text: var TcHmi,__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};!function(TcHmi){let Controls;!function(Controls){let Beckhoff;!function(Beckhoff){var _a,_TcHmiTextbox_tchmiFQN;class TcHmiTextbox extends TcHmi.Controls.System.TcHmiControl{constructor(element,pcElement,attrs){super(element,pcElement,attrs),this.__locked=!1,this.__triggerUIFinishedOnBlur=!0,this.__onKeydown=event=>{!0===TcHmi.Access.checkAccess(this,"operate")&&this.getIsEnabled()&&(this.__triggerUIFinishedOnBlur=!0,"Escape"===event.key?(this.__setText(this.__oldText),TcHmi.EventProvider.raise(this.__id+".onUserInteractionCanceled"),this.__triggerUIFinishedOnBlur=!1,this.__autoFocusOut&&this.__elementInput.blur()):"Enter"!==event.key||this.__multiline||(this.__oldText=this.__text,this.__triggerUIFinishedOnBlur=!1,this.__autoFocusOut&&(this.__elementInput.blur(),this.__unlock()),TcHmi.EventProvider.raise(this.__id+".onUserInteractionFinished"),event.preventDefault()))},this.__onInput=event=>{!0===TcHmi.Access.checkAccess(this,"operate")&&this.getIsEnabled()&&(this.__triggerUIFinishedOnBlur=!0,this.__setText(this.__elementInput[0].value.replace(/\\n/gm,"\\\\n").replace(/\\r/gm,"\\\\r").replace(/\\t/gm,"\\\\t").replace(/\n/gm,"\\n").replace(/\r/gm,"\\r").replace(/\t/gm,"\\t"),!1))},this.__onPaste=event=>{!0===TcHmi.Access.checkAccess(this,"operate")&&this.getIsEnabled()&&(this.__triggerUIFinishedOnBlur=!0,window.setTimeout(()=>{this.__setText(this.__elementInput[0].value.replace(/\\n/gm,"\\\\n").replace(/\\r/gm,"\\\\r").replace(/\\t/gm,"\\\\t").replace(/\n/gm,"\\n").replace(/\r/gm,"\\r").replace(/\t/gm,"\\t"),!1)}))},this.__onCut=event=>{!0===TcHmi.Access.checkAccess(this,"operate")&&this.getIsEnabled()&&(this.__triggerUIFinishedOnBlur=!0,window.setTimeout(()=>{this.__setText(this.__elementInput[0].value.replace(/\\n/gm,"\\\\n").replace(/\\r/gm,"\\\\r").replace(/\\t/gm,"\\\\t").replace(/\n/gm,"\\n").replace(/\r/gm,"\\r").replace(/\t/gm,"\\t"),!1)}))},this.__onFocusIn=event=>{!0===TcHmi.Access.checkAccess(this,"operate")&&this.getIsEnabled()&&(this.__triggerUIFinishedOnBlur=!0,this.__oldText=this.__text,this.__elementFocusBorder[0].classList.add("tchmi-focus"),this.__autoSelectText&&(this.__elementInput[0].setSelectionRange(0,0),this.__elementInput[0].select()),TcHmi.EventProvider.raise(this.__id+".onFocusIn",event),this.__elementInput[0]===document.activeElement&&this.__lock())},this.__onFocusOut=event=>{!0===TcHmi.Access.checkAccess(this,"operate")&&this.getIsEnabled()&&(this.__unlock(),this.__elementFocusBorder[0].classList.remove("tchmi-focus"),TcHmi.EventProvider.raise(this.__id+".onFocusOut",event),this.__oldText=this.__text,this.__triggerUIFinishedOnBlur&&TcHmi.EventProvider.raise(this.__id+".onUserInteractionFinished"),this.__triggerUIFinishedOnBlur=!0)},this.__onResolverForContentPaddingWatchCallback=data=>{!1===this.__isAttached&&this.__suspendObjectResolver("contentPadding"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__contentPadding)||(this.__contentPadding=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"ContentPadding"}),this.__processContentPadding()):TCHMI_CONSOLE_LOG_LEVEL>=1&&TcHmi.Log.errorEx("[Source=Control, Module="+this.__type+(__classPrivateFieldGet(TcHmiTextbox,_a,"f",_TcHmiTextbox_tchmiFQN)!==this.__type?", Origin="+__classPrivateFieldGet(TcHmiTextbox,_a,"f",_TcHmiTextbox_tchmiFQN):"")+", Id="+this.getId()+", Attribute=ContentPadding] Resolving symbols from object failed with error: "+TcHmi.Log.buildMessage(data.details))},this.__onResolverForTextColorWatchCallback=data=>{!1===this.__isAttached&&this.__suspendObjectResolver("textColor"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__textColor)||(this.__textColor=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TextColor"}),this.__processTextColor()):TCHMI_CONSOLE_LOG_LEVEL>=1&&TcHmi.Log.errorEx("[Source=Control, Module="+this.__type+(__classPrivateFieldGet(TcHmiTextbox,_a,"f",_TcHmiTextbox_tchmiFQN)!==this.__type?", Origin="+__classPrivateFieldGet(TcHmiTextbox,_a,"f",_TcHmiTextbox_tchmiFQN):"")+", Id="+this.getId()+", Attribute=TextColor] Resolving symbols from object failed with error: "+TcHmi.Log.buildMessage(data.details))}}__previnit(){if(this.__elementTemplateRoot=this.__element.find(".TcHmi_Controls_Beckhoff_TcHmiTextbox-template"),0===this.__elementTemplateRoot.length&&(this.__elementTemplateRoot=this.__element.find(".tchmi-textbox-template")),this.__elementBorder=this.__elementTemplateRoot.find(".TcHmi_Controls_Beckhoff_TcHmiTextbox-template-border"),0===this.__elementBorder.length&&(this.__elementBorder=this.__elementTemplateRoot.find(".tchmi-textbox-template-border")),this.__elementContainer=this.__elementTemplateRoot.find(".TcHmi_Controls_Beckhoff_TcHmiTextbox-template-input-container"),0===this.__elementContainer.length&&(this.__elementContainer=this.__elementTemplateRoot.find(".tchmi-textbox-template-input-container")),this.__elementFocusBorder=this.__elementTemplateRoot.find(".TcHmi_Controls_Beckhoff_TcHmiTextbox-template-focus-border"),0===this.__elementFocusBorder.length&&(this.__elementFocusBorder=this.__elementTemplateRoot.find(".tchmi-textbox-template-focus-border")),0===this.__elementTemplateRoot.length||0===this.__elementBorder.length||0===this.__elementContainer.length||0===this.__elementFocusBorder.length)throw new Error("Invalid Template.html");const inputFromTemplateHtml=this.__elementTemplateRoot.find(".tchmi-textbox-template-input");inputFromTemplateHtml.length&&(this.__elementInput=inputFromTemplateHtml),super.__previnit()}__init(){super.__init();const passiveEventOptions=!!TCHMI_EVENT_OPTION_OBJECT_SUPPORTED&&{passive:!0,capture:!1},activeEventOptions=!!TCHMI_EVENT_OPTION_OBJECT_SUPPORTED&&{passive:!1,capture:!1};this.__elementTemplateRoot[0].addEventListener("focusin",this.__onFocusIn,passiveEventOptions),this.__elementTemplateRoot[0].addEventListener("focusout",this.__onFocusOut,passiveEventOptions),this.__elementContainer[0].addEventListener("keydown",this.__onKeydown,activeEventOptions),this.__elementContainer[0].addEventListener("input",this.__onInput,passiveEventOptions),this.__elementContainer[0].addEventListener("paste",this.__onPaste,passiveEventOptions),this.__elementContainer[0].addEventListener("cut",this.__onCut,passiveEventOptions)}__attach(){super.__attach()}__detach(){super.__detach()}destroy(){if(this.__keepAlive)return;const passiveEventOptions=!!TCHMI_EVENT_OPTION_OBJECT_SUPPORTED&&{passive:!0,capture:!1},activeEventOptions=!!TCHMI_EVENT_OPTION_OBJECT_SUPPORTED&&{passive:!1,capture:!1};this.__elementTemplateRoot[0].removeEventListener("focusin",this.__onFocusIn,passiveEventOptions),this.__elementTemplateRoot[0].removeEventListener("focusout",this.__onFocusOut,passiveEventOptions),this.__elementContainer[0].removeEventListener("keydown",this.__onKeydown,activeEventOptions),this.__elementContainer[0].removeEventListener("input",this.__onInput,passiveEventOptions),this.__elementContainer[0].removeEventListener("paste",this.__onPaste,passiveEventOptions),this.__elementContainer[0].removeEventListener("cut",this.__onCut,passiveEventOptions),super.destroy()}setText(valueNew){!0!==this.__locked&&this.__setText(valueNew)}__setText(valueNew,process=!0){let convertedValue=TcHmi.ValueConverter.toString(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("Text")),convertedValue!==this.__text&&(this.__text=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"Text"}),TcHmi.EventProvider.raise(this.__id+".onTextChanged",this.__text),process&&this.__processText())}getText(){return this.__text}__processText(){var _b;if(void 0===this.__text)return;if(!this.__elementInput||0===this.__elementInput.length)return;let text;text=this.__multiline?tchmi_decode_control_characters(this.__text):tchmi_decode_control_characters((null!==(_b=this.__text)&&void 0!==_b?_b:"").replace(/^\\n|([^\\])\\n/g,"$1 ").replace(/^\\r|([^\\])\\r/g,"$1 ")),this.__elementInput[0].value=text}setTextHorizontalAlignment(valueNew){let convertedValue=TcHmi.ValueConverter.toHorizontalAlignment(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TextHorizontalAlignment")),convertedValue!==this.__textHorizontalAlignment&&(this.__textHorizontalAlignment=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TextHorizontalAlignment"}),this.__processTextHorizontalAlignment())}getTextHorizontalAlignment(){return this.__textHorizontalAlignment}__processTextHorizontalAlignment(){switch(this.__textHorizontalAlignment){case"Left":TcHmi.StyleProvider.setSimpleElementStyle(this.__elementContainer,"text-align","left");break;case"Center":TcHmi.StyleProvider.setSimpleElementStyle(this.__elementContainer,"text-align","center");break;case"Right":TcHmi.StyleProvider.setSimpleElementStyle(this.__elementContainer,"text-align","right");break;default:TcHmi.StyleProvider.setSimpleElementStyle(this.__elementContainer,"text-align",null)}}setContentPadding(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("ContentPadding"));let resolverInfo=this.__objectResolvers.get("contentPadding");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue);this.__objectResolvers.set("contentPadding",{resolver:resolver,watchCallback:this.__onResolverForContentPaddingWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForContentPaddingWatchCallback)})}getContentPadding(){return this.__contentPadding}__processContentPadding(){this.__elementInput&&0!==this.__elementInput.length&&TcHmi.StyleProvider.processContentPadding(this.__elementInput,this.__contentPadding)}setTextFontSize(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TextFontSize")),convertedValue!==this.__textFontSize&&(this.__textFontSize=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TextFontSize"}),this.__processTextFontSize())}getTextFontSize(){return this.__textFontSize}__processTextFontSize(){TcHmi.StyleProvider.processFontSize(this.__elementContainer,this.__textFontSize,this.__textFontSizeUnit)}setTextFontSizeUnit(valueNew){let convertedValue=TcHmi.ValueConverter.toFontSizeUnit(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TextFontSizeUnit")),convertedValue!==this.__textFontSizeUnit&&(this.__textFontSizeUnit=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TextFontSizeUnit"}),this.__processTextFontSizeUnit())}getTextFontSizeUnit(){return this.__textFontSizeUnit}__processTextFontSizeUnit(){TcHmi.StyleProvider.processFontSize(this.__elementContainer,this.__textFontSize,this.__textFontSizeUnit)}setTextFontFamily(valueNew){let convertedValue=TcHmi.ValueConverter.toFontFamily(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TextFontFamily")),convertedValue!==this.__textFontFamily&&(this.__textFontFamily=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TextFontFamily"}),this.__processTextFontFamily())}getTextFontFamily(){return this.__textFontFamily}__processTextFontFamily(){TcHmi.StyleProvider.processFontFamily(this.__elementContainer,this.__textFontFamily)}setTextFontStyle(valueNew){let convertedValue=TcHmi.ValueConverter.toFontStyle(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TextFontStyle")),convertedValue!==this.__textFontStyle&&(this.__textFontStyle=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TextFontStyle"}),this.__processTextFontStyle())}getTextFontStyle(){return this.__textFontStyle}__processTextFontStyle(){TcHmi.StyleProvider.processFontStyle(this.__elementContainer,this.__textFontStyle)}setTextFontWeight(valueNew){let convertedValue=TcHmi.ValueConverter.toFontWeight(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TextFontWeight")),convertedValue!==this.__textFontWeight&&(this.__textFontWeight=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TextFontWeight"}),this.__processTextFontWeight())}getTextFontWeight(){return this.__textFontWeight}__processTextFontWeight(){TcHmi.StyleProvider.processFontWeight(this.__elementContainer,this.__textFontWeight)}setMultiline(valueNew){let convertedValue=TcHmi.ValueConverter.toBoolean(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("Multiline")),convertedValue!==this.__multiline&&(this.__multiline=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"Multiline"}),this.__processMultiline())}getMultiline(){return this.__multiline}__processMultiline(){if(!0===this.__multiline){if(void 0===this.__elementInput||0===this.__elementInput.length||"TEXTAREA"!==this.__elementInput[0].tagName){let oldElement=this.__elementInput;this.__elementInput=$('<textarea class="TcHmi_Controls_Beckhoff_TcHmiTextbox-template-input tchmi-textbox-template-input" wrap="off" spellcheck="false"></textarea>'),this.__processWordWrap(),this.__processText(),this.__processContentPadding(),this.__processPlaceholder(),oldElement&&oldElement.length>0?oldElement.replaceWith(this.__elementInput):this.__elementContainer.append(this.__elementInput)}}else if(void 0===this.__elementInput||0===this.__elementInput.length||"INPUT"!==this.__elementInput[0].tagName){let oldElement=this.__elementInput;this.__elementInput=$('<input class="TcHmi_Controls_Beckhoff_TcHmiTextbox-template-input tchmi-textbox-template-input" spellcheck="false" />'),this.__processWordWrap(),this.__processText(),this.__processContentPadding(),this.__processPlaceholder(),oldElement&&oldElement.length>0?oldElement.replaceWith(this.__elementInput):this.__elementContainer.append(this.__elementInput)}}setWordWrap(valueNew){let convertedValue=TcHmi.ValueConverter.toBoolean(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("WordWrap")),convertedValue!==this.__wordWrap&&(this.__wordWrap=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"WordWrap"}),this.__processWordWrap())}getWordWrap(){return this.__wordWrap}__processWordWrap(){this.__elementInput&&0!==this.__elementInput.length&&(this.__wordWrap?(TcHmi.StyleProvider.setSimpleElementStyle(this.__elementInput,{"white-space":"pre-wrap","word-wrap":"break-word","overflow-wrap":"break-word"}),this.__elementInput[0].setAttribute("wrap","on")):(TcHmi.StyleProvider.setSimpleElementStyle(this.__elementInput,{"white-space":null,"word-wrap":null,"overflow-wrap":null}),this.__elementInput[0].setAttribute("wrap","off")))}setPlaceholder(valueNew){let convertedValue=TcHmi.ValueConverter.toString(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("Placeholder")),convertedValue!==this.__placeholder&&(this.__placeholder=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"Placeholder"}),this.__processPlaceholder())}getPlaceholder(){return this.__placeholder}__processPlaceholder(){this.__elementInput&&0!==this.__elementInput.length&&(this.__placeholder?this.__elementInput[0].setAttribute("placeholder",this.__placeholder):this.__elementInput[0].removeAttribute("placeholder"))}setTextColor(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TextColor"));let resolverInfo=this.__objectResolvers.get("textColor");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue);this.__objectResolvers.set("textColor",{resolver:resolver,watchCallback:this.__onResolverForTextColorWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForTextColorWatchCallback)})}getTextColor(){return this.__textColor}__processTextColor(){TcHmi.StyleProvider.processTextColor(this.__elementContainer,this.__textColor)}setAutoFocusOut(valueNew){let convertedValue=TcHmi.ValueConverter.toBoolean(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("AutoFocusOut")),convertedValue!==this.__autoFocusOut&&(this.__autoFocusOut=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"AutoFocusOut"}),this.__processAutoFocusOut())}getAutoFocusOut(){return this.__autoFocusOut}__processAutoFocusOut(){}setAutoSelectText(valueNew){let convertedValue=TcHmi.ValueConverter.toBoolean(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("AutoSelectText")),convertedValue!==this.__autoSelectText&&(this.__autoSelectText=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"AutoSelectText"}))}getAutoSelectText(){return this.__autoSelectText}__lock(){this.__locked=!0}__unlock(){this.__locked=!1}__processControlActivation(){if(!this.__elementInput||0===this.__elementInput.length)return;const textArea=this.__elementInput[0];TcHmi.Access.checkAccess(this,"operate")&&this.getIsEnabled()?textArea.disabled=!1:(textArea.blur(),textArea.disabled=!0)}__processIsEnabled(){super.__processIsEnabled(),this.__processControlActivation()}__processAccessConfig(){super.__processAccessConfig(),this.__processControlActivation()}}_TcHmiTextbox_tchmiFQN={value:"TcHmi.Controls.Beckhoff."+(_a=TcHmiTextbox).name},Beckhoff.TcHmiTextbox=TcHmiTextbox}(Beckhoff=Controls.Beckhoff||(Controls.Beckhoff={}))}(Controls=TcHmi.Controls||(TcHmi.Controls={}))}(TcHmi||(TcHmi={})),TcHmi.Controls.registerEx("TcHmiTextbox","TcHmi.Controls.Beckhoff",TcHmi.Controls.Beckhoff.TcHmiTextbox);