
kerio.waw.ui.urlGroupEditor = {
x_m: function(x_n) {
var x_1b = kerio.lib;
var x_x = x_1b.x_x;
var x_o = (kerio.waw.status.x_p.x_q === x_r.x_s.x_t);
var x_w = 'UrlGroupManager';
var x_u = ('urlGroupAdd' === x_n);
var x_1wj = x_r.x_mn;
var x_1wk = [
{'x_a6': x_x('URL', 'urlGroupEditor'),      'x_1o': x_1wj.x_mr},
{'x_a6': x_x('URL Group', 'urlGroupEditor'),'x_1o': x_1wj.x_mq}
];var x_br = x_1b.x_a1(
{	x_a2: 100,
pl: 130
});

var x_1e = [
{
x_1f: 'x_79',
x_23: x_x('Properties', 'urlGroupEditor'),
x_br: x_br,
x_1p: 'removeFieldsetMargin',
x_1e: [
{x_1f: 'x_9u',
x_1j: 'x_1wl',
x_5z: x_1wk,
x_23: x_x('Type:', 'urlGroupEditor'),
x_a5: 'x_a6',
x_a7: 'x_1o',
x_1o: x_1wj.x_mr,

x_9t: function(x_1c, x_9u) {
var x_di = x_1c.x_16.x_1wm();
x_1c.x_2k(['x_1gv'], x_di);
x_1c.x_2k(['x_1wn'], !x_di);
} },{x_1j: 'x_1wn',
x_93: 127,
x_ge: true,
x_23: x_x('URL:', 'urlGroupEditor'),
x_b6: {
x_b7: false,
x_nv: 'x_nw'
}
},{x_1f: 'x_9u',
x_1j: 'x_1gv',
x_23: x_x('URL Group:', 'urlGroupEditor'),
x_1m: true,
x_5z: {}, x_1o: x_x('Loading groups…', 'urlGroupEditor'),
x_31: true, x_a5: 'name',
x_a7: 'id'
},{x_93: 255,
x_ge: true,
x_1j: 'x_1wo',
x_23: x_x('Description:', 'common'),
x_b6: {
x_nv: 'x_nx'
}
}]
}
];var x_1y,
x_5c = false;
if (!x_u) {
x_5c = true;
if (x_o) {
x_1y = x_x('View URL', 'groupingDialog');
}
else {
x_1y = x_x('Edit URL', 'groupingDialog');
}
}
else {
x_1y = x_x('Add URL', 'groupingDialog');
}
var x_10 = {
x_1e: x_1e,
x_5p: x_o,
x_5c: !x_u,
x_vs: {
x_6a: '/admin/stub/dataMiner.php',
x_hi: x_w },
x_2n: {
x_1v: 300
},
x_1gv: 'x_1gv',
x_vr: {
x_1y: x_1y
},

x_1wm: function() {
var x_1wp = x_r.x_mn;
var x_1wq = (x_1wp.x_mq === this.x_1c.x_1wl.x_2t());
return x_1wq;
},

x_mc: function(x_16) {
x_16.x_iy();
}
};var x_16 = new kerio.adm.x_17.x_vt(x_n, x_10);
var x_1c = x_16.x_1c;
x_16.x_27({
x_u: x_u,
x_o: x_o,
x_w: x_w,
x_1wl: x_1c.x_29('x_1wl')
});
this.x_2a(x_16);
x_1c.x_27({
x_1gv: x_1c.x_29('x_1gv'),
x_1wl: x_1c.x_29('x_1wl'),
x_o5: []
});
return x_16;
},
x_2a: function(x_2b) {

x_2b.x_2c = function(x_28){
var x_1c = this.x_1c;
var x_47 = x_28.x_47;
var x_vv = (undefined !== x_47 && !this.x_u); x_1c.x_o5 = x_47;
this.x_5d = x_28.x_5d;
var x_1f = ( x_vv ) ? x_47.type: x_r.x_mn.x_mr;
if (!this.x_1wl) {
this.x_1wl = x_1c.x_29('x_1wl');
}
this.x_1wl.x_9w(x_1f);
if (x_vv) {
this.x_7k.call(x_1c, x_47);
}
var x_vw, x_1gv;
if (x_vv) {
x_vw = {
id: x_47.groupId,
name: x_47.groupName
};
x_1gv = {
id: x_47.childGroupId,
name: x_47.childGroupName
};
}
else {
var x_nm = x_28.x_nm;
if (x_nm.id) {
x_vw = {
id: x_nm.id,
name: x_nm.name
};
}
else {
x_vw = {};
}
x_1gv = {};
}
this.x_vx(x_vw, x_1gv);
};
x_2b.x_7k = function(x_47) {
var x_1c = this;
var x_7h = {};
x_7h.x_1wo = x_47.description;
x_7h.x_1j = x_47.id;
if (x_r.x_mn.x_mr === x_47.type) {
x_7h.x_1wn = x_47.url;
} else {
x_7h.x_1gv = x_47.childGroupName;
}
x_7h.x_1wl = x_47.type;
x_1c.x_7k(x_7h);
};var x_nj = kerio.waw.shared.x_az.x_nk.x_3e;

x_2b.x_1wr = x_nj.x_1wr;

x_2b.x_iy = function() {
if (this.x_o) {
return; }
var x_1c = this.x_1c;
var x_47 = x_1c.x_7i();
var x_1ws = x_r.x_mn;
var x_1wt = {};
var x_vy = this.x_vz();
x_1wt.groupId = x_vy.id;
x_1wt.groupName = x_vy.name;
switch (x_47.x_1wl) {
case x_1ws.x_mr:
x_1wt.url = x_47.x_1wn;
break;
case x_1ws.x_mq:
x_1wt.childGroupId = x_47.x_1gv;
x_1wt.childGroupName = x_1c.x_1gv.x_vj();
break;
} x_1wt.type = x_47.x_1wl;
x_1wt.description = x_47.x_1wo;
var x_1wu = (this.x_u || true === x_1c.x_o5.enabled);
x_1wt.enabled = x_1wu;
if (this.x_u) {
this.x_5d.x_4y('create', {groups: [x_1wt]}, {x_2s: {x_4z: true}, x_2e: this.x_jk, x_2q: this});
}
else {
this.x_5d.x_4y('set', {groupIds: [x_1c.x_o5.id], details: x_1wt},
{x_2s: {x_4z: true}, x_2e: this.x_jk, x_2q: this});
}
};
x_2b.x_jk = function(x_6v) {
if (!x_6v.x_6x) {
return;
}
this.x_5d.x_6y();
kerio.waw.status.x_14.x_15(true);
this.x_2r();
};}}; 