/* @license Copyright (C) Exontrol. All rights reserved. */ !function(t,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define(["exports"],o):(t="undefined"!=typeof globalThis?globalThis:t||self,o(t.exontrol||{}))}(this,function(t){"use strict";function o(t){return function(t,o,e){for(;~t.indexOf(o);)t=t.repAll(o,e);return t}(t,g,C).trim()}function e(t){return Math.round(t)}function i(){return Math.max.apply(0,arguments)}function n(){return Math.min.apply(null,arguments)}function r(t){return null!=t}function s(t){return null==t}function h(t,e){return o(c(t,e)+C+e)}function c(t,e){return o(t.repAll(e,""))}function l(t,o,e){e=e||this;var i=a.CC.c2CC(t);return i&&i.rgC.forEachU(function(t){if(t=function(t){return t.oT||t}(t))return o.call(e,t)})}function u(t){return t.oB&&t.oB.oHE||t.oHE}function p(t){return l(u(t),function(t){return t})}var a=a||window.exontrol,f=a.G,d="exd2-hide",y="exd2-show",C=" ",g=" ",v=1234;a.Def.ComboBox={},a.Shapes.ComboBox={},a.Mrg(a,function(){function t(t,o){this.init(t,o)}return t.version="3.0",t.type="ComboBox",t.XML=function(){function t(t){return r(t)?t.toLowerCase():t}function o(e){var i,n,r="^"==e.charAt(0);r&&(e=e.substr(1)),~(i=e.indexOf("/"))&&(n=e.substr(i+1),e=e.substr(0,i));for(var s,h=function(o){o=t(o);for(var e,i=[],n=0,r=this.getElementsByTagName("*"),s=r.length;n>=8))+",",i+=(255&(t>>=8))+")"),i||o}}}(),t.allowRurPart=function(t,o,e){return!e||!o||o.indexOf(t)>=0&&(!function(t){return t.split(",").forEachU(function(t){return this.has(t)},this)}.call(e,o)||e.has(t))},t.Options={tfi:null,locked:null,readOnly:null,readOnly:!1,shapes:null,cursors:null,zoom:null,formatText:null,pad:null,allowActions:null,toolTipDelay:null,toolTipPopDelay:null,toolTipWidth:null,label:null,host:null,allowDrop:null,align:null,dropDown:null,allowResize:null,showClearButton:null},t.bSCTX=function(t,o,e,i){var n;return o&&(t.drawShape(e,o,i),n=a.TFI.bCTX(t,o.tfi),r(o.opacity)&&((n=n||{}).opacity=t.globalAlpha,t.globalAlpha=o.opacity)),n},t.eSCTX=function(t,o){r(o.opacity)&&(t.globalAlpha=o.opacity),o instanceof a.TFI&&a.TFI.eCTX(t,o)},t.prototype.init=function(o,e){this.lnt=this.lnt||0,this.lnt++,this.oD2B=null,this.oCB=null,this.oCV=null,this.rgCV=[],this.iLts(),this.oCW=new a.CW(o,{AllowXChg:0}),this.oCW.oT=this,this.Shortcuts=this.oCW.oSts,this.initCW(),this.import(),a.expO(t.Options,this,this.oCV),this.cwbU(),this.SetOptions(e,!0),this.cweU(),a.DPR.Reg(this),--this.lnt},t.prototype.GetCanvas=function(){return this.oCW.GetCanvas()},t.prototype.defAA=function(){return"d2,d2(double)"},t.prototype.roAA=function(){return""},t.prototype.allP=function(){return"view(ComboBox.CV)"},t.prototype.lRA=function(t){this.oCW.lRA(t)},t.prototype.feCV=function(t,o){a.ComboBox.CV.prototype[t]?this.rgCV.forEach(function(o){o[t].call(o)},this):this.rgCV.forEach(t,o)},t.prototype.feCVU=function(t,o){return a.ComboBox.CV.prototype[t]?this.rgCV.forEachU(function(o){o[t].call(o)},this):this.rgCV.forEachU(t,o)},t.prototype.BeginUpdate=function(){this.oCW.CWs().forEach(function(t){t.bU()})},t.prototype.bU=t.prototype.cwbU=t.prototype.BeginUpdate,t.prototype.EndUpdate=function(){1==this.oCW.lR&&this.fU(),this.oCW.CWs().forEach(function(t){t.eU()})},t.prototype.eU=t.prototype.cweU=t.prototype.EndUpdate,t.prototype.Update=function(t,o){this.bU(),t&&t.call(o||this),this.eU()},t.prototype.fU=function(){},t.prototype.Refresh=function(){this.bU(),this.onRL(),this.eU()},t.prototype.onRL=function(){},t.prototype.iLts=function(){this.Listeners=this.oLts=new a.Lts,this.oLts.add("onclick"),this.oLts.add("onanchorclick"),this.oLts.add("ond2"),this.oLts.add("onclear")},t.prototype.addCV=function(t,o){var e=null;if(!s(t)&&t.trim().length||(t="combobox"+this.rgCV.length),!this.oCW.W(t)){var i=!this.rgCV.length,n=(this.oCW.W("main")||this.oCW).Add(t,a.Mrg({Dock:i?5:4,Size:256},o));e=new a.ComboBox.CV(this),this.rgCV.push(e),this.oCV=this.oCV||e,!(n.GetDock()%2)&&n.SetPosition(this.oCW.W("combobox").GetPosition()+1),n.Add("client",{Dock:5,Control:e})}return e},t.prototype.delCV=function(t){!s(t)&&t.trim().length||(t=this.rgCV[this.rgCV.length-1].oW.opW.GetName());var o=!1,e=this.oCW.W(t);if(e){var i=null,n=this.oCW.W(e.GetName()+".client");if(n&&(i=n.GetC())instanceof a.ComboBox.CV&&i!=this.oCV){var r=this.rgCV.indexOf(i);(o=r>=0)&&(this.rgCV.splice(r,1),this.oCW.Remove(e))}}return o},t.prototype.initCW=function(){var t,o=this,e=this.oCW;this.oCW.canvas.addEventListener("dragover",this.localdragover=function(t){return o.ondragover(t)}),this.oCW.canvas.addEventListener("drop",this.localdrop=function(t){return o.ondrop(t)}),this.oCW.SetClientRect=function(t){return function(){t.apply(this,arguments)}}(this.oCW.SetClientRect),(e=e.Add("control",{Dock:5})).Add("d2b",{Dock:4,Size:24,Resizable:!1,DrawWindowFrame:!1,Control:this.oD2B=new a.ComboBox.D2B(this)}),t=e.Add("cb",{Dock:4,Size:24,Resizable:!1,DrawWindowFrame:!1,Control:this.oCB=new a.ComboBox.CB(this)}),e.Add("main",{Dock:5,HoverExtends:"control,cb"}),this.addCV("combobox"),t.GetVisible=this.oCV.showCB.bind(this.oCV),this.oD2B.import(),this.oCB.import()},t.prototype.w2P=function(t){function o(){function t(t){var o=[];return a.B.split(t).forEach(function(t){t.caption&&t.subText&&o.push({n:t.caption,p:function(t){var o=a;return t.split(".").forEach(function(t){o=o[t]}),o.prototype}(t.subText)})}),o}return this._allP||(this._allP=t.call(this,this.allP()))}var e,i=t&&t.oC&&Object.getPrototypeOf(t.oC);if(i)for(var n,r=o.call(this),s=0,h=r.length;!e&&se?0:(o[3]-l)/2),~~(c+1),l]||null})}.call(this),onpaint:function(t,o){this.ctxTfi(function(t){i(n,t,o,s)},this,t)},thisArg:this}},{thisArg:this,ttO:n.o,ttD:this.getToolTipDelay(),ttP:this.getToolTipPopDelay()})}},t.prototype.xA=function(){a.A.Cancel("ss*")},t.prototype.ondown=function(t){return this.isSelectable()&&(this.xA(),this.gAA().Do(this,t),!a.RUR.Rng()&&this.doRUR(t,function(t){switch(t.drag.status){case 4:case 5:this.rurActionClick(null,t)}},this)),!0},t.prototype.doRUR=function(t,o,e,i){var n,r,s=this.gAA(),h=this.oT.lRA.bind(this.oT);return a.RUR.Do(t,function(t){switch(r=t.drag.status){case 1:h(7),n=this.oT.oRUR=this.e2RUR(t),this.lRURLong&&t.drag.setCursor(a.GP.Get("long",this.getCursors()));break;case 3:s.CanDo(t,1)&&(a.RUR.Cancel(),this.norurAction(t,1)||(this.lRURLong=(this.lRURLong||0)+1,s.Do(this,t,1),--this.lRURLong));break;case 5:this.norurAction(t,2);break;case 2:case 6:h(4)}!(n&&n.c&&n.c.bRUR&&n.c.bRUR(t))&&o.call(e,t),n&&n.c&&n.c.eRUR&&n.c.eRUR(t),7==r&&(n&&(n=this.oT.oRUR=null),h(t.drag.click||t.drag.long?46:62))},this,i)},t.toClick=function(t){return{dblClick:t.drag&&(t.drag.long||1!=t.drag.click)||!1,button:a.e2B(t),modifiers:a.ModK(t)}},t.prototype.toClick=function(t,o){},t.prototype.onA=function(t,o){if(t){a.H.VisitA(this,t),this.inv();var e=p(this.getHost());e&&e.Refresh&&e.Refresh(),this.onanchorclick(t)}},t.prototype.onClick=function(o){var e=t.toClick(o),i=this.e2V(o),n=this.gPtr(o);i&&(e.view=i,i.toClick&&i.toClick(o,e)),this.onA(this.p2A(n),e),this.onclick(e)},t.prototype.onclick=function(t){this.oLts.onclick.do(t)},t.prototype.onanchorclick=function(t){this.oLts.onanchorclick.do(t)},t.prototype.onDblClk=function(t){this.gAA().CanDo(t,2,"d2")&&this.setTimeout(function(){this.d2(!0)})},t.prototype.ond2=function(){this.oLts.ond2.do()},t.prototype.isD2V=function(){var t=this.getHost().oHE;return t&&~t.className.indexOf(y)||!1},t.prototype.d2=function(t){function o(t){for(var o=a.CSSzom(t),e=a.Ert(t),i=0;i<4;i++)e[i]*=o;return e}function e(t){var e,i,n,r,s=this.getHost(),l=s.oHE;l&&(t=!!t,!!this.isD2V(t)!=t&&(this.grtD2(s),l.className=t?function(t){return h(c(t,d),y)}(l.className):function(t){return h(c(t,y),d)}(l.className),t&&(e=o(this.GetCanvas()),i=o(l),n=this.getAlign(),i=a.G.C2R(a.G.R2C(e,n[0]),i[2],i[3],n[1]),a.FRt(i,a.pgrt()),(r=l.style).left=a.toU(i[0]),r.top=a.toU(i[1]))))}!t||!(v?0:v=1+a.Tick()%3321)&&!function(){var t="pmgi",o=a[t+="rwi"].call(a);return!(a.iL()&&(!o||!o.k))}()||(v+=v>>2)%4||(t=!1),e.call(this,t)},t.prototype.onclear=function(){this.d2(!1),this.oLts.onclear.do()},t.prototype.clear=function(){var t=this.getHost();this.bU(),this.SetLabel(""),t.sCB&&t.sCB(!0,this),this.eU()},t.prototype.e2RUR=function(t){var o=this.gPtr(t),e=this.e2W(t)||this.oW,i=e.GetClientRect();return{w:e,c:e.oC,x:f.X(o)-i[0],y:f.Y(o)-i[1]}},t.prototype.allowRur=function(t,o){return r(t)},t.prototype.rurAction=function(t,o,e){var i={rurName:t,rurFlags:o,rurOnlyW:this.e2W(e),rurStatus:function(o){this.rurActionClick(t,o)}};if(this.allowRur(e,i)){var n="rur"+a.getP(function(t){for(var o,e="",i=0,n=t.length;i=o[e])for(;t>=o[e+1]&&e"+t+":"+(e(this.gCtx().fontHeight())+2)+" "+o),o},t.prototype.isDef=function(){return this==this.oT.oCV},t.prototype.GetAllowDrop=function(){return this.oO.allowDrop},t.prototype.SetAllowDrop=function(t){this.oO.allowDrop=t},t.prototype.getAllowDrop=function(){return this.opt("allowDrop",!1)},t.prototype.GetTfi=function(){return this.oO.tfi},t.prototype.SetTfi=function(t){this.cwbU(),this.oO.tfi=t||null,this.nFH=0,this.onRL(),this.cweU()},t.prototype.getTfi=function(){return this.opt("tfi")},t.prototype.getFH=function(){return this.nFH||(this.nFH=function(){return this.ctxTfi(function(t){return t.fontHeight()})}.call(this))},t.prototype.ctxTfi=function(t,o,e){var i,n;return(e=e||this.gCtx())&&(i=a.TFI.bCTX(e,this.getTfi()),n=t.call(o||this,e),a.TFI.eCTX(e,i)),n},t.prototype.getFont=function(){return this.ctxTfi(function(t){return a.GetFont(t)})},t.prototype.GetLocked=function(){return this.oO.locked},t.prototype.SetLocked=function(t){this.cwbU(),this.oO.locked=t,this.onRL(),this.cweU()},t.prototype.getLocked=function(){return this.opt("locked",!1)},t.prototype.GetReadOnly=function(){return this.oO.readOnly},t.prototype.SetReadOnly=function(t){this.cwbU(),this.oAA=null,this.oO.readOnly=t,this.onRL(),this.uH(),this.cweU()},t.prototype.isReadOnly=function(){return this.opt("readOnly",!1)},t.prototype.GetShapes=function(){return this.oO.shapes},t.prototype.SetShapes=function(t){this.cwbU(),this.sShs=null,this.oO.shapes=t,this.onRL(),this.cweU()},t.prototype.defShp=function(){return'Button(button),{"normal":{"text":"▼"},"hover":{"fillColor":"#B2B2B2"}}(button),{"normal":{"text":"✖"}}(clear)'},t.prototype.getShapes=function(){var t=this.sShs;return s(t)&&(s(t=this.GetShapes())&&(t=a.Def.ComboBox.shapes),t=a.ToS(t,this.defShp()),this.sShs=t),t},t.prototype.toShapes=function(o){return o&&a.S.GetOf(o.GetShape&&o.GetShape()||t.typeOf(o),this.getShapes(),"ComboBox")||null},t.prototype.toShape=function(t,o){var e=this.toShapes(t),i=e&&e.normal||e;return i&&o&&e&&e.disabled&&(i=a.Inh(e.disabled,i)),i},t.prototype.GetCursors=function(){return this.oO.cursors},t.prototype.SetCursors=function(t){this.cwbU(),this.sCrs=null,this.oO.cursors=t,this.onRL(),this.cweU()},t.prototype.defCrs=function(){return"pointer(drag-drop,button,clear,anchor)"},t.prototype.getCursors=function(){var t=this.sCrs;return s(t)&&(s(t=this.GetCursors())&&(t=a.Def.ComboBox.cursors),t=a.ToS(t,this.defCrs()),this.sCrs=t),t},t.prototype.GetFormatText=function(){return this.oO.formatText},t.prototype.SetFormatText=function(t){this.cwbU(),this.nFT=null,this.oO.formatText=t,this.onRL(),this.cweU()},t.prototype.getFormatText=function(){return s(this.nFT)&&(this.nFT=function(t,o,e){return s(t)?~~e:a.s2F(t,o)}(this.opt("formatText"),a.DrawTextFormatEnum,a.DrawTextFormatEnum.exTextAlignLeft|a.DrawTextFormatEnum.exTextAlignVCenter|a.DrawTextFormatEnum.exTextWordBreak|a.DrawTextFormatEnum.exTextWordEllipsis)),this.nFT},t.prototype.GetPad=function(){return this.oO.pad},t.prototype.SetPad=function(t){this.cwbU(),this.rgPad=null,this.oO.pad=t,this.onRL(),this.cweU()},t.prototype.getPad=function(){return s(this.rgPad)&&(this.rgPad=a.pad2A(this.opt("pad",[2,2]))),this.rgPad},t.prototype.GetAllowActions=function(){return this.oO.allowActions},t.prototype.SetAllowActions=function(t){this.cwbU(),this.oAA=null,this.oO.allowActions=t,this.cweU()},t.prototype.gAA=function(){return this.oAA||(this.oAA=new a.AA(this.opt("allowActions",this.oT.defAA()),this.isReadOnly()?this.oT.roAA():"")),this.oAA},t.prototype.GetToolTipDelay=function(){return this.oO.toolTipDelay},t.prototype.SetToolTipDelay=function(t){this.oO.toolTipDelay=t},t.prototype.getToolTipDelay=function(){return this.opt("toolTipDelay",500)},t.prototype.GetToolTipPopDelay=function(){return this.oO.toolTipPopDelay},t.prototype.SetToolTipPopDelay=function(t){this.oO.toolTipPopDelay=t},t.prototype.getToolTipPopDelay=function(){return this.opt("toolTipPopDelay",5e3)},t.prototype.GetToolTipWidth=function(){return this.oO.toolTipWidth},t.prototype.SetToolTipWidth=function(t){this.oO.toolTipWidth=t},t.prototype.getToolTipWidth=function(){return this.opt("toolTipWidth",-1)},t.prototype.allowTT=function(){return a.TT&&this.getToolTipWidth()&&this.getToolTipPopDelay()},t.prototype.GetLabel=function(){return this.oO.label},t.prototype.SetLabel=function(t){this.bU(),this.oO.label=t,this.eU()},t.prototype.getLabel=function(){var t=this.getHost().oHE;return a.ToS(this.opt("label"))||!t&&"no host is set"||""},t.prototype.GetHost=function(){return this.oO.host},t.prototype.SetHost=function(t){function o(){var t,o,r,s=this.getHost();(t=s.oHE)&&(this.grtD2(s,!0),o=u(s),s.hed=function(t){i=e.call(this,t)}.bind(this),a.win.addEventListener("pointerdown",s.hed),a.win.addEventListener("mousedown",s.hed),s.heu=function(t){if(this.isD2V()){var o,r=e.call(this,t),s=this.getHost();(o=(!i||2!=i.h)&&r.h<0)||(o=!i||i.h<1)||(o=!i||2==i.h&&!a.ModK(t)&&i.x==r.x&&i.y==r.y&&r.s0&&1&this.getShowClearButton()},t.prototype.sCBh=function(){return this.getShowClearButton()>0&&2&this.getShowClearButton()},t.prototype.showCB=function(){var t,o=this.getShowClearButton();return this.isCBr()&&(o=(t=this.getHost()).sCB&&t.sCB(!1,this)),!!o},o.prototype.init=function(t){this.oT=t,this.oLts=t.oLts,this.lI=0},a.SB.addProto(o.prototype),a.SB.addProto(o.prototype,t.prototype,"import,GetClientRect,SetClientRect,onmousemove"),o.prototype.n={s:"button",c:"button"},o.prototype.onSetAO=function(t){if(this.isSelectable()&&!t.hasOf(this)){function o(t,o){return a.PInR(t,o,e.rtB())&&e.isAP(t,o)}var e=this,i=a.Def.ScrollBar.SmoothScroll,n=i.duration,r=i.transition,s=e.toShapes(this.n.s);s&&(!a.EyO(s.hover)&&t.set({owner:e,id:this.idAOH||(this.idAOH={}),inv:e.inv,hitTest:o,duration:n,transition:r}),!a.EyO(s.click)&&t.set({owner:e,id:this.idAOC||(this.idAOC={}),inv:e.inv,hitTest:o,actOn:4,duration:n,transition:r}))}},o.prototype.draw=function(t,o,e){this.drawB(t,this.rtB(),this.gAO())},o.prototype.drawB=function(t,o,e){var i,n=this.toShapes(this.n.s)||{},r=n.normal||n;!this.isSelectable()?a.EyO(n.disabled)||(r=a.Inh(n.disabled,r)):e&&(a.EyO(n.hover)||(i=e.get(this,this.idAOH))&&(r=a.R.Shape(i.state,i.range,{from:r,to:n.hover})),a.EyO(n.click)||(i=e.get(this,this.idAOC))&&(r=a.R.Shape(i.state,i.range,{from:r,to:n.click})));var s=a.ComboBox.bSCTX(t,r,o);s&&a.ComboBox.eSCTX(t,s)},o.prototype.rtB=function(){var t=this.GetClientRect(),o=n(t[2],t[3])-2;return a.G.C2R(a.G.R2C(t),o,o)},o.prototype.isSelectable=function(){return a.SB.prototype.isSelectable.call(this)&&this.gAA().Has("d2")},o.prototype.getCursor=function(t){return this.isSelectable()&&a.PInR(f.X(t),f.Y(t),this.rtB())&&a.GP.Get(this.n.c,this.getCursors())||null},o.prototype.allowTT=function(){},o.prototype.dCV=function(){return this.oT.oCV},o.prototype.ondown=function(t){return this.dCV().ondown(t)},o.prototype.rurD2=function(t,o){var e,i,n=this.gPtr(t);a.PInR(f.X(n),f.Y(n),this.rtB())&&a.RUC(t,function(t){t.drag.click&&(i=this.dCV(),e=!i.isD2V(),i.d2(e),e&&i.ond2())},this)},Object.addPrototypeOf(C.prototype,o.prototype),C.prototype.n={s:"clear",c:"clear"},C.prototype.isSelectable=function(){return a.SB.prototype.isSelectable.call(this)},C.prototype.ondown=function(t){var o,e=this.gPtr(t);a.PInR(f.X(e),f.Y(e),this.rtB())&&a.RUC(t,function(t){t.drag.click&&((o=this.dCV()).clear(),o.getHost().sel=-1,o.Refresh(),o.onclear())},this)},{CV:t,D2B:o,CB:C}}()),t.ComboBox=a.ComboBox});