// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
require({cache:{"url:esri/dijit/SymbolStyler/templates/SymbolStyler.html":'\x3cdiv data-dojo-attach-point\x3d"containerNode"\x3e\r\n  \x3cdiv class\x3d"${css.symbolPreviewContainer}"\x3e\r\n    \x3cdiv class\x3d"${css.symbolPreview}" data-dojo-attach-point\x3d"dap_symbolPreview"\x3e\x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv data-dojo-type\x3d"dijit/layout/StackController" class\x3d"${css.tabBar}" data-dojo-props\x3d"containerId:\'${id}_stackContainer\'" data-dojo-attach-point\x3d"dap_stackController"\x3e\x3c/div\x3e\r\n  \x3cdiv data-dojo-type\x3d"dijit/layout/StackContainer" id\x3d"${id}_stackContainer" data-dojo-attach-point\x3d"dap_stackContainer" data-dojo-props\x3d"doLayout: false" class\x3d"${css.content}"\x3e\r\n    \x3cdiv data-dojo-type\x3d"dijit/layout/ContentPane" title\x3d"${labels.shape}" data-dojo-attach-point\x3d"dap_shapeContainer"\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"dap_symbolPicker"\x3e\x3c/div\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"dap_useImageContent"\x3e\r\n        \x3cdiv class\x3d"${css.link}" data-dojo-attach-point\x3d"dap_addImage" tabindex\x3d"0"\x3e${labels.useImage}\x3c/div\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"dap_shapeImageUrlContainer" class\x3d"${css.shapeImageUrlContainer}"\x3e\r\n          \x3cdiv data-dojo-type\x3d"dijit/form/TextBox" data-dojo-attach-point\x3d"dap_shapeImageUrlInput" class\x3d"${css.urlInput} dijitInline"\x3e\x3c/div\x3e\r\n          \x3cdiv data-dojo-attach-point\x3d"dap_loadShapeImageUrl" class\x3d"dijitInline ${css.addIcon}" tabindex\x3d"0"\x3e\x3c/div\x3e\r\n          \x3cdiv data-dojo-attach-point\x3d"dap_shapeImageUrlErrorDisplay" class\x3d"${css.errorDisplay}"\x3e\x3c/div\x3e\r\n        \x3c/div\x3e\r\n      \x3c/div\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"dap_shapeSizeLabel" class\x3d"${css.label}"\x3e${labels.symbolSize}\x3c/div\x3e\r\n      \x3cdiv class\x3d"${css.symbolSizeInput} ${css.inlineInput}" data-dojo-attach-point\x3d"dap_symbolSizeOptions"\x3e\r\n        \x3cdiv data-dojo-type\x3d"esri/dijit/HorizontalSlider" data-dojo-attach-point\x3d"dap_shapeSizeSlider"\x3e\x3c/div\x3e\r\n        \x3cdiv data-dojo-type\x3d"dijit/form/NumberSpinner"  data-dojo-attach-point\x3d"dap_shapeSizeTextBox"\x3e\x3c/div\x3e\r\n        \x3cspan class\x3d"${css.text}"\x3e${labels.px}\x3c/span\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv data-dojo-type\x3d"dijit/layout/ContentPane" title\x3d"${labels.fill}" data-dojo-attach-point\x3d"dap_fillContainer"\x3e\r\n      \x3cdiv data-dojo-type\x3d"esri/dijit/ColorPicker" data-dojo-attach-point\x3d"dap_fillColorPicker" data-dojo-props\x3d"showSuggestedColors: true"\x3e\x3c/div\x3e\r\n      \x3cdiv data-dojo-type\x3d"esri/dijit/SymbolStyler/ColorRampPicker" data-dojo-attach-point\x3d"dap_fillColorRampPicker" class\x3d"${css.hidden}"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv data-dojo-type\x3d"dijit/layout/ContentPane" title\x3d"${labels.outline}" data-dojo-attach-point\x3d"dap_outlineContainer"\x3e\r\n      \x3cdiv data-dojo-type\x3d"esri/dijit/ColorPicker" data-dojo-attach-point\x3d"dap_outlineColorPicker" data-dojo-props\x3d"showSuggestedColors: true"\x3e\x3c/div\x3e\r\n      \x3cdiv data-dojo-type\x3d"esri/dijit/SymbolStyler/ColorRampPicker" data-dojo-attach-point\x3d"dap_outlineColorRampPicker" class\x3d"${css.hidden}"\x3e\x3c/div\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"dap_lineWidthLabel" class\x3d"${css.label}"\x3e${labels.lineWidth}\x3c/div\x3e\r\n      \x3cdiv class\x3d"${css.lineWidthInput} ${css.inlineInput}" data-dojo-attach-point\x3d"dap_lineWidthOptions"\x3e\r\n        \x3cdiv data-dojo-type\x3d"esri/dijit/HorizontalSlider" data-dojo-attach-point\x3d"dap_lineWidthSlider"\x3e\x3c/div\x3e\r\n        \x3cselect data-dojo-attach-point\x3d"dap_lineWidthTextBox"\x3e\x3c!--values added dynamically--\x3e\x3c/select\x3e\r\n        \x3cspan class\x3d"${css.text}"\x3e${labels.px}\x3c/span\x3e\r\n      \x3c/div\x3e\r\n      \x3cdiv class\x3d"${css.label}" data-dojo-attach-point\x3d"dap_linePatternSelectLabel"\x3e${labels.pattern}\x3c/div\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"dap_linePatternSelect"\x3e\x3c/div\x3e\r\n      \x3cdiv class\x3d"${css.label}" data-dojo-attach-point\x3d"dap_arrowPatternSelectLabel"\x3e${labels.arrow}\x3c/div\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"dap_arrowPatternSelect"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e\r\n'}});
define("esri/dijit/SymbolStyler","../dijit/ColorPicker ../domUtils ../kernel ../symbol ./_EventedWidget ./_Tooltip ./ColorPicker/colorUtil ./SymbolStyler/_DelayedUpdate ./SymbolStyler/IconSelect ./SymbolStyler/MarkerSymbolPicker ./SymbolStyler/schemeUtil ./SymbolStyler/stylerUtil ./SymbolStyler/symbolUtil dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dijit/a11yclick dijit/form/CheckBox dijit/form/ComboBoxMixin dijit/form/NumberTextBox dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/dom-class dojo/dom-construct dojo/has dojo/keys dojo/number dojo/on dojo/string dojo/i18n!../nls/jsapi dojo/text!./SymbolStyler/templates/SymbolStyler.html ../dijit/HorizontalSlider ./SymbolStyler/MarkerSymbolPicker ./SymbolStyler/ColorRampPicker dijit/form/Button dijit/form/ComboBox dijit/form/NumberSpinner dijit/form/Select dijit/form/TextBox dijit/layout/BorderContainer dijit/layout/ContentPane dijit/layout/StackController dijit/layout/StackContainer".split(" "),
function(q,f,y,n,p,z,A,B,t,C,u,h,c,D,E,v,F,G,H,l,I,d,m,k,J,K,L,w,x,r,M){p=I([p,D,E,B,z],{_RECENT_FILL_COLORS_ITEM_KEY:"symbolStyler/recent/fill/colors",_RECENT_OUTLINE_COLORS_ITEM_KEY:"symbolStyler/recent/outline/colors",_defaultMinLineWidthInPx:0,_defaultMinShapeSizeInPx:1,_defaultMaxLineWidthInPx:18,_defaultMaxShapeSizeInPx:120,declaredClass:"esri.dijit.SymbolStyler",baseClass:"esriSymbolStyler",templateString:M,labels:null,css:{symbolPreviewContainer:"esriSymbolPreviewContainer",symbolPreview:"esriSymbolPreview",
tabBar:"esriTabBar",content:"esriContent",link:"esriLink",label:"esriLabel",shapeImageUrlContainer:"esriShapeImageUrlContainer",urlInput:"esriUrlInput",addIcon:"esriAddIcon",errorDisplay:"esriErrorDisplay",symbolSizeInput:"esriSymbolSizeInput",inlineInput:"esriInlineInput",text:"esriText",hidden:"esriHidden",lineWidthInput:"esriLineWidthInput",arrowPattern:"esriArrowPattern",arrowPatternInput:"esriArrowPatternInput",linePattern:"esriLinePattern",linePatternInput:"esriLinePatternInput",alt:"esriAlt",
disabled:"esriDisabled"},declaredClass:"esri.dijit.SymbolStyler",_originalSymbol:null,_editedSymbol:null,_activeTabName:null,_externalSizing:!1,_delayedCommitPropsTrigger:null,_symbolPreviewSurface:null,_arrowPatternSelect:null,_linePatternSelect:null,_symbolPicker:null,_customImageSymbol:null,_optimizationSection:null,_optimizationCheckBox:null,_isPreppingEdit:null,constructor:function(a){this._delayedCommitPropsTrigger=this.createUpdateTrigger(this._commitProperties,this);this._initOptimizationControls()},
_initOptimizationControls:function(){var a=new F,b=k.create("div",{className:q.prototype.css.section});k.create("label",{"for":a.id,className:this.css.label,innerHTML:r.widgets.symbolEditor.autoAdjustOutline},b);a.on("change",d.hitch(this,function(a){var b=this.dap_outlineColorPicker.get("color");b.a=a?.5:1;this.dap_outlineColorPicker.set("color",b);this._delayedCommitPropsTrigger()}));a.placeAt(b,"first");this._optimizationSection=b;this._optimizationCheckBox=a},postMixInProperties:function(){this.inherited(arguments);
this.labels=d.mixin({},r.common,r.widgets.symbolEditor)},_toggleOutlineColorControls:function(a){var b=this.dap_outlineColorRampPicker,e=this.dap_outlineColorPicker;this._shouldShowOutlineColorRamp(a)?(this._show(b),this._hide(e)):(this._show(e),this._hide(b))},_shouldShowOutlineColorRamp:function(a){return this._hasColorRamp()&&(c.isLine(a)||c.isPoint(a)&&c.hasPureOutlineStyle(a))},_setUpColorControls:function(a,b){var e=this.dap_outlineColorRampPicker,c=this.dap_outlineColorPicker,d=this.dap_fillColorRampPicker,
g=this.dap_fillColorPicker,f;b?(f={colors:b.colors},b.scheme&&(f.scheme=b.scheme),this._isLine()?(e.set({schemes:a,selected:f,numStops:b.numStops}),this._hide(c),this._show(e)):(this._isPoint()&&e.set({schemes:a,selected:f,numStops:b.numStops}),d.set({schemes:a,selected:f,numStops:b.numStops}),this._show(d),this._show(c),this._hide(g),this._hide(e))):(this._show(g),this._show(c),this._hide(d),this._hide(e),this._updateSuggestedColors(g,u.getFillColors(a)));this._updateSuggestedColors(c,u.getOutlineColors(a))},
edit:function(a,b){var e=c.cloneSymbol(a),d;b=b||{};d=b.colorRamp;this._isPreppingEdit=!0;this._colorRamp=d;this._originalSymbol=a;this._editedSymbol=e;this._activeTabName=b.activeTab;this._externalSizing=b.externalSizing;this._tabOptions=b.tabOptions||{};this._optimizationOptions="boolean"===typeof b.optimizeOutline?{value:b.optimizeOutline}:void 0;this._setUpColorControls(b.schemes,d);this._assimilateSymbol(e);this._toggleSizingControls(this._externalSizing);this._updateSymbolPicker();this._toggleOutlineColorControls(e);
this._toggleOptimizationOptions()},_toggleOptimizationOptions:function(){var a=this._optimizationOptions,b=this._optimizationSection;c.isPolygon(this._editedSymbol)&&a?(this._optimizationCheckBox.set("value",a.value),k.place(b,this.dap_outlineColorPicker.dap_recentColorSection)):b.parentNode&&k.empty(b.parentNode)},_importRecentColors:function(){this.dap_fillColorPicker.loadRecentColors(this._RECENT_FILL_COLORS_ITEM_KEY);this.dap_outlineColorPicker.loadRecentColors(this._RECENT_OUTLINE_COLORS_ITEM_KEY)},
_hasColorRamp:function(){return!!this._colorRamp},_toggleSizingControls:function(a){var b=!1,e=!1;a&&(this._isLine()?e=!0:b=!0);this._toggleLabeledControls({labels:this.dap_lineWidthLabel,controls:[this._lineWidthTextBox,this.dap_lineWidthSlider],disabled:e});this._toggleLabeledControls({labels:this.dap_shapeSizeLabel,controls:[this.dap_shapeSizeTextBox,this.dap_shapeSizeSlider],disabled:b})},_toggleLabeledControls:function(a){var b=a.labels,e=a.controls,c=a.disabled;d.isArray(b)?l.forEach(b,function(a){m.toggle(a,
this.css.disabled,c)},this):m.toggle(b,this.css.disabled,c);d.isArray(e)?l.forEach(e,function(a){a.set("disabled",c)}):e.set("disabled",c)},_updateSymbolPicker:function(){var a=this._tabOptions.symbolDisplayMode?this._tabOptions.symbolDisplayMode:this._isPoint()&&this._hasColorRamp()?"default":"portal";"portal"===a?f.show(this.dap_useImageContent):f.hide(this.dap_useImageContent);this._symbolPicker.set("displayMode",a);this._symbolPicker.clearSelection()},shapeSymbol:null,_setShapeSymbolAttr:function(a){this._adjustOutlineProperties(this._editedSymbol,
a);this._set("shapeSymbol",a);this._editedSymbol=a;this._toggleTabs(a);this._toggleOutlineColorControls(a);this._delayedCommitPropsTrigger()},_adjustOutlineProperties:function(a,b){var e=this.dap_fillColorPicker,d=this.dap_outlineColorPicker,f=this.dap_fillColorRampPicker,g=this.dap_outlineColorRampPicker;this._switchedFromPmsToSms(a,b)?(e.set("color",b.color),e=c.getOutline(b),d.set("color",e.color),this.dap_lineWidthSlider.set("value",e.width),this._linePatternSelect.set("value",e.style),this._arrowPatternSelect.set("value",
e.marker)):this._switchedPureOutlineToSmsStyle(a,b)&&this._hasColorRamp()?f.set("selected",g.get("selected")):this._switchedSmsStyleToPureOutline(a,b)&&(this._hasColorRamp()?g.set("selected",f.get("selected")):(e=c.getOutline(a),g=d.get("color"),e.color?(f=A.isBright(e.color))&&.2>e.color.a?(g.a=.2,d.set("color",g)):!f&&.1>e.color.a&&(g.a=.1,d.set("color",g)):d.set("color",b.color)))},_switchedFromPmsToSms:function(a,b){return c.isType(a,"picturemarker")&&c.isType(b,"simplemarker")},_switchedSmsStyleToPureOutline:function(a,
b){return c.isType(a,"simplemarker")&&c.isType(b,"simplemarker")&&c.hasPureOutlineStyle(a)&&c.hasPureOutlineStyle(b)},_switchedPureOutlineToSmsStyle:function(a,b){return this._switchedSmsStyleToPureOutline(b,a)},shapeSize:null,_setShapeSizeAttr:function(a){this._set("shapeSize",a);this._delayedCommitPropsTrigger()},_shapeImageUrl:null,_setShapeImageUrlAttr:function(a){this._set("shapeImageUrl",a);this._delayedCommitPropsTrigger()},fillColor:null,_setFillColorAttr:function(a){a=a===q.NO_COLOR?null:
a;this._set("fillColor",a);this._delayedCommitPropsTrigger()},fillColorRamp:null,_setFillColorRampAttr:function(a){this._set("fillColorRamp",a);this._delayedCommitPropsTrigger()},outlineColorRamp:null,_setOutlineColorRampAttr:function(a){this._set("outlineColorRamp",a);this._delayedCommitPropsTrigger()},outlineWidth:null,_setOutlineWidthAttr:function(a){this._set("outlineWidth",a);this._delayedCommitPropsTrigger()},outlineColor:null,_setOutlineColorAttr:function(a){a=a===q.NO_COLOR?null:a;var b=!!this._optimizationOptions&&
this._optimizationCheckBox.checked;a&&b&&(a.a=.5,this.dap_outlineColorPicker.set("color",a,!1));this._set("outlineColor",a);this._delayedCommitPropsTrigger()},outlinePattern:null,_setOutlinePatternAttr:function(a){this._set("outlinePattern",a);this._delayedCommitPropsTrigger()},arrowPattern:null,_setArrowPatternAttr:function(a){this._set("arrowPattern",a);this._delayedCommitPropsTrigger()},_getTabContainer:function(a){return"fill"===a?this.dap_fillContainer:"outline"===a?this.dap_outlineContainer:
this.dap_shapeContainer},_storeRecentFillColors:function(){this._storeRecentColors(this.dap_fillColorPicker,this._RECENT_FILL_COLORS_ITEM_KEY)},_storeRecentOutlineColors:function(){this._storeRecentColors(this.dap_outlineColorPicker,this._RECENT_OUTLINE_COLORS_ITEM_KEY)},_storeRecentColors:function(a,b){a.addRecentColor(a.get("color"));a.saveRecentColors(b)},_isPoint:function(){return c.isPoint(this._editedSymbol)},_isLine:function(){return c.isLine(this._editedSymbol)},_isPolygon:function(){return c.isPolygon(this._editedSymbol)},
_addHandlers:function(){this.own(this.dap_shapeContainer.on("show",d.hitch(this,function(){this._symbolPicker._updateTemplatePickerIfHeightless()})));this._linePatternSelect.on("change",d.hitch(this,function(a){this.set("outlinePattern",a)}));this._arrowPatternSelect.on("change",d.hitch(this,function(a){this.set("arrowPattern",a)}));this.own(w(this.dap_loadShapeImageUrl,v,d.hitch(this,function(){this._loadImage(this.dap_shapeImageUrlInput.get("value"))})));this.own(w(this.dap_addImage,v,d.hitch(this,
function(){f.show(this.dap_shapeImageUrlContainer);this.dap_shapeImageUrlInput.focus()})));this.dap_shapeImageUrlInput.on("input",d.hitch(this,function(a){a.keyCode===K.ENTER&&this._loadImage(this.dap_shapeImageUrlInput.get("value"))}));this.dap_shapeImageUrlInput.on("change",d.hitch(this,function(a){this.set("shapeImageUrl",a)}));this.dap_shapeSizeSlider.on("change",d.hitch(this,function(a){this.set("shapeSize",a)}));this.dap_fillColorPicker.on("color-change",d.hitch(this,function(a){this.set("fillColor",
a.color)}));this.dap_fillColorRampPicker.on("color-ramp-change",d.hitch(this,function(a){this.set("fillColorRamp",a.colors)}));this.dap_outlineColorRampPicker.on("color-ramp-change",d.hitch(this,function(a){this.set("outlineColorRamp",a.colors)}));this.dap_lineWidthSlider.on("change",d.hitch(this,function(a){this.set("outlineWidth",a)}));this.dap_outlineColorPicker.on("color-change",d.hitch(this,function(a){this.set("outlineColor",a.color)}));h.bindSliderAndTextBox(this.dap_lineWidthSlider,this._lineWidthTextBox);
h.bindSliderAndTextBox(this.dap_shapeSizeSlider,this.dap_shapeSizeTextBox);this._symbolPicker.on("symbol-select",d.hitch(this,function(a){this._hideImageUrlInput();this.set("shapeSymbol",a.selection)}));this.dap_shapeSizeSlider.on("change",d.hitch(this,this._onSizeChange));this.dap_fillColorPicker.on("color-change",d.hitch(this,this._onFillColorChange));this.dap_outlineColorPicker.on("color-change",d.hitch(this,this._onOutlineColorChange));this.dap_lineWidthSlider.on("change",d.hitch(this,this._onWidthChange))},
getStyle:function(){var a=c.cloneSymbol(this._editedSymbol),b={symbol:a};this._hasColorRamp()&&(a=(a=c.isLine(a)||c.isPoint(a)&&c.hasPureOutlineStyle(a))?this.dap_outlineColorRampPicker:this.dap_fillColorRampPicker,d.mixin(b,a.getStyle()));this._optimizationOptions&&(b.optimizeOutline=this._optimizationCheckBox.checked);return b},storeColors:function(){this._storeRecentFillColors();this._storeRecentOutlineColors()},postCreate:function(){this.inherited(arguments);this._setUpComboBox();var a=new t({},
this.dap_linePatternSelect),b=new t({},this.dap_arrowPatternSelect);this._linePatternSelect=a;this._arrowPatternSelect=b;f.hide(this.dap_shapeImageUrlContainer);this.dap_shapeImageUrlInput.set("placeholder",this.labels.imageUrlInputPlaceholder);this._lineWidthTextBox.selectOnClick=!0;this.dap_shapeSizeTextBox.selectOnClick=!0;this.dap_lineWidthSlider.intermediateChanges=!0;this._lineWidthTextBox.intermediateChanges=!0;this.dap_shapeSizeSlider.intermediateChanges=!0;this.dap_shapeSizeTextBox.intermediateChanges=
!0;this.dap_fillColorPicker.trackColors=!1;this.dap_outlineColorPicker.trackColors=!1;this._linePatternSelect.addIconOptions(["solid","dot","dash","dashdot","longdashdotdot"],this.css.linePattern);this._arrowPatternSelect.addIconOptions(["none","begin","end","begin-end"],this.css.arrowPattern);this._importRecentColors();this.createTooltips([{node:this.dap_shapeImageUrlContainer,label:this.labels.imageUrlInputTooltip},{node:this.dap_addImage,label:this.labels.useImageTooltip},{node:this.dap_symbolSizeOptions},
{node:this.dap_lineWidthOptions}]);this.dap_outlineColorPicker._enableTransparencySlider=function(){};this.dap_outlineColorPicker._disableTransparencySlider=function(){}},_setUpComboBox:function(){var a=H.createSubclass([G]),b=document.createDocumentFragment();l.forEach([1,1.2,1.5,2,3,4,5,6,7,8,9,10],function(a){b.appendChild(k.create("option",{innerHTML:L.format(a)}))});this.dap_lineWidthTextBox.appendChild(b);this._lineWidthTextBox=new a({},this.dap_lineWidthTextBox)},_updateSliderAndTextBoxConstraints:function(a){var b=
a.minimum,c=a.maximum;a.textBox.set("constraints",{min:b,max:c});a.slider.set({minimum:b,maximum:c,discreteValues:Math.round(c)-Math.round(b)+1})},_loadImage:function(a){this._clearUrlImageErrorDisplay();c.testImageUrl(a).then(d.hitch(this,function(b){var e=this._customImageSymbol;b=c.preserveAspectRatio({dimensions:b,targetDimension:"width",targetSize:this.shapeSize});e?(e.url=a,e.height=b.height,e.width=b.width):this._customImageSymbol=e=new n.PictureMarkerSymbol(a,b.width,b.height);this._symbolPicker.addCustomImageSymbol(e);
this.set("shapeSymbol",e)}),d.hitch(this,function(){this._showUrlImageErrorDisplay(this.labels.imageLoadError)}))},_showUrlImageErrorDisplay:function(a){this.dap_shapeImageUrlErrorDisplay.innerHTML=a},_clearUrlImageErrorDisplay:function(){this.dap_shapeImageUrlErrorDisplay.innerHTML=""},_getActiveTabAttr:function(){var a=this.dap_stackContainer.selectedChildWidget;return a===this.dap_outlineContainer?"outline":a===this.dap_fillContainer?"fill":"shape"},_updateTabs:function(a){this._toggleTabs(a);
this._showRelevantTabs(a);this._selectActiveTab();h.ensureEnabledChildSelection(this.dap_stackContainer)},_supportsPattern:function(a){return c.isLine(a)||c.isPolygon(a)},_toggleTabs:function(a){this._shouldShowShapeTab(a)?this._enableTab("shape"):this._disableTab("shape");this._shouldShowFillTab(a)?this._enableTab("fill"):this._disableTab("fill");if(this._shouldShowOutlineTab(a)){this._enableTab("outline");var b=[this._arrowPatternSelect,this.dap_arrowPatternSelectLabel];l.forEach([this._linePatternSelect,
this.dap_linePatternSelectLabel],f[c.isLine(a)||c.isPolygon(a)?"show":"hide"]);l.forEach(b,f[c.isLine(a)?"show":"hide"])}else this._disableTab("outline")},_shouldShowShapeTab:function(a){return"simplemarkersymbol"===a.type||"picturemarkersymbol"===a.type},_enableTab:function(a){h.enable(this._getTabContainer(a))},_disableTab:function(a){h.disable(this._getTabContainer(a))},_shouldShowFillTab:function(a){return"simplemarkersymbol"===a.type&&a.style===n.SimpleMarkerSymbol.STYLE_CIRCLE||"simplemarkersymbol"===
a.type&&a.style===n.SimpleMarkerSymbol.STYLE_SQUARE||"simplemarkersymbol"===a.type&&a.style===n.SimpleMarkerSymbol.STYLE_DIAMOND||"simplefillsymbol"===a.type},_shouldShowOutlineTab:function(a){return"simplemarkersymbol"===a.type||"simplefillsymbol"===a.type||"cartographiclinesymbol"===a.type||"simplelinesymbol"===a.type},_syncControls:function(a){var b;this._hideImageUrlInput();this._updateSizingConstraints();this._shouldShowShapeTab(a)&&(b=c.getMarkerLength(a),this.set("shapeSize",b),h.silentlyUpdateIntermediateChangingValueWidget(this.dap_shapeSizeSlider,
b),h.silentlyUpdateIntermediateChangingValueWidget(this.dap_shapeSizeTextBox,b));this._shouldShowFillTab(a)&&(this.set("fillColor",a.color),this.dap_fillColorPicker.set("color",a.color,!1));this._shouldShowOutlineTab(a)&&(a=c.getOutline(a),b=a.marker?a.marker.placement:"none",this.set("outlineColor",a.color),this.set("outlineWidth",a.width),this.set("outlinePattern",a.style),this.set("arrowPattern",b),this.dap_outlineColorPicker.set("color",a.color,!1),h.silentlyUpdateIntermediateChangingValueWidget(this.dap_lineWidthSlider,
a.width),h.silentlyUpdateIntermediateChangingValueWidget(this._lineWidthTextBox,a.width),this._linePatternSelect.set("value",a.style,!1),this._arrowPatternSelect.set("value",b,!1))},_updateSizingConstraints:function(){var a=c.getOutline(this._editedSymbol),a=a&&a.width>this._defaultMaxLineWidthInPx?Math.ceil(a.width):this._defaultMaxLineWidthInPx,b=c.getMarkerLength(this._editedSymbol),b=b>this._defaultMaxShapeSizeInPx?Math.ceil(b):this._defaultMaxShapeSizeInPx;this._updateSliderAndTextBoxConstraints({textBox:this._lineWidthTextBox,
slider:this.dap_lineWidthSlider,minimum:this._defaultMinLineWidthInPx,maximum:a});this.findTooltip(this.dap_lineWidthOptions).set("label",x.substitute(this.labels.lineWidthTooltip,{min:this._defaultMinLineWidthInPx,max:a}));this._updateSliderAndTextBoxConstraints({textBox:this.dap_shapeSizeTextBox,slider:this.dap_shapeSizeSlider,minimum:this._defaultMinShapeSizeInPx,maximum:b});this.findTooltip(this.dap_symbolSizeOptions).set("label",x.substitute(this.labels.symbolSizeTooltip,{min:this._defaultMinShapeSizeInPx,
max:b}))},_assimilateSymbol:function(a){this._updateTabs(a);this._syncControls(a)},startup:function(){this.inherited(arguments);var a=new C(this._getSymbolPickerParams(),this.dap_symbolPicker);a.startup();this._symbolPicker=a;this._addHandlers()},_getSymbolPickerParams:function(){return{portal:this.portal||this.portalSelf||this.portalUrl}},_hideImageUrlInput:function(){this._clearUrlImageErrorDisplay();f.hide(this.dap_shapeImageUrlContainer);this.dap_shapeImageUrlInput.set("value","")},_showRelevantTabs:function(){var a=
this.dap_stackContainer,b=this.dap_shapeContainer,c=this.dap_fillContainer,d=this.dap_outlineContainer,h,g,k;l.forEach(a.getChildren(),function(b){a.removeChild(b)});this._isPoint()&&(k=g=h=!0);this._isLine()&&(k=!0);this._isPolygon()&&(k=g=!0);var m=this._tabOptions.excluded||[];-1<l.indexOf(m,"shape")&&(h=!1);-1<l.indexOf(m,"outline")&&(k=!1);-1<l.indexOf(m,"fill")&&(g=!1);h&&a.addChild(b);g&&a.addChild(c);k&&a.addChild(d);1===a.getChildren().length?f.hide(this.dap_stackController.domNode):f.show(this.dap_stackController.domNode)},
_selectActiveTab:function(){var a=this._getTabContainer(this._activeTabName);-1<this.dap_stackContainer.getIndexOfChild(a)&&this.dap_stackContainer.selectChild(a)},_onFillColorChange:function(a){this.set("fillColor",a.color)},_onOutlineColorChange:function(a){this.set("outlineColor",a.color)},_getFillColor:function(){return!this._isLine()&&this._hasColorRamp()?this._getMiddleItem(this.fillColorRamp):this.fillColor},_getMiddleItem:function(a){return a[Math.floor(.5*(a.length-1))]},_getOutlineColor:function(){return this._shouldShowOutlineColorRamp(this._editedSymbol)?
this._getMiddleItem(this.outlineColorRamp):this.outlineColor},_commitProperties:function(){var a=this._editedSymbol;this._shouldShowShapeTab(a)&&this._updateShapeSize();this._shouldShowFillTab(a)&&(c.setFillColor(a,this._getFillColor()),this._isPreppingEdit||this._ensureSupportedSfsStyle(a));this._shouldShowOutlineTab(a)&&(c.setOutlineColor(a,this._getOutlineColor()),this._updateArrowPattern(),this._updateOutlinePattern(),this._updateOutlineWidth());this._updatePreviewSymbol();this._toggleOutlineOptions();
this._isPreppingEdit=!1;this.emit("style-update")},_ensureSupportedSfsStyle:function(a){"simplefillsymbol"!==a.type||"none"===a.style&&"solid"===a.style||(a.style="solid")},_toggleOutlineOptions:function(){var a=!!this._optimizationOptions&&this._optimizationCheckBox.checked,b=this.outlineColor,c=this._isLine(),d=a||!b,f=!b;this._toggleLabeledControls({labels:this.dap_lineWidthLabel,controls:[this._lineWidthTextBox,this.dap_lineWidthSlider],disabled:this._externalSizing&&c||!b||a});this._toggleLabeledControls({labels:this.dap_linePatternSelectLabel,
controls:[this._linePatternSelect,this._arrowPatternSelect],disabled:f});this._toggleLabeledControls({labels:[this.dap_outlineColorPicker.dap_transparencyLabel],controls:[this.dap_outlineColorPicker.dap_transparencySlider],disabled:d})},_updatePreviewSymbol:function(){var a=this._editedSymbol,b=this.css.alt,d=this.dap_symbolPreview;this._symbolPreviewSurface&&this._symbolPreviewSurface.destroy();m.toggle(d,b,this._blendsIntoBackground(a));this._symbolPreviewSurface=c.renderOnSurface(a,d)},_blendsIntoBackground:function(a){return c.hasColor(a.outline)?
this._isWhitish(a.outline.color):this._isWhitish(a.color)},_isWhitish:function(a){return a&&246<a.r&&246<a.g&&246<a.b},destroy:function(){this._symbolPreviewSurface&&this._symbolPreviewSurface.destroy();k.destroy(this._optimizationSection);this._optimizationCheckBox.destroy();this.dap_shapeContainer.destroy();this.dap_fillContainer.destroy();this.dap_outlineContainer.destroy();this.inherited(arguments)},_updateSuggestedColors:function(a,b){a.set("suggestedColors",b)},_updateOutlineWidth:function(){c.setOutlineWidth(this._editedSymbol,
this.outlineWidth)},_onWidthChange:function(a){this.set("outlineWidth",a)},_onSizeChange:function(a){this.set("shapeSize",a)},_updateShapeSize:function(){c.setSize(this._editedSymbol,this.shapeSize)},_updateOutlinePattern:function(){this._shouldShowOutlineTab(this._editedSymbol)&&c.setOutlineStyle(this._editedSymbol,c.toFullLineStyle(this.outlinePattern))},_updateArrowPattern:function(){this._shouldShowOutlineTab(this._editedSymbol)&&c.setLineMarker(this._editedSymbol,c.toLineMarker(this.arrowPattern))},
_show:function(a){m.remove(f.getNode(a),this.css.hidden)},_hide:function(a){m.add(f.getNode(a),this.css.hidden)},popUp:function(a){h.popUp(this,a)}});J("extend-esri")&&d.setObject("dijit.SymbolStyler",p,y);return p});