!function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t,n){const o=n(1);function i(e,t,n,o,i,s){const r=c(e.currentTarget),u=e.target.value,p=u.length;let g="",f=r.end;const h=u.substr(0,r.end);if(g=u.substr(r.end,p),void 0!==i){let n=h.split(" "),r=0;if(r=n.includes("")?n[n.length-2]:n[n.length-1],t[i]=t[r],void 0===r)return void console.log("last word before cursor end is not defined");f-=r.length;let u=!1;n.includes("")?n[n.length-2]=i:(u=!0,n[n.length-1]=i),n=n.join(" "),f+=i.length,n+=g,u&&(f++,n+=" "),o.val(d(n)),a(e.currentTarget,f),$(s+" .btn, #InputSuggestions .suggestion-btn").removeClass("btn-success"),$(this).addClass("btn-success"),l()}}function l(){null!==document.getElementById("InputSuggestions")&&document.getElementById("InputSuggestions").remove()}function s(e,t){for(let n in e){const o=e[n];void 0!==o.classList&&o.classList.contains(t)&&o.classList.remove(t)}}function r(e,t){void 0!==e&&e.classList.add(t)}function u(e,t,n,o,i){n.innerHTML="";let l=0,u=0;e.forEach(function(e){u++,l+=25;const t=document.createElement("button");t.setAttribute("value",e[0]),t.innerHTML=e[1],t.classList.add("suggestion-btn"),t.style.height="25px",t.style.display="block",t.style.backgroundColor="#fefefe",t.style.border="0px",t.style.width="100%",t.style.fontSize="15px",t.style.textAlign="left",1===u&&t.classList.add("selected"),n.append(t),n.style.height=l+"px"}),n.remove();const c=t[0],a=function(e){let t={x:0,y:0};const n=function(e,t,n){let o=document.createElement("div");o.id="input-textarea-caret-position-mirror-div",document.body.appendChild(o);let i=o.style,l=window.getComputedStyle?getComputedStyle(e):e.currentStyle;i.whiteSpace="pre-wrap","INPUT"!==e.nodeName&&(i.wordWrap="break-word");i.position="absolute",i.visibility="hidden",p.forEach(function(e){i[e]=l[e]}),g?(i.width=parseInt(l.width)-2+"px",e.scrollHeight>parseInt(l.height)&&(i.overflowY="scroll")):i.overflow="hidden";o.textContent=e.value.substring(0,t),"INPUT"===e.nodeName&&(o.textContent=o.textContent.replace(/\s/g,"Â "));let s=document.createElement("span");s.textContent=e.value.substring(t)||".",o.appendChild(s);const r={top:s.offsetTop+parseInt(l.borderTopWidth),left:s.offsetLeft+parseInt(l.borderLeftWidth)};return document.body.removeChild(o),r}(e,e.selectionEnd),o=e.style.fontSize.replace("px",""),i=function(e){let t={height:0,width:0};return t.height=e.clientHeight+1,t.width=e.clientWidth+1,t}(e);100*n.left/i.width<70?t.x=n.left:t.x=n.left-50;return t.y=n.top+2*o,t}(c);!function(e,t,n,o,i,l){t.style.position="absolute",t.style.left=o+"px",t.style.top=l+i+"px",t.style.display="block",t.style.border="1px solid #999";const s=e.parentNode;s.style.position="relative",s.appendChild(t)}(c,n,0,a.x,a.y,i);let d=0;$(document).keydown(function(e){const t=document.getElementById("InputSuggestions");if(null===t)return;const n=t.getElementsByTagName("button"),o=n.length,i=document.getElementById("InputSuggestions");if(null!==i&&"block"===i.style.display)switch(e.which){case 39:case 38:e.preventDefault(),-1===--d&&(d=o-1),s(n,"selected"),r(n[d],"selected");break;case 37:case 40:e.preventDefault(),++d===o&&(d=0),s(n,"selected"),r(n[d],"selected")}})}function c(e){let t,n,o,i,l,s=0,r=0;return"number"==typeof e.selectionStart&&"number"==typeof e.selectionEnd?(s=e.selectionStart,r=e.selectionEnd):(n=document.selection.createRange())&&n.parentElement()==e&&(i=e.value.length,t=e.value.replace(/\r\n/g,"\n"),(o=e.createTextRange()).moveToBookmark(n.getBookmark()),(l=e.createTextRange()).collapse(!1),o.compareEndPoints("StartToEnd",l)>-1?s=r=i:(s=-o.moveStart("character",-i),s+=t.slice(0,s).split("\n").length-1,o.compareEndPoints("EndToEnd",l)>-1?r=i:(r=-o.moveEnd("character",-i),r+=t.slice(0,r).split("\n").length-1))),{start:s,end:r}}function a(e,t){let n;e.createTextRange?((n=e.createTextRange()).move("character",t),n.select()):(e.focus(),void 0!==e.selectionStart&&e.setSelectionRange(t,t))}function d(e){let t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue}e.exports={transliterate:function(e){const t=(e=e||{}).inputTextareaIds||"#input_tool, #languageTextarea, #emailContents, #translationTextarea",n=e.inputHelperTool||"#input_tool_helper",s=e.additionalPopUpTopMargin||0;e.debug&&console.log("google transliteration tool",e);const r=e.suggestionPopupAfterSpace||!1,p=e.suggestionPopupOnClick||!1;let g=e.googleInputKeyCode||$("input[name=googleInputKeyCode]").val(),f=$(t);const h=$(n),m=e.maxResult||6;let y=new XMLHttpRequest,v=!1;const b=document.createElement("div");b.id="InputSuggestions";const x=document.createTextNode("Option");f.on("input",function(e){b.remove()}),g||(g="ne-t-i0-und",console.error('Google Input Key Code not defined. So defaulting to Nepali (ne-t-i0-und). Please specify hidden input: '));f.on("keydown",function(e){(function(e){if(71===e.which&&e.ctrlKey)return e.preventDefault(),!0;return!1})(e)&&(v=!v)});let E={};f.on("keyup",function(e){8===e.which&&(h.empty(),v?h.append("English mode enabled. Press (CTRL + G) to switch back."):h.append("Additional options appears here!"))}),f.click(function(e){console.log("1. Backup Google Input 1..."),l();const t=[" ","\n","\r","\t"],i=$(this).val();let r=$(this)[0].selectionStart,c=$(this)[0].selectionEnd;for(;r>0&&-1==t.indexOf(i[r]);)--r;for(++r;cEnglish mode enabled. Press (CTRL + G) to switch back.");if(32===e.which||229===e.which||8===e.which){let t=$(this).val().split(" "),p=!1,v="",T=0;const I=c(e.currentTarget),w=e.target.value,S=w.length;let C=null;if(8===e.which){I.end;let e=t[t.length-1];if(void 0===(C=E[e]))return}else C=t[t.length-2];if(null===C)return;if(I.end!==S){T=I.end;const e=w.substr(0,I.end);v=w.substr(I.end,S),p=!0,t=e.split(" "),C=t[t.length-2],T-=C.length}o(y,C,g,m).then(function(o){o.forEach(function(e){E[e[0]]=C});const c=C.match(/[A-Za-z0-9\u00C0-\u024F\u1E00-\u1EFF]+/)[0];o.push([C,c]),h.empty();let g=0;o.forEach(function(e){g++;const t=document.createElement("button");t.setAttribute("value",e[0]),t.innerHTML=e[1],t.classList.add("btn"),1===g&&t.classList.add("btn-success"),h.append(t)}),!0===r&&u(o,f,b,x,s),f.on("keydown",function(t){if($("#InputSuggestions .selected")&&"Enter"===t.key){const o=document.getElementById("InputSuggestions");null!==o&&"block"===o.style.display&&t.preventDefault();const s=document.getElementById("InputSuggestions");if(null===s)return;const r=s.getElementsByClassName("selected");if(void 0===r||void 0===r[0])return;const u=r[0];i(e,E,C,f,void 0!==u.value?u.value:u.innerHTML,n),l()}}),$(n+" .btn, #InputSuggestions .suggestion-btn").on("click",function(t){i(e,E,C,f,""!==this.value?this.value:this.innerHTML,n)}),8===e.which?t[t.length-1]=o[0][0]:t[t.length-2]=o[0][0],t=t.join(" "),!0===p&&(T+=o[0][0].length,t+=v),E[o[0][0]]=C,f.val(d(t)),!0===p&&a(e.currentTarget,T)})}else h.empty(),v?h.append("English mode enabled. Press (CTRL + G) to switch back."):h.append("Additional options appears here!")})}};let p=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing"],g=!(null==window.mozInnerScreenX)},function(e,t,n){"use strict";e.exports=function(e,t,n,o){return new Promise(function(i,l){const s=t.match(/[A-Za-z0-9\u00C0-\u024F\u1E00-\u1EFF]+/);if(null===s)return;const r=s[0],u=t.split(r),c=u[0],a=u[1];let d=encodeURI("https://inputtools.google.com/request?text="+r+"&itc="+n+"&num="+o+"&cp=0&cs=1&ie=utf-8&oe=utf-8&app=demopage");e.open("GET",d),e.onreadystatechange=function(){if(e.readyState===e.DONE)if(200===e.status){const e=JSON.parse(this.responseText);if(void 0===e[1]||void 0===e[1][0])return;const t=e[1][0][1];i(t.map(e=>[c+e+a,e]))}else l("Rejected status code: "+e.status)},e.onerror=function(){l(Error("Network Error"))},e.send()})}},,,,function(e,t,n){e.exports=n(6)},function(e,t,n){const o=n(0);let i=document.getElementById("input_tool"),l=document.getElementById("languageTextarea"),s=document.getElementsByName("screenType"),r=document.getElementsByName("googleInputKeyCode"),u="",c=5,a=!1,d=!1;s.length>0&&"desktop"===s[0].value&&(d=!0),i&&r.length>0&&!1===d&&(u=r[0].value,o.transliterate({inputTextareaIds:"#"+i.id,inputHelperTool:"#input_tool_helper",googleInputKeyCode:u,suggestionPopupOnClick:!0,suggestionPopupAfterSpace:a,additionalPopUpTopMargin:25,maxResult:c})),l&&r.length>0&&!1===d&&(u=r[0].value,o.transliterate({inputTextareaIds:"#"+l.id,inputHelperTool:"#input_tool_helper",googleInputKeyCode:u,suggestionPopupOnClick:!0,suggestionPopupAfterSpace:a,additionalPopUpTopMargin:25,maxResult:c})),l&&r.length>0&&!0===d&&(u=r[0].value,a=!0,c=6,o.transliterate({inputTextareaIds:"#"+l.id,inputHelperTool:"#input_tool_helper",googleInputKeyCode:u,suggestionPopupOnClick:!0,suggestionPopupAfterSpace:a,additionalPopUpTopMargin:25,maxResult:c}))}]);