// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
define("esri/dijit/analysis/HelpWindow","require dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/event dojo/_base/kernel dojo/aspect dojo/has dojo/dom-construct dojo/dom-class dojo/dom-attr dojo/dom-style dojo/query dojo/window dojo/dom-geometry dijit/_Widget dijit/TooltipDialog dijit/popup ../../kernel ../../lang ../../urlUtils ../../request ../_EventedWidget dojo/i18n!../../nls/jsapi".split(" "),function(q,r,n,g,G,H,m,w,t,I,J,K,x,y,z,A,B,C,p,D,u,E,F,L,v){n=n([B],
{declaredClass:"esri.dijit.analysis.HelpWindow",i18n:null,onlineHelpMap:null,showLearnMore:!1,"class":"esriAnalyisHelpWindow",constructor:function(b){this.isPortal=b&&b.isPortal},postMixInProperties:function(){this.inherited(arguments);this.i18n={};g.mixin(this.i18n,v.common);g.mixin(this.i18n,v.analysisHelp)},postCreate:function(){this.inherited(arguments);var b=["ar","he"],a,h;this.onlineHelpMap={};for(a=0;a<b.length;a+=1)h=b[a],m.locale&&-1!==m.locale.indexOf(h)&&(-1!==m.locale.indexOf("-")?-1!==
m.locale.indexOf(h+"-")&&(this._isRightToLeft=!0):this._isRightToLeft=!0);b=q.toUrl(this.isPortal?"./help/helpmap_enterprise.json":"./help/helpmap.json");F({url:b}).then(g.hitch(this,function(a){this.onlineHelpMap=a.map}))},_getAbsoluteUrl:function(b){var a=E.getProtocolForWebResource();if(/^https?\:/i.test(b))return b;if(/^\/\//i.test(b))return a+b;if(/^\//i.test(b))return a+"//"+window.location.host+b},_computeSize:function(b){var a={w:400,h:200};t("esri-mobile")?a={w:"50%",h:"90%"}:-1!==b.indexOf("Category")?
(a.w=400,a.h=320):-1!==b.indexOf("Tool")?(a.w=400,a.h=320):-1!==b.indexOf("toolDescription")&&(a.w=400,a.h=520);return a},_setHelpTopicAttr:function(b){this.tooltipHelpDlg&&(p.close(this.tooltipHelpDlg),this.tooltipHelpDlg.destroy(),this.tooltipHelpDlg=null);var a,h,c,e,d,k,l="",f;this.showLearnMore=!1;c=this._analysisGpServer&&-1!==this._analysisGpServer.indexOf("dev")?"dev":this._analysisGpServer&&-1!==this._analysisGpServer.indexOf("qa")?"uat":"";l=this.isPortal?"-PortalOnly":"-OnlineOnly";a=g.clone(m.locale);
"nb"===a&&(a="no");h="ar bs cs da de es el et fi fr hi hr id it ja ko lt lv ru nl no pl pt-br pt-pt ro sl sv sr th tr vi zh-cn zh-hk zh-tw".split(" ");k="ar de es fr it ja ko ru pl pt-br zh-cn zh-hk zh-tw".split(" ");"SHOWHELPURL"===b?(e=this.helpIdUrl,this.showLearnMore=!1):(e=q.toUrl("esri/dijit/analysis/help/"+this.helpFileName+".html"),f=this.helpFileName,u.isDefined(this.onlineHelpMap[f])&&u.isDefined(this.onlineHelpMap[f][b])&&(this.showLearnMore=!0,d="http://doc"+c+".arcgis.com/en/arcgis-online/analyze/"+
this.onlineHelpMap[f][b],this.isPortal&&this.helpBase?d=this.helpBase+"index.html#"+this.onlineHelpMap[f][b]:this.isPortal&&!this.helpBase&&(d="http://server"+c+".arcgis.com/en/portal/latest/use/"+this.onlineHelpMap[f][b])),-1!==r.indexOf(h,a)&&(-1!==a.indexOf("-")&&(e=a.split("-"),a=e[0]+"-"+e[1].toUpperCase()),e=q.toUrl("esri/dijit/analysis/help/"+a+"/"+this.helpFileName+".html")),-1!==r.indexOf(k,a)&&this.showLearnMore&&(d="http://doc"+c+".arcgis.com/"+a+"/arcgis-online/analyze/"+this.onlineHelpMap[f][b],
this.isPortal&&this.helpBase?d=this.helpBase+"index.html#"+this.onlineHelpMap[f][b]:this.isPortal&&!this.helpBase&&(d="http://server"+c+".arcgis.com/"+a+"/portal/latest/use/"+this.onlineHelpMap[f][b])));this._size=c=this._computeSize(b);this.tooltipHelpDlg=new C({preload:!0,content:"\x3cdiv class\x3d'' style\x3d'position:relative'\x3cdiv class\x3d'sizer content'\x3e\x3cdiv class\x3d'contentPane'\x3e\x3cdiv class\x3d'esriFloatTrailing' style\x3d'padding:0;'\x3e\x3ca href\x3d'#' class\x3d'esriAnalysisCloseIcon' title\x3d'"+
this.i18n.close+"'\x3e\x3c/a\x3e\x3c/div\x3e\x3ciframe frameborder\x3d'0'  id\x3d'"+b+"' src\x3d'"+e+"#"+b+l+"' width\x3d'"+c.w+"' height\x3d'"+c.h+"' marginheight\x3d'0' marginwidth\x3d'0'\x3e\x3c/iframe\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d'sizer'\x3e\x3cdiv class\x3d'actionsPane'\x3e\x3cdiv class\x3d'actionList"+(this.showLearnMore?"'\x3e":" hidden'\x3e")+"\x3ca class\x3d'action zoomTo' href\x3d'"+(this.showLearnMore?d:"#")+"' target\x3d'_help'\x3e"+this.i18n.learnMore+"\x3c/a\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e",
"class":"esriHelpPopup esriHelpPopupWrapper esriAnalyisHelpWindow"});this.tooltipHelpDlg.startup()},show:function(b,a){this.helpFileName=a.helpFileName;this._analysisGpServer=a.analysisGpServer;this.isPortal=a.isPortal;this.helpBase=a.helpBase;a.analysisMode&&(this.analysisMode=a.analysisMode);a.showHelpFromUrl&&a.helpUrl&&(this.showHelpFromUrl=a.showHelpFromUrl,this.helpIdUrl=a.helpUrl,a.helpId="SHOWHELPURL");this.set("helpTopic",a.helpId);var h=w.after(p,"open",g.hitch(this,function(){y(".esriAnalysisCloseIcon",
this.tooltipHelpDlg.domNode).on("click",g.hitch(this,this.close));h.remove()})),c=b.pageX,e=z.getBox(),d,k,l;l=!1;a.helpParentNode&&(d=a.helpParentNode);d&&(k=A.position(d));k&&e.w-b.pageX<k.w?(l=!0,c=k.x-this._size.w-10,this._isRightToLeft&&(c-=10)):this._isRightToLeft&&c-40<this._size.w&&(c=k.w+this._size.w+80);p.open({popup:this.tooltipHelpDlg,x:!0===this._isRightToLeft||l?c-40:c+40,y:b.screenY-b.pageY+10,onCancel:g.hitch(this,function(){this.close()}),onExecute:function(){this.close()}});this.tooltipHelpDlg.domNode.parentNode&&
x.set(this.tooltipHelpDlg.domNode.parentNode,"overflowY","hidden")},close:function(b,a){p.close(this.tooltipHelpDlg)}});t("extend-esri")&&g.setObject("dijit.analysis.HelpWindow",n,D);return n});