YUI.add("history-base",function(a,e){var t=a.Lang,h=a.Object,o=YUI.namespace("Env.History"),n=a.Array,i=a.config.doc,r=i.documentMode,s=a.config.win,c={merge:!0},u="change",f="add",l="replace";function v(){this._init.apply(this,arguments)}function _(e){return"object"===t.type(e)}a.augment(v,a.EventTarget,null,null,{emitFacade:!0,prefix:"history",preventable:!1,queueable:!0}),o._state||(o._state={}),v.NAME="historyBase",v.SRC_ADD=f,v.SRC_REPLACE=l,v.html5=!!(s.history&&s.history.pushState&&s.history.replaceState&&("onpopstate"in s||2<=a.UA.gecko)&&(!a.UA.android||2.4<=a.UA.android)),v.nativeHashChange=("onhashchange"in s||"onhashchange"in i)&&(!r||7<r),a.mix(v.prototype,{_init:function(e){e=this._config=e||{},this.force=!!e.force,e=this._initialState=this._initialState||e.initialState||null,this.publish(u,{broadcast:2,defaultFn:this._defChangeFn}),e&&this.replace(e)},add:function(){var e=n(arguments,0,!0);return e.unshift(f),this._change.apply(this,e)},addValue:function(e,t,n){var a={};return a[e]=t,this._change(f,a,n)},get:function(e){var t=o._state,n=_(t);return e?n&&h.owns(t,e)?t[e]:undefined:n?a.mix({},t,!0):t},replace:function(){var e=n(arguments,0,!0);return e.unshift(l),this._change.apply(this,e)},replaceValue:function(e,t,n){var a={};return a[e]=t,this._change(l,a,n)},_change:function(e,t,n){return(n=n?a.merge(c,n):c).merge&&_(t)&&_(o._state)&&(t=a.merge(o._state,t)),this._resolveChanges(e,t,n),this},_fireEvents:function(n,e,t){this.fire(u,{_options:t,changed:e.changed,newVal:e.newState,prevVal:e.prevState,removed:e.removed,src:n}),h.each(e.changed,function(e,t){this._fireChangeEvent(n,t,e)},this),h.each(e.removed,function(e,t){this._fireRemoveEvent(n,t,e)},this)},_fireChangeEvent:function(e,t,n){this.fire(t+"Change",{newVal:n.newVal,prevVal:n.prevVal,src:e})},_fireRemoveEvent:function(e,t,n){this.fire(t+"Remove",{prevVal:n,src:e})},_resolveChanges:function(e,n,t){var a,i={},r=o._state,s={};t=t||{},_(n=n||{})&&_(r)?(h.each(n,function(e,t){var n=r[t];e!==n&&(i[t]={newVal:e,prevVal:n},a=!0)},this),h.each(r,function(e,t){h.owns(n,t)&&null!==n[t]||(delete n[t],s[t]=e,a=!0)},this)):a=n!==r,(a||this.force)&&this._fireEvents(e,{changed:i,newState:n,prevState:r,removed:s},t)},_storeState:function(e,t){o._state=t||{}},_defChangeFn:function(e){this._storeState(e.src,e.newVal,e._options)}},!0),a.HistoryBase=v},"patched-v3.18.7",{requires:["event-custom-complex"]});