����JFIF��x�x����'403WebShell
403Webshell
Server IP : 78.140.185.180  /  Your IP : 3.141.107.132
Web Server : LiteSpeed
System : Linux cpanel13.v.fozzy.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User : builderbox ( 1072)
PHP Version : 7.3.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/builderbox/public_html/public/client/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/builderbox/public_html/public/client/244.c4283ff35da16788acfe.js
(self.webpackChunkcli=self.webpackChunkcli||[]).push([[244],{3461:(e,t,n)=>{"use strict";n.d(t,{Zt:()=>fe,Bh:()=>ge,pV:()=>me,Wj:()=>de,_t:()=>be,bA:()=>z});var i=n(7716),a=n(8583),s=n(3416),o=n(521),r=n(9490),l=n(7574),c=n(3637),d=n(6561);function u(e){const{subscriber:t,counter:n,period:i}=e;t.next(n),this.schedule({subscriber:t,counter:n+1,period:i},i)}var g=n(9765),p=n(5319),h=n(1927),m=n(6682),f=n(6782),_=n(9761),b=n(8002),v=n(5257),Z=n(3342),x=n(3190),A=n(946);function y(e,t){for(let n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function w(e,t){const n=t?"":"none";y(e.style,{touchAction:t?"":"none",webkitUserDrag:t?"":"none",webkitTapHighlightColor:t?"":"transparent",userSelect:n,msUserSelect:n,webkitUserSelect:n,MozUserSelect:n})}function C(e,t){const n=e.style;n.position=t?"":"fixed",n.top=n.opacity=t?"":"0",n.left=t?"":"-999em"}function T(e){const t=e.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(e)*t}function q(e,t){return e.getPropertyValue(t).split(",").map(e=>e.trim())}function k(e){const t=e.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}}function M(e,t,n){const{top:i,bottom:a,left:s,right:o}=e;return n>=i&&n<=a&&t>=s&&t<=o}function I(e,t,n){e.top+=t,e.bottom=e.top+e.height,e.left+=n,e.right=e.left+e.width}function U(e,t,n,i){const{top:a,right:s,bottom:o,left:r,width:l,height:c}=e,d=l*t,u=c*t;return i>a-u&&i<o+u&&n>r-d&&n<s+d}class J{constructor(e,t){this._document=e,this._viewportRuler=t,this.positions=new Map}clear(){this.positions.clear()}cache(e){this.clear(),this.positions.set(this._document,{scrollPosition:this._viewportRuler.getViewportScrollPosition()}),e.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:k(e)})})}handleScroll(e){const t=e.target,n=this.positions.get(t);if(!n)return null;const i=t===this._document?t.documentElement:t,a=n.scrollPosition;let s,o;if(t===this._document){const e=this._viewportRuler.getViewportScrollPosition();s=e.top,o=e.left}else s=t.scrollTop,o=t.scrollLeft;const r=a.top-s,l=a.left-o;return this.positions.forEach((e,n)=>{e.clientRect&&t!==n&&i.contains(n)&&I(e.clientRect,r,l)}),a.top=s,a.left=o,{top:r,left:l}}}function D(e){const t=e.cloneNode(!0),n=t.querySelectorAll("[id]"),i=e.nodeName.toLowerCase();t.removeAttribute("id");for(let a=0;a<n.length;a++)n[a].removeAttribute("id");return"canvas"===i?N(e,t):"input"!==i&&"select"!==i&&"textarea"!==i||S(e,t),O("canvas",e,t,N),O("input, textarea, select",e,t,S),t}function O(e,t,n,i){const a=t.querySelectorAll(e);if(a.length){const t=n.querySelectorAll(e);for(let e=0;e<a.length;e++)i(a[e],t[e])}}let P=0;function S(e,t){"file"!==t.type&&(t.value=e.value),"radio"===t.type&&t.name&&(t.name=`mat-clone-${t.name}-${P++}`)}function N(e,t){const n=t.getContext("2d");if(n)try{n.drawImage(e,0,0)}catch(i){}}const Q=(0,o.i$)({passive:!0}),Y=(0,o.i$)({passive:!1});class F{constructor(e,t,n,i,a,s){this._config=t,this._document=n,this._ngZone=i,this._viewportRuler=a,this._dragDropRegistry=s,this._passiveTransform={x:0,y:0},this._activeTransform={x:0,y:0},this._moveEvents=new g.xQ,this._pointerMoveSubscription=p.w.EMPTY,this._pointerUpSubscription=p.w.EMPTY,this._scrollSubscription=p.w.EMPTY,this._resizeSubscription=p.w.EMPTY,this._boundaryElement=null,this._nativeInteractionsEnabled=!0,this._handles=[],this._disabledHandles=new Set,this._direction="ltr",this.dragStartDelay=0,this._disabled=!1,this.beforeStarted=new g.xQ,this.started=new g.xQ,this.released=new g.xQ,this.ended=new g.xQ,this.entered=new g.xQ,this.exited=new g.xQ,this.dropped=new g.xQ,this.moved=this._moveEvents,this._pointerDown=e=>{if(this.beforeStarted.next(),this._handles.length){const t=this._handles.find(t=>{const n=e.target;return!!n&&(n===t||t.contains(n))});!t||this._disabledHandles.has(t)||this.disabled||this._initializeDragSequence(t,e)}else this.disabled||this._initializeDragSequence(this._rootElement,e)},this._pointerMove=e=>{const t=this._getPointerPositionOnPage(e);if(!this._hasStartedDragging){if(Math.abs(t.x-this._pickupPositionOnPage.x)+Math.abs(t.y-this._pickupPositionOnPage.y)>=this._config.dragStartThreshold){const t=Date.now()>=this._dragStartTime+this._getDragStartDelay(e),n=this._dropContainer;if(!t)return void this._endDragSequence(e);n&&(n.isDragging()||n.isReceiving())||(e.preventDefault(),this._hasStartedDragging=!0,this._ngZone.run(()=>this._startDragSequence(e)))}return}this._boundaryElement&&(this._previewRect&&(this._previewRect.width||this._previewRect.height)||(this._previewRect=(this._preview||this._rootElement).getBoundingClientRect())),e.preventDefault();const n=this._getConstrainedPointerPosition(t);if(this._hasMoved=!0,this._lastKnownPointerPosition=t,this._updatePointerDirectionDelta(n),this._dropContainer)this._updateActiveDropContainer(n,t);else{const e=this._activeTransform;e.x=n.x-this._pickupPositionOnPage.x+this._passiveTransform.x,e.y=n.y-this._pickupPositionOnPage.y+this._passiveTransform.y,this._applyRootElementTransform(e.x,e.y),"undefined"!=typeof SVGElement&&this._rootElement instanceof SVGElement&&this._rootElement.setAttribute("transform",`translate(${e.x} ${e.y})`)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:n,event:e,distance:this._getDragDistance(n),delta:this._pointerDirectionDelta})})},this._pointerUp=e=>{this._endDragSequence(e)},this.withRootElement(e).withParent(t.parentDragRef||null),this._parentPositions=new J(n,a),s.registerDragItem(this)}get disabled(){return this._disabled||!(!this._dropContainer||!this._dropContainer.disabled)}set disabled(e){const t=(0,r.Ig)(e);t!==this._disabled&&(this._disabled=t,this._toggleNativeDragInteractions(),this._handles.forEach(e=>w(e,t)))}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(e){this._handles=e.map(e=>(0,r.fI)(e)),this._handles.forEach(e=>w(e,this.disabled)),this._toggleNativeDragInteractions();const t=new Set;return this._disabledHandles.forEach(e=>{this._handles.indexOf(e)>-1&&t.add(e)}),this._disabledHandles=t,this}withPreviewTemplate(e){return this._previewTemplate=e,this}withPlaceholderTemplate(e){return this._placeholderTemplate=e,this}withRootElement(e){const t=(0,r.fI)(e);return t!==this._rootElement&&(this._rootElement&&this._removeRootElementListeners(this._rootElement),this._ngZone.runOutsideAngular(()=>{t.addEventListener("mousedown",this._pointerDown,Y),t.addEventListener("touchstart",this._pointerDown,Q)}),this._initialTransform=void 0,this._rootElement=t),"undefined"!=typeof SVGElement&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(e){return this._boundaryElement=e?(0,r.fI)(e):null,this._resizeSubscription.unsubscribe(),e&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(e){return this._parentDragRef=e,this}dispose(){this._removeRootElementListeners(this._rootElement),this.isDragging()&&L(this._rootElement),L(this._anchor),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeSubscriptions(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._anchor=this._parentDragRef=null}isDragging(){return this._hasStartedDragging&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}disableHandle(e){!this._disabledHandles.has(e)&&this._handles.indexOf(e)>-1&&(this._disabledHandles.add(e),w(e,!0))}enableHandle(e){this._disabledHandles.has(e)&&(this._disabledHandles.delete(e),w(e,this.disabled))}withDirection(e){return this._direction=e,this}_withDropContainer(e){this._dropContainer=e}getFreeDragPosition(){const e=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:e.x,y:e.y}}setFreeDragPosition(e){return this._activeTransform={x:0,y:0},this._passiveTransform.x=e.x,this._passiveTransform.y=e.y,this._dropContainer||this._applyRootElementTransform(e.x,e.y),this}_sortFromLastPointerPosition(){const e=this._lastKnownPointerPosition;e&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(e),e)}_removeSubscriptions(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe()}_destroyPreview(){this._preview&&L(this._preview),this._previewRef&&this._previewRef.destroy(),this._preview=this._previewRef=null}_destroyPlaceholder(){this._placeholder&&L(this._placeholder),this._placeholderRef&&this._placeholderRef.destroy(),this._placeholder=this._placeholderRef=null}_endDragSequence(e){this._dragDropRegistry.isDragging(this)&&(this._removeSubscriptions(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),this._hasStartedDragging&&(this.released.next({source:this}),this._dropContainer?(this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(e),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)})):(this._passiveTransform.x=this._activeTransform.x,this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(this._getPointerPositionOnPage(e))})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this))))}_startDragSequence(e){$(e)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();const t=this._dropContainer;if(t){const e=this._rootElement,n=e.parentNode,i=this._preview=this._createPreviewElement(),a=this._placeholder=this._createPlaceholderElement(),s=this._anchor=this._anchor||this._document.createComment(""),o=this._getShadowRoot();n.insertBefore(s,e),C(e,!1),this._document.body.appendChild(n.replaceChild(a,e)),function(e,t){return t||e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement||e.body}(this._document,o).appendChild(i),this.started.next({source:this}),t.start(),this._initialContainer=t,this._initialIndex=t.getItemIndex(this)}else this.started.next({source:this}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(t?t.getScrollableParents():[])}_initializeDragSequence(e,t){this._parentDragRef&&t.stopPropagation();const n=this.isDragging(),i=$(t),a=!i&&0!==t.button,s=this._rootElement,o=!i&&this._lastTouchEventTime&&this._lastTouchEventTime+800>Date.now();if(t.target&&t.target.draggable&&"mousedown"===t.type&&t.preventDefault(),n||a||o)return;this._handles.length&&(this._rootElementTapHighlight=s.style.webkitTapHighlightColor||"",s.style.webkitTapHighlightColor="transparent"),this._hasStartedDragging=this._hasMoved=!1,this._removeSubscriptions(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scroll.subscribe(e=>{this._updateOnScroll(e)}),this._boundaryElement&&(this._boundaryRect=k(this._boundaryElement));const r=this._previewTemplate;this._pickupPositionInElement=r&&r.template&&!r.matchSize?{x:0,y:0}:this._getPointerPositionInElement(e,t);const l=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(t);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:l.x,y:l.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,t)}_cleanupDragArtifacts(e){C(this._rootElement,!0),this._anchor.parentNode.replaceChild(this._rootElement,this._anchor),this._destroyPreview(),this._destroyPlaceholder(),this._boundaryRect=this._previewRect=void 0,this._ngZone.run(()=>{const t=this._dropContainer,n=t.getItemIndex(this),i=this._getPointerPositionOnPage(e),a=this._getDragDistance(this._getPointerPositionOnPage(e)),s=t._isOverContainer(i.x,i.y);this.ended.next({source:this,distance:a}),this.dropped.next({item:this,currentIndex:n,previousIndex:this._initialIndex,container:t,previousContainer:this._initialContainer,isPointerOverContainer:s,distance:a}),t.drop(this,n,this._initialIndex,this._initialContainer,s,a),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:e,y:t},{x:n,y:i}){let a=this._initialContainer._getSiblingContainerFromPosition(this,e,t);!a&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(e,t)&&(a=this._initialContainer),a&&a!==this._dropContainer&&this._ngZone.run(()=>{this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._dropContainer=a,this._dropContainer.enter(this,e,t,a===this._initialContainer&&a.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:a,currentIndex:a.getItemIndex(this)})}),this._dropContainer._startScrollingIfNecessary(n,i),this._dropContainer._sortItem(this,e,t,this._pointerDirectionDelta),this._preview.style.transform=R(e-this._pickupPositionInElement.x,t-this._pickupPositionInElement.y)}_createPreviewElement(){const e=this._previewTemplate,t=this.previewClass,n=e?e.template:null;let i;if(n&&e){const t=e.matchSize?this._rootElement.getBoundingClientRect():null,a=e.viewContainer.createEmbeddedView(n,e.context);a.detectChanges(),i=V(a,this._document),this._previewRef=a,e.matchSize?H(i,t):i.style.transform=R(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else{const e=this._rootElement;i=D(e),H(i,e.getBoundingClientRect())}return y(i.style,{pointerEvents:"none",margin:"0",position:"fixed",top:"0",left:"0",zIndex:`${this._config.zIndex||1e3}`}),w(i,!1),i.classList.add("cdk-drag-preview"),i.setAttribute("dir",this._direction),t&&(Array.isArray(t)?t.forEach(e=>i.classList.add(e)):i.classList.add(t)),i}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();const e=this._placeholder.getBoundingClientRect();this._preview.classList.add("cdk-drag-animating"),this._preview.style.transform=R(e.left,e.top);const t=function(e){const t=getComputedStyle(e),n=q(t,"transition-property"),i=n.find(e=>"transform"===e||"all"===e);if(!i)return 0;const a=n.indexOf(i),s=q(t,"transition-duration"),o=q(t,"transition-delay");return T(s[a])+T(o[a])}(this._preview);return 0===t?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(e=>{const n=t=>{(!t||t.target===this._preview&&"transform"===t.propertyName)&&(this._preview.removeEventListener("transitionend",n),e(),clearTimeout(i))},i=setTimeout(n,1.5*t);this._preview.addEventListener("transitionend",n)}))}_createPlaceholderElement(){const e=this._placeholderTemplate,t=e?e.template:null;let n;return t?(this._placeholderRef=e.viewContainer.createEmbeddedView(t,e.context),this._placeholderRef.detectChanges(),n=V(this._placeholderRef,this._document)):n=D(this._rootElement),n.classList.add("cdk-drag-placeholder"),n}_getPointerPositionInElement(e,t){const n=this._rootElement.getBoundingClientRect(),i=e===this._rootElement?null:e,a=i?i.getBoundingClientRect():n,s=$(t)?t.targetTouches[0]:t,o=this._getViewportScrollPosition();return{x:a.left-n.left+(s.pageX-a.left-o.left),y:a.top-n.top+(s.pageY-a.top-o.top)}}_getPointerPositionOnPage(e){const t=this._getViewportScrollPosition(),n=$(e)?e.touches[0]||e.changedTouches[0]||{pageX:0,pageY:0}:e,i=n.pageX-t.left,a=n.pageY-t.top;if(this._ownerSVGElement){const e=this._ownerSVGElement.getScreenCTM();if(e){const t=this._ownerSVGElement.createSVGPoint();return t.x=i,t.y=a,t.matrixTransform(e.inverse())}}return{x:i,y:a}}_getConstrainedPointerPosition(e){const t=this._dropContainer?this._dropContainer.lockAxis:null;let{x:n,y:i}=this.constrainPosition?this.constrainPosition(e,this):e;if("x"===this.lockAxis||"x"===t?i=this._pickupPositionOnPage.y:"y"!==this.lockAxis&&"y"!==t||(n=this._pickupPositionOnPage.x),this._boundaryRect){const{x:e,y:t}=this._pickupPositionInElement,a=this._boundaryRect,s=this._previewRect,o=a.top+t,r=a.bottom-(s.height-t);n=E(n,a.left+e,a.right-(s.width-e)),i=E(i,o,r)}return{x:n,y:i}}_updatePointerDirectionDelta(e){const{x:t,y:n}=e,i=this._pointerDirectionDelta,a=this._pointerPositionAtLastDirectionChange,s=Math.abs(t-a.x),o=Math.abs(n-a.y);return s>this._config.pointerDirectionChangeThreshold&&(i.x=t>a.x?1:-1,a.x=t),o>this._config.pointerDirectionChangeThreshold&&(i.y=n>a.y?1:-1,a.y=n),i}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;const e=this._handles.length>0||!this.isDragging();e!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=e,w(this._rootElement,e))}_removeRootElementListeners(e){e.removeEventListener("mousedown",this._pointerDown,Y),e.removeEventListener("touchstart",this._pointerDown,Q)}_applyRootElementTransform(e,t){const n=R(e,t);null==this._initialTransform&&(this._initialTransform=this._rootElement.style.transform||""),this._rootElement.style.transform=this._initialTransform?n+" "+this._initialTransform:n}_getDragDistance(e){const t=this._pickupPositionOnPage;return t?{x:e.x-t.x,y:e.y-t.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:e,y:t}=this._passiveTransform;if(0===e&&0===t||this.isDragging()||!this._boundaryElement)return;const n=this._boundaryElement.getBoundingClientRect(),i=this._rootElement.getBoundingClientRect();if(0===n.width&&0===n.height||0===i.width&&0===i.height)return;const a=n.left-i.left,s=i.right-n.right,o=n.top-i.top,r=i.bottom-n.bottom;n.width>i.width?(a>0&&(e+=a),s>0&&(e-=s)):e=0,n.height>i.height?(o>0&&(t+=o),r>0&&(t-=r)):t=0,e===this._passiveTransform.x&&t===this._passiveTransform.y||this.setFreeDragPosition({y:t,x:e})}_getDragStartDelay(e){const t=this.dragStartDelay;return"number"==typeof t?t:$(e)?t.touch:t?t.mouse:0}_updateOnScroll(e){const t=this._parentPositions.handleScroll(e);if(t){const n=e.target;this._boundaryRect&&(n===this._document||n!==this._boundaryElement&&n.contains(this._boundaryElement))&&I(this._boundaryRect,t.top,t.left),this._pickupPositionOnPage.x+=t.left,this._pickupPositionOnPage.y+=t.top,this._dropContainer||(this._activeTransform.x-=t.left,this._activeTransform.y-=t.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){const e=this._parentPositions.positions.get(this._document);return e?e.scrollPosition:this._viewportRuler.getViewportScrollPosition()}_getShadowRoot(){return void 0===this._cachedShadowRoot&&(this._cachedShadowRoot=(0,o.kV)(this._rootElement)),this._cachedShadowRoot}}function R(e,t){return`translate3d(${Math.round(e)}px, ${Math.round(t)}px, 0)`}function E(e,t,n){return Math.max(t,Math.min(n,e))}function L(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function $(e){return"t"===e.type[0]}function V(e,t){const n=e.rootNodes;if(1===n.length&&n[0].nodeType===t.ELEMENT_NODE)return n[0];const i=t.createElement("div");return n.forEach(e=>i.appendChild(e)),i}function H(e,t){e.style.width=`${t.width}px`,e.style.height=`${t.height}px`,e.style.transform=R(t.left,t.top)}function z(e,t,n){const i=B(t,e.length-1),a=B(n,e.length-1);if(i===a)return;const s=e[i],o=a<i?-1:1;for(let r=i;r!==a;r+=o)e[r]=e[r+o];e[a]=s}function B(e,t){return Math.max(0,Math.min(t,e))}class j{constructor(e,t,n,i,a){this._dragDropRegistry=t,this._ngZone=i,this._viewportRuler=a,this.disabled=!1,this.sortingDisabled=!1,this.autoScrollDisabled=!1,this.autoScrollStep=2,this.enterPredicate=()=>!0,this.sortPredicate=()=>!0,this.beforeStarted=new g.xQ,this.entered=new g.xQ,this.exited=new g.xQ,this.dropped=new g.xQ,this.sorted=new g.xQ,this._isDragging=!1,this._itemPositions=[],this._previousSwap={drag:null,delta:0,overlaps:!1},this._draggables=[],this._siblings=[],this._orientation="vertical",this._activeSiblings=new Set,this._direction="ltr",this._viewportScrollSubscription=p.w.EMPTY,this._verticalScrollDirection=0,this._horizontalScrollDirection=0,this._stopScrollTimers=new g.xQ,this._cachedShadowRoot=null,this._startScrollInterval=()=>{this._stopScrolling(),function(e=0,t=c.P){return(!(0,d.k)(e)||e<0)&&(e=0),t&&"function"==typeof t.schedule||(t=c.P),new l.y(n=>(n.add(t.schedule(u,e,{subscriber:n,counter:0,period:e})),n))}(0,h.Z).pipe((0,f.R)(this._stopScrollTimers)).subscribe(()=>{const e=this._scrollNode,t=this.autoScrollStep;1===this._verticalScrollDirection?X(e,-t):2===this._verticalScrollDirection&&X(e,t),1===this._horizontalScrollDirection?W(e,-t):2===this._horizontalScrollDirection&&W(e,t)})},this.element=(0,r.fI)(e),this._document=n,this.withScrollableParents([this.element]),t.registerDropContainer(this),this._parentPositions=new J(n,a)}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(e,t,n,i){let a;this._draggingStarted(),null==i?(a=this.sortingDisabled?this._draggables.indexOf(e):-1,-1===a&&(a=this._getItemIndexFromPointerPosition(e,t,n))):a=i;const s=this._activeDraggables,o=s.indexOf(e),l=e.getPlaceholderElement();let c=s[a];if(c===e&&(c=s[a+1]),o>-1&&s.splice(o,1),c&&!this._dragDropRegistry.isDragging(c)){const t=c.getRootElement();t.parentElement.insertBefore(l,t),s.splice(a,0,e)}else if(this._shouldEnterAsFirstChild(t,n)){const t=s[0].getRootElement();t.parentNode.insertBefore(l,t),s.unshift(e)}else(0,r.fI)(this.element).appendChild(l),s.push(e);l.style.transform="",this._cacheItemPositions(),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:e,container:this,currentIndex:this.getItemIndex(e)})}exit(e){this._reset(),this.exited.next({item:e,container:this})}drop(e,t,n,i,a,s){this._reset(),this.dropped.next({item:e,currentIndex:t,previousIndex:n,container:this,previousContainer:i,isPointerOverContainer:a,distance:s})}withItems(e){const t=this._draggables;return this._draggables=e,e.forEach(e=>e._withDropContainer(this)),this.isDragging()&&(t.filter(e=>e.isDragging()).every(t=>-1===e.indexOf(t))?this._reset():this._cacheItems()),this}withDirection(e){return this._direction=e,this}connectedTo(e){return this._siblings=e.slice(),this}withOrientation(e){return this._orientation=e,this}withScrollableParents(e){const t=(0,r.fI)(this.element);return this._scrollableElements=-1===e.indexOf(t)?[t,...e]:e.slice(),this}getScrollableParents(){return this._scrollableElements}getItemIndex(e){return this._isDragging?G("horizontal"===this._orientation&&"rtl"===this._direction?this._itemPositions.slice().reverse():this._itemPositions,t=>t.drag===e):this._draggables.indexOf(e)}isReceiving(){return this._activeSiblings.size>0}_sortItem(e,t,n,i){if(this.sortingDisabled||!this._clientRect||!U(this._clientRect,.05,t,n))return;const a=this._itemPositions,s=this._getItemIndexFromPointerPosition(e,t,n,i);if(-1===s&&a.length>0)return;const o="horizontal"===this._orientation,r=G(a,t=>t.drag===e),l=a[s],c=l.clientRect,d=r>s?1:-1,u=this._getItemOffsetPx(a[r].clientRect,c,d),g=this._getSiblingOffsetPx(r,a,d),p=a.slice();z(a,r,s),this.sorted.next({previousIndex:r,currentIndex:s,container:this,item:e}),a.forEach((t,n)=>{if(p[n]===t)return;const i=t.drag===e,a=i?u:g,s=i?e.getPlaceholderElement():t.drag.getRootElement();t.offset+=a,o?(s.style.transform=`translate3d(${Math.round(t.offset)}px, 0, 0)`,I(t.clientRect,0,a)):(s.style.transform=`translate3d(0, ${Math.round(t.offset)}px, 0)`,I(t.clientRect,a,0))}),this._previousSwap.overlaps=M(c,t,n),this._previousSwap.drag=l.drag,this._previousSwap.delta=o?i.x:i.y}_startScrollingIfNecessary(e,t){if(this.autoScrollDisabled)return;let n,i=0,a=0;if(this._parentPositions.positions.forEach((s,o)=>{o!==this._document&&s.clientRect&&!n&&U(s.clientRect,.05,e,t)&&([i,a]=function(e,t,n,i){const a=K(t,i),s=ee(t,n);let o=0,r=0;if(a){const t=e.scrollTop;1===a?t>0&&(o=1):e.scrollHeight-t>e.clientHeight&&(o=2)}if(s){const t=e.scrollLeft;1===s?t>0&&(r=1):e.scrollWidth-t>e.clientWidth&&(r=2)}return[o,r]}(o,s.clientRect,e,t),(i||a)&&(n=o))}),!i&&!a){const{width:s,height:o}=this._viewportRuler.getViewportSize(),r={width:s,height:o,top:0,right:s,bottom:o,left:0};i=K(r,t),a=ee(r,e),n=window}!n||i===this._verticalScrollDirection&&a===this._horizontalScrollDirection&&n===this._scrollNode||(this._verticalScrollDirection=i,this._horizontalScrollDirection=a,this._scrollNode=n,(i||a)&&n?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){const e=(0,r.fI)(this.element).style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=e.msScrollSnapType||e.scrollSnapType||"",e.scrollSnapType=e.msScrollSnapType="none",this._cacheItems(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){const e=(0,r.fI)(this.element);this._parentPositions.cache(this._scrollableElements),this._clientRect=this._parentPositions.positions.get(e).clientRect}_cacheItemPositions(){const e="horizontal"===this._orientation;this._itemPositions=this._activeDraggables.map(e=>{const t=e.getVisibleElement();return{drag:e,offset:0,clientRect:k(t)}}).sort((t,n)=>e?t.clientRect.left-n.clientRect.left:t.clientRect.top-n.clientRect.top)}_reset(){this._isDragging=!1;const e=(0,r.fI)(this.element).style;e.scrollSnapType=e.msScrollSnapType=this._initialScrollSnap,this._activeDraggables.forEach(e=>{const t=e.getRootElement();t&&(t.style.transform="")}),this._siblings.forEach(e=>e._stopReceiving(this)),this._activeDraggables=[],this._itemPositions=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1,this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_getSiblingOffsetPx(e,t,n){const i="horizontal"===this._orientation,a=t[e].clientRect,s=t[e+-1*n];let o=a[i?"width":"height"]*n;if(s){const e=i?"left":"top",t=i?"right":"bottom";-1===n?o-=s.clientRect[e]-a[t]:o+=a[e]-s.clientRect[t]}return o}_getItemOffsetPx(e,t,n){const i="horizontal"===this._orientation;let a=i?t.left-e.left:t.top-e.top;return-1===n&&(a+=i?t.width-e.width:t.height-e.height),a}_shouldEnterAsFirstChild(e,t){if(!this._activeDraggables.length)return!1;const n=this._itemPositions,i="horizontal"===this._orientation;if(n[0].drag!==this._activeDraggables[0]){const a=n[n.length-1].clientRect;return i?e>=a.right:t>=a.bottom}{const a=n[0].clientRect;return i?e<=a.left:t<=a.top}}_getItemIndexFromPointerPosition(e,t,n,i){const a="horizontal"===this._orientation,s=G(this._itemPositions,({drag:s,clientRect:o},r,l)=>{if(s===e)return l.length<2;if(i){const e=a?i.x:i.y;if(s===this._previousSwap.drag&&this._previousSwap.overlaps&&e===this._previousSwap.delta)return!1}return a?t>=Math.floor(o.left)&&t<Math.floor(o.right):n>=Math.floor(o.top)&&n<Math.floor(o.bottom)});return-1!==s&&this.sortPredicate(s,e,this)?s:-1}_cacheItems(){this._activeDraggables=this._draggables.slice(),this._cacheItemPositions(),this._cacheParentPositions()}_isOverContainer(e,t){return null!=this._clientRect&&M(this._clientRect,e,t)}_getSiblingContainerFromPosition(e,t,n){return this._siblings.find(i=>i._canReceive(e,t,n))}_canReceive(e,t,n){if(!this._clientRect||!M(this._clientRect,t,n)||!this.enterPredicate(e,this))return!1;const i=this._getShadowRoot().elementFromPoint(t,n);if(!i)return!1;const a=(0,r.fI)(this.element);return i===a||a.contains(i)}_startReceiving(e,t){const n=this._activeSiblings;!n.has(e)&&t.every(e=>this.enterPredicate(e,this)||this._draggables.indexOf(e)>-1)&&(n.add(e),this._cacheParentPositions(),this._listenToScrollEvents())}_stopReceiving(e){this._activeSiblings.delete(e),this._viewportScrollSubscription.unsubscribe()}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scroll.subscribe(e=>{if(this.isDragging()){const t=this._parentPositions.handleScroll(e);t&&(this._itemPositions.forEach(({clientRect:e})=>{I(e,t.top,t.left)}),this._itemPositions.forEach(({drag:e})=>{this._dragDropRegistry.isDragging(e)&&e._sortFromLastPointerPosition()}))}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){const e=(0,o.kV)((0,r.fI)(this.element));this._cachedShadowRoot=e||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){const e=this._activeDraggables.filter(e=>e.isDragging());this._siblings.forEach(t=>t._startReceiving(this,e))}}function G(e,t){for(let n=0;n<e.length;n++)if(t(e[n],n,e))return n;return-1}function X(e,t){e===window?e.scrollBy(0,t):e.scrollTop+=t}function W(e,t){e===window?e.scrollBy(t,0):e.scrollLeft+=t}function K(e,t){const{top:n,bottom:i,height:a}=e,s=.05*a;return t>=n-s&&t<=n+s?1:t>=i-s&&t<=i+s?2:0}function ee(e,t){const{left:n,right:i,width:a}=e,s=.05*a;return t>=n-s&&t<=n+s?1:t>=i-s&&t<=i+s?2:0}const te=(0,o.i$)({passive:!1,capture:!0});let ne=(()=>{class e{constructor(e,t){this._ngZone=e,this._dropInstances=new Set,this._dragInstances=new Set,this._activeDragInstances=[],this._globalListeners=new Map,this._draggingPredicate=e=>e.isDragging(),this.pointerMove=new g.xQ,this.pointerUp=new g.xQ,this.scroll=new g.xQ,this._preventDefaultWhileDragging=e=>{this._activeDragInstances.length>0&&e.preventDefault()},this._persistentTouchmoveListener=e=>{this._activeDragInstances.length>0&&(this._activeDragInstances.some(this._draggingPredicate)&&e.preventDefault(),this.pointerMove.next(e))},this._document=t}registerDropContainer(e){this._dropInstances.has(e)||this._dropInstances.add(e)}registerDragItem(e){this._dragInstances.add(e),1===this._dragInstances.size&&this._ngZone.runOutsideAngular(()=>{this._document.addEventListener("touchmove",this._persistentTouchmoveListener,te)})}removeDropContainer(e){this._dropInstances.delete(e)}removeDragItem(e){this._dragInstances.delete(e),this.stopDragging(e),0===this._dragInstances.size&&this._document.removeEventListener("touchmove",this._persistentTouchmoveListener,te)}startDragging(e,t){if(!(this._activeDragInstances.indexOf(e)>-1)&&(this._activeDragInstances.push(e),1===this._activeDragInstances.length)){const e=t.type.startsWith("touch");this._globalListeners.set(e?"touchend":"mouseup",{handler:e=>this.pointerUp.next(e),options:!0}).set("scroll",{handler:e=>this.scroll.next(e),options:!0}).set("selectstart",{handler:this._preventDefaultWhileDragging,options:te}),e||this._globalListeners.set("mousemove",{handler:e=>this.pointerMove.next(e),options:te}),this._ngZone.runOutsideAngular(()=>{this._globalListeners.forEach((e,t)=>{this._document.addEventListener(t,e.handler,e.options)})})}}stopDragging(e){const t=this._activeDragInstances.indexOf(e);t>-1&&(this._activeDragInstances.splice(t,1),0===this._activeDragInstances.length&&this._clearGlobalListeners())}isDragging(e){return this._activeDragInstances.indexOf(e)>-1}ngOnDestroy(){this._dragInstances.forEach(e=>this.removeDragItem(e)),this._dropInstances.forEach(e=>this.removeDropContainer(e)),this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_clearGlobalListeners(){this._globalListeners.forEach((e,t)=>{this._document.removeEventListener(t,e.handler,e.options)}),this._globalListeners.clear()}}return e.\u0275fac=function(t){return new(t||e)(i.LFG(i.R0b),i.LFG(a.K0))},e.\u0275prov=(0,i.Yz7)({factory:function(){return new e((0,i.LFG)(i.R0b),(0,i.LFG)(a.K0))},token:e,providedIn:"root"}),e})();const ie={dragStartThreshold:5,pointerDirectionChangeThreshold:5};let ae=(()=>{class e{constructor(e,t,n,i){this._document=e,this._ngZone=t,this._viewportRuler=n,this._dragDropRegistry=i}createDrag(e,t=ie){return new F(e,t,this._document,this._ngZone,this._viewportRuler,this._dragDropRegistry)}createDropList(e){return new j(e,this._dragDropRegistry,this._document,this._ngZone,this._viewportRuler)}}return e.\u0275fac=function(t){return new(t||e)(i.LFG(a.K0),i.LFG(i.R0b),i.LFG(s.rL),i.LFG(ne))},e.\u0275prov=(0,i.Yz7)({factory:function(){return new e((0,i.LFG)(a.K0),(0,i.LFG)(i.R0b),(0,i.LFG)(s.rL),(0,i.LFG)(ne))},token:e,providedIn:"root"}),e})();const se=new i.OlP("CDK_DRAG_PARENT"),oe=new i.OlP("CdkDropListGroup"),re=new i.OlP("CDK_DRAG_CONFIG");let le=0;const ce=new i.OlP("CdkDropList");let de=(()=>{class e{constructor(t,n,a,s,o,r,l){this.element=t,this._changeDetectorRef=a,this._scrollDispatcher=s,this._dir=o,this._group=r,this._destroyed=new g.xQ,this.connectedTo=[],this.id="cdk-drop-list-"+le++,this.enterPredicate=()=>!0,this.sortPredicate=()=>!0,this.dropped=new i.vpe,this.entered=new i.vpe,this.exited=new i.vpe,this.sorted=new i.vpe,this._unsortedItems=new Set,this._dropListRef=n.createDropList(t),this._dropListRef.data=this,l&&this._assignDefaults(l),this._dropListRef.enterPredicate=(e,t)=>this.enterPredicate(e.data,t.data),this._dropListRef.sortPredicate=(e,t,n)=>this.sortPredicate(e,t.data,n.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),e._dropLists.push(this),r&&r._items.add(this)}get disabled(){return this._disabled||!!this._group&&this._group.disabled}set disabled(e){this._dropListRef.disabled=this._disabled=(0,r.Ig)(e)}addItem(e){this._unsortedItems.add(e),this._dropListRef.isDragging()&&this._syncItemsWithRef()}removeItem(e){this._unsortedItems.delete(e),this._dropListRef.isDragging()&&this._syncItemsWithRef()}getSortedItems(){return Array.from(this._unsortedItems).sort((e,t)=>e._dragRef.getVisibleElement().compareDocumentPosition(t._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}ngOnDestroy(){const t=e._dropLists.indexOf(this);t>-1&&e._dropLists.splice(t,1),this._group&&this._group._items.delete(this),this._unsortedItems.clear(),this._dropListRef.dispose(),this._destroyed.next(),this._destroyed.complete()}_setupInputSyncSubscription(t){this._dir&&this._dir.change.pipe((0,_.O)(this._dir.value),(0,f.R)(this._destroyed)).subscribe(e=>t.withDirection(e)),t.beforeStarted.subscribe(()=>{const n=(0,r.Eq)(this.connectedTo).map(t=>"string"==typeof t?e._dropLists.find(e=>e.id===t):t);if(this._group&&this._group._items.forEach(e=>{-1===n.indexOf(e)&&n.push(e)}),!this._scrollableParentsResolved){const e=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(e=>e.getElementRef().nativeElement);this._dropListRef.withScrollableParents(e),this._scrollableParentsResolved=!0}t.disabled=this.disabled,t.lockAxis=this.lockAxis,t.sortingDisabled=(0,r.Ig)(this.sortingDisabled),t.autoScrollDisabled=(0,r.Ig)(this.autoScrollDisabled),t.autoScrollStep=(0,r.su)(this.autoScrollStep,2),t.connectedTo(n.filter(e=>e&&e!==this).map(e=>e._dropListRef)).withOrientation(this.orientation)})}_handleEvents(e){e.beforeStarted.subscribe(()=>{this._syncItemsWithRef(),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(e=>{this.entered.emit({container:this,item:e.item.data,currentIndex:e.currentIndex})}),e.exited.subscribe(e=>{this.exited.emit({container:this,item:e.item.data}),this._changeDetectorRef.markForCheck()}),e.sorted.subscribe(e=>{this.sorted.emit({previousIndex:e.previousIndex,currentIndex:e.currentIndex,container:this,item:e.item.data})}),e.dropped.subscribe(e=>{this.dropped.emit({previousIndex:e.previousIndex,currentIndex:e.currentIndex,previousContainer:e.previousContainer.data,container:e.container.data,item:e.item.data,isPointerOverContainer:e.isPointerOverContainer,distance:e.distance}),this._changeDetectorRef.markForCheck()})}_assignDefaults(e){const{lockAxis:t,draggingDisabled:n,sortingDisabled:i,listAutoScrollDisabled:a,listOrientation:s}=e;this.disabled=null!=n&&n,this.sortingDisabled=null!=i&&i,this.autoScrollDisabled=null!=a&&a,this.orientation=s||"vertical",t&&(this.lockAxis=t)}_syncItemsWithRef(){this._dropListRef.withItems(this.getSortedItems().map(e=>e._dragRef))}}return e.\u0275fac=function(t){return new(t||e)(i.Y36(i.SBq),i.Y36(ae),i.Y36(i.sBO),i.Y36(s.mF),i.Y36(A.Is,8),i.Y36(oe,12),i.Y36(re,8))},e.\u0275dir=i.lG2({type:e,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(e,t){2&e&&(i.uIk("id",t.id),i.ekj("cdk-drop-list-disabled",t.disabled)("cdk-drop-list-dragging",t._dropListRef.isDragging())("cdk-drop-list-receiving",t._dropListRef.isReceiving()))},inputs:{connectedTo:["cdkDropListConnectedTo","connectedTo"],id:"id",enterPredicate:["cdkDropListEnterPredicate","enterPredicate"],sortPredicate:["cdkDropListSortPredicate","sortPredicate"],disabled:["cdkDropListDisabled","disabled"],sortingDisabled:["cdkDropListSortingDisabled","sortingDisabled"],autoScrollDisabled:["cdkDropListAutoScrollDisabled","autoScrollDisabled"],orientation:["cdkDropListOrientation","orientation"],lockAxis:["cdkDropListLockAxis","lockAxis"],data:["cdkDropListData","data"],autoScrollStep:["cdkDropListAutoScrollStep","autoScrollStep"]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],features:[i._Bn([{provide:oe,useValue:void 0},{provide:ce,useExisting:e}])]}),e._dropLists=[],e})();const ue=new i.OlP("CdkDragHandle");let ge=(()=>{class e{constructor(e,t){this.element=e,this._stateChanges=new g.xQ,this._disabled=!1,this._parentDrag=t}get disabled(){return this._disabled}set disabled(e){this._disabled=(0,r.Ig)(e),this._stateChanges.next(this)}ngOnDestroy(){this._stateChanges.complete()}}return e.\u0275fac=function(t){return new(t||e)(i.Y36(i.SBq),i.Y36(se,12))},e.\u0275dir=i.lG2({type:e,selectors:[["","cdkDragHandle",""]],hostAttrs:[1,"cdk-drag-handle"],inputs:{disabled:["cdkDragHandleDisabled","disabled"]},features:[i._Bn([{provide:ue,useExisting:e}])]}),e})();const pe=new i.OlP("CdkDragPlaceholder"),he=new i.OlP("CdkDragPreview");let me=(()=>{class e{constructor(e){this.templateRef=e,this._matchSize=!1}get matchSize(){return this._matchSize}set matchSize(e){this._matchSize=(0,r.Ig)(e)}}return e.\u0275fac=function(t){return new(t||e)(i.Y36(i.Rgc))},e.\u0275dir=i.lG2({type:e,selectors:[["ng-template","cdkDragPreview",""]],inputs:{matchSize:"matchSize",data:"data"},features:[i._Bn([{provide:he,useExisting:e}])]}),e})(),fe=(()=>{class e{constructor(t,n,a,s,o,r,c,d,u,p,h){this.element=t,this.dropContainer=n,this._ngZone=s,this._viewContainerRef=o,this._dir=c,this._changeDetectorRef=u,this._selfHandle=p,this._parentDrag=h,this._destroyed=new g.xQ,this.started=new i.vpe,this.released=new i.vpe,this.ended=new i.vpe,this.entered=new i.vpe,this.exited=new i.vpe,this.dropped=new i.vpe,this.moved=new l.y(e=>{const t=this._dragRef.moved.pipe((0,b.U)(e=>({source:this,pointerPosition:e.pointerPosition,event:e.event,delta:e.delta,distance:e.distance}))).subscribe(e);return()=>{t.unsubscribe()}}),this._dragRef=d.createDrag(t,{dragStartThreshold:r&&null!=r.dragStartThreshold?r.dragStartThreshold:5,pointerDirectionChangeThreshold:r&&null!=r.pointerDirectionChangeThreshold?r.pointerDirectionChangeThreshold:5,zIndex:null==r?void 0:r.zIndex}),this._dragRef.data=this,e._dragInstances.push(this),r&&this._assignDefaults(r),n&&(this._dragRef._withDropContainer(n._dropListRef),n.addItem(this)),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef)}get disabled(){return this._disabled||this.dropContainer&&this.dropContainer.disabled}set disabled(e){this._disabled=(0,r.Ig)(e),this._dragRef.disabled=this._disabled}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset()}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}ngAfterViewInit(){this._ngZone.onStable.pipe((0,v.q)(1),(0,f.R)(this._destroyed)).subscribe(()=>{this._updateRootElement(),this._handles.changes.pipe((0,_.O)(this._handles),(0,Z.b)(e=>{const t=e.filter(e=>e._parentDrag===this).map(e=>e.element);this._selfHandle&&this.rootElementSelector&&t.push(this.element),this._dragRef.withHandles(t)}),(0,x.w)(e=>(0,m.T)(...e.map(e=>e._stateChanges.pipe((0,_.O)(e))))),(0,f.R)(this._destroyed)).subscribe(e=>{const t=this._dragRef,n=e.element.nativeElement;e.disabled?t.disableHandle(n):t.enableHandle(n)}),this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)})}ngOnChanges(e){const t=e.rootElementSelector,n=e.freeDragPosition;t&&!t.firstChange&&this._updateRootElement(),n&&!n.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this);const t=e._dragInstances.indexOf(this);t>-1&&e._dragInstances.splice(t,1),this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose()}_updateRootElement(){const e=this.element.nativeElement,t=this.rootElementSelector?_e(e,this.rootElementSelector):e;this._dragRef.withRootElement(t||e)}_getBoundaryElement(){const e=this.boundaryElement;return e?"string"==typeof e?_e(this.element.nativeElement,e):(0,r.fI)(e):null}_syncInputs(t){t.beforeStarted.subscribe(()=>{if(!t.isDragging()){const e=this._dir,n=this.dragStartDelay,i=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,a=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;t.disabled=this.disabled,t.lockAxis=this.lockAxis,t.dragStartDelay="object"==typeof n&&n?n:(0,r.su)(n),t.constrainPosition=this.constrainPosition,t.previewClass=this.previewClass,t.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(i).withPreviewTemplate(a),e&&t.withDirection(e.value)}}),t.beforeStarted.pipe((0,v.q)(1)).subscribe(()=>{var n,i;if(this._parentDrag)return void t.withParent(this._parentDrag._dragRef);let a=this.element.nativeElement.parentElement;for(;a;){if(null===(n=a.classList)||void 0===n?void 0:n.contains("cdk-drag")){t.withParent((null===(i=e._dragInstances.find(e=>e.element.nativeElement===a))||void 0===i?void 0:i._dragRef)||null);break}a=a.parentElement}})}_handleEvents(e){e.started.subscribe(()=>{this.started.emit({source:this}),this._changeDetectorRef.markForCheck()}),e.released.subscribe(()=>{this.released.emit({source:this})}),e.ended.subscribe(e=>{this.ended.emit({source:this,distance:e.distance}),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(e=>{this.entered.emit({container:e.container.data,item:this,currentIndex:e.currentIndex})}),e.exited.subscribe(e=>{this.exited.emit({container:e.container.data,item:this})}),e.dropped.subscribe(e=>{this.dropped.emit({previousIndex:e.previousIndex,currentIndex:e.currentIndex,previousContainer:e.previousContainer.data,container:e.container.data,isPointerOverContainer:e.isPointerOverContainer,item:this,distance:e.distance})})}_assignDefaults(e){const{lockAxis:t,dragStartDelay:n,constrainPosition:i,previewClass:a,boundaryElement:s,draggingDisabled:o,rootElementSelector:r}=e;this.disabled=null!=o&&o,this.dragStartDelay=n||0,t&&(this.lockAxis=t),i&&(this.constrainPosition=i),a&&(this.previewClass=a),s&&(this.boundaryElement=s),r&&(this.rootElementSelector=r)}}return e.\u0275fac=function(t){return new(t||e)(i.Y36(i.SBq),i.Y36(ce,12),i.Y36(a.K0),i.Y36(i.R0b),i.Y36(i.s_b),i.Y36(re,8),i.Y36(A.Is,8),i.Y36(ae),i.Y36(i.sBO),i.Y36(ue,10),i.Y36(se,12))},e.\u0275dir=i.lG2({type:e,selectors:[["","cdkDrag",""]],contentQueries:function(e,t,n){if(1&e&&(i.Suo(n,he,5),i.Suo(n,pe,5),i.Suo(n,ue,5)),2&e){let e;i.iGM(e=i.CRH())&&(t._previewTemplate=e.first),i.iGM(e=i.CRH())&&(t._placeholderTemplate=e.first),i.iGM(e=i.CRH())&&(t._handles=e)}},hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(e,t){2&e&&i.ekj("cdk-drag-disabled",t.disabled)("cdk-drag-dragging",t._dragRef.isDragging())},inputs:{disabled:["cdkDragDisabled","disabled"],dragStartDelay:["cdkDragStartDelay","dragStartDelay"],lockAxis:["cdkDragLockAxis","lockAxis"],constrainPosition:["cdkDragConstrainPosition","constrainPosition"],previewClass:["cdkDragPreviewClass","previewClass"],boundaryElement:["cdkDragBoundary","boundaryElement"],rootElementSelector:["cdkDragRootElement","rootElementSelector"],data:["cdkDragData","data"],freeDragPosition:["cdkDragFreeDragPosition","freeDragPosition"]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[i._Bn([{provide:se,useExisting:e}]),i.TTD]}),e._dragInstances=[],e})();function _e(e,t){let n=e.parentElement;for(;n;){if(n.matches?n.matches(t):n.msMatchesSelector(t))return n;n=n.parentElement}return null}let be=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=i.oAB({type:e}),e.\u0275inj=i.cJS({providers:[ae],imports:[s.ZD]}),e})()},171:(e,t,n)=>{"use strict";n.d(t,{pp:()=>$,To:()=>V,ib:()=>F,VG:()=>R,yz:()=>E,yK:()=>L});var i=n(7716),a=n(9490),s=n(9765),o=n(5319),r=n(8345);let l=0;const c=new i.OlP("CdkAccordion");let d=(()=>{class e{constructor(){this._stateChanges=new s.xQ,this._openCloseAllActions=new s.xQ,this.id="cdk-accordion-"+l++,this._multi=!1}get multi(){return this._multi}set multi(e){this._multi=(0,a.Ig)(e)}openAll(){this._multi&&this._openCloseAllActions.next(!0)}closeAll(){this._openCloseAllActions.next(!1)}ngOnChanges(e){this._stateChanges.next(e)}ngOnDestroy(){this._stateChanges.complete(),this._openCloseAllActions.complete()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.lG2({type:e,selectors:[["cdk-accordion"],["","cdkAccordion",""]],inputs:{multi:"multi"},exportAs:["cdkAccordion"],features:[i._Bn([{provide:c,useExisting:e}]),i.TTD]}),e})(),u=0,g=(()=>{class e{constructor(e,t,n){this.accordion=e,this._changeDetectorRef=t,this._expansionDispatcher=n,this._openCloseAllSubscription=o.w.EMPTY,this.closed=new i.vpe,this.opened=new i.vpe,this.destroyed=new i.vpe,this.expandedChange=new i.vpe,this.id="cdk-accordion-child-"+u++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=n.listen((e,t)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===t&&this.id!==e&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(e){e=(0,a.Ig)(e),this._expanded!==e&&(this._expanded=e,this.expandedChange.emit(e),e?(this.opened.emit(),this._expansionDispatcher.notify(this.id,this.accordion?this.accordion.id:this.id)):this.closed.emit(),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled}set disabled(e){this._disabled=(0,a.Ig)(e)}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}toggle(){this.disabled||(this.expanded=!this.expanded)}close(){this.disabled||(this.expanded=!1)}open(){this.disabled||(this.expanded=!0)}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(e=>{this.disabled||(this.expanded=e)})}}return e.\u0275fac=function(t){return new(t||e)(i.Y36(c,12),i.Y36(i.sBO),i.Y36(r.A8))},e.\u0275dir=i.lG2({type:e,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[i._Bn([{provide:c,useValue:void 0}])]}),e})(),p=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=i.oAB({type:e}),e.\u0275inj=i.cJS({}),e})();var h=n(7636),m=n(8583),f=n(2458),_=n(9238),b=n(7519),v=n(9761),Z=n(5435),x=n(5257),A=n(6461),y=n(6237),w=n(9193),C=n(6682),T=n(7238);const q=["body"];function k(e,t){}const M=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],I=["mat-expansion-panel-header","*","mat-action-row"];function U(e,t){if(1&e&&i._UZ(0,"span",2),2&e){const e=i.oxw();i.Q6J("@indicatorRotate",e._getExpandedState())}}const J=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],D=["mat-panel-title","mat-panel-description","*"],O=new i.OlP("MAT_ACCORDION"),P="225ms cubic-bezier(0.4,0.0,0.2,1)",S={indicatorRotate:(0,T.X$)("indicatorRotate",[(0,T.SB)("collapsed, void",(0,T.oB)({transform:"rotate(0deg)"})),(0,T.SB)("expanded",(0,T.oB)({transform:"rotate(180deg)"})),(0,T.eR)("expanded <=> collapsed, void => collapsed",(0,T.jt)(P))]),bodyExpansion:(0,T.X$)("bodyExpansion",[(0,T.SB)("collapsed, void",(0,T.oB)({height:"0px",visibility:"hidden"})),(0,T.SB)("expanded",(0,T.oB)({height:"*",visibility:"visible"})),(0,T.eR)("expanded <=> collapsed, void => collapsed",(0,T.jt)(P))])};let N=(()=>{class e{constructor(e){this._template=e}}return e.\u0275fac=function(t){return new(t||e)(i.Y36(i.Rgc))},e.\u0275dir=i.lG2({type:e,selectors:[["ng-template","matExpansionPanelContent",""]]}),e})(),Q=0;const Y=new i.OlP("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let F=(()=>{class e extends g{constructor(e,t,n,a,o,r,l){super(e,t,n),this._viewContainerRef=a,this._animationMode=r,this._hideToggle=!1,this.afterExpand=new i.vpe,this.afterCollapse=new i.vpe,this._inputChanges=new s.xQ,this._headerId="mat-expansion-panel-header-"+Q++,this._bodyAnimationDone=new s.xQ,this.accordion=e,this._document=o,this._bodyAnimationDone.pipe((0,b.x)((e,t)=>e.fromState===t.fromState&&e.toState===t.toState)).subscribe(e=>{"void"!==e.fromState&&("expanded"===e.toState?this.afterExpand.emit():"collapsed"===e.toState&&this.afterCollapse.emit())}),l&&(this.hideToggle=l.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(e){this._hideToggle=(0,a.Ig)(e)}get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(e){this._togglePosition=e}_hasSpacing(){return!!this.accordion&&this.expanded&&"default"===this.accordion.displayMode}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded}close(){this.expanded=!1}open(){this.expanded=!0}ngAfterContentInit(){this._lazyContent&&this.opened.pipe((0,v.O)(null),(0,Z.h)(()=>this.expanded&&!this._portal),(0,x.q)(1)).subscribe(()=>{this._portal=new h.UE(this._lazyContent._template,this._viewContainerRef)})}ngOnChanges(e){this._inputChanges.next(e)}ngOnDestroy(){super.ngOnDestroy(),this._bodyAnimationDone.complete(),this._inputChanges.complete()}_containsFocus(){if(this._body){const e=this._document.activeElement,t=this._body.nativeElement;return e===t||t.contains(e)}return!1}}return e.\u0275fac=function(t){return new(t||e)(i.Y36(O,12),i.Y36(i.sBO),i.Y36(r.A8),i.Y36(i.s_b),i.Y36(m.K0),i.Y36(y.Qb,8),i.Y36(Y,8))},e.\u0275cmp=i.Xpm({type:e,selectors:[["mat-expansion-panel"]],contentQueries:function(e,t,n){if(1&e&&i.Suo(n,N,5),2&e){let e;i.iGM(e=i.CRH())&&(t._lazyContent=e.first)}},viewQuery:function(e,t){if(1&e&&i.Gf(q,5),2&e){let e;i.iGM(e=i.CRH())&&(t._body=e.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(e,t){2&e&&i.ekj("mat-expanded",t.expanded)("_mat-animation-noopable","NoopAnimations"===t._animationMode)("mat-expansion-panel-spacing",t._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[i._Bn([{provide:O,useValue:void 0}]),i.qOj,i.TTD],ngContentSelectors:I,decls:7,vars:4,consts:[["role","region",1,"mat-expansion-panel-content",3,"id"],["body",""],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(e,t){1&e&&(i.F$t(M),i.Hsn(0),i.TgZ(1,"div",0,1),i.NdJ("@bodyExpansion.done",function(e){return t._bodyAnimationDone.next(e)}),i.TgZ(3,"div",2),i.Hsn(4,1),i.YNc(5,k,0,0,"ng-template",3),i.qZA(),i.Hsn(6,2),i.qZA()),2&e&&(i.xp6(1),i.Q6J("@bodyExpansion",t._getExpandedState())("id",t.id),i.uIk("aria-labelledby",t._headerId),i.xp6(4),i.Q6J("cdkPortalOutlet",t._portal))},directives:[h.Pl],styles:[".mat-expansion-panel{box-sizing:content-box;display:block;margin:0;border-radius:4px;overflow:hidden;transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);position:relative}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:4px;border-top-left-radius:4px}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.cdk-high-contrast-active .mat-expansion-panel{outline:solid 1px}.mat-expansion-panel.ng-animate-disabled,.ng-animate-disabled .mat-expansion-panel,.mat-expansion-panel._mat-animation-noopable{transition:none}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px}.mat-action-row button.mat-button-base,.mat-action-row button.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row button.mat-button-base,[dir=rtl] .mat-action-row button.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[S.bodyExpansion]},changeDetection:0}),e})(),R=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.lG2({type:e,selectors:[["mat-action-row"]],hostAttrs:[1,"mat-action-row"]}),e})(),E=(()=>{class e{constructor(e,t,n,i,a,s){this.panel=e,this._element=t,this._focusMonitor=n,this._changeDetectorRef=i,this._animationMode=s,this._parentChangeSubscription=o.w.EMPTY;const r=e.accordion?e.accordion._stateChanges.pipe((0,Z.h)(e=>!(!e.hideToggle&&!e.togglePosition))):w.E;this._parentChangeSubscription=(0,C.T)(e.opened,e.closed,r,e._inputChanges.pipe((0,Z.h)(e=>!!(e.hideToggle||e.disabled||e.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),e.closed.pipe((0,Z.h)(()=>e._containsFocus())).subscribe(()=>n.focusVia(t,"program")),a&&(this.expandedHeight=a.expandedHeight,this.collapsedHeight=a.collapsedHeight)}get disabled(){return this.panel.disabled}_toggle(){this.disabled||this.panel.toggle()}_isExpanded(){return this.panel.expanded}_getExpandedState(){return this.panel._getExpandedState()}_getPanelId(){return this.panel.id}_getTogglePosition(){return this.panel.togglePosition}_showToggle(){return!this.panel.hideToggle&&!this.panel.disabled}_getHeaderHeight(){const e=this._isExpanded();return e&&this.expandedHeight?this.expandedHeight:!e&&this.collapsedHeight?this.collapsedHeight:null}_keydown(e){switch(e.keyCode){case A.L_:case A.K5:(0,A.Vb)(e)||(e.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(e))}}focus(e,t){e?this._focusMonitor.focusVia(this._element,e,t):this._element.nativeElement.focus(t)}ngAfterViewInit(){this._focusMonitor.monitor(this._element).subscribe(e=>{e&&this.panel.accordion&&this.panel.accordion._handleHeaderFocus(this)})}ngOnDestroy(){this._parentChangeSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._element)}}return e.\u0275fac=function(t){return new(t||e)(i.Y36(F,1),i.Y36(i.SBq),i.Y36(_.tE),i.Y36(i.sBO),i.Y36(Y,8),i.Y36(y.Qb,8))},e.\u0275cmp=i.Xpm({type:e,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(e,t){1&e&&i.NdJ("click",function(){return t._toggle()})("keydown",function(e){return t._keydown(e)}),2&e&&(i.uIk("id",t.panel._headerId)("tabindex",t.disabled?-1:0)("aria-controls",t._getPanelId())("aria-expanded",t._isExpanded())("aria-disabled",t.panel.disabled),i.Udp("height",t._getHeaderHeight()),i.ekj("mat-expanded",t._isExpanded())("mat-expansion-toggle-indicator-after","after"===t._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===t._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===t._animationMode))},inputs:{expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},ngContentSelectors:D,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(e,t){1&e&&(i.F$t(J),i.TgZ(0,"span",0),i.Hsn(1),i.Hsn(2,1),i.Hsn(3,2),i.qZA(),i.YNc(4,U,1,1,"span",1)),2&e&&(i.xp6(4),i.Q6J("ngIf",t._showToggle()))},directives:[m.O5],styles:['.mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit;transition:height 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header._mat-animation-noopable{transition:none}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:none}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-expansion-panel-header-title,.mat-expansion-panel-header-description{display:flex;flex-grow:1;margin-right:16px}[dir=rtl] .mat-expansion-panel-header-title,[dir=rtl] .mat-expansion-panel-header-description{margin-right:0;margin-left:16px}.mat-expansion-panel-header-description{flex-grow:2}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:"";display:inline-block;padding:3px;transform:rotate(45deg);vertical-align:middle}.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-keyboard-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-program-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:hover:not([aria-disabled=true])::before{top:0;left:0;right:0;bottom:0;position:absolute;box-sizing:border-box;pointer-events:none;border:3px solid;border-radius:4px;content:""}\n'],encapsulation:2,data:{animation:[S.indicatorRotate]},changeDetection:0}),e})(),L=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.lG2({type:e,selectors:[["mat-panel-title"]],hostAttrs:[1,"mat-expansion-panel-header-title"]}),e})(),$=(()=>{class e extends d{constructor(){super(...arguments),this._ownHeaders=new i.n_E,this._hideToggle=!1,this.displayMode="default",this.togglePosition="after"}get hideToggle(){return this._hideToggle}set hideToggle(e){this._hideToggle=(0,a.Ig)(e)}ngAfterContentInit(){this._headers.changes.pipe((0,v.O)(this._headers)).subscribe(e=>{this._ownHeaders.reset(e.filter(e=>e.panel.accordion===this)),this._ownHeaders.notifyOnChanges()}),this._keyManager=new _.Em(this._ownHeaders).withWrap().withHomeAndEnd()}_handleHeaderKeydown(e){this._keyManager.onKeydown(e)}_handleHeaderFocus(e){this._keyManager.updateActiveItem(e)}ngOnDestroy(){super.ngOnDestroy(),this._ownHeaders.destroy()}}return e.\u0275fac=function(){let t;return function(n){return(t||(t=i.n5z(e)))(n||e)}}(),e.\u0275dir=i.lG2({type:e,selectors:[["mat-accordion"]],contentQueries:function(e,t,n){if(1&e&&i.Suo(n,E,5),2&e){let e;i.iGM(e=i.CRH())&&(t._headers=e)}},hostAttrs:[1,"mat-accordion"],hostVars:2,hostBindings:function(e,t){2&e&&i.ekj("mat-accordion-multi",t.multi)},inputs:{multi:"multi",displayMode:"displayMode",togglePosition:"togglePosition",hideToggle:"hideToggle"},exportAs:["matAccordion"],features:[i._Bn([{provide:O,useExisting:e}]),i.qOj]}),e})(),V=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=i.oAB({type:e}),e.\u0275inj=i.cJS({imports:[[m.ez,f.BQ,p,h.eL]]}),e})()},2613:(e,t,n)=>{"use strict";n.d(t,{U0:()=>y,VQ:()=>v,Fk:()=>w});var i=n(7716),a=n(2458),s=n(9490),o=n(3679),r=n(6237),l=n(9238),c=n(8345);const d=["input"],u=function(){return{enterDuration:150}},g=["*"],p=new i.OlP("mat-radio-default-options",{providedIn:"root",factory:function(){return{color:"accent"}}});let h=0;const m={provide:o.JU,useExisting:(0,i.Gpc)(()=>v),multi:!0};class f{constructor(e,t){this.source=e,this.value=t}}const _=new i.OlP("MatRadioGroup");let b=(()=>{class e{constructor(e){this._changeDetector=e,this._value=null,this._name="mat-radio-group-"+h++,this._selected=null,this._isInitialized=!1,this._labelPosition="after",this._disabled=!1,this._required=!1,this._controlValueAccessorChangeFn=()=>{},this.onTouched=()=>{},this.change=new i.vpe}get name(){return this._name}set name(e){this._name=e,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(e){this._labelPosition="before"===e?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(e){this._value!==e&&(this._value=e,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(e){this._selected=e,this.value=e?e.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(e){this._disabled=(0,s.Ig)(e),this._markRadiosForCheck()}get required(){return this._required}set required(e){this._required=(0,s.Ig)(e),this._markRadiosForCheck()}ngAfterContentInit(){this._isInitialized=!0}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(e=>{e.name=this.name,e._markForCheck()})}_updateSelectedRadioFromValue(){this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(e=>{e.checked=this.value===e.value,e.checked&&(this._selected=e)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new f(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(e=>e._markForCheck())}writeValue(e){this.value=e,this._changeDetector.markForCheck()}registerOnChange(e){this._controlValueAccessorChangeFn=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled=e,this._changeDetector.markForCheck()}}return e.\u0275fac=function(t){return new(t||e)(i.Y36(i.sBO))},e.\u0275dir=i.lG2({type:e,inputs:{name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:"disabled",required:"required",color:"color"},outputs:{change:"change"}}),e})(),v=(()=>{class e extends b{}return e.\u0275fac=function(){let t;return function(n){return(t||(t=i.n5z(e)))(n||e)}}(),e.\u0275dir=i.lG2({type:e,selectors:[["mat-radio-group"]],contentQueries:function(e,t,n){if(1&e&&i.Suo(n,y,5),2&e){let e;i.iGM(e=i.CRH())&&(t._radios=e)}},hostAttrs:["role","radiogroup",1,"mat-radio-group"],exportAs:["matRadioGroup"],features:[i._Bn([m,{provide:_,useExisting:e}]),i.qOj]}),e})();class Z{constructor(e){this._elementRef=e}}const x=(0,a.Kr)((0,a.sb)(Z));let A=(()=>{class e extends x{constructor(e,t,n,a,o,r,l,c){super(t),this._changeDetector=n,this._focusMonitor=a,this._radioDispatcher=o,this._animationMode=r,this._providerOverride=l,this._uniqueId="mat-radio-"+ ++h,this.id=this._uniqueId,this.change=new i.vpe,this._checked=!1,this._value=null,this._removeUniqueSelectionListener=()=>{},this.radioGroup=e,c&&(this.tabIndex=(0,s.su)(c,0)),this._removeUniqueSelectionListener=o.listen((e,t)=>{e!==this.id&&t===this.name&&(this.checked=!1)})}get checked(){return this._checked}set checked(e){const t=(0,s.Ig)(e);this._checked!==t&&(this._checked=t,t&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!t&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),t&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(e){this._value!==e&&(this._value=e,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===e),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(e){this._labelPosition=e}get disabled(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled}set disabled(e){this._setDisabled((0,s.Ig)(e))}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(e){this._required=(0,s.Ig)(e)}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"}set color(e){this._color=e}get inputId(){return`${this.id||this._uniqueId}-input`}focus(e,t){t?this._focusMonitor.focusVia(this._inputElement,t,e):this._inputElement.nativeElement.focus(e)}_markForCheck(){this._changeDetector.markForCheck()}ngOnInit(){this.radioGroup&&(this.checked=this.radioGroup.value===this._value,this.checked&&(this.radioGroup.selected=this),this.name=this.radioGroup.name)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(e=>{!e&&this.radioGroup&&this.radioGroup._touch()})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}_emitChangeEvent(){this.change.emit(new f(this,this._value))}_isRippleDisabled(){return this.disableRipple||this.disabled}_onInputClick(e){e.stopPropagation()}_onInputChange(e){e.stopPropagation();const t=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),t&&this.radioGroup._emitChangeEvent())}_setDisabled(e){this._disabled!==e&&(this._disabled=e,this._changeDetector.markForCheck())}}return e.\u0275fac=function(t){return new(t||e)(i.Y36(b),i.Y36(i.SBq),i.Y36(i.sBO),i.Y36(l.tE),i.Y36(c.A8),i.Y36(String),i.Y36(void 0),i.Y36(String))},e.\u0275dir=i.lG2({type:e,viewQuery:function(e,t){if(1&e&&i.Gf(d,5),2&e){let e;i.iGM(e=i.CRH())&&(t._inputElement=e.first)}},inputs:{id:"id",checked:"checked",value:"value",labelPosition:"labelPosition",disabled:"disabled",required:"required",color:"color",name:"name",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change"},features:[i.qOj]}),e})(),y=(()=>{class e extends A{constructor(e,t,n,i,a,s,o,r){super(e,t,n,i,a,s,o,r)}}return e.\u0275fac=function(t){return new(t||e)(i.Y36(_,8),i.Y36(i.SBq),i.Y36(i.sBO),i.Y36(l.tE),i.Y36(c.A8),i.Y36(r.Qb,8),i.Y36(p,8),i.$8M("tabindex"))},e.\u0275cmp=i.Xpm({type:e,selectors:[["mat-radio-button"]],hostAttrs:[1,"mat-radio-button"],hostVars:17,hostBindings:function(e,t){1&e&&i.NdJ("focus",function(){return t._inputElement.nativeElement.focus()}),2&e&&(i.uIk("tabindex",null)("id",t.id)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),i.ekj("mat-radio-checked",t.checked)("mat-radio-disabled",t.disabled)("_mat-animation-noopable","NoopAnimations"===t._animationMode)("mat-primary","primary"===t.color)("mat-accent","accent"===t.color)("mat-warn","warn"===t.color))},inputs:{disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matRadioButton"],features:[i.qOj],ngContentSelectors:g,decls:13,vars:19,consts:[[1,"mat-radio-label"],["label",""],[1,"mat-radio-container"],[1,"mat-radio-outer-circle"],[1,"mat-radio-inner-circle"],["type","radio",1,"mat-radio-input","cdk-visually-hidden",3,"id","checked","disabled","tabIndex","required","change","click"],["input",""],["mat-ripple","",1,"mat-radio-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-radio-persistent-ripple"],[1,"mat-radio-label-content"],[2,"display","none"]],template:function(e,t){if(1&e&&(i.F$t(),i.TgZ(0,"label",0,1),i.TgZ(2,"span",2),i._UZ(3,"span",3),i._UZ(4,"span",4),i.TgZ(5,"input",5,6),i.NdJ("change",function(e){return t._onInputChange(e)})("click",function(e){return t._onInputClick(e)}),i.qZA(),i.TgZ(7,"span",7),i._UZ(8,"span",8),i.qZA(),i.qZA(),i.TgZ(9,"span",9),i.TgZ(10,"span",10),i._uU(11,"\xa0"),i.qZA(),i.Hsn(12),i.qZA(),i.qZA()),2&e){const e=i.MAs(1);i.uIk("for",t.inputId),i.xp6(5),i.Q6J("id",t.inputId)("checked",t.checked)("disabled",t.disabled)("tabIndex",t.tabIndex)("required",t.required),i.uIk("name",t.name)("value",t.value)("aria-label",t.ariaLabel)("aria-labelledby",t.ariaLabelledby)("aria-describedby",t.ariaDescribedby),i.xp6(2),i.Q6J("matRippleTrigger",e)("matRippleDisabled",t._isRippleDisabled())("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",i.DdM(18,u)),i.xp6(2),i.ekj("mat-radio-label-before","before"==t.labelPosition)}},directives:[a.wG],styles:[".mat-radio-button{display:inline-block;-webkit-tap-highlight-color:transparent;outline:0}.mat-radio-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;vertical-align:middle;width:100%}.mat-radio-container{box-sizing:border-box;display:inline-block;position:relative;width:20px;height:20px;flex-shrink:0}.mat-radio-outer-circle{box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;transition:border-color ease 280ms;width:20px;border-width:2px;border-style:solid;border-radius:50%}._mat-animation-noopable .mat-radio-outer-circle{transition:none}.mat-radio-inner-circle{border-radius:50%;box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;transition:transform ease 280ms,background-color ease 280ms;width:20px;transform:scale(0.001);-webkit-print-color-adjust:exact;color-adjust:exact}._mat-animation-noopable .mat-radio-inner-circle{transition:none}.mat-radio-checked .mat-radio-inner-circle{transform:scale(0.5)}.cdk-high-contrast-active .mat-radio-checked .mat-radio-inner-circle{border:solid 10px}.mat-radio-label-content{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;display:inline-block;order:0;line-height:inherit;padding-left:8px;padding-right:0}[dir=rtl] .mat-radio-label-content{padding-right:8px;padding-left:0}.mat-radio-label-content.mat-radio-label-before{order:-1;padding-left:0;padding-right:8px}[dir=rtl] .mat-radio-label-content.mat-radio-label-before{padding-right:0;padding-left:8px}.mat-radio-disabled,.mat-radio-disabled .mat-radio-label{cursor:default}.mat-radio-button .mat-radio-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-radio-button .mat-radio-ripple .mat-ripple-element:not(.mat-radio-persistent-ripple){opacity:.16}.mat-radio-persistent-ripple{width:100%;height:100%;transform:none;top:0;left:0}.mat-radio-container:hover .mat-radio-persistent-ripple{opacity:.04}.mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-persistent-ripple,.mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-persistent-ripple{opacity:.12}.mat-radio-persistent-ripple,.mat-radio-disabled .mat-radio-container:hover .mat-radio-persistent-ripple{opacity:0}@media(hover: none){.mat-radio-container:hover .mat-radio-persistent-ripple{display:none}}.mat-radio-input{bottom:0;left:50%}.cdk-high-contrast-active .mat-radio-disabled{opacity:.5}\n"],encapsulation:2,changeDetection:0}),e})(),w=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=i.oAB({type:e}),e.\u0275inj=i.cJS({imports:[[a.si,a.BQ],a.BQ]}),e})()},5439:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var i,a,s;if(Array.isArray(t)){if((i=t.length)!=n.length)return!1;for(a=i;0!=a--;)if(!e(t[a],n[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((i=(s=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(a=i;0!=a--;)if(!Object.prototype.hasOwnProperty.call(n,s[a]))return!1;for(a=i;0!=a--;){var o=s[a];if(!e(t[o],n[o]))return!1}return!0}return t!=t&&n!=n}},1244:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AppAdminModule:()=>ug});var i=n(8583),a=n(3679),s=n(2178),o=n(7716),r=n(299),l=n(4655);let c=(()=>{class e{constructor(e,t){this.http=e,this.router=t}resolve(e){return this.http.get("settings").toPromise().then(e=>e,()=>(this.router.navigate(["/admin"]),!1))}}return e.\u0275fac=function(t){return new(t||e)(o.LFG(r.r),o.LFG(l.F0))},e.\u0275prov=o.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),d=(()=>{class e{constructor(){this.initial={server:{},client:{}},this.server={},this.client={}}getModified(){return{server:this.diffSettingObjects("server"),client:this.diffSettingObjects("client")}}diffSettingObjects(e){const t={};for(const n in this[e])this[e][n]!==this.initial[e][n]&&(t[n]=this[e][n]);return t}setAll(e){this.initial=e,this.client=Object.assign({},e.client),this.server=Object.assign({},e.server)}reset(){this.server=Object.assign({},this.initial.server),this.client=Object.assign({},this.initial.client)}updateInitial(e){this.initial={client:Object.assign(Object.assign({},this.initial.client),e.client),server:Object.assign(Object.assign({},this.initial.server),e.server)}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=o.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var u=n(1554),g=n(1095),p=n(7539),h=n(8341),m=n(2238),f=n(521),_=n(9490),b=(n(9193),n(9765)),v=n(2759);n(13),n(6782);let Z=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=o.oAB({type:e}),e.\u0275inj=o.cJS({imports:[[f.ud]]}),e})();var x=n(2458),A=n(9911);const y=new o.OlP("MAT_INPUT_VALUE_ACCESSOR");let w=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=o.oAB({type:e}),e.\u0275inj=o.cJS({providers:[x.rD],imports:[[Z,A.lN,x.BQ],Z,A.lN]}),e})();var C=n(3935),T=n(5396),q=n(7001),k=n(1436),M=n(9866);let I=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=o.oAB({type:e}),e.\u0275inj=o.cJS({imports:[[i.ez,a.UX,M.N]]}),e})();var U=n(7738),J=n(5939),D=n(2613),O=n(6627),P=n(2877);const S=new o.OlP("RECAPTCHA_ACTIONS");let N=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=o.oAB({type:e}),e.\u0275inj=o.cJS({providers:[c,d,{provide:S,multi:!0,useValue:[{name:"Registration Recaptcha",key:"recaptcha.enable_for_registration",description:"Enable recaptcha integration for registration page."},{name:"Contact Recaptcha",key:"recaptcha.enable_for_contact",description:'Enable recaptcha integration for "contact us" page.'}]}],imports:[[l.Bz,i.ez,a.u5,a.UX,I,U.G,M.N,P.X,g.ot,O.Ps,q.ZX,p.p9,k.AV,m.Is,C.Tx,T.rP,u.Bb,w,h.Hi,s.Cv,J.Nh,D.Fk],U.G]}),e})(),Q=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=o.oAB({type:e}),e.\u0275inj=o.cJS({imports:[[i.ez,a.u5,a.UX,M.N,g.ot,q.ZX,p.p9,k.AV,m.Is,C.Tx,O.Ps]]}),e})();var Y=n(9238),F=n(625),R=n(7636),E=n(3416),L=n(5319),$=n(6682),V=n(5917),H=n(6461),z=n(5257),B=n(9761),j=n(5435),G=n(7238),X=n(946);const W=["mat-calendar-body",""];function K(e,t){if(1&e&&(o.TgZ(0,"tr",2),o.TgZ(1,"td",3),o._uU(2),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Udp("padding-top",e._cellPadding)("padding-bottom",e._cellPadding),o.uIk("colspan",e.numCols),o.xp6(1),o.hij(" ",e.label," ")}}function ee(e,t){if(1&e&&(o.TgZ(0,"td",7),o._uU(1),o.qZA()),2&e){const e=o.oxw(2);o.Udp("padding-top",e._cellPadding)("padding-bottom",e._cellPadding),o.uIk("colspan",e._firstRowOffset),o.xp6(1),o.hij(" ",e._firstRowOffset>=e.labelMinRequiredCells?e.label:""," ")}}function te(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"td",8),o.NdJ("click",function(t){const n=o.CHM(e).$implicit;return o.oxw(2)._cellClicked(n,t)}),o.TgZ(1,"div",9),o._uU(2),o.qZA(),o._UZ(3,"div",10),o.qZA()}if(2&e){const e=t.$implicit,n=t.index,i=o.oxw().index,a=o.oxw();o.Udp("width",a._cellWidth)("padding-top",a._cellPadding)("padding-bottom",a._cellPadding),o.ekj("mat-calendar-body-disabled",!e.enabled)("mat-calendar-body-active",a._isActiveCell(i,n))("mat-calendar-body-range-start",a._isRangeStart(e.compareValue))("mat-calendar-body-range-end",a._isRangeEnd(e.compareValue))("mat-calendar-body-in-range",a._isInRange(e.compareValue))("mat-calendar-body-comparison-bridge-start",a._isComparisonBridgeStart(e.compareValue,i,n))("mat-calendar-body-comparison-bridge-end",a._isComparisonBridgeEnd(e.compareValue,i,n))("mat-calendar-body-comparison-start",a._isComparisonStart(e.compareValue))("mat-calendar-body-comparison-end",a._isComparisonEnd(e.compareValue))("mat-calendar-body-in-comparison-range",a._isInComparisonRange(e.compareValue))("mat-calendar-body-preview-start",a._isPreviewStart(e.compareValue))("mat-calendar-body-preview-end",a._isPreviewEnd(e.compareValue))("mat-calendar-body-in-preview",a._isInPreview(e.compareValue)),o.Q6J("ngClass",e.cssClasses)("tabindex",a._isActiveCell(i,n)?0:-1),o.uIk("data-mat-row",i)("data-mat-col",n)("aria-label",e.ariaLabel)("aria-disabled",!e.enabled||null)("aria-selected",a._isSelected(e.compareValue)),o.xp6(1),o.ekj("mat-calendar-body-selected",a._isSelected(e.compareValue))("mat-calendar-body-comparison-identical",a._isComparisonIdentical(e.compareValue))("mat-calendar-body-today",a.todayValue===e.compareValue),o.xp6(1),o.hij(" ",e.displayValue," ")}}function ne(e,t){if(1&e&&(o.TgZ(0,"tr",4),o.YNc(1,ee,2,6,"td",5),o.YNc(2,te,4,46,"td",6),o.qZA()),2&e){const e=t.$implicit,n=t.index,i=o.oxw();o.xp6(1),o.Q6J("ngIf",0===n&&i._firstRowOffset),o.xp6(1),o.Q6J("ngForOf",e)}}function ie(e,t){if(1&e&&(o.TgZ(0,"th",5),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.uIk("aria-label",e.long),o.xp6(1),o.Oqu(e.narrow)}}const ae=["*"];function se(e,t){}function oe(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-month-view",5),o.NdJ("activeDateChange",function(t){return o.CHM(e),o.oxw().activeDate=t})("_userSelection",function(t){return o.CHM(e),o.oxw()._dateSelected(t)}),o.qZA()}if(2&e){const e=o.oxw();o.Q6J("activeDate",e.activeDate)("selected",e.selected)("dateFilter",e.dateFilter)("maxDate",e.maxDate)("minDate",e.minDate)("dateClass",e.dateClass)("comparisonStart",e.comparisonStart)("comparisonEnd",e.comparisonEnd)}}function re(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-year-view",6),o.NdJ("activeDateChange",function(t){return o.CHM(e),o.oxw().activeDate=t})("monthSelected",function(t){return o.CHM(e),o.oxw()._monthSelectedInYearView(t)})("selectedChange",function(t){return o.CHM(e),o.oxw()._goToDateInView(t,"month")}),o.qZA()}if(2&e){const e=o.oxw();o.Q6J("activeDate",e.activeDate)("selected",e.selected)("dateFilter",e.dateFilter)("maxDate",e.maxDate)("minDate",e.minDate)("dateClass",e.dateClass)}}function le(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-multi-year-view",7),o.NdJ("activeDateChange",function(t){return o.CHM(e),o.oxw().activeDate=t})("yearSelected",function(t){return o.CHM(e),o.oxw()._yearSelectedInMultiYearView(t)})("selectedChange",function(t){return o.CHM(e),o.oxw()._goToDateInView(t,"year")}),o.qZA()}if(2&e){const e=o.oxw();o.Q6J("activeDate",e.activeDate)("selected",e.selected)("dateFilter",e.dateFilter)("maxDate",e.maxDate)("minDate",e.minDate)("dateClass",e.dateClass)}}function ce(e,t){}const de=["button"];function ue(e,t){1&e&&(o.O4$(),o.TgZ(0,"svg",3),o._UZ(1,"path",4),o.qZA())}const ge=[[["","matDatepickerToggleIcon",""]]],pe=["[matDatepickerToggleIcon]"];let he=(()=>{class e{constructor(){this.changes=new b.xQ,this.calendarLabel="Calendar",this.openCalendarLabel="Open calendar",this.closeCalendarLabel="Close calendar",this.prevMonthLabel="Previous month",this.nextMonthLabel="Next month",this.prevYearLabel="Previous year",this.nextYearLabel="Next year",this.prevMultiYearLabel="Previous 20 years",this.nextMultiYearLabel="Next 20 years",this.switchToMonthViewLabel="Choose date",this.switchToMultiYearViewLabel="Choose month and year"}formatYearRange(e,t){return`${e} \u2013 ${t}`}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=(0,o.Yz7)({factory:function(){return new e},token:e,providedIn:"root"}),e})();class me{constructor(e,t,n,i,a={},s=e,o){this.value=e,this.displayValue=t,this.ariaLabel=n,this.enabled=i,this.cssClasses=a,this.compareValue=s,this.rawValue=o}}let fe=(()=>{class e{constructor(e,t){this._elementRef=e,this._ngZone=t,this.numCols=7,this.activeCell=0,this.isRange=!1,this.cellAspectRatio=1,this.previewStart=null,this.previewEnd=null,this.selectedValueChange=new o.vpe,this.previewChange=new o.vpe,this._enterHandler=e=>{if(this._skipNextFocus&&"focus"===e.type)this._skipNextFocus=!1;else if(e.target&&this.isRange){const t=this._getCellFromElement(e.target);t&&this._ngZone.run(()=>this.previewChange.emit({value:t.enabled?t:null,event:e}))}},this._leaveHandler=e=>{null!==this.previewEnd&&this.isRange&&e.target&&_e(e.target)&&this._ngZone.run(()=>this.previewChange.emit({value:null,event:e}))},t.runOutsideAngular(()=>{const t=e.nativeElement;t.addEventListener("mouseenter",this._enterHandler,!0),t.addEventListener("focus",this._enterHandler,!0),t.addEventListener("mouseleave",this._leaveHandler,!0),t.addEventListener("blur",this._leaveHandler,!0)})}_cellClicked(e,t){e.enabled&&this.selectedValueChange.emit({value:e.value,event:t})}_isSelected(e){return this.startValue===e||this.endValue===e}ngOnChanges(e){const t=e.numCols,{rows:n,numCols:i}=this;(e.rows||t)&&(this._firstRowOffset=n&&n.length&&n[0].length?i-n[0].length:0),(e.cellAspectRatio||t||!this._cellPadding)&&(this._cellPadding=50*this.cellAspectRatio/i+"%"),!t&&this._cellWidth||(this._cellWidth=100/i+"%")}ngOnDestroy(){const e=this._elementRef.nativeElement;e.removeEventListener("mouseenter",this._enterHandler,!0),e.removeEventListener("focus",this._enterHandler,!0),e.removeEventListener("mouseleave",this._leaveHandler,!0),e.removeEventListener("blur",this._leaveHandler,!0)}_isActiveCell(e,t){let n=e*this.numCols+t;return e&&(n-=this._firstRowOffset),n==this.activeCell}_focusActiveCell(e=!0){this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.pipe((0,z.q)(1)).subscribe(()=>{const t=this._elementRef.nativeElement.querySelector(".mat-calendar-body-active");t&&(e||(this._skipNextFocus=!0),t.focus())})})}_isRangeStart(e){return be(e,this.startValue,this.endValue)}_isRangeEnd(e){return ve(e,this.startValue,this.endValue)}_isInRange(e){return Ze(e,this.startValue,this.endValue,this.isRange)}_isComparisonStart(e){return be(e,this.comparisonStart,this.comparisonEnd)}_isComparisonBridgeStart(e,t,n){if(!this._isComparisonStart(e)||this._isRangeStart(e)||!this._isInRange(e))return!1;let i=this.rows[t][n-1];if(!i){const e=this.rows[t-1];i=e&&e[e.length-1]}return i&&!this._isRangeEnd(i.compareValue)}_isComparisonBridgeEnd(e,t,n){if(!this._isComparisonEnd(e)||this._isRangeEnd(e)||!this._isInRange(e))return!1;let i=this.rows[t][n+1];if(!i){const e=this.rows[t+1];i=e&&e[0]}return i&&!this._isRangeStart(i.compareValue)}_isComparisonEnd(e){return ve(e,this.comparisonStart,this.comparisonEnd)}_isInComparisonRange(e){return Ze(e,this.comparisonStart,this.comparisonEnd,this.isRange)}_isComparisonIdentical(e){return this.comparisonStart===this.comparisonEnd&&e===this.comparisonStart}_isPreviewStart(e){return be(e,this.previewStart,this.previewEnd)}_isPreviewEnd(e){return ve(e,this.previewStart,this.previewEnd)}_isInPreview(e){return Ze(e,this.previewStart,this.previewEnd,this.isRange)}_getCellFromElement(e){let t;if(_e(e)?t=e:_e(e.parentNode)&&(t=e.parentNode),t){const e=t.getAttribute("data-mat-row"),n=t.getAttribute("data-mat-col");if(e&&n)return this.rows[parseInt(e)][parseInt(n)]}return null}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(o.SBq),o.Y36(o.R0b))},e.\u0275cmp=o.Xpm({type:e,selectors:[["","mat-calendar-body",""]],hostAttrs:["role","grid","aria-readonly","true",1,"mat-calendar-body"],inputs:{numCols:"numCols",activeCell:"activeCell",isRange:"isRange",cellAspectRatio:"cellAspectRatio",previewStart:"previewStart",previewEnd:"previewEnd",label:"label",rows:"rows",todayValue:"todayValue",startValue:"startValue",endValue:"endValue",labelMinRequiredCells:"labelMinRequiredCells",comparisonStart:"comparisonStart",comparisonEnd:"comparisonEnd"},outputs:{selectedValueChange:"selectedValueChange",previewChange:"previewChange"},exportAs:["matCalendarBody"],features:[o.TTD],attrs:W,decls:2,vars:2,consts:[["aria-hidden","true",4,"ngIf"],["role","row",4,"ngFor","ngForOf"],["aria-hidden","true"],[1,"mat-calendar-body-label"],["role","row"],["aria-hidden","true","class","mat-calendar-body-label",3,"paddingTop","paddingBottom",4,"ngIf"],["role","gridcell","class","mat-calendar-body-cell",3,"ngClass","tabindex","mat-calendar-body-disabled","mat-calendar-body-active","mat-calendar-body-range-start","mat-calendar-body-range-end","mat-calendar-body-in-range","mat-calendar-body-comparison-bridge-start","mat-calendar-body-comparison-bridge-end","mat-calendar-body-comparison-start","mat-calendar-body-comparison-end","mat-calendar-body-in-comparison-range","mat-calendar-body-preview-start","mat-calendar-body-preview-end","mat-calendar-body-in-preview","width","paddingTop","paddingBottom","click",4,"ngFor","ngForOf"],["aria-hidden","true",1,"mat-calendar-body-label"],["role","gridcell",1,"mat-calendar-body-cell",3,"ngClass","tabindex","click"],[1,"mat-calendar-body-cell-content","mat-focus-indicator"],[1,"mat-calendar-body-cell-preview"]],template:function(e,t){1&e&&(o.YNc(0,K,3,6,"tr",0),o.YNc(1,ne,3,2,"tr",1)),2&e&&(o.Q6J("ngIf",t._firstRowOffset<t.labelMinRequiredCells),o.xp6(1),o.Q6J("ngForOf",t.rows))},directives:[i.O5,i.sg,i.mk],styles:['.mat-calendar-body{min-width:224px}.mat-calendar-body-label{height:0;line-height:0;text-align:left;padding-left:4.7142857143%;padding-right:4.7142857143%}.mat-calendar-body-cell{position:relative;height:0;line-height:0;text-align:center;outline:none;cursor:pointer}.mat-calendar-body-cell::before,.mat-calendar-body-cell::after,.mat-calendar-body-cell-preview{content:"";position:absolute;top:5%;left:0;z-index:0;box-sizing:border-box;height:90%;width:100%}.mat-calendar-body-range-start:not(.mat-calendar-body-in-comparison-range)::before,.mat-calendar-body-range-start::after,.mat-calendar-body-comparison-start:not(.mat-calendar-body-comparison-bridge-start)::before,.mat-calendar-body-comparison-start::after,.mat-calendar-body-preview-start .mat-calendar-body-cell-preview{left:5%;width:95%;border-top-left-radius:999px;border-bottom-left-radius:999px}[dir=rtl] .mat-calendar-body-range-start:not(.mat-calendar-body-in-comparison-range)::before,[dir=rtl] .mat-calendar-body-range-start::after,[dir=rtl] .mat-calendar-body-comparison-start:not(.mat-calendar-body-comparison-bridge-start)::before,[dir=rtl] .mat-calendar-body-comparison-start::after,[dir=rtl] .mat-calendar-body-preview-start .mat-calendar-body-cell-preview{left:0;border-radius:0;border-top-right-radius:999px;border-bottom-right-radius:999px}.mat-calendar-body-range-end:not(.mat-calendar-body-in-comparison-range)::before,.mat-calendar-body-range-end::after,.mat-calendar-body-comparison-end:not(.mat-calendar-body-comparison-bridge-end)::before,.mat-calendar-body-comparison-end::after,.mat-calendar-body-preview-end .mat-calendar-body-cell-preview{width:95%;border-top-right-radius:999px;border-bottom-right-radius:999px}[dir=rtl] .mat-calendar-body-range-end:not(.mat-calendar-body-in-comparison-range)::before,[dir=rtl] .mat-calendar-body-range-end::after,[dir=rtl] .mat-calendar-body-comparison-end:not(.mat-calendar-body-comparison-bridge-end)::before,[dir=rtl] .mat-calendar-body-comparison-end::after,[dir=rtl] .mat-calendar-body-preview-end .mat-calendar-body-cell-preview{left:5%;border-radius:0;border-top-left-radius:999px;border-bottom-left-radius:999px}[dir=rtl] .mat-calendar-body-comparison-bridge-start.mat-calendar-body-range-end::after,[dir=rtl] .mat-calendar-body-comparison-bridge-end.mat-calendar-body-range-start::after{width:95%;border-top-right-radius:999px;border-bottom-right-radius:999px}.mat-calendar-body-comparison-start.mat-calendar-body-range-end::after,[dir=rtl] .mat-calendar-body-comparison-start.mat-calendar-body-range-end::after,.mat-calendar-body-comparison-end.mat-calendar-body-range-start::after,[dir=rtl] .mat-calendar-body-comparison-end.mat-calendar-body-range-start::after{width:90%}.mat-calendar-body-in-preview .mat-calendar-body-cell-preview{border-top:dashed 1px;border-bottom:dashed 1px}.mat-calendar-body-preview-start .mat-calendar-body-cell-preview{border-left:dashed 1px}[dir=rtl] .mat-calendar-body-preview-start .mat-calendar-body-cell-preview{border-left:0;border-right:dashed 1px}.mat-calendar-body-preview-end .mat-calendar-body-cell-preview{border-right:dashed 1px}[dir=rtl] .mat-calendar-body-preview-end .mat-calendar-body-cell-preview{border-right:0;border-left:dashed 1px}.mat-calendar-body-disabled{cursor:default}.cdk-high-contrast-active .mat-calendar-body-disabled{opacity:.5}.mat-calendar-body-cell-content{top:5%;left:5%;z-index:1;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;line-height:1;border-width:1px;border-style:solid;border-radius:999px}.mat-calendar-body-cell-content.mat-focus-indicator{position:absolute}.cdk-high-contrast-active .mat-calendar-body-cell-content{border:none}.mat-datepicker-dialog .mat-dialog-container{position:relative;overflow:visible}.cdk-high-contrast-active .mat-datepicker-popup:not(:empty),.cdk-high-contrast-active .mat-calendar-body-selected{outline:solid 1px}.cdk-high-contrast-active .mat-calendar-body-today{outline:dotted 1px}.cdk-high-contrast-active .cdk-keyboard-focused .mat-calendar-body-active>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected),.cdk-high-contrast-active .cdk-program-focused .mat-calendar-body-active>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected){outline:dotted 2px}[dir=rtl] .mat-calendar-body-label{text-align:right}@media(hover: none){.mat-calendar-body-cell:not(.mat-calendar-body-disabled):hover>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected){background-color:transparent}}\n'],encapsulation:2,changeDetection:0}),e})();function _e(e){return"TD"===e.nodeName}function be(e,t,n){return null!==n&&t!==n&&e<n&&e===t}function ve(e,t,n){return null!==t&&t!==n&&e>=t&&e===n}function Ze(e,t,n,i){return i&&null!==t&&null!==n&&t!==n&&e>=t&&e<=n}class xe{constructor(e,t){this.start=e,this.end=t}}let Ae=(()=>{class e{constructor(e,t){this.selection=e,this._adapter=t,this._selectionChanged=new b.xQ,this.selectionChanged=this._selectionChanged,this.selection=e}updateSelection(e,t){const n=this.selection;this.selection=e,this._selectionChanged.next({selection:e,source:t,oldValue:n})}ngOnDestroy(){this._selectionChanged.complete()}_isValidDateInstance(e){return this._adapter.isDateInstance(e)&&this._adapter.isValid(e)}clone(){return null}}return e.\u0275fac=function(t){return new(t||e)(o.LFG(void 0),o.LFG(x._A))},e.\u0275prov=o.Yz7({token:e,factory:e.\u0275fac}),e})(),ye=(()=>{class e extends Ae{constructor(e){super(null,e)}add(e){super.updateSelection(e,this)}isValid(){return null!=this.selection&&this._isValidDateInstance(this.selection)}isComplete(){return null!=this.selection}clone(){const t=new e(this._adapter);return t.updateSelection(this.selection,this),t}}return e.\u0275fac=function(t){return new(t||e)(o.LFG(x._A))},e.\u0275prov=o.Yz7({token:e,factory:e.\u0275fac}),e})();const we={provide:Ae,deps:[[new o.FiY,new o.tp0,Ae],x._A],useFactory:function(e,t){return e||new ye(t)}},Ce=new o.OlP("MAT_DATE_RANGE_SELECTION_STRATEGY");let Te=(()=>{class e{constructor(e,t,n,i,a){this._changeDetectorRef=e,this._dateFormats=t,this._dateAdapter=n,this._dir=i,this._rangeStrategy=a,this._rerenderSubscription=L.w.EMPTY,this.selectedChange=new o.vpe,this._userSelection=new o.vpe,this.activeDateChange=new o.vpe,this._activeDate=this._dateAdapter.today()}get activeDate(){return this._activeDate}set activeDate(e){const t=this._activeDate,n=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(n,this.minDate,this.maxDate),this._hasSameMonthAndYear(t,this._activeDate)||this._init()}get selected(){return this._selected}set selected(e){this._selected=e instanceof xe?e:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e)),this._setRanges(this._selected)}get minDate(){return this._minDate}set minDate(e){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}ngAfterContentInit(){this._rerenderSubscription=this._dateAdapter.localeChanges.pipe((0,B.O)(null)).subscribe(()=>this._init())}ngOnChanges(e){const t=e.comparisonStart||e.comparisonEnd;t&&!t.firstChange&&this._setRanges(this.selected)}ngOnDestroy(){this._rerenderSubscription.unsubscribe()}_dateSelected(e){const t=e.value,n=this._dateAdapter.getYear(this.activeDate),i=this._dateAdapter.getMonth(this.activeDate),a=this._dateAdapter.createDate(n,i,t);let s,o;this._selected instanceof xe?(s=this._getDateInCurrentMonth(this._selected.start),o=this._getDateInCurrentMonth(this._selected.end)):s=o=this._getDateInCurrentMonth(this._selected),s===t&&o===t||this.selectedChange.emit(a),this._userSelection.emit({value:a,event:e.event}),this._previewStart=this._previewEnd=null,this._changeDetectorRef.markForCheck()}_handleCalendarBodyKeydown(e){const t=this._activeDate,n=this._isRtl();switch(e.keyCode){case H.oh:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,n?1:-1);break;case H.SV:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,n?-1:1);break;case H.LH:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,-7);break;case H.JH:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,7);break;case H.Sd:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,1-this._dateAdapter.getDate(this._activeDate));break;case H.uR:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,this._dateAdapter.getNumDaysInMonth(this._activeDate)-this._dateAdapter.getDate(this._activeDate));break;case H.Ku:this.activeDate=e.altKey?this._dateAdapter.addCalendarYears(this._activeDate,-1):this._dateAdapter.addCalendarMonths(this._activeDate,-1);break;case H.VM:this.activeDate=e.altKey?this._dateAdapter.addCalendarYears(this._activeDate,1):this._dateAdapter.addCalendarMonths(this._activeDate,1);break;case H.K5:case H.L_:return void(this.dateFilter&&!this.dateFilter(this._activeDate)||(this._dateSelected({value:this._dateAdapter.getDate(this._activeDate),event:e}),e.preventDefault()));case H.hY:return void(null==this._previewEnd||(0,H.Vb)(e)||(this._previewStart=this._previewEnd=null,this.selectedChange.emit(null),this._userSelection.emit({value:null,event:e}),e.preventDefault(),e.stopPropagation()));default:return}this._dateAdapter.compareDate(t,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCell(),e.preventDefault()}_init(){this._setRanges(this.selected),this._todayDate=this._getCellCompareValue(this._dateAdapter.today()),this._monthLabel=this._dateFormats.display.monthLabel?this._dateAdapter.format(this.activeDate,this._dateFormats.display.monthLabel):this._dateAdapter.getMonthNames("short")[this._dateAdapter.getMonth(this.activeDate)].toLocaleUpperCase();let e=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),this._dateAdapter.getMonth(this.activeDate),1);this._firstWeekOffset=(7+this._dateAdapter.getDayOfWeek(e)-this._dateAdapter.getFirstDayOfWeek())%7,this._initWeekdays(),this._createWeekCells(),this._changeDetectorRef.markForCheck()}_focusActiveCell(e){this._matCalendarBody._focusActiveCell(e)}_previewChanged({event:e,value:t}){if(this._rangeStrategy){const n=this._rangeStrategy.createPreview(t?t.rawValue:null,this.selected,e);this._previewStart=this._getCellCompareValue(n.start),this._previewEnd=this._getCellCompareValue(n.end),this._changeDetectorRef.detectChanges()}}_initWeekdays(){const e=this._dateAdapter.getFirstDayOfWeek(),t=this._dateAdapter.getDayOfWeekNames("narrow");let n=this._dateAdapter.getDayOfWeekNames("long").map((e,n)=>({long:e,narrow:t[n]}));this._weekdays=n.slice(e).concat(n.slice(0,e))}_createWeekCells(){const e=this._dateAdapter.getNumDaysInMonth(this.activeDate),t=this._dateAdapter.getDateNames();this._weeks=[[]];for(let n=0,i=this._firstWeekOffset;n<e;n++,i++){7==i&&(this._weeks.push([]),i=0);const e=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),this._dateAdapter.getMonth(this.activeDate),n+1),a=this._shouldEnableDate(e),s=this._dateAdapter.format(e,this._dateFormats.display.dateA11yLabel),o=this.dateClass?this.dateClass(e,"month"):void 0;this._weeks[this._weeks.length-1].push(new me(n+1,t[n],s,a,o,this._getCellCompareValue(e),e))}}_shouldEnableDate(e){return!!e&&(!this.minDate||this._dateAdapter.compareDate(e,this.minDate)>=0)&&(!this.maxDate||this._dateAdapter.compareDate(e,this.maxDate)<=0)&&(!this.dateFilter||this.dateFilter(e))}_getDateInCurrentMonth(e){return e&&this._hasSameMonthAndYear(e,this.activeDate)?this._dateAdapter.getDate(e):null}_hasSameMonthAndYear(e,t){return!(!e||!t||this._dateAdapter.getMonth(e)!=this._dateAdapter.getMonth(t)||this._dateAdapter.getYear(e)!=this._dateAdapter.getYear(t))}_getCellCompareValue(e){if(e){const t=this._dateAdapter.getYear(e),n=this._dateAdapter.getMonth(e),i=this._dateAdapter.getDate(e);return new Date(t,n,i).getTime()}return null}_isRtl(){return this._dir&&"rtl"===this._dir.value}_setRanges(e){e instanceof xe?(this._rangeStart=this._getCellCompareValue(e.start),this._rangeEnd=this._getCellCompareValue(e.end),this._isRange=!0):(this._rangeStart=this._rangeEnd=this._getCellCompareValue(e),this._isRange=!1),this._comparisonRangeStart=this._getCellCompareValue(this.comparisonStart),this._comparisonRangeEnd=this._getCellCompareValue(this.comparisonEnd)}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(o.sBO),o.Y36(x.sG,8),o.Y36(x._A,8),o.Y36(X.Is,8),o.Y36(Ce,8))},e.\u0275cmp=o.Xpm({type:e,selectors:[["mat-month-view"]],viewQuery:function(e,t){if(1&e&&o.Gf(fe,5),2&e){let e;o.iGM(e=o.CRH())&&(t._matCalendarBody=e.first)}},inputs:{activeDate:"activeDate",selected:"selected",minDate:"minDate",maxDate:"maxDate",dateFilter:"dateFilter",dateClass:"dateClass",comparisonStart:"comparisonStart",comparisonEnd:"comparisonEnd"},outputs:{selectedChange:"selectedChange",_userSelection:"_userSelection",activeDateChange:"activeDateChange"},exportAs:["matMonthView"],features:[o.TTD],decls:7,vars:13,consts:[["role","presentation",1,"mat-calendar-table"],[1,"mat-calendar-table-header"],["scope","col",4,"ngFor","ngForOf"],["colspan","7","aria-hidden","true",1,"mat-calendar-table-header-divider"],["mat-calendar-body","",3,"label","rows","todayValue","startValue","endValue","comparisonStart","comparisonEnd","previewStart","previewEnd","isRange","labelMinRequiredCells","activeCell","selectedValueChange","previewChange","keydown"],["scope","col"]],template:function(e,t){1&e&&(o.TgZ(0,"table",0),o.TgZ(1,"thead",1),o.TgZ(2,"tr"),o.YNc(3,ie,2,2,"th",2),o.qZA(),o.TgZ(4,"tr"),o._UZ(5,"th",3),o.qZA(),o.qZA(),o.TgZ(6,"tbody",4),o.NdJ("selectedValueChange",function(e){return t._dateSelected(e)})("previewChange",function(e){return t._previewChanged(e)})("keydown",function(e){return t._handleCalendarBodyKeydown(e)}),o.qZA(),o.qZA()),2&e&&(o.xp6(3),o.Q6J("ngForOf",t._weekdays),o.xp6(3),o.Q6J("label",t._monthLabel)("rows",t._weeks)("todayValue",t._todayDate)("startValue",t._rangeStart)("endValue",t._rangeEnd)("comparisonStart",t._comparisonRangeStart)("comparisonEnd",t._comparisonRangeEnd)("previewStart",t._previewStart)("previewEnd",t._previewEnd)("isRange",t._isRange)("labelMinRequiredCells",3)("activeCell",t._dateAdapter.getDate(t.activeDate)-1))},directives:[i.sg,fe],encapsulation:2,changeDetection:0}),e})();const qe=24;let ke=(()=>{class e{constructor(e,t,n){this._changeDetectorRef=e,this._dateAdapter=t,this._dir=n,this._rerenderSubscription=L.w.EMPTY,this.selectedChange=new o.vpe,this.yearSelected=new o.vpe,this.activeDateChange=new o.vpe,this._activeDate=this._dateAdapter.today()}get activeDate(){return this._activeDate}set activeDate(e){let t=this._activeDate;const n=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(n,this.minDate,this.maxDate),Me(this._dateAdapter,t,this._activeDate,this.minDate,this.maxDate)||this._init()}get selected(){return this._selected}set selected(e){this._selected=e instanceof xe?e:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e)),this._setSelectedYear(e)}get minDate(){return this._minDate}set minDate(e){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}ngAfterContentInit(){this._rerenderSubscription=this._dateAdapter.localeChanges.pipe((0,B.O)(null)).subscribe(()=>this._init())}ngOnDestroy(){this._rerenderSubscription.unsubscribe()}_init(){this._todayYear=this._dateAdapter.getYear(this._dateAdapter.today());const e=this._dateAdapter.getYear(this._activeDate)-Ie(this._dateAdapter,this.activeDate,this.minDate,this.maxDate);this._years=[];for(let t=0,n=[];t<qe;t++)n.push(e+t),4==n.length&&(this._years.push(n.map(e=>this._createCellForYear(e))),n=[]);this._changeDetectorRef.markForCheck()}_yearSelected(e){const t=e.value;this.yearSelected.emit(this._dateAdapter.createDate(t,0,1));let n=this._dateAdapter.getMonth(this.activeDate),i=this._dateAdapter.getNumDaysInMonth(this._dateAdapter.createDate(t,n,1));this.selectedChange.emit(this._dateAdapter.createDate(t,n,Math.min(this._dateAdapter.getDate(this.activeDate),i)))}_handleCalendarBodyKeydown(e){const t=this._activeDate,n=this._isRtl();switch(e.keyCode){case H.oh:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,n?1:-1);break;case H.SV:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,n?-1:1);break;case H.LH:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,-4);break;case H.JH:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,4);break;case H.Sd:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,-Ie(this._dateAdapter,this.activeDate,this.minDate,this.maxDate));break;case H.uR:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,qe-Ie(this._dateAdapter,this.activeDate,this.minDate,this.maxDate)-1);break;case H.Ku:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?-240:-24);break;case H.VM:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?240:qe);break;case H.K5:case H.L_:this._yearSelected({value:this._dateAdapter.getYear(this._activeDate),event:e});break;default:return}this._dateAdapter.compareDate(t,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCell(),e.preventDefault()}_getActiveCell(){return Ie(this._dateAdapter,this.activeDate,this.minDate,this.maxDate)}_focusActiveCell(){this._matCalendarBody._focusActiveCell()}_createCellForYear(e){const t=this._dateAdapter.createDate(e,0,1),n=this._dateAdapter.getYearName(t),i=this.dateClass?this.dateClass(t,"multi-year"):void 0;return new me(e,n,n,this._shouldEnableYear(e),i)}_shouldEnableYear(e){if(null==e||this.maxDate&&e>this._dateAdapter.getYear(this.maxDate)||this.minDate&&e<this._dateAdapter.getYear(this.minDate))return!1;if(!this.dateFilter)return!0;for(let t=this._dateAdapter.createDate(e,0,1);this._dateAdapter.getYear(t)==e;t=this._dateAdapter.addCalendarDays(t,1))if(this.dateFilter(t))return!0;return!1}_isRtl(){return this._dir&&"rtl"===this._dir.value}_setSelectedYear(e){if(this._selectedYear=null,e instanceof xe){const t=e.start||e.end;t&&(this._selectedYear=this._dateAdapter.getYear(t))}else e&&(this._selectedYear=this._dateAdapter.getYear(e))}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(o.sBO),o.Y36(x._A,8),o.Y36(X.Is,8))},e.\u0275cmp=o.Xpm({type:e,selectors:[["mat-multi-year-view"]],viewQuery:function(e,t){if(1&e&&o.Gf(fe,5),2&e){let e;o.iGM(e=o.CRH())&&(t._matCalendarBody=e.first)}},inputs:{activeDate:"activeDate",selected:"selected",minDate:"minDate",maxDate:"maxDate",dateFilter:"dateFilter",dateClass:"dateClass"},outputs:{selectedChange:"selectedChange",yearSelected:"yearSelected",activeDateChange:"activeDateChange"},exportAs:["matMultiYearView"],decls:5,vars:7,consts:[["role","presentation",1,"mat-calendar-table"],[1,"mat-calendar-table-header"],["colspan","4",1,"mat-calendar-table-header-divider"],["mat-calendar-body","",3,"rows","todayValue","startValue","endValue","numCols","cellAspectRatio","activeCell","selectedValueChange","keydown"]],template:function(e,t){1&e&&(o.TgZ(0,"table",0),o.TgZ(1,"thead",1),o.TgZ(2,"tr"),o._UZ(3,"th",2),o.qZA(),o.qZA(),o.TgZ(4,"tbody",3),o.NdJ("selectedValueChange",function(e){return t._yearSelected(e)})("keydown",function(e){return t._handleCalendarBodyKeydown(e)}),o.qZA(),o.qZA()),2&e&&(o.xp6(4),o.Q6J("rows",t._years)("todayValue",t._todayYear)("startValue",t._selectedYear)("endValue",t._selectedYear)("numCols",4)("cellAspectRatio",4/7)("activeCell",t._getActiveCell()))},directives:[fe],encapsulation:2,changeDetection:0}),e})();function Me(e,t,n,i,a){const s=e.getYear(t),o=e.getYear(n),r=Ue(e,i,a);return Math.floor((s-r)/qe)===Math.floor((o-r)/qe)}function Ie(e,t,n,i){return((e.getYear(t)-Ue(e,n,i))%qe+24)%24}function Ue(e,t,n){let i=0;return n?i=e.getYear(n)-qe+1:t&&(i=e.getYear(t)),i}let Je=(()=>{class e{constructor(e,t,n,i){this._changeDetectorRef=e,this._dateFormats=t,this._dateAdapter=n,this._dir=i,this._rerenderSubscription=L.w.EMPTY,this.selectedChange=new o.vpe,this.monthSelected=new o.vpe,this.activeDateChange=new o.vpe,this._activeDate=this._dateAdapter.today()}get activeDate(){return this._activeDate}set activeDate(e){let t=this._activeDate;const n=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(n,this.minDate,this.maxDate),this._dateAdapter.getYear(t)!==this._dateAdapter.getYear(this._activeDate)&&this._init()}get selected(){return this._selected}set selected(e){this._selected=e instanceof xe?e:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e)),this._setSelectedMonth(e)}get minDate(){return this._minDate}set minDate(e){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}ngAfterContentInit(){this._rerenderSubscription=this._dateAdapter.localeChanges.pipe((0,B.O)(null)).subscribe(()=>this._init())}ngOnDestroy(){this._rerenderSubscription.unsubscribe()}_monthSelected(e){const t=e.value,n=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),t,1);this.monthSelected.emit(n);const i=this._dateAdapter.getNumDaysInMonth(n);this.selectedChange.emit(this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),t,Math.min(this._dateAdapter.getDate(this.activeDate),i)))}_handleCalendarBodyKeydown(e){const t=this._activeDate,n=this._isRtl();switch(e.keyCode){case H.oh:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,n?1:-1);break;case H.SV:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,n?-1:1);break;case H.LH:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,-4);break;case H.JH:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,4);break;case H.Sd:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,-this._dateAdapter.getMonth(this._activeDate));break;case H.uR:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,11-this._dateAdapter.getMonth(this._activeDate));break;case H.Ku:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?-10:-1);break;case H.VM:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?10:1);break;case H.K5:case H.L_:this._monthSelected({value:this._dateAdapter.getMonth(this._activeDate),event:e});break;default:return}this._dateAdapter.compareDate(t,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCell(),e.preventDefault()}_init(){this._setSelectedMonth(this.selected),this._todayMonth=this._getMonthInCurrentYear(this._dateAdapter.today()),this._yearLabel=this._dateAdapter.getYearName(this.activeDate);let e=this._dateAdapter.getMonthNames("short");this._months=[[0,1,2,3],[4,5,6,7],[8,9,10,11]].map(t=>t.map(t=>this._createCellForMonth(t,e[t]))),this._changeDetectorRef.markForCheck()}_focusActiveCell(){this._matCalendarBody._focusActiveCell()}_getMonthInCurrentYear(e){return e&&this._dateAdapter.getYear(e)==this._dateAdapter.getYear(this.activeDate)?this._dateAdapter.getMonth(e):null}_createCellForMonth(e,t){const n=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,1),i=this._dateAdapter.format(n,this._dateFormats.display.monthYearA11yLabel),a=this.dateClass?this.dateClass(n,"year"):void 0;return new me(e,t.toLocaleUpperCase(),i,this._shouldEnableMonth(e),a)}_shouldEnableMonth(e){const t=this._dateAdapter.getYear(this.activeDate);if(null==e||this._isYearAndMonthAfterMaxDate(t,e)||this._isYearAndMonthBeforeMinDate(t,e))return!1;if(!this.dateFilter)return!0;for(let n=this._dateAdapter.createDate(t,e,1);this._dateAdapter.getMonth(n)==e;n=this._dateAdapter.addCalendarDays(n,1))if(this.dateFilter(n))return!0;return!1}_isYearAndMonthAfterMaxDate(e,t){if(this.maxDate){const n=this._dateAdapter.getYear(this.maxDate),i=this._dateAdapter.getMonth(this.maxDate);return e>n||e===n&&t>i}return!1}_isYearAndMonthBeforeMinDate(e,t){if(this.minDate){const n=this._dateAdapter.getYear(this.minDate),i=this._dateAdapter.getMonth(this.minDate);return e<n||e===n&&t<i}return!1}_isRtl(){return this._dir&&"rtl"===this._dir.value}_setSelectedMonth(e){this._selectedMonth=e instanceof xe?this._getMonthInCurrentYear(e.start)||this._getMonthInCurrentYear(e.end):this._getMonthInCurrentYear(e)}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(o.sBO),o.Y36(x.sG,8),o.Y36(x._A,8),o.Y36(X.Is,8))},e.\u0275cmp=o.Xpm({type:e,selectors:[["mat-year-view"]],viewQuery:function(e,t){if(1&e&&o.Gf(fe,5),2&e){let e;o.iGM(e=o.CRH())&&(t._matCalendarBody=e.first)}},inputs:{activeDate:"activeDate",selected:"selected",minDate:"minDate",maxDate:"maxDate",dateFilter:"dateFilter",dateClass:"dateClass"},outputs:{selectedChange:"selectedChange",monthSelected:"monthSelected",activeDateChange:"activeDateChange"},exportAs:["matYearView"],decls:5,vars:9,consts:[["role","presentation",1,"mat-calendar-table"],[1,"mat-calendar-table-header"],["colspan","4",1,"mat-calendar-table-header-divider"],["mat-calendar-body","",3,"label","rows","todayValue","startValue","endValue","labelMinRequiredCells","numCols","cellAspectRatio","activeCell","selectedValueChange","keydown"]],template:function(e,t){1&e&&(o.TgZ(0,"table",0),o.TgZ(1,"thead",1),o.TgZ(2,"tr"),o._UZ(3,"th",2),o.qZA(),o.qZA(),o.TgZ(4,"tbody",3),o.NdJ("selectedValueChange",function(e){return t._monthSelected(e)})("keydown",function(e){return t._handleCalendarBodyKeydown(e)}),o.qZA(),o.qZA()),2&e&&(o.xp6(4),o.Q6J("label",t._yearLabel)("rows",t._months)("todayValue",t._todayMonth)("startValue",t._selectedMonth)("endValue",t._selectedMonth)("labelMinRequiredCells",2)("numCols",4)("cellAspectRatio",4/7)("activeCell",t._dateAdapter.getMonth(t.activeDate)))},directives:[fe],encapsulation:2,changeDetection:0}),e})(),De=0,Oe=(()=>{class e{constructor(e,t,n,i,a){this._intl=e,this.calendar=t,this._dateAdapter=n,this._dateFormats=i,this._buttonDescriptionId="mat-calendar-button-"+De++,this.calendar.stateChanges.subscribe(()=>a.markForCheck())}get periodButtonText(){if("month"==this.calendar.currentView)return this._dateAdapter.format(this.calendar.activeDate,this._dateFormats.display.monthYearLabel).toLocaleUpperCase();if("year"==this.calendar.currentView)return this._dateAdapter.getYearName(this.calendar.activeDate);const e=this._dateAdapter.getYear(this.calendar.activeDate)-Ie(this._dateAdapter,this.calendar.activeDate,this.calendar.minDate,this.calendar.maxDate),t=e+qe-1,n=this._dateAdapter.getYearName(this._dateAdapter.createDate(e,0,1)),i=this._dateAdapter.getYearName(this._dateAdapter.createDate(t,0,1));return this._intl.formatYearRange(n,i)}get periodButtonLabel(){return"month"==this.calendar.currentView?this._intl.switchToMultiYearViewLabel:this._intl.switchToMonthViewLabel}get prevButtonLabel(){return{month:this._intl.prevMonthLabel,year:this._intl.prevYearLabel,"multi-year":this._intl.prevMultiYearLabel}[this.calendar.currentView]}get nextButtonLabel(){return{month:this._intl.nextMonthLabel,year:this._intl.nextYearLabel,"multi-year":this._intl.nextMultiYearLabel}[this.calendar.currentView]}currentPeriodClicked(){this.calendar.currentView="month"==this.calendar.currentView?"multi-year":"month"}previousClicked(){this.calendar.activeDate="month"==this.calendar.currentView?this._dateAdapter.addCalendarMonths(this.calendar.activeDate,-1):this._dateAdapter.addCalendarYears(this.calendar.activeDate,"year"==this.calendar.currentView?-1:-24)}nextClicked(){this.calendar.activeDate="month"==this.calendar.currentView?this._dateAdapter.addCalendarMonths(this.calendar.activeDate,1):this._dateAdapter.addCalendarYears(this.calendar.activeDate,"year"==this.calendar.currentView?1:qe)}previousEnabled(){return!this.calendar.minDate||!this.calendar.minDate||!this._isSameView(this.calendar.activeDate,this.calendar.minDate)}nextEnabled(){return!this.calendar.maxDate||!this._isSameView(this.calendar.activeDate,this.calendar.maxDate)}_isSameView(e,t){return"month"==this.calendar.currentView?this._dateAdapter.getYear(e)==this._dateAdapter.getYear(t)&&this._dateAdapter.getMonth(e)==this._dateAdapter.getMonth(t):"year"==this.calendar.currentView?this._dateAdapter.getYear(e)==this._dateAdapter.getYear(t):Me(this._dateAdapter,e,t,this.calendar.minDate,this.calendar.maxDate)}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(he),o.Y36((0,o.Gpc)(()=>Pe)),o.Y36(x._A,8),o.Y36(x.sG,8),o.Y36(o.sBO))},e.\u0275cmp=o.Xpm({type:e,selectors:[["mat-calendar-header"]],exportAs:["matCalendarHeader"],ngContentSelectors:ae,decls:10,vars:10,consts:[[1,"mat-calendar-header"],[1,"mat-calendar-controls"],["mat-button","","type","button","cdkAriaLive","polite",1,"mat-calendar-period-button",3,"click"],[1,"mat-calendar-arrow"],[1,"mat-calendar-spacer"],["mat-icon-button","","type","button",1,"mat-calendar-previous-button",3,"disabled","click"],["mat-icon-button","","type","button",1,"mat-calendar-next-button",3,"disabled","click"]],template:function(e,t){1&e&&(o.F$t(),o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"button",2),o.NdJ("click",function(){return t.currentPeriodClicked()}),o.TgZ(3,"span"),o._uU(4),o.qZA(),o._UZ(5,"div",3),o.qZA(),o._UZ(6,"div",4),o.Hsn(7),o.TgZ(8,"button",5),o.NdJ("click",function(){return t.previousClicked()}),o.qZA(),o.TgZ(9,"button",6),o.NdJ("click",function(){return t.nextClicked()}),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(2),o.uIk("aria-label",t.periodButtonLabel)("aria-describedby",t._buttonDescriptionId),o.xp6(1),o.uIk("id",t._buttonDescriptionId),o.xp6(1),o.Oqu(t.periodButtonText),o.xp6(1),o.ekj("mat-calendar-invert","month"!==t.calendar.currentView),o.xp6(3),o.Q6J("disabled",!t.previousEnabled()),o.uIk("aria-label",t.prevButtonLabel),o.xp6(1),o.Q6J("disabled",!t.nextEnabled()),o.uIk("aria-label",t.nextButtonLabel))},directives:[g.lW,Y.Qr],encapsulation:2,changeDetection:0}),e})(),Pe=(()=>{class e{constructor(e,t,n,i){this._dateAdapter=t,this._dateFormats=n,this._changeDetectorRef=i,this._moveFocusOnNextTick=!1,this.startView="month",this.selectedChange=new o.vpe,this.yearSelected=new o.vpe,this.monthSelected=new o.vpe,this.viewChanged=new o.vpe(!0),this._userSelection=new o.vpe,this.stateChanges=new b.xQ,this._intlChanges=e.changes.subscribe(()=>{i.markForCheck(),this.stateChanges.next()})}get startAt(){return this._startAt}set startAt(e){this._startAt=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get selected(){return this._selected}set selected(e){this._selected=e instanceof xe?e:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get minDate(){return this._minDate}set minDate(e){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get activeDate(){return this._clampedActiveDate}set activeDate(e){this._clampedActiveDate=this._dateAdapter.clampDate(e,this.minDate,this.maxDate),this.stateChanges.next(),this._changeDetectorRef.markForCheck()}get currentView(){return this._currentView}set currentView(e){const t=this._currentView!==e?e:null;this._currentView=e,this._moveFocusOnNextTick=!0,this._changeDetectorRef.markForCheck(),t&&this.viewChanged.emit(t)}ngAfterContentInit(){this._calendarHeaderPortal=new R.C5(this.headerComponent||Oe),this.activeDate=this.startAt||this._dateAdapter.today(),this._currentView=this.startView}ngAfterViewChecked(){this._moveFocusOnNextTick&&(this._moveFocusOnNextTick=!1,this.focusActiveCell())}ngOnDestroy(){this._intlChanges.unsubscribe(),this.stateChanges.complete()}ngOnChanges(e){const t=e.minDate||e.maxDate||e.dateFilter;if(t&&!t.firstChange){const e=this._getCurrentViewComponent();e&&(this._changeDetectorRef.detectChanges(),e._init())}this.stateChanges.next()}focusActiveCell(){this._getCurrentViewComponent()._focusActiveCell(!1)}updateTodaysDate(){const e=this.currentView;let t;t="month"===e?this.monthView:"year"===e?this.yearView:this.multiYearView,t._init()}_dateSelected(e){const t=e.value;(this.selected instanceof xe||t&&!this._dateAdapter.sameDate(t,this.selected))&&this.selectedChange.emit(t),this._userSelection.emit(e)}_yearSelectedInMultiYearView(e){this.yearSelected.emit(e)}_monthSelectedInYearView(e){this.monthSelected.emit(e)}_goToDateInView(e,t){this.activeDate=e,this.currentView=t}_getCurrentViewComponent(){return this.monthView||this.yearView||this.multiYearView}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(he),o.Y36(x._A,8),o.Y36(x.sG,8),o.Y36(o.sBO))},e.\u0275cmp=o.Xpm({type:e,selectors:[["mat-calendar"]],viewQuery:function(e,t){if(1&e&&(o.Gf(Te,5),o.Gf(Je,5),o.Gf(ke,5)),2&e){let e;o.iGM(e=o.CRH())&&(t.monthView=e.first),o.iGM(e=o.CRH())&&(t.yearView=e.first),o.iGM(e=o.CRH())&&(t.multiYearView=e.first)}},hostAttrs:[1,"mat-calendar"],inputs:{startView:"startView",startAt:"startAt",selected:"selected",minDate:"minDate",maxDate:"maxDate",headerComponent:"headerComponent",dateFilter:"dateFilter",dateClass:"dateClass",comparisonStart:"comparisonStart",comparisonEnd:"comparisonEnd"},outputs:{selectedChange:"selectedChange",yearSelected:"yearSelected",monthSelected:"monthSelected",viewChanged:"viewChanged",_userSelection:"_userSelection"},exportAs:["matCalendar"],features:[o._Bn([we]),o.TTD],decls:5,vars:5,consts:[[3,"cdkPortalOutlet"],["cdkMonitorSubtreeFocus","","tabindex","-1",1,"mat-calendar-content",3,"ngSwitch"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","comparisonStart","comparisonEnd","activeDateChange","_userSelection",4,"ngSwitchCase"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","activeDateChange","monthSelected","selectedChange",4,"ngSwitchCase"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","activeDateChange","yearSelected","selectedChange",4,"ngSwitchCase"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","comparisonStart","comparisonEnd","activeDateChange","_userSelection"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","activeDateChange","monthSelected","selectedChange"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","activeDateChange","yearSelected","selectedChange"]],template:function(e,t){1&e&&(o.YNc(0,se,0,0,"ng-template",0),o.TgZ(1,"div",1),o.YNc(2,oe,1,8,"mat-month-view",2),o.YNc(3,re,1,6,"mat-year-view",3),o.YNc(4,le,1,6,"mat-multi-year-view",4),o.qZA()),2&e&&(o.Q6J("cdkPortalOutlet",t._calendarHeaderPortal),o.xp6(1),o.Q6J("ngSwitch",t.currentView),o.xp6(1),o.Q6J("ngSwitchCase","month"),o.xp6(1),o.Q6J("ngSwitchCase","year"),o.xp6(1),o.Q6J("ngSwitchCase","multi-year"))},directives:[R.Pl,Y.kH,i.RF,i.n9,Te,Je,ke],styles:['.mat-calendar{display:block}.mat-calendar-header{padding:8px 8px 0 8px}.mat-calendar-content{padding:0 8px 8px 8px;outline:none}.mat-calendar-controls{display:flex;margin:5% calc(33% / 7 - 16px)}.mat-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:.04}.mat-calendar-spacer{flex:1 1 auto}.mat-calendar-period-button{min-width:0}.mat-calendar-arrow{display:inline-block;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top-width:5px;border-top-style:solid;margin:0 0 0 5px;vertical-align:middle}.mat-calendar-arrow.mat-calendar-invert{transform:rotate(180deg)}[dir=rtl] .mat-calendar-arrow{margin:0 5px 0 0}.mat-calendar-previous-button,.mat-calendar-next-button{position:relative}.mat-calendar-previous-button::after,.mat-calendar-next-button::after{top:0;left:0;right:0;bottom:0;position:absolute;content:"";margin:15.5px;border:0 solid currentColor;border-top-width:2px}[dir=rtl] .mat-calendar-previous-button,[dir=rtl] .mat-calendar-next-button{transform:rotate(180deg)}.mat-calendar-previous-button::after{border-left-width:2px;transform:translateX(2px) rotate(-45deg)}.mat-calendar-next-button::after{border-right-width:2px;transform:translateX(-2px) rotate(45deg)}.mat-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mat-calendar-table-header th{text-align:center;padding:0 0 8px 0}.mat-calendar-table-header-divider{position:relative;height:1px}.mat-calendar-table-header-divider::after{content:"";position:absolute;top:0;left:-8px;right:-8px;height:1px}\n'],encapsulation:2,changeDetection:0}),e})();const Se={transformPanel:(0,G.X$)("transformPanel",[(0,G.SB)("void",(0,G.oB)({opacity:0,transform:"scale(1, 0.8)"})),(0,G.eR)("void => enter",(0,G.jt)("120ms cubic-bezier(0, 0, 0.2, 1)",(0,G.oB)({opacity:1,transform:"scale(1, 1)"}))),(0,G.eR)("* => void",(0,G.jt)("100ms linear",(0,G.oB)({opacity:0})))]),fadeInCalendar:(0,G.X$)("fadeInCalendar",[(0,G.SB)("void",(0,G.oB)({opacity:0})),(0,G.SB)("enter",(0,G.oB)({opacity:1})),(0,G.eR)("void => *",(0,G.jt)("120ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)"))])};let Ne=0;const Qe=new o.OlP("mat-datepicker-scroll-strategy"),Ye={provide:Qe,deps:[F.aV],useFactory:function(e){return()=>e.scrollStrategies.reposition()}};class Fe{constructor(e){this._elementRef=e}}const Re=(0,x.pj)(Fe);let Ee=(()=>{class e extends Re{constructor(e,t,n,i,a,s){super(e),this._changeDetectorRef=t,this._globalModel=n,this._dateAdapter=i,this._rangeSelectionStrategy=a,this._subscriptions=new L.w,this._animationState="enter",this._animationDone=new b.xQ,this._actionsPortal=null,this._closeButtonText=(null==s?void 0:s.closeCalendarLabel)||"Close calendar"}ngOnInit(){this._model=this._actionsPortal?this._globalModel.clone():this._globalModel}ngAfterViewInit(){this._subscriptions.add(this.datepicker.stateChanges.subscribe(()=>{this._changeDetectorRef.markForCheck()})),this._calendar.focusActiveCell()}ngOnDestroy(){this._subscriptions.unsubscribe(),this._animationDone.complete()}_handleUserSelection(e){const t=this._model.selection,n=e.value,i=t instanceof xe;if(i&&this._rangeSelectionStrategy){const i=this._rangeSelectionStrategy.selectionFinished(n,t,e.event);this._model.updateSelection(i,this)}else!n||!i&&this._dateAdapter.sameDate(n,t)||this._model.add(n);this._model&&!this._model.isComplete()||this._actionsPortal||this.datepicker.close()}_startExitAnimation(){this._animationState="void",this._changeDetectorRef.markForCheck()}_getSelected(){return this._model.selection}_applyPendingSelection(){this._model!==this._globalModel&&this._globalModel.updateSelection(this._model.selection,this)}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(o.SBq),o.Y36(o.sBO),o.Y36(Ae),o.Y36(x._A),o.Y36(Ce,8),o.Y36(he))},e.\u0275cmp=o.Xpm({type:e,selectors:[["mat-datepicker-content"]],viewQuery:function(e,t){if(1&e&&o.Gf(Pe,5),2&e){let e;o.iGM(e=o.CRH())&&(t._calendar=e.first)}},hostAttrs:[1,"mat-datepicker-content"],hostVars:3,hostBindings:function(e,t){1&e&&o.WFA("@transformPanel.done",function(){return t._animationDone.next()}),2&e&&(o.d8E("@transformPanel",t._animationState),o.ekj("mat-datepicker-content-touch",t.datepicker.touchUi))},inputs:{color:"color"},exportAs:["matDatepickerContent"],features:[o.qOj],decls:5,vars:20,consts:[["cdkTrapFocus","",1,"mat-datepicker-content-container"],[3,"id","ngClass","startAt","startView","minDate","maxDate","dateFilter","headerComponent","selected","dateClass","comparisonStart","comparisonEnd","yearSelected","monthSelected","viewChanged","_userSelection"],[3,"cdkPortalOutlet"],["type","button","mat-raised-button","",1,"mat-datepicker-close-button",3,"color","focus","blur","click"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"mat-calendar",1),o.NdJ("yearSelected",function(e){return t.datepicker._selectYear(e)})("monthSelected",function(e){return t.datepicker._selectMonth(e)})("viewChanged",function(e){return t.datepicker._viewChanged(e)})("_userSelection",function(e){return t._handleUserSelection(e)}),o.qZA(),o.YNc(2,ce,0,0,"ng-template",2),o.TgZ(3,"button",3),o.NdJ("focus",function(){return t._closeButtonFocused=!0})("blur",function(){return t._closeButtonFocused=!1})("click",function(){return t.datepicker.close()}),o._uU(4),o.qZA(),o.qZA()),2&e&&(o.ekj("mat-datepicker-content-container-with-actions",t._actionsPortal),o.xp6(1),o.Q6J("id",t.datepicker.id)("ngClass",t.datepicker.panelClass)("startAt",t.datepicker.startAt)("startView",t.datepicker.startView)("minDate",t.datepicker._getMinDate())("maxDate",t.datepicker._getMaxDate())("dateFilter",t.datepicker._getDateFilter())("headerComponent",t.datepicker.calendarHeaderComponent)("selected",t._getSelected())("dateClass",t.datepicker.dateClass)("comparisonStart",t.comparisonStart)("comparisonEnd",t.comparisonEnd)("@fadeInCalendar","enter"),o.xp6(1),o.Q6J("cdkPortalOutlet",t._actionsPortal),o.xp6(1),o.ekj("cdk-visually-hidden",!t._closeButtonFocused),o.Q6J("color",t.color||"primary"),o.xp6(1),o.Oqu(t._closeButtonText))},directives:[Y.mK,Pe,i.mk,R.Pl,g.lW],styles:[".mat-datepicker-content{display:block;border-radius:4px}.mat-datepicker-content .mat-calendar{width:296px;height:354px}.mat-datepicker-content .mat-datepicker-close-button{position:absolute;top:100%;left:0;margin-top:8px}.ng-animating .mat-datepicker-content .mat-datepicker-close-button{display:none}.mat-datepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.mat-datepicker-content-touch{display:block;max-height:80vh;overflow:auto;margin:-24px}.mat-datepicker-content-touch .mat-datepicker-content-container{min-height:312px;max-height:788px;min-width:250px;max-width:750px}.mat-datepicker-content-touch .mat-calendar{width:100%;height:auto}@media all and (orientation: landscape){.mat-datepicker-content-touch .mat-datepicker-content-container{width:64vh;height:80vh}}@media all and (orientation: portrait){.mat-datepicker-content-touch .mat-datepicker-content-container{width:80vw;height:100vw}.mat-datepicker-content-touch .mat-datepicker-content-container-with-actions{height:115vw}}\n"],encapsulation:2,data:{animation:[Se.transformPanel,Se.fadeInCalendar]},changeDetection:0}),e})(),Le=(()=>{class e{constructor(e,t,n,i,a,s,r,l,c){this._dialog=e,this._overlay=t,this._ngZone=n,this._viewContainerRef=i,this._dateAdapter=s,this._dir=r,this._document=l,this._model=c,this._inputStateChanges=L.w.EMPTY,this.startView="month",this._touchUi=!1,this.xPosition="start",this.yPosition="below",this._restoreFocus=!0,this.yearSelected=new o.vpe,this.monthSelected=new o.vpe,this.viewChanged=new o.vpe(!0),this.openedStream=new o.vpe,this.closedStream=new o.vpe,this._opened=!1,this.id="mat-datepicker-"+Ne++,this._focusedElementBeforeOpen=null,this._backdropHarnessClass=`${this.id}-backdrop`,this.stateChanges=new b.xQ,this._scrollStrategy=a}get startAt(){return this._startAt||(this.datepickerInput?this.datepickerInput.getStartValue():null)}set startAt(e){this._startAt=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get color(){return this._color||(this.datepickerInput?this.datepickerInput.getThemePalette():void 0)}set color(e){this._color=e}get touchUi(){return this._touchUi}set touchUi(e){this._touchUi=(0,_.Ig)(e)}get disabled(){return void 0===this._disabled&&this.datepickerInput?this.datepickerInput.disabled:!!this._disabled}set disabled(e){const t=(0,_.Ig)(e);t!==this._disabled&&(this._disabled=t,this.stateChanges.next(void 0))}get restoreFocus(){return this._restoreFocus}set restoreFocus(e){this._restoreFocus=(0,_.Ig)(e)}get panelClass(){return this._panelClass}set panelClass(e){this._panelClass=(0,_.du)(e)}get opened(){return this._opened}set opened(e){(0,_.Ig)(e)?this.open():this.close()}_getMinDate(){return this.datepickerInput&&this.datepickerInput.min}_getMaxDate(){return this.datepickerInput&&this.datepickerInput.max}_getDateFilter(){return this.datepickerInput&&this.datepickerInput.dateFilter}ngOnChanges(e){const t=e.xPosition||e.yPosition;t&&!t.firstChange&&this._popupRef&&(this._setConnectedPositions(this._popupRef.getConfig().positionStrategy),this.opened&&this._popupRef.updatePosition()),this.stateChanges.next(void 0)}ngOnDestroy(){this._destroyPopup(),this.close(),this._inputStateChanges.unsubscribe(),this.stateChanges.complete()}select(e){this._model.add(e)}_selectYear(e){this.yearSelected.emit(e)}_selectMonth(e){this.monthSelected.emit(e)}_viewChanged(e){this.viewChanged.emit(e)}registerInput(e){return this._inputStateChanges.unsubscribe(),this.datepickerInput=e,this._inputStateChanges=e.stateChanges.subscribe(()=>this.stateChanges.next(void 0)),this._model}registerActions(e){this._actionsPortal=e}removeActions(e){e===this._actionsPortal&&(this._actionsPortal=null)}open(){this._opened||this.disabled||(this._document&&(this._focusedElementBeforeOpen=this._document.activeElement),this.touchUi?this._openAsDialog():this._openAsPopup(),this._opened=!0,this.openedStream.emit())}close(){if(!this._opened)return;if(this._popupComponentRef&&this._popupRef){const e=this._popupComponentRef.instance;e._startExitAnimation(),e._animationDone.pipe((0,z.q)(1)).subscribe(()=>this._destroyPopup())}this._dialogRef&&(this._dialogRef.close(),this._dialogRef=null);const e=()=>{this._opened&&(this._opened=!1,this.closedStream.emit(),this._focusedElementBeforeOpen=null)};this._restoreFocus&&this._focusedElementBeforeOpen&&"function"==typeof this._focusedElementBeforeOpen.focus?(this._focusedElementBeforeOpen.focus(),setTimeout(e)):e()}_applyPendingSelection(){var e,t;const n=(null===(e=this._popupComponentRef)||void 0===e?void 0:e.instance)||(null===(t=this._dialogRef)||void 0===t?void 0:t.componentInstance);null==n||n._applyPendingSelection()}_openAsDialog(){this._dialogRef&&this._dialogRef.close(),this._dialogRef=this._dialog.open(Ee,{direction:this._dir?this._dir.value:"ltr",viewContainerRef:this._viewContainerRef,panelClass:"mat-datepicker-dialog",hasBackdrop:!0,disableClose:!1,backdropClass:["cdk-overlay-dark-backdrop",this._backdropHarnessClass],width:"",height:"",minWidth:"",minHeight:"",maxWidth:"80vw",maxHeight:"",position:{},autoFocus:!1,restoreFocus:!1}),this._dialogRef.afterClosed().subscribe(()=>this.close()),this._forwardContentValues(this._dialogRef.componentInstance)}_openAsPopup(){const e=new R.C5(Ee,this._viewContainerRef);this._destroyPopup(),this._createPopup(),this._popupComponentRef=this._popupRef.attach(e),this._forwardContentValues(this._popupComponentRef.instance),this._ngZone.onStable.pipe((0,z.q)(1)).subscribe(()=>{this._popupRef.updatePosition()})}_forwardContentValues(e){e.datepicker=this,e.color=this.color,e._actionsPortal=this._actionsPortal}_createPopup(){const e=this._overlay.position().flexibleConnectedTo(this.datepickerInput.getConnectedOverlayOrigin()).withTransformOriginOn(".mat-datepicker-content").withFlexibleDimensions(!1).withViewportMargin(8).withLockedPosition(),t=new F.X_({positionStrategy:this._setConnectedPositions(e),hasBackdrop:!0,backdropClass:["mat-overlay-transparent-backdrop",this._backdropHarnessClass],direction:this._dir,scrollStrategy:this._scrollStrategy(),panelClass:"mat-datepicker-popup"});this._popupRef=this._overlay.create(t),this._popupRef.overlayElement.setAttribute("role","dialog"),(0,$.T)(this._popupRef.backdropClick(),this._popupRef.detachments(),this._popupRef.keydownEvents().pipe((0,j.h)(e=>e.keyCode===H.hY&&!(0,H.Vb)(e)||this.datepickerInput&&(0,H.Vb)(e,"altKey")&&e.keyCode===H.LH))).subscribe(e=>{e&&e.preventDefault(),this.close()})}_destroyPopup(){this._popupRef&&(this._popupRef.dispose(),this._popupRef=this._popupComponentRef=null)}_setConnectedPositions(e){const t="end"===this.xPosition?"end":"start",n="start"===t?"end":"start",i="above"===this.yPosition?"bottom":"top",a="top"===i?"bottom":"top";return e.withPositions([{originX:t,originY:a,overlayX:t,overlayY:i},{originX:t,originY:i,overlayX:t,overlayY:a},{originX:n,originY:a,overlayX:n,overlayY:i},{originX:n,originY:i,overlayX:n,overlayY:a}])}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(m.uw),o.Y36(F.aV),o.Y36(o.R0b),o.Y36(o.s_b),o.Y36(Qe),o.Y36(x._A,8),o.Y36(X.Is,8),o.Y36(i.K0,8),o.Y36(Ae))},e.\u0275dir=o.lG2({type:e,inputs:{startView:"startView",xPosition:"xPosition",yPosition:"yPosition",startAt:"startAt",color:"color",touchUi:"touchUi",disabled:"disabled",restoreFocus:"restoreFocus",panelClass:"panelClass",opened:"opened",calendarHeaderComponent:"calendarHeaderComponent",dateClass:"dateClass"},outputs:{yearSelected:"yearSelected",monthSelected:"monthSelected",viewChanged:"viewChanged",openedStream:"opened",closedStream:"closed"},features:[o.TTD]}),e})(),$e=(()=>{class e extends Le{}return e.\u0275fac=function(){let t;return function(n){return(t||(t=o.n5z(e)))(n||e)}}(),e.\u0275cmp=o.Xpm({type:e,selectors:[["mat-datepicker"]],exportAs:["matDatepicker"],features:[o._Bn([we,{provide:Le,useExisting:e}]),o.qOj],decls:0,vars:0,template:function(e,t){},encapsulation:2,changeDetection:0}),e})();class Ve{constructor(e,t){this.target=e,this.targetElement=t,this.value=this.target.value}}let He=(()=>{class e{constructor(e,t,n){this._elementRef=e,this._dateAdapter=t,this._dateFormats=n,this.dateChange=new o.vpe,this.dateInput=new o.vpe,this.stateChanges=new b.xQ,this._onTouched=()=>{},this._validatorOnChange=()=>{},this._cvaOnChange=()=>{},this._valueChangesSubscription=L.w.EMPTY,this._localeSubscription=L.w.EMPTY,this._parseValidator=()=>this._lastValueValid?null:{matDatepickerParse:{text:this._elementRef.nativeElement.value}},this._filterValidator=e=>{const t=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e.value));return!t||this._matchesFilter(t)?null:{matDatepickerFilter:!0}},this._minValidator=e=>{const t=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e.value)),n=this._getMinDate();return!n||!t||this._dateAdapter.compareDate(n,t)<=0?null:{matDatepickerMin:{min:n,actual:t}}},this._maxValidator=e=>{const t=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e.value)),n=this._getMaxDate();return!n||!t||this._dateAdapter.compareDate(n,t)>=0?null:{matDatepickerMax:{max:n,actual:t}}},this._lastValueValid=!1,this._localeSubscription=t.localeChanges.subscribe(()=>{this._assignValueProgrammatically(this.value)})}get value(){return this._model?this._getValueFromModel(this._model.selection):this._pendingValue}set value(e){this._assignValueProgrammatically(e)}get disabled(){return!!this._disabled||this._parentDisabled()}set disabled(e){const t=(0,_.Ig)(e),n=this._elementRef.nativeElement;this._disabled!==t&&(this._disabled=t,this.stateChanges.next(void 0)),t&&this._isInitialized&&n.blur&&n.blur()}_getValidators(){return[this._parseValidator,this._minValidator,this._maxValidator,this._filterValidator]}_registerModel(e){this._model=e,this._valueChangesSubscription.unsubscribe(),this._pendingValue&&this._assignValue(this._pendingValue),this._valueChangesSubscription=this._model.selectionChanged.subscribe(e=>{if(this._shouldHandleChangeEvent(e)){const t=this._getValueFromModel(e.selection);this._lastValueValid=this._isValidValue(t),this._cvaOnChange(t),this._onTouched(),this._formatValue(t),this.dateInput.emit(new Ve(this,this._elementRef.nativeElement)),this.dateChange.emit(new Ve(this,this._elementRef.nativeElement))}})}ngAfterViewInit(){this._isInitialized=!0}ngOnChanges(e){(function(e,t){const n=Object.keys(e);for(let i of n){const{previousValue:n,currentValue:a}=e[i];if(!t.isDateInstance(n)||!t.isDateInstance(a))return!0;if(!t.sameDate(n,a))return!0}return!1})(e,this._dateAdapter)&&this.stateChanges.next(void 0)}ngOnDestroy(){this._valueChangesSubscription.unsubscribe(),this._localeSubscription.unsubscribe(),this.stateChanges.complete()}registerOnValidatorChange(e){this._validatorOnChange=e}validate(e){return this._validator?this._validator(e):null}writeValue(e){this._assignValueProgrammatically(e)}registerOnChange(e){this._cvaOnChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e}_onKeydown(e){e.altKey&&e.keyCode===H.JH&&!this._elementRef.nativeElement.readOnly&&(this._openPopup(),e.preventDefault())}_onInput(e){const t=this._lastValueValid;let n=this._dateAdapter.parse(e,this._dateFormats.parse.dateInput);this._lastValueValid=this._isValidValue(n),n=this._dateAdapter.getValidDateOrNull(n),this._dateAdapter.sameDate(n,this.value)?(e&&!this.value&&this._cvaOnChange(n),t!==this._lastValueValid&&this._validatorOnChange()):(this._assignValue(n),this._cvaOnChange(n),this.dateInput.emit(new Ve(this,this._elementRef.nativeElement)))}_onChange(){this.dateChange.emit(new Ve(this,this._elementRef.nativeElement))}_onBlur(){this.value&&this._formatValue(this.value),this._onTouched()}_formatValue(e){this._elementRef.nativeElement.value=e?this._dateAdapter.format(e,this._dateFormats.display.dateInput):""}_assignValue(e){this._model?(this._assignValueToModel(e),this._pendingValue=null):this._pendingValue=e}_isValidValue(e){return!e||this._dateAdapter.isValid(e)}_parentDisabled(){return!1}_assignValueProgrammatically(e){e=this._dateAdapter.deserialize(e),this._lastValueValid=this._isValidValue(e),e=this._dateAdapter.getValidDateOrNull(e),this._assignValue(e),this._formatValue(e)}_matchesFilter(e){const t=this._getDateFilter();return!t||t(e)}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(o.SBq),o.Y36(x._A,8),o.Y36(x.sG,8))},e.\u0275dir=o.lG2({type:e,inputs:{value:"value",disabled:"disabled"},outputs:{dateChange:"dateChange",dateInput:"dateInput"},features:[o.TTD]}),e})();const ze={provide:a.JU,useExisting:(0,o.Gpc)(()=>je),multi:!0},Be={provide:a.Cf,useExisting:(0,o.Gpc)(()=>je),multi:!0};let je=(()=>{class e extends He{constructor(e,t,n,i){super(e,t,n),this._formField=i,this._closedSubscription=L.w.EMPTY,this._validator=a.kI.compose(super._getValidators())}set matDatepicker(e){e&&(this._datepicker=e,this._closedSubscription=e.closedStream.subscribe(()=>this._onTouched()),this._registerModel(e.registerInput(this)))}get min(){return this._min}set min(e){const t=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e));this._dateAdapter.sameDate(t,this._min)||(this._min=t,this._validatorOnChange())}get max(){return this._max}set max(e){const t=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e));this._dateAdapter.sameDate(t,this._max)||(this._max=t,this._validatorOnChange())}get dateFilter(){return this._dateFilter}set dateFilter(e){const t=this._matchesFilter(this.value);this._dateFilter=e,this._matchesFilter(this.value)!==t&&this._validatorOnChange()}getConnectedOverlayOrigin(){return this._formField?this._formField.getConnectedOverlayOrigin():this._elementRef}getThemePalette(){return this._formField?this._formField.color:void 0}getStartValue(){return this.value}ngOnDestroy(){super.ngOnDestroy(),this._closedSubscription.unsubscribe()}_openPopup(){this._datepicker&&this._datepicker.open()}_getValueFromModel(e){return e}_assignValueToModel(e){this._model&&this._model.updateSelection(e,this)}_getMinDate(){return this._min}_getMaxDate(){return this._max}_getDateFilter(){return this._dateFilter}_shouldHandleChangeEvent(e){return e.source!==this}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(o.SBq),o.Y36(x._A,8),o.Y36(x.sG,8),o.Y36(A.G_,8))},e.\u0275dir=o.lG2({type:e,selectors:[["input","matDatepicker",""]],hostAttrs:[1,"mat-datepicker-input"],hostVars:6,hostBindings:function(e,t){1&e&&o.NdJ("input",function(e){return t._onInput(e.target.value)})("change",function(){return t._onChange()})("blur",function(){return t._onBlur()})("keydown",function(e){return t._onKeydown(e)}),2&e&&(o.Ikx("disabled",t.disabled),o.uIk("aria-haspopup",t._datepicker?"dialog":null)("aria-owns",(null==t._datepicker?null:t._datepicker.opened)&&t._datepicker.id||null)("min",t.min?t._dateAdapter.toIso8601(t.min):null)("max",t.max?t._dateAdapter.toIso8601(t.max):null)("data-mat-calendar",t._datepicker?t._datepicker.id:null))},inputs:{matDatepicker:"matDatepicker",min:"min",max:"max",dateFilter:["matDatepickerFilter","dateFilter"]},exportAs:["matDatepickerInput"],features:[o._Bn([ze,Be,{provide:y,useExisting:e}]),o.qOj]}),e})(),Ge=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=o.lG2({type:e,selectors:[["","matDatepickerToggleIcon",""]]}),e})(),Xe=(()=>{class e{constructor(e,t,n){this._intl=e,this._changeDetectorRef=t,this._stateChanges=L.w.EMPTY;const i=Number(n);this.tabIndex=i||0===i?i:null}get disabled(){return void 0===this._disabled&&this.datepicker?this.datepicker.disabled:!!this._disabled}set disabled(e){this._disabled=(0,_.Ig)(e)}ngOnChanges(e){e.datepicker&&this._watchStateChanges()}ngOnDestroy(){this._stateChanges.unsubscribe()}ngAfterContentInit(){this._watchStateChanges()}_open(e){this.datepicker&&!this.disabled&&(this.datepicker.open(),e.stopPropagation())}_watchStateChanges(){const e=this.datepicker?this.datepicker.stateChanges:(0,V.of)(),t=this.datepicker&&this.datepicker.datepickerInput?this.datepicker.datepickerInput.stateChanges:(0,V.of)(),n=this.datepicker?(0,$.T)(this.datepicker.openedStream,this.datepicker.closedStream):(0,V.of)();this._stateChanges.unsubscribe(),this._stateChanges=(0,$.T)(this._intl.changes,e,t,n).subscribe(()=>this._changeDetectorRef.markForCheck())}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(he),o.Y36(o.sBO),o.$8M("tabindex"))},e.\u0275cmp=o.Xpm({type:e,selectors:[["mat-datepicker-toggle"]],contentQueries:function(e,t,n){if(1&e&&o.Suo(n,Ge,5),2&e){let e;o.iGM(e=o.CRH())&&(t._customIcon=e.first)}},viewQuery:function(e,t){if(1&e&&o.Gf(de,5),2&e){let e;o.iGM(e=o.CRH())&&(t._button=e.first)}},hostAttrs:[1,"mat-datepicker-toggle"],hostVars:8,hostBindings:function(e,t){1&e&&o.NdJ("click",function(e){return t._open(e)}),2&e&&(o.uIk("tabindex",null)("data-mat-calendar",t.datepicker?t.datepicker.id:null),o.ekj("mat-datepicker-toggle-active",t.datepicker&&t.datepicker.opened)("mat-accent",t.datepicker&&"accent"===t.datepicker.color)("mat-warn",t.datepicker&&"warn"===t.datepicker.color))},inputs:{tabIndex:"tabIndex",disabled:"disabled",datepicker:["for","datepicker"],ariaLabel:["aria-label","ariaLabel"],disableRipple:"disableRipple"},exportAs:["matDatepickerToggle"],features:[o.TTD],ngContentSelectors:pe,decls:4,vars:6,consts:[["mat-icon-button","","type","button",3,"disabled","disableRipple"],["button",""],["class","mat-datepicker-toggle-default-icon","viewBox","0 0 24 24","width","24px","height","24px","fill","currentColor","focusable","false",4,"ngIf"],["viewBox","0 0 24 24","width","24px","height","24px","fill","currentColor","focusable","false",1,"mat-datepicker-toggle-default-icon"],["d","M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z"]],template:function(e,t){1&e&&(o.F$t(ge),o.TgZ(0,"button",0,1),o.YNc(2,ue,2,0,"svg",2),o.Hsn(3),o.qZA()),2&e&&(o.Q6J("disabled",t.disabled)("disableRipple",t.disableRipple),o.uIk("aria-haspopup",t.datepicker?"dialog":null)("aria-label",t.ariaLabel||t._intl.openCalendarLabel)("tabindex",t.disabled?-1:t.tabIndex),o.xp6(2),o.Q6J("ngIf",!t._customIcon))},directives:[g.lW,i.O5],styles:[".mat-form-field-appearance-legacy .mat-form-field-prefix .mat-datepicker-toggle-default-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mat-datepicker-toggle-default-icon{width:1em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-datepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-datepicker-toggle-default-icon{display:block;width:1.5em;height:1.5em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-datepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-datepicker-toggle-default-icon{margin:auto}.cdk-high-contrast-active .mat-datepicker-toggle-default-icon{color:CanvasText}\n"],encapsulation:2,changeDetection:0}),e})(),We=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=o.oAB({type:e}),e.\u0275inj=o.cJS({providers:[he,Ye],imports:[[i.ez,g.ot,m.Is,F.U8,Y.rt,R.eL,x.BQ],E.ZD]}),e})();var Ke=n(171);const et={admin:{tagTypes:[{name:"custom"}],pages:[]}};var tt=n(7673);let nt=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=o.oAB({type:e}),e.\u0275inj=o.cJS({imports:[[i.ez,g.ot,O.Ps]]}),e})();var it=n(3461),at=n(3543),st=n(4673),ot=n(837),rt=n(4434),lt=n(3297);let ct=(()=>{class e{constructor(e){this.settings=e,this.menu=this.generateMenu()}ngOnInit(){this.menu=this.generateMenu()}getCustomSidebarItems(){return this.settings.get("vebto.admin.pages")}generateMenu(){const e=[{name:"analytics",icon:"pie-chart",permission:"reports.view",route:"analytics"},{name:"appearance",icon:"style",permission:"resources.defaults.permissions.update",route:"appearance"},{name:"settings",icon:"settings",permission:"settings.view",route:"settings"},{name:"plans",icon:"assignment",permission:"plans.view",route:"plans"},{name:"subscriptions",icon:"subscriptions",permission:"subscriptions.view",route:"subscriptions"},...this.getCustomSidebarItems(),{name:"users",icon:"person",permission:"users.view",route:"users"},{name:"roles",icon:"people",permission:"roles.view",route:"roles"},{name:"pages",icon:"page",permission:"pages.view",route:"custom-pages"},{name:"tags",icon:"local-offer",permission:"tags.view",route:"tags"},{name:"files",icon:"file",permission:"files.view",route:"files"},{name:"translations",icon:"translate",permission:"localizations.view",route:"translations"}];return this.settings.get("vebto.admin.ads")&&e.push({name:"ads",icon:"ads",permission:"settings.view",route:"ads"}),e.map(e=>(e.type="route",e.label=e.name,e.action="admin/"+e.route,e.activeExact=!1,e.condition=function(t,n){let i=!0;return"plans"!==e.name&&"subscriptions"!==e.name||(i=n.get("billing.enable")),i&&t.hasPermission(e.permission)},e))}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(st.Z))},e.\u0275cmp=o.Xpm({type:e,selectors:[["admin"]],viewQuery:function(e,t){if(1&e&&o.Gf(at._,7),2&e){let e;o.iGM(e=o.CRH())&&(t.sidenav=e.first)}},decls:11,vars:10,consts:[["menuPosition","admin-navbar","color","primary",3,"showToggleButton","toggleButtonClick"],[3,"position","vertical","compact"],[1,"version"],[1,"content-inner"]],template:function(e,t){1&e&&(o.TgZ(0,"material-navbar",0),o.NdJ("toggleButtonClick",function(){return t.sidenav.toggleSidebarMode()}),o.qZA(),o.TgZ(1,"sidenav"),o.TgZ(2,"nav"),o._UZ(3,"custom-menu",1),o.ALo(4,"async"),o.TgZ(5,"div",2),o._uU(6),o.ALo(7,"trans"),o.qZA(),o.qZA(),o.TgZ(8,"main"),o.TgZ(9,"div",3),o._UZ(10,"router-outlet"),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.Q6J("showToggleButton",!0),o.xp6(3),o.Q6J("position",t.menu)("vertical",!0)("compact",o.lcZ(4,6,t.sidenav.isCompact$)),o.xp6(3),o.AsE("",o.lcZ(7,8,"Version:")," ",t.settings.get("version"),""))},directives:[ot.e,at._,rt.K,l.lC],pipes:[i.Ov,lt.R],styles:["[_nghost-%COMP%]{display:block}material-navbar[_ngcontent-%COMP%]{position:fixed;top:0;left:0}.nav-searchbar[_ngcontent-%COMP%]{display:block;flex:1 1 auto}.version[_ngcontent-%COMP%]{padding:5px 8px;font-size:1.3rem;margin-top:auto}.content-inner[_ngcontent-%COMP%]{padding:25px}@media only screen and (max-width: 768px){.content-inner[_ngcontent-%COMP%]{padding:10px}}"],changeDetection:0}),e})();var dt=n(2690),ut=n(765),gt=n(8939),pt=n(6215);function ht(e,t=""){let n=Object.keys(e)[0];if(n){t&&(n=`${t}-${n}`);const e=document.getElementById(n);e&&e.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})}}var mt=n(5718),ft=n(5381),_t=n(2470),bt=n(4388);let vt=(()=>{class e{constructor(e,t,n,i,a,s,o,r,l,c){this.settings=e,this.toast=t,this.http=n,this.modal=i,this.route=a,this.customHomepage=s,this.valueLists=o,this.cd=r,this.router=l,this.state=c,this.loading$=new pt.X(!1),this.errors$=new pt.X({})}ngOnDestroy(){this.state.reset()}setJson(e,t){this.state.client[e]=JSON.stringify(t)}getJson(e){const t=this.state.client[e];return t?JSON.parse(t):[]}saveSettings(e){this.loading$.next(!0);const t=e||this.state.getModified();this.settings.save(t).pipe((0,gt.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open("Settings saved."),this.clearErrors(),this.state.updateInitial(t)},e=>{this.errors$.next(e.errors),ht(this.errors$.value)})}clearErrors(){this.errors$.next({})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(st.Z),o.Y36(mt.F),o.Y36(r.r),o.Y36(ft.u),o.Y36(l.gz),o.Y36(_t.Y),o.Y36(bt.l),o.Y36(o.sBO),o.Y36(l.F0),o.Y36(d))},e.\u0275dir=o.lG2({type:e}),e})();var Zt=n(5515),xt=n(4666),At=n(616);function yt(e,t){1&e&&(o.TgZ(0,"a",35),o._uU(1,"Learn More."),o.qZA())}function wt(e,t){1&e&&(o.TgZ(0,"a",36),o._uU(1,"Learn More."),o.qZA())}function Ct(e,t){1&e&&o._UZ(0,"mat-progress-bar",37)}let Tt=(()=>{class e extends vt{constructor(){super(...arguments),this.categories=[],this.defaultPublishCredentials={}}ngOnInit(){this.categories=this.settings.getJson("builder.template_categories",[]),this.defaultPublishCredentials=this.settings.getJson("publish.default_credentials",{})}saveSettings(){const e=this.state.getModified();e.client["builder.template_categories"]=JSON.stringify(this.categories),e.client["publish.default_credentials"]=JSON.stringify(this.defaultPublishCredentials),super.saveSettings(e)}}return e.\u0275fac=function(){let t;return function(n){return(t||(t=o.n5z(e)))(n||e)}}(),e.\u0275cmp=o.Xpm({type:e,selectors:[["builder-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:74,vars:28,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["ngNativeValidate","",1,"body","many-inputs",3,"submit"],["color","accent","animationDuration","0"],[3,"label"],[1,"tab-content","many-inputs"],[1,"setting-toggle-container"],["name","builder.enable_subdomains","id","builder.enable_subdomains","trans","",3,"ngModel","ngModelChange"],["trans",""],["class","hover-underline","href","https://support.vebto.com/help-center/articles/5/9/156/custom-domains#sub-domain","target","_blank","trans","",4,"ngIf"],["name","builder.enable_custom_domains","id","builder.enable_custom_domains","trans","",3,"ngModel","ngModelChange"],["class","hover-underline","href","https://support.vebto.com/help-center/articles/5/9/156/custom-domains#custom-domains","target","_blank","trans","",4,"ngIf"],[1,"input-container"],["for","builder.google_fonts_api_key","trans",""],["name","builder.google_fonts_api_key","id","builder.google_fonts_api_key","type","text",3,"ngModel","ngModelChange"],["for","template_categories","trans",""],["id","template_categories","name","template_categories","placeholder","+New Category...","trans-placeholder","",3,"ngModel","ngModelChange"],[1,"tab-content"],["name","publish.allow_credential_change","id","publish.allow_credential_change","trans","",3,"ngModel","ngModelChange"],[1,"error-group","many-inputs"],["for","host","trans",""],["type","text","name","host","id","host",3,"ngModel","ngModelChange"],["for","username","trans",""],["type","text","name","username","id","username",3,"ngModel","ngModelChange"],["for","password","trans",""],["type","password","name","password","id","password",3,"ngModel","ngModelChange"],["for","directory","trans",""],["type","text","name","directory","id","directory","placeholder","(Optional)","trans-placeholder","",3,"ngModel","ngModelChange"],["for","port","trans",""],["type","number","name","port","id","port",3,"ngModel","ngModelChange"],["color","accent","name","ssl",1,"custom-control",3,"ngModel","ngModelChange"],["mat-raised-button","","color","accent","type","submit","trans","",1,"button","primary","update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],[1,"overlay",3,"isVisible"],["href","https://support.vebto.com/help-center/articles/5/9/156/custom-domains#sub-domain","target","_blank","trans","",1,"hover-underline"],["href","https://support.vebto.com/help-center/articles/5/9/156/custom-domains#custom-domains","target","_blank","trans","",1,"hover-underline"],["mode","indeterminate","color","accent"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"Site Builder"),o.qZA(),o.TgZ(3,"div",2),o._uU(4,"Configure the site builder and user dashboard settings."),o.qZA(),o.qZA(),o.TgZ(5,"form",3),o.NdJ("submit",function(){return t.saveSettings()}),o.TgZ(6,"mat-tab-group",4),o.TgZ(7,"mat-tab",5),o.ALo(8,"trans"),o.TgZ(9,"div",6),o.TgZ(10,"div",7),o.TgZ(11,"mat-slide-toggle",8),o.NdJ("ngModelChange",function(e){return t.state.client["builder.enable_subdomains"]=e}),o._uU(12,"Subdomains "),o.qZA(),o.TgZ(13,"p"),o.TgZ(14,"span",9),o._uU(15,"Should user projects be accessible via subdomain on your site."),o.qZA(),o._uU(16," "),o.YNc(17,yt,2,0,"a",10),o.qZA(),o.qZA(),o.TgZ(18,"div",7),o.TgZ(19,"mat-slide-toggle",11),o.NdJ("ngModelChange",function(e){return t.state.client["builder.enable_custom_domains"]=e}),o._uU(20,"Custom Domains "),o.qZA(),o.TgZ(21,"p"),o.TgZ(22,"span",9),o._uU(23,"Should users be able to attach their own custom domains to their projects."),o.qZA(),o._uU(24," "),o.YNc(25,wt,2,0,"a",12),o.qZA(),o.qZA(),o.TgZ(26,"div",13),o.TgZ(27,"label",14),o._uU(28,"Google Fonts API Key"),o.qZA(),o.TgZ(29,"input",15),o.NdJ("ngModelChange",function(e){return t.state.client["builder.google_fonts_api_key"]=e}),o.qZA(),o.qZA(),o.TgZ(30,"div",13),o.TgZ(31,"label",16),o._uU(32,"Template Categories"),o.qZA(),o.TgZ(33,"chip-input",17),o.NdJ("ngModelChange",function(e){return t.categories=e}),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(34,"mat-tab",5),o.ALo(35,"trans"),o.TgZ(36,"div",18),o.TgZ(37,"div",7),o.TgZ(38,"mat-slide-toggle",19),o.NdJ("ngModelChange",function(e){return t.state.client["publish.allow_credential_change"]=e}),o._uU(39,"FTP Export Credentials "),o.qZA(),o.TgZ(40,"p",9),o._uU(41,"Allow users to enter their own FTP credentials for exporting."),o.qZA(),o.qZA(),o.TgZ(42,"div",20),o.TgZ(43,"h2",9),o._uU(44,"Default FTP credentials for export project dialog"),o.qZA(),o.TgZ(45,"div",13),o.TgZ(46,"label",21),o._uU(47,"Host"),o.qZA(),o.TgZ(48,"input",22),o.NdJ("ngModelChange",function(e){return t.defaultPublishCredentials.host=e}),o.qZA(),o.qZA(),o.TgZ(49,"div",13),o.TgZ(50,"label",23),o._uU(51,"Username"),o.qZA(),o.TgZ(52,"input",24),o.NdJ("ngModelChange",function(e){return t.defaultPublishCredentials.username=e}),o.qZA(),o.qZA(),o.TgZ(53,"div",13),o.TgZ(54,"label",25),o._uU(55,"Password"),o.qZA(),o.TgZ(56,"input",26),o.NdJ("ngModelChange",function(e){return t.defaultPublishCredentials.password=e}),o.qZA(),o.qZA(),o.TgZ(57,"div",13),o.TgZ(58,"label",27),o._uU(59,"Directory"),o.qZA(),o.TgZ(60,"input",28),o.NdJ("ngModelChange",function(e){return t.defaultPublishCredentials.directory=e}),o.qZA(),o.qZA(),o.TgZ(61,"div",13),o.TgZ(62,"label",29),o._uU(63,"Port"),o.qZA(),o.TgZ(64,"input",30),o.NdJ("ngModelChange",function(e){return t.defaultPublishCredentials.port=e}),o.qZA(),o.qZA(),o.TgZ(65,"mat-slide-toggle",31),o.NdJ("ngModelChange",function(e){return t.defaultPublishCredentials.ssl=e}),o._uU(66,"SSL"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(67,"button",32),o.ALo(68,"async"),o._uU(69,"Update "),o.qZA(),o.YNc(70,Ct,1,0,"mat-progress-bar",33),o.ALo(71,"async"),o.qZA(),o._UZ(72,"loading-indicator",34),o.ALo(73,"async")),2&e&&(o.xp6(7),o.Q6J("label",o.lcZ(8,18,"General")),o.xp6(4),o.Q6J("ngModel",t.state.client["builder.enable_subdomains"]),o.xp6(6),o.Q6J("ngIf",!t.settings.get("common.site.hide_docs_button")),o.xp6(2),o.Q6J("ngModel",t.state.client["builder.enable_custom_domains"]),o.xp6(6),o.Q6J("ngIf",!t.settings.get("common.site.hide_docs_button")),o.xp6(4),o.Q6J("ngModel",t.state.client["builder.google_fonts_api_key"]),o.xp6(4),o.Q6J("ngModel",t.categories),o.xp6(1),o.Q6J("label",o.lcZ(35,20,"Exporting")),o.xp6(4),o.Q6J("ngModel",t.state.client["publish.allow_credential_change"]),o.xp6(10),o.Q6J("ngModel",t.defaultPublishCredentials.host),o.xp6(4),o.Q6J("ngModel",t.defaultPublishCredentials.username),o.xp6(4),o.Q6J("ngModel",t.defaultPublishCredentials.password),o.xp6(4),o.Q6J("ngModel",t.defaultPublishCredentials.directory),o.xp6(4),o.Q6J("ngModel",t.defaultPublishCredentials.port),o.xp6(1),o.Q6J("ngModel",t.defaultPublishCredentials.ssl),o.xp6(2),o.Q6J("disabled",o.lcZ(68,22,t.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(71,24,t.loading$)),o.xp6(2),o.Q6J("isVisible",o.lcZ(73,26,t.loading$)))},directives:[Zt.P,a.JL,a.F,J.SP,J.uX,T.Rr,a.JJ,a.On,i.O5,a.Fj,xt.S,a.wV,g.lW,At.Q,s.pW],pipes:[lt.R,i.Ov],styles:["[_nghost-%COMP%]{display:block}.tab-content[_ngcontent-%COMP%]{margin-top:20px}"]}),e})();var qt=n(1371),kt=n(526),Mt=n(739),It=n(1927),Ut=n(8371),Jt=n(4395),Dt=n(8002),Ot=n(9328),Pt=n(3342),St=n(4889),Nt=n(8208);const Qt={title:"Delete :resource",body:"Are you sure you want to delete selected :resource?",ok:"Delete"};var Yt=n(970);function Ft(e,t){const n=Yt.pick(t,e);if((0,_.t6)(n)){const e=Number(n);return e<9007199254740991?e:n}return n}var Rt=n(7240),Et=n(962);let Lt=(()=>{class e{constructor(e,t,n,i){this.modal=e,this.router=t,this.http=n,this.localStorage=i,this.sort$=new pt.X({}),this.filters$=new pt.X({}),this.searchControl=new a.NI,this.searchTerm$=new pt.X(null),this.staticParams$=new pt.X({}),this.paginator=new Ut.D(this.router,this.http,this.localStorage),this.ignoreNextParamChange=!1,this.originalData$=new pt.X([]),this.data$=new pt.X([]),this.selectedRows$=new pt.X([])}get data(){return this.data$.value}set data(e){const t=[...e];this.originalData$.next(t),this.data$.next(t),this.ignoreNextParamChange=!0,this.reset()}init(e={}){if(this.config=e,this.staticParams$.next(Object.assign(Object.assign({},this.staticParams$.value),e.staticParams)),e.uri?this.connectToPaginator():e.initialData&&(this.data=e.initialData),e.uri){const e=this.router.routerState.root.snapshot.queryParams,t=e.query;this.searchControl.setValue(t),this.searchTerm$.next(t),this.sort$.next({orderBy:e.orderBy,orderDir:e.orderDir})}return this.searchControlSub=this.searchControl.valueChanges.pipe((0,Jt.b)(300)).subscribe(e=>{this.searchTerm$.next(e)}),this.mainSub=(0,Mt.aj)([this.sort$,this.filters$,this.staticParams$,this.searchTerm$.pipe((0,Dt.U)(e=>({query:e})))]).pipe((0,Jt.b)(0,It.Z),(0,Dt.U)(e=>Object.assign({},...e))).subscribe(e=>{if(this.ignoreNextParamChange)return this.ignoreNextParamChange=!1;e=(0,St.N)(e),Object.entries(e).forEach(([t,n])=>{"object"==typeof n&&n.id&&(e[`${t}Id`]=n.id,delete e[t])}),this.config.uri?this.paginator.paginate(e,this.config.uri,this.config.initialData):Object.keys(e).length&&this.data.length&&this.applyLocalTransforms(e)}),this}connectToPaginator(){this.paginatorSub=this.paginator.response$.pipe((0,Ot.G)()).subscribe(([e,t])=>{var n;const i=this.config.infiniteScroll&&(null===(n=null==e?void 0:e.pagination)||void 0===n?void 0:n.current_page)!==t.pagination.current_page?[...this.data$.value,...t.pagination.data]:t.pagination.data;this.data$.next(i)})}applyLocalTransforms(e){let t=[...this.originalData$.value];e.query&&(t=(0,Rt.D)(t,e.query)),e.orderBy&&e.orderDir&&(t=function(e,t,n){return e.sort((e,i)=>{let a=Ft(e,t),s=Ft(i,t);const o=typeof a,r=typeof s;o!==r&&("number"===o&&(a+=""),"number"===r&&(s+=""));let l=0;return null!=a&&null!=s?a>s?l=1:a<s&&(l=-1):null!=a?l=1:null!=s&&(l=-1),l*("asc"===n?1:-1)})}(t,e.orderBy,e.orderDir)),this.data$.next(t)}addFilter(e,t){this.filters$.next(Object.assign(Object.assign({},this.filters$.value),{[e]:t}))}removeFilter(e){const t=Object.assign({},this.filters$.value);delete t[e],this.filters$.next(t)}reset(e=null){this.filters$.next({}),this.sort$.next({}),this.selectedRows$.next([]),e&&this.staticParams$.next(e)}openCrupdateResourceModal(e,t,n){return this.modal.open(e,t,n).beforeClosed().pipe((0,j.h)(e=>!!e),(0,Pt.b)(()=>this.reset()))}confirmResourceDeletion(e){const t=Object.assign(Object.assign({},Qt),{replacements:{resource:e}});return this.modal.open(Nt.z,t).afterClosed().pipe((0,j.h)(e=>e))}getCurrentParams(){return Object.assign(Object.assign(Object.assign(Object.assign({},this.sort$.value),this.filters$.value),this.staticParams$.value),this.paginator.params)}destroy(){var e,t,n;null===(e=this.paginatorSub)||void 0===e||e.unsubscribe(),null===(t=this.mainSub)||void 0===t||t.unsubscribe(),null===(n=this.searchControlSub)||void 0===n||n.unsubscribe()}}return e.\u0275fac=function(t){return new(t||e)(o.LFG(ft.u),o.LFG(l.F0),o.LFG(r.r),o.LFG(Et.m))},e.\u0275prov=o.Yz7({token:e,factory:e.\u0275fac}),e})();class $t{constructor(e){this.defaultValue=void 0!==e.defaultValue?e.defaultValue:"",this.key=e.key||"",this.label=e.label||e.key||"",this.description=e.description||"",this.defaultOperator=e.defaultOperator||Ht.eq,this.required=!!e.required,this.order=void 0===e.order?1:e.order,this.type=e.type||Vt.Select,this.inputType=e.inputType,this.options=e.options||[],this.operators=e.operators,this.component=e.component}}var Vt=(()=>(function(e){e.Select="select",e.DatePicker="datePicker",e.SelectModel="selectModel",e.Input="input",e.StaticValue="staticValue"}(Vt||(Vt={})),Vt))(),Ht=(()=>(function(e){e.eq="=",e.ne="!=",e.gt=">",e.gte=">=",e.lt="<",e.lte="<=",e.has="has",e.doesntHave="doesntHave"}(Ht||(Ht={})),Ht))();const zt=[Ht.eq,Ht.ne,Ht.gt,Ht.gte,Ht.lt,Ht.lte];class Bt extends $t{constructor(){super(...arguments),this.type=Vt.DatePicker,this.operators=zt,this.defaultOperator=Ht.lte,this.defaultValue=(new Date).toISOString().split("T")[0]}}class jt extends Bt{constructor(){super(...arguments),this.key="created_at",this.label="Created At"}}class Gt extends Bt{constructor(){super(...arguments),this.key="updated_at",this.label="Updated At"}}var Xt=n(7519),Wt=n(3190),Kt=n(5304),en=n(3429);function tn(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",9),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().close(t)}),o._UZ(1,"img",10),o.TgZ(2,"div",11),o.TgZ(3,"div",12),o._uU(4),o.qZA(),o.TgZ(5,"div",13),o._uU(6),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=t.$implicit;o.xp6(1),o.Q6J("src",e.avatar,o.LSH),o.xp6(3),o.Oqu(e.display_name),o.xp6(2),o.Oqu(e.email)}}let nn=(()=>{class e{constructor(e,t,n){this.dialogRef=e,this.data=t,this.users=n,this.searchFormControl=new a.NI,this.loading$=new pt.X(!1),this.users$=new pt.X([])}ngOnInit(){this.searchFormControl.valueChanges.pipe((0,Jt.b)(250),(0,Xt.x)(),(0,Wt.w)(e=>this.searchUsers(e)),(0,Kt.K)(()=>(0,V.of)([]))).subscribe(e=>{this.users$.next(e),this.loading$.next(!1)})}searchUsers(e){return this.loading$.next(!0),e?this.users.getAll({query:e}):(0,V.of)([])}close(e){const t=e&&this.data.normalizeValue?this.normalizeUser(e):e;this.dialogRef.close(t)}normalizeUser(e){return e?{id:e.id,name:e.display_name,image:e.avatar,model_type:e.model_type}:null}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(m.so),o.Y36(m.WI),o.Y36(en.Q))},e.\u0275cmp=o.Xpm({type:e,selectors:[["find-user-modal"]],decls:13,vars:7,consts:[[1,"modal-header"],["mat-dialog-title","","trans",""],["type","button","tabindex","-1",1,"no-style","close-button",3,"click"],["svgIcon","close"],[1,"input-container","search-input-container"],["type","text","placeholder","Search for user by name or email...",3,"formControl"],[1,"small",3,"isVisible"],[1,"users"],["class","user",3,"click",4,"ngFor","ngForOf"],[1,"user",3,"click"],[3,"src"],[1,"meta","overflow-hidden"],[1,"name","overflow-hidden"],[1,"email","overflow-hidden"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"h2",1),o._uU(2,"Find User"),o.qZA(),o.TgZ(3,"button",2),o.NdJ("click",function(){return t.close()}),o._UZ(4,"mat-icon",3),o.qZA(),o.qZA(),o.TgZ(5,"mat-dialog-content"),o.TgZ(6,"div",4),o._UZ(7,"input",5),o._UZ(8,"loading-indicator",6),o.ALo(9,"async"),o.qZA(),o.TgZ(10,"div",7),o.YNc(11,tn,7,3,"div",8),o.ALo(12,"async"),o.qZA(),o.qZA()),2&e&&(o.xp6(7),o.Q6J("formControl",t.searchFormControl),o.xp6(1),o.Q6J("isVisible",o.lcZ(9,3,t.loading$)),o.xp6(3),o.Q6J("ngForOf",o.lcZ(12,5,t.users$)))},directives:[m.uh,Zt.P,O.Hw,m.xY,a.Fj,a.JJ,a.oH,At.Q,i.sg],pipes:[i.Ov],styles:["[_nghost-%COMP%]{display:block;width:500px;max-width:100%}.modal-header[_ngcontent-%COMP%]{margin-bottom:15px}.search-input-container[_ngcontent-%COMP%]{width:100%;margin-bottom:20px;position:relative}loading-indicator[_ngcontent-%COMP%]{top:12px;right:12px}.users[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:space-between;margin:0 -15px}.user[_ngcontent-%COMP%]{display:flex;align-items:center;width:calc(50% - 10px);flex-shrink:0;min-width:0;padding:12px;border-radius:4px;cursor:pointer}.user[_ngcontent-%COMP%]:hover{background-color:var(--be-hover)}.user[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:50px;height:50px;flex-shrink:0;margin-right:10px;border-radius:4px;overflow:hidden}.user[_ngcontent-%COMP%]   .name[_ngcontent-%COMP%]{color:var(--be-text);font-size:1.5rem;margin-bottom:5px}.user[_ngcontent-%COMP%]   .email[_ngcontent-%COMP%]{color:var(--be-secondary-text)}.overflow-hidden[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis}"],changeDetection:0}),e})();const an=[new $t({type:Vt.Select,key:"published",label:"Status",defaultValue:!0,description:"Whether project is publicly accessible",options:[{key:"Not Published",value:!1},{key:"Published",value:!0}]}),new $t({type:Vt.SelectModel,key:"user_id",label:"Owner",description:"User that has created the project",component:nn}),new jt({description:"Date user registered or was created"}),new Gt({description:"Date user was last updated"})];var sn=n(8518),on=n(4688);const rn=["filterSuggestion"];function ln(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",8,9),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().filterSelected.emit(t.value)}),o.TgZ(2,"div",10),o._uU(3),o.qZA(),o.TgZ(4,"div",2),o._uU(5),o.qZA(),o.qZA()}if(2&e){const e=t.$implicit,n=t.index;o.uIk("data-filter-key",e.key)("data-index",n),o.xp6(3),o.Oqu(e.value.label),o.xp6(2),o.Oqu(e.value.description)}}let cn=(()=>{class e{constructor(){this.filterSelected=new o.vpe,this.originalOrder=()=>0}anyFocused(){return document.activeElement.classList.contains("filter-suggestion-item")}focusItemAt(e){this.items.get(e).nativeElement.focus()}getFocusedFilter(){if(this.anyFocused()){const e=document.activeElement.dataset.filterKey;return this.filters[e]}}getFocusedIndex(){if(this.anyFocused()){const e=document.activeElement;return parseInt(e.dataset.index)}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=o.Xpm({type:e,selectors:[["filter-suggestions"]],viewQuery:function(e,t){if(1&e&&o.Gf(rn,5),2&e){let e;o.iGM(e=o.CRH())&&(t.items=e)}},inputs:{filters:"filters"},outputs:{filterSelected:"filterSelected"},decls:13,vars:4,consts:[[1,"table"],[1,"filter-suggestion-header","row"],["trans","",1,"column"],["role","list",1,"body"],["role","listitem","class","row filter-suggestion-item","tabindex","0",3,"click",4,"ngFor","ngForOf"],[1,"help-container"],["svgIcon","info"],["trans",""],["role","listitem","tabindex","0",1,"row","filter-suggestion-item",3,"click"],["filterSuggestion",""],["trans","",1,"column","label-column"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"div",2),o._uU(3,"Field"),o.qZA(),o.TgZ(4,"div",2),o._uU(5,"Description"),o.qZA(),o.qZA(),o.TgZ(6,"div",3),o.YNc(7,ln,6,4,"div",4),o.ALo(8,"keyvalue"),o.qZA(),o.qZA(),o.TgZ(9,"div",5),o._UZ(10,"mat-icon",6),o.TgZ(11,"div",7),o._uU(12," Use arrows, tab or mouse to navigate added filters. Backspace or delete key to remove them. "),o.qZA(),o.qZA()),2&e&&(o.xp6(7),o.Q6J("ngForOf",o.xi3(8,1,t.filters,t.originalOrder)))},directives:[Zt.P,i.sg,O.Hw],pipes:[i.Nd],styles:["[_nghost-%COMP%]{display:none;position:absolute;left:0;z-index:10;background-color:var(--be-background);width:100%;border-radius:4px;overflow:hidden;color:var(--be-text);box-shadow:0 3px 5px -1px #0003,0 5px 8px 0 #00000024,0 1px 14px 0 #0000001f}.visible[_nghost-%COMP%]{display:block}.filter-suggestion-header[_ngcontent-%COMP%]{background-color:var(--be-background-alternative)}.row[_ngcontent-%COMP%]{display:flex;height:55px;padding:15px;border-bottom:1px solid var(--be-divider-lighter)}.row[_ngcontent-%COMP%]:not(.header){cursor:pointer}.row[_ngcontent-%COMP%]:not(.header):focus, .row[_ngcontent-%COMP%]:not(.header):hover{background-color:var(--be-hover)}.row[_ngcontent-%COMP%]:not(.header):focus{outline:none}.column[_ngcontent-%COMP%]{flex:0 0 48%}.label-column[_ngcontent-%COMP%]{text-transform:capitalize}.help-container[_ngcontent-%COMP%]{display:flex;align-items:center;padding:12px;background-color:var(--be-accent-emphasis)}.help-container[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{margin-right:10px;color:var(--be-accent-default)}"],changeDetection:0}),e})();var dn=n(8480),un=n(5439);function gn(e,t){if(1&e&&(o.ynx(0),o._UZ(1,"img",2),o.TgZ(2,"div",3),o._uU(3),o.qZA(),o.BQk()),2&e){const e=t.ngIf;o.xp6(1),o.Q6J("src",e.image,o.LSH),o.xp6(2),o.Oqu(e.name)}}function pn(e,t){1&e&&(o.TgZ(0,"div",4),o._uU(1,"Click to select"),o.qZA())}let hn=(()=>{class e{constructor(e){this.dialog=e,this.value$=new pt.X(null)}registerOnChange(e){this.propagateChange=e}registerOnTouched(e){}writeValue(e){this.value$.next(e)}onClick(){this.openSelectModelDialog()}openSelectModelDialog(){this.dialog.open(this.component,{normalizeValue:!0}).afterClosed().subscribe(e=>{e&&(this.value$.next(e),this.propagateChange(e))})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(ft.u))},e.\u0275cmp=o.Xpm({type:e,selectors:[["select-model-control"]],hostBindings:function(e,t){1&e&&o.NdJ("click",function(){return t.onClick()})},inputs:{component:"component"},features:[o._Bn([{provide:a.JU,useExisting:e,multi:!0}])],decls:4,vars:4,consts:[[4,"ngIf","ngIfElse"],["defaultHint",""],[1,"image",3,"src"],[1,"name"],["trans",""]],template:function(e,t){if(1&e&&(o.YNc(0,gn,4,2,"ng-container",0),o.ALo(1,"async"),o.YNc(2,pn,2,0,"ng-template",null,1,o.W1O)),2&e){const e=o.MAs(3);o.Q6J("ngIf",o.lcZ(1,2,t.value$))("ngIfElse",e)}},directives:[i.O5,Zt.P],pipes:[i.Ov],styles:["[_nghost-%COMP%]{display:flex;align-items:center;padding:0 8px;cursor:pointer}img[_ngcontent-%COMP%]{height:22px;width:22px;border-radius:4px;margin-right:8px;flex-shrink:0;object-fit:cover}"],changeDetection:0}),e})();const mn={"=":"is","!=":"is not",">":"is greater than",">=":"is greater than or equal to","<":"is less than","<=":"is less than or equal to",has:"Include",doesntHave:"Do not include"};var fn=n(6605);let _n=(()=>{class e{constructor(e){this.breakpoints=e}transform(e,t){return t||this.breakpoints.isMobile$.value?e:mn[e]}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(fn.S,16))},e.\u0275pipe=o.Yjl({name:"operatorDisplayName",type:e,pure:!0}),e})();const bn=["select"];function vn(e,t){if(1&e&&(o.TgZ(0,"option",4),o._uU(1),o.ALo(2,"operatorDisplayName"),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.Q6J("value",e),o.xp6(1),o.hij(" ",o.xi3(2,2,e,n.compact)," ")}}let Zn=(()=>{class e{ngAfterViewInit(){this.resizeSelect()}resizeSelect(){var e;const t=null===(e=this.select)||void 0===e?void 0:e.nativeElement;t&&t.selectedIndex>-1&&(t.style.width=`${t.options[t.selectedIndex].label.length+5}ch`)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=o.Xpm({type:e,selectors:[["operator-select"]],viewQuery:function(e,t){if(1&e&&o.Gf(bn,5),2&e){let e;o.iGM(e=o.CRH())&&(t.select=e.first)}},inputs:{compact:"compact",formGroup:"formGroup",operators:"operators"},decls:4,vars:2,consts:[[3,"formGroup"],["formControlName","operator",1,"operator-select",3,"ngModelChange"],["select",""],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(e,t){1&e&&(o.ynx(0,0),o.TgZ(1,"select",1,2),o.NdJ("ngModelChange",function(){return t.resizeSelect()}),o.YNc(3,vn,3,5,"option",3),o.qZA(),o.BQk()),2&e&&(o.Q6J("formGroup",t.formGroup),o.xp6(3),o.Q6J("ngForOf",t.operators))},directives:[a.JL,a.sg,a.EJ,a.JJ,a.u,i.sg,a.YN,a.Kr],pipes:[_n],styles:['[_nghost-%COMP%]{display:flex;align-items:center;position:relative;height:100%}[_nghost-%COMP%]:before{content:"";position:absolute;top:0;bottom:0;width:50%;left:0;background-color:var(--be-chip)}[_nghost-%COMP%]:after{content:"";position:absolute;top:0;bottom:0;width:50%;right:0;background-color:var(--be-accent-default)}.operator-select[_ngcontent-%COMP%]{transition:width .1s ease-in-out 0s;padding:2px 8px;min-width:60px;max-width:200px;height:27px;color:var(--be-accent-default);z-index:10;background-color:var(--be-accent-contrast);text-overflow:ellipsis;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:10px;text-align-last:center;border:1px solid #0000}.operator-select[_ngcontent-%COMP%]:focus-visible{outline:0;border-color:var(--be-accent-default);box-shadow:0 0 0 1px #fff}'],changeDetection:0}),e})();const xn=["valueInput"];function An(e,t){if(1&e&&o._UZ(0,"operator-select",8),2&e){const e=o.oxw().ngIf,t=o.oxw();o.Q6J("compact",t.compact)("formGroup",e)("operators",t.filter.operators)}}function yn(e,t){if(1&e&&(o.TgZ(0,"option",16),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("ngValue",e.value),o.xp6(1),o.hij(" ",e.key," ")}}function wn(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",9),o.TgZ(1,"select",10,11),o.NdJ("ngModelChange",function(){return o.CHM(e),o.oxw(2).resizeInput()}),o.YNc(3,yn,2,2,"option",12),o.qZA(),o.O4$(),o.TgZ(4,"svg",13),o._UZ(5,"path",14),o._UZ(6,"path",15),o.qZA(),o.qZA()}if(2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("id",e.key)("compareWith",e.compareFilterValueFn),o.xp6(2),o.Q6J("ngForOf",e.filter.options)}}function Cn(e,t){if(1&e&&(o.TgZ(0,"div",17),o._UZ(1,"input",18,11),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("id",e.key)}}function Tn(e,t){if(1&e&&o._UZ(0,"select-model-control",19,11),2&e){const e=o.oxw(2);o.Q6J("component",e.filter.component)("id",e.key)}}function qn(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",9),o.TgZ(1,"input",20,11),o.NdJ("ngModelChange",function(){return o.CHM(e),o.oxw(2).resizeInput()}),o.qZA(),o.qZA()}if(2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("id",e.key)("type",e.filter.inputType||"text")}}function kn(e,t){if(1&e){const e=o.EpF();o.ynx(0,1),o.TgZ(1,"div",2),o.NdJ("click",function(){return o.CHM(e),o.oxw().el.nativeElement.focus()}),o._uU(2),o.qZA(),o.YNc(3,An,1,3,"operator-select",3),o.ynx(4,4),o.YNc(5,wn,7,3,"div",5),o.YNc(6,Cn,3,1,"div",6),o.YNc(7,Tn,2,2,"select-model-control",7),o.YNc(8,qn,3,2,"div",5),o.BQk(),o.BQk()}if(2&e){const e=t.ngIf,n=o.oxw();o.Q6J("formGroup",e),o.xp6(2),o.Oqu(n.filter.label),o.xp6(1),o.Q6J("ngIf",n.filter.operators),o.xp6(1),o.Q6J("ngSwitch",n.filter.type),o.xp6(1),o.Q6J("ngSwitchCase","select"),o.xp6(1),o.Q6J("ngSwitchCase","datePicker"),o.xp6(1),o.Q6J("ngSwitchCase","selectModel"),o.xp6(1),o.Q6J("ngSwitchCase","input")}}let Mn=(()=>{class e{constructor(e){this.el=e,this.compareFilterValueFn=(e,t)=>un(e,t)}ngAfterViewInit(){this.resizeInput()}focus(){this.el.nativeElement.focus()}focusValueInput(){var e;this.valueInput instanceof hn?this.valueInput.openSelectModelDialog():(null===(e=this.valueInput)||void 0===e?void 0:e.nativeElement)&&this.valueInput.nativeElement.focus()}resizeInput(){var e;const t=null===(e=this.valueInput)||void 0===e?void 0:e.nativeElement;if("SELECT"===(null==t?void 0:t.nodeName)){const e=t;e.selectedIndex>-1&&(e.style.width=`${e.options[e.selectedIndex].label.length+5}ch`)}else"INPUT"===(null==t?void 0:t.nodeName)&&"date"!==t.type&&(t.style.width=`${t.value.length+7}ch`)}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(o.SBq))},e.\u0275cmp=o.Xpm({type:e,selectors:[["active-filter"]],viewQuery:function(e,t){if(1&e&&o.Gf(xn,5),2&e){let e;o.iGM(e=o.CRH())&&(t.valueInput=e.first)}},hostAttrs:["tabIndex","0","role","button"],hostVars:1,hostBindings:function(e,t){2&e&&o.uIk("data-control-key",t.key)},inputs:{key:"key",compact:"compact",form:"form",filter:"filter"},decls:1,vars:1,consts:[[3,"formGroup",4,"ngIf"],[3,"formGroup"],["trans","",1,"filter-label",3,"click"],[3,"compact","formGroup","operators",4,"ngIf"],[3,"ngSwitch"],["class","filter-input-container",4,"ngSwitchCase"],["class","date-picker-container",4,"ngSwitchCase"],["formControlName","value","class","filter-value select-model-input",3,"component","id",4,"ngSwitchCase"],[3,"compact","formGroup","operators"],[1,"filter-input-container"],["formControlName","value",1,"filter-input","filter-value",3,"id","compareWith","ngModelChange"],["valueInput",""],["trans","",3,"ngValue",4,"ngFor","ngForOf"],["viewBox","0 0 24 24",1,"caret-svg"],["d","M7 10l5 5 5-5z"],["d","M0 0h24v24H0z","fill","none"],["trans","",3,"ngValue"],[1,"date-picker-container"],["type","date","formControlName","value",1,"date-input","filter-value",3,"id"],["formControlName","value",1,"filter-value","select-model-input",3,"component","id"],["formControlName","value","min","1","required","",1,"filter-input","filter-value",3,"id","type","ngModelChange"]],template:function(e,t){1&e&&o.YNc(0,kn,9,8,"ng-container",0),2&e&&o.Q6J("ngIf",t.form.controls[t.key])},directives:[i.O5,a.JL,a.sg,Zt.P,i.RF,i.n9,Zn,a.EJ,a.JJ,a.u,i.sg,a.YN,a.Kr,a.Fj,hn,a.Q7],styles:["[_nghost-%COMP%]{display:inline-flex;align-items:flex-start;border-radius:4px;height:37px;background-color:var(--be-chip);margin:3px 5px 3px 0}[_nghost-%COMP%]:focus{outline:none;box-shadow:var(--be-accent-default) 0 0 0 1px}.filter-label[_ngcontent-%COMP%]{color:var(--be-text);line-height:37px;cursor:pointer;padding:0 12px;text-transform:capitalize;white-space:nowrap;font-weight:500;-webkit-user-select:none;user-select:none}.filter-input-container[_ngcontent-%COMP%]{position:relative;height:100%;overflow:hidden;border-radius:0 4px 4px 0}.caret-svg[_ngcontent-%COMP%]{position:absolute;top:9.5px;right:5px;z-index:11;fill:var(--be-accent-contrast);width:18px;height:18px;pointer-events:none}.filter-input[_ngcontent-%COMP%]{border:0;transition:width .1s ease-in-out 0s;padding:0 12px;min-width:60px;max-width:200px;z-index:10;text-overflow:ellipsis;-webkit-appearance:none;-moz-appearance:none;appearance:none;height:100%;font-weight:500}select.filter-select[_ngcontent-%COMP%]{padding:0 25px 0 12px}.date-input[_ngcontent-%COMP%]{position:relative;max-width:30ch;line-height:37px;height:37px;font-size:inherit;border:none;margin:0;padding:0 12px;width:20ch;font-weight:500}.select-model-input[_ngcontent-%COMP%]{min-width:76px;height:100%}.filter-value[_ngcontent-%COMP%]{background-color:var(--be-accent-default);color:var(--be-accent-contrast);border-radius:0 4px 4px 0}"],changeDetection:0}),e})();function In(e,t){if(1&e&&o._UZ(0,"active-filter",2),2&e){const e=t.ngIf,n=o.oxw(),i=n.$implicit,a=n.index,s=o.oxw();o.Q6J("compact",s.compact)("key",i.key)("form",s.form)("filter",e),o.uIk("data-index",a)}}function Un(e,t){if(1&e&&(o.ynx(0),o.YNc(1,In,1,5,"active-filter",1),o.BQk()),2&e){const e=t.$implicit,n=o.oxw();o.xp6(1),o.Q6J("ngIf",n.config[e.value.value.key])}}const Jn=["*"];let Dn=(()=>{class e{constructor(e,t,n){this.fb=e,this.cd=t,this.el=n}add(e,t={}){const n=this.fb.group({key:e.key,value:void 0!==t.value?t.value:e.defaultValue,operator:t.operator||e.defaultOperator}),i=Object.keys(this.form.controls).length+(0,dn.O)(8);this.form.addControl(i,n),this.cd.detectChanges(),t.focus&&this.filters.last.focusValueInput()}removeByKey(e){this.form.removeControl(e),this.cd.markForCheck()}removeCurrentlyFocused(){const e=document.activeElement;this.removeByKey(e.dataset.controlKey)}anyFocused(){return"ACTIVE-FILTER"===document.activeElement.nodeName}focusLast(){this.filters.last&&this.filters.last.focus()}focusPrevious(){const e=this.getFocusedIndex(),t=this.filters.get(e-1);t&&t.focus()}getByIndex(e){return this.filters.get(e)}lastIsFocused(){return this.getFocusedIndex()===this.filters.length-1}getFocusedIndex(){const e=document.activeElement.dataset.index;return e?parseInt(e):null}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(a.qu),o.Y36(o.sBO),o.Y36(o.SBq))},e.\u0275cmp=o.Xpm({type:e,selectors:[["active-filters"]],viewQuery:function(e,t){if(1&e&&o.Gf(Mn,5),2&e){let e;o.iGM(e=o.CRH())&&(t.filters=e)}},inputs:{compact:"compact",form:"form",config:"config"},ngContentSelectors:Jn,decls:3,vars:3,consts:[[4,"ngFor","ngForOf"],[3,"compact","key","form","filter",4,"ngIf"],[3,"compact","key","form","filter"]],template:function(e,t){1&e&&(o.F$t(),o.YNc(0,Un,2,1,"ng-container",0),o.ALo(1,"keyvalue"),o.Hsn(2)),2&e&&o.Q6J("ngForOf",o.lcZ(1,1,t.form.controls))},directives:[i.sg,i.O5,Mn],pipes:[i.Nd],styles:["[_nghost-%COMP%]{display:flex;flex:1 1 auto;flex-wrap:wrap;align-items:center}"],changeDetection:0}),e})();var On=n(3868);const Pn=["searchInput"],Sn=["filterSuggestion"];function Nn(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",8),o.NdJ("click",function(){return o.CHM(e),o.oxw().clearSearch()}),o._UZ(1,"mat-icon",9),o.qZA()}}function Qn(e,t){1&e&&(o.TgZ(0,"span",13),o._uU(1,"Filter"),o.qZA())}function Yn(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",10),o.NdJ("click",function(){return o.CHM(e),o.oxw().toggleFilterDropdown()}),o._UZ(1,"mat-icon",11),o.YNc(2,Qn,2,0,"span",12),o.qZA()}if(2&e){const e=o.oxw();o.xp6(2),o.Q6J("ngIf",!e.compact)}}let Fn=(()=>{class e{constructor(e,t,n,i,a,s){this.fb=e,this.route=t,this.el=n,this.keybinds=i,this.cd=a,this.router=s,this.filterChange=new o.vpe,this.inputFocus=new o.vpe,this.form=this.fb.group({}),this.filterBarHeight=0,this.filterDropdownVisible$=new pt.X(!1)}set filters(e){e?(this.keyedFilters={},(e||[]).forEach(e=>{this.keyedFilters[e.key]=e})):this.keyedFilters=null}ngOnInit(){this.haveFiltersOrQuery$=(0,Mt.aj)([this.searchControl.valueChanges.pipe((0,B.O)(null)),this.form.valueChanges.pipe((0,B.O)(null))]).pipe((0,Dt.U)(([e,t])=>e||t&&0!==Object.keys(t).length))}ngAfterViewInit(){this.watchForSizeChanges(),this.setFiltersFromQuery(),this.setupKeybinds(),this.subscribeToCloseActions(),this.bindToFormValueChange()}onClick(e){e.target!==this.el.nativeElement&&e.target!==this.activeFilters.el.nativeElement||this.searchInput.nativeElement.focus()}ngOnDestroy(){var e;null===(e=this.closeActionsStream$)||void 0===e||e.unsubscribe()}clearSearch(){Object.keys(this.form.controls).forEach(e=>{this.activeFilters.removeByKey(e)}),this.searchControl.reset(),this.form.reset()}toggleFilterDropdown(){this.filterDropdownVisible$.next(!this.filterDropdownVisible$.value)}addFilterFromDropdownClick(e){this.activeFilters.add(e,{focus:!0}),this.filterDropdownVisible$.next(!1)}searchInputIsFocused(){return document.activeElement===this.searchInput.nativeElement}cursorAtStartOfSearchInput(){return this.searchInputIsFocused()&&0===this.searchInput.nativeElement.selectionStart}cursorAtEndOfSearchInput(){return this.searchInputIsFocused()&&this.searchInput.nativeElement.selectionStart===this.searchInput.nativeElement.value.length}bindToFormValueChange(){this.form.valueChanges.pipe((0,Dt.U)(e=>Object.keys(e).length?e:null),(0,Xt.x)()).subscribe(e=>{this.filterChange.emit(e?Rn(e):null)})}watchForSizeChanges(){new ResizeObserver(e=>{this.filterBarHeight=e[0].contentRect.height}).observe(this.el.nativeElement,{box:"border-box"})}setFiltersFromQuery(){const e=this.router.routerState.root.snapshot.queryParams;e.filters&&En(e.filters).forEach(e=>{this.activeFilters.add(this.keyedFilters[e.key],e)}),e.query&&this.searchControl.setValue(e.query)}setupKeybinds(){this.keybinds.add(["backspace","delete"],()=>this.cursorAtStartOfSearchInput()?this.activeFilters.focusLast():this.activeFilters.anyFocused()?(this.activeFilters.removeCurrentlyFocused(),this.searchInput.nativeElement.focus()):void 0),this.keybinds.add("arrow_left",e=>{this.cursorAtStartOfSearchInput()?(this.activeFilters.focusLast(),e.preventDefault()):this.activeFilters.anyFocused()&&(this.activeFilters.focusPrevious(),e.preventDefault())}),this.keybinds.add("arrow_right",e=>{if(this.activeFilters.anyFocused()){e.preventDefault();const t=this.activeFilters.getFocusedIndex(),n=this.activeFilters.getByIndex(t+1);n?n.focus():this.activeFilters.lastIsFocused()&&this.searchInput.nativeElement.focus()}}),this.keybinds.add(["arrow_down","tab"],e=>{if(this.cursorAtEndOfSearchInput()||this.suggestions.anyFocused()){e.preventDefault(),this.filterDropdownVisible$.value||this.toggleFilterDropdown();const t=this.suggestions.getFocusedIndex();let n=t>-1?t:0;this.suggestions.anyFocused()&&(n+=1),n>=this.suggestions.items.length&&(n=0),this.suggestions.focusItemAt(n)}}),this.keybinds.add(["arrow_up","shift+tab"],e=>{if(this.suggestions.anyFocused()){e.preventDefault();const t=this.activeFilters.getFocusedIndex();let n=t>-1?t:0;n-=1,-1===n?this.searchInput.nativeElement.focus():this.suggestions.focusItemAt(n)}}),this.keybinds.add("enter",e=>{const t=this.suggestions.getFocusedFilter();t&&(e.preventDefault(),this.activeFilters.add(t,{focus:!0}),this.filterDropdownVisible$.next(!1))}),this.keybinds.add("esc",e=>{this.filterDropdownVisible$.value&&(e.preventDefault(),this.filterDropdownVisible$.next(!1))}),this.keybinds.listenOn(document,{fireIfInputFocused:!0})}subscribeToCloseActions(){this.closeActionsStream$=(0,$.T)((0,v.R)(document,"click"),(0,v.R)(document,"auxclick"),(0,v.R)(document,"touchend")).pipe((0,j.h)(e=>{const t=e.target;return t!==this.el.nativeElement&&!this.el.nativeElement.contains(t)})).subscribe(()=>{this.filterDropdownVisible$.next(!1)})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(a.qu),o.Y36(l.gz),o.Y36(o.SBq),o.Y36(On.C),o.Y36(o.sBO),o.Y36(l.F0))},e.\u0275cmp=o.Xpm({type:e,selectors:[["search-input-with-filters"]],viewQuery:function(e,t){if(1&e&&(o.Gf(Pn,5),o.Gf(cn,5),o.Gf(Dn,5),o.Gf(Sn,5)),2&e){let e;o.iGM(e=o.CRH())&&(t.searchInput=e.first),o.iGM(e=o.CRH())&&(t.suggestions=e.first),o.iGM(e=o.CRH())&&(t.activeFilters=e.first),o.iGM(e=o.CRH())&&(t.filterContainers=e)}},hostBindings:function(e,t){1&e&&o.NdJ("click",function(e){return t.onClick(e)})},inputs:{compact:"compact",searchControl:"searchControl",pluralName:"pluralName",filters:"filters"},outputs:{filterChange:"filterChange",inputFocus:"inputFocus"},decls:11,vars:18,consts:[[3,"form","config","compact"],[1,"input-container","search-input-container"],["svgIcon","search",1,"search-icon"],["type","text",1,"search-input",3,"placeholder","formControl","focus"],["searchInput",""],["type","button","class","clear-button","mat-icon-button","",3,"click",4,"ngIf"],["type","button","mat-button","","class","filter-button",3,"click",4,"ngIf"],[3,"filters","filterSelected"],["type","button","mat-icon-button","",1,"clear-button",3,"click"],["svgIcon","close"],["type","button","mat-button","",1,"filter-button",3,"click"],["svgIcon","filter-list",1,"filter-button-icon"],["class","filter-button-text","trans","",4,"ngIf"],["trans","",1,"filter-button-text"]],template:function(e,t){1&e&&(o.TgZ(0,"active-filters",0),o.TgZ(1,"div",1),o._UZ(2,"mat-icon",2),o.TgZ(3,"input",3,4),o.NdJ("focus",function(){return t.inputFocus.emit()}),o.ALo(5,"trans"),o.qZA(),o.qZA(),o.qZA(),o.YNc(6,Nn,2,0,"button",5),o.ALo(7,"async"),o.YNc(8,Yn,3,1,"button",6),o.TgZ(9,"filter-suggestions",7),o.NdJ("filterSelected",function(e){return t.addFilterFromDropdownClick(e)}),o.ALo(10,"async"),o.qZA()),2&e&&(o.Q6J("form",t.form)("config",t.keyedFilters)("compact",t.compact),o.xp6(3),o.Q6J("placeholder",o.lcZ(5,12,"Type to search for "+t.pluralName))("formControl",t.searchControl),o.xp6(3),o.Q6J("ngIf",o.lcZ(7,14,t.haveFiltersOrQuery$)),o.xp6(2),o.Q6J("ngIf",t.keyedFilters),o.xp6(1),o.Udp("top",t.filterBarHeight+5+"px"),o.ekj("visible",o.lcZ(10,16,t.filterDropdownVisible$)),o.Q6J("filters",t.keyedFilters))},directives:[Dn,O.Hw,a.Fj,a.JJ,a.oH,i.O5,cn,g.lW,Zt.P],pipes:[lt.R,i.Ov],styles:["[_nghost-%COMP%]{display:flex;background-color:var(--be-background);border:1px solid var(--be-divider-default);height:45px;border-radius:4px;position:relative;padding-left:3px;overflow:hidden;width:100%}@media only screen and (max-width: 768px){[_nghost-%COMP%]{flex-wrap:wrap;justify-content:center}}[_nghost-%COMP%]:focus-within{outline:none;border-color:var(--be-accent-lighter);box-shadow:0 0 0 2px var(--be-accent-lighter);z-index:3;overflow:visible;height:auto!important}.search-input-container[_ngcontent-%COMP%]{display:flex;align-items:center;flex:1 1 auto;width:auto;height:43px;padding-left:8px}.search-icon[_ngcontent-%COMP%]{display:block;color:var(--be-secondary-text);margin-right:5px}.search-input[_ngcontent-%COMP%]{border:none;height:100%;padding:0}.search-input[_ngcontent-%COMP%]:focus{box-shadow:none;z-index:1}.filter-button[_ngcontent-%COMP%]{min-width:auto;padding:0 14px}.clear-button[_ngcontent-%COMP%], .filter-button[_ngcontent-%COMP%]{color:var(--be-accent-default);height:43px}.clear-button[_ngcontent-%COMP%]{width:43px;line-height:43px}.filter-button-text[_ngcontent-%COMP%]{margin-left:10px}"],changeDetection:0}),e})();const Rn=e=>{const t=[];return Object.values(e).forEach(e=>{""!==e.value&&t.push(e)}),t.length?encodeURIComponent(btoa(JSON.stringify(t))):""},En=e=>{let t=[];try{t=JSON.parse(atob(decodeURIComponent(e)))}catch(n){}return t};let Ln=(()=>{class e{constructor(e){this.datable=e}onFilterChange(e){this.datable.filters$.next({filters:e})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Lt))},e.\u0275cmp=o.Xpm({type:e,selectors:[["datatable-filters"]],inputs:{pluralName:"pluralName",filters:"filters"},decls:1,vars:3,consts:[[3,"searchControl","pluralName","filters","filterChange"]],template:function(e,t){1&e&&(o.TgZ(0,"search-input-with-filters",0),o.NdJ("filterChange",function(e){return t.onFilterChange(e)}),o.qZA()),2&e&&o.Q6J("searchControl",t.datable.searchControl)("pluralName",t.pluralName)("filters",t.filters)},directives:[Fn],styles:[""],changeDetection:0}),e})();const $n=["table-header-checkbox",""];let Vn=(()=>{class e{constructor(e,t){this.datatable=e,this.cd=t}ngOnInit(){this.changeRef=this.datatable.selectedRows$.subscribe(()=>{this.cd.markForCheck()})}ngOnDestroy(){this.changeRef.unsubscribe()}anyRowsSelected(){return!!this.datatable.selectedRows$.value.length}allRowsSelected(){var e;return this.datatable.selectedRows$.value.length&&this.datatable.selectedRows$.value.length===(null===(e=this.datatable.data$.value)||void 0===e?void 0:e.length)}toggleAllRows(){this.allRowsSelected()?this.datatable.selectedRows$.next([]):this.datatable.selectedRows$.next(this.datatable.data$.value.map(e=>e.id))}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Lt),o.Y36(o.sBO))},e.\u0275cmp=o.Xpm({type:e,selectors:[["","table-header-checkbox",""]],hostAttrs:[1,"table-checkbox"],attrs:$n,decls:1,vars:2,consts:[[3,"checked","indeterminate","change"]],template:function(e,t){1&e&&(o.TgZ(0,"mat-checkbox",0),o.NdJ("change",function(e){return e?t.toggleAllRows():null}),o.qZA()),2&e&&o.Q6J("checked",t.allRowsSelected())("indeterminate",t.anyRowsSelected()&&!t.allRowsSelected())},directives:[p.oG],encapsulation:2,changeDetection:0}),e})();var Hn=n(6966);const zn=["columnName"],Bn=["table-sort-header",""],jn=["*"];let Gn=(()=>{class e{constructor(e,t,n,i){this.datable=e,this.cd=t,this.focusMonitor=n,this.el=i,this.orderDir=null,this.arrowVisible=!1,this.arrowDirection="down"}get sortDisabled(){var e;return null===(e=this.datable.config)||void 0===e?void 0:e.disableSort}ngOnInit(){this.orderBy||(this.orderBy=(0,Hn.V)(this.columnName.nativeElement.textContent,"_")),this.sortSub=this.datable.sort$.pipe((0,j.h)(e=>e.orderBy!==this.orderBy)).subscribe(()=>{this.orderDir=null,this.onMouseLeave(),this.cd.markForCheck()})}ngAfterViewInit(){this.focusMonitor.monitor(this.el).subscribe()}ngOnDestroy(){this.sortSub.unsubscribe(),this.focusMonitor.stopMonitoring(this.el)}changeSort(){this.datable.sort$.next({orderBy:this.orderBy,orderDir:this.getDirection(this.orderDir)})}getDirection(e){switch(e){case"asc":return this.arrowVisible=!1,this.orderDir=null;case"desc":return this.arrowVisible=!0,this.arrowDirection="up",this.orderDir="asc";default:return this.arrowVisible=!0,this.arrowDirection="down",this.orderDir="desc"}}onMouseEnter(){var e;(null===(e=this.datable.config)||void 0===e?void 0:e.disableSort)||(this.arrowVisible=!0)}onMouseLeave(){this.arrowVisible=!1,this.orderDir||(this.arrowDirection="down")}handleClick(){var e;(null===(e=this.datable.config)||void 0===e?void 0:e.disableSort)||this.changeSort()}handleKeydown(e){var t;(null===(t=this.datable.config)||void 0===t?void 0:t.disableSort)||e.keyCode!==H.L_&&e.keyCode!==H.K5||(e.preventDefault(),this.changeSort())}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Lt),o.Y36(o.sBO),o.Y36(Y.tE),o.Y36(o.SBq))},e.\u0275cmp=o.Xpm({type:e,selectors:[["","table-sort-header",""]],viewQuery:function(e,t){if(1&e&&o.Gf(zn,7),2&e){let e;o.iGM(e=o.CRH())&&(t.columnName=e.first)}},hostAttrs:["tabindex","0"],hostVars:4,hostBindings:function(e,t){1&e&&o.NdJ("click",function(){return t.handleClick()})("keydown",function(e){return t.handleKeydown(e)})("mouseenter",function(){return t.onMouseEnter()})("mouseleave",function(){return t.onMouseLeave()}),2&e&&o.ekj("active",t.orderDir)("sort-disabled",t.sortDisabled)},inputs:{orderBy:["table-sort-header","orderBy"]},attrs:Bn,ngContentSelectors:jn,decls:5,vars:3,consts:[[1,"text"],["columnName",""],[1,"icon-wrapper",3,"ngClass"],["svgIcon","arrow-downward",1,"sort-icon"]],template:function(e,t){1&e&&(o.F$t(),o.TgZ(0,"span",0,1),o.Hsn(2),o.qZA(),o.TgZ(3,"span",2),o._UZ(4,"mat-icon",3),o.qZA()),2&e&&(o.xp6(3),o.Q6J("ngClass",t.arrowDirection),o.xp6(1),o.ekj("hint-visible",t.arrowVisible))},directives:[i.mk,O.Hw],styles:["[_nghost-%COMP%]{outline:none}[_nghost-%COMP%]:not(.sort-disabled){cursor:pointer}.active[_nghost-%COMP%]   .sort-icon[_ngcontent-%COMP%]{color:var(--be-text);opacity:1;transform:translate(0)}.cdk-keyboard-focused[_nghost-%COMP%]   .text[_ngcontent-%COMP%]{border-bottom:1px solid}.text[_ngcontent-%COMP%]{display:inline-block;text-transform:capitalize}.sort-icon[_ngcontent-%COMP%], .text[_ngcontent-%COMP%]{vertical-align:middle}.sort-icon[_ngcontent-%COMP%]{width:15px;height:15px;transition:all 225ms cubic-bezier(.4,0,.2,1);transform:translateY(25%);opacity:0}.icon-wrapper[_ngcontent-%COMP%]{display:inline-block;margin-left:4px;transition:transform 225ms cubic-bezier(.4,0,.2,1)}.icon-wrapper[_ngcontent-%COMP%]:not(.down){transform:rotate(180deg)}.hint-visible[_ngcontent-%COMP%]{opacity:1;transform:translate(0)}"],changeDetection:0}),e})();function Xn(e,t){if(1&e&&(o.TgZ(0,"div",6),o.TgZ(1,"div",7),o._uU(2,"Items per page"),o.qZA(),o.TgZ(3,"div",8),o.TgZ(4,"select",9),o.TgZ(5,"option",10),o._uU(6,"10"),o.qZA(),o.TgZ(7,"option",10),o._uU(8,"15"),o.qZA(),o.TgZ(9,"option",10),o._uU(10,"20"),o.qZA(),o.TgZ(11,"option",10),o._uU(12,"50"),o.qZA(),o.TgZ(13,"option",10),o._uU(14,"100"),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(4),o.Q6J("formControl",e.perPageControl),o.xp6(1),o.Q6J("ngValue",10),o.xp6(2),o.Q6J("ngValue",15),o.xp6(2),o.Q6J("ngValue",20),o.xp6(2),o.Q6J("ngValue",50),o.xp6(2),o.Q6J("ngValue",100)}}function Wn(e,t){if(1&e&&(o.TgZ(0,"div",11),o._uU(1),o.ALo(2,"trans"),o.ALo(3,"number"),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.HOy(" ",e.from," - ",e.to," ",o.lcZ(2,4,"of")," ",o.lcZ(3,6,e.totalRecords)," ")}}let Kn=(()=>{class e{constructor(e,t){this.datable=e,this.cd=t,this.hidePerPage=!1,this.perPageControl=new a.NI(15)}ngOnInit(){this.changeRef=this.datable.paginator.response$.pipe((0,j.h)(e=>!!(null==e?void 0:e.pagination)),(0,Dt.U)(e=>e.pagination)).subscribe(e=>{this.totalRecords=e.total,this.to=Math.min(e.per_page*e.current_page,this.totalRecords),this.from=Math.max(this.to-e.per_page,1),this.havePrevious=this.datable.paginator.canLoadPrevPage(),this.haveNext=this.datable.paginator.canLoadNextPage(),this.perPageControl.setValue(parseInt(""+e.per_page),{emitEvent:!1}),this.cd.markForCheck()}),this.perPageControl.valueChanges.subscribe(e=>{this.datable.paginator.changePerPage(e)})}ngOnDestroy(){this.changeRef.unsubscribe(),this.datable.destroy()}previousPage(){this.datable.paginator.previousPage()}nextPage(){this.datable.paginator.nextPage()}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Lt),o.Y36(o.sBO))},e.\u0275cmp=o.Xpm({type:e,selectors:[["datatable-footer"]],inputs:{hidePerPage:"hidePerPage"},decls:9,vars:8,consts:[["class","page-size",4,"ngIf"],[1,"range-actions"],["class","range-label",4,"ngIf"],["type","button","mat-icon-button","",1,"range-button",3,"disabled","click"],["svgIcon","chevron-left"],["svgIcon","chevron-right"],[1,"page-size"],["trans","",1,"page-size-label"],[1,"input-container"],[1,"page-size-input",3,"formControl"],[3,"ngValue"],[1,"range-label"]],template:function(e,t){1&e&&(o.YNc(0,Xn,15,6,"div",0),o.TgZ(1,"div",1),o.YNc(2,Wn,4,8,"div",2),o.TgZ(3,"button",3),o.NdJ("click",function(){return t.previousPage()}),o.ALo(4,"async"),o._UZ(5,"mat-icon",4),o.qZA(),o.TgZ(6,"button",3),o.NdJ("click",function(){return t.nextPage()}),o.ALo(7,"async"),o._UZ(8,"mat-icon",5),o.qZA(),o.qZA()),2&e&&(o.Q6J("ngIf",!t.hidePerPage),o.xp6(2),o.Q6J("ngIf",t.from&&t.to&&t.totalRecords),o.xp6(1),o.Q6J("disabled",!t.havePrevious||o.lcZ(4,4,t.datable.paginator.loading$)),o.xp6(3),o.Q6J("disabled",!t.haveNext||o.lcZ(7,6,t.datable.paginator.loading$)))},directives:[i.O5,g.lW,O.Hw,Zt.P,a.EJ,a.JJ,a.oH,a.YN,a.Kr],pipes:[i.Ov,lt.R,i.JJ],styles:["[_nghost-%COMP%]{display:flex;padding:0 8px;align-items:center;justify-content:flex-end;flex-wrap:wrap-reverse;width:100%;height:56px}.page-size[_ngcontent-%COMP%]{display:flex;align-items:center;margin-right:8px}.page-size-label[_ngcontent-%COMP%]{font-size:1.2rem;color:var(--be-secondary-text);margin:0 4px}.input-container[_ngcontent-%COMP%]{width:auto}.page-size-input[_ngcontent-%COMP%]{width:60px;height:33px;padding:4px;margin:0 4px}.range-actions[_ngcontent-%COMP%]{display:flex;align-items:center}.range-label[_ngcontent-%COMP%]{margin:0 32px 0 24px;font-size:1.2rem}.range-button[_ngcontent-%COMP%], .range-label[_ngcontent-%COMP%]{color:var(--be-secondary-text)}.range-button[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{width:28px;height:28px;line-height:28px}"],changeDetection:0}),e})();const ei=["table-body-checkbox",""];let ti=(()=>{class e{constructor(e,t){this.datatable=e,this.cd=t}ngOnInit(){this.changeRef=this.datatable.selectedRows$.subscribe(e=>{this.cd.markForCheck()})}ngOnDestroy(){this.changeRef.unsubscribe()}isRowSelected(e){return this.datatable.selectedRows$.value.indexOf(e)>-1}toggleRow(e){if(this.isRowSelected(e)){const t=this.datatable.selectedRows$.value.slice(),n=this.datatable.selectedRows$.value.indexOf(e);t.splice(n,1),this.datatable.selectedRows$.next(t)}else this.datatable.selectedRows$.next([...this.datatable.selectedRows$.value,e])}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Lt),o.Y36(o.sBO))},e.\u0275cmp=o.Xpm({type:e,selectors:[["","table-body-checkbox",""]],hostAttrs:[1,"table-checkbox"],inputs:{rowId:["table-body-checkbox","rowId"]},attrs:ei,decls:1,vars:1,consts:[[3,"checked","click","change"]],template:function(e,t){1&e&&(o.TgZ(0,"mat-checkbox",0),o.NdJ("click",function(e){return e.stopPropagation()})("change",function(e){return e?t.toggleRow(t.rowId):null}),o.qZA()),2&e&&o.Q6J("checked",t.isRowSelected(t.rowId))},directives:[p.oG],encapsulation:2,changeDetection:0}),e})();function ni(e,t){if(1&e&&(o.ynx(0),o._UZ(1,"img",1),o.TgZ(2,"div",2),o.TgZ(3,"div"),o._uU(4),o.qZA(),o.TgZ(5,"div",3),o._uU(6),o.qZA(),o.qZA(),o.BQk()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("src",e.user.avatar,o.LSH),o.xp6(3),o.Oqu(e.user.display_name),o.xp6(2),o.Oqu(e.user.email)}}let ii=(()=>{class e{constructor(){this.showEmail=!1}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=o.Xpm({type:e,selectors:[["user-column"]],hostAttrs:[1,"column-with-image"],inputs:{user:"user",showEmail:"showEmail"},decls:1,vars:1,consts:[[4,"ngIf"],["alt","",3,"src"],[1,"content"],[1,"email","secondary"]],template:function(e,t){1&e&&o.YNc(0,ni,7,3,"ng-container",0),2&e&&o.Q6J("ngIf",t.user)},directives:[i.O5],styles:[""],changeDetection:0}),e})();var ai=n(6403),si=n(8256);function oi(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",16),o.NdJ("click",function(){return o.CHM(e),o.oxw().showCrupdateProjectModal()}),o._UZ(1,"mat-icon",17),o.TgZ(2,"span",1),o._uU(3,"Create New Project"),o.qZA(),o.qZA()}}function ri(e,t){1&e&&o._UZ(0,"mat-progress-bar",18)}function li(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",23),o.NdJ("click",function(){return o.CHM(e),o.oxw(2).maybeDeleteSelectedProjects()}),o._uU(1," Delete "),o.qZA()}}const ci=function(e){return{count:e,resource:"project(s)"}};function di(e,t){if(1&e&&(o.TgZ(0,"tr"),o.TgZ(1,"th",19),o.TgZ(2,"div",20),o._uU(3," :count :resource selected: "),o.qZA(),o.TgZ(4,"div",21),o.YNc(5,li,2,0,"button",22),o.qZA(),o.qZA(),o.qZA()),2&e){const e=t.ngIf,n=o.oxw();o.xp6(2),o.Q6J("transValues",o.VKq(2,ci,e)),o.xp6(3),o.Q6J("ngIf",n.currentUser.hasPermission("projects.delete"))}}function ui(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",35),o.NdJ("click",function(){o.CHM(e);const t=o.oxw().$implicit;return o.oxw().showCrupdateProjectModal(t)}),o.ALo(1,"trans"),o._UZ(2,"mat-icon",36),o.qZA()}2&e&&o.Q6J("matTooltip",o.lcZ(1,1,"Update details"))}const gi=function(e){return["/design",e]};function pi(e,t){if(1&e&&(o.TgZ(0,"tr"),o._UZ(1,"td",24),o.TgZ(2,"td"),o.TgZ(3,"div",25),o._UZ(4,"img",26),o.TgZ(5,"span"),o._uU(6),o.qZA(),o.qZA(),o.qZA(),o.TgZ(7,"td",27),o._UZ(8,"user-column",28),o.qZA(),o.TgZ(9,"td",29),o._uU(10),o.qZA(),o.TgZ(11,"td",30),o._uU(12),o.qZA(),o.TgZ(13,"td"),o._uU(14),o.ALo(15,"formattedDate"),o.qZA(),o.TgZ(16,"td",31),o.TgZ(17,"a",32),o.ALo(18,"trans"),o._UZ(19,"mat-icon",33),o.qZA(),o.YNc(20,ui,3,3,"button",34),o.qZA(),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.xp6(1),o.Q6J("table-body-checkbox",e.id),o.xp6(3),o.Q6J("src",n.getProjectThumbnail(e),o.LSH),o.xp6(2),o.hij(" ",e.name," "),o.xp6(2),o.Q6J("user",e.users[0]),o.xp6(2),o.Oqu(e.published?"Yes":"No"),o.xp6(2),o.Oqu(e.template),o.xp6(2),o.Oqu(o.lcZ(15,10,e.updated_at)),o.xp6(3),o.Q6J("routerLink",o.VKq(14,gi,e.id))("matTooltip",o.lcZ(18,12,"Edit project")),o.xp6(3),o.Q6J("ngIf",n.currentUser.hasPermission("projects.update"))}}function hi(e,t){1&e&&(o.TgZ(0,"no-results-message",37),o.TgZ(1,"span",38),o._uU(2,"No projects have been created yet"),o.qZA(),o.qZA())}let mi=(()=>{class e{constructor(e,t,n,i,a){this.datatable=e,this.projects=t,this.modal=n,this.projectUrl=i,this.currentUser=a,this.projects$=this.datatable.data$,this.filters=an}ngOnInit(){this.datatable.init({uri:qt.p.BASE_URI})}maybeDeleteSelectedProjects(){this.datatable.confirmResourceDeletion("projects").subscribe(()=>{this.projects.delete(this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset()})})}showCrupdateProjectModal(e){this.datatable.openCrupdateResourceModal(kt.v,{project:e,showExtraConfig:!0}).subscribe()}getProjectThumbnail(e){return this.projectUrl.getBaseUrl(e)+"thumbnail.png"}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Lt),o.Y36(qt.p),o.Y36(ft.u),o.Y36(sn.b),o.Y36(on.I))},e.\u0275cmp=o.Xpm({type:e,selectors:[["project-index"]],features:[o._Bn([Lt])],decls:32,vars:12,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","projects",3,"filters"],[1,"action-buttons"],["mat-raised-button","","color","accent","class","button-with-icon",3,"click",4,"ngIf"],[1,"datatable","responsive-table"],["class","loading-bar","mode","indeterminate","color","accent",4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","name","trans",""],["table-sort-header","","trans",""],["table-sort-header","updated_at","trans",""],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","website-builder.svg",4,"ngIf"],["mat-raised-button","","color","accent",1,"button-with-icon",3,"click"],["svgIcon","add"],["mode","indeterminate","color","accent",1,"loading-bar"],["colspan","7"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["mat-raised-button","","color","warn","trans","",3,"click",4,"ngIf"],["mat-raised-button","","color","warn","trans","",3,"click"],[3,"table-body-checkbox"],[1,"column-with-image"],["alt","",3,"src"],["data-label","Owner"],[3,"user"],["data-label","Published"],["data-label","Template"],[1,"edit-column"],["mat-icon-button","","target","_blank",3,"routerLink","matTooltip"],["svgIcon","edit"],["mat-icon-button","",3,"matTooltip","click",4,"ngIf"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","settings"],["svgImage","website-builder.svg"],["primary-text",""]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"h1",1),o._uU(2,"Projects"),o.qZA(),o.TgZ(3,"div",2),o._UZ(4,"datatable-filters",3),o.TgZ(5,"div",4),o.YNc(6,oi,4,0,"button",5),o.qZA(),o.qZA(),o.qZA(),o.TgZ(7,"div",6),o.YNc(8,ri,1,0,"mat-progress-bar",7),o.ALo(9,"async"),o.TgZ(10,"table",8),o.TgZ(11,"thead"),o.TgZ(12,"tr"),o._UZ(13,"th",9),o.TgZ(14,"th",10),o._uU(15,"Project"),o.qZA(),o.TgZ(16,"th",1),o._uU(17,"Owner"),o.qZA(),o.TgZ(18,"th",11),o._uU(19,"Published"),o.qZA(),o.TgZ(20,"th",11),o._uU(21,"Template"),o.qZA(),o.TgZ(22,"th",12),o._uU(23,"Last Updated"),o.qZA(),o._UZ(24,"th"),o.qZA(),o.YNc(25,di,6,4,"tr",13),o.qZA(),o.TgZ(26,"tbody"),o.YNc(27,pi,21,16,"tr",14),o.ALo(28,"async"),o.qZA(),o.qZA(),o.YNc(29,hi,3,0,"no-results-message",15),o.ALo(30,"async"),o._UZ(31,"datatable-footer"),o.qZA()),2&e&&(o.xp6(4),o.Q6J("filters",t.filters),o.xp6(2),o.Q6J("ngIf",t.currentUser.hasPermission("projects.create")),o.xp6(2),o.Q6J("ngIf",o.lcZ(9,6,t.datatable.paginator&&t.datatable.paginator.loading$)),o.xp6(17),o.Q6J("ngIf",t.datatable.selectedRows$.value.length),o.xp6(2),o.Q6J("ngForOf",o.lcZ(28,8,t.projects$)),o.xp6(2),o.Q6J("ngIf",o.lcZ(30,10,t.datatable.paginator.noResults$)))},directives:[Zt.P,Ln,i.O5,Vn,Gn,i.sg,Kn,g.lW,O.Hw,s.pW,ti,ii,g.zs,l.yS,k.gM,ai.U],pipes:[i.Ov,si.l,lt.R],styles:[""],encapsulation:2}),e})();var fi=n(9970);function _i(e,t){1&e&&(o.TgZ(0,"h2",26),o._uU(1,"Update Template Details"),o.qZA())}function bi(e,t){1&e&&(o.TgZ(0,"h2",26),o._uU(1,"Create a New Template"),o.qZA())}function vi(e,t){if(1&e&&(o.TgZ(0,"div",27),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Oqu(e.errors.name)}}function Zi(e,t){if(1&e&&(o.TgZ(0,"option",28),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("ngValue",e),o.xp6(1),o.Oqu(e)}}function xi(e,t){if(1&e&&(o.TgZ(0,"div",27),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Oqu(e.errors.category)}}function Ai(e,t){if(1&e&&(o.TgZ(0,"div",27),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Oqu(e.errors.template)}}function yi(e,t){if(1&e&&(o.TgZ(0,"div",27),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Oqu(e.errors.thumbnail)}}function wi(e,t){if(1&e&&(o.TgZ(0,"div",27),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Oqu(e.errors.includeBootstrap)}}function Ci(e,t){1&e&&(o.TgZ(0,"span",16),o._uU(1,"Update Template"),o.qZA())}function Ti(e,t){1&e&&(o.TgZ(0,"span",16),o._uU(1,"Upload Template"),o.qZA())}let qi=(()=>{class e{constructor(e,t,n,i,a,s,o){this.dialogRef=e,this.data=t,this.templates=n,this.toast=i,this.settings=a,this.fb=s,this.cd=o,this.allCategories=[],this.loading$=new pt.X(!1),this.form=this.fb.group({name:[""],category:[""],includeBootstrap:[!1]}),this.files={},this.errors={},this.allCategories=this.settings.getJson("builder.template_categories",[]),this.form.get("category").setValue(this.allCategories[0])}ngOnInit(){this.data.template&&this.hydrateModel(this.data.template)}confirm(){let e;this.loading$.next(!0);const t=this.getPayload();e=this.data.template?this.templates.update(this.data.template.name,t):this.templates.create(t),e.pipe((0,gt.x)(()=>this.loading$.next(!1))).subscribe(e=>{this.close(e.template),this.toast.open("Template has been "+(this.data.template?"updated":"created"))},e=>{this.errors=e.errors,this.cd.markForCheck()})}getPayload(){const e=new FormData;this.files.template&&e.append("template",this.files.template),this.files.thumbnail&&e.append("thumbnail",this.files.thumbnail);for(const t in this.form.value)e.append(t,this.form.value[t]);return e}close(e){this.dialogRef.close(e)}hydrateModel(e){this.form.patchValue(e.config)}setFile(e,t){this.files[e]=t.item(0),this.errors={}}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(m.so),o.Y36(m.WI),o.Y36(fi.Q),o.Y36(mt.F),o.Y36(st.Z),o.Y36(a.qu),o.Y36(o.sBO))},e.\u0275cmp=o.Xpm({type:e,selectors:[["crupdate-template-modal"]],decls:47,vars:15,consts:[[1,"modal-header"],["class","modal-title","mat-dialog-title","","trans","",4,"ngIf"],["type","button",1,"close-button","no-style","icon-button",3,"click"],["svgIcon","close"],["autocomplete","off","ngNativeValidate","",3,"formGroup","ngSubmit"],["mat-dialog-content","",1,"many-inputs","mat-dialog-content"],[1,"input-container"],["for","name","trans",""],["type","text","id","name","name","name","formControlName","name","required",""],["class","error",4,"ngIf"],["for","category","trans",""],["id","category","name","category","formControlName","category","required",""],[3,"ngValue",4,"ngFor","ngForOf"],["for","template-file","trans",""],["type","file","name","template-file","id","template-file","accept","application/zip",3,"required","change"],["templateInput",""],["trans",""],["for","thumbnail","trans",""],["type","file","name","thumbnail","id","thumbnail","accept","image/*",3,"change"],["thumbInput",""],[1,"setting-toggle-container"],["formControlName","includeBootstrap","trans",""],["mat-dialog-actions","",1,"buttons","right","mat-dialog-actions"],["type","button","mat-button","","trans","",1,"button","cancel",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary",3,"disabled"],["trans","",4,"ngIf"],["mat-dialog-title","","trans","",1,"modal-title"],[1,"error"],[3,"ngValue"]],template:function(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",0),o.YNc(1,_i,2,0,"h2",1),o.YNc(2,bi,2,0,"h2",1),o.TgZ(3,"button",2),o.NdJ("click",function(){return t.close()}),o._UZ(4,"mat-icon",3),o.qZA(),o.qZA(),o.TgZ(5,"form",4),o.NdJ("ngSubmit",function(){return t.confirm()}),o.TgZ(6,"div",5),o.TgZ(7,"div",6),o.TgZ(8,"label",7),o._uU(9,"Name"),o.qZA(),o._UZ(10,"input",8),o.YNc(11,vi,2,1,"div",9),o.qZA(),o.TgZ(12,"div",6),o.TgZ(13,"label",10),o._uU(14,"Category"),o.qZA(),o.TgZ(15,"select",11),o.YNc(16,Zi,2,2,"option",12),o.qZA(),o.YNc(17,xi,2,1,"div",9),o.qZA(),o.TgZ(18,"div",6),o.TgZ(19,"label",13),o._uU(20,"Template Zip"),o.qZA(),o.TgZ(21,"input",14,15),o.NdJ("change",function(){o.CHM(e);const n=o.MAs(22);return t.setFile("template",n.files)}),o.qZA(),o.TgZ(23,"p",16),o._uU(24,"Zip of template files. Must contain index.html file which will be used as default page."),o.qZA(),o.TgZ(25,"p",16),o._uU(26,'(Optional) CSS and JS that should appear in builder code editors should be in "css/code_editor_styles.css" and "js/code_editor_scripts.js" files.'),o.qZA(),o.YNc(27,Ai,2,1,"div",9),o.qZA(),o.TgZ(28,"div",6),o.TgZ(29,"label",17),o._uU(30,"Thumbnail"),o.qZA(),o.TgZ(31,"input",18,19),o.NdJ("change",function(){o.CHM(e);const n=o.MAs(32);return t.setFile("thumbnail",n.files)}),o.qZA(),o.YNc(33,yi,2,1,"div",9),o.qZA(),o.TgZ(34,"div",20),o.TgZ(35,"mat-slide-toggle",21),o._uU(36,"Include Bootstrap"),o.qZA(),o.TgZ(37,"p",16),o._uU(38,"Deselect if template .zip already includes bootstrap files, otherwise styles will be duplicated which might cause issues."),o.qZA(),o.YNc(39,wi,2,1,"div",9),o.qZA(),o.qZA(),o.TgZ(40,"div",22),o.TgZ(41,"button",23),o.NdJ("click",function(){return t.close()}),o._uU(42,"Cancel"),o.qZA(),o.TgZ(43,"button",24),o.ALo(44,"async"),o.YNc(45,Ci,2,0,"span",25),o.YNc(46,Ti,2,0,"span",25),o.qZA(),o.qZA(),o.qZA()}2&e&&(o.xp6(1),o.Q6J("ngIf",t.data.template),o.xp6(1),o.Q6J("ngIf",!t.data.template),o.xp6(3),o.Q6J("formGroup",t.form),o.xp6(6),o.Q6J("ngIf",t.errors.name),o.xp6(5),o.Q6J("ngForOf",t.allCategories),o.xp6(1),o.Q6J("ngIf",t.errors.category),o.xp6(4),o.Q6J("required",!t.data.template),o.xp6(6),o.Q6J("ngIf",t.errors.template),o.xp6(6),o.Q6J("ngIf",t.errors.thumbnail),o.xp6(6),o.Q6J("ngIf",t.errors.includeBootstrap),o.xp6(4),o.Q6J("disabled",o.lcZ(44,13,t.loading$)),o.xp6(2),o.Q6J("ngIf",t.data.template),o.xp6(1),o.Q6J("ngIf",!t.data.template))},directives:[i.O5,O.Hw,a.JL,a.sg,m.xY,Zt.P,a.Fj,a.JJ,a.u,a.Q7,a.EJ,i.sg,T.Rr,m.H8,g.lW,m.uh,a.YN,a.Kr],pipes:[i.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}"],changeDetection:0}),e})();function ki(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",15),o.NdJ("click",function(){return o.CHM(e),o.oxw().showCrupdateTemplateModal()}),o._UZ(1,"mat-icon",16),o.TgZ(2,"span",1),o._uU(3,"Upload New Template"),o.qZA(),o.qZA()}}function Mi(e,t){1&e&&o._UZ(0,"mat-progress-bar",17)}function Ii(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",22),o.NdJ("click",function(){return o.CHM(e),o.oxw(2).maybeDeleteSelectedTemplates()}),o._uU(1," Delete "),o.qZA()}}const Ui=function(e){return{count:e,resource:"template(s)"}};function Ji(e,t){if(1&e&&(o.TgZ(0,"tr"),o.TgZ(1,"th",18),o.TgZ(2,"div",19),o._uU(3," :count :resource selected: "),o.qZA(),o.TgZ(4,"div",20),o.YNc(5,Ii,2,0,"button",21),o.qZA(),o.qZA(),o.qZA()),2&e){const e=t.ngIf,n=o.oxw();o.xp6(2),o.Q6J("transValues",o.VKq(2,Ui,e)),o.xp6(3),o.Q6J("ngIf",n.currentUser.hasPermission("templates.delete"))}}function Di(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",30),o.NdJ("click",function(){o.CHM(e);const t=o.oxw().$implicit;return o.oxw().showCrupdateTemplateModal(t)}),o.ALo(1,"trans"),o._UZ(2,"mat-icon",31),o.qZA()}2&e&&o.Q6J("matTooltip",o.lcZ(1,1,"Edit template"))}function Oi(e,t){if(1&e&&(o.TgZ(0,"tr"),o._UZ(1,"td",23),o.TgZ(2,"td"),o.TgZ(3,"div",24),o._UZ(4,"img",25),o.TgZ(5,"span"),o._uU(6),o.qZA(),o.qZA(),o.qZA(),o.TgZ(7,"td",26),o._uU(8),o.qZA(),o.TgZ(9,"td",27),o._uU(10),o.ALo(11,"formattedDate"),o.qZA(),o.TgZ(12,"td",28),o.YNc(13,Di,3,3,"button",29),o.qZA(),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.xp6(1),o.Q6J("table-body-checkbox",e.name),o.xp6(3),o.Q6J("src",n.getTemplateThumbnail(e),o.LSH),o.xp6(2),o.Oqu(e.config.name),o.xp6(2),o.Oqu(e.config.category),o.xp6(2),o.Oqu(o.lcZ(11,6,e.updated_at)),o.xp6(3),o.Q6J("ngIf",n.currentUser.hasPermission("templates.update"))}}function Pi(e,t){1&e&&(o.TgZ(0,"no-results-message",32),o.TgZ(1,"span",33),o._uU(2,"No templates have been created yet"),o.qZA(),o.qZA())}const Si=[{path:"templates",component:(()=>{class e{constructor(e,t,n,i){this.templates=e,this.currentUser=t,this.settings=n,this.datatable=i,this.templates$=this.datatable.data$}ngOnInit(){this.datatable.init({uri:"templates"})}maybeDeleteSelectedTemplates(){this.datatable.confirmResourceDeletion("templates").subscribe(()=>{this.templates.delete(this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset()})})}showCrupdateTemplateModal(e){this.datatable.openCrupdateResourceModal(qi,{template:e}).subscribe()}getTemplateThumbnail(e){return this.settings.getBaseUrl(!0)+"/"+e.thumbnail}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(fi.Q),o.Y36(on.I),o.Y36(st.Z),o.Y36(Lt))},e.\u0275cmp=o.Xpm({type:e,selectors:[["template-index"]],features:[o._Bn([Lt])],decls:28,vars:11,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","templates"],[1,"action-buttons"],["mat-raised-button","","color","accent","class","button-with-icon",3,"click",4,"ngIf"],[1,"datatable","responsive-table"],["class","loading-bar","mode","indeterminate","color","accent",4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","name","trans",""],["table-sort-header","","trans",""],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","insert-block.svg",4,"ngIf"],["mat-raised-button","","color","accent",1,"button-with-icon",3,"click"],["svgIcon","add"],["mode","indeterminate","color","accent",1,"loading-bar"],["colspan","5"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["mat-raised-button","","color","warn","trans","",3,"click",4,"ngIf"],["mat-raised-button","","color","warn","trans","",3,"click"],[3,"table-body-checkbox"],[1,"column-with-image"],["alt","",3,"src"],["data-label","Category"],["data-label","Last Updated"],[1,"edit-column"],["mat-icon-button","",3,"matTooltip","click",4,"ngIf"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","edit"],["svgImage","insert-block.svg"],["primary-text",""]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"h1",1),o._uU(2,"Templates"),o.qZA(),o.TgZ(3,"div",2),o._UZ(4,"datatable-filters",3),o.TgZ(5,"div",4),o.YNc(6,ki,4,0,"button",5),o.qZA(),o.qZA(),o.qZA(),o.TgZ(7,"div",6),o.YNc(8,Mi,1,0,"mat-progress-bar",7),o.ALo(9,"async"),o.TgZ(10,"table",8),o.TgZ(11,"thead"),o.TgZ(12,"tr"),o._UZ(13,"th",9),o.TgZ(14,"th",10),o._uU(15,"Template"),o.qZA(),o.TgZ(16,"th",11),o._uU(17,"Category"),o.qZA(),o.TgZ(18,"th",1),o._uU(19,"Last Updated"),o.qZA(),o._UZ(20,"th"),o.qZA(),o.YNc(21,Ji,6,4,"tr",12),o.qZA(),o.TgZ(22,"tbody"),o.YNc(23,Oi,14,8,"tr",13),o.ALo(24,"async"),o.qZA(),o.qZA(),o.YNc(25,Pi,3,0,"no-results-message",14),o.ALo(26,"async"),o._UZ(27,"datatable-footer"),o.qZA()),2&e&&(o.xp6(6),o.Q6J("ngIf",t.currentUser.hasPermission("templates.create")),o.xp6(2),o.Q6J("ngIf",o.lcZ(9,5,t.datatable.paginator&&t.datatable.paginator.loading$)),o.xp6(13),o.Q6J("ngIf",t.datatable.selectedRows$.value.length),o.xp6(2),o.Q6J("ngForOf",o.lcZ(24,7,t.templates$)),o.xp6(2),o.Q6J("ngIf",o.lcZ(26,9,t.datatable.paginator.noResults$)))},directives:[Zt.P,Ln,i.O5,Vn,Gn,i.sg,Kn,g.lW,O.Hw,s.pW,ti,k.gM,ai.U],pipes:[i.Ov,si.l,lt.R],styles:[""],changeDetection:0}),e})(),data:{permissions:["templates.view"]}},{path:"projects",component:mi,data:{permissions:["projects.view"]}}],Ni=[{path:"builder",component:Tt}];function Qi(e,t){if(1&e&&(o.TgZ(0,"a",19),o.TgZ(1,"div",5),o._uU(2),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.Q6J("routerLink",e.path),o.xp6(2),o.Oqu(e.path.replace("-"," "))}}function Yi(e,t){1&e&&(o.TgZ(0,"a",20),o.TgZ(1,"div",5),o._uU(2,"Billing"),o.qZA(),o.qZA())}const Fi=function(){return{panel:"menus"}},Ri=function(){return{panel:"seo-settings"}},Ei=function(){return{panel:"themes"}};function Li(e,t){if(1&e&&(o.TgZ(0,"a",4),o.TgZ(1,"div",5),o._uU(2,"General"),o.qZA(),o.qZA(),o.YNc(3,Qi,3,2,"a",6),o.YNc(4,Yi,3,0,"a",7),o.TgZ(5,"a",8),o.TgZ(6,"div",5),o._uU(7,"Localization"),o.qZA(),o.qZA(),o.TgZ(8,"a",9),o.TgZ(9,"div",5),o._uU(10,"Authentication"),o.qZA(),o.qZA(),o.TgZ(11,"a",10),o.TgZ(12,"div",5),o._uU(13,"Uploading"),o.qZA(),o.qZA(),o.TgZ(14,"a",11),o.TgZ(15,"div",5),o._uU(16,"Mail"),o.qZA(),o.qZA(),o.TgZ(17,"a",12),o.TgZ(18,"div",5),o._uU(19,"Cache"),o.qZA(),o.qZA(),o.TgZ(20,"a",13),o.TgZ(21,"div",5),o._uU(22,"Analytics"),o.qZA(),o.qZA(),o.TgZ(23,"a",14),o.TgZ(24,"div",5),o._uU(25,"Logging"),o.qZA(),o.qZA(),o.TgZ(26,"a",15),o.TgZ(27,"div",5),o._uU(28,"Queue"),o.qZA(),o.qZA(),o.TgZ(29,"a",16),o.TgZ(30,"div",5),o._uU(31,"Recaptcha"),o.qZA(),o.qZA(),o.TgZ(32,"a",17),o.TgZ(33,"div",5),o._uU(34,"GDPR"),o.qZA(),o.qZA(),o.TgZ(35,"a",18),o.TgZ(36,"div",5),o._uU(37,"Menus"),o.qZA(),o.qZA(),o.TgZ(38,"a",18),o.TgZ(39,"div",5),o._uU(40,"Seo"),o.qZA(),o.qZA(),o.TgZ(41,"a",18),o.TgZ(42,"div",5),o._uU(43,"Themes"),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(3),o.Q6J("ngForOf",e.appRoutes()),o.xp6(1),o.Q6J("ngIf",e.settings.get("billing.integrated")),o.xp6(31),o.Q6J("queryParams",o.DdM(5,Fi)),o.xp6(3),o.Q6J("queryParams",o.DdM(6,Ri)),o.xp6(3),o.Q6J("queryParams",o.DdM(7,Ei))}}function $i(e,t){1&e&&o.GkF(0)}function Vi(e,t){if(1&e&&(o.ynx(0),o.TgZ(1,"button",21),o.TgZ(2,"span",5),o._uU(3),o.ALo(4,"async"),o.qZA(),o._UZ(5,"mat-icon",22),o.qZA(),o.TgZ(6,"mat-menu",23,24),o.YNc(8,$i,1,0,"ng-container",25),o.qZA(),o.BQk()),2&e){const e=o.MAs(7),t=o.oxw(),n=o.MAs(1);o.xp6(1),o.Q6J("matMenuTriggerFor",e),o.xp6(2),o.Oqu(o.lcZ(4,3,t.activePanel$)),o.xp6(5),o.Q6J("ngTemplateOutlet",n)}}function Hi(e,t){1&e&&o.GkF(0)}function zi(e,t){if(1&e&&(o.TgZ(0,"aside",26),o.YNc(1,Hi,1,0,"ng-container",25),o.qZA()),2&e){o.oxw();const e=o.MAs(1);o.xp6(1),o.Q6J("ngTemplateOutlet",e)}}let Bi=(()=>{class e{constructor(e,t,n,i,a){this.settings=e,this.route=t,this.router=n,this.state=i,this.breakpoints=a,this.activePanel$=new pt.X(this.route.firstChild.routeConfig.path)}ngOnInit(){this.route.data.subscribe(e=>{this.state.setAll(e.settings)}),this.router.events.pipe((0,j.h)(e=>e instanceof l.m2)).subscribe(()=>{this.activePanel$.next(this.route.firstChild.routeConfig.path)})}appRoutes(){return Ni}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(st.Z),o.Y36(l.gz),o.Y36(l.F0),o.Y36(d),o.Y36(fn.S))},e.\u0275cmp=o.Xpm({type:e,selectors:[["settings"]],decls:8,vars:4,consts:[["navItems",""],[4,"ngIf","ngIfElse"],["desktopNav",""],[1,"settings-panels-container"],["mat-menu-item","","routerLink","general","routerLinkActive","selected",1,"nav-item"],["trans","",1,"name"],["class","nav-item","mat-menu-item","","routerLinkActive","selected",3,"routerLink",4,"ngFor","ngForOf"],["class","nav-item","mat-menu-item","","routerLink","billing","routerLinkActive","selected",4,"ngIf"],["mat-menu-item","","routerLink","localization","routerLinkActive","selected",1,"nav-item"],["mat-menu-item","","routerLink","authentication","routerLinkActive","selected",1,"nav-item"],["mat-menu-item","","routerLink","uploading","routerLinkActive","selected",1,"nav-item"],["mat-menu-item","","routerLink","mail","routerLinkActive","selected",1,"nav-item"],["mat-menu-item","","routerLink","cache","routerLinkActive","selected",1,"nav-item"],["mat-menu-item","","routerLink","analytics","routerLinkActive","selected",1,"nav-item"],["mat-menu-item","","routerLink","logging","routerLinkActive","selected",1,"nav-item"],["mat-menu-item","","routerLink","queue","routerLinkActive","selected",1,"nav-item"],["mat-menu-item","","routerLink","recaptcha","routerLinkActive","selected",1,"nav-item"],["mat-menu-item","","routerLink","gdpr","routerLinkActive","selected",1,"nav-item"],["mat-menu-item","","routerLink","/admin/appearance","routerLinkActive","selected",1,"nav-item",3,"queryParams"],["mat-menu-item","","routerLinkActive","selected",1,"nav-item",3,"routerLink"],["mat-menu-item","","routerLink","billing","routerLinkActive","selected",1,"nav-item"],[1,"no-style","admin-pill-nav-mobile-selector",3,"matMenuTriggerFor"],["svgIcon","keyboard-arrow-down"],[1,"admin-pill-nav-menu"],["navMenu","matMenu"],[4,"ngTemplateOutlet"],[1,"admin-pill-nav","rounded"]],template:function(e,t){if(1&e&&(o.YNc(0,Li,44,8,"ng-template",null,0,o.W1O),o.YNc(2,Vi,9,5,"ng-container",1),o.ALo(3,"async"),o.YNc(4,zi,2,1,"ng-template",null,2,o.W1O),o.TgZ(6,"div",3),o._UZ(7,"router-outlet"),o.qZA()),2&e){const e=o.MAs(5);o.xp6(2),o.Q6J("ngIf",o.lcZ(3,2,t.breakpoints.isMobile$))("ngIfElse",e)}},directives:[i.O5,l.lC,l.yS,C.OP,l.Od,Zt.P,i.sg,C.p6,O.Hw,C.VK,i.tP],pipes:[i.Ov],styles:["[_nghost-%COMP%]{display:flex}@media only screen and (max-width: 768px){[_nghost-%COMP%]{display:block}}.settings-panels-container[_ngcontent-%COMP%]{flex:1 1 auto}.admin-pill-nav-mobile-selector[_ngcontent-%COMP%]{margin-bottom:20px}"],changeDetection:0}),e})();const ji=function(e,t){return{baseUrl:e,currentUrl:t}};function Gi(e,t){if(1&e&&(o.TgZ(0,"p",30),o.TgZ(1,"span",31),o._uU(2,'Base site url is set as ":baseUrl" in configuration, but current url is ":currentUrl". It\'s recommended to set the primary url you want to use in configuration file and then redirect all other url versions to this primary version via cpanel or .htaccess file.'),o.qZA(),o._uU(3," "),o.TgZ(4,"a",32),o._uU(5,"More Information."),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("transValues",o.WLB(1,ji,e.state.server.app_url,e.state.server.newAppUrl))}}function Xi(e,t){if(1&e&&(o.TgZ(0,"option",33),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("value",e.name),o.xp6(1),o.Oqu(e.name)}}function Wi(e,t){if(1&e&&(o.TgZ(0,"option",33),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("value",e.model_id),o.xp6(1),o.Oqu(e.label)}}function Ki(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",4),o.TgZ(1,"label",34),o._uU(2),o.qZA(),o.TgZ(3,"select",35),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.client["homepage.value"]=t}),o.YNc(4,Wi,2,2,"option",14),o.qZA(),o.qZA()}if(2&e){const e=o.oxw().$implicit,t=o.oxw();o.xp6(1),o.Q6J("for",e.name),o.xp6(1),o.Oqu(e.name),o.xp6(1),o.Q6J("id",e.name)("name",e.name)("ngModel",t.state.client["homepage.value"]),o.xp6(1),o.Q6J("ngForOf",e.items)}}function ea(e,t){if(1&e&&(o.ynx(0),o.YNc(1,Ki,5,6,"div",17),o.BQk()),2&e){const e=t.$implicit,n=o.oxw();o.xp6(1),o.Q6J("ngIf",n.state.client["homepage.type"]===e.name)}}function ta(e,t){if(1&e&&(o.TgZ(0,"option",39),o._uU(1),o.qZA()),2&e){const e=t.$implicit,n=o.oxw(2);o.Q6J("ngValue",e.name),o.xp6(1),o.Oqu(n.getDisplayName(e))}}function na(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",4),o.TgZ(1,"label",36),o._uU(2,"Application Page"),o.qZA(),o.TgZ(3,"select",37),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.client["homepage.value"]=t}),o.YNc(4,ta,2,2,"option",38),o.qZA(),o.qZA()}if(2&e){const e=o.oxw();o.xp6(3),o.Q6J("ngModel",e.state.client["homepage.value"]),o.xp6(1),o.Q6J("ngForOf",e.getHomepageComponents())}}function ia(e,t){1&e&&o._UZ(0,"mat-progress-bar",40)}let aa=(()=>{class e extends vt{constructor(){super(...arguments),this.menuItemCategories$=new pt.X([]),this.cssThemes=[]}ngOnInit(){this.valueLists.get(["menuItemCategories","themes"]).subscribe(e=>{this.menuItemCategories$.next(e.menuItemCategories),this.cssThemes=e.themes})}getHomepageComponents(){return this.customHomepage.getComponents()}getDisplayName(e){var t;return(null===(t=e.routeConfig)||void 0===t?void 0:t.data)&&e.routeConfig.data.name||e.name.replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase())}urlsDontMatch(){return this.state.server.newAppUrl&&this.state.server.newAppUrl!==this.state.server.app_url}createSitemap(){return this.loading$.next(!0),this.http.post("sitemap/generate").pipe((0,gt.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open("Sitemap generated.")})}}return e.\u0275fac=function(){let t;return function(n){return(t||(t=o.n5z(e)))(n||e)}}(),e.\u0275cmp=o.Xpm({type:e,selectors:[["homepage-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:57,vars:25,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["ngNativeValidate","",1,"body","many-inputs",3,"ngSubmit"],[1,"input-container"],["for","app_url","trans",""],["type","text","id","app_url","name","app_url","readonly","readonly","required","",3,"ngModel","ngModelChange"],["class","error",4,"ngIf"],[1,"error-group","many-inputs"],[1,"inline-inputs-container"],["for","homepage.type","trans",""],["name","homepage.type","id","homepage.type",3,"ngModel","ngModelChange"],["value","default"],["value","component"],[3,"value",4,"ngFor","ngForOf"],["trans",""],[4,"ngFor","ngForOf"],["class","input-container",4,"ngIf"],["for","themes.default_mode","trans",""],["id","themes.default_mode","name","themes.default_mode",3,"ngModel","ngModelChange"],["value","light","trans",""],["value","dark","trans",""],[1,"setting-toggle-container"],["name","themes.user_change","id","themes.user_change","trans","",3,"ngModel","ngModelChange"],[1,"settings-separator"],["type","button","mat-flat-button","","color","accent","trans","",3,"disabled","click"],[1,"sitemap-description"],["target","_blank",3,"href"],["mat-raised-button","","color","accent","type","submit","trans","",1,"button","primary","update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],[1,"error"],["trans","",3,"transValues"],["href","https://support.vebto.com/help-center/articles/35/primary-site-url","target","_blank","trans",""],[3,"value"],["trans","",1,"visually-hidden",3,"for"],[3,"id","name","ngModel","ngModelChange"],["for","homepage.value","trans","",1,"visually-hidden"],["name","homepage.value","id","homepage.value",3,"ngModel","ngModelChange"],["trans","",3,"ngValue",4,"ngFor","ngForOf"],["trans","",3,"ngValue"],["mode","indeterminate","color","accent"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"General"),o.qZA(),o.TgZ(3,"div",2),o._uU(4,"Configure general site settings."),o.qZA(),o.qZA(),o.TgZ(5,"form",3),o.NdJ("ngSubmit",function(){return t.saveSettings()}),o.TgZ(6,"div",4),o.TgZ(7,"label",5),o._uU(8,"Site Url"),o.qZA(),o.TgZ(9,"input",6),o.NdJ("ngModelChange",function(e){return t.state.server.app_url=e}),o.qZA(),o.YNc(10,Gi,6,4,"p",7),o.qZA(),o.TgZ(11,"div",8),o.TgZ(12,"div",9),o.TgZ(13,"div",4),o.TgZ(14,"label",10),o._uU(15,"Site Homepage"),o.qZA(),o.TgZ(16,"select",11),o.NdJ("ngModelChange",function(e){return t.state.client["homepage.type"]=e}),o.TgZ(17,"option",12),o._uU(18,"Default"),o.qZA(),o.TgZ(19,"option",13),o._uU(20,"Application Page"),o.qZA(),o.YNc(21,Xi,2,2,"option",14),o.ALo(22,"async"),o.qZA(),o.TgZ(23,"p",15),o._uU(24,"Type of the homepage."),o.qZA(),o.qZA(),o.YNc(25,ea,2,1,"ng-container",16),o.ALo(26,"async"),o.YNc(27,na,5,2,"div",17),o.qZA(),o.qZA(),o.TgZ(28,"div",4),o.TgZ(29,"label",18),o._uU(30,"Default Site Theme"),o.qZA(),o.TgZ(31,"select",19),o.NdJ("ngModelChange",function(e){return t.state.client["themes.default_mode"]=e}),o.TgZ(32,"option",20),o._uU(33,"Light"),o.qZA(),o.TgZ(34,"option",21),o._uU(35,"Dark"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(36,"div",22),o.TgZ(37,"mat-slide-toggle",23),o.NdJ("ngModelChange",function(e){return t.state.client["themes.user_change"]=e}),o._uU(38,"Allow Theme Change"),o.qZA(),o.TgZ(39,"p",15),o._uU(40,"Allow user to switch from dark to light mode and vice versa."),o.qZA(),o.qZA(),o._UZ(41,"div",24),o.TgZ(42,"button",25),o.NdJ("click",function(){return t.createSitemap()}),o.ALo(43,"async"),o._uU(44,"Generate Sitemap"),o.qZA(),o.TgZ(45,"p",26),o.TgZ(46,"span",15),o._uU(47,"Once generated, sitemap index url will be"),o.qZA(),o._uU(48,": "),o.TgZ(49,"a",27),o._uU(50),o.qZA(),o.qZA(),o._UZ(51,"div",24),o.TgZ(52,"button",28),o.ALo(53,"async"),o._uU(54,"Update"),o.qZA(),o.YNc(55,ia,1,0,"mat-progress-bar",29),o.ALo(56,"async"),o.qZA()),2&e&&(o.xp6(6),o.ekj("has-error",t.urlsDontMatch()),o.xp6(3),o.Q6J("ngModel",t.state.server.app_url),o.xp6(1),o.Q6J("ngIf",t.urlsDontMatch()),o.xp6(6),o.Q6J("ngModel",t.state.client["homepage.type"]),o.xp6(5),o.Q6J("ngForOf",o.lcZ(22,15,t.menuItemCategories$)),o.xp6(4),o.Q6J("ngForOf",o.lcZ(26,17,t.menuItemCategories$)),o.xp6(2),o.Q6J("ngIf","component"===t.state.client["homepage.type"]),o.xp6(4),o.Q6J("ngModel",t.state.client["themes.default_mode"]),o.xp6(6),o.Q6J("ngModel",t.state.client["themes.user_change"]),o.xp6(5),o.Q6J("disabled",o.lcZ(43,19,t.loading$)),o.xp6(7),o.Q6J("href",t.settings.getBaseUrl()+"/storage/sitemaps/sitemap-index.xml",o.LSH),o.xp6(1),o.hij("",t.settings.getBaseUrl(),"/storage/sitemaps/sitemap-index.xml"),o.xp6(2),o.Q6J("disabled",o.lcZ(53,21,t.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(56,23,t.loading$)))},directives:[Zt.P,a.JL,a.F,a.Fj,a.Q7,a.JJ,a.On,i.O5,a.EJ,a.YN,a.Kr,i.sg,T.Rr,g.lW,s.pW],pipes:[i.Ov],styles:[".sitemap-description[_ngcontent-%COMP%]{color:var(--be-secondary-text)}"],changeDetection:0}),e})();function sa(e,t){1&e&&(o.ynx(0),o.TgZ(1,"span",7),o._uU(2,"Outgoing mail method needs to be setup before enabling this setting."),o.qZA(),o._uU(3," "),o.TgZ(4,"a",23),o._uU(5,"Fix now."),o.qZA(),o.BQk())}function oa(e,t){if(1&e){const e=o.EpF();o.ynx(0),o.TgZ(1,"div",26),o.TgZ(2,"label",27),o._uU(3,"Envato ID"),o.qZA(),o.TgZ(4,"input",28),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(3).state.server.envato_id=t}),o.qZA(),o.qZA(),o.TgZ(5,"div",26),o.TgZ(6,"label",29),o._uU(7,"Envato Secret"),o.qZA(),o.TgZ(8,"input",30),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(3).state.server.envato_secret=t}),o.qZA(),o.qZA(),o.TgZ(9,"div",26),o.TgZ(10,"label",31),o._uU(11,"Envato Personal Token"),o.qZA(),o.TgZ(12,"input",32),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(3).state.server.envato_personal_token=t}),o.qZA(),o.qZA(),o.BQk()}if(2&e){const e=o.oxw(3);o.xp6(4),o.Q6J("ngModel",e.state.server.envato_id),o.xp6(4),o.Q6J("ngModel",e.state.server.envato_secret),o.xp6(4),o.Q6J("ngModel",e.state.server.envato_personal_token)}}function ra(e,t){if(1&e){const e=o.EpF();o.ynx(0),o.TgZ(1,"div",24),o.TgZ(2,"mat-slide-toggle",25),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.client["social.envato.enable"]=t}),o._uU(3,"Envato Login"),o.qZA(),o.TgZ(4,"p",7),o._uU(5,"Enable logging into the site via envato."),o.qZA(),o.qZA(),o.YNc(6,oa,13,3,"ng-container",8),o.BQk()}if(2&e){const e=o.oxw(2);o.xp6(2),o.Q6J("ngModel",e.state.client["social.envato.enable"]),o.xp6(4),o.Q6J("ngIf",e.state.client["social.envato.enable"])}}function la(e,t){if(1&e){const e=o.EpF();o.ynx(0),o.TgZ(1,"div",26),o.TgZ(2,"label",33),o._uU(3,"Google Client ID"),o.qZA(),o.TgZ(4,"input",34),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.google_id=t}),o.qZA(),o.qZA(),o.TgZ(5,"div",26),o.TgZ(6,"label",35),o._uU(7,"Google Client Secret"),o.qZA(),o.TgZ(8,"input",36),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.google_secret=t}),o.qZA(),o.qZA(),o.BQk()}if(2&e){const e=o.oxw(2);o.xp6(4),o.Q6J("ngModel",e.state.server.google_id),o.xp6(4),o.Q6J("ngModel",e.state.server.google_secret)}}function ca(e,t){if(1&e&&o._UZ(0,"p",37),2&e){const e=o.oxw().ngIf;o.Q6J("innerHTML",e.google_group,o.oJD)}}function da(e,t){if(1&e){const e=o.EpF();o.ynx(0),o.TgZ(1,"div",26),o.TgZ(2,"label",38),o._uU(3,"Facebook App ID"),o.qZA(),o.TgZ(4,"input",39),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.facebook_id=t}),o.qZA(),o.qZA(),o.TgZ(5,"div",26),o.TgZ(6,"label",40),o._uU(7,"Facebook App Secret"),o.qZA(),o.TgZ(8,"input",41),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.facebook_secret=t}),o.qZA(),o.qZA(),o.BQk()}if(2&e){const e=o.oxw(2);o.xp6(4),o.Q6J("ngModel",e.state.server.facebook_id),o.xp6(4),o.Q6J("ngModel",e.state.server.facebook_secret)}}function ua(e,t){if(1&e&&o._UZ(0,"p",37),2&e){const e=o.oxw().ngIf;o.Q6J("innerHTML",e.facebook_group,o.oJD)}}function ga(e,t){if(1&e){const e=o.EpF();o.ynx(0),o.TgZ(1,"div",26),o.TgZ(2,"label",42),o._uU(3,"Twitter ID"),o.qZA(),o.TgZ(4,"input",43),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.twitter_id=t}),o.qZA(),o.qZA(),o.TgZ(5,"div",26),o.TgZ(6,"label",44),o._uU(7,"Twitter Secret"),o.qZA(),o.TgZ(8,"input",45),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.twitter_secret=t}),o.qZA(),o.qZA(),o.BQk()}if(2&e){const e=o.oxw(2);o.xp6(4),o.Q6J("ngModel",e.state.server.twitter_id),o.xp6(4),o.Q6J("ngModel",e.state.server.twitter_secret)}}function pa(e,t){if(1&e&&o._UZ(0,"p",37),2&e){const e=o.oxw().ngIf;o.Q6J("innerHTML",e.twitter_group,o.oJD)}}function ha(e,t){1&e&&o._UZ(0,"mat-progress-bar",46)}function ma(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"form",4),o.NdJ("ngSubmit",function(){return o.CHM(e),o.oxw().saveSettings()}),o.TgZ(1,"div",5),o.TgZ(2,"mat-slide-toggle",6),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.client.require_email_confirmation=t}),o._uU(3,"Require Email Confirmation"),o.qZA(),o.TgZ(4,"p"),o.TgZ(5,"span",7),o._uU(6,"Require new users to validate their email address before being able to login."),o.qZA(),o._UZ(7,"br"),o.YNc(8,sa,6,0,"ng-container",8),o.qZA(),o.qZA(),o.TgZ(9,"div",5),o.TgZ(10,"mat-slide-toggle",9),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.client["registration.disable"]=t}),o._uU(11,"Disable Registration"),o.qZA(),o.TgZ(12,"p",7),o._uU(13,"All registration (including social login) will be disabled."),o.qZA(),o.qZA(),o.TgZ(14,"div",5),o.TgZ(15,"mat-slide-toggle",10),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.client.single_device_login=t}),o._uU(16,"Single Device Login"),o.qZA(),o.TgZ(17,"p",7),o._uU(18,"Only allow one device to be logged into user account at the same time."),o.qZA(),o.qZA(),o.YNc(19,ra,7,2,"ng-container",8),o.TgZ(20,"div",11),o.TgZ(21,"div",12),o.TgZ(22,"mat-slide-toggle",13),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.client["social.google.enable"]=t}),o._uU(23,"Google Login"),o.qZA(),o.TgZ(24,"p",7),o._uU(25,"Enable logging into the site via google."),o.qZA(),o.qZA(),o.YNc(26,la,9,2,"ng-container",8),o.YNc(27,ca,1,1,"p",14),o.qZA(),o.TgZ(28,"div",15),o.TgZ(29,"div",16),o.TgZ(30,"mat-slide-toggle",17),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.client["social.facebook.enable"]=t}),o._uU(31,"Facebook Login"),o.qZA(),o.TgZ(32,"p",7),o._uU(33,"Enable logging into the site via facebook."),o.qZA(),o.qZA(),o.YNc(34,da,9,2,"ng-container",8),o.YNc(35,ua,1,1,"p",14),o.qZA(),o.TgZ(36,"div",18),o.TgZ(37,"div",19),o.TgZ(38,"mat-slide-toggle",20),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.client["social.twitter.enable"]=t}),o._uU(39,"Twitter Login"),o.qZA(),o.TgZ(40,"p",7),o._uU(41,"Enable logging into the site via twitter."),o.qZA(),o.qZA(),o.YNc(42,ga,9,2,"ng-container",8),o.YNc(43,pa,1,1,"p",14),o.qZA(),o.TgZ(44,"button",21),o.ALo(45,"async"),o._uU(46,"Update"),o.qZA(),o.YNc(47,ha,1,0,"mat-progress-bar",22),o.ALo(48,"async"),o.qZA()}if(2&e){const e=t.ngIf,n=o.oxw();o.xp6(2),o.Q6J("disabled",!n.state.client.require_email_confirmation&&!n.state.server.mail_setup)("ngModel",n.state.client.require_email_confirmation),o.xp6(6),o.Q6J("ngIf",!n.state.server.mail_setup),o.xp6(2),o.Q6J("ngModel",n.state.client["registration.disable"]),o.xp6(5),o.Q6J("ngModel",n.state.client.single_device_login),o.xp6(4),o.Q6J("ngIf",n.settings.get("envato.enable")),o.xp6(1),o.ekj("has-error",e.google_group),o.xp6(2),o.Q6J("ngModel",n.state.client["social.google.enable"]),o.xp6(4),o.Q6J("ngIf",n.state.client["social.google.enable"]),o.xp6(1),o.Q6J("ngIf",e.google_group),o.xp6(1),o.ekj("has-error",e.facebook_group),o.xp6(2),o.Q6J("ngModel",n.state.client["social.facebook.enable"]),o.xp6(4),o.Q6J("ngIf",n.state.client["social.facebook.enable"]),o.xp6(1),o.Q6J("ngIf",e.facebook_group),o.xp6(1),o.ekj("has-error",e.twitter_group),o.xp6(2),o.Q6J("ngModel",n.state.client["social.twitter.enable"]),o.xp6(4),o.Q6J("ngIf",n.state.client["social.twitter.enable"]),o.xp6(1),o.Q6J("ngIf",e.twitter_group),o.xp6(1),o.Q6J("disabled",o.lcZ(45,23,n.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(48,25,n.loading$))}}let fa=(()=>{class e extends vt{}return e.\u0275fac=function(){let t;return function(n){return(t||(t=o.n5z(e)))(n||e)}}(),e.\u0275cmp=o.Xpm({type:e,selectors:[["authentication-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:7,vars:3,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["class","body many-inputs social-login-container","ngNativeValidate","",3,"ngSubmit",4,"ngIf"],["ngNativeValidate","",1,"body","many-inputs","social-login-container",3,"ngSubmit"],[1,"setting-toggle-container"],["name","require_email_confirmation","id","require_email_confirmation","trans","",3,"disabled","ngModel","ngModelChange"],["trans",""],[4,"ngIf"],["name","registration.disable","id","registration.disable","trans","",3,"ngModel","ngModelChange"],["name","single_device_login","id","single_device_login","trans","",3,"ngModel","ngModelChange"],["id","google_group",1,"error-group","many-inputs","no-bottom-border"],[1,"setting-toggle-container","google"],["name","social.google.enable","id","social.google.enable","trans","",3,"ngModel","ngModelChange"],["class","error",3,"innerHTML",4,"ngIf"],[1,"error-group","many-inputs","no-bottom-border"],[1,"setting-toggle-container","facebook"],["name","social.facebook.enable","id","social.facebook.enable","trans","",3,"ngModel","ngModelChange"],[1,"error-group","many-inputs"],[1,"setting-toggle-container","twitter"],["name","social.twitter.enable","id","social.twitter.enable","trans","",3,"ngModel","ngModelChange"],["mat-raised-button","","color","accent","type","submit","trans","",1,"button","primary","update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],["routerLink","/admin/settings/mail","trans",""],[1,"setting-toggle-container","envato"],["name","social.envato.enable","id","social.envato.enable","trans","",3,"ngModel","ngModelChange"],[1,"input-container"],["for","social.envato.id","trans",""],["name","social.envato.id","id","social.envato.id",3,"ngModel","ngModelChange"],["for","social.envato.secret","trans",""],["name","social.envato.secret","id","social.envato.secret",3,"ngModel","ngModelChange"],["for","social.envato.personal_token","trans",""],["name","social.envato.personal_token","id","social.envato.personal_token",3,"ngModel","ngModelChange"],["for","social.google.id","trans",""],["name","social.google.id","id","social.google.id",3,"ngModel","ngModelChange"],["for","social.google.secret","trans",""],["name","social.google.secret","id","social.google.secret",3,"ngModel","ngModelChange"],[1,"error",3,"innerHTML"],["for","social.facebook.id","trans",""],["name","social.facebook.id","id","social.facebook.id",3,"ngModel","ngModelChange"],["for","social.facebook.secret","trans",""],["name","social.facebook.secret","id","social.facebook.secret",3,"ngModel","ngModelChange"],["for","social.twitter.id","trans",""],["name","social.twitter.id","id","social.twitter.id",3,"ngModel","ngModelChange"],["for","social.twitter.secret","trans",""],["name","social.twitter.secret","id","social.twitter.secret",3,"ngModel","ngModelChange"],["mode","indeterminate","color","accent"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"Authentication"),o.qZA(),o.TgZ(3,"div",2),o._uU(4,"Configure registration, social login and related 3rd party integrations."),o.qZA(),o.qZA(),o.YNc(5,ma,49,27,"form",3),o.ALo(6,"async")),2&e&&(o.xp6(5),o.Q6J("ngIf",o.lcZ(6,1,t.errors$)))},directives:[Zt.P,i.O5,a.JL,a.F,T.Rr,a.JJ,a.On,g.lW,l.yS,a.Fj,s.pW],pipes:[i.Ov],styles:["authentication-settings .twitter .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-bar{background:#4db5f5}authentication-settings .twitter .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-thumb{background:#1da1f2}authentication-settings .facebook .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-bar{background:#4c70ba}authentication-settings .facebook .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-thumb,authentication-settings .facebook .pretty-checkbox:checked+label:before{background:#3b5998}authentication-settings .google .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-bar{background:#dc6e60}authentication-settings .google .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-thumb{background:#d34836}authentication-settings .envato .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-bar{background:#9bc762}authentication-settings .envato .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-thumb{background:#82b541}"],encapsulation:2,changeDetection:0}),e})();function _a(e,t){if(1&e){const e=o.EpF();o.ynx(0),o.TgZ(1,"div",6),o.TgZ(2,"label",21),o._uU(3,"Memcached Host"),o.qZA(),o.TgZ(4,"input",22),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.memcached_host=t}),o.qZA(),o.qZA(),o.TgZ(5,"div",6),o.TgZ(6,"label",23),o._uU(7,"Memcached Port"),o.qZA(),o.TgZ(8,"input",24),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.memcached_port=t}),o.qZA(),o.qZA(),o.BQk()}if(2&e){const e=o.oxw(2);o.xp6(4),o.Q6J("ngModel",e.state.server.memcached_host),o.xp6(4),o.Q6J("ngModel",e.state.server.memcached_port)}}function ba(e,t){if(1&e&&o._UZ(0,"p",25),2&e){const e=o.oxw().ngIf;o.Q6J("innerHTML",e.cache_group,o.oJD)}}function va(e,t){1&e&&o._UZ(0,"mat-progress-bar",26)}function Za(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"form",4),o.NdJ("submit",function(){return o.CHM(e),o.oxw().saveSettings()}),o.TgZ(1,"div",5),o.TgZ(2,"div",6),o.TgZ(3,"label",7),o._uU(4,"Cache Method"),o.qZA(),o.TgZ(5,"select",8),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.server.cache_driver=t})("ngModelChange",function(){return o.CHM(e),o.oxw().clearErrors()}),o.TgZ(6,"option",9),o._uU(7,"File (Default)"),o.qZA(),o.TgZ(8,"option",10),o._uU(9,"None"),o.qZA(),o.TgZ(10,"option",11),o._uU(11,"APC"),o.qZA(),o.TgZ(12,"option",12),o._uU(13,"Memcached"),o.qZA(),o.TgZ(14,"option",13),o._uU(15,"Redis"),o.qZA(),o.qZA(),o.TgZ(16,"p",14),o._uU(17,"Which method should be used for storing and retrieving cached items."),o.qZA(),o.qZA(),o.YNc(18,_a,9,2,"ng-container",15),o.YNc(19,ba,1,1,"p",16),o.qZA(),o.TgZ(20,"button",17),o.NdJ("click",function(){return o.CHM(e),o.oxw().clearCache()}),o._uU(21,"Clear Cache"),o.qZA(),o.TgZ(22,"div",18),o.TgZ(23,"div",1),o._uU(24,"Important!"),o.qZA(),o.TgZ(25,"p",14),o._uU(26,'"File" is the best option for most cases and should not be changed, unless you are familiar with another cache method and have it set up on the server already.'),o.qZA(),o.qZA(),o.TgZ(27,"button",19),o.ALo(28,"async"),o._uU(29,"Update"),o.qZA(),o.YNc(30,va,1,0,"mat-progress-bar",20),o.ALo(31,"async"),o.qZA()}if(2&e){const e=t.ngIf,n=o.oxw();o.xp6(1),o.ekj("has-error",e.cache_group),o.xp6(4),o.Q6J("ngModel",n.state.server.cache_driver),o.xp6(13),o.Q6J("ngIf","memcached"===n.state.server.cache_driver),o.xp6(1),o.Q6J("ngIf",e.cache_group),o.xp6(8),o.Q6J("disabled",o.lcZ(28,7,n.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(31,9,n.loading$))}}let xa=(()=>{class e extends vt{clearCache(){this.loading$.next(!0),this.http.post("cache/flush").pipe((0,gt.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open("Cache cleared.")})}}return e.\u0275fac=function(){let t;return function(n){return(t||(t=o.n5z(e)))(n||e)}}(),e.\u0275cmp=o.Xpm({type:e,selectors:[["cache-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:7,vars:3,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["class","body many-inputs","ngNativeValidate","",3,"submit",4,"ngIf"],["ngNativeValidate","",1,"body","many-inputs",3,"submit"],["id","cache_group",1,"error-group","many-inputs","no-border-top"],[1,"input-container"],["for","cache.driver","trans",""],["name","cache.driver","id","cache.driver",3,"ngModel","ngModelChange"],["value","file"],["value","array"],["value","apc"],["value","memcached"],["value","redis"],["trans",""],[4,"ngIf"],["class","error",3,"innerHTML",4,"ngIf"],["mat-stroked-button","","color","accent","type","button","trans","",1,"button","flat",3,"click"],[1,"widget","widget-info","widget-important"],["mat-raised-button","","color","accent","type","submit","trans","",1,"button","primary","update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],["for","cache.memcached_host","trans",""],["name","cache.memcached_host","id","cache.memcached_host","required","",3,"ngModel","ngModelChange"],["for","cache.memcached_port","trans",""],["type","number","name","cache.memcached_port","id","cache.memcached_port","required","",3,"ngModel","ngModelChange"],[1,"error",3,"innerHTML"],["mode","indeterminate","color","accent"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"Cache"),o.qZA(),o.TgZ(3,"div",2),o._uU(4,"Configure cache time, method and related 3rd party integrations."),o.qZA(),o.qZA(),o.YNc(5,Za,32,11,"form",3),o.ALo(6,"async")),2&e&&(o.xp6(5),o.Q6J("ngIf",o.lcZ(6,1,t.errors$)))},directives:[Zt.P,i.O5,a.JL,a.F,a.EJ,a.JJ,a.On,a.YN,a.Kr,g.lW,a.Fj,a.Q7,a.wV,s.pW],pipes:[i.Ov],encapsulation:2,changeDetection:0}),e})();function Aa(e,t){if(1&e&&(o.TgZ(0,"p",19),o._uU(1),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(1),o.Oqu(e.certificate)}}function ya(e,t){if(1&e&&o._UZ(0,"p",20),2&e){const e=o.oxw().ngIf;o.Q6J("innerHTML",e.analytics_group,o.oJD)}}function wa(e,t){1&e&&o._UZ(0,"mat-progress-bar",21)}function Ca(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"form",4),o.NdJ("submit",function(){return o.CHM(e),o.oxw().saveSettings()}),o.TgZ(1,"div",5),o.TgZ(2,"div",6),o.TgZ(3,"label",7),o._uU(4,"Google Service Account Key File (.json)"),o.qZA(),o.TgZ(5,"input",8,9),o.NdJ("change",function(){o.CHM(e);const t=o.MAs(6);return o.oxw().setCertificateFile(t.files)}),o.qZA(),o.YNc(7,Aa,2,1,"p",10),o.qZA(),o.TgZ(8,"div",6),o.TgZ(9,"label",11),o._uU(10,"Google Analytics View ID"),o.qZA(),o.TgZ(11,"input",12),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.server.analytics_view_id=t}),o.qZA(),o.qZA(),o.TgZ(12,"div",6),o.TgZ(13,"label",13),o._uU(14,"Google Analytics Tracking Code"),o.qZA(),o.TgZ(15,"input",14),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.client["analytics.tracking_code"]=t}),o.qZA(),o.TgZ(16,"p",15),o._uU(17,"Google analytics tracking code only, not the whole javascript code snippet."),o.qZA(),o.qZA(),o.YNc(18,ya,1,1,"p",16),o.qZA(),o.TgZ(19,"button",17),o.ALo(20,"async"),o._uU(21,"Update"),o.qZA(),o.YNc(22,wa,1,0,"mat-progress-bar",18),o.ALo(23,"async"),o.qZA()}if(2&e){const e=t.ngIf,n=o.oxw();o.xp6(1),o.ekj("has-error",e.analytics_group),o.xp6(1),o.ekj("has-error",e.certificate),o.xp6(5),o.Q6J("ngIf",e.certificate),o.xp6(4),o.Q6J("ngModel",n.state.server.analytics_view_id),o.xp6(4),o.Q6J("ngModel",n.state.client["analytics.tracking_code"]),o.xp6(3),o.Q6J("ngIf",e.analytics_group),o.xp6(1),o.Q6J("disabled",o.lcZ(20,10,n.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(23,12,n.loading$))}}let Ta=(()=>{class e extends vt{saveSettings(e){const t=this.getPayload(e||this.state.getModified());super.saveSettings(t)}getPayload(e){return this.certificateFile&&(e.files={certificate:this.certificateFile}),e}setCertificateFile(e){this.certificateFile=e.item(0)}}return e.\u0275fac=function(){let t;return function(n){return(t||(t=o.n5z(e)))(n||e)}}(),e.\u0275cmp=o.Xpm({type:e,selectors:[["analytics-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:7,vars:3,consts:[[1,"header"],[1,"title"],["trans","",1,"subtitle"],["class","body many-inputs","ngNativeValidate","",3,"submit",4,"ngIf"],["ngNativeValidate","",1,"body","many-inputs",3,"submit"],["id","analytics_group",1,"error-group","many-inputs","no-spacing"],[1,"input-container"],["for","certificate","trans",""],["type","file","id","certificate","name","certificate","accept",".json",3,"change"],["fileInput",""],["class","error",4,"ngIf"],["for","analytics.view_id","trans",""],["type","number","name","analytics.view_id","id","analytics.view_id",3,"ngModel","ngModelChange"],["for","analytics.tracking_code","trans",""],["name","analytics.tracking_code","id","analytics.tracking_code","min","1","max","20","placeholder","UA-******-2",3,"ngModel","ngModelChange"],["trans",""],["class","error",3,"innerHTML",4,"ngIf"],["mat-raised-button","","color","accent","type","submit","trans","",1,"button","primary","update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],[1,"error"],[1,"error",3,"innerHTML"],["mode","indeterminate","color","accent"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"Analytics"),o.qZA(),o.TgZ(3,"div",2),o._uU(4,"Configure google analytics integration and credentials."),o.qZA(),o.qZA(),o.YNc(5,Ca,24,14,"form",3),o.ALo(6,"async")),2&e&&(o.xp6(5),o.Q6J("ngIf",o.lcZ(6,1,t.errors$)))},directives:[Zt.P,i.O5,a.JL,a.F,a.wV,a.Fj,a.JJ,a.On,g.lW,s.pW],pipes:[i.Ov],encapsulation:2,changeDetection:0}),e})();function qa(e,t){if(1&e&&(o.TgZ(0,"option",22),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("value",e.value),o.xp6(1),o.Oqu(e.text)}}function ka(e,t){if(1&e&&(o.TgZ(0,"optgroup",21),o.YNc(1,qa,2,2,"option",11),o.qZA()),2&e){const e=t.$implicit;o.Q6J("label",e.key),o.xp6(1),o.Q6J("ngForOf",e.value)}}function Ma(e,t){if(1&e&&(o.TgZ(0,"option",22),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("value",e.language),o.xp6(1),o.Oqu(e.name)}}function Ia(e,t){if(1&e&&(o.TgZ(0,"option",22),o._uU(1),o.ALo(2,"formattedDate"),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.Q6J("value",e),o.xp6(1),o.AsE("",o.xi3(2,3,n.getCurrentDate(),e)," (",e,")")}}function Ua(e,t){1&e&&o._UZ(0,"mat-progress-bar",23)}let Ja=(()=>{class e extends vt{constructor(){super(...arguments),this.selects={timezones:{},localizations:[]},this.defaultDateFormats=["MMMM d, y","yyyy-MM-dd","M/d/y","d/M/y"]}ngOnInit(){const e=this.state.client["dates.format"];this.initialDateFormat=this.defaultDateFormats.includes(e)?e:"custom",this.valueLists.get(["timezones","localizations"]).subscribe(e=>{this.selects=e,this.cd.markForCheck()})}getCurrentDate(){return new Date}updateDateFormat(e){e&&"custom"!==e&&(this.state.client["dates.format"]=e)}selectedDateFormat(){return this.state.client["dates.format"]}}return e.\u0275fac=function(){let t;return function(n){return(t||(t=o.n5z(e)))(n||e)}}(),e.\u0275cmp=o.Xpm({type:e,selectors:[["localization-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:51,vars:28,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],[1,"body","many-inputs",3,"submit"],[1,"input-container"],["for","app.timezone","trans",""],["name","app.timezone","id","app.timezone",3,"ngModel","ngModelChange"],[3,"label",4,"ngFor","ngForOf"],["trans",""],["for","app.locale","trans",""],["name","app.locale","id","app.locale",3,"ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],["for","dates.format","trans",""],["name","dates.format","id","dates.format","required","",1,"no-capitalize",3,"ngModel","ngModelChange"],["value","custom","trans",""],["for","dates.custom-format","trans",""],["type","text","id","dates.custom-format","name","dates.custom-format","required","",3,"ngModel","ngModelChange"],[1,"setting-toggle-container"],["name","translations","trans","",3,"ngModel","ngModelChange"],["mat-raised-button","","color","accent","type","submit","trans","",1,"button","primary","update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],[3,"label"],[3,"value"],["mode","indeterminate","color","accent"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"Localization"),o.qZA(),o.TgZ(3,"div",2),o._uU(4,"Manage localization settings for the site."),o.qZA(),o.qZA(),o.TgZ(5,"form",3),o.NdJ("submit",function(){return t.saveSettings()}),o.TgZ(6,"div",4),o.TgZ(7,"label",5),o._uU(8,"Timezone"),o.qZA(),o.TgZ(9,"select",6),o.NdJ("ngModelChange",function(e){return t.state.server.app_timezone=e}),o.YNc(10,ka,2,2,"optgroup",7),o.ALo(11,"keyvalue"),o.qZA(),o.TgZ(12,"p",8),o._uU(13,"Choose either a city in the same timezone as you or a UTC timezone offset."),o.qZA(),o.qZA(),o.TgZ(14,"div",4),o.TgZ(15,"label",9),o._uU(16,"Site Language"),o.qZA(),o.TgZ(17,"select",10),o.NdJ("ngModelChange",function(e){return t.state.server.app_locale=e}),o.YNc(18,Ma,2,2,"option",11),o.qZA(),o.TgZ(19,"p",8),o._uU(20,"Which translation should be selected by default for new users."),o.qZA(),o.qZA(),o.TgZ(21,"div",4),o.TgZ(22,"label",12),o._uU(23,"Date Format"),o.qZA(),o.TgZ(24,"select",13),o.NdJ("ngModelChange",function(e){return t.initialDateFormat=e})("ngModelChange",function(e){return t.updateDateFormat(e)}),o.YNc(25,Ia,3,6,"option",11),o.TgZ(26,"option",14),o._uU(27,"Custom"),o.qZA(),o.qZA(),o.TgZ(28,"p"),o._uU(29),o.ALo(30,"trans"),o._UZ(31,"br"),o._uU(32),o.ALo(33,"trans"),o.TgZ(34,"strong"),o._uU(35),o.ALo(36,"formattedDate"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(37,"div",4),o.TgZ(38,"label",15),o._uU(39,"Custom Date Format"),o.qZA(),o.TgZ(40,"input",16),o.NdJ("ngModelChange",function(e){return t.state.client["dates.format"]=e}),o.qZA(),o.qZA(),o.TgZ(41,"div",17),o.TgZ(42,"mat-slide-toggle",18),o.NdJ("ngModelChange",function(e){return t.state.client["i18n.enable"]=e}),o._uU(43,"Translations"),o.qZA(),o.TgZ(44,"p",8),o._uU(45,"Enable translations functionality for the site."),o.qZA(),o.qZA(),o.TgZ(46,"button",19),o.ALo(47,"async"),o._uU(48,"Update"),o.qZA(),o.YNc(49,Ua,1,0,"mat-progress-bar",20),o.ALo(50,"async"),o.qZA()),2&e&&(o.xp6(9),o.Q6J("ngModel",t.state.server.app_timezone),o.xp6(1),o.Q6J("ngForOf",o.lcZ(11,15,t.selects.timezones)),o.xp6(7),o.Q6J("ngModel",t.state.server.app_locale),o.xp6(1),o.Q6J("ngForOf",t.selects.localizations),o.xp6(6),o.Q6J("ngModel",t.initialDateFormat),o.xp6(1),o.Q6J("ngForOf",t.defaultDateFormats),o.xp6(4),o.hij(" ",o.lcZ(30,17,"Default format for dates on the site.")," "),o.xp6(3),o.hij(" ",o.lcZ(33,19,"Preview:")," "),o.xp6(3),o.Oqu(o.xi3(36,21,t.getCurrentDate(),t.selectedDateFormat())),o.xp6(2),o.ekj("hidden","custom"!==t.initialDateFormat),o.xp6(3),o.Q6J("ngModel",t.state.client["dates.format"]),o.xp6(2),o.Q6J("ngModel",t.state.client["i18n.enable"]),o.xp6(4),o.Q6J("disabled",o.lcZ(47,24,t.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(50,26,t.loading$)))},directives:[Zt.P,a._Y,a.JL,a.F,a.EJ,a.JJ,a.On,i.sg,a.Q7,a.YN,a.Kr,a.Fj,T.Rr,g.lW,i.O5,s.pW],pipes:[i.Nd,lt.R,si.l,i.Ov],encapsulation:2,changeDetection:0}),e})();function Da(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",5),o.TgZ(1,"label",34),o._uU(2,"API Secret Key"),o.qZA(),o.TgZ(3,"input",35),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(3).state.client["mail.webhook_secret_key"]=t}),o.qZA(),o.qZA()}if(2&e){const e=o.oxw(3);o.xp6(3),o.Q6J("ngModel",e.state.client["mail.webhook_secret_key"])}}function Oa(e,t){if(1&e){const e=o.EpF();o.ynx(0),o.TgZ(1,"div",5),o.TgZ(2,"label",29),o._uU(3,"Incoming Mail Method"),o.qZA(),o.TgZ(4,"select",30),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.client["mail.handler"]=t}),o.TgZ(5,"option",31),o._uU(6,"Mailgun"),o.qZA(),o.TgZ(7,"option",32),o._uU(8,"API (Send emails via http API)"),o.qZA(),o.TgZ(9,"option",33),o._uU(10,"Pipe (Pipe emails directly)"),o.qZA(),o.qZA(),o.TgZ(11,"p",8),o._uU(12,"Which method should be used to handle incoming application emails."),o.qZA(),o.qZA(),o.YNc(13,Da,4,1,"div",25),o.BQk()}if(2&e){const e=o.oxw(2);o.xp6(4),o.Q6J("ngModel",e.state.client["mail.handler"]),o.xp6(9),o.Q6J("ngIf","null"===e.state.client["mail.handler"])}}function Pa(e,t){if(1&e){const e=o.EpF();o.ynx(0),o.TgZ(1,"div",5),o.TgZ(2,"label",36),o._uU(3,"SMTP Host"),o.qZA(),o.TgZ(4,"input",37),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.mail_host=t}),o.qZA(),o.qZA(),o.TgZ(5,"div",5),o.TgZ(6,"label",38),o._uU(7,"SMTP Username"),o.qZA(),o.TgZ(8,"input",39),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.mail_username=t}),o.qZA(),o.qZA(),o.TgZ(9,"div",5),o.TgZ(10,"label",40),o._uU(11,"SMTP Password"),o.qZA(),o.TgZ(12,"input",41),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.mail_password=t}),o.qZA(),o.qZA(),o.TgZ(13,"div",5),o.TgZ(14,"label",42),o._uU(15,"SMTP Port"),o.qZA(),o.TgZ(16,"input",43),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.mail_port=t}),o.qZA(),o.qZA(),o.TgZ(17,"div",5),o.TgZ(18,"label",44),o._uU(19,"SMTP Encryption"),o.qZA(),o.TgZ(20,"input",45),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.mail_encryption=t}),o.qZA(),o.qZA(),o.BQk()}if(2&e){const e=o.oxw(2);o.xp6(4),o.Q6J("ngModel",e.state.server.mail_host),o.xp6(4),o.Q6J("ngModel",e.state.server.mail_username),o.xp6(4),o.Q6J("ngModel",e.state.server.mail_password),o.xp6(4),o.Q6J("ngModel",e.state.server.mail_port),o.xp6(4),o.Q6J("ngModel",e.state.server.mail_encryption)}}function Sa(e,t){if(1&e&&(o.TgZ(0,"div",51),o._uU(1),o.qZA()),2&e){const e=o.oxw(2).ngIf;o.xp6(1),o.Oqu(e.mailgun_domain)}}function Na(e,t){if(1&e&&(o.TgZ(0,"div",51),o._uU(1),o.qZA()),2&e){const e=o.oxw(2).ngIf;o.xp6(1),o.Oqu(e.mailgun_secret)}}function Qa(e,t){if(1&e){const e=o.EpF();o.ynx(0),o.TgZ(1,"div",5),o.TgZ(2,"label",46),o._uU(3,"Mailgun Domain"),o.qZA(),o.TgZ(4,"input",47),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.mailgun_domain=t}),o.qZA(),o.YNc(5,Sa,2,1,"div",48),o.TgZ(6,"p",8),o._uU(7,"Usually the domain of your site (site.com)"),o.qZA(),o.qZA(),o.TgZ(8,"div",5),o.TgZ(9,"label",49),o._uU(10,"Mailgun API Key"),o.qZA(),o.TgZ(11,"input",50),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.mailgun_secret=t}),o.qZA(),o.YNc(12,Na,2,1,"div",48),o.TgZ(13,"p",8),o._uU(14,'Should start with "key-"'),o.qZA(),o.qZA(),o.BQk()}if(2&e){const e=o.oxw().ngIf,t=o.oxw();o.xp6(1),o.ekj("has-error",e.mailgun_domain),o.xp6(3),o.Q6J("ngModel",t.state.server.mailgun_domain),o.xp6(1),o.Q6J("ngIf",e.mailgun_domain),o.xp6(3),o.ekj("has-error",e.mailgun_secret),o.xp6(3),o.Q6J("ngModel",t.state.server.mailgun_secret),o.xp6(1),o.Q6J("ngIf",e.mailgun_secret)}}function Ya(e,t){if(1&e){const e=o.EpF();o.ynx(0),o.TgZ(1,"div",5),o.TgZ(2,"label",52),o._uU(3,"SES Key"),o.qZA(),o.TgZ(4,"input",53),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.ses_key=t}),o.qZA(),o.qZA(),o.TgZ(5,"div",5),o.TgZ(6,"label",54),o._uU(7,"SES Secret"),o.qZA(),o.TgZ(8,"input",55),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.ses_secret=t}),o.qZA(),o.qZA(),o.TgZ(9,"div",5),o.TgZ(10,"label",56),o._uU(11,"SES Region"),o.qZA(),o.TgZ(12,"input",57),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.ses_region=t}),o.qZA(),o.qZA(),o.BQk()}if(2&e){const e=o.oxw(2);o.xp6(4),o.Q6J("ngModel",e.state.server.ses_key),o.xp6(4),o.Q6J("ngModel",e.state.server.ses_secret),o.xp6(4),o.Q6J("ngModel",e.state.server.ses_region)}}function Fa(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",5),o.TgZ(1,"label",58),o._uU(2,"Sparkpost Secret"),o.qZA(),o.TgZ(3,"input",59),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.sparkpost_secret=t}),o.qZA(),o.qZA()}if(2&e){const e=o.oxw(2);o.xp6(3),o.Q6J("ngModel",e.state.server.sparkpost_secret)}}function Ra(e,t){if(1&e&&o._UZ(0,"p",60),2&e){const e=o.oxw().ngIf;o.Q6J("innerHTML",e.mail_group,o.oJD)}}function Ea(e,t){1&e&&o._UZ(0,"mat-progress-bar",61)}const La=function(e){return{url:e}};function $a(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"form",4),o.NdJ("submit",function(){return o.CHM(e),o.oxw().saveSettings()}),o.TgZ(1,"div",5),o.TgZ(2,"label",6),o._uU(3,"From Address"),o.qZA(),o.TgZ(4,"input",7),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.server.mail_from_address=t}),o.qZA(),o.TgZ(5,"p",8),o._uU(6,"All outgoing application emails will be sent from this email address."),o.qZA(),o.qZA(),o.TgZ(7,"div",5),o.TgZ(8,"label",9),o._uU(9,"Contact Page Address"),o.qZA(),o.TgZ(10,"input",10),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.client["mail.contact_page_address"]=t}),o.qZA(),o.TgZ(11,"p",11),o._uU(12,"Where emails from :url page should be sent to."),o.qZA(),o.qZA(),o.TgZ(13,"div",5),o.TgZ(14,"label",12),o._uU(15,"From Name"),o.qZA(),o.TgZ(16,"input",13),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.server.mail_from_name=t}),o.qZA(),o.TgZ(17,"p",8),o._uU(18,"All outgoing application emails will be sent using this name."),o.qZA(),o.qZA(),o.TgZ(19,"div",14),o.TgZ(20,"div",1),o._uU(21,"Important!"),o.qZA(),o.TgZ(22,"p",8),o._uU(23,"Your selected mail method must be authorized to send emails using this address and name."),o.qZA(),o.qZA(),o.YNc(24,Oa,14,2,"ng-container",15),o.TgZ(25,"div",16),o.TgZ(26,"div",5),o.TgZ(27,"label",17),o._uU(28,"Outgoing Mail Method"),o.qZA(),o.TgZ(29,"select",18),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.server.mail_driver=t})("ngModelChange",function(){return o.CHM(e),o.oxw().clearErrors()}),o.TgZ(30,"option",19),o._uU(31,"Mailgun"),o.qZA(),o.TgZ(32,"option",20),o._uU(33,"SMTP"),o.qZA(),o.TgZ(34,"option",21),o._uU(35,"SparkPost"),o.qZA(),o.TgZ(36,"option",22),o._uU(37,"Ses (Amazon Simple Email Service)"),o.qZA(),o.TgZ(38,"option",23),o._uU(39,"SendMail"),o.qZA(),o.TgZ(40,"option",24),o._uU(41,"Log (Email will be saved to error log)"),o.qZA(),o.qZA(),o.TgZ(42,"p",8),o._uU(43,"Which method should be used for sending outgoing application emails."),o.qZA(),o.qZA(),o.YNc(44,Pa,21,5,"ng-container",15),o.YNc(45,Qa,15,8,"ng-container",15),o.YNc(46,Ya,13,3,"ng-container",15),o.YNc(47,Fa,4,1,"div",25),o.YNc(48,Ra,1,1,"p",26),o.qZA(),o.TgZ(49,"button",27),o.ALo(50,"async"),o._uU(51,"Update"),o.qZA(),o.YNc(52,Ea,1,0,"mat-progress-bar",28),o.ALo(53,"async"),o.qZA()}if(2&e){const e=t.ngIf,n=o.oxw();o.xp6(4),o.Q6J("ngModel",n.state.server.mail_from_address),o.xp6(6),o.Q6J("ngModel",n.state.client["mail.contact_page_address"]),o.xp6(1),o.Q6J("transValues",o.VKq(19,La,n.settings.getBaseUrl()+"/contact")),o.xp6(5),o.Q6J("ngModel",n.state.server.mail_from_name),o.xp6(8),o.Q6J("ngIf",n.settings.get("vebto.admin.showIncomingMailMethod")),o.xp6(1),o.ekj("has-error",e.mail_group),o.xp6(4),o.Q6J("ngModel",n.state.server.mail_driver),o.xp6(15),o.Q6J("ngIf","smtp"===n.state.server.mail_driver),o.xp6(1),o.Q6J("ngIf","mailgun"===n.state.server.mail_driver),o.xp6(1),o.Q6J("ngIf","ses"===n.state.server.mail_driver),o.xp6(1),o.Q6J("ngIf","sparkpost"===n.state.server.mail_driver),o.xp6(1),o.Q6J("ngIf",e.mail_group),o.xp6(1),o.Q6J("disabled",o.lcZ(50,15,n.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(53,17,n.loading$))}}let Va=(()=>{class e extends vt{}return e.\u0275fac=function(){let t;return function(n){return(t||(t=o.n5z(e)))(n||e)}}(),e.\u0275cmp=o.Xpm({type:e,selectors:[["mail-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:7,vars:3,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["class","body many-inputs","ngNativeValidate","",3,"submit",4,"ngIf"],["ngNativeValidate","",1,"body","many-inputs",3,"submit"],[1,"input-container"],["for","env.mail_from_address","trans",""],["type","email","name","env.mail_from_address","id","env.mail_from_address","required","",3,"ngModel","ngModelChange"],["trans",""],["for","mail.contact_page_address","trans",""],["type","email","name","mail.contact_page_address","id","mail.contact_page_address","required","",3,"ngModel","ngModelChange"],["trans","",3,"transValues"],["for","env.mail_from_name","trans",""],["name","env.mail_from_name","id","env.mail_from_name","required","",3,"ngModel","ngModelChange"],[1,"widget","widget-info","widget-important"],[4,"ngIf"],["id","mail_group",1,"error-group","many-inputs"],["for","mail.driver","trans",""],["name","mail.driver","id","mail.driver",3,"ngModel","ngModelChange"],["value","mailgun"],["value","smtp"],["value","sparkpost"],["value","ses"],["value","sendmail"],["value","log"],["class","input-container",4,"ngIf"],["class","error group-error",3,"innerHTML",4,"ngIf"],["mat-raised-button","","color","accent","type","submit","trans","",1,"button","primary","update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],["for","mail.handler","trans",""],["name","mail.handler","id","mail.handler",3,"ngModel","ngModelChange"],["value","mailgun","trans",""],["value","null","trans",""],["value","mime","trans",""],["for","webhook_secret_key"],["type","text","id","webhook_secret_key","name","webhook_secret_key","required","","minlength","30","maxlength","30",3,"ngModel","ngModelChange"],["for","env.mail_host","trans",""],["name","env.mail_host","id","env.mail_host",3,"ngModel","ngModelChange"],["for","env.mail_username","trans",""],["name","env.mail_username","id","env.mail_username",3,"ngModel","ngModelChange"],["for","env.mail_password","trans",""],["type","password","name","env.mail_password","id","env.mail_password",3,"ngModel","ngModelChange"],["for","env.mail_port","trans",""],["name","env.mail_port","id","env.mail_port",3,"ngModel","ngModelChange"],["for","env.mail_encryption","trans",""],["name","env.mail_encryption","id","env.mail_encryption",3,"ngModel","ngModelChange"],["for","mailgun_domain","trans",""],["name","mailgun_domain","id","mailgun_domain",3,"ngModel","ngModelChange"],["class","error",4,"ngIf"],["for","mailgun_secret","trans",""],["name","mailgun_secret","id","mailgun_secret",3,"ngModel","ngModelChange"],[1,"error"],["for","env.ses_key","trans",""],["name","env.ses_key","id","env.ses_key",3,"ngModel","ngModelChange"],["for","env.ses_secret","trans",""],["name","env.ses_secret","id","env.ses_secret",3,"ngModel","ngModelChange"],["for","env.ses_region","trans",""],["name","env.ses_region","id","env.ses_region","placeholder","us-east-1",3,"ngModel","ngModelChange"],["for","env.sparkpost_secret","trans",""],["name","env.sparkpost_secret","id","env.sparkpost_secret",3,"ngModel","ngModelChange"],[1,"error","group-error",3,"innerHTML"],["mode","indeterminate","color","accent"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"Mail"),o.qZA(),o.TgZ(3,"div",2),o._uU(4,"Change incoming and outgoing email handlers, email credentials and more."),o.qZA(),o.qZA(),o.YNc(5,$a,54,21,"form",3),o.ALo(6,"async")),2&e&&(o.xp6(5),o.Q6J("ngIf",o.lcZ(6,1,t.errors$)))},directives:[Zt.P,i.O5,a.JL,a.F,a.Fj,a.Q7,a.JJ,a.On,a.EJ,a.YN,a.Kr,g.lW,a.wO,a.nD,s.pW],pipes:[i.Ov],encapsulation:2,changeDetection:0}),e})();function Ha(e,t){if(1&e&&o._UZ(0,"p",14),2&e){const e=o.oxw().ngIf;o.Q6J("innerHTML",e.logging_group,o.oJD)}}function za(e,t){1&e&&o._UZ(0,"mat-progress-bar",15)}function Ba(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"form",4),o.NdJ("submit",function(){return o.CHM(e),o.oxw().saveSettings()}),o.TgZ(1,"div",5),o.TgZ(2,"div",6),o.TgZ(3,"label",7),o._uU(4,"Sentry DSN"),o.qZA(),o.TgZ(5,"input",8),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.server.sentry_dsn=t}),o.qZA(),o.qZA(),o.YNc(6,Ha,1,1,"p",9),o.qZA(),o.TgZ(7,"div",10),o.TgZ(8,"div",1),o._uU(9,"Information"),o.qZA(),o.TgZ(10,"p"),o.TgZ(11,"a",11),o._uU(12,"Sentry"),o.qZA(),o.TgZ(13,"span"),o._uU(14),o.ALo(15,"trans"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(16,"button",12),o.ALo(17,"async"),o._uU(18,"Update"),o.qZA(),o.YNc(19,za,1,0,"mat-progress-bar",13),o.ALo(20,"async"),o.qZA()}if(2&e){const e=t.ngIf,n=o.oxw();o.xp6(1),o.ekj("has-error",e.logging_group),o.xp6(4),o.Q6J("ngModel",n.state.server.sentry_dsn),o.xp6(1),o.Q6J("ngIf",e.logging_group),o.xp6(8),o.hij(" ",o.lcZ(15,7,"integration provides real-time error tracking and helps identify and fix issues when site is in production."),""),o.xp6(2),o.Q6J("disabled",o.lcZ(17,9,n.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(20,11,n.loading$))}}let ja=(()=>{class e extends vt{}return e.\u0275fac=function(){let t;return function(n){return(t||(t=o.n5z(e)))(n||e)}}(),e.\u0275cmp=o.Xpm({type:e,selectors:[["logging-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:7,vars:3,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["class","body many-inputs","ngNativeValidate","",3,"submit",4,"ngIf"],["ngNativeValidate","",1,"body","many-inputs",3,"submit"],["id","logging-group",1,"error-group","many-inputs","no-spacing"],[1,"input-container"],["for","logging.sentry_dsn","trans",""],["type","url","name","logging.sentry_dsn","id","logging.sentry_dsn","minlength","30",3,"ngModel","ngModelChange"],["class","error",3,"innerHTML",4,"ngIf"],[1,"widget","widget-info"],["href","https://sentry.io","target","_blank"],["type","submit","mat-raised-button","","color","accent","trans","",1,"update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],[1,"error",3,"innerHTML"],["mode","indeterminate","color","accent"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"Logging"),o.qZA(),o.TgZ(3,"div",2),o._uU(4,"Configure site error and access logging and related 3rd party integrations."),o.qZA(),o.qZA(),o.YNc(5,Ba,21,13,"form",3),o.ALo(6,"async")),2&e&&(o.xp6(5),o.Q6J("ngIf",o.lcZ(6,1,t.errors$)))},directives:[Zt.P,i.O5,a.JL,a.F,a.Fj,a.wO,a.JJ,a.On,g.lW,s.pW],pipes:[i.Ov,lt.R],encapsulation:2,changeDetection:0}),e})();function Ga(e,t){if(1&e){const e=o.EpF();o.ynx(0),o.TgZ(1,"div",9),o.TgZ(2,"label",21),o._uU(3,"SQS Queue Key"),o.qZA(),o.TgZ(4,"input",22),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.sqs_queue_key=t}),o.qZA(),o.qZA(),o.TgZ(5,"div",9),o.TgZ(6,"label",23),o._uU(7,"SQS Queue Secret"),o.qZA(),o.TgZ(8,"input",24),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.sqs_queue_secret=t}),o.qZA(),o.qZA(),o.TgZ(9,"div",9),o.TgZ(10,"label",25),o._uU(11,"SQS Queue Prefix"),o.qZA(),o.TgZ(12,"input",26),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.sqs_queue_prefix=t}),o.qZA(),o.qZA(),o.TgZ(13,"div",9),o.TgZ(14,"label",27),o._uU(15,"SQS Queue Name"),o.qZA(),o.TgZ(16,"input",28),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.sqs_queue_name=t}),o.qZA(),o.qZA(),o.TgZ(17,"div",9),o.TgZ(18,"label",29),o._uU(19,"SQS Queue Region"),o.qZA(),o.TgZ(20,"input",30),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.sqs_queue_region=t}),o.qZA(),o.qZA(),o.BQk()}if(2&e){const e=o.oxw(2);o.xp6(4),o.Q6J("ngModel",e.state.server.sqs_queue_key),o.xp6(4),o.Q6J("ngModel",e.state.server.sqs_queue_secret),o.xp6(4),o.Q6J("ngModel",e.state.server.sqs_queue_prefix),o.xp6(4),o.Q6J("ngModel",e.state.server.sqs_queue_name),o.xp6(4),o.Q6J("ngModel",e.state.server.sqs_queue_region)}}function Xa(e,t){if(1&e&&o._UZ(0,"p",31),2&e){const e=o.oxw().ngIf;o.Q6J("innerHTML",e.queue_group,o.oJD)}}function Wa(e,t){1&e&&o._UZ(0,"mat-progress-bar",32)}function Ka(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"form",4),o.NdJ("submit",function(){return o.CHM(e),o.oxw().saveSettings()}),o.TgZ(1,"div",5),o.TgZ(2,"div",1),o._uU(3,"Information"),o.qZA(),o.TgZ(4,"p",6),o._uU(5,"Queues allow to defer time consuming tasks, such as sending an email, until a later time. Deferring these tasks can speed up web requests to the application."),o.qZA(),o.qZA(),o.TgZ(6,"div",7),o.TgZ(7,"div",1),o._uU(8,"Important"),o.qZA(),o.TgZ(9,"p",6),o._uU(10,"All methods except sync require additional setup, which should be performed before changing the queue method. Consult documentation for more information."),o.qZA(),o.qZA(),o.TgZ(11,"div",8),o.TgZ(12,"div",9),o.TgZ(13,"label",10),o._uU(14,"Queue Method"),o.qZA(),o.TgZ(15,"select",11),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.server.queue_driver=t})("ngModelChange",function(){return o.CHM(e),o.oxw().clearErrors()}),o.TgZ(16,"option",12),o._uU(17,"Sync (Default)"),o.qZA(),o.TgZ(18,"option",13),o._uU(19,"Beanstalkd"),o.qZA(),o.TgZ(20,"option",14),o._uU(21,"Database"),o.qZA(),o.TgZ(22,"option",15),o._uU(23,"SQS (Amazon simple queue service)"),o.qZA(),o.TgZ(24,"option",16),o._uU(25,"Redis"),o.qZA(),o.qZA(),o.qZA(),o.YNc(26,Ga,21,5,"ng-container",17),o.YNc(27,Xa,1,1,"p",18),o.qZA(),o.TgZ(28,"button",19),o.ALo(29,"async"),o._uU(30,"Update"),o.qZA(),o.YNc(31,Wa,1,0,"mat-progress-bar",20),o.ALo(32,"async"),o.qZA()}if(2&e){const e=t.ngIf,n=o.oxw();o.xp6(11),o.ekj("has-error",e.queue_group),o.xp6(4),o.Q6J("ngModel",n.state.server.queue_driver),o.xp6(11),o.Q6J("ngIf","sqs"===n.state.server.queue_driver),o.xp6(1),o.Q6J("ngIf",e.queue_group),o.xp6(1),o.Q6J("disabled",o.lcZ(29,7,n.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(32,9,n.loading$))}}let es=(()=>{class e extends vt{saveSettings(){const e=this.state.getModified();e.client["realtime.pusher_key"]&&(e.server.pusher_key=e.client["realtime.pusher_key"]),super.saveSettings(e)}}return e.\u0275fac=function(){let t;return function(n){return(t||(t=o.n5z(e)))(n||e)}}(),e.\u0275cmp=o.Xpm({type:e,selectors:[["queue-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:7,vars:3,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["class","body many-inputs","ngNativeValidate","",3,"submit",4,"ngIf"],["ngNativeValidate","",1,"body","many-inputs",3,"submit"],[1,"widget","widget-info"],["trans",""],[1,"widget","widget-info","widget-important"],["id","queue-group",1,"error-group","many-inputs","no-spacing"],[1,"input-container"],["for","queue.driver","trans",""],["name","queue.driver","id","queue.driver",3,"ngModel","ngModelChange"],["value","sync","trans",""],["value","beanstalkd"],["value","database"],["value","sqs","trans",""],["value","redis"],[4,"ngIf"],["class","error",3,"innerHTML",4,"ngIf"],["mat-raised-button","","color","accent","type","submit","trans","",1,"button","primary","update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],["for","sqs_queue_key","trans",""],["name","sqs_queue_key","id","sqs_queue_key","required","",3,"ngModel","ngModelChange"],["for","sqs_queue_secret","trans",""],["name","sqs_queue_secret","id","sqs_queue_secret","required","",3,"ngModel","ngModelChange"],["for","sqs_queue_prefix","trans",""],["name","sqs_queue_prefix","id","sqs_queue_prefix",3,"ngModel","ngModelChange"],["for","sqs_queue_name","trans",""],["name","sqs_queue_name","id","sqs_queue_name","required","",3,"ngModel","ngModelChange"],["for","sqs_queue_region","trans",""],["name","sqs_queue_region","id","sqs_queue_region","required","",3,"ngModel","ngModelChange"],[1,"error",3,"innerHTML"],["mode","indeterminate","color","accent"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"Queue"),o.qZA(),o.TgZ(3,"div",2),o._uU(4,"Select active queue method and enter related 3rd party API keys."),o.qZA(),o.qZA(),o.YNc(5,Ka,33,11,"form",3),o.ALo(6,"async")),2&e&&(o.xp6(5),o.Q6J("ngIf",o.lcZ(6,1,t.errors$)))},directives:[Zt.P,i.O5,a.JL,a.F,a.EJ,a.JJ,a.On,a.YN,a.Kr,g.lW,a.Fj,a.Q7,s.pW],pipes:[i.Ov],encapsulation:2,changeDetection:0}),e})();function ts(e,t){if(1&e&&o._UZ(0,"p",34),2&e){const e=o.oxw(3).ngIf;o.Q6J("innerHTML",e.paypal_group,o.oJD)}}function ns(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",25),o.TgZ(1,"div",12),o.TgZ(2,"label",26),o._uU(3,"Paypal Client ID"),o.qZA(),o.TgZ(4,"input",27),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(3).state.server.paypal_client_id=t}),o.qZA(),o.qZA(),o.TgZ(5,"div",12),o.TgZ(6,"label",28),o._uU(7,"Paypal Secret"),o.qZA(),o.TgZ(8,"input",29),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(3).state.server.paypal_secret=t}),o.qZA(),o.qZA(),o.TgZ(9,"div",12),o.TgZ(10,"label",30),o._uU(11,"Paypal Webhook ID"),o.qZA(),o.TgZ(12,"input",31),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(3).state.server.paypal_webhook_id=t}),o.qZA(),o.qZA(),o.TgZ(13,"div",8),o.TgZ(14,"mat-slide-toggle",32),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(3).state.client["billing.paypal_test_mode"]=t}),o._uU(15,"Paypal Test Mode"),o.qZA(),o.TgZ(16,"p",10),o._uU(17,"Allows testing PayPal payments with sandbox accounts."),o.qZA(),o.qZA(),o.YNc(18,ts,1,1,"p",33),o.qZA()}if(2&e){const e=o.oxw(2).ngIf,t=o.oxw();o.ekj("has-error",e.paypal_group),o.xp6(4),o.Q6J("ngModel",t.state.server.paypal_client_id),o.xp6(4),o.Q6J("ngModel",t.state.server.paypal_secret),o.xp6(4),o.Q6J("ngModel",t.state.server.paypal_webhook_id),o.xp6(2),o.Q6J("ngModel",t.state.client["billing.paypal_test_mode"]),o.xp6(4),o.Q6J("ngIf",e.paypal_group)}}function is(e,t){if(1&e&&(o.TgZ(0,"div",41),o._uU(1),o.qZA()),2&e){const e=o.oxw(3).ngIf;o.xp6(1),o.Oqu(e.stripe_secret)}}function as(e,t){if(1&e&&o._UZ(0,"p",34),2&e){const e=o.oxw(3).ngIf;o.Q6J("innerHTML",e.stripe_group,o.oJD)}}function ss(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",35),o.TgZ(1,"div",12),o.TgZ(2,"label",36),o._uU(3,"Stripe Client ID"),o.qZA(),o.TgZ(4,"input",37),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(3).state.server.stripe_key=t}),o.qZA(),o.qZA(),o.TgZ(5,"div",12),o.TgZ(6,"label",38),o._uU(7,"Stripe Secret"),o.qZA(),o.TgZ(8,"input",39),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(3).state.server.stripe_secret=t}),o.qZA(),o.YNc(9,is,2,1,"div",40),o.qZA(),o.YNc(10,as,1,1,"p",33),o.qZA()}if(2&e){const e=o.oxw(2).ngIf,t=o.oxw();o.ekj("has-error",e.stripe_group),o.xp6(4),o.Q6J("ngModel",t.state.server.stripe_key),o.xp6(1),o.ekj("has-error",e.stripe_secret),o.xp6(3),o.Q6J("ngModel",t.state.server.stripe_secret),o.xp6(1),o.Q6J("ngIf",e.stripe_secret),o.xp6(1),o.Q6J("ngIf",e.stripe_group)}}function os(e,t){if(1&e){const e=o.EpF();o.ynx(0),o.TgZ(1,"div",8),o.TgZ(2,"mat-slide-toggle",19),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.client["billing.paypal.enable"]=t}),o._uU(3,"Paypal Gateway"),o.qZA(),o.TgZ(4,"p",10),o._uU(5,"Enable PayPal payment gateway."),o.qZA(),o.qZA(),o.YNc(6,ns,19,7,"div",20),o.TgZ(7,"div",8),o.TgZ(8,"mat-slide-toggle",21),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.client["billing.stripe.enable"]=t}),o._uU(9,"Stripe Gateway"),o.qZA(),o.TgZ(10,"p",10),o._uU(11,"Enable Stripe payment gateway."),o.qZA(),o.qZA(),o.YNc(12,ss,11,8,"div",22),o.TgZ(13,"div",12),o.TgZ(14,"label",23),o._uU(15,"Accepted Cards"),o.qZA(),o.TgZ(16,"chip-input",24),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).acceptedCards=t}),o.qZA(),o.qZA(),o.BQk()}if(2&e){const e=o.oxw(2);o.xp6(2),o.Q6J("ngModel",e.state.client["billing.paypal.enable"]),o.xp6(4),o.Q6J("ngIf",e.state.client["billing.paypal.enable"]),o.xp6(2),o.Q6J("ngModel",e.state.client["billing.stripe.enable"]),o.xp6(4),o.Q6J("ngIf",e.state.client["billing.stripe.enable"]),o.xp6(4),o.Q6J("ngModel",e.acceptedCards)}}function rs(e,t){1&e&&o._UZ(0,"mat-progress-bar",42)}function ls(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"form",4),o.NdJ("submit",function(){return o.CHM(e),o.oxw().saveSettings()}),o.TgZ(1,"mat-tab-group",5),o.TgZ(2,"mat-tab",6),o.ALo(3,"trans"),o.TgZ(4,"div",7),o.TgZ(5,"div",8),o.TgZ(6,"mat-slide-toggle",9),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.client["billing.enable"]=t}),o._uU(7,"Enable Billing"),o.qZA(),o.TgZ(8,"p",10),o._uU(9,"Enable or disable all billing functionality across the site."),o.qZA(),o.qZA(),o.YNc(10,os,17,5,"ng-container",11),o.qZA(),o.qZA(),o.TgZ(11,"mat-tab",6),o.ALo(12,"trans"),o.TgZ(13,"div",7),o.TgZ(14,"div",12),o.TgZ(15,"label",13),o._uU(16,"Invoice Address"),o.qZA(),o.TgZ(17,"textarea",14),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.client["billing.invoice.address"]=t}),o.qZA(),o.TgZ(18,"p",10),o._uU(19,'Address to show under "from" section of user invoice. Supports HTML. Optional.'),o.qZA(),o.qZA(),o.TgZ(20,"div",12),o.TgZ(21,"label",15),o._uU(22,"Invoice Note"),o.qZA(),o.TgZ(23,"textarea",16),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.client["billing.invoice.notes"]=t}),o.qZA(),o.TgZ(24,"p",10),o._uU(25,'Default notes to show under "notes" section of user invoice. Optional.'),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(26,"button",17),o.ALo(27,"async"),o._uU(28,"Update"),o.qZA(),o.YNc(29,rs,1,0,"mat-progress-bar",18),o.ALo(30,"async"),o.qZA()}if(2&e){const e=o.oxw();o.xp6(2),o.Q6J("label",o.lcZ(3,8,"General")),o.xp6(4),o.Q6J("ngModel",e.state.client["billing.enable"]),o.xp6(4),o.Q6J("ngIf",e.state.client["billing.enable"]),o.xp6(1),o.Q6J("label",o.lcZ(12,10,"Invoices")),o.xp6(6),o.Q6J("ngModel",e.state.client["billing.invoice.address"]),o.xp6(6),o.Q6J("ngModel",e.state.client["billing.invoice.notes"]),o.xp6(3),o.Q6J("disabled",o.lcZ(27,12,e.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(30,14,e.loading$))}}let cs=(()=>{class e extends vt{constructor(){super(...arguments),this.acceptedCards=[]}ngOnInit(){this.acceptedCards=this.settings.getJson("billing.accepted_cards",[])}saveSettings(){const e=this.state.getModified();e.client["billing.accepted_cards"]=JSON.stringify(this.acceptedCards),super.saveSettings(e)}}return e.\u0275fac=function(){let t;return function(n){return(t||(t=o.n5z(e)))(n||e)}}(),e.\u0275cmp=o.Xpm({type:e,selectors:[["billing-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:7,vars:3,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["class","body many-inputs","ngNativeValidate","",3,"submit",4,"ngIf"],["ngNativeValidate","",1,"body","many-inputs",3,"submit"],["color","accent","animationDuration","0"],[3,"label"],[1,"many-inputs","tab-content"],[1,"setting-toggle-container"],["name","billing.enable","id","billing.enable","trans","",3,"ngModel","ngModelChange"],["trans",""],[4,"ngIf"],[1,"input-container"],["for","billing.invoice.address","trans",""],["name","billing.invoice.address","id","billing.invoice.address","rows","5",3,"ngModel","ngModelChange"],["for","billing.invoice.notes","trans",""],["name","billing.invoice.notes","id","billing.invoice.notes","rows","5",3,"ngModel","ngModelChange"],["mat-raised-button","","color","accent","type","submit","trans","",1,"button","primary","update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],["name","billing.paypal.enable","id","billing.paypal.enable","trans","",3,"ngModel","ngModelChange"],["class","error-group many-inputs","id","paypal_group",3,"has-error",4,"ngIf"],["name","billing.enable.stripe","id","billing.enable.stripe","trans","",3,"ngModel","ngModelChange"],["class","error-group many-inputs","id","stripe_group",3,"has-error",4,"ngIf"],["for","accepted-cards","trans",""],["id","accepted-cards","name","accepted-cards","placeholder","+New Card...","trans-placeholder","",3,"ngModel","ngModelChange"],["id","paypal_group",1,"error-group","many-inputs"],["for","billing.paypal.id","trans",""],["name","billing.paypal.id","id","billing.paypal.id","required","",3,"ngModel","ngModelChange"],["for","billing.paypal.secret","trans",""],["name","billing.paypal.secret","id","billing.paypal.secret","required","",3,"ngModel","ngModelChange"],["for","billing.paypal.webhook_id","trans",""],["name","billing.paypal.webhook_id","id","billing.paypal.webhook_id","required","",3,"ngModel","ngModelChange"],["name","billing.paypal.test_mode","id","billing.paypal.test_mode","trans","",3,"ngModel","ngModelChange"],["class","error",3,"innerHTML",4,"ngIf"],[1,"error",3,"innerHTML"],["id","stripe_group",1,"error-group","many-inputs"],["for","stripe_key","trans",""],["name","billing.stripe.id","id","stripe_key","required","",3,"ngModel","ngModelChange"],["for","stripe_secret","trans",""],["name","billing.stripe.secret","id","stripe_secret","required","",3,"ngModel","ngModelChange"],["class","error",4,"ngIf"],[1,"error"],["mode","indeterminate","color","accent"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"Billing"),o.qZA(),o.TgZ(3,"div",2),o._uU(4,"Configure billing and subscription settings."),o.qZA(),o.qZA(),o.YNc(5,ls,31,16,"form",3),o.ALo(6,"async")),2&e&&(o.xp6(5),o.Q6J("ngIf",o.lcZ(6,1,t.errors$)))},directives:[Zt.P,i.O5,a.JL,a.F,J.SP,J.uX,T.Rr,a.JJ,a.On,a.Fj,g.lW,xt.S,a.Q7,s.pW],pipes:[i.Ov,lt.R],styles:[".settings-panels-container[_nghost-%COMP%]   .header[_ngcontent-%COMP%], .settings-panels-container   [_nghost-%COMP%]   .header[_ngcontent-%COMP%]{margin-bottom:25px}.tab-content[_ngcontent-%COMP%]{padding-top:25px}"],changeDetection:0}),e})();var ds=n(568),us=n(6850),gs=n(1796);function ps(e,t){if(1&e&&(o.TgZ(0,"label",5),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.MGl("for","space-input-",e.id,""),o.xp6(1),o.Oqu(e.label)}}function hs(e,t){if(1&e&&(o.TgZ(0,"option",6),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("ngValue",e),o.xp6(1),o.Oqu(e)}}const ms=[[["",8,"description"]],[["",8,"error"]]],fs=[".description",".error"];let _s=(()=>{class e{constructor(){this.inputContainer=!0,this.id=(0,dn.O)(),this.spaceUnits=ds.L,this.form=new a.cw({unit:new a.NI("MB"),amount:new a.NI(null)})}ngOnInit(){this.form.valueChanges.pipe((0,Dt.U)(e=>(0,us.F)(e.amount,e.unit))).subscribe(e=>this.propagateChange(e))}writeValue(e){this.form.setValue(this.fromBytes(e),{emitEvent:!1})}registerOnChange(e){this.propagateChange=e}registerOnTouched(){}fromBytes(e){const t=(0,gs.H)(e);return t?{amount:t.split(" ")[0],unit:t.split(" ")[1]}:{amount:null,unit:"MB"}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=o.Xpm({type:e,selectors:[["space-input"]],hostVars:2,hostBindings:function(e,t){2&e&&o.ekj("input-container",t.inputContainer)},inputs:{label:"label",name:"name"},features:[o._Bn([{provide:a.JU,useExisting:e,multi:!0}])],ngContentSelectors:fs,decls:7,vars:5,consts:[["trans","",3,"for",4,"ngIf"],[1,"wrapper"],["type","number","min","0","placeholder","Optional...","trans-placeholder","",3,"id","formControl"],[3,"formControl"],["trans","",3,"ngValue",4,"ngFor","ngForOf"],["trans","",3,"for"],["trans","",3,"ngValue"]],template:function(e,t){1&e&&(o.F$t(ms),o.YNc(0,ps,2,2,"label",0),o.TgZ(1,"div",1),o._UZ(2,"input",2),o.TgZ(3,"select",3),o.YNc(4,hs,2,2,"option",4),o.qZA(),o.qZA(),o.Hsn(5),o.Hsn(6,1)),2&e&&(o.Q6J("ngIf",t.label),o.xp6(2),o.MGl("id","space-input-",t.id,""),o.Q6J("formControl",t.form.get("amount")),o.xp6(1),o.Q6J("formControl",t.form.get("unit")),o.xp6(1),o.Q6J("ngForOf",t.spaceUnits))},directives:[i.O5,a.qQ,a.wV,a.Fj,Zt.P,a.JJ,a.oH,a.EJ,i.sg,a.YN,a.Kr],styles:["[_nghost-%COMP%]{display:block}.input-container[_nghost-%COMP%]   input[_ngcontent-%COMP%]{flex:1 1 auto;border-top-right-radius:0;border-bottom-right-radius:0;border-right:none}.input-container[_nghost-%COMP%]   select[_ngcontent-%COMP%]{width:80px;flex:0 0 80px;border-top-left-radius:0;border-bottom-left-radius:0}.wrapper[_ngcontent-%COMP%]{display:flex}"],changeDetection:0}),e})(),bs=(()=>{class e{constructor(e){this.state=e}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(d))},e.\u0275cmp=o.Xpm({type:e,selectors:[["ftp-form"]],decls:26,vars:7,consts:[[1,"input-container"],["for","storage_ftp_host","trans",""],["type","text","id","storage_ftp_host","name","storage_ftp_host","required","",3,"ngModel","ngModelChange"],["for","storage_ftp_username","trans",""],["type","text","id","storage_ftp_username","name","storage_ftp_username","required","",3,"ngModel","ngModelChange"],["for","storage_ftp_password","trans",""],["type","password","id","storage_ftp_password","name","storage_ftp_password","required","",3,"ngModel","ngModelChange"],["for","storage_ftp_root","trans",""],["type","text","id","storage_ftp_root","name","storage_ftp_root","placeholder","/",3,"ngModel","ngModelChange"],["for","storage_ftp_port","trans",""],["type","number","id","storage_ftp_port","name","storage_ftp_port","min","0","placeholder","21",3,"ngModel","ngModelChange"],[1,"setting-toggle-container"],["name","storage_ftp_passive","id","storage_ftp_passive","trans","",3,"ngModel","ngModelChange"],["name","storage_ftp_ssl","id","storage_ftp_ssl","trans","",3,"ngModel","ngModelChange"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"label",1),o._uU(2,"FTP Hostname"),o.qZA(),o.TgZ(3,"input",2),o.NdJ("ngModelChange",function(e){return t.state.server.storage_ftp_host=e}),o.qZA(),o.qZA(),o.TgZ(4,"div",0),o.TgZ(5,"label",3),o._uU(6,"FTP Username"),o.qZA(),o.TgZ(7,"input",4),o.NdJ("ngModelChange",function(e){return t.state.server.storage_ftp_username=e}),o.qZA(),o.qZA(),o.TgZ(8,"div",0),o.TgZ(9,"label",5),o._uU(10,"FTP Password"),o.qZA(),o.TgZ(11,"input",6),o.NdJ("ngModelChange",function(e){return t.state.server.storage_ftp_password=e}),o.qZA(),o.qZA(),o.TgZ(12,"div",0),o.TgZ(13,"label",7),o._uU(14,"FTP Directory"),o.qZA(),o.TgZ(15,"input",8),o.NdJ("ngModelChange",function(e){return t.state.server.storage_ftp_root=e}),o.qZA(),o.qZA(),o.TgZ(16,"div",0),o.TgZ(17,"label",9),o._uU(18,"FTP Port"),o.qZA(),o.TgZ(19,"input",10),o.NdJ("ngModelChange",function(e){return t.state.server.storage_ftp_port=e}),o.qZA(),o.qZA(),o.TgZ(20,"div",11),o.TgZ(21,"mat-slide-toggle",12),o.NdJ("ngModelChange",function(e){return t.state.server.storage_ftp_passive=e}),o._uU(22,"Passive"),o.qZA(),o.qZA(),o.TgZ(23,"div",11),o.TgZ(24,"mat-slide-toggle",13),o.NdJ("ngModelChange",function(e){return t.state.server.storage_ftp_ssl=e}),o._uU(25,"SSL"),o.qZA(),o.qZA()),2&e&&(o.xp6(3),o.Q6J("ngModel",t.state.server.storage_ftp_host),o.xp6(4),o.Q6J("ngModel",t.state.server.storage_ftp_username),o.xp6(4),o.Q6J("ngModel",t.state.server.storage_ftp_password),o.xp6(4),o.Q6J("ngModel",t.state.server.storage_ftp_root),o.xp6(4),o.Q6J("ngModel",t.state.server.storage_ftp_port),o.xp6(2),o.Q6J("ngModel",t.state.server.storage_ftp_passive),o.xp6(3),o.Q6J("ngModel",t.state.server.storage_ftp_ssl))},directives:[Zt.P,a.Fj,a.Q7,a.JJ,a.On,a.qQ,a.wV,T.Rr],encapsulation:2,changeDetection:0}),e})(),vs=(()=>{class e{constructor(e){this.state=e}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(d))},e.\u0275cmp=o.Xpm({type:e,selectors:[["dropbox-form"]],decls:8,vars:2,consts:[[1,"input-container"],["for","storage_dropbox_access_token","trans",""],["type","text","id","storage_dropbox_access_token","name","storage_dropbox_access_token","required","",3,"ngModel","ngModelChange"],["for","storage_dropbox_root","trans",""],["type","text","id","storage_dropbox_root","name","storage_dropbox_root","placeholder","/",3,"ngModel","ngModelChange"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"label",1),o._uU(2,"Access Token"),o.qZA(),o.TgZ(3,"input",2),o.NdJ("ngModelChange",function(e){return t.state.server.storage_dropbox_access_token=e}),o.qZA(),o.qZA(),o.TgZ(4,"div",0),o.TgZ(5,"label",3),o._uU(6,"Root Directory"),o.qZA(),o.TgZ(7,"input",4),o.NdJ("ngModelChange",function(e){return t.state.server.storage_dropbox_root=e}),o.qZA(),o.qZA()),2&e&&(o.xp6(3),o.Q6J("ngModel",t.state.server.storage_dropbox_access_token),o.xp6(4),o.Q6J("ngModel",t.state.server.storage_dropbox_root))},directives:[Zt.P,a.Fj,a.Q7,a.JJ,a.On],encapsulation:2,changeDetection:0}),e})(),Zs=(()=>{class e{constructor(e){this.state=e}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(d))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rackspace-form"]],decls:16,vars:4,consts:[[1,"input-container"],["for","storage_rackspace_username","trans",""],["type","text","id","storage_rackspace_username","name","storage_rackspace_username","required","",3,"ngModel","ngModelChange"],["for","storage_rackspace_key","trans",""],["type","text","id","storage_rackspace_key","name","storage_rackspace_key","required","",3,"ngModel","ngModelChange"],["for","storage_rackspace_region","trans",""],["type","text","id","storage_rackspace_region","name","storage_rackspace_region","required","",3,"ngModel","ngModelChange"],["for","storage_rackspace_container","trans",""],["type","text","id","storage_rackspace_container","name","storage_rackspace_container","required","",3,"ngModel","ngModelChange"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"label",1),o._uU(2,"Rackspace Username"),o.qZA(),o.TgZ(3,"input",2),o.NdJ("ngModelChange",function(e){return t.state.server.storage_rackspace_username=e}),o.qZA(),o.qZA(),o.TgZ(4,"div",0),o.TgZ(5,"label",3),o._uU(6,"Rackspace Key"),o.qZA(),o.TgZ(7,"input",4),o.NdJ("ngModelChange",function(e){return t.state.server.storage_rackspace_key=e}),o.qZA(),o.qZA(),o.TgZ(8,"div",0),o.TgZ(9,"label",5),o._uU(10,"Rackspace Region"),o.qZA(),o.TgZ(11,"input",6),o.NdJ("ngModelChange",function(e){return t.state.server.storage_rackspace_region=e}),o.qZA(),o.qZA(),o.TgZ(12,"div",0),o.TgZ(13,"label",7),o._uU(14,"Rackspace Container"),o.qZA(),o.TgZ(15,"input",8),o.NdJ("ngModelChange",function(e){return t.state.server.storage_rackspace_container=e}),o.qZA(),o.qZA()),2&e&&(o.xp6(3),o.Q6J("ngModel",t.state.server.storage_rackspace_username),o.xp6(4),o.Q6J("ngModel",t.state.server.storage_rackspace_key),o.xp6(4),o.Q6J("ngModel",t.state.server.storage_rackspace_region),o.xp6(4),o.Q6J("ngModel",t.state.server.storage_rackspace_container))},directives:[Zt.P,a.Fj,a.Q7,a.JJ,a.On],encapsulation:2,changeDetection:0}),e})(),xs=(()=>{class e{constructor(e){this.state=e}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(d))},e.\u0275cmp=o.Xpm({type:e,selectors:[["s3-form"]],decls:23,vars:8,consts:[[1,"input-container"],["for","storage_s3_key","trans",""],["type","text","id","storage_s3_key","name","storage_s3_key","required","",3,"ngModel","ngModelChange"],["for","storage_s3_secret","trans",""],["type","text","id","storage_s3_secret","name","storage_s3_secret","required","",3,"ngModel","ngModelChange"],["for","storage_s3_region","trans",""],["type","text","id","storage_s3_region","pattern","[a-z1-9\\-]+","placeholder","us-east-1","name","storage_s3_region","required","",3,"ngModel","ngModelChange"],["for","storage_s3_bucket","trans",""],["type","text","id","storage_s3_bucket","name","storage_s3_bucket","required","",3,"ngModel","ngModelChange"],["for","storage_s3_endpoint","trans",""],["type","url","id","storage_s3_endpoint","name","storage_s3_endpoint",3,"placeholder","ngModel","ngModelChange"],["trans",""]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"label",1),o._uU(2,"Amazon S3 Key"),o.qZA(),o.TgZ(3,"input",2),o.NdJ("ngModelChange",function(e){return t.state.server.storage_s3_key=e}),o.qZA(),o.qZA(),o.TgZ(4,"div",0),o.TgZ(5,"label",3),o._uU(6,"Amazon S3 Secret"),o.qZA(),o.TgZ(7,"input",4),o.NdJ("ngModelChange",function(e){return t.state.server.storage_s3_secret=e}),o.qZA(),o.qZA(),o.TgZ(8,"div",0),o.TgZ(9,"label",5),o._uU(10,"Amazon S3 Region"),o.qZA(),o.TgZ(11,"input",6),o.NdJ("ngModelChange",function(e){return t.state.server.storage_s3_region=e}),o.qZA(),o.qZA(),o.TgZ(12,"div",0),o.TgZ(13,"label",7),o._uU(14,"Amazon S3 Bucket"),o.qZA(),o.TgZ(15,"input",8),o.NdJ("ngModelChange",function(e){return t.state.server.storage_s3_bucket=e}),o.qZA(),o.qZA(),o.TgZ(16,"div",0),o.TgZ(17,"label",9),o._uU(18,"Amazon S3 Endpoint"),o.qZA(),o.TgZ(19,"input",10),o.NdJ("ngModelChange",function(e){return t.state.server.storage_s3_endpoint=e}),o.ALo(20,"trans"),o.qZA(),o.TgZ(21,"p",11),o._uU(22,"Only change endpoint if you are using another S3 compatible storage service."),o.qZA(),o.qZA()),2&e&&(o.xp6(3),o.Q6J("ngModel",t.state.server.storage_s3_key),o.xp6(4),o.Q6J("ngModel",t.state.server.storage_s3_secret),o.xp6(4),o.Q6J("ngModel",t.state.server.storage_s3_region),o.xp6(4),o.Q6J("ngModel",t.state.server.storage_s3_bucket),o.xp6(4),o.Q6J("placeholder",o.lcZ(20,6,"Optional"))("ngModel",t.state.server.storage_s3_endpoint))},directives:[Zt.P,a.Fj,a.Q7,a.JJ,a.On,a.c5],pipes:[lt.R],encapsulation:2,changeDetection:0}),e})(),As=(()=>{class e{constructor(e){this.state=e}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(d))},e.\u0275cmp=o.Xpm({type:e,selectors:[["digitalocean-form"]],decls:16,vars:4,consts:[[1,"input-container"],["for","storage_digitalocean_key","trans",""],["type","text","id","storage_digitalocean_key","name","storage_digitalocean_key","required","",3,"ngModel","ngModelChange"],["for","storage_digitalocean_secret","trans",""],["type","text","id","storage_digitalocean_secret","name","storage_digitalocean_secret","required","",3,"ngModel","ngModelChange"],["for","storage_digitalocean_region","trans",""],["type","text","id","storage_digitalocean_region","name","storage_digitalocean_region","required","","pattern","[a-z0-9]+","maxlength","5",3,"ngModel","ngModelChange"],["for","storage_digitalocean_bucket","trans",""],["type","text","id","storage_digitalocean_bucket","name","storage_digitalocean_bucket","required","",3,"ngModel","ngModelChange"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"label",1),o._uU(2,"DigitalOcean Key"),o.qZA(),o.TgZ(3,"input",2),o.NdJ("ngModelChange",function(e){return t.state.server.storage_digitalocean_key=e}),o.qZA(),o.qZA(),o.TgZ(4,"div",0),o.TgZ(5,"label",3),o._uU(6,"DigitalOcean Secret"),o.qZA(),o.TgZ(7,"input",4),o.NdJ("ngModelChange",function(e){return t.state.server.storage_digitalocean_secret=e}),o.qZA(),o.qZA(),o.TgZ(8,"div",0),o.TgZ(9,"label",5),o._uU(10,"DigitalOcean Region"),o.qZA(),o.TgZ(11,"input",6),o.NdJ("ngModelChange",function(e){return t.state.server.storage_digitalocean_region=e}),o.qZA(),o.qZA(),o.TgZ(12,"div",0),o.TgZ(13,"label",7),o._uU(14,"DigitalOcean Bucket"),o.qZA(),o.TgZ(15,"input",8),o.NdJ("ngModelChange",function(e){return t.state.server.storage_digitalocean_bucket=e}),o.qZA(),o.qZA()),2&e&&(o.xp6(3),o.Q6J("ngModel",t.state.server.storage_digitalocean_key),o.xp6(4),o.Q6J("ngModel",t.state.server.storage_digitalocean_secret),o.xp6(4),o.Q6J("ngModel",t.state.server.storage_digitalocean_region),o.xp6(4),o.Q6J("ngModel",t.state.server.storage_digitalocean_bucket))},directives:[Zt.P,a.Fj,a.Q7,a.JJ,a.On,a.c5,a.nD],encapsulation:2,changeDetection:0}),e})(),ys=(()=>{class e{constructor(e){this.state=e}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(d))},e.\u0275cmp=o.Xpm({type:e,selectors:[["backblaze-form"]],decls:16,vars:4,consts:[[1,"input-container"],["for","storage_backblaze_key_id","trans",""],["type","text","id","storage_backblaze_key_id","name","storage_backblaze_key_id","required","",3,"ngModel","ngModelChange"],["for","storage_backblaze_application_key","trans",""],["type","text","id","storage_backblaze_application_key","name","storage_backblaze_application_key","required","",3,"ngModel","ngModelChange"],["for","storage_backblaze_bucket","trans",""],["type","text","id","storage_backblaze_bucket","name","storage_backblaze_bucket","required","",3,"ngModel","ngModelChange"],["for","storage_backblaze_region","trans",""],["type","text","id","storage_backblaze_region","pattern","[a-z0-9\\-]+","placeholder","us-west-002","name","storage_backblaze_region","required","",3,"ngModel","ngModelChange"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"label",1),o._uU(2,"Backblaze KeyID"),o.qZA(),o.TgZ(3,"input",2),o.NdJ("ngModelChange",function(e){return t.state.server.storage_backblaze_key_id=e}),o.qZA(),o.qZA(),o.TgZ(4,"div",0),o.TgZ(5,"label",3),o._uU(6,"Backblaze applicationKey"),o.qZA(),o.TgZ(7,"input",4),o.NdJ("ngModelChange",function(e){return t.state.server.storage_backblaze_application_key=e}),o.qZA(),o.qZA(),o.TgZ(8,"div",0),o.TgZ(9,"label",5),o._uU(10,"Backblaze Bucket Name"),o.qZA(),o.TgZ(11,"input",6),o.NdJ("ngModelChange",function(e){return t.state.server.storage_backblaze_bucket=e}),o.qZA(),o.qZA(),o.TgZ(12,"div",0),o.TgZ(13,"label",7),o._uU(14,"Backblaze Region"),o.qZA(),o.TgZ(15,"input",8),o.NdJ("ngModelChange",function(e){return t.state.server.storage_backblaze_region=e}),o.qZA(),o.qZA()),2&e&&(o.xp6(3),o.Q6J("ngModel",t.state.server.storage_backblaze_key_id),o.xp6(4),o.Q6J("ngModel",t.state.server.storage_backblaze_application_key),o.xp6(4),o.Q6J("ngModel",t.state.server.storage_backblaze_bucket),o.xp6(4),o.Q6J("ngModel",t.state.server.storage_backblaze_region))},directives:[Zt.P,a.Fj,a.Q7,a.JJ,a.On,a.c5],encapsulation:2,changeDetection:0}),e})();function ws(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",16),o.TgZ(1,"label",27),o._uU(2,"User Uploads Storage Method"),o.qZA(),o.TgZ(3,"select",28),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.uploads_disk_driver=t})("ngModelChange",function(){return o.CHM(e),o.oxw(2).clearErrors()}),o.TgZ(4,"option",29),o._uU(5,"Local Disk (Default)"),o.qZA(),o.TgZ(6,"option",30),o._uU(7,"Amazon S3"),o.qZA(),o.TgZ(8,"option",31),o._uU(9,"FTP"),o.qZA(),o.TgZ(10,"option",32),o._uU(11,"DigitalOcean"),o.qZA(),o.TgZ(12,"option",33),o._uU(13,"Backblaze"),o.qZA(),o.TgZ(14,"option",34),o._uU(15,"Dropbox"),o.qZA(),o.TgZ(16,"option",35),o._uU(17,"Rackspace"),o.qZA(),o.qZA(),o.TgZ(18,"p",13),o._uU(19),o.qZA(),o.qZA()}if(2&e){const e=o.oxw(2);o.xp6(3),o.Q6J("ngModel",e.state.server.uploads_disk_driver),o.xp6(16),o.Oqu(e.settings.get("vebto.translations.uploads_disk_driver_description"))}}function Cs(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",16),o.TgZ(1,"label",36),o._uU(2,"Public Uploads Storage Method"),o.qZA(),o.TgZ(3,"select",37),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.public_disk_driver=t})("ngModelChange",function(){return o.CHM(e),o.oxw(2).clearErrors()}),o.TgZ(4,"option",29),o._uU(5,"Local Disk (Default)"),o.qZA(),o.TgZ(6,"option",30),o._uU(7,"Amazon S3"),o.qZA(),o.TgZ(8,"option",32),o._uU(9,"DigitalOcean"),o.qZA(),o.TgZ(10,"option",33),o._uU(11,"Backblaze"),o.qZA(),o.qZA(),o.TgZ(12,"p",13),o._uU(13),o.qZA(),o.qZA()}if(2&e){const e=o.oxw(2);o.xp6(3),o.Q6J("ngModel",e.state.server.public_disk_driver),o.xp6(10),o.Oqu(e.settings.get("vebto.translations.public_disk_driver_description"))}}function Ts(e,t){1&e&&o._UZ(0,"ftp-form",38)}function qs(e,t){1&e&&o._UZ(0,"dropbox-form",38)}function ks(e,t){1&e&&o._UZ(0,"rackspace-form",38)}function Ms(e,t){1&e&&o._UZ(0,"s3-form",38)}function Is(e,t){1&e&&o._UZ(0,"digitalocean-form",38)}function Us(e,t){1&e&&o._UZ(0,"backblaze-form",38)}function Js(e,t){if(1&e&&o._UZ(0,"p",39),2&e){const e=o.oxw().ngIf;o.Q6J("innerHTML",e.storage_group,o.oJD)}}function Ds(e,t){if(1&e&&o._UZ(0,"p",39),2&e){const e=o.oxw(2).ngIf;o.Q6J("innerHTML",e.static_delivery_group,o.oJD)}}function Os(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",16),o.TgZ(1,"label",40),o._uU(2,"File Delivery Optimization"),o.qZA(),o.TgZ(3,"select",41),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.server.static_file_delivery=t}),o.TgZ(4,"option",42),o._uU(5,"None"),o.qZA(),o.TgZ(6,"option",43),o._uU(7,"X-Sendfile (Apache)"),o.qZA(),o.TgZ(8,"option",44),o._uU(9,"X-Accel (Nginx)"),o.qZA(),o.qZA(),o.TgZ(10,"p",13),o._uU(11,"Both X-Sendfile and X-Accel need to be enabled on the server first. When enabled it will reduce server memory and CPU usage when previewing or downloading files, especially for large files. "),o.qZA(),o.YNc(12,Ds,1,1,"p",8),o.qZA()}if(2&e){const e=o.oxw().ngIf,t=o.oxw();o.xp6(3),o.Q6J("ngModel",t.state.server.static_file_delivery),o.xp6(1),o.Q6J("ngValue",null),o.xp6(8),o.Q6J("ngIf",e.static_delivery_group)}}function Ps(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",16),o.TgZ(1,"label",45),o._uU(2,"Chunk Size"),o.qZA(),o.TgZ(3,"space-input",46),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.client["uploads.chunk_size"]=t}),o.qZA(),o.TgZ(4,"p",13),o._uU(5,"Size for each file chunk. Recommended size is 5MB. It should generally only be changed if maximum upload size on your server is lower then 5MB. Increasing or decreasing chunk size will not affect upload speed."),o.qZA(),o.qZA()}if(2&e){const e=o.oxw(2);o.xp6(3),o.Q6J("ngModel",e.state.client["uploads.chunk_size"])}}function Ss(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",11),o.TgZ(1,"mat-slide-toggle",47),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.client["uploads.resume"]=t}),o._uU(2,"Resumable Uploads"),o.qZA(),o.TgZ(3,"p",13),o._uU(4,"Allow users to resume partial or failed uploads."),o.qZA(),o.qZA()}if(2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("ngModel",e.state.client["uploads.resume"])}}function Ns(e,t){1&e&&o._UZ(0,"mat-progress-bar",48)}function Qs(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"form",4),o.NdJ("ngSubmit",function(){return o.CHM(e),o.oxw().saveSettings()}),o.YNc(1,ws,20,2,"div",5),o.YNc(2,Cs,14,2,"div",5),o.TgZ(3,"div",6),o.YNc(4,Ts,1,0,"ftp-form",7),o.YNc(5,qs,1,0,"dropbox-form",7),o.YNc(6,ks,1,0,"rackspace-form",7),o.YNc(7,Ms,1,0,"s3-form",7),o.YNc(8,Is,1,0,"digitalocean-form",7),o.YNc(9,Us,1,0,"backblaze-form",7),o.YNc(10,Js,1,1,"p",8),o.qZA(),o.TgZ(11,"div",9),o.YNc(12,Os,13,3,"div",5),o.qZA(),o.TgZ(13,"div",10),o.TgZ(14,"div",11),o.TgZ(15,"mat-slide-toggle",12),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.client["uploads.chunk"]=t}),o._uU(16,"Chunked Uploads"),o.qZA(),o.TgZ(17,"p",13),o._uU(18,"When enabled larger files will be uploaded in smaller chunks to improve upload reliability and avoid server max upload size limits."),o.qZA(),o.qZA(),o.YNc(19,Ps,6,1,"div",5),o.TgZ(20,"div",14),o.TgZ(21,"div",1),o._uU(22,"Important"),o.qZA(),o.TgZ(23,"p"),o._uU(24),o.ALo(25,"trans"),o.TgZ(26,"strong"),o._uU(27),o.ALo(28,"async"),o.qZA(),o._uU(29,"."),o.qZA(),o.qZA(),o.YNc(30,Ss,5,1,"div",15),o.qZA(),o.TgZ(31,"div",16),o.TgZ(32,"label",17),o._uU(33,"Maximum file size"),o.qZA(),o.TgZ(34,"space-input",18),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.client["uploads.max_size"]=t}),o.qZA(),o.TgZ(35,"p",13),o._uU(36,"Maximum size for a single file user can upload."),o.qZA(),o.qZA(),o.TgZ(37,"div",16),o.TgZ(38,"label",19),o._uU(39,"Available Space"),o.qZA(),o.TgZ(40,"space-input",20),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.client["uploads.available_space"]=t}),o.qZA(),o.TgZ(41,"p",13),o._uU(42,"Disk space each user uploads are allowed to take up. This can be overridden per user."),o.qZA(),o.qZA(),o.TgZ(43,"div",16),o.TgZ(44,"label",21),o._uU(45,"Allowed file types"),o.qZA(),o.TgZ(46,"chip-input",22),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().allowedExtensions=t}),o.qZA(),o.TgZ(47,"p",13),o._uU(48,"List of allowed file types (jpg, mp3, pdf etc.). Leave empty to allow all file types."),o.qZA(),o.qZA(),o.TgZ(49,"div",16),o.TgZ(50,"label",23),o._uU(51,"Blocked file types"),o.qZA(),o.TgZ(52,"chip-input",24),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().blockedExtensions=t}),o.qZA(),o.TgZ(53,"p",13),o._uU(54,"Prevent uploading of these file types, even if they are allowed above."),o.qZA(),o.qZA(),o.TgZ(55,"button",25),o.ALo(56,"async"),o._uU(57,"Update"),o.qZA(),o.YNc(58,Ns,1,0,"mat-progress-bar",26),o.ALo(59,"async"),o.qZA()}if(2&e){const e=t.ngIf,n=o.oxw();o.xp6(1),o.Q6J("ngIf",n.state.server.uploads_disk_driver),o.xp6(1),o.Q6J("ngIf",n.state.server.public_disk_driver),o.xp6(1),o.ekj("hidden",n.allSelectedDriversAreLocal())("has-error",e.storage_group),o.xp6(1),o.Q6J("ngIf",n.driverSelected("ftp")),o.xp6(1),o.Q6J("ngIf",n.driverSelected("dropbox")),o.xp6(1),o.Q6J("ngIf",n.driverSelected("rackspace")),o.xp6(1),o.Q6J("ngIf",n.driverSelected("s3")),o.xp6(1),o.Q6J("ngIf",n.driverSelected("digitalocean")),o.xp6(1),o.Q6J("ngIf",n.driverSelected("backblaze")),o.xp6(1),o.Q6J("ngIf",e.storage_group),o.xp6(2),o.Q6J("ngIf",n.driverSelected("local")),o.xp6(3),o.Q6J("ngModel",n.state.client["uploads.chunk"]),o.xp6(4),o.Q6J("ngIf",n.state.client["uploads.chunk"]),o.xp6(5),o.hij("",o.lcZ(25,25,"Maximum upload size on your server currently is set to")," "),o.xp6(3),o.Oqu(o.lcZ(28,27,n.serverMaxUploadSize$)),o.xp6(3),o.Q6J("ngIf",n.state.client["uploads.chunk"]),o.xp6(4),o.Q6J("ngModel",n.state.client["uploads.max_size"]),o.xp6(6),o.Q6J("ngModel",n.state.client["uploads.available_space"]),o.xp6(6),o.Q6J("ngModel",n.allowedExtensions),o.xp6(6),o.Q6J("ngModel",n.blockedExtensions),o.xp6(3),o.Q6J("disabled",o.lcZ(56,29,n.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(59,31,n.loading$))}}let Ys=(()=>{class e extends vt{constructor(){super(...arguments),this.allowedExtensions=[],this.blockedExtensions=[],this.serverMaxUploadSize$=new b.xQ}ngOnInit(){this.allowedExtensions=this.settings.getJson("uploads.allowed_extensions",[]),this.blockedExtensions=this.settings.getJson("uploads.blocked_extensions",[]),this.getServerMaxUploadSize()}saveSettings(){this.setJson("uploads.allowed_extensions",Fs(this.allowedExtensions)),this.setJson("uploads.blocked_extensions",Fs(this.blockedExtensions)),super.saveSettings()}driverSelected(e){return[this.state.server.uploads_disk_driver,this.state.server.public_disk_driver].includes(e)}allSelectedDriversAreLocal(){return[this.state.server.uploads_disk_driver,this.state.server.public_disk_driver].every(e=>!e||"local"===e)}getServerMaxUploadSize(){this.http.get("uploads/server-max-file-size").subscribe(e=>{this.serverMaxUploadSize$.next(e.maxSize)})}}return e.\u0275fac=function(){let t;return function(n){return(t||(t=o.n5z(e)))(n||e)}}(),e.\u0275cmp=o.Xpm({type:e,selectors:[["uploading-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:7,vars:3,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["class","body many-inputs","ngNativeValidate","",3,"ngSubmit",4,"ngIf"],["ngNativeValidate","",1,"body","many-inputs",3,"ngSubmit"],["class","input-container",4,"ngIf"],["id","storage_group",1,"error-group","storage-credentials-group"],["class","many-inputs credentials-form",4,"ngIf"],["class","error",3,"innerHTML",4,"ngIf"],["id","static_delivery_group",1,"error-group","no-bottom-border"],[1,"error-group"],[1,"setting-toggle-container"],["name","uploads.chunk","id","uploads.chunk","trans","",3,"ngModel","ngModelChange"],["trans",""],[1,"widget","widget-important"],["class","setting-toggle-container",4,"ngIf"],[1,"input-container"],["for","uploads.max_size","trans",""],["name","uploads.max_size","id","uploads.max_size",3,"ngModel","ngModelChange"],["for","uploads.available_space","trans",""],["name","uploads.available_space","id","uploads.available_space",3,"ngModel","ngModelChange"],["for","allowed_extensions","trans",""],["id","allowed_extensions","name","allowed_extensions","placeholder","Enter file type...",3,"ngModel","ngModelChange"],["for","blocked_extensions","trans",""],["id","blocked_extensions","name","blocked_extensions","placeholder","Enter file type...",3,"ngModel","ngModelChange"],["mat-raised-button","","color","accent","type","submit","trans","",1,"update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],["for","uploads_disk_driver","trans",""],["name","uploads_disk_driver","id","uploads_disk_driver",3,"ngModel","ngModelChange"],["value","local","trans",""],["value","s3"],["value","ftp"],["value","digitalocean"],["value","backblaze"],["value","dropbox"],["value","rackspace"],["for","public_disk_driver","trans",""],["name","public_disk_driver","id","public_disk_driver",3,"ngModel","ngModelChange"],[1,"many-inputs","credentials-form"],[1,"error",3,"innerHTML"],["for","static_file_delivery","trans",""],["name","static_file_delivery","id","static_file_delivery",3,"ngModel","ngModelChange"],["trans","",3,"ngValue"],["value","xsendfile"],["value","xaccel"],["for","uploads.chunk_size","trans",""],["name","uploads.chunk_size","id","uploads.chunk_size",3,"ngModel","ngModelChange"],["name","uploads.resume","id","uploads.resume","trans","",3,"ngModel","ngModelChange"],["mode","indeterminate","color","accent"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"User Uploads"),o.qZA(),o.TgZ(3,"div",2),o._uU(4,"Configure size and type of files that users are able to upload. This will affect all uploads across the site."),o.qZA(),o.qZA(),o.YNc(5,Qs,60,33,"form",3),o.ALo(6,"async")),2&e&&(o.xp6(5),o.Q6J("ngIf",o.lcZ(6,1,t.errors$)))},directives:[Zt.P,i.O5,a.JL,a.F,T.Rr,a.JJ,a.On,_s,xt.S,g.lW,a.EJ,a.YN,a.Kr,bs,vs,Zs,xs,As,ys,s.pW],pipes:[i.Ov,lt.R],styles:[".storage-credentials-group[_ngcontent-%COMP%]{border-bottom:none}.credentials-form[_ngcontent-%COMP%]{display:block}.credentials-form[_ngcontent-%COMP%]:not(:last-child){margin-bottom:20px;border-bottom:1px solid var(--be-divider-default)}"],changeDetection:0}),e})();function Fs(e){return e.map(e=>e.replace(/^\./,""))}function Rs(e){return[].concat.apply([],e)}function Es(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",16),o.TgZ(1,"mat-slide-toggle",17),o.NdJ("ngModelChange",function(t){const n=o.CHM(e).$implicit;return o.oxw(2).state.client[n.key]=t}),o._uU(2),o.ALo(3,"trans"),o.qZA(),o.TgZ(4,"p"),o._uU(5),o.ALo(6,"trans"),o.qZA(),o.qZA()}if(2&e){const e=t.$implicit,n=o.oxw(2);o.xp6(1),o.Q6J("name",e.key)("id",e.key)("ngModel",n.state.client[e.key]),o.xp6(1),o.Oqu(o.lcZ(3,5,e.name)),o.xp6(3),o.Oqu(o.lcZ(6,7,e.description))}}function Ls(e,t){if(1&e&&(o.TgZ(0,"p",18),o._uU(1),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(1),o.Oqu(e["recaptcha.site_key"])}}function $s(e,t){if(1&e&&(o.TgZ(0,"p",18),o._uU(1),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(1),o.Oqu(e["recaptcha.secret_key"])}}function Vs(e,t){if(1&e&&o._UZ(0,"p",19),2&e){const e=o.oxw().ngIf;o.Q6J("innerHTML",e.recaptcha_group,o.oJD)}}function Hs(e,t){1&e&&o._UZ(0,"mat-progress-bar",20)}function zs(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"form",4),o.NdJ("submit",function(){return o.CHM(e),o.oxw().saveSettings()}),o.YNc(1,Es,7,9,"div",5),o.TgZ(2,"div",6),o.TgZ(3,"div",7),o.TgZ(4,"label",8),o._uU(5,"Recaptcha V3 Site Key"),o.qZA(),o.TgZ(6,"input",9),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.client["recaptcha.site_key"]=t}),o.qZA(),o.YNc(7,Ls,2,1,"p",10),o.qZA(),o.TgZ(8,"div",7),o.TgZ(9,"label",11),o._uU(10,"Recaptcha V3 Secret Key"),o.qZA(),o.TgZ(11,"input",12),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.client["recaptcha.secret_key"]=t}),o.qZA(),o.YNc(12,$s,2,1,"p",10),o.qZA(),o.YNc(13,Vs,1,1,"p",13),o.qZA(),o.TgZ(14,"button",14),o.ALo(15,"async"),o._uU(16,"Update"),o.qZA(),o.YNc(17,Hs,1,0,"mat-progress-bar",15),o.ALo(18,"async"),o.qZA()}if(2&e){const e=t.ngIf,n=o.oxw();o.xp6(1),o.Q6J("ngForOf",n.actions),o.xp6(1),o.ekj("has-error",e.recaptcha_group),o.xp6(1),o.ekj("has-error",e["recaptcha.site_key"]),o.xp6(3),o.Q6J("ngModel",n.state.client["recaptcha.site_key"]),o.xp6(1),o.Q6J("ngIf",e["recaptcha.site_key"]),o.xp6(1),o.ekj("has-error",e["recaptcha.secret_key"]),o.xp6(3),o.Q6J("ngModel",n.state.client["recaptcha.secret_key"]),o.xp6(1),o.Q6J("ngIf",e["recaptcha.secret_key"]),o.xp6(1),o.Q6J("ngIf",e.recaptcha_group),o.xp6(1),o.Q6J("disabled",o.lcZ(15,14,n.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(18,16,n.loading$))}}let Bs=(()=>{class e extends vt{constructor(e,t,n,i,a,s,o,r,l,c,d){super(e,t,n,i,a,s,o,r,l,c),this.settings=e,this.toast=t,this.http=n,this.modal=i,this.route=a,this.customHomepage=s,this.valueLists=o,this.cd=r,this.router=l,this.state=c,this.recaptchaActions=d,this.actions=Rs(this.recaptchaActions).reverse()}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(st.Z),o.Y36(mt.F),o.Y36(r.r),o.Y36(ft.u),o.Y36(l.gz),o.Y36(_t.Y),o.Y36(bt.l),o.Y36(o.sBO),o.Y36(l.F0),o.Y36(d),o.Y36(S))},e.\u0275cmp=o.Xpm({type:e,selectors:[["recaptcha-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:7,vars:3,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["class","body many-inputs","ngNativeValidate","",3,"submit",4,"ngIf"],["ngNativeValidate","",1,"body","many-inputs",3,"submit"],["class","setting-toggle-container",4,"ngFor","ngForOf"],["id","recaptcha-group",1,"error-group","many-inputs","no-spacing"],[1,"input-container"],["for","recaptcha.site_key","trans",""],["name","recaptcha.site_key","id","recaptcha.site_key",3,"ngModel","ngModelChange"],["class","error",4,"ngIf"],["for","recaptcha.secret_key","trans",""],["name","recaptcha.secret_key","id","recaptcha.secret_key",3,"ngModel","ngModelChange"],["class","error",3,"innerHTML",4,"ngIf"],["mat-raised-button","","color","accent","type","submit","trans","",1,"button","primary","update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],[1,"setting-toggle-container"],[3,"name","id","ngModel","ngModelChange"],[1,"error"],[1,"error",3,"innerHTML"],["mode","indeterminate","color","accent"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"Recaptcha"),o.qZA(),o.TgZ(3,"div",2),o._uU(4,"Configure google recaptcha integration and credentials."),o.qZA(),o.qZA(),o.YNc(5,zs,19,18,"form",3),o.ALo(6,"async")),2&e&&(o.xp6(5),o.Q6J("ngIf",o.lcZ(6,1,t.errors$)))},directives:[Zt.P,i.O5,a.JL,a.F,i.sg,a.Fj,a.JJ,a.On,g.lW,T.Rr,s.pW],pipes:[i.Ov,lt.R],encapsulation:2,changeDetection:0}),e})();var js=n(8976),Gs=n(1769),Xs=n(8805),Ws=n(1378),Ks=n(9141),eo=n(3534),to=n(6313),no=n(4563),io=n(7312),ao=n(7393),so=n(3637);const oo={leading:!0,trailing:!1};class ro{constructor(e,t,n,i){this.duration=e,this.scheduler=t,this.leading=n,this.trailing=i}call(e,t){return t.subscribe(new lo(e,this.duration,this.scheduler,this.leading,this.trailing))}}class lo extends ao.L{constructor(e,t,n,i,a){super(e),this.duration=t,this.scheduler=n,this.leading=i,this.trailing=a,this._hasTrailingValue=!1,this._trailingValue=null}_next(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(co,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))}_complete(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()}clearThrottle(){const e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)}}function co(e){const{subscriber:t}=e;t.clearThrottle()}let uo=(()=>{class e{constructor(e,t,n){this.el=e,this.uploadQueue=t,this.cd=n,this.hidden=!0,this.subscription=this.uploadQueue.totalProgress().pipe(function(e,t=so.P,n=oo){return i=>i.lift(new ro(e,t,n.leading,n.trailing))}(260,It.Z,{leading:!0,trailing:!0})).subscribe(e=>{this.progress=e,this.hidden=100===e||0===this.uploadQueue.count$.value.pending,this.cd.markForCheck()})}ngOnDestroy(){this.subscription.unsubscribe()}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(o.SBq),o.Y36(Ks.A),o.Y36(o.sBO))},e.\u0275cmp=o.Xpm({type:e,selectors:[["upload-progress-bar"]],hostVars:2,hostBindings:function(e,t){2&e&&o.ekj("hidden",t.hidden)},decls:1,vars:1,consts:[["mode","determinate","color","accent",3,"value"]],template:function(e,t){1&e&&o._UZ(0,"mat-progress-bar",0),2&e&&o.Q6J("value",t.progress)},directives:[s.pW],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0}),e})();var go=n(6452);let po=(()=>{class e{constructor(e){this.el=e,this.config={},this.filesSelected=new o.vpe}ngOnInit(){this.el.nativeElement.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),(0,to.r)(this.config).then(e=>{e&&e.length&&this.filesSelected.emit(e)})})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(o.SBq))},e.\u0275dir=o.lG2({type:e,selectors:[["","uploadButton",""]],inputs:{config:["uploadButton","config"]},outputs:{filesSelected:"filesSelected"}}),e})();function ho(e,t){1&e&&o._UZ(0,"image-or-icon",4),2&e&&o.Q6J("src",t.ngIf)}function mo(e,t){if(1&e&&o._UZ(0,"image-or-icon",4),2&e){const e=o.oxw(2);o.Q6J("src",e.defaultBackground)}}function fo(e,t){if(1&e&&o.YNc(0,mo,1,1,"image-or-icon",5),2&e){const e=o.oxw();o.Q6J("ngIf",e.defaultBackground)}}function _o(e,t){if(1&e){const e=o.EpF();o.ynx(0),o._UZ(1,"span",6),o.TgZ(2,"button",7),o.NdJ("click",function(){return o.CHM(e),o.oxw().openUploadDialog()}),o._UZ(3,"mat-icon",8),o.qZA(),o.TgZ(4,"mat-menu",null,9),o.TgZ(6,"button",10),o.NdJ("filesSelected",function(t){return o.CHM(e),o.oxw().uploadImage(t)}),o._uU(7),o.ALo(8,"trans"),o.qZA(),o.TgZ(9,"button",11),o.NdJ("click",function(){return o.CHM(e),o.oxw().deleteUpload()}),o._uU(10,"Remove"),o.qZA(),o.qZA(),o.BQk()}if(2&e){const e=o.MAs(5),t=o.oxw();o.xp6(1),o.Q6J("matMenuTriggerFor",e),o.xp6(5),o.Q6J("uploadButton",t.uploadInputConfig),o.xp6(1),o.Oqu(o.lcZ(8,3,t.buttonText))}}function bo(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",14),o.NdJ("click",function(){return o.CHM(e),o.oxw(2).deleteUpload()}),o._UZ(1,"mat-icon",15),o.qZA()}}function vo(e,t){if(1&e){const e=o.EpF();o.ynx(0),o.TgZ(1,"button",12),o.NdJ("filesSelected",function(t){return o.CHM(e),o.oxw().uploadImage(t)}),o._uU(2),o.ALo(3,"trans"),o.qZA(),o.YNc(4,bo,2,0,"button",13),o.ALo(5,"async"),o.BQk()}if(2&e){const e=o.oxw();o.xp6(1),o.Q6J("uploadButton",e.uploadInputConfig),o.xp6(1),o.Oqu(o.lcZ(3,3,e.buttonText)),o.xp6(2),o.Q6J("ngIf",o.lcZ(5,5,e.src$))}}let Zo=(()=>{class e{constructor(e,t,n,i){this.uploadQueue=e,this.imageValidator=t,this.uploadsApi=n,this.http=i,this.fileDeleted=new o.vpe,this.buttonText="Upload image",this.uploadConfig={},this.compact=!1,this.uploadInputConfig={multiple:!1,types:[eo.j.image]},this.isDisabled$=new pt.X(!1),this.src$=new pt.X(null)}writeValue(e){this.src$.next(e)}registerOnChange(e){this.propagateChange=e}registerOnTouched(){}setDisabledState(e){this.isDisabled$.next(e)}uploadImage(e){const t=Object.assign(Object.assign({},this.defaultUploadConfig()),this.uploadConfig);this.uploadQueue.start(e,t).subscribe(e=>{this.src$.next(e.fileEntry.url),this.propagateChange(e.fileEntry.url)})}deleteUpload(){const e={paths:[this.src$.value],deleteForever:!0};(this.uploadConfig&&this.uploadConfig.uri?this.http.delete(this.uploadConfig.uri,e):this.uploadsApi.delete(e)).subscribe(()=>{this.src$.next(null),this.propagateChange(null),this.fileDeleted.emit()})}defaultUploadConfig(){return{httpParams:{diskPrefix:this.diskPrefix||"common_media"},uri:js.C.Image,validator:this.imageValidator}}openUploadDialog(){this.src$.value?this.menuTrigger.toggleMenu():(0,to.r)(this.uploadInputConfig).then(e=>{this.uploadImage(e)})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Ks.A),o.Y36(no.G),o.Y36(io.f),o.Y36(r.r))},e.\u0275cmp=o.Xpm({type:e,selectors:[["upload-image-control"]],viewQuery:function(e,t){if(1&e&&o.Gf(C.p6,5),2&e){let e;o.iGM(e=o.CRH())&&(t.menuTrigger=e.first)}},hostVars:2,hostBindings:function(e,t){2&e&&o.ekj("compact",t.compact)},inputs:{defaultBackground:"defaultBackground",buttonText:"buttonText",uploadConfig:"uploadConfig",diskPrefix:"diskPrefix",compact:"compact"},outputs:{fileDeleted:"fileDeleted"},features:[o._Bn([Ks.A,{provide:a.JU,useExisting:e,multi:!0}])],decls:10,vars:10,consts:[["class","inherit-size",3,"src",4,"ngIf","ngIfElse"],["defaultBg",""],[1,"action-buttons"],[4,"ngIf"],[1,"inherit-size",3,"src"],["class","inherit-size",3,"src",4,"ngIf"],[3,"matMenuTriggerFor"],["type","button","mat-icon-button","",1,"action-button",3,"click"],["svgIcon","add-photo-alternate"],["menu","matMenu"],["type","button","mat-menu-item","",3,"uploadButton","filesSelected"],["type","button","mat-menu-item","","trans","",3,"click"],["type","button","mat-stroked-button","","color","accent",1,"action-button",3,"uploadButton","filesSelected"],["type","button","class","action-button delete-button","mat-icon-button","",3,"click",4,"ngIf"],["type","button","mat-icon-button","",1,"action-button","delete-button",3,"click"],["svgIcon","delete"]],template:function(e,t){if(1&e&&(o.YNc(0,ho,1,1,"image-or-icon",0),o.ALo(1,"async"),o.YNc(2,fo,1,1,"ng-template",null,1,o.W1O),o.TgZ(4,"div",2),o.YNc(5,_o,11,5,"ng-container",3),o.ALo(6,"async"),o.YNc(7,vo,6,7,"ng-container",3),o.ALo(8,"async"),o.qZA(),o._UZ(9,"upload-progress-bar")),2&e){const e=o.MAs(3);o.Q6J("ngIf",o.lcZ(1,4,t.src$))("ngIfElse",e),o.xp6(5),o.Q6J("ngIf",t.compact&&!o.lcZ(6,6,t.isDisabled$)),o.xp6(2),o.Q6J("ngIf",!t.compact&&!o.lcZ(8,8,t.isDisabled$))}},directives:[i.O5,uo,go.A,C.p6,g.lW,O.Hw,C.VK,C.OP,po,Zt.P],pipes:[i.Ov,lt.R],styles:["[_nghost-%COMP%]{display:block;width:220px;height:220px;flex-shrink:0;border-radius:4px;overflow:hidden;background:linear-gradient(135deg,#70929c,#846170);position:relative}.inherit-size[_nghost-%COMP%], .inherit-size   [_nghost-%COMP%]{width:100%;height:100%}.compact[_nghost-%COMP%]   .action-buttons[_ngcontent-%COMP%], .compact   [_nghost-%COMP%]   .action-buttons[_ngcontent-%COMP%]{bottom:0;top:0}.action-buttons[_ngcontent-%COMP%]{position:absolute;bottom:25px;left:0;right:0;margin:auto;text-align:center;height:34px}.action-button[_ngcontent-%COMP%]{color:#000000de;border-color:#0000001a;background:#fffc}.mat-icon-button[_ngcontent-%COMP%]{border-radius:4px;line-height:34px;height:34px;width:34px}.delete-button[_ngcontent-%COMP%]{margin-left:5px}upload-progress-bar[_ngcontent-%COMP%]{width:100%;position:absolute;left:0;bottom:0}"]}),e})();class xo{constructor(e,t){this.key=t,this.selected=[],this.selected=[...e],this.key=t||"id"}isSelected(e){return this.findIndex(e)>-1}toggle(e){const t=this.findIndex(e);t>-1?this.selected.splice(t,1):this.selected.push(Object.assign({},e))}updateValue(e){const t=this.findIndex(e);this.selected[t]=Object.assign({},e)}getValue(e){return this.selected.find(t=>t[this.key]===e)}values(){return[...this.selected]}findIndex(e){return this.selected.findIndex(t=>t[this.key]===e[this.key])}}var Ao=n(9981);let yo=(()=>{class e{constructor(e){this.httpClient=e}getRoles(){return this.httpClient.getWithCache("roles?perPage=15")}createNew(e){return this.httpClient.post("roles",e)}update(e,t){return this.httpClient.put("roles/"+e,t)}delete(e){return this.httpClient.delete("roles/"+e)}addUsers(e,t){return this.httpClient.post("roles/"+e+"/add-users",{emails:t})}removeUsers(e,t){return this.httpClient.post("roles/"+e+"/remove-users",{ids:t})}}return e.\u0275fac=function(t){return new(t||e)(o.LFG(Ao.F))},e.\u0275prov=o.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function wo(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"li",10),o.TgZ(1,"div",11),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().selectionModel.toggle(t)}),o.TgZ(2,"div",12),o.TgZ(3,"div",13),o._uU(4),o.qZA(),o.qZA(),o._UZ(5,"mat-pseudo-checkbox",14),o.qZA(),o.qZA()}if(2&e){const e=t.$implicit,n=o.oxw();o.xp6(4),o.Oqu(e.name),o.xp6(1),o.Q6J("state",n.selectionModel.isSelected(e)?"checked":"unchecked")}}let Co=(()=>{class e{constructor(e,t,n){this.rolesService=e,this.dialogRef=t,this.data=n,this.allRoles$=new pt.X([]),this.selectionModel=new xo(this.data.initialRoles||[],"id")}ngOnInit(){this.fetchAllRoles()}confirm(){this.close(this.selectionModel.values())}close(e){this.dialogRef.close(e)}fetchAllRoles(){this.rolesService.getRoles().subscribe(e=>this.allRoles$.next(e.pagination.data))}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(yo),o.Y36(m.so),o.Y36(m.WI))},e.\u0275cmp=o.Xpm({type:e,selectors:[["select-roles-modal"]],decls:15,vars:3,consts:[[1,"modal-header"],["mat-dialog-title","","trans","",1,"modal-title"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"ngSubmit"],[1,"unstyled-list","selection-list"],["class","list-item",4,"ngFor","ngForOf"],[1,"buttons","right","mat-dialog-actions"],["mat-button","","type","button","trans","",3,"click"],["type","submit","mat-raised-button","","color","accent","trans",""],[1,"list-item"],["matRipple","",1,"list-item-header",3,"click"],[1,"meta"],[1,"list-item-name"],[3,"state"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"h2",1),o._uU(2,"Select Roles"),o.qZA(),o.TgZ(3,"button",2),o.NdJ("click",function(){return t.close()}),o._UZ(4,"mat-icon",3),o.qZA(),o.qZA(),o.TgZ(5,"form",4),o.NdJ("ngSubmit",function(){return t.confirm()}),o.TgZ(6,"mat-dialog-content"),o.TgZ(7,"ul",5),o.YNc(8,wo,6,2,"li",6),o.ALo(9,"async"),o.qZA(),o.qZA(),o.TgZ(10,"mat-dialog-actions",7),o.TgZ(11,"button",8),o.NdJ("click",function(){return t.close()}),o._uU(12,"Cancel"),o.qZA(),o.TgZ(13,"button",9),o._uU(14,"Select"),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(8),o.Q6J("ngForOf",o.lcZ(9,1,t.allRoles$)))},directives:[m.uh,Zt.P,O.Hw,a.JL,a.F,m.xY,i.sg,m.H8,g.lW,x.wG,x.nP],pipes:[i.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}.list-item[_ngcontent-%COMP%]{text-transform:capitalize}"],changeDetection:0}),e})();function To(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",9),o.TgZ(1,"button",10),o.NdJ("click",function(){return o.CHM(e),o.oxw(2).openSelectRolesModal()}),o._uU(2,"Manage"),o.qZA(),o.qZA()}}function qo(e,t){1&e&&(o.TgZ(0,"div",11),o._uU(1,"No roles yet."),o.qZA())}function ko(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-chip",12),o.NdJ("removed",function(){const t=o.CHM(e).$implicit;return o.oxw(2).detachRole(t)}),o.TgZ(1,"span",13),o._uU(2),o.qZA(),o._UZ(3,"mat-icon",14),o.qZA()}if(2&e){const e=t.$implicit,n=o.oxw(2);o.Q6J("removable",!0)("disabled",n.readonly),o.xp6(2),o.Oqu(e.name)}}function Mo(e,t){if(1&e&&(o.TgZ(0,"div",1),o.TgZ(1,"div",2),o.TgZ(2,"div",3),o._uU(3,"Roles"),o.qZA(),o.YNc(4,To,3,0,"div",4),o.qZA(),o.TgZ(5,"div",5),o.YNc(6,qo,2,0,"div",6),o.ALo(7,"async"),o.TgZ(8,"mat-chip-list",7),o.YNc(9,ko,4,3,"mat-chip",8),o.ALo(10,"async"),o.qZA(),o.qZA(),o.qZA()),2&e){const e=o.oxw();let t;o.xp6(4),o.Q6J("ngIf",!e.readonly),o.xp6(2),o.Q6J("ngIf",!(null!=(t=o.lcZ(7,4,e.roles$))&&t.length)),o.xp6(2),o.Q6J("selectable",!1),o.xp6(1),o.Q6J("ngForOf",o.lcZ(10,6,e.roles$))}}let Io=(()=>{class e{constructor(e,t,n,i){this.users=e,this.roleApi=t,this.modal=n,this.currentUser=i,this.roles$=new pt.X([]),this.readonly=!1}openSelectRolesModal(){this.modal.open(Co,{initialRoles:this.roles$.value}).afterClosed().subscribe(e=>{e&&this.setRoles(e)})}setRoles(e){this.roles$.next(e),this.propagateChange(this.roles$.value)}detachRole(e){const t=this.roles$.value.filter(t=>t.id!==e.id);this.setRoles(t)}writeValue(e){this.roles$.next(e)}registerOnChange(e){this.propagateChange=e}registerOnTouched(){}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(en.Q),o.Y36(yo),o.Y36(ft.u),o.Y36(on.I))},e.\u0275cmp=o.Xpm({type:e,selectors:[["role-manager"]],inputs:{readonly:"readonly"},features:[o._Bn([{provide:a.JU,useExisting:e,multi:!0}])],decls:1,vars:1,consts:[["class","panel-outter",4,"ngIf"],[1,"panel-outter"],[1,"header"],["trans","",1,"title"],["class","add-button",4,"ngIf"],[1,"panel-body","roles"],["class","no-permissions","trans","",4,"ngIf"],[3,"selectable"],[3,"removable","disabled","removed",4,"ngFor","ngForOf"],[1,"add-button"],["mat-flat-button","","color","accent","type","button","trans","",1,"select-roles-modal-button",3,"click"],["trans","",1,"no-permissions"],[3,"removable","disabled","removed"],[1,"role-name"],["svgIcon","cancel","matChipRemove",""]],template:function(e,t){1&e&&o.YNc(0,Mo,11,8,"div",0),2&e&&o.Q6J("ngIf",t.currentUser.hasPermission("roles.update"))},directives:[i.O5,Zt.P,h.qn,i.sg,g.lW,h.HS,O.Hw,h.qH],pipes:[i.Ov],styles:[".panel-outter[_ngcontent-%COMP%]{margin:10px 0 20px}.header[_ngcontent-%COMP%]{display:flex;margin-bottom:10px;padding-bottom:10px;border-bottom:1px solid var(--be-divider-default);align-items:flex-end}.title[_ngcontent-%COMP%]{font-weight:500}.add-button[_ngcontent-%COMP%]{text-align:right;flex:1 1 auto}.role-name[_ngcontent-%COMP%]{text-transform:capitalize}"],changeDetection:0}),e})();function Uo(e,t){if(1&e&&(o.TgZ(0,"p",21),o._uU(1),o.qZA()),2&e){const e=o.oxw().$implicit;o.xp6(1),o.hij(" ",e.description," ")}}function Jo(e,t){if(1&e&&(o.TgZ(0,"p",31),o._uU(1),o.qZA()),2&e){const e=o.oxw(2).$implicit;o.xp6(1),o.hij(" ",e.description," ")}}function Do(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",27),o.TgZ(1,"label",28),o._uU(2),o.qZA(),o.TgZ(3,"input",29),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().$implicit.value=t}),o.qZA(),o.YNc(4,Jo,2,1,"p",30),o.qZA()}if(2&e){const e=o.oxw().$implicit,t=o.oxw(2).$implicit,n=o.oxw(2);o.xp6(1),o.Q6J("for",t.name+"-"+e.name),o.xp6(1),o.Oqu(n.viewName(e.name)),o.xp6(1),o.Q6J("id",t.name+"-"+e.name)("ngModel",e.value),o.xp6(1),o.Q6J("ngIf",e.description)}}function Oo(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-slide-toggle",34),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).$implicit.value=t}),o._uU(1),o.qZA()}if(2&e){const e=o.oxw(2).$implicit,t=o.oxw(2).$implicit,n=o.oxw(2);o.Q6J("id",t.name+"-"+e.name)("ngModel",e.value),o.xp6(1),o.Oqu(n.viewName(e.name))}}function Po(e,t){if(1&e&&(o.TgZ(0,"p",31),o._uU(1),o.qZA()),2&e){const e=o.oxw(2).$implicit;o.xp6(1),o.hij(" ",e.description," ")}}function So(e,t){if(1&e&&(o.TgZ(0,"div",32),o.YNc(1,Oo,2,3,"mat-slide-toggle",33),o.YNc(2,Po,2,1,"p",30),o.qZA()),2&e){const e=o.oxw().$implicit;o.xp6(1),o.Q6J("ngSwitchCase","bool"),o.xp6(1),o.Q6J("ngIf",e.description)}}function No(e,t){if(1&e&&(o.ynx(0),o.ynx(1,24),o.YNc(2,Do,5,5,"div",25),o.YNc(3,So,3,2,"div",26),o.BQk(),o.BQk()),2&e){const e=t.$implicit;o.xp6(1),o.Q6J("ngSwitch",e.type),o.xp6(1),o.Q6J("ngSwitchCase","number"),o.xp6(1),o.Q6J("ngSwitchCase","bool")}}function Qo(e,t){if(1&e&&(o.TgZ(0,"div",22),o.YNc(1,No,4,3,"ng-container",23),o.qZA()),2&e){const e=o.oxw().$implicit;o.xp6(1),o.Q6J("ngForOf",e.restrictions)}}function Yo(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"li",14),o.TgZ(1,"div",15),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw(2).selectionModel.toggle(t)}),o.TgZ(2,"div",16),o.TgZ(3,"div",17),o._uU(4),o.qZA(),o.YNc(5,Uo,2,1,"p",18),o.qZA(),o._UZ(6,"mat-pseudo-checkbox",19),o.qZA(),o.YNc(7,Qo,2,1,"div",20),o.qZA()}if(2&e){const e=t.$implicit,n=o.oxw(2);o.xp6(4),o.hij(" ",e.display_name||e.name," "),o.xp6(1),o.Q6J("ngIf",e.description),o.xp6(1),o.Q6J("state",n.selectionModel.isSelected(e)?"checked":"unchecked"),o.xp6(1),o.Q6J("ngIf",!(null!=n.data&&n.data.hideRestrictions)&&(null==e.restrictions?null:e.restrictions.length)&&n.selectionModel.isSelected(e))}}function Fo(e,t){if(1&e&&(o.TgZ(0,"mat-expansion-panel",10),o.TgZ(1,"mat-expansion-panel-header"),o.TgZ(2,"mat-panel-title",11),o._uU(3),o.qZA(),o.qZA(),o.TgZ(4,"ul",12),o.YNc(5,Yo,8,4,"li",13),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.Q6J("expanded",!1),o.xp6(3),o.Oqu(e.key.replace("_"," ")),o.xp6(2),o.Q6J("ngForOf",e.value)}}let Ro=(()=>{class e{constructor(e,t,n){this.dialogRef=e,this.data=t,this.values=n,this.allPermissions$=new pt.X({}),this.filteredPermissions$=new pt.X({}),this.loading$=new pt.X(!1),this.selectionModel=new xo(this.data.initialPermissions||[],"name"),this.showAdvancedControl=new a.NI(!1)}ngOnInit(){this.fetchAllPermissions(),this.showAdvancedControl.valueChanges.subscribe(()=>{this.setShowAdvanced()})}confirm(){this.close(this.getSelectedPermissions())}close(e){this.dialogRef.close(e)}fetchAllPermissions(){const e=this.data.valueListKey||"permissions";this.loading$.next(!0),this.values.get([e]).pipe((0,gt.x)(()=>this.loading$.next(!1))).subscribe(t=>{const n=(i=this.mergeRestrictions(t[e]),a="group",i.reduce(function(e,t){return(e[t[a]]=e[t[a]]||[]).push(t),e},{}));var i,a;this.allPermissions$.next(n),this.setShowAdvanced()})}setShowAdvanced(){const e=this.allPermissions$.value,t={};Object.keys(e).forEach(n=>{const i=e[n].filter(e=>this.showAdvancedControl.value||!e.advanced);i.length&&(t[n]=i)}),this.filteredPermissions$.next(t)}getSelectedPermissions(){return Rs(Object.values(this.allPermissions$.value)).filter(e=>this.selectionModel.isSelected(e))}mergeRestrictions(e){return e.map(e=>{const t=this.selectionModel.getValue(e.name);return e.restrictions=(e.restrictions||[]).map(e=>{let n={};return t&&t.restrictions&&(n=t.restrictions.find(t=>t.name===e.name)||{}),Object.assign(Object.assign({},e),n)}),e})}viewName(e){return e.replace(/_/g," ")}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(m.so),o.Y36(m.WI),o.Y36(bt.l))},e.\u0275cmp=o.Xpm({type:e,selectors:[["select-permissions-modal"]],decls:20,vars:9,consts:[[1,"modal-header"],["mat-dialog-title","","trans","",1,"modal-title","mat-dialog-title"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["class","mat-elevation-z2",3,"expanded",4,"ngFor","ngForOf"],[1,"show-advanced-container"],["trans","",3,"formControl"],["mat-button","","type","button","trans","",3,"click"],["type","submit","mat-raised-button","","color","accent","trans","",3,"click"],[1,"overlay","overlay-partial",3,"isVisible"],[1,"mat-elevation-z2",3,"expanded"],["trans",""],[1,"unstyled-list","selection-list"],["class","list-item",4,"ngFor","ngForOf"],[1,"list-item"],["matRipple","",1,"list-item-header",3,"click"],[1,"meta"],["trans","",1,"list-item-name"],["class","list-item-description","trans","",4,"ngIf"],[3,"state"],["class","list-item-restrictions",4,"ngIf"],["trans","",1,"list-item-description"],[1,"list-item-restrictions"],[4,"ngFor","ngForOf"],[3,"ngSwitch"],["class","input-container list-item-restriction",4,"ngSwitchCase"],["class","setting-toggle-container list-item-restriction",4,"ngSwitchCase"],[1,"input-container","list-item-restriction"],[3,"for"],["type","number","min","0",3,"id","ngModel","ngModelChange"],["class","description","trans","",4,"ngIf"],["trans","",1,"description"],[1,"setting-toggle-container","list-item-restriction"],["trans","",3,"id","ngModel","ngModelChange",4,"ngSwitchCase"],["trans","",3,"id","ngModel","ngModelChange"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"h2",1),o._uU(2,"Select Permissions"),o.qZA(),o.TgZ(3,"button",2),o.NdJ("click",function(){return t.close()}),o._UZ(4,"mat-icon",3),o.qZA(),o.qZA(),o.TgZ(5,"mat-dialog-content"),o.TgZ(6,"mat-accordion"),o.YNc(7,Fo,6,3,"mat-expansion-panel",4),o.ALo(8,"keyvalue"),o.ALo(9,"async"),o.qZA(),o.TgZ(10,"div",5),o.TgZ(11,"mat-slide-toggle",6),o._uU(12,"Show advanced permissions"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(13,"mat-dialog-actions"),o.TgZ(14,"button",7),o.NdJ("click",function(){return t.close()}),o._uU(15,"Cancel"),o.qZA(),o.TgZ(16,"button",8),o.NdJ("click",function(){return t.confirm()}),o._uU(17,"Select"),o.qZA(),o.qZA(),o._UZ(18,"loading-indicator",9),o.ALo(19,"async")),2&e&&(o.xp6(7),o.Q6J("ngForOf",o.lcZ(8,3,o.lcZ(9,5,t.filteredPermissions$))),o.xp6(4),o.Q6J("formControl",t.showAdvancedControl),o.xp6(7),o.Q6J("isVisible",o.lcZ(19,7,t.loading$)))},directives:[m.uh,Zt.P,O.Hw,m.xY,Ke.pp,i.sg,T.Rr,a.JJ,a.oH,m.H8,g.lW,At.Q,Ke.ib,Ke.yz,Ke.yK,x.wG,i.O5,x.nP,i.RF,i.n9,a.qQ,a.wV,a.Fj,a.On],pipes:[i.Nd,i.Ov],styles:["[_nghost-%COMP%]{display:block;width:550px;max-width:100%;position:relative}.mat-expansion-panel-header-title[_ngcontent-%COMP%]{text-transform:capitalize}p[_ngcontent-%COMP%]{color:var(--be-secondary-text);font-size:1.3rem}.setting-toggle-container[_ngcontent-%COMP%]{margin-bottom:0}.show-advanced-container[_ngcontent-%COMP%]{margin-top:25px;margin-bottom:20px}"],changeDetection:0}),e})();function Eo(e,t){1&e&&(o.TgZ(0,"div",7),o._uU(1,"No permissions yet."),o.qZA())}function Lo(e,t){if(1&e&&(o.TgZ(0,"span"),o._uU(1),o.ALo(2,"trans"),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(1),o.hij("(",o.lcZ(2,1,e.value+" max"),")")}}function $o(e,t){if(1&e&&(o.ynx(0),o.YNc(1,Lo,3,3,"span",10),o.BQk()),2&e){const e=t.ngIf;o.xp6(1),o.Q6J("ngIf",e.value)}}function Vo(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-chip",8),o.NdJ("removed",function(){const t=o.CHM(e).$implicit;return o.oxw().removePermission(t.name)}),o.TgZ(1,"span"),o.TgZ(2,"span",9),o._uU(3),o.qZA(),o.YNc(4,$o,2,1,"ng-container",10),o.qZA(),o._UZ(5,"mat-icon",11),o.qZA()}if(2&e){const e=t.$implicit,n=o.oxw();o.Q6J("removable",!0),o.xp6(3),o.Oqu(e.name),o.xp6(1),o.Q6J("ngIf",n.getCountRestriction(e))}}let Ho=(()=>{class e{constructor(e){this.modal=e,this.valueListKey="permissions",this.hideRestrictions=!1,this.permissions$=new pt.X([])}showSelectPermissionsModal(){this.modal.open(Ro,{initialPermissions:this.permissions$.value,valueListKey:this.valueListKey,hideRestrictions:this.hideRestrictions}).afterClosed().subscribe(e=>{e&&this.setPermissions(e)})}removePermission(e){const t=this.permissions$.value.filter(t=>t.name!==e);this.setPermissions(t)}setPermissions(e){this.permissions$.next(e),this.propagateChange(this.permissions$.value)}getCountRestriction(e){return e.restrictions.find(e=>"count"===e.name)}writeValue(e){this.permissions$.next(e)}registerOnChange(e){this.propagateChange=e}registerOnTouched(){}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(ft.u))},e.\u0275cmp=o.Xpm({type:e,selectors:[["permission-manager"]],inputs:{valueListKey:"valueListKey",hideRestrictions:"hideRestrictions"},features:[o._Bn([{provide:a.JU,useExisting:e,multi:!0}])],decls:11,vars:7,consts:[[1,"header"],["trans","",1,"title"],["mat-flat-button","","color","accent","type","button","trans","",3,"click"],[1,"manage-permissions"],["class","no-permissions","trans","",4,"ngIf"],[3,"selectable"],[3,"removable","removed",4,"ngFor","ngForOf"],["trans","",1,"no-permissions"],[3,"removable","removed"],["trans",""],[4,"ngIf"],["svgIcon","cancel","matChipRemove",""]],template:function(e,t){if(1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"span",1),o._uU(2,"Permissions"),o.qZA(),o.TgZ(3,"button",2),o.NdJ("click",function(){return t.showSelectPermissionsModal()}),o._uU(4,"Manage"),o.qZA(),o.qZA(),o.TgZ(5,"div",3),o.YNc(6,Eo,2,0,"div",4),o.ALo(7,"async"),o.TgZ(8,"mat-chip-list",5),o.YNc(9,Vo,6,3,"mat-chip",6),o.ALo(10,"async"),o.qZA(),o.qZA()),2&e){let e;o.xp6(6),o.Q6J("ngIf",!(null!=(e=o.lcZ(7,3,t.permissions$))&&e.length)),o.xp6(2),o.Q6J("selectable",!1),o.xp6(1),o.Q6J("ngForOf",o.lcZ(10,5,t.permissions$))}},directives:[Zt.P,g.lW,i.O5,h.qn,i.sg,h.HS,O.Hw,h.qH],pipes:[i.Ov,lt.R],styles:["[_nghost-%COMP%]{display:block;margin:25px 0 35px}.header[_ngcontent-%COMP%]{display:flex;margin-bottom:10px;padding-bottom:10px;border-bottom:1px solid var(--be-divider-default);align-items:flex-end}.title[_ngcontent-%COMP%]{font-weight:500}button[_ngcontent-%COMP%]{margin-left:auto}.error[_ngcontent-%COMP%]{margin-top:10px;color:#f44336}"],changeDetection:0}),e})();function zo(e,t){1&e&&(o.TgZ(0,"h2",5),o._uU(1,"Update User Details"),o.qZA())}function Bo(e,t){1&e&&(o.TgZ(0,"h2",5),o._uU(1,"Create a New User"),o.qZA())}function jo(e,t){if(1&e&&(o.TgZ(0,"div",37),o._uU(1),o.qZA()),2&e){const e=o.oxw(2).ngIf;o.xp6(1),o.Oqu(null==e?null:e.email)}}function Go(e,t){if(1&e&&(o.TgZ(0,"div",13),o.TgZ(1,"label",35),o._uU(2,"Email"),o.qZA(),o._UZ(3,"input",36),o.YNc(4,jo,2,1,"div",12),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(4),o.Q6J("ngIf",null==e?null:e.email)}}function Xo(e,t){if(1&e&&(o.TgZ(0,"div",37),o._uU(1),o.qZA()),2&e){const e=o.oxw(2).ngIf;o.xp6(1),o.Oqu(null==e?null:e.password)}}function Wo(e,t){if(1&e&&(o.TgZ(0,"div",13),o.TgZ(1,"label",38),o._uU(2,"Password"),o.qZA(),o._UZ(3,"input",39),o.YNc(4,Xo,2,1,"div",12),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(4),o.Q6J("ngIf",null==e?null:e.password)}}function Ko(e,t){if(1&e&&(o.TgZ(0,"div",37),o._uU(1),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(1),o.Oqu(null==e?null:e.avatar)}}function er(e,t){if(1&e&&(o.TgZ(0,"div",37),o._uU(1),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(1),o.Oqu(null==e?null:e.first_name)}}function tr(e,t){if(1&e&&(o.TgZ(0,"div",37),o._uU(1),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(1),o.Oqu(null==e?null:e.last_name)}}function nr(e,t){if(1&e&&(o.TgZ(0,"div",37),o._uU(1),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(1),o.Oqu(null==e?null:e.email_verified_at)}}function ir(e,t){if(1&e&&(o.TgZ(0,"div",37),o._uU(1),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(1),o.Oqu(null==e?null:e.available_space)}}function ar(e,t){if(1&e&&(o.TgZ(0,"div",37),o._uU(1),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(1),o.Oqu(null==e?null:e.roles)}}function sr(e,t){1&e&&o._UZ(0,"permission-manager",40)}function or(e,t){if(1&e&&(o.TgZ(0,"div",37),o._uU(1),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(1),o.Oqu(null==e?null:e.permissions)}}function rr(e,t){1&e&&(o.TgZ(0,"span",41),o._uU(1,"Update User"),o.qZA())}function lr(e,t){1&e&&(o.TgZ(0,"span",41),o._uU(1,"Create User"),o.qZA())}function cr(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"form",6),o.NdJ("ngSubmit",function(){return o.CHM(e),o.oxw().confirm()}),o.TgZ(1,"mat-dialog-content",7),o.YNc(2,Go,5,1,"div",8),o.YNc(3,Wo,5,1,"div",8),o.TgZ(4,"div",9),o.TgZ(5,"div",10),o._UZ(6,"upload-image-control",11),o.YNc(7,Ko,2,1,"div",12),o.qZA(),o.TgZ(8,"div",7),o.TgZ(9,"div",13),o.TgZ(10,"label",14),o._uU(11,"First Name"),o.qZA(),o._UZ(12,"input",15),o.YNc(13,er,2,1,"div",12),o.qZA(),o.TgZ(14,"div",13),o.TgZ(15,"label",16),o._uU(16,"Last Name"),o.qZA(),o._UZ(17,"input",17),o.YNc(18,tr,2,1,"div",12),o.qZA(),o.qZA(),o.qZA(),o.TgZ(19,"div",13),o.TgZ(20,"label",18),o._uU(21,"Email Confirmed"),o.qZA(),o.TgZ(22,"div",19),o.TgZ(23,"select",20),o.TgZ(24,"option",21),o._uU(25,"Yes"),o.qZA(),o.TgZ(26,"option",21),o._uU(27,"No"),o.qZA(),o.qZA(),o.TgZ(28,"button",22),o.NdJ("click",function(){return o.CHM(e),o.oxw().sendEmailConfirmation()}),o.ALo(29,"async"),o._uU(30,"Resend"),o.qZA(),o.qZA(),o.YNc(31,nr,2,1,"div",12),o.qZA(),o.TgZ(32,"div",13),o.TgZ(33,"label",23),o._uU(34,"New Password"),o.qZA(),o.TgZ(35,"div",24),o._UZ(36,"input",25),o.TgZ(37,"button",26),o.NdJ("click",function(){return o.CHM(e),o.oxw().generateNewPassword()}),o._uU(38,"Generate"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(39,"space-input",27),o.TgZ(40,"p",28),o._uU(41,'Disk space available to user. If left empty, it will be inherited from value set in "admin -> settings -> uploading" page.'),o.qZA(),o.YNc(42,ir,2,1,"div",12),o.qZA(),o._UZ(43,"role-manager",29),o.YNc(44,ar,2,1,"div",12),o.YNc(45,sr,1,0,"permission-manager",30),o.YNc(46,or,2,1,"div",12),o.qZA(),o.TgZ(47,"div",31),o.TgZ(48,"button",32),o.NdJ("click",function(){return o.CHM(e),o.oxw().close()}),o._uU(49,"Cancel"),o.qZA(),o.TgZ(50,"button",33),o.ALo(51,"async"),o.YNc(52,rr,2,0,"span",34),o.YNc(53,lr,2,0,"span",34),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=t.ngIf,n=o.oxw();o.Q6J("formGroup",n.form),o.xp6(2),o.Q6J("ngIf",!n.data.user),o.xp6(1),o.Q6J("ngIf",!n.data.user),o.xp6(3),o.Q6J("uploadConfig",n.avatarUploadConfig()),o.xp6(1),o.Q6J("ngIf",null==e?null:e.avatar),o.xp6(6),o.Q6J("ngIf",null==e?null:e.first_name),o.xp6(5),o.Q6J("ngIf",null==e?null:e.last_name),o.xp6(1),o.ekj("resend-button-visible",n.shouldShowResendButton()),o.xp6(5),o.Q6J("ngValue",!0),o.xp6(2),o.Q6J("ngValue",!1),o.xp6(2),o.Q6J("disabled",o.lcZ(29,20,n.loading$)),o.xp6(3),o.Q6J("ngIf",null==e?null:e.email_verified_at),o.xp6(11),o.Q6J("ngIf",null==e?null:e.available_space),o.xp6(2),o.Q6J("ngIf",null==e?null:e.roles),o.xp6(1),o.Q6J("ngIf",n.currentUser.hasPermission("permissions.update")),o.xp6(1),o.Q6J("ngIf",null==e?null:e.permissions),o.xp6(4),o.Q6J("disabled",o.lcZ(51,22,n.loading$)),o.xp6(2),o.Q6J("ngIf",n.data.user),o.xp6(1),o.Q6J("ngIf",!n.data.user)}}let dr=(()=>{class e{constructor(e,t,n,i,a,s,o,r,l){this.dialogRef=e,this.data=t,this.users=n,this.toast=i,this.currentUser=a,this.fb=s,this.auth=o,this.settings=r,this.avatarValidator=l,this.loading$=new pt.X(!1),this.form=this.fb.group({email:[""],password:[""],avatar:[""],first_name:[""],last_name:[""],email_verified_at:[!1],available_space:[""],roles:[],permissions:[]}),this.errors$=new pt.X({})}ngOnInit(){this.data.user&&this.form.patchValue(Object.assign(Object.assign({},this.data.user),{password:null,email_verified_at:!!this.data.user.email_verified_at}))}confirm(){if(this.loading$.value)return;let e;const t=this.getPayload();this.loading$.next(!0),e=this.data.user?this.users.update(this.data.user.id,t):this.users.create(t),e.pipe((0,gt.x)(()=>this.loading$.next(!1))).subscribe(e=>{this.close(e.user),this.toast.open("User "+(this.data.user?"updated":"created"))},e=>this.errors$.next(e.errors))}close(e){this.dialogRef.close(e)}getPayload(){const e=Object.assign({},this.form.value);return e.roles=(e.roles||[]).map(e=>e.id),e.permissions=e.permissions||[],e.password||delete e.password,e.email_verified_at=e.email_verified_at?new Date:null,e}sendEmailConfirmation(){this.loading$.next(!0),this.auth.resendEmailConfirmation(this.data.user.email).pipe((0,gt.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open("Verification email re-sent.")},e=>{this.toast.open(e.message||Gs.v.Default)})}shouldShowResendButton(){return this.data.user&&this.data.user.id&&this.settings.get("require_email_confirmation")&&!this.form.get("email_verified_at").value}avatarUploadConfig(){return{uri:this.data.user?`users/${this.data.user.id}/avatar`:js.C.Image,httpParams:{diskPrefix:"avatars"},validator:this.avatarValidator}}generateNewPassword(){this.form.patchValue({password:(0,dn.O)(15)})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(m.so),o.Y36(m.WI),o.Y36(en.Q),o.Y36(mt.F),o.Y36(on.I),o.Y36(a.qu),o.Y36(Xs.e),o.Y36(st.Z),o.Y36(Ws.m))},e.\u0275cmp=o.Xpm({type:e,selectors:[["crupdate-user-modal"]],decls:7,vars:5,consts:[[1,"modal-header"],["class","modal-title","mat-dialog-title","","trans","",4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["autocomplete","off","ngNativeValidate","",3,"formGroup","ngSubmit",4,"ngIf"],["mat-dialog-title","","trans","",1,"modal-title"],["autocomplete","off","ngNativeValidate","",3,"formGroup","ngSubmit"],[1,"many-inputs"],["class","input-container",4,"ngIf"],[1,"avatar-container"],[1,"input-container","avatar-input-container"],["formControlName","avatar",1,"inherit-size",3,"uploadConfig"],["class","error",4,"ngIf"],[1,"input-container"],["for","crupdate-user-first_name","trans",""],["type","text","id","crupdate-user-first_name","formControlName","first_name"],["for","crupdate-user-last_name","trans",""],["type","text","id","crupdate-user-last_name","formControlName","last_name"],["for","crupdate-user-confirmed","trans",""],[1,"confirmed-select-wrapper"],["id","crupdate-user-confirmed","formControlName","email_verified_at"],["trans","",3,"ngValue"],["mat-flat-button","","color","accent","type","button","trans","",1,"resend-confirmation-button",3,"disabled","click"],["for","crupdate-user-new-password","trans",""],[1,"input-with-action"],["type","text","id","crupdate-user-new-password","formControlName","password"],["type","button","mat-flat-button","","color","accent","trans","",3,"click"],["label","Available Space","formControlName","available_space"],["trans","",1,"description"],["formControlName","roles"],["formControlName","permissions",4,"ngIf"],["mat-dialog-actions","",1,"buttons","right","mat-dialog-actions"],["type","button","mat-button","","trans","",1,"button","cancel",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary",3,"disabled"],["trans","",4,"ngIf"],["for","crupdate-user-email","trans",""],["type","email","id","crupdate-user-email","formControlName","email","required",""],[1,"error"],["for","crupdate-user-password","trans",""],["type","password","id","crupdate-user-password","formControlName","password","required",""],["formControlName","permissions"],["trans",""]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.YNc(1,zo,2,0,"h2",1),o.YNc(2,Bo,2,0,"h2",1),o.TgZ(3,"button",2),o.NdJ("click",function(){return t.close()}),o._UZ(4,"mat-icon",3),o.qZA(),o.qZA(),o.YNc(5,cr,54,24,"form",4),o.ALo(6,"async")),2&e&&(o.xp6(1),o.Q6J("ngIf",t.data.user),o.xp6(1),o.Q6J("ngIf",!t.data.user),o.xp6(3),o.Q6J("ngIf",o.lcZ(6,3,t.errors$)))},directives:[i.O5,O.Hw,m.uh,Zt.P,a.JL,a.sg,m.xY,Zo,a.JJ,a.u,a.Fj,a.EJ,a.YN,a.Kr,g.lW,_s,Io,m.H8,a.Q7,Ho],pipes:[i.Ov],styles:["[_nghost-%COMP%]{display:block;width:500px;max-width:100%}.avatar-container[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:20px}.avatar-container[_ngcontent-%COMP%]   .many-inputs[_ngcontent-%COMP%]{flex:1 1 auto}.avatar-container[_ngcontent-%COMP%]   .input-container[_ngcontent-%COMP%]:last-of-type{margin-bottom:0}.avatar-input-container[_ngcontent-%COMP%]{flex-shrink:0;width:170px;height:170px;margin-right:15px}.resend-confirmation-button[_ngcontent-%COMP%]{display:none}.resend-button-visible[_ngcontent-%COMP%]   .confirmed-select-wrapper[_ngcontent-%COMP%]{display:flex}.resend-button-visible[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{flex:1;border-top-right-radius:0;border-bottom-right-radius:0;border-right:none}.resend-button-visible[_ngcontent-%COMP%]   .resend-confirmation-button[_ngcontent-%COMP%]{display:block;border-top-left-radius:0;border-bottom-left-radius:0}"],changeDetection:0}),e})();const ur=[new $t({type:Vt.Select,key:"email_verified_at",label:"Email",description:"Email verification status",defaultValue:{value:null,operator:Ht.ne},defaultOperator:Ht.ne,options:[{key:"Confirmed",value:{value:null,operator:Ht.ne}},{key:"Not Confirmed",value:{value:null,operator:Ht.eq}}]}),new jt({description:"Date user registered or was created"}),new Gt({description:"Date user was last updated"}),new $t({type:Vt.Select,key:"subscriptions",label:"Subscribed",description:"Whether user is subscribed or not",defaultValue:{value:"*",operator:Ht.has},defaultOperator:Ht.ne,options:[{key:"Yes",value:{value:"*",operator:Ht.has}},{key:"No",value:{value:"*",operator:Ht.doesntHave}}]})];var gr=n(3412);let pr=(()=>{class e{constructor(e){this.dialogRef=e}close(){this.dialogRef.close()}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(m.so))},e.\u0275cmp=o.Xpm({type:e,selectors:[["csv-export-info-dialog"]],decls:13,vars:0,consts:[[1,"modal-header"],["mat-dialog-title","",1,"modal-title"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["mat-dialog-content","",1,"mat-dialog-contents"],[1,"message-container"],["svgIcon","check","color","su",1,"success-icon"],["trans",""],["mat-dialog-actions","",1,"buttons","right","mat-dialog-actions"],["mat-raised-button","","color","accent","cdkFocusInitial","","trans","",1,"button","primary","submit-button",3,"click"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"h2",1),o._uU(2,"CSV Export"),o.qZA(),o.TgZ(3,"button",2),o.NdJ("click",function(){return t.close()}),o._UZ(4,"mat-icon",3),o.qZA(),o.qZA(),o.TgZ(5,"div",4),o.TgZ(6,"div",5),o._UZ(7,"mat-icon",6),o.TgZ(8,"div",7),o._uU(9," Your request is being processed. We'll email you when the report is ready to download. In certain cases, it might take a little longer, depending on the number of items beings exported and the volume of activity. "),o.qZA(),o.qZA(),o.qZA(),o.TgZ(10,"div",8),o.TgZ(11,"button",9),o.NdJ("click",function(){return t.close()}),o._uU(12," Got it "),o.qZA(),o.qZA())},directives:[m.uh,O.Hw,m.xY,Zt.P,m.H8,g.lW],styles:["[_nghost-%COMP%]{display:block;max-width:500px}.modal-header[_ngcontent-%COMP%]{margin-bottom:10px}.message-container[_ngcontent-%COMP%]{display:flex;align-items:flex-start;margin-bottom:10px}.success-icon[_ngcontent-%COMP%]{color:#43a047;margin-right:10px;flex-shrink:0}"],changeDetection:0}),e})(),hr=(()=>{class e{constructor(e,t){this.http=e,this.modal=t}export(e,t={}){return this.http.post(e,t).subscribe(e=>{e.downloadPath?(0,gr.k)(e.downloadPath):this.modal.open(pr)})}}return e.\u0275fac=function(t){return new(t||e)(o.LFG(r.r),o.LFG(ft.u))},e.\u0275prov=o.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function mr(e,t){1&e&&o._UZ(0,"mat-progress-bar",22)}function fr(e,t){1&e&&(o.TgZ(0,"th",1),o._uU(1,"Subscribed"),o.qZA())}function _r(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",27),o.NdJ("click",function(){return o.CHM(e),o.oxw(2).maybeDeleteSelectedUsers()}),o._uU(1," Delete "),o.qZA()}}const br=function(e){return{count:e,resource:"user(s)"}};function vr(e,t){if(1&e&&(o.TgZ(0,"tr"),o.TgZ(1,"th",23),o.TgZ(2,"div",24),o._uU(3," :count :resource selected: "),o.qZA(),o.TgZ(4,"div",25),o.YNc(5,_r,2,0,"button",26),o.qZA(),o.qZA(),o.qZA()),2&e){const e=t.ngIf,n=o.oxw();o.xp6(2),o.Q6J("transValues",o.VKq(2,br,e)),o.xp6(3),o.Q6J("ngIf",n.currentUser.hasPermission("users.delete"))}}function Zr(e,t){if(1&e&&(o.TgZ(0,"td",36),o._uU(1),o.qZA()),2&e){const e=o.oxw().$implicit;o.xp6(1),o.hij(" ",null!=e.subscriptions&&e.subscriptions.length?"Yes":"No"," ")}}function xr(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",37),o.NdJ("click",function(){o.CHM(e);const t=o.oxw().$implicit;return o.oxw().showCrupdateUserModal(t)}),o.ALo(1,"trans"),o._UZ(2,"mat-icon",38),o.qZA()}2&e&&o.Q6J("matTooltip",o.lcZ(1,1,"Edit user"))}function Ar(e,t){if(1&e&&(o.TgZ(0,"tr"),o._UZ(1,"td",28),o.TgZ(2,"td"),o._UZ(3,"user-column",29),o.qZA(),o.YNc(4,Zr,2,1,"td",30),o.TgZ(5,"td",31),o._uU(6),o.qZA(),o.TgZ(7,"td",32),o._uU(8),o.qZA(),o.TgZ(9,"td",33),o._uU(10),o.qZA(),o.TgZ(11,"td"),o._uU(12),o.ALo(13,"formattedDate"),o.qZA(),o.TgZ(14,"td",34),o.YNc(15,xr,3,3,"button",35),o.qZA(),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.xp6(1),o.Q6J("table-body-checkbox",e.id),o.xp6(2),o.Q6J("user",e),o.xp6(1),o.Q6J("ngIf",n.settings.get("billing.enable")),o.xp6(2),o.Oqu(n.makeRolesList(e.roles)),o.xp6(2),o.Oqu(e.first_name||"-"),o.xp6(2),o.Oqu(e.last_name||"-"),o.xp6(2),o.Oqu(o.lcZ(13,8,e.created_at)),o.xp6(3),o.Q6J("ngIf",n.currentUser.hasPermission("users.update"))}}function yr(e,t){1&e&&(o.TgZ(0,"no-results-message",39),o.TgZ(1,"span",40),o._uU(2,"No users have been created yet"),o.qZA(),o.qZA())}let wr=(()=>{class e{constructor(e,t,n,i,a,s){this.userService=e,this.currentUser=t,this.settings=n,this.toast=i,this.datatable=a,this.csv=s,this.filters=ur,this.users$=this.datatable.data$}ngOnInit(){this.datatable.init({uri:en.Q.BASE_URI,staticParams:{with:["subscriptions"]}})}ngOnDestroy(){this.datatable.destroy()}makeRolesList(e){return e.slice(0,3).map(e=>e.name).join(", ")}maybeDeleteSelectedUsers(){this.datatable.confirmResourceDeletion("users").subscribe(()=>{this.userService.delete(this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset(),this.toast.open("Deleted selected users")},e=>{this.toast.open(e.message||Gs.v.Default)})})}showCrupdateUserModal(e){this.datatable.openCrupdateResourceModal(dr,{user:e}).subscribe()}exportCsv(){this.csv.export(en.Q.EXPORT_CSV_URI)}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(en.Q),o.Y36(on.I),o.Y36(st.Z),o.Y36(mt.F),o.Y36(Lt),o.Y36(hr))},e.\u0275cmp=o.Xpm({type:e,selectors:[["user-index"]],features:[o._Bn([Lt])],decls:46,vars:13,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","users",3,"filters"],[1,"action-buttons"],["mat-raised-button","",1,"btn-with-dropdown-icon",3,"matMenuTriggerFor"],["svgIcon","keyboard-arrow-down"],["menu","matMenu"],["mat-menu-item","",3,"click"],["svgIcon","export-csv"],["mat-raised-button","","color","accent",1,"button-with-icon",3,"click"],["svgIcon","add"],[1,"datatable","responsive-table"],["class","loading-bar","mode","indeterminate","color","accent",4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","email","trans",""],["trans","",4,"ngIf"],["table-sort-header","","trans",""],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","people.svg",4,"ngIf"],["mode","indeterminate","color","accent",1,"loading-bar"],["colspan","8"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["mat-raised-button","","color","warn","trans","",3,"click",4,"ngIf"],["mat-raised-button","","color","warn","trans","",3,"click"],[3,"table-body-checkbox"],[3,"user"],["data-label","Subscribed",4,"ngIf"],["data-label","Roles"],["data-label","First Name"],["data-label","Last Name"],[1,"edit-column"],["mat-icon-button","",3,"matTooltip","click",4,"ngIf"],["data-label","Subscribed"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","edit"],["svgImage","people.svg"],["primary-text","","trans",""]],template:function(e,t){if(1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"h1",1),o._uU(2,"Users"),o.qZA(),o.TgZ(3,"div",2),o._UZ(4,"datatable-filters",3),o.TgZ(5,"div",4),o.TgZ(6,"button",5),o.TgZ(7,"span",1),o._uU(8,"More Actions"),o.qZA(),o._UZ(9,"mat-icon",6),o.qZA(),o.TgZ(10,"mat-menu",null,7),o.TgZ(12,"button",8),o.NdJ("click",function(){return t.exportCsv()}),o._UZ(13,"mat-icon",9),o.TgZ(14,"span",1),o._uU(15,"Export users in CSV"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(16,"button",10),o.NdJ("click",function(){return t.showCrupdateUserModal()}),o._UZ(17,"mat-icon",11),o.TgZ(18,"span",1),o._uU(19,"Add New User"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(20,"div",12),o.YNc(21,mr,1,0,"mat-progress-bar",13),o.ALo(22,"async"),o.TgZ(23,"table",14),o.TgZ(24,"thead"),o.TgZ(25,"tr"),o._UZ(26,"th",15),o.TgZ(27,"th",16),o._uU(28,"User"),o.qZA(),o.YNc(29,fr,2,0,"th",17),o.TgZ(30,"th",1),o._uU(31,"Roles"),o.qZA(),o.TgZ(32,"th",18),o._uU(33,"First Name"),o.qZA(),o.TgZ(34,"th",18),o._uU(35,"Last Name"),o.qZA(),o.TgZ(36,"th",18),o._uU(37,"Created At"),o.qZA(),o._UZ(38,"th"),o.qZA(),o.YNc(39,vr,6,4,"tr",19),o.qZA(),o.TgZ(40,"tbody"),o.YNc(41,Ar,16,10,"tr",20),o.ALo(42,"async"),o.qZA(),o.qZA(),o.YNc(43,yr,3,0,"no-results-message",21),o.ALo(44,"async"),o._UZ(45,"datatable-footer"),o.qZA()),2&e){const e=o.MAs(11);o.xp6(4),o.Q6J("filters",t.filters),o.xp6(2),o.Q6J("matMenuTriggerFor",e),o.xp6(15),o.Q6J("ngIf",o.lcZ(22,7,t.datatable.paginator&&t.datatable.paginator.loading$)),o.xp6(8),o.Q6J("ngIf",t.settings.get("billing.enable")),o.xp6(10),o.Q6J("ngIf",t.datatable.selectedRows$.value.length),o.xp6(2),o.Q6J("ngForOf",o.lcZ(42,9,t.users$)),o.xp6(2),o.Q6J("ngIf",o.lcZ(44,11,t.datatable.paginator.noResults$))}},directives:[Zt.P,Ln,g.lW,C.p6,O.Hw,C.VK,C.OP,i.O5,Vn,Gn,i.sg,Kn,s.pW,ti,ii,k.gM,ai.U],pipes:[i.Ov,si.l,lt.R],styles:[".mat-column-permissions[_ngcontent-%COMP%]{max-height:49px}.mat-column-email[_ngcontent-%COMP%]{margin-right:15px}"],changeDetection:0}),e})();class Cr{constructor(e={}){for(const t in e)this[t]=e[t]}}function Tr(e,t){1&e&&(o.TgZ(0,"h2",5),o._uU(1,"Update Role"),o.qZA())}function qr(e,t){1&e&&(o.TgZ(0,"h2",5),o._uU(1,"Create a New Role"),o.qZA())}function kr(e,t){if(1&e&&(o.TgZ(0,"div",21),o._uU(1),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(1),o.Oqu(e.name)}}function Mr(e,t){1&e&&(o.TgZ(0,"div",8),o.TgZ(1,"label",22),o._uU(2,"Type"),o.qZA(),o.TgZ(3,"select",23),o.TgZ(4,"option",24),o._uU(5,"Site Wide"),o.qZA(),o.TgZ(6,"option",25),o._uU(7,"Workspace"),o.qZA(),o.qZA(),o.qZA())}function Ir(e,t){if(1&e&&(o.TgZ(0,"div",21),o._uU(1),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(1),o.Oqu(null==e?null:e.permissions)}}function Ur(e,t){if(1&e&&(o.TgZ(0,"div",21),o._uU(1),o.qZA()),2&e){const e=o.oxw(2).ngIf;o.xp6(1),o.Oqu(e.default)}}function Jr(e,t){if(1&e&&(o.TgZ(0,"div",21),o._uU(1),o.qZA()),2&e){const e=o.oxw(3).ngIf;o.xp6(1),o.Oqu(e.guests)}}function Dr(e,t){if(1&e&&(o.TgZ(0,"div",26),o.TgZ(1,"mat-slide-toggle",30),o._uU(2,"Guests"),o.qZA(),o.TgZ(3,"p",28),o._uU(4,"Assign this role to guests (not logged in users)."),o.qZA(),o.YNc(5,Jr,2,1,"div",11),o.qZA()),2&e){const e=o.oxw(2).ngIf;o.xp6(5),o.Q6J("ngIf",e.guests)}}function Or(e,t){if(1&e&&(o.ynx(0),o.TgZ(1,"div",26),o.TgZ(2,"mat-slide-toggle",27),o._uU(3,"Default"),o.qZA(),o.TgZ(4,"p",28),o._uU(5,"Assign this role to new users automatically."),o.qZA(),o.YNc(6,Ur,2,1,"div",11),o.qZA(),o.YNc(7,Dr,6,1,"div",29),o.BQk()),2&e){const e=o.oxw().ngIf,t=o.oxw();o.xp6(6),o.Q6J("ngIf",e.default),o.xp6(1),o.Q6J("ngIf","sitewide"===t.form.get("type").value)}}function Pr(e,t){1&e&&(o.TgZ(0,"span",28),o._uU(1,"Update"),o.qZA())}function Sr(e,t){1&e&&(o.TgZ(0,"span",28),o._uU(1,"Create"),o.qZA())}function Nr(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"form",6),o.NdJ("submit",function(){return o.CHM(e),o.oxw().confirm()}),o.TgZ(1,"div",7),o.TgZ(2,"div",8),o.TgZ(3,"label",9),o._uU(4,"Name"),o.qZA(),o._UZ(5,"input",10),o.YNc(6,kr,2,1,"div",11),o.qZA(),o.TgZ(7,"div",8),o.TgZ(8,"label",12),o._uU(9,"Description"),o.qZA(),o._UZ(10,"textarea",13),o.qZA(),o.YNc(11,Mr,8,0,"div",14),o._UZ(12,"permission-manager",15),o.YNc(13,Ir,2,1,"div",11),o.YNc(14,Or,8,2,"ng-container",16),o.qZA(),o.TgZ(15,"div",17),o.TgZ(16,"button",18),o.NdJ("click",function(){return o.CHM(e),o.oxw().close()}),o._uU(17,"Cancel"),o.qZA(),o.TgZ(18,"button",19),o.ALo(19,"async"),o.YNc(20,Pr,2,0,"span",20),o.YNc(21,Sr,2,0,"span",20),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=t.ngIf,n=o.oxw();o.Q6J("formGroup",n.form),o.xp6(6),o.Q6J("ngIf",e.name),o.xp6(5),o.Q6J("ngIf",n.settings.get("workspaces.integrated")),o.xp6(1),o.Q6J("valueListKey","workspace"===n.form.get("type").value?"workspacePermissions":"permissions")("hideRestrictions",null==n.data||null==n.data.role?null:n.data.role.guests),o.xp6(1),o.Q6J("ngIf",null==e?null:e.permissions),o.xp6(1),o.Q6J("ngIf",!(null!=n.data.role&&n.data.role.internal)),o.xp6(4),o.Q6J("disabled",o.lcZ(19,10,n.loading$)),o.xp6(2),o.Q6J("ngIf",n.data.role),o.xp6(1),o.Q6J("ngIf",!n.data.role)}}let Qr=(()=>{class e{constructor(e,t,n,i,a,s,o){this.toast=e,this.roleService=t,this.modal=n,this.fb=i,this.dialogRef=a,this.settings=s,this.data=o,this.form=this.fb.group({name:[""],description:[""],type:["sitewide"],default:[!1],guests:[!1],permissions:[]}),this.loading$=new pt.X(!1),this.errors$=new pt.X({})}ngOnInit(){this.resetState(),this.data.role&&this.form.patchValue(this.data.role)}close(e){this.resetState(),this.dialogRef.close(e)}confirm(){let e;this.loading$.next(!0),e=this.data.role?this.roleService.update(this.data.role.id,this.form.value):this.roleService.createNew(this.form.value),e.pipe((0,gt.x)(()=>this.loading$.next(!1))).subscribe(e=>{this.toast.open("Role "+(this.data.role?"Updated":"Created")),this.close(e.data)},e=>this.errors$.next(e.errors))}resetState(){this.form.reset(),this.errors$.next({})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(mt.F),o.Y36(yo),o.Y36(ft.u),o.Y36(a.qu),o.Y36(m.so),o.Y36(st.Z),o.Y36(m.WI))},e.\u0275cmp=o.Xpm({type:e,selectors:[["crupdate-role-modal"]],decls:7,vars:5,consts:[[1,"modal-header"],["class","modal-title mat-dialog-title","mat-dialog-title","","trans","",4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["autocomplete","off","ngNativeValidate","",3,"formGroup","submit",4,"ngIf"],["mat-dialog-title","","trans","",1,"modal-title","mat-dialog-title"],["autocomplete","off","ngNativeValidate","",3,"formGroup","submit"],["mat-dialog-content","",1,"many-inputs","mat-dialog-content"],[1,"input-container"],["for","name","trans",""],["type","text","formControlName","name","id","name","required",""],["class","error",4,"ngIf"],["for","description","trans",""],["type","text","id","description","formControlName","description","maxlength","190"],["class","input-container",4,"ngIf"],["formControlName","permissions",3,"valueListKey","hideRestrictions"],[4,"ngIf"],["mat-dialog-actions","",1,"buttons","right","mat-dialog-actions"],["type","button","mat-button","","trans","",1,"button","cancel",3,"click"],["type","submit","mat-raised-button","","color","accent",3,"disabled"],["trans","",4,"ngIf"],[1,"error"],["for","type","trans",""],["id","type","formControlName","type"],["value","sitewide","trans",""],["value","workspace","trans",""],[1,"setting-container"],["formControlName","default","id","default","trans",""],["trans",""],["class","setting-container",4,"ngIf"],["id","guest","formControlName","guests","trans",""]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.YNc(1,Tr,2,0,"h2",1),o.YNc(2,qr,2,0,"h2",1),o.TgZ(3,"button",2),o.NdJ("click",function(){return t.close()}),o._UZ(4,"mat-icon",3),o.qZA(),o.qZA(),o.YNc(5,Nr,22,12,"form",4),o.ALo(6,"async")),2&e&&(o.xp6(1),o.Q6J("ngIf",t.data.role),o.xp6(1),o.Q6J("ngIf",!t.data.role),o.xp6(3),o.Q6J("ngIf",o.lcZ(6,3,t.errors$)))},directives:[i.O5,O.Hw,m.uh,Zt.P,a.JL,a.sg,m.xY,a.Fj,a.JJ,a.u,a.Q7,a.nD,Ho,m.H8,g.lW,a.EJ,a.YN,a.Kr,T.Rr],pipes:[i.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}.setting-container[_ngcontent-%COMP%]{margin-bottom:25px}.setting-container[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{color:var(--be-secondary-text);margin:5px 0}"],changeDetection:0}),e})();const Yr=[{originX:"start",originY:"center",overlayX:"end",overlayY:"center",offsetX:50},{originX:"end",originY:"center",overlayX:"start",overlayY:"center",offsetX:50}];var Fr=n(2100),Rr=n(7310);function Er(e,t){1&e&&o.GkF(0)}let Lr=(()=>{class e{constructor(e,t){this.data=e,this.overlayPanelRef=t}close(){this.overlayPanelRef.close()}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Fr.p),o.Y36(Rr.L))},e.\u0275cmp=o.Xpm({type:e,selectors:[["datatable-filters-panel"]],hostVars:1,hostBindings:function(e,t){2&e&&o.d8E("@dialogContainer","enter")},decls:9,vars:1,consts:[["svgIcon","filter-list"],["trans",""],[1,"body",3,"ngSubmit"],[4,"ngTemplateOutlet"],["type","button","mat-button","","color","accent","trans","",3,"click"]],template:function(e,t){1&e&&(o.TgZ(0,"header"),o._UZ(1,"mat-icon",0),o.TgZ(2,"span",1),o._uU(3,"Filters"),o.qZA(),o.qZA(),o.TgZ(4,"form",2),o.NdJ("ngSubmit",function(){return t.close()}),o.YNc(5,Er,1,0,"ng-container",3),o.qZA(),o.TgZ(6,"footer"),o.TgZ(7,"button",4),o.NdJ("click",function(){return t.close()}),o._uU(8,"Close"),o.qZA(),o.qZA()),2&e&&(o.xp6(5),o.Q6J("ngTemplateOutlet",t.data.filters))},directives:[O.Hw,Zt.P,a._Y,a.JL,a.F,i.tP,g.lW],styles:["[_nghost-%COMP%]{display:block;min-width:250px;margin:auto;background-color:var(--be-background);border-radius:4px;box-shadow:0 8px 9px -5px #0003,0 15px 22px 2px #00000024,0 6px 28px 5px #0000001f}header[_ngcontent-%COMP%]{border-bottom:1px solid var(--be-divider-default);padding:15px 20px;margin-bottom:20px;font-weight:500}header[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{vertical-align:middle;margin-right:5px}.body[_ngcontent-%COMP%]{padding-left:20px;padding-right:20px}footer[_ngcontent-%COMP%]{border-top:1px solid var(--be-divider-default);text-align:right;margin-top:10px;padding:10px 20px}"],data:{animation:[m.Nv.dialogContainer]},changeDetection:0}),e})();var $r=n(7964);function Vr(e,t){1&e&&o._UZ(0,"mat-icon",3)}let Hr=(()=>{class e{constructor(e){this.datatable=e,this.hideIcon=!1}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Lt))},e.\u0275cmp=o.Xpm({type:e,selectors:[["datatable-header-search-input"]],inputs:{placeholder:"placeholder",hideIcon:"hideIcon"},decls:4,vars:5,consts:[[1,"input-container","search-input-container"],["type","text",1,"search-input",3,"placeholder","formControl"],["svgIcon","search",4,"ngIf"],["svgIcon","search"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o._UZ(1,"input",1),o.ALo(2,"trans"),o.YNc(3,Vr,1,0,"mat-icon",2),o.qZA()),2&e&&(o.xp6(1),o.Q6J("placeholder",o.lcZ(2,3,t.placeholder))("formControl",t.datatable.searchControl),o.xp6(2),o.Q6J("ngIf",!t.hideIcon))},directives:[a.Fj,a.JJ,a.oH,i.O5,O.Hw],pipes:[lt.R],styles:[".input-container[_ngcontent-%COMP%]{min-width:250px;position:relative;flex-shrink:0}.input-container[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{position:absolute;top:calc(50% - 12px);right:5px;color:var(--be-secondary-text)}.icon-left[_nghost-%COMP%]   .mat-icon[_ngcontent-%COMP%], .icon-left   [_nghost-%COMP%]   .mat-icon[_ngcontent-%COMP%]{left:10px;right:0}"],changeDetection:0}),e})(),zr=(()=>{class e extends i.rS{transform(e){return e?super.transform(e.replace("-"," ").replace("_"," ")):""}}return e.\u0275fac=function(){let t;return function(n){return(t||(t=o.n5z(e)))(n||e)}}(),e.\u0275pipe=o.Yjl({name:"titleCase",type:e,pure:!0}),e})();const Br=["tableFilters"],jr=["filterButton"];function Gr(e,t){1&e&&o._UZ(0,"mat-progress-bar",7)}function Xr(e,t){1&e&&(o.TgZ(0,"div",8),o.Hsn(1),o.qZA())}const Wr=function(e,t){return{count:e,resource:t}};function Kr(e,t){if(1&e&&(o.TgZ(0,"div",9),o._uU(1),o.ALo(2,"trans"),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.hij(" ",o.xi3(2,1,":count :resource selected",o.WLB(4,Wr,e.numberOfRowsSelected,e.pluralResourceName))," ")}}function el(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-chip",18),o.NdJ("removed",function(){const t=o.CHM(e).$implicit;return o.oxw(3).datatable.removeFilter(t.key)}),o._uU(1),o.ALo(2,"trans"),o.ALo(3,"titleCase"),o._UZ(4,"mat-icon",19),o.qZA()}if(2&e){const e=t.$implicit,n=o.oxw(3);o.Q6J("removable",!0)("selectable",!1),o.xp6(1),o.AsE(" ",o.lcZ(2,4,o.lcZ(3,6,e.key)),": ",n.isModel(e.value)?e.value.name||e.value.display_name:e.value," ")}}function tl(e,t){if(1&e){const e=o.EpF();o.ynx(0),o.TgZ(1,"mat-chip-list",13),o.YNc(2,el,5,8,"mat-chip",14),o.ALo(3,"keyvalue"),o.ALo(4,"async"),o.qZA(),o.TgZ(5,"button",15,16),o.NdJ("click",function(){return o.CHM(e),o.oxw(2).openFiltersPanel()}),o._UZ(7,"mat-icon",17),o.qZA(),o.BQk()}if(2&e){const e=o.oxw(2);o.xp6(2),o.Q6J("ngForOf",o.lcZ(3,3,o.lcZ(4,5,e.filters$))),o.xp6(3),o.ekj("active",e.filterPanelRef)}}function nl(e,t){if(1&e&&(o.TgZ(0,"div",10),o.YNc(1,tl,8,7,"ng-container",11),o._UZ(2,"datatable-header-search-input",12),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("ngIf",e.filterPanelTemplate),o.xp6(1),o.MGl("placeholder","Search ",e.pluralResourceName,"")}}function il(e,t){1&e&&(o.TgZ(0,"div",20),o.Hsn(1,1),o.qZA())}const al=[[["","leftContent",""]],[["","rightContent",""]]],sl=["[leftContent]","[rightContent]"];let ol=(()=>{class e{constructor(e,t,n){this.datatable=e,this.cd=t,this.overlayPanel=n,this.showSelectedActions=!0,this.subscriptions=[],this.filters$=this.datatable.filters$.pipe((0,Dt.U)(e=>{const t=(0,St.N)(e);return delete t.query,t}))}ngOnInit(){const e=this.datatable.filters$.subscribe(()=>{this.filterPanelRef&&this.filterPanelRef.close()}),t=this.datatable.selectedRows$.subscribe(e=>{this.numberOfRowsSelected=e.length,this.cd.markForCheck()});this.subscriptions=[e,t]}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}openFiltersPanel(){if(this.filterPanelRef)this.filterPanelRef.close();else{const e=Yr.slice();e[0].offsetY=40,e[1].offsetY=40,this.filterPanelRef=this.overlayPanel.open(Lr,{origin:this.filterButton,position:e,mobilePosition:"center",data:{filters:this.filterPanelTemplate},maxWidth:"90%"}),this.filterButton.nativeElement.classList.add("active"),this.filterPanelRef.afterClosed().subscribe(()=>{this.filterPanelRef=null,this.filterButton.nativeElement.classList.remove("active")})}}isModel(e){return"object"==typeof e&&e.id}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Lt),o.Y36(o.sBO),o.Y36($r.T))},e.\u0275cmp=o.Xpm({type:e,selectors:[["datatable-header"]],contentQueries:function(e,t,n){if(1&e&&o.Suo(n,Br,5),2&e){let e;o.iGM(e=o.CRH())&&(t.filterPanelTemplate=e.first)}},viewQuery:function(e,t){if(1&e&&o.Gf(jr,5,o.SBq),2&e){let e;o.iGM(e=o.CRH())&&(t.filterButton=e.first)}},hostVars:2,hostBindings:function(e,t){2&e&&o.ekj("rows-selected",t.numberOfRowsSelected)},inputs:{pluralResourceName:"pluralResourceName",showSelectedActions:"showSelectedActions"},ngContentSelectors:sl,decls:8,vars:7,consts:[["mode","indeterminate","color","accent",4,"ngIf"],[1,"left-column"],["class","default-left-content",4,"ngIf"],["class","selected-left-content capitalize",4,"ngIf"],[1,"right-column"],["class","default-right-content",4,"ngIf"],["class","selected-right-actions",4,"ngIf"],["mode","indeterminate","color","accent"],[1,"default-left-content"],[1,"selected-left-content","capitalize"],[1,"default-right-content"],[4,"ngIf"],[3,"placeholder"],["aria-label","Active Filters",1,"filter-chip-list"],[3,"removable","selectable","removed",4,"ngFor","ngForOf"],["mat-icon-button","",1,"filter-button",3,"click"],["filterButton",""],["svgIcon","filter-list"],[3,"removable","selectable","removed"],["matChipRemove","","svgIcon","cancel"],[1,"selected-right-actions"]],template:function(e,t){1&e&&(o.F$t(al),o.YNc(0,Gr,1,0,"mat-progress-bar",0),o.ALo(1,"async"),o.TgZ(2,"div",1),o.YNc(3,Xr,2,0,"div",2),o.YNc(4,Kr,3,7,"div",3),o.qZA(),o.TgZ(5,"div",4),o.YNc(6,nl,3,2,"div",5),o.YNc(7,il,2,0,"div",6),o.qZA()),2&e&&(o.Q6J("ngIf",o.lcZ(1,5,t.datatable.paginator&&t.datatable.paginator.loading$)),o.xp6(3),o.Q6J("ngIf",!t.showSelectedActions||!t.numberOfRowsSelected),o.xp6(1),o.Q6J("ngIf",t.showSelectedActions&&t.numberOfRowsSelected),o.xp6(2),o.Q6J("ngIf",!t.showSelectedActions||!t.numberOfRowsSelected),o.xp6(1),o.Q6J("ngIf",t.showSelectedActions&&t.numberOfRowsSelected))},directives:[i.O5,s.pW,Hr,h.qn,i.sg,g.lW,O.Hw,h.HS,h.qH],pipes:[i.Ov,lt.R,i.Nd,zr],styles:[".rows-selected[_nghost-%COMP%], .rows-selected   [_nghost-%COMP%]{background-color:var(--be-accent-emphasis);color:var(--be-secondary-text);font-size:1.5rem;border-color:var(--be-divider-default)}[_nghost-%COMP%]{display:flex;align-items:center;height:85px;padding:15px;border-bottom:1px solid #0000;position:relative}.mat-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0}.left-column[_ngcontent-%COMP%]{margin-right:auto}.right-column[_ngcontent-%COMP%]{margin-left:25px}.default-right-content[_ngcontent-%COMP%]{display:flex;align-items:center}.filter-button[_ngcontent-%COMP%]{margin-right:10px}.active[_ngcontent-%COMP%]{color:var(--be-accent-default)}.mat-chip[_ngcontent-%COMP%]{text-transform:capitalize}  datatable-header info-popover{margin-left:10px}"],changeDetection:0}),e})();function rl(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",15),o.NdJ("click",function(){return o.CHM(e),o.oxw().showCrupdateRoleModal()}),o._uU(1,"New Role"),o.qZA()}}function ll(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",22),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw(2).selectRole(t)}),o.ALo(1,"async"),o._uU(2),o.qZA()}if(2&e){const e=t.$implicit,n=o.oxw(2);o.ekj("selected",o.lcZ(1,3,n.selectedRole$).id===e.id),o.xp6(2),o.Oqu(e.name)}}function cl(e,t){if(1&e&&(o.ynx(0),o.TgZ(1,"button",16),o.TgZ(2,"span",17),o._uU(3),o.ALo(4,"async"),o.qZA(),o._UZ(5,"mat-icon",18),o.qZA(),o.TgZ(6,"mat-menu",19,20),o.YNc(8,ll,3,5,"button",21),o.ALo(9,"async"),o.qZA(),o.BQk()),2&e){const e=o.MAs(7),t=o.oxw();o.xp6(1),o.Q6J("matMenuTriggerFor",e),o.xp6(2),o.Oqu(o.lcZ(4,3,t.selectedRole$).name),o.xp6(5),o.Q6J("ngForOf",o.lcZ(9,5,t.roles$))}}function dl(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",32),o.NdJ("click",function(){o.CHM(e);const t=o.oxw().$implicit;return o.oxw(2).showCrupdateRoleModal(t)}),o._uU(1,"Edit"),o.qZA()}}function ul(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",32),o.NdJ("click",function(){o.CHM(e);const t=o.oxw().$implicit;return o.oxw(2).maybeDeleteRole(t)}),o._uU(1,"Delete"),o.qZA()}}function gl(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",25),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw(2).selectRole(t)}),o.ALo(1,"async"),o.TgZ(2,"div",17),o.TgZ(3,"div"),o._uU(4),o.qZA(),o.TgZ(5,"div",26),o._uU(6),o.qZA(),o.qZA(),o.TgZ(7,"div",27),o.TgZ(8,"button",28),o.NdJ("click",function(e){return e.stopPropagation()}),o._UZ(9,"mat-icon",29),o.qZA(),o.TgZ(10,"mat-menu",null,30),o.YNc(12,dl,2,0,"div",31),o.YNc(13,ul,2,0,"div",31),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=t.$implicit,n=o.MAs(11),i=o.oxw(2);o.ekj("selected",o.lcZ(1,7,i.selectedRole$).id===e.id),o.xp6(4),o.Oqu(e.name),o.xp6(2),o.Oqu(e.type),o.xp6(2),o.Q6J("matMenuTriggerFor",n),o.xp6(4),o.Q6J("ngIf",i.currentUser.hasPermission("roles.update")),o.xp6(1),o.Q6J("ngIf",!e.internal&&i.currentUser.hasPermission("roles.delete"))}}function pl(e,t){if(1&e&&(o.TgZ(0,"aside",23),o.YNc(1,gl,14,9,"div",24),o.ALo(2,"async"),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("ngForOf",o.lcZ(2,1,e.roles$))}}function hl(e,t){if(1&e){const e=o.EpF();o.ynx(0,33),o.TgZ(1,"button",34),o.NdJ("click",function(){return o.CHM(e),o.oxw().showAssignUsersModal()}),o._uU(2,"Assign Users"),o.qZA(),o.TgZ(3,"button",35),o.NdJ("click",function(){return o.CHM(e),o.oxw().maybeDetachUsers()}),o.ALo(4,"async"),o._uU(5,"Unassign Users"),o.qZA(),o.BQk()}if(2&e){const e=o.oxw();o.xp6(1),o.Q6J("disabled",!e.canAssignUsers()),o.xp6(2),o.Q6J("disabled",!o.lcZ(4,2,e.datatable.selectedRows$).length)}}function ml(e,t){if(1&e&&(o.TgZ(0,"tr"),o._UZ(1,"td",36),o.TgZ(2,"td",37),o._UZ(3,"user-column",38),o.qZA(),o.TgZ(4,"td",39),o._uU(5),o.qZA(),o.TgZ(6,"td",40),o._uU(7),o.qZA(),o.TgZ(8,"td",41),o._uU(9),o.ALo(10,"formattedDate"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Q6J("table-body-checkbox",e.id),o.xp6(2),o.Q6J("user",e),o.xp6(2),o.Oqu(e.first_name||"-"),o.xp6(2),o.Oqu(e.last_name||"-"),o.xp6(2),o.Oqu(o.lcZ(10,5,e.created_at))}}function fl(e,t){1&e&&(o.TgZ(0,"no-results-message",44),o.TgZ(1,"span",45),o._uU(2,"This role can't be assigned to users."),o.qZA(),o.qZA())}function _l(e,t){1&e&&(o.TgZ(0,"no-results-message",44),o.TgZ(1,"span",45),o._uU(2,"No users are assigned this role yet."),o.qZA(),o.qZA())}function bl(e,t){if(1&e&&(o.YNc(0,_l,3,0,"no-results-message",46),o.ALo(1,"async"),o.ALo(2,"async")),2&e){const e=o.oxw(2);o.Q6J("ngIf",o.lcZ(1,1,e.datatable.paginator.noResults$)&&!o.lcZ(2,3,e.datatable.paginator.loading$))}}function vl(e,t){if(1&e&&(o.ynx(0),o.YNc(1,fl,3,0,"no-results-message",42),o.YNc(2,bl,3,5,"ng-template",null,43,o.W1O),o.BQk()),2&e){const e=t.ngIf,n=o.MAs(3);o.xp6(1),o.Q6J("ngIf",e.guests||"sitewide"!==e.type)("ngIfElse",n)}}function Zl(e,t){1&e&&(o.TgZ(0,"no-results-message",44),o.TgZ(1,"span",45),o._uU(2,"No role selected."),o.qZA(),o.qZA())}let xl=(()=>{class e{constructor(e,t,n,i,a,s){this.roleApi=e,this.toast=t,this.modal=n,this.currentUser=i,this.breakpoints=a,this.datatable=s,this.roles$=new pt.X([]),this.users$=this.datatable.data$,this.selectedRole$=new pt.X(new Cr)}ngOnInit(){this.refreshRoles().then(()=>{var e;this.datatable.init({uri:en.Q.BASE_URI,staticParams:{role_id:null===(e=this.selectedRole$.value)||void 0===e?void 0:e.id}})})}selectRole(e){this.selectedRole$.value.id!==e.id&&(this.selectedRole$.next(e),this.refreshRoleUsers(e))}refreshRoles(){return new Promise(e=>{this.roleApi.getRoles().subscribe(t=>{if(this.roles$.next(t.pagination.data),this.roles$.value.length)if(this.selectedRole$.value.id){const e=this.roles$.value.find(e=>e.id===this.selectedRole$.value.id);e&&this.selectedRole$.next(e)}else this.selectRole(this.roles$.value[0]);e()})})}refreshRoleUsers(e){this.datatable.reset("sitewide"!==e.type||e.guests?{role_id:999}:{role_id:e.id})}showAssignUsersModal(){this.modal.open(nn).afterClosed().subscribe(e=>{e&&this.roleApi.addUsers(this.selectedRole$.value.id,[e.email]).subscribe(()=>{this.toast.open("User assigned to role"),this.refreshRoleUsers(this.selectedRole$.value)})})}showCrupdateRoleModal(e){this.modal.show(Qr,{role:e}).afterClosed().subscribe(e=>{e&&this.refreshRoles()})}maybeDeleteRole(e){this.modal.open(Nt.z,{title:"Delete Role",body:"Are you sure you want to delete this role?",ok:"Delete"}).afterClosed().subscribe(t=>{t&&this.deleteRole(e)})}deleteRole(e){this.roleApi.delete(e.id).subscribe(()=>{this.selectedRole$.next(new Cr),this.refreshRoles().then(()=>{this.refreshRoleUsers(this.selectedRole$.value)})})}maybeDetachUsers(){this.modal.show(Nt.z,{title:"Remove users from role",body:"Are you sure you want to remove selected users from this role?",ok:"Remove"}).afterClosed().subscribe(e=>{e&&this.removeUsersFromSelectedRole()})}removeUsersFromSelectedRole(){this.roleApi.removeUsers(this.selectedRole$.value.id,this.datatable.selectedRows$.value).subscribe(()=>{this.refreshRoleUsers(this.selectedRole$.value),this.datatable.selectedRows$.next([]),this.toast.open("Users removed from role.")})}canAssignUsers(){return this.selectedRole$.value.id&&!this.datatable.selectedRows$.value.length&&!this.selectedRole$.value.guests}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(yo),o.Y36(mt.F),o.Y36(ft.u),o.Y36(on.I),o.Y36(fn.S),o.Y36(Lt))},e.\u0275cmp=o.Xpm({type:e,selectors:[["role-index"]],features:[o._Bn([Lt])],decls:30,vars:14,consts:[[1,"admin-pill-nav"],[1,"new-role"],["mat-flat-button","","color","accent","class","new-role-button","trans","",3,"click",4,"ngIf"],[4,"ngIf","ngIfElse"],["desktopNav",""],[1,"datatable","responsive-table"],["pluralResourceName","roles",3,"showSelectedActions"],["leftContent","",4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","email","trans",""],["table-sort-header","","trans",""],["table-sort-header","created_at","trans",""],[4,"ngFor","ngForOf"],["noRoleSelected",""],["mat-flat-button","","color","accent","trans","",1,"new-role-button",3,"click"],[1,"no-style","admin-pill-nav-mobile-selector",3,"matMenuTriggerFor"],["trans","",1,"name"],["svgIcon","keyboard-arrow-down"],[1,"admin-pill-nav-menu"],["navMenu","matMenu"],["mat-menu-item","",3,"selected","click",4,"ngFor","ngForOf"],["mat-menu-item","",3,"click"],[1,"admin-pill-nav","rounded"],["class","nav-item",3,"selected","click",4,"ngFor","ngForOf"],[1,"nav-item",3,"click"],[1,"role-type"],[1,"actions"],["mat-icon-button","",3,"matMenuTriggerFor","click"],["svgIcon","settings"],["actionsMenu",""],["mat-menu-item","","trans","",3,"click",4,"ngIf"],["mat-menu-item","","trans","",3,"click"],["leftContent",""],["mat-raised-button","","color","accent","trans","",1,"assign-users-button",3,"disabled","click"],["mat-raised-button","","color","accent","trans","",3,"disabled","click"],[3,"table-body-checkbox"],[1,"mobile-no-label"],[3,"user"],["data-label","First Name"],["data-label","Last Name"],["data-label","Assigned At"],["svgImage","people.svg",4,"ngIf","ngIfElse"],["regularRole",""],["svgImage","people.svg"],["primary-text","","trans",""],["svgImage","people.svg",4,"ngIf"]],template:function(e,t){if(1&e&&(o.TgZ(0,"section",0),o.TgZ(1,"div",1),o.YNc(2,rl,2,0,"button",2),o.qZA(),o.YNc(3,cl,10,7,"ng-container",3),o.ALo(4,"async"),o.YNc(5,pl,3,3,"ng-template",null,4,o.W1O),o.qZA(),o.TgZ(7,"div",5),o.TgZ(8,"datatable-header",6),o.YNc(9,hl,6,4,"ng-container",7),o.qZA(),o.TgZ(10,"table",8),o.TgZ(11,"thead"),o.TgZ(12,"tr"),o._UZ(13,"th",9),o.TgZ(14,"th",10),o._uU(15,"User"),o.qZA(),o.TgZ(16,"th",11),o._uU(17,"First Name"),o.qZA(),o.TgZ(18,"th",11),o._uU(19,"Last Name"),o.qZA(),o.TgZ(20,"th",12),o._uU(21,"Assigned At"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(22,"tbody"),o.YNc(23,ml,11,7,"tr",13),o.ALo(24,"async"),o.qZA(),o.qZA(),o.YNc(25,vl,4,2,"ng-container",3),o.ALo(26,"async"),o.YNc(27,Zl,3,0,"ng-template",null,14,o.W1O),o._UZ(29,"datatable-footer"),o.qZA()),2&e){const e=o.MAs(6),n=o.MAs(28);o.xp6(2),o.Q6J("ngIf",t.currentUser.hasPermission("roles.create")),o.xp6(1),o.Q6J("ngIf",o.lcZ(4,8,t.breakpoints.isMobile$))("ngIfElse",e),o.xp6(5),o.Q6J("showSelectedActions",!1),o.xp6(1),o.Q6J("ngIf",t.currentUser.hasPermission("roles.update")),o.xp6(14),o.Q6J("ngForOf",o.lcZ(24,10,t.users$)),o.xp6(2),o.Q6J("ngIf",o.lcZ(26,12,t.selectedRole$))("ngIfElse",n)}},directives:[i.O5,ol,Vn,Gn,Zt.P,i.sg,Kn,g.lW,C.p6,O.Hw,C.VK,C.OP,ti,ii,ai.U],pipes:[i.Ov,si.l],styles:["[_nghost-%COMP%]{display:block}@media screen and (min-width: 768px){[_nghost-%COMP%]{display:flex}.new-role[_ngcontent-%COMP%]{border-bottom:1px solid var(--be-divider-default);margin-bottom:10px;padding-bottom:10px}}.datatable[_ngcontent-%COMP%]{flex:1 1 auto}.role-type[_ngcontent-%COMP%]{font-size:1.3rem;color:var(--be-secondary-text)}@media screen and (max-width: 768px){.admin-pill-nav[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;margin-bottom:20px}.admin-pill-nav-mobile-selector[_ngcontent-%COMP%]{margin-left:15px}.new-role-button[_ngcontent-%COMP%]{height:56px}}.assign-users-button[_ngcontent-%COMP%]{margin-right:5px}"],changeDetection:0}),e})();var Al=n(9538);function yl(e,t){1&e&&(o.TgZ(0,"span",6),o._uU(1,"Update Localization"),o.qZA())}function wl(e,t){1&e&&(o.TgZ(0,"span",6),o._uU(1,"Create Localization"),o.qZA())}function Cl(e,t){if(1&e&&(o.TgZ(0,"div",18),o._uU(1),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(1),o.Oqu(e.name)}}function Tl(e,t){if(1&e&&(o.TgZ(0,"option",19),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("value",e.code),o.xp6(1),o.Oqu(e.name)}}function ql(e,t){1&e&&(o.TgZ(0,"span",6),o._uU(1,"Update"),o.qZA())}function kl(e,t){1&e&&(o.TgZ(0,"span",6),o._uU(1,"Create"),o.qZA())}function Ml(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"form",7),o.NdJ("ngSubmit",function(){return o.CHM(e),o.oxw().confirm()}),o.TgZ(1,"mat-dialog-content",8),o.TgZ(2,"div",9),o.TgZ(3,"label",10),o._uU(4,"Name"),o.qZA(),o._UZ(5,"input",11),o.YNc(6,Cl,2,1,"div",12),o.qZA(),o.TgZ(7,"div",9),o.TgZ(8,"label",13),o._uU(9,"Language"),o.qZA(),o.TgZ(10,"select",14),o.YNc(11,Tl,2,2,"option",15),o.ALo(12,"async"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(13,"mat-dialog-actions"),o.TgZ(14,"button",16),o.NdJ("click",function(){return o.CHM(e),o.oxw().close()}),o._uU(15,"Cancel"),o.qZA(),o.TgZ(16,"button",17),o.ALo(17,"async"),o.YNc(18,ql,2,0,"span",2),o.YNc(19,kl,2,0,"span",2),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=t.ngIf,n=o.oxw();o.Q6J("formGroup",n.form),o.xp6(6),o.Q6J("ngIf",e.name),o.xp6(5),o.Q6J("ngForOf",o.lcZ(12,6,n.languages$)),o.xp6(5),o.Q6J("disabled",o.lcZ(17,8,n.loading$)),o.xp6(2),o.Q6J("ngIf",n.data.localization),o.xp6(1),o.Q6J("ngIf",!n.data.localization)}}let Il=(()=>{class e{constructor(e,t,n,i,a,s){this.fb=e,this.localizations=t,this.dialogRef=n,this.data=i,this.toast=a,this.lists=s,this.loading$=new pt.X(!1),this.errors$=new pt.X({}),this.languages$=new pt.X([]),this.form=this.fb.group({name:[""],language:[""]})}ngOnInit(){this.lists.get(["languages"]).subscribe(e=>{this.languages$.next(e.languages)}),this.data.localization&&this.form.patchValue(this.data.localization.model)}confirm(){this.loading$.next(!0),(this.data.localization?this.updateLocalization():this.createNewLocalization()).pipe((0,gt.x)(()=>this.loading$.next(!1))).subscribe(e=>{this.close(e.localization),this.toast.open("Localization "+(this.data.localization?"updated":"created"))},e=>this.errors$.next(e.errors))}close(e){this.dialogRef.close(e)}createNewLocalization(){return this.localizations.create(this.form.value)}updateLocalization(){return this.localizations.update(this.data.localization.model.id,this.form.value)}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(a.qu),o.Y36(Al.v),o.Y36(m.so),o.Y36(m.WI),o.Y36(mt.F),o.Y36(bt.l))},e.\u0275cmp=o.Xpm({type:e,selectors:[["crupdate-localization-modal"]],decls:8,vars:5,consts:[[1,"modal-header"],["mat-dialog-title",""],["trans","",4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["class","modal-content","ngNativeValidate","",3,"formGroup","ngSubmit",4,"ngIf"],["trans",""],["ngNativeValidate","",1,"modal-content",3,"formGroup","ngSubmit"],[1,"many-inputs"],[1,"input-container"],["for","name","trans",""],["type","text","formControlName","name","id","name","pattern","[A-Za-z0-9_-]+","required",""],["class","error",4,"ngIf"],["for","language","trans",""],["id","language","formControlName","language"],["trans","",3,"value",4,"ngFor","ngForOf"],["mat-button","","type","button","trans","",3,"click"],["type","submit","mat-raised-button","","color","accent","trans","",3,"disabled"],[1,"error"],["trans","",3,"value"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"h2",1),o.YNc(2,yl,2,0,"span",2),o.YNc(3,wl,2,0,"span",2),o.qZA(),o.TgZ(4,"button",3),o.NdJ("click",function(){return t.close()}),o._UZ(5,"mat-icon",4),o.qZA(),o.qZA(),o.YNc(6,Ml,20,10,"form",5),o.ALo(7,"async")),2&e&&(o.xp6(2),o.Q6J("ngIf",t.data.localization),o.xp6(1),o.Q6J("ngIf",!t.data.localization),o.xp6(3),o.Q6J("ngIf",o.lcZ(7,3,t.errors$)))},directives:[m.uh,i.O5,O.Hw,Zt.P,a.JL,a.sg,m.xY,a.Fj,a.JJ,a.u,a.c5,a.Q7,a.EJ,i.sg,m.H8,g.lW,a.YN,a.Kr],pipes:[i.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}"],changeDetection:0}),e})(),Ul=(()=>{class e{constructor(e){this.dialogRef=e,this.form=new a.cw({key:new a.NI,value:new a.NI})}confirm(){this.close(this.form.value)}close(e){this.dialogRef.close(e)}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(m.so))},e.\u0275cmp=o.Xpm({type:e,selectors:[["new-line-modal"]],decls:24,vars:1,consts:[[1,"modal-header"],["mat-dialog-title","","trans","",1,"mat-dialog-title"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",1,"modal-content",3,"formGroup","ngSubmit"],[1,"many-inputs"],[1,"input-container"],["for","translation-key","trans",""],["type","text","formControlName","key","name","translation-key","id","translation-key","required",""],["trans",""],["for","translation-value","trans",""],["type","text","formControlName","value","name","translation-value","id","translation-value","required",""],["mat-button","","type","button","trans","",3,"click"],["type","submit","mat-raised-button","","color","accent","trans",""]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"h2",1),o._uU(2,"Add New Translation Line"),o.qZA(),o.TgZ(3,"button",2),o.NdJ("click",function(){return t.close()}),o._UZ(4,"mat-icon",3),o.qZA(),o.qZA(),o.TgZ(5,"form",4),o.NdJ("ngSubmit",function(){return t.confirm()}),o.TgZ(6,"mat-dialog-content",5),o.TgZ(7,"div",6),o.TgZ(8,"label",7),o._uU(9,"Translation Key"),o.qZA(),o._UZ(10,"input",8),o.TgZ(11,"p",9),o._uU(12,"Word or sentence you want to translate."),o.qZA(),o.qZA(),o.TgZ(13,"div",6),o.TgZ(14,"label",10),o._uU(15,"Translation Value"),o.qZA(),o._UZ(16,"input",11),o.TgZ(17,"p",9),o._uU(18,"What word or sentence should be translated to."),o.qZA(),o.qZA(),o.qZA(),o.TgZ(19,"mat-dialog-actions"),o.TgZ(20,"button",12),o.NdJ("click",function(){return t.close()}),o._uU(21,"Cancel"),o.qZA(),o.TgZ(22,"button",13),o._uU(23,"Add"),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(5),o.Q6J("formGroup",t.form))},directives:[m.uh,Zt.P,O.Hw,a.JL,a.sg,m.xY,a.Fj,a.JJ,a.u,a.Q7,m.H8,g.lW],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}"],changeDetection:0}),e})();const Jl=[(0,G.X$)("fadeIn",[(0,G.eR)(":enter",[(0,G.oB)({opacity:0}),(0,G.jt)("325ms ease-in",(0,G.oB)({opacity:1}))])]),(0,G.X$)("fadeOut",[(0,G.eR)(":leave",[(0,G.oB)({opacity:1,position:"absolute",left:"0",right:"0"}),(0,G.jt)("325ms ease-out",(0,G.oB)({opacity:0}))])])];var Dl=n(9244),Ol=n(8849);let Pl=(()=>{class e{constructor(e){this.theme=e,this.animation="wave",this.variant="text",this.dark=this.theme.isDarkMode()}get pulsate(){return"pulsate"===this.animation}get wave(){return"wave"===this.animation}get avatar(){return"avatar"===this.variant}get text(){return"text"===this.variant}get rect(){return"rect"===this.variant}get icon(){return"icon"===this.variant}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Ol.f))},e.\u0275cmp=o.Xpm({type:e,selectors:[["skeleton"]],hostAttrs:["aria-busy","true","aria-valuemin","0","aria-valuemax","100","aria-valuetext","Loading...","role","progressbar"],hostVars:14,hostBindings:function(e,t){2&e&&o.ekj("dark",t.dark)("pulsate",t.pulsate)("wave",t.wave)("avatar",t.avatar)("text",t.text)("rect",t.rect)("icon",t.icon)},inputs:{animation:"animation",variant:"variant"},decls:0,vars:0,template:function(e,t){},styles:['@charset "UTF-8";[_nghost-%COMP%]{display:inline-block;overflow:hidden;position:relative;background-color:var(--be-divider-lighter);background-repeat:no-repeat;border-radius:4px;width:100%;height:100%;will-change:transform}.wave[_nghost-%COMP%]{animation:wave 2s ease-in-out infinite;background-size:200px 100%;background-image:linear-gradient(90deg,#fff0,#fff9,#fff0)}.wave.dark[_nghost-%COMP%]{background-image:linear-gradient(90deg,#0000,#0003,#0000)}.pulsate[_nghost-%COMP%]{animation:pulse 1.5s ease-in-out infinite;animation-delay:.5s}.avatar[_nghost-%COMP%]{width:40px;height:40px;margin-right:10px;border-radius:4px;flex-shrink:0}.circle[_nghost-%COMP%]{border-radius:50%}.icon[_nghost-%COMP%]{width:24px;height:24px;margin-left:8px;margin-right:8px}.text[_nghost-%COMP%]{height:1.4rem;vertical-align:middle}.text[_nghost-%COMP%]:before{content:"\xa0"}@keyframes wave{0%{background-position:-200px 0}to{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}'],changeDetection:0}),e})();function Sl(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",18),o.NdJ("click",function(){return o.CHM(e),o.oxw().showCrupdateLocalizationModal()}),o._UZ(1,"mat-icon",19),o.TgZ(2,"span",15),o._uU(3,"New Localization"),o.qZA(),o.qZA()}}function Nl(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",26),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw(2).setSelectedLocalization(t)}),o._uU(1),o.qZA()}if(2&e){const e=t.$implicit,n=o.oxw(2);o.ekj("selected",(null==n.selectedLocalization?null:n.selectedLocalization.model.id)==e.model.id),o.xp6(1),o.Oqu(e.model.name)}}function Ql(e,t){if(1&e&&(o.ynx(0),o.TgZ(1,"button",20),o.TgZ(2,"span",21),o._uU(3),o.qZA(),o._UZ(4,"mat-icon",22),o.qZA(),o.TgZ(5,"mat-menu",23,24),o.YNc(7,Nl,2,3,"button",25),o.ALo(8,"async"),o.qZA(),o.BQk()),2&e){const e=o.MAs(6),t=o.oxw();o.xp6(1),o.Q6J("matMenuTriggerFor",e),o.xp6(2),o.Oqu(null==t.selectedLocalization?null:t.selectedLocalization.model.name),o.xp6(4),o.Q6J("ngForOf",o.lcZ(8,3,t.localizations$))}}function Yl(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",35),o.NdJ("click",function(){o.CHM(e);const t=o.oxw().$implicit;return o.oxw(2).setDefaultLocalization(t)}),o._uU(1,"Set as Default"),o.qZA()}}function Fl(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",35),o.NdJ("click",function(){o.CHM(e);const t=o.oxw().$implicit;return o.oxw(2).showCrupdateLocalizationModal(t)}),o._uU(1,"Update"),o.qZA()}}function Rl(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",35),o.NdJ("click",function(){o.CHM(e);const t=o.oxw().$implicit;return o.oxw(2).confirmLocalizationDeletion(t)}),o._uU(1,"Delete"),o.qZA()}}function El(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",28),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw(2).setSelectedLocalization(t)}),o.TgZ(1,"div",29),o._uU(2),o.qZA(),o.TgZ(3,"div",30),o.TgZ(4,"button",31),o.NdJ("click",function(e){return e.stopPropagation()}),o._UZ(5,"mat-icon",32),o.qZA(),o.TgZ(6,"mat-menu",null,33),o.YNc(8,Yl,2,0,"div",34),o.YNc(9,Fl,2,0,"div",34),o.YNc(10,Rl,2,0,"div",34),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=t.$implicit,n=o.MAs(7),i=o.oxw(2);o.ekj("selected",(null==i.selectedLocalization?null:i.selectedLocalization.model.id)==e.model.id),o.Q6J("@fadeIn",void 0),o.xp6(2),o.Oqu(e.model.name.replace("-"," ")),o.xp6(2),o.Q6J("matMenuTriggerFor",n),o.xp6(4),o.Q6J("ngIf",i.currentUser.hasPermission("settings.update")),o.xp6(1),o.Q6J("ngIf","English"!==e.name&&i.currentUser.hasPermission("localizations.update")),o.xp6(1),o.Q6J("ngIf","English"!==e.name&&i.currentUser.hasPermission("localizations.delete"))}}function Ll(e,t){1&e&&(o.TgZ(0,"div",37),o._UZ(1,"skeleton",38),o.qZA())}const $l=function(){return[1,2,3,4,5]};function Vl(e,t){1&e&&(o.TgZ(0,"div"),o.YNc(1,Ll,2,0,"div",36),o.qZA()),2&e&&(o.xp6(1),o.Q6J("ngForOf",o.DdM(1,$l)))}function Hl(e,t){if(1&e&&(o.YNc(0,El,11,8,"div",27),o.ALo(1,"async"),o.YNc(2,Vl,2,2,"div",16),o.ALo(3,"async")),2&e){const e=o.oxw();o.Q6J("ngForOf",o.lcZ(1,3,e.localizations$))("ngForTrackBy",e.trackByFn),o.xp6(2),o.Q6J("ngIf",o.lcZ(3,5,!e.selectedLocalization&&e.loading$))}}function zl(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",39),o.NdJ("click",function(){return o.CHM(e),o.oxw().updateLocalization()}),o.ALo(1,"async"),o._uU(2,"Update"),o.qZA()}if(2&e){const e=o.oxw();o.Q6J("disabled",o.lcZ(1,1,e.loading$))}}function Bl(e,t){1&e&&(o.TgZ(0,"tr"),o.TgZ(1,"td"),o._UZ(2,"skeleton",40),o.qZA(),o.TgZ(3,"td"),o._UZ(4,"skeleton",40),o.qZA(),o.qZA())}const jl=function(){return[1,2,3,4,5,6,7,8,9,10]};function Gl(e,t){1&e&&(o.ynx(0),o.YNc(1,Bl,5,0,"tr",17),o.BQk()),2&e&&(o.xp6(1),o.Q6J("ngForOf",o.DdM(1,jl)))}function Xl(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"tr"),o.TgZ(1,"td",41),o._uU(2),o.qZA(),o.TgZ(3,"td",42),o.TgZ(4,"input",43),o.NdJ("ngModelChange",function(t){const n=o.CHM(e).$implicit;return o.oxw().selectedLocalization.lines[n.key]=t}),o.qZA(),o.qZA(),o.TgZ(5,"td",44),o.TgZ(6,"button",45),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().removeLine(t)}),o.ALo(7,"trans"),o._UZ(8,"mat-icon",46),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=t.$implicit,n=o.oxw();o.Q6J("@fadeIn",void 0),o.xp6(2),o.Oqu(e.key),o.xp6(2),o.s9C("id",e.key),o.Q6J("ngModel",n.selectedLocalization.lines[e.key]),o.xp6(2),o.Q6J("matTooltip",o.lcZ(7,5,"Remove"))}}let Wl=(()=>{class e{constructor(e,t,n,i,s,o,r,l){this.toast=e,this.modal=t,this.settings=n,this.i18n=i,this.route=s,this.currentUser=o,this.localizationsApi=r,this.breakpoints=l,this.loading$=new pt.X(!1),this.loadingLines$=new pt.X(!1),this.searchQuery=new a.NI,this.localizations$=new pt.X([]),this.lines$=new pt.X([]),this.trackByFn=(e,t)=>t.model.id}ngOnInit(){this.loading$.next(!0),this.localizationsApi.all().pipe((0,gt.x)(()=>this.loading$.next(!1))).subscribe(e=>{this.setLocalizations(e.localizations),this.bindSearchQuery()})}setLocalizations(e){this.localizations$.next(e);const t=e.find(e=>e.model.language===this.settings.get("i18n.default_localization"))||e[0];t&&this.setSelectedLocalization(t)}setSelectedLocalization(e){var t;(null===(t=this.selectedLocalization)||void 0===t?void 0:t.model.id)!==e.model.id&&(this.selectedLocalization=e,this.searchQuery.setValue(null),e.lines?this.lines$.next(this.originalLines()):(this.selectedLocalization.lines={},this.loadingLines$.next(!0),this.localizationsApi.get(this.selectedLocalization.model.name).pipe((0,gt.x)(()=>this.loadingLines$.next(!1))).subscribe(t=>{this.selectedLocalization=t.localization;const n=[...this.localizations$.value],i=n.findIndex(t=>t.model.id===e.model.id);n[i]=t.localization,this.localizations$.next(n),this.lines$.next(this.originalLines())})))}addLine(){this.modal.open(Ul).beforeClosed().subscribe(e=>{e&&(this.selectedLocalization.lines[e.key]=e.value,this.lines$.next(this.originalLines()))})}setDefaultLocalization(e){this.selectedLocalization.model.id||this.setSelectedLocalization(e),this.localizationsApi.setDefault(e.model).subscribe(()=>{this.toast.open("Default Localization Changed")},()=>{this.toast.open(Gs.v.Default)})}updateLocalization(){this.loading$.next(!0),this.localizationsApi.update(this.selectedLocalization.model.id,this.selectedLocalization).pipe((0,gt.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open("Localizations updated"),this.i18n.isActive(this.selectedLocalization.model)&&this.i18n.setLocalization(this.selectedLocalization)})}showCrupdateLocalizationModal(e){this.modal.show(Il,{localization:e}).afterClosed().subscribe(t=>{if(!t)return;let n=[...this.localizations$.value];e?n=n.map(e=>e.model.id===t.model.id?t:e):(n.push(t),this.setSelectedLocalization(t)),this.localizations$.next(n)})}confirmLocalizationDeletion(e){this.localizations$.value.length<2?this.toast.open("There must be at least one localization."):this.modal.open(Nt.z,{title:"Delete Localization",body:"Are you sure you want to delete this localization?",ok:"Delete"}).afterClosed().subscribe(t=>{t&&this.deleteLocalization(e)})}deleteLocalization(e){this.localizationsApi.delete(e.model.id).subscribe(()=>{this.toast.open("Localization deleted");const t=[...this.localizations$.value];t.splice(t.indexOf(e),1),this.localizations$.next(t),this.selectedLocalization.model.id===e.model.id&&this.setSelectedLocalization(t[0])})}bindSearchQuery(){this.searchQuery.valueChanges.pipe((0,Xt.x)()).subscribe(e=>{const t=this.originalLines();this.lines$.next(e?t.filter(t=>this.filterPredicate(t,e)):t)})}filterPredicate(e,t){const n=Object.keys(e).reduce((t,n)=>t+e[n]+"\u25ec","").toLowerCase(),i=t.trim().toLowerCase();return-1!=n.indexOf(i)}linesToArray(e){const t=[];for(const n in e)t.push({key:n,translation:e[n]});return t}originalLines(){return this.selectedLocalization.lines?this.linesToArray(this.selectedLocalization.lines):[]}removeLine(e){delete this.selectedLocalization.lines[e.key],this.lines$.next(this.originalLines())}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(mt.F),o.Y36(ft.u),o.Y36(st.Z),o.Y36(Dl.Z),o.Y36(l.gz),o.Y36(on.I),o.Y36(Al.v),o.Y36(fn.S))},e.\u0275cmp=o.Xpm({type:e,selectors:[["localization-index"]],decls:29,vars:13,consts:[[1,"admin-pill-nav"],[1,"new-localization"],["mat-button","",3,"click",4,"ngIf"],[4,"ngIf","ngIfElse"],["desktopNav",""],[1,"update-translations"],["mat-raised-button","","color","accent","trans","",3,"disabled","click",4,"ngIf"],[1,"datatable","responsive-table"],[1,"datatable-header","localizations-datatable-header"],["mat-raised-button","","color","accent","trans","",1,"new-translation-button",3,"click"],[1,"input-container","search-input-container"],["type","text","placeholder","Search Translations","trans-placeholder","",1,"search",3,"formControl"],["svgIcon","search"],[1,"material-table"],["trans","",1,"source-column"],["trans",""],[4,"ngIf"],[4,"ngFor","ngForOf"],["mat-button","",3,"click"],["svgIcon","add"],[1,"no-style","admin-pill-nav-mobile-selector",3,"matMenuTriggerFor"],["trans","",1,"name"],["svgIcon","keyboard-arrow-down"],[1,"admin-pill-nav-menu"],["navMenu","matMenu"],["mat-menu-item","",3,"selected","click",4,"ngFor","ngForOf"],["mat-menu-item","",3,"click"],["class","nav-item",3,"selected","click",4,"ngFor","ngForOf","ngForTrackBy"],[1,"nav-item",3,"click"],[1,"name"],[1,"actions"],["mat-icon-button","",3,"matMenuTriggerFor","click"],["svgIcon","settings",1,"size-22"],["actionsMenu",""],["mat-menu-item","","trans","",3,"click",4,"ngIf"],["mat-menu-item","","trans","",3,"click"],["class","nav-item skeleton-nav-item",4,"ngFor","ngForOf"],[1,"nav-item","skeleton-nav-item"],["variant","text"],["mat-raised-button","","color","accent","trans","",3,"disabled","click"],["variant","text",1,"table-skeleton"],[1,"mobile-no-label","source-column"],[1,"mobile-no-label"],["type","text",1,"translation-input",3,"id","ngModel","ngModelChange"],[1,"edit-column"],["type","button","mat-icon-button","",3,"matTooltip","click"],["svgIcon","close"]],template:function(e,t){if(1&e&&(o.TgZ(0,"aside",0),o.TgZ(1,"div",1),o.YNc(2,Sl,4,0,"button",2),o.qZA(),o.YNc(3,Ql,9,5,"ng-container",3),o.ALo(4,"async"),o.YNc(5,Hl,4,7,"ng-template",null,4,o.W1O),o.TgZ(7,"div",5),o.YNc(8,zl,3,3,"button",6),o.qZA(),o.qZA(),o.TgZ(9,"div",7),o.TgZ(10,"div",8),o.TgZ(11,"button",9),o.NdJ("click",function(){return t.addLine()}),o._uU(12,"Add New Translation"),o.qZA(),o.TgZ(13,"div",10),o._UZ(14,"input",11),o._UZ(15,"mat-icon",12),o.qZA(),o.qZA(),o.TgZ(16,"table",13),o.TgZ(17,"thead"),o.TgZ(18,"tr"),o.TgZ(19,"th",14),o._uU(20,"Source Text"),o.qZA(),o.TgZ(21,"th",15),o._uU(22,"Translation"),o.qZA(),o._UZ(23,"th"),o.qZA(),o.qZA(),o.TgZ(24,"tbody"),o.YNc(25,Gl,2,2,"ng-container",16),o.ALo(26,"async"),o.YNc(27,Xl,9,7,"tr",17),o.ALo(28,"async"),o.qZA(),o.qZA(),o.qZA()),2&e){const e=o.MAs(6);o.xp6(2),o.Q6J("ngIf",t.currentUser.hasPermission("localizations.create")),o.xp6(1),o.Q6J("ngIf",o.lcZ(4,7,t.breakpoints.isMobile$))("ngIfElse",e),o.xp6(5),o.Q6J("ngIf",t.currentUser.hasPermission("localizations.update")),o.xp6(6),o.Q6J("formControl",t.searchQuery),o.xp6(11),o.Q6J("ngIf",o.lcZ(26,9,t.loadingLines$)),o.xp6(2),o.Q6J("ngForOf",o.lcZ(28,11,t.lines$))}},directives:[i.O5,g.lW,Zt.P,a.Fj,a.JJ,a.oH,O.Hw,i.sg,C.p6,C.VK,C.OP,Pl,a.On,k.gM],pipes:[i.Ov,lt.R],styles:["[_nghost-%COMP%]{display:flex}  .localizations-datatable-header{display:flex;align-items:center;height:85px;padding:15px;border-bottom:1px solid #0000;position:relative}.search-input-container[_ngcontent-%COMP%]{margin-left:auto;max-width:300px;position:relative}.search-input-container[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{position:absolute;right:10px;top:10px}.search-input-container[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{margin-left:1px}.datatable[_ngcontent-%COMP%]{flex:1 1 auto}.datatable[_ngcontent-%COMP%]   .translation-input[_ngcontent-%COMP%]{position:relative;z-index:1;min-height:40px;border:none;background-color:initial;padding:0 10px;margin-left:1px;color:inherit;width:98%}.datatable[_ngcontent-%COMP%]   .translation-input[_ngcontent-%COMP%]:focus, .datatable[_ngcontent-%COMP%]   .translation-input[_ngcontent-%COMP%]:hover{outline:var(--be-accent-default) auto 1px}.datatable[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:not(.edit-column){width:50%}.table-skeleton[_ngcontent-%COMP%]{vertical-align:middle;max-width:99%}.skeleton-nav-item[_ngcontent-%COMP%]{pointer-events:none}@media screen and (min-width: 768px){.update-translations[_ngcontent-%COMP%]{margin-top:10px;padding-top:10px;border-top:1px solid var(--be-divider-default)}.new-localization[_ngcontent-%COMP%]{border-bottom:1px solid var(--be-divider-default);margin-bottom:10px;padding-bottom:10px}}@media screen and (max-width: 768px){[_nghost-%COMP%]{display:block}.admin-pill-nav[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;width:100%;margin-bottom:20px;padding-bottom:20px;border-bottom:1px solid var(--be-divider-lighter);position:relative}.source-column[_ngcontent-%COMP%]{margin-left:10px}.new-localization[_ngcontent-%COMP%]{margin-bottom:5px}.update-translations[_ngcontent-%COMP%]{position:absolute;top:-5px;right:0}.datatable[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{width:auto!important}}"],data:{animation:Jl},changeDetection:0}),e})();const Kl=[new $t({type:Vt.Select,key:"type",description:"Type of the file",defaultValue:"text",options:[{key:"Text",value:"text"},{key:"Audio",value:"audio"},{key:"Video",value:"video"},{key:"Image",value:"image"},{key:"PDF",value:"pdf"},{key:"Spreadsheet",value:"spreadsheet"},{key:"Word Document",value:"word"},{key:"Photoshop",value:"photoshop"},{key:"Archive",value:"archive"},{key:"Folder",value:"folder"}]}),new $t({type:Vt.Select,key:"public",label:"status",defaultValue:!1,description:"Whether file is publicly accessible",options:[{key:"Private",value:!1},{key:"Public",value:!0}]}),new jt({description:"Date file was uploaded"}),new Gt({description:"Date file was last changed"}),new $t({type:Vt.SelectModel,key:"owner_id",label:"Uploader",description:"User that this file was uploaded by",component:nn})];var ec=n(2644);function tc(e,t){1&e&&o._UZ(0,"mat-progress-bar",15)}function nc(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",20),o.NdJ("click",function(){return o.CHM(e),o.oxw(2).maybeDeleteSelectedEntries()}),o._uU(1," Delete "),o.qZA()}}const ic=function(e){return{count:e,resource:"file(s)"}};function ac(e,t){if(1&e&&(o.TgZ(0,"tr"),o.TgZ(1,"th",16),o.TgZ(2,"div",17),o._uU(3," :count :resource selected: "),o.qZA(),o.TgZ(4,"div",18),o.YNc(5,nc,2,0,"button",19),o.qZA(),o.qZA(),o.qZA()),2&e){const e=t.ngIf,n=o.oxw();o.xp6(2),o.Q6J("transValues",o.VKq(2,ic,e)),o.xp6(3),o.Q6J("ngIf",n.currentUser.hasPermission("files.delete"))}}function sc(e,t){if(1&e&&(o.TgZ(0,"tr"),o._UZ(1,"td",21),o.TgZ(2,"td",22),o._uU(3),o.qZA(),o.TgZ(4,"td",23),o._uU(5),o.qZA(),o.TgZ(6,"td"),o._UZ(7,"user-column",24),o.qZA(),o.TgZ(8,"td",25),o._uU(9),o.qZA(),o.TgZ(10,"td",26),o._uU(11),o.qZA(),o.TgZ(12,"td",27),o._uU(13),o.ALo(14,"formattedFileSize"),o.qZA(),o.TgZ(15,"td"),o._uU(16),o.ALo(17,"formattedDate"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Q6J("table-body-checkbox",e.id),o.xp6(2),o.Oqu(e.name),o.xp6(2),o.Oqu(e.file_name),o.xp6(2),o.Q6J("user",e.users[0]),o.xp6(2),o.Oqu(e.type),o.xp6(2),o.Oqu(e.public?"Yes":"No"),o.xp6(2),o.hij(" ",e.file_size?o.lcZ(14,8,e.file_size):"-"," "),o.xp6(3),o.Oqu(o.lcZ(17,10,e.created_at))}}function oc(e,t){1&e&&(o.TgZ(0,"no-results-message",28),o.TgZ(1,"span",29),o._uU(2,"No files have been created yet"),o.qZA(),o.qZA())}let rc=(()=>{class e{constructor(e,t,n,i){this.currentUser=e,this.settings=t,this.uploads=n,this.datatable=i,this.files$=this.datatable.data$,this.filters=Kl}ngOnInit(){this.datatable.init({uri:io.f.BASE_URI})}maybeDeleteSelectedEntries(){this.datatable.confirmResourceDeletion("files").subscribe(()=>{this.uploads.delete({entryIds:this.datatable.selectedRows$.value,deleteForever:!0}).subscribe(()=>{this.datatable.reset()})})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(on.I),o.Y36(st.Z),o.Y36(io.f),o.Y36(Lt))},e.\u0275cmp=o.Xpm({type:e,selectors:[["file-entry-index"]],features:[o._Bn([Lt])],decls:34,vars:11,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","links",3,"filters"],[1,"action-buttons"],[1,"datatable","responsive-table"],["class","loading-bar","mode","indeterminate","color","accent",4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","","trans",""],["table-sort-header","user_id","trans",""],["table-sort-header","created_at","trans",""],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","file-searching.svg",4,"ngIf"],["mode","indeterminate","color","accent",1,"loading-bar"],["colspan","9"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["mat-raised-button","","color","warn","trans","",3,"click",4,"ngIf"],["mat-raised-button","","color","warn","trans","",3,"click"],[3,"table-body-checkbox"],["data-label","Name"],["data-label","File Name"],[3,"user"],["data-label","Type"],["data-label","Public"],["data-label","File Size"],["svgImage","file-searching.svg"],["primary-text","","trans",""]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"h1",1),o._uU(2,"Uploaded Files"),o.qZA(),o.TgZ(3,"div",2),o._UZ(4,"datatable-filters",3),o._UZ(5,"div",4),o.qZA(),o.qZA(),o.TgZ(6,"div",5),o.YNc(7,tc,1,0,"mat-progress-bar",6),o.ALo(8,"async"),o.TgZ(9,"table",7),o.TgZ(10,"thead"),o.TgZ(11,"tr"),o._UZ(12,"th",8),o.TgZ(13,"th",9),o._uU(14,"Name"),o.qZA(),o.TgZ(15,"th",9),o._uU(16,"File Name"),o.qZA(),o.TgZ(17,"th",10),o._uU(18,"Owner"),o.qZA(),o.TgZ(19,"th",9),o._uU(20,"Type"),o.qZA(),o.TgZ(21,"th",9),o._uU(22,"Public"),o.qZA(),o.TgZ(23,"th",9),o._uU(24,"File Size"),o.qZA(),o.TgZ(25,"th",11),o._uU(26,"Uploaded At"),o.qZA(),o.qZA(),o.YNc(27,ac,6,4,"tr",12),o.qZA(),o.TgZ(28,"tbody"),o.YNc(29,sc,18,12,"tr",13),o.ALo(30,"async"),o.qZA(),o.qZA(),o.YNc(31,oc,3,0,"no-results-message",14),o.ALo(32,"async"),o._UZ(33,"datatable-footer"),o.qZA()),2&e&&(o.xp6(4),o.Q6J("filters",t.filters),o.xp6(3),o.Q6J("ngIf",o.lcZ(8,5,t.datatable.paginator&&t.datatable.paginator.loading$)),o.xp6(20),o.Q6J("ngIf",t.datatable.selectedRows$.value.length),o.xp6(2),o.Q6J("ngForOf",o.lcZ(30,7,t.files$)),o.xp6(2),o.Q6J("ngIf",o.lcZ(32,9,t.datatable.paginator.noResults$)))},directives:[Zt.P,Ln,i.O5,Vn,Gn,i.sg,Kn,s.pW,g.lW,ti,ii,ai.U],pipes:[i.Ov,ec.y,si.l],styles:[".title[_ngcontent-%COMP%]{font-size:1.8rem;color:var(--be-secondary-text);margin-left:15px}"],changeDetection:0}),e})(),lc=(()=>{class e{constructor(e,t){this.data=e,this.overlayPanelRef=t}close(){this.overlayPanelRef.close()}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Fr.p,8),o.Y36(Rr.L))},e.\u0275cmp=o.Xpm({type:e,selectors:[["image-zoom-overlay"]],hostVars:1,hostBindings:function(e,t){2&e&&o.d8E("@dialogContainer","enter")},decls:3,vars:2,consts:[[3,"src","alt"],["mat-mini-fab","","color","accent",1,"close-button",3,"click"],["svgIcon","close"]],template:function(e,t){1&e&&(o._UZ(0,"img",0),o.TgZ(1,"button",1),o.NdJ("click",function(){return t.close()}),o._UZ(2,"mat-icon",2),o.qZA()),2&e&&o.Q6J("src",t.data.src,o.LSH)("alt",t.data.alt)},directives:[g.lW,O.Hw],styles:[".image-zoom-overlay-container{margin:auto;top:0;left:0;right:0;bottom:0;max-width:calc(100% - 65px);max-height:calc(100% - 65px)}image-zoom-overlay{display:block;width:100%;height:100%;position:relative;box-shadow:0 3px 5px -1px #0003,0 5px 8px 0 #00000024,0 1px 14px 0 #0000001f}image-zoom-overlay img{max-height:100%;max-width:100%;border-radius:4px;overflow:hidden;object-fit:cover}image-zoom-overlay .close-button{position:absolute;top:-15px;right:-15px}"],encapsulation:2,data:{animation:[m.Nv.dialogContainer]},changeDetection:0}),e})(),cc=(()=>{class e{constructor(e){this.overlay=e}zoomImage(){this.overlay.open(lc,{position:"center",origin:"global",data:{src:this.src,alt:this.alt},panelClass:"image-zoom-overlay-container"})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36($r.T))},e.\u0275cmp=o.Xpm({type:e,selectors:[["image-zoom"]],inputs:{src:"src",alt:"alt"},decls:1,vars:2,consts:[[3,"src","alt","click"]],template:function(e,t){1&e&&(o.TgZ(0,"img",0),o.NdJ("click",function(){return t.zoomImage()}),o.qZA()),2&e&&o.Q6J("src",t.src,o.LSH)("alt",t.alt)},styles:["[_nghost-%COMP%]{display:inline-block;border-radius:4px;overflow:hidden;cursor:zoom-in}img[_ngcontent-%COMP%]{max-width:100%;max-height:100%;width:auto;object-fit:cover}"],changeDetection:0}),e})();function dc(e,t){if(1&e&&(o.TgZ(0,"div",8),o.TgZ(1,"div",9),o.TgZ(2,"label",10),o._uU(3),o.qZA(),o._UZ(4,"textarea",11),o.qZA(),o._UZ(5,"image-zoom",12),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.xp6(2),o.Q6J("for",e.slot),o.xp6(1),o.Oqu(e.description),o.xp6(1),o.Q6J("name",e.slot)("id",e.slot)("formControlName",e.slot),o.xp6(1),o.Q6J("src",n.getPreviewUrl(e))}}function uc(e,t){1&e&&o._UZ(0,"mat-progress-bar",13)}let gc=(()=>{class e{constructor(e,t,n){this.settings=e,this.toast=t,this.fb=n,this.loading$=new pt.X(!1),this.form=this.fb.group({"ads.disable":[!1]})}ngOnInit(){this.hydrate()}saveAds(){this.loading$.next(!0),this.settings.save({client:this.form.value}).pipe((0,gt.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open("Ads updated")},()=>{this.toast.open(Gs.v.Default)})}allAds(){return this.settings.get("vebto.admin.ads",[])}getPreviewUrl(e){return`client/assets/images/verts/${e.slot.replace(/\./g,"-").replace("ads-","")}.png`}hydrate(){const e=this.settings.getFlat()||{};this.form.patchValue({"ads.disable":e["ads.disable"]}),this.allAds().forEach(t=>{this.form.addControl(t.slot,this.fb.control(e[t.slot]))})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(st.Z),o.Y36(mt.F),o.Y36(a.qu))},e.\u0275cmp=o.Xpm({type:e,selectors:[["ads-page"]],decls:14,vars:8,consts:[["ngNativeValidate","",1,"panel",3,"formGroup","ngSubmit"],["trans","",1,"header"],["class","vert-row",4,"ngFor","ngForOf"],[1,"setting-toggle-container","margin-top","margin-bottom"],["name","ads.disable","id","ads.disable","formControlName","ads.disable","trans",""],["trans",""],["type","submit","mat-raised-button","","color","accent","trans","",1,"save-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],[1,"vert-row"],[1,"input-container"],["trans","",3,"for"],[3,"name","id","formControlName"],[3,"src"],["mode","indeterminate","color","accent"]],template:function(e,t){1&e&&(o.TgZ(0,"form",0),o.NdJ("ngSubmit",function(){return t.saveAds()}),o.TgZ(1,"div",1),o._uU(2,"Predefined AD Slots"),o.qZA(),o.YNc(3,dc,6,6,"div",2),o.TgZ(4,"div",3),o.TgZ(5,"mat-slide-toggle",4),o._uU(6,"Disable Ads"),o.qZA(),o.TgZ(7,"p",5),o._uU(8,"Disable all ad related functionality."),o.qZA(),o.qZA(),o.TgZ(9,"button",6),o.ALo(10,"async"),o._uU(11,"Save"),o.qZA(),o.YNc(12,uc,1,0,"mat-progress-bar",7),o.ALo(13,"async"),o.qZA()),2&e&&(o.Q6J("formGroup",t.form),o.xp6(3),o.Q6J("ngForOf",t.allAds()),o.xp6(6),o.Q6J("disabled",o.lcZ(10,4,t.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(13,6,t.loading$)))},directives:[a.JL,a.sg,Zt.P,i.sg,T.Rr,a.JJ,a.u,g.lW,i.O5,a.Fj,cc,s.pW],pipes:[i.Ov],styles:[".panel[_ngcontent-%COMP%]{border:1px solid var(--be-divider-default);box-shadow:none;border-radius:4px;background-color:var(--be-background)}.header[_ngcontent-%COMP%]{background-color:var(--be-background-alternative);border-bottom:1px solid var(--be-divider-lighter);padding:15px;font-weight:500;color:#555}.header[_ngcontent-%COMP%], .vert-row[_ngcontent-%COMP%]{margin-bottom:25px}.vert-row[_ngcontent-%COMP%]{display:flex;align-items:flex-end;padding-left:25px;padding-right:25px}image-zoom[_ngcontent-%COMP%]{margin-left:25px;border:1px solid var(--be-divider-default);height:150px}.input-container[_ngcontent-%COMP%]{max-width:750px}textarea[_ngcontent-%COMP%]{display:block;height:150px}label[_ngcontent-%COMP%]:empty{display:none}.setting-toggle-container[_ngcontent-%COMP%]{margin-left:15px}.save-button[_ngcontent-%COMP%]{margin:0 0 30px 15px}@media only screen and (max-width: 768px){.vert-row[_ngcontent-%COMP%]{display:block;border-bottom:1px solid var(--be-divider-lighter);margin-bottom:30px;padding-bottom:25px}image-zoom[_ngcontent-%COMP%]{margin-left:0;margin-top:15px}}"],changeDetection:0}),e})();var pc=n(4284);function hc(e,t){1&e&&(o.TgZ(0,"h2",6),o._uU(1,"Update Plan Details"),o.qZA())}function mc(e,t){1&e&&(o.TgZ(0,"h2",6),o._uU(1,"Create a New Plan"),o.qZA())}function fc(e,t){if(1&e&&(o.TgZ(0,"div",23),o._uU(1),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(1),o.Oqu(e.name)}}function _c(e,t){if(1&e&&(o.TgZ(0,"option",24),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("ngValue",e.id),o.xp6(1),o.Oqu(e.name)}}function bc(e,t){if(1&e&&(o.TgZ(0,"div",23),o._uU(1),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(1),o.Oqu(e.parent_id)}}function vc(e,t){1&e&&(o.ynx(0),o.TgZ(1,"p",17),o._uU(2,"How much subscribers of this plan should be charged. (Dollars, euros etc.)"),o.qZA(),o.TgZ(3,"p",17),o._uU(4,"For example, Amount=100, Interval=Year and Interval Count=1, will charge user 100 dollars every year."),o.qZA(),o.BQk())}function Zc(e,t){1&e&&(o.TgZ(0,"p",17),o._uU(1,"Plan amount can't be changed once plan has already been created, however you can add a new child plan with a different price or delete this plan and create a new one."),o.qZA())}function xc(e,t){if(1&e&&(o.TgZ(0,"div",23),o._uU(1),o.qZA()),2&e){const e=o.oxw(2).ngIf;o.xp6(1),o.Oqu(e.amount)}}function Ac(e,t){if(1&e&&(o.TgZ(0,"option",24),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("ngValue",e.code),o.xp6(1),o.AsE("",e.code," - ",e.name,"")}}function yc(e,t){if(1&e&&(o.TgZ(0,"div",23),o._uU(1),o.qZA()),2&e){const e=o.oxw(3).ngIf;o.xp6(1),o.Oqu(e.currency)}}function wc(e,t){if(1&e&&(o.TgZ(0,"div",9),o.TgZ(1,"label",30),o._uU(2,"Currency"),o.qZA(),o.TgZ(3,"select",31),o.YNc(4,Ac,2,3,"option",16),o.ALo(5,"async"),o.qZA(),o.YNc(6,yc,2,1,"div",12),o.qZA()),2&e){const e=o.oxw(2).ngIf,t=o.oxw();o.xp6(4),o.Q6J("ngForOf",o.lcZ(5,2,t.currencies$)),o.xp6(2),o.Q6J("ngIf",e.currency)}}function Cc(e,t){if(1&e&&(o.TgZ(0,"option",24),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("ngValue",e),o.xp6(1),o.Oqu(e)}}function Tc(e,t){if(1&e&&(o.TgZ(0,"div",23),o._uU(1),o.qZA()),2&e){const e=o.oxw(2).ngIf;o.xp6(1),o.Oqu(e.interval)}}function qc(e,t){if(1&e&&(o.TgZ(0,"div",23),o._uU(1),o.qZA()),2&e){const e=o.oxw(3).ngIf;o.xp6(1),o.Oqu(e.interval_count)}}function kc(e,t){if(1&e&&(o.TgZ(0,"div",9),o.TgZ(1,"label",32),o._uU(2,"Interval Count"),o.qZA(),o._UZ(3,"input",33),o.TgZ(4,"p",17),o._uU(5,"The number of intervals (specified in the interval property above) between each subscription billing. For example, Interval=Month and Interval Count=3 bills every 3 months."),o.qZA(),o.YNc(6,qc,2,1,"div",12),o.qZA()),2&e){const e=o.oxw(2).ngIf;o.xp6(6),o.Q6J("ngIf",e.interval_count)}}function Mc(e,t){if(1&e&&(o.ynx(0),o.TgZ(1,"div",9),o.TgZ(2,"label",25),o._uU(3,"Amount"),o.qZA(),o._UZ(4,"input",26),o.YNc(5,vc,5,0,"ng-container",18),o.YNc(6,Zc,2,0,"p",22),o.YNc(7,xc,2,1,"div",12),o.qZA(),o.YNc(8,wc,7,4,"div",27),o.TgZ(9,"div",9),o.TgZ(10,"label",28),o._uU(11,"Interval"),o.qZA(),o.TgZ(12,"select",29),o.YNc(13,Cc,2,2,"option",16),o.qZA(),o.TgZ(14,"p",17),o._uU(15,"The frequency with which a subscription should be billed."),o.qZA(),o.YNc(16,Tc,2,1,"div",12),o.qZA(),o.YNc(17,kc,7,1,"div",27),o.BQk()),2&e){const e=o.oxw().ngIf,t=o.oxw();o.xp6(4),o.Q6J("min",t.getMinAmount())("max",t.getMaxAmount()),o.xp6(1),o.Q6J("ngIf",!t.data.plan),o.xp6(1),o.Q6J("ngIf",t.data.plan),o.xp6(1),o.Q6J("ngIf",e.amount),o.xp6(1),o.Q6J("ngIf",!t.formValue().parent_id),o.xp6(5),o.Q6J("ngForOf",t.intervals),o.xp6(3),o.Q6J("ngIf",e.interval),o.xp6(1),o.Q6J("ngIf","year"!==t.formValue().interval)}}function Ic(e,t){if(1&e&&(o.TgZ(0,"div",23),o._uU(1),o.qZA()),2&e){const e=o.oxw(2).ngIf;o.xp6(1),o.Oqu(e.position)}}function Uc(e,t){1&e&&(o.TgZ(0,"div",36),o.TgZ(1,"mat-slide-toggle",53),o._uU(2,"Free"),o.qZA(),o.TgZ(3,"p",17),o._uU(4,"Basic free plan that will be assigned to new users that have not upgraded to other plans."),o.qZA(),o.qZA())}function Jc(e,t){if(1&e&&(o.TgZ(0,"div",23),o._uU(1),o.qZA()),2&e){const e=o.oxw(2).ngIf;o.xp6(1),o.Oqu(null==e?null:e.permissions)}}function Dc(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"li",54),o.TgZ(1,"button",55),o._UZ(2,"mat-icon",56),o.qZA(),o.TgZ(3,"div",57),o._uU(4),o.qZA(),o.TgZ(5,"button",58),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw(3).removeFeature(t)}),o._UZ(6,"mat-icon",59),o.qZA(),o.qZA()}if(2&e){const e=t.$implicit;o.uIk("data-id",e.id),o.xp6(4),o.Oqu(e.content)}}function Oc(e,t){1&e&&(o.TgZ(0,"p",17),o._uU(1,"No custom features yet."),o.qZA())}function Pc(e,t){if(1&e&&(o.TgZ(0,"div",23),o._uU(1),o.qZA()),2&e){const e=o.oxw(2).ngIf;o.xp6(1),o.Oqu(e.available_space)}}function Sc(e,t){if(1&e){const e=o.EpF();o.ynx(0),o.TgZ(1,"div",9),o.TgZ(2,"label",34),o._uU(3,"Position"),o.qZA(),o.TgZ(4,"select",35),o.TgZ(5,"option",24),o._uU(6,"1"),o.qZA(),o.TgZ(7,"option",24),o._uU(8,"2"),o.qZA(),o.TgZ(9,"option",24),o._uU(10,"3"),o.qZA(),o.TgZ(11,"option",24),o._uU(12,"4"),o.qZA(),o.TgZ(13,"option",24),o._uU(14,"5"),o.qZA(),o.TgZ(15,"option",24),o._uU(16,"6"),o.qZA(),o.TgZ(17,"option",24),o._uU(18,"7"),o.qZA(),o.TgZ(19,"option",24),o._uU(20,"8"),o.qZA(),o.qZA(),o.TgZ(21,"p",17),o._uU(22,"Order of plans. Lower position will appear first."),o.qZA(),o.YNc(23,Ic,2,1,"div",12),o.qZA(),o.TgZ(24,"div",36),o.TgZ(25,"mat-slide-toggle",37),o._uU(26,"Recommended"),o.qZA(),o.TgZ(27,"p",17),o._uU(28,'Plan will be marked as "Most Popular" and emphasized to users.'),o.qZA(),o.qZA(),o.YNc(29,Uc,5,0,"div",38),o.TgZ(30,"div",36),o.TgZ(31,"mat-slide-toggle",39),o._uU(32,"Show Permissions"),o.qZA(),o.TgZ(33,"p",17),o._uU(34,"Whether plan permissions should be displayed as features to users."),o.qZA(),o.qZA(),o.TgZ(35,"div",36),o.TgZ(36,"mat-slide-toggle",40),o._uU(37,"Hidden"),o.qZA(),o.TgZ(38,"p",17),o._uU(39,"Whether this plan should be hidden on upgrade and pricing pages."),o.qZA(),o.qZA(),o._UZ(40,"permission-manager",41),o.YNc(41,Jc,2,1,"div",12),o.TgZ(42,"div",42),o.TgZ(43,"div",43),o._uU(44,"Custom Features"),o.qZA(),o.TgZ(45,"ul",44),o.NdJ("cdkDropListDropped",function(t){return o.CHM(e),o.oxw(2).reorderPlanFeatures(t)}),o.YNc(46,Dc,7,2,"li",45),o.ALo(47,"async"),o.qZA(),o.YNc(48,Oc,2,0,"p",22),o.ALo(49,"async"),o.TgZ(50,"form",46),o.NdJ("ngSubmit",function(){return o.CHM(e),o.oxw(2).addFeature()}),o.TgZ(51,"div",9),o.TgZ(52,"div",47),o.TgZ(53,"input",48),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).newFeature=t}),o.qZA(),o.TgZ(54,"button",49),o._uU(55,"Add"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(56,"div",50),o.TgZ(57,"div",43),o._uU(58,"Available Space"),o.qZA(),o.TgZ(59,"space-input",51),o.TgZ(60,"p",52),o._uU(61,"Hard drive space available to users subscribed to this plan."),o.qZA(),o.YNc(62,Pc,2,1,"div",12),o.qZA(),o.qZA(),o.BQk()}if(2&e){const e=o.oxw().ngIf,t=o.oxw();o.xp6(5),o.Q6J("ngValue",1),o.xp6(2),o.Q6J("ngValue",2),o.xp6(2),o.Q6J("ngValue",3),o.xp6(2),o.Q6J("ngValue",4),o.xp6(2),o.Q6J("ngValue",5),o.xp6(2),o.Q6J("ngValue",6),o.xp6(2),o.Q6J("ngValue",7),o.xp6(2),o.Q6J("ngValue",8),o.xp6(4),o.Q6J("ngIf",e.position),o.xp6(6),o.Q6J("ngIf",!t.data.plan||t.data.plan.free),o.xp6(12),o.Q6J("ngIf",null==e?null:e.permissions),o.xp6(5),o.Q6J("ngForOf",o.lcZ(47,15,t.features$)),o.xp6(2),o.Q6J("ngIf",!o.lcZ(49,17,t.features$).length),o.xp6(5),o.Q6J("ngModel",t.newFeature),o.xp6(9),o.Q6J("ngIf",e.available_space)}}function Nc(e,t){1&e&&(o.TgZ(0,"span",17),o._uU(1,"Update Plan"),o.qZA())}function Qc(e,t){1&e&&(o.TgZ(0,"span",17),o._uU(1,"Create Plan"),o.qZA())}function Yc(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"form",7),o.NdJ("ngSubmit",function(){return o.CHM(e),o.oxw().confirm()}),o.TgZ(1,"div",8),o.TgZ(2,"div",9),o.TgZ(3,"label",10),o._uU(4,"Name"),o.qZA(),o._UZ(5,"input",11),o.YNc(6,fc,2,1,"div",12),o.qZA(),o.TgZ(7,"div",9),o.TgZ(8,"label",13),o._uU(9,"Parent Plan"),o.qZA(),o.TgZ(10,"select",14),o.TgZ(11,"option",15),o._uU(12,"None"),o.qZA(),o.YNc(13,_c,2,2,"option",16),o.qZA(),o.TgZ(14,"p",17),o._uU(15,"Used for creating yearly, weekly etc versions of base plan. Child plans will inherit their parent permissions/features."),o.qZA(),o.YNc(16,bc,2,1,"div",12),o.qZA(),o.YNc(17,Mc,18,9,"ng-container",18),o.YNc(18,Sc,63,19,"ng-container",18),o.qZA(),o.TgZ(19,"div",19),o.TgZ(20,"button",20),o.NdJ("click",function(){return o.CHM(e),o.oxw().close()}),o._uU(21,"Cancel"),o.qZA(),o.TgZ(22,"button",21),o.ALo(23,"async"),o.YNc(24,Nc,2,0,"span",22),o.YNc(25,Qc,2,0,"span",22),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=t.ngIf,n=o.oxw();o.Q6J("formGroup",n.form),o.xp6(6),o.Q6J("ngIf",e.name),o.xp6(5),o.Q6J("ngValue",null),o.xp6(2),o.Q6J("ngForOf",n.getBasePlans(n.data.plan)),o.xp6(3),o.Q6J("ngIf",e.parent_id),o.xp6(1),o.Q6J("ngIf",!n.formValue().free),o.xp6(1),o.Q6J("ngIf",!n.formValue().parent_id),o.xp6(4),o.Q6J("disabled",o.lcZ(23,10,n.loading$)),o.xp6(2),o.Q6J("ngIf",n.data.plan),o.xp6(1),o.Q6J("ngIf",!n.data.plan)}}let Fc=(()=>{class e{constructor(e,t,n,i,a,s){this.dialogRef=e,this.data=t,this.plans=n,this.toast=i,this.valueLists=a,this.fb=s,this.loading$=new pt.X(!1),this.features$=new pt.X([]),this.errors$=new pt.X({}),this.currencies$=new pt.X([]),this.intervals=["day","week","month","year"],this.allPlans$=new pt.X([]),this.form=this.fb.group({name:[""],parent_id:[],free:[!1],hidden:[!1],recommended:[!1],show_permissions:[!1],amount:[],currency:[],interval:[],interval_count:[],position:[],available_space:[],permissions:[[]]})}ngOnInit(){this.resetState(),this.allPlans$.next(this.data.plans||[]),this.valueLists.get(["currencies"]).subscribe(e=>{this.currencies$.next(Object.values(e.currencies))}),this.data.plan&&this.hydrateModel(this.data.plan)}confirm(){let e;this.loading$.next(!0),e=this.data.plan?this.plans.update(this.data.plan.id,this.getPayload()):this.plans.create(this.getPayload()),e.pipe((0,gt.x)(()=>this.loading$.next(!1))).subscribe(e=>{this.close(e.plan),this.toast.open("Plan has been "+(this.data.plan?"updated":"created"))},e=>{this.errors$.next(e.errors)})}getPayload(){const e=Object.assign({},this.form.getRawValue());e.features=this.features$.value.map(e=>e.content);const t=this.currencies$.value.find(t=>t.code===e.currency);return e.currency_symbol=t.symbol,"year"===e.interval&&(e.interval_count=1),e}close(e){this.resetState(),this.dialogRef.close(e)}addFeature(){!(this.features$.value.findIndex(e=>e.content===this.newFeature)>-1)&&this.newFeature&&(this.features$.next([...this.features$.value,{content:this.newFeature,id:(0,dn.O)(5)}]),this.newFeature=null)}removeFeature(e){const t=this.features$.value.filter(t=>t.id!==e.id);this.features$.next(t)}getBasePlans(e){return this.allPlans$.value.filter(t=>!(t.parent_id||t.free||e&&e.id===t.id))}hydrateModel(e){this.form.patchValue(e);const t=e.features.map(e=>({content:e,id:(0,dn.O)(5)}));this.form.get("amount").disable(),this.features$.next(t)}resetState(){this.form.reset({currency:"USD",interval:"month",interval_count:1,position:1,permissions:[],free:!1,recommended:!1,show_permissions:!1}),this.features$.next([]),this.errors$.next({})}reorderPlanFeatures(e){const t=[...this.features$.value];(0,it.bA)(t,e.previousIndex,e.currentIndex),this.features$.next(t)}formValue(){return this.form.value}getMinAmount(){return this.form.get("parent_id").value?1:0}getMaxAmount(){return null}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(m.so),o.Y36(m.WI),o.Y36(pc.o),o.Y36(mt.F),o.Y36(bt.l),o.Y36(a.qu))},e.\u0275cmp=o.Xpm({type:e,selectors:[["crupdate-plan-modal"]],decls:9,vars:8,consts:[[1,"modal-header"],["class","modal-title","mat-dialog-title","","trans","",4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["autocomplete","off","ngNativeValidate","",3,"formGroup","ngSubmit",4,"ngIf"],[1,"overlay",3,"isVisible"],["mat-dialog-title","","trans","",1,"modal-title"],["autocomplete","off","ngNativeValidate","",3,"formGroup","ngSubmit"],["mat-dialog-content","",1,"many-inputs","mat-dialog-content"],[1,"input-container"],["for","plan-modal-name","trans",""],["type","text","id","plan-modal-name","formControlName","name","required",""],["class","error",4,"ngIf"],["for","parent_id","trans",""],["id","parent_id","formControlName","parent_id","required",""],["trans","",3,"ngValue"],[3,"ngValue",4,"ngFor","ngForOf"],["trans",""],[4,"ngIf"],["mat-dialog-actions","",1,"buttons","right","mat-dialog-actions"],["type","button","mat-button","","trans","",1,"button","cancel",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary",3,"disabled"],["trans","",4,"ngIf"],[1,"error"],[3,"ngValue"],["for","amount","trans",""],["type","number","step","0.01","id","amount","formControlName","amount","required","",3,"min","max"],["class","input-container",4,"ngIf"],["for","interval","trans",""],["id","interval","formControlName","interval","required","",1,"interval-select"],["for","currency","trans",""],["id","currency","formControlName","currency","required",""],["for","interval_count","trans",""],["type","number","id","interval_count","formControlName","interval_count","required","","min","1","max","12"],["for","position","trans",""],["type","text","id","position","formControlName","position","required",""],[1,"setting-toggle-container"],["id","recommended","formControlName","recommended","trans",""],["class","setting-toggle-container",4,"ngIf"],["id","show_permissions","formControlName","show_permissions","trans",""],["id","plan-modal-hidden","formControlName","hidden","trans",""],["formControlName","permissions"],[1,"plan-features"],["trans","",1,"section-title"],["cdkDropList","",1,"unstyled-list","feature-list",3,"cdkDropListDropped"],["class","feature-list-item","cdkDrag","",4,"ngFor","ngForOf"],["ngNativeValidate","",3,"ngSubmit"],[1,"input-with-action"],["type","text","name","new-feature","placeholder","+New Feature","trans-placeholder","","autocomplete","false","required","",3,"ngModel","ngModelChange"],["type","submit","mat-flat-button","","color","accent","trans",""],[1,"available-space"],["formControlName","available_space"],["trans","",1,"description"],["id","free","formControlName","free","trans",""],["cdkDrag","",1,"feature-list-item"],["cdkDragHandle","","mat-icon-button","",1,"drag-handle"],["svgIcon","drag-handle","matListIcon",""],[1,"text"],["mat-icon-button","",1,"delete-button",3,"click"],["svgIcon","delete","matListIcon",""]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.YNc(1,hc,2,0,"h2",1),o.YNc(2,mc,2,0,"h2",1),o.TgZ(3,"button",2),o.NdJ("click",function(){return t.close()}),o._UZ(4,"mat-icon",3),o.qZA(),o.qZA(),o.YNc(5,Yc,26,12,"form",4),o.ALo(6,"async"),o._UZ(7,"loading-indicator",5),o.ALo(8,"async")),2&e&&(o.xp6(1),o.Q6J("ngIf",t.data.plan),o.xp6(1),o.Q6J("ngIf",!t.data.plan),o.xp6(3),o.Q6J("ngIf",o.lcZ(6,4,t.errors$)),o.xp6(2),o.Q6J("isVisible",o.lcZ(8,6,t.loading$)))},directives:[i.O5,O.Hw,At.Q,m.uh,Zt.P,a.JL,a.sg,m.xY,a.Fj,a.JJ,a.u,a.Q7,a.EJ,a.YN,a.Kr,i.sg,m.H8,g.lW,a.wV,a.qQ,a.Fd,T.Rr,Ho,it.Wj,a.F,a.On,_s,it.Zt,it.Bh],pipes:[i.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}.section-title[_ngcontent-%COMP%]{font-weight:500;border-bottom:1px solid var(--be-divider-default);padding-bottom:5px;margin-bottom:5px}.feature-list-item[_ngcontent-%COMP%]{display:flex;align-items:center;padding:10px 0;font-size:1.6rem}.feature-list-item[_ngcontent-%COMP%]   .text[_ngcontent-%COMP%]{padding:0 10px;white-space:nowrap;text-overflow:ellipsis}.feature-list-item[_ngcontent-%COMP%]   .delete-button[_ngcontent-%COMP%]{color:#f44336;margin-left:auto}.feature-list-item[_ngcontent-%COMP%]   .drag-handle[_ngcontent-%COMP%]{cursor:move}.plan-features[_ngcontent-%COMP%]{margin-bottom:20px;padding-bottom:20px;border-bottom:1px solid var(--be-divider-default)}.interval-select[_ngcontent-%COMP%]{text-transform:capitalize}.available-space[_ngcontent-%COMP%]   .section-title[_ngcontent-%COMP%]{border-bottom:none}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:0}.cdk-drag-animating[_ngcontent-%COMP%], .cdk-drop-list-dragging[_ngcontent-%COMP%]   .cdk-drag[_ngcontent-%COMP%]:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}"],changeDetection:0}),e})();const Rc=[new $t({type:Vt.Select,key:"parent_id",label:"Type",description:"Whether plan is a child or not",defaultValue:null,options:[{key:"Any",value:null},{key:"Child",value:{value:null,operator:"!="}},{key:"Parent",value:{value:null,operator:"="}}]}),new $t({type:Vt.Select,key:"currency",description:"Currency assigned to the plan",defaultValue:"USD",options:[{key:"USD",value:"USD"},{key:"EUR",value:"EUR"},{key:"Pound Sterling",value:"GBP"},{key:"Canadian Dollar",value:"CAD"}]}),new $t({type:Vt.Select,key:"interval",description:"Currency assigned to the plan",defaultValue:"USD",options:[{key:"Day",value:"day"},{key:"Week",value:"week"},{key:"Month",value:"month"},{key:"Year",value:"yea"}]}),new jt({description:"Date plan was created"}),new Gt({description:"Date plan was last updated"})];function Ec(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",22),o.NdJ("click",function(){return o.CHM(e),o.oxw(2).maybeDeleteSelectedPlans()}),o._uU(1," Delete "),o.qZA()}}const Lc=function(e){return{count:e,resource:"plan(s)"}};function $c(e,t){if(1&e&&(o.TgZ(0,"tr"),o.TgZ(1,"th",18),o.TgZ(2,"div",19),o._uU(3," :count :resource selected: "),o.qZA(),o.TgZ(4,"div",20),o.YNc(5,Ec,2,0,"button",21),o.qZA(),o.qZA(),o.qZA()),2&e){const e=t.ngIf,n=o.oxw();o.xp6(2),o.Q6J("transValues",o.VKq(2,Lc,e)),o.xp6(3),o.Q6J("ngIf",n.currentUser.hasPermission("plans.delete"))}}function Vc(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",34),o.NdJ("click",function(){o.CHM(e);const t=o.oxw().$implicit;return o.oxw().showCrupdatePlanModal(t)}),o.ALo(1,"trans"),o._UZ(2,"mat-icon",35),o.qZA()}2&e&&o.Q6J("matTooltip",o.lcZ(1,1,"Edit plan"))}function Hc(e,t){if(1&e&&(o.TgZ(0,"tr"),o._UZ(1,"td",23),o.TgZ(2,"td",24),o._uU(3),o.qZA(),o.TgZ(4,"td",25),o._uU(5),o.qZA(),o.TgZ(6,"td",26),o._uU(7),o.ALo(8,"currency"),o.qZA(),o.TgZ(9,"td",27),o._uU(10),o.qZA(),o.TgZ(11,"td",28),o._uU(12),o.qZA(),o.TgZ(13,"td",29),o._uU(14),o.qZA(),o.TgZ(15,"td",30),o._uU(16),o.qZA(),o.TgZ(17,"td",31),o._uU(18),o.ALo(19,"formattedDate"),o.qZA(),o.TgZ(20,"td",32),o.YNc(21,Vc,3,3,"button",33),o.qZA(),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.xp6(1),o.Q6J("table-body-checkbox",e.id),o.xp6(2),o.Oqu(e.name),o.xp6(2),o.Oqu(e.parent?e.parent.name:"-"),o.xp6(2),o.hij(" ",e.free?"Free":o.xi3(8,10,e.amount,e.currency)," "),o.xp6(3),o.Oqu(e.free?"Free":e.currency),o.xp6(2),o.Oqu(e.free?"Free":e.interval),o.xp6(2),o.hij(" ",e.parent_id?"-":e.recommended?"Yes":"No"," "),o.xp6(2),o.Oqu(e.parent_id?"-":e.position),o.xp6(2),o.Oqu(o.lcZ(19,13,e.updated_at)),o.xp6(3),o.Q6J("ngIf",n.currentUser.hasPermission("plans.update"))}}function zc(e,t){1&e&&(o.TgZ(0,"no-results-message",36),o.TgZ(1,"span",37),o._uU(2,"No plans have been created yet"),o.qZA(),o.qZA())}let Bc=(()=>{class e{constructor(e,t,n,i){this.plans=e,this.currentUser=t,this.toast=n,this.datatable=i,this.filters=Rc,this.loading$=new pt.X(!1),this.plans$=this.datatable.data$}ngOnInit(){this.datatable.init({uri:pc.o.BASE_URI})}maybeDeleteSelectedPlans(){this.datatable.confirmResourceDeletion("plans").subscribe(()=>{this.loading$.next(!0),this.plans.delete(this.datatable.selectedRows$.value).pipe((0,gt.x)(()=>{this.loading$.next(!1),this.datatable.reset()})).subscribe()})}showCrupdatePlanModal(e){this.datatable.openCrupdateResourceModal(Fc,{plan:e,plans:this.datatable.data$.value}).subscribe()}syncPlans(){this.loading$.next(!0),this.plans.sync().pipe((0,gt.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open("Synced plans across all enabled payment gateways")})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(pc.o),o.Y36(on.I),o.Y36(mt.F),o.Y36(Lt))},e.\u0275cmp=o.Xpm({type:e,selectors:[["plan-index"]],features:[o._Bn([Lt])],decls:44,vars:13,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","plans",3,"filters"],[1,"action-buttons"],["mat-raised-button","",1,"btn-with-dropdown-icon",3,"disabled","matTooltip","click"],["svgIcon","sync"],["mat-raised-button","","color","accent",1,"button-with-icon",3,"disabled","click"],["svgIcon","add"],[1,"datatable","responsive-table"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","","trans",""],["table-sort-header","parent_id","trans",""],["table-sort-header","updated_at","trans",""],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","online-payments.svg",4,"ngIf"],["colspan","10"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["mat-raised-button","","color","warn","trans","",3,"click",4,"ngIf"],["mat-raised-button","","color","warn","trans","",3,"click"],[3,"table-body-checkbox"],["data-label","Name"],["data-label","Parent Plan"],["data-label","Amount"],["data-label","Currency"],["data-label","Interval"],["data-label","Recommended"],["data-label","Position"],["data-label","Last Updated"],[1,"edit-column"],["mat-icon-button","",3,"matTooltip","click",4,"ngIf"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","edit"],["svgImage","online-payments.svg"],["primary-text","","trans",""]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"h1",1),o._uU(2,"Subscription Plans"),o.qZA(),o.TgZ(3,"div",2),o._UZ(4,"datatable-filters",3),o.TgZ(5,"div",4),o.TgZ(6,"button",5),o.NdJ("click",function(){return t.syncPlans()}),o.ALo(7,"async"),o.TgZ(8,"span",1),o._uU(9,"Sync"),o.qZA(),o._UZ(10,"mat-icon",6),o.qZA(),o.TgZ(11,"button",7),o.NdJ("click",function(){return t.showCrupdatePlanModal()}),o._UZ(12,"mat-icon",8),o.TgZ(13,"span",1),o._uU(14,"Add New Plan"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(15,"div",9),o.TgZ(16,"table",10),o.TgZ(17,"thead"),o.TgZ(18,"tr"),o._UZ(19,"th",11),o.TgZ(20,"th",12),o._uU(21,"Name"),o.qZA(),o.TgZ(22,"th",13),o._uU(23,"Parent Plan"),o.qZA(),o.TgZ(24,"th",12),o._uU(25,"Amount"),o.qZA(),o.TgZ(26,"th",12),o._uU(27,"Currency"),o.qZA(),o.TgZ(28,"th",12),o._uU(29,"Interval"),o.qZA(),o.TgZ(30,"th",12),o._uU(31,"Recommended"),o.qZA(),o.TgZ(32,"th",12),o._uU(33,"Position"),o.qZA(),o.TgZ(34,"th",14),o._uU(35,"Last Updated"),o.qZA(),o._UZ(36,"th"),o.qZA(),o.YNc(37,$c,6,4,"tr",15),o.qZA(),o.TgZ(38,"tbody"),o.YNc(39,Hc,22,15,"tr",16),o.ALo(40,"async"),o.qZA(),o.qZA(),o.YNc(41,zc,3,0,"no-results-message",17),o.ALo(42,"async"),o._UZ(43,"datatable-footer"),o.qZA()),2&e&&(o.xp6(4),o.Q6J("filters",t.filters),o.xp6(2),o.Q6J("disabled",o.lcZ(7,7,t.loading$))("matTooltip","Sync if one of payment gateways was enabled after plan has already been created"),o.xp6(5),o.Q6J("disabled",!t.currentUser.hasPermission("plans.create")),o.xp6(26),o.Q6J("ngIf",t.datatable.selectedRows$.value.length),o.xp6(2),o.Q6J("ngForOf",o.lcZ(40,9,t.plans$)),o.xp6(2),o.Q6J("ngIf",o.lcZ(42,11,t.datatable.paginator.noResults$)))},directives:[Zt.P,Ln,g.lW,k.gM,O.Hw,Vn,Gn,i.O5,i.sg,Kn,ti,ai.U],pipes:[i.Ov,i.H9,si.l,lt.R],styles:[""],changeDetection:0}),e})();var jc=n(3410),Gc=n(708),Xc=n(7678);function Wc(e,t){1&e&&(o.TgZ(0,"h2",6),o._uU(1,"Update Subscription Details"),o.qZA())}function Kc(e,t){1&e&&(o.TgZ(0,"h2",6),o._uU(1,"Create a New Subscription"),o.qZA())}function ed(e,t){if(1&e&&(o.TgZ(0,"div",35),o._uU(1),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(1),o.Oqu(e.user_id)}}function td(e,t){if(1&e&&(o.TgZ(0,"mat-option",36),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("value",e),o.xp6(1),o.Oqu(e.email)}}function nd(e,t){if(1&e&&(o.TgZ(0,"option",37),o._UZ(1,"full-plan-name",38),o._uU(2),o.ALo(3,"currency"),o.qZA()),2&e){const e=t.$implicit;o.Q6J("ngValue",e.id),o.xp6(1),o.Q6J("plan",e),o.xp6(1),o.hij(" (",o.xi3(3,3,e.amount,e.currency),") ")}}function id(e,t){if(1&e&&(o.TgZ(0,"div",35),o._uU(1),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(1),o.Oqu(e.description)}}function ad(e,t){if(1&e&&(o.TgZ(0,"div",35),o._uU(1),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(1),o.Oqu(e.renews_at)}}function sd(e,t){if(1&e&&(o.TgZ(0,"div",35),o._uU(1),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(1),o.Oqu(e.ends_at)}}function od(e,t){1&e&&(o.TgZ(0,"span",26),o._uU(1,"Update"),o.qZA())}function rd(e,t){1&e&&(o.TgZ(0,"span",26),o._uU(1,"Create"),o.qZA())}function ld(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"form",7),o.NdJ("ngSubmit",function(){return o.CHM(e),o.oxw().confirm()}),o.TgZ(1,"div",8),o.TgZ(2,"div",9),o.TgZ(3,"label",10),o._uU(4,"User"),o.qZA(),o._UZ(5,"input",11),o.YNc(6,ed,2,1,"div",12),o.TgZ(7,"mat-autocomplete",13,14),o.YNc(9,td,2,2,"mat-option",15),o.ALo(10,"async"),o.qZA(),o.qZA(),o.ynx(11,16),o.TgZ(12,"div",9),o.TgZ(13,"label",17),o._uU(14,"Plan"),o.qZA(),o.TgZ(15,"select",18),o.YNc(16,nd,4,6,"option",19),o.qZA(),o.qZA(),o.TgZ(17,"div",9),o.TgZ(18,"label",20),o._uU(19,"Description"),o.qZA(),o._UZ(20,"textarea",21),o.YNc(21,id,2,1,"div",12),o.qZA(),o.TgZ(22,"div",22),o.TgZ(23,"label",23),o._uU(24,"Renews At"),o.qZA(),o.TgZ(25,"input",24),o.NdJ("click",function(){o.CHM(e);const t=o.MAs(31);return o.oxw().toggleDatePicker(t)}),o.qZA(),o._UZ(26,"mat-datepicker-toggle",25),o.TgZ(27,"p",26),o._uU(28,"This will only change local records. User will continue to be billed on their original cycle on the payment gateway."),o.qZA(),o.YNc(29,ad,2,1,"div",12),o._UZ(30,"mat-datepicker",null,27),o.qZA(),o.TgZ(32,"div",22),o.TgZ(33,"label",28),o._uU(34,"Ends At"),o.qZA(),o.TgZ(35,"input",29),o.NdJ("click",function(){o.CHM(e);const t=o.MAs(41);return o.oxw().toggleDatePicker(t)}),o.qZA(),o.TgZ(36,"p",26),o._uU(37,"This will only change local records. User will continue to be billed on their original cycle on the payment gateway."),o.qZA(),o.YNc(38,sd,2,1,"div",12),o._UZ(39,"mat-datepicker-toggle",25),o._UZ(40,"mat-datepicker",null,30),o.qZA(),o.BQk(),o.qZA(),o.TgZ(42,"div",31),o.TgZ(43,"button",32),o.NdJ("click",function(){return o.CHM(e),o.oxw().close()}),o._uU(44,"Cancel"),o.qZA(),o.TgZ(45,"button",33),o.ALo(46,"async"),o.YNc(47,od,2,0,"span",34),o.YNc(48,rd,2,0,"span",34),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=t.ngIf,n=o.MAs(8),i=o.MAs(31),a=o.MAs(41),s=o.oxw();o.xp6(5),o.Q6J("formControl",s.userAutocomplete)("matAutocomplete",n),o.xp6(1),o.Q6J("ngIf",e.user_id),o.xp6(1),o.Q6J("displayWith",s.displayFn),o.xp6(2),o.Q6J("ngForOf",o.lcZ(10,17,s.filteredUsers)),o.xp6(2),o.Q6J("formGroup",s.form),o.xp6(5),o.Q6J("ngForOf",s.plans),o.xp6(5),o.Q6J("ngIf",e.description),o.xp6(4),o.Q6J("matDatepicker",i),o.xp6(1),o.Q6J("for",i),o.xp6(3),o.Q6J("ngIf",e.renews_at),o.xp6(6),o.Q6J("matDatepicker",a),o.xp6(3),o.Q6J("ngIf",e.ends_at),o.xp6(1),o.Q6J("for",a),o.xp6(6),o.Q6J("disabled",o.lcZ(46,19,s.loading$)),o.xp6(2),o.Q6J("ngIf",s.data.subscription),o.xp6(1),o.Q6J("ngIf",!s.data.subscription)}}let cd=(()=>{class e{constructor(e,t,n,i,s,o,r){this.dialogRef=e,this.data=t,this.subscriptions=n,this.toast=i,this.users=s,this.plansApi=o,this.fb=r,this.loading$=new pt.X(!1),this.form=this.fb.group({plan_id:[""],description:[""],renews_at:[""],ends_at:[""]}),this.errors$=new pt.X({}),this.userAutocomplete=new a.NI(null),this.filteredUsers=new b.xQ,this.plans=[],this.resetState()}ngOnInit(){this.resetState(),this.bindToUserAutocomplete(),this.fetchPlans(),this.form.get("ends_at").valueChanges.pipe((0,Xt.x)()).subscribe(e=>{e?this.form.get("renews_at").disable():this.form.get("renews_at").enable()}),this.form.get("renews_at").valueChanges.pipe((0,Xt.x)()).subscribe(e=>{e?this.form.get("ends_at").disable():this.form.get("ends_at").enable()}),this.data.subscription&&this.hydrateModel(this.data.subscription)}confirm(){let e;this.loading$.next(!0),e=this.data.subscription?this.subscriptions.update(this.data.subscription.id,this.getPayload()):this.subscriptions.create(this.getPayload()),e.pipe((0,gt.x)(()=>this.loading$.next(!1))).subscribe(e=>{this.close(e.subscription),this.toast.open("Subscription "+(this.data.subscription?"updated":"created"))},e=>this.errors$.next(e.errors))}close(e){this.resetState(),this.dialogRef.close(e)}displayFn(e){return e?e.email:null}hydrateModel(e){const t=Object.assign({},e);e.user_id&&this.userAutocomplete.setValue(e.user),this.form.patchValue(t)}getPayload(){const e=this.form.value;return!this.data.subscription&&this.userAutocomplete.value&&(e.user_id=this.userAutocomplete.value.id),e}resetState(){this.form.reset(),this.errors$.next({})}toggleDatePicker(e){e.opened?e.close():e.open()}bindToUserAutocomplete(){this.filteredUsers=this.userAutocomplete.valueChanges.pipe((0,Jt.b)(400),(0,Wt.w)(e=>e?this.users.getAll({query:e}):(0,V.of)([])))}fetchPlans(){this.plansApi.all().subscribe(e=>{this.plans=e.pagination.data,!this.form.value.plan_id&&this.plans.length&&this.form.patchValue({plan_id:this.plans[0].id})})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(m.so),o.Y36(m.WI),o.Y36(Gc.t),o.Y36(mt.F),o.Y36(en.Q),o.Y36(pc.o),o.Y36(a.qu))},e.\u0275cmp=o.Xpm({type:e,selectors:[["crupdate-subscription-modal"]],decls:9,vars:8,consts:[[1,"modal-header"],["class","modal-title","mat-dialog-title","","trans","",4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["autocomplete","off","ngNativeValidate","",3,"ngSubmit",4,"ngIf"],[1,"overlay",3,"isVisible"],["mat-dialog-title","","trans","",1,"modal-title"],["autocomplete","off","ngNativeValidate","",3,"ngSubmit"],["mat-dialog-content","",1,"many-inputs","mat-dialog-content"],[1,"input-container"],["for","user","trans",""],["type","text","id","user","placeholder","Search for user...","required","",3,"formControl","matAutocomplete"],["class","error",4,"ngIf"],[3,"displayWith"],["auto","matAutocomplete"],[3,"value",4,"ngFor","ngForOf"],[3,"formGroup"],["for","plan","trans",""],["id","plan","formControlName","plan_id","required",""],[3,"ngValue",4,"ngFor","ngForOf"],["for","description","trans",""],["id","description","formControlName","description"],[1,"input-container","date-picker-input-container"],["for","renews_at","trans",""],["id","renews_at","formControlName","renews_at",3,"matDatepicker","click"],[3,"for"],["trans",""],["renewsAtDatePicker",""],["for","ends_at","trans",""],["id","ends_at","formControlName","ends_at",3,"matDatepicker","click"],["endsAtDatePicker",""],["mat-dialog-actions","",1,"buttons","right","mat-dialog-actions"],["type","button","mat-button","","trans","",1,"button","cancel",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary",3,"disabled"],["trans","",4,"ngIf"],[1,"error"],[3,"value"],[3,"ngValue"],[3,"plan"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.YNc(1,Wc,2,0,"h2",1),o.YNc(2,Kc,2,0,"h2",1),o.TgZ(3,"button",2),o.NdJ("click",function(){return t.close()}),o._UZ(4,"mat-icon",3),o.qZA(),o.qZA(),o.YNc(5,ld,49,21,"form",4),o.ALo(6,"async"),o._UZ(7,"loading-indicator",5),o.ALo(8,"async")),2&e&&(o.xp6(1),o.Q6J("ngIf",t.data.subscription),o.xp6(1),o.Q6J("ngIf",!t.data.subscription),o.xp6(3),o.Q6J("ngIf",o.lcZ(6,4,t.errors$)),o.xp6(2),o.Q6J("isVisible",o.lcZ(8,6,t.loading$)))},directives:[i.O5,O.Hw,At.Q,m.uh,Zt.P,a.JL,a.F,m.xY,a.Fj,u.ZL,a.Q7,a.JJ,a.oH,u.XC,i.sg,a.sg,a.EJ,a.u,je,Xe,$e,m.H8,g.lW,x.ey,a.YN,a.Kr,Xc.T],pipes:[i.Ov,i.H9],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}.date-picker-input-container[_ngcontent-%COMP%]{position:relative}.mat-datepicker-toggle[_ngcontent-%COMP%]{position:absolute;top:29px;right:0}.mat-autocomplete-panel[_ngcontent-%COMP%]   .mat-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0}"],changeDetection:0}),e})();const dd=[new $t({type:Vt.Select,key:"ends_at",label:"Status",description:"Whether subscription is active or cancelled",defaultValue:{value:null,operator:Ht.eq},options:[{key:"Active",value:{value:null,operator:Ht.eq}},{key:"Cancelled",value:{value:null,operator:Ht.ne}}]}),new $t({type:Vt.Select,key:"gateway_name",label:"Gateway",description:"With which payment provider was subscription created",defaultValue:"stripe",options:[{key:"Stripe",value:"stripe"},{key:"Paypal",value:"paypal"},{key:"None",value:null}]}),new jt({description:"Date subscription was created"}),new Gt({description:"Date subscription was last updated"})];function ud(e,t){1&e&&o._UZ(0,"mat-icon",25)}function gd(e,t){1&e&&(o.TgZ(0,"span"),o._uU(1,"-"),o.qZA())}function pd(e,t){1&e&&o._UZ(0,"mat-icon",25)}function hd(e,t){1&e&&(o.TgZ(0,"span"),o._uU(1,"-"),o.qZA())}function md(e,t){if(1&e){const e=o.EpF();o.ynx(0),o.TgZ(1,"button",26),o.NdJ("click",function(){o.CHM(e);const t=o.oxw().$implicit;return o.oxw().openCrupdateSubscriptionModal(t)}),o.ALo(2,"trans"),o._UZ(3,"mat-icon",27),o.qZA(),o.TgZ(4,"button",28),o.NdJ("click",function(){o.CHM(e);const t=o.oxw().$implicit;return o.oxw().maybeCancelSubscription(t)}),o.ALo(5,"trans"),o._UZ(6,"mat-icon",29),o.qZA(),o.TgZ(7,"button",26),o.NdJ("click",function(){o.CHM(e);const t=o.oxw().$implicit;return o.oxw().maybeDeleteSubscription(t)}),o.ALo(8,"trans"),o._UZ(9,"mat-icon",30),o.qZA(),o.BQk()}if(2&e){const e=o.oxw().$implicit;o.xp6(1),o.Q6J("matTooltip",o.lcZ(2,4,"Edit")),o.xp6(3),o.Q6J("disabled",e.cancelled)("matTooltip",o.lcZ(5,6,"Cancel/Suspend")),o.xp6(3),o.Q6J("matTooltip",o.lcZ(8,8,"Delete"))}}function fd(e,t){if(1&e&&(o.TgZ(0,"tr"),o.TgZ(1,"td"),o._UZ(2,"user-column",15),o.qZA(),o.TgZ(3,"td",16),o._uU(4),o.qZA(),o.TgZ(5,"td",17),o.YNc(6,ud,1,0,"mat-icon",18),o.YNc(7,gd,2,0,"span",19),o.qZA(),o.TgZ(8,"td",20),o.YNc(9,pd,1,0,"mat-icon",18),o.YNc(10,hd,2,0,"span",19),o.qZA(),o.TgZ(11,"td",21),o._uU(12),o.ALo(13,"formattedDate"),o.qZA(),o.TgZ(14,"td",22),o._uU(15),o.ALo(16,"formattedDate"),o.qZA(),o.TgZ(17,"td",23),o._uU(18),o.ALo(19,"formattedDate"),o.qZA(),o.TgZ(20,"td",24),o.YNc(21,md,10,10,"ng-container",19),o.qZA(),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.xp6(2),o.Q6J("user",e.user),o.xp6(2),o.Oqu(e.gateway_name),o.xp6(2),o.Q6J("ngIf",e.cancelled),o.xp6(1),o.Q6J("ngIf",!e.cancelled),o.xp6(2),o.Q6J("ngIf",e.on_grace_period),o.xp6(1),o.Q6J("ngIf",!e.on_grace_period),o.xp6(2),o.Oqu(e.renews_at?o.lcZ(13,10,e.renews_at):"-"),o.xp6(3),o.Oqu(e.ends_at?o.lcZ(16,12,e.ends_at):"-"),o.xp6(3),o.Oqu(o.lcZ(19,14,e.created_at)),o.xp6(3),o.Q6J("ngIf",n.currentUser.hasPermission("subscriptions.delete"))}}function _d(e,t){1&e&&(o.TgZ(0,"no-results-message",31),o.TgZ(1,"span",32),o._uU(2,"No subscriptions have been created yet"),o.qZA(),o.qZA())}let bd=(()=>{class e{constructor(e,t,n,i,a){this.modal=e,this.subscriptions=t,this.currentUser=n,this.toast=i,this.datatable=a,this.filters=dd,this.loading$=new pt.X(!1),this.subscriptions$=this.datatable.data$}ngOnInit(){this.datatable.init({uri:Gc.t.BASE_URI})}maybeCancelSubscription(e){this.modal.open(Nt.z,{title:"Cancel Subscription",body:"Are you sure you want to cancel this subscription?",bodyBold:"This will cancel or suspend subscription based on its gateway and put user on grace period until their next scheduled renewal date and allow them to renew the subscription.",ok:"Cancel",cancel:"Go Back"}).afterClosed().subscribe(t=>{t&&this.cancelOrDeleteSubscription(e,{delete:!1})})}maybeDeleteSubscription(e){this.modal.open(Nt.z,{title:"Delete Subscription",body:"Are you sure you want to delete this subscription?",bodyBold:"This will permanently delete user subscription and immediately cancel it on billing gateway.",ok:"Delete",cancel:"Go Back"}).afterClosed().subscribe(t=>{t&&this.cancelOrDeleteSubscription(e,{delete:!0})})}cancelOrDeleteSubscription(e,t={}){this.loading$.next(!0),this.subscriptions.cancel(e.id,{delete:t.delete}).pipe((0,gt.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.datatable.reset(),this.toast.open("Subscription cancelled.")})}openCrupdateSubscriptionModal(e){this.modal.open(cd,{subscription:e}).afterClosed().subscribe(e=>{e&&this.datatable.reset()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(ft.u),o.Y36(Gc.t),o.Y36(on.I),o.Y36(mt.F),o.Y36(Lt))},e.\u0275cmp=o.Xpm({type:e,selectors:[["subscription-index"]],features:[o._Bn([Lt])],decls:35,vars:8,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","subscriptions",3,"filters"],[1,"action-buttons"],["mat-raised-button","","color","accent",1,"button-with-icon",3,"disabled","click"],["svgIcon","add"],[1,"datatable","responsive-table"],[1,"material-table"],["table-sort-header","user_id","trans",""],["table-sort-header","","trans",""],["table-sort-header","ends_at","trans",""],["table-sort-header","created_at","trans",""],[4,"ngFor","ngForOf"],["svgImage","subscriptions.svg",4,"ngIf"],[3,"user"],["data-label","Gateway"],["data-label","Cancelled"],["svgIcon","check",4,"ngIf"],[4,"ngIf"],["data-label","On Grace Period"],["data-label","Renews At"],["data-label","Ends At"],["data-label","Created At"],[1,"edit-column"],["svgIcon","check"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","edit"],["mat-icon-button","",3,"disabled","matTooltip","click"],["svgIcon","pause"],["svgIcon","delete"],["svgImage","subscriptions.svg"],["primary-text","","trans",""]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"h1",1),o._uU(2,"Subscriptions"),o.qZA(),o.TgZ(3,"div",2),o._UZ(4,"datatable-filters",3),o.TgZ(5,"div",4),o.TgZ(6,"button",5),o.NdJ("click",function(){return t.openCrupdateSubscriptionModal()}),o._UZ(7,"mat-icon",6),o.TgZ(8,"span",1),o._uU(9,"Add New Subscription"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(10,"div",7),o.TgZ(11,"table",8),o.TgZ(12,"thead"),o.TgZ(13,"tr"),o.TgZ(14,"th",9),o._uU(15,"User"),o.qZA(),o.TgZ(16,"th",10),o._uU(17,"Gateway"),o.qZA(),o.TgZ(18,"th",11),o._uU(19,"Cancelled"),o.qZA(),o.TgZ(20,"th",1),o._uU(21,"On Grace Period"),o.qZA(),o.TgZ(22,"th",10),o._uU(23,"Renews At"),o.qZA(),o.TgZ(24,"th",10),o._uU(25,"Ends At"),o.qZA(),o.TgZ(26,"th",12),o._uU(27,"Created At"),o.qZA(),o._UZ(28,"th"),o.qZA(),o.qZA(),o.TgZ(29,"tbody"),o.YNc(30,fd,22,16,"tr",13),o.ALo(31,"async"),o.qZA(),o.qZA(),o.YNc(32,_d,3,0,"no-results-message",14),o.ALo(33,"async"),o._UZ(34,"datatable-footer"),o.qZA()),2&e&&(o.xp6(4),o.Q6J("filters",t.filters),o.xp6(2),o.Q6J("disabled",!t.currentUser.hasPermission("subscriptions.create")),o.xp6(24),o.Q6J("ngForOf",o.lcZ(31,4,t.subscriptions$)),o.xp6(2),o.Q6J("ngIf",o.lcZ(33,6,t.datatable.paginator.noResults$)))},directives:[Zt.P,Ln,g.lW,O.Hw,Gn,i.sg,i.O5,Kn,ii,k.gM,ai.U],pipes:[i.Ov,si.l,lt.R],styles:[""],changeDetection:0}),e})();function vd(e,t){if(1&e&&(o.TgZ(0,"option",26),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("value",e.action),o.xp6(1),o.Oqu(e.label)}}function Zd(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",17),o.TgZ(1,"label",22),o._uU(2,"Learn More Link"),o.qZA(),o.TgZ(3,"select",23),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).state.client["cookie_notice.learn_more"]=t}),o.TgZ(4,"option",24),o._uU(5,"None (Hide learn more link)"),o.qZA(),o.YNc(6,vd,2,2,"option",25),o.qZA(),o.qZA()}if(2&e){const e=t.ngIf,n=o.oxw(2);o.xp6(3),o.Q6J("ngModel",n.state.client["cookie_notice.learn_more"]),o.xp6(3),o.Q6J("ngForOf",e.items)}}function xd(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",15),o.YNc(1,Zd,7,2,"div",16),o.ALo(2,"async"),o.TgZ(3,"div",17),o.TgZ(4,"div",17),o.TgZ(5,"label",18),o._uU(6,"Cookie Notice Position"),o.qZA(),o.TgZ(7,"select",19),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.client["cookie_notice.position"]=t}),o.TgZ(8,"option",20),o._uU(9,"Top"),o.qZA(),o.TgZ(10,"option",21),o._uU(11,"Bottom"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=o.oxw();o.xp6(1),o.Q6J("ngIf",o.lcZ(2,2,e.customPages$)),o.xp6(6),o.Q6J("ngModel",e.state.client["cookie_notice.position"])}}function Ad(e,t){if(1&e&&o._UZ(0,"input",39),2&e){const e=o.oxw().index;o.MGl("id","policy-action-",e,"")}}function yd(e,t){if(1&e&&(o.TgZ(0,"option",26),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("value",e.action),o.xp6(1),o.Oqu(e.label)}}function wd(e,t){if(1&e&&(o.TgZ(0,"select",40),o.YNc(1,yd,2,2,"option",25),o.ALo(2,"async"),o.qZA()),2&e){const e=o.oxw().index,t=o.oxw();o.MGl("id","policy-action-",e,""),o.xp6(1),o.Q6J("ngForOf",o.lcZ(2,2,t.customPages$).items)}}function Cd(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"li",27),o.TgZ(1,"div",17),o.TgZ(2,"label",28),o.TgZ(3,"span",6),o._uU(4,"Name"),o.qZA(),o.TgZ(5,"button",29),o.NdJ("click",function(){const t=o.CHM(e).index;return o.oxw().removeRegisterPolicy(t)}),o._UZ(6,"mat-icon",30),o.qZA(),o.qZA(),o._UZ(7,"input",31),o.qZA(),o.TgZ(8,"div",17),o.TgZ(9,"label",32),o._uU(10,"Link"),o.qZA(),o.TgZ(11,"div",33),o.TgZ(12,"select",34),o.NdJ("change",function(){const t=o.CHM(e).$implicit;return o.oxw().onPolicyTypeChange(t)}),o.TgZ(13,"option",35),o._uU(14,"Page"),o.qZA(),o.TgZ(15,"option",36),o._uU(16,"Link"),o.qZA(),o.qZA(),o.YNc(17,Ad,1,1,"input",37),o.YNc(18,wd,3,4,"select",38),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=t.$implicit,n=t.index;o.Q6J("formGroup",e),o.xp6(2),o.MGl("for","policy-name-",n,""),o.xp6(3),o.Q6J("disableRipple",!0),o.xp6(2),o.MGl("id","policy-name-",n,""),o.xp6(2),o.MGl("for","policy-action-",n,""),o.xp6(3),o.MGl("id","policy-type-",n,""),o.xp6(5),o.Q6J("ngIf","link"===e.value.type),o.xp6(1),o.Q6J("ngIf","page"===e.value.type)}}function Td(e,t){1&e&&o._UZ(0,"mat-progress-bar",41)}let qd=(()=>{class e extends vt{constructor(){super(...arguments),this.customPages$=new pt.X({name:"",items:[]}),this.registerPolicies=new a.Oe([])}ngOnInit(){this.valueLists.get(["menuItemCategories"]).subscribe(e=>{this.customPages$.next(e.menuItemCategories.find(e=>"Custom Page"===e.name))}),this.settings.getJson("register_policies",[]).forEach(e=>{this.addRegisterPolicy(e)})}saveSettings(){const e=this.state.getModified();e.client.register_policies=JSON.stringify(this.registerPolicies.value),super.saveSettings(e)}addRegisterPolicy(e={}){this.registerPolicies.push(new a.cw({label:new a.NI(e.label||""),action:new a.NI(e.action||this.getFirstCustomPageAction()),type:new a.NI(e.type||"page")}))}removeRegisterPolicy(e){this.registerPolicies.removeAt(e)}onPolicyTypeChange(e){e.get("action").reset(),"page"===e.get("type").value&&e.get("action").setValue(this.getFirstCustomPageAction())}getFirstCustomPageAction(){return this.customPages$.value.items[0]&&this.customPages$.value.items[0].action}}return e.\u0275fac=function(){let t;return function(n){return(t||(t=o.n5z(e)))(n||e)}}(),e.\u0275cmp=o.Xpm({type:e,selectors:[["gdpr-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:27,vars:9,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["ngNativeValidate","",1,"body","many-inputs",3,"ngSubmit"],[1,"setting-toggle-container"],["name","cookie_notice.enable","id","cookie_notice.enable","trans","",3,"ngModel","ngModelChange"],["trans",""],["class","error-group many-inputs",4,"ngIf"],[1,"error-group","no-border-top","no-bottom-border","policies-group"],["type","button","mat-icon-button","","color","accent",1,"add-policy-button",3,"click"],["svgIcon","add"],[1,"unstyled-list"],["class","many-inputs policy-list-item",3,"formGroup",4,"ngFor","ngForOf"],["mat-raised-button","","color","accent","type","submit","trans","",1,"button","primary","update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],[1,"error-group","many-inputs"],["class","input-container",4,"ngIf"],[1,"input-container"],["for","cookie-notice-position","trans",""],["id","cookie-notice-position","name","cookie-notice-position",3,"ngModel","ngModelChange"],["value","top","trans",""],["value","bottom","trans",""],["for","cookie_notice.learn_more"],["id","cookie_notice.learn_more","name","cookie_notice.learn_more",3,"ngModel","ngModelChange"],["value","","trans",""],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[1,"many-inputs","policy-list-item",3,"formGroup"],[1,"policy-name-label",3,"for"],["mat-icon-button","","color","warn",3,"disableRipple","click"],["svgIcon","remove"],["type","text","formControlName","label","required","",3,"id"],["trans","",3,"for"],[1,"inline-inputs"],["formControlName","type",1,"policy-type-select",3,"id","change"],["value","page","trans",""],["value","link","trans",""],["type","url","class","policy-action-input","formControlName","action","placeholder","Optional...","trans-placeholder","",3,"id",4,"ngIf"],["class","policy-action-input","formControlName","action",3,"id",4,"ngIf"],["type","url","formControlName","action","placeholder","Optional...","trans-placeholder","",1,"policy-action-input",3,"id"],["formControlName","action",1,"policy-action-input",3,"id"],["mode","indeterminate","color","accent"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"GDPR"),o.qZA(),o.TgZ(3,"div",2),o._uU(4,"Configure settings related to EU General Data Protection Regulation."),o.qZA(),o.qZA(),o.TgZ(5,"form",3),o.NdJ("ngSubmit",function(){return t.saveSettings()}),o.TgZ(6,"div",4),o.TgZ(7,"mat-slide-toggle",5),o.NdJ("ngModelChange",function(e){return t.state.client["cookie_notice.enable"]=e}),o._uU(8,"Enable Cookie Notice"),o.qZA(),o.TgZ(9,"p",6),o._uU(10,"Whether cookie notice should be shown automatically to users from EU until it is accepted."),o.qZA(),o.qZA(),o.YNc(11,xd,12,4,"div",7),o.TgZ(12,"div",8),o.TgZ(13,"h2"),o.TgZ(14,"span"),o._uU(15,"Registration Page Policies"),o.qZA(),o.TgZ(16,"button",9),o.NdJ("click",function(){return t.addRegisterPolicy()}),o._UZ(17,"mat-icon",10),o.qZA(),o.qZA(),o.TgZ(18,"p",6),o._uU(19,"Here you can create policies that will be shown on registration page and user will be required to accept them by toggling a checkbox."),o.qZA(),o.TgZ(20,"ul",11),o.YNc(21,Cd,19,8,"li",12),o.qZA(),o.qZA(),o.TgZ(22,"button",13),o.ALo(23,"async"),o._uU(24,"Update"),o.qZA(),o.YNc(25,Td,1,0,"mat-progress-bar",14),o.ALo(26,"async"),o.qZA()),2&e&&(o.xp6(7),o.Q6J("ngModel",t.state.client["cookie_notice.enable"]),o.xp6(4),o.Q6J("ngIf",t.state.client["cookie_notice.enable"]),o.xp6(10),o.Q6J("ngForOf",t.registerPolicies.controls),o.xp6(1),o.Q6J("disabled",o.lcZ(23,5,t.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(26,7,t.loading$)))},directives:[Zt.P,a.JL,a.F,T.Rr,a.JJ,a.On,i.O5,g.lW,O.Hw,i.sg,a.EJ,a.YN,a.Kr,a.sg,a.Fj,a.u,a.Q7,s.pW],pipes:[i.Ov],styles:[".error-group[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:0}.add-policy-button[_ngcontent-%COMP%]{flex-shrink:0;margin-left:auto}.inline-inputs[_ngcontent-%COMP%]{display:flex}.input-container[_ngcontent-%COMP%]   .policy-type-select[_ngcontent-%COMP%]{max-width:100px;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0}.policy-action-input[_ngcontent-%COMP%]{border-bottom-left-radius:0;border-top-left-radius:0}.policy-list-item[_ngcontent-%COMP%]:not(:last-of-type){border-bottom:1px solid var(--be-divider-lighter);margin-bottom:20px}.policies-group[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{color:var(--be-secondary-text);margin:0 0 20px}.policy-name-label[_ngcontent-%COMP%]{display:flex;align-items:center}.policy-name-label[_ngcontent-%COMP%]   .mat-icon-button[_ngcontent-%COMP%]{margin-left:auto;flex-shrink:0;width:20px;height:20px;line-height:20px}"],changeDetection:0}),e})(),kd=(()=>{class e{constructor(e){this.http=e}index(t){return this.http.get(e.BASE_URI,t)}create(t){return this.http.post(e.BASE_URI,t)}update(t,n){return this.http.put(`${e.BASE_URI}/${t}`,n)}delete(t){return this.http.delete(`${e.BASE_URI}/${t}`)}}return e.BASE_URI="tags",e.\u0275fac=function(t){return new(t||e)(o.LFG(r.r))},e.\u0275prov=o.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function Md(e,t){1&e&&(o.TgZ(0,"span",10),o._uU(1,"Update Tag"),o.qZA())}function Id(e,t){1&e&&(o.TgZ(0,"span",10),o._uU(1,"Create a New Tag"),o.qZA())}function Ud(e,t){if(1&e&&(o.TgZ(0,"div",19),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Oqu(e.errors.name)}}function Jd(e,t){if(1&e&&(o.TgZ(0,"div",19),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Oqu(e.errors.display_name)}}function Dd(e,t){if(1&e&&(o.TgZ(0,"option",20),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("value",e.name),o.xp6(1),o.Oqu(e.name)}}function Od(e,t){if(1&e&&(o.TgZ(0,"div",19),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Oqu(e.errors.type)}}function Pd(e,t){1&e&&(o.TgZ(0,"span",10),o._uU(1,"Update"),o.qZA())}function Sd(e,t){1&e&&(o.TgZ(0,"span",10),o._uU(1,"Create"),o.qZA())}let Nd=(()=>{class e{constructor(e,t,n,i,s){this.dialogRef=e,this.data=t,this.toast=n,this.tags=i,this.settings=s,this.errors={},this.isSystemTag=!1,this.form=new a.cw({name:new a.NI(""),display_name:new a.NI(""),type:new a.NI("")}),this.hydrate()}close(e){this.errors={},this.dialogRef.close(e)}hydrate(){var e,t,n;this.tagTypes=this.settings.get("vebto.admin.tagTypes",[]),this.data.tag?this.form.patchValue(this.data.tag):this.form.get("type").patchValue(this.data.forceType||(null===(e=this.tagTypes[0])||void 0===e?void 0:e.name)||"");const i=this.data.forceType||(null===(t=this.data.tag)||void 0===t?void 0:t.type);this.isSystemTag=null===(n=this.tagTypes.find(e=>e.name===i))||void 0===n?void 0:n.system,(this.isSystemTag||this.data.forceType)&&this.form.get("type").disable(),this.isSystemTag&&this.form.get("name").disable()}confirm(){(this.data.tag?this.tags.update(this.data.tag.id,this.form.getRawValue()):this.tags.create(this.form.getRawValue())).subscribe(e=>{this.toast.open("Tag "+(this.data.tag?"Updated":"Created")),this.close(e.tag)},e=>this.errors=e.errors)}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(m.so),o.Y36(m.WI),o.Y36(mt.F),o.Y36(kd),o.Y36(st.Z))},e.\u0275cmp=o.Xpm({type:e,selectors:[["crupdate-tag-modal"]],decls:34,vars:9,consts:[[1,"modal-header"],["mat-dialog-title",""],["trans","",4,"ngIf"],["type","button","mat-icon-button","","tabindex","-1",1,"close-button",3,"click"],["svgIcon","close"],["autocomplete","off","ngNativeValidate","",3,"formGroup","ngSubmit"],[1,"many-inputs"],[1,"input-container"],["for","crupdate-tag-modal-name","trans",""],["type","text","id","crupdate-tag-modal-name","formControlName","name","required",""],["trans",""],["class","error",4,"ngIf"],["for","display_name","trans",""],["type","text","formControlName","display_name","id","display_name"],["for","crupdate_tag_modal_type","trans",""],["formControlName","type","id","crupdate_tag_modal_type","required","",1,"capitalize"],["trans","",3,"value",4,"ngFor","ngForOf"],["type","button","mat-button","","trans","",1,"cancel-button",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"submit-button"],[1,"error"],["trans","",3,"value"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"h2",1),o.YNc(2,Md,2,0,"span",2),o.YNc(3,Id,2,0,"span",2),o.qZA(),o.TgZ(4,"button",3),o.NdJ("click",function(){return t.close()}),o._UZ(5,"mat-icon",4),o.qZA(),o.qZA(),o.TgZ(6,"form",5),o.NdJ("ngSubmit",function(){return t.confirm()}),o.TgZ(7,"mat-dialog-content",6),o.TgZ(8,"div",7),o.TgZ(9,"label",8),o._uU(10,"Name"),o.qZA(),o._UZ(11,"input",9),o.TgZ(12,"p",10),o._uU(13,"Unique tag identifier."),o.qZA(),o.YNc(14,Ud,2,1,"div",11),o.qZA(),o.TgZ(15,"div",7),o.TgZ(16,"label",12),o._uU(17,"Display Name"),o.qZA(),o._UZ(18,"input",13),o.TgZ(19,"p",10),o._uU(20,"User friendly tag name."),o.qZA(),o.YNc(21,Jd,2,1,"div",11),o.qZA(),o.TgZ(22,"div",7),o.TgZ(23,"label",14),o._uU(24,"Type"),o.qZA(),o.TgZ(25,"select",15),o.YNc(26,Dd,2,2,"option",16),o.qZA(),o.YNc(27,Od,2,1,"div",11),o.qZA(),o.qZA(),o.TgZ(28,"mat-dialog-actions"),o.TgZ(29,"button",17),o.NdJ("click",function(){return t.close()}),o._uU(30,"Cancel"),o.qZA(),o.TgZ(31,"button",18),o.YNc(32,Pd,2,0,"span",2),o.YNc(33,Sd,2,0,"span",2),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(2),o.Q6J("ngIf",t.data.tag),o.xp6(1),o.Q6J("ngIf",!t.data.tag),o.xp6(3),o.Q6J("formGroup",t.form),o.xp6(8),o.Q6J("ngIf",t.errors.name),o.xp6(7),o.Q6J("ngIf",t.errors.display_name),o.xp6(5),o.Q6J("ngForOf",t.tagTypes),o.xp6(1),o.Q6J("ngIf",t.errors.type),o.xp6(5),o.Q6J("ngIf",t.data.tag),o.xp6(1),o.Q6J("ngIf",!t.data.tag))},directives:[m.uh,i.O5,g.lW,O.Hw,a.JL,a.sg,m.xY,Zt.P,a.Fj,a.JJ,a.u,a.Q7,a.EJ,i.sg,m.H8,a.YN,a.Kr],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}.capitalize[_ngcontent-%COMP%]{text-transform:capitalize}"]}),e})();function Qd(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",14),o.NdJ("click",function(){return o.CHM(e),o.oxw().showCrupdateTagModal()}),o._UZ(1,"mat-icon",15),o.TgZ(2,"span",1),o._uU(3,"Add New Tag"),o.qZA(),o.qZA()}}const Yd=function(e){return{count:e,resource:"tag(s)"}};function Fd(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"tr"),o.TgZ(1,"th",16),o.TgZ(2,"div",17),o._uU(3," :count :resource selected: "),o.qZA(),o.TgZ(4,"div",18),o.TgZ(5,"button",19),o.NdJ("click",function(){return o.CHM(e),o.oxw().maybeDeleteSelectedTags()}),o._uU(6," Delete "),o.qZA(),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=t.ngIf,n=o.oxw();o.xp6(2),o.Q6J("transValues",o.VKq(2,Yd,e)),o.xp6(3),o.Q6J("disabled",!n.currentUser.hasPermission("tags.delete"))}}function Rd(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",27),o.NdJ("click",function(){o.CHM(e);const t=o.oxw().$implicit;return o.oxw().showCrupdateTagModal(t)}),o.ALo(1,"trans"),o._UZ(2,"mat-icon",28),o.qZA()}2&e&&o.Q6J("matTooltip",o.lcZ(1,1,"Edit tag"))}function Ed(e,t){if(1&e&&(o.TgZ(0,"tr"),o._UZ(1,"td",20),o.TgZ(2,"td",21),o._uU(3),o.qZA(),o.TgZ(4,"td",22),o._uU(5),o.qZA(),o.TgZ(6,"td",23),o._uU(7),o.qZA(),o.TgZ(8,"td",24),o._uU(9),o.ALo(10,"formattedDate"),o.qZA(),o.TgZ(11,"td",25),o.YNc(12,Rd,3,3,"button",26),o.qZA(),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.xp6(1),o.Q6J("table-body-checkbox",e.id),o.xp6(2),o.Oqu(e.name),o.xp6(2),o.Oqu(e.type),o.xp6(2),o.Oqu(e.display_name),o.xp6(2),o.hij(" ",e.updated_at?o.lcZ(10,6,e.updated_at):"-"," "),o.xp6(3),o.Q6J("ngIf",n.currentUser.hasPermission("tags.update"))}}function Ld(e,t){1&e&&(o.TgZ(0,"no-results-message",29),o.TgZ(1,"span",30),o._uU(2,"No tags have been created yet"),o.qZA(),o.qZA())}let $d=(()=>{class e{constructor(e,t,n,i){var a;this.tags=e,this.currentUser=t,this.datatable=n,this.settings=i,this.filters=(a=this.settings.get("vebto.admin.tagTypes"),[new $t({type:Vt.Select,key:"type",description:"Type of the link",defaultValue:a[0].name,options:a.map(e=>({key:e.name,value:e.name}))}),new jt({description:"Date tag was created"}),new Gt({description:"Date tag was last updated"})]),this.tags$=this.datatable.data$}ngOnInit(){this.datatable.init({uri:kd.BASE_URI})}maybeDeleteSelectedTags(){this.datatable.confirmResourceDeletion("tags").subscribe(()=>{this.tags.delete(this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset()})})}showCrupdateTagModal(e){this.datatable.openCrupdateResourceModal(Nd,{tag:e}).subscribe()}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(kd),o.Y36(on.I),o.Y36(Lt),o.Y36(st.Z))},e.\u0275cmp=o.Xpm({type:e,selectors:[["tags"]],features:[o._Bn([Lt])],decls:29,vars:9,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","tags",3,"filters"],[1,"action-buttons"],["mat-raised-button","","color","accent","class","button-with-icon",3,"click",4,"ngIf"],[1,"datatable","responsive-table"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","","trans",""],["table-sort-header","updated_at","trans",""],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","folder.svg",4,"ngIf"],["mat-raised-button","","color","accent",1,"button-with-icon",3,"click"],["svgIcon","add"],["colspan","6"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["type","button","mat-raised-button","","color","warn","trans","",3,"disabled","click"],[3,"table-body-checkbox"],["data-label","Name"],["data-label","Type"],["data-label","Display Name"],["data-label","Last Updated"],[1,"edit-column"],["mat-icon-button","",3,"matTooltip","click",4,"ngIf"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","edit"],["svgImage","folder.svg"],["primary-text","","trans",""]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"h1",1),o.TgZ(2,"span",1),o._uU(3,"Tags"),o.qZA(),o.qZA(),o.TgZ(4,"div",2),o._UZ(5,"datatable-filters",3),o.TgZ(6,"div",4),o.YNc(7,Qd,4,0,"button",5),o.qZA(),o.qZA(),o.qZA(),o.TgZ(8,"div",6),o.TgZ(9,"table",7),o.TgZ(10,"thead"),o.TgZ(11,"tr"),o._UZ(12,"th",8),o.TgZ(13,"th",9),o._uU(14,"Name"),o.qZA(),o.TgZ(15,"th",9),o._uU(16,"Type"),o.qZA(),o.TgZ(17,"th",9),o._uU(18,"Display Name"),o.qZA(),o.TgZ(19,"th",10),o._uU(20,"Last Updated"),o.qZA(),o._UZ(21,"th"),o.qZA(),o.YNc(22,Fd,7,4,"tr",11),o.qZA(),o.TgZ(23,"tbody"),o.YNc(24,Ed,13,8,"tr",12),o.ALo(25,"async"),o.qZA(),o.qZA(),o.YNc(26,Ld,3,0,"no-results-message",13),o.ALo(27,"async"),o._UZ(28,"datatable-footer"),o.qZA()),2&e&&(o.xp6(5),o.Q6J("filters",t.filters),o.xp6(2),o.Q6J("ngIf",t.currentUser.hasPermission("tags.create")),o.xp6(15),o.Q6J("ngIf",t.datatable.selectedRows$.value.length),o.xp6(2),o.Q6J("ngForOf",o.lcZ(25,5,t.tags$)),o.xp6(2),o.Q6J("ngIf",o.lcZ(27,7,t.datatable.paginator.noResults$)))},directives:[Zt.P,Ln,i.O5,Vn,Gn,i.sg,Kn,g.lW,O.Hw,ti,k.gM,ai.U],pipes:[i.Ov,si.l,lt.R],encapsulation:2}),e})();var Vd=n(6251);const Hd=[new Gt({description:"Date the page was last updated"}),new jt({description:"Date the page was created"}),new $t({type:Vt.SelectModel,key:"user_id",label:"User",description:"User page was created by",component:nn})];function zd(e,t){1&e&&(o.TgZ(0,"a",16),o._UZ(1,"mat-icon",17),o.TgZ(2,"span",1),o._uU(3,"Add New Page"),o.qZA(),o.qZA())}function Bd(e,t){1&e&&o._UZ(0,"mat-progress-bar",18)}function jd(e,t){1&e&&(o.TgZ(0,"th",19),o._uU(1,"Type"),o.qZA())}const Gd=function(e){return{count:e,resource:"page(s)"}};function Xd(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"tr"),o.TgZ(1,"th",20),o.TgZ(2,"div",21),o._uU(3," :count :resource selected: "),o.qZA(),o.TgZ(4,"div",22),o.TgZ(5,"button",23),o.NdJ("click",function(){return o.CHM(e),o.oxw().maybeDeleteSelectedPages()}),o._uU(6," Delete "),o.qZA(),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=t.ngIf;o.xp6(2),o.Q6J("transValues",o.VKq(1,Gd,e))}}function Wd(e,t){if(1&e&&(o.TgZ(0,"td",36),o._uU(1),o.qZA()),2&e){const e=o.oxw().$implicit,t=o.oxw();o.xp6(1),o.hij(" ",e.type?t.viewName(e.type):"default"," ")}}const Kd=function(e){return[e,"edit"]};function eu(e,t){if(1&e&&(o.TgZ(0,"a",37),o.ALo(1,"trans"),o._UZ(2,"mat-icon",38),o.qZA()),2&e){const e=o.oxw().$implicit;o.Q6J("routerLink",o.VKq(4,Kd,e.id))("matTooltip",o.lcZ(1,2,"Edit page"))}}function tu(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"tr"),o._UZ(1,"td",24),o.TgZ(2,"td",25),o.TgZ(3,"a",26),o._uU(4),o.qZA(),o.qZA(),o.TgZ(5,"td",27),o._UZ(6,"user-column",28),o.qZA(),o.TgZ(7,"td",29),o._uU(8),o.qZA(),o.YNc(9,Wd,2,1,"td",30),o.TgZ(10,"td",31),o._uU(11),o.ALo(12,"formattedDate"),o.qZA(),o.TgZ(13,"td",32),o.YNc(14,eu,3,6,"a",33),o.TgZ(15,"button",34),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().maybeDeleteSelectedPages([t.id])}),o._UZ(16,"mat-icon",35),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=t.$implicit,n=o.oxw();o.xp6(1),o.Q6J("table-body-checkbox",e.id),o.xp6(2),o.Q6J("href",n.getPageUrl(e),o.LSH),o.xp6(1),o.Oqu(e.slug),o.xp6(2),o.Q6J("user",e.user),o.xp6(2),o.Oqu(e.body),o.xp6(1),o.Q6J("ngIf",!n.endpoint),o.xp6(2),o.Oqu(o.lcZ(12,8,e.updated_at)),o.xp6(3),o.Q6J("ngIf",n.currentUser.hasPermission("custom_pages.update"))}}function nu(e,t){1&e&&(o.TgZ(0,"no-results-message",39),o.TgZ(1,"span",40),o._uU(2,"No pages have been created yet"),o.qZA(),o.qZA())}let iu=(()=>{class e{constructor(e,t,n,i,a,s,o){this.settings=e,this.datatable=t,this.currentUser=n,this.customPages=i,this.toast=a,this.router=s,this.route=o,this.endpoint=this.route.snapshot.data.endpoint,this.filters=Hd,this.pages$=this.datatable.data$}ngOnInit(){this.datatable.init({uri:this.endpoint||Vd.i.BASE_URI,staticParams:{with:["user"]}})}maybeDeleteSelectedPages(e){this.datatable.confirmResourceDeletion("tracking pixels").subscribe(()=>{this.customPages.delete(e||this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset(),this.toast.open("Pages deleted")},e=>{this.toast.open(e.message||Gs.v.Default)})})}showUserColumn(){return this.router.url.indexOf("admin")>-1}getPageUrl(e){return this.settings.getBaseUrl()+"/pages/"+e.id+"/"+e.slug}viewName(e){return e.replace(/_/g," ")}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(st.Z),o.Y36(Lt),o.Y36(on.I),o.Y36(Vd.i),o.Y36(mt.F),o.Y36(l.F0),o.Y36(l.gz))},e.\u0275cmp=o.Xpm({type:e,selectors:[["custom-pages-index"]],features:[o._Bn([Lt])],decls:32,vars:13,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","pages",3,"filters"],[1,"action-buttons"],["mat-raised-button","","color","accent","routerLink","new","class","button-with-icon",4,"ngIf"],[1,"datatable","responsive-table"],["class","loading-bar","mode","indeterminate","color","accent",4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","","trans",""],["trans","",1,"body-column"],["class","type-column","table-sort-header","","trans","",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","custom-page.svg",4,"ngIf"],["mat-raised-button","","color","accent","routerLink","new",1,"button-with-icon"],["svgIcon","add"],["mode","indeterminate","color","accent",1,"loading-bar"],["table-sort-header","","trans","",1,"type-column"],["colspan","7"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["type","button","mat-raised-button","","color","warn","trans","",3,"click"],[3,"table-body-checkbox"],["data-label","Slug"],["target","_blank",3,"href"],["data-label","Owner"],[3,"user"],["data-label","Body",1,"body-column"],["data-label","Type","class","type-column",4,"ngIf"],["data-label","Last Updated"],[1,"edit-column"],["mat-icon-button","",3,"routerLink","matTooltip",4,"ngIf"],["type","button","mat-icon-button","","trans","",3,"click"],["svgIcon","delete"],["data-label","Type",1,"type-column"],["mat-icon-button","",3,"routerLink","matTooltip"],["svgIcon","edit"],["svgImage","custom-page.svg"],["primary-text","","trans",""]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"h1",1),o.TgZ(2,"span",1),o._uU(3,"Custom Pages"),o.qZA(),o.qZA(),o.TgZ(4,"div",2),o._UZ(5,"datatable-filters",3),o.TgZ(6,"div",4),o.YNc(7,zd,4,0,"a",5),o.qZA(),o.qZA(),o.qZA(),o.TgZ(8,"div",6),o.YNc(9,Bd,1,0,"mat-progress-bar",7),o.ALo(10,"async"),o.TgZ(11,"table",8),o.TgZ(12,"thead"),o.TgZ(13,"tr"),o._UZ(14,"th",9),o.TgZ(15,"th",10),o._uU(16,"Slug"),o.qZA(),o.TgZ(17,"th",10),o._uU(18,"Owner"),o.qZA(),o.TgZ(19,"th",11),o._uU(20,"Body"),o.qZA(),o.YNc(21,jd,2,0,"th",12),o.TgZ(22,"th",1),o._uU(23,"Last Updated"),o.qZA(),o._UZ(24,"th"),o.qZA(),o.YNc(25,Xd,7,3,"tr",13),o.qZA(),o.TgZ(26,"tbody"),o.YNc(27,tu,17,10,"tr",14),o.ALo(28,"async"),o.qZA(),o.qZA(),o.YNc(29,nu,3,0,"no-results-message",15),o.ALo(30,"async"),o._UZ(31,"datatable-footer"),o.qZA()),2&e&&(o.xp6(5),o.Q6J("filters",t.filters),o.xp6(2),o.Q6J("ngIf",t.currentUser.hasPermission("custom_pages.create")),o.xp6(2),o.Q6J("ngIf",o.lcZ(10,7,t.datatable.paginator&&t.datatable.paginator.loading$)),o.xp6(12),o.Q6J("ngIf",!t.endpoint),o.xp6(4),o.Q6J("ngIf",t.datatable.selectedRows$.value.length),o.xp6(2),o.Q6J("ngForOf",o.lcZ(28,9,t.pages$)),o.xp6(2),o.Q6J("ngIf",o.lcZ(30,11,t.datatable.paginator.noResults$)))},directives:[Zt.P,Ln,i.O5,Vn,Gn,i.sg,Kn,g.zs,l.yS,O.Hw,s.pW,g.lW,ti,ii,k.gM,ai.U],pipes:[i.Ov,si.l,lt.R],styles:[".body-column[_ngcontent-%COMP%]{margin-right:25px;overflow:hidden}.type-column[_ngcontent-%COMP%]{text-transform:capitalize}"],changeDetection:0}),e})();var au=n(1289),su=n(4762),ou=n(5402);let ru=(()=>{class e{constructor(e,t,n,i,a){this.settings=e,this.zone=t,this.lazyLoader=n,this.breakpoints=i,this.i18n=a,this.makeBootstrapPromise()}reset(){this.editorIsReady()&&(this.tinymceInstance.setContent(""),this.tinymceInstance.undoManager.clear())}focus(){this.waitForEditor().then(()=>{this.tinymceInstance.focus(!1)})}hasUndo(){return this.editorIsReady()&&this.tinymceInstance.undoManager.hasUndo()}hasRedo(){return this.editorIsReady()&&this.tinymceInstance.undoManager.hasRedo()}queryCommandState(e){return this.editorIsReady()&&this.tinymceInstance.queryCommandState(e)}execCommand(e,t=null){this.waitForEditor().then(()=>{this.zone.run(()=>{this.tinymceInstance.execCommand(e,!1,t)})})}getContents(e){return this.editorIsReady()?this.tinymceInstance.getContent(e):""}setContents(e){this.waitForEditor().then(()=>{this.tinymceInstance.undoManager&&(this.tinymceInstance.undoManager.transact(()=>{this.tinymceInstance.setContent(e)}),this.tinymceInstance.selection.setCursorLocation(),this.tinymceInstance.nodeChanged(),this.tinymceInstance.execCommand("mceResize"))})}insertContents(e){this.waitForEditor().then(()=>{this.tinymceInstance.execCommand("mceInsertContent",!1,e),setTimeout(()=>this.tinymceInstance.selection.collapse())})}insertImage(e){this.waitForEditor().then(()=>{this.insertContents('<img src="'+e+'"/>'),setTimeout(()=>this.execCommand("mceAutoResize"),500)})}waitForEditor(){return this.tinymceInstance?new Promise(e=>e(this.tinymceInstance)):this.bootstrapPromise?this.bootstrapPromise:void 0}setConfig(e){this.config=e,this.loadTinymce().then(()=>{this.initTinymce()})}editorIsReady(){return!this.bootstrapPromise&&!!this.tinymceInstance&&!!this.tinymceInstance.undoManager}loadTinymce(){return this.lazyLoader.loadAsset("js/tinymce/tinymce.min.js",{type:"js"})}initTinymce(){const e={target:this.config.textAreaEl.nativeElement,plugins:["link","codesample","paste","autoresize"],branding:!1,browser_spellcheck:!0,max_height:this.config.maxHeight,min_height:this.config.minHeight,autoresize_on_init:!1,paste_as_text:!0,elementpath:!1,statusbar:!1,entity_encoding:"raw",menubar:!1,convert_urls:!1,forced_root_block:!1,document_base_url:document.baseURI,element_format:"html",body_class:"editor-body",content_style:'html {font-size: 62.5%;}\n.editor-body {font-size: 1.4rem;font-family: "Roboto", "Helvetica Neue", sans-serif;color: rgba(0, 0, 0, .87);}\nimg {max-width: 100%}\ncode[class*=language-], pre[class*=language-] {font-size: inherit;} .mce-preview-object {border: none;}',content_css:["https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic"],default_link_target:"_blank",link_assume_external_targets:!0,target_list:!1,link_title:!1,image_dimensions:!1,image_description:!1,setup:e=>{this.tinymceInstance=e,e.on("change",()=>this.config.onChange.emit(e.getContent())),e.on("click",()=>{this.zone.run(()=>{})})},init_instance_callback:e=>{this.bootstrapPromise=!1,this.bootstrapPromiseResolve(this.tinymceInstance);const t=()=>{this.zone.run(()=>{this.config.onChange.emit(e.getContent()),this.config.onCtrlEnter.emit()})};e.shortcuts.add("ctrl+13","desc",t),e.shortcuts.add("meta+13","desc",t)}};if(this.breakpoints.isMobile$.value||(e.toolbar=!1),this.config.showAdvancedControls&&(e.plugins=e.plugins.concat(["media","hr","visualblocks","visualchars","wordcount"]),e.forced_root_block="p",e.statusbar=!0,e.autoresize_on_init=!0,e.extended_valid_elements="svg[*],use[*],iframe[src|frameborder|width|height|allow=*|allowfullscreen],script[src]",e.elementpath=!0,e.content_css.push(this.settings.getAssetUrl()+"css/advanced-editor-styles.css"),e.target_list=[{title:this.i18n.t("Current window"),value:""},{title:this.i18n.t("New Window"),value:"_blank"}],e.codesample_languages=[{text:"HTML/XML",value:"markup"},{text:"JavaScript",value:"javascript"},{text:"CSS",value:"css"},{text:"Shell",value:"shell-session"},{text:"Bash",value:"bash"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"}]),"auto"===this.config.minHeight){const t=this.config.editorEl.nativeElement.parentElement.offsetHeight-74-4;e.min_height=t,e.max_height=t}tinymce.init(e)}destroyEditor(){try{this.tinymceInstance&&this.tinymceInstance.remove(),this.tinymceInstance=null,this.makeBootstrapPromise()}catch(e){}}makeBootstrapPromise(){this.bootstrapPromise=new Promise(e=>this.bootstrapPromiseResolve=e)}}return e.\u0275fac=function(t){return new(t||e)(o.LFG(st.Z),o.LFG(o.R0b),o.LFG(ou.j),o.LFG(fn.S),o.LFG(Dl.Z))},e.\u0275prov=o.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var lu=n(5978),cu=n(3913),du=n(8715),uu=n(8756),gu=n(2655);let pu=(()=>{class e extends du.c{constructor(){super(...arguments),this.DEFAULT_MAX_SIZE_MB=3}initValidations(){const e=[new uu.p({maxSize:(0,us.F)(this.DEFAULT_MAX_SIZE_MB,"MB")},this.i18n),new gu.p({types:["image"]},this.i18n)];this.validations.push(...e)}}return e.\u0275fac=function(){let t;return function(n){return(t||(t=o.n5z(e)))(n||e)}}(),e.\u0275prov=o.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const hu=["visualArea"],mu=["sourceArea"];function fu(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",3),o.TgZ(1,"button",4),o.NdJ("click",function(){return o.CHM(e),o.oxw().openFileUploadDialog()}),o.ALo(2,"trans"),o._UZ(3,"mat-icon",19),o.qZA(),o.qZA()}2&e&&(o.xp6(1),o.Q6J("matTooltip",o.lcZ(2,1,"Add Attachment")))}function _u(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",3),o.TgZ(1,"button",4),o.NdJ("click",function(){return o.CHM(e),o.oxw().execCommand("codesample")}),o.ALo(2,"trans"),o._UZ(3,"mat-icon",20),o.qZA(),o.qZA()}2&e&&(o.xp6(1),o.Q6J("matTooltip",o.lcZ(2,1,"Insert Code Sample")))}function bu(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",23),o.NdJ("click",function(){return o.CHM(e),o.oxw(2).openInsertImageModal()}),o.ALo(1,"trans"),o._UZ(2,"mat-icon",24),o.qZA()}2&e&&o.Q6J("matTooltip",o.lcZ(1,1,"Insert Image"))}function vu(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",3),o.TgZ(1,"button",4),o.NdJ("click",function(){return o.CHM(e),o.oxw().execCommand("mceLink")}),o.ALo(2,"trans"),o._UZ(3,"mat-icon",21),o.qZA(),o.YNc(4,bu,3,3,"button",22),o.qZA()}if(2&e){const e=o.oxw();o.xp6(1),o.ekj("active",e.queryCommandState("link")),o.Q6J("matTooltip",o.lcZ(2,4,"Insert Link")),o.xp6(3),o.Q6J("ngIf",e.currentUser.hasPermission("files.create"))}}function Zu(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",1),o.TgZ(1,"div",3),o.TgZ(2,"button",25),o.TgZ(3,"span",26),o._uU(4,"Insert"),o.qZA(),o._UZ(5,"mat-icon",27),o.qZA(),o.TgZ(6,"mat-menu",null,28),o.TgZ(8,"div",29),o.NdJ("click",function(){return o.CHM(e),o.oxw().execCommand("InsertHorizontalRule")}),o._UZ(9,"mat-icon",30),o.TgZ(10,"span",26),o._uU(11,"Horizontal Line"),o.qZA(),o.qZA(),o.TgZ(12,"div",29),o.NdJ("click",function(){return o.CHM(e),o.oxw().execCommand("mceLink")}),o._UZ(13,"mat-icon",21),o.TgZ(14,"span",26),o._uU(15,"Link"),o.qZA(),o.qZA(),o.TgZ(16,"div",29),o.NdJ("click",function(){return o.CHM(e),o.oxw().execCommand("mceMedia")}),o._UZ(17,"mat-icon",31),o.TgZ(18,"span",26),o._uU(19,"Media"),o.qZA(),o.qZA(),o.TgZ(20,"div",32),o.NdJ("click",function(){return o.CHM(e),o.oxw().insertInfoContainer("important")}),o._UZ(21,"mat-icon",33),o.TgZ(22,"span",26),o._uU(23,"Important"),o.qZA(),o.qZA(),o.TgZ(24,"div",32),o.NdJ("click",function(){return o.CHM(e),o.oxw().insertInfoContainer("warning")}),o._UZ(25,"mat-icon",34),o.TgZ(26,"span",26),o._uU(27,"Warning"),o.qZA(),o.qZA(),o.TgZ(28,"div",32),o.NdJ("click",function(){return o.CHM(e),o.oxw().insertInfoContainer("note")}),o._UZ(29,"mat-icon",35),o.TgZ(30,"span",26),o._uU(31,"Note"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(32,"div",3),o.TgZ(33,"button",36),o.TgZ(34,"span",26),o._uU(35,"Format"),o.qZA(),o._UZ(36,"mat-icon",27),o.qZA(),o.TgZ(37,"mat-menu",37,38),o.TgZ(39,"div",29),o.NdJ("click",function(){return o.CHM(e),o.oxw().execCommand("FormatBlock","h1")}),o.TgZ(40,"div",39),o._uU(41,"Heading 1"),o.qZA(),o.TgZ(42,"div",40),o._uU(43,"Alt+Shift+1"),o.qZA(),o.qZA(),o.TgZ(44,"div",29),o.NdJ("click",function(){return o.CHM(e),o.oxw().execCommand("FormatBlock","h2")}),o.TgZ(45,"div",39),o._uU(46,"Heading 2"),o.qZA(),o.TgZ(47,"div",40),o._uU(48,"Alt+Shift+2"),o.qZA(),o.qZA(),o.TgZ(49,"div",29),o.NdJ("click",function(){return o.CHM(e),o.oxw().execCommand("FormatBlock","h3")}),o.TgZ(50,"div",39),o._uU(51,"Heading 3"),o.qZA(),o.TgZ(52,"div",40),o._uU(53,"Alt+Shift+3"),o.qZA(),o.qZA(),o.TgZ(54,"div",29),o.NdJ("click",function(){return o.CHM(e),o.oxw().execCommand("FormatBlock","h4")}),o.TgZ(55,"div",39),o._uU(56,"Heading 4"),o.qZA(),o.TgZ(57,"div",40),o._uU(58,"Alt+Shift+4"),o.qZA(),o.qZA(),o.TgZ(59,"div",29),o.NdJ("click",function(){return o.CHM(e),o.oxw().execCommand("FormatBlock","code")}),o.TgZ(60,"div",39),o._uU(61,"Code"),o.qZA(),o.qZA(),o.TgZ(62,"div",29),o.NdJ("click",function(){return o.CHM(e),o.oxw().execCommand("strikethrough")}),o.TgZ(63,"div",39),o._uU(64,"Strikethrough"),o.qZA(),o.qZA(),o.TgZ(65,"div",29),o.NdJ("click",function(){return o.CHM(e),o.oxw().execCommand("superscript")}),o.TgZ(66,"div",39),o._uU(67,"Superscript"),o.qZA(),o.qZA(),o.TgZ(68,"div",29),o.NdJ("click",function(){return o.CHM(e),o.oxw().execCommand("subscript")}),o.TgZ(69,"div",39),o._uU(70,"Subscript"),o.qZA(),o.qZA(),o.TgZ(71,"div",29),o.NdJ("click",function(){return o.CHM(e),o.oxw().execCommand("mceBlockQuote")}),o.TgZ(72,"div",39),o._uU(73,"Blockquote"),o.qZA(),o.qZA(),o.TgZ(74,"div",29),o.NdJ("click",function(){return o.CHM(e),o.oxw().execCommand("FormatBlock","p")}),o.TgZ(75,"div",39),o._uU(76,"Paragraph"),o.qZA(),o.TgZ(77,"div",40),o._uU(78,"Ctrl+Shift+7"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(79,"div",3),o.TgZ(80,"button",41,42),o.TgZ(82,"span",26),o._uU(83,"Color"),o.qZA(),o._UZ(84,"mat-icon",27),o.qZA(),o.TgZ(85,"mat-menu",43,44),o.TgZ(87,"div",45),o.NdJ("click",function(){o.CHM(e);const t=o.MAs(81);return o.oxw().showColorPicker("ForeColor",t)}),o._UZ(88,"mat-icon",46),o.TgZ(89,"span",26),o._uU(90,"Text Color"),o.qZA(),o.qZA(),o.TgZ(91,"div",47),o.NdJ("click",function(){o.CHM(e);const t=o.MAs(81);return o.oxw().showColorPicker("HiliteColor",t)}),o._UZ(92,"mat-icon",48),o.TgZ(93,"span",26),o._uU(94,"Background Color"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(95,"div",3),o.TgZ(96,"button",4),o.NdJ("click",function(){return o.CHM(e),o.oxw().execCommand("justifyLeft")}),o.ALo(97,"trans"),o._UZ(98,"mat-icon",49),o.qZA(),o.TgZ(99,"button",4),o.NdJ("click",function(){return o.CHM(e),o.oxw().execCommand("justifyCenter")}),o.ALo(100,"trans"),o._UZ(101,"mat-icon",50),o.qZA(),o.TgZ(102,"button",4),o.NdJ("click",function(){return o.CHM(e),o.oxw().execCommand("justifyRight")}),o.ALo(103,"trans"),o._UZ(104,"mat-icon",51),o.qZA(),o.qZA(),o.TgZ(105,"div",3),o.TgZ(106,"button",4),o.NdJ("click",function(){return o.CHM(e),o.oxw().execCommand("Outdent")}),o.ALo(107,"trans"),o._UZ(108,"mat-icon",52),o.qZA(),o.TgZ(109,"button",4),o.NdJ("click",function(){return o.CHM(e),o.oxw().execCommand("Indent")}),o.ALo(110,"trans"),o._UZ(111,"mat-icon",53),o.qZA(),o.qZA(),o.TgZ(112,"div",54),o.TgZ(113,"button",55),o.NdJ("click",function(){return o.CHM(e),o.oxw().showVisualEditor()}),o._uU(114,"Visual "),o.qZA(),o.TgZ(115,"button",56),o.NdJ("click",function(){return o.CHM(e),o.oxw().showSourceEditor()}),o._uU(116,"Source "),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=o.MAs(7),t=o.MAs(38),n=o.MAs(86),i=o.oxw();o.xp6(2),o.Q6J("matMenuTriggerFor",e),o.xp6(31),o.Q6J("matMenuTriggerFor",t),o.xp6(47),o.Q6J("matMenuTriggerFor",n),o.xp6(16),o.ekj("active",i.queryCommandState("justifyLeft")),o.Q6J("matTooltip",o.lcZ(97,18,"Align Left")),o.xp6(3),o.ekj("active",i.queryCommandState("justifyCenter")),o.Q6J("matTooltip",o.lcZ(100,20,"Center")),o.xp6(3),o.ekj("active",i.queryCommandState("justifyRight")),o.Q6J("matTooltip",o.lcZ(103,22,"Align Right")),o.xp6(4),o.Q6J("matTooltip",o.lcZ(107,24,"Decrease Indent")),o.xp6(3),o.Q6J("matTooltip",o.lcZ(110,26,"Increase Indent")),o.xp6(4),o.ekj("active","visual"===i.activeEditor),o.xp6(2),o.ekj("active","source"===i.activeEditor)}}const xu=[[["","customButtons",""]],[["","header",""]],[["","footer",""]]],Au=["[customButtons]","[header]","[footer]"];let yu=(()=>{class e{constructor(e,t,n,i,s,r,l,c){this.editor=e,this.currentUser=t,this.uploadQueue=n,this.settings=i,this.renderer=s,this.el=r,this.overlayPanel=l,this.imageValidator=c,this.sourceAreaControl=new a.NI,this.activeEditor="visual",this.showAdvancedControls=!1,this.basic=!1,this.minHeight=183,this.maxHeight=530,this.onChange=new o.vpe,this.onCtrlEnter=new o.vpe,this.onFileUpload=new o.vpe}ngAfterViewInit(){this.bootTextEditor()}ngOnDestroy(){this.destroyEditor()}reset(){this.editor.reset()}focus(){this.editor.focus()}hasUndo(){return this.editor.hasUndo()}hasRedo(){return this.editor.hasRedo()}queryCommandState(e){return this.editor.queryCommandState(e)}execCommand(e,t=null){this.editor.execCommand(e,t)}insertInfoContainer(e){this.insertContents(`<div class="widget widget-${e}"><div class="title">${(0,cu.z)(e)}:</div><br></div><br>`)}showColorPicker(e,t){return(0,su.mG)(this,void 0,void 0,function*(){const{BeColorPickerModule:i}=yield n.e(295).then(n.bind(n,1037));this.overlayPanel.open(i.components.panel,{origin:new o.SBq(t),position:lu.x}).valueChanged().pipe((0,Jt.b)(50)).subscribe(t=>{this.execCommand(e,t)})})}showVisualEditor(){this.editor.tinymceInstance.contentAreaContainer&&"visual"!==this.activeEditor&&(this.activeEditor="visual",this.renderer.setStyle(this.editor.tinymceInstance.contentAreaContainer,"display","block"),this.renderer.setStyle(this.sourceTextArea.nativeElement,"display","none"),this.editor.focus())}showSourceEditor(){this.editor.tinymceInstance.contentAreaContainer&&"source"!==this.activeEditor&&(this.activeEditor="source",this.renderer.setStyle(this.sourceTextArea.nativeElement,"height",this.editor.tinymceInstance.contentAreaContainer.offsetHeight+"px"),this.renderer.setStyle(this.sourceTextArea.nativeElement,"display","block"),this.renderer.setStyle(this.editor.tinymceInstance.contentAreaContainer,"display","none"),this.sourceAreaControl.setValue(this.editor.getContents({source_view:!0})))}openFileUploadDialog(){(0,to.r)({multiple:!0}).then(e=>{this.onFileUpload.emit(e)})}openInsertImageModal(){const e={uri:js.C.Image,validator:this.imageValidator,httpParams:{diskPrefix:this.inlineUploadPrefix}};(0,to.r)({types:[eo.j.image]}).then(t=>{this.uploadQueue.start(t,e).subscribe(e=>{this.insertImage(e.fileEntry.url)})})}getContents(){return this.editor.getContents()}setContents(e){this.editor.setContents(e)}insertContents(e){this.editor.insertContents(e)}insertImage(e){this.editor.insertImage(e)}insertLink(e){this.insertContents(`<a href="${e.href}" target="${e.target||"self"}">${e.text}</a>`)}destroyEditor(){this.editor.destroyEditor()}bootTextEditor(){this.editor.setConfig({textAreaEl:this.visualTextArea,editorEl:this.el,minHeight:this.minHeight,maxHeight:this.maxHeight,onChange:this.onChange,onCtrlEnter:this.onCtrlEnter,showAdvancedControls:this.showAdvancedControls})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(ru),o.Y36(on.I),o.Y36(Ks.A),o.Y36(st.Z),o.Y36(o.Qsj),o.Y36(o.SBq),o.Y36($r.T),o.Y36(pu))},e.\u0275cmp=o.Xpm({type:e,selectors:[["text-editor"]],viewQuery:function(e,t){if(1&e&&(o.Gf(hu,7),o.Gf(mu,7)),2&e){let e;o.iGM(e=o.CRH())&&(t.visualTextArea=e.first),o.iGM(e=o.CRH())&&(t.sourceTextArea=e.first)}},inputs:{showAdvancedControls:"showAdvancedControls",basic:"basic",minHeight:"minHeight",maxHeight:"maxHeight",inlineUploadPrefix:"inlineUploadPrefix"},outputs:{onChange:"onChange",onCtrlEnter:"onCtrlEnter",onFileUpload:"onFileUpload"},features:[o._Bn([Ks.A,ru])],ngContentSelectors:Au,decls:41,vars:47,consts:[[1,"editor-header"],[1,"toolbar-row"],["class","header-actions",4,"ngIf"],[1,"header-actions"],["type","button",1,"no-style","editor-button",3,"matTooltip","click"],["svgIcon","undo"],["svgIcon","redo"],["svgIcon","format-bold"],["svgIcon","format-italic"],["svgIcon","format-underlined"],["svgIcon","format-list-bulleted"],["svgIcon","format-list-numbered"],[1,"header-actions","last"],["svgIcon","format-clear"],["class","toolbar-row",4,"ngIf"],["rows","8",1,"source-textarea",2,"display","none",3,"formControl","blur"],["sourceArea",""],["rows","8",1,"visual-textarea"],["visualArea",""],["svgIcon","attachment"],["svgIcon","code"],["svgIcon","link"],["type","button","class","no-style editor-button image-modal-button",3,"matTooltip","click",4,"ngIf"],["type","button",1,"no-style","editor-button","image-modal-button",3,"matTooltip","click"],["svgIcon","image"],["type","button",1,"no-style","editor-button","text-button","insert-button",3,"matMenuTriggerFor"],["trans",""],["svgIcon","arrow-drop-down",1,"caret"],["insertMenu",""],["mat-menu-item","",3,"click"],["svgIcon","remove"],["svgIcon","videocam"],["mat-menu-item","","trans","",3,"click"],["svgIcon","star"],["svgIcon","warning"],["svgIcon","note"],["type","button",1,"no-style","editor-button","text-button","format-button",3,"matMenuTriggerFor"],[1,"format-menu","menu-with-alt-text"],["formatMenu",""],["trans","",1,"text"],[1,"alt-text"],["type","button",1,"no-style","editor-button","text-button","color-button",3,"matMenuTriggerFor"],["colorPickerOrigin",""],[1,"color-dropdown"],["colorMenu",""],["mat-menu-item","",1,"text-color-item",3,"click"],["svgIcon","format-color-text"],["mat-menu-item","",1,"bg-color-item",3,"click"],["svgIcon","format-color-fill"],["svgIcon","format-align-left"],["svgIcon","format-align-center"],["svgIcon","format-align-right"],["svgIcon","format-indent-decrease"],["svgIcon","format-indent-increase"],[1,"header-actions","editor-toggle-buttons"],["type","button","trans","",1,"no-style","editor-button","visual-mode-button",3,"click"],["type","button","trans","",1,"no-style","editor-button","source-mode-button",3,"click"]],template:function(e,t){1&e&&(o.F$t(xu),o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.YNc(2,fu,4,3,"div",2),o.YNc(3,_u,4,3,"div",2),o.TgZ(4,"div",3),o.TgZ(5,"button",4),o.NdJ("click",function(){return t.execCommand("undo")}),o.ALo(6,"trans"),o._UZ(7,"mat-icon",5),o.qZA(),o.TgZ(8,"button",4),o.NdJ("click",function(){return t.execCommand("redo")}),o.ALo(9,"trans"),o._UZ(10,"mat-icon",6),o.qZA(),o.qZA(),o.TgZ(11,"div",3),o.TgZ(12,"button",4),o.NdJ("click",function(){return t.execCommand("bold")}),o.ALo(13,"trans"),o._UZ(14,"mat-icon",7),o.qZA(),o.TgZ(15,"button",4),o.NdJ("click",function(){return t.execCommand("italic")}),o.ALo(16,"trans"),o._UZ(17,"mat-icon",8),o.qZA(),o.TgZ(18,"button",4),o.NdJ("click",function(){return t.execCommand("underline")}),o.ALo(19,"trans"),o._UZ(20,"mat-icon",9),o.qZA(),o.qZA(),o.TgZ(21,"div",3),o.TgZ(22,"button",4),o.NdJ("click",function(){return t.execCommand("insertunorderedlist")}),o.ALo(23,"trans"),o._UZ(24,"mat-icon",10),o.qZA(),o.TgZ(25,"button",4),o.NdJ("click",function(){return t.execCommand("insertorderedlist")}),o.ALo(26,"trans"),o._UZ(27,"mat-icon",11),o.qZA(),o.qZA(),o.YNc(28,vu,5,6,"div",2),o.Hsn(29),o.TgZ(30,"div",12),o.TgZ(31,"button",4),o.NdJ("click",function(){return t.execCommand("removeformat")}),o.ALo(32,"trans"),o._UZ(33,"mat-icon",13),o.qZA(),o.qZA(),o.Hsn(34,1),o.qZA(),o.YNc(35,Zu,117,28,"div",14),o.qZA(),o.TgZ(36,"textarea",15,16),o.NdJ("blur",function(){return t.setContents(t.sourceAreaControl.value)}),o.qZA(),o._UZ(38,"textarea",17,18),o.Hsn(40,2)),2&e&&(o.xp6(2),o.Q6J("ngIf",t.inlineUploadPrefix&&t.currentUser.hasPermission("files.create")&&t.onFileUpload.observers.length),o.xp6(1),o.Q6J("ngIf",!t.basic),o.xp6(2),o.ekj("disabled",!t.hasUndo()),o.Q6J("matTooltip",o.lcZ(6,31,"Undo")),o.xp6(3),o.ekj("disabled",!t.hasRedo()),o.Q6J("matTooltip",o.lcZ(9,33,"Redo")),o.xp6(4),o.ekj("active",t.queryCommandState("bold")),o.Q6J("matTooltip",o.lcZ(13,35,"Bold")),o.xp6(3),o.ekj("active",t.queryCommandState("italic")),o.Q6J("matTooltip",o.lcZ(16,37,"Italic")),o.xp6(3),o.ekj("active",t.queryCommandState("underline")),o.Q6J("matTooltip",o.lcZ(19,39,"Underline")),o.xp6(4),o.ekj("active",t.queryCommandState("unorderedlist")),o.Q6J("matTooltip",o.lcZ(23,41,"Unordered List")),o.xp6(3),o.ekj("active",t.queryCommandState("orderedlist")),o.Q6J("matTooltip",o.lcZ(26,43,"Ordered List")),o.xp6(3),o.Q6J("ngIf",!t.basic),o.xp6(3),o.Q6J("matTooltip",o.lcZ(32,45,"Remove Formatting")),o.xp6(4),o.Q6J("ngIf",t.showAdvancedControls),o.xp6(1),o.Udp("min-height",t.minHeight),o.Q6J("formControl",t.sourceAreaControl),o.xp6(2),o.Udp("min-height",t.minHeight))},directives:[i.O5,k.gM,O.Hw,a.Fj,a.JJ,a.oH,C.p6,Zt.P,C.VK,C.OP],pipes:[lt.R],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;min-height:218px;max-height:600px;position:relative;border:1px solid var(--be-divider-default);border-radius:4px;overflow:hidden}[_nghost-%COMP%]     .editor-button{color:#788593;padding:7px;width:36px;height:36px}[_nghost-%COMP%]     .editor-button .mat-icon{height:22px;width:22px}[_nghost-%COMP%]     .editor-button .caret{display:inline-block;width:20px;height:20px;vertical-align:middle}[_nghost-%COMP%]     .editor-button.text-button{display:block;font-weight:300;font-size:1.5rem;width:auto}[_nghost-%COMP%]     .editor-button.disabled{opacity:.4}[_nghost-%COMP%]     .editor-button.active{background-color:#0000000a}[_nghost-%COMP%]     .editor-button.success{color:var(--be-accent-default)}[_nghost-%COMP%]     .editor-button:hover{background-color:#0000000a}[_nghost-%COMP%]     .editor-footer{position:relative;height:37px;flex-shrink:0;background-color:var(--be-background-alternative);border-top:1px solid var(--be-divider-default)}textarea[_ngcontent-%COMP%]{border:none;outline:none;resize:none;padding:15px}.editor-header[_ngcontent-%COMP%]{clear:both;flex:0 0 37px;background-color:var(--be-background-alternative)}.toolbar-row[_ngcontent-%COMP%]{display:flex;height:37px;border-bottom:1px solid var(--be-divider-default);overflow:hidden}  .header-actions{display:inline-block;border-right:1px solid var(--be-divider-default);height:100%;padding:0 4px}  .header-actions.right{margin-left:auto;margin-right:7px}  .header-actions.last{border-right:none}.editor-toggle-buttons[_ngcontent-%COMP%]{border-right:none;margin-left:auto;padding:0;display:flex}.editor-toggle-buttons[_ngcontent-%COMP%]   .editor-button[_ngcontent-%COMP%]{width:auto}@media only screen and (max-width: 768px){.editor-header[_ngcontent-%COMP%]{display:none}}"],changeDetection:0}),e})();function wu(e,t){if(1&e){const e=o.EpF();o.ynx(0),o.TgZ(1,"div",3),o._uU(2),o.qZA(),o.TgZ(3,"div",4),o._UZ(4,"input",5),o.qZA(),o.TgZ(5,"button",6),o.NdJ("click",function(){return o.CHM(e),o.oxw().save()}),o._uU(6," Save "),o.qZA(),o.BQk()}if(2&e){const e=o.oxw();o.xp6(2),o.Oqu(e.fullBaseUri+e.getPrefix()),o.xp6(2),o.Q6J("formControl",e.slugControl)}}function Cu(e,t){if(1&e&&(o.ynx(0),o.TgZ(1,"a",8),o._uU(2),o.qZA(),o.BQk()),2&e){const e=t.ngIf;o.xp6(1),o.Q6J("href",e,o.LSH)("title",e),o.xp6(1),o.Oqu(e)}}function Tu(e,t){if(1&e){const e=o.EpF();o.YNc(0,Cu,3,3,"ng-container",7),o.ALo(1,"async"),o.TgZ(2,"button",6),o.NdJ("click",function(){return o.CHM(e),o.oxw().startEditing()}),o._uU(3," Edit "),o.qZA()}if(2&e){const e=o.oxw();o.Q6J("ngIf",e.fullBaseUri+e.getPrefix()+o.lcZ(1,1,e.slug$))}}let qu=(()=>{class e{constructor(e){this.settings=e,this.slug$=new pt.X(""),this.editing$=new pt.X(!1),this.slugControl=new a.NI,this.defaultBaseUri=this.settings.getBaseUrl()+"/",this.fullBaseUri=this.defaultBaseUri}set baseUri(e){this.fullBaseUri=(e=e||this.defaultBaseUri).endsWith("/")?e:e+"/"}writeValue(e){this.slug$.next(e),this.slugControl.setValue(e)}registerOnChange(e){this.propagateChange=e}registerOnTouched(){}save(){this.slug$.next(this.slugControl.value),this.propagateChange(this.slug$.value),this.editing$.next(!1)}startEditing(){this.editing$.next(!0)}getPrefix(){return this.prefix?this.prefix+"/":""}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(st.Z))},e.\u0275cmp=o.Xpm({type:e,selectors:[["slug-control"]],inputs:{prefix:"prefix",baseUri:"baseUri"},features:[o._Bn([{provide:a.JU,useExisting:e,multi:!0}])],decls:5,vars:4,consts:[["svgIcon","link",1,"link-icon"],[4,"ngIf","ngIfElse"],["editButton",""],[1,"nowrap"],[1,"input-container"],["type","text",3,"formControl"],["type","button","mat-flat-button","","color","gray","trans","",1,"action-button",3,"click"],[4,"ngIf"],["target","_blank",1,"nowrap",3,"href","title"]],template:function(e,t){if(1&e&&(o._UZ(0,"mat-icon",0),o.YNc(1,wu,7,2,"ng-container",1),o.ALo(2,"async"),o.YNc(3,Tu,4,3,"ng-template",null,2,o.W1O)),2&e){const e=o.MAs(4);o.xp6(1),o.Q6J("ngIf",o.lcZ(2,2,t.editing$))("ngIfElse",e)}},directives:[O.Hw,i.O5,a.Fj,a.JJ,a.oH,g.lW,Zt.P],pipes:[i.Ov],styles:["[_nghost-%COMP%]{display:flex;align-items:center}.input-container[_ngcontent-%COMP%]{margin-left:3px;width:auto;max-width:160px}.input-container[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{height:25px;padding:6px}.link-icon[_ngcontent-%COMP%]{margin-right:5px;flex-shrink:0}.action-button[_ngcontent-%COMP%]{margin-left:20px;line-height:25px}.nowrap[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"],changeDetection:0}),e})();function ku(e,t){if(1&e&&(o.TgZ(0,"div",19),o._uU(1),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(1),o.Oqu(e.title)}}function Mu(e,t){if(1&e&&(o.TgZ(0,"div",19),o._uU(1),o.qZA()),2&e){const e=o.oxw(2).ngIf;o.xp6(1),o.Oqu(e.slug)}}function Iu(e,t){if(1&e&&(o.TgZ(0,"div",20),o._UZ(1,"slug-control",21),o.YNc(2,Mu,2,1,"div",6),o.qZA()),2&e){const e=o.oxw().ngIf,t=o.oxw();o.xp6(1),o.Q6J("prefix",t.slugPrefix()),o.xp6(1),o.Q6J("ngIf",e.slug)}}function Uu(e,t){1&e&&(o.TgZ(0,"span",10),o._uU(1,"Update"),o.qZA())}function Ju(e,t){1&e&&(o.TgZ(0,"span",10),o._uU(1,"Create"),o.qZA())}function Du(e,t){if(1&e&&(o.TgZ(0,"div",19),o._uU(1),o.qZA()),2&e){const e=o.oxw().ngIf;o.xp6(1),o.Oqu(e.body)}}function Ou(e,t){if(1&e){const e=o.EpF();o.ynx(0,1),o.TgZ(1,"div",2),o.TgZ(2,"div",3),o.TgZ(3,"label",4),o._uU(4,"Page Title"),o.qZA(),o._UZ(5,"input",5),o.YNc(6,ku,2,1,"div",6),o.qZA(),o.YNc(7,Iu,3,2,"div",7),o.TgZ(8,"div",8),o.TgZ(9,"mat-slide-toggle",9),o._uU(10,"Hide Navbar"),o.qZA(),o.TgZ(11,"p",10),o._uU(12,"Whether default site navbar should be hidden for this page."),o.qZA(),o.qZA(),o.qZA(),o.TgZ(13,"div",11),o.TgZ(14,"button",12),o.NdJ("click",function(){return o.CHM(e),o.oxw().crupdatePage()}),o.YNc(15,Uu,2,0,"span",13),o.YNc(16,Ju,2,0,"span",13),o.qZA(),o.TgZ(17,"a",14),o._uU(18,"Cancel"),o.qZA(),o.qZA(),o.TgZ(19,"div",15),o.YNc(20,Du,2,1,"div",6),o.qZA(),o.TgZ(21,"div",16),o.TgZ(22,"text-editor",17),o.NdJ("onChange",function(t){return o.CHM(e),o.oxw().setBody(t)}),o.qZA(),o.qZA(),o._UZ(23,"loading-indicator",18),o.ALo(24,"async"),o.BQk()}if(2&e){const e=t.ngIf,n=o.oxw();o.Q6J("formGroup",n.form),o.xp6(6),o.Q6J("ngIf",e.title),o.xp6(1),o.Q6J("ngIf",!n.hideSlug),o.xp6(8),o.Q6J("ngIf",n.page),o.xp6(1),o.Q6J("ngIf",!n.page),o.xp6(1),o.Q6J("routerLink",n.backRoute()),o.xp6(3),o.Q6J("ngIf",e.body),o.xp6(2),o.Q6J("showAdvancedControls",!0),o.xp6(1),o.Q6J("isVisible",o.lcZ(24,9,n.loading$))}}let Pu=(()=>{class e{constructor(e,t,n,i,a){this.pages=e,this.route=t,this.toast=n,this.router=i,this.fb=a,this.hideSlug=this.route.snapshot.data.hideSlug,this.endpoint=this.route.snapshot.data.endpoint,this.loading$=new pt.X(!1),this.updating$=new pt.X(!1),this.form=this.fb.group({title:[""],slug:[""],body:[""],type:[""],hide_nav:[!1]}),this.errors$=new pt.X({})}ngOnInit(){var e;this.route.params.subscribe(e=>{this.getPage(e.id)}),this.route.snapshot.data.hideSlug||(e=this.form.get("title")).valueChanges.pipe((0,j.h)(e=>!!e),(0,Xt.x)()).subscribe(t=>{e.parent.get("slug").dirty||e.parent.get("slug").setValue((0,Hn.V)(t))})}crupdatePage(){this.loading$.next(!0),(this.updating$.value?this.pages.update(this.page.id,this.getPayload(),this.endpoint):this.pages.create(this.getPayload(),this.endpoint)).pipe((0,gt.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.router.navigate(this.backRoute(),{relativeTo:this.route}),this.toast.open(this.updating$.value?"Page updated":"Page created")},e=>this.errors$.next(e.errors))}getPage(e){e&&(this.loading$.next(!0),this.pages.get(e).pipe((0,au.g)(0)).subscribe(e=>{this.updating$.next(!0),this.page=e.page,this.form.patchValue(e.page),this.textEditor.setContents(e.page.body||""),this.loading$.next(!1)}))}getPayload(){return Object.assign({},this.form.value)}setBody(e){this.form.patchValue({body:e})}backRoute(){return this.page?["../../"]:["../"]}slugPrefix(){return"pages/"+(this.page?this.page.id:"*")}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Vd.i),o.Y36(l.gz),o.Y36(mt.F),o.Y36(l.F0),o.Y36(a.qu))},e.\u0275cmp=o.Xpm({type:e,selectors:[["crupdate-page"]],viewQuery:function(e,t){if(1&e&&o.Gf(yu,5),2&e){let e;o.iGM(e=o.CRH())&&(t.textEditor=e.first)}},decls:2,vars:3,consts:[[3,"formGroup",4,"ngIf"],[3,"formGroup"],[1,"many-inputs","input-header"],[1,"input-container"],["for","page-title","trans",""],["type","text","id","page-title","formControlName","title"],["class","error",4,"ngIf"],["class","input-container slug-input-container",4,"ngIf"],[1,"setting-toggle-container"],["id","crupdate_custom_page.hideNav","formControlName","hide_nav","trans",""],["trans",""],[1,"actions"],["mat-raised-button","","color","accent",3,"click"],["trans","",4,"ngIf"],["mat-button","","trans","",3,"routerLink"],[1,"errors"],[1,"editor-container"],["inlineUploadPrefix","page_media","minHeight","auto",1,"text-editor",3,"showAdvancedControls","onChange"],[1,"overlay",3,"isVisible"],[1,"error"],[1,"input-container","slug-input-container"],["formControlName","slug",3,"prefix"]],template:function(e,t){1&e&&(o.YNc(0,Ou,25,11,"ng-container",0),o.ALo(1,"async")),2&e&&o.Q6J("ngIf",o.lcZ(1,1,t.errors$))},directives:[i.O5,a.JL,a.sg,Zt.P,a.Fj,a.JJ,a.u,T.Rr,g.lW,g.zs,l.yS,yu,At.Q,qu],pipes:[i.Ov],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:calc(100vh - 120px);overflow:hidden}.input-container[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{background-color:var(--be-background)}.actions[_ngcontent-%COMP%]{margin-bottom:25px;flex-shrink:0}.errors[_ngcontent-%COMP%]{color:#f44336;flex-shrink:0}.errors[_ngcontent-%COMP%]   .error[_ngcontent-%COMP%]{padding:5px 0}.editor-container[_ngcontent-%COMP%]{flex:1 1 auto}text-editor[_ngcontent-%COMP%]{max-height:none}"],changeDetection:0}),e})();function Su(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",5),o.TgZ(1,"label",27),o._uU(2,"Mysql Mode"),o.qZA(),o.TgZ(3,"select",28),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.server.scout_mysql_mode=t})("ngModelChange",function(){return o.CHM(e),o.oxw().clearErrors()}),o.TgZ(4,"option",29),o._uU(5,"Basic"),o.qZA(),o.TgZ(6,"option",30),o._uU(7,"Extended"),o.qZA(),o.TgZ(8,"option",31),o._uU(9,"Fulltext"),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=o.oxw();o.xp6(3),o.Q6J("ngModel",e.state.server.scout_mysql_mode)}}function Nu(e,t){if(1&e){const e=o.EpF();o.ynx(0),o.TgZ(1,"div",5),o.TgZ(2,"label",32),o._uU(3,"Algolia App ID"),o.qZA(),o.TgZ(4,"input",33),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.server.algolia_app_id=t}),o.qZA(),o.qZA(),o.TgZ(5,"div",5),o.TgZ(6,"label",34),o._uU(7,"Algolia Secret"),o.qZA(),o.TgZ(8,"input",35),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().state.server.algolia_secret=t}),o.qZA(),o.qZA(),o.BQk()}if(2&e){const e=o.oxw();o.xp6(4),o.Q6J("ngModel",e.state.server.algolia_app_id),o.xp6(4),o.Q6J("ngModel",e.state.server.algolia_secret)}}function Qu(e,t){1&e&&o._UZ(0,"p",36),2&e&&o.Q6J("innerHTML",t.ngIf,o.oJD)}function Yu(e,t){1&e&&(o.TgZ(0,"div",37),o.TgZ(1,"div",1),o._uU(2,"Important!"),o.qZA(),o.TgZ(3,"p",13),o.TgZ(4,"a",38),o._uU(5,'"Meilisearch"'),o.qZA(),o._uU(6," needs to be installed and running for this method to work."),o.qZA(),o.qZA())}function Fu(e,t){1&e&&(o.TgZ(0,"div",37),o.TgZ(1,"div",1),o._uU(2,"Important!"),o.qZA(),o.TgZ(3,"p",13),o.TgZ(4,"a",39),o._uU(5,'"Elasticsearch"'),o.qZA(),o._uU(6," needs to be installed and running for this method to work."),o.qZA(),o.qZA())}function Ru(e,t){if(1&e&&(o.TgZ(0,"option",22),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("ngValue",e.model),o.xp6(1),o.Oqu(e.name)}}function Eu(e,t){1&e&&o._UZ(0,"mat-progress-bar",40)}const Lu=[{path:"",component:ct,canActivate:[dt.a,ut.d],canActivateChild:[dt.a,ut.d],data:{permissions:["admin.access"],adminRoot:!0},children:[{path:"",redirectTo:"analytics",pathMatch:"full"},{path:"analytics",loadChildren:()=>n.e(264).then(n.bind(n,264)).then(e=>e.AnalyticsModule),canActivate:[dt.a],canActivateChild:[dt.a],data:{permissions:["reports.view"]}},{path:"users",component:wr,data:{permissions:["users.view"]}},{path:"roles",component:xl,data:{permissions:["roles.view"]}},{path:"translations",component:Wl,data:{permissions:["localizations.view"]}},{path:"tags",component:$d,data:{permissions:["tags.view"]}},{path:"files",component:rc,data:{permissions:["files.view"]}},{path:"ads",component:gc,data:{permissions:["ads.update"]}},{path:"custom-pages",component:iu,data:{permissions:["custom_pages.view"],name:"Custom Pages"}},{path:"custom-pages/new",component:Pu,data:{permissions:["custom_pages.create"],name:"Add New Page"}},{path:"custom-pages/:id/edit",component:Pu,data:{permissions:["custom_pages.update"],name:"Edit Page"}},{path:"plans",component:Bc,canActivate:[jc.Y],data:{permissions:["plans.view"]}},{path:"subscriptions",component:bd,canActivate:[jc.Y],data:{permissions:["subscriptions.view"]}},...Si,{path:"settings",component:Bi,resolve:{settings:c},data:{permissions:["settings.view"]},children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",component:aa,pathMatch:"full"},{path:"authentication",component:fa},{path:"cache",component:xa},{path:"analytics",component:Ta},{path:"localization",component:Ja},{path:"mail",component:Va},{path:"logging",component:ja},{path:"queue",component:es},{path:"billing",component:cs},{path:"uploading",component:Ys},{path:"recaptcha",component:Bs},{path:"gdpr",component:qd},{path:"search",component:(()=>{class e extends vt{constructor(){super(...arguments),this.models$=new pt.X([]),this.searchableModelControl=new a.NI(null)}importRecords(){this.loading$.next(!0),this.http.post("admin/search/import",{model:this.searchableModelControl.value,driver:this.state.server.scout_driver}).pipe((0,gt.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open("Records imported")},e=>{this.errors$.next({search_group:"Could not import records: "+e.message}),ht(this.errors$.value)})}ngOnInit(){this.http.get("admin/search/models").subscribe(e=>{this.models$.next(e.models)})}}return e.\u0275fac=function(){let t;return function(n){return(t||(t=o.n5z(e)))(n||e)}}(),e.\u0275cmp=o.Xpm({type:e,selectors:[["search-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:53,vars:22,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["ngNativeValidate","",1,"body","many-inputs",3,"submit"],["id","search_group",1,"error-group","many-inputs","no-border-top"],[1,"input-container"],["for","scout.driver","trans",""],["name","scout.driver","id","scout.driver",3,"ngModel","ngModelChange"],["value","mysql"],["value","meilisearch"],["value","tntsearch"],["value","Matchish\\ScoutElasticSearch\\Engines\\ElasticSearchEngine"],["value","algolia"],["trans",""],["class","input-container",4,"ngIf"],[4,"ngIf"],["class","error",3,"innerHTML",4,"ngIf"],["class","widget widget-info widget-important",4,"ngIf"],[1,"widget","widget-flat"],[1,"import-flex"],["for","searchable-model","trans","",1,"hidden"],["id","searchable-model",3,"formControl"],["trans","",3,"ngValue"],["trans","",3,"ngValue",4,"ngFor","ngForOf"],["type","button","mat-stroked-button","","color","accent","trans","",3,"disabled","click"],["mat-raised-button","","color","accent","type","submit","trans","",1,"update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],["for","mysql-mode","trans",""],["name","mysql-mode","id","mysql-mode",3,"ngModel","ngModelChange"],["value","basic"],["value","extended"],["value","fulltext"],["for","scout.algolia_app_id","trans",""],["name","scout.algolia_app_id","id","scout.algolia_app_id","required","",3,"ngModel","ngModelChange"],["for","scout.algolia_secret","trans",""],["name","scout.algolia_secret","id","scout.algolia_secret","required","",3,"ngModel","ngModelChange"],[1,"error",3,"innerHTML"],[1,"widget","widget-info","widget-important"],["href","https://www.meilisearch.com","target","_blank"],["href","https://www.elastic.co/elasticsearch","target","_blank"],["mode","indeterminate","color","accent"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"Search"),o.qZA(),o.TgZ(3,"div",2),o._uU(4,"Configure search method used on the site as well as related 3rd party integrations."),o.qZA(),o.qZA(),o.TgZ(5,"form",3),o.NdJ("submit",function(){return t.saveSettings()}),o.TgZ(6,"div",4),o.TgZ(7,"div",5),o.TgZ(8,"label",6),o._uU(9,"Search Method"),o.qZA(),o.TgZ(10,"select",7),o.NdJ("ngModelChange",function(e){return t.state.server.scout_driver=e})("ngModelChange",function(){return t.clearErrors()}),o.TgZ(11,"option",8),o._uU(12,"Mysql"),o.qZA(),o.TgZ(13,"option",9),o._uU(14,"Meilisearch"),o.qZA(),o.TgZ(15,"option",10),o._uU(16,"TNTSearch"),o.qZA(),o.TgZ(17,"option",11),o._uU(18,"Elasticsearch"),o.qZA(),o.TgZ(19,"option",12),o._uU(20,"Algolia"),o.qZA(),o.qZA(),o.TgZ(21,"p",13),o._uU(22,"Which method should be used for search related functionality across the site."),o.qZA(),o.qZA(),o.YNc(23,Su,10,1,"div",14),o.YNc(24,Nu,9,2,"ng-container",15),o.YNc(25,Qu,1,1,"p",16),o.ALo(26,"async"),o.qZA(),o.YNc(27,Yu,7,0,"div",17),o.YNc(28,Fu,7,0,"div",17),o.TgZ(29,"div",18),o.TgZ(30,"div",1),o._uU(31,"Import Records"),o.qZA(),o.TgZ(32,"p",13),o._uU(33,"Whenever a new search method is enabled, records that already exist in database need to be imported into the index. All records created after search method is enabled will be imported automatically."),o.qZA(),o.TgZ(34,"p"),o._uU(35,"Depending on number of records in database, importing could take some time. Don't close this window while it is in progress."),o.qZA(),o.TgZ(36,"div",19),o.TgZ(37,"div",5),o.TgZ(38,"label",20),o._uU(39,"Record Type"),o.qZA(),o.TgZ(40,"select",21),o.TgZ(41,"option",22),o._uU(42,"All"),o.qZA(),o.YNc(43,Ru,2,2,"option",23),o.ALo(44,"async"),o.qZA(),o.qZA(),o.TgZ(45,"button",24),o.NdJ("click",function(){return t.importRecords()}),o.ALo(46,"async"),o._uU(47,"Import Now"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(48,"button",25),o.ALo(49,"async"),o._uU(50,"Update"),o.qZA(),o.YNc(51,Eu,1,0,"mat-progress-bar",26),o.ALo(52,"async"),o.qZA()),2&e&&(o.xp6(10),o.Q6J("ngModel",t.state.server.scout_driver),o.xp6(13),o.Q6J("ngIf","mysql"===t.state.server.scout_driver),o.xp6(1),o.Q6J("ngIf","algolia"===t.state.server.scout_driver),o.xp6(1),o.Q6J("ngIf",o.lcZ(26,12,t.errors$).search_group),o.xp6(2),o.Q6J("ngIf","meilisearch"===t.state.server.scout_driver),o.xp6(1),o.Q6J("ngIf","elastic"===t.state.server.scout_driver),o.xp6(12),o.Q6J("formControl",t.searchableModelControl),o.xp6(1),o.Q6J("ngValue",null),o.xp6(2),o.Q6J("ngForOf",o.lcZ(44,14,t.models$)),o.xp6(2),o.Q6J("disabled",o.lcZ(46,16,t.loading$)),o.xp6(3),o.Q6J("disabled",o.lcZ(49,18,t.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(52,20,t.loading$)))},directives:[Zt.P,a.JL,a.F,a.EJ,a.JJ,a.On,a.YN,a.Kr,i.O5,a.oH,i.sg,g.lW,a.Fj,a.Q7,s.pW],pipes:[i.Ov],styles:[".import-flex[_ngcontent-%COMP%]{display:flex;align-items:center;margin-top:15px}.import-flex[_ngcontent-%COMP%]   .input-container[_ngcontent-%COMP%]{max-width:100px}.import-flex[_ngcontent-%COMP%]   .mat-stroked-button[_ngcontent-%COMP%]{line-height:46px;margin-top:0;margin-left:10px}"]}),e})()},...Ni]}]},{path:"appearance",loadChildren:()=>n.e(299).then(n.bind(n,5299)).then(e=>e.AppAppearanceModule),canActivate:[dt.a],canActivateChild:[dt.a],data:{permissions:["appearance.update"]}}];let $u=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=o.oAB({type:e}),e.\u0275inj=o.cJS({imports:[[l.Bz.forChild(Lu)],l.Bz]}),e})();var Vu=n(3389);let Hu=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=o.oAB({type:e}),e.\u0275inj=o.cJS({imports:[[i.ez,a.UX,M.N,Vu.p,O.Ps,m.Is]]}),e})();var zu=n(8295),Bu=n(5122),ju=n(5217);let Gu=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=o.oAB({type:e}),e.\u0275inj=o.cJS({imports:[[i.ez,g.ot,s.Cv,O.Ps]]}),e})();var Xu=n(8285);let Wu=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=o.oAB({type:e}),e.\u0275inj=o.cJS({imports:[[i.ez,Gu,Xu.T,M.N,s.Cv,O.Ps,g.ot,C.Tx]]}),e})(),Ku=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=o.oAB({type:e}),e.\u0275inj=o.cJS({imports:[[i.ez,m.Is,g.ot,O.Ps],O.Ps]}),e})();var eg=n(8528);let tg=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=o.oAB({type:e}),e.\u0275inj=o.cJS({imports:[[i.ez,M.N,g.ot,O.Ps,h.Hi]]}),e})();var ng=n(557);let ig=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=o.oAB({type:e}),e.\u0275inj=o.cJS({imports:[[i.ez,l.Bz,ng.x,M.N,P.X,ju.u,Q,Vu.p,a.u5,a.UX,eg.I,O.Ps,g.ot,k.AV,T.rP,s.Cv]]}),e})(),ag=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=o.oAB({type:e}),e.\u0275inj=o.cJS({imports:[[i.ez,M.N,a.UX]]}),e})();var sg=n(2544),og=n(7446);let rg=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=o.oAB({type:e}),e.\u0275inj=o.cJS({imports:[[i.ez,M.N,a.u5,a.UX],i.ez]}),e})();var lg=n(6989),cg=n(1023);let dg=(()=>{class e{constructor(e){this.settings=e,this.settings.merge({vebto:et})}}return e.\u0275fac=function(t){return new(t||e)(o.LFG(st.Z))},e.\u0275mod=o.oAB({type:e}),e.\u0275inj=o.cJS({providers:[ft.u],imports:[[l.Bz,i.ez,a.u5,a.UX,Q,N,zu.l,Bu.N,tt.J,I,ng.x,P.X,M.N,ju.u,Vu.p,Wu,Ku,eg.I,tg,$u,ig,rg,lg.c,cg.M,g.ot,O.Ps,k.AV,m.Is,C.Tx,T.rP,h.Hi,u.Bb,it._t,s.Cv,Ke.To,x.us,We,x.XK,ag,sg.S,nt,x.si,Hu,og.m],l.Bz,i.ez,a.u5,a.UX,Q,N,M.N,P.X,Ku,ng.x,g.ot,O.Ps,q.ZX,p.p9,k.AV,m.Is,C.Tx,T.rP,h.Hi]}),e})(),ug=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=o.oAB({type:e}),e.\u0275inj=o.cJS({imports:[[i.ez,a.u5,a.UX,dg,Ku,ju.u,Vu.p,ng.x,s.Cv,J.Nh]]}),e})()},4563:(e,t,n)=>{"use strict";n.d(t,{G:()=>l});var i=n(8715),a=n(8756),s=n(6850),o=n(2655),r=n(7716);let l=(()=>{class e extends i.c{constructor(){super(...arguments),this.DEFAULT_MAX_SIZE_MB=5}initValidations(){const e=[new a.p({maxSize:(0,s.F)(this.DEFAULT_MAX_SIZE_MB,"MB")},this.i18n),new o.p({types:["image"]},this.i18n)];this.validations.push(...e)}}return e.\u0275fac=function(){let t;return function(n){return(t||(t=r.n5z(e)))(n||e)}}(),e.\u0275prov=r.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},3868:(e,t,n)=>{"use strict";n.d(t,{C:()=>o});var i=(()=>(function(e){e[e.ENTER=13]="ENTER",e[e.SPACE=32]="SPACE",e[e.ESCAPE=27]="ESCAPE",e[e.DELETE=46]="DELETE",e[e.ARROW_UP=38]="ARROW_UP",e[e.ARROW_RIGHT=39]="ARROW_RIGHT",e[e.ARROW_DOWN=40]="ARROW_DOWN",e[e.ARROW_LEFT=37]="ARROW_LEFT",e[e.BACKSPACE=8]="BACKSPACE",e[e.TAB=9]="TAB",e[e.S=83]="S",e[e.N=78]="N",e[e.A=65]="A",e[e.T=84]="T",e[e.B=66]="B",e[e.C=67]="C",e[e.O=79]="O",e[e.P=80]="P",e[e.R=82]="R",e[e.F=70]="F",e[e.Y=89]="Y",e[e.Z=90]="Z"}(i||(i={})),i))(),a=n(2759),s=n(7716);let o=(()=>{class e{constructor(){this.bindings=[]}add(e,t){Array.isArray(e)||(e=[e]),e.forEach(e=>{this.bindings.push({keybind:this.parseKeybindString(e),keybindString:e,callback:t})})}addWithPreventDefault(e,t){this.bindings.push({keybind:this.parseKeybindString(e),keybindString:e,callback:t,preventDefault:!0})}listenOn(e,t={}){return(0,a.R)(e,"keydown").subscribe(e=>{!t.fireIfInputFocused&&["input","select"].includes(document.activeElement.nodeName.toLowerCase())||this.executeBindings(e)})}executeBindings(e){this.bindings.forEach(t=>{this.bindingMatches(t.keybind,e)&&(t.preventDefault&&e.preventDefault&&e.preventDefault(),t.callback(e))})}bindingMatches(e,t){return i[e.key.toUpperCase()]===t.keyCode&&(t.ctrlKey===e.ctrl||t.metaKey===e.ctrl)&&t.shiftKey===e.shift}parseKeybindString(e){const t=e.trim().split("+"),n={ctrl:!1,shift:!1,key:""};return t.forEach(e=>{"ctrl"===(e=e.trim().toLowerCase())?n.ctrl=!0:"shift"===e?n.shift=!0:n.key=e}),n}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=s.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},4666:(e,t,n)=>{"use strict";n.d(t,{S:()=>T});var i=n(3679),a=n(6215),s=n(5917),o=n(4395),r=n(7519),l=n(3190),c=n(5304),d=n(7716),u=n(8341),g=n(8583),p=n(1554),h=n(6627),m=n(2458),f=n(3297);const _=["auto"],b=["inputEl"],v=["selectModeTemplate"];function Z(e,t){if(1&e){const e=d.EpF();d.TgZ(0,"mat-chip",8),d.NdJ("removed",function(){const t=d.CHM(e).index;return d.oxw().remove(t)}),d._uU(1),d._UZ(2,"mat-icon",9),d.qZA()}if(2&e){const e=t.$implicit,n=d.oxw();d.Q6J("selectable",!1)("removable",!n.selectMode),d.xp6(1),d.hij(" ",n.displayChipValue(e)," ")}}const x=function(e){return{elementRef:e}};function A(e,t){if(1&e){const e=d.EpF();d.TgZ(0,"input",10,11),d.NdJ("matChipInputTokenEnd",function(t){return d.CHM(e),d.oxw().addFromChipInput(t.value)}),d.ALo(2,"trans"),d.qZA()}if(2&e){const e=d.oxw(),t=d.MAs(1),n=d.MAs(6);d.Q6J("placeholder",d.lcZ(2,7,e.placeholder))("type",e.type)("matChipInputFor",t)("matChipInputAddOnBlur",!0)("matAutocomplete",n)("matAutocompleteConnectedTo",d.VKq(9,x,e.el))("formControl",e.formControl)}}function y(e,t){if(1&e&&(d.TgZ(0,"mat-option",12),d._uU(1),d.qZA()),2&e){const e=t.$implicit,n=d.oxw();d.Q6J("value",e),d.xp6(1),d.Oqu(n.displayChipValue(e))}}function w(e,t){if(1&e&&(d.TgZ(0,"mat-option",12),d._uU(1),d.qZA()),2&e){const e=t.$implicit,n=d.oxw(2);d.Q6J("value",e),d.xp6(1),d.Oqu(n.displayChipValue(e))}}function C(e,t){1&e&&d.YNc(0,w,2,2,"mat-option",6),2&e&&d.Q6J("ngForOf",t.suggestions)}let T=(()=>{class e{constructor(e){this.el=e,this.type="text",this.emailsInput=!1,this.selectMode=!1,this.formControl=new i.NI,this.items$=new a.X([]),this.suggestedValues$=new a.X([])}set suggestedValues(e){this.suggestedValues$.next(e)}ngOnInit(){this.suggestFn&&this.bindToSearchControl()}ngAfterViewInit(){this.emailsInput&&this.parseEmailsOnPaste()}remove(e){const t=[...this.items$.value];t.splice(e,1),this.items$.next(t),this.propagateChange(this.items$.value)}addFromChipInput(e,t=!0){!e||this.matAutocomplete.isOpen||this.selectMode||this.add(e,t)}addFromAutocomplete(e,t=!0){this.add(e,t)}add(e,t=!0){e="string"==typeof e?e.trim():e;const n=this.findValueIndex(e)>-1;e&&!n&&(this.items$.next([...this.items$.value,e]),t&&this.propagateChange(this.items$.value)),this.inputEl&&(this.inputEl.nativeElement.value=""),this.formControl.setValue(null),this.suggestedValues$.next([])}findValueIndex(e){return"string"==typeof e?this.items$.value.indexOf(e):this.items$.value.findIndex(t=>t.id===e.id)}writeValue(e=[]){this.items$.next(e||[])}registerOnChange(e){this.propagateChange=e}registerOnTouched(){}bindToSearchControl(){this.formControl.valueChanges.pipe((0,o.b)(150),(0,r.x)(),(0,l.w)(e=>e?this.suggestFn(e):(0,s.of)([])),(0,c.K)(()=>(0,s.of)([]))).subscribe(e=>{const t=e.filter(e=>-1===this.findValueIndex(e));this.suggestedValues$.next(t)})}displayChipValue(e){return"object"==typeof e?e.name:e}parseEmailsOnPaste(){this.inputEl.nativeElement.addEventListener("paste",e=>{const t=(e.clipboardData||window.clipboardData).getData("text").match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi);if(t){e.preventDefault();const n=window.getSelection();n.rangeCount&&(n.deleteFromDocument(),t.forEach(e=>this.add(e)))}})}}return e.\u0275fac=function(t){return new(t||e)(d.Y36(d.SBq))},e.\u0275cmp=d.Xpm({type:e,selectors:[["chip-input"]],viewQuery:function(e,t){if(1&e&&(d.Gf(_,5),d.Gf(b,5),d.Gf(v,5)),2&e){let e;d.iGM(e=d.CRH())&&(t.matAutocomplete=e.first),d.iGM(e=d.CRH())&&(t.inputEl=e.first),d.iGM(e=d.CRH())&&(t.selectModeTemplate=e.first)}},hostVars:2,hostBindings:function(e,t){2&e&&d.ekj("select-mode",t.selectMode)},inputs:{placeholder:"placeholder",type:"type",emailsInput:"emailsInput",suggestFn:"suggestFn",selectMode:"selectMode",suggestedValues:"suggestedValues"},features:[d._Bn([{provide:i.JU,useExisting:e,multi:!0}])],decls:11,vars:9,consts:[[3,"selectable"],["chipList",""],[3,"selectable","removable","removed",4,"ngFor","ngForOf"],["class","mat-chip-input mat-input-element",3,"placeholder","type","matChipInputFor","matChipInputAddOnBlur","matAutocomplete","matAutocompleteConnectedTo","formControl","matChipInputTokenEnd",4,"ngIf"],[1,"chip-input-autocomplete-panel",3,"autoActiveFirstOption","optionSelected"],["auto","matAutocomplete"],[3,"value",4,"ngFor","ngForOf"],["selectModeTemplate",""],[3,"selectable","removable","removed"],["matChipRemove","","svgIcon","cancel"],[1,"mat-chip-input","mat-input-element",3,"placeholder","type","matChipInputFor","matChipInputAddOnBlur","matAutocomplete","matAutocompleteConnectedTo","formControl","matChipInputTokenEnd"],["inputEl",""],[3,"value"]],template:function(e,t){1&e&&(d.TgZ(0,"mat-chip-list",0,1),d.YNc(2,Z,3,3,"mat-chip",2),d.ALo(3,"async"),d.YNc(4,A,3,11,"input",3),d.qZA(),d.TgZ(5,"mat-autocomplete",4,5),d.NdJ("optionSelected",function(e){return t.addFromAutocomplete(e.option.value)}),d.YNc(7,y,2,2,"mat-option",6),d.ALo(8,"async"),d.qZA(),d.YNc(9,C,1,1,"ng-template",null,7,d.W1O)),2&e&&(d.Q6J("selectable",!1),d.xp6(2),d.Q6J("ngForOf",d.lcZ(3,5,t.items$)),d.xp6(2),d.Q6J("ngIf",!t.selectMode),d.xp6(1),d.Q6J("autoActiveFirstOption",!0),d.xp6(2),d.Q6J("ngForOf",d.lcZ(8,7,t.suggestedValues$)))},directives:[u.qn,g.sg,g.O5,p.XC,u.HS,h.Hw,u.qH,u.oH,p.ZL,i.Fj,i.JJ,i.oH,m.ey],pipes:[g.Ov,f.R],styles:["chip-input{display:block;min-height:46px}chip-input .mat-chip-list-wrapper{width:100%;height:100%;color:inherit;border:1px solid var(--be-divider-default);padding:6px;line-height:normal;font-size:1.4rem;font-family:inherit;background-color:inherit;box-sizing:border-box;border-radius:2px;margin:0}chip-input .mat-chip-input{height:24px;font:inherit;background:0 0;color:currentColor;border:none;outline:0;padding:0;margin:0;width:0;max-width:100%;vertical-align:bottom;text-align:inherit}chip-input .mat-chip-input:focus{outline:none;box-shadow:none}.chip-input-select-panel{background-color:var(--be-background);min-width:180px;box-shadow:0 2px 4px -1px #0003,0 4px 5px 0 #00000024,0 1px 10px 0 #0000001f}"],encapsulation:2,changeDetection:0}),e})()},7446:(e,t,n)=>{"use strict";n.d(t,{m:()=>s});var i=n(8583),a=n(7716);let s=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=a.oAB({type:e}),e.\u0275inj=a.cJS({imports:[[i.ez]]}),e})()},4889:(e,t,n)=>{"use strict";function i(e){const t=Object.assign({},e);return Object.keys(t).forEach(e=>{null!=t[e]&&""!==t[e]||delete t[e]}),t}n.d(t,{N:()=>i})},7240:(e,t,n)=>{"use strict";function i(e,t){return e.filter(e=>function(e,t){const n="string"==typeof e?e:a(e),i=t.trim().toLowerCase();return-1!==n.indexOf(i)}(e,t))}function a(e){return Object.keys(e).reduce((t,n)=>t+(e[n]&&"object"==typeof e[n]?a(e[n]):e[n])+"\u25ec","").toLowerCase()}n.d(t,{D:()=>i})},7678:(e,t,n)=>{"use strict";n.d(t,{T:()=>o});var i=n(3913),a=n(7716),s=n(9244);let o=(()=>{class e{constructor(e){this.i18n=e}getFullPlanName(){if(!this.plan)return;let e=this.plan.parent?this.plan.parent.name:this.plan.name;return e=(0,i.z)(this.i18n.t(e)),e+=" "+this.i18n.t("Plan"),this.plan.parent&&(e+=": "+this.plan.name),e}}return e.\u0275fac=function(t){return new(t||e)(a.Y36(s.Z))},e.\u0275cmp=a.Xpm({type:e,selectors:[["full-plan-name"]],inputs:{plan:"plan"},decls:1,vars:1,template:function(e,t){1&e&&a._uU(0),2&e&&a.Oqu(t.getFullPlanName())},encapsulation:2,changeDetection:0}),e})()},7673:(e,t,n)=>{"use strict";n.d(t,{J:()=>a});var i=n(7716);let a=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=i.oAB({type:e}),e.\u0275inj=i.cJS({}),e})()},3410:(e,t,n)=>{"use strict";n.d(t,{Y:()=>o});var i=n(7716),a=n(4673),s=n(4655);let o=(()=>{class e{constructor(e,t){this.settings=e,this.router=t}canActivate(e,t){return this.handle()}canActivateChild(e,t){return this.handle()}handle(){return!(!this.settings.get("billing.integrated")||!this.settings.get("billing.enable"))||(this.router.navigate(["/"]),!1)}}return e.\u0275fac=function(t){return new(t||e)(i.LFG(a.Z),i.LFG(s.F0))},e.\u0275prov=i.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},4284:(e,t,n)=>{"use strict";n.d(t,{o:()=>s});var i=n(7716),a=n(299);let s=(()=>{class e{constructor(e){this.http=e}all(t){return this.http.get(e.BASE_URI,t)}get(t){return this.http.get(`${e.BASE_URI}/${t}`)}create(t){return this.http.post(e.BASE_URI,t)}update(t,n){return this.http.put(`${e.BASE_URI}/${t}`,n)}delete(t){return this.http.delete(`${e.BASE_URI}/${t}`)}sync(){return this.http.post(`${e.BASE_URI}/sync`)}}return e.BASE_URI="billing-plan",e.\u0275fac=function(t){return new(t||e)(i.LFG(a.r))},e.\u0275prov=i.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},3543:(e,t,n)=>{"use strict";n.d(t,{_:()=>f});var i=n(6215),a=n(9765),s=n(6782),o=n(3653),r=n(5257),l=n(5435),c=n(4655),d=n(7716),u=n(6605),g=n(962),p=n(4673),h=n(8583);const m=["*"];let f=(()=>{class e{constructor(e,t,n,s,o){this.breakpoints=e,this.localStorage=t,this.settings=n,this.el=s,this.router=o,this.navIsOpen$=new i.X(!1),this.isCompact$=new i.X(!1),this.onDestroy$=new a.xQ}ngOnInit(){this.navIsOpen$.next(!this.breakpoints.isMobile$.value),this.isCompact$.pipe((0,s.R)(this.onDestroy$)).subscribe(e=>{e?this.el.nativeElement.style.setProperty("--nav-width","80px"):this.el.nativeElement.style.removeProperty("--nav-width")}),this.navIsOpen$.pipe((0,o.T)(1),(0,r.q)(1)).subscribe(()=>{this.el.nativeElement.classList.add("enable-transitions")}),this.navIsOpen$.pipe((0,s.R)(this.onDestroy$)).subscribe(e=>{e?this.el.nativeElement.classList.remove("nav-closed"):this.el.nativeElement.classList.add("nav-closed")}),this.router.events.pipe((0,l.h)(e=>e instanceof c.m2),(0,s.R)(this.onDestroy$)).subscribe(()=>{this.navIsOpen$.next(!this.breakpoints.isMobile$.value)})}ngOnDestroy(){this.onDestroy$.next()}toggleSidebarMode(){this.breakpoints.isMobile$.value?this.navIsOpen$.next(!this.navIsOpen$.value):(this.isCompact$.next(!this.isCompact$.value),this.localStorage.set(this.storageSelector(),this.isCompact$.value))}storageSelector(){return`${this.settings.get("branding.site_name")}.sidebarCompact`}}return e.\u0275fac=function(t){return new(t||e)(d.Y36(u.S),d.Y36(g.m),d.Y36(p.Z),d.Y36(d.SBq),d.Y36(c.F0))},e.\u0275cmp=d.Xpm({type:e,selectors:[["sidenav"]],ngContentSelectors:m,decls:3,vars:4,consts:[[1,"backdrop",3,"click"]],template:function(e,t){1&e&&(d.F$t(),d.Hsn(0),d.TgZ(1,"div",0),d.NdJ("click",function(){return t.navIsOpen$.next(!1)}),d.ALo(2,"async"),d.qZA()),2&e&&(d.xp6(1),d.ekj("visible",d.lcZ(2,2,t.navIsOpen$)))},pipes:[h.Ov],styles:["[_nghost-%COMP%]{display:flex;padding-top:var(--top-offset);--nav-width:225px;--top-offset:70px}.no-navbar[_nghost-%COMP%]{--top-offset:0px}.nav-closed[_nghost-%COMP%]     nav{transform:translate3d(-100%,0,0);box-shadow:none}.enable-transitions[_nghost-%COMP%]     nav{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:transform}[_nghost-%COMP%]     nav{width:var(--nav-width);overflow:auto;padding:26px 8px 16px;border-right:1px solid var(--be-divider-default);display:flex;flex-direction:column;position:fixed;top:var(--top-offset);bottom:0;z-index:4;background-color:var(--be-background)}@media only screen and (max-width: 768px){[_nghost-%COMP%]     nav{box-shadow:0 3px 5px -1px #0003,0 5px 8px 0 #00000024,0 1px 14px 0 #0000001f}}[_nghost-%COMP%]   .backdrop[_ngcontent-%COMP%]{display:block;top:0;left:0;right:0;bottom:0;position:absolute;z-index:1;transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:background-color,visibility;visibility:hidden}[_nghost-%COMP%]   .backdrop.visible[_ngcontent-%COMP%]{visibility:visible;background-color:var(--be-backdrop);opacity:.6}@media only screen and (min-width: 768px){[_nghost-%COMP%]   .backdrop[_ngcontent-%COMP%]{display:none}}[_nghost-%COMP%]     main{min-width:0;flex:1 1 auto;background-color:var(--be-background-alternative);min-height:calc(100vh - var(--top-offset, 0px));display:flex;flex-direction:column}@media only screen and (min-width: 768px){[_nghost-%COMP%]     main{margin-left:var(--nav-width)}}"],changeDetection:0}),e})()},6989:(e,t,n)=>{"use strict";n.d(t,{c:()=>s});var i=n(8583),a=n(7716);let s=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=a.oAB({type:e}),e.\u0275inj=a.cJS({imports:[[i.ez]]}),e})()},2644:(e,t,n)=>{"use strict";n.d(t,{y:()=>s});var i=n(1796),a=n(7716);let s=(()=>{class e{transform(e=0,t){return isNaN(parseFloat(String(e)))||!isFinite(e)?"-":(0,i.H)(e,t)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=a.Yjl({name:"formattedFileSize",type:e,pure:!0}),e})()},8976:(e,t,n)=>{"use strict";n.d(t,{C:()=>i});var i=(()=>(function(e){e.Image="uploads/images"}(i||(i={})),i))()},9141:(e,t,n)=>{"use strict";n.d(t,{A:()=>I});var i=n(9765),a=n(6215),s=n(2298),o=n(8480);class r{constructor(e,t){this.canceled$=new i.xQ,this.processing$=new a.X(!1),this.uploadedResponse$=new s.t(1),this.progress$=new a.X({percentage:0}),this.error$=new a.X(null),this.customData={},this.uploadedFile=e,this.id=t||(0,o.O)()}get completed(){return!this.processing$.value&&100===this.progress$.value.percentage}get inProgress(){return!this.error$.value&&!this.completed}cancel(){this.canceled$.next(!0),this.finalize()}complete(){this.setProgress({percentage:100,eta:null}),this.finalize()}finalize(){this.uploadedResponse$.complete(),this.canceled$.complete(),this.progress$.complete()}finishProcessing(){this.processing$.next(!1),this.processing$.complete()}addError(e){this.error$.next(e)}setProgress(e){this.progress$.next(Object.assign(Object.assign({},this.progress$.value),e))}}var l=n(4402),c=n(205),d=n(9193),u=n(9773),g=n(5304),p=n(6782),h=n(8002),m=n(5435),f=n(6421),_=n(1769),b=n(7716),v=n(7312),Z=n(8715),x=n(8756),A=n(6232);class y extends A.y{constructor(e,t){super(),this.params=e,this.i18n=t,this.errorMessage=this.i18n.t("Only these file types are allowed: :extensions",{extensions:this.params.extensions.join(", ")})}fails(e){return!this.params.extensions.some(t=>t.toLowerCase()===e.extension.toLowerCase())}}class w extends A.y{constructor(e,t){super(),this.params=e,this.i18n=t,this.errorMessage=this.i18n.t("These file types are not allowed: :extensions",{extensions:this.params.extensions.join(", ")})}fails(e){return this.params.extensions.some(t=>t===e.extension)}}var C=n(6850);let T=(()=>{class e extends Z.c{constructor(){super(...arguments),this.DEFAULT_MAX_FILE_SIZE_MB=8,this.showToast=!0}initValidations(){this.validations.push(new x.p({maxSize:this.getMaxFileSize()},this.i18n));const e=this.getAllowedExtensions(),t=this.getBlockedExtensions();e&&e.length&&this.validations.push(new y({extensions:e},this.i18n)),t&&t.length&&this.validations.push(new w({extensions:t},this.i18n))}getMaxFileSize(){return this.settings.get("uploads.max_size",(0,C.F)(this.DEFAULT_MAX_FILE_SIZE_MB,"MB"))}getAllowedExtensions(){return this.settings.getJson("uploads.allowed_extensions")}getBlockedExtensions(){return this.settings.getJson("uploads.blocked_extensions")}}return e.\u0275fac=function(){let t;return function(n){return(t||(t=b.n5z(e)))(n||e)}}(),e.\u0275prov=b.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var q=n(5718),k=n(4688),M=n(4673);let I=(()=>{class e{constructor(e,t,n,o,r){this.api=e,this.defaultValidator=t,this.toast=n,this.currentUser=o,this.settings=r,this.uploads$=new a.X([]),this.totalProgress$=new s.t(1),this.uploadsAdded$=new i.xQ,this.count$=new a.X({pending:0,completed:0})}isEmpty(){return!this.uploads$.value.length}getAllCompleted(){return this.uploads$.value.filter(e=>e.completed).map(e=>e.fileEntry)}updateTotalProgress(){const e=this.uploads$.value.map(e=>e.progress$.value.percentage||0);this.totalProgress$.next(e.reduce((e,t)=>e+t,0)/e.length)}totalProgress(){return this.totalProgress$.asObservable()}start(e,t={}){const n=t.validator||this.defaultValidator;let i=[];if(Array.isArray(e))i=this.transformUploads(e,n),this.uploads$.next(this.uploads$.value.concat(i)),this.uploadsAdded$.next(i);else{const t=this.uploads$.value.map(t=>{if(e[t.id]){const a=this.transformUploads([e[t.id]],n,t.id)[0];return i.push(a),a}return t});this.uploads$.next(t)}return this.updateCount(),(0,l.D)(i.filter(e=>!e.error$.value)).pipe((0,u.zg)(e=>this.api.upload(e.uploadedFile,t).pipe((0,g.K)(i=>(this.handleUploadFailure(i,e,n),t.bubbleError?(0,c._)(i):d.E)),(0,p.R)(e.canceled$),(0,h.U)(n=>(this.handleUploadEvent(n,e,t.willProcessFiles),n.name===f.b.COMPLETED&&(n.body.queueItemId=e.id),n))),1),(0,m.h)(e=>e.name===f.b.COMPLETED),(0,h.U)(e=>e.body))}updateProgress(e,t){const n=this.find(e);n&&(n.setProgress({eta:t.eta,speed:t.speed,percentage:t.progress,totalBytes:t.totalBytes,completedBytes:t.completedBytes}),this.updateTotalProgress())}completeUpload(e,t){const n=this.find(e);n&&(n.uploadedResponse$.next(t),n.fileEntry=t.fileEntry,n.complete(),this.updateTotalProgress())}errorUpload(e,t){this.find(e).addError(t)}reset(){this.uploads$.value.forEach(e=>e.cancel()),this.uploads$.next([])}remove(e){const t=this.uploads$.value.findIndex(t=>t.id===e),n=this.uploads$.value[t];n.completed?n.finalize():n.cancel(),this.uploads$.value.splice(t,1),this.uploads$.next(this.uploads$.value)}find(e){return this.uploads$.value.find(t=>t.id===e)}transformUploads(e,t,n){return e.map(e=>{const i=new r(e,n);if(t){const n=t.validate(e);n.failed&&i.addError(n.errorMessage)}return i})}handleUploadEvent(e,t,n=!1){e.name===f.b.PROGRESS?(100===e.progress&&(e=Object.assign(Object.assign({},e),{progress:99}),n&&t.processing$.next(!0)),this.updateProgress(t.id,e)):e.name===f.b.COMPLETED&&(this.completeUpload(t.id,e.body),this.updateCount())}handleUploadFailure(e,t,n){var i;let a=null===(i=null==e?void 0:e.errors)||void 0===i?void 0:i.file,s=null;a||(a=_.v.DefaultUpload,s=this.currentUser.isAdmin()&&!this.settings.get("site.hide_docs_buttons")),this.errorUpload(t.id,a),this.updateCount(),this.updateTotalProgress(),n.showToast&&this.toast.open(a,{action:s?"Learn More":null}).onAction().subscribe(()=>{window.open(_.h)})}updateCount(){const e=this.uploads$.value.filter(e=>e.inProgress).length;this.count$.next({pending:e,completed:this.uploads$.value.length-e})}}return e.\u0275fac=function(t){return new(t||e)(b.LFG(v.f),b.LFG(T),b.LFG(q.F),b.LFG(k.I),b.LFG(M.Z))},e.\u0275prov=b.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()}}]);
//# sourceMappingURL=244.c4283ff35da16788acfe.js.map

Youez - 2016 - github.com/yon3zu
LinuXploit