import{e as b}from"./chunk-RBSSJWML.js";import{c as h}from"./chunk-SDHD5Z3H.js";import{Ob as x,tb as v}from"./chunk-YSQLW2JA.js";import{Aa as r,Rd as u,Sd as y,ab as m,bb as p,dd as f,hd as l,ya as c}from"./chunk-SKPDQO4E.js";var k=`<ng-container *ngIf="visibleComponent">
  <div class="modal-header">
    <div class="d-flex flex-grow-1">
      <div class="d-flex flex-column">
        <span class="text-lg">{{dayText}} {{dayWeekdayText}}</span>
        <span class="text-md">{{dayYearText}}</span>
      </div>
      <div class="d-flex align-items-center ms-auto" *ngIf="visibleAddPPermissionButton">
        <!-- added to armon-report-pacs-daily-user -->
        <!-- <button class="btn btn-outline-primary btn-sm"
          (click)="onAddPPermissionClicked($event)">{{'PACS.ADD_USER_PPERMISSION' | translate}}</button> -->
      </div>
    </div>
  </div>
  <div class="modal-body">
    <div class="row mb-3" *ngIf="workingHours && workingHours.length > 0">
      <div class="col-12 d-flex flex-column">
        <ng-container *ngFor="let workingHour of workingHours">
          <span class="text-md">{{workingHour.workPlanName}}</span>
          <span class="text-sm">
            <div class="workplan-dot me-1"></div>{{workingHour.startDateText}} - {{workingHour.endDateText}}
          </span>
        </ng-container>
      </div>
    </div>
    <div class="row" *ngIf="dailyRecord">
      <div class="col-12">
        <armon-report-pacs-daily-user [record]="dailyRecord" [day]="dailyRecord.day" [showDetail]="true"
          [disabled]="true" (routingStarted)="onCancelClicked($event)">
        </armon-report-pacs-daily-user>
      </div>
    </div>
    <div class="row" *ngIf="!dailyRecord">
      <div class="col-12">
        <div class="alert alert-info text-center" role="alert">
          {{'PACS.DIRECTION_NO_TIMELINE_DAY' | translate}}
        </div>
      </div>
    </div>
  </div>
  <div class="modal-footer">
    <button class="btn btn-outline-primary" (click)="onCancelClicked($event)">{{'BUTTON.CLOSE' | translate}}</button>
  </div>
</ng-container>`;var g=`.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}.workplan-dot{display:inline-block;width:8px;height:8px;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;background-color:#d6d67f}
`;var I=function(a,e,o,i){var n=arguments.length,t=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(a,e,o,i);else for(var d=a.length-1;d>=0;d--)(s=a[d])&&(t=(n<3?s(t):n>3?s(e,o,t):s(e,o))||t);return n>3&&t&&Object.defineProperty(e,o,t),t},w=class extends y{authService;socialAreaService;modalService;userId;dayDateTime;dailyRecord;workingHours;visibleComponent=!1;visibleAddPPermissionButton=!1;dayText;dayWeekdayText;dayYearText;constructor(e,o,i){super(),this.authService=e,this.socialAreaService=o,this.modalService=i}onModalInitialized(){super.onModalInitialized(),this.dayText=this.dayDateTime.toFormat("d MMMM"),this.dayWeekdayText=this.dayDateTime.toFormat("EEEE"),this.dayYearText=this.dayDateTime.toFormat("yyyy"),this.visibleAddPPermissionButton=this.authService.checkPermission(l.PPERMISSION.getHRApprovement())||this.authService.checkPermission(l.PPERMISSION.getWrite()),this.visibleComponent=!0}onAddPPermissionClicked(){this.modalService.open(h,{settings:{size:"xl",scrollable:!0,centered:!1,escape:!1,click:!1},props:{userId:this.userId,selectedStartDay:this.dayDateTime.toFormat("YYYY-MM-DD")}}).result.then(e=>{}).catch(e=>{})}static ctorParameters=()=>[{type:x},{type:v},{type:u}];static propDecorators={userId:[{type:r}],dayDateTime:[{type:r}],dailyRecord:[{type:r}],workingHours:[{type:r}]}};w=I([c({selector:"armon-report-pacs-daliy-user-modal",template:k,standalone:!0,imports:[p,m,b,f],styles:[g]})],w);export{w as a};
