// 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:{"widgets/Print/setting/_build-generate_module":function(){define(["dojo/text!./Setting.html","dojo/text!./css/style.css","dojo/i18n!./nls/strings"],function(){})},"url:widgets/Print/setting/Setting.html":'\x3cdiv style\x3d"width:100%;height:100%;"\x3e\r\n  \x3cdiv class\x3d"settings-section" data-dojo-attach-point\x3d"searchesSection"\x3e\r\n    \x3ctable class\x3d"setting-table input-table" cellspacing\x3d"0"\x3e\r\n      \x3ctbody\x3e\r\n        \x3ctr\x3e\r\n\r\n        \x3ctd class\x3d"first"\x3e*${nls.serviceURL}\x3c/td\x3e\r\n          \x3ctd class\x3d"second"\x3e\r\n            \x3cinput type\x3d"text" data-dojo-type\x3d"dijit/form/ValidationTextBox"\r\n            data-dojo-attach-point\x3d"serviceURL"\r\n            required\x3d"true" data-dojo-props\x3d"style:{width:\'100%\'}"/\x3e\r\n          \x3c/td\x3e\r\n\r\n          \x3ctd\x3e\x3cdiv data-dojo-attach-point\x3d"checkProcessDiv" style\x3d"display:none"\x3e\r\n            \x26nbsp;\x26nbsp;\x3cimg data-dojo-attach-point\x3d"checkImg" width\x3d"20px" height\x3d"20px" src\x3d""\x3e\x3c/div\x3e\r\n          \x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd class\x3d"first"\x3e${nls.defaultTitle}\x3c/td\x3e\r\n          \x3ctd class\x3d"second" colspan\x3d"2"\x3e\r\n            \x3cinput type\x3d"text" data-dojo-type\x3d"dijit/form/ValidationTextBox"\r\n            data-dojo-attach-point\x3d"defaultTitle" data-dojo-attach-event\x3d"Blur:_onTitleBlur" placeHolder\x3d"ArcGIS WebMap"\r\n            data-dojo-props\x3d\'style:{width:"100%"}\'/\x3e\r\n          \x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd class\x3d"first"\x3e${nls.defaultAuthor}\x3c/td\x3e\r\n          \x3ctd class\x3d"second" colspan\x3d"2"\x3e\r\n            \x3cinput type\x3d"text" data-dojo-type\x3d"dijit/form/ValidationTextBox" placeHolder\x3d"ArcGIS Web AppBuilder"\r\n            data-dojo-attach-point\x3d"defaultAuthor" data-dojo-attach-event\x3d"Blur:_onAuthorBlur" data-dojo-props\x3d\'style:{width:"100%"}\'/\x3e\r\n          \x3c/td\x3e\r\n      \x3c/tr\x3e\r\n      \x3ctr\x3e\r\n          \x3ctd class\x3d"first"\x3e${nls.defaultCopyright}\x3c/td\x3e\r\n          \x3ctd class\x3d"second" colspan\x3d"2"\x3e\r\n            \x3ctextarea data-dojo-attach-point\x3d"defaultCopyright" name\x3d"copyright"\r\n                      data-dojo-attach-event\x3d"Blur:_onCopyrightBlur"\r\n                      data-dojo-type\x3d"dijit/form/SimpleTextarea"\r\n                      style\x3d"width:100%;height:60px;resize:none;font-size:14px;"\x3e\x3c/textarea\x3e\r\n            \x3cdiv data-dojo-attach-point\x3d"copyrightEditableChk" class\x3d"jimu-float-leading"\r\n            data-dojo-type\x3d"jimu/dijit/CheckBox" data-dojo-props\x3d"label:\'${nls.editable}\'"\x3e\x3c/div\x3e\r\n          \x3c/td\x3e\r\n      \x3c/tr\x3e\r\n      \x3ctr style\x3d"display: none"\x3e\r\n          \x3ctd class\x3d"first"\x3e${nls.defaultFormat}\x3c/td\x3e\r\n          \x3ctd class\x3d"second" colspan\x3d"2"\x3e\r\n            \x3cselect data-dojo-type\x3d"dijit/form/ComboBox" data-dojo-attach-point\x3d"defaultFormat"\x3e\r\n            \x3c/select\x3e\r\n          \x3c/td\x3e\r\n      \x3c/tr\x3e\r\n      \x3ctr style\x3d"display: none"\x3e\r\n          \x3ctd class\x3d"first"\x3e${nls.defaultLayout}\x3c/td\x3e\r\n          \x3ctd class\x3d"second" colspan\x3d"2"\x3e\r\n            \x3cselect data-dojo-type\x3d"dijit/form/ComboBox" data-dojo-attach-point\x3d"defaultLayout"\x3e\r\n            \x3c/select\x3e\r\n          \x3c/td\x3e\r\n      \x3c/tr\x3e\r\n      \x3ctr style\x3d"display: none"\x3e\r\n          \x3ctd class\x3d"first"\x3e${nls.advancedOption}\x3c/td\x3e\r\n          \x3ctd class\x3d"second" colspan\x3d"2"\x3e\r\n            \x3cdiv data-dojo-attach-point\x3d"showAdvancedOptionChk"\r\n                data-dojo-type\x3d"jimu/dijit/CheckBox"\r\n                data-dojo-props\x3d"checked:true"\x3e\r\n          \x3c/td\x3e\r\n      \x3c/tr\x3e\r\n      \x3c/tbody\x3e\r\n    \x3c/table\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:widgets/Print/setting/css/style.css":".jimu-widget-print-setting{margin:0; padding:0; font-size:15px;}.jimu-widget-print-setting .dijitArrowButtonContainer{width: 17px;}.jimu-widget-print-setting .setting-table \x3e thead \x3e tr \x3e th,.jimu-widget-print-setting .setting-table \x3e tbody \x3e tr \x3e td{height:40px; line-height:40px; vertical-align:middle;}.jimu-widget-print-setting .input-table \x3e tbody \x3e tr \x3e .first{width:auto; text-align: right; padding-right:15px; min-width: 200px;}.jimu-widget-print-setting .input-table \x3e tbody \x3e tr \x3e .second{width:650px;}.jimu-widget-print-setting .jimu-checkbox .checkbox {margin: 12px 0;}",
"*now":function(p){p(['dojo/i18n!*preload*widgets/Print/setting/nls/Setting*["ar","bs","ca","cs","da","de","en","el","es","et","fi","fr","he","hr","hu","id","it","ja","ko","lt","lv","nb","nl","pl","pt-br","pt-pt","ro","ru","sk","sl","sr","sv","th","tr","zh-cn","uk","vi","zh-hk","zh-tw","ROOT"]'])},"*noref":1}});
define("dojo/_base/declare jimu/BaseWidgetSetting dijit/_WidgetsInTemplateMixin dojo/_base/lang dojo/on dojo/Deferred dojo/dom-style dojo/dom-attr esri/request jimu/dijit/Message jimu/portalUtils jimu/portalUrlUtils jimu/utils dojo/store/Memory dijit/form/ValidationTextBox dijit/form/ComboBox jimu/dijit/CheckBox dijit/form/SimpleTextarea".split(" "),function(p,u,v,e,w,x,f,y,z,r,A,q,d,t){return p([u,v],{baseClass:"jimu-widget-print-setting",memoryFormat:new t,memoryLayout:new t,_portalPrintTaskURL:null,
validUrl:!0,startup:function(){this.inherited(arguments);this.setConfig(this.config);y.set(this.checkImg,"src",require.toUrl("jimu")+"/images/loading.gif");this.serviceURL.validator=e.hitch(this,this.validator);this.own(w(this.serviceURL,"Change",e.hitch(this,this.onUrlChange)))},validator:function(a){if(!this.validUrl)return this.serviceURL.invalidMessage=this.nls.urlNotAvailable,!1;var c=q.getNewPrintUrl(this.appConfig.portalUrl);if(a===c||/^https?:\/\/.+sharing\/tools\/newPrint$/.test(a)||/^https?:\/\/.+\/GPServer\//.test(a))return!0;
this.serviceURL.invalidMessage=this.nls.notPrintTask;return!1},onUrlChange:function(){this.validUrl=!0;if(this.serviceURL.validate()){var a=this.serviceURL.get("value");if(a){f.set(this.checkProcessDiv,"display","");this.memoryFormat.data={};this.memoryLayout.data={};this.defaultFormat.set("store",this.memoryFormat);this.defaultLayout.set("store",this.memoryLayout);this.defaultFormat.set("value","");this.defaultLayout.set("value","");f.set(this.defaultFormat.domNode.parentNode.parentNode,"display",
"none");f.set(this.defaultLayout.domNode.parentNode.parentNode,"display","none");var c=q.setHttpProtocol(this.serviceURL.get("value")),b=q.getNewPrintUrl(this.appConfig.portalUrl);c===b||/sharing\/tools\/newPrint$/.test(c)?f.set(this.checkProcessDiv,"display","none"):this._getPrintTaskInfo(a)}}},_getPrintTaskInfo:function(a){z({url:a,content:{f:"json"},handleAs:"json",callbackParamName:"callback",timeout:6E4,load:e.hitch(this,this._handlePrintInfo),error:e.hitch(this,this._handleError)})},_handleError:function(){f.set(this.checkProcessDiv,
"display","none");this.validUrl=!1;this.serviceURL.validate()},_handlePrintInfo:function(a){f.set(this.checkProcessDiv,"display","none");f.set(this.defaultFormat.domNode.parentNode.parentNode,"display","");f.set(this.defaultLayout.domNode.parentNode.parentNode,"display","");var c=!1,b=!1;if(a&&a.parameters)for(var B=a.parameters.length,h=0;h<B;h++){var g=a.parameters[h];if("Format"===g.name||"Layout_Template"===g.name){var k=a.parameters[h].choiceList,l=a.parameters[h].defaultValue,m=[];if(k)for(var C=
k.length,n=0;n<C;n++)m.push({name:k[n],id:k[n]});else m.push({name:l,id:l});"Format"===g.name?(this.memoryFormat.data=m,this.defaultFormat.set("store",this.memoryFormat),this.config.serviceURL===this.serviceURL.get("value")&&this.config.defaultFormat?this.defaultFormat.set("value",this.config.defaultFormat):this.defaultFormat.set("value",l)):(this.memoryLayout.data=m,this.defaultLayout.set("store",this.memoryLayout),this.config.serviceURL===this.serviceURL.get("value")&&this.config.defaultLayout?
this.defaultLayout.set("value",this.config.defaultLayout):this.defaultLayout.set("value",l))}"string"===typeof g.name&&"web_map_as_json"===g.name.toLowerCase()&&(c=!0);"string"===typeof g.name&&"output_file"===g.name.toLowerCase()&&(b=!0)}c&&b||(this.validUrl=!1,this.serviceURL.validate())},setConfig:function(a){this.config=a;this.loadPrintURL(a);a.defaultTitle?this.defaultTitle.set("value",d.stripHTML(a.defaultTitle)):this.defaultTitle.set("value","ArcGIS WebMap");a.defaultAuthor?this.defaultAuthor.set("value",
d.stripHTML(a.defaultAuthor)):this.defaultTitle.set("value","ArcGIS Web AppBuilder");a.defaultCopyright&&this.defaultCopyright.set("value",d.stripHTML(a.defaultCopyright));this.copyrightEditableChk.setValue(!1!==a.copyrightEditable)},_onTitleBlur:function(){this.defaultTitle.set("value",d.stripHTML(this.defaultTitle.get("value")))},_onAuthorBlur:function(){this.defaultAuthor.set("value",d.stripHTML(this.defaultAuthor.get("value")))},_onCopyrightBlur:function(){this.defaultCopyright.set("value",d.stripHTML(this.defaultCopyright.get("value")))},
getConfig:function(){if(!this.serviceURL.validate()){var a=new r({message:this.nls.warning,buttons:[{label:this.nls.ok,onClick:e.hitch(this,function(){a.close()})}]});return!1}this.config.serviceURL=this.serviceURL.get("value");this.config.defaultTitle=d.stripHTML(this.defaultTitle.get("value"));this.config.defaultAuthor=d.stripHTML(this.defaultAuthor.get("value"));this.config.defaultCopyright=d.stripHTML(this.defaultCopyright.get("value"));this.config.defaultFormat=this.defaultFormat.get("value");
this.config.defaultLayout=this.defaultLayout.get("value");this.config.copyrightEditable=this.copyrightEditableChk.getValue();return this.config},loadPrintURL:function(){this._getPrintTaskURL(this.appConfig.portalUrl).then(e.hitch(this,function(a){this.serviceURL.set("value",a)}))},_getPrintTaskURL:function(a){var c=new x;if(this.config&&this.config.serviceURL)return c.resolve(this.config.serviceURL),c;A.getPortalSelfInfo(a).then(e.hitch(this,function(b){(b=b&&b.helperServices&&b.helperServices.printTask&&
b.helperServices.printTask.url)?c.resolve(b):c.reject("error")}),e.hitch(this,function(b){new r({message:this.nls.portalConnectionError||b&&b.message||"portal connection error"});c.reject("error");console.error(b)}));return c}})});