// 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/GriddedReferenceGraphic/templates/FontSetting.html":'\x3cdiv class\x3d"style-selector"\x3e\r\n  \x3cdiv class\x3d"setting-items font clearFix" data-dojo-attach-point\x3d"fontSetting"\x3e\r\n    \x3cdiv class\x3d"label jimu-float-leading" title\x3d"${nls.font}"\x3e${nls.font}\x3c/div\x3e\r\n    \x3cdiv class\x3d"setting-wapper jimu-float-trailing"\x3e\r\n      \x3cselect data-dojo-attach-point\x3d"fontSelect" data-dojo-props\x3d\'style:{width:"100%"}\' data-dojo-type\x3d"jimu/dijit/formSelect" aria-label\x3d"${nls.font}"\x3e\x3c/select\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"setting-items text-size clearFix" data-dojo-attach-point\x3d"textSizeSetting"\x3e\r\n    \x3cdiv class\x3d"label jimu-float-leading" title\x3d"${nls.textSize}"\x3e${nls.textSize}\x3c/div\x3e\r\n    \x3cdiv class\x3d"setting-wapper jimu-float-trailing"\x3e\r\n      \x3cdiv class\x3d"text-size-group jimu-float-leading"\x3e\r\n        \x3c!--role and aria-label added run time--\x3e\r\n        \x3cselect data-dojo-type\x3d"dijit/form/ComboBox" data-dojo-attach-point\x3d"textSizeSelect"\x3e\x3c/select\x3e\r\n      \x3c/div\x3e\r\n      \x3cdiv class\x3d"text-size-group jimu-float-leading"\x3e\r\n        \x3cdiv class\x3d"sliderbar" data-dojo-attach-point\x3d"sliderBar"\x3e\x3c/div\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"setting-items text-color clearFix" data-dojo-attach-point\x3d"textColorSetting"\x3e\r\n    \x3cdiv class\x3d"label jimu-float-leading" title\x3d"${nls.textColor}"\x3e${nls.textColor}\x3c/div\x3e\r\n    \x3cdiv class\x3d"setting-wapper jimu-float-trailing"\x3e\r\n      \x3cdiv class\x3d"font-group jimu-float-leading"\x3e\r\n        \x3cdiv class\x3d"text-color-btn" data-dojo-attach-point\x3d"textColorBtn"\x3e\x3c/div\x3e\r\n      \x3c/div\x3e\r\n      \x3cdiv class\x3d"font-group font-group-btns jimu-float-leading"\x3e\r\n        \x3cdiv class\x3d"font-btn jimu-float-leading bold" data-dojo-attach-point\x3d"bold" tabindex\x3d"0" role\x3d"button" aria-label\x3d"bold" aria-pressed\x3d"false"\x3e\x3c/div\x3e\r\n        \x3cdiv class\x3d"font-btn jimu-float-leading italic" data-dojo-attach-point\x3d"italic" tabindex\x3d"0" role\x3d"button" aria-label\x3d"italic" aria-pressed\x3d"false"\x3e\x3c/div\x3e\r\n        \x3cdiv class\x3d"font-btn jimu-float-leading underline" data-dojo-attach-point\x3d"underline" tabindex\x3d"0" role\x3d"button" aria-label\x3d"underline" aria-pressed\x3d"false"\x3e\x3c/div\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"setting-items text-color clearFix" data-dojo-attach-point\x3d"transparencySetting"\x3e\r\n    \x3cdiv class\x3d"label jimu-float-leading" title\x3d"${nls.transparency}"\x3e${nls.transparency}\x3c/div\x3e\r\n    \x3cdiv class\x3d"setting-wapper jimu-float-trailing"\x3e\r\n      \x3cdiv class\x3d"font-group jimu-float-leading"\x3e\r\n        \x3cdiv class\x3d"text-color-btn" data-dojo-attach-point\x3d"transparencySlider"\x3e\x3c/div\x3e\r\n      \x3c/div\x3e      \r\n    \x3c/div\x3e\r\n  \x3c/div\x3e  \r\n  \x3cdiv class\x3d"setting-items halo-size clearFix" data-dojo-attach-point\x3d"haloSetting"\x3e\r\n    \x3cdiv class\x3d"label jimu-float-leading" title\x3d"${nls.halo}"\x3e${nls.halo}\x3c/div\x3e\r\n    \x3cdiv class\x3d"setting-wapper jimu-float-trailing"\x3e\r\n      \x3cdiv class\x3d"halo-size-group jimu-float-leading"\x3e\r\n        \x3cselect data-dojo-type\x3d"jimu/dijit/formSelect" data-dojo-attach-point\x3d"haloSizeSelect" aria-label\x3d"${nls.halo}"\x3e\x3c/select\x3e\r\n      \x3c/div\x3e\r\n      \x3cdiv class\x3d"halo-size-group jimu-float-leading"\x3e\r\n        \x3cdiv class\x3d"halo-color-btn" data-dojo-attach-point\x3d"haloColorBtn" aria-label\x3d"${nls.halo}"\x3e\x3c/div\x3e        \r\n      \x3c/div\x3e\r\n      \x3cdiv class\x3d"halo-size-group jimu-float-leading"\x3e\r\n        \x3cdiv class\x3d"label" title\x3d"${nls.show}"\x3e${nls.show}\x3c/div\x3e\r\n      \x3c/div\x3e\r\n      \x3cdiv class\x3d"halo-size-group jimu-float-leading"\x3e\r\n        \x3cinput class\x3d"halo-toggle" data-dojo-type\x3d"dijit/form/CheckBox" data-dojo-attach-point\x3d"showHalo" checked\x3d"true" aria-label\x3d"${nls.show}"/\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/_base/lang dojo/on dojo/_base/html dojo/_base/array dojo/dom-attr dojo/Evented dojo/query dojo/keys dojo/aspect dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/text!../templates/FontSetting.html jimu/dijit/ColorPickerPopup dijit/form/HorizontalSlider ./TransparencyEditor dojo/store/Memory jimu/dijit/formSelect jimu/dijit/CheckBox jimu/dijit/ImageChooser dijit/form/ComboBox".split(" "),function(r,c,e,f,n,g,t,u,h,p,v,w,x,y,q,z,A,B){return r([v,
w,x,t],{templateString:y,nls:null,_FONTS:null,_MIN_TEXT_SIZE:12,_MAX_TEXT_SIZE:48,_INTERVAL_TEXT_SIZE:2,_DEFAULT_CONFIG:null,postCreate:function(){this.inherited(arguments);this._FONTS="Arial;Comic Sans MS;Courier New;Garamond;Tahoma;Times New Roman;Verdana".split(";");this._DEFAULT_CONFIG={font:{fontFamily:this._FONTS[0],bold:!1,italic:!1,underline:!1},fontSize:"24",textColor:"#282828",haloSize:1,haloColor:"#FFFFFF",haloOn:!0,labelTransparency:1};this.config=c.mixin(c.clone(this._DEFAULT_CONFIG),
this.config);n.forEach(this._FONTS,c.hitch(this,function(b){this.fontSelect.addOption({value:b,label:b})}));for(var a=new B({}),d=this._MIN_TEXT_SIZE,k=this._MAX_TEXT_SIZE;d<=k;d+=this._INTERVAL_TEXT_SIZE)a.put({id:d,name:d});this.textSizeSelect.store=a;g.set(this.textSizeSelect.domNode,"aria-label",this.nls.textSize);g.set(this.textSizeSelect.domNode,"role","combobox");g.set(this.textSizeSelect.domNode,"aria-expanded","false");p.after(this.textSizeSelect,"loadAndOpenDropDown",c.hitch(this,function(){g.set(this.textSizeSelect.domNode,
"aria-expanded","true")}));p.after(this.textSizeSelect,"closeDropDown",c.hitch(this,function(){g.set(this.textSizeSelect.domNode,"aria-expanded","false")}));this.textSizeSelect.validator=c.hitch(this,function(){var b=this.textSizeSelect.getValue();return null!==b&&""!==b?!isNaN(b):!1});this.textSizeSlider=new z({name:"slider",value:0,minimum:this._MIN_TEXT_SIZE,maximum:this._MAX_TEXT_SIZE,discreteValues:this.textSizeSelect.store.data.length+1,intermediateChanges:!0,showButtons:!1,style:"display: inline-block;",
"aria-label":this.nls.textSize},this.sliderBar);this.textSizeSlider.startup();a="";this.nls.gridSettings&&(a=this.nls.gridSettings.colorPicker);this.textColorPicker=new q({role:"button",tabindex:"0","aria-label":this.nls.textColor+" "+a,appearance:{showTransparent:!1,showColorPalette:!0,showCoustom:!0,showCoustomRecord:!0},recordUID:this.recordUID});this.textColorPicker.placeAt(this.textColorBtn);this.textColorPicker.startup();this.labelTransparency=new A({ariaLabel:this.nls.transparency},this.transparencySlider);
this.labelTransparency.startup();var l=[];d=1;for(k=10;d<=k;d+=1){var C={value:d.toString(),label:d.toString()};l.push(C)}this.haloSizeSelect.addOption(l);this.haloSizeSelect.validator=c.hitch(this,function(){var b=this.haloSizeSelect.get("value");return null!==b&&""!==b?!isNaN(b):!1});this.haloColorPicker=new q({role:"button",tabindex:"0","aria-label":this.nls.halo+" "+a,appearance:{showTransparent:!1,showColorPalette:!0,showCoustom:!0,showCoustomRecord:!0}});this.haloColorPicker.placeAt(this.haloColorBtn);
this.haloColorPicker.startup();this.own(e(this.fontSelect,"change",c.hitch(this,function(b){if(this.config.font.fontFamily!==b)this.onSettingChange({font:{fontFamily:b,bold:this.config.font.bold,italic:this.config.font.italic,underline:this.config.font.underline}})})));this._initAppearance();this.own(e(this.bold,"click",c.hitch(this,function(){this._clickHandlerOfBoldItalicUnderline(this.bold,"bold")})));this.own(e(this.italic,"click",c.hitch(this,function(){this._clickHandlerOfBoldItalicUnderline(this.italic,
"italic")})));this.own(e(this.underline,"click",c.hitch(this,function(){this._clickHandlerOfBoldItalicUnderline(this.underline,"underline")})));this.own(e(this.bold,"keydown",c.hitch(this,function(b){b.keyCode!==h.ENTER&&b.keyCode!==h.SPACE||this._clickHandlerOfBoldItalicUnderline(this.bold,"bold")})));this.own(e(this.italic,"keydown",c.hitch(this,function(b){b.keyCode!==h.ENTER&&b.keyCode!==h.SPACE||this._clickHandlerOfBoldItalicUnderline(this.italic,"italic")})));this.own(e(this.underline,"keydown",
c.hitch(this,function(b){b.keyCode!==h.ENTER&&b.keyCode!==h.SPACE||this._clickHandlerOfBoldItalicUnderline(this.underline,"underline")})));this.own(e(this.textSizeSelect,"change",c.hitch(this,function(b){this.config.fontSize!==b&&!1!==this.textSizeSelect.isValid()&&(this.setTextSize(b),this.onSettingChange({fontSize:b}))})));this.own(e(this.textSizeSlider,"change",c.hitch(this,function(b){this.config.fontSize!==b&&(this.setTextSize(Math.round(b)),this.onSettingChange({fontSize:b}))})));this.own(e(this.textColorPicker,
"change",c.hitch(this,function(b){if(this.config.textColor!==b)this.onSettingChange({textColor:b.toHex()})})));this.own(this.labelTransparency.watch("transparency",c.hitch(this,function(){this.onSettingChange({labelTransparency:this.labelTransparency.getValues().transparency})})));this.own(e(this.haloSizeSelect,"change",c.hitch(this,function(b){if(this.config.haloSize!==b&&!1!==this.haloSizeSelect.isValid())this.onSettingChange({haloSize:b})})));this.own(e(this.haloColorPicker,"change",c.hitch(this,
function(b){if(this.config.haloColor!==b)this.onSettingChange({haloColor:b.toHex()})})));this.own(e(this.showHalo,"change",c.hitch(this,function(){this.onSettingChange({haloOn:this.showHalo.checked})})));d=u(".jimu-color-pickerPopup",this.domNode);n.forEach(d,c.hitch(this,function(b){this.own(e(b,"keydown",c.hitch(this,function(m){m.keyCode!==h.ENTER&&m.keyCode!==h.SPACE||m.currentTarget.click()})))}))},startup:function(){this.inherited(arguments);this.setConfig(this.config);this.refresh()},onSettingChange:function(a){this.config=
c.mixin(this.config,a);this.onChange(this.config)},onChange:function(a){this.emit("change",a)},refresh:function(){this.onSettingChange({})},isValid:function(){return!1===this.textSizeSelect.isValid()?!1:!0},getConfig:function(){return this.isValid()?this.config:!1},setConfig:function(a){if("undefined"!==a){"undefined"!==typeof a.font&&(this.config.font=a.font,this.config.font.fontFamily&&this.fontSelect.set("value",this.config.font.fontFamily),this.fontBtnClickd(this.config.font));"undefined"!==typeof a.fontSize&&
(this.config.fontSize=a.fontSize,this.setTextSize(this.config.fontSize));if("undefined"===typeof a.textColor||""===a.textColor)a.textColor=this._DEFAULT_CONFIG.textColor;this.config.textColor=a.textColor;if("undefined"===typeof a.labelTransparency||""===a.labelTransparency)a.labelTransparency=this._DEFAULT_CONFIG.labelTransparency;this.config.labelTransparency=a.labelTransparency;this.labelTransparency.setValues({transparency:this.config.labelTransparency});if("undefined"===typeof a.haloSize||""===
a.haloSize)a.haloSize=this._DEFAULT_CONFIG.haloSize;this.config.haloSize=a.haloSize;this.haloSizeSelect.set("value",a.haloSize);if("undefined"===typeof a.haloColor||""===a.haloColor)a.haloColor=this._DEFAULT_CONFIG.haloColor;this.config.haloColor=a.haloColor;f.setStyle(this.textColorPicker.domNode,"backgroundColor",this.config.textColor);this.textColorPicker.picker.refreshRecords();this.textColorPicker.picker.setColor(this.config.textColor,!1,!0);f.setStyle(this.haloColorPicker.domNode,"backgroundColor",
this.config.haloColor);this.haloColorPicker.picker.refreshRecords();this.haloColorPicker.picker.setColor(this.config.haloColor,!1,!0);if("undefined"===typeof a.haloOn||""===a.haloOn)a.haloOn=this._DEFAULT_CONFIG.haloOn;this.showHalo.set("checked",this.config.haloOn)}},_clickHandlerOfBoldItalicUnderline:function(a,d){var k=!f.hasClass(a,"selected");a={fontFamily:this.config.font.fontFamily,bold:this.config.font.bold,italic:this.config.font.italic,underline:this.config.font.underline};"bold"===d?a.bold=
k:"italic"===d?a.italic=k:a.underline=k;var l={};l[d]=k;this.fontBtnClickd(l);this.onSettingChange({font:a})},setTextSize:function(a){a!==this.textSizeSelect.getValue()&&this.textSizeSelect.set("value",a);a!==this.textSizeSlider.getValue()&&(a>this._MAX_TEXT_SIZE?a=this._MAX_TEXT_SIZE:a<this._MIN_TEXT_SIZE&&(a=this._MIN_TEXT_SIZE),this.textSizeSlider.set("value",a))},fontBtnClickd:function(a){!0===a.bold?(f.addClass(this.bold,"selected"),g.set(this.bold,"aria-pressed","true")):!1===a.bold&&(f.removeClass(this.bold,
"selected"),g.set(this.bold,"aria-pressed","false"));!0===a.italic?(f.addClass(this.italic,"selected"),g.set(this.italic,"aria-pressed","true")):!1===a.italic&&(f.removeClass(this.italic,"selected"),g.set(this.italic,"aria-pressed","false"));!0===a.underline?(f.addClass(this.underline,"selected"),g.set(this.underline,"aria-pressed","true")):!1===a.underline&&(f.removeClass(this.underline,"selected"),g.set(this.underline,"aria-pressed","false"))},_initAppearance:function(){this.appearance&&(!1===this.appearance.bold&&
f.addClass(this.bold,"hide"),!1===this.appearance.italic&&f.addClass(this.italic,"hide"),!1===this.appearance.underline&&f.addClass(this.underline,"hide"))}})});