import{a as Ei}from"./chunk-JUI5JEEH.js";import{a as Ci}from"./chunk-IKQMUISD.js";import{a as yi}from"./chunk-P7XQ2A6N.js";import"./chunk-C7K6NHIV.js";import{a as xi}from"./chunk-I5K7GPAI.js";import{a as gi}from"./chunk-LTYRORJD.js";import"./chunk-ZTPSCNCV.js";import"./chunk-TOMSDEUO.js";import"./chunk-MXSLISEG.js";import{a as ii}from"./chunk-NLCRYDJ4.js";import{a as si}from"./chunk-RB5TOXJE.js";import"./chunk-7GYHTWED.js";import{a as Fn}from"./chunk-AYO4TCFG.js";import{a as ni}from"./chunk-P3WQM3KW.js";import{a as li}from"./chunk-PWALQELY.js";import"./chunk-7QEXVS2A.js";import{a as ai}from"./chunk-D4RZOGGF.js";import"./chunk-PMJFQIXL.js";import"./chunk-MNVOJIXC.js";import{a as fi,b as ci,c as ui}from"./chunk-UZB7YFT6.js";import"./chunk-HXEFMD5A.js";import"./chunk-KCLQIV7M.js";import"./chunk-5KCUTXXV.js";import{a as vi}from"./chunk-JUDWAYYT.js";import"./chunk-LAJI7RPC.js";import{a as oi}from"./chunk-WFZJP5WR.js";import"./chunk-F6KLNSUK.js";import{b as hi,c as di,d as pi}from"./chunk-YOJ4KGSB.js";import{b as mi}from"./chunk-I6FSQTEP.js";import"./chunk-CO3X7TQN.js";import{a as ze}from"./chunk-VSFNMVXJ.js";import"./chunk-WQ6DP4JQ.js";import{Fb as Jo,Mb as ti,Ob as ei,P as Bn,Qb as ri,Rb as $t,a as Pn,rb as qo,s as Ur,v as Vr,wb as $o,y as Hr}from"./chunk-YSQLW2JA.js";import{Ca as Qo,H as zr,I as Xo,R as jo,T as Yo,ma as cr,pa as Mn,xa as Ko}from"./chunk-NVJ2ZZFT.js";import{$f as Wo,Aa as xt,Ba as Rt,Dc as de,Ea as Mo,Hb as Uo,He as Ve,Mc as zo,Mg as Gr,Na as Dn,Nc as re,Ng as Ge,Oa as Bo,Pa as bn,Pd as pe,Qf as me,Ra as Fo,Rd as Ue,Sa as Lo,Sd as ve,Se as Lr,Tb as Vo,Te as qt,Ue as kr,Va as he,Wb as Nn,Yf as Oe,Yg as Zo,_ as Dr,_a as Nr,a as bo,ab as Qt,af as He,b as No,bb as Ut,bh as Wr,ca as Rn,cd as Fr,dc as Br,dd as Vt,eh as Xr,fb as ko,g as Tn,gb as Pr,h as ee,ha as Tt,hd as Ht,m as Po,ma as ke,mb as Mr,ng as fr,uc as Ho,wa as br,ya as Ft,zc as Go}from"./chunk-SKPDQO4E.js";var Ai=`<div class="h-100">
  <side-navigation>
    <ng-template side-navigation-nav>
      <!-- Filtering area -->
      <label class="report-form-label">{{'ACCESSCONTROLPOINT.SEARCH' | translate}}</label>
      <armon-search-text-input [minLength]="3" [maxLength]="20" [(ngModel)]="filter.filter"
        (ngModelChange)="onFilterChanged($event)" placeholder="COMMON.SEARCH"></armon-search-text-input>
      <div class="centered filterButtons">
        <button nz-dropdown [nzDropdownMenu]="menuPrint" class="btn btn-success btn-sm me-2">
          {{'BUTTON.DOWNLOAD' | translate}}
          <cds-icon shape="angle" direction="down"></cds-icon>
        </button>
        <nz-dropdown-menu #menuPrint="nzDropdownMenu">
          <ul nz-menu>
            <li nz-menu-item (click)="onGetExcelClicked($event)">{{'BUTTON.EXCEL'|translate}}</li>
            <li nz-menu-item (click)="onGetPDFClicked($event)">{{'BUTTON.PDF'|translate}}</li>
          </ul>
        </nz-dropdown-menu>
      </div>
    </ng-template>
    <ng-template side-navigation-content>
      <div class="row mb-3">
        <div class="col-12 d-flex justify-content-start">
          <button nz-dropdown [nzDropdownMenu]="menuActions" class="btn btn-primary btn-sm me-2">
            {{'BUTTON.ACTIONS' | translate}}
            <cds-icon shape="angle" direction="down"></cds-icon>
          </button>
          <nz-dropdown-menu #menuActions="nzDropdownMenu">
            <ul nz-menu>
              <li nz-menu-item (click)="onBulkManualRecordsClicked($event)">
                {{'ACCESSCONTROLPOINT.BULK_MANUAL_RECORD_BUTTON'|translate}}</li>
            </ul>
          </nz-dropdown-menu>
        </div>
      </div>
      <!-- Listing area -->
      <ng-container *ngIf="accessControlPoints && accessControlPoints.length > 0">
        <div class="row" [@listAnimation]="accessControlPoints.length">
          <!-- List of user groups -->
          <div class="col-xxxl-4 col-xl-6 col-lg-6 col-md-12" *ngFor="let accessControlPoint of accessControlPoints">
            <armon-access-control-point-card [accessControlPoint]="accessControlPoint"
              [enabledNotificationJobTypes]="enabledNotificationJobTypes"
              (accessControlPointDeleted)="onAccessControlPointDeleted($event)"></armon-access-control-point-card>
          </div>
        </div>
      </ng-container>
      <div class="row py-5" *ngIf="accessControlPoints && accessControlPoints.length==0">
        <div class="col-12 mt-5">
          <nz-empty [nzNotFoundContent]="contentTpl" [nzNotFoundImage]="'./assets/images/empty/empty_list.png'">
            <ng-template #contentTpl>
              <span>{{'ACCESSCONTROLPOINT.FILTER_NO_ITEMS'|translate}}</span>
            </ng-template>
          </nz-empty>
        </div>
      </div>
      <div class="row" *ngIf="accessControlPoints && accessControlPoints.length>0">
        <div class="col-12 my-3">
          <armon-pagination [paginationResponse]="paginationResponse" (pageChanged)="pageChanged($event)">
          </armon-pagination>
        </div>
      </div>
    </ng-template>
  </side-navigation>
</div>`;var wi=`.showMoreArea{margin-top:24px}
`;var Do=Tn(Pn());var _i=`<div class="card mb-3">
  <div class="card-body d-flex flex-column accessControlPointBasicInfo" [attr.footer]="visibleButtons.length > 0">
    <div class="d-flex mb-3 align-items-center">
      <span class="text-base text-primary flex-grow-1 fw-medium">{{accessControlPoint.name}}</span>
      <div class="d-flex column-gap-1">
        <cds-icon class="ml-1 color-error" shape="error-standard" style="width: 18px; height: 18px;" nz-tooltip
          *ngIf="hasManualSettings" nzTooltipTitle="{{'REMOTECONTROL.CONTROL_STATE_HAS_MANUAL_CONTROL'|translate}}">
        </cds-icon>
        <cds-icon class="ml-1 color-gray-darkest" shape="qr-code" style="width: 18px; height: 18px;" nz-tooltip
          *ngIf="accessControlPoint.qrCodes && accessControlPoint.qrCodes.items?.length>0"
          nzTooltipTitle="{{'ACCESSCONTROLPOINT.HAS_QR_CODE' | translate}}"></cds-icon>
        <cds-icon class="ml-1 color-gray-darkest" shape="map-marker" style="width: 18px; height: 18px;" nz-tooltip
          *ngIf="accessControlPoint.typedGeoLocation"
          nzTooltipTitle="{{'ACCESSCONTROLPOINT.GEOLOCATION_SELECTED' | translate}}"></cds-icon>
        <cds-icon class="ml-1 color-gray-darkest" shape="open-remotely" style="width: 18px; height: 18px;" nz-tooltip
          *ngIf="accessControlPoint.remoteAvailable"
          nzTooltipTitle="{{'ACCESSCONTROLPOINT.REMOTE_AVAILABLE' | translate}}"></cds-icon>
        <cds-icon class="ml-1 color-gray-darkest" shape="mobile" style="width: 18px; height: 18px;" nz-tooltip
          *ngIf="accessControlPoint.isBuiltinVirtualPoint"
          nzTooltipTitle="{{'ACCESSCONTROLPOINT.PACS_BUILTIN_POINT' | translate}}"></cds-icon>
      </div>
    </div>

    <!-- Location -->
    <p class="text-sm mb-1" *ngIf="accessControlPoint.location">{{accessControlPoint.location}}</p>

    <!-- Type -->
    <span class="text-sm fw-medium mb-1" *ngIf="accessControlPoint.typeName">
      {{accessControlPoint.typeName | translate}}</span>

    <armon-icon-label [colorCode]="1" *ngIf="accessControlPoint.isBuiltinVirtualPoint" class="mt-2">
      <ng-template icon-label-icon>
        <cds-icon shape="mobile" solid></cds-icon>
      </ng-template>
      <ng-template icon-label-content>
        <span>{{'ACCESSCONTROLPOINT.PACS_BUILTIN_POINT' | translate}}</span>
      </ng-template>
    </armon-icon-label>

  </div>
  <div class="card-footer p-2" *ngIf="visibleButtons.length > 0">
    <button class="btn btn-sm btn-link" *ngFor="let button of visibleButtons"
      (click)="onFooterButtonClicked($event, button.event)">{{button.text |
      translate:languageService.userTranslate}}</button>
    <button nz-dropdown [nzDropdownMenu]="menuSub" class="btn btn-link btn-sm mr-2" *ngIf="hiddenButtons.length > 0"
      [nzClickHide]="true">
      <cds-icon shape="ellipsis-horizontal"></cds-icon>
    </button>
    <nz-dropdown-menu #menuSub="nzDropdownMenu">
      <ul nz-menu>
        <li nz-menu-item *ngFor="let button of hiddenButtons" (click)="onFooterButtonClicked($event, button.event)">
          {{button.text | translate:languageService.userTranslate}}</li>
      </ul>
    </nz-dropdown-menu>
  </div>
</div>`;var Si=`.accessControlPointBasicInfo{min-height:120px}.accessControlPointBasicInfo[footer=false]{min-height:160px}
`;var ns=Tn(Pn());var Ii=`<div class="modal-header d-flex flex-column align-items-start">\r
  <span class="text-lg">{{'ACCESSCONTROLPOINT.LIST_GRANT_USERS' | translate}}</span>\r
  <span class="text-sm">{{accessControlPoint.name}}</span>\r
</div>\r
<div class="modal-body bg-color-background" id="acp-grant-users-list">\r
  <div class="row m-2">\r
    <div class="col-12 col-lg-6 px-2 py-1" *ngFor="let user of users">\r
      <armon-captionlines *ngIf="user.userCaptions" [captionlines]="user.userCaptions"\r
        [className]="'bg-white'"></armon-captionlines>\r
    </div>\r
  </div>\r
  <div class="row m-1">\r
    <div class="col-12">\r
      <armon-pagination [paginationResponse]="paginationResponse" [scrollDomId]="'acp-grant-users-list'"\r
        (pageChanged)="pageChanged($event)"></armon-pagination>\r
    </div>\r
  </div>\r
</div>\r
<div class="modal-footer">\r
  <button class="btn btn-outline-primary" (click)="onCancelClicked($event)">{{'BUTTON.CLOSE' | translate}}</button>\r
</div>`;var Oi=`.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 ps=function(r,t,e,n){var o=arguments.length,i=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,t,e,n);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(i=(o<3?a(i):o>3?a(t,e,i):a(t,e))||i);return o>3&&i&&Object.defineProperty(t,e,i),i},jr=class extends ve{accessControlPointService;sessionService;accessControlPoint;request=Qo.getEmptyModel();users;paginationResponse=new Ge;paginationRequest=new Gr;constructor(t,e){super(),this.accessControlPointService=t,this.sessionService=e}onModalInitialized(){super.onModalInitialized(),this.request.grant=!0,this.request.take=20,this.getList()}getList(){this.accessControlPointService.getAccessControlPointUsers(this.accessControlPoint.id,this.request).subscribe(t=>{this.users=t.users,this.paginationResponse=new Ge,this.paginationResponse.total=t.total,this.paginationResponse.take=t.take,this.paginationResponse.skip=t.skip},t=>{})}pageChanged(t){this.request.skip=t.skip,this.request.take=t.take,this.getList()}static ctorParameters=()=>[{type:$t},{type:pe}];static propDecorators={accessControlPoint:[{type:xt}]}};jr=ps([Ft({selector:"armon-access-control-point-grant-users",template:Ii,standalone:!0,imports:[Qt,Ut,oi,ze,Vt],styles:[Oi]})],jr);var Ti=`<div class="modal-header align-items-center">
  <div class="d-flex me-2 align-items-center">
    <cds-icon shape="qr-code" size="lg" class="text-primary opacity-25"></cds-icon>
  </div>
  <div class="d-flex flex-column flex-grow-1">
    <span class="text-lg">{{"ACCESSCONTROLPOINT.QR_CODES" | translate }}</span>
    <span class="text-md">{{accessControlPoint.name}}</span>
  </div>
</div>

<div class="modal-body">
  <div class="row">
    <div class="col-12">
      <button type="button" class="btn btn-sm btn-primary" (click)="onAddClicked($event, upsertTemplate)">
        <cds-icon shape="plus-circle" solid class="cds-icon-18 me-1"></cds-icon>{{'BUTTON.ADD' |
        translate}}
      </button>
    </div>
  </div>
  <div class="row mt-3" *ngIf="items && items.length>0">
    <ng-container *ngFor="let item of items">
      <div class="col-12">
        <div class="card mb-3">
          <div class="card-body py-1 px-2">
            <div class="d-flex">
              <div class="me-2 mt-2 d-flex align-items-center justify-content-center">
                <qr-code [value]="item.qrCodeData" size="96" errorCorrectionLevel="M" darkColor="#7a7a7a"></qr-code>
              </div>
              <div class="d-flex flex-column py-1 justify-content-center flex-grow-1">
                <span class="text-md">{{item.directionDefinition.description|translate}}</span>
                <span class="text-xs mb-2 color-gray">{{item.qrCodeData}}</span>
                <span class="text-sm">{{item.triggerDefinition.label|translate}}</span>
                <ng-container *ngIf="item.config">
                  <span class="text-xs text-italic color-gray"
                    *ngIf="item.config && item.config.trigger && item.config.trigger.validateGeoLocation == true">{{'ACCESSCONTROLPOINT.QR_CODE_VALIDATE_GEOLOCATION'|translate}}</span>
                  <span class="text-xs text-italic color-gray"
                    *ngIf="item.config && item.config.trigger && item.config.trigger.userCanChangeTrigger == true">{{'ACCESSCONTROLPOINT.QR_CODE_VALIDATE_USER_CHANGE_TRIGGER'|translate:languageService.userTranslate}}</span>
                </ng-container>
              </div>
            </div>
          </div>
          <div class="card-footer py-1 px-2">
            <button class="btn btn-link" (click)="onDeleteClicked($event, item)">{{'BUTTON.DELETE'|translate}}</button>
            <!-- hidden, because of no settings for virtual point QR -->
            <button class="btn btn-link" [hidden]="accessControlPoint.isVirtualPoint"
              (click)="onEditClicked($event, item, upsertTemplate)">{{'BUTTON.EDIT'|translate}}</button>
          </div>
        </div>
      </div>
    </ng-container>
  </div>
  <div class="row pt-3" *ngIf="items && items.length==0">
    <div class="col-12">
      <nz-empty [nzNotFoundContent]="contentTpl" [nzNotFoundImage]="'./assets/images/empty/empty_list.png'">
        <ng-template #contentTpl>
          <span>{{'ACCESSCONTROLPOINT.QR_CODE_EMPTY'|translate}}</span>
        </ng-template>
      </nz-empty>
    </div>
  </div>
  <div class="row">
    <div class="col-12 my-1">
      <armon-pagination [paginationResponse]="paginationResponse" [scrollDomId]="'report-data-table-container'"
        (pageChanged)="pageChanged($event)"></armon-pagination>
    </div>
  </div>
</div>

<div class="modal-footer">
  <button type="button" class="btn btn-outline-primary" (click)="onCancelClicked($event)">{{'BUTTON.CLOSE' |
    translate}}</button>
</div>


<!-- UPSERT MODAL -->
<ng-template #upsertTemplate let-modal>
  <div class="modal-header align-items-center">
    <div class="d-flex me-2 align-items-center">
      <cds-icon shape="qr-code" size="lg" class="text-primary opacity-25"></cds-icon>
    </div>
    <div class="d-flex flex-column flex-grow-1">
      <span class="text-lg">{{"ACCESSCONTROLPOINT.QR_CODE" | translate }}</span>
    </div>
  </div>

  <div class="modal-body" [ngClass]="{'mhs-25': !accessControlPoint.isVirtualPoint}">
    <form [formGroup]="form">
      <div class="row">
        <div class="col-12 mb-2" *ngIf="isEditMode == false">
          <label class="report-form-label">{{'ACCESSCONTROLPOINT.QR_CODE_DATA'|translate}}</label>
          <div class="input-group input-group-sm">
            <input [formControl]="form.get('qrCodeData')" type="text"
              [ngClass]="{'is-invalid': form.get('qrCodeData').invalid}" class="form-control form-control-sm">
            <button class="btn btn-sm btn-success" (click)="onQRCodeReadClicked($event)" [disabled]="!hasCamera"
              title="{{(hasCamera?'QR_CODE.HAS_CAMERA':'QR_CODE.HAS_NO_CAMERA') | translate}}">
              <cds-icon shape="camera" solid class="me-2 cds-icon-18"></cds-icon>{{'BUTTON.READ'|translate}}
            </button>
          </div>
          <ng-template
            *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('qrCodeData'), isArray:false}">
          </ng-template>
        </div>
        <div class="col-12 mb-2">
          <label class="report-form-label">{{'REPORT.DIRECTION'|translate}}</label>
          <nz-select class="w-100" nzSize="small" [formControl]="form.get('config').get('direction')"
            [ngClass]="{'nz-invalid': form.get('config').get('direction').invalid}">
            <nz-option *ngFor="let directionType of directionTypes" [nzValue]="directionType.type" [nzLabel]="(directionType.description |
                  translate)"></nz-option>
          </nz-select>
          <ng-template
            *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form.get('config'), control:form.get('config').get('direction')}">
          </ng-template>
        </div>
        <div class="col-12 mb-2" [hidden]="accessControlPoint.isVirtualPoint">
          <label class="report-form-label">{{'ACCESSCONTROLPOINT.QR_CODE_TRIGGER'|translate}}</label>
          <nz-select class="w-100" nzSize="small" [formControl]="form.get('config').get('trigger').get('type')"
            [ngClass]="{'nz-invalid': form.get('config').get('trigger').get('type').invalid}">
            <nz-option *ngFor="let qrCodeTrigger of qrCodeTriggers" nzCustomContent [nzValue]="qrCodeTrigger.trigger"
              [nzLabel]="(qrCodeTrigger.label | translate)">
              <div class="d-flex flex-column justify-content-center h-100">
                <span class="text-sm">{{qrCodeTrigger.label| translate}}</span>
                <span *ngIf="qrCodeTrigger.description"
                  class="text-xs color-gray text-italic line-height-xs">{{qrCodeTrigger.description| translate}}</span>
              </div>
            </nz-option>
          </nz-select>
          <ng-template
            *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form.get('config').get('trigger'), control:form.get('config').get('trigger').get('type')}">
          </ng-template>
        </div>
        <div class="col-12 py-1 mb-2"
          [hidden]="accessControlPoint.isVirtualPoint || form.get('config').get('trigger').get('validateGeoLocation').disabled">
          <nz-switch nzSize="small" [formControl]="form.get('config').get('trigger').get('validateGeoLocation')">
          </nz-switch>
          <span class="ms-2 text-sm">{{'ACCESSCONTROLPOINT.QR_CODE_VALIDATE_GEOLOCATION'|translate}}</span>
        </div>
        <div class="col-12 py-1 mb-2"
          [hidden]="accessControlPoint.isVirtualPoint || form.get('config').get('trigger').get('userCanChangeTrigger').disabled">
          <nz-switch nzSize="small" [formControl]="form.get('config').get('trigger').get('userCanChangeTrigger')">
          </nz-switch>
          <span
            class="ms-2 text-sm">{{'ACCESSCONTROLPOINT.QR_CODE_VALIDATE_USER_CHANGE_TRIGGER'|translate:languageService.userTranslate}}</span>
        </div>
      </div>
    </form>
  </div>

  <div class="modal-footer">
    <button type="button" class="btn btn-outline-primary me-2"
      (click)="onUpsertCancelClicked($event, modal)">{{'BUTTON.CANCEL' |
      translate}}</button>
    <button type="button" class="btn btn-primary" [disabled]="form.invalid"
      (click)="onUpsertSaveClicked($event, modal)">{{'BUTTON.SAVE' |
      translate}}</button>
  </div>
</ng-template>

<!-- FORM FIELD VALIDATION -->
<ng-template #controlValidationTemplate let-form let-control="control" let-isArray="isArray">
  <ng-container *ngIf="control.errors">
    <div class="invalid-feedback" style="display: initial;">
      <span
        *ngIf="control.errors.required">{{(isArray?'VALIDATION.MIN_ONE_SELECTED':'VALIDATION.REQUIRED')|translate}}</span>
      <span *ngIf="control.errors.numeric">{{'VALIDATION.POSITIVE_NUMBER'|translate}}</span>
      <span *ngIf="control.errors.minNumber" [translate]="'VALIDATION.MIN_VALUE'"
        [translateParams]="{min: control.errors.minNumber.refValues[1]}"></span>
      <span *ngIf="control.errors.maxNumber" [translate]="'VALIDATION.MAX_VALUE'"
        [translateParams]="{max: control.errors.maxNumber.refValues[1]}"></span>
      <span *ngIf="control.errors.unique">{{'VALIDATION.UNIQUE'|translate}}</span>
      <span *ngIf="control.errors.validAccessQRCode">{{'VALIDATION.ACCESS_QR_CODE'|translate}}</span>
    </div>
  </ng-container>
</ng-template>`;var Ri=`.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}.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}:host .form-layout{width:100%!important;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;-webkit-box-pack:start;-moz-box-pack:start;-webkit-flex-pack:start;-ms-flex-pack:start;-moz-justify-content:flex-start;-webkit-justify-content:flex-start;justify-content:flex-start;-webkit-flex-wrap:wrap;-moz-flex-wrap:wrap;flex-wrap:wrap;padding-top:6px;padding-bottom:6px}:host .form-layout>label:not(.custom-item){width:auto;margin-right:12px;min-width:140px}@media screen and (max-width: 576px){:host .form-layout>label:not(.custom-item){width:100%;margin-right:0;margin-bottom:0}}:host .form-layout>label[unit]{margin-left:3px}@media screen and (max-width: 576px){:host .form-layout>label[unit]{flex:0}}:host .form-layout input{flex:1}:host .form-layout .select{flex:1}:host .form-layout textarea{flex:1;margin-right:0}:host .form-layout .form-item{flex:1}:host .form-layout .checkbox{flex:1}:host .form-layout .custom-item{flex:1}:host .form-layout .radio-inline-container{position:relative}:host .form-layout .form-button{margin:0 0 0 12px}:host .form-layout .required:after{content:"*";font-size:1.1em;color:#c92100;margin-left:6px}
`;function Di(r){return r.value==null||r.value==null||r.value==""||Ho(r.value)?null:{validAccessQRCode:!0}}var bi=`<div class="modal-header align-items-center">
    <div class="d-flex me-2 align-items-center">
        <cds-icon shape="camera" size="lg" class="text-primary opacity-25"></cds-icon>
    </div>
    <div class="d-flex flex-column flex-grow-1">
        <span class="text-lg">{{'QR_CODE.READ' | translate}}</span>
    </div>
</div>
<div class="modal-body p-0 bg-dark d-flex justify-content-center align-items-center modal-body-container">
    <ng-container *ngIf="visibleScanner">
        <zxing-scanner [formats]="formatsEnabled" (scanComplete)="scanCompleteHandler($event)"
            [(device)]="currentDevice" (camerasFound)="onCamerasFoundHandler($event)"
            (permissionResponse)="onHasPermissionHandler($event)" (scanSuccess)="scanSuccessHandler($event)">
        </zxing-scanner>
    </ng-container>
    <ng-container *ngIf="!visibleScanner && hasPermission == false">
        <div class="d-flex flex-column align-items-center justify-content-center color-white mt-5">
            <span class="text-lg text-center fw-medium mb-4">{{'QR_CODE.READ_NO_CAMERA_HEADER'|translate}}</span>
            <span class="text-md text-center">{{'QR_CODE.READ_NO_CAMERA_HEADER_INFO'|translate}}</span>
        </div>
    </ng-container>
</div>
<div class="modal-footer">
    <div class="d-flex flex-grow-1 align-items-center" *ngIf="visibleScanner">
        <cds-icon shape="qr-code" size="md" class="text-primary me-2"></cds-icon>
        <div class="spinner-grow spinner-grow-sm ms-2" role="status" *ngIf="!result"></div>
        <ng-container *ngIf="result">
            <span class="d-none d-lg-block text-truncate" style="max-width: 500px;">{{result}}</span>
        </ng-container>
    </div>
    <button class="btn btn-outline-primary" (click)="onCancelClicked($event)">{{'BUTTON.CANCEL' |
        translate}}</button>
    <button class="btn btn-success" (click)="onOKClicked($event)" [disabled]="!result">{{'BUTTON.OK' |
        translate}}</button>
</div>`;var Ni=`.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}.modal-body-container{min-height:500px}zxing-scanner{max-width:100%;max-height:800px}
`;function ys(r,t){var e=Object.setPrototypeOf;e?e(r,t):r.__proto__=t}function Cs(r,t){t===void 0&&(t=r.constructor);var e=Error.captureStackTrace;e&&e(r,t)}var Es=function(){var r=function(e,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(o[a]=i[a])},r(e,n)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Pi=function(r){Es(t,r);function t(e,n){var o=this.constructor,i=r.call(this,e,n)||this;return Object.defineProperty(i,"name",{value:o.name,enumerable:!1,configurable:!0}),ys(i,o.prototype),Cs(i),i}return t}(Error);var As=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ws=function(r){As(t,r);function t(e){e===void 0&&(e=void 0);var n=r.call(this,e)||this;return n.message=e,n}return t.prototype.getKind=function(){var e=this.constructor;return e.kind},t.kind="Exception",t}(Pi),J=ws;var _s=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ss=function(r){_s(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="ArgumentException",t}(J),ft=Ss;var Is=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Os=function(r){Is(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="IllegalArgumentException",t}(J),I=Os;var Ts=function(){function r(t){if(this.binarizer=t,t===null)throw new I("Binarizer must be non-null.")}return r.prototype.getWidth=function(){return this.binarizer.getWidth()},r.prototype.getHeight=function(){return this.binarizer.getHeight()},r.prototype.getBlackRow=function(t,e){return this.binarizer.getBlackRow(t,e)},r.prototype.getBlackMatrix=function(){return(this.matrix===null||this.matrix===void 0)&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},r.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},r.prototype.crop=function(t,e,n,o){var i=this.binarizer.getLuminanceSource().crop(t,e,n,o);return new r(this.binarizer.createBinarizer(i))},r.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},r.prototype.rotateCounterClockwise=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new r(this.binarizer.createBinarizer(t))},r.prototype.rotateCounterClockwise45=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new r(this.binarizer.createBinarizer(t))},r.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return""}},r}(),ur=Ts;var Rs=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ds=function(r){Rs(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.getChecksumInstance=function(){return new t},t.kind="ChecksumException",t}(J),X=Ds;var bs=function(){function r(t){this.source=t}return r.prototype.getLuminanceSource=function(){return this.source},r.prototype.getWidth=function(){return this.source.getWidth()},r.prototype.getHeight=function(){return this.source.getHeight()},r}(),Ln=bs;var Ns=function(){function r(){}return r.arraycopy=function(t,e,n,o,i){for(;i--;)n[o++]=t[e++]},r.currentTimeMillis=function(){return Date.now()},r}(),H=Ns;var Ps=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ms=function(r){Ps(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="IndexOutOfBoundsException",t}(J),We=Ms;var Bs=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Fs=function(r){Bs(t,r);function t(e,n){e===void 0&&(e=void 0),n===void 0&&(n=void 0);var o=r.call(this,n)||this;return o.index=e,o.message=n,o}return t.kind="ArrayIndexOutOfBoundsException",t}(We),kn=Fs;var Ls=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ks=function(){function r(){}return r.fill=function(t,e){for(var n=0,o=t.length;n<o;n++)t[n]=e},r.fillWithin=function(t,e,n,o){r.rangeCheck(t.length,e,n);for(var i=e;i<n;i++)t[i]=o},r.rangeCheck=function(t,e,n){if(e>n)throw new I("fromIndex("+e+") > toIndex("+n+")");if(e<0)throw new kn(e);if(n>t)throw new kn(n)},r.asList=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t},r.create=function(t,e,n){var o=Array.from({length:t});return o.map(function(i){return Array.from({length:e}).fill(n)})},r.createInt32Array=function(t,e,n){var o=Array.from({length:t});return o.map(function(i){return Int32Array.from({length:e}).fill(n)})},r.equals=function(t,e){if(!t||!e||!t.length||!e.length||t.length!==e.length)return!1;for(var n=0,o=t.length;n<o;n++)if(t[n]!==e[n])return!1;return!0},r.hashCode=function(t){var e,n;if(t===null)return 0;var o=1;try{for(var i=Ls(t),a=i.next();!a.done;a=i.next()){var s=a.value;o=31*o+s}}catch(f){e={error:f}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return o},r.fillUint8Array=function(t,e){for(var n=0;n!==t.length;n++)t[n]=e},r.copyOf=function(t,e){return t.slice(0,e)},r.copyOfUint8Array=function(t,e){if(t.length<=e){var n=new Uint8Array(e);return n.set(t),n}return t.slice(0,e)},r.copyOfRange=function(t,e,n){var o=n-e,i=new Int32Array(o);return H.arraycopy(t,e,i,0,o),i},r.binarySearch=function(t,e,n){n===void 0&&(n=r.numberComparator);for(var o=0,i=t.length-1;o<=i;){var a=i+o>>1,s=n(e,t[a]);if(s>0)o=a+1;else if(s<0)i=a-1;else return a}return-o-1},r.numberComparator=function(t,e){return t-e},r}(),Z=ks;var Us=function(){function r(){}return r.numberOfTrailingZeros=function(t){var e;if(t===0)return 32;var n=31;return e=t<<16,e!==0&&(n-=16,t=e),e=t<<8,e!==0&&(n-=8,t=e),e=t<<4,e!==0&&(n-=4,t=e),e=t<<2,e!==0&&(n-=2,t=e),n-(t<<1>>>31)},r.numberOfLeadingZeros=function(t){if(t===0)return 32;var e=1;return t>>>16||(e+=16,t<<=16),t>>>24||(e+=8,t<<=8),t>>>28||(e+=4,t<<=4),t>>>30||(e+=2,t<<=2),e-=t>>>31,e},r.toHexString=function(t){return t.toString(16)},r.toBinaryString=function(t){return String(parseInt(String(t),2))},r.bitCount=function(t){return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),t=t+(t>>>4)&252645135,t=t+(t>>>8),t=t+(t>>>16),t&63},r.truncDivision=function(t,e){return Math.trunc(t/e)},r.parseInt=function(t,e){return e===void 0&&(e=void 0),parseInt(t,e)},r.MIN_VALUE_32_BITS=-2147483648,r.MAX_VALUE=Number.MAX_SAFE_INTEGER,r}(),M=Us;var Vs=function(){function r(t,e){t===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=t,e==null?this.bits=r.makeArray(t):this.bits=e)}return r.prototype.getSize=function(){return this.size},r.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},r.prototype.ensureCapacity=function(t){if(t>this.bits.length*32){var e=r.makeArray(t);H.arraycopy(this.bits,0,e,0,this.bits.length),this.bits=e}},r.prototype.get=function(t){return(this.bits[Math.floor(t/32)]&1<<(t&31))!==0},r.prototype.set=function(t){this.bits[Math.floor(t/32)]|=1<<(t&31)},r.prototype.flip=function(t){this.bits[Math.floor(t/32)]^=1<<(t&31)},r.prototype.getNextSet=function(t){var e=this.size;if(t>=e)return e;var n=this.bits,o=Math.floor(t/32),i=n[o];i&=~((1<<(t&31))-1);for(var a=n.length;i===0;){if(++o===a)return e;i=n[o]}var s=o*32+M.numberOfTrailingZeros(i);return s>e?e:s},r.prototype.getNextUnset=function(t){var e=this.size;if(t>=e)return e;var n=this.bits,o=Math.floor(t/32),i=~n[o];i&=~((1<<(t&31))-1);for(var a=n.length;i===0;){if(++o===a)return e;i=~n[o]}var s=o*32+M.numberOfTrailingZeros(i);return s>e?e:s},r.prototype.setBulk=function(t,e){this.bits[Math.floor(t/32)]=e},r.prototype.setRange=function(t,e){if(e<t||t<0||e>this.size)throw new I;if(e!==t){e--;for(var n=Math.floor(t/32),o=Math.floor(e/32),i=this.bits,a=n;a<=o;a++){var s=a>n?0:t&31,f=a<o?31:e&31,c=(2<<f)-(1<<s);i[a]|=c}}},r.prototype.clear=function(){for(var t=this.bits.length,e=this.bits,n=0;n<t;n++)e[n]=0},r.prototype.isRange=function(t,e,n){if(e<t||t<0||e>this.size)throw new I;if(e===t)return!0;e--;for(var o=Math.floor(t/32),i=Math.floor(e/32),a=this.bits,s=o;s<=i;s++){var f=s>o?0:t&31,c=s<i?31:e&31,u=(2<<c)-(1<<f)&4294967295;if((a[s]&u)!==(n?u:0))return!1}return!0},r.prototype.appendBit=function(t){this.ensureCapacity(this.size+1),t&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++},r.prototype.appendBits=function(t,e){if(e<0||e>32)throw new I("Num bits must be between 0 and 32");this.ensureCapacity(this.size+e);for(var n=e;n>0;n--)this.appendBit((t>>n-1&1)===1)},r.prototype.appendBitArray=function(t){var e=t.size;this.ensureCapacity(this.size+e);for(var n=0;n<e;n++)this.appendBit(t.get(n))},r.prototype.xor=function(t){if(this.size!==t.size)throw new I("Sizes don't match");for(var e=this.bits,n=0,o=e.length;n<o;n++)e[n]^=t.bits[n]},r.prototype.toBytes=function(t,e,n,o){for(var i=0;i<o;i++){for(var a=0,s=0;s<8;s++)this.get(t)&&(a|=1<<7-s),t++;e[n+i]=a}},r.prototype.getBitArray=function(){return this.bits},r.prototype.reverse=function(){for(var t=new Int32Array(this.bits.length),e=Math.floor((this.size-1)/32),n=e+1,o=this.bits,i=0;i<n;i++){var a=o[i];a=a>>1&1431655765|(a&1431655765)<<1,a=a>>2&858993459|(a&858993459)<<2,a=a>>4&252645135|(a&252645135)<<4,a=a>>8&16711935|(a&16711935)<<8,a=a>>16&65535|(a&65535)<<16,t[e-i]=a}if(this.size!==n*32){for(var s=n*32-this.size,f=t[0]>>>s,i=1;i<n;i++){var c=t[i];f|=c<<32-s,t[i-1]=f,f=c>>>s}t[n-1]=f}this.bits=t},r.makeArray=function(t){return new Int32Array(Math.floor((t+31)/32))},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.size===e.size&&Z.equals(this.bits,e.bits)},r.prototype.hashCode=function(){return 31*this.size+Z.hashCode(this.bits)},r.prototype.toString=function(){for(var t="",e=0,n=this.size;e<n;e++)e&7||(t+=" "),t+=this.get(e)?"X":".";return t},r.prototype.clone=function(){return new r(this.size,this.bits.slice())},r.prototype.toArray=function(){for(var t=[],e=0,n=this.size;e<n;e++)t.push(this.get(e));return t},r}(),ot=Vs;var Un;(function(r){r[r.OTHER=0]="OTHER",r[r.PURE_BARCODE=1]="PURE_BARCODE",r[r.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",r[r.TRY_HARDER=3]="TRY_HARDER",r[r.CHARACTER_SET=4]="CHARACTER_SET",r[r.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",r[r.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",r[r.ASSUME_GS1=7]="ASSUME_GS1",r[r.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",r[r.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",r[r.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"})(Un||(Un={}));var L=Un;var Hs=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Gs=function(r){Hs(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.getFormatInstance=function(){return new t},t.kind="FormatException",t}(J),S=Gs;var zs=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},tt;(function(r){r[r.Cp437=0]="Cp437",r[r.ISO8859_1=1]="ISO8859_1",r[r.ISO8859_2=2]="ISO8859_2",r[r.ISO8859_3=3]="ISO8859_3",r[r.ISO8859_4=4]="ISO8859_4",r[r.ISO8859_5=5]="ISO8859_5",r[r.ISO8859_6=6]="ISO8859_6",r[r.ISO8859_7=7]="ISO8859_7",r[r.ISO8859_8=8]="ISO8859_8",r[r.ISO8859_9=9]="ISO8859_9",r[r.ISO8859_10=10]="ISO8859_10",r[r.ISO8859_11=11]="ISO8859_11",r[r.ISO8859_13=12]="ISO8859_13",r[r.ISO8859_14=13]="ISO8859_14",r[r.ISO8859_15=14]="ISO8859_15",r[r.ISO8859_16=15]="ISO8859_16",r[r.SJIS=16]="SJIS",r[r.Cp1250=17]="Cp1250",r[r.Cp1251=18]="Cp1251",r[r.Cp1252=19]="Cp1252",r[r.Cp1256=20]="Cp1256",r[r.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",r[r.UTF8=22]="UTF8",r[r.ASCII=23]="ASCII",r[r.Big5=24]="Big5",r[r.GB18030=25]="GB18030",r[r.EUC_KR=26]="EUC_KR"})(tt||(tt={}));var Ws=function(){function r(t,e,n){for(var o,i,a=[],s=3;s<arguments.length;s++)a[s-3]=arguments[s];this.valueIdentifier=t,this.name=n,typeof e=="number"?this.values=Int32Array.from([e]):this.values=e,this.otherEncodingNames=a,r.VALUE_IDENTIFIER_TO_ECI.set(t,this),r.NAME_TO_ECI.set(n,this);for(var f=this.values,c=0,u=f.length;c!==u;c++){var l=f[c];r.VALUES_TO_ECI.set(l,this)}try{for(var h=zs(a),d=h.next();!d.done;d=h.next()){var p=d.value;r.NAME_TO_ECI.set(p,this)}}catch(v){o={error:v}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}}return r.prototype.getValueIdentifier=function(){return this.valueIdentifier},r.prototype.getName=function(){return this.name},r.prototype.getValue=function(){return this.values[0]},r.getCharacterSetECIByValue=function(t){if(t<0||t>=900)throw new S("incorect value");var e=r.VALUES_TO_ECI.get(t);if(e===void 0)throw new S("incorect value");return e},r.getCharacterSetECIByName=function(t){var e=r.NAME_TO_ECI.get(t);if(e===void 0)throw new S("incorect value");return e},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.getName()===e.getName()},r.VALUE_IDENTIFIER_TO_ECI=new Map,r.VALUES_TO_ECI=new Map,r.NAME_TO_ECI=new Map,r.Cp437=new r(tt.Cp437,Int32Array.from([0,2]),"Cp437"),r.ISO8859_1=new r(tt.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),r.ISO8859_2=new r(tt.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),r.ISO8859_3=new r(tt.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),r.ISO8859_4=new r(tt.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),r.ISO8859_5=new r(tt.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),r.ISO8859_6=new r(tt.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),r.ISO8859_7=new r(tt.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),r.ISO8859_8=new r(tt.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),r.ISO8859_9=new r(tt.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),r.ISO8859_10=new r(tt.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),r.ISO8859_11=new r(tt.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),r.ISO8859_13=new r(tt.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),r.ISO8859_14=new r(tt.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),r.ISO8859_15=new r(tt.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),r.ISO8859_16=new r(tt.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),r.SJIS=new r(tt.SJIS,20,"SJIS","Shift_JIS"),r.Cp1250=new r(tt.Cp1250,21,"Cp1250","windows-1250"),r.Cp1251=new r(tt.Cp1251,22,"Cp1251","windows-1251"),r.Cp1252=new r(tt.Cp1252,23,"Cp1252","windows-1252"),r.Cp1256=new r(tt.Cp1256,24,"Cp1256","windows-1256"),r.UnicodeBigUnmarked=new r(tt.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),r.UTF8=new r(tt.UTF8,26,"UTF8","UTF-8"),r.ASCII=new r(tt.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),r.Big5=new r(tt.Big5,28,"Big5"),r.GB18030=new r(tt.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),r.EUC_KR=new r(tt.EUC_KR,30,"EUC_KR","EUC-KR"),r}(),it=Ws;var Xs=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),js=function(r){Xs(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="UnsupportedOperationException",t}(J),Te=js;var Ys=function(){function r(){}return r.decode=function(t,e){var n=this.encodingName(e);return this.customDecoder?this.customDecoder(t,n):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(n)?this.decodeFallback(t,n):new TextDecoder(n).decode(t)},r.shouldDecodeOnFallback=function(t){return!r.isBrowser()&&t==="ISO-8859-1"},r.encode=function(t,e){var n=this.encodingName(e);return this.customEncoder?this.customEncoder(t,n):typeof TextEncoder>"u"?this.encodeFallback(t):new TextEncoder().encode(t)},r.isBrowser=function(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"},r.encodingName=function(t){return typeof t=="string"?t:t.getName()},r.encodingCharacterSet=function(t){return t instanceof it?t:it.getCharacterSetECIByName(t)},r.decodeFallback=function(t,e){var n=this.encodingCharacterSet(e);if(r.isDecodeFallbackSupported(n)){for(var o="",i=0,a=t.length;i<a;i++){var s=t[i].toString(16);s.length<2&&(s="0"+s),o+="%"+s}return decodeURIComponent(o)}if(n.equals(it.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(t.buffer));throw new Te("Encoding "+this.encodingName(e)+" not supported by fallback.")},r.isDecodeFallbackSupported=function(t){return t.equals(it.UTF8)||t.equals(it.ISO8859_1)||t.equals(it.ASCII)},r.encodeFallback=function(t){for(var e=btoa(unescape(encodeURIComponent(t))),n=e.split(""),o=[],i=0;i<n.length;i++)o.push(n[i].charCodeAt(0));return new Uint8Array(o)},r}(),Ct=Ys;var Zs=function(){function r(){}return r.castAsNonUtf8Char=function(t,e){e===void 0&&(e=null);var n=e?e.getName():this.ISO88591;return Ct.decode(new Uint8Array([t]),n)},r.guessEncoding=function(t,e){if(e!=null&&e.get(L.CHARACTER_SET)!==void 0)return e.get(L.CHARACTER_SET).toString();for(var n=t.length,o=!0,i=!0,a=!0,s=0,f=0,c=0,u=0,l=0,h=0,d=0,p=0,v=0,g=0,y=0,x=t.length>3&&t[0]===239&&t[1]===187&&t[2]===191,C=0;C<n&&(o||i||a);C++){var w=t[C]&255;a&&(s>0?w&128?s--:a=!1:w&128&&(w&64?(s++,w&32?(s++,w&16?(s++,w&8?a=!1:u++):c++):f++):a=!1)),o&&(w>127&&w<160?o=!1:w>159&&(w<192||w===215||w===247)&&y++),i&&(l>0?w<64||w===127||w>252?i=!1:l--:w===128||w===160||w>239?i=!1:w>160&&w<224?(h++,p=0,d++,d>v&&(v=d)):w>127?(l++,d=0,p++,p>g&&(g=p)):(d=0,p=0))}return a&&s>0&&(a=!1),i&&l>0&&(i=!1),a&&(x||f+c+u>0)?r.UTF8:i&&(r.ASSUME_SHIFT_JIS||v>=3||g>=3)?r.SHIFT_JIS:o&&i?v===2&&h===2||y*10>=n?r.SHIFT_JIS:r.ISO88591:o?r.ISO88591:i?r.SHIFT_JIS:a?r.UTF8:r.PLATFORM_DEFAULT_ENCODING},r.format=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=-1;function i(s,f,c,u,l,h){if(s==="%%")return"%";if(e[++o]!==void 0){s=u?parseInt(u.substr(1)):void 0;var d=l?parseInt(l.substr(1)):void 0,p;switch(h){case"s":p=e[o];break;case"c":p=e[o][0];break;case"f":p=parseFloat(e[o]).toFixed(s);break;case"p":p=parseFloat(e[o]).toPrecision(s);break;case"e":p=parseFloat(e[o]).toExponential(s);break;case"x":p=parseInt(e[o]).toString(d||16);break;case"d":p=parseFloat(parseInt(e[o],d||10).toPrecision(s)).toFixed(0);break}p=typeof p=="object"?JSON.stringify(p):(+p).toString(d);for(var v=parseInt(c),g=c&&c[0]+""=="0"?"0":" ";p.length<v;)p=f!==void 0?p+g:g+p;return p}}var a=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return t.replace(a,i)},r.getBytes=function(t,e){return Ct.encode(t,e)},r.getCharCode=function(t,e){return e===void 0&&(e=0),t.charCodeAt(e)},r.getCharAt=function(t){return String.fromCharCode(t)},r.SHIFT_JIS=it.SJIS.getName(),r.GB2312="GB2312",r.ISO88591=it.ISO8859_1.getName(),r.EUC_JP="EUC_JP",r.UTF8=it.UTF8.getName(),r.PLATFORM_DEFAULT_ENCODING=r.UTF8,r.ASSUME_SHIFT_JIS=!1,r}(),F=Zs;var Ks=function(){function r(t){t===void 0&&(t=""),this.value=t}return r.prototype.enableDecoding=function(t){return this.encoding=t,this},r.prototype.append=function(t){return typeof t=="string"?this.value+=t.toString():this.encoding?this.value+=F.castAsNonUtf8Char(t,this.encoding):this.value+=String.fromCharCode(t),this},r.prototype.appendChars=function(t,e,n){for(var o=e;e<e+n;o++)this.append(t[o]);return this},r.prototype.length=function(){return this.value.length},r.prototype.charAt=function(t){return this.value.charAt(t)},r.prototype.deleteCharAt=function(t){this.value=this.value.substr(0,t)+this.value.substring(t+1)},r.prototype.setCharAt=function(t,e){this.value=this.value.substr(0,t)+e+this.value.substr(t+1)},r.prototype.substring=function(t,e){return this.value.substring(t,e)},r.prototype.setLengthToZero=function(){this.value=""},r.prototype.toString=function(){return this.value},r.prototype.insert=function(t,e){this.value=this.value.substring(0,t)+e+this.value.substring(t)},r}(),P=Ks;var Qs=function(){function r(t,e,n,o){if(this.width=t,this.height=e,this.rowSize=n,this.bits=o,e==null&&(e=t),this.height=e,t<1||e<1)throw new I("Both dimensions must be greater than 0");n==null&&(n=Math.floor((t+31)/32)),this.rowSize=n,o==null&&(this.bits=new Int32Array(this.rowSize*this.height))}return r.parseFromBooleanArray=function(t){for(var e=t.length,n=t[0].length,o=new r(n,e),i=0;i<e;i++)for(var a=t[i],s=0;s<n;s++)a[s]&&o.set(s,i);return o},r.parseFromString=function(t,e,n){if(t===null)throw new I("stringRepresentation cannot be null");for(var o=new Array(t.length),i=0,a=0,s=-1,f=0,c=0;c<t.length;)if(t.charAt(c)===`
`||t.charAt(c)==="\r"){if(i>a){if(s===-1)s=i-a;else if(i-a!==s)throw new I("row lengths do not match");a=i,f++}c++}else if(t.substring(c,c+e.length)===e)c+=e.length,o[i]=!0,i++;else if(t.substring(c,c+n.length)===n)c+=n.length,o[i]=!1,i++;else throw new I("illegal character encountered: "+t.substring(c));if(i>a){if(s===-1)s=i-a;else if(i-a!==s)throw new I("row lengths do not match");f++}for(var u=new r(s,f),l=0;l<i;l++)o[l]&&u.set(Math.floor(l%s),Math.floor(l/s));return u},r.prototype.get=function(t,e){var n=e*this.rowSize+Math.floor(t/32);return(this.bits[n]>>>(t&31)&1)!==0},r.prototype.set=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]|=1<<(t&31)&4294967295},r.prototype.unset=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]&=~(1<<(t&31)&4294967295)},r.prototype.flip=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]^=1<<(t&31)&4294967295},r.prototype.xor=function(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize())throw new I("input matrix dimensions do not match");for(var e=new ot(Math.floor(this.width/32)+1),n=this.rowSize,o=this.bits,i=0,a=this.height;i<a;i++)for(var s=i*n,f=t.getRow(i,e).getBitArray(),c=0;c<n;c++)o[s+c]^=f[c]},r.prototype.clear=function(){for(var t=this.bits,e=t.length,n=0;n<e;n++)t[n]=0},r.prototype.setRegion=function(t,e,n,o){if(e<0||t<0)throw new I("Left and top must be nonnegative");if(o<1||n<1)throw new I("Height and width must be at least 1");var i=t+n,a=e+o;if(a>this.height||i>this.width)throw new I("The region must fit inside the matrix");for(var s=this.rowSize,f=this.bits,c=e;c<a;c++)for(var u=c*s,l=t;l<i;l++)f[u+Math.floor(l/32)]|=1<<(l&31)&4294967295},r.prototype.getRow=function(t,e){e==null||e.getSize()<this.width?e=new ot(this.width):e.clear();for(var n=this.rowSize,o=this.bits,i=t*n,a=0;a<n;a++)e.setBulk(a*32,o[i+a]);return e},r.prototype.setRow=function(t,e){H.arraycopy(e.getBitArray(),0,this.bits,t*this.rowSize,this.rowSize)},r.prototype.rotate180=function(){for(var t=this.getWidth(),e=this.getHeight(),n=new ot(t),o=new ot(t),i=0,a=Math.floor((e+1)/2);i<a;i++)n=this.getRow(i,n),o=this.getRow(e-1-i,o),n.reverse(),o.reverse(),this.setRow(i,o),this.setRow(e-1-i,n)},r.prototype.getEnclosingRectangle=function(){for(var t=this.width,e=this.height,n=this.rowSize,o=this.bits,i=t,a=e,s=-1,f=-1,c=0;c<e;c++)for(var u=0;u<n;u++){var l=o[c*n+u];if(l!==0){if(c<a&&(a=c),c>f&&(f=c),u*32<i){for(var h=0;!(l<<31-h&4294967295);)h++;u*32+h<i&&(i=u*32+h)}if(u*32+31>s){for(var h=31;!(l>>>h);)h--;u*32+h>s&&(s=u*32+h)}}}return s<i||f<a?null:Int32Array.from([i,a,s-i+1,f-a+1])},r.prototype.getTopLeftOnBit=function(){for(var t=this.rowSize,e=this.bits,n=0;n<e.length&&e[n]===0;)n++;if(n===e.length)return null;for(var o=n/t,i=n%t*32,a=e[n],s=0;!(a<<31-s&4294967295);)s++;return i+=s,Int32Array.from([i,o])},r.prototype.getBottomRightOnBit=function(){for(var t=this.rowSize,e=this.bits,n=e.length-1;n>=0&&e[n]===0;)n--;if(n<0)return null;for(var o=Math.floor(n/t),i=Math.floor(n%t)*32,a=e[n],s=31;!(a>>>s);)s--;return i+=s,Int32Array.from([i,o])},r.prototype.getWidth=function(){return this.width},r.prototype.getHeight=function(){return this.height},r.prototype.getRowSize=function(){return this.rowSize},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.width===e.width&&this.height===e.height&&this.rowSize===e.rowSize&&Z.equals(this.bits,e.bits)},r.prototype.hashCode=function(){var t=this.width;return t=31*t+this.width,t=31*t+this.height,t=31*t+this.rowSize,t=31*t+Z.hashCode(this.bits),t},r.prototype.toString=function(t,e,n){return t===void 0&&(t="X "),e===void 0&&(e="  "),n===void 0&&(n=`
`),this.buildToString(t,e,n)},r.prototype.buildToString=function(t,e,n){for(var o=new P,i=0,a=this.height;i<a;i++){for(var s=0,f=this.width;s<f;s++)o.append(this.get(s,i)?t:e);o.append(n)}return o.toString()},r.prototype.clone=function(){return new r(this.width,this.height,this.rowSize,this.bits.slice())},r}(),at=Qs;var qs=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),$s=function(r){qs(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.getNotFoundInstance=function(){return new t},t.kind="NotFoundException",t}(J),E=$s;var Js=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),tf=function(r){Js(t,r);function t(e){var n=r.call(this,e)||this;return n.luminances=t.EMPTY,n.buckets=new Int32Array(t.LUMINANCE_BUCKETS),n}return t.prototype.getBlackRow=function(e,n){var o=this.getLuminanceSource(),i=o.getWidth();n==null||n.getSize()<i?n=new ot(i):n.clear(),this.initArrays(i);for(var a=o.getRow(e,this.luminances),s=this.buckets,f=0;f<i;f++)s[(a[f]&255)>>t.LUMINANCE_SHIFT]++;var c=t.estimateBlackPoint(s);if(i<3)for(var f=0;f<i;f++)(a[f]&255)<c&&n.set(f);else for(var u=a[0]&255,l=a[1]&255,f=1;f<i-1;f++){var h=a[f+1]&255;(l*4-u-h)/2<c&&n.set(f),u=l,l=h}return n},t.prototype.getBlackMatrix=function(){var e=this.getLuminanceSource(),n=e.getWidth(),o=e.getHeight(),i=new at(n,o);this.initArrays(n);for(var a=this.buckets,s=1;s<5;s++)for(var f=Math.floor(o*s/5),c=e.getRow(f,this.luminances),u=Math.floor(n*4/5),l=Math.floor(n/5);l<u;l++){var h=c[l]&255;a[h>>t.LUMINANCE_SHIFT]++}for(var d=t.estimateBlackPoint(a),p=e.getMatrix(),s=0;s<o;s++)for(var v=s*n,l=0;l<n;l++){var h=p[v+l]&255;h<d&&i.set(l,s)}return i},t.prototype.createBinarizer=function(e){return new t(e)},t.prototype.initArrays=function(e){this.luminances.length<e&&(this.luminances=new Uint8ClampedArray(e));for(var n=this.buckets,o=0;o<t.LUMINANCE_BUCKETS;o++)n[o]=0},t.estimateBlackPoint=function(e){for(var n=e.length,o=0,i=0,a=0,s=0;s<n;s++)e[s]>a&&(i=s,a=e[s]),e[s]>o&&(o=e[s]);for(var f=0,c=0,s=0;s<n;s++){var u=s-i,l=e[s]*u*u;l>c&&(f=s,c=l)}if(i>f){var h=i;i=f,f=h}if(f-i<=n/16)throw new E;for(var d=f-1,p=-1,s=f-1;s>i;s--){var v=s-i,l=v*v*(f-s)*(o-e[s]);l>p&&(d=s,p=l)}return d<<t.LUMINANCE_SHIFT},t.LUMINANCE_BITS=5,t.LUMINANCE_SHIFT=8-t.LUMINANCE_BITS,t.LUMINANCE_BUCKETS=1<<t.LUMINANCE_BITS,t.EMPTY=Uint8ClampedArray.from([0]),t}(Ln),Vn=tf;var ef=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),rf=function(r){ef(t,r);function t(e){var n=r.call(this,e)||this;return n.matrix=null,n}return t.prototype.getBlackMatrix=function(){if(this.matrix!==null)return this.matrix;var e=this.getLuminanceSource(),n=e.getWidth(),o=e.getHeight();if(n>=t.MINIMUM_DIMENSION&&o>=t.MINIMUM_DIMENSION){var i=e.getMatrix(),a=n>>t.BLOCK_SIZE_POWER;n&t.BLOCK_SIZE_MASK&&a++;var s=o>>t.BLOCK_SIZE_POWER;o&t.BLOCK_SIZE_MASK&&s++;var f=t.calculateBlackPoints(i,a,s,n,o),c=new at(n,o);t.calculateThresholdForBlock(i,a,s,n,o,f,c),this.matrix=c}else this.matrix=r.prototype.getBlackMatrix.call(this);return this.matrix},t.prototype.createBinarizer=function(e){return new t(e)},t.calculateThresholdForBlock=function(e,n,o,i,a,s,f){for(var c=a-t.BLOCK_SIZE,u=i-t.BLOCK_SIZE,l=0;l<o;l++){var h=l<<t.BLOCK_SIZE_POWER;h>c&&(h=c);for(var d=t.cap(l,2,o-3),p=0;p<n;p++){var v=p<<t.BLOCK_SIZE_POWER;v>u&&(v=u);for(var g=t.cap(p,2,n-3),y=0,x=-2;x<=2;x++){var C=s[d+x];y+=C[g-2]+C[g-1]+C[g]+C[g+1]+C[g+2]}var w=y/25;t.thresholdBlock(e,v,h,w,i,f)}}},t.cap=function(e,n,o){return e<n?n:e>o?o:e},t.thresholdBlock=function(e,n,o,i,a,s){for(var f=0,c=o*a+n;f<t.BLOCK_SIZE;f++,c+=a)for(var u=0;u<t.BLOCK_SIZE;u++)(e[c+u]&255)<=i&&s.set(n+u,o+f)},t.calculateBlackPoints=function(e,n,o,i,a){for(var s=a-t.BLOCK_SIZE,f=i-t.BLOCK_SIZE,c=new Array(o),u=0;u<o;u++){c[u]=new Int32Array(n);var l=u<<t.BLOCK_SIZE_POWER;l>s&&(l=s);for(var h=0;h<n;h++){var d=h<<t.BLOCK_SIZE_POWER;d>f&&(d=f);for(var p=0,v=255,g=0,y=0,x=l*i+d;y<t.BLOCK_SIZE;y++,x+=i){for(var C=0;C<t.BLOCK_SIZE;C++){var w=e[x+C]&255;p+=w,w<v&&(v=w),w>g&&(g=w)}if(g-v>t.MIN_DYNAMIC_RANGE)for(y++,x+=i;y<t.BLOCK_SIZE;y++,x+=i)for(var C=0;C<t.BLOCK_SIZE;C++)p+=e[x+C]&255}var _=p>>t.BLOCK_SIZE_POWER*2;if(g-v<=t.MIN_DYNAMIC_RANGE&&(_=v/2,u>0&&h>0)){var O=(c[u-1][h]+2*c[u][h-1]+c[u-1][h-1])/4;v<O&&(_=O)}c[u][h]=_}}return c},t.BLOCK_SIZE_POWER=3,t.BLOCK_SIZE=1<<t.BLOCK_SIZE_POWER,t.BLOCK_SIZE_MASK=t.BLOCK_SIZE-1,t.MINIMUM_DIMENSION=t.BLOCK_SIZE*5,t.MIN_DYNAMIC_RANGE=24,t}(Vn),lr=rf;var nf=function(){function r(t,e){this.width=t,this.height=e}return r.prototype.getWidth=function(){return this.width},r.prototype.getHeight=function(){return this.height},r.prototype.isCropSupported=function(){return!1},r.prototype.crop=function(t,e,n,o){throw new Te("This luminance source does not support cropping.")},r.prototype.isRotateSupported=function(){return!1},r.prototype.rotateCounterClockwise=function(){throw new Te("This luminance source does not support rotation by 90 degrees.")},r.prototype.rotateCounterClockwise45=function(){throw new Te("This luminance source does not support rotation by 45 degrees.")},r.prototype.toString=function(){for(var t=new Uint8ClampedArray(this.width),e=new P,n=0;n<this.height;n++){for(var o=this.getRow(n,t),i=0;i<this.width;i++){var a=o[i]&255,s=void 0;a<64?s="#":a<128?s="+":a<192?s=".":s=" ",e.append(s)}e.append(`
`)}return e.toString()},r}(),Yt=nf;var of=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),af=function(r){of(t,r);function t(e){var n=r.call(this,e.getWidth(),e.getHeight())||this;return n.delegate=e,n}return t.prototype.getRow=function(e,n){for(var o=this.delegate.getRow(e,n),i=this.getWidth(),a=0;a<i;a++)o[a]=255-(o[a]&255);return o},t.prototype.getMatrix=function(){for(var e=this.delegate.getMatrix(),n=this.getWidth()*this.getHeight(),o=new Uint8ClampedArray(n),i=0;i<n;i++)o[i]=255-(e[i]&255);return o},t.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},t.prototype.crop=function(e,n,o,i){return new t(this.delegate.crop(e,n,o,i))},t.prototype.isRotateSupported=function(){return this.delegate.isRotateSupported()},t.prototype.invert=function(){return this.delegate},t.prototype.rotateCounterClockwise=function(){return new t(this.delegate.rotateCounterClockwise())},t.prototype.rotateCounterClockwise45=function(){return new t(this.delegate.rotateCounterClockwise45())},t}(Yt),ne=af;var sf=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Mi=function(r){sf(t,r);function t(e){var n=r.call(this,e.width,e.height)||this;return n.canvas=e,n.tempCanvasElement=null,n.buffer=t.makeBufferFromCanvasImageData(e),n}return t.makeBufferFromCanvasImageData=function(e){var n=e.getContext("2d").getImageData(0,0,e.width,e.height);return t.toGrayscaleBuffer(n.data,e.width,e.height)},t.toGrayscaleBuffer=function(e,n,o){var i=new Uint8ClampedArray(n*o);if(t.FRAME_INDEX=!t.FRAME_INDEX,t.FRAME_INDEX)for(var a=0,s=0,f=e.length;a<f;a+=4,s++){var c=void 0,u=e[a+3];if(u===0)c=255;else{var l=e[a],h=e[a+1],d=e[a+2];c=306*l+601*h+117*d+512>>10}i[s]=c}else for(var a=0,s=0,p=e.length;a<p;a+=4,s++){var c=void 0,u=e[a+3];if(u===0)c=255;else{var l=e[a],h=e[a+1],d=e[a+2];c=306*l+601*h+117*d+512>>10}i[s]=255-c}return i},t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new I("Requested row is outside the image: "+e);var o=this.getWidth(),i=e*o;return n===null?n=this.buffer.slice(i,i+o):(n.length<o&&(n=new Uint8ClampedArray(o)),n.set(this.buffer.slice(i,i+o))),n},t.prototype.getMatrix=function(){return this.buffer},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,n,o,i){return r.prototype.crop.call(this,e,n,o,i),this},t.prototype.isRotateSupported=function(){return!0},t.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},t.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},t.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var e=this.canvas.ownerDocument.createElement("canvas");e.width=this.canvas.width,e.height=this.canvas.height,this.tempCanvasElement=e}return this.tempCanvasElement},t.prototype.rotate=function(e){var n=this.getTempCanvasElement(),o=n.getContext("2d"),i=e*t.DEGREE_TO_RADIANS,a=this.canvas.width,s=this.canvas.height,f=Math.ceil(Math.abs(Math.cos(i))*a+Math.abs(Math.sin(i))*s),c=Math.ceil(Math.abs(Math.sin(i))*a+Math.abs(Math.cos(i))*s);return n.width=f,n.height=c,o.translate(f/2,c/2),o.rotate(i),o.drawImage(this.canvas,a/-2,s/-2),this.buffer=t.makeBufferFromCanvasImageData(n),this},t.prototype.invert=function(){return new ne(this)},t.DEGREE_TO_RADIANS=Math.PI/180,t.FRAME_INDEX=!0,t}(Yt);var Bi=function(){function r(t,e,n){this.deviceId=t,this.label=e,this.kind="videoinput",this.groupId=n||void 0}return r.prototype.toJSON=function(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}},r}();var Dt=function(r,t,e,n){function o(i){return i instanceof e?i:new e(function(a){a(i)})}return new(e||(e=Promise))(function(i,a){function s(u){try{c(n.next(u))}catch(l){a(l)}}function f(u){try{c(n.throw(u))}catch(l){a(l)}}function c(u){u.done?i(u.value):o(u.value).then(s,f)}c((n=n.apply(r,t||[])).next())})},bt=function(r,t){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(u){return f([c,u])}}function f(c){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,o&&(i=c[0]&2?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return e.label++,{value:c[1],done:!1};case 5:e.label++,o=c[1],c=[0];continue;case 7:c=e.ops.pop(),e.trys.pop();continue;default:if(i=e.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){e.label=c[1];break}if(c[0]===6&&e.label<i[1]){e.label=i[1],i=c;break}if(i&&e.label<i[2]){e.label=i[2],e.ops.push(c);break}i[2]&&e.ops.pop(),e.trys.pop();continue}c=t.call(r,e)}catch(u){c=[6,u],o=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},ff=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Gt=function(){function r(t,e,n){e===void 0&&(e=500),this.reader=t,this.timeBetweenScansMillis=e,this._hints=n,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(r.prototype,"hasNavigator",{get:function(){return typeof navigator<"u"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"canEnumerateDevices",{get:function(){return!!(this.isMediaDevicesSuported&&navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(t){this._timeBetweenDecodingAttempts=t<0?0:t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"hints",{get:function(){return this._hints},set:function(t){this._hints=t||null},enumerable:!1,configurable:!0}),r.prototype.listVideoInputDevices=function(){return Dt(this,void 0,void 0,function(){var t,e,n,o,i,a,s,f,c,u,l,h;return bt(this,function(d){switch(d.label){case 0:if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=d.sent(),e=[];try{for(n=ff(t),o=n.next();!o.done;o=n.next())i=o.value,a=i.kind==="video"?"videoinput":i.kind,a==="videoinput"&&(s=i.deviceId||i.id,f=i.label||"Video device "+(e.length+1),c=i.groupId,u={deviceId:s,label:f,kind:a,groupId:c},e.push(u))}catch(p){l={error:p}}finally{try{o&&!o.done&&(h=n.return)&&h.call(n)}finally{if(l)throw l.error}}return[2,e]}})})},r.prototype.getVideoInputDevices=function(){return Dt(this,void 0,void 0,function(){var t;return bt(this,function(e){switch(e.label){case 0:return[4,this.listVideoInputDevices()];case 1:return t=e.sent(),[2,t.map(function(n){return new Bi(n.deviceId,n.label)})]}})})},r.prototype.findDeviceById=function(t){return Dt(this,void 0,void 0,function(){var e;return bt(this,function(n){switch(n.label){case 0:return[4,this.listVideoInputDevices()];case 1:return e=n.sent(),e?[2,e.find(function(o){return o.deviceId===t})]:[2,null]}})})},r.prototype.decodeFromInputVideoDevice=function(t,e){return Dt(this,void 0,void 0,function(){return bt(this,function(n){switch(n.label){case 0:return[4,this.decodeOnceFromVideoDevice(t,e)];case 1:return[2,n.sent()]}})})},r.prototype.decodeOnceFromVideoDevice=function(t,e){return Dt(this,void 0,void 0,function(){var n,o;return bt(this,function(i){switch(i.label){case 0:return this.reset(),t?n={deviceId:{exact:t}}:n={facingMode:"environment"},o={video:n},[4,this.decodeOnceFromConstraints(o,e)];case 1:return[2,i.sent()]}})})},r.prototype.decodeOnceFromConstraints=function(t,e){return Dt(this,void 0,void 0,function(){var n;return bt(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return n=o.sent(),[4,this.decodeOnceFromStream(n,e)];case 2:return[2,o.sent()]}})})},r.prototype.decodeOnceFromStream=function(t,e){return Dt(this,void 0,void 0,function(){var n,o;return bt(this,function(i){switch(i.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return n=i.sent(),[4,this.decodeOnce(n)];case 2:return o=i.sent(),[2,o]}})})},r.prototype.decodeFromInputVideoDeviceContinuously=function(t,e,n){return Dt(this,void 0,void 0,function(){return bt(this,function(o){switch(o.label){case 0:return[4,this.decodeFromVideoDevice(t,e,n)];case 1:return[2,o.sent()]}})})},r.prototype.decodeFromVideoDevice=function(t,e,n){return Dt(this,void 0,void 0,function(){var o,i;return bt(this,function(a){switch(a.label){case 0:return t?o={deviceId:{exact:t}}:o={facingMode:"environment"},i={video:o},[4,this.decodeFromConstraints(i,e,n)];case 1:return[2,a.sent()]}})})},r.prototype.decodeFromConstraints=function(t,e,n){return Dt(this,void 0,void 0,function(){var o;return bt(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return o=i.sent(),[4,this.decodeFromStream(o,e,n)];case 2:return[2,i.sent()]}})})},r.prototype.decodeFromStream=function(t,e,n){return Dt(this,void 0,void 0,function(){var o;return bt(this,function(i){switch(i.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return o=i.sent(),[4,this.decodeContinuously(o,n)];case 2:return[2,i.sent()]}})})},r.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},r.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},r.prototype.attachStreamToVideo=function(t,e){return Dt(this,void 0,void 0,function(){var n;return bt(this,function(o){switch(o.label){case 0:return n=this.prepareVideoElement(e),this.addVideoSource(n,t),this.videoElement=n,this.stream=t,[4,this.playVideoOnLoadAsync(n)];case 1:return o.sent(),[2,n]}})})},r.prototype.playVideoOnLoadAsync=function(t){var e=this;return new Promise(function(n,o){return e.playVideoOnLoad(t,function(){return n()})})},r.prototype.playVideoOnLoad=function(t,e){var n=this;this.videoEndedListener=function(){return n.stopStreams()},this.videoCanPlayListener=function(){return n.tryPlayVideo(t)},t.addEventListener("ended",this.videoEndedListener),t.addEventListener("canplay",this.videoCanPlayListener),t.addEventListener("playing",e),this.tryPlayVideo(t)},r.prototype.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&!t.ended&&t.readyState>2},r.prototype.tryPlayVideo=function(t){return Dt(this,void 0,void 0,function(){var e;return bt(this,function(n){switch(n.label){case 0:if(this.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.play()];case 2:return n.sent(),[3,4];case 3:return e=n.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},r.prototype.getMediaElement=function(t,e){var n=document.getElementById(t);if(!n)throw new ft("element with id '"+t+"' not found");if(n.nodeName.toLowerCase()!==e.toLowerCase())throw new ft("element with id '"+t+"' must be an "+e+" element");return n},r.prototype.decodeFromImage=function(t,e){if(!t&&!e)throw new ft("either imageElement with a src set or an url must be provided");return e&&!t?this.decodeFromImageUrl(e):this.decodeFromImageElement(t)},r.prototype.decodeFromVideo=function(t,e){if(!t&&!e)throw new ft("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrl(e):this.decodeFromVideoElement(t)},r.prototype.decodeFromVideoContinuously=function(t,e,n){if(t===void 0&&e===void 0)throw new ft("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrlContinuously(e,n):this.decodeFromVideoElementContinuously(t,n)},r.prototype.decodeFromImageElement=function(t){if(!t)throw new ft("An image element must be provided.");this.reset();var e=this.prepareImageElement(t);this.imageElement=e;var n;return this.isImageLoaded(e)?n=this.decodeOnce(e,!1,!0):n=this._decodeOnLoadImage(e),n},r.prototype.decodeFromVideoElement=function(t){var e=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideo(e)},r.prototype.decodeFromVideoElementContinuously=function(t,e){var n=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideoContinuously(n,e)},r.prototype._decodeFromVideoElementSetup=function(t){if(!t)throw new ft("A video element must be provided.");this.reset();var e=this.prepareVideoElement(t);return this.videoElement=e,e},r.prototype.decodeFromImageUrl=function(t){if(!t)throw new ft("An URL must be provided.");this.reset();var e=this.prepareImageElement();this.imageElement=e;var n=this._decodeOnLoadImage(e);return e.src=t,n},r.prototype.decodeFromVideoUrl=function(t){if(!t)throw new ft("An URL must be provided.");this.reset();var e=this.prepareVideoElement(),n=this.decodeFromVideoElement(e);return e.src=t,n},r.prototype.decodeFromVideoUrlContinuously=function(t,e){if(!t)throw new ft("An URL must be provided.");this.reset();var n=this.prepareVideoElement(),o=this.decodeFromVideoElementContinuously(n,e);return n.src=t,o},r.prototype._decodeOnLoadImage=function(t){var e=this;return new Promise(function(n,o){e.imageLoadedListener=function(){return e.decodeOnce(t,!1,!0).then(n,o)},t.addEventListener("load",e.imageLoadedListener)})},r.prototype._decodeOnLoadVideo=function(t){return Dt(this,void 0,void 0,function(){return bt(this,function(e){switch(e.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return e.sent(),[4,this.decodeOnce(t)];case 2:return[2,e.sent()]}})})},r.prototype._decodeOnLoadVideoContinuously=function(t,e){return Dt(this,void 0,void 0,function(){return bt(this,function(n){switch(n.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return n.sent(),this.decodeContinuously(t,e),[2]}})})},r.prototype.isImageLoaded=function(t){return!(!t.complete||t.naturalWidth===0)},r.prototype.prepareImageElement=function(t){var e;return typeof t>"u"&&(e=document.createElement("img"),e.width=200,e.height=200),typeof t=="string"&&(e=this.getMediaElement(t,"img")),t instanceof HTMLImageElement&&(e=t),e},r.prototype.prepareVideoElement=function(t){var e;return!t&&typeof document<"u"&&(e=document.createElement("video"),e.width=200,e.height=200),typeof t=="string"&&(e=this.getMediaElement(t,"video")),t instanceof HTMLVideoElement&&(e=t),e.setAttribute("autoplay","true"),e.setAttribute("muted","true"),e.setAttribute("playsinline","true"),e},r.prototype.decodeOnce=function(t,e,n){var o=this;e===void 0&&(e=!0),n===void 0&&(n=!0),this._stopAsyncDecode=!1;var i=function(a,s){if(o._stopAsyncDecode){s(new E("Video stream has ended before any code could be detected.")),o._stopAsyncDecode=void 0;return}try{var f=o.decode(t);a(f)}catch(h){var c=e&&h instanceof E,u=h instanceof X||h instanceof S,l=u&&n;if(c||l)return setTimeout(i,o._timeBetweenDecodingAttempts,a,s);s(h)}};return new Promise(function(a,s){return i(a,s)})},r.prototype.decodeContinuously=function(t,e){var n=this;this._stopContinuousDecode=!1;var o=function(){if(n._stopContinuousDecode){n._stopContinuousDecode=void 0;return}try{var i=n.decode(t);e(i,null),setTimeout(o,n.timeBetweenScansMillis)}catch(f){e(null,f);var a=f instanceof X||f instanceof S,s=f instanceof E;(a||s)&&setTimeout(o,n._timeBetweenDecodingAttempts)}};o()},r.prototype.decode=function(t){var e=this.createBinaryBitmap(t);return this.decodeBitmap(e)},r.prototype.createBinaryBitmap=function(t){var e=this.getCaptureCanvasContext(t);t instanceof HTMLVideoElement?this.drawFrameOnCanvas(t):this.drawImageOnCanvas(t);var n=this.getCaptureCanvas(t),o=new Mi(n),i=new lr(o);return new ur(i)},r.prototype.getCaptureCanvasContext=function(t){if(!this.captureCanvasContext){var e=this.getCaptureCanvas(t),n=void 0;try{n=e.getContext("2d",{willReadFrequently:!0})}catch{n=e.getContext("2d")}this.captureCanvasContext=n}return this.captureCanvasContext},r.prototype.getCaptureCanvas=function(t){if(!this.captureCanvas){var e=this.createCaptureCanvas(t);this.captureCanvas=e}return this.captureCanvas},r.prototype.drawFrameOnCanvas=function(t,e,n){e===void 0&&(e={sx:0,sy:0,sWidth:t.videoWidth,sHeight:t.videoHeight,dx:0,dy:0,dWidth:t.videoWidth,dHeight:t.videoHeight}),n===void 0&&(n=this.captureCanvasContext),n.drawImage(t,e.sx,e.sy,e.sWidth,e.sHeight,e.dx,e.dy,e.dWidth,e.dHeight)},r.prototype.drawImageOnCanvas=function(t,e,n){e===void 0&&(e={sx:0,sy:0,sWidth:t.naturalWidth,sHeight:t.naturalHeight,dx:0,dy:0,dWidth:t.naturalWidth,dHeight:t.naturalHeight}),n===void 0&&(n=this.captureCanvasContext),n.drawImage(t,e.sx,e.sy,e.sWidth,e.sHeight,e.dx,e.dy,e.dWidth,e.dHeight)},r.prototype.decodeBitmap=function(t){return this.reader.decode(t,this._hints)},r.prototype.createCaptureCanvas=function(t){if(typeof document>"u")return this._destroyCaptureCanvas(),null;var e=document.createElement("canvas"),n,o;return typeof t<"u"&&(t instanceof HTMLVideoElement?(n=t.videoWidth,o=t.videoHeight):t instanceof HTMLImageElement&&(n=t.naturalWidth||t.width,o=t.naturalHeight||t.height)),e.style.width=n+"px",e.style.height=o+"px",e.width=n,e.height=o,e},r.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(t){return t.stop()}),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()},r.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},r.prototype._destroyVideoElement=function(){this.videoElement&&(typeof this.videoEndedListener<"u"&&this.videoElement.removeEventListener("ended",this.videoEndedListener),typeof this.videoPlayingEventListener<"u"&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),typeof this.videoCanPlayListener<"u"&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},r.prototype._destroyImageElement=function(){this.imageElement&&(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},r.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},r.prototype.addVideoSource=function(t,e){try{t.srcObject=e}catch{t.src=URL.createObjectURL(e)}},r.prototype.cleanVideoSource=function(t){try{t.srcObject=null}catch{t.src=""}this.videoElement.removeAttribute("src")},r}();var cf=function(){function r(t,e,n,o,i,a){n===void 0&&(n=e==null?0:8*e.length),a===void 0&&(a=H.currentTimeMillis()),this.text=t,this.rawBytes=e,this.numBits=n,this.resultPoints=o,this.format=i,this.timestamp=a,this.text=t,this.rawBytes=e,n==null?this.numBits=e==null?0:8*e.length:this.numBits=n,this.resultPoints=o,this.format=i,this.resultMetadata=null,a==null?this.timestamp=H.currentTimeMillis():this.timestamp=a}return r.prototype.getText=function(){return this.text},r.prototype.getRawBytes=function(){return this.rawBytes},r.prototype.getNumBits=function(){return this.numBits},r.prototype.getResultPoints=function(){return this.resultPoints},r.prototype.getBarcodeFormat=function(){return this.format},r.prototype.getResultMetadata=function(){return this.resultMetadata},r.prototype.putMetadata=function(t,e){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(t,e)},r.prototype.putAllMetadata=function(t){t!==null&&(this.resultMetadata===null?this.resultMetadata=t:this.resultMetadata=new Map(t))},r.prototype.addResultPoints=function(t){var e=this.resultPoints;if(e===null)this.resultPoints=t;else if(t!==null&&t.length>0){var n=new Array(e.length+t.length);H.arraycopy(e,0,n,0,e.length),H.arraycopy(t,0,n,e.length,t.length),this.resultPoints=n}},r.prototype.getTimestamp=function(){return this.timestamp},r.prototype.toString=function(){return this.text},r}(),Y=cf;var Hn;(function(r){r[r.AZTEC=0]="AZTEC",r[r.CODABAR=1]="CODABAR",r[r.CODE_39=2]="CODE_39",r[r.CODE_93=3]="CODE_93",r[r.CODE_128=4]="CODE_128",r[r.DATA_MATRIX=5]="DATA_MATRIX",r[r.EAN_8=6]="EAN_8",r[r.EAN_13=7]="EAN_13",r[r.ITF=8]="ITF",r[r.MAXICODE=9]="MAXICODE",r[r.PDF_417=10]="PDF_417",r[r.QR_CODE=11]="QR_CODE",r[r.RSS_14=12]="RSS_14",r[r.RSS_EXPANDED=13]="RSS_EXPANDED",r[r.UPC_A=14]="UPC_A",r[r.UPC_E=15]="UPC_E",r[r.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(Hn||(Hn={}));var T=Hn;var Gn;(function(r){r[r.OTHER=0]="OTHER",r[r.ORIENTATION=1]="ORIENTATION",r[r.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",r[r.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",r[r.ISSUE_NUMBER=4]="ISSUE_NUMBER",r[r.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",r[r.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",r[r.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",r[r.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",r[r.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",r[r.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(Gn||(Gn={}));var st=Gn;var uf=function(){function r(t,e,n,o,i,a){i===void 0&&(i=-1),a===void 0&&(a=-1),this.rawBytes=t,this.text=e,this.byteSegments=n,this.ecLevel=o,this.structuredAppendSequenceNumber=i,this.structuredAppendParity=a,this.numBits=t==null?0:8*t.length}return r.prototype.getRawBytes=function(){return this.rawBytes},r.prototype.getNumBits=function(){return this.numBits},r.prototype.setNumBits=function(t){this.numBits=t},r.prototype.getText=function(){return this.text},r.prototype.getByteSegments=function(){return this.byteSegments},r.prototype.getECLevel=function(){return this.ecLevel},r.prototype.getErrorsCorrected=function(){return this.errorsCorrected},r.prototype.setErrorsCorrected=function(t){this.errorsCorrected=t},r.prototype.getErasures=function(){return this.erasures},r.prototype.setErasures=function(t){this.erasures=t},r.prototype.getOther=function(){return this.other},r.prototype.setOther=function(t){this.other=t},r.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},r.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},r.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},r}(),oe=uf;var lf=function(){function r(){}return r.prototype.exp=function(t){return this.expTable[t]},r.prototype.log=function(t){if(t===0)throw new I;return this.logTable[t]},r.addOrSubtract=function(t,e){return t^e},r}(),Re=lf;var hf=function(){function r(t,e){if(e.length===0)throw new I;this.field=t;var n=e.length;if(n>1&&e[0]===0){for(var o=1;o<n&&e[o]===0;)o++;o===n?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(n-o),H.arraycopy(e,o,this.coefficients,0,this.coefficients.length))}else this.coefficients=e}return r.prototype.getCoefficients=function(){return this.coefficients},r.prototype.getDegree=function(){return this.coefficients.length-1},r.prototype.isZero=function(){return this.coefficients[0]===0},r.prototype.getCoefficient=function(t){return this.coefficients[this.coefficients.length-1-t]},r.prototype.evaluateAt=function(t){if(t===0)return this.getCoefficient(0);var e=this.coefficients,n;if(t===1){n=0;for(var o=0,i=e.length;o!==i;o++){var a=e[o];n=Re.addOrSubtract(n,a)}return n}n=e[0];for(var s=e.length,f=this.field,o=1;o<s;o++)n=Re.addOrSubtract(f.multiply(t,n),e[o]);return n},r.prototype.addOrSubtract=function(t){if(!this.field.equals(t.field))throw new I("GenericGFPolys do not have same GenericGF field");if(this.isZero())return t;if(t.isZero())return this;var e=this.coefficients,n=t.coefficients;if(e.length>n.length){var o=e;e=n,n=o}var i=new Int32Array(n.length),a=n.length-e.length;H.arraycopy(n,0,i,0,a);for(var s=a;s<n.length;s++)i[s]=Re.addOrSubtract(e[s-a],n[s]);return new r(this.field,i)},r.prototype.multiply=function(t){if(!this.field.equals(t.field))throw new I("GenericGFPolys do not have same GenericGF field");if(this.isZero()||t.isZero())return this.field.getZero();for(var e=this.coefficients,n=e.length,o=t.coefficients,i=o.length,a=new Int32Array(n+i-1),s=this.field,f=0;f<n;f++)for(var c=e[f],u=0;u<i;u++)a[f+u]=Re.addOrSubtract(a[f+u],s.multiply(c,o[u]));return new r(s,a)},r.prototype.multiplyScalar=function(t){if(t===0)return this.field.getZero();if(t===1)return this;for(var e=this.coefficients.length,n=this.field,o=new Int32Array(e),i=this.coefficients,a=0;a<e;a++)o[a]=n.multiply(i[a],t);return new r(n,o)},r.prototype.multiplyByMonomial=function(t,e){if(t<0)throw new I;if(e===0)return this.field.getZero();for(var n=this.coefficients,o=n.length,i=new Int32Array(o+t),a=this.field,s=0;s<o;s++)i[s]=a.multiply(n[s],e);return new r(a,i)},r.prototype.divide=function(t){if(!this.field.equals(t.field))throw new I("GenericGFPolys do not have same GenericGF field");if(t.isZero())throw new I("Divide by 0");for(var e=this.field,n=e.getZero(),o=this,i=t.getCoefficient(t.getDegree()),a=e.inverse(i);o.getDegree()>=t.getDegree()&&!o.isZero();){var s=o.getDegree()-t.getDegree(),f=e.multiply(o.getCoefficient(o.getDegree()),a),c=t.multiplyByMonomial(s,f),u=e.buildMonomial(s,f);n=n.addOrSubtract(u),o=o.addOrSubtract(c)}return[n,o]},r.prototype.toString=function(){for(var t="",e=this.getDegree();e>=0;e--){var n=this.getCoefficient(e);if(n!==0){if(n<0?(t+=" - ",n=-n):t.length>0&&(t+=" + "),e===0||n!==1){var o=this.field.log(n);o===0?t+="1":o===1?t+="a":(t+="a^",t+=o)}e!==0&&(e===1?t+="x":(t+="x^",t+=e))}}return t},r}(),zt=hf;var df=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),pf=function(r){df(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="ArithmeticException",t}(J),hr=pf;var vf=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),mf=function(r){vf(t,r);function t(e,n,o){var i=r.call(this)||this;i.primitive=e,i.size=n,i.generatorBase=o;for(var a=new Int32Array(n),s=1,f=0;f<n;f++)a[f]=s,s*=2,s>=n&&(s^=e,s&=n-1);i.expTable=a;for(var c=new Int32Array(n),f=0;f<n-1;f++)c[a[f]]=f;return i.logTable=c,i.zero=new zt(i,Int32Array.from([0])),i.one=new zt(i,Int32Array.from([1])),i}return t.prototype.getZero=function(){return this.zero},t.prototype.getOne=function(){return this.one},t.prototype.buildMonomial=function(e,n){if(e<0)throw new I;if(n===0)return this.zero;var o=new Int32Array(e+1);return o[0]=n,new zt(this,o)},t.prototype.inverse=function(e){if(e===0)throw new hr;return this.expTable[this.size-this.logTable[e]-1]},t.prototype.multiply=function(e,n){return e===0||n===0?0:this.expTable[(this.logTable[e]+this.logTable[n])%(this.size-1)]},t.prototype.getSize=function(){return this.size},t.prototype.getGeneratorBase=function(){return this.generatorBase},t.prototype.toString=function(){return"GF(0x"+M.toHexString(this.primitive)+","+this.size+")"},t.prototype.equals=function(e){return e===this},t.AZTEC_DATA_12=new t(4201,4096,1),t.AZTEC_DATA_10=new t(1033,1024,1),t.AZTEC_DATA_6=new t(67,64,1),t.AZTEC_PARAM=new t(19,16,1),t.QR_CODE_FIELD_256=new t(285,256,0),t.DATA_MATRIX_FIELD_256=new t(301,256,1),t.AZTEC_DATA_8=t.DATA_MATRIX_FIELD_256,t.MAXICODE_FIELD_64=t.AZTEC_DATA_6,t}(Re),dt=mf;var gf=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),xf=function(r){gf(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="ReedSolomonException",t}(J),Xe=xf;var yf=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Cf=function(r){yf(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="IllegalStateException",t}(J),mt=Cf;var Ef=function(){function r(t){this.field=t}return r.prototype.decode=function(t,e){for(var n=this.field,o=new zt(n,t),i=new Int32Array(e),a=!0,s=0;s<e;s++){var f=o.evaluateAt(n.exp(s+n.getGeneratorBase()));i[i.length-1-s]=f,f!==0&&(a=!1)}if(!a)for(var c=new zt(n,i),u=this.runEuclideanAlgorithm(n.buildMonomial(e,1),c,e),l=u[0],h=u[1],d=this.findErrorLocations(l),p=this.findErrorMagnitudes(h,d),s=0;s<d.length;s++){var v=t.length-1-n.log(d[s]);if(v<0)throw new Xe("Bad error location");t[v]=dt.addOrSubtract(t[v],p[s])}},r.prototype.runEuclideanAlgorithm=function(t,e,n){if(t.getDegree()<e.getDegree()){var o=t;t=e,e=o}for(var i=this.field,a=t,s=e,f=i.getZero(),c=i.getOne();s.getDegree()>=(n/2|0);){var u=a,l=f;if(a=s,f=c,a.isZero())throw new Xe("r_{i-1} was zero");s=u;for(var h=i.getZero(),d=a.getCoefficient(a.getDegree()),p=i.inverse(d);s.getDegree()>=a.getDegree()&&!s.isZero();){var v=s.getDegree()-a.getDegree(),g=i.multiply(s.getCoefficient(s.getDegree()),p);h=h.addOrSubtract(i.buildMonomial(v,g)),s=s.addOrSubtract(a.multiplyByMonomial(v,g))}if(c=h.multiply(f).addOrSubtract(l),s.getDegree()>=a.getDegree())throw new mt("Division algorithm failed to reduce polynomial?")}var y=c.getCoefficient(0);if(y===0)throw new Xe("sigmaTilde(0) was zero");var x=i.inverse(y),C=c.multiplyScalar(x),w=s.multiplyScalar(x);return[C,w]},r.prototype.findErrorLocations=function(t){var e=t.getDegree();if(e===1)return Int32Array.from([t.getCoefficient(1)]);for(var n=new Int32Array(e),o=0,i=this.field,a=1;a<i.getSize()&&o<e;a++)t.evaluateAt(a)===0&&(n[o]=i.inverse(a),o++);if(o!==e)throw new Xe("Error locator degree does not match number of roots");return n},r.prototype.findErrorMagnitudes=function(t,e){for(var n=e.length,o=new Int32Array(n),i=this.field,a=0;a<n;a++){for(var s=i.inverse(e[a]),f=1,c=0;c<n;c++)if(a!==c){var u=i.multiply(e[c],s),l=u&1?u&-2:u|1;f=i.multiply(f,l)}o[a]=i.multiply(t.evaluateAt(s),i.inverse(f)),i.getGeneratorBase()!==0&&(o[a]=i.multiply(o[a],s))}return o},r}(),ie=Ef;var St;(function(r){r[r.UPPER=0]="UPPER",r[r.LOWER=1]="LOWER",r[r.MIXED=2]="MIXED",r[r.DIGIT=3]="DIGIT",r[r.PUNCT=4]="PUNCT",r[r.BINARY=5]="BINARY"})(St||(St={}));var Af=function(){function r(){}return r.prototype.decode=function(t){this.ddata=t;var e=t.getBits(),n=this.extractBits(e),o=this.correctBits(n),i=r.convertBoolArrayToByteArray(o),a=r.getEncodedData(o),s=new oe(i,a,null,null);return s.setNumBits(o.length),s},r.highLevelDecode=function(t){return this.getEncodedData(t)},r.getEncodedData=function(t){for(var e=t.length,n=St.UPPER,o=St.UPPER,i="",a=0;a<e;)if(o===St.BINARY){if(e-a<5)break;var s=r.readCode(t,a,5);if(a+=5,s===0){if(e-a<11)break;s=r.readCode(t,a,11)+31,a+=11}for(var f=0;f<s;f++){if(e-a<8){a=e;break}var c=r.readCode(t,a,8);i+=F.castAsNonUtf8Char(c),a+=8}o=n}else{var u=o===St.DIGIT?4:5;if(e-a<u)break;var c=r.readCode(t,a,u);a+=u;var l=r.getCharacter(o,c);l.startsWith("CTRL_")?(n=o,o=r.getTable(l.charAt(5)),l.charAt(6)==="L"&&(n=o)):(i+=l,o=n)}return i},r.getTable=function(t){switch(t){case"L":return St.LOWER;case"P":return St.PUNCT;case"M":return St.MIXED;case"D":return St.DIGIT;case"B":return St.BINARY;case"U":default:return St.UPPER}},r.getCharacter=function(t,e){switch(t){case St.UPPER:return r.UPPER_TABLE[e];case St.LOWER:return r.LOWER_TABLE[e];case St.MIXED:return r.MIXED_TABLE[e];case St.PUNCT:return r.PUNCT_TABLE[e];case St.DIGIT:return r.DIGIT_TABLE[e];default:throw new mt("Bad table")}},r.prototype.correctBits=function(t){var e,n;this.ddata.getNbLayers()<=2?(n=6,e=dt.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(n=8,e=dt.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(n=10,e=dt.AZTEC_DATA_10):(n=12,e=dt.AZTEC_DATA_12);var o=this.ddata.getNbDatablocks(),i=t.length/n;if(i<o)throw new S;for(var a=t.length%n,s=new Int32Array(i),f=0;f<i;f++,a+=n)s[f]=r.readCode(t,a,n);try{var c=new ie(e);c.decode(s,i-o)}catch(g){throw new S(g)}for(var u=(1<<n)-1,l=0,f=0;f<o;f++){var h=s[f];if(h===0||h===u)throw new S;(h===1||h===u-1)&&l++}for(var d=new Array(o*n-l),p=0,f=0;f<o;f++){var h=s[f];if(h===1||h===u-1)d.fill(h>1,p,p+n-1),p+=n-1;else for(var v=n-1;v>=0;--v)d[p++]=(h&1<<v)!==0}return d},r.prototype.extractBits=function(t){var e=this.ddata.isCompact(),n=this.ddata.getNbLayers(),o=(e?11:14)+n*4,i=new Int32Array(o),a=new Array(this.totalBitsInLayer(n,e));if(e)for(var s=0;s<i.length;s++)i[s]=s;else for(var f=o+1+2*M.truncDivision(M.truncDivision(o,2)-1,15),c=o/2,u=M.truncDivision(f,2),s=0;s<c;s++){var l=s+M.truncDivision(s,15);i[c-s-1]=u-l-1,i[c+s]=u+l+1}for(var s=0,h=0;s<n;s++){for(var d=(n-s)*4+(e?9:12),p=s*2,v=o-1-p,g=0;g<d;g++)for(var y=g*2,x=0;x<2;x++)a[h+y+x]=t.get(i[p+x],i[p+g]),a[h+2*d+y+x]=t.get(i[p+g],i[v-x]),a[h+4*d+y+x]=t.get(i[v-x],i[v-g]),a[h+6*d+y+x]=t.get(i[v-g],i[p+x]);h+=d*8}return a},r.readCode=function(t,e,n){for(var o=0,i=e;i<e+n;i++)o<<=1,t[i]&&(o|=1);return o},r.readByte=function(t,e){var n=t.length-e;return n>=8?r.readCode(t,e,8):r.readCode(t,e,n)<<8-n},r.convertBoolArrayToByteArray=function(t){for(var e=new Uint8Array((t.length+7)/8),n=0;n<e.length;n++)e[n]=r.readByte(t,8*n);return e},r.prototype.totalBitsInLayer=function(t,e){return((e?88:112)+16*t)*t},r.UPPER_TABLE=["CTRL_PS"," ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"],r.LOWER_TABLE=["CTRL_PS"," ","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"],r.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b","	",`
`,"\\13","\f","\r","\\33","\\34","\\35","\\36","\\37","@","\\","^","_","`","|","~","\\177","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],r.PUNCT_TABLE=["","\r",`\r
`,". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],r.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],r}(),Yr=Af;var wf=function(){function r(){}return r.round=function(t){return isNaN(t)?0:t<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:t>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t+(t<0?-.5:.5)|0},r.distance=function(t,e,n,o){var i=t-n,a=e-o;return Math.sqrt(i*i+a*a)},r.sum=function(t){for(var e=0,n=0,o=t.length;n!==o;n++){var i=t[n];e+=i}return e},r}(),G=wf;var _f=function(){function r(){}return r.floatToIntBits=function(t){return t},r.MAX_VALUE=Number.MAX_SAFE_INTEGER,r}(),dr=_f;var Sf=function(){function r(t,e){this.x=t,this.y=e}return r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.equals=function(t){if(t instanceof r){var e=t;return this.x===e.x&&this.y===e.y}return!1},r.prototype.hashCode=function(){return 31*dr.floatToIntBits(this.x)+dr.floatToIntBits(this.y)},r.prototype.toString=function(){return"("+this.x+","+this.y+")"},r.orderBestPatterns=function(t){var e=this.distance(t[0],t[1]),n=this.distance(t[1],t[2]),o=this.distance(t[0],t[2]),i,a,s;if(n>=e&&n>=o?(a=t[0],i=t[1],s=t[2]):o>=n&&o>=e?(a=t[1],i=t[0],s=t[2]):(a=t[2],i=t[0],s=t[1]),this.crossProductZ(i,a,s)<0){var f=i;i=s,s=f}t[0]=i,t[1]=a,t[2]=s},r.distance=function(t,e){return G.distance(t.x,t.y,e.x,e.y)},r.crossProductZ=function(t,e,n){var o=e.x,i=e.y;return(n.x-o)*(t.y-i)-(n.y-i)*(t.x-o)},r}(),D=Sf;var If=function(){function r(t,e){this.bits=t,this.points=e}return r.prototype.getBits=function(){return this.bits},r.prototype.getPoints=function(){return this.points},r}(),De=If;var Of=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Tf=function(r){Of(t,r);function t(e,n,o,i,a){var s=r.call(this,e,n)||this;return s.compact=o,s.nbDatablocks=i,s.nbLayers=a,s}return t.prototype.getNbLayers=function(){return this.nbLayers},t.prototype.getNbDatablocks=function(){return this.nbDatablocks},t.prototype.isCompact=function(){return this.compact},t}(De),zn=Tf;var Rf=function(){function r(t,e,n,o){this.image=t,this.height=t.getHeight(),this.width=t.getWidth(),e==null&&(e=r.INIT_SIZE),n==null&&(n=t.getWidth()/2|0),o==null&&(o=t.getHeight()/2|0);var i=e/2|0;if(this.leftInit=n-i,this.rightInit=n+i,this.upInit=o-i,this.downInit=o+i,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new E}return r.prototype.detect=function(){for(var t=this.leftInit,e=this.rightInit,n=this.upInit,o=this.downInit,i=!1,a=!0,s=!1,f=!1,c=!1,u=!1,l=!1,h=this.width,d=this.height;a;){a=!1;for(var p=!0;(p||!f)&&e<h;)p=this.containsBlackPoint(n,o,e,!1),p?(e++,a=!0,f=!0):f||e++;if(e>=h){i=!0;break}for(var v=!0;(v||!c)&&o<d;)v=this.containsBlackPoint(t,e,o,!0),v?(o++,a=!0,c=!0):c||o++;if(o>=d){i=!0;break}for(var g=!0;(g||!u)&&t>=0;)g=this.containsBlackPoint(n,o,t,!1),g?(t--,a=!0,u=!0):u||t--;if(t<0){i=!0;break}for(var y=!0;(y||!l)&&n>=0;)y=this.containsBlackPoint(t,e,n,!0),y?(n--,a=!0,l=!0):l||n--;if(n<0){i=!0;break}a&&(s=!0)}if(!i&&s){for(var x=e-t,C=null,w=1;C===null&&w<x;w++)C=this.getBlackPointOnSegment(t,o-w,t+w,o);if(C==null)throw new E;for(var _=null,w=1;_===null&&w<x;w++)_=this.getBlackPointOnSegment(t,n+w,t+w,n);if(_==null)throw new E;for(var O=null,w=1;O===null&&w<x;w++)O=this.getBlackPointOnSegment(e,n+w,e-w,n);if(O==null)throw new E;for(var R=null,w=1;R===null&&w<x;w++)R=this.getBlackPointOnSegment(e,o-w,e-w,o);if(R==null)throw new E;return this.centerEdges(R,C,O,_)}else throw new E},r.prototype.getBlackPointOnSegment=function(t,e,n,o){for(var i=G.round(G.distance(t,e,n,o)),a=(n-t)/i,s=(o-e)/i,f=this.image,c=0;c<i;c++){var u=G.round(t+c*a),l=G.round(e+c*s);if(f.get(u,l))return new D(u,l)}return null},r.prototype.centerEdges=function(t,e,n,o){var i=t.getX(),a=t.getY(),s=e.getX(),f=e.getY(),c=n.getX(),u=n.getY(),l=o.getX(),h=o.getY(),d=r.CORR;return i<this.width/2?[new D(l-d,h+d),new D(s+d,f+d),new D(c-d,u-d),new D(i+d,a-d)]:[new D(l+d,h+d),new D(s+d,f-d),new D(c-d,u+d),new D(i-d,a-d)]},r.prototype.containsBlackPoint=function(t,e,n,o){var i=this.image;if(o){for(var a=t;a<=e;a++)if(i.get(a,n))return!0}else for(var s=t;s<=e;s++)if(i.get(n,s))return!0;return!1},r.INIT_SIZE=10,r.CORR=1,r}(),je=Rf;var Df=function(){function r(){}return r.checkAndNudgePoints=function(t,e){for(var n=t.getWidth(),o=t.getHeight(),i=!0,a=0;a<e.length&&i;a+=2){var s=Math.floor(e[a]),f=Math.floor(e[a+1]);if(s<-1||s>n||f<-1||f>o)throw new E;i=!1,s===-1?(e[a]=0,i=!0):s===n&&(e[a]=n-1,i=!0),f===-1?(e[a+1]=0,i=!0):f===o&&(e[a+1]=o-1,i=!0)}i=!0;for(var a=e.length-2;a>=0&&i;a-=2){var s=Math.floor(e[a]),f=Math.floor(e[a+1]);if(s<-1||s>n||f<-1||f>o)throw new E;i=!1,s===-1?(e[a]=0,i=!0):s===n&&(e[a]=n-1,i=!0),f===-1?(e[a+1]=0,i=!0):f===o&&(e[a+1]=o-1,i=!0)}},r}(),Zr=Df;var bf=function(){function r(t,e,n,o,i,a,s,f,c){this.a11=t,this.a21=e,this.a31=n,this.a12=o,this.a22=i,this.a32=a,this.a13=s,this.a23=f,this.a33=c}return r.quadrilateralToQuadrilateral=function(t,e,n,o,i,a,s,f,c,u,l,h,d,p,v,g){var y=r.quadrilateralToSquare(t,e,n,o,i,a,s,f),x=r.squareToQuadrilateral(c,u,l,h,d,p,v,g);return x.times(y)},r.prototype.transformPoints=function(t){for(var e=t.length,n=this.a11,o=this.a12,i=this.a13,a=this.a21,s=this.a22,f=this.a23,c=this.a31,u=this.a32,l=this.a33,h=0;h<e;h+=2){var d=t[h],p=t[h+1],v=i*d+f*p+l;t[h]=(n*d+a*p+c)/v,t[h+1]=(o*d+s*p+u)/v}},r.prototype.transformPointsWithValues=function(t,e){for(var n=this.a11,o=this.a12,i=this.a13,a=this.a21,s=this.a22,f=this.a23,c=this.a31,u=this.a32,l=this.a33,h=t.length,d=0;d<h;d++){var p=t[d],v=e[d],g=i*p+f*v+l;t[d]=(n*p+a*v+c)/g,e[d]=(o*p+s*v+u)/g}},r.squareToQuadrilateral=function(t,e,n,o,i,a,s,f){var c=t-n+i-s,u=e-o+a-f;if(c===0&&u===0)return new r(n-t,i-n,t,o-e,a-o,e,0,0,1);var l=n-i,h=s-i,d=o-a,p=f-a,v=l*p-h*d,g=(c*p-h*u)/v,y=(l*u-c*d)/v;return new r(n-t+g*n,s-t+y*s,t,o-e+g*o,f-e+y*f,e,g,y,1)},r.quadrilateralToSquare=function(t,e,n,o,i,a,s,f){return r.squareToQuadrilateral(t,e,n,o,i,a,s,f).buildAdjoint()},r.prototype.buildAdjoint=function(){return new r(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)},r.prototype.times=function(t){return new r(this.a11*t.a11+this.a21*t.a12+this.a31*t.a13,this.a11*t.a21+this.a21*t.a22+this.a31*t.a23,this.a11*t.a31+this.a21*t.a32+this.a31*t.a33,this.a12*t.a11+this.a22*t.a12+this.a32*t.a13,this.a12*t.a21+this.a22*t.a22+this.a32*t.a23,this.a12*t.a31+this.a22*t.a32+this.a32*t.a33,this.a13*t.a11+this.a23*t.a12+this.a33*t.a13,this.a13*t.a21+this.a23*t.a22+this.a33*t.a23,this.a13*t.a31+this.a23*t.a32+this.a33*t.a33)},r}(),pr=bf;var Nf=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Pf=function(r){Nf(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.sampleGrid=function(e,n,o,i,a,s,f,c,u,l,h,d,p,v,g,y,x,C,w){var _=pr.quadrilateralToQuadrilateral(i,a,s,f,c,u,l,h,d,p,v,g,y,x,C,w);return this.sampleGridWithTransform(e,n,o,_)},t.prototype.sampleGridWithTransform=function(e,n,o,i){if(n<=0||o<=0)throw new E;for(var a=new at(n,o),s=new Float32Array(2*n),f=0;f<o;f++){for(var c=s.length,u=f+.5,l=0;l<c;l+=2)s[l]=l/2+.5,s[l+1]=u;i.transformPoints(s),Zr.checkAndNudgePoints(e,s);try{for(var l=0;l<c;l+=2)e.get(Math.floor(s[l]),Math.floor(s[l+1]))&&a.set(l/2,f)}catch{throw new E}}return a},t}(Zr),Wn=Pf;var Mf=function(){function r(){}return r.setGridSampler=function(t){r.gridSampler=t},r.getInstance=function(){return r.gridSampler},r.gridSampler=new Wn,r}(),be=Mf;var Nt=function(){function r(t,e){this.x=t,this.y=e}return r.prototype.toResultPoint=function(){return new D(this.getX(),this.getY())},r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r}();var Bf=function(){function r(t){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=t}return r.prototype.detect=function(){return this.detectMirror(!1)},r.prototype.detectMirror=function(t){var e=this.getMatrixCenter(),n=this.getBullsEyeCorners(e);if(t){var o=n[0];n[0]=n[2],n[2]=o}this.extractParameters(n);var i=this.sampleGrid(this.image,n[this.shift%4],n[(this.shift+1)%4],n[(this.shift+2)%4],n[(this.shift+3)%4]),a=this.getMatrixCornerPoints(n);return new zn(i,a,this.compact,this.nbDataBlocks,this.nbLayers)},r.prototype.extractParameters=function(t){if(!this.isValidPoint(t[0])||!this.isValidPoint(t[1])||!this.isValidPoint(t[2])||!this.isValidPoint(t[3]))throw new E;var e=2*this.nbCenterLayers,n=new Int32Array([this.sampleLine(t[0],t[1],e),this.sampleLine(t[1],t[2],e),this.sampleLine(t[2],t[3],e),this.sampleLine(t[3],t[0],e)]);this.shift=this.getRotation(n,e);for(var o=0,i=0;i<4;i++){var a=n[(this.shift+i)%4];this.compact?(o<<=7,o+=a>>1&127):(o<<=10,o+=(a>>2&992)+(a>>1&31))}var s=this.getCorrectedParameterData(o,this.compact);this.compact?(this.nbLayers=(s>>6)+1,this.nbDataBlocks=(s&63)+1):(this.nbLayers=(s>>11)+1,this.nbDataBlocks=(s&2047)+1)},r.prototype.getRotation=function(t,e){var n=0;t.forEach(function(i,a,s){var f=(i>>e-2<<1)+(i&1);n=(n<<3)+f}),n=((n&1)<<11)+(n>>1);for(var o=0;o<4;o++)if(M.bitCount(n^this.EXPECTED_CORNER_BITS[o])<=2)return o;throw new E},r.prototype.getCorrectedParameterData=function(t,e){var n,o;e?(n=7,o=2):(n=10,o=4);for(var i=n-o,a=new Int32Array(n),s=n-1;s>=0;--s)a[s]=t&15,t>>=4;try{var f=new ie(dt.AZTEC_PARAM);f.decode(a,i)}catch{throw new E}for(var c=0,s=0;s<o;s++)c=(c<<4)+a[s];return c},r.prototype.getBullsEyeCorners=function(t){var e=t,n=t,o=t,i=t,a=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){var s=this.getFirstDifferent(e,a,1,-1),f=this.getFirstDifferent(n,a,1,1),c=this.getFirstDifferent(o,a,-1,1),u=this.getFirstDifferent(i,a,-1,-1);if(this.nbCenterLayers>2){var l=this.distancePoint(u,s)*this.nbCenterLayers/(this.distancePoint(i,e)*(this.nbCenterLayers+2));if(l<.75||l>1.25||!this.isWhiteOrBlackRectangle(s,f,c,u))break}e=s,n=f,o=c,i=u,a=!a}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new E;this.compact=this.nbCenterLayers===5;var h=new D(e.getX()+.5,e.getY()-.5),d=new D(n.getX()+.5,n.getY()+.5),p=new D(o.getX()-.5,o.getY()+.5),v=new D(i.getX()-.5,i.getY()-.5);return this.expandSquare([h,d,p,v],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},r.prototype.getMatrixCenter=function(){var t,e,n,o;try{var i=new je(this.image).detect();t=i[0],e=i[1],n=i[2],o=i[3]}catch{var a=this.image.getWidth()/2,s=this.image.getHeight()/2;t=this.getFirstDifferent(new Nt(a+7,s-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new Nt(a+7,s+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new Nt(a-7,s+7),!1,-1,1).toResultPoint(),o=this.getFirstDifferent(new Nt(a-7,s-7),!1,-1,-1).toResultPoint()}var f=G.round((t.getX()+o.getX()+e.getX()+n.getX())/4),c=G.round((t.getY()+o.getY()+e.getY()+n.getY())/4);try{var i=new je(this.image,15,f,c).detect();t=i[0],e=i[1],n=i[2],o=i[3]}catch{t=this.getFirstDifferent(new Nt(f+7,c-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new Nt(f+7,c+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new Nt(f-7,c+7),!1,-1,1).toResultPoint(),o=this.getFirstDifferent(new Nt(f-7,c-7),!1,-1,-1).toResultPoint()}return f=G.round((t.getX()+o.getX()+e.getX()+n.getX())/4),c=G.round((t.getY()+o.getY()+e.getY()+n.getY())/4),new Nt(f,c)},r.prototype.getMatrixCornerPoints=function(t){return this.expandSquare(t,2*this.nbCenterLayers,this.getDimension())},r.prototype.sampleGrid=function(t,e,n,o,i){var a=be.getInstance(),s=this.getDimension(),f=s/2-this.nbCenterLayers,c=s/2+this.nbCenterLayers;return a.sampleGrid(t,s,s,f,f,c,f,c,c,f,c,e.getX(),e.getY(),n.getX(),n.getY(),o.getX(),o.getY(),i.getX(),i.getY())},r.prototype.sampleLine=function(t,e,n){for(var o=0,i=this.distanceResultPoint(t,e),a=i/n,s=t.getX(),f=t.getY(),c=a*(e.getX()-t.getX())/i,u=a*(e.getY()-t.getY())/i,l=0;l<n;l++)this.image.get(G.round(s+l*c),G.round(f+l*u))&&(o|=1<<n-l-1);return o},r.prototype.isWhiteOrBlackRectangle=function(t,e,n,o){var i=3;t=new Nt(t.getX()-i,t.getY()+i),e=new Nt(e.getX()-i,e.getY()-i),n=new Nt(n.getX()+i,n.getY()-i),o=new Nt(o.getX()+i,o.getY()+i);var a=this.getColor(o,t);if(a===0)return!1;var s=this.getColor(t,e);return s!==a||(s=this.getColor(e,n),s!==a)?!1:(s=this.getColor(n,o),s===a)},r.prototype.getColor=function(t,e){for(var n=this.distancePoint(t,e),o=(e.getX()-t.getX())/n,i=(e.getY()-t.getY())/n,a=0,s=t.getX(),f=t.getY(),c=this.image.get(t.getX(),t.getY()),u=Math.ceil(n),l=0;l<u;l++)s+=o,f+=i,this.image.get(G.round(s),G.round(f))!==c&&a++;var h=a/n;return h>.1&&h<.9?0:h<=.1===c?1:-1},r.prototype.getFirstDifferent=function(t,e,n,o){for(var i=t.getX()+n,a=t.getY()+o;this.isValid(i,a)&&this.image.get(i,a)===e;)i+=n,a+=o;for(i-=n,a-=o;this.isValid(i,a)&&this.image.get(i,a)===e;)i+=n;for(i-=n;this.isValid(i,a)&&this.image.get(i,a)===e;)a+=o;return a-=o,new Nt(i,a)},r.prototype.expandSquare=function(t,e,n){var o=n/(2*e),i=t[0].getX()-t[2].getX(),a=t[0].getY()-t[2].getY(),s=(t[0].getX()+t[2].getX())/2,f=(t[0].getY()+t[2].getY())/2,c=new D(s+o*i,f+o*a),u=new D(s-o*i,f-o*a);i=t[1].getX()-t[3].getX(),a=t[1].getY()-t[3].getY(),s=(t[1].getX()+t[3].getX())/2,f=(t[1].getY()+t[3].getY())/2;var l=new D(s+o*i,f+o*a),h=new D(s-o*i,f-o*a),d=[c,l,u,h];return d},r.prototype.isValid=function(t,e){return t>=0&&t<this.image.getWidth()&&e>0&&e<this.image.getHeight()},r.prototype.isValidPoint=function(t){var e=G.round(t.getX()),n=G.round(t.getY());return this.isValid(e,n)},r.prototype.distancePoint=function(t,e){return G.distance(t.getX(),t.getY(),e.getX(),e.getY())},r.prototype.distanceResultPoint=function(t,e){return G.distance(t.getX(),t.getY(),e.getX(),e.getY())},r.prototype.getDimension=function(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(M.truncDivision(this.nbLayers-4,8)+1)+15},r}(),Xn=Bf;var Ff=function(){function r(){}return r.prototype.decode=function(t,e){e===void 0&&(e=null);var n=null,o=new Xn(t.getBlackMatrix()),i=null,a=null;try{var s=o.detectMirror(!1);i=s.getPoints(),this.reportFoundResultPoints(e,i),a=new Yr().decode(s)}catch(l){n=l}if(a==null)try{var s=o.detectMirror(!0);i=s.getPoints(),this.reportFoundResultPoints(e,i),a=new Yr().decode(s)}catch(l){throw n??l}var f=new Y(a.getText(),a.getRawBytes(),a.getNumBits(),i,T.AZTEC,H.currentTimeMillis()),c=a.getByteSegments();c!=null&&f.putMetadata(st.BYTE_SEGMENTS,c);var u=a.getECLevel();return u!=null&&f.putMetadata(st.ERROR_CORRECTION_LEVEL,u),f},r.prototype.reportFoundResultPoints=function(t,e){if(t!=null){var n=t.get(L.NEED_RESULT_POINT_CALLBACK);n!=null&&e.forEach(function(o,i,a){n.foundPossibleResultPoint(o)})}},r.prototype.reset=function(){},r}(),ge=Ff;var Lf=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Cp=function(r){Lf(t,r);function t(e){return e===void 0&&(e=500),r.call(this,new ge,e)||this}return t}(Gt);var kf=function(){function r(){}return r.prototype.decode=function(t,e){try{return this.doDecode(t,e)}catch{var n=e&&e.get(L.TRY_HARDER)===!0;if(n&&t.isRotateSupported()){var o=t.rotateCounterClockwise(),i=this.doDecode(o,e),a=i.getResultMetadata(),s=270;a!==null&&a.get(st.ORIENTATION)===!0&&(s=s+a.get(st.ORIENTATION)%360),i.putMetadata(st.ORIENTATION,s);var f=i.getResultPoints();if(f!==null)for(var c=o.getHeight(),u=0;u<f.length;u++)f[u]=new D(c-f[u].getY()-1,f[u].getX());return i}else throw new E}},r.prototype.reset=function(){},r.prototype.doDecode=function(t,e){var n=t.getWidth(),o=t.getHeight(),i=new ot(n),a=e&&e.get(L.TRY_HARDER)===!0,s=Math.max(1,o>>(a?8:5)),f;a?f=o:f=15;for(var c=Math.trunc(o/2),u=0;u<f;u++){var l=Math.trunc((u+1)/2),h=(u&1)===0,d=c+s*(h?l:-l);if(d<0||d>=o)break;try{i=t.getBlackRow(d,i)}catch{continue}for(var p=function(x){if(x===1&&(i.reverse(),e&&e.get(L.NEED_RESULT_POINT_CALLBACK)===!0)){var C=new Map;e.forEach(function(O,R){return C.set(R,O)}),C.delete(L.NEED_RESULT_POINT_CALLBACK),e=C}try{var w=v.decodeRow(d,i,e);if(x===1){w.putMetadata(st.ORIENTATION,180);var _=w.getResultPoints();_!==null&&(_[0]=new D(n-_[0].getX()-1,_[0].getY()),_[1]=new D(n-_[1].getX()-1,_[1].getY()))}return{value:w}}catch{}},v=this,g=0;g<2;g++){var y=p(g);if(typeof y=="object")return y.value}}throw new E},r.recordPattern=function(t,e,n){for(var o=n.length,i=0;i<o;i++)n[i]=0;var a=t.getSize();if(e>=a)throw new E;for(var s=!t.get(e),f=0,c=e;c<a;){if(t.get(c)!==s)n[f]++;else{if(++f===o)break;n[f]=1,s=!s}c++}if(!(f===o||f===o-1&&c===a))throw new E},r.recordPatternInReverse=function(t,e,n){for(var o=n.length,i=t.get(e);e>0&&o>=0;)t.get(--e)!==i&&(o--,i=!i);if(o>=0)throw new E;r.recordPattern(t,e+1,n)},r.patternMatchVariance=function(t,e,n){for(var o=t.length,i=0,a=0,s=0;s<o;s++)i+=t[s],a+=e[s];if(i<a)return Number.POSITIVE_INFINITY;var f=i/a;n*=f;for(var c=0,u=0;u<o;u++){var l=t[u],h=e[u]*f,d=l>h?l-h:h-l;if(d>n)return Number.POSITIVE_INFINITY;c+=d}return c/i},r}(),q=kf;var Uf=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Vf=function(r){Uf(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.findStartPattern=function(e){for(var n=e.getSize(),o=e.getNextSet(0),i=0,a=Int32Array.from([0,0,0,0,0,0]),s=o,f=!1,c=6,u=o;u<n;u++)if(e.get(u)!==f)a[i]++;else{if(i===c-1){for(var l=t.MAX_AVG_VARIANCE,h=-1,d=t.CODE_START_A;d<=t.CODE_START_C;d++){var p=q.patternMatchVariance(a,t.CODE_PATTERNS[d],t.MAX_INDIVIDUAL_VARIANCE);p<l&&(l=p,h=d)}if(h>=0&&e.isRange(Math.max(0,s-(u-s)/2),s,!1))return Int32Array.from([s,u,h]);s+=a[0]+a[1],a=a.slice(2,a.length-1),a[i-1]=0,a[i]=0,i--}else i++;a[i]=1,f=!f}throw new E},t.decodeCode=function(e,n,o){q.recordPattern(e,o,n);for(var i=t.MAX_AVG_VARIANCE,a=-1,s=0;s<t.CODE_PATTERNS.length;s++){var f=t.CODE_PATTERNS[s],c=this.patternMatchVariance(n,f,t.MAX_INDIVIDUAL_VARIANCE);c<i&&(i=c,a=s)}if(a>=0)return a;throw new E},t.prototype.decodeRow=function(e,n,o){var i=o&&o.get(L.ASSUME_GS1)===!0,a=t.findStartPattern(n),s=a[2],f=0,c=new Uint8Array(20);c[f++]=s;var u;switch(s){case t.CODE_START_A:u=t.CODE_CODE_A;break;case t.CODE_START_B:u=t.CODE_CODE_B;break;case t.CODE_START_C:u=t.CODE_CODE_C;break;default:throw new S}for(var l=!1,h=!1,d="",p=a[0],v=a[1],g=Int32Array.from([0,0,0,0,0,0]),y=0,x=0,C=s,w=0,_=!0,O=!1,R=!1;!l;){var N=h;switch(h=!1,y=x,x=t.decodeCode(n,g,v),c[f++]=x,x!==t.CODE_STOP&&(_=!0),x!==t.CODE_STOP&&(w++,C+=w*x),p=v,v+=g.reduce(function(In,On){return In+On},0),x){case t.CODE_START_A:case t.CODE_START_B:case t.CODE_START_C:throw new S}switch(u){case t.CODE_CODE_A:if(x<64)R===O?d+=String.fromCharCode(32+x):d+=String.fromCharCode(32+x+128),R=!1;else if(x<96)R===O?d+=String.fromCharCode(x-64):d+=String.fromCharCode(x+64),R=!1;else switch(x!==t.CODE_STOP&&(_=!1),x){case t.CODE_FNC_1:i&&(d.length===0?d+="]C1":d+="");break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_A:!O&&R?(O=!0,R=!1):O&&R?(O=!1,R=!1):R=!0;break;case t.CODE_SHIFT:h=!0,u=t.CODE_CODE_B;break;case t.CODE_CODE_B:u=t.CODE_CODE_B;break;case t.CODE_CODE_C:u=t.CODE_CODE_C;break;case t.CODE_STOP:l=!0;break}break;case t.CODE_CODE_B:if(x<96)R===O?d+=String.fromCharCode(32+x):d+=String.fromCharCode(32+x+128),R=!1;else switch(x!==t.CODE_STOP&&(_=!1),x){case t.CODE_FNC_1:i&&(d.length===0?d+="]C1":d+="");break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_B:!O&&R?(O=!0,R=!1):O&&R?(O=!1,R=!1):R=!0;break;case t.CODE_SHIFT:h=!0,u=t.CODE_CODE_A;break;case t.CODE_CODE_A:u=t.CODE_CODE_A;break;case t.CODE_CODE_C:u=t.CODE_CODE_C;break;case t.CODE_STOP:l=!0;break}break;case t.CODE_CODE_C:if(x<100)x<10&&(d+="0"),d+=x;else switch(x!==t.CODE_STOP&&(_=!1),x){case t.CODE_FNC_1:i&&(d.length===0?d+="]C1":d+="");break;case t.CODE_CODE_A:u=t.CODE_CODE_A;break;case t.CODE_CODE_B:u=t.CODE_CODE_B;break;case t.CODE_STOP:l=!0;break}break}N&&(u=u===t.CODE_CODE_A?t.CODE_CODE_B:t.CODE_CODE_A)}var k=v-p;if(v=n.getNextUnset(v),!n.isRange(v,Math.min(n.getSize(),v+(v-p)/2),!1))throw new E;if(C-=w*y,C%103!==y)throw new X;var B=d.length;if(B===0)throw new E;B>0&&_&&(u===t.CODE_CODE_C?d=d.substring(0,B-2):d=d.substring(0,B-1));for(var vt=(a[1]+a[0])/2,j=p+k/2,ct=c.length,kt=new Uint8Array(ct),le=0;le<ct;le++)kt[le]=c[le];var Sn=[new D(vt,e),new D(j,e)];return new Y(d,kt,0,Sn,T.CODE_128,new Date().getTime())},t.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])],t.MAX_AVG_VARIANCE=.25,t.MAX_INDIVIDUAL_VARIANCE=.7,t.CODE_SHIFT=98,t.CODE_CODE_C=99,t.CODE_CODE_B=100,t.CODE_CODE_A=101,t.CODE_FNC_1=102,t.CODE_FNC_2=97,t.CODE_FNC_3=96,t.CODE_FNC_4_A=101,t.CODE_FNC_4_B=100,t.CODE_START_A=103,t.CODE_START_B=104,t.CODE_START_C=105,t.CODE_STOP=106,t}(q),Kr=Vf;var Hf=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),jn=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Gf=function(r){Hf(t,r);function t(e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var o=r.call(this)||this;return o.usingCheckDigit=e,o.extendedMode=n,o.decodeRowResult="",o.counters=new Int32Array(9),o}return t.prototype.decodeRow=function(e,n,o){var i,a,s,f,c=this.counters;c.fill(0),this.decodeRowResult="";var u=t.findAsteriskPattern(n,c),l=n.getNextSet(u[1]),h=n.getSize(),d,p;do{t.recordPattern(n,l,c);var v=t.toNarrowWidePattern(c);if(v<0)throw new E;d=t.patternToChar(v),this.decodeRowResult+=d,p=l;try{for(var g=(i=void 0,jn(c)),y=g.next();!y.done;y=g.next()){var x=y.value;l+=x}}catch(ct){i={error:ct}}finally{try{y&&!y.done&&(a=g.return)&&a.call(g)}finally{if(i)throw i.error}}l=n.getNextSet(l)}while(d!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var C=0;try{for(var w=jn(c),_=w.next();!_.done;_=w.next()){var x=_.value;C+=x}}catch(ct){s={error:ct}}finally{try{_&&!_.done&&(f=w.return)&&f.call(w)}finally{if(s)throw s.error}}var O=l-p-C;if(l!==h&&O*2<C)throw new E;if(this.usingCheckDigit){for(var R=this.decodeRowResult.length-1,N=0,k=0;k<R;k++)N+=t.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(k));if(this.decodeRowResult.charAt(R)!==t.ALPHABET_STRING.charAt(N%43))throw new X;this.decodeRowResult=this.decodeRowResult.substring(0,R)}if(this.decodeRowResult.length===0)throw new E;var B;this.extendedMode?B=t.decodeExtended(this.decodeRowResult):B=this.decodeRowResult;var vt=(u[1]+u[0])/2,j=p+C/2;return new Y(B,null,0,[new D(vt,e),new D(j,e)],T.CODE_39,new Date().getTime())},t.findAsteriskPattern=function(e,n){for(var o=e.getSize(),i=e.getNextSet(0),a=0,s=i,f=!1,c=n.length,u=i;u<o;u++)if(e.get(u)!==f)n[a]++;else{if(a===c-1){if(this.toNarrowWidePattern(n)===t.ASTERISK_ENCODING&&e.isRange(Math.max(0,s-Math.floor((u-s)/2)),s,!1))return[s,u];s+=n[0]+n[1],n.copyWithin(0,2,2+a-1),n[a-1]=0,n[a]=0,a--}else a++;n[a]=1,f=!f}throw new E},t.toNarrowWidePattern=function(e){var n,o,i=e.length,a=0,s;do{var f=2147483647;try{for(var c=(n=void 0,jn(e)),u=c.next();!u.done;u=c.next()){var l=u.value;l<f&&l>a&&(f=l)}}catch(v){n={error:v}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}a=f,s=0;for(var h=0,d=0,p=0;p<i;p++){var l=e[p];l>a&&(d|=1<<i-1-p,s++,h+=l)}if(s===3){for(var p=0;p<i&&s>0;p++){var l=e[p];if(l>a&&(s--,l*2>=h))return-1}return d}}while(s>3);return-1},t.patternToChar=function(e){for(var n=0;n<t.CHARACTER_ENCODINGS.length;n++)if(t.CHARACTER_ENCODINGS[n]===e)return t.ALPHABET_STRING.charAt(n);if(e===t.ASTERISK_ENCODING)return"*";throw new E},t.decodeExtended=function(e){for(var n=e.length,o="",i=0;i<n;i++){var a=e.charAt(i);if(a==="+"||a==="$"||a==="%"||a==="/"){var s=e.charAt(i+1),f="\0";switch(a){case"+":if(s>="A"&&s<="Z")f=String.fromCharCode(s.charCodeAt(0)+32);else throw new S;break;case"$":if(s>="A"&&s<="Z")f=String.fromCharCode(s.charCodeAt(0)-64);else throw new S;break;case"%":if(s>="A"&&s<="E")f=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")f=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")f=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")f=String.fromCharCode(s.charCodeAt(0)+43);else if(s==="U")f="\0";else if(s==="V")f="@";else if(s==="W")f="`";else if(s==="X"||s==="Y"||s==="Z")f="\x7F";else throw new S;break;case"/":if(s>="A"&&s<="O")f=String.fromCharCode(s.charCodeAt(0)-32);else if(s==="Z")f=":";else throw new S;break}o+=f,i++}else o+=a}return o},t.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",t.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],t.ASTERISK_ENCODING=148,t}(q),Qr=Gf;var zf=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Yn=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Wf=function(r){zf(t,r);function t(){var e=r.call(this)||this;return e.decodeRowResult="",e.counters=new Int32Array(6),e}return t.prototype.decodeRow=function(e,n,o){var i,a,s,f,c=this.findAsteriskPattern(n),u=n.getNextSet(c[1]),l=n.getSize(),h=this.counters;h.fill(0),this.decodeRowResult="";var d,p;do{t.recordPattern(n,u,h);var v=this.toPattern(h);if(v<0)throw new E;d=this.patternToChar(v),this.decodeRowResult+=d,p=u;try{for(var g=(i=void 0,Yn(h)),y=g.next();!y.done;y=g.next()){var x=y.value;u+=x}}catch(k){i={error:k}}finally{try{y&&!y.done&&(a=g.return)&&a.call(g)}finally{if(i)throw i.error}}u=n.getNextSet(u)}while(d!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var C=0;try{for(var w=Yn(h),_=w.next();!_.done;_=w.next()){var x=_.value;C+=x}}catch(k){s={error:k}}finally{try{_&&!_.done&&(f=w.return)&&f.call(w)}finally{if(s)throw s.error}}if(u===l||!n.get(u))throw new E;if(this.decodeRowResult.length<2)throw new E;this.checkChecksums(this.decodeRowResult),this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-2);var O=this.decodeExtended(this.decodeRowResult),R=(c[1]+c[0])/2,N=p+C/2;return new Y(O,null,0,[new D(R,e),new D(N,e)],T.CODE_93,new Date().getTime())},t.prototype.findAsteriskPattern=function(e){var n=e.getSize(),o=e.getNextSet(0);this.counters.fill(0);for(var i=this.counters,a=o,s=!1,f=i.length,c=0,u=o;u<n;u++)if(e.get(u)!==s)i[c]++;else{if(c===f-1){if(this.toPattern(i)===t.ASTERISK_ENCODING)return new Int32Array([a,u]);a+=i[0]+i[1],i.copyWithin(0,2,2+c-1),i[c-1]=0,i[c]=0,c--}else c++;i[c]=1,s=!s}throw new E},t.prototype.toPattern=function(e){var n,o,i=0;try{for(var a=Yn(e),s=a.next();!s.done;s=a.next()){var f=s.value;i+=f}}catch(p){n={error:p}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}for(var c=0,u=e.length,l=0;l<u;l++){var h=Math.round(e[l]*9/i);if(h<1||h>4)return-1;if(l&1)c<<=h;else for(var d=0;d<h;d++)c=c<<1|1}return c},t.prototype.patternToChar=function(e){for(var n=0;n<t.CHARACTER_ENCODINGS.length;n++)if(t.CHARACTER_ENCODINGS[n]===e)return t.ALPHABET_STRING.charAt(n);throw new E},t.prototype.decodeExtended=function(e){for(var n=e.length,o="",i=0;i<n;i++){var a=e.charAt(i);if(a>="a"&&a<="d"){if(i>=n-1)throw new S;var s=e.charAt(i+1),f="\0";switch(a){case"d":if(s>="A"&&s<="Z")f=String.fromCharCode(s.charCodeAt(0)+32);else throw new S;break;case"a":if(s>="A"&&s<="Z")f=String.fromCharCode(s.charCodeAt(0)-64);else throw new S;break;case"b":if(s>="A"&&s<="E")f=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")f=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")f=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")f=String.fromCharCode(s.charCodeAt(0)+43);else if(s==="U")f="\0";else if(s==="V")f="@";else if(s==="W")f="`";else if(s>="X"&&s<="Z")f="\x7F";else throw new S;break;case"c":if(s>="A"&&s<="O")f=String.fromCharCode(s.charCodeAt(0)-32);else if(s==="Z")f=":";else throw new S;break}o+=f,i++}else o+=a}return o},t.prototype.checkChecksums=function(e){var n=e.length;this.checkOneChecksum(e,n-2,20),this.checkOneChecksum(e,n-1,15)},t.prototype.checkOneChecksum=function(e,n,o){for(var i=1,a=0,s=n-1;s>=0;s--)a+=i*t.ALPHABET_STRING.indexOf(e.charAt(s)),++i>o&&(i=1);if(e.charAt(n)!==t.ALPHABET_STRING[a%47])throw new X},t.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*",t.CHARACTER_ENCODINGS=[276,328,324,322,296,292,290,336,274,266,424,420,418,404,402,394,360,356,354,308,282,344,332,326,300,278,436,434,428,422,406,410,364,358,310,314,302,468,466,458,366,374,430,294,474,470,306,350],t.ASTERISK_ENCODING=t.CHARACTER_ENCODINGS[47],t}(q),qr=Wf;var Xf=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),jf=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Yf=function(r){Xf(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.narrowLineWidth=-1,e}return t.prototype.decodeRow=function(e,n,o){var i,a,s=this.decodeStart(n),f=this.decodeEnd(n),c=new P;t.decodeMiddle(n,s[1],f[0],c);var u=c.toString(),l=null;o!=null&&(l=o.get(L.ALLOWED_LENGTHS)),l==null&&(l=t.DEFAULT_ALLOWED_LENGTHS);var h=u.length,d=!1,p=0;try{for(var v=jf(l),g=v.next();!g.done;g=v.next()){var y=g.value;if(h===y){d=!0;break}y>p&&(p=y)}}catch(w){i={error:w}}finally{try{g&&!g.done&&(a=v.return)&&a.call(v)}finally{if(i)throw i.error}}if(!d&&h>p&&(d=!0),!d)throw new S;var x=[new D(s[1],e),new D(f[0],e)],C=new Y(u,null,0,x,T.ITF,new Date().getTime());return C},t.decodeMiddle=function(e,n,o,i){var a=new Int32Array(10),s=new Int32Array(5),f=new Int32Array(5);for(a.fill(0),s.fill(0),f.fill(0);n<o;){q.recordPattern(e,n,a);for(var c=0;c<5;c++){var u=2*c;s[c]=a[u],f[c]=a[u+1]}var l=t.decodeDigit(s);i.append(l.toString()),l=this.decodeDigit(f),i.append(l.toString()),a.forEach(function(h){n+=h})}},t.prototype.decodeStart=function(e){var n=t.skipWhiteSpace(e),o=t.findGuardPattern(e,n,t.START_PATTERN);return this.narrowLineWidth=(o[1]-o[0])/4,this.validateQuietZone(e,o[0]),o},t.prototype.validateQuietZone=function(e,n){var o=this.narrowLineWidth*10;o=o<n?o:n;for(var i=n-1;o>0&&i>=0&&!e.get(i);i--)o--;if(o!==0)throw new E},t.skipWhiteSpace=function(e){var n=e.getSize(),o=e.getNextSet(0);if(o===n)throw new E;return o},t.prototype.decodeEnd=function(e){e.reverse();try{var n=t.skipWhiteSpace(e),o=void 0;try{o=t.findGuardPattern(e,n,t.END_PATTERN_REVERSED[0])}catch(a){a instanceof E&&(o=t.findGuardPattern(e,n,t.END_PATTERN_REVERSED[1]))}this.validateQuietZone(e,o[0]);var i=o[0];return o[0]=e.getSize()-o[1],o[1]=e.getSize()-i,o}finally{e.reverse()}},t.findGuardPattern=function(e,n,o){var i=o.length,a=new Int32Array(i),s=e.getSize(),f=!1,c=0,u=n;a.fill(0);for(var l=n;l<s;l++)if(e.get(l)!==f)a[c]++;else{if(c===i-1){if(q.patternMatchVariance(a,o,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return[u,l];u+=a[0]+a[1],H.arraycopy(a,2,a,0,c-1),a[c-1]=0,a[c]=0,c--}else c++;a[c]=1,f=!f}throw new E},t.decodeDigit=function(e){for(var n=t.MAX_AVG_VARIANCE,o=-1,i=t.PATTERNS.length,a=0;a<i;a++){var s=t.PATTERNS[a],f=q.patternMatchVariance(e,s,t.MAX_INDIVIDUAL_VARIANCE);f<n?(n=f,o=a):f===n&&(o=-1)}if(o>=0)return o%10;throw new E},t.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],t.MAX_AVG_VARIANCE=.38,t.MAX_INDIVIDUAL_VARIANCE=.5,t.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],t.START_PATTERN=Int32Array.from([1,1,1,1]),t.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],t}(q),$r=Yf;var Zf=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Kf=function(r){Zf(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.decodeRowStringBuffer="",e}return t.findStartGuardPattern=function(e){for(var n=!1,o,i=0,a=Int32Array.from([0,0,0]);!n;){a=Int32Array.from([0,0,0]),o=t.findGuardPattern(e,i,!1,this.START_END_PATTERN,a);var s=o[0];i=o[1];var f=s-(i-s);f>=0&&(n=e.isRange(f,s,!1))}return o},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var n=e.length;if(n===0)return!1;var o=parseInt(e.charAt(n-1),10);return t.getStandardUPCEANChecksum(e.substring(0,n-1))===o},t.getStandardUPCEANChecksum=function(e){for(var n=e.length,o=0,i=n-1;i>=0;i-=2){var a=e.charAt(i).charCodeAt(0)-48;if(a<0||a>9)throw new S;o+=a}o*=3;for(var i=n-2;i>=0;i-=2){var a=e.charAt(i).charCodeAt(0)-48;if(a<0||a>9)throw new S;o+=a}return(1e3-o)%10},t.decodeEnd=function(e,n){return t.findGuardPattern(e,n,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t.findGuardPatternWithoutCounters=function(e,n,o,i){return this.findGuardPattern(e,n,o,i,new Int32Array(i.length))},t.findGuardPattern=function(e,n,o,i,a){var s=e.getSize();n=o?e.getNextUnset(n):e.getNextSet(n);for(var f=0,c=n,u=i.length,l=o,h=n;h<s;h++)if(e.get(h)!==l)a[f]++;else{if(f===u-1){if(q.patternMatchVariance(a,i,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return Int32Array.from([c,h]);c+=a[0]+a[1];for(var d=a.slice(2,a.length),p=0;p<f-1;p++)a[p]=d[p];a[f-1]=0,a[f]=0,f--}else f++;a[f]=1,l=!l}throw new E},t.decodeDigit=function(e,n,o,i){this.recordPattern(e,o,n);for(var a=this.MAX_AVG_VARIANCE,s=-1,f=i.length,c=0;c<f;c++){var u=i[c],l=q.patternMatchVariance(n,u,t.MAX_INDIVIDUAL_VARIANCE);l<a&&(a=l,s=c)}if(s>=0)return s;throw new E},t.MAX_AVG_VARIANCE=.48,t.MAX_INDIVIDUAL_VARIANCE=.7,t.START_END_PATTERN=Int32Array.from([1,1,1]),t.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),t.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],t}(q),Jt=Kf;var Qf=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},qf=function(){function r(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return r.prototype.decodeRow=function(t,e,n){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(e,n,o),a=o.toString(),s=r.parseExtensionString(a),f=[new D((n[0]+n[1])/2,t),new D(i,t)],c=new Y(a,null,0,f,T.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&c.putAllMetadata(s),c},r.prototype.decodeMiddle=function(t,e,n){var o,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=t.getSize(),f=e[1],c=0,u=0;u<5&&f<s;u++){var l=Jt.decodeDigit(t,a,f,Jt.L_AND_G_PATTERNS);n+=String.fromCharCode(48+l%10);try{for(var h=(o=void 0,Qf(a)),d=h.next();!d.done;d=h.next()){var p=d.value;f+=p}}catch(g){o={error:g}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}l>=10&&(c|=1<<4-u),u!==4&&(f=t.getNextSet(f),f=t.getNextUnset(f))}if(n.length!==5)throw new E;var v=this.determineCheckDigit(c);if(r.extensionChecksum(n.toString())!==v)throw new E;return f},r.extensionChecksum=function(t){for(var e=t.length,n=0,o=e-2;o>=0;o-=2)n+=t.charAt(o).charCodeAt(0)-48;n*=3;for(var o=e-1;o>=0;o-=2)n+=t.charAt(o).charCodeAt(0)-48;return n*=3,n%10},r.prototype.determineCheckDigit=function(t){for(var e=0;e<10;e++)if(t===this.CHECK_DIGIT_ENCODINGS[e])return e;throw new E},r.parseExtensionString=function(t){if(t.length!==5)return null;var e=r.parseExtension5String(t);return e==null?null:new Map([[st.SUGGESTED_PRICE,e]])},r.parseExtension5String=function(t){var e;switch(t.charAt(0)){case"0":e="\xA3";break;case"5":e="$";break;case"9":switch(t){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}e="";break;default:e="";break}var n=parseInt(t.substring(1)),o=(n/100).toString(),i=n%100,a=i<10?"0"+i:i.toString();return e+o+"."+a},r}(),Fi=qf;var $f=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Jf=function(){function r(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return r.prototype.decodeRow=function(t,e,n){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(e,n,o),a=o.toString(),s=r.parseExtensionString(a),f=[new D((n[0]+n[1])/2,t),new D(i,t)],c=new Y(a,null,0,f,T.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&c.putAllMetadata(s),c},r.prototype.decodeMiddle=function(t,e,n){var o,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=t.getSize(),f=e[1],c=0,u=0;u<2&&f<s;u++){var l=Jt.decodeDigit(t,a,f,Jt.L_AND_G_PATTERNS);n+=String.fromCharCode(48+l%10);try{for(var h=(o=void 0,$f(a)),d=h.next();!d.done;d=h.next()){var p=d.value;f+=p}}catch(v){o={error:v}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}l>=10&&(c|=1<<1-u),u!==1&&(f=t.getNextSet(f),f=t.getNextUnset(f))}if(n.length!==2)throw new E;if(parseInt(n.toString())%4!==c)throw new E;return f},r.parseExtensionString=function(t){return t.length!==2?null:new Map([[st.ISSUE_NUMBER,parseInt(t)]])},r}(),Li=Jf;var tc=function(){function r(){}return r.decodeRow=function(t,e,n){var o=Jt.findGuardPattern(e,n,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{var i=new Fi;return i.decodeRow(t,e,o)}catch{var a=new Li;return a.decodeRow(t,e,o)}},r.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),r}(),ki=tc;var ec=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),rc=function(r){ec(t,r);function t(){var e=r.call(this)||this;e.decodeRowStringBuffer="",t.L_AND_G_PATTERNS=t.L_PATTERNS.map(function(s){return Int32Array.from(s)});for(var n=10;n<20;n++){for(var o=t.L_PATTERNS[n-10],i=new Int32Array(o.length),a=0;a<o.length;a++)i[a]=o[o.length-a-1];t.L_AND_G_PATTERNS[n]=i}return e}return t.prototype.decodeRow=function(e,n,o){var i=t.findStartGuardPattern(n),a=o==null?null:o.get(L.NEED_RESULT_POINT_CALLBACK);if(a!=null){var s=new D((i[0]+i[1])/2,e);a.foundPossibleResultPoint(s)}var f=this.decodeMiddle(n,i,this.decodeRowStringBuffer),c=f.rowOffset,u=f.resultString;if(a!=null){var l=new D(c,e);a.foundPossibleResultPoint(l)}var h=t.decodeEnd(n,c);if(a!=null){var d=new D((h[0]+h[1])/2,e);a.foundPossibleResultPoint(d)}var p=h[1],v=p+(p-h[0]);if(v>=n.getSize()||!n.isRange(p,v,!1))throw new E;var g=u.toString();if(g.length<8)throw new S;if(!t.checkChecksum(g))throw new X;var y=(i[1]+i[0])/2,x=(h[1]+h[0])/2,C=this.getBarcodeFormat(),w=[new D(y,e),new D(x,e)],_=new Y(g,null,0,w,C,new Date().getTime()),O=0;try{var R=ki.decodeRow(e,n,h[1]);_.putMetadata(st.UPC_EAN_EXTENSION,R.getText()),_.putAllMetadata(R.getResultMetadata()),_.addResultPoints(R.getResultPoints()),O=R.getText().length}catch{}var N=o==null?null:o.get(L.ALLOWED_EAN_EXTENSIONS);if(N!=null){var k=!1;for(var B in N)if(O.toString()===B){k=!0;break}if(!k)throw new E}return C===T.EAN_13||T.UPC_A,_},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var n=e.length;if(n===0)return!1;var o=parseInt(e.charAt(n-1),10);return t.getStandardUPCEANChecksum(e.substring(0,n-1))===o},t.getStandardUPCEANChecksum=function(e){for(var n=e.length,o=0,i=n-1;i>=0;i-=2){var a=e.charAt(i).charCodeAt(0)-48;if(a<0||a>9)throw new S;o+=a}o*=3;for(var i=n-2;i>=0;i-=2){var a=e.charAt(i).charCodeAt(0)-48;if(a<0||a>9)throw new S;o+=a}return(1e3-o)%10},t.decodeEnd=function(e,n){return t.findGuardPattern(e,n,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t}(Jt),ut=rc;var nc=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ui=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},oc=function(r){nc(t,r);function t(){var e=r.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return t.prototype.decodeMiddle=function(e,n,o){var i,a,s,f,c=this.decodeMiddleCounters;c[0]=0,c[1]=0,c[2]=0,c[3]=0;for(var u=e.getSize(),l=n[1],h=0,d=0;d<6&&l<u;d++){var p=ut.decodeDigit(e,c,l,ut.L_AND_G_PATTERNS);o+=String.fromCharCode(48+p%10);try{for(var v=(i=void 0,Ui(c)),g=v.next();!g.done;g=v.next()){var y=g.value;l+=y}}catch(_){i={error:_}}finally{try{g&&!g.done&&(a=v.return)&&a.call(v)}finally{if(i)throw i.error}}p>=10&&(h|=1<<5-d)}o=t.determineFirstDigit(o,h);var x=ut.findGuardPattern(e,l,!0,ut.MIDDLE_PATTERN,new Int32Array(ut.MIDDLE_PATTERN.length).fill(0));l=x[1];for(var d=0;d<6&&l<u;d++){var p=ut.decodeDigit(e,c,l,ut.L_PATTERNS);o+=String.fromCharCode(48+p);try{for(var C=(s=void 0,Ui(c)),w=C.next();!w.done;w=C.next()){var y=w.value;l+=y}}catch(R){s={error:R}}finally{try{w&&!w.done&&(f=C.return)&&f.call(C)}finally{if(s)throw s.error}}}return{rowOffset:l,resultString:o}},t.prototype.getBarcodeFormat=function(){return T.EAN_13},t.determineFirstDigit=function(e,n){for(var o=0;o<10;o++)if(n===this.FIRST_DIGIT_ENCODINGS[o])return e=String.fromCharCode(48+o)+e,e;throw new E},t.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26],t}(ut),Ye=oc;var ic=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Vi=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ac=function(r){ic(t,r);function t(){var e=r.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return t.prototype.decodeMiddle=function(e,n,o){var i,a,s,f,c=this.decodeMiddleCounters;c[0]=0,c[1]=0,c[2]=0,c[3]=0;for(var u=e.getSize(),l=n[1],h=0;h<4&&l<u;h++){var d=ut.decodeDigit(e,c,l,ut.L_PATTERNS);o+=String.fromCharCode(48+d);try{for(var p=(i=void 0,Vi(c)),v=p.next();!v.done;v=p.next()){var g=v.value;l+=g}}catch(w){i={error:w}}finally{try{v&&!v.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}}var y=ut.findGuardPattern(e,l,!0,ut.MIDDLE_PATTERN,new Int32Array(ut.MIDDLE_PATTERN.length).fill(0));l=y[1];for(var h=0;h<4&&l<u;h++){var d=ut.decodeDigit(e,c,l,ut.L_PATTERNS);o+=String.fromCharCode(48+d);try{for(var x=(s=void 0,Vi(c)),C=x.next();!C.done;C=x.next()){var g=C.value;l+=g}}catch(O){s={error:O}}finally{try{C&&!C.done&&(f=x.return)&&f.call(x)}finally{if(s)throw s.error}}}return{rowOffset:l,resultString:o}},t.prototype.getBarcodeFormat=function(){return T.EAN_8},t}(ut),Zn=ac;var sc=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),fc=function(r){sc(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.ean13Reader=new Ye,e}return t.prototype.getBarcodeFormat=function(){return T.UPC_A},t.prototype.decode=function(e,n){return this.maybeReturnResult(this.ean13Reader.decode(e))},t.prototype.decodeRow=function(e,n,o){return this.maybeReturnResult(this.ean13Reader.decodeRow(e,n,o))},t.prototype.decodeMiddle=function(e,n,o){return this.ean13Reader.decodeMiddle(e,n,o)},t.prototype.maybeReturnResult=function(e){var n=e.getText();if(n.charAt(0)==="0"){var o=new Y(n.substring(1),null,null,e.getResultPoints(),T.UPC_A);return e.getResultMetadata()!=null&&o.putAllMetadata(e.getResultMetadata()),o}else throw new E},t.prototype.reset=function(){this.ean13Reader.reset()},t}(ut),Kn=fc;var cc=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),uc=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},lc=function(r){cc(t,r);function t(){var e=r.call(this)||this;return e.decodeMiddleCounters=new Int32Array(4),e}return t.prototype.decodeMiddle=function(e,n,o){var i,a,s=this.decodeMiddleCounters.map(function(g){return g});s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var f=e.getSize(),c=n[1],u=0,l=0;l<6&&c<f;l++){var h=t.decodeDigit(e,s,c,t.L_AND_G_PATTERNS);o+=String.fromCharCode(48+h%10);try{for(var d=(i=void 0,uc(s)),p=d.next();!p.done;p=d.next()){var v=p.value;c+=v}}catch(g){i={error:g}}finally{try{p&&!p.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}h>=10&&(u|=1<<5-l)}return t.determineNumSysAndCheckDigit(new P(o),u),c},t.prototype.decodeEnd=function(e,n){return t.findGuardPatternWithoutCounters(e,n,!0,t.MIDDLE_END_PATTERN)},t.prototype.checkChecksum=function(e){return ut.checkChecksum(t.convertUPCEtoUPCA(e))},t.determineNumSysAndCheckDigit=function(e,n){for(var o=0;o<=1;o++)for(var i=0;i<10;i++)if(n===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[o][i]){e.insert(0,"0"+o),e.append("0"+i);return}throw E.getNotFoundInstance()},t.prototype.getBarcodeFormat=function(){return T.UPC_E},t.convertUPCEtoUPCA=function(e){var n=e.slice(1,7).split("").map(function(a){return a.charCodeAt(0)}),o=new P;o.append(e.charAt(0));var i=n[5];switch(i){case 0:case 1:case 2:o.appendChars(n,0,2),o.append(i),o.append("0000"),o.appendChars(n,2,3);break;case 3:o.appendChars(n,0,3),o.append("00000"),o.appendChars(n,3,2);break;case 4:o.appendChars(n,0,4),o.append("00000"),o.append(n[4]);break;default:o.appendChars(n,0,5),o.append("0000"),o.append(i);break}return e.length>=8&&o.append(e.charAt(7)),o.toString()},t.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],t}(ut),Qn=lc;var hc=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Hi=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},dc=function(r){hc(t,r);function t(e){var n=r.call(this)||this,o=e==null?null:e.get(L.POSSIBLE_FORMATS),i=[];return o!=null&&(o.indexOf(T.EAN_13)>-1&&i.push(new Ye),o.indexOf(T.UPC_A)>-1&&i.push(new Kn),o.indexOf(T.EAN_8)>-1&&i.push(new Zn),o.indexOf(T.UPC_E)>-1&&i.push(new Qn)),i.length===0&&(i.push(new Ye),i.push(new Kn),i.push(new Zn),i.push(new Qn)),n.readers=i,n}return t.prototype.decodeRow=function(e,n,o){var i,a;try{for(var s=Hi(this.readers),f=s.next();!f.done;f=s.next()){var c=f.value;try{var u=c.decodeRow(e,n,o),l=u.getBarcodeFormat()===T.EAN_13&&u.getText().charAt(0)==="0",h=o==null?null:o.get(L.POSSIBLE_FORMATS),d=h==null||h.includes(T.UPC_A);if(l&&d){var p=u.getRawBytes(),v=new Y(u.getText().substring(1),p,p?p.length:null,u.getResultPoints(),T.UPC_A);return v.putAllMetadata(u.getResultMetadata()),v}return u}catch{}}}catch(g){i={error:g}}finally{try{f&&!f.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}throw new E},t.prototype.reset=function(){var e,n;try{for(var o=Hi(this.readers),i=o.next();!i.done;i=o.next()){var a=i.value;a.reset()}}catch(s){e={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}},t}(q),Jr=dc;var pc=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),vc=function(r){pc(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.CODA_BAR_CHAR_SET={nnnnnww:"0",nnnnwwn:"1",nnnwnnw:"2",wwnnnnn:"3",nnwnnwn:"4",wnnnnwn:"5",nwnnnnw:"6",nwnnwnn:"7",nwwnnnn:"8",wnnwnnn:"9",nnnwwnn:"-",nnwwnnn:"$",wnnnwnw:":",wnwnnnw:"/",wnwnwnn:".",nnwwwww:"+",nnwwnwn:"A",nwnwnnw:"B",nnnwnww:"C",nnnwwwn:"D"},e}return t.prototype.decodeRow=function(e,n,o){var i=this.getValidRowData(n);if(!i)throw new E;var a=this.codaBarDecodeRow(i.row);if(!a)throw new E;return new Y(a,null,0,[new D(i.left,e),new D(i.right,e)],T.CODABAR,new Date().getTime())},t.prototype.getValidRowData=function(e){var n=e.toArray(),o=n.indexOf(!0);if(o===-1)return null;var i=n.lastIndexOf(!0);if(i<=o)return null;n=n.slice(o,i+1);for(var a=[],s=n[0],f=1,c=1;c<n.length;c++)n[c]===s?f++:(s=n[c],a.push(f),f=1);return a.push(f),a.length<23&&(a.length+1)%8!==0?null:{row:a,left:o,right:i}},t.prototype.codaBarDecodeRow=function(e){for(var n=[],o=Math.ceil(e.reduce(function(f,c){return(f+c)/2},0));e.length>0;){var i=e.splice(0,8).splice(0,7),a=i.map(function(f){return f<o?"n":"w"}).join("");if(this.CODA_BAR_CHAR_SET[a]===void 0)return null;n.push(this.CODA_BAR_CHAR_SET[a])}var s=n.join("");return this.validCodaBarString(s)?s:null},t.prototype.validCodaBarString=function(e){var n=/^[A-D].{1,}[A-D]$/;return n.test(e)},t}(q),qn=vc;var mc=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),gc=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},xc=function(r){mc(t,r);function t(){var e=r.call(this)||this;return e.decodeFinderCounters=new Int32Array(4),e.dataCharacterCounters=new Int32Array(8),e.oddRoundingErrors=new Array(4),e.evenRoundingErrors=new Array(4),e.oddCounts=new Array(e.dataCharacterCounters.length/2),e.evenCounts=new Array(e.dataCharacterCounters.length/2),e}return t.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},t.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},t.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},t.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},t.prototype.getOddCounts=function(){return this.oddCounts},t.prototype.getEvenCounts=function(){return this.evenCounts},t.prototype.parseFinderValue=function(e,n){for(var o=0;o<n.length;o++)if(q.patternMatchVariance(e,n[o],t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return o;throw new E},t.count=function(e){return G.sum(new Int32Array(e))},t.increment=function(e,n){for(var o=0,i=n[0],a=1;a<e.length;a++)n[a]>i&&(i=n[a],o=a);e[o]++},t.decrement=function(e,n){for(var o=0,i=n[0],a=1;a<e.length;a++)n[a]<i&&(i=n[a],o=a);e[o]--},t.isFinderPattern=function(e){var n,o,i=e[0]+e[1],a=i+e[2]+e[3],s=i/a;if(s>=t.MIN_FINDER_PATTERN_RATIO&&s<=t.MAX_FINDER_PATTERN_RATIO){var f=Number.MAX_SAFE_INTEGER,c=Number.MIN_SAFE_INTEGER;try{for(var u=gc(e),l=u.next();!l.done;l=u.next()){var h=l.value;h>c&&(c=h),h<f&&(f=h)}}catch(d){n={error:d}}finally{try{l&&!l.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}return c<10*f}return!1},t.MAX_AVG_VARIANCE=.2,t.MAX_INDIVIDUAL_VARIANCE=.45,t.MIN_FINDER_PATTERN_RATIO=9.5/12,t.MAX_FINDER_PATTERN_RATIO=12.5/14,t}(q),ae=xc;var yc=function(){function r(t,e){this.value=t,this.checksumPortion=e}return r.prototype.getValue=function(){return this.value},r.prototype.getChecksumPortion=function(){return this.checksumPortion},r.prototype.toString=function(){return this.value+"("+this.checksumPortion+")"},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.value===e.value&&this.checksumPortion===e.checksumPortion},r.prototype.hashCode=function(){return this.value^this.checksumPortion},r}(),Ne=yc;var Cc=function(){function r(t,e,n,o,i){this.value=t,this.startEnd=e,this.value=t,this.startEnd=e,this.resultPoints=new Array,this.resultPoints.push(new D(n,i)),this.resultPoints.push(new D(o,i))}return r.prototype.getValue=function(){return this.value},r.prototype.getStartEnd=function(){return this.startEnd},r.prototype.getResultPoints=function(){return this.resultPoints},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.value===e.value},r.prototype.hashCode=function(){return this.value},r}(),tn=Cc;var Ec=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ac=function(){function r(){}return r.getRSSvalue=function(t,e,n){var o,i,a=0;try{for(var s=Ec(t),f=s.next();!f.done;f=s.next()){var c=f.value;a+=c}}catch(x){o={error:x}}finally{try{f&&!f.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}for(var u=0,l=0,h=t.length,d=0;d<h-1;d++){var p=void 0;for(p=1,l|=1<<d;p<t[d];p++,l&=~(1<<d)){var v=r.combins(a-p-1,h-d-2);if(n&&l===0&&a-p-(h-d-1)>=h-d-1&&(v-=r.combins(a-p-(h-d),h-d-2)),h-d-1>1){for(var g=0,y=a-p-(h-d-2);y>e;y--)g+=r.combins(a-p-y-1,h-d-3);v-=g*(h-1-d)}else a-p>e&&v--;u+=v}a-=p}return u},r.combins=function(t,e){var n,o;t-e>e?(o=e,n=t-e):(o=t-e,n=e);for(var i=1,a=1,s=t;s>n;s--)i*=s,a<=o&&(i/=a,a++);for(;a<=o;)i/=a,a++;return i},r}(),xe=Ac;var wc=function(){function r(){}return r.buildBitArray=function(t){var e=t.length*2-1;t[t.length-1].getRightChar()==null&&(e-=1);for(var n=12*e,o=new ot(n),i=0,a=t[0],s=a.getRightChar().getValue(),f=11;f>=0;--f)s&1<<f&&o.set(i),i++;for(var f=1;f<t.length;++f){for(var c=t[f],u=c.getLeftChar().getValue(),l=11;l>=0;--l)u&1<<l&&o.set(i),i++;if(c.getRightChar()!==null)for(var h=c.getRightChar().getValue(),l=11;l>=0;--l)h&1<<l&&o.set(i),i++}return o},r}(),Gi=wc;var _c=function(){function r(t,e){e?this.decodedInformation=null:(this.finished=t,this.decodedInformation=e)}return r.prototype.getDecodedInformation=function(){return this.decodedInformation},r.prototype.isFinished=function(){return this.finished},r}(),ye=_c;var Sc=function(){function r(t){this.newPosition=t}return r.prototype.getNewPosition=function(){return this.newPosition},r}(),Ze=Sc;var Ic=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Oc=function(r){Ic(t,r);function t(e,n){var o=r.call(this,e)||this;return o.value=n,o}return t.prototype.getValue=function(){return this.value},t.prototype.isFNC1=function(){return this.value===t.FNC1},t.FNC1="$",t}(Ze),Wt=Oc;var Tc=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Rc=function(r){Tc(t,r);function t(e,n,o){var i=r.call(this,e)||this;return o?(i.remaining=!0,i.remainingValue=i.remainingValue):(i.remaining=!1,i.remainingValue=0),i.newString=n,i}return t.prototype.getNewString=function(){return this.newString},t.prototype.isRemaining=function(){return this.remaining},t.prototype.getRemainingValue=function(){return this.remainingValue},t}(Ze),Ce=Rc;var Dc=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),bc=function(r){Dc(t,r);function t(e,n,o){var i=r.call(this,e)||this;if(n<0||n>10||o<0||o>10)throw new S;return i.firstDigit=n,i.secondDigit=o,i}return t.prototype.getFirstDigit=function(){return this.firstDigit},t.prototype.getSecondDigit=function(){return this.secondDigit},t.prototype.getValue=function(){return this.firstDigit*10+this.secondDigit},t.prototype.isFirstDigitFNC1=function(){return this.firstDigit===t.FNC1},t.prototype.isSecondDigitFNC1=function(){return this.secondDigit===t.FNC1},t.prototype.isAnyFNC1=function(){return this.firstDigit===t.FNC1||this.secondDigit===t.FNC1},t.FNC1=10,t}(Ze),Pe=bc;var en=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Nc=function(){function r(){}return r.parseFieldsInGeneralPurpose=function(t){var e,n,o,i,a,s,f,c;if(!t)return null;if(t.length<2)throw new E;var u=t.substring(0,2);try{for(var l=en(r.TWO_DIGIT_DATA_LENGTH),h=l.next();!h.done;h=l.next()){var d=h.value;if(d[0]===u)return d[1]===r.VARIABLE_LENGTH?r.processVariableAI(2,d[2],t):r.processFixedAI(2,d[1],t)}}catch(O){e={error:O}}finally{try{h&&!h.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}if(t.length<3)throw new E;var p=t.substring(0,3);try{for(var v=en(r.THREE_DIGIT_DATA_LENGTH),g=v.next();!g.done;g=v.next()){var d=g.value;if(d[0]===p)return d[1]===r.VARIABLE_LENGTH?r.processVariableAI(3,d[2],t):r.processFixedAI(3,d[1],t)}}catch(O){o={error:O}}finally{try{g&&!g.done&&(i=v.return)&&i.call(v)}finally{if(o)throw o.error}}try{for(var y=en(r.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),x=y.next();!x.done;x=y.next()){var d=x.value;if(d[0]===p)return d[1]===r.VARIABLE_LENGTH?r.processVariableAI(4,d[2],t):r.processFixedAI(4,d[1],t)}}catch(O){a={error:O}}finally{try{x&&!x.done&&(s=y.return)&&s.call(y)}finally{if(a)throw a.error}}if(t.length<4)throw new E;var C=t.substring(0,4);try{for(var w=en(r.FOUR_DIGIT_DATA_LENGTH),_=w.next();!_.done;_=w.next()){var d=_.value;if(d[0]===C)return d[1]===r.VARIABLE_LENGTH?r.processVariableAI(4,d[2],t):r.processFixedAI(4,d[1],t)}}catch(O){f={error:O}}finally{try{_&&!_.done&&(c=w.return)&&c.call(w)}finally{if(f)throw f.error}}throw new E},r.processFixedAI=function(t,e,n){if(n.length<t)throw new E;var o=n.substring(0,t);if(n.length<t+e)throw new E;var i=n.substring(t,t+e),a=n.substring(t+e),s="("+o+")"+i,f=r.parseFieldsInGeneralPurpose(a);return f==null?s:s+f},r.processVariableAI=function(t,e,n){var o=n.substring(0,t),i;n.length<t+e?i=n.length:i=t+e;var a=n.substring(t,i),s=n.substring(i),f="("+o+")"+a,c=r.parseFieldsInGeneralPurpose(s);return c==null?f:f+c},r.VARIABLE_LENGTH=[],r.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",r.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",r.VARIABLE_LENGTH,20],["22",r.VARIABLE_LENGTH,29],["30",r.VARIABLE_LENGTH,8],["37",r.VARIABLE_LENGTH,8],["90",r.VARIABLE_LENGTH,30],["91",r.VARIABLE_LENGTH,30],["92",r.VARIABLE_LENGTH,30],["93",r.VARIABLE_LENGTH,30],["94",r.VARIABLE_LENGTH,30],["95",r.VARIABLE_LENGTH,30],["96",r.VARIABLE_LENGTH,30],["97",r.VARIABLE_LENGTH,3],["98",r.VARIABLE_LENGTH,30],["99",r.VARIABLE_LENGTH,30]],r.THREE_DIGIT_DATA_LENGTH=[["240",r.VARIABLE_LENGTH,30],["241",r.VARIABLE_LENGTH,30],["242",r.VARIABLE_LENGTH,6],["250",r.VARIABLE_LENGTH,30],["251",r.VARIABLE_LENGTH,30],["253",r.VARIABLE_LENGTH,17],["254",r.VARIABLE_LENGTH,20],["400",r.VARIABLE_LENGTH,30],["401",r.VARIABLE_LENGTH,30],["402",17],["403",r.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",r.VARIABLE_LENGTH,20],["421",r.VARIABLE_LENGTH,15],["422",3],["423",r.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],r.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=[["310",6],["311",6],["312",6],["313",6],["314",6],["315",6],["316",6],["320",6],["321",6],["322",6],["323",6],["324",6],["325",6],["326",6],["327",6],["328",6],["329",6],["330",6],["331",6],["332",6],["333",6],["334",6],["335",6],["336",6],["340",6],["341",6],["342",6],["343",6],["344",6],["345",6],["346",6],["347",6],["348",6],["349",6],["350",6],["351",6],["352",6],["353",6],["354",6],["355",6],["356",6],["357",6],["360",6],["361",6],["362",6],["363",6],["364",6],["365",6],["366",6],["367",6],["368",6],["369",6],["390",r.VARIABLE_LENGTH,15],["391",r.VARIABLE_LENGTH,18],["392",r.VARIABLE_LENGTH,15],["393",r.VARIABLE_LENGTH,18],["703",r.VARIABLE_LENGTH,30]],r.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",r.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",r.VARIABLE_LENGTH,20],["8003",r.VARIABLE_LENGTH,30],["8004",r.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",r.VARIABLE_LENGTH,30],["8008",r.VARIABLE_LENGTH,12],["8018",18],["8020",r.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",r.VARIABLE_LENGTH,70],["8200",r.VARIABLE_LENGTH,70]],r}(),zi=Nc;var Pc=function(){function r(t){this.buffer=new P,this.information=t}return r.prototype.decodeAllCodes=function(t,e){var n=e,o=null;do{var i=this.decodeGeneralPurposeField(n,o),a=zi.parseFieldsInGeneralPurpose(i.getNewString());if(a!=null&&t.append(a),i.isRemaining()?o=""+i.getRemainingValue():o=null,n===i.getNewPosition())break;n=i.getNewPosition()}while(!0);return t.toString()},r.prototype.isStillNumeric=function(t){if(t+7>this.information.getSize())return t+4<=this.information.getSize();for(var e=t;e<t+3;++e)if(this.information.get(e))return!0;return this.information.get(t+3)},r.prototype.decodeNumeric=function(t){if(t+7>this.information.getSize()){var e=this.extractNumericValueFromBitArray(t,4);return e===0?new Pe(this.information.getSize(),Pe.FNC1,Pe.FNC1):new Pe(this.information.getSize(),e-1,Pe.FNC1)}var n=this.extractNumericValueFromBitArray(t,7),o=(n-8)/11,i=(n-8)%11;return new Pe(t+7,o,i)},r.prototype.extractNumericValueFromBitArray=function(t,e){return r.extractNumericValueFromBitArray(this.information,t,e)},r.extractNumericValueFromBitArray=function(t,e,n){for(var o=0,i=0;i<n;++i)t.get(e+i)&&(o|=1<<n-i-1);return o},r.prototype.decodeGeneralPurposeField=function(t,e){this.buffer.setLengthToZero(),e!=null&&this.buffer.append(e),this.current.setPosition(t);var n=this.parseBlocks();return n!=null&&n.isRemaining()?new Ce(this.current.getPosition(),this.buffer.toString(),n.getRemainingValue()):new Ce(this.current.getPosition(),this.buffer.toString())},r.prototype.parseBlocks=function(){var t,e;do{var n=this.current.getPosition();this.current.isAlpha()?(e=this.parseAlphaBlock(),t=e.isFinished()):this.current.isIsoIec646()?(e=this.parseIsoIec646Block(),t=e.isFinished()):(e=this.parseNumericBlock(),t=e.isFinished());var o=n!==this.current.getPosition();if(!o&&!t)break}while(!t);return e.getDecodedInformation()},r.prototype.parseNumericBlock=function(){for(;this.isStillNumeric(this.current.getPosition());){var t=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFirstDigitFNC1()){var e=void 0;return t.isSecondDigitFNC1()?e=new Ce(this.current.getPosition(),this.buffer.toString()):e=new Ce(this.current.getPosition(),this.buffer.toString(),t.getSecondDigit()),new ye(!0,e)}if(this.buffer.append(t.getFirstDigit()),t.isSecondDigitFNC1()){var e=new Ce(this.current.getPosition(),this.buffer.toString());return new ye(!0,e)}this.buffer.append(t.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new ye(!1)},r.prototype.parseIsoIec646Block=function(){for(;this.isStillIsoIec646(this.current.getPosition());){var t=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFNC1()){var e=new Ce(this.current.getPosition(),this.buffer.toString());return new ye(!0,e)}this.buffer.append(t.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new ye(!1)},r.prototype.parseAlphaBlock=function(){for(;this.isStillAlpha(this.current.getPosition());){var t=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFNC1()){var e=new Ce(this.current.getPosition(),this.buffer.toString());return new ye(!0,e)}this.buffer.append(t.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new ye(!1)},r.prototype.isStillIsoIec646=function(t){if(t+5>this.information.getSize())return!1;var e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+7>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(t,7);if(n>=64&&n<116)return!0;if(t+8>this.information.getSize())return!1;var o=this.extractNumericValueFromBitArray(t,8);return o>=232&&o<253},r.prototype.decodeIsoIec646=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(e===15)return new Wt(t+5,Wt.FNC1);if(e>=5&&e<15)return new Wt(t+5,"0"+(e-5));var n=this.extractNumericValueFromBitArray(t,7);if(n>=64&&n<90)return new Wt(t+7,""+(n+1));if(n>=90&&n<116)return new Wt(t+7,""+(n+7));var o=this.extractNumericValueFromBitArray(t,8),i;switch(o){case 232:i="!";break;case 233:i='"';break;case 234:i="%";break;case 235:i="&";break;case 236:i="'";break;case 237:i="(";break;case 238:i=")";break;case 239:i="*";break;case 240:i="+";break;case 241:i=",";break;case 242:i="-";break;case 243:i=".";break;case 244:i="/";break;case 245:i=":";break;case 246:i=";";break;case 247:i="<";break;case 248:i="=";break;case 249:i=">";break;case 250:i="?";break;case 251:i="_";break;case 252:i=" ";break;default:throw new S}return new Wt(t+8,i)},r.prototype.isStillAlpha=function(t){if(t+5>this.information.getSize())return!1;var e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+6>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(t,6);return n>=16&&n<63},r.prototype.decodeAlphanumeric=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(e===15)return new Wt(t+5,Wt.FNC1);if(e>=5&&e<15)return new Wt(t+5,"0"+(e-5));var n=this.extractNumericValueFromBitArray(t,6);if(n>=32&&n<58)return new Wt(t+6,""+(n+33));var o;switch(n){case 58:o="*";break;case 59:o=",";break;case 60:o="-";break;case 61:o=".";break;case 62:o="/";break;default:throw new mt("Decoding invalid alphanumeric value: "+n)}return new Wt(t+6,o)},r.prototype.isAlphaTo646ToAlphaLatch=function(t){if(t+1>this.information.getSize())return!1;for(var e=0;e<5&&e+t<this.information.getSize();++e)if(e===2){if(!this.information.get(t+2))return!1}else if(this.information.get(t+e))return!1;return!0},r.prototype.isAlphaOr646ToNumericLatch=function(t){if(t+3>this.information.getSize())return!1;for(var e=t;e<t+3;++e)if(this.information.get(e))return!1;return!0},r.prototype.isNumericToAlphaNumericLatch=function(t){if(t+1>this.information.getSize())return!1;for(var e=0;e<4&&e+t<this.information.getSize();++e)if(this.information.get(t+e))return!1;return!0},r}(),Ke=Pc;var Mc=function(){function r(t){this.information=t,this.generalDecoder=new Ke(t)}return r.prototype.getInformation=function(){return this.information},r.prototype.getGeneralDecoder=function(){return this.generalDecoder},r}(),vr=Mc;var Bc=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Fc=function(r){Bc(t,r);function t(e){return r.call(this,e)||this}return t.prototype.encodeCompressedGtin=function(e,n){e.append("(01)");var o=e.length();e.append("9"),this.encodeCompressedGtinWithoutAI(e,n,o)},t.prototype.encodeCompressedGtinWithoutAI=function(e,n,o){for(var i=0;i<4;++i){var a=this.getGeneralDecoder().extractNumericValueFromBitArray(n+10*i,10);a/100===0&&e.append("0"),a/10===0&&e.append("0"),e.append(a)}t.appendCheckDigit(e,o)},t.appendCheckDigit=function(e,n){for(var o=0,i=0;i<13;i++){var a=e.charAt(i+n).charCodeAt(0)-48;o+=i&1?a:3*a}o=10-o%10,o===10&&(o=0),e.append(o)},t.GTIN_SIZE=40,t}(vr),Pt=Fc;var Lc=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),kc=function(r){Lc(t,r);function t(e){return r.call(this,e)||this}return t.prototype.parseInformation=function(){var e=new P;e.append("(01)");var n=e.length(),o=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE,4);return e.append(o),this.encodeCompressedGtinWithoutAI(e,t.HEADER_SIZE+4,n),this.getGeneralDecoder().decodeAllCodes(e,t.HEADER_SIZE+44)},t.HEADER_SIZE=4,t}(Pt),Wi=kc;var Uc=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Vc=function(r){Uc(t,r);function t(e){return r.call(this,e)||this}return t.prototype.parseInformation=function(){var e=new P;return this.getGeneralDecoder().decodeAllCodes(e,t.HEADER_SIZE)},t.HEADER_SIZE=5,t}(vr),Xi=Vc;var Hc=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Gc=function(r){Hc(t,r);function t(e){return r.call(this,e)||this}return t.prototype.encodeCompressedWeight=function(e,n,o){var i=this.getGeneralDecoder().extractNumericValueFromBitArray(n,o);this.addWeightCode(e,i);for(var a=this.checkWeight(i),s=1e5,f=0;f<5;++f)a/s===0&&e.append("0"),s/=10;e.append(a)},t}(Pt),Qe=Gc;var zc=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Wc=function(r){zc(t,r);function t(e){return r.call(this,e)||this}return t.prototype.parseInformation=function(){if(this.getInformation().getSize()!==t.HEADER_SIZE+Qe.GTIN_SIZE+t.WEIGHT_SIZE)throw new E;var e=new P;return this.encodeCompressedGtin(e,t.HEADER_SIZE),this.encodeCompressedWeight(e,t.HEADER_SIZE+Qe.GTIN_SIZE,t.WEIGHT_SIZE),e.toString()},t.HEADER_SIZE=5,t.WEIGHT_SIZE=15,t}(Qe),rn=Wc;var Xc=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),jc=function(r){Xc(t,r);function t(e){return r.call(this,e)||this}return t.prototype.addWeightCode=function(e,n){e.append("(3103)")},t.prototype.checkWeight=function(e){return e},t}(rn),ji=jc;var Yc=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Zc=function(r){Yc(t,r);function t(e){return r.call(this,e)||this}return t.prototype.addWeightCode=function(e,n){n<1e4?e.append("(3202)"):e.append("(3203)")},t.prototype.checkWeight=function(e){return e<1e4?e:e-1e4},t}(rn),Yi=Zc;var Kc=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Qc=function(r){Kc(t,r);function t(e){return r.call(this,e)||this}return t.prototype.parseInformation=function(){if(this.getInformation().getSize()<t.HEADER_SIZE+Pt.GTIN_SIZE)throw new E;var e=new P;this.encodeCompressedGtin(e,t.HEADER_SIZE);var n=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+Pt.GTIN_SIZE,t.LAST_DIGIT_SIZE);e.append("(392"),e.append(n),e.append(")");var o=this.getGeneralDecoder().decodeGeneralPurposeField(t.HEADER_SIZE+Pt.GTIN_SIZE+t.LAST_DIGIT_SIZE,null);return e.append(o.getNewString()),e.toString()},t.HEADER_SIZE=8,t.LAST_DIGIT_SIZE=2,t}(Pt),Zi=Qc;var qc=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),$c=function(r){qc(t,r);function t(e){return r.call(this,e)||this}return t.prototype.parseInformation=function(){if(this.getInformation().getSize()<t.HEADER_SIZE+Pt.GTIN_SIZE)throw new E;var e=new P;this.encodeCompressedGtin(e,t.HEADER_SIZE);var n=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+Pt.GTIN_SIZE,t.LAST_DIGIT_SIZE);e.append("(393"),e.append(n),e.append(")");var o=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+Pt.GTIN_SIZE+t.LAST_DIGIT_SIZE,t.FIRST_THREE_DIGITS_SIZE);o/100===0&&e.append("0"),o/10===0&&e.append("0"),e.append(o);var i=this.getGeneralDecoder().decodeGeneralPurposeField(t.HEADER_SIZE+Pt.GTIN_SIZE+t.LAST_DIGIT_SIZE+t.FIRST_THREE_DIGITS_SIZE,null);return e.append(i.getNewString()),e.toString()},t.HEADER_SIZE=8,t.LAST_DIGIT_SIZE=2,t.FIRST_THREE_DIGITS_SIZE=10,t}(Pt),Ki=$c;var Jc=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),tu=function(r){Jc(t,r);function t(e,n,o){var i=r.call(this,e)||this;return i.dateCode=o,i.firstAIdigits=n,i}return t.prototype.parseInformation=function(){if(this.getInformation().getSize()!==t.HEADER_SIZE+t.GTIN_SIZE+t.WEIGHT_SIZE+t.DATE_SIZE)throw new E;var e=new P;return this.encodeCompressedGtin(e,t.HEADER_SIZE),this.encodeCompressedWeight(e,t.HEADER_SIZE+t.GTIN_SIZE,t.WEIGHT_SIZE),this.encodeCompressedDate(e,t.HEADER_SIZE+t.GTIN_SIZE+t.WEIGHT_SIZE),e.toString()},t.prototype.encodeCompressedDate=function(e,n){var o=this.getGeneralDecoder().extractNumericValueFromBitArray(n,t.DATE_SIZE);if(o!==38400){e.append("("),e.append(this.dateCode),e.append(")");var i=o%32;o/=32;var a=o%12+1;o/=12;var s=o;s/10===0&&e.append("0"),e.append(s),a/10===0&&e.append("0"),e.append(a),i/10===0&&e.append("0"),e.append(i)}},t.prototype.addWeightCode=function(e,n){e.append("("),e.append(this.firstAIdigits),e.append(n/1e5),e.append(")")},t.prototype.checkWeight=function(e){return e%1e5},t.HEADER_SIZE=8,t.WEIGHT_SIZE=20,t.DATE_SIZE=16,t}(Qe),se=tu;function $n(r){try{if(r.get(1))return new Wi(r);if(!r.get(2))return new Xi(r);var t=Ke.extractNumericValueFromBitArray(r,1,4);switch(t){case 4:return new ji(r);case 5:return new Yi(r)}var e=Ke.extractNumericValueFromBitArray(r,1,5);switch(e){case 12:return new Zi(r);case 13:return new Ki(r)}var n=Ke.extractNumericValueFromBitArray(r,1,7);switch(n){case 56:return new se(r,"310","11");case 57:return new se(r,"320","11");case 58:return new se(r,"310","13");case 59:return new se(r,"320","13");case 60:return new se(r,"310","15");case 61:return new se(r,"320","15");case 62:return new se(r,"310","17");case 63:return new se(r,"320","17")}}catch(o){throw console.log(o),new mt("unknown decoder: "+r)}}var eu=function(){function r(t,e,n,o){this.leftchar=t,this.rightchar=e,this.finderpattern=n,this.maybeLast=o}return r.prototype.mayBeLast=function(){return this.maybeLast},r.prototype.getLeftChar=function(){return this.leftchar},r.prototype.getRightChar=function(){return this.rightchar},r.prototype.getFinderPattern=function(){return this.finderpattern},r.prototype.mustBeLast=function(){return this.rightchar==null},r.prototype.toString=function(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(this.finderpattern==null?"null":this.finderpattern.getValue())+" ]"},r.equals=function(t,e){return t instanceof r?r.equalsOrNull(t.leftchar,e.leftchar)&&r.equalsOrNull(t.rightchar,e.rightchar)&&r.equalsOrNull(t.finderpattern,e.finderpattern):!1},r.equalsOrNull=function(t,e){return t===null?e===null:r.equals(t,e)},r.prototype.hashCode=function(){var t=this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue();return t},r}(),Jn=eu;var ru=function(){function r(t,e,n){this.pairs=t,this.rowNumber=e,this.wasReversed=n}return r.prototype.getPairs=function(){return this.pairs},r.prototype.getRowNumber=function(){return this.rowNumber},r.prototype.isReversed=function(){return this.wasReversed},r.prototype.isEquivalent=function(t){return this.checkEqualitity(this,t)},r.prototype.toString=function(){return"{ "+this.pairs+" }"},r.prototype.equals=function(t,e){return t instanceof r?this.checkEqualitity(t,e)&&t.wasReversed===e.wasReversed:!1},r.prototype.checkEqualitity=function(t,e){if(!(!t||!e)){var n;return t.forEach(function(o,i){e.forEach(function(a){o.getLeftChar().getValue()===a.getLeftChar().getValue()&&o.getRightChar().getValue()===a.getRightChar().getValue()&&o.getFinderPatter().getValue()===a.getFinderPatter().getValue()&&(n=!0)})}),n}},r}(),Qi=ru;var nu=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ee=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ou=function(r){nu(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.pairs=new Array(t.MAX_PAIRS),e.rows=new Array,e.startEnd=[2],e}return t.prototype.decodeRow=function(e,n,o){this.pairs.length=0,this.startFromEven=!1;try{return t.constructResult(this.decodeRow2pairs(e,n))}catch{}return this.pairs.length=0,this.startFromEven=!0,t.constructResult(this.decodeRow2pairs(e,n))},t.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},t.prototype.decodeRow2pairs=function(e,n){for(var o=!1;!o;)try{this.pairs.push(this.retrieveNextPair(n,this.pairs,e))}catch(s){if(s instanceof E){if(!this.pairs.length)throw new E;o=!0}}if(this.checkChecksum())return this.pairs;var i;if(this.rows.length?i=!0:i=!1,this.storeRow(e,!1),i){var a=this.checkRowsBoolean(!1);if(a!=null||(a=this.checkRowsBoolean(!0),a!=null))return a}throw new E},t.prototype.checkRowsBoolean=function(e){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,e&&(this.rows=this.rows.reverse());var n=null;try{n=this.checkRows(new Array,0)}catch(o){console.log(o)}return e&&(this.rows=this.rows.reverse()),n},t.prototype.checkRows=function(e,n){for(var o,i,a=n;a<this.rows.length;a++){var s=this.rows[a];this.pairs.length=0;try{for(var f=(o=void 0,Ee(e)),c=f.next();!c.done;c=f.next()){var u=c.value;this.pairs.push(u.getPairs())}}catch(h){o={error:h}}finally{try{c&&!c.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}if(this.pairs.push(s.getPairs()),!!t.isValidSequence(this.pairs)){if(this.checkChecksum())return this.pairs;var l=new Array(e);l.push(s);try{return this.checkRows(l,a+1)}catch(h){console.log(h)}}}throw new E},t.isValidSequence=function(e){var n,o;try{for(var i=Ee(t.FINDER_PATTERN_SEQUENCES),a=i.next();!a.done;a=i.next()){var s=a.value;if(!(e.length>s.length)){for(var f=!0,c=0;c<e.length;c++)if(e[c].getFinderPattern().getValue()!==s[c]){f=!1;break}if(f)return!0}}}catch(u){n={error:u}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return!1},t.prototype.storeRow=function(e,n){for(var o=0,i=!1,a=!1;o<this.rows.length;){var s=this.rows[o];if(s.getRowNumber()>e){a=s.isEquivalent(this.pairs);break}i=s.isEquivalent(this.pairs),o++}a||i||t.isPartialRow(this.pairs,this.rows)||(this.rows.push(o,new Qi(this.pairs,e,n)),this.removePartialRows(this.pairs,this.rows))},t.prototype.removePartialRows=function(e,n){var o,i,a,s,f,c;try{for(var u=Ee(n),l=u.next();!l.done;l=u.next()){var h=l.value;if(h.getPairs().length!==e.length){var d=!0;try{for(var p=(a=void 0,Ee(h.getPairs())),v=p.next();!v.done;v=p.next()){var g=v.value,y=!1;try{for(var x=(f=void 0,Ee(e)),C=x.next();!C.done;C=x.next()){var w=C.value;if(Jn.equals(g,w)){y=!0;break}}}catch(_){f={error:_}}finally{try{C&&!C.done&&(c=x.return)&&c.call(x)}finally{if(f)throw f.error}}y||(d=!1)}}catch(_){a={error:_}}finally{try{v&&!v.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}}}}catch(_){o={error:_}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}},t.isPartialRow=function(e,n){var o,i,a,s,f,c;try{for(var u=Ee(n),l=u.next();!l.done;l=u.next()){var h=l.value,d=!0;try{for(var p=(a=void 0,Ee(e)),v=p.next();!v.done;v=p.next()){var g=v.value,y=!1;try{for(var x=(f=void 0,Ee(h.getPairs())),C=x.next();!C.done;C=x.next()){var w=C.value;if(g.equals(w)){y=!0;break}}}catch(_){f={error:_}}finally{try{C&&!C.done&&(c=x.return)&&c.call(x)}finally{if(f)throw f.error}}if(!y){d=!1;break}}}catch(_){a={error:_}}finally{try{v&&!v.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}if(d)return!0}}catch(_){o={error:_}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}return!1},t.prototype.getRows=function(){return this.rows},t.constructResult=function(e){var n=Gi.buildBitArray(e),o=$n(n),i=o.parseInformation(),a=e[0].getFinderPattern().getResultPoints(),s=e[e.length-1].getFinderPattern().getResultPoints(),f=[a[0],a[1],s[0],s[1]];return new Y(i,null,null,f,T.RSS_EXPANDED,null)},t.prototype.checkChecksum=function(){var e=this.pairs.get(0),n=e.getLeftChar(),o=e.getRightChar();if(o===null)return!1;for(var i=o.getChecksumPortion(),a=2,s=1;s<this.pairs.size();++s){var f=this.pairs.get(s);i+=f.getLeftChar().getChecksumPortion(),a++;var c=f.getRightChar();c!=null&&(i+=c.getChecksumPortion(),a++)}i%=211;var u=211*(a-4)+i;return u===n.getValue()},t.getNextSecondBar=function(e,n){var o;return e.get(n)?(o=e.getNextUnset(n),o=e.getNextSet(o)):(o=e.getNextSet(n),o=e.getNextUnset(o)),o},t.prototype.retrieveNextPair=function(e,n,o){var i=n.length%2===0;this.startFromEven&&(i=!i);var a,s=!0,f=-1;do this.findNextPair(e,n,f),a=this.parseFoundFinderPattern(e,o,i),a===null?f=t.getNextSecondBar(e,this.startEnd[0]):s=!1;while(s);var c=this.decodeDataCharacter(e,a,i,!0);if(!this.isEmptyPair(n)&&n[n.length-1].mustBeLast())throw new E;var u;try{u=this.decodeDataCharacter(e,a,i,!1)}catch(l){u=null,console.log(l)}return new Jn(c,u,a,!0)},t.prototype.isEmptyPair=function(e){return e.length===0},t.prototype.findNextPair=function(e,n,o){var i=this.getDecodeFinderCounters();i[0]=0,i[1]=0,i[2]=0,i[3]=0;var a=e.getSize(),s;if(o>=0)s=o;else if(this.isEmptyPair(n))s=0;else{var f=n[n.length-1];s=f.getFinderPattern().getStartEnd()[1]}var c=n.length%2!==0;this.startFromEven&&(c=!c);for(var u=!1;s<a&&(u=!e.get(s),!!u);)s++;for(var l=0,h=s,d=s;d<a;d++)if(e.get(d)!==u)i[l]++;else{if(l===3){if(c&&t.reverseCounters(i),t.isFinderPattern(i)){this.startEnd[0]=h,this.startEnd[1]=d;return}c&&t.reverseCounters(i),h+=i[0]+i[1],i[0]=i[2],i[1]=i[3],i[2]=0,i[3]=0,l--}else l++;i[l]=1,u=!u}throw new E},t.reverseCounters=function(e){for(var n=e.length,o=0;o<n/2;++o){var i=e[o];e[o]=e[n-o-1],e[n-o-1]=i}},t.prototype.parseFoundFinderPattern=function(e,n,o){var i,a,s;if(o){for(var f=this.startEnd[0]-1;f>=0&&!e.get(f);)f--;f++,i=this.startEnd[0]-f,a=f,s=this.startEnd[1]}else a=this.startEnd[0],s=e.getNextUnset(this.startEnd[1]+1),i=s-this.startEnd[1];var c=this.getDecodeFinderCounters();H.arraycopy(c,0,c,1,c.length-1),c[0]=i;var u;try{u=this.parseFinderValue(c,t.FINDER_PATTERNS)}catch{return null}return new tn(u,[a,s],a,s,n)},t.prototype.decodeDataCharacter=function(e,n,o,i){for(var a=this.getDataCharacterCounters(),s=0;s<a.length;s++)a[s]=0;if(i)t.recordPatternInReverse(e,n.getStartEnd()[0],a);else{t.recordPattern(e,n.getStartEnd()[1],a);for(var f=0,c=a.length-1;f<c;f++,c--){var u=a[f];a[f]=a[c],a[c]=u}}var l=17,h=G.sum(new Int32Array(a))/l,d=(n.getStartEnd()[1]-n.getStartEnd()[0])/15;if(Math.abs(h-d)/d>.3)throw new E;for(var p=this.getOddCounts(),v=this.getEvenCounts(),g=this.getOddRoundingErrors(),y=this.getEvenRoundingErrors(),f=0;f<a.length;f++){var x=1*a[f]/h,C=x+.5;if(C<1){if(x<.3)throw new E;C=1}else if(C>8){if(x>8.7)throw new E;C=8}var w=f/2;f&1?(v[w]=C,y[w]=x-C):(p[w]=C,g[w]=x-C)}this.adjustOddEvenCounts(l);for(var _=4*n.getValue()+(o?0:2)+(i?0:1)-1,O=0,R=0,f=p.length-1;f>=0;f--){if(t.isNotA1left(n,o,i)){var N=t.WEIGHTS[_][2*f];R+=p[f]*N}O+=p[f]}for(var k=0,f=v.length-1;f>=0;f--)if(t.isNotA1left(n,o,i)){var N=t.WEIGHTS[_][2*f+1];k+=v[f]*N}var B=R+k;if(O&1||O>13||O<4)throw new E;var vt=(13-O)/2,j=t.SYMBOL_WIDEST[vt],ct=9-j,kt=xe.getRSSvalue(p,j,!0),le=xe.getRSSvalue(v,ct,!1),Sn=t.EVEN_TOTAL_SUBSET[vt],In=t.GSUM[vt],On=kt*Sn+le+In;return new Ne(On,B)},t.isNotA1left=function(e,n,o){return!(e.getValue()===0&&n&&o)},t.prototype.adjustOddEvenCounts=function(e){var n=G.sum(new Int32Array(this.getOddCounts())),o=G.sum(new Int32Array(this.getEvenCounts())),i=!1,a=!1;n>13?a=!0:n<4&&(i=!0);var s=!1,f=!1;o>13?f=!0:o<4&&(s=!0);var c=n+o-e,u=(n&1)===1,l=(o&1)===0;if(c===1)if(u){if(l)throw new E;a=!0}else{if(!l)throw new E;f=!0}else if(c===-1)if(u){if(l)throw new E;i=!0}else{if(!l)throw new E;s=!0}else if(c===0){if(u){if(!l)throw new E;n<o?(i=!0,f=!0):(a=!0,s=!0)}else if(l)throw new E}else throw new E;if(i){if(a)throw new E;t.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(a&&t.decrement(this.getOddCounts(),this.getOddRoundingErrors()),s){if(f)throw new E;t.increment(this.getEvenCounts(),this.getOddRoundingErrors())}f&&t.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},t.SYMBOL_WIDEST=[7,5,4,3,1],t.EVEN_TOTAL_SUBSET=[4,20,52,104,204],t.GSUM=[0,348,1388,2948,3988],t.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])],t.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,91],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]],t.FINDER_PAT_A=0,t.FINDER_PAT_B=1,t.FINDER_PAT_C=2,t.FINDER_PAT_D=3,t.FINDER_PAT_E=4,t.FINDER_PAT_F=5,t.FINDER_PATTERN_SEQUENCES=[[t.FINDER_PAT_A,t.FINDER_PAT_A],[t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B],[t.FINDER_PAT_A,t.FINDER_PAT_C,t.FINDER_PAT_B,t.FINDER_PAT_D],[t.FINDER_PAT_A,t.FINDER_PAT_E,t.FINDER_PAT_B,t.FINDER_PAT_D,t.FINDER_PAT_C],[t.FINDER_PAT_A,t.FINDER_PAT_E,t.FINDER_PAT_B,t.FINDER_PAT_D,t.FINDER_PAT_D,t.FINDER_PAT_F],[t.FINDER_PAT_A,t.FINDER_PAT_E,t.FINDER_PAT_B,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_F,t.FINDER_PAT_F],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_D],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_E],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_F,t.FINDER_PAT_F],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_E,t.FINDER_PAT_F,t.FINDER_PAT_F]],t.MAX_PAIRS=11,t}(ae),to=ou;var iu=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),au=function(r){iu(t,r);function t(e,n,o){var i=r.call(this,e,n)||this;return i.count=0,i.finderPattern=o,i}return t.prototype.getFinderPattern=function(){return this.finderPattern},t.prototype.getCount=function(){return this.count},t.prototype.incrementCount=function(){this.count++},t}(Ne),qi=au;var su=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),eo=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},fu=function(r){su(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.possibleLeftPairs=[],e.possibleRightPairs=[],e}return t.prototype.decodeRow=function(e,n,o){var i,a,s,f,c=this.decodePair(n,!1,e,o);t.addOrTally(this.possibleLeftPairs,c),n.reverse();var u=this.decodePair(n,!0,e,o);t.addOrTally(this.possibleRightPairs,u),n.reverse();try{for(var l=eo(this.possibleLeftPairs),h=l.next();!h.done;h=l.next()){var d=h.value;if(d.getCount()>1)try{for(var p=(s=void 0,eo(this.possibleRightPairs)),v=p.next();!v.done;v=p.next()){var g=v.value;if(g.getCount()>1&&t.checkChecksum(d,g))return t.constructResult(d,g)}}catch(y){s={error:y}}finally{try{v&&!v.done&&(f=p.return)&&f.call(p)}finally{if(s)throw s.error}}}}catch(y){i={error:y}}finally{try{h&&!h.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}throw new E},t.addOrTally=function(e,n){var o,i;if(n!=null){var a=!1;try{for(var s=eo(e),f=s.next();!f.done;f=s.next()){var c=f.value;if(c.getValue()===n.getValue()){c.incrementCount(),a=!0;break}}}catch(u){o={error:u}}finally{try{f&&!f.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}a||e.push(n)}},t.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},t.constructResult=function(e,n){for(var o=4537077*e.getValue()+n.getValue(),i=new String(o).toString(),a=new P,s=13-i.length;s>0;s--)a.append("0");a.append(i);for(var f=0,s=0;s<13;s++){var c=a.charAt(s).charCodeAt(0)-48;f+=s&1?c:3*c}f=10-f%10,f===10&&(f=0),a.append(f.toString());var u=e.getFinderPattern().getResultPoints(),l=n.getFinderPattern().getResultPoints();return new Y(a.toString(),null,0,[u[0],u[1],l[0],l[1]],T.RSS_14,new Date().getTime())},t.checkChecksum=function(e,n){var o=(e.getChecksumPortion()+16*n.getChecksumPortion())%79,i=9*e.getFinderPattern().getValue()+n.getFinderPattern().getValue();return i>72&&i--,i>8&&i--,o===i},t.prototype.decodePair=function(e,n,o,i){try{var a=this.findFinderPattern(e,n),s=this.parseFoundFinderPattern(e,o,n,a),f=i==null?null:i.get(L.NEED_RESULT_POINT_CALLBACK);if(f!=null){var c=(a[0]+a[1])/2;n&&(c=e.getSize()-1-c),f.foundPossibleResultPoint(new D(c,o))}var u=this.decodeDataCharacter(e,s,!0),l=this.decodeDataCharacter(e,s,!1);return new qi(1597*u.getValue()+l.getValue(),u.getChecksumPortion()+4*l.getChecksumPortion(),s)}catch{return null}},t.prototype.decodeDataCharacter=function(e,n,o){for(var i=this.getDataCharacterCounters(),a=0;a<i.length;a++)i[a]=0;if(o)q.recordPatternInReverse(e,n.getStartEnd()[0],i);else{q.recordPattern(e,n.getStartEnd()[1]+1,i);for(var s=0,f=i.length-1;s<f;s++,f--){var c=i[s];i[s]=i[f],i[f]=c}}for(var u=o?16:15,l=G.sum(new Int32Array(i))/u,h=this.getOddCounts(),d=this.getEvenCounts(),p=this.getOddRoundingErrors(),v=this.getEvenRoundingErrors(),s=0;s<i.length;s++){var g=i[s]/l,y=Math.floor(g+.5);y<1?y=1:y>8&&(y=8);var x=Math.floor(s/2);s&1?(d[x]=y,v[x]=g-y):(h[x]=y,p[x]=g-y)}this.adjustOddEvenCounts(o,u);for(var C=0,w=0,s=h.length-1;s>=0;s--)w*=9,w+=h[s],C+=h[s];for(var _=0,O=0,s=d.length-1;s>=0;s--)_*=9,_+=d[s],O+=d[s];var R=w+3*_;if(o){if(C&1||C>12||C<4)throw new E;var N=(12-C)/2,k=t.OUTSIDE_ODD_WIDEST[N],B=9-k,vt=xe.getRSSvalue(h,k,!1),j=xe.getRSSvalue(d,B,!0),ct=t.OUTSIDE_EVEN_TOTAL_SUBSET[N],kt=t.OUTSIDE_GSUM[N];return new Ne(vt*ct+j+kt,R)}else{if(O&1||O>10||O<4)throw new E;var N=(10-O)/2,k=t.INSIDE_ODD_WIDEST[N],B=9-k,vt=xe.getRSSvalue(h,k,!0),j=xe.getRSSvalue(d,B,!1),le=t.INSIDE_ODD_TOTAL_SUBSET[N],kt=t.INSIDE_GSUM[N];return new Ne(j*le+vt+kt,R)}},t.prototype.findFinderPattern=function(e,n){var o=this.getDecodeFinderCounters();o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var i=e.getSize(),a=!1,s=0;s<i&&(a=!e.get(s),n!==a);)s++;for(var f=0,c=s,u=s;u<i;u++)if(e.get(u)!==a)o[f]++;else{if(f===3){if(ae.isFinderPattern(o))return[c,u];c+=o[0]+o[1],o[0]=o[2],o[1]=o[3],o[2]=0,o[3]=0,f--}else f++;o[f]=1,a=!a}throw new E},t.prototype.parseFoundFinderPattern=function(e,n,o,i){for(var a=e.get(i[0]),s=i[0]-1;s>=0&&a!==e.get(s);)s--;s++;var f=i[0]-s,c=this.getDecodeFinderCounters(),u=new Int32Array(c.length);H.arraycopy(c,0,u,1,c.length-1),u[0]=f;var l=this.parseFinderValue(u,t.FINDER_PATTERNS),h=s,d=i[1];return o&&(h=e.getSize()-1-h,d=e.getSize()-1-d),new tn(l,[s,i[1]],h,d,n)},t.prototype.adjustOddEvenCounts=function(e,n){var o=G.sum(new Int32Array(this.getOddCounts())),i=G.sum(new Int32Array(this.getEvenCounts())),a=!1,s=!1,f=!1,c=!1;e?(o>12?s=!0:o<4&&(a=!0),i>12?c=!0:i<4&&(f=!0)):(o>11?s=!0:o<5&&(a=!0),i>10?c=!0:i<4&&(f=!0));var u=o+i-n,l=(o&1)===(e?1:0),h=(i&1)===1;if(u===1)if(l){if(h)throw new E;s=!0}else{if(!h)throw new E;c=!0}else if(u===-1)if(l){if(h)throw new E;a=!0}else{if(!h)throw new E;f=!0}else if(u===0){if(l){if(!h)throw new E;o<i?(a=!0,c=!0):(s=!0,f=!0)}else if(h)throw new E}else throw new E;if(a){if(s)throw new E;ae.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(s&&ae.decrement(this.getOddCounts(),this.getOddRoundingErrors()),f){if(c)throw new E;ae.increment(this.getEvenCounts(),this.getOddRoundingErrors())}c&&ae.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},t.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],t.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],t.OUTSIDE_GSUM=[0,161,961,2015,2715],t.INSIDE_GSUM=[0,336,1036,1516],t.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],t.INSIDE_ODD_WIDEST=[2,4,6,8],t.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])],t}(ae),nn=fu;var cu=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),uu=function(r){cu(t,r);function t(e){var n=r.call(this)||this;n.readers=[];var o=e?e.get(L.POSSIBLE_FORMATS):null,i=e&&e.get(L.ASSUME_CODE_39_CHECK_DIGIT)!==void 0;return o&&((o.includes(T.EAN_13)||o.includes(T.UPC_A)||o.includes(T.EAN_8)||o.includes(T.UPC_E))&&n.readers.push(new Jr(e)),o.includes(T.CODE_39)&&n.readers.push(new Qr(i)),o.includes(T.CODE_93)&&n.readers.push(new qr),o.includes(T.CODE_128)&&n.readers.push(new Kr),o.includes(T.ITF)&&n.readers.push(new $r),o.includes(T.CODABAR)&&n.readers.push(new qn),o.includes(T.RSS_14)&&n.readers.push(new nn),o.includes(T.RSS_EXPANDED)&&(console.warn("RSS Expanded reader IS NOT ready for production yet! use at your own risk."),n.readers.push(new to))),n.readers.length===0&&(n.readers.push(new Jr(e)),n.readers.push(new Qr),n.readers.push(new qr),n.readers.push(new Jr(e)),n.readers.push(new Kr),n.readers.push(new $r),n.readers.push(new nn)),n}return t.prototype.decodeRow=function(e,n,o){for(var i=0;i<this.readers.length;i++)try{return this.readers[i].decodeRow(e,n,o)}catch{}throw new E},t.prototype.reset=function(){this.readers.forEach(function(e){return e.reset()})},t}(q),te=uu;var lu=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Mg=function(r){lu(t,r);function t(e,n){return e===void 0&&(e=500),r.call(this,new te(n),e,n)||this}return t}(Gt);var $i=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},$=function(){function r(t,e,n){this.ecCodewords=t,this.ecBlocks=[e],n&&this.ecBlocks.push(n)}return r.prototype.getECCodewords=function(){return this.ecCodewords},r.prototype.getECBlocks=function(){return this.ecBlocks},r}();var K=function(){function r(t,e){this.count=t,this.dataCodewords=e}return r.prototype.getCount=function(){return this.count},r.prototype.getDataCodewords=function(){return this.dataCodewords},r}();var hu=function(){function r(t,e,n,o,i,a){var s,f;this.versionNumber=t,this.symbolSizeRows=e,this.symbolSizeColumns=n,this.dataRegionSizeRows=o,this.dataRegionSizeColumns=i,this.ecBlocks=a;var c=0,u=a.getECCodewords(),l=a.getECBlocks();try{for(var h=$i(l),d=h.next();!d.done;d=h.next()){var p=d.value;c+=p.getCount()*(p.getDataCodewords()+u)}}catch(v){s={error:v}}finally{try{d&&!d.done&&(f=h.return)&&f.call(h)}finally{if(s)throw s.error}}this.totalCodewords=c}return r.prototype.getVersionNumber=function(){return this.versionNumber},r.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},r.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},r.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},r.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},r.prototype.getTotalCodewords=function(){return this.totalCodewords},r.prototype.getECBlocks=function(){return this.ecBlocks},r.getVersionForDimensions=function(t,e){var n,o;if(t&1||e&1)throw new S;try{for(var i=$i(r.VERSIONS),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.symbolSizeRows===t&&s.symbolSizeColumns===e)return s}}catch(f){n={error:f}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}throw new S},r.prototype.toString=function(){return""+this.versionNumber},r.buildVersions=function(){return[new r(1,10,10,8,8,new $(5,new K(1,3))),new r(2,12,12,10,10,new $(7,new K(1,5))),new r(3,14,14,12,12,new $(10,new K(1,8))),new r(4,16,16,14,14,new $(12,new K(1,12))),new r(5,18,18,16,16,new $(14,new K(1,18))),new r(6,20,20,18,18,new $(18,new K(1,22))),new r(7,22,22,20,20,new $(20,new K(1,30))),new r(8,24,24,22,22,new $(24,new K(1,36))),new r(9,26,26,24,24,new $(28,new K(1,44))),new r(10,32,32,14,14,new $(36,new K(1,62))),new r(11,36,36,16,16,new $(42,new K(1,86))),new r(12,40,40,18,18,new $(48,new K(1,114))),new r(13,44,44,20,20,new $(56,new K(1,144))),new r(14,48,48,22,22,new $(68,new K(1,174))),new r(15,52,52,24,24,new $(42,new K(2,102))),new r(16,64,64,14,14,new $(56,new K(2,140))),new r(17,72,72,16,16,new $(36,new K(4,92))),new r(18,80,80,18,18,new $(48,new K(4,114))),new r(19,88,88,20,20,new $(56,new K(4,144))),new r(20,96,96,22,22,new $(68,new K(4,174))),new r(21,104,104,24,24,new $(56,new K(6,136))),new r(22,120,120,18,18,new $(68,new K(6,175))),new r(23,132,132,20,20,new $(62,new K(8,163))),new r(24,144,144,22,22,new $(62,new K(8,156),new K(2,155))),new r(25,8,18,6,16,new $(7,new K(1,5))),new r(26,8,32,6,14,new $(11,new K(1,10))),new r(27,12,26,10,24,new $(14,new K(1,16))),new r(28,12,36,10,16,new $(18,new K(1,22))),new r(29,16,36,14,16,new $(24,new K(1,32))),new r(30,16,48,14,22,new $(28,new K(1,49)))]},r.VERSIONS=r.buildVersions(),r}(),Ji=hu;var du=function(){function r(t){var e=t.getHeight();if(e<8||e>144||e&1)throw new S;this.version=r.readVersion(t),this.mappingBitMatrix=this.extractDataRegion(t),this.readMappingMatrix=new at(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return r.prototype.getVersion=function(){return this.version},r.readVersion=function(t){var e=t.getHeight(),n=t.getWidth();return Ji.getVersionForDimensions(e,n)},r.prototype.readCodewords=function(){var t=new Int8Array(this.version.getTotalCodewords()),e=0,n=4,o=0,i=this.mappingBitMatrix.getHeight(),a=this.mappingBitMatrix.getWidth(),s=!1,f=!1,c=!1,u=!1;do if(n===i&&o===0&&!s)t[e++]=this.readCorner1(i,a)&255,n-=2,o+=2,s=!0;else if(n===i-2&&o===0&&a&3&&!f)t[e++]=this.readCorner2(i,a)&255,n-=2,o+=2,f=!0;else if(n===i+4&&o===2&&!(a&7)&&!c)t[e++]=this.readCorner3(i,a)&255,n-=2,o+=2,c=!0;else if(n===i-2&&o===0&&(a&7)===4&&!u)t[e++]=this.readCorner4(i,a)&255,n-=2,o+=2,u=!0;else{do n<i&&o>=0&&!this.readMappingMatrix.get(o,n)&&(t[e++]=this.readUtah(n,o,i,a)&255),n-=2,o+=2;while(n>=0&&o<a);n+=1,o+=3;do n>=0&&o<a&&!this.readMappingMatrix.get(o,n)&&(t[e++]=this.readUtah(n,o,i,a)&255),n+=2,o-=2;while(n<i&&o>=0);n+=3,o+=1}while(n<i||o<a);if(e!==this.version.getTotalCodewords())throw new S;return t},r.prototype.readModule=function(t,e,n,o){return t<0&&(t+=n,e+=4-(n+4&7)),e<0&&(e+=o,t+=4-(o+4&7)),this.readMappingMatrix.set(e,t),this.mappingBitMatrix.get(e,t)},r.prototype.readUtah=function(t,e,n,o){var i=0;return this.readModule(t-2,e-2,n,o)&&(i|=1),i<<=1,this.readModule(t-2,e-1,n,o)&&(i|=1),i<<=1,this.readModule(t-1,e-2,n,o)&&(i|=1),i<<=1,this.readModule(t-1,e-1,n,o)&&(i|=1),i<<=1,this.readModule(t-1,e,n,o)&&(i|=1),i<<=1,this.readModule(t,e-2,n,o)&&(i|=1),i<<=1,this.readModule(t,e-1,n,o)&&(i|=1),i<<=1,this.readModule(t,e,n,o)&&(i|=1),i},r.prototype.readCorner1=function(t,e){var n=0;return this.readModule(t-1,0,t,e)&&(n|=1),n<<=1,this.readModule(t-1,1,t,e)&&(n|=1),n<<=1,this.readModule(t-1,2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-1,t,e)&&(n|=1),n<<=1,this.readModule(1,e-1,t,e)&&(n|=1),n<<=1,this.readModule(2,e-1,t,e)&&(n|=1),n<<=1,this.readModule(3,e-1,t,e)&&(n|=1),n},r.prototype.readCorner2=function(t,e){var n=0;return this.readModule(t-3,0,t,e)&&(n|=1),n<<=1,this.readModule(t-2,0,t,e)&&(n|=1),n<<=1,this.readModule(t-1,0,t,e)&&(n|=1),n<<=1,this.readModule(0,e-4,t,e)&&(n|=1),n<<=1,this.readModule(0,e-3,t,e)&&(n|=1),n<<=1,this.readModule(0,e-2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-1,t,e)&&(n|=1),n<<=1,this.readModule(1,e-1,t,e)&&(n|=1),n},r.prototype.readCorner3=function(t,e){var n=0;return this.readModule(t-1,0,t,e)&&(n|=1),n<<=1,this.readModule(t-1,e-1,t,e)&&(n|=1),n<<=1,this.readModule(0,e-3,t,e)&&(n|=1),n<<=1,this.readModule(0,e-2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-1,t,e)&&(n|=1),n<<=1,this.readModule(1,e-3,t,e)&&(n|=1),n<<=1,this.readModule(1,e-2,t,e)&&(n|=1),n<<=1,this.readModule(1,e-1,t,e)&&(n|=1),n},r.prototype.readCorner4=function(t,e){var n=0;return this.readModule(t-3,0,t,e)&&(n|=1),n<<=1,this.readModule(t-2,0,t,e)&&(n|=1),n<<=1,this.readModule(t-1,0,t,e)&&(n|=1),n<<=1,this.readModule(0,e-2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-1,t,e)&&(n|=1),n<<=1,this.readModule(1,e-1,t,e)&&(n|=1),n<<=1,this.readModule(2,e-1,t,e)&&(n|=1),n<<=1,this.readModule(3,e-1,t,e)&&(n|=1),n},r.prototype.extractDataRegion=function(t){var e=this.version.getSymbolSizeRows(),n=this.version.getSymbolSizeColumns();if(t.getHeight()!==e)throw new I("Dimension of bitMatrix must match the version size");for(var o=this.version.getDataRegionSizeRows(),i=this.version.getDataRegionSizeColumns(),a=e/o|0,s=n/i|0,f=a*o,c=s*i,u=new at(c,f),l=0;l<a;++l)for(var h=l*o,d=0;d<s;++d)for(var p=d*i,v=0;v<o;++v)for(var g=l*(o+2)+1+v,y=h+v,x=0;x<i;++x){var C=d*(i+2)+1+x;if(t.get(C,g)){var w=p+x;u.set(w,y)}}return u},r}(),ta=du;var ea=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},pu=function(){function r(t,e){this.numDataCodewords=t,this.codewords=e}return r.getDataBlocks=function(t,e){var n,o,i,a,s=e.getECBlocks(),f=0,c=s.getECBlocks();try{for(var u=ea(c),l=u.next();!l.done;l=u.next()){var h=l.value;f+=h.getCount()}}catch(kt){n={error:kt}}finally{try{l&&!l.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}var d=new Array(f),p=0;try{for(var v=ea(c),g=v.next();!g.done;g=v.next())for(var h=g.value,y=0;y<h.getCount();y++){var x=h.getDataCodewords(),C=s.getECCodewords()+x;d[p++]=new r(x,new Uint8Array(C))}}catch(kt){i={error:kt}}finally{try{g&&!g.done&&(a=v.return)&&a.call(v)}finally{if(i)throw i.error}}for(var w=d[0].codewords.length,_=w-s.getECCodewords(),O=_-1,R=0,y=0;y<O;y++)for(var N=0;N<p;N++)d[N].codewords[y]=t[R++];for(var k=e.getVersionNumber()===24,B=k?8:p,N=0;N<B;N++)d[N].codewords[_-1]=t[R++];for(var vt=d[0].codewords.length,y=_;y<vt;y++)for(var N=0;N<p;N++){var j=k?(N+8)%p:N,ct=k&&j>7?y-1:y;d[j].codewords[ct]=t[R++]}if(R!==t.length)throw new I;return d},r.prototype.getNumDataCodewords=function(){return this.numDataCodewords},r.prototype.getCodewords=function(){return this.codewords},r}(),ra=pu;var vu=function(){function r(t){this.bytes=t,this.byteOffset=0,this.bitOffset=0}return r.prototype.getBitOffset=function(){return this.bitOffset},r.prototype.getByteOffset=function(){return this.byteOffset},r.prototype.readBits=function(t){if(t<1||t>32||t>this.available())throw new I(""+t);var e=0,n=this.bitOffset,o=this.byteOffset,i=this.bytes;if(n>0){var a=8-n,s=t<a?t:a,f=a-s,c=255>>8-s<<f;e=(i[o]&c)>>f,t-=s,n+=s,n===8&&(n=0,o++)}if(t>0){for(;t>=8;)e=e<<8|i[o]&255,o++,t-=8;if(t>0){var f=8-t,c=255>>f<<f;e=e<<t|(i[o]&c)>>f,n+=t}}return this.bitOffset=n,this.byteOffset=o,e},r.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},r}(),mr=vu;var Et;(function(r){r[r.PAD_ENCODE=0]="PAD_ENCODE",r[r.ASCII_ENCODE=1]="ASCII_ENCODE",r[r.C40_ENCODE=2]="C40_ENCODE",r[r.TEXT_ENCODE=3]="TEXT_ENCODE",r[r.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",r[r.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",r[r.BASE256_ENCODE=6]="BASE256_ENCODE"})(Et||(Et={}));var mu=function(){function r(){}return r.decode=function(t){var e=new mr(t),n=new P,o=new P,i=new Array,a=Et.ASCII_ENCODE;do if(a===Et.ASCII_ENCODE)a=this.decodeAsciiSegment(e,n,o);else{switch(a){case Et.C40_ENCODE:this.decodeC40Segment(e,n);break;case Et.TEXT_ENCODE:this.decodeTextSegment(e,n);break;case Et.ANSIX12_ENCODE:this.decodeAnsiX12Segment(e,n);break;case Et.EDIFACT_ENCODE:this.decodeEdifactSegment(e,n);break;case Et.BASE256_ENCODE:this.decodeBase256Segment(e,n,i);break;default:throw new S}a=Et.ASCII_ENCODE}while(a!==Et.PAD_ENCODE&&e.available()>0);return o.length()>0&&n.append(o.toString()),new oe(t,n.toString(),i.length===0?null:i,null)},r.decodeAsciiSegment=function(t,e,n){var o=!1;do{var i=t.readBits(8);if(i===0)throw new S;if(i<=128)return o&&(i+=128),e.append(String.fromCharCode(i-1)),Et.ASCII_ENCODE;if(i===129)return Et.PAD_ENCODE;if(i<=229){var a=i-130;a<10&&e.append("0"),e.append(""+a)}else switch(i){case 230:return Et.C40_ENCODE;case 231:return Et.BASE256_ENCODE;case 232:e.append("");break;case 233:case 234:break;case 235:o=!0;break;case 236:e.append("[)>05"),n.insert(0,"");break;case 237:e.append("[)>06"),n.insert(0,"");break;case 238:return Et.ANSIX12_ENCODE;case 239:return Et.TEXT_ENCODE;case 240:return Et.EDIFACT_ENCODE;case 241:break;default:if(i!==254||t.available()!==0)throw new S;break}}while(t.available()>0);return Et.ASCII_ENCODE},r.decodeC40Segment=function(t,e){var n=!1,o=[],i=0;do{if(t.available()===8)return;var a=t.readBits(8);if(a===254)return;this.parseTwoBytes(a,t.readBits(8),o);for(var s=0;s<3;s++){var f=o[s];switch(i){case 0:if(f<3)i=f+1;else if(f<this.C40_BASIC_SET_CHARS.length){var c=this.C40_BASIC_SET_CHARS[f];n?(e.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):e.append(c)}else throw new S;break;case 1:n?(e.append(String.fromCharCode(f+128)),n=!1):e.append(String.fromCharCode(f)),i=0;break;case 2:if(f<this.C40_SHIFT2_SET_CHARS.length){var c=this.C40_SHIFT2_SET_CHARS[f];n?(e.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):e.append(c)}else switch(f){case 27:e.append("");break;case 30:n=!0;break;default:throw new S}i=0;break;case 3:n?(e.append(String.fromCharCode(f+224)),n=!1):e.append(String.fromCharCode(f+96)),i=0;break;default:throw new S}}}while(t.available()>0)},r.decodeTextSegment=function(t,e){var n=!1,o=[],i=0;do{if(t.available()===8)return;var a=t.readBits(8);if(a===254)return;this.parseTwoBytes(a,t.readBits(8),o);for(var s=0;s<3;s++){var f=o[s];switch(i){case 0:if(f<3)i=f+1;else if(f<this.TEXT_BASIC_SET_CHARS.length){var c=this.TEXT_BASIC_SET_CHARS[f];n?(e.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):e.append(c)}else throw new S;break;case 1:n?(e.append(String.fromCharCode(f+128)),n=!1):e.append(String.fromCharCode(f)),i=0;break;case 2:if(f<this.TEXT_SHIFT2_SET_CHARS.length){var c=this.TEXT_SHIFT2_SET_CHARS[f];n?(e.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):e.append(c)}else switch(f){case 27:e.append("");break;case 30:n=!0;break;default:throw new S}i=0;break;case 3:if(f<this.TEXT_SHIFT3_SET_CHARS.length){var c=this.TEXT_SHIFT3_SET_CHARS[f];n?(e.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):e.append(c),i=0}else throw new S;break;default:throw new S}}}while(t.available()>0)},r.decodeAnsiX12Segment=function(t,e){var n=[];do{if(t.available()===8)return;var o=t.readBits(8);if(o===254)return;this.parseTwoBytes(o,t.readBits(8),n);for(var i=0;i<3;i++){var a=n[i];switch(a){case 0:e.append("\r");break;case 1:e.append("*");break;case 2:e.append(">");break;case 3:e.append(" ");break;default:if(a<14)e.append(String.fromCharCode(a+44));else if(a<40)e.append(String.fromCharCode(a+51));else throw new S;break}}}while(t.available()>0)},r.parseTwoBytes=function(t,e,n){var o=(t<<8)+e-1,i=Math.floor(o/1600);n[0]=i,o-=i*1600,i=Math.floor(o/40),n[1]=i,n[2]=o-i*40},r.decodeEdifactSegment=function(t,e){do{if(t.available()<=16)return;for(var n=0;n<4;n++){var o=t.readBits(6);if(o===31){var i=8-t.getBitOffset();i!==8&&t.readBits(i);return}o&32||(o|=64),e.append(String.fromCharCode(o))}}while(t.available()>0)},r.decodeBase256Segment=function(t,e,n){var o=1+t.getByteOffset(),i=this.unrandomize255State(t.readBits(8),o++),a;if(i===0?a=t.available()/8|0:i<250?a=i:a=250*(i-249)+this.unrandomize255State(t.readBits(8),o++),a<0)throw new S;for(var s=new Uint8Array(a),f=0;f<a;f++){if(t.available()<8)throw new S;s[f]=this.unrandomize255State(t.readBits(8),o++)}n.push(s);try{e.append(Ct.decode(s,F.ISO88591))}catch(c){throw new mt("Platform does not support required encoding: "+c.message)}},r.unrandomize255State=function(t,e){var n=149*e%255+1,o=t-n;return o>=0?o:o+256},r.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],r.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],r.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],r.TEXT_SHIFT2_SET_CHARS=r.C40_SHIFT2_SET_CHARS,r.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~","\x7F"],r}(),ro=mu;var gu=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},xu=function(){function r(){this.rsDecoder=new ie(dt.DATA_MATRIX_FIELD_256)}return r.prototype.decode=function(t){var e,n,o=new ta(t),i=o.getVersion(),a=o.readCodewords(),s=ra.getDataBlocks(a,i),f=0;try{for(var c=gu(s),u=c.next();!u.done;u=c.next()){var l=u.value;f+=l.getNumDataCodewords()}}catch(C){e={error:C}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}for(var h=new Uint8Array(f),d=s.length,p=0;p<d;p++){var v=s[p],g=v.getCodewords(),y=v.getNumDataCodewords();this.correctErrors(g,y);for(var x=0;x<y;x++)h[x*d+p]=g[x]}return ro.decode(h)},r.prototype.correctErrors=function(t,e){var n=new Int32Array(t);try{this.rsDecoder.decode(n,t.length-e)}catch{throw new X}for(var o=0;o<e;o++)t[o]=n[o]},r}(),na=xu;var yu=function(){function r(t){this.image=t,this.rectangleDetector=new je(this.image)}return r.prototype.detect=function(){var t=this.rectangleDetector.detect(),e=this.detectSolid1(t);if(e=this.detectSolid2(e),e[3]=this.correctTopRight(e),!e[3])throw new E;e=this.shiftToModuleCenter(e);var n=e[0],o=e[1],i=e[2],a=e[3],s=this.transitionsBetween(n,a)+1,f=this.transitionsBetween(i,a)+1;(s&1)===1&&(s+=1),(f&1)===1&&(f+=1),4*s<7*f&&4*f<7*s&&(s=f=Math.max(s,f));var c=r.sampleGrid(this.image,n,o,i,a,s,f);return new De(c,[n,o,i,a])},r.shiftPoint=function(t,e,n){var o=(e.getX()-t.getX())/(n+1),i=(e.getY()-t.getY())/(n+1);return new D(t.getX()+o,t.getY()+i)},r.moveAway=function(t,e,n){var o=t.getX(),i=t.getY();return o<e?o-=1:o+=1,i<n?i-=1:i+=1,new D(o,i)},r.prototype.detectSolid1=function(t){var e=t[0],n=t[1],o=t[3],i=t[2],a=this.transitionsBetween(e,n),s=this.transitionsBetween(n,o),f=this.transitionsBetween(o,i),c=this.transitionsBetween(i,e),u=a,l=[i,e,n,o];return u>s&&(u=s,l[0]=e,l[1]=n,l[2]=o,l[3]=i),u>f&&(u=f,l[0]=n,l[1]=o,l[2]=i,l[3]=e),u>c&&(l[0]=o,l[1]=i,l[2]=e,l[3]=n),l},r.prototype.detectSolid2=function(t){var e=t[0],n=t[1],o=t[2],i=t[3],a=this.transitionsBetween(e,i),s=r.shiftPoint(n,o,(a+1)*4),f=r.shiftPoint(o,n,(a+1)*4),c=this.transitionsBetween(s,e),u=this.transitionsBetween(f,i);return c<u?(t[0]=e,t[1]=n,t[2]=o,t[3]=i):(t[0]=n,t[1]=o,t[2]=i,t[3]=e),t},r.prototype.correctTopRight=function(t){var e=t[0],n=t[1],o=t[2],i=t[3],a=this.transitionsBetween(e,i),s=this.transitionsBetween(n,i),f=r.shiftPoint(e,n,(s+1)*4),c=r.shiftPoint(o,n,(a+1)*4);a=this.transitionsBetween(f,i),s=this.transitionsBetween(c,i);var u=new D(i.getX()+(o.getX()-n.getX())/(a+1),i.getY()+(o.getY()-n.getY())/(a+1)),l=new D(i.getX()+(e.getX()-n.getX())/(s+1),i.getY()+(e.getY()-n.getY())/(s+1));if(!this.isValid(u))return this.isValid(l)?l:null;if(!this.isValid(l))return u;var h=this.transitionsBetween(f,u)+this.transitionsBetween(c,u),d=this.transitionsBetween(f,l)+this.transitionsBetween(c,l);return h>d?u:l},r.prototype.shiftToModuleCenter=function(t){var e=t[0],n=t[1],o=t[2],i=t[3],a=this.transitionsBetween(e,i)+1,s=this.transitionsBetween(o,i)+1,f=r.shiftPoint(e,n,s*4),c=r.shiftPoint(o,n,a*4);a=this.transitionsBetween(f,i)+1,s=this.transitionsBetween(c,i)+1,(a&1)===1&&(a+=1),(s&1)===1&&(s+=1);var u=(e.getX()+n.getX()+o.getX()+i.getX())/4,l=(e.getY()+n.getY()+o.getY()+i.getY())/4;e=r.moveAway(e,u,l),n=r.moveAway(n,u,l),o=r.moveAway(o,u,l),i=r.moveAway(i,u,l);var h,d;return f=r.shiftPoint(e,n,s*4),f=r.shiftPoint(f,i,a*4),h=r.shiftPoint(n,e,s*4),h=r.shiftPoint(h,o,a*4),c=r.shiftPoint(o,i,s*4),c=r.shiftPoint(c,n,a*4),d=r.shiftPoint(i,o,s*4),d=r.shiftPoint(d,e,a*4),[f,h,c,d]},r.prototype.isValid=function(t){return t.getX()>=0&&t.getX()<this.image.getWidth()&&t.getY()>0&&t.getY()<this.image.getHeight()},r.sampleGrid=function(t,e,n,o,i,a,s){var f=be.getInstance();return f.sampleGrid(t,a,s,.5,.5,a-.5,.5,a-.5,s-.5,.5,s-.5,e.getX(),e.getY(),i.getX(),i.getY(),o.getX(),o.getY(),n.getX(),n.getY())},r.prototype.transitionsBetween=function(t,e){var n=Math.trunc(t.getX()),o=Math.trunc(t.getY()),i=Math.trunc(e.getX()),a=Math.trunc(e.getY()),s=Math.abs(a-o)>Math.abs(i-n);if(s){var f=n;n=o,o=f,f=i,i=a,a=f}for(var c=Math.abs(i-n),u=Math.abs(a-o),l=-c/2,h=o<a?1:-1,d=n<i?1:-1,p=0,v=this.image.get(s?o:n,s?n:o),g=n,y=o;g!==i;g+=d){var x=this.image.get(s?y:g,s?g:y);if(x!==v&&(p++,v=x),l+=u,l>0){if(y===a)break;y+=h,l-=c}}return p},r}(),oa=yu;var Cu=function(){function r(){this.decoder=new na}return r.prototype.decode=function(t,e){e===void 0&&(e=null);var n,o;if(e!=null&&e.has(L.PURE_BARCODE)){var i=r.extractPureBits(t.getBlackMatrix());n=this.decoder.decode(i),o=r.NO_POINTS}else{var a=new oa(t.getBlackMatrix()).detect();n=this.decoder.decode(a.getBits()),o=a.getPoints()}var s=n.getRawBytes(),f=new Y(n.getText(),s,8*s.length,o,T.DATA_MATRIX,H.currentTimeMillis()),c=n.getByteSegments();c!=null&&f.putMetadata(st.BYTE_SEGMENTS,c);var u=n.getECLevel();return u!=null&&f.putMetadata(st.ERROR_CORRECTION_LEVEL,u),f},r.prototype.reset=function(){},r.extractPureBits=function(t){var e=t.getTopLeftOnBit(),n=t.getBottomRightOnBit();if(e==null||n==null)throw new E;var o=this.moduleSize(e,t),i=e[1],a=n[1],s=e[0],f=n[0],c=(f-s+1)/o,u=(a-i+1)/o;if(c<=0||u<=0)throw new E;var l=o/2;i+=l,s+=l;for(var h=new at(c,u),d=0;d<u;d++)for(var p=i+d*o,v=0;v<c;v++)t.get(s+v*o,p)&&h.set(v,d);return h},r.moduleSize=function(t,e){for(var n=e.getWidth(),o=t[0],i=t[1];o<n&&e.get(o,i);)o++;if(o===n)throw new E;var a=o-t[0];if(a===0)throw new E;return a},r.NO_POINTS=[],r}(),Ae=Cu;var Eu=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ix=function(r){Eu(t,r);function t(e){return e===void 0&&(e=500),r.call(this,new Ae,e)||this}return t}(Gt);var qe;(function(r){r[r.L=0]="L",r[r.M=1]="M",r[r.Q=2]="Q",r[r.H=3]="H"})(qe||(qe={}));var Au=function(){function r(t,e,n){this.value=t,this.stringValue=e,this.bits=n,r.FOR_BITS.set(n,this),r.FOR_VALUE.set(t,this)}return r.prototype.getValue=function(){return this.value},r.prototype.getBits=function(){return this.bits},r.fromString=function(t){switch(t){case"L":return r.L;case"M":return r.M;case"Q":return r.Q;case"H":return r.H;default:throw new ft(t+"not available")}},r.prototype.toString=function(){return this.stringValue},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.value===e.value},r.forBits=function(t){if(t<0||t>=r.FOR_BITS.size)throw new I;return r.FOR_BITS.get(t)},r.FOR_BITS=new Map,r.FOR_VALUE=new Map,r.L=new r(qe.L,"L",1),r.M=new r(qe.M,"M",0),r.Q=new r(qe.Q,"Q",3),r.H=new r(qe.H,"H",2),r}(),Mt=Au;var wu=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},_u=function(){function r(t){this.errorCorrectionLevel=Mt.forBits(t>>3&3),this.dataMask=t&7}return r.numBitsDiffering=function(t,e){return M.bitCount(t^e)},r.decodeFormatInformation=function(t,e){var n=r.doDecodeFormatInformation(t,e);return n!==null?n:r.doDecodeFormatInformation(t^r.FORMAT_INFO_MASK_QR,e^r.FORMAT_INFO_MASK_QR)},r.doDecodeFormatInformation=function(t,e){var n,o,i=Number.MAX_SAFE_INTEGER,a=0;try{for(var s=wu(r.FORMAT_INFO_DECODE_LOOKUP),f=s.next();!f.done;f=s.next()){var c=f.value,u=c[0];if(u===t||u===e)return new r(c[1]);var l=r.numBitsDiffering(t,u);l<i&&(a=c[1],i=l),t!==e&&(l=r.numBitsDiffering(e,u),l<i&&(a=c[1],i=l))}}catch(h){n={error:h}}finally{try{f&&!f.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}return i<=3?new r(a):null},r.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},r.prototype.getDataMask=function(){return this.dataMask},r.prototype.hashCode=function(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.errorCorrectionLevel===e.errorCorrectionLevel&&this.dataMask===e.dataMask},r.FORMAT_INFO_MASK_QR=21522,r.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])],r}(),gr=_u;var Su=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Iu=function(){function r(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this.ecCodewordsPerBlock=t,this.ecBlocks=e}return r.prototype.getECCodewordsPerBlock=function(){return this.ecCodewordsPerBlock},r.prototype.getNumBlocks=function(){var t,e,n=0,o=this.ecBlocks;try{for(var i=Su(o),a=i.next();!a.done;a=i.next()){var s=a.value;n+=s.getCount()}}catch(f){t={error:f}}finally{try{a&&!a.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return n},r.prototype.getTotalECCodewords=function(){return this.ecCodewordsPerBlock*this.getNumBlocks()},r.prototype.getECBlocks=function(){return this.ecBlocks},r}(),A=Iu;var Ou=function(){function r(t,e){this.count=t,this.dataCodewords=e}return r.prototype.getCount=function(){return this.count},r.prototype.getDataCodewords=function(){return this.dataCodewords},r}(),m=Ou;var Tu=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ru=function(){function r(t,e){for(var n,o,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];this.versionNumber=t,this.alignmentPatternCenters=e,this.ecBlocks=i;var s=0,f=i[0].getECCodewordsPerBlock(),c=i[0].getECBlocks();try{for(var u=Tu(c),l=u.next();!l.done;l=u.next()){var h=l.value;s+=h.getCount()*(h.getDataCodewords()+f)}}catch(d){n={error:d}}finally{try{l&&!l.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}this.totalCodewords=s}return r.prototype.getVersionNumber=function(){return this.versionNumber},r.prototype.getAlignmentPatternCenters=function(){return this.alignmentPatternCenters},r.prototype.getTotalCodewords=function(){return this.totalCodewords},r.prototype.getDimensionForVersion=function(){return 17+4*this.versionNumber},r.prototype.getECBlocksForLevel=function(t){return this.ecBlocks[t.getValue()]},r.getProvisionalVersionForDimension=function(t){if(t%4!==1)throw new S;try{return this.getVersionForNumber((t-17)/4)}catch{throw new S}},r.getVersionForNumber=function(t){if(t<1||t>40)throw new I;return r.VERSIONS[t-1]},r.decodeVersionInformation=function(t){for(var e=Number.MAX_SAFE_INTEGER,n=0,o=0;o<r.VERSION_DECODE_INFO.length;o++){var i=r.VERSION_DECODE_INFO[o];if(i===t)return r.getVersionForNumber(o+7);var a=gr.numBitsDiffering(t,i);a<e&&(n=o+7,e=a)}return e<=3?r.getVersionForNumber(n):null},r.prototype.buildFunctionPattern=function(){var t=this.getDimensionForVersion(),e=new at(t);e.setRegion(0,0,9,9),e.setRegion(t-8,0,8,9),e.setRegion(0,t-8,9,8);for(var n=this.alignmentPatternCenters.length,o=0;o<n;o++)for(var i=this.alignmentPatternCenters[o]-2,a=0;a<n;a++)o===0&&(a===0||a===n-1)||o===n-1&&a===0||e.setRegion(this.alignmentPatternCenters[a]-2,i,5,5);return e.setRegion(6,9,1,t-17),e.setRegion(9,6,t-17,1),this.versionNumber>6&&(e.setRegion(t-11,0,3,6),e.setRegion(0,t-11,6,3)),e},r.prototype.toString=function(){return""+this.versionNumber},r.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),r.VERSIONS=[new r(1,new Int32Array(0),new A(7,new m(1,19)),new A(10,new m(1,16)),new A(13,new m(1,13)),new A(17,new m(1,9))),new r(2,Int32Array.from([6,18]),new A(10,new m(1,34)),new A(16,new m(1,28)),new A(22,new m(1,22)),new A(28,new m(1,16))),new r(3,Int32Array.from([6,22]),new A(15,new m(1,55)),new A(26,new m(1,44)),new A(18,new m(2,17)),new A(22,new m(2,13))),new r(4,Int32Array.from([6,26]),new A(20,new m(1,80)),new A(18,new m(2,32)),new A(26,new m(2,24)),new A(16,new m(4,9))),new r(5,Int32Array.from([6,30]),new A(26,new m(1,108)),new A(24,new m(2,43)),new A(18,new m(2,15),new m(2,16)),new A(22,new m(2,11),new m(2,12))),new r(6,Int32Array.from([6,34]),new A(18,new m(2,68)),new A(16,new m(4,27)),new A(24,new m(4,19)),new A(28,new m(4,15))),new r(7,Int32Array.from([6,22,38]),new A(20,new m(2,78)),new A(18,new m(4,31)),new A(18,new m(2,14),new m(4,15)),new A(26,new m(4,13),new m(1,14))),new r(8,Int32Array.from([6,24,42]),new A(24,new m(2,97)),new A(22,new m(2,38),new m(2,39)),new A(22,new m(4,18),new m(2,19)),new A(26,new m(4,14),new m(2,15))),new r(9,Int32Array.from([6,26,46]),new A(30,new m(2,116)),new A(22,new m(3,36),new m(2,37)),new A(20,new m(4,16),new m(4,17)),new A(24,new m(4,12),new m(4,13))),new r(10,Int32Array.from([6,28,50]),new A(18,new m(2,68),new m(2,69)),new A(26,new m(4,43),new m(1,44)),new A(24,new m(6,19),new m(2,20)),new A(28,new m(6,15),new m(2,16))),new r(11,Int32Array.from([6,30,54]),new A(20,new m(4,81)),new A(30,new m(1,50),new m(4,51)),new A(28,new m(4,22),new m(4,23)),new A(24,new m(3,12),new m(8,13))),new r(12,Int32Array.from([6,32,58]),new A(24,new m(2,92),new m(2,93)),new A(22,new m(6,36),new m(2,37)),new A(26,new m(4,20),new m(6,21)),new A(28,new m(7,14),new m(4,15))),new r(13,Int32Array.from([6,34,62]),new A(26,new m(4,107)),new A(22,new m(8,37),new m(1,38)),new A(24,new m(8,20),new m(4,21)),new A(22,new m(12,11),new m(4,12))),new r(14,Int32Array.from([6,26,46,66]),new A(30,new m(3,115),new m(1,116)),new A(24,new m(4,40),new m(5,41)),new A(20,new m(11,16),new m(5,17)),new A(24,new m(11,12),new m(5,13))),new r(15,Int32Array.from([6,26,48,70]),new A(22,new m(5,87),new m(1,88)),new A(24,new m(5,41),new m(5,42)),new A(30,new m(5,24),new m(7,25)),new A(24,new m(11,12),new m(7,13))),new r(16,Int32Array.from([6,26,50,74]),new A(24,new m(5,98),new m(1,99)),new A(28,new m(7,45),new m(3,46)),new A(24,new m(15,19),new m(2,20)),new A(30,new m(3,15),new m(13,16))),new r(17,Int32Array.from([6,30,54,78]),new A(28,new m(1,107),new m(5,108)),new A(28,new m(10,46),new m(1,47)),new A(28,new m(1,22),new m(15,23)),new A(28,new m(2,14),new m(17,15))),new r(18,Int32Array.from([6,30,56,82]),new A(30,new m(5,120),new m(1,121)),new A(26,new m(9,43),new m(4,44)),new A(28,new m(17,22),new m(1,23)),new A(28,new m(2,14),new m(19,15))),new r(19,Int32Array.from([6,30,58,86]),new A(28,new m(3,113),new m(4,114)),new A(26,new m(3,44),new m(11,45)),new A(26,new m(17,21),new m(4,22)),new A(26,new m(9,13),new m(16,14))),new r(20,Int32Array.from([6,34,62,90]),new A(28,new m(3,107),new m(5,108)),new A(26,new m(3,41),new m(13,42)),new A(30,new m(15,24),new m(5,25)),new A(28,new m(15,15),new m(10,16))),new r(21,Int32Array.from([6,28,50,72,94]),new A(28,new m(4,116),new m(4,117)),new A(26,new m(17,42)),new A(28,new m(17,22),new m(6,23)),new A(30,new m(19,16),new m(6,17))),new r(22,Int32Array.from([6,26,50,74,98]),new A(28,new m(2,111),new m(7,112)),new A(28,new m(17,46)),new A(30,new m(7,24),new m(16,25)),new A(24,new m(34,13))),new r(23,Int32Array.from([6,30,54,78,102]),new A(30,new m(4,121),new m(5,122)),new A(28,new m(4,47),new m(14,48)),new A(30,new m(11,24),new m(14,25)),new A(30,new m(16,15),new m(14,16))),new r(24,Int32Array.from([6,28,54,80,106]),new A(30,new m(6,117),new m(4,118)),new A(28,new m(6,45),new m(14,46)),new A(30,new m(11,24),new m(16,25)),new A(30,new m(30,16),new m(2,17))),new r(25,Int32Array.from([6,32,58,84,110]),new A(26,new m(8,106),new m(4,107)),new A(28,new m(8,47),new m(13,48)),new A(30,new m(7,24),new m(22,25)),new A(30,new m(22,15),new m(13,16))),new r(26,Int32Array.from([6,30,58,86,114]),new A(28,new m(10,114),new m(2,115)),new A(28,new m(19,46),new m(4,47)),new A(28,new m(28,22),new m(6,23)),new A(30,new m(33,16),new m(4,17))),new r(27,Int32Array.from([6,34,62,90,118]),new A(30,new m(8,122),new m(4,123)),new A(28,new m(22,45),new m(3,46)),new A(30,new m(8,23),new m(26,24)),new A(30,new m(12,15),new m(28,16))),new r(28,Int32Array.from([6,26,50,74,98,122]),new A(30,new m(3,117),new m(10,118)),new A(28,new m(3,45),new m(23,46)),new A(30,new m(4,24),new m(31,25)),new A(30,new m(11,15),new m(31,16))),new r(29,Int32Array.from([6,30,54,78,102,126]),new A(30,new m(7,116),new m(7,117)),new A(28,new m(21,45),new m(7,46)),new A(30,new m(1,23),new m(37,24)),new A(30,new m(19,15),new m(26,16))),new r(30,Int32Array.from([6,26,52,78,104,130]),new A(30,new m(5,115),new m(10,116)),new A(28,new m(19,47),new m(10,48)),new A(30,new m(15,24),new m(25,25)),new A(30,new m(23,15),new m(25,16))),new r(31,Int32Array.from([6,30,56,82,108,134]),new A(30,new m(13,115),new m(3,116)),new A(28,new m(2,46),new m(29,47)),new A(30,new m(42,24),new m(1,25)),new A(30,new m(23,15),new m(28,16))),new r(32,Int32Array.from([6,34,60,86,112,138]),new A(30,new m(17,115)),new A(28,new m(10,46),new m(23,47)),new A(30,new m(10,24),new m(35,25)),new A(30,new m(19,15),new m(35,16))),new r(33,Int32Array.from([6,30,58,86,114,142]),new A(30,new m(17,115),new m(1,116)),new A(28,new m(14,46),new m(21,47)),new A(30,new m(29,24),new m(19,25)),new A(30,new m(11,15),new m(46,16))),new r(34,Int32Array.from([6,34,62,90,118,146]),new A(30,new m(13,115),new m(6,116)),new A(28,new m(14,46),new m(23,47)),new A(30,new m(44,24),new m(7,25)),new A(30,new m(59,16),new m(1,17))),new r(35,Int32Array.from([6,30,54,78,102,126,150]),new A(30,new m(12,121),new m(7,122)),new A(28,new m(12,47),new m(26,48)),new A(30,new m(39,24),new m(14,25)),new A(30,new m(22,15),new m(41,16))),new r(36,Int32Array.from([6,24,50,76,102,128,154]),new A(30,new m(6,121),new m(14,122)),new A(28,new m(6,47),new m(34,48)),new A(30,new m(46,24),new m(10,25)),new A(30,new m(2,15),new m(64,16))),new r(37,Int32Array.from([6,28,54,80,106,132,158]),new A(30,new m(17,122),new m(4,123)),new A(28,new m(29,46),new m(14,47)),new A(30,new m(49,24),new m(10,25)),new A(30,new m(24,15),new m(46,16))),new r(38,Int32Array.from([6,32,58,84,110,136,162]),new A(30,new m(4,122),new m(18,123)),new A(28,new m(13,46),new m(32,47)),new A(30,new m(48,24),new m(14,25)),new A(30,new m(42,15),new m(32,16))),new r(39,Int32Array.from([6,26,54,82,110,138,166]),new A(30,new m(20,117),new m(4,118)),new A(28,new m(40,47),new m(7,48)),new A(30,new m(43,24),new m(22,25)),new A(30,new m(10,15),new m(67,16))),new r(40,Int32Array.from([6,30,58,86,114,142,170]),new A(30,new m(19,118),new m(6,119)),new A(28,new m(18,47),new m(31,48)),new A(30,new m(34,24),new m(34,25)),new A(30,new m(20,15),new m(61,16)))],r}(),Zt=Ru;var wt;(function(r){r[r.DATA_MASK_000=0]="DATA_MASK_000",r[r.DATA_MASK_001=1]="DATA_MASK_001",r[r.DATA_MASK_010=2]="DATA_MASK_010",r[r.DATA_MASK_011=3]="DATA_MASK_011",r[r.DATA_MASK_100=4]="DATA_MASK_100",r[r.DATA_MASK_101=5]="DATA_MASK_101",r[r.DATA_MASK_110=6]="DATA_MASK_110",r[r.DATA_MASK_111=7]="DATA_MASK_111"})(wt||(wt={}));var Du=function(){function r(t,e){this.value=t,this.isMasked=e}return r.prototype.unmaskBitMatrix=function(t,e){for(var n=0;n<e;n++)for(var o=0;o<e;o++)this.isMasked(n,o)&&t.flip(o,n)},r.values=new Map([[wt.DATA_MASK_000,new r(wt.DATA_MASK_000,function(t,e){return(t+e&1)===0})],[wt.DATA_MASK_001,new r(wt.DATA_MASK_001,function(t,e){return(t&1)===0})],[wt.DATA_MASK_010,new r(wt.DATA_MASK_010,function(t,e){return e%3===0})],[wt.DATA_MASK_011,new r(wt.DATA_MASK_011,function(t,e){return(t+e)%3===0})],[wt.DATA_MASK_100,new r(wt.DATA_MASK_100,function(t,e){return(Math.floor(t/2)+Math.floor(e/3)&1)===0})],[wt.DATA_MASK_101,new r(wt.DATA_MASK_101,function(t,e){return t*e%6===0})],[wt.DATA_MASK_110,new r(wt.DATA_MASK_110,function(t,e){return t*e%6<3})],[wt.DATA_MASK_111,new r(wt.DATA_MASK_111,function(t,e){return(t+e+t*e%3&1)===0})]]),r}(),on=Du;var bu=function(){function r(t){var e=t.getHeight();if(e<21||(e&3)!==1)throw new S;this.bitMatrix=t}return r.prototype.readFormatInformation=function(){if(this.parsedFormatInfo!==null&&this.parsedFormatInfo!==void 0)return this.parsedFormatInfo;for(var t=0,e=0;e<6;e++)t=this.copyBit(e,8,t);t=this.copyBit(7,8,t),t=this.copyBit(8,8,t),t=this.copyBit(8,7,t);for(var n=5;n>=0;n--)t=this.copyBit(8,n,t);for(var o=this.bitMatrix.getHeight(),i=0,a=o-7,n=o-1;n>=a;n--)i=this.copyBit(8,n,i);for(var e=o-8;e<o;e++)i=this.copyBit(e,8,i);if(this.parsedFormatInfo=gr.decodeFormatInformation(t,i),this.parsedFormatInfo!==null)return this.parsedFormatInfo;throw new S},r.prototype.readVersion=function(){if(this.parsedVersion!==null&&this.parsedVersion!==void 0)return this.parsedVersion;var t=this.bitMatrix.getHeight(),e=Math.floor((t-17)/4);if(e<=6)return Zt.getVersionForNumber(e);for(var n=0,o=t-11,i=5;i>=0;i--)for(var a=t-9;a>=o;a--)n=this.copyBit(a,i,n);var s=Zt.decodeVersionInformation(n);if(s!==null&&s.getDimensionForVersion()===t)return this.parsedVersion=s,s;n=0;for(var a=5;a>=0;a--)for(var i=t-9;i>=o;i--)n=this.copyBit(a,i,n);if(s=Zt.decodeVersionInformation(n),s!==null&&s.getDimensionForVersion()===t)return this.parsedVersion=s,s;throw new S},r.prototype.copyBit=function(t,e,n){var o=this.isMirror?this.bitMatrix.get(e,t):this.bitMatrix.get(t,e);return o?n<<1|1:n<<1},r.prototype.readCodewords=function(){var t=this.readFormatInformation(),e=this.readVersion(),n=on.values.get(t.getDataMask()),o=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,o);for(var i=e.buildFunctionPattern(),a=!0,s=new Uint8Array(e.getTotalCodewords()),f=0,c=0,u=0,l=o-1;l>0;l-=2){l===6&&l--;for(var h=0;h<o;h++)for(var d=a?o-1-h:h,p=0;p<2;p++)i.get(l-p,d)||(u++,c<<=1,this.bitMatrix.get(l-p,d)&&(c|=1),u===8&&(s[f++]=c,u=0,c=0));a=!a}if(f!==e.getTotalCodewords())throw new S;return s},r.prototype.remask=function(){if(this.parsedFormatInfo!==null){var t=on.values[this.parsedFormatInfo.getDataMask()],e=this.bitMatrix.getHeight();t.unmaskBitMatrix(this.bitMatrix,e)}},r.prototype.setMirror=function(t){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=t},r.prototype.mirror=function(){for(var t=this.bitMatrix,e=0,n=t.getWidth();e<n;e++)for(var o=e+1,i=t.getHeight();o<i;o++)t.get(e,o)!==t.get(o,e)&&(t.flip(o,e),t.flip(e,o))},r}(),ia=bu;var aa=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Nu=function(){function r(t,e){this.numDataCodewords=t,this.codewords=e}return r.getDataBlocks=function(t,e,n){var o,i,a,s;if(t.length!==e.getTotalCodewords())throw new I;var f=e.getECBlocksForLevel(n),c=0,u=f.getECBlocks();try{for(var l=aa(u),h=l.next();!h.done;h=l.next()){var d=h.value;c+=d.getCount()}}catch(ct){o={error:ct}}finally{try{h&&!h.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}var p=new Array(c),v=0;try{for(var g=aa(u),y=g.next();!y.done;y=g.next())for(var d=y.value,x=0;x<d.getCount();x++){var C=d.getDataCodewords(),w=f.getECCodewordsPerBlock()+C;p[v++]=new r(C,new Uint8Array(w))}}catch(ct){a={error:ct}}finally{try{y&&!y.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}for(var _=p[0].codewords.length,O=p.length-1;O>=0;){var R=p[O].codewords.length;if(R===_)break;O--}O++;for(var N=_-f.getECCodewordsPerBlock(),k=0,x=0;x<N;x++)for(var B=0;B<v;B++)p[B].codewords[x]=t[k++];for(var B=O;B<v;B++)p[B].codewords[N]=t[k++];for(var vt=p[0].codewords.length,x=N;x<vt;x++)for(var B=0;B<v;B++){var j=B<O?x:x+1;p[B].codewords[j]=t[k++]}return p},r.prototype.getNumDataCodewords=function(){return this.numDataCodewords},r.prototype.getCodewords=function(){return this.codewords},r}(),sa=Nu;var Xt;(function(r){r[r.TERMINATOR=0]="TERMINATOR",r[r.NUMERIC=1]="NUMERIC",r[r.ALPHANUMERIC=2]="ALPHANUMERIC",r[r.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",r[r.BYTE=4]="BYTE",r[r.ECI=5]="ECI",r[r.KANJI=6]="KANJI",r[r.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",r[r.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",r[r.HANZI=9]="HANZI"})(Xt||(Xt={}));var Pu=function(){function r(t,e,n,o){this.value=t,this.stringValue=e,this.characterCountBitsForVersions=n,this.bits=o,r.FOR_BITS.set(o,this),r.FOR_VALUE.set(t,this)}return r.forBits=function(t){var e=r.FOR_BITS.get(t);if(e===void 0)throw new I;return e},r.prototype.getCharacterCountBits=function(t){var e=t.getVersionNumber(),n;return e<=9?n=0:e<=26?n=1:n=2,this.characterCountBitsForVersions[n]},r.prototype.getValue=function(){return this.value},r.prototype.getBits=function(){return this.bits},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.value===e.value},r.prototype.toString=function(){return this.stringValue},r.FOR_BITS=new Map,r.FOR_VALUE=new Map,r.TERMINATOR=new r(Xt.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),r.NUMERIC=new r(Xt.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),r.ALPHANUMERIC=new r(Xt.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),r.STRUCTURED_APPEND=new r(Xt.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),r.BYTE=new r(Xt.BYTE,"BYTE",Int32Array.from([8,16,16]),4),r.ECI=new r(Xt.ECI,"ECI",Int32Array.from([0,0,0]),7),r.KANJI=new r(Xt.KANJI,"KANJI",Int32Array.from([8,10,12]),8),r.FNC1_FIRST_POSITION=new r(Xt.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),r.FNC1_SECOND_POSITION=new r(Xt.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),r.HANZI=new r(Xt.HANZI,"HANZI",Int32Array.from([8,10,12]),13),r}(),et=Pu;var Mu=function(){function r(){}return r.decode=function(t,e,n,o){var i=new mr(t),a=new P,s=new Array,f=-1,c=-1;try{var u=null,l=!1,h=void 0;do{if(i.available()<4)h=et.TERMINATOR;else{var d=i.readBits(4);h=et.forBits(d)}switch(h){case et.TERMINATOR:break;case et.FNC1_FIRST_POSITION:case et.FNC1_SECOND_POSITION:l=!0;break;case et.STRUCTURED_APPEND:if(i.available()<16)throw new S;f=i.readBits(8),c=i.readBits(8);break;case et.ECI:var p=r.parseECIValue(i);if(u=it.getCharacterSetECIByValue(p),u===null)throw new S;break;case et.HANZI:var v=i.readBits(4),g=i.readBits(h.getCharacterCountBits(e));v===r.GB2312_SUBSET&&r.decodeHanziSegment(i,a,g);break;default:var y=i.readBits(h.getCharacterCountBits(e));switch(h){case et.NUMERIC:r.decodeNumericSegment(i,a,y);break;case et.ALPHANUMERIC:r.decodeAlphanumericSegment(i,a,y,l);break;case et.BYTE:r.decodeByteSegment(i,a,y,u,s,o);break;case et.KANJI:r.decodeKanjiSegment(i,a,y);break;default:throw new S}break}}while(h!==et.TERMINATOR)}catch{throw new S}return new oe(t,a.toString(),s.length===0?null:s,n===null?null:n.toString(),f,c)},r.decodeHanziSegment=function(t,e,n){if(n*13>t.available())throw new S;for(var o=new Uint8Array(2*n),i=0;n>0;){var a=t.readBits(13),s=a/96<<8&4294967295|a%96;s<959?s+=41377:s+=42657,o[i]=s>>8&255,o[i+1]=s&255,i+=2,n--}try{e.append(Ct.decode(o,F.GB2312))}catch(f){throw new S(f)}},r.decodeKanjiSegment=function(t,e,n){if(n*13>t.available())throw new S;for(var o=new Uint8Array(2*n),i=0;n>0;){var a=t.readBits(13),s=a/192<<8&4294967295|a%192;s<7936?s+=33088:s+=49472,o[i]=s>>8,o[i+1]=s,i+=2,n--}try{e.append(Ct.decode(o,F.SHIFT_JIS))}catch(f){throw new S(f)}},r.decodeByteSegment=function(t,e,n,o,i,a){if(8*n>t.available())throw new S;for(var s=new Uint8Array(n),f=0;f<n;f++)s[f]=t.readBits(8);var c;o===null?c=F.guessEncoding(s,a):c=o.getName();try{e.append(Ct.decode(s,c))}catch(u){throw new S(u)}i.push(s)},r.toAlphaNumericChar=function(t){if(t>=r.ALPHANUMERIC_CHARS.length)throw new S;return r.ALPHANUMERIC_CHARS[t]},r.decodeAlphanumericSegment=function(t,e,n,o){for(var i=e.length();n>1;){if(t.available()<11)throw new S;var a=t.readBits(11);e.append(r.toAlphaNumericChar(Math.floor(a/45))),e.append(r.toAlphaNumericChar(a%45)),n-=2}if(n===1){if(t.available()<6)throw new S;e.append(r.toAlphaNumericChar(t.readBits(6)))}if(o)for(var s=i;s<e.length();s++)e.charAt(s)==="%"&&(s<e.length()-1&&e.charAt(s+1)==="%"?e.deleteCharAt(s+1):e.setCharAt(s,""))},r.decodeNumericSegment=function(t,e,n){for(;n>=3;){if(t.available()<10)throw new S;var o=t.readBits(10);if(o>=1e3)throw new S;e.append(r.toAlphaNumericChar(Math.floor(o/100))),e.append(r.toAlphaNumericChar(Math.floor(o/10)%10)),e.append(r.toAlphaNumericChar(o%10)),n-=3}if(n===2){if(t.available()<7)throw new S;var i=t.readBits(7);if(i>=100)throw new S;e.append(r.toAlphaNumericChar(Math.floor(i/10))),e.append(r.toAlphaNumericChar(i%10))}else if(n===1){if(t.available()<4)throw new S;var a=t.readBits(4);if(a>=10)throw new S;e.append(r.toAlphaNumericChar(a))}},r.parseECIValue=function(t){var e=t.readBits(8);if(!(e&128))return e&127;if((e&192)===128){var n=t.readBits(8);return(e&63)<<8&4294967295|n}if((e&224)===192){var o=t.readBits(16);return(e&31)<<16&4294967295|o}throw new S},r.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",r.GB2312_SUBSET=1,r}(),no=Mu;var Bu=function(){function r(t){this.mirrored=t}return r.prototype.isMirrored=function(){return this.mirrored},r.prototype.applyMirroredCorrection=function(t){if(!(!this.mirrored||t===null||t.length<3)){var e=t[0];t[0]=t[2],t[2]=e}},r}(),an=Bu;var fa=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Fu=function(){function r(){this.rsDecoder=new ie(dt.QR_CODE_FIELD_256)}return r.prototype.decodeBooleanArray=function(t,e){return this.decodeBitMatrix(at.parseFromBooleanArray(t),e)},r.prototype.decodeBitMatrix=function(t,e){var n=new ia(t),o=null;try{return this.decodeBitMatrixParser(n,e)}catch(a){o=a}try{n.remask(),n.setMirror(!0),n.readVersion(),n.readFormatInformation(),n.mirror();var i=this.decodeBitMatrixParser(n,e);return i.setOther(new an(!0)),i}catch(a){throw o!==null?o:a}},r.prototype.decodeBitMatrixParser=function(t,e){var n,o,i,a,s=t.readVersion(),f=t.readFormatInformation().getErrorCorrectionLevel(),c=t.readCodewords(),u=sa.getDataBlocks(c,s,f),l=0;try{for(var h=fa(u),d=h.next();!d.done;d=h.next()){var p=d.value;l+=p.getNumDataCodewords()}}catch(O){n={error:O}}finally{try{d&&!d.done&&(o=h.return)&&o.call(h)}finally{if(n)throw n.error}}var v=new Uint8Array(l),g=0;try{for(var y=fa(u),x=y.next();!x.done;x=y.next()){var p=x.value,C=p.getCodewords(),w=p.getNumDataCodewords();this.correctErrors(C,w);for(var _=0;_<w;_++)v[g++]=C[_]}}catch(O){i={error:O}}finally{try{x&&!x.done&&(a=y.return)&&a.call(y)}finally{if(i)throw i.error}}return no.decode(v,s,f,e)},r.prototype.correctErrors=function(t,e){var n=new Int32Array(t);try{this.rsDecoder.decode(n,t.length-e)}catch{throw new X}for(var o=0;o<e;o++)t[o]=n[o]},r}(),ca=Fu;var Lu=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ku=function(r){Lu(t,r);function t(e,n,o){var i=r.call(this,e,n)||this;return i.estimatedModuleSize=o,i}return t.prototype.aboutEquals=function(e,n,o){if(Math.abs(n-this.getY())<=e&&Math.abs(o-this.getX())<=e){var i=Math.abs(e-this.estimatedModuleSize);return i<=1||i<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,n,o){var i=(this.getX()+n)/2,a=(this.getY()+e)/2,s=(this.estimatedModuleSize+o)/2;return new t(i,a,s)},t}(D),ua=ku;var Uu=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Vu=function(){function r(t,e,n,o,i,a,s){this.image=t,this.startX=e,this.startY=n,this.width=o,this.height=i,this.moduleSize=a,this.resultPointCallback=s,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return r.prototype.find=function(){for(var t=this.startX,e=this.height,n=this.width,o=t+n,i=this.startY+e/2,a=new Int32Array(3),s=this.image,f=0;f<e;f++){var c=i+(f&1?-Math.floor((f+1)/2):Math.floor((f+1)/2));a[0]=0,a[1]=0,a[2]=0;for(var u=t;u<o&&!s.get(u,c);)u++;for(var l=0;u<o;){if(s.get(u,c))if(l===1)a[1]++;else if(l===2){if(this.foundPatternCross(a)){var h=this.handlePossibleCenter(a,c,u);if(h!==null)return h}a[0]=a[2],a[1]=1,a[2]=0,l=1}else a[++l]++;else l===1&&l++,a[l]++;u++}if(this.foundPatternCross(a)){var h=this.handlePossibleCenter(a,c,o);if(h!==null)return h}}if(this.possibleCenters.length!==0)return this.possibleCenters[0];throw new E},r.centerFromEnd=function(t,e){return e-t[2]-t[1]/2},r.prototype.foundPatternCross=function(t){for(var e=this.moduleSize,n=e/2,o=0;o<3;o++)if(Math.abs(e-t[o])>=n)return!1;return!0},r.prototype.crossCheckVertical=function(t,e,n,o){var i=this.image,a=i.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var f=t;f>=0&&i.get(e,f)&&s[1]<=n;)s[1]++,f--;if(f<0||s[1]>n)return NaN;for(;f>=0&&!i.get(e,f)&&s[0]<=n;)s[0]++,f--;if(s[0]>n)return NaN;for(f=t+1;f<a&&i.get(e,f)&&s[1]<=n;)s[1]++,f++;if(f===a||s[1]>n)return NaN;for(;f<a&&!i.get(e,f)&&s[2]<=n;)s[2]++,f++;if(s[2]>n)return NaN;var c=s[0]+s[1]+s[2];return 5*Math.abs(c-o)>=2*o?NaN:this.foundPatternCross(s)?r.centerFromEnd(s,f):NaN},r.prototype.handlePossibleCenter=function(t,e,n){var o,i,a=t[0]+t[1]+t[2],s=r.centerFromEnd(t,n),f=this.crossCheckVertical(e,s,2*t[1],a);if(!isNaN(f)){var c=(t[0]+t[1]+t[2])/3;try{for(var u=Uu(this.possibleCenters),l=u.next();!l.done;l=u.next()){var h=l.value;if(h.aboutEquals(c,f,s))return h.combineEstimate(f,s,c)}}catch(p){o={error:p}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}var d=new ua(s,f,c);this.possibleCenters.push(d),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(d)}return null},r}(),la=Vu;var Hu=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Gu=function(r){Hu(t,r);function t(e,n,o,i){var a=r.call(this,e,n)||this;return a.estimatedModuleSize=o,a.count=i,i===void 0&&(a.count=1),a}return t.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},t.prototype.getCount=function(){return this.count},t.prototype.aboutEquals=function(e,n,o){if(Math.abs(n-this.getY())<=e&&Math.abs(o-this.getX())<=e){var i=Math.abs(e-this.estimatedModuleSize);return i<=1||i<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,n,o){var i=this.count+1,a=(this.count*this.getX()+n)/i,s=(this.count*this.getY()+e)/i,f=(this.count*this.estimatedModuleSize+o)/i;return new t(a,s,f,i)},t}(D),ha=Gu;var zu=function(){function r(t){this.bottomLeft=t[0],this.topLeft=t[1],this.topRight=t[2]}return r.prototype.getBottomLeft=function(){return this.bottomLeft},r.prototype.getTopLeft=function(){return this.topLeft},r.prototype.getTopRight=function(){return this.topRight},r}(),da=zu;var xr=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Wu=function(){function r(t,e){this.image=t,this.resultPointCallback=e,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=e}return r.prototype.getImage=function(){return this.image},r.prototype.getPossibleCenters=function(){return this.possibleCenters},r.prototype.find=function(t){var e=t!=null&&t.get(L.TRY_HARDER)!==void 0,n=t!=null&&t.get(L.PURE_BARCODE)!==void 0,o=this.image,i=o.getHeight(),a=o.getWidth(),s=Math.floor(3*i/(4*r.MAX_MODULES));(s<r.MIN_SKIP||e)&&(s=r.MIN_SKIP);for(var f=!1,c=new Int32Array(5),u=s-1;u<i&&!f;u+=s){c[0]=0,c[1]=0,c[2]=0,c[3]=0,c[4]=0;for(var l=0,h=0;h<a;h++)if(o.get(h,u))(l&1)===1&&l++,c[l]++;else if(l&1)c[l]++;else if(l===4)if(r.foundPatternCross(c)){var d=this.handlePossibleCenter(c,u,h,n);if(d===!0)if(s=2,this.hasSkipped===!0)f=this.haveMultiplyConfirmedCenters();else{var p=this.findRowSkip();p>c[2]&&(u+=p-c[2]-s,h=a-1)}else{c[0]=c[2],c[1]=c[3],c[2]=c[4],c[3]=1,c[4]=0,l=3;continue}l=0,c[0]=0,c[1]=0,c[2]=0,c[3]=0,c[4]=0}else c[0]=c[2],c[1]=c[3],c[2]=c[4],c[3]=1,c[4]=0,l=3;else c[++l]++;if(r.foundPatternCross(c)){var d=this.handlePossibleCenter(c,u,a,n);d===!0&&(s=c[0],this.hasSkipped&&(f=this.haveMultiplyConfirmedCenters()))}}var v=this.selectBestPatterns();return D.orderBestPatterns(v),new da(v)},r.centerFromEnd=function(t,e){return e-t[4]-t[3]-t[2]/2},r.foundPatternCross=function(t){for(var e=0,n=0;n<5;n++){var o=t[n];if(o===0)return!1;e+=o}if(e<7)return!1;var i=e/7,a=i/2;return Math.abs(i-t[0])<a&&Math.abs(i-t[1])<a&&Math.abs(3*i-t[2])<3*a&&Math.abs(i-t[3])<a&&Math.abs(i-t[4])<a},r.prototype.getCrossCheckStateCount=function(){var t=this.crossCheckStateCount;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t},r.prototype.crossCheckDiagonal=function(t,e,n,o){for(var i=this.getCrossCheckStateCount(),a=0,s=this.image;t>=a&&e>=a&&s.get(e-a,t-a);)i[2]++,a++;if(t<a||e<a)return!1;for(;t>=a&&e>=a&&!s.get(e-a,t-a)&&i[1]<=n;)i[1]++,a++;if(t<a||e<a||i[1]>n)return!1;for(;t>=a&&e>=a&&s.get(e-a,t-a)&&i[0]<=n;)i[0]++,a++;if(i[0]>n)return!1;var f=s.getHeight(),c=s.getWidth();for(a=1;t+a<f&&e+a<c&&s.get(e+a,t+a);)i[2]++,a++;if(t+a>=f||e+a>=c)return!1;for(;t+a<f&&e+a<c&&!s.get(e+a,t+a)&&i[3]<n;)i[3]++,a++;if(t+a>=f||e+a>=c||i[3]>=n)return!1;for(;t+a<f&&e+a<c&&s.get(e+a,t+a)&&i[4]<n;)i[4]++,a++;if(i[4]>=n)return!1;var u=i[0]+i[1]+i[2]+i[3]+i[4];return Math.abs(u-o)<2*o&&r.foundPatternCross(i)},r.prototype.crossCheckVertical=function(t,e,n,o){for(var i=this.image,a=i.getHeight(),s=this.getCrossCheckStateCount(),f=t;f>=0&&i.get(e,f);)s[2]++,f--;if(f<0)return NaN;for(;f>=0&&!i.get(e,f)&&s[1]<=n;)s[1]++,f--;if(f<0||s[1]>n)return NaN;for(;f>=0&&i.get(e,f)&&s[0]<=n;)s[0]++,f--;if(s[0]>n)return NaN;for(f=t+1;f<a&&i.get(e,f);)s[2]++,f++;if(f===a)return NaN;for(;f<a&&!i.get(e,f)&&s[3]<n;)s[3]++,f++;if(f===a||s[3]>=n)return NaN;for(;f<a&&i.get(e,f)&&s[4]<n;)s[4]++,f++;if(s[4]>=n)return NaN;var c=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(c-o)>=2*o?NaN:r.foundPatternCross(s)?r.centerFromEnd(s,f):NaN},r.prototype.crossCheckHorizontal=function(t,e,n,o){for(var i=this.image,a=i.getWidth(),s=this.getCrossCheckStateCount(),f=t;f>=0&&i.get(f,e);)s[2]++,f--;if(f<0)return NaN;for(;f>=0&&!i.get(f,e)&&s[1]<=n;)s[1]++,f--;if(f<0||s[1]>n)return NaN;for(;f>=0&&i.get(f,e)&&s[0]<=n;)s[0]++,f--;if(s[0]>n)return NaN;for(f=t+1;f<a&&i.get(f,e);)s[2]++,f++;if(f===a)return NaN;for(;f<a&&!i.get(f,e)&&s[3]<n;)s[3]++,f++;if(f===a||s[3]>=n)return NaN;for(;f<a&&i.get(f,e)&&s[4]<n;)s[4]++,f++;if(s[4]>=n)return NaN;var c=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(c-o)>=o?NaN:r.foundPatternCross(s)?r.centerFromEnd(s,f):NaN},r.prototype.handlePossibleCenter=function(t,e,n,o){var i=t[0]+t[1]+t[2]+t[3]+t[4],a=r.centerFromEnd(t,n),s=this.crossCheckVertical(e,Math.floor(a),t[2],i);if(!isNaN(s)&&(a=this.crossCheckHorizontal(Math.floor(a),Math.floor(s),t[2],i),!isNaN(a)&&(!o||this.crossCheckDiagonal(Math.floor(s),Math.floor(a),t[2],i)))){for(var f=i/7,c=!1,u=this.possibleCenters,l=0,h=u.length;l<h;l++){var d=u[l];if(d.aboutEquals(f,s,a)){u[l]=d.combineEstimate(s,a,f),c=!0;break}}if(!c){var p=new ha(a,s,f);u.push(p),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(p)}return!0}return!1},r.prototype.findRowSkip=function(){var t,e,n=this.possibleCenters.length;if(n<=1)return 0;var o=null;try{for(var i=xr(this.possibleCenters),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.getCount()>=r.CENTER_QUORUM)if(o==null)o=s;else return this.hasSkipped=!0,Math.floor((Math.abs(o.getX()-s.getX())-Math.abs(o.getY()-s.getY()))/2)}}catch(f){t={error:f}}finally{try{a&&!a.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return 0},r.prototype.haveMultiplyConfirmedCenters=function(){var t,e,n,o,i=0,a=0,s=this.possibleCenters.length;try{for(var f=xr(this.possibleCenters),c=f.next();!c.done;c=f.next()){var u=c.value;u.getCount()>=r.CENTER_QUORUM&&(i++,a+=u.getEstimatedModuleSize())}}catch(v){t={error:v}}finally{try{c&&!c.done&&(e=f.return)&&e.call(f)}finally{if(t)throw t.error}}if(i<3)return!1;var l=a/s,h=0;try{for(var d=xr(this.possibleCenters),p=d.next();!p.done;p=d.next()){var u=p.value;h+=Math.abs(u.getEstimatedModuleSize()-l)}}catch(v){n={error:v}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(n)throw n.error}}return h<=.05*a},r.prototype.selectBestPatterns=function(){var t,e,n,o,i=this.possibleCenters.length;if(i<3)throw new E;var a=this.possibleCenters,s;if(i>3){var f=0,c=0;try{for(var u=xr(this.possibleCenters),l=u.next();!l.done;l=u.next()){var h=l.value,d=h.getEstimatedModuleSize();f+=d,c+=d*d}}catch(_){t={error:_}}finally{try{l&&!l.done&&(e=u.return)&&e.call(u)}finally{if(t)throw t.error}}s=f/i;var p=Math.sqrt(c/i-s*s);a.sort(function(_,O){var R=Math.abs(O.getEstimatedModuleSize()-s),N=Math.abs(_.getEstimatedModuleSize()-s);return R<N?-1:R>N?1:0});for(var v=Math.max(.2*s,p),g=0;g<a.length&&a.length>3;g++){var y=a[g];Math.abs(y.getEstimatedModuleSize()-s)>v&&(a.splice(g,1),g--)}}if(a.length>3){var f=0;try{for(var x=xr(a),C=x.next();!C.done;C=x.next()){var w=C.value;f+=w.getEstimatedModuleSize()}}catch(O){n={error:O}}finally{try{C&&!C.done&&(o=x.return)&&o.call(x)}finally{if(n)throw n.error}}s=f/a.length,a.sort(function(O,R){if(R.getCount()===O.getCount()){var N=Math.abs(R.getEstimatedModuleSize()-s),k=Math.abs(O.getEstimatedModuleSize()-s);return N<k?1:N>k?-1:0}else return R.getCount()-O.getCount()}),a.splice(3)}return[a[0],a[1],a[2]]},r.CENTER_QUORUM=2,r.MIN_SKIP=3,r.MAX_MODULES=57,r}(),pa=Wu;var Xu=function(){function r(t){this.image=t}return r.prototype.getImage=function(){return this.image},r.prototype.getResultPointCallback=function(){return this.resultPointCallback},r.prototype.detect=function(t){this.resultPointCallback=t==null?null:t.get(L.NEED_RESULT_POINT_CALLBACK);var e=new pa(this.image,this.resultPointCallback),n=e.find(t);return this.processFinderPatternInfo(n)},r.prototype.processFinderPatternInfo=function(t){var e=t.getTopLeft(),n=t.getTopRight(),o=t.getBottomLeft(),i=this.calculateModuleSize(e,n,o);if(i<1)throw new E("No pattern found in proccess finder.");var a=r.computeDimension(e,n,o,i),s=Zt.getProvisionalVersionForDimension(a),f=s.getDimensionForVersion()-7,c=null;if(s.getAlignmentPatternCenters().length>0)for(var u=n.getX()-e.getX()+o.getX(),l=n.getY()-e.getY()+o.getY(),h=1-3/f,d=Math.floor(e.getX()+h*(u-e.getX())),p=Math.floor(e.getY()+h*(l-e.getY())),v=4;v<=16;v<<=1)try{c=this.findAlignmentInRegion(i,d,p,v);break}catch(C){if(!(C instanceof E))throw C}var g=r.createTransform(e,n,o,c,a),y=r.sampleGrid(this.image,g,a),x;return c===null?x=[o,e,n]:x=[o,e,n,c],new De(y,x)},r.createTransform=function(t,e,n,o,i){var a=i-3.5,s,f,c,u;return o!==null?(s=o.getX(),f=o.getY(),c=a-3,u=c):(s=e.getX()-t.getX()+n.getX(),f=e.getY()-t.getY()+n.getY(),c=a,u=a),pr.quadrilateralToQuadrilateral(3.5,3.5,a,3.5,c,u,3.5,a,t.getX(),t.getY(),e.getX(),e.getY(),s,f,n.getX(),n.getY())},r.sampleGrid=function(t,e,n){var o=be.getInstance();return o.sampleGridWithTransform(t,n,n,e)},r.computeDimension=function(t,e,n,o){var i=G.round(D.distance(t,e)/o),a=G.round(D.distance(t,n)/o),s=Math.floor((i+a)/2)+7;switch(s&3){case 0:s++;break;case 2:s--;break;case 3:throw new E("Dimensions could be not found.")}return s},r.prototype.calculateModuleSize=function(t,e,n){return(this.calculateModuleSizeOneWay(t,e)+this.calculateModuleSizeOneWay(t,n))/2},r.prototype.calculateModuleSizeOneWay=function(t,e){var n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY())),o=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY()));return isNaN(n)?o/7:isNaN(o)?n/7:(n+o)/14},r.prototype.sizeOfBlackWhiteBlackRunBothWays=function(t,e,n,o){var i=this.sizeOfBlackWhiteBlackRun(t,e,n,o),a=1,s=t-(n-t);s<0?(a=t/(t-s),s=0):s>=this.image.getWidth()&&(a=(this.image.getWidth()-1-t)/(s-t),s=this.image.getWidth()-1);var f=Math.floor(e-(o-e)*a);return a=1,f<0?(a=e/(e-f),f=0):f>=this.image.getHeight()&&(a=(this.image.getHeight()-1-e)/(f-e),f=this.image.getHeight()-1),s=Math.floor(t+(s-t)*a),i+=this.sizeOfBlackWhiteBlackRun(t,e,s,f),i-1},r.prototype.sizeOfBlackWhiteBlackRun=function(t,e,n,o){var i=Math.abs(o-e)>Math.abs(n-t);if(i){var a=t;t=e,e=a,a=n,n=o,o=a}for(var s=Math.abs(n-t),f=Math.abs(o-e),c=-s/2,u=t<n?1:-1,l=e<o?1:-1,h=0,d=n+u,p=t,v=e;p!==d;p+=u){var g=i?v:p,y=i?p:v;if(h===1===this.image.get(g,y)){if(h===2)return G.distance(p,v,t,e);h++}if(c+=f,c>0){if(v===o)break;v+=l,c-=s}}return h===2?G.distance(n+u,o,t,e):NaN},r.prototype.findAlignmentInRegion=function(t,e,n,o){var i=Math.floor(o*t),a=Math.max(0,e-i),s=Math.min(this.image.getWidth()-1,e+i);if(s-a<t*3)throw new E("Alignment top exceeds estimated module size.");var f=Math.max(0,n-i),c=Math.min(this.image.getHeight()-1,n+i);if(c-f<t*3)throw new E("Alignment bottom exceeds estimated module size.");var u=new la(this.image,a,f,s-a,c-f,t,this.resultPointCallback);return u.find()},r}(),va=Xu;var ju=function(){function r(){this.decoder=new ca}return r.prototype.getDecoder=function(){return this.decoder},r.prototype.decode=function(t,e){var n,o;if(e!=null&&e.get(L.PURE_BARCODE)!==void 0){var i=r.extractPureBits(t.getBlackMatrix());n=this.decoder.decodeBitMatrix(i,e),o=r.NO_POINTS}else{var a=new va(t.getBlackMatrix()).detect(e);n=this.decoder.decodeBitMatrix(a.getBits(),e),o=a.getPoints()}n.getOther()instanceof an&&n.getOther().applyMirroredCorrection(o);var s=new Y(n.getText(),n.getRawBytes(),void 0,o,T.QR_CODE,void 0),f=n.getByteSegments();f!==null&&s.putMetadata(st.BYTE_SEGMENTS,f);var c=n.getECLevel();return c!==null&&s.putMetadata(st.ERROR_CORRECTION_LEVEL,c),n.hasStructuredAppend()&&(s.putMetadata(st.STRUCTURED_APPEND_SEQUENCE,n.getStructuredAppendSequenceNumber()),s.putMetadata(st.STRUCTURED_APPEND_PARITY,n.getStructuredAppendParity())),s},r.prototype.reset=function(){},r.extractPureBits=function(t){var e=t.getTopLeftOnBit(),n=t.getBottomRightOnBit();if(e===null||n===null)throw new E;var o=this.moduleSize(e,t),i=e[1],a=n[1],s=e[0],f=n[0];if(s>=f||i>=a)throw new E;if(a-i!==f-s&&(f=s+(a-i),f>=t.getWidth()))throw new E;var c=Math.round((f-s+1)/o),u=Math.round((a-i+1)/o);if(c<=0||u<=0)throw new E;if(u!==c)throw new E;var l=Math.floor(o/2);i+=l,s+=l;var h=s+Math.floor((c-1)*o)-f;if(h>0){if(h>l)throw new E;s-=h}var d=i+Math.floor((u-1)*o)-a;if(d>0){if(d>l)throw new E;i-=d}for(var p=new at(c,u),v=0;v<u;v++)for(var g=i+Math.floor(v*o),y=0;y<c;y++)t.get(s+Math.floor(y*o),g)&&p.set(y,v);return p},r.moduleSize=function(t,e){for(var n=e.getHeight(),o=e.getWidth(),i=t[0],a=t[1],s=!0,f=0;i<o&&a<n;){if(s!==e.get(i,a)){if(++f===5)break;s=!s}i++,a++}if(i===o||a===n)throw new E;return(i-t[0])/7},r.NO_POINTS=new Array,r}(),we=ju;var Yu=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Zu=function(){function r(){}return r.prototype.PDF417Common=function(){},r.getBitCountSum=function(t){return G.sum(t)},r.toIntArray=function(t){var e,n;if(t==null||!t.length)return r.EMPTY_INT_ARRAY;var o=new Int32Array(t.length),i=0;try{for(var a=Yu(t),s=a.next();!s.done;s=a.next()){var f=s.value;o[i++]=f}}catch(c){e={error:c}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return o},r.getCodeword=function(t){var e=Z.binarySearch(r.SYMBOL_TABLE,t&262143);return e<0?-1:(r.CODEWORD_TABLE[e]-1)%r.NUMBER_OF_CODEWORDS},r.NUMBER_OF_CODEWORDS=929,r.MAX_CODEWORDS_IN_BARCODE=r.NUMBER_OF_CODEWORDS-1,r.MIN_ROWS_IN_BARCODE=3,r.MAX_ROWS_IN_BARCODE=90,r.MODULES_IN_CODEWORD=17,r.MODULES_IN_STOP_PATTERN=18,r.BARS_IN_MODULE=8,r.EMPTY_INT_ARRAY=new Int32Array([]),r.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),r.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),r}(),z=Zu;var Ku=function(){function r(t,e){this.bits=t,this.points=e}return r.prototype.getBits=function(){return this.bits},r.prototype.getPoints=function(){return this.points},r}(),ma=Ku;var Qu=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},qu=function(){function r(){}return r.detectMultiple=function(t,e,n){var o=t.getBlackMatrix(),i=r.detect(n,o);return i.length||(o=o.clone(),o.rotate180(),i=r.detect(n,o)),new ma(o,i)},r.detect=function(t,e){for(var n,o,i=new Array,a=0,s=0,f=!1;a<e.getHeight();){var c=r.findVertices(e,a,s);if(c[0]==null&&c[3]==null){if(!f)break;f=!1,s=0;try{for(var u=(n=void 0,Qu(i)),l=u.next();!l.done;l=u.next()){var h=l.value;h[1]!=null&&(a=Math.trunc(Math.max(a,h[1].getY()))),h[3]!=null&&(a=Math.max(a,Math.trunc(h[3].getY())))}}catch(d){n={error:d}}finally{try{l&&!l.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}a+=r.ROW_STEP;continue}if(f=!0,i.push(c),!t)break;c[2]!=null?(s=Math.trunc(c[2].getX()),a=Math.trunc(c[2].getY())):(s=Math.trunc(c[4].getX()),a=Math.trunc(c[4].getY()))}return i},r.findVertices=function(t,e,n){var o=t.getHeight(),i=t.getWidth(),a=new Array(8);return r.copyToResult(a,r.findRowsWithPattern(t,o,i,e,n,r.START_PATTERN),r.INDEXES_START_PATTERN),a[4]!=null&&(n=Math.trunc(a[4].getX()),e=Math.trunc(a[4].getY())),r.copyToResult(a,r.findRowsWithPattern(t,o,i,e,n,r.STOP_PATTERN),r.INDEXES_STOP_PATTERN),a},r.copyToResult=function(t,e,n){for(var o=0;o<n.length;o++)t[n[o]]=e[o]},r.findRowsWithPattern=function(t,e,n,o,i,a){for(var s=new Array(4),f=!1,c=new Int32Array(a.length);o<e;o+=r.ROW_STEP){var u=r.findGuardPattern(t,i,o,n,!1,a,c);if(u!=null){for(;o>0;){var l=r.findGuardPattern(t,i,--o,n,!1,a,c);if(l!=null)u=l;else{o++;break}}s[0]=new D(u[0],o),s[1]=new D(u[1],o),f=!0;break}}var h=o+1;if(f){for(var d=0,l=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);h<e;h++){var u=r.findGuardPattern(t,l[0],h,n,!1,a,c);if(u!=null&&Math.abs(l[0]-u[0])<r.MAX_PATTERN_DRIFT&&Math.abs(l[1]-u[1])<r.MAX_PATTERN_DRIFT)l=u,d=0;else{if(d>r.SKIPPED_ROW_COUNT_MAX)break;d++}}h-=d+1,s[2]=new D(l[0],h),s[3]=new D(l[1],h)}return h-o<r.BARCODE_MIN_HEIGHT&&Z.fill(s,null),s},r.findGuardPattern=function(t,e,n,o,i,a,s){Z.fillWithin(s,0,s.length,0);for(var f=e,c=0;t.get(f,n)&&f>0&&c++<r.MAX_PIXEL_DRIFT;)f--;for(var u=f,l=0,h=a.length,d=i;u<o;u++){var p=t.get(u,n);if(p!==d)s[l]++;else{if(l===h-1){if(r.patternMatchVariance(s,a,r.MAX_INDIVIDUAL_VARIANCE)<r.MAX_AVG_VARIANCE)return new Int32Array([f,u]);f+=s[0]+s[1],H.arraycopy(s,2,s,0,l-1),s[l-1]=0,s[l]=0,l--}else l++;s[l]=1,d=!d}}return l===h-1&&r.patternMatchVariance(s,a,r.MAX_INDIVIDUAL_VARIANCE)<r.MAX_AVG_VARIANCE?new Int32Array([f,u-1]):null},r.patternMatchVariance=function(t,e,n){for(var o=t.length,i=0,a=0,s=0;s<o;s++)i+=t[s],a+=e[s];if(i<a)return 1/0;var f=i/a;n*=f;for(var c=0,u=0;u<o;u++){var l=t[u],h=e[u]*f,d=l>h?l-h:h-l;if(d>n)return 1/0;c+=d}return c/i},r.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),r.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),r.MAX_AVG_VARIANCE=.42,r.MAX_INDIVIDUAL_VARIANCE=.8,r.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),r.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),r.MAX_PIXEL_DRIFT=3,r.MAX_PATTERN_DRIFT=5,r.SKIPPED_ROW_COUNT_MAX=25,r.ROW_STEP=5,r.BARCODE_MIN_HEIGHT=10,r}(),ga=qu;var $u=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ju=function(){function r(t,e){if(e.length===0)throw new I;this.field=t;var n=e.length;if(n>1&&e[0]===0){for(var o=1;o<n&&e[o]===0;)o++;o===n?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(n-o),H.arraycopy(e,o,this.coefficients,0,this.coefficients.length))}else this.coefficients=e}return r.prototype.getCoefficients=function(){return this.coefficients},r.prototype.getDegree=function(){return this.coefficients.length-1},r.prototype.isZero=function(){return this.coefficients[0]===0},r.prototype.getCoefficient=function(t){return this.coefficients[this.coefficients.length-1-t]},r.prototype.evaluateAt=function(t){var e,n;if(t===0)return this.getCoefficient(0);if(t===1){var o=0;try{for(var i=$u(this.coefficients),a=i.next();!a.done;a=i.next()){var s=a.value;o=this.field.add(o,s)}}catch(l){e={error:l}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return o}for(var f=this.coefficients[0],c=this.coefficients.length,u=1;u<c;u++)f=this.field.add(this.field.multiply(t,f),this.coefficients[u]);return f},r.prototype.add=function(t){if(!this.field.equals(t.field))throw new I("ModulusPolys do not have same ModulusGF field");if(this.isZero())return t;if(t.isZero())return this;var e=this.coefficients,n=t.coefficients;if(e.length>n.length){var o=e;e=n,n=o}var i=new Int32Array(n.length),a=n.length-e.length;H.arraycopy(n,0,i,0,a);for(var s=a;s<n.length;s++)i[s]=this.field.add(e[s-a],n[s]);return new r(this.field,i)},r.prototype.subtract=function(t){if(!this.field.equals(t.field))throw new I("ModulusPolys do not have same ModulusGF field");return t.isZero()?this:this.add(t.negative())},r.prototype.multiply=function(t){return t instanceof r?this.multiplyOther(t):this.multiplyScalar(t)},r.prototype.multiplyOther=function(t){if(!this.field.equals(t.field))throw new I("ModulusPolys do not have same ModulusGF field");if(this.isZero()||t.isZero())return new r(this.field,new Int32Array([0]));for(var e=this.coefficients,n=e.length,o=t.coefficients,i=o.length,a=new Int32Array(n+i-1),s=0;s<n;s++)for(var f=e[s],c=0;c<i;c++)a[s+c]=this.field.add(a[s+c],this.field.multiply(f,o[c]));return new r(this.field,a)},r.prototype.negative=function(){for(var t=this.coefficients.length,e=new Int32Array(t),n=0;n<t;n++)e[n]=this.field.subtract(0,this.coefficients[n]);return new r(this.field,e)},r.prototype.multiplyScalar=function(t){if(t===0)return new r(this.field,new Int32Array([0]));if(t===1)return this;for(var e=this.coefficients.length,n=new Int32Array(e),o=0;o<e;o++)n[o]=this.field.multiply(this.coefficients[o],t);return new r(this.field,n)},r.prototype.multiplyByMonomial=function(t,e){if(t<0)throw new I;if(e===0)return new r(this.field,new Int32Array([0]));for(var n=this.coefficients.length,o=new Int32Array(n+t),i=0;i<n;i++)o[i]=this.field.multiply(this.coefficients[i],e);return new r(this.field,o)},r.prototype.toString=function(){for(var t=new P,e=this.getDegree();e>=0;e--){var n=this.getCoefficient(e);n!==0&&(n<0?(t.append(" - "),n=-n):t.length()>0&&t.append(" + "),(e===0||n!==1)&&t.append(n),e!==0&&(e===1?t.append("x"):(t.append("x^"),t.append(e))))}return t.toString()},r}(),fe=Ju;var t1=function(){function r(){}return r.prototype.add=function(t,e){return(t+e)%this.modulus},r.prototype.subtract=function(t,e){return(this.modulus+t-e)%this.modulus},r.prototype.exp=function(t){return this.expTable[t]},r.prototype.log=function(t){if(t===0)throw new I;return this.logTable[t]},r.prototype.inverse=function(t){if(t===0)throw new hr;return this.expTable[this.modulus-this.logTable[t]-1]},r.prototype.multiply=function(t,e){return t===0||e===0?0:this.expTable[(this.logTable[t]+this.logTable[e])%(this.modulus-1)]},r.prototype.getSize=function(){return this.modulus},r.prototype.equals=function(t){return t===this},r}(),xa=t1;var e1=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),r1=function(r){e1(t,r);function t(e,n){var o=r.call(this)||this;o.modulus=e,o.expTable=new Int32Array(e),o.logTable=new Int32Array(e);for(var i=1,a=0;a<e;a++)o.expTable[a]=i,i=i*n%e;for(var a=0;a<e-1;a++)o.logTable[o.expTable[a]]=a;return o.zero=new fe(o,new Int32Array([0])),o.one=new fe(o,new Int32Array([1])),o}return t.prototype.getZero=function(){return this.zero},t.prototype.getOne=function(){return this.one},t.prototype.buildMonomial=function(e,n){if(e<0)throw new I;if(n===0)return this.zero;var o=new Int32Array(e+1);return o[0]=n,new fe(this,o)},t.PDF417_GF=new t(z.NUMBER_OF_CODEWORDS,3),t}(xa),ya=r1;var n1=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o1=function(){function r(){this.field=ya.PDF417_GF}return r.prototype.decode=function(t,e,n){for(var o,i,a=new fe(this.field,t),s=new Int32Array(e),f=!1,c=e;c>0;c--){var u=a.evaluateAt(this.field.exp(c));s[e-c]=u,u!==0&&(f=!0)}if(!f)return 0;var l=this.field.getOne();if(n!=null)try{for(var h=n1(n),d=h.next();!d.done;d=h.next()){var p=d.value,v=this.field.exp(t.length-1-p),g=new fe(this.field,new Int32Array([this.field.subtract(0,v),1]));l=l.multiply(g)}}catch(N){o={error:N}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}for(var y=new fe(this.field,s),x=this.runEuclideanAlgorithm(this.field.buildMonomial(e,1),y,e),C=x[0],w=x[1],_=this.findErrorLocations(C),O=this.findErrorMagnitudes(w,C,_),c=0;c<_.length;c++){var R=t.length-1-this.field.log(_[c]);if(R<0)throw X.getChecksumInstance();t[R]=this.field.subtract(t[R],O[c])}return _.length},r.prototype.runEuclideanAlgorithm=function(t,e,n){if(t.getDegree()<e.getDegree()){var o=t;t=e,e=o}for(var i=t,a=e,s=this.field.getZero(),f=this.field.getOne();a.getDegree()>=Math.round(n/2);){var c=i,u=s;if(i=a,s=f,i.isZero())throw X.getChecksumInstance();a=c;for(var l=this.field.getZero(),h=i.getCoefficient(i.getDegree()),d=this.field.inverse(h);a.getDegree()>=i.getDegree()&&!a.isZero();){var p=a.getDegree()-i.getDegree(),v=this.field.multiply(a.getCoefficient(a.getDegree()),d);l=l.add(this.field.buildMonomial(p,v)),a=a.subtract(i.multiplyByMonomial(p,v))}f=l.multiply(s).subtract(u).negative()}var g=f.getCoefficient(0);if(g===0)throw X.getChecksumInstance();var y=this.field.inverse(g),x=f.multiply(y),C=a.multiply(y);return[x,C]},r.prototype.findErrorLocations=function(t){for(var e=t.getDegree(),n=new Int32Array(e),o=0,i=1;i<this.field.getSize()&&o<e;i++)t.evaluateAt(i)===0&&(n[o]=this.field.inverse(i),o++);if(o!==e)throw X.getChecksumInstance();return n},r.prototype.findErrorMagnitudes=function(t,e,n){for(var o=e.getDegree(),i=new Int32Array(o),a=1;a<=o;a++)i[o-a]=this.field.multiply(a,e.getCoefficient(a));for(var s=new fe(this.field,i),f=n.length,c=new Int32Array(f),a=0;a<f;a++){var u=this.field.inverse(n[a]),l=this.field.subtract(0,t.evaluateAt(u)),h=this.field.inverse(s.evaluateAt(u));c[a]=this.field.multiply(l,h)}return c},r}(),oo=o1;var i1=function(){function r(t,e,n,o,i){t instanceof r?this.constructor_2(t):this.constructor_1(t,e,n,o,i)}return r.prototype.constructor_1=function(t,e,n,o,i){var a=e==null||n==null,s=o==null||i==null;if(a&&s)throw new E;a?(e=new D(0,o.getY()),n=new D(0,i.getY())):s&&(o=new D(t.getWidth()-1,e.getY()),i=new D(t.getWidth()-1,n.getY())),this.image=t,this.topLeft=e,this.bottomLeft=n,this.topRight=o,this.bottomRight=i,this.minX=Math.trunc(Math.min(e.getX(),n.getX())),this.maxX=Math.trunc(Math.max(o.getX(),i.getX())),this.minY=Math.trunc(Math.min(e.getY(),o.getY())),this.maxY=Math.trunc(Math.max(n.getY(),i.getY()))},r.prototype.constructor_2=function(t){this.image=t.image,this.topLeft=t.getTopLeft(),this.bottomLeft=t.getBottomLeft(),this.topRight=t.getTopRight(),this.bottomRight=t.getBottomRight(),this.minX=t.getMinX(),this.maxX=t.getMaxX(),this.minY=t.getMinY(),this.maxY=t.getMaxY()},r.merge=function(t,e){return t==null?e:e==null?t:new r(t.image,t.topLeft,t.bottomLeft,e.topRight,e.bottomRight)},r.prototype.addMissingRows=function(t,e,n){var o=this.topLeft,i=this.bottomLeft,a=this.topRight,s=this.bottomRight;if(t>0){var f=n?this.topLeft:this.topRight,c=Math.trunc(f.getY()-t);c<0&&(c=0);var u=new D(f.getX(),c);n?o=u:a=u}if(e>0){var l=n?this.bottomLeft:this.bottomRight,h=Math.trunc(l.getY()+e);h>=this.image.getHeight()&&(h=this.image.getHeight()-1);var d=new D(l.getX(),h);n?i=d:s=d}return new r(this.image,o,i,a,s)},r.prototype.getMinX=function(){return this.minX},r.prototype.getMaxX=function(){return this.maxX},r.prototype.getMinY=function(){return this.minY},r.prototype.getMaxY=function(){return this.maxY},r.prototype.getTopLeft=function(){return this.topLeft},r.prototype.getTopRight=function(){return this.topRight},r.prototype.getBottomLeft=function(){return this.bottomLeft},r.prototype.getBottomRight=function(){return this.bottomRight},r}(),yr=i1;var a1=function(){function r(t,e,n,o){this.columnCount=t,this.errorCorrectionLevel=o,this.rowCountUpperPart=e,this.rowCountLowerPart=n,this.rowCount=e+n}return r.prototype.getColumnCount=function(){return this.columnCount},r.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},r.prototype.getRowCount=function(){return this.rowCount},r.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},r.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},r}(),Ca=a1;var s1=function(){function r(){this.buffer=""}return r.form=function(t,e){var n=-1;function o(a,s,f,c,u,l){if(a==="%%")return"%";if(e[++n]!==void 0){a=c?parseInt(c.substr(1)):void 0;var h=u?parseInt(u.substr(1)):void 0,d;switch(l){case"s":d=e[n];break;case"c":d=e[n][0];break;case"f":d=parseFloat(e[n]).toFixed(a);break;case"p":d=parseFloat(e[n]).toPrecision(a);break;case"e":d=parseFloat(e[n]).toExponential(a);break;case"x":d=parseInt(e[n]).toString(h||16);break;case"d":d=parseFloat(parseInt(e[n],h||10).toPrecision(a)).toFixed(0);break}d=typeof d=="object"?JSON.stringify(d):(+d).toString(h);for(var p=parseInt(f),v=f&&f[0]+""=="0"?"0":" ";d.length<p;)d=s!==void 0?d+v:v+d;return d}}var i=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return t.replace(i,o)},r.prototype.format=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this.buffer+=r.form(t,e)},r.prototype.toString=function(){return this.buffer},r}(),$e=s1;var f1=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},c1=function(){function r(t){this.boundingBox=new yr(t),this.codewords=new Array(t.getMaxY()-t.getMinY()+1)}return r.prototype.getCodewordNearby=function(t){var e=this.getCodeword(t);if(e!=null)return e;for(var n=1;n<r.MAX_NEARBY_DISTANCE;n++){var o=this.imageRowToCodewordIndex(t)-n;if(o>=0&&(e=this.codewords[o],e!=null)||(o=this.imageRowToCodewordIndex(t)+n,o<this.codewords.length&&(e=this.codewords[o],e!=null)))return e}return null},r.prototype.imageRowToCodewordIndex=function(t){return t-this.boundingBox.getMinY()},r.prototype.setCodeword=function(t,e){this.codewords[this.imageRowToCodewordIndex(t)]=e},r.prototype.getCodeword=function(t){return this.codewords[this.imageRowToCodewordIndex(t)]},r.prototype.getBoundingBox=function(){return this.boundingBox},r.prototype.getCodewords=function(){return this.codewords},r.prototype.toString=function(){var t,e,n=new $e,o=0;try{for(var i=f1(this.codewords),a=i.next();!a.done;a=i.next()){var s=a.value;if(s==null){n.format("%3d:    |   %n",o++);continue}n.format("%3d: %3d|%3d%n",o++,s.getRowNumber(),s.getValue())}}catch(f){t={error:f}}finally{try{a&&!a.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return n.toString()},r.MAX_NEARBY_DISTANCE=5,r}(),sn=c1;var u1=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},l1=function(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var n=e.call(r),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(a)throw a.error}}return i},h1=function(){function r(){this.values=new Map}return r.prototype.setValue=function(t){t=Math.trunc(t);var e=this.values.get(t);e==null&&(e=0),e++,this.values.set(t,e)},r.prototype.getValue=function(){var t,e,n=-1,o=new Array,i=function(l,h){var d={getKey:function(){return l},getValue:function(){return h}};d.getValue()>n?(n=d.getValue(),o=[],o.push(d.getKey())):d.getValue()===n&&o.push(d.getKey())};try{for(var a=u1(this.values.entries()),s=a.next();!s.done;s=a.next()){var f=l1(s.value,2),c=f[0],u=f[1];i(c,u)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return z.toIntArray(o)},r.prototype.getConfidence=function(t){return this.values.get(t)},r}(),Me=h1;var d1=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),io=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},p1=function(r){d1(t,r);function t(e,n){var o=r.call(this,e)||this;return o._isLeft=n,o}return t.prototype.setRowNumbers=function(){var e,n;try{for(var o=io(this.getCodewords()),i=o.next();!i.done;i=o.next()){var a=i.value;a?.setRowNumberAsRowIndicatorColumn()}}catch(s){e={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}},t.prototype.adjustCompleteIndicatorColumnRowNumbers=function(e){var n=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(n,e);for(var o=this.getBoundingBox(),i=this._isLeft?o.getTopLeft():o.getTopRight(),a=this._isLeft?o.getBottomLeft():o.getBottomRight(),s=this.imageRowToCodewordIndex(Math.trunc(i.getY())),f=this.imageRowToCodewordIndex(Math.trunc(a.getY())),c=-1,u=1,l=0,h=s;h<f;h++)if(n[h]!=null){var d=n[h],p=d.getRowNumber()-c;if(p===0)l++;else if(p===1)u=Math.max(u,l),l=1,c=d.getRowNumber();else if(p<0||d.getRowNumber()>=e.getRowCount()||p>h)n[h]=null;else{var v=void 0;u>2?v=(u-2)*p:v=p;for(var g=v>=h,y=1;y<=v&&!g;y++)g=n[h-y]!=null;g?n[h]=null:(c=d.getRowNumber(),l=1)}}},t.prototype.getRowHeights=function(){var e,n,o=this.getBarcodeMetadata();if(o==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(o);var i=new Int32Array(o.getRowCount());try{for(var a=io(this.getCodewords()),s=a.next();!s.done;s=a.next()){var f=s.value;if(f!=null){var c=f.getRowNumber();if(c>=i.length)continue;i[c]++}}}catch(u){e={error:u}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return i},t.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(e){for(var n=this.getBoundingBox(),o=this._isLeft?n.getTopLeft():n.getTopRight(),i=this._isLeft?n.getBottomLeft():n.getBottomRight(),a=this.imageRowToCodewordIndex(Math.trunc(o.getY())),s=this.imageRowToCodewordIndex(Math.trunc(i.getY())),f=this.getCodewords(),c=-1,u=1,l=0,h=a;h<s;h++)if(f[h]!=null){var d=f[h];d.setRowNumberAsRowIndicatorColumn();var p=d.getRowNumber()-c;p===0?l++:p===1?(u=Math.max(u,l),l=1,c=d.getRowNumber()):d.getRowNumber()>=e.getRowCount()?f[h]=null:(c=d.getRowNumber(),l=1)}},t.prototype.getBarcodeMetadata=function(){var e,n,o=this.getCodewords(),i=new Me,a=new Me,s=new Me,f=new Me;try{for(var c=io(o),u=c.next();!u.done;u=c.next()){var l=u.value;if(l!=null){l.setRowNumberAsRowIndicatorColumn();var h=l.getValue()%30,d=l.getRowNumber();switch(this._isLeft||(d+=2),d%3){case 0:a.setValue(h*3+1);break;case 1:f.setValue(h/3),s.setValue(h%3);break;case 2:i.setValue(h+1);break}}}}catch(v){e={error:v}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}if(i.getValue().length===0||a.getValue().length===0||s.getValue().length===0||f.getValue().length===0||i.getValue()[0]<1||a.getValue()[0]+s.getValue()[0]<z.MIN_ROWS_IN_BARCODE||a.getValue()[0]+s.getValue()[0]>z.MAX_ROWS_IN_BARCODE)return null;var p=new Ca(i.getValue()[0],a.getValue()[0],s.getValue()[0],f.getValue()[0]);return this.removeIncorrectCodewords(o,p),p},t.prototype.removeIncorrectCodewords=function(e,n){for(var o=0;o<e.length;o++){var i=e[o];if(e[o]!=null){var a=i.getValue()%30,s=i.getRowNumber();if(s>n.getRowCount()){e[o]=null;continue}switch(this._isLeft||(s+=2),s%3){case 0:a*3+1!==n.getRowCountUpperPart()&&(e[o]=null);break;case 1:(Math.trunc(a/3)!==n.getErrorCorrectionLevel()||a%3!==n.getRowCountLowerPart())&&(e[o]=null);break;case 2:a+1!==n.getColumnCount()&&(e[o]=null);break}}}},t.prototype.isLeft=function(){return this._isLeft},t.prototype.toString=function(){return"IsLeft: "+this._isLeft+`
`+r.prototype.toString.call(this)},t}(sn),ao=p1;var v1=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},m1=function(){function r(t,e){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=t,this.barcodeColumnCount=t.getColumnCount(),this.boundingBox=e,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return r.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var t=z.MAX_CODEWORDS_IN_BARCODE,e;do e=t,t=this.adjustRowNumbersAndGetCount();while(t>0&&t<e);return this.detectionResultColumns},r.prototype.adjustIndicatorColumnRowNumbers=function(t){t?.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)},r.prototype.adjustRowNumbersAndGetCount=function(){var t=this.adjustRowNumbersByRow();if(t===0)return 0;for(var e=1;e<this.barcodeColumnCount+1;e++)for(var n=this.detectionResultColumns[e].getCodewords(),o=0;o<n.length;o++)n[o]!=null&&(n[o].hasValidRowNumber()||this.adjustRowNumbers(e,o,n));return t},r.prototype.adjustRowNumbersByRow=function(){this.adjustRowNumbersFromBothRI();var t=this.adjustRowNumbersFromLRI();return t+this.adjustRowNumbersFromRRI()},r.prototype.adjustRowNumbersFromBothRI=function(){if(!(this.detectionResultColumns[0]==null||this.detectionResultColumns[this.barcodeColumnCount+1]==null)){for(var t=this.detectionResultColumns[0].getCodewords(),e=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),n=0;n<t.length;n++)if(t[n]!=null&&e[n]!=null&&t[n].getRowNumber()===e[n].getRowNumber())for(var o=1;o<=this.barcodeColumnCount;o++){var i=this.detectionResultColumns[o].getCodewords()[n];i!=null&&(i.setRowNumber(t[n].getRowNumber()),i.hasValidRowNumber()||(this.detectionResultColumns[o].getCodewords()[n]=null))}}},r.prototype.adjustRowNumbersFromRRI=function(){if(this.detectionResultColumns[this.barcodeColumnCount+1]==null)return 0;for(var t=0,e=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),n=0;n<e.length;n++)if(e[n]!=null)for(var o=e[n].getRowNumber(),i=0,a=this.barcodeColumnCount+1;a>0&&i<this.ADJUST_ROW_NUMBER_SKIP;a--){var s=this.detectionResultColumns[a].getCodewords()[n];s!=null&&(i=r.adjustRowNumberIfValid(o,i,s),s.hasValidRowNumber()||t++)}return t},r.prototype.adjustRowNumbersFromLRI=function(){if(this.detectionResultColumns[0]==null)return 0;for(var t=0,e=this.detectionResultColumns[0].getCodewords(),n=0;n<e.length;n++)if(e[n]!=null)for(var o=e[n].getRowNumber(),i=0,a=1;a<this.barcodeColumnCount+1&&i<this.ADJUST_ROW_NUMBER_SKIP;a++){var s=this.detectionResultColumns[a].getCodewords()[n];s!=null&&(i=r.adjustRowNumberIfValid(o,i,s),s.hasValidRowNumber()||t++)}return t},r.adjustRowNumberIfValid=function(t,e,n){return n==null||n.hasValidRowNumber()||(n.isValidRowNumber(t)?(n.setRowNumber(t),e=0):++e),e},r.prototype.adjustRowNumbers=function(t,e,n){var o,i;if(this.detectionResultColumns[t-1]!=null){var a=n[e],s=this.detectionResultColumns[t-1].getCodewords(),f=s;this.detectionResultColumns[t+1]!=null&&(f=this.detectionResultColumns[t+1].getCodewords());var c=new Array(14);c[2]=s[e],c[3]=f[e],e>0&&(c[0]=n[e-1],c[4]=s[e-1],c[5]=f[e-1]),e>1&&(c[8]=n[e-2],c[10]=s[e-2],c[11]=f[e-2]),e<n.length-1&&(c[1]=n[e+1],c[6]=s[e+1],c[7]=f[e+1]),e<n.length-2&&(c[9]=n[e+2],c[12]=s[e+2],c[13]=f[e+2]);try{for(var u=v1(c),l=u.next();!l.done;l=u.next()){var h=l.value;if(r.adjustRowNumber(a,h))return}}catch(d){o={error:d}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}}},r.adjustRowNumber=function(t,e){return e==null?!1:e.hasValidRowNumber()&&e.getBucket()===t.getBucket()?(t.setRowNumber(e.getRowNumber()),!0):!1},r.prototype.getBarcodeColumnCount=function(){return this.barcodeColumnCount},r.prototype.getBarcodeRowCount=function(){return this.barcodeMetadata.getRowCount()},r.prototype.getBarcodeECLevel=function(){return this.barcodeMetadata.getErrorCorrectionLevel()},r.prototype.setBoundingBox=function(t){this.boundingBox=t},r.prototype.getBoundingBox=function(){return this.boundingBox},r.prototype.setDetectionResultColumn=function(t,e){this.detectionResultColumns[t]=e},r.prototype.getDetectionResultColumn=function(t){return this.detectionResultColumns[t]},r.prototype.toString=function(){var t=this.detectionResultColumns[0];t==null&&(t=this.detectionResultColumns[this.barcodeColumnCount+1]);for(var e=new $e,n=0;n<t.getCodewords().length;n++){e.format("CW %3d:",n);for(var o=0;o<this.barcodeColumnCount+2;o++){if(this.detectionResultColumns[o]==null){e.format("    |   ");continue}var i=this.detectionResultColumns[o].getCodewords()[n];if(i==null){e.format("    |   ");continue}e.format(" %3d|%3d",i.getRowNumber(),i.getValue())}e.format("%n")}return e.toString()},r}(),Ea=m1;var g1=function(){function r(t,e,n,o){this.rowNumber=r.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(t),this.endX=Math.trunc(e),this.bucket=Math.trunc(n),this.value=Math.trunc(o)}return r.prototype.hasValidRowNumber=function(){return this.isValidRowNumber(this.rowNumber)},r.prototype.isValidRowNumber=function(t){return t!==r.BARCODE_ROW_UNKNOWN&&this.bucket===t%3*3},r.prototype.setRowNumberAsRowIndicatorColumn=function(){this.rowNumber=Math.trunc(Math.trunc(this.value/30)*3+Math.trunc(this.bucket/3))},r.prototype.getWidth=function(){return this.endX-this.startX},r.prototype.getStartX=function(){return this.startX},r.prototype.getEndX=function(){return this.endX},r.prototype.getBucket=function(){return this.bucket},r.prototype.getValue=function(){return this.value},r.prototype.getRowNumber=function(){return this.rowNumber},r.prototype.setRowNumber=function(t){this.rowNumber=t},r.prototype.toString=function(){return this.rowNumber+"|"+this.value},r.BARCODE_ROW_UNKNOWN=-1,r}(),Aa=g1;var x1=function(){function r(){}return r.initialize=function(){for(var t=0;t<z.SYMBOL_TABLE.length;t++)for(var e=z.SYMBOL_TABLE[t],n=e&1,o=0;o<z.BARS_IN_MODULE;o++){for(var i=0;(e&1)===n;)i+=1,e>>=1;n=e&1,r.RATIOS_TABLE[t]||(r.RATIOS_TABLE[t]=new Array(z.BARS_IN_MODULE)),r.RATIOS_TABLE[t][z.BARS_IN_MODULE-o-1]=Math.fround(i/z.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},r.getDecodedValue=function(t){var e=r.getDecodedCodewordValue(r.sampleBitCounts(t));return e!==-1?e:r.getClosestDecodedValue(t)},r.sampleBitCounts=function(t){for(var e=G.sum(t),n=new Int32Array(z.BARS_IN_MODULE),o=0,i=0,a=0;a<z.MODULES_IN_CODEWORD;a++){var s=e/(2*z.MODULES_IN_CODEWORD)+a*e/z.MODULES_IN_CODEWORD;i+t[o]<=s&&(i+=t[o],o++),n[o]++}return n},r.getDecodedCodewordValue=function(t){var e=r.getBitValue(t);return z.getCodeword(e)===-1?-1:e},r.getBitValue=function(t){for(var e=0,n=0;n<t.length;n++)for(var o=0;o<t[n];o++)e=e<<1|(n%2===0?1:0);return Math.trunc(e)},r.getClosestDecodedValue=function(t){var e=G.sum(t),n=new Array(z.BARS_IN_MODULE);if(e>1)for(var o=0;o<n.length;o++)n[o]=Math.fround(t[o]/e);var i=dr.MAX_VALUE,a=-1;this.bSymbolTableReady||r.initialize();for(var s=0;s<r.RATIOS_TABLE.length;s++){for(var f=0,c=r.RATIOS_TABLE[s],u=0;u<z.BARS_IN_MODULE;u++){var l=Math.fround(c[u]-n[u]);if(f+=Math.fround(l*l),f>=i)break}f<i&&(i=f,a=z.SYMBOL_TABLE[s])}return a},r.bSymbolTableReady=!1,r.RATIOS_TABLE=new Array(z.SYMBOL_TABLE.length).map(function(t){return t=new Array(z.BARS_IN_MODULE)}),r}(),wa=x1;var y1=function(){function r(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}return r.prototype.getSegmentIndex=function(){return this.segmentIndex},r.prototype.setSegmentIndex=function(t){this.segmentIndex=t},r.prototype.getFileId=function(){return this.fileId},r.prototype.setFileId=function(t){this.fileId=t},r.prototype.getOptionalData=function(){return this.optionalData},r.prototype.setOptionalData=function(t){this.optionalData=t},r.prototype.isLastSegment=function(){return this.lastSegment},r.prototype.setLastSegment=function(t){this.lastSegment=t},r.prototype.getSegmentCount=function(){return this.segmentCount},r.prototype.setSegmentCount=function(t){this.segmentCount=t},r.prototype.getSender=function(){return this.sender||null},r.prototype.setSender=function(t){this.sender=t},r.prototype.getAddressee=function(){return this.addressee||null},r.prototype.setAddressee=function(t){this.addressee=t},r.prototype.getFileName=function(){return this.fileName},r.prototype.setFileName=function(t){this.fileName=t},r.prototype.getFileSize=function(){return this.fileSize},r.prototype.setFileSize=function(t){this.fileSize=t},r.prototype.getChecksum=function(){return this.checksum},r.prototype.setChecksum=function(t){this.checksum=t},r.prototype.getTimestamp=function(){return this.timestamp},r.prototype.setTimestamp=function(t){this.timestamp=t},r}(),so=y1;var C1=function(){function r(){}return r.parseLong=function(t,e){return e===void 0&&(e=void 0),parseInt(t,e)},r}(),fo=C1;var E1=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),A1=function(r){E1(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="NullPointerException",t}(J),_a=A1;var w1=function(){function r(){}return r.prototype.writeBytes=function(t){this.writeBytesOffset(t,0,t.length)},r.prototype.writeBytesOffset=function(t,e,n){if(t==null)throw new _a;if(e<0||e>t.length||n<0||e+n>t.length||e+n<0)throw new We;if(n===0)return;for(var o=0;o<n;o++)this.write(t[e+o])},r.prototype.flush=function(){},r.prototype.close=function(){},r}(),Sa=w1;var _1=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),S1=function(r){_1(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t}(J),Ia=S1;var I1=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),O1=function(r){I1(t,r);function t(e){e===void 0&&(e=32);var n=r.call(this)||this;if(n.count=0,e<0)throw new I("Negative initial size: "+e);return n.buf=new Uint8Array(e),n}return t.prototype.ensureCapacity=function(e){e-this.buf.length>0&&this.grow(e)},t.prototype.grow=function(e){var n=this.buf.length,o=n<<1;if(o-e<0&&(o=e),o<0){if(e<0)throw new Ia;o=M.MAX_VALUE}this.buf=Z.copyOfUint8Array(this.buf,o)},t.prototype.write=function(e){this.ensureCapacity(this.count+1),this.buf[this.count]=e,this.count+=1},t.prototype.writeBytesOffset=function(e,n,o){if(n<0||n>e.length||o<0||n+o-e.length>0)throw new We;this.ensureCapacity(this.count+o),H.arraycopy(e,n,this.buf,this.count,o),this.count+=o},t.prototype.writeTo=function(e){e.writeBytesOffset(this.buf,0,this.count)},t.prototype.reset=function(){this.count=0},t.prototype.toByteArray=function(){return Z.copyOfUint8Array(this.buf,this.count)},t.prototype.size=function(){return this.count},t.prototype.toString=function(e){return e?typeof e=="string"?this.toString_string(e):this.toString_number(e):this.toString_void()},t.prototype.toString_void=function(){return new String(this.buf).toString()},t.prototype.toString_string=function(e){return new String(this.buf).toString()},t.prototype.toString_number=function(e){return new String(this.buf).toString()},t.prototype.close=function(){},t}(Sa),Oa=O1;var rt;(function(r){r[r.ALPHA=0]="ALPHA",r[r.LOWER=1]="LOWER",r[r.MIXED=2]="MIXED",r[r.PUNCT=3]="PUNCT",r[r.ALPHA_SHIFT=4]="ALPHA_SHIFT",r[r.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(rt||(rt={}));function Ta(){if(typeof window<"u")return window.BigInt||null;if(typeof global<"u")return global.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}var fn;function _e(r){if(typeof fn>"u"&&(fn=Ta()),fn===null)throw new Error("BigInt is not supported!");return fn(r)}function T1(){var r=[];r[0]=_e(1);var t=_e(900);r[1]=t;for(var e=2;e<16;e++)r[e]=r[e-1]*t;return r}var R1=function(){function r(){}return r.decode=function(t,e){var n=new P(""),o=it.ISO8859_1;n.enableDecoding(o);for(var i=1,a=t[i++],s=new so;i<t[0];){switch(a){case r.TEXT_COMPACTION_MODE_LATCH:i=r.textCompaction(t,i,n);break;case r.BYTE_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH_6:i=r.byteCompaction(a,t,o,i,n);break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:n.append(t[i++]);break;case r.NUMERIC_COMPACTION_MODE_LATCH:i=r.numericCompaction(t,i,n);break;case r.ECI_CHARSET:var f=it.getCharacterSetECIByValue(t[i++]);break;case r.ECI_GENERAL_PURPOSE:i+=2;break;case r.ECI_USER_DEFINED:i++;break;case r.BEGIN_MACRO_PDF417_CONTROL_BLOCK:i=r.decodeMacroBlock(t,i,s);break;case r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case r.MACRO_PDF417_TERMINATOR:throw new S;default:i--,i=r.textCompaction(t,i,n);break}if(i<t.length)a=t[i++];else throw S.getFormatInstance()}if(n.length()===0)throw S.getFormatInstance();var c=new oe(null,n.toString(),null,e);return c.setOther(s),c},r.decodeMacroBlock=function(t,e,n){if(e+r.NUMBER_OF_SEQUENCE_CODEWORDS>t[0])throw S.getFormatInstance();for(var o=new Int32Array(r.NUMBER_OF_SEQUENCE_CODEWORDS),i=0;i<r.NUMBER_OF_SEQUENCE_CODEWORDS;i++,e++)o[i]=t[e];n.setSegmentIndex(M.parseInt(r.decodeBase900toBase10(o,r.NUMBER_OF_SEQUENCE_CODEWORDS)));var a=new P;e=r.textCompaction(t,e,a),n.setFileId(a.toString());var s=-1;for(t[e]===r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(s=e+1);e<t[0];)switch(t[e]){case r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(e++,t[e]){case r.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:var f=new P;e=r.textCompaction(t,e+1,f),n.setFileName(f.toString());break;case r.MACRO_PDF417_OPTIONAL_FIELD_SENDER:var c=new P;e=r.textCompaction(t,e+1,c),n.setSender(c.toString());break;case r.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:var u=new P;e=r.textCompaction(t,e+1,u),n.setAddressee(u.toString());break;case r.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:var l=new P;e=r.numericCompaction(t,e+1,l),n.setSegmentCount(M.parseInt(l.toString()));break;case r.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:var h=new P;e=r.numericCompaction(t,e+1,h),n.setTimestamp(fo.parseLong(h.toString()));break;case r.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:var d=new P;e=r.numericCompaction(t,e+1,d),n.setChecksum(M.parseInt(d.toString()));break;case r.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:var p=new P;e=r.numericCompaction(t,e+1,p),n.setFileSize(fo.parseLong(p.toString()));break;default:throw S.getFormatInstance()}break;case r.MACRO_PDF417_TERMINATOR:e++,n.setLastSegment(!0);break;default:throw S.getFormatInstance()}if(s!==-1){var v=e-s;n.isLastSegment()&&v--,n.setOptionalData(Z.copyOfRange(t,s,s+v))}return e},r.textCompaction=function(t,e,n){for(var o=new Int32Array((t[0]-e)*2),i=new Int32Array((t[0]-e)*2),a=0,s=!1;e<t[0]&&!s;){var f=t[e++];if(f<r.TEXT_COMPACTION_MODE_LATCH)o[a]=f/30,o[a+1]=f%30,a+=2;else switch(f){case r.TEXT_COMPACTION_MODE_LATCH:o[a++]=r.TEXT_COMPACTION_MODE_LATCH;break;case r.BYTE_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH_6:case r.NUMERIC_COMPACTION_MODE_LATCH:case r.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case r.MACRO_PDF417_TERMINATOR:e--,s=!0;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o[a]=r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,f=t[e++],i[a]=f,a++;break}}return r.decodeTextCompaction(o,i,a,n),e},r.decodeTextCompaction=function(t,e,n,o){for(var i=rt.ALPHA,a=rt.ALPHA,s=0;s<n;){var f=t[s],c="";switch(i){case rt.ALPHA:if(f<26)c=String.fromCharCode(65+f);else switch(f){case 26:c=" ";break;case r.LL:i=rt.LOWER;break;case r.ML:i=rt.MIXED;break;case r.PS:a=i,i=rt.PUNCT_SHIFT;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(e[s]);break;case r.TEXT_COMPACTION_MODE_LATCH:i=rt.ALPHA;break}break;case rt.LOWER:if(f<26)c=String.fromCharCode(97+f);else switch(f){case 26:c=" ";break;case r.AS:a=i,i=rt.ALPHA_SHIFT;break;case r.ML:i=rt.MIXED;break;case r.PS:a=i,i=rt.PUNCT_SHIFT;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(e[s]);break;case r.TEXT_COMPACTION_MODE_LATCH:i=rt.ALPHA;break}break;case rt.MIXED:if(f<r.PL)c=r.MIXED_CHARS[f];else switch(f){case r.PL:i=rt.PUNCT;break;case 26:c=" ";break;case r.LL:i=rt.LOWER;break;case r.AL:i=rt.ALPHA;break;case r.PS:a=i,i=rt.PUNCT_SHIFT;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(e[s]);break;case r.TEXT_COMPACTION_MODE_LATCH:i=rt.ALPHA;break}break;case rt.PUNCT:if(f<r.PAL)c=r.PUNCT_CHARS[f];else switch(f){case r.PAL:i=rt.ALPHA;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(e[s]);break;case r.TEXT_COMPACTION_MODE_LATCH:i=rt.ALPHA;break}break;case rt.ALPHA_SHIFT:if(i=a,f<26)c=String.fromCharCode(65+f);else switch(f){case 26:c=" ";break;case r.TEXT_COMPACTION_MODE_LATCH:i=rt.ALPHA;break}break;case rt.PUNCT_SHIFT:if(i=a,f<r.PAL)c=r.PUNCT_CHARS[f];else switch(f){case r.PAL:i=rt.ALPHA;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(e[s]);break;case r.TEXT_COMPACTION_MODE_LATCH:i=rt.ALPHA;break}break}c!==""&&o.append(c),s++}},r.byteCompaction=function(t,e,n,o,i){var a=new Oa,s=0,f=0,c=!1;switch(t){case r.BYTE_COMPACTION_MODE_LATCH:for(var u=new Int32Array(6),l=e[o++];o<e[0]&&!c;)switch(u[s++]=l,f=900*f+l,l=e[o++],l){case r.TEXT_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH:case r.NUMERIC_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH_6:case r.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case r.MACRO_PDF417_TERMINATOR:o--,c=!0;break;default:if(s%5===0&&s>0){for(var h=0;h<6;++h)a.write(Number(_e(f)>>_e(8*(5-h))));f=0,s=0}break}o===e[0]&&l<r.TEXT_COMPACTION_MODE_LATCH&&(u[s++]=l);for(var d=0;d<s;d++)a.write(u[d]);break;case r.BYTE_COMPACTION_MODE_LATCH_6:for(;o<e[0]&&!c;){var p=e[o++];if(p<r.TEXT_COMPACTION_MODE_LATCH)s++,f=900*f+p;else switch(p){case r.TEXT_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH:case r.NUMERIC_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH_6:case r.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case r.MACRO_PDF417_TERMINATOR:o--,c=!0;break}if(s%5===0&&s>0){for(var h=0;h<6;++h)a.write(Number(_e(f)>>_e(8*(5-h))));f=0,s=0}}break}return i.append(Ct.decode(a.toByteArray(),n)),o},r.numericCompaction=function(t,e,n){for(var o=0,i=!1,a=new Int32Array(r.MAX_NUMERIC_CODEWORDS);e<t[0]&&!i;){var s=t[e++];if(e===t[0]&&(i=!0),s<r.TEXT_COMPACTION_MODE_LATCH)a[o]=s,o++;else switch(s){case r.TEXT_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH_6:case r.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case r.MACRO_PDF417_TERMINATOR:e--,i=!0;break}(o%r.MAX_NUMERIC_CODEWORDS===0||s===r.NUMERIC_COMPACTION_MODE_LATCH||i)&&o>0&&(n.append(r.decodeBase900toBase10(a,o)),o=0)}return e},r.decodeBase900toBase10=function(t,e){for(var n=_e(0),o=0;o<e;o++)n+=r.EXP900[e-o-1]*_e(t[o]);var i=n.toString();if(i.charAt(0)!=="1")throw new S;return i.substring(1)},r.TEXT_COMPACTION_MODE_LATCH=900,r.BYTE_COMPACTION_MODE_LATCH=901,r.NUMERIC_COMPACTION_MODE_LATCH=902,r.BYTE_COMPACTION_MODE_LATCH_6=924,r.ECI_USER_DEFINED=925,r.ECI_GENERAL_PURPOSE=926,r.ECI_CHARSET=927,r.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,r.MACRO_PDF417_TERMINATOR=922,r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,r.MAX_NUMERIC_CODEWORDS=15,r.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,r.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,r.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,r.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,r.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,r.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,r.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,r.PL=25,r.LL=27,r.AS=27,r.ML=28,r.AL=28,r.PS=29,r.PAL=29,r.PUNCT_CHARS=`;<>@[\\]_\`~!\r	,:
-.$/"|*()?{}'`,r.MIXED_CHARS="0123456789&\r	,:#-.$/+%*=^",r.EXP900=Ta()?T1():[],r.NUMBER_OF_SEQUENCE_CODEWORDS=2,r}(),co=R1;var Cr=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},D1=function(){function r(){}return r.decode=function(t,e,n,o,i,a,s){for(var f=new yr(t,e,n,o,i),c=null,u=null,l,h=!0;;h=!1){if(e!=null&&(c=r.getRowIndicatorColumn(t,f,e,!0,a,s)),o!=null&&(u=r.getRowIndicatorColumn(t,f,o,!1,a,s)),l=r.merge(c,u),l==null)throw E.getNotFoundInstance();var d=l.getBoundingBox();if(h&&d!=null&&(d.getMinY()<f.getMinY()||d.getMaxY()>f.getMaxY()))f=d;else break}l.setBoundingBox(f);var p=l.getBarcodeColumnCount()+1;l.setDetectionResultColumn(0,c),l.setDetectionResultColumn(p,u);for(var v=c!=null,g=1;g<=p;g++){var y=v?g:p-g;if(l.getDetectionResultColumn(y)===void 0){var x=void 0;y===0||y===p?x=new ao(f,y===0):x=new sn(f),l.setDetectionResultColumn(y,x);for(var C=-1,w=C,_=f.getMinY();_<=f.getMaxY();_++){if(C=r.getStartColumn(l,y,_,v),C<0||C>f.getMaxX()){if(w===-1)continue;C=w}var O=r.detectCodeword(t,f.getMinX(),f.getMaxX(),v,C,_,a,s);O!=null&&(x.setCodeword(_,O),w=C,a=Math.min(a,O.getWidth()),s=Math.max(s,O.getWidth()))}}}return r.createDecoderResult(l)},r.merge=function(t,e){if(t==null&&e==null)return null;var n=r.getBarcodeMetadata(t,e);if(n==null)return null;var o=yr.merge(r.adjustBoundingBox(t),r.adjustBoundingBox(e));return new Ea(n,o)},r.adjustBoundingBox=function(t){var e,n;if(t==null)return null;var o=t.getRowHeights();if(o==null)return null;var i=r.getMax(o),a=0;try{for(var s=Cr(o),f=s.next();!f.done;f=s.next()){var c=f.value;if(a+=i-c,c>0)break}}catch(d){e={error:d}}finally{try{f&&!f.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}for(var u=t.getCodewords(),l=0;a>0&&u[l]==null;l++)a--;for(var h=0,l=o.length-1;l>=0&&(h+=i-o[l],!(o[l]>0));l--);for(var l=u.length-1;h>0&&u[l]==null;l--)h--;return t.getBoundingBox().addMissingRows(a,h,t.isLeft())},r.getMax=function(t){var e,n,o=-1;try{for(var i=Cr(t),a=i.next();!a.done;a=i.next()){var s=a.value;o=Math.max(o,s)}}catch(f){e={error:f}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return o},r.getBarcodeMetadata=function(t,e){var n;if(t==null||(n=t.getBarcodeMetadata())==null)return e==null?null:e.getBarcodeMetadata();var o;return e==null||(o=e.getBarcodeMetadata())==null?n:n.getColumnCount()!==o.getColumnCount()&&n.getErrorCorrectionLevel()!==o.getErrorCorrectionLevel()&&n.getRowCount()!==o.getRowCount()?null:n},r.getRowIndicatorColumn=function(t,e,n,o,i,a){for(var s=new ao(e,o),f=0;f<2;f++)for(var c=f===0?1:-1,u=Math.trunc(Math.trunc(n.getX())),l=Math.trunc(Math.trunc(n.getY()));l<=e.getMaxY()&&l>=e.getMinY();l+=c){var h=r.detectCodeword(t,0,t.getWidth(),o,u,l,i,a);h!=null&&(s.setCodeword(l,h),o?u=h.getStartX():u=h.getEndX())}return s},r.adjustCodewordCount=function(t,e){var n=e[0][1],o=n.getValue(),i=t.getBarcodeColumnCount()*t.getBarcodeRowCount()-r.getNumberOfECCodeWords(t.getBarcodeECLevel());if(o.length===0){if(i<1||i>z.MAX_CODEWORDS_IN_BARCODE)throw E.getNotFoundInstance();n.setValue(i)}else o[0]!==i&&n.setValue(i)},r.createDecoderResult=function(t){var e=r.createBarcodeMatrix(t);r.adjustCodewordCount(t,e);for(var n=new Array,o=new Int32Array(t.getBarcodeRowCount()*t.getBarcodeColumnCount()),i=[],a=new Array,s=0;s<t.getBarcodeRowCount();s++)for(var f=0;f<t.getBarcodeColumnCount();f++){var c=e[s][f+1].getValue(),u=s*t.getBarcodeColumnCount()+f;c.length===0?n.push(u):c.length===1?o[u]=c[0]:(a.push(u),i.push(c))}for(var l=new Array(i.length),h=0;h<l.length;h++)l[h]=i[h];return r.createDecoderResultFromAmbiguousValues(t.getBarcodeECLevel(),o,z.toIntArray(n),z.toIntArray(a),l)},r.createDecoderResultFromAmbiguousValues=function(t,e,n,o,i){for(var a=new Int32Array(o.length),s=100;s-- >0;){for(var f=0;f<a.length;f++)e[o[f]]=i[f][a[f]];try{return r.decodeCodewords(e,t,n)}catch(u){var c=u instanceof X;if(!c)throw u}if(a.length===0)throw X.getChecksumInstance();for(var f=0;f<a.length;f++)if(a[f]<i[f].length-1){a[f]++;break}else if(a[f]=0,f===a.length-1)throw X.getChecksumInstance()}throw X.getChecksumInstance()},r.createBarcodeMatrix=function(t){for(var e,n,o,i,a=Array.from({length:t.getBarcodeRowCount()},function(){return new Array(t.getBarcodeColumnCount()+2)}),s=0;s<a.length;s++)for(var f=0;f<a[s].length;f++)a[s][f]=new Me;var c=0;try{for(var u=Cr(t.getDetectionResultColumns()),l=u.next();!l.done;l=u.next()){var h=l.value;if(h!=null)try{for(var d=(o=void 0,Cr(h.getCodewords())),p=d.next();!p.done;p=d.next()){var v=p.value;if(v!=null){var g=v.getRowNumber();if(g>=0){if(g>=a.length)continue;a[g][c].setValue(v.getValue())}}}}catch(y){o={error:y}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}c++}}catch(y){e={error:y}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}return a},r.isValidBarcodeColumn=function(t,e){return e>=0&&e<=t.getBarcodeColumnCount()+1},r.getStartColumn=function(t,e,n,o){var i,a,s=o?1:-1,f=null;if(r.isValidBarcodeColumn(t,e-s)&&(f=t.getDetectionResultColumn(e-s).getCodeword(n)),f!=null)return o?f.getEndX():f.getStartX();if(f=t.getDetectionResultColumn(e).getCodewordNearby(n),f!=null)return o?f.getStartX():f.getEndX();if(r.isValidBarcodeColumn(t,e-s)&&(f=t.getDetectionResultColumn(e-s).getCodewordNearby(n)),f!=null)return o?f.getEndX():f.getStartX();for(var c=0;r.isValidBarcodeColumn(t,e-s);){e-=s;try{for(var u=(i=void 0,Cr(t.getDetectionResultColumn(e).getCodewords())),l=u.next();!l.done;l=u.next()){var h=l.value;if(h!=null)return(o?h.getEndX():h.getStartX())+s*c*(h.getEndX()-h.getStartX())}}catch(d){i={error:d}}finally{try{l&&!l.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}c++}return o?t.getBoundingBox().getMinX():t.getBoundingBox().getMaxX()},r.detectCodeword=function(t,e,n,o,i,a,s,f){i=r.adjustCodewordStartColumn(t,e,n,o,i,a);var c=r.getModuleBitCount(t,e,n,o,i,a);if(c==null)return null;var u,l=G.sum(c);if(o)u=i+l;else{for(var h=0;h<c.length/2;h++){var d=c[h];c[h]=c[c.length-1-h],c[c.length-1-h]=d}u=i,i=u-l}if(!r.checkCodewordSkew(l,s,f))return null;var p=wa.getDecodedValue(c),v=z.getCodeword(p);return v===-1?null:new Aa(i,u,r.getCodewordBucketNumber(p),v)},r.getModuleBitCount=function(t,e,n,o,i,a){for(var s=i,f=new Int32Array(8),c=0,u=o?1:-1,l=o;(o?s<n:s>=e)&&c<f.length;)t.get(s,a)===l?(f[c]++,s+=u):(c++,l=!l);return c===f.length||s===(o?n:e)&&c===f.length-1?f:null},r.getNumberOfECCodeWords=function(t){return 2<<t},r.adjustCodewordStartColumn=function(t,e,n,o,i,a){for(var s=i,f=o?-1:1,c=0;c<2;c++){for(;(o?s>=e:s<n)&&o===t.get(s,a);){if(Math.abs(i-s)>r.CODEWORD_SKEW_SIZE)return i;s+=f}f=-f,o=!o}return s},r.checkCodewordSkew=function(t,e,n){return e-r.CODEWORD_SKEW_SIZE<=t&&t<=n+r.CODEWORD_SKEW_SIZE},r.decodeCodewords=function(t,e,n){if(t.length===0)throw S.getFormatInstance();var o=1<<e+1,i=r.correctErrors(t,n,o);r.verifyCodewordCount(t,o);var a=co.decode(t,""+e);return a.setErrorsCorrected(i),a.setErasures(n.length),a},r.correctErrors=function(t,e,n){if(e!=null&&e.length>n/2+r.MAX_ERRORS||n<0||n>r.MAX_EC_CODEWORDS)throw X.getChecksumInstance();return r.errorCorrection.decode(t,n,e)},r.verifyCodewordCount=function(t,e){if(t.length<4)throw S.getFormatInstance();var n=t[0];if(n>t.length)throw S.getFormatInstance();if(n===0)if(e<t.length)t[0]=t.length-e;else throw S.getFormatInstance()},r.getBitCountForCodeword=function(t){for(var e=new Int32Array(8),n=0,o=e.length-1;!((t&1)!==n&&(n=t&1,o--,o<0));)e[o]++,t>>=1;return e},r.getCodewordBucketNumber=function(t){return t instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(t):this.getCodewordBucketNumber_number(t)},r.getCodewordBucketNumber_number=function(t){return r.getCodewordBucketNumber(r.getBitCountForCodeword(t))},r.getCodewordBucketNumber_Int32Array=function(t){return(t[0]-t[2]+t[4]-t[6]+9)%9},r.toString=function(t){for(var e=new $e,n=0;n<t.length;n++){e.format("Row %2d: ",n);for(var o=0;o<t[n].length;o++){var i=t[n][o];i.getValue().length===0?e.format("        ",null):e.format("%4d(%2d)",i.getValue()[0],i.getConfidence(i.getValue()[0]))}e.format("%n")}return e.toString()},r.CODEWORD_SKEW_SIZE=2,r.MAX_ERRORS=3,r.MAX_EC_CODEWORDS=512,r.errorCorrection=new oo,r}(),Ra=D1;var b1=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},N1=function(){function r(){}return r.prototype.decode=function(t,e){e===void 0&&(e=null);var n=r.decode(t,e,!1);if(n==null||n.length===0||n[0]==null)throw E.getNotFoundInstance();return n[0]},r.prototype.decodeMultiple=function(t,e){e===void 0&&(e=null);try{return r.decode(t,e,!0)}catch(n){throw n instanceof S||n instanceof X?E.getNotFoundInstance():n}},r.decode=function(t,e,n){var o,i,a=new Array,s=ga.detectMultiple(t,e,n);try{for(var f=b1(s.getPoints()),c=f.next();!c.done;c=f.next()){var u=c.value,l=Ra.decode(s.getBits(),u[4],u[5],u[6],u[7],r.getMinCodewordWidth(u),r.getMaxCodewordWidth(u)),h=new Y(l.getText(),l.getRawBytes(),void 0,u,T.PDF_417);h.putMetadata(st.ERROR_CORRECTION_LEVEL,l.getECLevel());var d=l.getOther();d!=null&&h.putMetadata(st.PDF417_EXTRA_METADATA,d),a.push(h)}}catch(p){o={error:p}}finally{try{c&&!c.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}return a.map(function(p){return p})},r.getMaxWidth=function(t,e){return t==null||e==null?0:Math.trunc(Math.abs(t.getX()-e.getX()))},r.getMinWidth=function(t,e){return t==null||e==null?M.MAX_VALUE:Math.trunc(Math.abs(t.getX()-e.getX()))},r.getMaxCodewordWidth=function(t){return Math.floor(Math.max(Math.max(r.getMaxWidth(t[0],t[4]),r.getMaxWidth(t[6],t[2])*z.MODULES_IN_CODEWORD/z.MODULES_IN_STOP_PATTERN),Math.max(r.getMaxWidth(t[1],t[5]),r.getMaxWidth(t[7],t[3])*z.MODULES_IN_CODEWORD/z.MODULES_IN_STOP_PATTERN)))},r.getMinCodewordWidth=function(t){return Math.floor(Math.min(Math.min(r.getMinWidth(t[0],t[4]),r.getMinWidth(t[6],t[2])*z.MODULES_IN_CODEWORD/z.MODULES_IN_STOP_PATTERN),Math.min(r.getMinWidth(t[1],t[5]),r.getMinWidth(t[7],t[3])*z.MODULES_IN_CODEWORD/z.MODULES_IN_STOP_PATTERN)))},r.prototype.reset=function(){},r}(),Se=N1;var P1=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),M1=function(r){P1(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="ReaderException",t}(J),cn=M1;var Da=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},B1=function(){function r(){}return r.prototype.decode=function(t,e){return this.setHints(e),this.decodeInternal(t)},r.prototype.decodeWithState=function(t){return(this.readers===null||this.readers===void 0)&&this.setHints(null),this.decodeInternal(t)},r.prototype.setHints=function(t){this.hints=t;var e=t!=null&&t.get(L.TRY_HARDER)!==void 0,n=t==null?null:t.get(L.POSSIBLE_FORMATS),o=new Array;if(n!=null){var i=n.some(function(a){return a===T.UPC_A||a===T.UPC_E||a===T.EAN_13||a===T.EAN_8||a===T.CODABAR||a===T.CODE_39||a===T.CODE_93||a===T.CODE_128||a===T.ITF||a===T.RSS_14||a===T.RSS_EXPANDED});i&&!e&&o.push(new te(t)),n.includes(T.QR_CODE)&&o.push(new we),n.includes(T.DATA_MATRIX)&&o.push(new Ae),n.includes(T.AZTEC)&&o.push(new ge),n.includes(T.PDF_417)&&o.push(new Se),i&&e&&o.push(new te(t))}o.length===0&&(e||o.push(new te(t)),o.push(new we),o.push(new Ae),o.push(new ge),o.push(new Se),e&&o.push(new te(t))),this.readers=o},r.prototype.reset=function(){var t,e;if(this.readers!==null)try{for(var n=Da(this.readers),o=n.next();!o.done;o=n.next()){var i=o.value;i.reset()}}catch(a){t={error:a}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},r.prototype.decodeInternal=function(t){var e,n;if(this.readers===null)throw new cn("No readers where selected, nothing can be read.");try{for(var o=Da(this.readers),i=o.next();!i.done;i=o.next()){var a=i.value;try{return a.decode(t,this.hints)}catch(s){if(s instanceof cn)continue}}}catch(s){e={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}throw new E("No MultiFormat Readers were able to detect the code.")},r}(),Er=B1;var F1=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),fE=function(r){F1(t,r);function t(e,n){e===void 0&&(e=null),n===void 0&&(n=500);var o=this,i=new Er;return i.setHints(e),o=r.call(this,i,n)||this,o}return t.prototype.decodeBitmap=function(e){return this.reader.decodeWithState(e)},t}(Gt);var L1=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),hE=function(r){L1(t,r);function t(e){return e===void 0&&(e=500),r.call(this,new Se,e)||this}return t}(Gt);var k1=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),mE=function(r){k1(t,r);function t(e){return e===void 0&&(e=500),r.call(this,new we,e)||this}return t}(Gt);var uo;(function(r){r[r.ERROR_CORRECTION=0]="ERROR_CORRECTION",r[r.CHARACTER_SET=1]="CHARACTER_SET",r[r.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",r[r.DATA_MATRIX_COMPACT=3]="DATA_MATRIX_COMPACT",r[r.MIN_SIZE=4]="MIN_SIZE",r[r.MAX_SIZE=5]="MAX_SIZE",r[r.MARGIN=6]="MARGIN",r[r.PDF417_COMPACT=7]="PDF417_COMPACT",r[r.PDF417_COMPACTION=8]="PDF417_COMPACTION",r[r.PDF417_DIMENSIONS=9]="PDF417_DIMENSIONS",r[r.AZTEC_LAYERS=10]="AZTEC_LAYERS",r[r.QR_VERSION=11]="QR_VERSION",r[r.GS1_FORMAT=12]="GS1_FORMAT",r[r.FORCE_C40=13]="FORCE_C40"})(uo||(uo={}));var V=uo;var U1=function(){function r(t){this.field=t,this.cachedGenerators=[],this.cachedGenerators.push(new zt(t,Int32Array.from([1])))}return r.prototype.buildGenerator=function(t){var e=this.cachedGenerators;if(t>=e.length)for(var n=e[e.length-1],o=this.field,i=e.length;i<=t;i++){var a=n.multiply(new zt(o,Int32Array.from([1,o.exp(i-1+o.getGeneratorBase())])));e.push(a),n=a}return e[t]},r.prototype.encode=function(t,e){if(e===0)throw new I("No error correction bytes");var n=t.length-e;if(n<=0)throw new I("No data bytes provided");var o=this.buildGenerator(e),i=new Int32Array(n);H.arraycopy(t,0,i,0,n);var a=new zt(this.field,i);a=a.multiplyByMonomial(e,1);for(var s=a.divide(o)[1],f=s.getCoefficients(),c=e-f.length,u=0;u<c;u++)t[n+u]=0;H.arraycopy(f,0,t,n+c,f.length)},r}(),Ar=U1;var V1=function(){function r(){}return r.applyMaskPenaltyRule1=function(t){return r.applyMaskPenaltyRule1Internal(t,!0)+r.applyMaskPenaltyRule1Internal(t,!1)},r.applyMaskPenaltyRule2=function(t){for(var e=0,n=t.getArray(),o=t.getWidth(),i=t.getHeight(),a=0;a<i-1;a++)for(var s=n[a],f=0;f<o-1;f++){var c=s[f];c===s[f+1]&&c===n[a+1][f]&&c===n[a+1][f+1]&&e++}return r.N2*e},r.applyMaskPenaltyRule3=function(t){for(var e=0,n=t.getArray(),o=t.getWidth(),i=t.getHeight(),a=0;a<i;a++)for(var s=0;s<o;s++){var f=n[a];s+6<o&&f[s]===1&&f[s+1]===0&&f[s+2]===1&&f[s+3]===1&&f[s+4]===1&&f[s+5]===0&&f[s+6]===1&&(r.isWhiteHorizontal(f,s-4,s)||r.isWhiteHorizontal(f,s+7,s+11))&&e++,a+6<i&&n[a][s]===1&&n[a+1][s]===0&&n[a+2][s]===1&&n[a+3][s]===1&&n[a+4][s]===1&&n[a+5][s]===0&&n[a+6][s]===1&&(r.isWhiteVertical(n,s,a-4,a)||r.isWhiteVertical(n,s,a+7,a+11))&&e++}return e*r.N3},r.isWhiteHorizontal=function(t,e,n){e=Math.max(e,0),n=Math.min(n,t.length);for(var o=e;o<n;o++)if(t[o]===1)return!1;return!0},r.isWhiteVertical=function(t,e,n,o){n=Math.max(n,0),o=Math.min(o,t.length);for(var i=n;i<o;i++)if(t[i][e]===1)return!1;return!0},r.applyMaskPenaltyRule4=function(t){for(var e=0,n=t.getArray(),o=t.getWidth(),i=t.getHeight(),a=0;a<i;a++)for(var s=n[a],f=0;f<o;f++)s[f]===1&&e++;var c=t.getHeight()*t.getWidth(),u=Math.floor(Math.abs(e*2-c)*10/c);return u*r.N4},r.getDataMaskBit=function(t,e,n){var o,i;switch(t){case 0:o=n+e&1;break;case 1:o=n&1;break;case 2:o=e%3;break;case 3:o=(n+e)%3;break;case 4:o=Math.floor(n/2)+Math.floor(e/3)&1;break;case 5:i=n*e,o=(i&1)+i%3;break;case 6:i=n*e,o=(i&1)+i%3&1;break;case 7:i=n*e,o=i%3+(n+e&1)&1;break;default:throw new I("Invalid mask pattern: "+t)}return o===0},r.applyMaskPenaltyRule1Internal=function(t,e){for(var n=0,o=e?t.getHeight():t.getWidth(),i=e?t.getWidth():t.getHeight(),a=t.getArray(),s=0;s<o;s++){for(var f=0,c=-1,u=0;u<i;u++){var l=e?a[s][u]:a[u][s];l===c?f++:(f>=5&&(n+=r.N1+(f-5)),f=1,c=l)}f>=5&&(n+=r.N1+(f-5))}return n},r.N1=3,r.N2=3,r.N3=40,r.N4=10,r}(),Ie=V1;var H1=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},G1=function(){function r(t,e){this.width=t,this.height=e;for(var n=new Array(e),o=0;o!==e;o++)n[o]=new Uint8Array(t);this.bytes=n}return r.prototype.getHeight=function(){return this.height},r.prototype.getWidth=function(){return this.width},r.prototype.get=function(t,e){return this.bytes[e][t]},r.prototype.getArray=function(){return this.bytes},r.prototype.setNumber=function(t,e,n){this.bytes[e][t]=n},r.prototype.setBoolean=function(t,e,n){this.bytes[e][t]=n?1:0},r.prototype.clear=function(t){var e,n;try{for(var o=H1(this.bytes),i=o.next();!i.done;i=o.next()){var a=i.value;Z.fill(a,t)}}catch(s){e={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;if(this.width!==e.width||this.height!==e.height)return!1;for(var n=0,o=this.height;n<o;++n)for(var i=this.bytes[n],a=e.bytes[n],s=0,f=this.width;s<f;++s)if(i[s]!==a[s])return!1;return!0},r.prototype.toString=function(){for(var t=new P,e=0,n=this.height;e<n;++e){for(var o=this.bytes[e],i=0,a=this.width;i<a;++i)switch(o[i]){case 0:t.append(" 0");break;case 1:t.append(" 1");break;default:t.append("  ");break}t.append(`
`)}return t.toString()},r}(),wr=G1;var z1=function(){function r(){this.maskPattern=-1}return r.prototype.getMode=function(){return this.mode},r.prototype.getECLevel=function(){return this.ecLevel},r.prototype.getVersion=function(){return this.version},r.prototype.getMaskPattern=function(){return this.maskPattern},r.prototype.getMatrix=function(){return this.matrix},r.prototype.toString=function(){var t=new P;return t.append(`<<
`),t.append(" mode: "),t.append(this.mode?this.mode.toString():"null"),t.append(`
 ecLevel: `),t.append(this.ecLevel?this.ecLevel.toString():"null"),t.append(`
 version: `),t.append(this.version?this.version.toString():"null"),t.append(`
 maskPattern: `),t.append(this.maskPattern.toString()),this.matrix?(t.append(`
 matrix:
`),t.append(this.matrix.toString())):t.append(`
 matrix: null
`),t.append(`>>
`),t.toString()},r.prototype.setMode=function(t){this.mode=t},r.prototype.setECLevel=function(t){this.ecLevel=t},r.prototype.setVersion=function(t){this.version=t},r.prototype.setMaskPattern=function(t){this.maskPattern=t},r.prototype.setMatrix=function(t){this.matrix=t},r.isValidMaskPattern=function(t){return t>=0&&t<r.NUM_MASK_PATTERNS},r.NUM_MASK_PATTERNS=8,r}(),Je=z1;var W1=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),X1=function(r){W1(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="WriterException",t}(J),nt=X1;var j1=function(){function r(){}return r.clearMatrix=function(t){t.clear(255)},r.buildMatrix=function(t,e,n,o,i){r.clearMatrix(i),r.embedBasicPatterns(n,i),r.embedTypeInfo(e,o,i),r.maybeEmbedVersionInfo(n,i),r.embedDataBits(t,o,i)},r.embedBasicPatterns=function(t,e){r.embedPositionDetectionPatternsAndSeparators(e),r.embedDarkDotAtLeftBottomCorner(e),r.maybeEmbedPositionAdjustmentPatterns(t,e),r.embedTimingPatterns(e)},r.embedTypeInfo=function(t,e,n){var o=new ot;r.makeTypeInfoBits(t,e,o);for(var i=0,a=o.getSize();i<a;++i){var s=o.get(o.getSize()-1-i),f=r.TYPE_INFO_COORDINATES[i],c=f[0],u=f[1];if(n.setBoolean(c,u,s),i<8){var l=n.getWidth()-i-1,h=8;n.setBoolean(l,h,s)}else{var l=8,h=n.getHeight()-7+(i-8);n.setBoolean(l,h,s)}}},r.maybeEmbedVersionInfo=function(t,e){if(!(t.getVersionNumber()<7)){var n=new ot;r.makeVersionInfoBits(t,n);for(var o=6*3-1,i=0;i<6;++i)for(var a=0;a<3;++a){var s=n.get(o);o--,e.setBoolean(i,e.getHeight()-11+a,s),e.setBoolean(e.getHeight()-11+a,i,s)}}},r.embedDataBits=function(t,e,n){for(var o=0,i=-1,a=n.getWidth()-1,s=n.getHeight()-1;a>0;){for(a===6&&(a-=1);s>=0&&s<n.getHeight();){for(var f=0;f<2;++f){var c=a-f;if(r.isEmpty(n.get(c,s))){var u=void 0;o<t.getSize()?(u=t.get(o),++o):u=!1,e!==255&&Ie.getDataMaskBit(e,c,s)&&(u=!u),n.setBoolean(c,s,u)}}s+=i}i=-i,s+=i,a-=2}if(o!==t.getSize())throw new nt("Not all bits consumed: "+o+"/"+t.getSize())},r.findMSBSet=function(t){return 32-M.numberOfLeadingZeros(t)},r.calculateBCHCode=function(t,e){if(e===0)throw new I("0 polynomial");var n=r.findMSBSet(e);for(t<<=n-1;r.findMSBSet(t)>=n;)t^=e<<r.findMSBSet(t)-n;return t},r.makeTypeInfoBits=function(t,e,n){if(!Je.isValidMaskPattern(e))throw new nt("Invalid mask pattern");var o=t.getBits()<<3|e;n.appendBits(o,5);var i=r.calculateBCHCode(o,r.TYPE_INFO_POLY);n.appendBits(i,10);var a=new ot;if(a.appendBits(r.TYPE_INFO_MASK_PATTERN,15),n.xor(a),n.getSize()!==15)throw new nt("should not happen but we got: "+n.getSize())},r.makeVersionInfoBits=function(t,e){e.appendBits(t.getVersionNumber(),6);var n=r.calculateBCHCode(t.getVersionNumber(),r.VERSION_INFO_POLY);if(e.appendBits(n,12),e.getSize()!==18)throw new nt("should not happen but we got: "+e.getSize())},r.isEmpty=function(t){return t===255},r.embedTimingPatterns=function(t){for(var e=8;e<t.getWidth()-8;++e){var n=(e+1)%2;r.isEmpty(t.get(e,6))&&t.setNumber(e,6,n),r.isEmpty(t.get(6,e))&&t.setNumber(6,e,n)}},r.embedDarkDotAtLeftBottomCorner=function(t){if(t.get(8,t.getHeight()-8)===0)throw new nt;t.setNumber(8,t.getHeight()-8,1)},r.embedHorizontalSeparationPattern=function(t,e,n){for(var o=0;o<8;++o){if(!r.isEmpty(n.get(t+o,e)))throw new nt;n.setNumber(t+o,e,0)}},r.embedVerticalSeparationPattern=function(t,e,n){for(var o=0;o<7;++o){if(!r.isEmpty(n.get(t,e+o)))throw new nt;n.setNumber(t,e+o,0)}},r.embedPositionAdjustmentPattern=function(t,e,n){for(var o=0;o<5;++o)for(var i=r.POSITION_ADJUSTMENT_PATTERN[o],a=0;a<5;++a)n.setNumber(t+a,e+o,i[a])},r.embedPositionDetectionPattern=function(t,e,n){for(var o=0;o<7;++o)for(var i=r.POSITION_DETECTION_PATTERN[o],a=0;a<7;++a)n.setNumber(t+a,e+o,i[a])},r.embedPositionDetectionPatternsAndSeparators=function(t){var e=r.POSITION_DETECTION_PATTERN[0].length;r.embedPositionDetectionPattern(0,0,t),r.embedPositionDetectionPattern(t.getWidth()-e,0,t),r.embedPositionDetectionPattern(0,t.getWidth()-e,t);var n=8;r.embedHorizontalSeparationPattern(0,n-1,t),r.embedHorizontalSeparationPattern(t.getWidth()-n,n-1,t),r.embedHorizontalSeparationPattern(0,t.getWidth()-n,t);var o=7;r.embedVerticalSeparationPattern(o,0,t),r.embedVerticalSeparationPattern(t.getHeight()-o-1,0,t),r.embedVerticalSeparationPattern(o,t.getHeight()-o,t)},r.maybeEmbedPositionAdjustmentPatterns=function(t,e){if(!(t.getVersionNumber()<2))for(var n=t.getVersionNumber()-1,o=r.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[n],i=0,a=o.length;i!==a;i++){var s=o[i];if(s>=0)for(var f=0;f!==a;f++){var c=o[f];c>=0&&r.isEmpty(e.get(c,s))&&r.embedPositionAdjustmentPattern(c-2,s-2,e)}}},r.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),r.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),r.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),r.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),r.VERSION_INFO_POLY=7973,r.TYPE_INFO_POLY=1335,r.TYPE_INFO_MASK_PATTERN=21522,r}(),un=j1;var Y1=function(){function r(t,e){this.dataBytes=t,this.errorCorrectionBytes=e}return r.prototype.getDataBytes=function(){return this.dataBytes},r.prototype.getErrorCorrectionBytes=function(){return this.errorCorrectionBytes},r}(),ba=Y1;var Na=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Z1=function(){function r(){}return r.calculateMaskPenalty=function(t){return Ie.applyMaskPenaltyRule1(t)+Ie.applyMaskPenaltyRule2(t)+Ie.applyMaskPenaltyRule3(t)+Ie.applyMaskPenaltyRule4(t)},r.encode=function(t,e,n){n===void 0&&(n=null);var o=r.DEFAULT_BYTE_MODE_ENCODING,i=n!==null&&n.get(V.CHARACTER_SET)!==void 0;i&&(o=n.get(V.CHARACTER_SET).toString());var a=this.chooseMode(t,o),s=new ot;if(a===et.BYTE&&(i||r.DEFAULT_BYTE_MODE_ENCODING!==o)){var f=it.getCharacterSetECIByName(o);f!==void 0&&this.appendECI(f,s)}this.appendModeInfo(a,s);var c=new ot;this.appendBytes(t,a,c,o);var u;if(n!==null&&n.get(V.QR_VERSION)!==void 0){var l=Number.parseInt(n.get(V.QR_VERSION).toString(),10);u=Zt.getVersionForNumber(l);var h=this.calculateBitsNeeded(a,s,c,u);if(!this.willFit(h,u,e))throw new nt("Data too big for requested version")}else u=this.recommendVersion(e,a,s,c);var d=new ot;d.appendBitArray(s);var p=a===et.BYTE?c.getSizeInBytes():t.length;this.appendLengthInfo(p,u,a,d),d.appendBitArray(c);var v=u.getECBlocksForLevel(e),g=u.getTotalCodewords()-v.getTotalECCodewords();this.terminateBits(g,d);var y=this.interleaveWithECBytes(d,u.getTotalCodewords(),g,v.getNumBlocks()),x=new Je;x.setECLevel(e),x.setMode(a),x.setVersion(u);var C=u.getDimensionForVersion(),w=new wr(C,C),_=this.chooseMaskPattern(y,e,u,w);return x.setMaskPattern(_),un.buildMatrix(y,e,u,_,w),x.setMatrix(w),x},r.recommendVersion=function(t,e,n,o){var i=this.calculateBitsNeeded(e,n,o,Zt.getVersionForNumber(1)),a=this.chooseVersion(i,t),s=this.calculateBitsNeeded(e,n,o,a);return this.chooseVersion(s,t)},r.calculateBitsNeeded=function(t,e,n,o){return e.getSize()+t.getCharacterCountBits(o)+n.getSize()},r.getAlphanumericCode=function(t){return t<r.ALPHANUMERIC_TABLE.length?r.ALPHANUMERIC_TABLE[t]:-1},r.chooseMode=function(t,e){if(e===void 0&&(e=null),it.SJIS.getName()===e&&this.isOnlyDoubleByteKanji(t))return et.KANJI;for(var n=!1,o=!1,i=0,a=t.length;i<a;++i){var s=t.charAt(i);if(r.isDigit(s))n=!0;else if(this.getAlphanumericCode(s.charCodeAt(0))!==-1)o=!0;else return et.BYTE}return o?et.ALPHANUMERIC:n?et.NUMERIC:et.BYTE},r.isOnlyDoubleByteKanji=function(t){var e;try{e=Ct.encode(t,it.SJIS)}catch{return!1}var n=e.length;if(n%2!==0)return!1;for(var o=0;o<n;o+=2){var i=e[o]&255;if((i<129||i>159)&&(i<224||i>235))return!1}return!0},r.chooseMaskPattern=function(t,e,n,o){for(var i=Number.MAX_SAFE_INTEGER,a=-1,s=0;s<Je.NUM_MASK_PATTERNS;s++){un.buildMatrix(t,e,n,s,o);var f=this.calculateMaskPenalty(o);f<i&&(i=f,a=s)}return a},r.chooseVersion=function(t,e){for(var n=1;n<=40;n++){var o=Zt.getVersionForNumber(n);if(r.willFit(t,o,e))return o}throw new nt("Data too big")},r.willFit=function(t,e,n){var o=e.getTotalCodewords(),i=e.getECBlocksForLevel(n),a=i.getTotalECCodewords(),s=o-a,f=(t+7)/8;return s>=f},r.terminateBits=function(t,e){var n=t*8;if(e.getSize()>n)throw new nt("data bits cannot fit in the QR Code"+e.getSize()+" > "+n);for(var o=0;o<4&&e.getSize()<n;++o)e.appendBit(!1);var i=e.getSize()&7;if(i>0)for(var o=i;o<8;o++)e.appendBit(!1);for(var a=t-e.getSizeInBytes(),o=0;o<a;++o)e.appendBits(o&1?17:236,8);if(e.getSize()!==n)throw new nt("Bits size does not equal capacity")},r.getNumDataBytesAndNumECBytesForBlockID=function(t,e,n,o,i,a){if(o>=n)throw new nt("Block ID too large");var s=t%n,f=n-s,c=Math.floor(t/n),u=c+1,l=Math.floor(e/n),h=l+1,d=c-l,p=u-h;if(d!==p)throw new nt("EC bytes mismatch");if(n!==f+s)throw new nt("RS blocks mismatch");if(t!==(l+d)*f+(h+p)*s)throw new nt("Total bytes mismatch");o<f?(i[0]=l,a[0]=d):(i[0]=h,a[0]=p)},r.interleaveWithECBytes=function(t,e,n,o){var i,a,s,f;if(t.getSizeInBytes()!==n)throw new nt("Number of bits and data bytes does not match");for(var c=0,u=0,l=0,h=new Array,d=0;d<o;++d){var p=new Int32Array(1),v=new Int32Array(1);r.getNumDataBytesAndNumECBytesForBlockID(e,n,o,d,p,v);var g=p[0],y=new Uint8Array(g);t.toBytes(8*c,y,0,g);var x=r.generateECBytes(y,v[0]);h.push(new ba(y,x)),u=Math.max(u,g),l=Math.max(l,x.length),c+=p[0]}if(n!==c)throw new nt("Data bytes does not match offset");for(var C=new ot,d=0;d<u;++d)try{for(var w=(i=void 0,Na(h)),_=w.next();!_.done;_=w.next()){var O=_.value,y=O.getDataBytes();d<y.length&&C.appendBits(y[d],8)}}catch(B){i={error:B}}finally{try{_&&!_.done&&(a=w.return)&&a.call(w)}finally{if(i)throw i.error}}for(var d=0;d<l;++d)try{for(var R=(s=void 0,Na(h)),N=R.next();!N.done;N=R.next()){var O=N.value,x=O.getErrorCorrectionBytes();d<x.length&&C.appendBits(x[d],8)}}catch(B){s={error:B}}finally{try{N&&!N.done&&(f=R.return)&&f.call(R)}finally{if(s)throw s.error}}if(e!==C.getSizeInBytes())throw new nt("Interleaving error: "+e+" and "+C.getSizeInBytes()+" differ.");return C},r.generateECBytes=function(t,e){for(var n=t.length,o=new Int32Array(n+e),i=0;i<n;i++)o[i]=t[i]&255;new Ar(dt.QR_CODE_FIELD_256).encode(o,e);for(var a=new Uint8Array(e),i=0;i<e;i++)a[i]=o[n+i];return a},r.appendModeInfo=function(t,e){e.appendBits(t.getBits(),4)},r.appendLengthInfo=function(t,e,n,o){var i=n.getCharacterCountBits(e);if(t>=1<<i)throw new nt(t+" is bigger than "+((1<<i)-1));o.appendBits(t,i)},r.appendBytes=function(t,e,n,o){switch(e){case et.NUMERIC:r.appendNumericBytes(t,n);break;case et.ALPHANUMERIC:r.appendAlphanumericBytes(t,n);break;case et.BYTE:r.append8BitBytes(t,n,o);break;case et.KANJI:r.appendKanjiBytes(t,n);break;default:throw new nt("Invalid mode: "+e)}},r.getDigit=function(t){return t.charCodeAt(0)-48},r.isDigit=function(t){var e=r.getDigit(t);return e>=0&&e<=9},r.appendNumericBytes=function(t,e){for(var n=t.length,o=0;o<n;){var i=r.getDigit(t.charAt(o));if(o+2<n){var a=r.getDigit(t.charAt(o+1)),s=r.getDigit(t.charAt(o+2));e.appendBits(i*100+a*10+s,10),o+=3}else if(o+1<n){var a=r.getDigit(t.charAt(o+1));e.appendBits(i*10+a,7),o+=2}else e.appendBits(i,4),o++}},r.appendAlphanumericBytes=function(t,e){for(var n=t.length,o=0;o<n;){var i=r.getAlphanumericCode(t.charCodeAt(o));if(i===-1)throw new nt;if(o+1<n){var a=r.getAlphanumericCode(t.charCodeAt(o+1));if(a===-1)throw new nt;e.appendBits(i*45+a,11),o+=2}else e.appendBits(i,6),o++}},r.append8BitBytes=function(t,e,n){var o;try{o=Ct.encode(t,n)}catch(f){throw new nt(f)}for(var i=0,a=o.length;i!==a;i++){var s=o[i];e.appendBits(s,8)}},r.appendKanjiBytes=function(t,e){var n;try{n=Ct.encode(t,it.SJIS)}catch(l){throw new nt(l)}for(var o=n.length,i=0;i<o;i+=2){var a=n[i]&255,s=n[i+1]&255,f=a<<8&4294967295|s,c=-1;if(f>=33088&&f<=40956?c=f-33088:f>=57408&&f<=60351&&(c=f-49472),c===-1)throw new nt("Invalid byte sequence");var u=(c>>8)*192+(c&255);e.appendBits(u,13)}},r.appendECI=function(t,e){e.appendBits(et.ECI.getBits(),4),e.appendBits(t.getValue(),8)},r.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),r.DEFAULT_BYTE_MODE_ENCODING=it.UTF8.getName(),r}(),ce=Z1;var aA=function(){function r(){}return r.prototype.write=function(t,e,n,o){if(o===void 0&&(o=null),t.length===0)throw new I("Found empty contents");if(e<0||n<0)throw new I("Requested dimensions are too small: "+e+"x"+n);var i=Mt.L,a=r.QUIET_ZONE_SIZE;o!==null&&(o.get(V.ERROR_CORRECTION)!==void 0&&(i=Mt.fromString(o.get(V.ERROR_CORRECTION).toString())),o.get(V.MARGIN)!==void 0&&(a=Number.parseInt(o.get(V.MARGIN).toString(),10)));var s=ce.encode(t,i,o);return this.renderResult(s,e,n,a)},r.prototype.writeToDom=function(t,e,n,o,i){i===void 0&&(i=null),typeof t=="string"&&(t=document.querySelector(t));var a=this.write(e,n,o,i);t&&t.appendChild(a)},r.prototype.renderResult=function(t,e,n,o){var i=t.getMatrix();if(i===null)throw new mt;for(var a=i.getWidth(),s=i.getHeight(),f=a+o*2,c=s+o*2,u=Math.max(e,f),l=Math.max(n,c),h=Math.min(Math.floor(u/f),Math.floor(l/c)),d=Math.floor((u-a*h)/2),p=Math.floor((l-s*h)/2),v=this.createSVGElement(u,l),g=0,y=p;g<s;g++,y+=h)for(var x=0,C=d;x<a;x++,C+=h)if(i.get(x,g)===1){var w=this.createSvgRectElement(C,y,h,h);v.appendChild(w)}return v},r.prototype.createSVGElement=function(t,e){var n=document.createElementNS(r.SVG_NS,"svg");return n.setAttributeNS(null,"height",t.toString()),n.setAttributeNS(null,"width",e.toString()),n},r.prototype.createSvgRectElement=function(t,e,n,o){var i=document.createElementNS(r.SVG_NS,"rect");return i.setAttributeNS(null,"x",t.toString()),i.setAttributeNS(null,"y",e.toString()),i.setAttributeNS(null,"height",n.toString()),i.setAttributeNS(null,"width",o.toString()),i.setAttributeNS(null,"fill","#000000"),i},r.QUIET_ZONE_SIZE=4,r.SVG_NS="http://www.w3.org/2000/svg",r}();var K1=function(){function r(){}return r.prototype.encode=function(t,e,n,o,i){if(t.length===0)throw new I("Found empty contents");if(e!==T.QR_CODE)throw new I("Can only encode QR_CODE, but got "+e);if(n<0||o<0)throw new I("Requested dimensions are too small: "+n+"x"+o);var a=Mt.L,s=r.QUIET_ZONE_SIZE;i!==null&&(i.get(V.ERROR_CORRECTION)!==void 0&&(a=Mt.fromString(i.get(V.ERROR_CORRECTION).toString())),i.get(V.MARGIN)!==void 0&&(s=Number.parseInt(i.get(V.MARGIN).toString(),10)));var f=ce.encode(t,a,i);return r.renderResult(f,n,o,s)},r.renderResult=function(t,e,n,o){var i=t.getMatrix();if(i===null)throw new mt;for(var a=i.getWidth(),s=i.getHeight(),f=a+o*2,c=s+o*2,u=Math.max(e,f),l=Math.max(n,c),h=Math.min(Math.floor(u/f),Math.floor(l/c)),d=Math.floor((u-a*h)/2),p=Math.floor((l-s*h)/2),v=new at(u,l),g=0,y=p;g<s;g++,y+=h)for(var x=0,C=d;x<a;x++,C+=h)i.get(x,g)===1&&v.setRegion(C,y,h,h);return v},r.QUIET_ZONE_SIZE=4,r}(),lo=K1;var NA=function(){function r(){}return r.prototype.encode=function(t,e,n,o,i){var a;switch(e){case T.QR_CODE:a=new lo;break;default:throw new I("No encoder available for format "+e)}return a.encode(t,e,n,o,i)},r}();var Q1=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),kA=function(r){Q1(t,r);function t(e,n,o,i,a,s,f,c){var u=r.call(this,s,f)||this;if(u.yuvData=e,u.dataWidth=n,u.dataHeight=o,u.left=i,u.top=a,i+s>n||a+f>o)throw new I("Crop rectangle does not fit within image data.");return c&&u.reverseHorizontal(s,f),u}return t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new I("Requested row is outside the image: "+e);var o=this.getWidth();(n==null||n.length<o)&&(n=new Uint8ClampedArray(o));var i=(e+this.top)*this.dataWidth+this.left;return H.arraycopy(this.yuvData,i,n,0,o),n},t.prototype.getMatrix=function(){var e=this.getWidth(),n=this.getHeight();if(e===this.dataWidth&&n===this.dataHeight)return this.yuvData;var o=e*n,i=new Uint8ClampedArray(o),a=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return H.arraycopy(this.yuvData,a,i,0,o),i;for(var s=0;s<n;s++){var f=s*e;H.arraycopy(this.yuvData,a,i,f,e),a+=this.dataWidth}return i},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,n,o,i){return new t(this.yuvData,this.dataWidth,this.dataHeight,this.left+e,this.top+n,o,i,!1)},t.prototype.renderThumbnail=function(){for(var e=this.getWidth()/t.THUMBNAIL_SCALE_FACTOR,n=this.getHeight()/t.THUMBNAIL_SCALE_FACTOR,o=new Int32Array(e*n),i=this.yuvData,a=this.top*this.dataWidth+this.left,s=0;s<n;s++){for(var f=s*e,c=0;c<e;c++){var u=i[a+c*t.THUMBNAIL_SCALE_FACTOR]&255;o[f+c]=4278190080|u*65793}a+=this.dataWidth*t.THUMBNAIL_SCALE_FACTOR}return o},t.prototype.getThumbnailWidth=function(){return this.getWidth()/t.THUMBNAIL_SCALE_FACTOR},t.prototype.getThumbnailHeight=function(){return this.getHeight()/t.THUMBNAIL_SCALE_FACTOR},t.prototype.reverseHorizontal=function(e,n){for(var o=this.yuvData,i=0,a=this.top*this.dataWidth+this.left;i<n;i++,a+=this.dataWidth)for(var s=a+e/2,f=a,c=a+e-1;f<s;f++,c--){var u=o[f];o[f]=o[c],o[c]=u}},t.prototype.invert=function(){return new ne(this)},t.THUMBNAIL_SCALE_FACTOR=2,t}(Yt);var q1=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),XA=function(r){q1(t,r);function t(e,n,o,i,a,s,f){var c=r.call(this,n,o)||this;if(c.dataWidth=i,c.dataHeight=a,c.left=s,c.top=f,e.BYTES_PER_ELEMENT===4){for(var u=n*o,l=new Uint8ClampedArray(u),h=0;h<u;h++){var d=e[h],p=d>>16&255,v=d>>7&510,g=d&255;l[h]=(p+v+g)/4&255}c.luminances=l}else c.luminances=e;if(i===void 0&&(c.dataWidth=n),a===void 0&&(c.dataHeight=o),s===void 0&&(c.left=0),f===void 0&&(c.top=0),c.left+n>c.dataWidth||c.top+o>c.dataHeight)throw new I("Crop rectangle does not fit within image data.");return c}return t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new I("Requested row is outside the image: "+e);var o=this.getWidth();(n==null||n.length<o)&&(n=new Uint8ClampedArray(o));var i=(e+this.top)*this.dataWidth+this.left;return H.arraycopy(this.luminances,i,n,0,o),n},t.prototype.getMatrix=function(){var e=this.getWidth(),n=this.getHeight();if(e===this.dataWidth&&n===this.dataHeight)return this.luminances;var o=e*n,i=new Uint8ClampedArray(o),a=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return H.arraycopy(this.luminances,a,i,0,o),i;for(var s=0;s<n;s++){var f=s*e;H.arraycopy(this.luminances,a,i,f,e),a+=this.dataWidth}return i},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,n,o,i){return new t(this.luminances,o,i,this.dataWidth,this.dataHeight,this.left+e,this.top+n)},t.prototype.invert=function(){return new ne(this)},t}(Yt);var $1=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),J1=function(r){$1(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.forName=function(e){return this.getCharacterSetECIByName(e)},t}(it),Be=J1;var tl=function(){function r(){}return r.ISO_8859_1=it.ISO8859_1,r}(),_r=tl;var el=function(){function r(t,e,n){this.codewords=t,this.numcols=e,this.numrows=n,this.bits=new Uint8Array(e*n),Z.fill(this.bits,2)}return r.prototype.getNumrows=function(){return this.numrows},r.prototype.getNumcols=function(){return this.numcols},r.prototype.getBits=function(){return this.bits},r.prototype.getBit=function(t,e){return this.bits[e*this.numcols+t]===1},r.prototype.setBit=function(t,e,n){this.bits[e*this.numcols+t]=n?1:0},r.prototype.noBit=function(t,e){return this.bits[e*this.numcols+t]===2},r.prototype.place=function(){var t=0,e=4,n=0;do{e===this.numrows&&n===0&&this.corner1(t++),e===this.numrows-2&&n===0&&this.numcols%4!==0&&this.corner2(t++),e===this.numrows-2&&n===0&&this.numcols%8===4&&this.corner3(t++),e===this.numrows+4&&n===2&&this.numcols%8===0&&this.corner4(t++);do e<this.numrows&&n>=0&&this.noBit(n,e)&&this.utah(e,n,t++),e-=2,n+=2;while(e>=0&&n<this.numcols);e++,n+=3;do e>=0&&n<this.numcols&&this.noBit(n,e)&&this.utah(e,n,t++),e+=2,n-=2;while(e<this.numrows&&n>=0);e+=3,n++}while(e<this.numrows||n<this.numcols);this.noBit(this.numcols-1,this.numrows-1)&&(this.setBit(this.numcols-1,this.numrows-1,!0),this.setBit(this.numcols-2,this.numrows-2,!0))},r.prototype.module=function(t,e,n,o){t<0&&(t+=this.numrows,e+=4-(this.numrows+4)%8),e<0&&(e+=this.numcols,t+=4-(this.numcols+4)%8);var i=this.codewords.charCodeAt(n);i&=1<<8-o,this.setBit(e,t,i!==0)},r.prototype.utah=function(t,e,n){this.module(t-2,e-2,n,1),this.module(t-2,e-1,n,2),this.module(t-1,e-2,n,3),this.module(t-1,e-1,n,4),this.module(t-1,e,n,5),this.module(t,e-2,n,6),this.module(t,e-1,n,7),this.module(t,e,n,8)},r.prototype.corner1=function(t){this.module(this.numrows-1,0,t,1),this.module(this.numrows-1,1,t,2),this.module(this.numrows-1,2,t,3),this.module(0,this.numcols-2,t,4),this.module(0,this.numcols-1,t,5),this.module(1,this.numcols-1,t,6),this.module(2,this.numcols-1,t,7),this.module(3,this.numcols-1,t,8)},r.prototype.corner2=function(t){this.module(this.numrows-3,0,t,1),this.module(this.numrows-2,0,t,2),this.module(this.numrows-1,0,t,3),this.module(0,this.numcols-4,t,4),this.module(0,this.numcols-3,t,5),this.module(0,this.numcols-2,t,6),this.module(0,this.numcols-1,t,7),this.module(1,this.numcols-1,t,8)},r.prototype.corner3=function(t){this.module(this.numrows-3,0,t,1),this.module(this.numrows-2,0,t,2),this.module(this.numrows-1,0,t,3),this.module(0,this.numcols-2,t,4),this.module(0,this.numcols-1,t,5),this.module(1,this.numcols-1,t,6),this.module(2,this.numcols-1,t,7),this.module(3,this.numcols-1,t,8)},r.prototype.corner4=function(t){this.module(this.numrows-1,0,t,1),this.module(this.numrows-1,this.numcols-1,t,2),this.module(0,this.numcols-3,t,3),this.module(0,this.numcols-2,t,4),this.module(0,this.numcols-1,t,5),this.module(1,this.numcols-3,t,6),this.module(1,this.numcols-2,t,7),this.module(1,this.numcols-1,t,8)},r}(),ln=el;var ho,vo=[5,7,10,11,12,14,18,20,24,28,36,42,48,56,62,68],Pa=[[228,48,15,111,62],[23,68,144,134,240,92,254],[28,24,185,166,223,248,116,255,110,61],[175,138,205,12,194,168,39,245,60,97,120],[41,153,158,91,61,42,142,213,97,178,100,242],[156,97,192,252,95,9,157,119,138,45,18,186,83,185],[83,195,100,39,188,75,66,61,241,213,109,129,94,254,225,48,90,188],[15,195,244,9,233,71,168,2,188,160,153,145,253,79,108,82,27,174,186,172],[52,190,88,205,109,39,176,21,155,197,251,223,155,21,5,172,254,124,12,181,184,96,50,193],[211,231,43,97,71,96,103,174,37,151,170,53,75,34,249,121,17,138,110,213,141,136,120,151,233,168,93,255],[245,127,242,218,130,250,162,181,102,120,84,179,220,251,80,182,229,18,2,4,68,33,101,137,95,119,115,44,175,184,59,25,225,98,81,112],[77,193,137,31,19,38,22,153,247,105,122,2,245,133,242,8,175,95,100,9,167,105,214,111,57,121,21,1,253,57,54,101,248,202,69,50,150,177,226,5,9,5],[245,132,172,223,96,32,117,22,238,133,238,231,205,188,237,87,191,106,16,147,118,23,37,90,170,205,131,88,120,100,66,138,186,240,82,44,176,87,187,147,160,175,69,213,92,253,225,19],[175,9,223,238,12,17,220,208,100,29,175,170,230,192,215,235,150,159,36,223,38,200,132,54,228,146,218,234,117,203,29,232,144,238,22,150,201,117,62,207,164,13,137,245,127,67,247,28,155,43,203,107,233,53,143,46],[242,93,169,50,144,210,39,118,202,188,201,189,143,108,196,37,185,112,134,230,245,63,197,190,250,106,185,221,175,64,114,71,161,44,147,6,27,218,51,63,87,10,40,130,188,17,163,31,176,170,4,107,232,7,94,166,224,124,86,47,11,204],[220,228,173,89,251,149,159,56,89,33,147,244,154,36,73,127,213,136,248,180,234,197,158,177,68,122,93,213,15,160,227,236,66,139,153,185,202,167,179,25,220,232,96,210,231,136,223,239,181,241,59,52,172,25,49,232,211,189,64,54,108,153,132,63,96,103,82,186]],rl=301,nl=function(r,t){for(var e=1,n=0;n<255;n++)t[n]=e,r[e]=n,e*=2,e>=256&&(e^=rl);return{LOG:r,ALOG:t}},Sr=(ho=nl([],[]),ho.LOG),mo=ho.ALOG,po;(function(r){r[r.FORCE_NONE=0]="FORCE_NONE",r[r.FORCE_SQUARE=1]="FORCE_SQUARE",r[r.FORCE_RECTANGLE=2]="FORCE_RECTANGLE"})(po||(po={}));var go=129,hn=230,Ma=231,Ba=235,Fa=236,La=237,ka=238,Ua=239,Va=240,dn=254,Ha=254,tr="[)>05",er="[)>06",rr="",W=0,yt=1,_t=2,pt=3,gt=4,At=5;var ol=function(){function r(){}return r.encodeECC200=function(t,e){if(t.length!==e.getDataCapacity())throw new Error("The number of codewords does not match the selected symbol");var n=new P;n.append(t);var o=e.getInterleavedBlockCount();if(o===1){var i=this.createECCBlock(t,e.getErrorCodewords());n.append(i)}else{for(var a=[],s=[],f=0;f<o;f++)a[f]=e.getDataLengthForInterleavedBlock(f+1),s[f]=e.getErrorLengthForInterleavedBlock(f+1);for(var c=0;c<o;c++){for(var u=new P,l=c;l<e.getDataCapacity();l+=o)u.append(t.charAt(l));for(var i=this.createECCBlock(u.toString(),s[c]),h=0,d=c;d<s[c]*o;d+=o)n.setCharAt(e.getDataCapacity()+d,i.charAt(h++))}}return n.toString()},r.createECCBlock=function(t,e){for(var n=-1,o=0;o<vo.length;o++)if(vo[o]===e){n=o;break}if(n<0)throw new Error("Illegal number of error correction codewords specified: "+e);for(var i=Pa[n],a=[],o=0;o<e;o++)a[o]=0;for(var o=0;o<t.length;o++){for(var s=a[e-1]^t.charAt(o).charCodeAt(0),f=e-1;f>0;f--)s!==0&&i[f]!==0?a[f]=a[f-1]^mo[(Sr[s]+Sr[i[f]])%255]:a[f]=a[f-1];s!==0&&i[0]!==0?a[0]=mo[(Sr[s]+Sr[i[0]])%255]:a[0]=0}for(var c=[],o=0;o<e;o++)c[o]=a[e-o-1];return c.map(function(u){return String.fromCharCode(u)}).join("")},r}(),pn=ol;var xo=function(){function r(){}return r.prototype.getEncodingMode=function(){return W},r.prototype.encode=function(t){var e=U.determineConsecutiveDigitCount(t.getMessage(),t.pos);if(e>=2)t.writeCodeword(this.encodeASCIIDigits(t.getMessage().charCodeAt(t.pos),t.getMessage().charCodeAt(t.pos+1))),t.pos+=2;else{var n=t.getCurrentChar(),o=U.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(o!==this.getEncodingMode())switch(o){case At:t.writeCodeword(Ma),t.signalEncoderChange(At);return;case yt:t.writeCodeword(hn),t.signalEncoderChange(yt);return;case pt:t.writeCodeword(ka),t.signalEncoderChange(pt);break;case _t:t.writeCodeword(Ua),t.signalEncoderChange(_t);break;case gt:t.writeCodeword(Va),t.signalEncoderChange(gt);break;default:throw new Error("Illegal mode: "+o)}else U.isExtendedASCII(n)?(t.writeCodeword(Ba),t.writeCodeword(n-128+1),t.pos++):(t.writeCodeword(n+1),t.pos++)}},r.prototype.encodeASCIIDigits=function(t,e){if(U.isDigit(t)&&U.isDigit(e)){var n=(t-48)*10+(e-48);return n+130}throw new Error("not digits: "+t+e)},r}();var yo=function(){function r(){}return r.prototype.getEncodingMode=function(){return At},r.prototype.encode=function(t){var e=new P;for(e.append(0);t.hasMoreCharacters();){var n=t.getCurrentChar();e.append(n),t.pos++;var o=U.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(o!==this.getEncodingMode()){t.signalEncoderChange(W);break}}var i=e.length()-1,a=1,s=t.getCodewordCount()+i+a;t.updateSymbolInfo(s);var f=t.getSymbolInfo().getDataCapacity()-s>0;if(t.hasMoreCharacters()||f)if(i<=249)e.setCharAt(0,F.getCharAt(i));else if(i<=1555)e.setCharAt(0,F.getCharAt(Math.floor(i/250)+249)),e.insert(1,F.getCharAt(i%250));else throw new Error("Message length not in valid ranges: "+i);for(var c=0,n=e.length();c<n;c++)t.writeCodeword(this.randomize255State(e.charAt(c).charCodeAt(0),t.getCodewordCount()+1))},r.prototype.randomize255State=function(t,e){var n=149*e%255+1,o=t+n;return o<=255?o:o-256},r}();var Fe=function(){function r(){}return r.prototype.getEncodingMode=function(){return yt},r.prototype.encodeMaximal=function(t){for(var e=new P,n=0,o=t.pos,i=0;t.hasMoreCharacters();){var a=t.getCurrentChar();t.pos++,n=this.encodeChar(a,e),e.length()%3===0&&(o=t.pos,i=e.length())}if(i!==e.length()){var s=Math.floor(e.length()/3*2),f=Math.floor(t.getCodewordCount()+s+1);t.updateSymbolInfo(f);var c=t.getSymbolInfo().getDataCapacity()-f,u=Math.floor(e.length()%3);(u===2&&c!==2||u===1&&(n>3||c!==1))&&(t.pos=o)}e.length()>0&&t.writeCodeword(hn),this.handleEOD(t,e)},r.prototype.encode=function(t){for(var e=new P;t.hasMoreCharacters();){var n=t.getCurrentChar();t.pos++;var o=this.encodeChar(n,e),i=Math.floor(e.length()/3)*2,a=t.getCodewordCount()+i;t.updateSymbolInfo(a);var s=t.getSymbolInfo().getDataCapacity()-a;if(!t.hasMoreCharacters()){var f=new P;for(e.length()%3===2&&s!==2&&(o=this.backtrackOneCharacter(t,e,f,o));e.length()%3===1&&(o>3||s!==1);)o=this.backtrackOneCharacter(t,e,f,o);break}var c=e.length();if(c%3===0){var u=U.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(u!==this.getEncodingMode()){t.signalEncoderChange(W);break}}}this.handleEOD(t,e)},r.prototype.backtrackOneCharacter=function(t,e,n,o){var i=e.length(),a=e.toString().substring(0,i-o);e.setLengthToZero(),e.append(a),t.pos--;var s=t.getCurrentChar();return o=this.encodeChar(s,n),t.resetSymbolInfo(),o},r.prototype.writeNextTriplet=function(t,e){t.writeCodewords(this.encodeToCodewords(e.toString()));var n=e.toString().substring(3);e.setLengthToZero(),e.append(n)},r.prototype.handleEOD=function(t,e){var n=Math.floor(e.length()/3*2),o=e.length()%3,i=t.getCodewordCount()+n;t.updateSymbolInfo(i);var a=t.getSymbolInfo().getDataCapacity()-i;if(o===2){for(e.append("\0");e.length()>=3;)this.writeNextTriplet(t,e);t.hasMoreCharacters()&&t.writeCodeword(dn)}else if(a===1&&o===1){for(;e.length()>=3;)this.writeNextTriplet(t,e);t.hasMoreCharacters()&&t.writeCodeword(dn),t.pos--}else if(o===0){for(;e.length()>=3;)this.writeNextTriplet(t,e);(a>0||t.hasMoreCharacters())&&t.writeCodeword(dn)}else throw new Error("Unexpected case. Please report!");t.signalEncoderChange(W)},r.prototype.encodeChar=function(t,e){if(t===32)return e.append(3),1;if(t>=48&&t<=57)return e.append(t-48+4),1;if(t>=65&&t<=90)return e.append(t-65+14),1;if(t<32)return e.append(0),e.append(t),2;if(t<=47)return e.append(1),e.append(t-33),2;if(t<=64)return e.append(1),e.append(t-58+15),2;if(t<=95)return e.append(1),e.append(t-91+22),2;if(t<=127)return e.append(2),e.append(t-96),2;e.append("1");var n=2;return n+=this.encodeChar(t-128,e),n},r.prototype.encodeToCodewords=function(t){var e=1600*t.charCodeAt(0)+40*t.charCodeAt(1)+t.charCodeAt(2)+1,n=e/256,o=e%256,i=new P;return i.append(n),i.append(o),i.toString()},r}();var Co=function(){function r(){}return r.prototype.getEncodingMode=function(){return gt},r.prototype.encode=function(t){for(var e=new P;t.hasMoreCharacters();){var n=t.getCurrentChar();this.encodeChar(n,e),t.pos++;var o=e.length();if(o>=4){t.writeCodewords(this.encodeToCodewords(e.toString()));var i=e.toString().substring(4);e.setLengthToZero(),e.append(i);var a=U.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(a!==this.getEncodingMode()){t.signalEncoderChange(W);break}}}e.append(F.getCharAt(31)),this.handleEOD(t,e)},r.prototype.handleEOD=function(t,e){try{var n=e.length();if(n===0)return;if(n===1){t.updateSymbolInfo();var o=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount(),i=t.getRemainingCharacters();if(i>o&&(t.updateSymbolInfo(t.getCodewordCount()+1),o=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount()),i<=o&&o<=2)return}if(n>4)throw new Error("Count must not exceed 4");var a=n-1,s=this.encodeToCodewords(e.toString()),f=!t.hasMoreCharacters(),c=f&&a<=2;if(a<=2){t.updateSymbolInfo(t.getCodewordCount()+a);var o=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount();o>=3&&(c=!1,t.updateSymbolInfo(t.getCodewordCount()+s.length))}c?(t.resetSymbolInfo(),t.pos-=a):t.writeCodewords(s)}finally{t.signalEncoderChange(W)}},r.prototype.encodeChar=function(t,e){t>=32&&t<=63?e.append(t):t>=64&&t<=94?e.append(F.getCharAt(t-64)):U.illegalCharacter(F.getCharAt(t))},r.prototype.encodeToCodewords=function(t){var e=t.length;if(e===0)throw new Error("StringBuilder must not be empty");var n=t.charAt(0).charCodeAt(0),o=e>=2?t.charAt(1).charCodeAt(0):0,i=e>=3?t.charAt(2).charCodeAt(0):0,a=e>=4?t.charAt(3).charCodeAt(0):0,s=(n<<18)+(o<<12)+(i<<6)+a,f=s>>16&255,c=s>>8&255,u=s&255,l=new P;return l.append(f),e>=2&&l.append(c),e>=3&&l.append(u),l.toString()},r}();var il=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),al=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Q=function(){function r(t,e,n,o,i,a,s,f){s===void 0&&(s=0),f===void 0&&(f=0),this.rectangular=t,this.dataCapacity=e,this.errorCodewords=n,this.matrixWidth=o,this.matrixHeight=i,this.dataRegions=a,this.rsBlockData=s,this.rsBlockError=f}return r.lookup=function(t,e,n,o,i){var a,s;e===void 0&&(e=0),n===void 0&&(n=null),o===void 0&&(o=null),i===void 0&&(i=!0);try{for(var f=al(fl),c=f.next();!c.done;c=f.next()){var u=c.value;if(!(e===1&&u.rectangular)&&!(e===2&&!u.rectangular)&&!(n!=null&&(u.getSymbolWidth()<n.getWidth()||u.getSymbolHeight()<n.getHeight()))&&!(o!=null&&(u.getSymbolWidth()>o.getWidth()||u.getSymbolHeight()>o.getHeight()))&&t<=u.dataCapacity)return u}}catch(l){a={error:l}}finally{try{c&&!c.done&&(s=f.return)&&s.call(f)}finally{if(a)throw a.error}}if(i)throw new Error("Can't find a symbol arrangement that matches the message. Data codewords: "+t);return null},r.prototype.getHorizontalDataRegions=function(){switch(this.dataRegions){case 1:return 1;case 2:case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},r.prototype.getVerticalDataRegions=function(){switch(this.dataRegions){case 1:case 2:return 1;case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},r.prototype.getSymbolDataWidth=function(){return this.getHorizontalDataRegions()*this.matrixWidth},r.prototype.getSymbolDataHeight=function(){return this.getVerticalDataRegions()*this.matrixHeight},r.prototype.getSymbolWidth=function(){return this.getSymbolDataWidth()+this.getHorizontalDataRegions()*2},r.prototype.getSymbolHeight=function(){return this.getSymbolDataHeight()+this.getVerticalDataRegions()*2},r.prototype.getCodewordCount=function(){return this.dataCapacity+this.errorCodewords},r.prototype.getInterleavedBlockCount=function(){return this.rsBlockData?this.dataCapacity/this.rsBlockData:1},r.prototype.getDataCapacity=function(){return this.dataCapacity},r.prototype.getErrorCodewords=function(){return this.errorCodewords},r.prototype.getDataLengthForInterleavedBlock=function(t){return this.rsBlockData},r.prototype.getErrorLengthForInterleavedBlock=function(t){return this.rsBlockError},r}(),nr=Q,sl=function(r){il(t,r);function t(){return r.call(this,!1,1558,620,22,22,36,-1,62)||this}return t.prototype.getInterleavedBlockCount=function(){return 10},t.prototype.getDataLengthForInterleavedBlock=function(e){return e<=8?156:155},t}(Q),fl=[new Q(!1,3,5,8,8,1),new Q(!1,5,7,10,10,1),new Q(!0,5,7,16,6,1),new Q(!1,8,10,12,12,1),new Q(!0,10,11,14,6,2),new Q(!1,12,12,14,14,1),new Q(!0,16,14,24,10,1),new Q(!1,18,14,16,16,1),new Q(!1,22,18,18,18,1),new Q(!0,22,18,16,10,2),new Q(!1,30,20,20,20,1),new Q(!0,32,24,16,14,2),new Q(!1,36,24,22,22,1),new Q(!1,44,28,24,24,1),new Q(!0,49,28,22,14,2),new Q(!1,62,36,14,14,4),new Q(!1,86,42,16,16,4),new Q(!1,114,48,18,18,4),new Q(!1,144,56,20,20,4),new Q(!1,174,68,22,22,4),new Q(!1,204,84,24,24,4,102,42),new Q(!1,280,112,14,14,16,140,56),new Q(!1,368,144,16,16,16,92,36),new Q(!1,456,192,18,18,16,114,48),new Q(!1,576,224,20,20,16,144,56),new Q(!1,696,272,22,22,16,174,68),new Q(!1,816,336,24,24,16,136,56),new Q(!1,1050,408,18,18,36,175,68),new Q(!1,1304,496,20,20,36,163,62),new sl];var Eo=function(){function r(t){this.msg=t,this.pos=0,this.skipAtEnd=0;for(var e=t.split("").map(function(s){return s.charCodeAt(0)}),n=new P,o=0,i=e.length;o<i;o++){var a=String.fromCharCode(e[o]&255);if(a==="?"&&t.charAt(o)!=="?")throw new Error("Message contains characters outside ISO-8859-1 encoding.");n.append(a)}this.msg=n.toString(),this.shape=0,this.codewords=new P,this.newEncoding=-1}return r.prototype.setSymbolShape=function(t){this.shape=t},r.prototype.setSizeConstraints=function(t,e){this.minSize=t,this.maxSize=e},r.prototype.getMessage=function(){return this.msg},r.prototype.setSkipAtEnd=function(t){this.skipAtEnd=t},r.prototype.getCurrentChar=function(){return this.msg.charCodeAt(this.pos)},r.prototype.getCurrent=function(){return this.msg.charCodeAt(this.pos)},r.prototype.getCodewords=function(){return this.codewords},r.prototype.writeCodewords=function(t){this.codewords.append(t)},r.prototype.writeCodeword=function(t){this.codewords.append(t)},r.prototype.getCodewordCount=function(){return this.codewords.length()},r.prototype.getNewEncoding=function(){return this.newEncoding},r.prototype.signalEncoderChange=function(t){this.newEncoding=t},r.prototype.resetEncoderSignal=function(){this.newEncoding=-1},r.prototype.hasMoreCharacters=function(){return this.pos<this.getTotalMessageCharCount()},r.prototype.getTotalMessageCharCount=function(){return this.msg.length-this.skipAtEnd},r.prototype.getRemainingCharacters=function(){return this.getTotalMessageCharCount()-this.pos},r.prototype.getSymbolInfo=function(){return this.symbolInfo},r.prototype.updateSymbolInfo=function(t){t===void 0&&(t=this.getCodewordCount()),(this.symbolInfo==null||t>this.symbolInfo.getDataCapacity())&&(this.symbolInfo=nr.lookup(t,this.shape,this.minSize,this.maxSize,!0))},r.prototype.resetSymbolInfo=function(){this.symbolInfo=null},r}();var cl=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ao=function(r){cl(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.getEncodingMode=function(){return pt},t.prototype.encode=function(e){for(var n=new P;e.hasMoreCharacters();){var o=e.getCurrentChar();e.pos++,this.encodeChar(o,n);var i=n.length();if(i%3===0){this.writeNextTriplet(e,n);var a=U.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(a!==this.getEncodingMode()){e.signalEncoderChange(W);break}}}this.handleEOD(e,n)},t.prototype.encodeChar=function(e,n){switch(e){case 13:n.append(0);break;case 42:n.append(1);break;case 62:n.append(2);break;case 32:n.append(3);break;default:e>=48&&e<=57?n.append(e-48+4):e>=65&&e<=90?n.append(e-65+14):U.illegalCharacter(F.getCharAt(e));break}return 1},t.prototype.handleEOD=function(e,n){e.updateSymbolInfo();var o=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount(),i=n.length();e.pos-=i,(e.getRemainingCharacters()>1||o>1||e.getRemainingCharacters()!==o)&&e.writeCodeword(Ha),e.getNewEncoding()<0&&e.signalEncoderChange(W)},t}(Fe);var ul=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),wo=function(r){ul(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.getEncodingMode=function(){return _t},t.prototype.encodeChar=function(e,n){if(e===32)return n.append(3),1;if(e>=48&&e<=57)return n.append(e-48+4),1;if(e>=97&&e<=122)return n.append(e-97+14),1;if(e<32)return n.append(0),n.append(e),2;if(e<=47)return n.append(1),n.append(e-33),2;if(e<=64)return n.append(1),n.append(e-58+15),2;if(e>=91&&e<=95)return n.append(1),n.append(e-91+22),2;if(e===96)return n.append(2),n.append(0),2;if(e<=90)return n.append(2),n.append(e-65+1),2;if(e<=127)return n.append(2),n.append(e-123+27),2;n.append("1");var o=2;return o+=this.encodeChar(e-128,n),o},t}(Fe);var ll=function(){function r(){}return r.randomize253State=function(t){var e=149*t%253+1,n=go+e;return n<=254?n:n-254},r.encodeHighLevel=function(t,e,n,o,i){e===void 0&&(e=0),n===void 0&&(n=null),o===void 0&&(o=null),i===void 0&&(i=!1);var a=new Fe,s=[new xo,a,new wo,new Ao,new Co,new yo],f=new Eo(t);f.setSymbolShape(e),f.setSizeConstraints(n,o),t.startsWith(tr)&&t.endsWith(rr)?(f.writeCodeword(Fa),f.setSkipAtEnd(2),f.pos+=tr.length):t.startsWith(er)&&t.endsWith(rr)&&(f.writeCodeword(La),f.setSkipAtEnd(2),f.pos+=er.length);var c=W;for(i&&(a.encodeMaximal(f),c=f.getNewEncoding(),f.resetEncoderSignal());f.hasMoreCharacters();)s[c].encode(f),f.getNewEncoding()>=0&&(c=f.getNewEncoding(),f.resetEncoderSignal());var u=f.getCodewordCount();f.updateSymbolInfo();var l=f.getSymbolInfo().getDataCapacity();u<l&&c!==W&&c!==At&&c!==gt&&f.writeCodeword("\xFE");var h=f.getCodewords();for(h.length()<l&&h.append(go);h.length()<l;)h.append(this.randomize253State(h.length()+1));return f.getCodewords().toString()},r.lookAheadTest=function(t,e,n){var o=this.lookAheadTestIntern(t,e,n);if(n===pt&&o===pt){for(var i=Math.min(e+3,t.length),a=e;a<i;a++)if(!this.isNativeX12(t.charCodeAt(a)))return W}else if(n===gt&&o===gt){for(var i=Math.min(e+4,t.length),a=e;a<i;a++)if(!this.isNativeEDIFACT(t.charCodeAt(a)))return W}return o},r.lookAheadTestIntern=function(t,e,n){if(e>=t.length)return n;var o;n===W?o=[0,1,1,1,1,1.25]:(o=[1,2,2,2,2,2.25],o[n]=0);for(var i=0,a=new Uint8Array(6),s=[];;){if(e+i===t.length){Z.fill(a,0),Z.fill(s,0);var f=this.findMinimums(o,s,M.MAX_VALUE,a),c=this.getMinimumCount(a);if(s[W]===f)return W;if(c===1){if(a[At]>0)return At;if(a[gt]>0)return gt;if(a[_t]>0)return _t;if(a[pt]>0)return pt}return yt}var u=t.charCodeAt(e+i);if(i++,this.isDigit(u)?o[W]+=.5:this.isExtendedASCII(u)?(o[W]=Math.ceil(o[W]),o[W]+=2):(o[W]=Math.ceil(o[W]),o[W]++),this.isNativeC40(u)?o[yt]+=2/3:this.isExtendedASCII(u)?o[yt]+=8/3:o[yt]+=4/3,this.isNativeText(u)?o[_t]+=2/3:this.isExtendedASCII(u)?o[_t]+=8/3:o[_t]+=4/3,this.isNativeX12(u)?o[pt]+=2/3:this.isExtendedASCII(u)?o[pt]+=13/3:o[pt]+=10/3,this.isNativeEDIFACT(u)?o[gt]+=3/4:this.isExtendedASCII(u)?o[gt]+=17/4:o[gt]+=13/4,this.isSpecialB256(u)?o[At]+=4:o[At]++,i>=4){if(Z.fill(a,0),Z.fill(s,0),this.findMinimums(o,s,M.MAX_VALUE,a),s[W]<this.min(s[At],s[yt],s[_t],s[pt],s[gt]))return W;if(s[At]<s[W]||s[At]+1<this.min(s[yt],s[_t],s[pt],s[gt]))return At;if(s[gt]+1<this.min(s[At],s[yt],s[_t],s[pt],s[W]))return gt;if(s[_t]+1<this.min(s[At],s[yt],s[gt],s[pt],s[W]))return _t;if(s[pt]+1<this.min(s[At],s[yt],s[gt],s[_t],s[W]))return pt;if(s[yt]+1<this.min(s[W],s[At],s[gt],s[_t])){if(s[yt]<s[pt])return yt;if(s[yt]===s[pt]){for(var l=e+i+1;l<t.length;){var h=t.charCodeAt(l);if(this.isX12TermSep(h))return pt;if(!this.isNativeX12(h))break;l++}return yt}}}}},r.min=function(t,e,n,o,i){var a=Math.min(t,Math.min(e,Math.min(n,o)));return i===void 0?a:Math.min(a,i)},r.findMinimums=function(t,e,n,o){for(var i=0;i<6;i++){var a=e[i]=Math.ceil(t[i]);n>a&&(n=a,Z.fill(o,0)),n===a&&(o[i]=o[i]+1)}return n},r.getMinimumCount=function(t){for(var e=0,n=0;n<6;n++)e+=t[n];return e||0},r.isDigit=function(t){return t>=48&&t<=57},r.isExtendedASCII=function(t){return t>=128&&t<=255},r.isNativeC40=function(t){return t===32||t>=48&&t<=57||t>=65&&t<=90},r.isNativeText=function(t){return t===32||t>=48&&t<=57||t>=97&&t<=122},r.isNativeX12=function(t){return this.isX12TermSep(t)||t===32||t>=48&&t<=57||t>=65&&t<=90},r.isX12TermSep=function(t){return t===13||t===42||t===62},r.isNativeEDIFACT=function(t){return t>=32&&t<=94},r.isSpecialB256=function(t){return!1},r.determineConsecutiveDigitCount=function(t,e){e===void 0&&(e=0);for(var n=t.length,o=e;o<n&&this.isDigit(t.charCodeAt(o));)o++;return o-e},r.illegalCharacter=function(t){var e=M.toHexString(t.charCodeAt(0));throw e="0000".substring(0,4-e.length)+e,new Error("Illegal character: "+t+" (0x"+e+")")},r}(),U=ll;var _o=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ga=function(){function r(t){this.charset=t,this.name=t.name}return r.prototype.canEncode=function(t){try{return Ct.encode(t,this.charset)!=null}catch{return!1}},r}(),za=function(){function r(t,e,n){var o,i,a,s,f,c;this.ENCODERS=["IBM437","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-6","ISO-8859-7","ISO-8859-8","ISO-8859-9","ISO-8859-10","ISO-8859-11","ISO-8859-13","ISO-8859-14","ISO-8859-15","ISO-8859-16","windows-1250","windows-1251","windows-1252","windows-1256","Shift_JIS"].map(function(k){return new Ga(Be.forName(k))}),this.encoders=[];var u=[];u.push(new Ga(_r.ISO_8859_1));for(var l=e!=null&&e.name.startsWith("UTF"),h=0;h<t.length;h++){var d=!1;try{for(var p=(o=void 0,_o(u)),v=p.next();!v.done;v=p.next()){var g=v.value,y=t.charAt(h),x=y.charCodeAt(0);if(x===n||g.canEncode(y)){d=!0;break}}}catch(k){o={error:k}}finally{try{v&&!v.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}if(!d)try{for(var C=(a=void 0,_o(this.ENCODERS)),w=C.next();!w.done;w=C.next()){var g=w.value;if(g.canEncode(t.charAt(h))){u.push(g),d=!0;break}}}catch(k){a={error:k}}finally{try{w&&!w.done&&(s=C.return)&&s.call(C)}finally{if(a)throw a.error}}d||(l=!0)}if(u.length===1&&!l)this.encoders=[u[0]];else{this.encoders=[];var _=0;try{for(var O=_o(u),R=O.next();!R.done;R=O.next()){var g=R.value;this.encoders[_++]=g}}catch(k){f={error:k}}finally{try{R&&!R.done&&(c=O.return)&&c.call(O)}finally{if(f)throw f.error}}}var N=-1;if(e!=null){for(var h=0;h<this.encoders.length;h++)if(this.encoders[h]!=null&&e.name===this.encoders[h].name){N=h;break}}this.priorityEncoderIndex=N}return r.prototype.length=function(){return this.encoders.length},r.prototype.getCharsetName=function(t){if(!(t<this.length()))throw new Error("index must be less than length");return this.encoders[t].name},r.prototype.getCharset=function(t){if(!(t<this.length()))throw new Error("index must be less than length");return this.encoders[t].charset},r.prototype.getECIValue=function(t){return this.encoders[t].charset.getValueIdentifier()},r.prototype.getPriorityEncoderIndex=function(){return this.priorityEncoderIndex},r.prototype.canEncode=function(t,e){if(!(e<this.length()))throw new Error("index must be less than length");return!0},r.prototype.encode=function(t,e){if(!(e<this.length()))throw new Error("index must be less than length");return Ct.encode(F.getCharAt(t),this.encoders[e].name)},r}();var hl=3,Xa=function(){function r(t,e,n){this.fnc1=n;var o=new za(t,e,n);if(o.length()===1)for(var i=0;i<this.bytes.length;i++){var a=t.charAt(i).charCodeAt(0);this.bytes[i]=a===n?1e3:a}else this.bytes=this.encodeMinimally(t,o,n)}return r.prototype.getFNC1Character=function(){return this.fnc1},r.prototype.length=function(){return this.bytes.length},r.prototype.haveNCharacters=function(t,e){if(t+e-1>=this.bytes.length)return!1;for(var n=0;n<e;n++)if(this.isECI(t+n))return!1;return!0},r.prototype.charAt=function(t){if(t<0||t>=this.length())throw new Error(""+t);if(this.isECI(t))throw new Error("value at "+t+" is not a character but an ECI");return this.isFNC1(t)?this.fnc1:this.bytes[t]},r.prototype.subSequence=function(t,e){if(t<0||t>e||e>this.length())throw new Error(""+t);for(var n=new P,o=t;o<e;o++){if(this.isECI(o))throw new Error("value at "+o+" is not a character but an ECI");n.append(this.charAt(o))}return n.toString()},r.prototype.isECI=function(t){if(t<0||t>=this.length())throw new Error(""+t);return this.bytes[t]>255&&this.bytes[t]<=999},r.prototype.isFNC1=function(t){if(t<0||t>=this.length())throw new Error(""+t);return this.bytes[t]===1e3},r.prototype.getECIValue=function(t){if(t<0||t>=this.length())throw new Error(""+t);if(!this.isECI(t))throw new Error("value at "+t+" is not an ECI but a character");return this.bytes[t]-256},r.prototype.addEdge=function(t,e,n){(t[e][n.encoderIndex]==null||t[e][n.encoderIndex].cachedTotalSize>n.cachedTotalSize)&&(t[e][n.encoderIndex]=n)},r.prototype.addEdges=function(t,e,n,o,i,a){var s=t.charAt(o).charCodeAt(0),f=0,c=e.length();e.getPriorityEncoderIndex()>=0&&(s===a||e.canEncode(s,e.getPriorityEncoderIndex()))&&(f=e.getPriorityEncoderIndex(),c=f+1);for(var u=f;u<c;u++)(s===a||e.canEncode(s,u))&&this.addEdge(n,o+1,new Wa(s,e,u,i,a))},r.prototype.encodeMinimally=function(t,e,n){var o=t.length,i=new Wa[o+1][e.length()];this.addEdges(t,e,i,0,null,n);for(var a=1;a<=o;a++){for(var s=0;s<e.length();s++)i[a][s]!=null&&a<o&&this.addEdges(t,e,i,a,i[a][s],n);for(var s=0;s<e.length();s++)i[a-1][s]=null}for(var f=-1,c=M.MAX_VALUE,s=0;s<e.length();s++)if(i[o][s]!=null){var u=i[o][s];u.cachedTotalSize<c&&(c=u.cachedTotalSize,f=s)}if(f<0)throw new Error('Failed to encode "'+t+'"');for(var l=[],h=i[o][f];h!=null;){if(h.isFNC1())l.unshift(1e3);else for(var d=e.encode(h.c,h.encoderIndex),a=d.length-1;a>=0;a--)l.unshift(d[a]&255);var p=h.previous===null?0:h.previous.encoderIndex;p!==h.encoderIndex&&l.unshift(256+e.getECIValue(h.encoderIndex)),h=h.previous}for(var v=[],a=0;a<v.length;a++)v[a]=l[a];return v},r}();var Wa=function(){function r(t,e,n,o,i){this.c=t,this.encoderSet=e,this.encoderIndex=n,this.previous=o,this.fnc1=i,this.c=t===i?1e3:t;var a=this.isFNC1()?1:e.encode(t,n).length,s=o===null?0:o.encoderIndex;s!==n&&(a+=hl),o!=null&&(a+=o.cachedTotalSize),this.cachedTotalSize=a}return r.prototype.isFNC1=function(){return this.c===1e3},r}();var dl=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ir=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},pl=function(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var n=e.call(r),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(a)throw a.error}}return i},vl=function(){for(var r=[],t=0;t<arguments.length;t++)r=r.concat(pl(arguments[t]));return r},b;(function(r){r[r.ASCII=0]="ASCII",r[r.C40=1]="C40",r[r.TEXT=2]="TEXT",r[r.X12=3]="X12",r[r.EDF=4]="EDF",r[r.B256=5]="B256"})(b||(b={}));var ml=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],It=function(){function r(){}return r.isExtendedASCII=function(t,e){return t!==e&&t>=128&&t<=255},r.isInC40Shift1Set=function(t){return t<=31},r.isInC40Shift2Set=function(t,e){var n,o;try{for(var i=Ir(ml),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.charCodeAt(0)===t)return!0}}catch(f){n={error:f}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return t===e},r.isInTextShift1Set=function(t){return this.isInC40Shift1Set(t)},r.isInTextShift2Set=function(t,e){return this.isInC40Shift2Set(t,e)},r.encodeHighLevel=function(t,e,n,o){e===void 0&&(e=null),n===void 0&&(n=-1),o===void 0&&(o=0);var i=0;return t.startsWith(tr)&&t.endsWith(rr)?(i=5,t=t.substring(tr.length,t.length-2)):t.startsWith(er)&&t.endsWith(rr)&&(i=6,t=t.substring(er.length,t.length-2)),decodeURIComponent(escape(String.fromCharCode.apply(String,vl(this.encode(t,e,n,o,i)))))},r.encode=function(t,e,n,o,i){return this.encodeMinimally(new xl(t,e,n,o,i)).getBytes()},r.addEdge=function(t,e){var n=e.fromPosition+e.characterLength;(t[n][e.getEndMode()]===null||t[n][e.getEndMode()].cachedTotalSize>e.cachedTotalSize)&&(t[n][e.getEndMode()]=e)},r.getNumberOfC40Words=function(t,e,n,o){for(var i=0,a=e;a<t.length();a++){if(t.isECI(a))return o[0]=0,0;var s=t.charAt(a);if(n&&U.isNativeC40(s)||!n&&U.isNativeText(s))i++;else if(!r.isExtendedASCII(s,t.getFNC1Character()))i+=2;else{var f=s&255;f>=128&&(n&&U.isNativeC40(f-128)||!n&&U.isNativeText(f-128))?i+=3:i+=4}if(i%3===0||(i-2)%3===0&&a+1===t.length())return o[0]=a-e+1,Math.ceil(i/3)}return o[0]=0,0},r.addEdges=function(t,e,n,o){var i,a;if(t.isECI(n)){this.addEdge(e,new jt(t,b.ASCII,n,1,o));return}var s=t.charAt(n);if(o===null||o.getEndMode()!==b.EDF){U.isDigit(s)&&t.haveNCharacters(n,2)&&U.isDigit(t.charAt(n+1))?this.addEdge(e,new jt(t,b.ASCII,n,2,o)):this.addEdge(e,new jt(t,b.ASCII,n,1,o));var f=[b.C40,b.TEXT];try{for(var c=Ir(f),u=c.next();!u.done;u=c.next()){var l=u.value,h=[];r.getNumberOfC40Words(t,n,l===b.C40,h)>0&&this.addEdge(e,new jt(t,l,n,h[0],o))}}catch(v){i={error:v}}finally{try{u&&!u.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}t.haveNCharacters(n,3)&&U.isNativeX12(t.charAt(n))&&U.isNativeX12(t.charAt(n+1))&&U.isNativeX12(t.charAt(n+2))&&this.addEdge(e,new jt(t,b.X12,n,3,o)),this.addEdge(e,new jt(t,b.B256,n,1,o))}var d;for(d=0;d<3;d++){var p=n+d;if(t.haveNCharacters(p,1)&&U.isNativeEDIFACT(t.charAt(p)))this.addEdge(e,new jt(t,b.EDF,n,d+1,o));else break}d===3&&t.haveNCharacters(n,4)&&U.isNativeEDIFACT(t.charAt(n+3))&&this.addEdge(e,new jt(t,b.EDF,n,4,o))},r.encodeMinimally=function(t){var e=t.length(),n=Array(e+1).fill(null).map(function(){return Array(6).fill(0)});this.addEdges(t,n,0,null);for(var o=1;o<=e;o++){for(var i=0;i<6;i++)n[o][i]!==null&&o<e&&this.addEdges(t,n,o,n[o][i]);for(var i=0;i<6;i++)n[o-1][i]=null}for(var a=-1,s=M.MAX_VALUE,i=0;i<6;i++)if(n[e][i]!==null){var f=n[e][i],c=i>=1&&i<=3?f.cachedTotalSize+1:f.cachedTotalSize;c<s&&(s=c,a=i)}if(a<0)throw new Error('Failed to encode "'+t+'"');return new gl(n[e][a])},r}();var gl=function(){function r(t){var e=t.input,n=0,o=[],i=[],a=[];(t.mode===b.C40||t.mode===b.TEXT||t.mode===b.X12)&&t.getEndMode()!==b.ASCII&&(n+=this.prepend(jt.getBytes(254),o));for(var s=t;s!==null;)n+=this.prepend(s.getDataBytes(),o),(s.previous===null||s.getPreviousStartMode()!==s.getMode())&&(s.getMode()===b.B256&&(n<=249?(o.unshift(n),n++):(o.unshift(n%250),o.unshift(n/250+249),n+=2),i.push(o.length),a.push(n)),this.prepend(s.getLatchBytes(),o),n=0),s=s.previous;e.getMacroId()===5?n+=this.prepend(jt.getBytes(236),o):e.getMacroId()===6&&(n+=this.prepend(jt.getBytes(237),o)),e.getFNC1Character()>0&&(n+=this.prepend(jt.getBytes(232),o));for(var f=0;f<i.length;f++)this.applyRandomPattern(o,o.length-i[f],a[f]);var c=t.getMinSymbolSize(o.length);for(o.length<c&&o.push(129);o.length<c;)o.push(this.randomize253State(o.length+1));this.bytes=new Uint8Array(o.length);for(var f=0;f<this.bytes.length;f++)this.bytes[f]=o[f]}return r.prototype.prepend=function(t,e){for(var n=t.length-1;n>=0;n--)e.unshift(t[n]);return t.length},r.prototype.randomize253State=function(t){var e=149*t%253+1,n=129+e;return n<=254?n:n-254},r.prototype.applyRandomPattern=function(t,e,n){for(var o=0;o<n;o++){var i=e+o,a=t[i]&255,s=149*(i+1)%255+1,f=a+s;t[i]=f<=255?f:f-256}},r.prototype.getBytes=function(){return this.bytes},r}(),jt=function(){function r(t,e,n,o,i){if(this.input=t,this.mode=e,this.fromPosition=n,this.characterLength=o,this.previous=i,this.allCodewordCapacities=[3,5,8,10,12,16,18,22,30,32,36,44,49,62,86,114,144,174,204,280,368,456,576,696,816,1050,1304,1558],this.squareCodewordCapacities=[3,5,8,12,18,22,30,36,44,62,86,114,144,174,204,280,368,456,576,696,816,1050,1304,1558],this.rectangularCodewordCapacities=[5,10,16,33,32,49],!(n+o<=t.length()))throw new Error("Invalid edge");var a=i!==null?i.cachedTotalSize:0,s=this.getPreviousMode();switch(e){case b.ASCII:a++,(t.isECI(n)||It.isExtendedASCII(t.charAt(n),t.getFNC1Character()))&&a++,(s===b.C40||s===b.TEXT||s===b.X12)&&a++;break;case b.B256:a++,(s!==b.B256||this.getB256Size()===250)&&a++,s===b.ASCII?a++:(s===b.C40||s===b.TEXT||s===b.X12)&&(a+=2);break;case b.C40:case b.TEXT:case b.X12:if(e===b.X12)a+=2;else{var f=[];a+=It.getNumberOfC40Words(t,n,e===b.C40,f)*2}s===b.ASCII||s===b.B256?a++:s!==e&&(s===b.C40||s===b.TEXT||s===b.X12)&&(a+=2);break;case b.EDF:a+=3,s===b.ASCII||s===b.B256?a++:(s===b.C40||s===b.TEXT||s===b.X12)&&(a+=2);break}this.cachedTotalSize=a}return r.prototype.getB256Size=function(){for(var t=0,e=this;e!==null&&e.mode===b.B256&&t<=250;)t++,e=e.previous;return t},r.prototype.getPreviousStartMode=function(){return this.previous===null?b.ASCII:this.previous.mode},r.prototype.getPreviousMode=function(){return this.previous===null?b.ASCII:this.previous.getEndMode()},r.prototype.getEndMode=function(){if(this.mode===b.EDF){if(this.characterLength<4)return b.ASCII;var t=this.getLastASCII();if(t>0&&this.getCodewordsRemaining(this.cachedTotalSize+t)<=2-t)return b.ASCII}if(this.mode===b.C40||this.mode===b.TEXT||this.mode===b.X12){if(this.fromPosition+this.characterLength>=this.input.length()&&this.getCodewordsRemaining(this.cachedTotalSize)===0)return b.ASCII;var t=this.getLastASCII();if(t===1&&this.getCodewordsRemaining(this.cachedTotalSize+1)===0)return b.ASCII}return this.mode},r.prototype.getMode=function(){return this.mode},r.prototype.getLastASCII=function(){var t=this.input.length(),e=this.fromPosition+this.characterLength;return t-e>4||e>=t?0:t-e===1?It.isExtendedASCII(this.input.charAt(e),this.input.getFNC1Character())?0:1:t-e===2?It.isExtendedASCII(this.input.charAt(e),this.input.getFNC1Character())||It.isExtendedASCII(this.input.charAt(e+1),this.input.getFNC1Character())?0:U.isDigit(this.input.charAt(e))&&U.isDigit(this.input.charAt(e+1))?1:2:t-e===3?U.isDigit(this.input.charAt(e))&&U.isDigit(this.input.charAt(e+1))&&!It.isExtendedASCII(this.input.charAt(e+2),this.input.getFNC1Character())||U.isDigit(this.input.charAt(e+1))&&U.isDigit(this.input.charAt(e+2))&&!It.isExtendedASCII(this.input.charAt(e),this.input.getFNC1Character())?2:0:U.isDigit(this.input.charAt(e))&&U.isDigit(this.input.charAt(e+1))&&U.isDigit(this.input.charAt(e+2))&&U.isDigit(this.input.charAt(e+3))?2:0},r.prototype.getMinSymbolSize=function(t){var e,n,o,i,a,s;switch(this.input.getShapeHint()){case 1:try{for(var f=Ir(this.squareCodewordCapacities),c=f.next();!c.done;c=f.next()){var u=c.value;if(u>=t)return u}}catch(v){e={error:v}}finally{try{c&&!c.done&&(n=f.return)&&n.call(f)}finally{if(e)throw e.error}}break;case 2:try{for(var l=Ir(this.rectangularCodewordCapacities),h=l.next();!h.done;h=l.next()){var u=h.value;if(u>=t)return u}}catch(v){o={error:v}}finally{try{h&&!h.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}break}try{for(var d=Ir(this.allCodewordCapacities),p=d.next();!p.done;p=d.next()){var u=p.value;if(u>=t)return u}}catch(v){a={error:v}}finally{try{p&&!p.done&&(s=d.return)&&s.call(d)}finally{if(a)throw a.error}}return this.allCodewordCapacities[this.allCodewordCapacities.length-1]},r.prototype.getCodewordsRemaining=function(t){return this.getMinSymbolSize(t)-t},r.getBytes=function(t,e){var n=new Uint8Array(e?2:1);return n[0]=t,e&&(n[1]=e),n},r.prototype.setC40Word=function(t,e,n,o,i){var a=1600*(n&255)+40*(o&255)+(i&255)+1;t[e]=a/256,t[e+1]=a%256},r.prototype.getX12Value=function(t){return t===13?0:t===42?1:t===62?2:t===32?3:t>=48&&t<=57?t-44:t>=65&&t<=90?t-51:t},r.prototype.getX12Words=function(){if(this.characterLength%3!==0)throw new Error("X12 words must be a multiple of 3");for(var t=new Uint8Array(this.characterLength/3*2),e=0;e<t.length;e+=2)this.setC40Word(t,e,this.getX12Value(this.input.charAt(this.fromPosition+e/2*3)),this.getX12Value(this.input.charAt(this.fromPosition+e/2*3+1)),this.getX12Value(this.input.charAt(this.fromPosition+e/2*3+2)));return t},r.prototype.getShiftValue=function(t,e,n){return e&&It.isInC40Shift1Set(t)||!e&&It.isInTextShift1Set(t)?0:e&&It.isInC40Shift2Set(t,n)||!e&&It.isInTextShift2Set(t,n)?1:2},r.prototype.getC40Value=function(t,e,n,o){if(n===o){if(e!==2)throw new Error("FNC1 cannot be used in C40 shift 2");return 27}return t?n<=31?n:n===32?3:n<=47?n-33:n<=57?n-44:n<=64?n-43:n<=90?n-51:n<=95?n-69:n<=127?n-96:n:n===0?0:e===0&&n<=3?n-1:e===1&&n<=31?n:n===32?3:n>=33&&n<=47?n-33:n>=48&&n<=57?n-44:n>=58&&n<=64?n-43:n>=65&&n<=90?n-64:n>=91&&n<=95?n-69:n===96?0:n>=97&&n<=122?n-83:n>=123&&n<=127?n-96:n},r.prototype.getC40Words=function(t,e){for(var n=[],o=0;o<this.characterLength;o++){var i=this.input.charAt(this.fromPosition+o);if(t&&U.isNativeC40(i)||!t&&U.isNativeText(i))n.push(this.getC40Value(t,0,i,e));else if(It.isExtendedASCII(i,e)){var s=(i&255)-128;if(t&&U.isNativeC40(s)||!t&&U.isNativeText(s))n.push(1),n.push(30),n.push(this.getC40Value(t,0,s,e));else{n.push(1),n.push(30);var a=this.getShiftValue(s,t,e);n.push(a),n.push(this.getC40Value(t,a,s,e))}}else{var a=this.getShiftValue(i,t,e);n.push(a),n.push(this.getC40Value(t,a,i,e))}}if(n.length%3!==0){if(!((n.length-2)%3===0&&this.fromPosition+this.characterLength===this.input.length()))throw new Error("C40 words must be a multiple of 3");n.push(0)}for(var f=new Uint8Array(n.length/3*2),c=0,o=0;o<n.length;o+=3)this.setC40Word(f,c,n[o]&255,n[o+1]&255,n[o+2]&255),c+=2;return f},r.prototype.getEDFBytes=function(){for(var t=Math.ceil(this.characterLength/4),e=new Uint8Array(t*3),n=this.fromPosition,o=Math.min(this.fromPosition+this.characterLength-1,this.input.length()-1),i=0;i<t;i+=3){for(var a=[],s=0;s<4;s++)n<=o?a[s]=this.input.charAt(n++)&63:a[s]=n===o+1?31:0;var f=a[0]<<18;f|=a[1]<<12,f|=a[2]<<6,f|=a[3],e[i]=f>>16&255,e[i+1]=f>>8&255,e[i+2]=f&255}return e},r.prototype.getLatchBytes=function(){switch(this.getPreviousMode()){case b.ASCII:case b.B256:switch(this.mode){case b.B256:return r.getBytes(231);case b.C40:return r.getBytes(230);case b.TEXT:return r.getBytes(239);case b.X12:return r.getBytes(238);case b.EDF:return r.getBytes(240)}break;case b.C40:case b.TEXT:case b.X12:if(this.mode!==this.getPreviousMode())switch(this.mode){case b.ASCII:return r.getBytes(254);case b.B256:return r.getBytes(254,231);case b.C40:return r.getBytes(254,230);case b.TEXT:return r.getBytes(254,239);case b.X12:return r.getBytes(254,238);case b.EDF:return r.getBytes(254,240)}break;case b.EDF:if(this.mode!==b.EDF)throw new Error("Cannot switch from EDF to "+this.mode);break}return new Uint8Array(0)},r.prototype.getDataBytes=function(){switch(this.mode){case b.ASCII:return this.input.isECI(this.fromPosition)?r.getBytes(241,this.input.getECIValue(this.fromPosition)+1):It.isExtendedASCII(this.input.charAt(this.fromPosition),this.input.getFNC1Character())?r.getBytes(235,this.input.charAt(this.fromPosition)-127):this.characterLength===2?r.getBytes(this.input.charAt(this.fromPosition)*10+this.input.charAt(this.fromPosition+1)+130):this.input.isFNC1(this.fromPosition)?r.getBytes(232):r.getBytes(this.input.charAt(this.fromPosition)+1);case b.B256:return r.getBytes(this.input.charAt(this.fromPosition));case b.C40:return this.getC40Words(!0,this.input.getFNC1Character());case b.TEXT:return this.getC40Words(!1,this.input.getFNC1Character());case b.X12:return this.getX12Words();case b.EDF:return this.getEDFBytes()}},r}(),xl=function(r){dl(t,r);function t(e,n,o,i,a){var s=r.call(this,e,n,o)||this;return s.shape=i,s.macroId=a,s}return t.prototype.getMacroId=function(){return this.macroId},t.prototype.getShapeHint=function(){return this.shape},t}(Xa);var w_=function(){function r(){}return r.prototype.encode=function(t,e,n,o,i){if(i===void 0&&(i=null),t.trim()==="")throw new Error("Found empty contents");if(e!==T.DATA_MATRIX)throw new Error("Can only encode DATA_MATRIX, but got "+e);if(n<0||o<0)throw new Error("Requested dimensions can't be negative: "+n+"x"+o);var a=0,s=null,f=null;if(i!=null){var c=i.get(V.DATA_MATRIX_SHAPE);c!=null&&(a=c);var u=i.get(V.MIN_SIZE);u!=null&&(s=u);var l=i.get(V.MAX_SIZE);l!=null&&(f=l)}var h,d=i!=null&&i.has(V.DATA_MATRIX_COMPACT)&&!!i.get(V.DATA_MATRIX_COMPACT).toString();if(d){var p=i.has(V.GS1_FORMAT)&&!!i.get(V.GS1_FORMAT).toString(),v=null,g=i.has(V.CHARACTER_SET);g&&(v=Be.forName(i.get(V.CHARACTER_SET).toString())),h=It.encodeHighLevel(t,v,p?29:-1,a)}else{var y=i!=null&&i.has(V.FORCE_C40)&&!!i.get(V.FORCE_C40).toString();h=U.encodeHighLevel(t,a,s,f,y)}var x=nr.lookup(h.length,a,s,f,!0),C=pn.encodeECC200(h,x),w=new ln(C,x.getSymbolDataWidth(),x.getSymbolDataHeight());return w.place(),this.encodeLowLevel(w,x,n,o)},r.prototype.encodeLowLevel=function(t,e,n,o){for(var i=e.getSymbolDataWidth(),a=e.getSymbolDataHeight(),s=new wr(e.getSymbolWidth(),e.getSymbolHeight()),f=0,c=0;c<a;c++){var u=void 0;if(c%e.matrixHeight===0){u=0;for(var l=0;l<e.getSymbolWidth();l++)s.setBoolean(u,f,l%2===0),u++;f++}u=0;for(var l=0;l<i;l++)l%e.matrixWidth===0&&(s.setBoolean(u,f,!0),u++),s.setBoolean(u,f,t.getBit(l,c)),u++,l%e.matrixWidth===e.matrixWidth-1&&(s.setBoolean(u,f,c%2===0),u++);if(f++,c%e.matrixHeight===e.matrixHeight-1){u=0;for(var l=0;l<e.getSymbolWidth();l++)s.setBoolean(u,f,!0),u++;f++}}return this.convertByteMatrixToBitMatrix(s,n,o)},r.prototype.convertByteMatrixToBitMatrix=function(t,e,n){var o=t.getWidth(),i=t.getHeight(),a=Math.max(e,o),s=Math.max(n,i),f=Math.min(a/o,s/i),c=(a-o*f)/2,u=(s-i*f)/2,l;n<i||e<o?(c=0,u=0,l=new at(o,i)):l=new at(e,n),l.clear();for(var h=0,d=u;h<i;h++,d+=f)for(var p=0,v=c;p<o;p++,v+=f)t.get(p,h)===1&&l.setRegion(v,d,f,f);return l},r}();var yl=function(){function r(){}return r.prototype.isCompact=function(){return this.compact},r.prototype.setCompact=function(t){this.compact=t},r.prototype.getSize=function(){return this.size},r.prototype.setSize=function(t){this.size=t},r.prototype.getLayers=function(){return this.layers},r.prototype.setLayers=function(t){this.layers=t},r.prototype.getCodeWords=function(){return this.codeWords},r.prototype.setCodeWords=function(t){this.codeWords=t},r.prototype.getMatrix=function(){return this.matrix},r.prototype.setMatrix=function(t){this.matrix=t},r}(),So=yl;var Cl=function(){function r(){}return r.singletonList=function(t){return[t]},r.min=function(t,e){return t.sort(e)[0]},r}(),Io=Cl;var El=function(){function r(t){this.previous=t}return r.prototype.getPrevious=function(){return this.previous},r}(),ja=El;var Al=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),wl=function(r){Al(t,r);function t(e,n,o){var i=r.call(this,e)||this;return i.value=n,i.bitCount=o,i}return t.prototype.appendTo=function(e,n){e.appendBits(this.value,this.bitCount)},t.prototype.add=function(e,n){return new t(this,e,n)},t.prototype.addBinaryShift=function(e,n){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new t(this,e,n)},t.prototype.toString=function(){var e=this.value&(1<<this.bitCount)-1;return e|=1<<this.bitCount,"<"+M.toBinaryString(e|1<<this.bitCount).substring(1)+">"},t}(ja),or=wl;var _l=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Sl=function(r){_l(t,r);function t(e,n,o){var i=r.call(this,e,0,0)||this;return i.binaryShiftStart=n,i.binaryShiftByteCount=o,i}return t.prototype.appendTo=function(e,n){for(var o=0;o<this.binaryShiftByteCount;o++)(o===0||o===31&&this.binaryShiftByteCount<=62)&&(e.appendBits(31,5),this.binaryShiftByteCount>62?e.appendBits(this.binaryShiftByteCount-31,16):o===0?e.appendBits(Math.min(this.binaryShiftByteCount,31),5):e.appendBits(this.binaryShiftByteCount-31,5)),e.appendBits(n[this.binaryShiftStart+o],8)},t.prototype.addBinaryShift=function(e,n){return new t(this,e,n)},t.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"},t}(or),Ya=Sl;function Za(r,t,e){return new Ya(r,t,e)}function ir(r,t,e){return new or(r,t,e)}var Ka=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],Kt=0,ar=1,Ot=2,vn=3,Lt=4,Qa=new or(null,0,0);var gn=[Int32Array.from([0,327708,327710,327709,656318]),Int32Array.from([590318,0,327710,327709,656318]),Int32Array.from([262158,590300,0,590301,932798]),Int32Array.from([327709,327708,656318,0,327710]),Int32Array.from([327711,656380,656382,656381,0])];var Tl=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function Rl(r){var t,e;try{for(var n=Tl(r),o=n.next();!o.done;o=n.next()){var i=o.value;Z.fill(i,-1)}}catch(a){t={error:a}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return r[Kt][Lt]=0,r[ar][Lt]=0,r[ar][Kt]=28,r[vn][Lt]=0,r[Ot][Lt]=0,r[Ot][Kt]=15,r}var xn=Rl(Z.createInt32Array(6,6));var Dl=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},bl=function(){function r(t,e,n,o){this.token=t,this.mode=e,this.binaryShiftByteCount=n,this.bitCount=o}return r.prototype.getMode=function(){return this.mode},r.prototype.getToken=function(){return this.token},r.prototype.getBinaryShiftByteCount=function(){return this.binaryShiftByteCount},r.prototype.getBitCount=function(){return this.bitCount},r.prototype.latchAndAppend=function(t,e){var n=this.bitCount,o=this.token;if(t!==this.mode){var i=gn[this.mode][t];o=ir(o,i&65535,i>>16),n+=i>>16}var a=t===Ot?4:5;return o=ir(o,e,a),new r(o,t,0,n+a)},r.prototype.shiftAndAppend=function(t,e){var n=this.token,o=this.mode===Ot?4:5;return n=ir(n,xn[this.mode][t],o),n=ir(n,e,5),new r(n,this.mode,0,this.bitCount+o+5)},r.prototype.addBinaryShiftChar=function(t){var e=this.token,n=this.mode,o=this.bitCount;if(this.mode===Lt||this.mode===Ot){var i=gn[n][Kt];e=ir(e,i&65535,i>>16),o+=i>>16,n=Kt}var a=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,s=new r(e,n,this.binaryShiftByteCount+1,o+a);return s.binaryShiftByteCount===2078&&(s=s.endBinaryShift(t+1)),s},r.prototype.endBinaryShift=function(t){if(this.binaryShiftByteCount===0)return this;var e=this.token;return e=Za(e,t-this.binaryShiftByteCount,this.binaryShiftByteCount),new r(e,this.mode,0,this.bitCount)},r.prototype.isBetterThanOrEqualTo=function(t){var e=this.bitCount+(gn[this.mode][t.mode]>>16);return this.binaryShiftByteCount<t.binaryShiftByteCount?e+=r.calculateBinaryShiftCost(t)-r.calculateBinaryShiftCost(this):this.binaryShiftByteCount>t.binaryShiftByteCount&&t.binaryShiftByteCount>0&&(e+=10),e<=t.bitCount},r.prototype.toBitArray=function(t){for(var e,n,o=[],i=this.endBinaryShift(t.length).token;i!==null;i=i.getPrevious())o.unshift(i);var a=new ot;try{for(var s=Dl(o),f=s.next();!f.done;f=s.next()){var c=f.value;c.appendTo(a,t)}}catch(u){e={error:u}}finally{try{f&&!f.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return a},r.prototype.toString=function(){return F.format("%s bits=%d bytes=%d",Ka[this.mode],this.bitCount,this.binaryShiftByteCount)},r.calculateBinaryShiftCost=function(t){return t.binaryShiftByteCount>62?21:t.binaryShiftByteCount>31?20:t.binaryShiftByteCount>0?10:0},r.INITIAL_STATE=new r(Qa,Kt,0,0),r}(),$a=bl;function Nl(r){var t=F.getCharCode(" "),e=F.getCharCode("."),n=F.getCharCode(",");r[Kt][t]=1;for(var o=F.getCharCode("Z"),i=F.getCharCode("A"),a=i;a<=o;a++)r[Kt][a]=a-i+2;r[ar][t]=1;for(var s=F.getCharCode("z"),f=F.getCharCode("a"),a=f;a<=s;a++)r[ar][a]=a-f+2;r[Ot][t]=1;for(var c=F.getCharCode("9"),u=F.getCharCode("0"),a=u;a<=c;a++)r[Ot][a]=a-u+2;r[Ot][n]=12,r[Ot][e]=13;for(var l=["\0"," ","","","","","","","\x07","\b","	",`
`,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~","\x7F"],h=0;h<l.length;h++)r[vn][F.getCharCode(l[h])]=h;for(var d=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"],h=0;h<d.length;h++)F.getCharCode(d[h])>0&&(r[Lt][F.getCharCode(d[h])]=h);return r}var yn=Nl(Z.createInt32Array(5,256));var Cn=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ml=function(){function r(t){this.text=t}return r.prototype.encode=function(){for(var t=F.getCharCode(" "),e=F.getCharCode(`
`),n=Io.singletonList($a.INITIAL_STATE),o=0;o<this.text.length;o++){var i=void 0,a=o+1<this.text.length?this.text[o+1]:0;switch(this.text[o]){case F.getCharCode("\r"):i=a===e?2:0;break;case F.getCharCode("."):i=a===t?3:0;break;case F.getCharCode(","):i=a===t?4:0;break;case F.getCharCode(":"):i=a===t?5:0;break;default:i=0}i>0?(n=r.updateStateListForPair(n,o,i),o++):n=this.updateStateListForChar(n,o)}var s=Io.min(n,function(f,c){return f.getBitCount()-c.getBitCount()});return s.toBitArray(this.text)},r.prototype.updateStateListForChar=function(t,e){var n,o,i=[];try{for(var a=Cn(t),s=a.next();!s.done;s=a.next()){var f=s.value;this.updateStateForChar(f,e,i)}}catch(c){n={error:c}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}return r.simplifyStates(i)},r.prototype.updateStateForChar=function(t,e,n){for(var o=this.text[e]&255,i=yn[t.getMode()][o]>0,a=null,s=0;s<=Lt;s++){var f=yn[s][o];if(f>0){if(a==null&&(a=t.endBinaryShift(e)),!i||s===t.getMode()||s===Ot){var c=a.latchAndAppend(s,f);n.push(c)}if(!i&&xn[t.getMode()][s]>=0){var u=a.shiftAndAppend(s,f);n.push(u)}}}if(t.getBinaryShiftByteCount()>0||yn[t.getMode()][o]===0){var l=t.addBinaryShiftChar(e);n.push(l)}},r.updateStateListForPair=function(t,e,n){var o,i,a=[];try{for(var s=Cn(t),f=s.next();!f.done;f=s.next()){var c=f.value;this.updateStateForPair(c,e,n,a)}}catch(u){o={error:u}}finally{try{f&&!f.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}return this.simplifyStates(a)},r.updateStateForPair=function(t,e,n,o){var i=t.endBinaryShift(e);if(o.push(i.latchAndAppend(Lt,n)),t.getMode()!==Lt&&o.push(i.shiftAndAppend(Lt,n)),n===3||n===4){var a=i.latchAndAppend(Ot,16-n).latchAndAppend(Ot,1);o.push(a)}if(t.getBinaryShiftByteCount()>0){var s=t.addBinaryShiftChar(e).addBinaryShiftChar(e+1);o.push(s)}},r.simplifyStates=function(t){var e,n,o,i,a=[];try{for(var s=Cn(t),f=s.next();!f.done;f=s.next()){var c=f.value,u=!0,l=function(g){if(g.isBetterThanOrEqualTo(c))return u=!1,"break";c.isBetterThanOrEqualTo(g)&&(a=a.filter(function(y){return y!==g}))};try{for(var h=(o=void 0,Cn(a)),d=h.next();!d.done;d=h.next()){var p=d.value,v=l(p);if(v==="break")break}}catch(g){o={error:g}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}u&&a.push(c)}}catch(g){e={error:g}}finally{try{f&&!f.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return a},r}(),Oo=Ml;var Bl=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Fl=function(){function r(){}return r.encodeBytes=function(t){return r.encode(t,r.DEFAULT_EC_PERCENT,r.DEFAULT_AZTEC_LAYERS)},r.encode=function(t,e,n){var o=new Oo(t).encode(),i=M.truncDivision(o.getSize()*e,100)+11,a=o.getSize()+i,s,f,c,u,l;if(n!==r.DEFAULT_AZTEC_LAYERS){if(s=n<0,f=Math.abs(n),f>(s?r.MAX_NB_BITS_COMPACT:r.MAX_NB_BITS))throw new I(F.format("Illegal value %s for layers",n));c=r.totalBitsInLayer(f,s),u=r.WORD_SIZE[f];var h=c-c%u;if(l=r.stuffBits(o,u),l.getSize()+i>h)throw new I("Data to large for user specified layer");if(s&&l.getSize()>u*64)throw new I("Data to large for user specified layer")}else{u=0,l=null;for(var d=0;;d++){if(d>r.MAX_NB_BITS)throw new I("Data too large for an Aztec code");if(s=d<=3,f=s?d+1:d,c=r.totalBitsInLayer(f,s),!(a>c)){(l==null||u!==r.WORD_SIZE[f])&&(u=r.WORD_SIZE[f],l=r.stuffBits(o,u));var h=c-c%u;if(!(s&&l.getSize()>u*64)&&l.getSize()+i<=h)break}}}var p=r.generateCheckWords(l,c,u),v=l.getSize()/u,g=r.generateModeMessage(s,f,v),y=(s?11:14)+f*4,x=new Int32Array(y),C;if(s){C=y;for(var d=0;d<x.length;d++)x[d]=d}else{C=y+1+2*M.truncDivision(M.truncDivision(y,2)-1,15);for(var w=M.truncDivision(y,2),_=M.truncDivision(C,2),d=0;d<w;d++){var O=d+M.truncDivision(d,15);x[w-d-1]=_-O-1,x[w+d]=_+O+1}}for(var R=new at(C),d=0,N=0;d<f;d++){for(var k=(f-d)*4+(s?9:12),B=0;B<k;B++)for(var vt=B*2,j=0;j<2;j++)p.get(N+vt+j)&&R.set(x[d*2+j],x[d*2+B]),p.get(N+k*2+vt+j)&&R.set(x[d*2+B],x[y-1-d*2-j]),p.get(N+k*4+vt+j)&&R.set(x[y-1-d*2-j],x[y-1-d*2-B]),p.get(N+k*6+vt+j)&&R.set(x[y-1-d*2-B],x[d*2+j]);N+=k*8}if(r.drawModeMessage(R,s,C,g),s)r.drawBullsEye(R,M.truncDivision(C,2),5);else{r.drawBullsEye(R,M.truncDivision(C,2),7);for(var d=0,B=0;d<M.truncDivision(y,2)-1;d+=15,B+=16)for(var j=M.truncDivision(C,2)&1;j<C;j+=2)R.set(M.truncDivision(C,2)-B,j),R.set(M.truncDivision(C,2)+B,j),R.set(j,M.truncDivision(C,2)-B),R.set(j,M.truncDivision(C,2)+B)}var ct=new So;return ct.setCompact(s),ct.setSize(C),ct.setLayers(f),ct.setCodeWords(v),ct.setMatrix(R),ct},r.drawBullsEye=function(t,e,n){for(var o=0;o<n;o+=2)for(var i=e-o;i<=e+o;i++)t.set(i,e-o),t.set(i,e+o),t.set(e-o,i),t.set(e+o,i);t.set(e-n,e-n),t.set(e-n+1,e-n),t.set(e-n,e-n+1),t.set(e+n,e-n),t.set(e+n,e-n+1),t.set(e+n,e+n-1)},r.generateModeMessage=function(t,e,n){var o=new ot;return t?(o.appendBits(e-1,2),o.appendBits(n-1,6),o=r.generateCheckWords(o,28,4)):(o.appendBits(e-1,5),o.appendBits(n-1,11),o=r.generateCheckWords(o,40,4)),o},r.drawModeMessage=function(t,e,n,o){var i=M.truncDivision(n,2);if(e)for(var a=0;a<7;a++){var s=i-3+a;o.get(a)&&t.set(s,i-5),o.get(a+7)&&t.set(i+5,s),o.get(20-a)&&t.set(s,i+5),o.get(27-a)&&t.set(i-5,s)}else for(var a=0;a<10;a++){var s=i-5+a+M.truncDivision(a,5);o.get(a)&&t.set(s,i-7),o.get(a+10)&&t.set(i+7,s),o.get(29-a)&&t.set(s,i+7),o.get(39-a)&&t.set(i-7,s)}},r.generateCheckWords=function(t,e,n){var o,i,a=t.getSize()/n,s=new Ar(r.getGF(n)),f=M.truncDivision(e,n),c=r.bitsToWords(t,n,f);s.encode(c,f-a);var u=e%n,l=new ot;l.appendBits(0,u);try{for(var h=Bl(Array.from(c)),d=h.next();!d.done;d=h.next()){var p=d.value;l.appendBits(p,n)}}catch(v){o={error:v}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}return l},r.bitsToWords=function(t,e,n){var o=new Int32Array(n),i,a;for(i=0,a=t.getSize()/e;i<a;i++){for(var s=0,f=0;f<e;f++)s|=t.get(i*e+f)?1<<e-f-1:0;o[i]=s}return o},r.getGF=function(t){switch(t){case 4:return dt.AZTEC_PARAM;case 6:return dt.AZTEC_DATA_6;case 8:return dt.AZTEC_DATA_8;case 10:return dt.AZTEC_DATA_10;case 12:return dt.AZTEC_DATA_12;default:throw new I("Unsupported word size "+t)}},r.stuffBits=function(t,e){for(var n=new ot,o=t.getSize(),i=(1<<e)-2,a=0;a<o;a+=e){for(var s=0,f=0;f<e;f++)(a+f>=o||t.get(a+f))&&(s|=1<<e-1-f);(s&i)===i?(n.appendBits(s&i,e),a--):s&i?n.appendBits(s,e):(n.appendBits(s|1,e),a--)}return n},r.totalBitsInLayer=function(t,e){return((e?88:112)+16*t)*t},r.DEFAULT_EC_PERCENT=33,r.DEFAULT_AZTEC_LAYERS=0,r.MAX_NB_BITS=32,r.MAX_NB_BITS_COMPACT=4,r.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]),r}(),Or=Fl;var h8=function(){function r(){}return r.prototype.encode=function(t,e,n,o){return this.encodeWithHints(t,e,n,o,null)},r.prototype.encodeWithHints=function(t,e,n,o,i){var a=_r.ISO_8859_1,s=Or.DEFAULT_EC_PERCENT,f=Or.DEFAULT_AZTEC_LAYERS;return i!=null&&(i.has(V.CHARACTER_SET)&&(a=Be.forName(i.get(V.CHARACTER_SET).toString())),i.has(V.ERROR_CORRECTION)&&(s=M.parseInt(i.get(V.ERROR_CORRECTION).toString())),i.has(V.AZTEC_LAYERS)&&(f=M.parseInt(i.get(V.AZTEC_LAYERS).toString()))),r.encodeLayers(t,e,n,o,a,s,f)},r.encodeLayers=function(t,e,n,o,i,a,s){if(e!==T.AZTEC)throw new I("Can only encode AZTEC, but got "+e);var f=Or.encode(F.getBytes(t,i),a,s);return r.renderResult(f,n,o)},r.renderResult=function(t,e,n){var o=t.getMatrix();if(o==null)throw new mt;for(var i=o.getWidth(),a=o.getHeight(),s=Math.max(e,i),f=Math.max(n,a),c=Math.min(s/i,f/a),u=(s-i*c)/2,l=(f-a*c)/2,h=new at(s,f),d=0,p=l;d<a;d++,p+=c)for(var v=0,g=u;v<i;v++,g+=c)o.get(v,d)&&h.setRegion(g,p,c,c);return h},r}();var Ll=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ja=function(r){Ll(t,r);function t(e){var n=r.call(this,e.width,e.height)||this;return n.canvas=e,n.tempCanvasElement=null,n.buffer=t.makeBufferFromCanvasImageData(e),n}return t.makeBufferFromCanvasImageData=function(e){var n=e.getContext("2d");if(!n)throw new Error("Couldn't get canvas context.");var o=n.getImageData(0,0,e.width,e.height);return t.toGrayscaleBuffer(o.data,e.width,e.height)},t.toGrayscaleBuffer=function(e,n,o){for(var i=new Uint8ClampedArray(n*o),a=0,s=0,f=e.length;a<f;a+=4,s++){var c=void 0,u=e[a+3];if(u===0)c=255;else{var l=e[a],h=e[a+1],d=e[a+2];c=306*l+601*h+117*d+512>>10}i[s]=c}return i},t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new I("Requested row is outside the image: "+e);var o=this.getWidth(),i=e*o;return n===null?n=this.buffer.slice(i,i+o):(n.length<o&&(n=new Uint8ClampedArray(o)),n.set(this.buffer.slice(i,i+o))),n},t.prototype.getMatrix=function(){return this.buffer},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,n,o,i){return r.prototype.crop.call(this,e,n,o,i),this},t.prototype.isRotateSupported=function(){return!0},t.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},t.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},t.prototype.invert=function(){return new ne(this)},t.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var e=this.canvas.ownerDocument.createElement("canvas");e.width=this.canvas.width,e.height=this.canvas.height,this.tempCanvasElement=e}return this.tempCanvasElement},t.prototype.rotate=function(e){var n=this.getTempCanvasElement();if(!n)throw new Error("Could not create a Canvas element.");var o=e*t.DEGREE_TO_RADIANS,i=this.canvas.width,a=this.canvas.height,s=Math.ceil(Math.abs(Math.cos(o))*i+Math.abs(Math.sin(o))*a),f=Math.ceil(Math.abs(Math.sin(o))*i+Math.abs(Math.cos(o))*a);n.width=s,n.height=f;var c=n.getContext("2d");if(!c)throw new Error("Could not create a Canvas Context element.");return c.translate(s/2,f/2),c.rotate(o),c.drawImage(this.canvas,i/-2,a/-2),this.buffer=t.makeBufferFromCanvasImageData(n),this},t.DEGREE_TO_RADIANS=Math.PI/180,t}(Yt);function To(){return typeof navigator<"u"}function kl(){return To()&&!!navigator.mediaDevices}function ts(){return!!(kl()&&navigator.mediaDevices.enumerateDevices)}var sr=function(){return sr=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++){t=arguments[e];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o])}return r},sr.apply(this,arguments)},lt=function(r,t,e,n){function o(i){return i instanceof e?i:new e(function(a){a(i)})}return new(e||(e=Promise))(function(i,a){function s(u){try{c(n.next(u))}catch(l){a(l)}}function f(u){try{c(n.throw(u))}catch(l){a(l)}}function c(u){u.done?i(u.value):o(u.value).then(s,f)}c((n=n.apply(r,t||[])).next())})},ht=function(r,t){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(u){return f([c,u])}}function f(c){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,o&&(i=c[0]&2?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return e.label++,{value:c[1],done:!1};case 5:e.label++,o=c[1],c=[0];continue;case 7:c=e.ops.pop(),e.trys.pop();continue;default:if(i=e.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){e.label=c[1];break}if(c[0]===6&&e.label<i[1]){e.label=i[1],i=c;break}if(i&&e.label<i[2]){e.label=i[2],e.ops.push(c);break}i[2]&&e.ops.pop(),e.trys.pop();continue}c=t.call(r,e)}catch(u){c=[6,u],o=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Ro=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ul={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},Bt=function(){function r(t,e,n){e===void 0&&(e=new Map),n===void 0&&(n={}),this.reader=t,this.hints=e,this.options=sr(sr({},Ul),n)}return Object.defineProperty(r.prototype,"possibleFormats",{set:function(t){this.hints.set(L.POSSIBLE_FORMATS,t)},enumerable:!1,configurable:!0}),r.addVideoSource=function(t,e){try{t.srcObject=e}catch{console.error("got interrupted by new loading request")}},r.mediaStreamSetTorch=function(t,e){return lt(this,void 0,void 0,function(){return ht(this,function(n){switch(n.label){case 0:return[4,t.applyConstraints({advanced:[{fillLightMode:e?"flash":"off",torch:!!e}]})];case 1:return n.sent(),[2]}})})},r.mediaStreamIsTorchCompatible=function(t){var e,n,o=t.getVideoTracks();try{for(var i=Ro(o),a=i.next();!a.done;a=i.next()){var s=a.value;if(r.mediaStreamIsTorchCompatibleTrack(s))return!0}}catch(f){e={error:f}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return!1},r.mediaStreamIsTorchCompatibleTrack=function(t){try{var e=t.getCapabilities();return"torch"in e}catch(n){return console.error(n),console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),!1}},r.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&t.readyState>2},r.getMediaElement=function(t,e){var n=document.getElementById(t);if(!n)throw new ft("element with id '".concat(t,"' not found"));if(n.nodeName.toLowerCase()!==e.toLowerCase())throw new ft("element with id '".concat(t,"' must be an ").concat(e," element"));return n},r.createVideoElement=function(t){if(t instanceof HTMLVideoElement)return t;if(typeof t=="string")return r.getMediaElement(t,"video");if(!t&&typeof document<"u"){var e=document.createElement("video");return e.width=200,e.height=200,e}throw new Error("Couldn't get videoElement from videoSource!")},r.prepareImageElement=function(t){if(t instanceof HTMLImageElement)return t;if(typeof t=="string")return r.getMediaElement(t,"img");if(typeof t>"u"){var e=document.createElement("img");return e.width=200,e.height=200,e}throw new Error("Couldn't get imageElement from imageSource!")},r.prepareVideoElement=function(t){var e=r.createVideoElement(t);return e.setAttribute("autoplay","true"),e.setAttribute("muted","true"),e.setAttribute("playsinline","true"),e},r.isImageLoaded=function(t){return!(!t.complete||t.naturalWidth===0)},r.createBinaryBitmapFromCanvas=function(t){var e=new Ja(t),n=new lr(e);return new ur(n)},r.drawImageOnCanvas=function(t,e){t.drawImage(e,0,0)},r.getMediaElementDimensions=function(t){if(t instanceof HTMLVideoElement)return{height:t.videoHeight,width:t.videoWidth};if(t instanceof HTMLImageElement)return{height:t.naturalHeight||t.height,width:t.naturalWidth||t.width};throw new Error("Couldn't find the Source's dimensions!")},r.createCaptureCanvas=function(t){if(!t)throw new ft("Cannot create a capture canvas without a media element.");if(typeof document>"u")throw new Error(`The page "Document" is undefined, make sure you're running in a browser.`);var e=document.createElement("canvas"),n=r.getMediaElementDimensions(t),o=n.width,i=n.height;return e.style.width=o+"px",e.style.height=i+"px",e.width=o,e.height=i,e},r.tryPlayVideo=function(t){return lt(this,void 0,void 0,function(){var e;return ht(this,function(n){switch(n.label){case 0:if(t?.ended)return console.error("Trying to play video that has ended."),[2,!1];if(r.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2,!0];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.play()];case 2:return n.sent(),[2,!0];case 3:return e=n.sent(),console.warn("It was not possible to play the video.",e),[2,!1];case 4:return[2]}})})},r.createCanvasFromMediaElement=function(t){var e=r.createCaptureCanvas(t),n=e.getContext("2d");if(!n)throw new Error("Couldn't find Canvas 2D Context.");return r.drawImageOnCanvas(n,t),e},r.createBinaryBitmapFromMediaElem=function(t){var e=r.createCanvasFromMediaElement(t);return r.createBinaryBitmapFromCanvas(e)},r.destroyImageElement=function(t){t.src="",t.removeAttribute("src"),t=void 0},r.listVideoInputDevices=function(){return lt(this,void 0,void 0,function(){var t,e,n,o,i,a,s,f,c,u,l,h;return ht(this,function(d){switch(d.label){case 0:if(!To())throw new Error("Can't enumerate devices, navigator is not present.");if(!ts())throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=d.sent(),e=[];try{for(n=Ro(t),o=n.next();!o.done;o=n.next())i=o.value,a=i.kind==="video"?"videoinput":i.kind,a==="videoinput"&&(s=i.deviceId||i.id,f=i.label||"Video device ".concat(e.length+1),c=i.groupId,u={deviceId:s,label:f,kind:a,groupId:c},e.push(u))}catch(p){l={error:p}}finally{try{o&&!o.done&&(h=n.return)&&h.call(n)}finally{if(l)throw l.error}}return[2,e]}})})},r.findDeviceById=function(t){return lt(this,void 0,void 0,function(){var e;return ht(this,function(n){switch(n.label){case 0:return[4,r.listVideoInputDevices()];case 1:return e=n.sent(),e?[2,e.find(function(o){return o.deviceId===t})]:[2]}})})},r.cleanVideoSource=function(t){if(t){try{t.srcObject=null}catch{t.src=""}t&&t.removeAttribute("src")}},r.releaseAllStreams=function(){r.streamTracker.length!==0&&r.streamTracker.forEach(function(t){t.getTracks().forEach(function(e){return e.stop()})}),r.streamTracker=[]},r.playVideoOnLoadAsync=function(t,e){return lt(this,void 0,void 0,function(){var n;return ht(this,function(o){switch(o.label){case 0:return[4,r.tryPlayVideo(t)];case 1:return n=o.sent(),n?[2,!0]:[2,new Promise(function(i,a){var s=setTimeout(function(){r.isVideoPlaying(t)||(a(!1),t.removeEventListener("canplay",f))},e),f=function(){r.tryPlayVideo(t).then(function(c){clearTimeout(s),t.removeEventListener("canplay",f),i(c)})};t.addEventListener("canplay",f)})]}})})},r.attachStreamToVideo=function(t,e,n){return n===void 0&&(n=5e3),lt(this,void 0,void 0,function(){var o;return ht(this,function(i){switch(i.label){case 0:return o=r.prepareVideoElement(e),r.addVideoSource(o,t),[4,r.playVideoOnLoadAsync(o,n)];case 1:return i.sent(),[2,o]}})})},r._waitImageLoad=function(t){return new Promise(function(e,n){var o=1e4,i=setTimeout(function(){r.isImageLoaded(t)||(t.removeEventListener("load",a),n())},o),a=function(){clearTimeout(i),t.removeEventListener("load",a),e()};t.addEventListener("load",a)})},r.checkCallbackFnOrThrow=function(t){if(!t)throw new ft("`callbackFn` is a required parameter, you cannot capture results without it.")},r.disposeMediaStream=function(t){t.getVideoTracks().forEach(function(e){return e.stop()}),t=void 0},r.prototype.decode=function(t){var e=r.createCanvasFromMediaElement(t);return this.decodeFromCanvas(e)},r.prototype.decodeBitmap=function(t){return this.reader.decode(t,this.hints)},r.prototype.decodeFromCanvas=function(t){var e=r.createBinaryBitmapFromCanvas(t);return this.decodeBitmap(e)},r.prototype.decodeFromImageElement=function(t){return lt(this,void 0,void 0,function(){var e;return ht(this,function(n){switch(n.label){case 0:if(!t)throw new ft("An image element must be provided.");return e=r.prepareImageElement(t),[4,this._decodeOnLoadImage(e)];case 1:return[2,n.sent()]}})})},r.prototype.decodeFromImageUrl=function(t){return lt(this,void 0,void 0,function(){var e;return ht(this,function(n){switch(n.label){case 0:if(!t)throw new ft("An URL must be provided.");e=r.prepareImageElement(),e.src=t,n.label=1;case 1:return n.trys.push([1,,3,4]),[4,this.decodeFromImageElement(e)];case 2:return[2,n.sent()];case 3:return r.destroyImageElement(e),[7];case 4:return[2]}})})},r.prototype.decodeFromConstraints=function(t,e,n){return lt(this,void 0,void 0,function(){var o,i;return ht(this,function(a){switch(a.label){case 0:return r.checkCallbackFnOrThrow(n),[4,this.getUserMedia(t)];case 1:o=a.sent(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.decodeFromStream(o,e,n)];case 3:return[2,a.sent()];case 4:throw i=a.sent(),r.disposeMediaStream(o),i;case 5:return[2]}})})},r.prototype.decodeFromStream=function(t,e,n){return lt(this,void 0,void 0,function(){var o,i,a,s,f,c,u,l,h,d=this;return ht(this,function(p){switch(p.label){case 0:return r.checkCallbackFnOrThrow(n),o=this.options.tryPlayVideoTimeout,[4,r.attachStreamToVideo(t,e,o)];case 1:return i=p.sent(),a=function(){r.disposeMediaStream(t),r.cleanVideoSource(i)},s=this.scan(i,n,a),f=t.getVideoTracks(),c=sr(sr({},s),{stop:function(){s.stop()},streamVideoConstraintsApply:function(v,g){return lt(this,void 0,void 0,function(){var y,x,C,w,_,O,R;return ht(this,function(N){switch(N.label){case 0:y=g?f.filter(g):f,N.label=1;case 1:N.trys.push([1,6,7,8]),x=Ro(y),C=x.next(),N.label=2;case 2:return C.done?[3,5]:(w=C.value,[4,w.applyConstraints(v)]);case 3:N.sent(),N.label=4;case 4:return C=x.next(),[3,2];case 5:return[3,8];case 6:return _=N.sent(),O={error:_},[3,8];case 7:try{C&&!C.done&&(R=x.return)&&R.call(x)}finally{if(O)throw O.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(v){return f.find(v).getConstraints()},streamVideoSettingsGet:function(v){return f.find(v).getSettings()},streamVideoCapabilitiesGet:function(v){return f.find(v).getCapabilities()}}),u=r.mediaStreamIsTorchCompatible(t),u&&(l=f?.find(function(v){return r.mediaStreamIsTorchCompatibleTrack(v)}),h=function(v){return lt(d,void 0,void 0,function(){return ht(this,function(g){switch(g.label){case 0:return[4,r.mediaStreamSetTorch(l,v)];case 1:return g.sent(),[2]}})})},c.switchTorch=h,c.stop=function(){return lt(d,void 0,void 0,function(){return ht(this,function(v){switch(v.label){case 0:return s.stop(),[4,h(!1)];case 1:return v.sent(),[2]}})})}),[2,c]}})})},r.prototype.decodeFromVideoDevice=function(t,e,n){return lt(this,void 0,void 0,function(){var o,i;return ht(this,function(a){switch(a.label){case 0:return r.checkCallbackFnOrThrow(n),t?o={deviceId:{exact:t}}:o={facingMode:"environment"},i={video:o},[4,this.decodeFromConstraints(i,e,n)];case 1:return[2,a.sent()]}})})},r.prototype.decodeFromVideoElement=function(t,e){return lt(this,void 0,void 0,function(){var n,o;return ht(this,function(i){switch(i.label){case 0:if(r.checkCallbackFnOrThrow(e),!t)throw new ft("A video element must be provided.");return n=r.prepareVideoElement(t),o=this.options.tryPlayVideoTimeout,[4,r.playVideoOnLoadAsync(n,o)];case 1:return i.sent(),[2,this.scan(n,e)]}})})},r.prototype.decodeFromVideoUrl=function(t,e){return lt(this,void 0,void 0,function(){var n,o,i,a;return ht(this,function(s){switch(s.label){case 0:if(r.checkCallbackFnOrThrow(e),!t)throw new ft("An URL must be provided.");return n=r.prepareVideoElement(),n.src=t,o=function(){r.cleanVideoSource(n)},i=this.options.tryPlayVideoTimeout,[4,r.playVideoOnLoadAsync(n,i)];case 1:return s.sent(),a=this.scan(n,e,o),[2,a]}})})},r.prototype.decodeOnceFromConstraints=function(t,e){return lt(this,void 0,void 0,function(){var n;return ht(this,function(o){switch(o.label){case 0:return[4,this.getUserMedia(t)];case 1:return n=o.sent(),[4,this.decodeOnceFromStream(n,e)];case 2:return[2,o.sent()]}})})},r.prototype.decodeOnceFromStream=function(t,e){return lt(this,void 0,void 0,function(){var n,o,i;return ht(this,function(a){switch(a.label){case 0:return n=!!e,[4,r.attachStreamToVideo(t,e)];case 1:o=a.sent(),a.label=2;case 2:return a.trys.push([2,,4,5]),[4,this.scanOneResult(o)];case 3:return i=a.sent(),[2,i];case 4:return n||r.cleanVideoSource(o),[7];case 5:return[2]}})})},r.prototype.decodeOnceFromVideoDevice=function(t,e){return lt(this,void 0,void 0,function(){var n,o;return ht(this,function(i){switch(i.label){case 0:return t?n={deviceId:{exact:t}}:n={facingMode:"environment"},o={video:n},[4,this.decodeOnceFromConstraints(o,e)];case 1:return[2,i.sent()]}})})},r.prototype.decodeOnceFromVideoElement=function(t){return lt(this,void 0,void 0,function(){var e,n;return ht(this,function(o){switch(o.label){case 0:if(!t)throw new ft("A video element must be provided.");return e=r.prepareVideoElement(t),n=this.options.tryPlayVideoTimeout,[4,r.playVideoOnLoadAsync(e,n)];case 1:return o.sent(),[4,this.scanOneResult(e)];case 2:return[2,o.sent()]}})})},r.prototype.decodeOnceFromVideoUrl=function(t){return lt(this,void 0,void 0,function(){var e,n;return ht(this,function(o){switch(o.label){case 0:if(!t)throw new ft("An URL must be provided.");e=r.prepareVideoElement(),e.src=t,n=this.decodeOnceFromVideoElement(e),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,n];case 2:return[2,o.sent()];case 3:return r.cleanVideoSource(e),[7];case 4:return[2]}})})},r.prototype.scanOneResult=function(t,e,n,o){var i=this;return e===void 0&&(e=!0),n===void 0&&(n=!0),o===void 0&&(o=!0),new Promise(function(a,s){i.scan(t,function(f,c,u){if(f){a(f),u.stop();return}if(c){if(c instanceof E&&e||c instanceof X&&n||c instanceof S&&o)return;u.stop(),s(c)}})})},r.prototype.scan=function(t,e,n){var o=this;r.checkCallbackFnOrThrow(e);var i=r.createCaptureCanvas(t),a=i.getContext("2d");if(!a)throw new Error("Couldn't create canvas for visual element scan.");var s=function(){a=void 0,i=void 0},f=!1,c,u=function(){f=!0,clearTimeout(c),s(),n&&n()},l={stop:u},h=function(){if(!f)try{r.drawImageOnCanvas(a,t);var d=o.decodeFromCanvas(i);e(d,void 0,l),c=setTimeout(h,o.options.delayBetweenScanSuccess)}catch(y){e(void 0,y,l);var p=y instanceof X,v=y instanceof S,g=y instanceof E;if(p||v||g){c=setTimeout(h,o.options.delayBetweenScanAttempts);return}s(),n&&n(y)}};return h(),l},r.prototype._decodeOnLoadImage=function(t){return lt(this,void 0,void 0,function(){var e;return ht(this,function(n){switch(n.label){case 0:return e=r.isImageLoaded(t),e?[3,2]:[4,r._waitImageLoad(t)];case 1:n.sent(),n.label=2;case 2:return[2,this.decode(t)]}})})},r.prototype.getUserMedia=function(t){return lt(this,void 0,void 0,function(){var e;return ht(this,function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return e=n.sent(),r.streamTracker.push(e),[2,e]}})})},r.streamTracker=[],r}();var Vl=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),CS=function(r){Vl(t,r);function t(e,n){return r.call(this,new ge,e,n)||this}return t}(Bt);var Hl=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),_S=function(r){Hl(t,r);function t(e,n){return r.call(this,new te(e),e,n)||this}return t}(Bt);var Gl=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),TS=function(r){Gl(t,r);function t(e,n){return r.call(this,new Ae,e,n)||this}return t}(Bt);var zl=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),es=function(r){zl(t,r);function t(e,n){var o=this,i=new Er;return i.setHints(e),o=r.call(this,i,e,n)||this,o.reader=i,o}return Object.defineProperty(t.prototype,"possibleFormats",{set:function(e){this.hints.set(L.POSSIBLE_FORMATS,e),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),t.prototype.decodeBitmap=function(e){return this.reader.decodeWithState(e)},t.prototype.setHints=function(e){this.hints=e,this.reader.setHints(this.hints)},t}(Bt);var Wl=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),BS=function(r){Wl(t,r);function t(e,n){return r.call(this,new Se,e,n)||this}return t}(Bt);var Xl=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),US=function(r){Xl(t,r);function t(e,n){return r.call(this,new we,e,n)||this}return t}(Bt);var ue="http://www.w3.org/2000/svg",GS=function(){function r(t){if(typeof t=="string"){var e=document.getElementById(t);if(!e)throw new Error("Could not find a Container element with '".concat(t,"'."));this.containerElement=e}else this.containerElement=t}return r.prototype.write=function(t,e,n,o){if(t.length===0)throw new I("Found empty contents");if(e<0||n<0)throw new I("Requested dimensions are too small: "+e+"x"+n);var i=o&&o.get(V.MARGIN)!==void 0?Number.parseInt(o.get(V.MARGIN).toString(),10):r.QUIET_ZONE_SIZE,a=this.encode(o,t);return this.renderResult(a,e,n,i)},r.prototype.createSVGElement=function(t,e){var n=document.createElementNS(r.SVG_NS,"svg");return n.setAttributeNS(ue,"width",e.toString()),n.setAttributeNS(ue,"height",t.toString()),n},r.prototype.createSvgPathPlaceholderElement=function(t,e){var n=document.createElementNS(r.SVG_NS,"path");return n.setAttributeNS(ue,"d","M0 0h".concat(t,"v").concat(e,"H0z")),n.setAttributeNS(ue,"fill","none"),n},r.prototype.createSvgRectElement=function(t,e,n,o){var i=document.createElementNS(r.SVG_NS,"rect");return i.setAttributeNS(ue,"x",t.toString()),i.setAttributeNS(ue,"y",e.toString()),i.setAttributeNS(ue,"height",n.toString()),i.setAttributeNS(ue,"width",o.toString()),i.setAttributeNS(ue,"fill","#000000"),i},r.prototype.encode=function(t,e){var n=Mt.L;if(t&&t.get(V.ERROR_CORRECTION)!==void 0){var o=t.get(V.ERROR_CORRECTION).toString();n=Mt.fromString(o)}var i=ce.encode(e,n,t);return i},r.prototype.renderResult=function(t,e,n,o){var i=t.getMatrix();if(i===null)throw new mt;var a=i.getWidth(),s=i.getHeight(),f=a+o*2,c=s+o*2,u=Math.max(e,f),l=Math.max(n,c),h=Math.min(Math.floor(u/f),Math.floor(l/c)),d=Math.floor((u-a*h)/2),p=Math.floor((l-s*h)/2),v=this.createSVGElement(u,l),g=this.createSvgPathPlaceholderElement(e,n);v.appendChild(g),this.containerElement.appendChild(v);for(var y=0,x=p;y<s;y++,x+=h)for(var C=0,w=d;C<a;C++,w+=h)if(i.get(C,y)===1){var _=this.createSvgRectElement(w,x,h,h);v.appendChild(_)}return v},r.QUIET_ZONE_SIZE=4,r.SVG_NS="http://www.w3.org/2000/svg",r}();var rs="http://www.w3.org/2000/svg",XS=function(){function r(){}return r.prototype.write=function(t,e,n,o){if(t.length===0)throw new I("Found empty contents");if(e<0||n<0)throw new I("Requested dimensions are too small: "+e+"x"+n);var i=Mt.L,a=r.QUIET_ZONE_SIZE;if(o){if(o.get(V.ERROR_CORRECTION)!==void 0){var s=o.get(V.ERROR_CORRECTION).toString();i=Mt.fromString(s)}o.get(V.MARGIN)!==void 0&&(a=Number.parseInt(o.get(V.MARGIN).toString(),10))}var f=ce.encode(t,i,o);return this.renderResult(f,e,n,a)},r.prototype.writeToDom=function(t,e,n,o,i){if(typeof t=="string"){var a=document.querySelector(t);if(!a)throw new Error("Could no find the target HTML element.");t=a}var s=this.write(e,n,o,i);t instanceof HTMLElement&&t.appendChild(s)},r.prototype.renderResult=function(t,e,n,o){var i=t.getMatrix();if(i===null)throw new mt;for(var a=i.getWidth(),s=i.getHeight(),f=a+o*2,c=s+o*2,u=Math.max(e,f),l=Math.max(n,c),h=Math.min(Math.floor(u/f),Math.floor(l/c)),d=Math.floor((u-a*h)/2),p=Math.floor((l-s*h)/2),v=this.createSVGElement(u,l),g=0,y=p;g<s;g++,y+=h)for(var x=0,C=d;x<a;x++,C+=h)if(i.get(x,g)===1){var w=this.createSvgRectElement(C,y,h,h);v.appendChild(w)}return v},r.prototype.createSVGElement=function(t,e){var n=document.createElementNS(rs,"svg"),o=t.toString(),i=e.toString();return n.setAttribute("height",i),n.setAttribute("width",o),n.setAttribute("viewBox","0 0 "+o+" "+i),n},r.prototype.createSvgRectElement=function(t,e,n,o){var i=document.createElementNS(rs,"rect");return i.setAttribute("x",t.toString()),i.setAttribute("y",e.toString()),i.setAttribute("height",n.toString()),i.setAttribute("width",o.toString()),i.setAttribute("fill","#000000"),i},r.QUIET_ZONE_SIZE=4,r}();var Tr=class extends es{getScannerControls(){if(!this.scannerControls)throw new Error("No scanning is running at the time.");return this.scannerControls}scanFromDeviceObservable(t,e){return ee(this,null,function*(){let n=new Po({}),o;try{o=yield this.decodeFromVideoDevice(t,e,(i,a)=>{if(!a){n.next({result:i});return}let s=a.name;if(s===E.name||s===X.name||s===S.name||a.message.includes("No MultiFormat Readers were able to detect the code.")){n.next({error:a});return}n.error(a),this.scannerControls.stop(),this.scannerControls=void 0}),this.scannerControls=No(bo({},o),{stop(){o.stop(),n.complete()}})}catch(i){n.error(i),this.scannerControls?.stop(),this.scannerControls=void 0}return n.asObservable()})}},Le=class r{get codeReader(){return this._codeReader}set device(t){if(!this._ready){this._devicePreStart=t;return}if(this.isAutostarting){console.warn("Avoid setting a device during auto-start.");return}if(this.isCurrentDevice(t)){console.warn("Setting the same device is not allowed.");return}if(!this.hasPermission){console.warn("Permissions not set yet, waiting for them to be set to apply device change.");return}this.setDevice(t)}get device(){return this._device}get formats(){return this.hints.get(L.POSSIBLE_FORMATS)}set formats(t){if(typeof t=="string")throw new Error("Invalid formats, make sure the [formats] input is a binding.");let e=t.map(o=>this.getBarcodeFormatOrFail(o)),n=this.hints;n.set(L.POSSIBLE_FORMATS,e),this.hints=n}get hints(){return this._hints}set hints(t){this._hints=t,this.codeReader?.setHints(this._hints)}set videoConstraints(t){let e=this.codeReader?.getScannerControls();e&&e?.streamVideoConstraintsApply(t)}set isAutostarting(t){this._isAutostarting=t,this.autostarting.next(t)}get isAutostarting(){return this._isAutostarting}set torch(t){try{this.getCodeReader().getScannerControls().switchTorch(t)}catch{}}set enable(t){this._enabled=!!t,this._enabled?this.device?this.scanFromDevice(this.device.deviceId):this.init():(this.reset(),Tr.releaseAllStreams())}get enabled(){return this._enabled}get tryHarder(){return this.hints.get(L.TRY_HARDER)}set tryHarder(t){let e=this.hints;t?e.set(L.TRY_HARDER,!0):e.delete(L.TRY_HARDER),this.hints=e}constructor(){this.timeBetweenScans=500,this.delayBetweenScanSuccess=500,this.previewFitMode="cover",this.poster="",this._ready=!1,this.autostarted=new Tt,this.autostarting=new Tt,this.torchCompatible=new Tt(!1),this.scanSuccess=new Tt,this.scanFailure=new Tt,this.scanError=new Tt,this.scanComplete=new Tt,this.camerasFound=new Tt,this.camerasNotFound=new Tt,this.permissionResponse=new Tt(!0),this.hasDevices=new Tt,this.deviceChange=new Tt,this._enabled=!0,this._hints=new Map,this.autofocusEnabled=!0,this.autostart=!0,this.formats=[T.QR_CODE],this.hasNavigator=typeof navigator<"u",this.isMediaDevicesSupported=this.hasNavigator&&!!navigator.mediaDevices}askForPermission(){return ee(this,null,function*(){if(!this.hasNavigator)return console.error("@zxing/ngx-scanner","Can't ask permission, navigator is not present."),this.setPermission(null),this.hasPermission;if(!this.isMediaDevicesSupported)return console.error("@zxing/ngx-scanner","Can't get user media, this is not supported."),this.setPermission(null),this.hasPermission;let t,e;try{t=yield this.getAnyVideoDevice(),e=!!t}catch(n){return this.handlePermissionException(n)}finally{this.terminateStream(t)}return this.setPermission(e),e})}getAnyVideoDevice(){return navigator.mediaDevices.getUserMedia({video:!0})}terminateStream(t){t&&t.getTracks().forEach(e=>e.stop()),t=void 0}init(){return ee(this,null,function*(){if(!this.autostart){console.warn("Feature 'autostart' disabled. Permissions and devices recovery has to be run manually."),this.initAutostartOff(),this._ready=!0;return}yield this.initAutostartOn(),this._ready=!0})}initAutostartOff(){this.isAutostarting=!1,this.updateVideoInputDevices(),this._device&&this._devicePreStart&&this.setDevice(this._devicePreStart)}initAutostartOn(){return ee(this,null,function*(){this.isAutostarting=!0;let t;try{t=yield this.askForPermission()}catch(e){console.error("Exception occurred while asking for permission:",e);return}if(t){let e=yield this.updateVideoInputDevices();yield this.autostartScanner([...e])}this.isAutostarting=!1,this.autostarted.next()})}isCurrentDevice(t){return t?.deviceId===this._device?.deviceId}ngOnDestroy(){this.reset(),Tr.releaseAllStreams()}ngOnInit(){this.init()}scanStop(){this._scanSubscription&&(this.codeReader?.getScannerControls().stop(),this._scanSubscription?.unsubscribe(),this._scanSubscription=void 0),this.torchCompatible.next(!1)}scanStart(){if(this._scanSubscription)throw new Error("There is already a scan process running.");if(!this._device)throw new Error("No device defined, cannot start scan, please define a device.");this.scanFromDevice(this._device.deviceId)}restart(){this._codeReader=void 0;let t=this._reset();t&&(this.device=t)}updateVideoInputDevices(){return ee(this,null,function*(){let t=(yield Bt.listVideoInputDevices())||[],e=t&&t.length>0;return this.hasDevices.next(e),this.camerasFound.next([...t]),e||this.camerasNotFound.next(null),t})}autostartScanner(t){return ee(this,null,function*(){let e=({label:o})=>/back|trás|rear|traseira|environment|ambiente/gi.test(o),n=t.find(e)||t.pop();if(!n)throw new Error("Impossible to autostart, no input devices available.");yield this.setDevice(n),this.deviceChange.next(n)})}dispatchScanSuccess(t){this.scanSuccess.next(t.getText())}dispatchScanFailure(t){this.scanFailure.next(t)}dispatchScanError(t){this.scanError.observed||(console.error(`zxing scanner component: ${t.name}`,t),console.warn("Use the `(scanError)` property to handle errors like this!")),this.scanError.next(t)}dispatchScanComplete(t){this.scanComplete.next(t)}handlePermissionException(t){console.error("@zxing/ngx-scanner","Error when asking for permission.",t);let e;switch(t.name){case"NotSupportedError":console.warn("@zxing/ngx-scanner",t.message),e=null,this.hasDevices.next(null);break;case"NotAllowedError":console.warn("@zxing/ngx-scanner",t.message),e=!1,this.hasDevices.next(!0);break;case"NotFoundError":console.warn("@zxing/ngx-scanner",t.message),e=null,this.hasDevices.next(!1),this.camerasNotFound.next(t);break;case"NotReadableError":console.warn("@zxing/ngx-scanner","Couldn't read the device(s)'s stream, it's probably in use by another app."),e=null,this.hasDevices.next(!1),this.camerasNotFound.next(t);break;default:console.warn("@zxing/ngx-scanner","I was not able to define if I have permissions for camera or not.",t),e=null;break}return this.setPermission(e),this.permissionResponse.error(t),e}getBarcodeFormatOrFail(t){return typeof t=="string"?T[t.trim().toUpperCase()]:t}getCodeReader(){if(!this._codeReader){let t={delayBetweenScanAttempts:this.timeBetweenScans,delayBetweenScanSuccess:this.delayBetweenScanSuccess};this._codeReader=new Tr(this.hints,t)}return this._codeReader}scanFromDevice(t){return ee(this,null,function*(){let e=this.previewElemRef.nativeElement,n=this.getCodeReader(),o=yield n.scanFromDeviceObservable(t,e);if(!o)throw new Error("Undefined decoding stream, aborting.");let i=u=>this._onDecodeResult(u.result,u.error),a=u=>this._onDecodeError(u),s=()=>{};if(this._scanSubscription=o.subscribe(i,a,s),this._scanSubscription.closed)return;let c=typeof n.getScannerControls().switchTorch<"u";this.torchCompatible.next(c)})}_onDecodeError(t){this.dispatchScanError(t)}_onDecodeResult(t,e){t?this.dispatchScanSuccess(t):this.dispatchScanFailure(e),this.dispatchScanComplete(t)}_reset(){if(!this._codeReader)return;this._codeReader=void 0;let t=this._device;return this.device=void 0,t}reset(){this._reset(),this.deviceChange.emit(null)}setDevice(t){return ee(this,null,function*(){this.scanStop(),this._device=t||void 0,this._device||Bt.cleanVideoSource(this.previewElemRef.nativeElement),this._enabled&&t&&(yield this.scanFromDevice(t.deviceId))})}setPermission(t){this.hasPermission=t,this.permissionResponse.next(t)}static{this.\u0275fac=bn({minVersion:"12.0.0",version:"17.0.4",ngImport:he,type:r,deps:[],target:Rn.Component})}static{this.\u0275cmp=Bo({minVersion:"14.0.0",version:"17.0.4",type:r,selector:"zxing-scanner",inputs:{autofocusEnabled:"autofocusEnabled",timeBetweenScans:"timeBetweenScans",delayBetweenScanSuccess:"delayBetweenScanSuccess",autostart:"autostart",previewFitMode:"previewFitMode",poster:"poster",device:"device",formats:"formats",videoConstraints:"videoConstraints",torch:"torch",enable:"enable",tryHarder:"tryHarder"},outputs:{autostarted:"autostarted",autostarting:"autostarting",torchCompatible:"torchCompatible",scanSuccess:"scanSuccess",scanFailure:"scanFailure",scanError:"scanError",scanComplete:"scanComplete",camerasFound:"camerasFound",camerasNotFound:"camerasNotFound",permissionResponse:"permissionResponse",hasDevices:"hasDevices",deviceChange:"deviceChange"},viewQueries:[{propertyName:"previewElemRef",first:!0,predicate:["preview"],descendants:!0,static:!0}],ngImport:he,template:`<video #preview [style.object-fit]="previewFitMode" [poster]="poster">
  <p>
    Your browser does not support this feature, please try to upgrade it.
  </p>
  <p>
    Seu navegador n\xE3o suporta este recurso, por favor tente atualiz\xE1-lo.
  </p>
</video>
`,styles:[`:host{display:block}video{width:100%;height:auto;object-fit:contain}
`],changeDetection:Dr.OnPush})}};Dn({minVersion:"12.0.0",version:"17.0.4",ngImport:he,type:Le,decorators:[{type:Ft,args:[{selector:"zxing-scanner",changeDetection:Dr.OnPush,template:`<video #preview [style.object-fit]="previewFitMode" [poster]="poster">
  <p>
    Your browser does not support this feature, please try to upgrade it.
  </p>
  <p>
    Seu navegador n\xE3o suporta este recurso, por favor tente atualiz\xE1-lo.
  </p>
</video>
`,styles:[`:host{display:block}video{width:100%;height:auto;object-fit:contain}
`]}]}],ctorParameters:()=>[],propDecorators:{previewElemRef:[{type:br,args:["preview",{static:!0}]}],autofocusEnabled:[{type:xt}],timeBetweenScans:[{type:xt}],delayBetweenScanSuccess:[{type:xt}],autostarted:[{type:Rt}],autostarting:[{type:Rt}],autostart:[{type:xt}],previewFitMode:[{type:xt}],poster:[{type:xt}],torchCompatible:[{type:Rt}],scanSuccess:[{type:Rt}],scanFailure:[{type:Rt}],scanError:[{type:Rt}],scanComplete:[{type:Rt}],camerasFound:[{type:Rt}],camerasNotFound:[{type:Rt}],permissionResponse:[{type:Rt}],hasDevices:[{type:Rt}],device:[{type:xt}],deviceChange:[{type:Rt}],formats:[{type:xt}],videoConstraints:[{type:xt}],torch:[{type:xt}],enable:[{type:xt}],tryHarder:[{type:xt}]}});var Rr=class r{static{this.\u0275fac=bn({minVersion:"12.0.0",version:"17.0.4",ngImport:he,type:r,deps:[],target:Rn.NgModule})}static{this.\u0275mod=Lo({minVersion:"14.0.0",version:"17.0.4",ngImport:he,type:r,declarations:[Le],imports:[Mr,qt],exports:[Le]})}static{this.\u0275inj=Fo({minVersion:"12.0.0",version:"17.0.4",ngImport:he,type:r,imports:[Mr,qt]})}};Dn({minVersion:"12.0.0",version:"17.0.4",ngImport:he,type:Rr,decorators:[{type:Mo,args:[{imports:[Mr,qt],declarations:[Le],exports:[Le]}]}]});var jl=function(r,t,e,n){var o=arguments.length,i=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,t,e,n);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(i=(o<3?a(i):o>3?a(t,e,i):a(t,e))||i);return o>3&&i&&Object.defineProperty(t,e,i),i},En=class extends ve{interactionService;hasPermission=!1;visibleScanner=!0;availableDevices;currentDevice=null;result=null;formatsEnabled=[T.CODE_128,T.DATA_MATRIX,T.EAN_13,T.QR_CODE];constructor(t){super(),this.interactionService=t}onOKClicked(t){this.closeModal(this.result)}scanCompleteHandler(t){}onHasPermissionHandler(t){this.hasPermission=t,this.hasPermission==!1&&(this.visibleScanner=!1)}onCamerasFoundHandler(t){this.availableDevices=t,this.availableDevices&&this.availableDevices.length>0&&(this.currentDevice=this.availableDevices[0])}scanSuccessHandler(t){this.result=t,this.interactionService.showMessage("QR_CODE.READ_COMPLETED",null,re.Success,null,{nzPlacement:"top"})}static ctorParameters=()=>[{type:me}]};En=jl([Ft({selector:"armon-qrcode-reader-modal",template:bi,schemas:[ke],standalone:!0,imports:[Ut,Rr,Vt],styles:[Ni]})],En);var Yl=function(r,t,e,n){var o=arguments.length,i=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,t,e,n);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(i=(o<3?a(i):o>3?a(t,e,i):a(t,e))||i);return o>3&&i&&Object.defineProperty(t,e,i),i},An=class extends ve{accessControlPointService;interactionService;sessionService;languageService;modalService;formBuilder;utilityInitializerService;accessControlPoint;listRequest;items;paginationResponse;form;isEditMode=!1;editingItem;hasCamera=!1;qrCodeTriggers=Br(jo);directionTypes=Br(Xo);constructor(t,e,n,o,i,a,s){super(),this.accessControlPointService=t,this.interactionService=e,this.sessionService=n,this.languageService=o,this.modalService=i,this.formBuilder=a,this.utilityInitializerService=s,this.hasCamera=this.utilityInitializerService.hasCamera}onModalInitialized(){super.onModalInitialized(),this.listRequest={},this.listRequest.pagination={take:10,skip:0},this.getList()}getList(){this.accessControlPointService.listAccessPointQRCodes(this.accessControlPoint.id,this.listRequest).subscribe(t=>{this.items=t.itemsUI,this.paginationResponse=t.pagination})}onAddClicked(t,e){this.isEditMode=!1,this.createForm(),this.form.patchValue(this.accessControlPoint.isVirtualPoint?{qrCodeData:null,config:{direction:zr.All,trigger:{type:Oe.Remote,validateGeoLocation:!0,userCanChangeTrigger:!1}}}:{qrCodeData:null,config:{direction:zr.All,trigger:{type:Oe.Bluetooth,validateGeoLocation:!0,userCanChangeTrigger:!1}}}),this.modalService.openTemplate(e,{settings:{size:"md",centered:!0}}).result.then(n=>{this.getList()}).catch(n=>{})}onDeleteClicked(t,e){this.interactionService.showDialog("ACCESSCONTROLPOINT.QR_CODE_DELETE","ACCESSCONTROLPOINT.QR_CODE_DELETE_CONFIRMATION",null,null,!0,"BUTTON.DELETE","",!0,()=>{this.accessControlPointService.deleteAccessControlPointQRCode(e.id).subscribe(n=>{this.interactionService.showMessage("ACCESSCONTROLPOINT.QR_CODE_DELETED",null,re.Success),this.getList()})})}onEditClicked(t,e,n){this.isEditMode=!0,this.editingItem=Br(e),this.createForm(),this.form.patchValue(e),this.modalService.openTemplate(n,{settings:{size:"md",centered:!0}}).result.then(o=>{this.getList()}).catch(o=>{})}pageChanged(t){this.listRequest.pagination=t,this.getList()}onUpsertCancelClicked(t,e){e.dismiss("userCancel")}onUpsertSaveClicked(t,e){if(this.isEditMode){let n=this.form.value;delete n.qrCodeData,this.accessControlPointService.updateAccessPointQRCode(this.editingItem.id,n).subscribe(o=>{this.interactionService.showMessage("ACCESSCONTROLPOINT.QR_CODE_UPDATED",null,re.Success,this.languageService.userTranslate),e.close(void 0)})}else{let n=this.form.value;n.accessPointId=this.accessControlPoint.id,this.accessControlPointService.addAccessPointQRCode(n).subscribe(o=>{this.interactionService.showMessage("ACCESSCONTROLPOINT.QR_CODE_ADDED",null,re.Success,this.languageService.userTranslate),e.close(void 0)})}}onQRCodeReadClicked(t){this.modalService.open(En,{settings:{size:"xl",scrollable:!0}}).result.then(e=>{this.form.get("qrCodeData").setValue(e.substring(e.indexOf("com/")+4))}).catch(e=>{})}createForm(){this.form||(this.form=this.formBuilder.group({qrCodeData:[null,[Di,Ve.required]],config:this.formBuilder.group({direction:[zr.All,[fr.required()]],trigger:this.formBuilder.group({type:[null,[fr.required()]],validateGeoLocation:[!0,[fr.required()]],userCanChangeTrigger:[!0,[fr.required()]]})})}),this.form.get("config").get("trigger").get("type").valueChanges.subscribe(t=>{if(t)switch(t){case Oe.Bluetooth:this.form.get("config").get("trigger").get("validateGeoLocation").disable(),this.form.get("config").get("trigger").get("userCanChangeTrigger").disable();break;case Oe.Remote:this.form.get("config").get("trigger").get("validateGeoLocation").enable(),this.form.get("config").get("trigger").get("userCanChangeTrigger").disable();break;case Oe.BluetoothThenRemote:this.form.get("config").get("trigger").get("validateGeoLocation").enable(),this.form.get("config").get("trigger").get("userCanChangeTrigger").enable();break;case Oe.RemoteThenBluetooth:this.form.get("config").get("trigger").get("validateGeoLocation").enable(),this.form.get("config").get("trigger").get("userCanChangeTrigger").enable();break}else this.form.get("config").get("trigger").get("validateGeoLocation").disable(),this.form.get("config").get("trigger").get("userCanChangeTrigger").disable()}))}static ctorParameters=()=>[{type:$t},{type:me},{type:pe},{type:He},{type:Ue},{type:Lr},{type:si}];static propDecorators={accessControlPoint:[{type:xt}]}};An=Yl([Ft({selector:"access-control-point-qrcodes-modal",template:Ti,schemas:[ke],standalone:!0,imports:[Ut,Qt,ii,Wr,ze,Nr,qt,kr,Pr,Xr,Jo,Vt],styles:[Ri]})],An);var Zl=function(r,t,e,n){var o=arguments.length,i=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,t,e,n);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(i=(o<3?a(i):o>3?a(t,e,i):a(t,e))||i);return o>3&&i&&Object.defineProperty(t,e,i),i},wn=class extends xi{router;interactionService;accessControlPointService;accessControlPointUserService;modalService;socketService;sessionService;routingService;languageService;authService;accessControlPoint;enabledNotificationJobTypes;accessControlPointDeleted=new Tt;hasManualSettings=!1;subscriptionStateChanged;constructor(t,e,n,o,i,a,s,f,c,u){super(u),this.router=t,this.interactionService=e,this.accessControlPointService=n,this.accessControlPointUserService=o,this.modalService=i,this.socketService=a,this.sessionService=s,this.routingService=f,this.languageService=c,this.authService=u}ngOnInit(){this.subscriptionStateChanged=this.socketService.onRemoteAccessControlStateChanged.subscribe(t=>{t.a==this.accessControlPoint.id&&t.sl&&t.sl.length>0&&(t.sl.forEach(e=>{let n=this.accessControlPoint.states.find(o=>o.direction==e.d);if(n)n.state=e.s;else{let o=Yo.getEmptyModel(e.d);o.state=e.s,this.accessControlPoint.states.push(o)}}),this.hasManualSettings=this.accessControlPoint.hasManualSettings)}),this.initializeButtons()}ngOnDestroy(){this.subscriptionStateChanged&&this.subscriptionStateChanged.unsubscribe()}initializeButtons(){this.hasManualSettings=this.accessControlPoint.hasManualSettings,this.accessControlPoint.userRights&&this.accessControlPoint.userRights.read&&(this.accessControlPoint.isVirtualPoint||this.addButton("BUTTON.DETAILS",this.onShowDetailsButtonClicked,Ht.SYSTEM.getRead()),this.addButton("BUTTON.SHOW_ACCESS_LOGS",this.onShowReportButtonClicked,Ht.ACCESSLOG.getReportDetailed()),this.accessControlPoint.isBuiltinVirtualPoint||this.addButton("BUTTON.USERS_EXCEL",this.onExportClicked,Ht.IDENTITY.getReadBasic()),this.addButton("ACCESSCONTROLPOINT.LIST_GRANT_USERS",this.onGrantUsersClicked,Ht.IDENTITY.getReadBasic()),!this.accessControlPoint.isVirtualPoint&&this.enabledNotificationJobTypes.findIndex(t=>t.type==cr.StatusSensor)>-1&&this.addButton("NOTIFICATIONJOBS.TYPE_STATUS_SENSOR",this.onAddStatusSensorNotificationClicked,Ht.IDENTITY.getReadBasic()),!this.accessControlPoint.isVirtualPoint&&this.enabledNotificationJobTypes.findIndex(t=>t.type==cr.CounterSensor)>-1&&this.addButton("NOTIFICATIONJOBS.TYPE_COUNTER_SENSOR",this.onAddCounterSensorNotificationClicked,Ht.IDENTITY.getReadBasic())),this.addButton("BUTTON.USERS",this.onShowUsersButtonClicked,Ht.IDENTITY.getReadBasic()),this.accessControlPoint.userRights&&this.accessControlPoint.userRights.config&&(this.accessControlPoint.isBuiltinVirtualPoint||this.addButton("ACCESSCONTROLPOINT.QR_CODES",this.onQRCodesButtonClicked,Ht.SYSTEM.getWrite()),this.addButton("ACCESSCONTROLPOINT.ADD_MANUAL_RECORD",this.onAddManualRecordButtonClicked,Ht.ACCESSLOG.getInsertManualLog()),this.addButton("BUTTON.EDIT",this.onEditButtonClicked,Ht.SYSTEM.getWrite()),this.accessControlPoint.isVirtualPoint||this.addButton("BUTTON.DELETE",this.onDeleteButtonClicked,Ht.SYSTEM.getWrite()))}onShowDetailsButtonClicked(){this.modalService.open(gi,{settings:{size:"lg"},props:{accessControlPointId:this.accessControlPoint.id}}).result.then(t=>{}).catch(t=>{})}onShowReportButtonClicked(){this.routingService.gotoAccessControlPointAccessLogs(this.accessControlPoint.id)}onExportClicked(t){this.accessControlPointService.exportUsersOfAccessControlPoint(this.accessControlPoint.id).subscribe(e=>{ns.default.saveAs(e,this.accessControlPoint.name+".xlsx")})}onGrantUsersClicked(t){this.modalService.open(jr,{settings:{size:"lg"},props:{accessControlPoint:this.accessControlPoint}}).result.then(e=>{}).catch(e=>{})}onAddStatusSensorNotificationClicked(t){setTimeout(()=>{let e=Bn.getEmptyModel(cr.StatusSensor);e.receiverFilter||(e.receiverFilter=Mn.getEmptyModel()),e.receiverFilter.userIds=[this.sessionService.currentUserId],e.settings.accessControlPointId=this.accessControlPoint.id,this.modalService.open(Fn,{settings:{size:"lg",scrollable:!0},props:{notificationJob:e}}).result.then(n=>{}).catch(n=>{})},300)}onAddCounterSensorNotificationClicked(t){setTimeout(()=>{let e=Bn.getEmptyModel(cr.CounterSensor);e.receiverFilter||(e.receiverFilter=Mn.getEmptyModel()),e.receiverFilter.userIds=[this.sessionService.currentUserId],e.settings.accessControlPointId=this.accessControlPoint.id,this.modalService.open(Fn,{settings:{size:"lg",scrollable:!0},props:{notificationJob:e}}).result.then(n=>{}).catch(n=>{})},300)}onAddManualRecordButtonClicked(){this.modalService.open(li,{settings:{size:"md",centered:!0},props:{accessControlPoint:this.accessControlPoint}}).result.then(t=>{}).catch(t=>{})}onShowUsersButtonClicked(){this.accessControlPointUserService.showUserSelection(this.accessControlPoint.id)}onEditButtonClicked(t=!1){setTimeout(()=>{this.modalService.open(yi,{settings:{size:"lg"},props:{accessControlPoint:this.accessControlPoint}}).result.then(e=>{this.accessControlPoint=e}).catch(e=>{})},600)}onDeleteButtonClicked(){this.interactionService.showDialog(this.accessControlPoint.name,"ACCESSCONTROLPOINT.APPROVE_FOR_DELETE",null,null,!0,"BUTTON.DELETE","",!0,()=>{this.accessControlPointService.deleteAccessControlPoint(this.accessControlPoint.id).subscribe(()=>{this.accessControlPointDeleted.emit(this.accessControlPoint.id)})})}onQRCodesButtonClicked(){setTimeout(()=>{this.modalService.open(An,{settings:{size:"lg",scrollable:!0},props:{accessControlPoint:this.accessControlPoint}}).result.then(t=>{}).catch(t=>{})},600)}static ctorParameters=()=>[{type:Uo},{type:me},{type:$t},{type:Ci},{type:Ue},{type:ri},{type:pe},{type:ti},{type:He},{type:ei}];static propDecorators={accessControlPoint:[{type:xt}],enabledNotificationJobTypes:[{type:xt}],accessControlPointDeleted:[{type:Rt}]}};wn=Zl([Ft({selector:"armon-access-control-point-card",template:_i,standalone:!0,imports:[Ut,Zo,ui,fi,ci,Qt,Hr,Vr,Ur,Vt],styles:[Si]})],wn);var os=`<div class="modal-header">\r
  <div class="d-flex flex-column">\r
    <span class="text-lg">{{'ACCESSCONTROLPOINT.BULK_MANUAL_RECORD_BUTTON' | translate}}</span>\r
  </div>\r
</div>\r
\r
<div class="modal-body d-flex flex-column bg-color-background">\r
  <div class="row mb-4">\r
    <div class="col-12">\r
      <form [formGroup]="formDownload">\r
        <div class="bg-white p-3 rounded-1 d-flex">\r
          <div class="d-flex px-4 py-2 flex-column align-items-center bg-color-gray rounded-1 me-4">\r
            <span class="fw-medium text-xxl text-white text-center" [ngStyle]="{'width': '16px'}">1</span>\r
          </div>\r
          <div class="d-flex flex-column flex-grow-1">\r
            <div class="row">\r
              <div class="col-12 mb-3 border-1 border-bottom border-dark-subtle pb-1">\r
                <span class="text-md color-gray-darkest fw-medium">{{'ACCESSCONTROLPOINT.BULK_MANUAL_RECORD_DOWNLOAD'|\r
                  translate}}</span>\r
              </div>\r
              <div class="col-12">\r
                <nz-radio-group name="dailyStartMorning" [formControl]="formDownload.get('dateIsCombined')">\r
                  <label nz-radio [nzValue]="true" class="w-100">\r
                    {{'ACCESSCONTROLPOINT.BULK_MANUAL_RECORD_MERGED_DATETIME'|translate}}</label>\r
                  <label nz-radio [nzValue]="false" class="w-100">\r
                    {{'ACCESSCONTROLPOINT.BULK_MANUAL_RECORD_NOT_MERGED_DATETIME'|translate}}</label>\r
                </nz-radio-group>\r
                <ng-template\r
                  *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: formDownload, control:formDownload.get('dateIsCombined')}">\r
                </ng-template>\r
              </div>\r
              <div class="col-12 d-flex justify-content-end">\r
                <button class="btn btn-primary" (click)="onDownloadClicked($event)" [disabled]="formDownload.invalid">\r
                  {{'BUTTON.DOWNLOAD' | translate}}\r
                </button>\r
              </div>\r
            </div>\r
          </div>\r
        </div>\r
      </form>\r
    </div>\r
  </div>\r
\r
  <div class="row">\r
    <div class="col-12">\r
      <form [formGroup]="formUpload">\r
        <div class="bg-white p-3 rounded-1 d-flex">\r
          <div class="d-flex px-4 py-2 flex-column align-items-center bg-color-gray rounded-1 me-4">\r
            <span class="fw-medium text-xxl text-white text-center" [ngStyle]="{'width': '16px'}">2</span>\r
          </div>\r
          <div class="d-flex flex-column flex-grow-1">\r
            <div class="row">\r
              <div class="col-12 mb-3 border-1 border-bottom border-dark-subtle pb-1">\r
                <span class="text-md color-gray-darkest fw-medium">{{'ACCESSCONTROLPOINT.BULK_MANUAL_RECORD_UPLOAD'|\r
                  translate}}</span>\r
              </div>\r
              <div class="col-12 mb-1">\r
                <div class="form-group">\r
                  <label>{{'ACCESSCONTROLPOINT.BULK_MANUAL_RECORD_FILE'|translate}}</label>\r
                  <div class="d-flex flex-column justify-content-end py-4 px-3 rounded-2 file-drop-area" fileDragDrop\r
                    [ngStyle]="{'background-color':'red'}" [attr.selected]="selectedFile!=null"\r
                    (files)="filesDropped($event)">\r
                    <input #fileInput type="file" style="display:none" (change)="onChangedFile($event)"\r
                      accept=".xlsx" />\r
                    <div class="d-flex flex-column align-items-center row-gap-4">\r
                      <cds-icon shape="filetype-xlsx" class="cds-icon-42 color-gray-darkest"></cds-icon>\r
                      <span class="text-sm " *ngIf="selectedFile">{{selectedFile.name}}</span>\r
                      <span class="text-sm text-italic"\r
                        *ngIf="!selectedFile">{{'COMMON.SELECT_OR_DRAGDROP_FILE'|translate}}</span>\r
                    </div>\r
                  </div>\r
                </div>\r
              </div>\r
              <div class="col-12 mb-2">\r
                <div class="d-flex justify-content-center align-items-center">\r
                  <button class="btn btn-sm" (click)="onSelectFile($event)"\r
                    [ngClass]="{'btn-primary':!selectedFile, 'btn-outline-primary':selectedFile}"><cds-icon\r
                      shape="folder-open" class="me-2"></cds-icon>{{'COMMON.SELECT_FILE'|translate}}</button>\r
                </div>\r
              </div>\r
              <div class="col-12 my-2" *ngIf="uploadError">\r
                <div class="d-flex flex-column row-gap-1 p-3 rounded-2 bg-danger-subtle"\r
                  style="max-height: 20vh; overflow-y: auto;">\r
                  <span class="text-sm fw-medium text-danger" *ngIf="uploadError.message">{{uploadError.message}}</span>\r
                  <ng-container *ngIf="uploadError.errorCells && uploadError.errorCells.length>0">\r
                    <span\r
                      class="text-sm fw-medium text-danger">{{'ACCESSCONTROLPOINT.BULK_MANUAL_TEMPLATE_ERROR_UPLOAD'|translate}}</span>\r
                    <span\r
                      class="text-sm mt-2 text-italic">{{'ACCESSCONTROLPOINT.BULK_MANUAL_TEMPLATE_ERROR_WORKPLAN_CELL'|translate}}</span>\r
                    <span class="text-sm ms-3" *ngFor="let errorCell of uploadError.errorCells">{{errorCell}}</span>\r
                  </ng-container>\r
                  <ng-container *ngIf="uploadError.errorUsers && uploadError.errorUsers.length>0">\r
                    <span\r
                      class="text-sm mt-2 text-italic">{{'ACCESSCONTROLPOINT.BULK_MANUAL_TEMPLATE_ERROR_USER_CELL'|translate}}</span>\r
                    <span class="text-sm ms-3" *ngFor="let errorUser of uploadError.errorUsers">{{errorUser}}</span>\r
                  </ng-container>\r
                  <ng-container *ngIf="uploadError.errorDates && uploadError.errorDates.length>0">\r
                    <span\r
                      class="text-sm mt-2 text-italic">{{'ACCESSCONTROLPOINT.BULK_MANUAL_TEMPLATE_ERROR_DATE_CELL'|translate}}</span>\r
                    <span class="text-sm ms-3" *ngFor="let errorDate of uploadError.errorDates">{{errorDate}}</span>\r
                  </ng-container>\r
                </div>\r
              </div>\r
              <div class="col-12">\r
                <div class="form-group">\r
                  <label>{{'ACCESSCONTROLPOINT.BULK_MANUAL_RECORD_DEFAULT_POINT'|translate}}</label>\r
                  <armon-select-search query="point" [allowMulti]="false"\r
                    [invalid]="formUpload.get('defaultAccessControlPointId').touched && formUpload.get('defaultAccessControlPointId').invalid"\r
                    [formControl]="formUpload.get('defaultAccessControlPointId')">\r
                  </armon-select-search>\r
                  <ng-template\r
                    *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: formUpload, control:formUpload.get('defaultAccessControlPointId')}">\r
                  </ng-template>\r
                </div>\r
              </div>\r
              <div class="col-12" *ngIf="pacsAvailable">\r
                <nz-radio-group name="calculate-pacs" [formControl]="formUpload.get('calculatePacs')">\r
                  <label nz-radio [nzValue]="false" class="w-100">\r
                    {{'ACCESSCONTROLPOINT.BULK_MANUAL_RECORD_NOT_CALCULATE_PACS'|translate}}</label>\r
                  <label nz-radio [nzValue]="true" class="w-100">\r
                    {{'ACCESSCONTROLPOINT.BULK_MANUAL_RECORD_CALCULATE_PACS'|translate}}</label>\r
                </nz-radio-group>\r
                <ng-template\r
                  *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: formUpload, control:formUpload.get('calculatePacs')}">\r
                </ng-template>\r
              </div>\r
              <div class="col-12 d-flex justify-content-end">\r
                <button class="btn btn-primary" (click)="onUploadClicked($event)"\r
                  [disabled]="formUpload.invalid || selectedFile==null">\r
                  {{'BUTTON.UPLOAD' | translate}}\r
                </button>\r
              </div>\r
            </div>\r
          </div>\r
        </div>\r
      </form>\r
    </div>\r
  </div>\r
</div>\r
<div class="modal-footer">\r
  <button class="btn btn-outline-primary me-2" (click)="onCancelClicked($event)">{{'BUTTON.CLOSE' |\r
    translate}}</button>\r
</div>\r
\r
<!-- FORM FIELD VALIDATION -->\r
<ng-template #controlValidationTemplate let-form let-control="control">\r
  <ng-container *ngIf="control.errors">\r
    <div class="invalid-feedback d-flex flex-column" style="display: initial;">\r
      <span *ngIf="control.errors.required">{{'VALIDATION.REQUIRED'|translate}}</span>\r
      <span *ngIf="control.errors.numeric">{{'VALIDATION.POSITIVE_NUMBER'|translate}}</span>\r
      <span *ngIf="control.errors.max">{{'VALIDATION.MAX_VALUE'|translate:control.errors.max}}</span>\r
      <span *ngIf="control.errors.maxlength">{{'VALIDATION.MAX_LENGTH'|translate: {\r
        max:control.errors.maxlength.requiredLength} }}</span>\r
      <span *ngIf="control.errors.min">{{'VALIDATION.MIN_VALUE'|translate:control.errors.min}}</span>\r
      <span *ngIf="control.errors.minlength">{{'VALIDATION.MIN_LENGTH'|translate: {\r
        min:control.errors.minlength.requiredLength} }}</span>\r
    </div>\r
  </ng-container>\r
</ng-template>`;var is=`.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 .file-drop-area{border-color:#3587b4!important;border-style:dashed!important;border-width:2px!important}:host .file-drop-area[selected=true]{border-color:#62a325!important}
`;var as=Tn(Pn());var ql=function(r,t,e,n){var o=arguments.length,i=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,t,e,n);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(i=(o<3?a(i):o>3?a(t,e,i):a(t,e))||i);return o>3&&i&&Object.defineProperty(t,e,i),i},_n=class extends ve{translate;accessControlPointService;interactionService;sessionService;languageService;formBuilder;formDownload;formUpload;pacsAvailable=!1;fileInput;selectedFile=null;uploadError=void 0;constructor(t,e,n,o,i,a){super(),this.translate=t,this.accessControlPointService=e,this.interactionService=n,this.sessionService=o,this.languageService=i,this.formBuilder=a}onModalInitialized(){super.onModalInitialized(),this.sessionService.hasModule(Wo.PACS)&&(this.pacsAvailable=!0),this.createForms()}createForms(){this.formDownload=this.formBuilder.group({dateIsCombined:[{value:!0,disabled:!1},[Ve.required]]}),this.formUpload=this.formBuilder.group({calculatePacs:[{value:!1,disabled:!1},[Ve.required]],defaultAccessControlPointId:[{value:null,disabled:!1},[Ve.required]]})}onSelectFile(t){this.fileInput.nativeElement.click()}resetSelectedFile(){this.selectedFile=null,this.fileInput.nativeElement.value=""}checkSelection(t){if(Nn(t)){this.resetSelectedFile();return}Vo(t)?this.resetSelectedFile():t.length>1?this.interactionService.showDialog("PACS.SHIFT_TEMPLATE_UPLOAD","COMMON.SELECT_ONLY_ONE_FILE",null,null,!1,"BUTTON.OK","",!1,()=>{this.resetSelectedFile()}):t[0].size/1e6>100?this.interactionService.showDialog("PACS.SHIFT_TEMPLATE_UPLOAD","COMMON.UPLOAD_FILE_EXCEED_LIMIT",null,{maxFileSize:100},!1,"BUTTON.OK","",!1,()=>{this.resetSelectedFile()}):t[0].type!==ni.EXCEL_XLSX?this.interactionService.showDialog("BUTTON.UPLOAD_FILE","COMMON.UPLOAD_FILE_INVALID_MIME_TYPE",null,null,!1,"BUTTON.OK","",!1,()=>{this.resetSelectedFile()}):this.selectedFile=t[0]}onChangedFile(t){this.checkSelection(t.target.files)}filesDropped(t){this.checkSelection(t)}onDownloadClicked(t){this.formDownload.invalid||this.accessControlPointService.downloadBulkManualAccessLogsTemplate(this.formDownload.get("dateIsCombined").value).subscribe(e=>{this.translate.get(["ACCESSCONTROLPOINT.BULK_MANUAL_RECORD_TEMPLATE"]).subscribe(n=>{as.default.saveAs(e,n["ACCESSCONTROLPOINT.BULK_MANUAL_RECORD_TEMPLATE"]+"_"+de.now().toLocaleString(de.DATETIME_MED)+".xlsx"),this.interactionService.showMessage("ACCESSCONTROLPOINT.BULK_MANUAL_RECORD_TEMPLATE_DOWNLOADED",null,re.Success),this.closeModal()})})}onUploadClicked(t){if(this.formUpload.invalid||Nn(this.selectedFile))return;let e=new FormData;e.append("file",this.selectedFile),this.accessControlPointService.uploadBulkManualAccessLogsTemplate(this.formUpload.get("defaultAccessControlPointId")?.value,this.formUpload.get("calculatePacs")?.value,e).subscribe({next:n=>{this.interactionService.showDialog("ACCESSCONTROLPOINT.BULK_MANUAL_RECORD_BUTTON","ACCESSCONTROLPOINT.BULK_MANUAL_RECORD_TEMPLATE_UPLOADED",null,null,!1,"BUTTON.OK","",!1,()=>{this.closeModal()})},error:n=>{n&&n.status&&n.status===zo.Conflict&&(this.uploadError=n.error,this.interactionService.showMessage("ACCESSCONTROLPOINT.BULK_MANUAL_RECORD_TEMPLATE_UPLOADED_FAILED",null,re.Error),this.resetSelectedFile())}})}static ctorParameters=()=>[{type:Fr},{type:$t},{type:me},{type:pe},{type:He},{type:Lr}];static propDecorators={fileInput:[{type:br,args:["fileInput",{static:!0}]}]}};_n=ql([Ft({selector:"armon-access-control-point-bulk-manual-record",template:os,schemas:[ke],standalone:!0,imports:[Ut,Qt,Pr,ko,Nr,Ei,qt,kr,$o,Xr,mi,Vt],styles:[is]})],_n);var $l=function(r,t,e,n){var o=arguments.length,i=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,t,e,n);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(i=(o<3?a(i):o>3?a(t,e,i):a(t,e))||i);return o>3&&i&&Object.defineProperty(t,e,i),i},ss=class{accessControlPointService;settingsService;modalService;translate;accessControlPoints;filter;enabledNotificationJobTypes;paginationResponse=new Ge;paginationRequest=new Gr;constructor(t,e,n,o){this.accessControlPointService=t,this.settingsService=e,this.modalService=n,this.translate=o}ngOnInit(){this.createFilterObject(),this.getOrganizationSettings()}getOrganizationSettings(){this.settingsService.getOrganizationSettings().subscribe(t=>{this.enabledNotificationJobTypes=t.notification.enabledTypeDefs,this.getAccessControlPoints()})}onFilterChanged(t){this.filter.skip=0,this.getAccessControlPoints()}onAccessControlPointDeleted(t){this.getAccessControlPoints()}createFilterObject(){this.filter=new Ko,this.filter.skip=0,this.filter.take=Go.REQUEST_ITEM_GRID_LIMIT,this.filter.returnTotalCount=!0}getAccessControlPoints(){this.accessControlPointService.searchAccessControlPoints(this.filter).subscribe(t=>{this.accessControlPoints=t.items;let e=new Ge;e.skip=t.skip,e.take=t.take,e.total=t.total,this.paginationResponse=e})}pageChanged(t){this.filter.skip=t.skip,this.filter.take=t.take,this.getAccessControlPoints()}onGetExcelClicked(t){this.accessControlPointService.searchAccessControlPointsExcel(this.filter).subscribe(e=>{this.translate.get(["PAGES.MANAGE_ACCESSCONTROLPOINTS"]).subscribe(n=>{Do.default.saveAs(e,n["PAGES.MANAGE_ACCESSCONTROLPOINTS"]+"_"+de.local().toLocaleString(de.DATETIME_MED)+".xlsx")})})}onGetPDFClicked(t){this.accessControlPointService.searchAccessControlPointsPdf(this.filter).subscribe(e=>{this.translate.get(["PAGES.MANAGE_ACCESSCONTROLPOINTS"]).subscribe(n=>{Do.default.saveAs(e,n["PAGES.MANAGE_ACCESSCONTROLPOINTS"]+"_"+de.local().toLocaleString(de.DATETIME_MED)+".pdf")})})}onBulkManualRecordsClicked(t){this.modalService.open(_n,{settings:{size:"lg",centered:!0}}).result.then(e=>{}).catch(e=>{})}static ctorParameters=()=>[{type:$t},{type:qo},{type:Ue},{type:Fr}]};ss=$l([Ft({selector:"armon-manage-access-control-points",template:Ai,animations:ai,standalone:!0,imports:[pi,hi,vi,qt,Hr,Vr,Ur,di,Ut,Qt,wn,Wr,ze,Vt],styles:[wi]})],ss);export{ss as ManageAccessControlPointsComponent};
