// 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
define("dojo/_base/lang dojo/_base/array esri/geometry/Point esri/geometry/Polygon esri/geometry/Polyline esri/graphic esri/symbols/SimpleMarkerSymbol esri/symbols/SimpleLineSymbol esri/symbols/SimpleFillSymbol esri/Color".split(" "),function(n,r,t,u,v,m,p,h,q,k){var g={getHighLightSymbol:function(b,a){switch(b.geometry.type){case "point":return g._getPointSymbol(b,a);case "polyline":return g._getPolyLineSymbol(b,a);case "polygon":return g._getPolygonSymbol(b,a)}},_getSizeInfo:function(b){var a=null;
b.renderer.visualVariables&&r.forEach(b.renderer.visualVariables,n.hitch(this,function(c){"sizeInfo"===c.type&&(a=c)}));return a},_getPointSymbol:function(b,a){var c,f;var e=!1;var d=new p(p.STYLE_SQUARE,null,new h(h.STYLE_SOLID,new k([0,255,255,1]),3));d.setColor(null);d.size=30;if(a&&a.renderer)if(a.renderer.symbol)e=!0,d=g._updatePointSymbolProperties(d,a.renderer.symbol);else if(a.renderer.infos&&0<a.renderer.infos.length){for(f=0;f<a.renderer.infos.length;f++){a.typeIdField?c=b.attributes[a.typeIdField]:
a.renderer.attributeField&&(c=b.attributes[a.renderer.attributeField]);var l=a.renderer.infos[f].value;void 0!==c&&null!==c&&""!==c&&void 0!==l&&null!==l&&""!==l&&c.toString()===l.toString()&&(e=!0,d=g._updatePointSymbolProperties(d,a.renderer.infos[f].symbol))}!e&&a.renderer.defaultSymbol&&(e=!0,d=g._updatePointSymbolProperties(d,a.renderer.defaultSymbol))}a&&a.graphics&&0<a.graphics.length&&a._getSymbol(b)&&((c=b.getShape())&&c.shape?c.shape.hasOwnProperty("r")?(e=!0,d.size=2*c.shape.r+10):c.shape.hasOwnProperty("width")&&
(e=!0,a.renderer&&a.renderer.infos&&0<a.renderer.infos.length&&(d=g._updatePointSymbolProperties(d,a.renderer.infos[0].symbol)),d.size=c.shape.width+10):a.renderer.visualVariables&&(e=a._getRenderer(b),c=g._getSizeInfo(a))&&(a=e.getSize(b,{sizeInfo:c,shape:a._getSymbol(b),resolution:a&&a.getResolutionInMeters&&a.getResolutionInMeters()}),null!==a&&(d.size=a+10)));a=new t(b.geometry.x,b.geometry.y,b.geometry.spatialReference);return new m(a,d,b.attributes)},_updatePointSymbolProperties:function(b,
a){if(a.hasOwnProperty("height")&&a.hasOwnProperty("width")){var c=a.height;var f=a.width;c=(c>f?c:f)+10;b.size=c}a.hasOwnProperty("size")&&(!c||c<a.size)&&(b.size=a.size+10);a.hasOwnProperty("xoffset")&&(b.xoffset=a.xoffset);a.hasOwnProperty("yoffset")&&(b.yoffset=a.yoffset);return b},_getPolyLineSymbol:function(b,a){var c,f;var e=5;if(a&&a.renderer)if(a.renderer.symbol&&a.renderer.symbol.hasOwnProperty("width"))e=a.renderer.symbol.width;else if(a.renderer.infos&&0<a.renderer.infos.length)for(f=
0;f<a.renderer.infos.length;f++){a.typeIdField?c=b.attributes[a.typeIdField]:a.renderer.attributeField&&(c=b.attributes[a.renderer.attributeField]);var d=a.renderer.infos[f].value;void 0!==c&&null!==c&&""!==c&&void 0!==d&&null!==d&&""!==d&&c.toString()===d.toString()&&a.renderer.infos[f].symbol.hasOwnProperty("width")&&(e=a.renderer.infos[f].symbol.width)}else a.renderer.defaultSymbol&&a.renderer.defaultSymbol.hasOwnProperty("width")&&(e=a.renderer.defaultSymbol.width);a=new h(h.STYLE_SOLID,new k([0,
255,255,1]),e);e=new v(b.geometry.spatialReference);b.geometry.paths&&0<b.geometry.paths.length&&e.addPath(b.geometry.paths[0]);return new m(e,a,b.attributes)},_getPolygonSymbol:function(b){var a=new q(q.STYLE_SOLID,new h(h.STYLE_SOLID,new k([0,255,255,1]),4),new k([0,0,0,0]));var c=new u(b.geometry.spatialReference);b.geometry.rings&&(c.rings=n.clone(b.geometry.rings));return new m(c,a,b.attributes)}};return g});