/*! For license information please see project.js.LICENSE.txt */ (()=>{var e,t,n={87108:function(e,t,n){(function(){try{return"undefined"!=typeof self}catch(e){return!1}})()&&self,e.exports=(()=>{var e={470:e=>{"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",i=0,a=-1,o=0,s=0;s<=e.length;++s){if(s2){var l=r.lastIndexOf("/");if(l!==r.length-1){-1===l?(r="",i=0):i=(r=r.slice(0,l)).length-1-r.lastIndexOf("/"),a=s,o=0;continue}}else if(2===r.length||1===r.length){r="",i=0,a=s,o=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(a+1,s):r=e.slice(a+1,s),i=s-a-1;a=s,o=0}else 46===n&&-1!==o?++o:o=-1}return r}var r={resolve:function(){for(var e,r="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var o;a>=0?o=arguments[a]:(void 0===e&&(e=process.cwd()),o=e),t(o),0!==o.length&&(r=o+"/"+r,i=47===o.charCodeAt(0))}return r=n(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var i=1;iu){if(47===n.charCodeAt(s+d))return n.slice(s+d+1);if(0===d)return n.slice(s+d)}else o>u&&(47===e.charCodeAt(i+d)?c=d:0===d&&(c=0));break}var f=e.charCodeAt(i+d);if(f!==n.charCodeAt(s+d))break;47===f&&(c=d)}var h="";for(d=i+c+1;d<=a;++d)d!==a&&47!==e.charCodeAt(d)||(0===h.length?h+="..":h+="/..");return h.length>0?h+n.slice(s+c):(s+=c,47===n.charCodeAt(s)&&++s,n.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,i=-1,a=!0,o=e.length-1;o>=1;--o)if(47===(n=e.charCodeAt(o))){if(!a){i=o;break}}else a=!1;return-1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,i=0,a=-1,o=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var s=n.length-1,l=-1;for(r=e.length-1;r>=0;--r){var u=e.charCodeAt(r);if(47===u){if(!o){i=r+1;break}}else-1===l&&(o=!1,l=r+1),s>=0&&(u===n.charCodeAt(s)?-1==--s&&(a=r):(s=-1,a=l))}return i===a?a=l:-1===a&&(a=e.length),e.slice(i,a)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!o){i=r+1;break}}else-1===a&&(o=!1,a=r+1);return-1===a?"":e.slice(i,a)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,a=!0,o=0,s=e.length-1;s>=0;--s){var l=e.charCodeAt(s);if(47!==l)-1===i&&(a=!1,i=s+1),46===l?-1===n?n=s:1!==o&&(o=1):-1!==n&&(o=-1);else if(!a){r=s+1;break}}return-1===n||-1===i||0===o||1===o&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,i=e.charCodeAt(0),a=47===i;a?(n.root="/",r=1):r=0;for(var o=-1,s=0,l=-1,u=!0,c=e.length-1,d=0;c>=r;--c)if(47!==(i=e.charCodeAt(c)))-1===l&&(u=!1,l=c+1),46===i?-1===o?o=c:1!==d&&(d=1):-1!==o&&(d=-1);else if(!u){s=c+1;break}return-1===o||-1===l||0===d||1===d&&o===l-1&&o===s+1?-1!==l&&(n.base=n.name=0===s&&a?e.slice(1,l):e.slice(s,l)):(0===s&&a?(n.name=e.slice(1,o),n.base=e.slice(1,l)):(n.name=e.slice(s,o),n.base=e.slice(s,l)),n.ext=e.slice(o,l)),s>0?n.dir=e.slice(0,s-1):a&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r},590:e=>{var t="undefined"!=typeof Element,n="function"==typeof Map,r="function"==typeof Set,i="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function a(e,o){if(e===o)return!0;if(e&&o&&"object"==typeof e&&"object"==typeof o){if(e.constructor!==o.constructor)return!1;var s,l,u,c;if(Array.isArray(e)){if((s=e.length)!=o.length)return!1;for(l=s;0!=l--;)if(!a(e[l],o[l]))return!1;return!0}if(n&&e instanceof Map&&o instanceof Map){if(e.size!==o.size)return!1;for(c=e.entries();!(l=c.next()).done;)if(!o.has(l.value[0]))return!1;for(c=e.entries();!(l=c.next()).done;)if(!a(l.value[1],o.get(l.value[0])))return!1;return!0}if(r&&e instanceof Set&&o instanceof Set){if(e.size!==o.size)return!1;for(c=e.entries();!(l=c.next()).done;)if(!o.has(l.value[0]))return!1;return!0}if(i&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(o)){if((s=e.length)!=o.length)return!1;for(l=s;0!=l--;)if(e[l]!==o[l])return!1;return!0}if(e.constructor===RegExp)return e.source===o.source&&e.flags===o.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===o.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===o.toString();if((s=(u=Object.keys(e)).length)!==Object.keys(o).length)return!1;for(l=s;0!=l--;)if(!Object.prototype.hasOwnProperty.call(o,u[l]))return!1;if(t&&e instanceof Element)return!1;for(l=s;0!=l--;)if(("_owner"!==u[l]&&"__v"!==u[l]&&"__o"!==u[l]||!e.$$typeof)&&!a(e[u[l]],o[u[l]]))return!1;return!0}return e!=e&&o!=o}e.exports=function(e,t){try{return a(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}},338:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AllowedComponentsContainer:()=>O,ComponentMapping:()=>o.ComponentMapping,ComponentMappingContext:()=>_,Constants:()=>c,Container:()=>k,EditorContext:()=>g,MapTo:()=>E,ModelProvider:()=>A,Page:()=>P,ResponsiveGrid:()=>I,Utils:()=>p,withComponentMappingContext:()=>C,withEditable:()=>f,withEditorContext:()=>v,withMappable:()=>w,withModel:()=>m});const i=n(2784);var a=r.n(i);const o=n(25378);var s=r(590),l=r.n(s);const u=n(32005);class c{constructor(){}}c.DATA_PATH_ATTR="data-cq-data-path",c.DATA_CQ_RESOURCE_TYPE_ATTR="data-cq-resource-type",c.NEW_SECTION_CLASS_NAMES="new section",c._CONTAINER_CLASS_NAMES="aem-container",c._PLACEHOLDER_CLASS_NAMES="cq-placeholder",c._PAGE_CLASS_NAMES="aem-page",c._RESPONSIVE_GRID_PLACEHOLDER_CLASS_NAMES="aem-Grid-newComponent",c._WCM_MODE_META_SELECTOR='meta[property="cq:wcmmode"]',c.TYPE_PROP=u.Constants.TYPE_PROP,c.ITEMS_PROP=u.Constants.ITEMS_PROP,c.ITEMS_ORDER_PROP=u.Constants.ITEMS_ORDER_PROP,c.PATH_PROP=u.Constants.PATH_PROP,c.CHILDREN_PROP=u.Constants.CHILDREN_PROP,c.HIERARCHY_TYPE_PROP=u.Constants.HIERARCHY_TYPE_PROP,c.JCR_CONTENT=u.Constants.JCR_CONTENT;class d extends i.Component{constructor(e){super(e),this.state=this.propsToState(e)}propsToState(e){const{wrappedComponent:t,containerProps:n,editConfig:r,...i}=e;return i}componentDidUpdate(e){l()(e,this.props)||this.setState(this.propsToState(this.props))}get editProps(){const e={},t=this.props.componentProperties;return t.isInEditor?(e[c.DATA_PATH_ATTR]=t.cqPath,this.props.editConfig.resourceType&&(e[c.DATA_CQ_RESOURCE_TYPE_ATTR]=this.props.editConfig.resourceType),e):e}get emptyPlaceholderProps(){return this.useEmptyPlaceholder()?{className:c._PLACEHOLDER_CLASS_NAMES,"data-emptytext":this.props.editConfig.emptyLabel}:null}useEmptyPlaceholder(){return this.props.componentProperties.isInEditor&&"function"==typeof this.props.editConfig.isEmpty&&this.props.editConfig.isEmpty(this.props.componentProperties)}render(){const e=this.props.wrappedComponent;return a().createElement("div",Object.assign({},this.editProps,this.props.containerProps),a().createElement(e,Object.assign({},this.state)),a().createElement("div",Object.assign({},this.emptyPlaceholderProps)))}}function f(e,t){const n=t||{isEmpty:e=>!1};return class extends i.Component{render(){const t={...this.props,componentProperties:this.props,editConfig:n,wrappedComponent:e};return a().createElement(d,Object.assign({},t))}}}var h=r(470);const p={isInEditor:()=>[u.AEM_MODE.EDIT,u.AEM_MODE.PREVIEW].includes(function(){let e=null;if(u.PathUtils.isBrowser()){const t=document.head.querySelector(c._WCM_MODE_META_SELECTOR);e=null==t?void 0:t.getAttribute("content")}return e||u.AEM_MODE.DISABLED}()),modelToProps(e){const t=Object.getOwnPropertyNames(e),n={};return t.forEach((t=>{let r=t;r.startsWith(":")&&(r=function(e){const t=e.substr(1);return"cq"+t.substr(0,1).toUpperCase()+t.substr(1)}(r)),n[r]=e[t]})),n},getCQPath(e){const{pagePath:t="",itemPath:n="",injectPropsOnInit:r}=e;let{cqPath:i=""}=e;return r&&!i&&(i=(0,h.normalize)(n?`${t}/jcr:content/${n}`:t)),i}};class A extends i.Component{constructor(e){super(e),this.updateData=this.updateData.bind(this),this.state=this.propsToState(e)}propsToState(e){const{wrappedComponent:t,cqForceReload:n,injectPropsOnInit:r,...i}=e;return i}componentDidUpdate(e){l()(e,this.props)||this.setState(this.propsToState(this.props))}updateData(e){const{pagePath:t,itemPath:n,injectPropsOnInit:r}=this.props,i=e||this.props.cqPath||t&&p.getCQPath({pagePath:t,itemPath:n,injectPropsOnInit:r});i&&u.ModelManager.getData({path:i,forceReload:this.props.cqForceReload}).then((e=>{if(e&&Object.keys(e).length>0){const t=p.modelToProps(e);this.setState(t)}})).catch((e=>{console.log(e)}))}componentDidMount(){const{pagePath:e,itemPath:t,injectPropsOnInit:n}=this.props;let{cqPath:r}=this.props;r=p.getCQPath({pagePath:e,itemPath:t,injectPropsOnInit:n,cqPath:r}),this.setState({cqPath:r}),this.props.injectPropsOnInit&&this.updateData(r),u.ModelManager.addListener(r,this.updateData)}componentWillUnmount(){u.ModelManager.removeListener(this.props.cqPath,this.updateData)}render(){const e=this.props.wrappedComponent;return a().createElement(e,Object.assign({},this.state))}}const m=(e,t={})=>class extends i.Component{render(){const n=this.props.cqForceReload||t.forceReload||!1,r=t.injectPropsOnInit||!1;return a().createElement(A,Object.assign({},this.props,{cqForceReload:n,injectPropsOnInit:r,wrappedComponent:e}))}},g=a().createContext(p.isInEditor()),v=e=>t=>a().createElement(g.Consumer,null,(n=>a().createElement(e,Object.assign({},t,{isInEditor:n})))),y=o.ComponentMapping.map,b=o.ComponentMapping.get,w=(e,t,n)=>{const{injectPropsOnInit:r=!0,forceReload:i=!1,...a}=n||{},o={injectPropsOnInit:r,forceReload:i,...a};let s=e;return s=v(m(f(s,t),o)),s};o.ComponentMapping.map=function(e,t,n,r){const{injectPropsOnInit:i=!1,...a}=r||{},s=w(t,n,{injectPropsOnInit:i,...a});return y.call(o.ComponentMapping,e,s),s},o.ComponentMapping.get=b;const E=e=>(t,n)=>o.ComponentMapping.map(e,t,n),_=a().createContext(o.ComponentMapping);function C(e){return function(t){return a().createElement(_.Consumer,null,(n=>a().createElement(e,Object.assign({},t,{componentMapping:n}))))}}const x=n(32706);var S=r.n(x);class T extends i.Component{static get propTypes(){return{cqPath:S().string,placeholderClassNames:S().string}}constructor(e){super(e)}render(){return a().createElement("div",{"data-cq-data-path":this.props.cqPath+"/*",className:this.props.placeholderClassNames})}}class k extends i.Component{constructor(e){super(e),this.state={componentMapping:this.props.componentMapping||o.ComponentMapping}}get childComponents(){const e=[];return this.props.cqItems&&this.props.cqItemsOrder?(this.props.cqItemsOrder.map((t=>{const n=p.modelToProps(this.props.cqItems[t]);if(n){const r=this.state.componentMapping.get(n.cqType);r&&e.push(this.connectComponentWithItem(r,n,t))}})),e):e}connectComponentWithItem(e,t,n){const r=this.getItemPath(n);return a().createElement(e,Object.assign({},t,{key:r,cqPath:r,isInEditor:this.props.isInEditor,containerProps:this.getItemComponentProps(t,n,r)}))}getItemComponentProps(e,t,n){return{}}getItemPath(e){return this.props&&this.props.cqPath?this.props.cqPath+"/"+e:e}get containerProps(){const e={className:c._CONTAINER_CLASS_NAMES};return this.props.isInEditor&&(e[c.DATA_PATH_ATTR]=this.props.cqPath),e}get placeholderProps(){return{cqPath:this.props.cqPath,placeholderClassNames:c.NEW_SECTION_CLASS_NAMES}}get placeholderComponent(){return this.props.isInEditor?a().createElement(T,Object.assign({},this.placeholderProps)):null}render(){return a().createElement("div",Object.assign({},this.containerProps),this.childComponents,this.placeholderComponent)}}k.defaultProps={cqItems:{},cqItemsOrder:[],cqPath:""};class B extends i.Component{static get propTypes(){return{emptyLabel:S().string,path:S().string}}render(){const{path:e,emptyLabel:t}=this.props;return a().createElement("div",{"data-cq-data-path":e,"data-emptytext":t,className:"aem-AllowedComponent--component cq-placeholder placeholder"})}}class N extends i.Component{render(){const{components:e,placeholderProps:t,title:n,emptyLabel:r}=this.props,i=e&&e.length>0?n:r;return a().createElement("div",{className:"aem-AllowedComponent--list "+t.placeholderClassNames},a().createElement("div",{"data-text":i,className:"aem-AllowedComponent--title"}),e.map(((e,t)=>a().createElement(B,{key:t,path:e.path,emptyLabel:e.title}))))}}class O extends k{render(){const{allowedComponents:e,_allowedComponentPlaceholderListEmptyLabel:t,title:n,isInEditor:r}=this.props;if(r&&e&&e.applicable){const r=t||O.defaultProps._allowedComponentPlaceholderListEmptyLabel;if(t)return a().createElement(N,{title:n,emptyLabel:r,components:e.components,placeholderProps:this.placeholderProps,cqPath:this.props.cqPath})}return super.render()}}O.defaultProps={_allowedComponentPlaceholderListEmptyLabel:"No allowed components",cqItems:{},cqItemsOrder:[],cqPath:""};class P extends k{constructor(e){super(e),this.state={componentMapping:this.props.componentMapping||o.ComponentMapping}}get containerProps(){const e={className:c._PAGE_CLASS_NAMES};return this.props.isInEditor&&(e[c.DATA_PATH_ATTR]=this.props.cqPath),e}get childPages(){const e=[];return this.props.cqChildren?(Object.keys(this.props.cqChildren).map((t=>{const n=p.modelToProps(this.props.cqChildren[t]),r=this.state.componentMapping.get(n.cqType);r&&e.push(a().createElement(r,Object.assign({key:n.cqPath},n,{cqPath:n.cqPath})))})),e):e}getItemPath(e){return this.props&&this.props.cqPath?this.props.cqPath+"/"+c.JCR_CONTENT+"/"+e:e}render(){return a().createElement("div",Object.assign({},this.containerProps),this.childComponents,this.childPages)}}P.defaultProps={cqChildren:{},cqItems:{},cqItemsOrder:[],cqPath:""};class I extends O{get containerProps(){const e=super.containerProps;return e.className=(e.className||"")+" "+this.props.gridClassNames,e}get placeholderProps(){const e=super.placeholderProps;return e.placeholderClassNames=(e.placeholderClassNames||"")+" "+c._RESPONSIVE_GRID_PLACEHOLDER_CLASS_NAMES,e}getItemComponentProps(e,t,n){const r=super.getItemComponentProps(e,t,n);return r.className=r.className||"",r.className+=this.props.columnClassNames&&this.props.columnClassNames[t]?" "+this.props.columnClassNames[t]:"",r}}I.defaultProps={_allowedComponentPlaceholderListEmptyLabel:"No allowed components",cqItems:{},cqItemsOrder:[],cqPath:"",title:"Layout Container"},E("wcm/foundation/components/responsivegrid")(C(I),{isEmpty:e=>e.cqItemsOrder&&e.cqItemsOrder.length>0})}},t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}return r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(338)})()},25378:function(e){(function(){try{return"undefined"!=typeof self}catch(e){return!1}})()&&self,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";let r;n.r(t),n.d(t,"ComponentMapping",(function(){return i})),n.d(t,"MapTo",(function(){return a}));class i{constructor(){return r||(r=this),r}static get instance(){return new this}map(e,t){i.map(e,t)}static map(e,t){e&&t&&("string"==typeof e?[e]:e).forEach((e=>{this.mapping[e]=t}))}get(e){return i.get(e)}static get(e){return this.mapping[e]}}i.mapping={};const a=e=>t=>i.instance.map(e,t)}])},32005:function(e,t,n){(function(){try{return"undefined"!=typeof self}catch(e){return!1}})()&&self,e.exports=(()=>{"use strict";var e={470:e=>{function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",i=0,a=-1,o=0,s=0;s<=e.length;++s){if(s2){var l=r.lastIndexOf("/");if(l!==r.length-1){-1===l?(r="",i=0):i=(r=r.slice(0,l)).length-1-r.lastIndexOf("/"),a=s,o=0;continue}}else if(2===r.length||1===r.length){r="",i=0,a=s,o=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(a+1,s):r=e.slice(a+1,s),i=s-a-1;a=s,o=0}else 46===n&&-1!==o?++o:o=-1}return r}var r={resolve:function(){for(var e,r="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var o;a>=0?o=arguments[a]:(void 0===e&&(e=process.cwd()),o=e),t(o),0!==o.length&&(r=o+"/"+r,i=47===o.charCodeAt(0))}return r=n(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var i=1;iu){if(47===n.charCodeAt(s+d))return n.slice(s+d+1);if(0===d)return n.slice(s+d)}else o>u&&(47===e.charCodeAt(i+d)?c=d:0===d&&(c=0));break}var f=e.charCodeAt(i+d);if(f!==n.charCodeAt(s+d))break;47===f&&(c=d)}var h="";for(d=i+c+1;d<=a;++d)d!==a&&47!==e.charCodeAt(d)||(0===h.length?h+="..":h+="/..");return h.length>0?h+n.slice(s+c):(s+=c,47===n.charCodeAt(s)&&++s,n.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,i=-1,a=!0,o=e.length-1;o>=1;--o)if(47===(n=e.charCodeAt(o))){if(!a){i=o;break}}else a=!1;return-1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,i=0,a=-1,o=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var s=n.length-1,l=-1;for(r=e.length-1;r>=0;--r){var u=e.charCodeAt(r);if(47===u){if(!o){i=r+1;break}}else-1===l&&(o=!1,l=r+1),s>=0&&(u===n.charCodeAt(s)?-1==--s&&(a=r):(s=-1,a=l))}return i===a?a=l:-1===a&&(a=e.length),e.slice(i,a)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!o){i=r+1;break}}else-1===a&&(o=!1,a=r+1);return-1===a?"":e.slice(i,a)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,a=!0,o=0,s=e.length-1;s>=0;--s){var l=e.charCodeAt(s);if(47!==l)-1===i&&(a=!1,i=s+1),46===l?-1===n?n=s:1!==o&&(o=1):-1!==n&&(o=-1);else if(!a){r=s+1;break}}return-1===n||-1===i||0===o||1===o&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,i=e.charCodeAt(0),a=47===i;a?(n.root="/",r=1):r=0;for(var o=-1,s=0,l=-1,u=!0,c=e.length-1,d=0;c>=r;--c)if(47!==(i=e.charCodeAt(c)))-1===l&&(u=!1,l=c+1),46===i?-1===o?o=c:1!==d&&(d=1):-1!==o&&(d=-1);else if(!u){s=c+1;break}return-1===o||-1===l||0===d||1===d&&o===l-1&&o===s+1?-1!==l&&(n.base=n.name=0===s&&a?e.slice(1,l):e.slice(s,l)):(0===s&&a?(n.name=e.slice(1,o),n.base=e.slice(1,l)):(n.name=e.slice(s,o),n.base=e.slice(s,l)),n.ext=e.slice(o,l)),s>0?n.dir=e.slice(0,s-1):a&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r},873:(e,t,r)=>{r.r(t),r.d(t,{AEM_MODE:()=>u,Constants:()=>f,ModelClient:()=>x,ModelManager:()=>k,PathUtils:()=>E});class i{constructor(){}}i.PAGE_MODEL_INIT="cq-pagemodel-init",i.PAGE_MODEL_LOADED="cq-pagemodel-loaded",i.PAGE_MODEL_UPDATE="cq-pagemodel-update",i.PAGE_MODEL_ROUTE_CHANGED="cq-pagemodel-route-changed";const a=i;class o{constructor(){}}o.PAGE_MODEL_ROOT_URL="cq:pagemodel_root_url",o.PAGE_MODEL_ROUTE_FILTERS="cq:pagemodel_route_filters",o.PAGE_MODEL_ROUTER="cq:pagemodel_router",o.WCM_MODE="cq:wcmmode";const s=o;class l{constructor(){}}var u,c,d;l.TYPE_PROP=":type",l.ITEMS_PROP=":items",l.ITEMS_ORDER_PROP=":itemsOrder",l.PATH_PROP=":path",l.CHILDREN_PROP=":children",l.HIERARCHY_TYPE_PROP=":hierarchyType",l.JCR_CONTENT="jcr:content",l.STATE_AUTHORING="authoring",l.AEM_MODE_KEY="aemmode",l.EDITOR_CLIENTLIB_PATH="/etc.clientlibs/cq/gui/components/authoring/editors/clientlibs/internal/",l.AUTHORING_LIBRARIES=["page.js","page.css","pagemodel/messaging.js","messaging.js"],function(e){e.EDIT="edit",e.PREVIEW="preview",e.DISABLED="disabled"}(u||(u={})),function(e){e.JS="script",e.STYLESHEET="stylesheet"}(c||(c={})),function(e){e.SRC="src",e.HREF="href"}(d||(d={}));const f=l,h=n(58138);var p=r.n(h),A=r(470);const m=n(883);var g=r.n(m);class v{constructor(){}}v.DEFAULT_SLING_MODEL_SELECTOR="model",v.DEFAULT_MODEL_JSON_EXTENSION=`.${v.DEFAULT_SLING_MODEL_SELECTOR}.json`;const y=v,b=/(?:\/)(?:content|apps|libs|etc|etc.clientlibs|conf|mnt\/overlay)(?:\/)/,w=`(.+)/${f.JCR_CONTENT}/(.+)`;class E{static isBrowser(){return"undefined"!=typeof window}static getContextPath(e){const t=e||this.getCurrentPathname();if(!t)return"";const n=t.match(b),r=null===n?-1:n.index||-1;return r>0?t.slice(0,r):""}static adaptPagePath(e,t){if(!e)return"";const n=E.internalize(e);return t&&n===E.sanitize(t)?"":n}static externalize(e){const t=this.getContextPath();return e.startsWith(t)?e:`${t}${e}`}static internalize(e){if(!e||"string"!=typeof e)return"";const t=this.getContextPath();return e.replace(new RegExp(`^${t}/`),"/")}static getMetaPropertyValue(e){let t=null;if(this.isBrowser()){const n=document.head.querySelector(`meta[property="${e}"]`);t=n?n.getAttribute("content"):null}return t}static convertToModelUrl(e){return e&&e.replace&&e.replace(/\.htm(l)?$/,y.DEFAULT_MODEL_JSON_EXTENSION)}static getCurrentPageModelUrl(){const e=this.getCurrentPathname();let t=null;return e&&(t=this.convertToModelUrl(e)||null),t}static getModelUrl(e){return e&&e.replace?this.convertToModelUrl(e):this.getMetaPropertyValue(s.PAGE_MODEL_ROOT_URL)||this.getCurrentPageModelUrl()}static sanitize(e){if(!e||"string"!=typeof e)return null;let t=g().parse(e,!1,!0).pathname;if(t){t=this.internalize(t);const e=t.indexOf(".");e>-1&&(t=t.substr(0,e)),t=(0,A.normalize)(t)}return t}static addExtension(e,t){if(!t||t.length<1)return e;if(t.startsWith(".")||(t="."+t),!e||e.length<1||e.indexOf(t)>-1)return e;let n=e;const r=/^((?:[/a-zA-Z0-9:_-]*)+)(?:\.?)([a-zA-Z0-9._-]*)(?:\/?)([a-zA-Z0-9/._-]*)(?:\??)([a-zA-Z0-9=&]*)$/g.exec(e);let i="";return r&&r.length>2&&(i=r[3]?"/"+r[3]:"",i+=r[4]?"?"+r[4]:"",n=r[1]+"."+r[2].replace(/\.htm(l)?/,t)+i),n.indexOf(t)>-1?n:(n+t+i).replace(/\.\./g,".")}static addSelector(e,t){if(!t||t.length<1)return e;if(t.startsWith(".")||(t="."+t),!e||e.length<1||e.indexOf(t)>-1)return e;const n=e.indexOf(".")||e.length;return n<0?e+t:e.slice(0,n)+t+e.slice(n,e.length)}static getCurrentPathname(){return this.isBrowser()?window.location.pathname:null}static getCurrentURL(){return this.isBrowser()?window.location.href:""}static dispatchGlobalCustomEvent(e,t){this.isBrowser()&&window.dispatchEvent(new CustomEvent(e,t))}static join(e){return e?this.normalize(e.filter((e=>e)).join("/")):""}static normalize(e){return e?e.replace(/\/+/g,"/"):""}static makeAbsolute(e){return e&&"string"==typeof e?e.startsWith("/")?e:"/"+e:""}static makeRelative(e){return e&&"string"==typeof e?e.startsWith("/")?e.slice(1):e:""}static getParentNodePath(e){if(e&&e.length>0){const t=e.lastIndexOf("/")+1;if(t{let t=[];const r=E.normalize(E.makeAbsolute(e)+"/");n.forEach((n=>{if(t=t.concat(n.split(r)),n.endsWith(e)){const n=t.splice(t.length-1,1)[0];n!==e&&(t=t.concat(n.split(E.makeAbsolute(e))))}t=t.filter((e=>e))})),n=t})),n}static _getJCRPath(e,t){return[e,f.JCR_CONTENT,t].join("/")}static splitPageContentPaths(e){if(!e&&"string"!=typeof e)return;const t=e.split(`/${f.JCR_CONTENT}/`),n={pagePath:t[0]};return t.length>1&&(n.itemPath=t[1]),n}static trimStrings(e,t){return t.forEach((t=>{for(;e.startsWith(t);)e=E.makeRelative(e.slice(t.length));for(;e.endsWith(t);)(e=e.slice(0,e.length-t.length)).endsWith("/")&&(e=e.slice(0,e.length-1))})),e}static _getStartStrings(e,t){let n="";return t.forEach((t=>{for(;e.startsWith(t);)e=E.makeRelative(e.slice(t.length)),n=`${n}/${t}`})),E.makeRelative(n)}static toAEMPath(e,t,n){if(window.location.origin===t){const t="(/editor.html)?/content/"+n;if(e.indexOf(t)<0)return(0,A.normalize)(`${t}/${e}(.html)?`)}return e}}function _(e){E.dispatchGlobalCustomEvent(a.PAGE_MODEL_LOADED,{detail:{model:p()(e)}})}class C{constructor(e){this._modelManager=e,this._windowListener=e=>{e&&e.detail&&e.detail.msg?this._updateModel(e.detail.msg):console.error("EditorService.js","No message passed to cq-pagemodel-update",e)},E.isBrowser()&&window.addEventListener(a.PAGE_MODEL_UPDATE,this._windowListener)}_updateModel(e){if(!e||!e.cmd||!e.path)return void console.error("PageModelManager.js","Not enough data received to update the page model");const t=e.path,n=e.cmd,r=p()(e.data);let i,a,o;const s=E.getParentNodePath(t);switch(n){case"replace":this._modelManager.modelStore.setData(t,r),this._modelManager._notifyListeners(t);break;case"delete":this._modelManager.modelStore.removeData(t),s&&this._modelManager._notifyListeners(s);break;case"insertBefore":o=!0;case"insertAfter":i=E.getNodeName(t),s&&(a=s+"/"+r.key,this._modelManager.modelStore.insertData(a,r.value,i,o),this._modelManager._notifyListeners(s));break;default:console.log("EditorClient","unsupported command:",n)}_(this._modelManager.modelStore.dataMap)}destroy(){E.isBrowser()&&window.removeEventListener(a.PAGE_MODEL_UPDATE,this._windowListener)}}class x{constructor(e){this._apiHost=e||null}get apiHost(){return this._apiHost}fetch(e){if(!e){const t="Fetching model rejected for path: "+e;return Promise.reject(new Error(t))}const t=this._apiHost||"";return fetch(`${t}${e}`,{credentials:"same-origin"}).then((e=>{if(e.status>=200&&e.status<300)return e.json();throw{response:e}})).catch((e=>Promise.reject(e)))}destroy(){this._apiHost=null}}class S{constructor(e,t){this._data=null,this._rootPath=null,this._data={},e&&this.initialize(e,t||{}),this._pageContentDelimiter=[f.JCR_CONTENT]}initialize(e,t){t&&(this._data=t),this._rootPath=e}get rootPath(){return this._rootPath||""}get dataMap(){return this._data}setData(e,t={}){const n=E.getNodeName(e);if(n){const r=this.getData(E.getParentNodePath(e),!1);if(r&&r[f.ITEMS_PROP]){const e=p()(t),i=r[f.ITEMS_PROP]||{};i[n]&&Object.keys(i[n]).forEach((t=>e.value[t]=e.value[t]||"")),i[n]=e.value,r[f.ITEMS_PROP]=i}}}getData(e,t=!0){if(!e&&"string"!=typeof e)return t?p()(this._data):this._data;if(e===this._rootPath||e===`${this._rootPath}/${f.JCR_CONTENT}`)return t?p()(this._data):this._data;const n=E.splitPageContentPaths(e);if(n){const e=this._getPageData(n.pagePath);if(!e||!n.itemPath)return t?p()(e):e;const r=this._findItemData(n.itemPath,e);if(r)return t?p()(r.data):r.data}}insertData(e,t,n,r=!1){if(t=p()(t),!e)return void console.warn("No path provided for data: "+t);if(!E.isItem(e)&&this._data)return this._data[f.CHILDREN_PROP]||(this._data[f.CHILDREN_PROP]={}),void(this._data[f.CHILDREN_PROP][e]=t);const i=E.splitPageContentPaths(e);if(i&&i.itemPath){const e=this._getPageData(i.pagePath),a=this._findItemData(i.itemPath,e).parent||e||this._data,o=E.getNodeName(i.itemPath);if(null!=o&&a&&Object.prototype.hasOwnProperty.call(a,f.ITEMS_PROP)){const e=a[f.ITEMS_PROP];if(e){e[o]=t;const i=a[f.ITEMS_ORDER_PROP];if(null!=i&&i.length>0&&null!=n){const e=i.indexOf(n);e>-1?i.splice(r?e:e+1,0,o):i.push(o)}}}}}removeData(e){if(!e)return null;if(!E.isItem(e)&&this._data&&this._data[f.CHILDREN_PROP])return delete this._data[f.CHILDREN_PROP][e],null;const t=E.splitPageContentPaths(e);if(t&&t.itemPath){const e=this._getPageData(t.pagePath),n=this._findItemData(t.itemPath,e);if(n.data&&n&&n.parent&&Object.prototype.hasOwnProperty.call(n.parent,f.ITEMS_PROP)){const{parent:e}=n,r=e[f.ITEMS_PROP],i=E.getNodeName(t.itemPath);if(i){r&&delete r[i],delete n.data,delete n.parent;const t=e[f.ITEMS_ORDER_PROP];if(t&&t.length>0){const e=t.indexOf(i);t.splice(e,1)}return n.parentPath?n.parentPath:null}}}return console.warn(`Item for path ${e} was not found! Nothing to remove then.`),null}destroy(){this._data=null,this._rootPath=null,this._pageContentDelimiter=null}_findItemData(e,t=this._data,n=null,r=""){const i={parent:n,parentPath:r};if(!t)throw new Error("Assertion error: No data provided. This should never happen.");const a=t[f.ITEMS_PROP];if(!a)return i;for(const t in a){if(!Object.prototype.hasOwnProperty.call(a,t))continue;const n=a[t];if(t===e)return i.data=a[t],i.key=t,i;{let i=E.subpath(e,t);if(!this._pageContentDelimiter)throw new Error("_pageContentDelimiter not set. this should never happen as its set in constructor.");{const a=E._getStartStrings(i,this._pageContentDelimiter),o=E.join([r,t,a]);if(i=E.trimStrings(i,this._pageContentDelimiter),i!==e){const e=this._findItemData(i,n,n,o);if(e)return e}}}}return i}_getPageData(e){if(!this._data)return;if(""===e||e===this._data[f.PATH_PROP]||e===this.rootPath)return this._data;const t=this._data[f.CHILDREN_PROP];return t&&t[e]}}class T{constructor(e){this._apiDomain=e}getApiDomain(){return this._apiDomain}getTagsForState(e){let t="";return e===f.STATE_AUTHORING&&(t=this.generateClientLibUrls().map((e=>e.endsWith(".js")?this.generateElementString(c.JS,d.SRC,e):e.endsWith(".css")?this.generateElementString(c.STYLESHEET,d.HREF,e):void 0)).join("")),t}generateElementString(e,t,n){let r="";return e===c.JS?r=`