//>>built
define("dojox/string/BidiComplex","dojo/_base/kernel dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/sniff dojo/keys".split(" "),function(t,u,p,m,l,k){t.experimental("dojox.string.BidiComplex");var e=u.getObject("string.BidiComplex",!0,dojox),q=[];e.attachInput=function(a,c){a.alt=c;m.connect(a,"onkeydown",this,"_ceKeyDown");m.connect(a,"onkeyup",this,"_ceKeyUp");m.connect(a,"oncut",this,"_ceCutText");m.connect(a,"oncopy",this,"_ceCopyText");a.value=e.createDisplayString(a.value,a.alt)};
e.createDisplayString=function(a,c){a=e.stripSpecialCharacters(a);var f=e._parse(a,c),b="\u202a"+a,g=1;p.forEach(f,function(d){if(null!=d){var h=b.substring(0,d+g);d=b.substring(d+g,b.length);b=h+"\u200e"+d;g++}});return b};e.stripSpecialCharacters=function(a){return a.replace(/[\u200E\u200F\u202A-\u202E]/g,"")};e._ceKeyDown=function(a){q=(l("ie")?a.srcElement:a.target).value};e._ceKeyUp=function(a){var c=l("ie")?a.srcElement:a.target,f=c.value,b=a.keyCode;if(b!=k.HOME&&b!=k.END&&b!=k.SHIFT){if(a=
e._getCaretPos(a,c)){var g=a[0];var d=a[1]}if(l("ie")){a=g;var h=d;if(b==k.LEFT_ARROW){"\u200e"==f.charAt(d-1)&&g==d&&e._setSelectedRange(c,g-1,d-1);return}if(b==k.RIGHT_ARROW){"\u200e"==f.charAt(d-1)&&(h=d+1,g==d&&(a=g+1));e._setSelectedRange(c,a,h);return}}else{if(b==k.LEFT_ARROW){"\u200e"==f.charAt(d-1)&&e._setSelectedRange(c,g-1,d-1);return}if(b==k.RIGHT_ARROW){"\u200e"==f.charAt(d-1)&&e._setSelectedRange(c,g+1,d+1);return}}a=e.createDisplayString(f,c.alt);f!=a&&(window.status=f+" c\x3d"+d,c.value=
a,b==k.DELETE&&"\u200e"==a.charAt(d)&&(c.value=a.substring(0,d)+a.substring(d+2,a.length)),b==k.DELETE?e._setSelectedRange(c,g,d):b==k.BACKSPACE?q.length>=d&&"\u200e"==q.charAt(d-1)?e._setSelectedRange(c,g-1,d-1):e._setSelectedRange(c,g,d):"\u200e"!=c.value.charAt(d)&&e._setSelectedRange(c,g+1,d+1))}};e._processCopy=function(a,c,f){null==c&&(c=l("ie")?document.selection.createRange().text:a.value.substring(a.selectionStart,a.selectionEnd));a=e.stripSpecialCharacters(c);l("ie")&&window.clipboardData.setData("Text",
a);return!0};e._ceCopyText=function(a){l("ie")&&(a.returnValue=!1);return e._processCopy(a,null,!1)};e._ceCutText=function(a){if(!e._processCopy(a,null,!1))return!1;if(l("ie"))document.selection.clear();else{var c=a.selectionStart;a.value=a.value.substring(0,c)+a.value.substring(a.selectionEnd);a.setSelectionRange(c,c)}return!0};e._getCaretPos=function(a,c){if(l("ie")){var f=0,b=document.selection.createRange().duplicate(),g=b.duplicate(),d=b.text.length;for("textarea"==c.type?g.moveToElementText(c):
g.expand("textedit");0<b.compareEndPoints("StartToStart",g);)b.moveStart("character",-1),++f;return[f,f+d]}return[a.target.selectionStart,a.target.selectionEnd]};e._setSelectedRange=function(a,c,f){if(l("ie")){var b=a.createTextRange();b&&("textarea"==a.type?b.moveToElementText(a):b.expand("textedit"),b.collapse(),b.moveEnd("character",f),b.moveStart("character",c),b.select())}else a.selectionStart=c,a.selectionEnd=f};var n=function(a,c,f){for(;0<c&&c!=f;){c--;var b=a.charAt(c);if("0"<=b&&"9">=b||
"\u00ff"<b)return!0;b=a.charAt(c);if("A"<=b&&"Z">=b||"a"<=b&&"z">=b)break}return!1};e._parse=function(a,c){var f=-1,b=[],g={FILE_PATH:"/\\:.",URL:"/:.?\x3d\x26#",XPATH:"/\\:.\x3c\x3e\x3d[]",EMAIL:"\x3c\x3e@.,;"}[c];switch(c){case "FILE_PATH":case "URL":case "XPATH":p.forEach(a,function(d,h){0<=g.indexOf(d)&&n(a,h,f)&&(f=h,b.push(h))});break;case "EMAIL":p.forEach(a,function(d,h){if('"'==d){n(a,h,f)&&(f=h,b.push(h));h++;var r=a.indexOf('"',h);r>=h&&(h=r);n(a,h,f)&&(f=h,b.push(h))}0<=g.indexOf(d)&&
n(a,h,f)&&(f=h,b.push(h))})}return b};return e});