import{a as H}from"./chunk-4INOPVVZ.js";import{b as B}from"./chunk-CYRQZGFX.js";import{e as V}from"./chunk-RBSSJWML.js";import"./chunk-MFZ3EXVF.js";import"./chunk-R6MVWAVG.js";import"./chunk-SDHD5Z3H.js";import"./chunk-ZDEKLPKE.js";import"./chunk-VQU52MNH.js";import"./chunk-MXSLISEG.js";import"./chunk-JNXLVPIF.js";import"./chunk-PWALQELY.js";import"./chunk-3GSDFESG.js";import"./chunk-7QEXVS2A.js";import"./chunk-FSCI3FDB.js";import"./chunk-D4RZOGGF.js";import"./chunk-PMJFQIXL.js";import"./chunk-MNVOJIXC.js";import"./chunk-IMWNGRKR.js";import"./chunk-5WJM4RWS.js";import"./chunk-UZB7YFT6.js";import{a as Y}from"./chunk-HXEFMD5A.js";import"./chunk-KCLQIV7M.js";import"./chunk-5KCUTXXV.js";import"./chunk-C7NDY7PV.js";import"./chunk-JUDWAYYT.js";import"./chunk-WFZJP5WR.js";import"./chunk-F6KLNSUK.js";import{b as G,c as $,d as q}from"./chunk-YOJ4KGSB.js";import"./chunk-I6FSQTEP.js";import"./chunk-CO3X7TQN.js";import{a as F}from"./chunk-VSFNMVXJ.js";import"./chunk-WQ6DP4JQ.js";import{J as _,Kb as W,Ob as U,a as ee,c as n,d as I,h as E,j as C,l as D,o as T,wb as j}from"./chunk-YSQLW2JA.js";import{gb as L,hc as A}from"./chunk-NVJ2ZZFT.js";import{Dc as r,Fb as h,Ng as O,Pd as w,Qf as z,Te as S,Vc as y,_a as x,ab as b,bb as g,bh as M,cd as k,dd as v,eh as N,g as Z,gb as u,gg as d,hd as p,hg as P,jg as R,wa as m,ya as f}from"./chunk-SKPDQO4E.js";var J=`<!-- REPORT VIEW -->
<ng-container *ngIf="reportMode">
  <div class="h-100">
    <side-navigation #sideNavigation>
      <ng-template side-navigation-nav>
        <div>
          <div class="row">
            <div class="col-12" *ngIf="permissionSearchIdentity">
              <label class="report-form-label">{{'REPORT.PACS_COL_USER' | translate}}</label>
              <armon-select-search query="identity" [allowMulti]="false" [(ngModel)]="filter.userId"
                (onSelectedChanged)="onIdentitySelected($event)">
              </armon-select-search>
            </div>
            <div class="col-12">
              <label class="report-form-label">{{'REPORT.WORKING_STATUS' | translate}}</label>
              <nz-select class="w-100" [(ngModel)]="filter.workStatusFilter" nzSize="small" nzMode="multiple"
                nzPlaceHolder="{{'COMMON.ALL'|translate}}" (ngModelChange)="onWorkStatusChanged($event)">
                <nz-option *ngFor="let userWorkingStatus of userWorkingStatusList" [nzValue]="userWorkingStatus.type"
                  [nzLabel]="userWorkingStatus.description |
                    translate"></nz-option>
              </nz-select>
              <label class="report-checkbox-label my-2" nz-checkbox [(ngModel)]="filter.onlyWorkingDays"
                (ngModelChange)="onWorkStatusChanged($event)">{{'REPORT.PACS_ENTRY_EXIT_USER_ONLY_WORK_DAYS' |
                translate}}</label>
            </div>
            <div class="col-12 d-flex justify-content-center">
              <button class="btn btn-success btn-sm" [disabled]="!records || records.length==0"
                (click)="onGetExcelClicked($event)">{{'BUTTON.EXCEL' | translate}}</button>
            </div>
          </div>
          <div class="row">
            <div class="col-12 mt-3">
              <label class="report-form-label">{{'PACS.USERS_LIST' | translate}}</label>
            </div>
            <div class="col-12 mt-2">
              <armon-identity-filter [enableDetailSearch]="false" [enableIdentitySelection]="true"
                (identitySelected)="onListIdentitySelected($event)"></armon-identity-filter>
            </div>
          </div>
        </div>
      </ng-template>
      <ng-template side-navigation-content>
        <ng-template *ngTemplateOutlet="dataTableTemplate">
        </ng-template>
      </ng-template>
    </side-navigation>
  </div>
</ng-container>

<!-- SELF VIEW -->
<ng-container *ngIf="!reportMode">
  <div class="row justify-content-center">
    <div class="col-xl-9 col-lg-12">
      <div class="row">
        <div class="col-12">
          <ng-template *ngTemplateOutlet="dataTableTemplate">
          </ng-template>
        </div>
      </div>
    </div>
  </div>
</ng-container>

<ng-template #dataTableTemplate>
  <div class="report-data-container">
    <div class="row report-filter-container">
      <div class="col-12">
        <div class="row">
          <div class="col-12">
            <ng-container *ngIf="reportMode">
              <armon-report-template-panel [reportType]="reportTemplateType" [templateId]="reportTemplateId"
                [saveEnabled]="selectedIdentity" class="d-none d-md-block" [filter]="request"
                (templateLoaded)="onTemplateLoaded($event)">
              </armon-report-template-panel>
            </ng-container>
            <armon-date-picker [options]="datePickerOptions" (selectionChanged)="onDateSelectionChanged($event)">
            </armon-date-picker>
          </div>
        </div>
      </div>
      <div class="col-12">
        <div class="row">
          <div class="col-12">
            <armon-sorting-picker #sortingPicker [data]="sortingPickerData"
              (selectionChanged)="onSortingSelectionChanged($event)">
            </armon-sorting-picker>
          </div>
        </div>
      </div>
      <div class="col-12">
        <div class="row mt-5" *ngIf="!selectedIdentity">
          <div class="col-12">
            <nz-empty [nzNotFoundContent]="contentTpl" [nzNotFoundImage]="'./assets/images/empty/search_user.png'">
              <ng-template #contentTpl>
                <span> {{'REPORT.PACS_SUMMARY_EMPLOYEE_USER_INFO'|translate}}</span>
              </ng-template>
            </nz-empty>
          </div>
        </div>
      </div>
      <div class="col-12 mb-3 mt-2" *ngIf="selectedIdentity && summary">
        <armon-report-entry-exit-user-range-summary [userCaptions]="userCaption" [summary]="summary">
        </armon-report-entry-exit-user-range-summary>
      </div>
    </div>
    <div class="row report-data-table-container" id="report-data-table-container" [ngClass]="{'h-auto': !reportMode}">
      <div class="col-12">
        <ng-container *ngFor="let record of records">
          <armon-report-pacs-daily-user [record]="record" [day]="record.day" [viewMode]="2">
          </armon-report-pacs-daily-user>
        </ng-container>
      </div>
      <div class="col-12 mb-3 mt-3" *ngIf="records">
        <armon-pagination [paginationResponse]="paginationResponse" [scrollDomId]="'report-data-table-container'"
          (pageChanged)="pageChanged($event)"></armon-pagination>
      </div>
    </div>
  </div>
</ng-template>`;var K=`.justify-content-center{-webkit-box-pack:center;-moz-box-pack:center;-webkit-flex-pack:center;-ms-flex-pack:center;-moz-justify-content:center;-webkit-justify-content:center;justify-content:center}.justify-content-flex-end{-webkit-box-pack:end;-moz-box-pack:end;-webkit-flex-pack:end;-ms-flex-pack:end;-moz-justify-content:flex-end;-webkit-justify-content:flex-end;justify-content:flex-end}.card-footer{padding:.28rem .7rem}.alert{font-size:.756rem}@media screen and (min-width: 992px){.modal-xxl{max-width:1640px}}@media screen and (min-width: 1200px){.modal-xxxl{max-width:1860px}}.modal-fs{max-width:none;position:absolute;margin:auto;inset:16px;height:100vh;display:flex}.btn-link{text-decoration:none}.btn-link:hover{text-decoration:underline}.invalid-feedback{margin-top:0!important;font-size:.672rem!important}.filterArea{background:#fff;border:1px solid rgb(235,235,235);padding:12px;border-radius:4px;box-shadow:0 3px 6px #ebebeb;-moz-transition:width .25s ease;-webkit-transition:width .25s ease;-o-transition:width .25s ease;transition:width .25s ease}.filterArea>div:first-child>p:first-child{margin-top:0}.filterSummary>p:first-child{margin-top:0}.filterContent>div{margin-bottom:12px}.filterContent clr-checkbox{margin-top:12px}.filterButtons{margin-top:12px}.filterSmallButtons>button:last-child{margin-right:0!important}.filterMoreInfo p{margin-top:0}.filterMoreInfo div{margin-bottom:8px}.filterMoreInfo div:last-child{margin-bottom:0}.resultArea{position:relative}.resultDisabled{position:absolute;width:100%;height:100%;background:linear-gradient(to top,#f3f4f6,transparent 150%)}.required:after{content:"*";font-size:1.1em;color:#c92100;margin-left:6px}.report-data-container{height:100%;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.report-data-container .report-filter-container{margin-bottom:.2rem}.report-data-container .report-data-table-container{overflow-y:auto;overflow-x:hidden;-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1;height:0;display:block}.report-multi-data-cell{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column;line-height:initial!important}.report-multi-data-cell .title-text{font-size:1.008rem}.report-multi-data-cell .main-text{font-size:.84rem}.report-multi-data-cell .sub-text{font-size:.672rem;color:#aaa}.report-form-label{font-size:.672rem;line-height:.84rem;font-weight:500;margin-top:.3rem;margin-bottom:.1rem!important}.report-form-label label{margin-bottom:0!important}.report-form-icon{position:absolute;color:#0a2a5a;right:15px;bottom:6px;cursor:pointer}.report-checkbox-label{font-size:.672rem}:host .status-data-td{padding:3px 0}:host .status-color-permission{color:#4c2aa8}:host .status-main-permission{padding:3px 6px;background-color:#edeaf6;color:#4c2aa8;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem}:host .status-data-cell{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:stretch;-ms-flex-align:stretch;-webkit-align-items:stretch;-moz-align-items:stretch;align-items:stretch}:host .status-data-cell .status-color-container{width:6px;margin-right:6px;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem}:host .status-data-cell .status-text-area{padding:6px 0;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-pack:center;-moz-box-pack:center;-webkit-flex-pack:center;-ms-flex-pack:center;-moz-justify-content:center;-webkit-justify-content:center;justify-content:center;min-height:36px}:host .status-data-cell .status-text-area .status-main-text{font-size:.672rem;line-height:.7rem;font-weight:500}:host .status-data-cell .status-text-area .status-sub-text{font-size:.588rem;line-height:.6rem}:host .status-data-cell .permission-text-area{padding:6px 12px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-flex-grow:0;-webkit-box-flex:0;-moz-flex-grow:0;-ms-flex-positive:0;flex-grow:0;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center;-webkit-border-v-left-radius:.375rem;-moz-border-radius-bottomleft:.375rem;border-bottom-left-radius:.375rem;-webkit-border-top-left-radius:.375rem;-moz-border-radius-topleft:.375rem;border-top-left-radius:.375rem;border-right:2px solid rgb(76,42,168);min-height:36px;background-color:#f8f6fc}:host .status-data-cell .permission-text-area .permission-main-text{font-size:.672rem;line-height:.7rem;font-weight:500}:host .status-data-cell .permission-text-area .permission-sub-text{font-size:.588rem;line-height:.6rem}:host .entry-exit-data-cell{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:center;-moz-box-pack:center;-webkit-flex-pack:center;-ms-flex-pack:center;-moz-justify-content:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}:host .entry-exit-data-cell .enter-container{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:end;-ms-flex-align:end;-webkit-align-items:flex-end;-moz-align-items:flex-end;align-items:flex-end;width:50%}:host .entry-exit-data-cell .exit-container{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column;width:50%}:host .entry-exit-data-cell .entry-exit-main-text,:host .entry-exit-data-cell .entry-exit-hour-text{font-size:.672rem;line-height:.6rem;color:#aaa}:host .entry-exit-data-cell .entry-exit-hour-text{font-weight:500;color:#000}:host .entry-exit-data-cell .entry-exit-expected-text{font-size:.588rem;line-height:.5rem;color:#aaa;padding-top:6px}:host .entry-exit-warning-cell{font-size:.588rem;line-height:.5rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center;-webkit-box-pack:center;-moz-box-pack:center;-webkit-flex-pack:center;-ms-flex-pack:center;-moz-justify-content:center;-webkit-justify-content:center;justify-content:center}:host .summary-data{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;height:100%;margin-top:3px;padding:6px 3px 3px;border:1px solid #ced4de;background-color:#f5f6f8}:host .summary-data.clickable{cursor:pointer}:host .summary-data.clickable:hover{background-color:#dde1e8}:host .summary-data .summary-count{font-size:.924rem;line-height:.75rem;color:#0a2a5a;margin-bottom:3px;font-weight:500}:host .summary-data .summary-label{text-align:center;font-size:.38rem;line-height:.44rem;color:#666}
`;var Q=Z(ee());var oe=function(c,e,t,o){var a=arguments.length,i=a<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(c,e,t,o);else for(var l=c.length-1;l>=0;l--)(s=c[l])&&(i=(a<3?s(i):a>3?s(e,t,i):s(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i},X=class{interactionService;pacsService;authService;reportService;sessionService;translate;route;filter;selectedIdentity=null;userCaption;records;reportMode=!0;permissionSearchIdentity;reportTemplateType=I.PACSWorkingDetailForSingleEmployee;reportTemplateId;paginationResponse=new O;datePickerOptions=new P;sideNavigation;sortingPicker;sortingPickerData;selectedSortingPickerEvent;userWorkingStatusList=B;summary;constructor(e,t,o,a,i,s,l){this.interactionService=e,this.pacsService=t,this.authService=o,this.reportService=a,this.sessionService=i,this.translate=s,this.route=l,this.permissionSearchIdentity=this.authService.checkPermission(p.IDENTITY.getReadBasic())}ngOnInit(){this.reportMode=this.authService.checkPermission(p.ATTENDANCECONTROL.getReport()),this.datePickerOptions.items=[{type:d.LastMonth,selected:!0},{type:d.Last3Months},{type:d.Custom}];let e=R.getDateSelection(this.datePickerOptions.items[0]);this.filter=A.getEmptyModel(),this.setDateSelection(e),this.sortingPickerData=this.pacsService.getDefaultSortingEmployeePickerData(),this.selectedSortingPickerEvent={value:this.sortingPickerData.items[0].value,direction:y.DESC},this.setSortingPickerEvent(),this.route.queryParams.subscribe(t=>{t&&t[n.UserId]&&t[n.UserId]!=""&&(this.filter.userId=t[n.UserId])})}ngAfterViewInit(){this.reportMode==!1&&(this.filter.userId=this.sessionService.currentUserId,this.selectedIdentity=new L,this.selectedIdentity.id=this.sessionService.currentUserId,this.getReportData()),this.route.queryParams.subscribe(e=>{e&&e[n.ReportTemplateId]&&e[n.ReportTemplateId]!=""&&(this.reportTemplateId=e[n.ReportTemplateId])})}ngOnDestroy(){}setSortingPickerEvent(){this.filter.sortType=this.selectedSortingPickerEvent.value,this.filter.sortOrder=this.selectedSortingPickerEvent.direction}setDateSelection(e){this.filter.dateRange.startDateTime=r.fromJSDate(e.startDate).toFormat("yyyy-MM-dd"),this.filter.dateRange.endDateTime=r.fromJSDate(e.endDate).toFormat("yyyy-MM-dd")}onIdentitySelected(e){this.userCaption=null,this.selectedIdentity=e.data,this.sideNavigation&&this.sideNavigation.hideLeftClicked(),this.filter.userId=this.selectedIdentity.id,this.getReportData()}onGetExcelClicked(e){this.selectedIdentity&&this.reportService.exportPacsWorkingDetailEmployeeExcel(this.filter).subscribe(t=>{this.translate.get(["PAGES.REPORT_PACS_EMPLOYEE_DETAILED"]).subscribe(o=>{Q.default.saveAs(t,o["PAGES.REPORT_PACS_EMPLOYEE_DETAILED"]+" "+this.selectedIdentity.fullname+" "+r.fromISO(this.filter.dateRange.startDateTime).toLocaleString(r.DATE_HUGE)+" - "+r.fromISO(this.filter.dateRange.endDateTime).toLocaleString(r.DATE_HUGE)+".xlsx")})})}getReportData(e=!0){this.selectedIdentity&&(e&&(this.filter.paginationRequest.skip=0),this.reportService.getPacsWorkingDetailEmployee(this.filter).subscribe(t=>{this.records=t.items,this.userCaption=t.userCaption,this.summary=t.summary,this.paginationResponse=t.paginationResponse}))}pageChanged(e){this.filter.paginationRequest.skip=e.skip,this.getReportData(!1)}onDateSelectionChanged(e){this.setDateSelection(e),this.getReportData()}onSortingSelectionChanged(e){this.selectedSortingPickerEvent=e,this.setSortingPickerEvent(),this.getReportData()}onListIdentitySelected(e){this.userCaption=null,this.selectedIdentity=e,this.sideNavigation&&this.sideNavigation.hideLeftClicked(),this.filter.userId=this.selectedIdentity.id,this.getReportData()}onWorkStatusChanged(e){this.selectedIdentity&&(this.sideNavigation.hideLeftClicked(),this.getReportData())}onTemplateLoaded(e){e.filter&&(this.filter.onlyWorkingDays=e.filter.onlyWorkingDays?e.filter.onlyWorkingDays:!1,this.filter.workStatusFilter=e.filter.workStatusFilter?e.filter.workStatusFilter:[],this.filter.userId=e.filter.userId?e.filter.userId:null,this.sortingPicker&&e.filter.sortOrder&&e.filter.sortType&&(this.filter.sortOrder=e.filter.sortOrder,this.filter.sortType=e.filter.sortType,this.sortingPicker.setSelection(e.filter.sortType,e.filter.sortOrder))),this.getReportData()}static ctorParameters=()=>[{type:z},{type:C},{type:U},{type:_},{type:w},{type:k},{type:h}];static propDecorators={sideNavigation:[{type:m,args:["sideNavigation"]}],sortingPicker:[{type:m,args:["sortingPicker"]}]}};X=oe([f({selector:"armon-report-pacs-employee",template:J,standalone:!0,imports:[g,q,G,j,S,N,b,T,Y,$,u,W,D,E,M,H,x,V,F,v],styles:[K]})],X);export{X as ReportPacsEmployeeComponent};
