// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://@sbaseurl@/jsapi/jsapi/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.

//>>built
require({cache:{"url:widgets/Screening/placename/placename.html":'\x3cdiv\x3e\r\n  \x3cdiv class\x3d"esriCTSearchOuterContainer"\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"searchHeader" class\x3d"esriCTSearchHeader" tabindex\x3d"0" aria-label\x3d"${nls.placenameWidget.placenameLabel}" role\x3d"presentation"\x3e\r\n      ${nls.placenameWidget.placenameLabel}\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTSearchContainer"\x3e\r\n      \x3cdiv class\x3d"esriCTSearchDiv"\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"searchWidgetContainer"\x3e\r\n        \x3c/div\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e'}});
define("dojo/_base/declare dojo/dom-construct dojo/query dojo/text!./placename.html dijit/_WidgetsInTemplateMixin dojo/_base/lang dojo/Evented jimu/BaseWidget ../search dojo/dom-geometry dijit/focus dojo/on dojo/dom-attr dojo/keys dojo/_base/event jimu/utils".split(" "),function(k,l,f,m,n,b,p,q,r,t,g,c,v,d,e,u){return k([q,n,p],{baseClass:"jimu-widget-screening-placename",_hasMultipleSourcesInSearch:!0,templateString:m,_windowResizeTimer:null,_buttonNodeEventHandler:null,_inputNodeEventHandler:null,
_submitNodeEventHandler:null,_clearNodeEventHandler:null,constructor:function(a){this._clearNodeEventHandler=this._submitNodeEventHandler=this._inputNodeEventHandler=this._buttonNodeEventHandler=this._windowResizeTimer=null;b.mixin(this,a)},postCreate:function(){this._createSearchInstance()},_createSearchInstance:function(){this._searchInstance=new r({searchOptions:{addLayersFromMap:!1,autoNavigate:!1,autoComplete:!0,minCharacters:0,maxLocations:5,searchDelay:100,enableHighlight:!1},config:this.config,
appConfig:this.appConfig,nls:this.nls,map:this.map},l.create("div",{},this.searchWidgetContainer));this.own(this._searchInstance.on("select-result",b.hitch(this,function(a){this.emit("onSearchComplete",a)})));this.own(this._searchInstance.on("clear-search",b.hitch(this,this._clearResults)));this.own(this._searchInstance.on("search-loaded",b.hitch(this,function(){setTimeout(b.hitch(this,function(){this._searchContainerNodeElement=f(".arcgisSearch .searchGroup .searchInput",this.domNode)[0];2>this._searchInstance.search.sources.length&&
(this._hasMultipleSourcesInSearch=!1);this.onWindowResize()}),1E3)})));this._searchInstance.startup()},_attachSearchNodeEvents:function(){this._searchInstance&&this._searchInstance.search&&this._searchInstance.search.inputNode&&(""!==this._inputNodeEventHandler&&null!==this._inputNodeEventHandler&&void 0!==this._inputNodeEventHandler&&this._inputNodeEventHandler[0].remove(),this._inputNodeEventHandler=this.own(c(this._searchInstance.search.inputNode,"keydown",b.hitch(this,function(a){a.keyCode!==
d.ESCAPE||this.isSingleTabSelected||(e.stop(a),this.emit("focusLastSelectedTab"))}))));this._searchInstance&&this._searchInstance.search&&this._searchInstance.search.submitNode&&(""!==this._submitNodeEventHandler&&null!==this._submitNodeEventHandler&&void 0!==this._submitNodeEventHandler&&this._submitNodeEventHandler[0].remove(),this._submitNodeEventHandler=this.own(c(this._searchInstance.search.submitNode,"keydown",b.hitch(this,function(a){a.keyCode!==d.ESCAPE||this.isSingleTabSelected||(e.stop(a),
this.emit("focusLastSelectedTab"))}))));this._searchInstance&&this._searchInstance.search&&this._searchInstance.search.sourcesBtnNode&&(""!==this._buttonNodeEventHandler&&null!==this._buttonNodeEventHandler&&void 0!==this._buttonNodeEventHandler&&this._buttonNodeEventHandler[0].remove(),this._buttonNodeEventHandler=this.own(c(this._searchInstance.search.sourcesBtnNode,"keydown",b.hitch(this,function(a){a.keyCode!==d.ESCAPE||this.isSingleTabSelected||(e.stop(a),this.emit("focusLastSelectedTab"))}))));
this._searchInstance&&this._searchInstance.search&&this._searchInstance.search.clearNode&&(""!==this._clearNodeEventHandler&&null!==this._clearNodeEventHandler&&void 0!==this._clearNodeEventHandler&&this._clearNodeEventHandler[0].remove(),this._clearNodeEventHandler=this.own(c(this._searchInstance.search.clearNode,"keydown",b.hitch(this,function(a){a.keyCode!==d.ESCAPE||this.isSingleTabSelected||(e.stop(a),this.emit("focusLastSelectedTab"))}))))},_clearResults:function(a){a||this.map.infoWindow.hide()},
clearSearchText:function(){this._searchInstance&&this._searchInstance.search&&this._searchInstance.search.clear()},onWindowResize:function(){this._windowResizeTimer&&clearTimeout(this._windowResizeTimer);this._windowResizeTimer=setTimeout(b.hitch(this,this._resetComponents),500)},_resetComponents:function(){var a;var h=f(".arcgisSearch .searchGroup",this.domNode)[0];this._searchContainerNodeElement||(this._searchContainerNodeElement=f(".arcgisSearch .searchGroup .searchInput",this.domNode)[0]);this.widgetMainContainer&&
this._searchContainerNodeElement&&(a=t.position(this.widgetMainContainer))&&a.w&&(a=a.w-162,this._hasMultipleSourcesInSearch||(a+=32),0<a&&(this._searchContainerNodeElement.style.setProperty("width",a+"px","important"),h&&h.style.setProperty("max-width","100%","important")));this._attachSearchNodeEvents()},resetPlaceNameWidgetValues:function(){this.clearSearchText()},focusFirstNodeOfSelectedTab:function(){g.focus(this.searchHeader)},_focusOutCurrentNode:function(){g.curNode&&g.curNode.blur()},setFirstFocusNode:function(a){u.initFirstFocusNode(a,
this.searchHeader)}})});