/* COPYRIGHT by SARTORIUS (Sartorius Lab Instruments GmbH & Co. KG) */
!function(e){var t={};function s(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=e,s.c=t,s.d=function(e,t,a){s.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=88)}([function(e,t,s){"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,s){"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,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cloneJSON=function(e){return JSON.parse(JSON.stringify(e))}},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(2),n=s(10),i=s(0);t.isTypeOfIDateTimeParameter=function(e){return e.type===i.EnumParameterTypes.PARAM_DATE_TIME},t.isTypeOfIMultipleSelectionParameter=function(e){return e.type===i.EnumParameterTypes.PARAM_MULTIPLE_SELECTION},t.isTypeOfISelectionParameter=function(e){return e.type===i.EnumParameterTypes.PARAM_SELECTION},t.isTypeOfIQuantityParameter=function(e){return e.type===i.EnumParameterTypes.PARAM_QUANTITY},
t.isTypeOfIMeasureParameter=function(e){return e.type===i.EnumParameterTypes.PARAM_MEASURE},t.isTypeOfIStringParameter=function(e){return e.type===i.EnumParameterTypes.PARAM_STRING},t.isTypeOfIAlibiIdentifierParameter=function(e){return e.type===i.EnumParameterTypes.ALIBI_IDENTIFIER},t.isTypeOfITextParameter=function(e){return e.type===i.EnumParameterTypes.PARAM_TEXT},t.isTypeOfIFormulaParameter=function(e){return e.type===i.EnumParameterTypes.PARAM_FORMULA},t.isTypeOfIPasswordParameter=function(e){return e.type===i.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=a.cloneJSON(r);return n.isString(e)&&(t.id=e),t}t.createEmptyTextStructure=o;const E={id:"",type:i.EnumParameterTypes.PARAM_GROUP,title:o(),appearance:i.EnumAppearance.HIDDEN,parameters:[]};function _(e){const t=a.cloneJSON(E);return n.isString(e)&&(t.id=e),t}
t.createEmptyParameterGroup=_;const l={id:"",type:i.EnumParameterTypes.PARAM_GROUP,title:o(),appearance:i.EnumAppearance.HIDDEN,parameters:[_()]};t.createEmptyParameterGroupOfGroups=function(){return a.cloneJSON(l)};const A={appearance:i.EnumAppearance.HIDDEN,id:"",text:o()};t.createEmptySelectionParameterOption=function(){return a.cloneJSON(A)};const u={id:"",type:i.EnumParameterTypes.PARAM_SELECTION,value:{selection:{id:""}},header:o(),title:o(),info:{options:[A]},appearance:i.EnumAppearance.HIDDEN};t.createEmptySelectionParameter=function(e){const t=a.cloneJSON(u);return n.isString(e)&&(t.id=e),t};const c={id:"",type:i.EnumParameterTypes.PARAM_MULTIPLE_SELECTION,value:{selections:[]},header:o(),title:o(),info:{options:[A]},appearance:i.EnumAppearance.HIDDEN};t.createEmptyMultipleSelectionParameter=function(e){const t=a.cloneJSON(c);return n.isString(e)&&(t.id=e),t},t.SAMPLE_DATE_TIME_ID="SAMPLE_DATE_TIME_ID";const I={id:t.SAMPLE_DATE_TIME_ID,
type:i.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:i.EnumAppearance.HIDDEN};t.createEmptyDateTimeParameter=function(e){const t=a.cloneJSON(I);return n.isString(e)&&(t.id=e),t};const p={id:"",type:i.EnumParameterTypes.PARAM_STRING,value:{string:""},header:o(),title:o(),info:{minimum:{length:0},maximum:{length:0}},appearance:i.EnumAppearance.HIDDEN};t.createEmptyStringParameter=function(e){const t=a.cloneJSON(p);return n.isString(e)&&(t.id=e),t};const d={id:"",type:i.EnumParameterTypes.PARAM_BARCODE,value:{string:"",format:i.EnumBarcodeFormats.CODE128,width:120},header:o(),title:o(),appearance:i.EnumAppearance.HIDDEN};t.createEmptyBarcodeParameter=function(e){const t=a.cloneJSON(d);return n.isString(e)&&(t.id=e),t};const T={id:"",type:i.EnumParameterTypes.PARAM_PASSWORD,value:{string:""},header:o(),title:o(),info:{
passwordLength:0,minimum:{length:0},maximum:{length:0}},appearance:i.EnumAppearance.HIDDEN};t.createEmptyPasswordParameter=function(e){const t=a.cloneJSON(T);return n.isString(e)&&(t.id=e),t};const N={id:"",type:i.EnumParameterTypes.PARAM_TEXT,value:{text:o()},header:o(),title:o(),appearance:i.EnumAppearance.HIDDEN,info:{suppressTitle:!1}};t.createEmptyTextParameter=function(e){const t=a.cloneJSON(N);return n.isString(e)&&(t.id=e),t},t.createEmptyTextParameterValueOnly=function(){let e=a.cloneJSON(N);return e.info.suppressTitle=!0,e};const R={visual:"",eval:""};t.createEmptyFormulaParameterValue=function(){return a.cloneJSON(R)};const S={id:"",type:i.EnumParameterTypes.PARAM_FORMULA,value:[],header:o(),title:o(),appearance:i.EnumAppearance.HIDDEN,info:{maximum:{length:0}}};t.createEmptyFormulaParameter=function(e){const t=a.cloneJSON(S);return n.isString(e)&&(t.id=e),t};const m={mark:"",sign:"",number:"0",decimals:0,auxiliaryDigits:0,unit:"",interval:1,isStable:!1,isSpecial:!1,
isWarning:!1,isInvalid:!0};t.createEmptyMeasureParameterValue=function(){return a.cloneJSON(m)};const h={id:"",type:i.EnumParameterTypes.PARAM_MEASURE,value:m,header:o(),title:o(),appearance:i.EnumAppearance.HIDDEN};t.createEmptyMeasureParameter=function(e){const t=a.cloneJSON(h);return n.isString(e)&&(t.id=e),t};const D={decimals:0,preferredDecimals:0,numbers:[],unit:""};t.createEmptyQuantityParameterValue=function(){return a.cloneJSON(D)},t.QUANTITY_PARAM_MIN_MAX_NAN="nan",t.QUANTITY_PARAM_NUMBERS_MAX=3;const P={id:"",type:i.EnumParameterTypes.PARAM_QUANTITY,value:D,header:o(),title:o(),info:{minimum:{value:t.QUANTITY_PARAM_MIN_MAX_NAN},maximum:{value:t.QUANTITY_PARAM_MIN_MAX_NAN}},appearance:i.EnumAppearance.HIDDEN};t.createEmptyQuantityParameter=function(e){const t=a.cloneJSON(P);return n.isString(e)&&(t.id=e),t};const g={id:"",type:i.EnumParameterTypes.ALIBI_IDENTIFIER,value:{alibiIdentifier:NaN},header:o(),title:o(),appearance:i.EnumAppearance.ENABLED}
;t.createEmptyAlibiIdentifier=function(){return a.cloneJSON(g)}},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(34),n="SUCCESS",i="FAILED";t.CubisRestResponse=class{constructor(e){if(this.restResponse=void 0,"boolean"==typeof e)this.result=e?n:i,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===n}};t.BaseProxy=class{constructor(){this.body={method:"",params:{}}}syncRequest(){let e,t=JSON.stringify(this.body),s=`http://127.0.0.1:8080/rest/${this.restEndpoint}`;const n=process.hrtime();let i=[s,"-H","Accept:application/json","-H","Content-Type:application/json","-H","Expect:","--data","@-"];e=a.spawnSync("curl",i,{input:t});const r=process.hrtime(n);return console.log(`${this.body.method} (hr): ${r[0]}s ${r[1]/1e6}ms`),e}}
},function(e,t,s){"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,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(9),n=s(1);var i;!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"}(i=t.ScreenEventType||(t.ScreenEventType={}));t.AbstractScreen=class{constructor(e){this.events$=new a.Subject,this.mqttHandler=e}show(){
console.log("AbstractScreen: show "+this.getId()+" @ "+n.MqttTopics.HMI_ACTIVE_QAPP_SCREEN),this.mqttHandler.publish(n.MqttTopics.HMI_ACTIVE_QAPP_SCREEN,'{ "screen":"'+this.getId()+'" }'),this.events$.next({type:i.SHOW_SCREEN,id:this.getId()})}hide(){}publishContent(e,t,s=!0){let a=e?this.getMqttTopicBaseExtensible()+e:this.getMqttTopicBase();console.log("AbstractScreen: publishContent @ "+a),this.mqttHandler.publish(a,t,{retain:s})}getMqttTopicBase(){return"SCREENS/"+this.getId()}getMqttTopicBaseExtensible(){return this.getMqttTopicBase()+"/"}getButton(e){}}},function(e,t,s){"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,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(0),n=s(2);function i(e){return n.cloneJSON({
module:"qappHandler",method:"buttonClickEvent",params:{buttonId:e||""}})}function r(e){let t={nameId:"",appearance:"HIDDEN",type:"",label:{id:"",args:[]},effect:i()};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=i(),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=i,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,s){this.lastPublishedTabContent="",this.mqttHandler=e,this.buttonTopic="SCREENS/"+t.getId()+"/"+s.buttonId,this.buttonJson=r(s)}setButtonId(e,t=!0){this.buttonJson.effect.params.buttonId=e,t&&this.publish()}setLongPressButtonId(e,t=!0){e?(this.buttonJson.longPressEffect||(this.buttonJson.longPressEffect=i()),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=a.EnumAppearance.HIDDEN;return this.buttonJson.appearance&&"string"==typeof this.buttonJson.appearance&&Object.keys(a.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){e.exports=require("rxjs/Subject")},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(2);function n(e){return null!=e&&null!==e&&void 0!=e&&void 0!==e&&"string"==typeof e}function i(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=n,t.isObject=i,t.isBoolean=function(e){return null!=e&&null!==e&&void 0!=e&&void 0!==e&&"boolean"==typeof e},t.getObjectByID=function(e,t,s){if(!i(e))return null
;n(s)||(s="id"),s=s;for(let a=0;a<e.length;a++)if(e[a].hasOwnProperty(s)&&n(e[a][s])&&e[a][s]===t)return e[a];return null},t.overwriteExistingAttributes=function(e,t){if(i(e)&&i(t)){let s=Object.keys(t);for(let n=0;n<s.length;n++)"function"!=typeof t[s[n]]&&e.hasOwnProperty(s[n])&&typeof t[s[n]]==typeof e[s[n]]&&(t[s[n]]=a.cloneJSON(e[s[n]]))}},t.setEnumSafely=function(e,t,s){const a=Object.keys(t);for(const s of a)if(t[s]===e)return t[s];return n(s)?s:a.length>0?t[a[0]]:void 0}},function(e,t,s){"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,s){"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,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(15),n=s(30),i=s(10),r=s(2);var o,E
;function _(e,s,n){let i=t.unitsMap[E.NONE],r=t.unitsMap[E.NONE];if(null==e)return a.bignumber(NaN);if(!t.unitsMap.hasOwnProperty(s))return e;if(!t.unitsMap.hasOwnProperty(n))return e;if(i=t.unitsMap[s],r=t.unitsMap[n],i.id===r.id)return e;if(i.unitConversionBase===o.UNDEFINED||r.unitConversionBase===o.UNDEFINED||void 0==i.conversionFactor||void 0==r.conversionFactor)return e;const _=[o.MASS,o.VOLUME];if(!(i.unitConversionBase===r.unitConversionBase||_.includes(i.unitConversionBase)&&_.includes(r.unitConversionBase)))return e;switch(i.unitConversionBase){case o.MASS:case o.VOLUME:case o.PRESSURE:return e.times(r.conversionFactor).dividedBy(i.conversionFactor);case o.TEMPERATURE:{let t=e;switch(i.id){case E.GRAD_CELSIUS:t=e.add(273.15);break;case E.GRAD_FAHRENHEIT:t=e.sub(32).dividedBy(i.conversionFactor).add(273.15)}switch(r.id){case E.GRAD_CELSIUS:return t.sub(273.15);case E.GRAD_FAHRENHEIT:return t.sub(273.15).times(r.conversionFactor).add(32);case E.KELVIN:return t}return e}default:
return e}}function l(e,t,s){let n=_(i.isNumber(e)?a.bignumber(e):e,t,s);return null==n?NaN:n.toNumber()}function A(e,t){return T(e,t).toFixed(Math.max(0,t))}function u(e,s){let a=r.cloneJSON(e);a.alibi=void 0,a.alibiId=void 0;let i=t.unitsMap[e.unit],E=t.unitsMap[s];if(i.id===E.id)return a;if(i.unitConversionBase===o.UNDEFINED||E.unitConversionBase===o.UNDEFINED)return a;const _=[o.MASS,o.VOLUME];return i.unitConversionBase===E.unitConversionBase||_.includes(i.unitConversionBase)&&_.includes(E.unitConversionBase)?(a.value=l(a.value,e.unit,s),a.unit=s,a.decimals=a.decimals-n.getUnitShift(e.unit)+n.getUnitShift(s),a.decimals<0&&(a.decimals=0),delete a.alibiId,a):a}function c(e){return e?t.unitsMap.hasOwnProperty(e.toString())?t.unitsMap[e].mark:e.toString():""}function I(e){const s=i.getObjectByID(Object.values(t.unitsMap),e,"mark");return null!=s?s.id:E.NONE}function p(e){let t=[];if(null==e||void 0===e)return t;if(0==e.length)return t;let s=E.NONE
;for(let a=0;a<e.length;a++)i.isNumber(e[a])?t.push(e[a]):i.isObject(e[a])&&e[a].hasOwnProperty("value")&&i.isNumber(e[a].value)&&e[a].hasOwnProperty("unit")&&(s!==E.NONE?t.push(u(e[a],s).value):(t.push(e[a].value),s=e[a].unit));return t}function d(e){let t=0;if(null==e||void 0===e)return t;if(0==e.length)return t;for(let s=0;s<e.length;s++)"object"==typeof e[s]&&e[s].hasOwnProperty("decimals")&&(t=e[s].decimals>t?e[s].decimals:t);return t}function T(e,t){let s=a.bignumber(e),n=a.bignumber(10).pow(t);return s.times(n).round().dividedBy(n).toNumber()}function N(e){let t=p(e);return i.isObject(t)&&0!==t.length?a.sum(t):NaN}function R(e){let t=p(e);return i.isObject(e)&&0!==e.length?a.mean(t):NaN}function S(e,t){let s=[];for(let a=0;a<e.length;a++)i.isNumber(e[a].value)&&(s[a]=u(e[a],t));return{value:R(s),unit:t,decimals:d(s)}}function m(e,t){return i.isObject(e)?a.bignumber(e.value).dividedBy(t).toNumber():a.bignumber(e).dividedBy(t).toNumber()}function h(e){let t=p(e)
;return i.isObject(t)&&0!==t.length?a.std(t,"unbiased"):NaN}function D(e,t){let s=[];for(let a=0;a<e.length;a++)i.isNumber(e[a].value)&&(s[a]=u(e[a],t));return{value:h(s),unit:t,decimals:d(s)}}function P(e,t,s){if(e<2||!i.isNumber(t)||!i.isNumber(s))return NaN;const n=a.bignumber(1).dividedBy(a.bignumber(e).minus(1)),r=a.bignumber(s).minus(a.bignumber(t).pow(2).dividedBy(a.bignumber(e)));return n.isNaN()||r.isNaN()?NaN:a.sqrt(n.times(r.abs())).toNumber()}function g(e){let t=p(e);return i.isObject(t)&&0!==t.length?a.min(t):NaN}function O(e){let t=p(e);return i.isObject(t)&&0!==t.length?a.max(t):NaN}function M(e){let t=p(e);return i.isObject(t)&&0!==t.length?L(h(t),R(t)):NaN}function L(e,t){let s=0,n=0;return s=i.isObject(e)?e.value:e,n=i.isObject(t)?t.value:t,i.isObject(e)&&i.isObject(t)&&(s=u(e,t.unit).value),a.bignumber(s).dividedBy(n).times(100).toNumber()}function C(e,t,s){let n=NaN,r=NaN,o=NaN,_=E.NONE;return i.isObject(e)?(n=e.value,_=e.unit):n=e,
i.isObject(t)?_!==E.NONE?r=u(t,_).value:(r=t.value,_=t.unit):r=t,i.isObject(s)?_!==E.NONE?o=u(s,_).value:(o=s.value,_=s.unit):o=s,a.bignumber(o).minus(r).dividedBy(a.bignumber(n).times(6)).toNumber()}function f(e,t,s){return{value:C(e,t,s),unit:E.NONE,decimals:3}}function b(e,t,s,n){let r=NaN,o=NaN,_=NaN,l=NaN,A=E.NONE;return i.isObject(e)?(r=e.value,A=e.unit):r=e,i.isObject(t)?A!==E.NONE?o=u(t,A).value:(o=t.value,A=t.unit):o=t,i.isObject(s)?A!==E.NONE?_=u(s,A).value:(_=s.value,A=s.unit):_=s,i.isObject(n)?A!==E.NONE?l=u(n,A).value:(l=n.value,A=n.unit):l=n,a.min(a.bignumber(o).minus(_).dividedBy(a.bignumber(r).times(3)),a.bignumber(l).minus(o).dividedBy(a.bignumber(r).times(3))).toNumber()}function B(e,t,s,a){return{value:b(e,t,s,a),unit:E.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"}(E=t.EnumUnit||(t.EnumUnit={})),t.unitsMap={NONE:{id:E.NONE,mark:"",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},DIGIT:{id:E.DIGIT,mark:"d",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},UNIVERSAL:{id:E.UNIVERSAL,mark:"o",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MICROGRAM:{id:E.MICROGRAM,mark:"µg",unitConversionBase:o.MASS,conversionFactor:1e6,conversionDecimalPlacesShift:-6},MILLIGRAM:{id:E.MILLIGRAM,mark:"mg",unitConversionBase:o.MASS,conversionFactor:1e3,conversionDecimalPlacesShift:-3},GRAM:{id:E.GRAM,mark:"g",unitConversionBase:o.MASS,conversionFactor:1,conversionDecimalPlacesShift:0},KILOGRAM:{id:E.KILOGRAM,mark:"kg",unitConversionBase:o.MASS,conversionFactor:.001,conversionDecimalPlacesShift:3},TONNE:{
id:E.TONNE,mark:"t",unitConversionBase:o.MASS,conversionFactor:1e-6,conversionDecimalPlacesShift:6},MILLICARAT:{id:E.MILLICARAT,mark:"mct",unitConversionBase:o.MASS,conversionFactor:5e3,conversionDecimalPlacesShift:-3},CARAT:{id:E.CARAT,mark:"ct",unitConversionBase:o.MASS,conversionFactor:5,conversionDecimalPlacesShift:0},KILOCARAT:{id:E.KILOCARAT,mark:"kct",unitConversionBase:o.MASS,conversionFactor:.005,conversionDecimalPlacesShift:3},KARAT:{id:E.KARAT,mark:"K",unitConversionBase:o.MASS,conversionFactor:5,conversionDecimalPlacesShift:0},POUND:{id:E.POUND,mark:"lb",unitConversionBase:o.MASS,conversionFactor:.00220462262184878,conversionDecimalPlacesShift:3},OUNCE:{id:E.OUNCE,mark:"oz",unitConversionBase:o.MASS,conversionFactor:.0352739619495804,conversionDecimalPlacesShift:2},POUND_OUNCE:{id:E.POUND_OUNCE,mark:"lb:oz",unitConversionBase:o.MASS,conversionFactor:.035273962,conversionDecimalPlacesShift:2},TROYOUNCE:{id:E.TROYOUNCE,mark:"ozt",unitConversionBase:o.MASS,
conversionFactor:.032150747,conversionDecimalPlacesShift:2},PENNYWEIGHT:{id:E.PENNYWEIGHT,mark:"dwt",unitConversionBase:o.MASS,conversionFactor:.643014931,conversionDecimalPlacesShift:1},GRAIN:{id:E.GRAIN,mark:"GN",unitConversionBase:o.MASS,conversionFactor:15.43235835,conversionDecimalPlacesShift:-1},PARTS_PER_POUND:{id:E.PARTS_PER_POUND,mark:"/lb",unitConversionBase:o.MASS,conversionFactor:1.1287667712,conversionDecimalPlacesShift:0},TAEL_HONGKONG:{id:E.TAEL_HONGKONG,mark:"tlh",unitConversionBase:o.MASS,conversionFactor:.02671725,conversionDecimalPlacesShift:2},TAEL_SINGAPORE:{id:E.TAEL_SINGAPORE,mark:"tls",unitConversionBase:o.MASS,conversionFactor:.02645544638,conversionDecimalPlacesShift:2},TAEL_TAIWAN:{id:E.TAEL_TAIWAN,mark:"tlt",unitConversionBase:o.MASS,conversionFactor:.02666666,conversionDecimalPlacesShift:2},TAEL_CHINA:{id:E.TAEL_CHINA,mark:"tlc",unitConversionBase:o.MASS,conversionFactor:.02645547175,conversionDecimalPlacesShift:2},MOMME:{id:E.MOMME,mark:"mom",
unitConversionBase:o.MASS,conversionFactor:.26666666666666666,conversionDecimalPlacesShift:1},TOLA:{id:E.TOLA,mark:"tol",unitConversionBase:o.MASS,conversionFactor:.0857333381,conversionDecimalPlacesShift:1},BATH:{id:E.BATH,mark:"bat",unitConversionBase:o.MASS,conversionFactor:.06578947436,conversionDecimalPlacesShift:2},MESGHAL:{id:E.MESGHAL,mark:"MS",unitConversionBase:o.MASS,conversionFactor:.217,conversionDecimalPlacesShift:1},NEWTON:{id:E.NEWTON,mark:"N",unitConversionBase:o.MASS,conversionFactor:.00980665,conversionDecimalPlacesShift:2},WARNING:{id:E.WARNING,mark:"!",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},PIECES:{id:E.PIECES,mark:"pcs",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},PERCENT:{id:E.PERCENT,mark:"%",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLIMETER:{id:E.MILLIMETER,mark:"mm",unitConversionBase:o.UNDEFINED,
conversionFactor:void 0,conversionDecimalPlacesShift:void 0},CENTIMETER:{id:E.CENTIMETER,mark:"cm",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},METER:{id:E.METER,mark:"m",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},KILOMETER:{id:E.KILOMETER,mark:"km",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},GRAM_PER_MILLILITER:{id:E.GRAM_PER_MILLILITER,mark:"g/ml",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLION_CELLS_PER_MILLILITER:{id:E.MILLION_CELLS_PER_MILLILITER,mark:"10^6 cls/ml",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MICROGRAM_PER_MILLILITER:{id:E.MICROGRAM_PER_MILLILITER,mark:"µg/ml",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MICROGRAM_PER_LITER:{id:E.MICROGRAM_PER_LITER,mark:"µg/l",
unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLIGRAM_PER_MILLILITER:{id:E.MILLIGRAM_PER_MILLILITER,mark:"mg/ml",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLIGRAM_PER_LITER:{id:E.MILLIGRAM_PER_LITER,mark:"mg/l",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLIMOL_PER_MILLILITER:{id:E.MILLIMOL_PER_MILLILITER,mark:"mmol/ml",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},GRAM_PER_CUBICCENTIMETRE:{id:E.GRAM_PER_CUBICCENTIMETRE,mark:"g/cm³",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},CUBICCENTIMETRE:{id:E.CUBICCENTIMETRE,mark:"cm³",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},SQUARECENTIMETRE:{id:E.SQUARECENTIMETRE,mark:"cm²",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,
conversionDecimalPlacesShift:void 0},SQUAREMETRE:{id:E.SQUAREMETRE,mark:"m²",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},GRAMMAGE:{id:E.GRAMMAGE,mark:"g/m²",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MICROLITER:{id:E.MICROLITER,mark:"µl",unitConversionBase:o.VOLUME,conversionFactor:1e3,conversionDecimalPlacesShift:-3},MILLILITER:{id:E.MILLILITER,mark:"ml",unitConversionBase:o.VOLUME,conversionFactor:1,conversionDecimalPlacesShift:0},MILLILITER_PER_SECOND:{id:E.MILLILITER_PER_SECOND,mark:"ml/s",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLILITER_PER_MINUTE:{id:E.MILLILITER_PER_MINUTE,mark:"ml/min",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLILITER_PER_HOUR:{id:E.MILLILITER_PER_HOUR,mark:"ml/h",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},
LITER:{id:E.LITER,mark:"l",unitConversionBase:o.VOLUME,conversionFactor:.001,conversionDecimalPlacesShift:3},MILLIMOL:{id:E.MILLIMOL,mark:"mmol",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},GRAD_CELSIUS:{id:E.GRAD_CELSIUS,mark:"°C",unitConversionBase:o.TEMPERATURE,conversionFactor:1,conversionDecimalPlacesShift:0},GRAD_FAHRENHEIT:{id:E.GRAD_FAHRENHEIT,mark:"°F",unitConversionBase:o.TEMPERATURE,conversionFactor:1.8,conversionDecimalPlacesShift:0},SECOND:{id:E.SECOND,mark:"sec",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MINUTE:{id:E.MINUTE,mark:"min",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},HOUR:{id:E.HOUR,mark:"h",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},TIME_AM:{id:E.TIME_AM,mark:"am",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},TIME_PM:{
id:E.TIME_PM,mark:"pm",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},VOLT:{id:E.VOLT,mark:"V",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLIAMPER:{id:E.MILLIAMPER,mark:"mA",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},HECTOPASCAL:{id:E.HECTOPASCAL,mark:"hPa",unitConversionBase:o.PRESSURE,conversionFactor:.01,conversionDecimalPlacesShift:2},KILOPASCAL:{id:E.KILOPASCAL,mark:"kPa",unitConversionBase:o.PRESSURE,conversionFactor:.001,conversionDecimalPlacesShift:3},GRAM_PER_MOL:{id:E.GRAM_PER_MOL,mark:"g/mol",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},INVALID:{id:E.INVALID,mark:"!invalid!",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},RPM:{id:E.RPM,mark:"rpm",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},
MILLIVOLT:{id:E.MILLIVOLT,mark:"mV",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MILLIVOLT_PER_PH:{id:E.MILLIVOLT_PER_PH,mark:"mV/pH",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MICROSIEMENS_PER_CENTIMETER:{id:E.MICROSIEMENS_PER_CENTIMETER,mark:"µS/cm",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},GRAM_PER_SQUARE_CENTIMETER:{id:E.GRAM_PER_SQUARE_CENTIMETER,mark:"g/cm²",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},GRAM_PER_METER:{id:E.GRAM_PER_METER,mark:"g/m",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},CENTILITER:{id:E.CENTILITER,mark:"cl",unitConversionBase:o.VOLUME,conversionFactor:.1,conversionDecimalPlacesShift:1},DENSITY:{id:E.DENSITY,mark:"g/cm³",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},VOLUME:{
id:E.VOLUME,mark:"cm³",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},KG_M3:{id:E.KG_M3,mark:"kg/m³",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},MMHG:{id:E.MMHG,mark:"mmHg",unitConversionBase:o.UNDEFINED,conversionFactor:void 0,conversionDecimalPlacesShift:void 0},KELVIN:{id:E.KELVIN,mark:"K",unitConversionBase:o.TEMPERATURE,conversionFactor:1,conversionDecimalPlacesShift:0},PASCAL:{id:E.PASCAL,mark:"Pa",unitConversionBase:o.PRESSURE,conversionFactor:1,conversionDecimalPlacesShift:0}},t.convertValueToTargetUnitBigNumber=_,t.convertValueToTargetUnit=l,t.createQuantity=function(e,t,s){let a={value:NaN,unit:E.NONE,decimals:0};if(i.isObject(e)){a=Object.assign(a,e);for(const e of Object.keys(a))["value","unit","decimals","auxiliaryDigits","alibiId","alibi","deviceserial","stable","timestamp","info"].includes(e)||delete a[e]
}else if(i.isObject(t))(t=t).value.numbers.length>0&&(a.value=parseFloat(t.value.numbers[0])),a.unit=I(t.value.unit),a.decimals=t.value.decimals;else if(i.isObject(s)){const e=(s=s).value;a.value=parseFloat(e.number),i.isNumber(a.value)||(a.info=e.number),i.isNumber(a.value)&&"-"===e.sign&&(a.value*=-1),a.decimals=e.decimals,a.unit=I(e.unit),a.stable=e.isStable,i.isNumber(e.auxiliaryDigits)&&e.auxiliaryDigits>0&&(a.auxiliaryDigits=e.auxiliaryDigits)}return a.unit=i.setEnumSafely(a.unit,E,E.NONE),a},t._formatQuantityParam_numberOnly=A,t.formatQuantityParam_numberOnly=function(e){return null!==e&&e.hasOwnProperty("value")&&e.hasOwnProperty("decimals")?i.isNumber(e.value)?A(e.value,e.decimals):"NaN":"N.A."},t.formatQuantityParam=function(e){return null!==e&&e.hasOwnProperty("value")&&e.hasOwnProperty("unit")&&e.hasOwnProperty("decimals")?i.isNumber(e.value)?A(e.value,e.decimals)+" "+c(e.unit):"NaN":"N.A."},t.convertToTargetUnit=u,t.getUnitString=c,t.getUnitEnum=I,
t.math_getSimple_numberArray=p,t.math_count=function(e){return p(e).length},t.math_getMaximumDecimals=d,t.math_roundUp=function(e,t){let s=a.bignumber(e),n=s.minus(s.floor()),i=(n=n.times(a.bignumber(10).pow(t))).minus(n.floor());return a.larger(i,0)&&(n=n.minus(i).add(1)),n=n.dividedBy(a.bignumber(10).pow(t)),s.floor().add(n).toNumber()},t.math_roundAuto=T,t.math_detectLeastSignificantDigit=function(e){let t=0,s=1,n=a.bignumber(e).abs(),i=n.floor(),r=n.minus(i);for(;r.greaterThan(0);)t++,i=(r=r.times(10)).floor(),r=r.minus(i);return t>0&&(s=i.dividedBy(a.bignumber(10).pow(t)).toNumber()),s},t.math_sum=N,t.math_Sum=function(e,t){let s=[];for(let a=0;a<e.length;a++)i.isNumber(e[a].value)&&(s[a]=u(e[a],t));return{value:N(s),unit:t,decimals:d(s)}},t.math_mean=R,t.math_Mean=S,t.math_mean_longterm=m,t.math_Mean_Longterm=function(e,t,s){const a=u(e,s);return a.value=m(a,t),a},t.math_standard_deviation=h,t.math_Standard_Deviation=D,t.math_standard_deviation_longterm=P,
t.math_Standard_Deviation_Longterm=function(e,t,s,a){return u({value:P(e,(t=u(t,s.unit)).value,s.value),unit:s.unit,decimals:s.decimals},a)},t.math_minimum=g,t.math_Minimum=function(e,t){let s=[];for(let a=0;a<e.length;a++)i.isNumber(e[a].value)&&(s[a]=u(e[a],t));return{value:g(s),unit:t,decimals:d(s)}},t.math_maximum=O,t.math_Maximum=function(e,t){let s=[];for(let a=0;a<e.length;a++)i.isNumber(e[a].value)&&(s[a]=u(e[a],t));return{value:O(s),unit:t,decimals:d(s)}},t.math_variation_coefficient=M,t.math_Variation_Coefficient=function(e){let t=[];for(let s=0;s<e.length;s++)i.isNumber(e[s].value)&&(t[s]=u(e[s],E.GRAM));return{value:M(t),unit:E.PERCENT,decimals:2}},t.math_variation_coefficient_longterm=L,t.math_Variation_Coefficient_Longterm=function(e,t){return{value:L(u(e,t.unit),t),unit:E.PERCENT,decimals:2}},t.math_cp=function(e,t,s){let a=p(e);return i.isObject(e)&&0!==e.length?C(h(a),t,s):NaN},t.math_Cp=function(e,t,s){return f(D(e,t.unit),t,s)},t.math_cp_longterm=C,
t.math_Cp_Longterm=f,t.math_cpk=function(e,t,s){return b(h(e),R(e),t,s)},t.math_Cpk=function(e,t,s){return B(D(e,t.unit),S(e,t.unit),t,s)},t.math_cpk_longterm=b,t.math_Cpk_Longterm=B},function(e,t){e.exports=require("lodash")},function(e,t){e.exports=require("mathjs")},function(e,t){e.exports=require("fs")},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(3),n=s(36),i=s(18),r=s(30),o=s(0);t.QUANTITY_PARAM_MAX_DIGITS_GENERAL=9;class E{static setValue(e,s,a=0,n=t.QUANTITY_PARAM_MAX_DIGITS_GENERAL){return E.setValueValueWithDecimals(e.value,s,e.value.preferredDecimals,a,n)}static setValueValue(e,s,a=0,n=t.QUANTITY_PARAM_MAX_DIGITS_GENERAL){return E.setValueValueWithDecimals(e,s,e.preferredDecimals,a,n)}static setValueWithDecimals(e,s,a,n=0,i=t.QUANTITY_PARAM_MAX_DIGITS_GENERAL){return E.setValueValueWithDecimals(e.value,s,a,n,i)}static setValueValueWithDecimals(e,s,r,o=0,E=t.QUANTITY_PARAM_MAX_DIGITS_GENERAL,_=!1){
let l="number"==typeof s?s:s.value,A=E-Math.floor(Math.abs(l)).toString().length,u=Math.min(A,r);u=Math.max(u,0),0===o&&e&&(e.decimals=u);let c=n.SartoMath.roundExactToDecimals(l,u).toFixed(u);if(e){if(_||0!==o)"number"!=typeof s&&(i.isArray(e.unit)?e.unit[0]=s.unit:e.unit=s.unit);else{for(let t=a.QUANTITY_PARAM_NUMBERS_MAX-2;t>=o;t--)void 0!==e.numbers[t]&&(e.numbers[t+1]=e.numbers[t]);if("number"==typeof s){if(i.isArray(e.unit))for(let t=a.QUANTITY_PARAM_NUMBERS_MAX-2;t>=o;t--)void 0!==e.unit[t]&&(e.unit[t+1]=e.unit[t])}else if(i.isArray(e.unit)){for(let t=a.QUANTITY_PARAM_NUMBERS_MAX-2;t>=o;t--)void 0!==e.unit[t]&&(e.unit[t+1]=e.unit[t]);e.unit[0]=s.unit}else e.unit=s.unit}e.numbers[o]=c}return c}static roundToDecimalPlaces(e,s=t.QUANTITY_PARAM_MAX_DIGITS_GENERAL){return E.roundToDecimalPlacesValue(e.value,s)}static roundToDecimalPlacesAllNumbers(e,s=t.QUANTITY_PARAM_MAX_DIGITS_GENERAL){return E.roundToDecimalPlacesValue(e.value,s,!0)}
static roundToDecimalPlacesValue(e,s=t.QUANTITY_PARAM_MAX_DIGITS_GENERAL,a=!1){return e.numbers.forEach((t,n)=>{(0===n||a)&&-1!==e.preferredDecimals&&E.setValueValueWithDecimals(e,parseFloat(t),e.preferredDecimals,n,s,!0)}),e.numbers.map(e=>parseFloat(e))}static getValue(e,t=0){let s,a=(s=void 0!==e.value?e.value:e).numbers[t];return void 0!==a?parseFloat(a):Number.NaN}static getIntValue(e,t=0){let s,a=(s=void 0!==e.value?e.value:e).numbers[t];return void 0!==a?parseInt(a,10):Number.NaN}static changeUnit(e,s){let a;a=void 0!==e.value?e.value:e;const n=r.unitStringToLong(a.unit);a.numbers.forEach((e,i)=>{const o=r.convertWgtUnit(parseFloat(e),n,s);E.setValueValueWithDecimals(a,o,a.preferredDecimals,i,t.QUANTITY_PARAM_MAX_DIGITS_GENERAL,!0)}),a.unit=r.unitStringToShort(s)}}t.QuantityParameter=E;t.WeightBlockHelper=class{static getMeasureParameter(e,t){for(const s of e.parameters)for(const e of s.parameters)if(e.id===t&&e.type===o.EnumParameterTypes.PARAM_MEASURE)return e}}
},function(e,t){e.exports=require("util")},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(47),n=s(29),i=s(2),r=s(4),o=s(10),E=s(0),_=s(34),l=s(55),A=s(35),u=s(5),c=s(13);function I(e){return o.isNumber(e)&&(e=e.toFixed(0)),t.DYNAMIC_PARAMID_PREQUEL+"CONFIG_SCREEN"+e}function p(e,t){o.isString(t)||(t="_"),t=t,!1!==o.isString(e)&&0!==e.length||(e=t);let s=new RegExp(/[^0-9A-Za-z._-]+/g),a=new RegExp(/[\/\?<>\\:\*\|"]/g),n=new RegExp(/[\x00-\x1f\x80-\x9f]/g),i=new RegExp(/^\.+$/),r=new RegExp(/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i),E=new RegExp(/[\. ]+$/);return(e=(e=(e=(e=(e=(e=e.replace(s,t)).replace(a,t)).replace(n,t)).replace(i,t)).replace(r,t)).replace(E,t)).length>255&&(e=e.substring(0,255)),e}function d(e){if(t.fs.existsSync(e))if(t.fs.lstatSync(e).isDirectory()){let a=t.fs.readdirSync(e,{encoding:"utf8",withFileTypes:!1});for(var s=0;s<a.length;s++)d(t.path.join(e,a[s]));t.fs.rmdirSync(e)}else t.fs.unlinkSync(e)}var T
;function N(e){let t={title:"",header:"",value:"",automaticManipulation:T.NONE};return o.isObject(e)&&(t=Object.assign(t,e)),t}function R(e,t,s){let a={method:t,params:s},n=JSON.stringify(a),i=["http://127.0.0.1:8080/rest/"+e,"-H","Accept:application/json","-H","Content-Type:application/json","-H","Expect:","--data","@-"],o=_.spawnSync("curl",i,{input:n}),E=new r.CubisRestResponse(!1);try{E=new r.CubisRestResponse(o)}catch(e){E.rawReturns=e}return E}function S(e,t,s){return a.__awaiter(this,void 0,void 0,function*(){let a=A;return"https"===e&&(a=l),new Promise(function(e,n){let i=a.request(t,function(t){let s=[];t.on("data",function(e){s.push(e)}),t.on("end",function(){try{e({headers:t.headers,url:t.url,statusCode:t.statusCode,body:Buffer.concat(s)})}catch(e){n(e)}})});i.on("error",function(e){n(e)}),i.on("timeout",function(){i.abort(),n("Request timeout")}),s&&i.write(s),i.end()})})}function m(e){let t={unit:c.EnumUnit.NONE,decimals:0,d:0,e:0,max:0,min:0,extended:{
d:c.createQuantity(),e:c.createQuantity(),max:c.createQuantity(),min:c.createQuantity()},ranges:{1:{d:c.createQuantity(),e:c.createQuantity(),max:c.createQuantity(),min:c.createQuantity()}},activeRangeIndex:"1"};return o.isObject(e)&&o.overwriteExistingAttributes(e,t),t}t.fs=s(16),t.path=s(37),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 s=[],a=[],n=[];for(let e=0;e<t.length;e++)o.isNumber(Number(t[e]))?s.push(t[e]):o.isString(t[e])?a.push(t[e]):n.push(t[e]);return a=a.sort(),n=n.sort(),(s=(s=s.sort(function(e,t){return Number(e)-Number(t)})).concat(a)).concat(n)},t.determineNearestNumberInArray=function(e,t){for(let s=0;s<t.length;s++)if(e<t[s])return s<=0?s:e<=t[s]-(t[s]-t[s-1])/2?s-1:s;return t.length-1},t.loadWorkstate_DATA_CONTAINER=function(e){let t=void 0;if(!o.isString(e))return t;let s=R("task/management",u.RestMethodsTASK_MANAGEMENT.getWorkstate,{id:e,workstate:{}});try{
t=(t=JSON.parse(s.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 s={DATA_CONTAINER:t};return R("task/management",u.RestMethodsTASK_MANAGEMENT.saveWorkstate,{id:e,workstate:s})},t.loadTaskConfig_DATA_CONTAINER=function(e){let s=e.getGroup(I(54321));if(void 0===s)return;let a=[],n=I(54321)+"/"+t.DYNAMIC_PARAMID_PREQUEL+"DATA_CONTAINER_";for(let e=0;e<s.parameters.length;e++)if(s.parameters[e].type===E.EnumParameterTypes.PARAM_STRING&&s.parameters[e].id.startsWith(n)){let t=parseInt(s.parameters[e].id.substring(n.length));o.isNumber(t)&&(a[t]=s.parameters[e].value.string)}try{return JSON.parse(a.join())}catch(e){return}},t.storeTaskConfig_DATA_CONTAINER=function(e,s,a){let n=e.getGroup(I(54321));if(a=!!o.isBoolean(a)&&a,void 0===n&&(e.addDynamicGroup({id:I(54321),type:E.EnumParameterTypes.PARAM_GROUP,appearance:E.EnumAppearance.HIDDEN,title:{id:"",args:[]},
parameters:[]}),n=e.getGroup(I(54321))),void 0===n)return new r.CubisRestResponse(!1);n.parameters=[];let i=JSON.stringify(s),_=0,l=0;for(;_<i.length;){(l=_+1e5)>i.length&&(l=i.length);let s={id:I(54321)+"/"+t.DYNAMIC_PARAMID_PREQUEL+"DATA_CONTAINER_"+n.parameters.length.toFixed(0),type:E.EnumParameterTypes.PARAM_STRING,appearance:E.EnumAppearance.HIDDEN,title:{id:"",args:[]},header:{id:"",args:[]},value:{string:i.substring(_,l)},info:{minimum:{length:0},maximum:{length:1e5}}};_=l,n.parameters.push(s),e.updateParameter(s)}return!1===a?R("task/management",u.RestMethodsTASK_MANAGEMENT.updateTask,{task:JSON.stringify(e.getTask()),errorList:[]}):new r.CubisRestResponse(!0)},t.get_taskConfig_paramGroupID=I,t.getCompliantFilename=p,t.checkFileNameCompliancy=function(e,t){if(p(e)!==e)return!1;t=void 0!==t?t:[];for(let s=0;s<t.length;s++)if(e.includes(t[s]))return!1;return!0},t.getCreateTaskSpecificFolder=function(e,s){
let a="",i=e.getTask(),r=e.getParameter("TASK/IDENTIFICATION/NAME"),o=t.fs.readdirSync(s,{encoding:"utf8",withFileTypes:!1}),E=new n.TaskProxy,_=[];try{_=E.getTaskNamesByOrderNumber(i.qappOrderNumber)}catch(e){}for(var l=0;l<o.length;l++)if(o[l].toString().startsWith("_RENAME_TASK_ID_")&&o[l].toString().endsWith(".json")){var A=t.fs.readFileSync(t.path.join(s,o[l]),"utf8");(u=JSON.parse(A))&&u.taskname&&u.foldername&&!_.includes(u.taskname)&&(d(t.path.join(s,u.foldername)),d(t.path.join(s,o[l])))}else if(o[l].toString().startsWith("_TASK_"))try{E.readTask(o[l].toString().substring("_TASK_".length))}catch(e){d(t.path.join(s,o[l]))}if(null==i._id||""==i._id){let e=Date.now(),n={taskname:r.value.string,foldername:"_RENAME_TASK_ID_"+e};t.fs.writeFileSync(t.path.join(s,"_RENAME_TASK_ID_"+e+".json"),JSON.stringify(n)),a=t.path.join(s,"_RENAME_TASK_ID_"+e)}else for(a=t.path.join(s,"_TASK_"+i._id),
l=0;l<o.length;l++)if(o[l].toString().startsWith("_RENAME_TASK_ID_")&&o[l].toString().endsWith(".json")){var u;A=t.fs.readFileSync(t.path.join(s,o[l]),"utf8"),(u=JSON.parse(A))&&u.taskname&&u.foldername&&u.taskname==r.value.string&&(t.fs.existsSync(t.path.join(s,u.foldername))?t.fs.existsSync(a)?(d(t.path.join(s,u.foldername)),d(t.path.join(s,o[l]))):(t.fs.renameSync(t.path.join(s,u.foldername),a),d(t.path.join(s,o[l]))):d(t.path.join(s,o[l])))}return t.fs.existsSync(a)||t.fs.mkdirSync(a),a},t.deleteFileFolderRecursive=d,t.createFolder=function(e){t.fs.existsSync(e)||t.fs.mkdirSync(e)},function(e){e.NONE="NONE",e.INCREMENT="INCREMENT",e.DECREMENT="DECREMENT"}(T=t.EnumIdentifierAutoManipulation||(t.EnumIdentifierAutoManipulation={})),t.EnumMapIdentifierAutoManipulation={[T.NONE]:"_QAPP_LIB_PARAM_SELECT_OPTION_SID_ON",[T.INCREMENT]:"_QAPP_LIB_PARAM_SELECT_OPTION_SID_ON_AUTO_INC",[T.DECREMENT]:"_QAPP_LIB_PARAM_SELECT_OPTION_SID_ON_AUTO_DEC"},t.getLotIDsParameterID=function(e){
o.isNumber(e)||(e=1),e=e;const s=I("_RESERVED_LOT_ID_SETTINGS");return{paramGroupID:s,settingsLockedInfo:s+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_LOT_ID_settingsLocked",mainCounter:s+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_LOT_ID_counter",header:s+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_LOT_ID_"+e.toFixed(0)+"_header",title:s+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_LOT_ID_"+e.toFixed(0)+"_title"}},t.getSampleIDsParameterID=function(e){o.isNumber(e)||(e=1),e=e;const s=I("_RESERVED_SAMPLE_ID_SETTINGS");return{paramGroupID:s,settingsLockedInfo:s+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_SAMPLE_ID_settingsLocked",mainCounter:s+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_SAMPLE_ID_counter",header:s+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_SAMPLE_ID_"+e.toFixed(0)+"_header",title:s+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_SAMPLE_ID_"+e.toFixed(0)+"_title",manipulator:s+"/"+t.DYNAMIC_PARAMID_PREQUEL+"RESERVED_SAMPLE_ID_"+e.toFixed(0)+"_manipulator"}},t.createStandardIdentifier=N,
t.preManipulateIdentifier=function(e){let t=N();void 0!==e&&(t=i.cloneJSON(e));let s=void 0,a=0;const n=/\d*$/,r=t.value.match(n);switch(null!=r&&r.length>0&&o.isString(r[0])&&(a=r[0].length,s=parseInt(r[0])),t.automaticManipulation){case T.INCREMENT:""===t.value?t.value="001":""===t.value||o.isNumber(s)?""!==t.value&&o.isNumber(s)&&(s++,t.value=t.value.replace(n,s.toFixed(0).padStart(a,"0"))):t.value+="-2";break;case T.DECREMENT:""!==t.value&&o.isNumber(s)&&s>0&&(s--,t.value=t.value.replace(n,s.toFixed(0).padStart(a,"0")))}return t},t.perform_InternalWebserviceRequest=R,t.perform_WebserviceRequest=function(e,t,s,n,i,r,E,_,u,c,I){return a.__awaiter(this,void 0,void 0,function*(){o.isNumber(t)||(t="http"===s?80:443),o.isNumber(I)||(I=1e4);let a,p={hostname:e,port:t,path:i,method:n,followRedirects:!1,headers:r,timeout:I};u&&c&&(p.auth=u+":"+c),p.agent="https"===s?new l.Agent({host:e,keepAlive:!0,rejectUnauthorized:!1,port:t}):new A.Agent({keepAlive:!0}),
E&&void 0!==E&&(_=JSON.stringify(E)),_&&(p.headers["content-length"]=Buffer.byteLength(_));try{a=yield S(s,p,_).then(e=>({isSuccess:!0,error:"",statusCode:e.statusCode,headers:e.headers,body:e.body,url:e.url,metadata:i}))}catch(e){return{isSuccess:!1,error:e?e.toString():"",statusCode:0,headers:{},body:void 0,url:p.hostname+p.path,metadata:i}}return a})},t.httpRequest=S,t.getConfiguredPrintProfiles=function(){let e=[];const t=R("profilemanagement",u.RestMethodsPROFILE_MANAGEMENT.getProfiles,{filter:'[{"type":{"ne":"WEIGHING_PROFILE_NAME"}}]',rProfiles:{}});if(t.isSuccess()&&o.isString(t.rawReturns.rProfiles)){const s=JSON.parse(t.rawReturns.rProfiles.toString());for(let t=0;t<s.data.length;t++){const a=o.getObjectByID(s.data[t].params,"PROFILE/IDENTIFICATION","id");if(o.isObject(a)&&o.isObject(a.parameters)){const n=o.getObjectByID(a.parameters,"PROFILE/IDENTIFICATION/NAME","id");o.isObject(n)&&o.isObject(n.value)&&e.push({id:s.data[t]._id,type:s.data[t].type,title:n.value.string})}}}
return e},t.createMetrology=m,t.getMetrology=function(e){let t=m(),s=R("weighing",u.RestMethodsWEIGHING.getParameter,{id:"WEIGHING/METROLOGY/RANGE",rObject:{}}),a="";if(s.isSuccess()&&s.hasOwnProperty("rawReturns")&&s.rawReturns.hasOwnProperty("rObject")&&(s=JSON.parse(s.rawReturns.rObject))&&s.hasOwnProperty("id")&&s.hasOwnProperty("parameters")){let e=o.getObjectByID(s.parameters,"WEIGHING/METROLOGY/RANGE/MAXIMUM");e&&(a=e.value.numbers[0])}const n=R("weighing",u.RestMethodsWEIGHING.getRangeParameters,{parameters:{}});if(!(n.isSuccess()&&n.hasOwnProperty("rawReturns")&&n.rawReturns.hasOwnProperty("parameters")))return t;const i=JSON.parse(n.rawReturns.parameters);if(!(i.hasOwnProperty("list")&&Array.isArray(i.list)&&i.list.length>0))return t;const r=o.getObjectByID(i.list,"WEIGHING/METROLOGY/RANGES");if(!o.isObject(r))return t;t.ranges={};for(let s of Object.values(r.parameters)){if(!o.isString(s.id)||!o.isObject(s.parameters))continue;let n="";const i=s.id.split("/")
;if(0===(n=i[i.length-1]).length)continue;const r={d:c.createQuantity(),e:c.createQuantity(),max:c.createQuantity(),min:c.createQuantity()};let E=o.getObjectByID(s.parameters,"WEIGHING/METROLOGY/RANGES/"+n+"/INTERVAL");E&&(r.d.value=parseFloat(E.value.numbers[0]),r.d.decimals=E.value.decimals,r.d.unit=c.getUnitEnum(E.value.unit.toString())),(E=o.getObjectByID(s.parameters,"WEIGHING/METROLOGY/RANGES/"+n+"/PRECISION"))&&(r.e.value=parseFloat(E.value.numbers[0]),r.e.decimals=E.value.decimals,r.e.unit=c.getUnitEnum(E.value.unit.toString())),(E=o.getObjectByID(s.parameters,"WEIGHING/METROLOGY/RANGES/"+n+"/MINIMUM"))&&(r.min.value=parseFloat(E.value.numbers[0]),r.min.decimals=E.value.decimals,r.min.unit=c.getUnitEnum(E.value.unit.toString())),(E=o.getObjectByID(s.parameters,"WEIGHING/METROLOGY/RANGES/"+n+"/MAXIMUM"))&&(r.max.value=parseFloat(E.value.numbers[0]),r.max.decimals=E.value.decimals,r.max.unit=c.getUnitEnum(E.value.unit.toString()),a===E.value.numbers[0]&&(t.activeRangeIndex=n)),
void 0===e&&(e=r.d.unit),r.d=c.convertToTargetUnit(r.d,e),r.e=c.convertToTargetUnit(r.e,e),r.e.decimals=r.d.decimals,r.min=c.convertToTargetUnit(r.min,e),r.min.decimals=r.d.decimals,r.max=c.convertToTargetUnit(r.max,e),r.max.decimals=r.d.decimals,t.ranges[n]=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=R("user",u.RestMethodsUSER_MANAGEMENT.getListRoles,{list:{},start:0,end:-1}),t=[];try{let s=JSON.parse(e.rawReturns.list).data;for(let e=0;e<s.length;e++)t.push({id:s[e]._id,
name:o.getObjectByID(s[e].params,"ROLE/NAME").value.string,editable:s[e].editable,locked:s[e].locked})}catch(e){}return t},t.get_device_user=function(){let e={id:"",name:"",display_name:"",description:"",role_id:"",role_name:""},t=R("access",u.RestMethodsACCESS_MANAGEMENT.getCurrentUser,{user:""});try{let s=JSON.parse(t.rawReturns.user);e.id=s._id;let a=o.getObjectByID(s.params,"USER/SETTINGS");e.name=o.getObjectByID(a.parameters,"USER/SETTINGS/LOGINNAME").value.string,e.display_name=o.getObjectByID(a.parameters,"USER/SETTINGS/NAME").value.string,e.description=o.getObjectByID(a.parameters,"USER/SETTINGS/DESCRIPTION").value.string,e.role_id=o.getObjectByID(a.parameters,"USER/SETTINGS/ROLES").value.selection.id,e.role_name=o.getObjectByID(a.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,s){},t.tryAssign_IQuantity_to_taskParameter=function(e,t,s){}
},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(3),n=s(2),i=s(1);class r{constructor(e,t){this.publishedId="",this.publishPending=!0,this.parameter=t,this.publishedId=i.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,a.isTypeOfIPasswordParameter(this.parameter)){let e=n.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,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0})
;const a=s(58),n=s(59),i=s(60),r=s(48),o=s(62),E=s(12),_=s(22),l=s(63),A=s(23),u=s(66),c=s(49),I=s(29),p=s(41),d=s(51),T=s(70),N=s(71),R=s(52),S=s(11),m=s(44),h=s(3),D=s(73),P=s(6),g=s(26),O=s(74),M=s(37),L=s(16),C=s(14),f=s(18),b=s(75),B=s(27),v=s(43),y=s(76),G=s(2),U=s(7),H=s(77),k=s(78),F=s(79),x=s(40),Q=s(80),V=s(28),Y=s(1),w=s(0);s(81),t.HEARTBEAT_INTERVAL_MS=2e3;const W=100,K=500;t.STORAGE_LOCATION_BASE="/data/installedQApps/qapps/data";const q="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",se="BTN_RESTART_QUESTION_YES",ae="BTN_RESTART_QUESTION_NO",ne="CANCEL_LOGOUT",ie="REMEMBER_LOGOUT",re="TASK/IDENTIFICATION",oe="TASK/PROFILE";var Ee,_e
;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"}(Ee=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"}(_e=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 le{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=_e.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 n=s(16);if(console.log("try reading debug config from file"),n.existsSync("/data/installedQApps/qapps/data/qapplog.conf"))try{console.log("...found config file")
;let e=JSON.parse(n.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 i=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 x.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 Q.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 s="";if(t.forEach(e=>{s+=e}),this.debugCfg.doConsoleLog)try{i(s)}catch(e){}s+="\n";try{e.write(s)}catch(e){}}),e.setNoDelay(!0),e.write("Hello, server! Love, Client.")}catch(e){}})}console.log("QAppBase: constr"),le.clientSingleton=this,this.restHandler=new u.RestHandler,this.mqttHandler=new l.MqttHandler,this.taskMngProxy=new I.TaskProxy,this.localizerProxy=new c.LocalizerProxy,this.weighingProxy=new p.WeighingProxy,this.accessControlProxy=new T.AccessControlProxy,this.reportingProxy=new R.ReportingProxy,this.devicInformationProxy=new b.DeviceInformationProxy,this.messageHandlerProxy=new B.MessageHandlerProxy,this.messageHandlerHelper=new v.MessageHandlerHelper(this.messageHandlerProxy),this.taskHandler=new d.TaskHandler,this.heartbeatInterval$=a.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&&h.isTypeOfISelectionParameter(e)?e.value.selection.id:void 0}registerAspect(e){this.aspects[e.getId()]=e}init(){let e=new D.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?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===P.ScreenEventType.SHOW_SCREEN&&this.hideLoadingScreenOnShowScreens&&this.hideLoadingScreen(),e.type,P.ScreenEventType.SHOW_LOADINGSCREEN,e.type,P.ScreenEventType.SHOW_MESSAGEBOX})}catch(e){}}showScreen(e){if(!this.exitTimeOutPending)switch(e.getId()){case D.LOADING_OVERLAY_ID:case N.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 D.LOADING_OVERLAY_ID:case N.MESSAGEBOX_ID:this.exitError("QAppBase::closeAllScreensExcept() was called for messagebox or loading screen - not allowed");break;default:for(let t in this.screens){let s=this.screens[t];s.getId()!==e.getId()&&s.getId()!==D.LOADING_OVERLAY_ID&&s.getId()!==F.LOCK_LOADING_OVERLAY_ID&&s.getId()!==k.LOCKMESSAGEBOX_ID&&(s.getId()===N.MESSAGEBOX_ID?this.hideMsgBox():s.hide())}this.hidePrintQueue()}}getLoadingScreen(){let e=this.screens[D.LOADING_OVERLAY_ID];return void 0===e&&(e=new D.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===g.MQTT_ADMIN_EVENT_PACKET_SENT&&e.payload.packet.topic===Y.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===g.MQTT_ADMIN_EVENT_PACKET_SENT&&e.payload.packet.topic===Y.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[N.MESSAGEBOX_ID]
;return void 0===e&&(e=new N.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(Y.MqttTopics.REPORTING_PRINTQUEUE_DISPLAYED,JSON.stringify(e),{retain:!1})}}hidePrintQueue(){console.log("QAppBase::hidePrintQueue()");this.mqttHandler.publish(Y.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 Ee.FUNC_BTN_TAKEOVER:this.buttons.takeoverBtn=t,
this.lastRequestedTakeoverBtnAppearance=t.getAppearance();break;case Ee.FUNC_BTN_DOCU:this.buttons.docuButton=t,this.buttons.docuButton.setAppearance(w.EnumAppearance.DISABLED);break;default:this.buttons.others.push(t)}}addTimer(e,t){const s=i.setTimeout(()=>{this.addToEventQueue(new E.QAppTimerEvent(t))},e);return s.unref(),s}cancelTimer(e){void 0!==e&&i.clearTimeout(e)}addInterval(e,t){return i.setInterval(()=>{this.addToEventQueue(new E.QAppIntervalEvent(t))},e)}cancelInterval(e){void 0!==e&&i.clearInterval(e)}generateAsyncCallidentifier(){let e=Math.random();for(;this.outstandingAsyncCalls.find(t=>t===e);)e=Math.random();return e}enqueAsyncCall(e,s,a=5*t.HEARTBEAT_INTERVAL_MS,n=!1){let r=this.getCurrentState();console.log("QAppBase::enqueAsyncCall in state: "+r+" (timeout: "+a+"/fetchAfter: "+n+") with metadata: "+f.inspect(s));let E=this.generateAsyncCallidentifier();this.outstandingAsyncCalls.push(E);let _=new y.QAppAsyncCallTimeoutError(r,s),l=i.setTimeout(()=>{
console.log("QAppBase async call timeout - add timeout to event queue");let e=new o.InternalAsyncCallEvent({type:n?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:_,metadata:s},id:E});this.addToEventQueue(e)},a);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:s},id:E,timerId:l});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:s},id:E,timerId:l});this.addToEventQueue(t)}),console.log("QAppBase::enqueAsyncCall done...")}addToEventQueue(e){
e.type===E.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,s=e.eventQueue.pop();for(;s&&t>0&&!this.exitTimeOutPending;)t--,e.handleEvent(s),t>0&&(s=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(n.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 Y.MqttTopics.METROLOGY_MAX_DIGITS:case Y.MqttTopics.METROLOGY_MAX_DIGITS_DEBUG:this.weighingProxy.updateWeighValueMaxDigits(parseInt(e.payload.value.toString(),10));break;case Y.MqttTopics.METROLOGY_RANGES:this.weighingProxy.updateMetrologyRanges(JSON.parse(e.payload.value.toString()));break;case Y.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(Y.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")},W),console.log("QAppBase: run finished")}}canSuspend(){if(console.log("QAppBase: Can suspend?"),this.suspendReason===_e.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===_e.SUSPEND_LOGOUT)this.showPriorMsgBox({type:S.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!==_e.SUSPEND_HOME)return!1;this.showPriorMsgBox({type:S.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!==_e.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=_e.SUSPEND_NO_SUSPEND}cancelLogout(){console.log("QAppBase: Cancel last logout request"),this.cancelSuspend(),this.mqttHandler.publish(Y.MqttTopics.QAPP_LOGOUT_REQUEST,JSON.stringify({request:ne}))}rememberLogout(){this.mqttHandler.publish(Y.MqttTopics.QAPP_LOGOUT_REQUEST,JSON.stringify({request:ie}))}suspend(){console.log("QAppBase: QApp suspend request"),
this.suspendReason=_e.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(Y.MqttTopics.QAPP_STOPPED,this.taskId?""+this.taskId:"",{retain:!1}),setTimeout(()=>{console.log("process.exit"),process.exit(0)},K),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:S.EnumMessageboxType.QUESTION,title:{id:"_QAPP_LIB_MBOX_RESTART_QUESTION_TITLE",args:[]},buttons:[{id:se,label:{id:"_QAPP_LIB_MBOX_BTN_YES",args:[]},appearance:w.EnumAppearance.ENABLED_SECONDARY},{id:ae,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(m.CANCEL_BARBUTTON_ID);if(t&&t.setAppearance(w.EnumAppearance.HIDDEN),e!==D.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(v.EMsgHandlerMsgs.ERR_799_GENERIC_INTERNAL_ERROR,e,void 0,[B.createMessageHandlerButton(void 0,void 0,B.MessageHandlerCallTarget.REMOVE_MESSAGE)]),this.onErrorExiting(e),this.mqttHandler.publish(Y.MqttTopics.QAPP_ERROR,(this.taskId?""+this.taskId:"")+"error: "+e,{retain:!1}),setTimeout(()=>{console.error("QAppBase: exit with error: "+e),process.exit(-1)},K),this.exitTimeOutPending=!0}heartbeat(e){this.isErrorStatePublished||(this.debugCfg.enableHeartbeatLog&&console.log("."),this.mqttHandler.publish(Y.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===g.MQTT_ADMIN_EVENT_PACKET_SENT&&e.payload.packet.topic===Y.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:S.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,s){return s.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 s=function(e,t){e.heartbeat(t.payload)};for(let e in t)t.hasOwnProperty(e)&&(t[e]._FSM_HEARTBEAT_EVENT_=s,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=_e.SUSPEND_HOME:e.suspendReason=_e.SUSPEND_LOGOUT,e.canSuspend()?this.transition(e,q):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=_e.SUSPEND_HOME,this.transition(e,q);break;case o.INTERNAL_SUSPEND_EVENT_TYPE.SUSPEND_EVENT_TYPE_EXECFINALLY:this.transition(e,q)}},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[q]={_onEnter:function(e){e.showLoadingScreen({id:"",args:[]})},_onExit:function(e){},MQTT_ADMIN_EVENT:function(e,t){e.checkForLoadingScreenEnableEvent(t)&&e.doSuspend()},_FSM_HEARTBEAT_EVENT_:s},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_:s}}else t=this.qappStates;return t}handleEvent(e){if(this.qappFsm){if(e instanceof _.MqttUpdateDebugEvent&&e.payload.topic===Y.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 A.HmiButtonClickedEvent)if(e.payload.buttonId!==V.BTN_HOME_ID||this.suppressGlobalHomeBtnHandling)if(e.payload.buttonId!==V.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===se)return void this.continueRestart();if(e.payload.buttonId===ae)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 _.MqttUpdateEvent&&e.payload.topic===Y.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&&i.clearTimeout(e.payload.timerId),this.outstandingAsyncCalls.splice(t,1),e=new E.QAppAsyncCallDoneEvent(e.payload.data);break
;case o.INTERNAL_ASYNC_CALL_EVENT_TYPE.INTERNAL_ASYNC_CALL_EVENT_TYPE_FAIL:e.payload.timerId&&i.clearTimeout(e.payload.timerId),this.outstandingAsyncCalls.splice(t,1),e=new E.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 E.QAppAsyncCallFailEvent(e.payload.data);break;case o.INTERNAL_ASYNC_CALL_EVENT_TYPE.INTERNAL_ASYNC_CALL_EVENT_TYPE_TIMEOUT_WITH_FETCHING_RESP:e=new E.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 s=t[e.toState];s?s(e.client,e):(s=t["~"])&&s(e.client,e),(s=t["*"])&&s(e.client,e)}if(e.fromState===r.STATE_UNINITIALIZED_INTERNAL){
e.client.mqttHandler.subscribe(Y.MqttTopics.METROLOGY_MAX_DIGITS),e.client.mqttHandler.subscribe(Y.MqttTopics.METROLOGY_MAX_DIGITS_DEBUG),e.client.mqttHandler.subscribe(Y.MqttTopics.METROLOGY_RANGES),e.client.mqttHandler.subscribe(Y.MqttTopics.WEIGHING_SELECTED_DISPLAY_VALUE),e.client.mqttHandler.subscribe(Y.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=[],s=e.client.messageHandlerHelper.buildSecret(v.MESSAGE_HANDLER_SECRET_TYPE.QAPP);s&&t.push({categoryAsString:B.MessageHandlerCategory.QAPP,secret:s});let a=e.client.messageHandlerHelper.buildSecret(v.MESSAGE_HANDLER_SECRET_TYPE.QAPP_DB_ERROR);a&&t.push({categoryAsString:B.MessageHandlerCategory.QAPP,secret:a})
;let n=e.client.messageHandlerHelper.buildSecret(v.MESSAGE_HANDLER_SECRET_TYPE.QAPP_RUNTIME_COMM_ERROR);n&&t.push({categoryAsString:B.MessageHandlerCategory.QAPP,secret:n});let i=e.client.messageHandlerHelper.buildSecret(v.MESSAGE_HANDLER_SECRET_TYPE.QAPP_RUNTIME_EXIT_ERROR);i&&t.push({categoryAsString:B.MessageHandlerCategory.QAPP,secret:i});let r=void 0;void 0!==e.client.taskId&&(r=e.client.messageHandlerHelper.buildSecret(v.MESSAGE_HANDLER_SECRET_TYPE.TASKID))&&t.push({categoryAsString:B.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"),s&&e.client.messageHandlerProxy.deleteMessageByCategory(B.MessageHandlerCategory.QAPP,s),a&&e.client.messageHandlerProxy.deleteMessageByCategory(B.MessageHandlerCategory.QAPP,a),
n&&e.client.messageHandlerProxy.deleteMessageByCategory(B.MessageHandlerCategory.QAPP,n),i&&e.client.messageHandlerProxy.deleteMessageByCategory(B.MessageHandlerCategory.QAPP,i),r&&e.client.messageHandlerProxy.deleteMessageByCategory(B.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(Y.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 s=t[e.fromState];s?s(e.client,e):(s=t["~"])&&s(e.client,e),(s=t["*"])&&s(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:"---",I.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 s=void 0,a=this.taskHandler.getTask();switch(e){case O.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_INDEPENDENT:s=t.STORAGE_LOCATION_BASE;break;case O.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_SPECIFIC:a&&(s=this.getStorageLocation(O.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_INDEPENDENT)+M.sep+a.qappOrderNumber);break;case O.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_SPECIFIC_VERSION:a&&(s=this.getStorageLocation(O.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_SPECIFIC)+M.sep+a.qappVersion);break;case O.EnumPersistencyScope.PERSISTENCY_SCOPE_TASk_SPECIFIC:a&&this.taskId&&(s=this.getStorageLocation(O.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_SPECIFIC_VERSION)+M.sep+this.taskId)}return s}
createStorageLocation(e){let t=s(16),a=this.getStorageLocation(O.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_INDEPENDENT);if(void 0!==a){if(!t.existsSync(a))return!1;if(e!==O.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_INDEPENDENT){let s=this.getStorageLocation(O.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_SPECIFIC);if(void 0!==s){if(t.existsSync(s)||t.mkdirSync(s),e!==O.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_SPECIFIC){let s=this.getStorageLocation(O.EnumPersistencyScope.PERSISTENCY_SCOPE_QAPP_SPECIFIC_VERSION);if(void 0!==s){if(t.existsSync(s)||t.mkdirSync(s),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 s=void 0,a=void 0,n="";this.scriptPath?n=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 i="";try{i=n+"qapp.desc_"+e+".json",a=L.readFileSync(i)}catch(e){console.log("QAppConfigBase: - no "+i+" found - try DEFAULT");try{i=n+"qapp.desc_DEFAULT.json",a=L.readFileSync(i)}catch(e){t?this.exitError("QAppConfigBase::readQAppDescAsJSON - "+i+" (fallback) missing"):console.log("QAppConfigBase::readQAppDescAsJSON - "+i+" (fallback) missing")}}try{a&&(s=JSON.parse(a.toString("utf-8")))}catch(e){t?this.exitError("QAppConfigBase::readQAppDescAsJSON - "+i+" not valid JSON"):console.log("QAppConfigBase::readQAppDescAsJSON - "+i+" not valid JSON")}return s}relevantParamsAreEqual(e,s){let a=G.cloneJSON(e),n=G.cloneJSON(s);return a.forEach((e,s)=>{
e.id===re?delete a[s]:e.id===oe&&e.parameters.forEach((e,n)=>{e.id.startsWith(t.TASK_PROFILE_REPORTING_ID_PREFIX)?delete a[s].parameters[n]:e.id===t.TASK_PROFILE_WEIGHING_ID&&(e.info.options=[])})}),n.forEach((e,s)=>{e.id===re?delete n[s]:e.id===oe&&e.parameters.forEach((e,a)=>{e.id.startsWith(t.TASK_PROFILE_REPORTING_ID_PREFIX)?delete n[s].parameters[a]:e.id===t.TASK_PROFILE_WEIGHING_ID&&(e.info.options=[])})}),C.isEqual(a,n)}deleteDBError(){let e=this.messageHandlerHelper.buildSecret(v.MESSAGE_HANDLER_SECRET_TYPE.QAPP_DB_ERROR);e&&this.messageHandlerProxy.deleteMessageByCategory(B.MessageHandlerCategory.QAPP,e)}}t.QAppBase=le},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EV_MQTT_UPDATE="EV_MQTT_UPDATE";class a{constructor(e){this.payload=e,this.type=t.EV_MQTT_UPDATE}}t.MqttUpdateEvent=a,t.EV_MQTT_UPDATE_DEBUG="EV_MQTT_UPDATE_DEBUG";t.MqttUpdateDebugEvent=class extends a{constructor(){super(...arguments),this.type=t.EV_MQTT_UPDATE_DEBUG}}
},function(e,t,s){"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 a=s(40);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 a.URL("http://127.0.0.1/"+e.payload.subUrl).searchParams}},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(3),n=s(20),i=s(6);t.CANCEL_BUTTON_ID="BTN_CANCEL",t.CANCEL_BUTTON_NAME="_CANCEL";class r extends i.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={},s={},i=a.createEmptyTextStructure();i=t.title,s.title=i,e.category=s,e.category.id=t.id,e.params=[];for(let s of t.parameters){let t=new n.default(this.mqttHandler,s);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,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(11),n=s(0),i=s(7);t.ParamUpdateUserActionSimpleAccept_OK_BUTTON_ID="BTN_OK",t.ParamUpdateUserActionSimpleAccept={type:a.EnumMessageboxType.ERROR,title:{id:"_QAPP_LIB_MSG_BOX_WARNING_UPDATE_TASK_PARAM",args:[]},textList:[],buttons:[{appearance:n.EnumAppearance.ENABLED_SECONDARY,label:{id:i.EnumFontLabels.OK,args:[]},id:t.ParamUpdateUserActionSimpleAccept_OK_BUTTON_ID}]}},function(e,t,s){"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,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(4),n=s(0),i=s(18),r=s(7),o=s(5);var E,_,l;function A(e,s,a){return{
appearance:n.EnumAppearance.ENABLED_SECONDARY,type:_.CALLBACK,name:s||r.EnumFontLabels.OK,effect:{method:"buttonClickEvent",module:"qappHandler",params:{buttonId:e||t.MESSAGEHANDLER_OK_BTN_ID},calltarget:a||l.ReST}}}!function(e){e.FATAL="FATAL",e.ERROR="ERROR",e.WARNING="WARNING",e.INFORMATION="INFORMATION"}(E=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"}(_=t.MESSAGE_HANDLER_BUTTON_TYPE||(t.MESSAGE_HANDLER_BUTTON_TYPE={})),function(e){e.MQTT="MQTT",e.ReST="ReST",e.REMOVE_MESSAGE="REMOVE_MESSAGE"
}(l=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=A;t.MessageHandlerProxy=class extends a.BaseProxy{constructor(){super(...arguments),this.restEndpoint="messagehandler"}addMessage(e,t,s,n,r,E,_,l,u,c){return this.body.method=o.RestMethodsMESSAGE_HANDLER.addMessage,this.body.params={message:{errorCode:e,type:t,lifetime:n,title:r,reason:E,solution:_,buttons:u||[A()],category:s,categorysecret:l},showMessageInFutureMillis:c||0,uniqueMessageId:0},console.log("addMessageHandler: "+i.inspect(this.body.params.message)),new a.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: "+i.inspect(this.body.params)),new a.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: "+i.inspect(this.body.params)),new a.CubisRestResponse(this.syncRequest())}getAllMessagesByCategory(e){this.body.method=o.RestMethodsMESSAGE_HANDLER.getAllMessagesByCategory,this.body.params={categoryAsString:e,messages:{}};let t=new a.CubisRestResponse(this.syncRequest());return JSON.parse(t.rawReturns.messages).data}getAllErrorMessagesByCategory(e){let t=this.getAllMessagesByCategory(e),s=[];for(let e of t)e.type===E.ERROR&&s.push(e);return s}removeMessage(e){return this.body.method=o.RestMethodsMESSAGE_HANDLER.removeMessage,this.body.params={uniqueMessageId:e},
new a.CubisRestResponse(this.syncRequest())}}},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(0),n=s(7),i=s(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:n.EnumFontLabels.RESULT,args:[]},appearance:a.EnumAppearance.HIDDEN};t.createEvalButtonData=function(){return i.cloneJSON(o)},t.BTN_NEXT_ID="BTN_NEXT";const E={buttonId:t.BTN_NEXT_ID,label:{id:n.EnumFontLabels.NEXT,args:[]},appearance:a.EnumAppearance.HIDDEN};t.createNextButtonData=function(){return i.cloneJSON(E)},t.BTN_PREV_ID="BTN_PREV";const _={buttonId:t.BTN_PREV_ID,label:{id:n.EnumFontLabels.PREV,args:[]},appearance:a.EnumAppearance.HIDDEN};t.createPrevButtonData=function(){return i.cloneJSON(_)},t.BTN_BACK_ID="BTN_BACK",t.BTN_LONG_BACK_ID="BTN_LONG_BACK";const l={
buttonId:t.BTN_BACK_ID,label:{id:n.EnumFontLabels.BACK,args:[]},appearance:a.EnumAppearance.HIDDEN};t.createBackButtonData=function(e=!1){let s=i.cloneJSON(l);return e&&(s.longPressButtonId=t.BTN_LONG_BACK_ID),s},t.BTN_DOCU_ID="BTN_DOCU";const A={buttonId:t.BTN_DOCU_ID,label:{id:n.EnumFontLabels.DOCU,args:[]},appearance:a.EnumAppearance.HIDDEN};t.createDocuButtonData=function(){return i.cloneJSON(A)},t.BTN_SEND_ID="BTN_SEND";const u={buttonId:t.BTN_SEND_ID,label:{id:n.EnumFontLabels.DOCU,args:[]},appearance:a.EnumAppearance.HIDDEN};t.createSendButtonData=function(){return i.cloneJSON(u)},t.BTN_INVALIDATE_SAMPLE_ID="BTN_INVALIDATE_SAMPLE";const c={buttonId:t.BTN_INVALIDATE_SAMPLE_ID,label:{id:n.EnumFontLabels.INVALIDATE_SAMPLE,args:[]},appearance:a.EnumAppearance.HIDDEN};t.createInvalidateSampleButtonData=function(){return i.cloneJSON(c)},t.BTN_PRINT_LABEL_ID="BTN_PRINT_LABEL";const I={buttonId:t.BTN_PRINT_LABEL_ID,label:{id:"_QAPP_LIB_PRINT_LABEL_BTN_TITLE",args:[]},
appearance:a.EnumAppearance.HIDDEN};t.createPrintLabelButtonData=function(){return i.cloneJSON(I)},t.BTN_START_ID="BTN_START";const p={buttonId:t.BTN_START_ID,label:{id:n.EnumFontLabels.START,args:[]},appearance:a.EnumAppearance.HIDDEN};t.createStartButtonData=function(){return i.cloneJSON(p)},t.BTN_END_ID="BTN_END";const d={buttonId:t.BTN_END_ID,label:{id:n.EnumFontLabels.END,args:[]},appearance:a.EnumAppearance.HIDDEN};t.createEndButtonData=function(){return i.cloneJSON(d)},t.BTN_PRINTADD_ID="BTN_PRINTADD";const T={buttonId:t.BTN_PRINTADD_ID,label:{id:n.EnumFontLabels.PRINT_ADD,args:[]},appearance:a.EnumAppearance.HIDDEN};t.createPrintAddButtonData=function(){return i.cloneJSON(T)},t.BTN_CANCEL_ID="BTN_CANCEL";const N={buttonId:t.BTN_CANCEL_ID,label:{id:n.EnumFontLabels.CANCEL,args:[]},appearance:a.EnumAppearance.HIDDEN};t.createCancelButtonData=function(){return i.cloneJSON(N)},t.BTN_SEARCH_ID="BTN_SEARCH";const R={buttonId:t.BTN_SEARCH_ID,label:{id:n.EnumFontLabels.SEARCH,args:[]},
appearance:a.EnumAppearance.HIDDEN};t.createSearchButtonData=function(){return i.cloneJSON(R)},t.setNoSearchActive=function(e,t=!0){e.setLabel({id:n.EnumFontLabels.SEARCH,args:[]},t)},t.setSearchActive=function(e,t=!0){e.setLabel({id:n.EnumFontLabels.SEARCH_ACTIVE,args:[]},t)},t.BTN_FILTER_ID="BTN_FILTER";const S={buttonId:t.BTN_FILTER_ID,label:{id:n.EnumFontLabels.FILTER,args:[]},appearance:a.EnumAppearance.HIDDEN};t.createFilterButtonData=function(){return i.cloneJSON(S)},t.setNoFilterActive=function(e,t=!0){e.setLabel({id:n.EnumFontLabels.FILTER,args:[]},t)},t.setFilterActive=function(e,t=!0){e.setLabel({id:n.EnumFontLabels.FILTER_ACTIVE,args:[]},t)},t.BTN_ADD_ID="BTN_ADD";const m={buttonId:t.BTN_ADD_ID,label:{id:n.EnumFontLabels.ADD,args:[]},appearance:a.EnumAppearance.HIDDEN};t.createAddButtonData=function(){return i.cloneJSON(m)},t.BTN_DELETE_ID="BTN_DELETE";const h={buttonId:t.BTN_DELETE_ID,label:{id:n.EnumFontLabels.DELETE,args:[]},appearance:a.EnumAppearance.HIDDEN}
;t.createDeleteButtonData=function(){return i.cloneJSON(h)},t.BTN_HOME_ID="BTN_HOME",t.HOME_BUTTON_ICON="./02_menu";const D={buttonId:t.BTN_HOME_ID,label:{id:n.EnumFontLabels.CANCEL,args:[]},icon:t.HOME_BUTTON_ICON,appearance:a.EnumAppearance.HIDDEN};t.createHomeButtonData=function(){return i.cloneJSON(D)},t.BTN_LOGOUT_ID="BTN_LOGOUT";const P={buttonId:t.BTN_LOGOUT_ID,label:{id:n.EnumFontLabels.LOGOUT,args:[]},appearance:a.EnumAppearance.ENABLED_SECONDARY};t.createLogoutButtonData=function(){return i.cloneJSON(P)},t.BTN_RELOAD_ID="BTN_RELOAD";const g={buttonId:t.BTN_RELOAD_ID,label:{id:n.EnumFontLabels.RELOAD,args:[]},appearance:a.EnumAppearance.ENABLED_SECONDARY};t.createReloadButtonData=function(){return i.cloneJSON(g)},t.BTN_OPEN_WEIGHING_ID="BTN_OPEN_WEIGHING";const O={buttonId:t.BTN_OPEN_WEIGHING_ID,label:{id:n.EnumFontLabels.WEIGHING,args:[]},appearance:a.EnumAppearance.ENABLED_SECONDARY};t.createOpenWeighingButtonData=function(){return i.cloneJSON(O)},t.BTN_OK_ID="BTN_OK"
;const M={buttonId:t.BTN_OK_ID,label:{id:n.EnumFontLabels.OK,args:[]},appearance:a.EnumAppearance.ENABLED_SECONDARY};t.createOKButtonData=function(){return i.cloneJSON(M)}},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(4),n=s(5);!function(e){e.EVENT_RESTART="restart"}(t.EnumTaskManagementEvent||(t.EnumTaskManagementEvent={}));class i extends a.CubisRestResponse{constructor(e){super(e)}getErrorList(){return JSON.parse(this.rawReturns.errorList)}}t.TaskValCreaUpdResponse=i;t.TaskProxy=class extends a.BaseProxy{constructor(){super(...arguments),this.restEndpoint="task/management"}getTaskTemplate(){let e,t;return this.body.method=n.RestMethodsTASK_MANAGEMENT.getTaskTemplate,this.body.params={taskTemplate:{}},e=new a.CubisRestResponse(this.syncRequest()),t=JSON.parse(e.rawReturns.taskTemplate)}readTask(e,t=!0){let s,i;if(this.body.method=n.RestMethodsTASK_MANAGEMENT.readTask,this.body.params={document:{},dbId:e,updateOptions:t},
!(s=new a.CubisRestResponse(this.syncRequest())).isSuccess())throw new Error("Error reading task with id '"+e+"'");return i=JSON.parse(s.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=n.RestMethodsTASK_MANAGEMENT.createTask,this.body.params={task:JSON.stringify(e),errorList:[]},new i(this.syncRequest())}updateTask(e){return this.body.method=n.RestMethodsTASK_MANAGEMENT.updateTask,this.body.params={task:JSON.stringify(e),errorList:[]},new i(this.syncRequest())}validateTask(e){return this.body.method=n.RestMethodsTASK_MANAGEMENT.validate,this.body.params={task:JSON.stringify(e),errorList:[]},new i(this.syncRequest())}saveWorkstate(e,t){let s;if(this.body.method=n.RestMethodsTASK_MANAGEMENT.saveWorkstate,this.body.params={id:t,workstate:e},
!(s=new a.CubisRestResponse(this.syncRequest())).isSuccess())throw new Error("Error saving workstate with id '"+t+"'");return s}deleteWorkstate(e){let t;if(this.body.method=n.RestMethodsTASK_MANAGEMENT.deleteWorkstate,this.body.params={id:e},!(t=new a.CubisRestResponse(this.syncRequest())).isSuccess())throw new Error("Error deleting workstate with id '"+e+"'");return t}getWorkstate(e){let t,s;if(this.body.method=n.RestMethodsTASK_MANAGEMENT.getWorkstate,this.body.params={id:e,workstate:{}},!(t=new a.CubisRestResponse(this.syncRequest())).isSuccess())throw new Error("Error reading task with id '"+e+"'");return s=JSON.parse(t.rawReturns.workstate).workstate}getTaskNamesByOrderNumber(e){let t;if(this.body.method=n.RestMethodsTASK_MANAGEMENT.getTaskNamesByOrderNumber,this.body.params={orderNumber:e,taskNames:[]},(t=new a.CubisRestResponse(this.syncRequest())).isSuccess())return JSON.parse(t.rawReturns.taskNames);throw new Error("Error getting used taskNames for '"+e+"'")}setTaskEvent(e,t){
let s;console.log(`TaskManagementProxy: send event: '${t}'`),this.body.method=n.RestMethodsTASK_MANAGEMENT.setTaskEvent,this.body.params={taskId:e,event:t};try{return(s=new a.CubisRestResponse(this.syncRequest())).isSuccess()}catch(e){return console.log("Something went wrong when calling sendTaskEvent"),console.log(e),!1}}}},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(36),n=s(15);var i=s(15);t.bignumber=i.bignumber,t.abs=i.abs;const r=s(13);function o(e){let t=void 0;return r.unitsMap.hasOwnProperty(e)&&(t=r.unitsMap[e].conversionDecimalPlacesShift),void 0===t&&(t=1),t}var E;t.calcInterval=function(e,t,s){return n.bignumber(s).times(a.SartoMath.decPowers(o(e))).times(a.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"}(E=t.EnumUnitStrings||(t.EnumUnitStrings={}));const _={[E.none]:"none",[E.o]:"o",[E.µg]:"µg",[E.mg]:"mg",[E.g]:"g",[E.kg]:"kg",[E.t]:"t",[E.mct]:"mct",[E.ct]:"ct",[E.kct]:"kct",[E.K]:"K",[E.lb]:"lb",[E.oz]:"oz",[E.lb_oz]:"lb_oz",[E.ozt]:"ozt",[E.dwt]:"dwt",[E.GN]:"GN",[E.per_lb]:"per_lb",[E.tlh]:"tlh",[E.tls]:"tls",[E.tlt]:"tlt",[E.tlc]:"tlc",[E.mom]:"mom",[E.tol]:"tol",[E.bat]:"bat",[E.MS]:"MS",[E.N]:"N",[E.war]:"war",[E.pcs]:"pcs",[E.per]:"per",[E.mm]:"mm",[E.cm]:"cm",[E.m]:"m",[E.km]:"km",[E.g_ml]:"g_ml",[E.Mcls_ml]:"Mcls_ml",[E.µg_ml]:"µg_ml",
[E.µg_l]:"µg_l",[E.mg_ml]:"mg_ml",[E.mg_l]:"mg_l",[E.mmol_ml]:"mmol_ml",[E.g_cm3]:"g_cm3",[E.cm3]:"cm3",[E.cm2]:"cm2",[E.m2]:"m2",[E.g_cm2]:"g_cm2",[E.g_m2]:"g_m2",[E.g_m]:"g_m",[E.µl]:"µl",[E.ml]:"ml",[E.cl]:"cl",[E.l]:"l",[E.mmol]:"mmol",[E.C]:"C",[E.F]:"F",[E.sec]:"sec",[E.min]:"min",[E.h]:"h",[E.am]:"am",[E.pm]:"pm",[E.V]:"V",[E.mA]:"mA",[E.hPa]:"hPa",[E.kPa]:"kPa",[E.g_mol]:"g_mol",[E.kg_m3]:"kg_m3",[E.mmHg]:"mmHg",[E.invalid]:"invalid",[E.rpm]:"rpm"};t.unitStringToLong=function(e){const t=Array.isArray(e)?e[0]:e;if(0===t.length)return E.none;for(const[e,s]of Object.entries(_))if(s===t)return e;return E.invalid},t.convertWgtUnit=function(e,t,s){return r.convertValueToTargetUnit(e,t,s)},t.convertWgtUnitBigNumber=function(e,t,s){return r.convertValueToTargetUnitBigNumber(e,t,s)},t.convertTempUnit=function(e,t,s){const a=[r.EnumUnit.GRAD_CELSIUS,r.EnumUnit.GRAD_FAHRENHEIT,E.C,E.F];return a.includes(t)&&a.includes(s)?r.convertValueToTargetUnit(e,t,s):e},
t.convertPressureUnit=function(e,t,s){const a=[r.EnumUnit.HECTOPASCAL,r.EnumUnit.KILOPASCAL,E.hPa,E.kPa];return a.includes(t)&&a.includes(s)?r.convertValueToTargetUnit(e,t,s):e},t.UnitEnum_Api2Lib=function(e){let t=E;for(let s in t)if(t[s].toString()===e.toString())return s;return null},t.UnitEnum_Lib2Api=function(e){return r.getUnitEnum(e)}},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(2);t.AbstractQAppAspect=class{configure(e){this.cfg=Object.assign(void 0!==this.cfg?this.cfg:{},e)}getConfig(){return a.cloneJSON(this.cfg)}}},function(e,t,s){"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,s){return t.TASK_DYNAMIC_ID_LID_X_PARAM_ID_PREFIX+s+e.toFixed(0)},t.createSIDParamId=function(e,s){return t.TASK_DYNAMIC_ID_SID_X_PARAM_ID_PREFIX+s+e.toFixed(0)}},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(0),n=s(6);t.AbstractOverlay=class extends n.AbstractScreen{show(){this.publishContent("",'{ "appearance":"'+a.EnumAppearance.ENABLED+'" }'),this.events$.next({type:n.ScreenEventType.SHOW_OVERLAY,id:this.getId()})}hide(){this.publishContent("",'{ "appearance":"'+a.EnumAppearance.HIDDEN+'" }'),this.events$.next({type:n.ScreenEventType.HIDE_OVERLAY,id:this.getId()})}}},function(e,t){e.exports=require("child_process")},function(e,t){e.exports=require("http")},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(15);class n{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 a.bignumber(e).times(n.decPowers(t)).toNumber()}static countDecimals(e){return a.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=n},function(e,t){
e.exports=require("path")},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(0),n=s(6),i=s(9),r=s(1);t.CANCEL_BUTTON_ID="BTN_CANCEL";class o{constructor(e){this.paramDetailsOverlayObject={appearance:a.EnumAppearance.HIDDEN,title:{id:"",args:[]},params:[]},this.events$=new i.Subject,this.mqttHandler=e}setAppearance(e){this.paramDetailsOverlayObject.appearance!==e&&(e!==a.EnumAppearance.HIDDEN&&e!==a.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!==a.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!==a.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===a.EnumAppearance.ENABLED&&(this.setAppearance(a.EnumAppearance.HIDDEN),this.events$.next({type:n.ScreenEventType.HIDE_OVERLAY,id:this.getId()}))}show(){this.paramDetailsOverlayObject.appearance===a.EnumAppearance.HIDDEN&&(this.setAppearance(a.EnumAppearance.ENABLED),this.events$.next({
type:n.ScreenEventType.SHOW_OVERLAY,id:this.getId()}))}}t.ParamDetailsOverlay=o,t.default=o},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(3),n=s(17),i=s(25),r=s(2);t.checkGeneralParamRules=function(e){let t=void 0;if(a.isTypeOfIQuantityParameter(e)){let s=n.QuantityParameter.getValue(e);if(Number.isNaN(s)){if(!0!==e.info.isNoValueAllowed){let s=r.cloneJSON(i.ParamUpdateUserActionSimpleAccept);void 0!==e.info.noValueErrorMsg?"string"==typeof e.info.noValueErrorMsg?s.textList=[{id:e.info.noValueErrorMsg,args:[]}]:s.textList=[e.info.noValueErrorMsg]:s.textList=[{id:"_QAPP_LIB_MSG_BOX_ERROR_CFG_QUANT_PARAM_EMPTY_NOT_ALLOWED",args:[]}],t={updatedParameter:e,message:s}}}else try{if(s<parseFloat(e.info.minimum.value)){let s=r.cloneJSON(i.ParamUpdateUserActionSimpleAccept);s.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:s}
}else if(s>parseFloat(e.info.maximum.value)){let s=r.cloneJSON(i.ParamUpdateUserActionSimpleAccept);s.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:s}}}catch(e){}}else if(a.isTypeOfIStringParameter(e)){let s=e.value.string;try{if(void 0===s){if(0!==e.info.minimum.length&&!0!==e.info.isNoValueAllowed){let s=r.cloneJSON(i.ParamUpdateUserActionSimpleAccept);void 0!==e.info.noValueErrorMsg?"string"==typeof e.info.noValueErrorMsg?s.textList=[{id:e.info.noValueErrorMsg,args:[]}]:s.textList=[e.info.noValueErrorMsg]:s.textList=[{id:"_QAPP_LIB_MSG_BOX_ERROR_CFG_STRING_PARAM_MANDATORY",args:[]}],t={updatedParameter:e,message:s}}}else if(s.length<e.info.minimum.length)if(0===s.length){if(console.log("StringParam: empty"),!0!==e.info.isNoValueAllowed){let s=r.cloneJSON(i.ParamUpdateUserActionSimpleAccept);void 0!==e.info.noValueErrorMsg?"string"==typeof e.info.noValueErrorMsg?s.textList=[{
id:e.info.noValueErrorMsg,args:[]}]:s.textList=[e.info.noValueErrorMsg]:s.textList=[{id:"_QAPP_LIB_MSG_BOX_ERROR_CFG_STRING_PARAM_MANDATORY",args:[]}],t={updatedParameter:e,message:s}}}else{console.log("StringParam: min exceed");let s=r.cloneJSON(i.ParamUpdateUserActionSimpleAccept);s.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:s}}else if(s.length>e.info.maximum.length)if(console.log("StringParam: max exceed"),!0===e.info.maximum.autoCut)console.log("StringParam: autocut"),e.value.string=s.substr(0,e.info.maximum.length);else{let s=r.cloneJSON(i.ParamUpdateUserActionSimpleAccept);s.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:s}}}catch(e){}}else if(a.isTypeOfIPasswordParameter(e)){let s=e.value.string;try{if(void 0===s){
if(0!==e.info.minimum.length&&!0!==e.info.isNoValueAllowed){let s=r.cloneJSON(i.ParamUpdateUserActionSimpleAccept);void 0!==e.info.noValueErrorMsg?"string"==typeof e.info.noValueErrorMsg?s.textList=[{id:e.info.noValueErrorMsg,args:[]}]:s.textList=[e.info.noValueErrorMsg]:s.textList=[{id:"_QAPP_LIB_MSG_BOX_ERROR_CFG_STRING_PARAM_MANDATORY",args:[]}],t={updatedParameter:e,message:s}}}else if(s.length<e.info.minimum.length)if(0===s.length){if(console.log("PasswordParam: empty"),!0!==e.info.isNoValueAllowed){let s=r.cloneJSON(i.ParamUpdateUserActionSimpleAccept);void 0!==e.info.noValueErrorMsg?"string"==typeof e.info.noValueErrorMsg?s.textList=[{id:e.info.noValueErrorMsg,args:[]}]:s.textList=[e.info.noValueErrorMsg]:s.textList=[{id:"_QAPP_LIB_MSG_BOX_ERROR_CFG_STRING_PARAM_MANDATORY",args:[]}],t={updatedParameter:e,message:s}}}else{console.log("PasswordParam: min exceed");let s=r.cloneJSON(i.ParamUpdateUserActionSimpleAccept);s.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:s}}else if(s.length>e.info.maximum.length){console.log("PasswordParam: max exceed");let s=r.cloneJSON(i.ParamUpdateUserActionSimpleAccept);s.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:s}}}catch(e){}}return t}},function(e,t){e.exports=require("url")},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(14),n=s(42),i=s(4),r=s(17),o=s(27),E=s(43),_=s(21),l=s(69),A=s(5),u=s(13),c=s(50);var I,p=s(42);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.SELECTED_DOMAIN_UNDEFINED="",e.SELECTED_DOMAIN_WEIGHING="ORIGINAL",e.SELECTED_DOMAIN_APP="APPLICATION"}(I=t.ISelectedWeightDisplayValueDomains||(t.ISelectedWeightDisplayValueDomains={}));const d="WEIGHING_ERROR_UNKNOWN_UNIT_ID";t.WeighingProxy=class extends i.BaseProxy{constructor(){super(...arguments),this.restEndpoint="weighing",this.weighValueMaxDigits=7,this.registeredApplications=[],this.weighingButtonAppearances={[c.WEIGHING_BUTTON_ID.UNIT]:"undefined",[c.WEIGHING_BUTTON_ID.DO_ZERO]:"undefined",[c.WEIGHING_BUTTON_ID.DO_TARE]:"undefined",
[c.WEIGHING_BUTTON_ID.DO_TARE1]:"undefined",[c.WEIGHING_BUTTON_ID.CLR_TARE1]:"undefined",[c.WEIGHING_BUTTON_ID.SET_TARE1]:"undefined",[c.WEIGHING_BUTTON_ID.SHOW_TARE1]:"undefined",[c.WEIGHING_BUTTON_ID.HIDE_TARE1]:"undefined",[c.WEIGHING_BUTTON_ID.DISPLAY]:"undefined"},this.metrologyMaximum$=new n.ReplaySubject(1),this.metrologyMinimum$=new n.ReplaySubject(1),this.highestRangeInterval$=new n.ReplaySubject(1),this.lowestRangeInterval$=new n.ReplaySubject(1),this.highestRangePrecision$=new n.ReplaySubject(1),this.lowestRangePrecision$=new n.ReplaySubject(1),this.metrologyRanges$=new n.ReplaySubject(1),this.selectedDisplayValue$=new n.ReplaySubject(1),this.lastSelectedDisplayValueInfo={currentSelectedDomain:I.SELECTED_DOMAIN_UNDEFINED,currentSelectedId:"",lastSelectedApplicationId:""}}createWeightApplication(e,t,s,a,n=!1){if(this.registeredApplications.find(t=>t===e))return this.enableWeightApplication(e,n);{this.body.method=A.RestMethodsWEIGHING.createWeightApplication,this.body.params={
id:e,title:t,header:s,isDynamic:a};let r=new i.CubisRestResponse(this.syncRequest());if(r.isSuccess()){try{this.enableWeightApplication(e,n)}catch(e){}this.registeredApplications.push(e)}return r}}enableWeightApplication(e,t){return this.body.method=A.RestMethodsWEIGHING.enableWeightApplication,this.body.params={id:e,isEnabled:t},new i.CubisRestResponse(this.syncRequest())}enableWeightApplicationBulk(e,t){if(!t){let t=this.getSelectedDisplayValue();if(t){let s=t.lastSelectedApplicationId;if(s){let t=!1;return e.forEach(e=>{e!==s?this.enableWeightApplication(e,!1):t=!0}),void(t&&this.enableWeightApplication(s,!1))}}}e.forEach(e=>{this.enableWeightApplication(e,t)})}selectWeightApplication(e){return this.body.method=A.RestMethodsWEIGHING.selectWeightApplication,this.body.params={id:e},new i.CubisRestResponse(this.syncRequest())}destroyWeightApplication(e){this.body.method=A.RestMethodsWEIGHING.destroyWeightApplication,this.body.params={id:e}
;let t=new i.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.weighingButtonAppearances[e]===t?new i.CubisRestResponse(!0):(this.weighingButtonAppearances[e]=t,this.body.method=A.RestMethodsWEIGHING.setButton,this.body.params={name:e,appearance:t},new i.CubisRestResponse(this.syncRequest()))}triggerStableWeightBlock(){return this.body.method=A.RestMethodsWEIGHING.triggerStableWeightBlock,this.body.params={},new i.CubisRestResponse(this.syncRequest())}cancelStableWeightBlock(){return this.body.method=A.RestMethodsWEIGHING.cancelStableWeightBlock,this.body.params={},new i.CubisRestResponse(this.syncRequest())}doZero(e){return this.body.method=A.RestMethodsWEIGHING.doZero,this.body.params={behavior:e},new i.CubisRestResponse(this.syncRequest())}clearTare1(){return this.body.method=A.RestMethodsWEIGHING.clearTare1,this.body.params={},
new i.CubisRestResponse(this.syncRequest())}clearTare2(){return this.body.method=A.RestMethodsWEIGHING.clearTare2,this.body.params={},new i.CubisRestResponse(this.syncRequest())}clearTare1AndTare2(){return{clearTare1Response:this.clearTare1(),clearTare2Response:this.clearTare2()}}clearTareAll(){return this.body.method=A.RestMethodsWEIGHING.clearTareAll,this.body.params={},new i.CubisRestResponse(this.syncRequest())}doTare(e){return this.body.method=A.RestMethodsWEIGHING.doTare,this.body.params={behavior:e},new i.CubisRestResponse(this.syncRequest())}doTare1(e){return this.body.method=A.RestMethodsWEIGHING.doTare1,this.body.params={behavior:e},new i.CubisRestResponse(this.syncRequest())}doTareAuto(e){return this.body.method=A.RestMethodsWEIGHING.doTareAuto,this.body.params={behavior:e},new i.CubisRestResponse(this.syncRequest())}doZeroTareAuto(e){return this.body.method=A.RestMethodsWEIGHING.doZeroTareAuto,this.body.params={behavior:e},new i.CubisRestResponse(this.syncRequest())}
setTare1(e){return this.body.method=A.RestMethodsWEIGHING.setTare1,this.body.params={value:e},new i.CubisRestResponse(this.syncRequest())}cancelDoing(){return this.body.method=A.RestMethodsWEIGHING.cancelDoing,this.body.params={},new i.CubisRestResponse(this.syncRequest())}setTare2(e){return this.body.method=A.RestMethodsWEIGHING.setTare2,this.body.params={value:e},new i.CubisRestResponse(this.syncRequest())}setUnit(e,t=!0){this.body.method=A.RestMethodsWEIGHING.setUnit,this.body.params={unitId:e};let s=new i.CubisRestResponse(this.syncRequest());if(s.isSuccess())return!0;if(s.result===d){if(t){let t=new E.MessageHandlerHelper(new o.MessageHandlerProxy),s=new l.ProfileManagementProxy,a=_.QAppBase.clientSingleton.getWeighingProfileId();t.addMessage(E.EMsgHandlerMsgs.ERR_704_UNIT_UNAVAILABLE,[_.QAppBase.clientSingleton.getTaskName()||"",u.getUnitString(e),a?s.getWeighingProfileName(a):""],void 0,[o.createMessageHandlerButton(void 0,void 0,o.MessageHandlerCallTarget.REMOVE_MESSAGE)]),
_.QAppBase.clientSingleton.doSuspend()}return!1}return!1}getParameter(e){return this.body.method=A.RestMethodsWEIGHING.getParameter,this.body.params={rObject:{},id:e},new i.CubisRestResponse(this.syncRequest())}getParameterIds(){return this.body.method=A.RestMethodsWEIGHING.getParameterIds,this.body.params={rIds:{}},new i.CubisRestResponse(this.syncRequest())}setMinUsp(e){return this.body.method=A.RestMethodsWEIGHING.setMinUsp,this.body.params={isEnabled:!0,value:r.QuantityParameter.getValue(e),unit:e.unit},new i.CubisRestResponse(this.syncRequest())}setMinWeight(e){return this.body.method=A.RestMethodsWEIGHING.setMinWeight,this.body.params=Object.assign({},e),new i.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=a.last(e.parameters),s=a.head(e.parameters)
;if(this.metrologyRanges$.next(e),void 0!==t){let e=t.parameters.find(e=>"MAXIMUM"===a.last(e.id.split("/"))),s=t.parameters.find(e=>"INTERVAL"===a.last(e.id.split("/"))),n=t.parameters.find(e=>"PRECISION"===a.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!==s&&this.highestRangeInterval$.next({intervalUnit:s.value.unit,intervalValue:r.QuantityParameter.getValue(s),intervalDecimals:s.value.decimals}),void 0!==n&&this.highestRangePrecision$.next({precisionUnit:n.value.unit,precisionValue:r.QuantityParameter.getValue(n),precisionDecimals:n.value.decimals})}if(void 0!==s){let e=s.parameters.find(e=>"MINIMUM"===a.last(e.id.split("/"))),t=s.parameters.find(e=>"INTERVAL"===a.last(e.id.split("/"))),n=s.parameters.find(e=>"PRECISION"===a.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!==n&&this.lowestRangePrecision$.next({precisionUnit:n.value.unit,precisionValue:r.QuantityParameter.getValue(n),precisionDecimals:n.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===I.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=A.RestMethodsWEIGHING.insertWeightInvalidation,this.body.params={group:e,topic:t},new i.CubisRestResponse(this.syncRequest())}removeWeightInvalidation(e,t){return this.body.method=A.RestMethodsWEIGHING.removeWeightInvalidation,this.body.params={group:e,topic:t},new i.CubisRestResponse(this.syncRequest())}setAmbientCondition(e){return this.body.method=A.RestMethodsWEIGHING.setAmbientCondition,this.body.params={ambientConditionId:e},new i.CubisRestResponse(this.syncRequest())}}},function(e,t){
e.exports=require("rxjs")},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(27),n=s(3),i=s(67),r=s(21),o=s(68),E="_QAPP_MSG_HANDLER_",_="_TITLE",l="_REASON",A="_SOLUTION";var u;function c(e){return e+"_"+a.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"}(u=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=c,t.isMessageHandlerOkButton=function(e){return e.endsWith(a.MESSAGEHANDLER_OK_BTN_ID)};const I={ERR_702:{errorCode:702,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:a.MessageHandlerCategory.USER_CAL,
lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_EXPLICIT_DELETION,secretType:u.MANUAL},ERR_703:{errorCode:703,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.WARNING,category:a.MessageHandlerCategory.USER_CAL,lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},INFO_USERCAL_CAL_OVERALL_PASSED:{errorCode:0,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.INFORMATION,category:a.MessageHandlerCategory.USER_CAL,lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},INFO_USERCAL_ERROR_NO_INVALIDATION:{errorCode:0,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:a.MessageHandlerCategory.USER_CAL,lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},ERR_704:{errorCode:704,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:a.MessageHandlerCategory.QAPP,lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.TASKID},
ERR_710:{errorCode:710,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.WARNING,category:a.MessageHandlerCategory.QAPP,lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},INFO_STARLIMS_CAL_OVERALL_PASSED:{errorCode:0,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.INFORMATION,category:a.MessageHandlerCategory.QAPP,lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},ERR_711:{errorCode:711,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:a.MessageHandlerCategory.QAPP,lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},ERR_712:{errorCode:712,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:a.MessageHandlerCategory.QAPP,lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},ERR_713:{errorCode:713,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:a.MessageHandlerCategory.QAPP,
lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},ERR_714:{errorCode:714,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:a.MessageHandlerCategory.QAPP,lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},ERR_715:{errorCode:715,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:a.MessageHandlerCategory.QAPP,lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},ERR_716:{errorCode:716,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:a.MessageHandlerCategory.QAPP,lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},ERR_717:{errorCode:717,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:a.MessageHandlerCategory.QAPP,lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},ERR_718:{errorCode:718,
type:a.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:a.MessageHandlerCategory.QAPP,lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.MANUAL},ERR_790:{errorCode:790,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:a.MessageHandlerCategory.QAPP,lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.QAPP_DB_ERROR,buttons:[a.createMessageHandlerButton(c(790))]},ERR_791:{errorCode:791,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:a.MessageHandlerCategory.QAPP,lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.QAPP_DB_ERROR,buttons:[a.createMessageHandlerButton(c(791))]},ERR_792:{errorCode:792,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:a.MessageHandlerCategory.QAPP,lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.QAPP_DB_ERROR,buttons:[a.createMessageHandlerButton(c(792))]},ERR_793:{
errorCode:793,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:a.MessageHandlerCategory.QAPP,lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.QAPP_DB_ERROR,buttons:[a.createMessageHandlerButton(c(793))]},ERR_794:{errorCode:794,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:a.MessageHandlerCategory.QAPP,lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.QAPP_DB_ERROR,buttons:[a.createMessageHandlerButton(c(794))]},ERR_795:{errorCode:795,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:a.MessageHandlerCategory.QAPP,lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.QAPP_DB_ERROR,buttons:[a.createMessageHandlerButton(c(795))]},ERR_796:{errorCode:796,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:a.MessageHandlerCategory.QAPP,lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,
secretType:u.QAPP_DB_ERROR,buttons:[a.createMessageHandlerButton(c(796))]},ERR_797:{errorCode:797,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:a.MessageHandlerCategory.QAPP,lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.QAPP_DB_ERROR,buttons:[a.createMessageHandlerButton(c(797))]},ERR_798:{errorCode:798,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:a.MessageHandlerCategory.QAPP,lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.QAPP_RUNTIME_COMM_ERROR},ERR_799:{errorCode:799,type:a.MESSAGE_HANDLER_MESSAGE_TYPE.ERROR,category:a.MessageHandlerCategory.QAPP,lifetime:a.MESSAGE_HANDLER_LIFETIME.UNTIL_USER_ACKNOWLEDGE_WITHOUT_REBOOT_PERSISTENCE,secretType:u.QAPP_RUNTIME_EXIT_ERROR}};t.MessageHandlerHelper=class{constructor(e){this.messageHandlerProxy=e}buildSecret(e){switch(e){case u.TASKID:return r.QAppBase.clientSingleton.getTaskId();case u.QAPP:
return r.QAppBase.clientSingleton.getQAppOrderNumber();case u.QAPP_DB_ERROR:return r.QAppBase.clientSingleton.getQAppOrderNumber()+u.QAPP_DB_ERROR;case u.QAPP_RUNTIME_COMM_ERROR:return r.QAppBase.clientSingleton.getQAppOrderNumber()+u.QAPP_RUNTIME_COMM_ERROR;case u.QAPP_RUNTIME_EXIT_ERROR:return r.QAppBase.clientSingleton.getQAppOrderNumber()+u.QAPP_RUNTIME_EXIT_ERROR;case u.MANUAL:default:return}}addMessage(e,t,s,a){console.log(`messageHandlerHelper::addMessage: ${e}`);let u=n.createEmptyTextStructure(),c=n.createEmptyTextStructure(),p=n.createEmptyTextStructure(),d=0;0===I[e].errorCode?(u.id=E+e+_,c.id=E+e+l,p.id=E+e+A):d=I[e].errorCode;let T=[];for(799!==I[e].errorCode&&798!==I[e].errorCode||T.push(r.QAppBase.clientSingleton.getQAppOrderNumber()),790!==I[e].errorCode&&791!==I[e].errorCode&&792!==I[e].errorCode&&793!==I[e].errorCode&&794!==I[e].errorCode&&795!==I[e].errorCode&&796!==I[e].errorCode&&797!==I[e].errorCode||(T.push(r.QAppBase.clientSingleton.getQAppOrderNumber()),
T.push(r.QAppBase.clientSingleton.getQAppVersion())),void 0!==t&&("string"==typeof t?(T.push("Error"),T.push(t)):i.isError(t)?o.isHttpRestError(t)?(T.push(`${t.name} (HTTP(s)/${t.statusCode})`),T.push(t.message)):(T.push(t.name),T.push(t.message)):T.push(...t));T.length<4;)T.push("");c.args=T;let N=this.buildSecret(I[e].secretType);return void 0!==N&&(s=N),console.log(`messageHandlerHelper::addMessage: add msg handler msg ${d} with secret ${s}`),this.messageHandlerProxy.addMessage(d,I[e].type,I[e].category,I[e].lifetime,u,c,p,s||"",a||(I[e].buttons?I[e].buttons:void 0),I[e].showMessageInFutureSeconds?I[e].showMessageInFutureSeconds:void 0)}}},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(8),n=s(53),i=s(0),r=s(6),o=s(28),E=s(1);t.WEIGHING_SCREEN_ID="WEIGHING",t.CANCEL_BARBUTTON_ID="BTN_BAR_CANCEL";const _={buttonId:"BARBUTTON/CANCEL",label:{id:"",args:[]},appearance:i.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 n.CheckBarGraph(e),this.cancelBarButton=new a.default(this.mqttHandler,this,_)}getId(){return t.WEIGHING_SCREEN_ID}getBarButtonId(){return E.MqttTopics.HMI_WEIGHING_SCREEN_BARBUTTONS}createBarButtons(e){e.sort(this.compareButtonBarButtons);for(let t of e){let e=new a.default(this.mqttHandler,this,t);this.buttonList.push(e),e.publish()}}publishBarButtons(){let e=[];for(let t of this.buttonList)e.push(E.MqttTopics.QAPP_NAMESPACE+"/"+t.getTopic());this.mqttHandler.publish(this.getBarButtonId(),JSON.stringify(e))}setText1(e,t){let s=!1;this.text1.value!==e&&(this.text1.value=e,s=!0),t&&this.text1.wildcards.join()!==t.join()&&(this.text1.wildcards=t,s=!0),s&&this.publishText1()}compareButtonBarButtons(e,t){
return o.getButtonPriority(e.buttonId)-o.getButtonPriority(t.buttonId)}publishText1(){this.mqttHandler.publish(E.MqttTopics.HMI_WEIGHING_SCREEN_INSTRUCTION1,JSON.stringify(this.text1),{retain:!0})}publishText2(){this.mqttHandler.publish(E.MqttTopics.HMI_WEIGHING_SCREEN_INSTRUCTION2,JSON.stringify(this.text2),{retain:!0})}setText2(e,t){let s=!1;this.text2.value!==e&&(this.text2.value=e,s=!0),t&&this.text2.wildcards.join()!==t.join()&&(this.text2.wildcards=t,s=!0),s&&this.publishText2()}publishTitle(){this.title?this.mqttHandler.publish(E.MqttTopics.HMI_WEIGHING_SCREEN_TITLE,JSON.stringify(this.title),{retain:!0}):this.mqttHandler.publish(E.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(E.MqttTopics.HMI_WEIGHING_SCREEN_PARAM1_TOPIC,JSON.stringify(this.param1),{retain:!0
})}publishParam2(){this.mqttHandler.publish(E.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){e.exports=require("tslib")},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let a=s(61);t.STATE_UNINITIALIZED_INTERNAL="STATE_UNINITIALIZED_INTERNAL",t.createFsm=function(e){return new a.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,s){let a;t.some(function(t){return a=t.nextState,t.guardFn(e,s)})&&a&&this.transition(e,a)}})}},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(4),n=s(5);t.LocalizerProxy=class extends a.BaseProxy{constructor(){super(...arguments),this.restEndpoint="localizer"}getLanguage(){let e;return this.body.method=n.RestMethodsLOCALIZER.getLanguage,this.body.params={rLanguageId:""},(e=new a.CubisRestResponse(this.syncRequest())).isSuccess()?e.rawReturns.rLanguageId:""}getText(e,t=[]){let s;return this.body.method=n.RestMethodsLOCALIZER.getText,this.body.params={id:e,
rText:"",args:t},(s=new a.CubisRestResponse(this.syncRequest())).isSuccess()?s.rawReturns.rText:e}getTexts(e){let t;return this.body.method=n.RestMethodsLOCALIZER.getTexts,this.body.params={textObjects:e,rTexts:""},(t=new a.CubisRestResponse(this.syncRequest())).isSuccess()?JSON.parse(t.rawReturns.rTexts):[]}}},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.UNIT="UNIT",e.DO_ZERO="DO_ZERO",e.DO_TARE="DO_TARE",e.DO_TARE1="DO_TARE1",e.CLR_TARE1="CLR_TARE1",e.SET_TARE1="SET_TARE1",e.SHOW_TARE1="SHOW_TARE1",e.HIDE_TARE1="HIDE_TARE1",e.DISPLAY="DISPLAY"}(t.WEIGHING_BUTTON_ID||(t.WEIGHING_BUTTON_ID={})),function(e){e.AS_CONFIGURED="AS_CONFIGURED",e.WITHOUT_STABILITY="WITHOUT_STABILITY",e.AFTER_STABILITY="AFTER_STABILITY"}(t.WEIGHING_ZEROTARE_BEHAVIOR||(t.WEIGHING_ZEROTARE_BEHAVIOR={})),function(e){e.VERY_STABLE="VERY_STABLE",e.STABLE="STABLE",e.UNSTABLE="UNSTABLE",e.VERY_UNSTABLE="VERY_UNSTABLE"
}(t.WEIGHING_AMBIENT_CONDITION||(t.WEIGHING_AMBIENT_CONDITION={})),function(e){e.MANAGE_USERS="MANAGE_USERS",e.MANAGE_TASKS="MANAGE_TASKS",e.SETUP_MENU_ACCESS="SETUP_MENU_ACCESS",e.ACCESS_QAPP_CENTER="ACCESS_QAPP_CENTER",e.ACCESS_AUDIT_TRAIL="ACCESS_AUDIT_TRAIL",e.ACCESS_ALIBI="ACCESS_ALIBI",e.EXECUTE_TASKS="EXECUTE_TASKS",e.MANAGE_PROFILES="MANAGE_PROFILES",e.MANAGE_DEVICE_SETTINGS="MANAGE_DEVICE_SETTINGS",e.MANAGE_ROLES="MANAGE_ROLES",e.MANAGE_ACCESS_MANAGEMENT="MANAGE_ACCESS_MANAGEMENT",e.MANAGE_LDAP_SETTINGS="MANAGE_LDAP_SETTINGS",e.MANAGE_TIMER_CONTROLLED_ACTIONS="MANAGE_TIMER_CONTROLLED_ACTIONS",e.MANAGE_CONNECTIONS="MANAGE_CONNECTIONS",e.REDIRECT_FAILED_TRANSFERS="REDIRECT_FAILED_TRANSFERS",e.DELETE_FAILED_TRANSFERS="DELETE_FAILED_TRANSFERS",e.MAINTENANCE_FIRMWARE_UPDATE="MAINTENANCE_FIRMWARE_UPDATE",e.MAINTENANCE_MANAGE_QAPPS="MAINTENANCE_MANAGE_QAPPS",e.MAINTENANCE_BACKUP_RESTORE="MAINTENANCE_BACKUP_RESTORE",e.MAINTENANCE_EXPORT_IMPORT="MAINTENANCE_EXPORT_IMPORT",
e.MAINTENANCE_FACTORY_RESET="MAINTENANCE_FACTORY_RESET",e.UNLOCK_DEVICE="UNLOCK_DEVICE",e.REMOTE_VIEW="REMOTE_VIEW",e.REMOTE_CONTROL="REMOTE_CONTROL",e.MANAGE_JOBS="MANAGE_JOBS",e.ACCESS_CALIBRATION_REPORTS="ACCESS_CALIBRATION_REPORTS",e.ACCESS_LAST_REPORTS="ACCESS_LAST_REPORTS",e.ACCESS_MASS_STORAGES="ACCESS_MASS_STORAGES",e.REMOVE_USERCAL_INVALIDATION="REMOVE_USERCAL_INVALIDATION"}(t.ACCESS_CONTROL_USER_RIGHTS||(t.ACCESS_CONTROL_USER_RIGHTS={})),function(e){e.ADMIN_ROLE_ID="adminRoleDbId",e.SERVICE_ROLE_ID="serviceRoleDbId",e.OPERATOR_ROLE_ID="operatorRoleDbId",e.GUEST_ROLE_ID="guestRoleDbId"}(t.ACCESS_CONTROL_ROLE_DB_IDS||(t.ACCESS_CONTROL_ROLE_DB_IDS={}))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(0),n=s(32),i=s(2),r=s(19);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,s)=>!!this.task&&(t.id===e.id&&(this.task.params[s]=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((s,a)=>{if(s.id===t)return s.parameters.some((t,s)=>!(t.id!==e.id||!this.task)&&(this.task.params[a].parameters[s]=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,s=this.splitParamId(e)[0];if(this.task)return this.task.params.find(a=>a.id===s&&(t=a.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 s=0;s<this.task.params.length;s++)if(this.task.params[s].id.startsWith(n.TASK_DYNAMIC_ID_GROUPS_PREFIX)||!this.task.params[s].id.startsWith(r.DYNAMIC_PARAMID_PREQUEL)){this.task.params.splice(s,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 s=this.getGroup(t);if(s)return s.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 s=this.getGroup(t);if(s)return s.parameters.unshift(e),!0}return!1}addDynamicParameterInFrontOf(e,t){let s=this.splitParamId(e.id)[0],a=this.splitParamId(t)[0];if(s===a){let a=this.getGroup(s);if(void 0!==a){let s=a.parameters.findIndex(e=>e.id===t);if(-1!==s)return a.parameters.splice(s,0,e),!0}}return console.log("addDynamicParameterInFrontOf - groups of new and existing parameter do not match: "+s+" vs. "+a),!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===a.EnumAppearance.ENABLED||e.data.appearance===a.EnumAppearance.ENABLED_INVALID_CFG)<(t.data.appearance===a.EnumAppearance.ENABLED||t.data.appearance===a.EnumAppearance.ENABLED_INVALID_CFG))return 1;if((e.data.appearance===a.EnumAppearance.ENABLED||e.data.appearance===a.EnumAppearance.ENABLED_INVALID_CFG)>(t.data.appearance===a.EnumAppearance.ENABLED||t.data.appearance===a.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=i.cloneJSON(this.task)).params.filter(e=>e.id.startsWith(r.DYNAMIC_PARAMID_PREQUEL))).forEach(e=>{e.id.startsWith(n.TASK_DYNAMIC_ID_GROUPS_PREFIX)?e.parameters.forEach((e,t)=>{e.appearance=a.EnumAppearance.HIDDEN}):(e.parameters.forEach((e,t)=>{void 0!==e.fixed&&!0!==e.fixed||e.appearance===a.EnumAppearance.HIDDEN||(e.appearance=a.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,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(4),n=s(3),i=s(17),r=s(1),o=s(5);var E;!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!"}(E=t.AlibiEntryError||(t.AlibiEntryError={})),t.isAlibiEntryError=function(e){return e===E.wrongAlibiId||e===E.wrongTopic||e===E.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 _ extends a.CubisRestResponse{
constructor(e){super(e)}getPrintItemIdentifier(){return this.rawReturns.printItemIdentifier}}t.ReportingPrintParamResponse=_;t.ReportingProxy=class extends a.BaseProxy{constructor(){super(...arguments),this.restEndpoint="reporting",this._isPrintQueueEmpty=!0}printParameters(e,t,s,a=-1){this.body.method=o.RestMethodsREPORTING.printParameters,this.body.params={parameters:JSON.stringify(e),category:t,redactable:s,printItemIdentifier:a};let n=new _(this.syncRequest());return n.isSuccess()&&(this._isPrintQueueEmpty=!1),n}printPrintQueue(){return this.body.method=o.RestMethodsREPORTING.printPrintQueueWithElectronicSignature,this.body.params={},new a.CubisRestResponse(this.syncRequest())}printParametersDirect(e,t,s){return this.body.method=o.RestMethodsREPORTING.printParametersDirect,this.body.params={parameters:JSON.stringify(e),category:t,silent:s},new a.CubisRestResponse(this.syncRequest())}getPrintQueue(){return this.body.method=o.RestMethodsREPORTING.getPrintQueue,this.body.params={
printQueue:{}},new a.CubisRestResponse(this.syncRequest())}isPrintQueueEmpty(){let e;this.body.method=o.RestMethodsREPORTING.isPrintQueueEmpty,this.body.params={rResult:!1};try{return!!(e=new a.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 a.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 a.CubisRestResponse(this.syncRequest())}setRedactionStatus(e,t,s){return this.body.method=o.RestMethodsREPORTING.setRedactionStatus,this.body.params={printItemIdentifier:e,redacted:t,reason:s},
new a.CubisRestResponse(this.syncRequest())}getAlibiRecord(e){return this.body.method=o.RestMethodsREPORTING.getAlibiRecord,this.body.params={identifier:e,record:""},new a.CubisRestResponse(this.syncRequest())}getAlibiRecordList(e){return this.body.method=o.RestMethodsREPORTING.getAlibiRecordList,this.body.params={identifiers:e,records:[]},new a.CubisRestResponse(this.syncRequest())}getDateFromAlibi(e){let t;if(e instanceof a.CubisRestResponse){if(!e.isSuccess())return E.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:E.wrongAlibiId}t=e}return t.timestamp}getWeightFromAlibi(e,t){let s;if(e instanceof a.CubisRestResponse){if(!e.isSuccess())return E.getAlibiListFailed;s=JSON.parse(e.rawReturns.record)}else if("number"==typeof e){let t=this.getAlibiRecord(e);if(!t.isSuccess())return E.wrongAlibiId;s=JSON.parse(t.rawReturns.record)}else s=e
;return this.parseMeasureParameterFromAlibiResponse(s,t)}getWeightFromAlibiList(e,t){let s=[],n=[];if(e instanceof a.CubisRestResponse){if(!e.isSuccess())return E.getAlibiListFailed;n=JSON.parse(e.rawReturns.records)}else if(0!==(i=e).length&&"number"!=typeof i[0])n=e;else{let t=this.getAlibiRecordList(e);if(!t.isSuccess())return E.getAlibiListFailed;n=JSON.parse(t.rawReturns.records)}var i;return n.forEach(e=>{s=[...s,this.parseMeasureParameterFromAlibiResponse(e,t)]}),s}parseMeasureParameterFromAlibiResponse(e,t){let s=n.createEmptyParameterGroupOfGroups();if(null===e)return E.wrongAlibiId;{s.parameters[0].parameters=JSON.parse(e.weighingblock);let a=i.WeightBlockHelper.getMeasureParameter(s,t||r.MqttTopics.WEIGHING_VALUE_NET);return void 0===a?E.wrongTopic:a}}}},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(0),n=s(72),i=s(1),r=1;t.CheckBarGraph=class{constructor(e){this.barGraphStatusObject={appearance:a.EnumAppearance.HIDDEN,
areas:n.EnumAreaCount.FOUR_AREAS},this.barGraphValueObject={area:1,perc:0},this.mqttHandler=e}publishValue(){this.mqttHandler.publish(i.MqttTopics.HMI_CHECKBARGRAPH_VALUE,JSON.stringify(this.barGraphValueObject))}publishStatus(){this.mqttHandler.publish(i.MqttTopics.HMI_CHECKBARGRAPH_STATUS,JSON.stringify(this.barGraphStatusObject))}setAppearance(e,t=!0){this.barGraphStatusObject.appearance!==e&&(e!==a.EnumAppearance.ENABLED&&e!==a.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!==n.EnumAreaCount.FOUR_AREAS&&e!==n.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===n.EnumAreaCount.FOUR_AREAS?4:6)&&(this.barGraphValueObject=e,t&&this.publishValue())}calc4AreaPerc(e,t,s,a,n,i=!0){let r=1,o=0;return e>0&&(0<e&&e<t?(r=1,o=e/t*100):t<=e&&e<=n?(r=2,o=(e-t)/(n-t)*100):n<e&&e<=s?(r=3,o=(e-n)/(s-n)*100):s<e&&e<=a&&(r=4,o=(e-s)/(a-s)*100)),i&&this.setAreaPerc({area:r,perc:o}),{area:r,perc:o}}calc6AreaPerc(e,t,s,a,n,i,r,o=!0){let E=1,_=0;return e>0&&(0<e&&e<t?(E=1,_=e/t*100):t<=e&&e<s?(E=2,_=(e-t)/(s-t)*100):s<=e&&e<=r?(E=3,_=(e-s)/(r-s)*100):r<e&&e<=a?(E=4,_=(e-r)/(a-r)*100):a<e&&e<=n?(E=5,_=(e-a)/(n-a)*100):n<e&&e<=i&&(E=6,_=(e-n)/(i-n)*100)),this.setAreaPerc({area:E,perc:_},o),{area:E,perc:_}}}},function(e,t,s){"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){e.exports=require("https")},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(0),n=s(57),i=s(38),r=s(25),o=s(12),E=s(31),_=s(38),l=s(20),A=s(39);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 u="STATE_ASPECT_CFG_PARAM_EDIT",c="STATE_ASPECT_CFG_PARAM_EDIT_USER_ACTION",I="STATE_ASPECT_CFG_PARAM_INSPECT",p="TASK_HANDLER_NO_PARAMETERS";t.ConfigParamsAspect=class extends E.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(p)):e.addToEventQueue(new o.ImmediateEvent(u))},_onExit:function(e){},
_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,s){s.payload===u&&this.transition(e,u),s.payload===p&&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(p)):e.addToEventQueue(new o.ImmediateEvent(u))},_onExit:function(e){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,s){s.payload===u&&this.transition(e,u),s.payload===p&&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 s=e.screens[n.PARAM_LIST_SCREENID].getButton(n.FINISH_BUTTON_ID);if(void 0!==s){let n=e.aspects[t.CFG_PARAMS_ASPECT].cfg.isValidFn();s.setAppearance(n?a.EnumAppearance.ENABLED_PRIMARY:a.EnumAppearance.DISABLED)}},_onExit:function(e){},_transTo:{},_transFrom:{
STATE_ASPECT_CFG_PARAM_EDIT_ENTER:function(e,s){let i=e.screens[n.PARAM_LIST_SCREENID];i.readFromTaskhandler(e.aspects[t.CFG_PARAMS_ASPECT].cfg.taskHandler),i.setShowLastVisibleCategory(!1);let r=i.getButton(n.FINISH_BUTTON_ID);if(void 0!==r){let s=e.aspects[t.CFG_PARAMS_ASPECT].cfg.isValidFn();r.setAppearance(s?a.EnumAppearance.ENABLED_PRIMARY:a.EnumAppearance.DISABLED)}i.show()},STATE_ASPECT_CFG_PARAM_EDIT_REENTER:function(e,s){let i=e.screens[n.PARAM_LIST_SCREENID];i.readFromTaskhandler(e.aspects[t.CFG_PARAMS_ASPECT].cfg.taskHandler),i.setShowLastVisibleCategory(!0);let r=i.getButton(n.FINISH_BUTTON_ID);if(void 0!==r){let s=e.aspects[t.CFG_PARAMS_ASPECT].cfg.isValidFn();r.setAppearance(s?a.EnumAppearance.ENABLED_PRIMARY:a.EnumAppearance.DISABLED)}i.show()}},EV_HMI_BTN_CLICKED:function(e,s){s.payload.buttonId===n.FINISH_BUTTON_ID&&e.aspects[t.CFG_PARAMS_ASPECT].cfg.isValidFn()&&this.transition(e,e.aspects[t.CFG_PARAMS_ASPECT].cfg.returnState),
s.payload.buttonId===n.CANCEL_BUTTON_ID&&e.suspend()},EV_HMI_PARAM_CHANGED:function(e,s){let a=e.aspects[t.CFG_PARAMS_ASPECT].updateTaskParameterGeneric(s.payload.parameter),n=[{guardFn:function(e,t){return void 0===a},nextState:""},{guardFn:function(e,t){return void 0!==a},nextState:c}];this.myHandler(e,n,s)},EV_HMI_PARAM_DETAIL:function(e,s){e.aspects[t.CFG_PARAMS_ASPECT].inspectTaskParameter(s.payload.parameter),this.transition(e,I)}},STATE_ASPECT_CFG_PARAM_INSPECT:{_onEnter:function(e){},_onExit:function(e){},_transTo:{},_transFrom:{},EV_HMI_BTN_CLICKED:function(e,t){t.payload.buttonId===i.CANCEL_BUTTON_ID&&this.transition(e,u)}},STATE_ASPECT_CFG_PARAM_EDIT_USER_ACTION:{_onEnter:function(e){},_onExit:function(e){},_transTo:{},_transFrom:{},EV_HMI_BTN_CLICKED:function(e,s){if(s.payload.buttonId===n.CANCEL_BUTTON_ID)e.suspend();else{let a=e.aspects[t.CFG_PARAMS_ASPECT].handleParamUpdateUserActionGeneric(s);"boolean"==typeof a&&a&&this.transition(e,u)}}}},
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 n.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[n.PARAM_LIST_SCREENID]&&this.client.screens[n.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=A.checkGeneralParamRules(e)),
void 0!==t?this.isLastUserActionGenericError=!0:(this.isLastUserActionGenericError=!1,t=this.cfg.updateTaskParameterFn(e)),this.setCurrentParamUpdateUserAction(t);let s=this.client.screens[n.PARAM_LIST_SCREENID].getButton(n.FINISH_BUTTON_ID);return void 0!==s&&s.setAppearance(this.cfg.isValidFn()?a.EnumAppearance.ENABLED_PRIMARY:a.EnumAppearance.DISABLED),t}handleParamUpdateUserActionGeneric(e){console.log("ConfigParamsAspect: handleParamUpdateUserActionGeneric");let t=!1,s=this.getCurrentParamUpdateUserAction();return s?(this.isLastUserActionGenericError&&e.payload.buttonId===r.ParamUpdateUserActionSimpleAccept_OK_BUTTON_ID?(this.isLastUserActionGenericError=!1,t=!0):t=this.cfg.handleParamUpdateUserActionFn(s,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 _.default(this.client.mqttHandler);t.setTitle(e.title.id,e.title.args),t.setAppearance(a.EnumAppearance.HIDDEN);let s=[];for(const t of e.params){let e=new l.default(this.client.mqttHandler,t);e.publish(),s.push(e.getPublishedId())}t.setParams(s),t.show()}parametersEmpty(){let e=this.cfg.taskHandler.getTaskGroupsAndParameters(),t=!0;for(let s of e)for(let e of s.parameters)e.appearance!==a.EnumAppearance.HIDDEN&&(t=!1);return t}}
},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(8),n=s(0),i=s(24);t.PARAM_LIST_SCREENID="PARAMLIST";var r=s(24);t.CANCEL_BUTTON_ID=r.CANCEL_BUTTON_ID,t.FINISH_BUTTON_ID="BTN_FIN";t.ParameterListScreen=class extends i.default{constructor(e){super(e);let s={};s.label={id:i.CANCEL_BUTTON_NAME,args:[]},s.appearance=n.EnumAppearance.ENABLED_PRIMARY,s.buttonId=i.CANCEL_BUTTON_ID,this.cancelButton=new a.default(e,this,s),s.appearance=n.EnumAppearance.HIDDEN,s.label.id="_FINISH",s.buttonId=t.FINISH_BUTTON_ID,this.finishButton=new a.default(e,this,s)}getId(){return"PARAMLIST"}getButton(e){let s;return s=e===i.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,s){"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,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(64),n=s(9),i=s(65),r=s(26),o=s(22),E=s(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:E.MqttTopics.QAPP_CLEANUP,payload:"",qos:1,retain:0}},
this.listeningForUpdateEvent=!1,this.listeningForAdminEvent=!1,this.mqttUpdateEvent$=new n.Subject,this.mqttAdminEvent$=new n.Subject,this.weighingNet={str:E.MqttTopics.WEIGHING_VALUE_NET,subscribe:()=>this.subscribe(E.MqttTopics.WEIGHING_VALUE_NET),unsubscribe:()=>this.unsubscribe(E.MqttTopics.WEIGHING_VALUE_NET)},this.client=a.connect(this.mqttOptions),this.startListeningForUpdateEvent(),this.startListeningForAdminEvent(),this.listOfPublishedTopics=[],this.listOfSubscribedTopics=[]}startListeningForUpdateEvent(){this.listeningForUpdateEvent||(this.client.on("message",(e,t,s)=>{let a={topic:e,value:t,packet:s};a.topic.startsWith(E.MqttTopics.QAPP_DEBUG_TOPIC_PREAMBLE)?this.mqttUpdateEvent$.next(new o.MqttUpdateDebugEvent(a)):this.mqttUpdateEvent$.next(new o.MqttUpdateEvent(a))}),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,s,a){let n,r;"function"==typeof s?(r=s,
n=void 0):(n=s,r=a);let o={qos:i.EnumMqttQos.AtMostOnce,retain:!0,dup:!1};Object.assign(o,n),"/"!==e.substring(0,1)&&(e="~"===e.substring(0,1)?e.substr(1):`${E.MqttTopics.QAPP_NAMESPACE}/${e}`),e.startsWith(E.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,s){if("object"==typeof e)this.subscribe(e,(e,t)=>{s&&s(e,t)});else{"function"==typeof t&&(s=t,t=void 0);let a={qos:0};Object.assign(a,t),-1===this.listOfSubscribedTopics.indexOf(e)&&this.listOfSubscribedTopics.push(e),this.client.subscribe(e,a,(e,t)=>{s&&s(e,t)})}}unsubscribe(e,t){this.client.unsubscribe(e,e=>{t&&t(e)})}end(e,t){let s=!1,a=void 0;"function"==typeof e?(s=!1,a=e):"boolean"==typeof e&&(s=e,a=t),this.client.end(s,()=>{a&&a()})}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,s)=>{t(e,s)})}reconnecting(){return this.client.reconnecting}connected(){return this.client.connected}clearPublishedTopics(){this.publish(E.MqttTopics.QAPP_CLEANUP,"");for(let e of this.listOfPublishedTopics)this.publish(e,"");this.publish(E.MqttTopics.QAPP_CLEANUP,"")}unsubscribeTopics(){this.unsubscribe(this.listOfSubscribedTopics)}}},function(e,t){e.exports=require("mqtt")},function(e,t,s){"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,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(35),n=s(9),i=s(23),r=s(18),o=s(1),E="/rest/qapp/paramDetail",_="/rest/qapp/paramChanged",l="/rest/qapp/buttonClick",A="/rest/qapp/extern",u=5e3;function c(e,t,s,a,n){e.statusCode=t,void 0!==s&&(e.statusMessage=s),
console.log(`RestHandler::finalizeResponse: send ${t} (${s}) response: ${r.inspect(a)}`),void 0===a?e.end():"object"==typeof a?(e.setHeader("Content-Type","application/json"),e.end(JSON.stringify(a,n))):(e.setHeader("Content-Type","plain/text"),e.end(a))}t.RestHandler=class{constructor(e){this.buttonClickEvent$=new n.Subject,this.paramChangedEvent$=new n.Subject,this.paramDetailEvent$=new n.Subject,this.restRequestEvent$=new n.Subject,this.restController=((e,t)=>{if(e.url)if(e.url.startsWith(A)){let s=e.url.replace(A,"");console.log(`RestHandler: rx extern REST request (${e.method})for URL ${s}`),this.handleRequest(e,a=>{console.log("RestHandler: rx all data for REST request - create and enqueue event"),t.setTimeout(u);let n={subUrl:s,request:e,body:a,response:t};this.restRequestEvent$.next(new i.RestRequestEvent(n))})}else switch(console.log(`RestHandler: rx internal REST request: ${e.url}`),e.url){case l:"POST"===e.method?this.handleRequest(e,e=>{
e.buttonId&&(console.log(`RestHandler::restController received buttonID: ${e.buttonId}`),this.buttonClickEvent$.next(new i.HmiButtonClickedEvent(e)),c(t,200,"Event Accepted and Forwarded","ok"))}):c(t,405,"Method Not Allowed","failure");break;case _:"POST"===e.method?this.handleRequest(e,e=>{e&&(this.paramChangedEvent$.next(new i.HmiParamChangedEvent({parameter:e})),c(t,200,"Event Accepted and Forwarded","ok"))}):c(t,405,"Method Not Allowed","failure");break;case E:"POST"===e.method?this.handleRequest(e,e=>{e&&(this.paramDetailEvent$.next(new i.HmiParamDetailEvent({parameter:e})),c(t,200,"Event Accepted and Forwarded","ok"))}):c(t,405,"Method Not Allowed","failure");break;default:c(t,404,"Not Found","failure")}else c(t,404,"Not Found","failure")}),this.port=e||8081,this.server=a.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 s,a=[""];e.on("error",t=>{console.log("RestHandler::handleRequest: "+t),e.socket.end()}).on("data",e=>{console.log("RestHandler::handleRequest: data"),"string"!=typeof e?a.push(e.toString()):a.push(e)}).on("end",()=>{if(console.log("RestHandler::handleRequest: end"),s=a.reduce((e,t)=>e+t),"application/json"===e.headers["content-type"])try{t(JSON.parse(s))}catch(e){t(s)}else t(s)})}registerRestEndpoints(e,t){e.publish(o.MqttTopics.CUSTOMIZED_REST_HANDLER_CONFIGURATION,JSON.stringify(t))}},t.finalizeResponse=c},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(3),n=s(7),i=s(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,s,o,E,_){let l=[];return r(o)?l.push({
id:o.name+":"+o.message,args:[]}):a.isITextStructure(o)?l.push(o):l.push({id:o.error.name+":"+o.error.message,args:o.msgargs}),void 0!==E&&l.push(E),{type:e,title:s,textList:l,buttons:[{id:_||t.ERRORMSGBOX_OK_BTN_ID,label:{id:n.EnumFontLabels.OK,args:[]},appearance:i.EnumAppearance.ENABLED_SECONDARY}]}}},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HttpRestErrorName="HttpRestError";class a extends Error{constructor(e,s,n,i){super(),this.statusCode=s,this.headers=n,this.body=i,this.name=t.HttpRestErrorName,Object.setPrototypeOf(this,a.prototype),this.message=e}}t.HttpRestError=a,t.isHttpRestError=function(e){return"object"==typeof e&&e.hasOwnProperty("statusCode")&&e.hasOwnProperty("headers")&&e.hasOwnProperty("body")}},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(4),n=s(0),i=s(5),r="WEIGHING/CONFIGURATION/PROFILE/ZERO_TARE",o=r+"/TARE1",E="ON",_="PROFILE/IDENTIFICATION",l="PROFILE/IDENTIFICATION/NAME"
;t.ProfileManagementProxy=class extends a.BaseProxy{constructor(){super(...arguments),this.restEndpoint="profilemanagement"}loadProfile(e){return this.body.method=i.RestMethodsPROFILE_MANAGEMENT.loadProfile,this.body.params={rProfile:"",id:e},new a.CubisRestResponse(this.syncRequest())}isPresetTareEnabled(e){let t;if(e instanceof a.CubisRestResponse)t=JSON.parse(e.rawReturns.rProfile).params;else if("string"==typeof e){let s=this.loadProfile(e);t=JSON.parse(s.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===E;return!1}getWeighingProfileName(e){let t;if(e instanceof a.CubisRestResponse)t=JSON.parse(e.rawReturns.rProfile).params;else if("string"==typeof e){let s=this.loadProfile(e);t=JSON.parse(s.rawReturns.rProfile).params}else t=e.params;for(let e of t)if(e.id===_)for(let t of e.parameters)if(t.id===l)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===n.EnumAppearance.ENABLED&&(t=[...t,e.id])}),0===t.length?void 0:t}}}}},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(4),n=s(3),i=s(5);t.AccessControlProxy=class extends a.BaseProxy{constructor(){super(...arguments),this.restEndpoint="access"}getCurrentUser(){let e,t;return this.body.method=i.RestMethodsACCESS_MANAGEMENT.getCurrentUser,this.body.params={user:""},e=new a.CubisRestResponse(this.syncRequest()),
t=JSON.parse(e.rawReturns.user)}getCurrentUserName(e){let t,s="";return(t=void 0!==e?e:this.getCurrentUser()).params.find(e=>"USER/SETTINGS"===e.id&&e.parameters.find(e=>"USER/SETTINGS/NAME"===e.id&&(s=e.value.string,!0))),s}getCurrentUserRoles(e){let t;t=void 0!==e?e:this.getCurrentUser();let s=n.createEmptySelectionParameter();return t.params.find(e=>"USER/SETTINGS"===e.id&&e.parameters.find(e=>"USER/SETTINGS/ROLES"===e.id&&(s=e,!0))),s}checkRightsOfCurrentUser(e){let t;return this.body.method=i.RestMethodsACCESS_MANAGEMENT.checkRightsOfCurrentUser,this.body.params={permissionGranted:!1,arrayOfRightsToCheck:e},(t=new a.CubisRestResponse(this.syncRequest())).rawReturns.permissionGranted}}},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(8),n=s(0),i=s(11),r=s(6),o=s(9),E=s(1);t.MESSAGEBOX_ID="MESSAGEBOX";class _{constructor(e){this.appearance=n.EnumAppearance.HIDDEN,this.lastPublishedTabContent={appearance:n.EnumAppearance.HIDDEN,
type:i.EnumMessageboxType.INFO,title:{id:"",args:[]},text:{id:"",args:[]},textsList:[],buttons:[]},this.messageBoxObject={appearance:n.EnumAppearance.HIDDEN,type:i.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 a.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 s=this.messageBoxObject.buttons[e];if(console.log("MessageBox: buttonId "+s.effect.params.buttonId),s.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),s=JSON.stringify(this.lastPublishedTabContent);e&&(t!==s&&this.messageBoxObject.appearance===n.EnumAppearance.ENABLED||this.lastPublishedTabContent.appearance===n.EnumAppearance.ENABLED&&this.messageBoxObject.appearance===n.EnumAppearance.HIDDEN)&&(this.mqttHandler.publish(E.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===n.EnumAppearance.ENABLED&&(this.setAppearance(n.EnumAppearance.HIDDEN),this.events$.next({type:r.ScreenEventType.HIDE_MESSAGEBOX,id:this.getId()}))}show(){
this.appearance===n.EnumAppearance.HIDDEN&&(this.setAppearance(n.EnumAppearance.ENABLED),this.events$.next({type:r.ScreenEventType.SHOW_MESSAGEBOX,id:this.getId()}))}}t.MessageBox=_,t.default=_},function(e,t,s){"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,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(0),n=s(33),i=s(6),r=s(1);t.LOADING_OVERLAY_ID="LOADING_MODAL";t.LoadingOverlay=class extends n.AbstractOverlay{setText(e){this.publishContent("TEXT",JSON.stringify(e))}show(){this.publishContent("APPEARANCE",'{ "appearance":"'+a.EnumAppearance.ENABLED+'" }'),this.events$.next({type:i.ScreenEventType.SHOW_LOADINGSCREEN,id:this.getId()})}hide(){this.publishContent("TEXT",""),this.publishContent("APPEARANCE",'{ "appearance":"'+a.EnumAppearance.HIDDEN+'" }'),this.events$.next({type:i.ScreenEventType.HIDE_LOADINGSCREEN,id:this.getId()})}
getMqttTopicBase(){return"~"+r.MqttTopics.HMI_LOADING_MODAL}getId(){return t.LOADING_OVERLAY_ID}}},function(e,t,s){"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,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(4),n=s(5);t.DeviceInformationProxy=class extends a.BaseProxy{constructor(){super(...arguments),this.restEndpoint="deviceinformation"}getSerialNo(){let e;return this.body.method=n.RestMethodsDEVICE_INFORMATION.getSerialNoBalance,this.body.params={rString:""},(e=new a.CubisRestResponse(this.syncRequest())).isSuccess()?e.rawReturns.rString:""}getModelName(){let e
;return this.body.method=n.RestMethodsDEVICE_INFORMATION.getModelName,this.body.params={rString:""},(e=new a.CubisRestResponse(this.syncRequest())).isSuccess()?e.rawReturns.rString:""}}},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QAppAsyncCallTimeoutErrorName="QAppAsyncCallTimeoutError";class a extends Error{constructor(e,s,n){super(),this.originalState=e,this.metadata=s,this.name=t.QAppAsyncCallTimeoutErrorName,n&&(this.stack=n),Object.setPrototypeOf(this,a.prototype),this.message="Async call timeout."+(s?` metadata: ${s}`:"")}}t.QAppAsyncCallTimeoutError=a},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LOCKING_ASPECT="LOCKING_ASPECT"},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(8),n=s(0),i=s(11),r=s(6),o=s(9),E=s(1);t.LOCKMESSAGEBOX_ID="LOCKMESSAGEBOX";class _{constructor(e){this.appearance=n.EnumAppearance.HIDDEN,this.lastPublishedTabContent={
appearance:n.EnumAppearance.HIDDEN,type:i.EnumMessageboxType.INFO,title:{id:"",args:[]},text:{id:"",args:[]},textsList:[],buttons:[]},this.messageBoxObject={appearance:n.EnumAppearance.HIDDEN,type:i.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 a.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 s=this.messageBoxObject.buttons[e];if(console.log("LockMessageBox: buttonId "+s.effect.params.buttonId),s.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),s=JSON.stringify(this.lastPublishedTabContent);e&&(t!==s&&this.messageBoxObject.appearance===n.EnumAppearance.ENABLED||this.lastPublishedTabContent.appearance===n.EnumAppearance.ENABLED&&this.messageBoxObject.appearance===n.EnumAppearance.HIDDEN)&&(this.mqttHandler.publish(E.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===n.EnumAppearance.ENABLED&&(this.setAppearance(n.EnumAppearance.HIDDEN),this.events$.next({type:r.ScreenEventType.HIDE_LOCKMESSAGEBOX,id:this.getId()}))}show(){this.appearance===n.EnumAppearance.HIDDEN&&(this.setAppearance(n.EnumAppearance.ENABLED),this.events$.next({
type:r.ScreenEventType.SHOW_LOCKMESSAGEBOX,id:this.getId()}))}}t.LockMessageBox=_,t.default=_},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(0),n=s(33),i=s(6),r=s(1);t.LOCK_LOADING_OVERLAY_ID="LOCK_LOADING_MODAL";t.LockLoadingOverlay=class extends n.AbstractOverlay{setText(e){this.publishContent("TEXT",JSON.stringify(e))}show(){this.publishContent("APPEARANCE",'{ "appearance":"'+a.EnumAppearance.ENABLED+'" }'),this.events$.next({type:i.ScreenEventType.SHOW_LOCKLOADINGSCREEN,id:this.getId()})}hide(){this.publishContent("TEXT",""),this.publishContent("APPEARANCE",'{ "appearance":"'+a.EnumAppearance.HIDDEN+'" }'),this.events$.next({type:i.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,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTime=function(){
return Math.trunc(Date.now()/1e3)}},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(19),n=s(0),i=s(13),r=s(10);var o,E,_;t.QAPP_ID="QAPP515",t.MAXIMUM_LOT_IDS=5,t.MAXIMUM_SAMPLE_IDS=5,t.MAXIMUM_SAMPLES=1e4,t.MINIMUM_LOAD_DIGIT_SELECTION=[10,20,50,100,200,500,1e3],function(e){e.ENABLED="ENABLED",e.DISABLED="DISABLED"}(o=t.EnumBoolean||(t.EnumBoolean={})),t.EnumMapBooleanOnOff={[o.ENABLED]:"_QAPP515_PARAMVAL_ON",[o.DISABLED]:"_QAPP515_PARAMVAL_OFF"},t.EnumMapBooleanYesNo={[o.ENABLED]:"_QAPP515_PARAMVAL_YES",[o.DISABLED]:"_QAPP515_PARAMVAL_NO"},t.EnumMapBooleanRememberIDs={[o.ENABLED]:"_QAPP515_PARAMVAL_REMEMBER_ID_YES",[o.DISABLED]:"_QAPP515_PARAMVAL_REMEMBER_ID_NO"},function(e){e.ONE_AFTER_ANOTHER="ONE_AFTER_ANOTHER",e.SELECTABLE_OVERVIEW="SELECTABLE_OVERVIEW"}(E=t.EnumIdentifierInputMode||(t.EnumIdentifierInputMode={})),t.EnumMapIdentifierInputMode={[E.ONE_AFTER_ANOTHER]:"_QAPP515_PARAMVAL_INPUT_ONE_AFTER_ANOTHER",
[E.SELECTABLE_OVERVIEW]:"_QAPP515_PARAMVAL_INPUT_SELECTABLE_OVERVIEW"},function(e){e.OFF="OFF",e.ONLY_GROSS="ONLY_GROSS",e.DISPLAYED_VALUE="DISPLAYED_VALUE"}(_=t.EnumPrintZeroAllowed||(t.EnumPrintZeroAllowed={})),t.EnumMapPrintZeroAllowed={[_.OFF]:"_QAPP515_PARAMVAL_NO",[_.ONLY_GROSS]:"_QAPP515_PARAMVAL_PRINT_ZERO_GROSS",[_.DISPLAYED_VALUE]:"_QAPP515_PARAMVAL_PRINT_ZERO_DISPLAY"},t.getSelectionListIdentifierInputModes=function(){let e=[];for(let s of[E.ONE_AFTER_ANOTHER,E.SELECTABLE_OVERVIEW])e.push({id:s,text:{id:t.EnumMapIdentifierInputMode[s],args:[]},appearance:n.EnumAppearance.ENABLED});return e},t.getSelectionListSIDmanipulators=function(){let e=[];for(let t of[a.EnumIdentifierAutoManipulation.NONE,a.EnumIdentifierAutoManipulation.INCREMENT,a.EnumIdentifierAutoManipulation.DECREMENT])e.push({id:t,text:{id:a.EnumMapIdentifierAutoManipulation[t],args:[]},appearance:n.EnumAppearance.ENABLED});return e},t.getSelectionListBooleanOnOff=function(){let e=[]
;for(let s of[o.ENABLED,o.DISABLED])e.push({id:s,text:{id:t.EnumMapBooleanOnOff[s],args:[]},appearance:n.EnumAppearance.ENABLED});return e},t.getSelectionListBooleanYesNo=function(){let e=[];for(let s of[o.ENABLED,o.DISABLED])e.push({id:s,text:{id:t.EnumMapBooleanYesNo[s],args:[]},appearance:n.EnumAppearance.ENABLED});return e},t.getSelectionListBooleanRememberIDs=function(){let e=[];for(let s of[o.ENABLED,o.DISABLED])e.push({id:s,text:{id:t.EnumMapBooleanRememberIDs[s],args:[]},appearance:n.EnumAppearance.ENABLED});return e},t.getSelectionListMinimumLoadDigit=function(){let e=[];for(let s of t.MINIMUM_LOAD_DIGIT_SELECTION)e.push({id:s.toFixed(0),text:{id:i.formatQuantityParam({value:s,unit:i.EnumUnit.DIGIT,decimals:0}),args:[]},appearance:n.EnumAppearance.ENABLED});return e},t.getSelectionListPrintZeroAllowed=function(){let e=[];for(let s of[_.OFF,_.ONLY_GROSS,_.DISPLAYED_VALUE])e.push({id:s,text:{id:t.EnumMapPrintZeroAllowed[s],args:[]},appearance:n.EnumAppearance.ENABLED});return e
},t.taskConfig_GUI_paramGroupMain="main",t.taskConfig_GUI_paramGroupLIDSettings="lotid_settings",t.taskConfig_GUI_paramGroupSIDSettings="sampleid_settings",t.taskConfig_GUI_paramReferences={autoTare:a.get_taskConfig_paramGroupID(t.taskConfig_GUI_paramGroupMain)+"/"+a.DYNAMIC_PARAMID_PREQUEL+"autoTare",autoTakeover:a.get_taskConfig_paramGroupID(t.taskConfig_GUI_paramGroupMain)+"/"+a.DYNAMIC_PARAMID_PREQUEL+"autoTakeover",autoTakeoverMinload:a.get_taskConfig_paramGroupID(t.taskConfig_GUI_paramGroupMain)+"/"+a.DYNAMIC_PARAMID_PREQUEL+"autoTakeoverMinload",allowPrintZero:a.get_taskConfig_paramGroupID(t.taskConfig_GUI_paramGroupMain)+"/"+a.DYNAMIC_PARAMID_PREQUEL+"allowPrintZero",autoPrintZero:a.get_taskConfig_paramGroupID(t.taskConfig_GUI_paramGroupMain)+"/"+a.DYNAMIC_PARAMID_PREQUEL+"autoPrintZero",printBlankLines:a.get_taskConfig_paramGroupID(t.taskConfig_GUI_paramGroupMain)+"/"+a.DYNAMIC_PARAMID_PREQUEL+"printBlankLines",
printReportingHeaders:a.get_taskConfig_paramGroupID(t.taskConfig_GUI_paramGroupMain)+"/"+a.DYNAMIC_PARAMID_PREQUEL+"printReportingHeaders",useStatistics:a.get_taskConfig_paramGroupID(t.taskConfig_GUI_paramGroupMain)+"/"+a.DYNAMIC_PARAMID_PREQUEL+"useStatistics",rememberLIDs:a.get_taskConfig_paramGroupID(t.taskConfig_GUI_paramGroupLIDSettings)+"/"+a.DYNAMIC_PARAMID_PREQUEL+"rememberLIDs",printEmptyLIDs:a.get_taskConfig_paramGroupID(t.taskConfig_GUI_paramGroupLIDSettings)+"/"+a.DYNAMIC_PARAMID_PREQUEL+"printEmptyLIDs",minLengthLIDs:a.get_taskConfig_paramGroupID(t.taskConfig_GUI_paramGroupLIDSettings)+"/"+a.DYNAMIC_PARAMID_PREQUEL+"minLengthLIDs",maxLengthLIDs:a.get_taskConfig_paramGroupID(t.taskConfig_GUI_paramGroupLIDSettings)+"/"+a.DYNAMIC_PARAMID_PREQUEL+"maxLengthLIDs",rememberSIDs:a.get_taskConfig_paramGroupID(t.taskConfig_GUI_paramGroupSIDSettings)+"/"+a.DYNAMIC_PARAMID_PREQUEL+"rememberSIDs",
printEmptySIDs:a.get_taskConfig_paramGroupID(t.taskConfig_GUI_paramGroupSIDSettings)+"/"+a.DYNAMIC_PARAMID_PREQUEL+"printEmptySIDs",minLengthSIDs:a.get_taskConfig_paramGroupID(t.taskConfig_GUI_paramGroupSIDSettings)+"/"+a.DYNAMIC_PARAMID_PREQUEL+"minLengthSIDs",maxLengthSIDs:a.get_taskConfig_paramGroupID(t.taskConfig_GUI_paramGroupSIDSettings)+"/"+a.DYNAMIC_PARAMID_PREQUEL+"maxLengthSIDs"},t.createConfig=function(e){let t={autoTare:o.DISABLED,autoTakeover:o.DISABLED,autoTakeoverMinload:{value:100,unit:i.EnumUnit.DIGIT,decimals:0},allowPrintZero:_.ONLY_GROSS,autoPrintZero:o.DISABLED,useStatistics:o.DISABLED,printBlankLines:o.DISABLED,printReportingHeaders:o.ENABLED,lotIDs:[],rememberLIDs:o.ENABLED,printEmptyLIDs:o.DISABLED,minLengthLIDs:0,maxLengthLIDs:60,sampleIDs:[],rememberSIDs:o.ENABLED,printEmptySIDs:o.DISABLED,minLengthSIDs:0,maxLengthSIDs:60,alterable_for_task_execution:{autoTare:!0,autoTakeover:!0,autoTakeoverMinload:!0}};return r.isObject(e)&&r.overwriteExistingAttributes(e,t),
t},t.createProcess=function(e){let t={autoTare:o.DISABLED,autoTakeover:o.DISABLED,autoTakeoverMinload:{value:100,unit:i.EnumUnit.DIGIT,decimals:0},lotIDs:[],samples:[],currentSampleIDs:[],get nextSampleNumber(){return this.samples.length+1},set nextSampleNumber(e){},statistics:{count:0,sum:{value:0,unit:i.EnumUnit.NONE,decimals:0},mean:{value:0,unit:i.EnumUnit.NONE,decimals:0},stdDev:{value:NaN,unit:i.EnumUnit.NONE,decimals:0},varCoeff:{value:NaN,unit:i.EnumUnit.PERCENT,decimals:2},minimum:{value:NaN,unit:i.EnumUnit.NONE,decimals:0},maximum:{value:NaN,unit:i.EnumUnit.NONE,decimals:0},range:{value:0,unit:i.EnumUnit.NONE,decimals:0},diffLastTwo:{value:0,unit:i.EnumUnit.NONE,decimals:0}}};return r.isObject(e)&&r.overwriteExistingAttributes(e,t),t},t.getCustomLotIDsParameterID=function(e){r.isNumber(e)||(e=1),e=e;const t=a.get_taskConfig_paramGroupID("_RESERVED_LOT_ID_SETTINGS");return{paramGroupID:t,settingsLockedInfo:t+"/"+a.DYNAMIC_PARAMID_PREQUEL+"RESERVED_LOT_ID_settingsLocked",
mainCounter:t+"/"+a.DYNAMIC_PARAMID_PREQUEL+"RESERVED_LOT_ID_counter",header:t+"/"+a.DYNAMIC_PARAMID_PREQUEL+"RESERVED_LOT_ID_"+e.toFixed(0)+"_header",title:t+"/"+a.DYNAMIC_PARAMID_PREQUEL+"RESERVED_LOT_ID_"+e.toFixed(0)+"_title",inputMode:t+"/"+a.DYNAMIC_PARAMID_PREQUEL+"RESERVED_LOT_ID_"+e.toFixed(0)+"inputMode"}},t.getCustomSampleIDsParameterID=function(e){r.isNumber(e)||(e=1),e=e;const t=a.get_taskConfig_paramGroupID("_RESERVED_SAMPLE_ID_SETTINGS");return{paramGroupID:t,settingsLockedInfo:t+"/"+a.DYNAMIC_PARAMID_PREQUEL+"RESERVED_SAMPLE_ID_settingsLocked",mainCounter:t+"/"+a.DYNAMIC_PARAMID_PREQUEL+"RESERVED_SAMPLE_ID_counter",header:t+"/"+a.DYNAMIC_PARAMID_PREQUEL+"RESERVED_SAMPLE_ID_"+e.toFixed(0)+"_header",title:t+"/"+a.DYNAMIC_PARAMID_PREQUEL+"RESERVED_SAMPLE_ID_"+e.toFixed(0)+"_title",manipulator:t+"/"+a.DYNAMIC_PARAMID_PREQUEL+"RESERVED_SAMPLE_ID_"+e.toFixed(0)+"_manipulator",inputMode:t+"/"+a.DYNAMIC_PARAMID_PREQUEL+"RESERVED_SAMPLE_ID_"+e.toFixed(0)+"inputMode"}}
},,,,,,function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(19),n=s(89),i=s(82),r=s(54),o=s(2),E=s(0),_=s(3),l=s(10);let A;function u(e,t){return void 0!==A?A.l(e,t):e}t.l=u;class c extends n.QAppConfigBase{constructor(){super(!0),this.config=i.createConfig(),this.localizerTextBuffer={},this.lotIDsCounter={id:a.getLotIDsParameterID().mainCounter,type:E.EnumParameterTypes.PARAM_QUANTITY,appearance:E.EnumAppearance.ENABLED,directInput:!0,title:{id:u("_QAPP_LIB_PARAM_TITLE_NUMBER_LIDS"),args:[]},header:{id:u("_QAPP_LIB_PARAM_HEADER_NUMBER_LIDS"),args:[]},value:{decimals:0,preferredDecimals:0,numbers:["0"],unit:""},info:{minimum:{value:(0).toString()},maximum:{value:i.MAXIMUM_LOT_IDS.toString()}},fixed:void 0},this.sampleIDsCounter={id:i.getCustomSampleIDsParameterID().mainCounter,type:E.EnumParameterTypes.PARAM_QUANTITY,appearance:E.EnumAppearance.ENABLED,directInput:!0,title:{id:u("_QAPP_LIB_PARAM_TITLE_NUMBER_SIDS"),args:[]},header:{
id:u("_QAPP_LIB_PARAM_HEADER_NUMBER_SIDS"),args:[]},value:{decimals:0,preferredDecimals:0,numbers:["0"],unit:""},info:{minimum:{value:(0).toString()},maximum:{value:i.MAXIMUM_SAMPLE_IDS.toString()}},fixed:void 0},this.sampleIDs_header=[],this.sampleIDs_title=[],this.sampleIDs_manipulator=[],this.sampleIDs_inputMode=[],this.lotIDs_header=[],this.lotIDs_title=[],this.lotIDs_inputMode=[],this.task_autoTare={id:i.taskConfig_GUI_paramReferences.autoTare,type:E.EnumParameterTypes.PARAM_SELECTION,appearance:E.EnumAppearance.ENABLED,title:{id:u("_QAPP515_PARAM_TITLE_AUTOTARE"),args:[]},header:{id:u("_QAPP515_PARAM_HEADER_AUTOTARE"),args:[]},value:{selection:{id:""}},info:{options:[]},fixed:!1},this.task_autoTakeover={id:i.taskConfig_GUI_paramReferences.autoTakeover,type:E.EnumParameterTypes.PARAM_SELECTION,appearance:E.EnumAppearance.ENABLED,title:{id:u("_QAPP515_PARAM_TITLE_AUTOTAKEOVER"),args:[]},header:{id:u("_QAPP515_PARAM_HEADER_AUTOTAKEOVER"),args:[]},value:{selection:{id:""}},info:{
options:[]},fixed:!1},this.task_autoTakeoverMinload={id:i.taskConfig_GUI_paramReferences.autoTakeoverMinload,type:E.EnumParameterTypes.PARAM_SELECTION,appearance:E.EnumAppearance.ENABLED,title:{id:u("_QAPP515_PARAM_TITLE_AUTOTAKEOVER_MINLOAD"),args:[]},header:{id:u("_QAPP515_PARAM_HEADER_AUTOTAKEOVER_MINLOAD"),args:[]},value:{selection:{id:""}},info:{options:[]},fixed:!1},this.task_allowPrintZero={id:i.taskConfig_GUI_paramReferences.allowPrintZero,type:E.EnumParameterTypes.PARAM_SELECTION,appearance:E.EnumAppearance.ENABLED,title:{id:u("_QAPP515_PARAM_TITLE_ALLOW_PRINT_ZERO"),args:[]},header:{id:u("_QAPP515_PARAM_HEADER_ALLOW_PRINT_ZERO"),args:[]},value:{selection:{id:""}},info:{options:[]},fixed:void 0},this.task_autoPrintZero={id:i.taskConfig_GUI_paramReferences.autoPrintZero,type:E.EnumParameterTypes.PARAM_SELECTION,appearance:E.EnumAppearance.ENABLED,title:{id:u("_QAPP515_PARAM_TITLE_AUTO_PRINT_ZERO"),args:[]},header:{id:u("_QAPP515_PARAM_HEADER_AUTO_PRINT_ZERO"),args:[]},value:{
selection:{id:""}},info:{options:[]},fixed:void 0},this.task_printReportingHeaders={id:i.taskConfig_GUI_paramReferences.printReportingHeaders,type:E.EnumParameterTypes.PARAM_SELECTION,appearance:E.EnumAppearance.ENABLED,title:{id:u("_QAPP515_PARAM_TITLE_PRINT_CATEGORY_HEADERS"),args:[]},header:{id:u("_QAPP515_PARAM_HEADER_PRINT_CATEGORY_HEADERS"),args:[]},value:{selection:{id:""}},info:{options:[]},fixed:void 0},this.task_printBlanks={id:i.taskConfig_GUI_paramReferences.printBlankLines,type:E.EnumParameterTypes.PARAM_SELECTION,appearance:E.EnumAppearance.ENABLED,title:{id:u("_QAPP515_PARAM_TITLE_PRINT_BLANKS"),args:[]},header:{id:u("_QAPP515_PARAM_HEADER_PRINT_BLANKS"),args:[]},value:{selection:{id:""}},info:{options:[]},fixed:void 0},this.task_useStatistics={id:i.taskConfig_GUI_paramReferences.useStatistics,type:E.EnumParameterTypes.PARAM_SELECTION,appearance:E.EnumAppearance.ENABLED,title:{id:u("_QAPP515_PARAM_TITLE_USE_STATISTICS"),args:[]},header:{
id:u("_QAPP515_PARAM_HEADER_USE_STATISTICS"),args:[]},value:{selection:{id:""}},info:{options:[]},fixed:void 0},this.task_rememberLIDs={id:i.taskConfig_GUI_paramReferences.rememberLIDs,type:E.EnumParameterTypes.PARAM_SELECTION,appearance:E.EnumAppearance.ENABLED,title:{id:u("_QAPP515_PARAM_TITLE_REMEMBER_LIDS"),args:[]},header:{id:u("_QAPP515_PARAM_HEADER_REMEMBER_IDS"),args:[]},value:{selection:{id:""}},info:{options:[]},fixed:void 0},this.task_printEmptyLIDs={id:i.taskConfig_GUI_paramReferences.printEmptyLIDs,type:E.EnumParameterTypes.PARAM_SELECTION,appearance:E.EnumAppearance.ENABLED,title:{id:u("_QAPP515_PARAM_TITLE_PRINT_EMPTY_LIDS"),args:[]},header:{id:u("_QAPP515_PARAM_HEADER_PRINT_EMPTY_IDS"),args:[]},value:{selection:{id:""}},info:{options:[]},fixed:void 0},this.task_minLengthLIDs={id:i.taskConfig_GUI_paramReferences.minLengthLIDs,type:E.EnumParameterTypes.PARAM_QUANTITY,appearance:E.EnumAppearance.ENABLED,title:{id:u("_QAPP515_PARAM_TITLE_MIN_LENGTH_LIDS"),args:[]},header:{
id:u("_QAPP515_PARAM_HEADER_MIN_LENGTH_IDS"),args:[]},value:_.createEmptyQuantityParameterValue(),info:{minimum:{value:(0).toFixed(0)},maximum:{value:60..toFixed(0)}},directInput:!0,fixed:void 0},this.task_maxLengthLIDs={id:i.taskConfig_GUI_paramReferences.maxLengthLIDs,type:E.EnumParameterTypes.PARAM_QUANTITY,appearance:E.EnumAppearance.ENABLED,title:{id:u("_QAPP515_PARAM_TITLE_MAX_LENGTH_LIDS"),args:[]},header:{id:u("_QAPP515_PARAM_HEADER_MAX_LENGTH_IDS"),args:[]},value:_.createEmptyQuantityParameterValue(),info:{minimum:{value:(0).toFixed(0)},maximum:{value:60..toFixed(0)}},directInput:!0,fixed:void 0},this.task_rememberSIDs={id:i.taskConfig_GUI_paramReferences.rememberSIDs,type:E.EnumParameterTypes.PARAM_SELECTION,appearance:E.EnumAppearance.ENABLED,title:{id:u("_QAPP515_PARAM_TITLE_REMEMBER_SIDS"),args:[]},header:{id:u("_QAPP515_PARAM_HEADER_REMEMBER_IDS"),args:[]},value:{selection:{id:""}},info:{options:[]},fixed:void 0},this.task_printEmptySIDs={
id:i.taskConfig_GUI_paramReferences.printEmptySIDs,type:E.EnumParameterTypes.PARAM_SELECTION,appearance:E.EnumAppearance.ENABLED,title:{id:u("_QAPP515_PARAM_TITLE_PRINT_EMPTY_SIDS"),args:[]},header:{id:u("_QAPP515_PARAM_HEADER_PRINT_EMPTY_IDS"),args:[]},value:{selection:{id:""}},info:{options:[]},fixed:void 0},this.task_minLengthSIDs={id:i.taskConfig_GUI_paramReferences.minLengthSIDs,type:E.EnumParameterTypes.PARAM_QUANTITY,appearance:E.EnumAppearance.ENABLED,title:{id:u("_QAPP515_PARAM_TITLE_MIN_LENGTH_SIDS"),args:[]},header:{id:u("_QAPP515_PARAM_HEADER_MIN_LENGTH_IDS"),args:[]},value:_.createEmptyQuantityParameterValue(),info:{minimum:{value:(0).toFixed(0)},maximum:{value:60..toFixed(0)}},directInput:!0,fixed:void 0},this.task_maxLengthSIDs={id:i.taskConfig_GUI_paramReferences.maxLengthSIDs,type:E.EnumParameterTypes.PARAM_QUANTITY,appearance:E.EnumAppearance.ENABLED,title:{id:u("_QAPP515_PARAM_TITLE_MAX_LENGTH_SIDS"),args:[]},header:{id:u("_QAPP515_PARAM_HEADER_MAX_LENGTH_IDS"),
args:[]},value:_.createEmptyQuantityParameterValue(),info:{minimum:{value:(0).toFixed(0)},maximum:{value:60..toFixed(0)}},directInput:!0,fixed:void 0},A=this,this.maxConfigurableSID=0,this.maxConfigurableLID=0,this.suppressModifyWarning=!0;for(let e=0;e<i.MAXIMUM_LOT_IDS;e++){const t=(e+1).toFixed(0);this.lotIDs_header.push({id:i.getCustomLotIDsParameterID(e).header,type:E.EnumParameterTypes.PARAM_STRING,appearance:E.EnumAppearance.HIDDEN,title:{id:u("_QAPP_LIB_PARAM_TITLE_LID_HEADER"),args:[t]},header:{id:u("_QAPP_LIB_PARAM_HEADER_LID_HEADER"),args:[t]},value:{string:u("_QAPP_CFG_PARAM_DEFAULT_VALUE_HEADER_LID",[t])},info:{isNoValueAllowed:!1,minimum:{length:0},maximum:{length:r.PARAM_HEADER}},fixed:void 0}),this.lotIDs_title.push({id:i.getCustomLotIDsParameterID(e).title,type:E.EnumParameterTypes.PARAM_STRING,appearance:E.EnumAppearance.HIDDEN,title:{id:u("_QAPP_LIB_PARAM_TITLE_LID_TITLE"),args:[t]},header:{id:u("_QAPP_LIB_PARAM_HEADER_LID_TITLE"),args:[t]},value:{
string:u("_QAPP_CFG_PARAM_DEFAULT_VALUE_TITLE_LID",[t])},info:{isNoValueAllowed:!1,minimum:{length:0},maximum:{length:r.PARAM_TITLE}},fixed:void 0}),this.lotIDs_inputMode.push({id:i.getCustomLotIDsParameterID(e).inputMode,type:E.EnumParameterTypes.PARAM_MULTIPLE_SELECTION,appearance:E.EnumAppearance.HIDDEN,title:{id:"_QAPP515_PARAM_TITLE_LID_INPUT_MODE",args:[t]},header:{id:"_QAPP515_PARAM_HEADER_ID_INPUT_MODE",args:[t]},value:{selections:[{id:i.EnumIdentifierInputMode.SELECTABLE_OVERVIEW}]},info:{options:i.getSelectionListIdentifierInputModes()},fixed:void 0})}for(let e=0;e<i.MAXIMUM_SAMPLE_IDS;e++){const t=(e+1).toFixed(0);this.sampleIDs_header.push({id:i.getCustomSampleIDsParameterID(e).header,type:E.EnumParameterTypes.PARAM_STRING,appearance:E.EnumAppearance.HIDDEN,title:{id:u("_QAPP_LIB_PARAM_TITLE_SID_HEADER"),args:[t]},header:{id:u("_QAPP_LIB_PARAM_HEADER_SID_HEADER"),args:[t]},value:{string:u("_QAPP_CFG_PARAM_DEFAULT_VALUE_HEADER_SID",[t])},info:{isNoValueAllowed:!1,minimum:{
length:0},maximum:{length:r.PARAM_HEADER}},fixed:void 0}),this.sampleIDs_title.push({id:i.getCustomSampleIDsParameterID(e).title,type:E.EnumParameterTypes.PARAM_STRING,appearance:E.EnumAppearance.HIDDEN,title:{id:u("_QAPP_LIB_PARAM_TITLE_SID_TITLE"),args:[t]},header:{id:u("_QAPP_LIB_PARAM_HEADER_SID_TITLE"),args:[t]},value:{string:u("_QAPP_CFG_PARAM_DEFAULT_VALUE_TITLE_SID",[t])},info:{isNoValueAllowed:!1,minimum:{length:0},maximum:{length:r.PARAM_TITLE}},fixed:void 0}),this.sampleIDs_manipulator.push({id:i.getCustomSampleIDsParameterID(e).manipulator,type:E.EnumParameterTypes.PARAM_SELECTION,appearance:E.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_SID_MODE",args:[t]},header:{id:"_QAPP_LIB_PARAM_HEADER_SID_MODE",args:[t]},value:{selection:{id:a.EnumIdentifierAutoManipulation.NONE}},info:{options:i.getSelectionListSIDmanipulators()},fixed:void 0}),this.sampleIDs_inputMode.push({id:i.getCustomSampleIDsParameterID(e).inputMode,type:E.EnumParameterTypes.PARAM_MULTIPLE_SELECTION,
appearance:E.EnumAppearance.HIDDEN,title:{id:"_QAPP515_PARAM_TITLE_SID_INPUT_MODE",args:[t]},header:{id:"_QAPP515_PARAM_HEADER_ID_INPUT_MODE",args:[t]},value:{selections:[{id:i.EnumIdentifierInputMode.ONE_AFTER_ANOTHER}]},info:{options:i.getSelectionListIdentifierInputModes()},fixed:void 0})}this.task_autoTare.info.options=i.getSelectionListBooleanOnOff(),this.task_autoTakeover.info.options=i.getSelectionListBooleanOnOff(),this.task_autoTakeoverMinload.info.options=i.getSelectionListMinimumLoadDigit(),this.task_allowPrintZero.info.options=i.getSelectionListPrintZeroAllowed(),this.task_autoPrintZero.info.options=i.getSelectionListBooleanOnOff(),this.task_printReportingHeaders.info.options=i.getSelectionListBooleanYesNo(),this.task_printBlanks.info.options=i.getSelectionListBooleanYesNo(),this.task_useStatistics.info.options=i.getSelectionListBooleanYesNo(),this.task_rememberLIDs.info.options=i.getSelectionListBooleanRememberIDs(),
this.task_printEmptyLIDs.info.options=i.getSelectionListBooleanYesNo(),this.task_rememberSIDs.info.options=i.getSelectionListBooleanRememberIDs(),this.task_printEmptySIDs.info.options=i.getSelectionListBooleanYesNo()}l(e,t){if(null!=t&&void 0!==t){if(this.localizerTextBuffer.hasOwnProperty(e)||(this.localizerTextBuffer[e]=this.localizerProxy.getText(e)),l.isBoolean(t))return this.localizerTextBuffer[e].valueOf();if(Array.isArray(t)){let s=this.localizerTextBuffer[e].valueOf();for(let e=0;e<t.length;e++)s=s.replace("%arg"+e.toFixed(0)+"%",t[e]);return s}}return e}postInit(){super.postInit(),this.config=i.createConfig(a.loadTaskConfig_DATA_CONTAINER(this.taskHandler)),this.lotIDsCounter.value.numbers[0]=this.config.lotIDs.length.toFixed(0);for(let e=0;e<this.config.lotIDs.length;e++)if(l.isObject(this.lotIDs_header[e])&&(this.lotIDs_header[e].value.string=this.config.lotIDs[e].header),l.isObject(this.lotIDs_title[e])&&(this.lotIDs_title[e].value.string=this.config.lotIDs[e].title),
l.isObject(this.lotIDs_inputMode[e])){this.lotIDs_inputMode[e].value.selections=[];for(let t=0;t<this.config.lotIDs[e].inputModes.length;t++)this.lotIDs_inputMode[e].value.selections.push({id:this.config.lotIDs[e].inputModes[t]})}this.sampleIDsCounter.value.numbers[0]=this.config.sampleIDs.length.toFixed(0);for(let e=0;e<this.config.sampleIDs.length;e++)if(l.isObject(this.sampleIDs_header[e])&&(this.sampleIDs_header[e].value.string=this.config.sampleIDs[e].header),l.isObject(this.sampleIDs_title[e])&&(this.sampleIDs_title[e].value.string=this.config.sampleIDs[e].title),l.isObject(this.sampleIDs_manipulator[e])&&(this.sampleIDs_manipulator[e].value.selection.id=this.config.sampleIDs[e].automaticManipulation),l.isObject(this.sampleIDs_inputMode[e])){this.sampleIDs_inputMode[e].value.selections=[];for(let t=0;t<this.config.sampleIDs[e].inputModes.length;t++)this.sampleIDs_inputMode[e].value.selections.push({id:this.config.sampleIDs[e].inputModes[t]})}
this.task_autoTare.value.selection.id=this.config.autoTare,this.task_autoTakeover.value.selection.id=this.config.autoTakeover,this.task_autoTakeoverMinload.value.selection.id=i.MINIMUM_LOAD_DIGIT_SELECTION[a.determineNearestNumberInArray(this.config.autoTakeoverMinload.value,i.MINIMUM_LOAD_DIGIT_SELECTION)].toFixed(0),this.task_allowPrintZero.value.selection.id=this.config.allowPrintZero,this.task_autoPrintZero.value.selection.id=this.config.autoPrintZero,this.task_printReportingHeaders.value.selection.id=this.config.printReportingHeaders,this.task_printBlanks.value.selection.id=this.config.printBlankLines,this.task_useStatistics.value.selection.id=this.config.useStatistics,this.task_rememberLIDs.value.selection.id=this.config.rememberLIDs,this.task_printEmptyLIDs.value.selection.id=this.config.printEmptyLIDs,this.task_minLengthLIDs.value.numbers=[this.config.minLengthLIDs.toFixed(0)],this.task_maxLengthLIDs.value.numbers=[this.config.maxLengthLIDs.toFixed(0)],
this.task_rememberSIDs.value.selection.id=this.config.rememberSIDs,this.task_printEmptySIDs.value.selection.id=this.config.printEmptySIDs,this.task_minLengthSIDs.value.numbers=[this.config.minLengthSIDs.toFixed(0)],this.task_maxLengthSIDs.value.numbers=[this.config.maxLengthSIDs.toFixed(0)],this.task_autoTare.fixed=!1===this.config.alterable_for_task_execution.autoTare,this.task_autoTakeover.fixed=!1===this.config.alterable_for_task_execution.autoTakeover,this.task_autoTakeoverMinload.fixed=!1===this.config.alterable_for_task_execution.autoTakeoverMinload}updateTaskParameter(e){this.updateTaskHandlerAndPublish(e)}handleParamUpdateUserAction(e,t){return!1}isConfigValid(){const e=this.updateRelevantConfigParameters();let t=!0;const s=this.checkLotIdentifierParameters();t=t&&s;const a=this.checkSampleIdentifierParameters();return t=t&&a,
this.task_autoTakeoverMinload.appearance=this.task_autoTakeover.value.selection.id===i.EnumBoolean.ENABLED?E.EnumAppearance.ENABLED:E.EnumAppearance.HIDDEN,this.task_autoPrintZero.appearance=this.task_allowPrintZero.value.selection.id!==i.EnumPrintZeroAllowed.OFF?E.EnumAppearance.ENABLED:E.EnumAppearance.HIDDEN,this.publishConfigParameterAppearances(e),t}checkLotIdentifierParameters(){let e=!0;const t=parseInt(this.lotIDsCounter.value.numbers[0]);for(let e=0;e<this.lotIDs_title.length;e++)this.lotIDs_title[e].appearance=e<t?E.EnumAppearance.ENABLED:E.EnumAppearance.HIDDEN;for(let e=0;e<this.lotIDs_header.length;e++)this.lotIDs_header[e].appearance=e<t?E.EnumAppearance.ENABLED:E.EnumAppearance.HIDDEN;for(let s=0;s<this.lotIDs_inputMode.length;s++)s<t?this.lotIDs_inputMode[s].value.selections.length<=0?(e=!1,
this.lotIDs_inputMode[s].appearance=E.EnumAppearance.ENABLED_INVALID_CFG):this.lotIDs_inputMode[s].appearance=E.EnumAppearance.ENABLED:this.lotIDs_inputMode[s].appearance=E.EnumAppearance.HIDDEN;if(t>0){this.task_rememberLIDs.appearance=E.EnumAppearance.ENABLED,this.task_printEmptyLIDs.appearance=E.EnumAppearance.ENABLED;let t=0,s=60;try{t=parseInt(this.task_minLengthLIDs.value.numbers[0]),s=parseInt(this.task_maxLengthLIDs.value.numbers[0])}catch(e){}t<=s?(this.task_minLengthLIDs.appearance=E.EnumAppearance.ENABLED,this.task_maxLengthLIDs.appearance=E.EnumAppearance.ENABLED):(e=!1,this.task_minLengthLIDs.appearance=E.EnumAppearance.ENABLED_INVALID_CFG,this.task_maxLengthLIDs.appearance=E.EnumAppearance.ENABLED_INVALID_CFG)}else this.task_rememberLIDs.appearance=E.EnumAppearance.HIDDEN,this.task_printEmptyLIDs.appearance=E.EnumAppearance.HIDDEN,this.task_minLengthLIDs.appearance=E.EnumAppearance.HIDDEN,this.task_maxLengthLIDs.appearance=E.EnumAppearance.HIDDEN;return e}
checkSampleIdentifierParameters(){let e=!0;const t=parseInt(this.sampleIDsCounter.value.numbers[0]);for(let e=0;e<this.sampleIDs_title.length;e++)this.sampleIDs_title[e].appearance=e<t?E.EnumAppearance.ENABLED:E.EnumAppearance.HIDDEN;for(let e=0;e<this.sampleIDs_header.length;e++)this.sampleIDs_header[e].appearance=e<t?E.EnumAppearance.ENABLED:E.EnumAppearance.HIDDEN;for(let e=0;e<this.sampleIDs_manipulator.length;e++)this.sampleIDs_manipulator[e].appearance=e<t?E.EnumAppearance.ENABLED:E.EnumAppearance.HIDDEN;for(let e=0;e<this.sampleIDs_inputMode.length;e++)this.sampleIDs_inputMode[e].appearance=e<t?E.EnumAppearance.ENABLED:E.EnumAppearance.HIDDEN;if(t>0){this.task_rememberSIDs.appearance=E.EnumAppearance.ENABLED,this.task_printEmptySIDs.appearance=E.EnumAppearance.ENABLED;let t=0,s=60;try{t=parseInt(this.task_minLengthSIDs.value.numbers[0]),s=parseInt(this.task_maxLengthSIDs.value.numbers[0])}catch(e){}t<=s?(this.task_minLengthSIDs.appearance=E.EnumAppearance.ENABLED,
this.task_maxLengthSIDs.appearance=E.EnumAppearance.ENABLED):(e=!1,this.task_minLengthSIDs.appearance=E.EnumAppearance.ENABLED_INVALID_CFG,this.task_maxLengthSIDs.appearance=E.EnumAppearance.ENABLED_INVALID_CFG)}else this.task_rememberSIDs.appearance=E.EnumAppearance.HIDDEN,this.task_printEmptySIDs.appearance=E.EnumAppearance.HIDDEN,this.task_minLengthSIDs.appearance=E.EnumAppearance.HIDDEN,this.task_maxLengthSIDs.appearance=E.EnumAppearance.HIDDEN;return e}getRelevantConfigParameters(){let e=[];e.push(this.task_autoTare,this.task_autoTakeover,this.task_autoTakeoverMinload,this.task_allowPrintZero,this.task_autoPrintZero,this.task_printReportingHeaders,this.task_printBlanks,this.task_useStatistics,this.lotIDsCounter,this.task_rememberLIDs,this.task_printEmptyLIDs,this.task_minLengthLIDs,this.task_maxLengthLIDs,this.sampleIDsCounter,this.task_rememberSIDs,this.task_printEmptySIDs,this.task_minLengthSIDs,this.task_maxLengthSIDs)
;for(let t=0;t<this.lotIDs_header.length;t++)e.push(this.lotIDs_header[t]);for(let t=0;t<this.lotIDs_title.length;t++)e.push(this.lotIDs_title[t]);for(let t=0;t<this.lotIDs_inputMode.length;t++)e.push(this.lotIDs_inputMode[t]);for(let t=0;t<this.sampleIDs_header.length;t++)e.push(this.sampleIDs_header[t]);for(let t=0;t<this.sampleIDs_title.length;t++)e.push(this.sampleIDs_title[t]);for(let t=0;t<this.sampleIDs_manipulator.length;t++)e.push(this.sampleIDs_manipulator[t]);for(let t=0;t<this.sampleIDs_inputMode.length;t++)e.push(this.sampleIDs_inputMode[t]);return e}updateRelevantConfigParameters(){this.task_autoTare=this.taskHandler.getParameter(this.task_autoTare.id),this.task_autoTakeover=this.taskHandler.getParameter(this.task_autoTakeover.id),this.task_autoTakeoverMinload=this.taskHandler.getParameter(this.task_autoTakeoverMinload.id),this.task_allowPrintZero=this.taskHandler.getParameter(this.task_allowPrintZero.id),
this.task_autoPrintZero=this.taskHandler.getParameter(this.task_autoPrintZero.id),this.task_printReportingHeaders=this.taskHandler.getParameter(this.task_printReportingHeaders.id),this.task_printBlanks=this.taskHandler.getParameter(this.task_printBlanks.id),this.task_useStatistics=this.taskHandler.getParameter(this.task_useStatistics.id),this.task_rememberLIDs=this.taskHandler.getParameter(this.task_rememberLIDs.id),this.task_printEmptyLIDs=this.taskHandler.getParameter(this.task_printEmptyLIDs.id),this.task_minLengthLIDs=this.taskHandler.getParameter(this.task_minLengthLIDs.id),this.task_maxLengthLIDs=this.taskHandler.getParameter(this.task_maxLengthLIDs.id),this.task_rememberSIDs=this.taskHandler.getParameter(this.task_rememberSIDs.id),this.task_printEmptySIDs=this.taskHandler.getParameter(this.task_printEmptySIDs.id),this.task_minLengthSIDs=this.taskHandler.getParameter(this.task_minLengthSIDs.id),this.task_maxLengthSIDs=this.taskHandler.getParameter(this.task_maxLengthSIDs.id),
this.lotIDsCounter=this.taskHandler.getParameter(this.lotIDsCounter.id),this.sampleIDsCounter=this.taskHandler.getParameter(this.sampleIDsCounter.id);for(let e=0;e<this.lotIDs_header.length;e++)this.lotIDs_header[e]=this.taskHandler.getParameter(this.lotIDs_header[e].id);for(let e=0;e<this.lotIDs_title.length;e++)this.lotIDs_title[e]=this.taskHandler.getParameter(this.lotIDs_title[e].id);for(let e=0;e<this.lotIDs_inputMode.length;e++)this.lotIDs_inputMode[e]=this.taskHandler.getParameter(this.lotIDs_inputMode[e].id);for(let e=0;e<this.sampleIDs_header.length;e++)this.sampleIDs_header[e]=this.taskHandler.getParameter(this.sampleIDs_header[e].id);for(let e=0;e<this.sampleIDs_title.length;e++)this.sampleIDs_title[e]=this.taskHandler.getParameter(this.sampleIDs_title[e].id);for(let e=0;e<this.sampleIDs_manipulator.length;e++)this.sampleIDs_manipulator[e]=this.taskHandler.getParameter(this.sampleIDs_manipulator[e].id)
;for(let e=0;e<this.sampleIDs_inputMode.length;e++)this.sampleIDs_inputMode[e]=this.taskHandler.getParameter(this.sampleIDs_inputMode[e].id);let e=this.getRelevantConfigParameters(),t={};for(let s=0;s<e.length;s++)t[e[s].id]=o.cloneJSON(e[s]);return t}publishConfigParameterAppearances(e){let t=this.getRelevantConfigParameters();for(let s=0;s<t.length;s++)e[t[s].id].appearance!==t[s].appearance&&this.updateTaskHandlerAndPublish(t[s])}adaptTaskHandler(){this.taskHandler.getTask()||this.exitError(i.QAPP_ID+"::adaptTaskHandler - task undefined, unexpectedly");let e={id:a.get_taskConfig_paramGroupID(i.taskConfig_GUI_paramGroupMain),type:E.EnumParameterTypes.PARAM_GROUP,appearance:E.EnumAppearance.ENABLED,title:{id:u("_QAPP515_SCREENTITLE_CONFIG_PARAMS1"),args:[]},parameters:[this.task_autoTare,this.task_autoTakeover,this.task_autoTakeoverMinload,this.task_allowPrintZero,this.task_autoPrintZero,this.task_printReportingHeaders,this.task_printBlanks,this.task_useStatistics]},t={
id:a.getLotIDsParameterID().paramGroupID,type:E.EnumParameterTypes.PARAM_GROUP,appearance:E.EnumAppearance.ENABLED,title:{id:u("_QAPP_LIB_GROUP_TITLE_IDENTIFIER_LID"),args:[]},parameters:[this.lotIDsCounter]};for(let e=0;e<i.MAXIMUM_LOT_IDS;e++)l.isObject(this.lotIDs_header[e])&&t.parameters.push(this.lotIDs_header[e]),l.isObject(this.lotIDs_title[e])&&t.parameters.push(this.lotIDs_title[e]),l.isObject(this.lotIDs_inputMode[e])&&t.parameters.push(this.lotIDs_inputMode[e]);let s={id:a.get_taskConfig_paramGroupID(i.taskConfig_GUI_paramGroupLIDSettings),type:E.EnumParameterTypes.PARAM_GROUP,appearance:E.EnumAppearance.ENABLED,title:{id:u("_QAPP_LIB_GROUP_TITLE_IDENTIFIER_LID"),args:[]},parameters:[this.task_rememberLIDs,this.task_printEmptyLIDs,this.task_minLengthLIDs,this.task_maxLengthLIDs]},n={id:i.getCustomSampleIDsParameterID().paramGroupID,type:E.EnumParameterTypes.PARAM_GROUP,appearance:E.EnumAppearance.ENABLED,title:{id:u("_QAPP_LIB_GROUP_TITLE_IDENTIFIER_SID"),args:[]},
parameters:[this.sampleIDsCounter]};for(let e=0;e<i.MAXIMUM_SAMPLE_IDS;e++)l.isObject(this.sampleIDs_header[e])&&n.parameters.push(this.sampleIDs_header[e]),l.isObject(this.sampleIDs_title[e])&&n.parameters.push(this.sampleIDs_title[e]),l.isObject(this.sampleIDs_manipulator[e])&&n.parameters.push(this.sampleIDs_manipulator[e]),l.isObject(this.sampleIDs_inputMode[e])&&n.parameters.push(this.sampleIDs_inputMode[e]);let r={id:a.get_taskConfig_paramGroupID(i.taskConfig_GUI_paramGroupSIDSettings),type:E.EnumParameterTypes.PARAM_GROUP,appearance:E.EnumAppearance.ENABLED,title:{id:u("_QAPP_LIB_GROUP_TITLE_IDENTIFIER_SID"),args:[]},parameters:[this.task_rememberSIDs,this.task_printEmptySIDs,this.task_minLengthSIDs,this.task_maxLengthSIDs]};void 0===this.taskHandler.getGroup(a.get_taskConfig_paramGroupID(i.taskConfig_GUI_paramGroupMain))?this.taskHandler.addDynamicGroup(e):this.taskHandler.updateGroup(e),
void 0===this.taskHandler.getGroup(a.getLotIDsParameterID().paramGroupID)?this.taskHandler.addDynamicGroup(t):this.taskHandler.updateGroup(t),void 0===this.taskHandler.getGroup(a.get_taskConfig_paramGroupID(i.taskConfig_GUI_paramGroupLIDSettings))?this.taskHandler.addDynamicGroup(s):this.taskHandler.updateGroup(s),void 0===this.taskHandler.getGroup(i.getCustomSampleIDsParameterID().paramGroupID)?this.taskHandler.addDynamicGroup(n):this.taskHandler.updateGroup(n),void 0===this.taskHandler.getGroup(a.get_taskConfig_paramGroupID(i.taskConfig_GUI_paramGroupSIDSettings))?this.taskHandler.addDynamicGroup(r):this.taskHandler.updateGroup(r)}storeTask(){this.updateRelevantConfigParameters();const e=o.cloneJSON(this.config.lotIDs),t=o.cloneJSON(this.config.sampleIDs);this.config.lotIDs=[],this.config.sampleIDs=[];for(let t=0;t<parseInt(this.lotIDsCounter.value.numbers[0]);t++)if(this.config.lotIDs[t]={title:l.isObject(this.lotIDs_title[t])?this.lotIDs_title[t].value.string:"",
header:l.isObject(this.lotIDs_header[t])?this.lotIDs_header[t].value.string:"",value:l.isObject(e[t])?e[t].value:"",automaticManipulation:a.EnumIdentifierAutoManipulation.NONE,inputModes:[i.EnumIdentifierInputMode.SELECTABLE_OVERVIEW]},l.isObject(this.lotIDs_inputMode[t])){this.config.lotIDs[t].inputModes=[];for(let e=0;e<this.lotIDs_inputMode[t].value.selections.length;e++)this.config.lotIDs[t].inputModes.push(this.lotIDs_inputMode[t].value.selections[e].id)}for(let e=0;e<parseInt(this.sampleIDsCounter.value.numbers[0]);e++)if(this.config.sampleIDs[e]={title:l.isObject(this.sampleIDs_title[e])?this.sampleIDs_title[e].value.string:"",header:l.isObject(this.sampleIDs_header[e])?this.sampleIDs_header[e].value.string:"",value:l.isObject(t[e])?t[e].value:"",automaticManipulation:l.isObject(this.sampleIDs_manipulator[e])?this.sampleIDs_manipulator[e].value.selection.id:a.EnumIdentifierAutoManipulation.NONE,inputModes:[i.EnumIdentifierInputMode.ONE_AFTER_ANOTHER]},
l.isObject(this.sampleIDs_inputMode[e])){this.config.sampleIDs[e].inputModes=[];for(let t=0;t<this.sampleIDs_inputMode[e].value.selections.length;t++)this.config.sampleIDs[e].inputModes.push(this.sampleIDs_inputMode[e].value.selections[t].id)}try{this.config.autoTare=this.task_autoTare.value.selection.id,this.config.autoTakeover=this.task_autoTakeover.value.selection.id,this.config.allowPrintZero=this.task_allowPrintZero.value.selection.id,this.config.autoPrintZero=this.task_autoPrintZero.value.selection.id,this.config.printReportingHeaders=this.task_printReportingHeaders.value.selection.id,this.config.printBlankLines=this.task_printBlanks.value.selection.id,this.config.useStatistics=this.task_useStatistics.value.selection.id,this.config.rememberLIDs=this.task_rememberLIDs.value.selection.id,this.config.printEmptyLIDs=this.task_printEmptyLIDs.value.selection.id,this.config.minLengthLIDs=parseInt(this.task_minLengthLIDs.value.numbers[0]),
this.config.maxLengthLIDs=parseInt(this.task_maxLengthLIDs.value.numbers[0]),this.config.rememberSIDs=this.task_rememberSIDs.value.selection.id,this.config.printEmptySIDs=this.task_printEmptySIDs.value.selection.id,this.config.minLengthSIDs=parseInt(this.task_minLengthSIDs.value.numbers[0]),this.config.maxLengthSIDs=parseInt(this.task_maxLengthSIDs.value.numbers[0])}catch(e){}this.config.allowPrintZero===i.EnumPrintZeroAllowed.OFF&&(this.config.autoPrintZero=i.EnumBoolean.DISABLED);try{this.config.autoTakeoverMinload.value=parseInt(this.task_autoTakeoverMinload.value.selection.id)}catch(e){this.config.autoTakeoverMinload.value=100}this.config.alterable_for_task_execution.autoTare=l.isBoolean(this.task_autoTare.fixed)&&!1===this.task_autoTare.fixed,this.config.alterable_for_task_execution.autoTakeover=l.isBoolean(this.task_autoTakeover.fixed)&&!1===this.task_autoTakeover.fixed,
this.config.alterable_for_task_execution.autoTakeoverMinload=l.isBoolean(this.task_autoTakeoverMinload.fixed)&&!1===this.task_autoTakeoverMinload.fixed,a.storeTaskConfig_DATA_CONTAINER(this.taskHandler,this.config,!0);let s=this.taskHandler.getTask();return s&&(s.lastExecution=Date.now()),super.storeTask()}}if(t.QAPPCONFIG=c,__dirname.endsWith("configWorkflow")){(new c).run()}},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(56),n=s(25),i=s(7),r=s(11),o=s(90),E=s(21),_=s(32),l=s(54),A=s(17),u=s(39),c=s(2),I=s(91),p=s(92),d=s(12),T=s(0),N="STATE_OVERVIEW_RESULT",R="STATE_CHECK_DATABASE",S="STATE_DATABASE_CONN_SUCCESS",m="STATE_DATABASE_CONN_FAILED",h="STATE_DATABASE_DISCONNECT",D="STATE_DATABASE_DISC_FAILED",P="BTN_OK",g="BTN_PARAM_CHANGED_YES",O="BTN_PARAM_CHANGED_NO",M="TASK/IDENTIFICATION/NAME",L="TASK/IDENTIFICATION/DESCRIPTION";t.TASK_ERROR_STR_TASK_NAME_NOT_UNIQUE="_TASK_NAME_NOT_UNIQUE",t.TASK_ERROR_STR_TASK_NAME_EMPTY="_TASK_NAME_EMPTY"
;const C=21;let f={STATE_OVERVIEW_RESULT:{_onEnter:function(e){e.screens[o.PARAM_OVER_SCREENID].getButton(o.SAVE_BUTTON_ID).setAppearance(e.isTotalConfigValid()?T.EnumAppearance.ENABLED_PRIMARY:T.EnumAppearance.DISABLED)},_onExit:function(e){},_transTo:{},_transFrom:{STATE_ASPECT_CFG_PARAM_EDIT:b,STATE_DATABASE_DISC_FAILED:b,STATE_DISCONNECT_ASPECT_DISCONNECT:b},EV_HMI_BTN_CLICKED:function(e,t){console.log("QAppConfigBase: Button pressed: ",t.payload.buttonId),t.payload.buttonId===o.SAVE_BUTTON_ID&&e.isTotalConfigValid()?e.paramsModified()?this.transition(e,"STATE_OVERVIEW_RESULT_PARAMS_MODIFIED"):e.storeTask()?e.suspend():this.transition(e,"STATE_OVERVIEW_RESULT_USER_ACTION"):t.payload.buttonId===o.BACK_BUTTON_ID?this.transition(e,a.STATE_ASPECT_CFG_PARAM_EDIT_REENTER):t.payload.buttonId===o.CANCEL_BUTTON_ID&&e.suspend()}},STATE_OVERVIEW_RESULT_USER_ACTION:{_onEnter:function(e){},_onExit:function(e){},_transFrom:{},_transTo:{},EV_HMI_BTN_CLICKED:function(e,t){let s=[{
guardFn:function(e,t){return t.payload.buttonId===P&&(e.hideMsgBox(),e.hideLoadingScreen(),!0)},nextState:N},{guardFn:function(e,t){return t.payload.buttonId===o.CANCEL_BUTTON_ID&&(e.suspend(),!0)},nextState:""}];this.myHandler(e,s,t)}},STATE_OVERVIEW_RESULT_PARAMS_MODIFIED:{_onEnter:function(e){},_onExit:function(e){},_transFrom:{},_transTo:{},EV_HMI_BTN_CLICKED:function(e,t){t.payload.buttonId===g?(e.hideMsgBox(),e.storeTask()?e.suspend():this.transition(e,"STATE_OVERVIEW_RESULT_USER_ACTION")):t.payload.buttonId===O&&e.suspend()}},STATE_CHECK_DATABASE:{_onEnter:function(e){e.onEnter_STATE_CHECK_DATABASE()},_onExit:function(e){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,t){t.payload.from===R&&this.transition(e,t.payload.to)}},STATE_DATABASE_CONN_SUCCESS:{_onEnter:function(e){e.onEnter_STATE_DATABASE_CONN_SUCCESS()},_onExit:function(e){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,t){t.payload.from===S&&this.transition(e,t.payload.to)}},STATE_DATABASE_CONN_FAILED:{
_onEnter:function(e){e.onEnter_STATE_DATABASE_CONN_FAILED()},_onExit:function(e){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,t){t.payload.from===m&&this.transition(e,t.payload.to)}},STATE_DATABASE_DISCONNECT:{_onEnter:function(e){e.addToEventQueue(new d.ImmediateEvent({from:h,to:p.STATE_DISCONNECT_ASPECT_DISCONNECT}))},_onExit:function(e){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,t){t.payload.from===h&&this.transition(e,t.payload.to)}},STATE_DATABASE_DISC_FAILED:{_onEnter:function(e){e.onEnter_STATE_DATABASE_DISC_FAILED()},_onExit:function(e){},_transTo:{},_transFrom:{},IMMEDIATE_EVENT:function(e,t){t.payload.from===h&&this.transition(e,t.payload.to)}}};function b(e,t){let s=e.screens[o.PARAM_OVER_SCREENID];s.readFromTaskhandler(e.taskHandler),s.getButton(o.SAVE_BUTTON_ID).setAppearance(e.isTotalConfigValid()?T.EnumAppearance.ENABLED_PRIMARY:T.EnumAppearance.DISABLED),s.getButton(o.BACK_BUTTON_ID).setAppearance(T.EnumAppearance.ENABLED_SECONDARY)
;let a=e.getParamOverviewTitle1(),n=e.getParamOverviewTitle2();s.setTitle1(a.id,a.args),s.setTitle2(n.id,n.args),s.show()}t.QAppConfigBase=class extends E.QAppBase{constructor(e){super(e),this.minConfigurableLID=_.TASK_DYNAMIC_ID_LID_CNT_MIN,this.maxConfigurableLID=_.TASK_DYNAMIC_ID_LID_CNT_MAX,this.minConfigurableSID=_.TASK_DYNAMIC_ID_SID_CNT_MIN,this.maxConfigurableSID=_.TASK_DYNAMIC_ID_SID_CNT_MAX,this.hidePrintProfiles=!1,this.isTaskNameValid=!0,this.initialSettings=void 0,this.suppressModifyWarning=!1,this.dbConnectionConfig=void 0,this.cfgParamAspect=new a.ConfigParamsAspect,this.registerAspect(this.cfgParamAspect)}getSupportedDatabases(){return[]}processCLParameters(e){e.length>=4?(this.scriptPath=e[1],this.qAppOrderNumber=e[2],this.qAppVersion=e[3]):(this.qAppOrderNumber=void 0,this.qAppVersion=void 0,this.exitError("QAppConfigBase::processCLParameters - configWorkflow-Script called without QAppOrderNumber or qAppVersion parameter")),
e.length>=5?(console.log("QAppConfigBase::processCLParameters - configWorkflow-Script called with taskId parameter -> modify task"),this.taskId=e[4]):(console.log("QAppConfigBase::processCLParameters - configWorkflow-Script called without taskId parameter -> create task"),this.taskId=void 0),console.log("QAppConfigBase: got qAppOrderNumber: "+this.qAppOrderNumber+"; qAppVersion : "+this.qAppVersion+"; taskId:"+this.taskId)}init(){console.log("QAppConfigBase: init"),super.init();let e=new o.ParameterOverviewScreen(this.mqttHandler);this.registerScreen(e),console.log("QAppConfigBase: init: ...done")}postInit(){console.log("QAppConfigBase: postInit"),super.postInit(),this.cfgParamAspect.configure({isValidFn:()=>this.isTotalConfigValid(),updateTaskParameterFn:e=>this.updateTaskParameterGeneric(e),getDetailForTaskParameterFn:e=>this.getDetailForTaskParameter(e),handleParamUpdateUserActionFn:(e,t)=>this.handleParamUpdateUserActionGeneric(e,t),returnState:void 0===this.dbConnectionConfig?N:R,
taskHandler:this.taskHandler})}initTaskHandler(){if(this.isCreatePath())console.log("QAppConfigBase: load task template"),this.taskHandler.setTask(this.taskMngProxy.getTaskTemplate()),this.taskHandler.getParameter(M).info.maximum.autoCut=!0,this.taskHandler.getParameter(M).info.isNoValueAllowed=!1,this.taskHandler.getParameter(L).info.maximum.autoCut=!0,this.taskHandler.getParameter(L).info.isNoValueAllowed=!1,this.setNewTaskValues(),this.addLIDSIDParameter(),void 0!==this.dbConnectionConfig&&(this.getSupportedDatabases().length>0?this.addDatabaseConnectionParameter():this.exitError("dbConnection has been configured, but the number of supported databases is still empty (getSupportedDatabases)")),this.initialSettings=void 0;else{this.loadTask();let e=this.taskHandler.getTask();this.initialSettings=void 0!==e?c.cloneJSON(e.params):void 0}if(this.hidePrintProfiles)for(let e=1;e<=2;e++){let t=this.taskHandler.getParameter(E.TASK_PROFILE_REPORTING_ID_PREFIX+"_"+e)
;void 0!==t&&(t.appearance=T.EnumAppearance.HIDDEN,this.taskHandler.updateParameter(t))}this.updateLIDParams(),this.updateSIDParams()}setNewTaskValues(){console.log("QAppConfigBase: adapt basics of task parameter for create"),console.log("QAppConfigBase: set qAppId-Info for QApp in Taskinformation: "+this.qAppOrderNumber+"@"+this.qAppVersion);let e=this.taskHandler.getTask();e?this.qAppOrderNumber&&this.qAppVersion?(e.qappOrderNumber=this.qAppOrderNumber,e.qappVersion=this.qAppVersion):this.exitError("QAppConfigBase::setNewTaskValues - qAppOrderNumber or qAppVersion undefined in creation workflow"):this.exitError("QAppConfigBase::setNewTaskValues - task undefined, unexpectedly");let t=this.localizerProxy.getLanguage();t||(t="DEFAULT",console.log("QAppConfigBase: localizer::getLanguage() failed - fallback to "+t));let s=this.readQAppDescQTFAsJSON(t);s?(this.setDefaultTaskName(s.name),
this.setDefaultTaskDescription(s.shortDescription)):(this.setDefaultTaskName("Input a name for the task."),this.setDefaultTaskDescription("Input a short description for the task."))}setDefaultTaskName(e){console.log("QAppConfigBase::setDefaultTaskName");let t=this.taskHandler.getParameter(M),s=this.taskMngProxy.getTaskNamesByOrderNumber(this.qAppOrderNumber);e=e.slice(0,t.info.maximum.length),console.log("autocut QApp title for taskname to max "+t.info.maximum.length+" chars"),t.value.string=e,t.appearance=T.EnumAppearance.ENABLED;let a=0,n=!1;for(s=s.filter(e=>e.startsWith(t.value.string));a<C;){if(void 0===s.find(e=>e===t.value.string)){n=!0;break}if(t.value.string=`${e} (${++a})`,console.log("new task name generated: "+t.value.string),t.value.string.length>t.info.maximum.length){console.log("taskname too long while autonaming"),n=!1;break}}n?(console.log("task name finally unique"),this.isTaskNameValid=!0):(console.log("taskname finally not unique"),this.isTaskNameValid=!1,
t.value.string=e,t.appearance=T.EnumAppearance.ENABLED_INVALID_CFG),this.updateTaskHandlerAndPublish(t)}setDefaultTaskDescription(e){console.log("QAppConfigBase::setDefaultTaskDescription");let t=this.taskHandler.getParameter(L);e=e.slice(0,t.info.maximum.length),t.value.string=e.slice(0,t.info.maximum.length)}provideStartFsmState(){return a.STATE_ASPECT_CFG_PARAM_EDIT_ENTER}provideFsmStates(){return f}isCreatePath(){return!this.taskId}getParamOverviewTitle1(){return{id:this.taskHandler.getParameter(M).value.string,args:[]}}getParamOverviewTitle2(){return{id:this.taskHandler.getParameter(L).value.string,args:[]}}checkTaskNameBeforePublish(e=!1){let s=this.taskMngProxy.validateTask(this.taskHandler.getTask()).getErrorList(),a=this.taskHandler.getParameter(M);return s.some(e=>e===t.TASK_ERROR_STR_TASK_NAME_NOT_UNIQUE||e===t.TASK_ERROR_STR_TASK_NAME_EMPTY)?(e&&(a.appearance=T.EnumAppearance.ENABLED_INVALID_CFG),!1):(e&&(a.appearance=T.EnumAppearance.ENABLED),!0)}
updateTaskParameterGeneric(e){console.log("QAppConfigBase: updateTaskParameterGeneric");let s=void 0;if(e.id===M)if(this.taskHandler.updateParameter(e),console.log("call taskMng - validate"),this.checkTaskNameBeforePublish())e.appearance=T.EnumAppearance.ENABLED,this.updateTaskHandlerAndPublish(e),this.isTaskNameValid=!0,s=void 0;else{e.appearance=T.EnumAppearance.ENABLED_INVALID_CFG,this.updateTaskHandlerAndPublish(e),this.isTaskNameValid=!1;let a=c.cloneJSON(n.ParamUpdateUserActionSimpleAccept);a.textList=[{id:t.TASK_ERROR_STR_TASK_NAME_NOT_UNIQUE,args:[]}],s={updatedParameter:e,message:a}}else if(e.id===_.TASK_DYNAMIC_ID_LID_CNT_PARAM_ID){let t=this.updateTaskParameter(e);void 0===t||!1===t?(this.updateTaskHandlerAndPublish(e),this.updateLIDParams()):!0===t?this.updateLIDParams():s=t}else if(e.id===_.TASK_DYNAMIC_ID_SID_CNT_PARAM_ID){let t=this.updateTaskParameter(e);void 0===t||!1===t?(this.updateTaskHandlerAndPublish(e),this.updateSIDParams()):!0===t?this.updateSIDParams():s=t
}else if(e.id===_.TASK_DYNAMIC_ID_DB_TYPES_PARAM_ID)this.updateTaskHandlerAndPublish(e),this.updateDatabaseConfigParameters(e.value.selection.id),s=void 0;else if(e.id.startsWith(_.TASK_DYNAMIC_ID_GROUPS_PREFIX))this.updateTaskHandlerAndPublish(e),s=void 0;else{let t=this.updateTaskParameter(e);s=void 0===t||"boolean"==typeof t?void 0:t}return s}getDetailForTaskParameter(e){return{title:{id:"not implemented",args:[]},params:[]}}handleParamUpdateUserActionGeneric(e,t){console.log("QAppConfigBase: handleParamUpdateUserActionGeneric");let s=!1;return s=e.updatedParameter.id===M&&t.payload.buttonId===n.ParamUpdateUserActionSimpleAccept_OK_BUTTON_ID||this.handleParamUpdateUserAction(e,t)}isTotalConfigValid(){return this.isTaskNameValid&&this.isConfigValid()}updateTaskHandlerAndPublish(e){return console.log("QAppConfigBase: updateTaskHandlerAndPublish"),e.type===T.EnumParameterTypes.PARAM_QUANTITY&&A.QuantityParameter.roundToDecimalPlaces(e),
!!this.taskHandler.updateParameter(e)&&(this.cfgParamAspect.publishParameter(e),!0)}paramsModified(){if(this.suppressModifyWarning)return!1;if(void 0===this.initialSettings)return!1;{let e=this.taskHandler.getTask();return void 0!==e&&(!this.relevantParamsAreEqual(this.initialSettings,e.params)&&(this.showMessageBox({type:r.EnumMessageboxType.WARNING,title:{id:"_QAPP_LIB_CFG_MSG_BOX_WARNING_PARAMS_CHANGED_TITLE",args:[]},textList:[{id:"_QAPP_LIB_CFG_MSG_BOX_WARNING_PARAMS_CHANGED",args:[]},{id:"_QAPP_LIB_CFG_MSG_BOX_WARNING_PARAMS_CHANGED_II",args:[]},{id:"_QAPP_LIB_CFG_MSG_BOX_WARNING_PARAMS_CHANGED_III",args:[]}],buttons:[{id:g,label:{id:"_QAPP_LIB_MBOX_BTN_YES",args:[]},appearance:T.EnumAppearance.ENABLED_SECONDARY},{id:O,label:{id:"_QAPP_LIB_MBOX_BTN_NO",args:[]},appearance:T.EnumAppearance.ENABLED_SECONDARY}]}),!0))}}storeTask(){console.log("QAppConfigBase: storeTask (create/update)");let e=this.taskHandler.getTask(),s=void 0;if(this.isCreatePath()){if(e){
s=this.taskMngProxy.createTask(e);try{let e=JSON.parse(s.rawReturns.task);this.taskId=e._id}catch(e){this.taskId=void 0}}}else e&&(s=this.taskMngProxy.updateTask(e));if(s){if(s.isSuccess()){let e=s.getErrorList(),a=[];for(let t of e)console.log("QAppConfigBase::storeTask - found create/update error: "+t),a.push({id:t,args:[]});if(e.length>0){if(this.showMessageBox({type:r.EnumMessageboxType.ERROR,title:{id:"_QAPP_LIB_MSG_BOX_ERROR_STORE_UPDATE_TASK",args:[]},textList:a,buttons:[{id:P,label:{id:i.EnumFontLabels.OK,args:[]},appearance:T.EnumAppearance.ENABLED_SECONDARY}]}),e.some(e=>e===t.TASK_ERROR_STR_TASK_NAME_NOT_UNIQUE)){this.isTaskNameValid=!1;let e=this.taskHandler.getParameter(M);e&&(e.appearance=T.EnumAppearance.ENABLED_INVALID_CFG,this.updateTaskHandlerAndPublish(e))}else this.isTaskNameValid=!0;return!1}return!(!this.taskId||0===this.taskId.length)||(this.taskId=void 0,this.exitError("QAppConfigBase::storeTask - error creating task data (missing _id)"),!1)}
return this.exitError("QAppConfigBase::storeTask - error creating/updating task data"),!1}return this.exitError("QAppConfigBase::storeTask - no result returned for store/update task - program error"),!1}hasConfigurableLIDs(){return this.maxConfigurableLID>0}hasConfigurableSIDs(){return this.maxConfigurableSID>0}hasConfigurableIDs(){return this.hasConfigurableLIDs()&&this.hasConfigurableSIDs()}addLIDSIDParameter(){this.minConfigurableLID>this.maxConfigurableLID&&(this.minConfigurableLID=this.maxConfigurableLID),this.minConfigurableSID>this.maxConfigurableSID&&(this.minConfigurableSID=this.maxConfigurableSID);let e={id:_.TASK_DYNAMIC_ID_CNT_GROUP_ID,type:T.EnumParameterTypes.PARAM_GROUP,appearance:this.hasConfigurableIDs()?T.EnumAppearance.ENABLED:T.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_GROUP_TITLE_IDENTIFIER_CNT",args:[]},parameters:[{id:_.TASK_DYNAMIC_ID_LID_CNT_PARAM_ID,type:T.EnumParameterTypes.PARAM_SELECTION,
appearance:this.hasConfigurableLIDs()?T.EnumAppearance.ENABLED:T.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_NUMBER_LIDS",args:[]},header:{id:"_QAPP_LIB_PARAM_HEADER_NUMBER_LIDS",args:[]},value:{selection:{id:_.createIDCntOption(this.minConfigurableLID)}},info:{options:[]}},{id:_.TASK_DYNAMIC_ID_SID_CNT_PARAM_ID,type:T.EnumParameterTypes.PARAM_SELECTION,appearance:this.hasConfigurableSIDs()?T.EnumAppearance.ENABLED:T.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_NUMBER_SIDS",args:[]},header:{id:"_QAPP_LIB_PARAM_HEADER_NUMBER_SIDS",args:[]},value:{selection:{id:_.createIDCntOption(this.minConfigurableSID)}},info:{options:[]}}]};_.getConfiguredIds(e.parameters[0])>this.maxConfigurableLID&&(e.parameters[0].value.selection.id=_.createIDCntOption(this.maxConfigurableLID)),_.getConfiguredIds(e.parameters[1])>this.maxConfigurableSID&&(e.parameters[1].value.selection.id=_.createIDCntOption(this.maxConfigurableSID))
;for(let t=this.minConfigurableLID;t<=this.maxConfigurableLID;t++)e.parameters[0].info.options.push({id:_.createIDCntOption(t),appearance:T.EnumAppearance.ENABLED,text:{id:""+t.toFixed(0),args:[]}});for(let t=this.minConfigurableSID;t<=this.maxConfigurableSID;t++)e.parameters[1].info.options.push({id:_.createIDCntOption(t),appearance:T.EnumAppearance.ENABLED,text:{id:""+t.toFixed(0),args:[]}});let t={id:_.TASK_DYNAMIC_ID_LID_GROUP_ID,type:T.EnumParameterTypes.PARAM_GROUP,appearance:T.EnumAppearance.ENABLED,title:{id:"_QAPP_LIB_GROUP_TITLE_IDENTIFIER_LID",args:[]},parameters:[]},s=[];for(let e=1;e<=this.maxConfigurableLID;e++)s.push({id:"_QAPP_CFG_PARAM_DEFAULT_VALUE_HEADER_LID",args:[e.toString()]});for(let e=1;e<=this.maxConfigurableLID;e++)s.push({id:"_QAPP_CFG_PARAM_DEFAULT_VALUE_TITLE_LID",args:[e.toString()]});for(let e=1;e<=this.maxConfigurableSID;e++)s.push({id:"_QAPP_CFG_PARAM_DEFAULT_VALUE_HEADER_SID",args:[e.toString()]});for(let e=1;e<=this.maxConfigurableSID;e++)s.push({
id:"_QAPP_CFG_PARAM_DEFAULT_VALUE_TITLE_SID",args:[e.toString()]});const a=this.localizerProxy.getTexts(s);let n=a.splice(0,this.maxConfigurableLID),i=a.splice(0,this.maxConfigurableLID),r=a.splice(0,this.maxConfigurableSID),o=a.splice(0,this.maxConfigurableSID);for(let e=1;e<=this.maxConfigurableLID;e++)t.parameters.push({id:_.createLIDParamId(e,_.TASK_DYNAMIC_ID_LID_X_PARAM_ID_SUFFIX_HEADER),type:T.EnumParameterTypes.PARAM_STRING,appearance:T.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_LID_HEADER",args:[e.toFixed(0)]},header:{id:"_QAPP_LIB_PARAM_HEADER_LID_HEADER",args:[e.toFixed(0)]},value:{string:n[e-1]},info:{isNoValueAllowed:!1,minimum:{length:1},maximum:{length:l.PARAM_HEADER}}}),t.parameters.push({id:_.createLIDParamId(e,_.TASK_DYNAMIC_ID_LID_X_PARAM_ID_SUFFIX_TITLE),type:T.EnumParameterTypes.PARAM_STRING,appearance:T.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_LID_TITLE",args:[e.toFixed(0)]},header:{id:"_QAPP_LIB_PARAM_HEADER_LID_TITLE",
args:[e.toFixed(0)]},value:{string:i[e-1]},info:{isNoValueAllowed:!1,minimum:{length:1},maximum:{length:l.PARAM_TITLE}}});let E={id:_.TASK_DYNAMIC_ID_SID_GROUP_ID,type:T.EnumParameterTypes.PARAM_GROUP,appearance:T.EnumAppearance.ENABLED,title:{id:"_QAPP_LIB_GROUP_TITLE_IDENTIFIER_SID",args:[]},parameters:[]};for(let e=1;e<=this.maxConfigurableSID;e++)E.parameters.push({id:_.createSIDParamId(e,_.TASK_DYNAMIC_ID_SID_X_PARAM_ID_SUFFIX_HEADER),type:T.EnumParameterTypes.PARAM_STRING,appearance:T.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_SID_HEADER",args:[e.toFixed(0)]},header:{id:"_QAPP_LIB_PARAM_HEADER_SID_HEADER",args:[e.toFixed(0)]},value:{string:r[e-1]},info:{isNoValueAllowed:!1,minimum:{length:1},maximum:{length:l.PARAM_HEADER}}}),E.parameters.push({id:_.createSIDParamId(e,_.TASK_DYNAMIC_ID_SID_X_PARAM_ID_SUFFIX_TITLE),type:T.EnumParameterTypes.PARAM_STRING,appearance:T.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_SID_TITLE",args:[e.toFixed(0)]},header:{
id:"_QAPP_LIB_PARAM_HEADER_SID_TITLE",args:[e.toFixed(0)]},value:{string:o[e-1]},info:{isNoValueAllowed:!1,minimum:{length:1},maximum:{length:l.PARAM_TITLE}}}),E.parameters.push({id:_.createSIDParamId(e,_.TASK_DYNAMIC_ID_SID_X_PARAM_ID_SUFFIX_MODE),type:T.EnumParameterTypes.PARAM_SELECTION,appearance:T.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_SID_MODE",args:[""+e.toFixed(0)]},header:{id:"_QAPP_LIB_PARAM_HEADER_SID_MODE",args:[""+e.toFixed(0)]},value:{selection:{id:_.EnumSampleIdentifierOptions.ON}},info:{options:[{id:_.EnumSampleIdentifierOptions.ON,appearance:T.EnumAppearance.ENABLED,text:{id:"_QAPP_LIB_PARAM_SELECT_OPTION_SID_ON",args:[]}},{id:_.EnumSampleIdentifierOptions.ON_AUTO_INC,appearance:T.EnumAppearance.ENABLED,text:{id:"_QAPP_LIB_PARAM_SELECT_OPTION_SID_ON_AUTO_INC",args:[]}},{id:_.EnumSampleIdentifierOptions.ON_AUTO_DEC,appearance:T.EnumAppearance.ENABLED,text:{id:"_QAPP_LIB_PARAM_SELECT_OPTION_SID_ON_AUTO_DEC",args:[]}}]}})
;this.taskHandler.addDynamicGroup(E),this.taskHandler.addDynamicGroup(t),this.taskHandler.addDynamicGroup(e)}updateLIDSIDParamAppearance(e,t,s){void 0!==e&&(t<=s?(console.log("QAppConfigBase::updateLIDSIDParamAppearance: configured:"+e.id),void 0!==u.checkGeneralParamRules(e)?(console.log("... invalid"),e.appearance=T.EnumAppearance.ENABLED_INVALID_CFG):(console.log("... valid"),e.appearance=T.EnumAppearance.ENABLED)):(console.log("QAppConfigBase::updateLIDSIDParamAppearance: not configured:"+e.id),e.appearance=T.EnumAppearance.HIDDEN),this.updateTaskHandlerAndPublish(e))}updateLIDParams(){let e=this.taskHandler.getParameter(_.TASK_DYNAMIC_ID_LID_CNT_PARAM_ID),t=_.getConfiguredIds(e);console.log("QAppConfigBase::updateLIDParams: configured LIDs: "+t);for(let e=1;e<=_.TASK_DYNAMIC_ID_LID_CNT_MAX;e++){let s=this.taskHandler.getParameter(_.createLIDParamId(e,_.TASK_DYNAMIC_ID_LID_X_PARAM_ID_SUFFIX_HEADER));this.updateLIDSIDParamAppearance(s,e,t),
s=this.taskHandler.getParameter(_.createLIDParamId(e,_.TASK_DYNAMIC_ID_LID_X_PARAM_ID_SUFFIX_TITLE)),this.updateLIDSIDParamAppearance(s,e,t)}}updateSIDParams(){let e=this.taskHandler.getParameter(_.TASK_DYNAMIC_ID_SID_CNT_PARAM_ID),t=_.getConfiguredIds(e);console.log("QAppConfigBase::updateLIDSIDParams: configured SIDs: "+t);for(let e=1;e<=_.TASK_DYNAMIC_ID_SID_CNT_MAX;e++){let s=this.taskHandler.getParameter(_.createSIDParamId(e,_.TASK_DYNAMIC_ID_SID_X_PARAM_ID_SUFFIX_HEADER));this.updateLIDSIDParamAppearance(s,e,t),s=this.taskHandler.getParameter(_.createSIDParamId(e,_.TASK_DYNAMIC_ID_SID_X_PARAM_ID_SUFFIX_TITLE)),this.updateLIDSIDParamAppearance(s,e,t),s=this.taskHandler.getParameter(_.createSIDParamId(e,_.TASK_DYNAMIC_ID_SID_X_PARAM_ID_SUFFIX_MODE)),this.updateLIDSIDParamAppearance(s,e,t)}}addDatabaseConnectionParameter(){let e={id:_.TASK_DYNAMIC_ID_DB_TYPES_PARAM_ID,type:T.EnumParameterTypes.PARAM_SELECTION,
appearance:this.getSupportedDatabases().length>1?T.EnumAppearance.ENABLED:T.EnumAppearance.DISABLED,title:{id:"_QAPP_LIB_PARAM_TITLE_DB_TYPE",args:[]},header:{id:"_QAPP_LIB_PARAM_HEADER_DB_TYPE",args:[]},value:{selection:{id:this.getSupportedDatabases()[0]}},info:{options:this.getSupportedDatabases().map(e=>{let t={appearance:T.EnumAppearance.ENABLED,id:e,text:{id:"",args:[]}};switch(e){case _.EnumDatabaseTypesOptions.MSSQL:t.text.id="_QAPP_LIB_PARAM_DB_TYPE_SELECTION_MSSQL";break;case _.EnumDatabaseTypesOptions.SQLITE:t.text.id="_QAPP_LIB_PARAM_DB_TYPE_SELECTION_SQLITE";break;case _.EnumDatabaseTypesOptions.POSTGRES:t.text.id="_QAPP_LIB_PARAM_DB_TYPE_SELECTION_PSOTGRESQL";break;case _.EnumDatabaseTypesOptions.MYSQL:t.text.id="_QAPP_LIB_PARAM_DB_TYPE_SELECTION_MYSQL";break;default:t.text.id="_QAPP_LIB_PARAM_DB_TYPE_SELECTION_SQLITE"}return t})}},t={id:_.TASK_DYNAMIC_ID_DB_CONN_CONFIG_GROUP_ID,type:T.EnumParameterTypes.PARAM_GROUP,appearance:T.EnumAppearance.ENABLED,title:{
id:"_QAPP_LIB_GROUP_TITLE_DB_CONN_CONFIG",args:[]},parameters:[e,...this.createConfigParametersForSupportedDatabases()]};this.taskHandler.addDynamicGroup(t)}createConfigParametersForSupportedDatabases(){let e=[],t={id:_.TASK_DYNAMIC_ID_DB_USERNAME_PARAM_ID,type:T.EnumParameterTypes.PARAM_STRING,appearance:T.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_DB_USERNAME",args:[]},header:{id:"_QAPP_LIB_PARAM_HEADER_DB_USERNAME",args:[]},value:{string:""},info:{minimum:{length:1},maximum:{length:1e3}},valid:!1},s={id:_.TASK_DYNAMIC_ID_DB_PASSWORD_PARAM_ID,type:T.EnumParameterTypes.PARAM_PASSWORD,appearance:T.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_DB_PASSWORD",args:[]},header:{id:"_QAPP_LIB_PARAM_HEADER_DB_PASSWORD",args:[]},value:{string:""},info:{minimum:{length:1},maximum:{length:1e3},passwordLength:6},valid:!1},a={id:_.TASK_DYNAMIC_ID_DB_DATABASE_PARAM_ID,type:T.EnumParameterTypes.PARAM_STRING,appearance:T.EnumAppearance.HIDDEN,title:{
id:"_QAPP_LIB_PARAM_TITLE_DB_DATABASE",args:[]},header:{id:"_QAPP_LIB_PARAM_HEADER_DB_DATABASE",args:[]},value:{string:""},info:{minimum:{length:1},maximum:{length:1e3}},valid:!1},n={id:_.TASK_DYNAMIC_ID_DB_SCHEMA_PARAM_ID,type:T.EnumParameterTypes.PARAM_STRING,appearance:T.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_DB_SCHEMA",args:[]},header:{id:"_QAPP_LIB_PARAM_HEADER_DB_SCHEMA",args:[]},value:{string:"public"},info:{minimum:{length:1},maximum:{length:1e3}},valid:!1},i={id:_.TASK_DYNAMIC_ID_DB_IP_PARAM_ID,type:T.EnumParameterTypes.PARAM_STRING,appearance:T.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_DB_IP",args:[]},header:{id:"_QAPP_LIB_PARAM_HEADER_DB_IP",args:[]},value:{string:""},info:{minimum:{length:1},maximum:{length:1e3}},valid:!1},r={id:_.TASK_DYNAMIC_ID_DB_PORT_PARAM_ID,type:T.EnumParameterTypes.PARAM_QUANTITY,appearance:T.EnumAppearance.HIDDEN,title:{id:"_QAPP_LIB_PARAM_TITLE_DB_PORT",args:[]},header:{id:"_QAPP_LIB_PARAM_HEADER_DB_PORT",args:[]},
value:{decimals:0,numbers:[],preferredDecimals:0,unit:""},info:{isNoValueAllowed:!1,maximum:{value:"65535"},minimum:{value:"0"}},valid:!1};return this.getSupportedDatabases().forEach((o,E)=>{let _=c.cloneJSON(t),l=c.cloneJSON(s),A=c.cloneJSON(a),u=c.cloneJSON(n),I=c.cloneJSON(i),p=c.cloneJSON(r);if("sqlite"!==o){switch(_.id=`${_.id}/${o.toUpperCase()}`,l.id=`${l.id}/${o.toUpperCase()}`,A.id=`${A.id}/${o.toUpperCase()}`,u.id=`${u.id}/${o.toUpperCase()}`,I.id=`${I.id}/${o.toUpperCase()}`,p.id=`${p.id}/${o.toUpperCase()}`,o){case"postgres":p.value.numbers=["5432"];break;case"mssql":p.value.numbers=["1433"];break;case"mysql":p.value.numbers=["3306"]}0===E&&(_.appearance=T.EnumAppearance.ENABLED_INVALID_CFG,l.appearance=T.EnumAppearance.ENABLED_INVALID_CFG,A.appearance=T.EnumAppearance.ENABLED_INVALID_CFG,u.appearance=T.EnumAppearance.ENABLED_INVALID_CFG,I.appearance=T.EnumAppearance.ENABLED_INVALID_CFG,p.appearance=T.EnumAppearance.ENABLED_INVALID_CFG),e.push(_,l,A,u,I,p)}}),e}
updateDatabaseConfigParameters(e){this.getSupportedDatabases().forEach(t=>{"sqlite"!==t&&(t===e?this.setDBTypeConfigParamsAppearance(e,T.EnumAppearance.ENABLED):this.setDBTypeConfigParamsAppearance(t,T.EnumAppearance.HIDDEN))})}setDBTypeConfigParamsAppearance(e,t,s){let a=[]
;"sqlite"===e||("postgres"===e?a=[this.taskHandler.getParameter(`${_.TASK_DYNAMIC_ID_DB_USERNAME_PARAM_ID}/${e.toUpperCase()}`),this.taskHandler.getParameter(`${_.TASK_DYNAMIC_ID_DB_PASSWORD_PARAM_ID}/${e.toUpperCase()}`),this.taskHandler.getParameter(`${_.TASK_DYNAMIC_ID_DB_DATABASE_PARAM_ID}/${e.toUpperCase()}`),this.taskHandler.getParameter(`${_.TASK_DYNAMIC_ID_DB_IP_PARAM_ID}/${e.toUpperCase()}`),this.taskHandler.getParameter(`${_.TASK_DYNAMIC_ID_DB_PORT_PARAM_ID}/${e.toUpperCase()}`)]:"mssql"===e&&(a=[this.taskHandler.getParameter(`${_.TASK_DYNAMIC_ID_DB_USERNAME_PARAM_ID}/${e.toUpperCase()}`),this.taskHandler.getParameter(`${_.TASK_DYNAMIC_ID_DB_PASSWORD_PARAM_ID}/${e.toUpperCase()}`),this.taskHandler.getParameter(`${_.TASK_DYNAMIC_ID_DB_DATABASE_PARAM_ID}/${e.toUpperCase()}`),this.taskHandler.getParameter(`${_.TASK_DYNAMIC_ID_DB_SCHEMA_PARAM_ID}/${e.toUpperCase()}`),this.taskHandler.getParameter(`${_.TASK_DYNAMIC_ID_DB_IP_PARAM_ID}/${e.toUpperCase()}`),this.taskHandler.getParameter(`${_.TASK_DYNAMIC_ID_DB_PORT_PARAM_ID}/${e.toUpperCase()}`)])),
a.forEach(e=>{void 0!==s&&(e.valid=s),t===T.EnumAppearance.HIDDEN?e.appearance!==t&&(e.appearance=t,this.updateTaskHandlerAndPublish(e)):(!1===e.valid&&(t=T.EnumAppearance.ENABLED_INVALID_CFG),e.appearance!==t&&(e.appearance=t,this.updateTaskHandlerAndPublish(e)))})}setDbConnectionConfig(e){this.dbConnectionConfig=e}onEnter_STATE_CHECK_DATABASE(){console.log("QAppConfigBase::onEnter_STATE_CHECK_DATABASE");const e=this.dbConnectionConfig;try{this.aspects[I.CONNECTION_ASPECT].configure({nextState:S,cancelState:m,qappEntities:e.qappEntities,workflow:!1,checkMigration:e.checkMigration,doMigration:e.doMigration,taskHandler:this.taskHandler,qappSpecificSqliteDatabaseLocation:void 0===e.qappSpecificSqliteDatabaseLocation||e.qappSpecificSqliteDatabaseLocation,useLogTable:void 0===e.useLogTable||e.useLogTable,syncByTypeorm:void 0!==e.syncByTypeorm&&e.syncByTypeorm})}catch(e){this.exitError("Connection Aspect not registered! Do so in the configWorkflow.")}
this.addToEventQueue(new d.ImmediateEvent({from:R,to:I.STATE_CONNECTION_ASPECT_CONNECT_TO_DATABASE}))}onEnter_STATE_DATABASE_CONN_SUCCESS(){console.log("qappConfigBase::onEnter_STATE_DATABASE_CONN_SUCCESS");try{this.aspects[p.DISCONNECT_ASPECT].configure({nextState:N,cancelState:D,connection:this.aspects[I.CONNECTION_ASPECT].getConnection()})}catch(e){this.exitError("Disconnect Aspect not registered! Do so in the configWorkflow.")}let e=this.taskHandler.getParameter(_.TASK_DYNAMIC_ID_DB_TYPES_PARAM_ID);void 0===e?console.log("Database connection type parameter not found"):this.setDBTypeConfigParamsAppearance(e.value.selection.id,T.EnumAppearance.ENABLED,!0),this.addToEventQueue(new d.ImmediateEvent({from:S,to:h}))}onEnter_STATE_DATABASE_CONN_FAILED(){console.log("qappConfigBase::onEnter_STATE_DATABASE_CONN_FAILED");try{this.aspects[p.DISCONNECT_ASPECT].configure({nextState:N,cancelState:D,connection:this.aspects[I.CONNECTION_ASPECT].getConnection()})}catch(e){
this.exitError("Disconnect Aspect not registered! Do so in the configWorkflow.")}let e=this.taskHandler.getParameter(_.TASK_DYNAMIC_ID_DB_TYPES_PARAM_ID);void 0===e?console.log("Database connection type parameter not found"):this.setDBTypeConfigParamsAppearance(e.value.selection.id,T.EnumAppearance.ENABLED_INVALID_CFG,!1),this.addToEventQueue(new d.ImmediateEvent({from:m,to:h}))}onEnter_STATE_DATABASE_DISC_FAILED(){let e=this.taskHandler.getParameter(_.TASK_DYNAMIC_ID_DB_TYPES_PARAM_ID);void 0===e?console.log("Database connection type parameter not found"):this.setDBTypeConfigParamsAppearance(e.value.selection.id,T.EnumAppearance.ENABLED_INVALID_CFG,!1),this.addToEventQueue(new d.ImmediateEvent({from:h,to:N}))}handleDocuButton(){}}},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=s(8),n=s(0),i=s(24),r=s(2);t.PARAM_OVER_SCREENID="PARAMOVERVIEW",t.EDIT_BUTTON_ID="BTN_EDIT",t.DELETE_BUTTON_ID="BTN_DELETE",t.SAVE_BUTTON_ID="BTN_SAVE",
t.BACK_BUTTON_ID="BTN_BACK";var o=s(24);t.CANCEL_BUTTON_ID=o.CANCEL_BUTTON_ID;class E extends i.default{constructor(e){super(e),this.buttonList=[],this.title1=Object.assign({},{id:"",args:[]}),this.title2=Object.assign({},{id:"",args:[]});let s=[],a={nameId:"",label:{id:"",args:[]},appearance:n.EnumAppearance.HIDDEN,buttonId:""},o=r.cloneJSON(a);o.label.id=i.CANCEL_BUTTON_NAME,o.appearance=n.EnumAppearance.ENABLED_PRIMARY,o.buttonId=i.CANCEL_BUTTON_ID,s.push(o);let E=r.cloneJSON(a);E.label.id="_SAVE",E.buttonId=t.SAVE_BUTTON_ID,E.appearance=n.EnumAppearance.HIDDEN,s.push(E);let _=r.cloneJSON(a);_.label.id="_PREVIOUS",_.buttonId=t.BACK_BUTTON_ID,_.appearance=n.EnumAppearance.HIDDEN,s.push(_),this.createButtons(s)}createButtons(e){for(let t of e){let e=new a.default(this.mqttHandler,this,t);this.buttonList.push(e)}}getButton(e){for(let t of this.buttonList){if(t.getButtonId()===e)return t}}setTitle1(e,t){this.title1.id===e&&this.title1.args.join()===t.join()||(this.title1.id=e,
this.title1.args=t,this.publishTitle1())}setTitle2(e,t){this.title2.id===e&&this.title2.args.join()===t.join()||(this.title2.id=e,this.title2.args=t,this.publishTitle2())}publishTitle1(){this.publishContent("TITLE1",JSON.stringify(this.title1))}publishTitle2(){this.publishContent("TITLE2",JSON.stringify(this.title2))}getTitle1(){return this.title1}getTitle2(){return this.title2}getId(){return t.PARAM_OVER_SCREENID}show(){this.createAndPublishParamsAndPage();for(let e of this.buttonList)e.getButtonId()!==i.CANCEL_BUTTON_ID&&e.show();""!==this.title1.id&&this.publishTitle1(),""!==this.title2.id&&this.publishTitle2(),super.show()}}t.ParameterOverviewScreen=E,t.default=E},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CONNECTION_ASPECT="CONNECTION_ASPECT",t.STATE_CONNECTION_ASPECT_CONNECT_TO_DATABASE="STATE_CONNECTION_ASPECT_CONNECT_TO_DATABASE",function(e){e[e.MIGRATION_NEEDED=0]="MIGRATION_NEEDED",e[e.MIGRATION_NOT_NEEDED=1]="MIGRATION_NOT_NEEDED",
e[e.MIGRATION_NOT_POSSIBLE=2]="MIGRATION_NOT_POSSIBLE",e[e.MIGRATION_DONE=3]="MIGRATION_DONE",e[e.MIGRATION_FAILED=4]="MIGRATION_FAILED"}(t.EMigrationResult||(t.EMigrationResult={}))},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DISCONNECT_ASPECT="DISCONNECT_ASPECT",t.STATE_DISCONNECT_ASPECT_DISCONNECT="STATE_DISCONNECT_ASPECT_DISCONNECT"}]);