
kerio.waw.ui.configurationImport = {
x_m: function(x_n) {
var
x_2w = x_n + '_',
x_1b = kerio.lib,
x_x = x_1b.x_x,
x_ju, x_jv,
x_jw, x_jx,
x_jy, x_jz,
x_k0, x_k1,
x_k2, x_k3,
x_k4, x_k5,
x_16, x_10,
x_go,
x_k6,
x_k7;
x_k3 = {
x_4v: true,
x_1e: [
{
x_1j: 'x_k8',
x_23: x_x('Select Interface…', 'configurationImport'),
x_25: this.x_k9
}
],
x_4c: this.x_ka
};
x_k2 = new kerio.lib.x_37(x_2w + 'x_3l' + '_' + 'x_32', x_k3); 
x_go = function(x_1o, x_47, x_fl, x_kb, x_3l) {
var
x_7s = x_3l.x_kc.config[x_kb].dataIndex; return {
x_kd: false,
x_ke: true,
x_kf: ('importedInterface' === x_7s) ? x_3l.x_k6 : x_3l.x_k7
};
}; 
x_k6 = function(x_1o, x_47, x_fl, x_kb, x_3l, x_g7) {
if (0 === x_g7) {
return x_fi.x_kg(x_1o, x_47);
}
return {
x_47: x_1o,
x_cy: ''
};
}; 
x_k7 = function(x_1o, x_47, x_fl, x_kb, x_3l, x_g7) {
if (0 === x_g7) {
if (x_r.x_kh.x_ki !== x_1o) {
return x_fi.x_kg(x_1o, this.x_16.x_kj[x_47.currentInterface.x_fk]);
}
x_1o = x_3l.x_kk;
}
return {
x_47: x_1o,
x_cy: ''
};
}; x_k1 = {
x_5s: 'x_kl',
x_1p: 'removePadding interfaceList undead', x_5x: {
x_d2: false,
x_1e: [
{x_7s: 'type'         ,  x_7t: true},
{x_7s: 'importedId'   ,  x_7t  : true},
{x_7s: 'name'         ,  x_1m: true, x_gn: true,

x_7u: function(x_1o, x_47) {
var
x_km = x_47.currentInterface,
x_kj = this.x_16.x_kj,
x_kn;
x_47.importedInterface  = [x_47.name, ('0.0.0.0' === x_47.ip) ? '' : x_47.ip, ''];
x_kn = x_kj[x_km.x_fk];
if (x_kn) {
x_47.x_km = [x_kn.id.name, x_kn.ip, x_kn.MAC];
}
else {
x_47.x_km = this.x_ko;
}
return {x_47: ''}; }},
{x_7s: 'importedInterface'  ,  x_23: x_x('Uploaded Configuration', 'configurationImport') , x_1u: 250,
x_go: x_go
},
{x_7s: 'x_km'          ,  x_23: x_x('This Firewall (Double-click the row to change it)', 'configurationImport'),
x_go: x_go
}
]
},x_5v: {
x_5w: x_k2
},

x_62: function(){
this.x_k9(this.x_5v.x_5w); }
}; x_k0 = new kerio.lib.x_4g(x_2w + 'x_3l', x_k1);
x_jv = {
x_1e: [
{
x_1f: 'x_1i',
x_1l: true,
x_kp: '<b>' + x_x('Click the button below to upload your exported configuration.', 'configurationImport') + '</b>'
},
{
x_1f: 'x_1i',
x_1l: true,
x_1o: x_x('With import you can restore your old configuration on the same machine, migrate Kerio WinRoute Firewall instalation to a different machine or even share the same configuration on several machines.', 'configurationImport')
},
{
x_1f: 'x_1g',
x_1v: 30,
x_1e: [
{
x_1f: 'x_kq',
x_1j: 'UploadFile', x_23: x_x('Upload configuration file…', 'configurationImport'),
x_65: {
x_kr: false,
x_6a: '/admin/internal/import', x_66: {}
},

x_9t: function(x_1c) {
x_1c.x_16.x_ks();
}
},
{
x_1f: 'x_kt',
x_1j: 'x_ku',
x_1o: 0,
x_b5: 100,
x_kv: {
x_1n: '<b>' + x_x('Import has failed.', 'configurationImport') + '</b>'
},
x_1m: true
}
]
},
{
x_1f: 'x_1i',
x_1l: true,
x_1o: x_x('Please note that upload process may take from few seconds to several minutes depending on file size and your connection speed. Progress bar will be displayed to inform you of the progress status.', 'configurationImport')
}
]
}; x_jx = {
x_1e: [
{
x_1f: 'x_1i',
x_1l: true,
x_1o: x_x("If you import configuration from a different machine or your machine's hardware has changed since last export, Kerio WinRoute Firewall guesses mapping of imported interfaces for the current ones. Please check the assigned interfaces and change them if necessary.", 'configurationImport')
},
{
x_1f: 'x_1i',
x_1l: true,
x_kp: '<b>' + x_x('Set correct interfaces on your firewall so that they match the imported ones.', 'configurationImport') + '</b>'
},
{
x_1f: 'x_1g',
x_1x: x_k0
}
]
}; x_jz = {
x_1e: [
{
x_1f: 'x_1i',
x_kp: '<b>' +  x_x('Your new configuration is ready to apply. Click Finish to restart Kerio WinRoute Firewall.', 'configurationImport') + '</b>',
x_1l: true
},
{
x_1f: 'x_1i',
x_1o: x_x('Please note that new configuration may change address or port for Kerio WinRoute Firewall Web Administration and you may not be able to login back without specifying the correct address in your browser.', 'configurationImport'),
x_1l: true
}
]
}; x_ju     = new x_1b.x_1t(x_2w + 'x_ju',     x_jv);
x_jw = new x_1b.x_1t(x_2w + 'x_jw', x_jx);
x_jy     = new x_1b.x_1t(x_2w + 'x_jy',     x_jz);
x_k5 = {
x_1e: [
{
x_1x: x_ju,
x_23: x_x('Configuration file', 'configurationImport'),
x_1j: 'x_kw'
},
{
x_1x: x_jw,
x_23: x_x('Interfaces', 'configurationImport'),
x_1j: 'x_kx'
},
{
x_1x: x_jy,
x_23: x_x('Finish', 'common'),
x_1j: 'x_ky'
}
]
};
x_k4 = new x_1b.x_kz(x_2w + 'x_k4', x_k5);
x_10 = {
x_1u: 600,
x_l0: 600,
x_1v: 500,
x_l1: 500,
x_1w: true,
x_1y: x_x('Import Configuration', 'configurationImport'),
x_1x: x_k4,
x_1z: [
{
x_31: true,
x_1j: 'x_l2',
x_23: x_x('< Back', 'common'),
x_25: this.x_l3
},
{
x_20: true,
x_31: true,
x_1j: 'x_l4',
x_23: x_x('Next >', 'common'),
x_25: this.x_l5
},
{
x_20: true,
x_1m: true,
x_1j: 'x_l6',
x_23: x_x('Finish', 'common'),
x_24: {
x_1n: x_x('Saving your changes…', 'common')
},
x_25: this.x_l7
},
{
x_21: true,
x_1j: 'x_ji',
x_23: x_x('Cancel', 'common')
}
]
};
x_16 = new x_1b.x_26(x_n, x_10);
x_16.x_27(
{
x_k4: x_k4,
x_l8: x_k0,
x_l9: x_ju,
x_la: x_ju.x_29('UploadFile'),
x_ku: x_ju.x_29('x_ku'),
x_kj: [],
x_lb: []
}
);x_ju.x_27({
x_16: x_16
});
x_k0.x_27({
x_16: x_16,
x_k6: x_k6,
x_k7: x_k7,
x_kk: '      ' + x_x('<Unassigned>', 'interfaceList'),
x_ko: [
x_r.x_kh.x_ki,
'',
''
]
});
kerio.lib.x_6o(x_k0, x_k2, [ kerio.lib.x_6b.x_6d.x_6e.x_4l ]);
this.x_2a(x_16);
return x_16;
},
x_2a: function(x_2b) {
x_2b.x_l8.x_27({
x_k9: this.x_k9
});
x_2b.x_k4.x_27({
x_l3: this.x_l3,
x_l5: this.x_l5,
x_l7: this.x_l7
});

x_2b.x_ks = function() {
var x_32 = this.x_32;
x_32.x_lc('x_l2');
x_32.x_lc('x_l4');
this.x_l9.x_2k(['UploadFile'], false);
this.x_l9.x_2k(['x_ku'], true);
kerio.lib.x_6t.x_6u({
x_28: {
object: 'ConfigurationManager',
method: 'importId'
},
x_2e: this.x_ld,
x_2q: this
});
};

x_2b.x_jo = function() {
var
x_32 = this.x_32;
this.x_le();
x_32.x_jp('x_l4');
x_32.x_jq('x_l6');
this.x_k4.x_lf('x_kw');
this.x_lg = true;
};

x_2b.x_le = function() {
var
x_l9 = this.x_l9;
x_l9.x_2h();
x_l9.x_2k('UploadFile', true);
x_l9.x_2k('x_ku', false);
};

x_2b.x_ld = function(x_6v) {
var
x_1j;
if (x_6v.x_6x) {
x_1j = x_6v.x_ac.id;
this.x_la.x_lh.x_65.x_6a = '/admin/internal/import?id=' + x_1j; this.x_li = x_1j;
this.x_lg = false;
this.x_lj();
}
else {
this.x_2r();
}
};

x_2b.x_lj = function() {
this.x_la.x_lk();
this.x_ll();
};

x_2b.x_ll = function() {
kerio.lib.x_6t.x_6u({
x_28: {
object: 'ConfigurationManager',
method: 'getUploadStatus',
params: kerio.lib.x_6r({id: this.x_li})
},
x_2e: this.x_lm,
x_2q: this
});
};

x_2b.x_lm = function(x_6v) {
var
x_ac = x_6v.x_ac,
x_ln = x_ac.status,
x_lo = x_r.x_lp,
x_lq = this.x_ku,
x_32 = this.x_32,
x_lr, x_ls,
x_lt, x_lu,
x_kn,
x_km,
x_lb,
x_kj;
if (x_6v.x_6x) {
this.x_jt(); x_32.x_lc('x_l2');
x_32.x_lc('x_l4');
switch (x_ln.phase) {
case x_lo.x_lv:
case x_lo.x_lw:
if (this.x_lg) {
return; }
x_lq.x_9w(x_ln.percentage);
this.x_ll.defer(200, this); return;
case x_lo.x_lx:
if (this.x_lg) {
return; }
x_lq.x_9w(x_ln.percentage);
this.x_ly(kerio.lib.x_x('Kerio WinRoute Firewall is analyzing the new configuration…', 'configurationImport'));
this.x_ll.defer(200, this); return;
case x_lo.x_lz:
x_lq.x_9w(100); x_lb = x_ac.importedInterfaces;
x_kj = x_ac.currentInterfaces;
this.x_kj = x_kj;
this.x_lb = x_lb;
for (x_lr = 0, x_ls = x_lb.length; x_lr < x_ls; x_lr++) {
x_km = x_lb[x_lr].currentInterface;
if ('' !== x_km.id) {
for (x_lt = 0, x_lu = x_kj.length; x_lt < x_lu; x_lt++) {
x_kn = x_kj[x_lt];
if (x_km.id === x_kn.id.id) {
break;
}
}
if (x_lt < x_lu) {
x_km.x_fk = x_lt;
x_km.type = x_kn.type;
x_kn.x_fk = x_lr;
}
}
}
this.x_l8.x_8f();
this.x_l8.x_7k(x_lb);
this.x_32.x_3b('x_l2');
this.x_32.x_3b('x_l4');
this.x_k4.x_l5(this.x_32);
this.x_jt(); return;
case x_lo.x_m0:
x_lq.x_9w(999); if (x_ac.result && x_ac.result[0] && ('object' === typeof x_ac.result[0].errorMessage )) {
x_fi.x_j2(x_ac.result[0].errorMessage, '', {x_74: this.x_le, x_2q: this});
}
else {
x_fi.x_j2(kerio.lib.x_x('Import has failed.', 'configurationImport'), '', {x_74: this.x_le, x_2q: this});
}
return;
} } else {
}
}; 
x_2b.x_m1 = function(x_6v) {
if (x_6v.x_6x) {
this.x_jt();
kerio.waw.shared.x_3e.x_3f(
undefined, {
x_1n: kerio.lib.x_x('Kerio WinRoute Firewall is restarting to apply the new configuration, then your browser will be reloaded automatically.', 'configurationImport'),
x_m2: 0
}
); kerio.waw.x_m3();
}
else {
kerio.waw.shared.x_3e.x_j2(kerio.lib.x_x('Kerio WinRoute Firewall was unable to apply the new configuration.', 'configurationImport'));
this.x_2r();
}
};
}, 
x_l3: function(x_32) {
var
x_k4 = x_32.x_2p.x_k4,
x_m4 = x_k4.x_m5;
x_k4.x_m6(); if (2 === x_m4) { x_32.x_jp('x_l4');
x_32.x_jq('x_l6');
}
if (1 === x_m4) { x_32.x_lc('x_l2');
}
},

x_l5: function(x_32) {
var
x_16 = x_32.x_2p,
x_k4 = x_16.x_k4,
x_m4 = x_k4.x_m5;
x_k4.x_m7(); x_32.x_3b('x_l2');
if (0 === x_m4) { x_16.x_le();
}
if (1 === x_m4) { x_32.x_jq('x_l4');
x_32.x_jp('x_l6');
}
},

x_l7: function(x_32) {
var
x_16 = x_32.x_2p,
x_l8 = x_16.x_l8.x_7i(),
x_kj = x_16.x_kj,
x_41, x_42,
x_m8,
x_m9;
x_m9 = {
id: '',
name: '',
invalid: false
};
for (x_41 = 0, x_42 = x_l8.length; x_41 < x_42; x_41++) {
x_m8 = x_l8[x_41];
if (undefined !== x_m8.currentInterface.x_fk) {
x_m8.currentInterface = x_kj[x_m8.currentInterface.x_fk].id;
}
else {
x_m8.currentInterface = x_m9;
}
delete x_m8.importedInterface;
delete x_m8.x_km;
}
kerio.lib.x_6t.x_6u({
x_28: {
object: 'ConfigurationManager',
method: 'apply',
params: kerio.lib.x_6r({id: x_16.x_li, interfaces: x_l8})
},
x_2e: x_16.x_m1,
x_2q: x_16,
x_ma: true
});
},

x_ka: function(x_4d, x_4e) {
var
x_4k = kerio.lib.x_6b.x_6d.x_6e,
x_46;
if (x_4d instanceof kerio.lib.x_4g) {
if (x_4k.x_4l === x_4e.x_1f) {
x_46 = x_4d.x_3v.x_46;
this.x_3b('x_k8', 0 < x_46);
}
}
},

x_k9: function(x_32) {
var
x_3l = x_32.x_2p,
x_16 = x_3l.x_16;
kerio.lib.x_5l.x_5m({
x_5g: 'configurationImportInterfaceEditor',
x_28: {
x_7w: x_3l,
x_kj: x_16.x_kj,
x_lb: x_16.x_lb,
x_mb: x_3l.x_3v.x_40[0]
}
});
}
}; 