/*! jQuery UI Virtual Keyboard v1.30.2 */ !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(h){"use strict";var b=h.keyboard=function(c,o){var p,y=this;y.version="1.30.2",y.$el=h(c),y.el=c,y.$el.data("keyboard",y),y.init=function(){y.initialized=!1,y.isTextArea="textarea"===y.el.nodeName.toLowerCase(),y.isInput="input"===y.el.nodeName.toLowerCase(),y.isContentEditable=!y.isTextArea&&!y.isInput&&y.el.isContentEditable;var e,t,a,i=b.css,n=b.events;if(y.isInput&&h.inArray((y.el.type||"").toLowerCase(),b.supportedInputTypes)<0)throw new TypeError('Input of type "'+y.el.type+'" is not supported; use type text, search, URL, tel or password');y.settings=o||{},o&&o.position&&(t=h.extend({},o.position),o.position=null),y.options=p=h.extend(!0,{},b.defaultOptions,o),t&&(p.position=t,o.position=t),y.el.active=!0,y.namespace=".keyboard"+Math.random().toString(16).slice(2),y.extensionNamespace=[],y.shiftActive=y.altActive=y.metaActive=y.sets=y.capsLock=!1,y.rows=["","-shift","-alt","-alt-shift"],y.inPlaceholder=y.$el.attr("placeholder")||"",y.watermark=b.watermark&&""!==y.inPlaceholder,y.repeatTime=1e3/(p.repeatRate||20),p.preventDoubleEventTime=p.preventDoubleEventTime||100,y.isOpen=!1,y.wheel="function"==typeof h.fn.mousewheel,y.escapeRegex=/[-\/\\^$*+?.()|[\]{}]/g,e=b.keyCodes,y.alwaysAllowed=[e.capsLock,e.pageUp,e.pageDown,e.end,e.home,e.left,e.up,e.right,e.down,e.insert,e.delete],y.$keyboard=[],y.enabled=!0,y.checkCaret=p.lockInput||b.checkCaretSupport(),y.isContentEditable&&(p.usePreview=!1),y.last={start:0,end:0,key:"",val:"",preVal:"",layout:"",virtual:!0,keyset:[!1,!1,!1],wheel_$Keys:[],wheelIndex:0,wheelLayers:[]},y.temp=["",0,0],h.each([n.kbInit,n.kbBeforeVisible,n.kbVisible,n.kbHidden,n.inputCanceled,n.inputAccepted,n.kbBeforeClose,n.inputRestricted],function(e,t){"function"==typeof p[t]&&y.$el.bind(t+y.namespace+"callbacks",p[t])}),p.alwaysOpen&&(p.stayOpen=!0),a=h(document),y.el.ownerDocument!==document&&(a=a.add(y.el.ownerDocument));var s="keyup checkkeyboard mousedown touchstart ";p.closeByClickEvent&&(s+="click "),a.bind(s.split(" ").join(y.namespace+" "),function(e){clearTimeout(y.timer3),y.timer3=setTimeout(function(){y.checkClose(e)},1)}),y.$el.addClass(i.input+" "+p.css.input).attr({"aria-haspopup":"true",role:"textbox"}),(p.lockInput||y.el.readOnly)&&(p.lockInput=!0,y.$el.addClass(i.locked).attr({readonly:"readonly"})),y.isUnavailable()&&y.$el.addClass(i.noKeyboard),p.openOn&&y.bindFocus(),y.watermark||""!==y.getValue(y.$el)||""===y.inPlaceholder||""===y.$el.attr("placeholder")||(y.$el.addClass(i.placeholder),y.setValue(y.inPlaceholder,y.$el)),y.$el.trigger(n.kbInit,[y,y.el]),p.alwaysOpen&&y.reveal(),y.initialized=!0},y.toggle=function(){if(y.hasKeyboard()){var e=y.$keyboard.find("."+b.css.keyToggle),t=!y.enabled;return y.preview.readonly=t||y.options.lockInput,y.$keyboard.toggleClass(b.css.keyDisabled,t).find("."+b.css.keyButton).not(e).attr("aria-disabled",t).each(function(){this.disabled=t}),e.toggleClass(b.css.keyDisabled,t),t&&y.typing_options&&(y.typing_options.text=""),y}},y.setCurrent=function(){var e=b.css,t=h("."+e.isCurrent),a=t.data("keyboard");h.isEmptyObject(a)||a.el===y.el||a.close(!!a.options.autoAccept&&"true"),t.removeClass(e.isCurrent),h("."+e.hasFocus).removeClass(e.hasFocus),y.$el.addClass(e.isCurrent),y.$preview.focus(),y.$keyboard.addClass(e.hasFocus),y.isCurrent(!0),y.isOpen=!0},y.isUnavailable=function(){return y.$el.is(":disabled")||!y.options.activeOnReadonly&&y.$el.attr("readonly")&&!y.$el.hasClass(b.css.locked)},y.isCurrent=function(e){var t=b.currentKeyboard||!1;return e?t=b.currentKeyboard=y.el:!1===e&&t===y.el&&(t=b.currentKeyboard=""),t===y.el},y.hasKeyboard=function(){return y.$keyboard&&0").addClass(n.wrapper).append(y.$preview).prependTo(y.$keyboard)}else y.$preview=y.$el,y.preview=y.el},y.caret=function(e,t){var a=b.caret(y.$preview,e,t);return a instanceof h?(y.saveCaret(a.start,a.end),y):a},y.saveCaret=function(e,t,a){var i;y.isCurrent()&&(i=void 0===e?b.caret(a||y.$preview):b.caret(a||y.$preview,e,t),y.last.start=void 0===e?i.start:e,y.last.end=void 0===t?i.end:t)},y.saveLastChange=function(e){y.last.val=e||y.getValue(y.$preview||y.$el),y.isContentEditable&&(y.last.elms=y.el.cloneNode(!0))},y.setScroll=function(){if(!y.isContentEditable&&y.last.virtual){var e,t,a,i,n=y.last.val.substring(0,Math.max(y.last.start,y.last.end));y.$previewCopy||(y.$previewCopy=y.$preview.clone().removeAttr("id").css({position:"absolute",left:0,zIndex:-10,visibility:"hidden"}).addClass(b.css.inputClone),y.$previewCopy[0].disabled=!0,y.isTextArea||y.$previewCopy.css({"white-space":"pre",width:0}),p.usePreview?y.$preview.after(y.$previewCopy):y.$keyboard.prepend(y.$previewCopy)),y.isTextArea?(y.$previewCopy.height(y.lineHeight).val(n),y.preview.scrollTop=y.lineHeight*(Math.floor(y.$previewCopy[0].scrollHeight/y.lineHeight)-1)):(y.$previewCopy.val(n.replace(/\s/g," ")),a=/c/i.test(p.scrollAdjustment)?y.preview.clientWidth/2:p.scrollAdjustment,e=y.$previewCopy[0].scrollWidth-1,void 0===y.last.scrollWidth&&(y.last.scrollWidth=e,y.last.direction=!0),i=y.last.scrollWidth===e?y.last.direction:y.last.scrollWidth=y.preview.scrollWidth-t?y.preview.scrollLeft=y.preview.scrollWidth-a:y.preview.scrollLeft=0=o.A&&t<=o.Z,i=t>=o.a&&t<=o.z,n=y.last.key=String.fromCharCode(t);if(!(t=o.X&&e.which<=o.Z))return;r.hasMappedKeys&&r.mappedKeys.hasOwnProperty(n)&&(y.last.key=r.mappedKeys[n],y.insertText(y.last.key),e.preventDefault()),"function"==typeof p.beforeInsert&&(y.insertText(y.last.key),e.preventDefault()),y.checkMaxLength()}}}).bind("keyup"+e,function(e){if(y.isCurrent()){switch(y.last.virtual=!1,e.which){case o.tab:if(y.tab&&!p.lockInput){y.shiftActive=e.shiftKey;var t=b.keyaction.tab(y);if(y.tab=!1,!t)return!1}else e.preventDefault();break;case o.escape:return p.ignoreEsc||y.close(!(!p.autoAccept||!p.autoAcceptOnEsc)&&"true"),!1}clearTimeout(y.throttled),y.throttled=setTimeout(function(){y&&y.isVisible()&&y.checkCombos()},100),y.checkMaxLength(),y.last.preVal=""+y.last.val,y.saveLastChange();var a=h.Event(b.events.kbChange);if(a.action=y.last.key,y.$el.trigger(a,[y,y.el]),"function"==typeof p.change)return a.type=b.events.inputChange,p.change(a,y,y.el),!1;p.acceptValid&&p.autoAcceptOnValid&&"function"==typeof p.validate&&p.validate(y,y.getValue(y.$preview))&&(y.$preview.blur(),y.accept())}}).bind("keydown"+e,function(e){if(y.last.keyPress=e.which,p.alwaysOpen&&!y.isCurrent()&&y.reveal(),e.which===o.tab)return!(y.tab=!0);if(p.lockInput||e.timeStamp===y.last.timeStamp)return!p.lockInput;switch(y.last.timeStamp=e.timeStamp,y.last.virtual=!1,e.which){case o.backSpace:b.keyaction.bksp(y,null,e),e.preventDefault();break;case o.enter:b.keyaction.enter(y,null,e);break;case o.capsLock:y.shiftActive=y.capsLock=!y.capsLock,y.showSet();break;case o.V:if(e.ctrlKey||e.metaKey){if(p.preventPaste)return void e.preventDefault();y.checkCombos()}}}).bind("mouseup touchend ".split(" ").join(e+" "),function(){y.last.virtual=!0,y.saveCaret()}),y.$keyboard.bind("mousedown click touchstart ".split(" ").join(y.namespace+" "),function(e){e.stopPropagation(),y.isCurrent()||(y.reveal(),h(y.el.ownerDocument).trigger("checkkeyboard"+y.namespace)),y.setFocus()}),p.preventPaste&&(y.$preview.bind("contextmenu"+y.namespace,function(e){e.preventDefault()}),y.$el.bind("contextmenu"+y.namespace,function(e){e.preventDefault()}))},y.bindButton=function(e,t){var a="."+b.css.keyButton,i=function(e){e.stopPropagation(),e.$target=h(this).closest("."+b.css.keyboard+", ."+b.css.input),t.call(this,e)};return h.fn.on?y.$keyboard.on(e,a,i):h.fn.delegate&&y.$keyboard.delegate(a,e,i),y},y.unbindButton=function(e){return h.fn.off?y.$keyboard.off(e):h.fn.undelegate&&y.$keyboard.undelegate("."+b.css.keyButton,e),y},y.bindKeys=function(){var s=b.css;y.unbindButton(y.namespace+" "+y.namespace+"kb").bindButton("mouseenter mouseleave touchstart ".split(" ").join(y.namespace+" "),function(e){if(!p.alwaysOpen&&!p.userClosed||"mouseleave"===e.type||y.isCurrent()||(y.reveal(),y.setFocus()),y.isCurrent()&&!this.disabled){var t,a,i=y.last,n=h(this),s=e.type;p.useWheel&&y.wheel&&(t=y.getLayers(n),a=(t.length?t.map(function(){return h(this).attr("data-value")||""}).get():"")||[n.text()],i.wheel_$Keys=t,i.wheelLayers=a,i.wheelIndex=h.inArray(n.attr("data-value"),a)),"mouseenter"!==s&&"touchstart"!==s||"password"===y.el.type||n.hasClass(p.css.buttonDisabled)||(n.addClass(p.css.buttonHover),p.useWheel&&y.wheel&&n.attr("title",function(e,t){return y.wheel&&""===t&&y.sets&&1=t.left&&e.originalEvent.touches[0].pageX=t.top&&e.originalEvent.touches[0].pageYn.length-1&&(i=0),i<0&&(i=n.length-1)):i=0,y.last.wheelIndex=i,a.html(n[i]),!1}},30)).bindButton("mousedown touchstart ".split(" ").join(y.namespace+"kb "),function(){var e=h(this);if(e&&(!e.hasClass(s.keyAction)||e.is("."+s.keyPrefix+"tab bksp space enter".split(" ").join(",."+s.keyPrefix))))return 0!==p.repeatRate&&(y.mouseRepeat=[!0,e],setTimeout(function(){y&&y.mouseRepeat[0]&&y.mouseRepeat[1]===e&&!e[0].disabled&&y.repeatKey(e)},p.repeatDelay)),!1})},y.throttleEvent=function(e,t){var a;return function(){a||(e.apply(this,arguments),a=!0,setTimeout(function(){a=!1},t))}},y.execCommand=function(e,t){y.el.ownerDocument.execCommand(e,!1,t),y.el.normalize(),p.reposition&&y.reposition()},y.getValue=function(e){return(e=e||y.$preview)[y.isContentEditable?"text":"val"]()},y.setValue=function(e,t){return t=t||y.$preview,y.isContentEditable?e!==t.text()&&(b.replaceContent(t,e),y.saveCaret()):t.val(e),y},y.insertText=function(e){if(!y.$preview)return y;if("function"==typeof p.beforeInsert&&(e=p.beforeInsert(y.last.event,y,y.el,e)),void 0===e||!1===e)return y.last.key="",y;if(y.isContentEditable)return y.insertContentEditable(e);var t,a=!1,i="\b"===e,n=y.getValue(),s=b.caret(y.$preview),o=n.length;return s.endo&&(s.end=s.start=o),y.isTextArea&&b.msie&&"\n"===n.substring(s.start,s.start+1)&&(s.start+=1,s.end+=1),t=s.start,"{d}"===e&&(e="",s.end+=1),i&&(e="",a=i&&t===s.end&&0p.maxLength&&(e=b.caret(y.$preview).start,t=Math.min(e,p.maxLength),p.maxInsert||(a=y.last.val,t=e-1),y.setValue(a.substring(0,p.maxLength)),y.saveCaret(t,t)),y.$decBtn.length&&y.checkDecimal(),y}},y.repeatKey=function(e){e.trigger(b.events.kbRepeater),y.mouseRepeat[0]&&(y.repeater=setTimeout(function(){y&&y.repeatKey(e)},y.repeatTime))},y.getKeySet=function(){var e=[];return y.altActive&&e.push("alt"),y.shiftActive&&e.push("shift"),y.metaActive&&e.push(y.metaActive),e.length?e.join("+"):"normal"},y.showKeySet=function(e){return"string"==typeof e?(y.last.keyset=[y.shiftActive,y.altActive,y.metaActive],y.shiftActive=/shift/i.test(e),y.altActive=/alt/i.test(e),/\bmeta/.test(e)?(y.metaActive=!0,y.showSet(e.match(/\bmeta[\w-]+/i)[0])):(y.metaActive=!1,y.showSet())):y.showSet(e),y},y.showSet=function(e){if(y.hasKeyboard()){p=y.options;var t=b.css,a="."+t.keyPrefix,i=p.css.buttonActive,n="",s=(y.shiftActive?1:0)+(y.altActive?2:0);if(y.shiftActive||(y.capsLock=!1),y.metaActive?(y.shiftActive&&(e=(e||"").replace("-shift","")),y.altActive&&(e=(e||"").replace("-alt","")),""===(n=/^meta/i.test(e)?e:"")?n=!0===y.metaActive?"":y.metaActive:y.metaActive=n,(!p.stickyShift&&y.last.keyset[2]!==y.metaActive||(y.shiftActive||y.altActive)&&!y.$keyboard.find("."+t.keySet+"-"+n+y.rows[s]).length)&&(y.shiftActive=y.altActive=!1)):!p.stickyShift&&y.last.keyset[2]!==y.metaActive&&y.shiftActive&&(y.shiftActive=y.altActive=!1),n=0!==(s=(y.shiftActive?1:0)+(y.altActive?2:0))||y.metaActive?""===n?"":"-"+n:"-normal",!y.$keyboard.find("."+t.keySet+n+y.rows[s]).length)return y.shiftActive=y.last.keyset[0],y.altActive=y.last.keyset[1],void(y.metaActive=y.last.keyset[2]);y.$keyboard.find(a+"alt,"+a+"shift,."+t.keyAction+"[class*=meta]").removeClass(i).end().find(a+"alt").toggleClass(i,y.altActive).end().find(a+"shift").toggleClass(i,y.shiftActive).end().find(a+"lock").toggleClass(i,y.capsLock).end().find("."+t.keySet).hide().end().find("."+(t.keyAction+a+n).replace("--","-")).addClass(i),y.$keyboard.find("."+t.keySet+n+y.rows[s])[0].style.display="inline-block",y.metaActive&&y.$keyboard.find(a+y.metaActive).toggleClass(i,!1!==y.metaActive),y.last.keyset=[y.shiftActive,y.altActive,y.metaActive],y.$el.trigger(b.events.kbKeysetChange,[y,y.el]),p.reposition&&y.reposition()}},y.checkCombos=function(){if(!(y.isVisible()||y.hasKeyboard()&&y.$keyboard.hasClass(b.css.hasFocus)))return y.getValue(y.$preview||y.$el);var e,t,a,i,n=y.getValue(),s=b.caret(y.$preview),o=b.builtLayouts[y.layout],r=y.isContentEditable?b.getEditableLength(y.el):n.length,l=r;return""===n||(s.endl&&(s.end=s.start=l),b.msie&&"\n"===n.substring(s.start,s.start+1)&&(s.start+=1,s.end+=1),p.useCombos&&(b.msie?n=n.replace(y.regex,function(e,t,a){return p.combos.hasOwnProperty(t)&&p.combos[t][a]||e}):y.$preview.length&&(t=s.start-(0<=s.start-2?2:0),b.caret(y.$preview,t,s.end),a=(i=function(e){return(e||"").replace(y.regex,function(e,t,a){return p.combos.hasOwnProperty(t)&&p.combos[t][a]||e})})((t=b.caret(y.$preview)).text),t&&t.replaceStr&&a!==t.text&&(y.isContentEditable?b.replaceContent(c,i):y.setValue(t.replaceStr(a))),n=y.getValue())),p.restrictInput&&""!==n&&(t=o.acceptedKeys.length,(e=o.acceptedKeysRegex)||(a=h.map(o.acceptedKeys,function(e){return e.replace(y.escapeRegex,"\\$&")}),-1n.length-1&&(i=p.stopAtEnd,s=0),s<0&&(i=p.stopAtEnd,s=n.length-1),!i){if(!(t=y.close(t)))return;(a=n.eq(s).data("keyboard"))&&a.options.openOn.length?a.focusOn():n.eq(s).focus()}}return!1},y.close=function(e){if(y.isOpen&&y.$keyboard.length){clearTimeout(y.throttled);var t=b.css,a=b.events,i=e?y.checkCombos():y.originalContent;if(e&&"function"==typeof p.validate&&!p.validate(y,i,!0)&&(i=y.originalContent,e=!1,p.cancelClose))return;y.isCurrent(!1),y.isOpen=p.alwaysOpen||p.userClosed,y.isContentEditable&&!e?y.$el.html(i):y.setValue(i,y.$el),y.$el.removeClass(t.isCurrent+" "+t.inputAutoAccepted).addClass(e?!0===e?"":t.inputAutoAccepted:"").trigger(a.inputChange),p.alwaysOpen||y.$el.trigger(a.kbBeforeClose,[y,y.el,e||!1]),b.caret(y.$preview,y.last),y.$el.trigger(e?a.inputAccepted:a.inputCanceled,[y,y.el]).trigger(p.alwaysOpen?a.kbInactive:a.kbHidden,[y,y.el]).blur(),y&&(y.last.eventTime=(new Date).getTime(),p.alwaysOpen||p.userClosed&&"true"===e||!y.$keyboard.length||(y.removeKeyboard(),y.timer=setTimeout(function(){y&&y.bindFocus()},200)),y.watermark||""!==y.el.value||""===y.inPlaceholder||(y.$el.addClass(t.placeholder),y.setValue(y.inPlaceholder,y.$el)))}return!!e},y.accept=function(){return y.close(!0)},y.checkClose=function(e){if(!y.opening){var t=h.keyboard.css,a=e.$target||h(e.target).closest("."+b.css.keyboard+", ."+b.css.input);if(a.length||(a=h(e.target)),a.length&&a.hasClass(t.keyboard)){var i=a.data("keyboard");i!==y&&!i.$el.hasClass(t.isCurrent)&&i.options.openOn&&e.type===p.openOn&&i.focusOn()}else y.escClose(e,a)}},y.escCloseCallback={keepOpen:function(){return!y.isOpen}},y.escClose=function(e,t){if(y.isOpen){if(e&&"keyup"===e.type)return e.which!==b.keyCodes.escape||p.ignoreEsc?"":y.close(!(!p.autoAccept||!p.autoAcceptOnEsc)&&"true");var a=!1,i=t.length&&t||h(e.target);if(h.each(y.escCloseCallback,function(e,t){"function"==typeof t&&(a=a||t(i))}),!a&&(!y.isCurrent()&&y.isOpen||y.isOpen&&i[0]!==y.el)){if((p.stayOpen||p.userClosed)&&!i.hasClass(b.css.input))return;if(b.allie&&e.preventDefault(),p.closeByClickEvent){var n=i[0]&&i[0].nodeName.toLowerCase();"input"!==n&&"textarea"!==n&&"click"!==e.type||y.close(!!p.autoAccept&&"true")}else y.close(!!p.autoAccept&&"true")}}},y.keyBtn=h("