!function(a,b){varc,d,e=wp.customize;e.Setting=e.Value.extend({initialize:function(a,b,c){e.Value.prototype.initialize.call(this,b,c),this.id=a,this.transport=this.transport||"refresh",this.bind(this.preview)},preview:function(){switch(this.transport){case"refresh":returnthis.previewer.refresh();case"postMessage":returnthis.previewer.send("setting",[this.id,this()])}}}),e.utils={},e.utils.bubbleChildValueChanges=function(a,c){b.each(c,function(b,c){a[c].bind(function(b,c){a.parent&&b!==c&&a.parent.trigger("change",a)})})},d=function(a){varb,c,d;b=this,a=a||{},d=function(){b.container.find(":focusable:first").focus(),b.container[0].scrollIntoView(!0)},a.completeCallback?(c=a.completeCallback,a.completeCallback=function(){d(),c()}):a.completeCallback=d,b.expand?b.expand(a):a.completeCallback()},e.utils.prioritySort=function(a,b){returna.priority()===b.priority()&&"number"==typeofa.params.instanceNumber&&"number"==typeofb.params.instanceNumber?a.params.instanceNumber-b.params.instanceNumber:a.priority()-b.priority()},e.utils.isKeydownButNotEnterEvent=function(a){return"keydown"===a.type&&13!==a.which},e.utils.areElementListsEqual=function(a,c){vard=a.length===c.length&&-1===_.map(_.zip(a,c),function(a){returnb(a[0]).is(a[1])}).indexOf(!1);returnd},c=e.Class.extend({defaultActiveArguments:{duration:"fast",completeCallback:b.noop},defaultExpandedArguments:{duration:"fast",completeCallback:b.noop},initialize:function(a,c){vard=this;d.id=a,d.params={},b.extend(d,c||{}),d.container=b(d.params.content),d.deferred={embedded:newb.Deferred},d.priority=newe.Value,d.active=newe.Value,d.activeArgumentsQueue=[],d.expanded=newe.Value,d.expandedArgumentsQueue=[],d.active.bind(function(a){varc=d.activeArgumentsQueue.shift();c=b.extend({},d.defaultActiveArguments,c),a=a&&d.isContextuallyActive(),d.onChangeActive(a,c)}),d.expanded.bind(function(a){varc=d.expandedArgumentsQueue.shift();c=b.extend({},d.defaultExpandedArguments,c),d.onChangeExpanded(a,c)}),d.attachEvents(),e.utils.bubbleChildValueChanges(d,["priority","active"]),d.priority.set(isNaN(d.params.priority)?100:d.params.priority),d.active.set(d.params.active),d.expanded.set(!1)},ready:function(){},_children:function(a,b){varc=this,d=[];returne[b].each(function(b){b[a].get()===c.id&&d.push(b)}),d.sort(e.utils.prioritySort),d},isContextuallyActive:function(){thrownewError("Container.isContextuallyActive() must be overridden in a subclass.")},onChangeActive:function(a,c){vard="resolved"===e.previewer.deferred.active.state()?c.duration:0;b.contains(document,this.container)?a?this.container.stop(!0,!0).slideDown(d,c.completeCallback):this.container.stop(!0,!0).slideUp(d,c.completeCallback):(this.container.toggle(a),c.completeCallback&&c.completeCallback())},_toggleActive:function(a,b){varc=this;returnb=b||{},a&&this.active.get()||!a&&!this.active.get()?(b.unchanged=!0,c.onChangeActive(c.active.get(),b),!1):(b.unchanged=!1,this.activeArgumentsQueue.push(b),this.active.set(a),!0)},activate:function(a){returnthis._toggleActive(!0,a)},deactivate:function(a){returnthis._toggleActive(!1,a)},onChangeExpanded:function(){thrownewError("Must override with subclass.")},_toggleExpanded:function(a,b){varc=this;returnb=b||{},a&&this.expanded.get()||!a&&!this.expanded.get()?(b.unchanged=!0,c.onChangeExpanded(c.expanded.get(),b),!1):(b.unchanged=!1,this.expandedArgumentsQueue.push(b),this.expanded.set(a),!0)},expand:function(a){returnthis._toggleExpanded(!0,a)},collapse:function(a){returnthis._toggleExpanded(!1,a)},focus:d}),e.Section=c.extend({initialize:function(a,d){varf=this;c.prototype.initialize.call(f,a,d),f.id=a,f.panel=newe.Value,f.panel.bind(function(a){b(f.container).toggleClass("control-subsection",!!a)}),f.panel.set(f.params.panel||""),e.utils.bubbleChildValueChanges(f,["panel"]),f.embed(),f.deferred.embedded.done(function(){f.ready()})},embed:function(){vara,c=this;a=function(a){vard;a?e.panel(a,function(a){a.deferred.embedded.done(function(){d=a.container.find("ul:first"),c.container.parent().is(d)||d.append(c.container),c.deferred.embedded.resolve()})}