import{a as xe}from"./chunk-EUEKUKCS.js";import{a as b,b as F}from"./chunk-SLQSOQUB.js";import{a as pe}from"./chunk-D4RZOGGF.js";import{a as ue}from"./chunk-JUDWAYYT.js";import{b as de,c as me,d as fe}from"./chunk-YOJ4KGSB.js";import"./chunk-CO3X7TQN.js";import{a as ce}from"./chunk-VSFNMVXJ.js";import"./chunk-WQ6DP4JQ.js";import{k as I,wb as _}from"./chunk-YSQLW2JA.js";import{oc as ne,pc as oe,qc as ae,sc as re,tc as le,uc as se}from"./chunk-NVJ2ZZFT.js";import{Aa as f,Ba as D,Dc as u,E as h,G as W,He as m,Id as O,Pd as te,Qd as k,Qf as C,Rd as N,Sc as X,Sd as S,Se as U,Tb as G,Te as g,Uc as w,Ue as L,Ve as R,Wb as y,Wc as v,Xc as Z,Ye as T,Yg as ie,_a as M,ab as x,ad as ee,af as z,bb as c,bh as j,dd as p,ea as J,gb as P,ha as E,jb as K,l as Y,rb as Q,ya as s}from"./chunk-SKPDQO4E.js";var ge=`<div class="h-100">
    <side-navigation *ngIf="visibleComponent">
        <ng-template side-navigation-nav>
            <div class="col-12 mb-2">
                <label class="report-form-label">{{'PACS.AUTOSHIFT_RULESET_NAME' | translate}}</label>
                <armon-search-text-input [(ngModel)]="request.filter.name" [maxLength]="20" [minLength]="3"
                    (ngModelChange)="onFilterUpdated($event)" placeholder="COMMON.SEARCH"></armon-search-text-input>
            </div>
            <div class="col-12 mb-2">
                <label class="report-form-label">{{'REPORT.REGIONS' | translate}}</label>
                <armon-select-search query="region" [allowMulti]="true" [(ngModel)]="request.filter.regionIds"
                    (ngModelChange)="onFilterUpdated($event)">
                </armon-select-search>
            </div>
            <div class="col-12 mb-2">
                <label class="report-form-label">{{'REPORT.USER_GROUPS' | translate :
                    languageService.userTranslate}}</label>
                <armon-select-search query="group" [allowMulti]="true" [(ngModel)]="request.filter.groupIds"
                    (ngModelChange)="onFilterUpdated($event)">
                </armon-select-search>
            </div>
            <div class="col-12 mb-2 pos-relative">
                <label class="report-form-label">{{'PACS.AUTOSHIFT_RULESET_APPLY_RANGE' | translate}}</label>
                <input placeholder="{{'DATEPICKER.LABEL_CUSTOM'|translate}}" type="text" readonly owlinput
                    class="form-control form-control-sm bg-white" [(ngModel)]="filterDateRange" [selectMode]="'range'"
                    (ngModelChange)="onFilterUpdated($event)" [owlDateTimeTrigger]="dtRange1" [owlDateTime]="dtRange1">
                <owl-date-time [firstDayOfWeek]="1" #dtRange1 [pickerType]="'calendar'"></owl-date-time>
                <cds-icon shape="times-circle" solid class="cds-icon-18 report-form-icon" *ngIf="filterDateRange!=null"
                    title="{{'BUTTON.CLEAR'|translate}}" click-stop-propagation
                    (click)="filterDateRange=null; onFilterUpdated($event)"></cds-icon>
            </div>
        </ng-template>
        <ng-template side-navigation-content>
            <div class="row my-3">
                <div class="col-12">
                    <button class="btn btn-sm btn-primary"
                        (click)="addRuleset($event)">{{'PACS.AUTOSHIFT_ADD_RULESET'|translate}}</button>
                </div>
            </div>
            <ng-container *ngIf="rulesets && rulesets.length>0">
                <div class="row" [@listAnimation]="rulesets.length">
                    <armon-pacs-auto-shift-list-item class="col-12 col-md-6" *ngFor="let ruleset of rulesets"
                        [ruleset]="ruleset" (onUpdated)="onUpdated($event)">
                    </armon-pacs-auto-shift-list-item>
                </div>
            </ng-container>
            <div class="row pt-5" *ngIf="rulesets && rulesets.length==0">
                <div class="col-12">
                    <nz-empty [nzNotFoundContent]="contentTpl"
                        [nzNotFoundImage]="'./assets/images/empty/empty_list.png'">
                        <ng-template #contentTpl>
                            <span>{{'COMMON.NO_DATA'|translate}}</span>
                        </ng-template>
                    </nz-empty>
                </div>
            </div>
            <div class="row my-2">
                <div class="col-12">
                    <armon-pagination [paginationResponse]="paginationResponse" (pageChanged)="pageChanged($event)">
                    </armon-pagination>
                </div>
            </div>
        </ng-template>
    </side-navigation>
</div>`;var be="";var q=class extends Z{http;sessionService;configurationService;interactionService;constructor(e,t,i,o){super(e,t,i,o),this.http=e,this.sessionService=t,this.configurationService=i,this.interactionService=o}getRulesetList(e){return this.requestPost(`/${this.sessionService.currentOrganizationId}/autoshift`,e,"AutoShiftRulesetListResponse",w.Pacs,v.Pacs)}upsertRuleset(e,t){return this.requestPost(`/${this.sessionService.currentOrganizationId}/autoshift/${e}`,t,null,w.Pacs,v.Pacs)}upsertRulesetRules(e,t){return this.requestPost(`/${this.sessionService.currentOrganizationId}/autoshift/${e}/rule-upsert`,t,null,w.Pacs,v.Pacs)}deleteRuleset(e){return this.requestDelete(`/${this.sessionService.currentOrganizationId}/autoshift/${e}`,"",w.Pacs,v.Pacs)}applyRuleset(e,t){return this.requestPost(`/${this.sessionService.currentOrganizationId}/autoshift/${e}/recalculate`,t,null,w.Pacs,v.Pacs)}};var Ee=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(n=(o<3?a(n):o>3?a(e,t,n):a(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},d=class extends X{http;configurationService;interactionService;sessionService;api;constructor(e,t,i,o){super(i,o),this.http=e,this.configurationService=t,this.interactionService=i,this.sessionService=o,this.api=new q(this.http,this.sessionService,this.configurationService,this.interactionService)}getRulesetList(e){return this.api.getRulesetList(e).pipe(h(t=>this.handleError(t,[])))}upsertRuleset(e,t){return this.api.upsertRuleset(e,t).pipe(h(i=>this.handleError(i,[])))}upsertRulesetRules(e,t){return this.api.upsertRulesetRules(e,t).pipe(h(i=>this.handleError(i,[])))}deleteRuleset(e){return this.api.deleteRuleset(e).pipe(h(t=>this.handleError(t,[])))}applyRuleset(e,t){return this.api.applyRuleset(e,t).pipe(h(i=>this.handleError(i,[])))}static ctorParameters=()=>[{type:Q},{type:ee},{type:C},{type:te}]};d=Ee([J({providedIn:"root"})],d);var he=`<ng-container>
  <div class="modal-header">
    <span class="text-lg">{{(editMode?'PACS.AUTOSHIFT_EDIT_RULESET':'PACS.AUTOSHIFT_ADD_RULESET')|translate}}</span>
  </div>
  <div class="modal-body">
    <form [formGroup]="form">
      <div class="form-group form-layout mb-3">
        <label for="name-input">{{'USERGROUP.NAME' | translate}}</label>
        <input type="text" id="name-input" formControlName="name" maxlength="255" class="form-control form-control-sm"
          [ngClass]="{'is-invalid': form.get('name').touched && form.get('name').invalid}">
        <ng-template
          *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('name')}">
        </ng-template>
      </div>
      <div class="form-group form-layout mb-3">
        <label for="group-input">{{'REPORT.USER_GROUPS'|translate: languageService.userTranslate}}</label>
        <armon-select-search query="group" [formControl]="form.get('groupIds')" [allowMulti]="true"
          [invalid]="form.get('groupIds').invalid">
        </armon-select-search>
        <ng-template
          *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('groupIds')}">
        </ng-template>
      </div>
      <div class="form-group form-layout mb-3">
        <label for="region-input">{{'REPORT.REGIONS'|translate}}</label>
        <armon-select-search query="region" [formControl]="form.get('regionIds')" [allowMulti]="true"
          [invalid]="form.get('regionIds').invalid">
        </armon-select-search>
        <ng-template
          *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('regionIds')}">
        </ng-template>
      </div>
      <div class="row">
        <div class="col-md-6 col-12 mb-3">
          <label>{{'PACS.START_DATE'|translate}}</label>
          <input [formControl]="form.get('startDateTime')" type="text" readonly owlinput
            class="form-control form-control-sm bg-white" [owlDateTime]="startDt" [owlDateTimeTrigger]="startDt">
          <owl-date-time [firstDayOfWeek]="1" #startDt></owl-date-time>
          <ng-template
            *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('startDateTime')}">
          </ng-template>
        </div>
        <div class="col-md-6 col-12 mb-3 pos-relative">
          <label>{{'PACS.END_DATE'|translate}}</label>
          <input [formControl]="form.get('endDateTime')" type="text" readonly owlinput
            class="form-control form-control-sm bg-white" [owlDateTime]="endDt" [owlDateTimeTrigger]="endDt"
            [min]="form.get('startDateTime').value">
          <owl-date-time [firstDayOfWeek]="1" #endDt [showSecondsTimer]="true"></owl-date-time>
          <cds-icon shape="times-circle" solid class="cds-icon-18 report-form-icon"
            *ngIf="form.get('endDateTime').value!=null" title="{{'BUTTON.CLEAR'|translate}}" click-stop-propagation
            (click)="form.get('endDateTime').setValue(null); onFilterUpdated($event)"></cds-icon>
          <ng-template
            *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('endDateTime')}">
          </ng-template>
        </div>
      </div>
      <div class="form-group form-layout mb-3">
        <div class="form-check">
          <input class="form-check-input" id="supportMobileCheckinInput" type="checkbox"
            [formControl]="form.get('supportMobileCheckin')" name="supportMobileCheckin">
          <label class="form-check-label" for="supportMobileCheckinInput">
            <span>{{'PACS.AUTOSHIFT_MOBILE_CHECK_IN_ALLOW' | translate}}</span>
          </label>
        </div>
      </div>
      <div class="form-group form-layout mb-3">
        <div class="form-check">
          <input class="form-check-input" id="useOnlyFirstAccessInput" type="checkbox"
            [formControl]="form.get('useOnlyFirstAccess')" name="useOnlyFirstAccess">
          <label class="form-check-label" for="useOnlyFirstAccessInput">
            <span>{{'PACS.AUTOSHIFT_USE_ONLY_FIRST_ACCESS' | translate}}</span>
          </label>
        </div>
      </div>
      <div class="form-group form-layout mb-3">
        <div class="form-check">
          <input class="form-check-input" id="supportManualLogInput" type="checkbox"
            [formControl]="form.get('supportManualLog')" name="supportManualLog">
          <label class="form-check-label" for="supportManualLogInput">
            <span>{{'PACS.AUTOSHIFT_MANUAL_LOG' | translate}}</span>
          </label>
        </div>
      </div>
    </form>
  </div>

  <div class="modal-footer">
    <button class="btn btn-outline-primary" (click)="onCancelClicked($event)">{{'BUTTON.CANCEL' | translate}}</button>
    <button class="btn btn-primary" [disabled]="form.invalid" (click)="onSaveClicked($event)">{{'BUTTON.SAVE' |
      translate}}</button>
  </div>
</ng-container>

<!-- FORM FIELD VALIDATION -->
<ng-template #controlValidationTemplate let-form let-control="control">
  <ng-container *ngIf="control.errors">
    <div class="invalid-feedback d-flex flex-column" style="display: initial;">
      <span *ngIf="control.errors.required">{{'VALIDATION.REQUIRED'|translate}}</span>
      <span *ngIf="control.errors.numeric">{{'VALIDATION.POSITIVE_NUMBER'|translate}}</span>
      <span *ngIf="control.errors.max">{{'VALIDATION.MAX_VALUE'|translate:control.errors.max}}</span>
      <span *ngIf="control.errors.maxlength">{{'VALIDATION.MAX_LENGTH'|translate: {
        max:control.errors.maxlength.requiredLength} }}</span>
      <span *ngIf="control.errors.min">{{'VALIDATION.MIN_VALUE'|translate:control.errors.min}}</span>
      <span *ngIf="control.errors.minlength">{{'VALIDATION.MIN_LENGTH'|translate: {
        min:control.errors.minlength.requiredLength} }}</span>
    </div>
  </ng-container>
</ng-template>`;var ye=`.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}
`;var Me=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(n=(o<3?a(n):o>3?a(e,t,n):a(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},A=class extends S{formBuilder;autoShiftService;languageService;ruleset;editMode=!1;form;constructor(e,t,i){super(),this.formBuilder=e,this.autoShiftService=t,this.languageService=i}onModalInitialized(){super.onModalInitialized(),this.initializeForms(),this.setRulesetData()}initializeForms(){this.form=this.formBuilder.group({name:[this.ruleset?.name||null,m.required],regionIds:[this.ruleset?.regions?this.ruleset.regions.map(e=>e.id):null,m.required],groupIds:[this.ruleset?.groups?this.ruleset.groups.map(e=>e.id):null,m.required],supportMobileCheckin:[y(this.ruleset?.supportMobileCheckin)?!1:this.ruleset.supportMobileCheckin,m.required],supportManualLog:[y(this.ruleset?.supportManualLog)?!1:this.ruleset.supportManualLog,m.required],useOnlyFirstAccess:[y(this.ruleset?.useOnlyFirstAccess)?!0:this.ruleset.useOnlyFirstAccess,m.required],startDateTime:[this.ruleset?.startDateTime?this.ruleset.startDateTime:u.now().startOf("day").toJSDate(),m.required],endDateTime:[this.ruleset?.endDateTime?this.ruleset?.endDateTime:null]})}setRulesetData(){this.ruleset?this.editMode=!0:this.editMode=!1}onSaveClicked(e){let t=re.getEmptyModel(),i;this.editMode?i=this.ruleset.id:i=O(),Object.assign(t,this.form.value),this.autoShiftService.upsertRuleset(i,t).subscribe(o=>{this.closeModal(o)})}static ctorParameters=()=>[{type:U},{type:d},{type:z}];static propDecorators={ruleset:[{type:f}]}};A=Me([s({selector:"armon-pacs-auto-shift-ruleset-modal",template:he,standalone:!0,providers:[{provide:R,useClass:I}],imports:[g,L,M,P,_,T,c,k,p],styles:[ye]})],A);var we=`<div class="card mb-3">
    <div class="card-header px-4">
        <div class="d-flex align-items-center">
            <div class="flex-grow-1">
                <span>{{ruleset.name}}</span>
            </div>
            <div class="d-flex flex-column justify-content-end align-items-end color-primary cursor-pointer"
                (click)="editRules($event)">
                <span class="text-xxl line-height-xxl">{{ruleset?.rules?.length || 0}}</span>
                <span class="text-xs line-height-xs color-gray-darkest">{{'PACS.AUTOSHIFT_RULE'|translate}}</span>
            </div>
        </div>
    </div>
    <div class="card-body">
        <div class="d-flex flex-column text-sm color-gray-darkest">
            <div class="d-flex align-items-center gap-2 mb-3">
                <cds-icon shape="calendar" class="color-primary" style="min-width: 18px; min-height: 18px;"></cds-icon>
                <span>{{ruleset.startDateTime|date:'fullDate'}} - </span>
                <ng-container *ngIf="ruleset.endDateTime">
                    <span>{{ruleset.startDateTime|date:'fullDate'}}</span>
                </ng-container>
                <ng-container *ngIf="!ruleset.endDateTime">
                    <span>...</span>
                </ng-container>
            </div>
            <div class="d-flex align-items-center gap-2 mb-3">
                <cds-icon shape="region" class="color-primary" style="min-width: 18px; min-height: 18px;"></cds-icon>
                <span>
                    <ng-container *ngFor="let region of ruleset.regions">
                        <span class="comma">{{region.name}}</span>
                    </ng-container>
                </span>
            </div>
            <div class="d-flex align-items-center gap-2">
                <cds-icon shape="users" class="color-primary" style="min-width: 18px; min-height: 18px;"></cds-icon>
                <span>
                    <ng-container *ngFor="let group of ruleset.groups">
                        <span class="comma">{{group.name}}</span>
                    </ng-container>
                </span>
            </div>
        </div>
    </div>
    <div class="card-footer">
        <button class="btn btn-sm btn-link"
            (click)="editRules($event)">{{'PACS.AUTOSHIFT_EDIT_RULES'|translate}}</button>
        <button class="btn btn-sm btn-link" (click)="applyRuleset($event)">{{'BUTTON.APPLY'|translate}}</button>
        <button class="btn btn-sm btn-link" (click)="editRuleset($event)">{{'BUTTON.EDIT'|translate}}</button>
        <button class="btn btn-sm btn-link" (click)="deleteRuleset($event)">{{'BUTTON.DELETE'|translate}}</button>
    </div>
</div>`;var ve=`.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}:host .card-header{padding:12px}:host .passive-alert{margin:3px}:host .type-tag-container{display:inline-block}@media screen and (max-width: 576px){:host .type-tag-container{width:100%}}:host .type-tag-container .type-tag[type="1"][selected=true]{font-size:.714rem;margin:3px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-direction:row;-moz-flex-direction:row;-ms-flex-direction:row;flex-direction:row}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="1"][selected=true]{flex:1}}:host .type-tag-container .type-tag[type="1"][selected=true] .icon-container{padding:6px 12px;height:42px;background-color:#f9fbf4;color:#c4d492;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="1"][selected=true] .icon-container{padding:0 6px}}:host .type-tag-container .type-tag[type="1"][selected=true] .title-container{padding:6px 12px;height:42px;color:#88a825;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-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="1"][selected=true] .title-container{flex:1;padding:0 6px}}:host .type-tag-container .type-tag[type="1"][selected=true] .title-container span{font-size:.714rem;text-align:left;font-weight:400!important}:host .type-tag-container .type-tag[type="1"][selected=false]{font-size:.714rem;margin:3px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-direction:row;-moz-flex-direction:row;-ms-flex-direction:row;flex-direction:row}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="1"][selected=false]{flex:1}}:host .type-tag-container .type-tag[type="1"][selected=false] .icon-container{padding:6px 12px;height:42px;background-color:#fbfaf9;color:#d3d1bf;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="1"][selected=false] .icon-container{padding:0 6px}}:host .type-tag-container .type-tag[type="1"][selected=false] .title-container{padding:6px 12px;height:42px;color:#a7a37e;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-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="1"][selected=false] .title-container{flex:1;padding:0 6px}}:host .type-tag-container .type-tag[type="1"][selected=false] .title-container span{font-size:.714rem;text-align:left;font-weight:400!important}:host .type-tag-container .type-tag[type="2"][selected=true]{font-size:.714rem;margin:3px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-direction:row;-moz-flex-direction:row;-ms-flex-direction:row;flex-direction:row}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="2"][selected=true]{flex:1}}:host .type-tag-container .type-tag[type="2"][selected=true] .icon-container{padding:6px 12px;height:42px;background-color:#f9fbf4;color:#c4d492;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="2"][selected=true] .icon-container{padding:0 6px}}:host .type-tag-container .type-tag[type="2"][selected=true] .title-container{padding:6px 12px;height:42px;color:#88a825;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-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="2"][selected=true] .title-container{flex:1;padding:0 6px}}:host .type-tag-container .type-tag[type="2"][selected=true] .title-container span{font-size:.714rem;text-align:left;font-weight:400!important}:host .type-tag-container .type-tag[type="2"][selected=false]{font-size:.714rem;margin:3px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-direction:row;-moz-flex-direction:row;-ms-flex-direction:row;flex-direction:row}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="2"][selected=false]{flex:1}}:host .type-tag-container .type-tag[type="2"][selected=false] .icon-container{padding:6px 12px;height:42px;background-color:#fbfaf9;color:#d3d1bf;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="2"][selected=false] .icon-container{padding:0 6px}}:host .type-tag-container .type-tag[type="2"][selected=false] .title-container{padding:6px 12px;height:42px;color:#a7a37e;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-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="2"][selected=false] .title-container{flex:1;padding:0 6px}}:host .type-tag-container .type-tag[type="2"][selected=false] .title-container span{font-size:.714rem;text-align:left;font-weight:400!important}:host .type-tag-container .type-tag[type="3"][selected=true]{font-size:.714rem;margin:3px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-direction:row;-moz-flex-direction:row;-ms-flex-direction:row;flex-direction:row}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="3"][selected=true]{flex:1}}:host .type-tag-container .type-tag[type="3"][selected=true] .icon-container{padding:6px 12px;height:42px;background-color:#faf3f6;color:#c888a3;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="3"][selected=true] .icon-container{padding:0 6px}}:host .type-tag-container .type-tag[type="3"][selected=true] .title-container{padding:6px 12px;height:42px;color:#911146;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-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="3"][selected=true] .title-container{flex:1;padding:0 6px}}:host .type-tag-container .type-tag[type="3"][selected=true] .title-container span{font-size:.714rem;text-align:left;font-weight:400!important}:host .type-tag-container .type-tag[type="3"][selected=false]{font-size:.714rem;margin:3px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-direction:row;-moz-flex-direction:row;-ms-flex-direction:row;flex-direction:row}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="3"][selected=false]{flex:1}}:host .type-tag-container .type-tag[type="3"][selected=false] .icon-container{padding:6px 12px;height:42px;background-color:#fdf6f5;color:#e7a598;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="3"][selected=false] .icon-container{padding:0 6px}}:host .type-tag-container .type-tag[type="3"][selected=false] .title-container{padding:6px 12px;height:42px;color:#cf4a30;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-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="3"][selected=false] .title-container{flex:1;padding:0 6px}}:host .type-tag-container .type-tag[type="3"][selected=false] .title-container span{font-size:.714rem;text-align:left;font-weight:400!important}:host .type-tag-container .type-tag[type="4"][selected=true]{font-size:.714rem;margin:3px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-direction:row;-moz-flex-direction:row;-ms-flex-direction:row;flex-direction:row}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="4"][selected=true]{flex:1}}:host .type-tag-container .type-tag[type="4"][selected=true] .icon-container{padding:6px 12px;height:42px;background-color:#f2f7f9;color:#82b1c0;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="4"][selected=true] .icon-container{padding:0 6px}}:host .type-tag-container .type-tag[type="4"][selected=true] .title-container{padding:6px 12px;height:42px;color:#046380;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-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="4"][selected=true] .title-container{flex:1;padding:0 6px}}:host .type-tag-container .type-tag[type="4"][selected=true] .title-container span{font-size:.714rem;text-align:left;font-weight:400!important}:host .type-tag-container .type-tag[type="4"][selected=false]{font-size:.714rem;margin:3px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-direction:row;-moz-flex-direction:row;-ms-flex-direction:row;flex-direction:row}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="4"][selected=false]{flex:1}}:host .type-tag-container .type-tag[type="4"][selected=false] .icon-container{padding:6px 12px;height:42px;background-color:#f2f7f9;color:#82b1c0;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="4"][selected=false] .icon-container{padding:0 6px}}:host .type-tag-container .type-tag[type="4"][selected=false] .title-container{padding:6px 12px;height:42px;color:#046380;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-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="4"][selected=false] .title-container{flex:1;padding:0 6px}}:host .type-tag-container .type-tag[type="4"][selected=false] .title-container span{font-size:.714rem;text-align:left;font-weight:400!important}:host .type-tag-container .type-tag[type="5"][selected=true]{font-size:.714rem;margin:3px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-direction:row;-moz-flex-direction:row;-ms-flex-direction:row;flex-direction:row}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="5"][selected=true]{flex:1}}:host .type-tag-container .type-tag[type="5"][selected=true] .icon-container{padding:6px 12px;height:42px;background-color:#f9fbf4;color:#c4d492;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="5"][selected=true] .icon-container{padding:0 6px}}:host .type-tag-container .type-tag[type="5"][selected=true] .title-container{padding:6px 12px;height:42px;color:#88a825;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-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="5"][selected=true] .title-container{flex:1;padding:0 6px}}:host .type-tag-container .type-tag[type="5"][selected=true] .title-container span{font-size:.714rem;text-align:left;font-weight:400!important}:host .type-tag-container .type-tag[type="5"][selected=false]{font-size:.714rem;margin:3px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-direction:row;-moz-flex-direction:row;-ms-flex-direction:row;flex-direction:row}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="5"][selected=false]{flex:1}}:host .type-tag-container .type-tag[type="5"][selected=false] .icon-container{padding:6px 12px;height:42px;background-color:#fbfaf9;color:#d3d1bf;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="5"][selected=false] .icon-container{padding:0 6px}}:host .type-tag-container .type-tag[type="5"][selected=false] .title-container{padding:6px 12px;height:42px;color:#a7a37e;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-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}@media screen and (max-width: 576px){:host .type-tag-container .type-tag[type="5"][selected=false] .title-container{flex:1;padding:0 6px}}:host .type-tag-container .type-tag[type="5"][selected=false] .title-container span{font-size:.714rem;text-align:left;font-weight:400!important}
`;var ke=`<ng-container *ngIf="visibleComponent">
  <div class="modal-header">
    <span class="text-lg">{{"PACS.AUTOSHIFT_RULES" | translate}}</span>
  </div>
  <div class="modal-body autoshift-rules-modal-body">
    <div class="row mb-3">
      <div class="col-12 d-flex align-items-center">
        <button class="btn btn-sm btn-primary"
          (click)="addRule($event)">{{'PACS.AUTOSHIFT_ADD_RULE'|translate}}</button>
        <span *ngIf="this.rules.length>0 && hasInvalid"
          class="ms-auto color-error text-sm text-italic">{{'PACS.AUTOSHIFT_RULES_INVALID'|translate}}</span>
      </div>
    </div>
    <div class="row py-2 modal-scroll-area-70 overflow-y-auto">
      <div class="col-12 d-flex flex-column gap-3">
        <ng-container *ngFor="let rule of rules; let i = index">
          <armon-pacs-auto-shift-rule-item [(rule)]="rules[i]" (onRuleChanged)="ruleChanged($event)"
            (onRuleRemoved)="ruleRemoved($event)"></armon-pacs-auto-shift-rule-item>
        </ng-container>
      </div>
      <div class="col-12" *ngIf="rules && rules.length==0">
        <nz-empty [nzNotFoundContent]="contentTpl" [nzNotFoundImage]="'./assets/images/empty/empty_list.png'">
          <ng-template #contentTpl>
            <span>{{'PACS.AUTOSHIFT_RULES_EMPTY'|translate}}</span>
          </ng-template>
        </nz-empty>
      </div>
    </div>
  </div>
  <div class="modal-footer">
    <button class="btn btn-outline-primary me-2" (click)="onCancelClicked($event)">
      {{'BUTTON.CANCEL' | translate}}
    </button>
    <button class="btn btn-primary" (click)="onSaveClicked($event)" [disabled]="hasInvalid">
      {{'BUTTON.SAVE' | translate}}
    </button>
  </div>
</ng-container>`;var Se=`.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}:host .autoshift-rules-modal-body{background-color:#f7f7f7}
`;var Re=`<div class="d-flex flex-column align-items-stretch rounded px-3 py-4 shadow-sm rule-main-container"
    [attr.invalid]="rule.invalid">
    <div class="d-flex flex-column entrance-range-container">
        <div class="position-relative d-flex justify-content-start gap-2 align-items-center px-3">
            <span class="text-md">{{"PACS.AUTOSHIFT_ENTRANCE_RANGE"|translate}}:</span>
            <span class="text-md fw-medium color-primary"
                [ngClass]="{'text-danger': rule.isConflict}">{{dateService.threeDaysFormatTime(rule.entranceRange[0])}}
                -
                {{dateService.threeDaysFormatTime(rule.entranceRange[1])}}</span>
            <ng-container *ngIf="rule.isConflict">
                <cds-icon shape="warning-standard" class="text-danger cds-icon-12" solid></cds-icon>
                <span
                    class="text-danger text-xs text-italic">({{"PACS.AUTOSHIFT_ENTRANCE_RANGE_CONFLICT"|translate}})</span>
            </ng-container>
            <cds-icon shape="trash" solid class="position-absolute cds-icon-20 cursor-pointer rule-remove-button"
                nz-tooltip nzTooltipTitle="{{'BUTTON.REMOVE' | translate}}" click-stop-propagation
                (click)="onRemoveRule($event)"></cds-icon>
        </div>
        <div class="d-flex flex-grow-1 justify-content-center position-relative">
            <div style="width: 33.33%; z-index: 2;">
                <nz-slider nzRange [(ngModel)]="rule.entranceRange" [nzMin]="DATE_SERVICE_THREEDAYS_DAYCOUNT"
                    [nzMax]="DATE_SERVICE_THREEDAYS_DAYCOUNT * 2" [nzMarks]="entranceRangeMarks"
                    [nzTipFormatter]="entranceRangeTooltipFormatter"
                    (ngModelChange)="entranceRangeChanged($event)"></nz-slider>
            </div>
            <div class="position-absolute m-auto entrance-range-bg-line">&nbsp;</div>
        </div>
    </div>
    <div class="d-flex flex-column membership-range-container">
        <div class="d-flex justify-content-start gap-2 align-items-baseline px-3">
            <span class="text-md">{{"PACS.AUTOSHIFT_MEMBERSHIP_RANGE"|translate}}:</span>
            <span class="text-md fw-medium color-primary">{{dateService.threeDaysFormatTime(rule.membershipRange[0])}} -
                {{dateService.threeDaysFormatTime(rule.membershipRange[1])}}</span>
            <ng-container *ngIf="showMembershipWarning">
                <cds-icon shape="warning-standard" class="color-gray-dark cds-icon-12" solid></cds-icon>
                <span
                    class="color-gray-dark text-xs text-italic">({{"PACS.AUTOSHIFT_MEMBERSHIP_RANGE_NOT_CONFLICT"|translate}})</span>
            </ng-container>
        </div>
        <div class="d-flex flex-grow-1 justify-content-center px-3">
            <div class="w-100">
                <nz-slider nzRange [(ngModel)]="rule.membershipRange" (ngModelChange)="membershipRangeChanged($event)"
                    [nzMax]="DATE_SERVICE_THREEDAYS_DAYCOUNT * 3" [nzMarks]="membershipRangeMarks"
                    [nzTipFormatter]="membershipRangeTooltipFormatter"></nz-slider>
            </div>
        </div>
    </div>
    <div class="d-flex flex-column mt-4">
        <div class="d-flex justify-content-start gap-2 align-items-center px-3">
            <span class="text-md">{{"PACS.AUTOSHIFT_WORKPLAN"|translate}}:</span>
            <div class="w-25">
                <armon-select-search query="workplan" [(ngModel)]="rule.selectedWorkplanId"
                    (ngModelChange)="workplanChanged($event)">
                </armon-select-search>
            </div>
            <cds-icon *ngIf="!rule.selectedWorkplanId" shape="warning-standard" class="text-danger cds-icon-12"
                solid></cds-icon>
        </div>
    </div>
</div>`;var Te=`.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}:host .rule-main-container{background-color:#fff;border:solid 2px #c0daa8!important}:host .rule-main-container[invalid=true]{border:solid 2px #e9a89a!important}:host .entrance-range-container .entrance-range-bg-line{border-bottom:solid 1px #f7f7f7;height:17px;left:1rem;right:1rem;z-index:1;pointer-events:none}:host .entrance-range-container .rule-remove-button{right:6px;top:0;color:#de7d67}:host .entrance-range-container .rule-remove-button:hover{color:#c82602}
`;var qe=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(n=(o<3?a(n):o>3?a(e,t,n):a(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},$=class{dateService;rule;onRuleChanged=new E;onRuleRemoved=new E;showMembershipWarning=!1;changedSubject=new Y;entranceRangeMarks;membershipRangeMarks;markStep=36;DATE_SERVICE_THREEDAYS_DAYCOUNT=b;constructor(e){this.dateService=e}prepareMarks(e,t){let i={};for(;e<=t;){let o=this.dateService.threeDaysFormatHour(e);o=="00:00"?i[e]={style:{color:"#666"},label:"<strong>00:00</strong>"}:i[e]=o,e+=this.markStep}return i}ngOnInit(){}ngOnDestroy(){}ngAfterViewInit(){this.entranceRangeMarks=this.prepareMarks(b,b*2),this.membershipRangeMarks=this.prepareMarks(0,b*3),this.changedSubject.pipe(W(500)).subscribe(e=>{this.onRuleChanged.emit(e)})}checkConflictRange(e,t){let i=e[0],o=e[1],n=t[0],a=t[1];return i<=a&&o>=n}entranceRangeChanged(e){this.changedSubject.next(this.rule),this.showMembershipWarning=!this.checkConflictRange(this.rule.entranceRange,this.rule.membershipRange)}membershipRangeChanged(e){this.changedSubject.next(this.rule),this.showMembershipWarning=!this.checkConflictRange(this.rule.entranceRange,this.rule.membershipRange)}onRemoveRule(e){this.onRuleRemoved.emit(this.rule)}workplanChanged(e){this.changedSubject.next(this.rule)}entranceRangeTooltipFormatter=e=>this.dateService.threeDaysFormatTime(e);membershipRangeTooltipFormatter=e=>this.dateService.threeDaysFormatTime(e);static ctorParameters=()=>[{type:F}];static propDecorators={rule:[{type:f}],onRuleChanged:[{type:D}],onRuleRemoved:[{type:D}]}};$=qe([s({selector:"armon-pacs-auto-shift-rule-item",template:Re,standalone:!0,imports:[M,c,ie,k,xe,g,_,p],styles:[Te]})],$);var $e=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(n=(o<3?a(n):o>3?a(e,t,n):a(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},H=class extends S{autoShiftService;dateService;ruleset;visibleComponent=!1;hasInvalid=!0;editMode=!1;rules=[];dayStepCount=b;constructor(e,t){super(),this.autoShiftService=e,this.dateService=t}onModalInitialized(){super.onModalInitialized(),this.prepareRules(),this.visibleComponent=!0}getRangePoints(e){return[this.dateService.threeDaysGetRangePoint(e.from),this.dateService.threeDaysGetRangePoint(e.to)]}prepareRules(){this.ruleset?.rules&&!G(this.ruleset?.rules)&&(this.ruleset.rules.forEach(e=>{this.rules.push({id:O(),selectedWorkplanId:e.workPlanId,entranceRange:this.getRangePoints(e.checkRange),membershipRange:this.getRangePoints(e.membershipRange),isConflict:!0,invalid:!1})}),this.validateRules())}checkConflictRange(e,t){let i=e[0],o=e[1],n=t[0],a=t[1];return i<a&&o>n}validateRules(){if(y(this.rules)||G(this.rules)){this.hasInvalid=!0;return}this.rules.forEach(t=>{t.isConflict=!1,t.invalid=!1});let e=!1;this.rules.forEach(t=>{this.rules.forEach(i=>{t.id!=i.id&&t.isConflict==!1&&(t.isConflict=this.checkConflictRange(t.entranceRange,i.entranceRange))}),(t.isConflict||t.selectedWorkplanId==null)&&(t.invalid=!0,e=!0)}),this.hasInvalid=e}addRule(e){this.rules.push({id:O(),entranceRange:[288,360],membershipRange:[288,500],selectedWorkplanId:null,isConflict:!0,invalid:!1}),this.validateRules()}ruleChanged(e){this.validateRules()}ruleRemoved(e){this.rules.splice(this.rules.findIndex(t=>t.id==e.id),1),this.validateRules()}getRangeData(e){return ae.getCopyModel({from:this.dateService.threeDaysGetRangePointData(e[0]),to:this.dateService.threeDaysGetRangePointData(e[1])})}getRuleData(e){return e.map(t=>{let i=new oe;return i.workPlanId=t.selectedWorkplanId,i.checkRange=this.getRangeData(t.entranceRange),i.membershipRange=this.getRangeData(t.membershipRange),i})}onSaveClicked(e){let t=le.getEmptyModel();t.rules=this.getRuleData(this.rules),this.autoShiftService.upsertRulesetRules(this.ruleset.id,t).subscribe(i=>{this.closeModal(i)})}static ctorParameters=()=>[{type:d},{type:F}];static propDecorators={ruleset:[{type:f}]}};H=$e([s({selector:"armon-auto-shift-rules-modal",template:ke,standalone:!0,imports:[c,x,$,j,p],styles:[Se]})],H);var ze=`<ng-container>
  <div class="modal-header">
    <span class="text-lg">{{('PACS.AUTOSHIFT_APPLY_RULESET')|translate}}</span>
  </div>
  <div class="modal-body">
    <div class="row">
      <div class="col-12">
        <div class="d-flex align-items-center gap-2 mb-3">
          <cds-icon shape="region" class="color-primary" style="min-width: 18px; min-height: 18px;"></cds-icon>
          <span>
            <ng-container *ngFor="let region of ruleset.regions">
              <span class="comma">{{region.name}}</span>
            </ng-container>
          </span>
        </div>
        <div class="d-flex align-items-center gap-2">
          <cds-icon shape="users" class="color-primary" style="min-width: 18px; min-height: 18px;"></cds-icon>
          <span>
            <ng-container *ngFor="let group of ruleset.groups">
              <span class="comma">{{group.name}}</span>
            </ng-container>
          </span>
        </div>
      </div>
    </div>
    <div class="row my-3">
      <div class="col-12">
        <span class="text-md">{{'PACS.AUTOSHIFT_APPLY_RULESET_DIRECTION'|translate}}</span>
      </div>
    </div>
    <form [formGroup]="form">
      <div class="row px-2">
        <div class="col-md-6 col-12 mb-3">
          <label class="col-form-label col-form-label-sm">{{'PACS.START_DATE'|translate}}</label>
          <input [formControl]="form.get('start')" type="text" readonly owlinput
            class="form-control form-control-sm bg-white" [owlDateTime]="startDt" [owlDateTimeTrigger]="startDt"
            [max]="form.get('end').value">
          <owl-date-time [firstDayOfWeek]="1" #startDt [pickerType]="'calendar'"></owl-date-time>
          <ng-template
            *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('start')}">
          </ng-template>
        </div>
        <div class="col-md-6 col-12 mb-3">
          <label class="col-form-label col-form-label-sm">{{'PACS.END_DATE'|translate}}</label>
          <input [formControl]="form.get('end')" type="text" readonly owlinput
            class="form-control form-control-sm bg-white" [owlDateTime]="endDt" [owlDateTimeTrigger]="endDt"
            [min]="form.get('start').value">
          <owl-date-time [firstDayOfWeek]="1" #endDt [pickerType]="'calendar'"></owl-date-time>
          <ng-template
            *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('end')}">
          </ng-template>
        </div>
      </div>
    </form>
  </div>

  <div class="modal-footer">
    <button class="btn btn-outline-primary" (click)="onCancelClicked($event)">{{'BUTTON.CANCEL' | translate}}</button>
    <button class="btn btn-primary" [disabled]="form.invalid" (click)="onApplyClicked($event)">{{'BUTTON.APPLY' |
      translate}}</button>
  </div>
</ng-container>

<!-- FORM FIELD VALIDATION -->
<ng-template #controlValidationTemplate let-form let-control="control">
  <ng-container *ngIf="control.errors">
    <div class="invalid-feedback d-flex flex-column" style="display: initial;">
      <span *ngIf="control.errors.required">{{'VALIDATION.REQUIRED'|translate}}</span>
    </div>
  </ng-container>
</ng-template>`;var Ce=`.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}
`;var Be=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(n=(o<3?a(n):o>3?a(e,t,n):a(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},V=class extends S{interactionService;formBuilder;autoShiftService;languageService;ruleset;editMode=!1;form;constructor(e,t,i,o){super(),this.interactionService=e,this.formBuilder=t,this.autoShiftService=i,this.languageService=o}onModalInitialized(){super.onModalInitialized(),this.initializeForms()}onApplyClicked(e){this.applyRuleset()}initializeForms(){this.form=this.formBuilder.group({start:[u.now().minus({days:30}).startOf("day").toJSDate(),m.required],end:[u.now().plus({days:1}).startOf("day").toJSDate(),m.required]})}applyRuleset(){this.interactionService.showDialog("PACS.AUTOSHIFT_APPLY_RULESET","PACS.AUTOSHIFT_APPLY_RULESET_CONFIRMATION",null,null,!0,"BUTTON.APPLY","",!1,()=>{let e=se.getEmptyModel();e.start=u.fromJSDate(this.form.value.start).startOf("day").toJSDate(),e.end=u.fromJSDate(this.form.value.end).startOf("day").toJSDate(),this.autoShiftService.applyRuleset(this.ruleset.id,e).subscribe(()=>{this.closeModal()})})}static ctorParameters=()=>[{type:C},{type:U},{type:d},{type:z}];static propDecorators={ruleset:[{type:f}]}};V=Be([s({selector:"armon-pacs-auto-shift-ruleset-apply-modal",template:ze,standalone:!0,providers:[{provide:R,useClass:I}],imports:[x,g,L,T,P,c,p],styles:[Ce]})],V);var Ge=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(n=(o<3?a(n):o>3?a(e,t,n):a(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},B=class{interactionService;autoShiftService;modalService;ruleset;onUpdated=new E;constructor(e,t,i){this.interactionService=e,this.autoShiftService=t,this.modalService=i}ngOnInit(){}ngOnDestroy(){}editRules(e){this.modalService.open(H,{settings:{size:"xxl",scrollable:!0,centered:!1},props:{ruleset:this.ruleset}}).result.then(t=>{this.onUpdated.emit()}).catch(t=>{})}applyRuleset(e){this.modalService.open(V,{settings:{size:"lg",scrollable:!0},props:{ruleset:this.ruleset}}).result.then(t=>{this.onUpdated.emit()}).catch(t=>{})}editRuleset(e){this.modalService.open(A,{settings:{size:"lg",scrollable:!0},props:{ruleset:this.ruleset}}).result.then(t=>{this.onUpdated.emit()}).catch(t=>{})}deleteRuleset(e){this.interactionService.showDialog("PACS.AUTOSHIFT_RULESET","PACS.AUTOSHIFT_RULESET_DELETE_CONFIRMATION",null,null,!0,"BUTTON.DELETE","",!0,()=>{this.autoShiftService.deleteRuleset(this.ruleset.id).subscribe(()=>{this.onUpdated.emit()})})}static ctorParameters=()=>[{type:C},{type:d},{type:N}];static propDecorators={ruleset:[{type:f}],onUpdated:[{type:D}]}};B=Ge([s({selector:"armon-pacs-auto-shift-list-item",template:we,standalone:!0,imports:[c,x,K,p],styles:[ve]})],B);var Ye=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(n=(o<3?a(n):o>3?a(e,t,n):a(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Ie=class{languageService;autoShiftService;modalService;visibleComponent=!1;rulesets=[];request;paginationResponse;filterDateRange=null;constructor(e,t,i){this.languageService=e,this.autoShiftService=t,this.modalService=i}ngOnInit(){this.visibleComponent=!0,this.setRequest(),this.getRulesetList()}ngOnDestroy(){}setRequest(){this.request=ne.getEmptyModel()}getRulesetList(){this.autoShiftService.getRulesetList(this.request).subscribe(e=>{this.rulesets=e.items,this.paginationResponse=e.pagination})}refreshList(e=!0){e&&(this.request.pagination.skip=0),this.getRulesetList()}onFilterUpdated(e){this.refreshList()}addRuleset(e){this.modalService.open(A,{settings:{size:"lg",scrollable:!0}}).result.then(t=>{this.refreshList()}).catch(t=>{})}onUpdated(e){this.filterDateRange?(this.request.filter.startDateTime=u.fromJSDate(this.filterDateRange[0]).startOf("day").toJSDate(),this.request.filter.endDateTime=u.fromJSDate(this.filterDateRange[1]).endOf("day").toJSDate()):(this.request.filter.startDateTime=null,this.request.filter.endDateTime=null),this.refreshList()}pageChanged(e){this.request.pagination=e,this.refreshList(!1)}static ctorParameters=()=>[{type:z},{type:d},{type:N}]};Ie=Ye([s({selector:"armon-pacs-auto-shift-list",template:ge,animations:pe,standalone:!0,providers:[{provide:R,useClass:I}],imports:[c,fe,de,ue,g,_,T,k,me,x,B,j,ce,p],styles:[be]})],Ie);export{Ie as PacsAutoShiftListComponent};
