webpackJsonp([20],{352:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n.n(i),a=n(853),o=n(344),s=n(940),l=n(57),u=n(11),p=n(127),f=n(858),c=n(16),d=n(96),h=n(856),y=n(355),b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},v=[{key:"name",type:l.FieldTypes.STRING},{key:"hub_url",type:l.FieldTypes.STRING},{key:"hub_description",type:l.FieldTypes.STRING,optional:!0},{key:"share_profile",type:l.FieldTypes.NUMBER,optional:!0},{key:"auto_connect",type:l.FieldTypes.BOOLEAN},{key:"nick",type:l.FieldTypes.STRING,optional:!0},{key:"user_description",type:l.FieldTypes.STRING,optional:!0}],_=function(e){return e&&(0===e.indexOf("adc://")||0===e.indexOf("adcs://"))},N=function(e,t){return e.filter(function(e){return _(t)||e.id===o.a.HIDDEN_PROFILE_ID}).map(y.a.normalizeEnumValue)},E=r.a.createClass({displayName:"FavoriteHubDialog",mixins:[p.b],isNew:function(){return!this.props.hubEntry},onFieldChanged:function(e,t,n){return-1===e.indexOf("hub_url")||_(t.hub_url)||t.share_profile===o.a.HIDDEN_PROFILE_ID?null:Promise.resolve({share_profile:null})},save:function(){return this.form.save()},onSave:function(e){return this.isNew()?u.a.post(s.b.HUBS_URL,e):u.a.patch(s.b.HUBS_URL+"/"+this.props.hubEntry.id,e)},onFieldSetting:function(e,t,n){"share_profile"===e&&b(t,{help:"Custom share profiles can be selected only after entering an ADC hub address (starting with adc:// or adcs://)",nullOption:{value:"null",text:"Global default"},factory:d.a.form.Select,options:N(this.props.profiles,n.hub_url),transformer:y.a.intTransformer})},render:function(){var e=this,t=this.isNew()?"Add favorite hub":"Edit favorite hub";return r.a.createElement(a.a,b({className:"fav-hub",title:t,onApprove:this.save,closable:!1,icon:c.a.FAVORITE},this.props),r.a.createElement(h.a,{ref:function(t){return e.form=t},title:"User information",onFieldChanged:this.onFieldChanged,onFieldSetting:this.onFieldSetting,onSave:this.onSave,fieldDefinitions:v,value:this.props.hubEntry}))}});t.default=n.i(f.a)(E,!0)},940:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i={DISCONNECTED:0,CONNECTING:1,CONNECTED:2};t.b={MODULE_URL:"favorite_hubs",HUBS_URL:"favorite_hubs"}}});
//# sourceMappingURL=favorite-hubs-children.37d538083f1a1df55e3c.chunk.js.map