(function(){"use strict";var e;var n;var t;var s;$.extend(page,{"Form.onCreate":i});window.downloadConfiguration=function(e){var n=new u8.Base.Request({endPoint:"ConfigurationChannel.Export",arguments:{configId:e}});n.exportTarget=null;n.executeExport()};function i(e){s=e;s.commandBindings=$.extend(s.commandBindings,{sendEmail:v,selectUser:r});Function.chain(o,u,g.curry(null))()}function o(e){u8.using({texts:["SystemInfo_text"],types:["Plugin"],templates:[{name:"systeminfo",url:"systeminfo.utml.htm"},{name:"systeminfo.user",url:"systeminfo.user.utml.htm"},{name:"systeminfo.email",url:"systeminfo.email.utml.htm"}]},e)}function r(){u(function(e,n){if(!n||!n.error){g({userInfo:true})}})}function u(e){Function.chain(a,m,f,l,c.async())(e)}function a(e){var t=u8.services.phone;n={userName:$v("userName"),userAgent:navigator.userAgent,phoneVersion:null};if(!t){return e()}t.getVersion().done(function(e){n.phoneVersion=e}).always(function(){e()})}function m(e){if(!n.userName){return e()}u8.request("AdministrationChannel.IsValidUserName",{userName:n.userName},function(e,t){if(!t.response){u8.services.notification.error("'"+n.userName+"' "+$t("TXT_SystemInfo_text_35"));return"error"}}.compose(e))}function f(t){if(e===undefined){u8.Crm.Plugin.getVersion(s)}else{s()}function s(s,i){if(i){e=i.version||null}n.plugInVersion=e;t()}}function l(e){u8.request("AdministrationChannel.GetSystemInfo",{options:n},function(e,n){if(u8.session.webConfigValues.getBoolean("Security.HidePathInformation",true)==true){n.response.paths.uploadPath="-"}t=n.response||{};t.useLauncher=u8.session.useLauncher()}.chain(e),true)}function c(){d("roles","label",",",$t("TXT_SystemInfo_text_46"));d("rights","name"," / ","")}function d(e,n,s,i){var o=e+"String";var r=t[e];var u=r&&r.map(u8._.attr(n)).join(s);t[o]=u||i}function g(e){p(e,"systemInfo","systemInfo","systeminfo");p(e,"userInfo","userInfo","systeminfo.user");p(e,"userInfo","email","systeminfo.email")}function p(e,n,i,o){if(!e||e[n]){var r=s.getWidget(i);r.empty();$(r.element).utml({name:o,data:t,itemOptions:{parent:r}})}}function v(){var e=$v("emailAddress");if(!e){return}var n=$v("userName");var s=$v("emailText");var i=t.version&&t.phoneVersion;u8.request("AdministrationChannel.SendSystemInfoAsEmail",{emailAddress:e,options:{userAgent:window.navigator.userAgent,userName:n,phoneVersion:i,text:s}})}})();