import{a as v}from"./chunk-ZTPSCNCV.js";import{a as b}from"./chunk-PMJFQIXL.js";import{Mb as _,Rb as g}from"./chunk-YSQLW2JA.js";import{Aa as a,Hb as h,Pd as I,Sd as D,_a as C,ab as d,ac as E,bb as m,cd as N,dd as p,fb as f,mc as S,ya as c}from"./chunk-SKPDQO4E.js";var y=`<div class="modal-header">
  <span class="text-lg" *ngIf="accessControlPointDetails">{{accessControlPointDetails.name}}</span>
</div>

<div class="modal-body">

  <!-- Button to access related control panel -->
  <div class="row">
    <div class="col mb-4">
      <button class="btn btn-sm btn-outline-primary"
        (click)="onShowControlPanelClicked($event)">{{'ACCESSCONTROLPOINT.SHOW_TERMINAL' | translate}}</button>
    </div>
  </div>

  <div class="row">
    <div class="col-12">
      <ng-container *ngFor="let detail of detailFilters">
        <button type="button" class="btn btn-sm me-2" (click)="onToggleShowDetailsClicked(detail.index)"
          *ngIf="detail.data && detail.data>0" [ngClass]="getAvailableClasses(detail.index)">
          {{detail.title | translate}} <span class="badge text-bg-light">{{detail.data}}</span>
        </button>
      </ng-container>
    </div>
  </div>

  <div class="row mb-4">

    <!-- Wiegand readers -->
    <div class="col-md-6 col-sm-12" *ngFor="let reader of readers">
      <armon-access-control-point-item [item]="reader" [type]="'CONNECTIONS.TYPE_WIEGAND_READER'" [title]="reader.name"
        [inputNumber]="reader.number" [infoField]="'infoList'" [colorCode]=getRelayColor(reader)>
      </armon-access-control-point-item>
    </div>

    <!-- Relays -->
    <div class="col-md-6 col-sm-12" *ngFor="let relay of relays">
      <armon-access-control-point-item [item]="relay" [type]="'CONNECTIONS.TYPE_RELAY'" [title]="relay.managesTo"
        [inputNumber]="relay.number" [infoField]="'infoList'" [colorCode]="relay.color">
      </armon-access-control-point-item>
    </div>

    <!-- Exit Buttons -->
    <div class="col-md-6 col-sm-12" *ngFor="let exitButton of exitButtons">
      <armon-access-control-point-item [item]="exitButton" [type]="'CONNECTIONS.TYPE_EXIT_BUTTON'"
        [inputNumber]="exitButton.dryContactInputNumber" [colorCode]=getRelayColor(exitButton)>
      </armon-access-control-point-item>
    </div>

    <!-- Status Sensors -->
    <div class="col-md-6 col-sm-12" *ngFor="let statusSensor of statusSensors">
      <armon-access-control-point-item [item]="statusSensor" [type]="'CONNECTIONS.TYPE_STATUS_SENSOR'"
        [title]="statusSensor.senseTo" [inputNumber]="statusSensor.dryContactInputNumber"
        [colorCode]=getRelayColor(statusSensor) [infoField]="'infoList'"></armon-access-control-point-item>
    </div>

    <!-- Counter Sensors -->
    <div class="col-md-6 col-sm-12" *ngFor="let counterSensor of counterSensors">
      <armon-access-control-point-item [item]="counterSensor" [type]="'CONNECTIONS.TYPE_COUNTER_SENSOR'"
        [title]="counterSensor.countsTo" [inputNumber]="counterSensor.dryContactInputNumber"
        [colorCode]=getRelayColor(counterSensor)></armon-access-control-point-item>
    </div>

  </div>

  <armon-access-control-point-authentication-factors [accessControlPoint]="accessControlPointDetails"
    *ngIf="accessControlPointDetails"></armon-access-control-point-authentication-factors>

  <div class="row mt-3" *ngIf="accessControlPointDetails?.typedGeoLocation">
    <div class="col-12">
      <armon-map-open-layers [location]="accessControlPointDetails.typedGeoLocation" ignoreReliable="true">
      </armon-map-open-layers>
    </div>
  </div>

</div>
<div class="modal-footer">
  <button class="btn btn-outline-primary" (click)="onCancelClicked($event)">{{'BUTTON.CLOSE' | translate}}</button>
</div>`;var P="";var x=`<div class="itemContainer p-2 my-2">
  <div class="d-flex">
    <div class="text-md flex-grow-1">{{type | translate}}</div>
    <span class="d-flex">
      <div class="itemColor" *ngIf="colorCode" [ngStyle]="{'background': colorCode}"></div>
      <span class="text-sm">#{{inputNumber}}</span>
    </span>
  </div>
  <div class="text-sm" *ngIf="title">{{title | translate:item}}</div>
  <div class="text-sm" *ngFor="let info of infoList">{{info}}</div>
</div>`;var T=`.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}.itemContainer{border:1px solid rgb(235,235,235);border-radius:3px;min-height:4.9rem}.itemColor{width:8px;height:8px;border-radius:50%;margin:2px 4px 0}
`;var F=function(n,t,e,o){var s=arguments.length,i=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var l=n.length-1;l>=0;l--)(r=n[l])&&(i=(s<3?r(i):s>3?r(t,e,i):r(t,e))||i);return s>3&&i&&Object.defineProperty(t,e,i),i},u=class{translate;item;type;title;inputNumber;colorCode;infoField;infoList=[];constructor(t){this.translate=t}ngOnInit(){this.updateInfoList()}updateInfoList(){this.item&&this.item[this.infoField]&&this.translate.get(this.item[this.infoField],this.item).subscribe(t=>{this.infoList=[],this.item[this.infoField].forEach(e=>{this.infoList.push(t[e]||"")})})}static ctorParameters=()=>[{type:N}];static propDecorators={item:[{type:a}],type:[{type:a}],title:[{type:a}],inputNumber:[{type:a}],colorCode:[{type:a}],infoField:[{type:a}]}};u=F([c({selector:"armon-access-control-point-item",template:x,standalone:!0,imports:[m,f,d,p],styles:[T]})],u);var k=function(n,t,e,o){var s=arguments.length,i=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var l=n.length-1;l>=0;l--)(r=n[l])&&(i=(s<3?r(i):s>3?r(t,e,i):r(t,e))||i);return s>3&&i&&Object.defineProperty(t,e,i),i},R=class extends D{router;accessControlPointService;routingService;sessionService;accessControlPointId;DETAIL_INDEX_READERS=1;DETAIL_INDEX_RELAYS=2;DETAIL_INDEX_SENSORS=3;DETAIL_INDEX_BUTTONS=4;accessControlPointDetails;selectedDetails=[];detailFilters;constructor(t,e,o,s){super(),this.router=t,this.accessControlPointService=e,this.routingService=o,this.sessionService=s}get readers(){return this.getAccessControlPointItems(this.DETAIL_INDEX_READERS,"readers","number")}get relays(){return this.getAccessControlPointItems(this.DETAIL_INDEX_RELAYS,"relays","number")}get exitButtons(){return this.getAccessControlPointItems(this.DETAIL_INDEX_BUTTONS,"exitButtons","dryContactInputNumber")}get statusSensors(){return this.getAccessControlPointItems(this.DETAIL_INDEX_SENSORS,"statusSensors","dryContactInputNumber")}get counterSensors(){return this.getAccessControlPointItems(this.DETAIL_INDEX_SENSORS,"counterSensors","dryContactInputNumber")}onModalInitialized(){super.onModalInitialized(),this.getAccessControlPointDetails(this.accessControlPointId)}isSelected(t){return this.selectedDetails.indexOf(t)>=0}getAvailableClasses(t){let e=this.detailFilters.find(o=>o.index===t);return{"btn-outline-info":e&&e.data&&!this.isSelected(t),"btn-info":e&&e.data&&this.isSelected(t)}}onShowControlPanelClicked(t){this.accessControlPointDetails&&(this.routingService.gotoManageTerminals(this.accessControlPointDetails.deviceId),this.closeModal())}onToggleShowDetailsClicked(t){let e=this.selectedDetails.indexOf(t);e>=0?this.selectedDetails.splice(e,1):this.selectedDetails.push(t)}getRelayColor(t){let e=this.relays.find(o=>o.id===t.deviceRelayId);return e?e.color:"transparent"}getAccessControlPointDetails(t){t&&this.accessControlPointService.getDetailsofAccessControlPoint(t).subscribe(e=>{this.accessControlPointDetails=e,this.detailFilters=[{index:this.DETAIL_INDEX_READERS,title:"CONNECTIONS.TYPE_WIEGAND_READER",data:this.accessControlPointDetails?this.accessControlPointDetails.wiegandReaderCount:0},{index:this.DETAIL_INDEX_RELAYS,title:"CONNECTIONS.TYPE_RELAY",data:this.accessControlPointDetails?this.accessControlPointDetails.relayCount:0},{index:this.DETAIL_INDEX_BUTTONS,title:"CONNECTIONS.TYPE_EXIT_BUTTON",data:this.accessControlPointDetails?this.accessControlPointDetails.exitButtonCount:0},{index:this.DETAIL_INDEX_SENSORS,title:"CONNECTIONS.TYPE_SENSORS",data:this.accessControlPointDetails?this.accessControlPointDetails.sensorCount:0}],this.accessControlPointDetails.wiegandReaderCount>0&&this.selectedDetails.push(this.DETAIL_INDEX_READERS),this.accessControlPointDetails.relayCount>0&&(this.selectedDetails.push(this.DETAIL_INDEX_RELAYS),this.accessControlPointDetails.relays.forEach(o=>{o.color=E()}))})}getAccessControlPointItems(t,e,o){let s=this.isSelected(t)&&this.accessControlPointDetails?this.accessControlPointDetails[e]:[];return S(s,o),s}static ctorParameters=()=>[{type:h},{type:g},{type:_},{type:I}];static propDecorators={accessControlPointId:[{type:a}]}};R=k([c({selector:"armon-access-control-point-detailed-modal",template:y,standalone:!0,imports:[m,d,C,u,v,b,p],styles:[P]})],R);export{R as a};
