/* COPYRIGHT by SARTORIUS (Sartorius Lab Instruments GmbH & Co. KG) */
!function(e){var t={};function a(s){if(t[s])return t[s].exports;var i=t[s]={i:s,l:!1,exports:{}};return e[s].call(i.exports,i,i.exports,a),i.l=!0,i.exports}a.m=e,a.c=t,a.d=function(e,t,s){a.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:s})},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=93)}([function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.PARAM_GROUP="GROUP",e.PARAM_DATE_TIME="DATE_TIME",e.PARAM_MULTIPLE_SELECTION="MULTIPLE_SELECTION",e.PARAM_SELECTION="SELECTION",e.PARAM_QUANTITY="QUANTITY",e.PARAM_MEASURE="MEASURE",e.PARAM_STRING="STRING",e.ALIBI_IDENTIFIER="ALIBI_IDENTIFIER",e.PARAM_TEXT="TEXT",e.PARAM_FORMULA="FORMULA",e.PARAM_PASSWORD="PASSWORD",e.PARAM_BARCODE="BARCODE"}(t.EnumParameterTypes||(t.EnumParameterTypes={})),function(e){e.HIDDEN="HIDDEN",e.DISABLED="DISABLED",
e.ENABLED_PRIMARY="ENABLED_PRIMARY",e.ENABLED_SECONDARY="ENABLED_SECONDARY",e.ENABLED="ENABLED",e.ENABLED_EDITABLE="ENABLED_EDITABLE",e.ENABLED_INVALID="ENABLED_INVALID",e.ENABLED_INVALID_CFG="ENABLED_INVALID_CFG"}(t.EnumAppearance||(t.EnumAppearance={})),function(e){e.CODE128="CODE128",e.QR="QR",e.EAN13="EAN13",e.EAN8="EAN8",e.UPC="UPC",e.CODE39="CODE39",e.ITF14="ITF14",e.ITF="ITF",e.MSI="MSI",e.MSI10="MSI10",e.MSI11="MSI11",e.MSI1010="MSI1010",e.MSI1110="MSI1110",e.Pharmacode="Pharmacode"}(t.EnumBarcodeFormats||(t.EnumBarcodeFormats={})),t.EnumButtonType||(t.EnumButtonType={}),function(e){e.OPEN="OPEN",e.CLOSED="CLOSED",e.MOVE="MOVE"}(t.EnumDraftShieldPosition||(t.EnumDraftShieldPosition={})),function(e){e.NONE="NONE",e.UNLICENSED="UNLICENSED",e.ROWI="ROWI",e.LIWI="LIWI",e.LIRO="LIRO"}(t.EnumDraftShieldType||(t.EnumDraftShieldType={})),function(e){e.TOUCH="TOUCH"}(t.EnumUserEvent||(t.EnumUserEvent={})),function(e){e[e.OPEN=1]="OPEN",e[e.RUNNING=2]="RUNNING",
e[e.CLOSED_SUCCESS=3]="CLOSED_SUCCESS",e[e.CLOSED_FAILED=4]="CLOSED_FAILED"}(t.EnumJobStatus||(t.EnumJobStatus={}))},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MQTT_TOPIC_WILDCARD_UNIQUE_ID="_replaceWithUniqueID_",t.MQTT_TOPIC_WILDCARD_GENERATED_TOKEN="_generatedToken_",t.MQTT_TOPIC_WILDCARD_SCREEN_ID="_replaceWithScreenID_",t.MQTT_TOPIC_WILDCARD_BUTTON_ID="_replaceWithButtonID_",t.MQTT_TOPIC_WILDCARD_TAB_ID="_replaceWithTabID_",function(e){e.DEVELOPER_MODE="/DEVELOPER_MODE",e.QAPP_CLEANUP="/QAPP/CLEANUP",e.QAPP_NAMESPACE="/QAPP",e.QAPP_DEBUG_TOPIC_PREAMBLE="/QAPP/DEBUG",e.QAPP_DEBUG_STOP_HEARTBEAT="/QAPP/DEBUG/stopHeartbeat",e.QAPP_LOGOUT_REQUEST="/QAPP/LOGOUT_REQUEST",e.QAPP_STARTED="/QAPP/STATE/STARTED",e.QAPP_STOPPED="/QAPP/STATE/STOPPED",e.QAPP_ERROR="/QAPP/STATE/ERROR",e.QAPP_HEARTBEAT="/QAPP/HEARTBEAT",e.QAPP_DATABASE_ACTION_DONE="/QAPP/DATABASE_ACTION_DONE",e.DEVICE_MODEL_NAME="/DEVICEINFORMATION/IDENTIFICATION/MODEL_NAME",
e.DEVICE_IS_FUSION="/FIRMWARELOADER/VERSION/IS_FUSION",e.NETWORK_MAC_ADDRESS="/DEVICEINFORMATION/NETWORK/MACADDRESS",e.NETWORK_HOSTNAME="/DEVICEINFORMATION/NETWORK/HOSTNAME",e.SENSOR_ACTOR_INFO="SENSOR_ACTOR/BALANCE/BALANCE_INFO",e.SENSOR_ACTOR_WEIGHT="SENSOR_ACTOR/BALANCE/WEIGHT",e.LEVELING_STATUS="/LEVELING/STATUS",e.LEVELING_CLOSE="/HMI_LEVELING/CLOSE",e.CALADJ_ISOCAL_STATUS="/CALIBRATION_ADJUSTMENT/ISOCAL",e.CALADJ_INTERNAL_RESULT="/CALIBRATION_ADJUSTMENT/RESULT",e.CLIMATE_INT_VALUE="/CLIMA_CONTROL/INT/VALUE",e.CLIMATE_EXT_VALUE="/CLIMA_CONTROL/EXT/VALUE",e.CLIMATE_INT_ID_SERIAL="CLIMA_CONTROL_INT_ID_SERIAL",e.CLIMATE_EXT_ID_SERIAL="CLIMA_CONTROL_EXT_ID_SERIAL",e.CLIMATE_STATUS="/CLIMA_CONTROL/STATUS",e.DRAFTSHIELD_TYPE="/DRAFTSHIELD/TYPE",e.DRAFTSHIELD_POSITION="/DRAFTSHIELD/IONIZER_INFO",e.QAPP_PARAMETERS_TOPIC_PREAMBLE="/QAPP/PARAMS",e.USERMANAGEMENT_AUTO_LOGOUT_EVENT="/USERMANAGEMENT/AUTO_LOG_OFF",
e.USERMANAGEMENT_AUTO_LOGOUT_PREWARNING_EVENT="/USERMANAGEMENT/AUTO_LOG_OFF_PREWARNING",e.REPORTING_SICS_PROTOCOL_HELPER="/SICS/ADD_TO_PROTOCOL",e.REPORTING_SBI_PROTOCOL_HELPER="/REPORTING/SBI/SINGLE_PRINT",e.COMM_SBI_PRINT_AT_STABILITY="SBI_PROTOCOL/STABILITY",e.JOBMGMT_TASK_WORKFLOWDATA="/TASK/WORKFLOWDATA",e.HMI_QAPP_WIZARD_SCREEN_TITLE="/QAPP/SCREENS/WIZARDSCREEN/HEADING_TITLE",e.HMI_VISUAL_SCREEN="/VISUAL_SCREEN",e.HMI_VISUAL_SCREEN_CLOSED="/HMI/VISUAL_SCREEN/CLOSED",e.HMI_OVERLAY_TOP="/HMI/OVERLAY_TOP",e.HMI_EVENT="/HMI/USER/EVENT",e.HMI_LOCK_SCREEN_STATE="HMI/LOCKSCREEN/STATE",e.HMI_ACTIVE_QAPP_SCREEN="/QAPP/SCREEN",e.HMI_ABSTRACT_SCREEN_BARBUTTONS="/QAPP/SCREENS/_replaceWithScreenID_/BARBUTTONS",e.HMI_ABSTRACT_SCREEN_BUTTONS="/QAPP/SCREENS/_replaceWithScreenID_/_replaceWithButtonID_",e.HMI_ABSTRACT_SCREEN_TAB_SINGLE="/QAPP/SCREENS/_replaceWithScreenID_/TAB",e.HMI_ABSTRACT_SCREEN_TABS="/QAPP/SCREENS/_replaceWithScreenID_/TABS/_replaceWithTabID_",
e.HMI_TABBED_SCREEN="/QAPP/SCREENS/TABBEDSCREEN",e.HMI_WEIGHING_SCREEN_BARBUTTONS="/QAPP/SCREENS/WEIGHING/BARBUTTONS",e.HMI_WEIGHING_SCREEN_INSTRUCTION1="/QAPP/SCREENS/WEIGHING/TEXT1",e.HMI_WEIGHING_SCREEN_INSTRUCTION2="/QAPP/SCREENS/WEIGHING/TEXT2",e.HMI_WEIGHING_SCREEN_TITLE="/QAPP/SCREENS/WEIGHING/NAVIGATION/TEXT",e.HMI_WEIGHING_SCREEN_PARAM1_TOPIC="/QAPP/SCREENS/WEIGHING/PARAM1",e.HMI_WEIGHING_SCREEN_PARAM2_TOPIC="/QAPP/SCREENS/WEIGHING/PARAM2",e.HMI_WEIGHINGSPLIT_SCREEN_BARBUTTONS="/QAPP/SCREENS/WEIGHINGSPLIT/BARBUTTONS",e.HMI_WEIGHINGSPLIT_SCREEN_INSTRUCTION1="/QAPP/SCREENS/WEIGHINGSPLIT/TEXT1",e.HMI_WEIGHINGSPLIT_SCREEN_INSTRUCTION2="/QAPP/SCREENS/WEIGHINGSPLIT/TEXT2",e.HMI_WEIGHINGSPLIT_SCREEN_TITLE="/QAPP/SCREENS/WEIGHINGSPLIT/NAVIGATION/TEXT",e.HMI_WEIGHINGSPLIT_SCREEN_PARAM1_TOPIC="/QAPP/SCREENS/WEIGHINGSPLIT/PARAM1",e.HMI_WEIGHINGSPLIT_SCREEN_PARAM2_TOPIC="/QAPP/SCREENS/WEIGHINGSPLIT/PARAM2",e.HMI_CHECKBARGRAPH_STATUS="/QAPP/CHECKBARGRAPH/STATUS",
e.HMI_CHECKBARGRAPH_VALUE="/QAPP/CHECKBARGRAPH/VALUE",e.HMI_QAPP_PARAMETER_INPUT="/QAPP/PARAMETER_INPUT",e.HMI_LOCK_SCREEN="/QAPP/SCREENS/LOCK",e.HMI_LOCK_LOADING_MODAL="/QAPP/SCREENS/LOCK/LOADING_MODAL",e.HMI_SINGLETABBUTTONBAR_SCREEN="/QAPP/SCREENS/SINGLETABBUTTONBARSCREEN",e.HMI_SINGLETABBUTTONBAR_SCREEN_BARBUTTONS="/QAPP/SCREENS/SINGLETABBUTTONBARSCREEN/BARBUTTONS",e.HMI_SINGLETABBUTTONBAR_SCREEN_TOPLEFTBUTTON="/QAPP/SCREENS/SINGLETABBUTTONBARSCREEN/TOPLEFTBUTTON",e.HMI_LOCK_LOADING_MODAL_TEXT="/QAPP/SCREENS/LOCK/LOADING_MODAL/TEXT",e.HMI_LOCK_LOADING_MODAL_APPEARANCE="/QAPP/SCREENS/LOCK/LOADING_MODAL/APPEARANCE",e.HMI_LOCK_MESSAGEBOX="/QAPP/SCREENS/LOCK/MESSAGEBOX",e.HMI_LOCK_RESET="/QAPP/SCREENS/LOCK/RESET",e.HMI_LOCK_UNLOCK="/QAPP/SCREENS/LOCK/UNLOCK",e.HMI_LOADING_MODAL="HMI/LOADING_MODAL",e.HMI_LOADING_MODAL_TEXT="HMI/LOADING_MODAL/TEXT",e.HMI_LOADING_MODAL_APPEARANCE="HMI/LOADING_MODAL/APPEARANCE",e.HMI_MESSAGEBOX="/QAPP/MESSAGEBOX",
e.HMI_PARAMDETAILSOVERLAY="/QAPP/PARAMDETAILSOVERLAY",e.HMI_PRINT_HEADER="/HMI/PRINT_HEADER",e.MESSAGE_HANDLER_MESSAGE="/MESSAGE_HANDLER/MESSAGE",e.WEIGHING_VALUE_NET="WEIGHING/WEIGHT/NET",e.WEIGHING_VALUE_NET_HIGH_RES="WEIGHING/WEIGHT/NET_HIGH_RES",e.WEIGHING_VALUE_TARE="WEIGHING/WEIGHT/TARE",e.WEIGHING_VALUE_TARE1="WEIGHING/WEIGHT/TARE1",e.WEIGHING_VALUE_TARE2="WEIGHING/WEIGHT/TARE2",e.WEIGHING_VALUE_GROSS="WEIGHING/WEIGHT/GROSS_CALC",e.WEIGHING_VALUE_DISPLAY="WEIGHING/WEIGHT/DISPLAY",e.WEIGHING_SELECTED_DISPLAY_VALUE="WEIGHING/WEIGHT/DISPLAY/SELECTED",e.WEIGHING_WEIGHT_BLOCK="WEIGHING/WEIGHT/BLOCK",e.WEIGHING_WAITING_FOR_STABILITY="WEIGHING/WAITING_FOR_STABILITY",e.WEIGHING_STATUS_ERROR="WEIGHING/STATUS/ERROR ",e.WEIGHING_TARE_BLOCK="WEIGHING/DOING_ZERO_TARE",e.WEIGHING_STATE="WEIGHING/STATE",e.SURE_ACTIVE="/WEIGHING/SURE/ACTIVE",e.SURE_RANGE_1_A="/WEIGHING/SURE/PARAM_SURE_RANGE_1_A",e.SURE_RANGE_1_B="/WEIGHING/SURE/PARAM_SURE_RANGE_1_B",
e.SURE_RANGE_1_B_EXP="/WEIGHING/SURE/PARAM_SURE_RANGE_1_B_EXP",e.SURE_RANGE_2_A="/WEIGHING/SURE/PARAM_SURE_RANGE_2_A",e.SURE_RANGE_2_B="/WEIGHING/SURE/PARAM_SURE_RANGE_2_B",e.SURE_RANGE_2_B_EXP="/WEIGHING/SURE/PARAM_SURE_RANGE_2_B_EXP",e.SURE_RANGE_3_A="/WEIGHING/SURE/PARAM_SURE_RANGE_3_A",e.SURE_RANGE_3_B="/WEIGHING/SURE/PARAM_SURE_RANGE_3_B",e.SURE_RANGE_3_B_EXP="/WEIGHING/SURE/PARAM_SURE_RANGE_3_B_EXP",e.METROLOGY_MAX_DIGITS="WEIGHING/METROLOGY/MAXIMUM_DIGITS",e.METROLOGY_MAX_DIGITS_DEBUG="/QAPP/DEBUG/WEIGHING/METROLOGY/MAXIMUM_DIGITS",e.METROLOGY_RANGES="WEIGHING/METROLOGY/RANGES",e.METROLOGY_APPROVED_FOR_VERIFICATION="WEIGHING/METROLOGY/APPROVED_FOR_VERIFICATION",e.ESIGNATURE_PERFORM="/HMI/PERFORM_SIGNATURE",e.ESIGNATURE_RESULT="/HMI/ELECTRONIC_SIGNATURE_RESULT",e.REPORTING_PRINTABLE_VALUE="/REPORTING/PRINTABLE_VALUE",e.REPORTING_PRINTQUEUE_DISPLAYED="/HMI/PRINT_QUEUE",e.REPORTING_PRINT_PROCESS_RESULT="/REPORTING/PRINT_PROCESS",
e.CUSTOMIZED_WEIGHT_DISPLAY_VALUE="/QAPP/WEIGHING/WEIGHT/APPLICATION/_replaceWithUniqueID_/VALUE",e.CUSTOMIZED_REST_HANDLER_CONFIGURATION="/QAPP/REST/CFG",e.COMM_QAPP_DIRECT_INTERFACE="/QAPP/QAPP_DIRECT_INTERFACE",e.COMM_FILE_OPERATIONS_ASYNC_TOKEN="/CONNECTORMANAGEMENT/PROGRESS/_generatedToken_"}(t.MqttTopics||(t.MqttTopics={}))},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cloneJSON=function(e){return JSON.parse(JSON.stringify(e))}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(2),i=a(22),n=a(0);t.isTypeOfIDateTimeParameter=function(e){return e.type===n.EnumParameterTypes.PARAM_DATE_TIME},t.isTypeOfIMultipleSelectionParameter=function(e){return e.type===n.EnumParameterTypes.PARAM_MULTIPLE_SELECTION},t.isTypeOfISelectionParameter=function(e){return e.type===n.EnumParameterTypes.PARAM_SELECTION},t.isTypeOfIQuantityParameter=function(e){return e.type===n.EnumParameterTypes.PARAM_QUANTITY},
t.isTypeOfIMeasureParameter=function(e){return e.type===n.EnumParameterTypes.PARAM_MEASURE},t.isTypeOfIStringParameter=function(e){return e.type===n.EnumParameterTypes.PARAM_STRING},t.isTypeOfIAlibiIdentifierParameter=function(e){return e.type===n.EnumParameterTypes.ALIBI_IDENTIFIER},t.isTypeOfITextParameter=function(e){return e.type===n.EnumParameterTypes.PARAM_TEXT},t.isTypeOfIFormulaParameter=function(e){return e.type===n.EnumParameterTypes.PARAM_FORMULA},t.isTypeOfIPasswordParameter=function(e){return e.type===n.EnumParameterTypes.PARAM_PASSWORD},t.isITextStructure=function(e){return"string"==typeof e.id&&"object"==typeof e.args&&e.args instanceof Array};const r={id:"",args:[]};function o(e){const t=s.cloneJSON(r);return i.isString(e)&&(t.id=e),t}t.createEmptyTextStructure=o;const l={id:"",type:n.EnumParameterTypes.PARAM_GROUP,title:o(),appearance:n.EnumAppearance.HIDDEN,parameters:[]};function E(e){const t=s.cloneJSON(l);return i.isString(e)&&(t.id=e),t}
t.createEmptyParameterGroup=E;const _={id:"",type:n.EnumParameterTypes.PARAM_GROUP,title:o(),appearance:n.EnumAppearance.HIDDEN,parameters:[E()]};t.createEmptyParameterGroupOfGroups=function(){return s.cloneJSON(_)};const u={appearance:n.EnumAppearance.HIDDEN,id:"",text:o()};t.createEmptySelectionParameterOption=function(){return s.cloneJSON(u)};const c={id:"",type:n.EnumParameterTypes.PARAM_SELECTION,value:{selection:{id:""}},header:o(),title:o(),info:{options:[u]},appearance:n.EnumAppearance.HIDDEN};t.createEmptySelectionParameter=function(e){const t=s.cloneJSON(c);return i.isString(e)&&(t.id=e),t};const A={id:"",type:n.EnumParameterTypes.PARAM_MULTIPLE_SELECTION,value:{selections:[]},header:o(),title:o(),info:{options:[u]},appearance:n.EnumAppearance.HIDDEN};t.createEmptyMultipleSelectionParameter=function(e){const t=s.cloneJSON(A);return i.isString(e)&&(t.id=e),t},t.SAMPLE_DATE_TIME_ID="SAMPLE_DATE_TIME_ID";const p={id:t.SAMPLE_DATE_TIME_ID,
type:n.EnumParameterTypes.PARAM_DATE_TIME,value:{timestamp:0},title:{id:"_QAPP_LIB_PARAM_TITLE_SAMPLE_DATETIME",args:[]},header:{id:"_QAPP_LIB_PARAM_HEADER_SAMPLE_DATETIME",args:[]},info:{isDate:!0,isTime:!0},appearance:n.EnumAppearance.HIDDEN};t.createEmptyDateTimeParameter=function(e){const t=s.cloneJSON(p);return i.isString(e)&&(t.id=e),t};const d={id:"",type:n.EnumParameterTypes.PARAM_STRING,value:{string:""},header:o(),title:o(),info:{minimum:{length:0},maximum:{length:0}},appearance:n.EnumAppearance.HIDDEN};t.createEmptyStringParameter=function(e){const t=s.cloneJSON(d);return i.isString(e)&&(t.id=e),t};const T={id:"",type:n.EnumParameterTypes.PARAM_BARCODE,value:{string:"",format:n.EnumBarcodeFormats.CODE128,width:120},header:o(),title:o(),appearance:n.EnumAppearance.HIDDEN};t.createEmptyBarcodeParameter=function(e){const t=s.cloneJSON(T);return i.isString(e)&&(t.id=e),t};const I={id:"",type:n.EnumParameterTypes.PARAM_PASSWORD,value:{string:""},header:o(),title:o(),info:{
passwordLength:0,minimum:{length:0},maximum:{length:0}},appearance:n.EnumAppearance.HIDDEN};t.createEmptyPasswordParameter=function(e){const t=s.cloneJSON(I);return i.isString(e)&&(t.id=e),t};const h={id:"",type:n.EnumParameterTypes.PARAM_TEXT,value:{text:o()},header:o(),title:o(),appearance:n.EnumAppearance.HIDDEN,info:{suppressTitle:!1}};t.createEmptyTextParameter=function(e){const t=s.cloneJSON(h);return i.isString(e)&&(t.id=e),t},t.createEmptyTextParameterValueOnly=function(){let e=s.cloneJSON(h);return e.info.suppressTitle=!0,e};const N={visual:"",eval:""};t.createEmptyFormulaParameterValue=function(){return s.cloneJSON(N)};const m={id:"",type:n.EnumParameterTypes.PARAM_FORMULA,value:[],header:o(),title:o(),appearance:n.EnumAppearance.HIDDEN,info:{maximum:{length:0}}};t.createEmptyFormulaParameter=function(e){const t=s.cloneJSON(m);return i.isString(e)&&(t.id=e),t};const S={mark:"",sign:"",number:"0",decimals:0,auxiliaryDigits:0,unit:"",interval:1,isStable:!1,isSpecial:!1,
isWarning:!1,isInvalid:!0};t.createEmptyMeasureParameterValue=function(){return s.cloneJSON(S)};const R={id:"",type:n.EnumParameterTypes.PARAM_MEASURE,value:S,header:o(),title:o(),appearance:n.EnumAppearance.HIDDEN};t.createEmptyMeasureParameter=function(e){const t=s.cloneJSON(R);return i.isString(e)&&(t.id=e),t};const P={decimals:0,preferredDecimals:0,numbers:[],unit:""};t.createEmptyQuantityParameterValue=function(){return s.cloneJSON(P)},t.QUANTITY_PARAM_MIN_MAX_NAN="nan",t.QUANTITY_PARAM_NUMBERS_MAX=3;const g={id:"",type:n.EnumParameterTypes.PARAM_QUANTITY,value:P,header:o(),title:o(),info:{minimum:{value:t.QUANTITY_PARAM_MIN_MAX_NAN},maximum:{value:t.QUANTITY_PARAM_MIN_MAX_NAN}},appearance:n.EnumAppearance.HIDDEN};t.createEmptyQuantityParameter=function(e){const t=s.cloneJSON(g);return i.isString(e)&&(t.id=e),t};const D={id:"",type:n.EnumParameterTypes.ALIBI_IDENTIFIER,value:{alibiIdentifier:NaN},header:o(),title:o(),appearance:n.EnumAppearance.ENABLED}
;t.createEmptyAlibiIdentifier=function(){return s.cloneJSON(D)}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(7),i=a(1);var n;!function(e){e[e.SHOW_SCREEN=0]="SHOW_SCREEN",e[e.HIDE_SCREEN=1]="HIDE_SCREEN",e[e.SHOW_OVERLAY=2]="SHOW_OVERLAY",e[e.HIDE_OVERLAY=3]="HIDE_OVERLAY",e[e.SHOW_LOADINGSCREEN=4]="SHOW_LOADINGSCREEN",e[e.HIDE_LOADINGSCREEN=5]="HIDE_LOADINGSCREEN",e[e.SHOW_MESSAGEBOX=6]="SHOW_MESSAGEBOX",e[e.HIDE_MESSAGEBOX=7]="HIDE_MESSAGEBOX",e[e.SHOW_LOCKSCREEN=8]="SHOW_LOCKSCREEN",e[e.HIDE_LOCKSCREEN=9]="HIDE_LOCKSCREEN",e[e.SHOW_LOCKLOADINGSCREEN=10]="SHOW_LOCKLOADINGSCREEN",e[e.HIDE_LOCKLOADINGSCREEN=11]="HIDE_LOCKLOADINGSCREEN",e[e.SHOW_LOCKMESSAGEBOX=12]="SHOW_LOCKMESSAGEBOX",e[e.HIDE_LOCKMESSAGEBOX=13]="HIDE_LOCKMESSAGEBOX"}(n=t.ScreenEventType||(t.ScreenEventType={}));t.AbstractScreen=class{constructor(e){this.events$=new s.Subject,this.mqttHandler=e}show(){
console.log("AbstractScreen: show "+this.getId()+" @ "+i.MqttTopics.HMI_ACTIVE_QAPP_SCREEN),this.mqttHandler.publish(i.MqttTopics.HMI_ACTIVE_QAPP_SCREEN,'{ "screen":"'+this.getId()+'" }'),this.events$.next({type:n.SHOW_SCREEN,id:this.getId()})}hide(){}publishContent(e,t,a=!0){let s=e?this.getMqttTopicBaseExtensible()+e:this.getMqttTopicBase();console.log("AbstractScreen: publishContent @ "+s),this.mqttHandler.publish(s,t,{retain:a})}getMqttTopicBase(){return"SCREENS/"+this.getId()}getMqttTopicBaseExtensible(){return this.getMqttTopicBase()+"/"}getButton(e){}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(38),i="SUCCESS",n="FAILED";t.CubisRestResponse=class{constructor(e){if(this.restResponse=void 0,"boolean"==typeof e)this.result=e?i:n,this.rawReturns={};else{let t;this.restResponse=e;try{t=JSON.parse(this.restResponse.stdout.toString())}catch(e){throw e.message+="\nreceived: "+this.restResponse.stdout.toString(),e}this.rawReturns=t.returns,
this.result=t.result}}isSuccess(){return this.result===i}};t.BaseProxy=class{constructor(){this.body={method:"",params:{}}}syncRequest(){let e,t=JSON.stringify(this.body),a=`http://127.0.0.1:8080/rest/${this.restEndpoint}`;const i=process.hrtime();let n=[a,"-H","Accept:application/json","-H","Content-Type:application/json","-H","Expect:","--data","@-"];e=s.spawnSync("curl",n,{input:t});const r=process.hrtime(i);return console.log(`${this.body.method} (hr): ${r[0]}s ${r[1]/1e6}ms`),e}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.printParameters="printParameters",e.printPrintQueueWithElectronicSignature="printPrintQueueWithElectronicSignature",e.printParametersDirect="printParametersDirect",e.getPrintQueue="getPrintQueue",e.isPrintQueueEmpty="isPrintQueueEmpty",e.clearPrintQueue="clearPrintQueue",e.requestPrintableValueComment="requestPrintableValueComment",e.setRedactionStatus="setRedactionStatus",e.getAlibiRecord="getAlibiRecord",
e.getAlibiRecordList="getAlibiRecordList",e.setPathAndFilenameForNextReport="setPathAndFilenameForNextReport",e.setMetaDataInCurrentReport="setMetaDataInCurrentReport",e.applyProfiles="applyProfiles",e.printParametersWithProfile="printParametersWithProfile"}(t.RestMethodsREPORTING||(t.RestMethodsREPORTING={})),function(e){e.getTemperature="getTemperature",e.getHumidity="getHumidity",e.getAirPressure="getAirPressure",e.getAirDensity="getAirDensity",e.getTemperatureUncertainty="getTemperatureUncertainty",e.getHumidityUncertainty="getHumidityUncertainty",e.getAirPressureUncertainty="getAirPressureUncertainty",e.getConfigurationData="getConfigurationData"}(t.RestMethodsCLIMATECONTROL||(t.RestMethodsCLIMATECONTROL={})),function(e){e.getWorkstate="getWorkstate",e.getTaskTemplate="getTaskTemplate",e.createTask="createTask",e.readTask="readTask",e.updateTask="updateTask",e.validate="validate",e.saveWorkstate="saveWorkstate",e.deleteWorkstate="deleteWorkstate",
e.getTaskNamesByOrderNumber="getTaskNamesByOrderNumber",e.setTaskEvent="setTaskEvent"}(t.RestMethodsTASK_MANAGEMENT||(t.RestMethodsTASK_MANAGEMENT={})),function(e){e.getCurrentUser="getCurrentUser",e.checkRightsOfCurrentUser="checkRightsOfCurrentUser"}(t.RestMethodsACCESS_MANAGEMENT||(t.RestMethodsACCESS_MANAGEMENT={})),function(e){e.addEventExt="addEventExt",e.getRecords="getRecords"}(t.RestMethodsAUDITTRAIL||(t.RestMethodsAUDITTRAIL={})),function(e){e.startInternCal="startInternCal",e.disableAutoIsoCal="disableAutoIsoCal"}(t.RestMethodsCALIBRATION||(t.RestMethodsCALIBRATION={})),function(e){e.getFormatConfiguration="getFormatConfiguration",e.getFormatConfigurationI18n="getFormatConfigurationI18n"}(t.RestMethodsCLOCK_HANDLER||(t.RestMethodsCLOCK_HANDLER={})),function(e){e.getConfigurations="getConfigurations",e.putFileAsync="putFileAsync",e.putFileAsyncWithoutMD5="putFileAsyncWithoutMD5",e.getFileAsyncWithoutMD5="getFileAsyncWithoutMD5",e.listDirectory="listDirectory"
}(t.RestMethodsCONNECTOR_MANAGEMENT||(t.RestMethodsCONNECTOR_MANAGEMENT={})),function(e){e.getSerialNoBalance="getSerialNoBalance",e.getModelName="getModelName",e.getVersionBalance="getVersionBalance",e.getVersionPackage="getVersionPackage",e.getParameter="getParameter",e.sendUDPBroadcast="sendUDPBroadcast",e.cancelUDP="cancelUDP",e.listenUDP="listenUDP",e.addRunningActivity="addRunningActivity",e.removeRunningActivity="removeRunningActivity",e.setActuatorsActive="setActuatorsActive",e.setDeviceCleaned="setDeviceCleaned"}(t.RestMethodsDEVICE_INFORMATION||(t.RestMethodsDEVICE_INFORMATION={})),function(e){e.getQappProtocolPortNumber="getQappProtocolPortNumber",e.getQappProtocolInterfaces="getQappProtocolInterfaces",e.isInterfaceActive="isInterfaceActive",e.setGPIOPorts="setGPIOPorts"}(t.RestMethodsINTERFACE_MANAGEMENT||(t.RestMethodsINTERFACE_MANAGEMENT={})),function(e){e.getLanguage="getLanguage",e.getText="getText",e.getTexts="getTexts"
}(t.RestMethodsLOCALIZER||(t.RestMethodsLOCALIZER={})),function(e){e.addMessage="addMessage",e.deleteMessageByCategory="deleteMessageByCategory",e.getAllMessagesByCategory="getAllMessagesByCategory",e.deleteMessagesByCategory="deleteMessagesByCategory",e.removeMessage="removeMessage"}(t.RestMethodsMESSAGE_HANDLER||(t.RestMethodsMESSAGE_HANDLER={})),function(e){e.loadProfile="loadProfile",e.getProfiles="getProfiles"}(t.RestMethodsPROFILE_MANAGEMENT||(t.RestMethodsPROFILE_MANAGEMENT={})),function(e){e.playEndOfActionSound="playEndOfActionSound",e.playMessageSound="playMessageSound"}(t.RestMethodsSOUND_MANAGEMENT||(t.RestMethodsSOUND_MANAGEMENT={})),function(e){e.isAutoLogout="isAutoLogout",e.getListRoles="getListRoles"}(t.RestMethodsUSER_MANAGEMENT||(t.RestMethodsUSER_MANAGEMENT={})),function(e){e.createWeightApplication="createWeightApplication",e.enableWeightApplication="enableWeightApplication",e.selectWeightApplication="selectWeightApplication",
e.destroyWeightApplication="destroyWeightApplication",e.setButton="setButton",e.triggerStableWeightBlock="triggerStableWeightBlock",e.cancelStableWeightBlock="cancelStableWeightBlock",e.doZero="doZero",e.clearTare="clearTare",e.clearTare1="clearTare1",e.clearTare2="clearTare2",e.clearTareAll="clearTareAll",e.doTare="doTare",e.doTare1="doTare1",e.doTare2="doTare2",e.doTareAuto="doTareAuto",e.doZeroTare="doZeroTare",e.doZeroTareAuto="doZeroTareAuto",e.setTare1="setTare1",e.cancelDoing="cancelDoing",e.setTare2="setTare2",e.setUnit="setUnit",e.getParameter="getParameter",e.getParameterIds="getParameterIds",e.getRangeParameters="getRangeParameters",e.setMinUsp="setMinUsp",e.setMinWeight="setMinWeight",e.insertWeightInvalidation="insertWeightInvalidation",e.removeWeightInvalidation="removeWeightInvalidation",e.setAmbientCondition="setAmbientCondition"}(t.RestMethodsWEIGHING||(t.RestMethodsWEIGHING={})),function(e){e.openLast="openLast",e.closeAll="closeAll",e.openLeft="openLeft",
e.openRight="openRight",e.openTop="openTop"}(t.RestMethodsDRAFTSHIELD||(t.RestMethodsDRAFTSHIELD={})),function(e){e.setJobStatusAndReason="setJobStatusAndReason"}(t.RestMethodsJOB_MANAGEMENT||(t.RestMethodsJOB_MANAGEMENT={})),function(e){e.disableChecker="disableChecker",e.enableChecker="enableChecker"}(t.RestMethodsSELF_MONITOR||(t.RestMethodsSELF_MONITOR={})),function(e){e.start="start"}(t.RestMethodsLEVELING||(t.RestMethodsLEVELING={})),function(e){e.getConfigData="getConfigData"}(t.RestMethodsMENU_HANDLER||(t.RestMethodsMENU_HANDLER={}))},function(e,t){e.exports=require("rxjs/Subject")},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(3),i=a(27),n=a(14),r=a(16),o=a(0);t.QUANTITY_PARAM_MAX_DIGITS_GENERAL=9;class l{static setValue(e,a,s=0,i=t.QUANTITY_PARAM_MAX_DIGITS_GENERAL){return l.setValueValueWithDecimals(e.value,a,e.value.preferredDecimals,s,i)}static setValueValue(e,a,s=0,i=t.QUANTITY_PARAM_MAX_DIGITS_GENERAL){
return l.setValueValueWithDecimals(e,a,e.preferredDecimals,s,i)}static setValueWithDecimals(e,a,s,i=0,n=t.QUANTITY_PARAM_MAX_DIGITS_GENERAL){return l.setValueValueWithDecimals(e.value,a,s,i,n)}static setValueValueWithDecimals(e,a,r,o=0,l=t.QUANTITY_PARAM_MAX_DIGITS_GENERAL,E=!1){let _="number"==typeof a?a:a.value,u=l-Math.floor(Math.abs(_)).toString().length,c=Math.min(u,r);c=Math.max(c,0),0===o&&e&&(e.decimals=c);let A=i.SartoMath.roundExactToDecimals(_,c).toFixed(c);if(e){if(E||0!==o)"number"!=typeof a&&(n.isArray(e.unit)?e.unit[0]=a.unit:e.unit=a.unit);else{for(let t=s.QUANTITY_PARAM_NUMBERS_MAX-2;t>=o;t--)void 0!==e.numbers[t]&&(e.numbers[t+1]=e.numbers[t]);if("number"==typeof a){if(n.isArray(e.unit))for(let t=s.QUANTITY_PARAM_NUMBERS_MAX-2;t>=o;t--)void 0!==e.unit[t]&&(e.unit[t+1]=e.unit[t])}else if(n.isArray(e.unit)){for(let t=s.QUANTITY_PARAM_NUMBERS_MAX-2;t>=o;t--)void 0!==e.unit[t]&&(e.unit[t+1]=e.unit[t]);e.unit[0]=a.unit}else e.unit=a.unit}e.numbers[o]=A}return A}
static roundToDecimalPlaces(e,a=t.QUANTITY_PARAM_MAX_DIGITS_GENERAL){return l.roundToDecimalPlacesValue(e.value,a)}static roundToDecimalPlacesAllNumbers(e,a=t.QUANTITY_PARAM_MAX_DIGITS_GENERAL){return l.roundToDecimalPlacesValue(e.value,a,!0)}static roundToDecimalPlacesValue(e,a=t.QUANTITY_PARAM_MAX_DIGITS_GENERAL,s=!1){return e.numbers.forEach((t,i)=>{(0===i||s)&&-1!==e.preferredDecimals&&l.setValueValueWithDecimals(e,parseFloat(t),e.preferredDecimals,i,a,!0)}),e.numbers.map(e=>parseFloat(e))}static getValue(e,t=0){let a,s=(a=void 0!==e.value?e.value:e).numbers[t];return void 0!==s?parseFloat(s):Number.NaN}static getIntValue(e,t=0){let a,s=(a=void 0!==e.value?e.value:e).numbers[t];return void 0!==s?parseInt(s,10):Number.NaN}static changeUnit(e,a){let s;s=void 0!==e.value?e.value:e;const i=r.unitStringToLong(s.unit);s.numbers.forEach((e,n)=>{const o=r.convertWgtUnit(parseFloat(e),i,a);l.setValueValueWithDecimals(s,o,s.preferredDecimals,n,t.QUANTITY_PARAM_MAX_DIGITS_GENERAL,!0)}),
s.unit=r.unitStringToShort(a)}}t.QuantityParameter=l;t.WeightBlockHelper=class{static getMeasureParameter(e,t){for(const a of e.parameters)for(const e of a.parameters)if(e.id===t&&e.type===o.EnumParameterTypes.PARAM_MEASURE)return e}}},function(e,t){e.exports=require("lodash")},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(0),i=a(2);function n(e){return i.cloneJSON({module:"qappHandler",method:"buttonClickEvent",params:{buttonId:e||""}})}function r(e){let t={nameId:"",appearance:"HIDDEN",type:"",label:{id:"",args:[]},effect:n()};return void 0!==e.nameId&&(t.nameId=e.nameId),void 0!==e.labelCenter&&(t.labelCenter=e.labelCenter),void 0!==e.labelRight&&(t.labelRight=e.labelRight),void 0!==e.icon&&(t.icon=e.icon),void 0!==e.lastSelected&&(t.lastSelected=e.lastSelected),t.label=e.label,t.appearance=e.appearance,t.effect.params.buttonId=e.buttonId,e.longPressButtonId&&(t.longPressEffect=n(),t.longPressEffect.params.buttonId=e.longPressButtonId),
void 0!==e.labelAlign&&(t.labelAlign=e.labelAlign),void 0!==e.labelCenterAlign&&(t.labelCenterAlign=e.labelCenterAlign),void 0!==e.labelRightAlign&&(t.labelRightAlign=e.labelRightAlign),t}t.createButtonEmptyEffect=n,t.IButtonParameterInterface2IButtonJsonInterface=r,t.IButtonJsonInterface2IButtonParameterInterface=function(e){let t={buttonId:e.effect.params.buttonId,appearance:e.appearance,label:e.label};return e.nameId&&(t.nameId=e.nameId),e.labelCenter&&(t.labelCenter=e.labelCenter),e.labelRight&&(t.labelRight=e.labelRight),e.longPressEffect&&(t.longPressButtonId=e.longPressEffect.params.buttonId),void 0!==e.icon&&(t.icon=e.icon),void 0!==e.lastSelected&&(t.lastSelected=e.lastSelected),void 0!==e.labelAlign&&(t.labelAlign=e.labelAlign),void 0!==e.labelCenterAlign&&(t.labelCenterAlign=e.labelCenterAlign),void 0!==e.labelRightAlign&&(t.labelRightAlign=e.labelRightAlign),t};class o{constructor(e,t,a){this.lastPublishedTabContent="",this.mqttHandler=e,
this.buttonTopic="SCREENS/"+t.getId()+"/"+a.buttonId,this.buttonJson=r(a)}setButtonId(e,t=!0){this.buttonJson.effect.params.buttonId=e,t&&this.publish()}setLongPressButtonId(e,t=!0){e?(this.buttonJson.longPressEffect||(this.buttonJson.longPressEffect=n()),this.buttonJson.longPressEffect.params.buttonId=e):delete this.buttonJson.longPressEffect,t&&this.publish()}setJson(e){this.buttonJson=JSON.parse(e),this.publish()}setNameId(e,t=!0){this.buttonJson.nameId=e,t&&this.publish()}getNameId(){return this.buttonJson.nameId}setAppearance(e,t=!0){this.buttonJson.appearance=e,t&&this.publish()}setType(e,t=!0){this.buttonJson.type=e,t&&this.publish()}getType(){return this.buttonJson.type}getLabel(){return this.buttonJson.label}setLabel(e,t=!0){this.buttonJson.label=e,t&&this.publish()}getIcon(){return this.buttonJson.icon}setIcon(e,t=!0){void 0!==e&&e.length>0?this.buttonJson.icon=e:delete this.buttonJson.icon,t&&this.publish()}getLabelCenter(){return this.buttonJson.labelCenter}
setLabelCenter(e,t=!0){this.buttonJson.labelCenter=e,t&&this.publish()}getLabelRight(){return this.buttonJson.labelRight}setLabelRight(e,t=!0){this.buttonJson.labelRight=e,t&&this.publish()}getAppearance(){let e=s.EnumAppearance.HIDDEN;return this.buttonJson.appearance&&"string"==typeof this.buttonJson.appearance&&Object.keys(s.EnumAppearance).indexOf(this.buttonJson.appearance)?this.buttonJson.appearance:e}getJson(){return this.buttonJson}getTopic(){return this.buttonTopic}getButtonId(){return this.buttonJson.effect.params.buttonId}getLongPressButtonId(){return this.buttonJson.longPressEffect?this.buttonJson.longPressEffect.params.buttonId:null}publish(){let e=JSON.stringify(this.buttonJson);e!==this.lastPublishedTabContent&&(this.mqttHandler.publish(this.buttonTopic,e),this.lastPublishedTabContent=e)}show(){this.publish()}}t.Button=o,t.default=o},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.INFO="INFO",e.ERROR="ERROR",
e.WARNING="WARNING",e.QUESTION="QUESTION"}(t.EnumMessageboxType||(t.EnumMessageboxType={}))},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ZERO="_FONT_ICON_ZERO",e.TARE="_FONT_ICON_TARE",e.TARE_1="_FONT_ICON_TARE1",e.CLR_TARE1="_FONT_ICON_CLR_TARE1",e.SHOW_TARE1="_FONT_ICON_SHOW_TARE1",e.HIDE_TARE1="_FONT_ICON_HIDE_TARE1",e.DELETE="_FONT_ICON_DELETE",e.EDIT="_FONT_ICON_EDIT",e.PRINT="_FONT_ICON_PRINT",e.OK="_FONT_ICON_OK",e.CANCEL="_FONT_ICON_CANCEL",e.ERROR="_FONT_ICON_ERROR",e.WARNING="_FONT_ICON_WARNING",e.INFO="_FONT_ICON_INFO",e.NEXT="_FONT_ICON_NEXT",e.PREV="_FONT_ICON_PREV",e.RESULT="_FONT_ICON_RESULT",e.IONIZER="_FONT_ICON_IONIZER",e.PRINT_ADD="_FONT_ICON_PRINT_ADD",e.X_ACROSS="_FONT_ICON_X_ACROSS",e.RESULT_ADD="_FONT_ICON_RESULT_ADD",e.RHO="_FONT_ICON_RHO",e.BACK="_FONT_ICON_BACK",e.MIN_USP="_FONT_ICON_MIN_USP",e.START="_FONT_ICON_START",e.END="_FONT_ICON_END",e.DOCU="_FONT_ICON_DOCU",
e.INVALIDATE_SAMPLE="_FONT_ICON_INVALID_SAMPLE",e.SEARCH="_FONT_ICON_SEARCH",e.SEARCH_ACTIVE="_FONT_ICON_SEARCH_ACTIVE",e.FILTER="_FONT_ICON_FILTER",e.FILTER_ACTIVE="_FONT_ICON_FILTER_ACTIVE",e.ADD="_FONT_ICON_ADD",e.LOGOUT="_FONT_ICON_LOGOUT",e.RELOAD="_FONT_ICON_RELOAD",e.WEIGHING="_FONT_ICON_WEIGHING",e.QUESTION="_FONT_ICON_QUESTION",e.SKIP="_FONT_ICON_SKIP"}(t.EnumFontLabels||(t.EnumFontLabels={}))},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QAPP_TIMER_EVENT="QAPP_TIMER_EVENT";t.QAppTimerEvent=class{constructor(e){this.payload=e,this.type=t.QAPP_TIMER_EVENT}},t.QAPP_INTERVAL_EVENT="QAPP_INTERVAL_EVENT";t.QAppIntervalEvent=class{constructor(e){this.payload=e,this.type=t.QAPP_INTERVAL_EVENT}},t.IMMEDIATE_EVENT="IMMEDIATE_EVENT";t.ImmediateEvent=class{constructor(e){this.payload=e,this.type=t.IMMEDIATE_EVENT}},t.SIMPLE_EVENT="SIMPLE_EVENT";t.SimpleEvent=class{constructor(e){this.payload=e,this.type=t.SIMPLE_EVENT}},
t.QAPP_SYNC_CALL_DONE_EVENT="QAPP_SYNC_CALL_DONE_EVENT",function(e){e.SYNC_CALL_SAVE_WORKSTATE="SYNC_CALL_SAVE_WORKSTATE"}(t.QAPP_SYNC_CALL_DONE_EVENT_TYPE||(t.QAPP_SYNC_CALL_DONE_EVENT_TYPE={}));t.QAppSyncCallDoneEvent=class{constructor(e){this.payload=e,this.type=t.QAPP_SYNC_CALL_DONE_EVENT}},t.QAPP_ASYNC_CALL_DONE_EVENT="QAPP_ASYNC_CALL_DONE_EVENT",t.QAPP_ASYNC_CALL_FAIL_EVENT="QAPP_ASYNC_CALL_FAIL_EVENT";t.QAppAsyncCallDoneEvent=class{constructor(e){this.payload=e,this.type=t.QAPP_ASYNC_CALL_DONE_EVENT}};t.QAppAsyncCallFailEvent=class{constructor(e){this.payload=e,this.type=t.QAPP_ASYNC_CALL_FAIL_EVENT}}},function(e,t){e.exports=require("util")},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(11),i=a(0),n=a(12);t.ParamUpdateUserActionSimpleAccept_OK_BUTTON_ID="BTN_OK",t.ParamUpdateUserActionSimpleAccept={type:s.EnumMessageboxType.ERROR,title:{id:"_QAPP_LIB_MSG_BOX_WARNING_UPDATE_TASK_PARAM",args:[]},textList:[],buttons:[{
appearance:i.EnumAppearance.ENABLED_SECONDARY,label:{id:n.EnumFontLabels.OK,args:[]},id:t.ParamUpdateUserActionSimpleAccept_OK_BUTTON_ID}]}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(27),i=a(17);var n=a(17);t.bignumber=n.bignumber,t.abs=n.abs;const r=a(25);function o(e){let t=void 0;return r.unitsMap.hasOwnProperty(e)&&(t=r.unitsMap[e].conversionDecimalPlacesShift),void 0===t&&(t=1),t}var l;t.calcInterval=function(e,t,a){return i.bignumber(a).times(s.SartoMath.decPowers(o(e))).times(s.SartoMath.decPowers(-1*o(t))).toNumber()},t.calcDecimals=function(e){return e>=1?0:Math.ceil(-1*Math.log10(e))},t.unitStringToShort=function(e){return r.unitsMap.hasOwnProperty(e)?r.unitsMap[e].mark:r.unitsMap[r.EnumUnit.INVALID].mark},t.getUnitFactor=function(e){let t=void 0;return r.unitsMap.hasOwnProperty(e)&&(t=r.unitsMap[e].conversionFactor),void 0===t&&(t=1),t},t.getUnitShift=o,function(e){e.none="NONE",e.o="UNIVERSAL",e["µg"]="MICROGRAM",
e.mg="MILLIGRAM",e.g="GRAM",e.kg="KILOGRAM",e.t="TONNE",e.mct="MILLICARAT",e.ct="CARAT",e.kct="KILOCARAT",e.K="KARAT",e.lb="POUND",e.oz="OUNCE",e.lb_oz="POUND_OUNCE",e.ozt="TROYOUNCE",e.dwt="PENNYWEIGHT",e.GN="GRAIN",e.per_lb="PARTS_PER_POUND",e.tlh="TAEL_HONGKONG",e.tls="TAEL_SINGAPORE",e.tlt="TAEL_TAIWAN",e.tlc="TAEL_CHINA",e.mom="MOMME",e.tol="TOLA",e.bat="BATH",e.MS="MESGHAL",e.N="NEWTON",e.war="WARNING",e.pcs="PIECES",e.per="PERCENT",e.mm="MILLIMETER",e.cm="CENTIMETER",e.m="METER",e.km="KILOMETER",e.g_ml="GRAM_PER_MILLILITER",e.Mcls_ml="MILLION_CELLS_PER_MILLILITER",e["µg_ml"]="MICROGRAM_PER_MILLILITER",e["µg_l"]="MICROGRAM_PER_LITER",e.mg_ml="MILLIGRAM_PER_MILLILITER",e.mg_l="MILLIGRAM_PER_LITER",e.mmol_ml="MILLIMOL_PER_MILLILITER",e.g_cm3="DENSITY",e.cm3="VOLUME",e.cm2="SQUARECENTIMETRE",e.m2="SQUAREMETRE",e.g_cm2="GRAM_PER_SQUARE_CENTIMETER",e.g_m2="GRAMMAGE",e.g_m="GRAM_PER_METER",e["µl"]="MICROLITER",e.ml="MILLILITER",e.cl="CENTILITER",e.l="LITER",e.mmol="MILLIMOL",
e.C="GRAD_CELSIUS",e.F="GRAD_FAHRENHEIT",e.sec="SECOND",e.min="MINUTE",e.h="HOUR",e.am="TIME_AM",e.pm="TIME_PM",e.V="VOLT",e.mA="MILLIAMPER",e.hPa="HECTOPASCAL",e.kPa="KILOPASCAL",e.g_mol="GRAM_PER_MOL",e.kg_m3="KG_M3",e.mmHg="MMHG",e.invalid="!invalid!",e.rpm="RPM"}(l=t.EnumUnitStrings||(t.EnumUnitStrings={}));const E={[l.none]:"none",[l.o]:"o",[l.µg]:"µg",[l.mg]:"mg",[l.g]:"g",[l.kg]:"kg",[l.t]:"t",[l.mct]:"mct",[l.ct]:"ct",[l.kct]:"kct",[l.K]:"K",[l.lb]:"lb",[l.oz]:"oz",[l.lb_oz]:"lb_oz",[l.ozt]:"ozt",[l.dwt]:"dwt",[l.GN]:"GN",[l.per_lb]:"per_lb",[l.tlh]:"tlh",[l.tls]:"tls",[l.tlt]:"tlt",[l.tlc]:"tlc",[l.mom]:"mom",[l.tol]:"tol",[l.bat]:"bat",[l.MS]:"MS",[l.N]:"N",[l.war]:"war",[l.pcs]:"pcs",[l.per]:"per",[l.mm]:"mm",[l.cm]:"cm",[l.m]:"m",[l.km]:"km",[l.g_ml]:"g_ml",[l.Mcls_ml]:"Mcls_ml",[l.µg_ml]:"µg_ml",[l.µg_l]:"µg_l",[l.mg_ml]:"mg_ml",[l.mg_l]:"mg_l",[l.mmol_ml]:"mmol_ml",[l.g_cm3]:"g_cm3",[l.cm3]:"cm3",[l.cm2]:"cm2",[l.m2]:"m2",[l.g_cm2]:"g_cm2",[l.g_m2]:"g_m2",[l.g_m]:"g_m",
[l.µl]:"µl",[l.ml]:"ml",[l.cl]:"cl",[l.l]:"l",[l.mmol]:"mmol",[l.C]:"C",[l.F]:"F",[l.sec]:"sec",[l.min]:"min",[l.h]:"h",[l.am]:"am",[l.pm]:"pm",[l.V]:"V",[l.mA]:"mA",[l.hPa]:"hPa",[l.kPa]:"kPa",[l.g_mol]:"g_mol",[l.kg_m3]:"kg_m3",[l.mmHg]:"mmHg",[l.invalid]:"invalid",[l.rpm]:"rpm"};t.unitStringToLong=function(e){const t=Array.isArray(e)?e[0]:e;if(0===t.length)return l.none;for(const[e,a]of Object.entries(E))if(a===t)return e;return l.invalid},t.convertWgtUnit=function(e,t,a){return r.convertValueToTargetUnit(e,t,a)},t.convertWgtUnitBigNumber=function(e,t,a){return r.convertValueToTargetUnitBigNumber(e,t,a)},t.convertTempUnit=function(e,t,a){const s=[r.EnumUnit.GRAD_CELSIUS,r.EnumUnit.GRAD_FAHRENHEIT,l.C,l.F];return s.includes(t)&&s.includes(a)?r.convertValueToTargetUnit(e,t,a):e},t.convertPressureUnit=function(e,t,a){const s=[r.EnumUnit.HECTOPASCAL,r.EnumUnit.KILOPASCAL,l.hPa,l.kPa];return s.includes(t)&&s.includes(a)?r.convertValueToTargetUnit(e,t,a):e},t.UnitEnum_Api2Lib=function(e){
let t=l;for(let a in t)if(t[a].toString()===e.toString())return a;return null},t.UnitEnum_Lib2Api=function(e){return r.getUnitEnum(e)}},function(e,t){e.exports=require("mathjs")},function(e,t){e.exports=require("fs")},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(55),i=a(56),n=a(57),r=a(45),o=a(59),l=a(13),E=a(28),_=a(60),u=a(30),c=a(63),A=a(64),p=a(39),d=a(40),T=a(46),I=a(70),h=a(71),N=a(33),m=a(11),S=a(48),R=a(3),P=a(72),g=a(4),D=a(29),O=a(73),M=a(42),C=a(18),L=a(9),f=a(14),b=a(74),v=a(26),B=a(41),y=a(75),G=a(2),U=a(12),H=a(76),x=a(77),F=a(78),V=a(36),k=a(79),w=a(20),Q=a(1),W=a(0);a(51),t.HEARTBEAT_INTERVAL_MS=2e3;const Y=100,q=500;t.STORAGE_LOCATION_BASE="/data/installedQApps/qapps/data";const K="STATE_SUSPENDING_INTERNAL",j="STATE_RESTARTING_INTERNAL",X="_START_FSM_",J="_INTERNAL_DEVEL_VERSION_INFO_STATE_",$="BTN_INTERNAL_DEVEL_VERSION_INFO";t.FORCED_SUSPEND_HOME_BUTTON_ID="BTN_HOME",t.LOGOUT_BUTTON_ID="BTN_LOGOUT",
t.PRINT_RESTART_BUTTON_ID="BTN_PRINT_RESTART";const z="BTN_SUSPEND_QUESTION_YES",Z="BTN_SUSPEND_QUESTION_NO",ee="BTN_LOGOUT_QUESTION_YES",te="BTN_LOGOUT_QUESTION_NO",ae="BTN_RESTART_QUESTION_YES",se="BTN_RESTART_QUESTION_NO",ie="CANCEL_LOGOUT",ne="REMEMBER_LOGOUT",re="TASK/IDENTIFICATION",oe="TASK/PROFILE";var le,Ee;t.TASK_PROFILE_REPORTING_ID_PREFIX=oe+"/REPORTING_PROFILES",t.TASK_PROFILE_WEIGHING_ID=oe+"/WEIGHING",t.ASYNC_CALL_DB_CONNECTION_CREATE="ASYNC_CALL_DB_CONNECTION_CREATE",function(e){e.FUNC_BTN_TAKEOVER="FUNC_BTN_TAKEOVER",e.FUNC_BTN_DOCU="FUNC_BTN_DOCU",e.FUNC_BTN_OTHER="FUNC_BTN_OTHER"}(le=t.EnumFunctionalButtonType||(t.EnumFunctionalButtonType={})),function(e){e.SUSPEND_NO_SUSPEND="SUSPEND_NO_SUSPEND",e.SUSPEND_HOME="SUSPEND_HOME",e.SUSPEND_LOGOUT="SUSPEND_LOGOUT",e.SUSPEND_APP="SUSPEND_APP"}(Ee=t.EnumSuspendReason||(t.EnumSuspendReason={})),t.dbg=function(e){
null===e?console.log(" ## DEBUG ## null"):void 0===e?console.log(" ## DEBUG ## undefined"):"string"==typeof e||"number"==typeof e||"boolean"==typeof e?console.log(" ## DEBUG ## "+f.inspect(e).toString()):(console.log(" ## DEBUG ##"),console.log(f.inspect(e,!1,20)),console.log(" ##########"))};class _e{constructor(e){this.suppressGlobalHomeBtnHandling=!1,this.suppressGlobalLogoutBtnHandling=!1,this.suppressGlobalRestartBtnHandling=!1,this.isDevelVersion=!1,this.screens={},this.hideLoadingScreenOnShowScreens=!0,this.buttons={takeoverBtn:void 0,docuButton:void 0,others:[]},this.lastRequestedTakeoverBtnAppearance=W.EnumAppearance.HIDDEN,this.aspects={},this.scriptPath=void 0,this.qAppOrderNumber=void 0,this.qAppVersion=void 0,this.taskId=void 0,this.isErrorStatePublished=!1,this.exitTimeOutPending=!1,this.suspendReason=Ee.SUSPEND_NO_SUSPEND,this.heartbeatCount=0,this.eventQueue=[],this.eventQueuePending=!1,this.subscriptions=[],this.outstandingAsyncCalls=[],this.debugCfg={doConsoleLog:!0,
enableHeartbeatLog:!1,url:null},this.pendingMsgBox=void 0,this.currentMsgBox=void 0,this.isCurrentMsgPrio=!1,this.debugCfg.doConsoleLog=e,console.error=((...e)=>{console.log("ERR: ",e)});let i=a(18);if(console.log("try reading debug config from file"),i.existsSync("/data/installedQApps/qapps/data/qapplog.conf"))try{console.log("...found config file");let e=JSON.parse(i.readFileSync("/data/installedQApps/qapps/data/qapplog.conf","utf8").toString());console.log("...got it"),Object.assign(this.debugCfg,e),console.log("...debug config (with defaults): "+f.inspect(this.debugCfg))}catch(e){console.log("...invalid JSON content in qapplog.conf: "+e),console.log("...disable logging at all"),console.log=((...e)=>{})}else console.log("No qapplog file found.");let n=console.log;console.log("...saved original stdout");let r=null;if(null!==this.debugCfg.url){console.log("...there seems to be an url for remote logging configured");try{r=new V.URL(this.debugCfg.url),
console.log("...valid url for remote logging")}catch(e){r=null,console.log('...invalid URL like "ws://hostname.port" in qapplog.conf')}}if(this.debugCfg.doConsoleLog||(console.log("...disable local output"),console.log=((...e)=>{})),null!==r){console.log("...valid url for remote logging");let e=new k.Socket;e.on("error",()=>{try{console.log("...no logging redirected - error"),e.end()}catch(e){}}),e.connect(Number.parseInt(r.port),r.hostname,()=>{try{console.log(`...logging remote redirected to external client (local: ${this.debugCfg.doConsoleLog})`),console.log=((...t)=>{let a="";if(t.forEach(e=>{a+=e}),this.debugCfg.doConsoleLog)try{n(a)}catch(e){}a+="\n";try{e.write(a)}catch(e){}}),e.setNoDelay(!0),e.write("Hello, server! Love, Client.")}catch(e){}})}console.log("QAppBase: constr"),_e.clientSingleton=this,this.restHandler=new c.RestHandler,this.mqttHandler=new _.MqttHandler,this.taskMngProxy=new p.TaskProxy,this.localizerProxy=new A.LocalizerProxy,
this.weighingProxy=new d.WeighingProxy,this.accessControlProxy=new I.AccessControlProxy,this.reportingProxy=new N.ReportingProxy,this.devicInformationProxy=new b.DeviceInformationProxy,this.messageHandlerProxy=new v.MessageHandlerProxy,this.messageHandlerHelper=new B.MessageHandlerHelper(this.messageHandlerProxy),this.taskHandler=new T.TaskHandler,this.heartbeatInterval$=s.interval(t.HEARTBEAT_INTERVAL_MS)}getQAppOrderNumber(){return this.qAppOrderNumber}getQAppVersion(){return this.qAppVersion}getTaskId(){return this.taskId}getSerialNumber(){return this.devicInformationProxy.getSerialNo()}getWeighingProfileId(){let e=this.taskHandler.getParameter(t.TASK_PROFILE_WEIGHING_ID);return void 0!==e&&R.isTypeOfISelectionParameter(e)?e.value.selection.id:void 0}registerAspect(e){this.aspects[e.getId()]=e}init(){let e=new P.LoadingOverlay(this.mqttHandler);this.registerScreen(e)}postInit(){}loadTask(){if(this.taskId){console.log("QAppBase: read task for: ",this.taskId);try{
this.taskHandler.setTask(this.taskMngProxy.readTask(this.taskId)),console.log("QAppBase: read task ...done");let e=this.taskHandler.getTask();e&&(this.qAppOrderNumber=e.qappOrderNumber,this.qAppVersion=e.qappVersion),console.log("QAppBase: got qAppOrderNumber from Task-Info: "+this.qAppOrderNumber+"@"+this.qAppVersion)}catch(e){this.exitError("QAppBase::loadTask - error reading: "+e.toString())}}else this.exitError("QAppBase::loadTask - Workflow script called without taskId")}getTaskName(){let e=void 0;if(void 0!==this.taskHandler){let t=this.taskHandler.getParameter("TASK/IDENTIFICATION/NAME");void 0!==t&&(e=t.value.string)}return e}registerScreen(e){console.log("QAppBase: register screen with id: "+e.getId()),this.screens[e.getId()]=e;try{e.events$.subscribe(e=>{e.type===g.ScreenEventType.SHOW_SCREEN&&this.hideLoadingScreenOnShowScreens&&this.hideLoadingScreen(),e.type,g.ScreenEventType.SHOW_LOADINGSCREEN,e.type,g.ScreenEventType.SHOW_MESSAGEBOX})}catch(e){}}showScreen(e){
if(!this.exitTimeOutPending)switch(e.getId()){case P.LOADING_OVERLAY_ID:case h.MESSAGEBOX_ID:this.exitError("QAppBase::showScreen() was called for messagebox or loading screen - not allowed");break;default:let t=this.hideLoadingScreenOnShowScreens;this.hideLoadingScreenOnShowScreens=!1,e.show(),this.closeAllScreensExcept(e),this.hideLoadingScreenOnShowScreens=t}}closeAllScreensExcept(e){switch(e.getId()){case P.LOADING_OVERLAY_ID:case h.MESSAGEBOX_ID:this.exitError("QAppBase::closeAllScreensExcept() was called for messagebox or loading screen - not allowed");break;default:for(let t in this.screens){let a=this.screens[t];a.getId()!==e.getId()&&a.getId()!==P.LOADING_OVERLAY_ID&&a.getId()!==F.LOCK_LOADING_OVERLAY_ID&&a.getId()!==x.LOCKMESSAGEBOX_ID&&(a.getId()===h.MESSAGEBOX_ID?this.hideMsgBox():a.hide())}this.hidePrintQueue()}}getLoadingScreen(){let e=this.screens[P.LOADING_OVERLAY_ID];return void 0===e&&(e=new P.LoadingOverlay(this.mqttHandler),this.registerScreen(e)),e}
showLoadingScreen(e){if(!this.exitTimeOutPending){console.log("QAppBase::showLoadingScreen()");let t=this.getLoadingScreen();e?t.setText(e):t.setText({id:"",args:[]}),t.show()}}hideLoadingScreen(){console.log("QAppBase::hideLoadingScreen()");try{this.getLoadingScreen().hide()}catch(e){}}checkForLoadingScreenEnableEvent(e){try{return e.payload.event===D.MQTT_ADMIN_EVENT_PACKET_SENT&&e.payload.packet.topic===Q.MqttTopics.HMI_LOADING_MODAL_APPEARANCE&&JSON.parse(e.payload.packet.payload.toString()).appearance===W.EnumAppearance.ENABLED}catch(e){return!1}}checkForLoadingScreenDisabledEvent(e){try{return e.payload.event===D.MQTT_ADMIN_EVENT_PACKET_SENT&&e.payload.packet.topic===Q.MqttTopics.HMI_LOADING_MODAL_APPEARANCE&&JSON.parse(e.payload.packet.payload.toString()).appearance===W.EnumAppearance.HIDDEN}catch(e){return!1}}showMessageBox(e){this.exitTimeOutPending||(void 0===this.currentMsgBox?(console.log("QAppBase::showMessageBox(): check no current active one -> prep and show"),
this.currentMsgBox=e,this.prepAndShowMsgBox(this.currentMsgBox),this.isCurrentMsgPrio=!1,this.pendingMsgBox=void 0):(console.log("QAppBase::showMessageBox(): queue msgbox"),this.pendingMsgBox=e))}hideMsgBox(){console.log("QAppBase::hideMsgBox()"),this.pendingMsgBox=void 0,void 0===this.currentMsgBox||this.isCurrentMsgPrio||(console.log("QAppBase::hideMsgBox(): check non-prio -> hide"),this.currentMsgBox=void 0,this.hideMsgBoxInternal())}showPriorMsgBox(e){this.exitTimeOutPending||(void 0!==this.currentMsgBox&&(this.isCurrentMsgPrio||(console.log("QAppBase::showPriorMsgBox(): queue the current non prio msgbox"),this.pendingMsgBox=this.currentMsgBox)),console.log("QAppBase::showPriorMsgBox(): prep and how prio msgbox"),this.currentMsgBox=e,this.prepAndShowMsgBox(this.currentMsgBox),this.isCurrentMsgPrio=!0)}hidePriorMsgBox(){void 0!==this.pendingMsgBox?(this.currentMsgBox=this.pendingMsgBox,this.pendingMsgBox=void 0,this.prepAndShowMsgBox(this.currentMsgBox)):(this.currentMsgBox=void 0,
this.hideMsgBoxInternal()),this.isCurrentMsgPrio=!1}hideAllMsgBox(){this.pendingMsgBox=void 0,this.currentMsgBox=void 0,this.isCurrentMsgPrio=!1,this.hideMsgBoxInternal()}getMsgbox(){let e=this.screens[h.MESSAGEBOX_ID];return void 0===e&&(e=new h.MessageBox(this.mqttHandler),this.registerScreen(e)),e}prepAndShowMsgBox(e){if(!this.exitTimeOutPending){let t=this.getMsgbox();t.setMessageBoxData(e),console.log("QAppBase::prepAndShowMsgBox(): show"),t.show(),console.log("QAppBase::prepAndShowMsgBox(): done")}}hideMsgBoxInternal(){console.log("QAppBase::hideMsgBoxInternal()"),this.getMsgbox().hide()}showPrintQueue(){if(!this.exitTimeOutPending){console.log("QAppBase::showPrintQueue()");let e={enabled:!0};this.mqttHandler.publish(Q.MqttTopics.REPORTING_PRINTQUEUE_DISPLAYED,JSON.stringify(e),{retain:!1})}}hidePrintQueue(){console.log("QAppBase::hidePrintQueue()");this.mqttHandler.publish(Q.MqttTopics.REPORTING_PRINTQUEUE_DISPLAYED,JSON.stringify({enabled:!1}),{retain:!1})}clearPrintQueue(){
void 0!==this.buttons.docuButton&&this.buttons.docuButton.setAppearance(W.EnumAppearance.DISABLED),this.reportingProxy.clearPrintQueue()}registerButton(e,t){switch(e){case le.FUNC_BTN_TAKEOVER:this.buttons.takeoverBtn=t,this.lastRequestedTakeoverBtnAppearance=t.getAppearance();break;case le.FUNC_BTN_DOCU:this.buttons.docuButton=t,this.buttons.docuButton.setAppearance(W.EnumAppearance.DISABLED);break;default:this.buttons.others.push(t)}}addTimer(e,t){let a=n.setTimeout(()=>{this.addToEventQueue(new l.QAppTimerEvent(t))},e);return a.unref(),a}cancelTimer(e){void 0!==e&&n.clearTimeout(e)}addInterval(e,t){return n.setInterval(()=>{this.addToEventQueue(new l.QAppIntervalEvent(t))},e)}cancelInterval(e){void 0!==e&&n.clearInterval(e)}generateAsyncCallidentifier(){let e=Math.random();for(;this.outstandingAsyncCalls.find(t=>t===e);)e=Math.random();return e}enqueAsyncCall(e,a,s=5*t.HEARTBEAT_INTERVAL_MS,i=!1){let r=this.getCurrentState()
;console.log("QAppBase::enqueAsyncCall in state: "+r+" (timeout: "+s+"/fetchAfter: "+i+") with metadata: "+f.inspect(a));let l=this.generateAsyncCallidentifier();this.outstandingAsyncCalls.push(l);let E=new y.QAppAsyncCallTimeoutError(r,a),_=n.setTimeout(()=>{console.log("QAppBase async call timeout - add timeout to event queue");let e=new o.InternalAsyncCallEvent({type:i?o.INTERNAL_ASYNC_CALL_EVENT_TYPE.INTERNAL_ASYNC_CALL_EVENT_TYPE_TIMEOUT_WITH_FETCHING_RESP:o.INTERNAL_ASYNC_CALL_EVENT_TYPE.INTERNAL_ASYNC_CALL_EVENT_TYPE_TIMEOUT,data:{sourceState:r,reason:E,metadata:a},id:l});this.addToEventQueue(e)},s);e.then(e=>{console.log("QAppBase async call passed - add result to event queue");let t=new o.InternalAsyncCallEvent({type:o.INTERNAL_ASYNC_CALL_EVENT_TYPE.INTERNAL_ASYNC_CALL_EVENT_TYPE_SUCCESS,data:{sourceState:r,result:e,metadata:a},id:l,timerId:_});this.addToEventQueue(t)}).catch(e=>{console.log("QAppBase async call failed - add reason to event queue"),console.log(f.inspect(e))
;let t=new o.InternalAsyncCallEvent({type:o.INTERNAL_ASYNC_CALL_EVENT_TYPE.INTERNAL_ASYNC_CALL_EVENT_TYPE_FAIL,data:{sourceState:r,reason:e,metadata:a},id:l,timerId:_});this.addToEventQueue(t)}),console.log("QAppBase::enqueAsyncCall done...")}addToEventQueue(e){e.type===l.IMMEDIATE_EVENT||e.type===o.INTERNAL_SUSPEND_EVENT||e.type===o.INTERNAL_RESTART_EVENT||e.type===o.HEARTBEAT_EVENT?this.eventQueue.push(e):this.eventQueue.unshift(e),this.eventQueuePending||(setImmediate(()=>{this.processEventQueue(this)}),this.eventQueuePending=!0)}processEventQueue(e){if(this.exitTimeOutPending)return;e.eventQueuePending=!1;let t=e.eventQueue.length,a=e.eventQueue.pop();for(;a&&t>0&&!this.exitTimeOutPending;)t--,e.handleEvent(a),t>0&&(a=e.eventQueue.pop())}run(){if(!this.isErrorStatePublished){console.log("QAppBase: run"),this.processCLParameters(process.argv),this.heartbeat({message:":-)",value:this.heartbeatCount++});let e=this.provideStartFsmState()
;this.qappStates=this.prepareAndExtendFsmStates(e),console.log("QAppBase: register internal event handler"),this.subscriptions.push(i.merge(this.mqttHandler.mqttUpdateEvent$,this.mqttHandler.mqttAdminEvent$,this.restHandler.buttonClickEvent$,this.restHandler.paramChangedEvent$,this.restHandler.paramDetailEvent$,this.restHandler.restRequestEvent$).subscribe(e=>{this.addToEventQueue(e)})),this.subscriptions.push(this.mqttHandler.mqttUpdateEvent$.subscribe(e=>{try{switch(e.payload.topic){case Q.MqttTopics.METROLOGY_MAX_DIGITS:case Q.MqttTopics.METROLOGY_MAX_DIGITS_DEBUG:this.weighingProxy.updateWeighValueMaxDigits(parseInt(e.payload.value.toString(),10));break;case Q.MqttTopics.METROLOGY_RANGES:this.weighingProxy.updateMetrologyRanges(JSON.parse(e.payload.value.toString()));break;case Q.MqttTopics.WEIGHING_SELECTED_DISPLAY_VALUE:this.weighingProxy.updateLastSelectedDisplayValue(JSON.parse(e.payload.value.toString()))}}catch(t){
this.exitError("unexpected value content for incoming MQTT event: "+e.payload.topic)}})),console.log("QAppBase: create the FSM with all custom states"),this.qappFsm=r.createFsm(this.qappStates),delete this.__machina__,this.eventQueue.splice(0),this.qappFsm.on("transition",this.onFsmTransitionInternal),this.mqttHandler.subscribe(Q.MqttTopics.QAPP_DEBUG_TOPIC_PREAMBLE+"/#"),this.onRunning(),console.log("QAppBase: schedule transition to custom start state"),setTimeout(()=>{console.log("QAppBase: start heartbeating"),this.heartbeatIntervalSubscription=this.heartbeatInterval$.subscribe(()=>{this.addHeartbeatEvent(":-)")}),console.log("QAppBase: initiate transition to custom start state"),this.qappFsm.handle(this,X,this.isDevelVersion?J:e),console.log("QAppBase: initiated transition to custom start state")},Y),console.log("QAppBase: run finished")}}canSuspend(){if(console.log("QAppBase: Can suspend?"),this.suspendReason===Ee.SUSPEND_APP)return!0;if(console.log("QAppBase: Check printQueue"),
this.reportingProxy.isPrintQueueEmpty())return console.log("QAppBase: printQueue is empty, exiting the QApp."),!0;if(this.suspendReason===Ee.SUSPEND_LOGOUT)this.showPriorMsgBox({type:m.EnumMessageboxType.QUESTION,title:{id:"_QAPP_LIB_MBOX_LOGOUT_WARNING_TITLE",args:[]},buttons:[{id:ee,label:{id:"_QAPP_LIB_MBOX_BTN_YES",args:[]},appearance:W.EnumAppearance.ENABLED_SECONDARY},{id:te,label:{id:"_QAPP_LIB_MBOX_BTN_NO",args:[]},appearance:W.EnumAppearance.ENABLED_SECONDARY}],textList:[{id:"_QAPP_LIB_MBOX_LOGOUT_WARNING_TEXT_top",args:[]},{id:"_QAPP_LIB_MBOX_LOGOUT_WARNING_TEXT_mid",args:[this.getTaskName()]},{id:"_QAPP_LIB_MBOX_LOGOUT_WARNING_TEXT_bottom",args:[]}]});else{if(this.suspendReason!==Ee.SUSPEND_HOME)return!1;this.showPriorMsgBox({type:m.EnumMessageboxType.QUESTION,title:{id:"_QAPP_LIB_MBOX_HOME_WARNING_TITLE",args:[]},buttons:[{id:z,label:{id:"_QAPP_LIB_MBOX_BTN_YES",args:[]},appearance:W.EnumAppearance.ENABLED_SECONDARY},{id:Z,label:{id:"_QAPP_LIB_MBOX_BTN_NO",args:[]},
appearance:W.EnumAppearance.ENABLED_SECONDARY}],textList:[{id:"_QAPP_LIB_MBOX_HOME_WARNING_TEXT_top",args:[]},{id:"_QAPP_LIB_MBOX_HOME_WARNING_TEXT_mid",args:[this.getTaskName()]},{id:"_QAPP_LIB_MBOX_HOME_WARNING_TEXT_bottom",args:[]}]})}return console.log("QAppBase: printQueue is not empty, asking for permission to exist task."),!1}continueSuspend(){this.suspendReason!==Ee.SUSPEND_NO_SUSPEND?(console.log("QAppBase: Continue last suspend request"),this.clearPrintQueue(),this.handleEvent(new o.InternalSuspendEvent(o.INTERNAL_SUSPEND_EVENT_TYPE.SUSPEND_EVENT_TYPE_EXECFINALLY))):console.log("QAppBase: No suspend pending continue")}cancelSuspend(){console.log("QAppBase: Cancel last suspend request"),this.suspendReason=Ee.SUSPEND_NO_SUSPEND}cancelLogout(){console.log("QAppBase: Cancel last logout request"),this.cancelSuspend(),this.mqttHandler.publish(Q.MqttTopics.QAPP_LOGOUT_REQUEST,JSON.stringify({request:ie}))}rememberLogout(){
this.mqttHandler.publish(Q.MqttTopics.QAPP_LOGOUT_REQUEST,JSON.stringify({request:ne}))}suspend(){console.log("QAppBase: QApp suspend request"),this.suspendReason=Ee.SUSPEND_APP,this.handleEvent(new o.InternalSuspendEvent(o.INTERNAL_SUSPEND_EVENT_TYPE.SUSPEND_EVENT_TYPE_EXECFINALLY))}doSuspend(){this.isErrorStatePublished||(console.log("QAppBase: suspend"),this.onSuspending(),this.doCloseAllOverlays(),console.log("QAppBase: publish STOPPED event of qapp"),this.mqttHandler.publish(Q.MqttTopics.QAPP_STOPPED,this.taskId?""+this.taskId:"",{retain:!1}),setTimeout(()=>{console.log("process.exit"),process.exit(0)},q),this.exitTimeOutPending=!0)}canRestart(){return console.log("QAppBase: can restart? - check printQueue"),this.reportingProxy.isPrintQueueEmpty()?(console.log("QAppBase: printQueue is empty, restart the QApp."),!0):(this.showPriorMsgBox({type:m.EnumMessageboxType.QUESTION,title:{id:"_QAPP_LIB_MBOX_RESTART_QUESTION_TITLE",args:[]},buttons:[{id:ae,label:{id:"_QAPP_LIB_MBOX_BTN_YES",
args:[]},appearance:W.EnumAppearance.ENABLED_SECONDARY},{id:se,label:{id:"_QAPP_LIB_MBOX_BTN_NO",args:[]},appearance:W.EnumAppearance.ENABLED_SECONDARY}],textList:[{id:"_QAPP_LIB_MBOX_RESTART_QUESTION_TEXT_top",args:[this.getTaskName()]},{id:"_QAPP_LIB_MBOX_RESTART_QUESTION_TEXT_bottom",args:[]}]}),console.log("QAppBase: printQueue is not empty, asking for permission to restart task."),!1)}continueRestart(){console.log("QAppBase: Continue last restart request"),this.handleEvent(new o.InternalRestartEvent(o.INTERNAL_RESTART_EVENT_TYPE.RESTART_EVENT_TYPE_EXECFINALLY))}doCloseAllOverlays(){this.hidePrintQueue();for(let e in this.screens){let t=this.screens[e].getButton(S.CANCEL_BARBUTTON_ID);if(t&&t.setAppearance(W.EnumAppearance.HIDDEN),e!==P.LOADING_OVERLAY_ID)try{this.screens[e].hide()}catch(e){}}this.hideAllMsgBox()}exitError(e){this.isErrorStatePublished=!0;let t=(new Error).stack;console.log("QAppBase: exit with error: "+e),console.log("exitError: "),console.log(t),
this.doCloseAllOverlays(),this.messageHandlerHelper.addMessage(B.EMsgHandlerMsgs.ERR_799_GENERIC_INTERNAL_ERROR,e,void 0,[v.createMessageHandlerButton(void 0,void 0,v.MessageHandlerCallTarget.REMOVE_MESSAGE)]),this.onErrorExiting(e),this.mqttHandler.publish(Q.MqttTopics.QAPP_ERROR,(this.taskId?""+this.taskId:"")+"error: "+e,{retain:!1}),setTimeout(()=>{console.error("QAppBase: exit with error: "+e),process.exit(-1)},q),this.exitTimeOutPending=!0}heartbeat(e){this.isErrorStatePublished||(this.debugCfg.enableHeartbeatLog&&console.log("."),this.mqttHandler.publish(Q.MqttTopics.QAPP_HEARTBEAT,JSON.stringify(e),{retain:!1}))}addHeartbeatEvent(e){this.addToEventQueue(new o.HeartbeatEvent({message:e,value:this.heartbeatCount++}))}checkForCustomHeartbeatEvent(e,t){try{return e.payload.event===D.MQTT_ADMIN_EVENT_PACKET_SENT&&e.payload.packet.topic===Q.MqttTopics.QAPP_HEARTBEAT&&JSON.parse(e.payload.packet.payload.toString()).message===t}catch(e){return!1}}adaptFsmStates(e){}
prepareAndExtendFsmStates(e){let t;if(console.log("QAppBase::prepareAndExtendFsmStates: create state machine with QApp specific states"),void 0===this.qappStates){t=this.provideFsmStates();for(let e in this.aspects)Object.assign(t,this.aspects[e].getAspectStates());t[J]={_onEnter:function(e){e.showMessageBox({type:m.EnumMessageboxType.INFO,title:{id:"_QAPP_LIB_MBOX_DEMO_INFO_TITLE",args:[]},buttons:[{id:$,label:{id:U.EnumFontLabels.OK,args:[]},appearance:W.EnumAppearance.ENABLED_SECONDARY}],textList:[{id:"_QAPP_LIB_MBOX_DEMO_INFO_TEXT",args:[]}]})},_onExit:function(e){},EV_HMI_BTN_CLICKED:function(t,a){return a.payload.buttonId===$&&(t.hideMsgBox(),this.transition(t,e)),""}},this.adaptFsmStates(t);for(let e in this.aspects)if(this.aspects[e].getId()===H.LOCKING_ASPECT){this.aspects[e].adaptFsmStates(t);break}let a=function(e,t){e.heartbeat(t.payload)};for(let e in t)t.hasOwnProperty(e)&&(t[e]._FSM_HEARTBEAT_EVENT_=a,t[e]._INTERNAL_SUSPEND_EVENT_=function(e,t){switch(t.payload){
case o.INTERNAL_SUSPEND_EVENT_TYPE.SUSPEND_EVENT_TYPE_FORCED_HOME:case o.INTERNAL_SUSPEND_EVENT_TYPE.SUSPEND_EVENT_TYPE_FORCED_LOGOUT:console.log("QAppBase: HOME/LOGOUT button suspend request"),t.payload===o.INTERNAL_SUSPEND_EVENT_TYPE.SUSPEND_EVENT_TYPE_FORCED_HOME?e.suspendReason=Ee.SUSPEND_HOME:e.suspendReason=Ee.SUSPEND_LOGOUT,e.canSuspend()?this.transition(e,K):console.log("QAppBase: HOME/LOGOUT suspend interrupted by QApp");break;case o.INTERNAL_SUSPEND_EVENT_TYPE.SUSPEND_EVENT_TYPE_FORCED_AUTO_LOGOUT:console.log("QAppBase: auto logout suspend request"),e.suspendReason=Ee.SUSPEND_HOME,this.transition(e,K);break;case o.INTERNAL_SUSPEND_EVENT_TYPE.SUSPEND_EVENT_TYPE_EXECFINALLY:this.transition(e,K)}},t[e]._INTERNAL_RESTART_EVENT_=function(e,t){switch(t.payload){case o.INTERNAL_RESTART_EVENT_TYPE.RESTART_EVENT_TYPE_REQUEST:e.canRestart()?this.transition(e,j):console.log("QAppBase: restart interrupted by QApp");break;case o.INTERNAL_RESTART_EVENT_TYPE.RESTART_EVENT_TYPE_EXECFINALLY:
this.transition(e,j)}});t[K]={_onEnter:function(e){e.showLoadingScreen({id:"",args:[]})},_onExit:function(e){},MQTT_ADMIN_EVENT:function(e,t){e.checkForLoadingScreenEnableEvent(t)&&e.doSuspend()},_FSM_HEARTBEAT_EVENT_:a},t[j]={_onEnter:function(e){e.showLoadingScreen({id:"_QAPP_LIB_LOADING_OVERLAY_TEXT_RESTARTING_APP",args:[e.getTaskName()]})},_onExit:function(e){},MQTT_ADMIN_EVENT:function(e,t){e.checkForLoadingScreenEnableEvent(t)&&(e.clearPrintQueue(),this.transition(e,r.STATE_UNINITIALIZED_INTERNAL),e.restart(),e.run())},_FSM_HEARTBEAT_EVENT_:a}}else t=this.qappStates;return t}handleEvent(e){if(this.qappFsm){if(e instanceof E.MqttUpdateDebugEvent&&e.payload.topic===Q.MqttTopics.QAPP_DEBUG_STOP_HEARTBEAT&&(console.log("DEBUG: stop heartbeat received"),this.heartbeatIntervalSubscription&&(console.log("DEBUG: stop heartbeat > unsubscribe on heartbeatInterval"),this.heartbeatIntervalSubscription.unsubscribe())),
e instanceof u.HmiButtonClickedEvent)if(e.payload.buttonId!==w.BTN_HOME_ID||this.suppressGlobalHomeBtnHandling)if(e.payload.buttonId!==w.BTN_LOGOUT_ID||this.suppressGlobalLogoutBtnHandling){if(e.payload.buttonId===z)return void this.continueSuspend();if(e.payload.buttonId===ee)return void this.continueSuspend();if(e.payload.buttonId===Z)return this.cancelSuspend(),this.hidePriorMsgBox(),void this.hideLoadingScreen();if(e.payload.buttonId===te)return this.cancelLogout(),this.hidePriorMsgBox(),void this.hideLoadingScreen();if(e.payload.buttonId!==t.PRINT_RESTART_BUTTON_ID||this.suppressGlobalRestartBtnHandling){if(e.payload.buttonId===ae)return void this.continueRestart();if(e.payload.buttonId===se)return this.hidePriorMsgBox(),void this.hideLoadingScreen();if(void 0!==this.buttons.docuButton&&e.payload.buttonId===this.buttons.docuButton.getButtonId())return void this.handleDocuButton()}else e=new o.InternalRestartEvent(o.INTERNAL_RESTART_EVENT_TYPE.RESTART_EVENT_TYPE_REQUEST)
}else e=new o.InternalSuspendEvent(o.INTERNAL_SUSPEND_EVENT_TYPE.SUSPEND_EVENT_TYPE_FORCED_LOGOUT);else e=new o.InternalSuspendEvent(o.INTERNAL_SUSPEND_EVENT_TYPE.SUSPEND_EVENT_TYPE_FORCED_HOME);if(e instanceof E.MqttUpdateEvent&&e.payload.topic===Q.MqttTopics.USERMANAGEMENT_AUTO_LOGOUT_EVENT)try{JSON.parse(e.payload.value.toString()).logOff&&(e=new o.InternalSuspendEvent(o.INTERNAL_SUSPEND_EVENT_TYPE.SUSPEND_EVENT_TYPE_FORCED_AUTO_LOGOUT))}catch(e){}if(e instanceof o.InternalAsyncCallEvent){let t=this.outstandingAsyncCalls.findIndex(t=>t===e.payload.id);if(-1===t)return void console.log(`QAppBase::handleEvent: async event already handled - discard result (${e.payload.type}) for metadata: ${e.payload.data.metadata}`);switch(e.payload.type){case o.INTERNAL_ASYNC_CALL_EVENT_TYPE.INTERNAL_ASYNC_CALL_EVENT_TYPE_SUCCESS:e.payload.timerId&&n.clearTimeout(e.payload.timerId),this.outstandingAsyncCalls.splice(t,1),e=new l.QAppAsyncCallDoneEvent(e.payload.data);break
;case o.INTERNAL_ASYNC_CALL_EVENT_TYPE.INTERNAL_ASYNC_CALL_EVENT_TYPE_FAIL:e.payload.timerId&&n.clearTimeout(e.payload.timerId),this.outstandingAsyncCalls.splice(t,1),e=new l.QAppAsyncCallFailEvent(e.payload.data);break;case o.INTERNAL_ASYNC_CALL_EVENT_TYPE.INTERNAL_ASYNC_CALL_EVENT_TYPE_TIMEOUT:this.outstandingAsyncCalls.splice(t,1),e=new l.QAppAsyncCallFailEvent(e.payload.data);break;case o.INTERNAL_ASYNC_CALL_EVENT_TYPE.INTERNAL_ASYNC_CALL_EVENT_TYPE_TIMEOUT_WITH_FETCHING_RESP:e=new l.QAppAsyncCallFailEvent(e.payload.data)}}this.qappFsm.handle(this,e.type,e)}else this.exitError("QAppBase::handleEvent - no fsm instance set, unexpectedly")}onFsmTransitionInternal(e){if(console.log("QAppBase: transition from <",e.fromState,"> to <",e.toState,"> (machina ev: <",e.action,">)"),e.fromState){let t=e.client.qappFsm.states[e.fromState]._transTo;if(t){let a=t[e.toState];a?a(e.client,e):(a=t["~"])&&a(e.client,e),(a=t["*"])&&a(e.client,e)}if(e.fromState===r.STATE_UNINITIALIZED_INTERNAL){
e.client.mqttHandler.subscribe(Q.MqttTopics.METROLOGY_MAX_DIGITS),e.client.mqttHandler.subscribe(Q.MqttTopics.METROLOGY_MAX_DIGITS_DEBUG),e.client.mqttHandler.subscribe(Q.MqttTopics.METROLOGY_RANGES),e.client.mqttHandler.subscribe(Q.MqttTopics.WEIGHING_SELECTED_DISPLAY_VALUE),e.client.mqttHandler.subscribe(Q.MqttTopics.USERMANAGEMENT_AUTO_LOGOUT_EVENT),console.log("QAppBase: handle transition to custom initial state: initTaskHandler"),e.client.initTaskHandler(),console.log("QAppBase: handle transition to custom initial state: adaptTaskHandler"),e.client.adaptTaskHandler(),console.log("QAppBase: clear all task and QApp errors from messageHandler");let t=[],a=e.client.messageHandlerHelper.buildSecret(B.MESSAGE_HANDLER_SECRET_TYPE.QAPP);a&&t.push({categoryAsString:v.MessageHandlerCategory.QAPP,secret:a});let s=e.client.messageHandlerHelper.buildSecret(B.MESSAGE_HANDLER_SECRET_TYPE.QAPP_DB_ERROR);s&&t.push({categoryAsString:v.MessageHandlerCategory.QAPP,secret:s})
;let i=e.client.messageHandlerHelper.buildSecret(B.MESSAGE_HANDLER_SECRET_TYPE.QAPP_RUNTIME_COMM_ERROR);i&&t.push({categoryAsString:v.MessageHandlerCategory.QAPP,secret:i});let n=e.client.messageHandlerHelper.buildSecret(B.MESSAGE_HANDLER_SECRET_TYPE.QAPP_RUNTIME_EXIT_ERROR);n&&t.push({categoryAsString:v.MessageHandlerCategory.QAPP,secret:n});let r=void 0;void 0!==e.client.taskId&&(r=e.client.messageHandlerHelper.buildSecret(B.MESSAGE_HANDLER_SECRET_TYPE.TASKID))&&t.push({categoryAsString:v.MessageHandlerCategory.QAPP,secret:r});let o=!1;try{o=!e.client.messageHandlerProxy.deleteMessagesByCategory(t).isSuccess()}catch(e){o=!0}o&&(console.log("QAppBase: bulk call failed/not supported - use multiple messageHandler calls instead"),a&&e.client.messageHandlerProxy.deleteMessageByCategory(v.MessageHandlerCategory.QAPP,a),s&&e.client.messageHandlerProxy.deleteMessageByCategory(v.MessageHandlerCategory.QAPP,s),
i&&e.client.messageHandlerProxy.deleteMessageByCategory(v.MessageHandlerCategory.QAPP,i),n&&e.client.messageHandlerProxy.deleteMessageByCategory(v.MessageHandlerCategory.QAPP,n),r&&e.client.messageHandlerProxy.deleteMessageByCategory(v.MessageHandlerCategory.QAPP,r)),console.log("QAppBase: handle transition to custom initial state: init"),e.client.init(),console.log("QAppBase: handle transition to custom initial state: init all aspects");for(let t in e.client.aspects)console.log("init aspect: ",t),e.client.aspects[t].init(e.client);console.log("QAppBase: handle transition to custom initial state: postInit"),e.client.postInit(),console.log("QAppBase: handle transition to custom initial state: ...done")}}if(e.client.onFsmTransition(e),e.fromState===r.STATE_UNINITIALIZED_INTERNAL&&(console.log("QAppBase: publish running state of qapp"),e.client.mqttHandler.publish(Q.MqttTopics.QAPP_STARTED,e.client.taskId?""+e.client.taskId:"create Task",{retain:!1})),e.toState){
let t=e.client.qappFsm.states[e.toState]._transFrom;if(t){let a=t[e.fromState];a?a(e.client,e):(a=t["~"])&&a(e.client,e),(a=t["*"])&&a(e.client,e)}}}getCurrentState(){let e=this.__machina__._qappStm_.state;return console.log("QAppBase::getCurrentState: ",e),e}onRunning(){console.log("QAppBase: default callback after QApp published RUNNING event")}restart(){this.announceRestart(),this.specificRestart(),this.onSuspending(),this.doCloseAllOverlays();for(let e of this.subscriptions)e.unsubscribe();this.heartbeatIntervalSubscription&&this.heartbeatIntervalSubscription.unsubscribe(),this.mqttHandler.unsubscribeTopics(),this.weighingProxy.clearTare1AndTare2()}announceRestart(){console.log("QAppBase: announce restart to system"),this.taskMngProxy.setTaskEvent(this.taskId?this.taskId:"---",p.EnumTaskManagementEvent.EVENT_RESTART)}specificRestart(){console.log("QAppBase: default callback before QApp restarts")}onSuspending(){
console.log("QAppBase: default callback before QApp publishes STOPPED event and exits")}onErrorExiting(e){console.log("QAppBase: default callback before QApp publishes ERROR event and aborts")}onFsmTransition(e){console.log("QAppBase: default callback for transitions")}getStorageLocation(e){let a=void 0,s=this.taskHandler.getTask();switch(e){case O.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_INDEPENDENT:a=t.STORAGE_LOCATION_BASE;break;case O.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_SPECIFIC:s&&(a=this.getStorageLocation(O.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_INDEPENDENT)+M.sep+s.qappOrderNumber);break;case O.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_SPECIFIC_VERSION:s&&(a=this.getStorageLocation(O.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_SPECIFIC)+M.sep+s.qappVersion);break;case O.EnumPersistencyScope.PERSISTENCY_SCOPE_TASk_SPECIFIC:s&&this.taskId&&(a=this.getStorageLocation(O.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_SPECIFIC_VERSION)+M.sep+this.taskId)}return a}
createStorageLocation(e){let t=a(18),s=this.getStorageLocation(O.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_INDEPENDENT);if(void 0!==s){if(!t.existsSync(s))return!1;if(e!==O.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_INDEPENDENT){let a=this.getStorageLocation(O.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_SPECIFIC);if(void 0!==a){if(t.existsSync(a)||t.mkdirSync(a),e!==O.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_SPECIFIC){let a=this.getStorageLocation(O.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_SPECIFIC_VERSION);if(void 0!==a){if(t.existsSync(a)||t.mkdirSync(a),e!==O.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_SPECIFIC_VERSION){return void 0!==this.getStorageLocation(O.EnumPersistencyScope.PERSISTENCY_SCOPE_TASk_SPECIFIC)&&(t.existsSync(this.getStorageLocation(O.EnumPersistencyScope.PERSISTENCY_SCOPE_TASk_SPECIFIC))||t.mkdirSync(this.getStorageLocation(O.EnumPersistencyScope.PERSISTENCY_SCOPE_TASk_SPECIFIC)),!0)}return!0}return!1}return!0}return!1}return!0}return!1}
readQAppDescQTFAsJSON(e,t=!0){let a=void 0,s=void 0,i="";this.scriptPath?i=M.dirname(this.scriptPath)+"/../":t?this.exitError("QAppConfigBase::readQAppDescAsJSON - internal error - no scriptPath is set."):console.log("QAppConfigBase::readQAppDescAsJSON - internal error - no scriptPath is set.");let n="";try{n=i+"qapp.desc_"+e+".json",s=C.readFileSync(n)}catch(e){console.log("QAppConfigBase: - no "+n+" found - try DEFAULT");try{n=i+"qapp.desc_DEFAULT.json",s=C.readFileSync(n)}catch(e){t?this.exitError("QAppConfigBase::readQAppDescAsJSON - "+n+" (fallback) missing"):console.log("QAppConfigBase::readQAppDescAsJSON - "+n+" (fallback) missing")}}try{s&&(a=JSON.parse(s.toString("utf-8")))}catch(e){t?this.exitError("QAppConfigBase::readQAppDescAsJSON - "+n+" not valid JSON"):console.log("QAppConfigBase::readQAppDescAsJSON - "+n+" not valid JSON")}return a}relevantParamsAreEqual(e,a){let s=G.cloneJSON(e),i=G.cloneJSON(a);return s.forEach((e,a)=>{
e.id===re?delete s[a]:e.id===oe&&e.parameters.forEach((e,i)=>{e.id.startsWith(t.TASK_PROFILE_REPORTING_ID_PREFIX)?delete s[a].parameters[i]:e.id===t.TASK_PROFILE_WEIGHING_ID&&(e.info.options=[])})}),i.forEach((e,a)=>{e.id===re?delete i[a]:e.id===oe&&e.parameters.forEach((e,s)=>{e.id.startsWith(t.TASK_PROFILE_REPORTING_ID_PREFIX)?delete i[a].parameters[s]:e.id===t.TASK_PROFILE_WEIGHING_ID&&(e.info.options=[])})}),L.isEqual(s,i)}deleteDBError(){let e=this.messageHandlerHelper.buildSecret(B.MESSAGE_HANDLER_SECRET_TYPE.QAPP_DB_ERROR);e&&this.messageHandlerProxy.deleteMessageByCategory(v.MessageHandlerCategory.QAPP,e)}}t.QAppBase=_e},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(0),i=a(12),n=a(2),r={BTN_INVALIDATE_SAMPLE:10,BTN_DOCU:20,BTN_EVAL:30,BTN_PRINT_LABEL:40,BTN_ADD:50,BTN_START:60,BTN_PRINTADD:60,BTN_NEXT:60};t.getButtonPriority=function(e){return void 0!==r[e]?r[e]:0},t.BTN_EVAL_ID="BTN_EVAL";const o={buttonId:t.BTN_EVAL_ID,label:{
id:i.EnumFontLabels.RESULT,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createEvalButtonData=function(){return n.cloneJSON(o)},t.BTN_NEXT_ID="BTN_NEXT";const l={buttonId:t.BTN_NEXT_ID,label:{id:i.EnumFontLabels.NEXT,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createNextButtonData=function(){return n.cloneJSON(l)},t.BTN_PREV_ID="BTN_PREV";const E={buttonId:t.BTN_PREV_ID,label:{id:i.EnumFontLabels.PREV,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createPrevButtonData=function(){return n.cloneJSON(E)},t.BTN_BACK_ID="BTN_BACK",t.BTN_LONG_BACK_ID="BTN_LONG_BACK";const _={buttonId:t.BTN_BACK_ID,label:{id:i.EnumFontLabels.BACK,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createBackButtonData=function(e=!1){let a=n.cloneJSON(_);return e&&(a.longPressButtonId=t.BTN_LONG_BACK_ID),a},t.BTN_DOCU_ID="BTN_DOCU";const u={buttonId:t.BTN_DOCU_ID,label:{id:i.EnumFontLabels.DOCU,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createDocuButtonData=function(){return n.cloneJSON(u)},
t.BTN_SEND_ID="BTN_SEND";const c={buttonId:t.BTN_SEND_ID,label:{id:i.EnumFontLabels.DOCU,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createSendButtonData=function(){return n.cloneJSON(c)},t.BTN_INVALIDATE_SAMPLE_ID="BTN_INVALIDATE_SAMPLE";const A={buttonId:t.BTN_INVALIDATE_SAMPLE_ID,label:{id:i.EnumFontLabels.INVALIDATE_SAMPLE,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createInvalidateSampleButtonData=function(){return n.cloneJSON(A)},t.BTN_PRINT_LABEL_ID="BTN_PRINT_LABEL";const p={buttonId:t.BTN_PRINT_LABEL_ID,label:{id:"_QAPP_LIB_PRINT_LABEL_BTN_TITLE",args:[]},appearance:s.EnumAppearance.HIDDEN};t.createPrintLabelButtonData=function(){return n.cloneJSON(p)},t.BTN_START_ID="BTN_START";const d={buttonId:t.BTN_START_ID,label:{id:i.EnumFontLabels.START,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createStartButtonData=function(){return n.cloneJSON(d)},t.BTN_END_ID="BTN_END";const T={buttonId:t.BTN_END_ID,label:{id:i.EnumFontLabels.END,args:[]},appearance:s.EnumAppearance.HIDDEN
};t.createEndButtonData=function(){return n.cloneJSON(T)},t.BTN_PRINTADD_ID="BTN_PRINTADD";const I={buttonId:t.BTN_PRINTADD_ID,label:{id:i.EnumFontLabels.PRINT_ADD,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createPrintAddButtonData=function(){return n.cloneJSON(I)},t.BTN_CANCEL_ID="BTN_CANCEL";const h={buttonId:t.BTN_CANCEL_ID,label:{id:i.EnumFontLabels.CANCEL,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createCancelButtonData=function(){return n.cloneJSON(h)},t.BTN_SEARCH_ID="BTN_SEARCH";const N={buttonId:t.BTN_SEARCH_ID,label:{id:i.EnumFontLabels.SEARCH,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createSearchButtonData=function(){return n.cloneJSON(N)},t.setNoSearchActive=function(e,t=!0){e.setLabel({id:i.EnumFontLabels.SEARCH,args:[]},t)},t.setSearchActive=function(e,t=!0){e.setLabel({id:i.EnumFontLabels.SEARCH_ACTIVE,args:[]},t)},t.BTN_FILTER_ID="BTN_FILTER";const m={buttonId:t.BTN_FILTER_ID,label:{id:i.EnumFontLabels.FILTER,args:[]},appearance:s.EnumAppearance.HIDDEN}
;t.createFilterButtonData=function(){return n.cloneJSON(m)},t.setNoFilterActive=function(e,t=!0){e.setLabel({id:i.EnumFontLabels.FILTER,args:[]},t)},t.setFilterActive=function(e,t=!0){e.setLabel({id:i.EnumFontLabels.FILTER_ACTIVE,args:[]},t)},t.BTN_ADD_ID="BTN_ADD";const S={buttonId:t.BTN_ADD_ID,label:{id:i.EnumFontLabels.ADD,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createAddButtonData=function(){return n.cloneJSON(S)},t.BTN_DELETE_ID="BTN_DELETE";const R={buttonId:t.BTN_DELETE_ID,label:{id:i.EnumFontLabels.DELETE,args:[]},appearance:s.EnumAppearance.HIDDEN};t.createDeleteButtonData=function(){return n.cloneJSON(R)},t.BTN_HOME_ID="BTN_HOME",t.HOME_BUTTON_ICON="./02_menu";const P={buttonId:t.BTN_HOME_ID,label:{id:i.EnumFontLabels.CANCEL,args:[]},icon:t.HOME_BUTTON_ICON,appearance:s.EnumAppearance.HIDDEN};t.createHomeButtonData=function(){return n.cloneJSON(P)},t.BTN_LOGOUT_ID="BTN_LOGOUT";const g={buttonId:t.BTN_LOGOUT_ID,label:{id:i.EnumFontLabels.LOGOUT,args:[]},
appearance:s.EnumAppearance.ENABLED_SECONDARY};t.createLogoutButtonData=function(){return n.cloneJSON(g)},t.BTN_RELOAD_ID="BTN_RELOAD";const D={buttonId:t.BTN_RELOAD_ID,label:{id:i.EnumFontLabels.RELOAD,args:[]},appearance:s.EnumAppearance.ENABLED_SECONDARY};t.createReloadButtonData=function(){return n.cloneJSON(D)},t.BTN_OPEN_WEIGHING_ID="BTN_OPEN_WEIGHING";const O={buttonId:t.BTN_OPEN_WEIGHING_ID,label:{id:i.EnumFontLabels.WEIGHING,args:[]},appearance:s.EnumAppearance.ENABLED_SECONDARY};t.createOpenWeighingButtonData=function(){return n.cloneJSON(O)},t.BTN_OK_ID="BTN_OK";const M={buttonId:t.BTN_OK_ID,label:{id:i.EnumFontLabels.OK,args:[]},appearance:s.EnumAppearance.ENABLED_SECONDARY};t.createOKButtonData=function(){return n.cloneJSON(M)}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(3),i=a(23),n=a(4);t.CANCEL_BUTTON_ID="BTN_CANCEL",t.CANCEL_BUTTON_NAME="_CANCEL";class r extends n.AbstractScreen{constructor(e){super(e),this.paramList=[],
this.parameterCategoryList=[],this.isLastCategoryVisible=!1,this.mqttHandler=e}setShowLastVisibleCategory(e,t=!0){this.isLastCategoryVisible=e,t&&this.createAndPublishParamsAndPage()}readFromTaskhandler(e){let t=e.getTaskGroupsAndParameters();this.readFromParameterGroupArray(t)}readFromParameterGroupArray(e){this.paramList.splice(0,this.paramList.length),this.parameterCategoryList.splice(0,this.parameterCategoryList.length);for(let t of e){let e={},a={},n=s.createEmptyTextStructure();n=t.title,a.title=n,e.category=a,e.category.id=t.id,e.params=[];for(let a of t.parameters){let t=new i.default(this.mqttHandler,a);this.paramList.push(t),e.params.push(t.getPublishedId())}this.parameterCategoryList.push(e)}}createAndPublishParamsAndPage(){let e={params:{}};e.params=this.parameterCategoryList,e.showLastVisibleCategory=this.isLastCategoryVisible;let t=JSON.stringify(e,null,2);this.publishContent("PARAMSANDPAGE",t)}updateParameter(e){
for(let t of this.paramList)if(t.getId()===e.id)return void t.setValue(e)}}t.ParamListBase=r,t.default=r},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(2);function i(e){return null!=e&&null!==e&&void 0!=e&&void 0!==e&&"string"==typeof e}function n(e){return null!=e&&null!==e&&void 0!=e&&void 0!==e&&"object"==typeof e}t.isNumber=function(e){return null!=e&&null!==e&&void 0!=e&&void 0!==e&&"number"==typeof e&&!isNaN(e)},t.isString=i,t.isObject=n,t.isBoolean=function(e){return null!=e&&null!==e&&void 0!=e&&void 0!==e&&"boolean"==typeof e},t.getObjectByID=function(e,t,a){if(!n(e))return null;i(a)||(a="id"),a=a;for(let s=0;s<e.length;s++)if(e[s].hasOwnProperty(a)&&i(e[s][a])&&e[s][a]===t)return e[s];return null},t.overwriteExistingAttributes=function(e,t){if(n(e)&&n(t)){let a=Object.keys(t);for(let i=0;i<a.length;i++)"function"!=typeof t[a[i]]&&e.hasOwnProperty(a[i])&&typeof t[a[i]]==typeof e[a[i]]&&(t[a[i]]=s.cloneJSON(e[a[i]]))}},
t.setEnumSafely=function(e,t,a){const s=Object.keys(t);for(const a of s)if(t[a]===e)return t[a];return i(a)?a:s.length>0?t[s[0]]:void 0}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(3),i=a(2),n=a(1);class r{constructor(e,t){this.publishedId="",this.publishPending=!0,this.parameter=t,this.publishedId=n.MqttTopics.QAPP_PARAMETERS_TOPIC_PREAMBLE+"/"+this.parameter.id,this.mqttHandler=e,this.publish()}getId(){return this.parameter.id}getPublishedId(){return this.publishedId}setValue(e){this.parameter=e,this.publish()}getValue(){return this.parameter}setParamId(e,t=!0){(this.parameter.id!==e||this.publishPending)&&(this.parameter.id=e,t?this.publish():this.publishPending=!0)}setParamAppearance(e,t=!0){(this.parameter.appearance!==e||this.publishPending)&&(this.parameter.appearance=e,t?this.publish():this.publishPending=!0)}setParamType(e,t=!0){(this.parameter.type!==e||this.publishPending)&&(this.parameter.type=e,
t?this.publish():this.publishPending=!0)}setParamTitle(e,t=!0){(this.parameter.title.id!==e.id||this.parameter.title.args.join("")!==e.args.join("")||this.publishPending)&&(this.parameter.title=e,t?this.publish():this.publishPending=!0)}setParamHeader(e,t=!0){(this.parameter.header.id!==e.id||this.parameter.header.args.join("")!==e.args.join("")||this.publishPending)&&(this.parameter.header=e,t?this.publish():this.publishPending=!0)}publish(){if(this.publishPending=!1,s.isTypeOfIPasswordParameter(this.parameter)){let e=i.cloneJSON(this.parameter);e.info.passwordLength=e.value.string.length,e.value.string="",this.mqttHandler.publish(this.publishedId,JSON.stringify(e))}else this.mqttHandler.publish(this.publishedId,JSON.stringify(this.parameter))}}t.Param=r,t.default=r},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(2);t.AbstractQAppAspect=class{configure(e){this.cfg=Object.assign(void 0!==this.cfg?this.cfg:{},e)}getConfig(){
return s.cloneJSON(this.cfg)}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(17),i=a(16),n=a(22),r=a(2);var o,l;function E(e,a,i){let n=t.unitsMap[l.NONE],r=t.unitsMap[l.NONE];if(null==e)return s.bignumber(NaN);if(!t.unitsMap.hasOwnProperty(a))return e;if(!t.unitsMap.hasOwnProperty(i))return e;if(n=t.unitsMap[a],r=t.unitsMap[i],n.id===r.id)return e;if(n.unitConversionBase===o.UNDEFINED||r.unitConversionBase===o.UNDEFINED||void 0==n.conversionFactor||void 0==r.conversionFactor)return e;const E=[o.MASS,o.VOLUME];if(!(n.unitConversionBase===r.unitConversionBase||E.includes(n.unitConversionBase)&&E.includes(r.unitConversionBase)))return e;switch(n.unitConversionBase){case o.MASS:case o.VOLUME:case o.PRESSURE:return e.times(r.conversionFactor).dividedBy(n.conversionFactor);case o.TEMPERATURE:{let t=e;switch(n.id){case l.GRAD_CELSIUS:t=e.add(273.15);break;case l.GRAD_FAHRENHEIT:t=e.sub(32).dividedBy(n.conversionFactor).add(273.15)}switch(r.id){
case l.GRAD_CELSIUS:return t.sub(273.15);case l.GRAD_FAHRENHEIT:return t.sub(273.15).times(r.conversionFactor).add(32);case l.KELVIN:return t}return e}default:return e}}function _(e,t,a){let i=E(n.isNumber(e)?s.bignumber(e):e,t,a);return null==i?NaN:i.toNumber()}function u(e,t){return I(e,t).toFixed(Math.max(0,t))}function c(e,a){let s=r.cloneJSON(e);s.alibi=void 0,s.alibiId=void 0;let n=t.unitsMap[e.unit],l=t.unitsMap[a];if(n.id===l.id)return s;if(n.unitConversionBase===o.UNDEFINED||l.unitConversionBase===o.UNDEFINED)return s;const E=[o.MASS,o.VOLUME];return n.unitConversionBase===l.unitConversionBase||E.includes(n.unitConversionBase)&&E.includes(l.unitConversionBase)?(s.value=_(s.value,e.unit,a),s.unit=a,s.decimals=s.decimals-i.getUnitShift(e.unit)+i.getUnitShift(a),s.decimals<0&&(s.decimals=0),delete s.alibiId,s):s}function A(e){return e?t.unitsMap.hasOwnProperty(e.toString())?t.unitsMap[e].mark:e.toString():""}function p(e){
const a=n.getObjectByID(Object.values(t.unitsMap),e,"mark");return null!=a?a.id:l.NONE}function d(e){let t=[];if(null==e||void 0===e)return t;if(0==e.length)return t;let a=l.NONE;for(let s=0;s<e.length;s++)n.isNumber(e[s])?t.push(e[s]):n.isObject(e[s])&&e[s].hasOwnProperty("value")&&n.isNumber(e[s].value)&&e[s].hasOwnProperty("unit")&&(a!==l.NONE?t.push(c(e[s],a).value):(t.push(e[s].value),a=e[s].unit));return t}function T(e){let t=0;if(null==e||void 0===e)return t;if(0==e.length)return t;for(let a=0;a<e.length;a++)"object"==typeof e[a]&&e[a].hasOwnProperty("decimals")&&(t=e[a].decimals>t?e[a].decimals:t);return t}function I(e,t){let a=s.bignumber(e),i=s.bignumber(10).pow(t);return a.times(i).round().dividedBy(i).toNumber()}function h(e){let t=d(e);return n.isObject(t)&&0!==t.length?s.sum(t):NaN}function N(e){let t=d(e);return n.isObject(e)&&0!==e.length?s.mean(t):NaN}function m(e,t){let a=[];for(let s=0;s<e.length;s++)n.isNumber(e[s].value)&&(a[s]=c(e[s],t));return{value:N(a),unit:t,
decimals:T(a)}}function S(e,t){return n.isObject(e)?s.bignumber(e.value).dividedBy(t).toNumber():s.bignumber(e).dividedBy(t).toNumber()}function R(e){let t=d(e);return n.isObject(t)&&0!==t.length?s.std(t,"unbiased"):NaN}function P(e,t){let a=[];for(let s=0;s<e.length;s++)n.isNumber(e[s].value)&&(a[s]=c(e[s],t));return{value:R(a),unit:t,decimals:T(a)}}function g(e,t,a){if(e<2||!n.isNumber(t)||!n.isNumber(a))return NaN;const i=s.bignumber(1).dividedBy(s.bignumber(e).minus(1)),r=s.bignumber(a).minus(s.bignumber(t).pow(2).dividedBy(s.bignumber(e)));return i.isNaN()||r.isNaN()?NaN:s.sqrt(i.times(r)).toNumber()}function D(e){let t=d(e);return n.isObject(t)&&0!==t.length?s.min(t):NaN}function O(e){let t=d(e);return n.isObject(t)&&0!==t.length?s.max(t):NaN}function M(e){let t=d(e);return n.isObject(t)&&0!==t.length?C(R(t),N(t)):NaN}function C(e,t){let a=0,i=0;return a=n.isObject(e)?e.value:e,i=n.isObject(t)?t.value:t,n.isObject(e)&&n.isObject(t)&&(a=c(e,t.unit).value),
s.bignumber(a).dividedBy(i).times(100).toNumber()}function L(e,t,a){let i=NaN,r=NaN,o=NaN,E=l.NONE;return n.isObject(e)?(i=e.value,E=e.unit):i=e,n.isObject(t)?E!==l.NONE?r=c(t,E).value:(r=t.value,E=t.unit):r=t,n.isObject(a)?E!==l.NONE?o=c(a,E).value:(o=a.value,E=a.unit):o=a,s.bignumber(o).minus(r).dividedBy(s.bignumber(i).times(6)).toNumber()}function f(e,t,a){return{value:L(e,t,a),unit:l.NONE,decimals:3}}function b(e,t,a,i){let r=NaN,o=NaN,E=NaN,_=NaN,u=l.NONE;return n.isObject(e)?(r=e.value,u=e.unit):r=e,n.isObject(t)?u!==l.NONE?o=c(t,u).value:(o=t.value,u=t.unit):o=t,n.isObject(a)?u!==l.NONE?E=c(a,u).value:(E=a.value,u=a.unit):E=a,n.isObject(i)?u!==l.NONE?_=c(i,u).value:(_=i.value,u=i.unit):_=i,s.min(s.bignumber(o).minus(E).dividedBy(s.bignumber(r).times(3)),s.bignumber(_).minus(o).dividedBy(s.bignumber(r).times(3))).toNumber()}function v(e,t,a,s){return{value:b(e,t,a,s),unit:l.NONE,decimals:3}}!function(e){e.UNDEFINED="UNDEFINED",e.MASS="MASS",e.TEMPERATURE="TEMPERATURE",
e.PRESSURE="PRESSURE",e.VOLUME="VOLUME"}(o=t.EnumUnitType||(t.EnumUnitType={})),function(e){e.NONE="NONE",e.DIGIT="DIGIT",e.UNIVERSAL="UNIVERSAL",e.MICROGRAM="MICROGRAM",e.MILLIGRAM="MILLIGRAM",e.GRAM="GRAM",e.KILOGRAM="KILOGRAM",e.TONNE="TONNE",e.MILLICARAT="MILLICARAT",e.CARAT="CARAT",e.KILOCARAT="KILOCARAT",e.KARAT="KARAT",e.POUND="POUND",e.OUNCE="OUNCE",e.POUND_OUNCE="POUND_OUNCE",e.TROYOUNCE="TROYOUNCE",e.PENNYWEIGHT="PENNYWEIGHT",e.GRAIN="GRAIN",e.PARTS_PER_POUND="PARTS_PER_POUND",e.TAEL_HONGKONG="TAEL_HONGKONG",e.TAEL_SINGAPORE="TAEL_SINGAPORE",e.TAEL_TAIWAN="TAEL_TAIWAN",e.TAEL_CHINA="TAEL_CHINA",e.MOMME="MOMME",e.TOLA="TOLA",e.BATH="BATH",e.MESGHAL="MESGHAL",e.NEWTON="NEWTON",e.WARNING="WARNING",e.PIECES="PIECES",e.PERCENT="PERCENT",e.MILLIMETER="MILLIMETER",e.CENTIMETER="CENTIMETER",e.METER="METER",e.KILOMETER="KILOMETER",e.GRAM_PER_MILLILITER="GRAM_PER_MILLILITER",e.MILLION_CELLS_PER_MILLILITER="MILLION_CELLS_PER_MILLILITER",
e.MICROGRAM_PER_MILLILITER="MICROGRAM_PER_MILLILITER",e.MICROGRAM_PER_LITER="MICROGRAM_PER_LITER",e.MILLIGRAM_PER_MILLILITER="MILLIGRAM_PER_MILLILITER",e.MILLIGRAM_PER_LITER="MILLIGRAM_PER_LITER",e.MILLIMOL_PER_MILLILITER="MILLIMOL_PER_MILLILITER",e.GRAM_PER_CUBICCENTIMETRE="GRAM_PER_CUBICCENTIMETRE",e.CUBICCENTIMETRE="CUBICCENTIMETRE",e.SQUARECENTIMETRE="SQUARECENTIMETRE",e.SQUAREMETRE="SQUAREMETRE",e.GRAMMAGE="GRAMMAGE",e.MICROLITER="MICROLITER",e.MILLILITER="MILLILITER",e.MILLILITER_PER_SECOND="MILLILITER_PER_SECOND",e.MILLILITER_PER_MINUTE="MILLILITER_PER_MINUTE",e.MILLILITER_PER_HOUR="MILLILITER_PER_HOUR",e.LITER="LITER",e.MILLIMOL="MILLIMOL",e.GRAD_CELSIUS="GRAD_CELSIUS",e.GRAD_FAHRENHEIT="GRAD_FAHRENHEIT",e.SECOND="SECOND",e.MINUTE="MINUTE",e.HOUR="HOUR",e.TIME_AM="TIME_AM",e.TIME_PM="TIME_PM",e.VOLT="VOLT",e.MILLIAMPER="MILLIAMPER",e.HECTOPASCAL="HECTOPASCAL",e.KILOPASCAL="KILOPASCAL",e.GRAM_PER_MOL="GRAM_PER_MOL",e.INVALID="INVALID",e.RPM="RPM",e.MILLIVOLT="MILLIVOLT",
e.MILLIVOLT_PER_PH="MILLIVOLT_PER_PH",e.MICROSIEMENS_PER_CENTIMETER="MICROSIEMENS_PER_CENTIMETER",e.GRAM_PER_SQUARE_CENTIMETER="GRAM_PER_SQUARE_CENTIMETER",e.GRAM_PER_METER="GRAM_PER_METER",e.CENTILITER="CENTILITER",e.DENSITY="DENSITY",e.VOLUME="VOLUME",e.KG_M3="KG_M3",e.MMHG="MMHG",e.KELVIN="KELVIN",e.PASCAL="PASCAL"}(l=t.EnumUnit||(t.EnumUnit={})),t.unitsMap={NONE:{id:l.NONE,mark:"",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},DIGIT:{id:l.DIGIT,mark:"d",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},UNIVERSAL:{id:l.UNIVERSAL,mark:"o",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MICROGRAM:{id:l.MICROGRAM,mark:"µg",unitConversionBase:o.MASS,conversionFactor:1e6,conversionDecimalPlacesShift:-6},MILLIGRAM:{id:l.MILLIGRAM,mark:"mg",unitConversionBase:o.MASS,conversionFactor:1e3,conversionDecimalPlacesShift:-3},GRAM:{id:l.GRAM,mark:"g",
unitConversionBase:o.MASS,conversionFactor:1,conversionDecimalPlacesShift:0},KILOGRAM:{id:l.KILOGRAM,mark:"kg",unitConversionBase:o.MASS,conversionFactor:.001,conversionDecimalPlacesShift:3},TONNE:{id:l.TONNE,mark:"t",unitConversionBase:o.MASS,conversionFactor:1e-6,conversionDecimalPlacesShift:6},MILLICARAT:{id:l.MILLICARAT,mark:"mct",unitConversionBase:o.MASS,conversionFactor:5e3,conversionDecimalPlacesShift:-3},CARAT:{id:l.CARAT,mark:"ct",unitConversionBase:o.MASS,conversionFactor:5,conversionDecimalPlacesShift:0},KILOCARAT:{id:l.KILOCARAT,mark:"kct",unitConversionBase:o.MASS,conversionFactor:.005,conversionDecimalPlacesShift:3},KARAT:{id:l.KARAT,mark:"K",unitConversionBase:o.MASS,conversionFactor:5,conversionDecimalPlacesShift:0},POUND:{id:l.POUND,mark:"lb",unitConversionBase:o.MASS,conversionFactor:.00220462262184878,conversionDecimalPlacesShift:3},OUNCE:{id:l.OUNCE,mark:"oz",unitConversionBase:o.MASS,conversionFactor:.0352739619495804,conversionDecimalPlacesShift:2},POUND_OUNCE:{
id:l.POUND_OUNCE,mark:"lb:oz",unitConversionBase:o.MASS,conversionFactor:.035273962,conversionDecimalPlacesShift:2},TROYOUNCE:{id:l.TROYOUNCE,mark:"ozt",unitConversionBase:o.MASS,conversionFactor:.032150747,conversionDecimalPlacesShift:2},PENNYWEIGHT:{id:l.PENNYWEIGHT,mark:"dwt",unitConversionBase:o.MASS,conversionFactor:.643014931,conversionDecimalPlacesShift:1},GRAIN:{id:l.GRAIN,mark:"GN",unitConversionBase:o.MASS,conversionFactor:15.43235835,conversionDecimalPlacesShift:-1},PARTS_PER_POUND:{id:l.PARTS_PER_POUND,mark:"/lb",unitConversionBase:o.MASS,conversionFactor:1.1287667712,conversionDecimalPlacesShift:0},TAEL_HONGKONG:{id:l.TAEL_HONGKONG,mark:"tlh",unitConversionBase:o.MASS,conversionFactor:.02671725,conversionDecimalPlacesShift:2},TAEL_SINGAPORE:{id:l.TAEL_SINGAPORE,mark:"tls",unitConversionBase:o.MASS,conversionFactor:.02645544638,conversionDecimalPlacesShift:2},TAEL_TAIWAN:{id:l.TAEL_TAIWAN,mark:"tlt",unitConversionBase:o.MASS,conversionFactor:.02666666,
conversionDecimalPlacesShift:2},TAEL_CHINA:{id:l.TAEL_CHINA,mark:"tlc",unitConversionBase:o.MASS,conversionFactor:.02645547175,conversionDecimalPlacesShift:2},MOMME:{id:l.MOMME,mark:"mom",unitConversionBase:o.MASS,conversionFactor:.26666666666666666,conversionDecimalPlacesShift:1},TOLA:{id:l.TOLA,mark:"tol",unitConversionBase:o.MASS,conversionFactor:.0857333381,conversionDecimalPlacesShift:1},BATH:{id:l.BATH,mark:"bat",unitConversionBase:o.MASS,conversionFactor:.06578947436,conversionDecimalPlacesShift:2},MESGHAL:{id:l.MESGHAL,mark:"MS",unitConversionBase:o.MASS,conversionFactor:.217,conversionDecimalPlacesShift:1},NEWTON:{id:l.NEWTON,mark:"N",unitConversionBase:o.MASS,conversionFactor:.00980665,conversionDecimalPlacesShift:2},WARNING:{id:l.WARNING,mark:"!",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},PIECES:{id:l.PIECES,mark:"pcs",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},PERCENT:{
id:l.PERCENT,mark:"%",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLIMETER:{id:l.MILLIMETER,mark:"mm",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},CENTIMETER:{id:l.CENTIMETER,mark:"cm",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},METER:{id:l.METER,mark:"m",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},KILOMETER:{id:l.KILOMETER,mark:"km",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},GRAM_PER_MILLILITER:{id:l.GRAM_PER_MILLILITER,mark:"g/ml",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLION_CELLS_PER_MILLILITER:{id:l.MILLION_CELLS_PER_MILLILITER,mark:"10^6 cls/ml",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MICROGRAM_PER_MILLILITER:{
id:l.MICROGRAM_PER_MILLILITER,mark:"µg/ml",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MICROGRAM_PER_LITER:{id:l.MICROGRAM_PER_LITER,mark:"µg/l",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLIGRAM_PER_MILLILITER:{id:l.MILLIGRAM_PER_MILLILITER,mark:"mg/ml",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLIGRAM_PER_LITER:{id:l.MILLIGRAM_PER_LITER,mark:"mg/l",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLIMOL_PER_MILLILITER:{id:l.MILLIMOL_PER_MILLILITER,mark:"mmol/ml",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},GRAM_PER_CUBICCENTIMETRE:{id:l.GRAM_PER_CUBICCENTIMETRE,mark:"g/cm³",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},CUBICCENTIMETRE:{id:l.CUBICCENTIMETRE,mark:"cm³",unitConversionBase:o.UNDEFINED,
conversionFactor:void 0,conversionDecimalPlacesShift:void 0},SQUARECENTIMETRE:{id:l.SQUARECENTIMETRE,mark:"cm²",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},SQUAREMETRE:{id:l.SQUAREMETRE,mark:"m²",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},GRAMMAGE:{id:l.GRAMMAGE,mark:"g/m²",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MICROLITER:{id:l.MICROLITER,mark:"µl",unitConversionBase:o.VOLUME,conversionFactor:1e3,conversionDecimalPlacesShift:-3},MILLILITER:{id:l.MILLILITER,mark:"ml",unitConversionBase:o.VOLUME,conversionFactor:1,conversionDecimalPlacesShift:0},MILLILITER_PER_SECOND:{id:l.MILLILITER_PER_SECOND,mark:"ml/s",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLILITER_PER_MINUTE:{id:l.MILLILITER_PER_MINUTE,mark:"ml/min",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,
conversionDecimalPlacesShift:void 0},MILLILITER_PER_HOUR:{id:l.MILLILITER_PER_HOUR,mark:"ml/h",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},LITER:{id:l.LITER,mark:"l",unitConversionBase:o.VOLUME,conversionFactor:.001,conversionDecimalPlacesShift:3},MILLIMOL:{id:l.MILLIMOL,mark:"mmol",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},GRAD_CELSIUS:{id:l.GRAD_CELSIUS,mark:"°C",unitConversionBase:o.TEMPERATURE,conversionFactor:1,conversionDecimalPlacesShift:0},GRAD_FAHRENHEIT:{id:l.GRAD_FAHRENHEIT,mark:"°F",unitConversionBase:o.TEMPERATURE,conversionFactor:1.8,conversionDecimalPlacesShift:0},SECOND:{id:l.SECOND,mark:"sec",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MINUTE:{id:l.MINUTE,mark:"min",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},HOUR:{id:l.HOUR,mark:"h",unitConversionBase:o.UNDEFINED,
conversionFactor:void 0,conversionDecimalPlacesShift:void 0},TIME_AM:{id:l.TIME_AM,mark:"am",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},TIME_PM:{id:l.TIME_PM,mark:"pm",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},VOLT:{id:l.VOLT,mark:"V",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLIAMPER:{id:l.MILLIAMPER,mark:"mA",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},HECTOPASCAL:{id:l.HECTOPASCAL,mark:"hPa",unitConversionBase:o.PRESSURE,conversionFactor:.01,conversionDecimalPlacesShift:2},KILOPASCAL:{id:l.KILOPASCAL,mark:"kPa",unitConversionBase:o.PRESSURE,conversionFactor:.001,conversionDecimalPlacesShift:3},GRAM_PER_MOL:{id:l.GRAM_PER_MOL,mark:"g/mol",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},INVALID:{id:l.INVALID,mark:"!invalid!",
unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},RPM:{id:l.RPM,mark:"rpm",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLIVOLT:{id:l.MILLIVOLT,mark:"mV",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLIVOLT_PER_PH:{id:l.MILLIVOLT_PER_PH,mark:"mV/pH",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MICROSIEMENS_PER_CENTIMETER:{id:l.MICROSIEMENS_PER_CENTIMETER,mark:"µS/cm",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},GRAM_PER_SQUARE_CENTIMETER:{id:l.GRAM_PER_SQUARE_CENTIMETER,mark:"g/cm²",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},GRAM_PER_METER:{id:l.GRAM_PER_METER,mark:"g/m",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},CENTILITER:{id:l.CENTILITER,mark:"cl",
unitConversionBase:o.VOLUME,conversionFactor:.1,conversionDecimalPlacesShift:1},DENSITY:{id:l.DENSITY,mark:"g/cm³",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},VOLUME:{id:l.VOLUME,mark:"cm³",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},KG_M3:{id:l.KG_M3,mark:"kg/m³",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MMHG:{id:l.MMHG,mark:"mmHg",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},KELVIN:{id:l.KELVIN,mark:"K",unitConversionBase:o.TEMPERATURE,conversionFactor:1,conversionDecimalPlacesShift:0},PASCAL:{id:l.PASCAL,mark:"Pa",unitConversionBase:o.PRESSURE,conversionFactor:1,conversionDecimalPlacesShift:0}},t.convertValueToTargetUnitBigNumber=E,t.convertValueToTargetUnit=_,t.createQuantity=function(e,t,a){let s={value:NaN,unit:l.NONE,decimals:0};if(n.isObject(e)){s=Object.assign(s,e)
;for(const e of Object.keys(s))["value","unit","decimals","auxiliaryDigits","alibiId","alibi","deviceserial","stable","timestamp","info"].includes(e)||delete s[e]}else if(n.isObject(t))(t=t).value.numbers.length>0&&(s.value=parseFloat(t.value.numbers[0])),s.unit=p(t.value.unit),s.decimals=t.value.decimals;else if(n.isObject(a)){const e=(a=a).value;s.value=parseFloat(e.number),n.isNumber(s.value)||(s.info=e.number),n.isNumber(s.value)&&"-"===e.sign&&(s.value*=-1),s.decimals=e.decimals,s.unit=p(e.unit),s.stable=e.isStable,n.isNumber(e.auxiliaryDigits)&&e.auxiliaryDigits>0&&(s.auxiliaryDigits=e.auxiliaryDigits)}return s.unit=n.setEnumSafely(s.unit,l,l.NONE),s},t._formatQuantityParam_numberOnly=u,t.formatQuantityParam_numberOnly=function(e){return null!==e&&e.hasOwnProperty("value")&&e.hasOwnProperty("decimals")?n.isNumber(e.value)?u(e.value,e.decimals):"NaN":"N.A."},t.formatQuantityParam=function(e){
return null!==e&&e.hasOwnProperty("value")&&e.hasOwnProperty("unit")&&e.hasOwnProperty("decimals")?n.isNumber(e.value)?u(e.value,e.decimals)+" "+A(e.unit):"NaN":"N.A."},t.convertToTargetUnit=c,t.getUnitString=A,t.getUnitEnum=p,t.math_getSimple_numberArray=d,t.math_count=function(e){return d(e).length},t.math_getMaximumDecimals=T,t.math_roundUp=function(e,t){let a=s.bignumber(e),i=a.minus(a.floor()),n=(i=i.times(s.bignumber(10).pow(t))).minus(i.floor());return s.larger(n,0)&&(i=i.minus(n).add(1)),i=i.dividedBy(s.bignumber(10).pow(t)),a.floor().add(i).toNumber()},t.math_roundAuto=I,t.math_detectLeastSignificantDigit=function(e){let t=0,a=1,i=s.bignumber(e).abs(),n=i.floor(),r=i.minus(n);for(;r.greaterThan(0);)t++,n=(r=r.times(10)).floor(),r=r.minus(n);return t>0&&(a=n.dividedBy(s.bignumber(10).pow(t)).toNumber()),a},t.math_sum=h,t.math_Sum=function(e,t){let a=[];for(let s=0;s<e.length;s++)n.isNumber(e[s].value)&&(a[s]=c(e[s],t));return{value:h(a),unit:t,decimals:T(a)}},t.math_mean=N,
t.math_Mean=m,t.math_mean_longterm=S,t.math_Mean_Longterm=function(e,t,a){const s=c(e,a);return s.value=S(s,t),s},t.math_standard_deviation=R,t.math_Standard_Deviation=P,t.math_standard_deviation_longterm=g,t.math_Standard_Deviation_Longterm=function(e,t,a,s){return c({value:g(e,(t=c(t,a.unit)).value,a.value),unit:a.unit,decimals:a.decimals},s)},t.math_minimum=D,t.math_Minimum=function(e,t){let a=[];for(let s=0;s<e.length;s++)n.isNumber(e[s].value)&&(a[s]=c(e[s],t));return{value:D(a),unit:t,decimals:T(a)}},t.math_maximum=O,t.math_Maximum=function(e,t){let a=[];for(let s=0;s<e.length;s++)n.isNumber(e[s].value)&&(a[s]=c(e[s],t));return{value:O(a),unit:t,decimals:T(a)}},t.math_variation_coefficient=M,t.math_Variation_Coefficient=function(e){let t=[];for(let a=0;a<e.length;a++)n.isNumber(e[a].value)&&(t[a]=c(e[a],l.GRAM));return{value:M(t),unit:l.PERCENT,decimals:2}},t.math_variation_coefficient_longterm=C,t.math_Variation_Coefficient_Longterm=function(e,t){return{value:C(c(e,t.unit),t),
unit:l.PERCENT,decimals:2}},t.math_cp=function(e,t,a){let s=d(e);return n.isObject(e)&&0!==e.length?L(R(s),t,a):NaN},t.math_Cp=function(e,t,a){return f(P(e,t.unit),t,a)},t.math_cp_longterm=L,t.math_Cp_Longterm=f,t.math_cpk=function(e,t,a){return b(R(e),N(e),t,a)},t.math_Cpk=function(e,t,a){return v(P(e,t.unit),m(e,t.unit),t,a)},t.math_cpk_longterm=b,t.math_Cpk_Longterm=v},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(5),i=a(0),n=a(14),r=a(12),o=a(6);var l,E,_;function u(e,a,s){return{appearance:i.EnumAppearance.ENABLED_SECONDARY,type:E.CALLBACK,name:a||r.EnumFontLabels.OK,effect:{method:"buttonClickEvent",module:"qappHandler",params:{buttonId:e||t.MESSAGEHANDLER_OK_BTN_ID},calltarget:s||_.ReST}}}!function(e){e.FATAL="FATAL",e.ERROR="ERROR",e.WARNING="WARNING",e.INFORMATION="INFORMATION"}(l=t.MESSAGE_HANDLER_MESSAGE_TYPE||(t.MESSAGE_HANDLER_MESSAGE_TYPE={})),function(e){e.UNTIL_EXPLICIT_DELETION="UNTIL_EXPLICIT_DELETION",
e.UNTIL_EXPLICIT_DELETION_OR_REBOOT="UNTIL_EXPLICIT_DELETION_OR_REBOOT",e.UNTIL_USER_ACKNOWLEDGE_WITH_REBOOT_PERSISTENCE="UNTIL_USER_ACKNOWLEDGE_WITH_REBOOT_PERSISTENCE",e.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE="UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE"}(t.MESSAGE_HANDLER_LIFETIME||(t.MESSAGE_HANDLER_LIFETIME={})),function(e){e.NAVIGATETO="NavigateTo",e.CALLBACK="Callback"}(E=t.MESSAGE_HANDLER_BUTTON_TYPE||(t.MESSAGE_HANDLER_BUTTON_TYPE={})),function(e){e.MQTT="MQTT",e.ReST="ReST",e.REMOVE_MESSAGE="REMOVE_MESSAGE"}(_=t.MessageHandlerCallTarget||(t.MessageHandlerCallTarget={})),function(e){e.NONE="NONE",e.USER_CAL="USER_CAL",e.QAPP="QAPP"}(t.MessageHandlerCategory||(t.MessageHandlerCategory={})),t.MESSAGEHANDLER_OK_BTN_ID="BTN_OK_MESSAGEHANDLER",t.MESSAGEHANDLER_CLOSE_QAPP_BTN_I18N="_QAPP_LIB_CONNECTION_ERROR_CLOSE_QAPP_BTN",t.createMessageHandlerButton=u;t.MessageHandlerProxy=class extends s.BaseProxy{constructor(){super(...arguments),
this.restEndpoint="messagehandler"}addMessage(e,t,a,i,r,l,E,_,c,A){return this.body.method=o.RestMethodsMESSAGE_HANDLER.addMessage,this.body.params={message:{errorCode:e,type:t,lifetime:i,title:r,reason:l,solution:E,buttons:c||[u()],category:a,categorysecret:_},showMessageInFutureMillis:A||0,uniqueMessageId:0},console.log("addMessageHandler: "+n.inspect(this.body.params.message)),new s.CubisRestResponse(this.syncRequest()).rawReturns.uniqueMessageId}deleteMessageByCategory(e,t){return this.body.method=o.RestMethodsMESSAGE_HANDLER.deleteMessageByCategory,this.body.params={categoryAsString:e,secret:t},console.log("deleteMessageByCategory: "+n.inspect(this.body.params)),new s.CubisRestResponse(this.syncRequest())}deleteMessagesByCategory(e){return this.body.method=o.RestMethodsMESSAGE_HANDLER.deleteMessagesByCategory,this.body.params={categorySecretArray:JSON.stringify({arraySize:e.length,data:e})},console.log("deleteMessagesByCategory: "+n.inspect(this.body.params)),
new s.CubisRestResponse(this.syncRequest())}getAllMessagesByCategory(e){this.body.method=o.RestMethodsMESSAGE_HANDLER.getAllMessagesByCategory,this.body.params={categoryAsString:e,messages:{}};let t=new s.CubisRestResponse(this.syncRequest());return JSON.parse(t.rawReturns.messages).data}getAllErrorMessagesByCategory(e){let t=this.getAllMessagesByCategory(e),a=[];for(let e of t)e.type===l.ERROR&&a.push(e);return a}removeMessage(e){return this.body.method=o.RestMethodsMESSAGE_HANDLER.removeMessage,this.body.params={uniqueMessageId:e},new s.CubisRestResponse(this.syncRequest())}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(17);class i{static roundExactToDecimals(e,t){return this.nTimesTen(this.roundExact(this.nTimesTen(e,t)),-1*t)}static roundExact(e){return e=e>=0?Math.floor(e+.5+Number.EPSILON):Math.ceil(e-.5-Number.EPSILON)}static nTimesTen(e,t){return s.bignumber(e).times(i.decPowers(t)).toNumber()}static countDecimals(e){
return s.bignumber(e).decimalPlaces()}static decPowers(e){switch(e){case-15:return 1e-15;case-14:return 1e-14;case-13:return 1e-13;case-12:return 1e-12;case-11:return 1e-11;case-10:return 1e-10;case-9:return 1e-9;case-8:return 1e-8;case-7:return 1e-7;case-6:return 1e-6;case-5:return 1e-5;case-4:return 1e-4;case-3:return.001;case-2:return.01;case-1:return.1;case 0:return 1;case 1:return 10;case 2:return 100;case 3:return 1e3;case 4:return 1e4;case 5:return 1e5;case 6:return 1e6;case 7:return 1e7;case 8:return 1e8;case 9:return 1e9;case 10:return 1e10;case 11:return 1e11;case 12:return 1e12;case 13:return 1e13;case 14:return 1e14;case 15:return 1e15;default:return Math.pow(10,e)}}}t.SartoMath=i},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EV_MQTT_UPDATE="EV_MQTT_UPDATE";class s{constructor(e){this.payload=e,this.type=t.EV_MQTT_UPDATE}}t.MqttUpdateEvent=s,t.EV_MQTT_UPDATE_DEBUG="EV_MQTT_UPDATE_DEBUG";t.MqttUpdateDebugEvent=class extends s{constructor(){
super(...arguments),this.type=t.EV_MQTT_UPDATE_DEBUG}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MQTT_ADMIN_EVENT="MQTT_ADMIN_EVENT",t.MQTT_ADMIN_EVENT_PACKET_SENT="packetsend";t.MqttAdminEvent=class{constructor(e){this.payload=e,this.type=t.MQTT_ADMIN_EVENT}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EV_HMI_BTN_CLICKED="EV_HMI_BTN_CLICKED",t.EV_HMI_PARAM_CHANGED="EV_HMI_PARAM_CHANGED",t.EV_HMI_PARAM_DETAIL="EV_HMI_PARAM_DETAIL",t.EV_REST_REQUEST="EV_REST_REQUEST";const s=a(36);t.HmiButtonClickedEvent=class{constructor(e){this.payload=e,this.type=t.EV_HMI_BTN_CLICKED}};t.HmiParamChangedEvent=class{constructor(e){this.payload=e,this.type=t.EV_HMI_PARAM_CHANGED}};t.HmiParamDetailEvent=class{constructor(e){this.payload=e,this.type=t.EV_HMI_PARAM_DETAIL}};t.RestRequestEvent=class{constructor(e){this.payload=e,this.type=t.EV_REST_REQUEST}},t.getParamsForRestRequestEvent=function(e){
return new s.URL("http://127.0.0.1/"+e.payload.subUrl).searchParams}},function(e,t){e.exports=require("rxjs")},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TASK_DYNAMIC_ID_GROUPS_PREFIX="TASK/DYNAMIC_ID",t.TASK_DYNAMIC_ID_CNT_GROUP_ID=t.TASK_DYNAMIC_ID_GROUPS_PREFIX+"_CNT",t.TASK_DYNAMIC_ID_LID_GROUP_ID=t.TASK_DYNAMIC_ID_GROUPS_PREFIX+"_LID",t.TASK_DYNAMIC_ID_SID_GROUP_ID=t.TASK_DYNAMIC_ID_GROUPS_PREFIX+"_SID",t.TASK_DYNAMIC_ID_DB_CONN_CONFIG_GROUP_ID=t.TASK_DYNAMIC_ID_GROUPS_PREFIX+"_DB_CONN_CONFIG",t.TASK_DYNAMIC_ID_LID_CNT_PARAM_ID=t.TASK_DYNAMIC_ID_CNT_GROUP_ID+"/LID_CNT",t.TASK_DYNAMIC_ID_LID_X_PARAM_ID_PREFIX=t.TASK_DYNAMIC_ID_LID_GROUP_ID+"/LID_",t.TASK_DYNAMIC_ID_LID_X_PARAM_ID_SUFFIX_HEADER="H_",t.TASK_DYNAMIC_ID_LID_X_PARAM_ID_SUFFIX_TITLE="T_",t.TASK_DYNAMIC_ID_LID_CNT_MIN=0,t.TASK_DYNAMIC_ID_LID_CNT_MAX=5,t.TASK_DYNAMIC_ID_SID_CNT_PARAM_ID=t.TASK_DYNAMIC_ID_CNT_GROUP_ID+"/SID_CNT",
t.TASK_DYNAMIC_ID_SID_X_PARAM_ID_PREFIX=t.TASK_DYNAMIC_ID_SID_GROUP_ID+"/SID_",t.TASK_DYNAMIC_ID_SID_X_PARAM_ID_SUFFIX_HEADER="H_",t.TASK_DYNAMIC_ID_SID_X_PARAM_ID_SUFFIX_TITLE="T_",t.TASK_DYNAMIC_ID_SID_X_PARAM_ID_SUFFIX_MODE="M_",t.TASK_DYNAMIC_ID_SID_CNT_MIN=0,t.TASK_DYNAMIC_ID_SID_CNT_MAX=5,t.TASK_DYNAMIC_ID_DB_TYPES_PARAM_ID=t.TASK_DYNAMIC_ID_DB_CONN_CONFIG_GROUP_ID+"/TYPES",t.TASK_DYNAMIC_ID_DB_USERNAME_PARAM_ID=t.TASK_DYNAMIC_ID_DB_CONN_CONFIG_GROUP_ID+"/USERNAME",t.TASK_DYNAMIC_ID_DB_PASSWORD_PARAM_ID=t.TASK_DYNAMIC_ID_DB_CONN_CONFIG_GROUP_ID+"/PASSWORD",t.TASK_DYNAMIC_ID_DB_DATABASE_PARAM_ID=t.TASK_DYNAMIC_ID_DB_CONN_CONFIG_GROUP_ID+"/DATABASE",t.TASK_DYNAMIC_ID_DB_SCHEMA_PARAM_ID=t.TASK_DYNAMIC_ID_DB_CONN_CONFIG_GROUP_ID+"/SCHEMA",t.TASK_DYNAMIC_ID_DB_IP_PARAM_ID=t.TASK_DYNAMIC_ID_DB_CONN_CONFIG_GROUP_ID+"/IP",t.TASK_DYNAMIC_ID_DB_PORT_PARAM_ID=t.TASK_DYNAMIC_ID_DB_CONN_CONFIG_GROUP_ID+"/PORT",t.TASK_DYNAMIC_ID_CNT_OPTION_PREFIX="CNT_",function(e){e.POSTGRES="postgres",
e.MYSQL="mysql",e.MSSQL="mssql",e.SQLITE="sqlite"}(t.EnumDatabaseTypesOptions||(t.EnumDatabaseTypesOptions={})),function(e){e.OFF="OFF",e.ON="ON"}(t.EnumLotIdentifierOptions||(t.EnumLotIdentifierOptions={})),function(e){e.OFF="OFF",e.ON="ON",e.ON_AUTO_INC="ON_AUTO_INC",e.ON_AUTO_DEC="ON_AUTO_DEC"}(t.EnumSampleIdentifierOptions||(t.EnumSampleIdentifierOptions={})),t.createIDCntOption=function(e){return t.TASK_DYNAMIC_ID_CNT_OPTION_PREFIX+e.toFixed(0)},t.getConfiguredIds=function(e){return parseInt(e.value.selection.id.replace(t.TASK_DYNAMIC_ID_CNT_OPTION_PREFIX,""),10)},t.createLIDParamId=function(e,a){return t.TASK_DYNAMIC_ID_LID_X_PARAM_ID_PREFIX+a+e.toFixed(0)},t.createSIDParamId=function(e,a){return t.TASK_DYNAMIC_ID_SID_X_PARAM_ID_PREFIX+a+e.toFixed(0)}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(5),i=a(3),n=a(8),r=a(1),o=a(6);var l;!function(e){e.STABLE="STABLE",e.CANCELED="CANCELED"
}(t.ReportingPrintableValueStateEnum||(t.ReportingPrintableValueStateEnum={})),function(e){e.wrongAlibiId="No alibi entry exists for this alibi id.",e.wrongTopic="Weighing topic not found for this alibi entry.",e.getAlibiListFailed="The rest call to get the Alibilist has failed!"}(l=t.AlibiEntryError||(t.AlibiEntryError={})),t.isAlibiEntryError=function(e){return e===l.wrongAlibiId||e===l.wrongTopic||e===l.getAlibiListFailed},t.REPORTING_CATEGORY_NONE="",t.REPORTING_CATEGORY_INIT="_QAPP_LIB_REPORTING_CATERGORY_INIT",t.REPORTING_CATEGORY_COMPONENTS="_QAPP_LIB_REPORTING_CATERGORY_COMPONENTS",t.REPORTING_CATEGORY_RESULT="_QAPP_LIB_REPORTING_CATERGORY_RESULT",t.REPORTING_CATEGORY_STATISTIC="_QAPP_LIB_REPORTING_CATERGORY_STATISTIC";class E extends s.CubisRestResponse{constructor(e){super(e)}getPrintItemIdentifier(){return this.rawReturns.printItemIdentifier}}t.ReportingPrintParamResponse=E;t.ReportingProxy=class extends s.BaseProxy{constructor(){super(...arguments),
this.restEndpoint="reporting",this._isPrintQueueEmpty=!0}printParameters(e,t,a,s=-1){this.body.method=o.RestMethodsREPORTING.printParameters,this.body.params={parameters:JSON.stringify(e),category:t,redactable:a,printItemIdentifier:s};let i=new E(this.syncRequest());return i.isSuccess()&&(this._isPrintQueueEmpty=!1),i}printPrintQueue(){return this.body.method=o.RestMethodsREPORTING.printPrintQueueWithElectronicSignature,this.body.params={},new s.CubisRestResponse(this.syncRequest())}printParametersDirect(e,t,a){return this.body.method=o.RestMethodsREPORTING.printParametersDirect,this.body.params={parameters:JSON.stringify(e),category:t,silent:a},new s.CubisRestResponse(this.syncRequest())}getPrintQueue(){return this.body.method=o.RestMethodsREPORTING.getPrintQueue,this.body.params={printQueue:{}},new s.CubisRestResponse(this.syncRequest())}isPrintQueueEmpty(){let e;this.body.method=o.RestMethodsREPORTING.isPrintQueueEmpty,this.body.params={rResult:!1};try{
return!!(e=new s.CubisRestResponse(this.syncRequest())).isSuccess()&&e.rawReturns.rResult}catch(e){return console.log("Something went wrong when calling isPrintQueueEmpty"),console.log(e),this._isPrintQueueEmpty}}clearPrintQueue(){this.body.method=o.RestMethodsREPORTING.clearPrintQueue,this.body.params={};let e=new s.CubisRestResponse(this.syncRequest());return e.isSuccess()&&(this._isPrintQueueEmpty=!0),console.log("clearPrintQueue() result: "+e.isSuccess()),e}requestPrintableValue(e){return this.body.method=o.RestMethodsREPORTING.requestPrintableValueComment,this.body.params={comment:e},new s.CubisRestResponse(this.syncRequest())}setRedactionStatus(e,t,a){return this.body.method=o.RestMethodsREPORTING.setRedactionStatus,this.body.params={printItemIdentifier:e,redacted:t,reason:a},new s.CubisRestResponse(this.syncRequest())}getAlibiRecord(e){return this.body.method=o.RestMethodsREPORTING.getAlibiRecord,this.body.params={identifier:e,record:""},
new s.CubisRestResponse(this.syncRequest())}getAlibiRecordList(e){return this.body.method=o.RestMethodsREPORTING.getAlibiRecordList,this.body.params={identifiers:e,records:[]},new s.CubisRestResponse(this.syncRequest())}getDateFromAlibi(e){let t;if(e instanceof s.CubisRestResponse){if(!e.isSuccess())return l.getAlibiListFailed;t=JSON.parse(e.rawReturns.record)}else{if("number"==typeof e){let t=this.getAlibiRecord(e);return t.isSuccess()?JSON.parse(t.rawReturns.record).timestamp:l.wrongAlibiId}t=e}return t.timestamp}getWeightFromAlibi(e,t){let a;if(e instanceof s.CubisRestResponse){if(!e.isSuccess())return l.getAlibiListFailed;a=JSON.parse(e.rawReturns.record)}else if("number"==typeof e){let t=this.getAlibiRecord(e);if(!t.isSuccess())return l.wrongAlibiId;a=JSON.parse(t.rawReturns.record)}else a=e;return this.parseMeasureParameterFromAlibiResponse(a,t)}getWeightFromAlibiList(e,t){let a=[],i=[];if(e instanceof s.CubisRestResponse){if(!e.isSuccess())return l.getAlibiListFailed
;i=JSON.parse(e.rawReturns.records)}else if(0!==(n=e).length&&"number"!=typeof n[0])i=e;else{let t=this.getAlibiRecordList(e);if(!t.isSuccess())return l.getAlibiListFailed;i=JSON.parse(t.rawReturns.records)}var n;return i.forEach(e=>{a=[...a,this.parseMeasureParameterFromAlibiResponse(e,t)]}),a}parseMeasureParameterFromAlibiResponse(e,t){let a=i.createEmptyParameterGroupOfGroups();if(null===e)return l.wrongAlibiId;{a.parameters[0].parameters=JSON.parse(e.weighingblock);let s=n.WeightBlockHelper.getMeasureParameter(a,t||r.MqttTopics.WEIGHING_VALUE_NET);return void 0===s?l.wrongTopic:s}}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(0),i=a(4),n=a(7),r=a(1);t.CANCEL_BUTTON_ID="BTN_CANCEL";class o{constructor(e){this.paramDetailsOverlayObject={appearance:s.EnumAppearance.HIDDEN,title:{id:"",args:[]},params:[]},this.events$=new n.Subject,this.mqttHandler=e}setAppearance(e){
this.paramDetailsOverlayObject.appearance!==e&&(e!==s.EnumAppearance.HIDDEN&&e!==s.EnumAppearance.ENABLED||(this.paramDetailsOverlayObject.appearance=e,this.mqttHandler.publish(r.MqttTopics.HMI_PARAMDETAILSOVERLAY,JSON.stringify(this.paramDetailsOverlayObject))))}getAppearance(){return this.paramDetailsOverlayObject.appearance}setTitle(e,t){this.paramDetailsOverlayObject.title.id===e&&this.paramDetailsOverlayObject.title.args.join("")===t.join("")||(this.paramDetailsOverlayObject.title.id=e,this.paramDetailsOverlayObject.title.args=t,this.paramDetailsOverlayObject.appearance!==s.EnumAppearance.HIDDEN&&this.mqttHandler.publish(r.MqttTopics.HMI_PARAMDETAILSOVERLAY,JSON.stringify(this.paramDetailsOverlayObject)))}getTitle(){return this.paramDetailsOverlayObject.title}setParams(e){this.paramDetailsOverlayObject.params.join("")!==e.join("")&&(this.paramDetailsOverlayObject.params=e,
this.paramDetailsOverlayObject.appearance!==s.EnumAppearance.HIDDEN&&this.mqttHandler.publish(r.MqttTopics.HMI_PARAMDETAILSOVERLAY,JSON.stringify(this.paramDetailsOverlayObject)))}getParams(){return this.paramDetailsOverlayObject.params}getId(){return"PARAMDETAILSOVERLAY"}getButton(e){}hide(){this.paramDetailsOverlayObject.appearance===s.EnumAppearance.ENABLED&&(this.setAppearance(s.EnumAppearance.HIDDEN),this.events$.next({type:i.ScreenEventType.HIDE_OVERLAY,id:this.getId()}))}show(){this.paramDetailsOverlayObject.appearance===s.EnumAppearance.HIDDEN&&(this.setAppearance(s.EnumAppearance.ENABLED),this.events$.next({type:i.ScreenEventType.SHOW_OVERLAY,id:this.getId()}))}}t.ParamDetailsOverlay=o,t.default=o},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(3),i=a(8),n=a(15),r=a(2);t.checkGeneralParamRules=function(e){let t=void 0;if(s.isTypeOfIQuantityParameter(e)){let a=i.QuantityParameter.getValue(e);if(Number.isNaN(a)){
if(!0!==e.info.isNoValueAllowed){let a=r.cloneJSON(n.ParamUpdateUserActionSimpleAccept);void 0!==e.info.noValueErrorMsg?"string"==typeof e.info.noValueErrorMsg?a.textList=[{id:e.info.noValueErrorMsg,args:[]}]:a.textList=[e.info.noValueErrorMsg]:a.textList=[{id:"_QAPP_LIB_MSG_BOX_ERROR_CFG_QUANT_PARAM_EMPTY_NOT_ALLOWED",args:[]}],t={updatedParameter:e,message:a}}}else try{if(a<parseFloat(e.info.minimum.value)){let a=r.cloneJSON(n.ParamUpdateUserActionSimpleAccept);a.textList=[{id:e.info.minimum.errorMsg?e.info.minimum.errorMsg:"_QAPP_LIB_MSG_BOX_ERROR_CFG_QUANT_PARAM_EXCEED_MIN",args:[]}],t={updatedParameter:e,message:a}}else if(a>parseFloat(e.info.maximum.value)){let a=r.cloneJSON(n.ParamUpdateUserActionSimpleAccept);a.textList=[{id:e.info.maximum.errorMsg?e.info.maximum.errorMsg:"_QAPP_LIB_MSG_BOX_ERROR_CFG_QUANT_PARAM_EXCEED_MAX",args:[]}],t={updatedParameter:e,message:a}}}catch(e){}}else if(s.isTypeOfIStringParameter(e)){let a=e.value.string;try{if(void 0===a){
if(0!==e.info.minimum.length&&!0!==e.info.isNoValueAllowed){let a=r.cloneJSON(n.ParamUpdateUserActionSimpleAccept);void 0!==e.info.noValueErrorMsg?"string"==typeof e.info.noValueErrorMsg?a.textList=[{id:e.info.noValueErrorMsg,args:[]}]:a.textList=[e.info.noValueErrorMsg]:a.textList=[{id:"_QAPP_LIB_MSG_BOX_ERROR_CFG_STRING_PARAM_MANDATORY",args:[]}],t={updatedParameter:e,message:a}}}else if(a.length<e.info.minimum.length)if(0===a.length){if(console.log("StringParam: empty"),!0!==e.info.isNoValueAllowed){let a=r.cloneJSON(n.ParamUpdateUserActionSimpleAccept);void 0!==e.info.noValueErrorMsg?"string"==typeof e.info.noValueErrorMsg?a.textList=[{id:e.info.noValueErrorMsg,args:[]}]:a.textList=[e.info.noValueErrorMsg]:a.textList=[{id:"_QAPP_LIB_MSG_BOX_ERROR_CFG_STRING_PARAM_MANDATORY",args:[]}],t={updatedParameter:e,message:a}}}else{console.log("StringParam: min exceed");let a=r.cloneJSON(n.ParamUpdateUserActionSimpleAccept);a.textList=[{
id:e.info.minimum.errorMsg?e.info.minimum.errorMsg:"_QAPP_LIB_MSG_BOX_ERROR_CFG_STRING_PARAM_TOO_SHORT",args:[]}],t={updatedParameter:e,message:a}}else if(a.length>e.info.maximum.length)if(console.log("StringParam: max exceed"),!0===e.info.maximum.autoCut)console.log("StringParam: autocut"),e.value.string=a.substr(0,e.info.maximum.length);else{let a=r.cloneJSON(n.ParamUpdateUserActionSimpleAccept);a.textList=[{id:e.info.maximum.errorMsg?e.info.maximum.errorMsg:"_QAPP_LIB_MSG_BOX_ERROR_CFG_STRING_PARAM_TOO_LONG",args:[]}],t={updatedParameter:e,message:a}}}catch(e){}}else if(s.isTypeOfIPasswordParameter(e)){let a=e.value.string;try{if(void 0===a){if(0!==e.info.minimum.length&&!0!==e.info.isNoValueAllowed){let a=r.cloneJSON(n.ParamUpdateUserActionSimpleAccept);void 0!==e.info.noValueErrorMsg?"string"==typeof e.info.noValueErrorMsg?a.textList=[{id:e.info.noValueErrorMsg,args:[]}]:a.textList=[e.info.noValueErrorMsg]:a.textList=[{id:"_QAPP_LIB_MSG_BOX_ERROR_CFG_STRING_PARAM_MANDATORY",
args:[]}],t={updatedParameter:e,message:a}}}else if(a.length<e.info.minimum.length)if(0===a.length){if(console.log("PasswordParam: empty"),!0!==e.info.isNoValueAllowed){let a=r.cloneJSON(n.ParamUpdateUserActionSimpleAccept);void 0!==e.info.noValueErrorMsg?"string"==typeof e.info.noValueErrorMsg?a.textList=[{id:e.info.noValueErrorMsg,args:[]}]:a.textList=[e.info.noValueErrorMsg]:a.textList=[{id:"_QAPP_LIB_MSG_BOX_ERROR_CFG_STRING_PARAM_MANDATORY",args:[]}],t={updatedParameter:e,message:a}}}else{console.log("PasswordParam: min exceed");let a=r.cloneJSON(n.ParamUpdateUserActionSimpleAccept);a.textList=[{id:e.info.minimum.errorMsg?e.info.minimum.errorMsg:"_QAPP_LIB_MSG_BOX_ERROR_CFG_STRING_PARAM_TOO_SHORT",args:[]}],t={updatedParameter:e,message:a}}else if(a.length>e.info.maximum.length){console.log("PasswordParam: max exceed");let a=r.cloneJSON(n.ParamUpdateUserActionSimpleAccept);a.textList=[{
id:e.info.maximum.errorMsg?e.info.maximum.errorMsg:"_QAPP_LIB_MSG_BOX_ERROR_CFG_STRING_PARAM_TOO_LONG",args:[]}],t={updatedParameter:e,message:a}}}catch(e){}}return t}},function(e,t){e.exports=require("url")},function(e,t){e.exports=require("http")},function(e,t){e.exports=require("child_process")},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(5),i=a(6);!function(e){e.EVENT_RESTART="restart"}(t.EnumTaskManagementEvent||(t.EnumTaskManagementEvent={}));class n extends s.CubisRestResponse{constructor(e){super(e)}getErrorList(){return JSON.parse(this.rawReturns.errorList)}}t.TaskValCreaUpdResponse=n;t.TaskProxy=class extends s.BaseProxy{constructor(){super(...arguments),this.restEndpoint="task/management"}getTaskTemplate(){let e,t;return this.body.method=i.RestMethodsTASK_MANAGEMENT.getTaskTemplate,this.body.params={taskTemplate:{}},e=new s.CubisRestResponse(this.syncRequest()),t=JSON.parse(e.rawReturns.taskTemplate)}readTask(e,t=!0){let a,n
;if(this.body.method=i.RestMethodsTASK_MANAGEMENT.readTask,this.body.params={document:{},dbId:e,updateOptions:t},!(a=new s.CubisRestResponse(this.syncRequest())).isSuccess())throw new Error("Error reading task with id '"+e+"'");return n=JSON.parse(a.rawReturns.document)}getTaskName(e){try{let t=this.readTask(e).params.find(e=>"TASK/IDENTIFICATION"===e.id);if(void 0!==t){let e=t.parameters.find(e=>"TASK/IDENTIFICATION/NAME"===e.id);if(void 0!==e)return e.value.string}return}catch(e){return}}createTask(e){return this.body.method=i.RestMethodsTASK_MANAGEMENT.createTask,this.body.params={task:JSON.stringify(e),errorList:[]},new n(this.syncRequest())}updateTask(e){return this.body.method=i.RestMethodsTASK_MANAGEMENT.updateTask,this.body.params={task:JSON.stringify(e),errorList:[]},new n(this.syncRequest())}validateTask(e){return this.body.method=i.RestMethodsTASK_MANAGEMENT.validate,this.body.params={task:JSON.stringify(e),errorList:[]},new n(this.syncRequest())}saveWorkstate(e,t){let a
;if(this.body.method=i.RestMethodsTASK_MANAGEMENT.saveWorkstate,this.body.params={id:t,workstate:e},!(a=new s.CubisRestResponse(this.syncRequest())).isSuccess())throw new Error("Error saving workstate with id '"+t+"'");return a}deleteWorkstate(e){let t;if(this.body.method=i.RestMethodsTASK_MANAGEMENT.deleteWorkstate,this.body.params={id:e},!(t=new s.CubisRestResponse(this.syncRequest())).isSuccess())throw new Error("Error deleting workstate with id '"+e+"'");return t}getWorkstate(e){let t,a;if(this.body.method=i.RestMethodsTASK_MANAGEMENT.getWorkstate,this.body.params={id:e,workstate:{}},!(t=new s.CubisRestResponse(this.syncRequest())).isSuccess())throw new Error("Error reading task with id '"+e+"'");return a=JSON.parse(t.rawReturns.workstate).workstate}getTaskNamesByOrderNumber(e){let t;if(this.body.method=i.RestMethodsTASK_MANAGEMENT.getTaskNamesByOrderNumber,this.body.params={orderNumber:e,taskNames:[]},
(t=new s.CubisRestResponse(this.syncRequest())).isSuccess())return JSON.parse(t.rawReturns.taskNames);throw new Error("Error getting used taskNames for '"+e+"'")}setTaskEvent(e,t){let a;console.log(`TaskManagementProxy: send event: '${t}'`),this.body.method=i.RestMethodsTASK_MANAGEMENT.setTaskEvent,this.body.params={taskId:e,event:t};try{return(a=new s.CubisRestResponse(this.syncRequest())).isSuccess()}catch(e){return console.log("Something went wrong when calling sendTaskEvent"),console.log(e),!1}}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(9),i=a(31),n=a(5),r=a(8),o=a(26),l=a(41),E=a(19),_=a(67),u=a(6),c=a(25);var A,p=a(31);t.Subscription=p.Subscription,t.Observable=p.Observable,t.WEIGHING_BUTTON_UNIT="UNIT",t.WEIGHING_BUTTON_DO_ZERO="DO_ZERO",t.WEIGHING_BUTTON_DO_TARE="DO_TARE",t.WEIGHING_BUTTON_DO_TARE1="DO_TARE1",t.WEIGHING_BUTTON_CLR_TARE1="CLR_TARE1",t.WEIGHING_BUTTON_SET_TARE1="SET_TARE1",t.WEIGHING_BUTTON_SHOW_TARE1="SHOW_TARE1",
t.WEIGHING_BUTTON_HIDE_TARE1="HIDE_TARE1",t.WEIGHING_BUTTON_DISPLAY="DISPLAY",function(e){e.WEIGHING_DOZEROTARE_BEHAVIOR_AS_CONFIGURED="AS_CONFIGURED",e.WEIGHING_DOZEROTARE_BEHAVIOR_WITHOUT_STABILITY="WITHOUT_STABILITY",e.WEIGHING_DOZEROTARE_BEHAVIOR_AFTER_STABILITY="AFTER_STABILITY"}(t.WEIGHING_DOZEROTARE_BEHAVIOR||(t.WEIGHING_DOZEROTARE_BEHAVIOR={})),function(e){e.VERY_STABLE="VERY_STABLE",e.STABLE="STABLE",e.UNSTABLE="UNSTABLE",e.VERY_UNSTABLE="VERY_UNSTABLE"}(t.AMBIENT_CONDITION||(t.AMBIENT_CONDITION={})),function(e){e.SELECTED_DOMAIN_UNDEFINED="",e.SELECTED_DOMAIN_WEIGHING="ORIGINAL",e.SELECTED_DOMAIN_APP="APPLICATION"}(A=t.ISelectedWeightDisplayValueDomains||(t.ISelectedWeightDisplayValueDomains={}));const d="WEIGHING_ERROR_UNKNOWN_UNIT_ID";t.WeighingProxy=class extends n.BaseProxy{constructor(){super(...arguments),this.restEndpoint="weighing",this.weighValueMaxDigits=7,this.registeredApplications=[],this.metrologyMaximum$=new i.ReplaySubject(1),
this.metrologyMinimum$=new i.ReplaySubject(1),this.highestRangeInterval$=new i.ReplaySubject(1),this.lowestRangeInterval$=new i.ReplaySubject(1),this.highestRangePrecision$=new i.ReplaySubject(1),this.lowestRangePrecision$=new i.ReplaySubject(1),this.metrologyRanges$=new i.ReplaySubject(1),this.selectedDisplayValue$=new i.ReplaySubject(1),this.lastSelectedDisplayValueInfo={currentSelectedDomain:A.SELECTED_DOMAIN_UNDEFINED,currentSelectedId:"",lastSelectedApplicationId:""}}createWeightApplication(e,t,a,s,i=!1){if(this.registeredApplications.find(t=>t===e))return this.enableWeightApplication(e,i);{this.body.method=u.RestMethodsWEIGHING.createWeightApplication,this.body.params={id:e,title:t,header:a,isDynamic:s};let r=new n.CubisRestResponse(this.syncRequest());if(r.isSuccess()){try{this.enableWeightApplication(e,i)}catch(e){}this.registeredApplications.push(e)}return r}}enableWeightApplication(e,t){return this.body.method=u.RestMethodsWEIGHING.enableWeightApplication,this.body.params={
id:e,isEnabled:t},new n.CubisRestResponse(this.syncRequest())}enableWeightApplicationBulk(e,t){if(!t){let t=this.getSelectedDisplayValue();if(t){let a=t.lastSelectedApplicationId;if(a){let t=!1;return e.forEach(e=>{e!==a?this.enableWeightApplication(e,!1):t=!0}),void(t&&this.enableWeightApplication(a,!1))}}}e.forEach(e=>{this.enableWeightApplication(e,t)})}selectWeightApplication(e){return this.body.method=u.RestMethodsWEIGHING.selectWeightApplication,this.body.params={id:e},new n.CubisRestResponse(this.syncRequest())}destroyWeightApplication(e){this.body.method=u.RestMethodsWEIGHING.destroyWeightApplication,this.body.params={id:e};let t=new n.CubisRestResponse(this.syncRequest());if(t.isSuccess()){let t=this.registeredApplications.findIndex(t=>t===e);t>=0&&this.registeredApplications.splice(t,1)}return t}setButton(e,t){return this.body.method=u.RestMethodsWEIGHING.setButton,this.body.params={name:e,appearance:t},new n.CubisRestResponse(this.syncRequest())}triggerStableWeightBlock(){
return this.body.method=u.RestMethodsWEIGHING.triggerStableWeightBlock,this.body.params={},new n.CubisRestResponse(this.syncRequest())}cancelStableWeightBlock(){return this.body.method=u.RestMethodsWEIGHING.cancelStableWeightBlock,this.body.params={},new n.CubisRestResponse(this.syncRequest())}doZero(e){return this.body.method=u.RestMethodsWEIGHING.doZero,this.body.params={behavior:e},new n.CubisRestResponse(this.syncRequest())}clearTare1(){return this.body.method=u.RestMethodsWEIGHING.clearTare1,this.body.params={},new n.CubisRestResponse(this.syncRequest())}clearTare2(){return this.body.method=u.RestMethodsWEIGHING.clearTare2,this.body.params={},new n.CubisRestResponse(this.syncRequest())}clearTare1AndTare2(){return{clearTare1Response:this.clearTare1(),clearTare2Response:this.clearTare2()}}clearTareAll(){return this.body.method=u.RestMethodsWEIGHING.clearTareAll,this.body.params={},new n.CubisRestResponse(this.syncRequest())}doTare(e){
return this.body.method=u.RestMethodsWEIGHING.doTare,this.body.params={behavior:e},new n.CubisRestResponse(this.syncRequest())}doTare1(e){return this.body.method=u.RestMethodsWEIGHING.doTare1,this.body.params={behavior:e},new n.CubisRestResponse(this.syncRequest())}doTareAuto(e){return this.body.method=u.RestMethodsWEIGHING.doTareAuto,this.body.params={behavior:e},new n.CubisRestResponse(this.syncRequest())}doZeroTareAuto(e){return this.body.method=u.RestMethodsWEIGHING.doZeroTareAuto,this.body.params={behavior:e},new n.CubisRestResponse(this.syncRequest())}setTare1(e){return this.body.method=u.RestMethodsWEIGHING.setTare1,this.body.params={value:e},new n.CubisRestResponse(this.syncRequest())}cancelDoing(){return this.body.method=u.RestMethodsWEIGHING.cancelDoing,this.body.params={},new n.CubisRestResponse(this.syncRequest())}setTare2(e){return this.body.method=u.RestMethodsWEIGHING.setTare2,this.body.params={value:e},new n.CubisRestResponse(this.syncRequest())}setUnit(e,t=!0){
this.body.method=u.RestMethodsWEIGHING.setUnit,this.body.params={unitId:e};let a=new n.CubisRestResponse(this.syncRequest());if(a.isSuccess())return!0;if(a.result===d){if(t){let t=new l.MessageHandlerHelper(new o.MessageHandlerProxy),a=new _.ProfileManagementProxy,s=E.QAppBase.clientSingleton.getWeighingProfileId();t.addMessage(l.EMsgHandlerMsgs.ERR_704_UNIT_UNAVAILABLE,[E.QAppBase.clientSingleton.getTaskName()||"",c.getUnitString(e),s?a.getWeighingProfileName(s):""],void 0,[o.createMessageHandlerButton(void 0,void 0,o.MessageHandlerCallTarget.REMOVE_MESSAGE)]),E.QAppBase.clientSingleton.doSuspend()}return!1}return!1}getParameter(e){return this.body.method=u.RestMethodsWEIGHING.getParameter,this.body.params={rObject:{},id:e},new n.CubisRestResponse(this.syncRequest())}getParameterIds(){return this.body.method=u.RestMethodsWEIGHING.getParameterIds,this.body.params={rIds:{}},new n.CubisRestResponse(this.syncRequest())}setMinUsp(e){return this.body.method=u.RestMethodsWEIGHING.setMinUsp,
this.body.params={isEnabled:!0,value:r.QuantityParameter.getValue(e),unit:e.unit},new n.CubisRestResponse(this.syncRequest())}setMinWeight(e){return this.body.method=u.RestMethodsWEIGHING.setMinWeight,this.body.params=Object.assign({},e),new n.CubisRestResponse(this.syncRequest())}getWeighValueMaxDigits(){return this.weighValueMaxDigits}updateWeighValueMaxDigits(e){console.log("Weighing proxy: set new max weight value digit count: "+e),this.weighValueMaxDigits=e}updateMetrologyRanges(e){let t=s.last(e.parameters),a=s.head(e.parameters);if(this.metrologyRanges$.next(e),void 0!==t){let e=t.parameters.find(e=>"MAXIMUM"===s.last(e.id.split("/"))),a=t.parameters.find(e=>"INTERVAL"===s.last(e.id.split("/"))),i=t.parameters.find(e=>"PRECISION"===s.last(e.id.split("/")));void 0!==e&&this.metrologyMaximum$.next({maxUnit:e.value.unit,maxValue:r.QuantityParameter.getValue(e),maxDecimals:e.value.decimals}),void 0!==a&&this.highestRangeInterval$.next({intervalUnit:a.value.unit,
intervalValue:r.QuantityParameter.getValue(a),intervalDecimals:a.value.decimals}),void 0!==i&&this.highestRangePrecision$.next({precisionUnit:i.value.unit,precisionValue:r.QuantityParameter.getValue(i),precisionDecimals:i.value.decimals})}if(void 0!==a){let e=a.parameters.find(e=>"MINIMUM"===s.last(e.id.split("/"))),t=a.parameters.find(e=>"INTERVAL"===s.last(e.id.split("/"))),i=a.parameters.find(e=>"PRECISION"===s.last(e.id.split("/")));void 0!==e&&this.metrologyMinimum$.next({minUnit:e.value.unit,minValue:r.QuantityParameter.getValue(e),minDecimals:e.value.decimals}),void 0!==t&&this.lowestRangeInterval$.next({intervalUnit:t.value.unit,intervalValue:r.QuantityParameter.getValue(t),intervalDecimals:t.value.decimals}),void 0!==i&&this.lowestRangePrecision$.next({precisionUnit:i.value.unit,precisionValue:r.QuantityParameter.getValue(i),precisionDecimals:i.value.decimals})}}getSelectedDisplayValue(){return this.lastSelectedDisplayValueInfo}restoreLastSelectedDisplayValue(e){
void 0!==this.lastSelectedDisplayValueInfo&&(this.lastSelectedDisplayValueInfo.lastSelectedApplicationId=e,this.selectedDisplayValue$.next(this.lastSelectedDisplayValueInfo))}updateLastSelectedDisplayValue(e){try{console.log("WeighingProxy::updateLastSelectedDisplayValue: "+JSON.stringify(e));let t={currentSelectedDomain:e.show,currentSelectedId:e.id,lastSelectedApplicationId:""};t.currentSelectedDomain===A.SELECTED_DOMAIN_APP?t.lastSelectedApplicationId=e.id:void 0!==this.lastSelectedDisplayValueInfo&&(t.lastSelectedApplicationId=this.lastSelectedDisplayValueInfo.lastSelectedApplicationId),this.lastSelectedDisplayValueInfo=t,console.log("WeighingProxy::updateLastSelectedDisplayValue: new: "+JSON.stringify(this.lastSelectedDisplayValueInfo)),this.selectedDisplayValue$.next(this.lastSelectedDisplayValueInfo)}finally{}}insertWeightInvalidation(e,t){return this.body.method=u.RestMethodsWEIGHING.insertWeightInvalidation,this.body.params={group:e,topic:t},
new n.CubisRestResponse(this.syncRequest())}removeWeightInvalidation(e,t){return this.body.method=u.RestMethodsWEIGHING.removeWeightInvalidation,this.body.params={group:e,topic:t},new n.CubisRestResponse(this.syncRequest())}setAmbientCondition(e){return this.body.method=u.RestMethodsWEIGHING.setAmbientCondition,this.body.params={ambientConditionId:e},new n.CubisRestResponse(this.syncRequest())}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(26),i=a(3),n=a(65),r=a(19),o=a(66),l="_QAPP_MSG_HANDLER_",E="_TITLE",_="_REASON",u="_SOLUTION";var c;function A(e){return e+"_"+s.MESSAGEHANDLER_OK_BTN_ID}!function(e){e.TASKID="TASKID",e.QAPP="QAPP",e.QAPP_DB_ERROR="QAPP_DB_ERROR",e.QAPP_RUNTIME_COMM_ERROR="QAPP_RUNTIME_COMM_ERROR",e.QAPP_RUNTIME_EXIT_ERROR="QAPP_RUNTIME_EXIT_ERROR",e.MANUAL="MANUAL"}(c=t.MESSAGE_HANDLER_SECRET_TYPE||(t.MESSAGE_HANDLER_SECRET_TYPE={})),function(e){e.ERR_702_ACTION_LIMIT="ERR_702",e.ERR_703_ACTION_LIMIT="ERR_703",
e.INFO_USERCAL_CAL_OVERALL_PASSED="INFO_USERCAL_CAL_OVERALL_PASSED",e.INFO_USERCAL_ERROR_NO_INVALIDATION="INFO_USERCAL_ERROR_NO_INVALIDATION",e.ERR_704_UNIT_UNAVAILABLE="ERR_704",e.ERR_710_STARLIMS_WARN_LIMIT="ERR_710",e.INFO_STARLIMS_CAL_OVERALL_PASSED="INFO_STARLIMS_CAL_OVERALL_PASSED",e.ERR_711_STARLIMS_WEIGHING_SERIAL="ERR_711",e.ERR_712_STARLIMS_CAL_SERIAL="ERR_712",e.ERR_713_STARLIMS_WEIGHING_PARAM="ERR_713",e.ERR_714_STARLIMS_CAL_PARAM="ERR_714",e.ERR_715_STARLIMS_ERROR_RESPONSE="ERR_715",e.ERR_716_STARLIMS_NO_CONNECTION="ERR_716",e.ERR_717_STARLIMS_USER_AUTORIZED="ERR_717",e.ERR_718_STARLIMS_NOT_IN_SERVICE="ERR_718",e.ERR_790_GENERIC_DB_ERROR="ERR_790",e.ERR_791_DB_MIGRATION_RUNTIME_ERROR="ERR_791",e.ERR_792_DB_CONN_WORKFLOW_ERROR="ERR_792",e.ERR_793_DB_OPERATION_TIMEOUT_ERROR="ERR_793",e.ERR_794_DB_MIGRATION_UNSUPPORTED_ERROR="ERR_794",e.ERR_795_DB_MIGRATION_FAILED_ERROR="ERR_795",e.ERR_796_DB_CONN_LOST_ERROR="ERR_796",e.ERR_797_DB_CONN_CONFWORKFLOW_ERROR="ERR_797",
e.ERR_798_GENERIC_EXTERNAL_COMM_ERROR="ERR_798",e.ERR_799_GENERIC_INTERNAL_ERROR="ERR_799"}(t.EMsgHandlerMsgs||(t.EMsgHandlerMsgs={})),t.getMessageHandlerOkButtonId=A,t.isMessageHandlerOkButton=function(e){return e.endsWith(s.MESSAGEHANDLER_OK_BTN_ID)};const p={ERR_702:{errorCode:702,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.USER_CAL,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_EXPLICIT_DELETION,secretType:c.MANUAL},ERR_703:{errorCode:703,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.WARNING,category:s.MessageHandlerCategory.USER_CAL,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.MANUAL},INFO_USERCAL_CAL_OVERALL_PASSED:{errorCode:0,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.INFORMATION,category:s.MessageHandlerCategory.USER_CAL,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.MANUAL},INFO_USERCAL_ERROR_NO_INVALIDATION:{errorCode:0,
type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.USER_CAL,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.MANUAL},ERR_704:{errorCode:704,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.TASKID},ERR_710:{errorCode:710,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.WARNING,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.MANUAL},INFO_STARLIMS_CAL_OVERALL_PASSED:{errorCode:0,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.INFORMATION,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.MANUAL},ERR_711:{errorCode:711,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,
lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.MANUAL},ERR_712:{errorCode:712,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.MANUAL},ERR_713:{errorCode:713,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.MANUAL},ERR_714:{errorCode:714,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.MANUAL},ERR_715:{errorCode:715,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.MANUAL},ERR_716:{errorCode:716,
type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.MANUAL},ERR_717:{errorCode:717,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.MANUAL},ERR_718:{errorCode:718,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.MANUAL},ERR_790:{errorCode:790,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.QAPP_DB_ERROR,buttons:[s.createMessageHandlerButton(A(790))]},ERR_791:{errorCode:791,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,
lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.QAPP_DB_ERROR,buttons:[s.createMessageHandlerButton(A(791))]},ERR_792:{errorCode:792,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.QAPP_DB_ERROR,buttons:[s.createMessageHandlerButton(A(792))]},ERR_793:{errorCode:793,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.QAPP_DB_ERROR,buttons:[s.createMessageHandlerButton(A(793))]},ERR_794:{errorCode:794,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.QAPP_DB_ERROR,buttons:[s.createMessageHandlerButton(A(794))]},ERR_795:{errorCode:795,
type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.QAPP_DB_ERROR,buttons:[s.createMessageHandlerButton(A(795))]},ERR_796:{errorCode:796,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.QAPP_DB_ERROR,buttons:[s.createMessageHandlerButton(A(796))]},ERR_797:{errorCode:797,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.QAPP_DB_ERROR,buttons:[s.createMessageHandlerButton(A(797))]},ERR_798:{errorCode:798,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.QAPP_RUNTIME_COMM_ERROR},
ERR_799:{errorCode:799,type:s.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:s.MessageHandlerCategory.QAPP,lifetime:s.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:c.QAPP_RUNTIME_EXIT_ERROR}};t.MessageHandlerHelper=class{constructor(e){this.messageHandlerProxy=e}buildSecret(e){switch(e){case c.TASKID:return r.QAppBase.clientSingleton.getTaskId();case c.QAPP:return r.QAppBase.clientSingleton.getQAppOrderNumber();case c.QAPP_DB_ERROR:return r.QAppBase.clientSingleton.getQAppOrderNumber()+c.QAPP_DB_ERROR;case c.QAPP_RUNTIME_COMM_ERROR:return r.QAppBase.clientSingleton.getQAppOrderNumber()+c.QAPP_RUNTIME_COMM_ERROR;case c.QAPP_RUNTIME_EXIT_ERROR:return r.QAppBase.clientSingleton.getQAppOrderNumber()+c.QAPP_RUNTIME_EXIT_ERROR;case c.MANUAL:default:return}}addMessage(e,t,a,s){console.log(`messageHandlerHelper::addMessage: ${e}`);let c=i.createEmptyTextStructure(),A=i.createEmptyTextStructure(),d=i.createEmptyTextStructure(),T=0
;0===p[e].errorCode?(c.id=l+e+E,A.id=l+e+_,d.id=l+e+u):T=p[e].errorCode;let I=[];for(799!==p[e].errorCode&&798!==p[e].errorCode||I.push(r.QAppBase.clientSingleton.getQAppOrderNumber()),790!==p[e].errorCode&&791!==p[e].errorCode&&792!==p[e].errorCode&&793!==p[e].errorCode&&794!==p[e].errorCode&&795!==p[e].errorCode&&796!==p[e].errorCode&&797!==p[e].errorCode||(I.push(r.QAppBase.clientSingleton.getQAppOrderNumber()),I.push(r.QAppBase.clientSingleton.getQAppVersion())),void 0!==t&&("string"==typeof t?(I.push("Error"),I.push(t)):n.isError(t)?o.isHttpRestError(t)?(I.push(`${t.name} (HTTP(s)/${t.statusCode})`),I.push(t.message)):(I.push(t.name),I.push(t.message)):I.push(...t));I.length<4;)I.push("");A.args=I;let h=this.buildSecret(p[e].secretType);return void 0!==h&&(a=h),console.log(`messageHandlerHelper::addMessage: add msg handler msg ${T} with secret ${a}`),
this.messageHandlerProxy.addMessage(T,p[e].type,p[e].category,p[e].lifetime,c,A,d,a||"",s||(p[e].buttons?p[e].buttons:void 0),p[e].showMessageInFutureSeconds?p[e].showMessageInFutureSeconds:void 0)}}},function(e,t){e.exports=require("path")},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(0),i=a(4);t.AbstractOverlay=class extends i.AbstractScreen{show(){this.publishContent("",'{ "appearance":"'+s.EnumAppearance.ENABLED+'" }'),this.events$.next({type:i.ScreenEventType.SHOW_OVERLAY,id:this.getId()})}hide(){this.publishContent("",'{ "appearance":"'+s.EnumAppearance.HIDDEN+'" }'),this.events$.next({type:i.ScreenEventType.HIDE_OVERLAY,id:this.getId()})}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(0),i=a(3),n=a(99);t.TAB_MQTT_SCREENS_STRING="SCREENS/",t.TAB_MQTT_TABS_STRING="/TABS/",t.TAB_MQTT_TAB_STRING="/TAB";t.TabBase=class{constructor(e,t,a=!1){this.tabData=void 0,this.screenId="",
this.publishPending=!1,this.lastPublishedTabContent="",this.mqttHandler=e,this.screenId=t,this.singleTab=a}setTabData(e,t=!0){this.tabData=e,t&&this.publishIfEnabled()}publishIfEnabled(){this.publishPending=!1,void 0!==this.tabData&&this.tabData.appearance===s.EnumAppearance.ENABLED&&this.publish()}getTabId(){return void 0!==this.tabData?this.tabData.id:""}setTabContainerTitle(e,t=!0){void 0!==this.tabData&&(this.tabData.containerTitle=e,t&&this.publishIfEnabled())}getTabContainerTitle(){return void 0!==this.tabData?this.tabData.containerTitle:i.createEmptyTextStructure()}setTabTitle(e,t=!0){void 0!==this.tabData&&(this.tabData.title=e,t&&this.publishIfEnabled())}getTabContainerIcon(){return void 0!==this.tabData&&this.tabData.topIcon||""}setTabContainerIcon(e,t=!0){void 0!==this.tabData&&(this.tabData.topIcon=e,t&&this.publishIfEnabled())}getTabTitle(){return void 0!==this.tabData?this.tabData.title:i.createEmptyTextStructure()}clearTabTopButtons(e=!0){
void 0!==this.tabData&&(this.tabData.topbuttons.splice(0,this.tabData.topbuttons.length),e&&this.publishIfEnabled())}getButton(e){}getTabTopButtons(){return void 0!==this.tabData?this.tabData.topbuttons:[]}publishId(){return this.singleTab?t.TAB_MQTT_SCREENS_STRING+this.screenId+t.TAB_MQTT_TAB_STRING:void 0!==this.tabData?t.TAB_MQTT_SCREENS_STRING+this.screenId+t.TAB_MQTT_TABS_STRING+this.tabData.id:""}publish(){if(void 0!==this.tabData){let e=JSON.stringify(this.tabData,n.functionReplacer);e!==this.lastPublishedTabContent&&(this.lastPublishedTabContent=e,this.mqttHandler.publish(this.publishId(),this.lastPublishedTabContent))}}setAppearance(e,t=!0){void 0!==this.tabData&&(this.tabData.appearance=e,t&&this.publish())}getId(){return this.screenId}hide(){this.setAppearance(s.EnumAppearance.HIDDEN)}show(){this.setAppearance(s.EnumAppearance.ENABLED)}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let s=a(58)
;t.STATE_UNINITIALIZED_INTERNAL="STATE_UNINITIALIZED_INTERNAL",t.createFsm=function(e){return new s.BehavioralFsm({namespace:"_qappStm_",states:{STATE_UNINITIALIZED_INTERNAL:{_onEnter:function(e){console.log("FSM: enter STATE_UNINITIALIZED_INTERNAL state")},_onExit:function(e){console.log("FSM: exit STATE_UNINITIALIZED_INTERNAL state")},_transTo:{},_transFom:{},_START_FSM_:function(e,t){this.transition(e,t)},"*":function(e){this.deferUntilTransition(e)}}},initialize:function(t){Object.assign(t.states,t.states,e)},initialState:t.STATE_UNINITIALIZED_INTERNAL,myHandler:function(e,t,a){let s;t.some(function(t){return s=t.nextState,t.guardFn(e,a)})&&s&&this.transition(e,s)}})}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(0),i=a(32),n=a(2),r=a(47);class o{constructor(e){this.task=e||void 0}splitParamId(e){let t=e.split("/");return t.length>1&&(t[0]=`${t[0]}/${t[1]}`,t.splice(1,1)),t}setTask(e){this.task=e}getTaskGroupsAndParameters(){
return this.task?this.task.params:[]}getTask(){return this.task}updateGroup(e){if(!this.task)return!1;return!!this.task.params.some((t,a)=>!!this.task&&(t.id===e.id&&(this.task.params[a]=e,!0)))&&(console.log(`Group ${e.id} updated!`),!0)}updateParameter(e){let t=this.splitParamId(e.id)[0];return!!this.task&&(!!this.task.params.some((a,s)=>{if(a.id===t)return a.parameters.some((t,a)=>!(t.id!==e.id||!this.task)&&(this.task.params[s].parameters[a]=e,!0))})&&(console.log(`Parameter ${e.id} updated!`),!0))}getGroup(e){let t;if(this.task)return(t=this.task.params.find(t=>t.id===e))||void console.log(`Group ${e} not found!`)}getParameter(e){let t,a=this.splitParamId(e)[0];if(this.task)return this.task.params.find(s=>s.id===a&&(t=s.parameters.find(t=>t.id===e),!0)),t||void console.log(`Parameter ${e} not found!`)}addDynamicGroup(e){if(!this.task)return!1;if(!e.id.startsWith(r.DYNAMIC_PARAMID_PREQUEL))return console.log(`GroupId does not start with '${r.DYNAMIC_PARAMID_PREQUEL}'`),!1
;if(e.id.includes("/",r.DYNAMIC_PARAMID_PREQUEL.length))return console.log('No additional "/" allowed in the name of a dynamic group!',e.id),!1;if(this.task.params.some(t=>t.id===e.id))return console.log("The DynamicGroup already exists!",e.id),!1;e.parameters.forEach(t=>{t.id.startsWith(e.id)||(console.log(`parameterId starts with parameterName only. Extend parameterId with own groupId '${e.id}'.`),t.id=e.id+"/"+t.id)});let t=!1;for(let a=0;a<this.task.params.length;a++)if(this.task.params[a].id.startsWith(i.TASK_DYNAMIC_ID_GROUPS_PREFIX)||!this.task.params[a].id.startsWith(r.DYNAMIC_PARAMID_PREQUEL)){this.task.params.splice(a,0,e),t=!0;break}return t||this.task.params.push(e),!0}addDynamicParameter(e){let t="";if(this.getParameter(e.id))return this.updateParameter(e),!0;{t=this.splitParamId(e.id)[0];let a=this.getGroup(t);if(a)return a.parameters.push(e),!0}return!1}addDynamicParameterToFront(e){let t="";if(this.getParameter(e.id))return this.updateParameter(e),!0;{
t=this.splitParamId(e.id)[0];let a=this.getGroup(t);if(a)return a.parameters.unshift(e),!0}return!1}addDynamicParameterInFrontOf(e,t){let a=this.splitParamId(e.id)[0],s=this.splitParamId(t)[0];if(a===s){let s=this.getGroup(a);if(void 0!==s){let a=s.parameters.findIndex(e=>e.id===t);if(-1!==a)return s.parameters.splice(a,0,e),!0}}return console.log("addDynamicParameterInFrontOf - groups of new and existing parameter do not match: "+a+" vs. "+s),!1}static sortGroup(e){let t=e.parameters.map(function(e,t){return{idx:t,data:e}});t.sort((e,t)=>{if((void 0===e.data.fixed||!0===e.data.fixed)>(void 0===t.data.fixed||!0===t.data.fixed))return 1;if((void 0===e.data.fixed||!0===e.data.fixed)<(void 0===t.data.fixed||!0===t.data.fixed))return-1;if(!(void 0!==e.data.fixed&&!0!==e.data.fixed||void 0!==t.data.fixed&&!0!==t.data.fixed)){
if((e.data.appearance===s.EnumAppearance.ENABLED||e.data.appearance===s.EnumAppearance.ENABLED_INVALID_CFG)<(t.data.appearance===s.EnumAppearance.ENABLED||t.data.appearance===s.EnumAppearance.ENABLED_INVALID_CFG))return 1;if((e.data.appearance===s.EnumAppearance.ENABLED||e.data.appearance===s.EnumAppearance.ENABLED_INVALID_CFG)>(t.data.appearance===s.EnumAppearance.ENABLED||t.data.appearance===s.EnumAppearance.ENABLED_INVALID_CFG))return-1}return e.idx-t.idx}),e.parameters=t.map(function(e){return e.data})}getFilteredTask(){let e,t;return this.task&&((t=(e=n.cloneJSON(this.task)).params.filter(e=>e.id.startsWith(r.DYNAMIC_PARAMID_PREQUEL))).forEach(e=>{e.id.startsWith(i.TASK_DYNAMIC_ID_GROUPS_PREFIX)?e.parameters.forEach((e,t)=>{e.appearance=s.EnumAppearance.HIDDEN}):(e.parameters.forEach((e,t)=>{void 0!==e.fixed&&!0!==e.fixed||e.appearance===s.EnumAppearance.HIDDEN||(e.appearance=s.EnumAppearance.DISABLED)}),o.sortGroup(e),e.parameters.forEach((e,t)=>{void 0!==e.fixed&&delete e.fixed
}))}),e.params=t),e}}t.TaskHandler=o},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(68),i=a(39),n=a(2),r=a(5),o=a(22),l=a(0),E=a(38),_=a(69),u=a(37),c=a(6),A=a(25);function p(e){return o.isNumber(e)&&(e=e.toFixed(0)),t.DYNAMIC_PARAMID_PREQUEL+"CONFIG_SCREEN"+e}function d(e,t){o.isString(t)||(t="_"),t=t,!1!==o.isString(e)&&0!==e.length||(e=t);let a=new RegExp(/[^0-9A-Za-z._-]+/g),s=new RegExp(/[\/\?<>\\:\*\|"]/g),i=new RegExp(/[\x00-\x1f\x80-\x9f]/g),n=new RegExp(/^\.+$/),r=new RegExp(/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i),l=new RegExp(/[\. ]+$/);return(e=(e=(e=(e=(e=(e=e.replace(a,t)).replace(s,t)).replace(i,t)).replace(n,t)).replace(r,t)).replace(l,t)).length>255&&(e=e.substring(0,255)),e}function T(e){if(t.fs.existsSync(e))if(t.fs.lstatSync(e).isDirectory()){let s=t.fs.readdirSync(e,{encoding:"utf8",withFileTypes:!1});for(var a=0;a<s.length;a++)T(t.path.join(e,s[a]));t.fs.rmdirSync(e)}else t.fs.unlinkSync(e)}var I;function h(e){
let t={title:"",header:"",value:"",automaticManipulation:I.NONE};return o.isObject(e)&&(t=Object.assign(t,e)),t}function N(e,t,a){let s={method:t,params:a},i=JSON.stringify(s),n=["http://127.0.0.1:8080/rest/"+e,"-H","Accept:application/json","-H","Content-Type:application/json","-H","Expect:","--data","@-"],o=E.spawnSync("curl",n,{input:i}),l=new r.CubisRestResponse(!1);try{l=new r.CubisRestResponse(o)}catch(e){l.rawReturns=e}return l}function m(e,t,a){return s.__awaiter(this,void 0,void 0,function*(){let s=u;return"https"===e&&(s=_),new Promise(function(e,i){let n=s.request(t,function(t){let a=[];t.on("data",function(e){a.push(e)}),t.on("end",function(){try{e({headers:t.headers,url:t.url,statusCode:t.statusCode,body:Buffer.concat(a)})}catch(e){i(e)}})});n.on("error",function(e){i(e)}),n.on("timeout",function(){n.abort(),i("Request timeout")}),a&&n.write(a),n.end()})})}function S(e){let t={unit:A.EnumUnit.NONE,decimals:0,d:0,e:0,max:0,min:0,extended:{d:A.createQuantity(),
e:A.createQuantity(),max:A.createQuantity(),min:A.createQuantity()},ranges:{1:{d:A.createQuantity(),e:A.createQuantity(),max:A.createQuantity(),min:A.createQuantity()}},activeRangeIndex:"1"};return o.isObject(e)&&o.overwriteExistingAttributes(e,t),t}t.fs=a(18),t.path=a(42),t.DYNAMIC_PARAMID_PREQUEL="TASK/DYNAMIC_",t.sortKeys=function(e){if(!1===o.isObject(e))return[];let t=[];t=Array.isArray(e)?e:Object.keys(e);let a=[],s=[],i=[];for(let e=0;e<t.length;e++)o.isNumber(Number(t[e]))?a.push(t[e]):o.isString(t[e])?s.push(t[e]):i.push(t[e]);return s=s.sort(),i=i.sort(),(a=(a=a.sort(function(e,t){return Number(e)-Number(t)})).concat(s)).concat(i)},t.determineNearestNumberInArray=function(e,t){for(let a=0;a<t.length;a++)if(e<t[a])return a<=0?a:e<=t[a]-(t[a]-t[a-1])/2?a-1:a;return t.length-1},t.loadWorkstate_DATA_CONTAINER=function(e){let t=void 0;if(!o.isString(e))return t;let a=N("task/management",c.RestMethodsTASK_MANAGEMENT.getWorkstate,{id:e,workstate:{}});try{
t=(t=JSON.parse(a.rawReturns.workstate).workstate).DATA_CONTAINER}catch(e){t=void 0}return t},t.storeWorkstate_DATA_CONTAINER=function(e,t){if(!o.isString(e))return new r.CubisRestResponse(!1);let a={DATA_CONTAINER:t};return N("task/management",c.RestMethodsTASK_MANAGEMENT.saveWorkstate,{id:e,workstate:a})},t.loadTaskConfig_DATA_CONTAINER=function(e){let a=e.getGroup(p(54321));if(void 0===a)return;let s=[],i=p(54321)+"/"+t.DYNAMIC_PARAMID_PREQUEL+"DATA_CONTAINER_";for(let e=0;e<a.parameters.length;e++)if(a.parameters[e].type===l.EnumParameterTypes.PARAM_STRING&&a.parameters[e].id.startsWith(i)){let t=parseInt(a.parameters[e].id.substring(i.length));o.isNumber(t)&&(s[t]=a.parameters[e].value.string)}try{return JSON.parse(s.join())}catch(e){return}},t.storeTaskConfig_DATA_CONTAINER=function(e,a,s){let i=e.getGroup(p(54321));if(s=!!o.isBoolean(s)&&s,void 0===i&&(e.addDynamicGroup({id:p(54321),type:l.EnumParameterTypes.PARAM_GROUP,appearance:l.EnumAppearance.HIDDEN,title:{id:"",args:[]},
parameters:[]}),i=e.getGroup(p(54321))),void 0===i)return new r.CubisRestResponse(!1);i.parameters=[];let n=JSON.stringify(a),E=0,_=0;for(;E<n.length;){(_=E+1e5)>n.length&&(_=n.length);let a={id:p(54321)+"/"+t.DYNAMIC_PARAMID_PREQUEL+"DATA_CONTAINER_"+i.parameters.length.toFixed(0),type:l.EnumParameterTypes.PARAM_STRING,appearance:l.EnumAppearance.HIDDEN,title:{id:"",args:[]},header:{id:"",args:[]},value:{string:n.substring(E,_)},info:{minimum:{length:0},maximum:{length:1e5}}};E=_,i.parameters.push(a),e.updateParameter(a)}return!1===s?N("task/management",c.RestMethodsTASK_MANAGEMENT.updateTask,{task:JSON.stringify(e.getTask()),errorList:[]}):new r.CubisRestResponse(!0)},t.get_taskConfig_paramGroupID=p,t.getCompliantFilename=d,t.checkFileNameCompliancy=function(e,t){if(d(e)!==e)return!1;t=void 0!==t?t:[];for(let a=0;a<t.length;a++)if(e.includes(t[a]))return!1;return!0},t.getCreateTaskSpecificFolder=function(e,a){
let s="",n=e.getTask(),r=e.getParameter("TASK/IDENTIFICATION/NAME"),o=t.fs.readdirSync(a,{encoding:"utf8",withFileTypes:!1}),l=new i.TaskProxy,E=[];try{E=l.getTaskNamesByOrderNumber(n.qappOrderNumber)}catch(e){}for(var _=0;_<o.length;_++)if(o[_].toString().startsWith("_RENAME_TASK_ID_")&&o[_].toString().endsWith(".json")){var u=t.fs.readFileSync(t.path.join(a,o[_]),"utf8");(c=JSON.parse(u))&&c.taskname&&c.foldername&&!E.includes(c.taskname)&&(T(t.path.join(a,c.foldername)),T(t.path.join(a,o[_])))}else if(o[_].toString().startsWith("_TASK_"))try{l.readTask(o[_].toString().substring("_TASK_".length))}catch(e){T(t.path.join(a,o[_]))}if(null==n._id||""==n._id){let e=Date.now(),i={taskname:r.value.string,foldername:"_RENAME_TASK_ID_"+e};t.fs.writeFileSync(t.path.join(a,"_RENAME_TASK_ID_"+e+".json"),JSON.stringify(i)),s=t.path.join(a,"_RENAME_TASK_ID_"+e)}else for(s=t.path.join(a,"_TASK_"+n._id),
_=0;_<o.length;_++)if(o[_].toString().startsWith("_RENAME_TASK_ID_")&&o[_].toString().endsWith(".json")){var c;u=t.fs.readFileSync(t.path.join(a,o[_]),"utf8"),(c=JSON.parse(u))&&c.taskname&&c.foldername&&c.taskname==r.value.string&&(t.fs.existsSync(t.path.join(a,c.foldername))?t.fs.existsSync(s)?(T(t.path.join(a,c.foldername)),T(t.path.join(a,o[_]))):(t.fs.renameSync(t.path.join(a,c.foldername),s),T(t.path.join(a,o[_]))):T(t.path.join(a,o[_])))}return t.fs.existsSync(s)||t.fs.mkdirSync(s),s},t.deleteFileFolderRecursive=T,t.createFolder=function(e){t.fs.existsSync(e)||t.fs.mkdirSync(e)},function(e){e.NONE="NONE",e.INCREMENT="INCREMENT",e.DECREMENT="DECREMENT"}(I=t.EnumIdentifierAutoManipulation||(t.EnumIdentifierAutoManipulation={})),t.EnumMapIdentifierAutoManipulation={[I.NONE]:"_QAPP_LIB_PARAM_SELECT_OPTION_SID_ON",[I.INCREMENT]:"_QAPP_LIB_PARAM_SELECT_OPTION_SID_ON_AUTO_INC",[I.DECREMENT]:"_QAPP_LIB_PARAM_SELECT_OPTION_SID_ON_AUTO_DEC"},t.getLotIDsParameterID=function(e){
o.isNumber(e)||(e=1),e=e;const a=p("_RESERVED_LOT_ID_SETTINGS");return{paramGroupID:a,settingsLockedInfo:a+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_LOT_ID_settingsLocked",mainCounter:a+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_LOT_ID_counter",header:a+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_LOT_ID_"+e.toFixed(0)+"_header",title:a+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_LOT_ID_"+e.toFixed(0)+"_title"}},t.getSampleIDsParameterID=function(e){o.isNumber(e)||(e=1),e=e;const a=p("_RESERVED_SAMPLE_ID_SETTINGS");return{paramGroupID:a,settingsLockedInfo:a+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_SAMPLE_ID_settingsLocked",mainCounter:a+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_SAMPLE_ID_counter",header:a+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_SAMPLE_ID_"+e.toFixed(0)+"_header",title:a+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_SAMPLE_ID_"+e.toFixed(0)+"_title",manipulator:a+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_SAMPLE_ID_"+e.toFixed(0)+"_manipulator"}},t.createStandardIdentifier=h,
t.preManipulateIdentifier=function(e){let t=h();void 0!==e&&(t=n.cloneJSON(e));let a=void 0,s=0;const i=/\d*$/,r=t.value.match(i);switch(null!=r&&r.length>0&&o.isString(r[0])&&(s=r[0].length,a=parseInt(r[0])),t.automaticManipulation){case I.INCREMENT:""===t.value?t.value="001":""===t.value||o.isNumber(a)?""!==t.value&&o.isNumber(a)&&(a++,t.value=t.value.replace(i,a.toFixed(0).padStart(s,"0"))):t.value+="-2";break;case I.DECREMENT:""!==t.value&&o.isNumber(a)&&a>0&&(a--,t.value=t.value.replace(i,a.toFixed(0).padStart(s,"0")))}return t},t.perform_InternalWebserviceRequest=N,t.perform_WebserviceRequest=function(e,t,a,i,n,r,l,E,c,A,p){return s.__awaiter(this,void 0,void 0,function*(){o.isNumber(t)||(t="http"===a?80:443),o.isNumber(p)||(p=1e4);let s,d={hostname:e,port:t,path:n,method:i,followRedirects:!1,headers:r,timeout:p};c&&A&&(d.auth=c+":"+A),d.agent="https"===a?new _.Agent({host:e,keepAlive:!0,rejectUnauthorized:!1,port:t}):new u.Agent({keepAlive:!0}),
l&&void 0!==l&&(E=JSON.stringify(l)),E&&(d.headers["content-length"]=Buffer.byteLength(E));try{s=yield m(a,d,E).then(e=>({isSuccess:!0,error:"",statusCode:e.statusCode,headers:e.headers,body:e.body,url:e.url,metadata:n}))}catch(e){return{isSuccess:!1,error:e,statusCode:0,headers:{},body:void 0,url:d.hostname+d.path,metadata:n}}return s})},t.httpRequest=m,t.getConfiguredPrintProfiles=function(){let e=[];const t=N("profilemanagement",c.RestMethodsPROFILE_MANAGEMENT.getProfiles,{filter:'[{"type":{"ne":"WEIGHING_PROFILE_NAME"}}]',rProfiles:{}});if(t.isSuccess()&&o.isString(t.rawReturns.rProfiles)){const a=JSON.parse(t.rawReturns.rProfiles.toString());for(let t=0;t<a.data.length;t++){const s=o.getObjectByID(a.data[t].params,"PROFILE/IDENTIFICATION","id");if(o.isObject(s)&&o.isObject(s.parameters)){const i=o.getObjectByID(s.parameters,"PROFILE/IDENTIFICATION/NAME","id");o.isObject(i)&&o.isObject(i.value)&&e.push({id:a.data[t]._id,type:a.data[t].type,title:i.value.string})}}}return e},
t.createMetrology=S,t.getMetrology=function(e){let t=S(),a=N("weighing",c.RestMethodsWEIGHING.getParameter,{id:"WEIGHING/METROLOGY/RANGE",rObject:{}}),s="";if(a.isSuccess()&&a.hasOwnProperty("rawReturns")&&a.rawReturns.hasOwnProperty("rObject")&&(a=JSON.parse(a.rawReturns.rObject))&&a.hasOwnProperty("id")&&a.hasOwnProperty("parameters")){let e=o.getObjectByID(a.parameters,"WEIGHING/METROLOGY/RANGE/MAXIMUM");e&&(s=e.value.numbers[0])}const i=N("weighing",c.RestMethodsWEIGHING.getRangeParameters,{parameters:{}});if(!(i.isSuccess()&&i.hasOwnProperty("rawReturns")&&i.rawReturns.hasOwnProperty("parameters")))return t;const n=JSON.parse(i.rawReturns.parameters);if(!(n.hasOwnProperty("list")&&Array.isArray(n.list)&&n.list.length>0))return t;const r=o.getObjectByID(n.list,"WEIGHING/METROLOGY/RANGES");if(!o.isObject(r))return t;t.ranges={};for(let a of Object.values(r.parameters)){if(!o.isString(a.id)||!o.isObject(a.parameters))continue;let i="";const n=a.id.split("/")
;if(0===(i=n[n.length-1]).length)continue;const r={d:A.createQuantity(),e:A.createQuantity(),max:A.createQuantity(),min:A.createQuantity()};let l=o.getObjectByID(a.parameters,"WEIGHING/METROLOGY/RANGES/"+i+"/INTERVAL");l&&(r.d.value=parseFloat(l.value.numbers[0]),r.d.decimals=l.value.decimals,r.d.unit=A.getUnitEnum(l.value.unit.toString())),(l=o.getObjectByID(a.parameters,"WEIGHING/METROLOGY/RANGES/"+i+"/PRECISION"))&&(r.e.value=parseFloat(l.value.numbers[0]),r.e.decimals=l.value.decimals,r.e.unit=A.getUnitEnum(l.value.unit.toString())),(l=o.getObjectByID(a.parameters,"WEIGHING/METROLOGY/RANGES/"+i+"/MINIMUM"))&&(r.min.value=parseFloat(l.value.numbers[0]),r.min.decimals=l.value.decimals,r.min.unit=A.getUnitEnum(l.value.unit.toString())),(l=o.getObjectByID(a.parameters,"WEIGHING/METROLOGY/RANGES/"+i+"/MAXIMUM"))&&(r.max.value=parseFloat(l.value.numbers[0]),r.max.decimals=l.value.decimals,r.max.unit=A.getUnitEnum(l.value.unit.toString()),s===l.value.numbers[0]&&(t.activeRangeIndex=i)),
void 0===e&&(e=r.d.unit),r.d=A.convertToTargetUnit(r.d,e),r.e=A.convertToTargetUnit(r.e,e),r.e.decimals=r.d.decimals,r.min=A.convertToTargetUnit(r.min,e),r.min.decimals=r.d.decimals,r.max=A.convertToTargetUnit(r.max,e),r.max.decimals=r.d.decimals,t.ranges[i]=r}t.extended.d.value=1/0,t.extended.e.value=1/0,t.extended.min.value=1/0,t.extended.max.value=-1/0;for(let e of Object.values(t.ranges))e.d.value<t.extended.d.value&&(t.extended.d=e.d),e.e.value<t.extended.e.value&&(t.extended.e=e.e),e.min.value<t.extended.min.value&&(t.extended.min=e.min),e.max.value>t.extended.max.value&&(t.extended.max=e.max);return t.unit=t.extended.d.unit,t.decimals=t.extended.d.decimals,t.d=t.extended.d.value,t.e=t.extended.e.value,t.min=t.extended.min.value,t.max=t.extended.max.value,t},t.get_device_roles=function(){let e=N("user",c.RestMethodsUSER_MANAGEMENT.getListRoles,{list:{},start:0,end:-1}),t=[];try{let a=JSON.parse(e.rawReturns.list).data;for(let e=0;e<a.length;e++)t.push({id:a[e]._id,
name:o.getObjectByID(a[e].params,"ROLE/NAME").value.string,editable:a[e].editable,locked:a[e].locked})}catch(e){}return t},t.get_device_user=function(){let e={id:"",name:"",display_name:"",description:"",role_id:"",role_name:""},t=N("access",c.RestMethodsACCESS_MANAGEMENT.getCurrentUser,{user:""});try{let a=JSON.parse(t.rawReturns.user);e.id=a._id;let s=o.getObjectByID(a.params,"USER/SETTINGS");e.name=o.getObjectByID(s.parameters,"USER/SETTINGS/LOGINNAME").value.string,e.display_name=o.getObjectByID(s.parameters,"USER/SETTINGS/NAME").value.string,e.description=o.getObjectByID(s.parameters,"USER/SETTINGS/DESCRIPTION").value.string,e.role_id=o.getObjectByID(s.parameters,"USER/SETTINGS/ROLES").value.selection.id,e.role_name=o.getObjectByID(s.parameters,"USER/SETTINGS/ROLES").value.selection.text.id}catch(e){}return e},t.EnumMapUnit=null,t.harmonizeWeightParam=function(e){},t.tryAssign_taskParameter_to_IQuantity=function(e,t,a){},t.tryAssign_IQuantity_to_taskParameter=function(e,t,a){}
},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(10),i=a(49),n=a(0),r=a(4),o=a(20),l=a(1);t.WEIGHING_SCREEN_ID="WEIGHING",t.CANCEL_BARBUTTON_ID="BTN_BAR_CANCEL";const E={buttonId:"BARBUTTON/CANCEL",label:{id:"",args:[]},appearance:n.EnumAppearance.HIDDEN};t.WeighingScreen=class extends r.AbstractScreen{constructor(e,t){super(e),this.buttonList=[],this.text1={value:"",wildcards:[]},this.text2={value:"",wildcards:[]},this.param1="",this.param2="",this.title=void 0,this.createBarButtons(t),this.publishBarButtons(),this.checkBarGraph=new i.CheckBarGraph(e),this.cancelBarButton=new s.default(this.mqttHandler,this,E)}getId(){return t.WEIGHING_SCREEN_ID}getBarButtonId(){return l.MqttTopics.HMI_WEIGHING_SCREEN_BARBUTTONS}createBarButtons(e){e.sort(this.compareButtonBarButtons);for(let t of e){let e=new s.default(this.mqttHandler,this,t);this.buttonList.push(e),e.publish()}}publishBarButtons(){let e=[]
;for(let t of this.buttonList)e.push(l.MqttTopics.QAPP_NAMESPACE+"/"+t.getTopic());this.mqttHandler.publish(this.getBarButtonId(),JSON.stringify(e))}setText1(e,t){let a=!1;this.text1.value!==e&&(this.text1.value=e,a=!0),t&&this.text1.wildcards.join()!==t.join()&&(this.text1.wildcards=t,a=!0),a&&this.publishText1()}compareButtonBarButtons(e,t){return o.getButtonPriority(e.buttonId)-o.getButtonPriority(t.buttonId)}publishText1(){this.mqttHandler.publish(l.MqttTopics.HMI_WEIGHING_SCREEN_INSTRUCTION1,JSON.stringify(this.text1),{retain:!0})}publishText2(){this.mqttHandler.publish(l.MqttTopics.HMI_WEIGHING_SCREEN_INSTRUCTION2,JSON.stringify(this.text2),{retain:!0})}setText2(e,t){let a=!1;this.text2.value!==e&&(this.text2.value=e,a=!0),t&&this.text2.wildcards.join()!==t.join()&&(this.text2.wildcards=t,a=!0),a&&this.publishText2()}publishTitle(){this.title?this.mqttHandler.publish(l.MqttTopics.HMI_WEIGHING_SCREEN_TITLE,JSON.stringify(this.title),{retain:!0
}):this.mqttHandler.publish(l.MqttTopics.HMI_WEIGHING_SCREEN_TITLE,"",{retain:!0})}setTitle(e){let t=void 0;this.title&&(t=JSON.stringify(this.title)),this.title=e,this.title!==t&&this.publishTitle()}getText1(){return this.text1}getText2(){return this.text2}publishParam1(){this.mqttHandler.publish(l.MqttTopics.HMI_WEIGHING_SCREEN_PARAM1_TOPIC,JSON.stringify(this.param1),{retain:!0})}publishParam2(){this.mqttHandler.publish(l.MqttTopics.HMI_WEIGHING_SCREEN_PARAM2_TOPIC,JSON.stringify(this.param2),{retain:!0})}setParam1(e){this.param1!==e&&(this.param1=e,this.publishParam1())}setParam2(e){this.param2!==e&&(this.param2=e,this.publishParam2())}getParam1(){return this.param1}getParam2(){return this.param2}getButton(e){if(e===t.CANCEL_BARBUTTON_ID)return this.cancelBarButton;for(let t of this.buttonList)if(t.getButtonId()===e)return t}show(){this.publishText1(),this.publishText2(),this.publishTitle(),this.publishParam1(),this.publishParam2();for(let e of this.buttonList)e.publish()
;super.show()}getCheckBarGraph(){return this.checkBarGraph}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(0),i=a(50),n=a(1),r=1;t.CheckBarGraph=class{constructor(e){this.barGraphStatusObject={appearance:s.EnumAppearance.HIDDEN,areas:i.EnumAreaCount.FOUR_AREAS},this.barGraphValueObject={area:1,perc:0},this.mqttHandler=e}publishValue(){this.mqttHandler.publish(n.MqttTopics.HMI_CHECKBARGRAPH_VALUE,JSON.stringify(this.barGraphValueObject))}publishStatus(){this.mqttHandler.publish(n.MqttTopics.HMI_CHECKBARGRAPH_STATUS,JSON.stringify(this.barGraphStatusObject))}setAppearance(e,t=!0){this.barGraphStatusObject.appearance!==e&&(e!==s.EnumAppearance.ENABLED&&e!==s.EnumAppearance.HIDDEN||(this.barGraphStatusObject.appearance=e,t&&(this.publishStatus(),this.publishValue())))}getAppearance(){return this.barGraphStatusObject.appearance}setAreas(e,t=!0){
this.barGraphStatusObject.areas!==e&&(e!==i.EnumAreaCount.FOUR_AREAS&&e!==i.EnumAreaCount.SIX_AREAS||(this.barGraphStatusObject.areas=e,t&&this.publishStatus()))}getAreas(){return this.barGraphStatusObject.areas}setAreaPerc(e,t=!0){this.barGraphValueObject.area===e.area&&this.barGraphValueObject.perc===e.perc||e.area>=r&&e.area<=(this.barGraphStatusObject.areas===i.EnumAreaCount.FOUR_AREAS?4:6)&&(this.barGraphValueObject=e,t&&this.publishValue())}calc4AreaPerc(e,t,a,s,i,n=!0){let r=1,o=0;return e>0&&(0<e&&e<t?(r=1,o=e/t*100):t<=e&&e<=i?(r=2,o=(e-t)/(i-t)*100):i<e&&e<=a?(r=3,o=(e-i)/(a-i)*100):a<e&&e<=s&&(r=4,o=(e-a)/(s-a)*100)),n&&this.setAreaPerc({area:r,perc:o}),{area:r,perc:o}}calc6AreaPerc(e,t,a,s,i,n,r,o=!0){let l=1,E=0;return e>0&&(0<e&&e<t?(l=1,E=e/t*100):t<=e&&e<a?(l=2,E=(e-t)/(a-t)*100):a<=e&&e<=r?(l=3,E=(e-a)/(r-a)*100):r<e&&e<=s?(l=4,E=(e-r)/(s-r)*100):s<e&&e<=i?(l=5,E=(e-s)/(i-s)*100):i<e&&e<=n&&(l=6,E=(e-i)/(n-i)*100)),this.setAreaPerc({area:l,perc:E},o),{area:l,perc:E}}}
},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.FOUR_AREAS="4",e.SIX_AREAS="6"}(t.EnumAreaCount||(t.EnumAreaCount={}))},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTime=function(){return Math.trunc(Date.now()/1e3)}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(2),i=a(0);var n;!function(e){e.TAB_PARAMLIST="PARAMLIST",e.TAB_FIGURE="FIGURE",e.TAB_GRAPH="GRAPH",e.TAB_MENU="MENU",e.TAB_TABLE="TABLE",e.TAB_BASE=""}(n=t.EnumTabType||(t.EnumTabType={})),t.TAB_PARAMLIST_TYPE_TOPIC="topics",t.TAB_PARAMLIST_TYPE_BULK="bulk",t.isITabParamList=function(e){return e.paramType===t.TAB_PARAMLIST_TYPE_TOPIC||void 0===e.paramType},t.isITabBulkParamList=function(e){return e.paramType===t.TAB_PARAMLIST_TYPE_BULK};const r={id:"",appearance:i.EnumAppearance.HIDDEN,type:n.TAB_FIGURE,containerTitle:{id:"",args:[]},topIcon:"",title:{id:"",args:[]},topbuttons:[],imgref:{}}
;t.createEmptyITabFigure=function(){return s.cloneJSON(r)};const o={id:"",appearance:i.EnumAppearance.HIDDEN,type:n.TAB_PARAMLIST,displayHeader:!0,containerTitle:{id:"",args:[]},topIcon:"",title:{id:"",args:[]},topbuttons:[],params:[],paramType:t.TAB_PARAMLIST_TYPE_TOPIC};t.createEmptyITabGraph=function(){return E};const l={};t.createEmptyIGraphInterface=function(){return s.cloneJSON(l)},t.createEmptyITabParamList=function(){return s.cloneJSON(o)};const E={id:"",appearance:i.EnumAppearance.HIDDEN,type:n.TAB_GRAPH,containerTitle:{id:"",args:[]},topIcon:"",title:{id:"",args:[]},topbuttons:[],data:{}};t.TAB_MENU_TYPE_TOPIC="topics",t.TAB_MENU_TYPE_BULK="bulk",t.isITabMenu=function(e){return e.menuType===t.TAB_MENU_TYPE_TOPIC},t.isITabBulkMenu=function(e){return e.menuType===t.TAB_MENU_TYPE_BULK};const _={id:"",appearance:i.EnumAppearance.HIDDEN,type:n.TAB_MENU,containerTitle:{id:"",args:[]},topIcon:"",title:{id:"",args:[]},topbuttons:[],menuType:t.TAB_MENU_TYPE_TOPIC,menubuttons:[],
scrollToTop:!1};t.createEmptyITabMenu=function(){return s.cloneJSON(_)},t.isITabTable=function(e){return e.tableType===t.TAB_MENU_TYPE_TOPIC},t.isITabBulkTable=function(e){return e.tableType===t.TAB_MENU_TYPE_BULK}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(0),i=a(54),n=a(34),r=a(15),o=a(13),l=a(24),E=a(34),_=a(23),u=a(35);t.CFG_PARAMS_ASPECT="CFG_PARAMS_ASPECT",t.STATE_ASPECT_CFG_PARAM_EDIT_ENTER="STATE_ASPECT_CFG_PARAM_EDIT_ENTER",t.STATE_ASPECT_CFG_PARAM_EDIT_REENTER="STATE_ASPECT_CFG_PARAM_EDIT_REENTER";const c="STATE_ASPECT_CFG_PARAM_EDIT",A="STATE_ASPECT_CFG_PARAM_EDIT_USER_ACTION",p="STATE_ASPECT_CFG_PARAM_INSPECT",d="TASK_HANDLER_NO_PARAMETERS";t.ConfigParamsAspect=class extends l.AbstractQAppAspect{constructor(){super(...arguments),this.states={STATE_ASPECT_CFG_PARAM_EDIT_ENTER:{_onEnter:function(e){e.aspects[t.CFG_PARAMS_ASPECT].parametersEmpty()?e.addToEventQueue(new o.ImmediateEvent(d)):e.addToEventQueue(new o.ImmediateEvent(c))
},_onExit:function(e){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,a){a.payload===c&&this.transition(e,c),a.payload===d&&this.transition(e,e.aspects[t.CFG_PARAMS_ASPECT].cfg.returnState)},"*":function(e){this.deferUntilTransition(e)}},STATE_ASPECT_CFG_PARAM_EDIT_REENTER:{_onEnter:function(e){e.aspects[t.CFG_PARAMS_ASPECT].parametersEmpty()?e.addToEventQueue(new o.ImmediateEvent(d)):e.addToEventQueue(new o.ImmediateEvent(c))},_onExit:function(e){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,a){a.payload===c&&this.transition(e,c),a.payload===d&&this.transition(e,e.aspects[t.CFG_PARAMS_ASPECT].cfg.returnState)},"*":function(e){this.deferUntilTransition(e)}},STATE_ASPECT_CFG_PARAM_EDIT:{_onEnter:function(e){let a=e.screens[i.PARAM_LIST_SCREENID].getButton(i.FINISH_BUTTON_ID);if(void 0!==a){let i=e.aspects[t.CFG_PARAMS_ASPECT].cfg.isValidFn();a.setAppearance(i?s.EnumAppearance.ENABLED_PRIMARY:s.EnumAppearance.DISABLED)}},_onExit:function(e){},_transTo:{},_transFrom:{
STATE_ASPECT_CFG_PARAM_EDIT_ENTER:function(e,a){let n=e.screens[i.PARAM_LIST_SCREENID];n.readFromTaskhandler(e.aspects[t.CFG_PARAMS_ASPECT].cfg.taskHandler),n.setShowLastVisibleCategory(!1);let r=n.getButton(i.FINISH_BUTTON_ID);if(void 0!==r){let a=e.aspects[t.CFG_PARAMS_ASPECT].cfg.isValidFn();r.setAppearance(a?s.EnumAppearance.ENABLED_PRIMARY:s.EnumAppearance.DISABLED)}n.show()},STATE_ASPECT_CFG_PARAM_EDIT_REENTER:function(e,a){let n=e.screens[i.PARAM_LIST_SCREENID];n.readFromTaskhandler(e.aspects[t.CFG_PARAMS_ASPECT].cfg.taskHandler),n.setShowLastVisibleCategory(!0);let r=n.getButton(i.FINISH_BUTTON_ID);if(void 0!==r){let a=e.aspects[t.CFG_PARAMS_ASPECT].cfg.isValidFn();r.setAppearance(a?s.EnumAppearance.ENABLED_PRIMARY:s.EnumAppearance.DISABLED)}n.show()}},EV_HMI_BTN_CLICKED:function(e,a){a.payload.buttonId===i.FINISH_BUTTON_ID&&e.aspects[t.CFG_PARAMS_ASPECT].cfg.isValidFn()&&this.transition(e,e.aspects[t.CFG_PARAMS_ASPECT].cfg.returnState),
a.payload.buttonId===i.CANCEL_BUTTON_ID&&e.suspend()},EV_HMI_PARAM_CHANGED:function(e,a){let s=e.aspects[t.CFG_PARAMS_ASPECT].updateTaskParameterGeneric(a.payload.parameter),i=[{guardFn:function(e,t){return void 0===s},nextState:""},{guardFn:function(e,t){return void 0!==s},nextState:A}];this.myHandler(e,i,a)},EV_HMI_PARAM_DETAIL:function(e,a){e.aspects[t.CFG_PARAMS_ASPECT].inspectTaskParameter(a.payload.parameter),this.transition(e,p)}},STATE_ASPECT_CFG_PARAM_INSPECT:{_onEnter:function(e){},_onExit:function(e){},_transTo:{},_transFrom:{},EV_HMI_BTN_CLICKED:function(e,t){t.payload.buttonId===n.CANCEL_BUTTON_ID&&this.transition(e,c)}},STATE_ASPECT_CFG_PARAM_EDIT_USER_ACTION:{_onEnter:function(e){},_onExit:function(e){},_transTo:{},_transFrom:{},EV_HMI_BTN_CLICKED:function(e,a){if(a.payload.buttonId===i.CANCEL_BUTTON_ID)e.suspend();else{let s=e.aspects[t.CFG_PARAMS_ASPECT].handleParamUpdateUserActionGeneric(a);"boolean"==typeof s&&s&&this.transition(e,c)}}}},
this.currentParamUpdateUserAction=void 0,this.isLastUserActionGenericError=!1}getId(){return t.CFG_PARAMS_ASPECT}getAspectStates(){return this.states}init(e){if(this.client=e,this.client){console.log("ConfigParamAspect::init");let e=new i.ParameterListScreen(this.client.mqttHandler);this.client.registerScreen(e)}else console.log("ConfigParamAspect::init - aspect not correctly initialized (no client set) - skip init")}publishParameter(e){void 0!==this.client&&this.client.screens[i.PARAM_LIST_SCREENID]&&this.client.screens[i.PARAM_LIST_SCREENID].updateParameter(e)}setCurrentParamUpdateUserAction(e){e?this.updateMessageBoxFromActionMessageAndShow(e.message):this.currentParamUpdateUserAction&&this.client.hideMsgBox(),this.currentParamUpdateUserAction=e}getCurrentParamUpdateUserAction(){return this.currentParamUpdateUserAction}updateTaskParameterGeneric(e){console.log("ConfigParamAspect: updateTaskParameterGeneric");let t=void 0;!0!==e.suppressLibRuleChecks&&(t=u.checkGeneralParamRules(e)),
void 0!==t?this.isLastUserActionGenericError=!0:(this.isLastUserActionGenericError=!1,t=this.cfg.updateTaskParameterFn(e)),this.setCurrentParamUpdateUserAction(t);let a=this.client.screens[i.PARAM_LIST_SCREENID].getButton(i.FINISH_BUTTON_ID);return void 0!==a&&a.setAppearance(this.cfg.isValidFn()?s.EnumAppearance.ENABLED_PRIMARY:s.EnumAppearance.DISABLED),t}handleParamUpdateUserActionGeneric(e){console.log("ConfigParamsAspect: handleParamUpdateUserActionGeneric");let t=!1,a=this.getCurrentParamUpdateUserAction();return a?(this.isLastUserActionGenericError&&e.payload.buttonId===r.ParamUpdateUserActionSimpleAccept_OK_BUTTON_ID?(this.isLastUserActionGenericError=!1,t=!0):t=this.cfg.handleParamUpdateUserActionFn(a,e),("boolean"==typeof t&&t||"object"==typeof t)&&(console.log("action handled"),this.setCurrentParamUpdateUserAction(void 0)),"object"==typeof t&&(console.log("new action present"),
this.setCurrentParamUpdateUserAction(t))):this.client.exitError("ConfigParamsAspect: handleParamUpdateUserActionGeneric - called in state, although no action set"),t}updateMessageBoxFromActionMessageAndShow(e){this.client.showMessageBox(e)}inspectTaskParameter(e){if(this.cfg.getDetailForTaskParameterFn){let t=this.cfg.getDetailForTaskParameterFn(e);this.showDetailTaskParameter(t)}else console.log("Error: Inspect parameter was clicked, but no getDetailForTaskParameterFn was configured in ConfigParamsAspect")}showDetailTaskParameter(e){let t=new E.default(this.client.mqttHandler);t.setTitle(e.title.id,e.title.args),t.setAppearance(s.EnumAppearance.HIDDEN);let a=[];for(const t of e.params){let e=new _.default(this.client.mqttHandler,t);e.publish(),a.push(e.getPublishedId())}t.setParams(a),t.show()}parametersEmpty(){let e=this.cfg.taskHandler.getTaskGroupsAndParameters(),t=!0;for(let a of e)for(let e of a.parameters)e.appearance!==s.EnumAppearance.HIDDEN&&(t=!1);return t}}
},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(10),i=a(0),n=a(21);t.PARAM_LIST_SCREENID="PARAMLIST";var r=a(21);t.CANCEL_BUTTON_ID=r.CANCEL_BUTTON_ID,t.FINISH_BUTTON_ID="BTN_FIN";t.ParameterListScreen=class extends n.default{constructor(e){super(e);let a={};a.label={id:n.CANCEL_BUTTON_NAME,args:[]},a.appearance=i.EnumAppearance.ENABLED_PRIMARY,a.buttonId=n.CANCEL_BUTTON_ID,this.cancelButton=new s.default(e,this,a),a.appearance=i.EnumAppearance.HIDDEN,a.label.id="_FINISH",a.buttonId=t.FINISH_BUTTON_ID,this.finishButton=new s.default(e,this,a)}getId(){return"PARAMLIST"}getButton(e){let a;return a=e===n.CANCEL_BUTTON_ID?this.cancelButton:e===t.FINISH_BUTTON_ID?this.finishButton:void 0}setFinishButtonLabel(e){this.finishButton.setLabel(e,!1)}show(){this.finishButton.publish(),this.createAndPublishParamsAndPage(),super.show()}}},function(e,t){e.exports=require("rxjs/observable/interval")},function(e,t){e.exports=require("rxjs/observable/merge")
},function(e,t){e.exports=require("timers")},function(e,t){e.exports=require("machina")},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.INTERNAL_SUSPEND_EVENT="_INTERNAL_SUSPEND_EVENT_",function(e){e.SUSPEND_EVENT_TYPE_FORCED_HOME="SUSPEND_EVENT_TYPE_FORCED_HOME",e.SUSPEND_EVENT_TYPE_FORCED_LOGOUT="SUSPEND_EVENT_TYPE_FORCED_LOGOUT",e.SUSPEND_EVENT_TYPE_FORCED_AUTO_LOGOUT="SUSPEND_EVENT_TYPE_FORCED_AUTO_LOGOUT",e.SUSPEND_EVENT_TYPE_EXECFINALLY="SUSPEND_EVENT_TYPE_EXECFINALLY"}(t.INTERNAL_SUSPEND_EVENT_TYPE||(t.INTERNAL_SUSPEND_EVENT_TYPE={}));t.InternalSuspendEvent=class{constructor(e){this.payload=e,this.type=t.INTERNAL_SUSPEND_EVENT}},t.INTERNAL_RESTART_EVENT="_INTERNAL_RESTART_EVENT_",function(e){e.RESTART_EVENT_TYPE_REQUEST="RESTART_EVENT_TYPE_REQUEST",e.RESTART_EVENT_TYPE_EXECFINALLY="RESTART_EVENT_TYPE_EXECFINALLY"}(t.INTERNAL_RESTART_EVENT_TYPE||(t.INTERNAL_RESTART_EVENT_TYPE={}));t.InternalRestartEvent=class{constructor(e){this.payload=e,
this.type=t.INTERNAL_RESTART_EVENT}},t.HEARTBEAT_EVENT="_FSM_HEARTBEAT_EVENT_";t.HeartbeatEvent=class{constructor(e){this.payload=e,this.type=t.HEARTBEAT_EVENT}},function(e){e.INTERNAL_ASYNC_CALL_EVENT_TYPE_SUCCESS="SUCCESS",e.INTERNAL_ASYNC_CALL_EVENT_TYPE_FAIL="FAIL",e.INTERNAL_ASYNC_CALL_EVENT_TYPE_TIMEOUT="TIMEOUT",e.INTERNAL_ASYNC_CALL_EVENT_TYPE_TIMEOUT_WITH_FETCHING_RESP="TIMEOUT_FETCH_RESP"}(t.INTERNAL_ASYNC_CALL_EVENT_TYPE||(t.INTERNAL_ASYNC_CALL_EVENT_TYPE={})),t.INTERNAL_ASYNC_CALL_EVENT="_INTERNAL_ASYNC_CALL_EVENT_";t.InternalAsyncCallEvent=class{constructor(e){this.payload=e,this.type=t.INTERNAL_ASYNC_CALL_EVENT}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(61),i=a(7),n=a(62),r=a(29),o=a(28),l=a(1);t.MqttHandler=class{constructor(){this.mqttOptions={host:"127.0.0.1",port:1883,clientId:`qapp_${Math.random().toString(16).substr(2,8)}`,will:{topic:l.MqttTopics.QAPP_CLEANUP,payload:"",qos:1,retain:0}},
this.listeningForUpdateEvent=!1,this.listeningForAdminEvent=!1,this.mqttUpdateEvent$=new i.Subject,this.mqttAdminEvent$=new i.Subject,this.weighingNet={str:l.MqttTopics.WEIGHING_VALUE_NET,subscribe:()=>this.subscribe(l.MqttTopics.WEIGHING_VALUE_NET),unsubscribe:()=>this.unsubscribe(l.MqttTopics.WEIGHING_VALUE_NET)},this.client=s.connect(this.mqttOptions),this.startListeningForUpdateEvent(),this.startListeningForAdminEvent(),this.listOfPublishedTopics=[],this.listOfSubscribedTopics=[]}startListeningForUpdateEvent(){this.listeningForUpdateEvent||(this.client.on("message",(e,t,a)=>{let s={topic:e,value:t,packet:a};s.topic.startsWith(l.MqttTopics.QAPP_DEBUG_TOPIC_PREAMBLE)?this.mqttUpdateEvent$.next(new o.MqttUpdateDebugEvent(s)):this.mqttUpdateEvent$.next(new o.MqttUpdateEvent(s))}),this.listeningForUpdateEvent=!0)}startListeningForAdminEvent(){this.listeningForAdminEvent||(this.client.on("offline",()=>{this.mqttAdminEvent$.next(new r.MqttAdminEvent({event:"offline",
message:"client is offline!"}))}),this.client.on("close",()=>{this.mqttAdminEvent$.next(new r.MqttAdminEvent({event:"close",message:"client has disconnected!"}))}),this.client.on("reconnect",()=>{this.mqttAdminEvent$.next(new r.MqttAdminEvent({event:"reconnect",message:"client is reconnecting!"}))}),this.client.on("error",e=>{this.mqttAdminEvent$.next(new r.MqttAdminEvent({event:"error",message:"client cannot connect or a parsing error occured!",error:e}))}),this.client.on("packetsend",e=>{this.mqttAdminEvent$.next(new r.MqttAdminEvent({event:"packetsend",message:"client send packet!",packet:e}))}),this.client.on("packetreceive",e=>{this.mqttAdminEvent$.next(new r.MqttAdminEvent({event:"packetreceive",message:"client recieved packet!",packet:e}))}),this.client.on("connect",e=>{this.mqttAdminEvent$.next(new r.MqttAdminEvent({event:"connect",message:"client has successfully connected!",connack:e}))}),this.listeningForAdminEvent=!0)}publish(e,t,a,s){let i,r;"function"==typeof a?(r=a,
i=void 0):(i=a,r=s);let o={qos:n.EnumMqttQos.AtMostOnce,retain:!0,dup:!1};Object.assign(o,i),"/"!==e.substring(0,1)&&(e="~"===e.substring(0,1)?e.substr(1):`${l.MqttTopics.QAPP_NAMESPACE}/${e}`),e.startsWith(l.MqttTopics.QAPP_NAMESPACE)&&-1===this.listOfPublishedTopics.indexOf(e)&&this.listOfPublishedTopics.push(e),this.client.publish(e,t,o,e=>{r&&r(e)})}subscribe(e,t,a){if("object"==typeof e)this.subscribe(e,(e,t)=>{a&&a(e,t)});else{"function"==typeof t&&(a=t,t=void 0);let s={qos:0};Object.assign(s,t),-1===this.listOfSubscribedTopics.indexOf(e)&&this.listOfSubscribedTopics.push(e),this.client.subscribe(e,s,(e,t)=>{a&&a(e,t)})}}unsubscribe(e,t){this.client.unsubscribe(e,e=>{t&&t(e)})}end(e,t){let a=!1,s=void 0;"function"==typeof e?(a=!1,s=e):"boolean"==typeof e&&(a=e,s=t),this.client.end(a,()=>{s&&s()})}removeOutgoingMessage(e){this.client.removeOutgoingMessage(e)}reconnect(e){this.client.reconnect(e)}getLastMessageId(){return this.client.getLastMessageId()}handleMessage(e,t){
this.client.handleMessage(e,(e,a)=>{t(e,a)})}reconnecting(){return this.client.reconnecting}connected(){return this.client.connected}clearPublishedTopics(){this.publish(l.MqttTopics.QAPP_CLEANUP,"");for(let e of this.listOfPublishedTopics)this.publish(e,"");this.publish(l.MqttTopics.QAPP_CLEANUP,"")}unsubscribeTopics(){this.unsubscribe(this.listOfSubscribedTopics)}}},function(e,t){e.exports=require("mqtt")},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.AtMostOnce=0]="AtMostOnce",e[e.AtLeastOnce=1]="AtLeastOnce",e[e.ExactlyOnce=2]="ExactlyOnce"}(t.EnumMqttQos||(t.EnumMqttQos={}))},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(37),i=a(7),n=a(30),r=a(14),o=a(1),l="/rest/qapp/paramDetail",E="/rest/qapp/paramChanged",_="/rest/qapp/buttonClick",u="/rest/qapp/extern",c=5e3;function A(e,t,a,s,i){e.statusCode=t,void 0!==a&&(e.statusMessage=a),
console.log(`RestHandler::finalizeResponse: send ${t} (${a}) response: ${r.inspect(s)}`),void 0===s?e.end():"object"==typeof s?(e.setHeader("Content-Type","application/json"),e.end(JSON.stringify(s,i))):(e.setHeader("Content-Type","plain/text"),e.end(s))}t.RestHandler=class{constructor(e){this.buttonClickEvent$=new i.Subject,this.paramChangedEvent$=new i.Subject,this.paramDetailEvent$=new i.Subject,this.restRequestEvent$=new i.Subject,this.restController=((e,t)=>{if(e.url)if(e.url.startsWith(u)){let a=e.url.replace(u,"");console.log(`RestHandler: rx extern REST request (${e.method})for URL ${a}`),this.handleRequest(e,s=>{console.log("RestHandler: rx all data for REST request - create and enqueue event"),t.setTimeout(c);let i={subUrl:a,request:e,body:s,response:t};this.restRequestEvent$.next(new n.RestRequestEvent(i))})}else switch(console.log(`RestHandler: rx internal REST request: ${e.url}`),e.url){case _:"POST"===e.method?this.handleRequest(e,e=>{
e.buttonId&&(console.log(`RestHandler::restController received buttonID: ${e.buttonId}`),this.buttonClickEvent$.next(new n.HmiButtonClickedEvent(e)),A(t,200,"Event Accepted and Forwarded","ok"))}):A(t,405,"Method Not Allowed","failure");break;case E:"POST"===e.method?this.handleRequest(e,e=>{e&&(this.paramChangedEvent$.next(new n.HmiParamChangedEvent({parameter:e})),A(t,200,"Event Accepted and Forwarded","ok"))}):A(t,405,"Method Not Allowed","failure");break;case l:"POST"===e.method?this.handleRequest(e,e=>{e&&(this.paramDetailEvent$.next(new n.HmiParamDetailEvent({parameter:e})),A(t,200,"Event Accepted and Forwarded","ok"))}):A(t,405,"Method Not Allowed","failure");break;default:A(t,404,"Not Found","failure")}else A(t,404,"Not Found","failure")}),this.port=e||8081,this.server=s.createServer(this.restController),this.server.listen(this.port,e=>{e&&console.log(e),console.log(`listening on port ${this.port}`)}),this.server.on("clientError",(e,t)=>{console.log("clientError"),
console.log(e),console.log(e.stack),t.end("HTTP/1.1 400 Bad Request\r\n\r\n")})}stopServer(){this.server.close(()=>{console.log("HttpServer closed")})}handleRequest(e,t){let a,s=[""];e.on("error",t=>{console.log("RestHandler::handleRequest: "+t),e.socket.end()}).on("data",e=>{console.log("RestHandler::handleRequest: data"),"string"!=typeof e?s.push(e.toString()):s.push(e)}).on("end",()=>{if(console.log("RestHandler::handleRequest: end"),a=s.reduce((e,t)=>e+t),"application/json"===e.headers["content-type"])try{t(JSON.parse(a))}catch(e){t(a)}else t(a)})}registerRestEndpoints(e,t){e.publish(o.MqttTopics.CUSTOMIZED_REST_HANDLER_CONFIGURATION,JSON.stringify(t))}},t.finalizeResponse=A},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(5),i=a(6);t.LocalizerProxy=class extends s.BaseProxy{constructor(){super(...arguments),this.restEndpoint="localizer"}getLanguage(){let e;return this.body.method=i.RestMethodsLOCALIZER.getLanguage,this.body.params={
rLanguageId:""},(e=new s.CubisRestResponse(this.syncRequest())).isSuccess()?e.rawReturns.rLanguageId:""}getText(e,t=[]){let a;return this.body.method=i.RestMethodsLOCALIZER.getText,this.body.params={id:e,rText:"",args:t},(a=new s.CubisRestResponse(this.syncRequest())).isSuccess()?a.rawReturns.rText:e}getTexts(e){let t;return this.body.method=i.RestMethodsLOCALIZER.getTexts,this.body.params={textObjects:e,rTexts:""},(t=new s.CubisRestResponse(this.syncRequest())).isSuccess()?JSON.parse(t.rawReturns.rTexts):[]}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(3),i=a(12),n=a(0);function r(e){return"string"==typeof e.name&&"string"==typeof e.message}t.ERRORMSGBOX_OK_BTN_ID="BTN_OK_ERRORMSGBOX",t.isError=r,t.createMsgBoxData=function(e,a,o,l,E){let _=[];return r(o)?_.push({id:o.name+":"+o.message,args:[]}):s.isITextStructure(o)?_.push(o):_.push({id:o.error.name+":"+o.error.message,args:o.msgargs}),void 0!==l&&_.push(l),{type:e,title:a,textList:_,
buttons:[{id:E||t.ERRORMSGBOX_OK_BTN_ID,label:{id:i.EnumFontLabels.OK,args:[]},appearance:n.EnumAppearance.ENABLED_SECONDARY}]}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HttpRestErrorName="HttpRestError";class s extends Error{constructor(e,a,i,n){super(),this.statusCode=a,this.headers=i,this.body=n,this.name=t.HttpRestErrorName,Object.setPrototypeOf(this,s.prototype),this.message=e}}t.HttpRestError=s,t.isHttpRestError=function(e){return"object"==typeof e&&e.hasOwnProperty("statusCode")&&e.hasOwnProperty("headers")&&e.hasOwnProperty("body")}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(5),i=a(0),n=a(6),r="WEIGHING/CONFIGURATION/PROFILE/ZERO_TARE",o=r+"/TARE1",l="ON",E="PROFILE/IDENTIFICATION",_="PROFILE/IDENTIFICATION/NAME";t.ProfileManagementProxy=class extends s.BaseProxy{constructor(){super(...arguments),this.restEndpoint="profilemanagement"}loadProfile(e){
return this.body.method=n.RestMethodsPROFILE_MANAGEMENT.loadProfile,this.body.params={rProfile:"",id:e},new s.CubisRestResponse(this.syncRequest())}isPresetTareEnabled(e){let t;if(e instanceof s.CubisRestResponse)t=JSON.parse(e.rawReturns.rProfile).params;else if("string"==typeof e){let a=this.loadProfile(e);t=JSON.parse(a.rawReturns.rProfile).params}else t=e.params;for(let e of t)if(e.id===r)for(let t of e.parameters)if(t.id===o)return t.value.selection.id===l;return!1}getWeighingProfileName(e){let t;if(e instanceof s.CubisRestResponse)t=JSON.parse(e.rawReturns.rProfile).params;else if("string"==typeof e){let a=this.loadProfile(e);t=JSON.parse(a.rawReturns.rProfile).params}else t=e.params;for(let e of t)if(e.id===E)for(let t of e.parameters)if(t.id===_)return t.value.string;return""}getAvailableWeighingUnitsInWeighingProfile(e){let t=e.params.find(e=>"WEIGHING/CONFIGURATION/PROFILE/UNITS_ACCURACY"===e.id);if(void 0!==t){
let e=t.parameters.find(e=>"WEIGHING/CONFIGURATION/PROFILE/UNITS_ACCURACY/UNITS"===e.id);return void 0===e?void 0:e.value.selections.map(e=>e.id)}}getUnitsAvailableOnBalance(e){let t=e.params.find(e=>"WEIGHING/CONFIGURATION/PROFILE/UNITS_ACCURACY"===e.id);if(void 0!==t){let e=t.parameters.find(e=>"WEIGHING/CONFIGURATION/PROFILE/UNITS_ACCURACY/UNITS"===e.id);if(void 0===e)return;{let t=[];return e.info.options.forEach(e=>{e.appearance===i.EnumAppearance.ENABLED&&(t=[...t,e.id])}),0===t.length?void 0:t}}}}},function(e,t){e.exports=require("tslib")},function(e,t){e.exports=require("https")},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(5),i=a(3),n=a(6);!function(e){e.TEX_RUNNEWTEST="TEX_RUNNEWTEST",e.TEX_RESTARTLASTTEST="TEX_RESTARTLASTTEST",e.SETTINGS="SETTINGS",e.PRG_VIEWNPRINT="PRG_VIEWNPRINT",e.PRG_CREATENEDIT="PRG_CREATENEDIT",e.PRG_DELETE="PRG_DELETE",e.PRG_IMPORTEXPORT="PRG_IMPORTEXPORT",e.RSL_VIEWNPRINT="RSL_VIEWNPRINT",
e.RSL_APPROVAL="RSL_APPROVAL",e.RSL_DELETE="RSL_DELETE",e.RSL_IMPORTEXPORT="RSL_IMPORTEXPORT",e.MAINTENANCE="MAINTENANCE",e.QFC_IQOQ="QFC_IQOQ",e.QFC_PQ="QFC_PQ",e.QFC_RESULTAPPROVAL="QFC_RESULTAPPROVAL",e.ATR_VIEW="ATR_VIEW",e.ATR_EXPORT="ATR_EXPORT",e.CREATE_UPDATE_DELETE_USER="CREATE_UPDATE_DELETE_USER",e.CREATE_UPDATE_DELETE_TASK="CREATE_UPDATE_DELETE_TASK",e.ACCESS_QAPP_CENTER="ACCESS_QAPP_CENTER",e.SETUP_MENU_ACCESS="SETUP_MENU_ACCESS"}(t.EnumUserRights||(t.EnumUserRights={})),function(e){e.ADMIN_ROLE_ID="adminRoleDbId",e.SERVICE_ROLE_ID="serviceRoleDbId",e.OPERATOR_ROLE_ID="operatorRoleDbId",e.GUEST_ROLE_ID="guestRoleDbId"}(t.EnumRoleDbIds||(t.EnumRoleDbIds={}));t.AccessControlProxy=class extends s.BaseProxy{constructor(){super(...arguments),this.restEndpoint="access"}getCurrentUser(){let e,t;return this.body.method=n.RestMethodsACCESS_MANAGEMENT.getCurrentUser,this.body.params={user:""},e=new s.CubisRestResponse(this.syncRequest()),t=JSON.parse(e.rawReturns.user)}
getCurrentUserName(e){let t,a="";return(t=void 0!==e?e:this.getCurrentUser()).params.find(e=>"USER/SETTINGS"===e.id&&e.parameters.find(e=>"USER/SETTINGS/NAME"===e.id&&(a=e.value.string,!0))),a}getCurrentUserRoles(e){let t;t=void 0!==e?e:this.getCurrentUser();let a=i.createEmptySelectionParameter();return t.params.find(e=>"USER/SETTINGS"===e.id&&e.parameters.find(e=>"USER/SETTINGS/ROLES"===e.id&&(a=e,!0))),a}checkRightsOfCurrentUser(e){let t;return this.body.method=n.RestMethodsACCESS_MANAGEMENT.checkRightsOfCurrentUser,this.body.params={permissionGranted:!1,arrayOfRightsToCheck:e},(t=new s.CubisRestResponse(this.syncRequest())).rawReturns.permissionGranted}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(10),i=a(0),n=a(11),r=a(4),o=a(7),l=a(1);t.MESSAGEBOX_ID="MESSAGEBOX";class E{constructor(e){this.appearance=i.EnumAppearance.HIDDEN,this.lastPublishedTabContent={appearance:i.EnumAppearance.HIDDEN,type:n.EnumMessageboxType.INFO,title:{id:"",
args:[]},text:{id:"",args:[]},textsList:[],buttons:[]},this.messageBoxObject={appearance:i.EnumAppearance.HIDDEN,type:n.EnumMessageboxType.INFO,title:{id:"",args:[]},text:{id:"",args:[]},textsList:[],buttons:[]},this.events$=new o.Subject,this.mqttHandler=e,this.buttonList=[]}setMessageBoxData(e,t=!0){this.setBackgroundColor(e.backgroundColor,!1),this.setIconColor(e.iconColor,!1),this.setType(e.type,!1),this.setTitle(e.title,!1),this.setTextsList(e.textList,!1),this.createButtons(e.buttons.map(e=>({buttonId:e.id,label:e.label,appearance:e.appearance}))),this.publish(t)}createButtons(e){this.buttonList.splice(0,this.buttonList.length),this.messageBoxObject.buttons.splice(0,this.messageBoxObject.buttons.length),console.log("MessageBox: createButtons buttonlist cleared: "+this.buttonList.length),console.log("MessageBox: createButtons buttonlist json cleared: "+this.messageBoxObject.buttons.length);for(let t of e)if(void 0===this.getButton(t.buttonId)){
let e=new s.default(this.mqttHandler,this,t);this.buttonList.push(e),this.messageBoxObject.buttons.push(e.getJson())}else console.error("MessageBox: Duplicate Button: "+t.buttonId);console.log("MessageBox: createButtons number of buttons: "+this.buttonList.length),console.log("MessageBox: createButtons json result: "+JSON.stringify(this.messageBoxObject))}removeButtons(e){console.log("MessageBox: removeButtons ");for(let t of e){for(let e=0;e<this.buttonList.length;e++)this.buttonList[e].getButtonId()===t&&(console.log("MessageBox: splice for index: "+e),this.buttonList.splice(e,1),console.log("MessageBox: Buttonlist buttons left: "+this.buttonList.length),e=0);console.log("MessageBox: Clearing json buttons");for(let e=0;e<this.messageBoxObject.buttons.length;e++){let a=this.messageBoxObject.buttons[e];if(console.log("MessageBox: buttonId "+a.effect.params.buttonId),a.effect.params.buttonId===t){let t=this.messageBoxObject.buttons.splice(e,1)
;console.log("MessageBox: Removed JSON Button: "+t[0]),console.log("MessageBox: ButtonJSON buttons left: "+this.messageBoxObject.buttons.length),e=0}}}console.log("MessageBox: Messagebox json: "+JSON.stringify(this.messageBoxObject))}publish(e=!0){let t=JSON.stringify(this.messageBoxObject),a=JSON.stringify(this.lastPublishedTabContent);e&&(t!==a&&this.messageBoxObject.appearance===i.EnumAppearance.ENABLED||this.lastPublishedTabContent.appearance===i.EnumAppearance.ENABLED&&this.messageBoxObject.appearance===i.EnumAppearance.HIDDEN)&&(this.mqttHandler.publish(l.MqttTopics.HMI_MESSAGEBOX,t),this.lastPublishedTabContent=JSON.parse(t))}getButtonByTopic(e){for(let t of this.buttonList){if(t.getTopic().substring(t.getTopic().lastIndexOf("/")+1)===e)return t}}getButton(e){for(let t of this.buttonList)if(t.getButtonId()===e)return t}setAppearance(e,t=!0){"HIDDEN"!==e&&"ENABLED"!==e||(this.appearance=e,this.messageBoxObject.appearance=e,this.publish(t))}getAppearance(){return this.appearance}
setBackgroundColor(e,t=!0){this.messageBoxObject.backgroundColor=e,this.publish(t)}getBackgroundColor(){return this.messageBoxObject.backgroundColor}setIconColor(e,t=!0){this.messageBoxObject.iconColor=e,this.publish(t)}getIconColor(){return this.messageBoxObject.iconColor}setType(e,t=!0){this.messageBoxObject.type=e,this.publish(t)}getType(){return this.messageBoxObject.type}setTitle(e,t=!0){this.messageBoxObject.title=e,this.publish(t)}getTitle(){return this.messageBoxObject.title}setTextsList(e,t=!0){this.messageBoxObject.textsList=e,this.publish(t)}getTextsList(){return this.messageBoxObject.textsList}getText(){return this.messageBoxObject.textsList[0]}getId(){return t.MESSAGEBOX_ID}hide(){this.appearance===i.EnumAppearance.ENABLED&&(this.setAppearance(i.EnumAppearance.HIDDEN),this.events$.next({type:r.ScreenEventType.HIDE_MESSAGEBOX,id:this.getId()}))}show(){this.appearance===i.EnumAppearance.HIDDEN&&(this.setAppearance(i.EnumAppearance.ENABLED),this.events$.next({
type:r.ScreenEventType.SHOW_MESSAGEBOX,id:this.getId()}))}}t.MessageBox=E,t.default=E},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(0),i=a(43),n=a(4),r=a(1);t.LOADING_OVERLAY_ID="LOADING_MODAL";t.LoadingOverlay=class extends i.AbstractOverlay{setText(e){this.publishContent("TEXT",JSON.stringify(e))}show(){this.publishContent("APPEARANCE",'{ "appearance":"'+s.EnumAppearance.ENABLED+'" }'),this.events$.next({type:n.ScreenEventType.SHOW_LOADINGSCREEN,id:this.getId()})}hide(){this.publishContent("TEXT",""),this.publishContent("APPEARANCE",'{ "appearance":"'+s.EnumAppearance.HIDDEN+'" }'),this.events$.next({type:n.ScreenEventType.HIDE_LOADINGSCREEN,id:this.getId()})}getMqttTopicBase(){return"~"+r.MqttTopics.HMI_LOADING_MODAL}getId(){return t.LOADING_OVERLAY_ID}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.PERSISTENCY_SCOPE_QAPP_INDEPENDENT="PERSISTENCY_SCOPE_QAPP_INDEPENDENT",
e.PERSISTENCY_SCOPE_QAPP_SPECIFIC="PERSISTENCY_SCOPE_QAPP_SPECIFIC",e.PERSISTENCY_SCOPE_QAPP_SPECIFIC_VERSION="PERSISTENCY_SCOPE_QAPP_SPECIFIC_VERSION",e.PERSISTENCY_SCOPE_TASk_SPECIFIC="PERSISTENCY_SCOPE_TASk_SPECIFIC"}(t.EnumPersistencyScope||(t.EnumPersistencyScope={}))},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(5),i=a(6);t.DeviceInformationProxy=class extends s.BaseProxy{constructor(){super(...arguments),this.restEndpoint="deviceinformation"}getSerialNo(){let e;return this.body.method=i.RestMethodsDEVICE_INFORMATION.getSerialNoBalance,this.body.params={rString:""},(e=new s.CubisRestResponse(this.syncRequest())).isSuccess()?e.rawReturns.rString:""}getModelName(){let e;return this.body.method=i.RestMethodsDEVICE_INFORMATION.getModelName,this.body.params={rString:""},(e=new s.CubisRestResponse(this.syncRequest())).isSuccess()?e.rawReturns.rString:""}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),
t.QAppAsyncCallTimeoutErrorName="QAppAsyncCallTimeoutError";class s extends Error{constructor(e,a,i){super(),this.originalState=e,this.metadata=a,this.name=t.QAppAsyncCallTimeoutErrorName,i&&(this.stack=i),Object.setPrototypeOf(this,s.prototype),this.message="Async call timeout."+(a?` metadata: ${a}`:"")}}t.QAppAsyncCallTimeoutError=s},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LOCKING_ASPECT="LOCKING_ASPECT"},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(10),i=a(0),n=a(11),r=a(4),o=a(7),l=a(1);t.LOCKMESSAGEBOX_ID="LOCKMESSAGEBOX";class E{constructor(e){this.appearance=i.EnumAppearance.HIDDEN,this.lastPublishedTabContent={appearance:i.EnumAppearance.HIDDEN,type:n.EnumMessageboxType.INFO,title:{id:"",args:[]},text:{id:"",args:[]},textsList:[],buttons:[]},this.messageBoxObject={appearance:i.EnumAppearance.HIDDEN,type:n.EnumMessageboxType.INFO,title:{id:"",args:[]},text:{id:"",args:[]},textsList:[],buttons:[]},
this.events$=new o.Subject,this.mqttHandler=e,this.buttonList=[]}setMessageBoxData(e,t=!0){this.setBackgroundColor(e.backgroundColor,!1),this.setIconColor(e.iconColor,!1),this.setType(e.type,!1),this.setTitle(e.title,!1),this.setTextsList(e.textList,!1),this.createButtons(e.buttons.map(e=>({buttonId:e.id,label:e.label,appearance:e.appearance}))),this.publish(t)}createButtons(e){this.buttonList.splice(0,this.buttonList.length),this.messageBoxObject.buttons.splice(0,this.messageBoxObject.buttons.length),console.log("LockMessageBox: createButtons buttonlist cleared: "+this.buttonList.length),console.log("LockMessageBox: createButtons buttonlist json cleared: "+this.messageBoxObject.buttons.length);for(let t of e)if(void 0===this.getButton(t.buttonId)){let e=new s.default(this.mqttHandler,this,t);this.buttonList.push(e),this.messageBoxObject.buttons.push(e.getJson())}else console.error("LockMessageBox: Duplicate Button: "+t.buttonId)
;console.log("LockMessageBox: createButtons number of buttons: "+this.buttonList.length),console.log("LockMessageBox: createButtons json result: "+JSON.stringify(this.messageBoxObject))}removeButtons(e){console.log("LockMessageBox: removeButtons ");for(let t of e){for(let e=0;e<this.buttonList.length;e++)this.buttonList[e].getButtonId()===t&&(console.log("LockMessageBox: splice for index: "+e),this.buttonList.splice(e,1),console.log("LockMessageBox: Buttonlist buttons left: "+this.buttonList.length),e=0);console.log("LockMessageBox: Clearing json buttons");for(let e=0;e<this.messageBoxObject.buttons.length;e++){let a=this.messageBoxObject.buttons[e];if(console.log("LockMessageBox: buttonId "+a.effect.params.buttonId),a.effect.params.buttonId===t){let t=this.messageBoxObject.buttons.splice(e,1);console.log("LockMessageBox: Removed JSON Button: "+t[0]),console.log("LockMessageBox: ButtonJSON buttons left: "+this.messageBoxObject.buttons.length),e=0}}}}publish(e=!0){
let t=JSON.stringify(this.messageBoxObject),a=JSON.stringify(this.lastPublishedTabContent);e&&(t!==a&&this.messageBoxObject.appearance===i.EnumAppearance.ENABLED||this.lastPublishedTabContent.appearance===i.EnumAppearance.ENABLED&&this.messageBoxObject.appearance===i.EnumAppearance.HIDDEN)&&(this.mqttHandler.publish(l.MqttTopics.HMI_LOCK_MESSAGEBOX,t),this.lastPublishedTabContent=JSON.parse(t))}getButtonByTopic(e){for(let t of this.buttonList){if(t.getTopic().substring(t.getTopic().lastIndexOf("/")+1)===e)return t}}getButton(e){for(let t of this.buttonList)if(t.getButtonId()===e)return t}setAppearance(e,t=!0){"HIDDEN"!==e&&"ENABLED"!==e||(this.appearance=e,this.messageBoxObject.appearance=e,this.publish(t))}getAppearance(){return this.appearance}setBackgroundColor(e,t=!0){this.messageBoxObject.backgroundColor=e,this.publish(t)}getBackgroundColor(){return this.messageBoxObject.backgroundColor}setIconColor(e,t=!0){this.messageBoxObject.iconColor=e,this.publish(t)}getIconColor(){
return this.messageBoxObject.iconColor}setType(e,t=!0){this.messageBoxObject.type=e,this.publish(t)}getType(){return this.messageBoxObject.type}setTitle(e,t=!0){this.messageBoxObject.title=e,this.publish(t)}getTitle(){return this.messageBoxObject.title}setTextsList(e,t=!0){this.messageBoxObject.textsList=e,this.publish(t)}getTextsList(){return this.messageBoxObject.textsList}getText(){return this.messageBoxObject.textsList[0]}getId(){return t.LOCKMESSAGEBOX_ID}hide(){this.appearance===i.EnumAppearance.ENABLED&&(this.setAppearance(i.EnumAppearance.HIDDEN),this.events$.next({type:r.ScreenEventType.HIDE_LOCKMESSAGEBOX,id:this.getId()}))}show(){this.appearance===i.EnumAppearance.HIDDEN&&(this.setAppearance(i.EnumAppearance.ENABLED),this.events$.next({type:r.ScreenEventType.SHOW_LOCKMESSAGEBOX,id:this.getId()}))}}t.LockMessageBox=E,t.default=E},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(0),i=a(43),n=a(4),r=a(1)
;t.LOCK_LOADING_OVERLAY_ID="LOCK_LOADING_MODAL";t.LockLoadingOverlay=class extends i.AbstractOverlay{setText(e){this.publishContent("TEXT",JSON.stringify(e))}show(){this.publishContent("APPEARANCE",'{ "appearance":"'+s.EnumAppearance.ENABLED+'" }'),this.events$.next({type:n.ScreenEventType.SHOW_LOCKLOADINGSCREEN,id:this.getId()})}hide(){this.publishContent("TEXT",""),this.publishContent("APPEARANCE",'{ "appearance":"'+s.EnumAppearance.HIDDEN+'" }'),this.events$.next({type:n.ScreenEventType.HIDE_LOCKLOADINGSCREEN,id:this.getId()})}getMqttTopicBase(){return r.MqttTopics.HMI_LOCK_LOADING_MODAL}getId(){return t.LOCK_LOADING_OVERLAY_ID}}},function(e,t){e.exports=require("net")},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PARAM_TITLE=40,t.PARAM_HEADER=8,t.USER_GUIDANCE=45,t.BUTTON_DISPLAY=8,t.BUTTON_APPL=8,t.PARAMLIST_TITLE=40,t.MSG_TITLE=25,t.MSG_DESCRIPTION=200,t.BUTTON_MSG=20,t.GROUP_PARAM_TITLE=25,t.PARAM_SELECTION=25,t.DETAIL_TITLE=25,
t.USER_INPUT_STRING_NAMES=50,t.LID_SID_USER_INPUT_STRING_VALUES=60},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(8),i=a(3),n=a(16),r=a(0);t.GROUP_1_ID="TASK/DYNAMIC_GROUP_1",t.GROUP_2_ID="TASK/DYNAMIC_GROUP_2",t.METHOD_PARAM_ID="TASK/DYNAMIC_GROUP_1/METHOD",function(e){e.INPUT="input",e.CALC="calculation"}(t.EnumMethodSelectionOptions||(t.EnumMethodSelectionOptions={})),t.REF_PIECE_COUNT_PARAM_ID="TASK/DYNAMIC_GROUP_1/REF_PIECE_COUNT",t.MIN_PIECE_COUNT="1",t.MAX_PIECE_COUNT="9999",t.REF_PIECE_WGT_PARAM_ID="TASK/DYNAMIC_GROUP_1/REF_PIECE_WGT",t.REF_PIECE_MIN_WGT=Math.pow(10,-1*(s.QUANTITY_PARAM_MAX_DIGITS_GENERAL-1)),t.REF_PIECE_WGT_UNIT_PARAM_ID="TASK/DYNAMIC_GROUP_1/REF_PIECE_WGT_UNIT",t.TARGET_PARAM_ID="TASK/DYNAMIC_GROUP_2/TARGET",t.TOL_MAX_PARAM_ID="TASK/DYNAMIC_GROUP_2/TOL_MAX",t.TOL_MIN_PARAM_ID="TASK/DYNAMIC_GROUP_2/TOL_MIN",t.DISPLAY_MODE_PARAM_ID="TASK/DYNAMIC_GROUP_2/DISPLAY_MODE",function(e){e.ABS_VALUE="ABS_VALUE",e.DIFF="DIFF"
}(t.EnumDisplayModeOptions||(t.EnumDisplayModeOptions={})),t.TAKE_OVER_PARAM_ID="TASK/DYNAMIC_GROUP_2/TAKE_OVER",function(e){e.ON="ON",e.OFF="OFF"}(t.EnumTakeOverOptions||(t.EnumTakeOverOptions={})),t.PORTS_PARAM_ID="TASK/DYNAMIC_GROUP_2/PORTS",function(e){e.NOT_ACTIVE="NOT_ACTIVE",e.CHECK_RANGE="CHECK_RANGE",e.ALWAYS_ON="ALWAYS_ON",e.STABLE_CHECK_RANGE="STABLE_CHECK_RANGE",e.AT_STABLE="AT_STABLE",e.STAB_CHECK_ONE_TIME="STAB_CHECK_ONE_TIME"}(t.EPortOptions||(t.EPortOptions={})),t.COUNTER_PARAM_ID="TASK/DYNAMIC_GROUP_2/COUNTER",function(e){e.ON="ON",e.OFF="OFF"}(t.EnumCounterOptions||(t.EnumCounterOptions={})),t.MIN_LOAD_PARAM_ID="TASK/DYNAMIC_GROUP_2/MIN_LOAD",function(e){e.TEN="TEN",e.TWENTY="TWENTY",e.FIFTY="FIFTY",e.HUNDRED="HUNDRED",e.TWO_HUNDRED="TWO_HUNDRED",e.FIVE_HUNDRED="FIVE_HUNDRED",e.THOUSAND="THOUSAND"}(t.EnumMinLoadSelectionOption||(t.EnumMinLoadSelectionOption={})),t.updateMinMax=function(e,t){
const a=n.convertWgtUnit(parseFloat(e.info.minimum.value),t,n.unitStringToLong(e.value.unit)),i=n.convertWgtUnit(parseFloat(e.info.maximum.value),t,n.unitStringToLong(e.value.unit));e.info.minimum.value=s.QuantityParameter.setValueValueWithDecimals(void 0,a,e.value.preferredDecimals),e.info.maximum.value=s.QuantityParameter.setValueValueWithDecimals(void 0,i,e.value.preferredDecimals)},t.getBlankPrintLine=function(){let e=i.createEmptyTextParameter();return e.id="BLANK",e.info.suppressTitle=!0,e.title.id=" ",e.header.id=" ",e.value.text.id=" ",e.appearance=r.EnumAppearance.ENABLED,e}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(24),i=a(83),n=a(23),r=a(0),o=a(13),l=a(32),E=a(12),_=a(11),u=a(80),c=a(9),A=a(15),p=a(35),d=a(2),T=a(3);t.IDENTIFIER_ASPECT="IDENTIFIER_ASPECT",t.STATE_ASPECT_IDENTIFIER_PREFIX="STATE_ASPECT_IDENTIFIER",t.STATE_ASPECT_IDENTIFIER_ENTER_LOT_INPUT=t.STATE_ASPECT_IDENTIFIER_PREFIX+"_ENTER_LOT_INPUT",
t.STATE_ASPECT_IDENTIFIER_ENTER_SID_INPUT=t.STATE_ASPECT_IDENTIFIER_PREFIX+"_ENTER_SID_INPUT";const I=t.STATE_ASPECT_IDENTIFIER_PREFIX+"_LOT_INPUT_DO",h=t.STATE_ASPECT_IDENTIFIER_PREFIX+"_SID_INPUT_DO";t.IDENTIFIER_MAX_LENGTH_LID_SID_VALUE=u.LID_SID_USER_INPUT_STRING_VALUES,t.IDENTIFIER_MAX_LENGTH_LID_SID_NUMBER_VALUE=15;const N=0,m="-1";t.BTN_ID_ASPECT_IDENTIFIER_AUTO_INC_DEC_WARNING_OK="BTN_ID_ASP_ID_A_INC_WARN_OK",t.BTN_ID_ASPECT_IDENTIFIER_AUTO_INC_DEC_WARNING_YES="BTN_ID_ASP_ID_A_INC_WARN_YES",t.BTN_ID_ASPECT_IDENTIFIER_AUTO_INC_DEC_WARNING_NO="BTN_ID_ASP_ID_A_INC_WARN_NO";const S="PARAM_ID_RT_LOT",R="PARAM_ID_RT_SID",P="PARAM_ID_RT_IDENTIFIER_INP";class g extends s.AbstractQAppAspect{constructor(){super(),this.states={STATE_ASPECT_IDENTIFIER_ENTER_LOT_INPUT:{_onEnter:function(e){let a=e.aspects[t.IDENTIFIER_ASPECT];a.inputIdx=0,a.evalLotInput()?(console.log("IdentifierAspect - at least one (more) LID configured"),e.addToEventQueue(new o.ImmediateEvent({
from:t.STATE_ASPECT_IDENTIFIER_ENTER_LOT_INPUT,to:I}))):(console.log("IdentifierAspect - no (further) LIDs configured"),e.addToEventQueue(new o.ImmediateEvent({from:t.STATE_ASPECT_IDENTIFIER_ENTER_LOT_INPUT,to:a.cfg.returnState})))},_onExit:function(e){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,a){a.payload.from===t.STATE_ASPECT_IDENTIFIER_ENTER_LOT_INPUT&&this.transition(e,a.payload.to)}},STATE_ASPECT_IDENTIFIER_LOT_INPUT_DO:{_onEnter:function(e){},_onExit:function(e){e.screens[i.KEYBOARD_SCREEN_ID].hide()},_transTo:{},_transFrom:{},EV_HMI_PARAM_CHANGED:function(e,a){console.log("IdentifierAspect - param change in STATE_ASPECT_IDENTIFIER_LOT_INPUT_DO");let s=e.aspects[t.IDENTIFIER_ASPECT];if(a.payload.parameter.id===P+s.inputIdx){let t=p.checkGeneralParamRules(a.payload.parameter),n=a.payload.parameter.value.string;void 0===t?(s.setLotID(s.inputIdx,n),s.inputIdx++,s.evalLotInput()||(console.log("IdentifierAspect - no (further) LIDs configured"),
this.transition(e,s.cfg.returnState))):(e.showMessageBox(t.message),s.sPIn_4_identifier.value.string=n,s.client.screens[i.KEYBOARD_SCREEN_ID].setParam(s.sPIn_4_identifier))}},EV_HMI_BTN_CLICKED:function(e,t){t.payload.buttonId===A.ParamUpdateUserActionSimpleAccept_OK_BUTTON_ID&&e.hideMsgBox()}},STATE_ASPECT_IDENTIFIER_ENTER_SID_INPUT:{_onEnter:function(e){let a=e.aspects[t.IDENTIFIER_ASPECT];a.inputIdx=0,a.evalSidInput()?(console.log("IdentifierAspect - at least one (more) SID configured"),e.addToEventQueue(new o.ImmediateEvent({from:t.STATE_ASPECT_IDENTIFIER_ENTER_SID_INPUT,to:h}))):(console.log("IdentifierAspect - no (further) SIDs configured"),e.addToEventQueue(new o.ImmediateEvent({from:t.STATE_ASPECT_IDENTIFIER_ENTER_SID_INPUT,to:a.cfg.returnState})))},_onExit:function(e){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,a){a.payload.from===t.STATE_ASPECT_IDENTIFIER_ENTER_SID_INPUT&&this.transition(e,a.payload.to)}},STATE_ASPECT_IDENTIFIER_SID_INPUT_DO:{
_onEnter:function(e){},_onExit:function(e){e.screens[i.KEYBOARD_SCREEN_ID].hide();let a=e.aspects[t.IDENTIFIER_ASPECT];a.cfg.autoRememberSIDs&&(a.sIDsPrevSample=a.sIDs)},_transTo:{},_transFrom:{},EV_HMI_PARAM_CHANGED:function(e,a){console.log("IdentifierAspect - param change in STATE_ASPECT_IDENTIFIER_SID_INPUT_DO");let s=e.aspects[t.IDENTIFIER_ASPECT];if(a.payload.parameter.id===P+s.inputIdx){let t=p.checkGeneralParamRules(a.payload.parameter),n=a.payload.parameter.value.string;if(void 0===t){s.setSID(s.inputIdx,n);let t=g.getSIDState(s.inputIdx,s.getTaskHandler());if(t===l.EnumSampleIdentifierOptions.ON_AUTO_INC||t===l.EnumSampleIdentifierOptions.ON_AUTO_DEC){let r=t===l.EnumSampleIdentifierOptions.ON_AUTO_INC,o=O(r,a.payload.parameter.value.string);o.success?this.transition(e,s.sIdInputDone()):(s.sPIn_4_identifier.value.string=n,s.client.screens[i.KEYBOARD_SCREEN_ID].setParam(s.sPIn_4_identifier),s.client.showMessageBox(M(r,o.result,!0)))}else this.transition(e,s.sIdInputDone())
}else e.showMessageBox(t.message),s.sPIn_4_identifier.value.string=n,s.client.screens[i.KEYBOARD_SCREEN_ID].setParam(s.sPIn_4_identifier)}},EV_HMI_BTN_CLICKED:function(e,a){let s=e.aspects[t.IDENTIFIER_ASPECT];a.payload.buttonId===t.BTN_ID_ASPECT_IDENTIFIER_AUTO_INC_DEC_WARNING_OK?(e.screens[i.KEYBOARD_SCREEN_ID].show(),e.hideMsgBox()):a.payload.buttonId===A.ParamUpdateUserActionSimpleAccept_OK_BUTTON_ID?e.hideMsgBox():a.payload.buttonId===t.BTN_ID_ASPECT_IDENTIFIER_AUTO_INC_DEC_WARNING_YES?(e.hideMsgBox(),this.transition(e,s.sIdInputDone())):a.payload.buttonId===t.BTN_ID_ASPECT_IDENTIFIER_AUTO_INC_DEC_WARNING_NO&&e.hideMsgBox()}}},this.sP_4_lotA=[],this.sP_4_sidA=[],this.lotIDs=[],this.sIDs=[],this.sIDsPrevSample=void 0,this.inputIdx=0,this.cfgGroupCnt=void 0,this.cfgGroupLID=void 0,this.cfgGroupSID=void 0,this.sPIn_4_identifier=T.createEmptyStringParameter()}getId(){return t.IDENTIFIER_ASPECT}getAspectStates(){return this.states}static getConfiguredLIDCount(e){
let t=e.getParameter(l.TASK_DYNAMIC_ID_LID_CNT_PARAM_ID);return void 0!==t?l.getConfiguredIds(t):0}static getConfiguredSIDCount(e){let t=e.getParameter(l.TASK_DYNAMIC_ID_SID_CNT_PARAM_ID);return void 0!==t?l.getConfiguredIds(t):0}static createLIDParams(e,a,s){let i=[],o=g.getConfiguredLIDCount(s);console.log("IdentifierAspect::createLIDParams: create params for "+o+" LIDs");for(let E=1;E<=o;E++){let o=s.getParameter(l.createLIDParamId(E,l.TASK_DYNAMIC_ID_LID_X_PARAM_ID_SUFFIX_TITLE)),_=s.getParameter(l.createLIDParamId(E,l.TASK_DYNAMIC_ID_LID_X_PARAM_ID_SUFFIX_HEADER)),u=T.createEmptyStringParameter();u.id=S+E+(e?"_"+e:""),u.appearance=r.EnumAppearance.HIDDEN,u.title={id:o.value.string,args:[]},u.header={id:_.value.string,args:[]},u.info={minimum:{length:0},maximum:{length:t.IDENTIFIER_MAX_LENGTH_LID_SID_VALUE}},i.push(new n.default(a,u))}return i}static createSIDParams(e,a,s){let i=[],o=g.getConfiguredSIDCount(s)
;console.log("IdentifierAspect::createSIDParams: create params for "+o+" SIDs");for(let E=1;E<=o;E++){let o=s.getParameter(l.createSIDParamId(E,l.TASK_DYNAMIC_ID_SID_X_PARAM_ID_SUFFIX_TITLE)),_=s.getParameter(l.createSIDParamId(E,l.TASK_DYNAMIC_ID_SID_X_PARAM_ID_SUFFIX_HEADER)),u=T.createEmptyStringParameter();u.id=R+E+(e?"_"+e:""),u.appearance=r.EnumAppearance.HIDDEN,u.title={id:o.value.string,args:[]},u.header={id:_.value.string,args:[]},u.info={minimum:{length:0},maximum:{length:t.IDENTIFIER_MAX_LENGTH_LID_SID_VALUE}},i.push(new n.default(a,u))}return i}init(e){if(this.client=e,this.client){if(console.log("IdentifierAspect::init"),!this.client.screens[i.KEYBOARD_SCREEN_ID]){let e=new i.KeyboardScreen(this.client.mqttHandler);this.client.registerScreen(e)}this.sPIn_4_identifier=T.createEmptyStringParameter(),this.sPIn_4_identifier.id=P,this.sPIn_4_identifier.appearance=r.EnumAppearance.ENABLED,this.sPIn_4_identifier.title={id:"",args:[]},this.sPIn_4_identifier.header={id:"",args:[]},
this.sPIn_4_identifier.info={isNoValueAllowed:!0,minimum:{length:0},maximum:{autoCut:!1,length:t.IDENTIFIER_MAX_LENGTH_LID_SID_VALUE}}}else console.log("IdentifierAspect::init - aspect not correctly initialized (no client set) - skip init")}configure(e){super.configure(e),void 0===this.cfg.showPreviouslySetLIDs&&(this.cfg.showPreviouslySetLIDs=!1);let t=this.getTaskHandler().getGroup(l.TASK_DYNAMIC_ID_CNT_GROUP_ID),a=this.getTaskHandler().getGroup(l.TASK_DYNAMIC_ID_LID_GROUP_ID),s=this.getTaskHandler().getGroup(l.TASK_DYNAMIC_ID_SID_GROUP_ID);console.log("IdentifierAspect::configure"),c.isEqual(this.cfgGroupCnt,t)&&c.isEqual(this.cfgGroupLID,a)&&c.isEqual(this.cfgGroupSID,s)?console.log("IdentifierAspect::configure: no content update of taskHandler - keep params for IDs"):(console.log("IdentifierAspect::configure: update of taskHandler - create params for IDs"),this.cfgGroupCnt=d.cloneJSON(t),this.cfgGroupLID=d.cloneJSON(a),this.cfgGroupSID=d.cloneJSON(s),
t&&a&&s&&(console.log("IdentifierAspect::configure - create LID params"),this.sP_4_lotA=g.createLIDParams("",this.client.mqttHandler,this.getTaskHandler()),this.sP_4_lotA.forEach(e=>{e.publish()}),console.log("IdentifierAspect::configure - create SID params"),this.sP_4_sidA=g.createSIDParams("",this.client.mqttHandler,this.getTaskHandler()),this.sP_4_sidA.forEach(e=>{e.publish()})))}getTaskHandler(){return this.cfg.taskHandler}getLotVisualParams(){return this.sP_4_lotA}getSIDVisualParams(){return this.sP_4_sidA}prepLotInput(e){this.client.screens[i.KEYBOARD_SCREEN_ID].hide(),this.sPIn_4_identifier.id=P+e,this.sPIn_4_identifier.title=this.sP_4_lotA[this.inputIdx].getValue().title,this.sPIn_4_identifier.header=this.sP_4_lotA[this.inputIdx].getValue().header,this.sPIn_4_identifier.info.maximum.length=t.IDENTIFIER_MAX_LENGTH_LID_SID_VALUE,this.cfg.showPreviouslySetLIDs?this.sPIn_4_identifier.value.string=void 0!==this.lotIDs[e]?this.lotIDs[e]:"":this.sPIn_4_identifier.value.string="",
console.log("IdentifierAspect::prepLotInput - prepare input of: "+JSON.stringify(this.sPIn_4_identifier.header)),this.client.screens[i.KEYBOARD_SCREEN_ID].setParam(this.sPIn_4_identifier),this.client.screens[i.KEYBOARD_SCREEN_ID].show()}prepSidInput(e,a,s){if(this.client.screens[i.KEYBOARD_SCREEN_ID].hide(),this.sPIn_4_identifier.id=P+e,this.sPIn_4_identifier.title=this.sP_4_sidA[e].getValue().title,this.sPIn_4_identifier.header=this.sP_4_sidA[e].getValue().header,this.sPIn_4_identifier.info.maximum.length=t.IDENTIFIER_MAX_LENGTH_LID_SID_VALUE,!a.length||0===a.length)switch(g.getSIDState(e,this.getTaskHandler())){case l.EnumSampleIdentifierOptions.ON_AUTO_INC:case l.EnumSampleIdentifierOptions.ON_AUTO_DEC:this.sPIn_4_identifier.info.maximum.length=t.IDENTIFIER_MAX_LENGTH_LID_SID_VALUE}this.sPIn_4_identifier.value.string=a,console.log("IdentifierAspect::prepSidInput - prepare input of: "+JSON.stringify(this.sPIn_4_identifier.header)),
this.client.screens[i.KEYBOARD_SCREEN_ID].setParam(this.sPIn_4_identifier),s&&this.client.screens[i.KEYBOARD_SCREEN_ID].show()}static updateAndPublishIDParamStatic(e,t){t&&t.length>0?(e.getValue().value.string=t,e.getValue().appearance=r.EnumAppearance.ENABLED):(e.getValue().value.string="",e.getValue().appearance=r.EnumAppearance.HIDDEN),e.publish()}static setLotIDsStatic(e,t){for(let a=0;a<t.length;a++)this.updateAndPublishIDParamStatic(t[a],e[a])}setLotIDs(e){this.lotIDs=e,g.setLotIDsStatic(this.lotIDs,this.sP_4_lotA)}setLotID(e,t){this.lotIDs[e]=t,g.updateAndPublishIDParamStatic(this.sP_4_lotA[e],this.lotIDs[e])}static setSIDsStatic(e,t){for(let a=0;a<t.length;a++)g.updateAndPublishIDParamStatic(t[a],e[a])}setSIDs(e,t){this.sIDs=e,this.cfg.autoRememberSIDs||(this.sIDsPrevSample=t),g.setSIDsStatic(this.sIDs,this.sP_4_sidA)}isPreviouSampleIdsPresent(){return void 0!==this.sIDsPrevSample&&void 0!==this.sIDsPrevSample[this.inputIdx]}setSID(e,t){this.sIDs[e]=t,
g.updateAndPublishIDParamStatic(this.sP_4_sidA[e],this.sIDs[e])}static getLotState(e,t){let a=l.EnumLotIdentifierOptions.OFF,s=t.getParameter(l.TASK_DYNAMIC_ID_LID_CNT_PARAM_ID);return e>=0&&e<l.getConfiguredIds(s)&&(a=l.EnumLotIdentifierOptions.ON),console.log("IdentifierAspect::getLotState for idx:"+e+" -> "+a),a}static getSIDState(e,t){let a=e+1,s=l.EnumSampleIdentifierOptions.OFF,i=t.getParameter(l.TASK_DYNAMIC_ID_SID_CNT_PARAM_ID);return e>=0&&e<l.getConfiguredIds(i)&&(s=t.getParameter(l.createSIDParamId(a,l.TASK_DYNAMIC_ID_SID_X_PARAM_ID_SUFFIX_MODE)).value.selection.id),s}static getIdxFirstEnabledSID(e){let t=e.getParameter(l.TASK_DYNAMIC_ID_SID_CNT_PARAM_ID);return l.getConfiguredIds(t)>0?0:NaN}evalLotInput(){let e=this.getTaskHandler().getParameter(l.TASK_DYNAMIC_ID_LID_CNT_PARAM_ID);for(let t=this.inputIdx;t<l.getConfiguredIds(e);t++)return this.inputIdx=t,this.prepLotInput(this.inputIdx),!0;return!1}evalSidInput(){console.log("IdentifierAspect - evalSidInput")
;let e=this.getTaskHandler().getParameter(l.TASK_DYNAMIC_ID_SID_CNT_PARAM_ID);for(let t=this.inputIdx;t<l.getConfiguredIds(e);t++){console.log("IdentifierAspect - evalSidInput: loop:"+t);let e=g.getSIDState(t,this.getTaskHandler());if(e===l.EnumSampleIdentifierOptions.ON)return console.log("IdentifierAspect - request input for SID idx:"+t),this.inputIdx=t,this.prepSidInput(this.inputIdx,this.sIDsPrevSample&&this.sIDsPrevSample[this.inputIdx]?this.sIDsPrevSample[this.inputIdx]:"",!0),!0;if(e===l.EnumSampleIdentifierOptions.ON_AUTO_INC||e===l.EnumSampleIdentifierOptions.ON_AUTO_DEC){this.inputIdx=t;let a=e===l.EnumSampleIdentifierOptions.ON_AUTO_INC;if(this.sIDsPrevSample&&void 0!==this.sIDsPrevSample[this.inputIdx]){console.log("IdentifierAspect - AutoInc/Dec for SID idx:"+this.inputIdx);let e=O(a,this.sIDsPrevSample[this.inputIdx]);return e.success?this.prepSidInput(this.inputIdx,e.result,!0):(console.log("IdentifierAspect - AutoInc/Dec failed show warning for SID idx:"+this.inputIdx),
this.prepSidInput(this.inputIdx,this.sIDsPrevSample[this.inputIdx],!1),this.client.showMessageBox(M(a,e.result))),!0}return console.log("IdentifierAspect - AutoInc/Dec, but first sample -> request input for SID idx:"+this.inputIdx),this.prepSidInput(this.inputIdx,"",!0),!0}}return!1}resetSIDsPrevSample(){this.sIDsPrevSample=void 0}sIdInputDone(){let e="";return console.log("IdentifierAspect - sIdInputDone"),this.inputIdx++,this.evalSidInput()?console.log("IdentifierAspect - at least one more SIDs configured"):(console.log("IdentifierAspect - no (further) SIDs configured"),e=this.cfg.returnState),e}}var D;function O(e,a,s=t.IDENTIFIER_MAX_LENGTH_LID_SID_VALUE){console.log("IdentifierAspect - AutoInc/Dec, not first sample > check for number");let i=a.match("^\\d*$");if(i&&void 0!==i[0]){let a;if(console.log("IdentifierAspect - AutoInc, not first sample > inc number"),""===i[0]){if(a=0,!e)return{success:!1,result:{id:D.NONUMBERFOUND,args:[]}}}else{
if(i[0].length>t.IDENTIFIER_MAX_LENGTH_LID_SID_NUMBER_VALUE)return{success:!1,result:{id:D.NUMBERTOOLARGE,args:[]}};a=parseInt(i[0],10)}if(e)a++;else{if(!(a>N))return{success:!1,result:{id:D.LOWERBOUNDARY,args:[]}};a--}let n=a.toFixed(0);return n.length>s?{success:!1,result:{id:D.SIDTOOLARGE,args:[s.toString()]}}:{success:!0,result:n}}{let i=a.match("(.*[\\-_.#\\s])(\\d*)$");if(i&&void 0!==i[2]){let a;if(console.log("IdentifierAspect - AutoInc/Dec, not first sample > inc/dec suffix"),""===i[2]){if(a=0,!e)return{success:!1,result:{id:D.NONUMBERFOUND,args:[]}}}else{if(i[2].length>t.IDENTIFIER_MAX_LENGTH_LID_SID_NUMBER_VALUE)return{success:!1,result:{id:D.NUMBERTOOLARGE,args:[]}};a=parseInt(i[2],10)}if(e)a++;else{if(!(a>N))return{success:!1,result:{id:D.LOWERBOUNDARY,args:[]}};a--}let n=i[1]+a.toFixed();return n.length>s?{success:!1,result:{id:D.SIDTOOLARGE,args:[s.toString()]}}:{success:!0,result:n}}if(console.log("IdentifierAspect - AutoInc, not first sample > add suffix"),e){let e=a+m
;return e.length>s?{success:!1,result:{id:D.SIDTOOLARGE,args:[s.toString()]}}:{success:!0,result:e}}return{success:!1,result:{id:D.NOSEPARATORFOUND,args:[]}}}}function M(e,a,s=!1){let i=[],n=[];return e?s?i.push({id:"_QAPP_LIB_MBOX_TEXT_IDENTIFIER_AUTO_INC_WARNING_FOR_NEXT_SID",args:[]}):i.push({id:"_QAPP_LIB_MBOX_TEXT_IDENTIFIER_AUTO_INC_WARNING",args:[]}):s?i.push({id:"_QAPP_LIB_MBOX_TEXT_IDENTIFIER_AUTO_DEC_WARNING_FOR_NEXT_SID",args:[]}):i.push({id:"_QAPP_LIB_MBOX_TEXT_IDENTIFIER_AUTO_DEC_WARNING",args:[]}),i.push(a),s&&i.push({id:"_QAPP_LIB_MBOX_TEXT_IDENTIFIER_AUTO_INC_DEC_WARNING_CONTINUE",args:[]}),n=s?[{id:t.BTN_ID_ASPECT_IDENTIFIER_AUTO_INC_DEC_WARNING_YES,label:{id:"_QAPP_LIB_MBOX_BTN_YES",args:[]},appearance:r.EnumAppearance.ENABLED_SECONDARY},{id:t.BTN_ID_ASPECT_IDENTIFIER_AUTO_INC_DEC_WARNING_NO,label:{id:"_QAPP_LIB_MBOX_BTN_NO",args:[]},appearance:r.EnumAppearance.ENABLED_SECONDARY}]:[{id:t.BTN_ID_ASPECT_IDENTIFIER_AUTO_INC_DEC_WARNING_OK,label:{id:E.EnumFontLabels.OK,
args:[]},appearance:r.EnumAppearance.ENABLED_SECONDARY}],{type:_.EnumMessageboxType.WARNING,title:{id:"_QAPP_LIB_MBOX_TITLE_IDENTIFIER_AUTO_INC_DEC_WARNING",args:[]},textList:i,buttons:n}}t.IdentifierAspect=g,function(e){e.NUMBERTOOLARGE="_QAPP_LIB_MBOX_TEXT_IDENTIFIER_AUTO_INC_DEC_WARNING_NO_TOO_LARGE",e.LOWERBOUNDARY="_QAPP_LIB_MBOX_TEXT_IDENTIFIER_AUTO_DEC_WARNING_LOWER_BOUNDARY",e.SIDTOOLARGE="_QAPP_LIB_MBOX_TEXT_IDENTIFIER_AUTO_INC_DEC_WARNING_SID_TOO_LARGE",e.NOSEPARATORFOUND="_QAPP_LIB_MBOX_TEXT_IDENTIFIER_AUTO_DEC_WARNING_NO_SEPARATOR_FOUND",e.NONUMBERFOUND="_QAPP_LIB_MBOX_TEXT_IDENTIFIER_AUTO_DEC_WARNING_NO_NUMBER_FOUND"}(D=t.IncreaseDecreaseFailEnum||(t.IncreaseDecreaseFailEnum={})),t.increaseDecreaseId=O,t.getWarningNoIdChange=M},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(0),i=a(3),n=a(9),r=a(4),o=a(7),l=a(1);t.KEYBOARD_SCREEN_ID="PARAMETER_INPUT";t.KeyboardScreen=class{constructor(e,t){this.keyboardObject={
appearance:s.EnumAppearance.HIDDEN,param:{}},this.events$=new o.Subject,t?(this.keyboardParam=i.createEmptySelectionParameter(),this.keyboardParam.appearance=s.EnumAppearance.HIDDEN):(this.keyboardParam=i.createEmptyStringParameter(),this.keyboardParam.appearance=s.EnumAppearance.HIDDEN),this.keyboardObject.param=this.keyboardParam,this.mqttHandler=e}setAppearance(e){this.keyboardObject.appearance!==e&&(e!==s.EnumAppearance.HIDDEN&&e!==s.EnumAppearance.ENABLED||(this.keyboardObject.appearance=e,this.mqttHandler.publish(l.MqttTopics.HMI_QAPP_PARAMETER_INPUT,JSON.stringify(this.keyboardObject))))}getAppearance(){return this.keyboardObject.appearance}publishIfEnabled(){this.keyboardObject.appearance===s.EnumAppearance.ENABLED&&this.mqttHandler.publish(l.MqttTopics.HMI_QAPP_PARAMETER_INPUT,JSON.stringify(this.keyboardObject))}setParamId(e){this.keyboardObject.param.id!==e&&(this.keyboardObject.param.id=e,this.publishIfEnabled())}getParamId(){return this.keyboardObject.param.id}
setParamType(e){this.keyboardObject.param.type!==e&&(this.keyboardObject.param.type=e,this.publishIfEnabled())}getParamType(){return this.keyboardObject.param.type}setParamAppearance(e){this.keyboardObject.param.appearance=e,this.publishIfEnabled()}getParamAppearance(){return this.keyboardObject.param.appearance}checkTextStructEqual(e,t){let a=!0;return e.id!==t.id&&(a=!1),e.args.join()!==t.args.join()&&(a=!1),a}setParamTitle(e){this.checkTextStructEqual(e,this.keyboardObject.param.title)||(this.keyboardObject.param.title=e,this.publishIfEnabled())}getParamTitle(){return this.keyboardObject.param.title}setParamHeader(e){this.checkTextStructEqual(e,this.keyboardObject.param.header)||(this.keyboardObject.param.header=e,this.publishIfEnabled())}getParamHeader(){return this.keyboardObject.param.header}setParam(e){n.isEqual(this.keyboardObject.param,e)||(this.keyboardObject.param=e,this.publishIfEnabled())}getParam(){return this.keyboardObject.param}getId(){return t.KEYBOARD_SCREEN_ID}
getButton(e){}hide(){this.keyboardObject.appearance===s.EnumAppearance.ENABLED&&(this.setAppearance(s.EnumAppearance.HIDDEN),this.events$.next({type:r.ScreenEventType.HIDE_OVERLAY,id:this.getId()}))}show(){this.keyboardObject.appearance===s.EnumAppearance.HIDDEN&&(this.setAppearance(s.EnumAppearance.ENABLED),this.events$.next({type:r.ScreenEventType.SHOW_OVERLAY,id:this.getId()}))}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(0),i=a(13),n=a(24),r=a(11),o=a(83),l=a(3);t.INVAL_SAMPLE_ASPECT="INVAL_SAMPLE_ASPECT",t.STATE_ASPECT_INVAL_SAMPLE_ENTER="STATE_ASPECT_INVAL_SAMPLE_ENTER",t.STATE_ASPECT_INVAL_SAMPLE_REASON="STATE_ASPECT_INVAL_SAMPLE_REASON";const E="BTN_INVAL_YES",_="BTN_INVAL_DONT";t.PARAM_ID_RT_INVAL_REASON_INP="PARAM_ID_RT_INVAL_REASON_INP";class u extends n.AbstractQAppAspect{constructor(){super(),this.states={STATE_ASPECT_INVAL_SAMPLE_ENTER:{_onEnter:function(e){let a=e.aspects[t.INVAL_SAMPLE_ASPECT]
;void 0!==a.cfg.sample&&a.cfg.sample.valid?e.showMessageBox({type:r.EnumMessageboxType.QUESTION,title:{id:"",args:[]},textList:[{id:"_QAPP_LIB_MSG_BOX_QUESTION_INVALIDATE_TEXT",args:[a.cfg.sample.sampleNo.toString()]}],buttons:[{id:E,label:{id:"_QAPP_LIB_MBOX_BTN_YES",args:[]},appearance:s.EnumAppearance.ENABLED_SECONDARY},{id:_,label:{id:"_QAPP_LIB_MBOX_BTN_NO",args:[]},appearance:s.EnumAppearance.ENABLED_SECONDARY}]}):e.addToEventQueue(new i.ImmediateEvent({from:t.STATE_ASPECT_INVAL_SAMPLE_ENTER,to:a.cfg.exitState}))},_onExit:function(e){e.hideMsgBox()},_transTo:{},_transFrom:{},EV_HMI_BTN_CLICKED:function(e,a){let s=e.aspects[t.INVAL_SAMPLE_ASPECT];a.payload.buttonId===_?this.transition(e,s.cfg.exitState):a.payload.buttonId===E&&(void 0!==s.cfg.sample&&(s.cfg.sample.valid=!1),this.transition(e,t.STATE_ASPECT_INVAL_SAMPLE_REASON))},IMMEDIATE_EVENT:function(e,a){a.payload.from&&a.payload.from===t.STATE_ASPECT_INVAL_SAMPLE_ENTER&&this.transition(e,a.payload.to)}},
STATE_ASPECT_INVAL_SAMPLE_REASON:{_onEnter:function(e){e.screens[o.KEYBOARD_SCREEN_ID].hide();let a=e.aspects[t.INVAL_SAMPLE_ASPECT];e.screens[o.KEYBOARD_SCREEN_ID].setParam(a.sP_4_InvalReason),e.screens[o.KEYBOARD_SCREEN_ID].show()},_onExit:function(e){e.screens[o.KEYBOARD_SCREEN_ID].hide()},_transTo:{},_transFrom:{},EV_HMI_PARAM_CHANGED:function(e,a){console.log("InvalidateSampleAspect - param change in STATE_ASPECT_INVAL_SAMPLE_REASON");let s=e.aspects[t.INVAL_SAMPLE_ASPECT];if(a.payload.parameter.id===t.PARAM_ID_RT_INVAL_REASON_INP){let t=s.cfg.sample;void 0!==t&&(t.invalidationReason=a.payload.parameter.value.string,void 0===s.cfg.samplePrintItemId||isNaN(s.cfg.samplePrintItemId)||e.reportingProxy.setRedactionStatus(s.cfg.samplePrintItemId,!0,t.invalidationReason),void 0!==s.cfg.dependentPrintItemIds&&s.cfg.dependentPrintItemIds.forEach(a=>{e.reportingProxy.setRedactionStatus(a,!0,t.invalidationReason)})),this.transition(e,s.cfg.exitState)}}}},
this.sP_4_InvalReason=u.createInvalidReasonParam(t.PARAM_ID_RT_INVAL_REASON_INP)}static createInvalidReasonParam(e){let t=l.createEmptyStringParameter();return t.id=e,t.title={id:"_QAPP_LIB_PARAM_TITLE_RT_INVAL_REASON",args:[]},t.header={id:"_QAPP_LIB_PARAM_HEADER_RT_INVAL_REASON",args:[]},t}updateCfgSampleOnly(e){this.cfg=Object.assign(this.cfg,e)}getId(){return t.INVAL_SAMPLE_ASPECT}getAspectStates(){return this.states}init(e){if(this.client=e,this.client){if(console.log("InvalidateSampleAspect::init"),!this.client.screens[o.KEYBOARD_SCREEN_ID]){let e=new o.KeyboardScreen(this.client.mqttHandler);this.client.registerScreen(e)}}else console.log("InvalidateSampleAspect::init - aspect not correctly initialized (no client set) - skip init")}}t.InvalidateSampleAspect=u},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(2),i=a(0);t.PARAM_ID_SAMPLE_NO="QAPP_LIB_SAMPLE_NO";const n={id:t.PARAM_ID_SAMPLE_NO,type:i.EnumParameterTypes.PARAM_STRING,value:{
string:""},header:{id:"_QAPP_LIB_PARAM_HEADER_SAMPLE_NO",args:[]},title:{id:"_QAPP_LIB_PARAM_TITLE_SAMPLE_NO",args:[]},appearance:i.EnumAppearance.HIDDEN,info:{minimum:{length:0},maximum:{length:0}}};function r(){return s.cloneJSON(n)}t.getSampleNumberStringParameter=r,t.createSampleNumberStringParameter=function(e){let t=s.cloneJSON(r());return t.id=e,t},t.PARAM_ID_SAMPLE_DATE="QAPP_LIB_SAMPLE_DATE";const o={id:t.PARAM_ID_SAMPLE_DATE,type:i.EnumParameterTypes.PARAM_DATE_TIME,value:{timestamp:0},header:{id:"_QAPP_LIB_PARAM_HEADER_SAMPLE_DATETIME",args:[]},title:{id:"_QAPP_LIB_PARAM_TITLE_SAMPLE_DATETIME",args:[]},appearance:i.EnumAppearance.HIDDEN,info:{isTime:!0,isDate:!0}};function l(){return s.cloneJSON(o)}t.getSampleDateDTParameter=l,t.createSampleDateDTParameter=function(e){let t=s.cloneJSON(l());return t.id=e,t}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0})
;const s=a(98),i=a(100),n=a(101),r=a(20),o=a(102),l=a(103),E="SCREENS/",_="/TABLIST",u="/REQUESTEDTAB",c="/QAPP/";class A{constructor(e,t){this.tabScreenTablistObject=[],this.tabScreenRequestedObject="",this.tabList=[],this.mqttHandler=e,this.screenId=t,this.tabScreenTopic=E+this.screenId,this.tabScreenTablistTopic=this.tabScreenTopic+_,this.tabScreenRequestedTopic=this.tabScreenTopic+u}publishTabList(){this.mqttHandler.publish(this.tabScreenTablistTopic,JSON.stringify(this.tabScreenTablistObject))}publishRequestedTab(){this.mqttHandler.publish(this.tabScreenRequestedTopic,JSON.stringify(this.tabScreenRequestedObject))}static createFigureTab(e,t,a,i,n){return a.topbuttons=void 0!==n?A.sortTopButtons(n):a.topbuttons,new s.TabFigure(a,e,t,i)}addFigureTab(e,t,a){t.id=e;let s=A.createFigureTab(this.mqttHandler,this.screenId,t,!1,a);return this.tabScreenTablistObject.push(c+s.publishId()),this.tabList.push(s),s}static createGraphTab(e,t,a,s,n){
return a.topbuttons=void 0!==n?A.sortTopButtons(n):a.topbuttons,new i.TabGraph(a,e,t,s)}addGraphTab(e,t,a){t.id=e;let s=A.createGraphTab(this.mqttHandler,this.screenId,t,!1,a);return this.tabScreenTablistObject.push(c+s.publishId()),this.tabList.push(s),s}static createParamListTab(e,t,a,s,i){return a.topbuttons=void 0!==i?A.sortTopButtons(i):a.topbuttons,new n.TabParamList(a,e,t,s)}addParamListTab(e,t,a){t.id=e;let s=A.createParamListTab(this.mqttHandler,this.screenId,t,!1,a);return this.tabScreenTablistObject.push(c+s.publishId()),this.tabList.push(s),s}static createMenuTab(e,t,a,s,i){return a.topbuttons=void 0!==i?A.sortTopButtons(i):a.topbuttons,new o.TabMenu(a,e,t,s)}static createTableTab(e,t,a,s,i){return a.topbuttons=void 0!==i?A.sortTopButtons(i):a.topbuttons,new l.TabTable(a,e,t,s)}addMenuTab(e,t,a){t.id=e;let s=A.createMenuTab(this.mqttHandler,this.screenId,t,!1,a);return this.tabScreenTablistObject.push(c+s.publishId()),this.tabList.push(s),s}addTableTab(e,t,a){t.id=e
;let s=A.createTableTab(this.mqttHandler,this.screenId,t,!1,a);return this.tabScreenTablistObject.push(c+s.publishId()),this.tabList.push(s),s}getTab(e){let t=void 0;for(let a of this.tabList)a.getTabId()===e&&(t=a);return t}getTabList(){return this.tabList}clearTabList(){this.tabList.splice(0,this.tabList.length),this.tabScreenTablistObject.splice(0,this.tabScreenTablistObject.length)}requestTab(e){void 0!==this.getTab(e)&&(this.tabScreenRequestedObject=e,this.publishRequestedTab())}static sortTopButtons(e){return e.sort((e,t)=>r.getButtonPriority(e.getButtonId())-r.getButtonPriority(t.getButtonId())).map(e=>`/QAPP/${e.getTopic()}`)}}t.TabApi=A},,,,,,,function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0})
;const s=a(15),i=a(94),n=a(97),r=a(104),o=a(105),l=a(40),E=a(13),_=a(81),u=a(20),c=a(10),A=a(19),p=a(23),d=a(108),T=a(84),I=a(8),h=a(109),N=a(82),m=a(85),S=a(16),R=a(52),P=a(110),g=a(33),D=a(50),O=a(2),M=a(112),C=a(11),L=a(14),f=a(47),b=a(0),v=a(3),B=a(1),y="CALCULATED_VALUE_DISPLAY_ID",G="CHECK_VALUE_DISPLAY_ID",U="WEIGHING/WEIGHT/NET",H="/QAPP/WEIGHING/WEIGHT/APPLICATION/"+y+"/VALUE",x="/QAPP/WEIGHING/WEIGHT/APPLICATION/"+G+"/VALUE",F="05_Counting_InitCount.png",V="05_Counting_SampleCount.png",k="05_Statistics_RemoveSample.png",w="05_Counting_Tare.png",Q=100,W=10,Y={LL:"LL",OK:"OK",HH:"HH"
},q="RT_SAMPLE_COUNT",K="RT_SAMPLE_WGT",j="RT_SAMPLE_INVAL_REASON",X="RT_CHECKT_RES_PARAM",J="RT_COUNTER_LOW",$="RT_COUNTER_OK",z="RT_COUNTER_HIGH",Z="RT_NUM_OF_COUNTER",ee="WG_SPLIT_ICON_TAB",te="WG_SPLIT_COUNTER_CHART_TAB",ae="TABS_EVAL_SAMPLE",se="TABS_EVAL_COUNTER_CHART",ie="BTN_CUSTOM_SUSPEND_QUESTION_YES",ne="BTN_CUSTOM_SUSPEND_QUESTION_NO",re="BTN_CUSTOM_LOGOUT_QUESTION_YES",oe="BTN_CUSTOM_LOGOUT_QUESTION_NO",le="BTN_CUSTOM_RESTART_QUESTION_YES",Ee="BTN_CUSTOM_RESTART_QUESTION_NO",_e="STATE_INIT_INPUT_WEIGHT",ue="STATE_INIT_CALC_WEIGHT",ce="STATE_TAKE_SAMPLE_DOWN",Ae="STATE_ACTIVE",pe="STATE_EVALUATION",de="STATE_MAX_SAMPLES_REACHED",Te="IMMEDIATE_STATE_GET_METHOD",Ie="IMMEDIATE_STATE_MEASURE_WREF",he="IMMEDIATE_STATE_STORE_SAMPLE",Ne="IMMEDIATE_RESUME_AFTER_INIT",me="TOGGLE_PARAMS_INDICATOR";let Se={STATE_INIT_INPUT_WEIGHT:{_onEnter:function(e){e.InitStateInputWeight()},_onExit:function(e){e.weighingProxy.setButton(l.WEIGHING_BUTTON_DO_TARE,b.EnumAppearance.ENABLED_SECONDARY)},
_transTo:{},_transFrom:{},EV_HMI_BTN_CLICKED:function(e,t){e.checkForHomeLogout(t.payload.buttonId)||t.payload.buttonId===u.BTN_START_ID&&(e.addRefParametersToPQ(),this.transition(e,Ae))}},STATE_INIT_CALC_WEIGHT:{_onEnter:function(e){e.InitStateCalcWeight()},_onExit:function(e){e.weighingProxy.setButton(l.WEIGHING_BUTTON_DO_TARE,b.EnumAppearance.ENABLED_SECONDARY)},_transTo:{},_transFrom:{},EV_HMI_BTN_CLICKED:function(e,t){e.checkForHomeLogout(t.payload.buttonId)||t.payload.buttonId===u.BTN_START_ID&&this.transition(e,d.STATE_ASPECT_WAITING_FOR_STABILITY)},EV_MQTT_UPDATE:function(e,t){t.payload.topic===U&&e.ExecCmdEnDisableStartBtn(JSON.parse(t.payload.value.toString()))}},STATE_TAKE_SAMPLE_DOWN:{_onEnter:function(e){e.InitStateTakeSampleDown()},_onExit:function(e){},_transTo:{STATE_ACTIVE:function(e,t){e.addNewSample=!0}},_transFrom:{IMMEDIATE_STATE_MEASURE_WREF:function(e,t){e.weighingProxy.createWeightApplication(y,{id:"_QAPP_WF_CNT_PARAM_PIECE_COUNT_TITLE",args:[]},{
id:"_QAPP_WF_CNT_PARAM_PIECE_COUNT_HEADER",args:[]},!0,!0),e.weighingProxy.createWeightApplication(G,{id:"_QAPP_WF_RT_PARAM_CHECK_TITLE",args:[]},{id:"_QAPP_WF_RT_PARAM_CHECK_HEADER",args:[]},!0,!0)},IMMEDIATE_RESUME_AFTER_INIT:function(e,t){e.weighingProxy.createWeightApplication(y,{id:"_QAPP_WF_CNT_PARAM_PIECE_COUNT_TITLE",args:[]},{id:"_QAPP_WF_CNT_PARAM_PIECE_COUNT_HEADER",args:[]},!0,!0),e.weighingProxy.createWeightApplication(G,{id:"_QAPP_WF_RT_PARAM_CHECK_TITLE",args:[]},{id:"_QAPP_WF_RT_PARAM_CHECK_HEADER",args:[]},!0,!0)}},EV_HMI_BTN_CLICKED:function(e,t){e.checkForHomeLogout(t.payload.buttonId)||t.payload.buttonId===u.BTN_EVAL_ID&&this.transition(e,e.ExecCmdEvalScreen())},EV_MQTT_UPDATE:function(e,t){t.payload.topic===U&&this.transition(e,e.ExecCmdSTATE_TAKE_SAMPLE_DOWN(JSON.parse(t.payload.value.toString())))},QAPP_INTERVAL_EVENT:function(e,t){t.payload===me&&e.toggleWSSParams()}},STATE_ACTIVE:{_onEnter:function(e){e.InitStateActive()},_onExit:function(e){},_transTo:{},
_transFrom:{STATE_INIT_INPUT_WEIGHT:function(e,t){e.weighingProxy.createWeightApplication(y,{id:"_QAPP_WF_CNT_PARAM_PIECE_COUNT_TITLE",args:[]},{id:"_QAPP_WF_CNT_PARAM_PIECE_COUNT_HEADER",args:[]},!0,!0),e.weighingProxy.createWeightApplication(G,{id:"_QAPP_WF_RT_PARAM_CHECK_TITLE",args:[]},{id:"_QAPP_WF_RT_PARAM_CHECK_HEADER",args:[]},!0,!0),e.saveWorkstate()}},EV_HMI_BTN_CLICKED:function(e,t){e.checkForHomeLogout(t.payload.buttonId)||(t.payload.buttonId===u.BTN_PRINTADD_ID?this.transition(e,e.ExecCmdWaitingForStability()):t.payload.buttonId===u.BTN_EVAL_ID&&this.transition(e,e.ExecCmdEvalScreen()))},EV_MQTT_UPDATE:function(e,t){t.payload.topic===U&&this.transition(e,e.ExecCmdCalcCount(JSON.parse(t.payload.value.toString())))},QAPP_INTERVAL_EVENT:function(e,t){t.payload===me&&e.toggleWSSParams()},QAPP_SYNC_CALL_DONE_EVENT:function(e,t){t.payload===E.QAPP_SYNC_CALL_DONE_EVENT_TYPE.SYNC_CALL_SAVE_WORKSTATE&&e.hideLoadingScreen()}},STATE_EVALUATION:{_onEnter:function(e){
e.initStateEvaluation()},_onExit:function(e){e.getTS().hide()},_transTo:{},_transFrom:{STATE_ACTIVE:function(e){e.evaluationBackState=Ae},STATE_TAKE_SAMPLE_DOWN:function(e){e.evaluationBackState=ce},STATE_INIT_CALC_WEIGHT:function(e){e.evaluationBackState=ue},STATE_INIT_INPUT_WEIGHT:function(e){e.evaluationBackState=_e},STATE_ASPECT_INVAL_SAMPLE_REASON:function(e){e.handlePossiblyInvalidSample(!1)}},EV_HMI_BTN_CLICKED:function(e,t){e.checkForHomeLogout(t.payload.buttonId)||(t.payload.buttonId.startsWith(n.BACK_BUTTON_ID_PREFIX)?this.transition(e,e.ExecBackSTATE_EVALUATION()):t.payload.buttonId===u.BTN_INVALIDATE_SAMPLE_ID&&this.transition(e,e.ExecCmdInvalidate()))},QAPP_SYNC_CALL_DONE_EVENT:function(e,t){t.payload===E.QAPP_SYNC_CALL_DONE_EVENT_TYPE.SYNC_CALL_SAVE_WORKSTATE&&e.hideLoadingScreen()}},STATE_MAX_SAMPLES_REACHED:{_onEnter:function(e){e.initStateMaxSamplesReached()},_onExit:function(e){},_transTo:{},_transFrom:{},EV_HMI_BTN_CLICKED:function(e,t){
e.checkForHomeLogout(t.payload.buttonId)||t.payload.buttonId===u.BTN_EVAL_ID&&this.transition(e,e.ExecCmdEvalScreen())},EV_MQTT_UPDATE:function(e,t){t.payload.topic===U&&e.updateCheckBarGraphAndCalculateCount(JSON.parse(t.payload.value.toString()))},QAPP_INTERVAL_EVENT:function(e,t){t.payload===me&&e.toggleWSSParams()}},IMMEDIATE_STATE_STORE_SAMPLE:{_onEnter:function(e){e.addToEventQueue(new E.ImmediateEvent(he))},_onExit:function(e){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,t){t.payload===he&&e.ExecImmediateSTATE_STORE_SAMPLE()},QAPP_SYNC_CALL_DONE_EVENT:function(e,t){t.payload===E.QAPP_SYNC_CALL_DONE_EVENT_TYPE.SYNC_CALL_SAVE_WORKSTATE&&this.transition(e,e.ExecCmdSyncCallDoneStoreSample())}},IMMEDIATE_STATE_GET_METHOD:{_onEnter:function(e){e.addToEventQueue(new E.ImmediateEvent(Te))},_onExit:function(e){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,t){t.payload===Te&&this.transition(e,e.ExecImmediateSTATE_GET_METHOD())}},IMMEDIATE_RESUME_AFTER_INIT:{
_onEnter:function(e){e.addToEventQueue(new E.ImmediateEvent(Ne))},_onExit:function(e){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,t){t.payload===Ne&&this.transition(e,e.ExecImmediateRESUME_AFTER_INIT())}},IMMEDIATE_STATE_MEASURE_WREF:{_onEnter:function(e){e.addToEventQueue(new E.ImmediateEvent(Ie))},_onExit:function(e){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,t){t.payload===Ie&&this.transition(e,e.ExecImmediateSTATE_MEASURE_WREF())},QAPP_SYNC_CALL_DONE_EVENT:function(e,t){t.payload===E.QAPP_SYNC_CALL_DONE_EVENT_TYPE.SYNC_CALL_SAVE_WORKSTATE&&(e.hideLoadingScreen(),this.transition(e,ce))}}};class Re extends i.QAppAdvBase{constructor(){super(!0),this.measureWRefConfig={mode:d.WaitingForStabilityModeEnum.WaitStableModeWeighing,isWeightValueValid:e=>this.isStableWeightValueValid(e,W),exitStateNoStability:ue,exitStateNotValid:ue,nextState:Ie},this.activeConfig=(e=>({mode:d.WaitingForStabilityModeEnum.WaitStableModeReporting,
isWeightValueValid:e=>this.isStableWeightValueValid(e,this.minLoad,!0),handleMqttEvent:e=>{e.payload.topic===U&&this.updateCheckBarGraphAndCalculateCount(JSON.parse(e.payload.value.toString()))},exitStateNoStability:Ae,exitStateNotValid:Ae,nextState:N.STATE_ASPECT_IDENTIFIER_ENTER_SID_INPUT,comment:e})),this.countingMethod=_.EnumMethodSelectionOptions.CALC,this.counterChart=new P.CheckweighingCounterChart,this.counterResultPrinted=!1,this.portSelection=_.EPortOptions.NOT_ACTIVE,this.lastCheckArea=0,this.lastTowerStatus="off",this.stableValueMeasured=!1,this.autoTakeOver=!1,this.minLoad=10,this.counterIsOn=!0,this.displayMode=_.EnumDisplayModeOptions.ABS_VALUE,this.maxSampleReached=!1,this.evaluationBackState=Ae,this.addNewSample=!0,this.lastWSSParamDisplayed=G,this.wssParamsIntervalId=void 0,this.sampleTranslation="",this.Metrology={unit:"",decimals:0,d:0,e:0,max:0,min:0},this.stabilityAspect=new d.WaitingStabilityAspect,this.invalidationAspect=new T.InvalidateSampleAspect,
this.registerAspect(this.stabilityAspect),this.registerAspect(this.invalidationAspect),this.suppressGlobalRestartBtnHandling=!0,this.suppressGlobalHomeBtnHandling=!0,this.suppressGlobalLogoutBtnHandling=!0,this.mqttHandler.mqttUpdateEvent$.subscribe(e=>{this.handleMetrologyChanges(e)})}handleMetrologyChanges(e){e&&L.isString(e.payload.topic)&&(e.payload.topic===B.MqttTopics.METROLOGY_APPROVED_FOR_VERIFICATION||e.payload.topic===B.MqttTopics.METROLOGY_RANGES&&this.updateMetrology())}updateMetrology(){return this.Metrology=f.getMetrology(),0!==this.Metrology.max||(this.Metrology={unit:"",decimals:0,d:0,e:0,max:0,min:0},!1)}provideSpecificAdvFsmStates(){return Se}providePQInitTaskParams(){let e=[];return isNaN(I.QuantityParameter.getValue(this.workflowMeasurement.data.calculatedNRef))||isNaN(I.QuantityParameter.getValue(this.workflowMeasurement.data.calculatedWRef))||(e.push(_.getBlankPrintLine()),this.countingMethod===_.EnumMethodSelectionOptions.CALC&&e.push(this.qP_4_nRef.getValue()),
e.push(this.qP_4_wRef.getValue()),e.push(this.targetParam.getValue()),e.push(this.minTolParam.getValue()),e.push(this.maxTolParam.getValue())),e.push(_.getBlankPrintLine()),e}initFromWorkstate(){if(this.workstate){switch(this.workflowMeasurement=new o.QAppMeasurementData(this.workstate.measurementData),this.confIdentifierAspect(!1,he),this.workflowTaskHandler.getParameter(_.METHOD_PARAM_ID).value.selection.id){case _.EnumMethodSelectionOptions.CALC:this.countingMethod=_.EnumMethodSelectionOptions.CALC;break;case _.EnumMethodSelectionOptions.INPUT:this.countingMethod=_.EnumMethodSelectionOptions.INPUT;break;default:this.countingMethod=_.EnumMethodSelectionOptions.CALC}if(this.autoTakeOver=this.workflowTaskHandler.getParameter(_.TAKE_OVER_PARAM_ID).value.selection.id===_.EnumTakeOverOptions.ON,this.autoTakeOver)switch(this.workflowTaskHandler.getParameter(_.MIN_LOAD_PARAM_ID).value.selection.id){case _.EnumMinLoadSelectionOption.TEN:this.minLoad=10;break
;case _.EnumMinLoadSelectionOption.TWENTY:this.minLoad=20;break;case _.EnumMinLoadSelectionOption.FIFTY:this.minLoad=50;break;case _.EnumMinLoadSelectionOption.HUNDRED:this.minLoad=100;break;case _.EnumMinLoadSelectionOption.TWO_HUNDRED:this.minLoad=200;break;case _.EnumMinLoadSelectionOption.FIVE_HUNDRED:this.minLoad=500;break;case _.EnumMinLoadSelectionOption.THOUSAND:this.minLoad=1e3;break;default:this.minLoad=1}switch(this.workflowTaskHandler.getParameter(_.COUNTER_PARAM_ID).value.selection.id){case _.EnumCounterOptions.ON:this.counterIsOn=!0;break;case _.EnumCounterOptions.OFF:this.counterIsOn=!1;break;default:this.counterIsOn=!0}switch(this.workflowTaskHandler.getParameter(_.DISPLAY_MODE_PARAM_ID).value.selection.id){case _.EnumDisplayModeOptions.ABS_VALUE:this.displayMode=_.EnumDisplayModeOptions.ABS_VALUE;break;case _.EnumDisplayModeOptions.DIFF:this.displayMode=_.EnumDisplayModeOptions.DIFF;break;default:this.displayMode=_.EnumDisplayModeOptions.ABS_VALUE}
this.portSelection=this.workflowTaskHandler.getParameter(_.PORTS_PARAM_ID).value.selection.id,this.portSelection!==_.EPortOptions.NOT_ACTIVE&&(this.towerLightController=new M.TowerLightController,this.lastTowerStatus=this.towerLightController.off()),this.targetParam=new p.Param(this.mqttHandler,this.workflowTaskHandler.getParameter(_.TARGET_PARAM_ID)),this.minTolParam=new p.Param(this.mqttHandler,this.workflowTaskHandler.getParameter(_.TOL_MIN_PARAM_ID)),this.maxTolParam=new p.Param(this.mqttHandler,this.workflowTaskHandler.getParameter(_.TOL_MAX_PARAM_ID)),this.qP_4_wRef=new p.Param(this.mqttHandler,this.workflowTaskHandler.getParameter(_.REF_PIECE_WGT_PARAM_ID)),this.qP_4_wRef.setParamAppearance(b.EnumAppearance.DISABLED),this.qP_4_wRef.getValue().info.minimum.value=(-1/0).toString(),this.qP_4_wRef.getValue().info.maximum.value=(1/0).toString(),this.qP_4_nRef=new p.Param(this.mqttHandler,O.cloneJSON(this.workflowTaskHandler.getParameter(_.REF_PIECE_COUNT_PARAM_ID))),
this.qP_4_nRef.setParamAppearance(b.EnumAppearance.DISABLED);let e=[];this.aspects[N.IDENTIFIER_ASPECT].getLotVisualParams().forEach(t=>{e.push(t.getPublishedId())}),e.push(this.sP_4_sampleNo.getPublishedId()),this.aspects[N.IDENTIFIER_ASPECT].getSIDVisualParams().forEach(t=>{e.push(t.getPublishedId())}),e.push(this.dP_4_sampleDate.getPublishedId()),e.push(this.mP_4_sampleWgt.getPublishedId()),e.push(this.qP_4_sampleCountRes.getPublishedId()),e.push(this.sP_4_sampleCheckResult.getPublishedId()),e.push(this.sP_4_sampleInvalidationReason.getPublishedId()),this.evalLastSampleTab.setTabParams(e),this.evalLastSampleTab.show(),this.counterIsOn&&(this.counterChart.init({splittScreenTab:this.wScrCounterChartTab,tabbedScreenTab:this.evalCounterChartTab},{minMax:{minTol:I.QuantityParameter.getValue(this.minTolParam.getValue()),maxTol:I.QuantityParameter.getValue(this.maxTolParam.getValue())}}),this.counterChart.resetGraphTab(this.workflowMeasurement.data.counter.counterChartData)),
isNaN(I.QuantityParameter.getValue(this.workflowMeasurement.data.calculatedNRef))||isNaN(I.QuantityParameter.getValue(this.workflowMeasurement.data.calculatedWRef))||(this.qP_4_wRef.setValue(O.cloneJSON(this.workflowMeasurement.data.calculatedWRef)),I.QuantityParameter.roundToDecimalPlaces(this.qP_4_wRef.getValue()),this.qP_4_nRef.setValue(O.cloneJSON(this.workflowMeasurement.data.calculatedNRef))),this.counterParams=this.setupCounterParams();let t=this.workflowMeasurement.getLastSample();t&&(this.lastSampleData=t,this.workflowMeasurement.getNumberOfSamples()>=Q&&(this.maxSampleReached=!0),this.updateSampleParameters(this.lastSampleData),this.aspects[N.IDENTIFIER_ASPECT].setSIDs(t.identifiers,t.identifiers))}else this.exitError("ACC::initFromWorkstate - workstate undefined - unexpected")}calcResumeState(){return this.workflowMeasurement.getLastSample()?Ne:isNaN(I.QuantityParameter.getValue(this.workflowMeasurement.data.calculatedWRef))?Te:Ne}reinitWorkstate(){
this.workstate&&this.deleteWorkstate(),this.prepReinitializedWorkstate({identifiers:[],samples:[],calculatedNRef:v.createEmptyQuantityParameter(),calculatedWRef:v.createEmptyQuantityParameter(),counter:{counterChartData:[],counterHigh:0,counterLow:0,counterOk:0}})}resumeAdvAspectIsReinitConditionDetectedFn(){return!this.workstate}resumeAdvAspectIsContinueConditionDetectedFn(){return!1}specificRestart(){this.workstate&&this.workflowMeasurement&&this.deleteWorkstate()}onSuspending(){this.weighingProxy.setButton(l.WEIGHING_BUTTON_UNIT,b.EnumAppearance.ENABLED_PRIMARY),this.weighingProxy.destroyWeightApplication(y),this.weighingProxy.destroyWeightApplication(G);try{this.selDisplValSubscription.unsubscribe()}catch(e){}this.portSelection!==_.EPortOptions.NOT_ACTIVE&&(this.lastTowerStatus=this.towerLightController.off())}provideSamplePQParams(e){
let t,a=[],s=O.cloneJSON(this.sP_4_sampleNo.getValue()),i=O.cloneJSON(this.sP_4_sampleCheckResult.getValue()),n=O.cloneJSON(this.qP_4_sampleCountRes.getValue());return(t=v.createEmptyAlibiIdentifier()).value.alibiIdentifier=e.alibiID,s.value.string=e.sampleNo.toString(),i.value.string=e.check,I.QuantityParameter.setValue(n,e.count),a.push(s),a.push(t),a.push(n),a.push(i),a.push(_.getBlankPrintLine()),a}doAddSampleDuringReinit2PQ(e){return-1!==e.alibiID}addRemainingDataToPQ(){let e=[];if(!this.counterResultPrinted&&this.counterIsOn){let t=[],a=-1;t.push(this.counterParams.qP_4_numOfCounter.getValue()),t.push(this.counterParams.qP_4_counterLow.getValue()),t.push(this.counterParams.qP_4_counterOk.getValue()),t.push(this.counterParams.qP_4_counterHigh.getValue()),a=this.reportingProxy.printParameters(t,g.REPORTING_CATEGORY_RESULT,!1).getPrintItemIdentifier(),e.push(a),this.counterResultPrinted=!0}return e}init(){super.init(),this.invalidationAspect.configure({exitState:pe}),
this.sP_4_sampleNo=new p.Param(this.mqttHandler,m.getSampleNumberStringParameter()),this.sP_4_sampleInvalidationReason=new p.Param(this.mqttHandler,T.InvalidateSampleAspect.createInvalidReasonParam(j)),this.dP_4_sampleDate=new p.Param(this.mqttHandler,m.getSampleDateDTParameter());let e=v.createEmptyMeasureParameter();e.id=q,e.appearance=b.EnumAppearance.ENABLED,e.title.id="_QAPP_WF_CNT_PARAM_PIECE_COUNT_TITLE",e.header.id="_QAPP_WF_CNT_PARAM_PIECE_COUNT_HEADER",e.value.unit=S.unitStringToShort(S.EnumUnitStrings.pcs),e.value.interval=1,e.value.mark="_QAPP_WF_CNT_PARAM_PIECE_COUNT_HEADER",this.mP_4_count=new h.MeasureParameter(e,!0);let t=v.createEmptyQuantityParameter();t.id=q,t.appearance=b.EnumAppearance.HIDDEN,t.title.id="_QAPP_WF_PARAM_TITLE_RUNTIME_RES",t.header.id="_QAPP_WF_PARAM_HEADER_RUNTIME_RES",t.value.unit=S.unitStringToShort(S.EnumUnitStrings.pcs),this.qP_4_sampleCountRes=new p.Param(this.mqttHandler,t);let a=v.createEmptyStringParameter();a.id=X,
a.appearance=b.EnumAppearance.HIDDEN,a.title.id="_QAPP_WF_PARAM_TITLE_RUNTIME_CHECK_RESULT",a.header.id="_QAPP_WF_PARAM_HEADER_RUNTIME_CHECK_RESULT",a.value.string=Y.OK,this.sP_4_sampleCheckResult=new p.Param(this.mqttHandler,a);let s=v.createEmptyMeasureParameter();s.id=K,s.appearance=b.EnumAppearance.HIDDEN,s.value.unit=S.unitStringToShort(S.EnumUnitStrings.g),this.mP_4_sampleWgt=new p.Param(this.mqttHandler,s);let i=new r.WeighingSplitScreen(this.mqttHandler,[u.createStartButtonData(),u.createEvalButtonData(),u.createPrintAddButtonData(),u.createDocuButtonData()]);this.registerScreen(i),this.getWSS().getTabApi().clearTabList(),this.wScrIconTab=this.getWSS().getTabApi().addFigureTab(ee,{id:ee,appearance:b.EnumAppearance.ENABLED,type:R.EnumTabType.TAB_FIGURE,containerTitle:{id:"",args:[]},title:{id:"",args:[]},topbuttons:[],imgref:{id:""}}),this.wScrCounterChartTab=this.getWSS().getTabApi().addGraphTab(te,{id:te,appearance:b.EnumAppearance.HIDDEN,type:R.EnumTabType.TAB_GRAPH,
containerTitle:{id:"",args:[]},title:{id:"",args:[]},topbuttons:[],data:{}}),this.getWSS().getTabApi().publishTabList(),this.startBtn=i.getButton(u.BTN_START_ID),this.registerButton(A.EnumFunctionalButtonType.FUNC_BTN_DOCU,i.getButton(u.BTN_DOCU_ID)),this.evalBtn=i.getButton(u.BTN_EVAL_ID),this.registerButton(A.EnumFunctionalButtonType.FUNC_BTN_TAKEOVER,i.getButton(u.BTN_PRINTADD_ID));let o=new n.TabScreen(this.mqttHandler);this.registerScreen(o),this.evalNotValidBtn=new c.Button(this.mqttHandler,o,u.createInvalidateSampleButtonData()),this.evalNotValidBtn.publish(),this.getTS().clearTabList(),this.evalLastSampleTab=this.getTS().addParamListTab(ae,{id:ae,appearance:b.EnumAppearance.ENABLED,type:R.EnumTabType.TAB_PARAMLIST,containerTitle:{id:"_QAPP_WF_TAB_CONTAINER_TITLE_SAMPLE",args:[]},title:{id:"",args:[]},displayHeader:!1,topbuttons:[],params:[]},[i.getButton(u.BTN_DOCU_ID),this.evalNotValidBtn]),this.evalCounterChartTab=this.getTS().addGraphTab(se,{id:se,
appearance:b.EnumAppearance.HIDDEN,type:R.EnumTabType.TAB_GRAPH,containerTitle:{id:"_QAPP_WF_TAB_CONTAINER_TITLE_COUNTER_CHART",args:[]},title:{id:"",args:[]},topbuttons:[],data:{}},[this.buttons.docuButton]),this.getTS().publishTabList(),this.getWSS().getCheckBarGraph().setAreas(D.EnumAreaCount.FOUR_AREAS,!1),this.getWSS().getCheckBarGraph().setAppearance(b.EnumAppearance.HIDDEN,!1),this.getWSS().getCheckBarGraph().publishStatus(),this.taskName=this.getTaskName(),this.sampleTranslation=this.localizerProxy.getText("_QAPP_WF_SAMPLE")}postInit(){super.postInit(),this.mqttHandler.subscribe(U)}InitStateInputWeight(){this.getWSS().getCheckBarGraph().setAppearance(b.EnumAppearance.HIDDEN,!1),this.getWSS().getCheckBarGraph().publishStatus(),this.weighingProxy.setButton(l.WEIGHING_BUTTON_UNIT,b.EnumAppearance.ENABLED_PRIMARY),this.weighingProxy.setButton(l.WEIGHING_BUTTON_DO_TARE,b.EnumAppearance.ENABLED_PRIMARY),this.startBtn.setAppearance(b.EnumAppearance.ENABLED_PRIMARY),
this.wScrIconTab.setTabImgRefId(w),this.workflowMeasurement.data.calculatedWRef=O.cloneJSON(this.qP_4_wRef.getValue()),this.workflowMeasurement.data.calculatedNRef=O.cloneJSON(this.qP_4_nRef.getValue()),this.qP_4_wRef.publish(),this.setWSSParams("",this.qP_4_wRef.getPublishedId()),this.getWSS().setText1("_QAPP_WF_CNT_STAT_INPUT_START_INFO"),this.getWSS().show()}InitStateCalcWeight(){this.getWSS().getCheckBarGraph().setAppearance(b.EnumAppearance.HIDDEN,!1),this.getWSS().getCheckBarGraph().publishStatus(),this.stabilityAspect.configure(this.measureWRefConfig),this.weighingProxy.setButton(l.WEIGHING_BUTTON_UNIT,b.EnumAppearance.ENABLED_PRIMARY),this.weighingProxy.setButton(l.WEIGHING_BUTTON_DO_TARE,b.EnumAppearance.ENABLED_PRIMARY),this.startBtn.setAppearance(b.EnumAppearance.DISABLED),this.wScrIconTab.setTabImgRefId(F),this.qP_4_nRef.publish(),this.setWSSParams("",this.qP_4_nRef.getPublishedId()),
this.getWSS().setText1("_QAPP_WF_CNT_STAT_CALC_START_INFO_1",[I.QuantityParameter.getValue(this.qP_4_nRef.getValue().value).toString()]),this.getWSS().setText2("_QAPP_WF_CNT_STAT_CALC_START_INFO_2",[this.startBtn.getLabel().id]),this.getWSS().show()}InitStateActive(){this.subToDisplayValue();let e=`${this.taskName} - ${this.sampleTranslation}: ${this.workflowMeasurement.getNumberOfSamples()+1}`;this.stabilityAspect.configure(this.activeConfig(e)),this.weighingProxy.setButton(l.WEIGHING_BUTTON_UNIT,b.EnumAppearance.DISABLED),this.weighingProxy.selectWeightApplication(G),this.getWSS().getCheckBarGraph().setAppearance(b.EnumAppearance.ENABLED,!1),this.getWSS().getCheckBarGraph().publishStatus(),this.counterIsOn&&(this.counterChart&&this.counterChart.getChartData().length>=1?this.wScrCounterChartTab.show():this.wScrCounterChartTab.hide()),this.wScrIconTab.setTabImgRefId(V),this.qP_4_wRef.publish(),this.setWSSParams(this.minTolParam.getPublishedId(),this.maxTolParam.getPublishedId()),
this.getWSS().setText1("_QAPP_WF_CNT_STAT_RESULT_INFO_1",[(this.workflowMeasurement.getNumberOfSamples()+1).toString()]),this.autoTakeOver?this.getWSS().setText2(""):this.getWSS().setText2("_QAPP_WF_CNT_STAT_RESULT_INFO_2",[this.buttons.takeoverBtn.getLabel().id])}InitStateTakeSampleDown(){this.subToDisplayValue(),this.weighingProxy.setButton(l.WEIGHING_BUTTON_UNIT,b.EnumAppearance.DISABLED),this.weighingProxy.selectWeightApplication(y),this.autoTakeOver?this.workflowMeasurement.getNumberOfSamples()>=1?(this.startBtn.setAppearance(b.EnumAppearance.HIDDEN),this.evalBtn.setAppearance(b.EnumAppearance.ENABLED_SECONDARY),this.updateRequestedTakeoverButtonAppearance(b.EnumAppearance.HIDDEN)):(this.startBtn.setAppearance(b.EnumAppearance.HIDDEN),this.evalBtn.setAppearance(b.EnumAppearance.DISABLED),this.updateRequestedTakeoverButtonAppearance(b.EnumAppearance.HIDDEN)):this.workflowMeasurement.getNumberOfSamples()>=1?(this.startBtn.setAppearance(b.EnumAppearance.HIDDEN),
this.evalBtn.setAppearance(b.EnumAppearance.ENABLED_SECONDARY),this.updateRequestedTakeoverButtonAppearance(b.EnumAppearance.DISABLED)):(this.startBtn.setAppearance(b.EnumAppearance.HIDDEN),this.evalBtn.setAppearance(b.EnumAppearance.DISABLED),this.updateRequestedTakeoverButtonAppearance(b.EnumAppearance.DISABLED)),this.counterIsOn&&(this.counterChart&&this.counterChart.getChartData().length>=1?this.wScrCounterChartTab.show():this.wScrCounterChartTab.hide()),this.getWSS().getCheckBarGraph().setAppearance(b.EnumAppearance.ENABLED,!1),this.getWSS().getCheckBarGraph().publishStatus(),this.wScrIconTab.setTabImgRefId(k),this.qP_4_wRef.publish(),this.setWSSParams("",this.qP_4_wRef.getPublishedId()),this.getWSS().setText1("_QAPP_WF_CNT_STAT_MEASURE_WREF_INFO"),this.getWSS().setText2("")}initStateEvaluation(){
this.lastSampleData.valid&&-1!==this.lastSampleData.alibiID?this.evalNotValidBtn.setAppearance(b.EnumAppearance.ENABLED_SECONDARY,!1):this.evalNotValidBtn.setAppearance(b.EnumAppearance.DISABLED,!1),this.evalNotValidBtn.publish(),this.counterIsOn&&(this.counterChart&&this.counterChart.getChartData().length>=1?this.evalCounterChartTab.show():this.evalCounterChartTab.hide()),this.getTS().show()}initStateMaxSamplesReached(){this.weighingProxy.selectWeightApplication(G),this.autoTakeOver?(this.startBtn.setAppearance(b.EnumAppearance.HIDDEN),this.evalBtn.setAppearance(b.EnumAppearance.ENABLED_SECONDARY),this.updateRequestedTakeoverButtonAppearance(b.EnumAppearance.HIDDEN)):(this.startBtn.setAppearance(b.EnumAppearance.HIDDEN),this.evalBtn.setAppearance(b.EnumAppearance.ENABLED_SECONDARY),this.updateRequestedTakeoverButtonAppearance(b.EnumAppearance.DISABLED)),this.minTolParam.publish(),this.maxTolParam.publish(),
this.setWSSParams(this.minTolParam.getPublishedId(),this.maxTolParam.getPublishedId()),this.getWSS().setText1("_QAPP_WF_CNT_STAT_MAX_SAMPLES"),this.getWSS().setText2("_QAPP_WF_CNT_STAT_MAX_SAMPLES_II")}ExecBackSTATE_EVALUATION(){return this.maxSampleReached?de:this.evaluationBackState}ExecCmdInvalidate(){let e="";return this.lastSampleData.valid&&(e=T.STATE_ASPECT_INVAL_SAMPLE_ENTER),e}ExecImmediateSTATE_MEASURE_WREF(){let e=new h.MeasureParameter(this.getWeightValueFromBlock(this.stabilityAspect.stableWeightBlock),!0);return this.isWeightValueValid(e.getValue_(),W)?(this.workflowMeasurement.data.calculatedWRef=O.cloneJSON(this.qP_4_wRef.getValue()),this.workflowMeasurement.data.calculatedNRef=O.cloneJSON(this.qP_4_nRef.getValue()),this.calcWRef(e),this.saveWorkstate(),this.sP_4_sampleNo.setParamAppearance(b.EnumAppearance.HIDDEN),this.addRefParametersToPQ(),""):ue}ExecImmediateRESUME_AFTER_INIT(){
return this.lastSampleData&&(void 0!==this.qP_4_sampleCountRes.getValue().value.numbers[0]?this.lastSampleData.valid?this.qP_4_sampleCountRes.setParamAppearance(b.EnumAppearance.ENABLED):this.qP_4_sampleCountRes.setParamAppearance(b.EnumAppearance.ENABLED_INVALID):this.qP_4_sampleCountRes.setParamAppearance(b.EnumAppearance.HIDDEN),0!==this.sP_4_sampleCheckResult.getValue().value.string.length?this.lastSampleData.valid?this.sP_4_sampleCheckResult.setParamAppearance(b.EnumAppearance.ENABLED):this.sP_4_sampleCheckResult.setParamAppearance(b.EnumAppearance.ENABLED_INVALID):this.sP_4_sampleCheckResult.setParamAppearance(b.EnumAppearance.HIDDEN),this.mP_4_sampleWgt.getValue().value.isInvalid?this.mP_4_sampleWgt.setParamAppearance(b.EnumAppearance.HIDDEN):this.lastSampleData.valid?this.mP_4_sampleWgt.setParamAppearance(b.EnumAppearance.ENABLED):this.mP_4_sampleWgt.setParamAppearance(b.EnumAppearance.ENABLED_INVALID),
this.lastSampleData.valid||this.aspects[N.IDENTIFIER_ASPECT].getSIDVisualParams().forEach(e=>{e.getValue().appearance!==b.EnumAppearance.HIDDEN&&e.setParamAppearance(b.EnumAppearance.ENABLED_INVALID,!0)})),this.getWSS().show(),ce}ExecImmediateSTATE_GET_METHOD(){let e="";switch(this.saveWorkstate(!1),this.countingMethod){case _.EnumMethodSelectionOptions.INPUT:e=_e;break;case _.EnumMethodSelectionOptions.CALC:e=ue}return e}ExecCmdWaitingForStability(){let e="";return this.autoTakeOver?this.updateRequestedTakeoverButtonAppearance(b.EnumAppearance.HIDDEN):this.updateRequestedTakeoverButtonAppearance(b.EnumAppearance.DISABLED),this.maxSampleReached||(e=d.STATE_ASPECT_WAITING_FOR_STABILITY),e}ExecCmdEvalScreen(){return pe}ExecCmdSTATE_TAKE_SAMPLE_DOWN(e){let t="";return this.updateCheckBarGraphAndCalculateCount(O.cloneJSON(e)),this.checkForTakeDownCondition(e)&&(t=this.maxSampleReached?pe:Ae),t}ExecImmediateSTATE_STORE_SAMPLE(){
let e,t=this.getWeightValueFromBlock(this.stabilityAspect.stableWeightBlock),a=this.calculateCount(t,!1);if(this.counterResultPrinted=!1,void 0!==this.stabilityAspect.alibiId?this.lastSampleData.alibiID=this.stabilityAspect.alibiId:this.exitError("EW::ExecImmediateSTATE_PRINT: no alibiId"),(e=this.reportingProxy.getAlibiRecord(this.lastSampleData.alibiID)).isSuccess()||this.exitError("ACC::initFromWorkstate no alibi memory record for the sample found"),this.lastSampleData.date=JSON.parse(e.rawReturns.record).timestamp,this.lastSampleData.count=a,this.lastSampleData.sampleNo=this.workflowMeasurement.getNumberOfSamples(),a<I.QuantityParameter.getValue(this.minTolParam.getValue())?this.lastSampleData.check=Y.LL:a>I.QuantityParameter.getValue(this.maxTolParam.getValue())?this.lastSampleData.check=Y.HH:this.lastSampleData.check=Y.OK,this.counterIsOn)switch(this.lastSampleData.check){case Y.LL:
I.QuantityParameter.setValue(this.counterParams.qP_4_counterLow.getValue(),I.QuantityParameter.getValue(this.counterParams.qP_4_counterLow.getValue())+1),this.workflowMeasurement.data.counter.counterLow=I.QuantityParameter.getValue(this.counterParams.qP_4_counterLow.getValue());break;case Y.HH:I.QuantityParameter.setValue(this.counterParams.qP_4_counterHigh.getValue(),I.QuantityParameter.getValue(this.counterParams.qP_4_counterHigh.getValue())+1),this.workflowMeasurement.data.counter.counterHigh=I.QuantityParameter.getValue(this.counterParams.qP_4_counterHigh.getValue());break;case Y.OK:I.QuantityParameter.setValue(this.counterParams.qP_4_counterOk.getValue(),I.QuantityParameter.getValue(this.counterParams.qP_4_counterOk.getValue())+1),this.workflowMeasurement.data.counter.counterOk=I.QuantityParameter.getValue(this.counterParams.qP_4_counterOk.getValue())}this.updateSampleParameters(this.lastSampleData,t),this.counterIsOn&&(this.counterChart.addValue(a),
this.workflowMeasurement.data.counter.counterChartData=this.counterChart.getChartData(),I.QuantityParameter.setValue(this.counterParams.qP_4_numOfCounter.getValue(),this.workflowMeasurement.data.counter.counterChartData.length)),this.workflowMeasurement.getNumberOfSamples()>=Q&&(this.maxSampleReached=!0),this.saveWorkstate()}ExecCmdSyncCallDoneStoreSample(){return this.notifyTakeOver(),this.addSample2PQ(this.lastSampleData,!0,!1),this.hideLoadingScreen(),ce}ExecCmdEnDisableStartBtn(e){this.isWeightValueValid(e,W)?this.startBtn.setAppearance(b.EnumAppearance.ENABLED_PRIMARY):this.startBtn.setAppearance(b.EnumAppearance.DISABLED)}ExecCmdCalcCount(e){if(this.updateCheckBarGraphAndCalculateCount(O.cloneJSON(e)),this.autoTakeOver){if(this.workflowMeasurement.getNumberOfSamples()>=1?(this.startBtn.setAppearance(b.EnumAppearance.HIDDEN),this.evalBtn.setAppearance(b.EnumAppearance.ENABLED_SECONDARY),
this.updateRequestedTakeoverButtonAppearance(b.EnumAppearance.HIDDEN)):(this.startBtn.setAppearance(b.EnumAppearance.HIDDEN),this.evalBtn.setAppearance(b.EnumAppearance.DISABLED),this.updateRequestedTakeoverButtonAppearance(b.EnumAppearance.HIDDEN)),this.isWeightValueValid(e,this.minLoad)&&!this.maxSampleReached)return d.STATE_ASPECT_WAITING_FOR_STABILITY}else this.isWeightValueValid(e,this.minLoad)&&!this.maxSampleReached?this.workflowMeasurement.getNumberOfSamples()>=1?(this.startBtn.setAppearance(b.EnumAppearance.HIDDEN),this.evalBtn.setAppearance(b.EnumAppearance.ENABLED_SECONDARY),this.updateRequestedTakeoverButtonAppearance(b.EnumAppearance.ENABLED_PRIMARY)):(this.startBtn.setAppearance(b.EnumAppearance.HIDDEN),this.evalBtn.setAppearance(b.EnumAppearance.DISABLED),this.updateRequestedTakeoverButtonAppearance(b.EnumAppearance.ENABLED_PRIMARY)):this.workflowMeasurement.getNumberOfSamples()>=1?(this.startBtn.setAppearance(b.EnumAppearance.HIDDEN),
this.evalBtn.setAppearance(b.EnumAppearance.ENABLED_SECONDARY),this.updateRequestedTakeoverButtonAppearance(b.EnumAppearance.DISABLED)):(this.startBtn.setAppearance(b.EnumAppearance.HIDDEN),this.evalBtn.setAppearance(b.EnumAppearance.DISABLED),this.updateRequestedTakeoverButtonAppearance(b.EnumAppearance.DISABLED));return""}checkForTakeDownCondition(e){let t=new h.MeasureParameter(e,!0),a=new h.MeasureParameter(this.mP_4_sampleWgt.getValue(),!0),s=I.QuantityParameter.getValue(this.qP_4_wRef.getValue())<0?"-":"+";return!t.isSpecial()&&(this.autoTakeOver?this.workflowMeasurement.getNumberOfSamples()>=1?t.getSteps()<.5*this.minLoad||t.getSign()!==a.getSign():t.getSteps()<.5*this.minLoad||t.getSign()!==s:this.workflowMeasurement.getNumberOfSamples()>=1?t.getFloat()<.5*a.getFloat()||t.getSign()!==a.getSign():t.getFloat()<.5*I.QuantityParameter.getValue(this.qP_4_wRef.getValue())||t.getSign()!==s)}calculateCount(e,t=!0){
let a,s=new h.MeasureParameter(e,!0),i=I.QuantityParameter.getValue(this.qP_4_wRef.getValue()),n={isStable:s.getValue_().value.isStable,isSpecial:s.getValue_().value.isSpecial,isInvalid:s.getValue_().value.isInvalid,isWarning:s.getValue_().value.isWarning},r=I.QuantityParameter.getValue(this.workflowMeasurement.data.calculatedWRef);if(isNaN(r)||(i=r),s.isSpecial())this.mP_4_count.getValue_().value.number=s.getValue_().value.number,Object.assign(this.mP_4_count.getValue_().value,n),a=Number.NaN;else{let e=S.convertWgtUnit(s.getFloat(),S.unitStringToLong(s.getValue_().value.unit),S.unitStringToLong(this.qP_4_wRef.getValue().value.unit));this.mP_4_count.setFloat(e/Math.abs(i),0),Object.assign(this.mP_4_count.getValue_().value,n),a=this.mP_4_count.getFloat()}return t&&this.mqttHandler.publish(H,JSON.stringify(this.mP_4_count.getValue_().value),{retain:!1}),a}updateCheckBarGraphAndCalculateCount(e){let t=new h.MeasureParameter(O.cloneJSON(e),!0),a=t.getFloat()
;void 0===this.qP_4_wRef.getValue().value.numbers[0]&&(this.qP_4_wRef.getValue().value.numbers[0]="1.00");let s=S.convertWgtUnit(I.QuantityParameter.getValue(this.qP_4_wRef.getValue()),S.unitStringToLong(this.qP_4_wRef.getValue().value.unit),S.unitStringToLong(t.getValue_().value.unit)),i=(I.QuantityParameter.getValue(this.minTolParam.getValue())-.5)*s,n=(I.QuantityParameter.getValue(this.maxTolParam.getValue())+.5)*s,r=I.QuantityParameter.getValue(this.targetParam.getValue())*s,o=this.calculateCount(e),l=0;t.getValue_().value.isWarning||t.isSpecial()?t.isSpecial()&&(l="High"===t.getValue_().value.number?this.getWSS().getCheckBarGraph().calc4AreaPerc(this.Metrology.max,i,n,this.Metrology.max,r).area:this.getWSS().getCheckBarGraph().calc4AreaPerc(0,i,n,this.Metrology.max,r).area):(a<i?t.getValue_().value.number=Y.LL:a>n?t.getValue_().value.number=Y.HH:(t.getValue_().value.unit=S.unitStringToShort(S.EnumUnitStrings.pcs),t.getValue_().value.interval=1,
this.displayMode===_.EnumDisplayModeOptions.DIFF?t.setFloat(o-I.QuantityParameter.getValue(this.targetParam.getValue()),0):t.setFloat(o,0)),l=this.getWSS().getCheckBarGraph().calc4AreaPerc(a,i,n,this.Metrology.max,r).area),isNaN(t.getFloat())&&(t.getValue_().value.isSpecial=!0,t.getValue_().value.unit=""),this.mqttHandler.publish(x,JSON.stringify(t.getValue_().value),{retain:!1}),this.computeTowerLight(new h.MeasureParameter(e,!0),a,r,l)}computeTowerLight(e,t,a,s){switch(this.portSelection){case _.EPortOptions.NOT_ACTIVE:break;case _.EPortOptions.CHECK_RANGE:this.inRangeCheck(t,a)?"off"!==this.lastTowerStatus&&this.lastCheckArea===s||(this.lastCheckArea=s,this.lastTowerStatus=this.towerLightController.setTowerLightByArea4(this.lastCheckArea)):"off"!==this.lastTowerStatus&&(this.lastTowerStatus=this.towerLightController.off());break;case _.EPortOptions.ALWAYS_ON:"off"!==this.lastTowerStatus&&this.lastCheckArea===s||(this.lastCheckArea=s,
this.lastTowerStatus=this.towerLightController.setTowerLightByArea4(this.lastCheckArea));break;case _.EPortOptions.STABLE_CHECK_RANGE:e.isStable()&&this.inRangeCheck(t,a)?"off"!==this.lastTowerStatus&&this.lastCheckArea===s||(this.lastCheckArea=s,this.lastTowerStatus=this.towerLightController.setTowerLightByArea4(this.lastCheckArea)):"off"!==this.lastTowerStatus&&(this.lastTowerStatus=this.towerLightController.off());break;case _.EPortOptions.AT_STABLE:e.isStable()?"off"!==this.lastTowerStatus&&this.lastCheckArea===s||(this.lastCheckArea=s,this.lastTowerStatus=this.towerLightController.setTowerLightByArea4(this.lastCheckArea)):"off"!==this.lastTowerStatus&&(this.lastTowerStatus=this.towerLightController.off());break;case _.EPortOptions.STAB_CHECK_ONE_TIME:!this.stableValueMeasured&&e.isStable()&&this.inRangeCheck(t,a)?(this.stableValueMeasured=!0,
this.lastTowerStatus=this.towerLightController.setTowerLightByArea4(s)):(e.getStepsAbs()<this.minLoad||e.isNegative())&&this.stableValueMeasured&&(this.stableValueMeasured=!1,this.lastTowerStatus=this.towerLightController.off())}}inRangeCheck(e,t){return.3*t<=e&&e<=1.7*t}calcWRef(e){let t=I.QuantityParameter.getValue(this.qP_4_nRef.getValue()),a=e.getFloat()/t;this.qP_4_wRef.getValue().info.minimum.value=(-1/0).toString(),this.qP_4_wRef.getValue().info.maximum.value=(1/0).toString(),this.qP_4_wRef.getValue().value.unit=e.getValue_().value.unit,this.qP_4_wRef.getValue().value.decimals=e.getScaleDecimals(),this.qP_4_wRef.getValue().value.preferredDecimals=e.getScaleDecimals(),I.QuantityParameter.setValue(this.qP_4_wRef.getValue(),a),this.workflowMeasurement.data.calculatedWRef=O.cloneJSON(this.qP_4_wRef.getValue()),this.qP_4_wRef.publish()}getWeightValueFromBlock(e){let t;return t=I.WeightBlockHelper.getMeasureParameter(e,U)}isStableWeightValueValid(e,t,a=!1){
let s=I.WeightBlockHelper.getMeasureParameter(e,U);return!!this.isWeightValueValid(s,t)&&(this.addNewSample&&a&&(this.createNewSample(),this.addNewSample=!1),!0)}isWeightValueValid(e,t){let a=new h.MeasureParameter(e,!0);return a.getSteps()>=t&&!a.isUseDisabled()}addRefParametersToPQ(){let e=[];this.countingMethod===_.EnumMethodSelectionOptions.CALC&&e.push(this.qP_4_nRef.getValue()),e.push(this.qP_4_wRef.getValue()),e.push(this.targetParam.getValue()),e.push(this.minTolParam.getValue()),e.push(this.maxTolParam.getValue()),e.push(_.getBlankPrintLine()),this.addInitParams2PQ(e)}setupCounterParams(){let e=v.createEmptyQuantityParameter();e.id=J,e.appearance=b.EnumAppearance.ENABLED,e.title={id:"_QAPP_CFG_PARAM_COUNTER_LOW_TITLE",args:[]},e.header={id:"_QAPP_CFG_PARAM_COUNTER_LOW_HEADER",args:[]};let t=v.createEmptyQuantityParameter();t.id=$,t.appearance=b.EnumAppearance.ENABLED,t.title={id:"_QAPP_CFG_PARAM_COUNTER_OK_TITLE",args:[]},t.header={id:"_QAPP_CFG_PARAM_COUNTER_OK_HEADER",
args:[]};let a=v.createEmptyQuantityParameter();a.id=z,a.appearance=b.EnumAppearance.ENABLED,a.title={id:"_QAPP_CFG_PARAM_COUNTER_HIGH_TITLE",args:[]},a.header={id:"_QAPP_CFG_PARAM_COUNTER_HIGH_HEADER",args:[]};let s=v.createEmptyQuantityParameter();return s.id=Z,s.appearance=b.EnumAppearance.ENABLED,s.title={id:"_QAPP_LIB_PARAM_TITLE_STAT_NUMSAM",args:[]},s.header={id:"_QAPP_LIB_PARAM_HEADER_STAT_NUMSAM",args:[]},I.QuantityParameter.setValue(e,this.workflowMeasurement.data.counter.counterLow),I.QuantityParameter.setValue(t,this.workflowMeasurement.data.counter.counterOk),I.QuantityParameter.setValue(a,this.workflowMeasurement.data.counter.counterHigh),I.QuantityParameter.setValue(s,this.workflowMeasurement.data.counter.counterChartData.length),{qP_4_counterLow:new p.Param(this.mqttHandler,e),qP_4_counterOk:new p.Param(this.mqttHandler,t),qP_4_counterHigh:new p.Param(this.mqttHandler,a),qP_4_numOfCounter:new p.Param(this.mqttHandler,s)}}handleHomeBtn(){this.showMessageBox({
type:C.EnumMessageboxType.QUESTION,title:{id:"_QAPP_LIB_MBOX_HOME_WARNING_TITLE",args:[]},buttons:[{id:ie,label:{id:"_QAPP_LIB_MBOX_BTN_YES",args:[]},appearance:b.EnumAppearance.ENABLED_SECONDARY},{id:ne,label:{id:"_QAPP_LIB_MBOX_BTN_NO",args:[]},appearance:b.EnumAppearance.ENABLED_SECONDARY}],textList:[{id:"_QAPP_LIB_MBOX_HOME_WARNING_TEXT_top",args:[]},{id:"_QAPP_LIB_MBOX_HOME_WARNING_TEXT_mid",args:[this.getTaskName()]}]})}handleLogoutBtn(){this.showMessageBox({type:C.EnumMessageboxType.QUESTION,title:{id:"_QAPP_LIB_MBOX_LOGOUT_WARNING_TITLE",args:[]},buttons:[{id:re,label:{id:"_QAPP_LIB_MBOX_BTN_YES",args:[]},appearance:b.EnumAppearance.ENABLED_SECONDARY},{id:oe,label:{id:"_QAPP_LIB_MBOX_BTN_NO",args:[]},appearance:b.EnumAppearance.ENABLED_SECONDARY}],textList:[{id:"_QAPP_LIB_MBOX_LOGOUT_WARNING_TEXT_top",args:[]},{id:"_QAPP_LIB_MBOX_LOGOUT_WARNING_TEXT_mid",args:[this.getTaskName()]}]})}handleRestartBtn(){this.showMessageBox({type:C.EnumMessageboxType.QUESTION,title:{
id:"_QAPP_LIB_MBOX_RESTART_QUESTION_TITLE",args:[]},buttons:[{id:le,label:{id:"_QAPP_LIB_MBOX_BTN_YES",args:[]},appearance:b.EnumAppearance.ENABLED_SECONDARY},{id:Ee,label:{id:"_QAPP_LIB_MBOX_BTN_NO",args:[]},appearance:b.EnumAppearance.ENABLED_SECONDARY}],textList:[{id:"_QAPP_LIB_MBOX_RESTART_QUESTION_TEXT_top",args:[this.getTaskName()]},{id:"_QAPP_LIB_MBOX_RESTART_QUESTION_TEXT_bottom",args:[]}]})}checkForHomeLogout(e){return e===u.BTN_HOME_ID?(this.handleHomeBtn(),!0):e===u.BTN_LOGOUT_ID?(this.handleLogoutBtn(),!0):e===A.PRINT_RESTART_BUTTON_ID?(this.handleRestartBtn(),!0):e===ne?(this.hideMsgBox(),!0):e===oe?(this.mqttHandler.publish("/QAPP/LOGOUT_REQUEST",JSON.stringify({request:"CANCEL_LOGOUT"})),this.hideMsgBox(),!0):e===ie?(this.suspend(),!0):e===re?(this.rememberLogout(),this.suspend(),!0):e===le?(this.continueRestart(),!0):e===Ee&&(this.hideMsgBox(),this.hideLoadingScreen(),!0)}subToDisplayValue(){
void 0===this.selDisplValSubscription&&(this.selDisplValSubscription=this.weighingProxy.selectedDisplayValue$.subscribe(e=>{this.handleSelectedDisplayValue(e)}))}handleSelectedDisplayValue(e){try{if(e.currentSelectedDomain===l.ISelectedWeightDisplayValueDomains.SELECTED_DOMAIN_APP&&e.currentSelectedId===y){try{this.cancelInterval(this.wssParamsIntervalId)}catch(e){}this.lastWSSParamDisplayed=e.currentSelectedId,this.setWSSParams("",this.qP_4_wRef.getPublishedId())}else if(e.currentSelectedDomain===l.ISelectedWeightDisplayValueDomains.SELECTED_DOMAIN_APP&&e.currentSelectedId===G){try{this.cancelInterval(this.wssParamsIntervalId)}catch(e){}this.lastWSSParamDisplayed=e.currentSelectedId,this.setWSSParams(this.minTolParam.getPublishedId(),this.maxTolParam.getPublishedId())}else{try{this.cancelInterval(this.wssParamsIntervalId)}catch(e){}this.lastWSSParamDisplayed=G,this.setWSSParams(this.minTolParam.getPublishedId(),this.maxTolParam.getPublishedId()),
this.wssParamsIntervalId=this.addInterval(3e3,me)}}catch(e){}}toggleWSSParams(){this.lastWSSParamDisplayed===G?(this.lastWSSParamDisplayed=y,this.setWSSParams("",this.qP_4_wRef.getPublishedId())):(this.lastWSSParamDisplayed=G,this.setWSSParams(this.minTolParam.getPublishedId(),this.maxTolParam.getPublishedId()))}setWSSParams(e,t){this.getWSS().setParam1(""),this.getWSS().setParam2(""),this.getWSS().setParam1(e),this.getWSS().setParam2(t)}updateSampleParameters(e,t){let a=void 0!==t?t:this.reportingProxy.getWeightFromAlibi(e.alibiID),s=this.mP_4_sampleWgt.getValue();if(g.isAlibiEntryError(a))this.exitError("ACC::updateSampleParameters: "+a);else{switch(this.dP_4_sampleDate.getValue().value.timestamp=e.date,e.check){case Y.LL:this.sP_4_sampleCheckResult.getValue().value.string="_QAPP_WF_PARAM_CHECK_OPTION_LL";break;case Y.OK:this.sP_4_sampleCheckResult.getValue().value.string="_QAPP_WF_PARAM_CHECK_OPTION_OK";break;case Y.HH:
this.sP_4_sampleCheckResult.getValue().value.string="_QAPP_WF_PARAM_CHECK_OPTION_HH"}s.value=a.value,s.title=a.title,s.header=a.header,this.sP_4_sampleNo.getValue().value.string=e.sampleNo.toString(),this.mP_4_sampleWgt.setValue(s),I.QuantityParameter.setValue(this.qP_4_sampleCountRes.getValue(),e.count),this.mP_4_sampleWgt.setValue(a)}e.valid?(this.sP_4_sampleNo.setParamAppearance(b.EnumAppearance.ENABLED,!1),this.sP_4_sampleCheckResult.setParamAppearance(b.EnumAppearance.ENABLED,!1),this.mP_4_sampleWgt.setParamAppearance(b.EnumAppearance.ENABLED,!1),this.sP_4_sampleInvalidationReason.setParamAppearance(b.EnumAppearance.HIDDEN,!1),this.dP_4_sampleDate.setParamAppearance(b.EnumAppearance.ENABLED,!1),this.qP_4_sampleCountRes.setParamAppearance(b.EnumAppearance.ENABLED,!1),this.sP_4_sampleNo.publish(),this.sP_4_sampleCheckResult.publish(),this.mP_4_sampleWgt.publish(),this.sP_4_sampleInvalidationReason.publish(),this.dP_4_sampleDate.publish(),
this.qP_4_sampleCountRes.publish()):this.invalidateSample(e,!0)}invalidateSample(e,t){this.sP_4_sampleInvalidationReason.getValue().value.string=e.invalidationReason,t||(this.counterResultPrinted=!1,this.counterIsOn&&(this.counterChart.removeLastValue(),this.workflowMeasurement.data.counter.counterChartData=this.counterChart.getChartData(),e.count<I.QuantityParameter.getValue(this.minTolParam.getValue())?(I.QuantityParameter.setValue(this.counterParams.qP_4_counterLow.getValue(),I.QuantityParameter.getValue(this.counterParams.qP_4_counterLow.getValue())-1),this.workflowMeasurement.data.counter.counterLow=I.QuantityParameter.getValue(this.counterParams.qP_4_counterLow.getValue())):e.count>I.QuantityParameter.getValue(this.maxTolParam.getValue())?(I.QuantityParameter.setValue(this.counterParams.qP_4_counterHigh.getValue(),I.QuantityParameter.getValue(this.counterParams.qP_4_counterHigh.getValue())-1),
this.workflowMeasurement.data.counter.counterHigh=I.QuantityParameter.getValue(this.counterParams.qP_4_counterHigh.getValue())):(I.QuantityParameter.setValue(this.counterParams.qP_4_counterOk.getValue(),I.QuantityParameter.getValue(this.counterParams.qP_4_counterOk.getValue())-1),this.workflowMeasurement.data.counter.counterOk=I.QuantityParameter.getValue(this.counterParams.qP_4_counterOk.getValue())),I.QuantityParameter.setValue(this.counterParams.qP_4_numOfCounter.getValue(),this.workflowMeasurement.data.counter.counterChartData.length)),this.saveWorkstate()),this.dP_4_sampleDate.setParamAppearance(b.EnumAppearance.ENABLED_INVALID,!0),this.sP_4_sampleNo.setParamAppearance(b.EnumAppearance.ENABLED_INVALID,!0),this.sP_4_sampleCheckResult.setParamAppearance(b.EnumAppearance.ENABLED_INVALID,!0),this.qP_4_sampleCountRes.setParamAppearance(b.EnumAppearance.ENABLED_INVALID,!0),this.mP_4_sampleWgt.setParamAppearance(b.EnumAppearance.ENABLED_INVALID,!0),
this.aspects[N.IDENTIFIER_ASPECT].getSIDVisualParams().forEach(e=>{e.getValue().appearance!==b.EnumAppearance.HIDDEN&&e.setParamAppearance(b.EnumAppearance.ENABLED_INVALID,!0)}),this.sP_4_sampleInvalidationReason.setParamAppearance(b.EnumAppearance.ENABLED,!0)}handlePossiblyInvalidSample(e){this.lastSampleData.valid||this.invalidateSample(this.lastSampleData,e)}createNewSample(){let e=this.workflowMeasurement.getNumberOfSamples()>0?this.lastSampleData.identifiers:[],t=this.workflowMeasurement.addSample();this.lastSampleData=t,this.aspects[N.IDENTIFIER_ASPECT].setSIDs(this.lastSampleData.identifiers,e)}getWSS(){return this.screens[r.WEIGHING_SPLIT_SCREEN_ID]}getTS(){return this.screens[n.TAB_SCREEN_ID]}cfgParamAspectIsValidFn(){
let e=this.workflowTaskHandler.getParameter(_.METHOD_PARAM_ID),t=this.workflowTaskHandler.getParameter(_.REF_PIECE_WGT_PARAM_ID),a=this.workflowTaskHandler.getParameter(_.TARGET_PARAM_ID),s=this.workflowTaskHandler.getParameter(_.TOL_MIN_PARAM_ID),i=this.workflowTaskHandler.getParameter(_.TOL_MAX_PARAM_ID);return a.appearance!==b.EnumAppearance.ENABLED_INVALID_CFG&&(s.appearance!==b.EnumAppearance.ENABLED_INVALID_CFG&&(i.appearance!==b.EnumAppearance.ENABLED_INVALID_CFG&&(e.value.selection.id!==_.EnumMethodSelectionOptions.INPUT||t.appearance!==b.EnumAppearance.ENABLED_INVALID_CFG)))}cfgParamAspectUpdateTaskParameterFn(e){let t=O.cloneJSON(s.ParamUpdateUserActionSimpleAccept);if(e.id===_.TARGET_PARAM_ID){if(v.isTypeOfIQuantityParameter(e)){
let a=O.cloneJSON(e),s=I.QuantityParameter.getValue(a),i=I.QuantityParameter.setValue(a,I.QuantityParameter.getValue(e)),n=this.workflowTaskHandler.getParameter(_.TOL_MIN_PARAM_ID),r=this.workflowTaskHandler.getParameter(_.TOL_MAX_PARAM_ID),o=I.QuantityParameter.getValue(n),l=I.QuantityParameter.getValue(r);return s=I.QuantityParameter.getValue(a),e.appearance=b.EnumAppearance.ENABLED,o>s&&(t.textList.push({id:"_QAPP_CFG_PARAM_CHECK_TARGET_SMALLER_MIN",args:[i,e.value.unit,n.value.numbers[0],n.value.unit]},{id:"_QAPP_CFG_PARAM_CHECK_TARGET_SMALLER_MIN_2",args:[]}),e.appearance=b.EnumAppearance.ENABLED_INVALID_CFG),s>l&&(t.textList.push({id:"_QAPP_CFG_PARAM_CHECK_TARGET_GREATER_MAX",args:[i,e.value.unit,r.value.numbers[0],r.value.unit]},{id:"_QAPP_CFG_PARAM_CHECK_TARGET_GREATER_MAX_2",args:[]}),e.appearance=b.EnumAppearance.ENABLED_INVALID_CFG),l>=s&&l>=o&&(r.appearance=b.EnumAppearance.ENABLED,this.cfgParamAspectUpdateTaskHandlerAndPublish(r)),
s>=o&&l>=o&&(n.appearance=b.EnumAppearance.ENABLED,this.cfgParamAspectUpdateTaskHandlerAndPublish(n)),Number.isNaN(s)&&(e.appearance=b.EnumAppearance.ENABLED_INVALID_CFG),this.cfgParamAspectUpdateTaskHandlerAndPublish(e),0!==t.textList.length?{message:t,updatedParameter:e}:void 0}this.exitError("An internal configuration error occured")}else if(e.id===_.TOL_MIN_PARAM_ID){if(v.isTypeOfIQuantityParameter(e)){let a=O.cloneJSON(e),s=I.QuantityParameter.getValue(a),i=I.QuantityParameter.setValue(a,I.QuantityParameter.getValue(e)),n=this.workflowTaskHandler.getParameter(_.TARGET_PARAM_ID),r=this.workflowTaskHandler.getParameter(_.TOL_MAX_PARAM_ID),o=I.QuantityParameter.getValue(n),l=I.QuantityParameter.getValue(r);return s=I.QuantityParameter.getValue(a),e.appearance=b.EnumAppearance.ENABLED,s>o&&(t.textList.push({id:"_QAPP_CFG_PARAM_CHECK_MIN_GREATER_TARGET",args:[i,e.value.unit,n.value.numbers[0],n.value.unit]},{id:"_QAPP_CFG_PARAM_CHECK_MIN_GREATER_TARGET_2",args:[]}),
e.appearance=b.EnumAppearance.ENABLED_INVALID_CFG,this.cfgParamAspectUpdateTaskHandlerAndPublish(e)),s>l&&(t.textList.push({id:"_QAPP_CFG_PARAM_CHECK_MIN_GREATER_MAX",args:[i,e.value.unit,r.value.numbers[0],r.value.unit]},{id:"_QAPP_CFG_PARAM_CHECK_MIN_GREATER_MAX_2",args:[]}),e.appearance=b.EnumAppearance.ENABLED_INVALID_CFG),l>=s&&l>=o&&(r.appearance=b.EnumAppearance.ENABLED,this.cfgParamAspectUpdateTaskHandlerAndPublish(r)),o>=s&&l>=o&&(n.appearance=b.EnumAppearance.ENABLED,this.cfgParamAspectUpdateTaskHandlerAndPublish(n)),Number.isNaN(s)&&(e.appearance=b.EnumAppearance.ENABLED_INVALID_CFG),this.cfgParamAspectUpdateTaskHandlerAndPublish(e),0!==t.textList.length?{message:t,updatedParameter:e}:void 0}this.exitError("An internal configuration error occured")}else if(e.id===_.TOL_MAX_PARAM_ID){if(v.isTypeOfIQuantityParameter(e)){
let a=O.cloneJSON(e),s=I.QuantityParameter.getValue(a),i=I.QuantityParameter.setValue(a,I.QuantityParameter.getValue(e)),n=this.workflowTaskHandler.getParameter(_.TARGET_PARAM_ID),r=this.workflowTaskHandler.getParameter(_.TOL_MIN_PARAM_ID),o=I.QuantityParameter.getValue(n),l=I.QuantityParameter.getValue(r);return s=I.QuantityParameter.getValue(a),e.appearance=b.EnumAppearance.ENABLED,o>s&&(t.textList.push({id:"_QAPP_CFG_PARAM_CHECK_MAX_SMALLER_TARGET",args:[i,e.value.unit,n.value.numbers[0],n.value.unit]},{id:"_QAPP_CFG_PARAM_CHECK_MAX_SMALLER_TARGET_2",args:[]}),e.appearance=b.EnumAppearance.ENABLED_INVALID_CFG),l>s&&(t.textList.push({id:"_QAPP_CFG_PARAM_CHECK_MAX_SMALLER_MIN",args:[i,e.value.unit,r.value.numbers[0],r.value.unit]},{id:"_QAPP_CFG_PARAM_CHECK_MAX_SMALLER_MIN_2",args:[]}),e.appearance=b.EnumAppearance.ENABLED_INVALID_CFG),s>=l&&o>=l&&(r.appearance=b.EnumAppearance.ENABLED,this.cfgParamAspectUpdateTaskHandlerAndPublish(r)),
s>=o&&o>=l&&(n.appearance=b.EnumAppearance.ENABLED,this.cfgParamAspectUpdateTaskHandlerAndPublish(n)),Number.isNaN(s)&&(e.appearance=b.EnumAppearance.ENABLED_INVALID_CFG),this.cfgParamAspectUpdateTaskHandlerAndPublish(e),0!==t.textList.length?{message:t,updatedParameter:e}:void 0}this.exitError("An internal configuration error occured")}else if(e.id===_.TAKE_OVER_PARAM_ID)if(v.isTypeOfISelectionParameter(e)){let t=this.workflowTaskHandler.getParameter(_.MIN_LOAD_PARAM_ID);e.value.selection.id===_.EnumTakeOverOptions.ON?t.appearance===b.EnumAppearance.HIDDEN&&(t.appearance=b.EnumAppearance.ENABLED):t.appearance===b.EnumAppearance.ENABLED&&(t.appearance=b.EnumAppearance.HIDDEN),this.cfgParamAspectUpdateTaskHandlerAndPublish(t)}else this.exitError("An internal configuration error occured");else if(e.id===_.METHOD_PARAM_ID)if(v.isTypeOfISelectionParameter(e)){
let t=this.workflowTaskHandler.getParameter(_.REF_PIECE_COUNT_PARAM_ID),a=this.workflowTaskHandler.getParameter(_.REF_PIECE_WGT_PARAM_ID),s=this.taskHandler.getParameter(_.REF_PIECE_WGT_UNIT_PARAM_ID);e.value.selection.id===_.EnumMethodSelectionOptions.CALC?(t.appearance=b.EnumAppearance.ENABLED,a.appearance=b.EnumAppearance.HIDDEN):e.value.selection.id===_.EnumMethodSelectionOptions.INPUT&&(t.appearance=b.EnumAppearance.HIDDEN,Number.isNaN(I.QuantityParameter.getValue(a))||I.QuantityParameter.getValue(a)<parseFloat(a.info.minimum.value)||I.QuantityParameter.getValue(a)>parseFloat(a.info.maximum.value)?a.appearance=b.EnumAppearance.ENABLED_INVALID_CFG:a.appearance=b.EnumAppearance.ENABLED,s.appearance=b.EnumAppearance.ENABLED),this.cfgParamAspectUpdateTaskHandlerAndPublish(t),this.cfgParamAspectUpdateTaskHandlerAndPublish(a),this.cfgParamAspectUpdateTaskHandlerAndPublish(s)
}else this.exitError("An internal configuration error occured");else if(e.id===_.REF_PIECE_WGT_UNIT_PARAM_ID)if(v.isTypeOfISelectionParameter(e)){let t=this.taskHandler.getParameter(_.REF_PIECE_WGT_PARAM_ID);const a=e.value.selection.id,s=S.unitStringToLong(t.value.unit),i=t.value.preferredDecimals+S.getUnitShift(a)-S.getUnitShift(s);t.value.preferredDecimals=i,I.QuantityParameter.changeUnit(t,a),_.updateMinMax(t,s),this.cfgParamAspectUpdateTaskHandlerAndPublish(t)}else this.exitError("An internal configuration error occured");else e.id===_.REF_PIECE_WGT_PARAM_ID&&(v.isTypeOfIQuantityParameter(e)?Number.isNaN(I.QuantityParameter.getValue(e))||I.QuantityParameter.getValue(e)<parseFloat(e.info.minimum.value)||I.QuantityParameter.getValue(e)>parseFloat(e.info.maximum.value)?e.appearance=b.EnumAppearance.ENABLED_INVALID_CFG:e.appearance=b.EnumAppearance.ENABLED:this.exitError("An internal configuration error occured"));this.cfgParamAspectUpdateTaskHandlerAndPublish(e)}}
t.AdvCountingCheck=Re,(new Re).run(),console.log("it's time for node event loop")},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(53),i=a(95),n=a(46),r=a(96),o=a(45),l=a(13),E=a(82),_=a(8),u=a(29),c=a(2),A=a(1),p=a(0),d="STATE_RECONFIG_DONE",T="STATE_LOT_IDENTIFIER_DONE";t.QAppAdvBase=class extends r.QAppWorkflowBase{constructor(e){super(e),this.advBaseStates={STATE_ASPECT_RESUME_ADV_REINIT_EXIT:{_onEnter:function(e){e.addToEventQueue(new l.ImmediateEvent(i.STATE_ASPECT_RESUME_ADV_REINIT_EXIT))},_onExit:function(e){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,t){t.payload===i.STATE_ASPECT_RESUME_ADV_REINIT_EXIT&&(e.reinitialize(),this.transition(e,e.skipConfigParamAspect?d:s.STATE_ASPECT_CFG_PARAM_EDIT_ENTER))}},STATE_RECONFIG_DONE:{_onEnter:function(e){e.addToEventQueue(new l.ImmediateEvent(d))},_onExit:function(e){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,t){t.payload===d&&(e.confIdentifierAspect(!0),
this.transition(e,e.skipLotInput?T:E.STATE_ASPECT_IDENTIFIER_ENTER_LOT_INPUT))}},STATE_LOT_IDENTIFIER_DONE:{_onEnter:function(e){e.saveWorkstate(!0)},_onExit:function(e){},_transTo:{},_transFrom:{},QAPP_SYNC_CALL_DONE_EVENT:function(e,t){t.payload===l.QAPP_SYNC_CALL_DONE_EVENT_TYPE.SYNC_CALL_SAVE_WORKSTATE&&this.transition(e,i.STATE_ASPECT_RESUME_ADV_CONT_EXIT)}},STATE_ASPECT_RESUME_ADV_CONT_EXIT:{_onEnter:function(e){e.showLoadingScreen({id:"_QAPP_LIB_LOADING_OVERLAY_TEXT_PREP_CONT_APP",args:[e.getTaskName()]})},_onExit:function(e){},_transTo:{},_transFrom:{},MQTT_ADMIN_EVENT:function(e,t){e.checkForLoadingScreenEnableEvent(t)?(e.confIdentifierAspect(!0),e.aspects[E.IDENTIFIER_ASPECT].setLotIDs(e.workstate.measurementData.identifiers),e.restoreLastSelectedDisplayValueInfo(),e.initFromWorkstate(),e.addHeartbeatEvent("INIT_PRINTQUEUE_HEARTBEAT")):e.checkForCustomHeartbeatEvent(t,"INIT_PRINTQUEUE_HEARTBEAT")&&(console.log("QAppAdvBase: clearing printQueue."),
e.reportingProxy.clearPrintQueue(),e.initPQ(!0)?(console.log("QAppAdvBase: init PQ fin"),this.transition(e,e.calcResumeState())):(console.log("QAppAdvBase: there are more samples to print - add trigger to queue"),e.addToEventQueue(new l.SimpleEvent("STATE_ASPECT_RESUME_ADV_CONT_EXIT_contInitPQ"))))},SIMPLE_EVENT:function(e,t){"STATE_ASPECT_RESUME_ADV_CONT_EXIT_contInitPQ"===t.payload&&(e.initPQ(!1)?(console.log("QAppAdvBase: init PQ fin"),this.transition(e,e.calcResumeState())):(console.log("QAppAdvBase: there are more samples to print - add trigger to queue"),e.addToEventQueue(new l.SimpleEvent("STATE_ASPECT_RESUME_ADV_CONT_EXIT_contInitPQ"))))}}},this.skipConfigParamAspect=!1,this.skipLotInput=!1,this.workstate=void 0,this.isNewInitialized=!1,this.ignoreSaveWorkstate=!1,this.saveDisplayValueSelectionWithWorkstate=!1,this.initPQIdx=0,this.cfgParamAspect=new s.ConfigParamsAspect,this.registerAspect(this.cfgParamAspect),this.resAdvAspect=new i.ResumeAdvancedAspect,
this.registerAspect(this.resAdvAspect),this.workflowTaskHandler=new n.TaskHandler}init(){console.log("QAppAdvBase::init"),super.init()}postInit(){console.log("QAppAdvBase: postInit"),super.postInit(),this.confParamConfigAspect(),this.confResumeAdvAspect()}confParamConfigAspect(){console.log("QAppAdvBase::confParamConfigAspect"),this.aspects[s.CFG_PARAMS_ASPECT].configure({isValidFn:()=>this.cfgParamAspectIsValidFn(),updateTaskParameterFn:e=>this.cfgParamAspectUpdateTaskParameterFn(e),handleParamUpdateUserActionFn:(e,t)=>this.cfgParamAspectHandleParamUpdateUserActionFn(e,t),returnState:d,taskHandler:this.workflowTaskHandler})}confResumeAdvAspect(){console.log("QAppAdvBase::confResumeAdvAspect"),this.aspects[i.RESUME_ADV_ASPECT].configure({isForcedReinitModificationDetectedFn:()=>this.resumeAdvAspectIsForcedReinitModificationDetectedFn(),isReinitConditionDetectedFn:()=>this.resumeAdvAspectIsReinitConditionDetectedFn(),
isContinueConditionDetectedFn:()=>this.resumeAdvAspectIsContinueConditionDetectedFn(),isPersitentWorkstatePresentFn:()=>{let e=void 0!==this.workstate;return console.log("QAppAdvBase::isPersitentWorkstatePresentFn: ",e),e}})}confIdentifierAspect(e,t=""){console.log("QAppAdvBase::confIdentifierAspect"),this.aspects[E.IDENTIFIER_ASPECT].configure({returnState:e?T:t,taskHandler:this.workflowTaskHandler,autoRememberSIDs:!1}),e&&this.workstate&&this.workstate.measurementData&&this.aspects[E.IDENTIFIER_ASPECT].setLotIDs(this.workstate.measurementData.identifiers)}cfgParamAspectUpdateTaskParameterFn(e){console.log("QAppAdvBase::cfgParamAspectUpdateTaskParameterFn"),this.cfgParamAspectUpdateTaskHandlerAndPublish(e)}cfgParamAspectUpdateTaskHandlerAndPublish(e){return e.type===p.EnumParameterTypes.PARAM_QUANTITY&&_.QuantityParameter.roundToDecimalPlaces(e),!!this.workflowTaskHandler.updateParameter(e)&&(this.cfgParamAspect.publishParameter(e),!0)}cfgParamAspectHandleParamUpdateUserActionFn(e,t){
return!0}cfgParamAspectIsValidFn(){return!0}resumeAdvAspectIsForcedReinitModificationDetectedFn(){let e=!1,t=this.taskHandler.getTask();return console.log("QAppAdvBase::resumeAdvAspectIsForcedReinitModificationDetectedFn"),this.workstate&&this.workstate.initialTaskHandlerData&&t?(e=!this.relevantParamsAreEqual(this.workstate.initialTaskHandlerData.params,t.params),console.log("QAppAdvBase::resumeAdvAspectIsForcedReinitModificationDetectedFn - return ",e)):console.log("QAppAdvBase::resumeAdvAspectIsForcedReinitModificationDetectedFn: no workstate - return ",e),e}resumeAdvAspectIsContinueConditionDetectedFn(){return!1}adaptTaskHandler(){console.log("QAppAdvBase::adaptTaskHandler")}reinitialize(){console.log("QAppAdvBase::reinitialize"),this.reinitWorkstate()}prepReinitializedWorkstate(e){let t=this.taskHandler.getFilteredTask();t?(console.log("QAppAdvBase::prepReinitializedWorkstate - got filtered task parameter"),this.workstate={measurementData:e,
initialTaskHandlerData:c.cloneJSON(this.taskHandler.getTask()),workflowTaskHandlerData:t},this.workflowTaskHandler.setTask(this.workstate.workflowTaskHandlerData)):this.exitError("QAppAdvBase::prepReinitializedWorkstate: No task parameters in taskHandler - unexpected.")}provideStartFsmState(){return i.STATE_ASPECT_RESUME_ADV_CHECK_STARTUP_ENTER}provideFsmStates(){return Object.assign(this.advBaseStates,this.provideSpecificAdvFsmStates())}adaptFsmStates(e){console.log("QAppAdvBase::adaptFsmStates");for(let t in e){let a=e[t].MQTT_ADMIN_EVENT;void 0!==a&&(e[t].MQTT_ADMIN_EVENT_CHILD=a),e[t].MQTT_ADMIN_EVENT=function(a,s){let i=!1;try{i=s.payload.event===u.MQTT_ADMIN_EVENT_PACKET_SENT&&s.payload.packet.topic===A.MqttTopics.HMI_LOADING_MODAL_TEXT&&JSON.parse(s.payload.packet.payload.toString()).args[1]===l.QAPP_SYNC_CALL_DONE_EVENT_TYPE.SYNC_CALL_SAVE_WORKSTATE}catch(e){}i&&(a.saveWorkstateIntern(),
a.addToEventQueue(new l.QAppSyncCallDoneEvent(l.QAPP_SYNC_CALL_DONE_EVENT_TYPE.SYNC_CALL_SAVE_WORKSTATE))),void 0!==e[t].MQTT_ADMIN_EVENT_CHILD&&e[t].MQTT_ADMIN_EVENT_CHILD.call(this,a,s)}}}onFsmTransition(e){if(e.fromState===o.STATE_UNINITIALIZED_INTERNAL){console.log("QAppAdvBase::onFsmTransition - try to load workstate");try{this.workstate=this.taskMngProxy.getWorkstate(this.taskId),console.log("QAppAdvBase::onFsmTransition - got workstate from persistency")}catch(e){console.log("QAppAdvBase::onFsmTransition - no workstate found - error: "+e),this.workstate=void 0}this.workstate&&this.workflowTaskHandler.setTask(this.workstate.workflowTaskHandlerData)}}saveWorkstateIntern(){this.taskMngProxy.saveWorkstate(this.workstate,this.taskId)}saveWorkstate(e=!0){this.workstate&&!this.ignoreSaveWorkstate?(console.log("QAppAdvBase::saveWorkstate - save workstate: "),e?this.showLoadingScreen({id:"_QAPP_LIB_LOADING_OVERLAY_TEXT_SAVE_WORKSTATE",
args:[this.getTaskName(),l.QAPP_SYNC_CALL_DONE_EVENT_TYPE.SYNC_CALL_SAVE_WORKSTATE]}):(this.saveWorkstateIntern(),this.addToEventQueue(new l.QAppSyncCallDoneEvent(l.QAPP_SYNC_CALL_DONE_EVENT_TYPE.SYNC_CALL_SAVE_WORKSTATE)))):this.addToEventQueue(new l.QAppSyncCallDoneEvent(l.QAPP_SYNC_CALL_DONE_EVENT_TYPE.SYNC_CALL_SAVE_WORKSTATE))}deleteWorkstate(){this.workstate&&this.taskMngProxy.deleteWorkstate(this.taskId)}specificRestart(){if(void 0!==this.workstate){try{this.taskMngProxy.deleteWorkstate(this.taskId)}catch(e){console.log("QAppAdvBase Restart: No workstate to delete")}this.workstate=void 0}}onSuspending(){void 0!==this.workstate&&this.saveDisplayValueSelectionWithWorkstate&&(console.log("save last display value info in workstate"),this.workstate.lastDisplayValDomain=this.lastDisplayValDomain,this.workstate.lastDisplayValAppId=this.weighingProxy.getSelectedDisplayValue().lastSelectedApplicationId,this.saveWorkstateIntern()),super.onSuspending()}
restoreLastSelectedDisplayValueInfo(){void 0!==this.workstate&&this.saveDisplayValueSelectionWithWorkstate&&(console.log("restoreLastSelectedDisplayValueInfo"),void 0!==this.workstate.lastDisplayValDomain&&(this.lastDisplayValDomain=this.workstate.lastDisplayValDomain),void 0!==this.workstate.lastDisplayValAppId&&this.weighingProxy.restoreLastSelectedDisplayValue(this.workstate.lastDisplayValAppId))}initPQ(e,t=!1){if(this.workstate&&this.workstate.measurementData&&this.workstate.measurementData.identifiers){e?(console.log("QAppAdvBase::initPQ: start initPQ"),this.addLotIds2PQ(this.workstate.measurementData.identifiers),this.addInitParams2PQ(this.providePQInitTaskParams()),this.initPQIdx=0):console.log("QAppAdvBase::initPQ: continue initPQ"),console.log("QAppAdvBase::initPQ start initPQIdx = "+this.initPQIdx);let a=0;for(;this.initPQIdx<this.workstate.measurementData.samples.length&&(a<10||t);){let e=this.workstate.measurementData.samples[this.initPQIdx];if(this.initPQIdx++,
this.doAddSampleDuringReinit2PQ(e)){let t=this.addSample2PQ(e,!0,!1);e.valid||void 0===t||this.reportingProxy.setRedactionStatus(t.getPrintItemIdentifier(),!0,e.invalidationReason),this.sampleAdded(),a++}}return console.log("QAppAdvBase::initPQ end initPQIdx = "+this.initPQIdx),this.initPQIdx>=this.workstate.measurementData.samples.length}return!0}addSample2PQ(e,t,a){console.log("QAppAdvBase::addSample2PQ"),this.sampleAdded();let s=this.addSample2PQ_withIds(e.identifiers,this.provideSamplePQParams(e),t,a);return this.updateInvalidationAspectSampleConfig({sample:e}),s}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(0),i=a(13),n=a(24),r=a(11),o=a(12);t.RESUME_ADV_ASPECT="RESUME_ADV_ASPECT",t.STATE_ASPECT_RESUME_ADV_CHECK_STARTUP_ENTER="STATE_ASPECT_RESUME_ADV_CHECK_STARTUP_ENTER",t.STATE_ASPECT_RESUME_ADV_REINIT_EXIT="STATE_ASPECT_RESUME_ADV_REINIT_EXIT",t.STATE_ASPECT_RESUME_ADV_CONT_EXIT="STATE_ASPECT_RESUME_ADV_CONT_EXIT"
;const l="STATE_ASPECT_RESUME_ADV_FORCE_REINIT",E="STATE_ASPECT_RESUME_ADV_QUESTION_CONT",_="BTN_OK",u="BTN_REINIT",c="BTN_CONT";t.ResumeAdvancedAspect=class extends n.AbstractQAppAspect{constructor(){super(...arguments),this.states={STATE_ASPECT_RESUME_ADV_CHECK_STARTUP_ENTER:{_onEnter:function(e){e.aspects[t.RESUME_ADV_ASPECT].cfg.isPersitentWorkstatePresentFn()?e.aspects[t.RESUME_ADV_ASPECT].cfg.isForcedReinitModificationDetectedFn()?e.addToEventQueue(new i.ImmediateEvent(l)):e.aspects[t.RESUME_ADV_ASPECT].cfg.isReinitConditionDetectedFn()?e.addToEventQueue(new i.ImmediateEvent(t.STATE_ASPECT_RESUME_ADV_REINIT_EXIT)):e.aspects[t.RESUME_ADV_ASPECT].cfg.isContinueConditionDetectedFn()?e.addToEventQueue(new i.ImmediateEvent(t.STATE_ASPECT_RESUME_ADV_CONT_EXIT)):e.addToEventQueue(new i.ImmediateEvent(E)):e.addToEventQueue(new i.ImmediateEvent(t.STATE_ASPECT_RESUME_ADV_REINIT_EXIT))},_onExit:function(){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,t){this.transition(e,t.payload)
}},STATE_ASPECT_RESUME_ADV_FORCE_REINIT:{_onEnter:function(e){e.showMessageBox({type:r.EnumMessageboxType.INFO,title:{id:"_QAPP_LIB_MSG_BOX_INFO_REINIT_TASK_NECESSARY",args:[]},textList:[{id:"_QAPP_LIB_MSG_BOX_INFO_REINIT_TASK_NECESSARY_TEXT",args:[]}],buttons:[{id:_,label:{id:o.EnumFontLabels.OK,args:[]},appearance:s.EnumAppearance.ENABLED_SECONDARY}]})},_onExit:function(e){e.hideMsgBox()},_transTo:{},_transFrom:{},EV_HMI_BTN_CLICKED:function(e,a){a.payload.buttonId===_&&this.transition(e,t.STATE_ASPECT_RESUME_ADV_REINIT_EXIT)}},STATE_ASPECT_RESUME_ADV_QUESTION_CONT:{_onEnter:function(e){e.showMessageBox({type:r.EnumMessageboxType.QUESTION,title:{id:"_QAPP_LIB_MSG_BOX_QUESTION_RESUME_CONTINUE",args:[]},textList:[{id:"_QAPP_LIB_MSG_BOX_QUESTION_RESUME_CONTINUE_TEXT",args:[]}],buttons:[{id:u,label:{id:"_QAPP_LIB_MSG_BOX_QUESTION_RESUME_CONTINUE_BTN_REINIT",args:[]},appearance:s.EnumAppearance.ENABLED_SECONDARY},{id:c,label:{id:"_QAPP_LIB_MSG_BOX_QUESTION_RESUME_CONTINUE_BTN_CONTINUE",
args:[]},appearance:s.EnumAppearance.ENABLED_PRIMARY}]})},_onExit:function(e){e.hideMsgBox()},_transTo:{},_transFrom:{},EV_HMI_BTN_CLICKED:function(e,a){a.payload.buttonId===u?this.transition(e,t.STATE_ASPECT_RESUME_ADV_REINIT_EXIT):a.payload.buttonId===c&&this.transition(e,t.STATE_ASPECT_RESUME_ADV_CONT_EXIT)}}}}getId(){return t.RESUME_ADV_ASPECT}getAspectStates(){return this.states}init(e){this.client=e,this.client?console.log("ResumeAdvancedAspect::init"):console.log("ResumeAdvancedAspect::init - aspect not correctly initialized (no client set) - skip init")}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(19),i=a(82),n=a(9),r=a(33),o=a(3),l=a(32),E=a(28),_=a(13),u=a(84),c=a(85),A=a(40),p=a(30),d=a(2),T=a(1),I=a(0);t.QAppWorkflowBase=class extends s.QAppBase{constructor(e){super(e),this.takeoverBtnPending=!1,this.lastDisplayValDomain=A.ISelectedWeightDisplayValueDomains.SELECTED_DOMAIN_UNDEFINED,this.doRememberLastDisplayValDomain=!1,
this.identifierAspect=new i.IdentifierAspect,this.registerAspect(this.identifierAspect),this.weighingProxy.selectedDisplayValue$.subscribe(e=>{this.doRememberLastDisplayValDomain&&(this.lastDisplayValDomain=e.currentSelectedDomain)})}init(){console.log("QAppWorkflowBase::init"),super.init(),this.identifierAspect.resetSIDsPrevSample(),this.mqttHandler.subscribe(T.MqttTopics.HMI_PRINT_HEADER),this.lastDisplayValDomain=A.ISelectedWeightDisplayValueDomains.SELECTED_DOMAIN_UNDEFINED,this.doRememberLastDisplayValDomain=!1}postInit(){console.log("QAppWorkflowBase::postInit"),super.postInit(),this.confIdentifierAspect(!0,"")}processCLParameters(e){e.length>=5?(this.scriptPath=e[1],this.taskId=e[4],console.log("QAppWorkflowBase: got taskId: "+this.taskId)):(this.taskId=void 0,this.exitError("QAppWorkflowBase::processCLParameters - workflow-Script called without taskId parameter"))}initTaskHandler(){console.log("QAppWorkflowBase: initTaskHandler"),this.loadTask()}adaptTaskHandler(){
console.log("QAppWorkflowBase: adaptTaskHandler")}handleDocuButton(){let e=this.addRemainingDataToPQ();e.length>0&&this.updateRemainingDataPQIDs(e),this.showPrintQueue()}handleEvent(e){if(e instanceof E.MqttUpdateEvent&&e.payload.topic===T.MqttTopics.HMI_PRINT_HEADER)try{JSON.parse(e.payload.value.toString()).isPrintHeaderDisplayed||(this.updateTakeoverBtnToLastRequestedAppearance(),this.takeoverBtnPending=!1)}catch(e){}else{if(e instanceof _.QAppTimerEvent&&"TAKEOVER_BTN_TIMER"===e.payload.id)return this.updateTakeoverBtnToLastRequestedAppearance(),void(this.takeoverBtnPending=!1)
;e instanceof p.HmiButtonClickedEvent&&void 0!==this.buttons.takeoverBtn&&e.payload.buttonId===this.buttons.takeoverBtn.getButtonId()&&(this.buttons.takeoverBtn.getAppearance()!==I.EnumAppearance.ENABLED&&this.buttons.takeoverBtn.getAppearance()!==I.EnumAppearance.ENABLED_SECONDARY&&this.buttons.takeoverBtn.getAppearance()!==I.EnumAppearance.ENABLED_PRIMARY||this.lastRequestedTakeoverBtnAppearance!==I.EnumAppearance.ENABLED&&this.lastRequestedTakeoverBtnAppearance!==I.EnumAppearance.ENABLED_SECONDARY&&this.lastRequestedTakeoverBtnAppearance!==I.EnumAppearance.ENABLED_PRIMARY)||super.handleEvent(e)}}notifyTakeOver(e=!1){this.buttons.takeoverBtn&&(this.takeoverBtnPending=!0,this.lastRequestedTakeoverBtnAppearance!==I.EnumAppearance.HIDDEN&&this.buttons.takeoverBtn.setAppearance(I.EnumAppearance.DISABLED),e&&this.addTimer(1e3,{id:"TAKEOVER_BTN_TIMER"}))}updateRequestedTakeoverButtonAppearance(e){this.lastRequestedTakeoverBtnAppearance=e,
this.takeoverBtnPending||this.updateTakeoverBtnToLastRequestedAppearance()}updateTakeoverBtnToLastRequestedAppearance(){this.buttons.takeoverBtn&&this.buttons.takeoverBtn.setAppearance(this.lastRequestedTakeoverBtnAppearance)}rememberLastSelectedDisplayValueDomain(e){this.doRememberLastDisplayValDomain=e}getLastSelectedDisplayValueDomain(){return this.lastDisplayValDomain}selectLastSelectedDisplayValue(e){this.lastDisplayValDomain===A.ISelectedWeightDisplayValueDomains.SELECTED_DOMAIN_APP?""!==this.weighingProxy.getSelectedDisplayValue().lastSelectedApplicationId?(console.log("restore last selected display display value: "+this.weighingProxy.getSelectedDisplayValue().lastSelectedApplicationId),this.weighingProxy.selectWeightApplication(this.weighingProxy.getSelectedDisplayValue().lastSelectedApplicationId)):(console.log("restore last selected display value: no AppId stored -> select QApp default: "+e),
this.weighingProxy.selectWeightApplication(e)):this.lastDisplayValDomain===A.ISelectedWeightDisplayValueDomains.SELECTED_DOMAIN_UNDEFINED?(console.log("restore last selected display value: undefined domain -> select QApp default: "+e),this.weighingProxy.selectWeightApplication(e)):console.log("restore last selected display value: WEIGHING was selected - do nothing")}addInitParams2PQ(e){if(console.log("QAppWorkflowBase::addInitParams2PQ"),e.length>0)return this.reportingProxy.printParameters(e,r.REPORTING_CATEGORY_INIT,!1)}addLotIds2PQ(e){console.log("QAppWorkflowBase::addLotIds2PQ");let t=[],a=this.identifierAspect.getLotVisualParams().map(e=>d.cloneJSON(e.getValue()));return e.forEach((e,s)=>{i.IdentifierAspect.getLotState(s,this.taskHandler)!==l.EnumLotIdentifierOptions.OFF&&""!==e&&(a[s].value.string=e,a[s].appearance=I.EnumAppearance.ENABLED,t.push(a[s]))}),this.addInitParams2PQ(t)}addSample2PQ_withIds(e,t,a,s){console.log("QAppWorkflowBase::addSample2PQ_withIds")
;let i=[],o=n.remove(t,e=>e.id===c.PARAM_ID_SAMPLE_NO);i.push(...o),i.push(...this.prepSampleIdParams4PQ(e)),o=n.remove(t,e=>e.id===c.PARAM_ID_SAMPLE_DATE),i.push(...o),i.push(...t);let l=this.reportingProxy.printParameters(i,a?r.REPORTING_CATEGORY_COMPONENTS:r.REPORTING_CATEGORY_NONE,s);return this.updateLastSamplePQID(l.getPrintItemIdentifier()),this.updateRemainingDataPQIDs([]),console.log("QAppWorkflowBase::addSample2PQ_withIds: done"),l}prepSampleIdParams4PQ(e){console.log("QAppWorkflowBase::prepSampleIdParams4PQ");let t=[],a=this.identifierAspect.getSIDVisualParams().map(e=>d.cloneJSON(e.getValue()));return e.forEach((e,s)=>{i.IdentifierAspect.getSIDState(s,this.taskHandler)!==l.EnumSampleIdentifierOptions.OFF&&""!==e&&(a[s].value.string=e,a[s].appearance=I.EnumAppearance.ENABLED,t.push(a[s]))}),t}addStatistic2PQ(e,t){if(console.log("QAppWorkflowBase::addStatistic2PQ"),t&&t.getValues().currCalcValues.numSamples>0){let a=[],s=t.getValues().currStatPublishableParameters;if(e){
let t=o.createEmptyTextParameter();t.value.text.id=e,t.info.suppressTitle=!0,a.push(t)}if(s.n.getValue().appearance!==I.EnumAppearance.HIDDEN&&a.push(s.n.getValue()),s.avg.getValue().appearance!==I.EnumAppearance.HIDDEN&&a.push(s.avg.getValue()),s.dev.getValue().appearance!==I.EnumAppearance.HIDDEN&&a.push(s.dev.getValue()),s.variation.getValue().appearance!==I.EnumAppearance.HIDDEN&&a.push(s.variation.getValue()),s.sum.getValue().appearance!==I.EnumAppearance.HIDDEN&&a.push(s.sum.getValue()),s.min.getValue().appearance!==I.EnumAppearance.HIDDEN&&a.push(s.min.getValue()),s.max.getValue().appearance!==I.EnumAppearance.HIDDEN&&a.push(s.max.getValue()),s.diff.getValue().appearance!==I.EnumAppearance.HIDDEN&&a.push(s.diff.getValue()),a.length>0)return this.reportingProxy.printParameters(a,r.REPORTING_CATEGORY_STATISTIC,!1)}}sampleAdded(){console.log("QAppWorkflowBase::sampleAdded"),void 0!==this.buttons.docuButton&&this.buttons.docuButton.setAppearance(I.EnumAppearance.ENABLED_SECONDARY)}
updateRemainingDataPQIDs(e){console.log("QAppWorkflowBase::updateRemainingDataPQIDs ids: "+e),this.updateInvalidationAspectSampleConfig({dependentPrintItemIds:e})}updateLastSamplePQID(e){console.log("QAppWorkflowBase::updateLastSamplePQID id: "+e),this.updateInvalidationAspectSampleConfig({samplePrintItemId:e})}updateInvalidationAspectSampleConfig(e){console.log("QAppWorkflowBase::updateInvalidationAspectSampleConfig");for(let t in this.aspects)if(t===u.INVAL_SAMPLE_ASPECT)return void this.aspects[t].updateCfgSampleOnly(e)}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(10),i=a(86),n=a(0),r=a(4),o=a(7),l=a(1);t.TAB_SCREEN_ID="TABBEDSCREEN",t.BACK_BUTTON_ID="BTN_BACK",t.BACK_BUTTON_ID_PREFIX=t.BACK_BUTTON_ID+"_";const E={buttonId:"BUTTONS/"+t.BACK_BUTTON_ID,label:{id:"",args:[]},appearance:n.EnumAppearance.ENABLED};t.TabScreen=class extends i.TabApi{constructor(e){super(e,t.TAB_SCREEN_ID),this.events$=new o.Subject,
this.backButton=new s.Button(this.mqttHandler,this,E)}hide(){this.mqttHandler.publish(l.MqttTopics.HMI_TABBED_SCREEN,'{ "appearance":"'+n.EnumAppearance.HIDDEN+'" }'),this.events$.next({type:r.ScreenEventType.HIDE_OVERLAY,id:this.getId()})}show(){this.backButton.publish(),this.getTabList().forEach(e=>e.publish()),this.mqttHandler.publish(l.MqttTopics.HMI_TABBED_SCREEN,'{ "appearance":"'+n.EnumAppearance.ENABLED+'" }'),this.events$.next({type:r.ScreenEventType.SHOW_OVERLAY,id:this.getId()})}getId(){return t.TAB_SCREEN_ID}getButton(e){if(e===t.BACK_BUTTON_ID)return this.backButton}hideBackButton(){this.backButton.setAppearance(n.EnumAppearance.HIDDEN)}showBackButton(){this.backButton.setAppearance(n.EnumAppearance.ENABLED)}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(44);t.TabFigure=class extends s.TabBase{constructor(e,t,a,s=!1){super(t,a,s),this.imageUrl={url:""},this.imageId={id:""},this.setTabData(e)}setTabImgRefUrl(e){
this.imageUrl.url!==e&&(this.imageUrl.url=e,this.tabData.imgref=this.imageUrl,this.publishIfEnabled())}setTabImgRefId(e){this.imageId.id!==e&&(this.imageId.id=e,this.tabData.imgref=this.imageId,this.publishIfEnabled())}getTabImgRef(){return this.tabData.imgref}getTabData(){return this.tabData}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.functionReplacer=function(e,t){return"function"==typeof t?t.toString().replace(/(\/\*([\s\S]*?)\*\/)|(\/\/(.*)$)/gm,"").replace(/\s\s+/g,""):t},t.functionReviver=function(e,t){if(""===e)return t;if("string"==typeof t){let e=/function[^\(]*\(([^\)]*)\)[^\{]*\{([^]*)\}/,a=t.match(e);if(a){let e=a[1].split(",").map(function(e){return e.replace(/\s+/,"")});return new Function(...e,a[2])}}return t}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(44),i=a(9);t.TabGraph=class extends s.TabBase{constructor(e,t,a,s=!1){super(t,a,s),this.setTabData(e)}setData(e,t=!0){
i.isEqual(this.tabData.data,e)||(this.tabData.data=e,t?this.publishIfEnabled():this.publishPending=!0)}getData(){return this.tabData.data}getTabData(){return this.tabData}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(44),i=a(52);t.TabParamList=class extends s.TabBase{constructor(e,t,a,s=!1){super(t,a,s),this.setTabData(e)}setTabParams(e){if(this.tabData)if(!i.isITabParamList(this.tabData)||"string"!=typeof e[0]&&0!==e.length){if(!i.isITabBulkParamList(this.tabData)||"object"!=typeof e[0]&&0!==e.length)throw new Error("TabParamList: given type for parameters and mode of tab does not match");this.tabData.bulkParameters.join()!==e.join()&&(this.tabData.bulkParameters=e,this.publishIfEnabled())}else this.tabData.params.join()!==e.join()&&(this.tabData.params=e,this.publishIfEnabled())}getTabParams(){if(this.tabData){if(i.isITabParamList(this.tabData))return this.tabData.params
;if(i.isITabBulkParamList(this.tabData))return this.tabData.bulkParameters;throw new Error("TabParamList expected type of tabdata found")}return[]}setTabDisplayHeader(e){this.tabData.displayHeader!==e&&(this.tabData.displayHeader=e,this.publishIfEnabled())}getTabDisplayHeader(){return this.tabData.displayHeader}publishTabParams(){this.publish()}getTabData(){return this.tabData}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(44),i=a(52),n=a(10);t.TabMenu=class extends s.TabBase{constructor(e,t,a,s=!1){super(t,a,s),this.setTabData(e)}setTabMenuButtons(e,t=!0){if(this.tabData&&e.length>0)if(console.log("isMenu:"+i.isITabMenu(this.tabData)),console.log("isMenuBulk:"+i.isITabBulkMenu(this.tabData)),console.log("buttons:"+JSON.stringify(e)),i.isITabMenu(this.tabData)&&"string"==typeof e[0])this.tabData.menubuttons.join()!==e.join()&&(this.tabData.menubuttons=e,t&&this.publishIfEnabled());else{
if(!i.isITabBulkMenu(this.tabData)||"object"!=typeof e[0])throw new Error("TabMenu: given type for buttons and mode of tab does not match");JSON.stringify(this.tabData.menuBulkButtons)!==JSON.stringify(e)&&(this.tabData.menuBulkButtons=e.map(e=>n.IButtonParameterInterface2IButtonJsonInterface(e)),t&&this.publishIfEnabled())}}getTabMenuButtons(){if(this.tabData){if(i.isITabMenu(this.tabData))return this.tabData.menubuttons;if(i.isITabBulkMenu(this.tabData))return this.tabData.menuBulkButtons.map(e=>n.IButtonJsonInterface2IButtonParameterInterface(e));throw new Error("TabMenu expected type of tabdata found")}return[]}getTabData(){return this.tabData}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(44),i=a(52);t.TabTable=class extends s.TabBase{constructor(e,t,a,s=!1){super(t,a,s),this.setTabData(e)}setTabMenuButtons(e,t=!0){if(this.tabData&&e.length>0)if(console.log("isTable:"+i.isITabTable(this.tabData)),
console.log("isMTableBulk:"+i.isITabBulkTable(this.tabData)),console.log("buttons:"+JSON.stringify(e)),i.isITabTable(this.tabData)&&"string"==typeof e[0])this.tabData.menubuttons.join()!==e.join()&&(this.tabData.menubuttons=e,t&&this.publishIfEnabled());else{if(!i.isITabBulkTable(this.tabData)||"object"!=typeof e[0])throw new Error("TabMTable: given type for buttons and mode of tab does not match");JSON.stringify(this.tabData.menuBulkButtons)!==JSON.stringify(e)&&(this.tabData.menuBulkButtons=e,t&&this.publishIfEnabled())}}getTabMenuButtons(){if(this.tabData){if(i.isITabTable(this.tabData))return this.tabData.menubuttons;if(i.isITabBulkTable(this.tabData))return this.tabData.menuBulkButtons;throw new Error("TabTable expected type of tabdata found")}return[]}getTabData(){return this.tabData}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(48),i=a(86),n=a(1),r=a(4),o=a(10),l=a(20),E=a(49),_=a(0);t.WEIGHING_SPLIT_SCREEN_ID="WEIGHINGSPLIT"
;const u={buttonId:"BARBUTTON/CANCEL",label:{id:"",args:[]},appearance:_.EnumAppearance.HIDDEN};t.WeighingSplitScreen=class extends r.AbstractScreen{constructor(e,t){super(e),this.buttonList=[],this.text1={value:"",wildcards:[]},this.text2={value:"",wildcards:[]},this.param1="",this.param2="",this.title=void 0,this.createBarButtons(t),this.publishBarButtons(),this.checkBarGraph=new E.CheckBarGraph(e),this.cancelBarButton=new o.default(this.mqttHandler,this,u),this.tabApi=new i.TabApi(e,this.getId())}getId(){return t.WEIGHING_SPLIT_SCREEN_ID}getTabApi(){return this.tabApi}getBarButtonId(){return n.MqttTopics.HMI_WEIGHINGSPLIT_SCREEN_BARBUTTONS}createBarButtons(e){e.sort(this.compareButtonBarButtons);for(let t of e){let e=new o.default(this.mqttHandler,this,t);this.buttonList.push(e),e.publish()}}publishBarButtons(){let e=[];for(let t of this.buttonList)e.push(n.MqttTopics.QAPP_NAMESPACE+"/"+t.getTopic());this.mqttHandler.publish(this.getBarButtonId(),JSON.stringify(e))}setText1(e,t){
let a=!1;this.text1.value!==e&&(this.text1.value=e,a=!0),t&&this.text1.wildcards.join()!==t.join()&&(this.text1.wildcards=t,a=!0),a&&this.publishText1()}compareButtonBarButtons(e,t){return l.getButtonPriority(e.buttonId)-l.getButtonPriority(t.buttonId)}publishText1(){this.mqttHandler.publish(n.MqttTopics.HMI_WEIGHINGSPLIT_SCREEN_INSTRUCTION1,JSON.stringify(this.text1),{retain:!0})}publishText2(){this.mqttHandler.publish(n.MqttTopics.HMI_WEIGHINGSPLIT_SCREEN_INSTRUCTION2,JSON.stringify(this.text2),{retain:!0})}setText2(e,t){let a=!1;this.text2.value!==e&&(this.text2.value=e,a=!0),t&&this.text2.wildcards.join()!==t.join()&&(this.text2.wildcards=t,a=!0),a&&this.publishText2()}publishTitle(){this.title?this.mqttHandler.publish(n.MqttTopics.HMI_WEIGHINGSPLIT_SCREEN_TITLE,JSON.stringify(this.title),{retain:!0}):this.mqttHandler.publish(n.MqttTopics.HMI_WEIGHINGSPLIT_SCREEN_TITLE,"",{retain:!0})}setTitle(e){let t=void 0;this.title&&(t=JSON.stringify(this.title)),this.title=e,
this.title!==t&&this.publishTitle()}getText1(){return this.text1}getText2(){return this.text2}publishParam1(){this.mqttHandler.publish(n.MqttTopics.HMI_WEIGHINGSPLIT_SCREEN_PARAM1_TOPIC,JSON.stringify(this.param1),{retain:!0})}publishParam2(){this.mqttHandler.publish(n.MqttTopics.HMI_WEIGHINGSPLIT_SCREEN_PARAM2_TOPIC,JSON.stringify(this.param2),{retain:!0})}setParam1(e){this.param1!==e&&(this.param1=e,this.publishParam1())}setParam2(e){this.param2!==e&&(this.param2=e,this.publishParam2())}getParam1(){return this.param1}getParam2(){return this.param2}getButton(e){if(e===s.CANCEL_BARBUTTON_ID)return this.cancelBarButton;for(let t of this.buttonList)if(t.getButtonId()===e)return t}show(){this.publishText1(),this.publishText2(),this.publishTitle(),this.publishParam1(),this.publishParam2();for(let e of this.buttonList)e.publish();super.show()}getCheckBarGraph(){return this.checkBarGraph}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(106),i=a(107)
;t.QAppMeasurementData=class extends s.Measurement{createEmptySampleData(e){let t=i.createEmptyCountSampleData();return t.sampleNo=e,t}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Measurement=class{constructor(e){this.data=e}getIdentifiers(){return this.data.identifiers}getSamples(){return this.data.samples}getSample(e){return this.data.samples.find(t=>t.sampleNo===e)}addSample(){let e=this.getNumberOfSamples()+1,t=this.createEmptySampleData(e);return t.sampleNo=e,console.log("Measurement: addSample as sampleNo: ",t.sampleNo," old array length: ",this.getNumberOfSamples()),this.data.samples.push(t),t}getNumberOfSamples(){return this.data.samples.length}getIdxOfSample(e){return this.data.samples.findIndex(t=>t.sampleNo===e)}getLastSample(){return this.data.samples.length>0?this.data.samples[this.data.samples.length-1]:void 0}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(9),i={date:0,identifiers:[],
sampleNo:0,valid:!0,invalidationReason:"",alibiID:-1,check:"",count:-1};t.createEmptyCountSampleData=function(){return s.cloneDeep(i)}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(3),i=a(24),n=a(13),r=a(33),o=a(0),l=a(51),E=a(1);t.WAITING_STABILITY_ASPECT="WAITING_STABILITY_ASPECT",t.STATE_ASPECT_WAITING_FOR_STABILITY="STATE_ASPECT_WAITING_FOR_STABILITY",t.STABLE_WEIGHT_DATE_TIME_ID="STABLE_WEIGHT_DATE_TIME_ID";const _="WAITING_STABILITY_ASPECT_TIMEOUT_ID";var u;!function(e){e[e.WaitStableModeWeighing=0]="WaitStableModeWeighing",e[e.WaitStableModeReporting=1]="WaitStableModeReporting"}(u=t.WaitingForStabilityModeEnum||(t.WaitingForStabilityModeEnum={}));t.WaitingStabilityAspect=class extends i.AbstractQAppAspect{constructor(){super(),this.states={STATE_ASPECT_WAITING_FOR_STABILITY:{_onEnter:function(e){let a=e.aspects[t.WAITING_STABILITY_ASPECT];switch(a.stableWeightBlock=void 0,a.alibiId=void 0,a.dateTime.value.timestamp=0,
void 0!==a.cfg.timeout&&(a.waitStabilityTimeoutTimer=e.addTimer(a.cfg.timeout.timer,_)),a.cfg.mode){case u.WaitStableModeReporting:console.log("waitStabAsp: reporting mode");const s=void 0!==a.cfg.comment?a.cfg.comment:"";e.reportingProxy.requestPrintableValue(s).isSuccess()||(console.log("waitStabAsp: trigger failed"),e.addToEventQueue(new n.ImmediateEvent({from:t.STATE_ASPECT_WAITING_FOR_STABILITY,to:a.cfg.exitStateNoStability})));break;case u.WaitStableModeWeighing:default:console.log("waitStabAsp: weighing mode"),e.weighingProxy.triggerStableWeightBlock().isSuccess()||(console.log("waitStabAsp: trigger failed"),e.addToEventQueue(new n.ImmediateEvent({from:t.STATE_ASPECT_WAITING_FOR_STABILITY,to:a.cfg.exitStateNoStability})))}},_onExit:function(e){const a=e.aspects[t.WAITING_STABILITY_ASPECT];e.cancelTimer(a.waitStabilityTimeoutTimer)},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,a){
a.payload.from&&a.payload.from===t.STATE_ASPECT_WAITING_FOR_STABILITY&&this.transition(e,a.payload.to)},EV_MQTT_UPDATE:function(e,a){const i=e.aspects[t.WAITING_STABILITY_ASPECT],n=i.cfg;switch(a.payload.topic){case E.MqttTopics.WEIGHING_WEIGHT_BLOCK:if(n.mode===u.WaitStableModeWeighing){e.cancelTimer(i.waitStabilityTimeoutTimer);let s=JSON.parse(a.payload.value.toString());n.isWeightValueValid&&!1===n.isWeightValueValid(s)?this.transition(e,n.exitStateNotValid):(e.aspects[t.WAITING_STABILITY_ASPECT].stableWeightBlock=s,e.aspects[t.WAITING_STABILITY_ASPECT].dateTime.value.timestamp=l.getTime(),this.transition(e,n.nextState))}break;case E.MqttTopics.WEIGHING_WAITING_FOR_STABILITY:n.mode===u.WaitStableModeWeighing&&!1===JSON.parse(a.payload.value.toString()).state&&(e.cancelTimer(i.waitStabilityTimeoutTimer),this.transition(e,n.exitStateNoStability));break;case E.MqttTopics.REPORTING_PRINTABLE_VALUE:if(n.mode===u.WaitStableModeReporting){e.cancelTimer(i.waitStabilityTimeoutTimer)
;let t=JSON.parse(a.payload.value.toString());if(t.state===r.ReportingPrintableValueStateEnum.STABLE){let a=s.createEmptyParameterGroupOfGroups();a.id=E.MqttTopics.REPORTING_PRINTABLE_VALUE,a.parameters[0].parameters=[...t.weightBlock],console.log(JSON.stringify(a)),n.isWeightValueValid&&!1===n.isWeightValueValid(a)?this.transition(e,n.exitStateNotValid):(i.stableWeightBlock=a,i.alibiId=t.alibiId,i.dateTime.value.timestamp=l.getTime(),this.transition(e,n.nextState))}else this.transition(e,n.exitStateNoStability)}break;case E.MqttTopics.WEIGHING_STATUS_ERROR:n.mode===u.WaitStableModeWeighing&&0!==JSON.parse(a.payload.value.toString()).state.code&&(e.cancelTimer(i.waitStabilityTimeoutTimer),this.transition(e,n.exitStateNoStability));break;default:n.handleMqttEvent&&n.handleMqttEvent(a)}},QAPP_TIMER_EVENT:function(e,a){if(a.payload===_){let a=e.aspects[t.WAITING_STABILITY_ASPECT];if(a.cfg.timeout)return e.weighingProxy.cancelStableWeightBlock(),
void this.transition(e,a.cfg.timeout.exitStateTimeout)}}}},this.dateTime=s.createEmptyDateTimeParameter(),this.dateTime.id=t.STABLE_WEIGHT_DATE_TIME_ID,this.dateTime.appearance=o.EnumAppearance.ENABLED,this.dateTime.info={isDate:!0,isTime:!0}}getId(){return t.WAITING_STABILITY_ASPECT}getAspectStates(){return this.states}init(e){this.client=e,this.client?(console.log("WaitingStabilityAspect::init"),this.client.mqttHandler.subscribe(E.MqttTopics.WEIGHING_WEIGHT_BLOCK),this.client.mqttHandler.subscribe(E.MqttTopics.WEIGHING_WAITING_FOR_STABILITY),this.client.mqttHandler.subscribe(E.MqttTopics.REPORTING_PRINTABLE_VALUE)):console.log("WaitingStabilityAspect::init - aspect not correctly initialized (no client set) - skip init")}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(3),i=a(27),n=a(8),r=a(14);class o{constructor(e,t=!1){this.value=void 0,this.scaleInterval=NaN,e&&this.setValue(e,t)}setValue(e,t=!1){this.value=e,t&&this.setScaleValue(e)}
getValue(){return this.value}getValue_(){return this.getValue()}isPositive(){return!!this.value&&"+"===this.value.value.sign}isNegative(){return!!this.value&&"-"===this.value.value.sign}isStable(){return!!this.value&&this.value.value.isStable}setScaleValue(e){this.setScaleInterval(e.value.interval)}setScaleInterval(e){isNaN(e)||e<=0?(console.log("MeasureParameter::setScaleInterval: invalid incoming interval value"),this.scaleInterval=NaN):this.scaleInterval=e}getScaleDecimals(){if(isNaN(this.scaleInterval))return console.log("MeasureParameter::getScaleDecimals: invalid interval value NaN"),NaN;{let e=0,t=this.scaleInterval;if(this.scaleInterval<=0)return console.log("MeasureParameter::getScaleDecimals: invalid interval value <= 0"),NaN;for(;t<1;){if(0===t)return console.log("MeasureParameter::getScaleDecimals: numeric error - interval rounded to zero in calculation"),NaN;t*=10,e++}return e}}getScaleInterval(){return this.scaleInterval}getScaleDivider(){let e=this.getScaleInterval()
;if(Number.isNaN(e))return NaN;if(e<=0)return console.log("MeasureParameter::getScaleDivider: invalid interval value <= 0"),NaN;if(e<1){for(;e<1;)if(0===(e*=10))return console.log("MeasureParameter::getScaleDivider: numeric error - interval rounded to zero in calculation"),NaN}else for(;e>=10;)e/=10;return e}setFloat(e,t,a=!1){let s=t-Math.floor(Math.abs(e)).toString().length,n=Math.max(s,0);if(this.value)if(Number.isNaN(e))this.value.value.number="NaN",this.value.value.isSpecial=!0,this.value.value.isInvalid=!0;else{let t=this.getScaleDecimals(),s=this.getScaleInterval();if(Number.isNaN(t)||Number.isNaN(s))this.value.value.number="NaN",this.value.value.isSpecial=!0,this.value.value.isInvalid=!0;else{if(n<t)t=n,e=i.SartoMath.roundExactToDecimals(e,t),s=i.SartoMath.decPowers(-1*t);else if(s<1){let n=1;a?n=this.getScaleDivider():s/=this.getScaleDivider(),e=i.SartoMath.nTimesTen(e,t),e/=n,e=i.SartoMath.roundExact(e),e*=n,e=i.SartoMath.nTimesTen(e,-1*t)}else a||(s/=this.getScaleDivider()),
e/=s,e=i.SartoMath.roundExact(e),e*=s;this.value.value.number=Math.abs(e).toFixed(t),this.value.value.sign="",e<0&&-0!==e&&(this.value.value.sign="-"),e>0&&0!==e&&(this.value.value.sign="+"),this.value.value.decimals=t,this.value.value.interval=s}}}round(e,t=!1){if(this.value){let a=this.getFloat();Number.isNaN(a)||this.setFloat(a,e,t)}return this}getAbsFloat(){return this.value?parseFloat(this.value.value.number):NaN}getFloat(){let e=this.getAbsFloat();return Number.isNaN(e)?NaN:this.applySign(e)}isUseDisabled(){let e=!0;return e=!this.value||(this.value.value.isInvalid||this.value.value.isSpecial)}isSpecial(){return!!this.value&&this.value.value.isSpecial}getStepsAbs(){let e=0;if(this.value){let t=this.getScaleInterval();Number.isNaN(t)||(t<1?(e=this.getAbsFloat(),e=i.SartoMath.nTimesTen(e,this.getScaleDecimals()),e/=this.getScaleDivider()):e=this.getAbsFloat()/t,e=i.SartoMath.roundExact(e))}return e}getSteps(){return this.applySign(this.getStepsAbs())}applySign(e){
return!Number.isNaN(e)&&this.value?"-"===this.value.value.sign?-1*e:e:NaN}getSign(){return void 0!==this.value?this.value.value.sign:"N/A"}getUnit(){return void 0!==this.value?this.value.value.unit:"none"}static convertValueQuantityToMeasure(e,t,a,l=0,E=!1,_=!1,u=!0,c=!1){let A=n.QuantityParameter.getValue(e),p={mark:a,unit:r.isArray(e.unit)?e.unit[0]:e.unit,sign:"",number:"NaN",decimals:0,interval:0,auxiliaryDigits:l,isSpecial:_,isInvalid:E,isStable:u,isWarning:c},d=s.createEmptyMeasureParameter();d.value=p;let T=new o(d,!0);return T.setScaleInterval(i.SartoMath.decPowers(-1*e.decimals)),Number.isNaN(A)?p.isSpecial=!0:T.setFloat(A,t,!1),p}}t.MeasureParameter=o},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(9),i=a(111),n=a(2);t.CheckweighingCounterChart=class extends i.BaseChart{constructor(){super(...arguments),this.minMax={minTol:0,maxTol:8200},this.minMax2=void 0,this.minMax3=void 0,this.plausibility=void 0,this.labels={oop:{
id:"_QAPP_LIB_CHART_CHECKWEIGHING_COUNTER_OOP_LABEL",args:[]},min3:{id:"_QAPP_LIB_CHART_CHECKWEIGHING_COUNTER_MIN_3_LABEL",args:[]},min2:{id:"_QAPP_LIB_CHART_CHECKWEIGHING_COUNTER_MIN_2_LABEL",args:[]},min:{id:"_QAPP_LIB_CHART_CHECKWEIGHING_COUNTER_MIN_1_LABEL",args:[]},ok:{id:"_QAPP_LIB_CHART_CHECKWEIGHING_COUNTER_OK_LABEL",args:[]},max:{id:"_QAPP_LIB_CHART_CHECKWEIGHING_COUNTER_MAX_1_LABEL",args:[]},max2:{id:"_QAPP_LIB_CHART_CHECKWEIGHING_COUNTER_MAX_2_LABEL",args:[]},max3:{id:"_QAPP_LIB_CHART_CHECKWEIGHING_COUNTER_MAX_3_LABEL",args:[]}},this.lastDataPointAdded=void 0}init(e,t){if(this.graphTab=e,this.initialized=!0,this.minMax=t.minMax,this.minMax2=t.minMax2,this.minMax3=t.minMax3,this.plausibility=t.plausibility,void 0!==t.labels)for(const e of Object.keys(t.labels))void 0!==t.labels[e]&&(this.labels[e]=t.labels[e]);if(s.assign(this.chartConfiguration,this.baseChartSetup()),void 0===this.minMax2)this.setEmptyDatasets(!1,!1,void 0!==this.plausibility),
this.setDatasetColors(!1,!1,void 0!==this.plausibility);else if(void 0!==this.minMax2&&void 0===this.minMax3)this.setEmptyDatasets(!0,!1,void 0!==this.plausibility),this.setDatasetColors(!0,!1,void 0!==this.plausibility);else{if(void 0===this.minMax2||void 0===this.minMax3)throw new Error("Chart initialization faulty!");this.setEmptyDatasets(!0,!0,void 0!==this.plausibility),this.setDatasetColors(!0,!0,void 0!==this.plausibility)}this.setupQAppChartData(),this.resetGraphTab()}addValue(e){if(!this.initialized)throw new Error("Chart object still not initialized.");{this.chartValues.push(e),this.updateLastDataPointAdded(e),this.canRemoveLastValue=!0,this.chartConfiguration.datasets[this.lastDataPointAdded.dataset].data[this.lastDataPointAdded.field]++;let t=parseFloat(this.chartConfiguration.labels[this.lastDataPointAdded.field]);t++,this.chartConfiguration.labels[this.lastDataPointAdded.field]=t.toString(),this.updateYAxesMax(),this.setLayoutOptionsAndSetTabData()}}
updateLastDataPointAdded(e){if(void 0===this.minMax2&&void 0===this.plausibility)e<this.minMax.minTol?this.lastDataPointAdded={dataset:1,field:0}:this.minMax.minTol<=e&&e<=this.minMax.maxTol?this.lastDataPointAdded={dataset:0,field:1}:this.lastDataPointAdded={dataset:1,field:2};else if(void 0===this.minMax2&&void 0!==this.plausibility){if("number"==typeof this.plausibility){if(e<this.plausibility)return this.lastDataPointAdded={dataset:2,field:0},!1}else if(void 0!==this.plausibility.lower&&e<this.plausibility.lower||void 0!==this.plausibility.upper&&this.plausibility.upper<e)return this.lastDataPointAdded={dataset:2,field:0},!1;e<this.minMax.minTol?this.lastDataPointAdded={dataset:1,field:1}:this.minMax.minTol<=e&&e<=this.minMax.maxTol?this.lastDataPointAdded={dataset:0,field:2}:this.lastDataPointAdded={dataset:1,field:3}}else if(void 0!==this.minMax2&&void 0===this.minMax3&&void 0===this.plausibility)e<this.minMax2.minTol?this.lastDataPointAdded={dataset:2,field:0
}:this.minMax2.minTol<=e&&e<this.minMax.minTol?this.lastDataPointAdded={dataset:1,field:1}:this.minMax.minTol<=e&&e<=this.minMax.maxTol?this.lastDataPointAdded={dataset:0,field:2}:this.minMax.maxTol<e&&e<=this.minMax2.maxTol?this.lastDataPointAdded={dataset:1,field:3}:this.lastDataPointAdded={dataset:2,field:4};else if(void 0!==this.minMax2&&void 0===this.minMax3&&void 0!==this.plausibility){if("number"==typeof this.plausibility){if(e<this.plausibility)return this.lastDataPointAdded={dataset:3,field:0},!1}else if(void 0!==this.plausibility.lower&&e<this.plausibility.lower||void 0!==this.plausibility.upper&&this.plausibility.upper<e)return this.lastDataPointAdded={dataset:3,field:0},!1;e<this.minMax2.minTol?this.lastDataPointAdded={dataset:2,field:1}:this.minMax2.minTol<=e&&e<this.minMax.minTol?this.lastDataPointAdded={dataset:1,field:2}:this.minMax.minTol<=e&&e<=this.minMax.maxTol?this.lastDataPointAdded={dataset:0,field:3
}:this.minMax.maxTol<e&&e<=this.minMax2.maxTol?this.lastDataPointAdded={dataset:1,field:4}:this.lastDataPointAdded={dataset:2,field:5}}else if(void 0!==this.minMax2&&void 0!==this.minMax3&&void 0===this.plausibility)e<this.minMax3.minTol?this.lastDataPointAdded={dataset:3,field:0}:this.minMax3.minTol<=e&&e<this.minMax2.minTol?this.lastDataPointAdded={dataset:2,field:1}:this.minMax2.minTol<=e&&e<this.minMax.minTol?this.lastDataPointAdded={dataset:1,field:2}:this.minMax.minTol<=e&&e<=this.minMax.maxTol?this.lastDataPointAdded={dataset:0,field:3}:this.minMax.maxTol<e&&e<=this.minMax2.maxTol?this.lastDataPointAdded={dataset:1,field:4}:this.minMax2.maxTol<e&&e<=this.minMax3.maxTol?this.lastDataPointAdded={dataset:2,field:5}:this.lastDataPointAdded={dataset:3,field:6};else if(void 0!==this.minMax2&&void 0!==this.minMax3&&void 0!==this.plausibility){if("number"==typeof this.plausibility){if(e<this.plausibility)return this.lastDataPointAdded={dataset:4,field:0},!1
}else if(void 0!==this.plausibility.lower&&e<this.plausibility.lower||void 0!==this.plausibility.upper&&this.plausibility.upper<e)return this.lastDataPointAdded={dataset:4,field:0},!1;e<this.minMax3.minTol?this.lastDataPointAdded={dataset:3,field:1}:this.minMax3.minTol<=e&&e<this.minMax2.minTol?this.lastDataPointAdded={dataset:2,field:2}:this.minMax2.minTol<=e&&e<this.minMax.minTol?this.lastDataPointAdded={dataset:1,field:3}:this.minMax.minTol<=e&&e<=this.minMax.maxTol?this.lastDataPointAdded={dataset:0,field:4}:this.minMax.maxTol<e&&e<=this.minMax2.maxTol?this.lastDataPointAdded={dataset:1,field:5}:this.minMax2.maxTol<e&&e<=this.minMax3.maxTol?this.lastDataPointAdded={dataset:2,field:6}:this.lastDataPointAdded={dataset:3,field:7}}return!0}removeLastValue(){if(!this.initialized)throw new Error("Chart object still not initialized.");if(this.canRemoveLastValue){this.chartValues.pop(),this.canRemoveLastValue=!1
;let e=parseFloat(this.chartConfiguration.labels[this.lastDataPointAdded.field]);e--,this.chartConfiguration.labels[this.lastDataPointAdded.field]=e.toString(),this.chartConfiguration.datasets[this.lastDataPointAdded.dataset].data[this.lastDataPointAdded.field]--,this.updateYAxesMax(),this.setLayoutOptionsAndSetTabData()}}recalculateChartData(){void 0===this.minMax2?(this.setEmptyDatasets(!1,!1,void 0!==this.plausibility),this.setDatasetColors(!1,!1,void 0!==this.plausibility)):void 0!==this.minMax2&&void 0===this.minMax3?(this.setEmptyDatasets(!0,!1,void 0!==this.plausibility),this.setDatasetColors(!0,!1,void 0!==this.plausibility)):void 0!==this.minMax2&&void 0!==this.minMax3&&(this.setEmptyDatasets(!0,!0,void 0!==this.plausibility),this.setDatasetColors(!0,!0,void 0!==this.plausibility)),this.setupQAppChartData(),this.calculateChartData(),this.addQAppPluginFunction(),this.updateYAxesMax(),this.setLayoutOptionsAndSetTabData()}setLayoutOptionsAndSetTabData(){
if(s.isArray(this.graphTab)){if(void 0!==this.chartConfiguration.options&&void 0!==this.chartConfiguration.options.layout){let e=0;void 0!==this.chartConfiguration.datasets&&void 0!==this.chartConfiguration.datasets[0]&&(e=this.chartConfiguration.datasets[0].data.length-3);let t=300-50*e;this.chartConfiguration.options.layout={padding:{left:t,right:t,top:50,bottom:0}}}this.graphTab.forEach(e=>{e.setData(this.chartConfiguration,!1),e.publish()})}else if(this.graphTab.hasOwnProperty("splittScreenTab")&&this.graphTab.hasOwnProperty("tabbedScreenTab")){let e=this.graphTab,t=s.cloneDeep(this.chartConfiguration),a=s.cloneDeep(this.chartConfiguration);if(t.options.layout={padding:{left:0,right:0,top:50,bottom:0}},void 0!==a.options&&void 0!==a.options.layout){let e=0;void 0!==a.datasets&&void 0!==a.datasets[0]&&(e=a.datasets[0].data.length-3);let t=300-50*e;a.options.layout={padding:{left:t,right:t,top:50,bottom:0}}}s.isArray(e.splittScreenTab)?e.splittScreenTab.forEach(e=>{e.setData(t,!1),
e.publish()}):(e.splittScreenTab.setData(t,!1),e.splittScreenTab.publish()),s.isArray(e.tabbedScreenTab)?e.tabbedScreenTab.forEach(e=>{e.setData(a,!1),e.publish()}):(e.tabbedScreenTab.setData(a,!1),e.tabbedScreenTab.publish())}else{if(void 0!==this.chartConfiguration.options&&void 0!==this.chartConfiguration.options.layout){let e=0;void 0!==this.chartConfiguration.datasets&&void 0!==this.chartConfiguration.datasets[0]&&(e=this.chartConfiguration.datasets[0].data.length-3);let t=300-50*e;this.chartConfiguration.options.layout={padding:{left:t,right:t,top:50,bottom:0}}}this.graphTab.setData(this.chartConfiguration,!1),this.graphTab.publish()}}updateYAxesMax(){let e=2;this.chartConfiguration.datasets.forEach(t=>{let a=s.max(t.data);e=(a=void 0!==a?a:0)>e?a:e}),s.has(this.chartConfiguration,"options.scales.yAxes[0].ticks")&&(this.chartConfiguration.options.scales.yAxes[0].ticks.max=e)}updateChartData(e,t=!0){if(!this.initialized)throw new Error("Chart object still not initialized.");{
let a=!1;(void 0===this.minMax2&&void 0!==e.minMax2||void 0!==this.minMax2&&void 0===e.minMax2)&&(a=!0),(void 0===this.minMax3&&void 0!==e.minMax3||void 0!==this.minMax3&&void 0===e.minMax3)&&(a=!0),(void 0===this.plausibility&&void 0!==e.plausibility||void 0!==this.plausibility&&void 0===e.plausibility)&&(a=!0),this.minMax=e.minMax,this.minMax2=e.minMax2,this.minMax3=e.minMax3,this.plausibility=e.plausibility,(t||a)&&(void 0===this.minMax2?(this.setEmptyDatasets(!1,!1,void 0!==this.plausibility),this.setDatasetColors(!1,!1,void 0!==this.plausibility)):void 0!==this.minMax2&&void 0===this.minMax3?(this.setEmptyDatasets(!0,!1,void 0!==this.plausibility),this.setDatasetColors(!0,!1,void 0!==this.plausibility)):void 0!==this.minMax2&&void 0!==this.minMax3&&(this.setEmptyDatasets(!0,!0,void 0!==this.plausibility),this.setDatasetColors(!0,!0,void 0!==this.plausibility)),this.setupQAppChartData(),this.recalculateChartData())}}calculateChartData(){
void 0===this.minMax2&&void 0===this.plausibility?this.fillDatasetsDataWithZeros(3):void 0===this.minMax2&&void 0!==this.plausibility?this.fillDatasetsDataWithZeros(4):void 0!==this.minMax2&&void 0===this.minMax3&&void 0===this.plausibility?this.fillDatasetsDataWithZeros(5):void 0!==this.minMax2&&void 0===this.minMax3&&void 0!==this.plausibility?this.fillDatasetsDataWithZeros(6):void 0!==this.minMax2&&void 0!==this.minMax3&&void 0===this.plausibility?this.fillDatasetsDataWithZeros(7):void 0!==this.minMax2&&void 0!==this.minMax3&&void 0!==this.plausibility&&this.fillDatasetsDataWithZeros(8),this.chartValues.forEach(e=>{this.updateLastDataPointAdded(e),this.chartConfiguration.datasets[this.lastDataPointAdded.dataset].data[this.lastDataPointAdded.field]++;let t=parseFloat(this.chartConfiguration.labels[this.lastDataPointAdded.field]);t++,this.chartConfiguration.labels[this.lastDataPointAdded.field]=t.toString()})}fillDatasetsDataWithZeros(e){this.chartConfiguration.datasets.forEach(t=>{
t.data=new Array(e).fill(0)})}setEmptyDatasets(e,t,a){let s={data:[],label:"_i18n{ id: '_QAPP_LIB_CHART_OCCURENCES_LABEL', args: [] }"};e||a?!e&&a?(this.chartConfiguration.datasets=[n.cloneJSON(s),n.cloneJSON(s),n.cloneJSON(s)],this.chartConfiguration.labels=["0","0","0","0"]):!e||t||a?e&&!t&&a?(this.chartConfiguration.datasets=[n.cloneJSON(s),n.cloneJSON(s),n.cloneJSON(s),n.cloneJSON(s)],this.chartConfiguration.labels=["0","0","0","0","0","0"]):e&&t&&!a?(this.chartConfiguration.datasets=[n.cloneJSON(s),n.cloneJSON(s),n.cloneJSON(s),n.cloneJSON(s)],this.chartConfiguration.labels=["0","0","0","0","0","0","0"]):e&&t&&a&&(this.chartConfiguration.datasets=[n.cloneJSON(s),n.cloneJSON(s),n.cloneJSON(s),n.cloneJSON(s),n.cloneJSON(s)],this.chartConfiguration.labels=["0","0","0","0","0","0","0","0"]):(this.chartConfiguration.datasets=[n.cloneJSON(s),n.cloneJSON(s),n.cloneJSON(s)],
this.chartConfiguration.labels=["0","0","0","0","0"]):(this.chartConfiguration.datasets=[n.cloneJSON(s),n.cloneJSON(s)],this.chartConfiguration.labels=["0","0","0"])}setDatasetColors(e,t,a){let s={backgroundColor:i.EnumColors.GREEN,borderColor:i.EnumColors.GREEN},n={backgroundColor:i.EnumColors.RED,borderColor:i.EnumColors.RED},r={backgroundColor:i.EnumColors.BLUE,borderColor:i.EnumColors.BLUE},o={backgroundColor:i.EnumColors.YELLOW,borderColor:i.EnumColors.YELLOW},l={backgroundColor:i.EnumColors.GREY,borderColor:i.EnumColors.GREY},E=[];e||a?!e&&a?E=[s,n,l]:!e||t||a?e&&!t&&a?E=[s,o,n,l]:e&&t&&!a?E=[s,r,o,n]:e&&t&&a&&(E=[s,r,o,n,l]):E=[s,o,n]:E=[s,n],this.chartConfiguration.colors=E}setupQAppChartData(){let e=[]
;void 0===this.minMax2&&void 0===this.plausibility?e=["_i18n{ id: '_QAPP_LIB_CHART_CHECKWEIGHING_COUNTER_LL_LABEL', args: []}",`_i18n{ id: '${this.labels.ok.id}', args: [${[...this.labels.ok.args]}]}`,"_i18n{ id: '_QAPP_LIB_CHART_CHECKWEIGHING_COUNTER_HH_LABEL', args: []}"]:void 0===this.minMax2&&void 0!==this.plausibility?e=[`_i18n{ id: '${this.labels.oop.id}', args: [${[...this.labels.oop.args]}]}`,`_i18n{ id: '${this.labels.min.id}', args: [${[...this.labels.min.args]}]}`,`_i18n{ id: '${this.labels.ok.id}', args: [${[...this.labels.ok.args]}]}`,`_i18n{ id: '${this.labels.max.id}', args: [${[...this.labels.max.args]}]}`]:void 0!==this.minMax2&&void 0===this.minMax3&&void 0===this.plausibility?e=[`_i18n{ id: '${this.labels.min2.id}', args: [${[...this.labels.min2.args]}]}`,`_i18n{ id: '${this.labels.min.id}', args: [${[...this.labels.min.args]}]}`,`_i18n{ id: '${this.labels.ok.id}', args: [${[...this.labels.ok.args]}]}`,`_i18n{ id: '${this.labels.max.id}', args: [${[...this.labels.max.args]}]}`,`_i18n{ id: '${this.labels.max2.id}', args: [${[...this.labels.max2.args]}]}`]:void 0!==this.minMax2&&void 0===this.minMax3&&void 0!==this.plausibility?e=[`_i18n{ id: '${this.labels.oop.id}', args: [${[...this.labels.oop.args]}]}`,`_i18n{ id: '${this.labels.min2.id}', args: [${[...this.labels.min2.args]}]}`,`_i18n{ id: '${this.labels.min.id}', args: [${[...this.labels.min.args]}]}`,`_i18n{ id: '${this.labels.ok.id}', args: [${[...this.labels.ok.args]}]}`,`_i18n{ id: '${this.labels.max.id}', args: [${[...this.labels.max.args]}]}`,`_i18n{ id: '${this.labels.max2.id}', args: [${[...this.labels.max2.args]}]}`]:void 0!==this.minMax2&&void 0!==this.minMax3&&void 0===this.plausibility?e=[`_i18n{ id: '${this.labels.min3.id}', args: [${[...this.labels.min3.args]}]}`,`_i18n{ id: '${this.labels.min2.id}', args: [${[...this.labels.min2.args]}]}`,`_i18n{ id: '${this.labels.min.id}', args: [${[...this.labels.min.args]}]}`,`_i18n{ id: '${this.labels.ok.id}', args: [${[...this.labels.ok.args]}]}`,`_i18n{ id: '${this.labels.max.id}', args: [${[...this.labels.max.args]}]}`,`_i18n{ id: '${this.labels.max2.id}', args: [${[...this.labels.max2.args]}]}`,`_i18n{ id: '${this.labels.max3.id}', args: [${[...this.labels.max3.args]}]}`]:void 0!==this.minMax2&&void 0!==this.minMax3&&void 0!==this.plausibility&&(e=[`_i18n{ id: '${this.labels.oop.id}', args: [${[...this.labels.oop.args]}]}`,`_i18n{ id: '${this.labels.min3.id}', args: [${[...this.labels.min3.args]}]}`,`_i18n{ id: '${this.labels.min2.id}', args: [${[...this.labels.min2.args]}]}`,`_i18n{ id: '${this.labels.min.id}', args: [${[...this.labels.min.args]}]}`,`_i18n{ id: '${this.labels.ok.id}', args: [${[...this.labels.ok.args]}]}`,`_i18n{ id: '${this.labels.max.id}', args: [${[...this.labels.max.args]}]}`,`_i18n{ id: '${this.labels.max2.id}', args: [${[...this.labels.max2.args]}]}`,`_i18n{ id: '${this.labels.max3.id}', args: [${[...this.labels.max3.args]}]}`]),
this.chartConfiguration.options.qappChartData.labels=e}overwriteDataDivision(e){if(!this.initialized)throw new Error("Chart object still not initialized.");{let t=[];void 0===this.minMax2&&void 0===this.minMax3&&void 0===this.plausibility?(t=[e.ltMin1,e.target,e.gtMax1],this.chartConfiguration.datasets[1].data[0]=t[0],this.chartConfiguration.datasets[0].data[1]=t[1],this.chartConfiguration.datasets[1].data[2]=t[2]):void 0===this.minMax2&&void 0===this.minMax3&&void 0!==this.plausibility?(t=void 0!==e.ltPlausible?[e.ltPlausible,e.ltMin1,e.target,e.gtMax1]:[0,e.ltMin1,e.target,e.gtMax1],this.chartConfiguration.datasets[2].data[0]=t[0],this.chartConfiguration.datasets[1].data[1]=t[1],this.chartConfiguration.datasets[0].data[2]=t[2],this.chartConfiguration.datasets[1].data[3]=t[3]):void 0!==this.minMax2&&void 0===this.minMax3&&void 0===this.plausibility?(t=void 0!==e.ltMin2&&void 0!==e.gtMax2?[e.ltMin2,e.ltMin1,e.target,e.gtMax1,e.gtMax2]:[0,e.ltMin1,e.target,e.gtMax1,0],
this.chartConfiguration.datasets[2].data[0]=t[0],this.chartConfiguration.datasets[1].data[1]=t[1],this.chartConfiguration.datasets[0].data[2]=t[2],this.chartConfiguration.datasets[1].data[3]=t[3],this.chartConfiguration.datasets[2].data[4]=t[4]):void 0!==this.minMax2&&void 0===this.minMax3&&void 0!==this.plausibility?(t=void 0!==e.ltMin2&&void 0!==e.gtMax2&&void 0!==e.ltPlausible?[e.ltPlausible,e.ltMin2,e.ltMin1,e.target,e.gtMax1,e.gtMax2]:[0,0,e.ltMin1,e.target,e.gtMax1,0],this.chartConfiguration.datasets[3].data[0]=t[0],this.chartConfiguration.datasets[2].data[1]=t[1],this.chartConfiguration.datasets[1].data[2]=t[2],this.chartConfiguration.datasets[0].data[3]=t[3],this.chartConfiguration.datasets[1].data[4]=t[4],
this.chartConfiguration.datasets[2].data[5]=t[5]):void 0!==this.minMax2&&void 0!==this.minMax3&&void 0===this.plausibility?(t=void 0!==e.ltMin2&&void 0!==e.gtMax2&&void 0!==e.ltMin3&&void 0!==e.gtMax3&&void 0===e.ltPlausible?[e.ltMin3,e.ltMin2,e.ltMin1,e.target,e.gtMax1,e.gtMax2,e.gtMax3]:[0,0,e.ltMin1,e.target,e.gtMax1,0,0],this.chartConfiguration.datasets[3].data[0]=t[0],this.chartConfiguration.datasets[2].data[1]=t[1],this.chartConfiguration.datasets[1].data[2]=t[2],this.chartConfiguration.datasets[0].data[3]=t[3],this.chartConfiguration.datasets[1].data[4]=t[4],this.chartConfiguration.datasets[2].data[5]=t[5],this.chartConfiguration.datasets[3].data[6]=t[6]):void 0!==this.minMax2&&void 0!==this.minMax3&&void 0!==this.plausibility&&(t=void 0!==e.ltMin2&&void 0!==e.gtMax2&&void 0!==e.ltMin3&&void 0!==e.gtMax3&&void 0!==e.ltPlausible?[e.ltPlausible,e.ltMin3,e.ltMin2,e.ltMin1,e.target,e.gtMax1,e.gtMax2,e.gtMax3]:[0,0,0,e.ltMin1,e.target,e.gtMax1,0,0],
this.chartConfiguration.datasets[4].data[0]=t[0],this.chartConfiguration.datasets[3].data[1]=t[1],this.chartConfiguration.datasets[2].data[2]=t[2],this.chartConfiguration.datasets[1].data[3]=t[3],this.chartConfiguration.datasets[0].data[4]=t[4],this.chartConfiguration.datasets[1].data[5]=t[5],this.chartConfiguration.datasets[2].data[6]=t[6],this.chartConfiguration.datasets[3].data[7]=t[7]),this.chartConfiguration.labels=t.map(e=>e.toString()),this.updateYAxesMax(),this.setLayoutOptionsAndSetTabData()}}baseChartSetup(){return{chartType:"bar",datasets:[],labels:[],options:{responsive:!1,showLines:!1,animation:!1,legend:{display:!1},layout:{padding:{left:300,right:300,top:50,bottom:0}},tooltips:{mode:"nearest",intersect:!0,bodyFontFamily:"Roboto Bold",bodyFontSize:12,footerFontFamily:"Roboto Regular",footerFontSize:12,titleFontFamily:"Roboto Regular",titleFontSize:12,callbacks:{title:function(e,t){return""}}},scales:{xAxes:[{stacked:!0,maxBarThickness:50,gridLines:{display:!1,
drawBorder:!1},scaleLabel:{display:!1},ticks:{fontFamily:"Roboto Regular",fontSize:14}}],yAxes:[{scaleLabel:{display:!1},gridLines:{display:!1,drawBorder:!1},ticks:{display:!1,max:0,min:0}}]},qappChartData:{},qappPluginFunction:{}},colors:[]}}addQAppPluginFunction(){this.chartConfiguration.options.qappPluginFunction={beforeDatasetsDraw:function(e){let t=e[0],a=t.chart.ctx,s=t.options.qappChartData,i=t.scales["y-axis-0"],n=t.scales["x-axis-0"],r=n.getPixelForTick(1)-n.getPixelForTick(0)-3,o=t.options.layout.padding.top,l=function(e,t){let s=[];return e.forEach(e=>{s.push(function(e,t){a.save(),a.font=t;let s=a.measureText(e);return a.restore(),s.width}(e,t))}),s.reduce((e,t)=>e>t?e:t)}(s.labels,"14px Roboto Regular");a.save();let E=function(e,t,a){let s,i,n=0,r=e;for(;r>t&&n<90;){let t=_(n);if(s=Math.cos(t),(i=Math.sin(t))*e>a){n--;break}n++,r=s*e}return _(-n)}(l,r,o);function _(e){return e*(Math.PI/180)}s.labels.forEach((e,t)=>{!function(e,t,s,i){a.save(),a.fillStyle="#666666",
a.font="14px Roboto Regular",a.textBaseline="middle",a.textAlign=0===i?"center":"left",a.translate(0===i?t:t-r/2+3,s),a.rotate(i),a.fillText(e.replace(/&#(\d+);/g,function(e,t){return a.font="14px Roboto Bold",String.fromCharCode(t)}),0,0),a.restore()}(e,n.getPixelForTick(t),i.top-15,E)}),a.restore()}}}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(9);!function(e){e.GREEN="#8CD31C",e.LIGHT_GREEN="#D8E4C0",e.YELLOW="#FADD37",e.WHITE="#FFFFFF",e.RED="#E60046",e.BLUE="#0069BE",e.LIGHT_RED="#E6B9B5",e.GREY="#C4C4C4"}(t.EnumColors||(t.EnumColors={}));t.BaseChart=class{constructor(){this.initialized=!1,this.canRemoveLastValue=!0,this.chartValues=[],this.chartConfiguration={}}removeLastValue(){if(!this.initialized)throw new Error("Chart object still not initialized.");this.canRemoveLastValue&&(this.chartValues.pop(),this.canRemoveLastValue=!1),this.recalculateChartData()}resetGraphTab(e){
if(!this.initialized)throw new Error("Chart object still not initialized.");void 0!==e?(this.chartValues=e,this.canRemoveLastValue=!0):this.chartValues=[],this.recalculateChartData()}getChartData(){if(this.initialized)return this.chartValues;throw new Error("Chart object still not initialized.")}sortByKeys(e){const t=[...Object.keys(e)].sort((e,t)=>parseFloat(e)-parseFloat(t));return s.map(t,t=>[t,e[t]])}getChartConfiguration(){if(this.initialized)return this.chartConfiguration;throw new Error("Chart object still not initialized.")}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=a(113);t.TowerLightController=class{constructor(){this.lastTowerStatus="off",this.interfaceManagementProxy=new s.InterfaceManagementProxy}setTowerLightByArea6(e){switch(e){case 1:case 6:return this.red();case 2:case 5:return this.yellow();case 3:case 4:return this.green();default:return this.off()}}setTowerLightByArea4(e){switch(e){case 1:return this.yellow();case 2:
case 3:return this.green();case 4:return this.red();default:return this.off()}}red(){return"red"!==this.lastTowerStatus&&(this.interfaceManagementProxy.setGPIOPorts({pin16:!1,pin17:!1,pin18:!0,pin19:!1}),console.log("Setting TowerLight: red"),this.lastTowerStatus="red"),this.lastTowerStatus}yellow(){return"yellow"!==this.lastTowerStatus&&(this.interfaceManagementProxy.setGPIOPorts({pin16:!0,pin17:!1,pin18:!1,pin19:!1}),console.log("Setting TowerLight: yellow"),this.lastTowerStatus="yellow"),this.lastTowerStatus}green(){return"green"!==this.lastTowerStatus&&(this.interfaceManagementProxy.setGPIOPorts({pin16:!1,pin17:!0,pin18:!1,pin19:!1}),console.log("Setting TowerLight: green"),this.lastTowerStatus="green"),this.lastTowerStatus}off(){return"off"!==this.lastTowerStatus&&(this.interfaceManagementProxy.setGPIOPorts({pin16:!1,pin17:!1,pin18:!1,pin19:!1}),console.log("Setting TowerLight: off"),this.lastTowerStatus="off"),this.lastTowerStatus}}},function(e,t,a){"use strict"
;Object.defineProperty(t,"__esModule",{value:!0});const s=a(5),i=a(6);!function(e){e.DefaultEthernetInterface="DefaultEthernetInterface",e.DefaultRS232Interface="DefaultRS232Interface",e.DefaultUSBInterface="DefaultUSBInterface"}(t.ESerialInterfaceIds||(t.ESerialInterfaceIds={}));t.InterfaceManagementProxy=class extends s.BaseProxy{constructor(){super(...arguments),this.restEndpoint="interfacemanagement"}setGPIOPorts(e){let{pin15:t,pin16:a,pin17:n,pin18:r,pin19:o}=e;return this.body.method=i.RestMethodsINTERFACE_MANAGEMENT.setGPIOPorts,this.body.params={pin15:!!t,pin16:!!a,pin17:!!n,pin18:!!r,pin19:!!o},new s.CubisRestResponse(this.syncRequest())}getQappProtocolPortNumber(e){return this.body.method=i.RestMethodsINTERFACE_MANAGEMENT.getQappProtocolPortNumber,this.body.params={interfaceId:e},new s.CubisRestResponse(this.syncRequest())}getQappProtocolInterfaces(){return this.body.method=i.RestMethodsINTERFACE_MANAGEMENT.getQappProtocolInterfaces,this.body.params={interfaceId:"",
portNumber:-1,name:{}},new s.CubisRestResponse(this.syncRequest())}isAnyInterfaceActive(){let e;return this.body.method=i.RestMethodsINTERFACE_MANAGEMENT.isInterfaceActive,this.body.params={isActive:!1},!!(e=new s.CubisRestResponse(this.syncRequest())).isSuccess()&&e.rawReturns.isActive}}}]);