Viewing File: /home/markqprx/iniasli.pro/public/client/445-es2015.0571e61aeb32d1a410f2.js
(self.webpackChunkclient=self.webpackChunkclient||[]).push([[445],{69244:function(t,e,n){"use strict";n.d(e,{Zt:function(){return mt},Bh:function(){return pt},Wj:function(){return dt},_t:function(){return bt},bA:function(){return V}});var i=n(35366),o=n(61116),s=n(43725),a=n(93169),r=n(19861),l=n(48318),c=n(48569),d=n(62293);function u(t){const{subscriber:e,counter:n,period:i}=t;e.next(n),this.schedule({subscriber:e,counter:n+1,period:i},i)}var p=n(55959),h=n(87570),g=n(91741),m=n(31906),f=n(25416),b=n(56238),v=n(79996),_=n(90611),x=n(66599),Z=n(44689),y=n(94720);function w(t,e){for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function k(t,e){const n=e?"":"none";w(t.style,{touchAction:e?"":"none",webkitUserDrag:e?"":"none",webkitTapHighlightColor:e?"":"transparent",userSelect:n,msUserSelect:n,webkitUserSelect:n,MozUserSelect:n})}function A(t,e){const n=t.style;n.position=e?"":"fixed",n.top=n.opacity=e?"":"0",n.left=e?"":"-999em"}function C(t){const e=t.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(t)*e}function T(t,e){return t.getPropertyValue(e).split(",").map(t=>t.trim())}function q(t){const e=t.getBoundingClientRect();return{top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}}function I(t,e,n){const{top:i,bottom:o,left:s,right:a}=t;return n>=i&&n<=o&&e>=s&&e<=a}function O(t,e,n){t.top+=e,t.bottom=t.top+t.height,t.left+=n,t.right=t.left+t.width}function U(t,e,n,i){const{top:o,right:s,bottom:a,left:r,width:l,height:c}=t,d=l*e,u=c*e;return i>o-u&&i<a+u&&n>r-d&&n<s+d}class P{constructor(t,e){this._document=t,this._viewportRuler=e,this.positions=new Map}clear(){this.positions.clear()}cache(t){this.clear(),this.positions.set(this._document,{scrollPosition:this._viewportRuler.getViewportScrollPosition()}),t.forEach(t=>{this.positions.set(t,{scrollPosition:{top:t.scrollTop,left:t.scrollLeft},clientRect:q(t)})})}handleScroll(t){const e=t.target,n=this.positions.get(e);if(!n)return null;const i=e===this._document?e.documentElement:e,o=n.scrollPosition;let s,a;if(e===this._document){const t=this._viewportRuler.getViewportScrollPosition();s=t.top,a=t.left}else s=e.scrollTop,a=e.scrollLeft;const r=o.top-s,l=o.left-a;return this.positions.forEach((t,n)=>{t.clientRect&&e!==n&&i.contains(n)&&O(t.clientRect,r,l)}),o.top=s,o.left=a,{top:r,left:l}}}function M(t){const e=t.cloneNode(!0),n=e.querySelectorAll("[id]"),i=t.nodeName.toLowerCase();e.removeAttribute("id");for(let o=0;o<n.length;o++)n[o].removeAttribute("id");return"canvas"===i?E(t,e):"input"!==i&&"select"!==i&&"textarea"!==i||J(t,e),S("canvas",t,e,E),S("input, textarea, select",t,e,J),e}function S(t,e,n,i){const o=e.querySelectorAll(t);if(o.length){const e=n.querySelectorAll(t);for(let t=0;t<o.length;t++)i(o[t],e[t])}}let N=0;function J(t,e){"file"!==e.type&&(e.value=t.value),"radio"===e.type&&e.name&&(e.name=`mat-clone-${e.name}-${N++}`)}function E(t,e){const n=e.getContext("2d");if(n)try{n.drawImage(t,0,0)}catch(i){}}const L=(0,a.i$)({passive:!0}),D=(0,a.i$)({passive:!1});class ${constructor(t,e,n,i,o,s){this._config=e,this._document=n,this._ngZone=i,this._viewportRuler=o,this._dragDropRegistry=s,this._passiveTransform={x:0,y:0},this._activeTransform={x:0,y:0},this._moveEvents=new p.xQ,this._pointerMoveSubscription=h.w.EMPTY,this._pointerUpSubscription=h.w.EMPTY,this._scrollSubscription=h.w.EMPTY,this._resizeSubscription=h.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 p.xQ,this.started=new p.xQ,this.released=new p.xQ,this.ended=new p.xQ,this.entered=new p.xQ,this.exited=new p.xQ,this.dropped=new p.xQ,this.moved=this._moveEvents,this._pointerDown=t=>{if(this.beforeStarted.next(),this._handles.length){const e=this._handles.find(e=>{const n=t.target;return!!n&&(n===e||e.contains(n))});!e||this._disabledHandles.has(e)||this.disabled||this._initializeDragSequence(e,t)}else this.disabled||this._initializeDragSequence(this._rootElement,t)},this._pointerMove=t=>{const e=this._getPointerPositionOnPage(t);if(!this._hasStartedDragging){if(Math.abs(e.x-this._pickupPositionOnPage.x)+Math.abs(e.y-this._pickupPositionOnPage.y)>=this._config.dragStartThreshold){const e=Date.now()>=this._dragStartTime+this._getDragStartDelay(t),n=this._dropContainer;if(!e)return void this._endDragSequence(t);n&&(n.isDragging()||n.isReceiving())||(t.preventDefault(),this._hasStartedDragging=!0,this._ngZone.run(()=>this._startDragSequence(t)))}return}this._boundaryElement&&(this._previewRect&&(this._previewRect.width||this._previewRect.height)||(this._previewRect=(this._preview||this._rootElement).getBoundingClientRect())),t.preventDefault();const n=this._getConstrainedPointerPosition(e);if(this._hasMoved=!0,this._lastKnownPointerPosition=e,this._updatePointerDirectionDelta(n),this._dropContainer)this._updateActiveDropContainer(n,e);else{const t=this._activeTransform;t.x=n.x-this._pickupPositionOnPage.x+this._passiveTransform.x,t.y=n.y-this._pickupPositionOnPage.y+this._passiveTransform.y,this._applyRootElementTransform(t.x,t.y),"undefined"!=typeof SVGElement&&this._rootElement instanceof SVGElement&&this._rootElement.setAttribute("transform",`translate(${t.x} ${t.y})`)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:n,event:t,distance:this._getDragDistance(n),delta:this._pointerDirectionDelta})})},this._pointerUp=t=>{this._endDragSequence(t)},this.withRootElement(t).withParent(e.parentDragRef||null),this._parentPositions=new P(n,o),s.registerDragItem(this)}get disabled(){return this._disabled||!(!this._dropContainer||!this._dropContainer.disabled)}set disabled(t){const e=(0,r.Ig)(t);e!==this._disabled&&(this._disabled=e,this._toggleNativeDragInteractions(),this._handles.forEach(t=>k(t,e)))}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(t){this._handles=t.map(t=>(0,r.fI)(t)),this._handles.forEach(t=>k(t,this.disabled)),this._toggleNativeDragInteractions();const e=new Set;return this._disabledHandles.forEach(t=>{this._handles.indexOf(t)>-1&&e.add(t)}),this._disabledHandles=e,this}withPreviewTemplate(t){return this._previewTemplate=t,this}withPlaceholderTemplate(t){return this._placeholderTemplate=t,this}withRootElement(t){const e=(0,r.fI)(t);return e!==this._rootElement&&(this._rootElement&&this._removeRootElementListeners(this._rootElement),this._ngZone.runOutsideAngular(()=>{e.addEventListener("mousedown",this._pointerDown,D),e.addEventListener("touchstart",this._pointerDown,L)}),this._initialTransform=void 0,this._rootElement=e),"undefined"!=typeof SVGElement&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(t){return this._boundaryElement=t?(0,r.fI)(t):null,this._resizeSubscription.unsubscribe(),t&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(t){return this._parentDragRef=t,this}dispose(){this._removeRootElementListeners(this._rootElement),this.isDragging()&&F(this._rootElement),F(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(t){!this._disabledHandles.has(t)&&this._handles.indexOf(t)>-1&&(this._disabledHandles.add(t),k(t,!0))}enableHandle(t){this._disabledHandles.has(t)&&(this._disabledHandles.delete(t),k(t,this.disabled))}withDirection(t){return this._direction=t,this}_withDropContainer(t){this._dropContainer=t}getFreeDragPosition(){const t=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:t.x,y:t.y}}setFreeDragPosition(t){return this._activeTransform={x:0,y:0},this._passiveTransform.x=t.x,this._passiveTransform.y=t.y,this._dropContainer||this._applyRootElementTransform(t.x,t.y),this}_sortFromLastPointerPosition(){const t=this._lastKnownPointerPosition;t&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(t),t)}_removeSubscriptions(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe()}_destroyPreview(){this._preview&&F(this._preview),this._previewRef&&this._previewRef.destroy(),this._preview=this._previewRef=null}_destroyPlaceholder(){this._placeholder&&F(this._placeholder),this._placeholderRef&&this._placeholderRef.destroy(),this._placeholder=this._placeholderRef=null}_endDragSequence(t){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(t),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(t))})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this))))}_startDragSequence(t){Q(t)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();const e=this._dropContainer;if(e){const t=this._rootElement,n=t.parentNode,i=this._preview=this._createPreviewElement(),o=this._placeholder=this._createPlaceholderElement(),s=this._anchor=this._anchor||this._document.createComment(""),a=this._getShadowRoot();n.insertBefore(s,t),A(t,!1),this._document.body.appendChild(n.replaceChild(o,t)),function(t,e){return e||t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement||t.body}(this._document,a).appendChild(i),this.started.next({source:this}),e.start(),this._initialContainer=e,this._initialIndex=e.getItemIndex(this)}else this.started.next({source:this}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(e?e.getScrollableParents():[])}_initializeDragSequence(t,e){this._parentDragRef&&e.stopPropagation();const n=this.isDragging(),i=Q(e),o=!i&&0!==e.button,s=this._rootElement,a=!i&&this._lastTouchEventTime&&this._lastTouchEventTime+800>Date.now();if(e.target&&e.target.draggable&&"mousedown"===e.type&&e.preventDefault(),n||o||a)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(t=>{this._updateOnScroll(t)}),this._boundaryElement&&(this._boundaryRect=q(this._boundaryElement));const r=this._previewTemplate;this._pickupPositionInElement=r&&r.template&&!r.matchSize?{x:0,y:0}:this._getPointerPositionInElement(t,e);const l=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:l.x,y:l.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e)}_cleanupDragArtifacts(t){A(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 e=this._dropContainer,n=e.getItemIndex(this),i=this._getPointerPositionOnPage(t),o=this._getDragDistance(this._getPointerPositionOnPage(t)),s=e._isOverContainer(i.x,i.y);this.ended.next({source:this,distance:o}),this.dropped.next({item:this,currentIndex:n,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:s,distance:o}),e.drop(this,n,this._initialIndex,this._initialContainer,s,o),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:t,y:e},{x:n,y:i}){let o=this._initialContainer._getSiblingContainerFromPosition(this,t,e);!o&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(t,e)&&(o=this._initialContainer),o&&o!==this._dropContainer&&this._ngZone.run(()=>{this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._dropContainer=o,this._dropContainer.enter(this,t,e,o===this._initialContainer&&o.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:o,currentIndex:o.getItemIndex(this)})}),this._dropContainer._startScrollingIfNecessary(n,i),this._dropContainer._sortItem(this,t,e,this._pointerDirectionDelta),this._preview.style.transform=R(t-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y)}_createPreviewElement(){const t=this._previewTemplate,e=this.previewClass,n=t?t.template:null;let i;if(n&&t){const e=t.matchSize?this._rootElement.getBoundingClientRect():null,o=t.viewContainer.createEmbeddedView(n,t.context);o.detectChanges(),i=B(o,this._document),this._previewRef=o,t.matchSize?H(i,e):i.style.transform=R(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else{const t=this._rootElement;i=M(t),H(i,t.getBoundingClientRect())}return w(i.style,{pointerEvents:"none",margin:"0",position:"fixed",top:"0",left:"0",zIndex:`${this._config.zIndex||1e3}`}),k(i,!1),i.classList.add("cdk-drag-preview"),i.setAttribute("dir",this._direction),e&&(Array.isArray(e)?e.forEach(t=>i.classList.add(t)):i.classList.add(e)),i}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();const t=this._placeholder.getBoundingClientRect();this._preview.classList.add("cdk-drag-animating"),this._preview.style.transform=R(t.left,t.top);const e=function(t){const e=getComputedStyle(t),n=T(e,"transition-property"),i=n.find(t=>"transform"===t||"all"===t);if(!i)return 0;const o=n.indexOf(i),s=T(e,"transition-duration"),a=T(e,"transition-delay");return C(s[o])+C(a[o])}(this._preview);return 0===e?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(t=>{const n=e=>{(!e||e.target===this._preview&&"transform"===e.propertyName)&&(this._preview.removeEventListener("transitionend",n),t(),clearTimeout(i))},i=setTimeout(n,1.5*e);this._preview.addEventListener("transitionend",n)}))}_createPlaceholderElement(){const t=this._placeholderTemplate,e=t?t.template:null;let n;return e?(this._placeholderRef=t.viewContainer.createEmbeddedView(e,t.context),this._placeholderRef.detectChanges(),n=B(this._placeholderRef,this._document)):n=M(this._rootElement),n.classList.add("cdk-drag-placeholder"),n}_getPointerPositionInElement(t,e){const n=this._rootElement.getBoundingClientRect(),i=t===this._rootElement?null:t,o=i?i.getBoundingClientRect():n,s=Q(e)?e.targetTouches[0]:e,a=this._getViewportScrollPosition();return{x:o.left-n.left+(s.pageX-o.left-a.left),y:o.top-n.top+(s.pageY-o.top-a.top)}}_getPointerPositionOnPage(t){const e=this._getViewportScrollPosition(),n=Q(t)?t.touches[0]||t.changedTouches[0]||{pageX:0,pageY:0}:t,i=n.pageX-e.left,o=n.pageY-e.top;if(this._ownerSVGElement){const t=this._ownerSVGElement.getScreenCTM();if(t){const e=this._ownerSVGElement.createSVGPoint();return e.x=i,e.y=o,e.matrixTransform(t.inverse())}}return{x:i,y:o}}_getConstrainedPointerPosition(t){const e=this._dropContainer?this._dropContainer.lockAxis:null;let{x:n,y:i}=this.constrainPosition?this.constrainPosition(t,this):t;if("x"===this.lockAxis||"x"===e?i=this._pickupPositionOnPage.y:"y"!==this.lockAxis&&"y"!==e||(n=this._pickupPositionOnPage.x),this._boundaryRect){const{x:t,y:e}=this._pickupPositionInElement,o=this._boundaryRect,s=this._previewRect,a=o.top+e,r=o.bottom-(s.height-e);n=Y(n,o.left+t,o.right-(s.width-t)),i=Y(i,a,r)}return{x:n,y:i}}_updatePointerDirectionDelta(t){const{x:e,y:n}=t,i=this._pointerDirectionDelta,o=this._pointerPositionAtLastDirectionChange,s=Math.abs(e-o.x),a=Math.abs(n-o.y);return s>this._config.pointerDirectionChangeThreshold&&(i.x=e>o.x?1:-1,o.x=e),a>this._config.pointerDirectionChangeThreshold&&(i.y=n>o.y?1:-1,o.y=n),i}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;const t=this._handles.length>0||!this.isDragging();t!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=t,k(this._rootElement,t))}_removeRootElementListeners(t){t.removeEventListener("mousedown",this._pointerDown,D),t.removeEventListener("touchstart",this._pointerDown,L)}_applyRootElementTransform(t,e){const n=R(t,e);null==this._initialTransform&&(this._initialTransform=this._rootElement.style.transform||""),this._rootElement.style.transform=this._initialTransform?n+" "+this._initialTransform:n}_getDragDistance(t){const e=this._pickupPositionOnPage;return e?{x:t.x-e.x,y:t.y-e.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:t,y:e}=this._passiveTransform;if(0===t&&0===e||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 o=n.left-i.left,s=i.right-n.right,a=n.top-i.top,r=i.bottom-n.bottom;n.width>i.width?(o>0&&(t+=o),s>0&&(t-=s)):t=0,n.height>i.height?(a>0&&(e+=a),r>0&&(e-=r)):e=0,t===this._passiveTransform.x&&e===this._passiveTransform.y||this.setFreeDragPosition({y:e,x:t})}_getDragStartDelay(t){const e=this.dragStartDelay;return"number"==typeof e?e:Q(t)?e.touch:e?e.mouse:0}_updateOnScroll(t){const e=this._parentPositions.handleScroll(t);if(e){const n=t.target;this._boundaryRect&&(n===this._document||n!==this._boundaryElement&&n.contains(this._boundaryElement))&&O(this._boundaryRect,e.top,e.left),this._pickupPositionOnPage.x+=e.left,this._pickupPositionOnPage.y+=e.top,this._dropContainer||(this._activeTransform.x-=e.left,this._activeTransform.y-=e.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){const t=this._parentPositions.positions.get(this._document);return t?t.scrollPosition:this._viewportRuler.getViewportScrollPosition()}_getShadowRoot(){return void 0===this._cachedShadowRoot&&(this._cachedShadowRoot=(0,a.kV)(this._rootElement)),this._cachedShadowRoot}}function R(t,e){return`translate3d(${Math.round(t)}px, ${Math.round(e)}px, 0)`}function Y(t,e,n){return Math.max(e,Math.min(n,t))}function F(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Q(t){return"t"===t.type[0]}function B(t,e){const n=t.rootNodes;if(1===n.length&&n[0].nodeType===e.ELEMENT_NODE)return n[0];const i=e.createElement("div");return n.forEach(t=>i.appendChild(t)),i}function H(t,e){t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.transform=R(e.left,e.top)}function V(t,e,n){const i=z(e,t.length-1),o=z(n,t.length-1);if(i===o)return;const s=t[i],a=o<i?-1:1;for(let r=i;r!==o;r+=a)t[r]=t[r+a];t[o]=s}function z(t,e){return Math.max(0,Math.min(e,t))}class G{constructor(t,e,n,i,o){this._dragDropRegistry=e,this._ngZone=i,this._viewportRuler=o,this.disabled=!1,this.sortingDisabled=!1,this.autoScrollDisabled=!1,this.autoScrollStep=2,this.enterPredicate=()=>!0,this.sortPredicate=()=>!0,this.beforeStarted=new p.xQ,this.entered=new p.xQ,this.exited=new p.xQ,this.dropped=new p.xQ,this.sorted=new p.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=h.w.EMPTY,this._verticalScrollDirection=0,this._horizontalScrollDirection=0,this._stopScrollTimers=new p.xQ,this._cachedShadowRoot=null,this._startScrollInterval=()=>{this._stopScrolling(),function(t=0,e=c.P){return(!(0,d.k)(t)||t<0)&&(t=0),e&&"function"==typeof e.schedule||(e=c.P),new l.y(n=>(n.add(e.schedule(u,t,{subscriber:n,counter:0,period:t})),n))}(0,g.Z).pipe((0,f.R)(this._stopScrollTimers)).subscribe(()=>{const t=this._scrollNode,e=this.autoScrollStep;1===this._verticalScrollDirection?X(t,-e):2===this._verticalScrollDirection&&X(t,e),1===this._horizontalScrollDirection?W(t,-e):2===this._horizontalScrollDirection&&W(t,e)})},this.element=(0,r.fI)(t),this._document=n,this.withScrollableParents([this.element]),e.registerDropContainer(this),this._parentPositions=new P(n,o)}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(t,e,n,i){let o;this._draggingStarted(),null==i?(o=this.sortingDisabled?this._draggables.indexOf(t):-1,-1===o&&(o=this._getItemIndexFromPointerPosition(t,e,n))):o=i;const s=this._activeDraggables,a=s.indexOf(t),l=t.getPlaceholderElement();let c=s[o];if(c===t&&(c=s[o+1]),a>-1&&s.splice(a,1),c&&!this._dragDropRegistry.isDragging(c)){const e=c.getRootElement();e.parentElement.insertBefore(l,e),s.splice(o,0,t)}else if(this._shouldEnterAsFirstChild(e,n)){const e=s[0].getRootElement();e.parentNode.insertBefore(l,e),s.unshift(t)}else(0,r.fI)(this.element).appendChild(l),s.push(t);l.style.transform="",this._cacheItemPositions(),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:t,container:this,currentIndex:this.getItemIndex(t)})}exit(t){this._reset(),this.exited.next({item:t,container:this})}drop(t,e,n,i,o,s){this._reset(),this.dropped.next({item:t,currentIndex:e,previousIndex:n,container:this,previousContainer:i,isPointerOverContainer:o,distance:s})}withItems(t){const e=this._draggables;return this._draggables=t,t.forEach(t=>t._withDropContainer(this)),this.isDragging()&&(e.filter(t=>t.isDragging()).every(e=>-1===t.indexOf(e))?this._reset():this._cacheItems()),this}withDirection(t){return this._direction=t,this}connectedTo(t){return this._siblings=t.slice(),this}withOrientation(t){return this._orientation=t,this}withScrollableParents(t){const e=(0,r.fI)(this.element);return this._scrollableElements=-1===t.indexOf(e)?[e,...t]:t.slice(),this}getScrollableParents(){return this._scrollableElements}getItemIndex(t){return this._isDragging?j("horizontal"===this._orientation&&"rtl"===this._direction?this._itemPositions.slice().reverse():this._itemPositions,e=>e.drag===t):this._draggables.indexOf(t)}isReceiving(){return this._activeSiblings.size>0}_sortItem(t,e,n,i){if(this.sortingDisabled||!this._clientRect||!U(this._clientRect,.05,e,n))return;const o=this._itemPositions,s=this._getItemIndexFromPointerPosition(t,e,n,i);if(-1===s&&o.length>0)return;const a="horizontal"===this._orientation,r=j(o,e=>e.drag===t),l=o[s],c=l.clientRect,d=r>s?1:-1,u=this._getItemOffsetPx(o[r].clientRect,c,d),p=this._getSiblingOffsetPx(r,o,d),h=o.slice();V(o,r,s),this.sorted.next({previousIndex:r,currentIndex:s,container:this,item:t}),o.forEach((e,n)=>{if(h[n]===e)return;const i=e.drag===t,o=i?u:p,s=i?t.getPlaceholderElement():e.drag.getRootElement();e.offset+=o,a?(s.style.transform=`translate3d(${Math.round(e.offset)}px, 0, 0)`,O(e.clientRect,0,o)):(s.style.transform=`translate3d(0, ${Math.round(e.offset)}px, 0)`,O(e.clientRect,o,0))}),this._previousSwap.overlaps=I(c,e,n),this._previousSwap.drag=l.drag,this._previousSwap.delta=a?i.x:i.y}_startScrollingIfNecessary(t,e){if(this.autoScrollDisabled)return;let n,i=0,o=0;if(this._parentPositions.positions.forEach((s,a)=>{a!==this._document&&s.clientRect&&!n&&U(s.clientRect,.05,t,e)&&([i,o]=function(t,e,n,i){const o=K(e,i),s=tt(e,n);let a=0,r=0;if(o){const e=t.scrollTop;1===o?e>0&&(a=1):t.scrollHeight-e>t.clientHeight&&(a=2)}if(s){const e=t.scrollLeft;1===s?e>0&&(r=1):t.scrollWidth-e>t.clientWidth&&(r=2)}return[a,r]}(a,s.clientRect,t,e),(i||o)&&(n=a))}),!i&&!o){const{width:s,height:a}=this._viewportRuler.getViewportSize(),r={width:s,height:a,top:0,right:s,bottom:a,left:0};i=K(r,e),o=tt(r,t),n=window}!n||i===this._verticalScrollDirection&&o===this._horizontalScrollDirection&&n===this._scrollNode||(this._verticalScrollDirection=i,this._horizontalScrollDirection=o,this._scrollNode=n,(i||o)&&n?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){const t=(0,r.fI)(this.element).style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=t.msScrollSnapType||t.scrollSnapType||"",t.scrollSnapType=t.msScrollSnapType="none",this._cacheItems(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){const t=(0,r.fI)(this.element);this._parentPositions.cache(this._scrollableElements),this._clientRect=this._parentPositions.positions.get(t).clientRect}_cacheItemPositions(){const t="horizontal"===this._orientation;this._itemPositions=this._activeDraggables.map(t=>{const e=t.getVisibleElement();return{drag:t,offset:0,clientRect:q(e)}}).sort((e,n)=>t?e.clientRect.left-n.clientRect.left:e.clientRect.top-n.clientRect.top)}_reset(){this._isDragging=!1;const t=(0,r.fI)(this.element).style;t.scrollSnapType=t.msScrollSnapType=this._initialScrollSnap,this._activeDraggables.forEach(t=>{const e=t.getRootElement();e&&(e.style.transform="")}),this._siblings.forEach(t=>t._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(t,e,n){const i="horizontal"===this._orientation,o=e[t].clientRect,s=e[t+-1*n];let a=o[i?"width":"height"]*n;if(s){const t=i?"left":"top",e=i?"right":"bottom";-1===n?a-=s.clientRect[t]-o[e]:a+=o[t]-s.clientRect[e]}return a}_getItemOffsetPx(t,e,n){const i="horizontal"===this._orientation;let o=i?e.left-t.left:e.top-t.top;return-1===n&&(o+=i?e.width-t.width:e.height-t.height),o}_shouldEnterAsFirstChild(t,e){if(!this._activeDraggables.length)return!1;const n=this._itemPositions,i="horizontal"===this._orientation;if(n[0].drag!==this._activeDraggables[0]){const o=n[n.length-1].clientRect;return i?t>=o.right:e>=o.bottom}{const o=n[0].clientRect;return i?t<=o.left:e<=o.top}}_getItemIndexFromPointerPosition(t,e,n,i){const o="horizontal"===this._orientation,s=j(this._itemPositions,({drag:s,clientRect:a},r,l)=>{if(s===t)return l.length<2;if(i){const t=o?i.x:i.y;if(s===this._previousSwap.drag&&this._previousSwap.overlaps&&t===this._previousSwap.delta)return!1}return o?e>=Math.floor(a.left)&&e<Math.floor(a.right):n>=Math.floor(a.top)&&n<Math.floor(a.bottom)});return-1!==s&&this.sortPredicate(s,t,this)?s:-1}_cacheItems(){this._activeDraggables=this._draggables.slice(),this._cacheItemPositions(),this._cacheParentPositions()}_isOverContainer(t,e){return null!=this._clientRect&&I(this._clientRect,t,e)}_getSiblingContainerFromPosition(t,e,n){return this._siblings.find(i=>i._canReceive(t,e,n))}_canReceive(t,e,n){if(!this._clientRect||!I(this._clientRect,e,n)||!this.enterPredicate(t,this))return!1;const i=this._getShadowRoot().elementFromPoint(e,n);if(!i)return!1;const o=(0,r.fI)(this.element);return i===o||o.contains(i)}_startReceiving(t,e){const n=this._activeSiblings;!n.has(t)&&e.every(t=>this.enterPredicate(t,this)||this._draggables.indexOf(t)>-1)&&(n.add(t),this._cacheParentPositions(),this._listenToScrollEvents())}_stopReceiving(t){this._activeSiblings.delete(t),this._viewportScrollSubscription.unsubscribe()}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scroll.subscribe(t=>{if(this.isDragging()){const e=this._parentPositions.handleScroll(t);e&&(this._itemPositions.forEach(({clientRect:t})=>{O(t,e.top,e.left)}),this._itemPositions.forEach(({drag:t})=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition()}))}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){const t=(0,a.kV)((0,r.fI)(this.element));this._cachedShadowRoot=t||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){const t=this._activeDraggables.filter(t=>t.isDragging());this._siblings.forEach(e=>e._startReceiving(this,t))}}function j(t,e){for(let n=0;n<t.length;n++)if(e(t[n],n,t))return n;return-1}function X(t,e){t===window?t.scrollBy(0,e):t.scrollTop+=e}function W(t,e){t===window?t.scrollBy(e,0):t.scrollLeft+=e}function K(t,e){const{top:n,bottom:i,height:o}=t,s=.05*o;return e>=n-s&&e<=n+s?1:e>=i-s&&e<=i+s?2:0}function tt(t,e){const{left:n,right:i,width:o}=t,s=.05*o;return e>=n-s&&e<=n+s?1:e>=i-s&&e<=i+s?2:0}const et=(0,a.i$)({passive:!1,capture:!0});let nt=(()=>{class t{constructor(t,e){this._ngZone=t,this._dropInstances=new Set,this._dragInstances=new Set,this._activeDragInstances=[],this._globalListeners=new Map,this._draggingPredicate=t=>t.isDragging(),this.pointerMove=new p.xQ,this.pointerUp=new p.xQ,this.scroll=new p.xQ,this._preventDefaultWhileDragging=t=>{this._activeDragInstances.length>0&&t.preventDefault()},this._persistentTouchmoveListener=t=>{this._activeDragInstances.length>0&&(this._activeDragInstances.some(this._draggingPredicate)&&t.preventDefault(),this.pointerMove.next(t))},this._document=e}registerDropContainer(t){this._dropInstances.has(t)||this._dropInstances.add(t)}registerDragItem(t){this._dragInstances.add(t),1===this._dragInstances.size&&this._ngZone.runOutsideAngular(()=>{this._document.addEventListener("touchmove",this._persistentTouchmoveListener,et)})}removeDropContainer(t){this._dropInstances.delete(t)}removeDragItem(t){this._dragInstances.delete(t),this.stopDragging(t),0===this._dragInstances.size&&this._document.removeEventListener("touchmove",this._persistentTouchmoveListener,et)}startDragging(t,e){if(!(this._activeDragInstances.indexOf(t)>-1)&&(this._activeDragInstances.push(t),1===this._activeDragInstances.length)){const t=e.type.startsWith("touch");this._globalListeners.set(t?"touchend":"mouseup",{handler:t=>this.pointerUp.next(t),options:!0}).set("scroll",{handler:t=>this.scroll.next(t),options:!0}).set("selectstart",{handler:this._preventDefaultWhileDragging,options:et}),t||this._globalListeners.set("mousemove",{handler:t=>this.pointerMove.next(t),options:et}),this._ngZone.runOutsideAngular(()=>{this._globalListeners.forEach((t,e)=>{this._document.addEventListener(e,t.handler,t.options)})})}}stopDragging(t){const e=this._activeDragInstances.indexOf(t);e>-1&&(this._activeDragInstances.splice(e,1),0===this._activeDragInstances.length&&this._clearGlobalListeners())}isDragging(t){return this._activeDragInstances.indexOf(t)>-1}ngOnDestroy(){this._dragInstances.forEach(t=>this.removeDragItem(t)),this._dropInstances.forEach(t=>this.removeDropContainer(t)),this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_clearGlobalListeners(){this._globalListeners.forEach((t,e)=>{this._document.removeEventListener(e,t.handler,t.options)}),this._globalListeners.clear()}}return t.\u0275fac=function(e){return new(e||t)(i.LFG(i.R0b),i.LFG(o.K0))},t.\u0275prov=(0,i.Yz7)({factory:function(){return new t((0,i.LFG)(i.R0b),(0,i.LFG)(o.K0))},token:t,providedIn:"root"}),t})();const it={dragStartThreshold:5,pointerDirectionChangeThreshold:5};let ot=(()=>{class t{constructor(t,e,n,i){this._document=t,this._ngZone=e,this._viewportRuler=n,this._dragDropRegistry=i}createDrag(t,e=it){return new $(t,e,this._document,this._ngZone,this._viewportRuler,this._dragDropRegistry)}createDropList(t){return new G(t,this._dragDropRegistry,this._document,this._ngZone,this._viewportRuler)}}return t.\u0275fac=function(e){return new(e||t)(i.LFG(o.K0),i.LFG(i.R0b),i.LFG(s.rL),i.LFG(nt))},t.\u0275prov=(0,i.Yz7)({factory:function(){return new t((0,i.LFG)(o.K0),(0,i.LFG)(i.R0b),(0,i.LFG)(s.rL),(0,i.LFG)(nt))},token:t,providedIn:"root"}),t})();const st=new i.OlP("CDK_DRAG_PARENT"),at=new i.OlP("CdkDropListGroup"),rt=new i.OlP("CDK_DRAG_CONFIG");let lt=0;const ct=new i.OlP("CdkDropList");let dt=(()=>{class t{constructor(e,n,o,s,a,r,l){this.element=e,this._changeDetectorRef=o,this._scrollDispatcher=s,this._dir=a,this._group=r,this._destroyed=new p.xQ,this.connectedTo=[],this.id="cdk-drop-list-"+lt++,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(e),this._dropListRef.data=this,l&&this._assignDefaults(l),this._dropListRef.enterPredicate=(t,e)=>this.enterPredicate(t.data,e.data),this._dropListRef.sortPredicate=(t,e,n)=>this.sortPredicate(t,e.data,n.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),t._dropLists.push(this),r&&r._items.add(this)}get disabled(){return this._disabled||!!this._group&&this._group.disabled}set disabled(t){this._dropListRef.disabled=this._disabled=(0,r.Ig)(t)}addItem(t){this._unsortedItems.add(t),this._dropListRef.isDragging()&&this._syncItemsWithRef()}removeItem(t){this._unsortedItems.delete(t),this._dropListRef.isDragging()&&this._syncItemsWithRef()}getSortedItems(){return Array.from(this._unsortedItems).sort((t,e)=>t._dragRef.getVisibleElement().compareDocumentPosition(e._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}ngOnDestroy(){const e=t._dropLists.indexOf(this);e>-1&&t._dropLists.splice(e,1),this._group&&this._group._items.delete(this),this._unsortedItems.clear(),this._dropListRef.dispose(),this._destroyed.next(),this._destroyed.complete()}_setupInputSyncSubscription(e){this._dir&&this._dir.change.pipe((0,b.O)(this._dir.value),(0,f.R)(this._destroyed)).subscribe(t=>e.withDirection(t)),e.beforeStarted.subscribe(()=>{const n=(0,r.Eq)(this.connectedTo).map(e=>"string"==typeof e?t._dropLists.find(t=>t.id===e):e);if(this._group&&this._group._items.forEach(t=>{-1===n.indexOf(t)&&n.push(t)}),!this._scrollableParentsResolved){const t=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(t=>t.getElementRef().nativeElement);this._dropListRef.withScrollableParents(t),this._scrollableParentsResolved=!0}e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.sortingDisabled=(0,r.Ig)(this.sortingDisabled),e.autoScrollDisabled=(0,r.Ig)(this.autoScrollDisabled),e.autoScrollStep=(0,r.su)(this.autoScrollStep,2),e.connectedTo(n.filter(t=>t&&t!==this).map(t=>t._dropListRef)).withOrientation(this.orientation)})}_handleEvents(t){t.beforeStarted.subscribe(()=>{this._syncItemsWithRef(),this._changeDetectorRef.markForCheck()}),t.entered.subscribe(t=>{this.entered.emit({container:this,item:t.item.data,currentIndex:t.currentIndex})}),t.exited.subscribe(t=>{this.exited.emit({container:this,item:t.item.data}),this._changeDetectorRef.markForCheck()}),t.sorted.subscribe(t=>{this.sorted.emit({previousIndex:t.previousIndex,currentIndex:t.currentIndex,container:this,item:t.item.data})}),t.dropped.subscribe(t=>{this.dropped.emit({previousIndex:t.previousIndex,currentIndex:t.currentIndex,previousContainer:t.previousContainer.data,container:t.container.data,item:t.item.data,isPointerOverContainer:t.isPointerOverContainer,distance:t.distance}),this._changeDetectorRef.markForCheck()})}_assignDefaults(t){const{lockAxis:e,draggingDisabled:n,sortingDisabled:i,listAutoScrollDisabled:o,listOrientation:s}=t;this.disabled=null!=n&&n,this.sortingDisabled=null!=i&&i,this.autoScrollDisabled=null!=o&&o,this.orientation=s||"vertical",e&&(this.lockAxis=e)}_syncItemsWithRef(){this._dropListRef.withItems(this.getSortedItems().map(t=>t._dragRef))}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(i.SBq),i.Y36(ot),i.Y36(i.sBO),i.Y36(s.mF),i.Y36(y.Is,8),i.Y36(at,12),i.Y36(rt,8))},t.\u0275dir=i.lG2({type:t,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(t,e){2&t&&(i.uIk("id",e.id),i.ekj("cdk-drop-list-disabled",e.disabled)("cdk-drop-list-dragging",e._dropListRef.isDragging())("cdk-drop-list-receiving",e._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:at,useValue:void 0},{provide:ct,useExisting:t}])]}),t._dropLists=[],t})();const ut=new i.OlP("CdkDragHandle");let pt=(()=>{class t{constructor(t,e){this.element=t,this._stateChanges=new p.xQ,this._disabled=!1,this._parentDrag=e}get disabled(){return this._disabled}set disabled(t){this._disabled=(0,r.Ig)(t),this._stateChanges.next(this)}ngOnDestroy(){this._stateChanges.complete()}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(i.SBq),i.Y36(st,12))},t.\u0275dir=i.lG2({type:t,selectors:[["","cdkDragHandle",""]],hostAttrs:[1,"cdk-drag-handle"],inputs:{disabled:["cdkDragHandleDisabled","disabled"]},features:[i._Bn([{provide:ut,useExisting:t}])]}),t})();const ht=new i.OlP("CdkDragPlaceholder"),gt=new i.OlP("CdkDragPreview");let mt=(()=>{class t{constructor(e,n,o,s,a,r,c,d,u,h,g){this.element=e,this.dropContainer=n,this._ngZone=s,this._viewContainerRef=a,this._dir=c,this._changeDetectorRef=u,this._selfHandle=h,this._parentDrag=g,this._destroyed=new p.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(t=>{const e=this._dragRef.moved.pipe((0,v.U)(t=>({source:this,pointerPosition:t.pointerPosition,event:t.event,delta:t.delta,distance:t.distance}))).subscribe(t);return()=>{e.unsubscribe()}}),this._dragRef=d.createDrag(e,{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,t._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(t){this._disabled=(0,r.Ig)(t),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,_.q)(1),(0,f.R)(this._destroyed)).subscribe(()=>{this._updateRootElement(),this._handles.changes.pipe((0,b.O)(this._handles),(0,x.b)(t=>{const e=t.filter(t=>t._parentDrag===this).map(t=>t.element);this._selfHandle&&this.rootElementSelector&&e.push(this.element),this._dragRef.withHandles(e)}),(0,Z.w)(t=>(0,m.T)(...t.map(t=>t._stateChanges.pipe((0,b.O)(t))))),(0,f.R)(this._destroyed)).subscribe(t=>{const e=this._dragRef,n=t.element.nativeElement;t.disabled?e.disableHandle(n):e.enableHandle(n)}),this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)})}ngOnChanges(t){const e=t.rootElementSelector,n=t.freeDragPosition;e&&!e.firstChange&&this._updateRootElement(),n&&!n.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this);const e=t._dragInstances.indexOf(this);e>-1&&t._dragInstances.splice(e,1),this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose()}_updateRootElement(){const t=this.element.nativeElement,e=this.rootElementSelector?ft(t,this.rootElementSelector):t;this._dragRef.withRootElement(e||t)}_getBoundaryElement(){const t=this.boundaryElement;return t?"string"==typeof t?ft(this.element.nativeElement,t):(0,r.fI)(t):null}_syncInputs(e){e.beforeStarted.subscribe(()=>{if(!e.isDragging()){const t=this._dir,n=this.dragStartDelay,i=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,o=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.dragStartDelay="object"==typeof n&&n?n:(0,r.su)(n),e.constrainPosition=this.constrainPosition,e.previewClass=this.previewClass,e.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(i).withPreviewTemplate(o),t&&e.withDirection(t.value)}}),e.beforeStarted.pipe((0,_.q)(1)).subscribe(()=>{var n,i;if(this._parentDrag)return void e.withParent(this._parentDrag._dragRef);let o=this.element.nativeElement.parentElement;for(;o;){if(null===(n=o.classList)||void 0===n?void 0:n.contains("cdk-drag")){e.withParent((null===(i=t._dragInstances.find(t=>t.element.nativeElement===o))||void 0===i?void 0:i._dragRef)||null);break}o=o.parentElement}})}_handleEvents(t){t.started.subscribe(()=>{this.started.emit({source:this}),this._changeDetectorRef.markForCheck()}),t.released.subscribe(()=>{this.released.emit({source:this})}),t.ended.subscribe(t=>{this.ended.emit({source:this,distance:t.distance}),this._changeDetectorRef.markForCheck()}),t.entered.subscribe(t=>{this.entered.emit({container:t.container.data,item:this,currentIndex:t.currentIndex})}),t.exited.subscribe(t=>{this.exited.emit({container:t.container.data,item:this})}),t.dropped.subscribe(t=>{this.dropped.emit({previousIndex:t.previousIndex,currentIndex:t.currentIndex,previousContainer:t.previousContainer.data,container:t.container.data,isPointerOverContainer:t.isPointerOverContainer,item:this,distance:t.distance})})}_assignDefaults(t){const{lockAxis:e,dragStartDelay:n,constrainPosition:i,previewClass:o,boundaryElement:s,draggingDisabled:a,rootElementSelector:r}=t;this.disabled=null!=a&&a,this.dragStartDelay=n||0,e&&(this.lockAxis=e),i&&(this.constrainPosition=i),o&&(this.previewClass=o),s&&(this.boundaryElement=s),r&&(this.rootElementSelector=r)}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(i.SBq),i.Y36(ct,12),i.Y36(o.K0),i.Y36(i.R0b),i.Y36(i.s_b),i.Y36(rt,8),i.Y36(y.Is,8),i.Y36(ot),i.Y36(i.sBO),i.Y36(ut,10),i.Y36(st,12))},t.\u0275dir=i.lG2({type:t,selectors:[["","cdkDrag",""]],contentQueries:function(t,e,n){if(1&t&&(i.Suo(n,gt,5),i.Suo(n,ht,5),i.Suo(n,ut,5)),2&t){let t;i.iGM(t=i.CRH())&&(e._previewTemplate=t.first),i.iGM(t=i.CRH())&&(e._placeholderTemplate=t.first),i.iGM(t=i.CRH())&&(e._handles=t)}},hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(t,e){2&t&&i.ekj("cdk-drag-disabled",e.disabled)("cdk-drag-dragging",e._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:st,useExisting:t}]),i.TTD]}),t._dragInstances=[],t})();function ft(t,e){let n=t.parentElement;for(;n;){if(n.matches?n.matches(e):n.msMatchesSelector(e))return n;n=n.parentElement}return null}let bt=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=i.oAB({type:t}),t.\u0275inj=i.cJS({providers:[ot],imports:[s.ZD]}),t})()},79961:function(t,e,n){"use strict";n.d(e,{XC:function(){return E},Bb:function(){return F},ZL:function(){return Y}});var i=n(97388),o=n(19861),s=n(93169),a=n(35366),r=n(87064),l=n(87570),c=n(55959),d=n(31450),u=n(31906),p=n(40878),h=n(87254),g=n(61116),m=n(77923),f=n(43725),b=n(99235),v=n(82151),_=n(31041),x=n(13070),Z=n(90611),y=n(44689),w=n(43835),k=n(79996),A=n(66599),C=n(82628),T=n(94720);const q=["panel"];function I(t,e){if(1&t&&(a.TgZ(0,"div",0,1),a.Hsn(2),a.qZA()),2&t){const t=e.id,n=a.oxw();a.Q6J("id",n.id)("ngClass",n._classList),a.uIk("aria-label",n.ariaLabel||null)("aria-labelledby",n._getPanelAriaLabelledby(t))}}const O=["*"];let U=0;class P{constructor(t,e){this.source=t,this.option=e}}class M{}const S=(0,r.Kr)(M),N=new a.OlP("mat-autocomplete-default-options",{providedIn:"root",factory:function(){return{autoActiveFirstOption:!1}}});let J=(()=>{class t extends S{constructor(t,e,n,i){super(),this._changeDetectorRef=t,this._elementRef=e,this._activeOptionChanges=l.w.EMPTY,this.showPanel=!1,this._isOpen=!1,this.displayWith=null,this.optionSelected=new a.vpe,this.opened=new a.vpe,this.closed=new a.vpe,this.optionActivated=new a.vpe,this._classList={},this.id="mat-autocomplete-"+U++,this.inertGroups=(null==i?void 0:i.SAFARI)||!1,this._autoActiveFirstOption=!!n.autoActiveFirstOption}get isOpen(){return this._isOpen&&this.showPanel}get autoActiveFirstOption(){return this._autoActiveFirstOption}set autoActiveFirstOption(t){this._autoActiveFirstOption=(0,o.Ig)(t)}set classList(t){this._classList=t&&t.length?(0,o.du)(t).reduce((t,e)=>(t[e]=!0,t),{}):{},this._setVisibilityClasses(this._classList),this._elementRef.nativeElement.className=""}ngAfterContentInit(){this._keyManager=new i.s1(this.options).withWrap(),this._activeOptionChanges=this._keyManager.change.subscribe(t=>{this.optionActivated.emit({source:this,option:this.options.toArray()[t]||null})}),this._setVisibility()}ngOnDestroy(){this._activeOptionChanges.unsubscribe()}_setScrollTop(t){this.panel&&(this.panel.nativeElement.scrollTop=t)}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options.length,this._setVisibilityClasses(this._classList),this._changeDetectorRef.markForCheck()}_emitSelectEvent(t){const e=new P(this,t);this.optionSelected.emit(e)}_getPanelAriaLabelledby(t){return this.ariaLabel?null:this.ariaLabelledby?(t?t+" ":"")+this.ariaLabelledby:t}_setVisibilityClasses(t){t[this._visibleClass]=this.showPanel,t[this._hiddenClass]=!this.showPanel}}return t.\u0275fac=function(e){return new(e||t)(a.Y36(a.sBO),a.Y36(a.SBq),a.Y36(N),a.Y36(s.t4))},t.\u0275dir=a.lG2({type:t,viewQuery:function(t,e){if(1&t&&(a.Gf(a.Rgc,7),a.Gf(q,5)),2&t){let t;a.iGM(t=a.CRH())&&(e.template=t.first),a.iGM(t=a.CRH())&&(e.panel=t.first)}},inputs:{displayWith:"displayWith",autoActiveFirstOption:"autoActiveFirstOption",classList:["class","classList"],ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],panelWidth:"panelWidth"},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},features:[a.qOj]}),t})(),E=(()=>{class t extends J{constructor(){super(...arguments),this._visibleClass="mat-autocomplete-visible",this._hiddenClass="mat-autocomplete-hidden"}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=a.n5z(t)))(n||t)}}(),t.\u0275cmp=a.Xpm({type:t,selectors:[["mat-autocomplete"]],contentQueries:function(t,e,n){if(1&t&&(a.Suo(n,r.K7,5),a.Suo(n,r.ey,5)),2&t){let t;a.iGM(t=a.CRH())&&(e.optionGroups=t),a.iGM(t=a.CRH())&&(e.options=t)}},hostAttrs:[1,"mat-autocomplete"],inputs:{disableRipple:"disableRipple"},exportAs:["matAutocomplete"],features:[a._Bn([{provide:r.HF,useExisting:t}]),a.qOj],ngContentSelectors:O,decls:1,vars:0,consts:[["role","listbox",1,"mat-autocomplete-panel",3,"id","ngClass"],["panel",""]],template:function(t,e){1&t&&(a.F$t(),a.YNc(0,I,3,4,"ng-template"))},directives:[g.mk],styles:[".mat-autocomplete-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;visibility:hidden;max-width:none;max-height:256px;position:relative;width:100%;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.mat-autocomplete-panel.mat-autocomplete-visible{visibility:visible}.mat-autocomplete-panel.mat-autocomplete-hidden{visibility:hidden}.mat-autocomplete-panel-above .mat-autocomplete-panel{border-radius:0;border-top-left-radius:4px;border-top-right-radius:4px}.mat-autocomplete-panel .mat-divider-horizontal{margin-top:-1px}.cdk-high-contrast-active .mat-autocomplete-panel{outline:solid 1px}mat-autocomplete{display:none}\n"],encapsulation:2,changeDetection:0}),t})();const L=new a.OlP("mat-autocomplete-scroll-strategy"),D={provide:L,deps:[m.aV],useFactory:function(t){return()=>t.scrollStrategies.reposition()}},$={provide:_.JU,useExisting:(0,a.Gpc)(()=>Y),multi:!0};let R=(()=>{class t{constructor(t,e,n,i,o,s,a,r,p,h,g){this._element=t,this._overlay=e,this._viewContainerRef=n,this._zone=i,this._changeDetectorRef=o,this._dir=a,this._formField=r,this._document=p,this._viewportRuler=h,this._defaults=g,this._componentDestroyed=!1,this._autocompleteDisabled=!1,this._manuallyFloatingLabel=!1,this._viewportSubscription=l.w.EMPTY,this._canOpenOnNextFocus=!0,this._closeKeyEventStream=new c.xQ,this._windowBlurHandler=()=>{this._canOpenOnNextFocus=this._document.activeElement!==this._element.nativeElement||this.panelOpen},this._onChange=()=>{},this._onTouched=()=>{},this.position="auto",this.autocompleteAttribute="off",this._overlayAttached=!1,this.optionSelections=(0,d.P)(()=>this.autocomplete&&this.autocomplete.options?(0,u.T)(...this.autocomplete.options.map(t=>t.onSelectionChange)):this._zone.onStable.pipe((0,Z.q)(1),(0,y.w)(()=>this.optionSelections))),this._scrollStrategy=s}get autocompleteDisabled(){return this._autocompleteDisabled}set autocompleteDisabled(t){this._autocompleteDisabled=(0,o.Ig)(t)}ngAfterViewInit(){const t=this._getWindow();void 0!==t&&this._zone.runOutsideAngular(()=>t.addEventListener("blur",this._windowBlurHandler))}ngOnChanges(t){t.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){const t=this._getWindow();void 0!==t&&t.removeEventListener("blur",this._windowBlurHandler),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete()}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}openPanel(){this._attachOverlay(),this._floatLabel()}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this.autocomplete.closed.emit(),this.autocomplete._isOpen=this._overlayAttached=!1,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._componentDestroyed||this._changeDetectorRef.detectChanges())}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return(0,u.T)(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe((0,w.h)(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe((0,w.h)(()=>this._overlayAttached)):(0,p.of)()).pipe((0,k.U)(t=>t instanceof r.rN?t:null))}get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return(0,u.T)((0,h.R)(this._document,"click"),(0,h.R)(this._document,"auxclick"),(0,h.R)(this._document,"touchend")).pipe((0,w.h)(t=>{const e=this._isInsideShadowRoot&&t.composedPath?t.composedPath()[0]:t.target,n=this._formField?this._formField._elementRef.nativeElement:null,i=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;return this._overlayAttached&&e!==this._element.nativeElement&&(!n||!n.contains(e))&&(!i||!i.contains(e))&&!!this._overlayRef&&!this._overlayRef.overlayElement.contains(e)}))}writeValue(t){Promise.resolve(null).then(()=>this._setTriggerValue(t))}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this._element.nativeElement.disabled=t}_handleKeydown(t){const e=t.keyCode;if(e!==b.hY||(0,b.Vb)(t)||t.preventDefault(),this.activeOption&&e===b.K5&&this.panelOpen)this.activeOption._selectViaInteraction(),this._resetActiveItem(),t.preventDefault();else if(this.autocomplete){const n=this.autocomplete._keyManager.activeItem,i=e===b.LH||e===b.JH;this.panelOpen||e===b.Mf?this.autocomplete._keyManager.onKeydown(t):i&&this._canOpen()&&this.openPanel(),(i||this.autocomplete._keyManager.activeItem!==n)&&this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0)}}_handleInput(t){let e=t.target,n=e.value;"number"===e.type&&(n=""==n?null:parseFloat(n)),this._previousValue!==n&&(this._previousValue=n,this._onChange(n),this._canOpen()&&this._document.activeElement===t.target&&this.openPanel())}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}_floatLabel(t=!1){this._formField&&"auto"===this._formField.floatLabel&&(t?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField.floatLabel="auto",this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){const t=this._zone.onStable.pipe((0,Z.q)(1)),e=this.autocomplete.options.changes.pipe((0,A.b)(()=>this._positionStrategy.reapplyLastPosition()),(0,C.g)(0));return(0,u.T)(t,e).pipe((0,y.w)(()=>{const t=this.panelOpen;return this._resetActiveItem(),this.autocomplete._setVisibility(),this.panelOpen&&(this._overlayRef.updatePosition(),t!==this.panelOpen&&this.autocomplete.opened.emit()),this.panelClosingActions}),(0,Z.q)(1)).subscribe(t=>this._setValueAndClose(t))}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_setTriggerValue(t){const e=this.autocomplete&&this.autocomplete.displayWith?this.autocomplete.displayWith(t):t,n=null!=e?e:"";this._formField?this._formField._control.value=n:this._element.nativeElement.value=n,this._previousValue=n}_setValueAndClose(t){t&&t.source&&(this._clearPreviousSelectedOption(t.source),this._setTriggerValue(t.source.value),this._onChange(t.source.value),this._element.nativeElement.focus(),this.autocomplete._emitSelectEvent(t.source)),this.closePanel()}_clearPreviousSelectedOption(t){this.autocomplete.options.forEach(e=>{e!==t&&e.selected&&e.deselect()})}_attachOverlay(){var t;null==this._isInsideShadowRoot&&(this._isInsideShadowRoot=!!(0,s.kV)(this._element.nativeElement));let e=this._overlayRef;e?(this._positionStrategy.setOrigin(this._getConnectedElement()),e.updateSize({width:this._getPanelWidth()})):(this._portal=new v.UE(this.autocomplete.template,this._viewContainerRef,{id:null===(t=this._formField)||void 0===t?void 0:t.getLabelId()}),e=this._overlay.create(this._getOverlayConfig()),this._overlayRef=e,e.keydownEvents().subscribe(t=>{(t.keyCode===b.hY&&!(0,b.Vb)(t)||t.keyCode===b.LH&&(0,b.Vb)(t,"altKey"))&&(this._resetActiveItem(),this._closeKeyEventStream.next(),t.stopPropagation(),t.preventDefault())}),this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&e&&e.updateSize({width:this._getPanelWidth()})})),e&&!e.hasAttached()&&(e.attach(this._portal),this._closingActionsSubscription=this._subscribeToClosingActions());const n=this.panelOpen;this.autocomplete._setVisibility(),this.autocomplete._isOpen=this._overlayAttached=!0,this.panelOpen&&n!==this.panelOpen&&this.autocomplete.opened.emit()}_getOverlayConfig(){var t;return new m.X_({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir,panelClass:null===(t=this._defaults)||void 0===t?void 0:t.overlayPanelClass})}_getOverlayPosition(){const t=this._overlay.position().flexibleConnectedTo(this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1);return this._setStrategyPositions(t),this._positionStrategy=t,t}_setStrategyPositions(t){const e=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],n=this._aboveClass,i=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:n},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:n}];let o;o="above"===this.position?i:"below"===this.position?e:[...e,...i],t.withPositions(o)}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){const t=this.autocomplete;t.autoActiveFirstOption?t._keyManager.setFirstItemActive():t._keyManager.setActiveItem(-1)}_canOpen(){const t=this._element.nativeElement;return!t.readOnly&&!t.disabled&&!this._autocompleteDisabled}_getWindow(){var t;return(null===(t=this._document)||void 0===t?void 0:t.defaultView)||window}_scrollToOption(t){const e=this.autocomplete,n=(0,r.CB)(t,e.options,e.optionGroups);if(0===t&&1===n)e._setScrollTop(0);else if(e.panel){const n=e.options.toArray()[t];if(n){const t=n._getHostElement(),i=(0,r.jH)(t.offsetTop,t.offsetHeight,e._getScrollTop(),e.panel.nativeElement.offsetHeight);e._setScrollTop(i)}}}}return t.\u0275fac=function(e){return new(e||t)(a.Y36(a.SBq),a.Y36(m.aV),a.Y36(a.s_b),a.Y36(a.R0b),a.Y36(a.sBO),a.Y36(L),a.Y36(T.Is,8),a.Y36(x.G_,9),a.Y36(g.K0,8),a.Y36(f.rL),a.Y36(N,8))},t.\u0275dir=a.lG2({type:t,inputs:{position:["matAutocompletePosition","position"],autocompleteAttribute:["autocomplete","autocompleteAttribute"],autocompleteDisabled:["matAutocompleteDisabled","autocompleteDisabled"],autocomplete:["matAutocomplete","autocomplete"],connectedTo:["matAutocompleteConnectedTo","connectedTo"]},features:[a.TTD]}),t})(),Y=(()=>{class t extends R{constructor(){super(...arguments),this._aboveClass="mat-autocomplete-panel-above"}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=a.n5z(t)))(n||t)}}(),t.\u0275dir=a.lG2({type:t,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-autocomplete-trigger"],hostVars:7,hostBindings:function(t,e){1&t&&a.NdJ("focusin",function(){return e._handleFocus()})("blur",function(){return e._onTouched()})("input",function(t){return e._handleInput(t)})("keydown",function(t){return e._handleKeydown(t)}),2&t&&a.uIk("autocomplete",e.autocompleteAttribute)("role",e.autocompleteDisabled?null:"combobox")("aria-autocomplete",e.autocompleteDisabled?null:"list")("aria-activedescendant",e.panelOpen&&e.activeOption?e.activeOption.id:null)("aria-expanded",e.autocompleteDisabled?null:e.panelOpen.toString())("aria-owns",e.autocompleteDisabled||!e.panelOpen||null==e.autocomplete?null:e.autocomplete.id)("aria-haspopup",!e.autocompleteDisabled)},exportAs:["matAutocompleteTrigger"],features:[a._Bn([$]),a.qOj]}),t})(),F=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=a.oAB({type:t}),t.\u0275inj=a.cJS({providers:[D],imports:[[m.U8,r.Ng,r.BQ,g.ez],f.ZD,r.Ng,r.BQ]}),t})()},92762:function(t,e,n){"use strict";n.d(e,{Yi:function(){return _},A9:function(){return f},vV:function(){return x}});var i=n(19861),o=n(58378),s=n(35366),a=n(31041),r=n(87064),l=n(97388);const c=["button"],d=["*"],u=new s.OlP("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS"),p=new s.OlP("MatButtonToggleGroup"),h={provide:a.JU,useExisting:(0,s.Gpc)(()=>f),multi:!0};let g=0;class m{constructor(t,e){this.source=t,this.value=e}}let f=(()=>{class t{constructor(t,e){this._changeDetector=t,this._vertical=!1,this._multiple=!1,this._disabled=!1,this._controlValueAccessorChangeFn=()=>{},this._onTouched=()=>{},this._name="mat-button-toggle-group-"+g++,this.valueChange=new s.vpe,this.change=new s.vpe,this.appearance=e&&e.appearance?e.appearance:"standard"}get name(){return this._name}set name(t){this._name=t,this._buttonToggles&&this._buttonToggles.forEach(t=>{t.name=this._name,t._markForCheck()})}get vertical(){return this._vertical}set vertical(t){this._vertical=(0,i.Ig)(t)}get value(){const t=this._selectionModel?this._selectionModel.selected:[];return this.multiple?t.map(t=>t.value):t[0]?t[0].value:void 0}set value(t){this._setSelectionByValue(t),this.valueChange.emit(this.value)}get selected(){const t=this._selectionModel?this._selectionModel.selected:[];return this.multiple?t:t[0]||null}get multiple(){return this._multiple}set multiple(t){this._multiple=(0,i.Ig)(t)}get disabled(){return this._disabled}set disabled(t){this._disabled=(0,i.Ig)(t),this._buttonToggles&&this._buttonToggles.forEach(t=>t._markForCheck())}ngOnInit(){this._selectionModel=new o.Ov(this.multiple,void 0,!1)}ngAfterContentInit(){this._selectionModel.select(...this._buttonToggles.filter(t=>t.checked))}writeValue(t){this.value=t,this._changeDetector.markForCheck()}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t}_emitChangeEvent(){const t=this.selected,e=Array.isArray(t)?t[t.length-1]:t,n=new m(e,this.value);this._controlValueAccessorChangeFn(n.value),this.change.emit(n)}_syncButtonToggle(t,e,n=!1,i=!1){this.multiple||!this.selected||t.checked||(this.selected.checked=!1),this._selectionModel?e?this._selectionModel.select(t):this._selectionModel.deselect(t):i=!0,i?Promise.resolve().then(()=>this._updateModelValue(n)):this._updateModelValue(n)}_isSelected(t){return this._selectionModel&&this._selectionModel.isSelected(t)}_isPrechecked(t){return void 0!==this._rawValue&&(this.multiple&&Array.isArray(this._rawValue)?this._rawValue.some(e=>null!=t.value&&e===t.value):t.value===this._rawValue)}_setSelectionByValue(t){this._rawValue=t,this._buttonToggles&&(this.multiple&&t?(Array.isArray(t),this._clearSelection(),t.forEach(t=>this._selectValue(t))):(this._clearSelection(),this._selectValue(t)))}_clearSelection(){this._selectionModel.clear(),this._buttonToggles.forEach(t=>t.checked=!1)}_selectValue(t){const e=this._buttonToggles.find(e=>null!=e.value&&e.value===t);e&&(e.checked=!0,this._selectionModel.select(e))}_updateModelValue(t){t&&this._emitChangeEvent(),this.valueChange.emit(this.value)}}return t.\u0275fac=function(e){return new(e||t)(s.Y36(s.sBO),s.Y36(u,8))},t.\u0275dir=s.lG2({type:t,selectors:[["mat-button-toggle-group"]],contentQueries:function(t,e,n){if(1&t&&s.Suo(n,_,5),2&t){let t;s.iGM(t=s.CRH())&&(e._buttonToggles=t)}},hostAttrs:["role","group",1,"mat-button-toggle-group"],hostVars:5,hostBindings:function(t,e){2&t&&(s.uIk("aria-disabled",e.disabled),s.ekj("mat-button-toggle-vertical",e.vertical)("mat-button-toggle-group-appearance-standard","standard"===e.appearance))},inputs:{appearance:"appearance",name:"name",vertical:"vertical",value:"value",multiple:"multiple",disabled:"disabled"},outputs:{valueChange:"valueChange",change:"change"},exportAs:["matButtonToggleGroup"],features:[s._Bn([h,{provide:p,useExisting:t}])]}),t})();class b{}const v=(0,r.Kr)(b);let _=(()=>{class t extends v{constructor(t,e,n,i,o,a){super(),this._changeDetectorRef=e,this._elementRef=n,this._focusMonitor=i,this._isSingleSelector=!1,this._checked=!1,this.ariaLabelledby=null,this._disabled=!1,this.change=new s.vpe;const r=Number(o);this.tabIndex=r||0===r?r:null,this.buttonToggleGroup=t,this.appearance=a&&a.appearance?a.appearance:"standard"}get buttonId(){return`${this.id}-button`}get appearance(){return this.buttonToggleGroup?this.buttonToggleGroup.appearance:this._appearance}set appearance(t){this._appearance=t}get checked(){return this.buttonToggleGroup?this.buttonToggleGroup._isSelected(this):this._checked}set checked(t){const e=(0,i.Ig)(t);e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&this.buttonToggleGroup._syncButtonToggle(this,this._checked),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled||this.buttonToggleGroup&&this.buttonToggleGroup.disabled}set disabled(t){this._disabled=(0,i.Ig)(t)}ngOnInit(){const t=this.buttonToggleGroup;this._isSingleSelector=t&&!t.multiple,this.id=this.id||"mat-button-toggle-"+g++,this._isSingleSelector&&(this.name=t.name),t&&(t._isPrechecked(this)?this.checked=!0:t._isSelected(this)!==this._checked&&t._syncButtonToggle(this,this._checked))}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){const t=this.buttonToggleGroup;this._focusMonitor.stopMonitoring(this._elementRef),t&&t._isSelected(this)&&t._syncButtonToggle(this,!1,!1,!0)}focus(t){this._buttonElement.nativeElement.focus(t)}_onButtonClick(){const t=!!this._isSingleSelector||!this._checked;t!==this._checked&&(this._checked=t,this.buttonToggleGroup&&(this.buttonToggleGroup._syncButtonToggle(this,this._checked,!0),this.buttonToggleGroup._onTouched())),this.change.emit(new m(this,this.value))}_markForCheck(){this._changeDetectorRef.markForCheck()}}return t.\u0275fac=function(e){return new(e||t)(s.Y36(p,8),s.Y36(s.sBO),s.Y36(s.SBq),s.Y36(l.tE),s.$8M("tabindex"),s.Y36(u,8))},t.\u0275cmp=s.Xpm({type:t,selectors:[["mat-button-toggle"]],viewQuery:function(t,e){if(1&t&&s.Gf(c,5),2&t){let t;s.iGM(t=s.CRH())&&(e._buttonElement=t.first)}},hostAttrs:["role","presentation",1,"mat-button-toggle"],hostVars:12,hostBindings:function(t,e){1&t&&s.NdJ("focus",function(){return e.focus()}),2&t&&(s.uIk("aria-label",null)("aria-labelledby",null)("id",e.id)("name",null),s.ekj("mat-button-toggle-standalone",!e.buttonToggleGroup)("mat-button-toggle-checked",e.checked)("mat-button-toggle-disabled",e.disabled)("mat-button-toggle-appearance-standard","standard"===e.appearance))},inputs:{disableRipple:"disableRipple",ariaLabelledby:["aria-labelledby","ariaLabelledby"],tabIndex:"tabIndex",appearance:"appearance",checked:"checked",disabled:"disabled",id:"id",name:"name",ariaLabel:["aria-label","ariaLabel"],value:"value"},outputs:{change:"change"},exportAs:["matButtonToggle"],features:[s.qOj],ngContentSelectors:d,decls:6,vars:9,consts:[["type","button",1,"mat-button-toggle-button","mat-focus-indicator",3,"id","disabled","click"],["button",""],[1,"mat-button-toggle-label-content"],[1,"mat-button-toggle-focus-overlay"],["matRipple","",1,"mat-button-toggle-ripple",3,"matRippleTrigger","matRippleDisabled"]],template:function(t,e){if(1&t&&(s.F$t(),s.TgZ(0,"button",0,1),s.NdJ("click",function(){return e._onButtonClick()}),s.TgZ(2,"span",2),s.Hsn(3),s.qZA(),s.qZA(),s._UZ(4,"span",3),s._UZ(5,"span",4)),2&t){const t=s.MAs(1);s.Q6J("id",e.buttonId)("disabled",e.disabled||null),s.uIk("tabindex",e.disabled?-1:e.tabIndex)("aria-pressed",e.checked)("name",e.name||null)("aria-label",e.ariaLabel)("aria-labelledby",e.ariaLabelledby),s.xp6(5),s.Q6J("matRippleTrigger",t)("matRippleDisabled",e.disableRipple||e.disabled)}},directives:[r.wG],styles:[".mat-button-toggle-standalone,.mat-button-toggle-group{position:relative;display:inline-flex;flex-direction:row;white-space:nowrap;overflow:hidden;border-radius:2px;-webkit-tap-highlight-color:transparent}.cdk-high-contrast-active .mat-button-toggle-standalone,.cdk-high-contrast-active .mat-button-toggle-group{outline:solid 1px}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{border-radius:4px}.cdk-high-contrast-active .mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.cdk-high-contrast-active .mat-button-toggle-group-appearance-standard{outline:0}.mat-button-toggle-vertical{flex-direction:column}.mat-button-toggle-vertical .mat-button-toggle-label-content{display:block}.mat-button-toggle{white-space:nowrap;position:relative}.mat-button-toggle .mat-icon svg{vertical-align:top}.mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:1}.cdk-high-contrast-active .mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:.5}.mat-button-toggle-appearance-standard:not(.mat-button-toggle-disabled):hover .mat-button-toggle-focus-overlay{opacity:.04}.mat-button-toggle-appearance-standard.cdk-keyboard-focused:not(.mat-button-toggle-disabled) .mat-button-toggle-focus-overlay{opacity:.12}.cdk-high-contrast-active .mat-button-toggle-appearance-standard.cdk-keyboard-focused:not(.mat-button-toggle-disabled) .mat-button-toggle-focus-overlay{opacity:.5}@media(hover: none){.mat-button-toggle-appearance-standard:not(.mat-button-toggle-disabled):hover .mat-button-toggle-focus-overlay{display:none}}.mat-button-toggle-label-content{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-block;line-height:36px;padding:0 16px;position:relative}.mat-button-toggle-appearance-standard .mat-button-toggle-label-content{padding:0 12px}.mat-button-toggle-label-content>*{vertical-align:middle}.mat-button-toggle-focus-overlay{border-radius:inherit;pointer-events:none;opacity:0;top:0;left:0;right:0;bottom:0;position:absolute}.mat-button-toggle-checked .mat-button-toggle-focus-overlay{border-bottom:solid 36px}.cdk-high-contrast-active .mat-button-toggle-checked .mat-button-toggle-focus-overlay{opacity:.5;height:0}.cdk-high-contrast-active .mat-button-toggle-checked.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{border-bottom:solid 500px}.mat-button-toggle .mat-button-toggle-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-button-toggle-button{border:0;background:none;color:inherit;padding:0;margin:0;font:inherit;outline:none;width:100%;cursor:pointer}.mat-button-toggle-disabled .mat-button-toggle-button{cursor:default}.mat-button-toggle-button::-moz-focus-inner{border:0}\n"],encapsulation:2,changeDetection:0}),t})(),x=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=s.oAB({type:t}),t.\u0275inj=s.cJS({imports:[[r.BQ,r.si],r.BQ]}),t})()},95522:function(t,e,n){"use strict";n.d(e,{HS:function(){return C},oH:function(){return N},qn:function(){return M},qH:function(){return T},Hi:function(){return E}});var i=n(99235),o=n(35366),s=n(87064),a=n(19861),r=n(61116),l=n(26136),c=n(55959),d=n(31906),u=n(90611),p=n(25416),h=n(56238),g=n(97388),m=n(58378),f=n(13070),b=n(93169),v=n(94720),_=n(31041);const x=["*"],Z=new o.OlP("MatChipRemove"),y=new o.OlP("MatChipAvatar"),w=new o.OlP("MatChipTrailingIcon");class k{constructor(t){this._elementRef=t}}const A=(0,s.sb)((0,s.pj)((0,s.Kr)(k),"primary"),-1);let C=(()=>{class t extends A{constructor(t,e,n,i,a,r,l,d){super(t),this._elementRef=t,this._ngZone=e,this._changeDetectorRef=a,this._hasFocus=!1,this.chipListSelectable=!0,this._chipListMultiple=!1,this._chipListDisabled=!1,this._selected=!1,this._selectable=!0,this._disabled=!1,this._removable=!0,this._onFocus=new c.xQ,this._onBlur=new c.xQ,this.selectionChange=new o.vpe,this.destroyed=new o.vpe,this.removed=new o.vpe,this._addHostClassName(),this._chipRippleTarget=r.createElement("div"),this._chipRippleTarget.classList.add("mat-chip-ripple"),this._elementRef.nativeElement.appendChild(this._chipRippleTarget),this._chipRipple=new s.IR(this,e,this._chipRippleTarget,n),this._chipRipple.setupTriggerEvents(t),this.rippleConfig=i||{},this._animationsDisabled="NoopAnimations"===l,this.tabIndex=null!=d&&parseInt(d)||-1}get rippleDisabled(){return this.disabled||this.disableRipple||this._animationsDisabled||!!this.rippleConfig.disabled}get selected(){return this._selected}set selected(t){const e=(0,a.Ig)(t);e!==this._selected&&(this._selected=e,this._dispatchSelectionChange())}get value(){return void 0!==this._value?this._value:this._elementRef.nativeElement.textContent}set value(t){this._value=t}get selectable(){return this._selectable&&this.chipListSelectable}set selectable(t){this._selectable=(0,a.Ig)(t)}get disabled(){return this._chipListDisabled||this._disabled}set disabled(t){this._disabled=(0,a.Ig)(t)}get removable(){return this._removable}set removable(t){this._removable=(0,a.Ig)(t)}get ariaSelected(){return this.selectable&&(this._chipListMultiple||this.selected)?this.selected.toString():null}_addHostClassName(){const t=this._elementRef.nativeElement;t.hasAttribute("mat-basic-chip")||"mat-basic-chip"===t.tagName.toLowerCase()?t.classList.add("mat-basic-chip"):t.classList.add("mat-standard-chip")}ngOnDestroy(){this.destroyed.emit({chip:this}),this._chipRipple._removeTriggerEvents()}select(){this._selected||(this._selected=!0,this._dispatchSelectionChange(),this._changeDetectorRef.markForCheck())}deselect(){this._selected&&(this._selected=!1,this._dispatchSelectionChange(),this._changeDetectorRef.markForCheck())}selectViaInteraction(){this._selected||(this._selected=!0,this._dispatchSelectionChange(!0),this._changeDetectorRef.markForCheck())}toggleSelected(t=!1){return this._selected=!this.selected,this._dispatchSelectionChange(t),this._changeDetectorRef.markForCheck(),this.selected}focus(){this._hasFocus||(this._elementRef.nativeElement.focus(),this._onFocus.next({chip:this})),this._hasFocus=!0}remove(){this.removable&&this.removed.emit({chip:this})}_handleClick(t){this.disabled?t.preventDefault():t.stopPropagation()}_handleKeydown(t){if(!this.disabled)switch(t.keyCode){case i.yY:case i.ZH:this.remove(),t.preventDefault();break;case i.L_:this.selectable&&this.toggleSelected(!0),t.preventDefault()}}_blur(){this._ngZone.onStable.pipe((0,u.q)(1)).subscribe(()=>{this._ngZone.run(()=>{this._hasFocus=!1,this._onBlur.next({chip:this})})})}_dispatchSelectionChange(t=!1){this.selectionChange.emit({source:this,isUserInput:t,selected:this._selected})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(o.SBq),o.Y36(o.R0b),o.Y36(b.t4),o.Y36(s.Y2,8),o.Y36(o.sBO),o.Y36(r.K0),o.Y36(l.Qb,8),o.$8M("tabindex"))},t.\u0275dir=o.lG2({type:t,selectors:[["mat-basic-chip"],["","mat-basic-chip",""],["mat-chip"],["","mat-chip",""]],contentQueries:function(t,e,n){if(1&t&&(o.Suo(n,y,5),o.Suo(n,w,5),o.Suo(n,Z,5)),2&t){let t;o.iGM(t=o.CRH())&&(e.avatar=t.first),o.iGM(t=o.CRH())&&(e.trailingIcon=t.first),o.iGM(t=o.CRH())&&(e.removeIcon=t.first)}},hostAttrs:["role","option",1,"mat-chip","mat-focus-indicator"],hostVars:14,hostBindings:function(t,e){1&t&&o.NdJ("click",function(t){return e._handleClick(t)})("keydown",function(t){return e._handleKeydown(t)})("focus",function(){return e.focus()})("blur",function(){return e._blur()}),2&t&&(o.uIk("tabindex",e.disabled?null:e.tabIndex)("disabled",e.disabled||null)("aria-disabled",e.disabled.toString())("aria-selected",e.ariaSelected),o.ekj("mat-chip-selected",e.selected)("mat-chip-with-avatar",e.avatar)("mat-chip-with-trailing-icon",e.trailingIcon||e.removeIcon)("mat-chip-disabled",e.disabled)("_mat-animation-noopable",e._animationsDisabled))},inputs:{color:"color",disableRipple:"disableRipple",tabIndex:"tabIndex",selected:"selected",value:"value",selectable:"selectable",disabled:"disabled",removable:"removable"},outputs:{selectionChange:"selectionChange",destroyed:"destroyed",removed:"removed"},exportAs:["matChip"],features:[o.qOj]}),t})(),T=(()=>{class t{constructor(t,e){this._parentChip=t,"BUTTON"===e.nativeElement.nodeName&&e.nativeElement.setAttribute("type","button")}_handleClick(t){const e=this._parentChip;e.removable&&!e.disabled&&e.remove(),t.stopPropagation()}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(C),o.Y36(o.SBq))},t.\u0275dir=o.lG2({type:t,selectors:[["","matChipRemove",""]],hostAttrs:[1,"mat-chip-remove","mat-chip-trailing-icon"],hostBindings:function(t,e){1&t&&o.NdJ("click",function(t){return e._handleClick(t)})},features:[o._Bn([{provide:Z,useExisting:t}])]}),t})();const q=new o.OlP("mat-chips-default-options");class I{constructor(t,e,n,i){this._defaultErrorStateMatcher=t,this._parentForm=e,this._parentFormGroup=n,this.ngControl=i}}const O=(0,s.FD)(I);let U=0;class P{constructor(t,e){this.source=t,this.value=e}}let M=(()=>{class t extends O{constructor(t,e,n,i,s,a,r){super(a,i,s,r),this._elementRef=t,this._changeDetectorRef=e,this._dir=n,this.ngControl=r,this.controlType="mat-chip-list",this._lastDestroyedChipIndex=null,this._destroyed=new c.xQ,this._uid="mat-chip-list-"+U++,this._tabIndex=0,this._userTabIndex=null,this._onTouched=()=>{},this._onChange=()=>{},this._multiple=!1,this._compareWith=(t,e)=>t===e,this._required=!1,this._disabled=!1,this.ariaOrientation="horizontal",this._selectable=!0,this.change=new o.vpe,this.valueChange=new o.vpe,this.ngControl&&(this.ngControl.valueAccessor=this)}get selected(){return this.multiple?this._selectionModel.selected:this._selectionModel.selected[0]}get role(){return this.empty?null:"listbox"}get multiple(){return this._multiple}set multiple(t){this._multiple=(0,a.Ig)(t),this._syncChipsState()}get compareWith(){return this._compareWith}set compareWith(t){this._compareWith=t,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(t){this.writeValue(t),this._value=t}get id(){return this._chipInput?this._chipInput.id:this._uid}get required(){return this._required}set required(t){this._required=(0,a.Ig)(t),this.stateChanges.next()}get placeholder(){return this._chipInput?this._chipInput.placeholder:this._placeholder}set placeholder(t){this._placeholder=t,this.stateChanges.next()}get focused(){return this._chipInput&&this._chipInput.focused||this._hasFocusedChip()}get empty(){return(!this._chipInput||this._chipInput.empty)&&(!this.chips||0===this.chips.length)}get shouldLabelFloat(){return!this.empty||this.focused}get disabled(){return this.ngControl?!!this.ngControl.disabled:this._disabled}set disabled(t){this._disabled=(0,a.Ig)(t),this._syncChipsState()}get selectable(){return this._selectable}set selectable(t){this._selectable=(0,a.Ig)(t),this.chips&&this.chips.forEach(t=>t.chipListSelectable=this._selectable)}set tabIndex(t){this._userTabIndex=t,this._tabIndex=t}get chipSelectionChanges(){return(0,d.T)(...this.chips.map(t=>t.selectionChange))}get chipFocusChanges(){return(0,d.T)(...this.chips.map(t=>t._onFocus))}get chipBlurChanges(){return(0,d.T)(...this.chips.map(t=>t._onBlur))}get chipRemoveChanges(){return(0,d.T)(...this.chips.map(t=>t.destroyed))}ngAfterContentInit(){this._keyManager=new g.Em(this.chips).withWrap().withVerticalOrientation().withHomeAndEnd().withHorizontalOrientation(this._dir?this._dir.value:"ltr"),this._dir&&this._dir.change.pipe((0,p.R)(this._destroyed)).subscribe(t=>this._keyManager.withHorizontalOrientation(t)),this._keyManager.tabOut.pipe((0,p.R)(this._destroyed)).subscribe(()=>{this._allowFocusEscape()}),this.chips.changes.pipe((0,h.O)(null),(0,p.R)(this._destroyed)).subscribe(()=>{this.disabled&&Promise.resolve().then(()=>{this._syncChipsState()}),this._resetChips(),this._initializeSelection(),this._updateTabIndex(),this._updateFocusForDestroyedChips(),this.stateChanges.next()})}ngOnInit(){this._selectionModel=new m.Ov(this.multiple,void 0,!1),this.stateChanges.next()}ngDoCheck(){this.ngControl&&(this.updateErrorState(),this.ngControl.disabled!==this._disabled&&(this.disabled=!!this.ngControl.disabled))}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete(),this.stateChanges.complete(),this._dropSubscriptions()}registerInput(t){this._chipInput=t,this._elementRef.nativeElement.setAttribute("data-mat-chip-input",t.id)}setDescribedByIds(t){this._ariaDescribedby=t.join(" ")}writeValue(t){this.chips&&this._setSelectionByValue(t,!1)}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this.stateChanges.next()}onContainerClick(t){this._originatesFromChip(t)||this.focus()}focus(t){this.disabled||this._chipInput&&this._chipInput.focused||(this.chips.length>0?(this._keyManager.setFirstItemActive(),this.stateChanges.next()):(this._focusInput(t),this.stateChanges.next()))}_focusInput(t){this._chipInput&&this._chipInput.focus(t)}_keydown(t){const e=t.target;t.keyCode===i.ZH&&this._isInputEmpty(e)?(this._keyManager.setLastItemActive(),t.preventDefault()):e&&e.classList.contains("mat-chip")&&(this._keyManager.onKeydown(t),this.stateChanges.next())}_updateTabIndex(){this._tabIndex=this._userTabIndex||(0===this.chips.length?-1:0)}_updateFocusForDestroyedChips(){if(null!=this._lastDestroyedChipIndex)if(this.chips.length){const t=Math.min(this._lastDestroyedChipIndex,this.chips.length-1);this._keyManager.setActiveItem(t)}else this.focus();this._lastDestroyedChipIndex=null}_isValidIndex(t){return t>=0&&t<this.chips.length}_isInputEmpty(t){return!(!t||"input"!==t.nodeName.toLowerCase()||t.value)}_setSelectionByValue(t,e=!0){if(this._clearSelection(),this.chips.forEach(t=>t.deselect()),Array.isArray(t))t.forEach(t=>this._selectValue(t,e)),this._sortValues();else{const n=this._selectValue(t,e);n&&e&&this._keyManager.setActiveItem(n)}}_selectValue(t,e=!0){const n=this.chips.find(e=>null!=e.value&&this._compareWith(e.value,t));return n&&(e?n.selectViaInteraction():n.select(),this._selectionModel.select(n)),n}_initializeSelection(){Promise.resolve().then(()=>{(this.ngControl||this._value)&&(this._setSelectionByValue(this.ngControl?this.ngControl.value:this._value,!1),this.stateChanges.next())})}_clearSelection(t){this._selectionModel.clear(),this.chips.forEach(e=>{e!==t&&e.deselect()}),this.stateChanges.next()}_sortValues(){this._multiple&&(this._selectionModel.clear(),this.chips.forEach(t=>{t.selected&&this._selectionModel.select(t)}),this.stateChanges.next())}_propagateChanges(t){let e=null;e=Array.isArray(this.selected)?this.selected.map(t=>t.value):this.selected?this.selected.value:t,this._value=e,this.change.emit(new P(this,e)),this.valueChange.emit(e),this._onChange(e),this._changeDetectorRef.markForCheck()}_blur(){this._hasFocusedChip()||this._keyManager.setActiveItem(-1),this.disabled||(this._chipInput?setTimeout(()=>{this.focused||this._markAsTouched()}):this._markAsTouched())}_markAsTouched(){this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next()}_allowFocusEscape(){-1!==this._tabIndex&&(this._tabIndex=-1,setTimeout(()=>{this._tabIndex=this._userTabIndex||0,this._changeDetectorRef.markForCheck()}))}_resetChips(){this._dropSubscriptions(),this._listenToChipsFocus(),this._listenToChipsSelection(),this._listenToChipsRemoved()}_dropSubscriptions(){this._chipFocusSubscription&&(this._chipFocusSubscription.unsubscribe(),this._chipFocusSubscription=null),this._chipBlurSubscription&&(this._chipBlurSubscription.unsubscribe(),this._chipBlurSubscription=null),this._chipSelectionSubscription&&(this._chipSelectionSubscription.unsubscribe(),this._chipSelectionSubscription=null),this._chipRemoveSubscription&&(this._chipRemoveSubscription.unsubscribe(),this._chipRemoveSubscription=null)}_listenToChipsSelection(){this._chipSelectionSubscription=this.chipSelectionChanges.subscribe(t=>{t.source.selected?this._selectionModel.select(t.source):this._selectionModel.deselect(t.source),this.multiple||this.chips.forEach(t=>{!this._selectionModel.isSelected(t)&&t.selected&&t.deselect()}),t.isUserInput&&this._propagateChanges()})}_listenToChipsFocus(){this._chipFocusSubscription=this.chipFocusChanges.subscribe(t=>{let e=this.chips.toArray().indexOf(t.chip);this._isValidIndex(e)&&this._keyManager.updateActiveItem(e),this.stateChanges.next()}),this._chipBlurSubscription=this.chipBlurChanges.subscribe(()=>{this._blur(),this.stateChanges.next()})}_listenToChipsRemoved(){this._chipRemoveSubscription=this.chipRemoveChanges.subscribe(t=>{const e=t.chip,n=this.chips.toArray().indexOf(t.chip);this._isValidIndex(n)&&e._hasFocus&&(this._lastDestroyedChipIndex=n)})}_originatesFromChip(t){let e=t.target;for(;e&&e!==this._elementRef.nativeElement;){if(e.classList.contains("mat-chip"))return!0;e=e.parentElement}return!1}_hasFocusedChip(){return this.chips&&this.chips.some(t=>t._hasFocus)}_syncChipsState(){this.chips&&this.chips.forEach(t=>{t._chipListDisabled=this._disabled,t._chipListMultiple=this.multiple})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(o.SBq),o.Y36(o.sBO),o.Y36(v.Is,8),o.Y36(_.F,8),o.Y36(_.sg,8),o.Y36(s.rD),o.Y36(_.a5,10))},t.\u0275cmp=o.Xpm({type:t,selectors:[["mat-chip-list"]],contentQueries:function(t,e,n){if(1&t&&o.Suo(n,C,5),2&t){let t;o.iGM(t=o.CRH())&&(e.chips=t)}},hostAttrs:[1,"mat-chip-list"],hostVars:15,hostBindings:function(t,e){1&t&&o.NdJ("focus",function(){return e.focus()})("blur",function(){return e._blur()})("keydown",function(t){return e._keydown(t)}),2&t&&(o.Ikx("id",e._uid),o.uIk("tabindex",e.disabled?null:e._tabIndex)("aria-describedby",e._ariaDescribedby||null)("aria-required",e.role?e.required:null)("aria-disabled",e.disabled.toString())("aria-invalid",e.errorState)("aria-multiselectable",e.multiple)("role",e.role)("aria-orientation",e.ariaOrientation),o.ekj("mat-chip-list-disabled",e.disabled)("mat-chip-list-invalid",e.errorState)("mat-chip-list-required",e.required))},inputs:{ariaOrientation:["aria-orientation","ariaOrientation"],multiple:"multiple",compareWith:"compareWith",value:"value",required:"required",placeholder:"placeholder",disabled:"disabled",selectable:"selectable",tabIndex:"tabIndex",errorStateMatcher:"errorStateMatcher"},outputs:{change:"change",valueChange:"valueChange"},exportAs:["matChipList"],features:[o._Bn([{provide:f.Eo,useExisting:t}]),o.qOj],ngContentSelectors:x,decls:2,vars:0,consts:[[1,"mat-chip-list-wrapper"]],template:function(t,e){1&t&&(o.F$t(),o.TgZ(0,"div",0),o.Hsn(1),o.qZA())},styles:['.mat-chip{position:relative;box-sizing:border-box;-webkit-tap-highlight-color:transparent;transform:translateZ(0);border:none;-webkit-appearance:none;-moz-appearance:none}.mat-standard-chip{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);display:inline-flex;padding:7px 12px;border-radius:16px;align-items:center;cursor:default;min-height:32px;height:1px}._mat-animation-noopable.mat-standard-chip{transition:none;animation:none}.mat-standard-chip .mat-chip-remove.mat-icon{width:18px;height:18px}.mat-standard-chip::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;opacity:0;content:"";pointer-events:none;transition:opacity 200ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-standard-chip:hover::after{opacity:.12}.mat-standard-chip:focus{outline:none}.mat-standard-chip:focus::after{opacity:.16}.cdk-high-contrast-active .mat-standard-chip{outline:solid 1px}.cdk-high-contrast-active .mat-standard-chip:focus{outline:dotted 2px}.mat-standard-chip.mat-chip-disabled::after{opacity:0}.mat-standard-chip.mat-chip-disabled .mat-chip-remove,.mat-standard-chip.mat-chip-disabled .mat-chip-trailing-icon{cursor:default}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar,.mat-standard-chip.mat-chip-with-avatar{padding-top:0;padding-bottom:0}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-right:8px;padding-left:0}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-left:8px;padding-right:0}.mat-standard-chip.mat-chip-with-trailing-icon{padding-top:7px;padding-bottom:7px;padding-right:8px;padding-left:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon{padding-left:8px;padding-right:12px}.mat-standard-chip.mat-chip-with-avatar{padding-left:0;padding-right:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-avatar{padding-right:0;padding-left:12px}.mat-standard-chip .mat-chip-avatar{width:24px;height:24px;margin-right:8px;margin-left:4px}[dir=rtl] .mat-standard-chip .mat-chip-avatar{margin-left:8px;margin-right:4px}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{width:18px;height:18px;cursor:pointer}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{margin-left:8px;margin-right:0}[dir=rtl] .mat-standard-chip .mat-chip-remove,[dir=rtl] .mat-standard-chip .mat-chip-trailing-icon{margin-right:8px;margin-left:0}.mat-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit;overflow:hidden}.mat-chip-list-wrapper{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;margin:-4px}.mat-chip-list-wrapper input.mat-input-element,.mat-chip-list-wrapper .mat-standard-chip{margin:4px}.mat-chip-list-stacked .mat-chip-list-wrapper{flex-direction:column;align-items:flex-start}.mat-chip-list-stacked .mat-chip-list-wrapper .mat-standard-chip{width:100%}.mat-chip-avatar{border-radius:50%;justify-content:center;align-items:center;display:flex;overflow:hidden;object-fit:cover}input.mat-chip-input{width:150px;margin:4px;flex:1 0 150px}\n'],encapsulation:2,changeDetection:0}),t})(),S=0,N=(()=>{class t{constructor(t,e){this._elementRef=t,this._defaultOptions=e,this.focused=!1,this._addOnBlur=!1,this.separatorKeyCodes=this._defaultOptions.separatorKeyCodes,this.chipEnd=new o.vpe,this.placeholder="",this.id="mat-chip-list-input-"+S++,this._disabled=!1,this._inputElement=this._elementRef.nativeElement}set chipList(t){t&&(this._chipList=t,this._chipList.registerInput(this))}get addOnBlur(){return this._addOnBlur}set addOnBlur(t){this._addOnBlur=(0,a.Ig)(t)}get disabled(){return this._disabled||this._chipList&&this._chipList.disabled}set disabled(t){this._disabled=(0,a.Ig)(t)}get empty(){return!this._inputElement.value}ngOnChanges(){this._chipList.stateChanges.next()}_keydown(t){t&&t.keyCode===i.Mf&&!(0,i.Vb)(t,"shiftKey")&&this._chipList._allowFocusEscape(),this._emitChipEnd(t)}_blur(){this.addOnBlur&&this._emitChipEnd(),this.focused=!1,this._chipList.focused||this._chipList._blur(),this._chipList.stateChanges.next()}_focus(){this.focused=!0,this._chipList.stateChanges.next()}_emitChipEnd(t){!this._inputElement.value&&t&&this._chipList._keydown(t),t&&!this._isSeparatorKey(t)||(this.chipEnd.emit({input:this._inputElement,value:this._inputElement.value}),t&&t.preventDefault())}_onInput(){this._chipList.stateChanges.next()}focus(t){this._inputElement.focus(t)}_isSeparatorKey(t){return!(0,i.Vb)(t)&&new Set(this.separatorKeyCodes).has(t.keyCode)}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(o.SBq),o.Y36(q))},t.\u0275dir=o.lG2({type:t,selectors:[["input","matChipInputFor",""]],hostAttrs:[1,"mat-chip-input","mat-input-element"],hostVars:5,hostBindings:function(t,e){1&t&&o.NdJ("keydown",function(t){return e._keydown(t)})("blur",function(){return e._blur()})("focus",function(){return e._focus()})("input",function(){return e._onInput()}),2&t&&(o.Ikx("id",e.id),o.uIk("disabled",e.disabled||null)("placeholder",e.placeholder||null)("aria-invalid",e._chipList&&e._chipList.ngControl?e._chipList.ngControl.invalid:null)("aria-required",e._chipList&&e._chipList.required||null))},inputs:{separatorKeyCodes:["matChipInputSeparatorKeyCodes","separatorKeyCodes"],placeholder:"placeholder",id:"id",chipList:["matChipInputFor","chipList"],addOnBlur:["matChipInputAddOnBlur","addOnBlur"],disabled:"disabled"},outputs:{chipEnd:"matChipInputTokenEnd"},exportAs:["matChipInput","matChipInputFor"],features:[o.TTD]}),t})();const J={separatorKeyCodes:[i.K5]};let E=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.oAB({type:t}),t.\u0275inj=o.cJS({providers:[s.rD,{provide:q,useValue:J}],imports:[[s.BQ]]}),t})()},7436:function(t,e,n){"use strict";n.d(e,{U0:function(){return w},VQ:function(){return _},Fk:function(){return k}});var i=n(35366),o=n(87064),s=n(19861),a=n(31041),r=n(26136),l=n(97388),c=n(58378);const d=["input"],u=function(){return{enterDuration:150}},p=["*"],h=new i.OlP("mat-radio-default-options",{providedIn:"root",factory:function(){return{color:"accent"}}});let g=0;const m={provide:a.JU,useExisting:(0,i.Gpc)(()=>_),multi:!0};class f{constructor(t,e){this.source=t,this.value=e}}const b=new i.OlP("MatRadioGroup");let v=(()=>{class t{constructor(t){this._changeDetector=t,this._value=null,this._name="mat-radio-group-"+g++,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(t){this._name=t,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(t){this._labelPosition="before"===t?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(t){this._selected=t,this.value=t?t.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(t){this._disabled=(0,s.Ig)(t),this._markRadiosForCheck()}get required(){return this._required}set required(t){this._required=(0,s.Ig)(t),this._markRadiosForCheck()}ngAfterContentInit(){this._isInitialized=!0}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(t=>{t.name=this.name,t._markForCheck()})}_updateSelectedRadioFromValue(){this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(t=>{t.checked=this.value===t.value,t.checked&&(this._selected=t)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new f(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(t=>t._markForCheck())}writeValue(t){this.value=t,this._changeDetector.markForCheck()}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetector.markForCheck()}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(i.sBO))},t.\u0275dir=i.lG2({type:t,inputs:{name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:"disabled",required:"required",color:"color"},outputs:{change:"change"}}),t})(),_=(()=>{class t extends v{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=i.n5z(t)))(n||t)}}(),t.\u0275dir=i.lG2({type:t,selectors:[["mat-radio-group"]],contentQueries:function(t,e,n){if(1&t&&i.Suo(n,w,5),2&t){let t;i.iGM(t=i.CRH())&&(e._radios=t)}},hostAttrs:["role","radiogroup",1,"mat-radio-group"],exportAs:["matRadioGroup"],features:[i._Bn([m,{provide:b,useExisting:t}]),i.qOj]}),t})();class x{constructor(t){this._elementRef=t}}const Z=(0,o.Kr)((0,o.sb)(x));let y=(()=>{class t extends Z{constructor(t,e,n,o,a,r,l,c){super(e),this._changeDetector=n,this._focusMonitor=o,this._radioDispatcher=a,this._animationMode=r,this._providerOverride=l,this._uniqueId="mat-radio-"+ ++g,this.id=this._uniqueId,this.change=new i.vpe,this._checked=!1,this._value=null,this._removeUniqueSelectionListener=()=>{},this.radioGroup=t,c&&(this.tabIndex=(0,s.su)(c,0)),this._removeUniqueSelectionListener=a.listen((t,e)=>{t!==this.id&&e===this.name&&(this.checked=!1)})}get checked(){return this._checked}set checked(t){const e=(0,s.Ig)(t);this._checked!==e&&(this._checked=e,e&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!e&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),e&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===t),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(t){this._labelPosition=t}get disabled(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled}set disabled(t){this._setDisabled((0,s.Ig)(t))}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(t){this._required=(0,s.Ig)(t)}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"}set color(t){this._color=t}get inputId(){return`${this.id||this._uniqueId}-input`}focus(t,e){e?this._focusMonitor.focusVia(this._inputElement,e,t):this._inputElement.nativeElement.focus(t)}_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(t=>{!t&&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(t){t.stopPropagation()}_onInputChange(t){t.stopPropagation();const e=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),e&&this.radioGroup._emitChangeEvent())}_setDisabled(t){this._disabled!==t&&(this._disabled=t,this._changeDetector.markForCheck())}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(v),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))},t.\u0275dir=i.lG2({type:t,viewQuery:function(t,e){if(1&t&&i.Gf(d,5),2&t){let t;i.iGM(t=i.CRH())&&(e._inputElement=t.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]}),t})(),w=(()=>{class t extends y{constructor(t,e,n,i,o,s,a,r){super(t,e,n,i,o,s,a,r)}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(b,8),i.Y36(i.SBq),i.Y36(i.sBO),i.Y36(l.tE),i.Y36(c.A8),i.Y36(r.Qb,8),i.Y36(h,8),i.$8M("tabindex"))},t.\u0275cmp=i.Xpm({type:t,selectors:[["mat-radio-button"]],hostAttrs:[1,"mat-radio-button"],hostVars:17,hostBindings:function(t,e){1&t&&i.NdJ("focus",function(){return e._inputElement.nativeElement.focus()}),2&t&&(i.uIk("tabindex",null)("id",e.id)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),i.ekj("mat-radio-checked",e.checked)("mat-radio-disabled",e.disabled)("_mat-animation-noopable","NoopAnimations"===e._animationMode)("mat-primary","primary"===e.color)("mat-accent","accent"===e.color)("mat-warn","warn"===e.color))},inputs:{disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matRadioButton"],features:[i.qOj],ngContentSelectors:p,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(t,e){if(1&t&&(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(t){return e._onInputChange(t)})("click",function(t){return e._onInputClick(t)}),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&t){const t=i.MAs(1);i.uIk("for",e.inputId),i.xp6(5),i.Q6J("id",e.inputId)("checked",e.checked)("disabled",e.disabled)("tabIndex",e.tabIndex)("required",e.required),i.uIk("name",e.name)("value",e.value)("aria-label",e.ariaLabel)("aria-labelledby",e.ariaLabelledby)("aria-describedby",e.ariaDescribedby),i.xp6(2),i.Q6J("matRippleTrigger",t)("matRippleDisabled",e._isRippleDisabled())("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",i.DdM(18,u)),i.xp6(2),i.ekj("mat-radio-label-before","before"==e.labelPosition)}},directives:[o.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}),t})(),k=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=i.oAB({type:t}),t.\u0275inj=i.cJS({imports:[[o.si,o.BQ],o.BQ]}),t})()},79572:function(t,e,n){"use strict";n.d(e,{Rr:function(){return Z},rP:function(){return w}});var i=n(27853),o=n(35366),s=n(87064),a=n(19861),r=n(31041),l=n(26136),c=n(97388);const d=["thumbContainer"],u=["toggleBar"],p=["input"],h=function(){return{enterDuration:150}},g=["*"],m=new o.OlP("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1})});let f=0;const b={provide:r.JU,useExisting:(0,o.Gpc)(()=>Z),multi:!0};class v{constructor(t,e){this.source=t,this.checked=e}}class _{constructor(t){this._elementRef=t}}const x=(0,s.sb)((0,s.pj)((0,s.Kr)((0,s.Id)(_)),"accent"));let Z=(()=>{class t extends x{constructor(t,e,n,i,s,a){super(t),this._focusMonitor=e,this._changeDetectorRef=n,this.defaults=s,this._animationMode=a,this._onChange=t=>{},this._onTouched=()=>{},this._uniqueId="mat-slide-toggle-"+ ++f,this._required=!1,this._checked=!1,this.name=null,this.id=this._uniqueId,this.labelPosition="after",this.ariaLabel=null,this.ariaLabelledby=null,this.change=new o.vpe,this.toggleChange=new o.vpe,this.tabIndex=parseInt(i)||0}get required(){return this._required}set required(t){this._required=(0,a.Ig)(t)}get checked(){return this._checked}set checked(t){this._checked=(0,a.Ig)(t),this._changeDetectorRef.markForCheck()}get inputId(){return`${this.id||this._uniqueId}-input`}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{"keyboard"===t||"program"===t?this._inputElement.nativeElement.focus():t||Promise.resolve().then(()=>this._onTouched())})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}_onChangeEvent(t){t.stopPropagation(),this.toggleChange.emit(),this.defaults.disableToggleValue?this._inputElement.nativeElement.checked=this.checked:(this.checked=this._inputElement.nativeElement.checked,this._emitChangeEvent())}_onInputClick(t){t.stopPropagation()}writeValue(t){this.checked=!!t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck()}focus(t,e){e?this._focusMonitor.focusVia(this._inputElement,e,t):this._inputElement.nativeElement.focus(t)}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(new v(this,this.checked))}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(o.SBq),o.Y36(c.tE),o.Y36(o.sBO),o.$8M("tabindex"),o.Y36(m),o.Y36(l.Qb,8))},t.\u0275cmp=o.Xpm({type:t,selectors:[["mat-slide-toggle"]],viewQuery:function(t,e){if(1&t&&(o.Gf(d,5),o.Gf(u,5),o.Gf(p,5)),2&t){let t;o.iGM(t=o.CRH())&&(e._thumbEl=t.first),o.iGM(t=o.CRH())&&(e._thumbBarEl=t.first),o.iGM(t=o.CRH())&&(e._inputElement=t.first)}},hostAttrs:[1,"mat-slide-toggle"],hostVars:12,hostBindings:function(t,e){2&t&&(o.Ikx("id",e.id),o.uIk("tabindex",e.disabled?null:-1)("aria-label",null)("aria-labelledby",null),o.ekj("mat-checked",e.checked)("mat-disabled",e.disabled)("mat-slide-toggle-label-before","before"==e.labelPosition)("_mat-animation-noopable","NoopAnimations"===e._animationMode))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],required:"required",checked:"checked"},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[o._Bn([b]),o.qOj],ngContentSelectors:g,decls:16,vars:18,consts:[[1,"mat-slide-toggle-label"],["label",""],[1,"mat-slide-toggle-bar"],["toggleBar",""],["type","checkbox","role","switch",1,"mat-slide-toggle-input","cdk-visually-hidden",3,"id","required","tabIndex","checked","disabled","change","click"],["input",""],[1,"mat-slide-toggle-thumb-container"],["thumbContainer",""],[1,"mat-slide-toggle-thumb"],["mat-ripple","",1,"mat-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-slide-toggle-persistent-ripple"],[1,"mat-slide-toggle-content",3,"cdkObserveContent"],["labelContent",""],[2,"display","none"]],template:function(t,e){if(1&t&&(o.F$t(),o.TgZ(0,"label",0,1),o.TgZ(2,"div",2,3),o.TgZ(4,"input",4,5),o.NdJ("change",function(t){return e._onChangeEvent(t)})("click",function(t){return e._onInputClick(t)}),o.qZA(),o.TgZ(6,"div",6,7),o._UZ(8,"div",8),o.TgZ(9,"div",9),o._UZ(10,"div",10),o.qZA(),o.qZA(),o.qZA(),o.TgZ(11,"span",11,12),o.NdJ("cdkObserveContent",function(){return e._onLabelTextChange()}),o.TgZ(13,"span",13),o._uU(14,"\xa0"),o.qZA(),o.Hsn(15),o.qZA(),o.qZA()),2&t){const t=o.MAs(1),n=o.MAs(12);o.uIk("for",e.inputId),o.xp6(2),o.ekj("mat-slide-toggle-bar-no-side-margin",!n.textContent||!n.textContent.trim()),o.xp6(2),o.Q6J("id",e.inputId)("required",e.required)("tabIndex",e.tabIndex)("checked",e.checked)("disabled",e.disabled),o.uIk("name",e.name)("aria-checked",e.checked.toString())("aria-label",e.ariaLabel)("aria-labelledby",e.ariaLabelledby),o.xp6(5),o.Q6J("matRippleTrigger",t)("matRippleDisabled",e.disableRipple||e.disabled)("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",o.DdM(17,h))}},directives:[s.wG,i.wD],styles:[".mat-slide-toggle{display:inline-block;height:24px;max-width:100%;line-height:24px;white-space:nowrap;outline:none;-webkit-tap-highlight-color:transparent}.mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(16px, 0, 0)}[dir=rtl] .mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(-16px, 0, 0)}.mat-slide-toggle.mat-disabled{opacity:.38}.mat-slide-toggle.mat-disabled .mat-slide-toggle-label,.mat-slide-toggle.mat-disabled .mat-slide-toggle-thumb-container{cursor:default}.mat-slide-toggle-label{display:flex;flex:1;flex-direction:row;align-items:center;height:inherit;cursor:pointer}.mat-slide-toggle-content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-slide-toggle-label-before .mat-slide-toggle-label{order:1}.mat-slide-toggle-label-before .mat-slide-toggle-bar{order:2}[dir=rtl] .mat-slide-toggle-label-before .mat-slide-toggle-bar,.mat-slide-toggle-bar{margin-right:8px;margin-left:0}[dir=rtl] .mat-slide-toggle-bar,.mat-slide-toggle-label-before .mat-slide-toggle-bar{margin-left:8px;margin-right:0}.mat-slide-toggle-bar-no-side-margin{margin-left:0;margin-right:0}.mat-slide-toggle-thumb-container{position:absolute;z-index:1;width:20px;height:20px;top:-3px;left:0;transform:translate3d(0, 0, 0);transition:all 80ms linear;transition-property:transform}._mat-animation-noopable .mat-slide-toggle-thumb-container{transition:none}[dir=rtl] .mat-slide-toggle-thumb-container{left:auto;right:0}.mat-slide-toggle-thumb{height:20px;width:20px;border-radius:50%}.mat-slide-toggle-bar{position:relative;width:36px;height:14px;flex-shrink:0;border-radius:8px}.mat-slide-toggle-input{bottom:0;left:10px}[dir=rtl] .mat-slide-toggle-input{left:auto;right:10px}.mat-slide-toggle-bar,.mat-slide-toggle-thumb{transition:all 80ms linear;transition-property:background-color;transition-delay:50ms}._mat-animation-noopable .mat-slide-toggle-bar,._mat-animation-noopable .mat-slide-toggle-thumb{transition:none}.mat-slide-toggle .mat-slide-toggle-ripple{position:absolute;top:calc(50% - 20px);left:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-slide-toggle .mat-slide-toggle-ripple .mat-ripple-element:not(.mat-slide-toggle-persistent-ripple){opacity:.12}.mat-slide-toggle-persistent-ripple{width:100%;height:100%;transform:none}.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:.04}.mat-slide-toggle:not(.mat-disabled).cdk-keyboard-focused .mat-slide-toggle-persistent-ripple{opacity:.12}.mat-slide-toggle-persistent-ripple,.mat-slide-toggle.mat-disabled .mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:0}@media(hover: none){.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{display:none}}.cdk-high-contrast-active .mat-slide-toggle-thumb,.cdk-high-contrast-active .mat-slide-toggle-bar{border:1px solid}.cdk-high-contrast-active .mat-slide-toggle.cdk-keyboard-focused .mat-slide-toggle-bar{outline:2px dotted;outline-offset:5px}\n"],encapsulation:2,changeDetection:0}),t})(),y=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.oAB({type:t}),t.\u0275inj=o.cJS({}),t})(),w=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.oAB({type:t}),t.\u0275inj=o.cJS({imports:[[y,s.si,s.BQ,i.Q8],y,s.BQ]}),t})()},88636:function(t,e,n){var i,o,s;void 0===(s=this)&&void 0!==window&&(s=window),i=[n(45059)],void 0===(o=(function(t){return s["Chartist.plugins.tooltip"]=(e=t,function(t,e,n){"use strict";var i={currency:void 0,currencyFormatCallback:void 0,tooltipOffset:{x:0,y:-20},anchorToPoint:!1,appendToBody:!0,class:void 0,pointClass:"ct-point"};function o(t,e){return(" "+t.getAttribute("class")+" ").indexOf(" "+e+" ")>-1}function s(n){var i;return s in n?((i=n.offsetParent)||(i=e.body.parentElement),i):(i=n.parentNode)?"static"!==t.getComputedStyle(i).position?i:"BODY"===i.tagName?i.parentElement:s(i):e.body.parentElement}n.plugins=n.plugins||{},n.plugins.tooltip=function(a){return a=n.extend({},i,a),function(i){var r=a.pointClass;i instanceof n.Bar?r="ct-bar":i instanceof n.Pie&&(r=i.options.donut?i.options.donutSolid?"ct-slice-donut-solid":"ct-slice-donut":"ct-slice-pie");var l,c=i.container,d=!1,u=s(c);(l=a.appendToBody?e.querySelector(".chartist-tooltip"):c.querySelector(".chartist-tooltip"))||((l=e.createElement("div")).className=a.class?"chartist-tooltip "+a.class:"chartist-tooltip",a.appendToBody?e.body.appendChild(l):c.appendChild(l));var p=l.offsetHeight,h=l.offsetWidth;function g(t,e,n){c.addEventListener(t,function(t){e&&!o(t.target,e)||n(t)})}function m(e){var n=-(h=h||l.offsetWidth)/2+a.tooltipOffset.x,i=-(p=p||l.offsetHeight)+a.tooltipOffset.y,o=!0===a.anchorToPoint&&e.target.x2&&e.target.y2;if(!0===a.appendToBody)if(o){var s=c.getBoundingClientRect(),r=e.target.y2.baseVal.value+s.top+t.pageYOffset;l.style.left=e.target.x2.baseVal.value+s.left+t.pageXOffset+n+"px",l.style.top=r+i+"px"}else l.style.left=e.pageX+n+"px",l.style.top=e.pageY+i+"px";else{var d=u.getBoundingClientRect(),g=-d.left-t.pageXOffset+n,m=-d.top-t.pageYOffset+i;o?(s=c.getBoundingClientRect(),r=e.target.y2.baseVal.value+s.top+t.pageYOffset,l.style.left=e.target.x2.baseVal.value+s.left+t.pageXOffset+g+"px",l.style.top=r+m+"px"):(l.style.left=e.pageX+g+"px",l.style.top=e.pageY+m+"px")}}function f(t){d=!1;var e=new RegExp("tooltip-show\\s*","gi");t.className=t.className.replace(e,"").trim()}f(l),g("mouseover",r,function(t){var r,g=t.target,f="",b=(i instanceof n.Pie?g:g.parentNode)?g.parentNode.getAttribute("ct:meta")||g.parentNode.getAttribute("ct:series-name"):"",v=g.getAttribute("ct:meta")||b||"",_=!!v,x=g.getAttribute("ct:value");if(a.transformTooltipTextFnc&&"function"==typeof a.transformTooltipTextFnc&&(x=a.transformTooltipTextFnc(x)),a.tooltipFnc&&"function"==typeof a.tooltipFnc)f=a.tooltipFnc(v,x);else{if(a.metaIsHTML){var Z=e.createElement("textarea");Z.innerHTML=v,v=Z.value}if(v='<span class="chartist-tooltip-meta">'+v+"</span>",_)f+=v+"<br>";else if(i instanceof n.Pie){var y=function(t,e){do{t=t.nextSibling}while(t&&!o(t,"ct-label"));return t}(g);y&&(f+=((r=y).innerText||r.textContent)+"<br>")}x&&(a.currency&&(x=null!=a.currencyFormatCallback?a.currencyFormatCallback(x,a):a.currency+x.replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g,"$1,")),f+=x='<span class="chartist-tooltip-value">'+x+"</span>")}f&&(l.innerHTML=f,p=l.offsetHeight,h=l.offsetWidth,!0!==a.appendToBody&&(u=s(c)),"absolute"!==l.style.display&&(l.style.display="absolute"),m(t),function(t){d=!0,o(t,"tooltip-show")||(t.className=t.className+" tooltip-show")}(l),p=l.offsetHeight,h=l.offsetWidth)}),g("mouseout",r,function(){f(l)}),g("mousemove",null,function(t){!1===a.anchorToPoint&&d&&m(t)})}}}(window,document,e),e.plugins.tooltip);var e}).apply(e,i))||(t.exports=o)},45059:function(t,e){var n,i;i=this,void 0===(n=(function(){return i.Chartist=function(){var t={version:"0.11.4"};return function(t,e){"use strict";var n=t.window,i=t.document;e.namespaces={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",ct:"http://gionkunz.github.com/chartist-js/ct"},e.noop=function(t){return t},e.alphaNumerate=function(t){return String.fromCharCode(97+t%26)},e.extend=function(t){var n,i,o;for(t=t||{},n=1;n<arguments.length;n++)for(var s in i=arguments[n])t[s]="object"!=typeof(o=i[s])||null===o||o instanceof Array?o:e.extend(t[s],o);return t},e.replaceAll=function(t,e,n){return t.replace(new RegExp(e,"g"),n)},e.ensureUnit=function(t,e){return"number"==typeof t&&(t+=e),t},e.quantity=function(t){if("string"==typeof t){var e=/^(\d+)\s*(.*)$/g.exec(t);return{value:+e[1],unit:e[2]||void 0}}return{value:t}},e.querySelector=function(t){return t instanceof Node?t:i.querySelector(t)},e.times=function(t){return Array.apply(null,new Array(t))},e.sum=function(t,e){return t+(e||0)},e.mapMultiply=function(t){return function(e){return e*t}},e.mapAdd=function(t){return function(e){return e+t}},e.serialMap=function(t,n){var i=[],o=Math.max.apply(null,t.map(function(t){return t.length}));return e.times(o).forEach(function(e,o){var s=t.map(function(t){return t[o]});i[o]=n.apply(null,s)}),i},e.roundWithPrecision=function(t,n){var i=Math.pow(10,n||e.precision);return Math.round(t*i)/i},e.precision=8,e.escapingMap={"&":"&","<":"<",">":">",'"':""","'":"'"},e.serialize=function(t){return null==t?t:("number"==typeof t?t=""+t:"object"==typeof t&&(t=JSON.stringify({data:t})),Object.keys(e.escapingMap).reduce(function(t,n){return e.replaceAll(t,n,e.escapingMap[n])},t))},e.deserialize=function(t){if("string"!=typeof t)return t;t=Object.keys(e.escapingMap).reduce(function(t,n){return e.replaceAll(t,e.escapingMap[n],n)},t);try{t=void 0!==(t=JSON.parse(t)).data?t.data:t}catch(n){}return t},e.createSvg=function(t,n,i,o){var s;return n=n||"100%",i=i||"100%",Array.prototype.slice.call(t.querySelectorAll("svg")).filter(function(t){return t.getAttributeNS(e.namespaces.xmlns,"ct")}).forEach(function(e){t.removeChild(e)}),(s=new e.Svg("svg").attr({width:n,height:i}).addClass(o))._node.style.width=n,s._node.style.height=i,t.appendChild(s._node),s},e.normalizeData=function(t,n,i){var o,s={raw:t,normalized:{}};return s.normalized.series=e.getDataArray({series:t.series||[]},n,i),o=s.normalized.series.every(function(t){return t instanceof Array})?Math.max.apply(null,s.normalized.series.map(function(t){return t.length})):s.normalized.series.length,s.normalized.labels=(t.labels||[]).slice(),Array.prototype.push.apply(s.normalized.labels,e.times(Math.max(0,o-s.normalized.labels.length)).map(function(){return""})),n&&e.reverseData(s.normalized),s},e.safeHasProperty=function(t,e){return null!==t&&"object"==typeof t&&t.hasOwnProperty(e)},e.isDataHoleValue=function(t){return null==t||"number"==typeof t&&isNaN(t)},e.reverseData=function(t){t.labels.reverse(),t.series.reverse();for(var e=0;e<t.series.length;e++)"object"==typeof t.series[e]&&void 0!==t.series[e].data?t.series[e].data.reverse():t.series[e]instanceof Array&&t.series[e].reverse()},e.getDataArray=function(t,n,i){return t.series.map(function t(n){if(e.safeHasProperty(n,"value"))return t(n.value);if(e.safeHasProperty(n,"data"))return t(n.data);if(n instanceof Array)return n.map(t);if(!e.isDataHoleValue(n)){if(i){var o={};return"string"==typeof i?o[i]=e.getNumberOrUndefined(n):o.y=e.getNumberOrUndefined(n),o.x=n.hasOwnProperty("x")?e.getNumberOrUndefined(n.x):o.x,o.y=n.hasOwnProperty("y")?e.getNumberOrUndefined(n.y):o.y,o}return e.getNumberOrUndefined(n)}})},e.normalizePadding=function(t,e){return e=e||0,"number"==typeof t?{top:t,right:t,bottom:t,left:t}:{top:"number"==typeof t.top?t.top:e,right:"number"==typeof t.right?t.right:e,bottom:"number"==typeof t.bottom?t.bottom:e,left:"number"==typeof t.left?t.left:e}},e.getMetaData=function(t,e){var n=t.data?t.data[e]:t[e];return n?n.meta:void 0},e.orderOfMagnitude=function(t){return Math.floor(Math.log(Math.abs(t))/Math.LN10)},e.projectLength=function(t,e,n){return e/n.range*t},e.getAvailableHeight=function(t,n){return Math.max((e.quantity(n.height).value||t.height())-(n.chartPadding.top+n.chartPadding.bottom)-n.axisX.offset,0)},e.getHighLow=function(t,n,i){var o={high:void 0===(n=e.extend({},n,i?n["axis"+i.toUpperCase()]:{})).high?-Number.MAX_VALUE:+n.high,low:void 0===n.low?Number.MAX_VALUE:+n.low},s=void 0===n.high,a=void 0===n.low;return(s||a)&&function t(e){if(void 0!==e)if(e instanceof Array)for(var n=0;n<e.length;n++)t(e[n]);else{var r=i?+e[i]:+e;s&&r>o.high&&(o.high=r),a&&r<o.low&&(o.low=r)}}(t),(n.referenceValue||0===n.referenceValue)&&(o.high=Math.max(n.referenceValue,o.high),o.low=Math.min(n.referenceValue,o.low)),o.high<=o.low&&(0===o.low?o.high=1:o.low<0?o.high=0:(o.high>0||(o.high=1),o.low=0)),o},e.isNumeric=function(t){return null!==t&&isFinite(t)},e.isFalseyButZero=function(t){return!t&&0!==t},e.getNumberOrUndefined=function(t){return e.isNumeric(t)?+t:void 0},e.isMultiValue=function(t){return"object"==typeof t&&("x"in t||"y"in t)},e.getMultiValue=function(t,n){return e.isMultiValue(t)?e.getNumberOrUndefined(t[n||"y"]):e.getNumberOrUndefined(t)},e.rho=function(t){if(1===t)return t;function e(t,n){return t%n==0?n:e(n,t%n)}function n(t){return t*t+1}var i,o=2,s=2;if(t%2==0)return 2;do{o=n(o)%t,s=n(n(s))%t,i=e(Math.abs(o-s),t)}while(1===i);return i},e.getBounds=function(t,n,i,o){var s,a,r,l=0,c={high:n.high,low:n.low};c.valueRange=c.high-c.low,c.oom=e.orderOfMagnitude(c.valueRange),c.step=Math.pow(10,c.oom),c.min=Math.floor(c.low/c.step)*c.step,c.max=Math.ceil(c.high/c.step)*c.step,c.range=c.max-c.min,c.numberOfSteps=Math.round(c.range/c.step);var d=e.projectLength(t,c.step,c)<i,u=o?e.rho(c.range):0;if(o&&e.projectLength(t,1,c)>=i)c.step=1;else if(o&&u<c.step&&e.projectLength(t,u,c)>=i)c.step=u;else for(;;){if(d&&e.projectLength(t,c.step,c)<=i)c.step*=2;else{if(d||!(e.projectLength(t,c.step/2,c)>=i))break;if(c.step/=2,o&&c.step%1!=0){c.step*=2;break}}if(l++>1e3)throw new Error("Exceeded maximum number of iterations while optimizing scale step!")}function p(t,e){return t===(t+=e)&&(t*=1+(e>0?2221e-19:-2221e-19)),t}for(c.step=Math.max(c.step,2221e-19),a=c.min,r=c.max;a+c.step<=c.low;)a=p(a,c.step);for(;r-c.step>=c.high;)r=p(r,-c.step);c.min=a,c.max=r,c.range=c.max-c.min;var h=[];for(s=c.min;s<=c.max;s=p(s,c.step)){var g=e.roundWithPrecision(s);g!==h[h.length-1]&&h.push(g)}return c.values=h,c},e.polarToCartesian=function(t,e,n,i){var o=(i-90)*Math.PI/180;return{x:t+n*Math.cos(o),y:e+n*Math.sin(o)}},e.createChartRect=function(t,n,i){var o=!(!n.axisX&&!n.axisY),s=o?n.axisY.offset:0,a=o?n.axisX.offset:0,r=t.width()||e.quantity(n.width).value||0,l=t.height()||e.quantity(n.height).value||0,c=e.normalizePadding(n.chartPadding,i);r=Math.max(r,s+c.left+c.right),l=Math.max(l,a+c.top+c.bottom);var d={padding:c,width:function(){return this.x2-this.x1},height:function(){return this.y1-this.y2}};return o?("start"===n.axisX.position?(d.y2=c.top+a,d.y1=Math.max(l-c.bottom,d.y2+1)):(d.y2=c.top,d.y1=Math.max(l-c.bottom-a,d.y2+1)),"start"===n.axisY.position?(d.x1=c.left+s,d.x2=Math.max(r-c.right,d.x1+1)):(d.x1=c.left,d.x2=Math.max(r-c.right-s,d.x1+1))):(d.x1=c.left,d.x2=Math.max(r-c.right,d.x1+1),d.y2=c.top,d.y1=Math.max(l-c.bottom,d.y2+1)),d},e.createGrid=function(t,n,i,o,s,a,r,l){var c={};c[i.units.pos+"1"]=t,c[i.units.pos+"2"]=t,c[i.counterUnits.pos+"1"]=o,c[i.counterUnits.pos+"2"]=o+s;var d=a.elem("line",c,r.join(" "));l.emit("draw",e.extend({type:"grid",axis:i,index:n,group:a,element:d},c))},e.createGridBackground=function(t,e,n,i){var o=t.elem("rect",{x:e.x1,y:e.y2,width:e.width(),height:e.height()},n,!0);i.emit("draw",{type:"gridBackground",group:t,element:o})},e.createLabel=function(t,n,o,s,a,r,l,c,d,u,p){var h,g={};if(g[a.units.pos]=t+l[a.units.pos],g[a.counterUnits.pos]=l[a.counterUnits.pos],g[a.units.len]=n,g[a.counterUnits.len]=Math.max(0,r-10),u){var m=i.createElement("span");m.className=d.join(" "),m.setAttribute("xmlns",e.namespaces.xhtml),m.innerText=s[o],m.style[a.units.len]=Math.round(g[a.units.len])+"px",m.style[a.counterUnits.len]=Math.round(g[a.counterUnits.len])+"px",h=c.foreignObject(m,e.extend({style:"overflow: visible;"},g))}else h=c.elem("text",g,d.join(" ")).text(s[o]);p.emit("draw",e.extend({type:"label",axis:a,index:o,group:c,element:h,text:s[o]},g))},e.getSeriesOption=function(t,e,n){if(t.name&&e.series&&e.series[t.name]){var i=e.series[t.name];return i.hasOwnProperty(n)?i[n]:e[n]}return e[n]},e.optionsProvider=function(t,i,o){var s,a,r=e.extend({},t),l=[];function c(t){var l=s;if(s=e.extend({},r),i)for(a=0;a<i.length;a++)n.matchMedia(i[a][0]).matches&&(s=e.extend(s,i[a][1]));o&&t&&o.emit("optionsChanged",{previousOptions:l,currentOptions:s})}if(!n.matchMedia)throw"window.matchMedia not found! Make sure you're using a polyfill.";if(i)for(a=0;a<i.length;a++){var d=n.matchMedia(i[a][0]);d.addListener(c),l.push(d)}return c(),{removeMediaQueryListeners:function(){l.forEach(function(t){t.removeListener(c)})},getCurrentOptions:function(){return e.extend({},s)}}},e.splitIntoSegments=function(t,n,i){i=e.extend({},{increasingX:!1,fillHoles:!1},i);for(var o=[],s=!0,a=0;a<t.length;a+=2)void 0===e.getMultiValue(n[a/2].value)?i.fillHoles||(s=!0):(i.increasingX&&a>=2&&t[a]<=t[a-2]&&(s=!0),s&&(o.push({pathCoordinates:[],valueData:[]}),s=!1),o[o.length-1].pathCoordinates.push(t[a],t[a+1]),o[o.length-1].valueData.push(n[a/2]));return o}}(this||global,t),function(t,e){"use strict";e.Interpolation={},e.Interpolation.none=function(t){return t=e.extend({},{fillHoles:!1},t),function(n,i){for(var o=new e.Svg.Path,s=!0,a=0;a<n.length;a+=2){var r=n[a],l=n[a+1],c=i[a/2];void 0!==e.getMultiValue(c.value)?(s?o.move(r,l,!1,c):o.line(r,l,!1,c),s=!1):t.fillHoles||(s=!0)}return o}},e.Interpolation.simple=function(t){t=e.extend({},{divisor:2,fillHoles:!1},t);var n=1/Math.max(1,t.divisor);return function(i,o){for(var s,a,r,l=new e.Svg.Path,c=0;c<i.length;c+=2){var d=i[c],u=i[c+1],p=(d-s)*n,h=o[c/2];void 0!==h.value?(void 0===r?l.move(d,u,!1,h):l.curve(s+p,a,d-p,u,d,u,!1,h),s=d,a=u,r=h):t.fillHoles||(s=d=r=void 0)}return l}},e.Interpolation.cardinal=function(t){t=e.extend({},{tension:1,fillHoles:!1},t);var n=Math.min(1,Math.max(0,t.tension)),i=1-n;return function o(s,a){var r=e.splitIntoSegments(s,a,{fillHoles:t.fillHoles});if(r.length){if(r.length>1){var l=[];return r.forEach(function(t){l.push(o(t.pathCoordinates,t.valueData))}),e.Svg.Path.join(l)}if(a=r[0].valueData,(s=r[0].pathCoordinates).length<=4)return e.Interpolation.none()(s,a);for(var c=(new e.Svg.Path).move(s[0],s[1],!1,a[0]),d=0,u=s.length;u-2>d;d+=2){var p=[{x:+s[d-2],y:+s[d-1]},{x:+s[d],y:+s[d+1]},{x:+s[d+2],y:+s[d+3]},{x:+s[d+4],y:+s[d+5]}];u-4===d?p[3]=p[2]:d||(p[0]={x:+s[d],y:+s[d+1]}),c.curve(n*(6*p[1].x-p[0].x+p[2].x)/6+i*p[2].x,n*(6*p[1].y-p[0].y+p[2].y)/6+i*p[2].y,n*(p[1].x+6*p[2].x-p[3].x)/6+i*p[2].x,n*(p[1].y+6*p[2].y-p[3].y)/6+i*p[2].y,p[2].x,p[2].y,!1,a[(d+2)/2])}return c}return e.Interpolation.none()([])}},e.Interpolation.monotoneCubic=function(t){return t=e.extend({},{fillHoles:!1},t),function n(i,o){var s=e.splitIntoSegments(i,o,{fillHoles:t.fillHoles,increasingX:!0});if(s.length){if(s.length>1){var a=[];return s.forEach(function(t){a.push(n(t.pathCoordinates,t.valueData))}),e.Svg.Path.join(a)}if(o=s[0].valueData,(i=s[0].pathCoordinates).length<=4)return e.Interpolation.none()(i,o);var r,l,c=[],d=[],u=i.length/2,p=[],h=[],g=[],m=[];for(r=0;r<u;r++)c[r]=i[2*r],d[r]=i[2*r+1];for(r=0;r<u-1;r++)g[r]=d[r+1]-d[r],m[r]=c[r+1]-c[r],h[r]=g[r]/m[r];for(p[0]=h[0],p[u-1]=h[u-2],r=1;r<u-1;r++)0===h[r]||0===h[r-1]||h[r-1]>0!=h[r]>0?p[r]=0:(p[r]=3*(m[r-1]+m[r])/((2*m[r]+m[r-1])/h[r-1]+(m[r]+2*m[r-1])/h[r]),isFinite(p[r])||(p[r]=0));for(l=(new e.Svg.Path).move(c[0],d[0],!1,o[0]),r=0;r<u-1;r++)l.curve(c[r]+m[r]/3,d[r]+p[r]*m[r]/3,c[r+1]-m[r]/3,d[r+1]-p[r+1]*m[r]/3,c[r+1],d[r+1],!1,o[r+1]);return l}return e.Interpolation.none()([])}},e.Interpolation.step=function(t){return t=e.extend({},{postpone:!0,fillHoles:!1},t),function(n,i){for(var o,s,a,r=new e.Svg.Path,l=0;l<n.length;l+=2){var c=n[l],d=n[l+1],u=i[l/2];void 0!==u.value?(void 0===a?r.move(c,d,!1,u):(t.postpone?r.line(c,s,!1,a):r.line(o,d,!1,u),r.line(c,d,!1,u)),o=c,s=d,a=u):t.fillHoles||(o=s=a=void 0)}return r}}}(this||global,t),function(t,e){"use strict";e.EventEmitter=function(){var t=[];return{addEventHandler:function(e,n){t[e]=t[e]||[],t[e].push(n)},removeEventHandler:function(e,n){t[e]&&(n?(t[e].splice(t[e].indexOf(n),1),0===t[e].length&&delete t[e]):delete t[e])},emit:function(e,n){t[e]&&t[e].forEach(function(t){t(n)}),t["*"]&&t["*"].forEach(function(t){t(e,n)})}}}}(this||global,t),function(t,e){"use strict";function n(t){var e=[];if(t.length)for(var n=0;n<t.length;n++)e.push(t[n]);return e}e.Class={extend:function(t,n){var i=n||this.prototype||e.Class,o=Object.create(i);e.Class.cloneDefinitions(o,t);var s=function(){var t,n=o.constructor||function(){};return t=this===e?Object.create(o):this,n.apply(t,Array.prototype.slice.call(arguments,0)),t};return s.prototype=o,s.super=i,s.extend=this.extend,s},cloneDefinitions:function(){var t=n(arguments),e=t[0];return t.splice(1,t.length-1).forEach(function(t){Object.getOwnPropertyNames(t).forEach(function(n){delete e[n],Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}),e}}}(this||global,t),function(t,e){"use strict";var n=t.window;function i(){n.addEventListener("resize",this.resizeListener),this.optionsProvider=e.optionsProvider(this.options,this.responsiveOptions,this.eventEmitter),this.eventEmitter.addEventHandler("optionsChanged",(function(){this.update()}).bind(this)),this.options.plugins&&this.options.plugins.forEach((function(t){t instanceof Array?t[0](this,t[1]):t(this)}).bind(this)),this.eventEmitter.emit("data",{type:"initial",data:this.data}),this.createChart(this.optionsProvider.getCurrentOptions()),this.initializeTimeoutId=void 0}e.Base=e.Class.extend({constructor:function(t,n,o,s,a){this.container=e.querySelector(t),this.data=n||{},this.data.labels=this.data.labels||[],this.data.series=this.data.series||[],this.defaultOptions=o,this.options=s,this.responsiveOptions=a,this.eventEmitter=e.EventEmitter(),this.supportsForeignObject=e.Svg.isSupported("Extensibility"),this.supportsAnimations=e.Svg.isSupported("AnimationEventsAttribute"),this.resizeListener=(function(){this.update()}).bind(this),this.container&&(this.container.__chartist__&&this.container.__chartist__.detach(),this.container.__chartist__=this),this.initializeTimeoutId=setTimeout(i.bind(this),0)},optionsProvider:void 0,container:void 0,svg:void 0,eventEmitter:void 0,createChart:function(){throw new Error("Base chart type can't be instantiated!")},update:function(t,n,i){return t&&(this.data=t||{},this.data.labels=this.data.labels||[],this.data.series=this.data.series||[],this.eventEmitter.emit("data",{type:"update",data:this.data})),n&&(this.options=e.extend({},i?this.options:this.defaultOptions,n),this.initializeTimeoutId||(this.optionsProvider.removeMediaQueryListeners(),this.optionsProvider=e.optionsProvider(this.options,this.responsiveOptions,this.eventEmitter))),this.initializeTimeoutId||this.createChart(this.optionsProvider.getCurrentOptions()),this},detach:function(){return this.initializeTimeoutId?n.clearTimeout(this.initializeTimeoutId):(n.removeEventListener("resize",this.resizeListener),this.optionsProvider.removeMediaQueryListeners()),this},on:function(t,e){return this.eventEmitter.addEventHandler(t,e),this},off:function(t,e){return this.eventEmitter.removeEventHandler(t,e),this},version:e.version,supportsForeignObject:!1})}(this||global,t),function(t,e){"use strict";var n=t.document;e.Svg=e.Class.extend({constructor:function(t,i,o,s,a){t instanceof Element?this._node=t:(this._node=n.createElementNS(e.namespaces.svg,t),"svg"===t&&this.attr({"xmlns:ct":e.namespaces.ct})),i&&this.attr(i),o&&this.addClass(o),s&&(a&&s._node.firstChild?s._node.insertBefore(this._node,s._node.firstChild):s._node.appendChild(this._node))},attr:function(t,n){return"string"==typeof t?n?this._node.getAttributeNS(n,t):this._node.getAttribute(t):(Object.keys(t).forEach((function(n){if(void 0!==t[n])if(-1!==n.indexOf(":")){var i=n.split(":");this._node.setAttributeNS(e.namespaces[i[0]],n,t[n])}else this._node.setAttribute(n,t[n])}).bind(this)),this)},elem:function(t,n,i,o){return new e.Svg(t,n,i,this,o)},parent:function(){return this._node.parentNode instanceof SVGElement?new e.Svg(this._node.parentNode):null},root:function(){for(var t=this._node;"svg"!==t.nodeName;)t=t.parentNode;return new e.Svg(t)},querySelector:function(t){var n=this._node.querySelector(t);return n?new e.Svg(n):null},querySelectorAll:function(t){var n=this._node.querySelectorAll(t);return n.length?new e.Svg.List(n):null},getNode:function(){return this._node},foreignObject:function(t,i,o,s){if("string"==typeof t){var a=n.createElement("div");a.innerHTML=t,t=a.firstChild}t.setAttribute("xmlns",e.namespaces.xmlns);var r=this.elem("foreignObject",i,o,s);return r._node.appendChild(t),r},text:function(t){return this._node.appendChild(n.createTextNode(t)),this},empty:function(){for(;this._node.firstChild;)this._node.removeChild(this._node.firstChild);return this},remove:function(){return this._node.parentNode.removeChild(this._node),this.parent()},replace:function(t){return this._node.parentNode.replaceChild(t._node,this._node),t},append:function(t,e){return e&&this._node.firstChild?this._node.insertBefore(t._node,this._node.firstChild):this._node.appendChild(t._node),this},classes:function(){return this._node.getAttribute("class")?this._node.getAttribute("class").trim().split(/\s+/):[]},addClass:function(t){return this._node.setAttribute("class",this.classes(this._node).concat(t.trim().split(/\s+/)).filter(function(t,e,n){return n.indexOf(t)===e}).join(" ")),this},removeClass:function(t){var e=t.trim().split(/\s+/);return this._node.setAttribute("class",this.classes(this._node).filter(function(t){return-1===e.indexOf(t)}).join(" ")),this},removeAllClasses:function(){return this._node.setAttribute("class",""),this},height:function(){return this._node.getBoundingClientRect().height},width:function(){return this._node.getBoundingClientRect().width},animate:function(t,n,i){return void 0===n&&(n=!0),Object.keys(t).forEach((function(o){function s(t,n){var s,a,r,l={};t.easing&&(r=t.easing instanceof Array?t.easing:e.Svg.Easing[t.easing],delete t.easing),t.begin=e.ensureUnit(t.begin,"ms"),t.dur=e.ensureUnit(t.dur,"ms"),r&&(t.calcMode="spline",t.keySplines=r.join(" "),t.keyTimes="0;1"),n&&(t.fill="freeze",l[o]=t.from,this.attr(l),a=e.quantity(t.begin||0).value,t.begin="indefinite"),s=this.elem("animate",e.extend({attributeName:o},t)),n&&setTimeout((function(){try{s._node.beginElement()}catch(e){l[o]=t.to,this.attr(l),s.remove()}}).bind(this),a),i&&s._node.addEventListener("beginEvent",(function(){i.emit("animationBegin",{element:this,animate:s._node,params:t})}).bind(this)),s._node.addEventListener("endEvent",(function(){i&&i.emit("animationEnd",{element:this,animate:s._node,params:t}),n&&(l[o]=t.to,this.attr(l),s.remove())}).bind(this))}t[o]instanceof Array?t[o].forEach((function(t){s.bind(this)(t,!1)}).bind(this)):s.bind(this)(t[o],n)}).bind(this)),this}}),e.Svg.isSupported=function(t){return n.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#"+t,"1.1")},e.Svg.Easing={easeInSine:[.47,0,.745,.715],easeOutSine:[.39,.575,.565,1],easeInOutSine:[.445,.05,.55,.95],easeInQuad:[.55,.085,.68,.53],easeOutQuad:[.25,.46,.45,.94],easeInOutQuad:[.455,.03,.515,.955],easeInCubic:[.55,.055,.675,.19],easeOutCubic:[.215,.61,.355,1],easeInOutCubic:[.645,.045,.355,1],easeInQuart:[.895,.03,.685,.22],easeOutQuart:[.165,.84,.44,1],easeInOutQuart:[.77,0,.175,1],easeInQuint:[.755,.05,.855,.06],easeOutQuint:[.23,1,.32,1],easeInOutQuint:[.86,0,.07,1],easeInExpo:[.95,.05,.795,.035],easeOutExpo:[.19,1,.22,1],easeInOutExpo:[1,0,0,1],easeInCirc:[.6,.04,.98,.335],easeOutCirc:[.075,.82,.165,1],easeInOutCirc:[.785,.135,.15,.86],easeInBack:[.6,-.28,.735,.045],easeOutBack:[.175,.885,.32,1.275],easeInOutBack:[.68,-.55,.265,1.55]},e.Svg.List=e.Class.extend({constructor:function(t){var n=this;this.svgElements=[];for(var i=0;i<t.length;i++)this.svgElements.push(new e.Svg(t[i]));Object.keys(e.Svg.prototype).filter(function(t){return-1===["constructor","parent","querySelector","querySelectorAll","replace","append","classes","height","width"].indexOf(t)}).forEach(function(t){n[t]=function(){var i=Array.prototype.slice.call(arguments,0);return n.svgElements.forEach(function(n){e.Svg.prototype[t].apply(n,i)}),n}})}})}(this||global,t),function(t,e){"use strict";var n={m:["x","y"],l:["x","y"],c:["x1","y1","x2","y2","x","y"],a:["rx","ry","xAr","lAf","sf","x","y"]},i={accuracy:3};function o(t,n,i,o,s,a){var r=e.extend({command:s?t.toLowerCase():t.toUpperCase()},n,a?{data:a}:{});i.splice(o,0,r)}function s(t,e){t.forEach(function(i,o){n[i.command.toLowerCase()].forEach(function(n,s){e(i,n,o,s,t)})})}e.Svg.Path=e.Class.extend({constructor:function(t,n){this.pathElements=[],this.pos=0,this.close=t,this.options=e.extend({},i,n)},position:function(t){return void 0!==t?(this.pos=Math.max(0,Math.min(this.pathElements.length,t)),this):this.pos},remove:function(t){return this.pathElements.splice(this.pos,t),this},move:function(t,e,n,i){return o("M",{x:+t,y:+e},this.pathElements,this.pos++,n,i),this},line:function(t,e,n,i){return o("L",{x:+t,y:+e},this.pathElements,this.pos++,n,i),this},curve:function(t,e,n,i,s,a,r,l){return o("C",{x1:+t,y1:+e,x2:+n,y2:+i,x:+s,y:+a},this.pathElements,this.pos++,r,l),this},arc:function(t,e,n,i,s,a,r,l,c){return o("A",{rx:+t,ry:+e,xAr:+n,lAf:+i,sf:+s,x:+a,y:+r},this.pathElements,this.pos++,l,c),this},scale:function(t,e){return s(this.pathElements,function(n,i){n[i]*="x"===i[0]?t:e}),this},translate:function(t,e){return s(this.pathElements,function(n,i){n[i]+="x"===i[0]?t:e}),this},transform:function(t){return s(this.pathElements,function(e,n,i,o,s){var a=t(e,n,i,o,s);(a||0===a)&&(e[n]=a)}),this},parse:function(t){var i=t.replace(/([A-Za-z])([0-9])/g,"$1 $2").replace(/([0-9])([A-Za-z])/g,"$1 $2").split(/[\s,]+/).reduce(function(t,e){return e.match(/[A-Za-z]/)&&t.push([]),t[t.length-1].push(e),t},[]);"Z"===i[i.length-1][0].toUpperCase()&&i.pop();var o=i.map(function(t){var i=t.shift(),o=n[i.toLowerCase()];return e.extend({command:i},o.reduce(function(e,n,i){return e[n]=+t[i],e},{}))}),s=[this.pos,0];return Array.prototype.push.apply(s,o),Array.prototype.splice.apply(this.pathElements,s),this.pos+=o.length,this},stringify:function(){var t=Math.pow(10,this.options.accuracy);return this.pathElements.reduce((function(e,i){var o=n[i.command.toLowerCase()].map((function(e){return this.options.accuracy?Math.round(i[e]*t)/t:i[e]}).bind(this));return e+i.command+o.join(",")}).bind(this),"")+(this.close?"Z":"")},clone:function(t){var n=new e.Svg.Path(t||this.close);return n.pos=this.pos,n.pathElements=this.pathElements.slice().map(function(t){return e.extend({},t)}),n.options=e.extend({},this.options),n},splitByCommand:function(t){var n=[new e.Svg.Path];return this.pathElements.forEach(function(i){i.command===t.toUpperCase()&&0!==n[n.length-1].pathElements.length&&n.push(new e.Svg.Path),n[n.length-1].pathElements.push(i)}),n}}),e.Svg.Path.elementDescriptions=n,e.Svg.Path.join=function(t,n,i){for(var o=new e.Svg.Path(n,i),s=0;s<t.length;s++)for(var a=t[s],r=0;r<a.pathElements.length;r++)o.pathElements.push(a.pathElements[r]);return o}}(this||global,t),function(t,e){"use strict";var n={x:{pos:"x",len:"width",dir:"horizontal",rectStart:"x1",rectEnd:"x2",rectOffset:"y2"},y:{pos:"y",len:"height",dir:"vertical",rectStart:"y2",rectEnd:"y1",rectOffset:"x1"}};e.Axis=e.Class.extend({constructor:function(t,e,i,o){this.units=t,this.counterUnits=t===n.x?n.y:n.x,this.chartRect=e,this.axisLength=e[t.rectEnd]-e[t.rectStart],this.gridOffset=e[t.rectOffset],this.ticks=i,this.options=o},createGridAndLabels:function(t,n,i,o,s){var a=o["axis"+this.units.pos.toUpperCase()],r=this.ticks.map(this.projectValue.bind(this)),l=this.ticks.map(a.labelInterpolationFnc);r.forEach((function(c,d){var u,p={x:0,y:0};u=r[d+1]?r[d+1]-c:Math.max(this.axisLength-c,30),e.isFalseyButZero(l[d])&&""!==l[d]||("x"===this.units.pos?(c=this.chartRect.x1+c,p.x=o.axisX.labelOffset.x,p.y="start"===o.axisX.position?this.chartRect.padding.top+o.axisX.labelOffset.y+(i?5:20):this.chartRect.y1+o.axisX.labelOffset.y+(i?5:20)):(c=this.chartRect.y1-c,p.y=o.axisY.labelOffset.y-(i?u:0),p.x="start"===o.axisY.position?i?this.chartRect.padding.left+o.axisY.labelOffset.x:this.chartRect.x1-10:this.chartRect.x2+o.axisY.labelOffset.x+10),a.showGrid&&e.createGrid(c,d,this,this.gridOffset,this.chartRect[this.counterUnits.len](),t,[o.classNames.grid,o.classNames[this.units.dir]],s),a.showLabel&&e.createLabel(c,u,d,l,this,a.offset,p,n,[o.classNames.label,o.classNames[this.units.dir],"start"===a.position?o.classNames[a.position]:o.classNames.end],i,s))}).bind(this))},projectValue:function(t,e,n){throw new Error("Base axis can't be instantiated!")}}),e.Axis.units=n}(this||global,t),function(t,e){"use strict";e.AutoScaleAxis=e.Axis.extend({constructor:function(t,n,i,o){var s=o.highLow||e.getHighLow(n,o,t.pos);this.bounds=e.getBounds(i[t.rectEnd]-i[t.rectStart],s,o.scaleMinSpace||20,o.onlyInteger),this.range={min:this.bounds.min,max:this.bounds.max},e.AutoScaleAxis.super.constructor.call(this,t,i,this.bounds.values,o)},projectValue:function(t){return this.axisLength*(+e.getMultiValue(t,this.units.pos)-this.bounds.min)/this.bounds.range}})}(this||global,t),function(t,e){"use strict";e.FixedScaleAxis=e.Axis.extend({constructor:function(t,n,i,o){var s=o.highLow||e.getHighLow(n,o,t.pos);this.divisor=o.divisor||1,this.ticks=o.ticks||e.times(this.divisor).map((function(t,e){return s.low+(s.high-s.low)/this.divisor*e}).bind(this)),this.ticks.sort(function(t,e){return t-e}),this.range={min:s.low,max:s.high},e.FixedScaleAxis.super.constructor.call(this,t,i,this.ticks,o),this.stepLength=this.axisLength/this.divisor},projectValue:function(t){return this.axisLength*(+e.getMultiValue(t,this.units.pos)-this.range.min)/(this.range.max-this.range.min)}})}(this||global,t),function(t,e){"use strict";e.StepAxis=e.Axis.extend({constructor:function(t,n,i,o){e.StepAxis.super.constructor.call(this,t,i,o.ticks,o);var s=Math.max(1,o.ticks.length-(o.stretch?1:0));this.stepLength=this.axisLength/s},projectValue:function(t,e){return this.stepLength*e}})}(this||global,t),function(t,e){"use strict";var n={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:e.noop,type:void 0},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:e.noop,type:void 0,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,showLine:!0,showPoint:!0,showArea:!1,areaBase:0,lineSmooth:!0,showGridBackground:!1,low:void 0,high:void 0,chartPadding:{top:15,right:15,bottom:5,left:10},fullWidth:!1,reverseData:!1,classNames:{chart:"ct-chart-line",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",line:"ct-line",point:"ct-point",area:"ct-area",grid:"ct-grid",gridGroup:"ct-grids",gridBackground:"ct-grid-background",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};e.Line=e.Base.extend({constructor:function(t,i,o,s){e.Line.super.constructor.call(this,t,i,n,e.extend({},n,o),s)},createChart:function(t){var i=e.normalizeData(this.data,t.reverseData,!0);this.svg=e.createSvg(this.container,t.width,t.height,t.classNames.chart);var o,s,a=this.svg.elem("g").addClass(t.classNames.gridGroup),r=this.svg.elem("g"),l=this.svg.elem("g").addClass(t.classNames.labelGroup),c=e.createChartRect(this.svg,t,n.padding);o=void 0===t.axisX.type?new e.StepAxis(e.Axis.units.x,i.normalized.series,c,e.extend({},t.axisX,{ticks:i.normalized.labels,stretch:t.fullWidth})):t.axisX.type.call(e,e.Axis.units.x,i.normalized.series,c,t.axisX),s=void 0===t.axisY.type?new e.AutoScaleAxis(e.Axis.units.y,i.normalized.series,c,e.extend({},t.axisY,{high:e.isNumeric(t.high)?t.high:t.axisY.high,low:e.isNumeric(t.low)?t.low:t.axisY.low})):t.axisY.type.call(e,e.Axis.units.y,i.normalized.series,c,t.axisY),o.createGridAndLabels(a,l,this.supportsForeignObject,t,this.eventEmitter),s.createGridAndLabels(a,l,this.supportsForeignObject,t,this.eventEmitter),t.showGridBackground&&e.createGridBackground(a,c,t.classNames.gridBackground,this.eventEmitter),i.raw.series.forEach((function(n,a){var l=r.elem("g");l.attr({"ct:series-name":n.name,"ct:meta":e.serialize(n.meta)}),l.addClass([t.classNames.series,n.className||t.classNames.series+"-"+e.alphaNumerate(a)].join(" "));var d=[],u=[];i.normalized.series[a].forEach((function(t,r){var l={x:c.x1+o.projectValue(t,r,i.normalized.series[a]),y:c.y1-s.projectValue(t,r,i.normalized.series[a])};d.push(l.x,l.y),u.push({value:t,valueIndex:r,meta:e.getMetaData(n,r)})}).bind(this));var p={lineSmooth:e.getSeriesOption(n,t,"lineSmooth"),showPoint:e.getSeriesOption(n,t,"showPoint"),showLine:e.getSeriesOption(n,t,"showLine"),showArea:e.getSeriesOption(n,t,"showArea"),areaBase:e.getSeriesOption(n,t,"areaBase")},h=("function"==typeof p.lineSmooth?p.lineSmooth:p.lineSmooth?e.Interpolation.monotoneCubic():e.Interpolation.none())(d,u);if(p.showPoint&&h.pathElements.forEach((function(i){var r=l.elem("line",{x1:i.x,y1:i.y,x2:i.x+.01,y2:i.y},t.classNames.point).attr({"ct:value":[i.data.value.x,i.data.value.y].filter(e.isNumeric).join(","),"ct:meta":e.serialize(i.data.meta)});this.eventEmitter.emit("draw",{type:"point",value:i.data.value,index:i.data.valueIndex,meta:i.data.meta,series:n,seriesIndex:a,axisX:o,axisY:s,group:l,element:r,x:i.x,y:i.y})}).bind(this)),p.showLine){var g=l.elem("path",{d:h.stringify()},t.classNames.line,!0);this.eventEmitter.emit("draw",{type:"line",values:i.normalized.series[a],path:h.clone(),chartRect:c,index:a,series:n,seriesIndex:a,seriesMeta:n.meta,axisX:o,axisY:s,group:l,element:g})}if(p.showArea&&s.range){var m=Math.max(Math.min(p.areaBase,s.range.max),s.range.min),f=c.y1-s.projectValue(m);h.splitByCommand("M").filter(function(t){return t.pathElements.length>1}).map(function(t){var e=t.pathElements[0],n=t.pathElements[t.pathElements.length-1];return t.clone(!0).position(0).remove(1).move(e.x,f).line(e.x,e.y).position(t.pathElements.length+1).line(n.x,f)}).forEach((function(e){var r=l.elem("path",{d:e.stringify()},t.classNames.area,!0);this.eventEmitter.emit("draw",{type:"area",values:i.normalized.series[a],path:e.clone(),series:n,seriesIndex:a,axisX:o,axisY:s,chartRect:c,index:a,group:l,element:r})}).bind(this))}}).bind(this)),this.eventEmitter.emit("created",{bounds:s.bounds,chartRect:c,axisX:o,axisY:s,svg:this.svg,options:t})}})}(this||global,t),function(t,e){"use strict";var n={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:e.noop,scaleMinSpace:30,onlyInteger:!1},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:e.noop,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,high:void 0,low:void 0,referenceValue:0,chartPadding:{top:15,right:15,bottom:5,left:10},seriesBarDistance:15,stackBars:!1,stackMode:"accumulate",horizontalBars:!1,distributeSeries:!1,reverseData:!1,showGridBackground:!1,classNames:{chart:"ct-chart-bar",horizontalBars:"ct-horizontal-bars",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",bar:"ct-bar",grid:"ct-grid",gridGroup:"ct-grids",gridBackground:"ct-grid-background",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};e.Bar=e.Base.extend({constructor:function(t,i,o,s){e.Bar.super.constructor.call(this,t,i,n,e.extend({},n,o),s)},createChart:function(t){var i,o;t.distributeSeries?(i=e.normalizeData(this.data,t.reverseData,t.horizontalBars?"x":"y")).normalized.series=i.normalized.series.map(function(t){return[t]}):i=e.normalizeData(this.data,t.reverseData,t.horizontalBars?"x":"y"),this.svg=e.createSvg(this.container,t.width,t.height,t.classNames.chart+(t.horizontalBars?" "+t.classNames.horizontalBars:""));var s=this.svg.elem("g").addClass(t.classNames.gridGroup),a=this.svg.elem("g"),r=this.svg.elem("g").addClass(t.classNames.labelGroup);if(t.stackBars&&0!==i.normalized.series.length){var l=e.serialMap(i.normalized.series,function(){return Array.prototype.slice.call(arguments).map(function(t){return t}).reduce(function(t,e){return{x:t.x+(e&&e.x)||0,y:t.y+(e&&e.y)||0}},{x:0,y:0})});o=e.getHighLow([l],t,t.horizontalBars?"x":"y")}else o=e.getHighLow(i.normalized.series,t,t.horizontalBars?"x":"y");o.high=+t.high||(0===t.high?0:o.high),o.low=+t.low||(0===t.low?0:o.low);var c,d,u,p,h,g=e.createChartRect(this.svg,t,n.padding);d=t.distributeSeries&&t.stackBars?i.normalized.labels.slice(0,1):i.normalized.labels,t.horizontalBars?(c=p=void 0===t.axisX.type?new e.AutoScaleAxis(e.Axis.units.x,i.normalized.series,g,e.extend({},t.axisX,{highLow:o,referenceValue:0})):t.axisX.type.call(e,e.Axis.units.x,i.normalized.series,g,e.extend({},t.axisX,{highLow:o,referenceValue:0})),u=h=void 0===t.axisY.type?new e.StepAxis(e.Axis.units.y,i.normalized.series,g,{ticks:d}):t.axisY.type.call(e,e.Axis.units.y,i.normalized.series,g,t.axisY)):(u=p=void 0===t.axisX.type?new e.StepAxis(e.Axis.units.x,i.normalized.series,g,{ticks:d}):t.axisX.type.call(e,e.Axis.units.x,i.normalized.series,g,t.axisX),c=h=void 0===t.axisY.type?new e.AutoScaleAxis(e.Axis.units.y,i.normalized.series,g,e.extend({},t.axisY,{highLow:o,referenceValue:0})):t.axisY.type.call(e,e.Axis.units.y,i.normalized.series,g,e.extend({},t.axisY,{highLow:o,referenceValue:0})));var m=t.horizontalBars?g.x1+c.projectValue(0):g.y1-c.projectValue(0),f=[];u.createGridAndLabels(s,r,this.supportsForeignObject,t,this.eventEmitter),c.createGridAndLabels(s,r,this.supportsForeignObject,t,this.eventEmitter),t.showGridBackground&&e.createGridBackground(s,g,t.classNames.gridBackground,this.eventEmitter),i.raw.series.forEach((function(n,o){var s,r,l=o-(i.raw.series.length-1)/2;s=t.distributeSeries&&!t.stackBars?u.axisLength/i.normalized.series.length/2:t.distributeSeries&&t.stackBars?u.axisLength/2:u.axisLength/i.normalized.series[o].length/2,(r=a.elem("g")).attr({"ct:series-name":n.name,"ct:meta":e.serialize(n.meta)}),r.addClass([t.classNames.series,n.className||t.classNames.series+"-"+e.alphaNumerate(o)].join(" ")),i.normalized.series[o].forEach((function(a,d){var b,v,_,x;if(x=t.distributeSeries&&!t.stackBars?o:t.distributeSeries&&t.stackBars?0:d,b=t.horizontalBars?{x:g.x1+c.projectValue(a&&a.x?a.x:0,d,i.normalized.series[o]),y:g.y1-u.projectValue(a&&a.y?a.y:0,x,i.normalized.series[o])}:{x:g.x1+u.projectValue(a&&a.x?a.x:0,x,i.normalized.series[o]),y:g.y1-c.projectValue(a&&a.y?a.y:0,d,i.normalized.series[o])},u instanceof e.StepAxis&&(u.options.stretch||(b[u.units.pos]+=s*(t.horizontalBars?-1:1)),b[u.units.pos]+=t.stackBars||t.distributeSeries?0:l*t.seriesBarDistance*(t.horizontalBars?-1:1)),f[d]=(_=f[d]||m)-(m-b[u.counterUnits.pos]),void 0!==a){var Z={};Z[u.units.pos+"1"]=b[u.units.pos],Z[u.units.pos+"2"]=b[u.units.pos],!t.stackBars||"accumulate"!==t.stackMode&&t.stackMode?(Z[u.counterUnits.pos+"1"]=m,Z[u.counterUnits.pos+"2"]=b[u.counterUnits.pos]):(Z[u.counterUnits.pos+"1"]=_,Z[u.counterUnits.pos+"2"]=f[d]),Z.x1=Math.min(Math.max(Z.x1,g.x1),g.x2),Z.x2=Math.min(Math.max(Z.x2,g.x1),g.x2),Z.y1=Math.min(Math.max(Z.y1,g.y2),g.y1),Z.y2=Math.min(Math.max(Z.y2,g.y2),g.y1);var y=e.getMetaData(n,d);v=r.elem("line",Z,t.classNames.bar).attr({"ct:value":[a.x,a.y].filter(e.isNumeric).join(","),"ct:meta":e.serialize(y)}),this.eventEmitter.emit("draw",e.extend({type:"bar",value:a,index:d,meta:y,series:n,seriesIndex:o,axisX:p,axisY:h,chartRect:g,group:r,element:v},Z))}}).bind(this))}).bind(this)),this.eventEmitter.emit("created",{bounds:c.bounds,chartRect:g,axisX:p,axisY:h,svg:this.svg,options:t})}})}(this||global,t),function(t,e){"use strict";var n={width:void 0,height:void 0,chartPadding:5,classNames:{chartPie:"ct-chart-pie",chartDonut:"ct-chart-donut",series:"ct-series",slicePie:"ct-slice-pie",sliceDonut:"ct-slice-donut",sliceDonutSolid:"ct-slice-donut-solid",label:"ct-label"},startAngle:0,total:void 0,donut:!1,donutSolid:!1,donutWidth:60,showLabel:!0,labelOffset:0,labelPosition:"inside",labelInterpolationFnc:e.noop,labelDirection:"neutral",reverseData:!1,ignoreEmptyValues:!1};function i(t,e,n){var i=e.x>t.x;return i&&"explode"===n||!i&&"implode"===n?"start":i&&"implode"===n||!i&&"explode"===n?"end":"middle"}e.Pie=e.Base.extend({constructor:function(t,i,o,s){e.Pie.super.constructor.call(this,t,i,n,e.extend({},n,o),s)},createChart:function(t){var o,s,a,r,l,c=e.normalizeData(this.data),d=[],u=t.startAngle;this.svg=e.createSvg(this.container,t.width,t.height,t.donut?t.classNames.chartDonut:t.classNames.chartPie),s=e.createChartRect(this.svg,t,n.padding),a=Math.min(s.width()/2,s.height()/2),l=t.total||c.normalized.series.reduce(function(t,e){return t+e},0);var p=e.quantity(t.donutWidth);"%"===p.unit&&(p.value*=a/100),a-=t.donut&&!t.donutSolid?p.value/2:0,r="outside"===t.labelPosition||t.donut&&!t.donutSolid?a:"center"===t.labelPosition?0:t.donutSolid?a-p.value/2:a/2,r+=t.labelOffset;var h={x:s.x1+s.width()/2,y:s.y2+s.height()/2},g=1===c.raw.series.filter(function(t){return t.hasOwnProperty("value")?0!==t.value:0!==t}).length;c.raw.series.forEach((function(t,e){d[e]=this.svg.elem("g",null,null)}).bind(this)),t.showLabel&&(o=this.svg.elem("g",null,null)),c.raw.series.forEach((function(n,s){if(0!==c.normalized.series[s]||!t.ignoreEmptyValues){d[s].attr({"ct:series-name":n.name}),d[s].addClass([t.classNames.series,n.className||t.classNames.series+"-"+e.alphaNumerate(s)].join(" "));var m=l>0?u+c.normalized.series[s]/l*360:0,f=Math.max(0,u-(0===s||g?0:.2));m-f>=359.99&&(m=f+359.99);var b,v,_,x=e.polarToCartesian(h.x,h.y,a,f),Z=e.polarToCartesian(h.x,h.y,a,m),y=new e.Svg.Path(!t.donut||t.donutSolid).move(Z.x,Z.y).arc(a,a,0,m-u>180,0,x.x,x.y);t.donut?t.donutSolid&&(b=e.polarToCartesian(h.x,h.y,_=a-p.value,u-(0===s||g?0:.2)),v=e.polarToCartesian(h.x,h.y,_,m),y.line(b.x,b.y),y.arc(_,_,0,m-u>180,1,v.x,v.y)):y.line(h.x,h.y);var w=t.classNames.slicePie;t.donut&&(w=t.classNames.sliceDonut,t.donutSolid&&(w=t.classNames.sliceDonutSolid));var k=d[s].elem("path",{d:y.stringify()},w);if(k.attr({"ct:value":c.normalized.series[s],"ct:meta":e.serialize(n.meta)}),t.donut&&!t.donutSolid&&(k._node.style.strokeWidth=p.value+"px"),this.eventEmitter.emit("draw",{type:"slice",value:c.normalized.series[s],totalDataSum:l,index:s,meta:n.meta,series:n,group:d[s],element:k,path:y.clone(),center:h,radius:a,startAngle:u,endAngle:m}),t.showLabel){var A,C;A=1===c.raw.series.length?{x:h.x,y:h.y}:e.polarToCartesian(h.x,h.y,r,u+(m-u)/2),C=c.normalized.labels&&!e.isFalseyButZero(c.normalized.labels[s])?c.normalized.labels[s]:c.normalized.series[s];var T=t.labelInterpolationFnc(C,s);if(T||0===T){var q=o.elem("text",{dx:A.x,dy:A.y,"text-anchor":i(h,A,t.labelDirection)},t.classNames.label).text(""+T);this.eventEmitter.emit("draw",{type:"label",index:s,group:o,element:q,text:""+T,x:A.x,y:A.y})}}u=m}}).bind(this)),this.eventEmitter.emit("created",{chartRect:s,svg:this.svg,options:t})},determineAnchorPosition:i})}(this||global,t),t}()}).apply(e,[]))||(t.exports=n)},1486:function(t){"use strict";t.exports=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){if(e.constructor!==n.constructor)return!1;var i,o,s;if(Array.isArray(e)){if((i=e.length)!=n.length)return!1;for(o=i;0!=o--;)if(!t(e[o],n[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((i=(s=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(o=i;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,s[o]))return!1;for(o=i;0!=o--;){var a=s[o];if(!t(e[a],n[a]))return!1}return!0}return e!=e&&n!=n}},38193:function(t,e,n){"use strict";n.d(e,{w:function(){return In}});var i=n(56238),o=n(78512),s=n(11520),a=n(66599),r=n(87829),l=n(4694),c=n(35366),d=n(76512),u=n(73234),p=n(31041),h=n(68515);let g=(()=>{class t{constructor(t){this.http=t}create(t,e,n,i){return this.http.post(`biolink/${t}/widget`,{type:e,position:n,config:i})}update(t,e,n){return this.http.put(`biolink/${t}/widget/${e}`,{config:n})}delete(t,e){return this.http.delete(`biolink/${t}/widget/${e}`)}}return t.BASE_URI="biolink-widgets",t.\u0275fac=function(e){return new(e||t)(c.LFG(h.r))},t.\u0275prov=c.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var m=n(24859);const f={links:0,appearance:1,settings:2};let b=(()=>{class t{constructor(t,e,n,i,s){this.biolinks=t,this.toast=e,this.fb=n,this.widgets=i,this.modal=s,this.biolink$=new o.X(null),this.loading$=new o.X(!1),this.activeTab$=new o.X(f.links),this.appearanceForm=this.fb.group({fontConfig:{},btnConfig:this.fb.group({color:this.fb.control(""),variant:this.fb.control(""),type:this.fb.control("")}),bgConfig:{}})}saveAppearance(){return this.loading$.next(!0),this.biolinks.saveAppearance(this.biolink$.value.id,this.appearanceForm.value).pipe((0,s.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open("Appearance saved")})}reloadBiolink(t){t=t||this.biolink$.value.id,this.loading$.next(!0),this.biolinks.get(t,{with:["appearance","rules","pixels","domain"]}).pipe((0,s.x)(()=>this.loading$.next(!1))).subscribe(t=>{var e;this.biolink$.next(t.biolink),this.appearanceForm.patchValue(null===(e=t.biolink.appearance)||void 0===e?void 0:e.config)})}crupdateWidget(t,e,n){return this.loading$.next(!0),(t?this.widgets.update(this.biolink$.value.id,t,n):this.widgets.create(this.biolink$.value.id,e,this.biolink$.value.content.length+1,n)).pipe((0,s.x)(()=>this.loading$.next(!1)),(0,a.b)(()=>this.reloadBiolink()))}openCrupdateLinkDialog(t,e={}){this.modal.open(r.P,Object.assign(Object.assign({},{groups:{[this.biolink$.value.id]:t?{}:{position:this.biolink$.value.content.length+1}},link:t,featuresToHide:{alias:!0,domain:!0,linkGroups:!0,tags:!0}}),e)).afterClosed().subscribe(t=>{t&&this.reloadBiolink()})}maybeDeleteContentItem(t){this.modal.open(l.z,{title:"Delete Widget",body:`Are you sure you want to delete this ${t.model_type}?`,ok:"Delete"}).afterClosed().subscribe(e=>{e&&(this.loading$.next(!0),this.biolinks.detach(this.biolink$.value.id,t).pipe((0,s.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.reloadBiolink(this.biolink$.value.id)}))})}updateContentItemConfig(t,e){this.loading$.next(!0),this.biolinks.updateContentItemConfig(this.biolink$.value.id,t,e).pipe((0,s.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.reloadBiolink()})}}return t.\u0275fac=function(e){return new(e||t)(c.LFG(d.n),c.LFG(u.F),c.LFG(p.qu),c.LFG(g),c.LFG(m.u))},t.\u0275prov=c.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var v=n(63337),_=n(88195),x=n(57173),Z=n(61116),y=n(24637),w=n(92935),k=n(77307),A=n(6006),C=n(38116),T=n(84369);function q(t,e){1&t&&(c.TgZ(0,"span",19),c._uU(1,"Update image widget"),c.qZA())}function I(t,e){1&t&&(c.TgZ(0,"span"),c._uU(1,"Add image widget"),c.qZA())}function O(t,e){1&t&&(c.TgZ(0,"span",19),c._uU(1,"Update"),c.qZA())}function U(t,e){1&t&&(c.TgZ(0,"span",19),c._uU(1,"Add"),c.qZA())}let P=(()=>{class t{constructor(t,e,n){this.dialogRef=t,this.data=e,this.editor=n,this.form=new p.cw({url:new p.NI,destinationUrl:new p.NI,type:new p.NI("default")}),e.config&&this.form.patchValue(e.config)}createOrUpdate(){this.editor.crupdateWidget(this.data.widgetId,"image",this.form.value).subscribe(t=>{this.dialogRef.close(t.widget)})}close(){this.dialogRef.close()}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(w.so),c.Y36(w.WI),c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["image-widget-modal"]],decls:28,vars:8,consts:[[1,"modal-header"],["mat-dialog-title","",1,"modal-title"],["trans","",4,"ngIf"],[4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit"],["mat-dialog-content","",1,"many-inputs"],["formControlName","url"],[1,"input-container"],["for","image-widget-type","trans","",1,"capitalize"],["id","image-widget-type","formControlName","type"],["value","default","trans",""],["value","avatar","trans",""],["for","image-widget-link","cdkFocusInitial","","trans","",1,"capitalize"],["type","url","id","image-widget-link","placeholder","Optional...","trans-placeholder","","formControlName","destinationUrl"],["mat-dialog-actions","",1,"buttons","right"],["type","button","mat-button","","trans","",1,"button","cancel","cancel-button",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary","submit-button",3,"disabled"],["trans",""]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h2",1),c.YNc(2,q,2,0,"span",2),c.YNc(3,I,2,0,"span",3),c.qZA(),c.TgZ(4,"button",4),c.NdJ("click",function(){return e.close()}),c._UZ(5,"mat-icon",5),c.qZA(),c.qZA(),c.TgZ(6,"form",6),c.NdJ("ngSubmit",function(){return e.createOrUpdate()}),c.TgZ(7,"div",7),c._UZ(8,"upload-image-control",8),c.TgZ(9,"div",9),c.TgZ(10,"label",10),c._uU(11,"Type"),c.qZA(),c.TgZ(12,"select",11),c.TgZ(13,"option",12),c._uU(14,"Default"),c.qZA(),c.TgZ(15,"option",13),c._uU(16,"Avatar"),c.qZA(),c.qZA(),c.qZA(),c.TgZ(17,"div",9),c.TgZ(18,"label",14),c._uU(19,"Destination Url"),c.qZA(),c._UZ(20,"input",15),c.qZA(),c.qZA(),c.TgZ(21,"div",16),c.TgZ(22,"button",17),c.NdJ("click",function(){return e.close()}),c._uU(23," Cancel "),c.qZA(),c.TgZ(24,"button",18),c.ALo(25,"async"),c.YNc(26,O,2,0,"span",2),c.YNc(27,U,2,0,"span",2),c.qZA(),c.qZA(),c.qZA()),2&t&&(c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config),c.xp6(3),c.Q6J("formGroup",e.form),c.xp6(18),c.Q6J("disabled",c.lcZ(25,6,e.editor.loading$)),c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config))},directives:[w.uh,Z.O5,k.Hw,p.JL,p.sg,w.xY,A.V,p.JJ,p.u,C.P,p.EJ,p.YN,p.Kr,p.Fj,w.H8,T.lW],pipes:[Z.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}upload-image-control[_ngcontent-%COMP%]{margin:0 auto 25px}"],changeDetection:0}),t})();var M=n(10487);function S(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update youtube widget"),c.qZA())}function N(t,e){1&t&&(c.TgZ(0,"span"),c._uU(1,"Add youtube widget"),c.qZA())}function J(t,e){if(1&t&&(c.TgZ(0,"div",16),c._uU(1),c.qZA()),2&t){const t=e.ngIf;c.xp6(1),c.Oqu(t)}}function E(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update"),c.qZA())}function L(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Add"),c.qZA())}let D=(()=>{class t{constructor(t,e,n){var i,s;this.dialogRef=t,this.data=e,this.editor=n,this.errors$=new o.X({}),this.form=new p.cw({url:new p.NI("")}),(null===(i=e.config)||void 0===i?void 0:i.url)&&this.form.patchValue({url:null===(s=e.config)||void 0===s?void 0:s.url})}createOrUpdate(){if(!(0,M.Z)(this.form.value.url).id)return this.errors$.next({url:"This is not a valid youtube url."});this.editor.crupdateWidget(this.data.widgetId,t.type,this.form.value).subscribe(t=>{this.dialogRef.close(t.widget)})}close(){this.dialogRef.close()}}return t.type="youtubeEmbed",t.\u0275fac=function(e){return new(e||t)(c.Y36(w.so),c.Y36(w.WI),c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["youtube-widget-modal"]],decls:21,vars:11,consts:[[1,"modal-header"],["mat-dialog-title","",1,"modal-title"],["trans","",4,"ngIf"],[4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit"],["mat-dialog-content",""],[1,"input-container"],["for","youtube-widget-url","trans",""],["type","url","id","youtube-widget-url","formControlName","url","placeholder","https://www.youtube.com/watch?v=YE7VzlLtp-4","cdkFocusInitial","","required",""],["class","error","trans","",4,"ngIf"],["mat-dialog-actions","",1,"buttons","right"],["type","button","mat-button","","trans","",1,"button","cancel","cancel-button",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary","submit-button",3,"disabled"],["trans",""],["trans","",1,"error"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h2",1),c.YNc(2,S,2,0,"span",2),c.YNc(3,N,2,0,"span",3),c.qZA(),c.TgZ(4,"button",4),c.NdJ("click",function(){return e.close()}),c._UZ(5,"mat-icon",5),c.qZA(),c.qZA(),c.TgZ(6,"form",6),c.NdJ("ngSubmit",function(){return e.createOrUpdate()}),c.TgZ(7,"div",7),c.TgZ(8,"div",8),c.TgZ(9,"label",9),c._uU(10,"Youtube Url"),c.qZA(),c._UZ(11,"input",10),c.YNc(12,J,2,1,"div",11),c.ALo(13,"async"),c.qZA(),c.qZA(),c.TgZ(14,"div",12),c.TgZ(15,"button",13),c.NdJ("click",function(){return e.close()}),c._uU(16," Cancel "),c.qZA(),c.TgZ(17,"button",14),c.ALo(18,"async"),c.YNc(19,E,2,0,"span",2),c.YNc(20,L,2,0,"span",2),c.qZA(),c.qZA(),c.qZA()),2&t&&(c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config),c.xp6(3),c.Q6J("formGroup",e.form),c.xp6(6),c.Q6J("ngIf",c.lcZ(13,7,e.errors$).url),c.xp6(5),c.Q6J("disabled",c.lcZ(18,9,e.editor.loading$)),c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config))},directives:[w.uh,Z.O5,k.Hw,p.JL,p.sg,w.xY,C.P,p.Fj,p.JJ,p.u,p.Q7,w.H8,T.lW],pipes:[Z.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}upload-image-control[_ngcontent-%COMP%]{margin:0 auto 25px}"],changeDetection:0}),t})();function $(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update soundcloud widget"),c.qZA())}function R(t,e){1&t&&(c.TgZ(0,"span"),c._uU(1,"Add soundcloud widget"),c.qZA())}function Y(t,e){if(1&t&&(c.TgZ(0,"div",16),c._uU(1),c.qZA()),2&t){const t=e.ngIf;c.xp6(1),c.Oqu(t)}}function F(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update"),c.qZA())}function Q(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Add"),c.qZA())}let B=(()=>{class t{constructor(t,e,n,i){this.dialogRef=t,this.data=e,this.http=n,this.editor=i,this.errors$=new o.X({}),this.form=new p.cw({url:new p.NI("")}),e.config&&this.form.patchValue(e.config)}createOrUpdate(){this.editor.loading$.next(!0);const e=encodeURIComponent(this.form.value.url);this.http.get("https://soundcloud.com/oembed?format=json&url="+e).subscribe(e=>{let n=e.html;if(!n)return this.editor.loading$.next(!1),this.errors$.next({url:"This is not a valid soundcloud url."});n=n.replace('height="400"','height="180"'),this.editor.crupdateWidget(this.data.widgetId,t.type,{embedCode:n,url:this.form.value.url}).subscribe(t=>{this.dialogRef.close(t.widget)})},()=>{this.editor.loading$.next(!1),this.errors$.next({url:"Could not get soundcloud embed code, try again later."})})}close(){this.dialogRef.close()}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(w.so),c.Y36(w.WI),c.Y36(h.r),c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["soundcloud-widget-modal"]],decls:21,vars:11,consts:[[1,"modal-header"],["mat-dialog-title","",1,"modal-title"],["trans","",4,"ngIf"],[4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit"],["mat-dialog-content",""],[1,"input-container"],["for","soundcloud-widget-url","trans",""],["type","url","id","soundcloud-widget-url","formControlName","url","placeholder","https://soundcloud.com/arianagrande/ariana-grande-test-drive","cdkFocusInitial","","required",""],["class","error","trans","",4,"ngIf"],["mat-dialog-actions","",1,"buttons","right"],["type","button","mat-button","","trans","",1,"button","cancel","cancel-button",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary","submit-button",3,"disabled"],["trans",""],["trans","",1,"error"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h2",1),c.YNc(2,$,2,0,"span",2),c.YNc(3,R,2,0,"span",3),c.qZA(),c.TgZ(4,"button",4),c.NdJ("click",function(){return e.close()}),c._UZ(5,"mat-icon",5),c.qZA(),c.qZA(),c.TgZ(6,"form",6),c.NdJ("ngSubmit",function(){return e.createOrUpdate()}),c.TgZ(7,"div",7),c.TgZ(8,"div",8),c.TgZ(9,"label",9),c._uU(10,"Soundcloud Url"),c.qZA(),c._UZ(11,"input",10),c.YNc(12,Y,2,1,"div",11),c.ALo(13,"async"),c.qZA(),c.qZA(),c.TgZ(14,"div",12),c.TgZ(15,"button",13),c.NdJ("click",function(){return e.close()}),c._uU(16," Cancel "),c.qZA(),c.TgZ(17,"button",14),c.ALo(18,"async"),c.YNc(19,F,2,0,"span",2),c.YNc(20,Q,2,0,"span",2),c.qZA(),c.qZA(),c.qZA()),2&t&&(c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config),c.xp6(3),c.Q6J("formGroup",e.form),c.xp6(6),c.Q6J("ngIf",c.lcZ(13,7,e.errors$).url),c.xp6(5),c.Q6J("disabled",c.lcZ(18,9,e.editor.loading$)),c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config))},directives:[w.uh,Z.O5,k.Hw,p.JL,p.sg,w.xY,C.P,p.Fj,p.JJ,p.u,p.Q7,w.H8,T.lW],pipes:[Z.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}upload-image-control[_ngcontent-%COMP%]{margin:0 auto 25px}"],changeDetection:0}),t})();function H(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update vimeo widget"),c.qZA())}function V(t,e){1&t&&(c.TgZ(0,"span"),c._uU(1,"Add vimeo widget"),c.qZA())}function z(t,e){if(1&t&&(c.TgZ(0,"div",16),c._uU(1),c.qZA()),2&t){const t=e.ngIf;c.xp6(1),c.Oqu(t)}}function G(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update"),c.qZA())}function j(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Add"),c.qZA())}let X=(()=>{class t{constructor(t,e,n){var i,s;this.dialogRef=t,this.data=e,this.editor=n,this.errors$=new o.X({}),this.form=new p.cw({url:new p.NI("")}),(null===(i=e.config)||void 0===i?void 0:i.url)&&this.form.patchValue({url:null===(s=e.config)||void 0===s?void 0:s.url})}createOrUpdate(){if(!(0,M.Z)(this.form.value.url).id)return this.errors$.next({url:"This is not a valid vimeo url."});this.editor.crupdateWidget(this.data.widgetId,t.widgetType,this.form.value).subscribe(t=>{this.dialogRef.close(t.widget)})}close(){this.dialogRef.close()}}return t.widgetType="vimeoEmbed",t.\u0275fac=function(e){return new(e||t)(c.Y36(w.so),c.Y36(w.WI),c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["vimeo-widget-modal"]],decls:21,vars:11,consts:[[1,"modal-header"],["mat-dialog-title","",1,"modal-title"],["trans","",4,"ngIf"],[4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit"],["mat-dialog-content",""],[1,"input-container"],["for","youtube-widget-url","trans",""],["type","url","id","youtube-widget-url","formControlName","url","placeholder","https://vimeo.com/1084537","cdkFocusInitial","","required",""],["class","error","trans","",4,"ngIf"],["mat-dialog-actions","",1,"buttons","right"],["type","button","mat-button","","trans","",1,"button","cancel","cancel-button",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary","submit-button",3,"disabled"],["trans",""],["trans","",1,"error"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h2",1),c.YNc(2,H,2,0,"span",2),c.YNc(3,V,2,0,"span",3),c.qZA(),c.TgZ(4,"button",4),c.NdJ("click",function(){return e.close()}),c._UZ(5,"mat-icon",5),c.qZA(),c.qZA(),c.TgZ(6,"form",6),c.NdJ("ngSubmit",function(){return e.createOrUpdate()}),c.TgZ(7,"div",7),c.TgZ(8,"div",8),c.TgZ(9,"label",9),c._uU(10,"Vimeo Url"),c.qZA(),c._UZ(11,"input",10),c.YNc(12,z,2,1,"div",11),c.ALo(13,"async"),c.qZA(),c.qZA(),c.TgZ(14,"div",12),c.TgZ(15,"button",13),c.NdJ("click",function(){return e.close()}),c._uU(16," Cancel "),c.qZA(),c.TgZ(17,"button",14),c.ALo(18,"async"),c.YNc(19,G,2,0,"span",2),c.YNc(20,j,2,0,"span",2),c.qZA(),c.qZA(),c.qZA()),2&t&&(c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config),c.xp6(3),c.Q6J("formGroup",e.form),c.xp6(6),c.Q6J("ngIf",c.lcZ(13,7,e.errors$).url),c.xp6(5),c.Q6J("disabled",c.lcZ(18,9,e.editor.loading$)),c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config))},directives:[w.uh,Z.O5,k.Hw,p.JL,p.sg,w.xY,C.P,p.Fj,p.JJ,p.u,p.Q7,w.H8,T.lW],pipes:[Z.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}upload-image-control[_ngcontent-%COMP%]{margin:0 auto 25px}"],changeDetection:0}),t})();var W=n(70110);function K(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update spotify widget"),c.qZA())}function tt(t,e){1&t&&(c.TgZ(0,"span"),c._uU(1,"Add spotify widget"),c.qZA())}function et(t,e){if(1&t&&(c.TgZ(0,"div",16),c._uU(1),c.qZA()),2&t){const t=e.ngIf;c.xp6(1),c.Oqu(t)}}function nt(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update"),c.qZA())}function it(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Add"),c.qZA())}let ot=(()=>{class t{constructor(t,e,n){var i,s;this.dialogRef=t,this.data=e,this.editor=n,this.errors$=new o.X({}),this.form=new p.cw({url:new p.NI("")}),(null===(i=e.config)||void 0===i?void 0:i.url)&&this.form.patchValue({url:null===(s=e.config)||void 0===s?void 0:s.url})}createOrUpdate(){if(!("id"in W(this.form.value.url)))return this.errors$.next({url:"This is not a valid spotify url."});this.editor.crupdateWidget(this.data.widgetId,t.type,this.form.value).subscribe(t=>{this.dialogRef.close(t.widget)})}close(){this.dialogRef.close()}}return t.type="spotifyEmbed",t.\u0275fac=function(e){return new(e||t)(c.Y36(w.so),c.Y36(w.WI),c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["spotify-widget-modal"]],decls:21,vars:11,consts:[[1,"modal-header"],["mat-dialog-title","",1,"modal-title"],["trans","",4,"ngIf"],[4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit"],["mat-dialog-content",""],[1,"input-container"],["for","spotify-widget-url","trans",""],["type","url","id","spotify-widget-url","formControlName","url","placeholder","https://open.spotify.com/track/2sqfLwGKXDw1nGjFhH3GGX?si=f329040f45804ec5","cdkFocusInitial","","required",""],["class","error","trans","",4,"ngIf"],["mat-dialog-actions","",1,"buttons","right"],["type","button","mat-button","","trans","",1,"button","cancel","cancel-button",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary","submit-button",3,"disabled"],["trans",""],["trans","",1,"error"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h2",1),c.YNc(2,K,2,0,"span",2),c.YNc(3,tt,2,0,"span",3),c.qZA(),c.TgZ(4,"button",4),c.NdJ("click",function(){return e.close()}),c._UZ(5,"mat-icon",5),c.qZA(),c.qZA(),c.TgZ(6,"form",6),c.NdJ("ngSubmit",function(){return e.createOrUpdate()}),c.TgZ(7,"div",7),c.TgZ(8,"div",8),c.TgZ(9,"label",9),c._uU(10,"Spotify Url"),c.qZA(),c._UZ(11,"input",10),c.YNc(12,et,2,1,"div",11),c.ALo(13,"async"),c.qZA(),c.qZA(),c.TgZ(14,"div",12),c.TgZ(15,"button",13),c.NdJ("click",function(){return e.close()}),c._uU(16," Cancel "),c.qZA(),c.TgZ(17,"button",14),c.ALo(18,"async"),c.YNc(19,nt,2,0,"span",2),c.YNc(20,it,2,0,"span",2),c.qZA(),c.qZA(),c.qZA()),2&t&&(c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config),c.xp6(3),c.Q6J("formGroup",e.form),c.xp6(6),c.Q6J("ngIf",c.lcZ(13,7,e.errors$).url),c.xp6(5),c.Q6J("disabled",c.lcZ(18,9,e.editor.loading$)),c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config))},directives:[w.uh,Z.O5,k.Hw,p.JL,p.sg,w.xY,C.P,p.Fj,p.JJ,p.u,p.Q7,w.H8,T.lW],pipes:[Z.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}upload-image-control[_ngcontent-%COMP%]{margin:0 auto 25px}"],changeDetection:0}),t})();function st(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update twitch widget"),c.qZA())}function at(t,e){1&t&&(c.TgZ(0,"span"),c._uU(1,"Add twitch widget"),c.qZA())}function rt(t,e){if(1&t&&(c.TgZ(0,"div",16),c._uU(1),c.qZA()),2&t){const t=e.ngIf;c.xp6(1),c.Oqu(t)}}function lt(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update"),c.qZA())}function ct(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Add"),c.qZA())}let dt=(()=>{class t{constructor(t,e,n){var i,s;this.dialogRef=t,this.data=e,this.editor=n,this.errors$=new o.X({}),this.form=new p.cw({url:new p.NI("")}),(null===(i=e.config)||void 0===i?void 0:i.url)&&this.form.patchValue({url:null===(s=e.config)||void 0===s?void 0:s.url})}createOrUpdate(){if(!this.form.value.url.includes("twitch.tv/"))return this.errors$.next({url:"This is not a valid twitch url."});this.editor.crupdateWidget(this.data.widgetId,t.type,this.form.value).subscribe(t=>{this.dialogRef.close(t.widget)})}close(){this.dialogRef.close()}}return t.type="twitchEmbed",t.\u0275fac=function(e){return new(e||t)(c.Y36(w.so),c.Y36(w.WI),c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["twitch-widget-modal"]],decls:21,vars:11,consts:[[1,"modal-header"],["mat-dialog-title","",1,"modal-title"],["trans","",4,"ngIf"],[4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit"],["mat-dialog-content",""],[1,"input-container"],["for","twitch-widget-url","trans",""],["type","url","id","twitch-widget-url","formControlName","url","placeholder","https://www.twitch.tv/kasparovchess","cdkFocusInitial","","required",""],["class","error","trans","",4,"ngIf"],["mat-dialog-actions","",1,"buttons","right"],["type","button","mat-button","","trans","",1,"button","cancel","cancel-button",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary","submit-button",3,"disabled"],["trans",""],["trans","",1,"error"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h2",1),c.YNc(2,st,2,0,"span",2),c.YNc(3,at,2,0,"span",3),c.qZA(),c.TgZ(4,"button",4),c.NdJ("click",function(){return e.close()}),c._UZ(5,"mat-icon",5),c.qZA(),c.qZA(),c.TgZ(6,"form",6),c.NdJ("ngSubmit",function(){return e.createOrUpdate()}),c.TgZ(7,"div",7),c.TgZ(8,"div",8),c.TgZ(9,"label",9),c._uU(10,"Twitch Url"),c.qZA(),c._UZ(11,"input",10),c.YNc(12,rt,2,1,"div",11),c.ALo(13,"async"),c.qZA(),c.qZA(),c.TgZ(14,"div",12),c.TgZ(15,"button",13),c.NdJ("click",function(){return e.close()}),c._uU(16," Cancel "),c.qZA(),c.TgZ(17,"button",14),c.ALo(18,"async"),c.YNc(19,lt,2,0,"span",2),c.YNc(20,ct,2,0,"span",2),c.qZA(),c.qZA(),c.qZA()),2&t&&(c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config),c.xp6(3),c.Q6J("formGroup",e.form),c.xp6(6),c.Q6J("ngIf",c.lcZ(13,7,e.errors$).url),c.xp6(5),c.Q6J("disabled",c.lcZ(18,9,e.editor.loading$)),c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config))},directives:[w.uh,Z.O5,k.Hw,p.JL,p.sg,w.xY,C.P,p.Fj,p.JJ,p.u,p.Q7,w.H8,T.lW],pipes:[Z.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}upload-image-control[_ngcontent-%COMP%]{margin:0 auto 25px}"],changeDetection:0}),t})();function ut(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update tiktok widget"),c.qZA())}function pt(t,e){1&t&&(c.TgZ(0,"span"),c._uU(1,"Add tiktok widget"),c.qZA())}function ht(t,e){if(1&t&&(c.TgZ(0,"div",16),c._uU(1),c.qZA()),2&t){const t=e.ngIf;c.xp6(1),c.Oqu(t)}}function gt(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update"),c.qZA())}function mt(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Add"),c.qZA())}let ft=(()=>{class t{constructor(t,e,n){var i,s;this.dialogRef=t,this.data=e,this.editor=n,this.errors$=new o.X({}),this.form=new p.cw({url:new p.NI("")}),(null===(i=e.config)||void 0===i?void 0:i.url)&&this.form.patchValue({url:null===(s=e.config)||void 0===s?void 0:s.url})}createOrUpdate(){if(!this.form.value.url.includes("tiktok.com/"))return this.errors$.next({url:"This is not a valid tiktok url."});this.editor.crupdateWidget(this.data.widgetId,t.type,this.form.value).subscribe(t=>{this.dialogRef.close(t.widget)})}close(){this.dialogRef.close()}}return t.type="tiktokEmbed",t.\u0275fac=function(e){return new(e||t)(c.Y36(w.so),c.Y36(w.WI),c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["tiktok-widget-modal"]],decls:21,vars:11,consts:[[1,"modal-header"],["mat-dialog-title","",1,"modal-title"],["trans","",4,"ngIf"],[4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit"],["mat-dialog-content",""],[1,"input-container"],["for","tiktok-widget-url","trans",""],["type","url","id","tiktok-widget-url","formControlName","url","placeholder","https://www.tiktok.com/@bts_official_bighit/video/6964945720885464322","cdkFocusInitial","","required",""],["class","error","trans","",4,"ngIf"],["mat-dialog-actions","",1,"buttons","right"],["type","button","mat-button","","trans","",1,"button","cancel","cancel-button",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary","submit-button",3,"disabled"],["trans",""],["trans","",1,"error"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h2",1),c.YNc(2,ut,2,0,"span",2),c.YNc(3,pt,2,0,"span",3),c.qZA(),c.TgZ(4,"button",4),c.NdJ("click",function(){return e.close()}),c._UZ(5,"mat-icon",5),c.qZA(),c.qZA(),c.TgZ(6,"form",6),c.NdJ("ngSubmit",function(){return e.createOrUpdate()}),c.TgZ(7,"div",7),c.TgZ(8,"div",8),c.TgZ(9,"label",9),c._uU(10,"TikTok Url"),c.qZA(),c._UZ(11,"input",10),c.YNc(12,ht,2,1,"div",11),c.ALo(13,"async"),c.qZA(),c.qZA(),c.TgZ(14,"div",12),c.TgZ(15,"button",13),c.NdJ("click",function(){return e.close()}),c._uU(16," Cancel "),c.qZA(),c.TgZ(17,"button",14),c.ALo(18,"async"),c.YNc(19,gt,2,0,"span",2),c.YNc(20,mt,2,0,"span",2),c.qZA(),c.qZA(),c.qZA()),2&t&&(c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config),c.xp6(3),c.Q6J("formGroup",e.form),c.xp6(6),c.Q6J("ngIf",c.lcZ(13,7,e.errors$).url),c.xp6(5),c.Q6J("disabled",c.lcZ(18,9,e.editor.loading$)),c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config))},directives:[w.uh,Z.O5,k.Hw,p.JL,p.sg,w.xY,C.P,p.Fj,p.JJ,p.u,p.Q7,w.H8,T.lW],pipes:[Z.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}upload-image-control[_ngcontent-%COMP%]{margin:0 auto 25px}"],changeDetection:0}),t})();function bt(t,e){1&t&&(c.TgZ(0,"span",16),c._uU(1,"Update text widget"),c.qZA())}function vt(t,e){1&t&&(c.TgZ(0,"span"),c._uU(1,"Add text widget"),c.qZA())}function _t(t,e){1&t&&(c.TgZ(0,"span",16),c._uU(1,"Update"),c.qZA())}function xt(t,e){1&t&&(c.TgZ(0,"span",16),c._uU(1,"Add"),c.qZA())}const Zt=[{name:"Email",type:"mail",placeholder:"your@email.com",inputType:"email"},{name:"Facebook Url",type:"facebook",placeholder:"https://facebook.com/username",pattern:"https://facebook.com/[a-zA-Z0-9._]+$",inputType:"url"},{name:"Twitter Handle",type:"twitter",placeholder:"@yourtwitterhandle",pattern:"^@[A-Za-z0-9_]{1,15}$"},{name:"Instagram Username",type:"instagram",placeholder:"@instagramusername",pattern:"^@[a-zA-Z0-9._]+$"},{name:"TikTok Username",type:"tiktok",placeholder:"@tiktokusername",pattern:"^@[a-zA-Z0-9._]+$"},{name:"Youtube Channel Url",type:"youtube",placeholder:"https://youtube.com/channel/youtubechannelurl",inputType:"url",pattern:"https://youtube.com/channel/[a-zA-Z0-9._]+$"},{name:"SoundCloud Url",type:"soundcloud",placeholder:"https://soundcloud.com/username",inputType:"url",pattern:"https://soundcloud.com/[a-zA-Z0-9._]+$"},{name:"Bandcamp Url",type:"bandcamp",placeholder:"https://you.bandcamp.com",inputType:"url",pattern:"https://[a-zA-Z0-9._]+.bandcamp.com$"},{name:"LinkedIn Url",type:"linkedin",placeholder:"https://linkedin.com/in/username",inputType:"url",pattern:"https://linkedin.com/in/[a-zA-Z0-9._]+$"},{name:"WhatsApp",type:"whatsapp",placeholder:"+00000000000",pattern:"^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\\s\\./0-9]*$"},{name:"Telegram Url",type:"telegram",placeholder:"https://t.me/",inputType:"url",pattern:"https://t.me/[a-zA-Z0-9._]+$"},{name:"Twitch Url",type:"twitch",placeholder:"https://twitch.tv/username",inputType:"url",pattern:"https://twitch.tv/[a-zA-Z0-9._]+$"},{name:"Patreon Url",type:"patreon",placeholder:"https://patreon.com/username",inputType:"url",pattern:"https://patreon.com/[a-zA-Z0-9._]+$"},{name:"Pinterest Url",type:"pinterest",placeholder:"https://pinterest.com/",inputType:"url",pattern:"https://pinterest.com/.+"},{name:"Spotify Artist Url",type:"spotify",placeholder:"https://open.spotify.com/artist/artistname",inputType:"url",pattern:"https://open.spotify.com/artist/[a-zA-Z0-9._]+$"},{name:"Amazon Shop Url",type:"amazon",placeholder:"https://amazon.com/shop/yourshopname",inputType:"url",pattern:"https://amazon.com/shop/[a-zA-Z0-9._]+$"},{name:"Snapchat Url",type:"snapchat",placeholder:"https://www.snapchat.com/add/yourusername",inputType:"url",pattern:"https://www.snapchat.com/add/[a-zA-Z0-9._]+$"},{name:"Apple Music Url",type:"apple",placeholder:"https://music.apple.com/us/album/youralbum",inputType:"url",pattern:"https://music.apple.com/.+"}];function yt(t,e){1&t&&(c.TgZ(0,"span",12),c._uU(1,"Update social links"),c.qZA())}function wt(t,e){1&t&&(c.TgZ(0,"span"),c._uU(1,"Add social links"),c.qZA())}function kt(t,e){if(1&t&&(c.TgZ(0,"div",13),c.TgZ(1,"label",14),c._uU(2),c.qZA(),c._UZ(3,"input",15),c.qZA()),2&t){const t=e.$implicit;c.xp6(1),c.Q6J("for",t.name),c.xp6(1),c.Oqu(t.name),c.xp6(1),c.Q6J("type",t.inputType||"text")("pattern",t.pattern)("placeholder",t.placeholder)("id",t.name)("formControlName",t.type)}}function At(t,e){1&t&&(c.TgZ(0,"span",12),c._uU(1,"Update"),c.qZA())}function Ct(t,e){1&t&&(c.TgZ(0,"span",12),c._uU(1,"Add"),c.qZA())}const Tt=[{type:"image",image:"image.png",description:"Upload an image and optionally add a link it will redirect to when clicked.",component:P},{type:"text",image:"text.png",description:"Add title and optional description. Can be used as a header for the whole biolink or a group of multiple widgets.",component:(()=>{class t{constructor(t,e,n){this.dialogRef=t,this.data=e,this.editor=n,this.form=new p.cw({title:new p.NI,description:new p.NI}),e.config&&this.form.patchValue(e.config)}createOrUpdate(){this.editor.crupdateWidget(this.data.widgetId,"text",this.form.value).subscribe(t=>{this.dialogRef.close(t.widget)})}close(){this.dialogRef.close()}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(w.so),c.Y36(w.WI),c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["text-widget-modal"]],decls:23,vars:8,consts:[[1,"modal-header"],["mat-dialog-title","",1,"modal-title"],["trans","",4,"ngIf"],[4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit"],["mat-dialog-content","",1,"many-inputs"],[1,"input-container"],["for","text-widget-title","trans","",1,"capitalize"],["cdkFocusInitial","","type","text","id","text-widget-title","formControlName","title","required",""],["for","text-widget-description","trans","",1,"capitalize"],["type","text","id","text-widget-description","formControlName","description"],["mat-dialog-actions","",1,"buttons","right"],["type","button","mat-button","","trans","",1,"button","cancel","cancel-button",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary","submit-button",3,"disabled"],["trans",""]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h2",1),c.YNc(2,bt,2,0,"span",2),c.YNc(3,vt,2,0,"span",3),c.qZA(),c.TgZ(4,"button",4),c.NdJ("click",function(){return e.close()}),c._UZ(5,"mat-icon",5),c.qZA(),c.qZA(),c.TgZ(6,"form",6),c.NdJ("ngSubmit",function(){return e.createOrUpdate()}),c.TgZ(7,"div",7),c.TgZ(8,"div",8),c.TgZ(9,"label",9),c._uU(10,"Title"),c.qZA(),c._UZ(11,"input",10),c.qZA(),c.qZA(),c.TgZ(12,"div",8),c.TgZ(13,"label",11),c._uU(14,"Description"),c.qZA(),c._UZ(15,"input",12),c.qZA(),c.TgZ(16,"div",13),c.TgZ(17,"button",14),c.NdJ("click",function(){return e.close()}),c._uU(18," Cancel "),c.qZA(),c.TgZ(19,"button",15),c.ALo(20,"async"),c.YNc(21,_t,2,0,"span",2),c.YNc(22,xt,2,0,"span",2),c.qZA(),c.qZA(),c.qZA()),2&t&&(c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config),c.xp6(3),c.Q6J("formGroup",e.form),c.xp6(13),c.Q6J("disabled",c.lcZ(20,6,e.editor.loading$)),c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config))},directives:[w.uh,Z.O5,k.Hw,p.JL,p.sg,w.xY,C.P,p.Fj,p.JJ,p.u,p.Q7,w.H8,T.lW],pipes:[Z.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}upload-image-control[_ngcontent-%COMP%]{margin:0 auto 25px}"],changeDetection:0}),t})()},{type:"socials",name:"Social Links",image:"socials.png",description:"Add your socials links to display them as icon buttons.",component:(()=>{class t{constructor(t,e,n){this.dialogRef=t,this.data=e,this.editor=n,this.services=Zt,this.form=new p.cw({}),this.services.forEach(t=>{this.form.addControl(t.type,new p.NI)}),e.config&&this.form.patchValue(e.config)}createOrUpdate(){this.editor.crupdateWidget(this.data.widgetId,"socials",this.form.value).subscribe(t=>{this.dialogRef.close(t.widget)})}close(){this.dialogRef.close()}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(w.so),c.Y36(w.WI),c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["socials-widget-modal"]],decls:16,vars:9,consts:[[1,"modal-header"],["mat-dialog-title","",1,"modal-title"],["trans","",4,"ngIf"],[4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit"],["mat-dialog-content","",1,"many-inputs"],["class","input-container",4,"ngFor","ngForOf"],["mat-dialog-actions","",1,"buttons","right"],["type","button","mat-button","","trans","",1,"button","cancel","cancel-button",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary","submit-button",3,"disabled"],["trans",""],[1,"input-container"],["trans","",1,"capitalize",3,"for"],["autocomplete","false",3,"type","pattern","placeholder","id","formControlName"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h2",1),c.YNc(2,yt,2,0,"span",2),c.YNc(3,wt,2,0,"span",3),c.qZA(),c.TgZ(4,"button",4),c.NdJ("click",function(){return e.close()}),c._UZ(5,"mat-icon",5),c.qZA(),c.qZA(),c.TgZ(6,"form",6),c.NdJ("ngSubmit",function(){return e.createOrUpdate()}),c.TgZ(7,"div",7),c.YNc(8,kt,4,7,"div",8),c.qZA(),c.TgZ(9,"div",9),c.TgZ(10,"button",10),c.NdJ("click",function(){return e.close()}),c._uU(11," Cancel "),c.qZA(),c.TgZ(12,"button",11),c.ALo(13,"async"),c.YNc(14,At,2,0,"span",2),c.YNc(15,Ct,2,0,"span",2),c.qZA(),c.qZA(),c.qZA()),2&t&&(c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config),c.xp6(3),c.Q6J("formGroup",e.form),c.xp6(2),c.Q6J("ngForOf",e.services),c.xp6(4),c.Q6J("disabled",c.lcZ(13,7,e.editor.loading$)),c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config))},directives:[w.uh,Z.O5,k.Hw,p.JL,p.sg,w.xY,Z.sg,w.H8,T.lW,C.P,p.Fj,p.c5,p.JJ,p.u],pipes:[Z.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}upload-image-control[_ngcontent-%COMP%]{margin:0 auto 25px}"],changeDetection:0}),t})()},{name:"Youtube Video",type:"youtubeEmbed",image:"youtube.png",description:"Paste a YouTube video URL to show it as a video embed in your profile.",component:D},{name:"Soundcloud Video",type:"soundcloudEmbed",image:"soundcloud.png",description:"Paste a SoundCloud URL to show it as a playable song in your profile.",component:B},{name:"Vimeo Video",type:"vimeoEmbed",image:"vimeo.jpeg",description:"Paste a vimeo URL to show it as a video embed in your profile.",component:X},{name:"Spotify Embed",type:"spotifyEmbed",image:"spotify.png",description:"Paste a spotify song, album, artist, playlist, podcast or episode url to show it as an embed in your profile.",component:ot},{name:"Twitch Embed",type:"twitchEmbed",image:"twitch.svg",description:"Paste twitch profile or clip url to show it as an embed in your profile.",component:dt},{name:"TikTok Embed",type:"tiktokEmbed",image:"tiktok.png",description:"Paste TikTok video url to show it as an embed in your profile.",component:ft}];var qt=n(87064);function It(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"div",7),c.NdJ("click",function(){const e=c.CHM(t).$implicit;return c.oxw().openWidgetDialog(e.component)}),c._UZ(1,"img",8),c.TgZ(2,"div",9),c._uU(3),c.qZA(),c.TgZ(4,"div",10),c._uU(5),c.qZA(),c.qZA()}if(2&t){const t=e.$implicit,n=c.oxw();c.xp6(1),c.Q6J("src",n.settings.getAssetUrl("images/widgets/"+t.image),c.LSH),c.xp6(2),c.Oqu(t.name||t.type),c.xp6(2),c.Oqu(t.description)}}let Ot=(()=>{class t{constructor(t,e,n,i){this.dialogRef=t,this.data=e,this.settings=n,this.modal=i,this.widgets=Tt}openWidgetDialog(t){this.close(),this.modal.open(t,this.data)}close(){this.dialogRef.close()}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(w.so),c.Y36(w.WI),c.Y36(_.Z),c.Y36(m.u))},t.\u0275cmp=c.Xpm({type:t,selectors:[["widget-list-modal"]],decls:8,vars:1,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,"widgets"],["class","widget","mat-ripple","",3,"click",4,"ngFor","ngForOf"],["mat-ripple","",1,"widget",3,"click"],["alt","",1,"widget-img",3,"src"],["trans","",1,"name"],["trans","",1,"description"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h2",1),c._uU(2,"Add New Widget"),c.qZA(),c.TgZ(3,"button",2),c.NdJ("click",function(){return e.close()}),c._UZ(4,"mat-icon",3),c.qZA(),c.qZA(),c.TgZ(5,"div",4),c.TgZ(6,"div",5),c.YNc(7,It,6,3,"div",6),c.qZA(),c.qZA()),2&t&&(c.xp6(7),c.Q6J("ngForOf",e.widgets))},directives:[w.uh,k.Hw,w.xY,Z.sg,qt.wG,C.P],styles:["[_nghost-%COMP%]{display:block;width:700px;max-width:100%;background-color:var(--be-background-alternative)}.widgets[_ngcontent-%COMP%]{display:grid;grid-column-gap:10px;grid-row-gap:10px;grid-template-columns:repeat(3,1fr)}.widget[_ngcontent-%COMP%]{cursor:pointer;border:1px solid #ececec;border-radius:4px;padding:10px;background-color:var(--be-background);box-shadow:0 2px 4px 0 #ececec}.widget[_ngcontent-%COMP%]:hover{background-color:var(--be-hover)}.widget-img[_ngcontent-%COMP%]{width:55px;height:55px;margin-bottom:20px;margin-right:auto}.name[_ngcontent-%COMP%]{text-transform:capitalize;font-size:2rem;font-weight:500;color:var(--be-accent-default);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.description[_ngcontent-%COMP%]{color:var(--be-secondary-text)}"],changeDetection:0}),t})();var Ut=n(69244),Pt=n(26437),Mt=n(24311),St=n(3080),Nt=n(99713),Jt=n(47701),Et=n(79996),Lt=n(48865),Dt=n(79572),$t=n(40450);const Rt=["*"];let Yt=(()=>{class t{constructor(){this.closed=new c.vpe,this.visible$=new o.X(!1)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=c.Xpm({type:t,selectors:[["biolink-slideout-panel"]],inputs:{title:"title"},outputs:{closed:"closed"},ngContentSelectors:Rt,decls:8,vars:3,consts:[[1,"header"],[1,"title"],["type","button","mat-icon-button","",3,"click"],["svgIcon","close"],[1,"body"]],template:function(t,e){1&t&&(c.F$t(),c.TgZ(0,"div",0),c.TgZ(1,"div",1),c._uU(2),c.ALo(3,"trans"),c.qZA(),c.TgZ(4,"button",2),c.NdJ("click",function(){return e.closed.emit()}),c._UZ(5,"mat-icon",3),c.qZA(),c.qZA(),c.TgZ(6,"div",4),c.Hsn(7),c.qZA()),2&t&&(c.xp6(2),c.Oqu(c.lcZ(3,1,e.title)))},directives:[T.lW,k.Hw],pipes:[$t.R],styles:["[_nghost-%COMP%]{display:block;box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12);border-bottom-left-radius:4px;border-bottom-right-radius:4px;overflow:hidden}.header[_ngcontent-%COMP%]{display:flex;align-items:center;padding:0 20px;background-color:var(--be-background-alternative);border-top:1px solid var(--be-divider-lighter);border-bottom:1px solid var(--be-divider-lighter)}.header[_ngcontent-%COMP%] .mat-icon-button[_ngcontent-%COMP%]{margin-left:15px}.title[_ngcontent-%COMP%]{flex:1 1 auto;margin-right:auto;font-weight:500}.body[_ngcontent-%COMP%]{background-color:var(--be-background);padding:15px}"],changeDetection:0}),t})();const Ft=["bounce","flash","pulse","rubberBand","shakeX","shakeY","headShake","swing","tada","wobble","jello","heartBeat"];var Qt=n(78733);function Bt(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"button",5),c.NdJ("mouseenter",function(e){const n=c.CHM(t).$implicit;return c.oxw().onMouseEnter(e,n)})("mouseleave",function(e){const n=c.CHM(t).$implicit;return c.oxw().onMouseLeave(e,n)})("click",function(){const e=c.CHM(t).$implicit;return c.oxw().selectAnimation(e)}),c.ALo(1,"async"),c._uU(2),c.qZA()}if(2&t){const t=e.$implicit,n=c.oxw();c.ekj("selected",c.lcZ(1,3,n.selectedAnimation$)===t),c.xp6(2),c.hij(" ",t," ")}}let Ht=(()=>{class t{constructor(t){this.lazyLoader=t,this.animationList=Ft,this.selectedAnimation$=new o.X(null)}ngOnInit(){this.lazyLoader.loadAsset("https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css",{type:"css",id:"animate.css"})}registerOnChange(t){this.propagateChange=t}writeValue(t){this.selectedAnimation$.next(t)}registerOnTouched(t){}selectAnimation(t){this.propagateChange(t),this.selectedAnimation$.next(t)}onMouseEnter(t,e){t.target.classList.add(`animate__${e}`)}onMouseLeave(t,e){t.target.classList.remove(`animate__${e}`)}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(Qt.j))},t.\u0275cmp=c.Xpm({type:t,selectors:[["animation-selector"]],features:[c._Bn([{provide:p.JU,useExisting:t,multi:!0}])],decls:10,vars:5,consts:[[1,"description"],["trans",""],[1,"animation-list"],["type","button","mat-stroked-button","","trans","",3,"click"],["type","button","mat-stroked-button","","class","animate__animated","trans","",3,"selected","mouseenter","mouseleave","click",4,"ngFor","ngForOf"],["type","button","mat-stroked-button","","trans","",1,"animate__animated",3,"mouseenter","mouseleave","click"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"div",1),c._uU(2,"Add an animation to draw attention to this link."),c.qZA(),c.TgZ(3,"div",1),c._uU(4,"Selected animation will repeat five times by default."),c.qZA(),c.qZA(),c.TgZ(5,"div",2),c.TgZ(6,"button",3),c.NdJ("click",function(){return e.selectAnimation(null)}),c.ALo(7,"async"),c._uU(8," None "),c.qZA(),c.YNc(9,Bt,3,5,"button",4),c.qZA()),2&t&&(c.xp6(6),c.ekj("selected",!c.lcZ(7,3,e.selectedAnimation$)),c.xp6(3),c.Q6J("ngForOf",e.animationList))},directives:[C.P,T.lW,Z.sg],pipes:[Z.Ov],styles:[".description[_ngcontent-%COMP%]{text-align:center;margin-bottom:18px}button[_ngcontent-%COMP%]{line-height:60px;text-transform:uppercase;border-width:2px;font-size:1.3rem;padding:0 5px}button.selected[_ngcontent-%COMP%]{border-color:var(--be-accent-default)}.animation-list[_ngcontent-%COMP%]{display:grid;grid-gap:15px;grid-template-columns:repeat(auto-fill,minmax(95px,1fr))}"],changeDetection:0}),t})();var Vt=n(98720),zt=n(98081);function Gt(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"div",1),c.TgZ(1,"div",2),c._uU(2,"Temporarily send all visitors directly to this link."),c.qZA(),c.TgZ(3,"div",2),c._uU(4,"You can only have one active Leap Link at a time."),c.qZA(),c.TgZ(5,"button",3),c.NdJ("click",function(){return c.CHM(t),c.oxw().enableLeapLink()}),c._uU(6," Enable Leap Link "),c.qZA(),c.qZA()}}function jt(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"div",1),c.TgZ(1,"div",4),c._uU(2,"Set an end time for the Leap Link. Your Biolink will automatically restore when the Leap Link expires."),c.qZA(),c._UZ(3,"datetime-input",5),c.TgZ(4,"button",3),c.NdJ("click",function(){return c.CHM(t),c.oxw().disableLeapLink()}),c._uU(5," Disable Leap Link "),c.qZA(),c.qZA()}if(2&t){const t=c.oxw();c.xp6(3),c.Q6J("formControl",t.leapUntilControl)}}let Xt=(()=>{class t{constructor(){this.leapUntilControl=new p.NI(null),this.leapIsActive$=new o.X(!1),this.sub=this.leapUntilControl.valueChanges.pipe((0,i.O)(null),(0,Et.U)(t=>!!t)).subscribe(t=>{this.leapIsActive$.next(t)})}ngAfterViewInit(){this.leapUntilControl.valueChanges.pipe((0,Vt.x)()).subscribe(t=>{this.propagateChange(t)})}ngOnDestroy(){this.sub.unsubscribe()}registerOnChange(t){this.propagateChange=t}writeValue(t){this.leapUntilControl.setValue(t)}registerOnTouched(t){}enableLeapLink(){const t=new Date;t.setDate(t.getDate()+1),this.leapUntilControl.setValue(t.toISOString())}disableLeapLink(){this.leapUntilControl.setValue(null)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=c.Xpm({type:t,selectors:[["leap-link-panel"]],features:[c._Bn([{provide:p.JU,useExisting:t,multi:!0}])],decls:4,vars:6,consts:[["class","enable-panel",4,"ngIf"],[1,"enable-panel"],["trans",""],["type","button","mat-flat-button","","color","accent","trans","",1,"enable-leap-btn",3,"click"],["trans","",1,"description"],[3,"formControl"]],template:function(t,e){1&t&&(c.YNc(0,Gt,7,0,"div",0),c.ALo(1,"async"),c.YNc(2,jt,6,1,"div",0),c.ALo(3,"async")),2&t&&(c.Q6J("ngIf",!c.lcZ(1,2,e.leapIsActive$)),c.xp6(2),c.Q6J("ngIf",c.lcZ(3,4,e.leapIsActive$)))},directives:[Z.O5,C.P,T.lW,zt.k,p.JJ,p.oH],pipes:[Z.Ov],styles:["[_nghost-%COMP%]{text-align:center}.enable-leap-btn[_ngcontent-%COMP%]{margin-top:18px;width:100%;min-height:40px}.enable-panel[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{margin-bottom:10px}"],changeDetection:0}),t})();var Wt=n(62147),Kt=n(66457),te=n(67139),ee=n(35331),ne=n(57125);function ie(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"div",2),c.TgZ(1,"div",3),c._uU(2,"Upload a thumbnail for this link."),c.qZA(),c.TgZ(3,"button",4),c.NdJ("click",function(){return c.CHM(t),c.oxw().openUploadWindow()}),c._uU(4," Upload Thumbnail "),c.qZA(),c.qZA()}}function oe(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"div",5),c._UZ(1,"img",6),c.ALo(2,"async"),c.TgZ(3,"div",7),c.TgZ(4,"button",8),c.NdJ("click",function(){return c.CHM(t),c.oxw().openUploadWindow()}),c._uU(5," Change "),c.qZA(),c.TgZ(6,"button",9),c.NdJ("click",function(){return c.CHM(t),c.oxw().removeImage()}),c._uU(7," Remove "),c.qZA(),c.qZA(),c.qZA()}if(2&t){const t=c.oxw();c.xp6(1),c.Q6J("src",c.lcZ(2,1,t.src$),c.LSH)}}let se=(()=>{class t{constructor(t,e){this.uploadQueue=t,this.imageValidator=e,this.src$=new o.X(null)}ngOnInit(){}registerOnChange(t){this.propagateChange=t}writeValue(t){this.src$.next(t)}registerOnTouched(t){}openUploadWindow(){(0,Wt.r)({multiple:!1,types:[te.j.image]}).then(t=>{this.uploadQueue.start(t,{httpParams:{diskPrefix:"biolink-thumbnails"},uri:ee.C.Image,validator:this.imageValidator}).subscribe(t=>{this.src$.next(t.fileEntry.url),this.propagateChange(t.fileEntry.url)})})}removeImage(){this.src$.next(null),this.propagateChange(null)}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(Kt.A),c.Y36(ne.G))},t.\u0275cmp=c.Xpm({type:t,selectors:[["link-thumbnail-panel"]],features:[c._Bn([Kt.A,{provide:p.JU,useExisting:t,multi:!0}])],decls:4,vars:6,consts:[["class","upload-panel",4,"ngIf"],["class","change-panel",4,"ngIf"],[1,"upload-panel"],["trans","",1,"description"],["type","button","mat-flat-button","","color","accent","trans","",1,"action-button",3,"click"],[1,"change-panel"],["alt","",1,"preview",3,"src"],[1,"upload-buttons"],["type","button","mat-flat-button","","color","accent","trans","",1,"action-button","change-button",3,"click"],["type","button","mat-stroked-button","","color","accent","trans","",1,"action-button",3,"click"]],template:function(t,e){1&t&&(c.YNc(0,ie,5,0,"div",0),c.ALo(1,"async"),c.YNc(2,oe,8,3,"div",1),c.ALo(3,"async")),2&t&&(c.Q6J("ngIf",!c.lcZ(1,2,e.src$)),c.xp6(2),c.Q6J("ngIf",c.lcZ(3,4,e.src$)))},directives:[Z.O5,C.P,T.lW],pipes:[Z.Ov],styles:[".change-panel[_ngcontent-%COMP%]{display:flex}.description[_ngcontent-%COMP%]{margin-bottom:10px;text-align:center}.preview[_ngcontent-%COMP%]{display:block;width:90px;height:90px;-o-object-fit:cover;object-fit:cover;margin-right:10px;border-radius:4px;overflow:hidden;flex-shrink:0}.upload-buttons[_ngcontent-%COMP%]{flex:1 1 auto}.action-button[_ngcontent-%COMP%]{display:block;width:100%;min-height:40px}.change-button[_ngcontent-%COMP%]{margin-bottom:10px}"],changeDetection:0}),t})();var ae=n(77830),re=n(40985);function le(t,e){if(1&t&&c._UZ(0,"img",29),2&t){const t=c.oxw();c.Q6J("src",t.link.image,c.LSH)}}function ce(t,e){if(1&t&&(c._UZ(0,"img",29),c.ALo(1,"favicon")),2&t){const t=c.oxw();c.Q6J("src",c.lcZ(1,1,t.link.long_url),c.LSH)}}function de(t,e){1&t&&(c.TgZ(0,"div",30),c.TgZ(1,"div",31),c._uU(2,"This link is inactive due to its schedule."),c.qZA(),c.qZA())}function ue(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"biolink-slideout-panel",32),c.NdJ("closed",function(){return c.CHM(t),c.oxw().activeSlideOutPanel$.next(null)}),c._UZ(1,"animation-selector",33),c.qZA()}2&t&&c.Q6J("title","Animation")("@slideOutPanelAnimation",void 0)}function pe(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"biolink-slideout-panel",32),c.NdJ("closed",function(){return c.CHM(t),c.oxw().activeSlideOutPanel$.next(null)}),c._UZ(1,"leap-link-panel",34),c.qZA()}2&t&&c.Q6J("title","Leap Link")("@slideOutPanelAnimation",void 0)}function he(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"biolink-slideout-panel",35),c.NdJ("closed",function(){return c.CHM(t),c.oxw().activeSlideOutPanel$.next(null)}),c._UZ(1,"link-thumbnail-panel",34),c.qZA()}2&t&&c.Q6J("@slideOutPanelAnimation",void 0)}const ge=function(){return{resource:"link"}};function me(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"biolink-slideout-panel",36),c.NdJ("closed",function(){return c.CHM(t),c.oxw().activeSlideOutPanel$.next(null)}),c.TgZ(1,"p",37),c._uU(2," Enter a date when :resource should be active. Both start and end dates are optional. "),c.qZA(),c.TgZ(3,"div",38),c.TgZ(4,"div",39),c.TgZ(5,"datetime-input",40),c._uU(6,"Start Date"),c.qZA(),c.qZA(),c.TgZ(7,"div",39),c.TgZ(8,"datetime-input",41),c._uU(9,"End Date"),c.qZA(),c.qZA(),c.qZA(),c.qZA()}2&t&&(c.Q6J("@slideOutPanelAnimation",void 0),c.xp6(1),c.Q6J("transValues",c.DdM(2,ge)))}const fe=function(t,e){return["/",t,"links",e]};let be=(()=>{class t{constructor(t,e,n){this.editor=t,this.fb=e,this.section=n,this.activeSlideOutPanel$=new o.X(null),this.form=this.fb.group({active:!0,animation:null,leap_until:null,image:null,expires_at:null,activates_at:null})}ngOnChanges(){var t,e;null===(t=this.formSub)||void 0===t||t.unsubscribe(),null===(e=this.animSub)||void 0===e||e.unsubscribe(),this.form.patchValue(this.link),this.link.active_locked?this.form.get("active").disable():this.form.get("active").enable(),this.formSub=this.form.valueChanges.pipe((0,Jt.b)(400)).subscribe(()=>{this.editor.updateContentItemConfig(this.link,this.getDirtyFromValues())}),this.animSub=this.form.get("animation").valueChanges.subscribe(()=>{this.activeSlideOutPanel$.next(null)})}ngOnInit(){this.leapActive$=this.activeObservable("leap_until"),this.animationActive$=this.activeObservable("animation"),this.imageActive$=this.activeObservable("image"),this.scheduleActive$=(0,St.aj)(this.activeObservable("expires_at"),this.activeObservable("activates_at")).pipe((0,Et.U)(t=>t[0]||t[1]))}toggleAnimationPanel(t){this.activeSlideOutPanel$.next(this.activeSlideOutPanel$.value===t?null:t)}openEditLinkDialog(){this.editor.openCrupdateLinkDialog(this.link)}getParentRoute(){return this.section.admin?"admin":"dashboard"}enableLeapLink(){this.form.patchValue({leap_link:!0})}clearFormField(t){this.form.patchValue({[t]:null})}activeObservable(t){return this.form.get(t).valueChanges.pipe((0,i.O)(this.link[t]),(0,Et.U)(t=>!!t))}getDirtyFromValues(){const t={};return Object.entries(this.form.controls).forEach(([e,n])=>{n.dirty&&(t[e]=n.value)}),t}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(b),c.Y36(p.qu),c.Y36(Lt.W))},t.\u0275cmp=c.Xpm({type:t,selectors:[["biolink-editor-link"]],inputs:{link:"link"},features:[c.TTD],decls:58,vars:85,consts:[[3,"formGroup"],[1,"content-item-wrapper"],[1,"drag-handle-container"],["type","button","mat-icon-button","","cdkDragHandle",""],["svgIcon","drag-indicator"],[1,"content-item-body"],[1,"header"],[1,"title"],["formControlName","active"],[1,"subheader"],["class","favicon-img","alt","",3,"src",4,"ngIf"],[1,"url"],[1,"actions"],["type","button","mat-icon-button","",1,"action-button",3,"disabled","matTooltip","click"],["svgIcon","edit"],["type","button","mat-icon-button","",1,"action-button","image-action-btn",3,"disabled","matTooltip","click"],["svgIcon","image"],["target","_blank","mat-icon-button","",1,"action-button",3,"routerLink","disabled","matTooltip"],["svgIcon","analytics"],["svgIcon","animation"],["svgIcon","shortcut"],["type","button","mat-icon-button","",1,"action-button","schedule-action-btn",3,"disabled","matTooltip","click"],["svgIcon","more-time"],["type","button","mat-icon-button","",1,"action-button","delete-action",3,"disabled","click"],["svgIcon","delete"],["class","locked-notif",4,"ngIf"],[3,"title","closed",4,"ngIf"],["title","Thumbnail",3,"closed",4,"ngIf"],["title","Schedule Link",3,"closed",4,"ngIf"],["alt","",1,"favicon-img",3,"src"],[1,"locked-notif"],["trans","",1,"locked-notif-msg"],[3,"title","closed"],["formControlName","animation"],["formControlName","image"],["title","Thumbnail",3,"closed"],["title","Schedule Link",3,"closed"],["trans","",1,"schedule-description",3,"transValues"],[1,"inline-inputs-container"],["permission-aware-input-container","expiration",1,"input-container"],["id","bio_exp_at","formControlName","activates_at","trans",""],["id","bio_act_at","formControlName","expires_at"]],template:function(t,e){1&t&&(c.ynx(0,0),c.TgZ(1,"div",1),c.ALo(2,"async"),c.TgZ(3,"div",2),c.TgZ(4,"button",3),c._UZ(5,"mat-icon",4),c.qZA(),c.qZA(),c.TgZ(6,"div",5),c.TgZ(7,"div",6),c.TgZ(8,"div",7),c._uU(9),c.qZA(),c._UZ(10,"mat-slide-toggle",8),c.qZA(),c.TgZ(11,"div",9),c.YNc(12,le,1,1,"img",10),c.YNc(13,ce,2,3,"img",10),c.TgZ(14,"span",11),c._uU(15),c.qZA(),c.qZA(),c.TgZ(16,"div",12),c.TgZ(17,"button",13),c.NdJ("click",function(){return e.openEditLinkDialog()}),c.ALo(18,"async"),c.ALo(19,"trans"),c._UZ(20,"mat-icon",14),c.qZA(),c.TgZ(21,"button",15),c.NdJ("click",function(){return e.toggleAnimationPanel("image")}),c.ALo(22,"async"),c.ALo(23,"async"),c.ALo(24,"trans"),c._UZ(25,"mat-icon",16),c.qZA(),c.TgZ(26,"a",17),c.ALo(27,"async"),c.ALo(28,"trans"),c._UZ(29,"mat-icon",18),c.qZA(),c.TgZ(30,"button",13),c.NdJ("click",function(){return e.toggleAnimationPanel("animation")}),c.ALo(31,"async"),c.ALo(32,"async"),c.ALo(33,"trans"),c._UZ(34,"mat-icon",19),c.qZA(),c.TgZ(35,"button",13),c.NdJ("click",function(){return e.toggleAnimationPanel("leapLink")}),c.ALo(36,"async"),c.ALo(37,"async"),c.ALo(38,"trans"),c._UZ(39,"mat-icon",20),c.qZA(),c.TgZ(40,"button",21),c.NdJ("click",function(){return e.toggleAnimationPanel("schedule")}),c.ALo(41,"async"),c.ALo(42,"async"),c.ALo(43,"trans"),c._UZ(44,"mat-icon",22),c.qZA(),c.TgZ(45,"button",23),c.NdJ("click",function(){return e.editor.maybeDeleteContentItem(e.link)}),c.ALo(46,"async"),c._UZ(47,"mat-icon",24),c.qZA(),c.qZA(),c.qZA(),c.qZA(),c.YNc(48,de,3,0,"div",25),c.ALo(49,"async"),c.YNc(50,ue,2,2,"biolink-slideout-panel",26),c.ALo(51,"async"),c.YNc(52,pe,2,2,"biolink-slideout-panel",26),c.ALo(53,"async"),c.YNc(54,he,2,1,"biolink-slideout-panel",27),c.ALo(55,"async"),c.YNc(56,me,10,3,"biolink-slideout-panel",28),c.ALo(57,"async"),c.BQk()),2&t&&(c.Q6J("formGroup",e.form),c.xp6(1),c.ekj("slide-out-panel-active",c.lcZ(2,36,e.activeSlideOutPanel$))("active-locked",e.link.active_locked),c.xp6(8),c.Oqu(e.link.name),c.xp6(3),c.Q6J("ngIf",e.link.image),c.xp6(1),c.Q6J("ngIf",!e.link.image),c.xp6(2),c.Oqu(e.link.long_url),c.xp6(2),c.Q6J("disabled",c.lcZ(18,38,e.editor.loading$))("matTooltip",c.lcZ(19,40,"Edit")),c.xp6(4),c.ekj("active",c.lcZ(22,42,e.imageActive$)),c.Q6J("disabled",c.lcZ(23,44,e.editor.loading$))("matTooltip",c.lcZ(24,46,"Change Thumbnail")),c.xp6(5),c.Q6J("routerLink",c.WLB(82,fe,e.getParentRoute(),e.link.id))("disabled",c.lcZ(27,48,e.editor.loading$))("matTooltip",c.lcZ(28,50,"Statistics")),c.xp6(4),c.ekj("active",c.lcZ(31,52,e.animationActive$)),c.Q6J("disabled",c.lcZ(32,54,e.editor.loading$))("matTooltip",c.lcZ(33,56,"Animation")),c.xp6(5),c.ekj("active",c.lcZ(36,58,e.leapActive$)),c.Q6J("disabled",c.lcZ(37,60,e.editor.loading$))("matTooltip",c.lcZ(38,62,"Leap Link")),c.xp6(5),c.ekj("active",c.lcZ(41,64,e.scheduleActive$)),c.Q6J("disabled",c.lcZ(42,66,e.editor.loading$))("matTooltip",c.lcZ(43,68,"Schedule")),c.xp6(5),c.Q6J("disabled",c.lcZ(46,70,e.editor.loading$)),c.xp6(3),c.Q6J("ngIf",e.link.active_locked&&!c.lcZ(49,72,e.activeSlideOutPanel$)),c.xp6(2),c.Q6J("ngIf","animation"===c.lcZ(51,74,e.activeSlideOutPanel$)),c.xp6(2),c.Q6J("ngIf","leapLink"===c.lcZ(53,76,e.activeSlideOutPanel$)),c.xp6(2),c.Q6J("ngIf","image"===c.lcZ(55,78,e.activeSlideOutPanel$)),c.xp6(2),c.Q6J("ngIf","schedule"===c.lcZ(57,80,e.activeSlideOutPanel$)))},directives:[p.JL,p.sg,T.lW,Ut.Bh,k.Hw,Dt.Rr,p.JJ,p.u,Z.O5,Mt.gM,T.zs,v.yS,C.P,Yt,Ht,Xt,se,ae.o,zt.k],pipes:[Z.Ov,$t.R,re.K],styles:[".locked-notif[_ngcontent-%COMP%]{background-color:var(--be-background);border:1px solid var(--be-accent-lighter);border-top:none;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.locked-notif-msg[_ngcontent-%COMP%]{padding:12px 15px;background-color:var(--be-accent-emphasis);font-size:1.5rem}.schedule-description[_ngcontent-%COMP%]{text-align:center;margin:0 0 15px}@media only screen and (max-width:768px){.image-action-btn[_ngcontent-%COMP%], .schedule-action-btn[_ngcontent-%COMP%]{display:none}}"],data:{animation:[(0,Nt.X$)("slideOutPanelAnimation",[(0,Nt.eR)(":enter",[(0,Nt.oB)({height:"0px",opacity:0}),(0,Nt.jt)("225ms cubic-bezier(0.4,0.0,0.2,1)",(0,Nt.oB)({height:"*",opacity:1}))]),(0,Nt.eR)(":leave",[(0,Nt.oB)({height:"*",opacity:1}),(0,Nt.jt)("225ms cubic-bezier(0.4,0.0,0.2,1)",(0,Nt.oB)({height:"0px",opacity:0}))])])]},changeDetection:0}),t})();var ve=n(62181),_e=n(29476);function xe(t,e){if(1&t&&(c.ynx(0),c.TgZ(1,"div",15),c.TgZ(2,"div",16),c._UZ(3,"image-or-icon",17),c.TgZ(4,"div",18),c._uU(5),c.qZA(),c.qZA(),c._UZ(6,"mat-slide-toggle",19),c.qZA(),c.BQk()),2&t){const t=c.oxw().ngIf,e=c.oxw();c.xp6(3),c.Q6J("src",e.widget.config.url),c.xp6(2),c.Oqu(t.name||t.type)}}function Ze(t,e){if(1&t&&(c.ynx(0),c.TgZ(1,"div",15),c.TgZ(2,"div",20),c.TgZ(3,"div",21),c._uU(4),c.qZA(),c.TgZ(5,"div",22),c.TgZ(6,"div",23),c._uU(7),c.qZA(),c.TgZ(8,"div",24),c._uU(9),c.qZA(),c.qZA(),c.qZA(),c._UZ(10,"mat-slide-toggle",19),c.qZA(),c.BQk()),2&t){const t=c.oxw().ngIf,e=c.oxw();c.xp6(4),c.Oqu(t.name||t.type),c.xp6(3),c.Oqu(e.widget.config.title),c.xp6(2),c.Oqu(e.widget.config.description)}}function ye(t,e){if(1&t&&(c.ynx(0),c.TgZ(1,"div",15),c.TgZ(2,"div",25),c._uU(3),c.qZA(),c._UZ(4,"mat-slide-toggle",19),c.qZA(),c.TgZ(5,"div",26),c._UZ(6,"social-button-list",27),c.qZA(),c.BQk()),2&t){const t=c.oxw().ngIf,e=c.oxw();c.xp6(3),c.Oqu(t.name||t.type),c.xp6(3),c.Q6J("config",e.widget.config)}}function we(t,e){if(1&t&&(c.ynx(0),c.TgZ(1,"div",15),c.TgZ(2,"div",25),c._uU(3),c.qZA(),c._UZ(4,"mat-slide-toggle",19),c.qZA(),c.TgZ(5,"div",26),c._UZ(6,"img",28),c.TgZ(7,"span",29),c._uU(8),c.qZA(),c.qZA(),c.BQk()),2&t){const t=c.oxw().ngIf,e=c.oxw();c.xp6(3),c.Oqu(t.name||t.type),c.xp6(3),c.Q6J("src",e.settings.getAssetUrl("images/widgets/"+t.image),c.LSH),c.xp6(2),c.Oqu(e.widget.config.url)}}function ke(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"div",6),c.ynx(1,7),c.YNc(2,xe,7,2,"ng-container",8),c.YNc(3,Ze,11,3,"ng-container",8),c.YNc(4,ye,7,2,"ng-container",8),c.YNc(5,we,9,3,"ng-container",9),c.BQk(),c.TgZ(6,"div",10),c.TgZ(7,"button",11),c.NdJ("click",function(){c.CHM(t);const e=c.oxw();return e.openEditWidgetDialog(e.widget)}),c.ALo(8,"async"),c.ALo(9,"trans"),c._UZ(10,"mat-icon",12),c.qZA(),c.TgZ(11,"button",13),c.NdJ("click",function(){c.CHM(t);const e=c.oxw();return e.editor.maybeDeleteContentItem(e.widget)}),c.ALo(12,"async"),c._UZ(13,"mat-icon",14),c.qZA(),c.qZA(),c.qZA()}if(2&t){const t=e.ngIf,n=c.oxw();c.xp6(1),c.Q6J("ngSwitch",t.type),c.xp6(1),c.Q6J("ngSwitchCase","image"),c.xp6(1),c.Q6J("ngSwitchCase","text"),c.xp6(1),c.Q6J("ngSwitchCase","socials"),c.xp6(3),c.Q6J("disabled",c.lcZ(8,7,n.editor.loading$))("matTooltip",c.lcZ(9,9,"Edit")),c.xp6(4),c.Q6J("disabled",c.lcZ(12,11,n.editor.loading$))}}let Ae=(()=>{class t{constructor(t,e,n,i){this.settings=t,this.fb=e,this.editor=n,this.modal=i,this.form=this.fb.group({active:!0})}ngOnInit(){this.form.patchValue(this.widget),this.form.valueChanges.subscribe(t=>{this.editor.updateContentItemConfig(this.widget,t)})}getWidgetConfig(t){return Tt.find(e=>e.type===t)}openEditWidgetDialog(t){const e=this.getWidgetConfig(t.type);this.modal.open(e.component,{config:t.config,widgetId:t.id})}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(_.Z),c.Y36(p.qu),c.Y36(b),c.Y36(m.u))},t.\u0275cmp=c.Xpm({type:t,selectors:[["biolink-editor-widget"]],inputs:{widget:"widget"},decls:6,vars:2,consts:[[3,"formGroup"],[1,"content-item-wrapper"],[1,"drag-handle-container"],["type","button","mat-icon-button","","cdkDragHandle",""],["svgIcon","drag-indicator"],["class","content-item-body",4,"ngIf"],[1,"content-item-body"],[3,"ngSwitch"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],[1,"actions"],["type","button","mat-icon-button","",1,"action-button",3,"disabled","matTooltip","click"],["svgIcon","edit"],["type","button","mat-icon-button","",1,"action-button","delete-action",3,"disabled","click"],["svgIcon","delete"],[1,"header"],[1,"title","image-title"],[1,"inherit-size",3,"src"],["trans","",1,"capitalize"],["formControlName","active"],[1,"title"],["trans","",1,"capitalize","centered"],[1,"text-widget-body"],[1,"text-widget-title","centered"],[1,"text-widget-description","centered"],["trans","",1,"title","capitalize"],[1,"subheader"],[3,"config"],["alt","",1,"favicon-img",3,"src"],[1,"url"]],template:function(t,e){1&t&&(c.ynx(0,0),c.TgZ(1,"div",1),c.TgZ(2,"div",2),c.TgZ(3,"button",3),c._UZ(4,"mat-icon",4),c.qZA(),c.qZA(),c.YNc(5,ke,14,13,"div",5),c.qZA(),c.BQk()),2&t&&(c.Q6J("formGroup",e.form),c.xp6(5),c.Q6J("ngIf",e.getWidgetConfig(e.widget.type)))},directives:[p.JL,p.sg,T.lW,Ut.Bh,k.Hw,Z.O5,Z.RF,Z.n9,Z.ED,Mt.gM,ve.A,C.P,Dt.Rr,p.JJ,p.u,_e.W],pipes:[Z.Ov,$t.R],styles:[".centered[_ngcontent-%COMP%]{text-align:center}.image-title[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding-top:22px;font-size:1.6rem}.image-title[_ngcontent-%COMP%] image-or-icon[_ngcontent-%COMP%]{width:25px;height:25px;margin-right:10px;display:block;border-radius:4px;overflow:hidden}.text-widget-body[_ngcontent-%COMP%]{font-weight:400;font-size:1.3rem;margin-top:5px}social-button-list[_ngcontent-%COMP%]{color:var(--be-secondary-text)}"],changeDetection:0}),t})();var Ce=n(47210),Te=n(88798);function qe(t,e){if(1&t&&c._UZ(0,"biolink-editor-link",11),2&t){const t=c.oxw().$implicit;c.Q6J("link",t)}}function Ie(t,e){if(1&t&&c._UZ(0,"biolink-editor-widget",12),2&t){const t=c.oxw().$implicit;c.Q6J("widget",t)}}function Oe(t,e){if(1&t&&(c.ynx(0),c.YNc(1,qe,1,1,"biolink-editor-link",9),c.YNc(2,Ie,1,1,"biolink-editor-widget",10),c.BQk()),2&t){const t=e.$implicit;c.xp6(1),c.Q6J("ngIf","link"===t.model_type),c.xp6(1),c.Q6J("ngIf","biolinkWidget"===t.model_type)}}function Ue(t,e){1&t&&(c.TgZ(0,"no-results-message",13),c.TgZ(1,"span",14),c._uU(2,"No links or widgets have been added yet"),c.qZA(),c.qZA())}function Pe(t,e){if(1&t){const t=c.EpF();c.ynx(0),c.TgZ(1,"div",6),c.NdJ("cdkDropListDropped",function(e){return c.CHM(t),c.oxw().reorderContent(e)}),c.ALo(2,"async"),c.YNc(3,Oe,3,2,"ng-container",7),c.YNc(4,Ue,3,0,"no-results-message",8),c.qZA(),c.BQk()}if(2&t){const t=e.ngIf,n=c.oxw();c.xp6(1),c.Q6J("cdkDropListDisabled",c.lcZ(2,5,n.editor.loading$))("@fadeIn",void 0),c.xp6(2),c.Q6J("ngForOf",t.content)("ngForTrackBy",n.trackByFn),c.xp6(1),c.Q6J("ngIf",!t.content.length)}}function Me(t,e){1&t&&(c.TgZ(0,"div",17),c.TgZ(1,"div",18),c.TgZ(2,"div",19),c._UZ(3,"skeleton",20),c.qZA(),c.TgZ(4,"div",21),c._UZ(5,"skeleton",22),c._UZ(6,"skeleton"),c._UZ(7,"skeleton"),c.qZA(),c.qZA(),c.qZA())}function Se(t,e){if(1&t&&(c.TgZ(0,"div",15),c.YNc(1,Me,8,0,"div",16),c.qZA()),2&t){const t=c.oxw();c.Q6J("@fadeOut",void 0),c.xp6(1),c.Q6J("ngForOf",t.skeletonIterator)}}let Ne=(()=>{class t{constructor(t,e,n,i,o){this.modal=t,this.editor=e,this.toast=n,this.biolinks=i,this.settings=o,this.skeletonIterator=Array(5),this.trackByFn=(t,e)=>e.id}openNewLinkDialog(){this.editor.openCrupdateLinkDialog(null,{createMsg:"Link added"})}openWidgetListDialog(){this.modal.open(Ot,{biolinkId:this.editor.biolink$.value.id})}reorderContent(t){if(t.previousIndex===t.currentIndex)return;const e=[...this.editor.biolink$.value.content];(0,Ut.bA)(e,t.previousIndex,t.currentIndex),this.editor.biolink$.next(Object.assign(Object.assign({},this.editor.biolink$.value),{content:e}));const n=e.map(t=>({id:t.id,model_type:t.model_type}));this.editor.loading$.next(!0),this.biolinks.changeOrder(this.editor.biolink$.value.id,n).pipe((0,s.x)(()=>this.editor.loading$.next(!1))).subscribe()}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(m.u),c.Y36(b),c.Y36(u.F),c.Y36(d.n),c.Y36(_.Z))},t.\u0275cmp=c.Xpm({type:t,selectors:[["biolink-editor-content"]],decls:10,vars:7,consts:[[1,"links-tab","left-col-spacer"],["type","button","mat-raised-button","","color","accent","trans","",1,"add-new-link-btn",3,"click"],["type","button","mat-raised-button","","color","accent",1,"add-widget-btn",3,"matTooltip","click"],["svgIcon","widgets"],[4,"ngIf","ngIfElse"],["loading",""],["cdkDropList","",1,"link-list",3,"cdkDropListDisabled","cdkDropListDropped"],[4,"ngFor","ngForOf","ngForTrackBy"],["svgImage","share-link.svg",4,"ngIf"],["class","biolink-content-item","cdkDrag","",3,"link",4,"ngIf"],["class","biolink-content-item","cdkDrag","",3,"widget",4,"ngIf"],["cdkDrag","",1,"biolink-content-item",3,"link"],["cdkDrag","",1,"biolink-content-item",3,"widget"],["svgImage","share-link.svg"],["primary-text","","trans",""],[1,"link-list"],["class","biolink-content-item",4,"ngFor","ngForOf"],[1,"biolink-content-item"],[1,"content-item-wrapper"],[1,"drag-handle-container"],["variant","icon"],[1,"content-item-body"],["animation",""]],template:function(t,e){if(1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"button",1),c.NdJ("click",function(){return e.openNewLinkDialog()}),c._uU(2," Add New Link "),c.qZA(),c.TgZ(3,"button",2),c.NdJ("click",function(){return e.openWidgetListDialog()}),c.ALo(4,"trans"),c._UZ(5,"mat-icon",3),c.qZA(),c.YNc(6,Pe,5,7,"ng-container",4),c.ALo(7,"async"),c.YNc(8,Se,2,2,"ng-template",null,5,c.W1O),c.qZA()),2&t){const t=c.MAs(9);c.xp6(3),c.Q6J("matTooltip",c.lcZ(4,3,"Add widget")),c.xp6(3),c.Q6J("ngIf",c.lcZ(7,5,e.editor.biolink$))("ngIfElse",t)}},directives:[T.lW,C.P,Mt.gM,k.Hw,Z.O5,Ut.Wj,Z.sg,be,Ut.Zt,Ae,Ce.U,Te._],pipes:[$t.R,Z.Ov],styles:["[_nghost-%COMP%]{display:block}.add-new-link-btn[_ngcontent-%COMP%]{width:calc(100% - 79px);height:48px;margin:auto}.add-widget-btn[_ngcontent-%COMP%]{height:48px;width:48px;margin-left:15px}.link-list[_ngcontent-%COMP%]{margin-top:50px} .biolink-content-item{display:block;margin-bottom:20px} .biolink-content-item .content-item-wrapper{display:flex;border-radius:4px;background-color:var(--be-background);border:1px solid transparent;box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12)} .biolink-content-item .content-item-wrapper.active-locked{border-color:var(--be-accent-lighter)} .biolink-content-item .content-item-wrapper.active-locked, .biolink-content-item .content-item-wrapper.slide-out-panel-active{border-bottom-left-radius:0;border-bottom-right-radius:0} .biolink-content-item .drag-handle-container{display:flex;align-items:center;border-right:1px solid var(--be-divider-default)} .biolink-content-item .content-item-body{padding:20px 20px 15px;flex:1 1 auto;overflow:hidden} .biolink-content-item .header{display:flex;align-items:center;margin-bottom:3px} .biolink-content-item .header .title{flex:1 1 auto;margin-right:auto;font-weight:500;font-size:1.5rem} .biolink-content-item .header .mat-slide-toggle{flex-shrink:0;margin-left:10px} .biolink-content-item .subheader{display:flex;align-items:center} .biolink-content-item .url{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--be-secondary-text)} .biolink-content-item .favicon-img{margin-right:8px;width:16px;height:16px;border-radius:4px;overflow:hidden} .biolink-content-item .actions{display:flex;align-items:center;margin-top:5px;color:var(--be-secondary-text)} .biolink-content-item .action-button.active{color:var(--be-accent-default)} .biolink-content-item .delete-action{margin-left:auto}"],data:{animation:Pt.B},changeDetection:0}),t})();var Je=n(64762);const Ee={configId:"uploadedImg",configLabel:"Image",backgroundSize:"cover",repeat:"no-repeat",position:"center center"},Le={configId:"flat",configLabel:"Color",backgroundColor:"rgb(209, 246, 255)",color:null},De=[Ee,Le,{configId:"gradient",configLabel:"Gradient",backgroundImage:"linear-gradient(43deg, #4158D0 0%, #C850C0 46%, #FFCC70 100%)"},{configId:"img1",backgroundColor:"#ffdd55",backgroundImage:"svg-bgs/Angled-Focus.svg",backgroundAttachment:"fixed",backgroundSize:"cover",color:"#fff"},{configId:"img2",backgroundColor:"#220044",backgroundImage:"svg-bgs/Circular-Focus.svg",backgroundAttachment:"fixed",backgroundSize:"cover",color:"#fff"},{configId:"img3",backgroundColor:"#000000",backgroundImage:"svg-bgs/Farseeing-Eyeball.svg",backgroundAttachment:"fixed",backgroundSize:"cover",color:"#fff"},{configId:"img4",backgroundColor:"#ff0000",backgroundImage:"svg-bgs/Canyon-Funnel.svg",backgroundAttachment:"fixed",backgroundSize:"cover",color:"#fff"},{configId:"img5",backgroundColor:"#11ddaa",backgroundImage:"svg-bgs/Looney-Loops.svg",backgroundAttachment:"fixed",backgroundSize:"cover",color:"#000"},{configId:"img6",backgroundColor:"#070014",backgroundImage:"svg-bgs/Hurricane-Aperture.svg",backgroundAttachment:"fixed",backgroundSize:"cover",color:"#fff"},{configId:"img7",backgroundColor:"#ccffff",backgroundImage:"svg-bgs/Icy-Explosion.svg",backgroundAttachment:"fixed",backgroundSize:"cover",backgroundRepeat:"no-repeat",color:"#000"},{configId:"img8",backgroundColor:"#442233",backgroundImage:"svg-bgs/Nuclear-Focalpoint.svg",backgroundAttachment:"fixed",backgroundSize:"cover",color:"#fff"},{configId:"img9",backgroundColor:"#ee5522;",backgroundImage:"svg-bgs/Protruding-Squares.svg",color:"#fff"},{configId:"img10",backgroundColor:"#fff",backgroundImage:"svg-bgs/Alternating-Triangles.svg",color:"#000"},{configId:"img11",backgroundColor:"#002200",backgroundImage:"svg-bgs/Monstera-Patch.svg",color:"#fff"},{configId:"img11",backgroundColor:"#aa3333",backgroundImage:"svg-bgs/Confetti-Doodles.svg",color:"#fff",backgroundAttachment:"fixed"},{configId:"img12",backgroundColor:"#ffdd99",backgroundImage:"svg-bgs/Threads-Ahead.svg",backgroundAttachment:"fixed",backgroundSize:"cover",color:"#000"},{configId:"img13",backgroundColor:"#00bbff",backgroundImage:"svg-bgs/Launch-Day.svg",backgroundAttachment:"fixed",backgroundSize:"cover",color:"#fff"},{configId:"img14",backgroundImage:"svg-bgs/Sprinkle.svg"},{configId:"img15",backgroundImage:"svg-bgs/Circuit-Board.svg"},{configId:"img15",backgroundImage:"svg-bgs/Snow.svg"}];var $e=n(72674),Re=n(25416);const Ye=[{configId:"grd1",backgroundImage:"linear-gradient(45deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%)"},{configId:"grd2",backgroundImage:"linear-gradient(to right, #ff8177 0%, #ff867a 0%, #ff8c7f 21%, #f99185 52%, #cf556c 78%, #b12a5b 100%)"},{configId:"grd3",backgroundImage:"linear-gradient(to top, #fbc2eb 0%, #a6c1ee 100%)"},{configId:"grd4",backgroundImage:"linear-gradient(to top, #cfd9df 0%, #e2ebf0 100%)"},{configId:"grd5",backgroundImage:"linear-gradient(to top, #30cfd0 0%, #330867 100%)",color:"#fff"},{configId:"grd6",backgroundImage:"linear-gradient(135deg, #FDEB71 10%, #F8D800 100%)"},{configId:"grd7",backgroundImage:"linear-gradient( 135deg, #F05F57 10%, #360940 100%)"},{configId:"grd8",color:"#4158D0",backgroundImage:"linear-gradient(43deg, #4158D0 0%, #C850C0 46%, #FFCC70 100%)"},{configId:"grd9",color:"#FBAB7E",backgroundImage:"linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%)"},{configId:"grd10",color:"#21D4FD",backgroundImage:"linear-gradient(19deg, #21D4FD 0%, #B721FF 100%)"},{configId:"grd11",backgroundImage:"linear-gradient( 109.5deg, rgba(76,221,242,1) 11.2%, rgba(92,121,255,1) 91.1% )"},{configId:"grd12",backgroundImage:"linear-gradient( 112.1deg, rgba(32,38,57,1) 11.4%, rgba(63,76,119,1) 70.2% )",color:"#fff"}];var Fe=n(7855),Qe=n(80147);function Be(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"div",2),c.NdJ("click",function(){const e=c.CHM(t).$implicit;return c.oxw().selectGradient(e)}),c._UZ(1,"div",3),c._UZ(2,"div",4),c.qZA()}if(2&t){const t=e.$implicit,n=c.oxw();c.ekj("active",(null==n.data.active?null:n.data.active.configId)===t.configId),c.xp6(1),c.Udp("background-image",t.backgroundImage)}}let He=(()=>{class t{constructor(t,e){this.data=t,this.overlayPanelRef=e,this.gradients=Ye}selectGradient(t){this.overlayPanelRef.close(t)}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(Fe.p,8),c.Y36(Qe.L))},t.\u0275cmp=c.Xpm({type:t,selectors:[["background-selector-gradient"]],decls:2,vars:1,consts:[[1,"auto-height-grid"],["class","grid-item",3,"active","click",4,"ngFor","ngForOf"],[1,"grid-item",3,"click"],[1,"grid-content"],[1,"grid-label"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.YNc(1,Be,3,4,"div",1),c.qZA()),2&t&&(c.xp6(1),c.Q6J("ngForOf",e.gradients))},directives:[Z.sg],styles:["[_nghost-%COMP%]{display:block;padding:15px;background-color:var(--be-background);width:500px;max-width:95%;border-radius:4px}"],changeDetection:0}),t})();var Ve=n(98979),ze=n(58901);let Ge=(()=>{class t{constructor(t,e,n,i){this.uploadQueue=t,this.imgValidator=e,this.el=n,this.bgUrl=i,this.imgUploaded=new c.vpe}ngOnChanges(){this.el.nativeElement.style.backgroundImage=this.selectedBg&&"uploadedImg"===this.selectedBg.configId?this.bgUrl.transform(this.selectedBg.backgroundImage):null}openUploadDialog(){(0,Wt.r)({types:[te.j.image]}).then(t=>{this.uploadQueue.start(t,{validator:this.imgValidator,httpParams:{diskPrefix:"biolink",disk:"public"}}).subscribe(t=>{this.imgUploaded.emit(Object.assign(Object.assign({},Ee),{backgroundImage:t.fileEntry.url}))})})}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(Kt.A),c.Y36(ne.G),c.Y36(c.SBq),c.Y36(ze.j))},t.\u0275cmp=c.Xpm({type:t,selectors:[["background-selector-img"]],hostBindings:function(t,e){1&t&&c.NdJ("click",function(t){return e.openUploadDialog(t.target)})},inputs:{selectedBg:"selectedBg"},outputs:{imgUploaded:"imgUploaded"},features:[c.TTD],decls:2,vars:0,consts:[[1,"icon-container"],["svgIcon","add-photo-alternate"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c._UZ(1,"mat-icon",1),c.qZA())},directives:[k.Hw],styles:["[_nghost-%COMP%]{color:#fff;position:relative}.icon-container[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0;bottom:0;margin:auto;background-color:rgba(0,0,0,.3);padding:4px 4px 6px 6px;border-radius:4px;width:50px;height:50px}.mat-icon[_ngcontent-%COMP%]{width:40px;height:40px}"],changeDetection:0}),t})(),je=(()=>{class t{transform(t){if(t)return t.split("/").pop().split(".")[0].replace("-"," ")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275pipe=c.Yjl({name:"labelFromFilename",type:t,pure:!0}),t})();function Xe(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"background-selector-img",7),c.NdJ("imgUploaded",function(e){return c.CHM(t),c.oxw(2).selectBackground(e)}),c.ALo(1,"async"),c.qZA()}if(2&t){const t=c.oxw(2);c.Q6J("selectedBg",c.lcZ(1,1,t.selectedBg$))}}function We(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"div",8),c.NdJ("click",function(e){c.CHM(t);const n=c.oxw().$implicit;return c.oxw().onBgClick(n,e)}),c.ALo(1,"backgroundUrl"),c.qZA()}if(2&t){const t=c.oxw().$implicit;c.Udp("background-color",t.color)("background-image",c.lcZ(1,4,t.backgroundImage))}}function Ke(t,e){if(1&t&&(c.ynx(0),c.TgZ(1,"div"),c.TgZ(2,"div",2),c.ALo(3,"async"),c.ynx(4,3),c.YNc(5,Xe,2,3,"background-selector-img",4),c.YNc(6,We,2,6,"div",5),c.BQk(),c.qZA(),c.TgZ(7,"div",6),c._uU(8),c.ALo(9,"trans"),c.ALo(10,"labelFromFilename"),c.qZA(),c.qZA(),c.BQk()),2&t){const t=e.$implicit,n=c.oxw();let i;c.xp6(2),c.ekj("active",(null==(i=c.lcZ(3,5,n.selectedBg$))?null:i.id)===t.configId),c.xp6(2),c.Q6J("ngSwitch",t.configId),c.xp6(1),c.Q6J("ngSwitchCase","uploadedImg"),c.xp6(3),c.hij(" ",c.lcZ(9,7,t.configLabel||c.lcZ(10,9,t.backgroundImage))," ")}}let tn=(()=>{class t{constructor(t){this.overlay=t,this.backgrounds=De,this.selectedBg$=new o.X(null)}registerOnChange(t){this.propagateChange=t}writeValue(t){this.selectedBg$.next(t)}registerOnTouched(t){}onBgClick(t,e){var n;"flat"===t.configId?(this.setFlatColorBg(null===(n=this.selectedBg$.value)||void 0===n?void 0:n.color),this.openColorPicker(e)):"gradient"===t.configId?this.overlay.open(He,{origin:new c.SBq(e.target),position:$e.Z,data:{active:this.selectedBg$.value}}).afterClosed().subscribe(t=>{t&&this.selectBackground(t)}):this.selectBackground(t)}selectBackground(t){var e;const n=null===(e=this.selectedBg$.value)||void 0===e?void 0:e.color,i=Object.assign({},t);!i.color&&n&&(i.color=n),this.propagateChange(i),this.selectedBg$.next(i)}setFlatColorBg(t){this.selectBackground(Object.assign(Object.assign({},Le),{color:t}))}openColorPicker(t){var e;return(0,Je.mG)(this,void 0,void 0,function*(){const{BeColorPickerModule:i}=yield n.e(378).then(n.bind(n,49378)),o=this.overlay.open(i.components.panel,{origin:new c.SBq(t.target),position:$e.Z,data:{color:null===(e=this.selectedBg$.value)||void 0===e?void 0:e.color}});o.valueChanged().pipe((0,Re.R)(o.afterClosed())).subscribe(t=>{this.setFlatColorBg(t)})})}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(Ve.T))},t.\u0275cmp=c.Xpm({type:t,selectors:[["background-selector"]],features:[c._Bn([{provide:p.JU,useExisting:t,multi:!0}])],decls:2,vars:1,consts:[[1,"auto-height-grid"],[4,"ngFor","ngForOf"],[1,"grid-item"],[3,"ngSwitch"],["class","grid-content","matRipple","",3,"selectedBg","imgUploaded",4,"ngSwitchCase"],["class","grid-content","matRipple","",3,"background-color","background-image","click",4,"ngSwitchDefault"],[1,"grid-label"],["matRipple","",1,"grid-content",3,"selectedBg","imgUploaded"],["matRipple","",1,"grid-content",3,"click"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.YNc(1,Ke,11,11,"ng-container",1),c.qZA()),2&t&&(c.xp6(1),c.Q6J("ngForOf",e.backgrounds))},directives:[Z.sg,Z.RF,Z.n9,Z.ED,Ge,qt.wG],pipes:[Z.Ov,$t.R,je,ze.j],styles:[".auto-height-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(auto-fill,minmax(130px,1fr))}.grid-item[_ngcontent-%COMP%]{padding-top:140%}.grid-content[_ngcontent-%COMP%]{background-size:cover;background-position:50%;border-radius:4px}background-selector-img.grid-content[_ngcontent-%COMP%]{border:1px dashed var(--be-secondary-text)}"],changeDetection:0}),t})();var en=n(9636);const nn=[{family:"Impact, Charcoal, sans-serif",category:"sans-serif"},{family:"Arial, Helvetica Neue, Helvetica, sans-serif",category:"serif"},{family:'"Comic Sans MS", cursive, sans-serif',category:"Handwriting"},{family:"Century Gothic, sans-serif",category:"sans-serif"},{family:'"Courier New", Courier, monospace',category:"monospace"},{family:'"Lucida Sans Unicode", "Lucida Grande", sans-serif',category:"sans-serif"},{family:'"Times New Roman", Times, serif',category:"serif"},{family:'"Lucida Console", Monaco, monospace',category:"monospace"},{family:'"Andele Mono", monospace, sans-serif',category:"sans-serif"},{family:"Verdana, Geneva, sans-serif",category:"sans-serif"},{family:'"Helvetica Neue", Helvetica, Arial, sans-serif',category:"sans-serif"}];var on=n(39404);let sn=(()=>{class t{transform(t){return t?t.split(",")[0].replace(/"/g,"").trim():null}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275pipe=c.Yjl({name:"fontDisplayName",type:t,pure:!0}),t})();function an(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"div",19),c.NdJ("click",function(){const e=c.CHM(t).$implicit;return c.oxw().selectFamily(e.family)}),c.ALo(1,"async"),c.TgZ(2,"div",20),c.TgZ(3,"div",21),c.O4$(),c.TgZ(4,"svg",22),c.TgZ(5,"text",23),c._uU(6,"Aa"),c.qZA(),c.qZA(),c.qZA(),c.qZA(),c.kcU(),c.TgZ(7,"div",24),c._uU(8),c.ALo(9,"fontDisplayName"),c.qZA(),c.qZA()}if(2&t){const t=e.$implicit,n=c.oxw();c.ekj("active",c.lcZ(1,5,n.selectedFamily$)===t.family),c.xp6(5),c.Udp("font-family",t.family),c.xp6(3),c.Oqu(c.lcZ(9,7,t.family))}}let rn=(()=>{class t{constructor(t){this.googleFonts=t,this.activePage$=new o.X(0),this.chunkedFonts$=new o.X(null),this.selectedFamily$=new o.X(null),this.filters=new p.cw({query:new p.NI,category:new p.NI(null)}),this.from$=this.activePage$.pipe((0,Et.U)(t=>t*this.perPage+1)),this.total$=new o.X(1052),this.to$=this.from$.pipe((0,Et.U)(t=>Math.min(t+this.perPage-1),this.total$.value)),this.fonts$=(0,St.aj)(this.activePage$,this.chunkedFonts$).pipe((0,Et.U)(([t,e])=>e?e[t]:[])),this.perPage=20}ngOnInit(){this.allFonts=[...nn],this.googleFonts.getAll().subscribe(t=>{this.allFonts=[...this.allFonts,...t],this.chunkFonts(this.allFonts)}),this.fontSub=this.fonts$.subscribe(t=>{this.loadIntoDom(t)}),this.formSub=this.filters.valueChanges.subscribe(t=>{var e;let n=(null===(e=t.query)||void 0===e?void 0:e.length)?(0,en.D)(this.allFonts,t.query):this.allFonts;n=t.category?n.filter(e=>e.category.toLowerCase()===t.category.toLowerCase()):n,this.activePage$.next(0),this.chunkFonts(n)})}ngOnDestroy(){this.formSub.unsubscribe(),this.fontSub.unsubscribe()}selectFamily(t){this.selectedFamily$.next(t),this.propagateChange({family:t})}haveNext(){var t;return(null===(t=this.chunkedFonts$.value)||void 0===t?void 0:t.length)>this.activePage$.value+1}havePrev(){return this.activePage$.value>0}nextPage(){this.activePage$.next(this.activePage$.value+1)}prevPage(){this.activePage$.next(this.activePage$.value-1)}registerOnChange(t){this.propagateChange=t}writeValue(t){this.selectedFamily$.next(null==t?void 0:t.family)}registerOnTouched(t){}chunkFonts(t){const e=this.perPage,n=[];for(let i=0,o=t.length;i<o;i+=e)n.push(t.slice(i,i+e));this.chunkedFonts$.next(n),this.total$.next(t.length)}loadIntoDom(t){this.googleFonts.loadIntoDom(t,"google-font-selector")}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(on.I))},t.\u0275cmp=c.Xpm({type:t,selectors:[["google-font-selector"]],features:[c._Bn([{provide:p.JU,useExisting:t,multi:!0}])],decls:36,vars:21,consts:[[1,"filters","inline-inputs-container","many-inputs",3,"formGroup"],[1,"input-container"],["for","font-selector-search","trans","",1,"hidden"],["type","text","id","font-selector-search","formControlName","query","placeholder","Search..."],["for","font-selector-category","trans","",1,"hidden"],["id","font-selector-category","formControlName","category"],["trans","",3,"ngValue"],["value","serif","trans",""],["value","sans-serif","trans",""],["value","display","trans",""],["value","handwriting","trans",""],["value","monospace","trans",""],[1,"font-grid"],["class","font",3,"active","click",4,"ngFor","ngForOf"],[1,"range-actions"],[1,"range-label"],["type","button","mat-icon-button","",1,"range-button",3,"disabled","click"],["svgIcon","chevron-left"],["svgIcon","chevron-right"],[1,"font",3,"click"],["role","button","matRipple","",1,"grid-item"],[1,"grid-content"],["viewBox","0 0 100 100"],["x","50%","y","50%"],[1,"label"]],template:function(t,e){1&t&&(c.TgZ(0,"form",0),c.TgZ(1,"div",1),c.TgZ(2,"label",2),c._uU(3,"Search"),c.qZA(),c._UZ(4,"input",3),c.qZA(),c.TgZ(5,"div",1),c.TgZ(6,"label",4),c._uU(7,"Category"),c.qZA(),c.TgZ(8,"select",5),c.TgZ(9,"option",6),c._uU(10,"All Categories"),c.qZA(),c.TgZ(11,"option",7),c._uU(12,"Serif"),c.qZA(),c.TgZ(13,"option",8),c._uU(14,"Sans Serif"),c.qZA(),c.TgZ(15,"option",9),c._uU(16,"Display"),c.qZA(),c.TgZ(17,"option",10),c._uU(18,"Handwriting"),c.qZA(),c.TgZ(19,"option",11),c._uU(20,"monospace"),c.qZA(),c.qZA(),c.qZA(),c.qZA(),c.TgZ(21,"div",12),c.YNc(22,an,10,9,"div",13),c.ALo(23,"async"),c.qZA(),c.TgZ(24,"div",14),c.TgZ(25,"div",15),c._uU(26),c.ALo(27,"async"),c.ALo(28,"async"),c.ALo(29,"trans"),c.ALo(30,"number"),c.ALo(31,"async"),c.qZA(),c.TgZ(32,"button",16),c.NdJ("click",function(){return e.prevPage()}),c._UZ(33,"mat-icon",17),c.qZA(),c.TgZ(34,"button",16),c.NdJ("click",function(){return e.nextPage()}),c._UZ(35,"mat-icon",18),c.qZA(),c.qZA()),2&t&&(c.Q6J("formGroup",e.filters),c.xp6(9),c.Q6J("ngValue",null),c.xp6(13),c.Q6J("ngForOf",c.lcZ(23,9,e.fonts$)),c.xp6(4),c.HOy(" ",c.lcZ(27,11,e.from$)," - ",c.lcZ(28,13,e.to$)," ",c.lcZ(29,15,"of")," ",c.lcZ(30,17,c.lcZ(31,19,e.total$))," "),c.xp6(6),c.Q6J("disabled",!e.havePrev()),c.xp6(2),c.Q6J("disabled",!e.haveNext()))},directives:[p._Y,p.JL,p.sg,C.P,p.Fj,p.JJ,p.u,p.EJ,p.YN,p.Kr,Z.sg,T.lW,k.Hw,qt.wG],pipes:[Z.Ov,$t.R,Z.JJ,sn],styles:["[_nghost-%COMP%]{display:block}.font-grid[_ngcontent-%COMP%]{display:grid;grid-gap:15px;grid-template-columns:repeat(auto-fill,minmax(99px,1fr))}.grid-item[_ngcontent-%COMP%]{padding-top:100%;position:relative;cursor:pointer}.grid-item[_ngcontent-%COMP%]:hover{background-color:var(--be-hover)}.active[_ngcontent-%COMP%] .grid-content[_ngcontent-%COMP%]{border-color:var(--be-accent-default)}.grid-content[_ngcontent-%COMP%]{border:1px solid var(--be-divider-default);border-radius:4px;position:absolute;top:0;left:0;right:0;bottom:0;margin:auto}.label[_ngcontent-%COMP%]{margin-top:6px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 5px}.preview[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;font-size:4rem;height:100%}svg[_ngcontent-%COMP%]{width:100%;height:100%}svg[_ngcontent-%COMP%] text[_ngcontent-%COMP%]{font-size:4rem;dominant-baseline:central;text-anchor:middle}.range-actions[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;margin-top:25px}.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}),t})(),ln=(()=>{class t{constructor(t){this.editor=t}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["biolink-editor-fonts"]],decls:4,vars:1,consts:[["trans",""],[1,"material-panel"],[3,"formControl"]],template:function(t,e){1&t&&(c.TgZ(0,"h3",0),c._uU(1,"Fonts"),c.qZA(),c.TgZ(2,"div",1),c._UZ(3,"google-font-selector",2),c.qZA()),2&t&&(c.xp6(3),c.Q6J("formControl",e.editor.appearanceForm.get("fontConfig")))},directives:[C.P,rn,p.JJ,p.oH],styles:[""],changeDetection:0}),t})();var cn=n(69042);function dn(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"div",2),c.TgZ(1,"h4",0),c._uU(2,"Raised"),c.qZA(),c.TgZ(3,"div",3),c.TgZ(4,"div",4),c.TgZ(5,"button",5),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("raised","square")}),c._uU(6," Square "),c.qZA(),c.qZA(),c.TgZ(7,"div",4),c.TgZ(8,"button",6),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("raised","rounded")}),c._uU(9," Rounded "),c.qZA(),c.qZA(),c.TgZ(10,"div",4),c.TgZ(11,"button",7),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("raised","pill")}),c._uU(12," Pill "),c.qZA(),c.qZA(),c.qZA(),c.TgZ(13,"h4",0),c._uU(14,"Flat"),c.qZA(),c.TgZ(15,"div",3),c.TgZ(16,"div",4),c.TgZ(17,"button",8),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("flat","square")}),c._uU(18," Square "),c.qZA(),c.qZA(),c.TgZ(19,"div",4),c.TgZ(20,"button",9),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("flat","rounded")}),c._uU(21," Rounded "),c.qZA(),c.qZA(),c.TgZ(22,"div",4),c.TgZ(23,"button",10),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("flat","pill")}),c._uU(24," Pill "),c.qZA(),c.qZA(),c.qZA(),c.TgZ(25,"h4",0),c._uU(26,"Outline"),c.qZA(),c.TgZ(27,"div",3),c.TgZ(28,"div",4),c.TgZ(29,"button",11),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("stroked","square")}),c._uU(30," Square "),c.qZA(),c.qZA(),c.TgZ(31,"div",4),c.TgZ(32,"button",12),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("stroked","rounded")}),c._uU(33," Rounded "),c.qZA(),c.qZA(),c.TgZ(34,"div",4),c.TgZ(35,"button",13),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("stroked","pill")}),c._uU(36," Pill "),c.qZA(),c.qZA(),c.qZA(),c.TgZ(37,"h4",0),c._uU(38,"Basic"),c.qZA(),c.TgZ(39,"div",3),c.TgZ(40,"div",4),c.TgZ(41,"button",14),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("basic","square")}),c._uU(42," Square "),c.qZA(),c.qZA(),c.TgZ(43,"div",4),c.TgZ(44,"button",15),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("basic","rounded")}),c._uU(45," Rounded "),c.qZA(),c.qZA(),c.TgZ(46,"div",4),c.TgZ(47,"button",16),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("basic","pill")}),c._uU(48," Pill "),c.qZA(),c.qZA(),c.qZA(),c.TgZ(49,"color-picker-input",17),c._uU(50,"Button Color"),c.qZA(),c.qZA()}if(2&t){const t=e.ngIf,n=c.oxw();c.xp6(4),c.ekj("active","raised"===t.type&&"square"===t.variant),c.xp6(3),c.ekj("active","raised"===t.type&&"rounded"===t.variant),c.xp6(3),c.ekj("active","raised"===t.type&&"pill"===t.variant),c.xp6(6),c.ekj("active","flat"===t.type&&"square"===t.variant),c.xp6(3),c.ekj("active","flat"===t.type&&"rounded"===t.variant),c.xp6(3),c.ekj("active","flat"===t.type&&"pill"===t.variant),c.xp6(6),c.ekj("active","stroked"===t.type&&"square"===t.variant),c.xp6(3),c.ekj("active","stroked"===t.type&&"rounded"===t.variant),c.xp6(3),c.ekj("active","stroked"===t.type&&"pill"===t.variant),c.xp6(6),c.ekj("active","basic"===t.type&&"square"===t.variant),c.xp6(3),c.ekj("active","basic"===t.type&&"rounded"===t.variant),c.xp6(3),c.ekj("active","basic"===t.type&&"pill"===t.variant),c.xp6(3),c.Q6J("formControl",n.colorControl)}}let un=(()=>{class t{constructor(t){this.editor=t,this.colorControl=new p.NI,this.active$=this.editor.appearanceForm.get("btnConfig").valueChanges.pipe((0,i.O)({}),(0,Et.U)(t=>null!=t?t:{}))}ngOnInit(){this.colorControl.valueChanges.subscribe(t=>{this.editor.appearanceForm.get("btnConfig.color").setValue(t),this.editor.appearanceForm.markAsDirty()})}changeBtnType(t,e){this.editor.appearanceForm.patchValue({btnConfig:{type:t,variant:e}}),this.editor.appearanceForm.markAsDirty()}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["biolink-editor-buttons"]],decls:4,vars:3,consts:[["trans",""],["class","material-panel",4,"ngIf"],[1,"material-panel"],[1,"row"],[1,"border"],["type","button","color","accent","mat-raised-button","","trans","",1,"btn-square",3,"click"],["type","button","color","accent","mat-raised-button","","trans","",3,"click"],["type","button","color","accent","mat-raised-button","","trans","",1,"btn-pill",3,"click"],["type","button","color","accent","mat-flat-button","","trans","",1,"btn-square",3,"click"],["type","button","color","accent","mat-flat-button","","trans","",3,"click"],["type","button","color","accent","mat-flat-button","","trans","",1,"btn-pill",3,"click"],["type","button","color","accent","mat-stroked-button","","trans","",1,"btn-square",3,"click"],["type","button","color","accent","mat-stroked-button","","trans","",3,"click"],["type","button","color","accent","mat-stroked-button","","trans","",1,"btn-pill",3,"click"],["type","button","color","accent","mat-button","","trans","",1,"btn-square","basic-btn",3,"click"],["type","button","color","accent","mat-button","","trans","",1,"basic-btn",3,"click"],["type","button","color","accent","mat-button","","trans","",1,"btn-pill","basic-btn",3,"click"],["trans","",3,"formControl"]],template:function(t,e){1&t&&(c.TgZ(0,"h3",0),c._uU(1,"Buttons"),c.qZA(),c.YNc(2,dn,51,25,"div",1),c.ALo(3,"async")),2&t&&(c.xp6(2),c.Q6J("ngIf",c.lcZ(3,1,e.active$)))},directives:[C.P,Z.O5,T.lW,cn.M,p.JJ,p.oH],pipes:[Z.Ov],styles:["[_nghost-%COMP%]{display:block}h4[_ngcontent-%COMP%]{font-size:1.4rem;margin:0 0 10px}.row[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,1fr);grid-gap:24px;margin:0 -10px 20px}button[_ngcontent-%COMP%]{min-height:45px;width:100%}.btn-square[_ngcontent-%COMP%]{border-radius:0}.btn-pill[_ngcontent-%COMP%]{border-radius:30px}.basic-btn[_ngcontent-%COMP%]{border:1px dashed var(--be-divider-lighter)}.border[_ngcontent-%COMP%]{border:4px solid transparent;border-radius:4px;padding:5px}.border.active[_ngcontent-%COMP%]{border-color:var(--be-divider-default)}"],changeDetection:0}),t})(),pn=(()=>{class t{constructor(t){this.editor=t}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["biolink-appearance"]],decls:13,vars:4,consts:[["trans",""],["trans","",1,"tab-description"],["mat-raised-button","","type","button","color","accent","trans","",1,"save-button",3,"disabled","click"],[1,"material-panel"],[3,"formControl"]],template:function(t,e){1&t&&(c.TgZ(0,"h2",0),c._uU(1,"Custom Appearance"),c.qZA(),c.TgZ(2,"p",1),c._uU(3," Fully customize your Biolink. Change background color or select gradients and images. Choose button style, text color, typeface and more.\n"),c.qZA(),c.TgZ(4,"button",2),c.NdJ("click",function(){return e.editor.saveAppearance()}),c.ALo(5,"async"),c._uU(6," Save Changes\n"),c.qZA(),c.TgZ(7,"h3",0),c._uU(8,"Background"),c.qZA(),c.TgZ(9,"div",3),c._UZ(10,"background-selector",4),c.qZA(),c._UZ(11,"biolink-editor-fonts"),c._UZ(12,"biolink-editor-buttons")),2&t&&(c.xp6(4),c.Q6J("disabled",c.lcZ(5,2,e.editor.loading$)||e.editor.appearanceForm.pristine),c.xp6(6),c.Q6J("formControl",e.editor.appearanceForm.get("bgConfig")))},directives:[C.P,T.lW,tn,p.JJ,p.oH,ln,un],pipes:[Z.Ov],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{font-size:2.4rem;margin:0 0 10px}h3[_ngcontent-%COMP%]{font-size:2rem}.tab-description[_ngcontent-%COMP%]{margin:0 0 15px}.save-button[_ngcontent-%COMP%]{margin:0 0 40px} .mat-tab-label-content{text-transform:capitalize}.material-panel[_ngcontent-%COMP%]{max-height:550px;overflow:auto}"],changeDetection:0}),t})();var hn=n(32198),gn=n(43835),mn=n(90611),fn=n(25051),bn=n(28505),vn=n(53129),_n=n(29738);function xn(t,e){if(1&t&&(c.TgZ(0,"div",14),c._uU(1),c.qZA()),2&t){const t=c.oxw().ngIf;c.xp6(1),c.Oqu(t.name)}}function Zn(t,e){if(1&t&&(c.TgZ(0,"div",14),c._uU(1),c.qZA()),2&t){const t=c.oxw().ngIf;c.xp6(1),c.Oqu(t.hash)}}function yn(t,e){if(1&t&&(c.TgZ(0,"div",4),c.TgZ(1,"div",5),c.TgZ(2,"label",6),c._uU(3,"Name"),c.qZA(),c._UZ(4,"input",7),c.YNc(5,xn,2,1,"div",8),c.qZA(),c.TgZ(6,"div",9),c._UZ(7,"slug-control",10),c.ALo(8,"async"),c.YNc(9,Zn,2,1,"div",8),c.qZA(),c.TgZ(10,"div",11),c.TgZ(11,"label",12),c._uU(12,"Description"),c.qZA(),c._UZ(13,"textarea",13),c.qZA(),c.qZA()),2&t){const t=e.ngIf,n=c.oxw();c.Q6J("formGroup",n.linkForm.formGroup),c.xp6(5),c.Q6J("ngIf",t.name),c.xp6(2),c.Q6J("baseUri",c.lcZ(8,4,n.slugBaseUri$)),c.xp6(2),c.Q6J("ngIf",t.hash)}}let wn=(()=>{class t{constructor(t,e,n,i,s,a,r){this.linkForm=t,this.valueLists=e,this.currentUser=n,this.fb=i,this.settings=s,this.editor=a,this.toast=r,this.hiddenFeatures={alias:!0,linkGroups:!0,details:!0},this.slugBaseUri$=new o.X(null),this.options$=new o.X(null),this.form=this.fb.group({name:""}),this.errors$=new o.X({})}ngOnInit(){this.valueLists.get(["countries","domains","pixels"],{userId:this.currentUser.get("id")}).subscribe(t=>{this.options$.next(t)}),(0,St.aj)(this.linkForm.formGroup.get("domain_id").valueChanges,this.options$.pipe((0,gn.h)(t=>!!t))).subscribe(([t,e])=>{this.setSlugBaseUri(t)}),this.editor.biolink$.pipe((0,gn.h)(t=>!!t),(0,mn.q)(1)).subscribe(t=>{this.linkForm.patchValue(t)})}saveSettings(){return this.editor.loading$.next(!0),this.editor.biolinks.update(this.editor.biolink$.value.id,this.linkForm.value()).pipe((0,s.x)(()=>this.editor.loading$.next(!1))).subscribe(()=>{this.toast.open("Biolink updated")},t=>this.errors$.next(t.errors))}setSlugBaseUri(t){this.slugBaseUri$.next(t?this.options$.value.domains.find(e=>e.id===t).host:this.settings.getBaseUrl())}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(hn.l),c.Y36(fn.l),c.Y36(bn.I),c.Y36(p.qu),c.Y36(_.Z),c.Y36(b),c.Y36(u.F))},t.\u0275cmp=c.Xpm({type:t,selectors:[["biolink-settings"]],features:[c._Bn([hn.l])],decls:8,vars:10,consts:[["ngNativeValidate","",1,"material-panel",3,"ngSubmit"],[3,"formGroup",4,"ngIf"],["resourceName","biolink",3,"featuresToHide","linkOptions"],["type","submit","mat-raised-button","","color","accent","trans","",3,"disabled"],[3,"formGroup"],[1,"input-container","name-container"],["for","link-group-name","trans",""],["type","text","id","link-group-name","formControlName","name","required","","minlength","3"],["class","error",4,"ngIf"],[1,"input-container","slug-container"],["formControlName","hash",3,"baseUri"],[1,"input-container"],["for","link-group-description","trans",""],["id","link-group-description","formControlName","description"],[1,"error"]],template:function(t,e){1&t&&(c.TgZ(0,"form",0),c.NdJ("ngSubmit",function(){return e.saveSettings()}),c.YNc(1,yn,14,6,"div",1),c.ALo(2,"async"),c._UZ(3,"link-options-form",2),c.ALo(4,"async"),c.TgZ(5,"button",3),c.ALo(6,"async"),c._uU(7," Save "),c.qZA(),c.qZA()),2&t&&(c.xp6(1),c.Q6J("ngIf",c.lcZ(2,4,e.errors$)),c.xp6(2),c.Q6J("featuresToHide",e.hiddenFeatures)("linkOptions",c.lcZ(4,6,e.options$)),c.xp6(2),c.Q6J("disabled",c.lcZ(6,8,e.editor.loading$)))},directives:[p.JL,p.F,Z.O5,vn.O,T.lW,C.P,p.sg,p.Fj,p.JJ,p.u,p.Q7,p.wO,_n.b],pipes:[Z.Ov],styles:["[_nghost-%COMP%]{display:block}.slug-container[_ngcontent-%COMP%]{margin:8px 0 20px}link-options-form[_ngcontent-%COMP%]{margin-top:10px}"],changeDetection:0}),t})();var kn=n(78671);function An(t,e){1&t&&c._UZ(0,"biolink-editor-content",8)}function Cn(t,e){1&t&&c._UZ(0,"biolink-appearance",8)}function Tn(t,e){1&t&&c._UZ(0,"biolink-settings",8)}function qn(t,e){if(1&t&&(c.TgZ(0,"div",9),c.TgZ(1,"div",10),c.TgZ(2,"a",11),c._uU(3),c.qZA(),c.qZA(),c._UZ(4,"share-link-btns",12),c.qZA()),2&t){const t=e.ngIf;c.xp6(2),c.Q6J("href",t.short_url,c.LSH),c.xp6(1),c.Oqu(t.short_url),c.xp6(1),c.Q6J("showCopyBtn",!0)("colored",!0)("link",t)}}let In=(()=>{class t{constructor(t,e,n,o,s,a,r,l){this.modal=t,this.biolinks=e,this.widgets=n,this.route=o,this.toast=s,this.settings=a,this.router=r,this.editor=l,this.appearance$=this.editor.appearanceForm.valueChanges.pipe((0,i.O)({}))}ngOnInit(){this.route.params.subscribe(t=>{this.editor.reloadBiolink(t.linkId)}),this.route.queryParams.subscribe(t=>{this.editor.activeTab$.next(f[t.tab||"links"])})}tabChanged(t){this.router.navigate([],{queryParams:{tab:Object.entries(f)[t.index][0]},replaceUrl:!0})}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(m.u),c.Y36(d.n),c.Y36(g),c.Y36(v.gz),c.Y36(u.F),c.Y36(_.Z),c.Y36(v.F0),c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["biolink-editor"]],decls:19,vars:21,consts:[[1,"left-col"],["dynamicHeight","","color","accent","animationDuration","0",3,"selectedIndex","selectedTabChange"],[3,"label"],["matTabContent",""],[1,"right-col"],["class","preview-title",4,"ngIf"],[1,"phone-preview"],[3,"biolink","appearance"],[1,"left-col-spacer"],[1,"preview-title"],[1,"link"],["target","_blank",3,"href"],[3,"showCopyBtn","colored","link"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"mat-tab-group",1),c.NdJ("selectedTabChange",function(t){return e.tabChanged(t)}),c.ALo(2,"async"),c.TgZ(3,"mat-tab",2),c.ALo(4,"trans"),c.YNc(5,An,1,0,"ng-template",3),c.qZA(),c.TgZ(6,"mat-tab",2),c.ALo(7,"trans"),c.YNc(8,Cn,1,0,"ng-template",3),c.qZA(),c.TgZ(9,"mat-tab",2),c.ALo(10,"trans"),c.YNc(11,Tn,1,0,"ng-template",3),c.qZA(),c.qZA(),c.qZA(),c.TgZ(12,"div",4),c.YNc(13,qn,5,5,"div",5),c.ALo(14,"async"),c.TgZ(15,"div",6),c._UZ(16,"biolink-page",7),c.ALo(17,"async"),c.ALo(18,"async"),c.qZA(),c.qZA()),2&t&&(c.xp6(1),c.Q6J("selectedIndex",c.lcZ(2,7,e.editor.activeTab$)),c.xp6(2),c.Q6J("label",c.lcZ(4,9,"Content")),c.xp6(3),c.Q6J("label",c.lcZ(7,11,"Appearance")),c.xp6(3),c.Q6J("label",c.lcZ(10,13,"Settings")),c.xp6(4),c.Q6J("ngIf",c.lcZ(14,15,e.editor.biolink$)),c.xp6(3),c.Q6J("biolink",c.lcZ(17,17,e.editor.biolink$))("appearance",c.lcZ(18,19,e.appearance$)))},directives:[x.SP,x.uX,x.Vc,Z.O5,y.v,Ne,pn,wn,kn.t],pipes:[Z.Ov,$t.R],styles:["@media only screen and (min-width:768px){[_nghost-%COMP%]{display:flex}}[_nghost-%COMP%] .mat-tab-label-content{text-transform:capitalize}.left-col[_ngcontent-%COMP%]{flex:1 1 auto}@media only screen and (min-width:768px){.left-col[_ngcontent-%COMP%]{padding-right:40px}}.left-col-spacer[_ngcontent-%COMP%]{max-width:650px;margin:0 auto;position:relative;padding:40px 0}.right-col[_ngcontent-%COMP%]{padding:0 40px 40px;border-left:1px solid var(--be-divider-default);flex-shrink:0}@media only screen and (max-width:768px){.right-col[_ngcontent-%COMP%]{display:none}}.preview-title[_ngcontent-%COMP%]{display:flex;align-items:center;padding-bottom:8px;margin-bottom:55px;border-bottom:1px solid var(--be-divider-default)}.preview-title[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]{flex:1 1 auto;margin-right:auto;color:var(--be-link);text-decoration:underline;max-width:175px;overflow:hidden;text-overflow:ellipsis}.preview-title[_ngcontent-%COMP%] share-link-btns[_ngcontent-%COMP%]{flex-shrink:0;margin-left:15px}.phone-preview[_ngcontent-%COMP%]{width:352px;height:724px;border-radius:64px;box-shadow:0 0 30px rgba(0,0,0,.2);border:12px solid #444546;overflow:hidden;position:sticky;top:135px}biolink-page[_ngcontent-%COMP%]{height:100%;width:100%;min-height:100%}"],changeDetection:0}),t})()},4512:function(t,e,n){"use strict";n.d(e,{o:function(){return z}});var i=n(56515),o=n(36024),s=n(90832),a=n(28577),r=n(76512),l=n(35366),c=n(28505),d=n(73234),u=n(63337),p=n(36501),h=n(48865),g=n(95157),m=n(24859),f=n(38116),b=n(49517),v=n(34955),_=n(56361),x=n(84369),Z=n(77307),y=n(61116),w=n(13536),k=n(80922),A=n(86668),C=n(27701),T=n(54275),q=n(24311),I=n(19708),O=n(71765),U=n(47210),P=n(2406),M=n(40450);function S(t,e){1&t&&l._UZ(0,"mat-progress-bar",22)}function N(t,e){1&t&&(l.TgZ(0,"th",23),l._uU(1,"Owner"),l.qZA())}const J=function(t){return{count:t,resource:"biolink(s)"}};function E(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"tr"),l.TgZ(1,"th",24),l.TgZ(2,"div",25),l._uU(3," :count :resource selected: "),l.qZA(),l.TgZ(4,"div",26),l.TgZ(5,"permission-aware-button",27),l.TgZ(6,"button",28),l.NdJ("click",function(){return l.CHM(t),l.oxw().maybeDeleteSelectedBiolinks()}),l._uU(7," Delete "),l.qZA(),l.qZA(),l.qZA(),l.qZA(),l.qZA()}if(2&t){const t=e.ngIf;l.xp6(2),l.Q6J("transValues",l.VKq(1,J,t))}}function L(t,e){if(1&t&&(l.TgZ(0,"td",48),l._UZ(1,"user-column",49),l.qZA()),2&t){const t=l.oxw().$implicit;l.xp6(1),l.Q6J("user",t.user)}}function D(t,e){1&t&&l._UZ(0,"mat-icon",50)}function $(t,e){1&t&&(l.TgZ(0,"span"),l._uU(1,"-"),l.qZA())}function R(t,e){1&t&&l._UZ(0,"mat-icon",50)}function Y(t,e){1&t&&(l.TgZ(0,"span"),l._uU(1,"-"),l.qZA())}const F=function(t){return["/",t]},Q=function(t){return[t,"analytics"]},B=function(t){return[t,"edit"]};function H(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"tr"),l._UZ(1,"td",29),l.TgZ(2,"td",30),l.TgZ(3,"a",31),l._uU(4),l.qZA(),l.qZA(),l.YNc(5,L,2,1,"td",32),l.TgZ(6,"td",33),l._uU(7),l.qZA(),l.TgZ(8,"td",34),l.YNc(9,D,1,0,"mat-icon",35),l.YNc(10,$,2,0,"span",19),l.qZA(),l.TgZ(11,"td",36),l.YNc(12,R,1,0,"mat-icon",35),l.YNc(13,Y,2,0,"span",19),l.qZA(),l.TgZ(14,"td",37),l._uU(15),l.ALo(16,"formattedDate"),l.qZA(),l.TgZ(17,"td",38),l.TgZ(18,"button",39),l.ALo(19,"trans"),l._UZ(20,"mat-icon",40),l.qZA(),l.TgZ(21,"permission-aware-button",41),l.TgZ(22,"button",42),l.ALo(23,"trans"),l._UZ(24,"mat-icon",43),l.qZA(),l.qZA(),l._UZ(25,"copy-link-btn",44),l.TgZ(26,"permission-aware-button",45),l.TgZ(27,"button",46),l.NdJ("click",function(){const e=l.CHM(t).$implicit;return l.oxw().maybeDeleteSelectedBiolinks([e.id])}),l._UZ(28,"mat-icon",47),l.qZA(),l.qZA(),l.qZA(),l.qZA()}if(2&t){const t=e.$implicit,n=l.oxw();l.xp6(1),l.Q6J("table-body-checkbox",t.id),l.xp6(2),l.Q6J("routerLink",l.VKq(22,F,t.hash)),l.xp6(1),l.Oqu(t.name),l.xp6(1),l.Q6J("ngIf",n.showUserColumn()),l.xp6(2),l.Oqu(t.links_count),l.xp6(2),l.Q6J("ngIf",t.active),l.xp6(1),l.Q6J("ngIf",!t.active),l.xp6(2),l.Q6J("ngIf",t.rotator),l.xp6(1),l.Q6J("ngIf",!t.rotator),l.xp6(2),l.Oqu(l.lcZ(16,16,t.updated_at)),l.xp6(3),l.Q6J("routerLink",l.VKq(24,Q,t.id))("matTooltip",l.lcZ(19,18,"Analytics")),l.xp6(3),l.Q6J("userOwnsResource",n.currentUser.get("id")===t.user_id),l.xp6(1),l.Q6J("routerLink",l.VKq(26,B,t.id))("matTooltip",l.lcZ(23,20,"Edit")),l.xp6(3),l.Q6J("model",t)}}function V(t,e){1&t&&(l.TgZ(0,"no-results-message",51),l.TgZ(1,"span",52),l._uU(2,"No biolinks have been created yet"),l.qZA(),l.qZA())}let z=(()=>{class t{constructor(t,e,n,i,o,a,r,l,c,d){this.datatable=t,this.currentUser=e,this.biolinks=n,this.toast=i,this.route=o,this.linkUsage=a,this.activeSection=r,this.workspaces=l,this.modal=c,this.router=d,this.biolinks$=this.datatable.data$,this.filters=s.L}ngOnInit(){this.workspaceSub=this.workspaces.activeId$.subscribe(()=>{this.setFilters()}),this.datatable.init({uri:r.n.BASE_URI,staticParams:{with:["user"],withCount:["links"],userId:this.showUserColumn()?null:this.currentUser.get("id")}})}ngOnDestroy(){this.workspaceSub.unsubscribe()}maybeDeleteSelectedBiolinks(t){this.datatable.confirmResourceDeletion("biolinks").subscribe(()=>{this.biolinks.delete(t||this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset(),this.toast.open("Biolink deleted")},t=>{this.toast.open(t.message||o.v.Default)})})}showUserColumn(){return this.activeSection.admin||!!this.workspaces.activeId$.value}setFilters(){this.filters=s.L.filter(t=>"user_id"!==t.key||this.showUserColumn())}openCreateBiolinkModal(){this.modal.open(a.L,{type:"biolink"}).afterClosed().subscribe(t=>{t&&this.router.navigate(["/",this.activeSection.admin?"admin":"dashboard","biolinks",t.id,"edit"])})}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(i.x),l.Y36(c.I),l.Y36(r.n),l.Y36(d.F),l.Y36(u.gz),l.Y36(p.F),l.Y36(h.W),l.Y36(g.b),l.Y36(m.u),l.Y36(u.F0))},t.\u0275cmp=l.Xpm({type:t,selectors:[["biolink-index"]],features:[l._Bn([i.x])],decls:43,vars:12,consts:[[1,"datatable-page-header"],["trans",""],["trans","",1,"title"],[1,"header"],["pluralName","biolinks",3,"filters"],[1,"action-buttons"],["permission","biolinks.create"],["mat-raised-button","","color","accent","trans","",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","","trans",""],["table-sort-header","user_id","trans","",4,"ngIf"],["table-sort-header","links_count","trans",""],["table-sort-header","public","trans",""],["table-sort-header","rotator","trans",""],["table-sort-header","updated_at","trans",""],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","marketing.svg",4,"ngIf"],["mode","indeterminate","color","accent",1,"loading-bar"],["table-sort-header","user_id","trans",""],["colspan","6"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["permission","biolinks.delete"],["type","button","mat-raised-button","","color","warn","trans","",3,"click"],[3,"table-body-checkbox"],["data-label","Name"],["target","_blank",1,"link-group-name",3,"routerLink"],["data-label","Owner",4,"ngIf"],["data-label","Link Count"],["data-label","Public"],["svgIcon","check",4,"ngIf"],["data-label","Rotator"],["data-label","Last Updated"],[1,"edit-column"],["type","button","mat-icon-button","",3,"routerLink","matTooltip"],["svgIcon","bar-chart"],["permission","biolinks.update",3,"userOwnsResource"],["mat-icon-button","",3,"routerLink","matTooltip"],["svgIcon","edit"],[3,"model"],["permission","biolinks.delete",1,"visible-on-mobile"],["type","button","mat-icon-button","","trans","",3,"click"],["svgIcon","delete"],["data-label","Owner"],[3,"user"],["svgIcon","check"],["svgImage","marketing.svg"],["primary-text","","trans",""]],template:function(t,e){1&t&&(l.TgZ(0,"div",0),l.TgZ(1,"h1"),l.TgZ(2,"span",1),l._uU(3,"Biolinks"),l.qZA(),l.TgZ(4,"info-popover"),l.TgZ(5,"div",2),l._uU(6,"Link in Bio"),l.qZA(),l.TgZ(7,"div",1),l._uU(8,"Offer multiple choices to your followers when they click on your Biolink. Share all your Social Media profiles, videos, songs, articles and other important links with just one url."),l.qZA(),l.qZA(),l.qZA(),l.TgZ(9,"div",3),l._UZ(10,"datatable-filters",4),l.TgZ(11,"div",5),l.TgZ(12,"permission-aware-button",6),l.TgZ(13,"button",7),l.NdJ("click",function(){return e.openCreateBiolinkModal()}),l._UZ(14,"mat-icon",8),l.TgZ(15,"span",1),l._uU(16,"Add New Biolink"),l.qZA(),l.qZA(),l.qZA(),l.qZA(),l.qZA(),l.qZA(),l.TgZ(17,"div",9),l.YNc(18,S,1,0,"mat-progress-bar",10),l.ALo(19,"async"),l.TgZ(20,"table",11),l.TgZ(21,"thead"),l.TgZ(22,"tr"),l._UZ(23,"th",12),l.TgZ(24,"th",13),l._uU(25,"Name"),l.qZA(),l.YNc(26,N,2,0,"th",14),l.TgZ(27,"th",15),l._uU(28,"Links"),l.qZA(),l.TgZ(29,"th",16),l._uU(30,"Public"),l.qZA(),l.TgZ(31,"th",17),l._uU(32,"Rotator"),l.qZA(),l.TgZ(33,"th",18),l._uU(34,"Last Updated"),l.qZA(),l._UZ(35,"th"),l.qZA(),l.YNc(36,E,8,3,"tr",19),l.qZA(),l.TgZ(37,"tbody"),l.YNc(38,H,29,28,"tr",20),l.ALo(39,"async"),l.qZA(),l.qZA(),l.YNc(40,V,3,0,"no-results-message",21),l.ALo(41,"async"),l._UZ(42,"datatable-footer"),l.qZA()),2&t&&(l.xp6(10),l.Q6J("filters",e.filters),l.xp6(8),l.Q6J("ngIf",l.lcZ(19,6,e.datatable.paginator&&e.datatable.paginator.loading$)),l.xp6(8),l.Q6J("ngIf",e.showUserColumn()),l.xp6(10),l.Q6J("ngIf",e.datatable.selectedRows$.value.length),l.xp6(2),l.Q6J("ngForOf",l.lcZ(39,8,e.biolinks$)),l.xp6(2),l.Q6J("ngIf",l.lcZ(41,10,e.datatable.paginator.noResults$)))},directives:[f.P,b.N,v.h,_.v,x.lW,Z.Hw,y.O5,w.e,k.p,y.sg,A.V,C.pW,T.O,u.yS,u.rH,q.gM,I.b,O.r,U.U],pipes:[y.Ov,P.l,M.R],styles:["h1[_ngcontent-%COMP%]{display:flex;align-items:center}"],changeDetection:0}),t})()},76512:function(t,e,n){"use strict";n.d(e,{n:function(){return s}});var i=n(35366),o=n(68515);let s=(()=>{class t{constructor(t){this.http=t}get(e,n){return this.http.get(`${t.BASE_URI}/${e}`,n)}create(e){return this.http.post(t.BASE_URI,e)}update(e,n){return this.http.put(`${t.BASE_URI}/${e}`,n)}delete(e){return this.http.delete(`${t.BASE_URI}/${e}`)}detach(e,n){return this.http.post(`${t.BASE_URI}/${e}/detach`,{contentItem:n})}changeOrder(e,n){return this.http.post(`${t.BASE_URI}/${e}/change-order`,{order:n})}analytics(t){return this.http.get(this.analyticsEndpoint(t))}analyticsEndpoint(e){return`${t.BASE_URI}/${e}/analytics`}saveAppearance(e,n){return this.http.post(`${t.BASE_URI}/${e}/appearance`,{config:n})}updateContentItemConfig(e,n,i){return this.http.post(`${t.BASE_URI}/${e}/update-content-config`,Object.assign({item_id:n.id,item_model_type:n.model_type},i))}}return t.BASE_URI="biolink",t.\u0275fac=function(e){return new(e||t)(i.LFG(o.r))},t.\u0275prov=i.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},93836:function(t,e,n){"use strict";n.d(e,{z:function(){return N}});var i=n(84222),o=n(31041),s=n(43835),a=n(66599),r=n(11520),l=n(79996),c=n(78512),d=n(3080),u=n(83693),p=n(18948),h=n(35366),g=n(78733),m=n(131),f=n(88195),b=n(3950),v=n(68515),_=n(61116),x=n(42300),Z=n(92762),y=n(38116),w=n(92007);const k=["*"];let A=(()=>{class t{constructor(t){this.fb=t,this.setDefaultDate=!1,this.showLabels=!1,this.datePattern="([12]\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01]))",this.initiated=!1,this.form=this.fb.group({from:[""],to:[""]}),this.defaultFrom=this.getDefaultDate(7),this.defaultTo=this.getDefaultDate()}writeValue(t){Array.isArray(t)||(t=(t||"").split(":"));let[e,n]=t;!this.initiated&&this.setDefaultDate&&(e=e||this.defaultFrom,n=n||this.defaultTo),this.initiated=!0,this.form.patchValue({from:e,to:n})}registerOnChange(t){this.propagateChange=t,this.form.valueChanges.pipe((0,s.h)(t=>t.from&&t.to)).subscribe(t=>{this.propagateChange(`${t.from}:${t.to}`)})}registerOnTouched(){}getDefaultDate(t=0){const e=new Date;e.setDate(e.getDate()-t);const n=this.addZero(e.getMonth()+1),i=this.addZero(e.getDate());return`${e.getFullYear()}-${n}-${i}`}addZero(t){return t<10?"0"+t:""+t}}return t.\u0275fac=function(e){return new(e||t)(h.Y36(o.qu))},t.\u0275cmp=h.Xpm({type:t,selectors:[["between-input"]],inputs:{setDefaultDate:"setDefaultDate",showLabels:"showLabels"},features:[h._Bn([{provide:o.JU,useExisting:t,multi:!0}])],ngContentSelectors:k,decls:12,vars:9,consts:[[3,"formGroup"],["trans",""],[1,"inline-inputs-container"],[1,"input-container"],["for","from","trans",""],["type","date","id","from","formControlName","from","required","",3,"placeholder","pattern"],["for","to","trans",""],["type","date","id","to","formControlName","to","required","",3,"placeholder","pattern"]],template:function(t,e){1&t&&(h.F$t(),h.TgZ(0,"fieldset",0),h.TgZ(1,"legend",1),h.Hsn(2),h.qZA(),h.TgZ(3,"div",2),h.TgZ(4,"div",3),h.TgZ(5,"label",4),h._uU(6,"From"),h.qZA(),h._UZ(7,"input",5),h.qZA(),h.TgZ(8,"div",3),h.TgZ(9,"label",6),h._uU(10,"To"),h.qZA(),h._UZ(11,"input",7),h.qZA(),h.qZA(),h.qZA()),2&t&&(h.Q6J("formGroup",e.form),h.xp6(5),h.ekj("hidden",!e.showLabels),h.xp6(2),h.Q6J("placeholder",e.defaultFrom)("pattern",e.datePattern),h.xp6(2),h.ekj("hidden",!e.showLabels),h.xp6(2),h.Q6J("placeholder",e.defaultTo)("pattern",e.datePattern))},directives:[o.JL,o.sg,y.P,o.Fj,o.JJ,o.u,o.Q7,o.c5],styles:["legend[_ngcontent-%COMP%]{text-transform:capitalize}legend[_ngcontent-%COMP%]:empty{display:none}"],changeDetection:0}),t})();var C=n(84369),T=n(40450);const q=["countryChartPlaceholder"];function I(t,e){if(1&t){const t=h.EpF();h.TgZ(0,"div",31),h._UZ(1,"between-input",32),h.TgZ(2,"button",33),h.NdJ("click",function(){h.CHM(t);const e=h.oxw(2);return e.customRange$.next(e.customRangeControl.value)}),h.ALo(3,"async"),h._uU(4,"Apply"),h.qZA(),h.qZA()}if(2&t){const t=h.oxw(2);h.xp6(1),h.Q6J("formControl",t.customRangeControl),h.xp6(1),h.Q6J("disabled",!h.lcZ(3,2,t.customRangeControl.valueChanges))}}function O(t,e){if(1&t&&(h.TgZ(0,"a",38),h._uU(1),h.qZA()),2&t){const t=h.oxw().$implicit;h.Q6J("href",t.label,h.LSH),h.xp6(1),h.Oqu(t.label)}}function U(t,e){1&t&&(h.TgZ(0,"div",39),h._uU(1,"Direct, Email, SMS"),h.qZA())}function P(t,e){if(1&t&&(h.TgZ(0,"li",34),h.YNc(1,O,2,2,"a",35),h.YNc(2,U,2,0,"ng-template",null,36,h.W1O),h.TgZ(4,"div",37),h._uU(5),h.qZA(),h.qZA()),2&t){const t=e.$implicit,n=h.MAs(3);h.xp6(1),h.Q6J("ngIf",t.label)("ngIfElse",n),h.xp6(4),h.Oqu(t.count)}}function M(t,e){if(1&t&&(h.TgZ(0,"div",40),h.TgZ(1,"span",41),h._uU(2),h.qZA(),h._uU(3),h.qZA()),2&t){const t=e.$implicit;h.xp6(2),h.Oqu(t.label),h.xp6(1),h.hij(" (",t.percentage,"%) ")}}function S(t,e){if(1&t&&(h.ynx(0),h.TgZ(1,"header",2),h.TgZ(2,"mat-button-toggle-group",3),h.TgZ(3,"mat-button-toggle",4),h._uU(4,"Hourly"),h.qZA(),h.TgZ(5,"mat-button-toggle",5),h._uU(6,"Weekly"),h.qZA(),h.TgZ(7,"mat-button-toggle",6),h._uU(8,"Monthly"),h.qZA(),h.TgZ(9,"mat-button-toggle",7),h._uU(10,"Yearly"),h.qZA(),h.TgZ(11,"mat-button-toggle",8),h._uU(12,"Custom"),h.qZA(),h.qZA(),h.YNc(13,I,5,4,"div",9),h.ALo(14,"async"),h.qZA(),h.TgZ(15,"div",10),h.TgZ(16,"div",11),h.TgZ(17,"chart",12),h.TgZ(18,"div",13),h.TgZ(19,"div",14),h.TgZ(20,"div",15),h._uU(21),h.ALo(22,"trans"),h.qZA(),h.TgZ(23,"div",16),h._uU(24),h.ALo(25,"trans"),h.qZA(),h.qZA(),h.qZA(),h.qZA(),h.qZA(),h.TgZ(26,"div",17),h.TgZ(27,"chart",18),h.TgZ(28,"div",19),h.TgZ(29,"div",15),h._uU(30,"Top Devices"),h.qZA(),h.TgZ(31,"div",20),h._uU(32,"Click count by device"),h.qZA(),h.qZA(),h.qZA(),h.qZA(),h.qZA(),h.TgZ(33,"div",10),h.TgZ(34,"div",21),h.TgZ(35,"div",22),h.TgZ(36,"div",19),h.TgZ(37,"div",15),h._uU(38,"Referrers"),h.qZA(),h.TgZ(39,"div",20),h._uU(40,"Click count by referrer"),h.qZA(),h.qZA(),h.TgZ(41,"ul",23),h.YNc(42,P,6,3,"li",24),h.qZA(),h.qZA(),h.qZA(),h.TgZ(43,"div",25),h.TgZ(44,"div",22),h.TgZ(45,"div",19),h.TgZ(46,"div",15),h._uU(47,"Top Locations"),h.qZA(),h.TgZ(48,"div",20),h._uU(49,"Click count by country"),h.qZA(),h.qZA(),h.TgZ(50,"div",26),h._UZ(51,"div",27,28),h.TgZ(53,"div",29),h.YNc(54,M,4,2,"div",30),h.qZA(),h.qZA(),h.qZA(),h.qZA(),h.qZA(),h.TgZ(55,"div",10),h.TgZ(56,"div",17),h.TgZ(57,"chart",18),h.TgZ(58,"div",19),h.TgZ(59,"div",15),h._uU(60,"Top Browsers"),h.qZA(),h.TgZ(61,"div",20),h._uU(62,"Click count by browser"),h.qZA(),h.qZA(),h.qZA(),h.qZA(),h.TgZ(63,"div",17),h.TgZ(64,"chart",18),h.TgZ(65,"div",19),h.TgZ(66,"div",15),h._uU(67,"Top Platforms"),h.qZA(),h.TgZ(68,"div",20),h._uU(69,"Click count by OS"),h.qZA(),h.qZA(),h.qZA(),h.qZA(),h.qZA(),h.BQk()),2&t){const t=e.ngIf,n=h.oxw();h.xp6(2),h.Q6J("formControl",n.range),h.xp6(11),h.Q6J("ngIf","custom"===h.lcZ(14,11,n.range.valueChanges)),h.xp6(4),h.Q6J("chartConfig",t.clicks),h.xp6(4),h.Oqu(h.lcZ(22,13,"Clicks this "+n.getRangeName())),h.xp6(3),h.AsE("",t.totalClicks," ",h.lcZ(25,15,"Total Clicks"),""),h.xp6(3),h.Q6J("chartConfig",t.devices),h.xp6(15),h.Q6J("ngForOf",t.referrers),h.xp6(12),h.Q6J("ngForOf",t.locations),h.xp6(3),h.Q6J("chartConfig",t.browsers),h.xp6(7),h.Q6J("chartConfig",t.platforms)}}let N=(()=>{class t{constructor(t,e,n,s,a){this.loader=t,this.theme=e,this.settings=n,this.i18n=s,this.http=a,this.endpoint=`${i.M.BASE_URI}/analytics`,this.transformedReports$=new c.X({}),this.loading$=new c.X(!1),this.range=new o.NI("weekly"),this.customRangeControl=new o.NI,this.customRange$=new c.X("")}ngOnChanges(t){t.reports&&t.reports.currentValue&&(this.updateCharts(t.reports.currentValue),this.initGoogleWorldMap())}ngOnInit(){(0,d.aj)([this.range.valueChanges,this.customRange$]).pipe((0,s.h)(([t,e])=>"custom"!==t||!!e),(0,a.b)(()=>this.loading$.next(!0))).subscribe(([t,e])=>{this.getUpdateDataRequest(t,e).pipe((0,r.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.updateCharts(t),this.drawGoogleChart()})}),this.theme.selectedTheme$.subscribe(()=>{this.googleChart&&this.drawGoogleChart()})}getRangeName(){return"custom"===this.range.value?"period":this.range.value.replace("ly","")}getUpdateDataRequest(t,e){return this.http.get(this.endpoint,{range:t,customRange:e}).pipe((0,l.U)(t=>(0,p.w)("mainData",t)?t.mainData:t.analytics))}updateCharts(t){const e=Object.assign(Object.assign({},t),{browsers:this.transformData(null==t?void 0:t.browsers,u.o.PIE),platforms:this.transformData(null==t?void 0:t.platforms,u.o.PIE),devices:this.transformData(null==t?void 0:t.devices,u.o.PIE,!0),clicks:this.transformData(null==t?void 0:t.clicks,u.o.LINE)});this.transformedReports$.next(e)}transformData(t,e=u.o.LINE,n=!1){return t?{type:e,labels:t.map(t=>n?this.i18n.t(t.label):t.label),data:e===u.o.LINE?[t.map(t=>t.count)]:t.map(t=>t.count),legend:!1,tooltip:this.i18n.t("Click Count"),options:{showLabel:!0,donut:!0}}:{}}initGoogleWorldMap(){this.loader.loadAsset("https://www.gstatic.com/charts/loader.js",{type:"js"}).then(()=>{const t=window.google;t.charts.load("current",{packages:["geochart"],mapsApiKey:this.settings.get("links.gchart_api_key")}),t.charts.setOnLoadCallback(()=>{this.drawGoogleChart()})})}drawGoogleChart(){const t=window.google;let e=this.transformedReports$.value.locations.map(t=>[t.label,t.count]);e.unshift(["Country","Popularity"]),e=t.visualization.arrayToDataTable(e);const n={colorAxis:{colors:["#4662fa"]},backgroundColor:this.theme.selectedTheme$.value.is_dark?"#1D1D1D":null,datalessRegionColor:this.theme.selectedTheme$.value.is_dark?"#e9ecfe":null};this.googleChart||(this.googleChart=new t.visualization.GeoChart(this.iframe.nativeElement)),this.googleChart.draw(e,n)}}return t.\u0275fac=function(e){return new(e||t)(h.Y36(g.j),h.Y36(m.f),h.Y36(f.Z),h.Y36(b.Z),h.Y36(v.r))},t.\u0275cmp=h.Xpm({type:t,selectors:[["click-charts"]],viewQuery:function(t,e){if(1&t&&h.Gf(q,5),2&t){let t;h.iGM(t=h.CRH())&&(e.iframe=t.first)}},inputs:{reports:"reports",endpoint:"endpoint"},features:[h.TTD],decls:4,vars:6,consts:[[4,"ngIf"],[1,"overlay",3,"isVisible"],[1,"date-header"],[1,"right",3,"formControl"],["value","hourly","trans",""],["value","weekly","trans",""],["value","monthly","trans",""],["value","yearly","trans",""],["value","custom","trans",""],["class","custom-date-container",4,"ngIf"],[1,"chart-row"],[1,"chart-wrapper"],["height","400",1,"clicks-chart",3,"chartConfig"],[1,"chart-header","clicks-chart-header"],[1,"left"],["trans","",1,"title"],[1,"subtitle"],[1,"chart-wrapper","pie-wrapper"],["height","385",3,"chartConfig"],[1,"chart-header"],["trans","",1,"subtitle"],[1,"chart-wrapper","referrers-panel"],[1,"chart"],[1,"unstyled-list"],["class","referrer",4,"ngFor","ngForOf"],[1,"chart-wrapper","locations-panel"],[1,"chart-body"],[1,"country-chart-placeholder"],["countryChartPlaceholder",""],[1,"country-list"],["class","country",4,"ngFor","ngForOf"],[1,"custom-date-container"],[1,"click-charts-date-input",3,"formControl"],["type","button","mat-raised-button","","color","accent","trans","",1,"apply-custom-range-button",3,"disabled","click"],[1,"referrer"],["class","url","target","_blank",3,"href",4,"ngIf","ngIfElse"],["direct",""],[1,"count"],["target","_blank",1,"url",3,"href"],["trans",""],[1,"country"],[1,"country-name"]],template:function(t,e){1&t&&(h.YNc(0,S,70,17,"ng-container",0),h.ALo(1,"async"),h._UZ(2,"loading-indicator",1),h.ALo(3,"async")),2&t&&(h.Q6J("ngIf",h.lcZ(1,2,e.transformedReports$)),h.xp6(2),h.Q6J("isVisible",h.lcZ(3,4,e.loading$)))},directives:[_.O5,x.Q,Z.A9,o.JJ,o.oH,Z.Yi,y.P,w.x,_.sg,A,C.lW],pipes:[_.Ov,T.R],styles:["[_nghost-%COMP%]{display:block;overflow:hidden}.clicks-chart[_ngcontent-%COMP%] .chart-body[_ngcontent-%COMP%]{padding-right:15px}.date-header[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:25px}.custom-date-container[_ngcontent-%COMP%]{display:flex;align-items:center;margin-left:auto}@media only screen and (max-width:845px){.date-header[_ngcontent-%COMP%]{display:block;overflow-x:auto}.custom-date-container[_ngcontent-%COMP%]{margin-top:25px}} .click-charts-date-input input{background-color:var(--be-background)}.apply-custom-range-button[_ngcontent-%COMP%]{margin-left:10px}.title[_ngcontent-%COMP%]{text-transform:capitalize}.referrers-panel[_ngcontent-%COMP%]{overflow:auto}.referrers-panel[_ngcontent-%COMP%] .chart-header[_ngcontent-%COMP%]{margin-bottom:5px}.referrers-panel[_ngcontent-%COMP%] .referrer[_ngcontent-%COMP%]{display:flex;align-items:center;padding:5px 20px}.referrers-panel[_ngcontent-%COMP%] .count[_ngcontent-%COMP%]{background-color:var(--be-accent-default);color:var(--be-accent-contrast);font-size:1.2rem;padding:5px 10px;border-radius:4px;margin-left:auto;line-height:10px}.referrers-panel[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:85%}.referrers-panel[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.locations-panel[_ngcontent-%COMP%]{max-width:700px}.locations-panel[_ngcontent-%COMP%] .chart-body[_ngcontent-%COMP%]{display:flex;padding:0 15px}@media only screen and (max-width:768px){.locations-panel[_ngcontent-%COMP%]{height:auto;max-height:none}.locations-panel[_ngcontent-%COMP%] .chart-body[_ngcontent-%COMP%]{display:block}.locations-panel[_ngcontent-%COMP%] .country-list[_ngcontent-%COMP%]{padding:10px 0}}.locations-panel[_ngcontent-%COMP%] .country-chart-placeholder[_ngcontent-%COMP%]{flex:1 1 auto;height:100%}.locations-panel[_ngcontent-%COMP%] .country[_ngcontent-%COMP%]{padding:4px 0;white-space:nowrap;overflow:hidden;font-size:1.3rem}.locations-panel[_ngcontent-%COMP%] .country-name[_ngcontent-%COMP%]{display:inline-block;vertical-align:middle;max-width:150px;overflow:hidden;text-overflow:ellipsis}iframe[_ngcontent-%COMP%]{border:none;width:100%;height:100%}"],changeDetection:0}),t})()},69193:function(t,e,n){"use strict";n.d(e,{a:function(){return h}});var i=n(61116),o=n(20653),s=n(84369),a=n(77307),r=n(92762),l=n(68400),c=n(31041),d=n(99808),u=n(68692),p=n(35366);let h=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=p.oAB({type:t}),t.\u0275inj=p.cJS({imports:[[i.ez,o.m,l.N,c.UX,d.p,u.X,s.ot,a.Ps,r.vV]]}),t})()},66445:function(t,e,n){"use strict";n.r(e),n.d(e,{DashboardModule:function(){return On}});var i=n(61116),o=n(63337),s=n(84698),a=n(25051),r=n(14926),l=n(35366),c=n(36501),d=n(88195),u=n(70549),p=n(95157),h=n(86655),g=n(97070),m=n(36024),f=n(4694),b=n(43835),v=n(72798),_=n(24859),x=n(28505),Z=n(73234),y=n(38116),w=n(77307),k=n(84369),A=n(40450);function C(t,e){1&t&&(l.TgZ(0,"span",12),l._uU(1,"Personal workspace"),l.qZA())}const T=function(t){return{count:t}};function q(t,e){if(1&t&&(l.TgZ(0,"span",12),l._uU(1),l.ALo(2,"trans"),l.qZA()),2&t){const t=l.oxw().ngIf;l.xp6(1),l.Oqu(l.xi3(2,1,":count members",l.VKq(4,T,(null==t?null:t.members_count)||0)))}}function I(t,e){if(1&t&&(l.TgZ(0,"div",5),l.TgZ(1,"div",6),l.TgZ(2,"div",7),l._uU(3),l.qZA(),l.TgZ(4,"div",8),l.YNc(5,C,2,0,"span",9),l.YNc(6,q,3,6,"span",9),l.qZA(),l.qZA(),l.TgZ(7,"div",10),l._UZ(8,"mat-icon",11),l.qZA(),l.qZA()),2&t){const t=e.ngIf;l.oxw();const n=l.MAs(3);l.Q6J("matMenuTriggerFor",n),l.xp6(3),l.Oqu(t.name),l.xp6(2),l.Q6J("ngIf",t.default),l.xp6(1),l.Q6J("ngIf",!t.default)}}function O(t,e){1&t&&(l.TgZ(0,"span",12),l._uU(1,"Personal workspace"),l.qZA())}function U(t,e){if(1&t&&(l.TgZ(0,"span",12),l._uU(1),l.ALo(2,"trans"),l.qZA()),2&t){const t=l.oxw().$implicit;l.xp6(1),l.Oqu(l.xi3(2,1,":count members",l.VKq(4,T,(null==t?null:t.members_count)||0)))}}function P(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"button",17),l.NdJ("click",function(e){l.CHM(t);const n=l.oxw().$implicit;return l.oxw().openWorkspaceMembersModal(n),e.stopPropagation()}),l._UZ(1,"mat-icon",18),l.qZA()}}function M(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"div",13),l.NdJ("click",function(){const e=l.CHM(t).$implicit;return l.oxw().selectWorkspace(e)}),l.ALo(1,"async"),l._UZ(2,"mat-icon",14),l.ALo(3,"async"),l.TgZ(4,"div"),l.TgZ(5,"div",15),l._uU(6),l.qZA(),l.TgZ(7,"div",8),l.YNc(8,O,2,0,"span",9),l.YNc(9,U,3,6,"span",9),l.qZA(),l.qZA(),l.YNc(10,P,2,0,"button",16),l.qZA()}if(2&t){const t=e.$implicit,n=l.oxw();l.ekj("active",l.lcZ(1,8,n.workspaces.activeId$)===t.id),l.xp6(2),l.ekj("visually-hidden",l.lcZ(3,10,n.workspaces.activeId$)!==t.id),l.xp6(4),l.Oqu(t.name),l.xp6(2),l.Q6J("ngIf",t.default),l.xp6(1),l.Q6J("ngIf",!t.default),l.xp6(1),l.Q6J("ngIf",!t.default)}}function S(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"div",19),l.NdJ("click",function(){return l.CHM(t),l.oxw().openCrupdateWorkspaceModal()}),l._UZ(1,"mat-icon",20),l.TgZ(2,"span",12),l._uU(3,"Create new workspace"),l.qZA(),l.qZA()}}let N=(()=>{class t{constructor(t,e,n,i,o,s){this.modal=t,this.workspaces=e,this.currentUser=n,this.toast=i,this.vcr=o,this.cd=s}ngOnInit(){this.workspaces.indexUserWorkspaces().subscribe()}openCrupdateWorkspaceModal(t){Promise.resolve().then(n.bind(n,75428)).then(e=>{this.modal.open(e.WorkspaceModule.components.crupdateModal,{workspace:t},{viewContainerRef:this.vcr}),this.cd.markForCheck()})}openWorkspaceMembersModal(t){Promise.resolve().then(n.bind(n,75428)).then(e=>{this.modal.open(e.WorkspaceModule.components.manageMembers,{workspace:t},{viewContainerRef:this.vcr}),this.cd.markForCheck(),this.menuTrigger.closeMenu()})}maybeDeleteWorkspace(t){const e=Object.assign(Object.assign({},v.M),{replacements:{resource:"workspace"}});this.modal.open(f.z,e).afterClosed().pipe((0,b.h)(t=>t)).subscribe(()=>{this.workspaces.delete([t.id]).subscribe(()=>{this.toast.open("Workspace deleted.")},t=>{this.toast.open(t.message||m.v.Default)})})}selectWorkspace(t){this.workspaces.select(t.id),this.menuTrigger.closeMenu()}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(_.u),l.Y36(p.b),l.Y36(x.I),l.Y36(Z.F),l.Y36(l.s_b),l.Y36(l.sBO))},t.\u0275cmp=l.Xpm({type:t,selectors:[["workspace-selector"]],viewQuery:function(t,e){if(1&t&&l.Gf(g.p6,5),2&t){let t;l.iGM(t=l.CRH())&&(e.menuTrigger=t.first)}},decls:7,vars:7,consts:[[3,"matMenuTriggerFor",4,"ngIf"],[1,"workspace-menu"],["workspaceMenu","matMenu"],["mat-menu-item","","class","workspace-menu-item",3,"active","click",4,"ngFor","ngForOf"],["mat-menu-item","","class","new-workspace-menu-item",3,"click",4,"ngIf"],[3,"matMenuTriggerFor"],[1,"left"],["trans","",1,"role-name"],[1,"member-count"],["trans","",4,"ngIf"],[1,"right"],["svgIcon","unfold-more"],["trans",""],["mat-menu-item","",1,"workspace-menu-item",3,"click"],["svgIcon","check"],["trans","",1,"name"],["type","button","class","settings-button","mat-icon-button","",3,"click",4,"ngIf"],["type","button","mat-icon-button","",1,"settings-button",3,"click"],["svgIcon","settings"],["mat-menu-item","",1,"new-workspace-menu-item",3,"click"],["svgIcon","add"]],template:function(t,e){1&t&&(l.YNc(0,I,9,4,"div",0),l.ALo(1,"async"),l.TgZ(2,"mat-menu",1,2),l.YNc(4,M,11,12,"div",3),l.ALo(5,"async"),l.YNc(6,S,4,0,"div",4),l.qZA()),2&t&&(l.Q6J("ngIf",l.lcZ(1,3,e.workspaces.activeWorkspace$)),l.xp6(4),l.Q6J("ngForOf",l.lcZ(5,5,e.workspaces.available$)),l.xp6(2),l.Q6J("ngIf",e.currentUser.hasPermission("workspaces.create")))},directives:[i.O5,g.VK,i.sg,g.p6,y.P,w.Hw,g.OP,k.lW],pipes:[i.Ov,A.R],styles:[".mat-menu-trigger[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;cursor:pointer;height:100%}.right[_ngcontent-%COMP%]{margin-left:auto;flex-shrink:0}.role-name[_ngcontent-%COMP%]{font-weight:500;text-transform:capitalize}.workspace-menu-item[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:normal;min-width:248px;line-height:normal;height:52px}.workspace-menu-item.active[_ngcontent-%COMP%]{color:var(--be-accent-default)}.workspace-menu-item.active[_ngcontent-%COMP%] .member-count[_ngcontent-%COMP%]{color:inherit}.workspace-menu-item[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{flex-shrink:0;color:inherit}.workspace-menu-item[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{margin-right:10px;flex:1 1 auto;font-size:1.5rem;text-transform:capitalize}.new-workspace-menu-item[_ngcontent-%COMP%]{border-top:1px solid var(--be-divider-default);margin-top:8px;padding-top:4px;font-size:1.5rem}.member-count[_ngcontent-%COMP%]{color:var(--be-secondary-text);font-size:1.3rem}.settings-button[_ngcontent-%COMP%]{margin-left:auto;color:var(--be-secondary-text);width:30px;height:30px;line-height:30px}.settings-button[_ngcontent-%COMP%]:hover{color:var(--be-accent-default)}.settings-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{width:18px;height:18px;line-height:18px;margin-right:0}"],changeDetection:0}),t})();var J=n(35944),E=n(2406);function L(t,e){if(1&t&&(l.TgZ(0,"li"),l._uU(1),l.ALo(2,"number"),l.ALo(3,"trans"),l.ALo(4,"trans"),l.ALo(5,"trans"),l.qZA()),2&t){const t=l.oxw().ngIf;l.xp6(1),l.Oqu(l.lcZ(2,1,t.links.used)+" "+l.lcZ(3,3,"out of")+" "+(t.links.total||l.lcZ(4,5,"Unlimited"))+" "+l.lcZ(5,7,"Links"))}}function D(t,e){if(1&t&&(l.TgZ(0,"li"),l._uU(1),l.ALo(2,"number"),l.ALo(3,"trans"),l.ALo(4,"trans"),l.ALo(5,"trans"),l.qZA()),2&t){const t=l.oxw().ngIf;l.xp6(1),l.Oqu(l.lcZ(2,1,t.biolinks.used)+" "+l.lcZ(3,3,"out of")+" "+(t.biolinks.total||l.lcZ(4,5,"Unlimited"))+" "+l.lcZ(5,7,"Biolinks"))}}function $(t,e){if(1&t&&(l.TgZ(0,"li"),l._uU(1),l.ALo(2,"number"),l.ALo(3,"trans"),l.ALo(4,"trans"),l.ALo(5,"trans"),l.qZA()),2&t){const t=l.oxw().ngIf;l.xp6(1),l.Oqu(l.lcZ(2,1,t.link_clicks.used)+" "+l.lcZ(3,3,"out of")+" "+(t.link_clicks.total||l.lcZ(4,5,"Unlimited"))+" "+l.lcZ(5,7,"Visitors"))}}function R(t,e){if(1&t&&(l.TgZ(0,"li"),l._uU(1),l.ALo(2,"trans"),l.ALo(3,"trans"),l.ALo(4,"trans"),l.qZA()),2&t){const t=l.oxw().ngIf;l.xp6(1),l.Oqu(t.link_overlays.used+" "+l.lcZ(2,1,"out of")+" "+(t.link_overlays.total||l.lcZ(3,3,"Unlimited"))+" "+l.lcZ(4,5,"Link Overlays"))}}function Y(t,e){if(1&t&&(l.TgZ(0,"li"),l._uU(1),l.ALo(2,"trans"),l.ALo(3,"trans"),l.ALo(4,"trans"),l.qZA()),2&t){const t=l.oxw().ngIf;l.xp6(1),l.Oqu(t.custom_pages.used+" "+l.lcZ(2,1,"out of")+" "+(t.custom_pages.total||l.lcZ(3,3,"Unlimited"))+" "+l.lcZ(4,5,"Custom Link Pages"))}}function F(t,e){if(1&t&&(l.TgZ(0,"li"),l._uU(1),l.ALo(2,"trans"),l.ALo(3,"trans"),l.ALo(4,"trans"),l.qZA()),2&t){const t=l.oxw().ngIf;l.xp6(1),l.Oqu(t.custom_domains.used+" "+l.lcZ(2,1,"out of")+" "+(t.custom_domains.total||l.lcZ(3,3,"Unlimited"))+" "+l.lcZ(4,5,"Custom Domains"))}}function Q(t,e){if(1&t&&(l.TgZ(0,"li"),l._uU(1),l.ALo(2,"number"),l.ALo(3,"trans"),l.ALo(4,"trans"),l.ALo(5,"trans"),l.qZA()),2&t){const t=l.oxw().ngIf;l.xp6(1),l.Oqu(l.lcZ(2,1,t.link_groups.used)+" "+l.lcZ(3,3,"out of")+" "+(t.link_groups.total||l.lcZ(4,5,"Unlimited"))+" "+l.lcZ(5,7,"Link Groups"))}}function B(t,e){if(1&t&&(l.TgZ(0,"li"),l._uU(1),l.ALo(2,"trans"),l.ALo(3,"trans"),l.ALo(4,"trans"),l.qZA()),2&t){const t=l.oxw().ngIf;l.xp6(1),l.Oqu(t.tracking_pixels.used+" "+l.lcZ(2,1,"out of")+" "+(t.tracking_pixels.total||l.lcZ(3,3,"Unlimited"))+" "+l.lcZ(4,5,"Tracking Pixels"))}}function H(t,e){if(1&t&&(l.TgZ(0,"ul",4),l.YNc(1,L,6,9,"li",5),l.YNc(2,D,6,9,"li",5),l.YNc(3,$,6,9,"li",5),l.YNc(4,R,5,7,"li",5),l.YNc(5,Y,5,7,"li",5),l.YNc(6,F,5,7,"li",5),l.YNc(7,Q,6,9,"li",5),l.YNc(8,B,5,7,"li",5),l.qZA()),2&t){const t=e.ngIf;l.xp6(1),l.Q6J("ngIf",t.links.create),l.xp6(1),l.Q6J("ngIf",t.biolinks.create),l.xp6(1),l.Q6J("ngIf",t.link_clicks.create),l.xp6(1),l.Q6J("ngIf",t.link_overlays.create),l.xp6(1),l.Q6J("ngIf",t.custom_pages.create),l.xp6(1),l.Q6J("ngIf",t.custom_domains.create),l.xp6(1),l.Q6J("ngIf",t.link_groups.create),l.xp6(1),l.Q6J("ngIf",t.tracking_pixels.create)}}let V=(()=>{class t{constructor(t,e){this.linkUsage=t,this.currentUser=e}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(c.F),l.Y36(x.I))},t.\u0275cmp=l.Xpm({type:t,selectors:[["link-usage-info"]],decls:12,vars:15,consts:[[1,"header"],[1,"current-plan"],[1,"next-payment"],["class","unstyled-list",4,"ngIf"],[1,"unstyled-list"],[4,"ngIf"]],template:function(t,e){if(1&t&&(l.TgZ(0,"div",0),l.TgZ(1,"div",1),l._uU(2),l.ALo(3,"trans"),l.ALo(4,"trans"),l.qZA(),l.TgZ(5,"div",2),l._uU(6),l.ALo(7,"trans"),l.ALo(8,"formattedDate"),l.ALo(9,"trans"),l.qZA(),l.qZA(),l.YNc(10,H,9,8,"ul",3),l.ALo(11,"async")),2&t){let t,n;l.xp6(2),l.hij(" ",l.lcZ(3,3,"Current Plan")+": "+((null==(t=e.currentUser.getSubscription())||null==t.plan?null:t.plan.name)||l.lcZ(4,5,"Free"))," "),l.xp6(4),l.hij(" ",l.lcZ(7,7,"Next Payment")+": "+(l.lcZ(8,9,null==(n=e.currentUser.getSubscription())?null:n.renews_at)||l.lcZ(9,11,"Never"))," "),l.xp6(4),l.Q6J("ngIf",l.lcZ(11,13,e.linkUsage.response$).usage)}},directives:[i.O5],pipes:[A.R,E.l,i.Ov,i.JJ],styles:["[_nghost-%COMP%]{display:block;background-color:var(--be-background);box-shadow:0 3px 3px -2px rgba(0,0,0,.2),0 3px 4px 0 rgba(0,0,0,.14),0 1px 8px 0 rgba(0,0,0,.12);border-radius:4px;padding:15px}.header[_ngcontent-%COMP%]{margin-bottom:10px;padding-bottom:10px;border-bottom:1px solid var(--be-divider-lighter)}.current-plan[_ngcontent-%COMP%]{font-weight:500;font-size:1.5rem}.next-payment[_ngcontent-%COMP%]{font-size:1.3rem;color:var(--be-secondary-text)}li[_ngcontent-%COMP%]{padding:5px 0;font-size:1.5rem}"],changeDetection:0}),t})();var z=n(72674),G=n(98979),j=n(27701);const X=["infoIcon"],W=function(t,e){return{number:t,total:e}};function K(t,e){if(1&t){const t=l.EpF();l.ynx(0),l._UZ(1,"mat-progress-bar",6),l.TgZ(2,"div",7),l.TgZ(3,"div",8),l.ALo(4,"number"),l.ALo(5,"trans"),l.ALo(6,"number"),l._uU(7," :number of :total links created "),l.qZA(),l.TgZ(8,"mat-icon",9,10),l.NdJ("click",function(){return l.CHM(t),l.oxw(3).togglePopover()})("mouseenter",function(){return l.CHM(t),l.oxw(3).openPopover()})("mouseleave",function(){return l.CHM(t),l.oxw(3).closePopover()}),l.qZA(),l.qZA(),l.BQk()}if(2&t){const t=l.oxw().ngIf;l.xp6(1),l.Q6J("value",t.usage.links.used/t.usage.links.total*100),l.xp6(2),l.Q6J("transValues",l.WLB(8,W,l.lcZ(4,2,t.usage.links.used),l.lcZ(5,4,l.lcZ(6,6,t.usage.links.total)||"Unlimited")))}}function tt(t,e){1&t&&(l.TgZ(0,"a",11),l._uU(1,"Upgrade Account"),l.qZA())}function et(t,e){1&t&&(l.TgZ(0,"a",12),l._uU(1,"Upgrade"),l.qZA())}function nt(t,e){if(1&t&&(l.TgZ(0,"div",2),l.YNc(1,K,10,11,"ng-container",0),l.TgZ(2,"div",3),l.YNc(3,tt,2,0,"a",4),l.YNc(4,et,2,0,"a",5),l.qZA(),l.qZA()),2&t){const t=e.ngIf,n=l.oxw(2);l.xp6(1),l.Q6J("ngIf",t.usage.links),l.xp6(2),l.Q6J("ngIf",!n.compact),l.xp6(1),l.Q6J("ngIf",n.compact)}}function it(t,e){if(1&t&&(l.ynx(0),l.YNc(1,nt,5,3,"div",1),l.ALo(2,"async"),l.BQk()),2&t){const t=l.oxw();l.xp6(1),l.Q6J("ngIf",l.lcZ(2,1,t.linkUsage.response$))}}let ot=(()=>{class t{constructor(t,e,n,i){this.settings=t,this.linkUsage=e,this.currentUser=n,this.overlay=i,this.compact=!1}ngOnInit(){this.linkUsage.reload()}openPopover(){this.overlayRef&&this.closePopover(),Object.assign({},z.Z)[0].offsetY=-15,this.overlayRef=this.overlay.open(V,{origin:this.infoIcon,position:z.Z,hasBackdrop:!1})}closePopover(){this.overlayRef&&this.overlayRef.close(),this.overlayRef=null}togglePopover(){this.overlayRef?this.closePopover():this.openPopover()}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(d.Z),l.Y36(c.F),l.Y36(x.I),l.Y36(G.T))},t.\u0275cmp=l.Xpm({type:t,selectors:[["upgrade-panel"]],viewQuery:function(t,e){if(1&t&&l.Gf(X,5,l.SBq),2&t){let t;l.iGM(t=l.CRH())&&(e.infoIcon=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&l.ekj("compact",e.compact)},inputs:{compact:"compact"},decls:1,vars:1,consts:[[4,"ngIf"],["class","upgrade-panel",4,"ngIf"],[1,"upgrade-panel"],[1,"upgrade-link-container"],["routerLink","/billing/upgrade","target","_blank","trans","",4,"ngIf"],["routerLink","/billing/upgrade","class","compact-link","target","_blank","trans","",4,"ngIf"],["mode","determinate","color","accent",3,"value"],[1,"usage-info"],["trans","",1,"text",3,"transValues"],["svgIcon","info",1,"info-icon",3,"click","mouseenter","mouseleave"],["infoIcon",""],["routerLink","/billing/upgrade","target","_blank","trans",""],["routerLink","/billing/upgrade","target","_blank","trans","",1,"compact-link"]],template:function(t,e){1&t&&l.YNc(0,it,3,3,"ng-container",0),2&t&&l.Q6J("ngIf",e.settings.get("billing.enable"))},directives:[i.O5,j.pW,y.P,w.Hw,o.yS],pipes:[i.Ov,i.JJ,A.R],styles:["[_nghost-%COMP%]{margin-top:auto;padding:15px 15px 0}.usage-info[_ngcontent-%COMP%]{display:flex;align-items:center;margin:5px 0;font-size:1.3rem;color:var(--be-secondary-text)}.usage-info[_ngcontent-%COMP%] .info-icon[_ngcontent-%COMP%]{margin-left:auto;flex-shrink:0;width:18px;height:18px}.usage-info[_ngcontent-%COMP%] .info-icon[_ngcontent-%COMP%]:hover{color:var(--be-primary-default)}.compact[_nghost-%COMP%], .compact [_nghost-%COMP%]{padding:15px 5px 0}.compact[_nghost-%COMP%] .mat-progress-bar[_ngcontent-%COMP%], .compact [_nghost-%COMP%] .mat-progress-bar[_ngcontent-%COMP%]{display:none}.compact[_nghost-%COMP%] .text[_ngcontent-%COMP%], .compact [_nghost-%COMP%] .text[_ngcontent-%COMP%]{display:none}.compact[_nghost-%COMP%] .info-icon[_ngcontent-%COMP%], .compact [_nghost-%COMP%] .info-icon[_ngcontent-%COMP%]{margin-right:auto}.compact[_nghost-%COMP%] .link-container[_ngcontent-%COMP%], .compact [_nghost-%COMP%] .link-container[_ngcontent-%COMP%]{text-align:center;font-size:1.3rem}"],changeDetection:0}),t})();var st=n(60467),at=n(30307);function rt(t,e){1&t&&l._UZ(0,"app-footer")}let lt=(()=>{class t{constructor(t,e,n,i){this.linkUsage=t,this.settings=e,this.notifications=n,this.workspaces=i,this.subscriptions=[]}ngOnInit(){this.bindToNotificationClick(),this.bindToWorkspaceChange()}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[]}onPageChange(t){this.activePage=t}bindToWorkspaceChange(){const t=this.workspaces.activeId$.pipe((0,s.T)(1)).subscribe(()=>{var t;null===(t=this.activePage.datatable)||void 0===t||t.reset(),this.linkUsage.reload()});this.subscriptions.push(t)}bindToNotificationClick(){const t=this.workspaces.bindToNotificationClick();this.subscriptions.push(t)}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(c.F),l.Y36(d.Z),l.Y36(u.g),l.Y36(p.b))},t.\u0275cmp=l.Xpm({type:t,selectors:[["dashboard-host"]],viewQuery:function(t,e){if(1&t&&l.Gf(r._,7),2&t){let t;l.iGM(t=l.CRH())&&(e.sidenav=t.first)}},features:[l._Bn([a.l])],decls:13,vars:9,consts:[["menuPosition","dashboard-navbar",3,"showToggleButton","toggleButtonClick"],["position","dashboard-sidebar",1,"vertical",3,"vertical","compact"],[3,"compact"],["slot","ads.dashboard.top"],[1,"dashboard-page"],[3,"activate"],[4,"ngIf"]],template:function(t,e){1&t&&(l.TgZ(0,"material-navbar",0),l.NdJ("toggleButtonClick",function(){return e.sidenav.toggleSidebarMode()}),l._UZ(1,"workspace-selector"),l.qZA(),l.TgZ(2,"sidenav"),l.TgZ(3,"nav"),l._UZ(4,"custom-menu",1),l.ALo(5,"async"),l._UZ(6,"upgrade-panel",2),l.ALo(7,"async"),l.qZA(),l.TgZ(8,"main"),l._UZ(9,"ad-host",3),l.TgZ(10,"div",4),l.TgZ(11,"router-outlet",5),l.NdJ("activate",function(t){return e.onPageChange(t)}),l.qZA(),l.qZA(),l.YNc(12,rt,1,0,"app-footer",6),l.qZA(),l.qZA()),2&t&&(l.Q6J("showToggleButton",!0),l.xp6(4),l.Q6J("vertical",!0)("compact",l.lcZ(5,5,e.sidenav.isCompact$)),l.xp6(2),l.Q6J("compact",l.lcZ(7,7,e.sidenav.isCompact$)),l.xp6(6),l.Q6J("ngIf",e.settings.get("links.dash_footer")))},directives:[h.e,N,r._,J.K,ot,st.i,o.lC,i.O5,at.q],pipes:[i.Ov],styles:["material-navbar[_ngcontent-%COMP%]{position:fixed;top:0;left:0;z-index:2}workspace-selector[_ngcontent-%COMP%]{min-width:200px;height:100%;margin-left:5px;margin-right:auto;border-left:1px solid hsla(0,0%,100%,.12);border-right:1px solid hsla(0,0%,100%,.12);padding:0 15px}workspace-selector[_ngcontent-%COMP%] .member-count{color:hsla(0,0%,100%,.7)}@media only screen and (max-width:768px){workspace-selector[_ngcontent-%COMP%]{display:none}}@media only screen and (min-width:768px){material-navbar[_ngcontent-%COMP%] .right-side-actions{margin-left:0}}.ads-dashboard-top-host[_ngcontent-%COMP%]{margin-bottom:25px}.dashboard-page[_ngcontent-%COMP%]{flex:1 1 auto;padding:25px}@media only screen and (max-width:768px){.dashboard-page[_ngcontent-%COMP%]{padding:15px}}app-footer[_ngcontent-%COMP%]{background-color:var(--be-background);padding:30px;border-top:1px solid var(--be-divider-default)}"],changeDetection:0}),t})();var ct=n(32656),dt=n(4886),ut=n(92890),pt=n(47727),ht=n(73982),gt=n(34056),mt=n(40878),ft=n(68515),bt=n(84222);let vt=(()=>{class t{constructor(t,e,n){this.router=t,this.http=e,this.link=n}resolve(t,e){return this.link.getCurrentUserReports().pipe((0,pt.K)(()=>(this.router.navigate(["/dashboard"]),gt.E)),(0,ht.zg)(t=>t?(0,mt.of)(t.analytics):(this.router.navigate(["/dashboard"]),gt.E)))}}return t.\u0275fac=function(e){return new(e||t)(l.LFG(o.F0),l.LFG(ft.r),l.LFG(bt.M))},t.\u0275prov=l.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var _t=n(78512),xt=n(93836);let Zt=(()=>{class t{constructor(t,e,n){this.route=t,this.workspaces=e,this.links=n,this.reports$=new _t.X(null)}ngOnInit(){this.route.data.subscribe(t=>{this.reports$.next(t.reports)}),this.workspaceSub=this.workspaces.activeId$.pipe((0,s.T)(1)).subscribe(()=>{this.links.getCurrentUserReports().subscribe(t=>{this.reports$.next(t.analytics)})})}ngOnDestroy(){this.workspaceSub.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(o.gz),l.Y36(p.b),l.Y36(bt.M))},t.\u0275cmp=l.Xpm({type:t,selectors:[["dashboard-home"]],decls:2,vars:3,consts:[[3,"reports"]],template:function(t,e){1&t&&(l._UZ(0,"click-charts",0),l.ALo(1,"async")),2&t&&l.Q6J("reports",l.lcZ(1,1,e.reports$))},directives:[xt.z],pipes:[i.Ov],styles:[""],changeDetection:0}),t})();var yt=n(45905),wt=n(80773),kt=n(75950),At=n(45362),Ct=n(99208),Tt=n(71453),qt=n(56515),It=n(14732),Ot=n(83381),Ut=n(48865),Pt=n(34955),Mt=n(56361),St=n(13536),Nt=n(80922),Jt=n(86668),Et=n(54275),Lt=n(24311),Dt=n(71765),$t=n(47210),Rt=n(40985);function Yt(t,e){1&t&&l._UZ(0,"mat-progress-bar",18)}function Ft(t,e){1&t&&(l.TgZ(0,"th",19),l._uU(1,"Owner"),l.qZA())}const Qt=function(t){return{count:t,resource:"domain(s)"}};function Bt(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"tr"),l.TgZ(1,"th",20),l.TgZ(2,"div",21),l._uU(3," :count :resource selected: "),l.qZA(),l.TgZ(4,"div",22),l.TgZ(5,"permission-aware-button",23),l.TgZ(6,"button",24),l.NdJ("click",function(){return l.CHM(t),l.oxw().maybeDeleteSelectedDomains()}),l._uU(7," Delete "),l.qZA(),l.qZA(),l.qZA(),l.qZA(),l.qZA()}if(2&t){const t=e.ngIf;l.xp6(2),l.Q6J("transValues",l.VKq(1,Qt,t))}}function Ht(t,e){if(1&t&&(l.TgZ(0,"td",37),l._UZ(1,"user-column",38),l.qZA()),2&t){const t=l.oxw().$implicit;l.xp6(1),l.Q6J("user",t.user)}}function Vt(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"tr"),l._UZ(1,"td",25),l.TgZ(2,"td",26),l._UZ(3,"img",27),l.ALo(4,"favicon"),l.TgZ(5,"span"),l._uU(6),l.qZA(),l.qZA(),l.YNc(7,Ht,2,1,"td",28),l.TgZ(8,"td",29),l._uU(9),l.ALo(10,"formattedDate"),l.qZA(),l.TgZ(11,"td",30),l.TgZ(12,"permission-aware-button",31),l.TgZ(13,"button",32),l.NdJ("click",function(){const e=l.CHM(t).$implicit;return l.oxw().showCrupdateDomainModal(e)}),l.ALo(14,"trans"),l._UZ(15,"mat-icon",33),l.qZA(),l.qZA(),l.TgZ(16,"permission-aware-button",34),l.TgZ(17,"button",35),l.NdJ("click",function(){const e=l.CHM(t).$implicit;return l.oxw().maybeDeleteSelectedDomains([e.id])}),l._UZ(18,"mat-icon",36),l.qZA(),l.qZA(),l.qZA(),l.qZA()}if(2&t){const t=e.$implicit,n=l.oxw();l.xp6(1),l.Q6J("table-body-checkbox",t.id),l.xp6(2),l.Q6J("src",l.lcZ(4,7,t.host),l.LSH),l.xp6(3),l.Oqu(t.host),l.xp6(1),l.Q6J("ngIf",n.showUserColumn()),l.xp6(2),l.Oqu(l.lcZ(10,9,t.updated_at)),l.xp6(3),l.Q6J("userOwnsResource",n.currentUser.get("id")===t.user_id),l.xp6(1),l.Q6J("matTooltip",l.lcZ(14,11,"Edit domain"))}}function zt(t,e){1&t&&(l.TgZ(0,"no-results-message",39),l.TgZ(1,"span",40),l._uU(2,"No custom domains have been added yet"),l.qZA(),l.qZA())}let Gt=(()=>{class t extends Tt.T{constructor(t,e,n,i,o,s,a,r){super(t,e,n,i,o),this.datatable=t,this.currentUser=e,this.customDomains=n,this.toast=i,this.router=o,this.route=s,this.workspaces=a,this.activeSection=r}ngOnInit(){this.workspaceSub=this.workspaces.activeId$.subscribe(()=>{this.setFilters()}),this.datatable.init({uri:It.c.BASE_URI,staticParams:{userId:this.showUserColumn()?null:this.currentUser.get("id")}})}ngOnDestroy(){this.workspaceSub.unsubscribe()}showUserColumn(){return this.activeSection.admin||!!this.workspaces.activeId$.value}setFilters(){this.filters=Ot.r.filter(t=>("user_id"!==t.key||this.showUserColumn())&&"global"!==t.key)}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(qt.x),l.Y36(x.I),l.Y36(It.c),l.Y36(Z.F),l.Y36(o.F0),l.Y36(o.gz),l.Y36(p.b),l.Y36(Ut.W))},t.\u0275cmp=l.Xpm({type:t,selectors:[["link-domain"]],features:[l._Bn([qt.x]),l.qOj],decls:31,vars:12,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","domains",3,"filters"],[1,"action-buttons"],["permission","custom_domains.create"],["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","","trans",""],["table-sort-header","user_id","trans","",4,"ngIf"],["table-sort-header","updated_at","trans",""],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","custom-domain.svg",4,"ngIf"],["mode","indeterminate","color","accent",1,"loading-bar"],["table-sort-header","user_id","trans",""],["colspan","5"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["permission","custom_domains.delete"],["type","button","mat-raised-button","","color","warn","trans","",3,"click"],[3,"table-body-checkbox"],["data-label","Host"],["alt","",1,"favicon-img",3,"src"],["data-label","Owner",4,"ngIf"],["data-label","Updated At"],[1,"edit-column"],["permission","custom_domains.update",3,"userOwnsResource"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","edit"],["permission","custom_domains.delete",1,"visible-on-mobile"],["type","button","mat-icon-button","","trans","",3,"click"],["svgIcon","delete"],["data-label","Owner"],[3,"user"],["svgImage","custom-domain.svg"],["primary-text","","trans",""]],template:function(t,e){1&t&&(l.TgZ(0,"div",0),l.TgZ(1,"h1",1),l._uU(2,"Custom Domains"),l.qZA(),l.TgZ(3,"div",2),l._UZ(4,"datatable-filters",3),l.TgZ(5,"div",4),l.TgZ(6,"permission-aware-button",5),l.TgZ(7,"button",6),l.NdJ("click",function(){return e.showCrupdateDomainModal()}),l._UZ(8,"mat-icon",7),l.TgZ(9,"span",1),l._uU(10,"Connect New Domain"),l.qZA(),l.qZA(),l.qZA(),l.qZA(),l.qZA(),l.qZA(),l.TgZ(11,"div",8),l.YNc(12,Yt,1,0,"mat-progress-bar",9),l.ALo(13,"async"),l.TgZ(14,"table",10),l.TgZ(15,"thead"),l.TgZ(16,"tr"),l._UZ(17,"th",11),l.TgZ(18,"th",12),l._uU(19,"Host"),l.qZA(),l.YNc(20,Ft,2,0,"th",13),l.TgZ(21,"th",14),l._uU(22,"Last Updated"),l.qZA(),l._UZ(23,"th"),l.qZA(),l.YNc(24,Bt,8,3,"tr",15),l.qZA(),l.TgZ(25,"tbody"),l.YNc(26,Vt,19,13,"tr",16),l.ALo(27,"async"),l.qZA(),l.qZA(),l.YNc(28,zt,3,0,"no-results-message",17),l.ALo(29,"async"),l._UZ(30,"datatable-footer"),l.qZA()),2&t&&(l.xp6(4),l.Q6J("filters",e.filters),l.xp6(8),l.Q6J("ngIf",l.lcZ(13,6,e.datatable.paginator&&e.datatable.paginator.loading$)),l.xp6(8),l.Q6J("ngIf",e.showUserColumn()),l.xp6(4),l.Q6J("ngIf",e.datatable.selectedRows$.value.length),l.xp6(2),l.Q6J("ngForOf",l.lcZ(27,8,e.domains$)),l.xp6(2),l.Q6J("ngIf",l.lcZ(29,10,e.datatable.paginator.noResults$)))},directives:[y.P,Pt.h,Mt.v,k.lW,w.Hw,i.O5,St.e,Nt.p,i.sg,Jt.V,j.pW,Et.O,Lt.gM,Dt.r,$t.U],pipes:[i.Ov,Rt.K,E.l,A.R],styles:[".favicon-img[_ngcontent-%COMP%]{display:inline-block;margin-right:5px;vertical-align:middle;flex-shrink:0}"],changeDetection:0}),t})();var jt=n(34384),Xt=n(8889),Wt=n(98034),Kt=n(4954),te=n(38053);function ee(t,e){1&t&&l._UZ(0,"mat-progress-bar",19)}function ne(t,e){1&t&&(l.TgZ(0,"th",12),l._uU(1,"Owner"),l.qZA())}function ie(t,e){1&t&&(l.TgZ(0,"th",20),l._uU(1,"Type"),l.qZA())}const oe=function(t){return{count:t,resource:"page(s)"}};function se(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"tr"),l.TgZ(1,"th",21),l.TgZ(2,"div",22),l._uU(3," :count :resource selected: "),l.qZA(),l.TgZ(4,"div",23),l.TgZ(5,"button",24),l.NdJ("click",function(){return l.CHM(t),l.oxw().maybeDeleteSelectedPages()}),l._uU(6," Delete "),l.qZA(),l.qZA(),l.qZA(),l.qZA()}if(2&t){const t=e.ngIf;l.xp6(2),l.Q6J("transValues",l.VKq(1,oe,t))}}function ae(t,e){if(1&t&&(l.TgZ(0,"td",39),l._UZ(1,"user-column",40),l.qZA()),2&t){const t=l.oxw().$implicit;l.xp6(1),l.Q6J("user",t.user)}}function re(t,e){if(1&t&&(l.TgZ(0,"td",41),l._uU(1),l.qZA()),2&t){const t=l.oxw().$implicit,e=l.oxw();l.xp6(1),l.hij(" ",t.type?e.viewName(t.type):"default"," ")}}const le=function(t){return[t,"edit"]};function ce(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"tr"),l._UZ(1,"td",25),l.TgZ(2,"td",26),l.TgZ(3,"a",27),l._uU(4),l.qZA(),l.qZA(),l.YNc(5,ae,2,1,"td",28),l.TgZ(6,"td",29),l._uU(7),l.qZA(),l.YNc(8,re,2,1,"td",30),l.TgZ(9,"td",31),l._uU(10),l.ALo(11,"formattedDate"),l.qZA(),l.TgZ(12,"td",32),l.TgZ(13,"permission-aware-button",33),l.TgZ(14,"button",34),l.ALo(15,"trans"),l._UZ(16,"mat-icon",35),l.qZA(),l.qZA(),l.TgZ(17,"permission-aware-button",36),l.TgZ(18,"button",37),l.NdJ("click",function(){const e=l.CHM(t).$implicit;return l.oxw().maybeDeleteSelectedPages([e.id])}),l._UZ(19,"mat-icon",38),l.qZA(),l.qZA(),l.qZA(),l.qZA()}if(2&t){const t=e.$implicit,n=l.oxw();l.xp6(1),l.Q6J("table-body-checkbox",t.id),l.xp6(2),l.Q6J("href",n.getPageUrl(t),l.LSH),l.xp6(1),l.Oqu(t.slug),l.xp6(1),l.Q6J("ngIf",n.showUserColumn()),l.xp6(2),l.Oqu(t.body),l.xp6(1),l.Q6J("ngIf",!n.endpoint),l.xp6(2),l.Oqu(l.lcZ(11,10,t.updated_at)),l.xp6(3),l.Q6J("userOwnsResource",t.user_id===n.currentUser.get("id")),l.xp6(1),l.Q6J("routerLink",l.VKq(14,le,t.id))("matTooltip",l.lcZ(15,12,"Edit page"))}}function de(t,e){1&t&&(l.TgZ(0,"no-results-message",42),l.TgZ(1,"span",43),l._uU(2,"No pages have been created yet"),l.qZA(),l.qZA())}let ue=(()=>{class t extends Wt.c{constructor(t,e,n,i,o,s,a,r,l){super(t,e,n,i,o,s,a),this.settings=t,this.datatable=e,this.currentUser=n,this.customPages=i,this.toast=o,this.router=s,this.route=a,this.workspaces=r,this.activeSection=l}ngOnInit(){this.workspaceSub=this.workspaces.activeId$.subscribe(()=>{this.setFilters()}),this.datatable.init({uri:"link-page",staticParams:{with:["user"],userId:this.showUserColumn()?null:this.currentUser.get("id")}})}ngOnDestroy(){this.workspaceSub.unsubscribe()}showUserColumn(){return this.activeSection.admin||!!this.workspaces.activeId$.value}setFilters(){this.filters=Kt.I.filter(t=>"user_id"!==t.key||this.showUserColumn())}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(d.Z),l.Y36(qt.x),l.Y36(x.I),l.Y36(te.i),l.Y36(Z.F),l.Y36(o.F0),l.Y36(o.gz),l.Y36(p.b),l.Y36(Ut.W))},t.\u0275cmp=l.Xpm({type:t,selectors:[["link-page-index"]],features:[l._Bn([qt.x]),l.qOj],decls:35,vars:13,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","pages",3,"filters"],[1,"action-buttons"],["permission","custom_pages.create"],["mat-raised-button","","color","accent","routerLink","new",1,"button-with-icon"],["svgIcon","add"],[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","","trans","",4,"ngIf"],["trans","",1,"body-column"],["class","type-column","table-sort-header","","trans","",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","custom-page.svg",4,"ngIf"],["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",4,"ngIf"],["data-label","Body",1,"body-column"],["data-label","Type","class","type-column",4,"ngIf"],["data-label","Last Updated"],[1,"edit-column"],["permission","custom_pages.update",3,"userOwnsResource"],["mat-icon-button","",3,"routerLink","matTooltip"],["svgIcon","edit"],["permission","custom_pages.delete",1,"visible-on-mobile"],["type","button","mat-icon-button","","trans","",3,"click"],["svgIcon","delete"],["data-label","Owner"],[3,"user"],["data-label","Type",1,"type-column"],["svgImage","custom-page.svg"],["primary-text","","trans",""]],template:function(t,e){1&t&&(l.TgZ(0,"div",0),l.TgZ(1,"h1",1),l.TgZ(2,"span",1),l._uU(3,"Link Pages"),l.qZA(),l.qZA(),l.TgZ(4,"div",2),l._UZ(5,"datatable-filters",3),l.TgZ(6,"div",4),l.TgZ(7,"permission-aware-button",5),l.TgZ(8,"button",6),l._UZ(9,"mat-icon",7),l.TgZ(10,"span",1),l._uU(11,"Add New Page"),l.qZA(),l.qZA(),l.qZA(),l.qZA(),l.qZA(),l.qZA(),l.TgZ(12,"div",8),l.YNc(13,ee,1,0,"mat-progress-bar",9),l.ALo(14,"async"),l.TgZ(15,"table",10),l.TgZ(16,"thead"),l.TgZ(17,"tr"),l._UZ(18,"th",11),l.TgZ(19,"th",12),l._uU(20,"Slug"),l.qZA(),l.YNc(21,ne,2,0,"th",13),l.TgZ(22,"th",14),l._uU(23,"Body"),l.qZA(),l.YNc(24,ie,2,0,"th",15),l.TgZ(25,"th",1),l._uU(26,"Last Updated"),l.qZA(),l._UZ(27,"th"),l.qZA(),l.YNc(28,se,7,3,"tr",16),l.qZA(),l.TgZ(29,"tbody"),l.YNc(30,ce,20,16,"tr",17),l.ALo(31,"async"),l.qZA(),l.qZA(),l.YNc(32,de,3,0,"no-results-message",18),l.ALo(33,"async"),l._UZ(34,"datatable-footer"),l.qZA()),2&t&&(l.xp6(5),l.Q6J("filters",e.filters),l.xp6(8),l.Q6J("ngIf",l.lcZ(14,7,e.datatable.paginator&&e.datatable.paginator.loading$)),l.xp6(8),l.Q6J("ngIf",e.showUserColumn()),l.xp6(3),l.Q6J("ngIf",!e.endpoint),l.xp6(4),l.Q6J("ngIf",e.datatable.selectedRows$.value.length),l.xp6(2),l.Q6J("ngForOf",l.lcZ(31,9,e.pages$)),l.xp6(2),l.Q6J("ngIf",l.lcZ(33,11,e.datatable.paginator.noResults$)))},directives:[y.P,Pt.h,Mt.v,k.lW,o.rH,w.Hw,i.O5,St.e,Nt.p,i.sg,Jt.V,j.pW,Et.O,Lt.gM,Dt.r,$t.U],pipes:[i.Ov,E.l,A.R],styles:[".body-column[_ngcontent-%COMP%]{margin-right:25px;overflow:hidden}.type-column[_ngcontent-%COMP%]{text-transform:capitalize}"],changeDetection:0}),t})();var pe=n(20237),he=n(36957),ge=n(36402);let me=(()=>{class t{constructor(t,e,n,i){this.currentUser=t,this.router=e,this.workspaces=n,this.localStorage=i}canActivate(t,e){return this.handle()}canActivateChild(t,e){return this.handle()}canLoad(t){return this.handle()}handle(){return!(this.currentUser.isLoggedIn()&&!this.currentUser.isSubscribed()&&!this.workspaces.activeId$.value&&this.localStorage.get(he.b)&&(this.localStorage.remove(he.b),this.router.navigate(["/billing/upgrade"]),1))}}return t.\u0275fac=function(e){return new(e||t)(l.LFG(x.I),l.LFG(o.F0),l.LFG(p.b),l.LFG(ge.m))},t.\u0275prov=l.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var fe=n(12440),be=n(77044),ve=n(75183);const _e=new l.OlP("WORKSPACE_CONFIG");var xe=n(49517);function Ze(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"button",13),l.NdJ("click",function(){return l.CHM(t),l.oxw().showCrupdateWorkspaceModal()}),l._UZ(1,"mat-icon",14),l.TgZ(2,"span",1),l._uU(3,"Add New Workspace"),l.qZA(),l.qZA()}}function ye(t,e){if(1&t){const t=l.EpF();l.ynx(0),l.TgZ(1,"button",22),l.NdJ("click",function(){l.CHM(t);const e=l.oxw().$implicit;return l.oxw().showCrupdateWorkspaceModal(e)}),l.ALo(2,"trans"),l._UZ(3,"mat-icon",25),l.qZA(),l.TgZ(4,"button",22),l.NdJ("click",function(){l.CHM(t);const e=l.oxw().$implicit;return l.oxw().maybeDeleteWorkspace(e)}),l.ALo(5,"trans"),l._UZ(6,"mat-icon",26),l.qZA(),l.BQk()}2&t&&(l.xp6(1),l.Q6J("matTooltip",l.lcZ(2,2,"Edit workspace")),l.xp6(3),l.Q6J("matTooltip",l.lcZ(5,4,"Delete workspace")))}function we(t,e){if(1&t){const t=l.EpF();l.ynx(0),l.TgZ(1,"button",22),l.NdJ("click",function(){l.CHM(t);const e=l.oxw().$implicit;return l.oxw().maybeLeaveWorkspace(e)}),l.ALo(2,"trans"),l._UZ(3,"mat-icon",27),l.qZA(),l.BQk()}2&t&&(l.xp6(1),l.Q6J("matTooltip",l.lcZ(2,1,"Leave workspace")))}function ke(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"tr"),l.TgZ(1,"td",15),l._uU(2),l.qZA(),l.TgZ(3,"td",16),l._UZ(4,"user-column",17),l.qZA(),l.TgZ(5,"td",18),l._uU(6),l.qZA(),l.TgZ(7,"td",19),l._uU(8),l.qZA(),l.TgZ(9,"td",20),l._uU(10),l.ALo(11,"formattedDate"),l.qZA(),l.TgZ(12,"td",21),l.TgZ(13,"button",22),l.NdJ("click",function(){const e=l.CHM(t).$implicit;return l.oxw().openWorkspaceMembersModal(e)}),l.ALo(14,"trans"),l._UZ(15,"mat-icon",23),l.qZA(),l.YNc(16,ye,7,6,"ng-container",24),l.YNc(17,we,4,3,"ng-container",24),l.qZA(),l.qZA()}if(2&t){const t=e.$implicit,n=l.oxw();l.xp6(2),l.Oqu(t.name),l.xp6(2),l.Q6J("user",t.owner),l.xp6(2),l.Oqu((null==t.currentUser?null:t.currentUser.role_name)||"-"),l.xp6(2),l.Oqu(t.members_count||"-"),l.xp6(2),l.Oqu(l.lcZ(11,8,t.updated_at)),l.xp6(3),l.Q6J("matTooltip",l.lcZ(14,10,"Manage Members")),l.xp6(3),l.Q6J("ngIf",t.owner_id===n.currentUser.get("id")),l.xp6(1),l.Q6J("ngIf",t.owner_id!==n.currentUser.get("id"))}}function Ae(t,e){1&t&&(l.TgZ(0,"no-results-message",28),l.TgZ(1,"span",29),l._uU(2,"No workspaces have been created yet"),l.qZA(),l.qZA())}let Ce=(()=>{class t{constructor(t,e,n,i,o,s,a){this.datatable=t,this.currentUser=e,this.workspaces=n,this.toast=i,this.router=o,this.modal=s,this.workspaceConfig=a,this.workspaces$=this.datatable.data$}ngOnInit(){this.datatable.init({uri:p.b.BASE_URI,staticParams:{userId:this.currentUser.get("id")}})}maybeDeleteWorkspace(t){this.datatable.confirmResourceDeletion("workspace").subscribe(()=>{this.workspaces.delete([t.id]).subscribe(()=>{this.datatable.reset(),this.toast.open("Workspace deleted.")},t=>{this.toast.open(t.message||m.v.Default)})})}showCrupdateWorkspaceModal(t){this.datatable.openCrupdateResourceModal(fe.Z,{workspace:t}).subscribe()}openWorkspaceMembersModal(t){this.modal.open(be.t,{workspace:t})}filterByUser(){return-1===this.router.url.indexOf("admin")}maybeLeaveWorkspace(t){this.modal.open(f.z,ve.W).afterClosed().subscribe(e=>{e&&this.workspaces.deleteMember(t.id,this.currentUser.get("id")).subscribe(()=>this.datatable.reset())})}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(qt.x),l.Y36(x.I),l.Y36(p.b),l.Y36(Z.F),l.Y36(o.F0),l.Y36(_.u),l.Y36(_e))},t.\u0275cmp=l.Xpm({type:t,selectors:[["workspace-index"]],features:[l._Bn([qt.x])],decls:34,vars:8,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","workspaces"],[1,"action-buttons"],["mat-raised-button","","color","accent","class","button-with-icon",3,"click",4,"ngIf"],[1,"datatable","responsive-table"],[1,"material-table"],["table-sort-header","","trans",""],["table-sort-header","owner_id","trans",""],["table-sort-header","members_count","trans",""],[4,"ngFor","ngForOf"],["svgImage","shared-workspace.svg",4,"ngIf"],["mat-raised-button","","color","accent",1,"button-with-icon",3,"click"],["svgIcon","add"],["data-label","Name"],["data-label","Owner"],[3,"user"],["data-label","Your Role","trans",""],["data-label","Members"],["data-label","Last Updated"],[1,"edit-column"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","group-add"],[4,"ngIf"],["svgIcon","edit"],["svgIcon","delete"],["svgIcon","exit-to-app"],["svgImage","shared-workspace.svg"],["primary-text","","trans",""]],template:function(t,e){1&t&&(l.TgZ(0,"div",0),l.TgZ(1,"h1",1),l.TgZ(2,"span",1),l._uU(3,"Workspaces"),l.qZA(),l.TgZ(4,"info-popover"),l.TgZ(5,"strong",1),l._uU(6,"Workspaces and Teammates"),l.qZA(),l.TgZ(7,"p",1),l._uU(8),l.qZA(),l.qZA(),l.qZA(),l.TgZ(9,"div",2),l._UZ(10,"datatable-filters",3),l.TgZ(11,"div",4),l.YNc(12,Ze,4,0,"button",5),l.qZA(),l.qZA(),l.qZA(),l.TgZ(13,"div",6),l.TgZ(14,"table",7),l.TgZ(15,"thead"),l.TgZ(16,"tr"),l.TgZ(17,"th",8),l._uU(18,"Name"),l.qZA(),l.TgZ(19,"th",9),l._uU(20,"Owner"),l.qZA(),l.TgZ(21,"th",1),l._uU(22,"Your Role"),l.qZA(),l.TgZ(23,"th",10),l._uU(24,"Members"),l.qZA(),l.TgZ(25,"th",1),l._uU(26,"Last Updated"),l.qZA(),l._UZ(27,"th"),l.qZA(),l.qZA(),l.TgZ(28,"tbody"),l.YNc(29,ke,18,12,"tr",11),l.ALo(30,"async"),l.qZA(),l.qZA(),l.YNc(31,Ae,3,0,"no-results-message",12),l.ALo(32,"async"),l._UZ(33,"datatable-footer"),l.qZA()),2&t&&(l.xp6(8),l.Oqu(e.workspaceConfig.description),l.xp6(4),l.Q6J("ngIf",e.currentUser.hasPermission("workspaces.create")),l.xp6(17),l.Q6J("ngForOf",l.lcZ(30,4,e.workspaces$)),l.xp6(2),l.Q6J("ngIf",l.lcZ(32,6,e.datatable.paginator.noResults$)))},directives:[y.P,xe.N,Pt.h,i.O5,Nt.p,i.sg,Jt.V,k.lW,w.Hw,Dt.r,Lt.gM,$t.U],pipes:[i.Ov,E.l,A.R],styles:["h1[_ngcontent-%COMP%]{display:flex;align-items:center}"],changeDetection:0}),t})();var Te=n(4512),qe=n(38193);const Ie=[{path:"",component:lt,canActivate:[me],children:[{path:"",resolve:{reports:vt},component:Zt,data:{name:"Dashboard"}},{path:"links",component:ct.g},{path:"links/:linkId",resolve:{api:ut.F},component:dt.G,data:{name:"Link Statistics"}},{path:"biolinks",component:Te.o},{path:"biolinks/:linkId/edit",component:qe.w,data:{name:"Edit Bio Link"}},{path:"biolinks/:biolinkId/analytics",component:wt.x,data:{name:"Biolink Statistics"}},{path:"link-groups",component:yt.o},{path:"link-groups/:groupId/links",component:Xt.Z},{path:"link-groups/:groupId/analytics",component:wt.x,data:{name:"Link Group Statistics"}},{path:"custom-domains",component:Gt,data:{name:"Custom Domains"}},{path:"link-overlays",component:kt.m,data:{name:"Link Overlays"}},{path:"link-overlays/new",component:jt.O,canDeactivate:[pe.w]},{path:"link-overlays/edit/:id",component:jt.O,canDeactivate:[pe.w]},{path:"pixels",component:At.V,data:{name:"Tracking Pixels"}},{path:"workspaces",component:Ce,data:{name:"Workspaces"}},{path:"link-pages",component:ue,data:{name:"Link Pages",endpoint:"link-page"}},{path:"link-pages/new",component:Ct.e,data:{name:"Add New Page",hideSlug:!0,endpoint:"link-page"}},{path:"link-pages/:id/edit",component:Ct.e,data:{name:"Edit Page",hideSlug:!0,endpoint:"link-page"}}]}];let Oe=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=l.oAB({type:t}),t.\u0275inj=l.cJS({imports:[[o.Bz.forChild(Ie)],o.Bz]}),t})();var Ue=n(92762),Pe=n(92935),Me=n(56160),Se=n(87829),Ne=n(20653),Je=n(75425),Ee=n(79572),Le=n(68400),De=n(58666),$e=n(50615),Re=n(31041),Ye=n(51685),Fe=n(99808);let Qe=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=l.oAB({type:t}),t.\u0275inj=l.cJS({imports:[[i.ez,Le.N,De.u,$e.X,Re.u5,Re.UX,Ye.x,Fe.p,w.Ps,k.ot,Lt.AV,Pe.Is,Ee.rP,j.Cv]]}),t})();var Be=n(57173);const He=["rootMenu"];function Ve(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"button",9),l.NdJ("click",function(){const e=l.CHM(t).$implicit;return l.oxw().selectValue("page:"+e.id)}),l._uU(1),l.qZA()}if(2&t){const t=e.$implicit,n=l.oxw();l.ekj("active",n.value==="page:"+t.id),l.xp6(1),l.Oqu(t.title)}}function ze(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"button",9),l.NdJ("click",function(){const e=l.CHM(t).$implicit;return l.oxw().selectValue("overlay:"+e.id)}),l._uU(1),l.qZA()}if(2&t){const t=e.$implicit,n=l.oxw();l.ekj("active",n.value==="overlay:"+t.id),l.xp6(1),l.Oqu(t.name)}}const Ge=function(t){return{siteName:t}};let je=(()=>{class t{constructor(t,e){this.cd=t,this.settings=e}writeValue(t){this.value=t,this.cd.detectChanges()}registerOnChange(t){this.propagateChange=t}registerOnTouched(){}selectValue(t){this.value=t,this.propagateChange(t)}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(l.sBO),l.Y36(d.Z))},t.\u0275cmp=l.Xpm({type:t,selectors:[["link-type-menu"]],viewQuery:function(t,e){if(1&t&&l.Gf(He,7),2&t){let t;l.iGM(t=l.CRH())&&(e.matMenu=t.first)}},inputs:{linkOptions:"linkOptions"},features:[l._Bn([{provide:Re.JU,useExisting:t,multi:!0}])],decls:33,vars:24,consts:[["rootMenu",""],["mat-menu-item","",1,"multiline-mat-menu-item",3,"click"],["trans","",1,"title"],["trans","",1,"description"],["trans","",1,"description",3,"transValues"],["mat-menu-item","",1,"multiline-mat-menu-item",3,"matMenuTriggerFor"],["customPagesMenu",""],["mat-menu-item","",3,"active","click",4,"ngFor","ngForOf"],["overlayMenu",""],["mat-menu-item","",3,"click"]],template:function(t,e){if(1&t&&(l.TgZ(0,"mat-menu",null,0),l.TgZ(2,"div",1),l.NdJ("click",function(){return e.selectValue("direct")}),l.TgZ(3,"div",2),l._uU(4,"Direct"),l.qZA(),l.TgZ(5,"div",3),l._uU(6,"Redirect user to url instantly."),l.qZA(),l.qZA(),l.TgZ(7,"div",1),l.NdJ("click",function(){return e.selectValue("frame")}),l.TgZ(8,"div",2),l._uU(9,"Frame"),l.qZA(),l.TgZ(10,"div",4),l._uU(11,"Show url inside iframe with :siteName navigation bar."),l.qZA(),l.qZA(),l.TgZ(12,"div",1),l.NdJ("click",function(){return e.selectValue("splash")}),l.TgZ(13,"div",2),l._uU(14,"Splash"),l.qZA(),l.TgZ(15,"div",3),l._uU(16,"Show splash page with optional ads and redirect user to url after a delay."),l.qZA(),l.qZA(),l.TgZ(17,"div",5),l.TgZ(18,"div",2),l._uU(19,"Link Page"),l.qZA(),l.TgZ(20,"div",4),l._uU(21,"Show specified link page with :siteName navigation bar and button to open long url."),l.qZA(),l.qZA(),l.TgZ(22,"div",5),l.TgZ(23,"div",2),l._uU(24,"Overlay"),l.qZA(),l.TgZ(25,"div",3),l._uU(26,"Redirect user instantly and show specified overlay over the link."),l.qZA(),l.qZA(),l.qZA(),l.TgZ(27,"mat-menu",null,6),l.YNc(29,Ve,2,3,"button",7),l.qZA(),l.TgZ(30,"mat-menu",null,8),l.YNc(32,ze,2,3,"button",7),l.qZA()),2&t){const t=l.MAs(28),n=l.MAs(31);l.xp6(2),l.ekj("active","direct"===e.value),l.xp6(5),l.ekj("active","frame"===e.value),l.xp6(3),l.Q6J("transValues",l.VKq(20,Ge,e.settings.get("branding.site_name"))),l.xp6(2),l.ekj("active","splash"===e.value),l.xp6(5),l.ekj("hidden",!(null!=e.linkOptions&&e.linkOptions.pages.length))("active",e.value.includes("page")),l.Q6J("matMenuTriggerFor",t),l.xp6(3),l.Q6J("transValues",l.VKq(22,Ge,e.settings.get("branding.site_name"))),l.xp6(2),l.ekj("hidden",!(null!=e.linkOptions&&e.linkOptions.overlays.length))("active",e.value.includes("overlay")),l.Q6J("matMenuTriggerFor",n),l.xp6(7),l.Q6J("ngForOf",null==e.linkOptions?null:e.linkOptions.pages),l.xp6(3),l.Q6J("ngForOf",null==e.linkOptions?null:e.linkOptions.overlays)}},directives:[g.VK,g.OP,y.P,g.p6,i.sg],styles:[""],changeDetection:0}),t})(),Xe=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=l.oAB({type:t}),t.\u0275inj=l.cJS({imports:[[i.ez,Re.UX,Le.N,k.ot]]}),t})();var We=n(69193),Ke=n(37604),tn=n(86013),en=n(20673),nn=n(12188),on=n(29828),sn=n(7436),an=n(4182),rn=n(15595),ln=n(47878),cn=n(63380),dn=n(90723),un=n(87254);let pn=(()=>{class t{constructor(t){this.el=t,this.enterPressed=new l.vpe}ngOnInit(){this.subscription=(0,un.R)(this.el.nativeElement,"keydown").subscribe(t=>{13===t.keyCode&&(t.preventDefault(),t.stopPropagation(),this.el.nativeElement.blur(),this.enterPressed.emit(t))})}ngOnDestroy(){this.subscription.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(l.SBq))},t.\u0275dir=l.lG2({type:t,selectors:[["","enterKeybind",""]],outputs:{enterPressed:"enterPressed"}}),t})();var hn=n(59447),gn=n(75428);let mn=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=l.oAB({type:t}),t.\u0275inj=l.cJS({imports:[[i.ez,Le.N,g.Tx,k.ot,w.Ps]]}),t})();var fn=n(41816),bn=n(45052),vn=n(87064),_n=n(8424),xn=n(69244);let Zn=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=l.oAB({type:t}),t.\u0275inj=l.cJS({imports:[[i.ez,Le.N,Re.UX,Re.u5,vn.si,k.ot,w.Ps]]}),t})(),yn=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=l.oAB({type:t}),t.\u0275inj=l.cJS({imports:[[i.ez,Le.N,vn.si,$e.X,k.ot,w.Ps,Re.UX,sn.Fk,Ue.vV]]}),t})();var wn=n(13070),kn=n(13841);let An=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=l.oAB({type:t}),t.\u0275inj=l.cJS({imports:[[i.ez,Re.UX,Le.N,Xe,dn.a,Me.G,k.ot,w.Ps,wn.lN,kn.LD]]}),t})(),Cn=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=l.oAB({type:t}),t.\u0275inj=l.cJS({imports:[[i.ez,Re.u5,Re.UX,o.Bz,$e.X,Le.N,De.u,rn.m,_n._,dn.a,Ke.x,Zn,yn,An,on.I,Je.m,Xe,bn.T,w.Ps,k.ot,Lt.AV,Pe.Is,xn._t,Be.Nh,vn.si,Ee.rP]]}),t})();var Tn=n(85786),qn=n(53129),In=n(78671);let On=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=l.oAB({type:t}),t.\u0275inj=l.cJS({providers:[_.u,{provide:_e,useValue:{description:"Workspaces are like folders for your links, domains, groups and other resources. They're great for organising your campaigns, collaborating with teammates and managing different projects."}}],imports:[[i.ez,o.Bz,Oe,Le.N,$e.X,We.a,Re.u5,Re.UX,Ke.x,Fe.p,De.u,tn.b,en.l,nn.v,on.I,cn.M,dn.a,hn.a,fn.J,gn.WorkspaceModule,mn,An,Tn.c,rn.m,Ye.x,an.S,Je.m,Ne.m,Qe,ln.k,Me.G,Xe,Cn,k.ot,w.Ps,Lt.AV,Pe.Is,Ue.vV,Be.Nh,g.Tx,j.Cv,Ee.rP,sn.Fk,bn.T,vn.si]]}),t})();l.B6R(Se.P,[Pe.uh,i.O5,y.P,w.Hw,Re.JL,Re.F,Pe.xY,Re.sg,Re.Fj,Re.JJ,Re.u,pn,Re.Q7,Re.wO,Re.nD,k.lW,g.p6,je,qn.O,Pe.H8,In.t],[i.Ov])},28577:function(t,e,n){"use strict";n.d(e,{L:function(){return I}});var i=n(78512),o=n(92935),s=n(31041),a=n(11520),r=n(24831),l=n(35366),c=n(16980),d=n(76512),u=n(73234),p=n(25051),h=n(88195),g=n(61116),m=n(77307),f=n(38116),b=n(29738),v=n(13571),_=n(79572),x=n(84369);function Z(t,e){if(1&t&&(l.TgZ(0,"span",6),l._uU(1),l.qZA()),2&t){const t=l.oxw();l.xp6(1),l.hij("Create ",t.resourceName,"")}}function y(t,e){if(1&t&&(l.TgZ(0,"span",6),l._uU(1),l.qZA()),2&t){const t=l.oxw();l.xp6(1),l.hij("Update ",t.resourceName,"")}}function w(t,e){if(1&t&&(l.TgZ(0,"div",25),l._uU(1),l.qZA()),2&t){const t=l.oxw().ngIf;l.xp6(1),l.Oqu(t.name)}}function k(t,e){if(1&t&&(l.TgZ(0,"div",25),l._uU(1),l.qZA()),2&t){const t=l.oxw().ngIf;l.xp6(1),l.Oqu(t.hash)}}function A(t,e){1&t&&(l.TgZ(0,"div",18),l.TgZ(1,"mat-slide-toggle",26),l._uU(2,"Rotator"),l.qZA(),l.TgZ(3,"p",6),l._uU(4," When checked, url above will redirect to random link from the group, instead of showing all links belonging to group. "),l.qZA(),l.qZA())}function C(t,e){1&t&&(l.TgZ(0,"span"),l._uU(1,"Update"),l.qZA())}function T(t,e){1&t&&(l.TgZ(0,"span"),l._uU(1,"Create"),l.qZA())}function q(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"form",7),l.NdJ("ngSubmit",function(){return l.CHM(t),l.oxw().confirm()}),l.TgZ(1,"mat-dialog-content",8),l.TgZ(2,"div",9),l.TgZ(3,"label",10),l._uU(4,"Name"),l.qZA(),l._UZ(5,"input",11),l.YNc(6,w,2,1,"div",12),l.qZA(),l.TgZ(7,"div",13),l._UZ(8,"slug-control",14),l.ALo(9,"async"),l.YNc(10,k,2,1,"div",12),l.qZA(),l._UZ(11,"domain-form-control",15),l.ALo(12,"async"),l.TgZ(13,"div",13),l.TgZ(14,"label",16),l._uU(15,"Description"),l.qZA(),l._UZ(16,"textarea",17),l.qZA(),l.TgZ(17,"div",18),l.TgZ(18,"mat-slide-toggle",19),l._uU(19,"Active"),l.qZA(),l.TgZ(20,"p",6),l._uU(21),l.qZA(),l.qZA(),l.YNc(22,A,5,0,"div",20),l.qZA(),l.TgZ(23,"mat-dialog-actions"),l.TgZ(24,"button",21),l.NdJ("click",function(){return l.CHM(t),l.oxw().close()}),l._uU(25,"Cancel"),l.qZA(),l.TgZ(26,"button",22),l.ALo(27,"async"),l.YNc(28,C,2,0,"span",23),l.ALo(29,"async"),l.YNc(30,T,2,0,"ng-template",null,24,l.W1O),l.qZA(),l.qZA(),l.qZA()}if(2&t){const t=e.ngIf,n=l.MAs(31),i=l.oxw();l.Q6J("formGroup",i.form),l.xp6(6),l.Q6J("ngIf",t.name),l.xp6(2),l.Q6J("baseUri",l.lcZ(9,10,i.slugBaseUri$)),l.xp6(2),l.Q6J("ngIf",t.hash),l.xp6(1),l.Q6J("domains",l.lcZ(12,12,i.domains$)),l.xp6(10),l.hij("Whether this ",i.resourceName," is viewable publicly."),l.xp6(1),l.Q6J("ngIf","biolink"!==i.data.type),l.xp6(4),l.Q6J("disabled",l.lcZ(27,14,i.loading$)),l.xp6(2),l.Q6J("ngIf",l.lcZ(29,16,i.updating$))("ngIfElse",n)}}let I=(()=>{class t{constructor(t,e,n,o,a,l,c){this.dialogRef=t,this.data=e,this.groups=n,this.biolinks=o,this.toast=a,this.valueLists=l,this.settings=c,this.loading$=new i.X(!1),this.updating$=new i.X(!1),this.errors$=new i.X({}),this.form=new s.cw({name:new s.NI,active:new s.NI(!0),description:new s.NI(""),hash:new s.NI((0,r.O)(6)),rotator:new s.NI(!1),domain_id:new s.NI(null)}),this.slugBaseUri$=new i.X(null),this.domains$=new i.X([])}get resourceName(){return"biolink"===this.data.type?"biolink":"link group"}ngOnInit(){this.updating$.next(!!this.data.linkGroup),this.data.linkGroup&&this.form.patchValue(this.data.linkGroup),this.valueLists.get(["domains"]).subscribe(t=>{this.domains$.next(t.domains),this.setSlugBaseUri(this.form.value.domain_id)}),this.form.get("domain_id").valueChanges.subscribe(t=>{this.setSlugBaseUri(t)})}confirm(){this.loading$.next(!0),(this.updating$.value?this.api().update(this.data.linkGroup.id,this.form.value):this.api().create(this.form.value)).pipe((0,a.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.toast.open(this.updating$.value?`${this.resourceName} updated`:`${this.resourceName} created`),this.close(t.linkGroup||t.biolink)},t=>this.errors$.next(t.errors))}close(t){this.dialogRef.close(t)}api(){return"biolink"===this.data.type?this.biolinks:this.groups}setSlugBaseUri(t){this.slugBaseUri$.next(t?this.domains$.value.find(e=>e.id===t).host:this.settings.getBaseUrl())}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(o.so),l.Y36(o.WI),l.Y36(c.L),l.Y36(d.n),l.Y36(u.F),l.Y36(p.l),l.Y36(h.Z))},t.\u0275cmp=l.Xpm({type:t,selectors:[["crupdate-link-group-modal"]],decls:8,vars:5,consts:[[1,"modal-header"],["mat-dialog-title","",1,"capitalize"],["trans","",4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit",4,"ngIf"],["trans",""],["ngNativeValidate","",3,"formGroup","ngSubmit"],[1,"many-inputs"],[1,"input-container","name-container"],["for","link-group-name","trans",""],["type","text","id","link-group-name","formControlName","name","required","","minlength","3"],["class","error",4,"ngIf"],[1,"input-container"],["formControlName","hash",3,"baseUri"],["controlName","domain_id",1,"many-inputs",3,"domains"],["for","link-group-description","trans",""],["id","link-group-description","formControlName","description"],[1,"setting-toggle-container"],["formControlName","active","id","link-group-active","trans","",1,"capitalize"],["class","setting-toggle-container",4,"ngIf"],["type","button","mat-button","","trans","",3,"click"],["type","submit","mat-raised-button","","color","accent","trans","",3,"disabled"],[4,"ngIf","ngIfElse"],["creating",""],[1,"error"],["formControlName","rotator","id","link-group-rotator","trans",""]],template:function(t,e){1&t&&(l.TgZ(0,"div",0),l.TgZ(1,"h2",1),l.YNc(2,Z,2,1,"span",2),l.YNc(3,y,2,1,"span",2),l.qZA(),l.TgZ(4,"button",3),l.NdJ("click",function(){return e.close()}),l._UZ(5,"mat-icon",4),l.qZA(),l.qZA(),l.YNc(6,q,32,18,"form",5),l.ALo(7,"async")),2&t&&(l.xp6(2),l.Q6J("ngIf",!e.data.linkGroup),l.xp6(1),l.Q6J("ngIf",e.data.linkGroup),l.xp6(3),l.Q6J("ngIf",l.lcZ(7,3,e.errors$)))},directives:[o.uh,g.O5,m.Hw,f.P,s.JL,s.sg,o.xY,s.Fj,s.JJ,s.u,s.Q7,s.wO,b.b,v.z,_.Rr,o.H8,x.lW],pipes:[g.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}.name-container[_ngcontent-%COMP%]{margin-bottom:8px}"],changeDetection:0}),t})()},80773:function(t,e,n){"use strict";n.d(e,{x:function(){return v}});var i=n(55959),o=n(26437),s=n(35366),a=n(63337),r=n(24859),l=n(16980),c=n(76512),d=n(61116),u=n(93836),p=n(84369),h=n(77307),g=n(88798),m=n(40450);function f(t,e){if(1&t&&(s.TgZ(0,"div"),s.TgZ(1,"h1",2),s.TgZ(2,"a",3),s._UZ(3,"mat-icon",4),s.qZA(),s._uU(4),s.ALo(5,"trans"),s.qZA(),s.qZA()),2&t){const t=e.ngIf;s.Q6J("@fadeIn",void 0),s.xp6(4),s.AsE(" ",t.name," ",s.lcZ(5,3,"Analytics")," ")}}function b(t,e){1&t&&(s.TgZ(0,"h1"),s._UZ(1,"skeleton",5),s.qZA()),2&t&&s.Q6J("@fadeOut",void 0)}let v=(()=>{class t{constructor(t,e,n,o){this.route=t,this.modal=e,this.groups=n,this.biolinks=o,this.analytics$=new i.xQ,this.linkGroup$=new i.xQ}ngOnInit(){this.route.params.subscribe(t=>{const e=t.groupId||t.biolinkId,n=t.groupId?this.groups:this.biolinks;this.analyticsEndpoint=n.analyticsEndpoint(e),n.analytics(e).subscribe(t=>{this.analytics$.next(t.analytics),this.linkGroup$.next(t.linkGroup||t.biolink)})})}}return t.\u0275fac=function(e){return new(e||t)(s.Y36(a.gz),s.Y36(r.u),s.Y36(l.L),s.Y36(c.n))},t.\u0275cmp=s.Xpm({type:t,selectors:[["link-group-analytics-page"]],decls:7,vars:10,consts:[[4,"ngIf"],[3,"reports","endpoint"],[1,"name"],["routerLink","../../","mat-icon-button",""],["svgIcon","arrow-back"],["variant","text"]],template:function(t,e){1&t&&(s.TgZ(0,"header"),s.YNc(1,f,6,5,"div",0),s.ALo(2,"async"),s.YNc(3,b,2,1,"h1",0),s.ALo(4,"async"),s.qZA(),s._UZ(5,"click-charts",1),s.ALo(6,"async")),2&t&&(s.xp6(1),s.Q6J("ngIf",s.lcZ(2,4,e.linkGroup$)),s.xp6(2),s.Q6J("ngIf",!s.lcZ(4,6,e.linkGroup$)),s.xp6(2),s.Q6J("reports",s.lcZ(6,8,e.analytics$))("endpoint",e.analyticsEndpoint))},directives:[d.O5,u.z,a.yS,p.zs,h.Hw,g._],pipes:[d.Ov,m.R],styles:["header[_ngcontent-%COMP%]{position:relative}h1[_ngcontent-%COMP%]{font-size:2rem;text-transform:capitalize;margin:0 0 10px;font-weight:400;height:40px}skeleton[_ngcontent-%COMP%]{max-width:350px}.mat-icon-button[_ngcontent-%COMP%]{color:var(--be-secondary-text);vertical-align:middle}"],data:{animation:o.B},changeDetection:0}),t})()},90832:function(t,e,n){"use strict";n.d(e,{L:function(){return a}});var i=n(44415),o=n(59075),s=n(45523);const a=[new o.XQ({type:o.Bq.Select,key:"active",label:"status",defaultValue:!1,description:"Whether group is public or not",options:[{key:"Disabled",value:!1},{key:"Active",value:!0}]}),new o.XQ({type:o.Bq.Select,key:"rotator",label:"rotator",defaultValue:!1,description:"Whether group is used as link rotator",options:[{key:"Yes",value:!0},{key:"No",value:!1}]}),new s.T7({description:"Date link group was created"}),new s.yH({description:"Date link group was last updated"}),new o.XQ({type:o.Bq.SelectModel,key:"user_id",label:"User",description:"User group was created by",component:i.y})]},45905:function(t,e,n){"use strict";n.d(e,{o:function(){return z}});var i=n(56515),o=n(36024),s=n(16980),a=n(67455),r=n(28577),l=n(90832),c=n(35366),d=n(28505),u=n(73234),p=n(63337),h=n(36501),g=n(48865),m=n(95157),f=n(38116),b=n(49517),v=n(34955),_=n(56361),x=n(84369),Z=n(77307),y=n(61116),w=n(13536),k=n(80922),A=n(86668),C=n(27701),T=n(54275),q=n(24311),I=n(19708),O=n(71765),U=n(47210),P=n(2406),M=n(40450);function S(t,e){1&t&&c._UZ(0,"mat-progress-bar",23)}function N(t,e){1&t&&(c.TgZ(0,"th",24),c._uU(1,"Owner"),c.qZA())}const J=function(t){return{count:t,resource:"group(s)"}};function E(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"tr"),c.TgZ(1,"th",25),c.TgZ(2,"div",26),c._uU(3," :count :resource selected: "),c.qZA(),c.TgZ(4,"div",27),c.TgZ(5,"permission-aware-button",28),c.TgZ(6,"button",29),c.NdJ("click",function(){return c.CHM(t),c.oxw().maybeDeleteSelectedGroups()}),c._uU(7," Delete "),c.qZA(),c.qZA(),c.qZA(),c.qZA(),c.qZA()}if(2&t){const t=e.ngIf;c.xp6(2),c.Q6J("transValues",c.VKq(1,J,t))}}function L(t,e){if(1&t&&(c.TgZ(0,"td",50),c._UZ(1,"user-column",51),c.qZA()),2&t){const t=c.oxw().$implicit;c.xp6(1),c.Q6J("user",t.user)}}function D(t,e){1&t&&c._UZ(0,"mat-icon",52)}function $(t,e){1&t&&(c.TgZ(0,"span"),c._uU(1,"-"),c.qZA())}function R(t,e){1&t&&c._UZ(0,"mat-icon",52)}function Y(t,e){1&t&&(c.TgZ(0,"span"),c._uU(1,"-"),c.qZA())}const F=function(t){return["/",t]},Q=function(t){return[t,"analytics"]},B=function(t){return[t,"links"]};function H(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"tr"),c._UZ(1,"td",30),c.TgZ(2,"td",31),c.TgZ(3,"a",32),c._uU(4),c.qZA(),c.qZA(),c.YNc(5,L,2,1,"td",33),c.TgZ(6,"td",34),c._uU(7),c.qZA(),c.TgZ(8,"td",35),c.YNc(9,D,1,0,"mat-icon",36),c.YNc(10,$,2,0,"span",20),c.qZA(),c.TgZ(11,"td",37),c.YNc(12,R,1,0,"mat-icon",36),c.YNc(13,Y,2,0,"span",20),c.qZA(),c.TgZ(14,"td",38),c._uU(15),c.ALo(16,"formattedDate"),c.qZA(),c.TgZ(17,"td",39),c.TgZ(18,"button",40),c.ALo(19,"trans"),c._UZ(20,"mat-icon",41),c.qZA(),c.TgZ(21,"permission-aware-button",42),c.TgZ(22,"button",40),c.ALo(23,"trans"),c._UZ(24,"mat-icon",43),c.qZA(),c.qZA(),c.TgZ(25,"permission-aware-button",42),c.TgZ(26,"button",44),c.NdJ("click",function(){const e=c.CHM(t).$implicit;return c.oxw().showCrupdateGroupModal(e)}),c.ALo(27,"trans"),c._UZ(28,"mat-icon",45),c.qZA(),c.qZA(),c._UZ(29,"copy-link-btn",46),c.TgZ(30,"permission-aware-button",47),c.TgZ(31,"button",48),c.NdJ("click",function(){const e=c.CHM(t).$implicit;return c.oxw().maybeDeleteSelectedGroups([e.id])}),c._UZ(32,"mat-icon",49),c.qZA(),c.qZA(),c.qZA(),c.qZA()}if(2&t){const t=e.$implicit,n=c.oxw();c.xp6(1),c.Q6J("table-body-checkbox",t.id),c.xp6(2),c.Q6J("routerLink",c.VKq(26,F,t.hash)),c.xp6(1),c.Oqu(t.name),c.xp6(1),c.Q6J("ngIf",n.showUserColumn()),c.xp6(2),c.Oqu(t.links_count),c.xp6(2),c.Q6J("ngIf",t.active),c.xp6(1),c.Q6J("ngIf",!t.active),c.xp6(2),c.Q6J("ngIf",t.rotator),c.xp6(1),c.Q6J("ngIf",!t.rotator),c.xp6(2),c.Oqu(c.lcZ(16,18,t.updated_at)),c.xp6(3),c.Q6J("routerLink",c.VKq(28,Q,t.id))("matTooltip",c.lcZ(19,20,"Analytics")),c.xp6(3),c.Q6J("userOwnsResource",n.currentUser.get("id")===t.user_id),c.xp6(1),c.Q6J("routerLink",c.VKq(30,B,t.id))("matTooltip",c.lcZ(23,22,"Manage Links")),c.xp6(3),c.Q6J("userOwnsResource",n.currentUser.get("id")===t.user_id),c.xp6(1),c.Q6J("matTooltip",c.lcZ(27,24,"Edit")),c.xp6(3),c.Q6J("model",t)}}function V(t,e){1&t&&(c.TgZ(0,"no-results-message",53),c.TgZ(1,"span",54),c._uU(2,"No link groups have been created yet"),c.qZA(),c.qZA())}let z=(()=>{class t{constructor(t,e,n,i,o,s,a,r){this.datatable=t,this.currentUser=e,this.linkGroups=n,this.toast=i,this.route=o,this.linkUsage=s,this.activeSection=a,this.workspaces=r,this.groups$=this.datatable.data$,this.filters=l.L}ngOnInit(){this.workspaceSub=this.workspaces.activeId$.subscribe(()=>{this.setFilters()}),this.datatable.init({uri:s.L.BASE_URI,staticParams:{with:["user"],withCount:["links"],userId:this.showUserColumn()?null:this.currentUser.get("id")}})}ngOnDestroy(){this.workspaceSub.unsubscribe()}maybeDeleteSelectedGroups(t){this.datatable.confirmResourceDeletion("link groups").subscribe(()=>{this.linkGroups.delete(t||this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset(),this.toast.open(a.V.LINK_GROUP_DELETE_SUCCESS)},t=>{this.toast.open(t.message||o.v.Default)})})}showCrupdateGroupModal(t){this.datatable.openCrupdateResourceModal(r.L,{linkGroup:t}).subscribe(()=>this.linkUsage.reload())}showUserColumn(){return this.activeSection.admin||!!this.workspaces.activeId$.value}setFilters(){this.filters=l.L.filter(t=>"user_id"!==t.key||this.showUserColumn())}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(i.x),c.Y36(d.I),c.Y36(s.L),c.Y36(u.F),c.Y36(p.gz),c.Y36(h.F),c.Y36(g.W),c.Y36(m.b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["link-group-index"]],features:[c._Bn([i.x])],decls:50,vars:13,consts:[[1,"datatable-page-header"],["trans",""],[3,"wider"],["trans","",1,"title"],[1,"header"],["pluralName","groups",3,"filters"],[1,"action-buttons"],["permission","link_groups.create"],["mat-raised-button","","color","accent","trans","",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","","trans",""],["table-sort-header","user_id","trans","",4,"ngIf"],["table-sort-header","links_count","trans",""],["table-sort-header","active","trans",""],["table-sort-header","rotator","trans",""],["table-sort-header","updated_at","trans",""],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","marketing.svg",4,"ngIf"],["mode","indeterminate","color","accent",1,"loading-bar"],["table-sort-header","user_id","trans",""],["colspan","6"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["permission","link_groups.delete"],["type","button","mat-raised-button","","color","warn","trans","",3,"click"],[3,"table-body-checkbox"],["data-label","Name"],["target","_blank",1,"link-group-name",3,"routerLink"],["data-label","Owner",4,"ngIf"],["data-label","Link Count"],["data-label","Active"],["svgIcon","check",4,"ngIf"],["data-label","Rotator"],["data-label","Last Updated"],[1,"edit-column"],["type","button","mat-icon-button","",3,"routerLink","matTooltip"],["svgIcon","bar-chart"],["permission","link_groups.update",3,"userOwnsResource"],["svgIcon","list-alt"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","edit"],[3,"model"],["permission","link_groups.delete",1,"visible-on-mobile"],["type","button","mat-icon-button","","trans","",3,"click"],["svgIcon","delete"],["data-label","Owner"],[3,"user"],["svgIcon","check"],["svgImage","marketing.svg"],["primary-text","","trans",""]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h1"),c.TgZ(2,"span",1),c._uU(3,"Link Groups"),c.qZA(),c.TgZ(4,"info-popover",2),c.TgZ(5,"div",3),c._uU(6,"Group links together to:"),c.qZA(),c.TgZ(7,"ul"),c.TgZ(8,"li",1),c._uU(9,"Simplify multiple link management."),c.qZA(),c.TgZ(10,"li",1),c._uU(11,"View statistics for a whole group instead of individual links."),c.qZA(),c.TgZ(12,"li",1),c._uU(13,"Share all links in the group with one link."),c.qZA(),c.TgZ(14,"li",1),c._uU(15,"And more."),c.qZA(),c.qZA(),c.qZA(),c.qZA(),c.TgZ(16,"div",4),c._UZ(17,"datatable-filters",5),c.TgZ(18,"div",6),c.TgZ(19,"permission-aware-button",7),c.TgZ(20,"button",8),c.NdJ("click",function(){return e.showCrupdateGroupModal()}),c._UZ(21,"mat-icon",9),c.TgZ(22,"span",1),c._uU(23,"Add New Group"),c.qZA(),c.qZA(),c.qZA(),c.qZA(),c.qZA(),c.qZA(),c.TgZ(24,"div",10),c.YNc(25,S,1,0,"mat-progress-bar",11),c.ALo(26,"async"),c.TgZ(27,"table",12),c.TgZ(28,"thead"),c.TgZ(29,"tr"),c._UZ(30,"th",13),c.TgZ(31,"th",14),c._uU(32,"Name"),c.qZA(),c.YNc(33,N,2,0,"th",15),c.TgZ(34,"th",16),c._uU(35,"Links"),c.qZA(),c.TgZ(36,"th",17),c._uU(37,"Active"),c.qZA(),c.TgZ(38,"th",18),c._uU(39,"Rotator"),c.qZA(),c.TgZ(40,"th",19),c._uU(41,"Last Updated"),c.qZA(),c._UZ(42,"th"),c.qZA(),c.YNc(43,E,8,3,"tr",20),c.qZA(),c.TgZ(44,"tbody"),c.YNc(45,H,33,32,"tr",21),c.ALo(46,"async"),c.qZA(),c.qZA(),c.YNc(47,V,3,0,"no-results-message",22),c.ALo(48,"async"),c._UZ(49,"datatable-footer"),c.qZA()),2&t&&(c.xp6(4),c.Q6J("wider",!0),c.xp6(13),c.Q6J("filters",e.filters),c.xp6(8),c.Q6J("ngIf",c.lcZ(26,7,e.datatable.paginator&&e.datatable.paginator.loading$)),c.xp6(8),c.Q6J("ngIf",e.showUserColumn()),c.xp6(10),c.Q6J("ngIf",e.datatable.selectedRows$.value.length),c.xp6(2),c.Q6J("ngForOf",c.lcZ(46,9,e.groups$)),c.xp6(2),c.Q6J("ngIf",c.lcZ(48,11,e.datatable.paginator.noResults$)))},directives:[f.P,b.N,v.h,_.v,x.lW,Z.Hw,y.O5,w.e,k.p,y.sg,A.V,C.pW,T.O,p.yS,p.rH,q.gM,I.b,O.r,U.U],pipes:[y.Ov,P.l,M.R],styles:["h1[_ngcontent-%COMP%]{display:flex;align-items:center}.link-group-name[_ngcontent-%COMP%]{color:inherit}.link-group-name[_ngcontent-%COMP%]:hover{text-decoration:underline}info-popover[_ngcontent-%COMP%] .info-popover-panel{max-width:450px!important}"],changeDetection:0}),t})()},8889:function(t,e,n){"use strict";n.d(e,{Z:function(){return f}});var i=n(78512),o=n(56515),s=n(26437),a=n(85706),r=n(35366),l=n(63337),c=n(24859),d=n(36501),u=n(16980),p=n(84222),h=n(73234),g=n(28505),m=n(32656);let f=(()=>{class t{constructor(t,e,n,o,s,a,r,l,c){this.route=t,this.modal=e,this.datatable=n,this.linkUsage=o,this.linkGroups=s,this.links=a,this.toast=r,this.router=l,this.currentUser=c,this.loading$=new i.X(!1),this.groupId$=new i.X(null)}ngOnInit(){this.route.params.subscribe(t=>{this.groupId$.next(t.groupId)})}filterByUser(){return-1===this.router.url.indexOf("admin")}setFilters(){this.filters=a.f.filter(t=>"user_id"!==t.key||!this.filterByUser())}}return t.\u0275fac=function(e){return new(e||t)(r.Y36(l.gz),r.Y36(c.u),r.Y36(o.x),r.Y36(d.F),r.Y36(u.L),r.Y36(p.M),r.Y36(h.F),r.Y36(l.F0),r.Y36(g.I))},t.\u0275cmp=r.Xpm({type:t,selectors:[["link-group-links-index"]],features:[r._Bn([o.x])],decls:1,vars:1,consts:[[3,"groupId"]],template:function(t,e){1&t&&r._UZ(0,"link-index",0),2&t&&r.Q6J("groupId",e.route.snapshot.params.groupId)},directives:[m.g],styles:["header[_ngcontent-%COMP%]{position:relative}h1[_ngcontent-%COMP%]{font-size:2rem;text-transform:capitalize;margin:0 0 10px;font-weight:400;line-height:40px}skeleton[_ngcontent-%COMP%]{max-width:350px}.mat-icon-button[_ngcontent-%COMP%]{color:var(--be-secondary-text);vertical-align:middle}"],data:{animation:s.B},changeDetection:0}),t})()},34384:function(t,e,n){"use strict";n.d(e,{O:function(){return I}});var i=n(34500),o=n(67455),s=n(11520),a=n(78512),r=n(35366),l=n(31041),c=n(72686),d=n(73234),u=n(3950),p=n(63337),h=n(61116),g=n(57173),m=n(38116),f=n(84369),b=n(6006);let v=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=r.Xpm({type:t,selectors:[["generic-page-preview"]],decls:31,vars:0,consts:[[1,"navbar"],[1,"os-button"],[1,"page-body"],[1,"top-row"],[1,"circle"],[1,"line"],[1,"middle-row"],[1,"flex-container"],[1,"left"],[1,"rect"],[1,"line","fat-line"],[1,"separator"],[1,"right"],[1,"fat-line","line"]],template:function(t,e){1&t&&(r.TgZ(0,"div",0),r._UZ(1,"div",1),r._UZ(2,"div",1),r._UZ(3,"div",1),r.qZA(),r.TgZ(4,"div",2),r.TgZ(5,"div",3),r._UZ(6,"div",4),r._UZ(7,"div",5),r._UZ(8,"div",5),r._UZ(9,"div",5),r.qZA(),r.TgZ(10,"div",6),r._UZ(11,"div",5),r._UZ(12,"div",5),r._UZ(13,"div",5),r._UZ(14,"div",5),r.qZA(),r.TgZ(15,"div",7),r.TgZ(16,"div",8),r._UZ(17,"div",9),r._UZ(18,"div",10),r._UZ(19,"div",5),r._UZ(20,"div",5),r._UZ(21,"div",11),r._UZ(22,"div",9),r._UZ(23,"div",5),r.qZA(),r.TgZ(24,"div",12),r._UZ(25,"div",9),r._UZ(26,"div",5),r._UZ(27,"div",13),r._UZ(28,"div",5),r._UZ(29,"div",11),r._UZ(30,"div",5),r.qZA(),r.qZA(),r.qZA())},styles:["[_nghost-%COMP%]{display:block;background-color:var(--be-background);height:100%;overflow:hidden}.navbar[_ngcontent-%COMP%]{display:flex;align-items:center;background-color:var(--be-background-alternative);height:40px;width:100%}.os-button[_ngcontent-%COMP%]{width:20px;height:20px;border-radius:50%;margin-left:15px}.os-button[_ngcontent-%COMP%]:first-child{background-color:#d7665d}.os-button[_ngcontent-%COMP%]:nth-child(2){background-color:#deab54}.os-button[_ngcontent-%COMP%]:nth-child(3){background-color:#6fb54c}.page-body[_ngcontent-%COMP%]{padding:25px}.top-row[_ngcontent-%COMP%]{display:flex;align-items:center;height:60px;background-color:var(--be-background-alternative);padding:10px;margin-bottom:25px}.top-row[_ngcontent-%COMP%] .line[_ngcontent-%COMP%]{width:15%;margin-left:15px}.circle[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:50%;margin-right:auto}.circle[_ngcontent-%COMP%], .line[_ngcontent-%COMP%]{background-color:var(--be-disabled-button)}.line[_ngcontent-%COMP%]{height:20px;border-radius:4px}.middle-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;flex-direction:column;height:260px;background-color:var(--be-background-alternative);margin:25px 0}.middle-row[_ngcontent-%COMP%] .line[_ngcontent-%COMP%]{height:15px;margin-bottom:5px;width:50%;background-color:var(--be-disabled-toggle)}.middle-row[_ngcontent-%COMP%] .line[_ngcontent-%COMP%]:first-child{height:35px;margin-bottom:20px;width:65%;background-color:var(--be-disabled-button)}.flex-container[_ngcontent-%COMP%]{display:flex}.fat-line[_ngcontent-%COMP%]{background-color:var(--be-chip);height:35px;margin-bottom:25px}.separator[_ngcontent-%COMP%]{height:1px;background-color:var(--be-divider-default);margin-bottom:25px;margin-top:25px}.left[_ngcontent-%COMP%]{width:30%}.left[_ngcontent-%COMP%] .rect[_ngcontent-%COMP%]{height:150px;background-color:var(--be-disabled-toggle);margin-bottom:5px}.left[_ngcontent-%COMP%] .rect[_ngcontent-%COMP%]:last-of-type{height:250px}.left[_ngcontent-%COMP%] .line[_ngcontent-%COMP%]{margin-bottom:10px}.right[_ngcontent-%COMP%]{width:70%;padding-left:25px}.right[_ngcontent-%COMP%] .rect[_ngcontent-%COMP%]{height:300px;margin-bottom:35px;background-color:var(--be-chip)}.right[_ngcontent-%COMP%] .line[_ngcontent-%COMP%]{margin-bottom:10px}"],changeDetection:0}),t})();var _=n(27701),x=n(69042),Z=n(40450);function y(t,e){1&t&&r._UZ(0,"mat-progress-bar",37)}function w(t,e){if(1&t&&(r.TgZ(0,"div",38),r._uU(1),r.qZA()),2&t){const t=r.oxw();r.xp6(1),r.Oqu(t.errors.name)}}function k(t,e){if(1&t&&(r.TgZ(0,"div",38),r._uU(1),r.qZA()),2&t){const t=r.oxw();r.xp6(1),r.Oqu(t.errors.message)}}function A(t,e){if(1&t&&(r.TgZ(0,"div",38),r._uU(1),r.qZA()),2&t){const t=r.oxw();r.xp6(1),r.Oqu(t.errors.label)}}function C(t,e){if(1&t&&(r.TgZ(0,"div",38),r._uU(1),r.qZA()),2&t){const t=r.oxw();r.xp6(1),r.Oqu(t.errors.btn_link)}}function T(t,e){if(1&t&&(r.TgZ(0,"div",38),r._uU(1),r.qZA()),2&t){const t=r.oxw();r.xp6(1),r.Oqu(t.errors.btn_text)}}function q(t,e){if(1&t&&(r.TgZ(0,"color-picker-input",39),r._uU(1),r.qZA()),2&t){const t=e.$implicit,n=r.oxw();r.Q6J("formControlName",t.key),r.xp6(1),r.Oqu(n.colorViewName(t.key))}}let I=(()=>{class t{constructor(t,e,n,i,o,s,r){this.fb=t,this.linkOverlays=e,this.toast=n,this.i18n=i,this.cd=o,this.router=s,this.route=r,this.loading$=new a.X(!1),this.errors={},this.form=this.fb.group({name:[""],position:[""],theme:[""],message:[""],label:[""],label_position:[""],btn_link:[""],btn_text:[""],colors:this.fb.group({"bg-image":this.fb.control(null),"bg-color":this.fb.control(""),"text-color":this.fb.control(""),"label-bg-color":this.fb.control(""),"label-color":this.fb.control(""),"btn-bg-color":this.fb.control(""),"btn-text-color":this.fb.control("")})})}ngOnInit(){this.route.params.subscribe(t=>{t.id&&(this.loading$.next(!0),this.linkOverlays.get(t.id).pipe((0,s.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.overlay=t.linkOverlay,this.form.patchValue(Object.assign({},this.overlay))}))})}ngAfterViewInit(){this.route.snapshot.params.id||this.form.patchValue(Object.assign({},this.getDefaultValue()))}canDeactivate(){return!this.form.dirty}confirm(){this.loading$.next(!0);const t=this.overlay?this.linkOverlays.update(this.overlay.id,this.form.value):this.linkOverlays.create(this.form.value),e=this.overlay?o.V.LINK_OVERLAY_UPDATE_SUCCESS:o.V.LINK_OVERLAY_CREATE_SUCCESS;t.pipe((0,s.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open(e),this.form.markAsPristine(),this.router.navigate([this.route.snapshot.params.id?"../../":"../"],{relativeTo:this.route})},t=>{this.errors=t.errors,this.cd.markForCheck()})}colorControls(){return this.form.get("colors").controls}colorViewName(t){return t.replace(/-/g," ").replace("bg","background").replace("btn","button")}getDefaultValue(){const t={position:"bottom-left",theme:"default",message:this.i18n.t("Your message here"),label:this.i18n.t("Label"),btn_text:this.i18n.t("Button Text"),btn_link:"https://google.com",colors:{}},e=this.overlayCmp.getComputedStyle();return Object.keys(this.colorControls()).forEach(n=>{t.colors[n]=e.getPropertyValue("--"+n).trim()}),t}}return t.\u0275fac=function(e){return new(e||t)(r.Y36(l.qu),r.Y36(c.S),r.Y36(d.F),r.Y36(u.Z),r.Y36(r.sBO),r.Y36(p.F0),r.Y36(p.gz))},t.\u0275cmp=r.Xpm({type:t,selectors:[["crupdate-link-overlay-page"]],viewQuery:function(t,e){if(1&t&&r.Gf(i.a,7),2&t){let t;r.iGM(t=r.CRH())&&(e.overlayCmp=t.first)}},decls:74,vars:29,consts:[[1,"left"],["mode","indeterminate","color","accent",4,"ngIf"],["ngNativeValidate","",3,"formGroup","ngSubmit"],["color","accent","animationDuration","200ms"],[3,"label"],[1,"many-inputs","tab-body-wrapper"],[1,"input-container"],["for","name","trans",""],["type","text","id","name","formControlName","name","required",""],["class","error",4,"ngIf"],["for","position","trans",""],["id","position","formControlName","position","required",""],["value","top-left","trans",""],["value","top-right","trans",""],["value","bottom-left","trans",""],["value","bottom-right","trans",""],["for","link-overlay-theme","trans",""],["id","link-overlay-theme","formControlName","theme","required",""],["value","default","trans",""],["value","full-width","trans",""],["value","rounded","trans",""],["value","pill","trans",""],["for","message","trans",""],["id","message","formControlName","message","maxlength","200","required",""],["for","label","trans",""],["type","text","id","label","formControlName","label","maxlength","8"],["for","btn_link","trans",""],["type","url","id","btn_link","formControlName","btn_link"],["for","btn_text","trans",""],["type","text","id","btn_text","formControlName","btn_text","maxlength","30"],["mat-raised-button","","color","accent","trans","",3,"disabled"],["formGroupName","colors",1,"tab-body-wrapper"],["formControlName","bg-image","diskPrefix","link-overlay-images",1,"overlay-bg-input"],[3,"formControlName",4,"ngFor","ngForOf"],[1,"right"],[3,"overlay"],[1,"cdk-overlay-backdrop","cdk-overlay-backdrop-showing","cdk-overlay-dark-backdrop"],["mode","indeterminate","color","accent"],[1,"error"],[3,"formControlName"]],template:function(t,e){1&t&&(r.TgZ(0,"div",0),r.YNc(1,y,1,0,"mat-progress-bar",1),r.ALo(2,"async"),r.TgZ(3,"form",2),r.NdJ("ngSubmit",function(){return e.confirm()}),r.TgZ(4,"mat-tab-group",3),r.TgZ(5,"mat-tab",4),r.ALo(6,"trans"),r.TgZ(7,"div",5),r.TgZ(8,"div",6),r.TgZ(9,"label",7),r._uU(10,"Name"),r.qZA(),r._UZ(11,"input",8),r.YNc(12,w,2,1,"div",9),r.qZA(),r.TgZ(13,"div",6),r.TgZ(14,"label",10),r._uU(15,"Position"),r.qZA(),r.TgZ(16,"select",11),r.TgZ(17,"option",12),r._uU(18,"Top Left"),r.qZA(),r.TgZ(19,"option",13),r._uU(20,"Top Right"),r.qZA(),r.TgZ(21,"option",14),r._uU(22,"Bottom Left"),r.qZA(),r.TgZ(23,"option",15),r._uU(24,"Bottom Right"),r.qZA(),r.qZA(),r.qZA(),r.TgZ(25,"div",6),r.TgZ(26,"label",16),r._uU(27,"Theme"),r.qZA(),r.TgZ(28,"select",17),r.TgZ(29,"option",18),r._uU(30,"Default"),r.qZA(),r.TgZ(31,"option",19),r._uU(32,"Full Width"),r.qZA(),r.TgZ(33,"option",20),r._uU(34,"Rounded"),r.qZA(),r.TgZ(35,"option",21),r._uU(36,"Pill"),r.qZA(),r.qZA(),r.qZA(),r.TgZ(37,"div",6),r.TgZ(38,"label",22),r._uU(39,"Message"),r.qZA(),r._UZ(40,"textarea",23),r.YNc(41,k,2,1,"div",9),r.qZA(),r.TgZ(42,"div",6),r.TgZ(43,"label",24),r._uU(44,"Label"),r.qZA(),r._UZ(45,"input",25),r.YNc(46,A,2,1,"div",9),r.qZA(),r.TgZ(47,"div",6),r.TgZ(48,"label",26),r._uU(49,"Button Link"),r.qZA(),r._UZ(50,"input",27),r.YNc(51,C,2,1,"div",9),r.qZA(),r.TgZ(52,"div",6),r.TgZ(53,"label",28),r._uU(54,"Button Text"),r.qZA(),r._UZ(55,"input",29),r.YNc(56,T,2,1,"div",9),r.qZA(),r.TgZ(57,"button",30),r.ALo(58,"async"),r._uU(59),r.qZA(),r.qZA(),r.qZA(),r.TgZ(60,"mat-tab",4),r.ALo(61,"trans"),r.TgZ(62,"div",31),r._UZ(63,"upload-image-control",32),r.YNc(64,q,2,2,"color-picker-input",33),r.ALo(65,"keyvalue"),r.TgZ(66,"button",30),r.ALo(67,"async"),r._uU(68),r.qZA(),r.qZA(),r.qZA(),r.qZA(),r.qZA(),r.qZA(),r.TgZ(69,"div",34),r._UZ(70,"generic-page-preview"),r._UZ(71,"link-overlay",35),r.ALo(72,"async"),r._UZ(73,"div",36),r.qZA()),2&t&&(r.xp6(1),r.Q6J("ngIf",r.lcZ(2,15,e.loading$)),r.xp6(2),r.Q6J("formGroup",e.form),r.xp6(2),r.Q6J("label",r.lcZ(6,17,"General")),r.xp6(7),r.Q6J("ngIf",e.errors.name),r.xp6(29),r.Q6J("ngIf",e.errors.message),r.xp6(5),r.Q6J("ngIf",e.errors.label),r.xp6(5),r.Q6J("ngIf",e.errors.btn_link),r.xp6(5),r.Q6J("ngIf",e.errors.btn_text),r.xp6(1),r.Q6J("disabled",r.lcZ(58,19,e.loading$)),r.xp6(2),r.hij(" ",e.overlay?"Update":"Create"," "),r.xp6(1),r.Q6J("label",r.lcZ(61,21,"Design")),r.xp6(4),r.Q6J("ngForOf",r.lcZ(65,23,e.colorControls())),r.xp6(2),r.Q6J("disabled",r.lcZ(67,25,e.loading$)),r.xp6(2),r.hij(" ",e.overlay?"Update":"Create"," "),r.xp6(3),r.Q6J("overlay",r.lcZ(72,27,e.form.valueChanges)))},directives:[h.O5,l.JL,l.sg,g.SP,g.uX,m.P,l.Fj,l.JJ,l.u,l.Q7,l.EJ,l.YN,l.Kr,l.nD,f.lW,l.x0,b.V,h.sg,v,i.a,_.pW,x.M],pipes:[h.Ov,Z.R,h.Nd],styles:["[_nghost-%COMP%]{display:flex;height:calc(100vh - 70px);margin:-25px}.left[_ngcontent-%COMP%], .right[_ngcontent-%COMP%]{flex:1 1 auto}.left[_ngcontent-%COMP%]{max-width:300px;padding:10px 20px 20px;background-color:var(--be-background);border-right:1px solid var(--be-divider-default);overflow:auto;box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12);z-index:1}.left[_ngcontent-%COMP%], .right[_ngcontent-%COMP%]{position:relative}.mat-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0} crupdate-link-overlay-page .mat-tab-label{width:50%;min-width:0;min-width:auto}.tab-body-wrapper[_ngcontent-%COMP%]{padding-top:15px}link-overlay[_ngcontent-%COMP%]{z-index:1001}.overlay-bg-input[_ngcontent-%COMP%]{margin-bottom:10px;height:80px;width:100%;border:1px solid var(--be-divider-default)}.overlay-bg-input[_ngcontent-%COMP%] .action-buttons{bottom:23px}"],changeDetection:0}),t})()},75950:function(t,e,n){"use strict";n.d(e,{m:function(){return F}});var i=n(67455),o=n(36024),s=n(72686),a=n(56515),r=n(44415),l=n(59075),c=n(45523);const d=[new l.XQ({type:l.Bq.Select,key:"theme",defaultValue:"default",description:"Active theme for link overlay",options:[{key:"default",value:"default"},{key:"full-width",value:"full-width"},{key:"rounded",value:"rounded"},{key:"pill",value:"pill"}]}),new c.T7({description:"Date overlay was created"}),new c.yH({description:"Date overlay was last updated"}),new l.XQ({type:l.Bq.SelectModel,key:"user_id",label:"User",description:"User overlay was created by",component:r.y})];var u=n(35366),p=n(28505),h=n(36501),g=n(73234),m=n(63337),f=n(95157),b=n(48865),v=n(38116),_=n(49517),x=n(34955),Z=n(56361),y=n(84369),w=n(77307),k=n(61116),A=n(13536),C=n(80922),T=n(86668),q=n(27701),I=n(54275),O=n(24311),U=n(71765),P=n(47210),M=n(2406),S=n(40450);function N(t,e){1&t&&u._UZ(0,"mat-progress-bar",18)}function J(t,e){1&t&&(u.TgZ(0,"th",1),u._uU(1,"Owner"),u.qZA())}const E=function(t){return{count:t,resource:"overlay(s)"}};function L(t,e){if(1&t){const t=u.EpF();u.TgZ(0,"tr"),u.TgZ(1,"th",19),u.TgZ(2,"div",20),u._uU(3," :count :resource selected: "),u.qZA(),u.TgZ(4,"div",21),u.TgZ(5,"permission-aware-button",22),u.TgZ(6,"button",23),u.NdJ("click",function(){return u.CHM(t),u.oxw().maybeDeleteSelectedOverlays()}),u._uU(7," Delete "),u.qZA(),u.qZA(),u.qZA(),u.qZA(),u.qZA()}if(2&t){const t=e.ngIf;u.xp6(2),u.Q6J("transValues",u.VKq(1,E,t))}}function D(t,e){if(1&t&&(u.TgZ(0,"td",39),u._UZ(1,"user-column",40),u.qZA()),2&t){const t=u.oxw().$implicit;u.xp6(1),u.Q6J("user",t.user)}}const $=function(t){return["edit",t]};function R(t,e){if(1&t){const t=u.EpF();u.TgZ(0,"tr"),u._UZ(1,"td",24),u.TgZ(2,"td",25),u._uU(3),u.qZA(),u.YNc(4,D,2,1,"td",26),u.TgZ(5,"td",27),u._uU(6),u.qZA(),u.TgZ(7,"td",28),u._uU(8),u.qZA(),u.TgZ(9,"td",29),u._UZ(10,"mat-icon",30),u.qZA(),u.TgZ(11,"td",31),u._uU(12),u.ALo(13,"formattedDate"),u.qZA(),u.TgZ(14,"td",32),u.TgZ(15,"permission-aware-button",33),u.TgZ(16,"button",34),u.ALo(17,"trans"),u._UZ(18,"mat-icon",35),u.qZA(),u.qZA(),u.TgZ(19,"permission-aware-button",36),u.TgZ(20,"button",37),u.NdJ("click",function(){const e=u.CHM(t).$implicit;return u.oxw().maybeDeleteSelectedOverlays([e.id])}),u._UZ(21,"mat-icon",38),u.qZA(),u.qZA(),u.qZA(),u.qZA()}if(2&t){const t=e.$implicit,n=u.oxw();u.xp6(1),u.Q6J("table-body-checkbox",t.id),u.xp6(2),u.Oqu(t.name),u.xp6(1),u.Q6J("ngIf",n.showUserColumn()),u.xp6(2),u.Oqu(t.message),u.xp6(2),u.Oqu(t.btn_text),u.xp6(2),u.Udp("color",t.colors["bg-color"]),u.xp6(2),u.Oqu(u.lcZ(13,11,t.updated_at)),u.xp6(3),u.Q6J("userOwnsResource",n.currentUser.get("id")===t.user_id),u.xp6(1),u.Q6J("routerLink",u.VKq(15,$,t.id))("matTooltip",u.lcZ(17,13,"Edit overlay"))}}function Y(t,e){1&t&&(u.TgZ(0,"no-results-message",41),u.TgZ(1,"span",42),u._uU(2,"No link overlays have been created yet"),u.qZA(),u.qZA())}let F=(()=>{class t{constructor(t,e,n,i,o,s,a,r){this.datatable=t,this.currentUser=e,this.linkUsage=n,this.linkOverlays=i,this.toast=o,this.route=s,this.workspaces=a,this.activeSection=r,this.filters=d,this.overlays$=this.datatable.data$}ngOnInit(){this.workspaceSub=this.workspaces.activeId$.subscribe(()=>{this.setFilters()}),this.datatable.init({uri:s.S.BASE_URI,staticParams:{with:["user"],userId:this.showUserColumn()?null:this.currentUser.get("id")}})}ngOnDestroy(){this.workspaceSub.unsubscribe()}maybeDeleteSelectedOverlays(t){this.datatable.confirmResourceDeletion("link overlays").subscribe(()=>{this.linkOverlays.delete(t||this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset(),this.linkUsage.reload(),this.toast.open(i.V.LINK_OVERLAY_DELETE_SUCCESS)},t=>{this.toast.open(t.message||o.v.Default)})})}showUserColumn(){return this.activeSection.admin||!!this.workspaces.activeId$.value}setFilters(){this.filters=d.filter(t=>"user_id"!==t.key||this.showUserColumn())}}return t.\u0275fac=function(e){return new(e||t)(u.Y36(a.x),u.Y36(p.I),u.Y36(h.F),u.Y36(s.S),u.Y36(g.F),u.Y36(m.gz),u.Y36(f.b),u.Y36(b.W))},t.\u0275cmp=u.Xpm({type:t,selectors:[["link-overlay-index"]],features:[u._Bn([a.x])],decls:41,vars:12,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","overlays",3,"filters"],[1,"action-buttons"],["permission","link_overlays.create"],["mat-raised-button","","color","accent","routerLink","new",1,"button-with-icon"],["svgIcon","add"],[1,"datatable","responsive-table"],["class","loading-bar","mode","indeterminate","color","accent",4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","","trans",""],["trans","",4,"ngIf"],["table-sort-header","clicks_count"],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","popular.svg",4,"ngIf"],["mode","indeterminate","color","accent",1,"loading-bar"],["colspan","8"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["permission","link_overlays.delete"],["type","button","mat-raised-button","","color","warn","trans","",3,"click"],[3,"table-body-checkbox"],["data-label","Name"],["data-label","Owner",4,"ngIf"],["data-label","Message"],["data-label","Action"],["data-label","Color"],["svgIcon","drop-custom",1,"color-icon"],["data-label","Last Updated"],[1,"edit-column"],["permission","link_overlays.update",3,"userOwnsResource"],["mat-icon-button","",3,"routerLink","matTooltip"],["svgIcon","edit"],["permission","link_overlays.delete",1,"visible-on-mobile"],["type","button","mat-icon-button","","trans","",3,"click"],["svgIcon","delete"],["data-label","Owner"],[3,"user"],["svgImage","popular.svg"],["primary-text","","trans",""]],template:function(t,e){1&t&&(u.TgZ(0,"div",0),u.TgZ(1,"h1",1),u.TgZ(2,"span",1),u._uU(3,"Link Overlays"),u.qZA(),u.TgZ(4,"info-popover"),u.TgZ(5,"span",1),u._uU(6,"Display fully customizable overlay with a message and call-to-action button over destination website."),u.qZA(),u.qZA(),u.qZA(),u.TgZ(7,"div",2),u._UZ(8,"datatable-filters",3),u.TgZ(9,"div",4),u.TgZ(10,"permission-aware-button",5),u.TgZ(11,"button",6),u._UZ(12,"mat-icon",7),u.TgZ(13,"span",1),u._uU(14,"Add New Overlay"),u.qZA(),u.qZA(),u.qZA(),u.qZA(),u.qZA(),u.qZA(),u.TgZ(15,"div",8),u.YNc(16,N,1,0,"mat-progress-bar",9),u.ALo(17,"async"),u.TgZ(18,"table",10),u.TgZ(19,"thead"),u.TgZ(20,"tr"),u._UZ(21,"th",11),u.TgZ(22,"th",12),u._uU(23,"Name"),u.qZA(),u.YNc(24,J,2,0,"th",13),u.TgZ(25,"th",14),u._uU(26,"Message"),u.qZA(),u.TgZ(27,"th",1),u._uU(28,"Action"),u.qZA(),u.TgZ(29,"th",1),u._uU(30,"Color"),u.qZA(),u.TgZ(31,"th",1),u._uU(32,"Last Updated"),u.qZA(),u._UZ(33,"th"),u.qZA(),u.YNc(34,L,8,3,"tr",15),u.qZA(),u.TgZ(35,"tbody"),u.YNc(36,R,22,17,"tr",16),u.ALo(37,"async"),u.qZA(),u.qZA(),u.YNc(38,Y,3,0,"no-results-message",17),u.ALo(39,"async"),u._UZ(40,"datatable-footer"),u.qZA()),2&t&&(u.xp6(8),u.Q6J("filters",e.filters),u.xp6(8),u.Q6J("ngIf",u.lcZ(17,6,e.datatable.paginator&&e.datatable.paginator.loading$)),u.xp6(8),u.Q6J("ngIf",e.showUserColumn()),u.xp6(10),u.Q6J("ngIf",e.datatable.selectedRows$.value.length),u.xp6(2),u.Q6J("ngForOf",u.lcZ(37,8,e.overlays$)),u.xp6(2),u.Q6J("ngIf",u.lcZ(39,10,e.datatable.paginator.noResults$)))},directives:[v.P,_.N,x.h,Z.v,y.lW,m.rH,w.Hw,k.O5,A.e,C.p,k.sg,T.V,q.pW,I.O,O.gM,U.r,P.U],pipes:[k.Ov,M.l,S.R],styles:["h1[_ngcontent-%COMP%]{display:flex;align-items:center}.info-button[_ngcontent-%COMP%]{color:var(--be-secondary-text)}"],changeDetection:0}),t})()},72686:function(t,e,n){"use strict";n.d(e,{S:function(){return s}});var i=n(35366),o=n(68515);let s=(()=>{class t{constructor(t){this.http=t}index(e={}){return this.http.get(`${t.BASE_URI}`,e)}get(e){return this.http.get(`${t.BASE_URI}/${e}`)}create(e){return this.http.post(t.BASE_URI,e)}update(e,n){return this.http.put(`${t.BASE_URI}/${e}`,n)}delete(e){return this.http.delete(`${t.BASE_URI}/${e}`)}}return t.BASE_URI="link-overlay",t.\u0275fac=function(e){return new(e||t)(i.LFG(o.r))},t.\u0275prov=i.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},87829:function(t,e,n){"use strict";n.d(e,{P:function(){return F}});var i,o,s=n(64762),a=n(92935),r=n(78512),l=n(32198),c=n(67455),d=n(99713),u=n(11520),p=n(8839),h="function"==typeof Map?new Map:(i=[],o=[],{has:function(t){return i.indexOf(t)>-1},get:function(t){return o[i.indexOf(t)]},set:function(t,e){-1===i.indexOf(t)&&(i.push(t),o.push(e))},delete:function(t){var e=i.indexOf(t);e>-1&&(i.splice(e,1),o.splice(e,1))}}),g=function(t){return new Event(t,{bubbles:!0})};try{new Event("test")}catch(i){g=function(t){var e=document.createEvent("Event");return e.initEvent(t,!0,!1),e}}function m(t){var e=h.get(t);e&&e.destroy()}function f(t){var e=h.get(t);e&&e.update()}var b=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((b=function(t){return t}).destroy=function(t){return t},b.update=function(t){return t}):((b=function(t,e){return t&&Array.prototype.forEach.call(t.length?t:[t],function(t){return function(t){if(t&&t.nodeName&&"TEXTAREA"===t.nodeName&&!h.has(t)){var e,n=null,i=null,o=null,s=function(){t.clientWidth!==i&&c()},a=(function(e){window.removeEventListener("resize",s,!1),t.removeEventListener("input",c,!1),t.removeEventListener("keyup",c,!1),t.removeEventListener("autosize:destroy",a,!1),t.removeEventListener("autosize:update",c,!1),Object.keys(e).forEach(function(n){t.style[n]=e[n]}),h.delete(t)}).bind(t,{height:t.style.height,resize:t.style.resize,overflowY:t.style.overflowY,overflowX:t.style.overflowX,wordWrap:t.style.wordWrap});t.addEventListener("autosize:destroy",a,!1),"onpropertychange"in t&&"oninput"in t&&t.addEventListener("keyup",c,!1),window.addEventListener("resize",s,!1),t.addEventListener("input",c,!1),t.addEventListener("autosize:update",c,!1),t.style.overflowX="hidden",t.style.wordWrap="break-word",h.set(t,{destroy:a,update:c}),"vertical"===(e=window.getComputedStyle(t,null)).resize?t.style.resize="none":"both"===e.resize&&(t.style.resize="horizontal"),n="content-box"===e.boxSizing?-(parseFloat(e.paddingTop)+parseFloat(e.paddingBottom)):parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth),isNaN(n)&&(n=0),c()}function r(e){var n=t.style.width;t.style.width="0px",t.style.width=n,t.style.overflowY=e}function l(){if(0!==t.scrollHeight){var e=function(t){for(var e=[];t&&t.parentNode&&t.parentNode instanceof Element;)t.parentNode.scrollTop&&e.push({node:t.parentNode,scrollTop:t.parentNode.scrollTop}),t=t.parentNode;return e}(t),o=document.documentElement&&document.documentElement.scrollTop;t.style.height="",t.style.height=t.scrollHeight+n+"px",i=t.clientWidth,e.forEach(function(t){t.node.scrollTop=t.scrollTop}),o&&(document.documentElement.scrollTop=o)}}function c(){l();var e=Math.round(parseFloat(t.style.height)),n=window.getComputedStyle(t,null),i="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):t.offsetHeight;if(i<e?"hidden"===n.overflowY&&(r("scroll"),l(),i="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(t,null).height)):t.offsetHeight):"hidden"!==n.overflowY&&(r("hidden"),l(),i="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(t,null).height)):t.offsetHeight),o!==i){o=i;var s=g("autosize:resized");try{t.dispatchEvent(s)}catch(t){}}}}(t)}),t}).destroy=function(t){return t&&Array.prototype.forEach.call(t.length?t:[t],m),t},b.update=function(t){return t&&Array.prototype.forEach.call(t.length?t:[t],f),t});var v=b,_=n(63589),x=n(35366),Z=n(38116),y=n(61116),w=n(78671);function k(t,e){if(1&t&&x._UZ(0,"share-link-btns",2),2&t){const t=x.oxw();x.Q6J("showCopyBtn",!0)("link",t.data.link)}}let A=(()=>{class t{constructor(t){this.data=t,this.message=this.data.createMsg||c.V.LINK_CREATE_SUCCESS}}return t.\u0275fac=function(e){return new(e||t)(x.Y36(_.qD))},t.\u0275cmp=x.Xpm({type:t,selectors:[["link-created-message"]],decls:3,vars:2,consts:[["trans",""],[3,"showCopyBtn","link",4,"ngIf"],[3,"showCopyBtn","link"]],template:function(t,e){1&t&&(x.TgZ(0,"div",0),x._uU(1),x.qZA(),x.YNc(2,k,1,2,"share-link-btns",1)),2&t&&(x.xp6(1),x.Oqu(e.message),x.xp6(1),x.Q6J("ngIf",e.data.link))},directives:[Z.P,y.O5,w.t],styles:["[_nghost-%COMP%]{display:flex;align-items:center}share-link-btns[_ngcontent-%COMP%]{margin-left:auto} .link-created-snackbar{padding-top:4px;padding-bottom:4px}"],changeDetection:0}),t})();var C=n(84222),T=n(73234),q=n(541),I=n(28505),O=n(88195),U=n(3950),P=n(2862);const M=["textarea"];function S(t,e){1&t&&(x.TgZ(0,"span"),x._uU(1,"Edit Link"),x.qZA())}function N(t,e){1&t&&(x.TgZ(0,"span",10),x._uU(1,"New Link"),x.qZA())}function J(t,e){if(1&t&&(x.TgZ(0,"div",23),x._uU(1),x.qZA()),2&t){const t=x.oxw(2).ngIf;x.xp6(1),x.Oqu(t.long_urls)}}function E(t,e){if(1&t&&(x.TgZ(0,"div",18),x.TgZ(1,"label",19),x._uU(2,"Multiple URLs (one per line)"),x.qZA(),x._UZ(3,"textarea",20,21),x.YNc(5,J,2,1,"div",22),x.qZA()),2&t){const t=x.oxw().ngIf;x.xp6(5),x.Q6J("ngIf",t.long_urls)}}function L(t,e){if(1&t&&(x.ynx(0),x.TgZ(1,"button",29),x.TgZ(2,"span",10),x._uU(3),x.qZA(),x._UZ(4,"mat-icon",30),x.qZA(),x._UZ(5,"link-type-menu",31,32),x.ALo(7,"async"),x.BQk()),2&t){const t=x.MAs(6),e=x.oxw(3);x.xp6(1),x.Q6J("matMenuTriggerFor",t.matMenu),x.xp6(2),x.Oqu(e.typeViewName()),x.xp6(2),x.Q6J("linkOptions",x.lcZ(7,3,e.linkOptions$))}}function D(t,e){if(1&t&&(x.TgZ(0,"div",23),x._uU(1),x.qZA()),2&t){const t=x.oxw(2).ngIf;x.xp6(1),x.Oqu(t.long_url)}}function $(t,e){if(1&t){const t=x.EpF();x.TgZ(0,"div",24),x.TgZ(1,"label",25),x._uU(2,"Paste long url"),x.qZA(),x.TgZ(3,"div",26),x.TgZ(4,"textarea",27,21),x.NdJ("enterPressed",function(){return x.CHM(t),x.oxw(2).createOrUpdate()}),x.qZA(),x.YNc(6,L,8,5,"ng-container",28),x.qZA(),x.YNc(7,D,2,1,"div",22),x.qZA()}if(2&t){const t=x.oxw().ngIf,e=x.oxw();x.xp6(4),x.Q6J("minlength",e.minLen)("maxlength",e.maxLen),x.xp6(2),x.Q6J("ngIf",e.settings.get("links.enable_type")),x.xp6(1),x.Q6J("ngIf",t.long_url)}}function R(t,e){if(1&t){const t=x.EpF();x.ynx(0,11),x.YNc(1,E,6,1,"div",12),x.YNc(2,$,8,4,"ng-template",null,13,x.W1O),x.TgZ(4,"div",14),x.TgZ(5,"button",15),x.NdJ("click",function(){return x.CHM(t),x.oxw().toggleOptions()}),x._UZ(6,"mat-icon",16),x.TgZ(7,"span",10),x._uU(8,"Advanced Options"),x.qZA(),x.qZA(),x.qZA(),x._UZ(9,"link-options-form",17),x.ALo(10,"async"),x.ALo(11,"async"),x.BQk()}if(2&t){const t=x.MAs(3),e=x.oxw();x.Q6J("formGroup",e.linkForm.formGroup),x.xp6(1),x.Q6J("ngIf",e.data.batch)("ngIfElse",t),x.xp6(8),x.Q6J("featuresToHide",e.data.featuresToHide)("@bodyExpansion",x.lcZ(10,7,e.optionsVisible$))("linkOptions",x.lcZ(11,9,e.linkOptions$))("batch",e.data.batch)}}function Y(t,e){if(1&t&&x._UZ(0,"share-link-btns",33),2&t){const t=x.oxw();x.Q6J("showCopyBtn",!0)("link",t.data.link)}}let F=(()=>{class t{constructor(t,e,n,i,o,s,a,l,c,d){this.dialogRef=t,this.data=e,this.linkForm=n,this.links=i,this.toast=o,this.selectValues=s,this.currentUser=a,this.settings=l,this.i18n=c,this.recaptcha=d,this.loading$=new r.X(!1),this.updating$=new r.X(!1),this.optionsVisible$=new r.X(!1),this.linkOptions$=new r.X(null),this.minLen=this.settings.get("links.min_len"),this.maxLen=this.settings.get("links.max_len"),e.link&&(this.updating$.next(!0),this.linkForm.patchValue(e.link))}ngOnInit(){this.selectValues.get().subscribe(t=>{this.linkOptions$.next(t)})}ngAfterViewInit(){v(this.textarea.nativeElement)}createOrUpdate(){return(0,s.mG)(this,void 0,void 0,function*(){const t=this.getPayload();return this.urlInvalid(t.long_url)?this.linkForm.setErrors({long_url:this.i18n.t("This url is invalid.")}):(this.loading$.next(!0),(yield this.recaptcha.verify("link_creation"))?void(this.updating$.value?this.links.update(this.data.link.id,t):this.links.create(t)).pipe((0,u.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.updating$.value?this.toast.open(c.V.LINK_UPDATE_SUCCESS):this.toast.openComponent(A,{data:{link:t.link,createMsg:this.data.createMsg},duration:6e3,panelClass:"link-created-snackbar"}),this.close(t.link)},t=>this.linkForm.setErrors(t.errors)):this.loading$.next(!1))})}shortenBatchUrls(){return(0,s.mG)(this,void 0,void 0,function*(){const t=this.getPayload();return t.long_urls.some(t=>this.urlInvalid(t))?this.linkForm.setErrors({long_urls:this.i18n.t("Some of the urls are not valid.")}):(this.loading$.next(!0),(yield this.recaptcha.verify("link_creation"))?void this.links.createBatch(t).pipe((0,u.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.toast.open(c.V.MULTIPLE_LINKS_CREATE_SUCCESS),this.close(t.links)},t=>this.linkForm.setErrors(t.errors)):this.loading$.next(!1))})}close(t){this.dialogRef.close(t)}toggleOptions(){this.optionsVisible$.next(!this.optionsVisible$.value)}typeViewName(){return this.linkForm.formGroup.get("type").value.split(":")[0]}getPayload(){const t=this.linkForm.value();return this.data.groups&&(t.groups=Object.assign(Object.assign({},t.groups),this.data.groups)),t}urlInvalid(t){return!p({exact:!0,strict:!1}).test(t)}}return t.\u0275fac=function(e){return new(e||t)(x.Y36(a.so),x.Y36(a.WI),x.Y36(l.l),x.Y36(C.M),x.Y36(T.F),x.Y36(q.U),x.Y36(I.I),x.Y36(O.Z),x.Y36(U.Z),x.Y36(P.K))},t.\u0275cmp=x.Xpm({type:t,selectors:[["crupdate-link-modal"]],viewQuery:function(t,e){if(1&t&&x.Gf(M,5),2&t){let t;x.iGM(t=x.CRH())&&(e.textarea=t.first)}},features:[x._Bn([l.l])],decls:18,vars:11,consts:[[1,"modal-header"],["mat-dialog-title",""],[4,"ngIf","ngIfElse"],["creating",""],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"ngSubmit"],[3,"formGroup",4,"ngIf"],["class","colored dialog-actions-left",3,"showCopyBtn","link",4,"ngIf"],["type","submit","mat-raised-button","","color","accent","trans","",1,"submit-button",3,"disabled"],["trans",""],[3,"formGroup"],["class","input-container",4,"ngIf","ngIfElse"],["single",""],[1,"actions"],["type","button","mat-button","",1,"advanced-options-btn",3,"click"],["svgIcon","settings"],[3,"featuresToHide","linkOptions","batch"],[1,"input-container"],["for","link-dialog-multiple-urls","trans",""],["name","link-dialog-multiple-urls","id","link-dialog-multiple-urls","autocomplete","off","spellcheck","false","formControlName","long_urls",1,"multiple-link-textarea"],["textarea",""],["class","error",4,"ngIf"],[1,"error"],[1,"input-container","link-input-container"],["for","link-dialog-long-url","trans","",1,"hidden"],[1,"input-with-action"],["type","text","id","link-dialog-long-url","autocomplete","off","spellcheck","false","enterKeybind","","formControlName","long_url","placeholder","Enter long url...","trans-placeholder","","required","",1,"single-link-textarea",3,"minlength","maxlength","enterPressed"],[4,"ngIf"],["mat-flat-button","","color","gray","type","button",1,"type-button",3,"matMenuTriggerFor"],["svgIcon","arrow-drop-down"],["formControlName","type",3,"linkOptions"],["linkTypeMenu",""],[1,"colored","dialog-actions-left",3,"showCopyBtn","link"]],template:function(t,e){if(1&t&&(x.TgZ(0,"div",0),x.TgZ(1,"h2",1),x.GkF(2),x.YNc(3,S,2,0,"span",2),x.ALo(4,"async"),x.YNc(5,N,2,0,"ng-template",null,3,x.W1O),x.qZA(),x.TgZ(7,"button",4),x.NdJ("click",function(){return e.close()}),x._UZ(8,"mat-icon",5),x.qZA(),x.qZA(),x.TgZ(9,"form",6),x.NdJ("ngSubmit",function(){return e.data.batch?e.shortenBatchUrls():e.createOrUpdate()}),x.TgZ(10,"mat-dialog-content"),x.YNc(11,R,12,11,"ng-container",7),x.ALo(12,"async"),x.qZA(),x.TgZ(13,"mat-dialog-actions"),x.YNc(14,Y,1,2,"share-link-btns",8),x.TgZ(15,"button",9),x.ALo(16,"async"),x._uU(17," Confirm "),x.qZA(),x.qZA(),x.qZA()),2&t){const t=x.MAs(6);x.xp6(3),x.Q6J("ngIf",x.lcZ(4,5,e.updating$))("ngIfElse",t),x.xp6(8),x.Q6J("ngIf",x.lcZ(12,7,e.linkForm.errors$)),x.xp6(3),x.Q6J("ngIf",e.data.link),x.xp6(1),x.Q6J("disabled",x.lcZ(16,9,e.loading$))}},styles:["[_nghost-%COMP%]{display:block;width:650px;max-width:100%}.single-link-textarea[_ngcontent-%COMP%]{max-height:130px;height:46px;border-right:1px solid var(--be-divider-default)!important}.multiple-link-textarea[_ngcontent-%COMP%]{height:242px;max-height:300px}textarea[_ngcontent-%COMP%]{resize:vertical;word-break:break-all;font-size:1.5rem;line-height:1.5}.link-input-container[_ngcontent-%COMP%]{margin-bottom:5px}.type-container[_ngcontent-%COMP%]{margin-left:auto;width:auto;min-width:100px}.type-button[_ngcontent-%COMP%]{text-transform:capitalize;max-height:46px}.type-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{margin-bottom:3px}.advanced-options-btn[_ngcontent-%COMP%]{padding:0 6px;margin-left:-6px;overflow:hidden}.advanced-options-btn[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{margin-right:5px}.dialog-actions-left[_ngcontent-%COMP%]{margin-right:auto}.mat-dialog-actions[_ngcontent-%COMP%]{margin-top:15px}.submit-button[_ngcontent-%COMP%]{width:120px;line-height:40px}@media screen and (max-width:768px){.multiple-toggle[_ngcontent-%COMP%]{display:none}}"],data:{animation:[(0,d.X$)("bodyExpansion",[(0,d.SB)("false",(0,d.oB)({height:"0px",visibility:"hidden"})),(0,d.SB)("true",(0,d.oB)({height:"*",visibility:"visible"})),(0,d.eR)("true <=> false",(0,d.jt)("225ms cubic-bezier(0.4,0.0,0.2,1)"))])]},changeDetection:0}),t})()},541:function(t,e,n){"use strict";n.d(e,{U:function(){return r}});var i=n(25051),o=n(35366),s=n(9823),a=n(28505);let r=(()=>{class t{constructor(t,e){this.http=t,this.currentUser=e}get(){return this.http.getWithCache(`${i.l.BASE_URI}/${["countries","domains","pages","overlays","pixels","groups"].join(",")}`,{userId:this.currentUser.get("id"),pageType:"link_page"})}clearCache(){this.http.clearCache()}}return t.\u0275fac=function(e){return new(e||t)(o.LFG(s.F),o.LFG(a.I))},t.\u0275prov=o.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},85706:function(t,e,n){"use strict";n.d(e,{f:function(){return a}});var i=n(59075),o=n(45523),s=n(44415);const a=[new i.XQ({type:i.Bq.Select,key:"type",description:"Type of the link",defaultValue:"direct",options:[{key:"All",value:""},{key:"Direct",value:"direct"},{key:"Overlay",value:"overlay"},{key:"Frame",value:"frame"},{key:"Custom Page",value:"link_page"}]}),new i.XQ({type:i.Bq.Select,key:"active",label:"status",defaultValue:!1,description:"Whether link is disabled or not",options:[{key:"enabled",value:!1},{key:"disabled",value:!0}]}),new i.XQ({type:i.Bq.Select,key:"password",description:"Whether link is password protected",options:[{key:"any",value:""},{key:"does not have password",value:{value:null,operator:i.pg.eq}},{key:"has password",value:{value:null,operator:i.pg.ne}}]}),new i.XQ({type:i.Bq.Input,inputType:"number",key:"clicks_count",label:"Click Count",description:"Total number of clicks for link",defaultValue:1,defaultOperator:i.pg.gte,operators:i.Hi}),new o.k4({key:"clicked_at",label:"Clicked At",description:"Date the link was last clicked"}),new o.k4({key:"expires_at",label:"Expires At",description:"Date the link will expire"}),new o.T7({description:"Date link was created"}),new o.yH({description:"Date link was last updated"}),new i.XQ({type:i.Bq.SelectModel,key:"user_id",label:"User",description:"User link was created by",component:s.y})]},32656:function(t,e,n){"use strict";n.d(e,{g:function(){return vt}});var i=n(36024),o=n(87829),s=n(84222),a=n(56515),r=n(67455),l=n(85706),c=n(16980),d=n(78512),u=n(4694),p=n(92935),h=n(40878),g=n(31041),m=n(56238),f=n(47701),b=n(98720),v=n(44689),_=n(47727),x=n(11520),Z=n(79996),y=n(35366),w=n(28505),k=n(73234),A=n(48865),C=n(95157),T=n(38116),q=n(77307),I=n(61116),O=n(27701),U=n(47210),P=n(40985);function M(t,e){1&t&&y._UZ(0,"mat-progress-bar",8)}function S(t,e){if(1&t){const t=y.EpF();y.TgZ(0,"div",12),y.NdJ("click",function(){const e=y.CHM(t).$implicit;return y.oxw(2).confirm(e)}),y._UZ(1,"img",13),y.ALo(2,"favicon"),y.TgZ(3,"button",14),y.ALo(4,"async"),y.TgZ(5,"span",15),y._uU(6),y.qZA(),y.TgZ(7,"span",16),y._uU(8),y.qZA(),y.qZA(),y.qZA()}if(2&t){const t=e.$implicit,n=y.oxw(2);y.xp6(1),y.Q6J("src",y.lcZ(2,4,t.long_url),y.LSH),y.xp6(2),y.Q6J("disabled",y.lcZ(4,6,n.loading$)),y.xp6(3),y.Oqu(t.long_url),y.xp6(2),y.Oqu(t.short_url)}}function N(t,e){1&t&&(y.TgZ(0,"div",17),y.TgZ(1,"no-results-message"),y.TgZ(2,"span",18),y._uU(3,"Could not find any links matching this query."),y.qZA(),y.qZA(),y.qZA())}function J(t,e){if(1&t&&(y.TgZ(0,"div",9),y.YNc(1,S,9,8,"div",10),y.YNc(2,N,4,0,"div",11),y.qZA()),2&t){const t=e.ngIf;y.xp6(1),y.Q6J("ngForOf",t),y.xp6(1),y.Q6J("ngIf",!t.length)}}let E=(()=>{class t{constructor(t,e,n,i,o,s,a,r){this.dialogRef=t,this.data=e,this.linkGroup=n,this.link=i,this.currentUser=o,this.toast=s,this.activeSection=a,this.workspaces=r,this.loading$=new d.X(!1),this.links$=new d.X(null),this.searchControl=new g.NI}ngOnInit(){this.searchControl.valueChanges.pipe((0,m.O)(""),(0,f.b)(250),(0,b.x)(),(0,v.w)(t=>this.findLinks(t)),(0,_.K)(()=>(0,h.of)([]))).subscribe(t=>{this.links$.next(t),this.loading$.next(!1)})}close(t){this.dialogRef.close(t)}confirm(t){this.loading$.next(!0),this.linkGroup.attach(this.data.groupId,[t.id]).pipe((0,x.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open(r.V.LINK_ATTACH_SUCCESS),this.close(t)})}findLinks(t){this.loading$.next(!0);const e="!"+this.data.groupId,n=this.forCurrentUser()?this.currentUser.get("id"):null;return this.link.index({query:t,userId:n,groupId:e,per_page:8}).pipe((0,Z.U)(t=>t.pagination.data))}forCurrentUser(){return!this.activeSection.admin&&!this.workspaces.activeId$.value}}return t.\u0275fac=function(e){return new(e||t)(y.Y36(p.so),y.Y36(p.WI),y.Y36(c.L),y.Y36(s.M),y.Y36(w.I),y.Y36(k.F),y.Y36(A.W),y.Y36(C.b))},t.\u0275cmp=y.Xpm({type:t,selectors:[["attach-link-modal"]],decls:12,vars:7,consts:[[1,"modal-header"],["mat-dialog-title","","trans",""],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],[1,"input-container"],["type","text","placeholder","Search for links...",3,"formControl"],["mode","indeterminate","color","accent",4,"ngIf"],["class","links",4,"ngIf"],["mode","indeterminate","color","accent"],[1,"links"],["class","link",3,"click",4,"ngFor","ngForOf"],["class","link",4,"ngIf"],[1,"link",3,"click"],[3,"src"],[1,"meta","overflow-hidden","no-style",3,"disabled"],[1,"long-url","overflow-hidden"],[1,"short-url","overflow-hidden"],[1,"link"],["secondary-text","","trans",""]],template:function(t,e){1&t&&(y.TgZ(0,"div",0),y.TgZ(1,"h2",1),y._uU(2,"Add Existing Links to Group"),y.qZA(),y.TgZ(3,"button",2),y.NdJ("click",function(){return e.close()}),y._UZ(4,"mat-icon",3),y.qZA(),y.qZA(),y.TgZ(5,"mat-dialog-content"),y.TgZ(6,"div",4),y._UZ(7,"input",5),y.YNc(8,M,1,0,"mat-progress-bar",6),y.ALo(9,"async"),y.qZA(),y.YNc(10,J,3,2,"div",7),y.ALo(11,"async"),y.qZA()),2&t&&(y.xp6(7),y.Q6J("formControl",e.searchControl),y.xp6(1),y.Q6J("ngIf",y.lcZ(9,3,e.loading$)),y.xp6(2),y.Q6J("ngIf",y.lcZ(11,5,e.links$)))},directives:[p.uh,T.P,q.Hw,p.xY,g.Fj,g.JJ,g.oH,I.O5,O.pW,I.sg,U.U],pipes:[I.Ov,P.K],styles:["[_nghost-%COMP%]{display:block;width:450px;max-width:100%}.modal-header[_ngcontent-%COMP%]{margin-bottom:15px}.input-container[_ngcontent-%COMP%]{width:100%;margin-bottom:30px;position:relative}.mat-progress-bar[_ngcontent-%COMP%]{position:absolute;bottom:0}.link[_ngcontent-%COMP%]{display:flex;margin-bottom:20px;cursor:pointer}.link[_ngcontent-%COMP%]:hover .overflow-hidden[_ngcontent-%COMP%]{color:var(--be-primary-default)}.link[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:25px;height:25px;flex-shrink:0;margin-right:10px;border-radius:4px;overflow:hidden}.link[_ngcontent-%COMP%] .long-url[_ngcontent-%COMP%]{color:var(--be-text);font-weight:500;margin-bottom:5px}.link[_ngcontent-%COMP%] .short-url[_ngcontent-%COMP%]{color:var(--be-secondary-text);font-size:1.3rem}.overflow-hidden[_ngcontent-%COMP%]{display:block;overflow:hidden;text-overflow:ellipsis}"],changeDetection:0}),t})();var L=n(63337),D=n(36501),$=n(37123),R=n(24859),Y=n(34955),F=n(84369),Q=n(97070),B=n(56361),H=n(13536),V=n(80922),z=n(86668),G=n(54275),j=n(24311),X=n(19708),W=n(71765);let K=(()=>{class t{transform(t){return t&&t.replace(/(^\w+:|^)\/\//,"")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275pipe=y.Yjl({name:"removeProtocol",type:t,pure:!0}),t})();var tt=n(40450),et=n(2406);const nt=function(t){return{groupName:t}};function it(t,e){1&t&&(y.TgZ(0,"span",30),y._uU(1,' Links for ":groupName" '),y.qZA()),2&t&&y.Q6J("transValues",y.VKq(1,nt,e.ngIf.name))}function ot(t,e){if(1&t&&(y.ynx(0),y.TgZ(1,"a",27),y._UZ(2,"mat-icon",28),y.qZA(),y.YNc(3,it,2,3,"span",29),y.ALo(4,"async"),y.BQk()),2&t){const t=y.oxw();y.xp6(3),y.Q6J("ngIf",y.lcZ(4,1,t.group$))}}function st(t,e){1&t&&(y.TgZ(0,"span",7),y._uU(1,"Links"),y.qZA())}function at(t,e){if(1&t){const t=y.EpF();y.TgZ(0,"permission-aware-button",31),y.TgZ(1,"button",12),y.NdJ("click",function(){return y.CHM(t),y.oxw().showAttachLinksToGroupModal()}),y._UZ(2,"mat-icon",32),y.TgZ(3,"span",7),y._uU(4,"Move existing links to this group"),y.qZA(),y.qZA(),y.qZA()}}function rt(t,e){1&t&&y._UZ(0,"mat-progress-bar",33)}function lt(t,e){1&t&&(y.ynx(0),y.TgZ(1,"th",34),y._uU(2,"Owner"),y.qZA(),y.BQk())}function ct(t,e){if(1&t){const t=y.EpF();y.TgZ(0,"button",41),y.NdJ("click",function(){return y.CHM(t),y.oxw(2).maybeDetachLinksFromGroup()}),y._uU(1," Detach from group "),y.qZA()}}const dt=function(t){return{count:t,resource:"link(s)"}};function ut(t,e){if(1&t){const t=y.EpF();y.TgZ(0,"tr"),y.TgZ(1,"th",35),y.TgZ(2,"div",36),y._uU(3," :count :resource selected: "),y.qZA(),y.TgZ(4,"div",37),y.YNc(5,ct,2,0,"button",38),y.TgZ(6,"permission-aware-button",39),y.TgZ(7,"button",40),y.NdJ("click",function(){return y.CHM(t),y.oxw().maybeDeleteSelectedLinks()}),y._uU(8," Delete "),y.qZA(),y.qZA(),y.qZA(),y.qZA(),y.qZA()}if(2&t){const t=e.ngIf,n=y.oxw();y.xp6(2),y.Q6J("transValues",y.VKq(2,dt,t)),y.xp6(3),y.Q6J("ngIf",n.groupId)}}function pt(t,e){if(1&t&&(y.TgZ(0,"td",65),y._UZ(1,"user-column",66),y.qZA()),2&t){const t=y.oxw().$implicit;y.xp6(1),y.Q6J("user",t.user)}}function ht(t,e){1&t&&y._UZ(0,"mat-icon",67)}function gt(t,e){1&t&&(y.TgZ(0,"span"),y._uU(1,"-"),y.qZA())}const mt=function(t,e){return["/",t,"links",e]};function ft(t,e){if(1&t){const t=y.EpF();y.TgZ(0,"tr"),y._UZ(1,"td",42),y.TgZ(2,"td",43),y.TgZ(3,"a",44),y._UZ(4,"img",45),y.ALo(5,"favicon"),y.TgZ(6,"span"),y._uU(7),y.ALo(8,"slice"),y.ALo(9,"removeProtocol"),y.qZA(),y.qZA(),y.TgZ(10,"div",46),y.TgZ(11,"a",47),y._uU(12),y.qZA(),y.qZA(),y.qZA(),y.YNc(13,pt,2,1,"td",48),y.TgZ(14,"td",49),y._uU(15),y.ALo(16,"number"),y.qZA(),y.TgZ(17,"td",50),y._uU(18),y.qZA(),y.TgZ(19,"td",51),y.YNc(20,ht,1,0,"mat-icon",52),y.YNc(21,gt,2,0,"span",1),y.qZA(),y.TgZ(22,"td",53),y._uU(23),y.ALo(24,"trans"),y.ALo(25,"formattedDate"),y.qZA(),y.TgZ(26,"td",54),y._uU(27),y.ALo(28,"formattedDate"),y.qZA(),y.TgZ(29,"td",55),y.TgZ(30,"a",56),y.ALo(31,"trans"),y._UZ(32,"mat-icon",57),y.qZA(),y._UZ(33,"copy-link-btn",58),y.TgZ(34,"permission-aware-button",59),y.TgZ(35,"button",60),y.NdJ("click",function(){const e=y.CHM(t).$implicit;return y.oxw().showCrupdateLinkModal(e)}),y.ALo(36,"trans"),y._UZ(37,"mat-icon",61),y.qZA(),y.qZA(),y.TgZ(38,"permission-aware-button",62),y.TgZ(39,"button",63),y.NdJ("click",function(){const e=y.CHM(t).$implicit;return y.oxw().maybeDeleteSelectedLinks([e.id])}),y.ALo(40,"trans"),y._UZ(41,"mat-icon",64),y.qZA(),y.qZA(),y.qZA(),y.qZA()}if(2&t){const t=e.$implicit,n=y.oxw();y.xp6(1),y.Q6J("table-body-checkbox",t.id),y.xp6(2),y.Q6J("href",t.long_url,y.LSH),y.xp6(1),y.Q6J("src",y.lcZ(5,20,t.long_url),y.LSH),y.xp6(3),y.Oqu(y.Dn7(8,22,y.lcZ(9,26,t.long_url),0,50)),y.xp6(4),y.Q6J("href",t.short_url,y.LSH),y.xp6(1),y.Oqu(t.short_url),y.xp6(1),y.Q6J("ngIf",n.showUserColumn()),y.xp6(2),y.Oqu(y.lcZ(16,28,t.clicks_count)),y.xp6(3),y.Oqu(t.type),y.xp6(2),y.Q6J("ngIf",t.has_password),y.xp6(1),y.Q6J("ngIf",!t.has_password),y.xp6(2),y.hij(" ",t.deleted_at?y.lcZ(24,30,"Expired"):t.expires_at?y.lcZ(25,32,t.expires_at):"-"," "),y.xp6(4),y.Oqu(t.clicked_at?y.lcZ(28,34,t.clicked_at):"-"),y.xp6(3),y.Q6J("routerLink",y.WLB(42,mt,n.getParentRoute(),t.id))("matTooltip",y.lcZ(31,36,"Link Statistics")),y.xp6(3),y.Q6J("model",t),y.xp6(1),y.Q6J("userOwnsResource",t.user_id===n.currentUser.get("id")),y.xp6(1),y.Q6J("matTooltip",y.lcZ(36,38,"Edit link")),y.xp6(3),y.Q6J("userOwnsResource",t.user_id===n.currentUser.get("id")),y.xp6(1),y.Q6J("matTooltip",y.lcZ(40,40,"Delete link"))}}function bt(t,e){1&t&&(y.TgZ(0,"no-results-message",68),y.TgZ(1,"span",69),y._uU(2,"No links have been added yet"),y.qZA(),y.qZA())}let vt=(()=>{class t{constructor(t,e,n,i,o,s,a,r,l,c,u,p){this.datatable=t,this.currentUser=e,this.links=n,this.toast=i,this.route=o,this.linkUsage=s,this.csv=a,this.router=r,this.modal=l,this.groups=c,this.workspaces=u,this.activeSection=p,this.group$=new d.X(null),this.links$=this.datatable.data$}ngOnInit(){this.workspaceSub=this.workspaces.activeId$.subscribe(()=>{this.setFilters()}),this.datatable.init({uri:this.groupId?`${c.L.BASE_URI}/${this.groupId}/links`:s.M.BASE_URI,staticParams:{with:["user"],userId:this.showUserColumn()?null:this.currentUser.get("id")}}),this.groupId&&this.datatable.paginator.response$.subscribe(t=>{this.group$.next(null==t?void 0:t.linkGroup)})}ngOnDestroy(){this.workspaceSub.unsubscribe()}maybeDeleteSelectedLinks(t){this.datatable.confirmResourceDeletion("links").subscribe(()=>{this.links.delete(t||this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset(),this.linkUsage.reload(),this.toast.open(r.V.LINK_DELETE_SUCCESS)},t=>{this.toast.open(t.message||i.v.Default)})})}showAttachLinksToGroupModal(){this.modal.open(E,{groupId:this.groupId}).beforeClosed().subscribe(t=>{t&&this.datatable.reset()})}maybeDetachLinksFromGroup(){this.modal.open(u.z,{title:"Detach Links",body:"Are you sure you want to detach selected links from this group?",ok:"Detach"}).afterClosed().subscribe(t=>{t&&this.groups.detach(this.groupId,this.datatable.selectedRows$.value).subscribe(()=>this.datatable.reset(),t=>{this.toast.open(t.message||i.v.Default)})})}showCrupdateLinkModal(t,e){this.datatable.openCrupdateResourceModal(o.P,{link:t,groups:{[this.groupId]:{}},batch:e}).subscribe(()=>this.linkUsage.reload())}showUserColumn(){return this.activeSection.admin||!!this.workspaces.activeId$.value}setFilters(){this.filters=l.f.filter(t=>"user_id"!==t.key||this.showUserColumn())}exportCsv(){this.csv.export(s.M.EXPORT_CSV_URI,{type:this.activeSection.admin?"all":null})}getParentRoute(){return this.activeSection.admin?"admin":"dashboard"}}return t.\u0275fac=function(e){return new(e||t)(y.Y36(a.x),y.Y36(w.I),y.Y36(s.M),y.Y36(k.F),y.Y36(L.gz),y.Y36(D.F),y.Y36($.T),y.Y36(L.F0),y.Y36(R.u),y.Y36(c.L),y.Y36(C.b),y.Y36(A.W))},t.\u0275cmp=y.Xpm({type:t,selectors:[["link-index"]],inputs:{groupId:"groupId"},features:[y._Bn([a.x])],decls:56,vars:18,consts:[[1,"datatable-page-header"],[4,"ngIf"],["trans","",4,"ngIf"],[1,"header"],["pluralName","links",3,"filters"],[1,"action-buttons"],["mat-raised-button","",1,"btn-with-dropdown-icon",3,"matMenuTriggerFor"],["trans",""],["svgIcon","keyboard-arrow-down"],["menu","matMenu"],["permission","link_groups.update",4,"ngIf"],["permission","links.create"],["mat-menu-item","",3,"click"],["svgIcon","add-link"],["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","clicks_count"],["table-sort-header","","trans",""],["table-sort-header","expires_at","trans",""],["table-sort-header","clicked_at","trans",""],[4,"ngFor","ngForOf"],["svgImage","share-link.svg",4,"ngIf"],["routerLink","../../","mat-icon-button","",1,"back-button"],["svgIcon","arrow-back"],["trans","",3,"transValues",4,"ngIf"],["trans","",3,"transValues"],["permission","link_groups.update"],["svgIcon","shortcut"],["mode","indeterminate","color","accent",1,"loading-bar"],["table-sort-header","user_id","trans",""],["colspan","9"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["type","button","mat-raised-button","","color","accent","trans","",3,"click",4,"ngIf"],["permission","links.delete"],["type","button","mat-raised-button","","color","warn","trans","",3,"click"],["type","button","mat-raised-button","","color","accent","trans","",3,"click"],[3,"table-body-checkbox"],[1,"link-summary-column","mobile-no-label"],["target","_blank",1,"long-url",3,"href"],["alt","Link favicon",1,"favicon-img",3,"src"],[1,"short-url"],["target","_blank",3,"href"],["data-label","Owner",4,"ngIf"],["data-label","Clicks"],["data-label","Type",1,"capitalize"],["data-label","Password"],["svgIcon","check",4,"ngIf"],["data-label","Expires At"],["data-label","Last Clicked"],[1,"edit-column"],["mat-icon-button","",3,"routerLink","matTooltip"],["svgIcon","analytics"],[3,"model"],["permission","links.update",3,"userOwnsResource"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","edit"],["permission","links.delete",3,"userOwnsResource"],["mat-icon-button","",1,"visible-on-mobile",3,"matTooltip","click"],["svgIcon","delete"],["data-label","Owner"],[3,"user"],["svgIcon","check"],["svgImage","share-link.svg"],["primary-text","","trans",""]],template:function(t,e){if(1&t&&(y.TgZ(0,"div",0),y.TgZ(1,"h1"),y.YNc(2,ot,5,3,"ng-container",1),y.YNc(3,st,2,0,"span",2),y.qZA(),y.TgZ(4,"div",3),y._UZ(5,"datatable-filters",4),y.TgZ(6,"div",5),y.TgZ(7,"button",6),y.TgZ(8,"span",7),y._uU(9,"More Actions"),y.qZA(),y._UZ(10,"mat-icon",8),y.qZA(),y.TgZ(11,"mat-menu",null,9),y.YNc(13,at,5,0,"permission-aware-button",10),y.TgZ(14,"permission-aware-button",11),y.TgZ(15,"button",12),y.NdJ("click",function(){return e.showCrupdateLinkModal(null,!0)}),y._UZ(16,"mat-icon",13),y.TgZ(17,"span",7),y._uU(18),y.qZA(),y.qZA(),y.qZA(),y.TgZ(19,"button",12),y.NdJ("click",function(){return e.exportCsv()}),y._UZ(20,"mat-icon",14),y.TgZ(21,"span",7),y._uU(22,"Export links in CSV"),y.qZA(),y.qZA(),y.qZA(),y.TgZ(23,"permission-aware-button",11),y.TgZ(24,"button",15),y.NdJ("click",function(){return e.showCrupdateLinkModal()}),y._UZ(25,"mat-icon",16),y.TgZ(26,"span",7),y._uU(27),y.qZA(),y.qZA(),y.qZA(),y.qZA(),y.qZA(),y.qZA(),y.TgZ(28,"div",17),y.YNc(29,rt,1,0,"mat-progress-bar",18),y.ALo(30,"async"),y.TgZ(31,"table",19),y.TgZ(32,"thead"),y.TgZ(33,"tr"),y._UZ(34,"th",20),y.TgZ(35,"th",7),y._uU(36,"Summary"),y.qZA(),y.YNc(37,lt,3,0,"ng-container",1),y.TgZ(38,"th",21),y._uU(39,"Clicks"),y.qZA(),y.TgZ(40,"th",22),y._uU(41,"Type"),y.qZA(),y.TgZ(42,"th",22),y._uU(43,"Password"),y.qZA(),y.TgZ(44,"th",23),y._uU(45,"Expires At"),y.qZA(),y.TgZ(46,"th",24),y._uU(47,"Last Clicked"),y.qZA(),y._UZ(48,"th"),y.qZA(),y.YNc(49,ut,9,4,"tr",1),y.qZA(),y.TgZ(50,"tbody"),y.YNc(51,ft,42,45,"tr",25),y.ALo(52,"async"),y.qZA(),y.qZA(),y.YNc(53,bt,3,0,"no-results-message",26),y.ALo(54,"async"),y._UZ(55,"datatable-footer"),y.qZA()),2&t){const t=y.MAs(12);y.xp6(2),y.Q6J("ngIf",e.groupId),y.xp6(1),y.Q6J("ngIf",!e.groupId),y.xp6(2),y.Q6J("filters",e.filters),y.xp6(2),y.Q6J("matMenuTriggerFor",t),y.xp6(6),y.Q6J("ngIf",e.groupId),y.xp6(5),y.Oqu(e.groupId?"Add multiple links":"Shorten multiple links"),y.xp6(9),y.Oqu(e.groupId?"Add Link":"Shorten Link"),y.xp6(2),y.Q6J("ngIf",y.lcZ(30,12,e.datatable.paginator&&e.datatable.paginator.loading$)),y.xp6(8),y.Q6J("ngIf",e.showUserColumn()),y.xp6(12),y.Q6J("ngIf",e.datatable.selectedRows$.value.length),y.xp6(2),y.Q6J("ngForOf",y.lcZ(52,14,e.links$)),y.xp6(2),y.Q6J("ngIf",y.lcZ(54,16,e.datatable.paginator.noResults$))}},directives:[I.O5,Y.h,F.lW,Q.p6,T.P,q.Hw,Q.VK,B.v,Q.OP,H.e,V.p,I.sg,z.V,L.yS,F.zs,O.pW,G.O,j.gM,X.b,W.r,U.U],pipes:[I.Ov,P.K,I.OU,K,I.JJ,tt.R,et.l],styles:["h1[_ngcontent-%COMP%]{display:flex;align-items:center}.back-button[_ngcontent-%COMP%]{color:var(--be-secondary-text)}.export-csv-button[_ngcontent-%COMP%]{border-color:var(--be-accent-default);min-width:0;min-width:auto;width:42px;padding:0}.export-csv-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{margin-bottom:4px}.favicon-img[_ngcontent-%COMP%]{display:inline-block;vertical-align:middle;margin-right:5px}.long-url[_ngcontent-%COMP%]{display:block;font-weight:500;font-size:1.5rem;color:inherit;max-width:90%;overflow:hidden;text-overflow:ellipsis}.short-url[_ngcontent-%COMP%]{display:block;color:var(--be-secondary-text);font-size:1.3rem;white-space:nowrap}.short-url[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:inherit}"],changeDetection:0}),t})()},13571:function(t,e,n){"use strict";n.d(e,{z:function(){return h}});var i=n(78512),o=n(35366),s=n(31041),a=n(25051),r=n(88195),l=n(38116),c=n(61116);function d(t,e){if(1&t&&(o.TgZ(0,"option",5),o._uU(1),o.qZA()),2&t){const t=o.oxw().$implicit;o.Q6J("ngValue",t.id),o.xp6(1),o.hij(" ",t.host," ")}}function u(t,e){if(1&t&&(o.ynx(0),o.YNc(1,d,2,2,"option",7),o.BQk()),2&t){const t=e.$implicit,n=o.oxw().ngIf;o.xp6(1),o.Q6J("ngIf",n!==t.host)}}function p(t,e){if(1&t&&(o.ynx(0),o.TgZ(1,"option",5),o._uU(2),o.qZA(),o.YNc(3,u,2,1,"ng-container",6),o.BQk()),2&t){const t=e.ngIf,n=o.oxw();o.xp6(1),o.Q6J("ngValue",0),o.xp6(1),o.Oqu(t),o.xp6(1),o.Q6J("ngForOf",n.domains)}}let h=(()=>{class t{constructor(t,e,n){this.groupDirective=t,this.valueLists=e,this.settings=n,this.domains=[],this.hideLabel=!1,this.defaultHost$=new i.X(null)}ngOnChanges(){this.domains.length&&this.setDefaultHost()}ngOnInit(){this.formControl=this.groupDirective.form.controls[this.controlName]}setDefaultHost(){const t=this.settings.get("custom_domains.default_host");if(t)this.defaultHost$.next(this.domains.find(e=>e.host===t).host);else{const t=this.settings.getBaseUrl().replace(/\/$/,"").replace(/(^\w+:|^)\/\//,"");this.defaultHost$.next(t)}}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(s.sg),o.Y36(a.l),o.Y36(r.Z))},t.\u0275cmp=o.Xpm({type:t,selectors:[["domain-form-control"]],inputs:{controlName:"controlName",domains:"domains",hideLabel:"hideLabel"},features:[o.TTD],decls:8,vars:7,consts:[[1,"input-container"],["for","crupdate_group_domain_id","trans",""],["id","crupdate_group_domain_id",3,"formControl"],["trans","",3,"ngValue"],[4,"ngIf"],[3,"ngValue"],[4,"ngFor","ngForOf"],[3,"ngValue",4,"ngIf"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"label",1),o._uU(2,"Domain"),o.qZA(),o.TgZ(3,"select",2),o.TgZ(4,"option",3),o._uU(5,"All my domains (including default)"),o.qZA(),o.YNc(6,p,4,3,"ng-container",4),o.ALo(7,"async"),o.qZA(),o.qZA()),2&t&&(o.xp6(1),o.ekj("hidden",e.hideLabel),o.xp6(2),o.Q6J("formControl",e.formControl),o.xp6(1),o.Q6J("ngValue",null),o.xp6(2),o.Q6J("ngIf",o.lcZ(7,5,e.defaultHost$)))},directives:[l.P,s.EJ,s.JJ,s.oH,s.YN,s.Kr,c.O5,c.sg],pipes:[c.Ov],styles:[""],changeDetection:0}),t})()},53129:function(t,e,n){"use strict";n.d(e,{O:function(){return j}});var i=n(74899),o=n(78512),s=n(92935),a=n(73709),r=n(35366),l=n(31041),c=n(38116),d=n(77307),u=n(84369);let p=(()=>{class t{constructor(t,e,n){this.dialogRef=t,this.data=e,this.fb=n,this.form=this.fb.group({utm_source:this.fb.control(null),utm_medium:this.fb.control(null),utm_campaign:this.fb.control(null),utm_term:this.fb.control(null),utm_content:this.fb.control(null)})}ngOnInit(){this.hydrateForm()}save(){this.dialogRef.close(this.formToUrlParams().toString())}close(){this.dialogRef.close()}hydrateForm(){if(this.data.utmQuery){const t=new URLSearchParams(this.data.utmQuery),e={};t.forEach((t,n)=>{e[n]=t}),this.form.patchValue(e)}}formToUrlParams(){return new URLSearchParams((0,a.N)(this.form.value))}}return t.\u0275fac=function(e){return new(e||t)(r.Y36(s.so),r.Y36(s.WI),r.Y36(l.qu))},t.\u0275cmp=r.Xpm({type:t,selectors:[["utm-builder-dialog"]],decls:36,vars:1,consts:[[1,"modal-header"],["mat-dialog-title","","trans",""],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit"],[1,"inline-inputs-container","many-inputs"],[1,"input-container"],["for","utm-source","trans",""],["type","text","id","utm-source","placeholder","e.g: adwords, google, facebook","trans-placeholder","","formControlName","utm_source"],["for","utm-medium","trans",""],["type","text","id","utm-medium","placeholder","e.g: banner, email, social post","trans-placeholder","","formControlName","utm_medium"],["for","utm-campaign","trans",""],["type","text","id","utm-campaign","placeholder","e.g: holiday special, birthday promo","trans-placeholder","","formControlName","utm_campaign"],["for","utm-term","trans",""],["type","text","id","utm-term","placeholder","Use to identify ppc keywords","trans-placeholder","","formControlName","utm_term"],["for","utm-content","trans",""],["type","text","id","utm-content","placeholder","Use to differentiate ads or words on a page","trans-placeholder","","formControlName","utm_content"],[1,"widget","widget-info"],["trans",""],["type","submit","mat-raised-button","","color","accent","trans",""]],template:function(t,e){1&t&&(r.TgZ(0,"div",0),r.TgZ(1,"h2",1),r._uU(2,"UTM Builder"),r.qZA(),r.TgZ(3,"button",2),r.NdJ("click",function(){return e.close()}),r._UZ(4,"mat-icon",3),r.qZA(),r.qZA(),r.TgZ(5,"form",4),r.NdJ("ngSubmit",function(){return e.save()}),r.TgZ(6,"mat-dialog-content"),r.TgZ(7,"div",5),r.TgZ(8,"div",6),r.TgZ(9,"label",7),r._uU(10,"Source"),r.qZA(),r._UZ(11,"input",8),r.qZA(),r.TgZ(12,"div",6),r.TgZ(13,"label",9),r._uU(14,"Medium"),r.qZA(),r._UZ(15,"input",10),r.qZA(),r.qZA(),r.TgZ(16,"div",5),r.TgZ(17,"div",6),r.TgZ(18,"label",11),r._uU(19,"Campaign"),r.qZA(),r._UZ(20,"input",12),r.qZA(),r.TgZ(21,"div",6),r.TgZ(22,"label",13),r._uU(23,"Term"),r.qZA(),r._UZ(24,"input",14),r.qZA(),r.qZA(),r.TgZ(25,"div",5),r.TgZ(26,"div",6),r.TgZ(27,"label",15),r._uU(28,"Content"),r.qZA(),r._UZ(29,"input",16),r.qZA(),r.qZA(),r.TgZ(30,"div",17),r.TgZ(31,"div",18),r._uU(32," UTM codes specified here will be applied to the link automatically when redirecting from short url to destination url. "),r.qZA(),r.qZA(),r.qZA(),r.TgZ(33,"mat-dialog-actions"),r.TgZ(34,"button",19),r._uU(35,"Save"),r.qZA(),r.qZA(),r.qZA()),2&t&&(r.xp6(5),r.Q6J("formGroup",e.form))},directives:[s.uh,c.P,d.Hw,l.JL,l.sg,s.xY,l.Fj,l.JJ,l.u,s.H8,u.lW],styles:["[_nghost-%COMP%]{display:block;width:500px;max-width:100%}.widget[_ngcontent-%COMP%]{background-color:#f3fbf7;max-width:100%;padding:14px;margin:10px 0;border-radius:3px;overflow-wrap:break-word;border-left:5px solid #5ac891}"],changeDetection:0}),t})();var h=n(32198),g=n(88195),m=n(24859),f=n(61116),b=n(77830),v=n(56361),_=n(98081),x=n(13571),Z=n(13070),y=n(13841),w=n(87064),k=n(6006),A=n(77910);function C(t,e){if(1&t&&(r.TgZ(0,"p",35),r._uU(1),r.qZA()),2&t){const t=r.oxw(2).ngIf;r.xp6(1),r.Oqu(t.alias)}}function T(t,e){if(1&t&&(r.TgZ(0,"div",32),r.TgZ(1,"label",33),r._uU(2,"Custom Link ID"),r.qZA(),r._UZ(3,"input",34),r.YNc(4,C,2,1,"p",12),r.qZA()),2&t){const t=r.oxw().ngIf,e=r.oxw();r.xp6(3),r.Q6J("minlength",e.alias.min)("maxlength",e.alias.max)("placeholder",e.linkForm.linkHash.value),r.xp6(1),r.Q6J("ngIf",t.alias)}}function q(t,e){if(1&t&&(r.TgZ(0,"p",35),r._uU(1),r.qZA()),2&t){const t=r.oxw().ngIf;r.xp6(1),r.Oqu(t.password)}}function I(t,e){if(1&t&&(r.TgZ(0,"div",16),r.TgZ(1,"header"),r.TgZ(2,"div",17),r.TgZ(3,"h3",18),r._uU(4,"Domain"),r.qZA(),r.TgZ(5,"p",18),r._uU(6,"Select on which domain should this short link be accessible."),r.qZA(),r.qZA(),r.qZA(),r._UZ(7,"domain-form-control",36),r.qZA()),2&t){const t=r.oxw(2);r.xp6(7),r.Q6J("domains",t.linkOptions.domains)("hideLabel",!0)}}function O(t,e){if(1&t&&(r.TgZ(0,"p",35),r._uU(1),r.qZA()),2&t){const t=r.oxw().ngIf;r.xp6(1),r.Oqu(t.activates_at)}}function U(t,e){if(1&t&&(r.TgZ(0,"p",35),r._uU(1),r.qZA()),2&t){const t=r.oxw().ngIf;r.xp6(1),r.Oqu(t.expires_at)}}function P(t,e){if(1&t&&(r.TgZ(0,"mat-option",40),r._uU(1),r.qZA()),2&t){const t=e.$implicit,n=r.oxw(3);r.Q6J("value",t.id),r.xp6(1),r.Oqu(n.capitalize(t.name))}}function M(t,e){if(1&t&&(r.TgZ(0,"div",16),r.TgZ(1,"header"),r.TgZ(2,"div",17),r.TgZ(3,"h3",18),r._uU(4,"Link Groups"),r.qZA(),r.TgZ(5,"p",18),r._uU(6,"Groups this link should be attached to."),r.qZA(),r.qZA(),r.qZA(),r.TgZ(7,"mat-form-field",37),r.TgZ(8,"mat-label",18),r._uU(9,"Select Groups"),r.qZA(),r.TgZ(10,"mat-select",38),r.YNc(11,P,2,2,"mat-option",39),r.qZA(),r.qZA(),r.qZA()),2&t){const t=r.oxw(2);r.xp6(11),r.Q6J("ngForOf",t.linkOptions.groups)}}function S(t,e){if(1&t&&(r.TgZ(0,"p",35),r._uU(1),r.qZA()),2&t){const t=r.oxw(2).ngIf;r.xp6(1),r.Oqu(t.name)}}function N(t,e){1&t&&(r.TgZ(0,"div",5),r.TgZ(1,"label",48),r._uU(2,"Tags"),r.qZA(),r._UZ(3,"chip-input",49),r.qZA())}function J(t,e){if(1&t&&(r.TgZ(0,"p",35),r._uU(1),r.qZA()),2&t){const t=r.oxw(2).ngIf;r.xp6(1),r.Oqu(t.description)}}function E(t,e){if(1&t&&(r.TgZ(0,"div",41),r.TgZ(1,"header"),r.TgZ(2,"div",17),r.TgZ(3,"h3",18),r._uU(4,"Details"),r.qZA(),r.TgZ(5,"p",18),r._uU(6,"Add title, description and upload an image to personalize the link."),r.qZA(),r.qZA(),r.qZA(),r.TgZ(7,"div",3),r._UZ(8,"upload-image-control",42),r.TgZ(9,"div",5),r.TgZ(10,"label",43),r._uU(11,"Title"),r.qZA(),r._UZ(12,"input",44),r.YNc(13,S,2,1,"p",12),r.qZA(),r.qZA(),r.YNc(14,N,4,0,"div",45),r.TgZ(15,"div",5),r.TgZ(16,"label",46),r._uU(17,"Description"),r.qZA(),r._UZ(18,"textarea",47),r.YNc(19,J,2,1,"p",12),r.qZA(),r.qZA()),2&t){const t=r.oxw().ngIf,e=r.oxw();r.xp6(8),r.Q6J("compact",!0),r.xp6(5),r.Q6J("ngIf",t.name),r.xp6(1),r.Q6J("ngIf",!(null!=e.featuresToHide&&e.featuresToHide.tags)),r.xp6(5),r.Q6J("ngIf",t.description)}}function L(t,e){if(1&t&&(r.TgZ(0,"mat-option",40),r._uU(1),r.qZA()),2&t){const t=e.$implicit,n=r.oxw(3);r.Q6J("value",t.id),r.xp6(1),r.Oqu(n.capitalize(t.name))}}function D(t,e){if(1&t&&(r.TgZ(0,"div",16),r.TgZ(1,"header"),r.TgZ(2,"div",17),r.TgZ(3,"h3",18),r._uU(4,"Tracking Pixel"),r.qZA(),r.TgZ(5,"p",18),r._uU(6,"Select tracking pixels that should be used for this link."),r.qZA(),r.qZA(),r.qZA(),r.TgZ(7,"mat-form-field",37),r.TgZ(8,"mat-label",18),r._uU(9,"Select Pixels"),r.qZA(),r.TgZ(10,"mat-select",50),r.YNc(11,L,2,2,"mat-option",39),r.qZA(),r.qZA(),r.qZA()),2&t){const t=r.oxw(2);r.xp6(11),r.Q6J("ngForOf",t.linkOptions.pixels)}}function $(t,e){if(1&t){const t=r.EpF();r.TgZ(0,"button",55),r.NdJ("click",function(){return r.CHM(t),r.oxw(3).linkForm.addNewGeoRule()}),r._UZ(1,"mat-icon",56),r.qZA()}}function R(t,e){if(1&t&&(r.TgZ(0,"option",40),r._uU(1),r.qZA()),2&t){const t=e.$implicit;r.Q6J("value",t.code),r.xp6(1),r.hij(" ",t.name," ")}}function Y(t,e){if(1&t){const t=r.EpF();r.TgZ(0,"li",57),r.TgZ(1,"div",58),r.TgZ(2,"label",59),r._uU(3,"Country"),r.qZA(),r.TgZ(4,"select",60),r.YNc(5,R,2,2,"option",39),r.qZA(),r.qZA(),r.TgZ(6,"div",61),r.TgZ(7,"label",59),r._uU(8,"Url"),r.qZA(),r._UZ(9,"input",62),r.qZA(),r.TgZ(10,"button",63),r.NdJ("click",function(){const e=r.CHM(t).index;return r.oxw(3).linkForm.geoRules.removeAt(e)}),r._UZ(11,"mat-icon",64),r.qZA(),r.qZA()}if(2&t){const t=e.$implicit,n=e.index,i=r.oxw(3);r.xp6(1),r.Q6J("formGroup",t),r.xp6(1),r.Q6J("for","link_dialog_country-"+n),r.xp6(2),r.Q6J("id","link_dialog_country-"+n),r.xp6(1),r.Q6J("ngForOf",i.linkOptions.countries),r.xp6(1),r.Q6J("formGroup",t),r.xp6(1),r.Q6J("for","link_dialog_geo_url-"+n),r.xp6(2),r.Q6J("id","link_dialog_geo_url-"+n),r.xp6(1),r.Q6J("disabled",t.disabled)}}function F(t,e){if(1&t){const t=r.EpF();r.TgZ(0,"button",55),r.NdJ("click",function(){return r.CHM(t),r.oxw(3).linkForm.addNewDeviceRule()}),r._UZ(1,"mat-icon",56),r.qZA()}}function Q(t,e){if(1&t){const t=r.EpF();r.TgZ(0,"li",57),r.TgZ(1,"div",65),r.TgZ(2,"label",59),r._uU(3,"Device"),r.qZA(),r.TgZ(4,"select",60),r.TgZ(5,"option",66),r._uU(6,"Desktop"),r.qZA(),r.TgZ(7,"option",67),r._uU(8,"Tablet"),r.qZA(),r.TgZ(9,"option",68),r._uU(10,"Mobile"),r.qZA(),r.qZA(),r.qZA(),r.TgZ(11,"div",61),r.TgZ(12,"label",59),r._uU(13,"Url"),r.qZA(),r._UZ(14,"input",62),r.qZA(),r.TgZ(15,"button",69),r.NdJ("click",function(){const e=r.CHM(t).index;return r.oxw(3).linkForm.deviceRules.removeAt(e)}),r._UZ(16,"mat-icon",64),r.qZA(),r.qZA()}if(2&t){const t=e.$implicit,n=e.index;r.xp6(1),r.Q6J("formGroup",t),r.xp6(1),r.Q6J("for","link_dialog_device-"+n),r.xp6(2),r.Q6J("id","link_dialog_device-"+n),r.xp6(7),r.Q6J("formGroup",t),r.xp6(1),r.Q6J("for","link_dialog_device_url-"+n),r.xp6(2),r.Q6J("id","link_dialog_device_url-"+n),r.xp6(1),r.Q6J("disabled",t.disabled)}}function B(t,e){if(1&t){const t=r.EpF();r.TgZ(0,"button",55),r.NdJ("click",function(){return r.CHM(t),r.oxw(3).linkForm.addNewPlatformRule()}),r._UZ(1,"mat-icon",56),r.qZA()}}function H(t,e){if(1&t){const t=r.EpF();r.TgZ(0,"li",57),r.TgZ(1,"div",65),r.TgZ(2,"label",59),r._uU(3,"Platform"),r.qZA(),r.TgZ(4,"select",60),r.TgZ(5,"option",70),r._uU(6,"Windows"),r.qZA(),r.TgZ(7,"option",71),r._uU(8,"Linux"),r.qZA(),r.TgZ(9,"option",72),r._uU(10,"MacOS"),r.qZA(),r.TgZ(11,"option",73),r._uU(12,"iOS"),r.qZA(),r.TgZ(13,"option",74),r._uU(14,"Android"),r.qZA(),r.qZA(),r.qZA(),r.TgZ(15,"div",61),r.TgZ(16,"label",59),r._uU(17,"Url"),r.qZA(),r._UZ(18,"input",62),r.qZA(),r.TgZ(19,"button",69),r.NdJ("click",function(){const e=r.CHM(t).index;return r.oxw(3).linkForm.platformRules.removeAt(e)}),r._UZ(20,"mat-icon",64),r.qZA(),r.qZA()}if(2&t){const t=e.$implicit,n=e.index;r.xp6(1),r.Q6J("formGroup",t),r.xp6(1),r.Q6J("for","link_dialog_platform-"+n),r.xp6(2),r.Q6J("id","link_dialog_platform-"+n),r.xp6(11),r.Q6J("formGroup",t),r.xp6(1),r.Q6J("for","link_dialog_platform_url-"+n),r.xp6(2),r.Q6J("id","link_dialog_platform_url-"+n),r.xp6(1),r.Q6J("disabled",t.disabled)}}function V(t,e){if(1&t&&(r.ynx(0),r.TgZ(1,"div",51),r.TgZ(2,"header"),r.TgZ(3,"div",17),r.TgZ(4,"h3",18),r._uU(5,"Location Targeting"),r.qZA(),r.TgZ(6,"p",18),r._uU(7,"Redirect users to different url based on their location."),r.qZA(),r.qZA(),r.YNc(8,$,2,0,"button",52),r.qZA(),r.TgZ(9,"ul",53),r.YNc(10,Y,12,8,"li",54),r.qZA(),r.qZA(),r.TgZ(11,"div",51),r.TgZ(12,"header"),r.TgZ(13,"div",17),r.TgZ(14,"h3",18),r._uU(15,"Device Targeting"),r.qZA(),r.TgZ(16,"p",18),r._uU(17,"Redirect users to different url based on their device."),r.qZA(),r.qZA(),r.YNc(18,F,2,0,"button",52),r.qZA(),r.TgZ(19,"ul",53),r.YNc(20,Q,17,7,"li",54),r.qZA(),r.qZA(),r.TgZ(21,"div",51),r.TgZ(22,"header"),r.TgZ(23,"div",17),r.TgZ(24,"h3",18),r._uU(25,"Platform Targeting"),r.qZA(),r.TgZ(26,"p",18),r._uU(27,"Redirect users to different url based on their platform."),r.qZA(),r.qZA(),r.YNc(28,B,2,0,"button",52),r.qZA(),r.TgZ(29,"ul",53),r.YNc(30,H,21,7,"li",54),r.qZA(),r.qZA(),r.BQk()),2&t){const t=r.oxw(2);r.xp6(1),r.Q6J("controlGroup",t.linkForm.geoRules),r.xp6(7),r.Q6J("ngIf",!t.linkForm.geoRules.disabled),r.xp6(2),r.Q6J("ngForOf",t.linkForm.geoRules.controls),r.xp6(1),r.Q6J("controlGroup",t.linkForm.deviceRules),r.xp6(7),r.Q6J("ngIf",!t.linkForm.geoRules.disabled),r.xp6(2),r.Q6J("ngForOf",t.linkForm.deviceRules.controls),r.xp6(1),r.Q6J("controlGroup",t.linkForm.platformRules),r.xp6(7),r.Q6J("ngIf",!t.linkForm.geoRules.disabled),r.xp6(2),r.Q6J("ngForOf",t.linkForm.platformRules.controls)}}const z=function(t){return{resource:t}};function G(t,e){if(1&t){const t=r.EpF();r.ynx(0,1),r.TgZ(1,"div",2),r.TgZ(2,"div",3),r.YNc(3,T,5,4,"div",4),r.TgZ(4,"div",5),r.TgZ(5,"label",6),r._uU(6,"Status"),r.qZA(),r.TgZ(7,"select",7),r.TgZ(8,"option",8),r._uU(9,"Activate"),r.qZA(),r.TgZ(10,"option",8),r._uU(11,"Disabled"),r.qZA(),r.qZA(),r.qZA(),r.qZA(),r.TgZ(12,"div",3),r.TgZ(13,"div",9),r.TgZ(14,"label",10),r._uU(15,"Password"),r.qZA(),r._UZ(16,"input",11),r.YNc(17,q,2,1,"p",12),r.qZA(),r.qZA(),r.TgZ(18,"permission-aware-button",13),r.TgZ(19,"button",14),r.NdJ("click",function(){return r.CHM(t),r.oxw().openUtmBuilder()}),r._uU(20," UTM Builder "),r.qZA(),r.qZA(),r.qZA(),r.YNc(21,I,8,2,"div",15),r.TgZ(22,"div",16),r.TgZ(23,"header"),r.TgZ(24,"div",17),r.TgZ(25,"h3",18),r._uU(26,"Schedule"),r.qZA(),r.TgZ(27,"p",19),r._uU(28," Enter a date when :resource should be active. Both start and end dates are optional. "),r.qZA(),r.qZA(),r.qZA(),r.TgZ(29,"div",3),r.TgZ(30,"div",20),r.TgZ(31,"datetime-input",21),r._uU(32,"Start Date"),r.qZA(),r.YNc(33,O,2,1,"p",12),r.qZA(),r.TgZ(34,"div",20),r.TgZ(35,"datetime-input",22),r._uU(36,"End Date"),r.qZA(),r.YNc(37,U,2,1,"p",12),r.qZA(),r.qZA(),r.qZA(),r.YNc(38,M,12,1,"div",15),r.YNc(39,E,20,4,"div",23),r.YNc(40,D,12,1,"div",15),r.TgZ(41,"div",24),r.TgZ(42,"header"),r.TgZ(43,"div",17),r.TgZ(44,"h3",18),r._uU(45,"Expiration Clicks"),r.qZA(),r.TgZ(46,"p"),r.TgZ(47,"span",19),r._uU(48,"After :resource is visited specified amount of times, it will no longer be accessible."),r.qZA(),r._UZ(49,"br"),r.TgZ(50,"span",19),r._uU(51,"Optionally, after click amount is reached :resource can redirect to specified url instead."),r.qZA(),r.qZA(),r.qZA(),r.qZA(),r.TgZ(52,"div",25),r.TgZ(53,"div",26),r.TgZ(54,"label",27),r._uU(55,"Max Clicks"),r.qZA(),r._UZ(56,"input",28),r.qZA(),r.TgZ(57,"div",5),r.TgZ(58,"label",29),r._uU(59,"Redirect Url"),r.qZA(),r._UZ(60,"input",30),r.qZA(),r.qZA(),r.qZA(),r.YNc(61,V,31,9,"ng-container",31),r.BQk()}if(2&t){const t=e.ngIf,n=r.oxw();r.Q6J("formGroup",n.linkForm.formGroup),r.xp6(3),r.Q6J("ngIf",!(n.batch||null!=n.featuresToHide&&n.featuresToHide.alias)),r.xp6(5),r.Q6J("ngValue",!0),r.xp6(2),r.Q6J("ngValue",!1),r.xp6(7),r.Q6J("ngIf",t.password),r.xp6(4),r.Q6J("ngIf",(null==n.linkOptions||null==n.linkOptions.domains?null:n.linkOptions.domains.length)&&!(null!=n.featuresToHide&&n.featuresToHide.domain)&&n.settings.get("custom_domains.allow_select")),r.xp6(6),r.Q6J("transValues",r.VKq(16,z,n.resourceName)),r.xp6(6),r.Q6J("ngIf",t.activates_at),r.xp6(4),r.Q6J("ngIf",t.expires_at),r.xp6(1),r.Q6J("ngIf",!(null!=n.featuresToHide&&n.featuresToHide.linkGroups)&&(null==n.linkOptions||null==n.linkOptions.groups?null:n.linkOptions.groups.length)),r.xp6(1),r.Q6J("ngIf",!(null!=n.featuresToHide&&n.featuresToHide.details)),r.xp6(1),r.Q6J("ngIf",(null==n.linkOptions||null==n.linkOptions.pixels?null:n.linkOptions.pixels.length)&&n.settings.get("links.pixels")),r.xp6(1),r.Q6J("controlGroup",n.linkForm.expClicksRule),r.xp6(6),r.Q6J("transValues",r.VKq(18,z,n.resourceName)),r.xp6(3),r.Q6J("transValues",r.VKq(20,z,n.resourceName)),r.xp6(11),r.Q6J("ngIf",n.linkOptions&&n.settings.get("links.retargeting"))}}let j=(()=>{class t{constructor(t,e,n){this.linkForm=t,this.settings=e,this.modal=n,this.batch=!1,this.featuresToHide={},this.resourceName="link",this.defaultHost$=new o.X(null),this.alias={min:this.settings.get("links.alias_min"),max:this.settings.get("links.alias_max")}}ngOnChanges(t){if(t.linkOptions.currentValue){const t=this.settings.get("custom_domains.default_host");if(t)this.defaultHost$.next(this.linkOptions.domains.find(e=>e.host===t).host);else{const t=this.settings.getBaseUrl().replace(/\/$/,"").replace(/(^\w+:|^)\/\//,"");this.defaultHost$.next(t)}}}capitalize(t){return(0,i.z)(t)}openUtmBuilder(){this.modal.open(p,{utmQuery:this.linkForm.formGroup.get("utm").value}).afterClosed().subscribe(t=>{t&&this.linkForm.formGroup.patchValue({utm:t})})}}return t.\u0275fac=function(e){return new(e||t)(r.Y36(h.l),r.Y36(g.Z),r.Y36(m.u))},t.\u0275cmp=r.Xpm({type:t,selectors:[["link-options-form"]],inputs:{linkOptions:"linkOptions",batch:"batch",featuresToHide:"featuresToHide",resourceName:"resourceName"},features:[r.TTD],decls:2,vars:3,consts:[[3,"formGroup",4,"ngIf"],[3,"formGroup"],[1,"group","first-group"],[1,"inline-inputs-container"],["class","input-container","permission-aware-input-container","alias",4,"ngIf"],[1,"input-container"],["for","link_dialog_active","trans",""],["id","link_dialog_active","formControlName","active"],["trans","",3,"ngValue"],["permission-aware-input-container","password",1,"input-container"],["for","link-dialog-password","trans",""],["type","password","id","link-dialog-password","formControlName","password","autocomplete","new-password"],["class","error",4,"ngIf"],["permission","links.create","restriction","utm"],["type","button","mat-stroked-button","","color","accent","trans","",3,"click"],["class","group",4,"ngIf"],[1,"group"],[1,"header-text"],["trans",""],["trans","",3,"transValues"],["permission-aware-input-container","expiration",1,"input-container"],["id","link_dialog_activates_at","formControlName","activates_at","trans",""],["id","link_dialog_expires_at","formControlName","expires_at","trans",""],["class","group many-inputs",4,"ngIf"],["permission-aware-input-container","expiration",1,"group","retargeting-group",3,"controlGroup"],["formGroupName","exp_clicks_rule",1,"inline-inputs-container","rule-inline-inputs"],[1,"input-container","country-input-container"],["for","link_dialog_exp_clicks","trans",""],["type","number","min","1","id","link_dialog_exp_clicks","formControlName","key"],["for","link_dialog_exp_link","trans",""],["type","url","id","link_dialog_exp_link","formControlName","value","placeholder","(Optional)","trans-placeholder",""],[4,"ngIf"],["permission-aware-input-container","alias",1,"input-container"],["for","link-dialog-alias","trans",""],["type","text","id","link-dialog-alias","formControlName","alias","pattern","[A-Za-z0-9_-]+",3,"minlength","maxlength","placeholder"],[1,"error"],["controlName","domain_id",3,"domains","hideLabel"],["appearance","outline"],["formControlName","groups","multiple",""],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[1,"group","many-inputs"],["formControlName","image",3,"compact"],["for","link_dialog_title","trans",""],["type","text","id","link_dialog_title","formControlName","name","maxlength","140"],["class","input-container",4,"ngIf"],["for","link_dialog_description","trans",""],["id","link_dialog_description","formControlName","description","maxlength","240"],["for","link_dialog_tags","trans",""],["id","link_dialog_tags","formControlName","tags","placeholder","+New tag","trans-placeholder",""],["formControlName","pixels","multiple",""],["permission-aware-input-container","retargeting",1,"group","retargeting-group",3,"controlGroup"],["mat-icon-button","","color","accent","type","button",3,"click",4,"ngIf"],[1,"unstyled-list"],["class","inline-inputs-container rule-inline-inputs",4,"ngFor","ngForOf"],["mat-icon-button","","color","accent","type","button",3,"click"],["svgIcon","add"],[1,"inline-inputs-container","rule-inline-inputs"],[1,"input-container","country-input-container",3,"formGroup"],["trans","",3,"for"],["formControlName","key",3,"id"],[1,"input-container",3,"formGroup"],["type","url","formControlName","value",3,"id"],["mat-icon-button","","color","warn","type","button",1,"remove-rule-btn",3,"disabled","click"],["svgIcon","close"],[1,"input-container","device-input-container",3,"formGroup"],["value","desktop","trans",""],["value","tablet","trans",""],["value","mobile","trans",""],["mat-icon-button","","type","button","color","warn",1,"remove-rule-btn",3,"disabled","click"],["value","windows","trans",""],["value","linux","trans",""],["value","osx","trans",""],["value","ios","trans",""],["value","androidos","trans",""]],template:function(t,e){1&t&&(r.YNc(0,G,62,22,"ng-container",0),r.ALo(1,"async")),2&t&&r.Q6J("ngIf",r.lcZ(1,1,e.linkForm.errors$))},directives:[f.O5,l.JL,l.sg,c.P,l.EJ,l.JJ,l.u,l.YN,l.Kr,b.o,l.Fj,v.v,u.lW,_.k,l.x0,l.qQ,l.wV,l.c5,l.wO,l.nD,x.z,Z.KE,Z.hX,y.gD,f.sg,w.ey,k.V,A.S,d.Hw],pipes:[f.Ov],styles:["[_nghost-%COMP%]{display:block;overflow:hidden}label[_ngcontent-%COMP%]{text-transform:capitalize}.group[_ngcontent-%COMP%]{border-bottom:1px solid var(--be-divider-default);margin-bottom:20px;padding-bottom:20px}.retargeting-group[_ngcontent-%COMP%] .lock-icon{right:8px;top:5px}.first-group[_ngcontent-%COMP%]{margin-top:15px;padding-top:15px;border-top:1px solid var(--be-divider-default)}header[_ngcontent-%COMP%]{display:flex;align-items:center}header[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-left:auto;align-self:flex-start}h3[_ngcontent-%COMP%]{margin:0}p[_ngcontent-%COMP%]{margin-top:3px;color:var(--be-secondary-text);max-width:650px}.inline-inputs-container[_ngcontent-%COMP%]{margin-bottom:20px;align-items:flex-end}.remove-rule-btn[_ngcontent-%COMP%]{margin-top:29px;margin-left:5px;flex-shrink:0}.input-wrapper[_ngcontent-%COMP%]{position:relative}.host-input[_ngcontent-%COMP%]{font-size:1.6rem}.base-url-prefix[_ngcontent-%COMP%]{position:absolute;top:0;left:0;line-height:46px;text-align:right}.mat-form-field[_ngcontent-%COMP%]{width:100%}upload-image-control[_ngcontent-%COMP%]{width:66px;height:66px;margin-right:15px}@media screen and (max-width:768px){.inline-inputs-container[_ngcontent-%COMP%]{display:block;position:relative}.country-input-container[_ngcontent-%COMP%], .device-input-container[_ngcontent-%COMP%]{margin-bottom:15px}.remove-rule-btn[_ngcontent-%COMP%]{position:absolute;top:-15px;right:-5px;margin:0}.rule-inline-inputs[_ngcontent-%COMP%]:not(:last-of-type){margin-bottom:25px;padding-bottom:25px;border-bottom:1px solid var(--be-divider-lighter)}}"],changeDetection:0}),t})()},92890:function(t,e,n){"use strict";n.d(e,{F:function(){return u}});var i=n(47727),o=n(73982),s=n(34056),a=n(40878),r=n(35366),l=n(63337),c=n(68515),d=n(84222);let u=(()=>{class t{constructor(t,e,n){this.router=t,this.http=e,this.link=n}resolve(t,e){return this.link.get(t.params.linkId).pipe((0,i.K)(()=>(this.router.navigate(["/dashboard/links"]),s.E)),(0,o.zg)(t=>t?(0,a.of)(t):(this.router.navigate(["/dashboard/links"]),s.E)))}}return t.\u0275fac=function(e){return new(e||t)(r.LFG(l.F0),r.LFG(c.r),r.LFG(d.M))},t.\u0275prov=r.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},4886:function(t,e,n){"use strict";n.d(e,{G:function(){return g}});var i=n(84222),o=n(78512),s=n(35366),a=n(63337),r=n(88195),l=n(61116),c=n(19708),d=n(78671),u=n(93836),p=n(40985);function h(t,e){if(1&t&&(s.ynx(0),s.TgZ(1,"header"),s._UZ(2,"img",1),s.ALo(3,"favicon"),s.TgZ(4,"a",2),s._uU(5),s.qZA(),s._UZ(6,"copy-link-btn",3),s._UZ(7,"share-link-btns",4),s.qZA(),s._UZ(8,"click-charts",5),s.BQk()),2&t){const t=e.ngIf,n=s.oxw();s.xp6(2),s.Q6J("src",s.lcZ(3,8,t.link.long_url),s.LSH),s.xp6(2),s.Q6J("href",t.link.long_url,s.LSH),s.xp6(1),s.Oqu(t.link.long_url),s.xp6(1),s.Q6J("model",t.link),s.xp6(1),s.Q6J("colored",!0)("link",t.link),s.xp6(1),s.Q6J("reports",t.analytics)("endpoint",n.analyticsEndpoint)}}let g=(()=>{class t{constructor(t,e){this.route=t,this.settings=e,this.data$=new o.X(null)}ngOnInit(){this.route.data.subscribe(t=>{this.data$.next(t.api),this.analyticsEndpoint=`${i.M.BASE_URI}/${t.api.link.id}`})}}return t.\u0275fac=function(e){return new(e||t)(s.Y36(a.gz),s.Y36(r.Z))},t.\u0275cmp=s.Xpm({type:t,selectors:[["link-show"]],decls:2,vars:3,consts:[[4,"ngIf"],["alt","link favicon",3,"src"],["target","_blank",1,"long-url",3,"href"],[3,"model"],[3,"colored","link"],[3,"reports","endpoint"]],template:function(t,e){1&t&&(s.YNc(0,h,9,10,"ng-container",0),s.ALo(1,"async")),2&t&&s.Q6J("ngIf",s.lcZ(1,1,e.data$))},directives:[l.O5,c.b,d.t,u.z],pipes:[l.Ov,p.K],styles:["header[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:15px;font-size:1.8rem;flex-wrap:wrap}header[_ngcontent-%COMP%] .long-url[_ngcontent-%COMP%]{max-width:60%;overflow:hidden;text-overflow:ellipsis}@media only screen and (max-width:768px){header[_ngcontent-%COMP%] .long-url[_ngcontent-%COMP%]{width:calc(100% - 32px)}header[_ngcontent-%COMP%] .long-url[_ngcontent-%COMP%], header[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{margin-bottom:15px}}@media only screen and (min-width:768px){header[_ngcontent-%COMP%] share-link-btns[_ngcontent-%COMP%]{margin-left:auto}header[_ngcontent-%COMP%] .edit-btn[_ngcontent-%COMP%]{margin-left:10px}}header[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{margin-right:10px;width:22px;height:22px;flex-shrink:0}header[_ngcontent-%COMP%] .edit-btn[_ngcontent-%COMP%], header[_ngcontent-%COMP%] copy-link-btn[_ngcontent-%COMP%]{color:var(--be-secondary-text)}"],changeDetection:0}),t})()},77830:function(t,e,n){"use strict";n.d(e,{o:function(){return b}});var i=n(35366),o=n(31041),s=n(40149),a=n(35096),r=n(78512),l=n(98979),c=n(88195),d=n(28505),u=n(36501),p=n(77307),h=n(61116);const g=["lockIcon"],m=["permission-aware-input-container",""],f=["*"];let b=(()=>{class t{constructor(t,e,n,i,o,s){this.cd=t,this.overlay=e,this.viewContainerRef=n,this.settings=i,this.currentUser=o,this.usage=s,this.lockIconHidden$=new r.X(!0)}ngAfterViewInit(){setTimeout(()=>{this.usageSub=this.usage.response$.subscribe(t=>{t.usage.links[this.permission]||this.currentUser.isAdmin()||(this.lockIconHidden$.next(!1),this.controlGroup?this.controlGroup.disable():this.controlName&&this.controlName.control.disable(),this.lockIcon&&this.createHoverListener())})})}ngOnDestroy(){var t;null===(t=this.usageSub)||void 0===t||t.unsubscribe()}createHoverListener(){this.listeningToHover||(this.lockIcon.nativeElement.addEventListener("mouseenter",()=>{this.cd.markForCheck(),this.showMessage()}),this.lockIcon.nativeElement.addEventListener("mouseleave",t=>{var e;const n=t.relatedTarget;"upgrade-overlay"!==(null===(e=null==n?void 0:n.nodeName)||void 0===e?void 0:e.toLowerCase())&&this.hideMessage()}),this.listeningToHover=!0)}showMessage(){this.overlayRef&&this.hideMessage(),this.overlayRef=this.overlay.open(a.O,{origin:this.lockIcon,position:s.x,hasBackdrop:!1,scrollStrategy:"close",viewContainerRef:this.viewContainerRef,data:{config:{resource:"links",createMsgType:this.permission}}}),this.overlayRef.getPanelEl().addEventListener("mouseleave",()=>{this.hideMessage()})}hideMessage(){this.overlayRef&&(this.overlayRef.close(),this.overlayRef=null)}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(i.sBO),i.Y36(l.T),i.Y36(i.s_b),i.Y36(c.Z),i.Y36(d.I),i.Y36(u.F))},t.\u0275cmp=i.Xpm({type:t,selectors:[["","permission-aware-input-container",""]],contentQueries:function(t,e,n){if(1&t&&i.Suo(n,o.u,5),2&t){let t;i.iGM(t=i.CRH())&&(e.controlName=t.first)}},viewQuery:function(t,e){if(1&t&&i.Gf(g,5,i.SBq),2&t){let t;i.iGM(t=i.CRH())&&(e.lockIcon=t.first)}},inputs:{permission:["permission-aware-input-container","permission"],controlGroup:"controlGroup"},attrs:m,ngContentSelectors:f,decls:4,vars:4,consts:[["svgIcon","lock",1,"lock-icon"],["lockIcon",""]],template:function(t,e){1&t&&(i.F$t(),i.Hsn(0),i.TgZ(1,"mat-icon",0,1),i.ALo(3,"async"),i.qZA()),2&t&&(i.xp6(1),i.ekj("hidden",i.lcZ(3,2,e.lockIconHidden$)))},directives:[p.Hw],pipes:[h.Ov],styles:["[_nghost-%COMP%]{display:block;position:relative;margin-top:8px}.lock-icon[_ngcontent-%COMP%]{position:absolute;right:0;top:-6px;color:var(--be-secondary-text)}"],changeDetection:0}),t})()},56361:function(t,e,n){"use strict";n.d(e,{v:function(){return v}});var i=n(84369),o=n(35096),s=n(40149),a=n(7855),r=n(35366),l=n(77307),c=n(38116);let d=(()=>{class t{constructor(t){this.data=t}ngOnInit(){this.message=function(t,e=!1,n,i){return"overQuota"===i?`You have created the maximum allowed number of ${t}.`:function(t,e,n){return t=t.replace("_"," "),e?`You are not allowed to ${n} ${t} in this workspace.`:`You are not allowed to ${n} ${t}.`}(t,e,n)}(this.data.config.resource,this.data.config.forWorkspace,this.data.config.action,this.data.config.createMsgType)}}return t.\u0275fac=function(e){return new(e||t)(r.Y36(a.p))},t.\u0275cmp=r.Xpm({type:t,selectors:[["simple-permission-overlay"]],hostAttrs:[1,"permission-overlay"],decls:4,vars:1,consts:[[1,"overlay"],["svgIcon","lock",1,"lock-icon"],["trans",""]],template:function(t,e){1&t&&(r.TgZ(0,"div",0),r._UZ(1,"mat-icon",1),r.TgZ(2,"span",2),r._uU(3),r.qZA(),r.qZA()),2&t&&(r.xp6(3),r.Oqu(e.message))},directives:[l.Hw,c.P],styles:["[_nghost-%COMP%]{display:block;padding:5px 0}.overlay[_ngcontent-%COMP%]{display:flex;align-items:flex-start;background-color:var(--be-background);box-shadow:0 3px 3px -2px rgba(0,0,0,.2),0 3px 4px 0 rgba(0,0,0,.14),0 1px 8px 0 rgba(0,0,0,.12);border-radius:4px;padding:15px;max-width:350px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lock-icon[_ngcontent-%COMP%]{width:28px;height:28px;flex-shrink:0;margin-right:10px;color:var(--be-secondary-text)}"],changeDetection:0}),t})();var u=n(97070),p=n(98979),h=n(88195),g=n(28505),m=n(36501);const f=["permission-aware-button",""],b=["*"];let v=(()=>{class t{constructor(t,e,n,i,o,s,a){this.cd=t,this.overlay=e,this.viewContainerRef=n,this.settings=i,this.currentUser=o,this.el=s,this.linkUsage=a}ngAfterViewInit(){setTimeout(()=>{this.matButton||this.matMenuItem||(this.regularButton=this.el.nativeElement.querySelector("button")),this.usageSub=this.linkUsage.response$.subscribe(t=>{this.hydrateConfig(t),this.config.hasPermission||this.userOwnsResource?(this.toggleButtonState(!1),this.overlayCmp=null):(this.toggleButtonState(!0),this.setOverlayCmp()),this.cd.markForCheck()}),this.createHoverListener()})}ngOnDestroy(){var t;null===(t=this.usageSub)||void 0===t||t.unsubscribe()}hydrateConfig(t){const[e,n]=this.permission.split(".");this.config={resource:e,action:n,hasPermission:t.usage[e][this.restriction||n]||this.currentUser.isAdmin(),forWorkspace:t.forWorkspace,createMsgType:t.usage[e].createMsgType||this.restriction,userOwnsWorkspace:t.userOwnsWorkspace}}setOverlayCmp(){this.overlayCmp=this.shouldShowUpgradeOverlay()?o.O:d}shouldShowUpgradeOverlay(){return this.settings.get("billing.enable")&&"create"===this.config.action&&!this.config.hasPermission&&"noWorkspacePermission"!==this.config.createMsgType}createHoverListener(){this.el.nativeElement.addEventListener("mouseenter",()=>{this.overlayCmp&&(this.cd.markForCheck(),this.showMessage())}),this.el.nativeElement.addEventListener("mouseleave",t=>{this.overlayRef&&!t.relatedTarget.classList.contains("permission-overlay")&&this.hideMessage()})}toggleButtonState(t){(this.matButton||this.matMenuItem||this.regularButton).disabled=t}showMessage(){this.overlayRef&&this.hideMessage(),this.overlayRef=this.overlay.open(this.overlayCmp,{origin:this.matButton._elementRef,position:s.x,hasBackdrop:!1,scrollStrategy:"close",viewContainerRef:this.viewContainerRef,data:{config:this.config}}),this.overlayRef.getPanelEl().addEventListener("mouseleave",()=>{this.hideMessage()})}hideMessage(){this.overlayRef&&(this.overlayRef.close(),this.overlayRef=null)}}return t.\u0275fac=function(e){return new(e||t)(r.Y36(r.sBO),r.Y36(p.T),r.Y36(r.s_b),r.Y36(h.Z),r.Y36(g.I),r.Y36(r.SBq),r.Y36(m.F))},t.\u0275cmp=r.Xpm({type:t,selectors:[["","permission-aware-button",""],["permission-aware-button"]],contentQueries:function(t,e,n){if(1&t&&(r.Suo(n,i.lW,5),r.Suo(n,u.OP,5)),2&t){let t;r.iGM(t=r.CRH())&&(e.matButton=t.first),r.iGM(t=r.CRH())&&(e.matMenuItem=t.first)}},inputs:{permission:"permission",restriction:"restriction",userOwnsResource:"userOwnsResource"},attrs:f,ngContentSelectors:b,decls:1,vars:0,template:function(t,e){1&t&&(r.F$t(),r.Hsn(0))},styles:[""],changeDetection:0}),t})()},35096:function(t,e,n){"use strict";n.d(e,{O:function(){return p}});var i=n(7855),o=n(35366),s=n(80147),a=n(88195),r=n(38116),l=n(84369),c=n(63337),d=n(92552);const u=function(t){return{siteName:t}};let p=(()=>{class t{constructor(t,e,n){this.overlayPanelRef=t,this.data=e,this.settings=n}ngOnInit(){var t,e;this.message=(e=this.data.config.createMsgType,t=(t=this.data.config.resource).replace("_"," "),"overQuota"===e?`You've reached the maximum number of ${t} allowed for your current plan.`:"alias"===e?"Your current plan doesn't allow setting custom link ID.":"expiration"===e?"Your current plan doesn't allow setting link expiration.":"password"===e?"Your current plan doesn't allow setting a password for links.":"utm"===e?"Your current plan doesn't include utm builder functionality.":"retargeting"===e?"Your current plan doesn't include retargeting functionality.":`Your current plan doesn't allow creating ${t}.`),this.siteName=this.settings.get("branding.site_name")}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(s.L),o.Y36(i.p),o.Y36(a.Z))},t.\u0275cmp=o.Xpm({type:t,selectors:[["upgrade-overlay"]],hostAttrs:[1,"permission-overlay"],decls:11,vars:4,consts:[[1,"overlay"],[1,"content"],["trans",""],["trans","",3,"transValues"],["mat-raised-button","","color","accent","routerLink","/billing/pricing","trans","",1,"upgrade-button"],["name","upgrade"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"div",2),o.TgZ(3,"span",2),o._uU(4),o.qZA(),o._uU(5," "),o.TgZ(6,"span",3),o._uU(7," Upgrade to get more out of :siteName. "),o.qZA(),o.qZA(),o.TgZ(8,"a",4),o._uU(9,"Upgrade Now"),o.qZA(),o.qZA(),o._UZ(10,"svg-image",5),o.qZA()),2&t&&(o.xp6(4),o.Oqu(e.message),o.xp6(2),o.Q6J("transValues",o.VKq(2,u,e.siteName)))},directives:[r.P,l.zs,c.yS,d.L],styles:["[_nghost-%COMP%]{display:block;padding:5px 0}.overlay[_ngcontent-%COMP%]{display:flex;align-items:center;background-color:var(--be-background);box-shadow:0 3px 3px -2px rgba(0,0,0,.2),0 3px 4px 0 rgba(0,0,0,.14),0 1px 8px 0 rgba(0,0,0,.12);border-radius:4px;padding:20px;max-width:350px}.content[_ngcontent-%COMP%]{flex:1 1 auto}svg-image[_ngcontent-%COMP%]{height:80px;width:auto;flex-shrink:0;margin-left:15px}.upgrade-button[_ngcontent-%COMP%]{margin-top:20px}"],changeDetection:0}),t})()},45362:function(t,e,n){"use strict";n.d(e,{V:function(){return st}});var i=n(67455),o=n(36024),s=n(56515),a=n(35366),r=n(68515);let l=(()=>{class t{constructor(t){this.http=t}index(e={}){return this.http.get(`${t.BASE_URI}`,e)}create(e){return this.http.post(t.BASE_URI,e)}update(e,n){return this.http.put(`${t.BASE_URI}/${e}`,n)}delete(e){return this.http.delete(`${t.BASE_URI}/${e}`)}}return t.BASE_URI="pixel",t.\u0275fac=function(e){return new(e||t)(a.LFG(r.r))},t.\u0275prov=a.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var c=n(92935),d=n(11520),u=n(78512);const p=[{name:"facebook",type:"number"},{name:"twitter",type:"number"},{name:"google-tag-manager",type:"text",pattern:"GTM-[a-zA-Z0-9]+"},{name:"google-analytics",type:"text"},{name:"adwords",type:"number"},{name:"bing",type:"number"},{name:"pinterest",type:"number"},{name:"linkedin",type:"text"},{name:"quora",type:"text",pattern:"[a-z0-9]+"},{name:"adroll",type:"text"},{name:"nexus-segment",type:"text"},{name:"custom",type:"text"}];var h=n(31041),g=n(73234),m=n(61116),f=n(77307),b=n(84369),v=n(38116);function _(t,e){1&t&&(a.TgZ(0,"span",11),a._uU(1,"Update Pixel"),a.qZA())}function x(t,e){1&t&&(a.TgZ(0,"span",11),a._uU(1,"Create New Pixel"),a.qZA())}function Z(t,e){if(1&t&&(a.TgZ(0,"div",20),a._uU(1),a.qZA()),2&t){const t=a.oxw().ngIf;a.xp6(1),a.Oqu(t.name)}}function y(t,e){if(1&t&&(a.TgZ(0,"option",21),a._uU(1),a.qZA()),2&t){const t=e.$implicit,n=a.oxw(2);a.Q6J("value",t.name),a.xp6(1),a.Oqu(n.viewTypeName(t.name))}}function w(t,e){if(1&t&&(a.TgZ(0,"div",20),a._uU(1),a.qZA()),2&t){const t=a.oxw(3).ngIf;a.xp6(1),a.Oqu(t.pixel_id)}}function k(t,e){if(1&t&&(a.TgZ(0,"div",13),a.TgZ(1,"label",23),a._uU(2,"Pixel ID"),a.qZA(),a._UZ(3,"input",24),a.YNc(4,w,2,1,"div",16),a.qZA()),2&t){const t=a.oxw().ngIf,e=a.oxw().ngIf;a.xp6(3),a.Q6J("type",t.type)("pattern",t.pattern),a.xp6(1),a.Q6J("ngIf",e.pixel_id)}}function A(t,e){1&t&&(a.TgZ(0,"div",12),a.TgZ(1,"div",13),a.TgZ(2,"label",25),a._uU(3,"Custom Code for Page Head"),a.qZA(),a._UZ(4,"textarea",26),a.qZA(),a.TgZ(5,"div",13),a.TgZ(6,"label",27),a._uU(7,"Custom Code for Page Body"),a.qZA(),a._UZ(8,"textarea",28),a.qZA(),a.qZA())}function C(t,e){if(1&t&&(a.ynx(0),a.YNc(1,k,5,3,"div",22),a.YNc(2,A,9,0,"div",7),a.BQk()),2&t){const t=e.ngIf;a.xp6(1),a.Q6J("ngIf","custom"!==t.name),a.xp6(1),a.Q6J("ngIf","custom"===t.name)}}function T(t,e){if(1&t&&(a.TgZ(0,"mat-dialog-content",12),a.TgZ(1,"div",13),a.TgZ(2,"label",14),a._uU(3,"Name"),a.qZA(),a._UZ(4,"input",15),a.YNc(5,Z,2,1,"div",16),a.qZA(),a.TgZ(6,"div",13),a.TgZ(7,"label",17),a._uU(8,"Type"),a.qZA(),a.TgZ(9,"select",18),a.YNc(10,y,2,2,"option",19),a.qZA(),a.qZA(),a.YNc(11,C,3,2,"ng-container",10),a.ALo(12,"async"),a.qZA()),2&t){const t=e.ngIf,n=a.oxw();a.xp6(5),a.Q6J("ngIf",t.name),a.xp6(5),a.Q6J("ngForOf",n.types),a.xp6(1),a.Q6J("ngIf",a.lcZ(12,3,n.selectedType$))}}function q(t,e){1&t&&(a.TgZ(0,"span"),a._uU(1,"Update"),a.qZA())}function I(t,e){1&t&&(a.TgZ(0,"span"),a._uU(1,"Create"),a.qZA())}let O=(()=>{class t{constructor(t,e,n,i,o){this.dialogRef=t,this.data=e,this.fb=n,this.pixels=i,this.toast=o,this.types=p,this.loading$=new u.X(!1),this.errors$=new u.X({}),this.selectedType$=new u.X(this.types[0]),this.form=this.fb.group({name:[""],type:[this.types[0].name],head_code:[""],body_code:[""],pixel_id:[""]})}ngOnInit(){this.form.get("type").valueChanges.subscribe(t=>{this.selectedType$.next(this.types.find(e=>e.name===t))}),this.data.pixel&&this.form.patchValue(this.data.pixel)}confirm(){this.loading$.next(!0);const t=this.data.pixel?this.pixels.update(this.data.pixel.id,this.getPayload()):this.pixels.create(this.getPayload()),e=this.data.pixel?i.V.TRACKING_PIXEL_UPDATE_SUCCESS:i.V.TRACKING_PIXEL_CREATE_SUCCESS;t.pipe((0,d.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.toast.open(e),this.close(t.pixel)},t=>this.errors$.next(t.errors))}close(t){this.dialogRef.close(t)}getPayload(){return Object.assign({},this.form.value)}viewTypeName(t){return t.replace(/-/g," ")}}return t.\u0275fac=function(e){return new(e||t)(a.Y36(c.so),a.Y36(c.WI),a.Y36(h.qu),a.Y36(l),a.Y36(g.F))},t.\u0275cmp=a.Xpm({type:t,selectors:[["crupdate-tracking-pixel-modal"]],decls:17,vars:11,consts:[[1,"modal-header"],["mat-dialog-title",""],["trans","",4,"ngIf","ngIfElse"],["creating",""],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit"],["class","many-inputs",4,"ngIf"],["type","button","mat-button","","trans","",3,"click"],["type","submit","mat-raised-button","","color","accent","trans","",3,"disabled"],[4,"ngIf"],["trans",""],[1,"many-inputs"],[1,"input-container"],["for","name","trans",""],["type","text","id","name","formControlName","name","required",""],["class","error",4,"ngIf"],["for","type","trans",""],["id","type","formControlName","type","required","",1,"type-select"],[3,"value",4,"ngFor","ngForOf"],[1,"error"],[3,"value"],["class","input-container",4,"ngIf"],["for","pixel_id","trans",""],["id","pixel_id","formControlName","pixel_id","required","",3,"type","pattern"],["for","head-code","trans",""],["name","head-code","id","head-code","rows","10","formControlName","head_code"],["for","body-code","trans",""],["name","body-code","id","body-code","rows","10","formControlName","body_code"]],template:function(t,e){if(1&t&&(a.TgZ(0,"div",0),a.TgZ(1,"h2",1),a.YNc(2,_,2,0,"span",2),a.YNc(3,x,2,0,"ng-template",null,3,a.W1O),a.qZA(),a.TgZ(5,"button",4),a.NdJ("click",function(){return e.close()}),a._UZ(6,"mat-icon",5),a.qZA(),a.qZA(),a.TgZ(7,"form",6),a.NdJ("ngSubmit",function(){return e.confirm()}),a.YNc(8,T,13,5,"mat-dialog-content",7),a.ALo(9,"async"),a.TgZ(10,"mat-dialog-actions"),a.TgZ(11,"button",8),a.NdJ("click",function(){return e.close()}),a._uU(12,"Cancel"),a.qZA(),a.TgZ(13,"button",9),a.ALo(14,"async"),a.YNc(15,q,2,0,"span",10),a.YNc(16,I,2,0,"span",10),a.qZA(),a.qZA(),a.qZA()),2&t){const t=a.MAs(4);a.xp6(2),a.Q6J("ngIf",e.data.pixel)("ngIfElse",t),a.xp6(5),a.Q6J("formGroup",e.form),a.xp6(1),a.Q6J("ngIf",a.lcZ(9,7,e.errors$)),a.xp6(5),a.Q6J("disabled",a.lcZ(14,9,e.loading$)),a.xp6(2),a.Q6J("ngIf",e.data.pixel),a.xp6(1),a.Q6J("ngIf",!e.data.pixel)}},directives:[c.uh,m.O5,f.Hw,h.JL,h.sg,c.H8,b.lW,v.P,c.xY,h.Fj,h.JJ,h.u,h.Q7,h.EJ,m.sg,h.YN,h.Kr,h.c5],pipes:[m.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}.type-select[_ngcontent-%COMP%]{text-transform:capitalize}"],changeDetection:0}),t})();var U=n(59075),P=n(45523),M=n(44415);const S=[new U.XQ({type:U.Bq.Select,key:"type",defaultValue:"facebook",description:"Tracking pixel type",options:p.map(t=>({key:t.name,value:t.name}))}),new P.T7({description:"Date pixel was created"}),new P.yH({description:"Date pixel was last updated"}),new U.XQ({type:U.Bq.SelectModel,key:"user_id",label:"User",description:"User overlay was created by",component:M.y})];var N=n(28505),J=n(36501),E=n(63337),L=n(95157),D=n(48865),$=n(34955),R=n(56361),Y=n(13536),F=n(80922),Q=n(86668),B=n(27701),H=n(54275),V=n(24311),z=n(71765),G=n(47210),j=n(2406),X=n(40450);function W(t,e){1&t&&a._UZ(0,"mat-progress-bar",17)}function K(t,e){1&t&&(a.TgZ(0,"th",12),a._uU(1,"Owner"),a.qZA())}const tt=function(t){return{count:t,resource:"pixel(s)"}};function et(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"tr"),a.TgZ(1,"th",18),a.TgZ(2,"div",19),a._uU(3," :count :resource selected: "),a.qZA(),a.TgZ(4,"div",20),a.TgZ(5,"permission-aware-button",21),a.TgZ(6,"button",22),a.NdJ("click",function(){return a.CHM(t),a.oxw().maybeDeleteSelectedPixels()}),a._uU(7," Delete "),a.qZA(),a.qZA(),a.qZA(),a.qZA(),a.qZA()}if(2&t){const t=e.ngIf;a.xp6(2),a.Q6J("transValues",a.VKq(1,tt,t))}}function nt(t,e){if(1&t&&(a.TgZ(0,"td",36),a._UZ(1,"user-column",37),a.qZA()),2&t){const t=a.oxw().$implicit;a.xp6(1),a.Q6J("user",t.user)}}function it(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"tr"),a._UZ(1,"td",23),a.TgZ(2,"td",24),a._uU(3),a.qZA(),a.YNc(4,nt,2,1,"td",25),a.TgZ(5,"td",26),a._uU(6),a.qZA(),a.TgZ(7,"td",27),a._uU(8),a.qZA(),a.TgZ(9,"td",28),a._uU(10),a.ALo(11,"formattedDate"),a.qZA(),a.TgZ(12,"td",29),a.TgZ(13,"permission-aware-button",30),a.TgZ(14,"button",31),a.NdJ("click",function(){const e=a.CHM(t).$implicit;return a.oxw().showCrupdatePixelModal(e)}),a.ALo(15,"trans"),a._UZ(16,"mat-icon",32),a.qZA(),a.qZA(),a.TgZ(17,"permission-aware-button",33),a.TgZ(18,"button",34),a.NdJ("click",function(){const e=a.CHM(t).$implicit;return a.oxw().maybeDeleteSelectedPixels([e.id])}),a._UZ(19,"mat-icon",35),a.qZA(),a.qZA(),a.qZA(),a.qZA()}if(2&t){const t=e.$implicit,n=a.oxw();a.xp6(1),a.Q6J("table-body-checkbox",t.id),a.xp6(2),a.Oqu(t.name),a.xp6(1),a.Q6J("ngIf",n.showUserColumn()),a.xp6(2),a.Oqu(t.type),a.xp6(2),a.Oqu(t.pixel_id),a.xp6(2),a.Oqu(a.lcZ(11,8,t.updated_at)),a.xp6(3),a.Q6J("userOwnsResource",n.currentUser.get("id")===t.user_id),a.xp6(1),a.Q6J("matTooltip",a.lcZ(15,10,"Edit tracking pixel"))}}function ot(t,e){1&t&&(a.TgZ(0,"no-results-message",38),a.TgZ(1,"span",39),a._uU(2,"No tracking pixels have been created yet"),a.qZA(),a.qZA())}let st=(()=>{class t{constructor(t,e,n,i,o,s,a,r){this.datatable=t,this.currentUser=e,this.linkUsage=n,this.trackingPixels=i,this.toast=o,this.route=s,this.workspaces=a,this.activeSection=r,this.filters=S,this.pixels$=this.datatable.data$}ngOnInit(){this.workspaceSub=this.workspaces.activeId$.subscribe(()=>{this.setFilters()}),this.datatable.init({uri:l.BASE_URI,staticParams:{with:["user"],userId:this.showUserColumn()?null:this.currentUser.get("id")}})}ngOnDestroy(){this.workspaceSub.unsubscribe()}maybeDeleteSelectedPixels(t){this.datatable.confirmResourceDeletion("tracking pixels").subscribe(()=>{this.trackingPixels.delete(t||this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset(),this.linkUsage.reload(),this.toast.open(i.V.TRACKING_PIXEL_DELETE_SUCCESS)},t=>{this.toast.open(t.message||o.v.Default)})})}showCrupdatePixelModal(t){this.datatable.openCrupdateResourceModal(O,{pixel:t}).subscribe(()=>{this.linkUsage.reload()})}showUserColumn(){return this.activeSection.admin||!!this.workspaces.activeId$.value}setFilters(){this.filters=S.filter(t=>"user_id"!==t.key||this.showUserColumn())}}return t.\u0275fac=function(e){return new(e||t)(a.Y36(s.x),a.Y36(N.I),a.Y36(J.F),a.Y36(l),a.Y36(g.F),a.Y36(E.gz),a.Y36(L.b),a.Y36(D.W))},t.\u0275cmp=a.Xpm({type:t,selectors:[["tracking-pixel-index"]],features:[a._Bn([s.x])],decls:35,vars:12,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","pixels",3,"filters"],[1,"action-buttons"],["permission","tracking_pixels.create"],["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","","trans",""],["table-sort-header","","trans","",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","location-tracking.svg",4,"ngIf"],["mode","indeterminate","color","accent",1,"loading-bar"],["colspan","7"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["permission","tracking_pixels.delete"],["type","button","mat-raised-button","","color","warn","trans","",3,"click"],[3,"table-body-checkbox"],["data-label","Name"],["data-label","Owner",4,"ngIf"],["data-label","Type"],["data-label","Pixel ID"],["data-label","Last Updated"],[1,"edit-column"],["permission","tracking_pixels.update",3,"userOwnsResource"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","edit"],["permission","tracking_pixels.delete",1,"visible-on-mobile"],["type","button","mat-icon-button","","trans","",3,"click"],["svgIcon","delete"],["data-label","Owner"],[3,"user"],["svgImage","location-tracking.svg"],["primary-text","","trans",""]],template:function(t,e){1&t&&(a.TgZ(0,"div",0),a.TgZ(1,"h1",1),a._uU(2,"Tracking Pixels"),a.qZA(),a.TgZ(3,"div",2),a._UZ(4,"datatable-filters",3),a.TgZ(5,"div",4),a.TgZ(6,"permission-aware-button",5),a.TgZ(7,"button",6),a.NdJ("click",function(){return e.showCrupdatePixelModal()}),a._UZ(8,"mat-icon",7),a.TgZ(9,"span",1),a._uU(10,"Add New Pixel"),a.qZA(),a.qZA(),a.qZA(),a.qZA(),a.qZA(),a.qZA(),a.TgZ(11,"div",8),a.YNc(12,W,1,0,"mat-progress-bar",9),a.ALo(13,"async"),a.TgZ(14,"table",10),a.TgZ(15,"thead"),a.TgZ(16,"tr"),a._UZ(17,"th",11),a.TgZ(18,"th",12),a._uU(19,"Name"),a.qZA(),a.YNc(20,K,2,0,"th",13),a.TgZ(21,"th",12),a._uU(22,"Type"),a.qZA(),a.TgZ(23,"th",1),a._uU(24,"Pixel ID"),a.qZA(),a.TgZ(25,"th",1),a._uU(26,"Last Updated"),a.qZA(),a._UZ(27,"th"),a.qZA(),a.YNc(28,et,8,3,"tr",14),a.qZA(),a.TgZ(29,"tbody"),a.YNc(30,it,20,12,"tr",15),a.ALo(31,"async"),a.qZA(),a.qZA(),a.YNc(32,ot,3,0,"no-results-message",16),a.ALo(33,"async"),a._UZ(34,"datatable-footer"),a.qZA()),2&t&&(a.xp6(4),a.Q6J("filters",e.filters),a.xp6(8),a.Q6J("ngIf",a.lcZ(13,6,e.datatable.paginator&&e.datatable.paginator.loading$)),a.xp6(8),a.Q6J("ngIf",e.showUserColumn()),a.xp6(8),a.Q6J("ngIf",e.datatable.selectedRows$.value.length),a.xp6(2),a.Q6J("ngForOf",a.lcZ(31,8,e.pixels$)),a.xp6(2),a.Q6J("ngIf",a.lcZ(33,10,e.datatable.paginator.noResults$)))},directives:[v.P,$.h,R.v,b.lW,f.Hw,m.O5,Y.e,F.p,m.sg,Q.V,B.pW,H.O,V.gM,z.r,G.U],pipes:[m.Ov,j.l,X.R],styles:[".mat-column-type[_ngcontent-%COMP%]{text-transform:capitalize}"],changeDetection:0}),t})()},36501:function(t,e,n){"use strict";n.d(e,{F:function(){return r}});var i=n(66994),o=n(35366),s=n(68515),a=n(541);let r=(()=>{class t{constructor(t,e){this.http=t,this.selectValues=e,this.response$=new i.t(1)}reload(){this.selectValues.clearCache(),this.http.get("link/usage").subscribe(t=>{this.response$.next(t)})}}return t.\u0275fac=function(e){return new(e||t)(o.LFG(s.r),o.LFG(a.U))},t.\u0275prov=o.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},32198:function(t,e,n){"use strict";n.d(e,{l:function(){return r}});var i=n(78512),o=n(35366),s=n(31041),a=n(88195);let r=(()=>{class t{constructor(t,e){this.fb=t,this.settings=e,this.errors$=new i.X({}),this.build(),this.linkHash=this.formGroup.get("hash")}value(){const t=Object.assign({},this.formGroup.value);return t.rules=(t.geo_rules||[]).concat(t.device_rules).concat(t.platform_rules).filter(t=>(null==t?void 0:t.key)&&(null==t?void 0:t.value)),delete t.geo_rules,delete t.device_rules,delete t.platform_rules,t.type.indexOf(":")>-1&&(t.type_id=parseInt(t.type.split(":")[1]),t.type=t.type.split(":")[0]),t.long_urls?(t.long_urls=t.long_urls.split(/\n/g),delete t.long_url,delete t.alias):delete t.long_urls,this.formGroup.get("password").dirty||delete t.password,t}build(){const t=this.settings.get("links.default_type","direct");this.formGroup=this.fb.group({type:[t],name:[""],long_url:[""],long_urls:[""],domain_id:[null],hash:[""],alias:[""],image:[""],utm:[""],password:[""],active:[!0],expires_at:[""],activates_at:[""],description:[""],tags:[[]],pixels:[[]],groups:[[]],geo_rules:this.fb.array([]),device_rules:this.fb.array([]),platform_rules:this.fb.array([]),exp_clicks_rule:this.fb.group({key:[""],value:[""]})}),this.geoRules=this.formGroup.controls.geo_rules,this.deviceRules=this.formGroup.controls.device_rules,this.platformRules=this.formGroup.controls.platform_rules,this.expClicksRule=this.formGroup.controls.exp_clicks_rule,this.addNewGeoRule(),this.addNewDeviceRule(),this.addNewPlatformRule(),this.formGroup.get("long_urls").valueChanges.subscribe(t=>{t?this.formGroup.get("alias").disable():this.formGroup.get("alias").enable()})}patchValue(t){if(t){const e=Object.assign({},t);"type_id"in t&&t.type_id&&(e.type=`${t.type}:${t.type_id}`);const n=t.rules||[];e.geo_rules=n.filter(t=>"geo"===t.type),e.device_rules=n.filter(t=>"device"===t.type),e.platform_rules=n.filter(t=>"platform"===t.type),e.exp_clicks_rule=n.find(t=>"exp_clicks"===t.type),e.tags=(e.tags||[]).map(t=>t.name),e.pixels=(e.pixels||[]).map(t=>t.id),e.groups=(e.groups||[]).map(t=>t.id),t.has_password&&(e.password="******"),this.formGroup.patchValue(e),e.geo_rules.length&&(this.geoRules.clear(),e.geo_rules.forEach(t=>{this.addNewGeoRule(t.key,t.value)})),e.device_rules.length&&(this.deviceRules.clear(),e.device_rules.forEach(t=>{this.addNewDeviceRule(t.key,t.value)})),e.platform_rules.length&&(this.platformRules.clear(),e.platform_rules.forEach(t=>{this.addNewPlatformRule(t.key,t.value)}))}}addNewGeoRule(t="us",e=""){this.geoRules.push(this.fb.group({key:[t],value:[e],type:"geo"}))}addNewDeviceRule(t="mobile",e=""){this.deviceRules.push(this.fb.group({key:[t],value:[e],type:"device"}))}addNewPlatformRule(t="windows",e=""){this.platformRules.push(this.fb.group({key:[t],value:[e],type:"platform"}))}setErrors(t){this.errors$.next(t||{})}}return t.\u0275fac=function(e){return new(e||t)(o.LFG(s.qu),o.LFG(a.Z))},t.\u0275prov=o.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},57125:function(t,e,n){"use strict";n.d(e,{G:function(){return l}});var i=n(16930),o=n(20274),s=n(94380),a=n(73033),r=n(35366);let l=(()=>{class t extends i.c{constructor(){super(...arguments),this.DEFAULT_MAX_SIZE_MB=5}initValidations(){const t=[new o.p({maxSize:(0,s.F)(this.DEFAULT_MAX_SIZE_MB,"MB")},this.i18n),new a.p({types:["image"]},this.i18n)];this.validations.push(...t)}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=r.n5z(t)))(n||t)}}(),t.\u0275prov=r.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},44415:function(t,e,n){"use strict";n.d(e,{y:function(){return v}});var i=n(31041),o=n(47701),s=n(98720),a=n(44689),r=n(47727),l=n(78512),c=n(40878),d=n(35366),u=n(92935),p=n(62424),h=n(38116),g=n(77307),m=n(42300),f=n(61116);function b(t,e){if(1&t){const t=d.EpF();d.TgZ(0,"div",9),d.NdJ("click",function(){const e=d.CHM(t).$implicit;return d.oxw().close(e)}),d._UZ(1,"img",10),d.TgZ(2,"div",11),d.TgZ(3,"div",12),d._uU(4),d.qZA(),d.TgZ(5,"div",13),d._uU(6),d.qZA(),d.qZA(),d.qZA()}if(2&t){const t=e.$implicit;d.xp6(1),d.Q6J("src",t.avatar,d.LSH),d.xp6(3),d.Oqu(t.display_name),d.xp6(2),d.Oqu(t.email)}}let v=(()=>{class t{constructor(t,e){this.dialogRef=t,this.users=e,this.searchFormControl=new i.NI,this.loading$=new l.X(!1),this.users$=new l.X([])}ngOnInit(){this.searchFormControl.valueChanges.pipe((0,o.b)(250),(0,s.x)(),(0,a.w)(t=>this.searchUsers(t)),(0,r.K)(()=>(0,c.of)([]))).subscribe(t=>{this.users$.next(t),this.loading$.next(!1)})}close(t){this.dialogRef.close(this.normalizeUser(t))}searchUsers(t){return this.loading$.next(!0),t?this.users.getAll({query:t}):(0,c.of)([])}normalizeUser(t){return t?{id:t.id,name:t.display_name,image:t.avatar,model_type:t.model_type}:null}}return t.\u0275fac=function(e){return new(e||t)(d.Y36(u.so),d.Y36(p.Q))},t.\u0275cmp=d.Xpm({type:t,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(t,e){1&t&&(d.TgZ(0,"div",0),d.TgZ(1,"h2",1),d._uU(2,"Find User"),d.qZA(),d.TgZ(3,"button",2),d.NdJ("click",function(){return e.close()}),d._UZ(4,"mat-icon",3),d.qZA(),d.qZA(),d.TgZ(5,"mat-dialog-content"),d.TgZ(6,"div",4),d._UZ(7,"input",5),d._UZ(8,"loading-indicator",6),d.ALo(9,"async"),d.qZA(),d.TgZ(10,"div",7),d.YNc(11,b,7,3,"div",8),d.ALo(12,"async"),d.qZA(),d.qZA()),2&t&&(d.xp6(7),d.Q6J("formControl",e.searchFormControl),d.xp6(1),d.Q6J("isVisible",d.lcZ(9,3,e.loading$)),d.xp6(3),d.Q6J("ngForOf",d.lcZ(12,5,e.users$)))},directives:[u.uh,h.P,g.Hw,u.xY,i.Fj,i.JJ,i.oH,m.Q,f.sg],pipes:[f.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}),t})()},68692:function(t,e,n){"use strict";n.d(e,{X:function(){return r}});var i=n(61116),o=n(68400),s=n(31041),a=n(35366);let r=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=a.oAB({type:t}),t.\u0275inj=a.cJS({imports:[[i.ez,o.N,s.UX]]}),t})()},77910:function(t,e,n){"use strict";n.d(e,{S:function(){return C}});var i=n(31041),o=n(78512),s=n(40878),a=n(47701),r=n(98720),l=n(44689),c=n(47727),d=n(35366),u=n(95522),p=n(61116),h=n(79961),g=n(77307),m=n(87064),f=n(40450);const b=["auto"],v=["inputEl"],_=["selectModeTemplate"];function x(t,e){if(1&t){const t=d.EpF();d.TgZ(0,"mat-chip",8),d.NdJ("removed",function(){const e=d.CHM(t).index;return d.oxw().remove(e)}),d._uU(1),d._UZ(2,"mat-icon",9),d.qZA()}if(2&t){const t=e.$implicit,n=d.oxw();d.Q6J("selectable",!1)("removable",!n.selectMode),d.xp6(1),d.hij(" ",n.displayChipValue(t)," ")}}const Z=function(t){return{elementRef:t}};function y(t,e){if(1&t){const t=d.EpF();d.TgZ(0,"input",10,11),d.NdJ("matChipInputTokenEnd",function(e){return d.CHM(t),d.oxw().addFromChipInput(e.value)}),d.ALo(2,"trans"),d.qZA()}if(2&t){const t=d.oxw(),e=d.MAs(1),n=d.MAs(6);d.Q6J("placeholder",d.lcZ(2,7,t.placeholder))("type",t.type)("matChipInputFor",e)("matChipInputAddOnBlur",!0)("matAutocomplete",n)("matAutocompleteConnectedTo",d.VKq(9,Z,t.el))("formControl",t.formControl)}}function w(t,e){if(1&t&&(d.TgZ(0,"mat-option",12),d._uU(1),d.qZA()),2&t){const t=e.$implicit,n=d.oxw();d.Q6J("value",t),d.xp6(1),d.Oqu(n.displayChipValue(t))}}function k(t,e){if(1&t&&(d.TgZ(0,"mat-option",12),d._uU(1),d.qZA()),2&t){const t=e.$implicit,n=d.oxw(2);d.Q6J("value",t),d.xp6(1),d.Oqu(n.displayChipValue(t))}}function A(t,e){1&t&&d.YNc(0,k,2,2,"mat-option",6),2&t&&d.Q6J("ngForOf",e.suggestions)}let C=(()=>{class t{constructor(t){this.el=t,this.type="text",this.emailsInput=!1,this.selectMode=!1,this.formControl=new i.NI,this.items$=new o.X([]),this.suggestedValues$=new o.X([])}set suggestedValues(t){this.suggestedValues$.next(t)}ngOnInit(){this.suggestFn&&this.bindToSearchControl()}ngAfterViewInit(){this.emailsInput&&this.parseEmailsOnPaste()}remove(t){const e=[...this.items$.value];e.splice(t,1),this.items$.next(e),this.propagateChange(this.items$.value)}addFromChipInput(t,e=!0){!t||this.matAutocomplete.isOpen||this.selectMode||this.add(t,e)}addFromAutocomplete(t,e=!0){this.add(t,e)}add(t,e=!0){t="string"==typeof t?t.trim():t;const n=this.findValueIndex(t)>-1;t&&!n&&(this.items$.next([...this.items$.value,t]),e&&this.propagateChange(this.items$.value)),this.inputEl&&(this.inputEl.nativeElement.value=""),this.formControl.setValue(null),this.suggestedValues$.next([])}findValueIndex(t){return"string"==typeof t?this.items$.value.indexOf(t):this.items$.value.findIndex(e=>e.id===t.id)}writeValue(t=[]){this.items$.next(t||[])}registerOnChange(t){this.propagateChange=t}registerOnTouched(){}bindToSearchControl(){this.formControl.valueChanges.pipe((0,a.b)(150),(0,r.x)(),(0,l.w)(t=>t?this.suggestFn(t):(0,s.of)([])),(0,c.K)(()=>(0,s.of)([]))).subscribe(t=>{const e=t.filter(t=>-1===this.findValueIndex(t));this.suggestedValues$.next(e)})}displayChipValue(t){return"object"==typeof t?t.name:t}parseEmailsOnPaste(){this.inputEl.nativeElement.addEventListener("paste",t=>{const e=(t.clipboardData||window.clipboardData).getData("text").match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi);if(e){t.preventDefault();const n=window.getSelection();n.rangeCount&&(n.deleteFromDocument(),e.forEach(t=>this.add(t)))}})}}return t.\u0275fac=function(e){return new(e||t)(d.Y36(d.SBq))},t.\u0275cmp=d.Xpm({type:t,selectors:[["chip-input"]],viewQuery:function(t,e){if(1&t&&(d.Gf(b,5),d.Gf(v,5),d.Gf(_,5)),2&t){let t;d.iGM(t=d.CRH())&&(e.matAutocomplete=t.first),d.iGM(t=d.CRH())&&(e.inputEl=t.first),d.iGM(t=d.CRH())&&(e.selectModeTemplate=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&d.ekj("select-mode",e.selectMode)},inputs:{placeholder:"placeholder",type:"type",emailsInput:"emailsInput",suggestFn:"suggestFn",selectMode:"selectMode",suggestedValues:"suggestedValues"},features:[d._Bn([{provide:i.JU,useExisting:t,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(t,e){1&t&&(d.TgZ(0,"mat-chip-list",0,1),d.YNc(2,x,3,3,"mat-chip",2),d.ALo(3,"async"),d.YNc(4,y,3,11,"input",3),d.qZA(),d.TgZ(5,"mat-autocomplete",4,5),d.NdJ("optionSelected",function(t){return e.addFromAutocomplete(t.option.value)}),d.YNc(7,w,2,2,"mat-option",6),d.ALo(8,"async"),d.qZA(),d.YNc(9,A,1,1,"ng-template",null,7,d.W1O)),2&t&&(d.Q6J("selectable",!1),d.xp6(2),d.Q6J("ngForOf",d.lcZ(3,5,e.items$)),d.xp6(2),d.Q6J("ngIf",!e.selectMode),d.xp6(1),d.Q6J("autoActiveFirstOption",!0),d.xp6(2),d.Q6J("ngForOf",d.lcZ(8,7,e.suggestedValues$)))},directives:[u.qn,p.sg,p.O5,h.XC,u.HS,g.Hw,u.qH,u.oH,h.ZL,i.Fj,i.JJ,i.oH,m.ey],pipes:[p.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 rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)}"],encapsulation:2,changeDetection:0}),t})()},56160:function(t,e,n){"use strict";n.d(e,{G:function(){return p}});var i=n(61116),o=n(95522),s=n(77307),a=n(31041),r=n(68400),l=n(79961),c=n(84369),d=n(87064),u=n(35366);let p=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=u.oAB({type:t}),t.\u0275inj=u.cJS({imports:[[i.ez,o.Hi,l.Bb,a.UX,r.N,c.ot,s.Ps,d.si]]}),t})()},69042:function(t,e,n){"use strict";n.d(e,{M:function(){return g}});var i=n(64762),o=n(35366),s=n(31041),a=n(40149),r=n(78512),l=n(98979),c=n(87064),d=n(77307),u=n(38116),p=n(61116);const h=["*"];let g=(()=>{class t{constructor(t){this.overlayPanel=t,this.color$=new r.X(null)}ngOnDestroy(){this.pickerSub&&this.pickerSub.unsubscribe()}writeValue(t){this.color$.next(t)}registerOnChange(t){this.propagateChange=t}registerOnTouched(){}openColorPicker(t){return(0,i.mG)(this,void 0,void 0,function*(){const{BeColorPickerModule:e}=yield n.e(378).then(n.bind(n,49378));this.pickerSub=this.overlayPanel.open(e.components.panel,{origin:new o.SBq(t.target),position:a.x,data:{color:this.color$.value}}).valueChanged().subscribe(t=>{this.color$.next(t),this.propagateChange(this.color$.value)})})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(l.T))},t.\u0275cmp=o.Xpm({type:t,selectors:[["color-picker-input"]],features:[o._Bn([{provide:s.JU,useExisting:t,multi:!0}])],ngContentSelectors:h,decls:7,vars:4,consts:[["type","button","matRipple","",1,"no-style","color-picker-btn",3,"click"],["svgIcon","drop-custom",1,"color-icon"],["trans","",1,"name"],["trans","",1,"change"]],template:function(t,e){1&t&&(o.F$t(),o.TgZ(0,"button",0),o.NdJ("click",function(t){return e.openColorPicker(t)}),o.TgZ(1,"mat-icon",1),o.ALo(2,"async"),o.qZA(),o.TgZ(3,"span",2),o.Hsn(4),o.qZA(),o.TgZ(5,"span",3),o._uU(6,"Change"),o.qZA(),o.qZA()),2&t&&(o.xp6(1),o.Udp("color",o.lcZ(2,2,e.color$)))},directives:[c.wG,d.Hw,u.P],pipes:[p.Ov],styles:[".color-picker-btn[_ngcontent-%COMP%]{display:flex;align-items:center;padding:0 10px 0 15px;margin-bottom:15px;border-radius:4px;border:1px solid var(--be-divider-default);background-color:var(--be-background);cursor:pointer;height:57px;font-size:1.5rem;overflow:hidden;width:100%}.color-picker-btn[_ngcontent-%COMP%] .color-icon[_ngcontent-%COMP%]{width:35px;height:35px}.color-picker-btn[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{margin-left:3px;margin-top:3px;font-size:1.4rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:160px;text-transform:capitalize}.color-picker-btn[_ngcontent-%COMP%] .change[_ngcontent-%COMP%]{color:var(--be-link);font-size:1.3rem;margin-left:auto}"],changeDetection:0}),t})()},37604:function(t,e,n){"use strict";n.d(e,{x:function(){return l}});var i=n(61116),o=n(68400),s=n(77307),a=n(87064),r=n(35366);let l=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=r.oAB({type:t}),t.\u0275inj=r.cJS({imports:[[i.ez,o.N,s.Ps,a.si]]}),t})()},98081:function(t,e,n){"use strict";n.d(e,{k:function(){return d}});var i=n(31041),o=n(35366),s=n(61116),a=n(38116),r=n(84369);function l(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",8),o.NdJ("click",function(){return o.CHM(t),o.oxw().clearValue()}),o._uU(1," Clear "),o.qZA()}}const c=["*"];let d=(()=>{class t{constructor(t,e){this.fb=t,this.cd=e,this.currentDateAsDefault=!1,this.initiated=!1,this.form=this.fb.group({date:[""],time:[""]}),this.setCurrentDatetime()}writeValue(t){t=(t||"").replace("Z","");let[e,n]=t.includes("T")?t.split("T"):t.split(" ");n=n?n.substr(0,5):"",!this.initiated&&this.currentDateAsDefault&&(e=e||this.currentDate,n=n||this.currentTime),this.initiated=!0,this.form.patchValue({date:e,time:n})}registerOnChange(t){this.propagateChange=t,this.form.valueChanges.subscribe(t=>{let e;t.date?(t.time||(t.time="00:00"),e=`${t.date} ${t.time}`,2===e.split(":").length&&(e+=":00")):e=null,this.propagateChange(e)})}registerOnTouched(){}setDisabledState(t){t?this.form.disable():this.form.enable(),this.cd.markForCheck()}clearValue(){this.form.patchValue({date:null,time:null})}setCurrentDatetime(){const[t,e]=(new Date).toISOString().replace("Z","").split("T"),[n,i]=e.split(":");this.currentDate=t,this.currentTime=`${n}:${i}`}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(i.qu),o.Y36(o.sBO))},t.\u0275cmp=o.Xpm({type:t,selectors:[["datetime-input"]],inputs:{id:"id",currentDateAsDefault:"currentDateAsDefault"},features:[o._Bn([{provide:i.JU,useExisting:t,multi:!0}])],ngContentSelectors:c,decls:14,vars:8,consts:[[3,"formGroup"],[1,"legend-label"],["class","clear-btn","type","button","mat-button","","trans","",3,"click",4,"ngIf"],[1,"inline-inputs-container"],[1,"input-container"],["trans","",1,"hidden",3,"for"],["type","date","formControlName","date",1,"date-input",3,"id","placeholder"],["type","time","formControlName","time",1,"time-input",3,"id","placeholder"],["type","button","mat-button","","trans","",1,"clear-btn",3,"click"]],template:function(t,e){1&t&&(o.F$t(),o.TgZ(0,"fieldset",0),o.TgZ(1,"legend"),o.TgZ(2,"span",1),o.Hsn(3),o.qZA(),o.YNc(4,l,2,0,"button",2),o.qZA(),o.TgZ(5,"div",3),o.TgZ(6,"div",4),o.TgZ(7,"label",5),o._uU(8,"Date"),o.qZA(),o._UZ(9,"input",6),o.qZA(),o.TgZ(10,"div",4),o.TgZ(11,"label",5),o._uU(12,"Time"),o.qZA(),o._UZ(13,"input",7),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.Q6J("formGroup",e.form),o.xp6(4),o.Q6J("ngIf",!e.form.disabled),o.xp6(3),o.Q6J("for",e.id+"-date"),o.xp6(2),o.Q6J("id",e.id+"-date")("placeholder",e.currentDate),o.xp6(2),o.Q6J("for",e.id+"-time"),o.xp6(2),o.Q6J("id",e.id+"-time")("placeholder",e.currentTime))},directives:[i.JL,i.sg,s.O5,a.P,i.Fj,i.JJ,i.u,r.lW],styles:[".date-input[_ngcontent-%COMP%]{border-right:none;border-top-right-radius:0;border-bottom-right-radius:0}.time-input[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}.input-container[_ngcontent-%COMP%]{margin-right:0}legend[_ngcontent-%COMP%]{display:flex;align-items:center;color:var(--be-label);width:100%}.legend-label[_ngcontent-%COMP%]{margin-right:auto}.clear-btn[_ngcontent-%COMP%]{margin-left:10px;line-height:28px}"],changeDetection:0}),t})()},49517:function(t,e,n){"use strict";n.d(e,{N:function(){return p}});var i=n(35366),o=n(72674),s=n(98979),a=n(84369),r=n(77307);const l=["infoIcon"],c=["popoverContent"];function d(t,e){1&t&&i.Hsn(0)}const u=["*"];let p=(()=>{class t{constructor(t,e){this.overlay=t,this.viewContainerRef=e}openPopover(){this.overlayRef&&this.closePopover(),Object.assign({},o.Z)[0].offsetY=-15,this.overlayRef=this.overlay.open(this.content,{origin:this.infoButton,position:o.Z,hasBackdrop:!1,scrollStrategy:"close",viewContainerRef:this.viewContainerRef,panelClass:["info-popover-panel",this.wider?"wider":null]}),this.overlayRef.getPanelEl().addEventListener("mouseleave",()=>{this.closePopover()})}closePopover(){this.overlayRef&&(this.overlayRef.close(),this.overlayRef=null)}togglePopover(){this.overlayRef?this.closePopover():this.openPopover()}onMouseLeave(t){const e=t.toElement||t.relatedTarget;e&&e.classList.contains("info-popover-panel")||this.closePopover()}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(s.T),i.Y36(i.s_b))},t.\u0275cmp=i.Xpm({type:t,selectors:[["info-popover"]],viewQuery:function(t,e){if(1&t&&(i.Gf(l,5,i.SBq),i.Gf(c,5)),2&t){let t;i.iGM(t=i.CRH())&&(e.infoButton=t.first),i.iGM(t=i.CRH())&&(e.content=t.first)}},inputs:{wider:"wider"},ngContentSelectors:u,decls:5,vars:0,consts:[["type","button","mat-icon-button","",3,"click","mouseenter","mouseleave"],["svgIcon","info",1,"info-icon"],["infoIcon",""],["popoverContent",""]],template:function(t,e){1&t&&(i.F$t(),i.TgZ(0,"button",0),i.NdJ("click",function(){return e.togglePopover()})("mouseenter",function(){return e.openPopover()})("mouseleave",function(t){return e.onMouseLeave(t)}),i._UZ(1,"mat-icon",1,2),i.qZA(),i.YNc(3,d,1,0,"ng-template",null,3,i.W1O))},directives:[a.lW,r.Hw],styles:["info-popover .mat-icon-button{vertical-align:middle;color:var(--be-secondary-text);cursor:help}.info-popover-panel{display:block;background-color:var(--be-background);box-shadow:0 3px 3px -2px rgba(0,0,0,.2),0 3px 4px 0 rgba(0,0,0,.14),0 1px 8px 0 rgba(0,0,0,.12);border-radius:4px;padding:15px;max-width:350px}.info-popover-panel.wider{max-width:550px}.info-popover-panel .title{font-size:1.6rem;margin-bottom:8px}.info-popover-panel .description{margin-bottom:5px;color:var(--be-secondary-text)}.info-popover-panel .link{margin-top:5px;padding-top:5px;border-top:var(--be-divider-default)}.info-popover-panel .link .mat-icon{vertical-align:middle;margin-right:5px;color:var(--be-link)}.info-popover-panel .link a:hover{text-decoration:underline}.info-popover-panel ol,.info-popover-panel ul{padding-left:15px;margin:0}"],encapsulation:2,changeDetection:0}),t})()},86013:function(t,e,n){"use strict";n.d(e,{b:function(){return r}});var i=n(61116),o=n(77307),s=n(84369),a=n(35366);let r=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=a.oAB({type:t}),t.\u0275inj=a.cJS({imports:[[i.ez,o.Ps,s.ot]]}),t})()},72674:function(t,e,n){"use strict";n.d(e,{Z:function(){return i}});const i=[{originX:"end",originY:"center",overlayX:"start",overlayY:"center",offsetX:5},{originX:"start",originY:"center",overlayX:"end",overlayY:"center",offsetX:5}]},4182:function(t,e,n){"use strict";n.d(e,{S:function(){return u}});var i=n(61116),o=n(84369),s=n(77307),a=n(97070),r=n(68400),l=n(31041),c=n(99808),d=n(35366);let u=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=d.oAB({type:t}),t.\u0275inj=d.cJS({imports:[[i.ez,o.ot,a.Tx,r.N,l.UX,s.Ps,c.p]]}),t})()},26437:function(t,e,n){"use strict";n.d(e,{B:function(){return o}});var i=n(99713);const o=[(0,i.X$)("fadeIn",[(0,i.eR)(":enter",[(0,i.oB)({opacity:0}),(0,i.jt)("325ms ease-in",(0,i.oB)({opacity:1}))])]),(0,i.X$)("fadeOut",[(0,i.eR)(":leave",[(0,i.oB)({opacity:1,position:"absolute",left:"0",right:"0"}),(0,i.jt)("325ms ease-out",(0,i.oB)({opacity:0}))])])]},73709:function(t,e,n){"use strict";function i(t){const e=Object.assign({},t);return Object.keys(e).forEach(t=>{null!=e[t]&&""!==e[t]||delete e[t]}),e}n.d(e,{N:function(){return i}})},37123:function(t,e,n){"use strict";n.d(e,{T:function(){return u}});var i=n(35366),o=n(92935),s=n(77307),a=n(38116),r=n(84369);let l=(()=>{class t{constructor(t){this.dialogRef=t}close(){this.dialogRef.close()}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(o.so))},t.\u0275cmp=i.Xpm({type:t,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(t,e){1&t&&(i.TgZ(0,"div",0),i.TgZ(1,"h2",1),i._uU(2,"CSV Export"),i.qZA(),i.TgZ(3,"button",2),i.NdJ("click",function(){return e.close()}),i._UZ(4,"mat-icon",3),i.qZA(),i.qZA(),i.TgZ(5,"div",4),i.TgZ(6,"div",5),i._UZ(7,"mat-icon",6),i.TgZ(8,"div",7),i._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. "),i.qZA(),i.qZA(),i.qZA(),i.TgZ(10,"div",8),i.TgZ(11,"button",9),i.NdJ("click",function(){return e.close()}),i._uU(12," Got it "),i.qZA(),i.qZA())},directives:[o.uh,s.Hw,o.xY,a.P,o.H8,r.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}),t})();var c=n(68515),d=n(24859);let u=(()=>{class t{constructor(t,e){this.http=t,this.modal=e}export(t,e={}){return this.http.post(t,e).subscribe(t=>{t.downloadPath?function(t,e){const n=document.createElement("a");n.href=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}(t.downloadPath):this.modal.open(l)})}}return t.\u0275fac=function(e){return new(e||t)(i.LFG(c.r),i.LFG(d.u))},t.\u0275prov=i.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},63380:function(t,e,n){"use strict";n.d(e,{M:function(){return l}});var i=n(77307),o=n(84369),s=n(92935),a=n(68400),r=n(35366);let l=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=r.oAB({type:t}),t.\u0275inj=r.cJS({imports:[[a.N,i.Ps,o.ot,s.Is]]}),t})()},83381:function(t,e,n){"use strict";n.d(e,{r:function(){return a}});var i=n(59075),o=n(44415),s=n(45523);const a=[new i.XQ({type:i.Bq.Select,key:"global",defaultValue:!1,description:"Whether domain is set as global or not",options:[{key:"No",value:!1},{key:"Yes",value:!0}]}),new s.yH({description:"Date the domain was last updated"}),new s.T7({description:"Date the domain was created"}),new i.XQ({type:i.Bq.SelectModel,key:"user_id",label:"User",description:"User domain was created by",component:o.y})]},71453:function(t,e,n){"use strict";n.d(e,{T:function(){return at}});var i=n(36024),o=n(56515),s=n(78512),a=n(92935),r=n(31041),l=n(11520),c=n(35366),d=n(14732),u=n(73234),p=n(88195),h=n(63337),g=n(28505),m=n(38116),f=n(77307),b=n(61116),v=n(84369),_=n(79572),x=n(42300),Z=n(40450);function y(t,e){if(1&t&&(c.TgZ(0,"div",23),c._uU(1),c.qZA()),2&t){const t=c.oxw(3).ngIf;c.xp6(1),c.Oqu(t.host)}}function w(t,e){1&t&&(c.TgZ(0,"div",24),c.TgZ(1,"mat-slide-toggle",25),c._uU(2,"Global"),c.qZA(),c.TgZ(3,"p",20),c._uU(4,"Whether all users should be able to select this domain."),c.qZA(),c.qZA())}function k(t,e){if(1&t&&(c.TgZ(0,"div",16),c.TgZ(1,"div",17),c.TgZ(2,"label",18),c._uU(3,"Host"),c.qZA(),c._UZ(4,"input",19),c.TgZ(5,"p",20),c._uU(6),c.qZA(),c.YNc(7,y,2,1,"div",21),c.qZA(),c.YNc(8,w,5,0,"div",22),c.qZA()),2&t){const t=c.oxw(2).ngIf,e=c.oxw();c.xp6(6),c.hij(" Enter the exact domain name you want your ",e.data.resourceName||"links"," to be accessible with. It can be a subdomain (example.yourdomain.com) or root domain (yourdomain.com). "),c.xp6(1),c.Q6J("ngIf",t.host),c.xp6(1),c.Q6J("ngIf",e.insideAdmin())}}function A(t,e){if(1&t&&(c.ynx(0),c.TgZ(1,"p",20),c._uU(2," Add this CNAME record to your domain by visiting your DNS provider or registrar. "),c.qZA(),c.TgZ(3,"div",27),c.TgZ(4,"div",28),c.TgZ(5,"strong"),c._uU(6,"CNAME"),c.qZA(),c._uU(7),c.qZA(),c.qZA(),c.BQk()),2&t){const t=c.oxw(4);c.xp6(7),c.hij(" ",t.baseUrl(),"")}}function C(t,e){if(1&t&&(c.ynx(0),c.TgZ(1,"p",20),c._uU(2," Add this A record to your domain by visiting your DNS provider or registrar. "),c.qZA(),c.TgZ(3,"div",27),c.TgZ(4,"div",28),c.TgZ(5,"strong"),c._uU(6,"A"),c.qZA(),c._uU(7),c.qZA(),c.qZA(),c.BQk()),2&t){const t=c.oxw(4);c.xp6(7),c.hij(" ",t.serverIp,"")}}function T(t,e){if(1&t&&(c.TgZ(0,"div",26),c.YNc(1,A,8,1,"ng-container",6),c.ALo(2,"async"),c.YNc(3,C,8,1,"ng-container",6),c.ALo(4,"async"),c.qZA()),2&t){const t=c.oxw(3);c.xp6(1),c.Q6J("ngIf",c.lcZ(2,2,t.isSubdomain$)),c.xp6(2),c.Q6J("ngIf",!c.lcZ(4,4,t.isSubdomain$))}}function q(t,e){1&t&&(c.TgZ(0,"div",27),c._UZ(1,"loading-indicator",32),c.TgZ(2,"div",33),c._uU(3,"Checking DNS configuration..."),c.qZA(),c.qZA()),2&t&&(c.xp6(1),c.Q6J("isVisible",!0))}const I=function(t){return{host:t}};function O(t,e){if(1&t&&(c.TgZ(0,"div",39),c._uU(1,' DNS records for the domain are setup, however it seems that your server is not configured to handle requests from "host" '),c.qZA()),2&t){const t=c.oxw(5);c.Q6J("transValues",c.VKq(1,I,t.form.value.host))}}const U=function(t){return{location:t}};function P(t,e){if(1&t&&(c.TgZ(0,"div",39),c.ALo(1,"async"),c._uU(2),c.ALo(3,"async"),c.qZA()),2&t){const t=c.oxw(5);c.Q6J("transValues",c.VKq(6,U,c.lcZ(1,2,t.isSubdomain$)?t.baseUrl():t.serverIp)),c.xp6(2),c.hij(" The domain is missing ",c.lcZ(3,4,t.isSubdomain$)?"CNAME":"A"," record pointing to :location or the changes haven't propagated yet. ")}}function M(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"div",34),c._UZ(1,"mat-icon",35),c.YNc(2,O,2,3,"div",36),c.ALo(3,"async"),c.YNc(4,P,4,8,"ng-template",null,37,c.W1O),c.qZA(),c.TgZ(6,"p"),c._uU(7),c.ALo(8,"trans"),c.TgZ(9,"button",38),c.NdJ("click",function(){return c.CHM(t),c.oxw(4).validateDnsForDomain()}),c.ALo(10,"async"),c._uU(11," refresh "),c.qZA(),c.qZA()}if(2&t){const t=c.MAs(5),e=c.oxw(4);c.xp6(2),c.Q6J("ngIf","serverNotConfigured"===c.lcZ(3,4,e.validationFailReason$)&&e.currentUserIsAdmin)("ngIfElse",t),c.xp6(5),c.hij(" ",c.lcZ(8,6,"You can wait and try again later or")," "),c.xp6(2),c.Q6J("disabled",c.lcZ(10,8,e.loading$))}}function S(t,e){if(1&t&&(c.TgZ(0,"div",29),c.YNc(1,q,4,1,"div",30),c.ALo(2,"async"),c.YNc(3,M,12,10,"ng-template",null,31,c.W1O),c.qZA()),2&t){const t=c.MAs(4),e=c.oxw(3);c.xp6(1),c.Q6J("ngIf",c.lcZ(2,2,e.loading$))("ngIfElse",t)}}function N(t,e){1&t&&(c.TgZ(0,"div",40),c.TgZ(1,"div",27),c._UZ(2,"loading-indicator",32),c.TgZ(3,"div",33),c._uU(4,"Connecting domain..."),c.qZA(),c.qZA(),c.TgZ(5,"p",20),c._uU(6,"Don't close this window until domain is connected."),c.qZA(),c.qZA()),2&t&&(c.xp6(2),c.Q6J("isVisible",!0))}function J(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"button",41),c.NdJ("click",function(){return c.CHM(t),c.oxw(3).previousStep()}),c._UZ(1,"mat-icon",42),c._uU(2," Previous "),c.qZA()}}function E(t,e){if(1&t){const t=c.EpF();c.ynx(0),c.TgZ(1,"mat-dialog-content"),c.YNc(2,k,9,3,"div",7),c.YNc(3,T,5,6,"div",8),c.YNc(4,S,5,4,"div",9),c.YNc(5,N,7,1,"div",10),c.qZA(),c.TgZ(6,"mat-dialog-actions"),c.TgZ(7,"button",11),c.NdJ("click",function(){return c.CHM(t),c.oxw(2).close()}),c._uU(8," Cancel "),c.qZA(),c.TgZ(9,"div",12),c.YNc(10,J,3,0,"button",13),c.TgZ(11,"button",14),c.ALo(12,"async"),c.ALo(13,"async"),c._uU(14," Next "),c._UZ(15,"mat-icon",15),c.qZA(),c.qZA(),c.qZA(),c.BQk()}if(2&t){const t=e.ngIf,n=c.oxw(2);c.xp6(2),c.Q6J("ngIf",t===n.Steps.Host),c.xp6(1),c.Q6J("ngIf",t===n.Steps.Info),c.xp6(1),c.Q6J("ngIf",t===n.Steps.Validate),c.xp6(1),c.Q6J("ngIf",t===n.Steps.Finalize),c.xp6(5),c.Q6J("ngIf",t>1),c.xp6(1),c.Q6J("disabled",c.lcZ(12,6,n.loading$)||c.lcZ(13,8,n.disabled$))}}function L(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"form",5),c.NdJ("ngSubmit",function(){return c.CHM(t),c.oxw().nextStep()}),c.YNc(1,E,16,10,"ng-container",6),c.ALo(2,"async"),c.qZA()}if(2&t){const t=c.oxw();c.Q6J("formGroup",t.form),c.xp6(1),c.Q6J("ngIf",c.lcZ(2,2,t.currentStep$))}}var D=function(t){return t[t.Host=1]="Host",t[t.Info=2]="Info",t[t.Validate=3]="Validate",t[t.Finalize=4]="Finalize",t}({});let $=(()=>{class t{constructor(t,e,n,i,o,a,l){this.dialogRef=t,this.data=e,this.customDomains=n,this.toast=i,this.settings=o,this.router=a,this.currentUser=l,this.Steps=D,this.currentStep$=new s.X(1),this.loading$=new s.X(!1),this.disabled$=new s.X(!1),this.updating$=new s.X(!1),this.errors$=new s.X({}),this.validationFailReason$=new s.X(null),this.isSubdomain$=new s.X(!1),this.form=new r.cw({host:new r.NI,global:new r.NI(!1)}),this.updating$.next(!!e.domain),this.currentUserIsAdmin=this.currentUser.isAdmin(),e.domain&&this.form.patchValue(e.domain)}ngOnInit(){this.form.get("host").valueChanges.subscribe(t=>{this.isSubdomain$.next((t.replace("www.","").match(/\./g)||[]).length>1)})}connectDomain(){this.loading$.next(!0),(this.updating$.value?this.customDomains.update(this.data.domain.id,this.form.value):this.customDomains.create(this.form.value)).pipe((0,l.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.toast.open("Domain connected"),this.close(t.domain)},t=>{this.errors$.next(t.errors)})}validateDnsForDomain(){this.disabled$.next(!0),this.loading$.next(!0),this.customDomains.validate(this.form.value.host).pipe((0,l.x)(()=>this.loading$.next(!1))).subscribe(t=>{t&&"connected"===t.result&&this.nextStep()},t=>{this.validationFailReason$.next(t.failReason)})}authorizeCrupdate(){this.loading$.next(!0);const t=Object.assign({},this.form.value);this.data.domain&&(t.domainId=this.data.domain.id),this.customDomains.authorizeCrupdate(t).pipe((0,l.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.serverIp=t.serverIp,this.nextStep(!0)},t=>this.errors$.next(t.errors))}close(t){this.dialogRef.close(t)}previousStep(){this.currentStep$.value>D.Host&&this.currentStep$.next(this.currentStep$.value-1)}nextStep(t=!1){if(this.currentStep$.value===D.Host&&!t)return this.authorizeCrupdate();this.currentStep$.next(this.currentStep$.value+1),this.currentStep$.value===D.Validate?this.data.domain&&this.form.value.host===this.data.domain.host?this.connectDomain():this.validateDnsForDomain():this.currentStep$.value===D.Finalize&&this.connectDomain()}baseUrl(){return this.settings.getBaseUrl().replace(/\/$/,"")}insideAdmin(){return this.router.url.indexOf("admin")>-1}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(a.so),c.Y36(a.WI),c.Y36(d.c),c.Y36(u.F),c.Y36(p.Z),c.Y36(h.F0),c.Y36(g.I))},t.\u0275cmp=c.Xpm({type:t,selectors:[["crupdate-custom-domain-modal"]],decls:7,vars:3,consts:[[1,"modal-header"],["mat-dialog-title","","trans",""],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit",4,"ngIf"],["ngNativeValidate","",3,"formGroup","ngSubmit"],[4,"ngIf"],["class","host-step",4,"ngIf"],["class","info-step",4,"ngIf"],["class","validate-step",4,"ngIf"],["class","finalize-step",4,"ngIf"],["type","button","mat-button","","trans","",1,"cancel-button",3,"click"],[1,"submit-btns"],["mat-button","","color","accent","class","step-btn","type","button","trans","",3,"click",4,"ngIf"],["type","submit","mat-raised-button","","color","accent","trans","",1,"step-btn",3,"disabled"],["svgIcon","keyboard-arrow-right",1,"step-icon"],[1,"host-step"],[1,"input-container"],["for","host","trans",""],["type","text","id","host","formControlName","host","placeholder","https://example.com","maxlength","100","required","",1,"host-input"],["trans",""],["class","error",4,"ngIf"],["class","setting-toggle-container global-toggle",4,"ngIf"],[1,"error"],[1,"setting-toggle-container","global-toggle"],["id","global","formControlName","global","trans",""],[1,"info-step"],[1,"message-widget"],[1,"message"],[1,"validate-step"],["class","message-widget",4,"ngIf","ngIfElse"],["notLoading",""],[1,"small","icon",3,"isVisible"],["trans","",1,"message"],[1,"message-widget","warning-color"],["svgIcon","warning",1,"icon"],["class","message","trans","",3,"transValues",4,"ngIf","ngIfElse"],["dnsNotSetup",""],["type","button","trans","",1,"no-style","refresh-btn",3,"disabled","click"],["trans","",1,"message",3,"transValues"],[1,"finalize-step"],["mat-button","","color","accent","type","button","trans","",1,"step-btn",3,"click"],["svgIcon","keyboard-arrow-left",1,"step-icon"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h2",1),c._uU(2,"Connect Domain"),c.qZA(),c.TgZ(3,"button",2),c.NdJ("click",function(){return e.close()}),c._UZ(4,"mat-icon",3),c.qZA(),c.qZA(),c.YNc(5,L,3,4,"form",4),c.ALo(6,"async")),2&t&&(c.xp6(5),c.Q6J("ngIf",c.lcZ(6,1,e.errors$)))},directives:[a.uh,m.P,f.Hw,b.O5,r.JL,r.sg,a.xY,a.H8,v.lW,r.Fj,r.JJ,r.u,r.nD,r.Q7,_.Rr,x.Q],pipes:[b.Ov,Z.R],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}.host-input[_ngcontent-%COMP%]{font-size:1.6rem}.mat-dialog-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding-top:25px;margin-top:25px;border-top:1px solid var(--be-divider-lighter)}.modal-header[_ngcontent-%COMP%]{border-bottom:1px solid var(--be-divider-lighter);margin-bottom:20px;padding-bottom:25px}.message-widget[_ngcontent-%COMP%]{display:flex;align-items:center;padding:15px;border-radius:4px;background-color:#ecf3ff;color:var(--be-accent-default);font-size:1.6rem}.message-widget[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.message-widget.warning-color[_ngcontent-%COMP%]{background-color:#fef0e2;color:#f77d05}.message-widget[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{flex-shrink:0;position:static;margin-right:15px}p[_ngcontent-%COMP%]{font-size:1.3rem;color:var(--be-secondary-text);margin:8px 0}.mat-button[_ngcontent-%COMP%], .mat-raised-button[_ngcontent-%COMP%]{min-width:105px;line-height:40px}.refresh-btn[_ngcontent-%COMP%]{color:var(--be-accent-default);text-decoration:underline}.step-icon[_ngcontent-%COMP%]{vertical-align:middle;margin-right:5px}.global-toggle[_ngcontent-%COMP%]{border-top:1px solid var(--be-divider-lighter);margin-top:20px;padding-top:20px;margin-bottom:0}@media only screen and (max-width:768px){.cancel-button[_ngcontent-%COMP%]{display:none}}"],changeDetection:0}),t})();var R=n(83381),Y=n(34955),F=n(13536),Q=n(80922),B=n(86668),H=n(27701),V=n(54275),z=n(24311),G=n(71765),j=n(47210),X=n(40985),W=n(2406);function K(t,e){1&t&&c._UZ(0,"mat-progress-bar",17)}function tt(t,e){1&t&&(c.TgZ(0,"th",18),c._uU(1,"Owner"),c.qZA())}const et=function(t){return{count:t,resource:"domain(s)"}};function nt(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"tr"),c.TgZ(1,"th",19),c.TgZ(2,"div",20),c._uU(3," :count :resource selected: "),c.qZA(),c.TgZ(4,"div",21),c.TgZ(5,"button",22),c.NdJ("click",function(){return c.CHM(t),c.oxw().maybeDeleteSelectedDomains()}),c._uU(6," Delete "),c.qZA(),c.qZA(),c.qZA(),c.qZA()}if(2&t){const t=e.ngIf,n=c.oxw();c.xp6(2),c.Q6J("transValues",c.VKq(2,et,t)),c.xp6(3),c.Q6J("disabled",!n.currentUser.hasPermission("custom_domains.delete"))}}function it(t,e){if(1&t&&(c.TgZ(0,"td",34),c._UZ(1,"user-column",35),c.qZA()),2&t){const t=c.oxw().$implicit;c.xp6(1),c.Q6J("user",t.user)}}function ot(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"tr"),c._UZ(1,"td",23),c.TgZ(2,"td",24),c._UZ(3,"img",25),c.ALo(4,"favicon"),c.TgZ(5,"span"),c._uU(6),c.qZA(),c.qZA(),c.YNc(7,it,2,1,"td",26),c.TgZ(8,"td",27),c._uU(9),c.qZA(),c.TgZ(10,"td",28),c._uU(11),c.ALo(12,"formattedDate"),c.qZA(),c.TgZ(13,"td",29),c.TgZ(14,"button",30),c.NdJ("click",function(){const e=c.CHM(t).$implicit;return c.oxw().showCrupdateDomainModal(e)}),c.ALo(15,"trans"),c._UZ(16,"mat-icon",31),c.qZA(),c.TgZ(17,"button",32),c.NdJ("click",function(){const e=c.CHM(t).$implicit;return c.oxw().maybeDeleteSelectedDomains([e.id])}),c._UZ(18,"mat-icon",33),c.qZA(),c.qZA(),c.qZA()}if(2&t){const t=e.$implicit,n=c.oxw();c.xp6(1),c.Q6J("table-body-checkbox",t.id),c.xp6(2),c.Q6J("src",c.lcZ(4,7,t.host),c.LSH),c.xp6(3),c.Oqu(t.host),c.xp6(1),c.Q6J("ngIf",n.showUserColumn()),c.xp6(2),c.Oqu(t.global?"Yes":"No"),c.xp6(2),c.Oqu(c.lcZ(12,9,t.updated_at)),c.xp6(3),c.Q6J("matTooltip",c.lcZ(15,11,"Edit domain"))}}function st(t,e){1&t&&(c.TgZ(0,"no-results-message",36),c.TgZ(1,"span",37),c._uU(2,"No custom domains have been added yet"),c.qZA(),c.qZA())}let at=(()=>{class t{constructor(t,e,n,i,o){this.datatable=t,this.currentUser=e,this.customDomains=n,this.toast=i,this.router=o,this.filters=R.r,this.domains$=this.datatable.data$}ngOnInit(){this.datatable.init({uri:d.c.BASE_URI})}maybeDeleteSelectedDomains(t){this.datatable.confirmResourceDeletion("domains").subscribe(()=>{this.customDomains.delete(t||this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset(),this.toast.open("Domains deleted.")},t=>{this.toast.open(t.message||i.v.Default)})})}showCrupdateDomainModal(t){this.datatable.openCrupdateResourceModal($,{domain:t}).subscribe()}showUserColumn(){return this.router.url.indexOf("admin")>-1}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(o.x),c.Y36(g.I),c.Y36(d.c),c.Y36(u.F),c.Y36(h.F0))},t.\u0275cmp=c.Xpm({type:t,selectors:[["custom-domain-index"]],features:[c._Bn([o.x])],decls:32,vars:13,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","domains",3,"filters"],[1,"action-buttons"],["mat-raised-button","","color","accent",1,"button-with-icon",3,"disabled","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","","trans",""],["table-sort-header","user_id","trans","",4,"ngIf"],["table-sort-header","updated_at","trans",""],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","custom-domain.svg",4,"ngIf"],["mode","indeterminate","color","accent",1,"loading-bar"],["table-sort-header","user_id","trans",""],["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","Host"],["alt","",1,"favicon-img",3,"src"],["data-label","Owner",4,"ngIf"],["data-label","Global"],["data-label","Updated At"],[1,"edit-column"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","edit"],["type","button","mat-icon-button","","trans","",1,"visible-on-mobile",3,"click"],["svgIcon","delete"],["data-label","Owner"],[3,"user"],["svgImage","custom-domain.svg"],["primary-text","","trans",""]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h1",1),c._uU(2,"Custom Domains"),c.qZA(),c.TgZ(3,"div",2),c._UZ(4,"datatable-filters",3),c.TgZ(5,"div",4),c.TgZ(6,"button",5),c.NdJ("click",function(){return e.showCrupdateDomainModal()}),c._UZ(7,"mat-icon",6),c.TgZ(8,"span",1),c._uU(9,"Connect New Domain"),c.qZA(),c.qZA(),c.qZA(),c.qZA(),c.qZA(),c.TgZ(10,"div",7),c.YNc(11,K,1,0,"mat-progress-bar",8),c.ALo(12,"async"),c.TgZ(13,"table",9),c.TgZ(14,"thead"),c.TgZ(15,"tr"),c._UZ(16,"th",10),c.TgZ(17,"th",11),c._uU(18,"Host"),c.qZA(),c.YNc(19,tt,2,0,"th",12),c.TgZ(20,"th",11),c._uU(21,"Global"),c.qZA(),c.TgZ(22,"th",13),c._uU(23,"Last Updated"),c.qZA(),c._UZ(24,"th"),c.qZA(),c.YNc(25,nt,7,4,"tr",14),c.qZA(),c.TgZ(26,"tbody"),c.YNc(27,ot,19,13,"tr",15),c.ALo(28,"async"),c.qZA(),c.qZA(),c.YNc(29,st,3,0,"no-results-message",16),c.ALo(30,"async"),c._UZ(31,"datatable-footer"),c.qZA()),2&t&&(c.xp6(4),c.Q6J("filters",e.filters),c.xp6(2),c.Q6J("disabled",!e.currentUser.hasPermission("custom_domains.create")),c.xp6(5),c.Q6J("ngIf",c.lcZ(12,7,e.datatable.paginator&&e.datatable.paginator.loading$)),c.xp6(8),c.Q6J("ngIf",e.showUserColumn()),c.xp6(6),c.Q6J("ngIf",e.datatable.selectedRows$.value.length),c.xp6(2),c.Q6J("ngForOf",c.lcZ(28,9,e.domains$)),c.xp6(2),c.Q6J("ngIf",c.lcZ(30,11,e.datatable.paginator.noResults$)))},directives:[m.P,Y.h,v.lW,f.Hw,b.O5,F.e,Q.p,b.sg,B.V,H.pW,V.O,z.gM,G.r,j.U],pipes:[b.Ov,X.K,W.l,Z.R],styles:[".favicon-img[_ngcontent-%COMP%]{display:inline-block;margin-right:5px;vertical-align:middle;flex-shrink:0}"],changeDetection:0}),t})()},14732:function(t,e,n){"use strict";n.d(e,{c:function(){return s}});var i=n(35366),o=n(68515);let s=(()=>{class t{constructor(t){this.http=t}index(e={}){return this.http.get(`${t.BASE_URI}`,e)}create(e){return this.http.post(t.BASE_URI,e)}update(e,n){return this.http.put(`${t.BASE_URI}/${e}`,n)}delete(e){return this.http.delete(`${t.BASE_URI}/${e}`)}validate(e){return this.http.post(`${t.BASE_URI}/validate/2BrM45vvfS/api`,{host:e})}authorizeCrupdate(e){return this.http.post(`${t.BASE_URI}/authorize/store`,e)}}return t.BASE_URI="custom-domain",t.\u0275fac=function(e){return new(e||t)(i.LFG(o.r))},t.\u0275prov=i.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},71765:function(t,e,n){"use strict";n.d(e,{r:function(){return d}});var i=n(35366),o=n(60994),s=n(61116),a=n(63337);function r(t,e){if(1&t&&(i.TgZ(0,"a",4),i.TgZ(1,"div"),i._uU(2),i.qZA(),i.TgZ(3,"div",5),i._uU(4),i.qZA(),i.qZA()),2&t){const t=i.oxw(2);i.Q6J("routerLink",t.url.generate(t.user)),i.xp6(2),i.Oqu(t.user.display_name),i.xp6(2),i.Oqu(t.user.email)}}function l(t,e){if(1&t&&(i.TgZ(0,"div",6),i.TgZ(1,"div"),i._uU(2),i.qZA(),i.TgZ(3,"div",5),i._uU(4),i.qZA(),i.qZA()),2&t){const t=i.oxw(2);i.xp6(2),i.Oqu(t.user.display_name),i.xp6(2),i.Oqu(t.user.email)}}function c(t,e){if(1&t&&(i.ynx(0),i._UZ(1,"img",1),i.YNc(2,r,5,3,"a",2),i.YNc(3,l,5,2,"div",3),i.BQk()),2&t){const t=i.oxw();i.xp6(1),i.Q6J("src",t.user.avatar,i.LSH),i.xp6(1),i.Q6J("ngIf",t.haveUrl),i.xp6(1),i.Q6J("ngIf",!t.haveUrl)}}let d=(()=>{class t{constructor(t){this.url=t,this.showEmail=!1,this.haveUrl=!!t.user}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(o.o))},t.\u0275cmp=i.Xpm({type:t,selectors:[["user-column"]],hostAttrs:[1,"column-with-image"],inputs:{user:"user",showEmail:"showEmail"},decls:1,vars:1,consts:[[4,"ngIf"],["alt","",3,"src"],["target","_blank","class","link content",3,"routerLink",4,"ngIf"],["class","content",4,"ngIf"],["target","_blank",1,"link","content",3,"routerLink"],[1,"email","secondary"],[1,"content"]],template:function(t,e){1&t&&i.YNc(0,c,4,3,"ng-container",0),2&t&&i.Q6J("ngIf",e.user)},directives:[s.O5,a.yS],styles:[""],changeDetection:0}),t})()},34955:function(t,e,n){"use strict";n.d(e,{h:function(){return ot}});var i=n(35366),o=n(56515),s=n(56238),a=n(79996),r=n(98720),l=n(43835),c=n(78512),d=n(3080),u=n(31906),p=n(87254),h=n(38116),g=n(61116),m=n(77307);const f=["filterSuggestion"];function b(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"div",8,9),i.NdJ("click",function(){const e=i.CHM(t).$implicit;return i.oxw().filterSelected.emit(e.value)}),i.TgZ(2,"div",10),i._uU(3),i.qZA(),i.TgZ(4,"div",2),i._uU(5),i.qZA(),i.qZA()}if(2&t){const t=e.$implicit,n=e.index;i.uIk("data-filter-key",t.key)("data-index",n),i.xp6(3),i.Oqu(t.value.label),i.xp6(2),i.Oqu(t.value.description)}}let v=(()=>{class t{constructor(){this.filterSelected=new i.vpe,this.originalOrder=()=>0}anyFocused(){return document.activeElement.classList.contains("filter-suggestion-item")}focusItemAt(t){this.items.get(t).nativeElement.focus()}getFocusedFilter(){if(this.anyFocused()){const t=document.activeElement.dataset.filterKey;return this.filters[t]}}getFocusedIndex(){if(this.anyFocused()){const t=document.activeElement;return parseInt(t.dataset.index)}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=i.Xpm({type:t,selectors:[["filter-suggestions"]],viewQuery:function(t,e){if(1&t&&i.Gf(f,5),2&t){let t;i.iGM(t=i.CRH())&&(e.items=t)}},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(t,e){1&t&&(i.TgZ(0,"div",0),i.TgZ(1,"div",1),i.TgZ(2,"div",2),i._uU(3,"Field"),i.qZA(),i.TgZ(4,"div",2),i._uU(5,"Description"),i.qZA(),i.qZA(),i.TgZ(6,"div",3),i.YNc(7,b,6,4,"div",4),i.ALo(8,"keyvalue"),i.qZA(),i.qZA(),i.TgZ(9,"div",5),i._UZ(10,"mat-icon",6),i.TgZ(11,"div",7),i._uU(12," Use arrows, tab or mouse to navigate added filters. Backspace or delete key to remove them. "),i.qZA(),i.qZA()),2&t&&(i.xp6(7),i.Q6J("ngForOf",i.xi3(8,1,e.filters,e.originalOrder)))},directives:[h.P,g.sg,m.Hw],pipes:[g.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 rgba(0,0,0,.2),0 5px 8px 0 rgba(0,0,0,.14),0 1px 14px 0 rgba(0,0,0,.12)}.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}),t})();var _=n(24831),x=n(1486),Z=n(31041),y=n(24859);function w(t,e){if(1&t&&(i.ynx(0),i._UZ(1,"img",2),i.TgZ(2,"div",3),i._uU(3),i.qZA(),i.BQk()),2&t){const t=e.ngIf;i.xp6(1),i.Q6J("src",t.image,i.LSH),i.xp6(2),i.Oqu(t.name)}}function k(t,e){1&t&&(i.TgZ(0,"div",4),i._uU(1,"Click to select"),i.qZA())}let A=(()=>{class t{constructor(t){this.dialog=t,this.value$=new c.X(null)}registerOnChange(t){this.propagateChange=t}registerOnTouched(t){}writeValue(t){this.value$.next(t)}onClick(){this.openSelectModelDialog()}openSelectModelDialog(){this.dialog.open(this.filter.component,this.filter.componentData).afterClosed().subscribe(t=>{t&&(this.value$.next(t),this.propagateChange(t))})}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(y.u))},t.\u0275cmp=i.Xpm({type:t,selectors:[["select-model-control"]],hostBindings:function(t,e){1&t&&i.NdJ("click",function(){return e.onClick()})},inputs:{filter:"filter"},features:[i._Bn([{provide:Z.JU,useExisting:t,multi:!0}])],decls:4,vars:4,consts:[[4,"ngIf","ngIfElse"],["defaultHint",""],[1,"image",3,"src"],[1,"name"],["trans",""]],template:function(t,e){if(1&t&&(i.YNc(0,w,4,2,"ng-container",0),i.ALo(1,"async"),i.YNc(2,k,2,0,"ng-template",null,1,i.W1O)),2&t){const t=i.MAs(3);i.Q6J("ngIf",i.lcZ(1,2,e.value$))("ngIfElse",t)}},directives:[g.O5,h.P],pipes:[g.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;-o-object-fit:cover;object-fit:cover}"],changeDetection:0}),t})();const C={"=":"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 T=n(71294);let q=(()=>{class t{constructor(t){this.breakpoints=t}transform(t,e){return e||this.breakpoints.isMobile$.value?t:C[t]}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(T.S,16))},t.\u0275pipe=i.Yjl({name:"operatorDisplayName",type:t,pure:!0}),t})();const I=["select"];function O(t,e){if(1&t&&(i.TgZ(0,"option",4),i._uU(1),i.ALo(2,"operatorDisplayName"),i.qZA()),2&t){const t=e.$implicit,n=i.oxw();i.Q6J("value",t),i.xp6(1),i.hij(" ",i.xi3(2,2,t,n.compact)," ")}}let U=(()=>{class t{ngAfterViewInit(){this.resizeSelect()}resizeSelect(){var t;const e=null===(t=this.select)||void 0===t?void 0:t.nativeElement;e&&e.selectedIndex>-1&&(e.style.width=`${e.options[e.selectedIndex].label.length+5}ch`)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=i.Xpm({type:t,selectors:[["operator-select"]],viewQuery:function(t,e){if(1&t&&i.Gf(I,5),2&t){let t;i.iGM(t=i.CRH())&&(e.select=t.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(t,e){1&t&&(i.ynx(0,0),i.TgZ(1,"select",1,2),i.NdJ("ngModelChange",function(){return e.resizeSelect()}),i.YNc(3,O,3,5,"option",3),i.qZA(),i.BQk()),2&t&&(i.Q6J("formGroup",e.formGroup),i.xp6(3),i.Q6J("ngForOf",e.operators))},directives:[Z.JL,Z.sg,Z.EJ,Z.JJ,Z.u,g.sg,Z.YN,Z.Kr],pipes:[q],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;-moz-text-align-last:center;text-align-last:center;border:1px solid transparent}.operator-select[_ngcontent-%COMP%]:focus-visible{outline:0;border-color:var(--be-accent-default);box-shadow:0 0 0 1px #fff}'],changeDetection:0}),t})();const P=["valueInput"];function M(t,e){if(1&t&&i._UZ(0,"operator-select",8),2&t){const t=i.oxw().ngIf,e=i.oxw();i.Q6J("compact",e.compact)("formGroup",t)("operators",e.filter.operators)}}function S(t,e){if(1&t&&(i.TgZ(0,"option",16),i._uU(1),i.qZA()),2&t){const t=e.$implicit;i.Q6J("ngValue",t.value),i.xp6(1),i.hij(" ",t.key||t.value," ")}}function N(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"div",9),i.TgZ(1,"select",10,11),i.NdJ("ngModelChange",function(){return i.CHM(t),i.oxw(2).resizeInput()}),i.YNc(3,S,2,2,"option",12),i.qZA(),i.O4$(),i.TgZ(4,"svg",13),i._UZ(5,"path",14),i._UZ(6,"path",15),i.qZA(),i.qZA()}if(2&t){const t=i.oxw(2);i.xp6(1),i.Q6J("id",t.key)("compareWith",t.compareFilterValueFn),i.xp6(2),i.Q6J("ngForOf",t.filter.options)}}function J(t,e){if(1&t&&(i.TgZ(0,"div",17),i._UZ(1,"input",18,11),i.qZA()),2&t){const t=i.oxw(2);i.xp6(1),i.Q6J("id",t.key)}}function E(t,e){if(1&t&&i._UZ(0,"select-model-control",19,11),2&t){const t=i.oxw(2);i.Q6J("filter",t.filter)("id",t.key)}}function L(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"div",9),i.TgZ(1,"input",20,11),i.NdJ("ngModelChange",function(){return i.CHM(t),i.oxw(2).resizeInput()}),i.qZA(),i.qZA()}if(2&t){const t=i.oxw(2);i.xp6(1),i.Q6J("id",t.key)("type",t.filter.inputType||"text")}}function D(t,e){if(1&t){const t=i.EpF();i.ynx(0,1),i.TgZ(1,"div",2),i.NdJ("click",function(){return i.CHM(t),i.oxw().el.nativeElement.focus()}),i._uU(2),i.qZA(),i.YNc(3,M,1,3,"operator-select",3),i.ynx(4,4),i.YNc(5,N,7,3,"div",5),i.YNc(6,J,3,1,"div",6),i.YNc(7,E,2,2,"select-model-control",7),i.YNc(8,L,3,2,"div",5),i.BQk(),i.BQk()}if(2&t){const t=e.ngIf,n=i.oxw();i.Q6J("formGroup",t),i.xp6(2),i.Oqu(n.filter.label),i.xp6(1),i.Q6J("ngIf",n.filter.operators),i.xp6(1),i.Q6J("ngSwitch",n.filter.type),i.xp6(1),i.Q6J("ngSwitchCase","select"),i.xp6(1),i.Q6J("ngSwitchCase","datePicker"),i.xp6(1),i.Q6J("ngSwitchCase","selectModel"),i.xp6(1),i.Q6J("ngSwitchCase","input")}}let $=(()=>{class t{constructor(t){this.el=t,this.compareFilterValueFn=(t,e)=>x(t,e)}ngAfterViewInit(){this.resizeInput()}focus(){this.el.nativeElement.focus()}focusValueInput(){var t;this.valueInput instanceof A?this.valueInput.openSelectModelDialog():(null===(t=this.valueInput)||void 0===t?void 0:t.nativeElement)&&this.valueInput.nativeElement.focus()}resizeInput(){var t;const e=null===(t=this.valueInput)||void 0===t?void 0:t.nativeElement;if("SELECT"===(null==e?void 0:e.nodeName)){const t=e;t.selectedIndex>-1&&(t.style.width=`${t.options[t.selectedIndex].label.length+5}ch`)}else"INPUT"===(null==e?void 0:e.nodeName)&&"date"!==e.type&&(e.style.width=`${e.value.length+7}ch`)}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(i.SBq))},t.\u0275cmp=i.Xpm({type:t,selectors:[["active-filter"]],viewQuery:function(t,e){if(1&t&&i.Gf(P,5),2&t){let t;i.iGM(t=i.CRH())&&(e.valueInput=t.first)}},hostAttrs:["tabIndex","0","role","button"],hostVars:1,hostBindings:function(t,e){2&t&&i.uIk("data-control-key",e.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,"filter","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,"filter","id"],["formControlName","value","min","1","required","",1,"filter-input","filter-value",3,"id","type","ngModelChange"]],template:function(t,e){1&t&&i.YNc(0,D,9,8,"ng-container",0),2&t&&i.Q6J("ngIf",e.form.controls[e.key])},directives:[g.O5,Z.JL,Z.sg,h.P,g.RF,g.n9,U,Z.EJ,Z.JJ,Z.u,g.sg,Z.YN,Z.Kr,Z.Fj,A,Z.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;-moz-user-select:none;-ms-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}),t})();function R(t,e){if(1&t&&i._UZ(0,"active-filter",2),2&t){const t=e.ngIf,n=i.oxw(),o=n.$implicit,s=n.index,a=i.oxw();i.Q6J("compact",a.compact)("key",o.key)("form",a.form)("filter",t),i.uIk("data-index",s)}}function Y(t,e){if(1&t&&(i.ynx(0),i.YNc(1,R,1,5,"active-filter",1),i.BQk()),2&t){const t=e.$implicit,n=i.oxw();i.xp6(1),i.Q6J("ngIf",n.config[t.value.value.key])}}const F=["*"];let Q=(()=>{class t{constructor(t,e,n){this.fb=t,this.cd=e,this.el=n}add(t,e={}){const n=void 0!==e.value?e.value:t.defaultValue,i=this.fb.group({key:t.key,value:n,operator:e.operator||t.defaultOperator}),o=Object.keys(this.form.controls).length+(0,_.O)(8);this.form.addControl(o,i,{emitEvent:""!==n}),this.cd.detectChanges(),e.focus&&this.filters.last.focusValueInput()}removeByKey(t){this.form.removeControl(t),this.cd.markForCheck()}removeCurrentlyFocused(){const t=document.activeElement;this.removeByKey(t.dataset.controlKey)}anyFocused(){return"ACTIVE-FILTER"===document.activeElement.nodeName}focusLast(){this.filters.last&&this.filters.last.focus()}focusPrevious(){const t=this.getFocusedIndex(),e=this.filters.get(t-1);e&&e.focus()}getByIndex(t){return this.filters.get(t)}lastIsFocused(){return this.getFocusedIndex()===this.filters.length-1}getFocusedIndex(){const t=document.activeElement.dataset.index;return t?parseInt(t):null}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(Z.qu),i.Y36(i.sBO),i.Y36(i.SBq))},t.\u0275cmp=i.Xpm({type:t,selectors:[["active-filters"]],viewQuery:function(t,e){if(1&t&&i.Gf($,5),2&t){let t;i.iGM(t=i.CRH())&&(e.filters=t)}},inputs:{compact:"compact",form:"form",config:"config"},ngContentSelectors:F,decls:3,vars:3,consts:[[4,"ngFor","ngForOf"],[3,"compact","key","form","filter",4,"ngIf"],[3,"compact","key","form","filter"]],template:function(t,e){1&t&&(i.F$t(),i.YNc(0,Y,2,1,"ng-container",0),i.ALo(1,"keyvalue"),i.Hsn(2)),2&t&&i.Q6J("ngForOf",i.lcZ(1,1,e.form.controls))},directives:[g.sg,g.O5,$],pipes:[g.Nd],styles:["[_nghost-%COMP%]{display:flex;flex:1 1 auto;flex-wrap:wrap;align-items:center}"],changeDetection:0}),t})();var B=n(63337),H=function(t){return t[t.ENTER=13]="ENTER",t[t.SPACE=32]="SPACE",t[t.ESCAPE=27]="ESCAPE",t[t.DELETE=46]="DELETE",t[t.ARROW_UP=38]="ARROW_UP",t[t.ARROW_RIGHT=39]="ARROW_RIGHT",t[t.ARROW_DOWN=40]="ARROW_DOWN",t[t.ARROW_LEFT=37]="ARROW_LEFT",t[t.BACKSPACE=8]="BACKSPACE",t[t.TAB=9]="TAB",t[t.S=83]="S",t[t.N=78]="N",t[t.A=65]="A",t[t.T=84]="T",t[t.B=66]="B",t[t.C=67]="C",t[t.O=79]="O",t[t.P=80]="P",t[t.R=82]="R",t[t.F=70]="F",t[t.Y=89]="Y",t[t.Z=90]="Z",t}({});let V=(()=>{class t{constructor(){this.bindings=[]}add(t,e){Array.isArray(t)||(t=[t]),t.forEach(t=>{this.bindings.push({keybind:this.parseKeybindString(t),keybindString:t,callback:e})})}addWithPreventDefault(t,e){this.bindings.push({keybind:this.parseKeybindString(t),keybindString:t,callback:e,preventDefault:!0})}listenOn(t,e={}){return(0,p.R)(t,"keydown").subscribe(t=>{!e.fireIfInputFocused&&["input","select"].includes(document.activeElement.nodeName.toLowerCase())||this.executeBindings(t)})}executeBindings(t){this.bindings.forEach(e=>{this.bindingMatches(e.keybind,t)&&(e.preventDefault&&t.preventDefault&&t.preventDefault(),e.callback(t))})}bindingMatches(t,e){return H[t.key.toUpperCase()]===e.keyCode&&(e.ctrlKey===t.ctrl||e.metaKey===t.ctrl)&&e.shiftKey===t.shift}parseKeybindString(t){const e=t.trim().split("+"),n={ctrl:!1,shift:!1,key:""};return e.forEach(t=>{"ctrl"===(t=t.trim().toLowerCase())?n.ctrl=!0:"shift"===t?n.shift=!0:n.key=t}),n}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=i.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var z=n(84369),G=n(40450);const j=["searchInput"],X=["filterSuggestion"];function W(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"button",8),i.NdJ("click",function(){return i.CHM(t),i.oxw().clearSearch()}),i._UZ(1,"mat-icon",9),i.qZA()}}function K(t,e){1&t&&(i.TgZ(0,"span",13),i._uU(1,"Filter"),i.qZA())}function tt(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"button",10),i.NdJ("click",function(){return i.CHM(t),i.oxw().toggleFilterDropdown()}),i._UZ(1,"mat-icon",11),i.YNc(2,K,2,0,"span",12),i.qZA()}if(2&t){const t=i.oxw();i.xp6(2),i.Q6J("ngIf",!t.compact)}}let et=(()=>{class t{constructor(t,e,n,o,s,a){this.fb=t,this.route=e,this.el=n,this.keybinds=o,this.cd=s,this.router=a,this.filterChange=new i.vpe,this.inputFocus=new i.vpe,this.form=this.fb.group({}),this.filterBarHeight=0,this.filterDropdownVisible$=new c.X(!1)}set filters(t){t?(this.keyedFilters={},(t||[]).forEach(t=>{this.keyedFilters[t.key]=t})):this.keyedFilters=null}ngOnInit(){this.haveFiltersOrQuery$=(0,d.aj)([this.searchControl.valueChanges.pipe((0,s.O)(null)),this.form.valueChanges.pipe((0,s.O)(null))]).pipe((0,a.U)(([t,e])=>t||e&&0!==Object.keys(e).length))}ngAfterViewInit(){this.watchForSizeChanges(),this.setFiltersFromQuery(),this.setupKeybinds(),this.subscribeToCloseActions(),this.bindToFormValueChange()}onClick(t){t.target!==this.el.nativeElement&&t.target!==this.activeFilters.el.nativeElement||this.searchInput.nativeElement.focus()}ngOnDestroy(){var t;null===(t=this.closeActionsStream$)||void 0===t||t.unsubscribe()}clearSearch(){Object.keys(this.form.controls).forEach(t=>{this.activeFilters.removeByKey(t)}),this.searchControl.reset(null,{emitEvent:!1}),this.form.reset()}toggleFilterDropdown(){this.filterDropdownVisible$.next(!this.filterDropdownVisible$.value)}addFilterFromDropdownClick(t){this.activeFilters.add(t,{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,a.U)(t=>Object.keys(t).length?t:null),(0,r.x)()).subscribe(t=>{this.filterChange.emit(t?nt(t):null)})}watchForSizeChanges(){new ResizeObserver(t=>{this.filterBarHeight=t[0].contentRect.height}).observe(this.el.nativeElement,{box:"border-box"})}setFiltersFromQuery(){const t=this.router.routerState.root.snapshot.queryParams;t.filters&&it(t.filters).forEach(t=>{this.activeFilters.add(this.keyedFilters[t.key],t)}),t.query&&this.searchControl.setValue(t.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",t=>{this.cursorAtStartOfSearchInput()?(this.activeFilters.focusLast(),t.preventDefault()):this.activeFilters.anyFocused()&&(this.activeFilters.focusPrevious(),t.preventDefault())}),this.keybinds.add("arrow_right",t=>{if(this.activeFilters.anyFocused()){t.preventDefault();const e=this.activeFilters.getFocusedIndex(),n=this.activeFilters.getByIndex(e+1);n?n.focus():this.activeFilters.lastIsFocused()&&this.searchInput.nativeElement.focus()}}),this.keybinds.add(["arrow_down","tab"],t=>{if(this.cursorAtEndOfSearchInput()||this.suggestions.anyFocused()){t.preventDefault(),this.filterDropdownVisible$.value||this.toggleFilterDropdown();const e=this.suggestions.getFocusedIndex();let n=e>-1?e:0;this.suggestions.anyFocused()&&(n+=1),n>=this.suggestions.items.length&&(n=0),this.suggestions.focusItemAt(n)}}),this.keybinds.add(["arrow_up","shift+tab"],t=>{if(this.suggestions.anyFocused()){t.preventDefault();const e=this.activeFilters.getFocusedIndex();let n=e>-1?e:0;n-=1,-1===n?this.searchInput.nativeElement.focus():this.suggestions.focusItemAt(n)}}),this.keybinds.add("enter",t=>{const e=this.suggestions.getFocusedFilter();e&&(t.preventDefault(),this.activeFilters.add(e,{focus:!0}),this.filterDropdownVisible$.next(!1))}),this.keybinds.add("esc",t=>{this.filterDropdownVisible$.value&&(t.preventDefault(),this.filterDropdownVisible$.next(!1))}),this.keybinds.listenOn(document,{fireIfInputFocused:!0})}subscribeToCloseActions(){this.closeActionsStream$=(0,u.T)((0,p.R)(document,"click"),(0,p.R)(document,"auxclick"),(0,p.R)(document,"touchend")).pipe((0,l.h)(t=>{const e=t.target;return e!==this.el.nativeElement&&!this.el.nativeElement.contains(e)})).subscribe(()=>{this.filterDropdownVisible$.next(!1)})}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(Z.qu),i.Y36(B.gz),i.Y36(i.SBq),i.Y36(V),i.Y36(i.sBO),i.Y36(B.F0))},t.\u0275cmp=i.Xpm({type:t,selectors:[["search-input-with-filters"]],viewQuery:function(t,e){if(1&t&&(i.Gf(j,5),i.Gf(v,5),i.Gf(Q,5),i.Gf(X,5)),2&t){let t;i.iGM(t=i.CRH())&&(e.searchInput=t.first),i.iGM(t=i.CRH())&&(e.suggestions=t.first),i.iGM(t=i.CRH())&&(e.activeFilters=t.first),i.iGM(t=i.CRH())&&(e.filterContainers=t)}},hostBindings:function(t,e){1&t&&i.NdJ("click",function(t){return e.onClick(t)})},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(t,e){1&t&&(i.TgZ(0,"active-filters",0),i.TgZ(1,"div",1),i._UZ(2,"mat-icon",2),i.TgZ(3,"input",3,4),i.NdJ("focus",function(){return e.inputFocus.emit()}),i.ALo(5,"trans"),i.qZA(),i.qZA(),i.qZA(),i.YNc(6,W,2,0,"button",5),i.ALo(7,"async"),i.YNc(8,tt,3,1,"button",6),i.TgZ(9,"filter-suggestions",7),i.NdJ("filterSelected",function(t){return e.addFilterFromDropdownClick(t)}),i.ALo(10,"async"),i.qZA()),2&t&&(i.Q6J("form",e.form)("config",e.keyedFilters)("compact",e.compact),i.xp6(3),i.Q6J("placeholder",i.lcZ(5,12,"Type to search for "+e.pluralName))("formControl",e.searchControl),i.xp6(3),i.Q6J("ngIf",i.lcZ(7,14,e.haveFiltersOrQuery$)),i.xp6(2),i.Q6J("ngIf",e.keyedFilters),i.xp6(1),i.Udp("top",e.filterBarHeight+5+"px"),i.ekj("visible",i.lcZ(10,16,e.filterDropdownVisible$)),i.Q6J("filters",e.keyedFilters))},directives:[Q,m.Hw,Z.Fj,Z.JJ,Z.oH,g.O5,v,z.lW,h.P],pipes:[G.R,g.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}),t})();const nt=t=>{const e=[];return Object.values(t).forEach(t=>{""!==t.value&&e.push(t)}),e.length?encodeURIComponent(btoa(JSON.stringify(e))):""},it=t=>{let e=[];try{e=JSON.parse(atob(decodeURIComponent(t)))}catch(n){}return e};let ot=(()=>{class t{constructor(t){this.datable=t}onFilterChange(t){this.datable.filters$.next({filters:t})}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(o.x))},t.\u0275cmp=i.Xpm({type:t,selectors:[["datatable-filters"]],inputs:{pluralName:"pluralName",filters:"filters"},decls:1,vars:3,consts:[[3,"searchControl","pluralName","filters","filterChange"]],template:function(t,e){1&t&&(i.TgZ(0,"search-input-with-filters",0),i.NdJ("filterChange",function(t){return e.onFilterChange(t)}),i.qZA()),2&t&&i.Q6J("searchControl",e.datable.searchControl)("pluralName",e.pluralName)("filters",e.filters)},directives:[et],styles:[""],changeDetection:0}),t})()},59075:function(t,e,n){"use strict";n.d(e,{XQ:function(){return i},Bq:function(){return o},pg:function(){return s},Hi:function(){return a}});class i{constructor(t){this.defaultValue=void 0!==t.defaultValue?t.defaultValue:"",this.key=t.key||"",this.label=t.label||t.key||"",this.description=t.description||"",this.defaultOperator=t.defaultOperator||s.eq,this.required=!!t.required,this.order=void 0===t.order?1:t.order,this.type=t.type||o.Select,this.inputType=t.inputType,this.options=t.options||[],this.operators=t.operators,this.component=t.component,this.componentData=t.componentData}}var o=function(t){return t.Select="select",t.DatePicker="datePicker",t.SelectModel="selectModel",t.Input="input",t.StaticValue="staticValue",t}({}),s=function(t){return t.eq="=",t.ne="!=",t.gt=">",t.gte=">=",t.lt="<",t.lte="<=",t.has="has",t.doesntHave="doesntHave",t}({});const a=[s.eq,s.ne,s.gt,s.gte,s.lt,s.lte]},45523:function(t,e,n){"use strict";n.d(e,{k4:function(){return o},T7:function(){return s},yH:function(){return a}});var i=n(59075);class o extends i.XQ{constructor(){super(...arguments),this.type=i.Bq.DatePicker,this.operators=i.Hi,this.defaultOperator=i.pg.lte,this.defaultValue=(new Date).toISOString().split("T")[0]}}class s extends o{constructor(){super(...arguments),this.key="created_at",this.label="Created At"}}class a extends o{constructor(){super(...arguments),this.key="updated_at",this.label="Updated At"}}},86668:function(t,e,n){"use strict";n.d(e,{V:function(){return m}});var i=n(31041),o=n(43835),s=n(79996),a=n(35366),r=n(56515),l=n(61116),c=n(84369),d=n(77307),u=n(38116),p=n(40450);function h(t,e){if(1&t&&(a.TgZ(0,"div",6),a.TgZ(1,"div",7),a._uU(2,"Items per page"),a.qZA(),a.TgZ(3,"div",8),a.TgZ(4,"select",9),a.TgZ(5,"option",10),a._uU(6,"10"),a.qZA(),a.TgZ(7,"option",10),a._uU(8,"15"),a.qZA(),a.TgZ(9,"option",10),a._uU(10,"20"),a.qZA(),a.TgZ(11,"option",10),a._uU(12,"50"),a.qZA(),a.TgZ(13,"option",10),a._uU(14,"100"),a.qZA(),a.qZA(),a.qZA(),a.qZA()),2&t){const t=a.oxw();a.xp6(4),a.Q6J("formControl",t.perPageControl),a.xp6(1),a.Q6J("ngValue",10),a.xp6(2),a.Q6J("ngValue",15),a.xp6(2),a.Q6J("ngValue",20),a.xp6(2),a.Q6J("ngValue",50),a.xp6(2),a.Q6J("ngValue",100)}}function g(t,e){if(1&t&&(a.TgZ(0,"div",11),a._uU(1),a.ALo(2,"trans"),a.ALo(3,"number"),a.qZA()),2&t){const t=a.oxw();a.xp6(1),a.HOy(" ",t.from," - ",t.to," ",a.lcZ(2,4,"of")," ",a.lcZ(3,6,t.totalRecords)," ")}}let m=(()=>{class t{constructor(t,e){this.datable=t,this.cd=e,this.hidePerPage=!1,this.perPageControl=new i.NI(15)}ngOnInit(){this.changeRef=this.datable.paginator.response$.pipe((0,o.h)(t=>!!(null==t?void 0:t.pagination)),(0,s.U)(t=>t.pagination)).subscribe(t=>{this.totalRecords=t.total,this.to=Math.min(t.per_page*t.current_page,this.totalRecords),this.from=Math.max(this.to-t.per_page,1),this.havePrevious=this.datable.paginator.canLoadPrevPage(),this.haveNext=this.datable.paginator.canLoadNextPage(),this.perPageControl.setValue(parseInt(""+t.per_page),{emitEvent:!1}),this.cd.markForCheck()}),this.perPageControl.valueChanges.subscribe(t=>{this.datable.paginator.changePerPage(t)})}ngOnDestroy(){this.changeRef.unsubscribe(),this.datable.destroy()}previousPage(){this.datable.paginator.previousPage()}nextPage(){this.datable.paginator.nextPage()}}return t.\u0275fac=function(e){return new(e||t)(a.Y36(r.x),a.Y36(a.sBO))},t.\u0275cmp=a.Xpm({type:t,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(t,e){1&t&&(a.YNc(0,h,15,6,"div",0),a.TgZ(1,"div",1),a.YNc(2,g,4,8,"div",2),a.TgZ(3,"button",3),a.NdJ("click",function(){return e.previousPage()}),a.ALo(4,"async"),a._UZ(5,"mat-icon",4),a.qZA(),a.TgZ(6,"button",3),a.NdJ("click",function(){return e.nextPage()}),a.ALo(7,"async"),a._UZ(8,"mat-icon",5),a.qZA(),a.qZA()),2&t&&(a.Q6J("ngIf",!e.hidePerPage),a.xp6(2),a.Q6J("ngIf",e.from&&e.to&&e.totalRecords),a.xp6(1),a.Q6J("disabled",!e.havePrevious||a.lcZ(4,4,e.datable.paginator.loading$)),a.xp6(3),a.Q6J("disabled",!e.haveNext||a.lcZ(7,6,e.datable.paginator.loading$)))},directives:[l.O5,c.lW,d.Hw,u.P,i.EJ,i.JJ,i.oH,i.YN,i.Kr],pipes:[l.Ov,p.R,l.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}),t})()},51685:function(t,e,n){"use strict";n.d(e,{x:function(){return _}});var i=n(61116),o=n(77307),s=n(68400),a=n(40994),r=n(31041),l=n(84369),c=n(95522),d=n(27701),u=n(56160),p=n(58666),h=n(50615),g=n(92935),m=n(99808),f=n(35366);let b=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=f.oAB({type:t}),t.\u0275inj=f.cJS({imports:[[i.ez,s.N,r.UX,o.Ps,l.ot,g.Is,m.p]]}),t})();var v=n(63337);let _=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=f.oAB({type:t}),t.\u0275inj=f.cJS({imports:[[i.ez,s.N,r.UX,r.u5,u.G,p.u,h.X,b,v.Bz,l.ot,o.Ps,a.p9,c.Hi,d.Cv],a.p9]}),t})()},56515:function(t,e,n){"use strict";n.d(e,{x:function(){return T}});var i=n(78512),o=n(3080),s=n(91741),a=n(40878),r=n(79996),l=n(44689),c=n(66599),d=n(35366),u=n(63337),p=n(68515),h=n(36402);let g=(()=>{class t{constructor(t,e,n){this.router=t,this.http=e,this.localStorage=n,this.params$=new i.X({}),this.paginatedOnce$=new i.X(!1),this.loading$=new i.X(!1),this.response$=new i.X(null),this.dontUpdateQueryParams=!1,this.perPageCacheKey=null,this.noResults$=this.response$.pipe((0,r.U)(t=>this.paginatedOnce$.value&&0===t.pagination.data.length))}get params(){return this.params$.value}get currentPage(){var t,e;return null===(e=null===(t=this.response$.value)||void 0===t?void 0:t.pagination)||void 0===e?void 0:e.current_page}paginate(t={},e,n){const i=this.subscription?{}:this.currentQueryParams();this.params$.next(Object.assign(Object.assign(Object.assign({},this.response$.value?{perPage:this.response$.value.pagination.per_page,page:this.response$.value.pagination.current_page}:{}),i),t)),this.subscription||this.init(e,n)}nextPage(){const t=this.response$.value.pagination.current_page||0;this.paginate(Object.assign(Object.assign({},this.params$.value),{page:t+1,cursor:this.response$.value.pagination.next_cursor}))}previousPage(){const t=this.response$.value.pagination.current_page;this.paginate(Object.assign(Object.assign({},this.params$.value),{page:t-1||1,cursor:this.response$.value.pagination.prev_cursor}))}changePerPage(t){var e;t!==(null===(e=this.params$.value)||void 0===e?void 0:e.perPage)&&(this.perPageCacheKey&&this.localStorage.set(this.perPageCacheKey,t),this.paginate(Object.assign(Object.assign({},this.params$.value),{perPage:t})))}currentQueryParams(){return this.router.routerState.root.snapshot.queryParams}init(t,e){this.subscription=this.params$.pipe((0,l.w)(n=>{this.loading$.next(!0);const i=!this.paginatedOnce$.value;return i&&this.perPageCacheKey&&this.localStorage.get(this.perPageCacheKey)&&(n=Object.assign({perPage:this.localStorage.get(this.perPageCacheKey)},n)),(i&&e?(0,a.of)({pagination:e}):this.http.get(t,n)).pipe((0,c.b)(()=>{this.updateQueryParams(n),this.loading$.next(!1),this.paginatedOnce$.next(!0)},()=>{this.loading$.next(!1),this.paginatedOnce$.next(!0)}))})).subscribe(t=>{this.response$.next(t)})}updateQueryParams(t={}){if(!this.dontUpdateQueryParams){for(const e in t)Array.isArray(t[e])&&(t[e]=t[e].join(","));this.router.navigate([],{queryParams:t,replaceUrl:!0})}}canLoadNextPage(){var t;const e=null===(t=this.response$.value)||void 0===t?void 0:t.pagination;return!!e&&(!!e.next_cursor||this.currentPage<e.last_page)}canLoadPrevPage(){var t;const e=null===(t=this.response$.value)||void 0===t?void 0:t.pagination;return!!e&&(!!e.prev_cursor||this.currentPage>1)}}return t.\u0275fac=function(e){return new(e||t)(d.LFG(u.F0),d.LFG(p.r),d.LFG(h.m))},t.\u0275prov=d.Yz7({token:t,factory:t.\u0275fac}),t})();var m=n(47701),f=n(62855),b=n(43835),v=n(73709),_=n(4694),x=n(72798),Z=n(52907),y=n(19861);function w(t,e){const n=Z.pick(e,t);if((0,y.t6)(n)){const t=Number(n);return t<9007199254740991?t:n}return n}var k=n(9636),A=n(31041),C=n(24859);let T=(()=>{class t{constructor(t,e,n,o){this.modal=t,this.router=e,this.http=n,this.localStorage=o,this.sort$=new i.X({}),this.filters$=new i.X({}),this.searchControl=new A.NI,this.searchTerm$=new i.X(null),this.staticParams$=new i.X({}),this.paginator=new g(this.router,this.http,this.localStorage),this.ignoreNextParamChange=!1,this.originalData$=new i.X([]),this.data$=new i.X([]),this.selectedRows$=new i.X([])}get data(){return this.data$.value}set data(t){const e=[...t];this.originalData$.next(e),this.data$.next(e),this.ignoreNextParamChange=!0,this.reset()}init(t={}){if(this.config=t,this.staticParams$.next(Object.assign(Object.assign({},this.staticParams$.value),t.staticParams)),t.uri?this.connectToPaginator():t.initialData&&(this.data=t.initialData),t.uri){const t=this.router.routerState.root.snapshot.queryParams,e=t.query;this.searchControl.setValue(e),this.searchTerm$.next(e),this.sort$.next({orderBy:t.orderBy,orderDir:t.orderDir})}return this.searchControlSub=this.searchControl.valueChanges.pipe((0,m.b)(300)).subscribe(t=>{this.searchTerm$.next(t)}),this.mainSub=(0,o.aj)([this.sort$,this.filters$,this.searchTerm$.pipe((0,r.U)(t=>({query:t}))),this.staticParams$]).pipe((0,m.b)(0,s.Z),(0,r.U)(t=>Object.assign({},...t))).subscribe(t=>{if(this.ignoreNextParamChange)return this.ignoreNextParamChange=!1;t=(0,v.N)(t),Object.entries(t).forEach(([e,n])=>{"object"==typeof n&&n.id&&(t[`${e}Id`]=n.id,delete t[e])}),this.config.uri?this.paginator.paginate(t,this.config.uri,this.config.initialData):Object.keys(t).length&&this.data.length&&this.applyLocalTransforms(t)}),this}connectToPaginator(){this.paginatorSub=this.paginator.response$.pipe((0,f.G)()).subscribe(([t,e])=>{var n;const i=this.config.infiniteScroll&&(null===(n=null==t?void 0:t.pagination)||void 0===n?void 0:n.current_page)!==e.pagination.current_page?[...this.data$.value,...e.pagination.data]:e.pagination.data;this.data$.next(i)})}applyLocalTransforms(t){let e=[...this.originalData$.value];t.query&&(e=(0,k.D)(e,t.query)),t.orderBy&&t.orderDir&&(e=function(t,e,n){return t.sort((t,i)=>{let o=w(t,e),s=w(i,e);const a=typeof o,r=typeof s;a!==r&&("number"===a&&(o+=""),"number"===r&&(s+=""));let l=0;return null!=o&&null!=s?o>s?l=1:o<s&&(l=-1):null!=o?l=1:null!=s&&(l=-1),l*("asc"===n?1:-1)})}(e,t.orderBy,t.orderDir)),this.data$.next(e)}addFilter(t,e){this.filters$.next(Object.assign(Object.assign({},this.filters$.value),{[t]:e}))}removeFilter(t){const e=Object.assign({},this.filters$.value);delete e[t],this.filters$.next(e)}reset(t=null){this.filters$.next({}),this.sort$.next({}),this.selectedRows$.next([]),t&&this.staticParams$.next(t)}openCrupdateResourceModal(t,e,n){return this.modal.open(t,e,n).beforeClosed().pipe((0,b.h)(t=>!!t),(0,c.b)(()=>this.reset()))}confirmResourceDeletion(t){const e=Object.assign(Object.assign({},x.M),{replacements:{resource:t}});return this.modal.open(_.z,e).afterClosed().pipe((0,b.h)(t=>t))}getCurrentParams(){return Object.assign(Object.assign(Object.assign(Object.assign({},this.sort$.value),this.filters$.value),this.staticParams$.value),this.paginator.params)}destroy(){var t,e,n;null===(t=this.paginatorSub)||void 0===t||t.unsubscribe(),null===(e=this.mainSub)||void 0===e||e.unsubscribe(),null===(n=this.searchControlSub)||void 0===n||n.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(d.LFG(C.u),d.LFG(u.F0),d.LFG(p.r),d.LFG(h.m))},t.\u0275prov=d.Yz7({token:t,factory:t.\u0275fac}),t})()},72798:function(t,e,n){"use strict";n.d(e,{M:function(){return i}});const i={title:"Delete :resource",body:"Are you sure you want to delete selected :resource?",ok:"Delete"}},54275:function(t,e,n){"use strict";n.d(e,{O:function(){return r}});var i=n(35366),o=n(56515),s=n(40994);const a=["table-body-checkbox",""];let r=(()=>{class t{constructor(t,e){this.datatable=t,this.cd=e}ngOnInit(){this.changeRef=this.datatable.selectedRows$.subscribe(t=>{this.cd.markForCheck()})}ngOnDestroy(){this.changeRef.unsubscribe()}isRowSelected(t){return this.datatable.selectedRows$.value.indexOf(t)>-1}toggleRow(t){if(this.isRowSelected(t)){const e=this.datatable.selectedRows$.value.slice(),n=this.datatable.selectedRows$.value.indexOf(t);e.splice(n,1),this.datatable.selectedRows$.next(e)}else this.datatable.selectedRows$.next([...this.datatable.selectedRows$.value,t])}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(o.x),i.Y36(i.sBO))},t.\u0275cmp=i.Xpm({type:t,selectors:[["","table-body-checkbox",""]],hostAttrs:[1,"table-checkbox"],inputs:{rowId:["table-body-checkbox","rowId"]},attrs:a,decls:1,vars:1,consts:[[3,"checked","click","change"]],template:function(t,e){1&t&&(i.TgZ(0,"mat-checkbox",0),i.NdJ("click",function(t){return t.stopPropagation()})("change",function(t){return t?e.toggleRow(e.rowId):null}),i.qZA()),2&t&&i.Q6J("checked",e.isRowSelected(e.rowId))},directives:[s.oG],encapsulation:2,changeDetection:0}),t})()},13536:function(t,e,n){"use strict";n.d(e,{e:function(){return r}});var i=n(35366),o=n(56515),s=n(40994);const a=["table-header-checkbox",""];let r=(()=>{class t{constructor(t,e){this.datatable=t,this.cd=e}ngOnInit(){this.changeRef=this.datatable.selectedRows$.subscribe(()=>{this.cd.markForCheck()})}ngOnDestroy(){this.changeRef.unsubscribe()}anyRowsSelected(){return!!this.datatable.selectedRows$.value.length}allRowsSelected(){var t;return this.datatable.selectedRows$.value.length&&this.datatable.selectedRows$.value.length===(null===(t=this.datatable.data$.value)||void 0===t?void 0:t.length)}toggleAllRows(){this.allRowsSelected()?this.datatable.selectedRows$.next([]):this.datatable.selectedRows$.next(this.datatable.data$.value.map(t=>t.id))}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(o.x),i.Y36(i.sBO))},t.\u0275cmp=i.Xpm({type:t,selectors:[["","table-header-checkbox",""]],hostAttrs:[1,"table-checkbox"],attrs:a,decls:1,vars:2,consts:[[3,"checked","indeterminate","change"]],template:function(t,e){1&t&&(i.TgZ(0,"mat-checkbox",0),i.NdJ("change",function(t){return t?e.toggleAllRows():null}),i.qZA()),2&t&&i.Q6J("checked",e.allRowsSelected())("indeterminate",e.anyRowsSelected()&&!e.allRowsSelected())},directives:[s.oG],encapsulation:2,changeDetection:0}),t})()},80922:function(t,e,n){"use strict";n.d(e,{p:function(){return g}});var i=n(43835),o=n(99235),s=n(40694),a=n(35366),r=n(56515),l=n(97388),c=n(61116),d=n(77307);const u=["columnName"],p=["table-sort-header",""],h=["*"];let g=(()=>{class t{constructor(t,e,n,i){this.datable=t,this.cd=e,this.focusMonitor=n,this.el=i,this.orderDir=null,this.arrowVisible=!1,this.arrowDirection="down"}get sortDisabled(){var t;return null===(t=this.datable.config)||void 0===t?void 0:t.disableSort}ngOnInit(){this.orderBy||(this.orderBy=(0,s.V)(this.columnName.nativeElement.textContent,"_")),this.sortSub=this.datable.sort$.pipe((0,i.h)(t=>t.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(t){switch(t){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 t;(null===(t=this.datable.config)||void 0===t?void 0:t.disableSort)||(this.arrowVisible=!0)}onMouseLeave(){this.arrowVisible=!1,this.orderDir||(this.arrowDirection="down")}handleClick(){var t;(null===(t=this.datable.config)||void 0===t?void 0:t.disableSort)||this.changeSort()}handleKeydown(t){var e;(null===(e=this.datable.config)||void 0===e?void 0:e.disableSort)||t.keyCode!==o.L_&&t.keyCode!==o.K5||(t.preventDefault(),this.changeSort())}}return t.\u0275fac=function(e){return new(e||t)(a.Y36(r.x),a.Y36(a.sBO),a.Y36(l.tE),a.Y36(a.SBq))},t.\u0275cmp=a.Xpm({type:t,selectors:[["","table-sort-header",""]],viewQuery:function(t,e){if(1&t&&a.Gf(u,7),2&t){let t;a.iGM(t=a.CRH())&&(e.columnName=t.first)}},hostAttrs:["tabindex","0"],hostVars:4,hostBindings:function(t,e){1&t&&a.NdJ("click",function(){return e.handleClick()})("keydown",function(t){return e.handleKeydown(t)})("mouseenter",function(){return e.onMouseEnter()})("mouseleave",function(){return e.onMouseLeave()}),2&t&&a.ekj("active",e.orderDir)("sort-disabled",e.sortDisabled)},inputs:{orderBy:["table-sort-header","orderBy"]},attrs:p,ngContentSelectors:h,decls:5,vars:3,consts:[[1,"text"],["columnName",""],[1,"icon-wrapper",3,"ngClass"],["svgIcon","arrow-downward",1,"sort-icon"]],template:function(t,e){1&t&&(a.F$t(),a.TgZ(0,"span",0,1),a.Hsn(2),a.qZA(),a.TgZ(3,"span",2),a._UZ(4,"mat-icon",3),a.qZA()),2&t&&(a.xp6(3),a.Q6J("ngClass",e.arrowDirection),a.xp6(1),a.ekj("hint-visible",e.arrowVisible))},directives:[c.mk,d.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}),t})()},9636:function(t,e,n){"use strict";function i(t,e){return t.filter(t=>function(t,e){const n="string"==typeof t?t:o(t),i=e.trim().toLowerCase();return-1!==n.indexOf(i)}(t,e))}function o(t){return Object.keys(t).reduce((e,n)=>e+(t[n]&&"object"==typeof t[n]?o(t[n]):t[n])+"\u25ec","").toLowerCase()}n.d(e,{D:function(){return i}})},20237:function(t,e,n){"use strict";n.d(e,{w:function(){return a}});var i=n(4694),o=n(35366),s=n(24859);let a=(()=>{class t{constructor(t){this.modal=t}canDeactivate(t){return!!t.canDeactivate()||this.modal.show(i.z,{title:"Unsaved Changes",body:"You have unsaved changes. Do you want to discard them?",ok:"Discard"}).beforeClosed()}}return t.\u0275fac=function(e){return new(e||t)(o.LFG(s.u))},t.\u0275prov=o.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},99208:function(t,e,n){"use strict";n.d(e,{e:function(){return rt}});var i=n(11520),o=n(82628),s=n(64762),a=n(35366),r=n(88195),l=n(78733),c=n(71294),d=n(3950);let u=(()=>{class t{constructor(t,e,n,i,o){this.settings=t,this.zone=e,this.lazyLoader=n,this.breakpoints=i,this.i18n=o,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(t){return this.editorIsReady()&&this.tinymceInstance.queryCommandState(t)}execCommand(t,e=null){this.waitForEditor().then(()=>{this.zone.run(()=>{this.tinymceInstance.execCommand(t,!1,e)})})}getContents(t){return this.editorIsReady()?this.tinymceInstance.getContent(t):""}setContents(t){this.waitForEditor().then(()=>{this.tinymceInstance.undoManager&&(this.tinymceInstance.undoManager.transact(()=>{this.tinymceInstance.setContent(t)}),this.tinymceInstance.selection.setCursorLocation(),this.tinymceInstance.nodeChanged(),this.tinymceInstance.execCommand("mceResize"))})}insertContents(t){this.waitForEditor().then(()=>{this.tinymceInstance.execCommand("mceInsertContent",!1,t),setTimeout(()=>this.tinymceInstance.selection.collapse())})}insertImage(t){this.waitForEditor().then(()=>{this.insertContents('<img src="'+t+'"/>'),setTimeout(()=>this.execCommand("mceAutoResize"),500)})}waitForEditor(){return this.tinymceInstance?new Promise(t=>t(this.tinymceInstance)):this.bootstrapPromise?this.bootstrapPromise:void 0}setConfig(t){this.config=t,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 t={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,toolbar:!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:t=>{this.tinymceInstance=t,t.on("change",()=>this.config.onChange.emit(t.getContent())),t.on("click",()=>{this.zone.run(()=>{})})},init_instance_callback:t=>{this.bootstrapPromise=!1,this.bootstrapPromiseResolve(this.tinymceInstance);const e=()=>{this.zone.run(()=>{this.config.onChange.emit(t.getContent()),this.config.onCtrlEnter.emit()})};t.shortcuts.add("ctrl+13","desc",e),window.navigator.platform.toLowerCase().includes("mac")&&t.shortcuts.add("meta+13","desc",e)}};if(this.config.showAdvancedControls&&(t.plugins=t.plugins.concat(["media","hr","visualblocks","visualchars","wordcount"]),t.forced_root_block="p",t.statusbar=!0,t.autoresize_on_init=!0,t.extended_valid_elements="svg[*],use[*],iframe[src|frameborder|width|height|allow=*|allowfullscreen],script[src]",t.elementpath=!0,t.content_css.push(this.settings.getAssetUrl()+"css/advanced-editor-styles.css"),t.target_list=[{title:this.i18n.t("Current window"),value:""},{title:this.i18n.t("New Window"),value:"_blank"}],t.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 e=this.config.editorEl.nativeElement.parentElement.offsetHeight-74-4;t.min_height=e,t.max_height=e}tinymce.init(t)}destroyEditor(){try{this.tinymceInstance&&this.tinymceInstance.remove(),this.tinymceInstance=null,this.makeBootstrapPromise()}catch(t){}}makeBootstrapPromise(){this.bootstrapPromise=new Promise(t=>this.bootstrapPromiseResolve=t)}}return t.\u0275fac=function(e){return new(e||t)(a.LFG(r.Z),a.LFG(a.R0b),a.LFG(l.j),a.LFG(c.S),a.LFG(d.Z))},t.\u0275prov=a.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var p=n(62147),h=n(66457),g=n(67139),m=n(40149),f=n(74899),b=n(31041),v=n(47701),_=n(35331),x=n(28505),Z=n(98979),y=n(16930),w=n(20274),k=n(94380),A=n(73033);let C=(()=>{class t extends y.c{constructor(){super(...arguments),this.DEFAULT_MAX_SIZE_MB=3}initValidations(){const t=[new w.p({maxSize:(0,k.F)(this.DEFAULT_MAX_SIZE_MB,"MB")},this.i18n),new A.p({types:["image"]},this.i18n)];this.validations.push(...t)}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=a.n5z(t)))(n||t)}}(),t.\u0275prov=a.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var T=n(61116),q=n(24311),I=n(77307),O=n(97070),U=n(38116),P=n(40450);const M=["visualArea"],S=["sourceArea"];function N(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"div",3),a.TgZ(1,"button",4),a.NdJ("click",function(){return a.CHM(t),a.oxw().openFileUploadDialog()}),a.ALo(2,"trans"),a._UZ(3,"mat-icon",19),a.qZA(),a.qZA()}2&t&&(a.xp6(1),a.Q6J("matTooltip",a.lcZ(2,1,"Add Attachment")))}function J(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"div",3),a.TgZ(1,"button",4),a.NdJ("click",function(){return a.CHM(t),a.oxw().execCommand("codesample")}),a.ALo(2,"trans"),a._UZ(3,"mat-icon",20),a.qZA(),a.qZA()}2&t&&(a.xp6(1),a.Q6J("matTooltip",a.lcZ(2,1,"Insert Code Sample")))}function E(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"button",23),a.NdJ("click",function(){return a.CHM(t),a.oxw(2).openInsertImageModal()}),a.ALo(1,"trans"),a._UZ(2,"mat-icon",24),a.qZA()}2&t&&a.Q6J("matTooltip",a.lcZ(1,1,"Insert Image"))}function L(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"div",3),a.TgZ(1,"button",4),a.NdJ("click",function(){return a.CHM(t),a.oxw().execCommand("mceLink")}),a.ALo(2,"trans"),a._UZ(3,"mat-icon",21),a.qZA(),a.YNc(4,E,3,3,"button",22),a.qZA()}if(2&t){const t=a.oxw();a.xp6(1),a.ekj("active",t.queryCommandState("link")),a.Q6J("matTooltip",a.lcZ(2,4,"Insert Link")),a.xp6(3),a.Q6J("ngIf",t.currentUser.hasPermission("files.create"))}}function D(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"div",1),a.TgZ(1,"div",3),a.TgZ(2,"button",25),a.TgZ(3,"span",26),a._uU(4,"Insert"),a.qZA(),a._UZ(5,"mat-icon",27),a.qZA(),a.TgZ(6,"mat-menu",null,28),a.TgZ(8,"div",29),a.NdJ("click",function(){return a.CHM(t),a.oxw().execCommand("InsertHorizontalRule")}),a._UZ(9,"mat-icon",30),a.TgZ(10,"span",26),a._uU(11,"Horizontal Line"),a.qZA(),a.qZA(),a.TgZ(12,"div",29),a.NdJ("click",function(){return a.CHM(t),a.oxw().execCommand("mceLink")}),a._UZ(13,"mat-icon",21),a.TgZ(14,"span",26),a._uU(15,"Link"),a.qZA(),a.qZA(),a.TgZ(16,"div",29),a.NdJ("click",function(){return a.CHM(t),a.oxw().execCommand("mceMedia")}),a._UZ(17,"mat-icon",31),a.TgZ(18,"span",26),a._uU(19,"Media"),a.qZA(),a.qZA(),a.TgZ(20,"div",32),a.NdJ("click",function(){return a.CHM(t),a.oxw().insertInfoContainer("important")}),a._UZ(21,"mat-icon",33),a.TgZ(22,"span",26),a._uU(23,"Important"),a.qZA(),a.qZA(),a.TgZ(24,"div",32),a.NdJ("click",function(){return a.CHM(t),a.oxw().insertInfoContainer("warning")}),a._UZ(25,"mat-icon",34),a.TgZ(26,"span",26),a._uU(27,"Warning"),a.qZA(),a.qZA(),a.TgZ(28,"div",32),a.NdJ("click",function(){return a.CHM(t),a.oxw().insertInfoContainer("note")}),a._UZ(29,"mat-icon",35),a.TgZ(30,"span",26),a._uU(31,"Note"),a.qZA(),a.qZA(),a.qZA(),a.qZA(),a.TgZ(32,"div",3),a.TgZ(33,"button",36),a.TgZ(34,"span",26),a._uU(35,"Format"),a.qZA(),a._UZ(36,"mat-icon",27),a.qZA(),a.TgZ(37,"mat-menu",37,38),a.TgZ(39,"div",29),a.NdJ("click",function(){return a.CHM(t),a.oxw().execCommand("FormatBlock","h1")}),a.TgZ(40,"div",39),a._uU(41,"Heading 1"),a.qZA(),a.TgZ(42,"div",40),a._uU(43,"Alt+Shift+1"),a.qZA(),a.qZA(),a.TgZ(44,"div",29),a.NdJ("click",function(){return a.CHM(t),a.oxw().execCommand("FormatBlock","h2")}),a.TgZ(45,"div",39),a._uU(46,"Heading 2"),a.qZA(),a.TgZ(47,"div",40),a._uU(48,"Alt+Shift+2"),a.qZA(),a.qZA(),a.TgZ(49,"div",29),a.NdJ("click",function(){return a.CHM(t),a.oxw().execCommand("FormatBlock","h3")}),a.TgZ(50,"div",39),a._uU(51,"Heading 3"),a.qZA(),a.TgZ(52,"div",40),a._uU(53,"Alt+Shift+3"),a.qZA(),a.qZA(),a.TgZ(54,"div",29),a.NdJ("click",function(){return a.CHM(t),a.oxw().execCommand("FormatBlock","h4")}),a.TgZ(55,"div",39),a._uU(56,"Heading 4"),a.qZA(),a.TgZ(57,"div",40),a._uU(58,"Alt+Shift+4"),a.qZA(),a.qZA(),a.TgZ(59,"div",29),a.NdJ("click",function(){return a.CHM(t),a.oxw().execCommand("FormatBlock","code")}),a.TgZ(60,"div",39),a._uU(61,"Code"),a.qZA(),a.qZA(),a.TgZ(62,"div",29),a.NdJ("click",function(){return a.CHM(t),a.oxw().execCommand("strikethrough")}),a.TgZ(63,"div",39),a._uU(64,"Strikethrough"),a.qZA(),a.qZA(),a.TgZ(65,"div",29),a.NdJ("click",function(){return a.CHM(t),a.oxw().execCommand("superscript")}),a.TgZ(66,"div",39),a._uU(67,"Superscript"),a.qZA(),a.qZA(),a.TgZ(68,"div",29),a.NdJ("click",function(){return a.CHM(t),a.oxw().execCommand("subscript")}),a.TgZ(69,"div",39),a._uU(70,"Subscript"),a.qZA(),a.qZA(),a.TgZ(71,"div",29),a.NdJ("click",function(){return a.CHM(t),a.oxw().execCommand("mceBlockQuote")}),a.TgZ(72,"div",39),a._uU(73,"Blockquote"),a.qZA(),a.qZA(),a.TgZ(74,"div",29),a.NdJ("click",function(){return a.CHM(t),a.oxw().execCommand("FormatBlock","p")}),a.TgZ(75,"div",39),a._uU(76,"Paragraph"),a.qZA(),a.TgZ(77,"div",40),a._uU(78,"Ctrl+Shift+7"),a.qZA(),a.qZA(),a.qZA(),a.qZA(),a.TgZ(79,"div",3),a.TgZ(80,"button",41,42),a.TgZ(82,"span",26),a._uU(83,"Color"),a.qZA(),a._UZ(84,"mat-icon",27),a.qZA(),a.TgZ(85,"mat-menu",43,44),a.TgZ(87,"div",45),a.NdJ("click",function(){a.CHM(t);const e=a.MAs(81);return a.oxw().showColorPicker("ForeColor",e)}),a._UZ(88,"mat-icon",46),a.TgZ(89,"span",26),a._uU(90,"Text Color"),a.qZA(),a.qZA(),a.TgZ(91,"div",47),a.NdJ("click",function(){a.CHM(t);const e=a.MAs(81);return a.oxw().showColorPicker("HiliteColor",e)}),a._UZ(92,"mat-icon",48),a.TgZ(93,"span",26),a._uU(94,"Background Color"),a.qZA(),a.qZA(),a.qZA(),a.qZA(),a.TgZ(95,"div",3),a.TgZ(96,"button",4),a.NdJ("click",function(){return a.CHM(t),a.oxw().execCommand("justifyLeft")}),a.ALo(97,"trans"),a._UZ(98,"mat-icon",49),a.qZA(),a.TgZ(99,"button",4),a.NdJ("click",function(){return a.CHM(t),a.oxw().execCommand("justifyCenter")}),a.ALo(100,"trans"),a._UZ(101,"mat-icon",50),a.qZA(),a.TgZ(102,"button",4),a.NdJ("click",function(){return a.CHM(t),a.oxw().execCommand("justifyRight")}),a.ALo(103,"trans"),a._UZ(104,"mat-icon",51),a.qZA(),a.qZA(),a.TgZ(105,"div",3),a.TgZ(106,"button",4),a.NdJ("click",function(){return a.CHM(t),a.oxw().execCommand("Outdent")}),a.ALo(107,"trans"),a._UZ(108,"mat-icon",52),a.qZA(),a.TgZ(109,"button",4),a.NdJ("click",function(){return a.CHM(t),a.oxw().execCommand("Indent")}),a.ALo(110,"trans"),a._UZ(111,"mat-icon",53),a.qZA(),a.qZA(),a.TgZ(112,"div",54),a.TgZ(113,"button",55),a.NdJ("click",function(){return a.CHM(t),a.oxw().showVisualEditor()}),a._uU(114,"Visual "),a.qZA(),a.TgZ(115,"button",56),a.NdJ("click",function(){return a.CHM(t),a.oxw().showSourceEditor()}),a._uU(116,"Source "),a.qZA(),a.qZA(),a.qZA()}if(2&t){const t=a.MAs(7),e=a.MAs(38),n=a.MAs(86),i=a.oxw();a.xp6(2),a.Q6J("matMenuTriggerFor",t),a.xp6(31),a.Q6J("matMenuTriggerFor",e),a.xp6(47),a.Q6J("matMenuTriggerFor",n),a.xp6(16),a.ekj("active",i.queryCommandState("justifyLeft")),a.Q6J("matTooltip",a.lcZ(97,18,"Align Left")),a.xp6(3),a.ekj("active",i.queryCommandState("justifyCenter")),a.Q6J("matTooltip",a.lcZ(100,20,"Center")),a.xp6(3),a.ekj("active",i.queryCommandState("justifyRight")),a.Q6J("matTooltip",a.lcZ(103,22,"Align Right")),a.xp6(4),a.Q6J("matTooltip",a.lcZ(107,24,"Decrease Indent")),a.xp6(3),a.Q6J("matTooltip",a.lcZ(110,26,"Increase Indent")),a.xp6(4),a.ekj("active","visual"===i.activeEditor),a.xp6(2),a.ekj("active","source"===i.activeEditor)}}const $=[[["","customButtons",""]],[["","header",""]],[["","footer",""]]],R=["[customButtons]","[header]","[footer]"];let Y=(()=>{class t{constructor(t,e,n,i,o,s,r,l){this.editor=t,this.currentUser=e,this.uploadQueue=n,this.settings=i,this.renderer=o,this.el=s,this.overlayPanel=r,this.imageValidator=l,this.sourceAreaControl=new b.NI,this.activeEditor="visual",this.showAdvancedControls=!1,this.basic=!1,this.minHeight=183,this.maxHeight=530,this.onChange=new a.vpe,this.onCtrlEnter=new a.vpe,this.onFileUpload=new a.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(t){return this.editor.queryCommandState(t)}execCommand(t,e=null){this.editor.execCommand(t,e)}insertInfoContainer(t){this.insertContents(`<div class="widget widget-${t}"><div class="title">${(0,f.z)(t)}:</div><br></div><br>`)}showColorPicker(t,e){return(0,s.mG)(this,void 0,void 0,function*(){const{BeColorPickerModule:i}=yield n.e(378).then(n.bind(n,49378));this.overlayPanel.open(i.components.panel,{origin:new a.SBq(e),position:m.x}).valueChanged().pipe((0,v.b)(50)).subscribe(e=>{this.execCommand(t,e)})})}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,p.r)({multiple:!0}).then(t=>{this.onFileUpload.emit(t)})}openInsertImageModal(){const t={uri:_.C.Image,validator:this.imageValidator,httpParams:{diskPrefix:this.inlineUploadPrefix}};(0,p.r)({types:[g.j.image]}).then(e=>{this.uploadQueue.start(e,t).subscribe(t=>{this.insertImage(t.fileEntry.url)})})}getContents(){return this.editor.getContents()}setContents(t){this.editor.setContents(t)}insertContents(t){this.editor.insertContents(t)}insertImage(t){this.editor.insertImage(t)}insertLink(t){this.insertContents(`<a href="${t.href}" target="${t.target||"self"}">${t.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 t.\u0275fac=function(e){return new(e||t)(a.Y36(u),a.Y36(x.I),a.Y36(h.A),a.Y36(r.Z),a.Y36(a.Qsj),a.Y36(a.SBq),a.Y36(Z.T),a.Y36(C))},t.\u0275cmp=a.Xpm({type:t,selectors:[["text-editor"]],viewQuery:function(t,e){if(1&t&&(a.Gf(M,7),a.Gf(S,7)),2&t){let t;a.iGM(t=a.CRH())&&(e.visualTextArea=t.first),a.iGM(t=a.CRH())&&(e.sourceTextArea=t.first)}},inputs:{showAdvancedControls:"showAdvancedControls",basic:"basic",minHeight:"minHeight",maxHeight:"maxHeight",inlineUploadPrefix:"inlineUploadPrefix"},outputs:{onChange:"onChange",onCtrlEnter:"onCtrlEnter",onFileUpload:"onFileUpload"},features:[a._Bn([h.A,u])],ngContentSelectors:R,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(t,e){1&t&&(a.F$t($),a.TgZ(0,"div",0),a.TgZ(1,"div",1),a.YNc(2,N,4,3,"div",2),a.YNc(3,J,4,3,"div",2),a.TgZ(4,"div",3),a.TgZ(5,"button",4),a.NdJ("click",function(){return e.execCommand("undo")}),a.ALo(6,"trans"),a._UZ(7,"mat-icon",5),a.qZA(),a.TgZ(8,"button",4),a.NdJ("click",function(){return e.execCommand("redo")}),a.ALo(9,"trans"),a._UZ(10,"mat-icon",6),a.qZA(),a.qZA(),a.TgZ(11,"div",3),a.TgZ(12,"button",4),a.NdJ("click",function(){return e.execCommand("bold")}),a.ALo(13,"trans"),a._UZ(14,"mat-icon",7),a.qZA(),a.TgZ(15,"button",4),a.NdJ("click",function(){return e.execCommand("italic")}),a.ALo(16,"trans"),a._UZ(17,"mat-icon",8),a.qZA(),a.TgZ(18,"button",4),a.NdJ("click",function(){return e.execCommand("underline")}),a.ALo(19,"trans"),a._UZ(20,"mat-icon",9),a.qZA(),a.qZA(),a.TgZ(21,"div",3),a.TgZ(22,"button",4),a.NdJ("click",function(){return e.execCommand("insertunorderedlist")}),a.ALo(23,"trans"),a._UZ(24,"mat-icon",10),a.qZA(),a.TgZ(25,"button",4),a.NdJ("click",function(){return e.execCommand("insertorderedlist")}),a.ALo(26,"trans"),a._UZ(27,"mat-icon",11),a.qZA(),a.qZA(),a.YNc(28,L,5,6,"div",2),a.Hsn(29),a.TgZ(30,"div",12),a.TgZ(31,"button",4),a.NdJ("click",function(){return e.execCommand("removeformat")}),a.ALo(32,"trans"),a._UZ(33,"mat-icon",13),a.qZA(),a.qZA(),a.Hsn(34,1),a.qZA(),a.YNc(35,D,117,28,"div",14),a.qZA(),a.TgZ(36,"textarea",15,16),a.NdJ("blur",function(){return e.setContents(e.sourceAreaControl.value)}),a.qZA(),a._UZ(38,"textarea",17,18),a.Hsn(40,2)),2&t&&(a.xp6(2),a.Q6J("ngIf",e.inlineUploadPrefix&&e.currentUser.hasPermission("files.create")&&e.onFileUpload.observers.length),a.xp6(1),a.Q6J("ngIf",!e.basic),a.xp6(2),a.ekj("disabled",!e.hasUndo()),a.Q6J("matTooltip",a.lcZ(6,31,"Undo")),a.xp6(3),a.ekj("disabled",!e.hasRedo()),a.Q6J("matTooltip",a.lcZ(9,33,"Redo")),a.xp6(4),a.ekj("active",e.queryCommandState("bold")),a.Q6J("matTooltip",a.lcZ(13,35,"Bold")),a.xp6(3),a.ekj("active",e.queryCommandState("italic")),a.Q6J("matTooltip",a.lcZ(16,37,"Italic")),a.xp6(3),a.ekj("active",e.queryCommandState("underline")),a.Q6J("matTooltip",a.lcZ(19,39,"Underline")),a.xp6(4),a.ekj("active",e.queryCommandState("unorderedlist")),a.Q6J("matTooltip",a.lcZ(23,41,"Unordered List")),a.xp6(3),a.ekj("active",e.queryCommandState("orderedlist")),a.Q6J("matTooltip",a.lcZ(26,43,"Ordered List")),a.xp6(3),a.Q6J("ngIf",!e.basic),a.xp6(3),a.Q6J("matTooltip",a.lcZ(32,45,"Remove Formatting")),a.xp6(4),a.Q6J("ngIf",e.showAdvancedControls),a.xp6(1),a.Udp("min-height",e.minHeight),a.Q6J("formControl",e.sourceAreaControl),a.xp6(2),a.Udp("min-height",e.minHeight))},directives:[T.O5,q.gM,I.Hw,b.Fj,b.JJ,b.oH,O.p6,U.P,O.VK,O.OP],pipes:[P.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:rgba(0,0,0,.04)}[_nghost-%COMP%] .editor-button.success{color:var(--be-accent-default)}[_nghost-%COMP%] .editor-button:hover{background-color:rgba(0,0,0,.04)}[_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){.toolbar-row[_ngcontent-%COMP%]{overflow-x:auto}}"],changeDetection:0}),t})();var F=n(78512),Q=n(43835),B=n(98720),H=n(40694),V=n(38053),z=n(63337),G=n(73234),j=n(79572),X=n(84369),W=n(42300),K=n(29738);function tt(t,e){if(1&t&&(a.TgZ(0,"div",19),a._uU(1),a.qZA()),2&t){const t=a.oxw().ngIf;a.xp6(1),a.Oqu(t.title)}}function et(t,e){if(1&t&&(a.TgZ(0,"div",19),a._uU(1),a.qZA()),2&t){const t=a.oxw(2).ngIf;a.xp6(1),a.Oqu(t.slug)}}function nt(t,e){if(1&t&&(a.TgZ(0,"div",20),a._UZ(1,"slug-control",21),a.YNc(2,et,2,1,"div",6),a.qZA()),2&t){const t=a.oxw().ngIf,e=a.oxw();a.xp6(1),a.Q6J("prefix",e.slugPrefix()),a.xp6(1),a.Q6J("ngIf",t.slug)}}function it(t,e){1&t&&(a.TgZ(0,"span",10),a._uU(1,"Update"),a.qZA())}function ot(t,e){1&t&&(a.TgZ(0,"span",10),a._uU(1,"Create"),a.qZA())}function st(t,e){if(1&t&&(a.TgZ(0,"div",19),a._uU(1),a.qZA()),2&t){const t=a.oxw().ngIf;a.xp6(1),a.Oqu(t.body)}}function at(t,e){if(1&t){const t=a.EpF();a.ynx(0,1),a.TgZ(1,"div",2),a.TgZ(2,"div",3),a.TgZ(3,"label",4),a._uU(4,"Page Title"),a.qZA(),a._UZ(5,"input",5),a.YNc(6,tt,2,1,"div",6),a.qZA(),a.YNc(7,nt,3,2,"div",7),a.TgZ(8,"div",8),a.TgZ(9,"mat-slide-toggle",9),a._uU(10,"Hide Navbar"),a.qZA(),a.TgZ(11,"p",10),a._uU(12,"Whether default site navbar should be hidden for this page."),a.qZA(),a.qZA(),a.qZA(),a.TgZ(13,"div",11),a.TgZ(14,"button",12),a.NdJ("click",function(){return a.CHM(t),a.oxw().crupdatePage()}),a.YNc(15,it,2,0,"span",13),a.YNc(16,ot,2,0,"span",13),a.qZA(),a.TgZ(17,"a",14),a._uU(18,"Cancel"),a.qZA(),a.qZA(),a.TgZ(19,"div",15),a.YNc(20,st,2,1,"div",6),a.qZA(),a.TgZ(21,"div",16),a.TgZ(22,"text-editor",17),a.NdJ("onChange",function(e){return a.CHM(t),a.oxw().setBody(e)}),a.qZA(),a.qZA(),a._UZ(23,"loading-indicator",18),a.ALo(24,"async"),a.BQk()}if(2&t){const t=e.ngIf,n=a.oxw();a.Q6J("formGroup",n.form),a.xp6(6),a.Q6J("ngIf",t.title),a.xp6(1),a.Q6J("ngIf",!n.hideSlug),a.xp6(8),a.Q6J("ngIf",n.page),a.xp6(1),a.Q6J("ngIf",!n.page),a.xp6(1),a.Q6J("routerLink",n.backRoute()),a.xp6(3),a.Q6J("ngIf",t.body),a.xp6(2),a.Q6J("showAdvancedControls",!0),a.xp6(1),a.Q6J("isVisible",a.lcZ(24,9,n.loading$))}}let rt=(()=>{class t{constructor(t,e,n,i,o){this.pages=t,this.route=e,this.toast=n,this.router=i,this.fb=o,this.hideSlug=this.route.snapshot.data.hideSlug,this.endpoint=this.route.snapshot.data.endpoint,this.loading$=new F.X(!1),this.updating$=new F.X(!1),this.form=this.fb.group({title:[""],slug:[""],body:[""],type:[""],hide_nav:[!1]}),this.errors$=new F.X({})}ngOnInit(){var t;this.route.params.subscribe(t=>{this.getPage(t.id)}),this.route.snapshot.data.hideSlug||(t=this.form.get("title")).valueChanges.pipe((0,Q.h)(t=>!!t),(0,B.x)()).subscribe(e=>{t.parent.get("slug").dirty||t.parent.get("slug").setValue((0,H.V)(e))})}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,i.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.router.navigate(this.backRoute(),{relativeTo:this.route}),this.toast.open(this.updating$.value?"Page updated":"Page created")},t=>this.errors$.next(t.errors))}getPage(t){t&&(this.loading$.next(!0),this.pages.get(t).pipe((0,o.g)(0)).subscribe(t=>{this.updating$.next(!0),this.page=t.page,this.form.patchValue(t.page),this.textEditor.setContents(t.page.body||""),this.loading$.next(!1)}))}getPayload(){return Object.assign({},this.form.value)}setBody(t){this.form.patchValue({body:t})}backRoute(){return this.page?["../../"]:["../"]}slugPrefix(){return"pages/"+(this.page?this.page.id:"*")}}return t.\u0275fac=function(e){return new(e||t)(a.Y36(V.i),a.Y36(z.gz),a.Y36(G.F),a.Y36(z.F0),a.Y36(b.qu))},t.\u0275cmp=a.Xpm({type:t,selectors:[["crupdate-page"]],viewQuery:function(t,e){if(1&t&&a.Gf(Y,5),2&t){let t;a.iGM(t=a.CRH())&&(e.textEditor=t.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(t,e){1&t&&(a.YNc(0,at,25,11,"ng-container",0),a.ALo(1,"async")),2&t&&a.Q6J("ngIf",a.lcZ(1,1,e.errors$))},directives:[T.O5,b.JL,b.sg,U.P,b.Fj,b.JJ,b.u,j.Rr,X.lW,X.zs,z.yS,Y,W.Q,K.b],pipes:[T.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}),t})()},4954:function(t,e,n){"use strict";n.d(e,{I:function(){return a}});var i=n(59075),o=n(44415),s=n(45523);const a=[new s.yH({description:"Date the page was last updated"}),new s.T7({description:"Date the page was created"}),new i.XQ({type:i.Bq.SelectModel,key:"user_id",label:"User",description:"User page was created by",component:o.y})]},47878:function(t,e,n){"use strict";n.d(e,{k:function(){return _}});var i=n(61116),o=n(51685),s=n(77307),a=n(84369),r=n(24311),l=n(68400),c=n(63337),d=n(50615),u=n(58666),p=n(31041),h=n(29828),g=n(90164),m=n(99808),f=n(79572),b=n(27701),v=n(35366);let _=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=v.oAB({type:t}),t.\u0275inj=v.cJS({imports:[[i.ez,c.Bz,o.x,l.N,d.X,u.u,g.y,m.p,p.u5,p.UX,h.I,s.Ps,a.ot,r.AV,f.rP,b.Cv]]}),t})()},98034:function(t,e,n){"use strict";n.d(e,{c:function(){return E}});var i=n(38053),o=n(36024),s=n(56515),a=n(4954),r=n(35366),l=n(88195),c=n(28505),d=n(73234),u=n(63337),p=n(38116),h=n(34955),g=n(61116),m=n(13536),f=n(80922),b=n(86668),v=n(84369),_=n(77307),x=n(27701),Z=n(54275),y=n(71765),w=n(24311),k=n(47210),A=n(2406),C=n(40450);function T(t,e){1&t&&(r.TgZ(0,"a",17),r._UZ(1,"mat-icon",18),r.TgZ(2,"span",1),r._uU(3,"Add New Page"),r.qZA(),r.qZA())}function q(t,e){1&t&&r._UZ(0,"mat-progress-bar",19)}function I(t,e){1&t&&(r.TgZ(0,"th",20),r._uU(1,"Type"),r.qZA())}const O=function(t){return{count:t,resource:"page(s)"}};function U(t,e){if(1&t){const t=r.EpF();r.TgZ(0,"tr"),r.TgZ(1,"th",21),r.TgZ(2,"div",22),r._uU(3," :count :resource selected: "),r.qZA(),r.TgZ(4,"div",23),r.TgZ(5,"button",24),r.NdJ("click",function(){return r.CHM(t),r.oxw().maybeDeleteSelectedPages()}),r._uU(6," Delete "),r.qZA(),r.qZA(),r.qZA(),r.qZA()}if(2&t){const t=e.ngIf;r.xp6(2),r.Q6J("transValues",r.VKq(1,O,t))}}function P(t,e){if(1&t&&(r.TgZ(0,"td",37),r._uU(1),r.qZA()),2&t){const t=r.oxw().$implicit,e=r.oxw();r.xp6(1),r.hij(" ",t.type?e.viewName(t.type):"default"," ")}}const M=function(t){return[t,"edit"]};function S(t,e){if(1&t&&(r.TgZ(0,"a",38),r.ALo(1,"trans"),r._UZ(2,"mat-icon",39),r.qZA()),2&t){const t=r.oxw().$implicit;r.Q6J("routerLink",r.VKq(4,M,t.id))("matTooltip",r.lcZ(1,2,"Edit page"))}}function N(t,e){if(1&t){const t=r.EpF();r.TgZ(0,"tr"),r._UZ(1,"td",25),r.TgZ(2,"td",26),r.TgZ(3,"a",27),r._uU(4),r.qZA(),r.qZA(),r.TgZ(5,"td",28),r._UZ(6,"user-column",29),r.qZA(),r.TgZ(7,"td",30),r._uU(8),r.qZA(),r.YNc(9,P,2,1,"td",31),r.TgZ(10,"td",32),r._uU(11),r.ALo(12,"formattedDate"),r.qZA(),r.TgZ(13,"td",33),r.YNc(14,S,3,6,"a",34),r.TgZ(15,"button",35),r.NdJ("click",function(){const e=r.CHM(t).$implicit;return r.oxw().maybeDeleteSelectedPages([e.id])}),r._UZ(16,"mat-icon",36),r.qZA(),r.qZA(),r.qZA()}if(2&t){const t=e.$implicit,n=r.oxw();r.xp6(1),r.Q6J("table-body-checkbox",t.id),r.xp6(2),r.Q6J("href",n.getPageUrl(t),r.LSH),r.xp6(1),r.Oqu(t.slug),r.xp6(2),r.Q6J("user",t.user),r.xp6(2),r.Oqu(t.body),r.xp6(1),r.Q6J("ngIf",!n.endpoint),r.xp6(2),r.Oqu(r.lcZ(12,8,t.updated_at)),r.xp6(3),r.Q6J("ngIf",n.currentUser.hasPermission("custom_pages.update"))}}function J(t,e){1&t&&(r.TgZ(0,"no-results-message",40),r.TgZ(1,"span",41),r._uU(2,"No pages have been created yet"),r.qZA(),r.qZA())}let E=(()=>{class t{constructor(t,e,n,i,o,s,r){this.settings=t,this.datatable=e,this.currentUser=n,this.customPages=i,this.toast=o,this.router=s,this.route=r,this.endpoint=this.route.snapshot.data.endpoint,this.filters=a.I,this.pages$=this.datatable.data$}ngOnInit(){this.datatable.init({uri:this.endpoint||i.i.BASE_URI,staticParams:{with:["user"]}})}maybeDeleteSelectedPages(t){this.datatable.confirmResourceDeletion("tracking pixels").subscribe(()=>{this.customPages.delete(t||this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset(),this.toast.open("Pages deleted")},t=>{this.toast.open(t.message||o.v.Default)})})}showUserColumn(){return this.router.url.indexOf("admin")>-1}getPageUrl(t){return this.settings.getBaseUrl()+"/pages/"+t.id+"/"+t.slug}viewName(t){return t.replace(/_/g," ")}}return t.\u0275fac=function(e){return new(e||t)(r.Y36(l.Z),r.Y36(s.x),r.Y36(c.I),r.Y36(i.i),r.Y36(d.F),r.Y36(u.F0),r.Y36(u.gz))},t.\u0275cmp=r.Xpm({type:t,selectors:[["custom-pages-index"]],features:[r._Bn([s.x])],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",""],["table-sort-header","user_id","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(t,e){1&t&&(r.TgZ(0,"div",0),r.TgZ(1,"h1",1),r.TgZ(2,"span",1),r._uU(3,"Custom Pages"),r.qZA(),r.qZA(),r.TgZ(4,"div",2),r._UZ(5,"datatable-filters",3),r.TgZ(6,"div",4),r.YNc(7,T,4,0,"a",5),r.qZA(),r.qZA(),r.qZA(),r.TgZ(8,"div",6),r.YNc(9,q,1,0,"mat-progress-bar",7),r.ALo(10,"async"),r.TgZ(11,"table",8),r.TgZ(12,"thead"),r.TgZ(13,"tr"),r._UZ(14,"th",9),r.TgZ(15,"th",10),r._uU(16,"Slug"),r.qZA(),r.TgZ(17,"th",11),r._uU(18,"Owner"),r.qZA(),r.TgZ(19,"th",12),r._uU(20,"Body"),r.qZA(),r.YNc(21,I,2,0,"th",13),r.TgZ(22,"th",1),r._uU(23,"Last Updated"),r.qZA(),r._UZ(24,"th"),r.qZA(),r.YNc(25,U,7,3,"tr",14),r.qZA(),r.TgZ(26,"tbody"),r.YNc(27,N,17,10,"tr",15),r.ALo(28,"async"),r.qZA(),r.qZA(),r.YNc(29,J,3,0,"no-results-message",16),r.ALo(30,"async"),r._UZ(31,"datatable-footer"),r.qZA()),2&t&&(r.xp6(5),r.Q6J("filters",e.filters),r.xp6(2),r.Q6J("ngIf",e.currentUser.hasPermission("custom_pages.create")),r.xp6(2),r.Q6J("ngIf",r.lcZ(10,7,e.datatable.paginator&&e.datatable.paginator.loading$)),r.xp6(12),r.Q6J("ngIf",!e.endpoint),r.xp6(4),r.Q6J("ngIf",e.datatable.selectedRows$.value.length),r.xp6(2),r.Q6J("ngForOf",r.lcZ(28,9,e.pages$)),r.xp6(2),r.Q6J("ngIf",r.lcZ(30,11,e.datatable.paginator.noResults$)))},directives:[p.P,h.h,g.O5,m.e,f.p,g.sg,b.V,v.zs,u.yS,_.Hw,x.pW,v.lW,Z.O,y.r,w.gM,k.U],pipes:[g.Ov,A.l,C.R],styles:[".body-column[_ngcontent-%COMP%]{margin-right:25px;overflow:hidden}.type-column[_ngcontent-%COMP%]{text-transform:capitalize}"],changeDetection:0}),t})()},83693:function(t,e,n){"use strict";n.d(e,{o:function(){return i},P:function(){return o}});var i=function(t){return t.LINE="line",t.PIE="pie",t.BAR="bar",t}({});class o{constructor(t){this.config=t,setTimeout(()=>this.generate())}getMaxValue(){return this.config.data?Array.isArray(this.config.data[0])?Math.max(...this.config.data[0],...this.config.data[1]||[]):Math.max(...this.config.data):0}generateDataWithTooltip(t){return this.config.tooltip?t.map(t=>({value:t,meta:this.config.tooltip})):t}isEmpty(){return this.getMaxValue()<=0}}},92007:function(t,e,n){"use strict";n.d(e,{x:function(){return w}});var i=n(83693),o=n(45059),s=n.n(o),a=n(88636),r=n.n(a);class l extends i.P{constructor(){super(...arguments),this.lineConfig={showArea:!0,lineSmooth:!0,low:0,fullWidth:!0,chartPadding:{left:15,right:30},axisY:{labelInterpolationFnc:t=>Math.floor(t)},plugins:[r()()]}}generate(){const t=Object.assign(Object.assign(Object.assign({},this.lineConfig),{high:this.getHigh()}),this.config.options||{});this.chart=new(s().Line)(this.config.selector,this.transformChartData(),t),this.chart.on("draw",t=>{"line"!==t.type&&"area"!==t.type||t.element.animate({d:{begin:t.index,dur:250,from:t.path.clone().scale(1,0).translate(0,t.chartRect.height()).stringify(),to:t.path.clone().stringify(),easing:s().Svg.Easing.easeOutQuint}})})}transformChartData(){return{labels:this.config.labels,series:this.config.data.map(t=>this.generateDataWithTooltip(t||[]))}}getHigh(){return this.getMaxValue()?void 0:100}destroy(){this.chart&&(this.chart.off("draw"),this.chart.detach())}}class c extends i.P{constructor(){super(...arguments),this.pieConfig={showLabel:!1,chartPadding:0,plugins:[r()()]}}generate(){const t=Object.assign(Object.assign({},this.pieConfig),this.config.options||{});this.chart=new(s().Pie)(this.config.selector,this.transformChartData(),t),this.animate()}transformChartData(){return{labels:this.config.labels,series:this.generateDataWithTooltip(this.config.data)}}destroy(){this.chart&&(this.chart.off("draw"),this.chart.detach())}animate(){this.chart.on("draw",t=>{if("slice"===t.type){const e=t.element._node.getTotalLength();t.element.attr({"stroke-dasharray":e+"px "+e+"px"});const n={"stroke-dashoffset":{id:"anim"+t.index,dur:300*t.value/t.totalDataSum,from:-e+"px",to:"0px",fill:"freeze"}};if(0!==t.index&&(n["stroke-dashoffset"].begin="anim"+(t.index-1)+".end"),t.element.attr({"stroke-dashoffset":-e+"px"}),t.element.animate(n,!1),360===t.endAngle){let n=t.index,i=1e3*t.value/t.totalDataSum/2,o=0,s=-e/3;for(let e=0;e<4;e++){t.element.animate({"stroke-dashoffset":{id:"anim"+(n+1),dur:i,from:o+"px",to:s+"px",fill:"freeze",begin:"anim"+n+".end"}},!1),n++,i/=1.75;const e=o;o=s,s=e/2.5}}}})}}class d extends i.P{constructor(){super(...arguments),this.barConfig={chartPadding:{left:15,right:30},plugins:[r()()]}}generate(){const t=Object.assign(Object.assign(Object.assign({},this.barConfig),this.config.options||{}),{high:this.getHigh()});this.chart=new(s().Bar)(this.config.selector,this.transformChartData(),t),this.chart.on("draw",function(t){"bar"===t.type&&t.element.animate({y2:{dur:"0.2s",from:t.y1,to:t.y2}})})}transformChartData(){return{labels:this.config.labels,series:this.config.data.map(t=>this.generateDataWithTooltip(t||[]))}}getHigh(){return this.getMaxValue()?void 0:100}destroy(){this.chart&&(this.chart.off("draw"),this.chart.detach())}}var u=n(35366),p=n(61116),h=n(77307),g=n(38116);const m=["headerWrapper"],f=["legendWrapper"],b=["chartPlaceholder"];function v(t,e){1&t&&(u.TgZ(0,"div",7),u._UZ(1,"mat-icon",8),u.TgZ(2,"span",9),u._uU(3,"No data available for this time period."),u.qZA(),u.qZA())}function _(t,e){if(1&t&&(u.TgZ(0,"div",12),u._uU(1),u.qZA()),2&t){const t=e.$implicit;u.xp6(1),u.Oqu(t)}}function x(t,e){if(1&t&&(u.TgZ(0,"div",10),u.YNc(1,_,2,1,"div",11),u.qZA()),2&t){const t=u.oxw();u.xp6(1),u.Q6J("ngForOf",t.chartConfig.labels)}}const Z=[[["",8,"chart-header"]],[["",8,"chart-legend"]]],y=[".chart-header",".chart-legend"];let w=(()=>{class t{constructor(t){this.el=t}ngOnInit(){this.calcAndSetChartHeight()}ngOnChanges(){this.chartConfig&&(this.chart=this.chartConfig.type===i.o.LINE?new l(this.transformConfig()):this.chartConfig.type===i.o.BAR?new d(this.transformConfig()):new c(this.transformConfig()))}ngOnDestroy(){this.chart&&this.chart.destroy()}transformConfig(){return Object.assign(Object.assign({},this.chartConfig),{selector:this.chartPlaceholder.nativeElement})}calcAndSetChartHeight(){let t=this.height;this.headerWrapper.nativeElement.children.length&&(t-=66),(this.chartConfig&&this.chartConfig.legend||this.legendWrapper.nativeElement.children.length)&&(t-=40),this.el.nativeElement.style.height=this.height+"px",this.chartPlaceholder.nativeElement.style.height=t-15+"px"}}return t.\u0275fac=function(e){return new(e||t)(u.Y36(u.SBq))},t.\u0275cmp=u.Xpm({type:t,selectors:[["chart"]],viewQuery:function(t,e){if(1&t&&(u.Gf(m,7),u.Gf(f,7),u.Gf(b,7)),2&t){let t;u.iGM(t=u.CRH())&&(e.headerWrapper=t.first),u.iGM(t=u.CRH())&&(e.legendWrapper=t.first),u.iGM(t=u.CRH())&&(e.chartPlaceholder=t.first)}},hostAttrs:[1,"chart"],inputs:{chartConfig:"chartConfig",height:"height"},features:[u.TTD],ngContentSelectors:y,decls:10,vars:5,consts:[[1,"header-wrapper"],["headerWrapper",""],["chartPlaceholder",""],["class","empty-msg",4,"ngIf"],[1,"legend-wrapper"],["legendWrapper",""],["class","chart-legend",4,"ngIf"],[1,"empty-msg"],["svgIcon","warning"],["trans",""],[1,"chart-legend"],["class","legend-item",4,"ngFor","ngForOf"],[1,"legend-item"]],template:function(t,e){1&t&&(u.F$t(Z),u.TgZ(0,"div",0,1),u.Hsn(2),u.qZA(),u.TgZ(3,"div",null,2),u.YNc(5,v,4,0,"div",3),u.qZA(),u.TgZ(6,"div",4,5),u.Hsn(8,1),u.YNc(9,x,2,1,"div",6),u.qZA()),2&t&&(u.xp6(3),u.Gre("ct-chart ct-perfect-fourth ",null==e.chartConfig?null:e.chartConfig.type,"-chart chart-body"),u.xp6(2),u.Q6J("ngIf",e.chart&&e.chart.isEmpty()),u.xp6(4),u.Q6J("ngIf",null==e.chartConfig?null:e.chartConfig.legend))},directives:[p.O5,h.Hw,g.P,p.sg],styles:['.chart{display:block;max-width:100%;overflow:hidden}@media only screen and (max-width:768px){.chart{width:100%;flex:0 0 100%}}.chart .chart-body{margin-top:15px;position:relative}.chart .chart-header{padding:15px;border-bottom:1px solid var(--be-divider-default);height:66px}.chart .chart-header .title{font-size:1.3rem;font-weight:500;color:var(--be-text)}.chart .chart-header .subtitle{font-size:1.2rem;color:var(--be-secondary-text)}.chart .chart-legend{display:flex;width:100%;height:40px;align-items:center;justify-content:center;flex-wrap:wrap;padding:0 15px;font-size:1.3rem}.chart .chart-legend .legend-item{margin-right:14px;position:relative;padding-left:15px;white-space:nowrap;text-transform:capitalize}.chart .chart-legend .legend-item:before{display:block;content:" ";width:12px;height:12px;position:absolute;top:0;left:0;bottom:0;right:0;margin:auto 0}.chart .empty-msg{padding:15px;border-radius:4px;background-color:var(--be-background-alternative);border:1px solid var(--be-divider-default);text-align:center;width:80%;height:50px;max-width:340px;position:absolute;top:0;left:0;right:0;bottom:0;margin:auto;z-index:1}.chart .empty-msg .mat-icon{vertical-align:middle;margin-right:8px;color:var(--be-secondary-text);margin-top:-2px}.chart .ct-bar{stroke-width:30px}'],encapsulation:2,changeDetection:0}),t})()},20653:function(t,e,n){"use strict";n.d(e,{m:function(){return r}});var i=n(61116),o=n(68400),s=n(77307),a=n(35366);let r=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=a.oAB({type:t}),t.\u0275inj=a.cJS({imports:[[i.ez,o.N,s.Ps]]}),t})()},29738:function(t,e,n){"use strict";n.d(e,{b:function(){return g}});var i=n(31041),o=n(78512),s=n(35366),a=n(88195),r=n(77307),l=n(61116),c=n(84369),d=n(38116);function u(t,e){if(1&t){const t=s.EpF();s.ynx(0),s.TgZ(1,"div",3),s._uU(2),s.qZA(),s.TgZ(3,"div",4),s._UZ(4,"input",5),s.qZA(),s.TgZ(5,"button",6),s.NdJ("click",function(){return s.CHM(t),s.oxw().save()}),s._uU(6," Save "),s.qZA(),s.BQk()}if(2&t){const t=s.oxw();s.xp6(2),s.Oqu(t.fullBaseUri+t.getPrefix()),s.xp6(2),s.Q6J("formControl",t.slugControl)}}function p(t,e){if(1&t&&(s.ynx(0),s.TgZ(1,"a",8),s._uU(2),s.qZA(),s.BQk()),2&t){const t=e.ngIf;s.xp6(1),s.Q6J("href",t,s.LSH)("title",t),s.xp6(1),s.Oqu(t)}}function h(t,e){if(1&t){const t=s.EpF();s.YNc(0,p,3,3,"ng-container",7),s.ALo(1,"async"),s.TgZ(2,"button",6),s.NdJ("click",function(){return s.CHM(t),s.oxw().startEditing()}),s._uU(3," Edit "),s.qZA()}if(2&t){const t=s.oxw();s.Q6J("ngIf",t.fullBaseUri+t.getPrefix()+s.lcZ(1,1,t.slug$))}}let g=(()=>{class t{constructor(t){this.settings=t,this.slug$=new o.X(""),this.editing$=new o.X(!1),this.slugControl=new i.NI,this.defaultBaseUri=this.settings.getBaseUrl()+"/",this.fullBaseUri=this.defaultBaseUri}set baseUri(t){this.fullBaseUri=(t=t||this.defaultBaseUri).endsWith("/")?t:t+"/"}writeValue(t){this.slug$.next(t),this.slugControl.setValue(t)}registerOnChange(t){this.propagateChange=t}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 t.\u0275fac=function(e){return new(e||t)(s.Y36(a.Z))},t.\u0275cmp=s.Xpm({type:t,selectors:[["slug-control"]],inputs:{prefix:"prefix",baseUri:"baseUri"},features:[s._Bn([{provide:i.JU,useExisting:t,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(t,e){if(1&t&&(s._UZ(0,"mat-icon",0),s.YNc(1,u,7,2,"ng-container",1),s.ALo(2,"async"),s.YNc(3,h,4,3,"ng-template",null,2,s.W1O)),2&t){const t=s.MAs(4);s.xp6(1),s.Q6J("ngIf",s.lcZ(2,2,e.editing$))("ngIfElse",t)}},directives:[r.Hw,l.O5,i.Fj,i.JJ,i.oH,c.lW,d.P],pipes:[l.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}),t})()},29828:function(t,e,n){"use strict";n.d(e,{I:function(){return c}});var i=n(61116),o=n(31041),s=n(84369),a=n(77307),r=n(68400),l=n(35366);let c=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=l.oAB({type:t}),t.\u0275inj=l.cJS({imports:[[i.ez,o.UX,s.ot,r.N,a.Ps]]}),t})()},6006:function(t,e,n){"use strict";n.d(e,{V:function(){return J}});var i=n(35366),o=n(31041),s=n(78512),a=n(66457),r=n(67139),l=n(35331),c=n(62147),d=n(97070),u=n(57125),p=n(340),h=n(68515),g=n(61116),m=n(91741),f=n(96673),b=n(48569);const v={leading:!0,trailing:!1};class _{constructor(t,e,n,i){this.duration=t,this.scheduler=e,this.leading=n,this.trailing=i}call(t,e){return e.subscribe(new x(t,this.duration,this.scheduler,this.leading,this.trailing))}}class x extends f.L{constructor(t,e,n,i,o){super(t),this.duration=e,this.scheduler=n,this.leading=i,this.trailing=o,this._hasTrailingValue=!1,this._trailingValue=null}_next(t){this.throttled?this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(Z,this.duration,{subscriber:this})),this.leading?this.destination.next(t):this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0))}_complete(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()}clearThrottle(){const t=this.throttled;t&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),t.unsubscribe(),this.remove(t),this.throttled=null)}}function Z(t){const{subscriber:e}=t;e.clearThrottle()}var y=n(27701);let w=(()=>{class t{constructor(t,e,n){this.el=t,this.uploadQueue=e,this.cd=n,this.hidden=!0,this.subscription=this.uploadQueue.totalProgress().pipe(function(t,e=b.P,n=v){return i=>i.lift(new _(t,e,n.leading,n.trailing))}(260,m.Z,{leading:!0,trailing:!0})).subscribe(t=>{this.progress=t,this.hidden=100===t||0===this.uploadQueue.count$.value.pending,this.cd.markForCheck()})}ngOnDestroy(){this.subscription.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(i.SBq),i.Y36(a.A),i.Y36(i.sBO))},t.\u0275cmp=i.Xpm({type:t,selectors:[["upload-progress-bar"]],hostVars:2,hostBindings:function(t,e){2&t&&i.ekj("hidden",e.hidden)},decls:1,vars:1,consts:[["mode","determinate","color","accent",3,"value"]],template:function(t,e){1&t&&i._UZ(0,"mat-progress-bar",0),2&t&&i.Q6J("value",e.progress)},directives:[y.pW],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0}),t})();var k=n(62181),A=n(84369),C=n(77307);let T=(()=>{class t{constructor(t){this.el=t,this.config={},this.filesSelected=new i.vpe}ngOnInit(){this.el.nativeElement.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),(0,c.r)(this.config).then(t=>{t&&t.length&&this.filesSelected.emit(t)})})}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(i.SBq))},t.\u0275dir=i.lG2({type:t,selectors:[["","uploadButton",""]],inputs:{config:["uploadButton","config"]},outputs:{filesSelected:"filesSelected"}}),t})();var q=n(38116),I=n(40450);function O(t,e){1&t&&i._UZ(0,"image-or-icon",4),2&t&&i.Q6J("src",e.ngIf)}function U(t,e){if(1&t&&i._UZ(0,"image-or-icon",4),2&t){const t=i.oxw(2);i.Q6J("src",t.defaultBackground)}}function P(t,e){if(1&t&&i.YNc(0,U,1,1,"image-or-icon",5),2&t){const t=i.oxw();i.Q6J("ngIf",t.defaultBackground)}}function M(t,e){if(1&t){const t=i.EpF();i.ynx(0),i._UZ(1,"span",6),i.TgZ(2,"button",7),i.NdJ("click",function(){return i.CHM(t),i.oxw().openUploadDialog()}),i._UZ(3,"mat-icon",8),i.qZA(),i.TgZ(4,"mat-menu",null,9),i.TgZ(6,"button",10),i.NdJ("filesSelected",function(e){return i.CHM(t),i.oxw().uploadImage(e)}),i._uU(7),i.ALo(8,"trans"),i.qZA(),i.TgZ(9,"button",11),i.NdJ("click",function(){return i.CHM(t),i.oxw().deleteUpload()}),i._uU(10,"Remove"),i.qZA(),i.qZA(),i.BQk()}if(2&t){const t=i.MAs(5),e=i.oxw();i.xp6(1),i.Q6J("matMenuTriggerFor",t),i.xp6(5),i.Q6J("uploadButton",e.uploadInputConfig),i.xp6(1),i.Oqu(i.lcZ(8,3,e.buttonText))}}function S(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"button",14),i.NdJ("click",function(){return i.CHM(t),i.oxw(2).deleteUpload()}),i._UZ(1,"mat-icon",15),i.qZA()}}function N(t,e){if(1&t){const t=i.EpF();i.ynx(0),i.TgZ(1,"button",12),i.NdJ("filesSelected",function(e){return i.CHM(t),i.oxw().uploadImage(e)}),i._uU(2),i.ALo(3,"trans"),i.qZA(),i.YNc(4,S,2,0,"button",13),i.ALo(5,"async"),i.BQk()}if(2&t){const t=i.oxw();i.xp6(1),i.Q6J("uploadButton",t.uploadInputConfig),i.xp6(1),i.Oqu(i.lcZ(3,3,t.buttonText)),i.xp6(2),i.Q6J("ngIf",i.lcZ(5,5,t.src$))}}let J=(()=>{class t{constructor(t,e,n,o){this.uploadQueue=t,this.imageValidator=e,this.uploadsApi=n,this.http=o,this.fileDeleted=new i.vpe,this.buttonText="Upload image",this.uploadConfig={},this.compact=!1,this.uploadInputConfig={multiple:!1,types:[r.j.image]},this.isDisabled$=new s.X(!1),this.src$=new s.X(null)}writeValue(t){this.src$.next(t)}registerOnChange(t){this.propagateChange=t}registerOnTouched(){}setDisabledState(t){this.isDisabled$.next(t)}uploadImage(t){const e=Object.assign(Object.assign({},this.defaultUploadConfig()),this.uploadConfig);this.uploadQueue.start(t,e).subscribe(t=>{this.src$.next(t.fileEntry.url),this.propagateChange(t.fileEntry.url)})}deleteUpload(){const t={paths:[this.src$.value],deleteForever:!0};(this.uploadConfig&&this.uploadConfig.uri?this.http.delete(this.uploadConfig.uri,t):this.uploadsApi.delete(t)).subscribe(()=>{this.src$.next(null),this.propagateChange(null),this.fileDeleted.emit()})}defaultUploadConfig(){return{httpParams:{diskPrefix:this.diskPrefix||"common_media"},uri:l.C.Image,validator:this.imageValidator}}openUploadDialog(){this.src$.value?this.menuTrigger.toggleMenu():(0,c.r)(this.uploadInputConfig).then(t=>{this.uploadImage(t)})}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(a.A),i.Y36(u.G),i.Y36(p.f),i.Y36(h.r))},t.\u0275cmp=i.Xpm({type:t,selectors:[["upload-image-control"]],viewQuery:function(t,e){if(1&t&&i.Gf(d.p6,5),2&t){let t;i.iGM(t=i.CRH())&&(e.menuTrigger=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&i.ekj("compact",e.compact)},inputs:{defaultBackground:"defaultBackground",buttonText:"buttonText",uploadConfig:"uploadConfig",diskPrefix:"diskPrefix",compact:"compact"},outputs:{fileDeleted:"fileDeleted"},features:[i._Bn([a.A,{provide:o.JU,useExisting:t,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(t,e){if(1&t&&(i.YNc(0,O,1,1,"image-or-icon",0),i.ALo(1,"async"),i.YNc(2,P,1,1,"ng-template",null,1,i.W1O),i.TgZ(4,"div",2),i.YNc(5,M,11,5,"ng-container",3),i.ALo(6,"async"),i.YNc(7,N,6,7,"ng-container",3),i.ALo(8,"async"),i.qZA(),i._UZ(9,"upload-progress-bar")),2&t){const t=i.MAs(3);i.Q6J("ngIf",i.lcZ(1,4,e.src$))("ngIfElse",t),i.xp6(5),i.Q6J("ngIf",e.compact&&!i.lcZ(6,6,e.isDisabled$)),i.xp6(2),i.Q6J("ngIf",!e.compact&&!i.lcZ(8,8,e.isDisabled$))}},directives:[g.O5,w,k.A,d.p6,A.lW,C.Hw,d.VK,d.OP,T,q.P],pipes:[g.Ov,I.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:rgba(0,0,0,.87);border-color:rgba(0,0,0,.1);background:hsla(0,0%,100%,.8)}.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}"]}),t})()},90723:function(t,e,n){"use strict";n.d(e,{a:function(){return p}});var i=n(61116),o=n(84369),s=n(77307),a=n(27701),r=n(35366);let l=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=r.oAB({type:t}),t.\u0275inj=r.cJS({imports:[[i.ez,o.ot,a.Cv,s.Ps]]}),t})();var c=n(45052),d=n(68400),u=n(97070);let p=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=r.oAB({type:t}),t.\u0275inj=r.cJS({imports:[[i.ez,l,c.T,d.N,a.Cv,s.Ps,o.ot,u.Tx]]}),t})()},14926:function(t,e,n){"use strict";n.d(e,{_:function(){return f}});var i=n(78512),o=n(55959),s=n(25416),a=n(84698),r=n(90611),l=n(43835),c=n(63337),d=n(35366),u=n(71294),p=n(36402),h=n(88195),g=n(61116);const m=["*"];let f=(()=>{class t{constructor(t,e,n,s,a){this.breakpoints=t,this.localStorage=e,this.settings=n,this.el=s,this.router=a,this.navIsOpen$=new i.X(!1),this.isCompact$=new i.X(!1),this.onDestroy$=new o.xQ}ngOnInit(){this.navIsOpen$.next(!this.breakpoints.isMobile$.value),this.isCompact$.pipe((0,s.R)(this.onDestroy$)).subscribe(t=>{t?this.el.nativeElement.style.setProperty("--nav-width","80px"):this.el.nativeElement.style.removeProperty("--nav-width")}),this.navIsOpen$.pipe((0,a.T)(1),(0,r.q)(1)).subscribe(()=>{this.el.nativeElement.classList.add("enable-transitions")}),this.navIsOpen$.pipe((0,s.R)(this.onDestroy$)).subscribe(t=>{t?this.el.nativeElement.classList.remove("nav-closed"):this.el.nativeElement.classList.add("nav-closed")}),this.router.events.pipe((0,l.h)(t=>t 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 t.\u0275fac=function(e){return new(e||t)(d.Y36(u.S),d.Y36(p.m),d.Y36(h.Z),d.Y36(d.SBq),d.Y36(c.F0))},t.\u0275cmp=d.Xpm({type:t,selectors:[["sidenav"]],ngContentSelectors:m,decls:3,vars:4,consts:[[1,"backdrop",3,"click"]],template:function(t,e){1&t&&(d.F$t(),d.Hsn(0),d.TgZ(1,"div",0),d.NdJ("click",function(){return e.navIsOpen$.next(!1)}),d.ALo(2,"async"),d.qZA()),2&t&&(d.xp6(1),d.ekj("visible",d.lcZ(2,2,e.navIsOpen$)))},pipes:[g.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 rgba(0,0,0,.2),0 5px 8px 0 rgba(0,0,0,.14),0 1px 14px 0 rgba(0,0,0,.12)}}[_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 - 0px);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}),t})()},85786:function(t,e,n){"use strict";n.d(e,{c:function(){return s}});var i=n(61116),o=n(35366);let s=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.oAB({type:t}),t.\u0275inj=o.cJS({imports:[[i.ez]]}),t})()},90164:function(t,e,n){"use strict";n.d(e,{y:function(){return g}});var i=n(61116),o=n(31041),s=n(84369),a=n(40994),r=n(92935),l=n(97070),c=n(63589),d=n(24311),u=n(77307),p=n(68400),h=n(35366);let g=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=h.oAB({type:t}),t.\u0275inj=h.cJS({imports:[[i.ez,o.u5,o.UX,p.N,s.ot,c.ZX,a.p9,d.AV,r.Is,l.Tx,u.Ps]]}),t})()},35331:function(t,e,n){"use strict";n.d(e,{C:function(){return i}});var i=function(t){return t.Image="uploads/images",t}({})},66457:function(t,e,n){"use strict";n.d(e,{A:function(){return O}});var i=n(55959),o=n(78512),s=n(66994),a=n(24831);class r{constructor(t,e){this.canceled$=new i.xQ,this.processing$=new o.X(!1),this.uploadedResponse$=new s.t(1),this.progress$=new o.X({percentage:0}),this.error$=new o.X(null),this.customData={},this.uploadedFile=t,this.id=e||(0,a.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(t){this.error$.next(t)}setProgress(t){this.progress$.next(Object.assign(Object.assign({},this.progress$.value),t))}}var l=n(19764),c=n(31225),d=n(34056),u=n(73982),p=n(47727),h=n(25416),g=n(79996),m=n(43835),f=n(91772),b=n(36024),v=n(35366),_=n(340),x=n(16930),Z=n(20274),y=n(16890);class w extends y.y{constructor(t,e){super(),this.params=t,this.i18n=e,this.errorMessage=this.i18n.t("Only these file types are allowed: :extensions",{extensions:this.params.extensions.join(", ")})}fails(t){return!this.params.extensions.some(e=>e.toLowerCase()===t.extension.toLowerCase())}}class k extends y.y{constructor(t,e){super(),this.params=t,this.i18n=e,this.errorMessage=this.i18n.t("These file types are not allowed: :extensions",{extensions:this.params.extensions.join(", ")})}fails(t){return this.params.extensions.some(e=>e===t.extension)}}var A=n(94380);let C=(()=>{class t extends x.c{constructor(){super(...arguments),this.DEFAULT_MAX_FILE_SIZE_MB=8,this.showToast=!0}initValidations(){this.validations.push(new Z.p({maxSize:this.getMaxFileSize()},this.i18n));const t=this.getAllowedExtensions(),e=this.getBlockedExtensions();t&&t.length&&this.validations.push(new w({extensions:t},this.i18n)),e&&e.length&&this.validations.push(new k({extensions:e},this.i18n))}getMaxFileSize(){return this.settings.get("uploads.max_size",(0,A.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 t.\u0275fac=function(){let e;return function(n){return(e||(e=v.n5z(t)))(n||t)}}(),t.\u0275prov=v.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var T=n(73234),q=n(28505),I=n(88195);let O=(()=>{class t{constructor(t,e,n,a,r){this.api=t,this.defaultValidator=e,this.toast=n,this.currentUser=a,this.settings=r,this.uploads$=new o.X([]),this.totalProgress$=new s.t(1),this.uploadsAdded$=new i.xQ,this.count$=new o.X({pending:0,completed:0})}isEmpty(){return!this.uploads$.value.length}getAllCompleted(){return this.uploads$.value.filter(t=>t.completed).map(t=>t.fileEntry)}updateTotalProgress(){const t=this.uploads$.value.map(t=>t.progress$.value.percentage||0);this.totalProgress$.next(t.reduce((t,e)=>t+e,0)/t.length)}totalProgress(){return this.totalProgress$.asObservable()}start(t,e={}){const n=e.validator||this.defaultValidator;let i=[];if(Array.isArray(t))i=this.transformUploads(t,n),this.uploads$.next(this.uploads$.value.concat(i)),this.uploadsAdded$.next(i);else{const e=this.uploads$.value.map(e=>{if(t[e.id]){const o=this.transformUploads([t[e.id]],n,e.id)[0];return i.push(o),o}return e});this.uploads$.next(e)}return this.updateCount(),(0,l.D)(i.filter(t=>!t.error$.value)).pipe((0,u.zg)(t=>this.api.upload(t.uploadedFile,e).pipe((0,p.K)(i=>(this.handleUploadFailure(i,t,n),e.bubbleError?(0,c._)(i):d.E)),(0,h.R)(t.canceled$),(0,g.U)(n=>(this.handleUploadEvent(n,t,e.willProcessFiles),n.name===f.b.COMPLETED&&(n.body.queueItemId=t.id),n))),1),(0,m.h)(t=>t.name===f.b.COMPLETED),(0,g.U)(t=>t.body))}updateProgress(t,e){const n=this.find(t);n&&(n.setProgress({eta:e.eta,speed:e.speed,percentage:e.progress,totalBytes:e.totalBytes,completedBytes:e.completedBytes}),this.updateTotalProgress())}completeUpload(t,e){const n=this.find(t);n&&(n.uploadedResponse$.next(e),n.fileEntry=e.fileEntry,n.complete(),this.updateTotalProgress())}errorUpload(t,e){this.find(t).addError(e)}reset(){this.uploads$.value.forEach(t=>t.cancel()),this.uploads$.next([])}remove(t){const e=this.uploads$.value.findIndex(e=>e.id===t),n=this.uploads$.value[e];n.completed?n.finalize():n.cancel(),this.uploads$.value.splice(e,1),this.uploads$.next(this.uploads$.value)}find(t){return this.uploads$.value.find(e=>e.id===t)}transformUploads(t,e,n){return t.map(t=>{const i=new r(t,n);if(e){const n=e.validate(t);n.failed&&i.addError(n.errorMessage)}return i})}handleUploadEvent(t,e,n=!1){t.name===f.b.PROGRESS?(100===t.progress&&(t=Object.assign(Object.assign({},t),{progress:99}),n&&e.processing$.next(!0)),this.updateProgress(e.id,t)):t.name===f.b.COMPLETED&&(this.completeUpload(e.id,t.body),this.updateCount())}handleUploadFailure(t,e,n){var i;let o=null===(i=null==t?void 0:t.errors)||void 0===i?void 0:i.file,s=null;o||(o=b.v.DefaultUpload,s=this.currentUser.isAdmin()&&!this.settings.get("site.hide_docs_buttons")),this.errorUpload(e.id,o),this.updateCount(),this.updateTotalProgress(),n.showToast&&this.toast.open(o,{action:s?"Learn More":null}).onAction().subscribe(()=>{window.open(b.h)})}updateCount(){const t=this.uploads$.value.filter(t=>t.inProgress).length;this.count$.next({pending:t,completed:this.uploads$.value.length-t})}}return t.\u0275fac=function(e){return new(e||t)(v.LFG(_.f),v.LFG(C),v.LFG(T.F),v.LFG(q.I),v.LFG(I.Z))},t.\u0275prov=v.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},12440:function(t,e,n){"use strict";n.d(e,{Z:function(){return v}});var i=n(78512),o=n(31041),s=n(92935),a=n(11520),r=n(35366),l=n(95157),c=n(73234),d=n(61116),u=n(77307),p=n(38116),h=n(84369);function g(t,e){1&t&&(r.TgZ(0,"span",6),r._uU(1,"Create Workspace"),r.qZA())}function m(t,e){1&t&&(r.TgZ(0,"span",6),r._uU(1,"Update Workspace"),r.qZA())}function f(t,e){if(1&t&&(r.TgZ(0,"div",15),r._uU(1),r.qZA()),2&t){const t=r.oxw().ngIf;r.xp6(1),r.Oqu(t.name)}}function b(t,e){if(1&t){const t=r.EpF();r.TgZ(0,"form",7),r.NdJ("ngSubmit",function(){return r.CHM(t),r.oxw().confirm()}),r.TgZ(1,"mat-dialog-content",8),r.TgZ(2,"div",9),r.TgZ(3,"label",10),r._uU(4,"Name"),r.qZA(),r._UZ(5,"input",11),r.YNc(6,f,2,1,"div",12),r.qZA(),r.qZA(),r.TgZ(7,"mat-dialog-actions"),r.TgZ(8,"button",13),r.NdJ("click",function(){return r.CHM(t),r.oxw().close()}),r._uU(9,"Cancel"),r.qZA(),r.TgZ(10,"button",14),r.ALo(11,"async"),r._uU(12),r.qZA(),r.qZA(),r.qZA()}if(2&t){const t=e.ngIf,n=r.oxw();r.Q6J("formGroup",n.form),r.xp6(6),r.Q6J("ngIf",t.name),r.xp6(4),r.Q6J("disabled",r.lcZ(11,4,n.loading$)),r.xp6(2),r.Oqu(n.data.workspace?"Update":"Create")}}let v=(()=>{class t{constructor(t,e,n,s){this.dialogRef=t,this.data=e,this.workspaces=n,this.toast=s,this.loading$=new i.X(!1),this.errors$=new i.X({}),this.form=new o.cw({name:new o.NI}),e.workspace&&this.form.patchValue(e.workspace)}confirm(){this.loading$.next(!0),(this.data.workspace?this.workspaces.update(this.data.workspace.id,this.form.value):this.workspaces.create(this.form.value)).pipe((0,a.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.toast.open(this.data.workspace?"Workspace updated.":"Workspace created."),this.close(t.workspace)},t=>this.errors$.next(t.errors))}close(t){this.dialogRef.close(t)}}return t.\u0275fac=function(e){return new(e||t)(r.Y36(s.so),r.Y36(s.WI),r.Y36(l.b),r.Y36(c.F))},t.\u0275cmp=r.Xpm({type:t,selectors:[["crupdate-workspace-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"],["ngNativeValidate","",3,"formGroup","ngSubmit",4,"ngIf"],["trans",""],["ngNativeValidate","",3,"formGroup","ngSubmit"],[1,"many-inputs"],[1,"input-container","name-container"],["for","crupdate-workspace-name","trans",""],["type","text","id","crupdate-workspace-name","formControlName","name","required","","minlength","3"],["class","error",4,"ngIf"],["type","button","mat-button","","trans","",3,"click"],["type","submit","mat-raised-button","","color","accent","trans","",3,"disabled"],[1,"error"]],template:function(t,e){1&t&&(r.TgZ(0,"div",0),r.TgZ(1,"h2",1),r.YNc(2,g,2,0,"span",2),r.YNc(3,m,2,0,"span",2),r.qZA(),r.TgZ(4,"button",3),r.NdJ("click",function(){return e.close()}),r._UZ(5,"mat-icon",4),r.qZA(),r.qZA(),r.YNc(6,b,13,6,"form",5),r.ALo(7,"async")),2&t&&(r.xp6(2),r.Q6J("ngIf",!e.data.workspace),r.xp6(1),r.Q6J("ngIf",e.data.workspace),r.xp6(3),r.Q6J("ngIf",r.lcZ(7,3,e.errors$)))},directives:[s.uh,d.O5,u.Hw,p.P,o.JL,o.sg,s.xY,o.Fj,o.JJ,o.u,o.Q7,o.wO,s.H8,h.lW],pipes:[d.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}"],changeDetection:0}),t})()},75183:function(t,e,n){"use strict";n.d(e,{W:function(){return i}});const i={title:"Leave Workspace",body:"Are you sure you want to leave this workspace?",bodyBold:"All resources you've created in the workspace will be transferred to workspace owner.",ok:"Leave"}},77044:function(t,e,n){"use strict";n.d(e,{t:function(){return Y}});var i=n(78512),o=n(31041),s=n(92935),a=n(11520),r=function(t){return t.LEFT_WORKSPACE="You have left the workspace.",t.MEMBER_DELETED="Member Deleted.",t.INVITES_SENT="Invites Sent.",t.INVITE_RESENT="Resent invite.",t.ROLE_ASSIGNED="Role Assigned.",t}({}),l=n(4694),c=n(75183),d=n(26437),u=n(35366),p=n(95157),h=n(73234),g=n(25051),m=n(28505),f=n(24859),b=n(38116),v=n(77307),_=n(61116),x=n(97070),Z=n(77910),y=n(84369),w=n(27701),k=n(88798),A=n(24311),C=n(40450);function T(t,e){1&t&&u._UZ(0,"mat-progress-bar",23)}function q(t,e){if(1&t){const t=u.EpF();u.TgZ(0,"div",16),u.TgZ(1,"div",17),u.TgZ(2,"label",18),u._uU(3,"Invite by email"),u.qZA(),u.TgZ(4,"div",19),u._UZ(5,"chip-input",20),u.TgZ(6,"button",21),u.NdJ("click",function(){return u.CHM(t),u.oxw().invitePeople()}),u.ALo(7,"async"),u.ALo(8,"async"),u._uU(9,"Invite "),u.qZA(),u.qZA(),u.qZA(),u.YNc(10,T,1,0,"mat-progress-bar",22),u.ALo(11,"async"),u.qZA()}if(2&t){const t=u.oxw();let e;u.Q6J("@fadeIn",void 0),u.xp6(5),u.Q6J("emailsInput",!0)("formControl",t.peopleToInvite),u.xp6(1),u.Q6J("disabled",u.lcZ(7,5,t.inviting$)||!(null!=(e=u.lcZ(8,7,t.peopleToInvite.valueChanges))&&e.length)),u.xp6(4),u.Q6J("ngIf",u.lcZ(11,9,t.inviting$))}}function I(t,e){1&t&&(u.TgZ(0,"li",24),u._UZ(1,"skeleton",25),u.TgZ(2,"div",26),u._UZ(3,"skeleton"),u._UZ(4,"skeleton"),u.qZA(),u.qZA())}const O=function(){return[1,2,3]};function U(t,e){1&t&&(u.TgZ(0,"ul",12),u.YNc(1,I,5,0,"li",13),u.qZA()),2&t&&(u.Q6J("@fadeOut",void 0),u.xp6(1),u.Q6J("ngForOf",u.DdM(2,O)))}function P(t,e){1&t&&(u.TgZ(0,"span",38),u._uU(1,"(You)"),u.qZA())}function M(t,e){if(1&t){const t=u.EpF();u.ynx(0),u._uU(1," \xb7 "),u.TgZ(2,"button",39),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(2).$implicit;return u.oxw().maybeResendInvite(e)}),u.ALo(3,"async"),u._uU(4,"Resend Invite"),u.qZA(),u.BQk()}if(2&t){const t=u.oxw(3);u.xp6(2),u.Q6J("disabled",u.lcZ(3,1,t.inviting$))}}function S(t,e){if(1&t&&(u.TgZ(0,"span"),u._uU(1," \xb7 "),u.TgZ(2,"span",34),u._uU(3,"Invited"),u.qZA(),u.YNc(4,M,5,3,"ng-container",30),u.qZA()),2&t){const t=u.oxw(2);u.xp6(4),u.Q6J("ngIf",t.canInvite)}}function N(t,e){if(1&t){const t=u.EpF();u.TgZ(0,"button",40),u.NdJ("click",function(){u.CHM(t);const e=u.oxw().$implicit;return u.oxw().maybeDeleteMember(e)}),u.ALo(1,"async"),u._UZ(2,"mat-icon",3),u.qZA()}if(2&t){const t=u.oxw().$implicit,e=u.oxw();u.ekj("visually-hidden",t.is_owner||!e.canDelete),u.Q6J("disabled",u.lcZ(1,3,e.deleting$))}}function J(t,e){if(1&t){const t=u.EpF();u.TgZ(0,"button",41),u.NdJ("click",function(){u.CHM(t);const e=u.oxw().$implicit;return u.oxw().maybeLeaveWorkspace(e)}),u.ALo(1,"trans"),u.ALo(2,"async"),u._UZ(3,"mat-icon",42),u.qZA()}if(2&t){const t=u.oxw(2);u.Q6J("matTooltip",u.lcZ(1,2,"Leave workspace"))("disabled",u.lcZ(2,4,t.deleting$))}}const E=function(t){return{member:t}};function L(t,e){if(1&t){const t=u.EpF();u.TgZ(0,"li",24),u.NdJ("@fadeIn.done",function(){return u.CHM(t),u.oxw(),u.MAs(6).style.overflow="auto"}),u._UZ(1,"img",27),u.TgZ(2,"div",26),u.TgZ(3,"div",28),u.TgZ(4,"span"),u._uU(5),u.qZA(),u._uU(6," "),u.YNc(7,P,2,0,"span",29),u.YNc(8,S,5,1,"span",30),u.qZA(),u.TgZ(9,"div",31),u._uU(10),u.qZA(),u.qZA(),u.TgZ(11,"div",32),u.TgZ(12,"button",33),u.TgZ(13,"span",34),u._uU(14),u.qZA(),u._UZ(15,"mat-icon",35),u.qZA(),u.YNc(16,N,3,5,"button",36),u.YNc(17,J,4,6,"button",37),u.qZA(),u.qZA()}if(2&t){const t=e.$implicit,n=u.oxw(),i=u.MAs(19);u.Q6J("@fadeIn",void 0),u.xp6(1),u.Q6J("src",t.avatar,u.LSH),u.xp6(4),u.Oqu(t.display_name),u.xp6(2),u.Q6J("ngIf",n.currentUser.get("id")===t.id),u.xp6(1),u.Q6J("ngIf","invite"===t.model_type),u.xp6(2),u.Oqu(t.email),u.xp6(2),u.ekj("not-clickable",t.is_owner||!n.canEdit),u.Q6J("matMenuTriggerFor",i)("matMenuTriggerData",u.VKq(13,E,t)),u.xp6(2),u.Oqu(t.role_name),u.xp6(2),u.Q6J("ngIf",t.is_owner||n.currentUser.get("id")!==t.id),u.xp6(1),u.Q6J("ngIf",!t.is_owner&&n.currentUser.get("id")===t.id)}}function D(t,e){if(1&t){const t=u.EpF();u.TgZ(0,"div",44),u.NdJ("click",function(){const e=u.CHM(t).$implicit,n=u.oxw().member;return u.oxw().changeRole(n,e)}),u._UZ(1,"mat-icon",45),u.TgZ(2,"div",46),u.TgZ(3,"div",47),u._uU(4),u.qZA(),u.TgZ(5,"div",48),u._uU(6),u.qZA(),u.qZA(),u.qZA()}if(2&t){const t=e.$implicit,n=u.oxw().member;u.ekj("active",n.role_id===t.id),u.xp6(1),u.ekj("visually-hidden",n.role_id!==t.id),u.xp6(3),u.Oqu(t.name),u.xp6(2),u.Oqu(t.description)}}function $(t,e){if(1&t&&(u.YNc(0,D,7,6,"div",43),u.ALo(1,"async")),2&t){const t=u.oxw();u.Q6J("ngForOf",u.lcZ(1,1,t.workspaceRoles$))}}const R=function(t){return{workspace:t}};let Y=(()=>{class t{constructor(t,e,n,s,a,r,l){this.dialogRef=t,this.data=e,this.workspaces=n,this.toast=s,this.valueLists=a,this.currentUser=r,this.modal=l,this.inviting$=new i.X(!1),this.deleting$=new i.X(!1),this.loadingMembers$=new i.X(!1),this.workspaceRoles$=new i.X([]),this.members$=new i.X([]),this.peopleToInvite=new o.NI([]),this.canInvite=!1,this.canEdit=!1,this.canDelete=!1}ngOnInit(){this.loadingMembers$.next(!0),this.valueLists.get(["workspaceRoles"]).subscribe(t=>{this.workspaceRoles$.next(t.workspaceRoles)}),this.workspaces.get(this.data.workspace.id).pipe((0,a.x)(()=>this.loadingMembers$.next(!1))).subscribe(t=>{this.members$.next([...t.workspace.invites,...t.workspace.members]),this.setCurrentUserPermissions()})}close(t){this.dialogRef.close(t)}invitePeople(){const t=this.peopleToInvite.value.filter(t=>!this.members$.value.find(e=>e.email===t));if(!t.length)return this.peopleToInvite.reset(),void this.toast.open("All invited people are already members.");const e={emails:t,roleId:(this.workspaceRoles$.value.find(t=>t.default)||this.workspaceRoles$.value[0]).id};this.inviting$.next(!0),this.workspaces.invitePeople(this.data.workspace.id,e).pipe((0,a.x)(()=>this.inviting$.next(!1))).subscribe(t=>{this.members$.next([...this.members$.value,...t.invites]),this.peopleToInvite.reset(),this.toast.open(r.INVITES_SENT)})}resendInvite(t){this.inviting$.next(!0),this.workspaces.resendInvite(this.data.workspace.id,t.id).pipe((0,a.x)(()=>this.inviting$.next(!1))).subscribe(()=>{this.toast.open(r.INVITE_RESENT)})}changeRole(t,e){this.workspaces.changeRole(this.data.workspace.id,t,e.id).subscribe(()=>{this.toast.open(r.ROLE_ASSIGNED);const n=[...this.members$.value],i=n.findIndex(e=>e.id===t.id);n[i].role_name=e.name,n[i].role_id=e.id,this.members$.next(n)})}deleteMember(t){this.deleting$.next(!0),("member"===t.model_type?this.workspaces.deleteMember(this.data.workspace.id,t.id):this.workspaces.deleteInvite(t.id)).pipe((0,a.x)(()=>this.deleting$.next(!1))).subscribe(()=>{const e=[...this.members$.value],n=e.findIndex(e=>t.id&&e.model_type===t.model_type);e.splice(n,1),this.members$.next(e),t.id===this.currentUser.get("id")?(this.close(),this.toast.open(r.LEFT_WORKSPACE)):this.toast.open(r.MEMBER_DELETED)})}maybeDeleteMember(t){this.modal.show(l.z,{title:"Delete Member",body:"Are you sure you want to delete this member?",bodyBold:"All workspace resources created by this member will be transferred to workspace owner.",ok:"Delete"}).afterClosed().subscribe(e=>{e&&this.deleteMember(t)})}maybeResendInvite(t){this.modal.show(l.z,{title:"Resend Invite",body:"Are you sure you want to send this invite again?",ok:"Resend"}).afterClosed().subscribe(e=>{e&&this.resendInvite(t)})}maybeLeaveWorkspace(t){this.modal.show(l.z,c.W).afterClosed().subscribe(e=>{e&&this.deleteMember(t)})}setCurrentUserPermissions(){const t=this.members$.value.find(t=>t.id===this.currentUser.get("id"));this.canInvite=t.is_owner||!!t.permissions.find(t=>"workspace_members.invite"===t.name),this.canEdit=t.is_owner||!!t.permissions.find(t=>"workspace_members.update"===t.name),this.canDelete=t.is_owner||!!t.permissions.find(t=>"workspace_members.delete"===t.name)}}return t.\u0275fac=function(e){return new(e||t)(u.Y36(s.so),u.Y36(s.WI),u.Y36(p.b),u.Y36(h.F),u.Y36(g.l),u.Y36(m.I),u.Y36(f.u))},t.\u0275cmp=u.Xpm({type:t,selectors:[["manage-workspace-members-modal"]],decls:21,vars:10,consts:[[1,"modal-header"],["mat-dialog-title","","trans",""],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],[2,"overflow","hidden"],["container",""],["class","invite-container",4,"ngIf"],[1,"header"],["svgIcon","people"],["trans","",1,"text",3,"transValues"],[1,"animation-container"],["class","member-list unstyled-list",4,"ngIf"],[1,"member-list","unstyled-list"],["class","member-list-item",4,"ngFor","ngForOf"],["selectRoleMenu","matMenu"],["matMenuContent",""],[1,"invite-container"],[1,"input-container"],["for","workspace-emails-input","trans",""],[1,"input-with-action"],["id","workspace-emails-input","placeholder","Email addresses",3,"emailsInput","formControl"],["type","button","mat-flat-button","","color","accent","trans","",1,"add-tags-button",3,"disabled","click"],["mode","indeterminate","color","accent",4,"ngIf"],["mode","indeterminate","color","accent"],[1,"member-list-item"],["variant","avatar"],[1,"details"],["alt","",3,"src"],[1,"email"],["class","strong","trans","",4,"ngIf"],[4,"ngIf"],[1,"invited_at"],[1,"actions"],["type","button","mat-stroked-button","",1,"role-trigger-button",3,"matMenuTriggerFor","matMenuTriggerData"],["trans",""],["svgIcon","keyboard-arrow-down",1,"dropdown-icon"],["type","button","class","delete-member-button","mat-icon-button","",3,"visually-hidden","disabled","click",4,"ngIf"],["type","button","class","delete-member-button","mat-icon-button","",3,"matTooltip","disabled","click",4,"ngIf"],["trans","",1,"strong"],["type","button","trans","",1,"no-style","resend-invite-button",3,"disabled","click"],["type","button","mat-icon-button","",1,"delete-member-button",3,"disabled","click"],["type","button","mat-icon-button","",1,"delete-member-button",3,"matTooltip","disabled","click"],["svgIcon","exit-to-app"],["class","multiline-mat-menu-item with-icon","mat-menu-item","","trans","",3,"active","click",4,"ngFor","ngForOf"],["mat-menu-item","","trans","",1,"multiline-mat-menu-item","with-icon",3,"click"],["svgIcon","check"],[1,"menu-item-content"],["trans","",1,"title"],["trans","",1,"description"]],template:function(t,e){1&t&&(u.TgZ(0,"div",0),u.TgZ(1,"h2",1),u._uU(2,"Manage workspace members"),u.qZA(),u.TgZ(3,"button",2),u.NdJ("click",function(){return e.close()}),u._UZ(4,"mat-icon",3),u.qZA(),u.qZA(),u.TgZ(5,"mat-dialog-content",4,5),u.YNc(7,q,12,11,"div",6),u.TgZ(8,"div",7),u._UZ(9,"mat-icon",8),u.TgZ(10,"span",9),u._uU(11,"Members of :workspace"),u.qZA(),u.qZA(),u.TgZ(12,"div",10),u.YNc(13,U,2,3,"ul",11),u.ALo(14,"async"),u.TgZ(15,"ul",12),u.YNc(16,L,18,15,"li",13),u.ALo(17,"async"),u.qZA(),u.qZA(),u.qZA(),u.TgZ(18,"mat-menu",null,14),u.YNc(20,$,2,3,"ng-template",15),u.qZA()),2&t&&(u.xp6(7),u.Q6J("ngIf",e.canInvite),u.xp6(3),u.Q6J("transValues",u.VKq(8,R,e.data.workspace.name)),u.xp6(3),u.Q6J("ngIf",u.lcZ(14,4,e.loadingMembers$)),u.xp6(3),u.Q6J("ngForOf",u.lcZ(17,6,e.members$)))},directives:[s.uh,b.P,v.Hw,s.xY,_.O5,_.sg,x.VK,x.KA,Z.S,o.JJ,o.oH,y.lW,w.pW,k._,x.p6,A.gM,x.OP],pipes:[_.Ov,C.R],styles:["[_nghost-%COMP%]{display:block;width:600px;max-width:100%}chip-input[_ngcontent-%COMP%]{flex:1}.invite-container[_ngcontent-%COMP%]{margin-bottom:30px;position:relative}.mat-progress-bar[_ngcontent-%COMP%]{position:absolute;bottom:0;left:0;right:0}.header[_ngcontent-%COMP%]{font-size:1.5rem;margin-bottom:15px}.header[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{margin-right:5px}.header[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%], .header[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{vertical-align:middle}.animation-container[_ngcontent-%COMP%]{position:relative}.member-list-item[_ngcontent-%COMP%]{display:flex;margin-bottom:20px}.member-list-item[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{flex-shrink:0;width:40px;height:40px;-o-object-fit:cover;object-fit:cover;margin-right:10px;border-radius:4px}.member-list-item[_ngcontent-%COMP%] .details[_ngcontent-%COMP%]{flex:1 1 auto}.member-list-item[_ngcontent-%COMP%] .delete-member-button[_ngcontent-%COMP%], .member-list-item[_ngcontent-%COMP%] .invited_at[_ngcontent-%COMP%]{color:var(--be-secondary-text)}.not-clickable[_ngcontent-%COMP%]{pointer-events:none}.not-clickable[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{display:none}.dropdown-icon[_ngcontent-%COMP%]{width:18px;height:18px;line-height:18px}.resend-invite-button[_ngcontent-%COMP%]{color:var(--be-link)}.role-trigger-button[_ngcontent-%COMP%]{margin-right:8px;font-size:1.3rem;font-weight:400}"],data:{animation:d.B},changeDetection:0}),t})()},75428:function(t,e,n){"use strict";n.r(e),n.d(e,{WorkspaceModule:function(){return Z}});var i=n(61116),o=n(12440),s=n(77044),a=n(77307),r=n(84369),l=n(92935),c=n(68400),d=n(31041),u=n(7436),p=n(51685),h=n(86013),g=n(24311),m=n(50615),f=n(27701),b=n(15595),v=n(56160),_=n(97070),x=n(35366);let Z=(()=>{class t{}return t.components={crupdateModal:o.Z,manageMembers:s.t},t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=x.oAB({type:t}),t.\u0275inj=x.cJS({imports:[[i.ez,d.u5,d.UX,c.N,p.x,h.b,m.X,b.m,v.G,a.Ps,r.ot,l.Is,u.Fk,g.AV,f.Cv,_.Tx]]}),t})()}}]);
//# sourceMappingURL=445-es2015.0571e61aeb32d1a410f2.js.map
Back to Directory
File Manager