//>>built
define("dojox/mobile/View","dojo/_base/array dojo/_base/config dojo/_base/connect dojo/_base/declare dojo/_base/lang dojo/sniff dojo/_base/window dojo/_base/Deferred dojo/dom dojo/dom-class dojo/dom-construct dojo/dom-geometry dojo/dom-style dijit/registry dijit/_Contained dijit/_Container dijit/_WidgetBase ./ViewController ./common ./transition ./viewRegistry ./_css3".split(" "),function(u,v,r,E,w,t,k,B,C,l,F,D,m,x,G,H,I,L,z,J,A,p){w.getObject("dojox.mobile",!0);return E("dojox.mobile.View",[I,H,
G],{selected:!1,keepScrollPos:!0,tag:"div",baseClass:"mblView",constructor:function(a,b){b&&(C.byId(b).style.visibility="hidden")},destroy:function(){A.remove(this.id);this.inherited(arguments)},buildRendering:function(){this.templateString||(this.domNode=this.containerNode=this.srcNodeRef||F.create(this.tag));this._animEndHandle=this.connect(this.domNode,p.name("animationEnd"),"onAnimationEnd");this._animStartHandle=this.connect(this.domNode,p.name("animationStart"),"onAnimationStart");v.mblCSS3Transition||
(this._transEndHandle=this.connect(this.domNode,p.name("transitionEnd"),"onAnimationEnd"));t("mblAndroid3Workaround")&&m.set(this.domNode,p.name("transformStyle"),"preserve-3d");A.add(this);this.inherited(arguments)},startup:function(){if(!this._started){if(void 0===this._visible){var a=this.getSiblingViews(),b=location.hash&&location.hash.substring(1).split(/,/),c,h,n;u.forEach(a,function(d,e){-1!==u.indexOf(b,d.id)&&(c=d);0==e&&(n=d);d.selected&&(h=d);d._visible=!1},this);(c||h||n)._visible=!0}this._visible&&
(this.show(!0,!0),this.defer(function(){this.onStartView();r.publish("/dojox/mobile/startView",[this])}));"hidden"===this.domNode.style.visibility&&(this.domNode.style.visibility="inherit");this.inherited(arguments);(a=this.getParent())&&a.resize||this.resize();this._visible||this.hide()}},resize:function(){u.forEach(this.getChildren(),function(a){a.resize&&a.resize()})},onStartView:function(){},onBeforeTransitionIn:function(a,b,c,h,n){},onAfterTransitionIn:function(a,b,c,h,n){},onBeforeTransitionOut:function(a,
b,c,h,n){},onAfterTransitionOut:function(a,b,c,h,n){},_clearClasses:function(a){if(a){var b=[];u.forEach(w.trim(a.className||"").split(/\s+/),function(c){(c.match(/^mbl\w*View$/)||-1===c.indexOf("mbl"))&&b.push(c)},this);a.className=b.join(" ")}},_fixViewState:function(a){for(var b=this.domNode.parentNode.childNodes,c=0;c<b.length;c++){var h=b[c];1===h.nodeType&&l.contains(h,"mblView")&&this._clearClasses(h)}this._clearClasses(a);if(a=x.byNode(a))a._inProgress=!1},convertToId:function(a){return"string"==
typeof a?a.replace(/^#?([^&?]+).*/,"$1"):a},_isBookmarkable:function(a){return a.moveTo&&(v.mblForceBookmarkable||"#"===a.moveTo.charAt(0))&&!a.hashchange},performTransition:function(a,b,c,h,n){if(!this._inProgress){this._inProgress=!0;if(a&&"object"===typeof a){var d=a;var e=b}else{d={moveTo:a,transitionDir:b,transition:c,context:h,method:n};e=[];for(var f=5;f<arguments.length;f++)e.push(arguments[f])}this._detail=d;this._optArgs=e;this._arguments=[d.moveTo,d.transitionDir,d.transition,d.context,
d.method];if("#"!==d.moveTo){d.moveTo?e=this.convertToId(d.moveTo):(this._dummyNode||(this._dummyNode=k.doc.createElement("div"),k.body().appendChild(this._dummyNode)),e=this._dummyNode);this.addTransitionInfo&&"string"==typeof d.moveTo&&this._isBookmarkable(d)&&this.addTransitionInfo(this.id,d.moveTo,{transitionDir:d.transitionDir,transition:d.transition});f=this.domNode;var q=f.offsetTop;if(e=this.toNode=C.byId(e)){e.style.visibility="hidden";e.style.display="";this._fixViewState(e);var g=x.byNode(e);
if(g){if(v.mblAlwaysResizeOnTransition||!g._resized)z.resizeAll(null,g),g._resized=!0;d.transition&&"none"!=d.transition&&g._addTransitionPaddingTop(q);g.load&&g.load();g.movedFrom=f.id}t("mblAndroidWorkaround")&&!v.mblCSS3Transition&&d.transition&&"none"!=d.transition&&(m.set(e,p.name("transformStyle"),"preserve-3d"),m.set(f,p.name("transformStyle"),"preserve-3d"),l.add(e,"mblAndroidWorkaround"));this.onBeforeTransitionOut.apply(this,this._arguments);r.publish("/dojox/mobile/beforeTransitionOut",
[this].concat(w._toArray(this._arguments)));if(g){if(this.keepScrollPos&&!this.getParent()){q=k.body().scrollTop||k.doc.documentElement.scrollTop||k.global.pageYOffset||0;f._scrollTop=q;var y=1==d.transitionDir?0:e._scrollTop||0;e.style.top="0px";if(1<q||0!==y)f.style.top=y-q+"px",7<=t("ios")||!1===v.mblHideAddressBar||this.defer(function(){k.global.scrollTo(0,y||1)})}else e.style.top="0px";g.onBeforeTransitionIn.apply(g,this._arguments);r.publish("/dojox/mobile/beforeTransitionIn",[g].concat(w._toArray(this._arguments)))}e.style.display=
"none";e.style.visibility="inherit";z.fromView=this;z.toView=g;this._doTransition(f,e,d.transition,d.transitionDir)}}}},_addTransitionPaddingTop:function(a){this.containerNode.style.paddingTop=a+"px"},_removeTransitionPaddingTop:function(){this.containerNode.style.paddingTop=""},_toCls:function(a){return"mbl"+a.charAt(0).toUpperCase()+a.substring(1)},_doTransition:function(a,b,c,h){var n=-1==h?" mblReverse":"";b.style.display="";if(c&&"none"!=c)if(v.mblCSS3Transition)B.when(J,w.hitch(this,function(y){var K=
m.get(b,"position");m.set(b,"position","absolute");B.when(y(a,b,{transition:c,reverse:-1===h?!0:!1}),w.hitch(this,function(){m.set(b,"position",K);b.style.paddingTop="";this.invokeCallback()}))}));else{-1!=c.indexOf("cube")&&(t("ipad")?m.set(b.parentNode,{webkitPerspective:1600}):t("ios")&&m.set(b.parentNode,{webkitPerspective:800}));var d=this._toCls(c);if(t("mblAndroidWorkaround")){var e=this;e.defer(function(){l.add(a,d+" mblOut"+n);l.add(b,d+" mblIn"+n);l.remove(b,"mblAndroidWorkaround");e.defer(function(){l.add(a,
"mblTransition");l.add(b,"mblTransition")},30)},70)}else l.add(a,d+" mblOut"+n),l.add(b,d+" mblIn"+n),this.defer(function(){l.add(a,"mblTransition");l.add(b,"mblTransition")},100);var f="50% 50%",q="50% 50%";if(-1!=c.indexOf("swirl")||-1!=c.indexOf("zoom")){f=this.keepScrollPos&&!this.getParent()?k.body().scrollTop||k.doc.documentElement.scrollTop||k.global.pageYOffset||0:-D.position(a,!0).y;var g=k.global.innerHeight/2+f;f="50% "+g+"px";q="50% "+g+"px"}else-1!=c.indexOf("scale")&&(f=D.position(a,
!0),q=(void 0!==this.clickedPosX?this.clickedPosX:k.global.innerWidth/2)-f.x,f=this.keepScrollPos&&!this.getParent()?k.body().scrollTop||k.doc.documentElement.scrollTop||k.global.pageYOffset||0:-f.y,g=(void 0!==this.clickedPosY?this.clickedPosY:k.global.innerHeight/2)+f,f=q+"px "+g+"px",q=q+"px "+g+"px");m.set(a,p.add({},{transformOrigin:f}));m.set(b,p.add({},{transformOrigin:q}))}else this.domNode.style.display="none",this.invokeCallback()},onAnimationStart:function(a){},onAnimationEnd:function(a){var b=
a.animationName||a.target.className;if(-1!==b.indexOf("Out")||-1!==b.indexOf("In")||-1!==b.indexOf("Shrink")){var c=!1;l.contains(this.domNode,"mblOut")?(c=!0,this.domNode.style.display="none",l.remove(this.domNode,[this._toCls(this._detail.transition),"mblIn","mblOut","mblReverse"])):this._removeTransitionPaddingTop();m.set(this.domNode,p.add({},{transformOrigin:""}));-1!==b.indexOf("Shrink")&&(a=a.target,a.style.display="none",l.remove(a,"mblCloseContent"),(a=A.getEnclosingScrollable(this.domNode))&&
a.onTouchEnd());c&&this.invokeCallback();this._clearClasses(this.domNode);this.clickedPosX=this.clickedPosY=void 0;-1!==b.indexOf("Cube")&&-1!==b.indexOf("In")&&t("ios")&&(this.domNode.parentNode.style[p.name("perspective")]="")}},invokeCallback:function(){this.onAfterTransitionOut.apply(this,this._arguments);r.publish("/dojox/mobile/afterTransitionOut",[this].concat(this._arguments));var a=x.byNode(this.toNode);a&&(a.onAfterTransitionIn.apply(a,this._arguments),r.publish("/dojox/mobile/afterTransitionIn",
[a].concat(this._arguments)),a.movedFrom=void 0,this.setFragIds&&this._isBookmarkable(this._detail)&&this.setFragIds(a));t("mblAndroidWorkaround")&&this.defer(function(){a&&m.set(this.toNode,p.name("transformStyle"),"");m.set(this.domNode,p.name("transformStyle"),"")});var b=this._detail.context,c=this._detail.method;if(b||c)c||(c=b,b=null),b=b||k.global,"string"==typeof c?b[c].apply(b,this._optArgs):"function"==typeof c&&c.apply(b,this._optArgs);this._detail=this._optArgs=this._arguments=void 0;
this._inProgress=!1},isVisible:function(a){if(a){for(a=this.domNode;"BODY"!==a.tagName;a=a.parentNode)if("none"===m.get(a,"display"))return!1;return!0}return"none"!==m.get(this.domNode,"display")},getShowingView:function(){for(var a=this.domNode.parentNode.childNodes,b=0;b<a.length;b++){var c=a[b];if(1===c.nodeType&&l.contains(c,"mblView")&&"none"!==c.style.display)return x.byNode(c)}return null},getSiblingViews:function(){return this.domNode.parentNode?u.map(u.filter(this.domNode.parentNode.childNodes,
function(a){return 1===a.nodeType&&l.contains(a,"mblView")}),function(a){return x.byNode(a)}):[this]},show:function(a,b){var c=this.getShowingView();a||(c&&(c.onBeforeTransitionOut(c.id),r.publish("/dojox/mobile/beforeTransitionOut",[c,c.id])),this.onBeforeTransitionIn(this.id),r.publish("/dojox/mobile/beforeTransitionIn",[this,this.id]));b?this.domNode.style.display="":u.forEach(this.getSiblingViews(),function(h){h.domNode.style.display=h===this?"":"none"},this);this.load&&this.load();a||(c&&(c.onAfterTransitionOut(c.id),
r.publish("/dojox/mobile/afterTransitionOut",[c,c.id])),this.onAfterTransitionIn(this.id),r.publish("/dojox/mobile/afterTransitionIn",[this,this.id]))},hide:function(){this.domNode.style.display="none"}})});