PageSourceSearch

https://libertrium.com/83.0ba04847035dea7d.js

js libertrium.com collected 2026-10-07 18:21:09 UTC 143,989 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkfrontoffice=self.webpackChunkfrontoffice||[]).push([[83],{1083:(Gn,Te,d)=>{d.r(Te),d.d(Te,{UserProfileModule:()=>Hn});var e=d(4650),g=d(6895),Se=d(142),Z=d(3353),S=d(1281),ce=d(2693),E=d(8929),q=d(2654),We=d(1715),$e=d(352),Xe=d(6498),et=d(6787),tt=d(7625);function pe(o,n,t){for(let i in n)if(n.hasOwnProperty(i)){const s=n[i];s?o.setProperty(i,s,t?.has(i)?"important":""):o.removeProperty(i)}return o}function M(o,n){const t=n?"":"none";pe(o.style,{"touch-action":n?"":"none","-webkit-user-drag":n?"":"none","-webkit-tap-highlight-color":n?"":"transparent","user-select":t,"-ms-user-select":t,"-webkit-user-select":t,"-moz-user-select":t})}function Ce(o,n,t){pe(o.style,{position:n?"":"fixed",top:n?"":"0",opacity:n?"":"0",left:n?"":"-999em"},t)}function K(o,n){return n&&"none"!=n?o+" "+n:o}function Ee(o){const n=o.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(o)*n}function de(o,n){return o.getPropertyValue(n).split(",").map(i=>i.trim())}function he(o){const n=o.getBoundingClientRect();return{top:n.top,right:n.right,bottom:n.bottom,left:n.left,width:n.width,height:n.height,x:n.x,y:n.y}}function ue(o,n,t){const{top:i,bottom:s,left:r,right:a}=o;return t>=i&&t<=s&&n>=r&&n<=a}function Y(o,n,t){o.top+=n,o.bottom=o.top+o.height,o.left+=t,o.right=o.left+o.width}function Ae(o,n,t,i){const{top:s,right:r,bottom:a,left:l,width:c,height:p}=o,h=c*n,m=p*n;return i>s-m&&i<a+m&&t>l-h&&t<r+h}class ye{constructor(n){this._document=n,this.positions=new Map}clear(){this.positions.clear()}cache(n){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),n.forEach(t=>{this.positions.set(t,{scrollPosition:{top:t.scrollTop,left:t.scrollLeft},clientRect:he(t)})})}handleScroll(n){const t=(0,Z.sA)(n),i=this.positions.get(t);if(!i)return null;const s=i.scrollPosition;let r,a;if(t===this._document){const p=this.getViewportScrollPosition();r=p.top,a=p.left}else r=t.scrollTop,a=t.scrollLeft;const l=s.top-r,c=s.left-a;return this.positions.forEach((p,h)=>{p.clientRect&&t!==h&&t.contains(h)&&Y(p.clientRect,l,c)}),s.top=r,s.left=a,{top:l,left:c}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}}function De(o){const n=o.cloneNode(!0),t=n.querySelectorAll("[id]"),i=o.nodeName.toLowerCase();n.removeAttribute("id");for(let s=0;s<t.length;s++)t[s].removeAttribute("id");return"canvas"===i?Pe(o,n):("input"===i||"select"===i||"textarea"===i)&&we(o,n),Ie("canvas",o,n,Pe),Ie("input, textarea, select",o,n,we),n}function Ie(o,n,t,i){const s=n.querySelectorAll(o);if(s.length){const r=t.querySelectorAll(o);for(let a=0;a<s.length;a++)i(s[a],r[a])}}let nt=0;function we(o,n){"file"!==n.type&&(n.value=o.value),"radio"===n.type&&n.name&&(n.name=`mat-clone-${n.name}-${nt++}`)}function Pe(o,n){const t=n.getContext("2d");if(t)try{t.drawImage(o,0,0)}catch{}}const Le=(0,Z.i$)({passive:!0}),z=(0,Z.i$)({passive:!1}),ge=new Set(["position"]);class ot{constructor(n,t,i,s,r,a){this._config=t,this._document=i,this._ngZone=s,this._viewportRuler=r,this._dragDropRegistry=a,this._passiveTransform={x:0,y:0},this._activeTransform={x:0,y:0},this._hasStartedDragging=!1,this._moveEvents=new E.xQ,this._pointerMoveSubscription=q.w.EMPTY,this._pointerUpSubscription=q.w.EMPTY,this._scrollSubscription=q.w.EMPTY,this._resizeSubscription=q.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 E.xQ,this.started=new E.xQ,this.released=new E.xQ,this.ended=new E.xQ,this.entered=new E.xQ,this.exited=new E.xQ,this.dropped=new E.xQ,this.moved=this._moveEvents,this._pointerDown=l=>{if(this.beforeStarted.next(),this._handles.length){const c=this._getTargetHandle(l);c&&!this._disabledHandles.has(c)&&!this.disabled&&this._initializeDragSequence(c,l)}else this.disabled||this._initializeDragSequence(this._rootElement,l)},this._pointerMove=l=>{const c=this._getPointerPositionOnPage(l);if(!this._hasStartedDragging){if(Math.abs(c.x-this._pickupPositionOnPage.x)+Math.abs(c.y-this._pickupPositionOnPage.y)>=this._config.dragStartThreshold){const D=Date.now()>=this._dragStartTime+this._getDragStartDelay(l),F=this._dropContainer;if(!D)return void this._endDragSequence(l);
1(!F||!F.isDragging()&&!F.isReceiving())&&(l.preventDefault(),this._hasStartedDragging=!0,this._ngZone.run(()=>this._startDragSequence(l)))}return}l.preventDefault();const p=this._getConstrainedPointerPosition(c);if(this._hasMoved=!0,this._lastKnownPointerPosition=c,this._updatePointerDirectionDelta(p),this._dropContainer)this._updateActiveDropContainer(p,c);else{const h=this.constrainPosition?this._initialClientRect:this._pickupPositionOnPage,m=this._activeTransform;m.x=p.x-h.x+this._passiveTransform.x,m.y=p.y-h.y+this._passiveTransform.y,this._applyRootElementTransform(m.x,m.y)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:p,event:l,distance:this._getDragDistance(p),delta:this._pointerDirectionDelta})})},this._pointerUp=l=>{this._endDragSequence(l)},this._nativeDragStart=l=>{if(this._handles.length){const c=this._getTargetHandle(l);c&&!this._disabledHandles.has(c)&&!this.disabled&&l.preventDefault()}else this.disabled||l.preventDefault()},this.withRootElement(n).withParent(t.parentDragRef||null),this._parentPositions=new ye(i),a.registerDragItem(this)}get disabled(){return this._disabled||!(!this._dropContainer||!this._dropContainer.disabled)}set disabled(n){const t=(0,S.Ig)(n);t!==this._disabled&&(this._disabled=t,this._toggleNativeDragInteractions(),this._handles.forEach(i=>M(i,t)))}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(n){this._handles=n.map(i=>(0,S.fI)(i)),this._handles.forEach(i=>M(i,this.disabled)),this._toggleNativeDragInteractions();const t=new Set;return this._disabledHandles.forEach(i=>{this._handles.indexOf(i)>-1&&t.add(i)}),this._disabledHandles=t,this}withPreviewTemplate(n){return this._previewTemplate=n,this}withPlaceholderTemplate(n){return this._placeholderTemplate=n,this}withRootElement(n){const t=(0,S.fI)(n);return t!==this._rootElement&&(this._rootElement&&this._removeRootElementListeners(this._rootElement),this._ngZone.runOutsideAngular(()=>{t.addEventListener("mousedown",this._pointerDown,z),t.addEventListener("touchstart",this._pointerDown,Le),t.addEventListener("dragstart",this._nativeDragStart,z)}),this._initialTransform=void 0,this._rootElement=t),typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(n){return this._boundaryElement=n?(0,S.fI)(n):null,this._resizeSubscription.unsubscribe(),n&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(n){return this._parentDragRef=n,this}dispose(){this._removeRootElementListeners(this._rootElement),this.isDragging()&&this._rootElement?.remove(),this._anchor?.remove(),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(n){!this._disabledHandles.has(n)&&this._handles.indexOf(n)>-1&&(this._disabledHandles.add(n),M(n,!0))}enableHandle(n){this._disabledHandles.has(n)&&(this._disabledHandles.delete(n),M(n,this.disabled))}withDirection(n){return this._direction=n,this}_withDropContainer(n){this._dropContainer=n}getFreeDragPosition(){const n=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:n.x,y:n.y}}setFreeDragPosition(n){return this._activeTransform={x:0,y:0},this._passiveTransform.x=n.x,this._passiveTransform.y=n.y,this._dropContainer||this._applyRootElementTransform(n.x,n.y),this}withPreviewContainer(n){return this._previewContainer=n,this}_sortFromLastPointerPosition(){const n=this._lastKnownPointerPosition;n&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(n),n)}_removeSubscriptions(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe()}_destroyPreview(){this._preview?.remove(),this._previewRef?.destroy(),this._preview=this._previewRef=null}
1_destroyPlaceholder(){this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._placeholderRef=null}_endDragSequence(n){if(this._dragDropRegistry.isDragging(this)&&(this._removeSubscriptions(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),this._hasStartedDragging))if(this.released.next({source:this,event:n}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(n),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;const t=this._getPointerPositionOnPage(n);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(t),dropPoint:t,event:n})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(n){V(n)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();const t=this._dropContainer;if(t){const i=this._rootElement,s=i.parentNode,r=this._placeholder=this._createPlaceholderElement(),a=this._anchor=this._anchor||this._document.createComment(""),l=this._getShadowRoot();s.insertBefore(a,i),this._initialTransform=i.style.transform||"",this._preview=this._createPreviewElement(),Ce(i,!1,ge),this._document.body.appendChild(s.replaceChild(r,i)),this._getPreviewInsertionPoint(s,l).appendChild(this._preview),this.started.next({source:this,event:n}),t.start(),this._initialContainer=t,this._initialIndex=t.getItemIndex(this)}else this.started.next({source:this,event:n}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(t?t.getScrollableParents():[])}_initializeDragSequence(n,t){this._parentDragRef&&t.stopPropagation();const i=this.isDragging(),s=V(t),r=!s&&0!==t.button,a=this._rootElement,l=(0,Z.sA)(t),c=!s&&this._lastTouchEventTime&&this._lastTouchEventTime+800>Date.now(),p=s?(0,ce.yG)(t):(0,ce.X6)(t);if(l&&l.draggable&&"mousedown"===t.type&&t.preventDefault(),i||r||c||p)return;if(this._handles.length){const b=a.style;this._rootElementTapHighlight=b.webkitTapHighlightColor||"",b.webkitTapHighlightColor="transparent"}this._hasStartedDragging=this._hasMoved=!1,this._removeSubscriptions(),this._initialClientRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(b=>this._updateOnScroll(b)),this._boundaryElement&&(this._boundaryRect=he(this._boundaryElement));const h=this._previewTemplate;this._pickupPositionInElement=h&&h.template&&!h.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialClientRect,n,t);const m=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(t);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:m.x,y:m.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,t)}_cleanupDragArtifacts(n){Ce(this._rootElement,!0,ge),this._anchor.parentNode.replaceChild(this._rootElement,this._anchor),this._destroyPreview(),this._destroyPlaceholder(),this._initialClientRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{const t=this._dropContainer,i=t.getItemIndex(this),s=this._getPointerPositionOnPage(n),r=this._getDragDistance(s),a=t._isOverContainer(s.x,s.y);this.ended.next({source:this,distance:r,dropPoint:s,event:n}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:t,previousContainer:this._initialContainer,isPointerOverContainer:a,distance:r,dropPoint:s,event:n}),t.drop(this,i,this._initialIndex,this._initialContainer,a,r,s,n),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:n,y:t},{x:i,y:s}){let r=this._initialContainer._getSiblingContainerFromPosition(this,n,t);!r&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(n,t)&&(r=this._initialContainer),r&&r!==this._dropContainer&&this._ngZone.run(()=>{this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._dropContainer=r,this._dropContainer.enter(this,n,t,r===this._initialContainer&&r.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:r,currentIndex:r.getItemIndex(this)})}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(i,s),this._dropContainer._sortItem(this,n,t,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(n,t):this._applyPreviewTransform(n-this._pickupPositionInElement.x,t-this._pickupPositionInElement.y))}_createPreviewElement(){const n=this._previewTemplate,t=this.previewClass,i=n?n.template:null;let s;if(i&&n){const r=n.matchSize?this._initialClientRect:null,a=n.viewContainer.createEmbeddedView(i,n.context);a.detectChanges(),s=Re(a,this._document),this._previewRef=a,n.matchSize?Fe(s,r):s.style.transform=W(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else s=De(this._rootElement),Fe(s,this._initialClientRect),this._initialTransform&&(s.style.transform=this._initialTransform);return pe(s.style,{"pointer-events":"none",margin:"0",position:"fixed",top:"0",left:"0","z-index":`${this._config.zIndex||1e3}`},ge),M(s,!1),s.classList.add("cdk-drag-preview"),s.setAttribute("dir",this._direction),t&&(Array.isArray(t)?t.forEach(r=>s.classList.add(r)):s.classList.add(t)),s}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();const n=this._placeholder.getBoundingClientRect();this._preview.classList.add("cdk-drag-animating"),this._applyPreviewTransform(n.left,n.top);const t=function it(o){const n=getComputedStyle(o),t=de(n,"transition-property"),i=t.find(l=>"transform"===l||"all"===l);if(!i)return 0;const s=t.indexOf(i),r=de(n,"transition-duration"),a=de(n,"transition-delay");return Ee(r[s])+Ee(a[s])}(this._preview);return 0===t?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(i=>{const s=a=>{(!a||(0,Z.sA)(a)===this._preview&&"transform"===a.propertyName)&&(this._preview?.removeEventListener("transitionend",s),i(),clearTimeout(r))},r=setTimeout(s,1.5*t);this._preview.addEventListener("transitionend",s)}
1))}_createPlaceholderElement(){const n=this._placeholderTemplate,t=n?n.template:null;let i;return t?(this._placeholderRef=n.viewContainer.createEmbeddedView(t,n.context),this._placeholderRef.detectChanges(),i=Re(this._placeholderRef,this._document)):i=De(this._rootElement),i.style.pointerEvents="none",i.classList.add("cdk-drag-placeholder"),i}_getPointerPositionInElement(n,t,i){const s=t===this._rootElement?null:t,r=s?s.getBoundingClientRect():n,a=V(i)?i.targetTouches[0]:i,l=this._getViewportScrollPosition();return{x:r.left-n.left+(a.pageX-r.left-l.left),y:r.top-n.top+(a.pageY-r.top-l.top)}}_getPointerPositionOnPage(n){const t=this._getViewportScrollPosition(),i=V(n)?n.touches[0]||n.changedTouches[0]||{pageX:0,pageY:0}:n,s=i.pageX-t.left,r=i.pageY-t.top;if(this._ownerSVGElement){const a=this._ownerSVGElement.getScreenCTM();if(a){const l=this._ownerSVGElement.createSVGPoint();return l.x=s,l.y=r,l.matrixTransform(a.inverse())}}return{x:s,y:r}}_getConstrainedPointerPosition(n){const t=this._dropContainer?this._dropContainer.lockAxis:null;let{x:i,y:s}=this.constrainPosition?this.constrainPosition(n,this,this._initialClientRect,this._pickupPositionInElement):n;if("x"===this.lockAxis||"x"===t?s=this._pickupPositionOnPage.y:("y"===this.lockAxis||"y"===t)&&(i=this._pickupPositionOnPage.x),this._boundaryRect){const{x:r,y:a}=this._pickupPositionInElement,l=this._boundaryRect,{width:c,height:p}=this._getPreviewRect(),h=l.top+a,m=l.bottom-(p-a);i=Oe(i,l.left+r,l.right-(c-r)),s=Oe(s,h,m)}return{x:i,y:s}}_updatePointerDirectionDelta(n){const{x:t,y:i}=n,s=this._pointerDirectionDelta,r=this._pointerPositionAtLastDirectionChange,a=Math.abs(t-r.x),l=Math.abs(i-r.y);return a>this._config.pointerDirectionChangeThreshold&&(s.x=t>r.x?1:-1,r.x=t),l>this._config.pointerDirectionChangeThreshold&&(s.y=i>r.y?1:-1,r.y=i),s}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;const n=this._handles.length>0||!this.isDragging();n!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=n,M(this._rootElement,n))}_removeRootElementListeners(n){n.removeEventListener("mousedown",this._pointerDown,z),n.removeEventListener("touchstart",this._pointerDown,Le),n.removeEventListener("dragstart",this._nativeDragStart,z)}_applyRootElementTransform(n,t){const i=W(n,t),s=this._rootElement.style;null==this._initialTransform&&(this._initialTransform=s.transform&&"none"!=s.transform?s.transform:""),s.transform=K(i,this._initialTransform)}_applyPreviewTransform(n,t){const i=this._previewTemplate?.template?void 0:this._initialTransform,s=W(n,t);this._preview.style.transform=K(s,i)}_getDragDistance(n){const t=this._pickupPositionOnPage;return t?{x:n.x-t.x,y:n.y-t.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:n,y:t}=this._passiveTransform;if(0===n&&0===t||this.isDragging()||!this._boundaryElement)return;const i=this._rootElement.getBoundingClientRect(),s=this._boundaryElement.getBoundingClientRect();if(0===s.width&&0===s.height||0===i.width&&0===i.height)return;const r=s.left-i.left,a=i.right-s.right,l=s.top-i.top,c=i.bottom-s.bottom;s.width>i.width?(r>0&&(n+=r),a>0&&(n-=a)):n=0,s.height>i.height?(l>0&&(t+=l),c>0&&(t-=c)):t=0,(n!==this._passiveTransform.x||t!==this._passiveTransform.y)&&this.setFreeDragPosition({y:t,x:n})}_getDragStartDelay(n){const t=this.dragStartDelay;return"number"==typeof t?t:V(n)?t.touch:t?t.mouse:0}_updateOnScroll(n){const t=this._parentPositions.handleScroll(n);if(t){const i=(0,Z.sA)(n);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&Y(this._boundaryRect,t.top,t.left),this._pickupPositionOnPage.x+=t.left,this._pickupPositionOnPage.y+=t.top,this._dropContainer||(this._activeTransform.x-=t.left,this._activeTransform.y-=t.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return void 0===this._cachedShadowRoot&&(this._cachedShadowRoot=(0,Z.kV)(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(n,t){const i=this._previewContainer||"global";if("parent"===i)return n;if("global"===i){const s=this._document;return t||s.fullscreenElement||s.webkitFullscreenElement||s.mozFullScreenElement||s.msFullscreenElement||s.body}return(0,S.fI)(i)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialClientRect),this._previewRect}_getTargetHandle(n){return this._handles.find(t=>n.target&&(n.target===t||t.contains(n.target)))}}function W(o,n){return`translate3d(${Math.round(o)}px, ${Math.round(n)}px, 0)`}function Oe(o,n,t){return Math.max(n,Math.min(t,o))}function V(o){return"t"===o.type[0]}function Re(o,n){const t=o.rootNodes;if(1===t.length&&t[0].nodeType===n.ELEMENT_NODE)return t[0];const i=n.createElement("div");return t.forEach(s=>i.appendChild(s)),i}function Fe(o,n){o.style.width=`${n.width}px`,o.style.height=`${n.height}px`,o.style.transform=W(n.left,n.top)}function Q(o,n){return Math.max(0,Math.min(n,o))}class at{constructor(n,t){this._element=n,this._dragDropRegistry=t,this._itemPositions=[],this.orientation="vertical",this._previousSwap={drag:null,delta:0,overlaps:!1}}start(n){this.withItems(n)}sort(n,t,i,s){const r=this._itemPositions,a=this._getItemIndexFromPointerPosition(n,t,i,s);if(-1===a&&r.length>0)return null;const l="horizontal"===this.orientation,c=r.findIndex(P=>P.drag===n),p=r[a],m=p.clientRect,b=c>a?1:-1,D=this._getItemOffsetPx(r[c].clientRect,m,b),F=this._getSiblingOffsetPx(c,r,b),ae=r.slice();return function rt(o,n,t){const i=Q(n,o.length-1),s=Q(t,o.length-1);if(i===s)return;const r=o[i],a=s<i?-1:1;for(let l=i;l!==s;l+=a)o[l]=o[l+a];o[s]=r}(r,c,a),r.forEach((P,xe)=>{if(ae[xe]===P)return;const le=P.drag===n,B=le?D:F,j=le?n.getPlaceholderElement():P.drag.getRootElement();P.offset+=B,l?(j.style.transform=K(`translate3d(${Math.round(P.offset)}px, 0, 0)`,P.initialTransform),Y(P.clientRect,0,B)):(j.style.transform=K(`translate3d(0, ${Math.round(P.offset)}px, 0)`,P.initialTransform),Y(P.clientRect,B,0))}),this._previousSwap.overlaps=ue(m,t,i),this._previousSwap.drag=p.drag,this._previousSwap.delta=l?s.x:s.y,{previousIndex:c,currentIndex:a}}enter(n,t,i,s){const r=null==s||s<0?this._getItemIndexFromPointerPosition(n,t,i):s,a=this._activeDraggables,l=a.indexOf(n),c=n.getPlaceholderElement();let p=a[r];if(p===n&&(p=a[r+1]),!p&&(null==r||-1===r||r<a.length-1)&&this._shouldEnterAsFirstChild(t,i)&&(p=a[0]),l>-1&&a.splice(l,1),p&&!this._dragDropRegistry.isDragging(p)){const h=p.getRootElement();h.parentElement.insertBefore(c,h),a.splice(r,0,n)}else(0,S.fI)(this._element).appendChild(c),a.push(n);c.style.transform="",this._cacheItemPositions()}withItems(n){this._activeDraggables=n.slice(),this._cacheItemPositions()}withSortPredicate(n){this._sortPredicate=n}
1reset(){this._activeDraggables.forEach(n=>{const t=n.getRootElement();if(t){const i=this._itemPositions.find(s=>s.drag===n)?.initialTransform;t.style.transform=i||""}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(n){return("horizontal"===this.orientation&&"rtl"===this.direction?this._itemPositions.slice().reverse():this._itemPositions).findIndex(i=>i.drag===n)}updateOnScroll(n,t){this._itemPositions.forEach(({clientRect:i})=>{Y(i,n,t)}),this._itemPositions.forEach(({drag:i})=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition()})}_cacheItemPositions(){const n="horizontal"===this.orientation;this._itemPositions=this._activeDraggables.map(t=>{const i=t.getVisibleElement();return{drag:t,offset:0,initialTransform:i.style.transform||"",clientRect:he(i)}}).sort((t,i)=>n?t.clientRect.left-i.clientRect.left:t.clientRect.top-i.clientRect.top)}_getItemOffsetPx(n,t,i){const s="horizontal"===this.orientation;let r=s?t.left-n.left:t.top-n.top;return-1===i&&(r+=s?t.width-n.width:t.height-n.height),r}_getSiblingOffsetPx(n,t,i){const s="horizontal"===this.orientation,r=t[n].clientRect,a=t[n+-1*i];let l=r[s?"width":"height"]*i;if(a){const c=s?"left":"top",p=s?"right":"bottom";-1===i?l-=a.clientRect[c]-r[p]:l+=r[c]-a.clientRect[p]}return l}_shouldEnterAsFirstChild(n,t){if(!this._activeDraggables.length)return!1;const i=this._itemPositions,s="horizontal"===this.orientation;if(i[0].drag!==this._activeDraggables[0]){const a=i[i.length-1].clientRect;return s?n>=a.right:t>=a.bottom}{const a=i[0].clientRect;return s?n<=a.left:t<=a.top}}_getItemIndexFromPointerPosition(n,t,i,s){const r="horizontal"===this.orientation,a=this._itemPositions.findIndex(({drag:l,clientRect:c})=>l!==n&&((!s||l!==this._previousSwap.drag||!this._previousSwap.overlaps||(r?s.x:s.y)!==this._previousSwap.delta)&&(r?t>=Math.floor(c.left)&&t<Math.floor(c.right):i>=Math.floor(c.top)&&i<Math.floor(c.bottom))));return-1!==a&&this._sortPredicate(a,n)?a:-1}}const Ue=.05;class lt{constructor(n,t,i,s,r){this._dragDropRegistry=t,this._ngZone=s,this._viewportRuler=r,this.disabled=!1,this.sortingDisabled=!1,this.autoScrollDisabled=!1,this.autoScrollStep=2,this.enterPredicate=()=>!0,this.sortPredicate=()=>!0,this.beforeStarted=new E.xQ,this.entered=new E.xQ,this.exited=new E.xQ,this.dropped=new E.xQ,this.sorted=new E.xQ,this._isDragging=!1,this._draggables=[],this._siblings=[],this._activeSiblings=new Set,this._viewportScrollSubscription=q.w.EMPTY,this._verticalScrollDirection=0,this._horizontalScrollDirection=0,this._stopScrollTimers=new E.xQ,this._cachedShadowRoot=null,this._startScrollInterval=()=>{this._stopScrolling(),(0,We.F)(0,$e.Z).pipe((0,tt.R)(this._stopScrollTimers)).subscribe(()=>{const a=this._scrollNode,l=this.autoScrollStep;1===this._verticalScrollDirection?a.scrollBy(0,-l):2===this._verticalScrollDirection&&a.scrollBy(0,l),1===this._horizontalScrollDirection?a.scrollBy(-l,0):2===this._horizontalScrollDirection&&a.scrollBy(l,0)})},this.element=(0,S.fI)(n),this._document=i,this.withScrollableParents([this.element]),t.registerDropContainer(this),this._parentPositions=new ye(i),this._sortStrategy=new at(this.element,t),this._sortStrategy.withSortPredicate((a,l)=>this.sortPredicate(a,l,this))}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(n,t,i,s){this._draggingStarted(),null==s&&this.sortingDisabled&&(s=this._draggables.indexOf(n)),this._sortStrategy.enter(n,t,i,s),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:n,container:this,currentIndex:this.getItemIndex(n)})}exit(n){this._reset(),this.exited.next({item:n,container:this})}drop(n,t,i,s,r,a,l,c={}){this._reset(),this.dropped.next({item:n,currentIndex:t,previousIndex:i,container:this,previousContainer:s,isPointerOverContainer:r,distance:a,dropPoint:l,event:c})}withItems(n){const t=this._draggables;
1return this._draggables=n,n.forEach(i=>i._withDropContainer(this)),this.isDragging()&&(t.filter(s=>s.isDragging()).every(s=>-1===n.indexOf(s))?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(n){return this._sortStrategy.direction=n,this}connectedTo(n){return this._siblings=n.slice(),this}withOrientation(n){return this._sortStrategy.orientation=n,this}withScrollableParents(n){const t=(0,S.fI)(this.element);return this._scrollableElements=-1===n.indexOf(t)?[t,...n]:n.slice(),this}getScrollableParents(){return this._scrollableElements}getItemIndex(n){return this._isDragging?this._sortStrategy.getItemIndex(n):this._draggables.indexOf(n)}isReceiving(){return this._activeSiblings.size>0}_sortItem(n,t,i,s){if(this.sortingDisabled||!this._clientRect||!Ae(this._clientRect,.05,t,i))return;const r=this._sortStrategy.sort(n,t,i,s);r&&this.sorted.next({previousIndex:r.previousIndex,currentIndex:r.currentIndex,container:this,item:n})}_startScrollingIfNecessary(n,t){if(this.autoScrollDisabled)return;let i,s=0,r=0;if(this._parentPositions.positions.forEach((a,l)=>
1{l===this._document||!a.clientRect||i||Ae(a.clientRect,.05,n,t)&&([s,r]=function ct(o,n,t,i){const s=ke(n,i),r=Ne(n,t);let a=0,l=0;if(s){const c=o.scrollTop;1===s?c>0&&(a=1):o.scrollHeight-c>o.clientHeight&&(a=2)}if(r){const c=o.scrollLeft;1===r?c>0&&(l=1):o.scrollWidth-c>o.clientWidth&&(l=2)}return[a,l]}(l,a.clientRect,n,t),(s||r)&&(i=l))}),!s&&!r){const{width:a,height:l}=this._viewportRuler.getViewportSize(),c={width:a,height:l,top:0,right:a,bottom:l,left:0};s=ke(c,t),r=Ne(c,n),i=window}i&&(s!==this._verticalScrollDirection||r!==this._horizontalScrollDirection||i!==this._scrollNode)&&(this._verticalScrollDirection=s,this._horizontalScrollDirection=r,this._scrollNode=i,(s||r)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){const n=(0,S.fI)(this.element).style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=n.msScrollSnapType||n.scrollSnapType||"",n.scrollSnapType=n.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){const n=(0,S.fI)(this.element);this._parentPositions.cache(this._scrollableElements),this._clientRect=this._parentPositions.positions.get(n).clientRect}_reset(){this._isDragging=!1;const n=(0,S.fI)(this.element).style;n.scrollSnapType=n.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(t=>t._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_isOverContainer(n,t){return null!=this._clientRect&&ue(this._clientRect,n,t)}_getSiblingContainerFromPosition(n,t,i){return this._siblings.find(s=>s._canReceive(n,t,i))}_canReceive(n,t,i){if(!this._clientRect||!ue(this._clientRect,t,i)||!this.enterPredicate(n,this))return!1;const s=this._getShadowRoot().elementFromPoint(t,i);if(!s)return!1;const r=(0,S.fI)(this.element);return s===r||r.contains(s)}_startReceiving(n,t){const i=this._activeSiblings;!i.has(n)&&t.every(s=>this.enterPredicate(s,this)||this._draggables.indexOf(s)>-1)&&(i.add(n),this._cacheParentPositions(),this._listenToScrollEvents())}_stopReceiving(n){this._activeSiblings.delete(n),this._viewportScrollSubscription.unsubscribe()}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(n=>{if(this.isDragging()){const t=this._parentPositions.handleScroll(n);t&&this._sortStrategy.updateOnScroll(t.top,t.left)}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){const n=(0,Z.kV)((0,S.fI)(this.element));this._cachedShadowRoot=n||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){const n=this._sortStrategy.getActiveItemsSnapshot().filter(t=>t.isDragging());this._siblings.forEach(t=>t._startReceiving(this,n))}}function ke(o,n){const{top:t,bottom:i,height:s}=o,r=s*Ue;return n>=t-r&&n<=t+r?1:n>=i-r&&n<=i+r?2:0}function Ne(o,n){const{left:t,right:i,width:s}=o,r=s*Ue;return n>=t-r&&n<=t+r?1:n>=i-r&&n<=i+r?2:0}const $=(0,Z.i$)({passive:!1,capture:!0});let pt=(()=>{class o{constructor(t,i){this._ngZone=t,this._dropInstances=new Set,this._dragInstances=new Set,this._activeDragInstances=[],this._globalListeners=new Map,this._draggingPredicate=s=>s.isDragging(),this.pointerMove=new E.xQ,this.pointerUp=new E.xQ,this.scroll=new E.xQ,this._preventDefaultWhileDragging=s=>{this._activeDragInstances.length>0&&s.preventDefault()},this._persistentTouchmoveListener=s=>{this._activeDragInstances.length>0&&(this._activeDragInstances.some(this._draggingPredicate)&&s.preventDefault(),this.pointerMove.next(s))},this._document=i}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,$)})}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,$)}startDragging(t,i){if(!(this._activeDragInstances.indexOf(t)>-1)&&(this._activeDragInstances.push(t),1===this._activeDragInstances.length)){const s=i.type.startsWith("touch");
1this._globalListeners.set(s?"touchend":"mouseup",{handler:r=>this.pointerUp.next(r),options:!0}).set("scroll",{handler:r=>this.scroll.next(r),options:!0}).set("selectstart",{handler:this._preventDefaultWhileDragging,options:$}),s||this._globalListeners.set("mousemove",{handler:r=>this.pointerMove.next(r),options:$}),this._ngZone.runOutsideAngular(()=>{this._globalListeners.forEach((r,a)=>{this._document.addEventListener(a,r.handler,r.options)})})}}stopDragging(t){const i=this._activeDragInstances.indexOf(t);i>-1&&(this._activeDragInstances.splice(i,1),0===this._activeDragInstances.length&&this._clearGlobalListeners())}isDragging(t){return this._activeDragInstances.indexOf(t)>-1}scrolled(t){const i=[this.scroll];return t&&t!==this._document&&i.push(new Xe.y(s=>this._ngZone.runOutsideAngular(()=>{const a=l=>{this._activeDragInstances.length&&s.next(l)};return t.addEventListener("scroll",a,!0),()=>{t.removeEventListener("scroll",a,!0)}}))),(0,et.T)(...i)}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,i)=>{this._document.removeEventListener(i,t.handler,t.options)}),this._globalListeners.clear()}}return o.\u0275fac=function(t){return new(t||o)(e.LFG(e.R0b),e.LFG(g.K0))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();const dt={dragStartThreshold:5,pointerDirectionChangeThreshold:5};let ht=(()=>{class o{constructor(t,i,s,r){this._document=t,this._ngZone=i,this._viewportRuler=s,this._dragDropRegistry=r}createDrag(t,i=dt){return new ot(t,i,this._document,this._ngZone,this._viewportRuler,this._dragDropRegistry)}createDropList(t){return new lt(t,this._dragDropRegistry,this._document,this._ngZone,this._viewportRuler)}}return o.\u0275fac=function(t){return new(t||o)(e.LFG(g.K0),e.LFG(e.R0b),e.LFG(Se.rL),e.LFG(pt))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})(),Me=(()=>{class o{}return o.\u0275fac=function(t){return new(t||o)}
1,o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({providers:[ht],imports:[Se.ZD]}),o})();var ut=d(529),v=d(4006),J=(d(5017),d(3238));let Tt=(()=>{class o{}return o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({imports:[J.BQ,J.si,J.BQ]}),o})();var O=d(8044),L=d(7160),X=d(5861),St=d(5254),me=d(4850),f=d(6295);class fe{constructor(n){this.rawFile=n;let i=function Ct(o){return!(!o||!(o.nodeName||o.prop&&o.attr&&o.find))}(n)?n.value:n;this["_createFrom"+("string"==typeof i?"FakePath":"Object")](i)}_createFromFakePath(n){this.lastModifiedDate=void 0,this.size=void 0,this.type="like/"+n.slice(n.lastIndexOf(".")+1).toLowerCase(),this.name=n.slice(n.lastIndexOf("/")+n.lastIndexOf("\\")+2)}_createFromObject(n){this.size=n.size,this.type=n.type,this.name=n.name}}class Et{constructor(n,t,i){this.url="/",this.headers=[],this.withCredentials=!0,this.formData=[],this.isReady=!1,this.isUploading=!1,this.isUploaded=!1,this.isSuccess=!1,this.isCancel=!1,this.isError=!1,this.progress=0,this.index=void 0,this.uploader=n,this.some=t,this.options=i,this.file=new fe(t),this._file=t,n.options&&(this.method=n.options.method||"POST",this.alias=n.options.itemAlias||"file"),this.url=n.options.url}upload(){try{this.uploader.uploadItem(this)}catch{this.uploader._onCompleteItem(this,"",0,{}),this.uploader._onErrorItem(this,"",0,{})}}cancel(){this.uploader.cancelItem(this)}remove(){this.uploader.removeFromQueue(this)}onBeforeUpload(){}onBuildForm(n){return{form:n}}onProgress(n){return{progress:n}}onSuccess(n,t,i){return{response:n,status:t,headers:i}}onError(n,t,i){return{response:n,status:t,headers:i}}onCancel(n,t,i){return{response:n,status:t,headers:i}}onComplete(n,t,i){return{response:n,status:t,headers:i}}_onBeforeUpload(){this.isReady=!0,this.isUploading=!0,this.isUploaded=!1,this.isSuccess=!1,this.isCancel=!1,this.isError=!1,this.progress=0,this.onBeforeUpload()}_onBuildForm(n){this.onBuildForm(n)}_onProgress(n){this.progress=n,this.onProgress(n)}_onSuccess(n,t,i){this.isReady=!1,this.isUploading=!1,this.isUploaded=!0,this.isSuccess=!0,this.isCancel=!1,this.isError=!1,this.progress=100,this.index=void 0,this.onSuccess(n,t,i)}_onError(n,t,i){this.isReady=!1,this.isUploading=!1,this.isUploaded=!0,this.isSuccess=!1,this.isCancel=!1,this.isError=!0,this.progress=0,this.index=void 0,this.onError(n,t,i)}_onCancel(n,t,i){this.isReady=!1,this.isUploading=!1,this.isUploaded=!1,this.isSuccess=!1,this.isCancel=!0,this.isError=!1,this.progress=0,this.index=void 0,this.onCancel(n,t,i)}_onComplete(n,t,i){this.onComplete(n,t,i),this.uploader.options.removeAfterUpload&&this.remove()}_prepareToUploading(){this.index=this.index||++this.uploader._nextIndex,this.isReady=!0}}let At=(()=>{class o{static getMimeClass(t){let i="application";return-1!==this.mime_psd.indexOf(t.type)||t.type.match("image.*")?i="image":t.type.match("video.*")?i="video":t.type.match("audio.*")?i="audio":"application/pdf"===t.type?i="pdf":-1!==this.mime_compress.indexOf(t.type)?i="compress":-1!==this.mime_doc.indexOf(t.type)?i="doc":-1!==this.mime_xsl.indexOf(t.type)?i="xls":-1!==this.mime_ppt.indexOf(t.type)&&(i="ppt"),"application"===i&&(i=this.fileTypeDetection(t.name)),i}static fileTypeDetection(t){let i={jpg:"image",jpeg:"image",tif:"image",psd:"image",bmp:"image",png:"image",nef:"image",tiff:"image",cr2:"image",dwg:"image",cdr:"image",ai:"image",indd:"image",pin:"image",cdp:"image",skp:"image",stp:"image","3dm":"image",mp3:"audio",wav:"audio",wma:"audio",mod:"audio",m4a:"audio",compress:"compress",zip:"compress",rar:"compress","7z":"compress",lz:"compress",z01:"compress",bz2:"compress",gz:"compress",pdf:"pdf",xls:"xls",xlsx:"xls",ods:"xls",mp4:"video",avi:"video",wmv:"video",mpg:"video",mts:"video",flv:"video","3gp":"video",vob:"video",m4v:"video",mpeg:"video",m2ts:"video",mov:"video",doc:"doc",docx:"doc",eps:"doc",txt:"doc",odt:"doc",rtf:"doc",ppt:"ppt",pptx:"ppt",pps:"ppt",ppsx:"ppt",odp:"ppt"},s=t.split(".");if(s.length<2)return"application";let r=s[s.length-1].toLowerCase();return void 0===i[r]?"application":i[r]}}return o.mime_doc=["application/msword","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-word.document.macroEnabled.12","application/vnd.ms-word.template.macroEnabled.12"],o.mime_xsl=["application/vnd.ms-excel","application/vnd.ms-excel","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.ms-excel.sheet.macroEnabled.12","application/vnd.ms-excel.template.macroEnabled.12","application/vnd.ms-excel.addin.macroEnabled.12","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],o.mime_ppt=["application/vnd.ms-powerpoint","application/vnd.ms-powerpoint","application/vnd.ms-powerpoint","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.presentationml.template","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/vnd.ms-powerpoint.addin.macroEnabled.12","application/vnd.ms-powerpoint.presentation.macroEnabled.12","application/vnd.ms-powerpoint.presentation.macroEnabled.12","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],o.mime_psd=["image/photoshop","image/x-photoshop","image/psd","application/photoshop","application/psd","zz-application/zz-winassoc-psd"],o.mime_compress=["application/x-gtar","application/x-gcompress","application/compress","application/x-tar","application/x-rar-compressed","application/octet-stream","application/x-zip-compressed","application/zip-compressed","application/x-7z-compressed","application/gzip","application/x-bzip2"],o})();class Dt{constructor(n){this.isUploading=!1,this.queue=[],this.progress=0,this._nextIndex=0,this.options={autoUpload:!1,isHTML5:!0,filters:[],removeAfterUpload:!1,disableMultipart:!1,formatDataFunction:t=>t._file,formatDataFunctionIsAsync:!1},this.setOptions(n),this.response=new e.vpe}setOptions(n){this.options=Object.assign(this.options,n),this.authToken=this.options.authToken,this.authTokenHeader=this.options.authTokenHeader||"Authorization",this.autoUpload=this.options.autoUpload,this.options.filters.unshift({name:"queueLimit",fn:this._queueLimitFilter}),this.options.maxFileSize&&this.options.filters.unshift({name:"fileSize",fn:this._fileSizeFilter}),this.options.allowedFileType&&this.options.filters.unshift({name:"fileType",fn:this._fileTypeFilter}),this.options.allowedMimeType&&this.options.filters.unshift({name:"mimeType",fn:this._mimeTypeFilter});for(let t=0;t<this.queue.length;t++)this.queue[t].url=this.options.url}addToQueue(n,t,i){let s=[];for(let c of n)s.push(c);let r=this._getFilters(i),a=this.queue.length,l=[];s.map(c=>{t||(t=this.options);let p=new fe(c);if(this._isValidFile(p,r,t)){let h=new Et(this,c,t);
1l.push(h),this.queue.push(h),this._onAfterAddingFile(h)}else this._onWhenAddingFileFailed(p,r[this._failFilterIndex],t)}),this.queue.length!==a&&(this._onAfterAddingAll(l),this.progress=this._getTotalProgress()),this._render(),this.options.autoUpload&&this.uploadAll()}removeFromQueue(n){let t=this.getIndexOfItem(n),i=this.queue[t];i.isUploading&&i.cancel(),this.queue.splice(t,1),this.progress=this._getTotalProgress()}clearQueue(){for(;this.queue.length;)this.queue[0].remove();this.progress=0}uploadItem(n){let t=this.getIndexOfItem(n),i=this.queue[t],s=this.options.isHTML5?"_xhrTransport":"_iframeTransport";i._prepareToUploading(),!this.isUploading&&(this.isUploading=!0,this[s](i))}cancelItem(n){let t=this.getIndexOfItem(n),i=this.queue[t];i&&i.isUploading&&(this.options.isHTML5?i._xhr:i._form).abort()}uploadAll(){let n=this.getNotUploadedItems().filter(t=>!t.isUploading);n.length&&(n.map(t=>t._prepareToUploading()),n[0].upload())}cancelAll(){this.getNotUploadedItems().map(t=>t.cancel())}isFile(n){return function yt(o){return File&&o instanceof File}(n)}isFileLikeObject(n){return n instanceof fe}getIndexOfItem(n){return"number"==typeof n?n:this.queue.indexOf(n)}getNotUploadedItems(){return this.queue.filter(n=>!n.isUploaded)}getReadyItems(){return this.queue.filter(n=>n.isReady&&!n.isUploading).sort((n,t)=>n.index-t.index)}destroy(){}onAfterAddingAll(n){return{fileItems:n}}onBuildItemForm(n,t){return{fileItem:n,form:t}}onAfterAddingFile(n){return{fileItem:n}}onWhenAddingFileFailed(n,t,i){return{item:n,filter:t,options:i}}onBeforeUploadItem(n){return{fileItem:n}}onProgressItem(n,t){return{fileItem:n,progress:t}}onProgressAll(n){return{progress:n}}onSuccessItem(n,t,i,s){return{item:n,response:t,status:i,headers:s}}onErrorItem(n,t,i,s){return{item:n,response:t,status:i,headers:s}}onCancelItem(n,t,i,s){return{item:n,response:t,status:i,headers:s}}onCompleteItem(n,t,i,s){return{item:n,response:t,status:i,headers:s}}onCompleteAll(){}_mimeTypeFilter(n){return!(this.options.allowedMimeType&&-1===this.options.allowedMimeType.indexOf(n.type))}_fileSizeFilter(n){return!(this.options.maxFileSize&&n.size>this.options.maxFileSize)}_fileTypeFilter(n){return!(this.options.allowedFileType&&-1===this.options.allowedFileType.indexOf(At.getMimeClass(n)))}_onErrorItem(n,t,i,s){n._onError(t,i,s),this.onErrorItem(n,t,i,s)}_onCompleteItem(n,t,i,s){n._onComplete(t,i,s),this.onCompleteItem(n,t,i,s);let r=this.getReadyItems()[0];this.isUploading=!1,r?r.upload():(this.onCompleteAll(),this.progress=this._getTotalProgress(),this._render())}_headersGetter(n){return t=>t?n[t.toLowerCase()]||void 0:n}_xhrTransport(n){let s,t=this,i=n._xhr=new XMLHttpRequest;if(this._onBeforeUploadItem(n),"number"!=typeof n._file.size)throw new TypeError("The file specified is no longer valid");if(this.options.disableMultipart)s=this.options.formatDataFunction(n);else{s=new FormData,this._onBuildItemForm(n,s);const r=()=>s.append(n.alias,n._file,n.file.name);this.options.parametersBeforeFiles||r(),void 0!==this.options.additionalParameter&&Object.keys(this.options.additionalParameter).forEach(a=>{let l=this.options.additionalParameter[a];"string"==typeof l&&l.indexOf("{{file_name}}")>=0&&(l=l.replace("{{file_name}}",n.file.name)),s.append(a,l)}),this.options.parametersBeforeFiles&&r()}if(i.upload.onprogress=r=>{let a=Math.round(r.lengthComputable?100*r.loaded/r.total:0);this._onProgressItem(n,a)},i.onload=()=>{let r=this._parseHeaders(i.getAllResponseHeaders()),a=this._transformResponse(i.response,r);this["_on"+(this._isSuccessCode(i.status)?"Success":"Error")+"Item"](n,a,i.status,r),this._onCompleteItem(n,a,i.status,r)},i.onerror=()=>{let r=this._parseHeaders(i.getAllResponseHeaders()),a=this._transformResponse(i.response,r);this._onErrorItem(n,a,i.status,r),this._onCompleteItem(n,a,i.status,r)},i.onabort=()=>{let r=this._parseHeaders(i.getAllResponseHeaders()),a=this._transformResponse(i.response,r);this._onCancelItem(n,a,i.status,r),this._onCompleteItem(n,a,i.status,r)},i.open(n.method,n.url,!0),i.withCredentials=n.withCredentials,this.options.headers)for(let r of this.options.headers)i.setRequestHeader(r.name,r.value);if(n.headers.length)for(let r of n.headers)i.setRequestHeader(r.name,r.value);this.authToken&&i.setRequestHeader(this.authTokenHeader,this.authToken),i.onreadystatechange=function(){i.readyState==XMLHttpRequest.DONE&&t.response.emit(i.responseText)},this.options.formatDataFunctionIsAsync?s.then(r=>i.send(JSON.stringify(r))):i.send(s),this._render()}_getTotalProgress(n=0){if(this.options.removeAfterUpload)return n;let t=this.getNotUploadedItems().length,s=100/this.queue.length;return Math.round((t?this.queue.length-t:this.queue.length)*s+n*s/100)}
1_getFilters(n){if(!n)return this.options.filters;if(Array.isArray(n))return n;if("string"==typeof n){let t=n.match(/[^\s,]+/g);return this.options.filters.filter(i=>-1!==t.indexOf(i.name))}return this.options.filters}_render(){}_queueLimitFilter(){return void 0===this.options.queueLimit||this.queue.length<this.options.queueLimit}_isValidFile(n,t,i){return this._failFilterIndex=-1,!t.length||t.every(s=>(this._failFilterIndex++,s.fn.call(this,n,i)))}_isSuccessCode(n){return n>=200&&n<300||304===n}_transformResponse(n,t){return n}_parseHeaders(n){let i,s,r,t={};return n&&n.split("\n").map(a=>{r=a.indexOf(":"),i=a.slice(0,r).trim().toLowerCase(),s=a.slice(r+1).trim(),i&&(t[i]=t[i]?t[i]+", "+s:s)}),t}_onWhenAddingFileFailed(n,t,i){this.onWhenAddingFileFailed(n,t,i)}_onAfterAddingFile(n){this.onAfterAddingFile(n)}_onAfterAddingAll(n){this.onAfterAddingAll(n)}_onBeforeUploadItem(n){n._onBeforeUpload(),this.onBeforeUploadItem(n)}_onBuildItemForm(n,t){n._onBuildForm(t),this.onBuildItemForm(n,t)}_onProgressItem(n,t){let i=this._getTotalProgress(t);this.progress=i,n._onProgress(t),this.onProgressItem(n,t),this.onProgressAll(i),this._render()}_onSuccessItem(n,t,i,s){n._onSuccess(t,i,s),this.onSuccessItem(n,t,i,s)}_onCancelItem(n,t,i,s){n._onCancel(t,i,s),this.onCancelItem(n,t,i,s)}}let It=(()=>{class o{constructor(t){this.onFileSelected=new e.vpe,this.element=t}getOptions(){return this.uploader.options}getFilters(){return{}}isEmptyAfterSelection(){return!!this.element.nativeElement.attributes.multiple}onChange(){let t=this.element.nativeElement.files,i=this.getOptions(),s=this.getFilters();this.uploader.addToQueue(t,i,s),this.onFileSelected.emit(t),this.isEmptyAfterSelection()&&(this.element.nativeElement.value="")}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(e.SBq))},o.\u0275dir=e.lG2({type:o,selectors:[["","ng2FileSelect",""]],hostBindings:function(t,i){1&t&&e.NdJ("change",function(){return i.onChange()})},inputs:{uploader:"uploader"},outputs:{onFileSelected:"onFileSelected"}}),o})(),Ve=(()=>{class o{}return o.\u0275fac=function(t){return new(t||o)}
1,o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({imports:[g.ez]}),o})();var w=d(9734),R=d(4296);let _e=(()=>{class o{constructor(t,i,s,r,a){this.uploadersFileIsOver=new Map,this.swalErrorService=t,this.mimeTypesService=i,this.authService=s,this.json=r,this.dom=a}createUploader(t,i,s=1,r=5){return this.mimeTypesService.getMimeTypesByExtensions(i).pipe((0,me.U)(a=>{const l={url:t,queueLimit:s,maxFileSize:1024*r*1024,allowedMimeType:a},c=this.authService.getAuthFromLocalStorage();null!=c?.access_token&&(l.authToken=`Bearer ${c.access_token}`);const p=new Dt(l);return this.uploadersFileIsOver.set(p,!1),this.updateUploaderErrorHandling(p),p}))}updateUploaderErrorHandling(t){t.onWhenAddingFileFailed=i=>{const s=i.size,r=[];t.queue.length+1>(t.options.queueLimit||1)&&r.push("4"),s>(t.options.maxFileSize||5)&&r.push("5"),-1===(t.options.allowedMimeType||[]).indexOf(i.type)&&r.push("3"),r.length&&this.swalErrorService.handleError({error:{message:r}},!1)}}chooseFile(t){this.dom.getElementById(t)?.click()}setFileOverAnother(t,i){this.uploadersFileIsOver.set(i,t)}getFileOverAnother(t){return!0===this.uploadersFileIsOver.get(t)}upload(t){return(0,St.D)(new Promise((i,s)=>{if(!t||!t.queue||!t.queue.length)return s({message:["6"]});this.uploadAll(t,!1,[],(r,a)=>null!=r?s(r):i(1===t.options.queueLimit?a[0]:a))}))}uploadAll(t,i,s,r){let a=!1,l=!1;const c=[];let p=Array.isArray(s)?s:[];i=!0===i,t.uploadAll(),t.onCompleteItem=(h,m)=>{const b=m.replace(")]}',",""),D=this.json.parse(b);if(null==D)return l=!0,c.push({message:["6"]}),h.isUploaded=!1,void(h.isError=!1);if(function Ht(o){return null!=o&&"object"==typeof o&&("error"in o||"statusCode"in o)}(D))return l=!0,c.push(D),h.isUploaded=!1,h.isError=!1,void(401===D.statusCode&&!1===i&&(a=!0));p.push(D);const F=t.queue.indexOf(h);t.queue.splice(F,1)},t.onCompleteAll=()=>{if(!0===a)return this.refreshAccessTokenAndUploadAgain(t,p,r);if(l){const m={message:c.map(b=>b.message||[]).reduce((b,D)=>b.concat(D),[])};return r({error:m},p)}return r(null,p)}}refreshAccessTokenAndUploadAgain(t,i,s){var r=this;return(0,X.Z)(function*(){const a=yield r.authService.refreshAccessToken().toPromise();return null!=a?.access_token?(t.setOptions({authToken:`Bearer ${a.access_token}`}),r.uploadAll(t,!0,i,s)):s({error:{message:["6"]}},i)})()}clearUploadersFileIsOver(){this.uploadersFileIsOver.clear()}}return o.\u0275fac=function(t){return new(t||o)(e.LFG(f.C4),e.LFG(f.$Y),e.LFG("AUTH_SERVICE"),e.LFG(f.rY),e.LFG(g.K0))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o})(),Gt=(()=>{class o{}return o.\u0275fac=function(t){return new(t||o)}
1,o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({providers:[{provide:_e,deps:[f.C4,f.$Y,R.e8,f.rY,g.K0],useFactory:(n,t,i,s,r)=>new _e(n,t,i,s,r)}],imports:[g.ez,f.qw,Me,O.HK,O.ZQ,Ve,w.Dt,f.dO,f.BN]}),o})();var ee=d(4619),U=d(3300),te=d(4130),H=d(7084),ve=d(4034);let qt=(()=>{const n=class{};let o=n;return n.\u0275fac=function(s){return new(s||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[g.ez,f.qw,ve.fA,L.x0,w.Dt,O.HK,te.VI,H.To,ee.vi]}),o})();var ie=d(7788),k=d(7081),u=d(5412),_=d(8201),ne=d(1837),C=d(1086),x=d(2994),A=d(537),y=d(7221),Yt=d(5226),N=d.n(Yt),T=d(9854);let G=(()=>{const n=class{constructor(i,s){this.dialogRef=i,this.title=s.title,this.description=s.description}ngOnInit(){}yes(){this.dialogRef.close(!0)}no(){this.dialogRef.close(!1)}};let o=n;return n.\u0275fac=function(s){return new(s||n)(e.Y36(u.so),e.Y36(u.WI))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-yes-no-dialog"]],decls:10,vars:8,consts:[["mat-dialog-title",""],[3,"innerHTML"],[1,"float-end"],["type","button",1,"btn","btn-light","btn-elevate","me-2",3,"click"],["type","submit",1,"btn","btn-primary","btn-elevate",3,"click"]],template:function(s,r){1&s&&(e.TgZ(0,"h2",0),e._uU(1),e.qZA(),e._UZ(2,"mat-dialog-content",1),e.TgZ(3,"mat-dialog-actions",2)(4,"button",3),e.NdJ("click",function(){return r.no()}),e._uU(5),e.ALo(6,"translate"),e.qZA(),e.TgZ(7,"button",4),e.NdJ("click",function(){return r.yes()}),e._uU(8),e.ALo(9,"translate"),e.qZA()()),2&s&&(e.xp6(1),e.Oqu(r.title),e.xp6(1),e.Q6J("innerHTML",r.description,e.oJD),e.xp6(3),e.hij(" ",e.lcZ(6,4,"GENERAL.NO")," "),e.xp6(3),e.hij(" ",e.lcZ(9,6,"GENERAL.YES")," "))},dependencies:[u.uh,u.xY,u.H8,T.X$]}),o})();var se=d(6451);function Vt(o,n){1&o&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&o&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"AUTH.CHANGE_PASSWORD.EXPIRES")))}function Qt(o,n){1&o&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&o&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"AUTH.CHANGE_PASSWORD.EXPIRED")))}function Jt(o,n){if(1&o&&(e.TgZ(0,"span"),e._uU(1,", "),e.YNc(2,Vt,3,3,"span",0),e.YNc(3,Qt,3,3,"span",0),e._uU(4),e.qZA()),2&o){const t=e.oxw(2);e.xp6(2),e.Q6J("ngIf",t.dateInFuture),e.xp6(1),e.Q6J("ngIf",!t.dateInFuture),e.xp6(1),e.hij(" ",t.expirityDateStr,"")}}const be=function(o,n){return{"fa-eye-slash":o,"fa-eye":n}};function Bt(o,n){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"form",1),e.NdJ("ngSubmit",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.save())}),e.TgZ(2,"div",2)(3,"div",3)(4,"h3",3)(5,"span",4),e._uU(6),e.ALo(7,"translate"),e.qZA(),e.TgZ(8,"span",5),e._uU(9),e.ALo(10,"translate"),e.qZA()()(),e.TgZ(11,"div",6)(12,"button",7),e._uU(13),e.ALo(14,"translate"),e.qZA(),e.TgZ(15,"button",8),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.cancel())}),e._uU(16),e.ALo(17,"translate"),e.qZA()()(),e.TgZ(18,"div",9)(19,"div",10)(20,"div",11)(21,"label",12),e._uU(22),e.ALo(23,"translate"),e.qZA(),e.TgZ(24,"div",13),e._uU(25),e.ALo(26,"luxonDate"),e.YNc(27,Jt,5,3,"span",0),e.qZA()(),e.TgZ(28,"div",14)(29,"label",12),e._uU(30),e.ALo(31,"translate"),e.qZA(),e.TgZ(32,"div",13)(33,"div",15),e._UZ(34,"input",16),e.ALo(35,"translate"),e.TgZ(36,"span",17),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.hidePassword=!s.hidePassword)}),e._UZ(37,"i",18),e.qZA()(),e._UZ(38,"liber-error",19),e.ALo(39,"translate"),e.qZA()(),e.TgZ(40,"div",14)(41,"label",12),e._uU(42),e.ALo(43,"translate"),e.qZA(),e.TgZ(44,"div",13)(45,"div",15),e._UZ(46,"input",20),e.ALo(47,"translate"),e.TgZ(48,"span",17),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.hideCPassword=!s.hideCPassword)}),e._UZ(49,"i",18),e.qZA()(),e._UZ(50,"liber-error",19),e.ALo(51,"translate"),e._UZ(52,"liber-error",21),e.ALo(53,"translate"),e._UZ(54,"liber-error",22),e.ALo(55,"translate"),e._UZ(56,"liber-error",23),e.ALo(57,"translate"),e._UZ(58,"liber-error",24),e.ALo(59,"translate"),e._UZ(60,"liber-error",25),e.ALo(61,"translate"),e._UZ(62,"liber-error",26),e.ALo(63,"translate"),e.qZA()(),e.TgZ(64,"div",14)(65,"label",12),e._uU(66),e.ALo(67,"translate"),e.qZA(),e.TgZ(68,"div",13)(69,"div",15),e._UZ(70,"input",27),e.ALo(71,"translate"),e.TgZ(72,"span",17),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.hideC2Password=!s.hideC2Password)}),e._UZ(73,"i",18),e.qZA()(),e._UZ(74,"liber-error",19),e.ALo(75,"translate"),e._UZ(76,"liber-error",28),e.ALo(77,"translate"),e.qZA()()()()(),e.BQk()}if(2&o){const t=e.oxw();
1e.xp6(1),e.Q6J("formGroup",t.formGroup),e.xp6(5),e.Oqu(e.lcZ(7,53,"PROFILE.CHANGE_PASSWORD.TITLE_CARD")),e.xp6(3),e.Oqu(e.lcZ(10,55,"PROFILE.CHANGE_PASSWORD.SUB_TITLE_CARD")),e.xp6(3),e.Q6J("disabled",t.formGroup.invalid),e.xp6(1),e.hij(" ",e.lcZ(14,57,"PROFILE.CHANGE_PASSWORD.SAVE")," "),e.xp6(3),e.hij(" ",e.lcZ(17,59,"PROFILE.CHANGE_PASSWORD.CANCEL")," "),e.xp6(6),e.Oqu(e.lcZ(23,61,"AUTH.CHANGE_PASSWORD.PASSWORD_CHANGED_AT")),e.xp6(3),e.hij(" ",e.xi3(26,63,t.user.passwordChangedAt,"DATETIME_SHORT"),""),e.xp6(2),e.Q6J("ngIf",t.expirityDateStr),e.xp6(3),e.Oqu(e.lcZ(31,66,"AUTH.CHANGE_PASSWORD.CURRENT_PASSWORD")),e.xp6(4),e.ekj("is-invalid",t.isControlInvalid("currentPassword"))("is-valid",t.isControlValid("currentPassword")),e.s9C("placeholder",e.lcZ(35,68,"AUTH.CHANGE_PASSWORD.CURRENT_PASSWORD")),e.Q6J("type",t.hidePassword?"password":"text"),e.xp6(3),e.Q6J("ngClass",e.WLB(98,be,t.hidePassword,!t.hidePassword)),e.xp6(1),e.Q6J("control",t.formGroup.controls.currentPassword)("message",e.lcZ(39,70,"AUTH.GENERAL.PASSWORD_REQUIRED")),e.xp6(4),e.Oqu(e.lcZ(43,72,"AUTH.CHANGE_PASSWORD.NEW_PASSWORD")),e.xp6(4),e.ekj("is-invalid",t.isControlInvalid("password"))("is-valid",t.isControlValid("password")),e.s9C("placeholder",e.lcZ(47,74,"AUTH.CHANGE_PASSWORD.NEW_PASSWORD")),e.Q6J("type",t.hideCPassword?"password":"text"),e.xp6(3),e.Q6J("ngClass",e.WLB(101,be,t.hideCPassword,!t.hideCPassword)),e.xp6(1),e.Q6J("control",t.formGroup.controls.password)("message",e.lcZ(51,76,"AUTH.GENERAL.PASSWORD_REQUIRED")),e.xp6(2),e.Q6J("control",t.formGroup.controls.password)("message",e.lcZ(53,78,"AUTH.GENERAL.PASSWORD_MIN_LENGTH")),e.xp6(2),e.Q6J("control",t.formGroup.controls.password)("message",e.lcZ(55,80,"AUTH.GENERAL.PASSWORD_SPECIAL_CHARS")),e.xp6(2),e.Q6J("control",t.formGroup.controls.password)("message",e.lcZ(57,82,"AUTH.GENERAL.PASSWORD_NUMBERS")),e.xp6(2),e.Q6J("control",t.formGroup.controls.password)("message",e.lcZ(59,84,"AUTH.GENERAL.PASSWORD_LOWER_CASE")),e.xp6(2),e.Q6J("control",t.formGroup.controls.password)("message",e.lcZ(61,86,"AUTH.GENERAL.PASSWORD_UPPER_CASE")),e.xp6(2),e.Q6J("control",t.formGroup.controls.password)("message",e.lcZ(63,88,"AUTH.GENERAL.PASSWORD_VALID")),e.xp6(4),e.Oqu(e.lcZ(67,90,"AUTH.CHANGE_PASSWORD.VERIFY_PASSWORD")),e.xp6(4),e.ekj("is-invalid",t.isControlInvalid("cPassword"))("is-valid",t.isControlValid("cPassword")),e.s9C("placeholder",e.lcZ(71,92,"AUTH.CHANGE_PASSWORD.VERIFY_PASSWORD")),e.Q6J("type",t.hideC2Password?"password":"text"),e.xp6(3),e.Q6J("ngClass",e.WLB(104,be,t.hideC2Password,!t.hideC2Password)),e.xp6(1),e.Q6J("control",t.formGroup.controls.cPassword)("message",e.lcZ(75,94,"AUTH.GENERAL.PASSWORD_REQUIRED")),e.xp6(2),e.Q6J("control",t.formGroup.controls.cPassword)("message",e.lcZ(77,96,"AUTH.CHANGE_PASSWORD.NO_MATCH"))}}let jt=(()=>{const n=class{constructor(i,s,r,a,l,c,p,h,m,b){this.userService=i,this.httpService=s,this.fb=r,this.translate=a,this.handleError=l,this.dialog=c,this.reCaptchaService=p,this.pageInfoService=h,this.configService=m,this.cdr=b,this.subscriptions=[],this.recaptchaAction="changepassword",this.hidePassword=!0,this.hideCPassword=!0,this.hideC2Password=!0,this.dateInFuture=!1}ngOnInit(){this.setBreadcrumbs(),this.user=Object.assign({},this.userService.currentUserValue),this.firstUserState=Object.assign({},this.user),this.getConfigs(),this.loadForm(),this.reCaptchaService.setBadgeVisibility(!0)}ngOnDestroy(){this.subscriptions.forEach(i=>i.unsubscribe()),this.reCaptchaService.setBadgeVisibility(!1)}getConfigs(){const i=this.configService.getLast().pipe((0,x.b)(s=>{this.config=structuredClone(s);const r=ne.ou.fromISO(this.user?.passwordChangedAt?.toString()).plus({days:this.config?.passwordExpirityDays??0});r>ne.ou.now()&&(this.dateInFuture=!0),this.expirityDateStr=r.toRelative({unit:["days","hours","minutes","seconds"]})}),(0,A.x)(()=>{this.cdr.markForCheck()})).subscribe();this.subscriptions.push(i)}loadForm(){this.formGroup=this.fb.group({currentPassword:["",_.k.compose([_.k.required])],password:["",_.k.compose([_.k.required,_.k.isValidPassword])],cPassword:["",_.k.compose([_.k.required,_.k.controlsValueMatch("password")])]})}save(){var i=this;return(0,X.Z)(function*(){if(i.formGroup.markAllAsTouched(),!i.formGroup.valid)return;const s=yield i.reCaptchaService.execute(i.recaptchaAction),r=new u.vA;r.maxWidth="500px",r.disableClose=!0,r.autoFocus=!0,r.data={title:i.translate.instant("PROFILE.CHANGE_PASSWORD.MODAL_CONFIRM.TITLE"),description:i.translate.instant("PROFILE.CHANGE_PASSWORD.MODAL_CONFIRM.DESC")},i.dialog.open(G,r).afterClosed().subscribe(a=>{if(!0===a){const l=i.httpService.changePassword(i.formGroup.get("currentPassword")?.value,i.formGroup.get("password")?.value,i.recaptchaAction,s).pipe((0,y.K)(c=>(i.handleError.handleError(c),(0,C.of)()))).subscribe((0,X.Z)(function*(){i.user=Object.assign({},i.user),i.loadForm(),yield N().fire({text:i.translate.instant("AUTH.CHANGE_PASSWORD.MSG_SUCCESS"),icon:"success",confirmButtonText:i.translate.instant("AUTH.CHANGE_PASSWORD.BTN_MSG_SUCCESS")});const c=i.userService.logout().subscribe();i.subscriptions.push(c)}));i.subscriptions.push(l)}})})()}cancel(){this.user=Object.assign({},this.firstUserState),this.loadForm()}isControlValid(i){const s=this.formGroup.controls[i];return s.valid&&(s.dirty||s.touched)}isControlInvalid(i){const s=this.formGroup.controls[i];return s.invalid&&(s.dirty||s.touched)}controlHasError(i,s){const r=this.formGroup.controls[s];return r.hasError(i)&&(r.dirty||r.touched)}isControlTouched(i){const s=this.formGroup.controls[i];return s.dirty||s.touched}setBreadcrumbs(){this.pageInfoService.updateBreadcrumbs([{title:this.translate.instant("USER_OFFCANVAS.MY_PROFILE"),path:"/my-profile",isActive:!1,isSeparator:!1},{title:"",path:"",isSeparator:!0,isActive:!1},{title:this.translate.instant("PROFILE.CHANGE_PASSWORD.TITLE_CARD"),path:"/my-profile/change-password",isActive:!0,isSeparator:!1}])}};let o=n;return n.\u0275fac=function(s){return new(s||n)(e.Y36(R.e8),e.Y36(R.Cd),e.Y36(v.QS),e.Y36(T.sK),e.Y36(f.C4),e.Y36(u.uw),e.Y36(f.qu),e.Y36(se.Z),e.Y36(f.xD),e.Y36(e.sBO))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-profile-change-password"]],decls:1,vars:1,consts:[[4,"ngIf"],[1,"card","card-custom",3,"formGroup","ngSubmit"],[1,"card-header","py-3"],[1,"card-title","align-items-start","flex-column"],[1,"card-label","fw-bolder","fs-3","mb-1"],[1,"text-muted","fw-medium","fs-7"],[1,"card-toolbar"],["type","submit",1,"btn","btn-success","me-2",3,"disabled"],["type","reset",1,"btn","btn-secondary",3,"click"],[1,"form"],[1,"card-body"],[1,"row","mb-6","align-items-center"],[1,"col-xl-3","col-lg-3","col-form-label","fw-medium","fs-6"],[1,"col-lg-9","col-xl-6","fv-row"],[1,"row","mb-6"],[1,"input-group"],["autocomplete","off","formControlName","currentPassword",1,"form-control","form-control-lg","form-control-solid",3,"type","placeholder"],["tabindex","-1",1,"input-group-text","cursor-pointer",2,"border","none",3,"click"],[1,"fas",3,"ngClass"],["validation","required",3,"control","message"],["autocomplete","off","formControlName","password",1,"form-control","form-control-lg","form-control-solid",3,"type","placeholder"],["validation","minChar",3,"control","message"],["validation","specialChars",3,"control","message"],["validation","numbers",3,"control","message"],["validation","lowerCase",3,"control","message"],["validation","upperCase",3,"control","message"],["validation","invali
1dPassword",3,"control","message"],["autocomplete","off","formControlName","cPassword",1,"form-control","form-control-lg","form-control-solid",3,"type","placeholder"],["validation","valuesDoNotMatch",3,"control","message"]],template:function(s,r){1&s&&e.YNc(0,Bt,78,107,"ng-container",0),2&s&&e.Q6J("ngIf",r.user)},dependencies:[g.mk,g.O5,v._Y,v.Fj,v.JJ,v.JL,v.sg,v.u,L.dW,w.o8,T.X$]}),o})();function Kt(o,n){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",21),e.ALo(2,"translate"),e.qZA()),2&o&&(e.xp6(1),e.s9C("ngbTooltip",e.lcZ(2,1,"PROFILE.LAST_ACCESS.DEVICES.DESKTOP")))}function zt(o,n){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",22),e.ALo(2,"translate"),e.qZA()),2&o&&(e.xp6(1),e.s9C("ngbTooltip",e.lcZ(2,1,"PROFILE.LAST_ACCESS.DEVICES.CONSOLE")))}function Wt(o,n){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",23),e.ALo(2,"translate"),e.qZA()),2&o&&(e.xp6(1),e.s9C("ngbTooltip",e.lcZ(2,1,"PROFILE.LAST_ACCESS.DEVICES.MOBILE")))}function $t(o,n){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",24),e.ALo(2,"translate"),e.qZA()),2&o&&(e.xp6(1),e.s9C("ngbTooltip",e.lcZ(2,1,"PROFILE.LAST_ACCESS.DEVICES.TABLET")))}function Xt(o,n){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e.ALo(2,"translate"),e.qZA()),2&o&&(e.xp6(1),e.s9C("ngbTooltip",e.lcZ(2,1,"PROFILE.LAST_ACCESS.DEVICES.UNKONWN")))}function ei(o,n){if(1&o&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&o){const t=e.oxw().$implicit;e.xp6(1),e.AsE(" ",null==t.userAgentInformation.device?null:t.userAgentInformation.device.vendor," ",null==t.userAgentInformation.device?null:t.userAgentInformation.device.model," ")}}function ti(o,n){1&o&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&o&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"PROFILE.LAST_ACCESS.DEVICES.DESKTOP")," "))}function ii(o,n){if(1&o&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&o){const t=e.oxw().$implicit;e.xp6(1),e.lnq(" ",t.ipLocation.city,", ",t.ipLocation.region,", ",t.ipLocation.country," ")}}function ni(o,n){1&o&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&o&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"PROFILE.LAST_ACCESS.WITHOUT_LOCATION")," "))}function si(o,n){1&o&&(e.TgZ(0,"span",26),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&o&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"PROFILE.LAST_ACCESS.SESSION_ACTIVE")," "))}function oi(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"i",27),e.NdJ("click",function(){e.CHM(t);const s=e.oxw().$implicit,r=e.oxw();return e.KtG(r.terminarSessao(s))}),e.ALo(1,"translate"),e.qZA()}2&o&&e.s9C("ngbTooltip",e.lcZ(1,1,"PROFILE.LAST_ACCESS.DELETE_SESSION"))}function ri(o,n){if(1&o&&(e.TgZ(0,"tr")(1,"td"),e.YNc(2,Kt,3,3,"span",18),e.YNc(3,zt,3,3,"span",18),e.YNc(4,Wt,3,3,"span",18),e.YNc(5,$t,3,3,"span",18),e.YNc(6,Xt,3,3,"span",18),e.qZA(),e.TgZ(7,"td"),e.YNc(8,ei,2,2,"span",18),e.YNc(9,ti,3,3,"span",18),e.qZA(),e.TgZ(10,"td"),e._uU(11),e.qZA(),e.TgZ(12,"td"),e._uU(13),e.qZA(),e.TgZ(14,"td"),e._uU(15),e.qZA(),e.TgZ(16,"td"),e.YNc(17,ii,2,3,"span",18),e.YNc(18,ni,3,3,"span",18),e.qZA(),e.TgZ(19,"td"),e.YNc(20,si,3,3,"span",19),e.YNc(21,oi,2,3,"i",20),e.qZA()()),2&o){const t=n.$implicit;e.xp6(2),e.Q6J("ngIf",!t.userAgentInformation.device||""===t.userAgentInformation.device.type),e.xp6(1),e.Q6J("ngIf","console"===(null==t.userAgentInformation||null==t.userAgentInformation.device?null:t.userAgentInformation.device.type)),e.xp6(1),e.Q6J("ngIf","mobile"===(null==t.userAgentInformation||null==t.userAgentInformation.device?null:t.userAgentInformation.device.type)),e.xp6(1),e.Q6J("ngIf","tablet"===(null==t.userAgentInformation||null==t.userAgentInformation.device?null:t.userAgentInformation.device.type)),e.xp6(1),e.Q6J("ngIf","embedded"===(null==t.userAgentInformation||null==t.userAgentInformation.device?null:t.userAgentInformation.device.type)||"wearable"===(null==t.userAgentInformation||null==t.userAgentInformation.device?null:t.userAgentInformation.device.type)||"smarttv"===(null==t.userAgentInformation||null==t.userAgentInformation.device?null:t.userAgentInformation.device.type)),e.xp6(2),e.Q6J("ngIf",t.userAgentInformation.device),e.xp6(1),e.Q6J("ngIf",!t.userAgentInformation.device||""===t.userAgentInformation.device.type),e.xp6(2),e.AsE(" ",t.userAgentInformation.os.name,"\xa0",t.userAgentInformation.os.version," "),e.xp6(2),e.Oqu(t.userAgentInformation.browser),e.xp6(2),e.Oqu(t.createdAtToShow),e.xp6(2),e.Q6J("ngIf",t.ipLocation.country),e.xp6(1),e.Q6J("ngIf",!t.ipLocation.country),e.xp6(2),e.Q6J("ngIf",t.currentSession),e.xp6(1),e.Q6J("ngIf",!t.currentSession)}}let ai=(()=>{const n=class{constructor(i,s,r,a,l,c,p){this.cdr=i,this.handleError=s,this.userService=r,this.translate=a,this.meService=l,this.dialog=c,this.pageInfoService=p,this.subscriptions=[]}ngOnInit(){this.setBreadcrumbs(),this.getUser()}getUser(){this.user=Object.assign({},this.userService.currentUserValue),this.getActiveSessions()}getActiveSessions(){const i=this.meService.getActiveSessions().pipe((0,x.b)(s=>{this.activeSessions=s,this.activeSessions.forEach(r=>{const a=ne.ou.fromISO(r.createdAt.toString()).toRelative({unit:["days","hours","minutes","seconds"]});null!=a&&(r.createdAtToShow=a)})}),(0,A.x)(()=>{this.cdr.markForCheck()}),(0,y.K)(s=>(this.handleError.handleError(s),(0,C.of)(null)))).subscribe();this.subscriptions.push(i)}terminarSessao(i){const s=new u.vA;s.disableClose=!0,s.autoFocus=!0,s.data={title:this.translate.instant("PROFILE.LAST_ACCESS.MODAL_DELETE_TITLE"),description:this.translate.instant("PROFILE.LAST_ACCESS.MODAL_DELETE_SUTITLE")},this.dialog.open(G,s).afterClosed().subscribe(r=>{if(!0===r){const a=this.meService.deleteActiveSession(i).pipe((0,x.b)(l=>{this.activeSessions=this.activeSessions.filter(c=>c._id!==i._id),this.successSwal("PROFILE.LAST_ACCESS.DELETED_SUCCESS")}),(0,A.x)(()=>{this.cdr.markForCheck()}),(0,y.K)(l=>(this.handleError.handleError(l),(0,C.of)(null)))).subscribe();this.subscriptions.push(a)}})}successSwal(i){N().fire({title:this.translate.instant(i),icon:"success",showConfirmButton:!1,timer:2500})}clearSessions(){var i=this;return(0,X.Z)(function*(){const s=new u.vA;if(s.disableClose=!0,s.autoFocus=!0,s.data={title:i.translate.instant("PROFILE.LAST_ACCESS.MODAL_CLEARSESSIONS_TITLE"),description:i.translate.instant("PROFILE.LAST_ACCESS.MODAL_CLEARSESSIONS_SUBTITLE")},!0===(yield i.dialog.open(G,s).afterClosed().toPromise()))try{yield i.meService.clearSessions().toPromise(),yield i.userService.logoutPromise()}catch(a){yield i.handleError.handleError(a)}})()}setBreadcrumbs(){this.pageInfoService.updateBreadcrumbs([{title:this.translate.instant("USER_OFFCANVAS.MY_PROFILE"),path:"/my-profile",isActive:!1,isSeparator:!1},{title:"",path:"",isSeparator:!0,isActive:!1},{title:this.translate.instant("PROFILE.LAST_ACCESS.TITLE"),path:"/my-profile/personal-information",isActive:!0,isSeparator:!1}])}ngOnDestroy(){this.subscriptions.forEach(i=>
1i.unsubscribe())}};let o=n;return n.\u0275fac=function(s){return new(s||n)(e.Y36(e.sBO),e.Y36(f.C4),e.Y36(R.e8),e.Y36(T.sK),e.Y36(ie.w),e.Y36(u.uw),e.Y36(se.Z))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-profile-last-access"]],decls:46,vars:28,consts:[[1,"card","card-custom"],[1,"card-header","py-3"],[1,"card-title","align-items-start","flex-column"],[1,"card-label","fw-bolder","fs-3","mb-1"],[1,"text-muted","fw-medium","fs-7"],[1,"card-toolbar"],["type","button",1,"btn","btn-danger",3,"click"],[1,"fas","fa-trash-alt","fa-fw"],[1,"form"],[1,"card-body"],[1,"tab-content"],[1,"py-0","tab-pane","fade","show","active"],[1,"dataTables_wrapper","dt-bootstrap4"],[1,"table-responsive"],[1,"table","align-middle","dataTable"],[1,"border-bottom","border-gray-200","fs-7","text-uppercase"],[1,"text-muted"],[4,"ngFor","ngForOf"],[4,"ngIf"],["class","badge badge-pill badge-success",4,"ngIf"],["class","fas fa-trash-alt cursor-pointer text-danger","container","body","placement","top",3,"ngbTooltip","click",4,"ngIf"],["container","body","placement","top",1,"fas","fa-desktop",3,"ngbTooltip"],["container","body","placement","top",1,"fas","fa-terminal",3,"ngbTooltip"],["container","body","placement","top",1,"fas","fa-mobile-alt",3,"ngbTooltip"],["container","body","placement","top",1,"fas","fa-tablet-alt",3,"ngbTooltip"],["container","body","placement","top",1,"far","fa-question-circle",3,"ngbTooltip"],[1,"badge","badge-pill","badge-success"],["container","body","placement","top",1,"fas","fa-trash-alt","cursor-pointer","text-danger",3,"ngbTooltip","click"]],template:function(s,r){1&s&&(e.ynx(0),e.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"h3",2)(5,"span",3),e._uU(6),e.ALo(7,"translate"),e.qZA(),e.TgZ(8,"span",4),e._uU(9),e.ALo(10,"translate"),e.qZA()()(),e.TgZ(11,"div",5)(12,"button",6),e.NdJ("click",function(){return r.clearSessions()}),e._UZ(13,"i",7),e._uU(14),e.ALo(15,"translate"),e.qZA()()(),e.TgZ(16,"div",8)(17,"div",9)(18,"div",10)(19,"div",11)(20,"div",12)(21,"div",13)(22,"table",14)(23,"thead",15)(24,"tr",16),e._UZ(25,"th"),e.TgZ(26,"th"),e._uU(27),e.ALo(28,"translate"),e.qZA(),e.TgZ(29,"th"),e._uU(30),e.ALo(31,"translate"),e.qZA(),e.TgZ(32,"th"),e._uU(33),e.ALo(34,"translate"),e.qZA(),e.TgZ(35,"th"),e._uU(36),e.ALo(37,"translate"),e.qZA(),e.TgZ(38,"th"),e._uU(39),e.ALo(40,"translate"),e.qZA(),e.TgZ(41,"th"),e._uU(42),e.ALo(43,"translate"),e.qZA()()(),e.TgZ(44,"tbody"),e.YNc(45,ri,22,15,"tr",17),e.qZA()()()()()()()()(),e.BQk()),2&s&&(e.xp6(6),e.Oqu(e.lcZ(7,10,"PROFILE.LAST_ACCESS.TITLE")),e.xp6(3),e.Oqu(e.lcZ(10,12,"PROFILE.LAST_ACCESS.SUBTITLE")),e.xp6(5),e.hij(" ",e.lcZ(15,14,"PROFILE.LAST_ACCESS.CLEAR_SESSIONS")," "),e.xp6(13),e.Oqu(e.lcZ(28,16,"PROFILE.LAST_ACCESS.DEVICE")),e.xp6(3),e.hij(" ",e.lcZ(31,18,"PROFILE.LAST_ACCESS.OS")," "),e.xp6(3),e.hij(" ",e.lcZ(34,20,"PROFILE.LAST_ACCESS.APPLICATION")," "),e.xp6(3),e.hij(" ",e.lcZ(37,22,"PROFILE.LAST_ACCESS.START_DATE")," "),e.xp6(3),e.hij(" ",e.lcZ(40,24,"PROFILE.LAST_ACCESS.LOCATION")," "),e.xp6(3),e.Oqu(e.lcZ(43,26,"PROFILE.LAST_ACCESS.ACTIONS")),e.xp6(3),e.Q6J("ngForOf",r.activeSessions))},dependencies:[g.sg,g.O5,O._L,T.X$]}),o})();var I=d(8249),li=d(3297),ci=d(1208);function pi(o,n){if(1&o&&(e.TgZ(0,"div",13),e._UZ(1,"div",14),e.ALo(2,"safe"),e.qZA()),2&o){const t=e.oxw();e.xp6(1),e.Q6J("innerHTML",e.xi3(2,1,t.description,"html"),e.oJD)}}function di(o,n){1&o&&(e.TgZ(0,"div",15),e._UZ(1,"span",16),e.qZA())}function hi(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"image-cropper",17),e.NdJ("imageCropped",function(s){e.CHM(t);const r=e.oxw();return e.KtG(r.imageCropped(s))})("cropperReady",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.cropperReady())}),e.qZA()}if(2&o){const t=e.oxw();e.Q6J("imageFile",t.imageFile)("aspectRatio",t.aspectRatio)}}function ui(o,n){if(1&o&&e._UZ(0,"img",18),2&o){const t=e.oxw();e.Q6J("src",t.croppedImage,e.LSH)("ngStyle",t.stylesPreview)}}const gi=function(){return{position:"relative"}};let mi=(()=>{const n=class{constructor(i,s,r){this.dialogRef=i,this.translateService=r,this.croppedImage="",this.cropperLoading=!0,this.imageFile=s.image,this.title=s.title||this.translateService.instant("MODAL_CROPPER.C
1ROP_IMAGE"),this.description=s.description,this.cropBtnText=s.cropBtnText||this.translateService.instant("MODAL_CROPPER.UPLOAD"),this.aspectRatio=s.aspectRatio??16/9,this.stylesPreview={width:s.preview?.width??"160px",height:s.preview?.height??"90px"},this.configScroll=new U.kO({suppressScrollX:!0,wheelPropagation:!0})}ngOnInit(){document.querySelector("kt-modal-cropper")?.style.setProperty("--cropper-overlay-color","var(--bs-body-bg)")}cropperReady(){this.cropperLoading=!1}imageCropped(i){if(null==i?.base64)return this.croppedImage="",void(this.croppedImageDimensions=null);this.croppedImage=i.base64,this.croppedImageDimensions={width:i.width,height:i.height,x:i.imagePosition.x1||0,y:i.imagePosition.y1||0}}crop(){if(!this.croppedImage||null==this.croppedImageDimensions)return this.cancel();this.dialogRef.close({dimensions:this.croppedImageDimensions,base64:this.croppedImage})}cancel(){this.dialogRef.close(!1)}};let o=n;return n.\u0275fac=function(s){return new(s||n)(e.Y36(u.so),e.Y36(u.WI),e.Y36(T.sK))},n.\u0275cmp=e.Xpm({type:n,selectors:[["kt-modal-cropper"]],decls:23,vars:18,consts:[["mat-dialog-title",""],[1,"conteudo",3,"perfectScrollbar","ngStyle"],["class","row",4,"ngIf"],[1,"row",2,"margin-bottom","10px"],[1,"col-12","col-sm-12","col-md-12","col-lg-9","col-xl-9",2,"margin-top","10px"],[1,"corTexto"],["class","text-center text-primary",4,"ngIf"],["class","p-0",3,"imageFile","aspectRatio","imageCropped","cropperReady",4,"ngIf"],[1,"col-12","col-sm-12","col-md-12","col-lg-3","col-xl-3",2,"margin-top","10px"],[3,"src","ngStyle",4,"ngIf"],[1,"float-end"],[1,"btn","btn-light",3,"click"],[1,"btn","btn-primary",3,"click"],[1,"row"],[1,"col-12",3,"innerHTML"],[1,"text-center","text-primary"],[1,"spinner-border","spinner-border-md"],[1,"p-0",3,"imageFile","aspectRatio","imageCropped","cropperReady"],[3,"src","ngStyle"]],template:function(s,r){1&s&&(e.TgZ(0,"h2",0),e._uU(1),e.qZA(),e.TgZ(2,"mat-dialog-content",1),e.YNc(3,pi,3,4,"div",2),e.TgZ(4,"div",3)(5,"div",4)(6,"div",5),e._uU(7),e.ALo(8,"translate"),e.qZA(),e.YNc(9,di,2,0,"div",6),e.YNc(10,hi,1,2,"image-cropper",7),e.qZA(),e.TgZ(11,"div",8)(12,"div",5),e._uU(13),e.ALo(14,"translate"),e.qZA(),e.YNc(15,ui,1,2,"img",9),e.qZA()()(),e.TgZ(16,"mat-dialog-actions",10)(17,"button",11),e.NdJ("click",function(){return r.cancel()}),e._uU(18),e.ALo(19,"translate"),e.qZA(),e._uU(20," \xa0 "),e.TgZ(21,"button",12),e.NdJ("click",function(){return r.crop()}),e._uU(22),e.qZA()()),2&s&&(e.xp6(1),e.Oqu(r.title),e.xp6(1),e.Q6J("perfectScrollbar",r.configScroll)("ngStyle",e.DdM(17,gi)),e.xp6(1),e.Q6J("ngIf",r.description),e.xp6(4),e.hij(" ",e.lcZ(8,11,"MODAL_CROPPER.ORIGINAL_IMAGE"),": "),e.xp6(2),e.Q6J("ngIf",r.cropperLoading),e.xp6(1),e.Q6J("ngIf",r.imageFile),e.xp6(3),e.hij(" ",e.lcZ(14,13,"MODAL_CROPPER.CROPPED_IMAGE"),": "),e.xp6(2),e.Q6J("ngIf",r.croppedImage),e.xp6(3),e.hij(" ",e.lcZ(19,15,"GENERAL.CANCEL")," "),e.xp6(4),e.Oqu(r.cropBtnText))},dependencies:[g.O5,g.PC,u.uh,u.xY,u.H8,ci.ap,U.$V,T.X$,w.yl],styles:[".corTexto[_ngcontent-%COMP%]{font-weight:500;margin-bottom:5px}.conteudo[_ngcontent-%COMP%]{width:850px}  image-cropper img{max-height:450px!important}@media screen and (max-width: 1023px){.conteudo[_ngcontent-%COMP%]{max-width:850px;width:unset}}"]}),o})();var fi=d(8359);function _i(o,n){1&o&&e._UZ(0,"span",39)}const Be=function(o){return{"background-image":o}};function vi(o,n){if(1&o&&e._UZ(0,"div",40),2&o){const t=e.oxw(2);e.Q6J("ngStyle",e.VKq(1,Be,"url("+t.pic+")"))}}function bi(o,n){if(1&o&&e._UZ(0,"div",40),2&o){const t=e.oxw(2);e.Q6J("ngStyle",e.VKq(1,Be,"url("+t.picBlank+")"))}}function xi(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"span",41),e.NdJ("click",function(){e.CHM(t);const s=e.oxw(2);return e.KtG(s.removePic())}),e.ALo(1,"translate"),e._UZ(2,"i",42),e.qZA()}2&o&&e.s9C("ngbTooltip",e.lcZ(1,1,"PROFILE.PERSONAL_INFORMATION.REMOVE_PIC_TOOLTIP"))}function Ti(o,n){if(1&o&&(e.TgZ(0,"div",31),e._UZ(1,"label",13),e.TgZ(2,"div",14)(3,"h5",15),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",43),e._UZ(7,"liber-form-fields",44),e.qZA()()),2&o){const t=e.oxw(2);e.xp6(4),e.hij(" ",e.lcZ(5,4,"PROFILE.PERSONAL_INFORMATION.IDENTIFICATION.TITLE")," "),e.xp6(3),e.Q6J("fields",t.identificationFields)("formGroup",t.formGroup)("getFilledValue",t.getIdentificationDocValue)}}function Si(o,n){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"form",1),e.NdJ("ngSubmit",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.save())}),e.TgZ(2,"div",2)(3,"div",3)(4,"h3",3)(5,"span",4),e._uU(6),e.ALo(7,"translate"),e.qZA(),e.TgZ(8,"span",5),e._uU(9),e.ALo(10,"translate"),e.qZA()()(),e.TgZ(11,"div",6)(12,"button",7),e._uU(13),e.ALo(14,"translate"),e.YNc(15,_i,1,0,"span",8),e.qZA(),e.TgZ(16,"button",9),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.cancel())}),e._uU(17),e.ALo(18,"translate"),e.qZA()()(),e.TgZ(19,"div",10)(20,"div",11)(21,"div",12),e._UZ(22,"label",13),e.TgZ(23,"div",14)(24,"h5",15),e._uU(25),e.ALo(26,"translate"),e.qZA()()(),e.TgZ(27,"div",12)(28,"label",16),e._uU(29),e.ALo(30,"translate"),e.qZA(),e.TgZ(31,"div",14)(32,"div",17),e.YNc(33,vi,1,3,"div",18),e.YNc(34,bi,1,3,"div",18),e.TgZ(35,"label",19),e.ALo(36,"translate"),e._UZ(37,"i",20),e.TgZ(38,"input",21),e.NdJ("change",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.picChangeEvent())}),e.qZA()(),e.YNc(39,xi,3,3,"span",22),e.qZA(),e._UZ(40,"br"),e.TgZ(41,"span",23),e._uU(42),e.ALo(43,"translate"),e.qZA()()(),e.TgZ(44,"div",12)(45,"label",24),e._uU(46),e.ALo(47,"translate"),e.qZA(),e.TgZ(48,"div",25),e._UZ(49,"input",26)(50,"liber-error",27),e.ALo(51,"translate"),e._UZ(52,"liber-error",28),e.ALo(53,"translate"),e._UZ(54,"liber-error",29),e.ALo(55,"translate"),e.qZA()(),e.YNc(56,Ti,8,6,"div",30),e.TgZ(57,"div",31),e._UZ(58,"label",13),e.TgZ(59,"div",14)(60,"h5",15),e._uU(61),e.ALo(62,"translate"),e.qZA()()(),e.TgZ(63,"div",12)(64,"label",24),e._uU(65),e.ALo(66,"translate"),e.qZA(),e.TgZ(67,"div",25)(68,"div",32)(69,"span",33),e._UZ(70,"i",34),e._uU(71,"\xa0+\xa0351 "),e.qZA(),e._UZ(72,"input",35),e.ALo(73,"translate"),e.qZA(),e._UZ(74,"liber-error",36),e.ALo(75,"translate"),e.qZA()(),e.TgZ(76,"div",12)(77,"label",24),e._uU(78),e.ALo(79,"translate"),e.qZA(),e.TgZ(80,"div",25)(81,"div",32)(82,"span",33),e._UZ(83,"i",37),e.qZA(),e._UZ(84,"input",38),e.ALo(85,"translate"),e.qZA()()()()()(),e.BQk()}if(2&o){const t=e.oxw();
1e.xp6(1),e.Q6J("formGroup",t.formGroup),e.xp6(5),e.Oqu(e.lcZ(7,46,"PROFILE.PERSONAL_INFORMATION.TITLE")),e.xp6(3),e.Oqu(e.lcZ(10,48,"PROFILE.PERSONAL_INFORMATION.SUBTITLE")),e.xp6(3),e.Q6J("disabled",t.isLoadingSave||!t.formGroup.valid||!t.formGroup.dirty||t.formGroup.pristine),e.xp6(1),e.hij(" ",e.lcZ(14,50,"GENERAL.SAVE")," "),e.xp6(2),e.Q6J("ngIf",t.isLoadingSave),e.xp6(1),e.Q6J("disabled",t.isLoadingSave||!t.formGroup.dirty||t.formGroup.pristine),e.xp6(1),e.hij(" ",e.lcZ(18,52,"GENERAL.CANCEL")," "),e.xp6(8),e.hij(" ",e.lcZ(26,54,"USERSCM.PERSONAL_INFORMATION.TITLE")," "),e.xp6(4),e.hij(" ",e.lcZ(30,56,"PROFILE.PERSONAL_INFORMATION.FOTO_CAPA")," "),e.xp6(4),e.Q6J("ngIf",null!=t.pic),e.xp6(1),e.Q6J("ngIf",null==t.pic),e.xp6(1),e.s9C("ngbTooltip",e.lcZ(36,58,"PROFILE.PERSONAL_INFORMATION.CHANGE_PIC_TOOLTIP")),e.xp6(3),e.Q6J("hidden",!0)("uploader",t.picUploader)("accept",t.allowedExtensions),e.xp6(1),e.Q6J("ngIf",null!=t.pic),e.xp6(3),e.AsE(" ",e.lcZ(43,60,"PROFILE.PERSONAL_INFORMATION.ALLOWEDFILETYPES"),": ",t.allowedExtensions.toString(),""),e.xp6(4),e.Oqu(e.lcZ(47,62,"USERSCM.PERSONAL_INFORMATION.NAME")),e.xp6(3),e.ekj("is-invalid",t.isControlInvalid("nome"))("is-valid",t.isControlValid("nome")),e.xp6(1),e.Q6J("control",t.formGroup.controls.nome)("message",e.lcZ(51,64,"AUTH.VALIDATION.REQUIRED_FIELD")),e.xp6(2),e.Q6J("control",t.formGroup.controls.nome)("message",e.lcZ(53,66,"AUTH.VALIDATION.MIN_LENGTH_FIELD")+" 3"),e.xp6(2),e.Q6J("control",t.formGroup.controls.nome)("message",e.lcZ(55,68,"AUTH.VALIDATION.MAX_LENGTH_FIELD")+" 255"),e.xp6(2),e.Q6J("ngIf",null==t.user.identificationDoc?null:t.user.identificationDoc.docNumber),e.xp6(5),e.hij(" ",e.lcZ(62,70,"USERSCM.PERSONAL_INFORMATION.CONTACT_INFO")," "),e.xp6(4),e.Oqu(e.lcZ(66,72,"USERSCM.PERSONAL_INFORMATION.CONTACT")),e.xp6(7),e.ekj("is-invalid",t.isControlInvalid("contacto"))("is-valid",t.isControlValid("contacto")),e.Q6J("placeholder",e.lcZ(73,74,"USERSCM.PERSONAL_INFORMATION.CONTACT")),e.xp6(2),e.Q6J("control",t.formGroup.controls.contacto)("message",e.lcZ(75,76,"AUTH.VALIDATION.INVALID_CONTACT")),e.xp6(4),e.Oqu(e.lcZ(79,78,"USERSCM.PERSONAL_INFORMATION.EMAIL")),e.xp6(6),e.ekj("is-invalid",t.isControlInvalid("email"))("is-valid",t.isControlValid("email")),e.Q6J("placeholder",e.lcZ(85,80,"USERSCM.PERSONAL_INFORMATION.TITLE"))}}let Ci=(()=>{const n=class{constructor(i,s,r,a,l,c,p,h,m,b,D,F,ae,P,xe,le,B){this.userService=i,this.awss3FileService=s,this.meService=r,this.cdr=a,this.handleError=l,this.fb=c,this.translate=p,this.uploaderHandlerService=h,this.dialog=m,this.swalErrorService=b,this.themeModeService=D,this.pageInfoService=F,this.configurationsService=ae,this.authHttpService=P,this.submitHTMLFormService=xe,this.route=le,this.location=B,this.picEditionMode=!1,this.allowedExtensions=[".png",".jpeg",".jpg"],this.subscriptions=[],this.getIdentificationDocValue=j=>null==this.user?.identificationDoc?null:"docNumber"===j?null!=this.user.identificationDoc.checkDigits?`${this.user.identificationDoc.docNumber} ${this.user.identificationDoc.checkDigits}`:this.user.identificationDoc.docNumber:this.user.identificationDoc[j],this.setBreadcrumbs(),this.picBlank="light"===this.themeModeService.getThemeMode()?"/assets/media/users/blank.svg":"/assets/media/users/blank-dark.svg",Object.keys(this.route.snapshot.queryParams).length>0&&this.location.replaceState("/my-profile/personal-information")}ngOnInit(){const i=this.uploaderHandlerService.createUploader(`${li.N.API_URL_PREFIX}/api/me/pic`,this.allowedExtensions,1,5).pipe((0,x.b)(s=>{this.picUploader=s})).subscribe();this.subscriptions.push(i),this.getUser(),this.initIdentificationFields()}loadForm(){this.formGroup=this.fb.group({nome:["",_.k.compose([_.k.required,_.k.minLength(3),_.k.maxLength(255)])],email:[{value:"",disabled:!0}],contacto:["",_.k.compose([_.k.isValidTelemovel])]}),this.loadFormData()}loadFormData(){const i=this.formGroup.controls;i.nome.setValue(this.user.nome),i.email.setValue(this.user.email),i.contacto.setValue(this.user.telemovel)}getUser(){this.user=Object.assign({},this.userService.currentUserValue),this.firstUserState=Object.assign({},this.user),this.getPic(),this.loadForm()}getPic(){if(!this.user?.pic?.resized)return;const i=this.awss3FileService.get(this.user.pic.resized,this).pipe((0,x.b)(s=>{this.pic=s}),(0,A.x)(()=>{this.cdr.markForCheck()})).subscribe();this.subscriptions.push(i)}initIdentificationFields(){const i={layoutSize:"full",layoutClasses:{label:"col-lg-3 col-xl-3",input:"col-lg-9 col-xl-6"}};this.identificationFields=[{key:"docType",name:"PROFILE.PERSONAL_INFORMATION.IDENTIFICATION.DOC_TYPE",type:I.EI.Select,configurations:{options:Object.keys(I.FM).map(s=>({name:`PROFILE.PERSONAL_INFORMATION.IDENTIFICATION.DOC_TYPE_${s}`,value:I.FM[s]}))},...i},{key:"docNumber",name:"PROFILE.PERSONAL_INFORMATION.IDENTIFICATION.DOC_NUMBER",type:I.EI.Text,...i}]}save(){const i=this.formGroup.controls;
1if(this.formGroup.invalid)return void Object.keys(i).forEach(a=>i[a].markAsTouched());this.isLoadingSave=!0;const r=this.meService.updatePersonalInfornUser({nome:i.nome.value,telemovel:i.contacto.value}).pipe((0,x.b)(a=>{this.userService.currentUserValue=a,this.getUser(),this.showSuccess()}),(0,A.x)(()=>{this.isLoadingSave=!1,this.cdr.markForCheck()}),(0,y.K)(a=>(this.handleError.handleError(a),(0,C.of)(null)))).subscribe();this.subscriptions.push(r)}cancel(){this.user=Object.assign({},this.firstUserState),this.loadForm()}ngOnDestroy(){this.subscriptions.forEach(i=>i.unsubscribe()),this.uploaderHandlerService.clearUploadersFileIsOver()}isControlValid(i){const s=this.formGroup.controls[i];return s.valid&&(s.dirty||s.touched)}isControlInvalid(i){const s=this.formGroup.controls[i];return s.invalid&&(s.dirty||s.touched)}picChangeEvent(){const i=this.picUploader.queue[0];if(null==i)return;const s=new u.vA;s.disableClose=!0,s.autoFocus=!0,s.data={image:i._file,aspectRatio:1,description:this.translate.instant("PROFILE.PERSONAL_INFORMATION.CROP_PIC_DESC"),preview:{width:"150px",height:"150px"}},this.dialog.open(mi,s).afterClosed().subscribe(r=>{r?(this.picUploader.setOptions({additionalParameter:{left:r.dimensions.x,top:r.dimensions.y,width:r.dimensions.width,height:r.dimensions.height}}),this.savePic()):!1===r&&this.cancelPicEdition()})}cancelPicEdition(){0===this.picUploader.queue.length&&(this.picEditionMode=!1),this.picUploader.clearQueue(),this.cdr.markForCheck()}savePic(){if(!this.picUploader.queue[0])return;const i=this.uploaderHandlerService.upload(this.picUploader).pipe((0,me.U)(s=>Array.isArray(s)?s[0]:s),(0,x.b)(s=>{this.picEditionMode=!1,this.userService.currentUserValue=s,this.user=this.userService.currentUserValue,this.firstUserState=Object.assign({},this.user),this.showSuccess(),this.getPic()}),(0,y.K)(s=>(this.swalErrorService.handleError(s),this.cancelPicEdition(),(0,C.of)(null))),(0,A.x)(()=>{this.cdr.markForCheck()})).subscribe();this.subscriptions.push(i)}removePic(){const i=new u.vA;i.disableClose=!0,i.autoFocus=!0,i.data={title:this.translate.instant("PROFILE.PERSONAL_INFORMATION.REMOVE_PIC_TITLE_MODAL"),description:this.translate.instant("PROFILE.PERSONAL_INFORMATION.REMOVE_PIC_DESC_MODAL")},this.dialog.open(G,i).afterClosed().subscribe(s=>{if(!0===s){const r=this.meService.removePic().pipe((0,x.b)(a=>{this.userService.currentUserValue=a,this.user=this.userService.currentUserValue,this.firstUserState=Object.assign({},this.user),this.showSuccess(),this.pic=void 0}),(0,A.x)(()=>{this.cdr.markForCheck()}),(0,y.K)(a=>(this.handleError.handleError(a),(0,C.of)(null)))).subscribe();this.subscriptions.push(r)}})}showSuccess(){N().fire({title:this.translate.instant("GENERAL.SUCCESSFULLY_SAVED"),icon:"success",showConfirmButton:!1,timer:2500})}setBreadcrumbs(){this.pageInfoService.updateBreadcrumbs([{title:this.translate.instant("USER_OFFCANVAS.MY_PROFILE"),path:"/my-profile",isActive:!1,isSeparator:!1},{title:"",path:"",isSeparator:!0,isActive:!1},{title:this.translate.instant("PROFILE.PERSONAL_INFORMATION.TITLE"),path:"/my-profile/personal-information",isActive:!0,isSeparator:!1}])}};let o=n;return n.\u0275fac=function(s){return new(s||n)(e.Y36(R.e8),e.Y36(f.lw),e.Y36(ie.w),e.Y36(e.sBO),e.Y36(f.C4),e.Y36(v.QS),e.Y36(T.sK),e.Y36(_e),e.Y36(u.uw),e.Y36(f.C4),e.Y36(fi.t),e.Y36(se.Z),e.Y36(f.xD),e.Y36(R.Cd),e.Y36(f.OS),e.Y36(k.gz),e.Y36(g.Ye))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-profile-personal-information"]],decls:1,vars:1,consts:[[4,"ngIf"],[1,"card",3,"formGroup","ngSubmit"],[1,"card-header","py-3"],[1,"card-title","align-items-start","flex-column"],[1,"card-label","fw-bolder","fs-3","mb-1"],[1,"text-muted","fw-medium","fs-7"],[1,"card-toolbar"],["type","submit",1,"btn","btn-success","me-2",3,"disabled"],["class","spinner-border spinner-border-sm align-middle ms-2",4,"ngIf"],["type","reset",1,"btn","btn-secondary",3,"disabled","click"],[1,"form"],[1,"card-body"],[1,"row","mb-6"],[1,"col-xl-3"],[1,"col-lg-9","col-xl-6"],[1,"fw-medium","fs-6"],[1,"col-xl-3","col-form-label","fw-medium","fs-6"],[1,"image-input","image-input-outline"],["class","image-input-wrapper",3,"ngStyle",4,"ngIf"],["container","body","data-action","change",1,"btn","btn-sm","btn-icon","btn-circle","btn-light","shadow-lg",2,"position","absolute","top","-10px","right","-10px",3,"ngbTooltip"],[1,"fas","fa-pencil-alt","icon-sm"],["type","file","id","fileInput","ng2FileSelect","",3,"hidden","uploader","accept","change"],["class","btn btn-sm btn-icon btn-circle btn-light shadow-lg","data-action","remove","container","body","style","position: absolute; bottom: -10px; right: -10px",3,"ngbTooltip","click",4,"ngIf"],[1,"form-text","text-muted"],[1,"col-xl-3","col-lg-3","col-form-label","fw-medium","fs-6"],[1,"col-lg-9","col-xl-6","fv-row"],["type","text","formControlName","nome",1,"form-control","form-control-lg","form-control-solid"],["validation","required",3,"control","message"],["validation","minlength",3,"control","message"],["validation","maxlength",3,"control","message"],["class","row mb-6 pt-4",4,"ngIf"],[1,"row","mb-6","pt-4"],[1,"input-group","input-group-lg","input-group-solid"],[1,"input-group-text"],[1,"fa","fa-phone"],["type","text","formControlName","contacto",1,"form-control","form-control-lg","form-control-solid",3,"placeholder"],["validation","invali
1dTelemovel",3,"control","message"],[1,"fa","fa-at"],["type","email","formControlName","email",1,"form-control","form-control-lg","form-control-solid",3,"placeholder"],[1,"spinner-border","spinner-border-sm","align-middle","ms-2"],[1,"image-input-wrapper",3,"ngStyle"],["data-action","remove","container","body",1,"btn","btn-sm","btn-icon","btn-circle","btn-light","shadow-lg",2,"position","absolute","bottom","-10px","right","-10px",3,"ngbTooltip","click"],[1,"fas","fa-times","icon-sm"],[1,"col-12"],["disabled","true",3,"fields","formGroup","getFilledValue"]],template:function(s,r){1&s&&e.YNc(0,Si,86,82,"ng-container",0),2&s&&e.Q6J("ngIf",r.user)},dependencies:[g.O5,g.PC,v._Y,v.Fj,v.JJ,v.JL,v.sg,v.u,O._L,L.dW,It,L.NM,T.X$]}),o})();var oe=d(2198),re=d(7545);function Ei(o,n){if(1&o&&(e.TgZ(0,"div",7),e._UZ(1,"div",8),e.ALo(2,"safe"),e.qZA()),2&o){const t=e.oxw();e.xp6(1),e.Q6J("innerHTML",e.xi3(2,1,t.description,"html"),e.oJD)}}function Ai(o,n){if(1&o&&(e.TgZ(0,"option",22),e._uU(1),e.qZA()),2&o){const t=n.$implicit;e.Q6J("value",t.key),e.xp6(1),e.hij(" ",t.value," ")}}function yi(o,n){1&o&&(e.TgZ(0,"label",11),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&o&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"PROFILE.SECURITY.MFA.ADD.EMAIL")))}function Di(o,n){if(1&o&&(e.TgZ(0,"div",12),e._UZ(1,"input",23)(2,"liber-error",14),e.ALo(3,"translate"),e._UZ(4,"liber-error",24),e.ALo(5,"translate"),e.qZA()),2&o){const t=e.oxw(2);e.xp6(1),e.ekj("is-invalid",t.isControlInvalid(t.formGroup,"email"))("is-valid",t.isControlValid(t.formGroup,"email")),e.xp6(1),e.Q6J("control",t.formGroup.controls.email)("message",e.lcZ(3,8,"AUTH.VALIDATION.REQUIRED_FIELD")),e.xp6(2),e.Q6J("control",t.formGroup.controls.email)("message",e.lcZ(5,10,"AUTH.GENERAL.EMAIL_INVALID"))}}function Ii(o,n){1&o&&(e.TgZ(0,"label",11),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&o&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"PROFILE.SECURITY.MFA.ADD.SMS")))}function wi(o,n){if(1&o&&(e.TgZ(0,"div",12),e._UZ(1,"input",25)(2,"liber-error",14),e.ALo(3,"translate"),e._UZ(4,"liber-error",26),e.ALo(5,"translate"),e.qZA()),2&o){const t=e.oxw(2);e.xp6(1),e.ekj("is-invalid",t.isControlInvalid(t.formGroup,"phoneNumber"))("is-valid",t.isControlValid(t.formGroup,"phoneNumber")),e.xp6(1),e.Q6J("control",t.formGroup.controls.phoneNumber)("message",e.lcZ(3,8,"AUTH.VALIDATION.REQUIRED_FIELD")),e.xp6(2),e.Q6J("control",t.formGroup.controls.phoneNumber)("message",e.lcZ(5,10,"AUTH.VALIDATION.PHONE_INVALID"))}}function Pi(o,n){if(1&o&&(e.TgZ(0,"div")(1,"form",9)(2,"div",10)(3,"label",11),e._uU(4),e.ALo(5,"translate"),e.qZA(),e.TgZ(6,"div",12),e._UZ(7,"input",13)(8,"liber-error",14),e.ALo(9,"translate"),e._UZ(10,"liber-error",15),e.ALo(11,"translate"),e._UZ(12,"liber-error",16),e.ALo(13,"translate"),e.qZA(),e.TgZ(14,"label",17),e._uU(15),e.ALo(16,"translate"),e.qZA(),e.TgZ(17,"div",12)(18,"select",18),e.YNc(19,Ai,2,2,"option",19),e.qZA(),e._UZ(20,"liber-error",14),e.ALo(21,"translate"),e.qZA(),e.YNc(22,yi,3,3,"label",20),e.YNc(23,Di,6,12,"div",21),e.YNc(24,Ii,3,3,"label",20),e.YNc(25,wi,6,12,"div",21),e.qZA()()()),2&o){const t=e.oxw();e.xp6(1),e.Q6J("formGroup",t.formGroup),e.xp6(3),e.Oqu(e.lcZ(5,24,"PROFILE.SECURITY.MFA.ADD.NAME")),e.xp6(3),e.ekj("is-invalid",t.isControlInvalid(t.formGroup,"name"))("is-valid",t.isControlValid(t.formGroup,"name")),e.xp6(1),e.Q6J("control",t.formGroup.controls.name)("message",e.lcZ(9,26,"AUTH.VALIDATION.REQUIRED_FIELD")),e.xp6(2),e.Q6J("control",t.formGroup.controls.name)("message",e.lcZ(11,28,"AUTH.VALIDATION.MIN_LENGTH_FIELD")+" 3"),e.xp6(2),e.Q6J("control",t.formGroup.controls.name)("message",e.lcZ(13,30,"AUTH.VALIDATION.MAX_LENGTH_FIELD")+" 255"),e.xp6(3),e.hij(" ",e.lcZ(16,32,"PROFILE.SECURITY.MFA.ADD.TYPE")," "),e.xp6(3),e.ekj("is-invalid",t.isControlInvalid(t.formGroup,"type"))("is-valid",t.isControlValid(t.formGroup,"type")),e.xp6(1),e.Q6J("ngForOf",t.mfaTypes),e.xp6(1),e.Q6J("control",t.formGroup.controls.type)("message",e.lcZ(21,34,"AUTH.VALIDATION.REQUIRED_FIELD")),e.xp6(2),e.Q6J("ngIf","email"===t.formGroup.controls.type.value),e.xp6(1),e.Q6J("ngIf","email"===t.formGroup.controls.type.value),e.xp6(1),e.Q6J("ngIf","sms"===t.formGroup.controls.type.value),e.xp6(1),e.Q6J("ngIf","sms"===t.formGroup.controls.type.value)}}function Li(o,n){if(1&o&&(e.TgZ(0,"div",30)(1,"p"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"p",31),e._uU(5),e.qZA()()),2&o){const t=e.oxw(2);
1e.xp6(2),e.Oqu(e.lcZ(3,2,"PROFILE.SECURITY.MFA.ADD.SECRET")),e.xp6(3),e.Oqu(t.secret.secret)}}function Oi(o,n){if(1&o&&(e.TgZ(0,"div",30)(1,"div",32)(2,"label"),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"div",33),e._UZ(6,"img",34),e.qZA()()()),2&o){const t=e.oxw(2);e.xp6(3),e.Oqu(e.lcZ(4,2,"PROFILE.SECURITY.MFA.ADD.QR_CODE")),e.xp6(3),e.Q6J("src",t.secret.qrCode,e.LSH)}}function Ri(o,n){1&o&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&o&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"PROFILE.SECURITY.MFA.ADD.MFA_CODE_DEVICE"),""))}function Fi(o,n){1&o&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&o&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"PROFILE.SECURITY.MFA.ADD.MFA_CODE_EMAIL"),""))}function Zi(o,n){1&o&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&o&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"PROFILE.SECURITY.MFA.ADD.MFA_CODE_SMS"),""))}function Ui(o,n){if(1&o&&(e.TgZ(0,"div")(1,"form",27)(2,"div",10),e.YNc(3,Li,6,4,"div",28),e.YNc(4,Oi,7,4,"div",28),e.TgZ(5,"label",11),e.YNc(6,Ri,3,3,"span",3),e.YNc(7,Fi,3,3,"span",3),e.YNc(8,Zi,3,3,"span",3),e.qZA(),e.TgZ(9,"div",12),e._UZ(10,"input",29)(11,"liber-error",14),e.ALo(12,"translate"),e.qZA()()()()),2&o){const t=e.oxw();e.xp6(1),e.Q6J("formGroup",t.formSecrets),e.xp6(2),e.Q6J("ngIf",t.secret),e.xp6(1),e.Q6J("ngIf",t.secret),e.xp6(2),e.Q6J("ngIf","device"===t.formGroup.controls.type.value),e.xp6(1),e.Q6J("ngIf","email"===t.formGroup.controls.type.value),e.xp6(1),e.Q6J("ngIf","sms"===t.formGroup.controls.type.value),e.xp6(2),e.ekj("is-invalid",t.isControlInvalid(t.formSecrets,"mfaCode"))("is-valid",t.isControlValid(t.formSecrets,"mfaCode")),e.xp6(1),e.Q6J("control",t.formSecrets.controls.mfaCode)("message",e.lcZ(12,12,"AUTH.VALIDATION.REQUIRED_FIELD"))}}function ki(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"button",35),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.close(!1))}),e._uU(1),e.ALo(2,"translate"),e.qZA()}2&o&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"GENERAL.CANCEL")," "))}function Ni(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"button",36),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.nextStep())}),e._uU(1),e.ALo(2,"translate"),e.qZA()}2&o&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"GENERAL.NEXT")," "))}function Mi(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"button",35),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.previousStep())}),e._uU(1),e.ALo(2,"translate"),e.qZA()}2&o&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"GENERAL.BACK")," "))}function Hi(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"button",36),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.add())}),e._uU(1),e.ALo(2,"translate"),e.qZA()}2&o&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"GENERAL.ADD")," "))}const Gi=function(){return{position:"relative"}};let qi=(()=>{const n=class{constructor(i,s,r,a,l,c,p,h){this.dialogRef=i,this.authHttpService=s,this.fb=r,this.translateService=l,this.swalErrorService=c,this.cdr=p,this.configService=h,this.currentStep=1,this.hasSMS=!1,this.subscriptions=[],this.mfaTypes=[],this.title=a.title,this.description=a.description,this.currentUser=a.user,this.configScroll=new U.kO({suppressScrollX:!0,wheelPropagation:!0})}ngOnInit(){this.getConfigs()}getConfigs(){const i=this.configService.getLastInMemory().pipe((0,x.b)(s=>{this.hasSMS=(s?.configs||[]).some(r=>"comSMS"===r.id&&!0===r.value),this.mfaTypes=[{key:"device",value:this.translateService.instant("PROFILE.SECURITY.MFA.TYPES.DEVICE")}],this.currentUser.mfaEmail?.enabled||this.mfaTypes.push({key:"email",value:this.translateService.instant("PROFILE.SECURITY.MFA.TYPES.EMAIL")}),this.hasSMS&&!this.currentUser.mfaSms?.enabled&&this.mfaTypes.push({key:"sms",value:this.translateService.instant("PROFILE.SECURITY.MFA.TYPES.SMS")}),this.initForms()}),(0,A.x)(()=>{this.cdr.markForCheck()})).subscribe();this.subscriptions.push(i)}initForms(){this.formGroup=this.fb.group({name:["",_.k.compose([_.k.required,_.k.minLength(3),_.k.maxLength(255)])],type:["",_.k.compose([_.k.required])],email:[this.currentUser?.email||"",_.k.compose([])],phoneNumber:[Number(this.currentUser?.telemovel)||"",_.k.compose([])]}),this.formSecrets=this.fb.group({mfaCode:["",_.k.compose([_.k.required])]});const i=this.formGroup.get("type")?.valueChanges.subscribe(s=>{"email"===s?(this.formGroup.get("email")?.setValidators([_.k.required,_.k.email]),this.formGroup.get("phoneNumber")?.clearValidators()):"sms"===s?(this.formGroup.get("email")?.clearValidators(),this.formGroup.get("phoneNumber")?.setValidators([_.k.required,_.k.isValidTelemovel])):(this.formGroup.get("email")?.clearValidators(),this.formGroup.get("phoneNumber")?.clearValidators()),this.formGroup.get("email")?.updateValueAndValidity(),this.formGroup.get("phoneNumber")?.updateValueAndValidity()});i&&this.subscriptions.push(i)}nextStep(){this.formGroup.invalid?this.formGroup.markAllAsTouched():(this.formGroup.valid&&this.currentStep++,2==this.currentStep&&this.get
1Secret(),this.cdr.markForCheck())}getSecret(){const i={name:this.formGroup.get("name")?.value||"",type:this.formGroup.get("type")?.value||"",email:"email"===this.formGroup.get("type")?.value?this.formGroup.get("email")?.value:void 0,phoneNumber:"sms"===this.formGroup.get("type")?.value?this.formGroup.get("phoneNumber")?.value:void 0},s=this.authHttpService.generateMFASecret(i.name,i.type,i.email,i.phoneNumber?.toString()).pipe((0,x.b)(r=>{r&&(this.secret=r)}),(0,A.x)(()=>{this.cdr.markForCheck()}),(0,y.K)(r=>(this.swalErrorService.handleError(r),(0,C.of)(null)))).subscribe();this.subscriptions.push(s)}previousStep(){this.currentStep--}isControlValid(i,s){const r=i.controls[s];return r.valid&&(r.dirty||r.touched)}isControlInvalid(i,s){const r=i.controls[s];return r.invalid&&(r.dirty||r.touched)}add(){const i=this.authHttpService.verifyMFASecret({mfaName:this.formGroup.get("name")?.value,secret:this.secret?.secret,mfaCode:this.formSecrets.get("mfaCode")?.value,mfaType:this.formGroup.get("type")?.value}).pipe((0,x.b)(s=>{const r="<p>"+this.translateService.instant("PROFILE.SECURITY.MFA.ADD.CREATED_SUCCESS_DESC")+'</p><p style=" background: #e3e3e3cc;padding: 3px;">'+s.recoveryCodes.map(a=>"<b>"+a+"</b><br>").join("")+"</p>";N().fire({title:this.translateService.instant("PROFILE.SECURITY.MFA.ADD.CREATED_SUCCESS_TITLE"),html:r,icon:"success",showConfirmButton:!0,allowEscapeKey:!1,allowOutsideClick:!1,heightAuto:!1}).then(()=>{this.dialogRef.close(!0)})}),(0,A.x)(()=>{this.cdr.markForCheck()}),(0,y.K)(s=>(this.swalErrorService.handleError(s),(0,C.of)(null)))).subscribe();this.subscriptions.push(i)}close(i=!1){this.dialogRef.close(i)}ngOnDestroy(){this.subscriptions.forEach(i=>i.unsubscribe())}};let o=n;return n.\u0275fac=function(s){return new(s||n)(e.Y36(u.so),e.Y36(R.Cd),e.Y36(v.QS),e.Y36(u.WI),e.Y36(T.sK),e.Y36(f.C4),e.Y36(e.sBO),e.Y36(f.xD))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-mfa-dialog"]],decls:13,vars:11,consts:[["mat-dialog-title",""],[1,"conteudo",3,"perfectScrollbar","ngStyle"],["class","row",4,"ngIf"],[4,"ngIf"],[1,"float-end"],["class","btn btn-light",3,"click",4,"ngIf"],["class","btn btn-primary btn-elevate",3,"click",4,"ngIf"],[1,"row"],[1,"col-12",3,"innerHTML"],["id","form","autocomplete","off",1,"form",3,"formGroup"],[1,"form-group","row"],[1,"col-md-12","col-form-label"],[1,"col-md-12"],["type","text","formControlName","name",1,"form-control","form-control-lg","form-control-solid"],["validation","required",3,"control","message"],["validation","minlength",3,"control","message"],["validation","maxlength",3,"control","message"],["for","typeSelectField",1,"col-md-12","col-form-label"],["id","typeSelectField","formControlName","type",1,"form-control","h-auto","form-control-solid"],[3,"value",4,"ngFor","ngForOf"],["class","col-md-12 col-form-label",4,"ngIf"],["class","col-md-12",4,"ngIf"],[3,"value"],["type","text","formControlName","email",1,"form-control","form-control-lg","form-control-solid"],["validation","invalidEmail",3,"control","message"],["type","text","formControlName","phoneNumber",1,"form-control","form-control-lg","form-control-solid"],["validation","invalidPhoneNumber",3,"control","message"],["id","formSecrets","autocomplete","off",1,"form",3,"formGroup"],["class","col-12",4,"ngIf"],["type","text","formControlName","mfaCode",1,"form-control","form-control-lg","form-control-solid"],[1,"col-12"],[1,"secret-section"],[1,"form-group"],[1,"form-text","text-center"],["alt","QR Code",3,"src"],[1,"btn","btn-light",3,"click"],[1,"btn","btn-primary","btn-elevate",3,"click"]],template:function(s,r){1&s&&(e.TgZ(0,"h2",0),e._uU(1),e.qZA(),e.TgZ(2,"mat-dialog-content",1),e.YNc(3,Ei,3,4,"div",2),e.YNc(4,Pi,26,36,"div",3),e.YNc(5,Ui,13,14,"div",3),e.qZA(),e.TgZ(6,"mat-dialog-actions",4),e.YNc(7,ki,3,3,"button",5),e._uU(8," \xa0 "),e.YNc(9,Ni,3,3,"button",6),e.YNc(10,Mi,3,3,"button",5),e._uU(11," \xa0 "),e.YNc(12,Hi,3,3,"button",6),e.qZA()),2&s&&(e.xp6(1),e.Oqu(r.title),e.xp6(1),e.Q6J("perfectScrollbar",r.configScroll)("ngStyle",e.DdM(10,Gi)),e.xp6(1),e.Q6J("ngIf",r.description),e.xp6(1),e.Q6J("ngIf",1===r.currentStep),e.xp6(1),e.Q6J("ngIf",2===r.currentStep),e.xp6(2),e.Q6J("ngIf",1===r.currentStep||2===r.currentStep),e.xp6(2),e.Q6J("ngIf",1===r.currentStep),e.xp6(1),e.Q6J("ngIf",2===r.currentStep),e.xp6(2),e.Q6J("ngIf",2===r.currentStep))},dependencies:[g.sg,g.O5,g.PC,u.uh,u.xY,u.H8,U.$V,L.dW,v._Y,v.YN,v.Kr,v.Fj,v.EJ,v.JJ,v.JL,v.sg,v.u,T.X$,w.yl],styles:[".secret-section[_ngcontent-%COMP%]{word-break:break-all;background:rgba(227,227,227,.8);padding:15px}"]}),o})();function Yi(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"button",6),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.newMfaCodes())}),e._UZ(1,"i",7),e._uU(2),e.ALo(3,"translate"),e.qZA()}2&o&&(e.xp6(2),e.hij(" ",e.lcZ(3,1,"PROFILE.SECURITY.MFA.NEW_CODES")," "))}function Vi(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"tr")(1,"td"),e._UZ(2,"i",21),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"td"),e._uU(5),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"luxonDate"),e.qZA(),e.TgZ(11,"td")(12,"i",22),e.NdJ("click",function(){const r=e.CHM(t).$implicit,a=e.oxw(2);return e.KtG(a.deleteMfa(r))}),e.ALo(13,"translate"),e.qZA()()()}if(2&o){const t=n.$implicit;e.xp6(2),e.Tol(t.icon),e.s9C("ngbTooltip",e.lcZ(3,7,"PROFILE.SECURITY.MFA.TYPES."+t.type.toUpperCase())),e.xp6(3),e.Oqu(t.name),e.xp6(2),e.Oqu(t.value),e.xp6(2),e.Oqu(e.l
1cZ(10,9,t.createdAt)),e.xp6(3),e.s9C("ngbTooltip",e.lcZ(13,11,"PROFILE.SECURITY.MFA.DELETE"))}}function Qi(o,n){if(1&o&&(e.TgZ(0,"div",15)(1,"div",16)(2,"table",17)(3,"thead",18)(4,"tr",19)(5,"th"),e._uU(6),e.ALo(7,"translate"),e.qZA(),e.TgZ(8,"th"),e._uU(9),e.ALo(10,"translate"),e.qZA(),e._UZ(11,"th"),e.TgZ(12,"th"),e._uU(13),e.ALo(14,"translate"),e.qZA(),e._UZ(15,"th"),e.qZA()(),e.TgZ(16,"tbody"),e.YNc(17,Vi,14,13,"tr",20),e.qZA()()()()),2&o){const t=e.oxw();e.xp6(6),e.Oqu(e.lcZ(7,4,"PROFILE.SECURITY.MFA.TYPE")),e.xp6(3),e.Oqu(e.lcZ(10,6,"PROFILE.SECURITY.MFA.NAME")),e.xp6(4),e.Oqu(e.lcZ(14,8,"PROFILE.SECURITY.MFA.CREATED_AT")),e.xp6(4),e.Q6J("ngForOf",t.mfaOptions)}}function Ji(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"div",23)(1,"div",24)(2,"div",25)(3,"span"),e._uU(4),e.ALo(5,"translate"),e.qZA()()(),e.TgZ(6,"div",24)(7,"button",6),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.add())}),e._UZ(8,"i",7),e._uU(9),e.ALo(10,"translate"),e.qZA()()()}2&o&&(e.xp6(4),e.hij(" ",e.lcZ(5,2,"PROFILE.SECURITY.MFA.WITHOUT")," "),e.xp6(5),e.hij(" ",e.lcZ(10,4,"PROFILE.SECURITY.MFA.BTN_ADD")," "))}function Bi(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"div",23)(1,"div",24)(2,"div",25)(3,"span"),e._uU(4),e.ALo(5,"translate"),e.qZA()()(),e.TgZ(6,"div",24)(7,"button",27),e.NdJ("click",function(){e.CHM(t);const s=e.oxw(2);return e.KtG(s.associateCMD())}),e._UZ(8,"img",28),e.qZA()()()}if(2&o){const t=e.oxw(2);e.xp6(4),e.hij(" ",e.lcZ(5,2,"PROFILE.SECURITY.CMD.ASSOCIATE_TEXT")," "),e.xp6(3),e.Q6J("disabled",t.isLoadingSave)}}function ji(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"div",23)(1,"div",24)(2,"div",25)(3,"span"),e._uU(4),e.ALo(5,"translate"),e.qZA()()(),e.TgZ(6,"div",24)(7,"button",29),e.NdJ("click",function(){e.CHM(t);const s=e.oxw(2);return e.KtG(s.disassociateCMD())}),e._uU(8),e.ALo(9,"translate"),e.qZA()()()}if(2&o){const t=e.oxw(2);e.xp6(4),e.hij(" ",e.lcZ(5,3,"PROFILE.SECURITY.CMD.DESASSOCIATE_TEXT")," "),e.xp6(3),e.Q6J("disabled",t.isLoadingSave),e.xp6(1),e.hij(" ",e.lcZ(9,5,"PROFILE.SECURITY.CMD.DESASSOCIATE_BTN")," ")}}function Ki(o,n){if(1&o&&(e.ynx(0),e.TgZ(1,"div",26)(2,"div",1)(3,"div",2)(4,"h3",2)(5,"span",3),e._uU(6),e.ALo(7,"translate"),e.qZA(),e.TgZ(8,"span",4),e._uU(9),e.ALo(10,"translate"),e.qZA()()()(),e.TgZ(11,"div",9),e.YNc(12,Bi,9,4,"div",13),e.YNc(13,ji,10,7,"div",13),e.qZA()(),e.BQk()),2&o){const t=e.oxw();e.xp6(6),e.Oqu(e.lcZ(7,4,"PROFILE.SECURITY.CMD.TITLE")),e.xp6(3),e.Oqu(e.lcZ(10,6,"PROFILE.SECURITY.CMD.SUBTITLE")),e.xp6(3),e.Q6J("ngIf",null==(null==t.user.identificationDoc?null:t.user.identificationDoc.docNumber)),e.xp6(1),e.Q6J("ngIf",null==t.user.identificationDoc?null:t.user.identificationDoc.docNumber)}}let zi=(()=>{const n=class{constructor(i,s,r,a,l,c,p,h,m,b){this.cdr=i,this.handleError=s,this.authService=r,this.translate=a,this.dialog=l,this.pageInfoService=c,this.authHttpService=p,this.configService=h,this.submitHTMLFormService=m,this.route=b,this.hasSMS=!1,this.mfaOptions=[],this.withCMD=!1,this.isLoadingSave=!1,this.subscriptions=[]}ngOnInit(){this.setBreadcrumbs(),this.getConfigs()}getConfigs(){const i=this.configService.getLastInMemory().pipe((0,x.b)(s=>{this.hasSMS=(s?.configs||[]).some(r=>"comSMS"===r.id&&!0===r.value),this.withCMD=!0===s.backofficeSignInMechanisms?.includes("cmd"),this.getUser()}),(0,A.x)(()=>{this.checkCMDParams(),this.cdr.markForCheck()})).subscribe();this.subscriptions.push(i)}getUser(){this.mfaOptions=[],this.user=Object.assign({},this.authService.currentUserValue),this.user.mfaDevices?.length&&this.user.mfaDevices.forEach(i=>{this.mfaOptions.push({name:i.name,type:"device",icon:"fas fa-mobile-alt",createdAt:i.createdAt,_id:i._id})}),this.user.mfaEmail?.enabled&&this.mfaOptions.push({name:this.user.mfaEmail?.name,type:"email",icon:"fas fa-envelope-open-text",createdAt:this.user.mfaEmail?.createdAt,value:this.user.mfaEmail?.email}),this.user.mfaSms?.enabled&&this.hasSMS&&this.mfaOptions.push({name:this.user.mfaSms?.name,type:"sms",icon:"fas fa-sms",createdAt:this.user.mfaSms?.createdAt,value:this.user.mfaSms?.phoneNumber?.toString()}),this.mfaOptions.sort((i,s)=>new Date(s.createdAt).getTime()-new Date(i.createdAt).getTime()),this.cdr.markForCheck()}successSwal(i){N().fire({title:this.translate.instant(i),icon:"success",showConfirmButton:!1,timer:2500})}setBreadcrumbs(){this.pageInfoService.updateBreadcrumbs([{title:this.translate.instant("USER_OFFCANVAS.MY_PROFILE"),path:"/my-profile",isActive:!1,isSeparator:!1},{title:"",path:"",isSeparator:!0,isActive:!1},{title:this.translate.instant("PROFILE.SECURITY.TITLE"),path:"/my-profile/security",isActive:!0,isSeparator:!1}])}add(){const i=new u.vA;i.disableClose=!0,i.autoFocus=!1,i.maxWidth="450px",i.data={title:this.translate.instant("PROFILE.SECURITY.MFA.ADD.TITLE"),description:this.translate.instant("PROFILE.SECURITY.MFA.ADD.DESCRIPTION"),user:this.user};const s=this.dialog.open(qi,i).afterClosed().pipe((0,oe.h)(r=>!1!==r),(0,re.w)(r=>(0,C.of)(r)),(0,x.b)(r=>{this.getDataFromUser()}),(0,A.x)(()=>{this.cdr.markForCheck()}),(0,y.K)(r=>(this.handleError.handleError(r),(0,C.of)(null)))).subscribe();this.subscriptions.push(s)}deleteMfa(i){const s=new u.vA;s.maxWidth="500px",s.disableClose=!0,s.autoFocus=!0,s.data={title:this.translate.instant("PROFILE.SECURITY.MFA.DEL.TITLE"),description:this.translate.instant("PROFILE.SECURITY.MFA.DEL.DESC")};const r=this.dialog.open(G,s).afterClosed().pipe((0,oe.h)(a=>!0===a),(0,re.w)(()=>this.authHttpService.deleteMFASecret(i)),(0,x.b)(a=>{this.getDataFromUser(),this.successSwal("PROFILE.SECURITY.MFA.DEL.MSG_SUCCESS")}),(0,y.K)(a=>(this.handleError.handleError(a),(0,C.of)(null)))).subscribe();this.subscriptions.push(r)}getDataFromUser(){const i=this.authService.getUserByToken().pipe((0,x.b)(s=>{this.getUser()}),(0,A.x)(()=>{this.cdr.markForCheck()}),(0,y.K)(s=>(this.handleError.handleError(s),(0,C.of)(null)))).subscribe();this.subscriptions.push(i)}newMfaCodes(){const i=new u.vA;i.maxWidth="500px",i.disableClose=!0,i.autoFocus=!0,i.data={title:this.translate.instant("PROFILE.SECURITY.MFA.NEW_CODES_TITLE"),description:this.translate.instant("PROFILE.SECURITY.MFA.NEW_CODES_DESC")};const s=this.dialog.open(G,i).afterClosed().pipe((0,oe.h)(r=>!0===r),(0,re.w)(()=>this.authHttpService.newMfaCodes()),(0,x.b)(r=>{const a="<p>"+this.translate.instant("PROFILE.SECURITY.MFA.ADD.CREATED_SUCCESS_DESC")+'</p><p style=" background: #e3e3e3cc;padding: 3px;">'+r.recoveryCodes.map(l=>"<b>"+l+"</b><br>").join("")+"</p>";N().fire({title:this.translate.instant("PROFILE.SECURITY.MFA.ADD.CREATED_SUCCESS_TITLE"),html:a,icon:"success",showConfirmButton:!0,allowEscapeKey:!1,allowOutsideClick:!1,heightAuto:!1})}),(0,y.K)(r=>(this.handleError.handleError(r),(0,C.of)(null)))).subscribe();this.subscriptions.push(s)}associateCMD(){if(!0!==this.withCMD)return;this.isLoadingSave=!0;
1const i=this.authHttpService.associateCMD().pipe((0,me.U)(({url:s,params:r})=>{this.authService.changeCMDFlagLocalStorage("set"),this.submitHTMLFormService.submitForm("POST",s,r)}),(0,A.x)(()=>{this.isLoadingSave=!1}),(0,y.K)(s=>(this.handleError.handleError(s),(0,C.of)(null)))).subscribe();this.subscriptions.push(i)}disassociateCMD(){if(!0!==this.withCMD)return;this.isLoadingSave=!0;const i=this.authHttpService.disassociateCMD().pipe((0,x.b)(()=>{delete this.user.identificationDoc,this.authService.currentUserValue=this.user,N().fire({title:this.translate.instant("GENERAL.SUCCESSFULLY_SAVED"),icon:"success",showConfirmButton:!0,didClose:()=>{this.authService.checkLogoutCMD("/cmd/association/sign-out")}})}),(0,A.x)(()=>{this.isLoadingSave=!1}),(0,y.K)(s=>(this.handleError.handleError(s),(0,C.of)(null)))).subscribe();this.subscriptions.push(i)}checkCMDParams(){if(!0!==this.withCMD)return;const i=this.route.snapshot.queryParams["cmd-error"];if(null!=i)return this.handleError.handleError({error:{message:[i]}},!1,()=>{this.authService.checkLogoutCMD("/cmd/association/sign-out")});"true"===this.route.snapshot.queryParams["cmd-associated"]&&(this.authService.changeCMDFlagLocalStorage("set"),this.successSwal("GENERAL.SUCCESSFULLY_SAVED"))}ngOnDestroy(){this.subscriptions.forEach(i=>i.unsubscribe())}};let o=n;return n.\u0275fac=function(s){return new(s||n)(e.Y36(e.sBO),e.Y36(f.C4),e.Y36(R.e8),e.Y36(T.sK),e.Y36(u.uw),e.Y36(se.Z),e.Y36(R.Cd),e.Y36(f.xD),e.Y36(f.OS),e.Y36(k.gz))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-profile-security"]],decls:23,vars:13,consts:[[1,"card","card-custom"],[1,"card-header","py-3"],[1,"card-title","align-items-start","flex-column"],[1,"card-label","fw-bolder","fs-3","mb-1"],[1,"text-muted","fw-medium","fs-7"],[1,"card-toolbar"],["type","button",1,"btn","btn-success","me-2",3,"click"],[1,"fas","fa-plus"],["type","button","class","btn btn-success me-2",3,"click",4,"ngIf"],[1,"card-body"],[1,"tab-content"],[1,"py-0","tab-pane","fade","show","active"],["class","dataTables_wrapper dt-bootstrap4",4,"ngIf"],["class","row",4,"ngIf"],[4,"ngIf"],[1,"dataTables_wrapper","dt-bootstrap4"],[1,"table-responsive"],[1,"table","align-middle","dataTable"],[1,"border-bottom","border-gray-200","fs-7","text-uppercase"],[1,"text-muted"],[4,"ngFor","ngForOf"],["container","body","placement","top",3,"ngbTooltip"],["container","body","placement","top",1,"fas","fa-trash-alt","cursor-pointer","text-danger",3,"ngbTooltip","click"],[1,"row"],[1,"col-12","text-center"],[1,"mt-5","mb-5"],[1,"card","card-custom","mt-4"],["type","button",1,"btn","btn-primary","btn-cmd",3,"disabled","click"],["src","./assets/media/logos/logo-autenticacao.gov-branco.png","alt","btn_cmd"],["type","button",1,"btn","btn-secondary",3,"disabled","click"]],template:function(s,r){1&s&&(e.ynx(0),e.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"h3",2)(5,"span",3),e._uU(6),e.ALo(7,"translate"),e.qZA(),e.TgZ(8,"span",4),e._uU(9),e.ALo(10,"translate"),e.qZA()()(),e.TgZ(11,"div",5)(12,"button",6),e.NdJ("click",function(){return r.add()}),e._UZ(13,"i",7),e._uU(14),e.ALo(15,"translate"),e.qZA(),e.YNc(16,Yi,4,3,"button",8),e.qZA()(),e.TgZ(17,"div",9)(18,"div",10)(19,"div",11),e.YNc(20,Qi,18,10,"div",12),e.YNc(21,Ji,11,6,"div",13),e.qZA()()()(),e.BQk(),e.YNc(22,Ki,14,8,"ng-container",14)),2&s&&(e.xp6(6),e.Oqu(e.lcZ(7,7,"PROFILE.SECURITY.MFA.TITLE")),e.xp6(3),e.Oqu(e.lcZ(10,9,"PROFILE.SECURITY.MFA.SUBTITLE")),e.xp6(5),e.hij(" ",e.lcZ(15,11,"PROFILE.SECURITY.MFA.BTN_ADD")," "),e.xp6(2),e.Q6J("ngIf",null==r.mfaOptions?null:r.mfaOptions.length),e.xp6(4),e.Q6J("ngIf",null==r.mfaOptions?null:r.mfaOptions.length),e.xp6(1),e.Q6J("ngIf",!r.mfaOptions.length),e.xp6(1),e.Q6J("ngIf",r.withCMD))},dependencies:[g.sg,g.O5,O._L,w.o8,T.X$],styles:[".btn-cmd[_ngcontent-%COMP%]{padding:3px 16px!important}"]}),o})();var je=d(9594);function Wi(o,n){if(1&o&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&o){const t=e.oxw();e.xp6(1),e.AsE(" - ",e.lcZ(2,2,"HISTORY.USER_NAME")," ",t.history.user.nome," ")}}function $i(o,n){1&o&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&o&&(e.xp6(1),e.hij(" - ",e.lcZ(2,1,"HISTORY.ANONIMUSUSERCM")," "))}function Xi(o,n){if(1&o&&(e.TgZ(0,"div",15),e._uU(1),e.qZA()),2&o){const t=e.oxw(2);e.xp6(1),e.hij(" ",t.getTranslatedContextParent()," ")}}function en(o,n){if(1&o&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.ALo(3,"translate"),e.qZA()),2&o){const t=e.oxw(3);e.xp6(1),e.lnq(" ",e.lcZ(2,3,"HISTORY.OLD"),": ",t.getLength(t.oldValue)," ",e.lcZ(3,5,"HISTORY.ELEMENTS")," ")}}function tn(o,n){1&o&&(e.TgZ(0,"span"),e._uU(1," - "),e.qZA())}function nn(o,n){if(1&o&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.ALo(3,"translate"),e.qZA()),2&o){const t=e.oxw(3);e.xp6(1),e.lnq("",e.lcZ(2,3,"HISTORY.NEW"),": ",t.getLength(t.newValue)," ",e.lcZ(3,5,"HISTORY.ELEMENTS")," ")}}function sn(o,n){if(1&o&&(e.TgZ(0,"div",3),e.YNc(1,en,4,7,"span",5),e.YNc(2,tn,2,0,"span",5),e.YNc(3,nn,4,7,"span",5),e.qZA()),2&o){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf","CREATE"!==t.history.event),e.xp6(1),e.Q6J("ngIf","UPDATE"===t.history.event),e.xp6(1),e.Q6J("ngIf","DELETE"!==t.history.event)}}function on(o,n){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",16)(2,"button",17),e.NdJ("click",function(){e.CHM(t);const s=e.oxw(2);return e.KtG(s.goToPreviousElement())}),e._UZ(3,"i",18),e._uU(4),e.ALo(5,"translate"),e.qZA(),e.TgZ(6,"span",19),e._uU(7),e.ALo(8,"translate"),e.qZA(),e.TgZ(9,"button",17),e.NdJ("click",function(){e.CHM(t);const s=e.oxw(2);return e.KtG(s.goToNextElement())}),e._uU(10),e.ALo(11,"translate"),e._UZ(12,"i",20),e.qZA()(),e.BQk()}if(2&o){const t=e.oxw(2);e.xp6(2),e.Q6J("disabled",t.cantGoToPreviousElement()),e.xp6(2),e.hij(" ",e.lcZ(5,6,"HISTORY.PREVIOUS_ELEMENT")," "),e.xp6(3),e.AsE("",e.lcZ(8,8,"HISTORY.ELEMENT")," ",t.currentElement+1,""),e.xp6(2),e.Q6J("disabled",t.cantGoToNextElement()),e.xp6(1),e.hij(" ",e.lcZ(11,10,"HISTORY.NEXT_ELEMENT")," ")}}function rn(o,n){if(1&o&&(e.TgZ(0,"div",2),e.YNc(1,Xi,2,1,"div",11),e.YNc(2,sn,4,3,"div",12),e.YNc(3,on,13,12,"ng-container",5),e.TgZ(4,"div",13)(5,"p"),e._uU(6),e.ALo(7,"translate"),e.qZA()(),e.TgZ(8,"div",14)(9,"p"),e._uU(10),e.ALo(11,"translate"),e.qZA()(),e.TgZ(12,"div",14)(13,"p"),e._uU(14),e.ALo(15,"translate"),e.qZA()()()),2&o){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",null!=t.parentKey),e.xp6(1),e.Q6J("ngIf",t.isArray),e.xp6(1),e.Q6J("ngIf",t.isObjectArray),e.xp6(3),e.Oqu(e.l
1cZ(7,8,"HISTORY.KEY")),e.xp6(2),e.Q6J("ngClass",t.getHeaderClass("DELETE","CREATE")),e.xp6(2),e.Oqu(e.lcZ(11,10,"HISTORY.OLD")),e.xp6(2),e.Q6J("ngClass",t.getHeaderClass("CREATE","DELETE")),e.xp6(2),e.Oqu(e.lcZ(15,12,"HISTORY.NEW"))}}function an(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"div",26)(1,"button",27),e.NdJ("click",function(){e.CHM(t);const s=e.oxw().$implicit,r=e.oxw();return e.KtG(r.openComplexDiff(s.key,s.previousValue,s.newValue))}),e.ALo(2,"translate"),e._UZ(3,"i",28),e.qZA()()}2&o&&(e.xp6(1),e.Q6J("ngbTooltip",e.lcZ(2,1,"HISTORY.DETAILS")))}const ln=function(o,n,t){return{value:o,showAs:n,differentValues:t,differentValuesClass:"bg-light-danger"}},cn=function(o,n,t){return{value:o,showAs:n,differentValues:t,differentValuesClass:"bg-light-success"}};function pn(o,n){if(1&o&&(e.TgZ(0,"div",2)(1,"div",21)(2,"p",22),e._uU(3),e.qZA()(),e.TgZ(4,"div",23),e.GkF(5,24),e.qZA(),e.YNc(6,an,4,3,"div",25),e.TgZ(7,"div",23),e.GkF(8,24),e.qZA()()),2&o){const t=n.$implicit,i=e.oxw(),s=e.MAs(16);e.xp6(3),e.hij(" ",i.translateKey(t)," "),e.xp6(1),e.Q6J("ngClass",i.getValueClass(t.showAsComplex,"DELETE","CREATE")),e.xp6(1),e.Q6J("ngTemplateOutlet",s)("ngTemplateOutletContext",e.kEZ(8,ln,t.previousValue,t.showPreviousAs,t.differentValues)),e.xp6(1),e.Q6J("ngIf",t.showAsComplex),e.xp6(1),e.Q6J("ngClass",i.getValueClass(t.showAsComplex,"CREATE","DELETE")),e.xp6(1),e.Q6J("ngTemplateOutlet",s)("ngTemplateOutletContext",e.kEZ(12,cn,t.newValue,t.showNewAs,t.differentValues))}}function dn(o,n){if(1&o&&(e._UZ(0,"div",32),e.ALo(1,"safe")),2&o){const t=e.oxw().value;e.Q6J("innerHTML",e.xi3(1,1,t,"html"),e.oJD)}}function hn(o,n){if(1&o&&(e.TgZ(0,"div"),e._UZ(1,"img",33),e.ALo(2,"async"),e.qZA()),2&o){const t=e.oxw().value,i=e.oxw();e.xp6(1),e.Q6J("src",e.lcZ(2,1,i.getFileSigned(t)),e.LSH)}}function un(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"div")(1,"button",34),e.NdJ("click",function(){e.CHM(t);const s=e.oxw().value,r=e.oxw();return e.KtG(r.downloadFile(s))}),e._UZ(2,"i",35),e._uU(3),e.ALo(4,"translate"),e.qZA()()}2&o&&(e.xp6(3),e.hij(" ",e.lcZ(4,1,"HISTORY.DOWNLOAD_FILE")," "))}function gn(o,n){if(1&o&&(e.TgZ(0,"div"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&o){const t=e.oxw().value;e.xp6(1),e.AsE(" ",t.length," ",e.lcZ(2,2,"HISTORY.ELEMENTS")," ")}}function mn(o,n){if(1&o&&(e.TgZ(0,"div"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&o){const t=e.oxw().value,i=e.oxw();e.xp6(1),e.AsE(" ",i.getLength(t)," ",e.lcZ(2,2,"HISTORY.FIELDS")," ")}}function fn(o,n){if(1&o&&(e.TgZ(0,"div",29),e.YNc(1,dn,2,4,"div",30),e.YNc(2,hn,3,3,"div",31),e.YNc(3,un,5,3,"div",31),e.YNc(4,gn,3,4,"div",31),e.YNc(5,mn,3,4,"div",31),e.qZA()),2&o){const t=n.showAs,i=n.differentValues,s=n.differentValuesClass,r=e.oxw();e.Q6J("ngClass",i?s:"bg-light")("ngSwitch",t),e.xp6(1),e.Q6J("ngSwitchCase",r.HistoryViewType.DEFAULT),e.xp6(1),e.Q6J("ngSwitchCase",r.HistoryViewType.IMG),e.xp6(1),e.Q6J("ngSwitchCase",r.HistoryViewType.FILE),e.xp6(1),e.Q6J("ngSwitchCase",r.HistoryViewType.ARRAY),e.xp6(1),e.Q6J("ngSwitchCase",r.HistoryViewType.OBJECT)}}function _n(o,n){1&o&&(e.TgZ(0,"div",2)(1,"div",36)(2,"p"),e._uU(3),e.ALo(4,"translate"),e.qZA()()()),2&o&&(e.xp6(3),e.Oqu(e.lcZ(4,1,"HISTORY.NO_KEYS")))}const vn=function(){return{position:"relative"}},Ke=function(o){return[o]};let bn=(()=>{const n=class{constructor(i,s,r,a,l,c){this.dialogRef=i,this.translate=r,this.json=a,this.awss3FileService=l,this.dialog=c,this.HistoryViewType=I.Px,this.arrInfo=[],this.existingKeys=[],this.isArray=!1,this.isObjectArray=!1,this.currentElement=-1,this.subscriptions=[],this.newValue=s.history.newValue??[],this.oldValue=s.history.oldValue??[],this.context=s.context,this.history=s.curHistory,this.customTransformValue=s.customTransformValue,this.parentKey=s.parentKey,this.dialogWidth=s.dialogWidth,this.configScroll=new U.kO({suppressScrollX:!0,wheelPropagation:!0})}ngOnInit(){if(this.checkArrayView(),!0===this.isObjectArray)return this.goToNextElement();this.buildHistoryView(this.newValue,this.oldValue)}checkArrayView(){Array.isArray(this.oldValue)&&Array.isArray(this.newValue)&&(this.isArray=!0,this.isObjectArray=[...this.oldValue,...this.newValue].every(i=>"object"==typeof i&&null!==i))}buildHistoryView(i,s){this.populateKeys(i),this.populateKeys(s),this.existingKeys=this.existingKeys.sort(),this.buildArrInfo(i,s)}populateKeys(i,s){if("object"==typeof i)for(const r in i)if(null!=s||null==i[r]||"object"!=typeof i[r]||!1!==Array.isArray(i[r]))if(s){if(this.existingKeys.some(a=>a===s||a===`${s}.${r}`))continue;this.existingKeys.push(`${s}.${r}`)}else{if(this.existingKeys.some(a=>a===r||a.startsWith(`${r}.`)))continue;this.existingKeys.push(r)}else this.populateKeys(i[r],r)}buildArrInfo(i,s){s=s||{},i=i||{};for(const r of this.existingKeys){const a=(0,je.Z)(s,r),l=(0,je.Z)(i,r),c=this.transformValue(r,a),p=this.transformValue(r,l),{isComplex:h,showAsComplex:m}=this.checkComplex(c,p);this.arrInfo.push({key:r,differentValues:this.json.stringify(a)!==this.json.stringify(l),previousValue:c.value,showPreviousAs:c.showAs,newValue:p.value,showNewAs:p.showAs,isComplex:h,showAsComplex:m})}}
1transformValue(i,s){if(null!=this.customTransformValue){const r=this.customTransformValue(this.parentKey?`${this.parentKey}.${i}`:i,s);if("string"==typeof r)return{showAs:I.Px.DEFAULT,value:r};if(null!=r&&"showAs"in r)return r}return this.transformValueGeneral(s)}transformValueGeneral(i){return Array.isArray(i)?{showAs:I.Px.ARRAY,value:i}:null!=i&&"object"==typeof i?{showAs:I.Px.OBJECT,value:i}:"boolean"==typeof i?{showAs:I.Px.DEFAULT,value:this.translate.instant(!0===i?"HISTORY.YES":"HISTORY.NO")}:null!=i&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(i)&&!0===ne.ou.fromISO(i).isValid?{showAs:I.Px.DEFAULT,value:(new w.o8).transform(i)??"-"}:{showAs:I.Px.DEFAULT,value:i??"-"}}checkComplex(i,s){return[I.Px.ARRAY,I.Px.OBJECT].some(a=>a===i.showAs||a===s.showAs)?{isComplex:!0,showAsComplex:this.getLength(i.value)>0||this.getLength(s.value)>0}:{isComplex:!1,showAsComplex:!1}}translateKey(i){const s=Number(i.key);if(!isNaN(s))return`${this.translate.instant("HISTORY.ELEMENT")} ${s+1}`;const r=[];if(this.parentKey&&r.push(this.parentKey),r.push(i.key),!0===i.isComplex){const a=i.key.split(".");r.push(a[a.length-1])}return this.getTranslatedContext(r)}cancel(){this.dialogRef.close(!1)}getTranslatedContext(i){const s=["HISTORY",this.context.toUpperCase(),...i.map(r=>r.toUpperCase())];return this.translate.instant(s.join("."))}getTranslatedContextParent(){if(null==this.parentKey)return;const i=[];i.push(this.parentKey);const s=this.parentKey.split(".");return i.push(s[s.length-1]),this.getTranslatedContext(i)}getFileSigned(i){return this.awss3FileService.get(i)}downloadFile(i){const s=this.awss3FileService.download(i).subscribe();this.subscriptions.push(s)}getLength(i){return Array.isArray(i)?i.length:"object"==typeof i?Object.keys(i).length:0}openComplexDiff(i,s,r){const a=new u.vA;a.disableClose=!0,a.width=this.dialogWidth,a.autoFocus=!1,a.data={history:{newValue:"object"!=typeof r?[]:r,oldValue:"object"!=typeof s?[]:s},context:this.context,curHistory:this.history,customTransformValue:this.customTransformValue,parentKey:this.parentKey?`${this.parentKey}.${i}`:i,dialogWidth:a.width},this.dialog.open(n,a)}cantGoToPreviousElement(){return this.currentElement-1<0}cantGoToNextElement(){const s=this.newValue,r=this.oldValue;return this.currentElement+1>(s>r?s:r).length-1}goToPreviousElement(){this.cantGoToPreviousElement()||this.goToElement(-1)}goToNextElement(){this.cantGoToNextElement()||this.goToElement(1)}goToElement(i){this.currentElement+=i,this.existingKeys=[],this.arrInfo=[],this.buildHistoryView(this.newValue[this.currentElement],this.oldValue[this.currentElement])}getValueClass(i,s,r){return this.history.event===s?i?"col-md-8":"col-md-10":this.history.event===r?"d-none":i?"col-md-4":"col-md-5"}getHeaderClass(i,s){return this.history.event===i?"d-none d-md-block col-md-10":this.history.event===s?"d-none":"d-none d-md-block col-md-5"}ngOnDestroy(){this.subscriptions.forEach(i=>i.unsubscribe())}};let o=n;return n.\u0275fac=function(s){return new(s||n)(e.Y36(u.so),e.Y36(u.WI),e.Y36(T.sK),e.Y36(f.rY),e.Y36(f.lw),e.Y36(u.uw))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-history-dialog"]],decls:22,vars:23,consts:[["mat-dialog-title",""],[3,"perfectScrollbar","ngStyle"],[1,"row"],[1,"col-12","text-center","mb-5"],[1,"fw-medium"],[4,"ngIf"],["class","row",4,"ngIf"],["class","row",4,"ngFor","ngForOf"],["historyValue",""],[1,"float-end"],["type","button",1,"btn","btn-light","btn-elevate","me-2",3,"click"],["class","col-12 text-center text-primary font-size-lg mb-2",4,"ngIf"],["class","col-12 text-center mb-5",4,"ngIf"],[1,"d-none","d-md-block","col-md-2","text-center"],[1,"text-center",3,"ngClass"],[1,"col-12","text-center","text-primary","font-size-lg","mb-2"],[1,"col-12","d-flex","justify-content-between","align-items-center","mb-10"],[1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-angle-left","p-0"],[1,"p-2"],[1,"fas","fa-angle-right","p-0"],[1,"col-md-2"],[1,"fw-medium","p-3"],[1,"mb-4",3,"ngClass"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["class","col-md-2 d-flex justify-content-center mt-2 mb-4",4,"ngIf"],[1,"col-md-2","d-flex","justify-content-center","mt-2","mb-4"],["placement","top",1,"btn","btn-primary","btn-sm","btn-icon",3,"ngbTooltip","click"],[1,"fas","fa-search-plus"],[1,"history-cell",3,"ngClass","ngSwitch"],[3,"innerHTML",4,"ngSwitchCase"],[4,"ngSwitchCase"],[3,"innerHTML"],[1,"history-image",3,"src"],[1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-file-download"],[1,"col-md-12","text-center"]],template:function(s,r){1&s&&(e.TgZ(0,"h2",0),e._uU(1),e.ALo(2,"translate"),e.qZA(),e.TgZ(3,"mat-dialog-content",1)(4,"div",2)(5,"div",3)(6,"p")(7,"span",4),e._uU(8),e.ALo(9,"luxonDate"),e.qZA(),e.YNc(10,Wi,3,4,"span",5),e.YNc(11,$i,3,3,"span",5),e._uU(12),e.qZA()()(),e.YNc(13,rn,16,14,"div",6),e.YNc(14,pn,9,16,"div",7),e.YNc(15,fn,6,7,"ng-template",null,8,e.W1O),e.YNc(17,_n,5,3,"div",6),e.qZA(),e.TgZ(18,"mat-dialog-actions",9)(19,"button",10),e.NdJ("click",function(){return r.cancel()}),e._uU(20),e.ALo(21,"translate"),e.qZA()()),2&s&&(e.xp6(1),e.Oqu(e.l
1cZ(2,12,"HISTORY.MODAL_TITLE")),e.xp6(2),e.Q6J("perfectScrollbar",r.configScroll)("ngStyle",e.DdM(18,vn)),e.xp6(5),e.Oqu(e.lcZ(9,14,r.history.updatedAt)),e.xp6(2),e.Q6J("ngIf",null==r.history||null==r.history.user?null:r.history.user.nome),e.xp6(1),e.Q6J("ngIf",!(null!=r.history&&null!=r.history.user&&r.history.user.nome)),e.xp6(1),e.AsE(" ",r.getTranslatedContext(e.VKq(19,Ke,r.history.event))," ",r.getTranslatedContext(e.VKq(21,Ke,r.context))," "),e.xp6(1),e.Q6J("ngIf",null==r.arrInfo?null:r.arrInfo.length),e.xp6(1),e.Q6J("ngForOf",r.arrInfo),e.xp6(3),e.Q6J("ngIf",!(null!=r.arrInfo&&r.arrInfo.length)),e.xp6(3),e.hij(" ",e.lcZ(21,16,"GENERAL.CANCEL")," "))},dependencies:[g.mk,g.sg,g.O5,g.tP,g.PC,g.RF,g.n9,O._L,u.uh,u.xY,u.H8,U.$V,g.Ov,T.X$,w.o8,w.yl],styles:[".history-cell[_ngcontent-%COMP%]{text-align:center;padding:1rem;white-space:pre-line;min-height:46px;overflow-wrap:break-word}.history-image[_ngcontent-%COMP%]{max-width:100%;max-height:200px}"]}),o})();var xn=d(3267);function Tn(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"div",9)(1,"filter-bar",10),e.NdJ("whenFiltersChange",function(s){e.CHM(t);const r=e.oxw(3);return e.KtG(r.onFiltersChange(s))}),e.qZA()()}if(2&o){const t=e.oxw(3);e.xp6(1),e.Q6J("filters",t.getFilters())}}function Sn(o,n){if(1&o&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&o){const t=e.oxw().$implicit;e.xp6(1),e.AsE(" - ",e.lcZ(2,2,"HISTORY.USER_NAME")," ",t.user.nome," ")}}function Cn(o,n){1&o&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&o&&(e.xp6(1),e.hij(" - ",e.lcZ(2,1,"HISTORY.ANONIMUSUSERCM")," "))}function En(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"i",18),e.NdJ("click",function(){e.CHM(t);const s=e.oxw(2).$implicit,r=e.oxw(4);return e.KtG(r.openDetails(s))}),e.ALo(1,"translate"),e.qZA()}2&o&&e.s9C("ngbTooltip",e.lcZ(1,1,"HISTORY.DETAILS"))}function An(o,n){if(1&o&&(e.TgZ(0,"span"),e.YNc(1,En,2,3,"i",17),e.qZA()),2&o){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngIf","SORT"!==t.event)}}const ze=function(o){return[o]};function yn(o,n){if(1&o&&(e.TgZ(0,"div",14)(1,"p")(2,"span",15),e._uU(3),e.ALo(4,"luxonDate"),e.qZA(),e.YNc(5,Sn,3,4,"span",16),e.YNc(6,Cn,3,3,"span",16),e._uU(7),e.qZA(),e.YNc(8,An,2,1,"span",1),e.qZA()),2&o){const t=n.$implicit,i=e.oxw(4);e.xp6(3),e.Oqu(e.lcZ(4,6,t.createdAt)),e.xp6(2),e.Q6J("ngIf",t.user),e.xp6(1),e.Q6J("ngIf",!t.user),e.xp6(1),e.AsE(" ",i.getOperationString(t.event)," ",i.getOperationString(i.context)," "),e.xp6(1),e.Q6J("ngxPermissionsOnly",e.VKq(8,ze,i.detailsPermission))}}function Dn(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"div",11),e.YNc(1,yn,9,10,"div",12),e.TgZ(2,"app-paginator",13),e.NdJ("paginate",function(s){e.CHM(t);const r=e.oxw(3);return e.KtG(r.paginate(s))}),e.qZA()()}if(2&o){const t=e.oxw(3);e.xp6(1),e.Q6J("ngForOf",t.getHistory()),e.xp6(1),e.Q6J("paginator",t.getPaginator())("isLoading",t.isLoading())}}function In(o,n){1&o&&(e.TgZ(0,"h2",19),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&o&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"HISTORY.NO_RESULTS")," "))}function wn(o,n){if(1&o&&(e.YNc(0,Tn,2,1,"div",6),e.YNc(1,Dn,3,3,"div",7),e.YNc(2,In,3,3,"h2",8)),2&o){const t=e.oxw(2);e.Q6J("ngIf",t.getFilters().length),e.xp6(1),e.Q6J("ngIf",0!==t.getHistory().length),e.xp6(1),e.Q6J("ngIf",0===t.getHistory().length)}}function Pn(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"mat-accordion")(1,"mat-expansion-panel",2),e.NdJ("afterExpand",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.handleAfterExpand())})("afterCollapse",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.handleAfterCollapse())}),e.TgZ(2,"mat-expansion-panel-header")(3,"mat-panel-title"),e._UZ(4,"span",3),e.TgZ(5,"span",4),e._uU(6),e.ALo(7,"translate"),e.qZA()()(),e.YNc(8,wn,3,3,"ng-template",5),e.qZA()()}if(2&o){const t=e.oxw();e.xp6(1),e.Q6J("expanded",t.open),e.xp6(3),e.Q6J("inlineSVG","./assets/media/icons/duotune/general/Clock.svg"),e.xp6(2),e.hij(" ",e.lcZ(7,3,"HISTORY.TITLE")," ")}}let Ln=(()=>{const n=class{constructor(i,s,r,a,l){this.cdr=i,this.dialog=s,this.handleError=r,this.translate=a,this.permissionsService=l,this.operations=["CREATE","UPDATE","DELETE"],this.size="md",this.open=!1,this.subscriptions=[],this.filters=[],this.historyQuery={sort:["-createdAt"],event:[]},this.paginator=new ve.OB,this.history=[],this.loading=!0}ngOnInit(){this.historyQuery.event=this.operations,this.initFilters()}ngOnChanges(i){null!=i.changed&&(this.historyQuery.event=this.operations,this.fetchHistory(),this.cdr.markForCheck())}initFilters(){this.filters.push(new L.JW("user",this.translate.instant("HISTORY.FILTERS.USER")),new L.N0("createdAt",this.translate.instant("HISTORY.FILTERS.CREATED_AT"),"",!0),new L.l6("event",this.translate.instant("HISTORY.FILTERS.EVENT.TITLE"),this.operations.map(i=>({key:i,label:this.translate.instant(`HISTORY.FILTERS.EVENT.${i}`)}))))}getOperationString(i){return this.translate.instant(`HISTORY.${this.context.toUpperCase()}.${i.toUpperCase()}`)}fetchHistory(){if(!this.permissionsService.getPermission(this.listPermission)||!1===this.open)return;this.loading=!0;const i=this.service.history(this.historyQuery).pipe((0,x.b)(s=>{this.total=s.total,this.history=s.results,this.setPaginator(this.total,this.paginator.page,this.paginator.pageSize,this.paginator.pageSizes)}),(0,A.x)(()=>{this.loading=!1,this.cdr.markForCheck()}),(0,y.K)(s=>(this.handleError.handleError(s),(0,C.of)(null)))).subscribe();this.subscriptions.push(i)}openDetails(i){this.permissionsService.getPermission(this.detailsPermission)&&this.service.historyById(i._id).pipe((0,x.b)(s=>{this.openDialog(s,i)}),(0,A.x)(()=>{this.cdr.markForCheck()}),(0,y.K)(()=>(0,C.of)(null))).subscribe()}openDialog(i,s){const r=new u.vA;r.disableClose=!0,"sm"===this.size&&(r.width="500px"),"md"===this.size&&(r.width="900px"),"lg"===this.size&&(r.width="1500px"),r.autoFocus=!1,r.data={history:i,context:this.context,curHistory:s,customTransformValue:this.customTransformValue,dialogWidth:r.width},this.dialog.open(bn,r)}setPaginator(i=0,s=1,r=10,a=[10,20,50,100]){this.paginator.page=s,this.paginator.pageSize=r,this.paginator.pageSizes=(a||[]).length?a:[10,20,50,100],this.paginator.total=i}resetPaginator(){this.paginator.page=1,this.historyQuery.page=1}paginate(i){this.historyQuery.page=i.page,this.historyQuery.rows=i.pageSize,this.fetchHistory()}onFiltersChange(i){this.resetPaginator(),this.historyQuery.event=this.operations,this.historyQuery.user=void 0,this.historyQuery.createdAtFrom=void 0,this.historyQuery.createdAtTo=void 0,i.user&&(this.historyQuery.user=i.user),i.event&&(this.historyQuery.event=i.event),i.createdAt&&(this.historyQuery.createdAtFrom=i.createdAt.from,this.historyQuery.createdAtTo=i.createdAt.to),this.fetchHistory()}handleAfterExpand(){this.open=!0,this.fetchHistory()}handleAfterCollapse(){this.open=!1}getFilters(){return this.filters}getPaginator(){return this.paginator}isLoading(){return this.loading}getHistory(){return this.history}ngOnDestroy(){this.subscriptions.forEach(i=>
1i.unsubscribe())}};let o=n;return n.\u0275fac=function(s){return new(s||n)(e.Y36(e.sBO),e.Y36(u.uw),e.Y36(f.C4),e.Y36(T.sK),e.Y36(te.YI))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-log-history"]],inputs:{context:"context",service:"service",changed:"changed",operations:"operations",size:"size",listPermission:"listPermission",detailsPermission:"detailsPermission",open:"open",customTransformValue:"customTransformValue"},features:[e.TTD],decls:2,vars:3,consts:[[1,"mb-5"],[4,"ngxPermissionsOnly"],[3,"expanded","afterExpand","afterCollapse"],["cacheSVG","false",1,"svg-icon","svg-icon-2x","svg-icon-primary","me-2",3,"inlineSVG"],[1,"align-self-center"],["matExpansionPanelContent",""],["class","w-100",4,"ngIf"],["class","px-7",4,"ngIf"],["class","text-center",4,"ngIf"],[1,"w-100"],[3,"filters","whenFiltersChange"],[1,"px-7"],["class","d-flex justify-content-between log-row",4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","align-items-center","flex-wrap",3,"paginator","isLoading","paginate"],[1,"d-flex","justify-content-between","log-row"],[1,"fw-medium"],[4,"ngIf"],["class","fas fa-search-plus text-primary cursor-pointer","container","body",3,"ngbTooltip","click",4,"ngIf"],["container","body",1,"fas","fa-search-plus","text-primary","cursor-pointer",3,"ngbTooltip","click"],[1,"text-center"]],template:function(s,r){1&s&&(e.TgZ(0,"div",0),e.YNc(1,Pn,9,5,"mat-accordion",1),e.qZA()),2&s&&(e.xp6(1),e.Q6J("ngxPermissionsOnly",e.VKq(1,ze,r.listPermission)))},dependencies:[g.sg,g.O5,xn.J,L.Zi,O._L,te.gE,H.pp,H.ib,H.yz,H.yK,H.HS,ee.d$,T.X$,w.o8],styles:['@charset "UTF-8";[_nghost-%COMP%]     .mat-expansion-panel-content{font-family:MontSerrat;font-size:13px}[_nghost-%COMP%]     .mat-expansion-panel-content>.mat-expansion-panel-body{padding:0!important}.log-row[_ngcontent-%COMP%]:hover   p[_ngcontent-%COMP%]:before{content:"\\25ba";color:var(--primary)}.log-row[_ngcontent-%COMP%]:hover   i[_ngcontent-%COMP%]{transform:scale(1.2);font-weight:bolder;transition:.25s all}']}),o})();const On=function(o){return{"background-image":o}};function Rn(o,n){1&o&&e._UZ(0,"div",21),2&o&&e.Q6J("ngStyle",e.VKq(1,On,"url("+n.ngIf+")"))}function Fn(o,n){if(1&o&&(e.TgZ(0,"span",22),e._uU(1),e.ALo(2,"firstLetter"),e.qZA()),2&o){const t=e.oxw().ngIf;e.xp6(1),e.hij(" ",e.lcZ(2,1,null==t?null:t.nome)," ")}}function Zn(o,n){if(1&o&&(e.TgZ(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4),e.YNc(4,Rn,1,3,"div",5),e.ALo(5,"async"),e.TgZ(6,"span",6),e.YNc(7,Fn,3,3,"span",7),e.qZA()(),e.TgZ(8,"div",8)(9,"div",9),e._uU(10),e.ALo(11,"firstLastNames"),e.qZA(),e.TgZ(12,"span",10),e._UZ(13,"span",11),e._uU(14),e.ALo(15,"truncate"),e.qZA()()(),e.TgZ(16,"div",12)(17,"div",13)(18,"a",14)(19,"span",15),e._UZ(20,"span",16),e.qZA(),e.TgZ(21,"span",17),e._uU(22),e.ALo(23,"translate"),e.qZA()()(),e.TgZ(24,"div",13)(25,"a",18)(26,"span",15),e._UZ(27,"span",16),e.qZA(),e.TgZ(28,"span",17),e._uU(29),e.ALo(30,"translate"),e.qZA()()(),e.TgZ(31,"div",13)(32,"a",19)(33,"span",15),e._UZ(34,"span",16),e.qZA(),e.TgZ(35,"span",17),e._uU(36),e.ALo(37,"translate"),e.qZA()()(),e.TgZ(38,"div",13)(39,"a",20)(40,"span",15),e._UZ(41,"span",16),e.qZA(),e.TgZ(42,"span",17),e._uU(43),e.ALo(44,"translate"),e.qZA()()()()()()),2&o){const t=n.ngIf,i=e.oxw();e.xp6(4),e.Q6J("ngIf",e.lcZ(5,13,(null==t.pic?null:t.pic.resized)&&i.getPic())),e.xp6(3),e.Q6J("ngIf",!(null!=t.pic&&t.pic.resized)),e.xp6(3),e.hij(" ",e.lcZ(11,15,t.nome)," "),e.xp6(3),e.Q6J("inlineSVG","./assets/media/icons/duotune/communication/com011.svg"),e.xp6(1),e.hij(" ",e.xi3(15,17,t.email,30)," "),e.xp6(6),e.Q6J("inlineSVG","./assets/media/icons/duotune/communication/com013.svg"),e.xp6(2),e.Oqu(e.lcZ(23,20,"PROFILE.PERSONAL_INFORMATION.TITLE")),e.xp6(5),e.Q6J("inlineSVG","./assets/media/icons/duotune/coding/cod009.svg"),e.xp6(2),e.hij(" ",e.lcZ(30,22,"PROFILE.CHANGE_PASSWORD.TITLE"),""),e.xp6(5),e.Q6J("inlineSVG","./assets/media/icons/duotune/technology/teh001.svg"),e.xp6(2),e.hij(" ",e.lcZ(37,24,"PROFILE.LAST_ACCESS.TITLE"),""),e.xp6(5),e.Q6J("inlineSVG","./assets/media/icons/duotune/general/gen051.svg"),e.xp6(2),e.hij(" ",e.lcZ(44,26,"PROFILE.SECURITY.TITLE"),"")}}let Un=(()=>{const n=class{constructor(i,s){this.userService=i,this.awss3FileService=s,this.subscriptions=[],this.userChange=new e.vpe,this.user$=this.userService.currentUserSubject.asObservable();const r=this.user$.subscribe(()=>{setTimeout(()=>{this.userChange.emit()},0)});this.subscriptions.push(r)}getPic(){return this.user$.pipe((0,oe.h)(s=>
1null!=s),(0,re.w)(s=>s?.pic?.resized?this.awss3FileService.get(s.pic.resized,this):(0,C.of)(null)))}ngOnDestroy(){this.subscriptions.forEach(i=>i.unsubscribe())}};let o=n;return n.\u0275fac=function(s){return new(s||n)(e.Y36(R.e8),e.Y36(f.lw))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-profile-card"]],outputs:{userChange:"userChange"},decls:2,vars:3,consts:[["class","card mb-5 mb-xl-10",4,"ngIf"],[1,"card","mb-5","mb-xl-10"],[1,"card-body","pt-9"],[1,"d-flex","align-items-center"],[1,"symbol","symbol-60","symbol-xxl-100","me-5","align-self-start","align-self-xxl-center"],["class","symbol-label",3,"ngStyle",4,"ngIf"],[1,"symbol","symbol-lg-35","symbol-25","symbol-light-success"],["class","symbol-label font-size-h1 fw-medium",4,"ngIf"],[1,"d-flex","flex-column"],[1,"fw-bolder","d-flex","align-items-center","fs-5"],[1,"fw-medium","text-muted","text-hover-primary","fs-7"],[1,"svg-icon","svg-icon-4","me-1",3,"inlineSVG"],[1,"menu","menu-column","menu-title-gray-800","menu-rounded","menu-state-bg","menu-arrow-gray-500","mt-5"],[1,"menu-item","fw-medium","mb-1"],["routerLink","/my-profile/personal-information","routerLinkActive","active-menu active",1,"menu-link"],[1,"menu-icon"],["cacheSVG","true",1,"svg-icon","svg-icon-2x",3,"inlineSVG"],[1,"menu-title"],["routerLink","/my-profile/change-password","routerLinkActive","active-menu active",1,"menu-link","without-sub"],["routerLink","/my-profile/active-sessions","routerLinkActive","active-menu active",1,"menu-link","without-sub"],["routerLink","/my-profile/security","routerLinkActive","active-menu active",1,"menu-link","without-sub"],[1,"symbol-label",3,"ngStyle"],[1,"symbol-label","font-size-h1","fw-medium"]],template:function(s,r){1&s&&(e.YNc(0,Zn,45,28,"div",0),e.ALo(1,"async")),2&s&&e.Q6J("ngIf",e.lcZ(1,1,r.user$))},dependencies:[g.O5,g.PC,ee.d$,k.rH,k.Od,w.VJ,w.qQ,w.W7,g.Ov,T.X$],styles:[".active-menu[_ngcontent-%COMP%]{background-color:var(--bs-menu-link-bg-color-active)}"]}),o})();const kn=function(){return["CREATE","UPDATE"]},Nn=[{path:"",component:(()=>{const n=class{constructor(i,s){this.meService=i,this.translateService=s,this.historyChanged=!0,this.transformHistoryValue=(r,a)=>{if(null!=a&&"identificationDoc.docType"===r){const l=Object.keys(I.FM).find(c=>I.FM[c]===a);return l?this.translateService.instant(`PROFILE.PERSONAL_INFORMATION.IDENTIFICATION.DOC_TYPE_${l}`):a}}}ngOnInit(){}getService(){return this.meService}onUserChange(){this.historyChanged=!this.historyChanged}};let o=n;return n.\u0275fac=function(s){return new(s||n)(e.Y36(ie.w),e.Y36(T.sK))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-user-profile"]],decls:7,vars:5,consts:[[1,"d-flex","flex-md-row","flex-column"],[1,"flex-row-auto","w-100","w-md-300px","w-xl-350px","mb-5","p-0"],[3,"userChange"],[1,"flex-row-fluid","ms-lg-8","ms-md-5"],[1,"mt-5"],["context","user","listPermission","verListaHistoricoMeuPerfil","detailsPermission","verDetalhesHistoricoMeuPerfil",3,"service","changed","operations","customTransformValue"]],template:function(s,r){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"app-profile-card",2),e.NdJ("userChange",function(){return r.onUserChange()}),e.qZA()(),e.TgZ(3,"div",3),e._UZ(4,"router-outlet"),e.qZA()(),e.TgZ(5,"div",4),e._UZ(6,"app-log-history",5),e.qZA()),2&s&&(e.xp6(6),e.Q6J("service",r.getService())("changed",r.historyChanged)("operations",e.DdM(4,kn))("customTransformValue",r.transformHistoryValue))},dependencies:[k.lC,Ln,Un]}),o})(),children:[{path:"personal-information",component:Ci},{path:"change-password",component:jt},{path:"active-sessions",component:ai},{path:"security",component:zi},{path:"",redirectTo:"personal-information",pathMatch:"full"},{path:"**",redirectTo:"personal-information",pathMatch:"full"}]}];let Mn=(()=>{const n=class{};let o=n;return n.\u0275fac=function(s){return new(s||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[k.Bz.forChild(Nn),k.Bz]}),o})(),Hn=(()=>{const n=class{};let o=n;return n.\u0275fac=function(s){return new(s||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({providers:[ie.w],imports:[w.Dt,g.ez,ut.JF,ve.fA,v.u5,v.UX,ee.vi,Mn,O.XC,O.HK,f.qw,Tt,Me,U.Xd,L.TU,te.VI,Ve,qt,Gt,L.CO]}),o})()}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.