//>>built
define("mill/jssupport/jsApplication/PersonalCabinetApp","dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/fx dojo/fx dojo/topic dojo/dom-construct dojo/dom-style dojo/hash dojo/router dojo/when dijit/registry mill/jssupport/jsApplication/CabinetApp mill/jssupport/base mill/jssupport/app mill/jssupport/session mill/jssupport/TranslatableNode mill/jssupport/Announcement mill/jssupport/layout/LayoutContainer mill/jssupport/layout/GridLayout mill/jssupport/layout/GridLayoutColumn mill/jssupport/layout/layoutMenu/MobileMenu mill/jssupport/layout/layoutMenu/LayoutMenu mill/jssupport/layout/carouselView/CarouselView mill/jssupport/layout/layoutContent/ExternalContent mill/jssupport/layout/layoutContent/InternalContent mill/jssupport/layout/layoutContent/AuthorizationForm mill/jssupport/layout/layoutContent/RegistrationForm mill/jssupport/layout/layoutContent/RemoteUserPane mill/jssupport/layout/layoutContent/PersonInfoPane".split(" "),
function(q,n,r,u,w,t,x,v,y,g,z,h,A,l,p,B){return mill.registerAlias("app.PersonalCabinetApp",q("mill.jssupport.jsApplication.PersonalCabinetApp",A,{autoSignIn:!0,authFormConstructorName:"office.AuthorizationForm",externalRoutes:null,uriRoute:null,anonymousBatchItems:function(){var b=this.inherited(arguments);this.controlSets.forEach(function(a){b.push({queryIdent:a.preLoadIdent,className:"TJSControlSet",methodName:"PreLoad",params:{Name:a.controlSetName}});"larExternal"===a.layoutActionRegion&&b.push({queryIdent:a.loadDataIdent,
className:"TJSControlSet",methodName:"Load",params:{Name:a.controlSetName,CabinetLocale:l.locale.toUpperCase()}})});return b},handlerBatchItems:function(){var b=this.inherited(arguments);b=b.concat([{queryIdent:"internalLayoutActions",className:"TJSApplication",methodName:"BuildLayoutActions",params:{ID:this.appID,RemoteUser:function(){return B.getRemoteUserID()}}}]);this.controlSets.filter(function(a){return!a.layoutActionRegion||"larInternal"===a.layoutActionRegion}).forEach(function(a){b.push({queryIdent:a.loadDataIdent?
a.loadDataIdent:a.controlSetName+"Load",className:"TJSControlSet",methodName:"Load",params:{Name:a.controlSetName,CabinetLocale:l.locale.toUpperCase()}})});return b},layoutActions:function(){var b=[];this.authFormConstructorName&&b.push({node:"\x3cdiv id\x3d'authorizationForm' data-dojo-type\x3d'"+this.authFormConstructorName+"'\x3e\x3c/div\x3e",anchor:"#signin",text:"Office.SignIn",region:"external"});var a=p.anonymousDataByIdent("layoutActions")[0];a&&Object.prototype.hasOwnProperty.call(a,"LayoutActions")&&
(r.forEach(a.LayoutActions,function(c){if(Object.prototype.hasOwnProperty.call(c,"text")){var d=c.text;l.getLocalization(d)||(c.text=p.combinedTranslationIdent(d))}}),b=b.concat(a.LayoutActions));return b},initCarouselView:function(b){for(var a=0;a<b.length;a+=1)b[a].anchor&&/^#/.test(b[a].anchor)?t.publish("office.layout.CarouselView.registerItem",b[a]):l.registerMenuItem(b[a])},initLayout:function(){this.initCarouselView(this.layoutActions())},initRouter:function(){this.externalRoutes=n.clone(g._routes);
this.uriRoute=y();var b=g._routes.reduce(function(a,c,d){d.route.test(a)&&(c=a);return c}.bind(null,this.uriRoute),"signin");g.startup();g.go(b)},getInternalInitialRoute:function(){function b(d,e){return d.reduce(function(f,k,m){m.route.test(f)&&(k=f);return k}.bind(null,e),"")}var a=this.externalRoutes.map(function(d){return String(d.route)}),c=n.clone(g._routes).filter(function(d){return 0>a.indexOf(String(d.route))});return b(c,this.uriRoute)||b(c,mill.session.values.savedRoute)},onAppInit:function(){var b=
h.byId("main"),a=h.byId("external"),c=h.byId("mobileMenu");b=[b.domNode];c&&b.push(c.domNode);this.initControlSets("larExternal");x.destroy("loading");v.set(a.domNode,{display:"block"});b=r.map(b,function(d){return u.fadeIn(q(null,{node:d})())});w.chain(b).play();this.autoSignIn&&this.signin(null,h.byId("authorizationForm"))},initControlSets:function(b){b?n.isArray(this.controlSets)&&this.controlSets.filter(function(a){return a.layoutActionRegion===b}).forEach(function(a){(a=h.byId(a.containerId))&&
a.init()}):l.logError('initControlSets: argument "layoutActionRegion" is required.')},startup:function(){this.inherited(arguments);this.initLayout();this.initRouter();this.onAppInit()},logon:function(){var b=this.inherited(arguments);z(b,function(){var a=p.handlerDataByIdent("internalLayoutActions")[0];a&&Object.prototype.hasOwnProperty.call(a,"LayoutActions")&&(r.forEach(a.LayoutActions,function(e){if(Object.prototype.hasOwnProperty.call(e,"text")){var f=e.text;l.getLocalization(f)||(e.text=p.combinedTranslationIdent(f))}}),
this.initCarouselView(a.LayoutActions));var c=h.byId("external"),d=h.byId("internal");t.subscribe("/dojo/hashchange",function(e){var f=g._routes.reduce(function(k,m){m.route.test(e)&&(k=e);return k},"");f&&mill.session.setValue("savedRoute",f)});u.fadeOut(q(null,{node:c.domNode,onEnd:n.hitch(this,function(){c.destroyRecursive();v.set(d.domNode,{display:"block"});var e=g._routes.reduce(function(f,k,m){m.route.test(f)&&(k=f);return k}.bind(null,this.getInternalInitialRoute()),"startup");g.go(e);(e=
h.byId("mobileMenu"))&&e.set("state","internal-state")})})()).play();this.initControlSets("larInternal");t.publish("app.onLogon",null)}.bind(this));return b}}))});