diff options
author | jakefeasel <jfeasel@gmail.com> | 2012-10-29 03:07:10 +0000 |
---|---|---|
committer | jakefeasel <jfeasel@gmail.com> | 2012-10-29 03:07:10 +0000 |
commit | 816e7040815c8b5237c435ff4ab4257ae1e61646 (patch) | |
tree | 2340524214854295b13c904969478e6a0c533659 | |
parent | 0aa1079bb52d7c61623c7901eef811b08251a614 (diff) | |
download | sqlfiddle-816e7040815c8b5237c435ff4ab4257ae1e61646.zip sqlfiddle-816e7040815c8b5237c435ff4ab4257ae1e61646.tar.gz sqlfiddle-816e7040815c8b5237c435ff4ab4257ae1e61646.tar.bz2 |
Optimized source from prod
20 files changed, 61 insertions, 15 deletions
diff --git a/src/main/webapp/javascripts_min/build.txt b/src/main/webapp/javascripts_min/build.txt index 5114a89..b29bfa1 100644 --- a/src/main/webapp/javascripts_min/build.txt +++ b/src/main/webapp/javascripts_min/build.txt @@ -32,11 +32,14 @@ libs/xplans/oracle/loadswf.js libs/xplans/mssql.js text!fiddle_backbone/templates/queryTabularOutput.html text!fiddle_backbone/templates/queryPlaintextOutput.html +text!fiddle_backbone/templates/queryMarkdownOutput.html libs/handlebarsHelpers/divider_display.js libs/handlebarsHelpers/each_simple_value_with_index.js libs/handlebarsHelpers/each_with_index.js libs/handlebarsHelpers/result_display_padded.js libs/handlebarsHelpers/result_display.js +libs/handlebarsHelpers/code_format.js +libs/handlebarsHelpers/add.js fiddle_backbone/views/Query.js fiddle_backbone/router.js libs/jquery/jquery.blockUI.js diff --git a/src/main/webapp/javascripts_min/fiddle_backbone/app.js b/src/main/webapp/javascripts_min/fiddle_backbone/app.js index b6fc0ce..7e1eca4 100644 --- a/src/main/webapp/javascripts_min/fiddle_backbone/app.js +++ b/src/main/webapp/javascripts_min/fiddle_backbone/app.js @@ -1 +1 @@ -define(["BrowserEngines/engines","fiddle_backbone/models/UsedFiddle","fiddle_backbone/models/MyFiddleHistory","fiddle_backbone/models/DBTypesList","fiddle_backbone/models/SchemaDef","fiddle_backbone/models/Query","fiddle_backbone/views/DBTypesList","fiddle_backbone/views/SchemaDef","fiddle_backbone/views/Query","fiddle_backbone/router","libs/renderTerminator","libs/jquery/jquery.blockUI","libs/jquery/jquery.cookie","Bootstrap/bootstrap-collapse","Bootstrap/bootstrap-tab","Bootstrap/bootstrap-dropdown","Bootstrap/bootstrap-modal","Bootstrap/bootstrap-tooltip","Bootstrap/bootstrap-popover"],function(e,t,n,r,i,s,o,u,a,f,l){var c=function(c){var h={},p=new n,d=new r,v=new i({browserEngines:e}),m=new s({schemaDef:v}),g=new o({el:$("#db_type_id")[0],collection:d}),y=new u({id:"schema_ddl",model:v,output_el:$("#output"),browser_el:$("#browser")}),b=new a({id:"sql",model:m,output_el:$("#output")});d.on("change",function(){g.render(),v.has("dbType")&&v.set("ready",v.get("dbType").id==this.getSelectedType().id)}),v.on("change",function(){this.hasChanged("ready")&&y.updateDependents(),this.hasChanged("errorMessage")&&y.renderOutput(),this.hasChanged("schema_structure")&&y.renderSchemaBrowser()}),v.on("reloaded",function(){this.set("dbType",d.getSelectedType()),y.render()}),m.on("reloaded",function(){this.set({pendingChanges:!1},{silent:!0}),b.render()}),v.on("built failed",function(){$("#buildSchema label").prop("disabled",!1),$("#buildSchema label").html($("#buildSchema label").data("originalValue")),y.renderOutput(),y.renderSchemaBrowser()}),m.on("change",function(){(this.hasChanged("sql")||this.hasChanged("statement_separator"))&&!this.hasChanged("id")&&!this.get("pendingChanges")&&this.set({pendingChanges:!0},{silent:!0})}),m.on("executed",function(){var e=$(".runQuery");e.prop("disabled",!1),e.html(e.data("originalValue")),this.set({pendingChanges:!1},{silent:!0}),b.renderOutput()}),$("#buildSchema").click(function(e){var t=$("label",this);e.preventDefault();if(t.prop("disabled"))return!1;t.data("originalValue",t.html()),t.prop("disabled",!0).text("Building Schema..."),v.build(d)});var w=function(e){var t=$(".runQuery");e.preventDefault();if(t.prop("disabled"))return!1;t.data("originalValue",t.html()),t.prop("disabled",!0).text("Executing SQL..."),b.checkForSelectedText(),m.execute()};return $(".runQuery").click(w),$(document).keyup(function(e){e.keyCode==116&&(e.preventDefault(),w(e))}),$("#runQueryOptions li a").click(function(e){e.preventDefault(),b.setOutputType(this.id),b.renderOutput()}),$("#queryPrettify").click(function(e){var t=$(this);t.attr("disabled",!0),e.preventDefault(),$.post("index.cfm/proxy/formatSQL",{sql:m.get("sql")},function(e){m.set({sql:e}),m.trigger("reloaded"),m.set({pendingChanges:!0}),t.attr("disabled",!1)})}),$(".terminator .dropdown-menu a").on("click",function(e){e.preventDefault(),l($(this).closest(".panel"),$(this).attr("href")),$(this).closest(".panel").hasClass("schema")?y.handleSchemaChange():m.set({pendingChanges:!0,statement_separator:$(this).attr("href")},{silent:!0})}),$(window).bind("beforeunload",function(){if(m.get("pendingChanges"))return"Warning! You have made changes to your query which will be lost. Continue?'"}),d.on("reset",function(){h=f.initialize(d,v,m,p,g),this.length&&!this.getSelectedType()&&this.setSelectedType(this.first().id,!0),g.render(),y.render(),b.render()}),p.on("change reset remove",function(){localStorage&&localStorage.setItem("fiddleHistory",JSON.stringify(this.toJSON()))}),$("#clear").click(function(e){e.preventDefault(),v.reset(),m.reset(),h.navigate("!"+d.getSelectedType().id,{trigger:!0})}),$("#sample").click(function(e){e.preventDefault(),h.navigate("!"+d.getSelectedType().get("sample_fragment"),{trigger:!0})}),d.on("change",function(){g.render(),m.id&&v.get("short_code").length&&v.get("dbType").id==this.getSelectedType().id?h.navigate("!"+this.getSelectedType().id+"/"+v.get("short_code")+"/"+m.id):v.get("short_code").length&&v.get("dbType").id==this.getSelectedType().id?h.navigate("!"+this.getSelectedType().id+"/"+v.get("short_code")):h.navigate("!"+this.getSelectedType().id)}),v.on("built",function(){p.insert(new t({fragment:"!"+this.get("dbType").id+"/"+this.get("short_code")})),h.navigate("!"+this.get("dbType").id+"/"+this.get("short_code"))}),m.on("executed",function(){var e=this.get("schemaDef");p.insert(new t({fragment:"!"+e.get("dbType").id+"/"+e.get("short_code")+"/"+this.id})),h.navigate("!"+e.get("dbType").id+"/"+e.get("short_code")+"/"+this.id)}),d.reset(c),{dbTypes:d,schemaDef:v,schemaDefView:y,queryView:b}};return{initialize:c}})
\ No newline at end of file +define(["BrowserEngines/engines","fiddle_backbone/models/UsedFiddle","fiddle_backbone/models/MyFiddleHistory","fiddle_backbone/models/DBTypesList","fiddle_backbone/models/SchemaDef","fiddle_backbone/models/Query","fiddle_backbone/views/DBTypesList","fiddle_backbone/views/SchemaDef","fiddle_backbone/views/Query","fiddle_backbone/router","libs/renderTerminator","libs/jquery/jquery.blockUI","libs/jquery/jquery.cookie","Bootstrap/bootstrap-collapse","Bootstrap/bootstrap-tab","Bootstrap/bootstrap-dropdown","Bootstrap/bootstrap-modal","Bootstrap/bootstrap-tooltip","Bootstrap/bootstrap-popover"],function(e,t,n,r,i,s,o,u,a,f,l){var c=function(c){var h={},p=new n,d=new r,v=new i({browserEngines:e}),m=new s({schemaDef:v}),g=new o({el:$("#db_type_id")[0],collection:d}),y=new u({id:"schema_ddl",model:v,output_el:$("#output"),browser_el:$("#browser")}),b=new a({id:"sql",model:m,output_el:$("#output")});d.on("change",function(){g.render(),v.has("dbType")&&v.set("ready",v.get("dbType").id==this.getSelectedType().id)}),v.on("change",function(){this.hasChanged("ready")&&y.updateDependents(),this.hasChanged("errorMessage")&&y.renderOutput(),this.hasChanged("schema_structure")&&y.renderSchemaBrowser()}),v.on("reloaded",function(){this.set("dbType",d.getSelectedType()),y.render()}),m.on("reloaded",function(){this.set({pendingChanges:!1},{silent:!0}),b.render()}),v.on("built failed",function(){$("#buildSchema label").prop("disabled",!1),$("#buildSchema label").html($("#buildSchema label").data("originalValue")),y.renderOutput(),y.renderSchemaBrowser()}),m.on("change",function(){(this.hasChanged("sql")||this.hasChanged("statement_separator"))&&!this.hasChanged("id")&&!this.get("pendingChanges")&&this.set({pendingChanges:!0},{silent:!0})}),m.on("executed",function(){var e=$(".runQuery");e.prop("disabled",!1),e.html(e.data("originalValue")),this.set({pendingChanges:!1},{silent:!0}),b.renderOutput()}),$("#buildSchema").click(function(e){var t=$("label",this);e.preventDefault();if(t.prop("disabled"))return!1;t.data("originalValue",t.html()),t.prop("disabled",!0).text("Building Schema..."),v.build()});var w=function(e){var t=$(".runQuery");e.preventDefault();if(t.prop("disabled"))return!1;t.data("originalValue",t.html()),t.prop("disabled",!0).text("Executing SQL..."),b.checkForSelectedText(),m.execute()};return $(".runQuery").click(w),$(document).keyup(function(e){e.keyCode==116&&(e.preventDefault(),w(e))}),$("#runQueryOptions li a").click(function(e){e.preventDefault(),b.setOutputType(this.id),b.renderOutput()}),$("#queryPrettify").click(function(e){var t=$(this);t.attr("disabled",!0),e.preventDefault(),$.post("index.cfm/proxy/formatSQL",{sql:m.get("sql")},function(e){m.set({sql:e}),m.trigger("reloaded"),m.set({pendingChanges:!0}),t.attr("disabled",!1)})}),$(".terminator .dropdown-menu a").on("click",function(e){e.preventDefault(),l($(this).closest(".panel"),$(this).attr("href")),$(this).closest(".panel").hasClass("schema")?y.handleSchemaChange():m.set({pendingChanges:!0,statement_separator:$(this).attr("href")},{silent:!0})}),$("#output").on("click",".depesz",function(e){var t=$(this).closest(".set").find(".executionPlan tr:not(:first)").text();$(this).closest("form").find("[name=plan]").val(t)}),$(window).bind("beforeunload",function(){if(m.get("pendingChanges"))return"Warning! You have made changes to your query which will be lost. Continue?'"}),d.on("reset",function(){h=f.initialize(d,v,m,p,g),this.length&&!this.getSelectedType()&&this.setSelectedType(this.first().id,!0),g.render(),y.render(),b.render()}),p.on("change reset remove",function(){localStorage&&localStorage.setItem("fiddleHistory",JSON.stringify(this.toJSON()))}),$("#clear").click(function(e){e.preventDefault(),v.reset(),m.reset(),h.navigate("!"+d.getSelectedType().id,{trigger:!0})}),$("#sample").click(function(e){e.preventDefault(),h.navigate("!"+d.getSelectedType().get("sample_fragment"),{trigger:!0})}),d.on("change",function(){g.render(),m.id&&v.get("short_code").length&&v.get("dbType").id==this.getSelectedType().id?h.navigate("!"+this.getSelectedType().id+"/"+v.get("short_code")+"/"+m.id):v.get("short_code").length&&v.get("dbType").id==this.getSelectedType().id?h.navigate("!"+this.getSelectedType().id+"/"+v.get("short_code")):h.navigate("!"+this.getSelectedType().id),v.set("dbType",this.getSelectedType())}),v.on("built",function(){p.insert(new t({fragment:"!"+this.get("dbType").id+"/"+this.get("short_code")})),h.navigate("!"+this.get("dbType").id+"/"+this.get("short_code"))}),m.on("executed",function(){var e=this.get("schemaDef");p.insert(new t({fragment:"!"+e.get("dbType").id+"/"+e.get("short_code")+"/"+this.id})),h.navigate("!"+e.get("dbType").id+"/"+e.get("short_code")+"/"+this.id)}),d.reset(c),{dbTypes:d,schemaDef:v,schemaDefView:y,queryView:b}};return{initialize:c}})
\ No newline at end of file diff --git a/src/main/webapp/javascripts_min/fiddle_backbone/models/SchemaDef.js b/src/main/webapp/javascripts_min/fiddle_backbone/models/SchemaDef.js index 373fcbc..0993175 100644 --- a/src/main/webapp/javascripts_min/fiddle_backbone/models/SchemaDef.js +++ b/src/main/webapp/javascripts_min/fiddle_backbone/models/SchemaDef.js @@ -1 +1 @@ -define(["Backbone"],function(e){var t=e.Model.extend({defaults:{ddl:"",short_code:"",simple_name:"",full_name:"",valid:!0,errorMessage:"",loading:!1,ready:!1,schema_structure:[],statement_separator:";",browserEngines:{}},reset:function(){this.set(this.defaults),this.trigger("reloaded")},build:function(e){var t=e.getSelectedType(),n=this;if(!t)return!1;(!this.has("dbType")||this.get("dbType").id!=t.id)&&this.set("dbType",t),$.ajax({type:"POST",url:"index.cfm/fiddles/createSchema",data:{statement_separator:this.get("statement_separator"),db_type_id:this.get("dbType").id,schema_ddl:this.get("ddl")},dataType:"json",success:function(e,r,i){e.short_code?t.get("context")=="browser"?n.get("browserEngines")[t.get("className")].buildSchema({short_code:$.trim(e.short_code),statement_separator:n.get("statement_separator"),ddl:n.get("ddl"),success:function(){n.set({short_code:$.trim(e.short_code),ready:!0,valid:!0,errorMessage:""}),n.get("browserEngines")[t.get("className")].getSchemaStructure({callback:function(e){n.set({schema_structure:e}),n.trigger("built")}})},error:function(t){n.set({short_code:$.trim(e.short_code),ready:!1,valid:!1,errorMessage:t,schema_structure:[]}),n.trigger("failed")}}):(n.set({short_code:$.trim(e.short_code),ready:!0,valid:!0,errorMessage:"",schema_structure:e.schema_structure}),n.trigger("built")):(n.set({short_code:"",ready:!1,valid:!1,errorMessage:e.error,schema_structure:[]}),n.trigger("failed"))},error:function(e,t,r){n.set({short_code:"",ready:!1,valid:!1,errorMessage:r,schema_structure:[]}),n.trigger("failed")}})}});return t})
\ No newline at end of file +define(["Backbone"],function(e){var t=e.Model.extend({defaults:{ddl:"",short_code:"",simple_name:"",full_name:"",valid:!0,errorMessage:"",loading:!1,ready:!1,schema_structure:[],statement_separator:";",browserEngines:{}},reset:function(){this.set(this.defaults),this.trigger("reloaded")},build:function(){var e=this.get("dbType"),t=this;$.ajax({type:"POST",url:"index.cfm/fiddles/createSchema",data:{statement_separator:this.get("statement_separator"),db_type_id:this.get("dbType").id,schema_ddl:this.get("ddl")},dataType:"json",success:function(n,r,i){n.short_code?e.get("context")=="browser"?t.get("browserEngines")[e.get("className")].buildSchema({short_code:$.trim(n.short_code),statement_separator:t.get("statement_separator"),ddl:t.get("ddl"),success:function(){t.set({short_code:$.trim(n.short_code),ready:!0,valid:!0,errorMessage:""}),t.get("browserEngines")[e.get("className")].getSchemaStructure({callback:function(e){t.set({schema_structure:e}),t.trigger("built")}})},error:function(e){t.set({short_code:$.trim(n.short_code),ready:!1,valid:!1,errorMessage:e,schema_structure:[]}),t.trigger("failed")}}):(t.set({short_code:$.trim(n.short_code),ready:!0,valid:!0,errorMessage:"",schema_structure:n.schema_structure}),t.trigger("built")):(t.set({short_code:"",ready:!1,valid:!1,errorMessage:n.error,schema_structure:[]}),t.trigger("failed"))},error:function(e,n,r){t.set({short_code:"",ready:!1,valid:!1,errorMessage:r,schema_structure:[]}),t.trigger("failed")}})}});return t})
\ No newline at end of file diff --git a/src/main/webapp/javascripts_min/fiddle_backbone/router.js b/src/main/webapp/javascripts_min/fiddle_backbone/router.js index da9b1e0..b635df1 100644 --- a/src/main/webapp/javascripts_min/fiddle_backbone/router.js +++ b/src/main/webapp/javascripts_min/fiddle_backbone/router.js @@ -1 +1 @@ -define(["jQuery","Underscore","Backbone","libs/renderTerminator","fiddle_backbone/models/UsedFiddle"],function(e,t,n,r,i){var s=function(s,o,u,a,f){var l=n.Router.extend({routes:{"!:db_type_id":"DBType","!:db_type_id/:short_code":"SchemaDef","!:db_type_id/:short_code/:query_id":"Query","!:db_type_id/:short_code/:query_id/:set_id":"SetAnchor"},DBType:function(e){s.setSelectedType(e,!0),f.render()},SchemaDef:function(e,t){this.loadContent(e,"!"+e+"/"+t)},Query:function(e,t,n){this.loadContent(e,"!"+e+"/"+t+"/"+n)},SetAnchor:function(n,r,i,a){var f=function(){e("#set_"+a).length&&(window.scrollTo(0,e("#set_"+a).offset().top-50),e("#set_"+a).addClass("highlight"))};!s.getSelectedType()||s.getSelectedType().get("id")!=n||o.get("short_code")!=r||u.get("id")!=i?(u.bind("reloaded",t.once(f)),this.loadContent(n,"!"+n+"/"+r+"/"+i)):(e(".set").removeClass("highlight"),f())},loadContent:function(n,f){this.DBType(n);if(u.get("pendingChanges")&&!confirm("Warning! You have made changes to your query which will be lost. Continue?'"))return!1;o.set("loading",!0),e(".helpTip").css("display","none"),e("body").block({message:"Loading..."}),e.getJSON("index.cfm/fiddles/loadContent",{fragment:f},function(f){o.set("loading",!1);if(f.short_code){var l=s.getSelectedType();l.get("context")=="browser"?(l.get("className")=="sqljs"&&o.get("browserEngines").websql.nativeSQLite&&confirm("Fiddle originally built with SQL.js, but you have WebSQL available - would you like to use that instead (it'll be faster to load)?")&&(s.setSelectedType(e("#db_type_id a:contains('WebSQL')").closest("li").attr("db_type_id")),l=s.getSelectedType(),o.set({ddl:f.ddl,dbType:l,statement_separator:f.schema_statement_separator}),f.sql&&(u.set({schemaDef:o,sql:f.sql,statement_separator:f.query_statement_separator}),o.on("built",t.once(function(){u.execute()}))),o.build(s)),o.get("browserEngines")[l.get("className")].buildSchema({short_code:e.trim(f.short_code),statement_separator:f.schema_statement_separator,ddl:f.ddl,success:function(){o.set({short_code:f.short_code,ddl:f.ddl,ready:!0,valid:!0,errorMessage:"",statement_separator:f.schema_statement_separator,dbType:s.getSelectedType()}),r(e(".panel.schema"),f.schema_statement_separator),f.sql?(a.insert(new i({fragment:"!"+n+"/"+f.short_code+"/"+f.id})),u.set({id:f.id,sql:f.sql,statement_separator:f.query_statement_separator})):a.insert(new i({fragment:"!"+n+"/"+f.short_code})),o.get("browserEngines")[l.get("className")].getSchemaStructure({callback:function(t){o.set({schema_structure:t}),o.trigger("reloaded"),f.sql?o.get("browserEngines")[l.get("className")].executeQuery({sql:f.sql,statement_separator:f.query_statement_separator,success:function(t){u.set({sets:t}),u.trigger("reloaded"),e("body").unblock()},error:function(t){u.set({sets:[]}),u.trigger("reloaded"),e("body").unblock()}}):e("body").unblock()}})},error:function(t){o.set({short_code:f.short_code,ddl:f.ddl,ready:!0,valid:!1,errorMessage:t,dbType:s.getSelectedType(),statement_separator:f.schema_statement_separator,schema_structure:[]}),r(e(".panel.schema"),f.schema_statement_separator),f.sql&&(u.set({id:f.id,sql:f.sql,statement_separator:f.query_statement_separator,schemaDef:o}),u.trigger("reloaded")),o.trigger("failed"),o.trigger("reloaded"),e("body").unblock()}})):(o.set({short_code:f.short_code,ddl:f.ddl,ready:!0,valid:!0,errorMessage:"",statement_separator:f.schema_statement_separator,schema_structure:f.schema_structure}),r(e(".panel.schema"),f.schema_statement_separator),o.trigger("reloaded"),f.sql?(a.insert(new i({fragment:"!"+n+"/"+f.short_code+"/"+f.id})),u.set({id:f.id,sql:f.sql,sets:f.sets,statement_separator:f.query_statement_separator}),u.trigger("reloaded")):a.insert(new i({fragment:"!"+n+"/"+f.short_code})),e("body").unblock())}else e("body").unblock()})}}),c=new l;return n.history.start({pushState:!1}),c};return{initialize:s}})
\ No newline at end of file +define(["jQuery","Underscore","Backbone","libs/renderTerminator","fiddle_backbone/models/UsedFiddle"],function(e,t,n,r,i){var s=function(s,o,u,a,f){var l=n.Router.extend({routes:{"!:db_type_id":"DBType","!:db_type_id/:short_code":"SchemaDef","!:db_type_id/:short_code/:query_id":"Query","!:db_type_id/:short_code/:query_id/:set_id":"SetAnchor"},DBType:function(e){s.setSelectedType(e,!0),f.render()},SchemaDef:function(e,t){this.loadContent(e,"!"+e+"/"+t)},Query:function(e,t,n){this.loadContent(e,"!"+e+"/"+t+"/"+n)},SetAnchor:function(n,r,i,a){var f=function(){e("#set_"+a).length&&(window.scrollTo(0,e("#set_"+a).offset().top-50),e("#set_"+a).addClass("highlight"))};!s.getSelectedType()||s.getSelectedType().get("id")!=n||o.get("short_code")!=r||u.get("id")!=i?(u.bind("reloaded",t.once(f)),this.loadContent(n,"!"+n+"/"+r+"/"+i)):(e(".set").removeClass("highlight"),f())},loadContent:function(n,f){this.DBType(n);if(u.get("pendingChanges")&&!confirm("Warning! You have made changes to your query which will be lost. Continue?'"))return!1;o.set("loading",!0),e(".helpTip").css("display","none"),e("body").block({message:"Loading..."}),e.getJSON("index.cfm/fiddles/loadContent",{fragment:f},function(f){o.set("loading",!1);if(f.short_code){var l=s.getSelectedType();l.get("context")=="browser"?(l.get("className")=="sqljs"&&o.get("browserEngines").websql.nativeSQLite&&confirm("Fiddle originally built with SQL.js, but you have WebSQL available - would you like to use that instead (it'll be faster to load)?")&&(s.setSelectedType(e("#db_type_id a:contains('WebSQL')").closest("li").attr("db_type_id")),l=s.getSelectedType(),o.set({ddl:f.ddl,dbType:l,statement_separator:f.schema_statement_separator}),f.sql&&(u.set({schemaDef:o,sql:f.sql,statement_separator:f.query_statement_separator}),o.on("built",t.once(function(){u.execute()}))),o.build()),o.get("browserEngines")[l.get("className")].buildSchema({short_code:e.trim(f.short_code),statement_separator:f.schema_statement_separator,ddl:f.ddl,success:function(){o.set({short_code:f.short_code,ddl:f.ddl,ready:!0,valid:!0,errorMessage:"",statement_separator:f.schema_statement_separator,dbType:s.getSelectedType()}),r(e(".panel.schema"),f.schema_statement_separator),f.sql?(a.insert(new i({fragment:"!"+n+"/"+f.short_code+"/"+f.id})),u.set({id:f.id,sql:f.sql,statement_separator:f.query_statement_separator})):a.insert(new i({fragment:"!"+n+"/"+f.short_code})),o.get("browserEngines")[l.get("className")].getSchemaStructure({callback:function(t){o.set({schema_structure:t}),o.trigger("reloaded"),f.sql?o.get("browserEngines")[l.get("className")].executeQuery({sql:f.sql,statement_separator:f.query_statement_separator,success:function(t){u.set({sets:t}),u.trigger("reloaded"),e("body").unblock()},error:function(t){u.set({sets:[]}),u.trigger("reloaded"),e("body").unblock()}}):e("body").unblock()}})},error:function(t){o.set({short_code:f.short_code,ddl:f.ddl,ready:!0,valid:!1,errorMessage:t,dbType:s.getSelectedType(),statement_separator:f.schema_statement_separator,schema_structure:[]}),r(e(".panel.schema"),f.schema_statement_separator),f.sql&&(u.set({id:f.id,sql:f.sql,statement_separator:f.query_statement_separator,schemaDef:o}),u.trigger("reloaded")),o.trigger("failed"),o.trigger("reloaded"),e("body").unblock()}})):(o.set({short_code:f.short_code,ddl:f.ddl,ready:!0,valid:!0,errorMessage:"",statement_separator:f.schema_statement_separator,schema_structure:f.schema_structure}),r(e(".panel.schema"),f.schema_statement_separator),o.trigger("reloaded"),f.sql?(a.insert(new i({fragment:"!"+n+"/"+f.short_code+"/"+f.id})),u.set({id:f.id,sql:f.sql,sets:f.sets,statement_separator:f.query_statement_separator}),u.trigger("reloaded")):a.insert(new i({fragment:"!"+n+"/"+f.short_code})),e("body").unblock())}else e("body").unblock()})}}),c=new l;return n.history.start({pushState:!1}),c};return{initialize:s}})
\ No newline at end of file diff --git a/src/main/webapp/javascripts_min/fiddle_backbone/templates/queryMarkdownOutput.html b/src/main/webapp/javascripts_min/fiddle_backbone/templates/queryMarkdownOutput.html new file mode 100644 index 0000000..54a3ea5 --- /dev/null +++ b/src/main/webapp/javascripts_min/fiddle_backbone/templates/queryMarkdownOutput.html @@ -0,0 +1,29 @@ +{{#if id}} +Markdown is useful for posting on sites like <a href="http://stackoverflow.com" target="_new">StackOverflow</a> and <a href="http://dba.stackexchange.com" target="_new">dba.se</a>. Also, those sites are great resources for getting help with database questions! +<pre class="results">[SQL Fiddle][1] + +**{{schemaDef.dbType.full_name}} Schema Setup**: + +{{code_format schemaDef.ddl}} +{{#each_with_index sets}} +**Query {{add index 1}}**: + +{{code_format STATEMENT}} + +**[Results][{{add index 2}}]**: + {{#if this.RESULTS.DATA.length}} + |{{#each_simple_value_with_index this.RESULTS.COLUMNS}} {{result_display_padded ../this/RESULTS/COLUMNWIDTHS}} |{{/each_simple_value_with_index}} + -{{#each_simple_value_with_index this.RESULTS.COLUMNS}}-{{divider_display ../this/RESULTS/COLUMNWIDTHS}}--{{/each_simple_value_with_index}}{{#each this.RESULTS.DATA}} + |{{#each_simple_value_with_index this}} {{result_display_padded ../../this/RESULTS/COLUMNWIDTHS}} |{{/each_simple_value_with_index}}{{/each}} +{{/if}} +{{/each_with_index}} + + [1]: http://sqlfiddle.com/#!{{../schemaDef/dbType/id}}/{{../schemaDef/short_code}}/{{id}} +{{#each_with_index sets}} + [{{add index 2}}]: http://sqlfiddle.com/#!{{../../schemaDef/dbType/id}}/{{../../schemaDef/short_code}}/{{../../id}}/{{index}} +{{/each_with_index}} +</pre> + +<span id="donationSuggestion">Did this query solve the problem? If so, consider donating $5 to help make sure SQL Fiddle will be here next time you need help with a database problem. Thanks!</span> + +{{/if}}
\ No newline at end of file diff --git a/src/main/webapp/javascripts_min/fiddle_backbone/templates/queryPlaintextOutput.html b/src/main/webapp/javascripts_min/fiddle_backbone/templates/queryPlaintextOutput.html index 4e5190d..7c822b1 100644 --- a/src/main/webapp/javascripts_min/fiddle_backbone/templates/queryPlaintextOutput.html +++ b/src/main/webapp/javascripts_min/fiddle_backbone/templates/queryPlaintextOutput.html @@ -38,6 +38,12 @@ <td><a href="index.cfm/Fiddles/getSQLPlan?db_type_id={{../../../../schemaDef/dbType/id}}&short_code={{../../../../schemaDef/short_code}}&query_id={{../../../../id}}&id={{index}}">Download .sqlplan</a></td> </tr> {{/if}} + + {{#if ../../../schemaDef/dbType/isPostgreSQL}} + <tr> + <td><form action="http://explain.depesz.com/" target="_new"><input type="hidden" name="title" value="{{../../schemaDef/dbType/id}}/{{../../schemaDef/short_code}}/{{../../id}}/{{index}}"><input type="hidden" name="plan" value=""><input type="submit" class="btn btn-info depesz" value="View on Depesz"></form></td> + </tr> + {{/if}} </table> {{/if}} @@ -48,5 +54,5 @@ </div> {{/each_with_index}} - <span id="donationSuggestion">Did this query solve the problem? If so, consider donating $5 to help make sure SQL Fiddle will be here next time you need help with a database problem. Thanks!</span> + <span id="donationSuggestion">Did this query solve the problem? If so, consider donating $5 to help make sure SQL Fiddle will be here next time you need help with a database problem. Thanks!</span> {{/if}} diff --git a/src/main/webapp/javascripts_min/fiddle_backbone/templates/queryTabularOutput.html b/src/main/webapp/javascripts_min/fiddle_backbone/templates/queryTabularOutput.html index e398b5f..ae7a80e 100644 --- a/src/main/webapp/javascripts_min/fiddle_backbone/templates/queryTabularOutput.html +++ b/src/main/webapp/javascripts_min/fiddle_backbone/templates/queryTabularOutput.html @@ -48,6 +48,12 @@ </tr> {{/if}} + {{#if ../../../schemaDef/dbType/isPostgreSQL}} + <tr> + <td><form action="http://explain.depesz.com/" target="_new"><input type="hidden" name="title" value="{{../../schemaDef/dbType/id}}/{{../../schemaDef/short_code}}/{{../../id}}/{{index}}"><input type="hidden" name="plan" value=""><input type="submit" class="btn btn-info depesz" value="View on Depesz"></form></td> + </tr> + {{/if}} + </table> {{/if}} diff --git a/src/main/webapp/javascripts_min/fiddle_backbone/views/Query.js b/src/main/webapp/javascripts_min/fiddle_backbone/views/Query.js index 4b38e73..91cb1b5 100644 --- a/src/main/webapp/javascripts_min/fiddle_backbone/views/Query.js +++ b/src/main/webapp/javascripts_min/fiddle_backbone/views/Query.js @@ -1 +1 @@ -define(["jQuery","Backbone","Handlebars","FiddleEditor","libs/renderTerminator","XPlans/oracle/loadswf","XPlans/mssql","text!fiddle_backbone/templates/queryTabularOutput.html","text!fiddle_backbone/templates/queryPlaintextOutput.html","HandlebarsHelpers/divider_display","HandlebarsHelpers/each_simple_value_with_index","HandlebarsHelpers/each_with_index","HandlebarsHelpers/result_display_padded","HandlebarsHelpers/result_display"],function(e,t,n,r,i,s,o,u,a){var f=t.View.extend({initialize:function(){this.editor=new r(this.id,this.handleQueryChange,this),this.outputType="tabular",this.compiledOutputTemplate={},this.compiledOutputTemplate.tabular=n.compile(u),this.compiledOutputTemplate.plaintext=n.compile(a)},setOutputType:function(e){this.outputType=e},handleQueryChange:function(){var t=this.model.get("schemaDef");this.model.set({sql:this.editor.getValue()}),e(".sql .helpTip").css("display",!t.get("ready")||t.get("loading")||this.model.get("sql").length?"none":"block")},render:function(){this.editor.setValue(this.model.get("sql")),this.model.id&&this.renderOutput(),i(e(".panel.sql"),this.model.get("statement_separator"))},renderOutput:function(){var t=this.model,n=this.model.toJSON();_.each(n.sets,function(e,t){if(e.RESULTS){var r=_.map(e.RESULTS.COLUMNS,function(e){return e.length});_.each(e.RESULTS.DATA,function(e){r=_.map(e,function(e,t){return _.max([e.toString().length,r[t]])})}),n.sets[t].RESULTS.COLUMNWIDTHS=r}}),n.schemaDef=this.model.get("schemaDef").toJSON(),n.schemaDef.dbType=this.model.get("schemaDef").get("dbType").toJSON(),n.schemaDef.dbType.isSQLServer=this.model.get("schemaDef").get("dbType").get("simple_name")=="SQL Server",this.options.output_el.html(this.compiledOutputTemplate[this.outputType](n)),e("script.oracle_xplan_xml").each(function(){e(this).siblings("div.oracle_xplan").html(s(e(this).text()))}),this.options.output_el.find("a.executionPlanLink").click(function(n){n.preventDefault(),e("i",this).toggleClass("icon-minus icon-plus"),e(this).closest(".set").find(".executionPlan").toggle(),e("i",this).hasClass("icon-minus")&&t.get("schemaDef").get("dbType").get("simple_name")=="SQL Server"&&o.drawLines(e(this).closest(".set").find(".executionPlan div"))})},refresh:function(){this.editor.refresh()},checkForSelectedText:function(){this.editor.somethingSelected()?this.model.set("sql",this.editor.getSelection()):this.model.set("sql",this.editor.getValue())}});return f})
\ No newline at end of file +define(["jQuery","Underscore","Backbone","Handlebars","FiddleEditor","libs/renderTerminator","XPlans/oracle/loadswf","XPlans/mssql","text!fiddle_backbone/templates/queryTabularOutput.html","text!fiddle_backbone/templates/queryPlaintextOutput.html","text!fiddle_backbone/templates/queryMarkdownOutput.html","HandlebarsHelpers/divider_display","HandlebarsHelpers/each_simple_value_with_index","HandlebarsHelpers/each_with_index","HandlebarsHelpers/result_display_padded","HandlebarsHelpers/result_display","HandlebarsHelpers/code_format","HandlebarsHelpers/add"],function(e,t,n,r,i,s,o,u,a,f,l){var c=n.View.extend({initialize:function(){this.editor=new i(this.id,this.handleQueryChange,this,t.bind(function(){this.model.execute()},this)),this.outputType="tabular",this.compiledOutputTemplate={},this.compiledOutputTemplate.tabular=r.compile(a),this.compiledOutputTemplate.plaintext=r.compile(f),this.compiledOutputTemplate.markdown=r.compile(l)},setOutputType:function(e){this.outputType=e},handleQueryChange:function(t){var n=this.model.get("schemaDef");this.model.set({sql:this.editor.getValue()}),e(".sql .helpTip").css("display",!n.get("ready")||n.get("loading")||this.model.get("sql").length?"none":"block")},render:function(){this.editor.setValue(this.model.get("sql")),this.model.id&&this.renderOutput(),s(e(".panel.sql"),this.model.get("statement_separator"))},renderOutput:function(){var n=this.model,r=this.model.toJSON();t.each(r.sets,function(e,n){if(e.RESULTS){var i=t.map(e.RESULTS.COLUMNS,function(e){return e.length});t.each(e.RESULTS.DATA,function(e){i=t.map(e,function(e,n){return t.max([e.toString().length,i[n]])})}),r.sets[n].RESULTS.COLUMNWIDTHS=i}}),r.schemaDef=this.model.get("schemaDef").toJSON(),r.schemaDef.dbType=this.model.get("schemaDef").get("dbType").toJSON(),r.schemaDef.dbType.isSQLServer=this.model.get("schemaDef").get("dbType").get("simple_name")=="SQL Server",r.schemaDef.dbType.isPostgreSQL=this.model.get("schemaDef").get("dbType").get("simple_name")=="PostgreSQL",this.options.output_el.html(this.compiledOutputTemplate[this.outputType](r)),e("script.oracle_xplan_xml").each(function(){e(this).siblings("div.oracle_xplan").html(o(e(this).text()))}),this.options.output_el.find("a.executionPlanLink").click(function(t){t.preventDefault(),e("i",this).toggleClass("icon-minus icon-plus"),e(this).closest(".set").find(".executionPlan").toggle(),e("i",this).hasClass("icon-minus")&&n.get("schemaDef").get("dbType").get("simple_name")=="SQL Server"&&u.drawLines(e(this).closest(".set").find(".executionPlan div"))})},refresh:function(){this.editor.refresh()},checkForSelectedText:function(){this.editor.somethingSelected()?this.model.set("sql",this.editor.getSelection()):this.model.set("sql",this.editor.getValue())}});return c})
\ No newline at end of file diff --git a/src/main/webapp/javascripts_min/fiddle_backbone/views/SchemaDef.js b/src/main/webapp/javascripts_min/fiddle_backbone/views/SchemaDef.js index 14c6a90..4f8034c 100644 --- a/src/main/webapp/javascripts_min/fiddle_backbone/views/SchemaDef.js +++ b/src/main/webapp/javascripts_min/fiddle_backbone/views/SchemaDef.js @@ -1 +1 @@ -define(["jQuery","Backbone","Handlebars","FiddleEditor","libs/renderTerminator","text!fiddle_backbone/templates/schemaOutput.html","text!fiddle_backbone/templates/schemaBrowser.html"],function(e,t,n,r,i,s,o){var u=t.View.extend({initialize:function(){this.editor=new r(this.id,this.handleSchemaChange,this),this.compiledOutputTemplate=n.compile(s),this.compiledSchemaBrowserTemplate=n.compile(o)},handleSchemaChange:function(){if(this.model.get("ddl")!=this.editor.getValue()||this.model.get("statement_separator")!=e(".panel.schema .terminator").data("statement_separator"))this.model.set({ddl:this.editor.getValue(),statement_separator:e(".panel.schema .terminator").data("statement_separator"),ready:!1}),e(".schema .helpTip").css("display",this.model.get("ddl").length?"none":"block"),e(".sql .helpTip").css("display",!this.model.get("ready")||this.model.get("loading")?"none":"block")},render:function(){this.editor.setValue(this.model.get("ddl")),this.updateDependents(),i(e(".panel.schema"),this.model.get("statement_separator"))},renderOutput:function(){this.options.output_el.html(this.compiledOutputTemplate(this.model.toJSON()))},renderSchemaBrowser:function(){this.options.browser_el.html(this.compiledSchemaBrowserTemplate({objects:this.model.get("schema_structure")}))},refresh:function(){this.editor.refresh()},updateDependents:function(){this.model.get("ready")?(e(".needsReadySchema").unblock(),e("#schemaBrowser").attr("disabled",!1),e(".schema .helpTip").css("display","none")):(e(".needsReadySchema").block({message:"Please build schema."}),e("#schemaBrowser").attr("disabled",!0),e(".schema .helpTip").css("display",this.model.get("loading")||this.model.get("ddl").length?"none":"block"))}});return u})
\ No newline at end of file +define(["jQuery","Backbone","Handlebars","FiddleEditor","libs/renderTerminator","text!fiddle_backbone/templates/schemaOutput.html","text!fiddle_backbone/templates/schemaBrowser.html"],function(e,t,n,r,i,s,o){var u=t.View.extend({initialize:function(){this.editor=new r(this.id,this.handleSchemaChange,this,_.bind(function(){this.model.build()},this)),this.compiledOutputTemplate=n.compile(s),this.compiledSchemaBrowserTemplate=n.compile(o)},handleSchemaChange:function(){if(this.model.get("ddl")!=this.editor.getValue()||this.model.get("statement_separator")!=e(".panel.schema .terminator").data("statement_separator"))this.model.set({ddl:this.editor.getValue(),statement_separator:e(".panel.schema .terminator").data("statement_separator"),ready:!1}),e(".schema .helpTip").css("display",this.model.get("ddl").length?"none":"block"),e(".sql .helpTip").css("display",!this.model.get("ready")||this.model.get("loading")?"none":"block")},render:function(){this.editor.setValue(this.model.get("ddl")),this.updateDependents(),i(e(".panel.schema"),this.model.get("statement_separator"))},renderOutput:function(){this.options.output_el.html(this.compiledOutputTemplate(this.model.toJSON()))},renderSchemaBrowser:function(){this.options.browser_el.html(this.compiledSchemaBrowserTemplate({objects:this.model.get("schema_structure")}))},refresh:function(){this.editor.refresh()},updateDependents:function(){this.model.get("ready")?(e(".needsReadySchema").unblock(),e("#schemaBrowser").attr("disabled",!1),e(".schema .helpTip").css("display","none")):(e(".needsReadySchema").block({message:"Please build schema."}),e("#schemaBrowser").attr("disabled",!0),e(".schema .helpTip").css("display",this.model.get("loading")||this.model.get("ddl").length?"none":"block"))}});return u})
\ No newline at end of file diff --git a/src/main/webapp/javascripts_min/libs/browserEngines/sqljs_driver.js b/src/main/webapp/javascripts_min/libs/browserEngines/sqljs_driver.js index f765560..da1f0d2 100644 --- a/src/main/webapp/javascripts_min/libs/browserEngines/sqljs_driver.js +++ b/src/main/webapp/javascripts_min/libs/browserEngines/sqljs_driver.js @@ -1 +1 @@ -define(["jQuery","BrowserEngines/sqlite_driver"],function(e,t){var n=function(){return this.db=null,this};return e.extend(n.prototype,t.prototype),n.prototype.buildSchema=function(n){var r=this;try{var i=function(){r.db=SQL.open(),e.each(t.prototype.splitStatement.call(this,n.ddl,n.statement_separator),function(e,t){r.db.exec(t)}),n.success()};window.SQL===undefined?e.getScript("javascripts_static/sql.js",function(e,t,n){i()}).fail(function(e,t,r){n.error("Your browser does not work with SQL.js. Try using a different browser (Chrome, Safari, Firefox, IE 10, etc...), or a newer version of your current one.")}):(r.db&&r.db.close(),i())}catch(s){n.error(s)}},n.prototype.executeQuery=function(n){var r=this;try{if(!r.db)throw"Database Schema not available!";var i=[];r.db.exec("BEGIN TRANSACTION"),e.each(t.prototype.splitStatement.call(this,n.sql,n.statement_separator),function(t,n){if(e.trim(n).length){var s=new Date,o=[];try{o=r.db.exec(n);var u={SUCCEEDED:!0,EXECUTIONTIME:new Date-s,RESULTS:{COLUMNS:[],DATA:[]},EXECUTIONPLAN:{COLUMNS:[],DATA:[]}};o.length&&e.each(o,function(t,n){var r=[];e.each(n,function(e,n){t==0&&u.RESULTS.COLUMNS.push(n.column),r.push(n.value)}),u.RESULTS.DATA.push(r)});try{exectionPlanArray=r.db.exec("EXPLAIN QUERY PLAN "+n),exectionPlanArray.length&&e.each(exectionPlanArray,function(t,n){var r=[];e.each(n,function(e,n){t==0&&u.EXECUTIONPLAN.COLUMNS.push(n.column),r.push(n.value)}),u.EXECUTIONPLAN.DATA.push(r)})}catch(a){}i.push(u)}catch(a){var u={SUCCEEDED:!1,EXECUTIONTIME:new Date-s,ERRORMESSAGE:a};return i.push(u),!1}}}),r.db.exec("ROLLBACK TRANSACTION"),n.success(i)}catch(s){n.error(s)}},n})
\ No newline at end of file +define(["jQuery","BrowserEngines/sqlite_driver"],function(e,t){var n=function(){return this.db=null,this};return e.extend(n.prototype,t.prototype),n.prototype.buildSchema=function(n){var r=this;try{var i=function(){r.db=SQL.open(),e.each(t.prototype.splitStatement.call(this,n.ddl,n.statement_separator),function(e,t){r.db.exec(t)}),n.success()};window.SQL===undefined?e.getScript("javascripts_static/sql.js",function(e,t,n){i()}).fail(function(e,t,r){n.error("Your browser does not work with SQL.js. Try using a different browser (Chrome, Safari, Firefox, IE 10, etc...), or a newer version of your current one.")}):(r.db&&r.db.close(),i())}catch(s){n.error(s)}},n.prototype.executeQuery=function(n){var r=this;try{if(!r.db)throw"Database Schema not available!";var i=[];r.db.exec("BEGIN TRANSACTION"),e.each(t.prototype.splitStatement.call(this,n.sql,n.statement_separator),function(t,n){if(e.trim(n).length){var s=new Date,o=[];try{o=r.db.exec(n);var u={SUCCEEDED:!0,STATEMENT:n,EXECUTIONTIME:new Date-s,RESULTS:{COLUMNS:[],DATA:[]},EXECUTIONPLAN:{COLUMNS:[],DATA:[]}};o.length&&e.each(o,function(t,n){var r=[];e.each(n,function(e,n){t==0&&u.RESULTS.COLUMNS.push(n.column),r.push(n.value)}),u.RESULTS.DATA.push(r)});try{exectionPlanArray=r.db.exec("EXPLAIN QUERY PLAN "+n),exectionPlanArray.length&&e.each(exectionPlanArray,function(t,n){var r=[];e.each(n,function(e,n){t==0&&u.EXECUTIONPLAN.COLUMNS.push(n.column),r.push(n.value)}),u.EXECUTIONPLAN.DATA.push(r)})}catch(a){}i.push(u)}catch(a){var u={SUCCEEDED:!1,EXECUTIONTIME:new Date-s,ERRORMESSAGE:a};return i.push(u),!1}}}),r.db.exec("ROLLBACK TRANSACTION"),n.success(i)}catch(s){n.error(s)}},n})
\ No newline at end of file diff --git a/src/main/webapp/javascripts_min/libs/browserEngines/websql_driver.js b/src/main/webapp/javascripts_min/libs/browserEngines/websql_driver.js index d90ead1..7064fe5 100644 --- a/src/main/webapp/javascripts_min/libs/browserEngines/websql_driver.js +++ b/src/main/webapp/javascripts_min/libs/browserEngines/websql_driver.js @@ -1 +1 @@ -define(["jQuery","BrowserEngines/sqlite_driver"],function(e,t){var n=function(){return this.db=null,this.ddl=[],this.nativeSQLite=window.openDatabase!==undefined,this};return e.extend(n.prototype,t.prototype),n.prototype.buildSchema=function(e){var t=this;try{t.nativeSQLite?(t.db=openDatabase(e.short_code,"1.0",e.short_code,e.ddl.length*1024),t.db.transaction(function(n){var r=t.splitStatement(e.ddl,e.statement_separator);t.ddl=r;var i=0,s=r[i],o=function(t,a){if(i<r.length-1){do i++,s=r[i];while(i<r.length-1&&s.match(/^\s*$/));s.match(/^\s*$/)?(n.executeSql("intentional failure used to rollback transaction"),e.success()):n.executeSql(s,[],o,u)}else n.executeSql("intentional failure used to rollback transaction"),e.success()},u=function(t,n){return n.message!="not an error"?e.error(n.message):e.success(),!0};s?n.executeSql(s,[],o,u):e.success()})):e.error("SQLite (WebSQL) not available in your browser. Try either using a webkit-based browser (such as Safari or Chrome) or using the SQLite (SQL.js) database type.")}catch(n){e.error(n)}},n.prototype.executeQuery=function(t){var n=this;try{if(n.db==null)throw"You need to build the schema before you can run a query.";var r=[];n.db.transaction(function(i){var s=function(e,u){var a={SUCCEEDED:!0,EXECUTIONTIME:new Date-p,RESULTS:{COLUMNS:[],DATA:[]},EXECUTIONPLAN:{COLUMNS:[],DATA:[]}};for(var f=0;f<u.rows.length;f++){var d=[],v=u.rows.item(f);if(f==0)for(col in v)a.RESULTS.COLUMNS.push(col);for(var m=0;m<a.RESULTS.COLUMNS.length;m++)d.push(v[a.RESULTS.COLUMNS[m]]);a.RESULTS.DATA.push(d)}i.executeSql("EXPLAIN QUERY PLAN "+h,[],function(e,u){for(var f=0;f<u.rows.length;f++){var p=[],d=u.rows.item(f);if(f==0)for(col in d)a.EXECUTIONPLAN.COLUMNS.push(col);for(var v=0;v<a.EXECUTIONPLAN.COLUMNS.length;v++)p.push(d[a.EXECUTIONPLAN.COLUMNS[v]]);a.EXECUTIONPLAN.DATA.push(p)}c>n.ddl.length-1&&r.push(a);if(c<l.length-1){do c++,h=l[c];while(c<l.length-1&&h.match(/^\s*$/));h.match(/^\s*$/)?(i.executeSql("intentional failure used to rollback transaction"),t.success(r)):i.executeSql(h,[],s,o)}else i.executeSql("intentional failure used to rollback transaction"),t.success(r)},function(e,u){c>n.ddl.length-1&&r.push(a);if(c<l.length-1){do c++,h=l[c];while(c<l.length-1&&h.match(/^\s*$/));h.match(/^\s*$/)?(i.executeSql("intentional failure used to rollback transaction"),t.success(r)):i.executeSql(h,[],s,o)}else i.executeSql("intentional failure used to rollback transaction"),t.success(r)})},o=function(e,n){if(n.message!="not an error"){var i={SUCCEEDED:!1,EXECUTIONTIME:new Date-p,ERRORMESSAGE:n.message};r.push(i)}return t.success(r),!0},u=[],a,f=!1,l=n.ddl.slice(0);e.each(n.splitStatement(t.sql,t.statement_separator),function(e,t){l.push(t)});var c=0,h=l[c],p=new Date;i.executeSql(h,[],s,o)})}catch(i){t.error(i)}},n})
\ No newline at end of file +define(["jQuery","BrowserEngines/sqlite_driver"],function(e,t){var n=function(){return this.db=null,this.ddl=[],this.nativeSQLite=window.openDatabase!==undefined,this};return e.extend(n.prototype,t.prototype),n.prototype.buildSchema=function(e){var t=this;try{t.nativeSQLite?(t.db=openDatabase(e.short_code,"1.0",e.short_code,e.ddl.length*1024),t.db.transaction(function(n){var r=t.splitStatement(e.ddl,e.statement_separator);t.ddl=r;var i=0,s=r[i],o=function(t,a){if(i<r.length-1){do i++,s=r[i];while(i<r.length-1&&s.match(/^\s*$/));s.match(/^\s*$/)?(n.executeSql("intentional failure used to rollback transaction"),e.success()):n.executeSql(s,[],o,u)}else n.executeSql("intentional failure used to rollback transaction"),e.success()},u=function(t,n){return n.message!="not an error"?e.error(n.message):e.success(),!0};s?n.executeSql(s,[],o,u):e.success()})):e.error("SQLite (WebSQL) not available in your browser. Try either using a webkit-based browser (such as Safari or Chrome) or using the SQLite (SQL.js) database type.")}catch(n){e.error(n)}},n.prototype.executeQuery=function(t){var n=this;try{if(n.db==null)throw"You need to build the schema before you can run a query.";var r=[];n.db.transaction(function(i){var s=function(e,u){var a={STATEMENT:h,SUCCEEDED:!0,EXECUTIONTIME:new Date-p,RESULTS:{COLUMNS:[],DATA:[]},EXECUTIONPLAN:{COLUMNS:[],DATA:[]}};for(var f=0;f<u.rows.length;f++){var d=[],v=u.rows.item(f);if(f==0)for(col in v)a.RESULTS.COLUMNS.push(col);for(var m=0;m<a.RESULTS.COLUMNS.length;m++)d.push(v[a.RESULTS.COLUMNS[m]]);a.RESULTS.DATA.push(d)}i.executeSql("EXPLAIN QUERY PLAN "+h,[],function(e,u){for(var f=0;f<u.rows.length;f++){var p=[],d=u.rows.item(f);if(f==0)for(col in d)a.EXECUTIONPLAN.COLUMNS.push(col);for(var v=0;v<a.EXECUTIONPLAN.COLUMNS.length;v++)p.push(d[a.EXECUTIONPLAN.COLUMNS[v]]);a.EXECUTIONPLAN.DATA.push(p)}c>n.ddl.length-1&&r.push(a);if(c<l.length-1){do c++,h=l[c];while(c<l.length-1&&h.match(/^\s*$/));h.match(/^\s*$/)?(i.executeSql("intentional failure used to rollback transaction"),t.success(r)):i.executeSql(h,[],s,o)}else i.executeSql("intentional failure used to rollback transaction"),t.success(r)},function(e,u){c>n.ddl.length-1&&r.push(a);if(c<l.length-1){do c++,h=l[c];while(c<l.length-1&&h.match(/^\s*$/));h.match(/^\s*$/)?(i.executeSql("intentional failure used to rollback transaction"),t.success(r)):i.executeSql(h,[],s,o)}else i.executeSql("intentional failure used to rollback transaction"),t.success(r)})},o=function(e,n){if(n.message!="not an error"){var i={SUCCEEDED:!1,EXECUTIONTIME:new Date-p,ERRORMESSAGE:n.message};r.push(i)}return t.success(r),!0},u=[],a,f=!1,l=n.ddl.slice(0);e.each(n.splitStatement(t.sql,t.statement_separator),function(e,t){l.push(t)});var c=0,h=l[c],p=new Date;i.executeSql(h,[],s,o)})}catch(i){t.error(i)}},n})
\ No newline at end of file diff --git a/src/main/webapp/javascripts_min/libs/codemirror/codemirror.js b/src/main/webapp/javascripts_min/libs/codemirror/codemirror.js index 0a5da03..8467139 100644 --- a/src/main/webapp/javascripts_min/libs/codemirror/codemirror.js +++ b/src/main/webapp/javascripts_min/libs/codemirror/codemirror.js @@ -1 +1 @@ -var CodeMirror=function(){function e(r,i){function Kt(e){return e>=0&&e<bt.size}function Gt(e){return E(bt,e)}function Yt(e,t){Bt=!0;var n=t-e.height;for(var r=e;r;r=r.parent)r.height+=n}function Zt(e){var t={line:0,ch:0};mn(t,{line:bt.size-1,ch:Gt(bt.size-1).text.length},ut(e),t,t),Ot=!0}function en(){var e=[];return bt.iter(0,bt.size,function(t){e.push(t.text)}),e.join("\n")}function tn(e){function c(e){var t=Hr(e,!0);if(t&&!Z(t,o)){Et||dn(),o=t,zn(r,t),Ot=!1;var n=Bn();if(t.line>=n.to||t.line<n.from)u=setTimeout(Jr(function(){c(e)}),150)}}function h(e){clearTimeout(u);var t=Hr(e);t&&zn(r,t),L(e),_n(),Ot=!0,p(),f()}Un(D(e,"shiftKey"));for(var t=M(e);t!=y;t=t.parentNode)if(t.parentNode==V&&t!=J)return;for(var t=M(e);t!=y;t=t.parentNode)if(t.parentNode==nt)return s.onGutterClick&&s.onGutterClick(Qt,st(nt.childNodes,t)+It,e),L(e);var r=Hr(e);switch(_(e)){case 3:j&&!n&&Br(e);return;case 2:r&&Vn(r.line,r.ch,!0);return}if(!r){M(e)==z&&L(e);return}Et||dn();var i=+(new Date);if(Nt&&Nt.time>i-400&&Z(Nt.pos,r))return L(e),setTimeout(_n,20),tr(r.line);if(Tt&&Tt.time>i-400&&Z(Tt.pos,r))return Nt={time:i,pos:r},L(e),er(r);Tt={time:i,pos:r};var o=r,u;if(s.dragDrop&&X&&!s.readOnly&&!Z(St.from,St.to)&&!et(r,St.from)&&!et(St.to,r)){R&&(rt.draggable=!0);function a(t){R&&(rt.draggable=!1),kt=!1,f(),l(),Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)<10&&(L(t),Vn(r.line,r.ch,!0),_n())}var f=P(document,"mouseup",Jr(a),!0),l=P(z,"drop",Jr(a),!0);kt=!0,rt.dragDrop&&rt.dragDrop();return}L(e),Vn(r.line,r.ch,!0);var p=P(document,"mousemove",Jr(function(e){clearTimeout(u),L(e),!F&&!_(e)?h(e):c(e)}),!0),f=P(document,"mouseup",Jr(h),!0)}function nn(e){for(var t=M(e);t!=y;t=t.parentNode)if(t.parentNode==nt)return L(e);var n=Hr(e);if(!n)return;Nt={time:+(new Date),pos:n},L(e),er(n)}function rn(e){if(s.onDragEvent&&s.onDragEvent(Qt,k(e)))return;e.preventDefault();var t=Hr(e,!0),n=e.dataTransfer.files;if(!t||s.readOnly)return;if(n&&n.length&&window.FileReader&&window.File){function r(e,n){var r=new FileReader;r.onload=function(){o[n]=r.result,++u==i&&(t=Jn(t),Jr(function(){var e=En(o.join(""),t,t);zn(t,e)})())},r.readAsText(e)}var i=n.length,o=Array(i),u=0;for(var a=0;a<i;++a)r(n[a],a)}else try{var o=e.dataTransfer.getData("Text");o&&Kr(function(){var e=St.from,n=St.to;zn(t,t),kt&&En("",e,n),Sn(o),_n()})}catch(e){}}function sn(e){var t=Nn();e.dataTransfer.setData("Text",t);if(j||U){var n=document.createElement("img");n.scr="data:image/gif;base64,R0lGODdhAgACAIAAAAAAAP///ywAAAAAAgACAAACAoRRADs=",e.dataTransfer.setDragImage(n,0,0)}}function on(e,t){if(typeof e=="string"){e=u[e];if(!e)return!1}var n=xt;try{s.readOnly&&(At=!0),t&&(xt=null),e(Qt)}catch(r){if(r!=B)throw r;return!1}finally{xt=n,At=!1}return!0}function un(e){function u(){o=!0}var t=f(s.keyMap),n=t.auto;clearTimeout(ln),n&&!c(e)&&(ln=setTimeout(function(){f(s.keyMap)==t&&(s.keyMap=n.call?n.call(null,Qt):n)},50));var r=ft[D(e,"keyCode")],i=!1;if(r==null||e.altGraphKey)return!1;D(e,"altKey")&&(r="Alt-"+r),D(e,"ctrlKey")&&(r="Ctrl-"+r),D(e,"metaKey")&&(r="Cmd-"+r);var o=!1;return D(e,"shiftKey")?i=l("Shift-"+r,s.extraKeys,s.keyMap,function(e){return on(e,!0)},u)||l(r,s.extraKeys,s.keyMap,function(e){if(typeof e=="string"&&/^go[A-Z]/.test(e))return on(e)},u):i=l(r,s.extraKeys,s.keyMap,on,u),o&&(i=!1),i&&(L(e),F&&(e.oldKeyCode=e.keyCode,e.keyCode=0)),i}function an(e,t){var n=l("'"+t+"'",s.extraKeys,s.keyMap,function(e){return on(e,!0)});return n&&L(e),n}function cn(e){Et||dn(),F&&e.keyCode==27&&(e.returnValue=!1),Cn&&On()&&(Cn=!1);if(s.onKeyEvent&&s.onKeyEvent(Qt,k(e)))return;var t=D(e,"keyCode");Un(t==16||D(e,"shiftKey"));var r=un(e);window.opera&&(fn=r?t:null,!r&&t==88&&D(e,n?"metaKey":"ctrlKey")&&Sn(""))}function hn(e){Cn&&On();if(s.onKeyEvent&&s.onKeyEvent(Qt,k(e)))return;var t=D(e,"keyCode"),n=D(e,"charCode");if(window.opera&&t==fn){fn=null,L(e);return}if((window.opera&&!e.which||W)&&un(e))return;var r=String.fromCharCode(n==null?t:n);s.electricChars&&yt.electricChars&&s.smartIndent&&!s.readOnly&&yt.electricChars.indexOf(r)>-1&&setTimeout(Jr(function(){rr(St.to.line,"smart")}),75);if(an(e,r))return;Ln()}function pn(e){if(s.onKeyEvent&&s.onKeyEvent(Qt,k(e)))return;D(e,"keyCode")==16&&(xt=null)}function dn(){if(s.readOnly=="nocursor")return;Et||(s.onFocus&&s.onFocus(Qt),Et=!0,y.className.search(/\bCodeMirror-focused\b/)==-1&&(y.className+=" CodeMirror-focused"),Ht||Mn(!0)),kn(),jr()}function vn(){Et&&(s.onBlur&&s.onBlur(Qt),Et=!1,Ut&&Jr(function(){Ut&&(Ut(),Ut=null)})(),y.className=y.className.replace(" CodeMirror-focused","")),clearInterval(gt),setTimeout(function(){Et||(xt=null)},150)}function mn(e,t,n,r,i){if(At)return;if(Vt){var o=[];bt.iter(e.line,t.line+1,function(e){o.push(e.text)}),Vt.addChange(e.line,n.length,o);while(Vt.done.length>s.undoDepth)Vt.done.shift()}wn(e,t,n,r,i)}function gn(e,t){if(!e.length)return;var n=e.pop(),r=[];for(var i=n.length-1;i>=0;i-=1){var s=n[i],o=[],u=s.start+s.added;bt.iter(s.start,u,function(e){o.push(e.text)}),r.push({start:s.start,added:s.old.length,old:o});var a=Jn({line:s.start+s.old.length-1,ch:it(o[o.length-1],s.old[s.old.length-1])});wn({line:s.start,ch:0},{line:u-1,ch:Gt(u-1).text.length},s.old,a,a)}Ot=!0,t.push(r)}function yn(){gn(Vt.done,Vt.undone)}function bn(){gn(Vt.undone,Vt.done)}function wn(e,t,n,r,i){function T(e){return e<=Math.min(t.line,t.line+y)?e:e+y}if(At)return;var o=!1,u=zt.length;s.lineWrapping||bt.iter(e.line,t.line+1,function(e){if(e.text.length==u)return o=!0,!0});if(e.line!=t.line||n.length>1)Bt=!0;var a=t.line-e.line,f=Gt(e.line),l=Gt(t.line);if(e.ch==0&&t.ch==0&&n[n.length-1]==""){var c=[],h=null;e.line?(h=Gt(e.line-1),h.fixMarkEnds(l)):l.fixMarkStarts();for(var p=0,d=n.length-1;p<d;++p)c.push(g.inheritMarks(n[p],h));a&&bt.remove(e.line,a,jt),c.length&&bt.insert(e.line,c)}else if(f==l)if(n.length==1)f.replace(e.ch,t.ch,n[0]);else{l=f.split(t.ch,n[n.length-1]),f.replace(e.ch,null,n[0]),f.fixMarkEnds(l);var c=[];for(var p=1,d=n.length-1;p<d;++p)c.push(g.inheritMarks(n[p],f));c.push(l),bt.insert(e.line+1,c)}else if(n.length==1)f.replace(e.ch,null,n[0]),l.replace(null,t.ch,""),f.append(l),bt.remove(e.line+1,a,jt);else{var c=[];f.replace(e.ch,null,n[0]),l.replace(null,t.ch,n[n.length-1]),f.fixMarkEnds(l);for(var p=1,d=n.length-1;p<d;++p)c.push(g.inheritMarks(n[p],f));a>1&&bt.remove(e.line+1,a-1,jt),bt.insert(e.line+1,c)}if(s.lineWrapping){var v=Math.max(5,z.clientWidth/_r()-3);bt.iter(e.line,e.line+n.length,function(e){if(e.hidden)return;var t=Math.ceil(e.text.length/v)||1;t!=e.height&&Yt(e,t)})}else bt.iter(e.line,e.line+n.length,function(e){var t=e.text;t.length>u&&(zt=t,u=t.length,Wt=null,o=!1)}),o&&(u=0,zt="",Wt=null,bt.iter(0,bt.size,function(e){var t=e.text;t.length>u&&(u=t.length,zt=t)}));var m=[],y=n.length-a-1;for(var p=0,b=wt.length;p<b;++p){var w=wt[p];w<e.line?m.push(w):w>t.line&&m.push(w+y)}var E=e.line+Math.min(n.length,500);Ur(e.line,E),m.push(E),wt=m,Wr(100),_t.push({from:e.line,to:t.line+1,diff:y});var S={from:e,to:t,text:n};if(Dt){for(var x=Dt;x.next;x=x.next);x.next=S}else Dt=S;Wn(r,i,T(St.from.line),T(St.to.line)),z.clientHeight&&(V.style.height=bt.height*Ar()+2*Dr()+"px")}function En(e,t,n){function r(r){if(et(r,t))return r;if(!et(n,r))return i;var s=r.line+e.length-(n.line-t.line)-1,o=r.ch;return r.line==n.line&&(o+=e[e.length-1].length-(n.ch-(n.line==t.line?t.ch:0))),{line:s,ch:o}}t=Jn(t),n?n=Jn(n):n=t,e=ut(e);var i;return xn(e,t,n,function(e){return i=e,{from:r(St.from),to:r(St.to)}}),i}function Sn(e,t){xn(ut(e),St.from,St.to,function(e){return t=="end"?{from:e,to:e}:t=="start"?{from:St.from,to:St.from}:{from:St.from,to:e}})}function xn(e,t,n,r){var i=e.length==1?e[0].length+t.ch:e[e.length-1].length,s=r({line:t.line+e.length-1,ch:i});mn(t,n,e,s.from,s.to)}function Tn(e,t){var n=e.line,r=t.line;if(n==r)return Gt(n).text.slice(e.ch,t.ch);var i=[Gt(n).text.slice(e.ch)];return bt.iter(n+1,r,function(e){i.push(e.text)}),i.push(Gt(r).text.slice(0,t.ch)),i.join("\n")}function Nn(){return Tn(St.from,St.to)}function kn(){if(Cn)return;vt.set(s.pollInterval,function(){Xr(),On(),Et&&kn(),Vr()})}function Ln(){function t(){Xr();var n=On();!n&&!e?(e=!0,vt.set(60,t)):(Cn=!1,kn()),Vr()}var e=!1;Cn=!0,vt.set(20,t)}function On(){if(Ht||!Et||at(A)||s.readOnly)return!1;var e=A.value;if(e==An)return!1;xt=null;var t=0,n=Math.min(An.length,e.length);while(t<n&&An[t]==e[t])++t;return t<An.length?St.from={line:St.from.line,ch:St.from.ch-(An.length-t)}:Lt&&Z(St.from,St.to)&&(St.to={line:St.to.line,ch:Math.min(Gt(St.to.line).text.length,St.to.ch+(e.length-t))}),Sn(e.slice(t),"end"),An=e,!0}function Mn(e){Z(St.from,St.to)?e&&(An=A.value=""):(An="",A.value=Nn(),Y(A))}function _n(){s.readOnly!="nocursor"&&A.focus()}function Dn(){if(!ct.getBoundingClientRect)return;var e=ct.getBoundingClientRect();if(F&&e.top==e.bottom)return;var t=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(e.top<0||e.bottom>t)&&ct.scrollIntoView()}function Pn(){var e=xr(St.inverted?St.from:St.to),t=s.lineWrapping?Math.min(e.x,rt.offsetWidth):e.x;return Hn(t,e.y,t,e.yBot)}function Hn(e,t,n,r){var i=Pr(),o=Dr();t+=o,r+=o,e+=i,n+=i;var u=z.clientHeight,a=z.scrollTop,f=!1,l=!0;t<a?(z.scrollTop=Math.max(0,t),f=!0):r>a+u&&(z.scrollTop=r-u,f=!0);var c=z.clientWidth,h=z.scrollLeft,p=s.fixedGutter?K.clientWidth:0,d=e<p+i+10;return e<h+p||d?(d&&(e=0),z.scrollLeft=Math.max(0,e-10-p),f=!0):n>c+h-3&&(z.scrollLeft=n+10-c,f=!0,n>V.clientWidth&&(l=!1)),f&&s.onScroll&&s.onScroll(Qt),l}function Bn(){var e=Ar(),t=z.scrollTop-Dr(),n=Math.max(0,Math.floor(t/e)),r=Math.ceil((t+z.clientHeight)/e);return{from:x(bt,n),to:x(bt,r)}}function jn(e,t){function p(){Wt=z.clientWidth;var e=pt.firstChild,t=!1;return bt.iter(It,qt,function(n){if(!n.hidden){var r=Math.round(e.offsetHeight/l)||1;n.height!=r&&(Yt(n,r),Bt=t=!0)}e=e.nextSibling}),t&&(V.style.height=bt.height*l+2*Dr()+"px"),t}if(!z.clientWidth){It=qt=Ft=0;return}var n=Bn();if(e!==!0&&e.length==0&&n.from>It&&n.to<qt)return;var r=Math.max(n.from-100,0),i=Math.min(bt.size,n.to+100);It<r&&r-It<20&&(r=It),qt>i&&qt-i<20&&(i=Math.min(bt.size,qt));var o=e===!0?[]:Fn([{from:It,to:qt,domStart:0}],e),u=0;for(var a=0;a<o.length;++a){var f=o[a];f.from<r&&(f.domStart+=r-f.from,f.from=r),f.to>i&&(f.to=i),f.from>=f.to?o.splice(a--,1):u+=f.to-f.from}if(u==i-r&&r==It&&i==qt)return;o.sort(function(e,t){return e.domStart-t.domStart});var l=Ar(),c=K.style.display;pt.style.display="none",In(r,i,o),pt.style.display=K.style.display="";var h=r!=It||i!=qt||Rt!=z.clientHeight+l;h&&(Rt=z.clientHeight+l),It=r,qt=i,Ft=T(bt,r),J.style.top=Ft*l+"px",z.clientHeight&&(V.style.height=bt.height*l+2*Dr()+"px");if(pt.childNodes.length!=qt-It)throw new Error("BAD PATCH! "+JSON.stringify(o)+" size="+(qt-It)+" nodes="+pt.childNodes.length);return s.lineWrapping?p():(Wt==null&&(Wt=br(zt)),Wt>z.clientWidth?(rt.style.width=Wt+"px",V.style.width="",V.style.width=z.scrollWidth+"px"):rt.style.width=V.style.width=""),K.style.display=c,(h||Bt)&&qn()&&s.lineWrapping&&p()&&qn(),Rn(),!t&&s.onUpdate&&s.onUpdate(Qt),!0}function Fn(e,t){for(var n=0,r=t.length||0;n<r;++n){var i=t[n],s=[],o=i.diff||0;for(var u=0,a=e.length;u<a;++u){var f=e[u];i.to<=f.from&&i.diff?s.push({from:f.from+o,to:f.to+o,domStart:f.domStart}):i.to<=f.from||i.from>=f.to?s.push(f):(i.from>f.from&&s.push({from:f.from,to:i.from,domStart:f.domStart}),i.to<f.to&&s.push({from:i.to+o,to:f.to+o,domStart:f.domStart+(i.to-f.from)}))}e=s}return e}function In(e,t,n){if(!n.length)pt.innerHTML="";else{function r(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}var i=0,s=pt.firstChild,o;for(var u=0;u<n.length;++u){var a=n[u];while(a.domStart>i)s=r(s),i++;for(var f=0,l=a.to-a.from;f<l;++f)s=s.nextSibling,i++}while(s)s=r(s)}var c=n.shift(),s=pt.firstChild,f=e,h=document.createElement("div");bt.iter(e,t,function(e){c&&c.to==f&&(c=n.shift());if(!c||c.from>f){if(e.hidden)var t=h.innerHTML="<pre></pre>";else{var t="<pre"+(e.className?' class="'+e.className+'"':"")+">"+e.getHTML(ur)+"</pre>";e.bgClassName&&(t='<div style="position: relative"><pre class="'+e.bgClassName+'" style="position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2"> </pre>'+t+"</div>")}h.innerHTML=t,pt.insertBefore(h.firstChild,s)}else s=s.nextSibling;++f})}function qn(){if(!s.gutter&&!s.lineNumbers)return;var e=J.offsetHeight,t=z.clientHeight;K.style.height=(e-t<2?t:e)+"px";var n=[],r=It,i;bt.iter(It,Math.max(qt,It+1),function(e){if(e.hidden)n.push("<pre></pre>");else{var t=e.gutterMarker,o=s.lineNumbers?r+s.firstLineNumber:null;t&&t.text?o=t.text.replace("%N%",o!=null?o:""):o==null&&(o=" "),n.push(t&&t.style?'<pre class="'+t.style+'">':"<pre>",o);for(var u=1;u<e.height;++u)n.push("<br/> ");n.push("</pre>"),t||(i=r)}++r}),K.style.display="none",nt.innerHTML=n.join("");if(i!=null){var o=nt.childNodes[i-It],u=String(bt.size).length,a=G(o),f="";while(a.length+f.length<u)f+=" ";f&&o.insertBefore(document.createTextNode(f),o.firstChild)}K.style.display="";var l=Math.abs((parseInt(rt.style.marginLeft)||0)-K.offsetWidth)>2;return rt.style.marginLeft=K.offsetWidth+"px",Bt=!1,l}function Rn(){var e=Z(St.from,St.to),t=xr(St.from,!0),n=e?t:xr(St.to,!0),r=St.inverted?t:n,i=Ar(),o=Q(y),u=Q(pt);C.style.top=Math.max(0,Math.min(z.offsetHeight,r.y+u.top-o.top))+"px",C.style.left=Math.max(0,Math.min(z.offsetWidth,r.x+u.left-o.left))+"px";if(e)ct.style.top=r.y+"px",ct.style.left=(s.lineWrapping?Math.min(r.x,rt.offsetWidth):r.x)+"px",ct.style.display="",ht.style.display="none";else{var a=t.y==n.y,f="",l=rt.clientWidth||rt.offsetWidth,c=rt.clientHeight||rt.offsetHeight;function h(e,t,n,r){var i=q?"width: "+(n?l-n-e:l)+"px":"right: "+n+"px";f+='<div class="CodeMirror-selected" style="position: absolute; left: '+e+"px; top: "+t+"px; "+i+"; height: "+r+'px"></div>'}if(St.from.ch&&t.y>=0){var p=a?l-n.x:0;h(t.x,t.y,p,i)}var d=Math.max(0,t.y+(St.from.ch?i:0)),v=Math.min(n.y,c)-d;v>.2*i&&h(0,d,0,v),(!a||!St.from.ch)&&n.y<c-.5*i&&h(0,n.y,l-n.x,i),ht.innerHTML=f,ct.style.display="none",ht.style.display=""}}function Un(e){e?xt=xt||(St.inverted?St.to:St.from):xt=null}function zn(e,t){var n=xt&&Jn(xt);n&&(et(n,e)?e=n:et(t,n)&&(t=n)),Wn(e,t),Mt=!0}function Wn(e,t,n,r){Yn=null,n==null&&(n=St.from.line,r=St.to.line);if(Z(St.from,e)&&Z(St.to,t))return;if(et(t,e)){var i=t;t=e,e=i}if(e.line!=n){var o=Xn(e,n,St.from.ch);o?e=o:gr(e.line,!1)}t.line!=r&&(t=Xn(t,r,St.to.ch)),Z(e,t)?St.inverted=!1:Z(e,St.to)?St.inverted=!1:Z(t,St.from)&&(St.inverted=!0);if(s.autoClearEmptyLines&&Z(St.from,St.to)){var u=St.inverted?e:t;if(u.line!=St.from.line&&St.from.line<bt.size){var a=Gt(St.from.line);/^\s+$/.test(a.text)&&setTimeout(Jr(function(){if(a.parent&&/^\s+$/.test(a.text)){var e=S(a);En("",{line:e,ch:0},{line:e,ch:a.text.length})}},10))}}St.from=e,St.to=t,Pt=!0}function Xn(e,t,n){function r(t){var r=e.line+t,i=t==1?bt.size:-1;while(r!=i){var o=Gt(r);if(!o.hidden){var u=e.ch;if(s||u>n||u>o.text.length)u=o.text.length;return{line:r,ch:u}}r+=t}}var i=Gt(e.line),s=e.ch==i.text.length&&e.ch!=n;return i.hidden?e.line>=t?r(1)||r(-1):r(-1)||r(1):e}function Vn(e,t,n){var r=Jn({line:e,ch:t||0});(n?zn:Wn)(r,r)}function $n(e){return Math.max(0,Math.min(e,bt.size-1))}function Jn(e){if(e.line<0)return{line:0,ch:0};if(e.line>=bt.size)return{line:bt.size-1,ch:Gt(bt.size-1).text.length};var t=e.ch,n=Gt(e.line).text.length;return t==null||t>n?{line:e.line,ch:n}:t<0?{line:e.line,ch:0}:e}function Kn(e,t){function o(){for(var t=r+e,n=e<0?-1:bt.size;t!=n;t+=e){var i=Gt(t);if(!i.hidden)return r=t,s=i,!0}}function u(t){if(i==(e<0?0:s.text.length)){if(!!t||!o())return!1;i=e<0?s.text.length:0}else i+=e;return!0}var n=St.inverted?St.from:St.to,r=n.line,i=n.ch,s=Gt(r);if(t=="char")u();else if(t=="column")u(!0);else if(t=="word"){var a=!1;for(;;){if(e<0&&!u())break;if(ot(s.text.charAt(i)))a=!0;else if(a){e<0&&(e=1,u());break}if(e>0&&!u())break}}return{line:r,ch:i}}function Qn(e,t){var n=e<0?St.from:St.to;if(xt||Z(St.from,St.to))n=Kn(e,t);Vn(n.line,n.ch,!0)}function Gn(e,t){Z(St.from,St.to)?e<0?En("",Kn(e,t),St.to):En("",St.from,Kn(e,t)):En("",St.from,St.to),Mt=!0}function Zn(e,t){var n=0,r=xr(St.inverted?St.from:St.to,!0);Yn!=null&&(r.x=Yn),t=="page"?n=Math.min(z.clientHeight,window.innerHeight||document.documentElement.clientHeight):t=="line"&&(n=Ar());var i=Tr(r.x,r.y+n*e+2);t=="page"&&(z.scrollTop+=xr(i,!0).y-r.y),Vn(i.line,i.ch,!0),Yn=r.x}function er(e){var t=Gt(e.line).text,n=e.ch,r=e.ch;while(n>0&&ot(t.charAt(n-1)))--n;while(r<t.length&&ot(t.charAt(r)))++r;zn({line:e.line,ch:n},{line:e.line,ch:r})}function tr(e){zn({line:e,ch:0},Jn({line:e+1,ch:0}))}function nr(e){if(Z(St.from,St.to))return rr(St.from.line,e);var t=St.to.line-(St.to.ch?0:1);for(var n=St.from.line;n<=t;++n)rr(n,e)}function rr(e,t){t||(t="add");if(t=="smart")if(!yt.indent)t="prev";else var n=Rr(e);var r=Gt(e),i=r.indentation(s.tabSize),o=r.text.match(/^\s*/)[0],u;t=="prev"?e?u=Gt(e-1).indentation(s.tabSize):u=0:t=="smart"?u=yt.indent(n,r.text.slice(o.length),r.text):t=="add"?u=i+s.indentUnit:t=="subtract"&&(u=i-s.indentUnit),u=Math.max(0,u);var a=u-i;if(!a){if(St.from.line!=e&&St.to.line!=e)return;var f=o}else{var f="",l=0;if(s.indentWithTabs)for(var c=Math.floor(u/s.tabSize);c;--c)l+=s.tabSize,f+=" ";while(l<u)++l,f+=" "}En(f,{line:e,ch:0},{line:e,ch:o.length})}function ir(){yt=e.getMode(s,s.mode),bt.iter(0,bt.size,function(e){e.stateAfter=null}),wt=[0],Wr()}function sr(){var e=s.gutter||s.lineNumbers;K.style.display=e?"":"none",e?Bt=!0:pt.parentNode.style.marginLeft=0}function or(e,t){if(s.lineWrapping){y.className+=" CodeMirror-wrap";var n=z.clientWidth/_r()-3;bt.iter(0,bt.size,function(e){if(e.hidden)return;var t=Math.ceil(e.text.length/n)||1;t!=1&&Yt(e,t)}),rt.style.width=V.style.width=""}else y.className=y.className.replace(" CodeMirror-wrap",""),Wt=null,zt="",bt.iter(0,bt.size,function(e){e.height!=1&&!e.hidden&&Yt(e,1),e.text.length>zt.length&&(zt=e.text)});_t.push({from:0,to:bt.size})}function ur(e){var t=s.tabSize-e%s.tabSize,n=Xt[t];if(n)return n;for(var r='<span class="cm-tab">',i=0;i<t;++i)r+=" ";return Xt[t]={html:r+"</span>",width:t}}function ar(){z.className=z.className.replace(/\s*cm-s-\S+/g,"")+s.theme.replace(/(^|\s)\s*/g," cm-s-")}function fr(){this.set=[]}function lr(e,t,n){function i(e,t,n,i){Gt(e).addMark(new v(t,n,i,r))}e=Jn(e),t=Jn(t);var r=new fr;if(!et(e,t))return r;if(e.line==t.line)i(e.line,e.ch,t.ch,n);else{i(e.line,e.ch,null,n);for(var s=e.line+1,o=t.line;s<o;++s)i(s,null,null,n);i(t.line,null,t.ch,n)}return _t.push({from:e.line,to:t.line+1}),r}function cr(e){e=Jn(e);var t=new m(e.ch);return Gt(e.line).addMark(t),t}function hr(e){e=Jn(e);var t=[],n=Gt(e.line).marked;if(!n)return t;for(var r=0,i=n.length;r<i;++r){var s=n[r];(s.from==null||s.from<=e.ch)&&(s.to==null||s.to>=e.ch)&&t.push(s.marker||s)}return t}function pr(e,t,n){return typeof e=="number"&&(e=Gt($n(e))),e.gutterMarker={text:t,style:n},Bt=!0,e}function dr(e){typeof e=="number"&&(e=Gt($n(e))),e.gutterMarker=null,Bt=!0}function vr(e,t){var n=e,r=e;return typeof e=="number"?r=Gt($n(e)):n=S(e),n==null?null:t(r,n)?(_t.push({from:n,to:n+1}),r):null}function mr(e,t,n){return vr(e,function(e){if(e.className!=t||e.bgClassName!=n)return e.className=t,e.bgClassName=n,!0})}function gr(e,t){return vr(e,function(e,n){if(e.hidden!=t){e.hidden=t,Yt(e,t?0:1);var r=St.from.line,i=St.to.line;if(t&&(r==n||i==n)){var s=r==n?Xn({line:r,ch:0},r,0):St.from,o=i==n?Xn({line:i,ch:0},i,0):St.to;if(!o)return;Wn(s,o)}return Bt=!0}})}function yr(e){if(typeof e=="number"){if(!Kt(e))return null;var t=e;e=Gt(e);if(!e)return null}else{var t=S(e);if(t==null)return null}var n=e.gutterMarker;return{line:t,handle:e,text:e.text,markerText:n&&n.text,markerClass:n&&n.style,lineClass:e.className,bgClass:e.bgClassName}}function br(e){return lt.innerHTML="<pre><span>x</span></pre>",lt.firstChild.firstChild.firstChild.nodeValue=e,lt.firstChild.firstChild.offsetWidth||10}function wr(e,t){function i(e){return Sr(n,e).left}if(t<=0)return 0;var n=Gt(e),r=n.text,s=0,o=0,u=r.length,a,f=Math.min(u,Math.ceil(t/_r()));for(;;){var l=i(f);if(!(l<=t&&f<u)){a=l,u=f;break}f=Math.min(u,Math.ceil(f*1.2))}if(t>a)return u;f=Math.floor(u*.8),l=i(f),l<t&&(s=f,o=l);for(;;){if(u-s<=1)return a-t>t-o?s:u;var c=Math.ceil((s+u)/2),h=i(c);h>t?(u=c,a=h):(s=c,o=h)}}function Sr(e,t){if(t==0)return{top:0,left:0};var n=s.lineWrapping&&t<e.text.length&&$.test(e.text.slice(t-1,t+1));lt.innerHTML="<pre>"+e.getHTML(ur,t,Er,n)+"</pre>";var r=document.getElementById(Er),i=r.offsetTop,o=r.offsetLeft;if(F&&i==0&&o==0){var u=document.createElement("span");u.innerHTML="x",r.parentNode.insertBefore(u,r.nextSibling),i=u.offsetTop}return{top:i,left:o}}function xr(e,t){var n,r=Ar(),i=r*(T(bt,e.line)-(t?Ft:0));if(e.ch==0)n=0;else{var o=Sr(Gt(e.line),e.ch);n=o.left,s.lineWrapping&&(i+=Math.max(0,o.top))}return{x:n,y:i,yBot:i+r}}function Tr(e,t){function c(e){var t=Sr(u,e);if(f){var r=Math.round(t.top/n);return Math.max(0,t.left+(r-l)*z.clientWidth)}return t.left}t<0&&(t=0);var n=Ar(),r=_r(),i=Ft+Math.floor(t/n),o=x(bt,i);if(o>=bt.size)return{line:bt.size-1,ch:Gt(bt.size-1).text.length};var u=Gt(o),a=u.text,f=s.lineWrapping,l=f?i-T(bt,o):0;if(e<=0&&l==0)return{line:o,ch:0};var h=0,p=0,d=a.length,v,m=Math.min(d,Math.ceil((e+l*z.clientWidth*.9)/r));for(;;){var g=c(m);if(!(g<=e&&m<d)){v=g,d=m;break}m=Math.min(d,Math.ceil(m*1.2))}if(e>v)return{line:o,ch:d};m=Math.floor(d*.8),g=c(m),g<e&&(h=m,p=g);for(;;){if(d-h<=1)return{line:o,ch:v-e>e-p?h:d};var y=Math.ceil((h+d)/2),b=c(y);b>e?(d=y,v=b):(h=y,p=b)}}function Nr(e){var t=xr(e,!0),n=Q(rt);return{x:n.left+t.x,y:n.top+t.y,yBot:n.top+t.yBot}}function Ar(){if(Lr==null){Lr="<pre>";for(var e=0;e<49;++e)Lr+="x<br/>";Lr+="x</pre>"}var t=pt.clientHeight;return t==kr?Cr:(kr=t,lt.innerHTML=Lr,Cr=lt.firstChild.offsetHeight/50||1,lt.innerHTML="",Cr)}function _r(){return z.clientWidth==Mr?Or:(Mr=z.clientWidth,Or=br("x"))}function Dr(){return rt.offsetTop}function Pr(){return rt.offsetLeft}function Hr(e,t){var n=Q(z,!0),r,i;try{r=e.clientX,i=e.clientY}catch(e){return null}if(!t&&(r-n.left>z.clientWidth||i-n.top>z.clientHeight))return null;var s=Q(rt,!0);return Tr(r-s.left,i-s.top)}function Br(e){function s(){var e=ut(A.value).join("\n");e!=i&&Jr(Sn)(e,"end"),C.style.position="relative",A.style.cssText=r,I&&(z.scrollTop=n),Ht=!1,Mn(!0),kn()}var t=Hr(e),n=z.scrollTop;if(!t||window.opera)return;(Z(St.from,St.to)||et(t,St.from)||!et(t,St.to))&&Jr(Vn)(t.line,t.ch);var r=A.style.cssText;C.style.position="absolute",A.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: white; "+"border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",Ht=!0;var i=A.value=Nn();_n(),Y(A);if(j){O(e);var o=P(window,"mouseup",function(){o(),setTimeout(s,20)},!0)}else setTimeout(s,50)}function jr(){clearInterval(gt);var e=!0;ct.style.visibility="",gt=setInterval(function(){ct.style.visibility=(e=!e)?"":"hidden"},650)}function Ir(e){function v(e,t,n){if(!e.text)return;var r=e.styles,i=o?0:e.text.length-1,s;for(var a=o?0:r.length-2,f=o?r.length:-2;a!=f;a+=2*u){var l=r[a];if(r[a+1]!=null&&r[a+1]!=h){i+=u*l.length;continue}for(var c=o?0:l.length-1,v=o?l.length:-1;c!=v;c+=u,i+=u)if(i>=t&&i<n&&d.test(s=l.charAt(c))){var m=Fr[s];if(m.charAt(1)==">"==o)p.push(s);else{if(p.pop()!=m.charAt(0))return{pos:i,match:!1};if(!p.length)return{pos:i,match:!0}}}}}var t=St.inverted?St.from:St.to,n=Gt(t.line),r=t.ch-1,i=r>=0&&Fr[n.text.charAt(r)]||Fr[n.text.charAt(++r)];if(!i)return;var s=i.charAt(0),o=i.charAt(1)==">",u=o?1:-1,a=n.styles;for(var f=r+1,l=0,c=a.length;l<c;l+=2)if((f-=a[l].length)<=0){var h=a[l+1];break}var p=[n.text.charAt(r)],d=/[(){}[\]]/;for(var l=t.line,c=o?Math.min(l+100,bt.size):Math.max(-1,l-100);l!=c;l+=u){var n=Gt(l),m=l==t.line,g=v(n,m&&o?r+1:0,m&&!o?r:n.text.length);if(g)break}g||(g={pos:null,match:!1});var h=g.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",y=lr({line:t.line,ch:r},{line:t.line,ch:r+1},h),b=g.pos!=null&&lr({line:l,ch:g.pos},{line:l,ch:g.pos+1},h),w=Jr(function(){y.clear(),b&&b.clear()});e?setTimeout(w,800):Ut=w}function qr(e){var t,n;for(var r=e,i=e-40;r>i;--r){if(r==0)return 0;var o=Gt(r-1);if(o.stateAfter)return r;var u=o.indentation(s.tabSize);if(n==null||t>u)n=r-1,t=u}return n}function Rr(e){var t=qr(e),n=t&&Gt(t-1).stateAfter;return n?n=h(yt,n):n=p(yt),bt.iter(t,e,function(e){e.highlight(yt,n,s.tabSize),e.stateAfter=h(yt,n)}),t<e&&_t.push({from:t,to:e}),e<bt.size&&!Gt(e).stateAfter&&wt.push(e),n}function Ur(e,t){var n=Rr(e);bt.iter(e,t,function(e){e.highlight(yt,n,s.tabSize),e.stateAfter=h(yt,n)})}function zr(){var e=+(new Date)+s.workTime,t=wt.length;while(wt.length){if(!Gt(It).stateAfter)var n=It;else var n=wt.pop();if(n>=bt.size)continue;var r=qr(n),i=r&&Gt(r-1).stateAfter;i?i=h(yt,i):i=p(yt);var o=0,u=yt.compareStates,a=!1,f=r,l=!1;bt.iter(f,bt.size,function(t){var r=t.stateAfter;if(+(new Date)>e)return wt.push(f),Wr(s.workDelay),a&&_t.push({from:n,to:f+1}),l=!0;var c=t.highlight(yt,i,s.tabSize);c&&(a=!0),t.stateAfter=h(yt,i);var p=null;if(u){var d=r&&u(r,i);d!=B&&(p=!!d)}p==null&&(c!==!1||!r?o=0:++o>3&&(!yt.indent||yt.indent(r,"")==yt.indent(i,""))&&(p=!0));if(p)return!0;++f});if(l)return;a&&_t.push({from:n,to:f+1})}t&&s.onHighlightComplete&&s.onHighlightComplete(Qt)}function Wr(e){if(!wt.length)return;mt.set(e,Jr(zr))}function Xr(){Ot=Mt=Dt=null,_t=[],Pt=!1,jt=[]}function Vr(){var e=!1,t;Pt&&(e=!Pn()),_t.length?t=jn(_t,!0):(Pt&&Rn(),Bt&&qn()),e&&Pn(),Pt&&(Dn(),jr()),Et&&!Ht&&(Ot===!0||Ot!==!1&&Pt)&&Mn(Mt),Pt&&s.matchBrackets&&setTimeout(Jr(function(){Ut&&(Ut(),Ut=null),Z(St.from,St.to)&&Ir(!1)}),20);var n=Dt,r=jt;Pt&&s.onCursorActivity&&s.onCursorActivity(Qt),n&&s.onChange&&Qt&&s.onChange(Qt,n);for(var i=0;i<r.length;++i)r[i](Qt);t&&s.onUpdate&&s.onUpdate(Qt)}function Jr(e){return function(){$r++||Xr();try{var t=e.apply(this,arguments)}finally{--$r||Vr()}return t}}function Kr(e){Vt.startCompound();try{return e()}finally{Vt.endCompound()}}var s={},a=e.defaults;for(var d in a)a.hasOwnProperty(d)&&(s[d]=(i&&i.hasOwnProperty(d)?i:a)[d]);var y=document.createElement("div");y.className="CodeMirror"+(s.lineWrapping?" CodeMirror-wrap":""),y.innerHTML='<div style="overflow: hidden; position: relative; width: 3px; height: 0px;"><textarea style="position: absolute; padding: 0; width: 1px; height: 1em" wrap="off" autocorrect="off" autocapitalize="off"></textarea></div><div class="CodeMirror-scroll" tabindex="-1"><div style="position: relative"><div style="position: relative"><div class="CodeMirror-gutter"><div class="CodeMirror-gutter-text"></div></div><div class="CodeMirror-lines"><div style="position: relative; z-index: 0"><div style="position: absolute; width: 100%; height: 0; overflow: hidden; visibility: hidden;"></div><pre class="CodeMirror-cursor"> </pre><div style="position: relative; z-index: -1"></div><div></div></div></div></div></div></div>',r.appendChild?r.appendChild(y):r(y);var C=y.firstChild,A=C.firstChild,z=y.lastChild,V=z.firstChild,J=V.firstChild,K=J.firstChild,nt=K.firstChild,rt=K.nextSibling.firstChild,lt=rt.firstChild,ct=lt.nextSibling,ht=ct.nextSibling,pt=ht.nextSibling;ar(),t&&(A.style.width="0px"),R||(rt.draggable=!0),rt.style.outline="none",s.tabindex!=null&&(A.tabIndex=s.tabindex),s.autofocus&&_n(),!s.gutter&&!s.lineNumbers&&(K.style.display="none"),W&&(C.style.height="1px",C.style.position="absolute");try{br("x")}catch(dt){throw dt.message.match(/runtime/i)&&(dt=new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)")),dt}var vt=new H,mt=new H,gt,yt,bt=new w([new b([new g("")])]),wt,Et;ir();var St={from:{line:0,ch:0},to:{line:0,ch:0},inverted:!1},xt,Tt,Nt,Ct=0,kt,Lt=!1,At=!1,Ot,Mt,_t,Dt,Pt,Ht,Bt,jt,Ft=0,It=0,qt=0,Rt=0,Ut,zt="",Wt,Xt={};Jr(function(){Zt(s.value||""),Ot=!1})();var Vt=new N;P(z,"mousedown",Jr(tn)),P(z,"dblclick",Jr(nn)),P(rt,"selectstart",L),j||P(z,"contextmenu",Br),P(z,"scroll",function(){Ct=z.scrollTop,jn([]),s.fixedGutter&&(K.style.left=z.scrollLeft+"px"),s.onScroll&&s.onScroll(Qt)}),P(window,"resize",function(){jn(!0)}),P(A,"keyup",Jr(pn)),P(A,"input",Ln),P(A,"keydown",Jr(cn)),P(A,"keypress",Jr(hn)),P(A,"focus",dn),P(A,"blur",vn);if(s.dragDrop){P(rt,"dragstart",sn);function $t(e){if(s.onDragEvent&&s.onDragEvent(Qt,k(e)))return;O(e)}P(z,"dragenter",$t),P(z,"dragover",$t),P(z,"drop",Jr(rn))}P(z,"paste",function(){_n(),Ln()}),P(A,"paste",Ln),P(A,"cut",Jr(function(){s.readOnly||Sn("")})),W&&P(V,"mouseup",function(){document.activeElement==A&&A.blur(),_n()});var Jt;try{Jt=document.activeElement==A}catch(dt){}Jt||s.autofocus?setTimeout(dn,20):vn();var Qt=y.CodeMirror={getValue:en,setValue:Jr(Zt),getSelection:Nn,replaceSelection:Jr(Sn),focus:function(){window.focus(),_n(),dn(),Ln()},setOption:function(e,t){var n=s[e];s[e]=t,e=="mode"||e=="indentUnit"?ir():e=="readOnly"&&t=="nocursor"?(vn(),A.blur()):e=="readOnly"&&!t?Mn(!0):e=="theme"?ar():e=="lineWrapping"&&n!=t?Jr(or)():e=="tabSize"&&jn(!0);if(e=="lineNumbers"||e=="gutter"||e=="firstLineNumber"||e=="theme")sr(),jn(!0)},getOption:function(e){return s[e]},undo:Jr(yn),redo:Jr(bn),indentLine:Jr(function(e,t){typeof t!="string"&&(t==null?t=s.smartIndent?"smart":"prev":t=t?"add":"subtract"),Kt(e)&&rr(e,t)}),indentSelection:Jr(nr),historySize:function(){return{undo:Vt.done.length,redo:Vt.undone.length}},clearHistory:function(){Vt=new N},matchBrackets:Jr(function(){Ir(!0)}),getTokenAt:Jr(function(e){return e=Jn(e),Gt(e.line).getTokenAt(yt,Rr(e.line),e.ch)}),getStateAfter:function(e){return e=$n(e==null?bt.size-1:e),Rr(e+1)},cursorCoords:function(e,t){return e==null&&(e=St.inverted),this.charCoords(e?St.from:St.to,t)},charCoords:function(e,t){return e=Jn(e),t=="local"?xr(e,!1):t=="div"?xr(e,!0):Nr(e)},coordsChar:function(e){var t=Q(rt);return Tr(e.x-t.left,e.y-t.top)},markText:Jr(lr),setBookmark:cr,findMarksAt:hr,setMarker:Jr(pr),clearMarker:Jr(dr),setLineClass:Jr(mr),hideLine:Jr(function(e){return gr(e,!0)}),showLine:Jr(function(e){return gr(e,!1)}),onDeleteLine:function(e,t){if(typeof e=="number"){if(!Kt(e))return null;e=Gt(e)}return(e.handlers||(e.handlers=[])).push(t),e},lineInfo:yr,addWidget:function(e,t,n,r,i){e=xr(Jn(e));var s=e.yBot,o=e.x;t.style.position="absolute",V.appendChild(t);if(r=="over")s=e.y;else if(r=="near"){var u=Math.max(z.offsetHeight,bt.height*Ar()),a=Math.max(V.clientWidth,rt.clientWidth)-Pr();e.yBot+t.offsetHeight>u&&e.y>t.offsetHeight&&(s=e.y-t.offsetHeight),o+t.offsetWidth>a&&(o=a-t.offsetWidth)}t.style.top=s+Dr()+"px",t.style.left=t.style.right="",i=="right"?(o=V.clientWidth-t.offsetWidth,t.style.right="0px"):(i=="left"?o=0:i=="middle"&&(o=(V.clientWidth-t.offsetWidth)/2),t.style.left=o+Pr()+"px"),n&&Hn(o,s,o+t.offsetWidth,s+t.offsetHeight)},lineCount:function(){return bt.size},clipPos:Jn,getCursor:function(e){return e==null&&(e=St.inverted),tt(e?St.from:St.to)},somethingSelected:function(){return!Z(St.from,St.to)},setCursor:Jr(function(e,t,n){t==null&&typeof e.line=="number"?Vn(e.line,e.ch,n):Vn(e,t,n)}),setSelection:Jr(function(e,t,n){(n?zn:Wn)(Jn(e),Jn(t||e))}),getLine:function(e){if(Kt(e))return Gt(e).text},getLineHandle:function(e){if(Kt(e))return Gt(e)},setLine:Jr(function(e,t){Kt(e)&&En(t,{line:e,ch:0},{line:e,ch:Gt(e).text.length})}),removeLine:Jr(function(e){Kt(e)&&En("",{line:e,ch:0},Jn({line:e+1,ch:0}))}),replaceRange:Jr(En),getRange:function(e,t){return Tn(Jn(e),Jn(t))},triggerOnKeyDown:Jr(cn),execCommand:function(e){return u[e](Qt)},moveH:Jr(Qn),deleteH:Jr(Gn),moveV:Jr(Zn),toggleOverwrite:function(){Lt?(Lt=!1,ct.className=ct.className.replace(" CodeMirror-overwrite","")):(Lt=!0,ct.className+=" CodeMirror-overwrite")},posFromIndex:function(e){var t=0,n;return bt.iter(0,bt.size,function(r){var i=r.text.length+1;if(i>e)return n=e,!0;e-=i,++t}),Jn({line:t,ch:n})},indexFromPos:function(e){if(e.line<0||e.ch<0)return 0;var t=e.ch;return bt.iter(0,e.line,function(e){t+=e.text.length+1}),t},scrollTo:function(e,t){e!=null&&(z.scrollLeft=e),t!=null&&(z.scrollTop=t),jn([])},operation:function(e){return Jr(e)()},compoundChange:function(e){return Kr(e)},refresh:function(){jn(!0),z.scrollHeight>Ct&&(z.scrollTop=Ct)},getInputField:function(){return A},getWrapperElement:function(){return y},getScrollerElement:function(){return z},getGutterElement:function(){return K}},fn=null,ln,Cn=!1,An="",Yn=null;fr.prototype.clear=Jr(function(){var e=Infinity,t=-Infinity;for(var n=0,r=this.set.length;n<r;++n){var i=this.set[n],s=i.marked;if(!s||!i.parent)continue;var o=S(i);e=Math.min(e,o),t=Math.max(t,o);for(var u=0;u<s.length;++u)s[u].marker==this&&s.splice(u--,1)}e!=Infinity&&_t.push({from:e,to:t+1})}),fr.prototype.find=function(){var e,t;for(var n=0,r=this.set.length;n<r;++n){var i=this.set[n],s=i.marked;for(var o=0;o<s.length;++o){var u=s[o];if(u.marker==this)if(u.from!=null||u.to!=null){var a=S(i);a!=null&&(u.from!=null&&(e={line:a,ch:u.from}),u.to!=null&&(t={line:a,ch:u.to}))}}}return{from:e,to:t}};var Er="CodeMirror-temp-"+Math.floor(Math.random()*16777215).toString(16),Cr,kr,Lr,Or,Mr=0,Fr={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},$r=0;for(var Qr in o)o.propertyIsEnumerable(Qr)&&!Qt.propertyIsEnumerable(Qr)&&(Qt[Qr]=o[Qr]);return Qt}function f(e){return typeof e=="string"?a[e]:e}function l(e,t,n,r,i){function s(t){t=f(t);var n=t[e];if(n!=null&&r(n))return!0;if(t.nofallthrough)return i&&i(),!0;var o=t.fallthrough;if(o==null)return!1;if(Object.prototype.toString.call(o)!="[object Array]")return s(o);for(var u=0,a=o.length;u<a;++u)if(s(o[u]))return!0;return!1}return t&&s(t)?!0:s(n)}function c(e){var t=ft[D(e,"keyCode")];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function h(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function p(e,t,n){return e.startState?e.startState(t,n):!0}function d(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8}function v(e,t,n,r){this.from=e,this.to=t,this.style=n,this.marker=r}function m(e){this.from=e,this.to=e,this.line=null}function g(e,t){this.styles=t||[e,null],this.text=e,this.height=1,this.marked=this.gutterMarker=this.className=this.bgClassName=this.handlers=null,this.stateAfter=this.parent=this.hidden=null}function y(e,t,n,r){for(var i=0,s=0,o=0;s<t;i+=2){var u=n[i],a=s+u.length;o==0?(a>e&&r.push(u.slice(e-s,Math.min(u.length,t-s)),n[i+1]),a>=e&&(o=1)):o==1&&(a>t?r.push(u.slice(0,t-s),n[i+1]):r.push(u,n[i+1])),s=a}}function b(e){this.lines=e,this.parent=null;for(var t=0,n=e.length,r=0;t<n;++t)e[t].parent=this,r+=e[t].height;this.height=r}function w(e){this.children=e;var t=0,n=0;for(var r=0,i=e.length;r<i;++r){var s=e[r];t+=s.chunkSize(),n+=s.height,s.parent=this}this.size=t,this.height=n,this.parent=null}function E(e,t){while(!e.lines)for(var n=0;;++n){var r=e.children[n],i=r.chunkSize();if(t<i){e=r;break}t-=i}return e.lines[t]}function S(e){if(e.parent==null)return null;var t=e.parent,n=st(t.lines,e);for(var r=t.parent;r;t=r,r=r.parent)for(var i=0,s=r.children.length;;++i){if(r.children[i]==t)break;n+=r.children[i].chunkSize()}return n}function x(e,t){var n=0;e:do{for(var r=0,i=e.children.length;r<i;++r){var s=e.children[r],o=s.height;if(t<o){e=s;continue e}t-=o,n+=s.chunkSize()}return n}while(!e.lines);for(var r=0,i=e.lines.length;r<i;++r){var u=e.lines[r],a=u.height;if(t<a)break;t-=a}return n+r}function T(e,t){var n=0;e:do{for(var r=0,i=e.children.length;r<i;++r){var s=e.children[r],o=s.chunkSize();if(t<o){e=s;continue e}t-=o,n+=s.height}return n}while(!e.lines);for(var r=0;r<t;++r)n+=e.lines[r].height;return n}function N(){this.time=0,this.done=[],this.undone=[],this.compound=0,this.closed=!1}function C(){O(this)}function k(e){return e.stop||(e.stop=C),e}function L(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function A(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function O(e){L(e),A(e)}function M(e){return e.target||e.srcElement}function _(e){if(e.which)return e.which;if(e.button&1)return 1;if(e.button&2)return 3;if(e.button&4)return 2}function D(e,t){var n=e.override&&e.override.hasOwnProperty(t);return n?e.override[t]:e[t]}function P(e,t,n,r){if(typeof e.addEventListener=="function"){e.addEventListener(t,n,!1);if(r)return function(){e.removeEventListener(t,n,!1)}}else{var i=function(e){n(e||window.event)};e.attachEvent("on"+t,i);if(r)return function(){e.detachEvent("on"+t,i)}}}function H(){this.id=null}function J(e,t,n){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var r=0,i=0;r<t;++r)e.charAt(r)==" "?i+=n-i%n:++i;return i}function K(e){return e.currentStyle?e.currentStyle:window.getComputedStyle(e,null)}function Q(e,t){var n=e.ownerDocument.body,r=0,i=0,s=!1;for(var o=e;o;o=o.offsetParent){var u=o.offsetLeft,a=o.offsetTop;o==n?(r+=Math.abs(u),i+=Math.abs(a)):(r+=u,i+=a),t&&K(o).position=="fixed"&&(s=!0)}var f=t&&!s?null:n;for(var o=e.parentNode;o!=f;o=o.parentNode)o.scrollLeft!=null&&(r-=o.scrollLeft,i-=o.scrollTop);return{left:r,top:i}}function G(e){return e.textContent||e.innerText||e.nodeValue||""}function Y(e){t?(e.selectionStart=0,e.selectionEnd=e.value.length):e.select()}function Z(e,t){return e.line==t.line&&e.ch==t.ch}function et(e,t){return e.line<t.line||e.line==t.line&&e.ch<t.ch}function tt(e){return{line:e.line,ch:e.ch}}function rt(e){return nt.textContent=e,nt.innerHTML}function it(e,t){if(!t)return 0;if(!e)return t.length;for(var n=e.length,r=t.length;n>=0&&r>=0;--n,--r)if(e.charAt(n)!=t.charAt(r))break;return r+1}function st(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;++n)if(e[n]==t)return n;return-1}function ot(e){return/\w/.test(e)||e.toUpperCase()!=e.toLowerCase()}e.defaults={value:"",mode:null,theme:"default",indentUnit:2,indentWithTabs:!1,smartIndent:!0,tabSize:4,keyMap:"default",extraKeys:null,electricChars:!0,autoClearEmptyLines:!1,onKeyEvent:null,onDragEvent:null,lineWrapping:!1,lineNumbers:!1,gutter:!1,fixedGutter:!1,firstLineNumber:1,readOnly:!1,dragDrop:!0,onChange:null,onCursorActivity:null,onGutterClick:null,onHighlightComplete:null,onUpdate:null,onFocus:null,onBlur:null,onScroll:null,matchBrackets:!1,workTime:100,workDelay:200,pollInterval:100,undoDepth:40,tabindex:null,autofocus:null};var t=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),n=t||/Mac/.test(navigator.platform),r=/Win/.test(navigator.platform),i=e.modes={},s=e.mimeModes={};e.defineMode=function(t,n){!e.defaults.mode&&t!="null"&&(e.defaults.mode=t);if(arguments.length>2){n.dependencies=[];for(var r=2;r<arguments.length;++r)n.dependencies.push(arguments[r])}i[t]=n},e.defineMIME=function(e,t){s[e]=t},e.resolveMode=function(t){if(typeof t=="string"&&s.hasOwnProperty(t))t=s[t];else if(typeof t=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return typeof t=="string"?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=i[n.name];return r?r(t,n):e.getMode(t,"text/plain")},e.listModes=function(){var e=[];for(var t in i)i.propertyIsEnumerable(t)&&e.push(t);return e},e.listMIMEs=function(){var e=[];for(var t in s)s.propertyIsEnumerable(t)&&e.push({mime:t,mode:s[t]});return e};var o=e.extensions={};e.defineExtension=function(e,t){o[e]=t};var u=e.commands={selectAll:function(e){e.setSelection({line:0,ch:0},{line:e.lineCount()-1})},killLine:function(e){var t=e.getCursor(!0),n=e.getCursor(!1),r=!Z(t,n);!r&&e.getLine(t.line).length==t.ch?e.replaceRange("",t,{line:t.line+1,ch:0}):e.replaceRange("",t,r?n:{line:t.line})},deleteLine:function(e){var t=e.getCursor().line;e.replaceRange("",{line:t,ch:0},{line:t})},undo:function(e){e.undo()},redo:function(e){e.redo()},goDocStart:function(e){e.setCursor(0,0,!0)},goDocEnd:function(e){e.setSelection({line:e.lineCount()-1},null,!0)},goLineStart:function(e){e.setCursor(e.getCursor().line,0,!0)},goLineStartSmart:function(e){var t=e.getCursor(),n=e.getLine(t.line),r=Math.max(0,n.search(/\S/));e.setCursor(t.line,t.ch<=r&&t.ch?0:r,!0)},goLineEnd:function(e){e.setSelection({line:e.getCursor().line},null,!0)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goWordRight:function(e){e.moveH(1,"word")},delCharLeft:function(e){e.deleteH(-1,"char")},delCharRight:function(e){e.deleteH(1,"char")},delWordLeft:function(e){e.deleteH(-1,"word")},delWordRight:function(e){e.deleteH(1,"word")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection(" ","end")},transposeChars:function(e){var t=e.getCursor(),n=e.getLine(t.line);t.ch>0&&t.ch<n.length-1&&e.replaceRange(n.charAt(t.ch)+n.charAt(t.ch-1),{line:t.line,ch:t.ch-1},{line:t.line,ch:t.ch+1})},newlineAndIndent:function(e){e.replaceSelection("\n","end"),e.indentLine(e.getCursor().line)},toggleOverwrite:function(e){e.toggleOverwrite()}},a=e.keyMap={};a.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharRight",Backspace:"delCharLeft",Tab:"insertTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"},a.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goWordLeft","Ctrl-Right":"goWordRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delWordLeft","Ctrl-Delete":"delWordRight","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore",fallthrough:"basic"},a.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goWordLeft","Alt-Right":"goWordRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delWordLeft","Ctrl-Alt-Backspace":"delWordRight","Alt-Delete":"delWordRight","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore",fallthrough:["basic","emacsy"]},a["default"]=n?a.macDefault:a.pcDefault,a.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageUp","Shift-Ctrl-V":"goPageDown","Ctrl-D":"delCharRight","Ctrl-H":"delCharLeft","Alt-D":"delWordRight","Alt-Backspace":"delWordLeft","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},e.fromTextArea=function(t,n){function r(){t.value=u.getValue()}n||(n={}),n.value=t.value,!n.tabindex&&t.tabindex&&(n.tabindex=t.tabindex),n.autofocus==null&&t.getAttribute("autofocus")!=null&&(n.autofocus=!0);if(t.form){var i=P(t.form,"submit",r,!0);if(typeof t.form.submit=="function"){var s=t.form.submit;function o(){r(),t.form.submit=s,t.form.submit(),t.form.submit=o}t.form.submit=o}}t.style.display="none";var u=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},n);return u.save=r,u.getTextArea=function(){return t},u.toTextArea=function(){r(),t.parentNode.removeChild(u.getWrapperElement()),t.style.display="",t.form&&(i(),typeof t.form.submit=="function"&&(t.form.submit=s))},u},e.copyState=h,e.startState=p,d.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(e){var t=this.string.charAt(this.pos);if(typeof e=="string")var n=t==e;else var n=t&&(e.test?e.test(t):e(t));if(n)return++this.pos,t},eatWhile:function(e){var t=this.pos;while(this.eat(e));return this.pos>t},eatSpace:function(){var e=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return J(this.string,this.start,this.tabSize)},indentation:function(){return J(this.string,null,this.tabSize)},match:function(e,t,n){if(typeof e!="string"){var i=this.string.slice(this.pos).match(e);return i&&t!==!1&&(this.pos+=i[0].length),i}function r(e){return n?e.toLowerCase():e}if(r(this.string).indexOf(r(e),this.pos)==this.pos)return t!==!1&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)}},e.StringStream=d,v.prototype={attach:function(e){this.marker.set.push(e)},detach:function(e){var t=st(this.marker.set,e);t>-1&&this.marker.set.splice(t,1)},split:function(e,t){if(this.to<=e&&this.to!=null)return null;var n=this.from<e||this.from==null?null:this.from-e+t,r=this.to==null?null:this.to-e+t;return new v(n,r,this.style,this.marker)},dup:function(){return new v(null,null,this.style,this.marker)},clipTo:function(e,t,n,r,i){e&&r>this.from&&(r<this.to||this.to==null)?this.from=null:this.from!=null&&this.from>=t&&(this.from=Math.max(r,this.from)+i),n&&(t<this.to||this.to==null)&&(t>this.from||this.from==null)?this.to=null:this.to!=null&&this.to>t&&(this.to=r<this.to?this.to+i:t)},isDead:function(){return this.from!=null&&this.to!=null&&this.from>=this.to},sameSet:function(e){return this.marker==e.marker}},m.prototype={attach:function(e){this.line=e},detach:function(e){this.line==e&&(this.line=null)},split:function(e,t){if(e<this.from)return this.from=this.to=this.from-e+t,this},isDead:function(){return this.from>this.to},clipTo:function(e,t,n,r,i){(e||t<this.from)&&(n||r>this.to)?(this.from=0,this.to=-1):this.from>t&&(this.from=this.to=Math.max(r,this.from)+i)},sameSet:function(e){return!1},find:function(){return!this.line||!this.line.parent?null:{line:S(this.line),ch:this.from}},clear:function(){if(this.line){var e=st(this.line.marked,this);e!=-1&&this.line.marked.splice(e,1),this.line=null}}},g.inheritMarks=function(e,t){var n=new g(e),r=t&&t.marked;if(r)for(var i=0;i<r.length;++i)if(r[i].to==null&&r[i].style){var s=n.marked||(n.marked=[]),o=r[i],u=o.dup();s.push(u),u.attach(n)}return n},g.prototype={replace:function(e,t,n){var r=[],i=this.marked,s=t==null?this.text.length:t;y(0,e,this.styles,r),n&&r.push(n,null),y(s,this.text.length,this.styles,r),this.styles=r,this.text=this.text.slice(0,e)+n+this.text.slice(s),this.stateAfter=null;if(i){var o=n.length-(s-e);for(var u=0;u<i.length;++u){var a=i[u];a.clipTo(e==null,e||0,t==null,s,o),a.isDead()&&(a.detach(this),i.splice(u--,1))}}},split:function(e,t){var n=[t,null],r=this.marked;y(e,this.text.length,this.styles,n);var i=new g(t+this.text.slice(e),n);if(r)for(var s=0;s<r.length;++s){var o=r[s],u=o.split(e,t.length);u&&(i.marked||(i.marked=[]),i.marked.push(u),u.attach(i),u==o&&r.splice(s--,1))}return i},append:function(e){var t=this.text.length,n=e.marked,r=this.marked;this.text+=e.text,y(0,e.text.length,e.styles,this.styles);if(r)for(var i=0;i<r.length;++i)r[i].to==null&&(r[i].to=t);if(n&&n.length){r||(this.marked=r=[]);e:for(var i=0;i<n.length;++i){var s=n[i];if(!s.from)for(var o=0;o<r.length;++o){var u=r[o];if(u.to==t&&u.sameSet(s)){u.to=s.to==null?null:s.to+t,u.isDead()&&(u.detach(this),n.splice(i--,1));continue e}}r.push(s),s.attach(this),s.from+=t,s.to!=null&&(s.to+=t)}}},fixMarkEnds:function(e){var t=this.marked,n=e.marked;if(!t)return;for(var r=0;r<t.length;++r){var i=t[r],s=i.to==null;if(s&&n)for(var o=0;o<n.length;++o)if(n[o].sameSet(i)){s=!1;break}s&&(i.to=this.text.length)}},fixMarkStarts:function(){var e=this.marked;if(!e)return;for(var t=0;t<e.length;++t)e[t].from==null&&(e[t].from=0)},addMark:function(e){e.attach(this),this.marked==null&&(this.marked=[]),this.marked.push(e),this.marked.sort(function(e,t){return(e.from||0)-(t.from||0)})},highlight:function(e,t,n){var r=new d(this.text,n),i=this.styles,s=0,o=!1,u=i[0],a;this.text==""&&e.blankLine&&e.blankLine(t);while(!r.eol()){var f=e.token(r,t),l=this.text.slice(r.start,r.pos);r.start=r.pos,s&&i[s-1]==f?i[s-2]+=l:l&&(!o&&(i[s+1]!=f||s&&i[s-2]!=a)&&(o=!0),i[s++]=l,i[s++]=f,a=u,u=i[s]);if(r.pos>5e3){i[s++]=this.text.slice(r.pos),i[s++]=null;break}}return i.length!=s&&(i.length=s,o=!0),s&&i[s-2]!=a&&(o=!0),o||(i.length<5&&this.text.length<10?null:!1)},getTokenAt:function(e,t,n){var r=this.text,i=new d(r);while(i.pos<n&&!i.eol()){i.start=i.pos;var s=e.token(i,t)}return{start:i.start,end:i.pos,string:i.current(),className:s||null,state:t}},indentation:function(e){return J(this.text,null,e)},getHTML:function(e,t,n,r){function u(t,n){if(!t)return;s&&F&&t.charAt(0)==" "&&(t=" "+t.slice(1)),s=!1;if(t.indexOf(" ")==-1){o+=t.length;var r=rt(t)}else{var r="";for(var u=0;;){var a=t.indexOf(" ",u);if(a==-1){r+=rt(t.slice(u)),o+=t.length-u;break}o+=a-u;var f=e(o);r+=rt(t.slice(u,a))+f.html,o+=f.width,u=a+1}}n?i.push('<span class="',n,'">',r,"</span>"):i.push(r)}function v(e){return e?"cm-"+e.replace(/ +/g," cm-"):null}var i=[],s=!0,o=0,a=u;if(t!=null){var f=0,l='<span id="'+n+'">';a=function(e,n){var s=e.length;t>=f&&t<f+s?(t>f&&(u(e.slice(0,t-f),n),r&&i.push("<wbr>")),i.push(l),u(e.slice(t-f),n),i.push("</span>"),t--,f+=s):(f+=s,u(e,n),f==t&&f==d?i.push(l+"</span>"):f>t+10&&/\s/.test(e)&&(a=function(){}))}}var c=this.styles,h=this.text,p=this.marked,d=h.length;if(!h&&t==null)a(" ");else if(!p||!p.length)for(var m=0,g=0;g<d;m+=2){var y=c[m],b=c[m+1],w=y.length;g+w>d&&(y=y.slice(0,d-g)),g+=w,a(y,v(b))}else{var E=0,m=0,S="",b,x=0,T=p[0].from||0,N=[],C=0;function k(){var e;while(C<p.length&&((e=p[C]).from==E||e.from==null))e.style!=null&&N.push(e),++C;T=C<p.length?p[C].from:Infinity;for(var t=0;t<N.length;++t){var n=N[t].to||Infinity;n==E?N.splice(t--,1):T=Math.min(n,T)}}var L=0;while(E<d){T==E&&k();var A=Math.min(d,T);for(;;){if(S){var O=E+S.length,M=b;for(var _=0;_<N.length;++_)M=(M?M+" ":"")+N[_].style;a(O>A?S.slice(0,A-E):S,M);if(O>=A){S=S.slice(A-E),E=A;break}E=O}S=c[m++],b=v(c[m++])}}}return i.join("")},cleanUp:function(){this.parent=null;if(this.marked)for(var e=0,t=this.marked.length;e<t;++e)this.marked[e].detach(this)}},b.prototype={chunkSize:function(){return this.lines.length},remove:function(e,t,n){for(var r=e,i=e+t;r<i;++r){var s=this.lines[r];this.height-=s.height,s.cleanUp();if(s.handlers)for(var o=0;o<s.handlers.length;++o)n.push(s.handlers[o])}this.lines.splice(e,t)},collapse:function(e){e.splice.apply(e,[e.length,0].concat(this.lines))},insertHeight:function(e,t,n){this.height+=n,F?this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e)):this.lines.splice.apply(this.lines,[e,0].concat(t));for(var r=0,i=t.length;r<i;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},w.prototype={chunkSize:function(){return this.size},remove:function(e,t,n){this.size-=t;for(var r=0;r<this.children.length;++r){var i=this.children[r],s=i.chunkSize();if(e<s){var o=Math.min(t,s-e),u=i.height;i.remove(e,o,n),this.height-=u-i.height,s==o&&(this.children.splice(r--,1),i.parent=null);if((t-=o)==0)break;e=0}else e-=s}if(this.size-t<25){var a=[];this.collapse(a),this.children=[new b(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0,n=this.children.length;t<n;++t)this.children[t].collapse(e)},insert:function(e,t){var n=0;for(var r=0,i=t.length;r<i;++r)n+=t[r].height;this.insertHeight(e,t,n)},insertHeight:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0,i=this.children.length;r<i;++r){var s=this.children[r],o=s.chunkSize();if(e<=o){s.insertHeight(e,t,n);if(s.lines&&s.lines.length>50){while(s.lines.length>50){var u=s.lines.splice(s.lines.length-25,25),a=new b(u);s.height-=a.height,this.children.splice(r+1,0,a),a.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new w(t);if(!e.parent){var r=new w(e.children);r.parent=e,e.children=[r,n],e=r}else{e.size-=n.size,e.height-=n.height;var i=st(e.parent.children,e);e.parent.children.splice(i+1,0,n)}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iter:function(e,t,n){this.iterN(e,t-e,n)},iterN:function(e,t,n){for(var r=0,i=this.children.length;r<i;++r){var s=this.children[r],o=s.chunkSize();if(e<o){var u=Math.min(t,o-e);if(s.iterN(e,u,n))return!0;if((t-=u)==0)break;e=0}else e-=o}}},N.prototype={addChange:function(e,t,n){this.undone.length=0;var r=+(new Date),i=this.done[this.done.length-1],s=i&&i[i.length-1],o=r-this.time;if(this.compound&&i&&!this.closed)i.push({start:e,added:t,old:n});else if(o>400||!s||this.closed||s.start>e+n.length||s.start+s.added<e)this.done.push([{start:e,added:t,old:n}]),this.closed=!1;else{var u=Math.max(0,s.start-e),a=Math.max(0,e+n.length-(s.start+s.added));for(var f=u;f>0;--f)s.old.unshift(n[f-1]);for(var f=a;f>0;--f)s.old.push(n[n.length-f]);u&&(s.start=e),s.added+=t-(n.length-u-a)}this.time=r},startCompound:function(){this.compound++||(this.closed=!0)},endCompound:function(){--this.compound||(this.closed=!0)}},e.e_stop=O,e.e_preventDefault=L,e.e_stopPropagation=A,e.connect=P,H.prototype={set:function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)}};var B=e.Pass={toString:function(){return"CodeMirror.Pass"}},j=/gecko\/\d{7}/i.test(navigator.userAgent),F=/MSIE \d/.test(navigator.userAgent),I=/MSIE [1-8]\b/.test(navigator.userAgent),q=F&&document.documentMode==5,R=/WebKit\//.test(navigator.userAgent),U=/Chrome\//.test(navigator.userAgent),z=/Apple Computer/.test(navigator.vendor),W=/KHTML\//.test(navigator.userAgent),X=function(){if(I)return!1;var e=document.createElement("div");return"draggable"in e||"dragDrop"in e}(),V=function(){var e=document.createElement("textarea");return e.value="foo\nbar",e.value.indexOf("\r")>-1?"\r\n":"\n"}(),$=/^$/;j?$=/$'/:z?$=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/:U&&($=/\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/),document.documentElement.getBoundingClientRect!=null&&(Q=function(e,t){try{var n=e.getBoundingClientRect();n={top:n.top,left:n.left}}catch(r){n={top:0,left:0}}if(!t)if(window.pageYOffset==null){var i=document.documentElement||document.body.parentNode;i.scrollTop==null&&(i=document.body),n.top+=i.scrollTop,n.left+=i.scrollLeft}else n.top+=window.pageYOffset,n.left+=window.pageXOffset;return n});var nt=document.createElement("pre");rt("a")=="\na"?rt=function(e){return nt.textContent=e,nt.innerHTML.slice(1)}:rt(" ")!=" "&&(rt=function(e){return nt.innerHTML="",nt.appendChild(document.createTextNode(e)),nt.innerHTML}),e.htmlEscape=rt;var ut="\n\nb".split(/\n/).length!=3?function(e){var t=0,n,r=[];while((n=e.indexOf("\n",t))>-1)r.push(e.slice(t,e.charAt(n-1)=="\r"?n-1:n)),t=n+1;return r.push(e.slice(t)),r}:function(e){return e.split(/\r?\n/)};e.splitLines=ut;var at=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0};e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var ft={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};return e.keyNames=ft,function(){for(var e=0;e<10;e++)ft[e+48]=String(e);for(var e=65;e<=90;e++)ft[e]=String.fromCharCode(e);for(var e=1;e<=12;e++)ft[e+111]=ft[e+63235]="F"+e}(),e}()
\ No newline at end of file +window.CodeMirror=function(){function e(r,i){function cn(e){if(s.onDragEvent&&s.onDragEvent(vn,K(e)))return;Y(e)}function dn(e){return e>=0&&e<Dt.size}function mn(e){return z(Dt,e)}function gn(e,t){Qt=!0;var n=t-e.height;for(var r=e;r;r=r.parent)r.height+=n}function yn(e,t){return e.styles||e.highlight(_t,e.stateAfter=ai(W(e)),s.tabSize),e.getContent(s.tabSize,t,s.lineWrapping)}function bn(e){var t={line:0,ch:0};jn(t,{line:Dt.size-1,ch:mn(Dt.size-1).text.length},Nt(e),t,t),Xt=!0}function wn(e){var t=[];return Dt.iter(0,Dt.size,function(e){t.push(e.text)}),t.join(e||"\n")}function En(e){M.scrollTop!=qt&&(qt=Et.scrollTop=M.scrollTop,ur([]))}function Sn(e){s.fixedGutter&&ut.style.left!=Et.scrollLeft+"px"&&(ut.style.left=Et.scrollLeft+"px"),Et.scrollTop!=qt&&(qt=Et.scrollTop,M.scrollTop!=qt&&(M.scrollTop=qt),ur([])),s.onScroll&&s.onScroll(vn)}function xn(e){function u(t){b&&(Et.draggable=!1),Rt=!1,l(),c(),Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)<10&&(Q(t),mr(n.line,n.ch,!0),tr())}function m(e){if(i=="single")pr(n,e);else if(i=="double"){var t=xr(e);mt(e,h)?pr(t.from,p):pr(h,t.to)}else i=="triple"&&(mt(e,h)?pr(p,yr({line:e.line,ch:0})):pr(h,yr({line:e.line+1,ch:0})))}function g(e){var t=ti(e,!0);if(t&&!vt(t,a)){Ht||Hn(),a=t,m(t),Xt=!1;var n=or();if(t.line>=n.to||t.line<n.from)f=setTimeout(di(function(){g(e)}),150)}}function y(e){clearTimeout(f);var t=ti(e);t&&m(t),Q(e),tr(),Xt=!0,w(),l()}hr(tt(e,"shiftKey"));for(var t=Z(e);t!=Lt;t=t.parentNode)if(t.parentNode==ct&&t!=at)return;for(var t=Z(e);t!=Lt;t=t.parentNode)if(t.parentNode==ot)return s.onGutterClick&&s.onGutterClick(vn,xt(ot.childNodes,t)+Zt,e),Q(e);var n=ti(e);switch(et(e)){case 3:d&&ri(e);return;case 2:n&&mr(n.line,n.ch,!0),setTimeout(tr,20),Q(e);return}if(!n){Z(e)==Et&&Q(e);return}Ht||Hn();var r=+(new Date),i="single";if(It&&It.time>r-400&&vt(It.pos,n))i="triple",Q(e),setTimeout(tr,20),Tr(n.line);else if(Ft&&Ft.time>r-400&&vt(Ft.pos,n)){i="double",It={time:r,pos:n},Q(e);var o=xr(n);pr(o.from,o.to)}else Ft={time:r,pos:n};var a=n,f;if(s.dragDrop&&st&&!s.readOnly&&!vt(Bt.from,Bt.to)&&!mt(n,Bt.from)&&!mt(Bt.to,n)&&i=="single"){b&&(Et.draggable=!0);var l=nt(document,"mouseup",di(u),!0),c=nt(Et,"drop",di(u),!0);Rt=!0,Et.dragDrop&&Et.dragDrop();return}Q(e),i=="single"&&mr(n.line,n.ch,!0);var h=Bt.from,p=Bt.to,w=nt(document,"mousemove",di(function(e){clearTimeout(f),Q(e),!v&&!et(e)?y(e):g(e)}),!0),l=nt(document,"mouseup",di(y),!0)}function Tn(e){for(var t=Z(e);t!=Lt;t=t.parentNode)if(t.parentNode==ot)return Q(e);Q(e)}function Nn(e){if(s.onDragEvent&&s.onDragEvent(vn,K(e)))return;Q(e);var t=ti(e,!0),n=e.dataTransfer.files;if(!t||s.readOnly)return;if(n&&n.length&&window.FileReader&&window.File){var r=n.length,i=Array(r),o=0,u=function(e,n){var s=new FileReader;s.onload=function(){i[n]=s.result,++o==r&&(t=yr(t),di(function(){var e=Xn(i.join(""),t,t);pr(t,e)})())},s.readAsText(e)};for(var a=0;a<r;++a)u(n[a],a)}else{if(Rt&&!mt(t,Bt.from)&&!mt(Bt.to,t))return;try{var i=e.dataTransfer.getData("Text");i&&vi(function(){var e=Bt.from,n=Bt.to;pr(t,t),Rt&&Xn("",e,n),Vn(i),tr()})}catch(e){}}}function Cn(e){var t=Kn();e.dataTransfer.setData("Text",t),e.dataTransfer.setDragImage&&e.dataTransfer.setDragImage(yt("img"),0,0)}function kn(e,t){if(typeof e=="string"){e=f[e];if(!e)return!1}var n=jt;try{s.readOnly&&(zt=!0),t&&(jt=null),e(vn)}catch(r){if(r!=it)throw r;return!1}finally{jt=n,zt=!1}return!0}function An(e){function f(){a=!0}var t=c(s.keyMap),r=t.auto;clearTimeout(Ln),r&&!p(e)&&(Ln=setTimeout(function(){c(s.keyMap)==t&&(s.keyMap=r.call?r.call(null,vn):r)},50));var i=kt[tt(e,"keyCode")],o=!1,u=E&&n;if(i==null||e.altGraphKey)return!1;tt(e,"altKey")&&(i="Alt-"+i),tt(e,u?"metaKey":"ctrlKey")&&(i="Ctrl-"+i),tt(e,u?"ctrlKey":"metaKey")&&(i="Cmd-"+i);var a=!1;return tt(e,"shiftKey")?o=h("Shift-"+i,s.extraKeys,s.keyMap,function(e){return kn(e,!0)},f)||h(i,s.extraKeys,s.keyMap,function(e){if(typeof e=="string"&&/^go[A-Z]/.test(e))return kn(e)},f):o=h(i,s.extraKeys,s.keyMap,kn,f),a&&(o=!1),o&&(Q(e),ii(),v&&(e.oldKeyCode=e.keyCode,e.keyCode=0)),o}function On(e,t){var n=h("'"+t+"'",s.extraKeys,s.keyMap,function(e){return kn(e,!0)});return n&&(Q(e),ii()),n}function _n(e){Ht||Hn(),v&&e.keyCode==27&&(e.returnValue=!1),un&&Zn()&&(un=!1);if(s.onKeyEvent&&s.onKeyEvent(vn,K(e)))return;var t=tt(e,"keyCode");hr(t==16||tt(e,"shiftKey"));var r=An(e);E&&(Mn=r?t:null,!r&&t==88&&tt(e,n?"metaKey":"ctrlKey")&&Vn(""))}function Dn(e){un&&Zn();if(s.onKeyEvent&&s.onKeyEvent(vn,K(e)))return;var t=tt(e,"keyCode"),n=tt(e,"charCode");if(E&&t==Mn){Mn=null,Q(e);return}if((E&&(!e.which||e.which<10)||x)&&An(e))return;var r=String.fromCharCode(n==null?t:n);s.electricChars&&_t.electricChars&&s.smartIndent&&!s.readOnly&&_t.electricChars.indexOf(r)>-1&&setTimeout(di(function(){Cr(Bt.to.line,"smart")}),75);if(On(e,r))return;Gn()}function Pn(e){if(s.onKeyEvent&&s.onKeyEvent(vn,K(e)))return;tt(e,"keyCode")==16&&(jt=null)}function Hn(){if(s.readOnly=="nocursor")return;Ht||(s.onFocus&&s.onFocus(vn),Ht=!0,Et.className.search(/\bCodeMirror-focused\b/)==-1&&(Et.className+=" CodeMirror-focused")),Qn(),ii()}function Bn(){Ht&&(s.onBlur&&s.onBlur(vn),Ht=!1,nn&&di(function(){nn&&(nn(),nn=null)})(),Et.className=Et.className.replace(" CodeMirror-focused","")),clearInterval(Mt),setTimeout(function(){Ht||(jt=null)},150)}function jn(e,t,n,r,i){if(zt)return;var o=[];Dt.iter(e.line,t.line+1,function(e){o.push(B(e.text,e.markedSpans))});if(fn){fn.addChange(e.line,n.length,o);while(fn.done.length>s.undoDepth)fn.done.shift()}var u=D(H(o[0]),H(pt(o)),e.ch,t.ch,n);Rn(e,t,u,r,i)}function Fn(e,t){if(!e.length)return;var n=e.pop(),r=[];for(var i=n.length-1;i>=0;i-=1){var s=n[i],o=[],u=s.start+s.added;Dt.iter(s.start,u,function(e){o.push(B(e.text,e.markedSpans))}),r.push({start:s.start,added:s.old.length,old:o});var a={line:s.start+s.old.length-1,ch:St(P(pt(o)),P(pt(s.old)))};Rn({line:s.start,ch:0},{line:u-1,ch:mn(u-1).text.length},s.old,a,a)}Xt=!0,t.push(r)}function In(){Fn(fn.done,fn.undone)}function qn(){Fn(fn.undone,fn.done)}function Rn(e,t,n,r,i){function w(e){return e<=Math.min(t.line,t.line+g)?e:e+g}if(zt)return;var o=!1,u=rn.text.length;s.lineWrapping||Dt.iter(e.line,t.line+1,function(e){if(!e.hidden&&e.text.length==u)return o=!0,!0});if(e.line!=t.line||n.length>1)Qt=!0;var a=t.line-e.line,f=mn(e.line),l=mn(t.line),c=pt(n);if(e.ch==0&&t.ch==0&&P(c)==""){var h=[],p=null;for(var d=0,v=n.length-1;d<v;++d)h.push(new q(P(n[d]),H(n[d])));l.update(l.text,H(c)),a&&Dt.remove(e.line,a,Gt),h.length&&Dt.insert(e.line,h)}else if(f==l)if(n.length==1)f.update(f.text.slice(0,e.ch)+P(n[0])+f.text.slice(t.ch),H(n[0]));else{for(var h=[],d=1,v=n.length-1;d<v;++d)h.push(new q(P(n[d]),H(n[d])));h.push(new q(P(c)+f.text.slice(t.ch),H(c))),f.update(f.text.slice(0,e.ch)+P(n[0]),H(n[0])),Dt.insert(e.line+1,h)}else if(n.length==1)f.update(f.text.slice(0,e.ch)+P(n[0])+l.text.slice(t.ch),H(n[0])),Dt.remove(e.line+1,a,Gt);else{var h=[];f.update(f.text.slice(0,e.ch)+P(n[0]),H(n[0])),l.update(P(c)+l.text.slice(t.ch),H(c));for(var d=1,v=n.length-1;d<v;++d)h.push(new q(P(n[d]),H(n[d])));a>1&&Dt.remove(e.line+1,a-1,Gt),Dt.insert(e.line+1,h)}if(s.lineWrapping){var m=Math.max(5,Et.clientWidth/Yr()-3);Dt.iter(e.line,e.line+n.length,function(e){if(e.hidden)return;var t=Math.ceil(e.text.length/m)||1;t!=e.height&&gn(e,t)})}else Dt.iter(e.line,e.line+n.length,function(e){var t=e.text;!e.hidden&&t.length>u&&(rn=e,u=t.length,on=!0,o=!1)}),o&&(sn=!0);Pt=Math.min(Pt,e.line),li(400);var g=n.length-a-1;$t.push({from:e.line,to:t.line+1,diff:g});if(s.onChange){for(var d=0;d<n.length;++d)typeof n[d]!="string"&&(n[d]=n[d].text);var y={from:e,to:t,text:n};if(Jt){for(var b=Jt;b.next;b=b.next);b.next=y}else Jt=y}dr(yr(r),yr(i),w(Bt.from.line),w(Bt.to.line))}function Un(){var e=Dt.height*Kr()+2*Zr();return e*.99>Et.offsetHeight?e:!1}function zn(e){var t=Un();M.style.display=t?"block":"none",t?(L.style.height=ct.style.minHeight=t+"px",M.style.height=Et.clientHeight+"px",e!=null&&(M.scrollTop=Et.scrollTop=e,b&&setTimeout(function(){if(M.scrollTop!=e)return;M.scrollTop=e+(e?-1:1),M.scrollTop=e},0))):ct.style.minHeight="",at.style.top=Yt*Kr()+"px"}function Wn(){rn=mn(0),on=!0;var e=rn.text.length;Dt.iter(1,Dt.size,function(t){var n=t.text;!t.hidden&&n.length>e&&(e=n.length,rn=t)}),sn=!1}function Xn(e,t,n){function r(r){if(mt(r,t))return r;if(!mt(n,r))return i;var s=r.line+e.length-(n.line-t.line)-1,o=r.ch;return r.line==n.line&&(o+=pt(e).length-(n.ch-(n.line==t.line?t.ch:0))),{line:s,ch:o}}t=yr(t),n?n=yr(n):n=t,e=Nt(e);var i;return $n(e,t,n,function(e){return i=e,{from:r(Bt.from),to:r(Bt.to)}}),i}function Vn(e,t){$n(Nt(e),Bt.from,Bt.to,function(e){return t=="end"?{from:e,to:e}:t=="start"?{from:Bt.from,to:Bt.from}:{from:Bt.from,to:e}})}function $n(e,t,n,r){var i=e.length==1?e[0].length+t.ch:pt(e).length,s=r({line:t.line+e.length-1,ch:i});jn(t,n,e,s.from,s.to)}function Jn(e,t,n){var r=e.line,i=t.line;if(r==i)return mn(r).text.slice(e.ch,t.ch);var s=[mn(r).text.slice(e.ch)];return Dt.iter(r+1,i,function(e){s.push(e.text)}),s.push(mn(i).text.slice(0,t.ch)),s.join(n||"\n")}function Kn(e){return Jn(Bt.from,Bt.to,e)}function Qn(){if(un)return;At.set(s.pollInterval,function(){Zn(),Ht&&Qn()})}function Gn(){function t(){var n=Zn();!n&&!e?(e=!0,At.set(60,t)):(un=!1,Qn())}var e=!1;un=!0,At.set(20,t)}function Zn(){if(!Ht||Ct(S)||s.readOnly)return!1;var e=S.value;if(e==Yn)return!1;pi||ci(),jt=null;var t=0,n=Math.min(Yn.length,e.length);while(t<n&&Yn[t]==e[t])++t;return t<Yn.length?Bt.from={line:Bt.from.line,ch:Bt.from.ch-(Yn.length-t)}:Ut&&vt(Bt.from,Bt.to)&&!Wt&&(Bt.to={line:Bt.to.line,ch:Math.min(mn(Bt.to.line).text.length,Bt.to.ch+(e.length-t))}),Vn(e.slice(t),"end"),e.length>1e3?S.value=Yn="":Yn=e,pi||hi(),Wt=!1,!0}function er(e){vt(Bt.from,Bt.to)?e&&(Yn=S.value=""):(Yn="",S.value=Kn(),Ht&&dt(S))}function tr(){s.readOnly!="nocursor"&&S.focus()}function nr(){var e=rr();ir(e.x,e.y,e.x,e.yBot);if(!Ht)return;var t=ct.getBoundingClientRect(),n=null;e.y+t.top<0?n=!0:e.y+t.top+Kr()>(window.innerHeight||document.documentElement.clientHeight)&&(n=!1);if(n!=null){var r=F.style.display=="none";r&&(F.style.display="",F.style.left=e.x+"px",F.style.top=e.y-Yt+"px"),F.scrollIntoView(n),r&&(F.style.display="none")}}function rr(){var e=zr(Bt.inverted?Bt.from:Bt.to),t=s.lineWrapping?Math.min(e.x,G.offsetWidth):e.x;return{x:t,y:e.y,yBot:e.yBot}}function ir(e,t,n,r){var i=sr(e,t,n,r);i.scrollLeft!=null&&(Et.scrollLeft=i.scrollLeft),i.scrollTop!=null&&(M.scrollTop=Et.scrollTop=i.scrollTop)}function sr(e,t,n,r){var i=ei(),o=Zr();t+=o,r+=o,e+=i,n+=i;var u=Et.clientHeight,a=M.scrollTop,f={},l=Un()||Infinity,c=t<o+10,h=r+o>l-10;t<a?f.scrollTop=c?0:Math.max(0,t):r>a+u&&(f.scrollTop=(h?l:r)-u);var p=Et.clientWidth,d=Et.scrollLeft,v=s.fixedGutter?ut.clientWidth:0,m=e<v+i+10;return e<d+v||m?(m&&(e=0),f.scrollLeft=Math.max(0,e-10-v)):n>p+d-3&&(f.scrollLeft=n+10-p),f}function or(e){var t=Kr(),n=(e!=null?e:M.scrollTop)-Zr(),r=Math.max(0,Math.floor(n/t)),i=Math.ceil((n+Et.clientHeight)/t);return{from:X(Dt,r),to:X(Dt,i)}}function ur(e,t,n){function d(){var e=_.firstChild,t=!1;return Dt.iter(Zt,en,function(n){if(!e)return;if(!n.hidden){var r=Math.round(e.offsetHeight/c)||1;n.height!=r&&(gn(n,r),Qt=t=!0)}e=e.nextSibling}),t}if(!Et.clientWidth){Zt=en=Yt=0;return}var r=or(n);if(e!==!0&&e.length==0&&r.from>Zt&&r.to<en){zn(n);return}var i=Math.max(r.from-100,0),o=Math.min(Dt.size,r.to+100);Zt<i&&i-Zt<20&&(i=Zt),en>o&&en-o<20&&(o=Math.min(Dt.size,en));var u=e===!0?[]:ar([{from:Zt,to:en,domStart:0}],e),a=0;for(var f=0;f<u.length;++f){var l=u[f];l.from<i&&(l.domStart+=i-l.from,l.from=i),l.to>o&&(l.to=o),l.from>=l.to?u.splice(f--,1):a+=l.to-l.from}if(a==o-i&&i==Zt&&o==en){zn(n);return}u.sort(function(e,t){return e.domStart-t.domStart});var c=Kr(),h=ut.style.display;_.style.display="none",fr(i,o,u),_.style.display=ut.style.display="";var p=i!=Zt||o!=en||tn!=Et.clientHeight+c;p&&(tn=Et.clientHeight+c),(i!=Zt||o!=en&&s.onViewportChange)&&setTimeout(function(){s.onViewportChange&&s.onViewportChange(vn,i,o)}),Zt=i,en=o,Yt=V(Dt,i),li(100);if(_.childNodes.length!=en-Zt)throw new Error("BAD PATCH! "+JSON.stringify(u)+" size="+(en-Zt)+" nodes="+_.childNodes.length);return s.lineWrapping&&d(),ut.style.display=h,(p||Qt)&&lr()&&s.lineWrapping&&d()&&lr(),zn(n),cr(),!t&&s.onUpdate&&s.onUpdate(vn),!0}function ar(e,t){for(var n=0,r=t.length||0;n<r;++n){var i=t[n],s=[],o=i.diff||0;for(var u=0,a=e.length;u<a;++u){var f=e[u];i.to<=f.from&&i.diff?s.push({from:f.from+o,to:f.to+o,domStart:f.domStart}):i.to<=f.from||i.from>=f.to?s.push(f):(i.from>f.from&&s.push({from:f.from,to:i.from,domStart:f.domStart}),i.to<f.to&&s.push({from:i.to+o,to:f.to+o,domStart:f.domStart+(i.to-f.from)}))}e=s}return e}function fr(e,t,n){function r(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}if(!n.length)bt(_);else{var i=0,s=_.firstChild,o;for(var u=0;u<n.length;++u){var a=n[u];while(a.domStart>i)s=r(s),i++;for(var f=0,l=a.to-a.from;f<l;++f)s=s.nextSibling,i++}while(s)s=r(s)}var c=n.shift(),s=_.firstChild,f=e;Dt.iter(e,t,function(e){c&&c.to==f&&(c=n.shift());if(!c||c.from>f){if(e.hidden)var t=yt("pre");else{var t=yn(e);e.className&&(t.className=e.className);if(e.bgClassName){var r=yt("pre"," ",e.bgClassName,"position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2");t=yt("div",[r,t],null,"position: relative")}}_.insertBefore(t,s)}else s=s.nextSibling;++f})}function lr(){if(!s.gutter&&!s.lineNumbers)return;var e=at.offsetHeight,t=Et.clientHeight;ut.style.height=(e-t<2?t:e)+"px";var n=document.createDocumentFragment(),r=Zt,i;Dt.iter(Zt,Math.max(en,Zt+1),function(e){if(e.hidden)n.appendChild(yt("pre"));else{var t=e.gutterMarker,o=s.lineNumbers?s.lineNumberFormatter(r+s.firstLineNumber):null;t&&t.text?o=t.text.replace("%N%",o!=null?o:""):o==null&&(o=" ");var u=n.appendChild(yt("pre",null,t&&t.style));u.innerHTML=o;for(var a=1;a<e.height;++a)u.appendChild(yt("br")),u.appendChild(document.createTextNode(" "));t||(i=r)}++r}),ut.style.display="none",wt(ot,n);if(i!=null&&s.lineNumbers){var o=ot.childNodes[i-Zt],u=String(Dt.size).length,a=lt(o.firstChild),f="";while(a.length+f.length<u)f+=" ";f&&o.insertBefore(document.createTextNode(f),o.firstChild)}ut.style.display="";var l=Math.abs((parseInt(G.style.marginLeft)||0)-ut.offsetWidth)>2;return G.style.marginLeft=ut.offsetWidth+"px",Qt=!1,l}function cr(){var e=vt(Bt.from,Bt.to),t=zr(Bt.from,!0),n=e?t:zr(Bt.to,!0),r=Bt.inverted?t:n,i=Kr(),o=ft(Lt),u=ft(_);k.style.top=Math.max(0,Math.min(Et.offsetHeight,r.y+u.top-o.top))+"px",k.style.left=Math.max(0,Math.min(Et.offsetWidth,r.x+u.left-o.left))+"px";if(e)F.style.top=r.y+"px",F.style.left=(s.lineWrapping?Math.min(r.x,G.offsetWidth):r.x)+"px",F.style.display="",j.style.display="none";else{var a=t.y==n.y,f=document.createDocumentFragment(),l=G.clientWidth||G.offsetWidth,c=G.clientHeight||G.offsetHeight,h=function(e,t,n,r){var i=y?"width: "+(n?l-n-e:l)+"px":"right: "+n+"px";f.appendChild(yt("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; "+i+"; height: "+r+"px"))};if(Bt.from.ch&&t.y>=0){var p=a?l-n.x:0;h(t.x,t.y,p,i)}var d=Math.max(0,t.y+(Bt.from.ch?i:0)),v=Math.min(n.y,c)-d;v>.2*i&&h(0,d,0,v),(!a||!Bt.from.ch)&&n.y<c-.5*i&&h(0,n.y,l-n.x,i),wt(j,f),F.style.display="none",j.style.display=""}}function hr(e){e?jt=jt||(Bt.inverted?Bt.to:Bt.from):jt=null}function pr(e,t){var n=jt&&yr(jt);n&&(mt(n,e)?e=n:mt(t,n)&&(t=n)),dr(e,t),Vt=!0}function dr(e,t,n,r){an=null,n==null&&(n=Bt.from.line,r=Bt.to.line);if(vt(Bt.from,e)&&vt(Bt.to,t))return;if(mt(t,e)){var i=t;t=e,e=i}if(e.line!=n){var o=vr(e,n,Bt.from.ch);o?e=o:qr(e.line,!1)}t.line!=r&&(t=vr(t,r,Bt.to.ch)),vt(e,t)?Bt.inverted=!1:vt(e,Bt.to)?Bt.inverted=!1:vt(t,Bt.from)&&(Bt.inverted=!0);if(s.autoClearEmptyLines&&vt(Bt.from,Bt.to)){var u=Bt.inverted?e:t;if(u.line!=Bt.from.line&&Bt.from.line<Dt.size){var a=mn(Bt.from.line);/^\s+$/.test(a.text)&&setTimeout(di(function(){if(a.parent&&/^\s+$/.test(a.text)){var e=W(a);Xn("",{line:e,ch:0},{line:e,ch:a.text.length})}},10))}}Bt.from=e,Bt.to=t,Kt=!0}function vr(e,t,n){function r(t){var r=e.line+t,i=t==1?Dt.size:-1;while(r!=i){var o=mn(r);if(!o.hidden){var u=e.ch;if(s||u>n||u>o.text.length)u=o.text.length;return{line:r,ch:u}}r+=t}}var i=mn(e.line),s=e.ch==i.text.length&&e.ch!=n;return i.hidden?e.line>=t?r(1)||r(-1):r(-1)||r(1):e}function mr(e,t,n){var r=yr({line:e,ch:t||0});(n?pr:dr)(r,r)}function gr(e){return Math.max(0,Math.min(e,Dt.size-1))}function yr(e){if(e.line<0)return{line:0,ch:0};if(e.line>=Dt.size)return{line:Dt.size-1,ch:mn(Dt.size-1).text.length};var t=e.ch,n=mn(e.line).text.length;return t==null||t>n?{line:e.line,ch:n}:t<0?{line:e.line,ch:0}:e}function br(e,t){function o(){for(var t=r+e,n=e<0?-1:Dt.size;t!=n;t+=e){var i=mn(t);if(!i.hidden)return r=t,s=i,!0}}function u(t){if(i==(e<0?0:s.text.length)){if(!!t||!o())return!1;i=e<0?s.text.length:0}else i+=e;return!0}var n=Bt.inverted?Bt.from:Bt.to,r=n.line,i=n.ch,s=mn(r);if(t=="char")u();else if(t=="column")u(!0);else if(t=="word"){var a=!1;for(;;){if(e<0&&!u())break;if(Tt(s.text.charAt(i)))a=!0;else if(a){e<0&&(e=1,u());break}if(e>0&&!u())break}}return{line:r,ch:i}}function wr(e,t){var n=e<0?Bt.from:Bt.to;if(jt||vt(Bt.from,Bt.to))n=br(e,t);mr(n.line,n.ch,!0)}function Er(e,t){vt(Bt.from,Bt.to)?e<0?Xn("",br(e,t),Bt.to):Xn("",Bt.from,br(e,t)):Xn("",Bt.from,Bt.to),Vt=!0}function Sr(e,t){var n=0,r=zr(Bt.inverted?Bt.from:Bt.to,!0);an!=null&&(r.x=an);if(t=="page")var i=Math.min(Et.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Wr(r.x,r.y+i*e);else if(t=="line")var o=Kr(),s=Wr(r.x,r.y+.5*o+e*o);t=="page"&&(M.scrollTop+=zr(s,!0).y-r.y),mr(s.line,s.ch,!0),an=r.x}function xr(e){var t=mn(e.line).text,n=e.ch,r=e.ch;if(t){e.after===!1||r==t.length?--n:++r;var i=t.charAt(n),s=Tt(i)?Tt:/\s/.test(i)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&Tt(e)};while(n>0&&s(t.charAt(n-1)))--n;while(r<t.length&&s(t.charAt(r)))++r}return{from:{line:e.line,ch:n},to:{line:e.line,ch:r}}}function Tr(e){pr({line:e,ch:0},yr({line:e+1,ch:0}))}function Nr(e){if(vt(Bt.from,Bt.to))return Cr(Bt.from.line,e);var t=Bt.to.line-(Bt.to.ch?0:1);for(var n=Bt.from.line;n<=t;++n)Cr(n,e)}function Cr(e,t){t||(t="add");if(t=="smart")if(!_t.indent)t="prev";else var n=ai(e);var r=mn(e),i=r.indentation(s.tabSize),o=r.text.match(/^\s*/)[0],u;t=="smart"&&(u=_t.indent(n,r.text.slice(o.length),r.text),u==it&&(t="prev")),t=="prev"?e?u=mn(e-1).indentation(s.tabSize):u=0:t=="add"?u=i+s.indentUnit:t=="subtract"&&(u=i-s.indentUnit),u=Math.max(0,u);var a=u-i,f="",l=0;if(s.indentWithTabs)for(var c=Math.floor(u/s.tabSize);c;--c)l+=s.tabSize,f+=" ";l<u&&(f+=ht(u-l)),f!=o&&Xn(f,{line:e,ch:0},{line:e,ch:o.length}),r.stateAfter=null}function kr(){_t=e.getMode(s,s.mode),Dt.iter(0,Dt.size,function(e){e.stateAfter=null}),Pt=0,li(100)}function Lr(){var e=s.gutter||s.lineNumbers;ut.style.display=e?"":"none",e?Qt=!0:_.parentNode.style.marginLeft=0}function Ar(e,t){if(s.lineWrapping){Lt.className+=" CodeMirror-wrap";var n=Et.clientWidth/Yr()-3;Dt.iter(0,Dt.size,function(e){if(e.hidden)return;var t=Math.ceil(e.text.length/n)||1;t!=1&&gn(e,t)}),G.style.minWidth=I.style.left=""}else Lt.className=Lt.className.replace(" CodeMirror-wrap",""),Wn(),Dt.iter(0,Dt.size,function(e){e.height!=1&&!e.hidden&&gn(e,1)});$t.push({from:0,to:Dt.size})}function Or(){Et.className=Et.className.replace(/\s*cm-s-\S+/g,"")+s.theme.replace(/(^|\s)\s*/g," cm-s-")}function Mr(){var e=l[s.keyMap].style;Lt.className=Lt.className.replace(/\s*cm-keymap-\S+/g,"")+(e?" cm-keymap-"+e:"")}function _r(e,t){this.lines=[],this.type=e,t&&(this.style=t)}function Dr(e,t,n,r){e=yr(e),t=yr(t);var i=new _r("range",n);if(r)for(var s in r)r.hasOwnProperty(s)&&(i[s]=r[s]);var o=e.line;return Dt.iter(o,t.line+1,function(n){var r={from:o==e.line?e.ch:null,to:o==t.line?t.ch:null,marker:i};n.markedSpans=(n.markedSpans||[]).concat([r]),i.lines.push(n),++o}),$t.push({from:e.line,to:t.line+1}),i}function Pr(e){e=yr(e);var t=new _r("bookmark"),n=mn(e.line);fn.addChange(e.line,1,[B(n.text,n.markedSpans)],!0);var r={from:e.ch,to:e.ch,marker:t};return n.markedSpans=(n.markedSpans||[]).concat([r]),t.lines.push(n),t}function Hr(e){e=yr(e);var t=[],n=mn(e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker)}return t}function Br(e,t,n){return typeof e=="number"&&(e=mn(gr(e))),e.gutterMarker={text:t,style:n},Qt=!0,e}function jr(e){typeof e=="number"&&(e=mn(gr(e))),e.gutterMarker=null,Qt=!0}function Fr(e,t){var n=e,r=e;return typeof e=="number"?r=mn(gr(e)):n=W(e),n==null?null:t(r,n)?($t.push({from:n,to:n+1}),r):null}function Ir(e,t,n){return Fr(e,function(e){if(e.className!=t||e.bgClassName!=n)return e.className=t,e.bgClassName=n,!0})}function qr(e,t){return Fr(e,function(e,n){if(e.hidden!=t){e.hidden=t,s.lineWrapping||(t&&e.text.length==rn.text.length?sn=!0:!t&&e.text.length>rn.text.length&&(rn=e,sn=!1)),gn(e,t?0:1);var r=Bt.from.line,i=Bt.to.line;if(t&&(r==n||i==n)){var o=r==n?vr({line:r,ch:0},r,0):Bt.from,u=i==n?vr({line:i,ch:0},i,0):Bt.to;if(!u)return;dr(o,u)}return Qt=!0}})}function Rr(e){if(typeof e=="number"){if(!dn(e))return null;var t=e;e=mn(e);if(!e)return null}else{var t=W(e);if(t==null)return null}var n=e.gutterMarker;return{line:t,handle:e,text:e.text,markerText:n&&n.text,markerClass:n&&n.style,lineClass:e.className,bgClass:e.bgClassName}}function Ur(e,t){if(t==0)return{top:0,left:0};var n=yn(e,t);wt(J,n);var r=n.anchor,i=r.offsetTop,s=r.offsetLeft;if(v&&i==0&&s==0){var o=yt("span","x");r.parentNode.insertBefore(o,r.nextSibling),i=o.offsetTop}return{top:i,left:s}}function zr(e,t){var n,r=Kr(),i=r*(V(Dt,e.line)-(t?Yt:0));if(e.ch==0)n=0;else{var o=Ur(mn(e.line),e.ch);n=o.left,s.lineWrapping&&(i+=Math.max(0,o.top))}return{x:n,y:i,yBot:i+r}}function Wr(e,t){function h(e){var t=Ur(u,e);if(f){var r=Math.round(t.top/n);return c=r!=l,Math.max(0,t.left+(r-l)*Et.clientWidth)}return t.left}var n=Kr(),r=Yr(),i=Yt+Math.floor(t/n);if(i<0)return{line:0,ch:0};var o=X(Dt,i);if(o>=Dt.size)return{line:Dt.size-1,ch:mn(Dt.size-1).text.length};var u=mn(o),a=u.text,f=s.lineWrapping,l=f?i-V(Dt,o):0;if(e<=0&&l==0)return{line:o,ch:0};var c=!1,p=0,d=0,v=a.length,m,g=Math.min(v,Math.ceil((e+l*Et.clientWidth*.9)/r));for(;;){var y=h(g);if(!(y<=e&&g<v)){m=y,v=g;break}g=Math.min(v,Math.ceil(g*1.2))}if(e>m)return{line:o,ch:v};g=Math.floor(v*.8),y=h(g),y<e&&(p=g,d=y);for(;;){if(v-p<=1){var b=e-d<m-e;return{line:o,ch:b?p:v,after:b}}var w=Math.ceil((p+v)/2),E=h(w);E>e?(v=w,m=E,c&&(m+=1e3)):(p=w,d=E)}}function Xr(e){var t=zr(e,!0),n=ft(G);return{x:n.left+t.x,y:n.top+t.y,yBot:n.top+t.yBot}}function Kr(){if(Jr==null){Jr=yt("pre");for(var e=0;e<49;++e)Jr.appendChild(document.createTextNode("x")),Jr.appendChild(yt("br"));Jr.appendChild(document.createTextNode("x"))}var t=_.clientHeight;return t==$r?Vr:($r=t,wt(J,Jr.cloneNode(!0)),Vr=J.firstChild.offsetHeight/50||1,bt(J),Vr)}function Yr(){if(Et.clientWidth==Gr)return Qr;Gr=Et.clientWidth;var e=yt("span","x"),t=yt("pre",[e]);return wt(J,t),Qr=e.offsetWidth||10}function Zr(){return G.offsetTop}function ei(){return G.offsetLeft}function ti(e,t){var n=ft(Et,!0),r,i;try{r=e.clientX,i=e.clientY}catch(e){return null}if(!t&&(r-n.left>Et.clientWidth||i-n.top>Et.clientHeight))return null;var s=ft(G,!0);return Wr(r-s.left,i-s.top)}function ri(e){function i(){k.style.position="relative",S.style.cssText=r,g&&(M.scrollTop=n),Qn();if(S.selectionStart!=null){clearTimeout(ni);var e=S.value=" "+(vt(Bt.from,Bt.to)?"":S.value),t=0;Yn=" ",S.selectionStart=1,S.selectionEnd=e.length,ni=setTimeout(function i(){Yn==" "&&S.selectionStart==0?di(f.selectAll)(vn):t++<10?ni=setTimeout(i,500):er()},200)}}var t=ti(e),n=M.scrollTop;if(!t||E)return;(vt(Bt.from,Bt.to)||mt(t,Bt.from)||!mt(t,Bt.to))&&di(mr)(t.line,t.ch);var r=S.style.cssText;k.style.position="absolute",S.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: white; "+"border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",tr(),er(!0),vt(Bt.from,Bt.to)&&(S.value=Yn=" ");if(d){Y(e);var s=nt(window,"mouseup",function(){s(),setTimeout(i,20)},!0)}else setTimeout(i,50)}function ii(){clearInterval(Mt);var e=!0;F.style.visibility="",Mt=setInterval(function(){F.style.visibility=(e=!e)?"":"hidden"},s.cursorBlinkRate)}function oi(e){function v(e,t,n){if(!e.text)return;var r=e.styles,i=o?0:e.text.length-1,s;for(var a=o?0:r.length-2,f=o?r.length:-2;a!=f;a+=2*u){var l=r[a];if(r[a+1]!=h){i+=u*l.length;continue}for(var c=o?0:l.length-1,v=o?l.length:-1;c!=v;c+=u,i+=u)if(i>=t&&i<n&&d.test(s=l.charAt(c))){var m=si[s];if(m.charAt(1)==">"==o)p.push(s);else{if(p.pop()!=m.charAt(0))return{pos:i,match:!1};if(!p.length)return{pos:i,match:!0}}}}}var t=Bt.inverted?Bt.from:Bt.to,n=mn(t.line),r=t.ch-1,i=r>=0&&si[n.text.charAt(r)]||si[n.text.charAt(++r)];if(!i)return;var s=i.charAt(0),o=i.charAt(1)==">",u=o?1:-1,a=n.styles;for(var f=r+1,l=0,c=a.length;l<c;l+=2)if((f-=a[l].length)<=0){var h=a[l+1];break}var p=[n.text.charAt(r)],d=/[(){}[\]]/;for(var l=t.line,c=o?Math.min(l+100,Dt.size):Math.max(-1,l-100);l!=c;l+=u){var n=mn(l),m=l==t.line,g=v(n,m&&o?r+1:0,m&&!o?r:n.text.length);if(g)break}g||(g={pos:null,match:!1});var h=g.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",y=Dr({line:t.line,ch:r},{line:t.line,ch:r+1},h),b=g.pos!=null&&Dr({line:l,ch:g.pos},{line:l,ch:g.pos+1},h),w=di(function(){y.clear(),b&&b.clear()});e?setTimeout(w,800):nn=w}function ui(e){var t,n;for(var r=e,i=e-40;r>i;--r){if(r==0)return 0;var o=mn(r-1);if(o.stateAfter)return r;var u=o.indentation(s.tabSize);if(n==null||t>u)n=r-1,t=u}return n}function ai(e){var t=ui(e),n=t&&mn(t-1).stateAfter;return n?n=N(_t,n):n=C(_t),Dt.iter(t,e,function(r){r.process(_t,n,s.tabSize),r.stateAfter=t==e-1||t%5==0?N(_t,n):null}),n}function fi(){if(Pt>=en)return;var e=+(new Date)+s.workTime,t=N(_t,ai(Pt)),n=Pt;Dt.iter(Pt,en,function(n){Pt>=Zt?(n.highlight(_t,t,s.tabSize),n.stateAfter=N(_t,t)):(n.process(_t,t,s.tabSize),n.stateAfter=Pt%5==0?N(_t,t):null),++Pt;if(+(new Date)>e)return li(s.workDelay),!0}),en>n&&Pt>=Zt&&di(function(){$t.push({from:n,to:Pt})})()}function li(e){Pt<en&&Ot.set(e,fi)}function ci(){Xt=Vt=Jt=null,$t=[],Kt=!1,Gt=[]}function hi(){sn&&Wn();if(on&&!s.lineWrapping){var e=I.offsetWidth,t=Ur(rn,rn.text.length).left;m||(I.style.left=t+"px",G.style.minWidth=t+e+"px"),on=!1}var n,r;if(Kt){var i=rr();n=sr(i.x,i.y,i.x,i.yBot)}if($t.length||n&&n.scrollTop!=null)r=ur($t,!0,n&&n.scrollTop);r||(Kt&&cr(),Qt&&lr()),n&&nr(),Kt&&ii(),Ht&&(Xt===!0||Xt!==!1&&Kt)&&er(Vt),Kt&&s.matchBrackets&&setTimeout(di(function(){nn&&(nn(),nn=null),vt(Bt.from,Bt.to)&&oi(!1)}),20);var o=Kt,u=Gt;Jt&&s.onChange&&vn&&s.onChange(vn,Jt),o&&s.onCursorActivity&&s.onCursorActivity(vn);for(var a=0;a<u.length;++a)u[a](vn);r&&s.onUpdate&&s.onUpdate(vn)}function di(e){return function(){pi++||ci();try{var t=e.apply(this,arguments)}finally{--pi||hi()}return t}}function vi(e){fn.startCompound();try{return e()}finally{fn.endCompound()}}var s={},a=e.defaults;for(var w in a)a.hasOwnProperty(w)&&(s[w]=(i&&i.hasOwnProperty(w)?i:a)[w]);var S=yt("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em");S.setAttribute("wrap","off"),S.setAttribute("autocorrect","off"),S.setAttribute("autocapitalize","off");var k=yt("div",[S],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),L=yt("div",null,"CodeMirror-scrollbar-inner"),M=yt("div",[L],"CodeMirror-scrollbar"),_=yt("div"),j=yt("div",null,null,"position: relative; z-index: -1"),F=yt("pre"," ","CodeMirror-cursor"),I=yt("pre"," ","CodeMirror-cursor","visibility: hidden"),J=yt("div",null,null,"position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden;"),G=yt("div",[J,F,I,j,_],null,"position: relative; z-index: 0"),ot=yt("div",null,"CodeMirror-gutter-text"),ut=yt("div",[ot],"CodeMirror-gutter"),at=yt("div",[ut,yt("div",[G],"CodeMirror-lines")],null,"position: relative"),ct=yt("div",[at],null,"position: relative"),Et=yt("div",[ct],"CodeMirror-scroll");Et.setAttribute("tabIndex","-1");var Lt=yt("div",[k,M,Et],"CodeMirror"+(s.lineWrapping?" CodeMirror-wrap":""));r.appendChild?r.appendChild(Lt):r(Lt),Or(),Mr(),t&&(S.style.width="0px"),b||(Et.draggable=!0),G.style.outline="none",s.tabindex!=null&&(S.tabIndex=s.tabindex),s.autofocus&&tr(),!s.gutter&&!s.lineNumbers&&(ut.style.display="none"),x&&(k.style.height="1px",k.style.position="absolute"),T?(M.style.zIndex=-2,M.style.visibility="hidden"):m&&(M.style.minWidth="18px");var At=new rt,Ot=new rt,Mt,_t,Dt=new U([new R([new q("")])]),Pt=0,Ht;kr();var Bt={from:{line:0,ch:0},to:{line:0,ch:0},inverted:!1},jt,Ft,It,qt=0,Rt,Ut=!1,zt=!1,Wt=!1,Xt,Vt,$t,Jt,Kt,Qt,Gt,Yt=0,Zt=0,en=0,tn=0,nn,rn=mn(0),sn=!1,on=!0,un=!1,an=null;di(function(){bn(s.value||""),Xt=!1})();var fn=new $;nt(Et,"mousedown",di(xn)),nt(Et,"dblclick",di(Tn)),nt(G,"selectstart",Q),d||nt(Et,"contextmenu",ri),nt(Et,"scroll",Sn),nt(M,"scroll",En),nt(M,"mousedown",function(){Ht&&setTimeout(tr,0)});var ln=nt(window,"resize",function(){Lt.parentNode?ur(!0):ln()},!0);nt(S,"keyup",di(Pn)),nt(S,"input",Gn),nt(S,"keydown",di(_n)),nt(S,"keypress",di(Dn)),nt(S,"focus",Hn),nt(S,"blur",Bn),s.dragDrop&&(nt(Et,"dragstart",Cn),nt(Et,"dragenter",cn),nt(Et,"dragover",cn),nt(Et,"drop",di(Nn))),nt(Et,"paste",function(){tr(),Gn()}),nt(S,"paste",function(){Wt=!0,Gn()}),nt(S,"cut",di(function(){s.readOnly||Vn("")})),x&&nt(ct,"mouseup",function(){document.activeElement==S&&S.blur(),tr()});var hn;try{hn=document.activeElement==S}catch(pn){}hn||s.autofocus?setTimeout(Hn,20):Bn();var vn=Lt.CodeMirror={getValue:wn,setValue:di(bn),getSelection:Kn,replaceSelection:di(Vn),focus:function(){window.focus(),tr(),Hn(),Gn()},setOption:function(e,t){var n=s[e];s[e]=t,e=="mode"||e=="indentUnit"?kr():e=="readOnly"&&t=="nocursor"?(Bn(),S.blur()):e=="readOnly"&&!t?er(!0):e=="theme"?Or():e=="lineWrapping"&&n!=t?di(Ar)():e=="tabSize"?ur(!0):e=="keyMap"?Mr():e=="tabindex"&&(S.tabIndex=t);if(e=="lineNumbers"||e=="gutter"||e=="firstLineNumber"||e=="theme"||e=="lineNumberFormatter")Lr(),ur(!0)},getOption:function(e){return s[e]},getMode:function(){return _t},undo:di(In),redo:di(qn),indentLine:di(function(e,t){typeof t!="string"&&(t==null?t=s.smartIndent?"smart":"prev":t=t?"add":"subtract"),dn(e)&&Cr(e,t)}),indentSelection:di(Nr),historySize:function(){return{undo:fn.done.length,redo:fn.undone.length}},clearHistory:function(){fn=new $},setHistory:function(e){fn=new $,fn.done=e.done,fn.undone=e.undone},getHistory:function(){function e(e){for(var t=0,n=[],r;t<e.length;++t){n.push(r=[]);for(var i=0,s=e[t];i<s.length;++i){var o=[],u=s[i];r.push({start:u.start,added:u.added,old:o});for(var a=0;a<u.old.length;++a)o.push(P(u.old[a]))}}return n}return{done:e(fn.done),undone:e(fn.undone)}},matchBrackets:di(function(){oi(!0)}),getTokenAt:di(function(e){return e=yr(e),mn(e.line).getTokenAt(_t,ai(e.line),s.tabSize,e.ch)}),getStateAfter:function(e){return e=gr(e==null?Dt.size-1:e),ai(e+1)},cursorCoords:function(e,t){return e==null&&(e=Bt.inverted),this.charCoords(e?Bt.from:Bt.to,t)},charCoords:function(e,t){return e=yr(e),t=="local"?zr(e,!1):t=="div"?zr(e,!0):Xr(e)},coordsChar:function(e){var t=ft(G);return Wr(e.x-t.left,e.y-t.top)},markText:di(Dr),setBookmark:Pr,findMarksAt:Hr,setMarker:di(Br),clearMarker:di(jr),setLineClass:di(Ir),hideLine:di(function(e){return qr(e,!0)}),showLine:di(function(e){return qr(e,!1)}),onDeleteLine:function(e,t){if(typeof e=="number"){if(!dn(e))return null;e=mn(e)}return(e.handlers||(e.handlers=[])).push(t),e},lineInfo:Rr,getViewport:function(){return{from:Zt,to:en}},addWidget:function(e,t,n,r,i){e=zr(yr(e));var s=e.yBot,o=e.x;t.style.position="absolute",ct.appendChild(t);if(r=="over")s=e.y;else if(r=="near"){var u=Math.max(Et.offsetHeight,Dt.height*Kr()),a=Math.max(ct.clientWidth,G.clientWidth)-ei();e.yBot+t.offsetHeight>u&&e.y>t.offsetHeight&&(s=e.y-t.offsetHeight),o+t.offsetWidth>a&&(o=a-t.offsetWidth)}t.style.top=s+Zr()+"px",t.style.left=t.style.right="",i=="right"?(o=ct.clientWidth-t.offsetWidth,t.style.right="0px"):(i=="left"?o=0:i=="middle"&&(o=(ct.clientWidth-t.offsetWidth)/2),t.style.left=o+ei()+"px"),n&&ir(o,s,o+t.offsetWidth,s+t.offsetHeight)},lineCount:function(){return Dt.size},clipPos:yr,getCursor:function(e){return e==null&&(e=Bt.inverted),gt(e?Bt.from:Bt.to)},somethingSelected:function(){return!vt(Bt.from,Bt.to)},setCursor:di(function(e,t,n){t==null&&typeof e.line=="number"?mr(e.line,e.ch,n):mr(e,t,n)}),setSelection:di(function(e,t,n){(n?pr:dr)(yr(e),yr(t||e))}),getLine:function(e){if(dn(e))return mn(e).text},getLineHandle:function(e){if(dn(e))return mn(e)},setLine:di(function(e,t){dn(e)&&Xn(t,{line:e,ch:0},{line:e,ch:mn(e).text.length})}),removeLine:di(function(e){dn(e)&&Xn("",{line:e,ch:0},yr({line:e+1,ch:0}))}),replaceRange:di(Xn),getRange:function(e,t,n){return Jn(yr(e),yr(t),n)},triggerOnKeyDown:di(_n),execCommand:function(e){return f[e](vn)},moveH:di(wr),deleteH:di(Er),moveV:di(Sr),toggleOverwrite:function(){Ut?(Ut=!1,F.className=F.className.replace(" CodeMirror-overwrite","")):(Ut=!0,F.className+=" CodeMirror-overwrite")},posFromIndex:function(e){var t=0,n;return Dt.iter(0,Dt.size,function(r){var i=r.text.length+1;if(i>e)return n=e,!0;e-=i,++t}),yr({line:t,ch:n})},indexFromPos:function(e){if(e.line<0||e.ch<0)return 0;var t=e.ch;return Dt.iter(0,e.line,function(e){t+=e.text.length+1}),t},scrollTo:function(e,t){e!=null&&(Et.scrollLeft=e),t!=null&&(M.scrollTop=Et.scrollTop=t),ur([])},getScrollInfo:function(){return{x:Et.scrollLeft,y:M.scrollTop,height:M.scrollHeight,width:Et.scrollWidth}},setSize:function(e,t){function n(e){return e=String(e),/^\d+$/.test(e)?e+"px":e}e!=null&&(Lt.style.width=n(e)),t!=null&&(Et.style.height=n(t)),vn.refresh()},operation:function(e){return di(e)()},compoundChange:function(e){return vi(e)},refresh:function(){ur(!0,null,qt),M.scrollHeight>qt&&(M.scrollTop=qt)},getInputField:function(){return S},getWrapperElement:function(){return Lt},getScrollerElement:function(){return Et},getGutterElement:function(){return ut}},Ln,Mn=null,Yn="";_r.prototype.clear=di(function(){var e,t;for(var n=0;n<this.lines.length;++n){var r=this.lines[n],i=A(r.markedSpans,this);i.from!=null&&(e=W(r)),i.to!=null&&(t=W(r)),r.markedSpans=O(r.markedSpans,i)}e!=null&&$t.push({from:e,to:t+1}),this.lines.length=0,this.explicitlyCleared=!0}),_r.prototype.find=function(){var e,t;for(var n=0;n<this.lines.length;++n){var r=this.lines[n],i=A(r.markedSpans,this);if(i.from!=null||i.to!=null){var s=W(r);i.from!=null&&(e={line:s,ch:i.from}),i.to!=null&&(t={line:s,ch:i.to})}}return this.type=="bookmark"?e:e&&{from:e,to:t}};var Vr,$r,Jr,Qr,Gr=0,ni,si={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},pi=0;for(var mi in o)o.propertyIsEnumerable(mi)&&!vn.propertyIsEnumerable(mi)&&(vn[mi]=o[mi]);for(var gi=0;gi<u.length;++gi)u[gi](vn);return vn}function c(e){return typeof e=="string"?l[e]:e}function h(e,t,n,r,i){function s(t){t=c(t);var n=t[e];if(n===!1)return i&&i(),!0;if(n!=null&&r(n))return!0;if(t.nofallthrough)return i&&i(),!0;var o=t.fallthrough;if(o==null)return!1;if(Object.prototype.toString.call(o)!="[object Array]")return s(o);for(var u=0,a=o.length;u<a;++u)if(s(o[u]))return!0;return!1}return t&&s(t)?!0:s(n)}function p(e){var t=kt[tt(e,"keyCode")];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function N(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function C(e,t,n){return e.startState?e.startState(t,n):!0}function k(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8}function L(e,t,n){this.from=e,this.to=t,this.marker=n}function A(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function O(e,t){var n;for(var r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function M(e,t,n){if(e)for(var r=0,i;r<e.length;++r){var s=e[r],o=s.marker,u=s.from==null||(o.inclusiveLeft?s.from<=t:s.from<t);if(u||o.type=="bookmark"&&s.from==t&&s.from!=n){var a=s.to==null||(o.inclusiveRight?s.to>=t:s.to>t);(i||(i=[])).push({from:s.from,to:a?null:s.to,marker:o})}}return i}function _(e,t){if(e)for(var n=0,r;n<e.length;++n){var i=e[n],s=i.marker,o=i.to==null||(s.inclusiveRight?i.to>=t:i.to>t);if(o||s.type=="bookmark"&&i.from==t){var u=i.from==null||(s.inclusiveLeft?i.from<=t:i.from<t);(r||(r=[])).push({from:u?null:i.from-t,to:i.to==null?null:i.to-t,marker:s})}}return r}function D(e,t,n,r,i){if(!e&&!t)return i;var s=M(e,n),o=_(t,r),u=i.length==1,a=pt(i).length+(u?n:0);if(s)for(var f=0;f<s.length;++f){var l=s[f];if(l.to==null){var c=A(o,l.marker);c?u&&(l.to=c.to==null?null:c.to+a):l.to=n}}if(o)for(var f=0;f<o.length;++f){var l=o[f];l.to!=null&&(l.to+=a);if(l.from==null){var c=A(s,l.marker);c||(l.from=a,u&&(s||(s=[])).push(l))}else l.from+=a,u&&(s||(s=[])).push(l)}var h=[B(i[0],s)];if(!u){var p=i.length-2,d;if(p>0&&s)for(var f=0;f<s.length;++f)s[f].to==null&&(d||(d=[])).push({from:null,to:null,marker:s[f].marker});for(var f=0;f<p;++f)h.push(B(i[f+1],d));h.push(B(pt(i),o))}return h}function P(e){return typeof e=="string"?e:e.text}function H(e){if(typeof e=="string")return null;var t=e.markedSpans,n=null;for(var r=0;r<t.length;++r)t[r].marker.explicitlyCleared?n||(n=t.slice(0,r)):n&&n.push(t[r]);return n?n.length?n:null:t}function B(e,t){return t?{text:e,markedSpans:t}:e}function j(e){var t=e.markedSpans;if(!t)return;for(var n=0;n<t.length;++n){var r=t[n].marker.lines,i=xt(r,e);r.splice(i,1)}e.markedSpans=null}function F(e,t){if(!t)return;for(var n=0;n<t.length;++n)var r=t[n].marker.lines.push(e);e.markedSpans=t}function q(e,t){this.text=e,this.height=1,F(this,t)}function R(e){this.lines=e,this.parent=null;for(var t=0,n=e.length,r=0;t<n;++t)e[t].parent=this,r+=e[t].height;this.height=r}function U(e){this.children=e;var t=0,n=0;for(var r=0,i=e.length;r<i;++r){var s=e[r];t+=s.chunkSize(),n+=s.height,s.parent=this}this.size=t,this.height=n,this.parent=null}function z(e,t){while(!e.lines)for(var n=0;;++n){var r=e.children[n],i=r.chunkSize();if(t<i){e=r;break}t-=i}return e.lines[t]}function W(e){if(e.parent==null)return null;var t=e.parent,n=xt(t.lines,e);for(var r=t.parent;r;t=r,r=r.parent)for(var i=0,s=r.children.length;;++i){if(r.children[i]==t)break;n+=r.children[i].chunkSize()}return n}function X(e,t){var n=0;e:do{for(var r=0,i=e.children.length;r<i;++r){var s=e.children[r],o=s.height;if(t<o){e=s;continue e}t-=o,n+=s.chunkSize()}return n}while(!e.lines);for(var r=0,i=e.lines.length;r<i;++r){var u=e.lines[r],a=u.height;if(t<a)break;t-=a}return n+r}function V(e,t){var n=0;e:do{for(var r=0,i=e.children.length;r<i;++r){var s=e.children[r],o=s.chunkSize();if(t<o){e=s;continue e}t-=o,n+=s.height}return n}while(!e.lines);for(var r=0;r<t;++r)n+=e.lines[r].height;return n}function $(){this.time=0,this.done=[],this.undone=[],this.compound=0,this.closed=!1}function J(){Y(this)}function K(e){return e.stop||(e.stop=J),e}function Q(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function G(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Y(e){Q(e),G(e)}function Z(e){return e.target||e.srcElement}function et(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),n&&e.ctrlKey&&t==1&&(t=3),t}function tt(e,t){var n=e.override&&e.override.hasOwnProperty(t);return n?e.override[t]:e[t]}function nt(e,t,n,r){if(typeof e.addEventListener=="function"){e.addEventListener(t,n,!1);if(r)return function(){e.removeEventListener(t,n,!1)}}else{var i=function(e){n(e||window.event)};e.attachEvent("on"+t,i);if(r)return function(){e.detachEvent("on"+t,i)}}}function rt(){this.id=null}function at(e,t,n){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var r=0,i=0;r<t;++r)e.charAt(r)==" "?i+=n-i%n:++i;return i}function ft(e,t){try{var n=e.getBoundingClientRect();n={top:n.top,left:n.left}}catch(r){n={top:0,left:0}}if(!t)if(window.pageYOffset==null){var i=document.documentElement||document.body.parentNode;i.scrollTop==null&&(i=document.body),n.top+=i.scrollTop,n.left+=i.scrollLeft}else n.top+=window.pageYOffset,n.left+=window.pageXOffset;return n}function lt(e){return e.textContent||e.innerText||e.nodeValue||""}function ht(e){while(ct.length<=e)ct.push(pt(ct)+" ");return ct[e]}function pt(e){return e[e.length-1]}function dt(e){t?(e.selectionStart=0,e.selectionEnd=e.value.length):e.select()}function vt(e,t){return e.line==t.line&&e.ch==t.ch}function mt(e,t){return e.line<t.line||e.line==t.line&&e.ch<t.ch}function gt(e){return{line:e.line,ch:e.ch}}function yt(e,t,n,r){var i=document.createElement(e);n&&(i.className=n),r&&(i.style.cssText=r);if(typeof t=="string")Et(i,t);else if(t)for(var s=0;s<t.length;++s)i.appendChild(t[s]);return i}function bt(e){return e.innerHTML="",e}function wt(e,t){bt(e).appendChild(t)}function Et(e,t){g?(e.innerHTML="",e.appendChild(document.createTextNode(t))):e.textContent=t}function St(e,t){if(!t)return 0;if(!e)return t.length;for(var n=e.length,r=t.length;n>=0&&r>=0;--n,--r)if(e.charAt(n)!=t.charAt(r))break;return r+1}function xt(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;++n)if(e[n]==t)return n;return-1}function Tt(e){return/\w/.test(e)||e.toUpperCase()!=e.toLowerCase()||/[\u4E00-\u9FA5]/.test(e)}e.defaults={value:"",mode:null,theme:"default",indentUnit:2,indentWithTabs:!1,smartIndent:!0,tabSize:4,keyMap:"default",extraKeys:null,electricChars:!0,autoClearEmptyLines:!1,onKeyEvent:null,onDragEvent:null,lineWrapping:!1,lineNumbers:!1,gutter:!1,fixedGutter:!1,firstLineNumber:1,readOnly:!1,dragDrop:!0,onChange:null,onCursorActivity:null,onViewportChange:null,onGutterClick:null,onUpdate:null,onFocus:null,onBlur:null,onScroll:null,matchBrackets:!1,cursorBlinkRate:530,workTime:100,workDelay:200,pollInterval:100,undoDepth:40,tabindex:null,autofocus:null,lineNumberFormatter:function(e){return e}};var t=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),n=t||/Mac/.test(navigator.platform),r=/Win/.test(navigator.platform),i=e.modes={},s=e.mimeModes={};e.defineMode=function(t,n){!e.defaults.mode&&t!="null"&&(e.defaults.mode=t);if(arguments.length>2){n.dependencies=[];for(var r=2;r<arguments.length;++r)n.dependencies.push(arguments[r])}i[t]=n},e.defineMIME=function(e,t){s[e]=t},e.resolveMode=function(t){if(typeof t=="string"&&s.hasOwnProperty(t))t=s[t];else if(typeof t=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return typeof t=="string"?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=i[n.name];if(!r)return e.getMode(t,"text/plain");var s=r(t,n);if(a.hasOwnProperty(n.name)){var o=a[n.name];for(var u in o)o.hasOwnProperty(u)&&(s[u]=o[u])}return s.name=n.name,s},e.listModes=function(){var e=[];for(var t in i)i.propertyIsEnumerable(t)&&e.push(t);return e},e.listMIMEs=function(){var e=[];for(var t in s)s.propertyIsEnumerable(t)&&e.push({mime:t,mode:s[t]});return e};var o=e.extensions={};e.defineExtension=function(e,t){o[e]=t};var u=[];e.defineInitHook=function(e){u.push(e)};var a=e.modeExtensions={};e.extendMode=function(e,t){var n=a.hasOwnProperty(e)?a[e]:a[e]={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r])};var f=e.commands={selectAll:function(e){e.setSelection({line:0,ch:0},{line:e.lineCount()-1})},killLine:function(e){var t=e.getCursor(!0),n=e.getCursor(!1),r=!vt(t,n);!r&&e.getLine(t.line).length==t.ch?e.replaceRange("",t,{line:t.line+1,ch:0}):e.replaceRange("",t,r?n:{line:t.line})},deleteLine:function(e){var t=e.getCursor().line;e.replaceRange("",{line:t,ch:0},{line:t})},undo:function(e){e.undo()},redo:function(e){e.redo()},goDocStart:function(e){e.setCursor(0,0,!0)},goDocEnd:function(e){e.setSelection({line:e.lineCount()-1},null,!0)},goLineStart:function(e){e.setCursor(e.getCursor().line,0,!0)},goLineStartSmart:function(e){var t=e.getCursor(),n=e.getLine(t.line),r=Math.max(0,n.search(/\S/));e.setCursor(t.line,t.ch<=r&&t.ch?0:r,!0)},goLineEnd:function(e){e.setSelection({line:e.getCursor().line},null,!0)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goWordRight:function(e){e.moveH(1,"word")},delCharLeft:function(e){e.deleteH(-1,"char")},delCharRight:function(e){e.deleteH(1,"char")},delWordLeft:function(e){e.deleteH(-1,"word")},delWordRight:function(e){e.deleteH(1,"word")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection(" ","end")},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.replaceSelection(" ","end")},transposeChars:function(e){var t=e.getCursor(),n=e.getLine(t.line);t.ch>0&&t.ch<n.length-1&&e.replaceRange(n.charAt(t.ch)+n.charAt(t.ch-1),{line:t.line,ch:t.ch-1},{line:t.line,ch:t.ch+1})},newlineAndIndent:function(e){e.replaceSelection("\n","end"),e.indentLine(e.getCursor().line)},toggleOverwrite:function(e){e.toggleOverwrite()}},l=e.keyMap={};l.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharRight",Backspace:"delCharLeft",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"},l.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goWordLeft","Ctrl-Right":"goWordRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delWordLeft","Ctrl-Delete":"delWordRight","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore",fallthrough:"basic"},l.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goWordLeft","Alt-Right":"goWordRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delWordLeft","Ctrl-Alt-Backspace":"delWordRight","Alt-Delete":"delWordRight","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore",fallthrough:["basic","emacsy"]},l["default"]=n?l.macDefault:l.pcDefault,l.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageUp","Shift-Ctrl-V":"goPageDown","Ctrl-D":"delCharRight","Ctrl-H":"delCharLeft","Alt-D":"delWordRight","Alt-Backspace":"delWordLeft","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},e.isModifierKey=p,e.fromTextArea=function(t,n){function s(){t.value=a.getValue()}n||(n={}),n.value=t.value,!n.tabindex&&t.tabindex&&(n.tabindex=t.tabindex);if(n.autofocus==null){var r=document.body;try{r=document.activeElement}catch(i){}n.autofocus=r==t||t.getAttribute("autofocus")!=null&&r==document.body}if(t.form){var o=nt(t.form,"submit",s,!0);if(typeof t.form.submit=="function"){var u=t.form.submit;t.form.submit=function f(){s(),t.form.submit=u,t.form.submit(),t.form.submit=f}}}t.style.display="none";var a=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},n);return a.save=s,a.getTextArea=function(){return t},a.toTextArea=function(){s(),t.parentNode.removeChild(a.getWrapperElement()),t.style.display="",t.form&&(o(),typeof t.form.submit=="function"&&(t.form.submit=u))},a};var d=/gecko\/\d{7}/i.test(navigator.userAgent),v=/MSIE \d/.test(navigator.userAgent),m=/MSIE [1-7]\b/.test(navigator.userAgent),g=/MSIE [1-8]\b/.test(navigator.userAgent),y=v&&document.documentMode==5,b=/WebKit\//.test(navigator.userAgent),w=/Chrome\//.test(navigator.userAgent),E=/Opera\//.test(navigator.userAgent),S=/Apple Computer/.test(navigator.vendor),x=/KHTML\//.test(navigator.userAgent),T=/Mac OS X 10\D([7-9]|\d\d)\D/.test(navigator.userAgent);e.copyState=N,e.startState=C,e.innerMode=function(e,t){while(e.innerMode){var n=e.innerMode(t);t=n.state,e=n.mode}return n||{mode:e,state:t}},k.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)||undefined},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(e){var t=this.string.charAt(this.pos);if(typeof e=="string")var n=t==e;else var n=t&&(e.test?e.test(t):e(t));if(n)return++this.pos,t},eatWhile:function(e){var t=this.pos;while(this.eat(e));return this.pos>t},eatSpace:function(){var e=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return at(this.string,this.start,this.tabSize)},indentation:function(){return at(this.string,null,this.tabSize)},match:function(e,t,n){if(typeof e!="string"){var i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&t!==!1&&(this.pos+=i[0].length),i)}var r=function(e){return n?e.toLowerCase():e};if(r(this.string).indexOf(r(e),this.pos)==this.pos)return t!==!1&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)}},e.StringStream=k;var I=" ";d||v&&!m?I="":E&&(I=""),q.prototype={update:function(e,t){this.text=e,this.stateAfter=this.styles=null,j(this),F(this,t)},highlight:function(e,t,n){var r=new k(this.text,n),i=this.styles||(this.styles=[]),s=i.length=0;this.text==""&&e.blankLine&&e.blankLine(t);while(!r.eol()){var o=e.token(r,t),u=r.current();r.start=r.pos,s&&i[s-1]==o?i[s-2]+=u:u&&(i[s++]=u,i[s++]=o);if(r.pos>5e3){i[s++]=this.text.slice(r.pos),i[s++]=null;break}}},process:function(e,t,n){var r=new k(this.text,n);this.text==""&&e.blankLine&&e.blankLine(t);while(!r.eol()&&r.pos<=5e3)e.token(r,t),r.start=r.pos},getTokenAt:function(e,t,n,r){var i=this.text,s=new k(i,n);while(s.pos<r&&!s.eol()){s.start=s.pos;var o=e.token(s,t)}return{start:s.start,end:s.pos,string:s.current(),className:o||null,state:t}},indentation:function(e){return at(this.text,null,e)},getContent:function(e,t,n){function u(t,n,o){if(!n)return;r&&v&&n.charAt(0)==" "&&(n=" "+n.slice(1)),r=!1;if(!s.test(n)){i+=n.length;var u=document.createTextNode(n)}else{var u=document.createDocumentFragment(),a=0;for(;;){s.lastIndex=a;var f=s.exec(n),l=f?f.index-a:n.length-a;l&&(u.appendChild(document.createTextNode(n.slice(a,a+l))),i+=l);if(!f)break;a+=l+1;if(f[0]==" "){var c=e-i%e;u.appendChild(yt("span",ht(c),"cm-tab")),i+=c}else{var h=yt("span","•","cm-invalidchar");h.title="\\u"+f[0].charCodeAt(0).toString(16),u.appendChild(h),i+=1}}}o?t.appendChild(yt("span",[u],o)):t.appendChild(u)}function g(e){return e?"cm-"+e.replace(/ +/g," cm-"):null}var r=!0,i=0,s=/[\t\u0000-\u0019\u200b\u2028\u2029\uFEFF]/g,o=yt("pre"),a=u;if(t!=null){var f=0,l=o.anchor=yt("span");a=function(e,r,i){var s=r.length;if(t>=f&&t<f+s){var o=t-f;if(o){u(e,r.slice(0,o),i);if(n){var c=r.slice(o-1,o+1);ut.test(c)?e.appendChild(yt("wbr")):!m&&/\w\w/.test(c)&&e.appendChild(document.createTextNode(""))}}e.appendChild(l),u(l,E?r.slice(o,o+1):r.slice(o),i),E&&u(e,r.slice(o+1),i),t--,f+=s}else f+=s,u(e,r,i),f==t&&f==d?(Et(l,I),e.appendChild(l)):f>t+10&&/\s/.test(r)&&(a=function(){})}}var c=this.styles,h=this.text,p=this.markedSpans,d=h.length;if(!h&&t==null)a(o," ");else if(!p||!p.length)for(var y=0,b=0;b<d;y+=2){var w=c[y],S=c[y+1],x=w.length;b+x>d&&(w=w.slice(0,d-b)),b+=x,a(o,w,g(S))}else{p.sort(function(e,t){return e.from-t.from});var T=0,y=0,N="",S,C=0,k=p[0].from||0,L=[],A=0,O=function(){var e;while(A<p.length&&((e=p[A]).from==T||e.from==null))e.marker.type=="range"&&L.push(e),++A;k=A<p.length?p[A].from:Infinity;for(var t=0;t<L.length;++t){var n=L[t].to;n==null&&(n=Infinity),n==T?L.splice(t--,1):k=Math.min(n,k)}},M=0;while(T<d){k==T&&O();var _=Math.min(d,k);for(;;){if(N){var D=T+N.length,P=S;for(var H=0;H<L.length;++H){var B=L[H];P=(P?P+" ":"")+B.marker.style,B.marker.endStyle&&B.to===Math.min(D,_)&&(P+=" "+B.marker.endStyle),B.marker.startStyle&&B.from===T&&(P+=" "+B.marker.startStyle)}a(o,D>_?N.slice(0,_-T):N,P);if(D>=_){N=N.slice(_-T),T=_;break}T=D}N=c[y++],S=g(c[y++])}}}return o},cleanUp:function(){this.parent=null,j(this)}},R.prototype={chunkSize:function(){return this.lines.length},remove:function(e,t,n){for(var r=e,i=e+t;r<i;++r){var s=this.lines[r];this.height-=s.height,s.cleanUp();if(s.handlers)for(var o=0;o<s.handlers.length;++o)n.push(s.handlers[o])}this.lines.splice(e,t)},collapse:function(e){e.splice.apply(e,[e.length,0].concat(this.lines))},insertHeight:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0,i=t.length;r<i;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},U.prototype={chunkSize:function(){return this.size},remove:function(e,t,n){this.size-=t;for(var r=0;r<this.children.length;++r){var i=this.children[r],s=i.chunkSize();if(e<s){var o=Math.min(t,s-e),u=i.height;i.remove(e,o,n),this.height-=u-i.height,s==o&&(this.children.splice(r--,1),i.parent=null);if((t-=o)==0)break;e=0}else e-=s}if(this.size-t<25){var a=[];this.collapse(a),this.children=[new R(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0,n=this.children.length;t<n;++t)this.children[t].collapse(e)},insert:function(e,t){var n=0;for(var r=0,i=t.length;r<i;++r)n+=t[r].height;this.insertHeight(e,t,n)},insertHeight:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0,i=this.children.length;r<i;++r){var s=this.children[r],o=s.chunkSize();if(e<=o){s.insertHeight(e,t,n);if(s.lines&&s.lines.length>50){while(s.lines.length>50){var u=s.lines.splice(s.lines.length-25,25),a=new R(u);s.height-=a.height,this.children.splice(r+1,0,a),a.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new U(t);if(!e.parent){var r=new U(e.children);r.parent=e,e.children=[r,n],e=r}else{e.size-=n.size,e.height-=n.height;var i=xt(e.parent.children,e);e.parent.children.splice(i+1,0,n)}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iter:function(e,t,n){this.iterN(e,t-e,n)},iterN:function(e,t,n){for(var r=0,i=this.children.length;r<i;++r){var s=this.children[r],o=s.chunkSize();if(e<o){var u=Math.min(t,o-e);if(s.iterN(e,u,n))return!0;if((t-=u)==0)break;e=0}else e-=o}}},$.prototype={addChange:function(e,t,n){this.undone.length=0;var r=+(new Date),i=pt(this.done),s=i&&pt(i),o=r-this.time;if(i&&!this.closed&&this.compound)i.push({start:e,added:t,old:n});else if(o>400||!s||this.closed||s.start>e+n.length||s.start+s.added<e)this.done.push([{start:e,added:t,old:n}]),this.closed=!1;else{var u=Math.max(0,s.start-e),a=Math.max(0,e+n.length-(s.start+s.added));for(var f=u;f>0;--f)s.old.unshift(n[f-1]);for(var f=a;f>0;--f)s.old.push(n[n.length-f]);u&&(s.start=e),s.added+=t-(n.length-u-a)}this.time=r},startCompound:function(){this.compound++||(this.closed=!0)},endCompound:function(){--this.compound||(this.closed=!0)}},e.e_stop=Y,e.e_preventDefault=Q,e.e_stopPropagation=G,e.connect=nt,rt.prototype={set:function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)}};var it=e.Pass={toString:function(){return"CodeMirror.Pass"}},st=function(){if(g)return!1;var e=yt("div");return"draggable"in e||"dragDrop"in e}(),ot=function(){var e=yt("textarea");return e.value="foo\nbar",e.value.indexOf("\r")>-1?"\r\n":"\n"}(),ut=/^$/;d?ut=/$'/:S?ut=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/:w&&(ut=/\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/);var ct=[""],Nt="\n\nb".split(/\n/).length!=3?function(e){var t=0,n=[],r=e.length;while(t<=r){var i=e.indexOf("\n",t);i==-1&&(i=e.length);var s=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),o=s.indexOf("\r");o!=-1?(n.push(s.slice(0,o)),t+=o+1):(n.push(s),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)};e.splitLines=Nt;var Ct=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0};e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var kt={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",109:"-",107:"=",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};return e.keyNames=kt,function(){for(var e=0;e<10;e++)kt[e+48]=String(e);for(var e=65;e<=90;e++)kt[e]=String.fromCharCode(e);for(var e=1;e<=12;e++)kt[e+111]=kt[e+63235]="F"+e}(),e.version="2.35",e}()
\ No newline at end of file diff --git a/src/main/webapp/javascripts_min/libs/codemirror/mode/mysql/mysql.js b/src/main/webapp/javascripts_min/libs/codemirror/mode/mysql/mysql.js index dcaf25f..fb83573 100644 --- a/src/main/webapp/javascripts_min/libs/codemirror/mode/mysql/mysql.js +++ b/src/main/webapp/javascripts_min/libs/codemirror/mode/mysql/mysql.js @@ -1 +1 @@ -CodeMirror.defineMode("mysql",function(e){function r(e){return new RegExp("^(?:"+e.join("|")+")$","i")}function u(e,t){var r=e.next();n=null;if(r=="$"||r=="?")return e.match(/^[\w\d]*/),"variable-2";if(r=="<"&&!e.match(/^[\s\u00a0=]/,!1))return e.match(/^[^\s\u00a0>]*>?/),"atom";if(r=='"'||r=="'")return t.tokenize=a(r),t.tokenize(e,t);if(r=="`")return t.tokenize=f(r),t.tokenize(e,t);if(/[{}\(\),\.;\[\]]/.test(r))return n=r,null;if(r!="-"){if(o.test(r))return e.eatWhile(o),null;if(r==":")return e.eatWhile(/[\w\d\._\-]/),"atom";e.eatWhile(/[_\w\d]/);if(e.eat(":"))return e.eatWhile(/[\w\d_\-]/),"atom";var u=e.current(),l;return i.test(u)?null:s.test(u)?"keyword":"variable"}ch2=e.next();if(ch2=="-")return e.skipToEnd(),"comment"}function a(e){return function(t,n){var r=!1,i;while((i=t.next())!=null){if(i==e&&!r){n.tokenize=u;break}r=!r&&i=="\\"}return"string"}}function f(e){return function(t,n){var r=!1,i;while((i=t.next())!=null){if(i==e&&!r){n.tokenize=u;break}r=!r&&i=="\\"}return"variable-2"}}function l(e,t,n){e.context={prev:e.context,indent:e.indent,col:n,type:t}}function c(e){e.indent=e.context.indent,e.context=e.context.prev}var t=e.indentUnit,n,i=r(["str","lang","langmatches","datatype","bound","sameterm","isiri","isuri","isblank","isliteral","union","a"]),s=r(["ACCESSIBLE","ALTER","AS","BEFORE","BINARY","BY","CASE","CHARACTER","COLUMN","CONTINUE","CROSS","CURRENT_TIMESTAMP","DATABASE","DAY_MICROSECOND","DEC","DEFAULT","DESC","DISTINCT","DOUBLE","EACH","ENCLOSED","EXIT","FETCH","FLOAT8","FOREIGN","GRANT","HIGH_PRIORITY","HOUR_SECOND","IN","INNER","INSERT","INT2","INT8","INTO","JOIN","KILL","LEFT","LINEAR","LOCALTIME","LONG","LOOP","MATCH","MEDIUMTEXT","MINUTE_SECOND","NATURAL","NULL","OPTIMIZE","OR","OUTER","PRIMARY","RANGE","READ_WRITE","REGEXP","REPEAT","RESTRICT","RIGHT","SCHEMAS","SENSITIVE","SHOW","SPECIFIC","SQLSTATE","SQL_CALC_FOUND_ROWS","STARTING","TERMINATED","TINYINT","TRAILING","UNDO","UNLOCK","USAGE","UTC_DATE","VALUES","VARCHARACTER","WHERE","WRITE","ZEROFILL","ALL","AND","ASENSITIVE","BIGINT","BOTH","CASCADE","CHAR","COLLATE","CONSTRAINT","CREATE","CURRENT_TIME","CURSOR","DAY_HOUR","DAY_SECOND","DECLARE","DELETE","DETERMINISTIC","DIV","DUAL","ELSEIF","EXISTS","FALSE","FLOAT4","FORCE","FULLTEXT","HAVING","HOUR_MINUTE","IGNORE","INFILE","INSENSITIVE","INT1","INT4","INTERVAL","ITERATE","KEYS","LEAVE","LIMIT","LOAD","LOCK","LONGTEXT","MASTER_SSL_VERIFY_SERVER_CERT","MEDIUMINT","MINUTE_MICROSECOND","MODIFIES","NO_WRITE_TO_BINLOG","ON","OPTIONALLY","OUT","PRECISION","PURGE","READS","REFERENCES","RENAME","REQUIRE","REVOKE","SCHEMA","SELECT","SET","SPATIAL","SQLEXCEPTION","SQL_BIG_RESULT","SSL","TABLE","TINYBLOB","TO","TRUE","UNIQUE","UPDATE","USING","UTC_TIMESTAMP","VARCHAR","WHEN","WITH","YEAR_MONTH","ADD","ANALYZE","ASC","BETWEEN","BLOB","CALL","CHANGE","CHECK","CONDITION","CONVERT","CURRENT_DATE","CURRENT_USER","DATABASES","DAY_MINUTE","DECIMAL","DELAYED","DESCRIBE","DISTINCTROW","DROP","ELSE","ESCAPED","EXPLAIN","FLOAT","FOR","FROM","GROUP","HOUR_MICROSECOND","IF","INDEX","INOUT","INT","INT3","INTEGER","IS","KEY","LEADING","LIKE","LINES","LOCALTIMESTAMP","LONGBLOB","LOW_PRIORITY","MEDIUMBLOB","MIDDLEINT","MOD","NOT","NUMERIC","OPTION","ORDER","OUTFILE","PROCEDURE","READ","REAL","RELEASE","REPLACE","RETURN","RLIKE","SECOND_MICROSECOND","SEPARATOR","SMALLINT","SQL","SQLWARNING","SQL_SMALL_RESULT","STRAIGHT_JOIN","THEN","TINYTEXT","TRIGGER","UNION","UNSIGNED","USE","UTC_TIME","VARBINARY","VARYING","WHILE","XOR","FULL","COLUMNS","MIN","MAX","STDEV","COUNT"]),o=/[*+\-<>=&|]/;return{startState:function(e){return{tokenize:u,context:null,indent:0,col:0}},token:function(e,t){e.sol()&&(t.context&&t.context.align==null&&(t.context.align=!1),t.indent=e.indentation());if(e.eatSpace())return null;var r=t.tokenize(e,t);r!="comment"&&t.context&&t.context.align==null&&t.context.type!="pattern"&&(t.context.align=!0);if(n=="(")l(t,")",e.column());else if(n=="[")l(t,"]",e.column());else if(n=="{")l(t,"}",e.column());else if(/[\]\}\)]/.test(n)){while(t.context&&t.context.type=="pattern")c(t);t.context&&n==t.context.type&&c(t)}else n=="."&&t.context&&t.context.type=="pattern"?c(t):/atom|string|variable/.test(r)&&t.context&&(/[\}\]]/.test(t.context.type)?l(t,"pattern",e.column()):t.context.type=="pattern"&&!t.context.align&&(t.context.align=!0,t.context.col=e.column()));return r},indent:function(e,n){var r=n&&n.charAt(0),i=e.context;if(/[\]\}]/.test(r))while(i&&i.type=="pattern")i=i.prev;var s=i&&r==i.type;return i?i.type=="pattern"?i.col:i.align?i.col+(s?0:1):i.indent+(s?0:t):0}}}),CodeMirror.defineMIME("text/x-mysql","mysql")
\ No newline at end of file +CodeMirror.defineMode("mysql",function(e){function r(e){return new RegExp("^(?:"+e.join("|")+")$","i")}function u(e,t){var r=e.next();n=null;if(r=="$"||r=="?")return e.match(/^[\w\d]*/),"variable-2";if(r=="<"&&!e.match(/^[\s\u00a0=]/,!1))return e.match(/^[^\s\u00a0>]*>?/),"atom";if(r=='"'||r=="'")return t.tokenize=a(r),t.tokenize(e,t);if(r=="`")return t.tokenize=f(r),t.tokenize(e,t);if(/[{}\(\),\.;\[\]]/.test(r))return n=r,null;if(r!="-"){if(o.test(r))return e.eatWhile(o),null;if(r==":")return e.eatWhile(/[\w\d\._\-]/),"atom";e.eatWhile(/[_\w\d]/);if(e.eat(":"))return e.eatWhile(/[\w\d_\-]/),"atom";var l=e.current(),c;return i.test(l)?null:s.test(l)?"keyword":"variable"}var u=e.next();if(u=="-")return e.skipToEnd(),"comment"}function a(e){return function(t,n){var r=!1,i;while((i=t.next())!=null){if(i==e&&!r){n.tokenize=u;break}r=!r&&i=="\\"}return"string"}}function f(e){return function(t,n){var r=!1,i;while((i=t.next())!=null){if(i==e&&!r){n.tokenize=u;break}r=!r&&i=="\\"}return"variable-2"}}function l(e,t,n){e.context={prev:e.context,indent:e.indent,col:n,type:t}}function c(e){e.indent=e.context.indent,e.context=e.context.prev}var t=e.indentUnit,n,i=r(["str","lang","langmatches","datatype","bound","sameterm","isiri","isuri","isblank","isliteral","union","a"]),s=r(["ACCESSIBLE","ALTER","AS","BEFORE","BINARY","BY","CASE","CHARACTER","COLUMN","CONTINUE","CROSS","CURRENT_TIMESTAMP","DATABASE","DAY_MICROSECOND","DEC","DEFAULT","DESC","DISTINCT","DOUBLE","EACH","ENCLOSED","EXIT","FETCH","FLOAT8","FOREIGN","GRANT","HIGH_PRIORITY","HOUR_SECOND","IN","INNER","INSERT","INT2","INT8","INTO","JOIN","KILL","LEFT","LINEAR","LOCALTIME","LONG","LOOP","MATCH","MEDIUMTEXT","MINUTE_SECOND","NATURAL","NULL","OPTIMIZE","OR","OUTER","PRIMARY","RANGE","READ_WRITE","REGEXP","REPEAT","RESTRICT","RIGHT","SCHEMAS","SENSITIVE","SHOW","SPECIFIC","SQLSTATE","SQL_CALC_FOUND_ROWS","STARTING","TERMINATED","TINYINT","TRAILING","UNDO","UNLOCK","USAGE","UTC_DATE","VALUES","VARCHARACTER","WHERE","WRITE","ZEROFILL","ALL","AND","ASENSITIVE","BIGINT","BOTH","CASCADE","CHAR","COLLATE","CONSTRAINT","CREATE","CURRENT_TIME","CURSOR","DAY_HOUR","DAY_SECOND","DECLARE","DELETE","DETERMINISTIC","DIV","DUAL","ELSEIF","EXISTS","FALSE","FLOAT4","FORCE","FULLTEXT","HAVING","HOUR_MINUTE","IGNORE","INFILE","INSENSITIVE","INT1","INT4","INTERVAL","ITERATE","KEYS","LEAVE","LIMIT","LOAD","LOCK","LONGTEXT","MASTER_SSL_VERIFY_SERVER_CERT","MEDIUMINT","MINUTE_MICROSECOND","MODIFIES","NO_WRITE_TO_BINLOG","ON","OPTIONALLY","OUT","PRECISION","PURGE","READS","REFERENCES","RENAME","REQUIRE","REVOKE","SCHEMA","SELECT","SET","SPATIAL","SQLEXCEPTION","SQL_BIG_RESULT","SSL","TABLE","TINYBLOB","TO","TRUE","UNIQUE","UPDATE","USING","UTC_TIMESTAMP","VARCHAR","WHEN","WITH","YEAR_MONTH","ADD","ANALYZE","ASC","BETWEEN","BLOB","CALL","CHANGE","CHECK","CONDITION","CONVERT","CURRENT_DATE","CURRENT_USER","DATABASES","DAY_MINUTE","DECIMAL","DELAYED","DESCRIBE","DISTINCTROW","DROP","ELSE","ESCAPED","EXPLAIN","FLOAT","FOR","FROM","GROUP","HOUR_MICROSECOND","IF","INDEX","INOUT","INT","INT3","INTEGER","IS","KEY","LEADING","LIKE","LINES","LOCALTIMESTAMP","LONGBLOB","LOW_PRIORITY","MEDIUMBLOB","MIDDLEINT","MOD","NOT","NUMERIC","OPTION","ORDER","OUTFILE","PROCEDURE","READ","REAL","RELEASE","REPLACE","RETURN","RLIKE","SECOND_MICROSECOND","SEPARATOR","SMALLINT","SQL","SQLWARNING","SQL_SMALL_RESULT","STRAIGHT_JOIN","THEN","TINYTEXT","TRIGGER","UNION","UNSIGNED","USE","UTC_TIME","VARBINARY","VARYING","WHILE","XOR","FULL","COLUMNS","MIN","MAX","STDEV","COUNT"]),o=/[*+\-<>=&|]/;return{startState:function(e){return{tokenize:u,context:null,indent:0,col:0}},token:function(e,t){e.sol()&&(t.context&&t.context.align==null&&(t.context.align=!1),t.indent=e.indentation());if(e.eatSpace())return null;var r=t.tokenize(e,t);r!="comment"&&t.context&&t.context.align==null&&t.context.type!="pattern"&&(t.context.align=!0);if(n=="(")l(t,")",e.column());else if(n=="[")l(t,"]",e.column());else if(n=="{")l(t,"}",e.column());else if(/[\]\}\)]/.test(n)){while(t.context&&t.context.type=="pattern")c(t);t.context&&n==t.context.type&&c(t)}else n=="."&&t.context&&t.context.type=="pattern"?c(t):/atom|string|variable/.test(r)&&t.context&&(/[\}\]]/.test(t.context.type)?l(t,"pattern",e.column()):t.context.type=="pattern"&&!t.context.align&&(t.context.align=!0,t.context.col=e.column()));return r},indent:function(e,n){var r=n&&n.charAt(0),i=e.context;if(/[\]\}]/.test(r))while(i&&i.type=="pattern")i=i.prev;var s=i&&r==i.type;return i?i.type=="pattern"?i.col:i.align?i.col+(s?0:1):i.indent+(s?0:t):0}}}),CodeMirror.defineMIME("text/x-mysql","mysql")
\ No newline at end of file diff --git a/src/main/webapp/javascripts_min/libs/codemirror/mode/plsql/plsql.js b/src/main/webapp/javascripts_min/libs/codemirror/mode/plsql/plsql.js index f1195d1..a2fdefb 100644 --- a/src/main/webapp/javascripts_min/libs/codemirror/mode/plsql/plsql.js +++ b/src/main/webapp/javascripts_min/libs/codemirror/mode/plsql/plsql.js @@ -1 +1 @@ -CodeMirror.defineMode("plsql",function(e,t){function f(e,t,n){return t.tokenize=n,n(e,t)}function c(e,t){return l=e,t}function h(e,t){var n=e.next();return n=='"'||n=="'"?f(e,t,p(n)):/[\[\]{}\(\),;\.]/.test(n)?c(n):/\d/.test(n)?(e.eatWhile(/[\w\.]/),c("number","number")):n=="/"?e.eat("*")?f(e,t,d):(e.eatWhile(a),c("operator","operator")):n=="-"?e.eat("-")?(e.skipToEnd(),c("comment","comment")):(e.eatWhile(a),c("operator","operator")):n=="@"||n=="$"?(e.eatWhile(/[\w\d\$_]/),c("word","variable")):a.test(n)?(e.eatWhile(a),c("operator","operator")):(e.eatWhile(/[\w\$_]/),r&&r.propertyIsEnumerable(e.current().toLowerCase())?c("keyword","keyword"):i&&i.propertyIsEnumerable(e.current().toLowerCase())?c("keyword","builtin"):s&&s.propertyIsEnumerable(e.current().toLowerCase())?c("keyword","variable-2"):o&&o.propertyIsEnumerable(e.current().toLowerCase())?c("keyword","variable-3"):c("word","plsql-word"))}function p(e){return function(t,n){var r=!1,i,s=!1;while((i=t.next())!=null){if(i==e&&!r){s=!0;break}r=!r&&i=="\\"}if(s||!r&&!u)n.tokenize=h;return c("string","plsql-string")}}function d(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=h;break}n=r=="*"}return c("comment","plsql-comment")}var n=e.indentUnit,r=t.keywords,i=t.functions,s=t.types,o=t.sqlplus,u=t.multiLineStrings,a=/[+\-*&%=<>!?:\/|]/,l;return{startState:function(e){return{tokenize:h,startOfLine:!0}},token:function(e,t){if(e.eatSpace())return null;var n=t.tokenize(e,t);return n}}}),function(){function e(e){var t={},n=e.split(" ");for(var r=0;r<n.length;++r)t[n[r]]=!0;return t}var t="abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work",n="abs acos add_months ascii asin atan atan2 average bfilename ceil chartorowid chr concat convert cos cosh count decode deref dual dump dup_val_on_index empty error exp false floor found glb greatest hextoraw initcap instr instrb isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mod months_between new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null nvl others power rawtohex reftohex round rowcount rowidtochar rpad rtrim sign sin sinh soundex sqlcode sqlerrm sqrt stddev substr substrb sum sysdate tan tanh to_char to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid upper user userenv variance vsize",r="bfile blob character clob dec float int integer mlslabel natural naturaln nchar nclob number numeric nvarchar2 real rowtype signtype smallint string varchar varchar2",i="appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap";CodeMirror.defineMIME("text/x-plsql",{name:"plsql",keywords:e(t),functions:e(n),types:e(r),sqlplus:e(i)})}()
\ No newline at end of file +CodeMirror.defineMode("plsql",function(e,t){function f(e,t,n){return t.tokenize=n,n(e,t)}function c(e,t){return l=e,t}function h(e,t){var n=e.next();return n=='"'||n=="'"?f(e,t,p(n)):/[\[\]{}\(\),;\.]/.test(n)?c(n):/\d/.test(n)?(e.eatWhile(/[\w\.]/),c("number","number")):n=="/"?e.eat("*")?f(e,t,d):(e.eatWhile(a),c("operator","operator")):n=="-"?e.eat("-")?(e.skipToEnd(),c("comment","comment")):(e.eatWhile(a),c("operator","operator")):n=="@"||n=="$"?(e.eatWhile(/[\w\d\$_]/),c("word","variable")):a.test(n)?(e.eatWhile(a),c("operator","operator")):(e.eatWhile(/[\w\$_]/),r&&r.propertyIsEnumerable(e.current().toLowerCase())?c("keyword","keyword"):i&&i.propertyIsEnumerable(e.current().toLowerCase())?c("keyword","builtin"):s&&s.propertyIsEnumerable(e.current().toLowerCase())?c("keyword","variable-2"):o&&o.propertyIsEnumerable(e.current().toLowerCase())?c("keyword","variable-3"):c("word","variable"))}function p(e){return function(t,n){var r=!1,i,s=!1;while((i=t.next())!=null){if(i==e&&!r){s=!0;break}r=!r&&i=="\\"}if(s||!r&&!u)n.tokenize=h;return c("string","plsql-string")}}function d(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=h;break}n=r=="*"}return c("comment","plsql-comment")}var n=e.indentUnit,r=t.keywords,i=t.functions,s=t.types,o=t.sqlplus,u=t.multiLineStrings,a=/[+\-*&%=<>!?:\/|]/,l;return{startState:function(e){return{tokenize:h,startOfLine:!0}},token:function(e,t){if(e.eatSpace())return null;var n=t.tokenize(e,t);return n}}}),function(){function e(e){var t={},n=e.split(" ");for(var r=0;r<n.length;++r)t[n[r]]=!0;return t}var t="abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work",n="abs acos add_months ascii asin atan atan2 average bfilename ceil chartorowid chr concat convert cos cosh count decode deref dual dump dup_val_on_index empty error exp false floor found glb greatest hextoraw initcap instr instrb isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mod months_between new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null nvl others power rawtohex reftohex round rowcount rowidtochar rpad rtrim sign sin sinh soundex sqlcode sqlerrm sqrt stddev substr substrb sum sysdate tan tanh to_char to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid upper user userenv variance vsize",r="bfile blob character clob dec float int integer mlslabel natural naturaln nchar nclob number numeric nvarchar2 real rowtype signtype smallint string varchar varchar2",i="appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap";CodeMirror.defineMIME("text/x-plsql",{name:"plsql",keywords:e(t),functions:e(n),types:e(r),sqlplus:e(i)})}()
\ No newline at end of file diff --git a/src/main/webapp/javascripts_min/libs/fiddleEditor.js b/src/main/webapp/javascripts_min/libs/fiddleEditor.js index 6a8c773..500fe3f 100644 --- a/src/main/webapp/javascripts_min/libs/fiddleEditor.js +++ b/src/main/webapp/javascripts_min/libs/fiddleEditor.js @@ -1 +1 @@ -define(["CodeMirror","MySQLCodeMirror"],function(e,t){var n=function(t,n,r){return this.codeMirrorSupported=!/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent),this.codeMirrorSupported?this.codeMirror=e.fromTextArea(document.getElementById(t),{mode:"mysql",extraKeys:{Tab:"indentMore"},lineNumbers:!0,onChange:function(){n.call(r)}}):(this.textArea=document.getElementById(t),$(this.textArea).on("change",function(){n.call(r)}),$(this.textArea).on("keyup",function(){n.call(r)}),$(this.textArea).attr("fullscreen",!1)),this};return n.prototype.getValue=function(){return this.codeMirrorSupported?this.codeMirror.getValue():this.textArea.value},n.prototype.setValue=function(e){this.codeMirrorSupported?this.codeMirror.setValue(e):(this.textArea.value=e,$(this.textArea).trigger("change"))},n.prototype.refresh=function(){this.codeMirrorSupported&&this.codeMirror.refresh()},n.prototype.somethingSelected=function(){return this.codeMirrorSupported?this.codeMirror.somethingSelected():!1},n.prototype.getSelection=function(){return this.codeMirrorSupported?this.codeMirror.getSelection():this.textArea.value},n.prototype.getScrollerElement=function(){return this.codeMirrorSupported?this.codeMirror.getScrollerElement():null},n.prototype.getGutterElement=function(){return this.codeMirrorSupported?this.codeMirror.getGutterElement():null},n.prototype.isFullscreen=function(){return this.codeMirrorSupported?$(this.codeMirror.getScrollerElement()).hasClass("CodeMirror-fullscreen"):$(this.textArea).attr("fullscreen")==1},n.prototype.setFullscreen=function(e){if(e){var t=$(window).height()-40;this.codeMirrorSupported?($(this.codeMirror.getScrollerElement()).addClass("CodeMirror-fullscreen").height(t),$(this.codeMirror.getGutterElement()).height(t)):($(this.textArea).addClass("fullscreen"),$(this.textArea).height(t),$(this.textArea).attr("fullscreen",e))}else this.codeMirrorSupported?($(this.codeMirror.getScrollerElement()).removeClass("CodeMirror-fullscreen"),$(this.codeMirror.getGutterElement()).css("height","auto"),$(this.codeMirror.getScrollerElement()).css("height","200px")):($(this.textArea).removeClass("fullscreen"),$(this.textArea).height(100),$(this.textArea).attr("fullscreen",e))},n})
\ No newline at end of file +define(["CodeMirror","MySQLCodeMirror","jQuery"],function(e,t,n){var r=function(t,r,i,s){return this.codeMirrorSupported=!/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent),this.codeMirrorSupported?(this.codeMirror=e.fromTextArea(document.getElementById(t),{mode:"mysql",matchBrackets:!0,extraKeys:{Tab:"indentMore"},lineNumbers:!0,onChange:function(){r.call(i)}}),n(this.codeMirror.getWrapperElement()).on("keypress",function(e){e.keyCode==13&&e.ctrlKey&&s&&(e.preventDefault(),s())})):(this.textArea=document.getElementById(t),n(this.textArea).on("change",function(){r.call(i)}),n(this.textArea).on("keyup",function(){r.call(i)}),n(this.textArea).on("keypress",function(e){e.keyCode==13&&e.ctrlKey&&s&&(e.preventDefault(),s())}),n(this.textArea).attr("fullscreen",!1)),this};return r.prototype.getValue=function(){return this.codeMirrorSupported?this.codeMirror.getValue():this.textArea.value},r.prototype.setValue=function(e){this.codeMirrorSupported?this.codeMirror.setValue(e):(this.textArea.value=e,n(this.textArea).trigger("change"))},r.prototype.refresh=function(){this.codeMirrorSupported&&this.codeMirror.refresh()},r.prototype.somethingSelected=function(){return this.codeMirrorSupported?this.codeMirror.somethingSelected():!1},r.prototype.getSelection=function(){return this.codeMirrorSupported?this.codeMirror.getSelection():this.textArea.value},r.prototype.getScrollerElement=function(){return this.codeMirrorSupported?this.codeMirror.getScrollerElement():null},r.prototype.getGutterElement=function(){return this.codeMirrorSupported?this.codeMirror.getGutterElement():null},r.prototype.isFullscreen=function(){return this.codeMirrorSupported?n(this.codeMirror.getScrollerElement()).hasClass("CodeMirror-fullscreen"):n(this.textArea).attr("fullscreen")==1},r.prototype.setFullscreen=function(e){if(e){var t=n(window).height()-40;this.codeMirrorSupported?(n(this.codeMirror.getScrollerElement()).addClass("CodeMirror-fullscreen").height(t),n(this.codeMirror.getGutterElement()).height(t)):(n(this.textArea).addClass("fullscreen"),n(this.textArea).height(t),n(this.textArea).attr("fullscreen",e))}else this.codeMirrorSupported?(n(this.codeMirror.getScrollerElement()).removeClass("CodeMirror-fullscreen"),n(this.codeMirror.getGutterElement()).css("height","auto"),n(this.codeMirror.getScrollerElement()).css("height","200px")):(n(this.textArea).removeClass("fullscreen"),n(this.textArea).height(100),n(this.textArea).attr("fullscreen",e))},r})
\ No newline at end of file diff --git a/src/main/webapp/javascripts_min/libs/handlebarsHelpers/add.js b/src/main/webapp/javascripts_min/libs/handlebarsHelpers/add.js new file mode 100644 index 0000000..5d3b3fa --- /dev/null +++ b/src/main/webapp/javascripts_min/libs/handlebarsHelpers/add.js @@ -0,0 +1 @@ +define(["Handlebars"],function(e){e.registerHelper("add",function(e,t){return e+t})})
\ No newline at end of file diff --git a/src/main/webapp/javascripts_min/libs/handlebarsHelpers/code_format.js b/src/main/webapp/javascripts_min/libs/handlebarsHelpers/code_format.js new file mode 100644 index 0000000..79b922b --- /dev/null +++ b/src/main/webapp/javascripts_min/libs/handlebarsHelpers/code_format.js @@ -0,0 +1 @@ +define(["Handlebars"],function(e){e.registerHelper("code_format",function(e){var t=[],n=e.split("\n");for(var r=0;r<n.length;r++)t.push(" "+n[r]);return t.join("\n")})})
\ No newline at end of file diff --git a/src/main/webapp/javascripts_min/main.js b/src/main/webapp/javascripts_min/main.js index 2c49854..914e8d5 100644 --- a/src/main/webapp/javascripts_min/main.js +++ b/src/main/webapp/javascripts_min/main.js @@ -201,4 +201,4 @@ * http://github.com/jakefeasel/DDLBuilder */ -function ControlVersion(){var e,t,n;try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"),e=t.GetVariable("$version")}catch(n){}if(!e)try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"),e="WIN 6,0,21,0",t.AllowScriptAccess="always",e=t.GetVariable("$version")}catch(n){}if(!e)try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"),e=t.GetVariable("$version")}catch(n){}if(!e)try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"),e="WIN 3,0,18,0"}catch(n){}if(!e)try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),e="WIN 2,0,0,11"}catch(n){e=-1}return e}function GetSwfVer(){var e=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var t=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"",n=navigator.plugins["Shockwave Flash"+t].description,r=n.split(" "),i=r[2].split("."),s=i[0],o=i[1];r[3]!=""?tempArrayMinor=r[3].split("r"):tempArrayMinor=r[4].split("r");var u=tempArrayMinor[1]>0?tempArrayMinor[1]:0,e=s+"."+o+"."+u}}else navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1?e=4:navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1?e=3:navigator.userAgent.toLowerCase().indexOf("webtv")!=-1?e=2:isIE&&isWin&&!isOpera&&(e=ControlVersion());return e}function DetectFlashVer(e,t,n){versionStr=GetSwfVer();if(versionStr==-1)return!1;if(versionStr!=0){isIE&&isWin&&!isOpera?(tempArray=versionStr.split(" "),tempString=tempArray[1],versionArray=tempString.split(",")):versionArray=versionStr.split(".");var r=versionArray[0],i=versionArray[1],s=versionArray[2];if(r>parseFloat(e))return!0;if(r==parseFloat(e)){if(i>parseFloat(t))return!0;if(i==parseFloat(t)&&s>=parseFloat(n))return!0}return!1}}function AC_AddExtension(e,t){return e.indexOf("?")!=-1?e.replace(/\?/,t+"?"):e+t}function AC_Generateobj(e,t,n){var r="";if(isIE&&isWin&&!isOpera){r+="<object ";for(var i in e)r+=i+'="'+e[i]+'" ';for(var i in t)r+='><param name="'+i+'" value="'+t[i]+'" /> ';r+="></object>"}else{r+="<embed ";for(var i in n)r+=i+'="'+n[i]+'" ';r+="> </embed>"}return r}function AC_FL_RunContent(){var e=AC_GetArgs(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");return AC_Generateobj(e.objAttrs,e.params,e.embedAttrs)}function AC_GetArgs(e,t,n,r,i){var s=new Object;s.embedAttrs=new Object,s.params=new Object,s.objAttrs=new Object;for(var o=0;o<e.length;o+=2){var u=e[o].toLowerCase();switch(u){case"classid":break;case"pluginspage":s.embedAttrs[e[o]]=e[o+1];break;case"src":case"movie":e[o+1]=AC_AddExtension(e[o+1],t),s.embedAttrs.src=e[o+1],s.params[n]=e[o+1];break;case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblClick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case"codebase":case"id":s.objAttrs[e[o]]=e[o+1];break;case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"tabindex":s.embedAttrs[e[o]]=s.objAttrs[e[o]]=e[o+1];break;default:s.embedAttrs[e[o]]=s.params[e[o]]=e[o+1]}}return s.objAttrs.classid=r,i&&(s.embedAttrs.type=i),s}function getSearch(e){var t="";return e.location.search.length>1&&(t=new String(e.location.search),t=t.substring(1,t.length)),t}function parseVersion(e){if(typeof e!="string")return[0,0,0,0,0];var t=e.split("."),n=t[0]=="X"?999:parseInt(t[0])||0,r=t[1]=="X"?999:parseInt(t[1])||0,i=t[2]=="X"?999:parseInt(t[2])||0,s=t[3]=="X"?999:parseInt(t[3])||0,o=t[4]=="X"?999:parseInt(t[4])||0;return new Array(n,r,i,s,o)}function compareVersions(e,t){var n=parseVersion(e),r=parseVersion(t);for(var i=0;i<5;i++){if(n[i]<r[i])return 1;if(n[i]>r[i])return-1}return 0}function findViewerFile(e,t){var n=viewerMap[e];if(n==null)return!1;var r=n.length;for(var i=0;i<r;i++)if(compareVersions(n[i],t)<0)break;i!=0&&i--;var s="http://download.oracle.com/otn_software/emviewers/"+e+"/"+n[i]+"/"+e;return s}function loadswf(e){var t=e.match(/db_version="([\d\.]*)"/),n=e.match(/orarep\/(\w*)\//),r=n==null?"":n[1],i=t==null?"":t[1];r==""&&e.match(/sql_monitor_report/)&&(r="sqlmonitor",i="11");var s=Math.floor(Math.random()*1e5).toString(16);this!=top&&(top.Vars=Vars,top.getSearch=getSearch,top.lc_id=s);var o="historyUrl=history.htm%3F&lconid="+s+"&model="+encodeURIComponent(e)+"";if(hasProductInstall&&!hasRequestedVersion){var u=isIE==1?"ActiveX":"PlugIn",a=window.location;document.title=document.title.slice(0,47)+" - Flash Player Installation";var f=document.title;return AC_FL_RunContent("src","http://download.oracle.com/otn_software/emviewers/scripts/playerProductInstall","FlashVars",o,"width","100%","height","100%","align","middle","id",r,"quality","high","bgcolor","#FFFFFF","name",r,"allowScriptAccess","always","type","application/x-shockwave-flash","pluginspage","http://www.adobe.com/go/getflashplayer")}if(!hasRequestedVersion){var c="Fail to display EM Standalone report. This content requires the Adobe Flash Player. <a href=http://www.adobe.com/go/getflash/>Get Flash</a>";return c}var l=typeof viewer_swf=="string"?viewer_swf:findViewerFile(r,i);if(!!l)return AC_FL_RunContent("src",l,"width","100%","height","100%","align","middle","id",r,"quality","high","bgcolor","#FFFFFF","name",r,"flashvars",o,"allowScriptAccess","always","type","application/x-shockwave-flash","pluginspage","http://www.adobe.com/go/getflashplayer");r!=""?alert('Sorry, viewer name "'+r+'" is not yet supported...'):alert("Sorry, cannot not display report: unknown report type")}(function(e,t){function u(e){var t=o[e]={},n,r;e=e.split(/\s+/);for(n=0,r=e.length;n<r;n++)t[e[n]]=!0;return t}function c(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(l,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:s.isNumeric(r)?+r:f.test(r)?s.parseJSON(r):r}catch(o){}s.data(e,n,r)}else r=t}return r}function h(e){for(var t in e){if(t==="data"&&s.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function p(e,t,n){var r=t+"defer",i=t+"queue",o=t+"mark",u=s._data(e,r);u&&(n==="queue"||!s._data(e,i))&&(n==="mark"||!s._data(e,o))&&setTimeout(function(){!s._data(e,i)&&!s._data(e,o)&&(s.removeData(e,r,!0),u.fire())},0)}function H(){return!1}function B(){return!0}function W(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function X(e,t,n){t=t||0;if(s.isFunction(t))return s.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return s.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=s.grep(e,function(e){return e.nodeType===1});if(q.test(t))return s.filter(t,r,!n);t=s.filter(t,r)}return s.grep(e,function(e,r){return s.inArray(e,t)>=0===n})}function V(e){var t=$.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function at(e,t){return s.nodeName(e,"table")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function ft(e,t){if(t.nodeType!==1||!s.hasData(e))return;var n,r,i,o=s._data(e),u=s._data(t,o),a=o.events;if(a){delete u.handle,u.events={};for(n in a)for(r=0,i=a[n].length;r<i;r++)s.event.add(t,n,a[n][r])}u.data&&(u.data=s.extend({},u.data))}function lt(e,t){var n;if(t.nodeType!==1)return;t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),n==="object"?t.outerHTML=e.outerHTML:n!=="input"||e.type!=="checkbox"&&e.type!=="radio"?n==="option"?t.selected=e.defaultSelected:n==="input"||n==="textarea"?t.defaultValue=e.defaultValue:n==="script"&&t.text!==e.text&&(t.text=e.text):(e.checked&&(t.defaultChecked=t.checked=e.checked),t.value!==e.value&&(t.value=e.value)),t.removeAttribute(s.expando),t.removeAttribute("_submit_attached"),t.removeAttribute("_change_attached")}function ct(e){return typeof e.getElementsByTagName!="undefined"?e.getElementsByTagName("*"):typeof e.querySelectorAll!="undefined"?e.querySelectorAll("*"):[]}function ht(e){if(e.type==="checkbox"||e.type==="radio")e.defaultChecked=e.checked}function pt(e){var t=(e.nodeName||"").toLowerCase();t==="input"?ht(e):t!=="script"&&typeof e.getElementsByTagName!="undefined"&&s.grep(e.getElementsByTagName("input"),ht)}function dt(e){var t=n.createElement("div");return ut.appendChild(t),t.innerHTML=e.outerHTML,t.firstChild}function kt(e,t,n){var r=t==="width"?e.offsetWidth:e.offsetHeight,i=t==="width"?1:0,o=4;if(r>0){if(n!=="border")for(;i<o;i+=2)n||(r-=parseFloat(s.css(e,"padding"+xt[i]))||0),n==="margin"?r+=parseFloat(s.css(e,n+xt[i]))||0:r-=parseFloat(s.css(e,"border"+xt[i]+"Width"))||0;return r+"px"}r=Tt(e,t);if(r<0||r==null)r=e.style[t];if(bt.test(r))return r;r=parseFloat(r)||0;if(n)for(;i<o;i+=2)r+=parseFloat(s.css(e,"padding"+xt[i]))||0,n!=="padding"&&(r+=parseFloat(s.css(e,"border"+xt[i]+"Width"))||0),n==="margin"&&(r+=parseFloat(s.css(e,n+xt[i]))||0);return r+"px"}function Qt(e){return function(t,n){typeof t!="string"&&(n=t,t="*");if(s.isFunction(n)){var r=t.toLowerCase().split(qt),i=0,o=r.length,u,a,f;for(;i<o;i++)u=r[i],f=/^\+/.test(u),f&&(u=u.substr(1)||"*"),a=e[u]=e[u]||[],a[f?"unshift":"push"](n)}}}function Gt(e,n,r,i,s,o){s=s||n.dataTypes[0],o=o||{},o[s]=!0;var u=e[s],a=0,f=u?u.length:0,l=e===Wt,c;for(;a<f&&(l||!c);a++)c=u[a](n,r,i),typeof c=="string"&&(!l||o[c]?c=t:(n.dataTypes.unshift(c),c=Gt(e,n,r,i,c,o)));return(l||!c)&&!o["*"]&&(c=Gt(e,n,r,i,"*",o)),c}function Yt(e,n){var r,i,o=s.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((o[r]?e:i||(i={}))[r]=n[r]);i&&s.extend(!0,e,i)}function Zt(e,t,n,r){if(s.isArray(t))s.each(t,function(t,i){n||At.test(e)?r(e,i):Zt(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&s.type(t)==="object")for(var i in t)Zt(e+"["+i+"]",t[i],n,r);else r(e,t)}function en(e,n,r){var i=e.contents,s=e.dataTypes,o=e.responseFields,u,a,f,l;for(a in o)a in r&&(n[o[a]]=r[a]);while(s[0]==="*")s.shift(),u===t&&(u=e.mimeType||n.getResponseHeader("content-type"));if(u)for(a in i)if(i[a]&&i[a].test(u)){s.unshift(a);break}if(s[0]in r)f=s[0];else{for(a in r){if(!s[0]||e.converters[a+" "+s[0]]){f=a;break}l||(l=a)}f=f||l}if(f)return f!==s[0]&&s.unshift(f),r[f]}function tn(e,n){e.dataFilter&&(n=e.dataFilter(n,e.dataType));var r=e.dataTypes,i={},o,u,a=r.length,f,l=r[0],c,h,p,d,v;for(o=1;o<a;o++){if(o===1)for(u in e.converters)typeof u=="string"&&(i[u.toLowerCase()]=e.converters[u]);c=l,l=r[o];if(l==="*")l=c;else if(c!=="*"&&c!==l){h=c+" "+l,p=i[h]||i["* "+l];if(!p){v=t;for(d in i){f=d.split(" ");if(f[0]===c||f[0]==="*"){v=i[f[1]+" "+l];if(v){d=i[d],d===!0?p=v:v===!0&&(p=d);break}}}}!p&&!v&&s.error("No conversion from "+h.replace(" "," to ")),p!==!0&&(n=p?p(n):v(d(n)))}}return n}function an(){try{return new e.XMLHttpRequest}catch(t){}}function fn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function yn(){return setTimeout(bn,0),gn=s.now()}function bn(){gn=t}function wn(e,t){var n={};return s.each(mn.concat.apply([],mn.slice(0,t)),function(){n[this]=e}),n}function En(e){if(!ln[e]){var t=n.body,r=s("<"+e+">").appendTo(t),i=r.css("display");r.remove();if(i==="none"||i===""){cn||(cn=n.createElement("iframe"),cn.frameBorder=cn.width=cn.height=0),t.appendChild(cn);if(!hn||!cn.createElement)hn=(cn.contentWindow||cn.contentDocument).document,hn.write((s.support.boxModel?"<!doctype html>":"")+"<html><body>"),hn.close();r=hn.createElement(e),hn.body.appendChild(r),i=s.css(r,"display"),t.removeChild(cn)}ln[e]=i}return ln[e]}function Nn(e){return s.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n=e.document,r=e.navigator,i=e.location,s=function(){function H(){if(i.isReady)return;try{n.documentElement.doScroll("left")}catch(e){setTimeout(H,1);return}i.ready()}var i=function(e,t){return new i.fn.init(e,t,u)},s=e.jQuery,o=e.$,u,a=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,f=/\S/,l=/^\s+/,c=/\s+$/,h=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,p=/^[\],:{}\s]*$/,d=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,v=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,m=/(?:^|:|,)(?:\s*\[)+/g,g=/(webkit)[ \/]([\w.]+)/,y=/(opera)(?:.*version)?[ \/]([\w.]+)/,b=/(msie) ([\w.]+)/,w=/(mozilla)(?:.*? rv:([\w.]+))?/,E=/-([a-z]|[0-9])/ig,S=/^-ms-/,x=function(e,t){return(t+"").toUpperCase()},T=r.userAgent,N,C,k,L=Object.prototype.toString,A=Object.prototype.hasOwnProperty,O=Array.prototype.push,M=Array.prototype.slice,_=String.prototype.trim,D=Array.prototype.indexOf,P={};return i.fn=i.prototype={constructor:i,init:function(e,r,s){var o,u,f,l;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(e==="body"&&!r&&n.body)return this.context=n,this[0]=n.body,this.selector=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?o=[null,e,null]:o=a.exec(e);if(o&&(o[1]||!r)){if(o[1])return r=r instanceof i?r[0]:r,l=r?r.ownerDocument||r:n,f=h.exec(e),f?i.isPlainObject(r)?(e=[n.createElement(f[1])],i.fn.attr.call(e,r,!0)):e=[l.createElement(f[1])]:(f=i.buildFragment([o[1]],[l]),e=(f.cacheable?i.clone(f.fragment):f.fragment).childNodes),i.merge(this,e);u=n.getElementById(o[2]);if(u&&u.parentNode){if(u.id!==o[2])return s.find(e);this.length=1,this[0]=u}return this.context=n,this.selector=e,this}return!r||r.jquery?(r||s).find(e):this.constructor(r).find(e)}return i.isFunction(e)?s.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),i.makeArray(e,this))},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return M.call(this,0)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=this.constructor();return i.isArray(e)?O.apply(r,e):i.merge(r,e),r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return i.each(this,e,t)},ready:function(e){return i.bindReady(),C.add(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(M.apply(this,arguments),"slice",M.call(arguments).join(","))},map:function(e){return this.pushStack(i.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:O,sort:[].sort,splice:[].splice},i.fn.init.prototype=i.fn,i.extend=i.fn.extend=function(){var e,n,r,s,o,u,a=arguments[0]||{},f=1,l=arguments.length,c=!1;typeof a=="boolean"&&(c=a,a=arguments[1]||{},f=2),typeof a!="object"&&!i.isFunction(a)&&(a={}),l===f&&(a=this,--f);for(;f<l;f++)if((e=arguments[f])!=null)for(n in e){r=a[n],s=e[n];if(a===s)continue;c&&s&&(i.isPlainObject(s)||(o=i.isArray(s)))?(o?(o=!1,u=r&&i.isArray(r)?r:[]):u=r&&i.isPlainObject(r)?r:{},a[n]=i.extend(c,u,s)):s!==t&&(a[n]=s)}return a},i.extend({noConflict:function(t){return e.$===i&&(e.$=o),t&&e.jQuery===i&&(e.jQuery=s),i},isReady:!1,readyWait:1,holdReady:function(e){e?i.readyWait++:i.ready(!0)},ready:function(e){if(e===!0&&!--i.readyWait||e!==!0&&!i.isReady){if(!n.body)return setTimeout(i.ready,1);i.isReady=!0;if(e!==!0&&--i.readyWait>0)return;C.fireWith(n,[i]),i.fn.trigger&&i(n).trigger("ready").off("ready")}},bindReady:function(){if(C)return;C=i.Callbacks("once memory");if(n.readyState==="complete")return setTimeout(i.ready,1);if(n.addEventListener)n.addEventListener("DOMContentLoaded",k,!1),e.addEventListener("load",i.ready,!1);else if(n.attachEvent){n.attachEvent("onreadystatechange",k),e.attachEvent("onload",i.ready);var t=!1;try{t=e.frameElement==null}catch(r){}n.documentElement.doScroll&&t&&H()}},isFunction:function(e){return i.type(e)==="function"},isArray:Array.isArray||function(e){return i.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):P[L.call(e)]||"object"},isPlainObject:function(e){if(!e||i.type(e)!=="object"||e.nodeType||i.isWindow(e))return!1;try{if(e.constructor&&!A.call(e,"constructor")&&!A.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||A.call(e,r)},isEmptyObject:function(e){for(var t in e)return!1;return!0},error:function(e){throw new Error(e)},parseJSON:function(t){if(typeof t!="string"||!t)return null;t=i.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(p.test(t.replace(d,"@").replace(v,"]").replace(m,"")))return(new Function("return "+t))();i.error("Invalid JSON: "+t)},parseXML:function(n){if(typeof n!="string"||!n)return null;var r,s;try{e.DOMParser?(s=new DOMParser,r=s.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&i.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&f.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(S,"ms-").replace(E,x)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toUpperCase()===t.toUpperCase()},each:function(e,n,r){var s,o=0,u=e.length,a=u===t||i.isFunction(e);if(r){if(a){for(s in e)if(n.apply(e[s],r)===!1)break}else for(;o<u;)if(n.apply(e[o++],r)===!1)break}else if(a){for(s in e)if(n.call(e[s],s,e[s])===!1)break}else for(;o<u;)if(n.call(e[o],o,e[o++])===!1)break;return e},trim:_?function(e){return e==null?"":_.call(e)}:function(e){return e==null?"":e.toString().replace(l,"").replace(c,"")},makeArray:function(e,t){var n=t||[];if(e!=null){var r=i.type(e);e.length==null||r==="string"||r==="function"||r==="regexp"||i.isWindow(e)?O.call(n,e):i.merge(n,e)}return n},inArray:function(e,t,n){var r;if(t){if(D)return D.call(t,e,n);r=t.length,n=n?n<0?Math.max(0,r+n):n:0;for(;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=e.length,i=0;if(typeof n.length=="number")for(var s=n.length;i<s;i++)e[r++]=n[i];else while(n[i]!==t)e[r++]=n[i++];return e.length=r,e},grep:function(e,t,n){var r=[],i;n=!!n;for(var s=0,o=e.length;s<o;s++)i=!!t(e[s],s),n!==i&&r.push(e[s]);return r},map:function(e,n,r){var s,o,u=[],a=0,f=e.length,l=e instanceof i||f!==t&&typeof f=="number"&&(f>0&&e[0]&&e[f-1]||f===0||i.isArray(e));if(l)for(;a<f;a++)s=n(e[a],a,r),s!=null&&(u[u.length]=s);else for(o in e)s=n(e[o],o,r),s!=null&&(u[u.length]=s);return u.concat.apply([],u)},guid:1,proxy:function(e,n){if(typeof n=="string"){var r=e[n];n=e,e=r}if(!i.isFunction(e))return t;var s=M.call(arguments,2),o=function(){return e.apply(n,s.concat(M.call(arguments)))};return o.guid=e.guid=e.guid||o.guid||i.guid++,o},access:function(e,n,r,s,o,u,a){var f,l=r==null,c=0,h=e.length;if(r&&typeof r=="object"){for(c in r)i.access(e,n,c,r[c],1,u,s);o=1}else if(s!==t){f=a===t&&i.isFunction(s),l&&(f?(f=n,n=function(e,t,n){return f.call(i(e),n)}):(n.call(e,s),n=null));if(n)for(;c<h;c++)n(e[c],r,f?s.call(e[c],c,n(e[c],r)):s,a);o=1}return o?e:l?n.call(e):h?n(e[0],r):u},now:function(){return(new Date).getTime()},uaMatch:function(e){e=e.toLowerCase();var t=g.exec(e)||y.exec(e)||b.exec(e)||e.indexOf("compatible")<0&&w.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},sub:function(){function e(t,n){return new e.fn.init(t,n)}i.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,s){return s&&s instanceof i&&!(s instanceof e)&&(s=e(s)),i.fn.init.call(this,r,s,t)},e.fn.init.prototype=e.fn;var t=e(n);return e},browser:{}}),i.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){P["[object "+t+"]"]=t.toLowerCase()}),N=i.uaMatch(T),N.browser&&(i.browser[N.browser]=!0,i.browser.version=N.version),i.browser.webkit&&(i.browser.safari=!0),f.test(" ")&&(l=/^[\s\xA0]+/,c=/[\s\xA0]+$/),u=i(n),n.addEventListener?k=function(){n.removeEventListener("DOMContentLoaded",k,!1),i.ready()}:n.attachEvent&&(k=function(){n.readyState==="complete"&&(n.detachEvent("onreadystatechange",k),i.ready())}),i}(),o={};s.Callbacks=function(e){e=e?o[e]||u(e):{};var n=[],r=[],i,a,f,l,c,h,p=function(t){var r,i,o,u,a;for(r=0,i=t.length;r<i;r++)o=t[r],u=s.type(o),u==="array"?p(o):u==="function"&&(!e.unique||!v.has(o))&&n.push(o)},d=function(t,s){s=s||[],i=!e.memory||[t,s],a=!0,f=!0,h=l||0,l=0,c=n.length;for(;n&&h<c;h++)if(n[h].apply(t,s)===!1&&e.stopOnFalse){i=!0;break}f=!1,n&&(e.once?i===!0?v.disable():n=[]:r&&r.length&&(i=r.shift(),v.fireWith(i[0],i[1])))},v={add:function(){if(n){var e=n.length;p(arguments),f?c=n.length:i&&i!==!0&&(l=e,d(i[0],i[1]))}return this},remove:function(){if(n){var t=arguments,r=0,i=t.length;for(;r<i;r++)for(var s=0;s<n.length;s++)if(t[r]===n[s]){f&&s<=c&&(c--,s<=h&&h--),n.splice(s--,1);if(e.unique)break}}return this},has:function(e){if(n){var t=0,r=n.length;for(;t<r;t++)if(e===n[t])return!0}return!1},empty:function(){return n=[],this},disable:function(){return n=r=i=t,this},disabled:function(){return!n},lock:function(){return r=t,(!i||i===!0)&&v.disable(),this},locked:function(){return!r},fireWith:function(t,n){return r&&(f?e.once||r.push([t,n]):(!e.once||!i)&&d(t,n)),this},fire:function(){return v.fireWith(this,arguments),this},fired:function(){return!!a}};return v};var a=[].slice;s.extend({Deferred:function(e){var t=s.Callbacks("once memory"),n=s.Callbacks("once memory"),r=s.Callbacks("memory"),i="pending",o={resolve:t,reject:n,notify:r},u={done:t.add,fail:n.add,progress:r.add,state:function(){return i},isResolved:t.fired,isRejected:n.fired,then:function(e,t,n){return a.done(e).fail(t).progress(n),this},always:function(){return a.done.apply(a,arguments).fail.apply(a,arguments),this},pipe:function(e,t,n){return s.Deferred(function(r){s.each({done:[e,"resolve"],fail:[t,"reject"],progress:[n,"notify"]},function(e,t){var n=t[0],i=t[1],o;s.isFunction(n)?a[e](function(){o=n.apply(this,arguments),o&&s.isFunction(o.promise)?o.promise().then(r.resolve,r.reject,r.notify):r[i+"With"](this===a?r:this,[o])}):a[e](r[i])})}).promise()},promise:function(e){if(e==null)e=u;else for(var t in u)e[t]=u[t];return e}},a=u.promise({}),f;for(f in o)a[f]=o[f].fire,a[f+"With"]=o[f].fireWith;return a.done(function(){i="resolved"},n.disable,r.lock).fail(function(){i="rejected"},t.disable,r.lock),e&&e.call(a,a),a},when:function(e){function c(e){return function(n){t[e]=arguments.length>1?a.call(arguments,0):n,--o||f.resolveWith(f,t)}}function h(e){return function(t){i[e]=arguments.length>1?a.call(arguments,0):t,f.notifyWith(l,i)}}var t=a.call(arguments,0),n=0,r=t.length,i=new Array(r),o=r,u=r,f=r<=1&&e&&s.isFunction(e.promise)?e:s.Deferred(),l=f.promise();if(r>1){for(;n<r;n++)t[n]&&t[n].promise&&s.isFunction(t[n].promise)?t[n].promise().then(c(n),f.reject,h(n)):--o;o||f.resolveWith(f,t)}else f!==e&&f.resolveWith(f,r?[e]:[]);return l}}),s.support=function(){var t,r,i,o,u,a,f,l,c,h,p,d,v=n.createElement("div"),m=n.documentElement;v.setAttribute("className","t"),v.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",r=v.getElementsByTagName("*"),i=v.getElementsByTagName("a")[0];if(!r||!r.length||!i)return{};o=n.createElement("select"),u=o.appendChild(n.createElement("option")),a=v.getElementsByTagName("input")[0],t={leadingWhitespace:v.firstChild.nodeType===3,tbody:!v.getElementsByTagName("tbody").length,htmlSerialize:!!v.getElementsByTagName("link").length,style:/top/.test(i.getAttribute("style")),hrefNormalized:i.getAttribute("href")==="/a",opacity:/^0.55/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:a.value==="on",optSelected:u.selected,getSetAttribute:v.className!=="t",enctype:!!n.createElement("form").enctype,html5Clone:n.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},s.boxModel=t.boxModel=n.compatMode==="CSS1Compat",a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,o.disabled=!0,t.optDisabled=!u.disabled;try{delete v.test}catch(g){t.deleteExpando=!1}!v.addEventListener&&v.attachEvent&&v.fireEvent&&(v.attachEvent("onclick",function(){t.noCloneEvent=!1}),v.cloneNode(!0).fireEvent("onclick")),a=n.createElement("input"),a.value="t",a.setAttribute("type","radio"),t.radioValue=a.value==="t",a.setAttribute("checked","checked"),a.setAttribute("name","t"),v.appendChild(a),f=n.createDocumentFragment(),f.appendChild(v.lastChild),t.checkClone=f.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=a.checked,f.removeChild(a),f.appendChild(v);if(v.attachEvent)for(p in{submit:1,change:1,focusin:1})h="on"+p,d=h in v,d||(v.setAttribute(h,"return;"),d=typeof v[h]=="function"),t[p+"Bubbles"]=d;return f.removeChild(v),f=o=u=v=a=null,s(function(){var r,i,o,u,a,f,c,h,p,m,g,y,b,w=n.getElementsByTagName("body")[0];if(!w)return;h=1,b="padding:0;margin:0;border:",g="position:absolute;top:0;left:0;width:1px;height:1px;",y=b+"0;visibility:hidden;",p="style='"+g+b+"5px solid #000;",m="<div "+p+"display:block;'><div style='"+b+"0;display:block;overflow:hidden;'></div></div>"+"<table "+p+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",r=n.createElement("div"),r.style.cssText=y+"width:0;height:0;position:static;top:0;margin-top:"+h+"px",w.insertBefore(r,w.firstChild),v=n.createElement("div"),r.appendChild(v),v.innerHTML="<table><tr><td style='"+b+"0;display:none'></td><td>t</td></tr></table>",l=v.getElementsByTagName("td"),d=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",t.reliableHiddenOffsets=d&&l[0].offsetHeight===0,e.getComputedStyle&&(v.innerHTML="",c=n.createElement("div"),c.style.width="0",c.style.marginRight="0",v.style.width="2px",v.appendChild(c),t.reliableMarginRight=(parseInt((e.getComputedStyle(c,null)||{marginRight:0}).marginRight,10)||0)===0),typeof v.style.zoom!="undefined"&&(v.innerHTML="",v.style.width=v.style.padding="1px",v.style.border=0,v.style.overflow="hidden",v.style.display="inline",v.style.zoom=1,t.inlineBlockNeedsLayout=v.offsetWidth===3,v.style.display="block",v.style.overflow="visible",v.innerHTML="<div style='width:5px;'></div>",t.shrinkWrapBlocks=v.offsetWidth!==3),v.style.cssText=g+y,v.innerHTML=m,i=v.firstChild,o=i.firstChild,a=i.nextSibling.firstChild.firstChild,f={doesNotAddBorder:o.offsetTop!==5,doesAddBorderForTableAndCells:a.offsetTop===5},o.style.position="fixed",o.style.top="20px",f.fixedPosition=o.offsetTop===20||o.offsetTop===15,o.style.position=o.style.top="",i.style.overflow="hidden",i.style.position="relative",f.subtractsBorderForOverflowNotVisible=o.offsetTop===-5,f.doesNotIncludeMarginInBodyOffset=w.offsetTop!==h,e.getComputedStyle&&(v.style.marginTop="1%",t.pixelMargin=(e.getComputedStyle(v,null)||{marginTop:0}).marginTop!=="1%"),typeof r.style.zoom!="undefined"&&(r.style.zoom=1),w.removeChild(r),c=v=r=null,s.extend(t,f)}),t}();var f=/^(?:\{.*\}|\[.*\])$/,l=/([A-Z])/g;s.extend({cache:{},uuid:0,expando:"jQuery"+(s.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?s.cache[e[s.expando]]:e[s.expando],!!e&&!h(e)},data:function(e,n,r,i){if(!s.acceptData(e))return;var o,u,a,f=s.expando,l=typeof n=="string",c=e.nodeType,h=c?s.cache:e,p=c?e[f]:e[f]&&f,d=n==="events";if((!p||!h[p]||!d&&!i&&!h[p].data)&&l&&r===t)return;p||(c?e[f]=p=++s.uuid:p=f),h[p]||(h[p]={},c||(h[p].toJSON=s.noop));if(typeof n=="object"||typeof n=="function")i?h[p]=s.extend(h[p],n):h[p].data=s.extend(h[p].data,n);return o=u=h[p],i||(u.data||(u.data={}),u=u.data),r!==t&&(u[s.camelCase(n)]=r),d&&!u[n]?o.events:(l?(a=u[n],a==null&&(a=u[s.camelCase(n)])):a=u,a)},removeData:function(e,t,n){if(!s.acceptData(e))return;var r,i,o,u=s.expando,a=e.nodeType,f=a?s.cache:e,l=a?e[u]:u;if(!f[l])return;if(t){r=n?f[l]:f[l].data;if(r){s.isArray(t)||(t in r?t=[t]:(t=s.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,o=t.length;i<o;i++)delete r[t[i]];if(!(n?h:s.isEmptyObject)(r))return}}if(!n){delete f[l].data;if(!h(f[l]))return}s.support.deleteExpando||!f.setInterval?delete f[l]:f[l]=null,a&&(s.support.deleteExpando?delete e[u]:e.removeAttribute?e.removeAttribute(u):e[u]=null)},_data:function(e,t,n){return s.data(e,t,n,!0)},acceptData:function(e){if(e.nodeName){var t=s.noData[e.nodeName.toLowerCase()];if(t)return t!==!0&&e.getAttribute("classid")===t}return!0}}),s.fn.extend({data:function(e,n){var r,i,o,u,a,f=this[0],l=0,h=null;if(e===t){if(this.length){h=s.data(f);if(f.nodeType===1&&!s._data(f,"parsedAttrs")){o=f.attributes;for(a=o.length;l<a;l++)u=o[l].name,u.indexOf("data-")===0&&(u=s.camelCase(u.substring(5)),c(f,u,h[u]));s._data(f,"parsedAttrs",!0)}}return h}return typeof e=="object"?this.each(function(){s.data(this,e)}):(r=e.split(".",2),r[1]=r[1]?"."+r[1]:"",i=r[1]+"!",s.access(this,function(n){if(n===t)return h=this.triggerHandler("getData"+i,[r[0]]),h===t&&f&&(h=s.data(f,e),h=c(f,e,h)),h===t&&r[1]?this.data(r[0]):h;r[1]=n,this.each(function(){var t=s(this);t.triggerHandler("setData"+i,r),s.data(this,e,n),t.triggerHandler("changeData"+i,r)})},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){s.removeData(this,e)})}}),s.extend({_mark:function(e,t){e&&(t=(t||"fx")+"mark",s._data(e,t,(s._data(e,t)||0)+1))},_unmark:function(e,t,n){e!==!0&&(n=t,t=e,e=!1);if(t){n=n||"fx";var r=n+"mark",i=e?0:(s._data(t,r)||1)-1;i?s._data(t,r,i):(s.removeData(t,r,!0),p(t,n,"mark"))}},queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=s._data(e,t),n&&(!r||s.isArray(n)?r=s._data(e,t,s.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=s.queue(e,t),r=n.shift(),i={};r==="inprogress"&&(r=n.shift()),r&&(t==="fx"&&n.unshift("inprogress"),s._data(e,t+".run",i),r.call(e,function(){s.dequeue(e,t)},i)),n.length||(s.removeData(e,t+"queue "+t+".run",!0),p(e,t,"queue"))}}),s.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length<r?s.queue(this[0],e):n===t?this:this.each(function(){var t=s.queue(this,e,n);e==="fx"&&t[0]!=="inprogress"&&s.dequeue(this,e)})},dequeue:function(e){return this.each(function(){s.dequeue(this,e)})},delay:function(e,t){return e=s.fx?s.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){function h(){--u||r.resolveWith(i,[i])}typeof e!="string"&&(n=e,e=t),e=e||"fx";var r=s.Deferred(),i=this,o=i.length,u=1,a=e+"defer",f=e+"queue",l=e+"mark",c;while(o--)if(c=s.data(i[o],a,t,!0)||(s.data(i[o],f,t,!0)||s.data(i[o],l,t,!0))&&s.data(i[o],a,s.Callbacks("once memory"),!0))u++,c.add(h);return h(),r.promise(n)}});var d=/[\n\t\r]/g,v=/\s+/,m=/\r/g,g=/^(?:button|input)$/i,y=/^(?:button|input|object|select|textarea)$/i,b=/^a(?:rea)?$/i,w=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,E=s.support.getSetAttribute,S,x,T;s.fn.extend({attr:function(e,t){return s.access(this,s.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){s.removeAttr(this,e)})},prop:function(e,t){return s.access(this,s.prop,e,t,arguments.length>1)},removeProp:function(e){return e=s.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,u,a;if(s.isFunction(e))return this.each(function(t){s(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(v);for(n=0,r=this.length;n<r;n++){i=this[n];if(i.nodeType===1)if(!i.className&&t.length===1)i.className=e;else{o=" "+i.className+" ";for(u=0,a=t.length;u<a;u++)~o.indexOf(" "+t[u]+" ")||(o+=t[u]+" ");i.className=s.trim(o)}}}return this},removeClass:function(e){var n,r,i,o,u,a,f;if(s.isFunction(e))return this.each(function(t){s(this).removeClass(e.call(this,t,this.className))});if(e&&typeof e=="string"||e===t){n=(e||"").split(v);for(r=0,i=this.length;r<i;r++){o=this[r];if(o.nodeType===1&&o.className)if(e){u=(" "+o.className+" ").replace(d," ");for(a=0,f=n.length;a<f;a++)u=u.replace(" "+n[a]+" "," ");o.className=s.trim(u)}else o.className=""}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return s.isFunction(e)?this.each(function(n){s(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,o=0,u=s(this),a=t,f=e.split(v);while(i=f[o++])a=r?a:!u.hasClass(i),u[a?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&s._data(this,"__className__",this.className),this.className=this.className||e===!1?"":s._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n<r;n++)if(this[n].nodeType===1&&(" "+this[n].className+" ").replace(d," ").indexOf(t)>-1)return!0;return!1},val:function(e){var n,r,i,o=this[0];if(!arguments.length){if(o)return n=s.valHooks[o.type]||s.valHooks[o.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(o,"value"))!==t?r:(r=o.value,typeof r=="string"?r.replace(m,""):r==null?"":r);return}return i=s.isFunction(e),this.each(function(r){var o=s(this),u;if(this.nodeType!==1)return;i?u=e.call(this,r,o.val()):u=e,u==null?u="":typeof u=="number"?u+="":s.isArray(u)&&(u=s.map(u,function(e){return e==null?"":e+""})),n=s.valHooks[this.type]||s.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,u,"value")===t)this.value=u})}}),s.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r,i,o=e.selectedIndex,u=[],a=e.options,f=e.type==="select-one";if(o<0)return null;n=f?o:0,r=f?o+1:a.length;for(;n<r;n++){i=a[n];if(i.selected&&(s.support.optDisabled?!i.disabled:i.getAttribute("disabled")===null)&&(!i.parentNode.disabled||!s.nodeName(i.parentNode,"optgroup"))){t=s(i).val();if(f)return t;u.push(t)}}return f&&!u.length&&a.length?s(a[o]).val():u},set:function(e,t){var n=s.makeArray(t);return s(e).find("option").each(function(){this.selected=s.inArray(s(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(e,n,r,i){var o,u,a,f=e.nodeType;if(!e||f===3||f===8||f===2)return;if(i&&n in s.attrFn)return s(e)[n](r);if(typeof e.getAttribute=="undefined")return s.prop(e,n,r);a=f!==1||!s.isXMLDoc(e),a&&(n=n.toLowerCase(),u=s.attrHooks[n]||(w.test(n)?x:S));if(r!==t){if(r===null){s.removeAttr(e,n);return}return u&&"set"in u&&a&&(o=u.set(e,r,n))!==t?o:(e.setAttribute(n,""+r),r)}return u&&"get"in u&&a&&(o=u.get(e,n))!==null?o:(o=e.getAttribute(n),o===null?t:o)},removeAttr:function(e,t){var n,r,i,o,u,a=0;if(t&&e.nodeType===1){r=t.toLowerCase().split(v),o=r.length;for(;a<o;a++)i=r[a],i&&(n=s.propFix[i]||i,u=w.test(i),u||s.attr(e,i,""),e.removeAttribute(E?i:n),u&&n in e&&(e[n]=!1))}},attrHooks:{type:{set:function(e,t){if(g.test(e.nodeName)&&e.parentNode)s.error("type property can't be changed");else if(!s.support.radioValue&&t==="radio"&&s.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return S&&s.nodeName(e,"button")?S.get(e,t):t in e?e.value:null},set:function(e,t,n){if(S&&s.nodeName(e,"button"))return S.set(e,t,n);e.value=t}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;return u=a!==1||!s.isXMLDoc(e),u&&(n=s.propFix[n]||n,o=s.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&(i=o.get(e,n))!==null?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):y.test(e.nodeName)||b.test(e.nodeName)&&e.href?0:t}}}}),s.attrHooks.tabindex=s.propHooks.tabIndex,x={get:function(e,n){var r,i=s.prop(e,n);return i===!0||typeof i!="boolean"&&(r=e.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():t},set:function(e,t,n){var r;return t===!1?s.removeAttr(e,n):(r=s.propFix[n]||n,r in e&&(e[r]=!0),e.setAttribute(n,n.toLowerCase())),n}},E||(T={name:!0,id:!0,coords:!0},S=s.valHooks.button={get:function(e,n){var r;return r=e.getAttributeNode(n),r&&(T[n]?r.nodeValue!=="":r.specified)?r.nodeValue:t},set:function(e,t,r){var i=e.getAttributeNode(r);return i||(i=n.createAttribute(r),e.setAttributeNode(i)),i.nodeValue=t+""}},s.attrHooks.tabindex.set=S.set,s.each(["width","height"],function(e,t){s.attrHooks[t]=s.extend(s.attrHooks[t],{set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}})}),s.attrHooks.contenteditable={get:S.get,set:function(e,t,n){t===""&&(t="false"),S.set(e,t,n)}}),s.support.hrefNormalized||s.each(["href","src","width","height"],function(e,n){s.attrHooks[n]=s.extend(s.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return r===null?t:r}})}),s.support.style||(s.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=""+t}}),s.support.optSelected||(s.propHooks.selected=s.extend(s.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),s.support.enctype||(s.propFix.enctype="encoding"),s.support.checkOn||s.each(["radio","checkbox"],function(){s.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}}),s.each(["radio","checkbox"],function(){s.valHooks[this]=s.extend(s.valHooks[this],{set:function(e,t){if(s.isArray(t))return e.checked=s.inArray(s(e).val(),t)>=0}})});var N=/^(?:textarea|input|select)$/i,C=/^([^\.]*)?(?:\.(.+))?$/,k=/(?:^|\s)hover(\.\S+)?\b/,L=/^key/,A=/^(?:mouse|contextmenu)|click/,O=/^(?:focusinfocus|focusoutblur)$/,M=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,_=function(e){var t=M.exec(e);return t&&(t[1]=(t[1]||"").toLowerCase(),t[3]=t[3]&&new RegExp("(?:^|\\s)"+t[3]+"(?:\\s|$)")),t},D=function(e,t){var n=e.attributes||{};return(!t[1]||e.nodeName.toLowerCase()===t[1])&&(!t[2]||(n.id||{}).value===t[2])&&(!t[3]||t[3].test((n["class"]||{}).value))},P=function(e){return s.event.special.hover?e:e.replace(k,"mouseenter$1 mouseleave$1")};s.event={add:function(e,n,r,i,o){var u,a,f,l,c,h,p,d,v,m,g,y;if(e.nodeType===3||e.nodeType===8||!n||!r||!(u=s._data(e)))return;r.handler&&(v=r,r=v.handler,o=v.selector),r.guid||(r.guid=s.guid++),f=u.events,f||(u.events=f={}),a=u.handle,a||(u.handle=a=function(e){return typeof s=="undefined"||!!e&&s.event.triggered===e.type?t:s.event.dispatch.apply(a.elem,arguments)},a.elem=e),n=s.trim(P(n)).split(" ");for(l=0;l<n.length;l++){c=C.exec(n[l])||[],h=c[1],p=(c[2]||"").split(".").sort(),y=s.event.special[h]||{},h=(o?y.delegateType:y.bindType)||h,y=s.event.special[h]||{},d=s.extend({type:h,origType:c[1],data:i,handler:r,guid:r.guid,selector:o,quick:o&&_(o),namespace:p.join(".")},v),g=f[h];if(!g){g=f[h]=[],g.delegateCount=0;if(!y.setup||y.setup.call(e,i,p,a)===!1)e.addEventListener?e.addEventListener(h,a,!1):e.attachEvent&&e.attachEvent("on"+h,a)}y.add&&(y.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),o?g.splice(g.delegateCount++,0,d):g.push(d),s.event.global[h]=!0}e=null},global:{},remove:function(e,t,n,r,i){var o=s.hasData(e)&&s._data(e),u,a,f,l,c,h,p,d,v,m,g,y;if(!o||!(d=o.events))return;t=s.trim(P(t||"")).split(" ");for(u=0;u<t.length;u++){a=C.exec(t[u])||[],f=l=a[1],c=a[2];if(!f){for(f in d)s.event.remove(e,f+t[u],n,r,!0);continue}v=s.event.special[f]||{},f=(r?v.delegateType:v.bindType)||f,g=d[f]||[],h=g.length,c=c?new RegExp("(^|\\.)"+c.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(p=0;p<g.length;p++)y=g[p],(i||l===y.origType)&&(!n||n.guid===y.guid)&&(!c||c.test(y.namespace))&&(!r||r===y.selector||r==="**"&&y.selector)&&(g.splice(p--,1),y.selector&&g.delegateCount--,v.remove&&v.remove.call(e,y));g.length===0&&h!==g.length&&((!v.teardown||v.teardown.call(e,c)===!1)&&s.removeEvent(e,f,o.handle),delete d[f])}s.isEmptyObject(d)&&(m=o.handle,m&&(m.elem=null),s.removeData(e,["events","handle"],!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,i,o){if(!i||i.nodeType!==3&&i.nodeType!==8){var u=n.type||n,a=[],f,l,c,h,p,d,v,m,g,y;if(O.test(u+s.event.triggered))return;u.indexOf("!")>=0&&(u=u.slice(0,-1),l=!0),u.indexOf(".")>=0&&(a=u.split("."),u=a.shift(),a.sort());if((!i||s.event.customEvent[u])&&!s.event.global[u])return;n=typeof n=="object"?n[s.expando]?n:new s.Event(u,n):new s.Event(u),n.type=u,n.isTrigger=!0,n.exclusive=l,n.namespace=a.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+a.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,d=u.indexOf(":")<0?"on"+u:"";if(!i){f=s.cache;for(c in f)f[c].events&&f[c].events[u]&&s.event.trigger(n,r,f[c].handle.elem,!0);return}n.result=t,n.target||(n.target=i),r=r!=null?s.makeArray(r):[],r.unshift(n),v=s.event.special[u]||{};if(v.trigger&&v.trigger.apply(i,r)===!1)return;g=[[i,v.bindType||u]];if(!o&&!v.noBubble&&!s.isWindow(i)){y=v.delegateType||u,h=O.test(y+u)?i:i.parentNode,p=null;for(;h;h=h.parentNode)g.push([h,y]),p=h;p&&p===i.ownerDocument&&g.push([p.defaultView||p.parentWindow||e,y])}for(c=0;c<g.length&&!n.isPropagationStopped();c++)h=g[c][0],n.type=g[c][1],m=(s._data(h,"events")||{})[n.type]&&s._data(h,"handle"),m&&m.apply(h,r),m=d&&h[d],m&&s.acceptData(h)&&m.apply(h,r)===!1&&n.preventDefault();return n.type=u,!o&&!n.isDefaultPrevented()&&(!v._default||v._default.apply(i.ownerDocument,r)===!1)&&(u!=="click"||!s.nodeName(i,"a"))&&s.acceptData(i)&&d&&i[u]&&(u!=="focus"&&u!=="blur"||n.target.offsetWidth!==0)&&!s.isWindow(i)&&(p=i[d],p&&(i[d]=null),s.event.triggered=u,i[u](),s.event.triggered=t,p&&(i[d]=p)),n.result}return},dispatch:function(n){n=s.event.fix(n||e.event);var r=(s._data(this,"events")||{})[n.type]||[],i=r.delegateCount,o=[].slice.call(arguments,0),u=!n.exclusive&&!n.namespace,a=s.event.special[n.type]||{},f=[],l,c,h,p,d,v,m,g,y,b,w;o[0]=n,n.delegateTarget=this;if(a.preDispatch&&a.preDispatch.call(this,n)===!1)return;if(i&&(!n.button||n.type!=="click")){p=s(this),p.context=this.ownerDocument||this;for(h=n.target;h!=this;h=h.parentNode||this)if(h.disabled!==!0){v={},g=[],p[0]=h;for(l=0;l<i;l++)y=r[l],b=y.selector,v[b]===t&&(v[b]=y.quick?D(h,y.quick):p.is(b)),v[b]&&g.push(y);g.length&&f.push({elem:h,matches:g})}}r.length>i&&f.push({elem:this,matches:r.slice(i)});for(l=0;l<f.length&&!n.isPropagationStopped();l++){m=f[l],n.currentTarget=m.elem;for(c=0;c<m.matches.length&&!n.isImmediatePropagationStopped();c++){y=m.matches[c];if(u||!n.namespace&&!y.namespace||n.namespace_re&&n.namespace_re.test(y.namespace))n.data=y.data,n.handleObj=y,d=((s.event.special[y.origType]||{}).handle||y.handler).apply(m.elem,o),d!==t&&(n.result=d,d===!1&&(n.preventDefault(),n.stopPropagation()))}}return a.postDispatch&&a.postDispatch.call(this,n),n.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return e.which==null&&(e.which=t.charCode!=null?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,r){var i,s,o,u=r.button,a=r.fromElement;return e.pageX==null&&r.clientX!=null&&(i=e.target.ownerDocument||n,s=i.documentElement,o=i.body,e.pageX=r.clientX+(s&&s.scrollLeft||o&&o.scrollLeft||0)-(s&&s.clientLeft||o&&o.clientLeft||0),e.pageY=r.clientY+(s&&s.scrollTop||o&&o.scrollTop||0)-(s&&s.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?r.toElement:a),!e.which&&u!==t&&(e.which=u&1?1:u&2?3:u&4?2:0),e}},fix:function(e){if(e[s.expando])return e;var r,i,o=e,u=s.event.fixHooks[e.type]||{},a=u.props?this.props.concat(u.props):this.props;e=s.Event(o);for(r=a.length;r;)i=a[--r],e[i]=o[i];return e.target||(e.target=o.srcElement||n),e.target.nodeType===3&&(e.target=e.target.parentNode),e.metaKey===t&&(e.metaKey=e.ctrlKey),u.filter?u.filter(e,o):e},special:{ready:{setup:s.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){s.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,r){var i=s.extend(new s.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?s.event.trigger(i,null,t):s.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},s.event.handle=s.event.dispatch,s.removeEvent=n.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){e.detachEvent&&e.detachEvent("on"+t,n)},s.Event=function(e,t){if(!(this instanceof s.Event))return new s.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?B:H):this.type=e,t&&s.extend(this,t),this.timeStamp=e&&e.timeStamp||s.now(),this[s.expando]=!0},s.Event.prototype={preventDefault:function(){this.isDefaultPrevented=B;var e=this.originalEvent;if(!e)return;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=B;var e=this.originalEvent;if(!e)return;e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=B,this.stopPropagation()},isDefaultPrevented:H,isPropagationStopped:H,isImmediatePropagationStopped:H},s.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){s.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n=this,r=e.relatedTarget,i=e.handleObj,o=i.selector,u;if(!r||r!==n&&!s.contains(n,r))e.type=i.origType,u=i.handler.apply(this,arguments),e.type=t;return u}}}),s.support.submitBubbles||(s.event.special.submit={setup:function(){if(s.nodeName(this,"form"))return!1;s.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=s.nodeName(n,"input")||s.nodeName(n,"button")?n.form:t;r&&!r._submit_attached&&(s.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),r._submit_attached=!0)})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&s.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(s.nodeName(this,"form"))return!1;s.event.remove(this,"._submit")}}),s.support.changeBubbles||(s.event.special.change={setup:function(){if(N.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")s.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),s.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1,s.event.simulate("change",this,e,!0))});return!1}s.event.add(this,"beforeactivate._change",function(e){var t=e.target;N.test(t.nodeName)&&!t._change_attached&&(s.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&s.event.simulate("change",this.parentNode,e,!0)}),t._change_attached=!0)})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return s.event.remove(this,"._change"),N.test(this.nodeName)}}),s.support.focusinBubbles||s.each({focus:"focusin",blur:"focusout"},function(e,t){var r=0,i=function(e){s.event.simulate(t,e.target,s.event.fix(e),!0)};s.event.special[t]={setup:function(){r++===0&&n.addEventListener(e,i,!0)},teardown:function(){--r===0&&n.removeEventListener(e,i,!0)}}}),s.fn.extend({on:function(e,n,r,i,o){var u,a;if(typeof e=="object"){typeof n!="string"&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}r==null&&i==null?(i=n,r=n=t):i==null&&(typeof n=="string"?(i=r,r=t):(i=r,r=n,n=t));if(i===!1)i=H;else if(!i)return this;return o===1&&(u=i,i=function(e){return s().off(e),u.apply(this,arguments)},i.guid=u.guid||(u.guid=s.guid++)),this.each(function(){s.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){if(e&&e.preventDefault&&e.handleObj){var i=e.handleObj;return s(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this}if(typeof e=="object"){for(var o in e)this.off(o,n,e[o]);return this}if(n===!1||typeof n=="function")r=n,n=t;return r===!1&&(r=H),this.each(function(){s.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return s(this.context).on(e,this.selector,t,n),this},die:function(e,t){return s(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length==1?this.off(e,"**"):this.off(t,e,n)},trigger:function(e,t){return this.each(function(){s.event.trigger(e,t,this)})},triggerHandler:function(e,t){if(this[0])return s.event.trigger(e,t,this[0],!0)},toggle:function(e){var t=arguments,n=e.guid||s.guid++,r=0,i=function(n){var i=(s._data(this,"lastToggle"+e.guid)||0)%r;return s._data(this,"lastToggle"+e.guid,i+1),n.preventDefault(),t[i].apply(this,arguments)||!1};i.guid=n;while(r<t.length)t[r++].guid=n;return this.click(i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),s.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){s.fn[t]=function(e,n){return n==null&&(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},s.attrFn&&(s.attrFn[t]=!0),L.test(t)&&(s.event.fixHooks[t]=s.event.keyHooks),A.test(t)&&(s.event.fixHooks[t]=s.event.mouseHooks)}),function(){function S(e,t,n,i,s,o){for(var u=0,a=i.length;u<a;u++){var f=i[u];if(f){var l=!1;f=f[e];while(f){if(f[r]===n){l=i[f.sizset];break}f.nodeType===1&&!o&&(f[r]=n,f.sizset=u);if(f.nodeName.toLowerCase()===t){l=f;break}f=f[e]}i[u]=l}}}function x(e,t,n,i,s,o){for(var u=0,a=i.length;u<a;u++){var f=i[u];if(f){var l=!1;f=f[e];while(f){if(f[r]===n){l=i[f.sizset];break}if(f.nodeType===1){o||(f[r]=n,f.sizset=u);if(typeof t!="string"){if(f===t){l=!0;break}}else if(h.filter(t,[f]).length>0){l=f;break}}f=f[e]}i[u]=l}}}var e=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,r="sizcache"+(Math.random()+"").replace(".",""),i=0,o=Object.prototype.toString,u=!1,a=!0,f=/\\/g,l=/\r\n/g,c=/\W/;[0,0].sort(function(){return a=!1,0});var h=function(t,r,i,s){i=i||[],r=r||n;var u=r;if(r.nodeType!==1&&r.nodeType!==9)return[];if(!t||typeof t!="string")return i;var a,f,l,c,p,m,g,b,w=!0,E=h.isXML(r),S=[],x=t;do{e.exec(""),a=e.exec(x);if(a){x=a[3],S.push(a[1]);if(a[2]){c=a[3];break}}}while(a);if(S.length>1&&v.exec(t))if(S.length===2&&d.relative[S[0]])f=T(S[0]+S[1],r,s);else{f=d.relative[S[0]]?[r]:h(S.shift(),r);while(S.length)t=S.shift(),d.relative[t]&&(t+=S.shift()),f=T(t,f,s)}else{!s&&S.length>1&&r.nodeType===9&&!E&&d.match.ID.test(S[0])&&!d.match.ID.test(S[S.length-1])&&(p=h.find(S.shift(),r,E),r=p.expr?h.filter(p.expr,p.set)[0]:p.set[0]);if(r){p=s?{expr:S.pop(),set:y(s)}:h.find(S.pop(),S.length!==1||S[0]!=="~"&&S[0]!=="+"||!r.parentNode?r:r.parentNode,E),f=p.expr?h.filter(p.expr,p.set):p.set,S.length>0?l=y(f):w=!1;while(S.length)m=S.pop(),g=m,d.relative[m]?g=S.pop():m="",g==null&&(g=r),d.relative[m](l,g,E)}else l=S=[]}l||(l=f),l||h.error(m||t);if(o.call(l)==="[object Array]")if(!w)i.push.apply(i,l);else if(r&&r.nodeType===1)for(b=0;l[b]!=null;b++)l[b]&&(l[b]===!0||l[b].nodeType===1&&h.contains(r,l[b]))&&i.push(f[b]);else for(b=0;l[b]!=null;b++)l[b]&&l[b].nodeType===1&&i.push(f[b]);else y(l,i);return c&&(h(c,u,i,s),h.uniqueSort(i)),i};h.uniqueSort=function(e){if(w){u=a,e.sort(w);if(u)for(var t=1;t<e.length;t++)e[t]===e[t-1]&&e.splice(t--,1)}return e},h.matches=function(e,t){return h(e,null,null,t)},h.matchesSelector=function(e,t){return h(t,null,null,[e]).length>0},h.find=function(e,t,n){var r,i,s,o,u,a;if(!e)return[];for(i=0,s=d.order.length;i<s;i++){u=d.order[i];if(o=d.leftMatch[u].exec(e)){a=o[1],o.splice(1,1);if(a.substr(a.length-1)!=="\\"){o[1]=(o[1]||"").replace(f,""),r=d.find[u](o,t,n);if(r!=null){e=e.replace(d.match[u],"");break}}}}return r||(r=typeof t.getElementsByTagName!="undefined"?t.getElementsByTagName("*"):[]),{set:r,expr:e}},h.filter=function(e,n,r,i){var s,o,u,a,f,l,c,p,v,m=e,g=[],y=n,b=n&&n[0]&&h.isXML(n[0]);while(e&&n.length){for(u in d.filter)if((s=d.leftMatch[u].exec(e))!=null&&s[2]){l=d.filter[u],c=s[1],o=!1,s.splice(1,1);if(c.substr(c.length-1)==="\\")continue;y===g&&(g=[]);if(d.preFilter[u]){s=d.preFilter[u](s,y,r,g,i,b);if(!s)o=a=!0;else if(s===!0)continue}if(s)for(p=0;(f=y[p])!=null;p++)f&&(a=l(f,s,p,y),v=i^a,r&&a!=null?v?o=!0:y[p]=!1:v&&(g.push(f),o=!0));if(a!==t){r||(y=g),e=e.replace(d.match[u],"");if(!o)return[];break}}if(e===m){if(o!=null)break;h.error(e)}m=e}return y},h.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)};var p=h.getText=function(e){var t,n,r=e.nodeType,i="";if(r){if(r===1||r===9||r===11){if(typeof e.textContent=="string")return e.textContent;if(typeof e.innerText=="string")return e.innerText.replace(l,"");for(e=e.firstChild;e;e=e.nextSibling)i+=p(e)}else if(r===3||r===4)return e.nodeValue}else for(t=0;n=e[t];t++)n.nodeType!==8&&(i+=p(n));return i},d=h.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")},type:function(e){return e.getAttribute("type")}},relative:{"+":function(e,t){var n=typeof t=="string",r=n&&!c.test(t),i=n&&!r;r&&(t=t.toLowerCase());for(var s=0,o=e.length,u;s<o;s++)if(u=e[s]){while((u=u.previousSibling)&&u.nodeType!==1);e[s]=i||u&&u.nodeName.toLowerCase()===t?u||!1:u===t}i&&h.filter(t,e,!0)},">":function(e,t){var n,r=typeof t=="string",i=0,s=e.length;if(r&&!c.test(t)){t=t.toLowerCase();for(;i<s;i++){n=e[i];if(n){var o=n.parentNode;e[i]=o.nodeName.toLowerCase()===t?o:!1}}}else{for(;i<s;i++)n=e[i],n&&(e[i]=r?n.parentNode:n.parentNode===t);r&&h.filter(t,e,!0)}},"":function(e,t,n){var r,s=i++,o=x;typeof t=="string"&&!c.test(t)&&(t=t.toLowerCase(),r=t,o=S),o("parentNode",t,s,e,r,n)},"~":function(e,t,n){var r,s=i++,o=x;typeof t=="string"&&!c.test(t)&&(t=t.toLowerCase(),r=t,o=S),o("previousSibling",t,s,e,r,n)}},find:{ID:function(e,t,n){if(typeof t.getElementById!="undefined"&&!n){var r=t.getElementById(e[1]);return r&&r.parentNode?[r]:[]}},NAME:function(e,t){if(typeof t.getElementsByName!="undefined"){var n=[],r=t.getElementsByName(e[1]);for(var i=0,s=r.length;i<s;i++)r[i].getAttribute("name")===e[1]&&n.push(r[i]);return n.length===0?null:n}},TAG:function(e,t){if(typeof t.getElementsByTagName!="undefined")return t.getElementsByTagName(e[1])}},preFilter:{CLASS:function(e,t,n,r,i,s){e=" "+e[1].replace(f,"")+" ";if(s)return e;for(var o=0,u;(u=t[o])!=null;o++)u&&(i^(u.className&&(" "+u.className+" ").replace(/[\t\n\r]/g," ").indexOf(e)>=0)?n||r.push(u):n&&(t[o]=!1));return!1},ID:function(e){return e[1].replace(f,"")},TAG:function(e,t){return e[1].replace(f,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){e[2]||h.error(e[0]),e[2]=e[2].replace(/^\+|\s*/g,"");var t=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=t[1]+(t[2]||1)-0,e[3]=t[3]-0}else e[2]&&h.error(e[0]);return e[0]=i++,e},ATTR:function(e,t,n,r,i,s){var o=e[1]=e[1].replace(f,"");return!s&&d.attrMap[o]&&(e[1]=d.attrMap[o]),e[4]=(e[4]||e[5]||"").replace(f,""),e[2]==="~="&&(e[4]=" "+e[4]+" "),e},PSEUDO:function(t,n,r,i,s){if(t[1]==="not"){if(!((e.exec(t[3])||"").length>1||/^\w/.test(t[3]))){var o=h.filter(t[3],n,r,!0^s);return r||i.push.apply(i,o),!1}t[3]=h(t[3],null,null,n)}else if(d.match.POS.test(t[0])||d.match.CHILD.test(t[0]))return!0;return t},POS:function(e){return e.unshift(!0),e}},filters:{enabled:function(e){return e.disabled===!1&&e.type!=="hidden"},disabled:function(e){return e.disabled===!0},checked:function(e){return e.checked===!0},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!!e.firstChild},empty:function(e){return!e.firstChild},has:function(e,t,n){return!!h(n[3],e).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){var t=e.getAttribute("type"),n=e.type;return e.nodeName.toLowerCase()==="input"&&"text"===n&&(t===n||t===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(e){var t=e.nodeName.toLowerCase();return(t==="input"||t==="button")&&"submit"===e.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(e){var t=e.nodeName.toLowerCase();return(t==="input"||t==="button")&&"reset"===e.type},button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&"button"===e.type||t==="button"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(e,t){return t===0},last:function(e,t,n,r){return t===r.length-1},even:function(e,t){return t%2===0},odd:function(e,t){return t%2===1},lt:function(e,t,n){return t<n[3]-0},gt:function(e,t,n){return t>n[3]-0},nth:function(e,t,n){return n[3]-0===t},eq:function(e,t,n){return n[3]-0===t}},filter:{PSEUDO:function(e,t,n,r){var i=t[1],s=d.filters[i];if(s)return s(e,n,t,r);if(i==="contains")return(e.textContent||e.innerText||p([e])||"").indexOf(t[3])>=0;if(i==="not"){var o=t[3];for(var u=0,a=o.length;u<a;u++)if(o[u]===e)return!1;return!0}h.error(i)},CHILD:function(e,t){var n,i,s,o,u,a,f,l=t[1],c=e;switch(l){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(l==="first")return!0;c=e;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0;case"nth":n=t[2],i=t[3];if(n===1&&i===0)return!0;s=t[0],o=e.parentNode;if(o&&(o[r]!==s||!e.nodeIndex)){a=0;for(c=o.firstChild;c;c=c.nextSibling)c.nodeType===1&&(c.nodeIndex=++a);o[r]=s}return f=e.nodeIndex-i,n===0?f===0:f%n===0&&f/n>=0}},ID:function(e,t){return e.nodeType===1&&e.getAttribute("id")===t},TAG:function(e,t){return t==="*"&&e.nodeType===1||!!e.nodeName&&e.nodeName.toLowerCase()===t},CLASS:function(e,t){return(" "+(e.className||e.getAttribute("class"))+" ").indexOf(t)>-1},ATTR:function(e,t){var n=t[1],r=h.attr?h.attr(e,n):d.attrHandle[n]?d.attrHandle[n](e):e[n]!=null?e[n]:e.getAttribute(n),i=r+"",s=t[2],o=t[4];return r==null?s==="!=":!s&&h.attr?r!=null:s==="="?i===o:s==="*="?i.indexOf(o)>=0:s==="~="?(" "+i+" ").indexOf(o)>=0:o?s==="!="?i!==o:s==="^="?i.indexOf(o)===0:s==="$="?i.substr(i.length-o.length)===o:s==="|="?i===o||i.substr(0,o.length+1)===o+"-":!1:i&&r!==!1},POS:function(e,t,n,r){var i=t[2],s=d.setFilters[i];if(s)return s(e,n,t,r)}}},v=d.match.POS,m=function(e,t){return"\\"+(t-0+1)};for(var g in d.match)d.match[g]=new RegExp(d.match[g].source+/(?![^\[]*\])(?![^\(]*\))/.source),d.leftMatch[g]=new RegExp(/(^(?:.|\r|\n)*?)/.source+d.match[g].source.replace(/\\(\d+)/g,m));d.match.globalPOS=v;var y=function(e,t){return e=Array.prototype.slice.call(e,0),t?(t.push.apply(t,e),t):e};try{Array.prototype.slice.call(n.documentElement.childNodes,0)[0].nodeType}catch(b){y=function(e,t){var n=0,r=t||[];if(o.call(e)==="[object Array]")Array.prototype.push.apply(r,e);else if(typeof e.length=="number")for(var i=e.length;n<i;n++)r.push(e[n]);else for(;e[n];n++)r.push(e[n]);return r}}var w,E;n.documentElement.compareDocumentPosition?w=function(e,t){return e===t?(u=!0,0):!e.compareDocumentPosition||!t.compareDocumentPosition?e.compareDocumentPosition?-1:1:e.compareDocumentPosition(t)&4?-1:1}:(w=function(e,t){if(e===t)return u=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,r,i=[],s=[],o=e.parentNode,a=t.parentNode,f=o;if(o===a)return E(e,t);if(!o)return-1;if(!a)return 1;while(f)i.unshift(f),f=f.parentNode;f=a;while(f)s.unshift(f),f=f.parentNode;n=i.length,r=s.length;for(var l=0;l<n&&l<r;l++)if(i[l]!==s[l])return E(i[l],s[l]);return l===n?E(e,s[l],-1):E(i[l],t,1)},E=function(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}),function(){var e=n.createElement("div"),r="script"+(new Date).getTime(),i=n.documentElement;e.innerHTML="<a name='"+r+"'/>",i.insertBefore(e,i.firstChild),n.getElementById(r)&&(d.find.ID=function(e,n,r){if(typeof n.getElementById!="undefined"&&!r){var i=n.getElementById(e[1]);return i?i.id===e[1]||typeof i.getAttributeNode!="undefined"&&i.getAttributeNode("id").nodeValue===e[1]?[i]:t:[]}},d.filter.ID=function(e,t){var n=typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id");return e.nodeType===1&&n&&n.nodeValue===t}),i.removeChild(e),i=e=null}(),function(){var e=n.createElement("div");e.appendChild(n.createComment("")),e.getElementsByTagName("*").length>0&&(d.find.TAG=function(e,t){var n=t.getElementsByTagName(e[1]);if(e[1]==="*"){var r=[];for(var i=0;n[i];i++)n[i].nodeType===1&&r.push(n[i]);n=r}return n}),e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!="undefined"&&e.firstChild.getAttribute("href")!=="#"&&(d.attrHandle.href=function(e){return e.getAttribute("href",2)}),e=null}(),n.querySelectorAll&&function(){var e=h,t=n.createElement("div"),r="__sizzle__";t.innerHTML="<p class='TEST'></p>";if(t.querySelectorAll&&t.querySelectorAll(".TEST").length===0)return;h=function(t,i,s,o){i=i||n;if(!o&&!h.isXML(i)){var u=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(t);if(u&&(i.nodeType===1||i.nodeType===9)){if(u[1])return y(i.getElementsByTagName(t),s);if(u[2]&&d.find.CLASS&&i.getElementsByClassName)return y(i.getElementsByClassName(u[2]),s)}if(i.nodeType===9){if(t==="body"&&i.body)return y([i.body],s);if(u&&u[3]){var a=i.getElementById(u[3]);if(!a||!a.parentNode)return y([],s);if(a.id===u[3])return y([a],s)}try{return y(i.querySelectorAll(t),s)}catch(f){}}else if(i.nodeType===1&&i.nodeName.toLowerCase()!=="object"){var l=i,c=i.getAttribute("id"),p=c||r,v=i.parentNode,m=/^\s*[+~]/.test(t);c?p=p.replace(/'/g,"\\$&"):i.setAttribute("id",p),m&&v&&(i=i.parentNode);try{if(!m||v)return y(i.querySelectorAll("[id='"+p+"'] "+t),s)}catch(g){}finally{c||l.removeAttribute("id")}}}return e(t,i,s,o)};for(var i in e)h[i]=e[i];t=null}(),function(){var e=n.documentElement,t=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(t){var r=!t.call(n.createElement("div"),"div"),i=!1;try{t.call(n.documentElement,"[test!='']:sizzle")}catch(s){i=!0}h.matchesSelector=function(e,n){n=n.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!h.isXML(e))try{if(i||!d.match.PSEUDO.test(n)&&!/!=/.test(n)){var s=t.call(e,n);if(s||!r||e.document&&e.document.nodeType!==11)return s}}catch(o){}return h(n,null,null,[e]).length>0}}}(),function(){var e=n.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0)return;e.lastChild.className="e";if(e.getElementsByClassName("e").length===1)return;d.order.splice(1,0,"CLASS"),d.find.CLASS=function(e,t,n){if(typeof t.getElementsByClassName!="undefined"&&!n)return t.getElementsByClassName(e[1])},e=null}(),n.documentElement.contains?h.contains=function(e,t){return e!==t&&(e.contains?e.contains(t):!0)}:n.documentElement.compareDocumentPosition?h.contains=function(e,t){return!!(e.compareDocumentPosition(t)&16)}:h.contains=function(){return!1},h.isXML=function(e){var t=(e?e.ownerDocument||e:0).documentElement;return t?t.nodeName!=="HTML":!1};var T=function(e,t,n){var r,i=[],s="",o=t.nodeType?[t]:t;while(r=d.match.PSEUDO.exec(e))s+=r[0],e=e.replace(d.match.PSEUDO,"");e=d.relative[e]?e+"*":e;for(var u=0,a=o.length;u<a;u++)h(e,o[u],i,n);return h.filter(s,i)};h.attr=s.attr,h.selectors.attrMap={},s.find=h,s.expr=h.selectors,s.expr[":"]=s.expr.filters,s.unique=h.uniqueSort,s.text=h.getText,s.isXMLDoc=h.isXML,s.contains=h.contains}();var j=/Until$/,F=/^(?:parents|prevUntil|prevAll)/,I=/,/,q=/^.[^:#\[\.,]*$/,R=Array.prototype.slice,U=s.expr.match.globalPOS,z={children:!0,contents:!0,next:!0,prev:!0};s.fn.extend({find:function(e){var t=this,n,r;if(typeof e!="string")return s(e).filter(function(){for(n=0,r=t.length;n<r;n++)if(s.contains(t[n],this))return!0});var i=this.pushStack("","find",e),o,u,a;for(n=0,r=this.length;n<r;n++){o=i.length,s.find(e,this[n],i);if(n>0)for(u=o;u<i.length;u++)for(a=0;a<o;a++)if(i[a]===i[u]){i.splice(u--,1);break}}return i},has:function(e){var t=s(e);return this.filter(function(){for(var e=0,n=t.length;e<n;e++)if(s.contains(this,t[e]))return!0})},not:function(e){return this.pushStack(X(this,e,!1),"not",e)},filter:function(e){return this.pushStack(X(this,e,!0),"filter",e)},is:function(e){return!!e&&(typeof e=="string"?U.test(e)?s(e,this.context).index(this[0])>=0:s.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n=[],r,i,o=this[0];if(s.isArray(e)){var u=1;while(o&&o.ownerDocument&&o!==t){for(r=0;r<e.length;r++)s(o).is(e[r])&&n.push({selector:e[r],elem:o,level:u});o=o.parentNode,u++}return n}var a=U.test(e)||typeof e!="string"?s(e,t||this.context):0;for(r=0,i=this.length;r<i;r++){o=this[r];while(o){if(a?a.index(o)>-1:s.find.matchesSelector(o,e)){n.push(o);break}o=o.parentNode;if(!o||!o.ownerDocument||o===t||o.nodeType===11)break}}return n=n.length>1?s.unique(n):n,this.pushStack(n,"closest",e)},index:function(e){return e?typeof e=="string"?s.inArray(this[0],s(e)):s.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?s(e,t):s.makeArray(e&&e.nodeType?[e]:e),r=s.merge(this.get(),n);return this.pushStack(W(n[0])||W(r[0])?r:s.unique(r))},andSelf:function(){return this.add(this.prevObject)}}),s.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return s.dir(e,"parentNode")},parentsUntil:function(e,t,n){return s.dir(e,"parentNode",n)},next:function(e){return s.nth(e,2,"nextSibling")},prev:function(e){return s.nth(e,2,"previousSibling")},nextAll:function(e){return s.dir(e,"nextSibling")},prevAll:function(e){return s.dir(e,"previousSibling")},nextUntil:function(e,t,n){return s.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return s.dir(e,"previousSibling",n)},siblings:function(e){return s.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return s.sibling(e.firstChild)},contents:function(e){return s.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:s.makeArray(e.childNodes)}},function(e,t){s.fn[e]=function(n,r){var i=s.map(this,t,n);return j.test(e)||(r=n),r&&typeof r=="string"&&(i=s.filter(r,i)),i=this.length>1&&!z[e]?s.unique(i):i,(this.length>1||I.test(r))&&F.test(e)&&(i=i.reverse()),this.pushStack(i,e,R.call(arguments).join(","))}}),s.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?s.find.matchesSelector(t[0],e)?[t[0]]:[]:s.find.matches(e,t)},dir:function(e,n,r){var i=[],o=e[n];while(o&&o.nodeType!==9&&(r===t||o.nodeType!==1||!s(o).is(r)))o.nodeType===1&&i.push(o),o=o[n];return i},nth:function(e,t,n,r){t=t||1;var i=0;for(;e;e=e[n])if(e.nodeType===1&&++i===t)break;return e},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var $="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",J=/ jQuery\d+="(?:\d+|null)"/g,K=/^\s+/,Q=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,G=/<([\w:]+)/,Y=/<tbody/i,Z=/<|&#?\w+;/,et=/<(?:script|style)/i,tt=/<(?:script|object|embed|option|style)/i,nt=new RegExp("<(?:"+$+")[\\s/>]","i"),rt=/checked\s*(?:[^=]|=\s*.checked.)/i,it=/\/(java|ecma)script/i,st=/^\s*<!(?:\[CDATA\[|\-\-)/,ot={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},ut=V(n);ot.optgroup=ot.option,ot.tbody=ot.tfoot=ot.colgroup=ot.caption=ot.thead,ot.th=ot.td,s.support.htmlSerialize||(ot._default=[1,"div<div>","</div>"]),s.fn.extend({text:function(e){return s.access(this,function(e){return e===t?s.text(this):this.empty().append((this[0]&&this[0].ownerDocument||n).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(s.isFunction(e))return this.each(function(t){s(this).wrapAll(e.call(this,t))});if(this[0]){var t=s(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return s.isFunction(e)?this.each(function(t){s(this).wrapInner(e.call(this,t))}):this.each(function(){var t=s(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=s.isFunction(e);return this.each(function(n){s(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){s.nodeName(this,"body")||s(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){this.nodeType===1&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){this.nodeType===1&&this.insertBefore(e,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=s.clean(arguments);return e.push.apply(e,this.toArray()),this.pushStack(e,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=this.pushStack(this,"after",arguments);return e.push.apply(e,s.clean(arguments)),e}},remove:function(e,t){for(var n=0,r;(r=this[n])!=null;n++)if(!e||s.filter(e,[r]).length)!t&&r.nodeType===1&&(s.cleanData(r.getElementsByTagName("*")),s.cleanData([r])),r.parentNode&&r.parentNode.removeChild(r);return this},empty:function(){for(var e=0,t;(t=this[e])!=null;e++){t.nodeType===1&&s.cleanData(t.getElementsByTagName("*"));while(t.firstChild)t.removeChild(t.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return s.clone(this,e,t)})},html:function(e){return s.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(J,""):null;if(typeof e=="string"&&!et.test(e)&&(s.support.leadingWhitespace||!K.test(e))&&!ot[(G.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(Q,"<$1></$2>");try{for(;r<i;r++)n=this[r]||{},n.nodeType===1&&(s.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return this[0]&&this[0].parentNode?s.isFunction(e)?this.each(function(t){var n=s(this),r=n.html();n.replaceWith(e.call(this,t,r))}):(typeof e!="string"&&(e=s(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;s(this).remove(),t?s(t).before(e):s(n).append(e)})):this.length?this.pushStack(s(s.isFunction(e)?e():e),"replaceWith",e):this},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){var i,o,u,a,f=e[0],l=[];if(!s.support.checkClone&&arguments.length===3&&typeof f=="string"&&rt.test(f))return this.each(function(){s(this).domManip(e,n,r,!0)});if(s.isFunction(f))return this.each(function(i){var o=s(this);e[0]=f.call(this,i,n?o.html():t),o.domManip(e,n,r)});if(this[0]){a=f&&f.parentNode,s.support.parentNode&&a&&a.nodeType===11&&a.childNodes.length===this.length?i={fragment:a}:i=s.buildFragment(e,this,l),u=i.fragment,u.childNodes.length===1?o=u=u.firstChild:o=u.firstChild;if(o){n=n&&s.nodeName(o,"tr");for(var c=0,h=this.length,p=h-1;c<h;c++)r.call(n?at(this[c],o):this[c],i.cacheable||h>1&&c<p?s.clone(u,!0,!0):u)}l.length&&s.each(l,function(e,t){t.src?s.ajax({type:"GET",global:!1,url:t.src,async:!1,dataType:"script"}):s.globalEval((t.text||t.textContent||t.innerHTML||"").replace(st,"/*$0*/")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),s.buildFragment=function(e,t,r){var i,o,u,a,f=e[0];return t&&t[0]&&(a=t[0].ownerDocument||t[0]),a.createDocumentFragment||(a=n),e.length===1&&typeof f=="string"&&f.length<512&&a===n&&f.charAt(0)==="<"&&!tt.test(f)&&(s.support.checkClone||!rt.test(f))&&(s.support.html5Clone||!nt.test(f))&&(o=!0,u=s.fragments[f],u&&u!==1&&(i=u)),i||(i=a.createDocumentFragment(),s.clean(e,a,i,r)),o&&(s.fragments[f]=u?i:1),{fragment:i,cacheable:o}},s.fragments={},s.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){s.fn[e]=function(n){var r=[],i=s(n),o=this.length===1&&this[0].parentNode;if(o&&o.nodeType===11&&o.childNodes.length===1&&i.length===1)return i[t](this[0]),this;for(var u=0,a=i.length;u<a;u++){var f=(u>0?this.clone(!0):this).get();s(i[u])[t](f),r=r.concat(f)}return this.pushStack(r,e,i.selector)}}),s.extend({clone:function(e,t,n){var r,i,o,u=s.support.html5Clone||s.isXMLDoc(e)||!nt.test("<"+e.nodeName+">")?e.cloneNode(!0):dt(e);if((!s.support.noCloneEvent||!s.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!s.isXMLDoc(e)){lt(e,u),r=ct(e),i=ct(u);for(o=0;r[o];++o)i[o]&<(r[o],i[o])}if(t){ft(e,u);if(n){r=ct(e),i=ct(u);for(o=0;r[o];++o)ft(r[o],i[o])}}return r=i=null,u},clean:function(e,t,r,i){var o,u,a,f=[];t=t||n,typeof t.createElement=="undefined"&&(t=t.ownerDocument||t[0]&&t[0].ownerDocument||n);for(var l=0,c;(c=e[l])!=null;l++){typeof c=="number"&&(c+="");if(!c)continue;if(typeof c=="string")if(!Z.test(c))c=t.createTextNode(c);else{c=c.replace(Q,"<$1></$2>");var h=(G.exec(c)||["",""])[1].toLowerCase(),p=ot[h]||ot._default,d=p[0],v=t.createElement("div"),m=ut.childNodes,g;t===n?ut.appendChild(v):V(t).appendChild(v),v.innerHTML=p[1]+c+p[2];while(d--)v=v.lastChild;if(!s.support.tbody){var y=Y.test(c),b=h==="table"&&!y?v.firstChild&&v.firstChild.childNodes:p[1]==="<table>"&&!y?v.childNodes:[];for(a=b.length-1;a>=0;--a)s.nodeName(b[a],"tbody")&&!b[a].childNodes.length&&b[a].parentNode.removeChild(b[a])}!s.support.leadingWhitespace&&K.test(c)&&v.insertBefore(t.createTextNode(K.exec(c)[0]),v.firstChild),c=v.childNodes,v&&(v.parentNode.removeChild(v),m.length>0&&(g=m[m.length-1],g&&g.parentNode&&g.parentNode.removeChild(g)))}var w;if(!s.support.appendChecked)if(c[0]&&typeof (w=c.length)=="number")for(a=0;a<w;a++)pt(c[a]);else pt(c);c.nodeType?f.push(c):f=s.merge(f,c)}if(r){o=function(e){return!e.type||it.test(e.type)};for(l=0;f[l];l++){u=f[l];if(i&&s.nodeName(u,"script")&&(!u.type||it.test(u.type)))i.push(u.parentNode?u.parentNode.removeChild(u):u);else{if(u.nodeType===1){var E=s.grep(u.getElementsByTagName("script"),o);f.splice.apply(f,[l+1,0].concat(E))}r.appendChild(u)}}}return f},cleanData:function(e){var t,n,r=s.cache,i=s.event.special,o=s.support.deleteExpando;for(var u=0,a;(a=e[u])!=null;u++){if(a.nodeName&&s.noData[a.nodeName.toLowerCase()])continue;n=a[s.expando];if(n){t=r[n];if(t&&t.events){for(var f in t.events)i[f]?s.event.remove(a,f):s.removeEvent(a,f,t.handle);t.handle&&(t.handle.elem=null)}o?delete a[s.expando]:a.removeAttribute&&a.removeAttribute(s.expando),delete r[n]}}}});var vt=/alpha\([^)]*\)/i,mt=/opacity=([^)]*)/,gt=/([A-Z]|^ms)/g,yt=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,wt=/^([\-+])=([\-+.\de]+)/,Et=/^margin/,St={position:"absolute",visibility:"hidden",display:"block"},xt=["Top","Right","Bottom","Left"],Tt,Nt,Ct;s.fn.css=function(e,n){return s.access(this,function(e,n,r){return r!==t?s.style(e,n,r):s.css(e,n)},e,n,arguments.length>1)},s.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Tt(e,"opacity");return n===""?"1":n}return e.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":s.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var o,u,a=s.camelCase(n),f=e.style,l=s.cssHooks[a];n=s.cssProps[a]||a;if(r===t)return l&&"get"in l&&(o=l.get(e,!1,i))!==t?o:f[n];u=typeof r,u==="string"&&(o=wt.exec(r))&&(r=+(o[1]+1)*+o[2]+parseFloat(s.css(e,n)),u="number");if(r==null||u==="number"&&isNaN(r))return;u==="number"&&!s.cssNumber[a]&&(r+="px");if(!l||!("set"in l)||(r=l.set(e,r))!==t)try{f[n]=r}catch(c){}},css:function(e,n,r){var i,o;n=s.camelCase(n),o=s.cssHooks[n],n=s.cssProps[n]||n,n==="cssFloat"&&(n="float");if(o&&"get"in o&&(i=o.get(e,!0,r))!==t)return i;if(Tt)return Tt(e,n)},swap:function(e,t,n){var r={},i,s;for(s in t)r[s]=e.style[s],e.style[s]=t[s];i=n.call(e);for(s in t)e.style[s]=r[s];return i}}),s.curCSS=s.css,n.defaultView&&n.defaultView.getComputedStyle&&(Nt=function(e,t){var n,r,i,o,u=e.style;return t=t.replace(gt,"-$1").toLowerCase(),(r=e.ownerDocument.defaultView)&&(i=r.getComputedStyle(e,null))&&(n=i.getPropertyValue(t),n===""&&!s.contains(e.ownerDocument.documentElement,e)&&(n=s.style(e,t))),!s.support.pixelMargin&&i&&Et.test(t)&&bt.test(n)&&(o=u.width,u.width=n,n=i.width,u.width=o),n}),n.documentElement.currentStyle&&(Ct=function(e,t){var n,r,i,s=e.currentStyle&&e.currentStyle[t],o=e.style;return s==null&&o&&(i=o[t])&&(s=i),bt.test(s)&&(n=o.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),o.left=t==="fontSize"?"1em":s,s=o.pixelLeft+"px",o.left=n,r&&(e.runtimeStyle.left=r)),s===""?"auto":s}),Tt=Nt||Ct,s.each(["height","width"],function(e,t){s.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth!==0?kt(e,t,r):s.swap(e,St,function(){return kt(e,t,r)})},set:function(e,t){return yt.test(t)?t+"px":t}}}),s.support.opacity||(s.cssHooks.opacity={get:function(e,t){return mt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?parseFloat(RegExp.$1)/100+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=s.isNumeric(t)?"alpha(opacity="+t*100+")":"",o=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&s.trim(o.replace(vt,""))===""){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=vt.test(o)?o.replace(vt,i):o+" "+i}}),s(function(){s.support.reliableMarginRight||(s.cssHooks.marginRight={get:function(e,t){return s.swap(e,{display:"inline-block"},function(){return t?Tt(e,"margin-right"):e.style.marginRight})}})}),s.expr&&s.expr.filters&&(s.expr.filters.hidden=function(e){var t=e.offsetWidth,n=e.offsetHeight;return t===0&&n===0||!s.support.reliableHiddenOffsets&&(e.style&&e.style.display||s.css(e,"display"))==="none"},s.expr.filters.visible=function(e){return!s.expr.filters.hidden(e)}),s.each({margin:"",padding:"",border:"Width"},function(e,t){s.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+xt[r]+t]=i[r]||i[r-2]||i[0];return s}}});var Lt=/%20/g,At=/\[\]$/,Ot=/\r?\n/g,Mt=/#.*$/,_t=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,Dt=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Pt=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Ht=/^(?:GET|HEAD)$/,Bt=/^\/\//,jt=/\?/,Ft=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,It=/^(?:select|textarea)/i,qt=/\s+/,Rt=/([?&])_=[^&]*/,Ut=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,zt=s.fn.load,Wt={},Xt={},Vt,$t,Jt=["*/"]+["*"];try{Vt=i.href}catch(Kt){Vt=n.createElement("a"),Vt.href="",Vt=Vt.href}$t=Ut.exec(Vt.toLowerCase())||[],s.fn.extend({load:function(e,n,r){if(typeof e!="string"&&zt)return zt.apply(this,arguments);if(!this.length)return this;var i=e.indexOf(" ");if(i>=0){var o=e.slice(i,e.length);e=e.slice(0,i)}var u="GET";n&&(s.isFunction(n)?(r=n,n=t):typeof n=="object"&&(n=s.param(n,s.ajaxSettings.traditional),u="POST"));var a=this;return s.ajax({url:e,type:u,dataType:"html",data:n,complete:function(e,t,n){n=e.responseText,e.isResolved()&&(e.done(function(e){n=e}),a.html(o?s("<div>").append(n.replace(Ft,"")).find(o):n)),r&&a.each(r,[n,t,e])}}),this},serialize:function(){return s.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?s.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||It.test(this.nodeName)||Dt.test(this.type))}).map(function(e,t){var n=s(this).val();return n==null?null:s.isArray(n)?s.map(n,function(e,n){return{name:t.name,value:e.replace(Ot,"\r\n")}}):{name:t.name,value:n.replace(Ot,"\r\n")}}).get()}}),s.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){s.fn[t]=function(e){return this.on(t,e)}}),s.each(["get","post"],function(e,n){s[n]=function(e,r,i,o){return s.isFunction(r)&&(o=o||i,i=r,r=t),s.ajax({type:n,url:e,data:r,success:i,dataType:o})}}),s.extend({getScript:function(e,n){return s.get(e,t,n,"script")},getJSON:function(e,t,n){return s.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Yt(e,s.ajaxSettings):(t=e,e=s.ajaxSettings),Yt(e,t),e},ajaxSettings:{url:Vt,isLocal:Pt.test($t[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Jt},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":s.parseJSON,"text xml":s.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Qt(Wt),ajaxTransport:Qt(Xt),ajax:function(e,n){function S(e,n,c,h){if(y===2)return;y=2,m&&clearTimeout(m),v=t,p=h||"",E.readyState=e>0?4:0;var d,g,w,S=n,x=c?en(r,E,c):t,T,N;if(e>=200&&e<300||e===304){if(r.ifModified){if(T=E.getResponseHeader("Last-Modified"))s.lastModified[l]=T;if(N=E.getResponseHeader("Etag"))s.etag[l]=N}if(e===304)S="notmodified",d=!0;else try{g=tn(r,x),S="success",d=!0}catch(C){S="parsererror",w=C}}else{w=S;if(!S||e)S="error",e<0&&(e=0)}E.status=e,E.statusText=""+(n||S),d?u.resolveWith(i,[g,S,E]):u.rejectWith(i,[E,S,w]),E.statusCode(f),f=t,b&&o.trigger("ajax"+(d?"Success":"Error"),[E,r,d?g:w]),a.fireWith(i,[E,S]),b&&(o.trigger("ajaxComplete",[E,r]),--s.active||s.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r=s.ajaxSetup({},n),i=r.context||r,o=i!==r&&(i.nodeType||i instanceof s)?s(i):s.event,u=s.Deferred(),a=s.Callbacks("once memory"),f=r.statusCode||{},l,c={},h={},p,d,v,m,g,y=0,b,w,E={readyState:0,setRequestHeader:function(e,t){if(!y){var n=e.toLowerCase();e=h[n]=h[n]||e,c[e]=t}return this},getAllResponseHeaders:function(){return y===2?p:null},getResponseHeader:function(e){var n;if(y===2){if(!d){d={};while(n=_t.exec(p))d[n[1].toLowerCase()]=n[2]}n=d[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return y||(r.mimeType=e),this},abort:function(e){return e=e||"abort",v&&v.abort(e),S(0,e),this}};u.promise(E),E.success=E.done,E.error=E.fail,E.complete=a.add,E.statusCode=function(e){if(e){var t;if(y<2)for(t in e)f[t]=[f[t],e[t]];else t=e[E.status],E.then(t,t)}return this},r.url=((e||r.url)+"").replace(Mt,"").replace(Bt,$t[1]+"//"),r.dataTypes=s.trim(r.dataType||"*").toLowerCase().split(qt),r.crossDomain==null&&(g=Ut.exec(r.url.toLowerCase()),r.crossDomain=!(!g||g[1]==$t[1]&&g[2]==$t[2]&&(g[3]||(g[1]==="http:"?80:443))==($t[3]||($t[1]==="http:"?80:443)))),r.data&&r.processData&&typeof r.data!="string"&&(r.data=s.param(r.data,r.traditional)),Gt(Wt,r,n,E);if(y===2)return!1;b=r.global,r.type=r.type.toUpperCase(),r.hasContent=!Ht.test(r.type),b&&s.active++===0&&s.event.trigger("ajaxStart");if(!r.hasContent){r.data&&(r.url+=(jt.test(r.url)?"&":"?")+r.data,delete r.data),l=r.url;if(r.cache===!1){var x=s.now(),T=r.url.replace(Rt,"$1_="+x);r.url=T+(T===r.url?(jt.test(r.url)?"&":"?")+"_="+x:"")}}(r.data&&r.hasContent&&r.contentType!==!1||n.contentType)&&E.setRequestHeader("Content-Type",r.contentType),r.ifModified&&(l=l||r.url,s.lastModified[l]&&E.setRequestHeader("If-Modified-Since",s.lastModified[l]),s.etag[l]&&E.setRequestHeader("If-None-Match",s.etag[l])),E.setRequestHeader("Accept",r.dataTypes[0]&&r.accepts[r.dataTypes[0]]?r.accepts[r.dataTypes[0]]+(r.dataTypes[0]!=="*"?", "+Jt+"; q=0.01":""):r.accepts["*"]);for(w in r.headers)E.setRequestHeader(w,r.headers[w]);if(!r.beforeSend||r.beforeSend.call(i,E,r)!==!1&&y!==2){for(w in{success:1,error:1,complete:1})E[w](r[w]);v=Gt(Xt,r,n,E);if(!v)S(-1,"No Transport");else{E.readyState=1,b&&o.trigger("ajaxSend",[E,r]),r.async&&r.timeout>0&&(m=setTimeout(function(){E.abort("timeout")},r.timeout));try{y=1,v.send(c,S)}catch(N){if(!(y<2))throw N;S(-1,N)}}return E}return E.abort(),!1},param:function(e,n){var r=[],i=function(e,t){t=s.isFunction(t)?t():t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=s.ajaxSettings.traditional);if(s.isArray(e)||e.jquery&&!s.isPlainObject(e))s.each(e,function(){i(this.name,this.value)});else for(var o in e)Zt(o,e[o],n,i);return r.join("&").replace(Lt,"+")}}),s.extend({active:0,lastModified:{},etag:{}});var nn=s.now(),rn=/(\=)\?(&|$)|\?\?/i;s.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return s.expando+"_"+nn++}}),s.ajaxPrefilter("json jsonp",function(t,n,r){var i=typeof t.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(t.contentType);if(t.dataTypes[0]==="jsonp"||t.jsonp!==!1&&(rn.test(t.url)||i&&rn.test(t.data))){var o,u=t.jsonpCallback=s.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a=e[u],f=t.url,l=t.data,c="$1"+u+"$2";return t.jsonp!==!1&&(f=f.replace(rn,c),t.url===f&&(i&&(l=l.replace(rn,c)),t.data===l&&(f+=(/\?/.test(f)?"&":"?")+t.jsonp+"="+u))),t.url=f,t.data=l,e[u]=function(e){o=[e]},r.always(function(){e[u]=a,o&&s.isFunction(a)&&e[u](o[0])}),t.converters["script json"]=function(){return o||s.error(u+" was not called"),o[0]},t.dataTypes[0]="json","script"}}),s.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return s.globalEval(e),e}}}),s.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),s.ajaxTransport("script",function(e){if(e.crossDomain){var r,i=n.head||n.getElementsByTagName("head")[0]||n.documentElement;return{send:function(s,o){r=n.createElement("script"),r.async="async",e.scriptCharset&&(r.charset=e.scriptCharset),r.src=e.url,r.onload=r.onreadystatechange=function(e,n){if(n||!r.readyState||/loaded|complete/.test(r.readyState))r.onload=r.onreadystatechange=null,i&&r.parentNode&&i.removeChild(r),r=t,n||o(200,"success")},i.insertBefore(r,i.firstChild)},abort:function(){r&&r.onload(0,1)}}}});var sn=e.ActiveXObject?function(){for(var e in un)un[e](0,1)}:!1,on=0,un;s.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&an()||fn()}:an,function(e){s.extend(s.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(s.ajaxSettings.xhr()),s.support.ajax&&s.ajaxTransport(function(n){if(!n.crossDomain||s.support.cors){var r;return{send:function(i,o){var u=n.xhr(),a,f;n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async);if(n.xhrFields)for(f in n.xhrFields)u[f]=n.xhrFields[f];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(f in i)u.setRequestHeader(f,i[f])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var f,l,c,h,p;try{if(r&&(i||u.readyState===4)){r=t,a&&(u.onreadystatechange=s.noop,sn&&delete un[a]);if(i)u.readyState!==4&&u.abort();else{f=u.status,c=u.getAllResponseHeaders(),h={},p=u.responseXML,p&&p.documentElement&&(h.xml=p);try{h.text=u.responseText}catch(e){}try{l=u.statusText}catch(d){l=""}!f&&n.isLocal&&!n.crossDomain?f=h.text?200:404:f===1223&&(f=204)}}}catch(v){i||o(-1,v)}h&&o(f,l,h,c)},!n.async||u.readyState===4?r():(a=++on,sn&&(un||(un={},s(e).unload(sn)),un[a]=r),u.onreadystatechange=r)},abort:function(){r&&r(0,1)}}}});var ln={},cn,hn,pn=/^(?:toggle|show|hide)$/,dn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,vn,mn=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],gn;s.fn.extend({show:function(e,t,n){var r,i;if(e||e===0)return this.animate(wn("show",3),e,t,n);for(var o=0,u=this.length;o<u;o++)r=this[o],r.style&&(i=r.style.display,!s._data(r,"olddisplay")&&i==="none"&&(i=r.style.display=""),(i===""&&s.css(r,"display")==="none"||!s.contains(r.ownerDocument.documentElement,r))&&s._data(r,"olddisplay",En(r.nodeName)));for(o=0;o<u;o++){r=this[o];if(r.style){i=r.style.display;if(i===""||i==="none")r.style.display=s._data(r,"olddisplay")||""}}return this},hide:function(e,t,n){if(e||e===0)return this.animate(wn("hide",3),e,t,n);var r,i,o=0,u=this.length;for(;o<u;o++)r=this[o],r.style&&(i=s.css(r,"display"),i!=="none"&&!s._data(r,"olddisplay")&&s._data(r,"olddisplay",i));for(o=0;o<u;o++)this[o].style&&(this[o].style.display="none");return this},_toggle:s.fn.toggle,toggle:function(e,t,n){var r=typeof e=="boolean";return s.isFunction(e)&&s.isFunction(t)?this._toggle.apply(this,arguments):e==null||r?this.each(function(){var t=r?e:s(this).is(":hidden");s(this)[t?"show":"hide"]()}):this.animate(wn("toggle",3),e,t,n),this},fadeTo:function(e,t,n,r){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){function o(){i.queue===!1&&s._mark(this);var t=s.extend({},i),n=this.nodeType===1,r=n&&s(this).is(":hidden"),o,u,a,f,l,c,h,p,d,v,m;t.animatedProperties={};for(a in e){o=s.camelCase(a),a!==o&&(e[o]=e[a],delete e[a]);if((l=s.cssHooks[o])&&"expand"in l){c=l.expand(e[o]),delete e[o];for(a in c)a in e||(e[a]=c[a])}}for(o in e){u=e[o],s.isArray(u)?(t.animatedProperties[o]=u[1],u=e[o]=u[0]):t.animatedProperties[o]=t.specialEasing&&t.specialEasing[o]||t.easing||"swing";if(u==="hide"&&r||u==="show"&&!r)return t.complete.call(this);n&&(o==="height"||o==="width")&&(t.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],s.css(this,"display")==="inline"&&s.css(this,"float")==="none"&&(!s.support.inlineBlockNeedsLayout||En(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}t.overflow!=null&&(this.style.overflow="hidden");for(a in e)f=new s.fx(this,t,a),u=e[a],pn.test(u)?(m=s._data(this,"toggle"+a)||(u==="toggle"?r?"show":"hide":0),m?(s._data(this,"toggle"+a,m==="show"?"hide":"show"),f[m]()):f[u]()):(h=dn.exec(u),p=f.cur(),h?(d=parseFloat(h[2]),v=h[3]||(s.cssNumber[a]?"":"px"),v!=="px"&&(s.style(this,a,(d||1)+v),p=(d||1)/f.cur()*p,s.style(this,a,p+v)),h[1]&&(d=(h[1]==="-="?-1:1)*d+p),f.custom(p,d,v)):f.custom(p,u,""));return!0}var i=s.speed(t,n,r);return s.isEmptyObject(e)?this.each(i.complete,[!1]):(e=s.extend({},e),i.queue===!1?this.each(o):this.queue(i.queue,o))},stop:function(e,n,r){return typeof e!="string"&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){function u(e,t,n){var i=t[n];s.removeData(e,n,!0),i.stop(r)}var t,n=!1,i=s.timers,o=s._data(this);r||s._unmark(!0,this);if(e==null)for(t in o)o[t]&&o[t].stop&&t.indexOf(".run")===t.length-4&&u(this,o,t);else o[t=e+".run"]&&o[t].stop&&u(this,o,t);for(t=i.length;t--;)i[t].elem===this&&(e==null||i[t].queue===e)&&(r?i[t](!0):i[t].saveState(),n=!0,i.splice(t,1));(!r||!n)&&s.dequeue(this,e)})}}),s.each({slideDown:wn("show",1),slideUp:wn("hide",1),slideToggle:wn("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){s.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),s.extend({speed:function(e,t,n){var r=e&&typeof e=="object"?s.extend({},e):{complete:n||!n&&t||s.isFunction(e)&&e,duration:e,easing:n&&t||t&&!s.isFunction(t)&&t};r.duration=s.fx.off?0:typeof r.duration=="number"?r.duration:r.duration in s.fx.speeds?s.fx.speeds[r.duration]:s.fx.speeds._default;if(r.queue==null||r.queue===!0)r.queue="fx";return r.old=r.complete,r.complete=function(e){s.isFunction(r.old)&&r.old.call(this),r.queue?s.dequeue(this,r.queue):e!==!1&&s._unmark(this)},r},easing:{linear:function(e){return e},swing:function(e){return-Math.cos(e*Math.PI)/2+.5}},timers:[],fx:function(e,t,n){this.options=t,this.elem=e,this.prop=n,t.orig=t.orig||{}}}),s.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(s.fx.step[this.prop]||s.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]==null||!!this.elem.style&&this.elem.style[this.prop]!=null){var e,t=s.css(this.elem,this.prop);return isNaN(e=parseFloat(t))?!t||t==="auto"?0:t:e}return this.elem[this.prop]},custom:function(e,n,r){function u(e){return i.step(e)}var i=this,o=s.fx;this.startTime=gn||yn(),this.end=n,this.now=this.start=e,this.pos=this.state=0,this.unit=r||this.unit||(s.cssNumber[this.prop]?"":"px"),u.queue=this.options.queue,u.elem=this.elem,u.saveState=function(){s._data(i.elem,"fxshow"+i.prop)===t&&(i.options.hide?s._data(i.elem,"fxshow"+i.prop,i.start):i.options.show&&s._data(i.elem,"fxshow"+i.prop,i.end))},u()&&s.timers.push(u)&&!vn&&(vn=setInterval(o.tick,o.interval))},show:function(){var e=s._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=e||s.style(this.elem,this.prop),this.options.show=!0,e!==t?this.custom(this.cur(),e):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),s(this.elem).show()},hide:function(){this.options.orig[this.prop]=s._data(this.elem,"fxshow"+this.prop)||s.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(e){var t,n,r,i=gn||yn(),o=!0,u=this.elem,a=this.options;if(e||i>=a.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),a.animatedProperties[this.prop]=!0;for(t in a.animatedProperties)a.animatedProperties[t]!==!0&&(o=!1);if(o){a.overflow!=null&&!s.support.shrinkWrapBlocks&&s.each(["","X","Y"],function(e,t){u.style["overflow"+t]=a.overflow[e]}),a.hide&&s(u).hide();if(a.hide||a.show)for(t in a.animatedProperties)s.style(u,t,a.orig[t]),s.removeData(u,"fxshow"+t,!0),s.removeData(u,"toggle"+t,!0);r=a.complete,r&&(a.complete=!1,r.call(u))}return!1}return a.duration==Infinity?this.now=i:(n=i-this.startTime,this.state=n/a.duration,this.pos=s.easing[a.animatedProperties[this.prop]](this.state,n,0,1,a.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update(),!0}},s.extend(s.fx,{tick:function(){var e,t=s.timers,n=0;for(;n<t.length;n++)e=t[n],!e()&&t[n]===e&&t.splice(n--,1);t.length||s.fx.stop()},interval:13,stop:function(){clearInterval(vn),vn=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(e){s.style(e.elem,"opacity",e.now)},_default:function(e){e.elem.style&&e.elem.style[e.prop]!=null?e.elem.style[e.prop]=e.now+e.unit:e.elem[e.prop]=e.now}}}),s.each(mn.concat.apply([],mn),function(e,t){t.indexOf("margin")&&(s.fx.step[t]=function(e){s.style(e.elem,t,Math.max(0,e.now)+e.unit)})}),s.expr&&s.expr.filters&&(s.expr.filters.animated=function(e){return s.grep(s.timers,function(t){return e===t.elem}).length});var Sn,xn=/^t(?:able|d|h)$/i,Tn=/^(?:body|html)$/i;"getBoundingClientRect"in n.documentElement?Sn=function(e,t,n,r){try{r=e.getBoundingClientRect()}catch(i){}if(!r||!s.contains(n,e))return r?{top:r.top,left:r.left}:{top:0,left:0};var o=t.body,u=Nn(t),a=n.clientTop||o.clientTop||0,f=n.clientLeft||o.clientLeft||0,l=u.pageYOffset||s.support.boxModel&&n.scrollTop||o.scrollTop,c=u.pageXOffset||s.support.boxModel&&n.scrollLeft||o.scrollLeft,h=r.top+l-a,p=r.left+c-f;return{top:h,left:p}}:Sn=function(e,t,n){var r,i=e.offsetParent,o=e,u=t.body,a=t.defaultView,f=a?a.getComputedStyle(e,null):e.currentStyle,l=e.offsetTop,c=e.offsetLeft;while((e=e.parentNode)&&e!==u&&e!==n){if(s.support.fixedPosition&&f.position==="fixed")break;r=a?a.getComputedStyle(e,null):e.currentStyle,l-=e.scrollTop,c-=e.scrollLeft,e===i&&(l+=e.offsetTop,c+=e.offsetLeft,s.support.doesNotAddBorder&&(!s.support.doesAddBorderForTableAndCells||!xn.test(e.nodeName))&&(l+=parseFloat(r.borderTopWidth)||0,c+=parseFloat(r.borderLeftWidth)||0),o=i,i=e.offsetParent),s.support.subtractsBorderForOverflowNotVisible&&r.overflow!=="visible"&&(l+=parseFloat(r.borderTopWidth)||0,c+=parseFloat(r.borderLeftWidth)||0),f=r}if(f.position==="relative"||f.position==="static")l+=u.offsetTop,c+=u.offsetLeft;return s.support.fixedPosition&&f.position==="fixed"&&(l+=Math.max(n.scrollTop,u.scrollTop),c+=Math.max(n.scrollLeft,u.scrollLeft)),{top:l,left:c}},s.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){s.offset.setOffset(this,e,t)});var n=this[0],r=n&&n.ownerDocument;return r?n===r.body?s.offset.bodyOffset(n):Sn(n,r,r.documentElement):null},s.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return s.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(s.css(e,"marginTop"))||0,n+=parseFloat(s.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var r=s.css(e,"position");r==="static"&&(e.style.position="relative");var i=s(e),o=i.offset(),u=s.css(e,"top"),a=s.css(e,"left"),f=(r==="absolute"||r==="fixed")&&s.inArray("auto",[u,a])>-1,l={},c={},h,p;f?(c=i.position(),h=c.top,p=c.left):(h=parseFloat(u)||0,p=parseFloat(a)||0),s.isFunction(t)&&(t=t.call(e,n,o)),t.top!=null&&(l.top=t.top-o.top+h),t.left!=null&&(l.left=t.left-o.left+p),"using"in t?t.using.call(e,l):i.css(l)}},s.fn.extend({position:function(){if(!this[0])return null;var e=this[0],t=this.offsetParent(),n=this.offset(),r=Tn.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(s.css(e,"marginTop"))||0,n.left-=parseFloat(s.css(e,"marginLeft"))||0,r.top+=parseFloat(s.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(s.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||n.body;while(e&&!Tn.test(e.nodeName)&&s.css(e,"position")==="static")e=e.offsetParent;return e})}}),s.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);s.fn[e]=function(i){return s.access(this,function(e,i,o){var u=Nn(e);if(o===t)return u?n in u?u[n]:s.support.boxModel&&u.document.documentElement[i]||u.document.body[i]:e[i];u?u.scrollTo(r?s(u).scrollLeft():o,r?o:s(u).scrollTop()):e[i]=o},e,i,arguments.length,null)}}),s.each({Height:"height",Width:"width"},function(e,n){var r="client"+e,i="scroll"+e,o="offset"+e;s.fn["inner"+e]=function(){var e=this[0];return e?e.style?parseFloat(s.css(e,n,"padding")):this[n]():null},s.fn["outer"+e]=function(e){var t=this[0];return t?t.style?parseFloat(s.css(t,n,e?"margin":"border")):this[n]():null},s.fn[n]=function(e){return s.access(this,function(e,n,u){var a,f,l,c;if(s.isWindow(e))return a=e.document,f=a.documentElement[r],s.support.boxModel&&f||a.body&&a.body[r]||f;if(e.nodeType===9)return a=e.documentElement,a[r]>=a[i]?a[r]:Math.max(e.body[i],a[i],e.body[o],a[o]);if(u===t)return l=s.css(e,n),c=parseFloat(l),s.isNumeric(c)?c:l;s(e).css(n,u)},n,e,arguments.length,null)}}),e.jQuery=e.$=s,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return s})})(window),define("jQuery",function(e){return function(){return e.$}}(this)),function(){function L(e,t,n){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e._chain&&(e=e._wrapped),t._chain&&(t=t._wrapped);if(e.isEqual&&x.isFunction(e.isEqual))return e.isEqual(t);if(t.isEqual&&x.isFunction(t.isEqual))return t.isEqual(e);var r=f.call(e);if(r!=f.call(t))return!1;switch(r){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:e==0?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if(typeof e!="object"||typeof t!="object")return!1;var i=n.length;while(i--)if(n[i]==e)return!0;n.push(e);var s=0,o=!0;if(r=="[object Array]"){s=e.length,o=s==t.length;if(o)while(s--)if(!(o=s in e==s in t&&L(e[s],t[s],n)))break}else{if("constructor"in e!="constructor"in t||e.constructor!=t.constructor)return!1;for(var u in e)if(x.has(e,u)){s++;if(!(o=x.has(t,u)&&L(e[u],t[u],n)))break}if(o){for(u in t)if(x.has(t,u)&&!(s--))break;o=!s}}return n.pop(),o}var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.unshift,f=i.toString,l=i.hasOwnProperty,c=r.forEach,h=r.map,p=r.reduce,d=r.reduceRight,v=r.filter,m=r.every,g=r.some,y=r.indexOf,b=r.lastIndexOf,w=Array.isArray,E=Object.keys,S=s.bind,x=function(e){return new F(e)};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=x),exports._=x):e._=x,x.VERSION="1.3.3";var T=x.each=x.forEach=function(e,t,r){if(e==null)return;if(c&&e.forEach===c)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i<s;i++)if(t.call(r,e[i],i,e)===n)return}else for(var o in e)if(x.has(e,o)&&t.call(r,e[o],o,e)===n)return};x.map=x.collect=function(e,t,n){var r=[];return e==null?r:h&&e.map===h?e.map(t,n):(T(e,function(e,i,s){r[r.length]=t.call(n,e,i,s)}),r)},x.reduce=x.foldl=x.inject=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(p&&e.reduce===p)return r&&(t=x.bind(t,r)),i?e.reduce(t,n):e.reduce(t);T(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError("Reduce of empty array with no initial value");return n},x.reduceRight=x.foldr=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(d&&e.reduceRight===d)return r&&(t=x.bind(t,r)),i?e.reduceRight(t,n):e.reduceRight(t);var s=x.toArray(e).reverse();return r&&!i&&(t=x.bind(t,r)),i?x.reduce(s,t,n,r):x.reduce(s,t)},x.find=x.detect=function(e,t,n){var r;return N(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},x.filter=x.select=function(e,t,n){var r=[];return e==null?r:v&&e.filter===v?e.filter(t,n):(T(e,function(e,i,s){t.call(n,e,i,s)&&(r[r.length]=e)}),r)},x.reject=function(e,t,n){var r=[];return e==null?r:(T(e,function(e,i,s){t.call(n,e,i,s)||(r[r.length]=e)}),r)},x.every=x.all=function(e,t,r){var i=!0;return e==null?i:m&&e.every===m?e.every(t,r):(T(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),!!i)};var N=x.some=x.any=function(e,t,r){t||(t=x.identity);var i=!1;return e==null?i:g&&e.some===g?e.some(t,r):(T(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n}),!!i)};x.include=x.contains=function(e,t){var n=!1;return e==null?n:y&&e.indexOf===y?e.indexOf(t)!=-1:(n=N(e,function(e){return e===t}),n)},x.invoke=function(e,t){var n=u.call(arguments,2);return x.map(e,function(e){return(x.isFunction(t)?t:e[t]).apply(e,n)})},x.pluck=function(e,t){return x.map(e,function(e){return e[t]})},x.max=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&x.isEmpty(e))return-Infinity;var r={computed:-Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>=r.computed&&(r={value:e,computed:o})}),r.value},x.min=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&x.isEmpty(e))return Infinity;var r={computed:Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o<r.computed&&(r={value:e,computed:o})}),r.value},x.shuffle=function(e){var t,n=0,r=[];return T(e,function(e){t=Math.floor(Math.random()*++n),r[n-1]=r[t],r[t]=e}),r},x.sortBy=function(e,t,n){var r=x.isFunction(t)?t:function(e){return e[t]};return x.pluck(x.map(e,function(e,t,i){return{value:e,criteria:r.call(n,e,t,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;return n===void 0?1:r===void 0?-1:n<r?-1:n>r?1:0}),"value")},x.groupBy=function(e,t){var n={},r=x.isFunction(t)?t:function(e){return e[t]};return T(e,function(e,t){var i=r(e,t);(n[i]||(n[i]=[])).push(e)}),n},x.sortedIndex=function(e,t,n){n||(n=x.identity);var r=n(t),i=0,s=e.length;while(i<s){var o=i+s>>1;n(e[o])<r?i=o+1:s=o}return i},x.toArray=function(e){return e?x.isArray(e)?u.call(e):x.isArguments(e)?u.call(e):e.toArray&&x.isFunction(e.toArray)?e.toArray():x.values(e):[]},x.size=function(e){return x.isArray(e)?e.length:x.keys(e).length},x.first=x.head=x.take=function(e,t,n){return t!=null&&!n?u.call(e,0,t):e[0]},x.initial=function(e,t,n){return u.call(e,0,e.length-(t==null||n?1:t))},x.last=function(e,t,n){return t!=null&&!n?u.call(e,Math.max(e.length-t,0)):e[e.length-1]},x.rest=x.tail=function(e,t,n){return u.call(e,t==null||n?1:t)},x.compact=function(e){return x.filter(e,function(e){return!!e})};var C=function(e,t,n){return T(e,function(e){x.isArray(e)?t?o.apply(n,e):C(e,t,n):n.push(e)}),n};x.flatten=function(e,t){return C(e,t,[])},x.without=function(e){return x.difference(e,u.call(arguments,1))},x.uniq=x.unique=function(e,t,n){var r=n?x.map(e,n):e,i=[];return x.reduce(r,function(n,r,s){if(t?x.last(n)!==r||!n.length:!x.include(n,r))n.push(r),i.push(e[s]);return n},[]),i},x.union=function(){return x.uniq(C(arguments,!0,[]))},x.intersection=function(e){var t=u.call(arguments,1);return x.filter(x.uniq(e),function(e){return x.every(t,function(t){return x.indexOf(t,e)>=0})})},x.difference=function(e){var t=C(u.call(arguments,1),!0,[]);return x.filter(e,function(e){return!x.include(t,e)})},x.zip=function(){var e=u.call(arguments),t=x.max(x.pluck(e,"length")),n=new Array(t);for(var r=0;r<t;r++)n[r]=x.pluck(e,""+r);return n},x.zipObject=function(e,t){var n={};for(var r=0,i=e.length;r<i;r++)n[e[r]]=t[r];return n},x.indexOf=function(e,t,n){if(e==null)return-1;var r,i;if(n)return r=x.sortedIndex(e,t),e[r]===t?r:-1;if(y&&e.indexOf===y)return e.indexOf(t);for(r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1},x.lastIndexOf=function(e,t){if(e==null)return-1;if(b&&e.lastIndexOf===b)return e.lastIndexOf(t);var n=e.length;while(n--)if(e[n]===t)return n;return-1},x.range=function(e,t,n){arguments.length<=1&&(t=e||0,e=0),n=arguments[2]||1;var r=Math.max(Math.ceil((t-e)/n),0),i=0,s=new Array(r);while(i<r)s[i++]=e,e+=n;return s};var k=function(){};x.bind=function(t,n){var r,i;if(t.bind===S&&S)return S.apply(t,u.call(arguments,1));if(!x.isFunction(t))throw new TypeError;return i=u.call(arguments,2),r=function(){if(this instanceof r){k.prototype=t.prototype;var e=new k,s=t.apply(e,i.concat(u.call(arguments)));return Object(s)===s?s:e}return t.apply(n,i.concat(u.call(arguments)))}},x.bindAll=function(e){var t=u.call(arguments,1);return t.length==0&&(t=x.functions(e)),T(t,function(t){e[t]=x.bind(e[t],e)}),e},x.memoize=function(e,t){var n={};return t||(t=x.identity),function(){var r=t.apply(this,arguments);return x.has(n,r)?n[r]:n[r]=e.apply(this,arguments)}},x.delay=function(e,t){var n=u.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},x.defer=function(e){return x.delay.apply(x,[e,1].concat(u.call(arguments,1)))},x.throttle=function(e,t){var n,r,i,s,o,u,a=x.debounce(function(){o=s=!1},t);return function(){n=this,r=arguments;var f=function(){i=null,o&&e.apply(n,r),a()};return i||(i=setTimeout(f,t)),s?o=!0:(s=!0,u=e.apply(n,r)),a(),u}},x.debounce=function(e,t,n){var r;return function(){var i=this,s=arguments,o=function(){r=null,n||e.apply(i,s)},u=n&&!r;clearTimeout(r),r=setTimeout(o,t),u&&e.apply(i,s)}},x.once=function(e){var t=!1,n;return function(){return t?n:(t=!0,n=e.apply(this,arguments))}},x.wrap=function(e,t){return function(){var n=[e].concat(u.call(arguments,0));return t.apply(this,n)}},x.compose=function(){var e=arguments;return function(){var t=arguments;for(var n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},x.after=function(e,t){return e<=0?t():function(){if(--e<1)return t.apply(this,arguments)}},x.keys=E||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)x.has(e,n)&&(t[t.length]=n);return t},x.values=function(e){return x.map(e,x.identity)},x.functions=x.methods=function(e){var t=[];for(var n in e)x.isFunction(e[n])&&t.push(n);return t.sort()},x.extend=function(e){return T(u.call(arguments,1),function(t){for(var n in t)e[n]=t[n]}),e},x.pick=function(e){var t={};return T(C(u.call(arguments,1),!0,[]),function(n){n in e&&(t[n]=e[n])}),t},x.defaults=function(e){return T(u.call(arguments,1),function(t){for(var n in t)e[n]==null&&(e[n]=t[n])}),e},x.clone=function(e){return x.isObject(e)?x.isArray(e)?e.slice():x.extend({},e):e},x.tap=function(e,t){return t(e),e},x.isEqual=function(e,t){return L(e,t,[])},x.isEmpty=function(e){if(e==null)return!0;if(x.isArray(e)||x.isString(e))return e.length===0;for(var t in e)if(x.has(e,t))return!1;return!0},x.isElement=function(e){return!!e&&e.nodeType==1},x.isArray=w||function(e){return f.call(e)=="[object Array]"},x.isObject=function(e){return e===Object(e)},T(["Arguments","Function","String","Number","Date","RegExp"],function(e){x["is"+e]=function(t){return f.call(t)=="[object "+e+"]"}}),x.isArguments(arguments)||(x.isArguments=function(e){return!!e&&!!x.has(e,"callee")}),x.isFinite=function(e){return x.isNumber(e)&&isFinite(e)},x.isNaN=function(e){return e!==e},x.isBoolean=function(e){return e===!0||e===!1||f.call(e)=="[object Boolean]"},x.isNull=function(e){return e===null},x.isUndefined=function(e){return e===void 0},x.has=function(e,t){return l.call(e,t)},x.noConflict=function(){return e._=t,this},x.identity=function(e){return e},x.times=function(e,t,n){for(var r=0;r<e;r++)t.call(n,r)};var A={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},O=/[&<>"'\/]/g;x.escape=function(e){return(""+e).replace(O,function(e){return A[e]})},x.result=function(e,t){if(e==null)return null;var n=e[t];return x.isFunction(n)?n.call(e):n},x.mixin=function(e){T(x.functions(e),function(t){q(t,x[t]=e[t])})};var M=0;x.uniqueId=function(e){var t=M++;return e?e+t:t},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var _=/.^/,D={"\\":"\\","'":"'",r:"\r",n:"\n",t:" ",u2028:"\u2028",u2029:"\u2029"};for(var P in D)D[D[P]]=P;var H=/\\|'|\r|\n|\t|\u2028|\u2029/g,B=/\\(\\|'|r|n|t|u2028|u2029)/g,j=function(e){return e.replace(B,function(e,t){return D[t]})};x.template=function(e,t,n){n=x.defaults(n||{},x.templateSettings);var r="__p+='"+e.replace(H,function(e){return"\\"+D[e]}).replace(n.escape||_,function(e,t){return"'+\n((__t=("+j(t)+"))==null?'':_.escape(__t))+\n'"}).replace(n.interpolate||_,function(e,t){return"'+\n((__t=("+j(t)+"))==null?'':__t)+\n'"}).replace(n.evaluate||_,function(e,t){return"';\n"+j(t)+"\n__p+='"})+"';\n";n.variable||(r="with(obj||{}){\n"+r+"}\n"),r="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'')};\n"+r+"return __p;\n";var i=new Function(n.variable||"obj","_",r);if(t)return i(t,x);var s=function(e){return i.call(this,e,x)};return s.source="function("+(n.variable||"obj")+"){\n"+r+"}",s},x.chain=function(e){return x(e).chain()};var F=function(e){this._wrapped=e};x.prototype=F.prototype;var I=function(e,t){return t?x(e).chain():e},q=function(e,t){F.prototype[e]=function(){var e=u.call(arguments);return a.call(e,this._wrapped),I(t.apply(x,e),this._chain)}};x.mixin(x),T(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];F.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],I(n,this._chain)}}),T(["concat","join","slice"],function(e){var t=r[e];F.prototype[e]=function(){return I(t.apply(this._wrapped,arguments),this._chain)}}),F.prototype.chain=function(){return this._chain=!0,this},F.prototype.value=function(){return this._wrapped}}.call(this),define("Underscore",function(e){return function(){return e._}}(this)),define("dbTypes_cached",[],function(){return[{id:2,className:"org.gjt.mm.mysql.Driver",context:"host",sample_fragment:"2/a2581/1",simple_name:"MySQL",notes:"Separate multiple statements in MySQL by terminating each one with a semicolon.",full_name:"MySQL 5.5.27"},{id:9,className:"org.gjt.mm.mysql.Driver",context:"host",sample_fragment:"9/a2581/1",simple_name:"MySQL",notes:"",full_name:"MySQL 5.6.6 m9"},{id:8,className:"org.gjt.mm.mysql.Driver",context:"host",sample_fragment:"8/a2581/1",simple_name:"MySQL",notes:"",full_name:"MySQL 5.1.61"},{id:4,className:"oracle.jdbc.OracleDriver",context:"host",sample_fragment:"4/ee7da/596",simple_name:"Oracle",notes:"Oracle does not support multiple statements in batch. Separate each statement with a line consisting of a single /, and do not terminate statements with semicolons.",full_name:"Oracle 11g R2"},{id:1,className:"org.postgresql.Driver",context:"host",sample_fragment:"1/6ccc5/2",simple_name:"PostgreSQL",notes:"Separate multiple statements in PostgreSQL by terminating each one with a semicolon.",full_name:"PostgreSQL 9.1.6"},{id:12,className:"org.postgresql.Driver",context:"host",sample_fragment:"12/6d80e/1",simple_name:"PostgreSQL",notes:"",full_name:"PostgreSQL 9.2.1"},{id:11,className:"org.postgresql.Driver",context:"host",sample_fragment:"11/6d80e/1",simple_name:"PostgreSQL",notes:"",full_name:"PostgreSQL 8.4.12"},{id:10,className:"org.postgresql.Driver",context:"host",sample_fragment:"10/f9585/1",simple_name:"PostgreSQL",notes:"",full_name:"PostgreSQL 8.3.20"},{id:7,className:"websql",context:"browser",sample_fragment:"7/04eca/1",simple_name:"SQLite",notes:"",full_name:"SQLite (WebSQL)"},{id:5,className:"sqljs",context:"browser",sample_fragment:"5/781d4/2",simple_name:"SQLite",notes:"",full_name:"SQLite (SQL.js)"},{id:6,className:"net.sourceforge.jtds.jdbc.Driver",context:"host",sample_fragment:"6/189a3/1",simple_name:"SQL Server",notes:"",full_name:"MS SQL Server 2012"},{id:3,className:"net.sourceforge.jtds.jdbc.Driver",context:"host",sample_fragment:"3/1fa93/1",simple_name:"SQL Server",notes:"SQL Server supports multiple statements in a batch separated by semicolons. Separate statement batches with a line consisting of a single GO command, as needed.",full_name:"MS SQL Server 2008"}]}),define("BrowserEngines/sqlite_driver",[],function(){var e=function(){return this};return e.prototype.getSchemaStructure=function(e){var t="select * from sqlite_master where type IN ('table', 'view') and name != '__WebKitDatabaseInfoTable__' order by type,name",n=function(t){var n={},r=[];for(var i in t[0].RESULTS.COLUMNS)n[t[0].RESULTS.COLUMNS[i]]=i;for(var s in t[0].RESULTS.DATA){var o=t[0].RESULTS.DATA[s][n.sql],u=t[0].RESULTS.DATA[s][n.name],a=t[0].RESULTS.DATA[s][n.type],f={table_name:u,table_type:a,columns:[]};if(a=="table"){var l=/^[\s\S]*?\(([\s\S]*)\)$/.exec(o)[1].split(/,\s*/);for(var c in l){var h=l[c].replace(/(^\s*)|(\s*$)/,"").split(/\s+/);f.columns.push({name:h.shift(),type:h.join(" ")})}}r.push(f)}e.callback(r)};this.executeQuery({sql:t,success:n})},e.prototype.splitStatement=function(e,t){t||(t=";");var n=t.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),r=e?e.split(new RegExp(n+"s*\r?(\n|$)")):[];return r},e}),define("BrowserEngines/sqljs_driver",["jQuery","BrowserEngines/sqlite_driver"],function(e,t){var n=function(){return this.db=null,this};return e.extend(n.prototype,t.prototype),n.prototype.buildSchema=function(n){var r=this;try{var i=function(){r.db=SQL.open(),e.each(t.prototype.splitStatement.call(this,n.ddl,n.statement_separator),function(e,t){r.db.exec(t)}),n.success()};window.SQL===undefined?e.getScript("javascripts_static/sql.js",function(e,t,n){i()}).fail(function(e,t,r){n.error("Your browser does not work with SQL.js. Try using a different browser (Chrome, Safari, Firefox, IE 10, etc...), or a newer version of your current one.")}):(r.db&&r.db.close(),i())}catch(s){n.error(s)}},n.prototype.executeQuery=function(n){var r=this;try{if(!r.db)throw"Database Schema not available!";var i=[];r.db.exec("BEGIN TRANSACTION"),e.each(t.prototype.splitStatement.call(this,n.sql,n.statement_separator),function(t,n){if(e.trim(n).length){var s=new Date,o=[];try{o=r.db.exec(n);var u={SUCCEEDED:!0,EXECUTIONTIME:new Date-s,RESULTS:{COLUMNS:[],DATA:[]},EXECUTIONPLAN:{COLUMNS:[],DATA:[]}};o.length&&e.each(o,function(t,n){var r=[];e.each(n,function(e,n){t==0&&u.RESULTS.COLUMNS.push(n.column),r.push(n.value)}),u.RESULTS.DATA.push(r)});try{exectionPlanArray=r.db.exec("EXPLAIN QUERY PLAN "+n),exectionPlanArray.length&&e.each(exectionPlanArray,function(t,n){var r=[];e.each(n,function(e,n){t==0&&u.EXECUTIONPLAN.COLUMNS.push(n.column),r.push(n.value)}),u.EXECUTIONPLAN.DATA.push(r)})}catch(a){}i.push(u)}catch(a){var u={SUCCEEDED:!1,EXECUTIONTIME:new Date-s,ERRORMESSAGE:a};return i.push(u),!1}}}),r.db.exec("ROLLBACK TRANSACTION"),n.success(i)}catch(s){n.error(s)}},n}),define("BrowserEngines/websql_driver",["jQuery","BrowserEngines/sqlite_driver"],function(e,t){var n=function(){return this.db=null,this.ddl=[],this.nativeSQLite=window.openDatabase!==undefined,this};return e.extend(n.prototype,t.prototype),n.prototype.buildSchema=function(e){var t=this;try{t.nativeSQLite?(t.db=openDatabase(e.short_code,"1.0",e.short_code,e.ddl.length*1024),t.db.transaction(function(n){var r=t.splitStatement(e.ddl,e.statement_separator);t.ddl=r;var i=0,s=r[i],o=function(t,a){if(i<r.length-1){do i++,s=r[i];while(i<r.length-1&&s.match(/^\s*$/));s.match(/^\s*$/)?(n.executeSql("intentional failure used to rollback transaction"),e.success()):n.executeSql(s,[],o,u)}else n.executeSql("intentional failure used to rollback transaction"),e.success()},u=function(t,n){return n.message!="not an error"?e.error(n.message):e.success(),!0};s?n.executeSql(s,[],o,u):e.success()})):e.error("SQLite (WebSQL) not available in your browser. Try either using a webkit-based browser (such as Safari or Chrome) or using the SQLite (SQL.js) database type.")}catch(n){e.error(n)}},n.prototype.executeQuery=function(t){var n=this;try{if(n.db==null)throw"You need to build the schema before you can run a query.";var r=[];n.db.transaction(function(i){var s=function(e,u){var a={SUCCEEDED:!0,EXECUTIONTIME:new Date-p,RESULTS:{COLUMNS:[],DATA:[]},EXECUTIONPLAN:{COLUMNS:[],DATA:[]}};for(var f=0;f<u.rows.length;f++){var d=[],v=u.rows.item(f);if(f==0)for(col in v)a.RESULTS.COLUMNS.push(col);for(var m=0;m<a.RESULTS.COLUMNS.length;m++)d.push(v[a.RESULTS.COLUMNS[m]]);a.RESULTS.DATA.push(d)}i.executeSql("EXPLAIN QUERY PLAN "+h,[],function(e,u){for(var f=0;f<u.rows.length;f++){var p=[],d=u.rows.item(f);if(f==0)for(col in d)a.EXECUTIONPLAN.COLUMNS.push(col);for(var v=0;v<a.EXECUTIONPLAN.COLUMNS.length;v++)p.push(d[a.EXECUTIONPLAN.COLUMNS[v]]);a.EXECUTIONPLAN.DATA.push(p)}c>n.ddl.length-1&&r.push(a);if(c<l.length-1){do c++,h=l[c];while(c<l.length-1&&h.match(/^\s*$/));h.match(/^\s*$/)?(i.executeSql("intentional failure used to rollback transaction"),t.success(r)):i.executeSql(h,[],s,o)}else i.executeSql("intentional failure used to rollback transaction"),t.success(r)},function(e,u){c>n.ddl.length-1&&r.push(a);if(c<l.length-1){do c++,h=l[c];while(c<l.length-1&&h.match(/^\s*$/));h.match(/^\s*$/)?(i.executeSql("intentional failure used to rollback transaction"),t.success(r)):i.executeSql(h,[],s,o)}else i.executeSql("intentional failure used to rollback transaction"),t.success(r)})},o=function(e,n){if(n.message!="not an error"){var i={SUCCEEDED:!1,EXECUTIONTIME:new Date-p,ERRORMESSAGE:n.message};r.push(i)}return t.success(r),!0},u=[],a,f=!1,l=n.ddl.slice(0);e.each(n.splitStatement(t.sql,t.statement_separator),function(e,t){l.push(t)});var c=0,h=l[c],p=new Date;i.executeSql(h,[],s,o)})}catch(i){t.error(i)}},n}),define("BrowserEngines/engines",["BrowserEngines/sqljs_driver","BrowserEngines/websql_driver"],function(e,t){return{sqljs:new e,websql:new t}});var JSON;JSON||(JSON={}),function(){function f(e){return e<10?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o=gap,u,a=t[e];a&&typeof a=="object"&&typeof a.toJSON=="function"&&(a=a.toJSON(e)),typeof rep=="function"&&(a=rep.call(t,e,a));switch(typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";gap+=indent,u=[];if(Object.prototype.toString.apply(a)==="[object Array]"){s=a.length;for(n=0;n<s;n+=1)u[n]=str(n,a)||"null";return i=u.length===0?"[]":gap?"[\n"+gap+u.join(",\n"+gap)+"\n"+o+"]":"["+u.join(",")+"]",gap=o,i}if(rep&&typeof rep=="object"){s=rep.length;for(n=0;n<s;n+=1)typeof rep[n]=="string"&&(r=rep[n],i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i))}else for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i));return i=u.length===0?"{}":gap?"{\n"+gap+u.join(",\n"+gap)+"\n"+o+"}":"{"+u.join(",")+"}",gap=o,i}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(e){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(e){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;typeof JSON.stringify!="function"&&(JSON.stringify=function(e,t,n){var r;gap="",indent="";if(typeof n=="number")for(r=0;r<n;r+=1)indent+=" ";else typeof n=="string"&&(indent=n);rep=t;if(!t||typeof t=="function"||typeof t=="object"&&typeof t.length=="number")return str("",{"":e});throw new Error("JSON.stringify")}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(e,t){var n,r,i=e[t];if(i&&typeof i=="object")for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r=walk(i,n),r!==undefined?i[n]=r:delete i[n]);return reviver.call(e,t,i)}var j;text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),define("libs/json2",function(){}),function(){var e=this,t=e.Backbone,n=Array.prototype.splice,r;typeof exports!="undefined"?r=exports:r=e.Backbone={},r.VERSION="0.9.2";var i=e._;!i&&typeof require!="undefined"&&(i=require("underscore")),r.$=e.jQuery||e.Zepto||e.ender,r.noConflict=function(){return e.Backbone=t,this},r.emulateHTTP=!1,r.emulateJSON=!1;var s=/\s+/,o=r.Events={on:function(e,t,n){var r,i,o;if(!t)return this;e=e.split(s),r=this._callbacks||(this._callbacks={});while(i=e.shift())o=r[i]||(r[i]=[]),o.push(t,n);return this},off:function(e,t,n){var r,o,u,a;if(!(o=this._callbacks))return this;if(!(e||t||n))return delete this._callbacks,this;e=e?e.split(s):i.keys(o);while(r=e.shift()){if(!(u=o[r])||!t&&!n){delete o[r];continue}for(a=u.length-2;a>=0;a-=2)t&&u[a]!==t||n&&u[a+1]!==n||u.splice(a,2)}return this},trigger:function(e){var t,n,r,i,o,u,a,f;if(!(n=this._callbacks))return this;f=[],e=e.split(s);for(i=1,o=arguments.length;i<o;i++)f[i-1]=arguments[i];while(t=e.shift()){if(a=n.all)a=a.slice();if(r=n[t])r=r.slice();if(r)for(i=0,o=r.length;i<o;i+=2)r[i].apply(r[i+1]||this,f);if(a){u=[t].concat(f);for(i=0,o=a.length;i<o;i+=2)a[i].apply(a[i+1]||this,u)}}return this}};o.bind=o.on,o.unbind=o.off;var u=r.Model=function(e,t){var n;e||(e={}),t&&t.collection&&(this.collection=t.collection),t&&t.parse&&(e=this.parse(e));if(n=N(this,"defaults"))e=i.extend({},n,e);this.attributes={},this._escapedAttributes={},this.cid=i.uniqueId("c"),this.changed={},this._silent={},this._pending={},this.set(e,{silent:!0}),this.changed={},this._silent={},this._pending={},this._previousAttributes=i.clone(this.attributes),this.initialize.apply(this,arguments)};i.extend(u.prototype,o,{changed:null,_silent:null,_pending:null,idAttribute:"id",initialize:function(){},toJSON:function(e){return i.clone(this.attributes)},sync:function(){return r.sync.apply(this,arguments)},get:function(e){return this.attributes[e]},escape:function(e){var t;if(t=this._escapedAttributes[e])return t;var n=this.get(e);return this._escapedAttributes[e]=i.escape(n==null?"":""+n)},has:function(e){return this.get(e)!=null},set:function(e,t,n){var r,s,o;i.isObject(e)||e==null?(r=e,n=t):(r={},r[e]=t),n||(n={});if(!r)return this;r instanceof u&&(r=r.attributes);if(n.unset)for(s in r)r[s]=void 0;if(!this._validate(r,n))return!1;this.idAttribute in r&&(this.id=r[this.idAttribute]);var a=n.changes={},f=this.attributes,l=this._escapedAttributes,c=this._previousAttributes||{};for(s in r){o=r[s];if(!i.isEqual(f[s],o)||n.unset&&i.has(f,s))delete l[s],(n.silent?this._silent:a)[s]=!0;n.unset?delete f[s]:f[s]=o,!i.isEqual(c[s],o)||i.has(f,s)!=i.has(c,s)?(this.changed[s]=o,n.silent||(this._pending[s]=!0)):(delete this.changed[s],delete this._pending[s])}return n.silent||this.change(n),this},unset:function(e,t){return t=i.extend({},t,{unset:!0}),this.set(e,null,t)},clear:function(e){return e=i.extend({},e,{unset:!0}),this.set(i.clone(this.attributes),e)},fetch:function(e){e=e?i.clone(e):{};var t=this,n=e.success;return e.success=function(r,i,s){if(!t.set(t.parse(r,s),e))return!1;n&&n(t,r,e),t.trigger("sync",t,r,e)},e.error=r.wrapError(e.error,t,e),this.sync("read",this,e)},save:function(e,t,n){var s,o,u;i.isObject(e)||e==null?(s=e,n=t):(s={},s[e]=t),n=n?i.clone(n):{};if(n.wait){if(!this._validate(s,n))return!1;o=i.clone(this.attributes)}var a=i.extend({},n,{silent:!0});if(s&&!this.set(s,n.wait?a:n))return!1;if(!s&&!this.isValid())return!1;var f=this,l=n.success;n.success=function(e,t,r){u=!0;var o=f.parse(e,r);n.wait&&(o=i.extend(s||{},o));if(!f.set(o,n))return!1;l&&l(f,e,n),f.trigger("sync",f,e,n)},n.error=r.wrapError(n.error,f,n);var c=this.sync(this.isNew()?"create":"update",this,n);return!u&&n.wait&&(this.clear(a),this.set(o,a)),c},destroy:function(e){e=e?i.clone(e):{};var t=this,n=e.success,s=function(){t.trigger("destroy",t,t.collection,e)};e.success=function(r){(e.wait||t.isNew())&&s(),n&&n(t,r,e),t.isNew()||t.trigger("sync",t,r,e)};if(this.isNew())return e.success(),!1;e.error=r.wrapError(e.error,t,e);var o=this.sync("delete",this,e);return e.wait||s(),o},url:function(){var e=N(this,"urlRoot")||N(this.collection,"url")||C();return this.isNew()?e:e+(e.charAt(e.length-1)=="/"?"":"/")+encodeURIComponent(this.id)},parse:function(e,t){return e},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return this.id==null},change:function(e){e||(e={});var t=this._changing;this._changing=!0;for(var n in this._silent)this._pending[n]=!0;var r=i.extend({},e.changes,this._silent);this._silent={};for(var n in r)this.trigger("change:"+n,this,this.get(n),e);if(t)return this;while(!i.isEmpty(this._pending)){this._pending={},this.trigger("change",this,e);for(var n in this.changed){if(this._pending[n]||this._silent[n])continue;delete this.changed[n]}this._previousAttributes=i.clone(this.attributes)}return this._changing=!1,this},hasChanged:function(e){return e==null?!i.isEmpty(this.changed):i.has(this.changed,e)},changedAttributes:function(e){if(!e)return this.hasChanged()?i.clone(this.changed):!1;var t,n=!1,r=this._previousAttributes;for(var s in e){if(i.isEqual(r[s],t=e[s]))continue;(n||(n={}))[s]=t}return n},previous:function(e){return e==null||!this._previousAttributes?null:this._previousAttributes[e]},previousAttributes:function(){return i.clone(this._previousAttributes)},isValid:function(){return!this.validate||!this.validate(this.attributes)},_validate:function(e,t){if(t.silent||!this.validate)return!0;e=i.extend({},this.attributes,e);var n=this.validate(e,t);return n?(t&&t.error?t.error(this,n,t):this.trigger("error",this,n,t),!1):!0}});var a=r.Collection=function(e,t){t||(t={}),t.model&&(this.model=t.model),t.comparator!==undefined&&(this.comparator=t.comparator),this._reset(),this.initialize.apply(this,arguments),e&&this.reset(e,{silent:!0,parse:t.parse})};i.extend(a.prototype,o,{model:u,initialize:function(){},toJSON:function(e){return this.map(function(t){return t.toJSON(e)})},sync:function(){return r.sync.apply(this,arguments)},add:function(e,t){var r,s,o,u,a,f,l={},c={},h=[];t||(t={}),e=i.isArray(e)?e.slice():[e];for(r=0,o=e.length;r<o;r++){if(!(u=e[r]=this._prepareModel(e[r],t)))throw new Error("Can't add an invalid model to a collection");a=u.cid,f=u.id;if(l[a]||this._byCid[a]||f!=null&&(c[f]||this._byId[f])){h.push(r);continue}l[a]=c[f]=u}r=h.length;while(r--)h[r]=e.splice(h[r],1)[0];for(r=0,o=e.length;r<o;r++)(u=e[r]).on("all",this._onModelEvent,this),this._byCid[u.cid]=u,u.id!=null&&(this._byId[u.id]=u);this.length+=o,s=t.at!=null?t.at:this.models.length,n.apply(this.models,[s,0].concat(e));if(t.merge)for(r=0,o=h.length;r<o;r++)(u=this._byId[h[r].id])&&u.set(h[r],t);this.comparator&&t.at==null&&this.sort({silent:!0});if(t.silent)return this;for(r=0,o=this.models.length;r<o;r++){if(!l[(u=this.models[r]).cid])continue;t.index=r,u.trigger("add",u,this,t)}return this},remove:function(e,t){var n,r,s,o;t||(t={}),e=i.isArray(e)?e.slice():[e];for(n=0,r=e.length;n<r;n++){o=this.getByCid(e[n])||this.get(e[n]);if(!o)continue;delete this._byId[o.id],delete this._byCid[o.cid],s=this.indexOf(o),this.models.splice(s,1),this.length--,t.silent||(t.index=s,o.trigger("remove",o,this,t)),this._removeReference(o)}return this},push:function(e,t){return e=this._prepareModel(e,t),this.add(e,t),e},pop:function(e){var t=this.at(this.length-1);return this.remove(t,e),t},unshift:function(e,t){return e=this._prepareModel(e,t),this.add(e,i.extend({at:0},t)),e},shift:function(e){var t=this.at(0);return this.remove(t,e),t},slice:function(e,t){return this.models.slice(e,t)},get:function(e){return e==null?void 0:this._byId[e.id!=null?e.id:e]},getByCid:function(e){return e&&this._byCid[e.cid||e]},at:function(e){return this.models[e]},where:function(e){return i.isEmpty(e)?[]:this.filter(function(t){for(var n in e)if(e[n]!==t.get(n))return!1;return!0})},sort:function(e){e||(e={});if(!this.comparator)throw new Error("Cannot sort a set without a comparator");var t=i.bind(this.comparator,this);return this.comparator.length==1?this.models=this.sortBy(t):this.models.sort(t),e.silent||this.trigger("reset",this,e),this},pluck:function(e){return i.map(this.models,function(t){return t.get(e)})},reset:function(e,t){e||(e=[]),t||(t={});for(var n=0,r=this.models.length;n<r;n++)this._removeReference(this.models[n]);return this._reset(),this.add(e,i.extend({silent:!0},t)),t.silent||this.trigger("reset",this,t),this},fetch:function(e){e=e?i.clone(e):{},e.parse===undefined&&(e.parse=!0);var t=this,n=e.success;return e.success=function(r,i,s){t[e.add?"add":"reset"](t.parse(r,s),e),n&&n(t,r,e),t.trigger("sync",t,r,e)},e.error=r.wrapError(e.error,t,e),this.sync("read",this,e)},create:function(e,t){var n=this;t=t?i.clone(t):{},e=this._prepareModel(e,t);if(!e)return!1;t.wait||n.add(e,t);var r=t.success;return t.success=function(e,t,i){i.wait&&n.add(e,i),r&&r(e,t,i)},e.save(null,t),e},parse:function(e,t){return e},clone:function(){return new this.constructor(this.models)},chain:function(){return i(this.models).chain()},_reset:function(e){this.length=0,this.models=[],this._byId={},this._byCid={}},_prepareModel:function(e,t){if(e instanceof u)return e.collection||(e.collection=this),e;t||(t={}),t.collection=this;var n=new this.model(e,t);return n._validate(n.attributes,t)?n:!1},_removeReference:function(e){this==e.collection&&delete e.collection,e.off("all",this._onModelEvent,this)},_onModelEvent:function(e,t,n,r){if((e=="add"||e=="remove")&&n!=this)return;e=="destroy"&&this.remove(t,r),t&&e==="change:"+t.idAttribute&&(delete this._byId[t.previous(t.idAttribute)],t.id!=null&&(this._byId[t.id]=t)),this.trigger.apply(this,arguments)}});var f=["forEach","each","map","reduce","reduceRight","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","sortBy","sortedIndex","toArray","size","first","initial","rest","last","without","indexOf","shuffle","lastIndexOf","isEmpty","groupBy"];i.each(f,function(e){a.prototype[e]=function(){return i[e].apply(i,[this.models].concat(i.toArray(arguments)))}});var l=r.Router=function(e){e||(e={}),e.routes&&(this.routes=e.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},c=/:\w+/g,h=/\*\w+/g,p=/[-[\]{}()+?.,\\^$|#\s]/g;i.extend(l.prototype,o,{initialize:function(){},route:function(e,t,n){return r.history||(r.history=new d),i.isRegExp(e)||(e=this._routeToRegExp(e)),n||(n=this[t]),r.history.route(e,i.bind(function(i){var s=this._extractParameters(e,i);n&&n.apply(this,s),this.trigger.apply(this,["route:"+t].concat(s)),r.history.trigger("route",this,t,s)},this)),this},navigate:function(e,t){r.history.navigate(e,t)},_bindRoutes:function(){if(!this.routes)return;var e=[];for(var t in this.routes)e.unshift([t,this.routes[t]]);for(var n=0,r=e.length;n<r;n++)this.route(e[n][0],e[n][1],this[e[n][1]])},_routeToRegExp:function(e){return e=e.replace(p,"\\$&").replace(c,"([^/]+)").replace(h,"(.*?)"),new RegExp("^"+e+"$")},_extractParameters:function(e,t){return e.exec(t).slice(1)}});var d=r.History=function(t){this.handlers=[],i.bindAll(this,"checkUrl"),this.location=t&&t.location||e.location,this.history=t&&t.history||e.history},v=/^[#\/]/,m=/msie [\w.]+/,g=/\/$/;d.started=!1,i.extend(d.prototype,o,{interval:50,getHash:function(e){var t=(e||this).location.href.match(/#(.*)$/);return t?t[1]:""},getFragment:function(e,t){if(e==null)if(this._hasPushState||!this._wantsHashChange||t){e=this.location.pathname;var n=this.options.root.replace(g,"");e.indexOf(n)||(e=e.substr(n.length))}else e=this.getHash();return decodeURIComponent(e.replace(v,""))},start:function(e){if(d.started)throw new Error("Backbone.history has already been started");d.started=!0,this.options=i.extend({},{root:"/"},this.options,e),this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var t=this.getFragment(),n=document.documentMode,s=m.exec(navigator.userAgent.toLowerCase())&&(!n||n<=7);s&&this._wantsHashChange&&(this.iframe=r.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(t)),this._hasPushState?r.$(window).bind("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!s?r.$(window).bind("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=t;var o=this.location,u=o.pathname==this.options.root&&!o.search;if(this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!u)return this.fragment=this.getFragment(null,!0),this.location.replace(this.options.root+this.location.search+"#"+this.fragment),!0;this._wantsPushState&&this._hasPushState&&u&&o.hash&&(this.fragment=this.getHash().replace(v,""),this.history.replaceState({},document.title,o.protocol+"//"+o.host+this.options.root+this.fragment));if(!this.options.silent)return this.loadUrl()},stop:function(){r.$(window).unbind("popstate",this.checkUrl).unbind("hashchange",this.checkUrl),clearInterval(this._checkUrlInterval),d.started=!1},route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(e){var t=this.getFragment();t==this.fragment&&this.iframe&&(t=this.getFragment(this.getHash(this.iframe)));if(t==this.fragment)return!1;this.iframe&&this.navigate(t),this.loadUrl()||this.loadUrl(this.getHash())},loadUrl:function(e){var t=this.fragment=this.getFragment(e),n=i.any(this.handlers,function(e){if(e.route.test(t))return e.callback(t),!0});return n},navigate:function(e,t){if(!d.started)return!1;if(!t||t===!0)t={trigger:t};var n=(e||"").replace(v,"");if(this.fragment==n)return;this.fragment=n;var r=(n.indexOf(this.options.root)!=0?this.options.root:"")+n;if(this._hasPushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);this._updateHash(this.location,n,t.replace),this.iframe&&n!=this.getFragment(this.getHash(this.iframe))&&(t.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,n,t.replace))}t.trigger&&this.loadUrl(e)},_updateHash:function(e,t,n){n?e.replace(e.href.replace(/(javascript:|#).*$/,"")+"#"+t):e.hash=t}});var y=r.View=function(e){this.cid=i.uniqueId("view"),this._configure(e||{}),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},b=/^(\S+)\s*(.*)$/,w=["model","collection","el","id","attributes","className","tagName"];i.extend(y.prototype,o,{tagName:"div",$:function(e){return this.$el.find(e)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this},make:function(e,t,n){var i=document.createElement(e);return t&&r.$(i).attr(t),n!=null&&r.$(i).html(n),i},setElement:function(e,t){return this.$el&&this.undelegateEvents(),this.$el=e instanceof r.$?e:r.$(e),this.el=this.$el[0],t!==!1&&this.delegateEvents(),this},delegateEvents:function(e){if(!e&&!(e=N(this,"events")))return;this.undelegateEvents();for(var t in e){var n=e[t];i.isFunction(n)||(n=this[e[t]]);if(!n)throw new Error('Method "'+e[t]+'" does not exist');var r=t.match(b),s=r[1],o=r[2];n=i.bind(n,this),s+=".delegateEvents"+this.cid,o===""?this.$el.bind(s,n):this.$el.delegate(o,s,n)}},undelegateEvents:function(){this.$el.unbind(".delegateEvents"+this.cid)},_configure:function(e){this.options&&(e=i.extend({},this.options,e));for(var t=0,n=w.length;t<n;t++){var r=w[t];e[r]&&(this[r]=e[r])}this.options=e},_ensureElement:function(){if(!this.el){var e=i.extend({},N(this,"attributes"));this.id&&(e.id=this.id),this.className&&(e["class"]=this.className),this.setElement(this.make(N(this,"tagName"),e),!1)}else this.setElement(this.el,!1)}});var E=function(e,t){var n=T(this,e,t);return n.extend=this.extend,n};u.extend=a.extend=l.extend=y.extend=E;var S={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};r.sync=function(e,t,n){var s=S[e];n||(n={});var o={type:s,dataType:"json"};return n.url||(o.url=N(t,"url")||C()),!n.data&&t&&(e=="create"||e=="update")&&(o.contentType="application/json",o.data=JSON.stringify(t)),r.emulateJSON&&(o.contentType="application/x-www-form-urlencoded",o.data=o.data?{model:o.data}:{}),r.emulateHTTP&&(s==="PUT"||s==="DELETE")&&(r.emulateJSON&&(o.data._method=s),o.type="POST",o.beforeSend=function(e){e.setRequestHeader("X-HTTP-Method-Override",s)}),o.type!=="GET"&&!r.emulateJSON&&(o.processData=!1),r.ajax(i.extend(o,n))},r.ajax=function(){return r.$.ajax.apply(r.$,arguments)},r.wrapError=function(e,t,n){return function(r,i){i=r===t?i:r,e?e(t,i,n):t.trigger("error",t,i,n)}};var x=function(){},T=function(e,t,n){var r;return t&&t.hasOwnProperty("constructor")?r=t.constructor:r=function(){e.apply(this,arguments)},i.extend(r,e),x.prototype=e.prototype,r.prototype=new x,t&&i.extend(r.prototype,t),n&&i.extend(r,n),r.prototype.constructor=r,r.__super__=e.prototype,r},N=function(e,t){return!e||!e[t]?null:i.isFunction(e[t])?e[t]():e[t]},C=function(){throw new Error('A "url" property or function must be specified')}}.call(this),define("Backbone",["Underscore","jQuery","libs/json2"],function(e){return function(){return e.Backbone}}(this)),define("fiddle_backbone/models/UsedFiddle",["Backbone"],function(e){var t=e.Model.extend({defaults:{fragment:"",full_name:"",ddl:"",sql:""},initialize:function(){this.set("last_used",new Date)}});return t}),define("fiddle_backbone/models/MyFiddleHistory",["Backbone","fiddle_backbone/models/UsedFiddle"],function(e,t){var n=e.Collection.extend({model:t,comparator:function(e,t){return e.get("last_used")==t.get("last_used")?0:e.get("last_used")>t.get("last_used")?-1:1},insert:function(e){if(!$("#user_choices",this).length){var t=this.find(function(t){return t.get("fragment")==e.get("fragment")});t?(t.set("last_used",e.get("last_used")),this.sort()):this.add(e),this.trigger("change")}},initialize:function(){try{if(localStorage){var e=localStorage.getItem("fiddleHistory");e&&e.length&&this.add($.parseJSON(e))}}catch(t){}}});return n}),define("fiddle_backbone/models/DBType",["Backbone"],function(e){var t=e.Model.extend({defaults:{sample_fragment:"",notes:"",simple_name:"",full_name:"",selected:!1,context:"host",className:""}});return t}),define("fiddle_backbone/models/DBTypesList",["Backbone","fiddle_backbone/models/DBType"],function(e,t){var n=e.Collection.extend({model:t,getSelectedType:function(){var e=this.filter(function(e){return e.get("selected")});return e.length?e[0]:!1},setSelectedType:function(e,t){this.each(function(t){t.set({selected:t.id==e},{silent:!0})}),t||this.trigger("change")}});return n}),define("fiddle_backbone/models/SchemaDef",["Backbone"],function(e){var t=e.Model.extend({defaults:{ddl:"",short_code:"",simple_name:"",full_name:"",valid:!0,errorMessage:"",loading:!1,ready:!1,schema_structure:[],statement_separator:";",browserEngines:{}},reset:function(){this.set(this.defaults),this.trigger("reloaded")},build:function(e){var t=e.getSelectedType(),n=this;if(!t)return!1;(!this.has("dbType")||this.get("dbType").id!=t.id)&&this.set("dbType",t),$.ajax({type:"POST",url:"index.cfm/fiddles/createSchema",data:{statement_separator:this.get("statement_separator"),db_type_id:this.get("dbType").id,schema_ddl:this.get("ddl")},dataType:"json",success:function(e,r,i){e.short_code?t.get("context")=="browser"?n.get("browserEngines")[t.get("className")].buildSchema({short_code:$.trim(e.short_code),statement_separator:n.get("statement_separator"),ddl:n.get("ddl"),success:function(){n.set({short_code:$.trim(e.short_code),ready:!0,valid:!0,errorMessage:""}),n.get("browserEngines")[t.get("className")].getSchemaStructure({callback:function(e){n.set({schema_structure:e}),n.trigger("built")}})},error:function(t){n.set({short_code:$.trim(e.short_code),ready:!1,valid:!1,errorMessage:t,schema_structure:[]}),n.trigger("failed")}}):(n.set({short_code:$.trim(e.short_code),ready:!0,valid:!0,errorMessage:"",schema_structure:e.schema_structure}),n.trigger("built")):(n.set({short_code:"",ready:!1,valid:!1,errorMessage:e.error,schema_structure:[]}),n.trigger("failed"))},error:function(e,t,r){n.set({short_code:"",ready:!1,valid:!1,errorMessage:r,schema_structure:[]}),n.trigger("failed")}})}});return t}),define("fiddle_backbone/models/Query",["jQuery","Backbone"],function(e,t){var n=t.Model.extend({defaults:{id:0,sql:"",sets:[],pendingChanges:!1,statement_separator:";"},reset:function(){this.set(this.defaults),this.trigger("reloaded")},execute:function(){var t=this;if(!this.has("schemaDef")||!this.get("schemaDef").has("dbType")||!this.get("schemaDef").get("ready"))return!1;e.ajax({type:"POST",url:"index.cfm/fiddles/runQuery",data:{db_type_id:this.get("schemaDef").get("dbType").id,schema_short_code:this.get("schemaDef").get("short_code"),statement_separator:this.get("statement_separator"),sql:this.get("sql")},dataType:"json",success:function(e,n,r){t.get("schemaDef").get("dbType").get("context")=="browser"?t.get("schemaDef").get("browserEngines")[t.get("schemaDef").get("dbType").get("className")].executeQuery({sql:t.get("sql"),statement_separator:t.get("statement_separator"),success:function(n){t.set({id:e.ID,sets:n}),t.trigger("executed")},error:function(e){t.set({sets:[{SUCCEEDED:!1,ERRORMESSAGE:e}]}),t.trigger("executed")}}):t.set({id:e.ID,sets:e.sets})},error:function(e,n,r){t.set({sets:[]})},complete:function(e,n){t.trigger("executed")}})}});return n});var Handlebars={};Handlebars.VERSION="1.0.beta.6",Handlebars.helpers={},Handlebars.partials={},Handlebars.registerHelper=function(e,t,n){n&&(t.not=n),this.helpers[e]=t},Handlebars.registerPartial=function(e,t){this.partials[e]=t},Handlebars.registerHelper("helperMissing",function(e){if(arguments.length===2)return undefined;throw new Error("Could not find property '"+e+"'")});var toString=Object.prototype.toString,functionType="[object Function]";Handlebars.registerHelper("blockHelperMissing",function(e,t){var n=t.inverse||function(){},r=t.fn,i="",s=toString.call(e);s===functionType&&(e=e.call(this));if(e===!0)return r(this);if(e===!1||e==null)return n(this);if(s==="[object Array]"){if(e.length>0)for(var o=0,u=e.length;o<u;o++)i+=r(e[o]);else i=n(this);return i}return r(e)}),Handlebars.registerHelper("each",function(e,t){var n=t.fn,r=t.inverse,i="";if(e&&e.length>0)for(var s=0,o=e.length;s<o;s++)i+=n(e[s]);else i=r(this);return i}),Handlebars.registerHelper("if",function(e,t){var n=toString.call(e);return n===functionType&&(e=e.call(this)),!e||Handlebars.Utils.isEmpty(e)?t.inverse(this):t.fn(this)}),Handlebars.registerHelper("unless",function(e,t){var n=t.fn,r=t.inverse;return t.fn=r,t.inverse=n,Handlebars.helpers["if"].call(this,e,t)}),Handlebars.registerHelper("with",function(e,t){return t.fn(e)}),Handlebars.registerHelper("log",function(e){Handlebars.log(e)});var handlebars=function(){var e={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,statements:6,simpleInverse:7,statement:8,openInverse:9,closeBlock:10,openBlock:11,mustache:12,partial:13,CONTENT:14,COMMENT:15,OPEN_BLOCK:16,inMustache:17,CLOSE:18,OPEN_INVERSE:19,OPEN_ENDBLOCK:20,path:21,OPEN:22,OPEN_UNESCAPED:23,OPEN_PARTIAL:24,params:25,hash:26,param:27,STRING:28,INTEGER:29,BOOLEAN:30,hashSegments:31,hashSegment:32,ID:33,EQUALS:34,pathSegments:35,SEP:36,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"OPEN_PARTIAL",28:"STRING",29:"INTEGER",30:"BOOLEAN",33:"ID",34:"EQUALS",36:"SEP"},productions_:[0,[3,2],[4,3],[4,1],[4,0],[6,1],[6,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[7,2],[17,3],[17,2],[17,2],[17,1],[25,2],[25,1],[27,1],[27,1],[27,1],[27,1],[26,1],[31,2],[31,1],[32,3],[32,3],[32,3],[32,3],[21,1],[35,3],[35,1]],performAction:function(t,n,r,i,s,o,u){var a=o.length-1;switch(s){case 1:return o[a-1];case 2:this.$=new i.ProgramNode(o[a-2],o[a]);break;case 3:this.$=new i.ProgramNode(o[a]);break;case 4:this.$=new i.ProgramNode([]);break;case 5:this.$=[o[a]];break;case 6:o[a-1].push(o[a]),this.$=o[a-1];break;case 7:this.$=new i.InverseNode(o[a-2],o[a-1],o[a]);break;case 8:this.$=new i.BlockNode(o[a-2],o[a-1],o[a]);break;case 9:this.$=o[a];break;case 10:this.$=o[a];break;case 11:this.$=new i.ContentNode(o[a]);break;case 12:this.$=new i.CommentNode(o[a]);break;case 13:this.$=new i.MustacheNode(o[a-1][0],o[a-1][1]);break;case 14:this.$=new i.MustacheNode(o[a-1][0],o[a-1][1]);break;case 15:this.$=o[a-1];break;case 16:this.$=new i.MustacheNode(o[a-1][0],o[a-1][1]);break;case 17:this.$=new i.MustacheNode(o[a-1][0],o[a-1][1],!0);break;case 18:this.$=new i.PartialNode(o[a-1]);break;case 19:this.$=new i.PartialNode(o[a-2],o[a-1]);break;case 20:break;case 21:this.$=[[o[a-2]].concat(o[a-1]),o[a]];break;case 22:this.$=[[o[a-1]].concat(o[a]),null];break;case 23:this.$=[[o[a-1]],o[a]];break;case 24:this.$=[[o[a]],null];break;case 25:o[a-1].push(o[a]),this.$=o[a-1];break;case 26:this.$=[o[a]];break;case 27:this.$=o[a];break;case 28:this.$=new i.StringNode(o[a]);break;case 29:this.$=new i.IntegerNode(o[a]);break;case 30:this.$=new i.BooleanNode(o[a]);break;case 31:this.$=new i.HashNode(o[a]);break;case 32:o[a-1].push(o[a]),this.$=o[a-1];break;case 33:this.$=[o[a]];break;case 34:this.$=[o[a-2],o[a]];break;case 35:this.$=[o[a-2],new i.StringNode(o[a])];break;case 36:this.$=[o[a-2],new i.IntegerNode(o[a])];break;case 37:this.$=[o[a-2],new i.BooleanNode(o[a])];break;case 38:this.$=new i.IdNode(o[a]);break;case 39:o[a-2].push(o[a]),this.$=o[a-2];break;case 40:this.$=[o[a]]}},table:[{3:1,4:2,5:[2,4],6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{1:[3]},{5:[1,16]},{5:[2,3],7:17,8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,19],20:[2,3],22:[1,13],23:[1,14],24:[1,15]},{5:[2,5],14:[2,5],15:[2,5],16:[2,5],19:[2,5],20:[2,5],22:[2,5],23:[2,5],24:[2,5]},{4:20,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{4:21,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],24:[2,9]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],24:[2,10]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],24:[2,11]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],24:[2,12]},{17:22,21:23,33:[1,25],35:24},{17:26,21:23,33:[1,25],35:24},{17:27,21:23,33:[1,25],35:24},{17:28,21:23,33:[1,25],35:24},{21:29,33:[1,25],35:24},{1:[2,1]},{6:30,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{5:[2,6],14:[2,6],15:[2,6],16:[2,6],19:[2,6],20:[2,6],22:[2,6],23:[2,6],24:[2,6]},{17:22,18:[1,31],21:23,33:[1,25],35:24},{10:32,20:[1,33]},{10:34,20:[1,33]},{18:[1,35]},{18:[2,24],21:40,25:36,26:37,27:38,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,38],28:[2,38],29:[2,38],30:[2,38],33:[2,38],36:[1,46]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],36:[2,40]},{18:[1,47]},{18:[1,48]},{18:[1,49]},{18:[1,50],21:51,33:[1,25],35:24},{5:[2,2],8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,2],22:[1,13],23:[1,14],24:[1,15]},{14:[2,20],15:[2,20],16:[2,20],19:[2,20],22:[2,20],23:[2,20],24:[2,20]},{5:[2,7],14:[2,7],15:[2,7],16:[2,7],19:[2,7],20:[2,7],22:[2,7],23:[2,7],24:[2,7]},{21:52,33:[1,25],35:24},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],24:[2,8]},{14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],24:[2,14]},{18:[2,22],21:40,26:53,27:54,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,23]},{18:[2,26],28:[2,26],29:[2,26],30:[2,26],33:[2,26]},{18:[2,31],32:55,33:[1,56]},{18:[2,27],28:[2,27],29:[2,27],30:[2,27],33:[2,27]},{18:[2,28],28:[2,28],29:[2,28],30:[2,28],33:[2,28]},{18:[2,29],28:[2,29],29:[2,29],30:[2,29],33:[2,29]},{18:[2,30],28:[2,30],29:[2,30],30:[2,30],33:[2,30]},{18:[2,33],33:[2,33]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],34:[1,57],36:[2,40]},{33:[1,58]},{14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],24:[2,13]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],24:[2,16]},{5:[2,17],14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],24:[2,17]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],24:[2,18]},{18:[1,59]},{18:[1,60]},{18:[2,21]},{18:[2,25],28:[2,25],29:[2,25],30:[2,25],33:[2,25]},{18:[2,32],33:[2,32]},{34:[1,57]},{21:61,28:[1,62],29:[1,63],30:[1,64],33:[1,25],35:24},{18:[2,39],28:[2,39],29:[2,39],30:[2,39],33:[2,39],36:[2,39]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],24:[2,19]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],24:[2,15]},{18:[2,34],33:[2,34]},{18:[2,35],33:[2,35]},{18:[2,36],33:[2,36]},{18:[2,37],33:[2,37]}],defaultActions:{16:[2,1],37:[2,23],53:[2,21]},parseError:function(t,n){throw new Error(t)},parse:function(t){function d(e){r.length=r.length-2*e,i.length=i.length-e,s.length=s.length-e}function v(){var e;return e=n.lexer.lex()||1,typeof e!="number"&&(e=n.symbols_[e]||e),e}var n=this,r=[0],i=[null],s=[],o=this.table,u="",a=0,f=0,l=0,c=2,h=1;this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,typeof this.lexer.yylloc=="undefined"&&(this.lexer.yylloc={});var p=this.lexer.yylloc;s.push(p),typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);var m,g,y,b,w,E,S={},x,T,N,C;for(;;){y=r[r.length-1],this.defaultActions[y]?b=this.defaultActions[y]:(m==null&&(m=v()),b=o[y]&&o[y][m]);if(typeof b=="undefined"||!b.length||!b[0])if(!l){C=[];for(x in o[y])this.terminals_[x]&&x>2&&C.push("'"+this.terminals_[x]+"'");var k="";this.lexer.showPosition?k="Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+C.join(", ")+", got '"+this.terminals_[m]+"'":k="Parse error on line "+(a+1)+": Unexpected "+(m==1?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(k,{text:this.lexer.match,token:this.terminals_[m]||m,line:this.lexer.yylineno,loc:p,expected:C})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+y+", token: "+m);switch(b[0]){case 1:r.push(m),i.push(this.lexer.yytext),s.push(this.lexer.yylloc),r.push(b[1]),m=null,g?(m=g,g=null):(f=this.lexer.yyleng,u=this.lexer.yytext,a=this.lexer.yylineno,p=this.lexer.yylloc,l>0&&l--);break;case 2:T=this.productions_[b[1]][1],S.$=i[i.length-T],S._$={first_line:s[s.length-(T||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(T||1)].first_column,last_column:s[s.length-1].last_column},E=this.performAction.call(S,u,f,a,this.yy,b[1],i,s);if(typeof E!="undefined")return E;T&&(r=r.slice(0,-1*T*2),i=i.slice(0,-1*T),s=s.slice(0,-1*T)),r.push(this.productions_[b[1]][0]),i.push(S.$),s.push(S._$),N=o[r[r.length-2]][r[r.length-1]],r.push(N);break;case 3:return!0}}return!0}},t=function(){var e={EOF:1,parseError:function(t,n){if(!this.yy.parseError)throw new Error(t);this.yy.parseError(t,n)},setInput:function(e){return this._input=e,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this},input:function(){var e=this._input[0];this.yytext+=e,this.yyleng++,this.match+=e,this.matched+=e;var t=e.match(/\n/);return t&&this.yylineno++,this._input=this._input.slice(1),e},unput:function(e){return this._input=e+this._input,this},more:function(){return this._more=!0,this},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=(new Array(e.length+1)).join("-");return e+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext="",this.match="");var i=this._currentRules();for(var s=0;s<i.length;s++){t=this._input.match(this.rules[i[s]]);if(t){r=t[0].match(/\n.*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-1:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,i[s],this.conditionStack[this.conditionStack.length-1]);if(e)return e;return}}if(this._input==="")return this.EOF;this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return typeof t!="undefined"?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(t){this.begin(t)}};return e.performAction=function(t,n,r,i){var s=i;switch(r){case 0:n.yytext.slice(-1)!=="\\"&&this.begin("mu"),n.yytext.slice(-1)==="\\"&&(n.yytext=n.yytext.substr(0,n.yyleng-1),this.begin("emu"));if(n.yytext)return 14;break;case 1:return 14;case 2:return this.popState(),14;case 3:return 24;case 4:return 16;case 5:return 20;case 6:return 19;case 7:return 19;case 8:return 23;case 9:return 23;case 10:return n.yytext=n.yytext.substr(3,n.yyleng-5),this.popState(),15;case 11:return 22;case 12:return 34;case 13:return 33;case 14:return 33;case 15:return 36;case 16:break;case 17:return this.popState(),18;case 18:return this.popState(),18;case 19:return n.yytext=n.yytext.substr(1,n.yyleng-2).replace(/\\"/g,'"'),28;case 20:return 30;case 21:return 30;case 22:return 29;case 23:return 33;case 24:return n.yytext=n.yytext.substr(1,n.yyleng-2),33;case 25:return"INVALID";case 26:return 5}},e.rules=[/^[^\x00]*?(?=(\{\{))/,/^[^\x00]+/,/^[^\x00]{2,}?(?=(\{\{))/,/^\{\{>/,/^\{\{#/,/^\{\{\//,/^\{\{\^/,/^\{\{\s*else\b/,/^\{\{\{/,/^\{\{&/,/^\{\{![\s\S]*?\}\}/,/^\{\{/,/^=/,/^\.(?=[} ])/,/^\.\./,/^[\/.]/,/^\s+/,/^\}\}\}/,/^\}\}/,/^"(\\["]|[^"])*"/,/^true(?=[}\s])/,/^false(?=[}\s])/,/^[0-9]+(?=[}\s])/,/^[a-zA-Z0-9_$-]+(?=[=}\s\/.])/,/^\[[^\]]*\]/,/^./,/^$/],e.conditions={mu:{rules:[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26],inclusive:!1},emu:{rules:[2],inclusive:!1},INITIAL:{rules:[0,1,26],inclusive:!0}},e}();return e.lexer=t,e}();typeof require!="undefined"&&typeof exports!="undefined"&&(exports.parser=handlebars,exports.parse=function(){return handlebars.parse.apply(handlebars,arguments)},exports.main=function(t){if(!t[1])throw new Error("Usage: "+t[0]+" FILE");if(typeof process!="undefined")var n=require("fs").readFileSync(require("path").join(process.cwd(),t[1]),"utf8");else var r=require("file").path(require("file").cwd()),n=r.join(t[1]).read({charset:"utf-8"});return exports.parser.parse(n)},typeof module!="undefined"&&require.main===module&&exports.main(typeof process!="undefined"?process.argv.slice(1):require("system").args)),Handlebars.Parser=handlebars,Handlebars.parse=function(e){return Handlebars.Parser.yy=Handlebars.AST,Handlebars.Parser.parse(e)},Handlebars.print=function(e){return(new Handlebars.PrintVisitor).accept(e)},Handlebars.logger={DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(e,t){}},Handlebars.log=function(e,t){Handlebars.logger.log(e,t)},function(){Handlebars.AST={},Handlebars.AST.ProgramNode=function(e,t){this.type="program",this.statements=e,t&&(this.inverse=new Handlebars.AST.ProgramNode(t))},Handlebars.AST.MustacheNode=function(e,t,n){this.type="mustache",this.id=e[0],this.params=e.slice(1),this.hash=t,this.escaped=!n},Handlebars.AST.PartialNode=function(e,t){this.type="partial",this.id=e,this.context=t};var e=function(e,t){if(e.original!==t.original)throw new Handlebars.Exception(e.original+" doesn't match "+t.original)};Handlebars.AST.BlockNode=function(t,n,r){e(t.id,r),this.type="block",this.mustache=t,this.program=n},Handlebars.AST.InverseNode=function(t,n,r){e(t.id,r),this.type="inverse",this.mustache=t,this.program=n},Handlebars.AST.ContentNode=function(e){this.type="content",this.string=e},Handlebars.AST.HashNode=function(e){this.type="hash",this.pairs=e},Handlebars.AST.IdNode=function(e){this.type="ID",this.original=e.join(".");var t=[],n=0;for(var r=0,i=e.length;r<i;r++){var s=e[r];s===".."?n++:s==="."||s==="this"?this.isScoped=!0:t.push(s)}this.parts=t,this.string=t.join("."),this.depth=n,this.isSimple=t.length===1&&n===0},Handlebars.AST.StringNode=function(e){this.type="STRING",this.string=e},Handlebars.AST.IntegerNode=function(e){this.type="INTEGER",this.integer=e},Handlebars.AST.BooleanNode=function(e){this.type="BOOLEAN",this.bool=e},Handlebars.AST.CommentNode=function(e){this.type="comment",this.comment=e}}(),Handlebars.Exception=function(e){var t=Error.prototype.constructor.apply(this,arguments);for(var n in t)t.hasOwnProperty(n)&&(this[n]=t[n]);this.message=t.message},Handlebars.Exception.prototype=new Error,Handlebars.SafeString=function(e){this.string=e},Handlebars.SafeString.prototype.toString=function(){return this.string.toString()},function(){var e={"<":"<",">":">",'"':""","'":"'","`":"`"},t=/&(?!\w+;)|[<>"'`]/g,n=/[&<>"'`]/,r=function(t){return e[t]||"&"};Handlebars.Utils={escapeExpression:function(e){return e instanceof Handlebars.SafeString?e.toString():e==null||e===!1?"":n.test(e)?e.replace(t,r):e},isEmpty:function(e){return typeof e=="undefined"?!0:e===null?!0:e===!1?!0:Object.prototype.toString.call(e)==="[object Array]"&&e.length===0?!0:!1}}}(),Handlebars.Compiler=function(){},Handlebars.JavaScriptCompiler=function(){},function(e,t){e.OPCODE_MAP={appendContent:1,getContext:2,lookupWithHelpers:3,lookup:4,append:5,invokeMustache:6,appendEscaped:7,pushString:8,truthyOrFallback:9,functionOrFallback:10,invokeProgram:11,invokePartial:12,push:13,assignToHash:15,pushStringParam:16},e.MULTI_PARAM_OPCODES={appendContent:1,getContext:1,lookupWithHelpers:2,lookup:1,invokeMustache:3,pushString:1,truthyOrFallback:1,functionOrFallback:1,invokeProgram:3,invokePartial:1,push:1,assignToHash:1,pushStringParam:1},e.DISASSEMBLE_MAP={};for(var n in e.OPCODE_MAP){var r=e.OPCODE_MAP[n];e.DISASSEMBLE_MAP[r]=n}e.multiParamSize=function(t){return e.MULTI_PARAM_OPCODES[e.DISASSEMBLE_MAP[t]]},e.prototype={compiler:e,disassemble:function(){var t=this.opcodes,n,r,i=[],s,o,u;for(var a=0,f=t.length;a<f;a++){n=t[a];if(n==="DECLARE")o=t[++a],u=t[++a],i.push("DECLARE "+o+" = "+u);else{s=e.DISASSEMBLE_MAP[n];var l=e.multiParamSize(n),c=[];for(var h=0;h<l;h++)r=t[++a],typeof r=="string"&&(r='"'+r.replace("\n","\\n")+'"'),c.push(r);s=s+" "+c.join(" "),i.push(s)}}return i.join("\n")},guid:0,compile:function(e,t){this.children=[],this.depths={list:[]},this.options=t;var n=this.options.knownHelpers;this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0};if(n)for(var r in n)this.options.knownHelpers[r]=n[r];return this.program(e)},accept:function(e){return this[e.type](e)},program:function(e){var t=e.statements,n;this.opcodes=[];for(var r=0,i=t.length;r<i;r++)n=t[r],this[n.type](n);return this.isSimple=i===1,this.depths.list=this.depths.list.sort(function(e,t){return e-t}),this},compileProgram:function(e){var t=(new this.compiler).compile(e,this.options),n=this.guid++;this.usePartial=this.usePartial||t.usePartial,this.children[n]=t;for(var r=0,i=t.depths.list.length;r<i;r++){depth=t.depths.list[r];if(depth<2)continue;this.addDepth(depth-1)}return n},block:function(e){var t=e.mustache,n,r,i,s,o=this.setupStackForMustache(t),u=this.compileProgram(e.program);e.program.inverse&&(s=this.compileProgram(e.program.inverse),this.declare("inverse",s)),this.opcode("invokeProgram",u,o.length,!!t.hash),this.declare("inverse",null),this.opcode("append")},inverse:function(e){var t=this.setupStackForMustache(e.mustache),n=this.compileProgram(e.program);this.declare("inverse",n),this.opcode("invokeProgram",null,t.length,!!e.mustache.hash),this.declare("inverse",null),this.opcode("append")},hash:function(e){var t=e.pairs,n,r;this.opcode("push","{}");for(var i=0,s=t.length;i<s;i++)n=t[i],r=n[1],this.accept(r),this.opcode("assignToHash",n[0])},partial:function(e){var t=e.id;this.usePartial=!0,e.context?this.ID(e.context):this.opcode("push","depth0"),this.opcode("invokePartial",t.original),this.opcode("append")},content:function(e){this.opcode("appendContent",e.string)},mustache:function(e){var t=this.setupStackForMustache(e);this.opcode("invokeMustache",t.length,e.id.original,!!e.hash),e.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},ID:function(e){this.addDepth(e.depth),this.opcode("getContext",e.depth),this.opcode("lookupWithHelpers",e.parts[0]||null,e.isScoped||!1);for(var t=1,n=e.parts.length;t<n;t++)this.opcode("lookup",e.parts[t])},STRING:function(e){this.opcode("pushString",e.string)},INTEGER:function(e){this.opcode("push",e.integer)},BOOLEAN:function(e){this.opcode("push",e.bool)},comment:function(){},pushParams:function(e){var t=e.length,n;while(t--)n=e[t],this.options.stringParams?(n.depth&&this.addDepth(n.depth),this.opcode("getContext",n.depth||0),this.opcode("pushStringParam",n.string)):this[n.type](n)},opcode:function(t,n,r,i){this.opcodes.push(e.OPCODE_MAP[t]),n!==undefined&&this.opcodes.push(n),r!==undefined&&this.opcodes.push(r),i!==undefined&&this.opcodes.push(i)},declare:function(e,t){this.opcodes.push("DECLARE"),this.opcodes.push(e),this.opcodes.push(t)},addDepth:function(e){if(e===0)return;this.depths[e]||(this.depths[e]=!0,this.depths.list.push(e))},setupStackForMustache:function(e){var t=e.params;return this.pushParams(t),e.hash&&this.hash(e.hash),this.ID(e.id),t}},t.prototype={nameLookup:function(e,n,r){return/^[0-9]+$/.test(n)?e+"["+n+"]":t.isValidJavaScriptVariableName(n)?e+"."+n:e+"['"+n+"']"},appendToBuffer:function(e){return this.environment.isSimple?"return "+e+";":"buffer += "+e+";"},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(e,t,n,r){this.environment=e,this.options=t||{},this.name=this.environment.name,this.isChild=!!n,this.context=n||{programs:[],aliases:{self:"this"},registers:{list:[]}},this.preamble(),this.stackSlot=0,this.stackVars=[],this.compileChildren(e,t);var i=e.opcodes,s;this.i=0;for(u=i.length;this.i<u;this.i++)s=this.nextOpcode(0),s[0]==="DECLARE"?(this.i=this.i+2,this[s[1]]=s[2]):(this.i=this.i+s[1].length,this[s[0]].apply(this,s[1]));return this.createFunctionContext(r)},nextOpcode:function(t){var n=this.environment.opcodes,r=n[this.i+t],i,s,o,u;if(r==="DECLARE")return i=n[this.i+1],s=n[this.i+2],["DECLARE",i,s];i=e.DISASSEMBLE_MAP[r],o=e.multiParamSize(r),u=[];for(var a=0;a<o;a++)u.push(n[this.i+a+1+t]);return[i,u]},eat:function(e){this.i=this.i+e.length},preamble:function(){var e=[];this.useRegister("foundHelper");if(!this.isChild){var t=this.namespace,n="helpers = helpers || "+t+".helpers;";this.environment.usePartial&&(n=n+" partials = partials || "+t+".partials;"),e.push(n)}else e.push("");this.environment.isSimple?e.push(""):e.push(", buffer = "+this.initializeBuffer()),this.lastContext=0,this.source=e},createFunctionContext:function(e){var t=this.stackVars;this.isChild||(t=t.concat(this.context.registers.list)),t.length>0&&(this.source[1]=this.source[1]+", "+t.join(", "));if(!this.isChild){var n=[];for(var r in this.context.aliases)this.source[1]=this.source[1]+", "+r+"="+this.context.aliases[r]}this.source[1]&&(this.source[1]="var "+this.source[1].substring(2)+";"),this.isChild||(this.source[1]+="\n"+this.context.programs.join("\n")+"\n"),this.environment.isSimple||this.source.push("return buffer;");var i=this.isChild?["depth0","data"]:["Handlebars","depth0","helpers","partials","data"];for(var s=0,o=this.environment.depths.list.length;s<o;s++)i.push("depth"+this.environment.depths.list[s]);if(e)return i.push(this.source.join("\n ")),Function.apply(this,i);var u="function "+(this.name||"")+"("+i.join(",")+") {\n "+this.source.join("\n ")+"}";return Handlebars.log(Handlebars.logger.DEBUG,u+"\n\n"),u},appendContent:function(e){this.source.push(this.appendToBuffer(this.quotedString(e)))},append:function(){var e=this.popStack();this.source.push("if("+e+" || "+e+" === 0) { "+this.appendToBuffer(e)+" }"),this.environment.isSimple&&this.source.push("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){var e=this.nextOpcode(1),t="";this.context.aliases.escapeExpression="this.escapeExpression",e[0]==="appendContent"&&(t=" + "+this.quotedString(e[1][0]),this.eat(e)),this.source.push(this.appendToBuffer("escapeExpression("+this.popStack()+")"+t))},getContext:function(e){this.lastContext!==e&&(this.lastContext=e)},lookupWithHelpers:function(e,t){if(e){var n=this.nextStack();this.usingKnownHelper=!1;var r;!t&&this.options.knownHelpers[e]?(r=n+" = "+this.nameLookup("helpers",e,"helper"),this.usingKnownHelper=!0):t||this.options.knownHelpersOnly?r=n+" = "+this.nameLookup("depth"+this.lastContext,e,"context"):(this.register("foundHelper",this.nameLookup("helpers",e,"helper")),r=n+" = foundHelper || "+this.nameLookup("depth"+this.lastContext,e,"context")),r+=";",this.source.push(r)}else this.pushStack("depth"+this.lastContext)},lookup:function(e){var t=this.topStack();this.source.push(t+" = ("+t+" === null || "+t+" === undefined || "+t+" === false ? "+t+" : "+this.nameLookup(t,e,"context")+");")},pushStringParam:function(e){this.pushStack("depth"+this.lastContext),this.pushString(e)},pushString:function(e){this.pushStack(this.quotedString(e))},push:function(e){this.pushStack(e)},invokeMustache:function(e,t,n){this.populateParams(e,this.quotedString(t),"{}",null,n,function(e,t,n){this.usingKnownHelper||(this.context.aliases.helperMissing="helpers.helperMissing",this.context.aliases.undef="void 0",this.source.push("else if("+n+"=== undef) { "+e+" = helperMissing.call("+t+"); }"),e!==n&&this.source.push("else { "+e+" = "+n+"; }"))})},invokeProgram:function(e,t,n){var r=this.programExpression(this.inverse),i=this.programExpression(e);this.populateParams(t,null,i,r,n,function(e,t,n){this.usingKnownHelper||(this.context.aliases.blockHelperMissing="helpers.blockHelperMissing",this.source.push("else { "+e+" = blockHelperMissing.call("+t+"); }"))})},populateParams:function(e,t,n,r,i,s){var o=i||this.options.stringParams||r||this.options.data,u=this.popStack(),a,f=[],l,c,h;o?(this.register("tmp1",n),h="tmp1"):h="{ hash: {} }";if(o){var p=i?this.popStack():"{}";this.source.push("tmp1.hash = "+p+";")}this.options.stringParams&&this.source.push("tmp1.contexts = [];");for(var d=0;d<e;d++)l=this.popStack(),f.push(l),this.options.stringParams&&this.source.push("tmp1.contexts.push("+this.popStack()+");");r&&(this.source.push("tmp1.fn = tmp1;"),this.source.push("tmp1.inverse = "+r+";")),this.options.data&&this.source.push("tmp1.data = data;"),f.push(h),this.populateCall(f,u,t||u,s,n!=="{}")},populateCall:function(e,t,n,r,i){var s=["depth0"].concat(e).join(", "),o=["depth0"].concat(n).concat(e).join(", "),u=this.nextStack();if(this.usingKnownHelper)this.source.push(u+" = "+t+".call("+s+");");else{this.context.aliases.functionType='"function"';var a=i?"foundHelper && ":"";this.source.push("if("+a+"typeof "+t+" === functionType) { "+u+" = "+t+".call("+s+"); }")}r.call(this,u,o,t),this.usingKnownHelper=!1},invokePartial:function(e){params=[this.nameLookup("partials",e,"partial"),"'"+e+"'",this.popStack(),"helpers","partials"],this.options.data&¶ms.push("data"),this.pushStack("self.invokePartial("+params.join(", ")+");")},assignToHash:function(e){var t=this.popStack(),n=this.topStack();this.source.push(n+"['"+e+"'] = "+t+";")},compiler:t,compileChildren:function(e,t){var n=e.children,r,i;for(var s=0,o=n.length;s<o;s++){r=n[s],i=new this.compiler,this.context.programs.push("");var u=this.context.programs.length;r.index=u,r.name="program"+u,this.context.programs[u]=i.compile(r,t,this.context)}},programExpression:function(e){if(e==null)return"self.noop";var t=this.environment.children[e],n=t.depths.list,r=[t.index,t.name,"data"];for(var i=0,s=n.length;i<s;i++)depth=n[i],depth===1?r.push("depth0"):r.push("depth"+(depth-1));return n.length===0?"self.program("+r.join(", ")+")":(r.shift(),"self.programWithDepth("+r.join(", ")+")")},register:function(e,t){this.useRegister(e),this.source.push(e+" = "+t+";")},useRegister:function(e){this.context.registers[e]||(this.context.registers[e]=!0,this.context.registers.list.push(e))},pushStack:function(e){return this.source.push(this.nextStack()+" = "+e+";"),"stack"+this.stackSlot},nextStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),"stack"+this.stackSlot},popStack:function(){return"stack"+this.stackSlot--},topStack:function(){return"stack"+this.stackSlot},quotedString:function(e){return'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r")+'"'}};var i="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),s=t.RESERVED_WORDS={};for(var o=0,u=i.length;o<u;o++)s[i[o]]=!0;t.isValidJavaScriptVariableName=function(e){return!t.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(e)?!0:!1}}(Handlebars.Compiler,Handlebars.JavaScriptCompiler),Handlebars.precompile=function(e,t){t=t||{};var n=Handlebars.parse(e),r=(new Handlebars.Compiler).compile(n,t);return(new Handlebars.JavaScriptCompiler).compile(r,t)},Handlebars.compile=function(e,t){function r(){var n=Handlebars.parse(e),r=(new Handlebars.Compiler).compile(n,t),i=(new Handlebars.JavaScriptCompiler).compile(r,t,undefined,!0);return Handlebars.template(i)}t=t||{};var n;return function(e,t){return n||(n=r()),n.call(this,e,t)}},Handlebars.VM={template:function(e){var t={escapeExpression:Handlebars.Utils.escapeExpression,invokePartial:Handlebars.VM.invokePartial,programs:[],program:function(e,t,n){var r=this.programs[e];return n?Handlebars.VM.program(t,n):r?r:(r=this.programs[e]=Handlebars.VM.program(t),r)},programWithDepth:Handlebars.VM.programWithDepth,noop:Handlebars.VM.noop};return function(n,r){return r=r||{},e.call(t,Handlebars,n,r.helpers,r.partials,r.data)}},programWithDepth:function(e,t,n){var r=Array.prototype.slice.call(arguments,2);return function(n,i){return i=i||{},e.apply(this,[n,i.data||t].concat(r))}},program:function(e,t){return function(n,r){return r=r||{},e(n,r.data||t)}},noop:function(){return""},invokePartial:function(e,t,n,r,i,s){options={helpers:r,partials:i,data:s};if(e===undefined)throw new Handlebars.Exception("The partial "+t+" could not be found");if(e instanceof Function)return e(n,options);if(!Handlebars.compile)throw new Handlebars.Exception("The partial "+t+" could not be compiled when running in runtime-only mode");return i[t]=Handlebars.compile(e),i[t](n,options)}},Handlebars.template=Handlebars.VM.template,define("Handlebars",function(e){return function(){return e.Handlebars}}(this)),define("text",["module"],function(e){var t,n,r=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],i=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,s=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,o=typeof location!="undefined"&&location.href,u=o&&location.protocol&&location.protocol.replace(/\:/,""),a=o&&location.hostname,f=o&&(location.port||undefined),l=[],c=e.config&&e.config()||{};t={version:"2.0.3",strip:function(e){if(e){e=e.replace(i,"");var t=e.match(s);t&&(e=t[1])}else e="";return e},jsEscape:function(e){return e.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:c.createXhr||function(){var e,t,n;if(typeof XMLHttpRequest!="undefined")return new XMLHttpRequest;if(typeof ActiveXObject!="undefined")for(t=0;t<3;t+=1){n=r[t];try{e=new ActiveXObject(n)}catch(i){}if(e){r=[n];break}}return e},parseName:function(e){var t=!1,n=e.indexOf("."),r=e.substring(0,n),i=e.substring(n+1,e.length);return n=i.indexOf("!"),n!==-1&&(t=i.substring(n+1,i.length),t=t==="strip",i=i.substring(0,n)),{moduleName:r,ext:i,strip:t}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,n,r,i){var s,o,u,a=t.xdRegExp.exec(e);return a?(s=a[2],o=a[3],o=o.split(":"),u=o[1],o=o[0],(!s||s===n)&&(!o||o.toLowerCase()===r.toLowerCase())&&(!u&&!o||u===i)):!0},finishLoad:function(e,n,r,i){r=n?t.strip(r):r,c.isBuild&&(l[e]=r),i(r)},load:function(e,n,r,i){if(i.isBuild&&!i.inlineText){r();return}c.isBuild=i.isBuild;var s=t.parseName(e),l=s.moduleName+"."+s.ext,h=n.toUrl(l),p=c.useXhr||t.useXhr;!o||p(h,u,a,f)?t.get(h,function(n){t.finishLoad(e,s.strip,n,r)},function(e){r.error&&r.error(e)}):n([l],function(e){t.finishLoad(s.moduleName+"."+s.ext,s.strip,e,r)})},write:function(e,n,r,i){if(l.hasOwnProperty(n)){var s=t.jsEscape(l[n]);r.asModule(e+"!"+n,"define(function () { return '"+s+"';});\n")}},writeFile:function(e,n,r,i,s){var o=t.parseName(n),u=o.moduleName+"."+o.ext,a=r.toUrl(o.moduleName+"."+o.ext)+".js";t.load(u,r,function(n){var r=function(e){return i(a,e)};r.asModule=function(e,t){return i.asModule(e,a,t)},t.write(e,u,r,s)},s)}};if(c.env==="node"||!c.env&&typeof process!="undefined"&&process.versions&&!!process.versions.node)n=require.nodeRequire("fs"),t.get=function(e,t){var r=n.readFileSync(e,"utf8");r.indexOf("")===0&&(r=r.substring(1)),t(r)};else if(c.env==="xhr"||!c.env&&t.createXhr())t.get=function(e,n,r){var i=t.createXhr();i.open("GET",e,!0),c.onXhr&&c.onXhr(i,e),i.onreadystatechange=function(t){var s,o;i.readyState===4&&(s=i.status,s>399&&s<600?(o=new Error(e+" HTTP status: "+s),o.xhr=i,r(o)):n(i.responseText))},i.send(null)};else if(c.env==="rhino"||!c.env&&typeof Packages!="undefined"&&typeof java!="undefined")t.get=function(e,t){var n,r,i="utf-8",s=new java.io.File(e),o=java.lang.System.getProperty("line.separator"),u=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(s),i)),a="";try{n=new java.lang.StringBuffer,r=u.readLine(),r&&r.length()&&r.charAt(0)===65279&&(r=r.substring(1)),n.append(r);while((r=u.readLine())!==null)n.append(o),n.append(r);a=String(n.toString())}finally{u.close()}t(a)};return t}),define("text!fiddle_backbone/templates/dbTypes.html",[],function(){return' <a class="dropdown-toggle" data-toggle="dropdown" href="#">\n {{selectedFullName}} <b class="caret"></b>\n </a>\n <ul class="dropdown-menu">\n {{#each dbTypes}}\n <li db_type_id="{{this.id}}" class="{{this.className}}"><a href="#"><i class="icon-tag"></i>{{this.full_name}}</a></li>\n {{/each}}\n </ul>'}),define("fiddle_backbone/views/DBTypesList",["jQuery","Backbone","Handlebars","text!fiddle_backbone/templates/dbTypes.html"],function(e,t,n,r){var i=t.View.extend({initialize:function(){this.compiledTemplate=n.compile(r)},events:{"click ul.dropdown-menu li":"clickDBType"},clickDBType:function(t){t.preventDefault(),this.collection.setSelectedType(e(t.currentTarget).attr("db_type_id"))},render:function(){var t=this.collection.getSelectedType();return e(this.el).html(this.compiledTemplate({dbTypes:this.collection.map(function(e){var t=e.toJSON();return t.className=t.selected?"active":"",t}),selectedFullName:t.get("full_name")})),e("#db_type_label_collapsed .navbar-text").text(t.get("full_name")),this}});return i});var CodeMirror=function(){function e(r,i){function Kt(e){return e>=0&&e<bt.size}function Gt(e){return E(bt,e)}function Yt(e,t){Bt=!0;var n=t-e.height;for(var r=e;r;r=r.parent)r.height+=n}function Zt(e){var t={line:0,ch:0};mn(t,{line:bt.size-1,ch:Gt(bt.size-1).text.length},ut(e),t,t),Ot=!0}function en(){var e=[];return bt.iter(0,bt.size,function(t){e.push(t.text)}),e.join("\n")}function tn(e){function c(e){var t=Hr(e,!0);if(t&&!Z(t,o)){Et||dn(),o=t,zn(r,t),Ot=!1;var n=Bn();if(t.line>=n.to||t.line<n.from)u=setTimeout(Jr(function(){c(e)}),150)}}function h(e){clearTimeout(u);var t=Hr(e);t&&zn(r,t),L(e),_n(),Ot=!0,p(),f()}Un(D(e,"shiftKey"));for(var t=M(e);t!=y;t=t.parentNode)if(t.parentNode==V&&t!=J)return;for(var t=M(e);t!=y;t=t.parentNode)if(t.parentNode==nt)return s.onGutterClick&&s.onGutterClick(Qt,st(nt.childNodes,t)+It,e),L(e);var r=Hr(e);switch(_(e)){case 3:j&&!n&&Br(e);return;case 2:r&&Vn(r.line,r.ch,!0);return}if(!r){M(e)==z&&L(e);return}Et||dn();var i=+(new Date);if(Nt&&Nt.time>i-400&&Z(Nt.pos,r))return L(e),setTimeout(_n,20),tr(r.line);if(Tt&&Tt.time>i-400&&Z(Tt.pos,r))return Nt={time:i,pos:r},L(e),er(r);Tt={time:i,pos:r};var o=r,u;if(s.dragDrop&&X&&!s.readOnly&&!Z(St.from,St.to)&&!et(r,St.from)&&!et(St.to,r)){R&&(rt.draggable=!0);function a(t){R&&(rt.draggable=!1),kt=!1,f(),l(),Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)<10&&(L(t),Vn(r.line,r.ch,!0),_n())}var f=P(document,"mouseup",Jr(a),!0),l=P(z,"drop",Jr(a),!0);kt=!0,rt.dragDrop&&rt.dragDrop();return}L(e),Vn(r.line,r.ch,!0);var p=P(document,"mousemove",Jr(function(e){clearTimeout(u),L(e),!F&&!_(e)?h(e):c(e)}),!0),f=P(document,"mouseup",Jr(h),!0)}function nn(e){for(var t=M(e);t!=y;t=t.parentNode)if(t.parentNode==nt)return L(e);var n=Hr(e);if(!n)return;Nt={time:+(new Date),pos:n},L(e),er(n)}function rn(e){if(s.onDragEvent&&s.onDragEvent(Qt,k(e)))return;e.preventDefault();var t=Hr(e,!0),n=e.dataTransfer.files;if(!t||s.readOnly)return;if(n&&n.length&&window.FileReader&&window.File){function r(e,n){var r=new FileReader;r.onload=function(){o[n]=r.result,++u==i&&(t=Jn(t),Jr(function(){var e=En(o.join(""),t,t);zn(t,e)})())},r.readAsText(e)}var i=n.length,o=Array(i),u=0;for(var a=0;a<i;++a)r(n[a],a)}else try{var o=e.dataTransfer.getData("Text");o&&Kr(function(){var e=St.from,n=St.to;zn(t,t),kt&&En("",e,n),Sn(o),_n()})}catch(e){}}function sn(e){var t=Nn();e.dataTransfer.setData("Text",t);if(j||U){var n=document.createElement("img");n.scr="data:image/gif;base64,R0lGODdhAgACAIAAAAAAAP///ywAAAAAAgACAAACAoRRADs=",e.dataTransfer.setDragImage(n,0,0)}}function on(e,t){if(typeof e=="string"){e=u[e];if(!e)return!1}var n=xt;try{s.readOnly&&(At=!0),t&&(xt=null),e(Qt)}catch(r){if(r!=B)throw r;return!1}finally{xt=n,At=!1}return!0}function un(e){function u(){o=!0}var t=f(s.keyMap),n=t.auto;clearTimeout(ln),n&&!c(e)&&(ln=setTimeout(function(){f(s.keyMap)==t&&(s.keyMap=n.call?n.call(null,Qt):n)},50));var r=ft[D(e,"keyCode")],i=!1;if(r==null||e.altGraphKey)return!1;D(e,"altKey")&&(r="Alt-"+r),D(e,"ctrlKey")&&(r="Ctrl-"+r),D(e,"metaKey")&&(r="Cmd-"+r);var o=!1;return D(e,"shiftKey")?i=l("Shift-"+r,s.extraKeys,s.keyMap,function(e){return on(e,!0)},u)||l(r,s.extraKeys,s.keyMap,function(e){if(typeof e=="string"&&/^go[A-Z]/.test(e))return on(e)},u):i=l(r,s.extraKeys,s.keyMap,on,u),o&&(i=!1),i&&(L(e),F&&(e.oldKeyCode=e.keyCode,e.keyCode=0)),i}function an(e,t){var n=l("'"+t+"'",s.extraKeys,s.keyMap,function(e){return on(e,!0)});return n&&L(e),n}function cn(e){Et||dn(),F&&e.keyCode==27&&(e.returnValue=!1),Cn&&On()&&(Cn=!1);if(s.onKeyEvent&&s.onKeyEvent(Qt,k(e)))return;var t=D(e,"keyCode");Un(t==16||D(e,"shiftKey"));var r=un(e);window.opera&&(fn=r?t:null,!r&&t==88&&D(e,n?"metaKey":"ctrlKey")&&Sn(""))}function hn(e){Cn&&On();if(s.onKeyEvent&&s.onKeyEvent(Qt,k(e)))return;var t=D(e,"keyCode"),n=D(e,"charCode");if(window.opera&&t==fn){fn=null,L(e);return}if((window.opera&&!e.which||W)&&un(e))return;var r=String.fromCharCode(n==null?t:n);s.electricChars&&yt.electricChars&&s.smartIndent&&!s.readOnly&&yt.electricChars.indexOf(r)>-1&&setTimeout(Jr(function(){rr(St.to.line,"smart")}),75);if(an(e,r))return;Ln()}function pn(e){if(s.onKeyEvent&&s.onKeyEvent(Qt,k(e)))return;D(e,"keyCode")==16&&(xt=null)}function dn(){if(s.readOnly=="nocursor")return;Et||(s.onFocus&&s.onFocus(Qt),Et=!0,y.className.search(/\bCodeMirror-focused\b/)==-1&&(y.className+=" CodeMirror-focused"),Ht||Mn(!0)),kn(),jr()}function vn(){Et&&(s.onBlur&&s.onBlur(Qt),Et=!1,Ut&&Jr(function(){Ut&&(Ut(),Ut=null)})(),y.className=y.className.replace(" CodeMirror-focused","")),clearInterval(gt),setTimeout(function(){Et||(xt=null)},150)}function mn(e,t,n,r,i){if(At)return;if(Vt){var o=[];bt.iter(e.line,t.line+1,function(e){o.push(e.text)}),Vt.addChange(e.line,n.length,o);while(Vt.done.length>s.undoDepth)Vt.done.shift()}wn(e,t,n,r,i)}function gn(e,t){if(!e.length)return;var n=e.pop(),r=[];for(var i=n.length-1;i>=0;i-=1){var s=n[i],o=[],u=s.start+s.added;bt.iter(s.start,u,function(e){o.push(e.text)}),r.push({start:s.start,added:s.old.length,old:o});var a=Jn({line:s.start+s.old.length-1,ch:it(o[o.length-1],s.old[s.old.length-1])});wn({line:s.start,ch:0},{line:u-1,ch:Gt(u-1).text.length},s.old,a,a)}Ot=!0,t.push(r)}function yn(){gn(Vt.done,Vt.undone)}function bn(){gn(Vt.undone,Vt.done)}function wn(e,t,n,r,i){function T(e){return e<=Math.min(t.line,t.line+y)?e:e+y}if(At)return;var o=!1,u=zt.length;s.lineWrapping||bt.iter(e.line,t.line+1,function(e){if(e.text.length==u)return o=!0,!0});if(e.line!=t.line||n.length>1)Bt=!0;var a=t.line-e.line,f=Gt(e.line),l=Gt(t.line);if(e.ch==0&&t.ch==0&&n[n.length-1]==""){var c=[],h=null;e.line?(h=Gt(e.line-1),h.fixMarkEnds(l)):l.fixMarkStarts();for(var p=0,d=n.length-1;p<d;++p)c.push(g.inheritMarks(n[p],h));a&&bt.remove(e.line,a,jt),c.length&&bt.insert(e.line,c)}else if(f==l)if(n.length==1)f.replace(e.ch,t.ch,n[0]);else{l=f.split(t.ch,n[n.length-1]),f.replace(e.ch,null,n[0]),f.fixMarkEnds(l);var c=[];for(var p=1,d=n.length-1;p<d;++p)c.push(g.inheritMarks(n[p],f));c.push(l),bt.insert(e.line+1,c)}else if(n.length==1)f.replace(e.ch,null,n[0]),l.replace(null,t.ch,""),f.append(l),bt.remove(e.line+1,a,jt);else{var c=[];f.replace(e.ch,null,n[0]),l.replace(null,t.ch,n[n.length-1]),f.fixMarkEnds(l);for(var p=1,d=n.length-1;p<d;++p)c.push(g.inheritMarks(n[p],f));a>1&&bt.remove(e.line+1,a-1,jt),bt.insert(e.line+1,c)}if(s.lineWrapping){var v=Math.max(5,z.clientWidth/_r()-3);bt.iter(e.line,e.line+n.length,function(e){if(e.hidden)return;var t=Math.ceil(e.text.length/v)||1;t!=e.height&&Yt(e,t)})}else bt.iter(e.line,e.line+n.length,function(e){var t=e.text;t.length>u&&(zt=t,u=t.length,Wt=null,o=!1)}),o&&(u=0,zt="",Wt=null,bt.iter(0,bt.size,function(e){var t=e.text;t.length>u&&(u=t.length,zt=t)}));var m=[],y=n.length-a-1;for(var p=0,b=wt.length;p<b;++p){var w=wt[p];w<e.line?m.push(w):w>t.line&&m.push(w+y)}var E=e.line+Math.min(n.length,500);Ur(e.line,E),m.push(E),wt=m,Wr(100),_t.push({from:e.line,to:t.line+1,diff:y});var S={from:e,to:t,text:n};if(Dt){for(var x=Dt;x.next;x=x.next);x.next=S}else Dt=S;Wn(r,i,T(St.from.line),T(St.to.line)),z.clientHeight&&(V.style.height=bt.height*Ar()+2*Dr()+"px")}function En(e,t,n){function r(r){if(et(r,t))return r;if(!et(n,r))return i;var s=r.line+e.length-(n.line-t.line)-1,o=r.ch;return r.line==n.line&&(o+=e[e.length-1].length-(n.ch-(n.line==t.line?t.ch:0))),{line:s,ch:o}}t=Jn(t),n?n=Jn(n):n=t,e=ut(e);var i;return xn(e,t,n,function(e){return i=e,{from:r(St.from),to:r(St.to)}}),i}function Sn(e,t){xn(ut(e),St.from,St.to,function(e){return t=="end"?{from:e,to:e}:t=="start"?{from:St.from,to:St.from}:{from:St.from,to:e}})}function xn(e,t,n,r){var i=e.length==1?e[0].length+t.ch:e[e.length-1].length,s=r({line:t.line+e.length-1,ch:i});mn(t,n,e,s.from,s.to)}function Tn(e,t){var n=e.line,r=t.line;if(n==r)return Gt(n).text.slice(e.ch,t.ch);var i=[Gt(n).text.slice(e.ch)];return bt.iter(n+1,r,function(e){i.push(e.text)}),i.push(Gt(r).text.slice(0,t.ch)),i.join("\n")}function Nn(){return Tn(St.from,St.to)}function kn(){if(Cn)return;vt.set(s.pollInterval,function(){Xr(),On(),Et&&kn(),Vr()})}function Ln(){function t(){Xr();var n=On();!n&&!e?(e=!0,vt.set(60,t)):(Cn=!1,kn()),Vr()}var e=!1;Cn=!0,vt.set(20,t)}function On(){if(Ht||!Et||at(A)||s.readOnly)return!1;var e=A.value;if(e==An)return!1;xt=null;var t=0,n=Math.min(An.length,e.length);while(t<n&&An[t]==e[t])++t;return t<An.length?St.from={line:St.from.line,ch:St.from.ch-(An.length-t)}:Lt&&Z(St.from,St.to)&&(St.to={line:St.to.line,ch:Math.min(Gt(St.to.line).text.length,St.to.ch+(e.length-t))}),Sn(e.slice(t),"end"),An=e,!0}function Mn(e){Z(St.from,St.to)?e&&(An=A.value=""):(An="",A.value=Nn(),Y(A))}function _n(){s.readOnly!="nocursor"&&A.focus()}function Dn(){if(!ct.getBoundingClientRect)return;var e=ct.getBoundingClientRect();if(F&&e.top==e.bottom)return;var t=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(e.top<0||e.bottom>t)&&ct.scrollIntoView()}function Pn(){var e=xr(St.inverted?St.from:St.to),t=s.lineWrapping?Math.min(e.x,rt.offsetWidth):e.x;return Hn(t,e.y,t,e.yBot)}function Hn(e,t,n,r){var i=Pr(),o=Dr();t+=o,r+=o,e+=i,n+=i;var u=z.clientHeight,a=z.scrollTop,f=!1,l=!0;t<a?(z.scrollTop=Math.max(0,t),f=!0):r>a+u&&(z.scrollTop=r-u,f=!0);var c=z.clientWidth,h=z.scrollLeft,p=s.fixedGutter?K.clientWidth:0,d=e<p+i+10;return e<h+p||d?(d&&(e=0),z.scrollLeft=Math.max(0,e-10-p),f=!0):n>c+h-3&&(z.scrollLeft=n+10-c,f=!0,n>V.clientWidth&&(l=!1)),f&&s.onScroll&&s.onScroll(Qt),l}function Bn(){var e=Ar(),t=z.scrollTop-Dr(),n=Math.max(0,Math.floor(t/e)),r=Math.ceil((t+z.clientHeight)/e);return{from:x(bt,n),to:x(bt,r)}}function jn(e,t){function p(){Wt=z.clientWidth;var e=pt.firstChild,t=!1;return bt.iter(It,qt,function(n){if(!n.hidden){var r=Math.round(e.offsetHeight/l)||1;n.height!=r&&(Yt(n,r),Bt=t=!0)}e=e.nextSibling}),t&&(V.style.height=bt.height*l+2*Dr()+"px"),t}if(!z.clientWidth){It=qt=Ft=0;return}var n=Bn();if(e!==!0&&e.length==0&&n.from>It&&n.to<qt)return;var r=Math.max(n.from-100,0),i=Math.min(bt.size,n.to+100);It<r&&r-It<20&&(r=It),qt>i&&qt-i<20&&(i=Math.min(bt.size,qt));var o=e===!0?[]:Fn([{from:It,to:qt,domStart:0}],e),u=0;for(var a=0;a<o.length;++a){var f=o[a];f.from<r&&(f.domStart+=r-f.from,f.from=r),f.to>i&&(f.to=i),f.from>=f.to?o.splice(a--,1):u+=f.to-f.from}if(u==i-r&&r==It&&i==qt)return;o.sort(function(e,t){return e.domStart-t.domStart});var l=Ar(),c=K.style.display;pt.style.display="none",In(r,i,o),pt.style.display=K.style.display="";var h=r!=It||i!=qt||Rt!=z.clientHeight+l;h&&(Rt=z.clientHeight+l),It=r,qt=i,Ft=T(bt,r),J.style.top=Ft*l+"px",z.clientHeight&&(V.style.height=bt.height*l+2*Dr()+"px");if(pt.childNodes.length!=qt-It)throw new Error("BAD PATCH! "+JSON.stringify(o)+" size="+(qt-It)+" nodes="+pt.childNodes.length);return s.lineWrapping?p():(Wt==null&&(Wt=br(zt)),Wt>z.clientWidth?(rt.style.width=Wt+"px",V.style.width="",V.style.width=z.scrollWidth+"px"):rt.style.width=V.style.width=""),K.style.display=c,(h||Bt)&&qn()&&s.lineWrapping&&p()&&qn(),Rn(),!t&&s.onUpdate&&s.onUpdate(Qt),!0}function Fn(e,t){for(var n=0,r=t.length||0;n<r;++n){var i=t[n],s=[],o=i.diff||0;for(var u=0,a=e.length;u<a;++u){var f=e[u];i.to<=f.from&&i.diff?s.push({from:f.from+o,to:f.to+o,domStart:f.domStart}):i.to<=f.from||i.from>=f.to?s.push(f):(i.from>f.from&&s.push({from:f.from,to:i.from,domStart:f.domStart}),i.to<f.to&&s.push({from:i.to+o,to:f.to+o,domStart:f.domStart+(i.to-f.from)}))}e=s}return e}function In(e,t,n){if(!n.length)pt.innerHTML="";else{function r(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}var i=0,s=pt.firstChild,o;for(var u=0;u<n.length;++u){var a=n[u];while(a.domStart>i)s=r(s),i++;for(var f=0,l=a.to-a.from;f<l;++f)s=s.nextSibling,i++}while(s)s=r(s)}var c=n.shift(),s=pt.firstChild,f=e,h=document.createElement("div");bt.iter(e,t,function(e){c&&c.to==f&&(c=n.shift());if(!c||c.from>f){if(e.hidden)var t=h.innerHTML="<pre></pre>";else{var t="<pre"+(e.className?' class="'+e.className+'"':"")+">"+e.getHTML(ur)+"</pre>";e.bgClassName&&(t='<div style="position: relative"><pre class="'+e.bgClassName+'" style="position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2"> </pre>'+t+"</div>")}h.innerHTML=t,pt.insertBefore(h.firstChild,s)}else s=s.nextSibling;++f})}function qn(){if(!s.gutter&&!s.lineNumbers)return;var e=J.offsetHeight,t=z.clientHeight;K.style.height=(e-t<2?t:e)+"px";var n=[],r=It,i;bt.iter(It,Math.max(qt,It+1),function(e){if(e.hidden)n.push("<pre></pre>");else{var t=e.gutterMarker,o=s.lineNumbers?r+s.firstLineNumber:null;t&&t.text?o=t.text.replace("%N%",o!=null?o:""):o==null&&(o=" "),n.push(t&&t.style?'<pre class="'+t.style+'">':"<pre>",o);for(var u=1;u<e.height;++u)n.push("<br/> ");n.push("</pre>"),t||(i=r)}++r}),K.style.display="none",nt.innerHTML=n.join("");if(i!=null){var o=nt.childNodes[i-It],u=String(bt.size).length,a=G(o),f="";while(a.length+f.length<u)f+=" ";f&&o.insertBefore(document.createTextNode(f),o.firstChild)}K.style.display="";var l=Math.abs((parseInt(rt.style.marginLeft)||0)-K.offsetWidth)>2;return rt.style.marginLeft=K.offsetWidth+"px",Bt=!1,l}function Rn(){var e=Z(St.from,St.to),t=xr(St.from,!0),n=e?t:xr(St.to,!0),r=St.inverted?t:n,i=Ar(),o=Q(y),u=Q(pt);C.style.top=Math.max(0,Math.min(z.offsetHeight,r.y+u.top-o.top))+"px",C.style.left=Math.max(0,Math.min(z.offsetWidth,r.x+u.left-o.left))+"px";if(e)ct.style.top=r.y+"px",ct.style.left=(s.lineWrapping?Math.min(r.x,rt.offsetWidth):r.x)+"px",ct.style.display="",ht.style.display="none";else{var a=t.y==n.y,f="",l=rt.clientWidth||rt.offsetWidth,c=rt.clientHeight||rt.offsetHeight;function h(e,t,n,r){var i=q?"width: "+(n?l-n-e:l)+"px":"right: "+n+"px";f+='<div class="CodeMirror-selected" style="position: absolute; left: '+e+"px; top: "+t+"px; "+i+"; height: "+r+'px"></div>'}if(St.from.ch&&t.y>=0){var p=a?l-n.x:0;h(t.x,t.y,p,i)}var d=Math.max(0,t.y+(St.from.ch?i:0)),v=Math.min(n.y,c)-d;v>.2*i&&h(0,d,0,v),(!a||!St.from.ch)&&n.y<c-.5*i&&h(0,n.y,l-n.x,i),ht.innerHTML=f,ct.style.display="none",ht.style.display=""}}function Un(e){e?xt=xt||(St.inverted?St.to:St.from):xt=null}function zn(e,t){var n=xt&&Jn(xt);n&&(et(n,e)?e=n:et(t,n)&&(t=n)),Wn(e,t),Mt=!0}function Wn(e,t,n,r){Yn=null,n==null&&(n=St.from.line,r=St.to.line);if(Z(St.from,e)&&Z(St.to,t))return;if(et(t,e)){var i=t;t=e,e=i}if(e.line!=n){var o=Xn(e,n,St.from.ch);o?e=o:gr(e.line,!1)}t.line!=r&&(t=Xn(t,r,St.to.ch)),Z(e,t)?St.inverted=!1:Z(e,St.to)?St.inverted=!1:Z(t,St.from)&&(St.inverted=!0);if(s.autoClearEmptyLines&&Z(St.from,St.to)){var u=St.inverted?e:t;if(u.line!=St.from.line&&St.from.line<bt.size){var a=Gt(St.from.line);/^\s+$/.test(a.text)&&setTimeout(Jr(function(){if(a.parent&&/^\s+$/.test(a.text)){var e=S(a);En("",{line:e,ch:0},{line:e,ch:a.text.length})}},10))}}St.from=e,St.to=t,Pt=!0}function Xn(e,t,n){function r(t){var r=e.line+t,i=t==1?bt.size:-1;while(r!=i){var o=Gt(r);if(!o.hidden){var u=e.ch;if(s||u>n||u>o.text.length)u=o.text.length;return{line:r,ch:u}}r+=t}}var i=Gt(e.line),s=e.ch==i.text.length&&e.ch!=n;return i.hidden?e.line>=t?r(1)||r(-1):r(-1)||r(1):e}function Vn(e,t,n){var r=Jn({line:e,ch:t||0});(n?zn:Wn)(r,r)}function $n(e){return Math.max(0,Math.min(e,bt.size-1))}function Jn(e){if(e.line<0)return{line:0,ch:0};if(e.line>=bt.size)return{line:bt.size-1,ch:Gt(bt.size-1).text.length};var t=e.ch,n=Gt(e.line).text.length;return t==null||t>n?{line:e.line,ch:n}:t<0?{line:e.line,ch:0}:e}function Kn(e,t){function o(){for(var t=r+e,n=e<0?-1:bt.size;t!=n;t+=e){var i=Gt(t);if(!i.hidden)return r=t,s=i,!0}}function u(t){if(i==(e<0?0:s.text.length)){if(!!t||!o())return!1;i=e<0?s.text.length:0}else i+=e;return!0}var n=St.inverted?St.from:St.to,r=n.line,i=n.ch,s=Gt(r);if(t=="char")u();else if(t=="column")u(!0);else if(t=="word"){var a=!1;for(;;){if(e<0&&!u())break;if(ot(s.text.charAt(i)))a=!0;else if(a){e<0&&(e=1,u());break}if(e>0&&!u())break}}return{line:r,ch:i}}function Qn(e,t){var n=e<0?St.from:St.to;if(xt||Z(St.from,St.to))n=Kn(e,t);Vn(n.line,n.ch,!0)}function Gn(e,t){Z(St.from,St.to)?e<0?En("",Kn(e,t),St.to):En("",St.from,Kn(e,t)):En("",St.from,St.to),Mt=!0}function Zn(e,t){var n=0,r=xr(St.inverted?St.from:St.to,!0);Yn!=null&&(r.x=Yn),t=="page"?n=Math.min(z.clientHeight,window.innerHeight||document.documentElement.clientHeight):t=="line"&&(n=Ar());var i=Tr(r.x,r.y+n*e+2);t=="page"&&(z.scrollTop+=xr(i,!0).y-r.y),Vn(i.line,i.ch,!0),Yn=r.x}function er(e){var t=Gt(e.line).text,n=e.ch,r=e.ch;while(n>0&&ot(t.charAt(n-1)))--n;while(r<t.length&&ot(t.charAt(r)))++r;zn({line:e.line,ch:n},{line:e.line,ch:r})}function tr(e){zn({line:e,ch:0},Jn({line:e+1,ch:0}))}function nr(e){if(Z(St.from,St.to))return rr(St.from.line,e);var t=St.to.line-(St.to.ch?0:1);for(var n=St.from.line;n<=t;++n)rr(n,e)}function rr(e,t){t||(t="add");if(t=="smart")if(!yt.indent)t="prev";else var n=Rr(e);var r=Gt(e),i=r.indentation(s.tabSize),o=r.text.match(/^\s*/)[0],u;t=="prev"?e?u=Gt(e-1).indentation(s.tabSize):u=0:t=="smart"?u=yt.indent(n,r.text.slice(o.length),r.text):t=="add"?u=i+s.indentUnit:t=="subtract"&&(u=i-s.indentUnit),u=Math.max(0,u);var a=u-i;if(!a){if(St.from.line!=e&&St.to.line!=e)return;var f=o}else{var f="",l=0;if(s.indentWithTabs)for(var c=Math.floor(u/s.tabSize);c;--c)l+=s.tabSize,f+=" ";while(l<u)++l,f+=" "}En(f,{line:e,ch:0},{line:e,ch:o.length})}function ir(){yt=e.getMode(s,s.mode),bt.iter(0,bt.size,function(e){e.stateAfter=null}),wt=[0],Wr()}function sr(){var e=s.gutter||s.lineNumbers;K.style.display=e?"":"none",e?Bt=!0:pt.parentNode.style.marginLeft=0}function or(e,t){if(s.lineWrapping){y.className+=" CodeMirror-wrap";var n=z.clientWidth/_r()-3;bt.iter(0,bt.size,function(e){if(e.hidden)return;var t=Math.ceil(e.text.length/n)||1;t!=1&&Yt(e,t)}),rt.style.width=V.style.width=""}else y.className=y.className.replace(" CodeMirror-wrap",""),Wt=null,zt="",bt.iter(0,bt.size,function(e){e.height!=1&&!e.hidden&&Yt(e,1),e.text.length>zt.length&&(zt=e.text)});_t.push({from:0,to:bt.size})}function ur(e){var t=s.tabSize-e%s.tabSize,n=Xt[t];if(n)return n;for(var r='<span class="cm-tab">',i=0;i<t;++i)r+=" ";return Xt[t]={html:r+"</span>",width:t}}function ar(){z.className=z.className.replace(/\s*cm-s-\S+/g,"")+s.theme.replace(/(^|\s)\s*/g," cm-s-")}function fr(){this.set=[]}function lr(e,t,n){function i(e,t,n,i){Gt(e).addMark(new v(t,n,i,r))}e=Jn(e),t=Jn(t);var r=new fr;if(!et(e,t))return r;if(e.line==t.line)i(e.line,e.ch,t.ch,n);else{i(e.line,e.ch,null,n);for(var s=e.line+1,o=t.line;s<o;++s)i(s,null,null,n);i(t.line,null,t.ch,n)}return _t.push({from:e.line,to:t.line+1}),r}function cr(e){e=Jn(e);var t=new m(e.ch);return Gt(e.line).addMark(t),t}function hr(e){e=Jn(e);var t=[],n=Gt(e.line).marked;if(!n)return t;for(var r=0,i=n.length;r<i;++r){var s=n[r];(s.from==null||s.from<=e.ch)&&(s.to==null||s.to>=e.ch)&&t.push(s.marker||s)}return t}function pr(e,t,n){return typeof e=="number"&&(e=Gt($n(e))),e.gutterMarker={text:t,style:n},Bt=!0,e}function dr(e){typeof e=="number"&&(e=Gt($n(e))),e.gutterMarker=null,Bt=!0}function vr(e,t){var n=e,r=e;return typeof e=="number"?r=Gt($n(e)):n=S(e),n==null?null:t(r,n)?(_t.push({from:n,to:n+1}),r):null}function mr(e,t,n){return vr(e,function(e){if(e.className!=t||e.bgClassName!=n)return e.className=t,e.bgClassName=n,!0})}function gr(e,t){return vr(e,function(e,n){if(e.hidden!=t){e.hidden=t,Yt(e,t?0:1);var r=St.from.line,i=St.to.line;if(t&&(r==n||i==n)){var s=r==n?Xn({line:r,ch:0},r,0):St.from,o=i==n?Xn({line:i,ch:0},i,0):St.to;if(!o)return;Wn(s,o)}return Bt=!0}})}function yr(e){if(typeof e=="number"){if(!Kt(e))return null;var t=e;e=Gt(e);if(!e)return null}else{var t=S(e);if(t==null)return null}var n=e.gutterMarker;return{line:t,handle:e,text:e.text,markerText:n&&n.text,markerClass:n&&n.style,lineClass:e.className,bgClass:e.bgClassName}}function br(e){return lt.innerHTML="<pre><span>x</span></pre>",lt.firstChild.firstChild.firstChild.nodeValue=e,lt.firstChild.firstChild.offsetWidth||10}function wr(e,t){function i(e){return Sr(n,e).left}if(t<=0)return 0;var n=Gt(e),r=n.text,s=0,o=0,u=r.length,a,f=Math.min(u,Math.ceil(t/_r()));for(;;){var l=i(f);if(!(l<=t&&f<u)){a=l,u=f;break}f=Math.min(u,Math.ceil(f*1.2))}if(t>a)return u;f=Math.floor(u*.8),l=i(f),l<t&&(s=f,o=l);for(;;){if(u-s<=1)return a-t>t-o?s:u;var c=Math.ceil((s+u)/2),h=i(c);h>t?(u=c,a=h):(s=c,o=h)}}function Sr(e,t){if(t==0)return{top:0,left:0};var n=s.lineWrapping&&t<e.text.length&&$.test(e.text.slice(t-1,t+1));lt.innerHTML="<pre>"+e.getHTML(ur,t,Er,n)+"</pre>";var r=document.getElementById(Er),i=r.offsetTop,o=r.offsetLeft;if(F&&i==0&&o==0){var u=document.createElement("span");u.innerHTML="x",r.parentNode.insertBefore(u,r.nextSibling),i=u.offsetTop}return{top:i,left:o}}function xr(e,t){var n,r=Ar(),i=r*(T(bt,e.line)-(t?Ft:0));if(e.ch==0)n=0;else{var o=Sr(Gt(e.line),e.ch);n=o.left,s.lineWrapping&&(i+=Math.max(0,o.top))}return{x:n,y:i,yBot:i+r}}function Tr(e,t){function c(e){var t=Sr(u,e);if(f){var r=Math.round(t.top/n);return Math.max(0,t.left+(r-l)*z.clientWidth)}return t.left}t<0&&(t=0);var n=Ar(),r=_r(),i=Ft+Math.floor(t/n),o=x(bt,i);if(o>=bt.size)return{line:bt.size-1,ch:Gt(bt.size-1).text.length};var u=Gt(o),a=u.text,f=s.lineWrapping,l=f?i-T(bt,o):0;if(e<=0&&l==0)return{line:o,ch:0};var h=0,p=0,d=a.length,v,m=Math.min(d,Math.ceil((e+l*z.clientWidth*.9)/r));for(;;){var g=c(m);if(!(g<=e&&m<d)){v=g,d=m;break}m=Math.min(d,Math.ceil(m*1.2))}if(e>v)return{line:o,ch:d};m=Math.floor(d*.8),g=c(m),g<e&&(h=m,p=g);for(;;){if(d-h<=1)return{line:o,ch:v-e>e-p?h:d};var y=Math.ceil((h+d)/2),b=c(y);b>e?(d=y,v=b):(h=y,p=b)}}function Nr(e){var t=xr(e,!0),n=Q(rt);return{x:n.left+t.x,y:n.top+t.y,yBot:n.top+t.yBot}}function Ar(){if(Lr==null){Lr="<pre>";for(var e=0;e<49;++e)Lr+="x<br/>";Lr+="x</pre>"}var t=pt.clientHeight;return t==kr?Cr:(kr=t,lt.innerHTML=Lr,Cr=lt.firstChild.offsetHeight/50||1,lt.innerHTML="",Cr)}function _r(){return z.clientWidth==Mr?Or:(Mr=z.clientWidth,Or=br("x"))}function Dr(){return rt.offsetTop}function Pr(){return rt.offsetLeft}function Hr(e,t){var n=Q(z,!0),r,i;try{r=e.clientX,i=e.clientY}catch(e){return null}if(!t&&(r-n.left>z.clientWidth||i-n.top>z.clientHeight))return null;var s=Q(rt,!0);return Tr(r-s.left,i-s.top)}function Br(e){function s(){var e=ut(A.value).join("\n");e!=i&&Jr(Sn)(e,"end"),C.style.position="relative",A.style.cssText=r,I&&(z.scrollTop=n),Ht=!1,Mn(!0),kn()}var t=Hr(e),n=z.scrollTop;if(!t||window.opera)return;(Z(St.from,St.to)||et(t,St.from)||!et(t,St.to))&&Jr(Vn)(t.line,t.ch);var r=A.style.cssText;C.style.position="absolute",A.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: white; "+"border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",Ht=!0;var i=A.value=Nn();_n(),Y(A);if(j){O(e);var o=P(window,"mouseup",function(){o(),setTimeout(s,20)},!0)}else setTimeout(s,50)}function jr(){clearInterval(gt);var e=!0;ct.style.visibility="",gt=setInterval(function(){ct.style.visibility=(e=!e)?"":"hidden"},650)}function Ir(e){function v(e,t,n){if(!e.text)return;var r=e.styles,i=o?0:e.text.length-1,s;for(var a=o?0:r.length-2,f=o?r.length:-2;a!=f;a+=2*u){var l=r[a];if(r[a+1]!=null&&r[a+1]!=h){i+=u*l.length;continue}for(var c=o?0:l.length-1,v=o?l.length:-1;c!=v;c+=u,i+=u)if(i>=t&&i<n&&d.test(s=l.charAt(c))){var m=Fr[s];if(m.charAt(1)==">"==o)p.push(s);else{if(p.pop()!=m.charAt(0))return{pos:i,match:!1};if(!p.length)return{pos:i,match:!0}}}}}var t=St.inverted?St.from:St.to,n=Gt(t.line),r=t.ch-1,i=r>=0&&Fr[n.text.charAt(r)]||Fr[n.text.charAt(++r)];if(!i)return;var s=i.charAt(0),o=i.charAt(1)==">",u=o?1:-1,a=n.styles;for(var f=r+1,l=0,c=a.length;l<c;l+=2)if((f-=a[l].length)<=0){var h=a[l+1];break}var p=[n.text.charAt(r)],d=/[(){}[\]]/;for(var l=t.line,c=o?Math.min(l+100,bt.size):Math.max(-1,l-100);l!=c;l+=u){var n=Gt(l),m=l==t.line,g=v(n,m&&o?r+1:0,m&&!o?r:n.text.length);if(g)break}g||(g={pos:null,match:!1});var h=g.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",y=lr({line:t.line,ch:r},{line:t.line,ch:r+1},h),b=g.pos!=null&&lr({line:l,ch:g.pos},{line:l,ch:g.pos+1},h),w=Jr(function(){y.clear(),b&&b.clear()});e?setTimeout(w,800):Ut=w}function qr(e){var t,n;for(var r=e,i=e-40;r>i;--r){if(r==0)return 0;var o=Gt(r-1);if(o.stateAfter)return r;var u=o.indentation(s.tabSize);if(n==null||t>u)n=r-1,t=u}return n}function Rr(e){var t=qr(e),n=t&&Gt(t-1).stateAfter;return n?n=h(yt,n):n=p(yt),bt.iter(t,e,function(e){e.highlight(yt,n,s.tabSize),e.stateAfter=h(yt,n)}),t<e&&_t.push({from:t,to:e}),e<bt.size&&!Gt(e).stateAfter&&wt.push(e),n}function Ur(e,t){var n=Rr(e);bt.iter(e,t,function(e){e.highlight(yt,n,s.tabSize),e.stateAfter=h(yt,n)})}function zr(){var e=+(new Date)+s.workTime,t=wt.length;while(wt.length){if(!Gt(It).stateAfter)var n=It;else var n=wt.pop();if(n>=bt.size)continue;var r=qr(n),i=r&&Gt(r-1).stateAfter;i?i=h(yt,i):i=p(yt);var o=0,u=yt.compareStates,a=!1,f=r,l=!1;bt.iter(f,bt.size,function(t){var r=t.stateAfter;if(+(new Date)>e)return wt.push(f),Wr(s.workDelay),a&&_t.push({from:n,to:f+1}),l=!0;var c=t.highlight(yt,i,s.tabSize);c&&(a=!0),t.stateAfter=h(yt,i);var p=null;if(u){var d=r&&u(r,i);d!=B&&(p=!!d)}p==null&&(c!==!1||!r?o=0:++o>3&&(!yt.indent||yt.indent(r,"")==yt.indent(i,""))&&(p=!0));if(p)return!0;++f});if(l)return;a&&_t.push({from:n,to:f+1})}t&&s.onHighlightComplete&&s.onHighlightComplete(Qt)}function Wr(e){if(!wt.length)return;mt.set(e,Jr(zr))}function Xr(){Ot=Mt=Dt=null,_t=[],Pt=!1,jt=[]}function Vr(){var e=!1,t;Pt&&(e=!Pn()),_t.length?t=jn(_t,!0):(Pt&&Rn(),Bt&&qn()),e&&Pn(),Pt&&(Dn(),jr()),Et&&!Ht&&(Ot===!0||Ot!==!1&&Pt)&&Mn(Mt),Pt&&s.matchBrackets&&setTimeout(Jr(function(){Ut&&(Ut(),Ut=null),Z(St.from,St.to)&&Ir(!1)}),20);var n=Dt,r=jt;Pt&&s.onCursorActivity&&s.onCursorActivity(Qt),n&&s.onChange&&Qt&&s.onChange(Qt,n);for(var i=0;i<r.length;++i)r[i](Qt);t&&s.onUpdate&&s.onUpdate(Qt)}function Jr(e){return function(){$r++||Xr();try{var t=e.apply(this,arguments)}finally{--$r||Vr()}return t}}function Kr(e){Vt.startCompound();try{return e()}finally{Vt.endCompound()}}var s={},a=e.defaults;for(var d in a)a.hasOwnProperty(d)&&(s[d]=(i&&i.hasOwnProperty(d)?i:a)[d]);var y=document.createElement("div");y.className="CodeMirror"+(s.lineWrapping?" CodeMirror-wrap":""),y.innerHTML='<div style="overflow: hidden; position: relative; width: 3px; height: 0px;"><textarea style="position: absolute; padding: 0; width: 1px; height: 1em" wrap="off" autocorrect="off" autocapitalize="off"></textarea></div><div class="CodeMirror-scroll" tabindex="-1"><div style="position: relative"><div style="position: relative"><div class="CodeMirror-gutter"><div class="CodeMirror-gutter-text"></div></div><div class="CodeMirror-lines"><div style="position: relative; z-index: 0"><div style="position: absolute; width: 100%; height: 0; overflow: hidden; visibility: hidden;"></div><pre class="CodeMirror-cursor"> </pre><div style="position: relative; z-index: -1"></div><div></div></div></div></div></div></div>',r.appendChild?r.appendChild(y):r(y);var C=y.firstChild,A=C.firstChild,z=y.lastChild,V=z.firstChild,J=V.firstChild,K=J.firstChild,nt=K.firstChild,rt=K.nextSibling.firstChild,lt=rt.firstChild,ct=lt.nextSibling,ht=ct.nextSibling,pt=ht.nextSibling;ar(),t&&(A.style.width="0px"),R||(rt.draggable=!0),rt.style.outline="none",s.tabindex!=null&&(A.tabIndex=s.tabindex),s.autofocus&&_n(),!s.gutter&&!s.lineNumbers&&(K.style.display="none"),W&&(C.style.height="1px",C.style.position="absolute");try{br("x")}catch(dt){throw dt.message.match(/runtime/i)&&(dt=new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)")),dt}var vt=new H,mt=new H,gt,yt,bt=new w([new b([new g("")])]),wt,Et;ir();var St={from:{line:0,ch:0},to:{line:0,ch:0},inverted:!1},xt,Tt,Nt,Ct=0,kt,Lt=!1,At=!1,Ot,Mt,_t,Dt,Pt,Ht,Bt,jt,Ft=0,It=0,qt=0,Rt=0,Ut,zt="",Wt,Xt={};Jr(function(){Zt(s.value||""),Ot=!1})();var Vt=new N;P(z,"mousedown",Jr(tn)),P(z,"dblclick",Jr(nn)),P(rt,"selectstart",L),j||P(z,"contextmenu",Br),P(z,"scroll",function(){Ct=z.scrollTop,jn([]),s.fixedGutter&&(K.style.left=z.scrollLeft+"px"),s.onScroll&&s.onScroll(Qt)}),P(window,"resize",function(){jn(!0)}),P(A,"keyup",Jr(pn)),P(A,"input",Ln),P(A,"keydown",Jr(cn)),P(A,"keypress",Jr(hn)),P(A,"focus",dn),P(A,"blur",vn);if(s.dragDrop){P(rt,"dragstart",sn);function $t(e){if(s.onDragEvent&&s.onDragEvent(Qt,k(e)))return;O(e)}P(z,"dragenter",$t),P(z,"dragover",$t),P(z,"drop",Jr(rn))}P(z,"paste",function(){_n(),Ln()}),P(A,"paste",Ln),P(A,"cut",Jr(function(){s.readOnly||Sn("")})),W&&P(V,"mouseup",function(){document.activeElement==A&&A.blur(),_n()});var Jt;try{Jt=document.activeElement==A}catch(dt){}Jt||s.autofocus?setTimeout(dn,20):vn();var Qt=y.CodeMirror={getValue:en,setValue:Jr(Zt),getSelection:Nn,replaceSelection:Jr(Sn),focus:function(){window.focus(),_n(),dn(),Ln()},setOption:function(e,t){var n=s[e];s[e]=t,e=="mode"||e=="indentUnit"?ir():e=="readOnly"&&t=="nocursor"?(vn(),A.blur()):e=="readOnly"&&!t?Mn(!0):e=="theme"?ar():e=="lineWrapping"&&n!=t?Jr(or)():e=="tabSize"&&jn(!0);if(e=="lineNumbers"||e=="gutter"||e=="firstLineNumber"||e=="theme")sr(),jn(!0)},getOption:function(e){return s[e]},undo:Jr(yn),redo:Jr(bn),indentLine:Jr(function(e,t){typeof t!="string"&&(t==null?t=s.smartIndent?"smart":"prev":t=t?"add":"subtract"),Kt(e)&&rr(e,t)}),indentSelection:Jr(nr),historySize:function(){return{undo:Vt.done.length,redo:Vt.undone.length}},clearHistory:function(){Vt=new N},matchBrackets:Jr(function(){Ir(!0)}),getTokenAt:Jr(function(e){return e=Jn(e),Gt(e.line).getTokenAt(yt,Rr(e.line),e.ch)}),getStateAfter:function(e){return e=$n(e==null?bt.size-1:e),Rr(e+1)},cursorCoords:function(e,t){return e==null&&(e=St.inverted),this.charCoords(e?St.from:St.to,t)},charCoords:function(e,t){return e=Jn(e),t=="local"?xr(e,!1):t=="div"?xr(e,!0):Nr(e)},coordsChar:function(e){var t=Q(rt);return Tr(e.x-t.left,e.y-t.top)},markText:Jr(lr),setBookmark:cr,findMarksAt:hr,setMarker:Jr(pr),clearMarker:Jr(dr),setLineClass:Jr(mr),hideLine:Jr(function(e){return gr(e,!0)}),showLine:Jr(function(e){return gr(e,!1)}),onDeleteLine:function(e,t){if(typeof e=="number"){if(!Kt(e))return null;e=Gt(e)}return(e.handlers||(e.handlers=[])).push(t),e},lineInfo:yr,addWidget:function(e,t,n,r,i){e=xr(Jn(e));var s=e.yBot,o=e.x;t.style.position="absolute",V.appendChild(t);if(r=="over")s=e.y;else if(r=="near"){var u=Math.max(z.offsetHeight,bt.height*Ar()),a=Math.max(V.clientWidth,rt.clientWidth)-Pr();e.yBot+t.offsetHeight>u&&e.y>t.offsetHeight&&(s=e.y-t.offsetHeight),o+t.offsetWidth>a&&(o=a-t.offsetWidth)}t.style.top=s+Dr()+"px",t.style.left=t.style.right="",i=="right"?(o=V.clientWidth-t.offsetWidth,t.style.right="0px"):(i=="left"?o=0:i=="middle"&&(o=(V.clientWidth-t.offsetWidth)/2),t.style.left=o+Pr()+"px"),n&&Hn(o,s,o+t.offsetWidth,s+t.offsetHeight)},lineCount:function(){return bt.size},clipPos:Jn,getCursor:function(e){return e==null&&(e=St.inverted),tt(e?St.from:St.to)},somethingSelected:function(){return!Z(St.from,St.to)},setCursor:Jr(function(e,t,n){t==null&&typeof e.line=="number"?Vn(e.line,e.ch,n):Vn(e,t,n)}),setSelection:Jr(function(e,t,n){(n?zn:Wn)(Jn(e),Jn(t||e))}),getLine:function(e){if(Kt(e))return Gt(e).text},getLineHandle:function(e){if(Kt(e))return Gt(e)},setLine:Jr(function(e,t){Kt(e)&&En(t,{line:e,ch:0},{line:e,ch:Gt(e).text.length})}),removeLine:Jr(function(e){Kt(e)&&En("",{line:e,ch:0},Jn({line:e+1,ch:0}))}),replaceRange:Jr(En),getRange:function(e,t){return Tn(Jn(e),Jn(t))},triggerOnKeyDown:Jr(cn),execCommand:function(e){return u[e](Qt)},moveH:Jr(Qn),deleteH:Jr(Gn),moveV:Jr(Zn),toggleOverwrite:function(){Lt?(Lt=!1,ct.className=ct.className.replace(" CodeMirror-overwrite","")):(Lt=!0,ct.className+=" CodeMirror-overwrite")},posFromIndex:function(e){var t=0,n;return bt.iter(0,bt.size,function(r){var i=r.text.length+1;if(i>e)return n=e,!0;e-=i,++t}),Jn({line:t,ch:n})},indexFromPos:function(e){if(e.line<0||e.ch<0)return 0;var t=e.ch;return bt.iter(0,e.line,function(e){t+=e.text.length+1}),t},scrollTo:function(e,t){e!=null&&(z.scrollLeft=e),t!=null&&(z.scrollTop=t),jn([])},operation:function(e){return Jr(e)()},compoundChange:function(e){return Kr(e)},refresh:function(){jn(!0),z.scrollHeight>Ct&&(z.scrollTop=Ct)},getInputField:function(){return A},getWrapperElement:function(){return y},getScrollerElement:function(){return z},getGutterElement:function(){return K}},fn=null,ln,Cn=!1,An="",Yn=null;fr.prototype.clear=Jr(function(){var e=Infinity,t=-Infinity;for(var n=0,r=this.set.length;n<r;++n){var i=this.set[n],s=i.marked;if(!s||!i.parent)continue;var o=S(i);e=Math.min(e,o),t=Math.max(t,o);for(var u=0;u<s.length;++u)s[u].marker==this&&s.splice(u--,1)}e!=Infinity&&_t.push({from:e,to:t+1})}),fr.prototype.find=function(){var e,t;for(var n=0,r=this.set.length;n<r;++n){var i=this.set[n],s=i.marked;for(var o=0;o<s.length;++o){var u=s[o];if(u.marker==this)if(u.from!=null||u.to!=null){var a=S(i);a!=null&&(u.from!=null&&(e={line:a,ch:u.from}),u.to!=null&&(t={line:a,ch:u.to}))}}}return{from:e,to:t}};var Er="CodeMirror-temp-"+Math.floor(Math.random()*16777215).toString(16),Cr,kr,Lr,Or,Mr=0,Fr={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},$r=0;for(var Qr in o)o.propertyIsEnumerable(Qr)&&!Qt.propertyIsEnumerable(Qr)&&(Qt[Qr]=o[Qr]);return Qt}function f(e){return typeof e=="string"?a[e]:e}function l(e,t,n,r,i){function s(t){t=f(t);var n=t[e];if(n!=null&&r(n))return!0;if(t.nofallthrough)return i&&i(),!0;var o=t.fallthrough;if(o==null)return!1;if(Object.prototype.toString.call(o)!="[object Array]")return s(o);for(var u=0,a=o.length;u<a;++u)if(s(o[u]))return!0;return!1}return t&&s(t)?!0:s(n)}function c(e){var t=ft[D(e,"keyCode")];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function h(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function p(e,t,n){return e.startState?e.startState(t,n):!0}function d(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8}function v(e,t,n,r){this.from=e,this.to=t,this.style=n,this.marker=r}function m(e){this.from=e,this.to=e,this.line=null}function g(e,t){this.styles=t||[e,null],this.text=e,this.height=1,this.marked=this.gutterMarker=this.className=this.bgClassName=this.handlers=null,this.stateAfter=this.parent=this.hidden=null}function y(e,t,n,r){for(var i=0,s=0,o=0;s<t;i+=2){var u=n[i],a=s+u.length;o==0?(a>e&&r.push(u.slice(e-s,Math.min(u.length,t-s)),n[i+1]),a>=e&&(o=1)):o==1&&(a>t?r.push(u.slice(0,t-s),n[i+1]):r.push(u,n[i+1])),s=a}}function b(e){this.lines=e,this.parent=null;for(var t=0,n=e.length,r=0;t<n;++t)e[t].parent=this,r+=e[t].height;this.height=r}function w(e){this.children=e;var t=0,n=0;for(var r=0,i=e.length;r<i;++r){var s=e[r];t+=s.chunkSize(),n+=s.height,s.parent=this}this.size=t,this.height=n,this.parent=null}function E(e,t){while(!e.lines)for(var n=0;;++n){var r=e.children[n],i=r.chunkSize();if(t<i){e=r;break}t-=i}return e.lines[t]}function S(e){if(e.parent==null)return null;var t=e.parent,n=st(t.lines,e);for(var r=t.parent;r;t=r,r=r.parent)for(var i=0,s=r.children.length;;++i){if(r.children[i]==t)break;n+=r.children[i].chunkSize()}return n}function x(e,t){var n=0;e:do{for(var r=0,i=e.children.length;r<i;++r){var s=e.children[r],o=s.height;if(t<o){e=s;continue e}t-=o,n+=s.chunkSize()}return n}while(!e.lines);for(var r=0,i=e.lines.length;r<i;++r){var u=e.lines[r],a=u.height;if(t<a)break;t-=a}return n+r}function T(e,t){var n=0;e:do{for(var r=0,i=e.children.length;r<i;++r){var s=e.children[r],o=s.chunkSize();if(t<o){e=s;continue e}t-=o,n+=s.height}return n}while(!e.lines);for(var r=0;r<t;++r)n+=e.lines[r].height;return n}function N(){this.time=0,this.done=[],this.undone=[],this.compound=0,this.closed=!1}function C(){O(this)}function k(e){return e.stop||(e.stop=C),e}function L(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function A(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function O(e){L(e),A(e)}function M(e){return e.target||e.srcElement}function _(e){if(e.which)return e.which;if(e.button&1)return 1;if(e.button&2)return 3;if(e.button&4)return 2}function D(e,t){var n=e.override&&e.override.hasOwnProperty(t);return n?e.override[t]:e[t]}function P(e,t,n,r){if(typeof e.addEventListener=="function"){e.addEventListener(t,n,!1);if(r)return function(){e.removeEventListener(t,n,!1)}}else{var i=function(e){n(e||window.event)};e.attachEvent("on"+t,i);if(r)return function(){e.detachEvent("on"+t,i)}}}function H(){this.id=null}function J(e,t,n){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var r=0,i=0;r<t;++r)e.charAt(r)==" "?i+=n-i%n:++i;return i}function K(e){return e.currentStyle?e.currentStyle:window.getComputedStyle(e,null)}function Q(e,t){var n=e.ownerDocument.body,r=0,i=0,s=!1;for(var o=e;o;o=o.offsetParent){var u=o.offsetLeft,a=o.offsetTop;o==n?(r+=Math.abs(u),i+=Math.abs(a)):(r+=u,i+=a),t&&K(o).position=="fixed"&&(s=!0)}var f=t&&!s?null:n;for(var o=e.parentNode;o!=f;o=o.parentNode)o.scrollLeft!=null&&(r-=o.scrollLeft,i-=o.scrollTop);return{left:r,top:i}}function G(e){return e.textContent||e.innerText||e.nodeValue||""}function Y(e){t?(e.selectionStart=0,e.selectionEnd=e.value.length):e.select()}function Z(e,t){return e.line==t.line&&e.ch==t.ch}function et(e,t){return e.line<t.line||e.line==t.line&&e.ch<t.ch}function tt(e){return{line:e.line,ch:e.ch}}function rt(e){return nt.textContent=e,nt.innerHTML}function it(e,t){if(!t)return 0;if(!e)return t.length;for(var n=e.length,r=t.length;n>=0&&r>=0;--n,--r)if(e.charAt(n)!=t.charAt(r))break;return r+1}function st(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;++n)if(e[n]==t)return n;return-1}function ot(e){return/\w/.test(e)||e.toUpperCase()!=e.toLowerCase()}e.defaults={value:"",mode:null,theme:"default",indentUnit:2,indentWithTabs:!1,smartIndent:!0,tabSize:4,keyMap:"default",extraKeys:null,electricChars:!0,autoClearEmptyLines:!1,onKeyEvent:null,onDragEvent:null,lineWrapping:!1,lineNumbers:!1,gutter:!1,fixedGutter:!1,firstLineNumber:1,readOnly:!1,dragDrop:!0,onChange:null,onCursorActivity:null,onGutterClick:null,onHighlightComplete:null,onUpdate:null,onFocus:null,onBlur:null,onScroll:null,matchBrackets:!1,workTime:100,workDelay:200,pollInterval:100,undoDepth:40,tabindex:null,autofocus:null};var t=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),n=t||/Mac/.test(navigator.platform),r=/Win/.test(navigator.platform),i=e.modes={},s=e.mimeModes={};e.defineMode=function(t,n){!e.defaults.mode&&t!="null"&&(e.defaults.mode=t);if(arguments.length>2){n.dependencies=[];for(var r=2;r<arguments.length;++r)n.dependencies.push(arguments[r])}i[t]=n},e.defineMIME=function(e,t){s[e]=t},e.resolveMode=function(t){if(typeof t=="string"&&s.hasOwnProperty(t))t=s[t];else if(typeof t=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return typeof t=="string"?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=i[n.name];return r?r(t,n):e.getMode(t,"text/plain")},e.listModes=function(){var e=[];for(var t in i)i.propertyIsEnumerable(t)&&e.push(t);return e},e.listMIMEs=function(){var e=[];for(var t in s)s.propertyIsEnumerable(t)&&e.push({mime:t,mode:s[t]});return e};var o=e.extensions={};e.defineExtension=function(e,t){o[e]=t};var u=e.commands={selectAll:function(e){e.setSelection({line:0,ch:0},{line:e.lineCount()-1})},killLine:function(e){var t=e.getCursor(!0),n=e.getCursor(!1),r=!Z(t,n);!r&&e.getLine(t.line).length==t.ch?e.replaceRange("",t,{line:t.line+1,ch:0}):e.replaceRange("",t,r?n:{line:t.line})},deleteLine:function(e){var t=e.getCursor().line;e.replaceRange("",{line:t,ch:0},{line:t})},undo:function(e){e.undo()},redo:function(e){e.redo()},goDocStart:function(e){e.setCursor(0,0,!0)},goDocEnd:function(e){e.setSelection({line:e.lineCount()-1},null,!0)},goLineStart:function(e){e.setCursor(e.getCursor().line,0,!0)},goLineStartSmart:function(e){var t=e.getCursor(),n=e.getLine(t.line),r=Math.max(0,n.search(/\S/));e.setCursor(t.line,t.ch<=r&&t.ch?0:r,!0)},goLineEnd:function(e){e.setSelection({line:e.getCursor().line},null,!0)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goWordRight:function(e){e.moveH(1,"word")},delCharLeft:function(e){e.deleteH(-1,"char")},delCharRight:function(e){e.deleteH(1,"char")},delWordLeft:function(e){e.deleteH(-1,"word")},delWordRight:function(e){e.deleteH(1,"word")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection(" ","end")},transposeChars:function(e){var t=e.getCursor(),n=e.getLine(t.line);t.ch>0&&t.ch<n.length-1&&e.replaceRange(n.charAt(t.ch)+n.charAt(t.ch-1),{line:t.line,ch:t.ch-1},{line:t.line,ch:t.ch+1})},newlineAndIndent:function(e){e.replaceSelection("\n","end"),e.indentLine(e.getCursor().line)},toggleOverwrite:function(e){e.toggleOverwrite()}},a=e.keyMap={};a.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharRight",Backspace:"delCharLeft",Tab:"insertTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"},a.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goWordLeft","Ctrl-Right":"goWordRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delWordLeft","Ctrl-Delete":"delWordRight","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore",fallthrough:"basic"},a.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goWordLeft","Alt-Right":"goWordRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delWordLeft","Ctrl-Alt-Backspace":"delWordRight","Alt-Delete":"delWordRight","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore",fallthrough:["basic","emacsy"]},a["default"]=n?a.macDefault:a.pcDefault,a.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageUp","Shift-Ctrl-V":"goPageDown","Ctrl-D":"delCharRight","Ctrl-H":"delCharLeft","Alt-D":"delWordRight","Alt-Backspace":"delWordLeft","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},e.fromTextArea=function(t,n){function r(){t.value=u.getValue()}n||(n={}),n.value=t.value,!n.tabindex&&t.tabindex&&(n.tabindex=t.tabindex),n.autofocus==null&&t.getAttribute("autofocus")!=null&&(n.autofocus=!0);if(t.form){var i=P(t.form,"submit",r,!0);if(typeof t.form.submit=="function"){var s=t.form.submit;function o(){r(),t.form.submit=s,t.form.submit(),t.form.submit=o}t.form.submit=o}}t.style.display="none";var u=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},n);return u.save=r,u.getTextArea=function(){return t},u.toTextArea=function(){r(),t.parentNode.removeChild(u.getWrapperElement()),t.style.display="",t.form&&(i(),typeof t.form.submit=="function"&&(t.form.submit=s))},u},e.copyState=h,e.startState=p,d.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(e){var t=this.string.charAt(this.pos);if(typeof e=="string")var n=t==e;else var n=t&&(e.test?e.test(t):e(t));if(n)return++this.pos,t},eatWhile:function(e){var t=this.pos;while(this.eat(e));return this.pos>t},eatSpace:function(){var e=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return J(this.string,this.start,this.tabSize)},indentation:function(){return J(this.string,null,this.tabSize)},match:function(e,t,n){if(typeof e!="string"){var i=this.string.slice(this.pos).match(e);return i&&t!==!1&&(this.pos+=i[0].length),i}function r(e){return n?e.toLowerCase():e}if(r(this.string).indexOf(r(e),this.pos)==this.pos)return t!==!1&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)}},e.StringStream=d,v.prototype={attach:function(e){this.marker.set.push(e)},detach:function(e){var t=st(this.marker.set,e);t>-1&&this.marker.set.splice(t,1)},split:function(e,t){if(this.to<=e&&this.to!=null)return null;var n=this.from<e||this.from==null?null:this.from-e+t,r=this.to==null?null:this.to-e+t;return new v(n,r,this.style,this.marker)},dup:function(){return new v(null,null,this.style,this.marker)},clipTo:function(e,t,n,r,i){e&&r>this.from&&(r<this.to||this.to==null)?this.from=null:this.from!=null&&this.from>=t&&(this.from=Math.max(r,this.from)+i),n&&(t<this.to||this.to==null)&&(t>this.from||this.from==null)?this.to=null:this.to!=null&&this.to>t&&(this.to=r<this.to?this.to+i:t)},isDead:function(){return this.from!=null&&this.to!=null&&this.from>=this.to},sameSet:function(e){return this.marker==e.marker}},m.prototype={attach:function(e){this.line=e},detach:function(e){this.line==e&&(this.line=null)},split:function(e,t){if(e<this.from)return this.from=this.to=this.from-e+t,this},isDead:function(){return this.from>this.to},clipTo:function(e,t,n,r,i){(e||t<this.from)&&(n||r>this.to)?(this.from=0,this.to=-1):this.from>t&&(this.from=this.to=Math.max(r,this.from)+i)},sameSet:function(e){return!1},find:function(){return!this.line||!this.line.parent?null:{line:S(this.line),ch:this.from}},clear:function(){if(this.line){var e=st(this.line.marked,this);e!=-1&&this.line.marked.splice(e,1),this.line=null}}},g.inheritMarks=function(e,t){var n=new g(e),r=t&&t.marked;if(r)for(var i=0;i<r.length;++i)if(r[i].to==null&&r[i].style){var s=n.marked||(n.marked=[]),o=r[i],u=o.dup();s.push(u),u.attach(n)}return n},g.prototype={replace:function(e,t,n){var r=[],i=this.marked,s=t==null?this.text.length:t;y(0,e,this.styles,r),n&&r.push(n,null),y(s,this.text.length,this.styles,r),this.styles=r,this.text=this.text.slice(0,e)+n+this.text.slice(s),this.stateAfter=null;if(i){var o=n.length-(s-e);for(var u=0;u<i.length;++u){var a=i[u];a.clipTo(e==null,e||0,t==null,s,o),a.isDead()&&(a.detach(this),i.splice(u--,1))}}},split:function(e,t){var n=[t,null],r=this.marked;y(e,this.text.length,this.styles,n);var i=new g(t+this.text.slice(e),n);if(r)for(var s=0;s<r.length;++s){var o=r[s],u=o.split(e,t.length);u&&(i.marked||(i.marked=[]),i.marked.push(u),u.attach(i),u==o&&r.splice(s--,1))}return i},append:function(e){var t=this.text.length,n=e.marked,r=this.marked;this.text+=e.text,y(0,e.text.length,e.styles,this.styles);if(r)for(var i=0;i<r.length;++i)r[i].to==null&&(r[i].to=t);if(n&&n.length){r||(this.marked=r=[]);e:for(var i=0;i<n.length;++i){var s=n[i];if(!s.from)for(var o=0;o<r.length;++o){var u=r[o];if(u.to==t&&u.sameSet(s)){u.to=s.to==null?null:s.to+t,u.isDead()&&(u.detach(this),n.splice(i--,1));continue e}}r.push(s),s.attach(this),s.from+=t,s.to!=null&&(s.to+=t)}}},fixMarkEnds:function(e){var t=this.marked,n=e.marked;if(!t)return;for(var r=0;r<t.length;++r){var i=t[r],s=i.to==null;if(s&&n)for(var o=0;o<n.length;++o)if(n[o].sameSet(i)){s=!1;break}s&&(i.to=this.text.length)}},fixMarkStarts:function(){var e=this.marked;if(!e)return;for(var t=0;t<e.length;++t)e[t].from==null&&(e[t].from=0)},addMark:function(e){e.attach(this),this.marked==null&&(this.marked=[]),this.marked.push(e),this.marked.sort(function(e,t){return(e.from||0)-(t.from||0)})},highlight:function(e,t,n){var r=new d(this.text,n),i=this.styles,s=0,o=!1,u=i[0],a;this.text==""&&e.blankLine&&e.blankLine(t);while(!r.eol()){var f=e.token(r,t),l=this.text.slice(r.start,r.pos);r.start=r.pos,s&&i[s-1]==f?i[s-2]+=l:l&&(!o&&(i[s+1]!=f||s&&i[s-2]!=a)&&(o=!0),i[s++]=l,i[s++]=f,a=u,u=i[s]);if(r.pos>5e3){i[s++]=this.text.slice(r.pos),i[s++]=null;break}}return i.length!=s&&(i.length=s,o=!0),s&&i[s-2]!=a&&(o=!0),o||(i.length<5&&this.text.length<10?null:!1)},getTokenAt:function(e,t,n){var r=this.text,i=new d(r);while(i.pos<n&&!i.eol()){i.start=i.pos;var s=e.token(i,t)}return{start:i.start,end:i.pos,string:i.current(),className:s||null,state:t}},indentation:function(e){return J(this.text,null,e)},getHTML:function(e,t,n,r){function u(t,n){if(!t)return;s&&F&&t.charAt(0)==" "&&(t=" "+t.slice(1)),s=!1;if(t.indexOf(" ")==-1){o+=t.length;var r=rt(t)}else{var r="";for(var u=0;;){var a=t.indexOf(" ",u);if(a==-1){r+=rt(t.slice(u)),o+=t.length-u;break}o+=a-u;var f=e(o);r+=rt(t.slice(u,a))+f.html,o+=f.width,u=a+1}}n?i.push('<span class="',n,'">',r,"</span>"):i.push(r)}function v(e){return e?"cm-"+e.replace(/ +/g," cm-"):null}var i=[],s=!0,o=0,a=u;if(t!=null){var f=0,l='<span id="'+n+'">';a=function(e,n){var s=e.length;t>=f&&t<f+s?(t>f&&(u(e.slice(0,t-f),n),r&&i.push("<wbr>")),i.push(l),u(e.slice(t-f),n),i.push("</span>"),t--,f+=s):(f+=s,u(e,n),f==t&&f==d?i.push(l+"</span>"):f>t+10&&/\s/.test(e)&&(a=function(){}))}}var c=this.styles,h=this.text,p=this.marked,d=h.length;if(!h&&t==null)a(" ");else if(!p||!p.length)for(var m=0,g=0;g<d;m+=2){var y=c[m],b=c[m+1],w=y.length;g+w>d&&(y=y.slice(0,d-g)),g+=w,a(y,v(b))}else{var E=0,m=0,S="",b,x=0,T=p[0].from||0,N=[],C=0;function k(){var e;while(C<p.length&&((e=p[C]).from==E||e.from==null))e.style!=null&&N.push(e),++C;T=C<p.length?p[C].from:Infinity;for(var t=0;t<N.length;++t){var n=N[t].to||Infinity;n==E?N.splice(t--,1):T=Math.min(n,T)}}var L=0;while(E<d){T==E&&k();var A=Math.min(d,T);for(;;){if(S){var O=E+S.length,M=b;for(var _=0;_<N.length;++_)M=(M?M+" ":"")+N[_].style;a(O>A?S.slice(0,A-E):S,M);if(O>=A){S=S.slice(A-E),E=A;break}E=O}S=c[m++],b=v(c[m++])}}}return i.join("")},cleanUp:function(){this.parent=null;if(this.marked)for(var e=0,t=this.marked.length;e<t;++e)this.marked[e].detach(this)}},b.prototype={chunkSize:function(){return this.lines.length},remove:function(e,t,n){for(var r=e,i=e+t;r<i;++r){var s=this.lines[r];this.height-=s.height,s.cleanUp();if(s.handlers)for(var o=0;o<s.handlers.length;++o)n.push(s.handlers[o])}this.lines.splice(e,t)},collapse:function(e){e.splice.apply(e,[e.length,0].concat(this.lines))},insertHeight:function(e,t,n){this.height+=n,F?this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e)):this.lines.splice.apply(this.lines,[e,0].concat(t));for(var r=0,i=t.length;r<i;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},w.prototype={chunkSize:function(){return this.size},remove:function(e,t,n){this.size-=t;for(var r=0;r<this.children.length;++r){var i=this.children[r],s=i.chunkSize();if(e<s){var o=Math.min(t,s-e),u=i.height;i.remove(e,o,n),this.height-=u-i.height,s==o&&(this.children.splice(r--,1),i.parent=null);if((t-=o)==0)break;e=0}else e-=s}if(this.size-t<25){var a=[];this.collapse(a),this.children=[new b(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0,n=this.children.length;t<n;++t)this.children[t].collapse(e)},insert:function(e,t){var n=0;for(var r=0,i=t.length;r<i;++r)n+=t[r].height;this.insertHeight(e,t,n)},insertHeight:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0,i=this.children.length;r<i;++r){var s=this.children[r],o=s.chunkSize();if(e<=o){s.insertHeight(e,t,n);if(s.lines&&s.lines.length>50){while(s.lines.length>50){var u=s.lines.splice(s.lines.length-25,25),a=new b(u);s.height-=a.height,this.children.splice(r+1,0,a),a.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new w(t);if(!e.parent){var r=new w(e.children);r.parent=e,e.children=[r,n],e=r}else{e.size-=n.size,e.height-=n.height;var i=st(e.parent.children,e);e.parent.children.splice(i+1,0,n)}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iter:function(e,t,n){this.iterN(e,t-e,n)},iterN:function(e,t,n){for(var r=0,i=this.children.length;r<i;++r){var s=this.children[r],o=s.chunkSize();if(e<o){var u=Math.min(t,o-e);if(s.iterN(e,u,n))return!0;if((t-=u)==0)break;e=0}else e-=o}}},N.prototype={addChange:function(e,t,n){this.undone.length=0;var r=+(new Date),i=this.done[this.done.length-1],s=i&&i[i.length-1],o=r-this.time;if(this.compound&&i&&!this.closed)i.push({start:e,added:t,old:n});else if(o>400||!s||this.closed||s.start>e+n.length||s.start+s.added<e)this.done.push([{start:e,added:t,old:n}]),this.closed=!1;else{var u=Math.max(0,s.start-e),a=Math.max(0,e+n.length-(s.start+s.added));for(var f=u;f>0;--f)s.old.unshift(n[f-1]);for(var f=a;f>0;--f)s.old.push(n[n.length-f]);u&&(s.start=e),s.added+=t-(n.length-u-a)}this.time=r},startCompound:function(){this.compound++||(this.closed=!0)},endCompound:function(){--this.compound||(this.closed=!0)}},e.e_stop=O,e.e_preventDefault=L,e.e_stopPropagation=A,e.connect=P,H.prototype={set:function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)}};var B=e.Pass={toString:function(){return"CodeMirror.Pass"}},j=/gecko\/\d{7}/i.test(navigator.userAgent),F=/MSIE \d/.test(navigator.userAgent),I=/MSIE [1-8]\b/.test(navigator.userAgent),q=F&&document.documentMode==5,R=/WebKit\//.test(navigator.userAgent),U=/Chrome\//.test(navigator.userAgent),z=/Apple Computer/.test(navigator.vendor),W=/KHTML\//.test(navigator.userAgent),X=function(){if(I)return!1;var e=document.createElement("div");return"draggable"in e||"dragDrop"in e}(),V=function(){var e=document.createElement("textarea");return e.value="foo\nbar",e.value.indexOf("\r")>-1?"\r\n":"\n"}(),$=/^$/;j?$=/$'/:z?$=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/:U&&($=/\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/),document.documentElement.getBoundingClientRect!=null&&(Q=function(e,t){try{var n=e.getBoundingClientRect();n={top:n.top,left:n.left}}catch(r){n={top:0,left:0}}if(!t)if(window.pageYOffset==null){var i=document.documentElement||document.body.parentNode;i.scrollTop==null&&(i=document.body),n.top+=i.scrollTop,n.left+=i.scrollLeft}else n.top+=window.pageYOffset,n.left+=window.pageXOffset;return n});var nt=document.createElement("pre");rt("a")=="\na"?rt=function(e){return nt.textContent=e,nt.innerHTML.slice(1)}:rt(" ")!=" "&&(rt=function(e){return nt.innerHTML="",nt.appendChild(document.createTextNode(e)),nt.innerHTML}),e.htmlEscape=rt;var ut="\n\nb".split(/\n/).length!=3?function(e){var t=0,n,r=[];while((n=e.indexOf("\n",t))>-1)r.push(e.slice(t,e.charAt(n-1)=="\r"?n-1:n)),t=n+1;return r.push(e.slice(t)),r}:function(e){return e.split(/\r?\n/)};e.splitLines=ut;var at=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0};e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var ft={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};return e.keyNames=ft,function(){for(var e=0;e<10;e++)ft[e+48]=String(e);for(var e=65;e<=90;e++)ft[e]=String.fromCharCode(e);for(var e=1;e<=12;e++)ft[e+111]=ft[e+63235]="F"+e}(),e}();define("CodeMirror",function(e){return function(){return e.CodeMirror}}(this)),CodeMirror.defineMode("mysql",function(e){function r(e){return new RegExp("^(?:"+e.join("|")+")$","i")}function u(e,t){var r=e.next();n=null;if(r=="$"||r=="?")return e.match(/^[\w\d]*/),"variable-2";if(r=="<"&&!e.match(/^[\s\u00a0=]/,!1))return e.match(/^[^\s\u00a0>]*>?/),"atom";if(r=='"'||r=="'")return t.tokenize=a(r),t.tokenize(e,t);if(r=="`")return t.tokenize=f(r),t.tokenize(e,t);if(/[{}\(\),\.;\[\]]/.test(r))return n=r,null;if(r!="-"){if(o.test(r))return e.eatWhile(o),null;if(r==":")return e.eatWhile(/[\w\d\._\-]/),"atom";e.eatWhile(/[_\w\d]/);if(e.eat(":"))return e.eatWhile(/[\w\d_\-]/),"atom";var u=e.current(),l;return i.test(u)?null:s.test(u)?"keyword":"variable"}ch2=e.next();if(ch2=="-")return e.skipToEnd(),"comment"}function a(e){return function(t,n){var r=!1,i;while((i=t.next())!=null){if(i==e&&!r){n.tokenize=u;break}r=!r&&i=="\\"}return"string"}}function f(e){return function(t,n){var r=!1,i;while((i=t.next())!=null){if(i==e&&!r){n.tokenize=u;break}r=!r&&i=="\\"}return"variable-2"}}function l(e,t,n){e.context={prev:e.context,indent:e.indent,col:n,type:t}}function c(e){e.indent=e.context.indent,e.context=e.context.prev}var t=e.indentUnit,n,i=r(["str","lang","langmatches","datatype","bound","sameterm","isiri","isuri","isblank","isliteral","union","a"]),s=r(["ACCESSIBLE","ALTER","AS","BEFORE","BINARY","BY","CASE","CHARACTER","COLUMN","CONTINUE","CROSS","CURRENT_TIMESTAMP","DATABASE","DAY_MICROSECOND","DEC","DEFAULT","DESC","DISTINCT","DOUBLE","EACH","ENCLOSED","EXIT","FETCH","FLOAT8","FOREIGN","GRANT","HIGH_PRIORITY","HOUR_SECOND","IN","INNER","INSERT","INT2","INT8","INTO","JOIN","KILL","LEFT","LINEAR","LOCALTIME","LONG","LOOP","MATCH","MEDIUMTEXT","MINUTE_SECOND","NATURAL","NULL","OPTIMIZE","OR","OUTER","PRIMARY","RANGE","READ_WRITE","REGEXP","REPEAT","RESTRICT","RIGHT","SCHEMAS","SENSITIVE","SHOW","SPECIFIC","SQLSTATE","SQL_CALC_FOUND_ROWS","STARTING","TERMINATED","TINYINT","TRAILING","UNDO","UNLOCK","USAGE","UTC_DATE","VALUES","VARCHARACTER","WHERE","WRITE","ZEROFILL","ALL","AND","ASENSITIVE","BIGINT","BOTH","CASCADE","CHAR","COLLATE","CONSTRAINT","CREATE","CURRENT_TIME","CURSOR","DAY_HOUR","DAY_SECOND","DECLARE","DELETE","DETERMINISTIC","DIV","DUAL","ELSEIF","EXISTS","FALSE","FLOAT4","FORCE","FULLTEXT","HAVING","HOUR_MINUTE","IGNORE","INFILE","INSENSITIVE","INT1","INT4","INTERVAL","ITERATE","KEYS","LEAVE","LIMIT","LOAD","LOCK","LONGTEXT","MASTER_SSL_VERIFY_SERVER_CERT","MEDIUMINT","MINUTE_MICROSECOND","MODIFIES","NO_WRITE_TO_BINLOG","ON","OPTIONALLY","OUT","PRECISION","PURGE","READS","REFERENCES","RENAME","REQUIRE","REVOKE","SCHEMA","SELECT","SET","SPATIAL","SQLEXCEPTION","SQL_BIG_RESULT","SSL","TABLE","TINYBLOB","TO","TRUE","UNIQUE","UPDATE","USING","UTC_TIMESTAMP","VARCHAR","WHEN","WITH","YEAR_MONTH","ADD","ANALYZE","ASC","BETWEEN","BLOB","CALL","CHANGE","CHECK","CONDITION","CONVERT","CURRENT_DATE","CURRENT_USER","DATABASES","DAY_MINUTE","DECIMAL","DELAYED","DESCRIBE","DISTINCTROW","DROP","ELSE","ESCAPED","EXPLAIN","FLOAT","FOR","FROM","GROUP","HOUR_MICROSECOND","IF","INDEX","INOUT","INT","INT3","INTEGER","IS","KEY","LEADING","LIKE","LINES","LOCALTIMESTAMP","LONGBLOB","LOW_PRIORITY","MEDIUMBLOB","MIDDLEINT","MOD","NOT","NUMERIC","OPTION","ORDER","OUTFILE","PROCEDURE","READ","REAL","RELEASE","REPLACE","RETURN","RLIKE","SECOND_MICROSECOND","SEPARATOR","SMALLINT","SQL","SQLWARNING","SQL_SMALL_RESULT","STRAIGHT_JOIN","THEN","TINYTEXT","TRIGGER","UNION","UNSIGNED","USE","UTC_TIME","VARBINARY","VARYING","WHILE","XOR","FULL","COLUMNS","MIN","MAX","STDEV","COUNT"]),o=/[*+\-<>=&|]/;return{startState:function(e){return{tokenize:u,context:null,indent:0,col:0}},token:function(e,t){e.sol()&&(t.context&&t.context.align==null&&(t.context.align=!1),t.indent=e.indentation());if(e.eatSpace())return null;var r=t.tokenize(e,t);r!="comment"&&t.context&&t.context.align==null&&t.context.type!="pattern"&&(t.context.align=!0);if(n=="(")l(t,")",e.column());else if(n=="[")l(t,"]",e.column());else if(n=="{")l(t,"}",e.column());else if(/[\]\}\)]/.test(n)){while(t.context&&t.context.type=="pattern")c(t);t.context&&n==t.context.type&&c(t)}else n=="."&&t.context&&t.context.type=="pattern"?c(t):/atom|string|variable/.test(r)&&t.context&&(/[\}\]]/.test(t.context.type)?l(t,"pattern",e.column()):t.context.type=="pattern"&&!t.context.align&&(t.context.align=!0,t.context.col=e.column()));return r},indent:function(e,n){var r=n&&n.charAt(0),i=e.context;if(/[\]\}]/.test(r))while(i&&i.type=="pattern")i=i.prev;var s=i&&r==i.type;return i?i.type=="pattern"?i.col:i.align?i.col+(s?0:1):i.indent+(s?0:t):0}}}),CodeMirror.defineMIME("text/x-mysql","mysql"),define("MySQLCodeMirror",function(){}),define("FiddleEditor",["CodeMirror","MySQLCodeMirror"],function(e,t){var n=function(t,n,r){return this.codeMirrorSupported=!/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent),this.codeMirrorSupported?this.codeMirror=e.fromTextArea(document.getElementById(t),{mode:"mysql",extraKeys:{Tab:"indentMore"},lineNumbers:!0,onChange:function(){n.call(r)}}):(this.textArea=document.getElementById(t),$(this.textArea).on("change",function(){n.call(r)}),$(this.textArea).on("keyup",function(){n.call(r)}),$(this.textArea).attr("fullscreen",!1)),this};return n.prototype.getValue=function(){return this.codeMirrorSupported?this.codeMirror.getValue():this.textArea.value},n.prototype.setValue=function(e){this.codeMirrorSupported?this.codeMirror.setValue(e):(this.textArea.value=e,$(this.textArea).trigger("change"))},n.prototype.refresh=function(){this.codeMirrorSupported&&this.codeMirror.refresh()},n.prototype.somethingSelected=function(){return this.codeMirrorSupported?this.codeMirror.somethingSelected():!1},n.prototype.getSelection=function(){return this.codeMirrorSupported?this.codeMirror.getSelection():this.textArea.value},n.prototype.getScrollerElement=function(){return this.codeMirrorSupported?this.codeMirror.getScrollerElement():null},n.prototype.getGutterElement=function(){return this.codeMirrorSupported?this.codeMirror.getGutterElement():null},n.prototype.isFullscreen=function(){return this.codeMirrorSupported?$(this.codeMirror.getScrollerElement()).hasClass("CodeMirror-fullscreen"):$(this.textArea).attr("fullscreen")==1},n.prototype.setFullscreen=function(e){if(e){var t=$(window).height()-40;this.codeMirrorSupported?($(this.codeMirror.getScrollerElement()).addClass("CodeMirror-fullscreen").height(t),$(this.codeMirror.getGutterElement()).height(t)):($(this.textArea).addClass("fullscreen"),$(this.textArea).height(t),$(this.textArea).attr("fullscreen",e))}else this.codeMirrorSupported?($(this.codeMirror.getScrollerElement()).removeClass("CodeMirror-fullscreen"),$(this.codeMirror.getGutterElement()).css("height","auto"),$(this.codeMirror.getScrollerElement()).css("height","200px")):($(this.textArea).removeClass("fullscreen"),$(this.textArea).height(100),$(this.textArea).attr("fullscreen",e))},n}),define("libs/renderTerminator",[],function(){var e=function(e,t){var n=e.find(".terminator a.btn");n.html(n.html().replace(/\[ .+ \]/,"[ "+t+" ]")),e.find(".terminator").data("statement_separator",t)};return e}),define("text!fiddle_backbone/templates/schemaOutput.html",[],function(){return' {{#if errorMessage}}\n <div class="alert alert-error database-error database-messages"><i class="icon-remove"></i>{{errorMessage}}</div> \n {{else}}\n <div class="alert alert-success database-messages"><i class="icon-ok"></i>Schema Ready</div> \n {{/if}}'}),define("text!fiddle_backbone/templates/schemaBrowser.html",[],function(){return' <h3>Schema Browser</h3>\n <ul class="tables">\n {{#each objects}}\n <li>\n <a href="#{{this.table_name}}"><i class="icon-plus"></i> {{this.table_name}}</a> ({{this.table_type}})\n <ul class="columns">\n {{#each this.columns}}\n <li>{{name}} {{type}}</li>\n {{/each}}\n </ul>\n </li>\n {{/each}}\n </ul>'}),define("fiddle_backbone/views/SchemaDef",["jQuery","Backbone","Handlebars","FiddleEditor","libs/renderTerminator","text!fiddle_backbone/templates/schemaOutput.html","text!fiddle_backbone/templates/schemaBrowser.html"],function(e,t,n,r,i,s,o){var u=t.View.extend({initialize:function(){this.editor=new r(this.id,this.handleSchemaChange,this),this.compiledOutputTemplate=n.compile(s),this.compiledSchemaBrowserTemplate=n.compile(o)},handleSchemaChange:function(){if(this.model.get("ddl")!=this.editor.getValue()||this.model.get("statement_separator")!=e(".panel.schema .terminator").data("statement_separator"))this.model.set({ddl:this.editor.getValue(),statement_separator:e(".panel.schema .terminator").data("statement_separator"),ready:!1}),e(".schema .helpTip").css("display",this.model.get("ddl").length?"none":"block"),e(".sql .helpTip").css("display",!this.model.get("ready")||this.model.get("loading")?"none":"block")},render:function(){this.editor.setValue(this.model.get("ddl")),this.updateDependents(),i(e(".panel.schema"),this.model.get("statement_separator"))},renderOutput:function(){this.options.output_el.html(this.compiledOutputTemplate(this.model.toJSON()))},renderSchemaBrowser:function(){this.options.browser_el.html(this.compiledSchemaBrowserTemplate({objects:this.model.get("schema_structure")}))},refresh:function(){this.editor.refresh()},updateDependents:function(){this.model.get("ready")?(e(".needsReadySchema").unblock(),e("#schemaBrowser").attr("disabled",!1),e(".schema .helpTip").css("display","none")):(e(".needsReadySchema").block({message:"Please build schema."}),e("#schemaBrowser").attr("disabled",!0),e(".schema .helpTip").css("display",this.model.get("loading")||this.model.get("ddl").length?"none":"block"))}});return u});var isIE=navigator.appVersion.indexOf("MSIE")!=-1?!0:!1,isWin=navigator.appVersion.toLowerCase().indexOf("win")!=-1?!0:!1,isOpera=navigator.userAgent.indexOf("Opera")!=-1?!0:!1;define("XPlans/oracle/flashver",function(){});var viewerMap={sqlmonitor:["11"],sqlpa:["11"],xplan:["11"],sql_detail:["11","11.2.0.2.0"],EmergencyADDM:["11"],ComparePeriodReport:["11"],AshViewer:["11"]},requiredMajorVersion=10,requiredMinorVersion=0,requiredRevision=0,hasProductInstall=DetectFlashVer(6,0,65),hasRequestedVersion=DetectFlashVer(requiredMajorVersion,requiredMinorVersion,requiredRevision);Vars=function(e){this.numVars=0;if(e!=null){var t,n,r=e.split("&"),i=r.length;for(var s=0;s<i;s++){var o=r[s];if(o.indexOf("=")!=-1&&o.length>3){var t=o.split("="),n=t[0],u=t[1];this[n]==null&&n.length>0&&u.length>0&&(this[n]=u,this.numVars++)}}}},Vars.prototype.toString=function(e){var t="";e==null&&(e="");for(var n in this)this[n]!=null&&typeof this[n]!="object"&&typeof this[n]!="function"&&n!="numVars"&&(t+=e+n+"="+this[n]+"&");return t.length>0&&(t=t.substr(0,t.length-1)),t},define("XPlans/oracle/loadswf",["XPlans/oracle/flashver"],function(e){return function(){return e.loadswf}}(this));if(typeof QP=="undefined"||!QP)var QP={};(function(){function e(e){var r=t(e),i=r[0];i.getContext!==null&&i.getContext!==undefined&&window.setTimeout(function(){var t=i.getContext("2d"),s=$(".qp-tr",e);i.width=s.outerWidth(!0),i.height=s.outerHeight(!0);var o=r.offset();$(".qp-tr",e).each(function(){var e=$("> * > .qp-node",$(this));$("> * > .qp-tr > * > .qp-node",$(this)).each(function(){n(t,o,e,$(this))})}),t.stroke()},1)}function t(e){var t=$("canvas",e);return t.length==0&&(e.prepend($("<canvas></canvas>").css("position","absolute").css("top",0).css("left",0)),t=$("canvas",e)),t}function n(e,t,n,r){var i=n.offset();i.top+=n.outerHeight()/2,i.left+=n.outerWidth();var s=r.offset();s.top+=r.outerHeight()/2;var o=i.left/2+s.left/2;e.moveTo(i.left-t.left,i.top-t.top),e.lineTo(o-t.left,i.top-t.top),e.lineTo(o-t.left,s.top-t.top),e.lineTo(s.left-t.left,s.top-t.top)}QP.drawLines=function(t){t===null||t===undefined?t=$(".qp-root").parent():t=$(t),e(t)}})(),define("XPlans/mssql",function(e){return function(){return e.QP}}(this)),define("text!fiddle_backbone/templates/queryTabularOutput.html",[],function(){return' {{#if id}}\n {{#each_with_index sets}}\n <div class="set" id="set_{{index}}">\n {{#if this.RESULTS.DATA.length}}\n <table class="results table table-bordered table-striped">\n <tr>\n {{#each this.RESULTS.COLUMNS}}\n <th>{{this}}</th>\n {{/each}}\n </tr>\n {{#each this.RESULTS.DATA}}\n <tr>\n {{#each this}}\n <td>{{result_display this this}}</td>\n {{/each}}\n </tr>\n {{/each}}\n </table>\n {{/if}}\n {{#if this.SUCCEEDED}}\n <div id="messages_{{index}}" class="alert alert-success database-messages">\n <i class="icon-ok"></i>\n Record Count: {{this.RESULTS.DATA.length}}; Execution Time: {{this.EXECUTIONTIME}}ms\n {{#if this.EXECUTIONPLAN.DATA.length}}\n <a href="#executionPlan" class="executionPlanLink"><i class="icon-plus"></i>View Execution Plan</a> \n {{/if}}\n <a href="#!{{../../schemaDef/dbType/id}}/{{../../schemaDef/short_code}}/{{../../id}}/{{index}}" class="setLink"><i class="icon-share-alt"></i> link</a>\n </div> \n \n {{#if this.EXECUTIONPLAN.DATA.length}}\n <table class="executionPlan table table-bordered">\n <tr>\n {{#each this.EXECUTIONPLAN.COLUMNS}}\n <th>{{this}}</th>\n {{/each}}\n </tr>\n {{#each this.EXECUTIONPLAN.DATA}}\n <tr>\n {{#each this}}\n <td><div style="position:relative">{{{this}}}</div></td>\n {{/each}}\n </tr>\n {{/each}}\n\n {{#if ../../../schemaDef/dbType/isSQLServer}}\n <tr>\n <td><a href="index.cfm/Fiddles/getSQLPlan?db_type_id={{../../../../schemaDef/dbType/id}}&short_code={{../../../../schemaDef/short_code}}&query_id={{../../../../id}}&id={{index}}">Download .sqlplan</a> | <a href="http://www.sqlsentry.net/plan-explorer/sql-server-query-view.asp?ad=201208-sqlfiddle-pe" target="_new">Download SQL Sentry Plan Explorer (free)</a></td>\n </tr>\n {{/if}}\n\n </table>\n {{/if}}\n \n {{else}}\n <div id="messages_{{index}}" class="alert alert-error database-messages"><i class="icon-remove"></i>{{this.ERRORMESSAGE}}</div> \n {{/if}}\n </div>\n {{/each_with_index}}\n \n <span id="donationSuggestion">Did this query solve the problem? If so, consider donating $5 to help make sure SQL Fiddle will be here next time you need help with a database problem. Thanks!</span>\n {{/if}}'}),define("text!fiddle_backbone/templates/queryPlaintextOutput.html",[],function(){return' {{#if id}}\n {{#each_with_index sets}}\n <div class="set" id="set_{{index}}">\n {{#if this.RESULTS.DATA.length}}\n <pre class="results">\n|{{#each_simple_value_with_index this.RESULTS.COLUMNS}} {{result_display_padded ../this/RESULTS/COLUMNWIDTHS}} |{{/each_simple_value_with_index}}\n-{{#each_simple_value_with_index this.RESULTS.COLUMNS}}-{{divider_display ../this/RESULTS/COLUMNWIDTHS}}--{{/each_simple_value_with_index}}{{#each this.RESULTS.DATA}}\n|{{#each_simple_value_with_index this}} {{result_display_padded ../../this/RESULTS/COLUMNWIDTHS}} |{{/each_simple_value_with_index}}{{/each}}\n </pre>\n {{/if}}\n {{#if this.SUCCEEDED}}\n <div id="messages_{{index}}" class="alert alert-success database-messages">\n <i class="icon-ok"></i>\n Record Count: {{this.RESULTS.DATA.length}}; Execution Time: {{this.EXECUTIONTIME}}ms\n {{#if this.EXECUTIONPLAN.DATA.length}}\n <a href="#executionPlan" class="executionPlanLink"><i class="icon-plus"></i>View Execution Plan</a>\n {{/if}}\n <a href="#!{{../../schemaDef/dbType/id}}/{{../../schemaDef/short_code}}/{{../../id}}/{{index}}" class="setLink"><i class="icon-share-alt"></i> link</a>\n </div> \n \n {{#if this.EXECUTIONPLAN.DATA.length}}\n <table class="executionPlan table table-bordered">\n <tr>\n {{#each this.EXECUTIONPLAN.COLUMNS}}\n <th>{{this}}</th>\n {{/each}}\n </tr>\n {{#each this.EXECUTIONPLAN.DATA}}\n <tr>\n {{#each this}}\n <td><div style="position:relative">{{{this}}}</div></td>\n {{/each}}\n </tr>\n {{/each}}\n\n {{#if ../../../schemaDef/dbType/isSQLServer}}\n <tr>\n <td><a href="index.cfm/Fiddles/getSQLPlan?db_type_id={{../../../../schemaDef/dbType/id}}&short_code={{../../../../schemaDef/short_code}}&query_id={{../../../../id}}&id={{index}}">Download .sqlplan</a></td>\n </tr>\n {{/if}}\n \n </table>\n {{/if}}\n \n {{else}}\n <div id="messages_{{index}}" class="alert alert-error database-error database-messages"><i class="icon-remove"></i>{{this.ERRORMESSAGE}}</div> \n {{/if}}\n </div>\n {{/each_with_index}}\n\n <span id="donationSuggestion">Did this query solve the problem? If so, consider donating $5 to help make sure SQL Fiddle will be here next time you need help with a database problem. Thanks!</span>\n {{/if}}'}),define("HandlebarsHelpers/divider_display",["Handlebars"],function(e){e.registerHelper("divider_display",function(e){var t=[];return t.length=e[this.index]+1,t.join("-")})}),define("HandlebarsHelpers/each_simple_value_with_index",["Handlebars"],function(e){e.registerHelper("each_simple_value_with_index",function(e,t){var n="";k=0;for(var r=0,i=e.length;r<i;r++){var s={value:e[r]};s.index=k,s.first=k==0,s.last=k==e.length,n+=t(s),k++}return n})}),define("HandlebarsHelpers/each_with_index",["Handlebars"],function(e){e.registerHelper("each_with_index",function(e,t){var n="",r=0;for(var i=0,s=e.length;i<s;i++)if(e[i]){var o=e[i];o.index=r,o.first=r==0,o.last=r==e.length,n+=t(o),r++}return n})}),define("HandlebarsHelpers/result_display_padded",["Handlebars"],function(e){e.registerHelper("result_display_padded",function(e){var t=[];return t.length=e[this.index]-this.value.toString().length+1,t.join(" ")+this.value.toString()})}),define("HandlebarsHelpers/result_display",["jQuery","Handlebars"],function(e,t){t.registerHelper("result_display",function(n){var r=/\b((?:https?:\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?������]))/ig;return e.isPlainObject(n)?JSON.stringify(n):n==null?"(null)":n===!1?"false":typeof n=="string"&&n.match(r)&&t.Utils.escapeExpression(n)==n?new t.SafeString(n.replace(r,"<a href='$1' target='_new'>$1</a>")):n})}),define("fiddle_backbone/views/Query",["jQuery","Backbone","Handlebars","FiddleEditor","libs/renderTerminator","XPlans/oracle/loadswf","XPlans/mssql","text!fiddle_backbone/templates/queryTabularOutput.html","text!fiddle_backbone/templates/queryPlaintextOutput.html","HandlebarsHelpers/divider_display","HandlebarsHelpers/each_simple_value_with_index","HandlebarsHelpers/each_with_index","HandlebarsHelpers/result_display_padded","HandlebarsHelpers/result_display"],function(e,t,n,r,i,s,o,u,a){var f=t.View.extend({initialize:function(){this.editor=new r(this.id,this.handleQueryChange,this),this.outputType="tabular",this.compiledOutputTemplate={},this.compiledOutputTemplate.tabular=n.compile(u),this.compiledOutputTemplate.plaintext=n.compile(a)},setOutputType:function(e){this.outputType=e},handleQueryChange:function(){var t=this.model.get("schemaDef");this.model.set({sql:this.editor.getValue()}),e(".sql .helpTip").css("display",!t.get("ready")||t.get("loading")||this.model.get("sql").length?"none":"block")},render:function(){this.editor.setValue(this.model.get("sql")),this.model.id&&this.renderOutput(),i(e(".panel.sql"),this.model.get("statement_separator"))},renderOutput:function(){var t=this.model,n=this.model.toJSON();_.each(n.sets,function(e,t){if(e.RESULTS){var r=_.map(e.RESULTS.COLUMNS,function(e){return e.length});_.each(e.RESULTS.DATA,function(e){r=_.map(e,function(e,t){return _.max([e.toString().length,r[t]])})}),n.sets[t].RESULTS.COLUMNWIDTHS=r}}),n.schemaDef=this.model.get("schemaDef").toJSON(),n.schemaDef.dbType=this.model.get("schemaDef").get("dbType").toJSON(),n.schemaDef.dbType.isSQLServer=this.model.get("schemaDef").get("dbType").get("simple_name")=="SQL Server",this.options.output_el.html(this.compiledOutputTemplate[this.outputType](n)),e("script.oracle_xplan_xml").each(function(){e(this).siblings("div.oracle_xplan").html(s(e(this).text()))}),this.options.output_el.find("a.executionPlanLink").click(function(n){n.preventDefault(),e("i",this).toggleClass("icon-minus icon-plus"),e(this).closest(".set").find(".executionPlan").toggle(),e("i",this).hasClass("icon-minus")&&t.get("schemaDef").get("dbType").get("simple_name")=="SQL Server"&&o.drawLines(e(this).closest(".set").find(".executionPlan div"))})},refresh:function(){this.editor.refresh()},checkForSelectedText:function(){this.editor.somethingSelected()?this.model.set("sql",this.editor.getSelection()):this.model.set("sql",this.editor.getValue())}});return f}),define("fiddle_backbone/router",["jQuery","Underscore","Backbone","libs/renderTerminator","fiddle_backbone/models/UsedFiddle"],function(e,t,n,r,i){var s=function(s,o,u,a,f){var l=n.Router.extend({routes:{"!:db_type_id":"DBType","!:db_type_id/:short_code":"SchemaDef","!:db_type_id/:short_code/:query_id":"Query","!:db_type_id/:short_code/:query_id/:set_id":"SetAnchor"},DBType:function(e){s.setSelectedType(e,!0),f.render()},SchemaDef:function(e,t){this.loadContent(e,"!"+e+"/"+t)},Query:function(e,t,n){this.loadContent(e,"!"+e+"/"+t+"/"+n)},SetAnchor:function(n,r,i,a){var f=function(){e("#set_"+a).length&&(window.scrollTo(0,e("#set_"+a).offset().top-50),e("#set_"+a).addClass("highlight"))};!s.getSelectedType()||s.getSelectedType().get("id")!=n||o.get("short_code")!=r||u.get("id")!=i?(u.bind("reloaded",t.once(f)),this.loadContent(n,"!"+n+"/"+r+"/"+i)):(e(".set").removeClass("highlight"),f())},loadContent:function(n,f){this.DBType(n);if(u.get("pendingChanges")&&!confirm("Warning! You have made changes to your query which will be lost. Continue?'"))return!1;o.set("loading",!0),e(".helpTip").css("display","none"),e("body").block({message:"Loading..."}),e.getJSON("index.cfm/fiddles/loadContent",{fragment:f},function(f){o.set("loading",!1);if(f.short_code){var l=s.getSelectedType();l.get("context")=="browser"?(l.get("className")=="sqljs"&&o.get("browserEngines").websql.nativeSQLite&&confirm("Fiddle originally built with SQL.js, but you have WebSQL available - would you like to use that instead (it'll be faster to load)?")&&(s.setSelectedType(e("#db_type_id a:contains('WebSQL')").closest("li").attr("db_type_id")),l=s.getSelectedType(),o.set({ddl:f.ddl,dbType:l,statement_separator:f.schema_statement_separator}),f.sql&&(u.set({schemaDef:o,sql:f.sql,statement_separator:f.query_statement_separator}),o.on("built",t.once(function(){u.execute()}))),o.build(s)),o.get("browserEngines")[l.get("className")].buildSchema({short_code:e.trim(f.short_code),statement_separator:f.schema_statement_separator,ddl:f.ddl,success:function(){o.set({short_code:f.short_code,ddl:f.ddl,ready:!0,valid:!0,errorMessage:"",statement_separator:f.schema_statement_separator,dbType:s.getSelectedType()}),r(e(".panel.schema"),f.schema_statement_separator),f.sql?(a.insert(new i({fragment:"!"+n+"/"+f.short_code+"/"+f.id})),u.set({id:f.id,sql:f.sql,statement_separator:f.query_statement_separator})):a.insert(new i({fragment:"!"+n+"/"+f.short_code})),o.get("browserEngines")[l.get("className")].getSchemaStructure({callback:function(t){o.set({schema_structure:t}),o.trigger("reloaded"),f.sql?o.get("browserEngines")[l.get("className")].executeQuery({sql:f.sql,statement_separator:f.query_statement_separator,success:function(t){u.set({sets:t}),u.trigger("reloaded"),e("body").unblock()},error:function(t){u.set({sets:[]}),u.trigger("reloaded"),e("body").unblock()}}):e("body").unblock()}})},error:function(t){o.set({short_code:f.short_code,ddl:f.ddl,ready:!0,valid:!1,errorMessage:t,dbType:s.getSelectedType(),statement_separator:f.schema_statement_separator,schema_structure:[]}),r(e(".panel.schema"),f.schema_statement_separator),f.sql&&(u.set({id:f.id,sql:f.sql,statement_separator:f.query_statement_separator,schemaDef:o}),u.trigger("reloaded")),o.trigger("failed"),o.trigger("reloaded"),e("body").unblock()}})):(o.set({short_code:f.short_code,ddl:f.ddl,ready:!0,valid:!0,errorMessage:"",statement_separator:f.schema_statement_separator,schema_structure:f.schema_structure}),r(e(".panel.schema"),f.schema_statement_separator),o.trigger("reloaded"),f.sql?(a.insert(new i({fragment:"!"+n+"/"+f.short_code+"/"+f.id})),u.set({id:f.id,sql:f.sql,sets:f.sets,statement_separator:f.query_statement_separator}),u.trigger("reloaded")):a.insert(new i({fragment:"!"+n+"/"+f.short_code})),e("body").unblock())}else e("body").unblock()})}}),c=new l;return n.history.start({pushState:!1}),c};return{initialize:s}}),function(e){function u(n,u){var f=n==window,c=u&&u.message!==undefined?u.message:undefined;u=e.extend({},e.blockUI.defaults,u||{}),u.overlayCSS=e.extend({},e.blockUI.defaults.overlayCSS,u.overlayCSS||{});var v=e.extend({},e.blockUI.defaults.css,u.css||{}),m=e.extend({},e.blockUI.defaults.themedCSS,u.themedCSS||{});c=c===undefined?u.message:c,f&&s&&a(window,{fadeOut:0});if(c&&typeof c!="string"&&(c.parentNode||c.jquery)){var g=c.jquery?c[0]:c,y={};e(n).data("blockUI.history",y),y.el=g,y.parent=g.parentNode,y.display=g.style.display,y.position=g.style.position,y.parent&&y.parent.removeChild(g)}e(n).data("blockUI.onUnblock",u.onUnblock);var b=u.baseZ,w=e.browser.msie||u.forceIframe?e('<iframe class="blockUI" style="z-index:'+b++ +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+u.iframeSrc+'"></iframe>'):e('<div class="blockUI" style="display:none"></div>'),E=u.theme?e('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+b++ +';display:none"></div>'):e('<div class="blockUI blockOverlay" style="z-index:'+b++ +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>'),S,x;u.theme&&f?x='<div class="blockUI '+u.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(b+10)+';display:none;position:fixed">'+'<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(u.title||" ")+"</div>"+'<div class="ui-widget-content ui-dialog-content"></div>'+"</div>":u.theme?x='<div class="blockUI '+u.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(b+10)+';display:none;position:absolute">'+'<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(u.title||" ")+"</div>"+'<div class="ui-widget-content ui-dialog-content"></div>'+"</div>":f?x='<div class="blockUI '+u.blockMsgClass+' blockPage" style="z-index:'+(b+10)+';display:none;position:fixed"></div>':x='<div class="blockUI '+u.blockMsgClass+' blockElement" style="z-index:'+(b+10)+';display:none;position:absolute"></div>',S=e(x),c&&(u.theme?(S.css(m),S.addClass("ui-widget-content")):S.css(v)),!u.theme&&(!u.applyPlatformOpacityRules||!e.browser.mozilla||!/Linux/.test(navigator.platform))&&E.css(u.overlayCSS),E.css("position",f?"fixed":"absolute"),(e.browser.msie||u.forceIframe)&&w.css("opacity",0);var T=[w,E,S],N=f?e("body"):e(n);e.each(T,function(){this.appendTo(N)}),u.theme&&u.draggable&&e.fn.draggable&&S.draggable({handle:".ui-dialog-titlebar",cancel:"li"});var C=r&&(!e.boxModel||e("object,embed",f?null:n).length>0);if(i||C){f&&u.allowBodyStretch&&e.boxModel&&e("html,body").css("height","100%");if((i||!e.boxModel)&&!f)var k=d(n,"borderTopWidth"),L=d(n,"borderLeftWidth"),A=k?"(0 - "+k+")":0,O=L?"(0 - "+L+")":0;e.each([w,E,S],function(e,t){var n=t[0].style;n.position="absolute";if(e<2)f?n.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:"+u.quirksmodeOffsetHack+') + "px"'):n.setExpression("height",'this.parentNode.offsetHeight + "px"'),f?n.setExpression("width",'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):n.setExpression("width",'this.parentNode.offsetWidth + "px"'),O&&n.setExpression("left",O),A&&n.setExpression("top",A);else if(u.centerY)f&&n.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'),n.marginTop=0;else if(!u.centerY&&f){var r=u.css&&u.css.top?parseInt(u.css.top):0,i="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+r+') + "px"';n.setExpression("top",i)}})}c&&(u.theme?S.find(".ui-widget-content").append(c):S.append(c),(c.jquery||c.nodeType)&&e(c).show()),(e.browser.msie||u.forceIframe)&&u.showOverlay&&w.show();if(u.fadeIn){var M=u.onBlock?u.onBlock:t,_=u.showOverlay&&!c?M:t,D=c?M:t;u.showOverlay&&E._fadeIn(u.fadeIn,_),c&&S._fadeIn(u.fadeIn,D)}else u.showOverlay&&E.show(),c&&S.show(),u.onBlock&&u.onBlock();l(1,n,u),f?(s=S[0],o=e(":input:enabled:visible",s),u.focusInput&&setTimeout(h,20)):p(S[0],u.centerX,u.centerY);if(u.timeout){var P=setTimeout(function(){f?e.unblockUI(u):e(n).unblock(u)},u.timeout);e(n).data("blockUI.timeout",P)}}function a(t,n){var r=t==window,i=e(t),u=i.data("blockUI.history"),a=i.data("blockUI.timeout");a&&(clearTimeout(a),i.removeData("blockUI.timeout")),n=e.extend({},e.blockUI.defaults,n||{}),l(0,t,n),n.onUnblock===null&&(n.onUnblock=i.data("blockUI.onUnblock"),i.removeData("blockUI.onUnblock"));var c;r?c=e("body").children().filter(".blockUI").add("body > .blockUI"):c=e(".blockUI",t),r&&(s=o=null),n.fadeOut?(c.fadeOut(n.fadeOut),setTimeout(function(){f(c,u,n,t)},n.fadeOut)):f(c,u,n,t)}function f(t,n,r,i){t.each(function(e,t){this.parentNode&&this.parentNode.removeChild(this)}),n&&n.el&&(n.el.style.display=n.display,n.el.style.position=n.position,n.parent&&n.parent.appendChild(n.el),e(i).removeData("blockUI.history")),typeof r.onUnblock=="function"&&r.onUnblock(i,r)}function l(t,n,r){var i=n==window,o=e(n);if(!t&&(i&&!s||!i&&!o.data("blockUI.isBlocked")))return;i||o.data("blockUI.isBlocked",t);if(!r.bindEvents||t&&!r.showOverlay)return;var u="mousedown mouseup keydown keypress";t?e(document).bind(u,r,c):e(document).unbind(u,c)}function c(t){if(t.keyCode&&t.keyCode==9&&s&&t.data.constrainTabKey){var n=o,r=!t.shiftKey&&t.target===n[n.length-1],i=t.shiftKey&&t.target===n[0];if(r||i)return setTimeout(function(){h(i)},10),!1}var u=t.data;return e(t.target).parents("div."+u.blockMsgClass).length>0?!0:e(t.target).parents().children().filter("div.blockUI").length==0}function h(e){if(!o)return;var t=o[e===!0?o.length-1:0];t&&t.focus()}function p(e,t,n){var r=e.parentNode,i=e.style,s=(r.offsetWidth-e.offsetWidth)/2-d(r,"borderLeftWidth"),o=(r.offsetHeight-e.offsetHeight)/2-d(r,"borderTopWidth");t&&(i.left=s>0?s+"px":"0"),n&&(i.top=o>0?o+"px":"0")}function d(t,n){return parseInt(e.css(t,n))||0}if(/1\.(0|1|2)\.(0|1|2)/.test(e.fn.jquery)||/^1.1/.test(e.fn.jquery)){alert("blockUI requires jQuery v1.2.3 or later! You are using v"+e.fn.jquery);return}e.fn._fadeIn=e.fn.fadeIn;var t=function(){},n=document.documentMode||0,r=e.browser.msie&&(e.browser.version<8&&!n||n<8),i=e.browser.msie&&/MSIE 6.0/.test(navigator.userAgent)&&!n;e.blockUI=function(e){u(window,e)},e.unblockUI=function(e){a(window,e)},e.growlUI=function(t,n,r,i){var s=e('<div class="growlUI"></div>');t&&s.append("<h1>"+t+"</h1>"),n&&s.append("<h2>"+n+"</h2>"),r==undefined&&(r=3e3),e.blockUI({message:s,fadeIn:700,fadeOut:1e3,centerY:!1,timeout:r,showOverlay:!1,onUnblock:i,css:e.blockUI.defaults.growlCSS})},e.fn.block=function(t){return this.unblock({fadeOut:0}).each(function(){e.css(this,"position")=="static"&&(this.style.position="relative"),e.browser.msie&&(this.style.zoom=1),u(this,t)})},e.fn.unblock=function(e){return this.each(function(){a(this,e)})},e.blockUI.version=2.39,e.blockUI.defaults={message:"<h1>Please wait...</h1>",title:null,draggable:!0,theme:!1,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:.6,cursor:"wait"},growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:!1,baseZ:1e3,centerX:!0,centerY:!0,allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,applyPlatformOpacityRules:!0,onBlock:null,onUnblock:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg"};var s=null,o=[]}(jQuery),define("libs/jquery/jquery.blockUI",function(){}),function(e){e.cookie=function(t,n,r){if(arguments.length>1&&(!/Object/.test(Object.prototype.toString.call(n))||n===null||n===undefined)){r=e.extend({},r);if(n===null||n===undefined)r.expires=-1;if(typeof r.expires=="number"){var i=r.expires,s=r.expires=new Date;s.setDate(s.getDate()+i)}return n=String(n),document.cookie=[encodeURIComponent(t),"=",r.raw?n:encodeURIComponent(n),r.expires?"; expires="+r.expires.toUTCString():"",r.path?"; path="+r.path:"",r.domain?"; domain="+r.domain:"",r.secure?"; secure":""].join("")}r=n||{};var o=r.raw?function(e){return e}:decodeURIComponent,u=document.cookie.split("; ");for(var a=0,f;f=u[a]&&u[a].split("=");a++)if(o(f[0])===t)return o(f[1]||"");return null}}(jQuery),define("libs/jquery/jquery.cookie",function(){}),!function(e){var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning)return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning)return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=typeof n=="object"&&n;i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e(function(){e("body").on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();e(i).collapse(s)})})}(window.jQuery),define("Bootstrap/bootstrap-collapse",function(){}),!function(e){var t=function(t){this.element=e(t)};t.prototype={constructor:t,show:function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.attr("data-target"),i,s,o;r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("active"))return;i=n.find(".active a").last()[0],o=e.Event("show",{relatedTarget:i}),t.trigger(o);if(o.isDefaultPrevented())return;s=e(r),this.activate(t.parent("li"),n),this.activate(s,s.parent(),function(){t.trigger({type:"shown",relatedTarget:i})})},activate:function(t,n,r){function o(){i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var i=n.find("> .active"),s=r&&e.support.transition&&i.hasClass("fade");s?i.one(e.support.transition.end,o):o(),i.removeClass("in")}},e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("tab");i||r.data("tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e(function(){e("body").on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})})}(window.jQuery),define("Bootstrap/bootstrap-tab",function(){}),!function(e){function r(){e(t).parent().removeClass("open")}var t='[data-toggle="dropdown"]',n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),i,s,o;if(n.is(".disabled, :disabled"))return;return s=n.attr("data-target"),s||(s=n.attr("href"),s=s&&s.replace(/.*(?=#[^\s]*$)/,"")),i=e(s),i.length||(i=n.parent()),o=i.hasClass("open"),r(),o||i.toggleClass("open"),!1}},e.fn.dropdown=function(t){return this.each(function(){var r=e(this),i=r.data("dropdown");i||r.data("dropdown",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.dropdown.Constructor=n,e(function(){e("html").on("click.dropdown.data-api",r),e("body").on("click.dropdown",".dropdown form",function(e){e.stopPropagation()}).on("click.dropdown.data-api",t,n.prototype.toggle)})}(window.jQuery),define("Bootstrap/bootstrap-dropdown",function(){}),!function(e){function n(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),r.call(t)},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),r.call(t)})}function r(e){this.$element.hide().trigger("hidden"),i.call(this)}function i(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="modal-backdrop '+r+'" />').appendTo(document.body),this.options.backdrop!="static"&&this.$backdrop.click(e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,e.proxy(s,this)):s.call(this)):t&&t()}function s(){this.$backdrop.remove(),this.$backdrop=null}function o(){var t=this;this.isShown&&this.options.keyboard?e(document).on("keyup.dismiss.modal",function(e){e.which==27&&t.hide()}):this.isShown||e(document).off("keyup.dismiss.modal")}var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this))};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;e("body").addClass("modal-open"),this.isShown=!0,o.call(this),i.call(this,function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in"),n?t.$element.one(e.support.transition.end,function(){t.$element.trigger("shown")}):t.$element.trigger("shown")})},hide:function(t){t&&t.preventDefault();var i=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,e("body").removeClass("modal-open"),o.call(this),this.$element.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?n.call(this):r.call(this)}},e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e(function(){e("body").on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({},i.data(),n.data());t.preventDefault(),i.modal(s)})})}(window.jQuery),define("Bootstrap/bootstrap-modal",function(){}),!function(e){var t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var i,s;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,this.options.trigger!="manual"&&(i=this.options.trigger=="hover"?"mouseenter":"focus",s=this.options.trigger=="hover"?"mouseleave":"blur",this.$element.on(i,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s,this.options.selector,e.proxy(this.leave,this))),this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=e.extend({},e.fn[this.type].defaults,t,this.$element.data()),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);if(!n.options.delay||!n.options.delay.show)return n.show();clearTimeout(this.timeout),n.hoverState="in",this.timeout=setTimeout(function(){n.hoverState=="in"&&n.show()},n.options.delay.show)},leave:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var e,t,n,r,i,s,o;if(this.hasContent()&&this.enabled){e=this.tip(),this.setContent(),this.options.animation&&e.addClass("fade"),s=typeof this.options.placement=="function"?this.options.placement.call(this,e[0],this.$element[0]):this.options.placement,t=/in/.test(s),e.remove().css({top:0,left:0,display:"block"}).appendTo(t?this.$element:document.body),n=this.getPosition(t),r=e[0].offsetWidth,i=e[0].offsetHeight;switch(t?s.split(" ")[1]:s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}e.css(o).addClass(s).addClass("in")}},isHTML:function(e){return typeof e!="string"||e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3||/^(?:[^<]*<[\w\W]+>[^>]*$)/.exec(e)},setContent:function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.isHTML(t)?"html":"text"](t),e.removeClass("fade in top bottom left right")},hide:function(){function r(){var t=setTimeout(function(){n.off(e.support.transition.end).remove()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.remove()})}var t=this,n=this.tip();n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?r():n.remove()},fixTitle:function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(t){return e.extend({},t?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return this.$tip=this.$tip||e(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()}},e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover",title:"",delay:0}}(window.jQuery),define("Bootstrap/bootstrap-tooltip",function(){}),!function(e){var t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.isHTML(t)?"html":"text"](t),e.find(".popover-content > *")[this.isHTML(n)?"html":"text"](n),e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-content")||(typeof n.content=="function"?n.content.call(t[0]):n.content),e},tip:function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip}}),e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("popover"),s=typeof n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults,{placement:"right",content:"",template:'<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'})}(window.jQuery),define("Bootstrap/bootstrap-popover",function(){}),define("fiddle_backbone/app",["BrowserEngines/engines","fiddle_backbone/models/UsedFiddle","fiddle_backbone/models/MyFiddleHistory","fiddle_backbone/models/DBTypesList","fiddle_backbone/models/SchemaDef","fiddle_backbone/models/Query","fiddle_backbone/views/DBTypesList","fiddle_backbone/views/SchemaDef","fiddle_backbone/views/Query","fiddle_backbone/router","libs/renderTerminator","libs/jquery/jquery.blockUI","libs/jquery/jquery.cookie","Bootstrap/bootstrap-collapse","Bootstrap/bootstrap-tab","Bootstrap/bootstrap-dropdown","Bootstrap/bootstrap-modal","Bootstrap/bootstrap-tooltip","Bootstrap/bootstrap-popover"],function(e,t,n,r,i,s,o,u,a,f,l){var c=function(c){var h={},p=new n,d=new r,v=new i({browserEngines:e}),m=new s({schemaDef:v}),g=new o({el:$("#db_type_id")[0],collection:d}),y=new u({id:"schema_ddl",model:v,output_el:$("#output"),browser_el:$("#browser")}),b=new a({id:"sql",model:m,output_el:$("#output")});d.on("change",function(){g.render(),v.has("dbType")&&v.set("ready",v.get("dbType").id==this.getSelectedType().id)}),v.on("change",function(){this.hasChanged("ready")&&y.updateDependents(),this.hasChanged("errorMessage")&&y.renderOutput(),this.hasChanged("schema_structure")&&y.renderSchemaBrowser()}),v.on("reloaded",function(){this.set("dbType",d.getSelectedType()),y.render()}),m.on("reloaded",function(){this.set({pendingChanges:!1},{silent:!0}),b.render()}),v.on("built failed",function(){$("#buildSchema label").prop("disabled",!1),$("#buildSchema label").html($("#buildSchema label").data("originalValue")),y.renderOutput(),y.renderSchemaBrowser()}),m.on("change",function(){(this.hasChanged("sql")||this.hasChanged("statement_separator"))&&!this.hasChanged("id")&&!this.get("pendingChanges")&&this.set({pendingChanges:!0},{silent:!0})}),m.on("executed",function(){var e=$(".runQuery");e.prop("disabled",!1),e.html(e.data("originalValue")),this.set({pendingChanges:!1},{silent:!0}),b.renderOutput()}),$("#buildSchema").click(function(e){var t=$("label",this);e.preventDefault();if(t.prop("disabled"))return!1;t.data("originalValue",t.html()),t.prop("disabled",!0).text("Building Schema..."),v.build(d)});var w=function(e){var t=$(".runQuery");e.preventDefault();if(t.prop("disabled"))return!1;t.data("originalValue",t.html()),t.prop("disabled",!0).text("Executing SQL..."),b.checkForSelectedText(),m.execute()};return $(".runQuery").click(w),$(document).keyup(function(e){e.keyCode==116&&(e.preventDefault(),w(e))}),$("#runQueryOptions li a").click(function(e){e.preventDefault(),b.setOutputType(this.id),b.renderOutput()}),$("#queryPrettify").click(function(e){var t=$(this);t.attr("disabled",!0),e.preventDefault(),$.post("index.cfm/proxy/formatSQL",{sql:m.get("sql")},function(e){m.set({sql:e}),m.trigger("reloaded"),m.set({pendingChanges:!0}),t.attr("disabled",!1)})}),$(".terminator .dropdown-menu a").on("click",function(e){e.preventDefault(),l($(this).closest(".panel"),$(this).attr("href")),$(this).closest(".panel").hasClass("schema")?y.handleSchemaChange():m.set({pendingChanges:!0,statement_separator:$(this).attr("href")},{silent:!0})}),$(window).bind("beforeunload",function(){if(m.get("pendingChanges"))return"Warning! You have made changes to your query which will be lost. Continue?'"}),d.on("reset",function(){h=f.initialize(d,v,m,p,g),this.length&&!this.getSelectedType()&&this.setSelectedType(this.first().id,!0),g.render(),y.render(),b.render()}),p.on("change reset remove",function(){localStorage&&localStorage.setItem("fiddleHistory",JSON.stringify(this.toJSON()))}),$("#clear").click(function(e){e.preventDefault(),v.reset(),m.reset(),h.navigate("!"+d.getSelectedType().id,{trigger:!0})}),$("#sample").click(function(e){e.preventDefault(),h.navigate("!"+d.getSelectedType().get("sample_fragment"),{trigger:!0})}),d.on("change",function(){g.render(),m.id&&v.get("short_code").length&&v.get("dbType").id==this.getSelectedType().id?h.navigate("!"+this.getSelectedType().id+"/"+v.get("short_code")+"/"+m.id):v.get("short_code").length&&v.get("dbType").id==this.getSelectedType().id?h.navigate("!"+this.getSelectedType().id+"/"+v.get("short_code")):h.navigate("!"+this.getSelectedType().id)}),v.on("built",function(){p.insert(new t({fragment:"!"+this.get("dbType").id+"/"+this.get("short_code")})),h.navigate("!"+this.get("dbType").id+"/"+this.get("short_code"))}),m.on("executed",function(){var e=this.get("schemaDef");p.insert(new t({fragment:"!"+e.get("dbType").id+"/"+e.get("short_code")+"/"+this.id})),h.navigate("!"+e.get("dbType").id+"/"+e.get("short_code")+"/"+this.id)}),d.reset(c),{dbTypes:d,schemaDef:v,schemaDefView:y,queryView:b}};return{initialize:c}});var dateFormat=function(){var e=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,t=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,n=/[^-+\dA-Z]/g,r=function(e,t){e=String(e),t=t||2;while(e.length<t)e="0"+e;return e};return function(i,s,o){var u=dateFormat;arguments.length==1&&Object.prototype.toString.call(i)=="[object String]"&&!/\d/.test(i)&&(s=i,i=undefined),i=i?new Date(i):new Date;if(isNaN(i))throw SyntaxError("invalid date");s=String(u.masks[s]||s||u.masks["default"]),s.slice(0,4)=="UTC:"&&(s=s.slice(4),o=!0);var a=o?"getUTC":"get",f=i[a+"Date"](),l=i[a+"Day"](),c=i[a+"Month"](),h=i[a+"FullYear"](),p=i[a+"Hours"](),d=i[a+"Minutes"](),v=i[a+"Seconds"](),m=i[a+"Milliseconds"](),g=o?0:i.getTimezoneOffset(),y={d:f,dd:r(f),ddd:u.i18n.dayNames[l],dddd:u.i18n.dayNames[l+7],m:c+1,mm:r(c+1),mmm:u.i18n.monthNames[c],mmmm:u.i18n.monthNames[c+12],yy:String(h).slice(2),yyyy:h,h:p%12||12,hh:r(p%12||12),H:p,HH:r(p),M:d,MM:r(d),s:v,ss:r(v),l:r(m,3),L:r(m>99?Math.round(m/10):m),t:p<12?"a":"p",tt:p<12?"am":"pm",T:p<12?"A":"P",TT:p<12?"AM":"PM",Z:o?"UTC":(String(i).match(t)||[""]).pop().replace(n,""),o:(g>0?"-":"+")+r(Math.floor(Math.abs(g)/60)*100+Math.abs(g)%60,4),S:["th","st","nd","rd"][f%10>3?0:(f%100-f%10!=10)*f%10]};return s.replace(e,function(e){return e in y?y[e]:e.slice(1,e.length-1)})}}();dateFormat.masks={"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"},dateFormat.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]},Date.prototype.format=function(e,t){return dateFormat(this,e,t)},define("DateFormat",function(e){return function(){return e.dateFormat}}(this)),define("text!DDLBuilder/templates/generic.sql",[],function(){return"CREATE TABLE {{{tablePrefix}}}{{tableName}}{{{tableSuffix}}}\n ({{#each_with_index columns}}{{#if index}}, {{/if}}{{{../fieldPrefix}}}{{name}}{{{../fieldSuffix}}} {{db_type}}{{/each_with_index}})\n{{separator}}\n \nINSERT INTO {{{tablePrefix}}}{{tableName}}{{{tableSuffix}}}\n ({{#each_with_index columns}}{{#if index}}, {{/if}}{{{../fieldPrefix}}}{{name}}{{{../fieldSuffix}}}{{/each_with_index}})\nVALUES\n {{#each_with_index data}}{{#if index}},\n {{/if}}({{#each_with_index r}}{{#if index}}, {{/if}}{{formatted_field ../..}}{{/each_with_index}}){{/each_with_index}}\n{{separator}}"}),define("text!DDLBuilder/templates/oracle.sql",[],function(){return"CREATE TABLE {{{tablePrefix}}}{{tableName}}{{{tableSuffix}}}\n ({{#each_with_index columns}}{{#if index}}, {{/if}}{{{../fieldPrefix}}}{{name}}{{{../fieldSuffix}}} {{db_type}}{{/each_with_index}})\n{{separator}}\n\nINSERT ALL {{#each_with_index data}}\n INTO {{{../tablePrefix}}}{{../tableName}}{{{../tableSuffix}}} ({{#each_with_index r}}{{#if index}}, {{/if}}{{{../../fieldPrefix}}}{{column_name_for_index ../..}}{{{../../fieldSuffix}}}{{/each_with_index}})\n VALUES ({{#each_with_index r}}{{#if index}}, {{/if}}{{formatted_field ../..}}{{/each_with_index}}){{/each_with_index}}\nSELECT * FROM dual\n{{separator}}"}),define("text!DDLBuilder/templates/sqlite.sql",[],function(){return"CREATE TABLE {{tablePrefix}}{{tableName}}{{tableSuffix}}\n ({{#each_with_index columns}}{{#if index}}, {{/if}}{{{../fieldPrefix}}}{{name}}{{{../fieldSuffix}}} {{db_type}}{{/each_with_index}})\n{{separator}}\n\n{{#each_with_index data}}\nINSERT INTO {{tablePrefix}}{{../tableName}}{{tableSuffix}}\n ({{#each_with_index ../columns}}{{#if index}}, {{/if}}{{{../../fieldPrefix}}}{{name}}{{{../../fieldSuffix}}}{{/each_with_index}})\nVALUES\n ({{#each_with_index r}}{{#if index}}, {{/if}}{{formatted_field ../..}}{{/each_with_index}})\n{{../separator}}\n\n{{/each_with_index}}"}),define("DDLBuilder/ddl_builder",["jQuery","Handlebars","DateFormat","text!./templates/generic.sql","text!./templates/oracle.sql","text!./templates/sqlite.sql","HandlebarsHelpers/each_with_index"],function(e,t,n,r,i,s){return ddl_builder=function(e){return e||(e={}),this.fieldPrefix="",this.fieldSuffix="",this.tablePrefix="",this.tableSuffix="",this.dateFormatMask="yyyy-mm-dd HH:MM:ss",this.charType="varchar",this.intType="int",this.floatType="numeric",this.dateType="datetime",this.valueSeparator="",this.column_count=0,this.definition={tableName:"Table1",columns:[],data:[]},this.ddlTemplate=r,this.compiledTemplate=t.compile(this.ddlTemplate),this.setup(e),this},ddl_builder.prototype.setup=function(e){for(var n in e)this[n]=e[n];return e.ddlTemplate&&(this.compiledTemplate=t.compile(this.ddlTemplate)),e.tableName&&(this.definition.tableName=e.tableName),this},ddl_builder.prototype.setupForDBType=function(e,t){switch(e){case"SQL Server":this.setup({statement_separator:t,fieldPrefix:"[",fieldSuffix:"]",tablePrefix:"[",tableSuffix:"]"});break;case"MySQL":this.setup({statement_separator:t,fieldPrefix:"`",fieldSuffix:"`",tablePrefix:"`",tableSuffix:"`"});break;case"PostgreSQL":this.setup({statement_separator:t,dateType:"timestamp",fieldPrefix:'"',fieldSuffix:'"'});break;case"Oracle":var n=i;this.setup({dateFormatMask:"dd-mmm-yyyy hh:MM:ss TT",statement_separator:t,ddlTemplate:n,dateType:"timestamp",charType:"varchar2",fieldPrefix:'"',fieldSuffix:'"'});break;case"SQLite":var n=s;this.setup({fieldPrefix:'"',fieldSuffix:'"',tablePrefix:'"',tableSuffix:'"',statement_separator:t,ddlTemplate:n,dateType:"DATE",charType:"TEXT",intType:"INTEGER",floatType:"REAL"})}return this},ddl_builder.prototype.populateDBTypes=function(){for(var e=0;e<this.definition.columns.length;e++)this.definition.columns[e].type=="charType"?this.definition.columns[e].db_type=this[this.definition.columns[e].type]+"("+this.definition.columns[e].length+")":this.definition.columns[e].db_type=this[this.definition.columns[e].type];this.definition.dateFormatMask=this.dateFormatMask},ddl_builder.prototype.populateWrappers=function(){this.definition.fieldPrefix=this.fieldPrefix,this.definition.fieldSuffix=this.fieldSuffix},ddl_builder.prototype.guessValueSeparator=function(t){var n=t.split("\n"),r=!1,i=0,s="";for(var o=0;o<n.length;o++)if(n[o].search(/[A-Z0-9_]/i)!=-1&&!r){var u=e.trim(n[o]).match(/([A-Z0-9_]+ ?)+([^A-Z0-9_]*)/gi);u.length==1&&(u=e.trim(n[o]).match(/([A-Z0-9_]+ ?)+?([^A-Z0-9_]*)/gi)),r=!0;for(var a=0;a<u.length;a++){var f=u[a].match(/[A-Z0-9_]+([^A-Z0-9_]*)$/i).pop();f.search(/^\s\s+$/)!=-1?f=new RegExp("\\s\\s+"):f.search(/^\t+$/)!=-1?f=new RegExp("\\t+"):f.search(/^\s+$/)!=-1?f=new RegExp("\\s+"):f=e.trim(f);if(f instanceof RegExp||f.length)if(s instanceof RegExp||!!s.length){if(s.toString()!=f.toString())return{status:!1,message:"Unable to find consistent column separator in header row"}}else s=f;else!(f instanceof RegExp)&&!(s instanceof RegExp)&&!s.length&&(s="\n")}s instanceof RegExp||s.length?i=e.trim(n[o]).split(s).length:i=1}else if(n[o].search(/[A-Z0-9_]/i)!=-1&&e.trim(n[o]).split(s).length!=i&&(s.toString()!=/\s\s+/.toString()||e.trim(n[o]).split(/\s+/).length!=i))return{status:!1,message:"Line "+o+' does not have the same number of columns as the header, based on separator "'+s+'".'};return{status:!0,separator:s,column_count:i}},ddl_builder.prototype.parse=function(t){if(!this.valueSeparator.length){var n=this.guessValueSeparator(t);if(!n.status)return"ERROR! "+n.message;this.column_count=n.column_count,this.valueSeparator=n.separator}var r=t.split("\n");for(var i=0;i<r.length;i++){var s=e.trim(r[i]).split(this.valueSeparator);if(e.trim(r[i]).length&&(s.length==this.column_count||this.valueSeparator.toString()==/\s\s+/.toString()&&(s=e.trim(r[i]).split(/\s+/)).length==this.column_count))if(!this.definition.columns.length)for(var o=0;o<s.length;o++){var u=e.trim(s[o]);u.length?this.definition.columns.push({name:u}):this.definition.columns.push(!1)}else{var a=[];for(var o=0;o<s.length;o++)if(this.definition.columns[o]!==!1){var u=e.trim(s[o]).replace(/'/g,"''");isNaN(u)||this.definition.columns[o].type=="dateType"||this.definition.columns[o].type=="charType"?this.definition.columns[o].type!="charType"&&!isNaN(Date.parse(u))?this.definition.columns[o].type="dateType":this.definition.columns[o].type="charType":this.definition.columns[o].type!="floatType"&&u%1!=0?this.definition.columns[o].type="floatType":this.definition.columns[o].type="intType";if(!this.definition.columns[o].length||u.length>this.definition.columns[o].length)this.definition.columns[o].length=u.length;a.push({v:u})}this.definition.data.push({r:a})}}return this.populateDBTypes(),this.populateWrappers(),this.render()},t.registerHelper("formatted_field",function(e){var r="",i=-1;for(var s=0;s<e.columns.length;s++){e.columns[s]&&i++;if(i==this.index){r=e.columns[s].type;break}}return!this.v.length||this.v.toUpperCase()=="NULL"?"NULL":r=="charType"?new t.SafeString("'"+this.v.replace(/'/g,"''")+"'"):r=="dateType"?new t.SafeString("'"+n(this.v,e.dateFormatMask)+"'"):this.v}),t.registerHelper("column_name_for_index",function(e){return e.columns[this.index].name}),ddl_builder.prototype.render=function(){return this.compiledTemplate(e.extend(this.definition,{separator:this.statement_separator}))},ddl_builder}),function(){function e(){function t(e){window.console&&window.console.log("ID Selector: "+e)}function n(e){var t=e+"=",n=document.cookie.split(";");for(var r=0;r<n.length;r++){var i=n[r];while(i.charAt(0)==" ")i=i.substring(1,i.length);if(i.indexOf(t)==0)return decodeURIComponent(i.substring(t.length,i.length))}return null}function k(e,t){this.grid=e,this.idx=t;var n=this.td=y.createElement("td");o=n.style,o.fontWeight="bold",o.padding="4px",o.verticalAlign="middle",o.cursor="pointer";var r=this;n.onmouseover=function(){r.onMouseOver()},n.onmouseout=function(){r.onMouseOut()},n.onclick=function(){r.onClick()};var i=u[t],s=y.createElement("img");s.src=i?"https://www.idselector.com/static/opicons/"+i.icon:"https://www.idselector.com/images/openid.ico",s.style.width="16px",s.style.height="16px",s.style.verticalAlign="middle",n.appendChild(s),n.appendChild(y.createTextNode(" ")),n.appendChild(y.createTextNode(i?i.shortname:"Other OpenID")),this.selected=!1}function L(){this.table=y.createElement("table"),this.table.style.backgroundColor="#FFF",this.table.style.width="100%",this.table.style.border="1px solid #6e91af",this.tbody=y.createElement("tbody"),this.table.appendChild(this.tbody),this.maxOffset=(Math.ceil(u.length/12)-1)*12,this.cells=[];for(var e=0;e<u.length;e++)this.cells[e]=new k(this,e);this.rows=[y.createElement("tr"),y.createElement("tr"),y.createElement("tr"),y.createElement("tr")],this.otherCell=new k(this,-1);var t=y.createElement("td");t.style.padding="4px",t.style.textAlign="right",t.style.verticalAlign="middle",t.colSpan=2,t.innerHTML='<a href="http://openid.net/" style="color:#6e91af;" target="_blank">Help</a>';var n=y.createElement("tr");n.style.borderTop="1px solid #AAA",n.appendChild(this.otherCell.td),n.appendChild(t);for(var r=0;r<4;r++)this.tbody.appendChild(this.rows[r]);this.tbody.appendChild(n),this.offset=0}function O(){var t=window.ActiveXObject?e?document.body.scrollLeft:document.documentElement.scrollLeft:window.pageXOffset,n=e?document.body.clientWidth:document.documentElement.clientWidth,r=n+t-401,i=f.offsetLeft,s=f.offsetTop;if(f.clientTop)s+=f.clientTop;else if(document.defaultView&&document.defaultView.getComputedStyle){var o=document.defaultView.getComputedStyle(f,"");s+=parseInt(o.getPropertyValue("border-top-width")),s+=parseInt(o.getPropertyValue("border-bottom-width"))}var u=f.offsetParent;while(u){i+=u.offsetLeft,s+=u.offsetTop;if(u.clientLeft)i+=u.clientLeft,s+=u.clientTop;else if(document.defaultView&&document.defaultView.getComputedStyle){var o=document.defaultView.getComputedStyle(u,"");s+=parseInt(o.getPropertyValue("border-top-width")),i+=parseInt(o.getPropertyValue("border-left-width"))}u=u.offsetParent}s+=f.offsetHeight,i=Math.max(Math.min(i,r),0);var a=v.style;a.left=i+"px",a.top=s+"px",a.display="block",a.height=b.offsetHeight+2+"px";var l=document.body.parentNode}function M(){v.style.display="none"}function _(e){if(e.isTextEdit){var t=e.createTextRange();t&&(t.move("character",e.value.length),t.select())}}function D(){f.value=="Click to Sign In"&&(f.value="http://"),_(f),O()}function B(e,t,n){if(n){var r=new Date;r.setTime(r.getTime()+n*24*60*60*1e3);var i="; expires="+r.toGMTString()}else var i="";document.cookie=e+"="+encodeURIComponent(t)+i+"; path=/"}var e=document.compatMode!="CSS1Compat",r=n("__openid_selector_openid"),i=n("__openid_selector_op_id"),s=n("__openid_selector_uname"),o,u=[{shortname:"myOpenID",url_suffix:".myopenid.com/",openid1:!0,openid2:!0,id:8,icon:"myopenid.ico",url_prefix:"http://",website:"https://www.myopenid.com/",longname:"myOpenID",usercalled:"username"},{shortname:"claimID",url_suffix:"",openid1:!0,openid2:!1,id:4,icon:"claimid.ico",url_prefix:"http://claimid.com/",website:"http://claimid.com/",longname:"claimID",usercalled:"username"},{shortname:"Clickpass",url_suffix:"",openid1:!0,openid2:!0,id:5,icon:"clickpass.ico",url_prefix:"http://clickpass.com/public/",website:"http://www.clickpass.com/",longname:"Clickpass",usercalled:"username"},{shortname:"Wordpress",url_suffix:".wordpress.com/",openid1:!0,openid2:!1,id:14,icon:"wordpress.ico",url_prefix:"http://",website:"http://www.wordpress.com/",longname:"Wordpress",usercalled:"username"},{shortname:"Blogger",url_suffix:".blogspot.com/",openid1:!0,openid2:!1,id:2,icon:"blogger.ico",url_prefix:"http://",website:"http://www.blogger.com/",longname:"Google Blogger",usercalled:"blog name"},{shortname:"Livejournal",url_suffix:".livejournal.com/",openid1:!0,openid2:!1,id:7,icon:"lj.ico",url_prefix:"http://",website:"http://www.livejournal.com/",longname:"Livejournal",usercalled:"username"},{shortname:"Technorati",url_suffix:"",openid1:!0,openid2:!1,id:10,icon:"technorati.ico",url_prefix:"http://technorati.com/people/technorati/",website:"http://www.technorati.com/",longname:"Technorati",usercalled:"username"},{shortname:"Flickr",url_suffix:"",openid1:!1,openid2:!0,id:6,icon:"flickr.ico",url_prefix:"http://www.flickr.com/photos/",website:"http://www.flickr.com/",longname:"Flickr",usercalled:"username"},{shortname:"Identity.net",url_suffix:".identity.net/",openid1:!0,openid2:!0,id:23,icon:"identity.ico",url_prefix:"http://",website:"http://identity.net/",longname:"Identity.net",usercalled:"username"},{shortname:"Google",url_suffix:"",openid1:!1,openid2:!0,id:26,icon:"google.ico",url_prefix:"",website:"https://www.google.com/accounts/o8/id",longname:"Google",usercalled:"username"},{shortname:"Yahoo!",url_suffix:"",openid1:!1,openid2:!0,id:15,icon:"yahoo.ico",url_prefix:"http://me.yahoo.com/",website:"http://yahoo.com/",longname:"Yahoo!",usercalled:"yahoo id"},{shortname:"AOL",url_suffix:"",openid1:!0,openid2:!1,id:1,icon:"aol.ico",url_prefix:"http://openid.aol.com/",website:"http://www.aol.com/",longname:"America Online/AIM",usercalled:"screenname"}],a=window.idselector_input_id?window.idselector_input_id:"openid_identifier",f=document.getElementById(a);if(f==null){t("couldn't find openid input box with id = "+a);for(H=0;!f&&H<document.forms.length;H++)f=document.forms[H].openid_identifier;for(H=0;!f&&H<document.forms.length;H++)f=document.forms[H].openid_url}if(f==null){t("couldn't find openid input box");return}var l=f.value,c=document.createElement("img");o=c.style,o.width="16px",o.height="16px",o.verticalAlign="middle",o.padding="0px",o.border="0px",o.margin="0px",o.display="inline";var h=document.createElement("div");h.innerHTML='<button type="button"></button>';var p=document.createElement("img");p.src="https://www.idselector.com/images/arrow.gif",p.style.display="inline";var d=h.firstChild;h.removeChild(d),d.id="__idselector_button",d.style.cursor="pointer",d.appendChild(c),d.appendChild(document.createTextNode(" ")),d.appendChild(p);var v=document.createElement("iframe");v.frameBorder=0,v.scrolling="no",o=v.style,o.display="none",o.position="absolute",o.width="400px",o.height="0px",o.margin="0px",o.padding="0px",o.zIndex=1e4,o.border="0px";var m=f.parentNode,g=null;window.idselector_target_id&&(g=document.getElementById(window.idselector_target_id),g||t("couldn't find element with id "+window.idselector_target_id)),g?g.insertBefore(d,g.firstChild):(m.insertBefore(d,f.nextSibling),m.insertBefore(document.createTextNode(" "),d)),document.body.appendChild(v);var y=v.contentWindow.document;y.open(),y.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><title>ID Selector</title><style type="text/css">html{color:#000;background:#6e91af;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:\'\';}abbr,acronym {border:0;font-variant:normal;}sup {vertical-align:text-top;}sub {vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}body {border:1px solid #6e91af;font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;}</style></head><body></body></html>'),y.close();var b=y.body,w=y.createElement("img");w.style.verticalAlign="middle",w.style.cursor="pointer",w.src="https://www.idselector.com/images/arrow_white_back.png";var E=y.createElement("img");E.style.verticalAlign="middle",E.style.cursor="pointer",E.src="https://www.idselector.com/images/arrow_white_forward.png";var S=y.createElement("div");S.style[document.all?"styleFloat":"cssFloat"]="right",S.innerHTML='<a href="https://www.myopenid.com/signup?affiliate_id=21239" style="color:#fff;" target="_blank">Get an OpenID</a>';var x=y.createElement("div");o=x.style,o.fontWeight="bold",o.color="#fff",o.padding="2px 8px 2px 8px",x.appendChild(S),x.appendChild(y.createTextNode("Sign in with OpenID using"));var T=y.createElement("span");T.appendChild(y.createTextNode("xxx:"));var N=y.createElement("input");N.type="text",N.size=20,o=N.style,o.verticalAlign="middle",o.padding="2px 2px 2px 20px",o.backgroundRepeat="no-repeat",o.backgroundPosition="2px 2px";var C=y.createElement("div");o=C.style,o.color="#fff",o.padding="2px 8px 2px 8px",o.textAlign="right",o.position="relative",C.appendChild(T),C.appendChild(y.createTextNode(" ")),C.appendChild(N),_id=k.prototype={},_id.onMouseOver=function(){this.selected||(this.td.style.backgroundColor="#eee")},_id.onMouseOut=function(){this.selected||(this.td.style.backgroundColor="")},_id.onClick=function(){this.grid.select(this),provider=u[this.idx],this.idx==-1?(f.value="http://",f.focus()):provider.openid2&&!provider.openid1?(f.focus(),setTimeout(M,1)):(N.focus(),N.select())},_id.setSelected=function(e){this.td.style.backgroundColor=e?"#c6d9e8":"",this.selected=e},_id=L.prototype={},_id.forward=function(){this.offset=Math.min(this.offset+12,this.maxOffset),this.gen()},_id.back=function(){this.offset=Math.max(this.offset-12,0),this.gen()},_id.gen=function(){for(var e=0;e<4;e++){var t=this.rows[e];while(t.firstChild)t.removeChild(t.firstChild)}for(var e=0;e<12;e++){var t=this.rows[Math.floor(e/3)],n=this.cells[this.offset+e];n?t.appendChild(n.td):t.appendChild(y.createElement("td"))}E.style.visibility=this.offset==this.maxOffset?"hidden":"",w.style.visibility=this.offset==0?"hidden":"",v.style.height=b.offsetHeight+2+"px"},_id.select=function(e){this.curr&&this.curr.setSelected(!1),this.curr=e,e.setSelected(!0);if(e.idx>-1){var t=u[e.idx];if(t.openid2&&!t.openid1)T.style.visibility="hidden",N.style.visibility="hidden",f.value=t.website;else{T.style.visibility="",N.style.visibility="",T.removeChild(T.firstChild);var n=y.createTextNode(t.longname+" "+t.usercalled+":");T.appendChild(n),N.style.backgroundImage="url(https://www.idselector.com/static/opicons/"+t.icon+")",f.value=t.url_prefix+"username"+t.url_suffix,N.value="username"}c.src="https://www.idselector.com/static/opicons/"+t.icon}else T.style.visibility="hidden",N.style.visibility="hidden",c.src="https://www.idselector.com/images/openid.ico"},_id.setName=function(e){var t=u[this.curr.idx];f.value=t.url_prefix+e+t.url_suffix};var A=new L;A.gen(),b.appendChild(x),b.appendChild(A.table),b.appendChild(C),d.onclick=function(e){return v.style.display=="none"?O():M(),e&&(e.cancelBubble=!0),!1},d.onfocus=function(){d.blur()},E.onclick=function(){A.forward()},w.onclick=function(){A.back()},f.onkeypress=function(e){var t;window.event?t=window.event.keyCode:e.which&&(t=e.which),t!=13&&t!=9&&A.select(A.otherCell)},N.onkeydown=function(e){var t;v.contentWindow.event?t=v.contentWindow.event.keyCode:e.which&&(t=e.which),(t==13||t==9)&&setTimeout(function(){f.onfocus=D,f.focus(),setTimeout(M,1)},1)},N.onkeyup=function(){var e=this.value;e||(e="username",this.value=e,this.select()),A.setName(e)},oldOnResize=window.onresize,window.onresize=function(e){try{v.style.display=="block"&&O()}finally{oldOnResize&&oldOnResize(e)}},oldOnScroll=window.onscroll,window.onscroll=function(e){try{v.style.display=="block"&&O()}finally{oldOnScroll&&oldOnScroll(e)}};if(i){var P=null;for(var H=0;H<u.length;H++)u[H].id==i&&(P=A.cells[H]);P&&(A.select(P),N.value=s)}A.curr||A.select(A.otherCell),r?f.value=r:l.length==0&&(f.value="Click to Sign In"),f.onfocus=D;var j=null;m=f.parentNode;while(m&&m.nodeType==1){if(m.nodeName=="FORM"){j=m;break}m=m.parentNode}if(j){var F=j.onsubmit;j.onsubmit=function(e){try{B("__openid_selector_openid",f.value,365);if(A.curr.idx>-1){var t=u[A.curr.idx].id;B("__openid_selector_op_id",t,365),B("__openid_selector_uname",N.value,365)}else B("__openid_selector_op_id","",-1),B("__openid_selector_uname","",-1)}finally{if(F)return F(e)}}}window.ActiveXObject?document.body.parentNode.attachEvent("onclick",function(){window.event.srcElement!=f&&window.event.srcElement!=d&&M()}):document.body.parentNode.addEventListener("click",function(e){e.target!=f&&e.target!=d&&M()},!1)}var t=window.onload;window.onload=function(n){try{e()}finally{return t&&t(n)}}}(),define("libs/idselector",function(){}),requirejs.config({paths:{jQuery:"libs/jquery/jquery",Underscore:"libs/underscore",Backbone:"libs/backbone",Bootstrap:"libs/bootstrap",Handlebars:"libs/handlebars-1.0.0.beta.6",HandlebarsHelpers:"libs/handlebarsHelpers",DateFormat:"libs/date.format",BrowserEngines:"libs/browserEngines",FiddleEditor:"libs/fiddleEditor",CodeMirror:"libs/codemirror/codemirror",MySQLCodeMirror:"libs/codemirror/mode/mysql/mysql",XPlans:"libs/xplans",DDLBuilder:"libs/ddl_builder"},shim:{Backbone:{deps:["Underscore","jQuery","libs/json2"],exports:"Backbone"},jQuery:{exports:"$"},Underscore:{exports:"_"},CodeMirror:{exports:"CodeMirror"},Handlebars:{exports:"Handlebars"},DateFormat:{exports:"dateFormat"},"XPlans/oracle/loadswf":{deps:["XPlans/oracle/flashver"],exports:"loadswf"},"XPlans/mssql":{exports:"QP"},MySQLCodeMirror:["CodeMirror"],"libs/jquery/jquery.blockUI":["jQuery"],"libs/jquery/jquery.cookie":["jQuery"],"Bootstrap/bootstrap-collapse":["jQuery"],"Bootstrap/bootstrap-tab":["jQuery"],"Bootstrap/bootstrap-dropdown":["jQuery"],"Bootstrap/bootstrap-modal":["jQuery"],"Bootstrap/bootstrap-tooltip":["jQuery"],"Bootstrap/bootstrap-popover":["jQuery","Bootstrap/bootstrap-tooltip"]}}),require(["jQuery","Underscore","dbTypes_cached","fiddle_backbone/app","DDLBuilder/ddl_builder","libs/idselector"],function(e,t,n,r,i){function u(t){e("#exit_fullscreen").css("display")=="none"?(e("body").css("overflow-y","hidden"),e(".navbar-fixed-top").css("position","fixed").css("margin",0),e("#exit_fullscreen").css("display","block"),e("#exit_fullscreen span").text("Exit Fullscreen "+t),e(".nav-collapse, .btn-navbar, #db_type_label_collapsed .navbar-text").css("display","none")):(e("body").css("overflow-y","auto"),e("body").css("height","100%"),e(".navbar-fixed-top").css("position","").css("margin",""),e("#exit_fullscreen").css("display","none"),e(".nav-collapse, .btn-navbar, #db_type_label_collapsed .navbar-text").css("display",""))}function a(){var t=e(window).height()-165;if(t>400){var n=e("#schema-output").width();e("#schema-output").height((t-10)*.7),e("#output").css("min-height",(t-10)*.3+"px"),fiddleBackbone.schemaDefView.editor.isFullscreen()?(e("#fiddleFormDDL .CodeMirror-scroll, #schema_ddl").css("height",e(window).height()+"px"),e("#fiddleFormDDL .CodeMirror-scroll .CodeMirror-gutter").height("height",e(window).height()+"px")):(e("#fiddleFormDDL .CodeMirror-scroll").css("height",e("#fiddleFormDDL").height()-(5+e("#fiddleFormDDL .action_buttons").height())+"px"),e("#schema_ddl").css("height",e("#fiddleFormDDL").height()-(15+e("#fiddleFormDDL .action_buttons").height())+"px"),e("#fiddleFormDDL .CodeMirror-scroll .CodeMirror-gutter").height(e("#fiddleFormDDL .CodeMirror-scroll").height()-2)),fiddleBackbone.queryView.editor.isFullscreen()?(e("#fiddleFormSQL .CodeMirror-scroll, #sql").css("height",e(window).height()+"px"),e("#fiddleFormSQL .CodeMirror-scroll .CodeMirror-gutter").css("height",e(window).height()+"px")):(e("#fiddleFormSQL .CodeMirror-scroll").css("height",e("#fiddleFormSQL").height()-(5+e("#fiddleFormSQL .action_buttons").height())+"px"),e("#sql").css("height",e("#fiddleFormSQL").height()-(15+e("#fiddleFormSQL .action_buttons").height())+"px"),e("#fiddleFormSQL .CodeMirror-scroll .CodeMirror-gutter").height(e("#fiddleFormSQL .CodeMirror-scroll").height()-2)),e("#browser").height(e("#fiddleFormDDL .CodeMirror-scroll").height());var r=function(t){var n={height:e(".blockMsg",t).height(),width:e(".blockMsg",t).width()},r={height:e(t).height(),width:e(t).width()};e(".blockMsg",t).css("top",(r.height-n.height)/2).css("left",(r.width-n.width)/2)};r(e("div.sql.panel")),r(e("#output")),fiddleBackbone.schemaDefView.refresh(),fiddleBackbone.queryView.refresh()}}e.blockUI.defaults.overlayCSS.cursor="auto",e.blockUI.defaults.css.cursor="auto",fiddleBackbone=r.initialize(n),e("#userInfo").on("click","#myFiddles",function(t){t.preventDefault(),e("#myFiddlesModal").modal("show"),e("#myFiddlesModal .modal-body").block({message:"Loading..."});var n=function(){var t=e(this);e(".tab-pane",this).removeClass("active"),e(e("#myFiddlesTabs li.active a").attr("href")).addClass("active"),t.unblock(),e(".preview-schema").popover({placement:"left",title:"Schema Structure",content:function(){return e(this).closest("td").find(".schemaPreviewWrapper").html()}}),e(".preview-ddl").popover({placement:"left",title:"Schema DDL",content:function(){return e(this).closest("td").find(".schemaPreviewWrapper").html()}}),e(".result-sets").popover({placement:"left",title:"Query Results",content:function(){return e(this).closest("td").find(".resultSetWrapper").html()}}),e(".preview-sql").popover({placement:"left",title:"SQL Statements",content:function(){return e(this).closest("td").find(".resultSetWrapper").html()}}),e(".showAll",this).click(function(t){t.preventDefault(),e("tr.for-schema-"+e(this).closest("tr").attr("id")).show("fast"),e(this).hide()}),e(".favorite",this).click(function(t){t.preventDefault();var r=this,i=e(this).closest("tr.queryLog");e.post("index.cfm/UserFiddles/setFavorite",{schema_def_id:e(this).attr("schema_def_id"),query_id:e(this).attr("query_id"),favorite:e(this).attr("href")=="#addFavorite"?1:0},function(){e(r).attr("href")=="#addFavorite"?e(r).attr("href","#removeFavorite").attr("title","Remove from favorites"):e(r).attr("href","#addFavorite").attr("title","Add to favorites"),e("i",r).toggleClass("icon-star-empty icon-star"),e(r).closest(".tab-pane").attr("id")=="favorites"&&e(".queryLog[schema_def_id="+e(r).attr("schema_def_id")+"][query_id="+e(r).attr("query_id")+"] a.favorite").replaceWith(r),e("#favorites").load("index.cfm/UserFiddles/getFavorites",{tz:(new Date).getTimezoneOffset()/60},n)})}),e(".forgetSchema",this).click(function(n){n.preventDefault();var r=e(this).closest("tr.schemaLog").attr("id");e.post("index.cfm/UserFiddles/forgetSchema",{schema_def_id:e(this).attr("schema_def_id")},function(){e("#"+r+",tr.for-schema-"+r,t).remove()})}),e(".forgetQuery",this).click(function(t){t.preventDefault();var n=e(this).closest("tr.queryLog");e.post("index.cfm/UserFiddles/forgetQuery",{schema_def_id:e(this).attr("schema_def_id"),query_id:e(this).attr("query_id")},function(){n.remove()})}),e(".forgetOtherQueries",this).click(function(t){t.preventDefault();var n=e(this).closest("tbody").find('tr.queryLog[schema_def_id="'+e(this).attr("schema_def_id")+'"][query_id!="'+e(this).attr("query_id")+'"]');e.post("index.cfm/UserFiddles/forgetOtherQueries",{schema_def_id:e(this).attr("schema_def_id"),query_id:e(this).attr("query_id")},function(){n.remove()})})};e("#myFiddlesModal .modal-body").load("index.cfm/UserFiddles",{tz:(new Date).getTimezoneOffset()/60},n)}),e("#myFiddlesTabs a").on("click",function(t){t.preventDefault(),e(this).tab("show")}),e("#myFiddlesModal .modal-body").on("click","a",function(t){e(this).hasClass("favorite")||e("#myFiddlesModal").modal("hide")}),e("#myFiddlesModal").on("hidden",function(){e(".popover-anchor",this).popover("hide")});if(e("#user_choices",this).length){var s=[];try{fullHistory=e.parseJSON(localStorage.getItem("fiddleHistory")),fullHistory.length&&(s=t.map(fullHistory,function(e,t){return[e.fragment,dateFormat(e.last_used,"mm/dd/yyyy HH:MM:ss")]}),e.post("index.cfm/UserFiddles/loadFromLocalStorage",{localHistory:JSON.stringify(s)},function(n){var r=e.parseJSON(n);fullHistory=t.reject(fullHistory,function(e){return t.find(r,function(t){return t[0]==e.fragment})}),localStorage.setItem("fiddleHistory",JSON.stringify(fullHistory))}))}catch(o){}}e("#loginModal form").submit(function(){e("#hash",this).val(window.location.hash)}),e("#loginModal").on("hidden",function(){e("iframe").css("display","none")}),e("#userInfo").on("click","#logout",function(t){t.preventDefault(),e("<form>",{action:e(this).attr("href"),method:"GET"}).append(e("<input>",{type:"hidden",name:"hash",value:window.location.hash})).submit()}),e("#textToDDLModal .btn").click(function(t){t.preventDefault();var n=(new i({tableName:e("#tableName").val()})).setupForDBType(fiddleBackbone.dbTypes.getSelectedType().get("simple_name"),fiddleBackbone.schemaDef.get("statement_separator")),r=n.parse(e("#raw").val());e("#parseResults").text(r),e(this).attr("id")=="appendDDL"&&(fiddleBackbone.schemaDef.set("ddl",fiddleBackbone.schemaDef.get("ddl")+"\n\n"+r),fiddleBackbone.schemaDef.trigger("reloaded"),e("#textToDDLModal").modal("hide"))}),e("#exit_fullscreen").on("click",function(e){e.preventDefault(),fiddleBackbone.schemaDefView.editor.setFullscreen(!1),fiddleBackbone.queryView.editor.setFullscreen(!1),u(""),a()}),e("#schemaFullscreen").on("click",function(e){e.preventDefault(),fiddleBackbone.schemaDefView.editor.setFullscreen(!0),u("Schema Editor")}),e("#queryFullscreen").on("click",function(e){e.preventDefault(),fiddleBackbone.queryView.editor.setFullscreen(!0),u("Query Editor")}),e("#schemaBrowser").on("click",function(t){t.preventDefault(),e(this).attr("disabled")||(e("#fiddleFormDDL .CodeMirror, .ddl_actions").css("display","none"),e("#browser, .browser_actions").css("display","block"))}),e("#browser").on("click",".tables a",function(t){t.preventDefault(),e("i",this).toggleClass("icon-minus icon-plus"),e(this).siblings(".columns").toggle()}),e("#ddlEdit").on("click",function(t){t.preventDefault(),e("#fiddleFormDDL .CodeMirror, .ddl_actions").css("display","block"),e("#browser, .browser_actions").css("display","none")}),e(window).bind("resize",a),setTimeout(a,1),e(".nav").on("click","a",function(t){e(".nav-collapse.in").collapse("hide")})}),define("main",function(){})
\ No newline at end of file +function ControlVersion(){var e,t,n;try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"),e=t.GetVariable("$version")}catch(n){}if(!e)try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"),e="WIN 6,0,21,0",t.AllowScriptAccess="always",e=t.GetVariable("$version")}catch(n){}if(!e)try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"),e=t.GetVariable("$version")}catch(n){}if(!e)try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"),e="WIN 3,0,18,0"}catch(n){}if(!e)try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),e="WIN 2,0,0,11"}catch(n){e=-1}return e}function GetSwfVer(){var e=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var t=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"",n=navigator.plugins["Shockwave Flash"+t].description,r=n.split(" "),i=r[2].split("."),s=i[0],o=i[1];r[3]!=""?tempArrayMinor=r[3].split("r"):tempArrayMinor=r[4].split("r");var u=tempArrayMinor[1]>0?tempArrayMinor[1]:0,e=s+"."+o+"."+u}}else navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1?e=4:navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1?e=3:navigator.userAgent.toLowerCase().indexOf("webtv")!=-1?e=2:isIE&&isWin&&!isOpera&&(e=ControlVersion());return e}function DetectFlashVer(e,t,n){versionStr=GetSwfVer();if(versionStr==-1)return!1;if(versionStr!=0){isIE&&isWin&&!isOpera?(tempArray=versionStr.split(" "),tempString=tempArray[1],versionArray=tempString.split(",")):versionArray=versionStr.split(".");var r=versionArray[0],i=versionArray[1],s=versionArray[2];if(r>parseFloat(e))return!0;if(r==parseFloat(e)){if(i>parseFloat(t))return!0;if(i==parseFloat(t)&&s>=parseFloat(n))return!0}return!1}}function AC_AddExtension(e,t){return e.indexOf("?")!=-1?e.replace(/\?/,t+"?"):e+t}function AC_Generateobj(e,t,n){var r="";if(isIE&&isWin&&!isOpera){r+="<object ";for(var i in e)r+=i+'="'+e[i]+'" ';for(var i in t)r+='><param name="'+i+'" value="'+t[i]+'" /> ';r+="></object>"}else{r+="<embed ";for(var i in n)r+=i+'="'+n[i]+'" ';r+="> </embed>"}return r}function AC_FL_RunContent(){var e=AC_GetArgs(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");return AC_Generateobj(e.objAttrs,e.params,e.embedAttrs)}function AC_GetArgs(e,t,n,r,i){var s=new Object;s.embedAttrs=new Object,s.params=new Object,s.objAttrs=new Object;for(var o=0;o<e.length;o+=2){var u=e[o].toLowerCase();switch(u){case"classid":break;case"pluginspage":s.embedAttrs[e[o]]=e[o+1];break;case"src":case"movie":e[o+1]=AC_AddExtension(e[o+1],t),s.embedAttrs.src=e[o+1],s.params[n]=e[o+1];break;case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblClick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case"codebase":case"id":s.objAttrs[e[o]]=e[o+1];break;case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"tabindex":s.embedAttrs[e[o]]=s.objAttrs[e[o]]=e[o+1];break;default:s.embedAttrs[e[o]]=s.params[e[o]]=e[o+1]}}return s.objAttrs.classid=r,i&&(s.embedAttrs.type=i),s}function getSearch(e){var t="";return e.location.search.length>1&&(t=new String(e.location.search),t=t.substring(1,t.length)),t}function parseVersion(e){if(typeof e!="string")return[0,0,0,0,0];var t=e.split("."),n=t[0]=="X"?999:parseInt(t[0])||0,r=t[1]=="X"?999:parseInt(t[1])||0,i=t[2]=="X"?999:parseInt(t[2])||0,s=t[3]=="X"?999:parseInt(t[3])||0,o=t[4]=="X"?999:parseInt(t[4])||0;return new Array(n,r,i,s,o)}function compareVersions(e,t){var n=parseVersion(e),r=parseVersion(t);for(var i=0;i<5;i++){if(n[i]<r[i])return 1;if(n[i]>r[i])return-1}return 0}function findViewerFile(e,t){var n=viewerMap[e];if(n==null)return!1;var r=n.length;for(var i=0;i<r;i++)if(compareVersions(n[i],t)<0)break;i!=0&&i--;var s="http://download.oracle.com/otn_software/emviewers/"+e+"/"+n[i]+"/"+e;return s}function loadswf(e){var t=e.match(/db_version="([\d\.]*)"/),n=e.match(/orarep\/(\w*)\//),r=n==null?"":n[1],i=t==null?"":t[1];r==""&&e.match(/sql_monitor_report/)&&(r="sqlmonitor",i="11");var s=Math.floor(Math.random()*1e5).toString(16);this!=top&&(top.Vars=Vars,top.getSearch=getSearch,top.lc_id=s);var o="historyUrl=history.htm%3F&lconid="+s+"&model="+encodeURIComponent(e)+"";if(hasProductInstall&&!hasRequestedVersion){var u=isIE==1?"ActiveX":"PlugIn",a=window.location;document.title=document.title.slice(0,47)+" - Flash Player Installation";var f=document.title;return AC_FL_RunContent("src","http://download.oracle.com/otn_software/emviewers/scripts/playerProductInstall","FlashVars",o,"width","100%","height","100%","align","middle","id",r,"quality","high","bgcolor","#FFFFFF","name",r,"allowScriptAccess","always","type","application/x-shockwave-flash","pluginspage","http://www.adobe.com/go/getflashplayer")}if(!hasRequestedVersion){var c="Fail to display EM Standalone report. This content requires the Adobe Flash Player. <a href=http://www.adobe.com/go/getflash/>Get Flash</a>";return c}var l=typeof viewer_swf=="string"?viewer_swf:findViewerFile(r,i);if(!!l)return AC_FL_RunContent("src",l,"width","100%","height","100%","align","middle","id",r,"quality","high","bgcolor","#FFFFFF","name",r,"flashvars",o,"allowScriptAccess","always","type","application/x-shockwave-flash","pluginspage","http://www.adobe.com/go/getflashplayer");r!=""?alert('Sorry, viewer name "'+r+'" is not yet supported...'):alert("Sorry, cannot not display report: unknown report type")}(function(e,t){function u(e){var t=o[e]={},n,r;e=e.split(/\s+/);for(n=0,r=e.length;n<r;n++)t[e[n]]=!0;return t}function c(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(l,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:s.isNumeric(r)?+r:f.test(r)?s.parseJSON(r):r}catch(o){}s.data(e,n,r)}else r=t}return r}function h(e){for(var t in e){if(t==="data"&&s.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function p(e,t,n){var r=t+"defer",i=t+"queue",o=t+"mark",u=s._data(e,r);u&&(n==="queue"||!s._data(e,i))&&(n==="mark"||!s._data(e,o))&&setTimeout(function(){!s._data(e,i)&&!s._data(e,o)&&(s.removeData(e,r,!0),u.fire())},0)}function H(){return!1}function B(){return!0}function W(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function X(e,t,n){t=t||0;if(s.isFunction(t))return s.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return s.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=s.grep(e,function(e){return e.nodeType===1});if(q.test(t))return s.filter(t,r,!n);t=s.filter(t,r)}return s.grep(e,function(e,r){return s.inArray(e,t)>=0===n})}function V(e){var t=$.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function at(e,t){return s.nodeName(e,"table")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function ft(e,t){if(t.nodeType!==1||!s.hasData(e))return;var n,r,i,o=s._data(e),u=s._data(t,o),a=o.events;if(a){delete u.handle,u.events={};for(n in a)for(r=0,i=a[n].length;r<i;r++)s.event.add(t,n,a[n][r])}u.data&&(u.data=s.extend({},u.data))}function lt(e,t){var n;if(t.nodeType!==1)return;t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),n==="object"?t.outerHTML=e.outerHTML:n!=="input"||e.type!=="checkbox"&&e.type!=="radio"?n==="option"?t.selected=e.defaultSelected:n==="input"||n==="textarea"?t.defaultValue=e.defaultValue:n==="script"&&t.text!==e.text&&(t.text=e.text):(e.checked&&(t.defaultChecked=t.checked=e.checked),t.value!==e.value&&(t.value=e.value)),t.removeAttribute(s.expando),t.removeAttribute("_submit_attached"),t.removeAttribute("_change_attached")}function ct(e){return typeof e.getElementsByTagName!="undefined"?e.getElementsByTagName("*"):typeof e.querySelectorAll!="undefined"?e.querySelectorAll("*"):[]}function ht(e){if(e.type==="checkbox"||e.type==="radio")e.defaultChecked=e.checked}function pt(e){var t=(e.nodeName||"").toLowerCase();t==="input"?ht(e):t!=="script"&&typeof e.getElementsByTagName!="undefined"&&s.grep(e.getElementsByTagName("input"),ht)}function dt(e){var t=n.createElement("div");return ut.appendChild(t),t.innerHTML=e.outerHTML,t.firstChild}function kt(e,t,n){var r=t==="width"?e.offsetWidth:e.offsetHeight,i=t==="width"?1:0,o=4;if(r>0){if(n!=="border")for(;i<o;i+=2)n||(r-=parseFloat(s.css(e,"padding"+xt[i]))||0),n==="margin"?r+=parseFloat(s.css(e,n+xt[i]))||0:r-=parseFloat(s.css(e,"border"+xt[i]+"Width"))||0;return r+"px"}r=Tt(e,t);if(r<0||r==null)r=e.style[t];if(bt.test(r))return r;r=parseFloat(r)||0;if(n)for(;i<o;i+=2)r+=parseFloat(s.css(e,"padding"+xt[i]))||0,n!=="padding"&&(r+=parseFloat(s.css(e,"border"+xt[i]+"Width"))||0),n==="margin"&&(r+=parseFloat(s.css(e,n+xt[i]))||0);return r+"px"}function Qt(e){return function(t,n){typeof t!="string"&&(n=t,t="*");if(s.isFunction(n)){var r=t.toLowerCase().split(qt),i=0,o=r.length,u,a,f;for(;i<o;i++)u=r[i],f=/^\+/.test(u),f&&(u=u.substr(1)||"*"),a=e[u]=e[u]||[],a[f?"unshift":"push"](n)}}}function Gt(e,n,r,i,s,o){s=s||n.dataTypes[0],o=o||{},o[s]=!0;var u=e[s],a=0,f=u?u.length:0,l=e===Wt,c;for(;a<f&&(l||!c);a++)c=u[a](n,r,i),typeof c=="string"&&(!l||o[c]?c=t:(n.dataTypes.unshift(c),c=Gt(e,n,r,i,c,o)));return(l||!c)&&!o["*"]&&(c=Gt(e,n,r,i,"*",o)),c}function Yt(e,n){var r,i,o=s.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((o[r]?e:i||(i={}))[r]=n[r]);i&&s.extend(!0,e,i)}function Zt(e,t,n,r){if(s.isArray(t))s.each(t,function(t,i){n||At.test(e)?r(e,i):Zt(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&s.type(t)==="object")for(var i in t)Zt(e+"["+i+"]",t[i],n,r);else r(e,t)}function en(e,n,r){var i=e.contents,s=e.dataTypes,o=e.responseFields,u,a,f,l;for(a in o)a in r&&(n[o[a]]=r[a]);while(s[0]==="*")s.shift(),u===t&&(u=e.mimeType||n.getResponseHeader("content-type"));if(u)for(a in i)if(i[a]&&i[a].test(u)){s.unshift(a);break}if(s[0]in r)f=s[0];else{for(a in r){if(!s[0]||e.converters[a+" "+s[0]]){f=a;break}l||(l=a)}f=f||l}if(f)return f!==s[0]&&s.unshift(f),r[f]}function tn(e,n){e.dataFilter&&(n=e.dataFilter(n,e.dataType));var r=e.dataTypes,i={},o,u,a=r.length,f,l=r[0],c,h,p,d,v;for(o=1;o<a;o++){if(o===1)for(u in e.converters)typeof u=="string"&&(i[u.toLowerCase()]=e.converters[u]);c=l,l=r[o];if(l==="*")l=c;else if(c!=="*"&&c!==l){h=c+" "+l,p=i[h]||i["* "+l];if(!p){v=t;for(d in i){f=d.split(" ");if(f[0]===c||f[0]==="*"){v=i[f[1]+" "+l];if(v){d=i[d],d===!0?p=v:v===!0&&(p=d);break}}}}!p&&!v&&s.error("No conversion from "+h.replace(" "," to ")),p!==!0&&(n=p?p(n):v(d(n)))}}return n}function an(){try{return new e.XMLHttpRequest}catch(t){}}function fn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function yn(){return setTimeout(bn,0),gn=s.now()}function bn(){gn=t}function wn(e,t){var n={};return s.each(mn.concat.apply([],mn.slice(0,t)),function(){n[this]=e}),n}function En(e){if(!ln[e]){var t=n.body,r=s("<"+e+">").appendTo(t),i=r.css("display");r.remove();if(i==="none"||i===""){cn||(cn=n.createElement("iframe"),cn.frameBorder=cn.width=cn.height=0),t.appendChild(cn);if(!hn||!cn.createElement)hn=(cn.contentWindow||cn.contentDocument).document,hn.write((s.support.boxModel?"<!doctype html>":"")+"<html><body>"),hn.close();r=hn.createElement(e),hn.body.appendChild(r),i=s.css(r,"display"),t.removeChild(cn)}ln[e]=i}return ln[e]}function Nn(e){return s.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n=e.document,r=e.navigator,i=e.location,s=function(){function H(){if(i.isReady)return;try{n.documentElement.doScroll("left")}catch(e){setTimeout(H,1);return}i.ready()}var i=function(e,t){return new i.fn.init(e,t,u)},s=e.jQuery,o=e.$,u,a=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,f=/\S/,l=/^\s+/,c=/\s+$/,h=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,p=/^[\],:{}\s]*$/,d=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,v=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,m=/(?:^|:|,)(?:\s*\[)+/g,g=/(webkit)[ \/]([\w.]+)/,y=/(opera)(?:.*version)?[ \/]([\w.]+)/,b=/(msie) ([\w.]+)/,w=/(mozilla)(?:.*? rv:([\w.]+))?/,E=/-([a-z]|[0-9])/ig,S=/^-ms-/,x=function(e,t){return(t+"").toUpperCase()},T=r.userAgent,N,C,k,L=Object.prototype.toString,A=Object.prototype.hasOwnProperty,O=Array.prototype.push,M=Array.prototype.slice,_=String.prototype.trim,D=Array.prototype.indexOf,P={};return i.fn=i.prototype={constructor:i,init:function(e,r,s){var o,u,f,l;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(e==="body"&&!r&&n.body)return this.context=n,this[0]=n.body,this.selector=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?o=[null,e,null]:o=a.exec(e);if(o&&(o[1]||!r)){if(o[1])return r=r instanceof i?r[0]:r,l=r?r.ownerDocument||r:n,f=h.exec(e),f?i.isPlainObject(r)?(e=[n.createElement(f[1])],i.fn.attr.call(e,r,!0)):e=[l.createElement(f[1])]:(f=i.buildFragment([o[1]],[l]),e=(f.cacheable?i.clone(f.fragment):f.fragment).childNodes),i.merge(this,e);u=n.getElementById(o[2]);if(u&&u.parentNode){if(u.id!==o[2])return s.find(e);this.length=1,this[0]=u}return this.context=n,this.selector=e,this}return!r||r.jquery?(r||s).find(e):this.constructor(r).find(e)}return i.isFunction(e)?s.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),i.makeArray(e,this))},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return M.call(this,0)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=this.constructor();return i.isArray(e)?O.apply(r,e):i.merge(r,e),r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return i.each(this,e,t)},ready:function(e){return i.bindReady(),C.add(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(M.apply(this,arguments),"slice",M.call(arguments).join(","))},map:function(e){return this.pushStack(i.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:O,sort:[].sort,splice:[].splice},i.fn.init.prototype=i.fn,i.extend=i.fn.extend=function(){var e,n,r,s,o,u,a=arguments[0]||{},f=1,l=arguments.length,c=!1;typeof a=="boolean"&&(c=a,a=arguments[1]||{},f=2),typeof a!="object"&&!i.isFunction(a)&&(a={}),l===f&&(a=this,--f);for(;f<l;f++)if((e=arguments[f])!=null)for(n in e){r=a[n],s=e[n];if(a===s)continue;c&&s&&(i.isPlainObject(s)||(o=i.isArray(s)))?(o?(o=!1,u=r&&i.isArray(r)?r:[]):u=r&&i.isPlainObject(r)?r:{},a[n]=i.extend(c,u,s)):s!==t&&(a[n]=s)}return a},i.extend({noConflict:function(t){return e.$===i&&(e.$=o),t&&e.jQuery===i&&(e.jQuery=s),i},isReady:!1,readyWait:1,holdReady:function(e){e?i.readyWait++:i.ready(!0)},ready:function(e){if(e===!0&&!--i.readyWait||e!==!0&&!i.isReady){if(!n.body)return setTimeout(i.ready,1);i.isReady=!0;if(e!==!0&&--i.readyWait>0)return;C.fireWith(n,[i]),i.fn.trigger&&i(n).trigger("ready").off("ready")}},bindReady:function(){if(C)return;C=i.Callbacks("once memory");if(n.readyState==="complete")return setTimeout(i.ready,1);if(n.addEventListener)n.addEventListener("DOMContentLoaded",k,!1),e.addEventListener("load",i.ready,!1);else if(n.attachEvent){n.attachEvent("onreadystatechange",k),e.attachEvent("onload",i.ready);var t=!1;try{t=e.frameElement==null}catch(r){}n.documentElement.doScroll&&t&&H()}},isFunction:function(e){return i.type(e)==="function"},isArray:Array.isArray||function(e){return i.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):P[L.call(e)]||"object"},isPlainObject:function(e){if(!e||i.type(e)!=="object"||e.nodeType||i.isWindow(e))return!1;try{if(e.constructor&&!A.call(e,"constructor")&&!A.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||A.call(e,r)},isEmptyObject:function(e){for(var t in e)return!1;return!0},error:function(e){throw new Error(e)},parseJSON:function(t){if(typeof t!="string"||!t)return null;t=i.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(p.test(t.replace(d,"@").replace(v,"]").replace(m,"")))return(new Function("return "+t))();i.error("Invalid JSON: "+t)},parseXML:function(n){if(typeof n!="string"||!n)return null;var r,s;try{e.DOMParser?(s=new DOMParser,r=s.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&i.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&f.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(S,"ms-").replace(E,x)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toUpperCase()===t.toUpperCase()},each:function(e,n,r){var s,o=0,u=e.length,a=u===t||i.isFunction(e);if(r){if(a){for(s in e)if(n.apply(e[s],r)===!1)break}else for(;o<u;)if(n.apply(e[o++],r)===!1)break}else if(a){for(s in e)if(n.call(e[s],s,e[s])===!1)break}else for(;o<u;)if(n.call(e[o],o,e[o++])===!1)break;return e},trim:_?function(e){return e==null?"":_.call(e)}:function(e){return e==null?"":e.toString().replace(l,"").replace(c,"")},makeArray:function(e,t){var n=t||[];if(e!=null){var r=i.type(e);e.length==null||r==="string"||r==="function"||r==="regexp"||i.isWindow(e)?O.call(n,e):i.merge(n,e)}return n},inArray:function(e,t,n){var r;if(t){if(D)return D.call(t,e,n);r=t.length,n=n?n<0?Math.max(0,r+n):n:0;for(;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=e.length,i=0;if(typeof n.length=="number")for(var s=n.length;i<s;i++)e[r++]=n[i];else while(n[i]!==t)e[r++]=n[i++];return e.length=r,e},grep:function(e,t,n){var r=[],i;n=!!n;for(var s=0,o=e.length;s<o;s++)i=!!t(e[s],s),n!==i&&r.push(e[s]);return r},map:function(e,n,r){var s,o,u=[],a=0,f=e.length,l=e instanceof i||f!==t&&typeof f=="number"&&(f>0&&e[0]&&e[f-1]||f===0||i.isArray(e));if(l)for(;a<f;a++)s=n(e[a],a,r),s!=null&&(u[u.length]=s);else for(o in e)s=n(e[o],o,r),s!=null&&(u[u.length]=s);return u.concat.apply([],u)},guid:1,proxy:function(e,n){if(typeof n=="string"){var r=e[n];n=e,e=r}if(!i.isFunction(e))return t;var s=M.call(arguments,2),o=function(){return e.apply(n,s.concat(M.call(arguments)))};return o.guid=e.guid=e.guid||o.guid||i.guid++,o},access:function(e,n,r,s,o,u,a){var f,l=r==null,c=0,h=e.length;if(r&&typeof r=="object"){for(c in r)i.access(e,n,c,r[c],1,u,s);o=1}else if(s!==t){f=a===t&&i.isFunction(s),l&&(f?(f=n,n=function(e,t,n){return f.call(i(e),n)}):(n.call(e,s),n=null));if(n)for(;c<h;c++)n(e[c],r,f?s.call(e[c],c,n(e[c],r)):s,a);o=1}return o?e:l?n.call(e):h?n(e[0],r):u},now:function(){return(new Date).getTime()},uaMatch:function(e){e=e.toLowerCase();var t=g.exec(e)||y.exec(e)||b.exec(e)||e.indexOf("compatible")<0&&w.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},sub:function(){function e(t,n){return new e.fn.init(t,n)}i.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,s){return s&&s instanceof i&&!(s instanceof e)&&(s=e(s)),i.fn.init.call(this,r,s,t)},e.fn.init.prototype=e.fn;var t=e(n);return e},browser:{}}),i.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){P["[object "+t+"]"]=t.toLowerCase()}),N=i.uaMatch(T),N.browser&&(i.browser[N.browser]=!0,i.browser.version=N.version),i.browser.webkit&&(i.browser.safari=!0),f.test(" ")&&(l=/^[\s\xA0]+/,c=/[\s\xA0]+$/),u=i(n),n.addEventListener?k=function(){n.removeEventListener("DOMContentLoaded",k,!1),i.ready()}:n.attachEvent&&(k=function(){n.readyState==="complete"&&(n.detachEvent("onreadystatechange",k),i.ready())}),i}(),o={};s.Callbacks=function(e){e=e?o[e]||u(e):{};var n=[],r=[],i,a,f,l,c,h,p=function(t){var r,i,o,u,a;for(r=0,i=t.length;r<i;r++)o=t[r],u=s.type(o),u==="array"?p(o):u==="function"&&(!e.unique||!v.has(o))&&n.push(o)},d=function(t,s){s=s||[],i=!e.memory||[t,s],a=!0,f=!0,h=l||0,l=0,c=n.length;for(;n&&h<c;h++)if(n[h].apply(t,s)===!1&&e.stopOnFalse){i=!0;break}f=!1,n&&(e.once?i===!0?v.disable():n=[]:r&&r.length&&(i=r.shift(),v.fireWith(i[0],i[1])))},v={add:function(){if(n){var e=n.length;p(arguments),f?c=n.length:i&&i!==!0&&(l=e,d(i[0],i[1]))}return this},remove:function(){if(n){var t=arguments,r=0,i=t.length;for(;r<i;r++)for(var s=0;s<n.length;s++)if(t[r]===n[s]){f&&s<=c&&(c--,s<=h&&h--),n.splice(s--,1);if(e.unique)break}}return this},has:function(e){if(n){var t=0,r=n.length;for(;t<r;t++)if(e===n[t])return!0}return!1},empty:function(){return n=[],this},disable:function(){return n=r=i=t,this},disabled:function(){return!n},lock:function(){return r=t,(!i||i===!0)&&v.disable(),this},locked:function(){return!r},fireWith:function(t,n){return r&&(f?e.once||r.push([t,n]):(!e.once||!i)&&d(t,n)),this},fire:function(){return v.fireWith(this,arguments),this},fired:function(){return!!a}};return v};var a=[].slice;s.extend({Deferred:function(e){var t=s.Callbacks("once memory"),n=s.Callbacks("once memory"),r=s.Callbacks("memory"),i="pending",o={resolve:t,reject:n,notify:r},u={done:t.add,fail:n.add,progress:r.add,state:function(){return i},isResolved:t.fired,isRejected:n.fired,then:function(e,t,n){return a.done(e).fail(t).progress(n),this},always:function(){return a.done.apply(a,arguments).fail.apply(a,arguments),this},pipe:function(e,t,n){return s.Deferred(function(r){s.each({done:[e,"resolve"],fail:[t,"reject"],progress:[n,"notify"]},function(e,t){var n=t[0],i=t[1],o;s.isFunction(n)?a[e](function(){o=n.apply(this,arguments),o&&s.isFunction(o.promise)?o.promise().then(r.resolve,r.reject,r.notify):r[i+"With"](this===a?r:this,[o])}):a[e](r[i])})}).promise()},promise:function(e){if(e==null)e=u;else for(var t in u)e[t]=u[t];return e}},a=u.promise({}),f;for(f in o)a[f]=o[f].fire,a[f+"With"]=o[f].fireWith;return a.done(function(){i="resolved"},n.disable,r.lock).fail(function(){i="rejected"},t.disable,r.lock),e&&e.call(a,a),a},when:function(e){function c(e){return function(n){t[e]=arguments.length>1?a.call(arguments,0):n,--o||f.resolveWith(f,t)}}function h(e){return function(t){i[e]=arguments.length>1?a.call(arguments,0):t,f.notifyWith(l,i)}}var t=a.call(arguments,0),n=0,r=t.length,i=new Array(r),o=r,u=r,f=r<=1&&e&&s.isFunction(e.promise)?e:s.Deferred(),l=f.promise();if(r>1){for(;n<r;n++)t[n]&&t[n].promise&&s.isFunction(t[n].promise)?t[n].promise().then(c(n),f.reject,h(n)):--o;o||f.resolveWith(f,t)}else f!==e&&f.resolveWith(f,r?[e]:[]);return l}}),s.support=function(){var t,r,i,o,u,a,f,l,c,h,p,d,v=n.createElement("div"),m=n.documentElement;v.setAttribute("className","t"),v.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",r=v.getElementsByTagName("*"),i=v.getElementsByTagName("a")[0];if(!r||!r.length||!i)return{};o=n.createElement("select"),u=o.appendChild(n.createElement("option")),a=v.getElementsByTagName("input")[0],t={leadingWhitespace:v.firstChild.nodeType===3,tbody:!v.getElementsByTagName("tbody").length,htmlSerialize:!!v.getElementsByTagName("link").length,style:/top/.test(i.getAttribute("style")),hrefNormalized:i.getAttribute("href")==="/a",opacity:/^0.55/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:a.value==="on",optSelected:u.selected,getSetAttribute:v.className!=="t",enctype:!!n.createElement("form").enctype,html5Clone:n.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},s.boxModel=t.boxModel=n.compatMode==="CSS1Compat",a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,o.disabled=!0,t.optDisabled=!u.disabled;try{delete v.test}catch(g){t.deleteExpando=!1}!v.addEventListener&&v.attachEvent&&v.fireEvent&&(v.attachEvent("onclick",function(){t.noCloneEvent=!1}),v.cloneNode(!0).fireEvent("onclick")),a=n.createElement("input"),a.value="t",a.setAttribute("type","radio"),t.radioValue=a.value==="t",a.setAttribute("checked","checked"),a.setAttribute("name","t"),v.appendChild(a),f=n.createDocumentFragment(),f.appendChild(v.lastChild),t.checkClone=f.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=a.checked,f.removeChild(a),f.appendChild(v);if(v.attachEvent)for(p in{submit:1,change:1,focusin:1})h="on"+p,d=h in v,d||(v.setAttribute(h,"return;"),d=typeof v[h]=="function"),t[p+"Bubbles"]=d;return f.removeChild(v),f=o=u=v=a=null,s(function(){var r,i,o,u,a,f,c,h,p,m,g,y,b,w=n.getElementsByTagName("body")[0];if(!w)return;h=1,b="padding:0;margin:0;border:",g="position:absolute;top:0;left:0;width:1px;height:1px;",y=b+"0;visibility:hidden;",p="style='"+g+b+"5px solid #000;",m="<div "+p+"display:block;'><div style='"+b+"0;display:block;overflow:hidden;'></div></div>"+"<table "+p+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",r=n.createElement("div"),r.style.cssText=y+"width:0;height:0;position:static;top:0;margin-top:"+h+"px",w.insertBefore(r,w.firstChild),v=n.createElement("div"),r.appendChild(v),v.innerHTML="<table><tr><td style='"+b+"0;display:none'></td><td>t</td></tr></table>",l=v.getElementsByTagName("td"),d=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",t.reliableHiddenOffsets=d&&l[0].offsetHeight===0,e.getComputedStyle&&(v.innerHTML="",c=n.createElement("div"),c.style.width="0",c.style.marginRight="0",v.style.width="2px",v.appendChild(c),t.reliableMarginRight=(parseInt((e.getComputedStyle(c,null)||{marginRight:0}).marginRight,10)||0)===0),typeof v.style.zoom!="undefined"&&(v.innerHTML="",v.style.width=v.style.padding="1px",v.style.border=0,v.style.overflow="hidden",v.style.display="inline",v.style.zoom=1,t.inlineBlockNeedsLayout=v.offsetWidth===3,v.style.display="block",v.style.overflow="visible",v.innerHTML="<div style='width:5px;'></div>",t.shrinkWrapBlocks=v.offsetWidth!==3),v.style.cssText=g+y,v.innerHTML=m,i=v.firstChild,o=i.firstChild,a=i.nextSibling.firstChild.firstChild,f={doesNotAddBorder:o.offsetTop!==5,doesAddBorderForTableAndCells:a.offsetTop===5},o.style.position="fixed",o.style.top="20px",f.fixedPosition=o.offsetTop===20||o.offsetTop===15,o.style.position=o.style.top="",i.style.overflow="hidden",i.style.position="relative",f.subtractsBorderForOverflowNotVisible=o.offsetTop===-5,f.doesNotIncludeMarginInBodyOffset=w.offsetTop!==h,e.getComputedStyle&&(v.style.marginTop="1%",t.pixelMargin=(e.getComputedStyle(v,null)||{marginTop:0}).marginTop!=="1%"),typeof r.style.zoom!="undefined"&&(r.style.zoom=1),w.removeChild(r),c=v=r=null,s.extend(t,f)}),t}();var f=/^(?:\{.*\}|\[.*\])$/,l=/([A-Z])/g;s.extend({cache:{},uuid:0,expando:"jQuery"+(s.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?s.cache[e[s.expando]]:e[s.expando],!!e&&!h(e)},data:function(e,n,r,i){if(!s.acceptData(e))return;var o,u,a,f=s.expando,l=typeof n=="string",c=e.nodeType,h=c?s.cache:e,p=c?e[f]:e[f]&&f,d=n==="events";if((!p||!h[p]||!d&&!i&&!h[p].data)&&l&&r===t)return;p||(c?e[f]=p=++s.uuid:p=f),h[p]||(h[p]={},c||(h[p].toJSON=s.noop));if(typeof n=="object"||typeof n=="function")i?h[p]=s.extend(h[p],n):h[p].data=s.extend(h[p].data,n);return o=u=h[p],i||(u.data||(u.data={}),u=u.data),r!==t&&(u[s.camelCase(n)]=r),d&&!u[n]?o.events:(l?(a=u[n],a==null&&(a=u[s.camelCase(n)])):a=u,a)},removeData:function(e,t,n){if(!s.acceptData(e))return;var r,i,o,u=s.expando,a=e.nodeType,f=a?s.cache:e,l=a?e[u]:u;if(!f[l])return;if(t){r=n?f[l]:f[l].data;if(r){s.isArray(t)||(t in r?t=[t]:(t=s.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,o=t.length;i<o;i++)delete r[t[i]];if(!(n?h:s.isEmptyObject)(r))return}}if(!n){delete f[l].data;if(!h(f[l]))return}s.support.deleteExpando||!f.setInterval?delete f[l]:f[l]=null,a&&(s.support.deleteExpando?delete e[u]:e.removeAttribute?e.removeAttribute(u):e[u]=null)},_data:function(e,t,n){return s.data(e,t,n,!0)},acceptData:function(e){if(e.nodeName){var t=s.noData[e.nodeName.toLowerCase()];if(t)return t!==!0&&e.getAttribute("classid")===t}return!0}}),s.fn.extend({data:function(e,n){var r,i,o,u,a,f=this[0],l=0,h=null;if(e===t){if(this.length){h=s.data(f);if(f.nodeType===1&&!s._data(f,"parsedAttrs")){o=f.attributes;for(a=o.length;l<a;l++)u=o[l].name,u.indexOf("data-")===0&&(u=s.camelCase(u.substring(5)),c(f,u,h[u]));s._data(f,"parsedAttrs",!0)}}return h}return typeof e=="object"?this.each(function(){s.data(this,e)}):(r=e.split(".",2),r[1]=r[1]?"."+r[1]:"",i=r[1]+"!",s.access(this,function(n){if(n===t)return h=this.triggerHandler("getData"+i,[r[0]]),h===t&&f&&(h=s.data(f,e),h=c(f,e,h)),h===t&&r[1]?this.data(r[0]):h;r[1]=n,this.each(function(){var t=s(this);t.triggerHandler("setData"+i,r),s.data(this,e,n),t.triggerHandler("changeData"+i,r)})},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){s.removeData(this,e)})}}),s.extend({_mark:function(e,t){e&&(t=(t||"fx")+"mark",s._data(e,t,(s._data(e,t)||0)+1))},_unmark:function(e,t,n){e!==!0&&(n=t,t=e,e=!1);if(t){n=n||"fx";var r=n+"mark",i=e?0:(s._data(t,r)||1)-1;i?s._data(t,r,i):(s.removeData(t,r,!0),p(t,n,"mark"))}},queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=s._data(e,t),n&&(!r||s.isArray(n)?r=s._data(e,t,s.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=s.queue(e,t),r=n.shift(),i={};r==="inprogress"&&(r=n.shift()),r&&(t==="fx"&&n.unshift("inprogress"),s._data(e,t+".run",i),r.call(e,function(){s.dequeue(e,t)},i)),n.length||(s.removeData(e,t+"queue "+t+".run",!0),p(e,t,"queue"))}}),s.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length<r?s.queue(this[0],e):n===t?this:this.each(function(){var t=s.queue(this,e,n);e==="fx"&&t[0]!=="inprogress"&&s.dequeue(this,e)})},dequeue:function(e){return this.each(function(){s.dequeue(this,e)})},delay:function(e,t){return e=s.fx?s.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){function h(){--u||r.resolveWith(i,[i])}typeof e!="string"&&(n=e,e=t),e=e||"fx";var r=s.Deferred(),i=this,o=i.length,u=1,a=e+"defer",f=e+"queue",l=e+"mark",c;while(o--)if(c=s.data(i[o],a,t,!0)||(s.data(i[o],f,t,!0)||s.data(i[o],l,t,!0))&&s.data(i[o],a,s.Callbacks("once memory"),!0))u++,c.add(h);return h(),r.promise(n)}});var d=/[\n\t\r]/g,v=/\s+/,m=/\r/g,g=/^(?:button|input)$/i,y=/^(?:button|input|object|select|textarea)$/i,b=/^a(?:rea)?$/i,w=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,E=s.support.getSetAttribute,S,x,T;s.fn.extend({attr:function(e,t){return s.access(this,s.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){s.removeAttr(this,e)})},prop:function(e,t){return s.access(this,s.prop,e,t,arguments.length>1)},removeProp:function(e){return e=s.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,u,a;if(s.isFunction(e))return this.each(function(t){s(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(v);for(n=0,r=this.length;n<r;n++){i=this[n];if(i.nodeType===1)if(!i.className&&t.length===1)i.className=e;else{o=" "+i.className+" ";for(u=0,a=t.length;u<a;u++)~o.indexOf(" "+t[u]+" ")||(o+=t[u]+" ");i.className=s.trim(o)}}}return this},removeClass:function(e){var n,r,i,o,u,a,f;if(s.isFunction(e))return this.each(function(t){s(this).removeClass(e.call(this,t,this.className))});if(e&&typeof e=="string"||e===t){n=(e||"").split(v);for(r=0,i=this.length;r<i;r++){o=this[r];if(o.nodeType===1&&o.className)if(e){u=(" "+o.className+" ").replace(d," ");for(a=0,f=n.length;a<f;a++)u=u.replace(" "+n[a]+" "," ");o.className=s.trim(u)}else o.className=""}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return s.isFunction(e)?this.each(function(n){s(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,o=0,u=s(this),a=t,f=e.split(v);while(i=f[o++])a=r?a:!u.hasClass(i),u[a?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&s._data(this,"__className__",this.className),this.className=this.className||e===!1?"":s._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n<r;n++)if(this[n].nodeType===1&&(" "+this[n].className+" ").replace(d," ").indexOf(t)>-1)return!0;return!1},val:function(e){var n,r,i,o=this[0];if(!arguments.length){if(o)return n=s.valHooks[o.type]||s.valHooks[o.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(o,"value"))!==t?r:(r=o.value,typeof r=="string"?r.replace(m,""):r==null?"":r);return}return i=s.isFunction(e),this.each(function(r){var o=s(this),u;if(this.nodeType!==1)return;i?u=e.call(this,r,o.val()):u=e,u==null?u="":typeof u=="number"?u+="":s.isArray(u)&&(u=s.map(u,function(e){return e==null?"":e+""})),n=s.valHooks[this.type]||s.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,u,"value")===t)this.value=u})}}),s.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r,i,o=e.selectedIndex,u=[],a=e.options,f=e.type==="select-one";if(o<0)return null;n=f?o:0,r=f?o+1:a.length;for(;n<r;n++){i=a[n];if(i.selected&&(s.support.optDisabled?!i.disabled:i.getAttribute("disabled")===null)&&(!i.parentNode.disabled||!s.nodeName(i.parentNode,"optgroup"))){t=s(i).val();if(f)return t;u.push(t)}}return f&&!u.length&&a.length?s(a[o]).val():u},set:function(e,t){var n=s.makeArray(t);return s(e).find("option").each(function(){this.selected=s.inArray(s(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(e,n,r,i){var o,u,a,f=e.nodeType;if(!e||f===3||f===8||f===2)return;if(i&&n in s.attrFn)return s(e)[n](r);if(typeof e.getAttribute=="undefined")return s.prop(e,n,r);a=f!==1||!s.isXMLDoc(e),a&&(n=n.toLowerCase(),u=s.attrHooks[n]||(w.test(n)?x:S));if(r!==t){if(r===null){s.removeAttr(e,n);return}return u&&"set"in u&&a&&(o=u.set(e,r,n))!==t?o:(e.setAttribute(n,""+r),r)}return u&&"get"in u&&a&&(o=u.get(e,n))!==null?o:(o=e.getAttribute(n),o===null?t:o)},removeAttr:function(e,t){var n,r,i,o,u,a=0;if(t&&e.nodeType===1){r=t.toLowerCase().split(v),o=r.length;for(;a<o;a++)i=r[a],i&&(n=s.propFix[i]||i,u=w.test(i),u||s.attr(e,i,""),e.removeAttribute(E?i:n),u&&n in e&&(e[n]=!1))}},attrHooks:{type:{set:function(e,t){if(g.test(e.nodeName)&&e.parentNode)s.error("type property can't be changed");else if(!s.support.radioValue&&t==="radio"&&s.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return S&&s.nodeName(e,"button")?S.get(e,t):t in e?e.value:null},set:function(e,t,n){if(S&&s.nodeName(e,"button"))return S.set(e,t,n);e.value=t}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;return u=a!==1||!s.isXMLDoc(e),u&&(n=s.propFix[n]||n,o=s.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&(i=o.get(e,n))!==null?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):y.test(e.nodeName)||b.test(e.nodeName)&&e.href?0:t}}}}),s.attrHooks.tabindex=s.propHooks.tabIndex,x={get:function(e,n){var r,i=s.prop(e,n);return i===!0||typeof i!="boolean"&&(r=e.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():t},set:function(e,t,n){var r;return t===!1?s.removeAttr(e,n):(r=s.propFix[n]||n,r in e&&(e[r]=!0),e.setAttribute(n,n.toLowerCase())),n}},E||(T={name:!0,id:!0,coords:!0},S=s.valHooks.button={get:function(e,n){var r;return r=e.getAttributeNode(n),r&&(T[n]?r.nodeValue!=="":r.specified)?r.nodeValue:t},set:function(e,t,r){var i=e.getAttributeNode(r);return i||(i=n.createAttribute(r),e.setAttributeNode(i)),i.nodeValue=t+""}},s.attrHooks.tabindex.set=S.set,s.each(["width","height"],function(e,t){s.attrHooks[t]=s.extend(s.attrHooks[t],{set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}})}),s.attrHooks.contenteditable={get:S.get,set:function(e,t,n){t===""&&(t="false"),S.set(e,t,n)}}),s.support.hrefNormalized||s.each(["href","src","width","height"],function(e,n){s.attrHooks[n]=s.extend(s.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return r===null?t:r}})}),s.support.style||(s.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=""+t}}),s.support.optSelected||(s.propHooks.selected=s.extend(s.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),s.support.enctype||(s.propFix.enctype="encoding"),s.support.checkOn||s.each(["radio","checkbox"],function(){s.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}}),s.each(["radio","checkbox"],function(){s.valHooks[this]=s.extend(s.valHooks[this],{set:function(e,t){if(s.isArray(t))return e.checked=s.inArray(s(e).val(),t)>=0}})});var N=/^(?:textarea|input|select)$/i,C=/^([^\.]*)?(?:\.(.+))?$/,k=/(?:^|\s)hover(\.\S+)?\b/,L=/^key/,A=/^(?:mouse|contextmenu)|click/,O=/^(?:focusinfocus|focusoutblur)$/,M=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,_=function(e){var t=M.exec(e);return t&&(t[1]=(t[1]||"").toLowerCase(),t[3]=t[3]&&new RegExp("(?:^|\\s)"+t[3]+"(?:\\s|$)")),t},D=function(e,t){var n=e.attributes||{};return(!t[1]||e.nodeName.toLowerCase()===t[1])&&(!t[2]||(n.id||{}).value===t[2])&&(!t[3]||t[3].test((n["class"]||{}).value))},P=function(e){return s.event.special.hover?e:e.replace(k,"mouseenter$1 mouseleave$1")};s.event={add:function(e,n,r,i,o){var u,a,f,l,c,h,p,d,v,m,g,y;if(e.nodeType===3||e.nodeType===8||!n||!r||!(u=s._data(e)))return;r.handler&&(v=r,r=v.handler,o=v.selector),r.guid||(r.guid=s.guid++),f=u.events,f||(u.events=f={}),a=u.handle,a||(u.handle=a=function(e){return typeof s=="undefined"||!!e&&s.event.triggered===e.type?t:s.event.dispatch.apply(a.elem,arguments)},a.elem=e),n=s.trim(P(n)).split(" ");for(l=0;l<n.length;l++){c=C.exec(n[l])||[],h=c[1],p=(c[2]||"").split(".").sort(),y=s.event.special[h]||{},h=(o?y.delegateType:y.bindType)||h,y=s.event.special[h]||{},d=s.extend({type:h,origType:c[1],data:i,handler:r,guid:r.guid,selector:o,quick:o&&_(o),namespace:p.join(".")},v),g=f[h];if(!g){g=f[h]=[],g.delegateCount=0;if(!y.setup||y.setup.call(e,i,p,a)===!1)e.addEventListener?e.addEventListener(h,a,!1):e.attachEvent&&e.attachEvent("on"+h,a)}y.add&&(y.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),o?g.splice(g.delegateCount++,0,d):g.push(d),s.event.global[h]=!0}e=null},global:{},remove:function(e,t,n,r,i){var o=s.hasData(e)&&s._data(e),u,a,f,l,c,h,p,d,v,m,g,y;if(!o||!(d=o.events))return;t=s.trim(P(t||"")).split(" ");for(u=0;u<t.length;u++){a=C.exec(t[u])||[],f=l=a[1],c=a[2];if(!f){for(f in d)s.event.remove(e,f+t[u],n,r,!0);continue}v=s.event.special[f]||{},f=(r?v.delegateType:v.bindType)||f,g=d[f]||[],h=g.length,c=c?new RegExp("(^|\\.)"+c.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(p=0;p<g.length;p++)y=g[p],(i||l===y.origType)&&(!n||n.guid===y.guid)&&(!c||c.test(y.namespace))&&(!r||r===y.selector||r==="**"&&y.selector)&&(g.splice(p--,1),y.selector&&g.delegateCount--,v.remove&&v.remove.call(e,y));g.length===0&&h!==g.length&&((!v.teardown||v.teardown.call(e,c)===!1)&&s.removeEvent(e,f,o.handle),delete d[f])}s.isEmptyObject(d)&&(m=o.handle,m&&(m.elem=null),s.removeData(e,["events","handle"],!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,i,o){if(!i||i.nodeType!==3&&i.nodeType!==8){var u=n.type||n,a=[],f,l,c,h,p,d,v,m,g,y;if(O.test(u+s.event.triggered))return;u.indexOf("!")>=0&&(u=u.slice(0,-1),l=!0),u.indexOf(".")>=0&&(a=u.split("."),u=a.shift(),a.sort());if((!i||s.event.customEvent[u])&&!s.event.global[u])return;n=typeof n=="object"?n[s.expando]?n:new s.Event(u,n):new s.Event(u),n.type=u,n.isTrigger=!0,n.exclusive=l,n.namespace=a.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+a.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,d=u.indexOf(":")<0?"on"+u:"";if(!i){f=s.cache;for(c in f)f[c].events&&f[c].events[u]&&s.event.trigger(n,r,f[c].handle.elem,!0);return}n.result=t,n.target||(n.target=i),r=r!=null?s.makeArray(r):[],r.unshift(n),v=s.event.special[u]||{};if(v.trigger&&v.trigger.apply(i,r)===!1)return;g=[[i,v.bindType||u]];if(!o&&!v.noBubble&&!s.isWindow(i)){y=v.delegateType||u,h=O.test(y+u)?i:i.parentNode,p=null;for(;h;h=h.parentNode)g.push([h,y]),p=h;p&&p===i.ownerDocument&&g.push([p.defaultView||p.parentWindow||e,y])}for(c=0;c<g.length&&!n.isPropagationStopped();c++)h=g[c][0],n.type=g[c][1],m=(s._data(h,"events")||{})[n.type]&&s._data(h,"handle"),m&&m.apply(h,r),m=d&&h[d],m&&s.acceptData(h)&&m.apply(h,r)===!1&&n.preventDefault();return n.type=u,!o&&!n.isDefaultPrevented()&&(!v._default||v._default.apply(i.ownerDocument,r)===!1)&&(u!=="click"||!s.nodeName(i,"a"))&&s.acceptData(i)&&d&&i[u]&&(u!=="focus"&&u!=="blur"||n.target.offsetWidth!==0)&&!s.isWindow(i)&&(p=i[d],p&&(i[d]=null),s.event.triggered=u,i[u](),s.event.triggered=t,p&&(i[d]=p)),n.result}return},dispatch:function(n){n=s.event.fix(n||e.event);var r=(s._data(this,"events")||{})[n.type]||[],i=r.delegateCount,o=[].slice.call(arguments,0),u=!n.exclusive&&!n.namespace,a=s.event.special[n.type]||{},f=[],l,c,h,p,d,v,m,g,y,b,w;o[0]=n,n.delegateTarget=this;if(a.preDispatch&&a.preDispatch.call(this,n)===!1)return;if(i&&(!n.button||n.type!=="click")){p=s(this),p.context=this.ownerDocument||this;for(h=n.target;h!=this;h=h.parentNode||this)if(h.disabled!==!0){v={},g=[],p[0]=h;for(l=0;l<i;l++)y=r[l],b=y.selector,v[b]===t&&(v[b]=y.quick?D(h,y.quick):p.is(b)),v[b]&&g.push(y);g.length&&f.push({elem:h,matches:g})}}r.length>i&&f.push({elem:this,matches:r.slice(i)});for(l=0;l<f.length&&!n.isPropagationStopped();l++){m=f[l],n.currentTarget=m.elem;for(c=0;c<m.matches.length&&!n.isImmediatePropagationStopped();c++){y=m.matches[c];if(u||!n.namespace&&!y.namespace||n.namespace_re&&n.namespace_re.test(y.namespace))n.data=y.data,n.handleObj=y,d=((s.event.special[y.origType]||{}).handle||y.handler).apply(m.elem,o),d!==t&&(n.result=d,d===!1&&(n.preventDefault(),n.stopPropagation()))}}return a.postDispatch&&a.postDispatch.call(this,n),n.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return e.which==null&&(e.which=t.charCode!=null?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,r){var i,s,o,u=r.button,a=r.fromElement;return e.pageX==null&&r.clientX!=null&&(i=e.target.ownerDocument||n,s=i.documentElement,o=i.body,e.pageX=r.clientX+(s&&s.scrollLeft||o&&o.scrollLeft||0)-(s&&s.clientLeft||o&&o.clientLeft||0),e.pageY=r.clientY+(s&&s.scrollTop||o&&o.scrollTop||0)-(s&&s.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?r.toElement:a),!e.which&&u!==t&&(e.which=u&1?1:u&2?3:u&4?2:0),e}},fix:function(e){if(e[s.expando])return e;var r,i,o=e,u=s.event.fixHooks[e.type]||{},a=u.props?this.props.concat(u.props):this.props;e=s.Event(o);for(r=a.length;r;)i=a[--r],e[i]=o[i];return e.target||(e.target=o.srcElement||n),e.target.nodeType===3&&(e.target=e.target.parentNode),e.metaKey===t&&(e.metaKey=e.ctrlKey),u.filter?u.filter(e,o):e},special:{ready:{setup:s.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){s.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,r){var i=s.extend(new s.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?s.event.trigger(i,null,t):s.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},s.event.handle=s.event.dispatch,s.removeEvent=n.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){e.detachEvent&&e.detachEvent("on"+t,n)},s.Event=function(e,t){if(!(this instanceof s.Event))return new s.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?B:H):this.type=e,t&&s.extend(this,t),this.timeStamp=e&&e.timeStamp||s.now(),this[s.expando]=!0},s.Event.prototype={preventDefault:function(){this.isDefaultPrevented=B;var e=this.originalEvent;if(!e)return;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=B;var e=this.originalEvent;if(!e)return;e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=B,this.stopPropagation()},isDefaultPrevented:H,isPropagationStopped:H,isImmediatePropagationStopped:H},s.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){s.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n=this,r=e.relatedTarget,i=e.handleObj,o=i.selector,u;if(!r||r!==n&&!s.contains(n,r))e.type=i.origType,u=i.handler.apply(this,arguments),e.type=t;return u}}}),s.support.submitBubbles||(s.event.special.submit={setup:function(){if(s.nodeName(this,"form"))return!1;s.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=s.nodeName(n,"input")||s.nodeName(n,"button")?n.form:t;r&&!r._submit_attached&&(s.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),r._submit_attached=!0)})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&s.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(s.nodeName(this,"form"))return!1;s.event.remove(this,"._submit")}}),s.support.changeBubbles||(s.event.special.change={setup:function(){if(N.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")s.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),s.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1,s.event.simulate("change",this,e,!0))});return!1}s.event.add(this,"beforeactivate._change",function(e){var t=e.target;N.test(t.nodeName)&&!t._change_attached&&(s.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&s.event.simulate("change",this.parentNode,e,!0)}),t._change_attached=!0)})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return s.event.remove(this,"._change"),N.test(this.nodeName)}}),s.support.focusinBubbles||s.each({focus:"focusin",blur:"focusout"},function(e,t){var r=0,i=function(e){s.event.simulate(t,e.target,s.event.fix(e),!0)};s.event.special[t]={setup:function(){r++===0&&n.addEventListener(e,i,!0)},teardown:function(){--r===0&&n.removeEventListener(e,i,!0)}}}),s.fn.extend({on:function(e,n,r,i,o){var u,a;if(typeof e=="object"){typeof n!="string"&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}r==null&&i==null?(i=n,r=n=t):i==null&&(typeof n=="string"?(i=r,r=t):(i=r,r=n,n=t));if(i===!1)i=H;else if(!i)return this;return o===1&&(u=i,i=function(e){return s().off(e),u.apply(this,arguments)},i.guid=u.guid||(u.guid=s.guid++)),this.each(function(){s.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){if(e&&e.preventDefault&&e.handleObj){var i=e.handleObj;return s(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this}if(typeof e=="object"){for(var o in e)this.off(o,n,e[o]);return this}if(n===!1||typeof n=="function")r=n,n=t;return r===!1&&(r=H),this.each(function(){s.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return s(this.context).on(e,this.selector,t,n),this},die:function(e,t){return s(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length==1?this.off(e,"**"):this.off(t,e,n)},trigger:function(e,t){return this.each(function(){s.event.trigger(e,t,this)})},triggerHandler:function(e,t){if(this[0])return s.event.trigger(e,t,this[0],!0)},toggle:function(e){var t=arguments,n=e.guid||s.guid++,r=0,i=function(n){var i=(s._data(this,"lastToggle"+e.guid)||0)%r;return s._data(this,"lastToggle"+e.guid,i+1),n.preventDefault(),t[i].apply(this,arguments)||!1};i.guid=n;while(r<t.length)t[r++].guid=n;return this.click(i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),s.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){s.fn[t]=function(e,n){return n==null&&(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},s.attrFn&&(s.attrFn[t]=!0),L.test(t)&&(s.event.fixHooks[t]=s.event.keyHooks),A.test(t)&&(s.event.fixHooks[t]=s.event.mouseHooks)}),function(){function S(e,t,n,i,s,o){for(var u=0,a=i.length;u<a;u++){var f=i[u];if(f){var l=!1;f=f[e];while(f){if(f[r]===n){l=i[f.sizset];break}f.nodeType===1&&!o&&(f[r]=n,f.sizset=u);if(f.nodeName.toLowerCase()===t){l=f;break}f=f[e]}i[u]=l}}}function x(e,t,n,i,s,o){for(var u=0,a=i.length;u<a;u++){var f=i[u];if(f){var l=!1;f=f[e];while(f){if(f[r]===n){l=i[f.sizset];break}if(f.nodeType===1){o||(f[r]=n,f.sizset=u);if(typeof t!="string"){if(f===t){l=!0;break}}else if(h.filter(t,[f]).length>0){l=f;break}}f=f[e]}i[u]=l}}}var e=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,r="sizcache"+(Math.random()+"").replace(".",""),i=0,o=Object.prototype.toString,u=!1,a=!0,f=/\\/g,l=/\r\n/g,c=/\W/;[0,0].sort(function(){return a=!1,0});var h=function(t,r,i,s){i=i||[],r=r||n;var u=r;if(r.nodeType!==1&&r.nodeType!==9)return[];if(!t||typeof t!="string")return i;var a,f,l,c,p,m,g,b,w=!0,E=h.isXML(r),S=[],x=t;do{e.exec(""),a=e.exec(x);if(a){x=a[3],S.push(a[1]);if(a[2]){c=a[3];break}}}while(a);if(S.length>1&&v.exec(t))if(S.length===2&&d.relative[S[0]])f=T(S[0]+S[1],r,s);else{f=d.relative[S[0]]?[r]:h(S.shift(),r);while(S.length)t=S.shift(),d.relative[t]&&(t+=S.shift()),f=T(t,f,s)}else{!s&&S.length>1&&r.nodeType===9&&!E&&d.match.ID.test(S[0])&&!d.match.ID.test(S[S.length-1])&&(p=h.find(S.shift(),r,E),r=p.expr?h.filter(p.expr,p.set)[0]:p.set[0]);if(r){p=s?{expr:S.pop(),set:y(s)}:h.find(S.pop(),S.length!==1||S[0]!=="~"&&S[0]!=="+"||!r.parentNode?r:r.parentNode,E),f=p.expr?h.filter(p.expr,p.set):p.set,S.length>0?l=y(f):w=!1;while(S.length)m=S.pop(),g=m,d.relative[m]?g=S.pop():m="",g==null&&(g=r),d.relative[m](l,g,E)}else l=S=[]}l||(l=f),l||h.error(m||t);if(o.call(l)==="[object Array]")if(!w)i.push.apply(i,l);else if(r&&r.nodeType===1)for(b=0;l[b]!=null;b++)l[b]&&(l[b]===!0||l[b].nodeType===1&&h.contains(r,l[b]))&&i.push(f[b]);else for(b=0;l[b]!=null;b++)l[b]&&l[b].nodeType===1&&i.push(f[b]);else y(l,i);return c&&(h(c,u,i,s),h.uniqueSort(i)),i};h.uniqueSort=function(e){if(w){u=a,e.sort(w);if(u)for(var t=1;t<e.length;t++)e[t]===e[t-1]&&e.splice(t--,1)}return e},h.matches=function(e,t){return h(e,null,null,t)},h.matchesSelector=function(e,t){return h(t,null,null,[e]).length>0},h.find=function(e,t,n){var r,i,s,o,u,a;if(!e)return[];for(i=0,s=d.order.length;i<s;i++){u=d.order[i];if(o=d.leftMatch[u].exec(e)){a=o[1],o.splice(1,1);if(a.substr(a.length-1)!=="\\"){o[1]=(o[1]||"").replace(f,""),r=d.find[u](o,t,n);if(r!=null){e=e.replace(d.match[u],"");break}}}}return r||(r=typeof t.getElementsByTagName!="undefined"?t.getElementsByTagName("*"):[]),{set:r,expr:e}},h.filter=function(e,n,r,i){var s,o,u,a,f,l,c,p,v,m=e,g=[],y=n,b=n&&n[0]&&h.isXML(n[0]);while(e&&n.length){for(u in d.filter)if((s=d.leftMatch[u].exec(e))!=null&&s[2]){l=d.filter[u],c=s[1],o=!1,s.splice(1,1);if(c.substr(c.length-1)==="\\")continue;y===g&&(g=[]);if(d.preFilter[u]){s=d.preFilter[u](s,y,r,g,i,b);if(!s)o=a=!0;else if(s===!0)continue}if(s)for(p=0;(f=y[p])!=null;p++)f&&(a=l(f,s,p,y),v=i^a,r&&a!=null?v?o=!0:y[p]=!1:v&&(g.push(f),o=!0));if(a!==t){r||(y=g),e=e.replace(d.match[u],"");if(!o)return[];break}}if(e===m){if(o!=null)break;h.error(e)}m=e}return y},h.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)};var p=h.getText=function(e){var t,n,r=e.nodeType,i="";if(r){if(r===1||r===9||r===11){if(typeof e.textContent=="string")return e.textContent;if(typeof e.innerText=="string")return e.innerText.replace(l,"");for(e=e.firstChild;e;e=e.nextSibling)i+=p(e)}else if(r===3||r===4)return e.nodeValue}else for(t=0;n=e[t];t++)n.nodeType!==8&&(i+=p(n));return i},d=h.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")},type:function(e){return e.getAttribute("type")}},relative:{"+":function(e,t){var n=typeof t=="string",r=n&&!c.test(t),i=n&&!r;r&&(t=t.toLowerCase());for(var s=0,o=e.length,u;s<o;s++)if(u=e[s]){while((u=u.previousSibling)&&u.nodeType!==1);e[s]=i||u&&u.nodeName.toLowerCase()===t?u||!1:u===t}i&&h.filter(t,e,!0)},">":function(e,t){var n,r=typeof t=="string",i=0,s=e.length;if(r&&!c.test(t)){t=t.toLowerCase();for(;i<s;i++){n=e[i];if(n){var o=n.parentNode;e[i]=o.nodeName.toLowerCase()===t?o:!1}}}else{for(;i<s;i++)n=e[i],n&&(e[i]=r?n.parentNode:n.parentNode===t);r&&h.filter(t,e,!0)}},"":function(e,t,n){var r,s=i++,o=x;typeof t=="string"&&!c.test(t)&&(t=t.toLowerCase(),r=t,o=S),o("parentNode",t,s,e,r,n)},"~":function(e,t,n){var r,s=i++,o=x;typeof t=="string"&&!c.test(t)&&(t=t.toLowerCase(),r=t,o=S),o("previousSibling",t,s,e,r,n)}},find:{ID:function(e,t,n){if(typeof t.getElementById!="undefined"&&!n){var r=t.getElementById(e[1]);return r&&r.parentNode?[r]:[]}},NAME:function(e,t){if(typeof t.getElementsByName!="undefined"){var n=[],r=t.getElementsByName(e[1]);for(var i=0,s=r.length;i<s;i++)r[i].getAttribute("name")===e[1]&&n.push(r[i]);return n.length===0?null:n}},TAG:function(e,t){if(typeof t.getElementsByTagName!="undefined")return t.getElementsByTagName(e[1])}},preFilter:{CLASS:function(e,t,n,r,i,s){e=" "+e[1].replace(f,"")+" ";if(s)return e;for(var o=0,u;(u=t[o])!=null;o++)u&&(i^(u.className&&(" "+u.className+" ").replace(/[\t\n\r]/g," ").indexOf(e)>=0)?n||r.push(u):n&&(t[o]=!1));return!1},ID:function(e){return e[1].replace(f,"")},TAG:function(e,t){return e[1].replace(f,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){e[2]||h.error(e[0]),e[2]=e[2].replace(/^\+|\s*/g,"");var t=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=t[1]+(t[2]||1)-0,e[3]=t[3]-0}else e[2]&&h.error(e[0]);return e[0]=i++,e},ATTR:function(e,t,n,r,i,s){var o=e[1]=e[1].replace(f,"");return!s&&d.attrMap[o]&&(e[1]=d.attrMap[o]),e[4]=(e[4]||e[5]||"").replace(f,""),e[2]==="~="&&(e[4]=" "+e[4]+" "),e},PSEUDO:function(t,n,r,i,s){if(t[1]==="not"){if(!((e.exec(t[3])||"").length>1||/^\w/.test(t[3]))){var o=h.filter(t[3],n,r,!0^s);return r||i.push.apply(i,o),!1}t[3]=h(t[3],null,null,n)}else if(d.match.POS.test(t[0])||d.match.CHILD.test(t[0]))return!0;return t},POS:function(e){return e.unshift(!0),e}},filters:{enabled:function(e){return e.disabled===!1&&e.type!=="hidden"},disabled:function(e){return e.disabled===!0},checked:function(e){return e.checked===!0},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!!e.firstChild},empty:function(e){return!e.firstChild},has:function(e,t,n){return!!h(n[3],e).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){var t=e.getAttribute("type"),n=e.type;return e.nodeName.toLowerCase()==="input"&&"text"===n&&(t===n||t===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(e){var t=e.nodeName.toLowerCase();return(t==="input"||t==="button")&&"submit"===e.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(e){var t=e.nodeName.toLowerCase();return(t==="input"||t==="button")&&"reset"===e.type},button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&"button"===e.type||t==="button"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(e,t){return t===0},last:function(e,t,n,r){return t===r.length-1},even:function(e,t){return t%2===0},odd:function(e,t){return t%2===1},lt:function(e,t,n){return t<n[3]-0},gt:function(e,t,n){return t>n[3]-0},nth:function(e,t,n){return n[3]-0===t},eq:function(e,t,n){return n[3]-0===t}},filter:{PSEUDO:function(e,t,n,r){var i=t[1],s=d.filters[i];if(s)return s(e,n,t,r);if(i==="contains")return(e.textContent||e.innerText||p([e])||"").indexOf(t[3])>=0;if(i==="not"){var o=t[3];for(var u=0,a=o.length;u<a;u++)if(o[u]===e)return!1;return!0}h.error(i)},CHILD:function(e,t){var n,i,s,o,u,a,f,l=t[1],c=e;switch(l){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(l==="first")return!0;c=e;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0;case"nth":n=t[2],i=t[3];if(n===1&&i===0)return!0;s=t[0],o=e.parentNode;if(o&&(o[r]!==s||!e.nodeIndex)){a=0;for(c=o.firstChild;c;c=c.nextSibling)c.nodeType===1&&(c.nodeIndex=++a);o[r]=s}return f=e.nodeIndex-i,n===0?f===0:f%n===0&&f/n>=0}},ID:function(e,t){return e.nodeType===1&&e.getAttribute("id")===t},TAG:function(e,t){return t==="*"&&e.nodeType===1||!!e.nodeName&&e.nodeName.toLowerCase()===t},CLASS:function(e,t){return(" "+(e.className||e.getAttribute("class"))+" ").indexOf(t)>-1},ATTR:function(e,t){var n=t[1],r=h.attr?h.attr(e,n):d.attrHandle[n]?d.attrHandle[n](e):e[n]!=null?e[n]:e.getAttribute(n),i=r+"",s=t[2],o=t[4];return r==null?s==="!=":!s&&h.attr?r!=null:s==="="?i===o:s==="*="?i.indexOf(o)>=0:s==="~="?(" "+i+" ").indexOf(o)>=0:o?s==="!="?i!==o:s==="^="?i.indexOf(o)===0:s==="$="?i.substr(i.length-o.length)===o:s==="|="?i===o||i.substr(0,o.length+1)===o+"-":!1:i&&r!==!1},POS:function(e,t,n,r){var i=t[2],s=d.setFilters[i];if(s)return s(e,n,t,r)}}},v=d.match.POS,m=function(e,t){return"\\"+(t-0+1)};for(var g in d.match)d.match[g]=new RegExp(d.match[g].source+/(?![^\[]*\])(?![^\(]*\))/.source),d.leftMatch[g]=new RegExp(/(^(?:.|\r|\n)*?)/.source+d.match[g].source.replace(/\\(\d+)/g,m));d.match.globalPOS=v;var y=function(e,t){return e=Array.prototype.slice.call(e,0),t?(t.push.apply(t,e),t):e};try{Array.prototype.slice.call(n.documentElement.childNodes,0)[0].nodeType}catch(b){y=function(e,t){var n=0,r=t||[];if(o.call(e)==="[object Array]")Array.prototype.push.apply(r,e);else if(typeof e.length=="number")for(var i=e.length;n<i;n++)r.push(e[n]);else for(;e[n];n++)r.push(e[n]);return r}}var w,E;n.documentElement.compareDocumentPosition?w=function(e,t){return e===t?(u=!0,0):!e.compareDocumentPosition||!t.compareDocumentPosition?e.compareDocumentPosition?-1:1:e.compareDocumentPosition(t)&4?-1:1}:(w=function(e,t){if(e===t)return u=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,r,i=[],s=[],o=e.parentNode,a=t.parentNode,f=o;if(o===a)return E(e,t);if(!o)return-1;if(!a)return 1;while(f)i.unshift(f),f=f.parentNode;f=a;while(f)s.unshift(f),f=f.parentNode;n=i.length,r=s.length;for(var l=0;l<n&&l<r;l++)if(i[l]!==s[l])return E(i[l],s[l]);return l===n?E(e,s[l],-1):E(i[l],t,1)},E=function(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}),function(){var e=n.createElement("div"),r="script"+(new Date).getTime(),i=n.documentElement;e.innerHTML="<a name='"+r+"'/>",i.insertBefore(e,i.firstChild),n.getElementById(r)&&(d.find.ID=function(e,n,r){if(typeof n.getElementById!="undefined"&&!r){var i=n.getElementById(e[1]);return i?i.id===e[1]||typeof i.getAttributeNode!="undefined"&&i.getAttributeNode("id").nodeValue===e[1]?[i]:t:[]}},d.filter.ID=function(e,t){var n=typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id");return e.nodeType===1&&n&&n.nodeValue===t}),i.removeChild(e),i=e=null}(),function(){var e=n.createElement("div");e.appendChild(n.createComment("")),e.getElementsByTagName("*").length>0&&(d.find.TAG=function(e,t){var n=t.getElementsByTagName(e[1]);if(e[1]==="*"){var r=[];for(var i=0;n[i];i++)n[i].nodeType===1&&r.push(n[i]);n=r}return n}),e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!="undefined"&&e.firstChild.getAttribute("href")!=="#"&&(d.attrHandle.href=function(e){return e.getAttribute("href",2)}),e=null}(),n.querySelectorAll&&function(){var e=h,t=n.createElement("div"),r="__sizzle__";t.innerHTML="<p class='TEST'></p>";if(t.querySelectorAll&&t.querySelectorAll(".TEST").length===0)return;h=function(t,i,s,o){i=i||n;if(!o&&!h.isXML(i)){var u=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(t);if(u&&(i.nodeType===1||i.nodeType===9)){if(u[1])return y(i.getElementsByTagName(t),s);if(u[2]&&d.find.CLASS&&i.getElementsByClassName)return y(i.getElementsByClassName(u[2]),s)}if(i.nodeType===9){if(t==="body"&&i.body)return y([i.body],s);if(u&&u[3]){var a=i.getElementById(u[3]);if(!a||!a.parentNode)return y([],s);if(a.id===u[3])return y([a],s)}try{return y(i.querySelectorAll(t),s)}catch(f){}}else if(i.nodeType===1&&i.nodeName.toLowerCase()!=="object"){var l=i,c=i.getAttribute("id"),p=c||r,v=i.parentNode,m=/^\s*[+~]/.test(t);c?p=p.replace(/'/g,"\\$&"):i.setAttribute("id",p),m&&v&&(i=i.parentNode);try{if(!m||v)return y(i.querySelectorAll("[id='"+p+"'] "+t),s)}catch(g){}finally{c||l.removeAttribute("id")}}}return e(t,i,s,o)};for(var i in e)h[i]=e[i];t=null}(),function(){var e=n.documentElement,t=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(t){var r=!t.call(n.createElement("div"),"div"),i=!1;try{t.call(n.documentElement,"[test!='']:sizzle")}catch(s){i=!0}h.matchesSelector=function(e,n){n=n.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!h.isXML(e))try{if(i||!d.match.PSEUDO.test(n)&&!/!=/.test(n)){var s=t.call(e,n);if(s||!r||e.document&&e.document.nodeType!==11)return s}}catch(o){}return h(n,null,null,[e]).length>0}}}(),function(){var e=n.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0)return;e.lastChild.className="e";if(e.getElementsByClassName("e").length===1)return;d.order.splice(1,0,"CLASS"),d.find.CLASS=function(e,t,n){if(typeof t.getElementsByClassName!="undefined"&&!n)return t.getElementsByClassName(e[1])},e=null}(),n.documentElement.contains?h.contains=function(e,t){return e!==t&&(e.contains?e.contains(t):!0)}:n.documentElement.compareDocumentPosition?h.contains=function(e,t){return!!(e.compareDocumentPosition(t)&16)}:h.contains=function(){return!1},h.isXML=function(e){var t=(e?e.ownerDocument||e:0).documentElement;return t?t.nodeName!=="HTML":!1};var T=function(e,t,n){var r,i=[],s="",o=t.nodeType?[t]:t;while(r=d.match.PSEUDO.exec(e))s+=r[0],e=e.replace(d.match.PSEUDO,"");e=d.relative[e]?e+"*":e;for(var u=0,a=o.length;u<a;u++)h(e,o[u],i,n);return h.filter(s,i)};h.attr=s.attr,h.selectors.attrMap={},s.find=h,s.expr=h.selectors,s.expr[":"]=s.expr.filters,s.unique=h.uniqueSort,s.text=h.getText,s.isXMLDoc=h.isXML,s.contains=h.contains}();var j=/Until$/,F=/^(?:parents|prevUntil|prevAll)/,I=/,/,q=/^.[^:#\[\.,]*$/,R=Array.prototype.slice,U=s.expr.match.globalPOS,z={children:!0,contents:!0,next:!0,prev:!0};s.fn.extend({find:function(e){var t=this,n,r;if(typeof e!="string")return s(e).filter(function(){for(n=0,r=t.length;n<r;n++)if(s.contains(t[n],this))return!0});var i=this.pushStack("","find",e),o,u,a;for(n=0,r=this.length;n<r;n++){o=i.length,s.find(e,this[n],i);if(n>0)for(u=o;u<i.length;u++)for(a=0;a<o;a++)if(i[a]===i[u]){i.splice(u--,1);break}}return i},has:function(e){var t=s(e);return this.filter(function(){for(var e=0,n=t.length;e<n;e++)if(s.contains(this,t[e]))return!0})},not:function(e){return this.pushStack(X(this,e,!1),"not",e)},filter:function(e){return this.pushStack(X(this,e,!0),"filter",e)},is:function(e){return!!e&&(typeof e=="string"?U.test(e)?s(e,this.context).index(this[0])>=0:s.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n=[],r,i,o=this[0];if(s.isArray(e)){var u=1;while(o&&o.ownerDocument&&o!==t){for(r=0;r<e.length;r++)s(o).is(e[r])&&n.push({selector:e[r],elem:o,level:u});o=o.parentNode,u++}return n}var a=U.test(e)||typeof e!="string"?s(e,t||this.context):0;for(r=0,i=this.length;r<i;r++){o=this[r];while(o){if(a?a.index(o)>-1:s.find.matchesSelector(o,e)){n.push(o);break}o=o.parentNode;if(!o||!o.ownerDocument||o===t||o.nodeType===11)break}}return n=n.length>1?s.unique(n):n,this.pushStack(n,"closest",e)},index:function(e){return e?typeof e=="string"?s.inArray(this[0],s(e)):s.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?s(e,t):s.makeArray(e&&e.nodeType?[e]:e),r=s.merge(this.get(),n);return this.pushStack(W(n[0])||W(r[0])?r:s.unique(r))},andSelf:function(){return this.add(this.prevObject)}}),s.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return s.dir(e,"parentNode")},parentsUntil:function(e,t,n){return s.dir(e,"parentNode",n)},next:function(e){return s.nth(e,2,"nextSibling")},prev:function(e){return s.nth(e,2,"previousSibling")},nextAll:function(e){return s.dir(e,"nextSibling")},prevAll:function(e){return s.dir(e,"previousSibling")},nextUntil:function(e,t,n){return s.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return s.dir(e,"previousSibling",n)},siblings:function(e){return s.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return s.sibling(e.firstChild)},contents:function(e){return s.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:s.makeArray(e.childNodes)}},function(e,t){s.fn[e]=function(n,r){var i=s.map(this,t,n);return j.test(e)||(r=n),r&&typeof r=="string"&&(i=s.filter(r,i)),i=this.length>1&&!z[e]?s.unique(i):i,(this.length>1||I.test(r))&&F.test(e)&&(i=i.reverse()),this.pushStack(i,e,R.call(arguments).join(","))}}),s.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?s.find.matchesSelector(t[0],e)?[t[0]]:[]:s.find.matches(e,t)},dir:function(e,n,r){var i=[],o=e[n];while(o&&o.nodeType!==9&&(r===t||o.nodeType!==1||!s(o).is(r)))o.nodeType===1&&i.push(o),o=o[n];return i},nth:function(e,t,n,r){t=t||1;var i=0;for(;e;e=e[n])if(e.nodeType===1&&++i===t)break;return e},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var $="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",J=/ jQuery\d+="(?:\d+|null)"/g,K=/^\s+/,Q=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,G=/<([\w:]+)/,Y=/<tbody/i,Z=/<|&#?\w+;/,et=/<(?:script|style)/i,tt=/<(?:script|object|embed|option|style)/i,nt=new RegExp("<(?:"+$+")[\\s/>]","i"),rt=/checked\s*(?:[^=]|=\s*.checked.)/i,it=/\/(java|ecma)script/i,st=/^\s*<!(?:\[CDATA\[|\-\-)/,ot={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},ut=V(n);ot.optgroup=ot.option,ot.tbody=ot.tfoot=ot.colgroup=ot.caption=ot.thead,ot.th=ot.td,s.support.htmlSerialize||(ot._default=[1,"div<div>","</div>"]),s.fn.extend({text:function(e){return s.access(this,function(e){return e===t?s.text(this):this.empty().append((this[0]&&this[0].ownerDocument||n).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(s.isFunction(e))return this.each(function(t){s(this).wrapAll(e.call(this,t))});if(this[0]){var t=s(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return s.isFunction(e)?this.each(function(t){s(this).wrapInner(e.call(this,t))}):this.each(function(){var t=s(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=s.isFunction(e);return this.each(function(n){s(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){s.nodeName(this,"body")||s(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){this.nodeType===1&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){this.nodeType===1&&this.insertBefore(e,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=s.clean(arguments);return e.push.apply(e,this.toArray()),this.pushStack(e,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=this.pushStack(this,"after",arguments);return e.push.apply(e,s.clean(arguments)),e}},remove:function(e,t){for(var n=0,r;(r=this[n])!=null;n++)if(!e||s.filter(e,[r]).length)!t&&r.nodeType===1&&(s.cleanData(r.getElementsByTagName("*")),s.cleanData([r])),r.parentNode&&r.parentNode.removeChild(r);return this},empty:function(){for(var e=0,t;(t=this[e])!=null;e++){t.nodeType===1&&s.cleanData(t.getElementsByTagName("*"));while(t.firstChild)t.removeChild(t.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return s.clone(this,e,t)})},html:function(e){return s.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(J,""):null;if(typeof e=="string"&&!et.test(e)&&(s.support.leadingWhitespace||!K.test(e))&&!ot[(G.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(Q,"<$1></$2>");try{for(;r<i;r++)n=this[r]||{},n.nodeType===1&&(s.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return this[0]&&this[0].parentNode?s.isFunction(e)?this.each(function(t){var n=s(this),r=n.html();n.replaceWith(e.call(this,t,r))}):(typeof e!="string"&&(e=s(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;s(this).remove(),t?s(t).before(e):s(n).append(e)})):this.length?this.pushStack(s(s.isFunction(e)?e():e),"replaceWith",e):this},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){var i,o,u,a,f=e[0],l=[];if(!s.support.checkClone&&arguments.length===3&&typeof f=="string"&&rt.test(f))return this.each(function(){s(this).domManip(e,n,r,!0)});if(s.isFunction(f))return this.each(function(i){var o=s(this);e[0]=f.call(this,i,n?o.html():t),o.domManip(e,n,r)});if(this[0]){a=f&&f.parentNode,s.support.parentNode&&a&&a.nodeType===11&&a.childNodes.length===this.length?i={fragment:a}:i=s.buildFragment(e,this,l),u=i.fragment,u.childNodes.length===1?o=u=u.firstChild:o=u.firstChild;if(o){n=n&&s.nodeName(o,"tr");for(var c=0,h=this.length,p=h-1;c<h;c++)r.call(n?at(this[c],o):this[c],i.cacheable||h>1&&c<p?s.clone(u,!0,!0):u)}l.length&&s.each(l,function(e,t){t.src?s.ajax({type:"GET",global:!1,url:t.src,async:!1,dataType:"script"}):s.globalEval((t.text||t.textContent||t.innerHTML||"").replace(st,"/*$0*/")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),s.buildFragment=function(e,t,r){var i,o,u,a,f=e[0];return t&&t[0]&&(a=t[0].ownerDocument||t[0]),a.createDocumentFragment||(a=n),e.length===1&&typeof f=="string"&&f.length<512&&a===n&&f.charAt(0)==="<"&&!tt.test(f)&&(s.support.checkClone||!rt.test(f))&&(s.support.html5Clone||!nt.test(f))&&(o=!0,u=s.fragments[f],u&&u!==1&&(i=u)),i||(i=a.createDocumentFragment(),s.clean(e,a,i,r)),o&&(s.fragments[f]=u?i:1),{fragment:i,cacheable:o}},s.fragments={},s.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){s.fn[e]=function(n){var r=[],i=s(n),o=this.length===1&&this[0].parentNode;if(o&&o.nodeType===11&&o.childNodes.length===1&&i.length===1)return i[t](this[0]),this;for(var u=0,a=i.length;u<a;u++){var f=(u>0?this.clone(!0):this).get();s(i[u])[t](f),r=r.concat(f)}return this.pushStack(r,e,i.selector)}}),s.extend({clone:function(e,t,n){var r,i,o,u=s.support.html5Clone||s.isXMLDoc(e)||!nt.test("<"+e.nodeName+">")?e.cloneNode(!0):dt(e);if((!s.support.noCloneEvent||!s.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!s.isXMLDoc(e)){lt(e,u),r=ct(e),i=ct(u);for(o=0;r[o];++o)i[o]&<(r[o],i[o])}if(t){ft(e,u);if(n){r=ct(e),i=ct(u);for(o=0;r[o];++o)ft(r[o],i[o])}}return r=i=null,u},clean:function(e,t,r,i){var o,u,a,f=[];t=t||n,typeof t.createElement=="undefined"&&(t=t.ownerDocument||t[0]&&t[0].ownerDocument||n);for(var l=0,c;(c=e[l])!=null;l++){typeof c=="number"&&(c+="");if(!c)continue;if(typeof c=="string")if(!Z.test(c))c=t.createTextNode(c);else{c=c.replace(Q,"<$1></$2>");var h=(G.exec(c)||["",""])[1].toLowerCase(),p=ot[h]||ot._default,d=p[0],v=t.createElement("div"),m=ut.childNodes,g;t===n?ut.appendChild(v):V(t).appendChild(v),v.innerHTML=p[1]+c+p[2];while(d--)v=v.lastChild;if(!s.support.tbody){var y=Y.test(c),b=h==="table"&&!y?v.firstChild&&v.firstChild.childNodes:p[1]==="<table>"&&!y?v.childNodes:[];for(a=b.length-1;a>=0;--a)s.nodeName(b[a],"tbody")&&!b[a].childNodes.length&&b[a].parentNode.removeChild(b[a])}!s.support.leadingWhitespace&&K.test(c)&&v.insertBefore(t.createTextNode(K.exec(c)[0]),v.firstChild),c=v.childNodes,v&&(v.parentNode.removeChild(v),m.length>0&&(g=m[m.length-1],g&&g.parentNode&&g.parentNode.removeChild(g)))}var w;if(!s.support.appendChecked)if(c[0]&&typeof (w=c.length)=="number")for(a=0;a<w;a++)pt(c[a]);else pt(c);c.nodeType?f.push(c):f=s.merge(f,c)}if(r){o=function(e){return!e.type||it.test(e.type)};for(l=0;f[l];l++){u=f[l];if(i&&s.nodeName(u,"script")&&(!u.type||it.test(u.type)))i.push(u.parentNode?u.parentNode.removeChild(u):u);else{if(u.nodeType===1){var E=s.grep(u.getElementsByTagName("script"),o);f.splice.apply(f,[l+1,0].concat(E))}r.appendChild(u)}}}return f},cleanData:function(e){var t,n,r=s.cache,i=s.event.special,o=s.support.deleteExpando;for(var u=0,a;(a=e[u])!=null;u++){if(a.nodeName&&s.noData[a.nodeName.toLowerCase()])continue;n=a[s.expando];if(n){t=r[n];if(t&&t.events){for(var f in t.events)i[f]?s.event.remove(a,f):s.removeEvent(a,f,t.handle);t.handle&&(t.handle.elem=null)}o?delete a[s.expando]:a.removeAttribute&&a.removeAttribute(s.expando),delete r[n]}}}});var vt=/alpha\([^)]*\)/i,mt=/opacity=([^)]*)/,gt=/([A-Z]|^ms)/g,yt=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,wt=/^([\-+])=([\-+.\de]+)/,Et=/^margin/,St={position:"absolute",visibility:"hidden",display:"block"},xt=["Top","Right","Bottom","Left"],Tt,Nt,Ct;s.fn.css=function(e,n){return s.access(this,function(e,n,r){return r!==t?s.style(e,n,r):s.css(e,n)},e,n,arguments.length>1)},s.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Tt(e,"opacity");return n===""?"1":n}return e.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":s.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var o,u,a=s.camelCase(n),f=e.style,l=s.cssHooks[a];n=s.cssProps[a]||a;if(r===t)return l&&"get"in l&&(o=l.get(e,!1,i))!==t?o:f[n];u=typeof r,u==="string"&&(o=wt.exec(r))&&(r=+(o[1]+1)*+o[2]+parseFloat(s.css(e,n)),u="number");if(r==null||u==="number"&&isNaN(r))return;u==="number"&&!s.cssNumber[a]&&(r+="px");if(!l||!("set"in l)||(r=l.set(e,r))!==t)try{f[n]=r}catch(c){}},css:function(e,n,r){var i,o;n=s.camelCase(n),o=s.cssHooks[n],n=s.cssProps[n]||n,n==="cssFloat"&&(n="float");if(o&&"get"in o&&(i=o.get(e,!0,r))!==t)return i;if(Tt)return Tt(e,n)},swap:function(e,t,n){var r={},i,s;for(s in t)r[s]=e.style[s],e.style[s]=t[s];i=n.call(e);for(s in t)e.style[s]=r[s];return i}}),s.curCSS=s.css,n.defaultView&&n.defaultView.getComputedStyle&&(Nt=function(e,t){var n,r,i,o,u=e.style;return t=t.replace(gt,"-$1").toLowerCase(),(r=e.ownerDocument.defaultView)&&(i=r.getComputedStyle(e,null))&&(n=i.getPropertyValue(t),n===""&&!s.contains(e.ownerDocument.documentElement,e)&&(n=s.style(e,t))),!s.support.pixelMargin&&i&&Et.test(t)&&bt.test(n)&&(o=u.width,u.width=n,n=i.width,u.width=o),n}),n.documentElement.currentStyle&&(Ct=function(e,t){var n,r,i,s=e.currentStyle&&e.currentStyle[t],o=e.style;return s==null&&o&&(i=o[t])&&(s=i),bt.test(s)&&(n=o.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),o.left=t==="fontSize"?"1em":s,s=o.pixelLeft+"px",o.left=n,r&&(e.runtimeStyle.left=r)),s===""?"auto":s}),Tt=Nt||Ct,s.each(["height","width"],function(e,t){s.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth!==0?kt(e,t,r):s.swap(e,St,function(){return kt(e,t,r)})},set:function(e,t){return yt.test(t)?t+"px":t}}}),s.support.opacity||(s.cssHooks.opacity={get:function(e,t){return mt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?parseFloat(RegExp.$1)/100+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=s.isNumeric(t)?"alpha(opacity="+t*100+")":"",o=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&s.trim(o.replace(vt,""))===""){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=vt.test(o)?o.replace(vt,i):o+" "+i}}),s(function(){s.support.reliableMarginRight||(s.cssHooks.marginRight={get:function(e,t){return s.swap(e,{display:"inline-block"},function(){return t?Tt(e,"margin-right"):e.style.marginRight})}})}),s.expr&&s.expr.filters&&(s.expr.filters.hidden=function(e){var t=e.offsetWidth,n=e.offsetHeight;return t===0&&n===0||!s.support.reliableHiddenOffsets&&(e.style&&e.style.display||s.css(e,"display"))==="none"},s.expr.filters.visible=function(e){return!s.expr.filters.hidden(e)}),s.each({margin:"",padding:"",border:"Width"},function(e,t){s.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+xt[r]+t]=i[r]||i[r-2]||i[0];return s}}});var Lt=/%20/g,At=/\[\]$/,Ot=/\r?\n/g,Mt=/#.*$/,_t=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,Dt=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Pt=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Ht=/^(?:GET|HEAD)$/,Bt=/^\/\//,jt=/\?/,Ft=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,It=/^(?:select|textarea)/i,qt=/\s+/,Rt=/([?&])_=[^&]*/,Ut=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,zt=s.fn.load,Wt={},Xt={},Vt,$t,Jt=["*/"]+["*"];try{Vt=i.href}catch(Kt){Vt=n.createElement("a"),Vt.href="",Vt=Vt.href}$t=Ut.exec(Vt.toLowerCase())||[],s.fn.extend({load:function(e,n,r){if(typeof e!="string"&&zt)return zt.apply(this,arguments);if(!this.length)return this;var i=e.indexOf(" ");if(i>=0){var o=e.slice(i,e.length);e=e.slice(0,i)}var u="GET";n&&(s.isFunction(n)?(r=n,n=t):typeof n=="object"&&(n=s.param(n,s.ajaxSettings.traditional),u="POST"));var a=this;return s.ajax({url:e,type:u,dataType:"html",data:n,complete:function(e,t,n){n=e.responseText,e.isResolved()&&(e.done(function(e){n=e}),a.html(o?s("<div>").append(n.replace(Ft,"")).find(o):n)),r&&a.each(r,[n,t,e])}}),this},serialize:function(){return s.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?s.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||It.test(this.nodeName)||Dt.test(this.type))}).map(function(e,t){var n=s(this).val();return n==null?null:s.isArray(n)?s.map(n,function(e,n){return{name:t.name,value:e.replace(Ot,"\r\n")}}):{name:t.name,value:n.replace(Ot,"\r\n")}}).get()}}),s.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){s.fn[t]=function(e){return this.on(t,e)}}),s.each(["get","post"],function(e,n){s[n]=function(e,r,i,o){return s.isFunction(r)&&(o=o||i,i=r,r=t),s.ajax({type:n,url:e,data:r,success:i,dataType:o})}}),s.extend({getScript:function(e,n){return s.get(e,t,n,"script")},getJSON:function(e,t,n){return s.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Yt(e,s.ajaxSettings):(t=e,e=s.ajaxSettings),Yt(e,t),e},ajaxSettings:{url:Vt,isLocal:Pt.test($t[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Jt},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":s.parseJSON,"text xml":s.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Qt(Wt),ajaxTransport:Qt(Xt),ajax:function(e,n){function S(e,n,c,h){if(y===2)return;y=2,m&&clearTimeout(m),v=t,p=h||"",E.readyState=e>0?4:0;var d,g,w,S=n,x=c?en(r,E,c):t,T,N;if(e>=200&&e<300||e===304){if(r.ifModified){if(T=E.getResponseHeader("Last-Modified"))s.lastModified[l]=T;if(N=E.getResponseHeader("Etag"))s.etag[l]=N}if(e===304)S="notmodified",d=!0;else try{g=tn(r,x),S="success",d=!0}catch(C){S="parsererror",w=C}}else{w=S;if(!S||e)S="error",e<0&&(e=0)}E.status=e,E.statusText=""+(n||S),d?u.resolveWith(i,[g,S,E]):u.rejectWith(i,[E,S,w]),E.statusCode(f),f=t,b&&o.trigger("ajax"+(d?"Success":"Error"),[E,r,d?g:w]),a.fireWith(i,[E,S]),b&&(o.trigger("ajaxComplete",[E,r]),--s.active||s.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r=s.ajaxSetup({},n),i=r.context||r,o=i!==r&&(i.nodeType||i instanceof s)?s(i):s.event,u=s.Deferred(),a=s.Callbacks("once memory"),f=r.statusCode||{},l,c={},h={},p,d,v,m,g,y=0,b,w,E={readyState:0,setRequestHeader:function(e,t){if(!y){var n=e.toLowerCase();e=h[n]=h[n]||e,c[e]=t}return this},getAllResponseHeaders:function(){return y===2?p:null},getResponseHeader:function(e){var n;if(y===2){if(!d){d={};while(n=_t.exec(p))d[n[1].toLowerCase()]=n[2]}n=d[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return y||(r.mimeType=e),this},abort:function(e){return e=e||"abort",v&&v.abort(e),S(0,e),this}};u.promise(E),E.success=E.done,E.error=E.fail,E.complete=a.add,E.statusCode=function(e){if(e){var t;if(y<2)for(t in e)f[t]=[f[t],e[t]];else t=e[E.status],E.then(t,t)}return this},r.url=((e||r.url)+"").replace(Mt,"").replace(Bt,$t[1]+"//"),r.dataTypes=s.trim(r.dataType||"*").toLowerCase().split(qt),r.crossDomain==null&&(g=Ut.exec(r.url.toLowerCase()),r.crossDomain=!(!g||g[1]==$t[1]&&g[2]==$t[2]&&(g[3]||(g[1]==="http:"?80:443))==($t[3]||($t[1]==="http:"?80:443)))),r.data&&r.processData&&typeof r.data!="string"&&(r.data=s.param(r.data,r.traditional)),Gt(Wt,r,n,E);if(y===2)return!1;b=r.global,r.type=r.type.toUpperCase(),r.hasContent=!Ht.test(r.type),b&&s.active++===0&&s.event.trigger("ajaxStart");if(!r.hasContent){r.data&&(r.url+=(jt.test(r.url)?"&":"?")+r.data,delete r.data),l=r.url;if(r.cache===!1){var x=s.now(),T=r.url.replace(Rt,"$1_="+x);r.url=T+(T===r.url?(jt.test(r.url)?"&":"?")+"_="+x:"")}}(r.data&&r.hasContent&&r.contentType!==!1||n.contentType)&&E.setRequestHeader("Content-Type",r.contentType),r.ifModified&&(l=l||r.url,s.lastModified[l]&&E.setRequestHeader("If-Modified-Since",s.lastModified[l]),s.etag[l]&&E.setRequestHeader("If-None-Match",s.etag[l])),E.setRequestHeader("Accept",r.dataTypes[0]&&r.accepts[r.dataTypes[0]]?r.accepts[r.dataTypes[0]]+(r.dataTypes[0]!=="*"?", "+Jt+"; q=0.01":""):r.accepts["*"]);for(w in r.headers)E.setRequestHeader(w,r.headers[w]);if(!r.beforeSend||r.beforeSend.call(i,E,r)!==!1&&y!==2){for(w in{success:1,error:1,complete:1})E[w](r[w]);v=Gt(Xt,r,n,E);if(!v)S(-1,"No Transport");else{E.readyState=1,b&&o.trigger("ajaxSend",[E,r]),r.async&&r.timeout>0&&(m=setTimeout(function(){E.abort("timeout")},r.timeout));try{y=1,v.send(c,S)}catch(N){if(!(y<2))throw N;S(-1,N)}}return E}return E.abort(),!1},param:function(e,n){var r=[],i=function(e,t){t=s.isFunction(t)?t():t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=s.ajaxSettings.traditional);if(s.isArray(e)||e.jquery&&!s.isPlainObject(e))s.each(e,function(){i(this.name,this.value)});else for(var o in e)Zt(o,e[o],n,i);return r.join("&").replace(Lt,"+")}}),s.extend({active:0,lastModified:{},etag:{}});var nn=s.now(),rn=/(\=)\?(&|$)|\?\?/i;s.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return s.expando+"_"+nn++}}),s.ajaxPrefilter("json jsonp",function(t,n,r){var i=typeof t.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(t.contentType);if(t.dataTypes[0]==="jsonp"||t.jsonp!==!1&&(rn.test(t.url)||i&&rn.test(t.data))){var o,u=t.jsonpCallback=s.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a=e[u],f=t.url,l=t.data,c="$1"+u+"$2";return t.jsonp!==!1&&(f=f.replace(rn,c),t.url===f&&(i&&(l=l.replace(rn,c)),t.data===l&&(f+=(/\?/.test(f)?"&":"?")+t.jsonp+"="+u))),t.url=f,t.data=l,e[u]=function(e){o=[e]},r.always(function(){e[u]=a,o&&s.isFunction(a)&&e[u](o[0])}),t.converters["script json"]=function(){return o||s.error(u+" was not called"),o[0]},t.dataTypes[0]="json","script"}}),s.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return s.globalEval(e),e}}}),s.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),s.ajaxTransport("script",function(e){if(e.crossDomain){var r,i=n.head||n.getElementsByTagName("head")[0]||n.documentElement;return{send:function(s,o){r=n.createElement("script"),r.async="async",e.scriptCharset&&(r.charset=e.scriptCharset),r.src=e.url,r.onload=r.onreadystatechange=function(e,n){if(n||!r.readyState||/loaded|complete/.test(r.readyState))r.onload=r.onreadystatechange=null,i&&r.parentNode&&i.removeChild(r),r=t,n||o(200,"success")},i.insertBefore(r,i.firstChild)},abort:function(){r&&r.onload(0,1)}}}});var sn=e.ActiveXObject?function(){for(var e in un)un[e](0,1)}:!1,on=0,un;s.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&an()||fn()}:an,function(e){s.extend(s.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(s.ajaxSettings.xhr()),s.support.ajax&&s.ajaxTransport(function(n){if(!n.crossDomain||s.support.cors){var r;return{send:function(i,o){var u=n.xhr(),a,f;n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async);if(n.xhrFields)for(f in n.xhrFields)u[f]=n.xhrFields[f];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(f in i)u.setRequestHeader(f,i[f])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var f,l,c,h,p;try{if(r&&(i||u.readyState===4)){r=t,a&&(u.onreadystatechange=s.noop,sn&&delete un[a]);if(i)u.readyState!==4&&u.abort();else{f=u.status,c=u.getAllResponseHeaders(),h={},p=u.responseXML,p&&p.documentElement&&(h.xml=p);try{h.text=u.responseText}catch(e){}try{l=u.statusText}catch(d){l=""}!f&&n.isLocal&&!n.crossDomain?f=h.text?200:404:f===1223&&(f=204)}}}catch(v){i||o(-1,v)}h&&o(f,l,h,c)},!n.async||u.readyState===4?r():(a=++on,sn&&(un||(un={},s(e).unload(sn)),un[a]=r),u.onreadystatechange=r)},abort:function(){r&&r(0,1)}}}});var ln={},cn,hn,pn=/^(?:toggle|show|hide)$/,dn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,vn,mn=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],gn;s.fn.extend({show:function(e,t,n){var r,i;if(e||e===0)return this.animate(wn("show",3),e,t,n);for(var o=0,u=this.length;o<u;o++)r=this[o],r.style&&(i=r.style.display,!s._data(r,"olddisplay")&&i==="none"&&(i=r.style.display=""),(i===""&&s.css(r,"display")==="none"||!s.contains(r.ownerDocument.documentElement,r))&&s._data(r,"olddisplay",En(r.nodeName)));for(o=0;o<u;o++){r=this[o];if(r.style){i=r.style.display;if(i===""||i==="none")r.style.display=s._data(r,"olddisplay")||""}}return this},hide:function(e,t,n){if(e||e===0)return this.animate(wn("hide",3),e,t,n);var r,i,o=0,u=this.length;for(;o<u;o++)r=this[o],r.style&&(i=s.css(r,"display"),i!=="none"&&!s._data(r,"olddisplay")&&s._data(r,"olddisplay",i));for(o=0;o<u;o++)this[o].style&&(this[o].style.display="none");return this},_toggle:s.fn.toggle,toggle:function(e,t,n){var r=typeof e=="boolean";return s.isFunction(e)&&s.isFunction(t)?this._toggle.apply(this,arguments):e==null||r?this.each(function(){var t=r?e:s(this).is(":hidden");s(this)[t?"show":"hide"]()}):this.animate(wn("toggle",3),e,t,n),this},fadeTo:function(e,t,n,r){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){function o(){i.queue===!1&&s._mark(this);var t=s.extend({},i),n=this.nodeType===1,r=n&&s(this).is(":hidden"),o,u,a,f,l,c,h,p,d,v,m;t.animatedProperties={};for(a in e){o=s.camelCase(a),a!==o&&(e[o]=e[a],delete e[a]);if((l=s.cssHooks[o])&&"expand"in l){c=l.expand(e[o]),delete e[o];for(a in c)a in e||(e[a]=c[a])}}for(o in e){u=e[o],s.isArray(u)?(t.animatedProperties[o]=u[1],u=e[o]=u[0]):t.animatedProperties[o]=t.specialEasing&&t.specialEasing[o]||t.easing||"swing";if(u==="hide"&&r||u==="show"&&!r)return t.complete.call(this);n&&(o==="height"||o==="width")&&(t.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],s.css(this,"display")==="inline"&&s.css(this,"float")==="none"&&(!s.support.inlineBlockNeedsLayout||En(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}t.overflow!=null&&(this.style.overflow="hidden");for(a in e)f=new s.fx(this,t,a),u=e[a],pn.test(u)?(m=s._data(this,"toggle"+a)||(u==="toggle"?r?"show":"hide":0),m?(s._data(this,"toggle"+a,m==="show"?"hide":"show"),f[m]()):f[u]()):(h=dn.exec(u),p=f.cur(),h?(d=parseFloat(h[2]),v=h[3]||(s.cssNumber[a]?"":"px"),v!=="px"&&(s.style(this,a,(d||1)+v),p=(d||1)/f.cur()*p,s.style(this,a,p+v)),h[1]&&(d=(h[1]==="-="?-1:1)*d+p),f.custom(p,d,v)):f.custom(p,u,""));return!0}var i=s.speed(t,n,r);return s.isEmptyObject(e)?this.each(i.complete,[!1]):(e=s.extend({},e),i.queue===!1?this.each(o):this.queue(i.queue,o))},stop:function(e,n,r){return typeof e!="string"&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){function u(e,t,n){var i=t[n];s.removeData(e,n,!0),i.stop(r)}var t,n=!1,i=s.timers,o=s._data(this);r||s._unmark(!0,this);if(e==null)for(t in o)o[t]&&o[t].stop&&t.indexOf(".run")===t.length-4&&u(this,o,t);else o[t=e+".run"]&&o[t].stop&&u(this,o,t);for(t=i.length;t--;)i[t].elem===this&&(e==null||i[t].queue===e)&&(r?i[t](!0):i[t].saveState(),n=!0,i.splice(t,1));(!r||!n)&&s.dequeue(this,e)})}}),s.each({slideDown:wn("show",1),slideUp:wn("hide",1),slideToggle:wn("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){s.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),s.extend({speed:function(e,t,n){var r=e&&typeof e=="object"?s.extend({},e):{complete:n||!n&&t||s.isFunction(e)&&e,duration:e,easing:n&&t||t&&!s.isFunction(t)&&t};r.duration=s.fx.off?0:typeof r.duration=="number"?r.duration:r.duration in s.fx.speeds?s.fx.speeds[r.duration]:s.fx.speeds._default;if(r.queue==null||r.queue===!0)r.queue="fx";return r.old=r.complete,r.complete=function(e){s.isFunction(r.old)&&r.old.call(this),r.queue?s.dequeue(this,r.queue):e!==!1&&s._unmark(this)},r},easing:{linear:function(e){return e},swing:function(e){return-Math.cos(e*Math.PI)/2+.5}},timers:[],fx:function(e,t,n){this.options=t,this.elem=e,this.prop=n,t.orig=t.orig||{}}}),s.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(s.fx.step[this.prop]||s.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]==null||!!this.elem.style&&this.elem.style[this.prop]!=null){var e,t=s.css(this.elem,this.prop);return isNaN(e=parseFloat(t))?!t||t==="auto"?0:t:e}return this.elem[this.prop]},custom:function(e,n,r){function u(e){return i.step(e)}var i=this,o=s.fx;this.startTime=gn||yn(),this.end=n,this.now=this.start=e,this.pos=this.state=0,this.unit=r||this.unit||(s.cssNumber[this.prop]?"":"px"),u.queue=this.options.queue,u.elem=this.elem,u.saveState=function(){s._data(i.elem,"fxshow"+i.prop)===t&&(i.options.hide?s._data(i.elem,"fxshow"+i.prop,i.start):i.options.show&&s._data(i.elem,"fxshow"+i.prop,i.end))},u()&&s.timers.push(u)&&!vn&&(vn=setInterval(o.tick,o.interval))},show:function(){var e=s._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=e||s.style(this.elem,this.prop),this.options.show=!0,e!==t?this.custom(this.cur(),e):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),s(this.elem).show()},hide:function(){this.options.orig[this.prop]=s._data(this.elem,"fxshow"+this.prop)||s.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(e){var t,n,r,i=gn||yn(),o=!0,u=this.elem,a=this.options;if(e||i>=a.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),a.animatedProperties[this.prop]=!0;for(t in a.animatedProperties)a.animatedProperties[t]!==!0&&(o=!1);if(o){a.overflow!=null&&!s.support.shrinkWrapBlocks&&s.each(["","X","Y"],function(e,t){u.style["overflow"+t]=a.overflow[e]}),a.hide&&s(u).hide();if(a.hide||a.show)for(t in a.animatedProperties)s.style(u,t,a.orig[t]),s.removeData(u,"fxshow"+t,!0),s.removeData(u,"toggle"+t,!0);r=a.complete,r&&(a.complete=!1,r.call(u))}return!1}return a.duration==Infinity?this.now=i:(n=i-this.startTime,this.state=n/a.duration,this.pos=s.easing[a.animatedProperties[this.prop]](this.state,n,0,1,a.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update(),!0}},s.extend(s.fx,{tick:function(){var e,t=s.timers,n=0;for(;n<t.length;n++)e=t[n],!e()&&t[n]===e&&t.splice(n--,1);t.length||s.fx.stop()},interval:13,stop:function(){clearInterval(vn),vn=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(e){s.style(e.elem,"opacity",e.now)},_default:function(e){e.elem.style&&e.elem.style[e.prop]!=null?e.elem.style[e.prop]=e.now+e.unit:e.elem[e.prop]=e.now}}}),s.each(mn.concat.apply([],mn),function(e,t){t.indexOf("margin")&&(s.fx.step[t]=function(e){s.style(e.elem,t,Math.max(0,e.now)+e.unit)})}),s.expr&&s.expr.filters&&(s.expr.filters.animated=function(e){return s.grep(s.timers,function(t){return e===t.elem}).length});var Sn,xn=/^t(?:able|d|h)$/i,Tn=/^(?:body|html)$/i;"getBoundingClientRect"in n.documentElement?Sn=function(e,t,n,r){try{r=e.getBoundingClientRect()}catch(i){}if(!r||!s.contains(n,e))return r?{top:r.top,left:r.left}:{top:0,left:0};var o=t.body,u=Nn(t),a=n.clientTop||o.clientTop||0,f=n.clientLeft||o.clientLeft||0,l=u.pageYOffset||s.support.boxModel&&n.scrollTop||o.scrollTop,c=u.pageXOffset||s.support.boxModel&&n.scrollLeft||o.scrollLeft,h=r.top+l-a,p=r.left+c-f;return{top:h,left:p}}:Sn=function(e,t,n){var r,i=e.offsetParent,o=e,u=t.body,a=t.defaultView,f=a?a.getComputedStyle(e,null):e.currentStyle,l=e.offsetTop,c=e.offsetLeft;while((e=e.parentNode)&&e!==u&&e!==n){if(s.support.fixedPosition&&f.position==="fixed")break;r=a?a.getComputedStyle(e,null):e.currentStyle,l-=e.scrollTop,c-=e.scrollLeft,e===i&&(l+=e.offsetTop,c+=e.offsetLeft,s.support.doesNotAddBorder&&(!s.support.doesAddBorderForTableAndCells||!xn.test(e.nodeName))&&(l+=parseFloat(r.borderTopWidth)||0,c+=parseFloat(r.borderLeftWidth)||0),o=i,i=e.offsetParent),s.support.subtractsBorderForOverflowNotVisible&&r.overflow!=="visible"&&(l+=parseFloat(r.borderTopWidth)||0,c+=parseFloat(r.borderLeftWidth)||0),f=r}if(f.position==="relative"||f.position==="static")l+=u.offsetTop,c+=u.offsetLeft;return s.support.fixedPosition&&f.position==="fixed"&&(l+=Math.max(n.scrollTop,u.scrollTop),c+=Math.max(n.scrollLeft,u.scrollLeft)),{top:l,left:c}},s.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){s.offset.setOffset(this,e,t)});var n=this[0],r=n&&n.ownerDocument;return r?n===r.body?s.offset.bodyOffset(n):Sn(n,r,r.documentElement):null},s.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return s.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(s.css(e,"marginTop"))||0,n+=parseFloat(s.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var r=s.css(e,"position");r==="static"&&(e.style.position="relative");var i=s(e),o=i.offset(),u=s.css(e,"top"),a=s.css(e,"left"),f=(r==="absolute"||r==="fixed")&&s.inArray("auto",[u,a])>-1,l={},c={},h,p;f?(c=i.position(),h=c.top,p=c.left):(h=parseFloat(u)||0,p=parseFloat(a)||0),s.isFunction(t)&&(t=t.call(e,n,o)),t.top!=null&&(l.top=t.top-o.top+h),t.left!=null&&(l.left=t.left-o.left+p),"using"in t?t.using.call(e,l):i.css(l)}},s.fn.extend({position:function(){if(!this[0])return null;var e=this[0],t=this.offsetParent(),n=this.offset(),r=Tn.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(s.css(e,"marginTop"))||0,n.left-=parseFloat(s.css(e,"marginLeft"))||0,r.top+=parseFloat(s.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(s.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||n.body;while(e&&!Tn.test(e.nodeName)&&s.css(e,"position")==="static")e=e.offsetParent;return e})}}),s.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);s.fn[e]=function(i){return s.access(this,function(e,i,o){var u=Nn(e);if(o===t)return u?n in u?u[n]:s.support.boxModel&&u.document.documentElement[i]||u.document.body[i]:e[i];u?u.scrollTo(r?s(u).scrollLeft():o,r?o:s(u).scrollTop()):e[i]=o},e,i,arguments.length,null)}}),s.each({Height:"height",Width:"width"},function(e,n){var r="client"+e,i="scroll"+e,o="offset"+e;s.fn["inner"+e]=function(){var e=this[0];return e?e.style?parseFloat(s.css(e,n,"padding")):this[n]():null},s.fn["outer"+e]=function(e){var t=this[0];return t?t.style?parseFloat(s.css(t,n,e?"margin":"border")):this[n]():null},s.fn[n]=function(e){return s.access(this,function(e,n,u){var a,f,l,c;if(s.isWindow(e))return a=e.document,f=a.documentElement[r],s.support.boxModel&&f||a.body&&a.body[r]||f;if(e.nodeType===9)return a=e.documentElement,a[r]>=a[i]?a[r]:Math.max(e.body[i],a[i],e.body[o],a[o]);if(u===t)return l=s.css(e,n),c=parseFloat(l),s.isNumeric(c)?c:l;s(e).css(n,u)},n,e,arguments.length,null)}}),e.jQuery=e.$=s,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return s})})(window),define("jQuery",function(e){return function(){return e.$}}(this)),function(){function L(e,t,n){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e._chain&&(e=e._wrapped),t._chain&&(t=t._wrapped);if(e.isEqual&&x.isFunction(e.isEqual))return e.isEqual(t);if(t.isEqual&&x.isFunction(t.isEqual))return t.isEqual(e);var r=f.call(e);if(r!=f.call(t))return!1;switch(r){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:e==0?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if(typeof e!="object"||typeof t!="object")return!1;var i=n.length;while(i--)if(n[i]==e)return!0;n.push(e);var s=0,o=!0;if(r=="[object Array]"){s=e.length,o=s==t.length;if(o)while(s--)if(!(o=s in e==s in t&&L(e[s],t[s],n)))break}else{if("constructor"in e!="constructor"in t||e.constructor!=t.constructor)return!1;for(var u in e)if(x.has(e,u)){s++;if(!(o=x.has(t,u)&&L(e[u],t[u],n)))break}if(o){for(u in t)if(x.has(t,u)&&!(s--))break;o=!s}}return n.pop(),o}var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.unshift,f=i.toString,l=i.hasOwnProperty,c=r.forEach,h=r.map,p=r.reduce,d=r.reduceRight,v=r.filter,m=r.every,g=r.some,y=r.indexOf,b=r.lastIndexOf,w=Array.isArray,E=Object.keys,S=s.bind,x=function(e){return new F(e)};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=x),exports._=x):e._=x,x.VERSION="1.3.3";var T=x.each=x.forEach=function(e,t,r){if(e==null)return;if(c&&e.forEach===c)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i<s;i++)if(t.call(r,e[i],i,e)===n)return}else for(var o in e)if(x.has(e,o)&&t.call(r,e[o],o,e)===n)return};x.map=x.collect=function(e,t,n){var r=[];return e==null?r:h&&e.map===h?e.map(t,n):(T(e,function(e,i,s){r[r.length]=t.call(n,e,i,s)}),r)},x.reduce=x.foldl=x.inject=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(p&&e.reduce===p)return r&&(t=x.bind(t,r)),i?e.reduce(t,n):e.reduce(t);T(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError("Reduce of empty array with no initial value");return n},x.reduceRight=x.foldr=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(d&&e.reduceRight===d)return r&&(t=x.bind(t,r)),i?e.reduceRight(t,n):e.reduceRight(t);var s=x.toArray(e).reverse();return r&&!i&&(t=x.bind(t,r)),i?x.reduce(s,t,n,r):x.reduce(s,t)},x.find=x.detect=function(e,t,n){var r;return N(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},x.filter=x.select=function(e,t,n){var r=[];return e==null?r:v&&e.filter===v?e.filter(t,n):(T(e,function(e,i,s){t.call(n,e,i,s)&&(r[r.length]=e)}),r)},x.reject=function(e,t,n){var r=[];return e==null?r:(T(e,function(e,i,s){t.call(n,e,i,s)||(r[r.length]=e)}),r)},x.every=x.all=function(e,t,r){var i=!0;return e==null?i:m&&e.every===m?e.every(t,r):(T(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),!!i)};var N=x.some=x.any=function(e,t,r){t||(t=x.identity);var i=!1;return e==null?i:g&&e.some===g?e.some(t,r):(T(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n}),!!i)};x.include=x.contains=function(e,t){var n=!1;return e==null?n:y&&e.indexOf===y?e.indexOf(t)!=-1:(n=N(e,function(e){return e===t}),n)},x.invoke=function(e,t){var n=u.call(arguments,2);return x.map(e,function(e){return(x.isFunction(t)?t:e[t]).apply(e,n)})},x.pluck=function(e,t){return x.map(e,function(e){return e[t]})},x.max=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&x.isEmpty(e))return-Infinity;var r={computed:-Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>=r.computed&&(r={value:e,computed:o})}),r.value},x.min=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&x.isEmpty(e))return Infinity;var r={computed:Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o<r.computed&&(r={value:e,computed:o})}),r.value},x.shuffle=function(e){var t,n=0,r=[];return T(e,function(e){t=Math.floor(Math.random()*++n),r[n-1]=r[t],r[t]=e}),r},x.sortBy=function(e,t,n){var r=x.isFunction(t)?t:function(e){return e[t]};return x.pluck(x.map(e,function(e,t,i){return{value:e,criteria:r.call(n,e,t,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;return n===void 0?1:r===void 0?-1:n<r?-1:n>r?1:0}),"value")},x.groupBy=function(e,t){var n={},r=x.isFunction(t)?t:function(e){return e[t]};return T(e,function(e,t){var i=r(e,t);(n[i]||(n[i]=[])).push(e)}),n},x.sortedIndex=function(e,t,n){n||(n=x.identity);var r=n(t),i=0,s=e.length;while(i<s){var o=i+s>>1;n(e[o])<r?i=o+1:s=o}return i},x.toArray=function(e){return e?x.isArray(e)?u.call(e):x.isArguments(e)?u.call(e):e.toArray&&x.isFunction(e.toArray)?e.toArray():x.values(e):[]},x.size=function(e){return x.isArray(e)?e.length:x.keys(e).length},x.first=x.head=x.take=function(e,t,n){return t!=null&&!n?u.call(e,0,t):e[0]},x.initial=function(e,t,n){return u.call(e,0,e.length-(t==null||n?1:t))},x.last=function(e,t,n){return t!=null&&!n?u.call(e,Math.max(e.length-t,0)):e[e.length-1]},x.rest=x.tail=function(e,t,n){return u.call(e,t==null||n?1:t)},x.compact=function(e){return x.filter(e,function(e){return!!e})};var C=function(e,t,n){return T(e,function(e){x.isArray(e)?t?o.apply(n,e):C(e,t,n):n.push(e)}),n};x.flatten=function(e,t){return C(e,t,[])},x.without=function(e){return x.difference(e,u.call(arguments,1))},x.uniq=x.unique=function(e,t,n){var r=n?x.map(e,n):e,i=[];return x.reduce(r,function(n,r,s){if(t?x.last(n)!==r||!n.length:!x.include(n,r))n.push(r),i.push(e[s]);return n},[]),i},x.union=function(){return x.uniq(C(arguments,!0,[]))},x.intersection=function(e){var t=u.call(arguments,1);return x.filter(x.uniq(e),function(e){return x.every(t,function(t){return x.indexOf(t,e)>=0})})},x.difference=function(e){var t=C(u.call(arguments,1),!0,[]);return x.filter(e,function(e){return!x.include(t,e)})},x.zip=function(){var e=u.call(arguments),t=x.max(x.pluck(e,"length")),n=new Array(t);for(var r=0;r<t;r++)n[r]=x.pluck(e,""+r);return n},x.zipObject=function(e,t){var n={};for(var r=0,i=e.length;r<i;r++)n[e[r]]=t[r];return n},x.indexOf=function(e,t,n){if(e==null)return-1;var r,i;if(n)return r=x.sortedIndex(e,t),e[r]===t?r:-1;if(y&&e.indexOf===y)return e.indexOf(t);for(r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1},x.lastIndexOf=function(e,t){if(e==null)return-1;if(b&&e.lastIndexOf===b)return e.lastIndexOf(t);var n=e.length;while(n--)if(e[n]===t)return n;return-1},x.range=function(e,t,n){arguments.length<=1&&(t=e||0,e=0),n=arguments[2]||1;var r=Math.max(Math.ceil((t-e)/n),0),i=0,s=new Array(r);while(i<r)s[i++]=e,e+=n;return s};var k=function(){};x.bind=function(t,n){var r,i;if(t.bind===S&&S)return S.apply(t,u.call(arguments,1));if(!x.isFunction(t))throw new TypeError;return i=u.call(arguments,2),r=function(){if(this instanceof r){k.prototype=t.prototype;var e=new k,s=t.apply(e,i.concat(u.call(arguments)));return Object(s)===s?s:e}return t.apply(n,i.concat(u.call(arguments)))}},x.bindAll=function(e){var t=u.call(arguments,1);return t.length==0&&(t=x.functions(e)),T(t,function(t){e[t]=x.bind(e[t],e)}),e},x.memoize=function(e,t){var n={};return t||(t=x.identity),function(){var r=t.apply(this,arguments);return x.has(n,r)?n[r]:n[r]=e.apply(this,arguments)}},x.delay=function(e,t){var n=u.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},x.defer=function(e){return x.delay.apply(x,[e,1].concat(u.call(arguments,1)))},x.throttle=function(e,t){var n,r,i,s,o,u,a=x.debounce(function(){o=s=!1},t);return function(){n=this,r=arguments;var f=function(){i=null,o&&e.apply(n,r),a()};return i||(i=setTimeout(f,t)),s?o=!0:(s=!0,u=e.apply(n,r)),a(),u}},x.debounce=function(e,t,n){var r;return function(){var i=this,s=arguments,o=function(){r=null,n||e.apply(i,s)},u=n&&!r;clearTimeout(r),r=setTimeout(o,t),u&&e.apply(i,s)}},x.once=function(e){var t=!1,n;return function(){return t?n:(t=!0,n=e.apply(this,arguments))}},x.wrap=function(e,t){return function(){var n=[e].concat(u.call(arguments,0));return t.apply(this,n)}},x.compose=function(){var e=arguments;return function(){var t=arguments;for(var n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},x.after=function(e,t){return e<=0?t():function(){if(--e<1)return t.apply(this,arguments)}},x.keys=E||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)x.has(e,n)&&(t[t.length]=n);return t},x.values=function(e){return x.map(e,x.identity)},x.functions=x.methods=function(e){var t=[];for(var n in e)x.isFunction(e[n])&&t.push(n);return t.sort()},x.extend=function(e){return T(u.call(arguments,1),function(t){for(var n in t)e[n]=t[n]}),e},x.pick=function(e){var t={};return T(C(u.call(arguments,1),!0,[]),function(n){n in e&&(t[n]=e[n])}),t},x.defaults=function(e){return T(u.call(arguments,1),function(t){for(var n in t)e[n]==null&&(e[n]=t[n])}),e},x.clone=function(e){return x.isObject(e)?x.isArray(e)?e.slice():x.extend({},e):e},x.tap=function(e,t){return t(e),e},x.isEqual=function(e,t){return L(e,t,[])},x.isEmpty=function(e){if(e==null)return!0;if(x.isArray(e)||x.isString(e))return e.length===0;for(var t in e)if(x.has(e,t))return!1;return!0},x.isElement=function(e){return!!e&&e.nodeType==1},x.isArray=w||function(e){return f.call(e)=="[object Array]"},x.isObject=function(e){return e===Object(e)},T(["Arguments","Function","String","Number","Date","RegExp"],function(e){x["is"+e]=function(t){return f.call(t)=="[object "+e+"]"}}),x.isArguments(arguments)||(x.isArguments=function(e){return!!e&&!!x.has(e,"callee")}),x.isFinite=function(e){return x.isNumber(e)&&isFinite(e)},x.isNaN=function(e){return e!==e},x.isBoolean=function(e){return e===!0||e===!1||f.call(e)=="[object Boolean]"},x.isNull=function(e){return e===null},x.isUndefined=function(e){return e===void 0},x.has=function(e,t){return l.call(e,t)},x.noConflict=function(){return e._=t,this},x.identity=function(e){return e},x.times=function(e,t,n){for(var r=0;r<e;r++)t.call(n,r)};var A={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},O=/[&<>"'\/]/g;x.escape=function(e){return(""+e).replace(O,function(e){return A[e]})},x.result=function(e,t){if(e==null)return null;var n=e[t];return x.isFunction(n)?n.call(e):n},x.mixin=function(e){T(x.functions(e),function(t){q(t,x[t]=e[t])})};var M=0;x.uniqueId=function(e){var t=M++;return e?e+t:t},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var _=/.^/,D={"\\":"\\","'":"'",r:"\r",n:"\n",t:" ",u2028:"\u2028",u2029:"\u2029"};for(var P in D)D[D[P]]=P;var H=/\\|'|\r|\n|\t|\u2028|\u2029/g,B=/\\(\\|'|r|n|t|u2028|u2029)/g,j=function(e){return e.replace(B,function(e,t){return D[t]})};x.template=function(e,t,n){n=x.defaults(n||{},x.templateSettings);var r="__p+='"+e.replace(H,function(e){return"\\"+D[e]}).replace(n.escape||_,function(e,t){return"'+\n((__t=("+j(t)+"))==null?'':_.escape(__t))+\n'"}).replace(n.interpolate||_,function(e,t){return"'+\n((__t=("+j(t)+"))==null?'':__t)+\n'"}).replace(n.evaluate||_,function(e,t){return"';\n"+j(t)+"\n__p+='"})+"';\n";n.variable||(r="with(obj||{}){\n"+r+"}\n"),r="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'')};\n"+r+"return __p;\n";var i=new Function(n.variable||"obj","_",r);if(t)return i(t,x);var s=function(e){return i.call(this,e,x)};return s.source="function("+(n.variable||"obj")+"){\n"+r+"}",s},x.chain=function(e){return x(e).chain()};var F=function(e){this._wrapped=e};x.prototype=F.prototype;var I=function(e,t){return t?x(e).chain():e},q=function(e,t){F.prototype[e]=function(){var e=u.call(arguments);return a.call(e,this._wrapped),I(t.apply(x,e),this._chain)}};x.mixin(x),T(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];F.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],I(n,this._chain)}}),T(["concat","join","slice"],function(e){var t=r[e];F.prototype[e]=function(){return I(t.apply(this._wrapped,arguments),this._chain)}}),F.prototype.chain=function(){return this._chain=!0,this},F.prototype.value=function(){return this._wrapped}}.call(this),define("Underscore",function(e){return function(){return e._}}(this)),define("dbTypes_cached",[],function(){return[{id:2,className:"org.gjt.mm.mysql.Driver",context:"host",sample_fragment:"2/a2581/1",simple_name:"MySQL",notes:"Separate multiple statements in MySQL by terminating each one with a semicolon.",full_name:"MySQL 5.5.27"},{id:9,className:"org.gjt.mm.mysql.Driver",context:"host",sample_fragment:"9/a2581/1",simple_name:"MySQL",notes:"",full_name:"MySQL 5.6.6 m9"},{id:8,className:"org.gjt.mm.mysql.Driver",context:"host",sample_fragment:"8/a2581/1",simple_name:"MySQL",notes:"",full_name:"MySQL 5.1.61"},{id:4,className:"oracle.jdbc.OracleDriver",context:"host",sample_fragment:"4/ee7da/596",simple_name:"Oracle",notes:"Oracle does not support multiple statements in batch. Separate each statement with a line consisting of a single /, and do not terminate statements with semicolons.",full_name:"Oracle 11g R2"},{id:1,className:"org.postgresql.Driver",context:"host",sample_fragment:"1/6ccc5/2",simple_name:"PostgreSQL",notes:"Separate multiple statements in PostgreSQL by terminating each one with a semicolon.",full_name:"PostgreSQL 9.1.6"},{id:12,className:"org.postgresql.Driver",context:"host",sample_fragment:"12/6d80e/1",simple_name:"PostgreSQL",notes:"",full_name:"PostgreSQL 9.2.1"},{id:11,className:"org.postgresql.Driver",context:"host",sample_fragment:"11/6d80e/1",simple_name:"PostgreSQL",notes:"",full_name:"PostgreSQL 8.4.12"},{id:10,className:"org.postgresql.Driver",context:"host",sample_fragment:"10/f9585/1",simple_name:"PostgreSQL",notes:"",full_name:"PostgreSQL 8.3.20"},{id:7,className:"websql",context:"browser",sample_fragment:"7/04eca/1",simple_name:"SQLite",notes:"",full_name:"SQLite (WebSQL)"},{id:5,className:"sqljs",context:"browser",sample_fragment:"5/781d4/2",simple_name:"SQLite",notes:"",full_name:"SQLite (SQL.js)"},{id:6,className:"net.sourceforge.jtds.jdbc.Driver",context:"host",sample_fragment:"6/189a3/1",simple_name:"SQL Server",notes:"",full_name:"MS SQL Server 2012"},{id:3,className:"net.sourceforge.jtds.jdbc.Driver",context:"host",sample_fragment:"3/1fa93/1",simple_name:"SQL Server",notes:"SQL Server supports multiple statements in a batch separated by semicolons. Separate statement batches with a line consisting of a single GO command, as needed.",full_name:"MS SQL Server 2008"}]}),define("BrowserEngines/sqlite_driver",[],function(){var e=function(){return this};return e.prototype.getSchemaStructure=function(e){var t="select * from sqlite_master where type IN ('table', 'view') and name != '__WebKitDatabaseInfoTable__' order by type,name",n=function(t){var n={},r=[];for(var i in t[0].RESULTS.COLUMNS)n[t[0].RESULTS.COLUMNS[i]]=i;for(var s in t[0].RESULTS.DATA){var o=t[0].RESULTS.DATA[s][n.sql],u=t[0].RESULTS.DATA[s][n.name],a=t[0].RESULTS.DATA[s][n.type],f={table_name:u,table_type:a,columns:[]};if(a=="table"){var l=/^[\s\S]*?\(([\s\S]*)\)$/.exec(o)[1].split(/,\s*/);for(var c in l){var h=l[c].replace(/(^\s*)|(\s*$)/,"").split(/\s+/);f.columns.push({name:h.shift(),type:h.join(" ")})}}r.push(f)}e.callback(r)};this.executeQuery({sql:t,success:n})},e.prototype.splitStatement=function(e,t){t||(t=";");var n=t.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),r=e?e.split(new RegExp(n+"s*\r?(\n|$)")):[];return r},e}),define("BrowserEngines/sqljs_driver",["jQuery","BrowserEngines/sqlite_driver"],function(e,t){var n=function(){return this.db=null,this};return e.extend(n.prototype,t.prototype),n.prototype.buildSchema=function(n){var r=this;try{var i=function(){r.db=SQL.open(),e.each(t.prototype.splitStatement.call(this,n.ddl,n.statement_separator),function(e,t){r.db.exec(t)}),n.success()};window.SQL===undefined?e.getScript("javascripts_static/sql.js",function(e,t,n){i()}).fail(function(e,t,r){n.error("Your browser does not work with SQL.js. Try using a different browser (Chrome, Safari, Firefox, IE 10, etc...), or a newer version of your current one.")}):(r.db&&r.db.close(),i())}catch(s){n.error(s)}},n.prototype.executeQuery=function(n){var r=this;try{if(!r.db)throw"Database Schema not available!";var i=[];r.db.exec("BEGIN TRANSACTION"),e.each(t.prototype.splitStatement.call(this,n.sql,n.statement_separator),function(t,n){if(e.trim(n).length){var s=new Date,o=[];try{o=r.db.exec(n);var u={SUCCEEDED:!0,STATEMENT:n,EXECUTIONTIME:new Date-s,RESULTS:{COLUMNS:[],DATA:[]},EXECUTIONPLAN:{COLUMNS:[],DATA:[]}};o.length&&e.each(o,function(t,n){var r=[];e.each(n,function(e,n){t==0&&u.RESULTS.COLUMNS.push(n.column),r.push(n.value)}),u.RESULTS.DATA.push(r)});try{exectionPlanArray=r.db.exec("EXPLAIN QUERY PLAN "+n),exectionPlanArray.length&&e.each(exectionPlanArray,function(t,n){var r=[];e.each(n,function(e,n){t==0&&u.EXECUTIONPLAN.COLUMNS.push(n.column),r.push(n.value)}),u.EXECUTIONPLAN.DATA.push(r)})}catch(a){}i.push(u)}catch(a){var u={SUCCEEDED:!1,EXECUTIONTIME:new Date-s,ERRORMESSAGE:a};return i.push(u),!1}}}),r.db.exec("ROLLBACK TRANSACTION"),n.success(i)}catch(s){n.error(s)}},n}),define("BrowserEngines/websql_driver",["jQuery","BrowserEngines/sqlite_driver"],function(e,t){var n=function(){return this.db=null,this.ddl=[],this.nativeSQLite=window.openDatabase!==undefined,this};return e.extend(n.prototype,t.prototype),n.prototype.buildSchema=function(e){var t=this;try{t.nativeSQLite?(t.db=openDatabase(e.short_code,"1.0",e.short_code,e.ddl.length*1024),t.db.transaction(function(n){var r=t.splitStatement(e.ddl,e.statement_separator);t.ddl=r;var i=0,s=r[i],o=function(t,a){if(i<r.length-1){do i++,s=r[i];while(i<r.length-1&&s.match(/^\s*$/));s.match(/^\s*$/)?(n.executeSql("intentional failure used to rollback transaction"),e.success()):n.executeSql(s,[],o,u)}else n.executeSql("intentional failure used to rollback transaction"),e.success()},u=function(t,n){return n.message!="not an error"?e.error(n.message):e.success(),!0};s?n.executeSql(s,[],o,u):e.success()})):e.error("SQLite (WebSQL) not available in your browser. Try either using a webkit-based browser (such as Safari or Chrome) or using the SQLite (SQL.js) database type.")}catch(n){e.error(n)}},n.prototype.executeQuery=function(t){var n=this;try{if(n.db==null)throw"You need to build the schema before you can run a query.";var r=[];n.db.transaction(function(i){var s=function(e,u){var a={STATEMENT:h,SUCCEEDED:!0,EXECUTIONTIME:new Date-p,RESULTS:{COLUMNS:[],DATA:[]},EXECUTIONPLAN:{COLUMNS:[],DATA:[]}};for(var f=0;f<u.rows.length;f++){var d=[],v=u.rows.item(f);if(f==0)for(col in v)a.RESULTS.COLUMNS.push(col);for(var m=0;m<a.RESULTS.COLUMNS.length;m++)d.push(v[a.RESULTS.COLUMNS[m]]);a.RESULTS.DATA.push(d)}i.executeSql("EXPLAIN QUERY PLAN "+h,[],function(e,u){for(var f=0;f<u.rows.length;f++){var p=[],d=u.rows.item(f);if(f==0)for(col in d)a.EXECUTIONPLAN.COLUMNS.push(col);for(var v=0;v<a.EXECUTIONPLAN.COLUMNS.length;v++)p.push(d[a.EXECUTIONPLAN.COLUMNS[v]]);a.EXECUTIONPLAN.DATA.push(p)}c>n.ddl.length-1&&r.push(a);if(c<l.length-1){do c++,h=l[c];while(c<l.length-1&&h.match(/^\s*$/));h.match(/^\s*$/)?(i.executeSql("intentional failure used to rollback transaction"),t.success(r)):i.executeSql(h,[],s,o)}else i.executeSql("intentional failure used to rollback transaction"),t.success(r)},function(e,u){c>n.ddl.length-1&&r.push(a);if(c<l.length-1){do c++,h=l[c];while(c<l.length-1&&h.match(/^\s*$/));h.match(/^\s*$/)?(i.executeSql("intentional failure used to rollback transaction"),t.success(r)):i.executeSql(h,[],s,o)}else i.executeSql("intentional failure used to rollback transaction"),t.success(r)})},o=function(e,n){if(n.message!="not an error"){var i={SUCCEEDED:!1,EXECUTIONTIME:new Date-p,ERRORMESSAGE:n.message};r.push(i)}return t.success(r),!0},u=[],a,f=!1,l=n.ddl.slice(0);e.each(n.splitStatement(t.sql,t.statement_separator),function(e,t){l.push(t)});var c=0,h=l[c],p=new Date;i.executeSql(h,[],s,o)})}catch(i){t.error(i)}},n}),define("BrowserEngines/engines",["BrowserEngines/sqljs_driver","BrowserEngines/websql_driver"],function(e,t){return{sqljs:new e,websql:new t}});var JSON;JSON||(JSON={}),function(){function f(e){return e<10?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o=gap,u,a=t[e];a&&typeof a=="object"&&typeof a.toJSON=="function"&&(a=a.toJSON(e)),typeof rep=="function"&&(a=rep.call(t,e,a));switch(typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";gap+=indent,u=[];if(Object.prototype.toString.apply(a)==="[object Array]"){s=a.length;for(n=0;n<s;n+=1)u[n]=str(n,a)||"null";return i=u.length===0?"[]":gap?"[\n"+gap+u.join(",\n"+gap)+"\n"+o+"]":"["+u.join(",")+"]",gap=o,i}if(rep&&typeof rep=="object"){s=rep.length;for(n=0;n<s;n+=1)typeof rep[n]=="string"&&(r=rep[n],i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i))}else for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i));return i=u.length===0?"{}":gap?"{\n"+gap+u.join(",\n"+gap)+"\n"+o+"}":"{"+u.join(",")+"}",gap=o,i}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(e){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(e){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;typeof JSON.stringify!="function"&&(JSON.stringify=function(e,t,n){var r;gap="",indent="";if(typeof n=="number")for(r=0;r<n;r+=1)indent+=" ";else typeof n=="string"&&(indent=n);rep=t;if(!t||typeof t=="function"||typeof t=="object"&&typeof t.length=="number")return str("",{"":e});throw new Error("JSON.stringify")}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(e,t){var n,r,i=e[t];if(i&&typeof i=="object")for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r=walk(i,n),r!==undefined?i[n]=r:delete i[n]);return reviver.call(e,t,i)}var j;text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),define("libs/json2",function(){}),function(){var e=this,t=e.Backbone,n=Array.prototype.splice,r;typeof exports!="undefined"?r=exports:r=e.Backbone={},r.VERSION="0.9.2";var i=e._;!i&&typeof require!="undefined"&&(i=require("underscore")),r.$=e.jQuery||e.Zepto||e.ender,r.noConflict=function(){return e.Backbone=t,this},r.emulateHTTP=!1,r.emulateJSON=!1;var s=/\s+/,o=r.Events={on:function(e,t,n){var r,i,o;if(!t)return this;e=e.split(s),r=this._callbacks||(this._callbacks={});while(i=e.shift())o=r[i]||(r[i]=[]),o.push(t,n);return this},off:function(e,t,n){var r,o,u,a;if(!(o=this._callbacks))return this;if(!(e||t||n))return delete this._callbacks,this;e=e?e.split(s):i.keys(o);while(r=e.shift()){if(!(u=o[r])||!t&&!n){delete o[r];continue}for(a=u.length-2;a>=0;a-=2)t&&u[a]!==t||n&&u[a+1]!==n||u.splice(a,2)}return this},trigger:function(e){var t,n,r,i,o,u,a,f;if(!(n=this._callbacks))return this;f=[],e=e.split(s);for(i=1,o=arguments.length;i<o;i++)f[i-1]=arguments[i];while(t=e.shift()){if(a=n.all)a=a.slice();if(r=n[t])r=r.slice();if(r)for(i=0,o=r.length;i<o;i+=2)r[i].apply(r[i+1]||this,f);if(a){u=[t].concat(f);for(i=0,o=a.length;i<o;i+=2)a[i].apply(a[i+1]||this,u)}}return this}};o.bind=o.on,o.unbind=o.off;var u=r.Model=function(e,t){var n;e||(e={}),t&&t.collection&&(this.collection=t.collection),t&&t.parse&&(e=this.parse(e));if(n=N(this,"defaults"))e=i.extend({},n,e);this.attributes={},this._escapedAttributes={},this.cid=i.uniqueId("c"),this.changed={},this._silent={},this._pending={},this.set(e,{silent:!0}),this.changed={},this._silent={},this._pending={},this._previousAttributes=i.clone(this.attributes),this.initialize.apply(this,arguments)};i.extend(u.prototype,o,{changed:null,_silent:null,_pending:null,idAttribute:"id",initialize:function(){},toJSON:function(e){return i.clone(this.attributes)},sync:function(){return r.sync.apply(this,arguments)},get:function(e){return this.attributes[e]},escape:function(e){var t;if(t=this._escapedAttributes[e])return t;var n=this.get(e);return this._escapedAttributes[e]=i.escape(n==null?"":""+n)},has:function(e){return this.get(e)!=null},set:function(e,t,n){var r,s,o;i.isObject(e)||e==null?(r=e,n=t):(r={},r[e]=t),n||(n={});if(!r)return this;r instanceof u&&(r=r.attributes);if(n.unset)for(s in r)r[s]=void 0;if(!this._validate(r,n))return!1;this.idAttribute in r&&(this.id=r[this.idAttribute]);var a=n.changes={},f=this.attributes,l=this._escapedAttributes,c=this._previousAttributes||{};for(s in r){o=r[s];if(!i.isEqual(f[s],o)||n.unset&&i.has(f,s))delete l[s],(n.silent?this._silent:a)[s]=!0;n.unset?delete f[s]:f[s]=o,!i.isEqual(c[s],o)||i.has(f,s)!=i.has(c,s)?(this.changed[s]=o,n.silent||(this._pending[s]=!0)):(delete this.changed[s],delete this._pending[s])}return n.silent||this.change(n),this},unset:function(e,t){return t=i.extend({},t,{unset:!0}),this.set(e,null,t)},clear:function(e){return e=i.extend({},e,{unset:!0}),this.set(i.clone(this.attributes),e)},fetch:function(e){e=e?i.clone(e):{};var t=this,n=e.success;return e.success=function(r,i,s){if(!t.set(t.parse(r,s),e))return!1;n&&n(t,r,e),t.trigger("sync",t,r,e)},e.error=r.wrapError(e.error,t,e),this.sync("read",this,e)},save:function(e,t,n){var s,o,u;i.isObject(e)||e==null?(s=e,n=t):(s={},s[e]=t),n=n?i.clone(n):{};if(n.wait){if(!this._validate(s,n))return!1;o=i.clone(this.attributes)}var a=i.extend({},n,{silent:!0});if(s&&!this.set(s,n.wait?a:n))return!1;if(!s&&!this.isValid())return!1;var f=this,l=n.success;n.success=function(e,t,r){u=!0;var o=f.parse(e,r);n.wait&&(o=i.extend(s||{},o));if(!f.set(o,n))return!1;l&&l(f,e,n),f.trigger("sync",f,e,n)},n.error=r.wrapError(n.error,f,n);var c=this.sync(this.isNew()?"create":"update",this,n);return!u&&n.wait&&(this.clear(a),this.set(o,a)),c},destroy:function(e){e=e?i.clone(e):{};var t=this,n=e.success,s=function(){t.trigger("destroy",t,t.collection,e)};e.success=function(r){(e.wait||t.isNew())&&s(),n&&n(t,r,e),t.isNew()||t.trigger("sync",t,r,e)};if(this.isNew())return e.success(),!1;e.error=r.wrapError(e.error,t,e);var o=this.sync("delete",this,e);return e.wait||s(),o},url:function(){var e=N(this,"urlRoot")||N(this.collection,"url")||C();return this.isNew()?e:e+(e.charAt(e.length-1)=="/"?"":"/")+encodeURIComponent(this.id)},parse:function(e,t){return e},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return this.id==null},change:function(e){e||(e={});var t=this._changing;this._changing=!0;for(var n in this._silent)this._pending[n]=!0;var r=i.extend({},e.changes,this._silent);this._silent={};for(var n in r)this.trigger("change:"+n,this,this.get(n),e);if(t)return this;while(!i.isEmpty(this._pending)){this._pending={},this.trigger("change",this,e);for(var n in this.changed){if(this._pending[n]||this._silent[n])continue;delete this.changed[n]}this._previousAttributes=i.clone(this.attributes)}return this._changing=!1,this},hasChanged:function(e){return e==null?!i.isEmpty(this.changed):i.has(this.changed,e)},changedAttributes:function(e){if(!e)return this.hasChanged()?i.clone(this.changed):!1;var t,n=!1,r=this._previousAttributes;for(var s in e){if(i.isEqual(r[s],t=e[s]))continue;(n||(n={}))[s]=t}return n},previous:function(e){return e==null||!this._previousAttributes?null:this._previousAttributes[e]},previousAttributes:function(){return i.clone(this._previousAttributes)},isValid:function(){return!this.validate||!this.validate(this.attributes)},_validate:function(e,t){if(t.silent||!this.validate)return!0;e=i.extend({},this.attributes,e);var n=this.validate(e,t);return n?(t&&t.error?t.error(this,n,t):this.trigger("error",this,n,t),!1):!0}});var a=r.Collection=function(e,t){t||(t={}),t.model&&(this.model=t.model),t.comparator!==undefined&&(this.comparator=t.comparator),this._reset(),this.initialize.apply(this,arguments),e&&this.reset(e,{silent:!0,parse:t.parse})};i.extend(a.prototype,o,{model:u,initialize:function(){},toJSON:function(e){return this.map(function(t){return t.toJSON(e)})},sync:function(){return r.sync.apply(this,arguments)},add:function(e,t){var r,s,o,u,a,f,l={},c={},h=[];t||(t={}),e=i.isArray(e)?e.slice():[e];for(r=0,o=e.length;r<o;r++){if(!(u=e[r]=this._prepareModel(e[r],t)))throw new Error("Can't add an invalid model to a collection");a=u.cid,f=u.id;if(l[a]||this._byCid[a]||f!=null&&(c[f]||this._byId[f])){h.push(r);continue}l[a]=c[f]=u}r=h.length;while(r--)h[r]=e.splice(h[r],1)[0];for(r=0,o=e.length;r<o;r++)(u=e[r]).on("all",this._onModelEvent,this),this._byCid[u.cid]=u,u.id!=null&&(this._byId[u.id]=u);this.length+=o,s=t.at!=null?t.at:this.models.length,n.apply(this.models,[s,0].concat(e));if(t.merge)for(r=0,o=h.length;r<o;r++)(u=this._byId[h[r].id])&&u.set(h[r],t);this.comparator&&t.at==null&&this.sort({silent:!0});if(t.silent)return this;for(r=0,o=this.models.length;r<o;r++){if(!l[(u=this.models[r]).cid])continue;t.index=r,u.trigger("add",u,this,t)}return this},remove:function(e,t){var n,r,s,o;t||(t={}),e=i.isArray(e)?e.slice():[e];for(n=0,r=e.length;n<r;n++){o=this.getByCid(e[n])||this.get(e[n]);if(!o)continue;delete this._byId[o.id],delete this._byCid[o.cid],s=this.indexOf(o),this.models.splice(s,1),this.length--,t.silent||(t.index=s,o.trigger("remove",o,this,t)),this._removeReference(o)}return this},push:function(e,t){return e=this._prepareModel(e,t),this.add(e,t),e},pop:function(e){var t=this.at(this.length-1);return this.remove(t,e),t},unshift:function(e,t){return e=this._prepareModel(e,t),this.add(e,i.extend({at:0},t)),e},shift:function(e){var t=this.at(0);return this.remove(t,e),t},slice:function(e,t){return this.models.slice(e,t)},get:function(e){return e==null?void 0:this._byId[e.id!=null?e.id:e]},getByCid:function(e){return e&&this._byCid[e.cid||e]},at:function(e){return this.models[e]},where:function(e){return i.isEmpty(e)?[]:this.filter(function(t){for(var n in e)if(e[n]!==t.get(n))return!1;return!0})},sort:function(e){e||(e={});if(!this.comparator)throw new Error("Cannot sort a set without a comparator");var t=i.bind(this.comparator,this);return this.comparator.length==1?this.models=this.sortBy(t):this.models.sort(t),e.silent||this.trigger("reset",this,e),this},pluck:function(e){return i.map(this.models,function(t){return t.get(e)})},reset:function(e,t){e||(e=[]),t||(t={});for(var n=0,r=this.models.length;n<r;n++)this._removeReference(this.models[n]);return this._reset(),this.add(e,i.extend({silent:!0},t)),t.silent||this.trigger("reset",this,t),this},fetch:function(e){e=e?i.clone(e):{},e.parse===undefined&&(e.parse=!0);var t=this,n=e.success;return e.success=function(r,i,s){t[e.add?"add":"reset"](t.parse(r,s),e),n&&n(t,r,e),t.trigger("sync",t,r,e)},e.error=r.wrapError(e.error,t,e),this.sync("read",this,e)},create:function(e,t){var n=this;t=t?i.clone(t):{},e=this._prepareModel(e,t);if(!e)return!1;t.wait||n.add(e,t);var r=t.success;return t.success=function(e,t,i){i.wait&&n.add(e,i),r&&r(e,t,i)},e.save(null,t),e},parse:function(e,t){return e},clone:function(){return new this.constructor(this.models)},chain:function(){return i(this.models).chain()},_reset:function(e){this.length=0,this.models=[],this._byId={},this._byCid={}},_prepareModel:function(e,t){if(e instanceof u)return e.collection||(e.collection=this),e;t||(t={}),t.collection=this;var n=new this.model(e,t);return n._validate(n.attributes,t)?n:!1},_removeReference:function(e){this==e.collection&&delete e.collection,e.off("all",this._onModelEvent,this)},_onModelEvent:function(e,t,n,r){if((e=="add"||e=="remove")&&n!=this)return;e=="destroy"&&this.remove(t,r),t&&e==="change:"+t.idAttribute&&(delete this._byId[t.previous(t.idAttribute)],t.id!=null&&(this._byId[t.id]=t)),this.trigger.apply(this,arguments)}});var f=["forEach","each","map","reduce","reduceRight","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","sortBy","sortedIndex","toArray","size","first","initial","rest","last","without","indexOf","shuffle","lastIndexOf","isEmpty","groupBy"];i.each(f,function(e){a.prototype[e]=function(){return i[e].apply(i,[this.models].concat(i.toArray(arguments)))}});var l=r.Router=function(e){e||(e={}),e.routes&&(this.routes=e.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},c=/:\w+/g,h=/\*\w+/g,p=/[-[\]{}()+?.,\\^$|#\s]/g;i.extend(l.prototype,o,{initialize:function(){},route:function(e,t,n){return r.history||(r.history=new d),i.isRegExp(e)||(e=this._routeToRegExp(e)),n||(n=this[t]),r.history.route(e,i.bind(function(i){var s=this._extractParameters(e,i);n&&n.apply(this,s),this.trigger.apply(this,["route:"+t].concat(s)),r.history.trigger("route",this,t,s)},this)),this},navigate:function(e,t){r.history.navigate(e,t)},_bindRoutes:function(){if(!this.routes)return;var e=[];for(var t in this.routes)e.unshift([t,this.routes[t]]);for(var n=0,r=e.length;n<r;n++)this.route(e[n][0],e[n][1],this[e[n][1]])},_routeToRegExp:function(e){return e=e.replace(p,"\\$&").replace(c,"([^/]+)").replace(h,"(.*?)"),new RegExp("^"+e+"$")},_extractParameters:function(e,t){return e.exec(t).slice(1)}});var d=r.History=function(t){this.handlers=[],i.bindAll(this,"checkUrl"),this.location=t&&t.location||e.location,this.history=t&&t.history||e.history},v=/^[#\/]/,m=/msie [\w.]+/,g=/\/$/;d.started=!1,i.extend(d.prototype,o,{interval:50,getHash:function(e){var t=(e||this).location.href.match(/#(.*)$/);return t?t[1]:""},getFragment:function(e,t){if(e==null)if(this._hasPushState||!this._wantsHashChange||t){e=this.location.pathname;var n=this.options.root.replace(g,"");e.indexOf(n)||(e=e.substr(n.length))}else e=this.getHash();return decodeURIComponent(e.replace(v,""))},start:function(e){if(d.started)throw new Error("Backbone.history has already been started");d.started=!0,this.options=i.extend({},{root:"/"},this.options,e),this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var t=this.getFragment(),n=document.documentMode,s=m.exec(navigator.userAgent.toLowerCase())&&(!n||n<=7);s&&this._wantsHashChange&&(this.iframe=r.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(t)),this._hasPushState?r.$(window).bind("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!s?r.$(window).bind("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=t;var o=this.location,u=o.pathname==this.options.root&&!o.search;if(this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!u)return this.fragment=this.getFragment(null,!0),this.location.replace(this.options.root+this.location.search+"#"+this.fragment),!0;this._wantsPushState&&this._hasPushState&&u&&o.hash&&(this.fragment=this.getHash().replace(v,""),this.history.replaceState({},document.title,o.protocol+"//"+o.host+this.options.root+this.fragment));if(!this.options.silent)return this.loadUrl()},stop:function(){r.$(window).unbind("popstate",this.checkUrl).unbind("hashchange",this.checkUrl),clearInterval(this._checkUrlInterval),d.started=!1},route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(e){var t=this.getFragment();t==this.fragment&&this.iframe&&(t=this.getFragment(this.getHash(this.iframe)));if(t==this.fragment)return!1;this.iframe&&this.navigate(t),this.loadUrl()||this.loadUrl(this.getHash())},loadUrl:function(e){var t=this.fragment=this.getFragment(e),n=i.any(this.handlers,function(e){if(e.route.test(t))return e.callback(t),!0});return n},navigate:function(e,t){if(!d.started)return!1;if(!t||t===!0)t={trigger:t};var n=(e||"").replace(v,"");if(this.fragment==n)return;this.fragment=n;var r=(n.indexOf(this.options.root)!=0?this.options.root:"")+n;if(this._hasPushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);this._updateHash(this.location,n,t.replace),this.iframe&&n!=this.getFragment(this.getHash(this.iframe))&&(t.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,n,t.replace))}t.trigger&&this.loadUrl(e)},_updateHash:function(e,t,n){n?e.replace(e.href.replace(/(javascript:|#).*$/,"")+"#"+t):e.hash=t}});var y=r.View=function(e){this.cid=i.uniqueId("view"),this._configure(e||{}),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},b=/^(\S+)\s*(.*)$/,w=["model","collection","el","id","attributes","className","tagName"];i.extend(y.prototype,o,{tagName:"div",$:function(e){return this.$el.find(e)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this},make:function(e,t,n){var i=document.createElement(e);return t&&r.$(i).attr(t),n!=null&&r.$(i).html(n),i},setElement:function(e,t){return this.$el&&this.undelegateEvents(),this.$el=e instanceof r.$?e:r.$(e),this.el=this.$el[0],t!==!1&&this.delegateEvents(),this},delegateEvents:function(e){if(!e&&!(e=N(this,"events")))return;this.undelegateEvents();for(var t in e){var n=e[t];i.isFunction(n)||(n=this[e[t]]);if(!n)throw new Error('Method "'+e[t]+'" does not exist');var r=t.match(b),s=r[1],o=r[2];n=i.bind(n,this),s+=".delegateEvents"+this.cid,o===""?this.$el.bind(s,n):this.$el.delegate(o,s,n)}},undelegateEvents:function(){this.$el.unbind(".delegateEvents"+this.cid)},_configure:function(e){this.options&&(e=i.extend({},this.options,e));for(var t=0,n=w.length;t<n;t++){var r=w[t];e[r]&&(this[r]=e[r])}this.options=e},_ensureElement:function(){if(!this.el){var e=i.extend({},N(this,"attributes"));this.id&&(e.id=this.id),this.className&&(e["class"]=this.className),this.setElement(this.make(N(this,"tagName"),e),!1)}else this.setElement(this.el,!1)}});var E=function(e,t){var n=T(this,e,t);return n.extend=this.extend,n};u.extend=a.extend=l.extend=y.extend=E;var S={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};r.sync=function(e,t,n){var s=S[e];n||(n={});var o={type:s,dataType:"json"};return n.url||(o.url=N(t,"url")||C()),!n.data&&t&&(e=="create"||e=="update")&&(o.contentType="application/json",o.data=JSON.stringify(t)),r.emulateJSON&&(o.contentType="application/x-www-form-urlencoded",o.data=o.data?{model:o.data}:{}),r.emulateHTTP&&(s==="PUT"||s==="DELETE")&&(r.emulateJSON&&(o.data._method=s),o.type="POST",o.beforeSend=function(e){e.setRequestHeader("X-HTTP-Method-Override",s)}),o.type!=="GET"&&!r.emulateJSON&&(o.processData=!1),r.ajax(i.extend(o,n))},r.ajax=function(){return r.$.ajax.apply(r.$,arguments)},r.wrapError=function(e,t,n){return function(r,i){i=r===t?i:r,e?e(t,i,n):t.trigger("error",t,i,n)}};var x=function(){},T=function(e,t,n){var r;return t&&t.hasOwnProperty("constructor")?r=t.constructor:r=function(){e.apply(this,arguments)},i.extend(r,e),x.prototype=e.prototype,r.prototype=new x,t&&i.extend(r.prototype,t),n&&i.extend(r,n),r.prototype.constructor=r,r.__super__=e.prototype,r},N=function(e,t){return!e||!e[t]?null:i.isFunction(e[t])?e[t]():e[t]},C=function(){throw new Error('A "url" property or function must be specified')}}.call(this),define("Backbone",["Underscore","jQuery","libs/json2"],function(e){return function(){return e.Backbone}}(this)),define("fiddle_backbone/models/UsedFiddle",["Backbone"],function(e){var t=e.Model.extend({defaults:{fragment:"",full_name:"",ddl:"",sql:""},initialize:function(){this.set("last_used",new Date)}});return t}),define("fiddle_backbone/models/MyFiddleHistory",["Backbone","fiddle_backbone/models/UsedFiddle"],function(e,t){var n=e.Collection.extend({model:t,comparator:function(e,t){return e.get("last_used")==t.get("last_used")?0:e.get("last_used")>t.get("last_used")?-1:1},insert:function(e){if(!$("#user_choices",this).length){var t=this.find(function(t){return t.get("fragment")==e.get("fragment")});t?(t.set("last_used",e.get("last_used")),this.sort()):this.add(e),this.trigger("change")}},initialize:function(){try{if(localStorage){var e=localStorage.getItem("fiddleHistory");e&&e.length&&this.add($.parseJSON(e))}}catch(t){}}});return n}),define("fiddle_backbone/models/DBType",["Backbone"],function(e){var t=e.Model.extend({defaults:{sample_fragment:"",notes:"",simple_name:"",full_name:"",selected:!1,context:"host",className:""}});return t}),define("fiddle_backbone/models/DBTypesList",["Backbone","fiddle_backbone/models/DBType"],function(e,t){var n=e.Collection.extend({model:t,getSelectedType:function(){var e=this.filter(function(e){return e.get("selected")});return e.length?e[0]:!1},setSelectedType:function(e,t){this.each(function(t){t.set({selected:t.id==e},{silent:!0})}),t||this.trigger("change")}});return n}),define("fiddle_backbone/models/SchemaDef",["Backbone"],function(e){var t=e.Model.extend({defaults:{ddl:"",short_code:"",simple_name:"",full_name:"",valid:!0,errorMessage:"",loading:!1,ready:!1,schema_structure:[],statement_separator:";",browserEngines:{}},reset:function(){this.set(this.defaults),this.trigger("reloaded")},build:function(){var e=this.get("dbType"),t=this;$.ajax({type:"POST",url:"index.cfm/fiddles/createSchema",data:{statement_separator:this.get("statement_separator"),db_type_id:this.get("dbType").id,schema_ddl:this.get("ddl")},dataType:"json",success:function(n,r,i){n.short_code?e.get("context")=="browser"?t.get("browserEngines")[e.get("className")].buildSchema({short_code:$.trim(n.short_code),statement_separator:t.get("statement_separator"),ddl:t.get("ddl"),success:function(){t.set({short_code:$.trim(n.short_code),ready:!0,valid:!0,errorMessage:""}),t.get("browserEngines")[e.get("className")].getSchemaStructure({callback:function(e){t.set({schema_structure:e}),t.trigger("built")}})},error:function(e){t.set({short_code:$.trim(n.short_code),ready:!1,valid:!1,errorMessage:e,schema_structure:[]}),t.trigger("failed")}}):(t.set({short_code:$.trim(n.short_code),ready:!0,valid:!0,errorMessage:"",schema_structure:n.schema_structure}),t.trigger("built")):(t.set({short_code:"",ready:!1,valid:!1,errorMessage:n.error,schema_structure:[]}),t.trigger("failed"))},error:function(e,n,r){t.set({short_code:"",ready:!1,valid:!1,errorMessage:r,schema_structure:[]}),t.trigger("failed")}})}});return t}),define("fiddle_backbone/models/Query",["jQuery","Backbone"],function(e,t){var n=t.Model.extend({defaults:{id:0,sql:"",sets:[],pendingChanges:!1,statement_separator:";"},reset:function(){this.set(this.defaults),this.trigger("reloaded")},execute:function(){var t=this;if(!this.has("schemaDef")||!this.get("schemaDef").has("dbType")||!this.get("schemaDef").get("ready"))return!1;e.ajax({type:"POST",url:"index.cfm/fiddles/runQuery",data:{db_type_id:this.get("schemaDef").get("dbType").id,schema_short_code:this.get("schemaDef").get("short_code"),statement_separator:this.get("statement_separator"),sql:this.get("sql")},dataType:"json",success:function(e,n,r){t.get("schemaDef").get("dbType").get("context")=="browser"?t.get("schemaDef").get("browserEngines")[t.get("schemaDef").get("dbType").get("className")].executeQuery({sql:t.get("sql"),statement_separator:t.get("statement_separator"),success:function(n){t.set({id:e.ID,sets:n}),t.trigger("executed")},error:function(e){t.set({sets:[{SUCCEEDED:!1,ERRORMESSAGE:e}]}),t.trigger("executed")}}):t.set({id:e.ID,sets:e.sets})},error:function(e,n,r){t.set({sets:[]})},complete:function(e,n){t.trigger("executed")}})}});return n});var Handlebars={};Handlebars.VERSION="1.0.beta.6",Handlebars.helpers={},Handlebars.partials={},Handlebars.registerHelper=function(e,t,n){n&&(t.not=n),this.helpers[e]=t},Handlebars.registerPartial=function(e,t){this.partials[e]=t},Handlebars.registerHelper("helperMissing",function(e){if(arguments.length===2)return undefined;throw new Error("Could not find property '"+e+"'")});var toString=Object.prototype.toString,functionType="[object Function]";Handlebars.registerHelper("blockHelperMissing",function(e,t){var n=t.inverse||function(){},r=t.fn,i="",s=toString.call(e);s===functionType&&(e=e.call(this));if(e===!0)return r(this);if(e===!1||e==null)return n(this);if(s==="[object Array]"){if(e.length>0)for(var o=0,u=e.length;o<u;o++)i+=r(e[o]);else i=n(this);return i}return r(e)}),Handlebars.registerHelper("each",function(e,t){var n=t.fn,r=t.inverse,i="";if(e&&e.length>0)for(var s=0,o=e.length;s<o;s++)i+=n(e[s]);else i=r(this);return i}),Handlebars.registerHelper("if",function(e,t){var n=toString.call(e);return n===functionType&&(e=e.call(this)),!e||Handlebars.Utils.isEmpty(e)?t.inverse(this):t.fn(this)}),Handlebars.registerHelper("unless",function(e,t){var n=t.fn,r=t.inverse;return t.fn=r,t.inverse=n,Handlebars.helpers["if"].call(this,e,t)}),Handlebars.registerHelper("with",function(e,t){return t.fn(e)}),Handlebars.registerHelper("log",function(e){Handlebars.log(e)});var handlebars=function(){var e={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,statements:6,simpleInverse:7,statement:8,openInverse:9,closeBlock:10,openBlock:11,mustache:12,partial:13,CONTENT:14,COMMENT:15,OPEN_BLOCK:16,inMustache:17,CLOSE:18,OPEN_INVERSE:19,OPEN_ENDBLOCK:20,path:21,OPEN:22,OPEN_UNESCAPED:23,OPEN_PARTIAL:24,params:25,hash:26,param:27,STRING:28,INTEGER:29,BOOLEAN:30,hashSegments:31,hashSegment:32,ID:33,EQUALS:34,pathSegments:35,SEP:36,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"OPEN_PARTIAL",28:"STRING",29:"INTEGER",30:"BOOLEAN",33:"ID",34:"EQUALS",36:"SEP"},productions_:[0,[3,2],[4,3],[4,1],[4,0],[6,1],[6,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[7,2],[17,3],[17,2],[17,2],[17,1],[25,2],[25,1],[27,1],[27,1],[27,1],[27,1],[26,1],[31,2],[31,1],[32,3],[32,3],[32,3],[32,3],[21,1],[35,3],[35,1]],performAction:function(t,n,r,i,s,o,u){var a=o.length-1;switch(s){case 1:return o[a-1];case 2:this.$=new i.ProgramNode(o[a-2],o[a]);break;case 3:this.$=new i.ProgramNode(o[a]);break;case 4:this.$=new i.ProgramNode([]);break;case 5:this.$=[o[a]];break;case 6:o[a-1].push(o[a]),this.$=o[a-1];break;case 7:this.$=new i.InverseNode(o[a-2],o[a-1],o[a]);break;case 8:this.$=new i.BlockNode(o[a-2],o[a-1],o[a]);break;case 9:this.$=o[a];break;case 10:this.$=o[a];break;case 11:this.$=new i.ContentNode(o[a]);break;case 12:this.$=new i.CommentNode(o[a]);break;case 13:this.$=new i.MustacheNode(o[a-1][0],o[a-1][1]);break;case 14:this.$=new i.MustacheNode(o[a-1][0],o[a-1][1]);break;case 15:this.$=o[a-1];break;case 16:this.$=new i.MustacheNode(o[a-1][0],o[a-1][1]);break;case 17:this.$=new i.MustacheNode(o[a-1][0],o[a-1][1],!0);break;case 18:this.$=new i.PartialNode(o[a-1]);break;case 19:this.$=new i.PartialNode(o[a-2],o[a-1]);break;case 20:break;case 21:this.$=[[o[a-2]].concat(o[a-1]),o[a]];break;case 22:this.$=[[o[a-1]].concat(o[a]),null];break;case 23:this.$=[[o[a-1]],o[a]];break;case 24:this.$=[[o[a]],null];break;case 25:o[a-1].push(o[a]),this.$=o[a-1];break;case 26:this.$=[o[a]];break;case 27:this.$=o[a];break;case 28:this.$=new i.StringNode(o[a]);break;case 29:this.$=new i.IntegerNode(o[a]);break;case 30:this.$=new i.BooleanNode(o[a]);break;case 31:this.$=new i.HashNode(o[a]);break;case 32:o[a-1].push(o[a]),this.$=o[a-1];break;case 33:this.$=[o[a]];break;case 34:this.$=[o[a-2],o[a]];break;case 35:this.$=[o[a-2],new i.StringNode(o[a])];break;case 36:this.$=[o[a-2],new i.IntegerNode(o[a])];break;case 37:this.$=[o[a-2],new i.BooleanNode(o[a])];break;case 38:this.$=new i.IdNode(o[a]);break;case 39:o[a-2].push(o[a]),this.$=o[a-2];break;case 40:this.$=[o[a]]}},table:[{3:1,4:2,5:[2,4],6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{1:[3]},{5:[1,16]},{5:[2,3],7:17,8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,19],20:[2,3],22:[1,13],23:[1,14],24:[1,15]},{5:[2,5],14:[2,5],15:[2,5],16:[2,5],19:[2,5],20:[2,5],22:[2,5],23:[2,5],24:[2,5]},{4:20,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{4:21,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],24:[2,9]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],24:[2,10]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],24:[2,11]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],24:[2,12]},{17:22,21:23,33:[1,25],35:24},{17:26,21:23,33:[1,25],35:24},{17:27,21:23,33:[1,25],35:24},{17:28,21:23,33:[1,25],35:24},{21:29,33:[1,25],35:24},{1:[2,1]},{6:30,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{5:[2,6],14:[2,6],15:[2,6],16:[2,6],19:[2,6],20:[2,6],22:[2,6],23:[2,6],24:[2,6]},{17:22,18:[1,31],21:23,33:[1,25],35:24},{10:32,20:[1,33]},{10:34,20:[1,33]},{18:[1,35]},{18:[2,24],21:40,25:36,26:37,27:38,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,38],28:[2,38],29:[2,38],30:[2,38],33:[2,38],36:[1,46]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],36:[2,40]},{18:[1,47]},{18:[1,48]},{18:[1,49]},{18:[1,50],21:51,33:[1,25],35:24},{5:[2,2],8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,2],22:[1,13],23:[1,14],24:[1,15]},{14:[2,20],15:[2,20],16:[2,20],19:[2,20],22:[2,20],23:[2,20],24:[2,20]},{5:[2,7],14:[2,7],15:[2,7],16:[2,7],19:[2,7],20:[2,7],22:[2,7],23:[2,7],24:[2,7]},{21:52,33:[1,25],35:24},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],24:[2,8]},{14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],24:[2,14]},{18:[2,22],21:40,26:53,27:54,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,23]},{18:[2,26],28:[2,26],29:[2,26],30:[2,26],33:[2,26]},{18:[2,31],32:55,33:[1,56]},{18:[2,27],28:[2,27],29:[2,27],30:[2,27],33:[2,27]},{18:[2,28],28:[2,28],29:[2,28],30:[2,28],33:[2,28]},{18:[2,29],28:[2,29],29:[2,29],30:[2,29],33:[2,29]},{18:[2,30],28:[2,30],29:[2,30],30:[2,30],33:[2,30]},{18:[2,33],33:[2,33]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],34:[1,57],36:[2,40]},{33:[1,58]},{14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],24:[2,13]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],24:[2,16]},{5:[2,17],14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],24:[2,17]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],24:[2,18]},{18:[1,59]},{18:[1,60]},{18:[2,21]},{18:[2,25],28:[2,25],29:[2,25],30:[2,25],33:[2,25]},{18:[2,32],33:[2,32]},{34:[1,57]},{21:61,28:[1,62],29:[1,63],30:[1,64],33:[1,25],35:24},{18:[2,39],28:[2,39],29:[2,39],30:[2,39],33:[2,39],36:[2,39]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],24:[2,19]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],24:[2,15]},{18:[2,34],33:[2,34]},{18:[2,35],33:[2,35]},{18:[2,36],33:[2,36]},{18:[2,37],33:[2,37]}],defaultActions:{16:[2,1],37:[2,23],53:[2,21]},parseError:function(t,n){throw new Error(t)},parse:function(t){function d(e){r.length=r.length-2*e,i.length=i.length-e,s.length=s.length-e}function v(){var e;return e=n.lexer.lex()||1,typeof e!="number"&&(e=n.symbols_[e]||e),e}var n=this,r=[0],i=[null],s=[],o=this.table,u="",a=0,f=0,l=0,c=2,h=1;this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,typeof this.lexer.yylloc=="undefined"&&(this.lexer.yylloc={});var p=this.lexer.yylloc;s.push(p),typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);var m,g,y,b,w,E,S={},x,T,N,C;for(;;){y=r[r.length-1],this.defaultActions[y]?b=this.defaultActions[y]:(m==null&&(m=v()),b=o[y]&&o[y][m]);if(typeof b=="undefined"||!b.length||!b[0])if(!l){C=[];for(x in o[y])this.terminals_[x]&&x>2&&C.push("'"+this.terminals_[x]+"'");var k="";this.lexer.showPosition?k="Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+C.join(", ")+", got '"+this.terminals_[m]+"'":k="Parse error on line "+(a+1)+": Unexpected "+(m==1?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(k,{text:this.lexer.match,token:this.terminals_[m]||m,line:this.lexer.yylineno,loc:p,expected:C})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+y+", token: "+m);switch(b[0]){case 1:r.push(m),i.push(this.lexer.yytext),s.push(this.lexer.yylloc),r.push(b[1]),m=null,g?(m=g,g=null):(f=this.lexer.yyleng,u=this.lexer.yytext,a=this.lexer.yylineno,p=this.lexer.yylloc,l>0&&l--);break;case 2:T=this.productions_[b[1]][1],S.$=i[i.length-T],S._$={first_line:s[s.length-(T||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(T||1)].first_column,last_column:s[s.length-1].last_column},E=this.performAction.call(S,u,f,a,this.yy,b[1],i,s);if(typeof E!="undefined")return E;T&&(r=r.slice(0,-1*T*2),i=i.slice(0,-1*T),s=s.slice(0,-1*T)),r.push(this.productions_[b[1]][0]),i.push(S.$),s.push(S._$),N=o[r[r.length-2]][r[r.length-1]],r.push(N);break;case 3:return!0}}return!0}},t=function(){var e={EOF:1,parseError:function(t,n){if(!this.yy.parseError)throw new Error(t);this.yy.parseError(t,n)},setInput:function(e){return this._input=e,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this},input:function(){var e=this._input[0];this.yytext+=e,this.yyleng++,this.match+=e,this.matched+=e;var t=e.match(/\n/);return t&&this.yylineno++,this._input=this._input.slice(1),e},unput:function(e){return this._input=e+this._input,this},more:function(){return this._more=!0,this},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=(new Array(e.length+1)).join("-");return e+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext="",this.match="");var i=this._currentRules();for(var s=0;s<i.length;s++){t=this._input.match(this.rules[i[s]]);if(t){r=t[0].match(/\n.*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-1:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,i[s],this.conditionStack[this.conditionStack.length-1]);if(e)return e;return}}if(this._input==="")return this.EOF;this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return typeof t!="undefined"?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(t){this.begin(t)}};return e.performAction=function(t,n,r,i){var s=i;switch(r){case 0:n.yytext.slice(-1)!=="\\"&&this.begin("mu"),n.yytext.slice(-1)==="\\"&&(n.yytext=n.yytext.substr(0,n.yyleng-1),this.begin("emu"));if(n.yytext)return 14;break;case 1:return 14;case 2:return this.popState(),14;case 3:return 24;case 4:return 16;case 5:return 20;case 6:return 19;case 7:return 19;case 8:return 23;case 9:return 23;case 10:return n.yytext=n.yytext.substr(3,n.yyleng-5),this.popState(),15;case 11:return 22;case 12:return 34;case 13:return 33;case 14:return 33;case 15:return 36;case 16:break;case 17:return this.popState(),18;case 18:return this.popState(),18;case 19:return n.yytext=n.yytext.substr(1,n.yyleng-2).replace(/\\"/g,'"'),28;case 20:return 30;case 21:return 30;case 22:return 29;case 23:return 33;case 24:return n.yytext=n.yytext.substr(1,n.yyleng-2),33;case 25:return"INVALID";case 26:return 5}},e.rules=[/^[^\x00]*?(?=(\{\{))/,/^[^\x00]+/,/^[^\x00]{2,}?(?=(\{\{))/,/^\{\{>/,/^\{\{#/,/^\{\{\//,/^\{\{\^/,/^\{\{\s*else\b/,/^\{\{\{/,/^\{\{&/,/^\{\{![\s\S]*?\}\}/,/^\{\{/,/^=/,/^\.(?=[} ])/,/^\.\./,/^[\/.]/,/^\s+/,/^\}\}\}/,/^\}\}/,/^"(\\["]|[^"])*"/,/^true(?=[}\s])/,/^false(?=[}\s])/,/^[0-9]+(?=[}\s])/,/^[a-zA-Z0-9_$-]+(?=[=}\s\/.])/,/^\[[^\]]*\]/,/^./,/^$/],e.conditions={mu:{rules:[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26],inclusive:!1},emu:{rules:[2],inclusive:!1},INITIAL:{rules:[0,1,26],inclusive:!0}},e}();return e.lexer=t,e}();typeof require!="undefined"&&typeof exports!="undefined"&&(exports.parser=handlebars,exports.parse=function(){return handlebars.parse.apply(handlebars,arguments)},exports.main=function(t){if(!t[1])throw new Error("Usage: "+t[0]+" FILE");if(typeof process!="undefined")var n=require("fs").readFileSync(require("path").join(process.cwd(),t[1]),"utf8");else var r=require("file").path(require("file").cwd()),n=r.join(t[1]).read({charset:"utf-8"});return exports.parser.parse(n)},typeof module!="undefined"&&require.main===module&&exports.main(typeof process!="undefined"?process.argv.slice(1):require("system").args)),Handlebars.Parser=handlebars,Handlebars.parse=function(e){return Handlebars.Parser.yy=Handlebars.AST,Handlebars.Parser.parse(e)},Handlebars.print=function(e){return(new Handlebars.PrintVisitor).accept(e)},Handlebars.logger={DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(e,t){}},Handlebars.log=function(e,t){Handlebars.logger.log(e,t)},function(){Handlebars.AST={},Handlebars.AST.ProgramNode=function(e,t){this.type="program",this.statements=e,t&&(this.inverse=new Handlebars.AST.ProgramNode(t))},Handlebars.AST.MustacheNode=function(e,t,n){this.type="mustache",this.id=e[0],this.params=e.slice(1),this.hash=t,this.escaped=!n},Handlebars.AST.PartialNode=function(e,t){this.type="partial",this.id=e,this.context=t};var e=function(e,t){if(e.original!==t.original)throw new Handlebars.Exception(e.original+" doesn't match "+t.original)};Handlebars.AST.BlockNode=function(t,n,r){e(t.id,r),this.type="block",this.mustache=t,this.program=n},Handlebars.AST.InverseNode=function(t,n,r){e(t.id,r),this.type="inverse",this.mustache=t,this.program=n},Handlebars.AST.ContentNode=function(e){this.type="content",this.string=e},Handlebars.AST.HashNode=function(e){this.type="hash",this.pairs=e},Handlebars.AST.IdNode=function(e){this.type="ID",this.original=e.join(".");var t=[],n=0;for(var r=0,i=e.length;r<i;r++){var s=e[r];s===".."?n++:s==="."||s==="this"?this.isScoped=!0:t.push(s)}this.parts=t,this.string=t.join("."),this.depth=n,this.isSimple=t.length===1&&n===0},Handlebars.AST.StringNode=function(e){this.type="STRING",this.string=e},Handlebars.AST.IntegerNode=function(e){this.type="INTEGER",this.integer=e},Handlebars.AST.BooleanNode=function(e){this.type="BOOLEAN",this.bool=e},Handlebars.AST.CommentNode=function(e){this.type="comment",this.comment=e}}(),Handlebars.Exception=function(e){var t=Error.prototype.constructor.apply(this,arguments);for(var n in t)t.hasOwnProperty(n)&&(this[n]=t[n]);this.message=t.message},Handlebars.Exception.prototype=new Error,Handlebars.SafeString=function(e){this.string=e},Handlebars.SafeString.prototype.toString=function(){return this.string.toString()},function(){var e={"<":"<",">":">",'"':""","'":"'","`":"`"},t=/&(?!\w+;)|[<>"'`]/g,n=/[&<>"'`]/,r=function(t){return e[t]||"&"};Handlebars.Utils={escapeExpression:function(e){return e instanceof Handlebars.SafeString?e.toString():e==null||e===!1?"":n.test(e)?e.replace(t,r):e},isEmpty:function(e){return typeof e=="undefined"?!0:e===null?!0:e===!1?!0:Object.prototype.toString.call(e)==="[object Array]"&&e.length===0?!0:!1}}}(),Handlebars.Compiler=function(){},Handlebars.JavaScriptCompiler=function(){},function(e,t){e.OPCODE_MAP={appendContent:1,getContext:2,lookupWithHelpers:3,lookup:4,append:5,invokeMustache:6,appendEscaped:7,pushString:8,truthyOrFallback:9,functionOrFallback:10,invokeProgram:11,invokePartial:12,push:13,assignToHash:15,pushStringParam:16},e.MULTI_PARAM_OPCODES={appendContent:1,getContext:1,lookupWithHelpers:2,lookup:1,invokeMustache:3,pushString:1,truthyOrFallback:1,functionOrFallback:1,invokeProgram:3,invokePartial:1,push:1,assignToHash:1,pushStringParam:1},e.DISASSEMBLE_MAP={};for(var n in e.OPCODE_MAP){var r=e.OPCODE_MAP[n];e.DISASSEMBLE_MAP[r]=n}e.multiParamSize=function(t){return e.MULTI_PARAM_OPCODES[e.DISASSEMBLE_MAP[t]]},e.prototype={compiler:e,disassemble:function(){var t=this.opcodes,n,r,i=[],s,o,u;for(var a=0,f=t.length;a<f;a++){n=t[a];if(n==="DECLARE")o=t[++a],u=t[++a],i.push("DECLARE "+o+" = "+u);else{s=e.DISASSEMBLE_MAP[n];var l=e.multiParamSize(n),c=[];for(var h=0;h<l;h++)r=t[++a],typeof r=="string"&&(r='"'+r.replace("\n","\\n")+'"'),c.push(r);s=s+" "+c.join(" "),i.push(s)}}return i.join("\n")},guid:0,compile:function(e,t){this.children=[],this.depths={list:[]},this.options=t;var n=this.options.knownHelpers;this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0};if(n)for(var r in n)this.options.knownHelpers[r]=n[r];return this.program(e)},accept:function(e){return this[e.type](e)},program:function(e){var t=e.statements,n;this.opcodes=[];for(var r=0,i=t.length;r<i;r++)n=t[r],this[n.type](n);return this.isSimple=i===1,this.depths.list=this.depths.list.sort(function(e,t){return e-t}),this},compileProgram:function(e){var t=(new this.compiler).compile(e,this.options),n=this.guid++;this.usePartial=this.usePartial||t.usePartial,this.children[n]=t;for(var r=0,i=t.depths.list.length;r<i;r++){depth=t.depths.list[r];if(depth<2)continue;this.addDepth(depth-1)}return n},block:function(e){var t=e.mustache,n,r,i,s,o=this.setupStackForMustache(t),u=this.compileProgram(e.program);e.program.inverse&&(s=this.compileProgram(e.program.inverse),this.declare("inverse",s)),this.opcode("invokeProgram",u,o.length,!!t.hash),this.declare("inverse",null),this.opcode("append")},inverse:function(e){var t=this.setupStackForMustache(e.mustache),n=this.compileProgram(e.program);this.declare("inverse",n),this.opcode("invokeProgram",null,t.length,!!e.mustache.hash),this.declare("inverse",null),this.opcode("append")},hash:function(e){var t=e.pairs,n,r;this.opcode("push","{}");for(var i=0,s=t.length;i<s;i++)n=t[i],r=n[1],this.accept(r),this.opcode("assignToHash",n[0])},partial:function(e){var t=e.id;this.usePartial=!0,e.context?this.ID(e.context):this.opcode("push","depth0"),this.opcode("invokePartial",t.original),this.opcode("append")},content:function(e){this.opcode("appendContent",e.string)},mustache:function(e){var t=this.setupStackForMustache(e);this.opcode("invokeMustache",t.length,e.id.original,!!e.hash),e.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},ID:function(e){this.addDepth(e.depth),this.opcode("getContext",e.depth),this.opcode("lookupWithHelpers",e.parts[0]||null,e.isScoped||!1);for(var t=1,n=e.parts.length;t<n;t++)this.opcode("lookup",e.parts[t])},STRING:function(e){this.opcode("pushString",e.string)},INTEGER:function(e){this.opcode("push",e.integer)},BOOLEAN:function(e){this.opcode("push",e.bool)},comment:function(){},pushParams:function(e){var t=e.length,n;while(t--)n=e[t],this.options.stringParams?(n.depth&&this.addDepth(n.depth),this.opcode("getContext",n.depth||0),this.opcode("pushStringParam",n.string)):this[n.type](n)},opcode:function(t,n,r,i){this.opcodes.push(e.OPCODE_MAP[t]),n!==undefined&&this.opcodes.push(n),r!==undefined&&this.opcodes.push(r),i!==undefined&&this.opcodes.push(i)},declare:function(e,t){this.opcodes.push("DECLARE"),this.opcodes.push(e),this.opcodes.push(t)},addDepth:function(e){if(e===0)return;this.depths[e]||(this.depths[e]=!0,this.depths.list.push(e))},setupStackForMustache:function(e){var t=e.params;return this.pushParams(t),e.hash&&this.hash(e.hash),this.ID(e.id),t}},t.prototype={nameLookup:function(e,n,r){return/^[0-9]+$/.test(n)?e+"["+n+"]":t.isValidJavaScriptVariableName(n)?e+"."+n:e+"['"+n+"']"},appendToBuffer:function(e){return this.environment.isSimple?"return "+e+";":"buffer += "+e+";"},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(e,t,n,r){this.environment=e,this.options=t||{},this.name=this.environment.name,this.isChild=!!n,this.context=n||{programs:[],aliases:{self:"this"},registers:{list:[]}},this.preamble(),this.stackSlot=0,this.stackVars=[],this.compileChildren(e,t);var i=e.opcodes,s;this.i=0;for(u=i.length;this.i<u;this.i++)s=this.nextOpcode(0),s[0]==="DECLARE"?(this.i=this.i+2,this[s[1]]=s[2]):(this.i=this.i+s[1].length,this[s[0]].apply(this,s[1]));return this.createFunctionContext(r)},nextOpcode:function(t){var n=this.environment.opcodes,r=n[this.i+t],i,s,o,u;if(r==="DECLARE")return i=n[this.i+1],s=n[this.i+2],["DECLARE",i,s];i=e.DISASSEMBLE_MAP[r],o=e.multiParamSize(r),u=[];for(var a=0;a<o;a++)u.push(n[this.i+a+1+t]);return[i,u]},eat:function(e){this.i=this.i+e.length},preamble:function(){var e=[];this.useRegister("foundHelper");if(!this.isChild){var t=this.namespace,n="helpers = helpers || "+t+".helpers;";this.environment.usePartial&&(n=n+" partials = partials || "+t+".partials;"),e.push(n)}else e.push("");this.environment.isSimple?e.push(""):e.push(", buffer = "+this.initializeBuffer()),this.lastContext=0,this.source=e},createFunctionContext:function(e){var t=this.stackVars;this.isChild||(t=t.concat(this.context.registers.list)),t.length>0&&(this.source[1]=this.source[1]+", "+t.join(", "));if(!this.isChild){var n=[];for(var r in this.context.aliases)this.source[1]=this.source[1]+", "+r+"="+this.context.aliases[r]}this.source[1]&&(this.source[1]="var "+this.source[1].substring(2)+";"),this.isChild||(this.source[1]+="\n"+this.context.programs.join("\n")+"\n"),this.environment.isSimple||this.source.push("return buffer;");var i=this.isChild?["depth0","data"]:["Handlebars","depth0","helpers","partials","data"];for(var s=0,o=this.environment.depths.list.length;s<o;s++)i.push("depth"+this.environment.depths.list[s]);if(e)return i.push(this.source.join("\n ")),Function.apply(this,i);var u="function "+(this.name||"")+"("+i.join(",")+") {\n "+this.source.join("\n ")+"}";return Handlebars.log(Handlebars.logger.DEBUG,u+"\n\n"),u},appendContent:function(e){this.source.push(this.appendToBuffer(this.quotedString(e)))},append:function(){var e=this.popStack();this.source.push("if("+e+" || "+e+" === 0) { "+this.appendToBuffer(e)+" }"),this.environment.isSimple&&this.source.push("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){var e=this.nextOpcode(1),t="";this.context.aliases.escapeExpression="this.escapeExpression",e[0]==="appendContent"&&(t=" + "+this.quotedString(e[1][0]),this.eat(e)),this.source.push(this.appendToBuffer("escapeExpression("+this.popStack()+")"+t))},getContext:function(e){this.lastContext!==e&&(this.lastContext=e)},lookupWithHelpers:function(e,t){if(e){var n=this.nextStack();this.usingKnownHelper=!1;var r;!t&&this.options.knownHelpers[e]?(r=n+" = "+this.nameLookup("helpers",e,"helper"),this.usingKnownHelper=!0):t||this.options.knownHelpersOnly?r=n+" = "+this.nameLookup("depth"+this.lastContext,e,"context"):(this.register("foundHelper",this.nameLookup("helpers",e,"helper")),r=n+" = foundHelper || "+this.nameLookup("depth"+this.lastContext,e,"context")),r+=";",this.source.push(r)}else this.pushStack("depth"+this.lastContext)},lookup:function(e){var t=this.topStack();this.source.push(t+" = ("+t+" === null || "+t+" === undefined || "+t+" === false ? "+t+" : "+this.nameLookup(t,e,"context")+");")},pushStringParam:function(e){this.pushStack("depth"+this.lastContext),this.pushString(e)},pushString:function(e){this.pushStack(this.quotedString(e))},push:function(e){this.pushStack(e)},invokeMustache:function(e,t,n){this.populateParams(e,this.quotedString(t),"{}",null,n,function(e,t,n){this.usingKnownHelper||(this.context.aliases.helperMissing="helpers.helperMissing",this.context.aliases.undef="void 0",this.source.push("else if("+n+"=== undef) { "+e+" = helperMissing.call("+t+"); }"),e!==n&&this.source.push("else { "+e+" = "+n+"; }"))})},invokeProgram:function(e,t,n){var r=this.programExpression(this.inverse),i=this.programExpression(e);this.populateParams(t,null,i,r,n,function(e,t,n){this.usingKnownHelper||(this.context.aliases.blockHelperMissing="helpers.blockHelperMissing",this.source.push("else { "+e+" = blockHelperMissing.call("+t+"); }"))})},populateParams:function(e,t,n,r,i,s){var o=i||this.options.stringParams||r||this.options.data,u=this.popStack(),a,f=[],l,c,h;o?(this.register("tmp1",n),h="tmp1"):h="{ hash: {} }";if(o){var p=i?this.popStack():"{}";this.source.push("tmp1.hash = "+p+";")}this.options.stringParams&&this.source.push("tmp1.contexts = [];");for(var d=0;d<e;d++)l=this.popStack(),f.push(l),this.options.stringParams&&this.source.push("tmp1.contexts.push("+this.popStack()+");");r&&(this.source.push("tmp1.fn = tmp1;"),this.source.push("tmp1.inverse = "+r+";")),this.options.data&&this.source.push("tmp1.data = data;"),f.push(h),this.populateCall(f,u,t||u,s,n!=="{}")},populateCall:function(e,t,n,r,i){var s=["depth0"].concat(e).join(", "),o=["depth0"].concat(n).concat(e).join(", "),u=this.nextStack();if(this.usingKnownHelper)this.source.push(u+" = "+t+".call("+s+");");else{this.context.aliases.functionType='"function"';var a=i?"foundHelper && ":"";this.source.push("if("+a+"typeof "+t+" === functionType) { "+u+" = "+t+".call("+s+"); }")}r.call(this,u,o,t),this.usingKnownHelper=!1},invokePartial:function(e){params=[this.nameLookup("partials",e,"partial"),"'"+e+"'",this.popStack(),"helpers","partials"],this.options.data&¶ms.push("data"),this.pushStack("self.invokePartial("+params.join(", ")+");")},assignToHash:function(e){var t=this.popStack(),n=this.topStack();this.source.push(n+"['"+e+"'] = "+t+";")},compiler:t,compileChildren:function(e,t){var n=e.children,r,i;for(var s=0,o=n.length;s<o;s++){r=n[s],i=new this.compiler,this.context.programs.push("");var u=this.context.programs.length;r.index=u,r.name="program"+u,this.context.programs[u]=i.compile(r,t,this.context)}},programExpression:function(e){if(e==null)return"self.noop";var t=this.environment.children[e],n=t.depths.list,r=[t.index,t.name,"data"];for(var i=0,s=n.length;i<s;i++)depth=n[i],depth===1?r.push("depth0"):r.push("depth"+(depth-1));return n.length===0?"self.program("+r.join(", ")+")":(r.shift(),"self.programWithDepth("+r.join(", ")+")")},register:function(e,t){this.useRegister(e),this.source.push(e+" = "+t+";")},useRegister:function(e){this.context.registers[e]||(this.context.registers[e]=!0,this.context.registers.list.push(e))},pushStack:function(e){return this.source.push(this.nextStack()+" = "+e+";"),"stack"+this.stackSlot},nextStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),"stack"+this.stackSlot},popStack:function(){return"stack"+this.stackSlot--},topStack:function(){return"stack"+this.stackSlot},quotedString:function(e){return'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r")+'"'}};var i="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),s=t.RESERVED_WORDS={};for(var o=0,u=i.length;o<u;o++)s[i[o]]=!0;t.isValidJavaScriptVariableName=function(e){return!t.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(e)?!0:!1}}(Handlebars.Compiler,Handlebars.JavaScriptCompiler),Handlebars.precompile=function(e,t){t=t||{};var n=Handlebars.parse(e),r=(new Handlebars.Compiler).compile(n,t);return(new Handlebars.JavaScriptCompiler).compile(r,t)},Handlebars.compile=function(e,t){function r(){var n=Handlebars.parse(e),r=(new Handlebars.Compiler).compile(n,t),i=(new Handlebars.JavaScriptCompiler).compile(r,t,undefined,!0);return Handlebars.template(i)}t=t||{};var n;return function(e,t){return n||(n=r()),n.call(this,e,t)}},Handlebars.VM={template:function(e){var t={escapeExpression:Handlebars.Utils.escapeExpression,invokePartial:Handlebars.VM.invokePartial,programs:[],program:function(e,t,n){var r=this.programs[e];return n?Handlebars.VM.program(t,n):r?r:(r=this.programs[e]=Handlebars.VM.program(t),r)},programWithDepth:Handlebars.VM.programWithDepth,noop:Handlebars.VM.noop};return function(n,r){return r=r||{},e.call(t,Handlebars,n,r.helpers,r.partials,r.data)}},programWithDepth:function(e,t,n){var r=Array.prototype.slice.call(arguments,2);return function(n,i){return i=i||{},e.apply(this,[n,i.data||t].concat(r))}},program:function(e,t){return function(n,r){return r=r||{},e(n,r.data||t)}},noop:function(){return""},invokePartial:function(e,t,n,r,i,s){options={helpers:r,partials:i,data:s};if(e===undefined)throw new Handlebars.Exception("The partial "+t+" could not be found");if(e instanceof Function)return e(n,options);if(!Handlebars.compile)throw new Handlebars.Exception("The partial "+t+" could not be compiled when running in runtime-only mode");return i[t]=Handlebars.compile(e),i[t](n,options)}},Handlebars.template=Handlebars.VM.template,define("Handlebars",function(e){return function(){return e.Handlebars}}(this)),define("text",["module"],function(e){var t,n,r=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],i=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,s=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,o=typeof location!="undefined"&&location.href,u=o&&location.protocol&&location.protocol.replace(/\:/,""),a=o&&location.hostname,f=o&&(location.port||undefined),l=[],c=e.config&&e.config()||{};t={version:"2.0.3",strip:function(e){if(e){e=e.replace(i,"");var t=e.match(s);t&&(e=t[1])}else e="";return e},jsEscape:function(e){return e.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:c.createXhr||function(){var e,t,n;if(typeof XMLHttpRequest!="undefined")return new XMLHttpRequest;if(typeof ActiveXObject!="undefined")for(t=0;t<3;t+=1){n=r[t];try{e=new ActiveXObject(n)}catch(i){}if(e){r=[n];break}}return e},parseName:function(e){var t=!1,n=e.indexOf("."),r=e.substring(0,n),i=e.substring(n+1,e.length);return n=i.indexOf("!"),n!==-1&&(t=i.substring(n+1,i.length),t=t==="strip",i=i.substring(0,n)),{moduleName:r,ext:i,strip:t}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,n,r,i){var s,o,u,a=t.xdRegExp.exec(e);return a?(s=a[2],o=a[3],o=o.split(":"),u=o[1],o=o[0],(!s||s===n)&&(!o||o.toLowerCase()===r.toLowerCase())&&(!u&&!o||u===i)):!0},finishLoad:function(e,n,r,i){r=n?t.strip(r):r,c.isBuild&&(l[e]=r),i(r)},load:function(e,n,r,i){if(i.isBuild&&!i.inlineText){r();return}c.isBuild=i.isBuild;var s=t.parseName(e),l=s.moduleName+"."+s.ext,h=n.toUrl(l),p=c.useXhr||t.useXhr;!o||p(h,u,a,f)?t.get(h,function(n){t.finishLoad(e,s.strip,n,r)},function(e){r.error&&r.error(e)}):n([l],function(e){t.finishLoad(s.moduleName+"."+s.ext,s.strip,e,r)})},write:function(e,n,r,i){if(l.hasOwnProperty(n)){var s=t.jsEscape(l[n]);r.asModule(e+"!"+n,"define(function () { return '"+s+"';});\n")}},writeFile:function(e,n,r,i,s){var o=t.parseName(n),u=o.moduleName+"."+o.ext,a=r.toUrl(o.moduleName+"."+o.ext)+".js";t.load(u,r,function(n){var r=function(e){return i(a,e)};r.asModule=function(e,t){return i.asModule(e,a,t)},t.write(e,u,r,s)},s)}};if(c.env==="node"||!c.env&&typeof process!="undefined"&&process.versions&&!!process.versions.node)n=require.nodeRequire("fs"),t.get=function(e,t){var r=n.readFileSync(e,"utf8");r.indexOf("")===0&&(r=r.substring(1)),t(r)};else if(c.env==="xhr"||!c.env&&t.createXhr())t.get=function(e,n,r){var i=t.createXhr();i.open("GET",e,!0),c.onXhr&&c.onXhr(i,e),i.onreadystatechange=function(t){var s,o;i.readyState===4&&(s=i.status,s>399&&s<600?(o=new Error(e+" HTTP status: "+s),o.xhr=i,r(o)):n(i.responseText))},i.send(null)};else if(c.env==="rhino"||!c.env&&typeof Packages!="undefined"&&typeof java!="undefined")t.get=function(e,t){var n,r,i="utf-8",s=new java.io.File(e),o=java.lang.System.getProperty("line.separator"),u=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(s),i)),a="";try{n=new java.lang.StringBuffer,r=u.readLine(),r&&r.length()&&r.charAt(0)===65279&&(r=r.substring(1)),n.append(r);while((r=u.readLine())!==null)n.append(o),n.append(r);a=String(n.toString())}finally{u.close()}t(a)};return t}),define("text!fiddle_backbone/templates/dbTypes.html",[],function(){return' <a class="dropdown-toggle" data-toggle="dropdown" href="#">\n {{selectedFullName}} <b class="caret"></b>\n </a>\n <ul class="dropdown-menu">\n {{#each dbTypes}}\n <li db_type_id="{{this.id}}" class="{{this.className}}"><a href="#"><i class="icon-tag"></i>{{this.full_name}}</a></li>\n {{/each}}\n </ul>'}),define("fiddle_backbone/views/DBTypesList",["jQuery","Backbone","Handlebars","text!fiddle_backbone/templates/dbTypes.html"],function(e,t,n,r){var i=t.View.extend({initialize:function(){this.compiledTemplate=n.compile(r)},events:{"click ul.dropdown-menu li":"clickDBType"},clickDBType:function(t){t.preventDefault(),this.collection.setSelectedType(e(t.currentTarget).attr("db_type_id"))},render:function(){var t=this.collection.getSelectedType();return e(this.el).html(this.compiledTemplate({dbTypes:this.collection.map(function(e){var t=e.toJSON();return t.className=t.selected?"active":"",t}),selectedFullName:t.get("full_name")})),e("#db_type_label_collapsed .navbar-text").text(t.get("full_name")),this}});return i}),window.CodeMirror=function(){function e(r,i){function cn(e){if(s.onDragEvent&&s.onDragEvent(vn,K(e)))return;Y(e)}function dn(e){return e>=0&&e<Dt.size}function mn(e){return z(Dt,e)}function gn(e,t){Qt=!0;var n=t-e.height;for(var r=e;r;r=r.parent)r.height+=n}function yn(e,t){return e.styles||e.highlight(_t,e.stateAfter=ai(W(e)),s.tabSize),e.getContent(s.tabSize,t,s.lineWrapping)}function bn(e){var t={line:0,ch:0};jn(t,{line:Dt.size-1,ch:mn(Dt.size-1).text.length},Nt(e),t,t),Xt=!0}function wn(e){var t=[];return Dt.iter(0,Dt.size,function(e){t.push(e.text)}),t.join(e||"\n")}function En(e){M.scrollTop!=qt&&(qt=Et.scrollTop=M.scrollTop,ur([]))}function Sn(e){s.fixedGutter&&ut.style.left!=Et.scrollLeft+"px"&&(ut.style.left=Et.scrollLeft+"px"),Et.scrollTop!=qt&&(qt=Et.scrollTop,M.scrollTop!=qt&&(M.scrollTop=qt),ur([])),s.onScroll&&s.onScroll(vn)}function xn(e){function u(t){b&&(Et.draggable=!1),Rt=!1,l(),c(),Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)<10&&(Q(t),mr(n.line,n.ch,!0),tr())}function m(e){if(i=="single")pr(n,e);else if(i=="double"){var t=xr(e);mt(e,h)?pr(t.from,p):pr(h,t.to)}else i=="triple"&&(mt(e,h)?pr(p,yr({line:e.line,ch:0})):pr(h,yr({line:e.line+1,ch:0})))}function g(e){var t=ti(e,!0);if(t&&!vt(t,a)){Ht||Hn(),a=t,m(t),Xt=!1;var n=or();if(t.line>=n.to||t.line<n.from)f=setTimeout(di(function(){g(e)}),150)}}function y(e){clearTimeout(f);var t=ti(e);t&&m(t),Q(e),tr(),Xt=!0,w(),l()}hr(tt(e,"shiftKey"));for(var t=Z(e);t!=Lt;t=t.parentNode)if(t.parentNode==ct&&t!=at)return;for(var t=Z(e);t!=Lt;t=t.parentNode)if(t.parentNode==ot)return s.onGutterClick&&s.onGutterClick(vn,xt(ot.childNodes,t)+Zt,e),Q(e);var n=ti(e);switch(et(e)){case 3:d&&ri(e);return;case 2:n&&mr(n.line,n.ch,!0),setTimeout(tr,20),Q(e);return}if(!n){Z(e)==Et&&Q(e);return}Ht||Hn();var r=+(new Date),i="single";if(It&&It.time>r-400&&vt(It.pos,n))i="triple",Q(e),setTimeout(tr,20),Tr(n.line);else if(Ft&&Ft.time>r-400&&vt(Ft.pos,n)){i="double",It={time:r,pos:n},Q(e);var o=xr(n);pr(o.from,o.to)}else Ft={time:r,pos:n};var a=n,f;if(s.dragDrop&&st&&!s.readOnly&&!vt(Bt.from,Bt.to)&&!mt(n,Bt.from)&&!mt(Bt.to,n)&&i=="single"){b&&(Et.draggable=!0);var l=nt(document,"mouseup",di(u),!0),c=nt(Et,"drop",di(u),!0);Rt=!0,Et.dragDrop&&Et.dragDrop();return}Q(e),i=="single"&&mr(n.line,n.ch,!0);var h=Bt.from,p=Bt.to,w=nt(document,"mousemove",di(function(e){clearTimeout(f),Q(e),!v&&!et(e)?y(e):g(e)}),!0),l=nt(document,"mouseup",di(y),!0)}function Tn(e){for(var t=Z(e);t!=Lt;t=t.parentNode)if(t.parentNode==ot)return Q(e);Q(e)}function Nn(e){if(s.onDragEvent&&s.onDragEvent(vn,K(e)))return;Q(e);var t=ti(e,!0),n=e.dataTransfer.files;if(!t||s.readOnly)return;if(n&&n.length&&window.FileReader&&window.File){var r=n.length,i=Array(r),o=0,u=function(e,n){var s=new FileReader;s.onload=function(){i[n]=s.result,++o==r&&(t=yr(t),di(function(){var e=Xn(i.join(""),t,t);pr(t,e)})())},s.readAsText(e)};for(var a=0;a<r;++a)u(n[a],a)}else{if(Rt&&!mt(t,Bt.from)&&!mt(Bt.to,t))return;try{var i=e.dataTransfer.getData("Text");i&&vi(function(){var e=Bt.from,n=Bt.to;pr(t,t),Rt&&Xn("",e,n),Vn(i),tr()})}catch(e){}}}function Cn(e){var t=Kn();e.dataTransfer.setData("Text",t),e.dataTransfer.setDragImage&&e.dataTransfer.setDragImage(yt("img"),0,0)}function kn(e,t){if(typeof e=="string"){e=f[e];if(!e)return!1}var n=jt;try{s.readOnly&&(zt=!0),t&&(jt=null),e(vn)}catch(r){if(r!=it)throw r;return!1}finally{jt=n,zt=!1}return!0}function An(e){function f(){a=!0}var t=c(s.keyMap),r=t.auto;clearTimeout(Ln),r&&!p(e)&&(Ln=setTimeout(function(){c(s.keyMap)==t&&(s.keyMap=r.call?r.call(null,vn):r)},50));var i=kt[tt(e,"keyCode")],o=!1,u=E&&n;if(i==null||e.altGraphKey)return!1;tt(e,"altKey")&&(i="Alt-"+i),tt(e,u?"metaKey":"ctrlKey")&&(i="Ctrl-"+i),tt(e,u?"ctrlKey":"metaKey")&&(i="Cmd-"+i);var a=!1;return tt(e,"shiftKey")?o=h("Shift-"+i,s.extraKeys,s.keyMap,function(e){return kn(e,!0)},f)||h(i,s.extraKeys,s.keyMap,function(e){if(typeof e=="string"&&/^go[A-Z]/.test(e))return kn(e)},f):o=h(i,s.extraKeys,s.keyMap,kn,f),a&&(o=!1),o&&(Q(e),ii(),v&&(e.oldKeyCode=e.keyCode,e.keyCode=0)),o}function On(e,t){var n=h("'"+t+"'",s.extraKeys,s.keyMap,function(e){return kn(e,!0)});return n&&(Q(e),ii()),n}function _n(e){Ht||Hn(),v&&e.keyCode==27&&(e.returnValue=!1),un&&Zn()&&(un=!1);if(s.onKeyEvent&&s.onKeyEvent(vn,K(e)))return;var t=tt(e,"keyCode");hr(t==16||tt(e,"shiftKey"));var r=An(e);E&&(Mn=r?t:null,!r&&t==88&&tt(e,n?"metaKey":"ctrlKey")&&Vn(""))}function Dn(e){un&&Zn();if(s.onKeyEvent&&s.onKeyEvent(vn,K(e)))return;var t=tt(e,"keyCode"),n=tt(e,"charCode");if(E&&t==Mn){Mn=null,Q(e);return}if((E&&(!e.which||e.which<10)||x)&&An(e))return;var r=String.fromCharCode(n==null?t:n);s.electricChars&&_t.electricChars&&s.smartIndent&&!s.readOnly&&_t.electricChars.indexOf(r)>-1&&setTimeout(di(function(){Cr(Bt.to.line,"smart")}),75);if(On(e,r))return;Gn()}function Pn(e){if(s.onKeyEvent&&s.onKeyEvent(vn,K(e)))return;tt(e,"keyCode")==16&&(jt=null)}function Hn(){if(s.readOnly=="nocursor")return;Ht||(s.onFocus&&s.onFocus(vn),Ht=!0,Et.className.search(/\bCodeMirror-focused\b/)==-1&&(Et.className+=" CodeMirror-focused")),Qn(),ii()}function Bn(){Ht&&(s.onBlur&&s.onBlur(vn),Ht=!1,nn&&di(function(){nn&&(nn(),nn=null)})(),Et.className=Et.className.replace(" CodeMirror-focused","")),clearInterval(Mt),setTimeout(function(){Ht||(jt=null)},150)}function jn(e,t,n,r,i){if(zt)return;var o=[];Dt.iter(e.line,t.line+1,function(e){o.push(B(e.text,e.markedSpans))});if(fn){fn.addChange(e.line,n.length,o);while(fn.done.length>s.undoDepth)fn.done.shift()}var u=D(H(o[0]),H(pt(o)),e.ch,t.ch,n);Rn(e,t,u,r,i)}function Fn(e,t){if(!e.length)return;var n=e.pop(),r=[];for(var i=n.length-1;i>=0;i-=1){var s=n[i],o=[],u=s.start+s.added;Dt.iter(s.start,u,function(e){o.push(B(e.text,e.markedSpans))}),r.push({start:s.start,added:s.old.length,old:o});var a={line:s.start+s.old.length-1,ch:St(P(pt(o)),P(pt(s.old)))};Rn({line:s.start,ch:0},{line:u-1,ch:mn(u-1).text.length},s.old,a,a)}Xt=!0,t.push(r)}function In(){Fn(fn.done,fn.undone)}function qn(){Fn(fn.undone,fn.done)}function Rn(e,t,n,r,i){function w(e){return e<=Math.min(t.line,t.line+g)?e:e+g}if(zt)return;var o=!1,u=rn.text.length;s.lineWrapping||Dt.iter(e.line,t.line+1,function(e){if(!e.hidden&&e.text.length==u)return o=!0,!0});if(e.line!=t.line||n.length>1)Qt=!0;var a=t.line-e.line,f=mn(e.line),l=mn(t.line),c=pt(n);if(e.ch==0&&t.ch==0&&P(c)==""){var h=[],p=null;for(var d=0,v=n.length-1;d<v;++d)h.push(new q(P(n[d]),H(n[d])));l.update(l.text,H(c)),a&&Dt.remove(e.line,a,Gt),h.length&&Dt.insert(e.line,h)}else if(f==l)if(n.length==1)f.update(f.text.slice(0,e.ch)+P(n[0])+f.text.slice(t.ch),H(n[0]));else{for(var h=[],d=1,v=n.length-1;d<v;++d)h.push(new q(P(n[d]),H(n[d])));h.push(new q(P(c)+f.text.slice(t.ch),H(c))),f.update(f.text.slice(0,e.ch)+P(n[0]),H(n[0])),Dt.insert(e.line+1,h)}else if(n.length==1)f.update(f.text.slice(0,e.ch)+P(n[0])+l.text.slice(t.ch),H(n[0])),Dt.remove(e.line+1,a,Gt);else{var h=[];f.update(f.text.slice(0,e.ch)+P(n[0]),H(n[0])),l.update(P(c)+l.text.slice(t.ch),H(c));for(var d=1,v=n.length-1;d<v;++d)h.push(new q(P(n[d]),H(n[d])));a>1&&Dt.remove(e.line+1,a-1,Gt),Dt.insert(e.line+1,h)}if(s.lineWrapping){var m=Math.max(5,Et.clientWidth/Yr()-3);Dt.iter(e.line,e.line+n.length,function(e){if(e.hidden)return;var t=Math.ceil(e.text.length/m)||1;t!=e.height&&gn(e,t)})}else Dt.iter(e.line,e.line+n.length,function(e){var t=e.text;!e.hidden&&t.length>u&&(rn=e,u=t.length,on=!0,o=!1)}),o&&(sn=!0);Pt=Math.min(Pt,e.line),li(400);var g=n.length-a-1;$t.push({from:e.line,to:t.line+1,diff:g});if(s.onChange){for(var d=0;d<n.length;++d)typeof n[d]!="string"&&(n[d]=n[d].text);var y={from:e,to:t,text:n};if(Jt){for(var b=Jt;b.next;b=b.next);b.next=y}else Jt=y}dr(yr(r),yr(i),w(Bt.from.line),w(Bt.to.line))}function Un(){var e=Dt.height*Kr()+2*Zr();return e*.99>Et.offsetHeight?e:!1}function zn(e){var t=Un();M.style.display=t?"block":"none",t?(L.style.height=ct.style.minHeight=t+"px",M.style.height=Et.clientHeight+"px",e!=null&&(M.scrollTop=Et.scrollTop=e,b&&setTimeout(function(){if(M.scrollTop!=e)return;M.scrollTop=e+(e?-1:1),M.scrollTop=e},0))):ct.style.minHeight="",at.style.top=Yt*Kr()+"px"}function Wn(){rn=mn(0),on=!0;var e=rn.text.length;Dt.iter(1,Dt.size,function(t){var n=t.text;!t.hidden&&n.length>e&&(e=n.length,rn=t)}),sn=!1}function Xn(e,t,n){function r(r){if(mt(r,t))return r;if(!mt(n,r))return i;var s=r.line+e.length-(n.line-t.line)-1,o=r.ch;return r.line==n.line&&(o+=pt(e).length-(n.ch-(n.line==t.line?t.ch:0))),{line:s,ch:o}}t=yr(t),n?n=yr(n):n=t,e=Nt(e);var i;return $n(e,t,n,function(e){return i=e,{from:r(Bt.from),to:r(Bt.to)}}),i}function Vn(e,t){$n(Nt(e),Bt.from,Bt.to,function(e){return t=="end"?{from:e,to:e}:t=="start"?{from:Bt.from,to:Bt.from}:{from:Bt.from,to:e}})}function $n(e,t,n,r){var i=e.length==1?e[0].length+t.ch:pt(e).length,s=r({line:t.line+e.length-1,ch:i});jn(t,n,e,s.from,s.to)}function Jn(e,t,n){var r=e.line,i=t.line;if(r==i)return mn(r).text.slice(e.ch,t.ch);var s=[mn(r).text.slice(e.ch)];return Dt.iter(r+1,i,function(e){s.push(e.text)}),s.push(mn(i).text.slice(0,t.ch)),s.join(n||"\n")}function Kn(e){return Jn(Bt.from,Bt.to,e)}function Qn(){if(un)return;At.set(s.pollInterval,function(){Zn(),Ht&&Qn()})}function Gn(){function t(){var n=Zn();!n&&!e?(e=!0,At.set(60,t)):(un=!1,Qn())}var e=!1;un=!0,At.set(20,t)}function Zn(){if(!Ht||Ct(S)||s.readOnly)return!1;var e=S.value;if(e==Yn)return!1;pi||ci(),jt=null;var t=0,n=Math.min(Yn.length,e.length);while(t<n&&Yn[t]==e[t])++t;return t<Yn.length?Bt.from={line:Bt.from.line,ch:Bt.from.ch-(Yn.length-t)}:Ut&&vt(Bt.from,Bt.to)&&!Wt&&(Bt.to={line:Bt.to.line,ch:Math.min(mn(Bt.to.line).text.length,Bt.to.ch+(e.length-t))}),Vn(e.slice(t),"end"),e.length>1e3?S.value=Yn="":Yn=e,pi||hi(),Wt=!1,!0}function er(e){vt(Bt.from,Bt.to)?e&&(Yn=S.value=""):(Yn="",S.value=Kn(),Ht&&dt(S))}function tr(){s.readOnly!="nocursor"&&S.focus()}function nr(){var e=rr();ir(e.x,e.y,e.x,e.yBot);if(!Ht)return;var t=ct.getBoundingClientRect(),n=null;e.y+t.top<0?n=!0:e.y+t.top+Kr()>(window.innerHeight||document.documentElement.clientHeight)&&(n=!1);if(n!=null){var r=F.style.display=="none";r&&(F.style.display="",F.style.left=e.x+"px",F.style.top=e.y-Yt+"px"),F.scrollIntoView(n),r&&(F.style.display="none")}}function rr(){var e=zr(Bt.inverted?Bt.from:Bt.to),t=s.lineWrapping?Math.min(e.x,G.offsetWidth):e.x;return{x:t,y:e.y,yBot:e.yBot}}function ir(e,t,n,r){var i=sr(e,t,n,r);i.scrollLeft!=null&&(Et.scrollLeft=i.scrollLeft),i.scrollTop!=null&&(M.scrollTop=Et.scrollTop=i.scrollTop)}function sr(e,t,n,r){var i=ei(),o=Zr();t+=o,r+=o,e+=i,n+=i;var u=Et.clientHeight,a=M.scrollTop,f={},l=Un()||Infinity,c=t<o+10,h=r+o>l-10;t<a?f.scrollTop=c?0:Math.max(0,t):r>a+u&&(f.scrollTop=(h?l:r)-u);var p=Et.clientWidth,d=Et.scrollLeft,v=s.fixedGutter?ut.clientWidth:0,m=e<v+i+10;return e<d+v||m?(m&&(e=0),f.scrollLeft=Math.max(0,e-10-v)):n>p+d-3&&(f.scrollLeft=n+10-p),f}function or(e){var t=Kr(),n=(e!=null?e:M.scrollTop)-Zr(),r=Math.max(0,Math.floor(n/t)),i=Math.ceil((n+Et.clientHeight)/t);return{from:X(Dt,r),to:X(Dt,i)}}function ur(e,t,n){function d(){var e=_.firstChild,t=!1;return Dt.iter(Zt,en,function(n){if(!e)return;if(!n.hidden){var r=Math.round(e.offsetHeight/c)||1;n.height!=r&&(gn(n,r),Qt=t=!0)}e=e.nextSibling}),t}if(!Et.clientWidth){Zt=en=Yt=0;return}var r=or(n);if(e!==!0&&e.length==0&&r.from>Zt&&r.to<en){zn(n);return}var i=Math.max(r.from-100,0),o=Math.min(Dt.size,r.to+100);Zt<i&&i-Zt<20&&(i=Zt),en>o&&en-o<20&&(o=Math.min(Dt.size,en));var u=e===!0?[]:ar([{from:Zt,to:en,domStart:0}],e),a=0;for(var f=0;f<u.length;++f){var l=u[f];l.from<i&&(l.domStart+=i-l.from,l.from=i),l.to>o&&(l.to=o),l.from>=l.to?u.splice(f--,1):a+=l.to-l.from}if(a==o-i&&i==Zt&&o==en){zn(n);return}u.sort(function(e,t){return e.domStart-t.domStart});var c=Kr(),h=ut.style.display;_.style.display="none",fr(i,o,u),_.style.display=ut.style.display="";var p=i!=Zt||o!=en||tn!=Et.clientHeight+c;p&&(tn=Et.clientHeight+c),(i!=Zt||o!=en&&s.onViewportChange)&&setTimeout(function(){s.onViewportChange&&s.onViewportChange(vn,i,o)}),Zt=i,en=o,Yt=V(Dt,i),li(100);if(_.childNodes.length!=en-Zt)throw new Error("BAD PATCH! "+JSON.stringify(u)+" size="+(en-Zt)+" nodes="+_.childNodes.length);return s.lineWrapping&&d(),ut.style.display=h,(p||Qt)&&lr()&&s.lineWrapping&&d()&&lr(),zn(n),cr(),!t&&s.onUpdate&&s.onUpdate(vn),!0}function ar(e,t){for(var n=0,r=t.length||0;n<r;++n){var i=t[n],s=[],o=i.diff||0;for(var u=0,a=e.length;u<a;++u){var f=e[u];i.to<=f.from&&i.diff?s.push({from:f.from+o,to:f.to+o,domStart:f.domStart}):i.to<=f.from||i.from>=f.to?s.push(f):(i.from>f.from&&s.push({from:f.from,to:i.from,domStart:f.domStart}),i.to<f.to&&s.push({from:i.to+o,to:f.to+o,domStart:f.domStart+(i.to-f.from)}))}e=s}return e}function fr(e,t,n){function r(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}if(!n.length)bt(_);else{var i=0,s=_.firstChild,o;for(var u=0;u<n.length;++u){var a=n[u];while(a.domStart>i)s=r(s),i++;for(var f=0,l=a.to-a.from;f<l;++f)s=s.nextSibling,i++}while(s)s=r(s)}var c=n.shift(),s=_.firstChild,f=e;Dt.iter(e,t,function(e){c&&c.to==f&&(c=n.shift());if(!c||c.from>f){if(e.hidden)var t=yt("pre");else{var t=yn(e);e.className&&(t.className=e.className);if(e.bgClassName){var r=yt("pre"," ",e.bgClassName,"position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2");t=yt("div",[r,t],null,"position: relative")}}_.insertBefore(t,s)}else s=s.nextSibling;++f})}function lr(){if(!s.gutter&&!s.lineNumbers)return;var e=at.offsetHeight,t=Et.clientHeight;ut.style.height=(e-t<2?t:e)+"px";var n=document.createDocumentFragment(),r=Zt,i;Dt.iter(Zt,Math.max(en,Zt+1),function(e){if(e.hidden)n.appendChild(yt("pre"));else{var t=e.gutterMarker,o=s.lineNumbers?s.lineNumberFormatter(r+s.firstLineNumber):null;t&&t.text?o=t.text.replace("%N%",o!=null?o:""):o==null&&(o=" ");var u=n.appendChild(yt("pre",null,t&&t.style));u.innerHTML=o;for(var a=1;a<e.height;++a)u.appendChild(yt("br")),u.appendChild(document.createTextNode(" "));t||(i=r)}++r}),ut.style.display="none",wt(ot,n);if(i!=null&&s.lineNumbers){var o=ot.childNodes[i-Zt],u=String(Dt.size).length,a=lt(o.firstChild),f="";while(a.length+f.length<u)f+=" ";f&&o.insertBefore(document.createTextNode(f),o.firstChild)}ut.style.display="";var l=Math.abs((parseInt(G.style.marginLeft)||0)-ut.offsetWidth)>2;return G.style.marginLeft=ut.offsetWidth+"px",Qt=!1,l}function cr(){var e=vt(Bt.from,Bt.to),t=zr(Bt.from,!0),n=e?t:zr(Bt.to,!0),r=Bt.inverted?t:n,i=Kr(),o=ft(Lt),u=ft(_);k.style.top=Math.max(0,Math.min(Et.offsetHeight,r.y+u.top-o.top))+"px",k.style.left=Math.max(0,Math.min(Et.offsetWidth,r.x+u.left-o.left))+"px";if(e)F.style.top=r.y+"px",F.style.left=(s.lineWrapping?Math.min(r.x,G.offsetWidth):r.x)+"px",F.style.display="",j.style.display="none";else{var a=t.y==n.y,f=document.createDocumentFragment(),l=G.clientWidth||G.offsetWidth,c=G.clientHeight||G.offsetHeight,h=function(e,t,n,r){var i=y?"width: "+(n?l-n-e:l)+"px":"right: "+n+"px";f.appendChild(yt("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; "+i+"; height: "+r+"px"))};if(Bt.from.ch&&t.y>=0){var p=a?l-n.x:0;h(t.x,t.y,p,i)}var d=Math.max(0,t.y+(Bt.from.ch?i:0)),v=Math.min(n.y,c)-d;v>.2*i&&h(0,d,0,v),(!a||!Bt.from.ch)&&n.y<c-.5*i&&h(0,n.y,l-n.x,i),wt(j,f),F.style.display="none",j.style.display=""}}function hr(e){e?jt=jt||(Bt.inverted?Bt.to:Bt.from):jt=null}function pr(e,t){var n=jt&&yr(jt);n&&(mt(n,e)?e=n:mt(t,n)&&(t=n)),dr(e,t),Vt=!0}function dr(e,t,n,r){an=null,n==null&&(n=Bt.from.line,r=Bt.to.line);if(vt(Bt.from,e)&&vt(Bt.to,t))return;if(mt(t,e)){var i=t;t=e,e=i}if(e.line!=n){var o=vr(e,n,Bt.from.ch);o?e=o:qr(e.line,!1)}t.line!=r&&(t=vr(t,r,Bt.to.ch)),vt(e,t)?Bt.inverted=!1:vt(e,Bt.to)?Bt.inverted=!1:vt(t,Bt.from)&&(Bt.inverted=!0);if(s.autoClearEmptyLines&&vt(Bt.from,Bt.to)){var u=Bt.inverted?e:t;if(u.line!=Bt.from.line&&Bt.from.line<Dt.size){var a=mn(Bt.from.line);/^\s+$/.test(a.text)&&setTimeout(di(function(){if(a.parent&&/^\s+$/.test(a.text)){var e=W(a);Xn("",{line:e,ch:0},{line:e,ch:a.text.length})}},10))}}Bt.from=e,Bt.to=t,Kt=!0}function vr(e,t,n){function r(t){var r=e.line+t,i=t==1?Dt.size:-1;while(r!=i){var o=mn(r);if(!o.hidden){var u=e.ch;if(s||u>n||u>o.text.length)u=o.text.length;return{line:r,ch:u}}r+=t}}var i=mn(e.line),s=e.ch==i.text.length&&e.ch!=n;return i.hidden?e.line>=t?r(1)||r(-1):r(-1)||r(1):e}function mr(e,t,n){var r=yr({line:e,ch:t||0});(n?pr:dr)(r,r)}function gr(e){return Math.max(0,Math.min(e,Dt.size-1))}function yr(e){if(e.line<0)return{line:0,ch:0};if(e.line>=Dt.size)return{line:Dt.size-1,ch:mn(Dt.size-1).text.length};var t=e.ch,n=mn(e.line).text.length;return t==null||t>n?{line:e.line,ch:n}:t<0?{line:e.line,ch:0}:e}function br(e,t){function o(){for(var t=r+e,n=e<0?-1:Dt.size;t!=n;t+=e){var i=mn(t);if(!i.hidden)return r=t,s=i,!0}}function u(t){if(i==(e<0?0:s.text.length)){if(!!t||!o())return!1;i=e<0?s.text.length:0}else i+=e;return!0}var n=Bt.inverted?Bt.from:Bt.to,r=n.line,i=n.ch,s=mn(r);if(t=="char")u();else if(t=="column")u(!0);else if(t=="word"){var a=!1;for(;;){if(e<0&&!u())break;if(Tt(s.text.charAt(i)))a=!0;else if(a){e<0&&(e=1,u());break}if(e>0&&!u())break}}return{line:r,ch:i}}function wr(e,t){var n=e<0?Bt.from:Bt.to;if(jt||vt(Bt.from,Bt.to))n=br(e,t);mr(n.line,n.ch,!0)}function Er(e,t){vt(Bt.from,Bt.to)?e<0?Xn("",br(e,t),Bt.to):Xn("",Bt.from,br(e,t)):Xn("",Bt.from,Bt.to),Vt=!0}function Sr(e,t){var n=0,r=zr(Bt.inverted?Bt.from:Bt.to,!0);an!=null&&(r.x=an);if(t=="page")var i=Math.min(Et.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Wr(r.x,r.y+i*e);else if(t=="line")var o=Kr(),s=Wr(r.x,r.y+.5*o+e*o);t=="page"&&(M.scrollTop+=zr(s,!0).y-r.y),mr(s.line,s.ch,!0),an=r.x}function xr(e){var t=mn(e.line).text,n=e.ch,r=e.ch;if(t){e.after===!1||r==t.length?--n:++r;var i=t.charAt(n),s=Tt(i)?Tt:/\s/.test(i)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&Tt(e)};while(n>0&&s(t.charAt(n-1)))--n;while(r<t.length&&s(t.charAt(r)))++r}return{from:{line:e.line,ch:n},to:{line:e.line,ch:r}}}function Tr(e){pr({line:e,ch:0},yr({line:e+1,ch:0}))}function Nr(e){if(vt(Bt.from,Bt.to))return Cr(Bt.from.line,e);var t=Bt.to.line-(Bt.to.ch?0:1);for(var n=Bt.from.line;n<=t;++n)Cr(n,e)}function Cr(e,t){t||(t="add");if(t=="smart")if(!_t.indent)t="prev";else var n=ai(e);var r=mn(e),i=r.indentation(s.tabSize),o=r.text.match(/^\s*/)[0],u;t=="smart"&&(u=_t.indent(n,r.text.slice(o.length),r.text),u==it&&(t="prev")),t=="prev"?e?u=mn(e-1).indentation(s.tabSize):u=0:t=="add"?u=i+s.indentUnit:t=="subtract"&&(u=i-s.indentUnit),u=Math.max(0,u);var a=u-i,f="",l=0;if(s.indentWithTabs)for(var c=Math.floor(u/s.tabSize);c;--c)l+=s.tabSize,f+=" ";l<u&&(f+=ht(u-l)),f!=o&&Xn(f,{line:e,ch:0},{line:e,ch:o.length}),r.stateAfter=null}function kr(){_t=e.getMode(s,s.mode),Dt.iter(0,Dt.size,function(e){e.stateAfter=null}),Pt=0,li(100)}function Lr(){var e=s.gutter||s.lineNumbers;ut.style.display=e?"":"none",e?Qt=!0:_.parentNode.style.marginLeft=0}function Ar(e,t){if(s.lineWrapping){Lt.className+=" CodeMirror-wrap";var n=Et.clientWidth/Yr()-3;Dt.iter(0,Dt.size,function(e){if(e.hidden)return;var t=Math.ceil(e.text.length/n)||1;t!=1&&gn(e,t)}),G.style.minWidth=I.style.left=""}else Lt.className=Lt.className.replace(" CodeMirror-wrap",""),Wn(),Dt.iter(0,Dt.size,function(e){e.height!=1&&!e.hidden&&gn(e,1)});$t.push({from:0,to:Dt.size})}function Or(){Et.className=Et.className.replace(/\s*cm-s-\S+/g,"")+s.theme.replace(/(^|\s)\s*/g," cm-s-")}function Mr(){var e=l[s.keyMap].style;Lt.className=Lt.className.replace(/\s*cm-keymap-\S+/g,"")+(e?" cm-keymap-"+e:"")}function _r(e,t){this.lines=[],this.type=e,t&&(this.style=t)}function Dr(e,t,n,r){e=yr(e),t=yr(t);var i=new _r("range",n);if(r)for(var s in r)r.hasOwnProperty(s)&&(i[s]=r[s]);var o=e.line;return Dt.iter(o,t.line+1,function(n){var r={from:o==e.line?e.ch:null,to:o==t.line?t.ch:null,marker:i};n.markedSpans=(n.markedSpans||[]).concat([r]),i.lines.push(n),++o}),$t.push({from:e.line,to:t.line+1}),i}function Pr(e){e=yr(e);var t=new _r("bookmark"),n=mn(e.line);fn.addChange(e.line,1,[B(n.text,n.markedSpans)],!0);var r={from:e.ch,to:e.ch,marker:t};return n.markedSpans=(n.markedSpans||[]).concat([r]),t.lines.push(n),t}function Hr(e){e=yr(e);var t=[],n=mn(e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker)}return t}function Br(e,t,n){return typeof e=="number"&&(e=mn(gr(e))),e.gutterMarker={text:t,style:n},Qt=!0,e}function jr(e){typeof e=="number"&&(e=mn(gr(e))),e.gutterMarker=null,Qt=!0}function Fr(e,t){var n=e,r=e;return typeof e=="number"?r=mn(gr(e)):n=W(e),n==null?null:t(r,n)?($t.push({from:n,to:n+1}),r):null}function Ir(e,t,n){return Fr(e,function(e){if(e.className!=t||e.bgClassName!=n)return e.className=t,e.bgClassName=n,!0})}function qr(e,t){return Fr(e,function(e,n){if(e.hidden!=t){e.hidden=t,s.lineWrapping||(t&&e.text.length==rn.text.length?sn=!0:!t&&e.text.length>rn.text.length&&(rn=e,sn=!1)),gn(e,t?0:1);var r=Bt.from.line,i=Bt.to.line;if(t&&(r==n||i==n)){var o=r==n?vr({line:r,ch:0},r,0):Bt.from,u=i==n?vr({line:i,ch:0},i,0):Bt.to;if(!u)return;dr(o,u)}return Qt=!0}})}function Rr(e){if(typeof e=="number"){if(!dn(e))return null;var t=e;e=mn(e);if(!e)return null}else{var t=W(e);if(t==null)return null}var n=e.gutterMarker;return{line:t,handle:e,text:e.text,markerText:n&&n.text,markerClass:n&&n.style,lineClass:e.className,bgClass:e.bgClassName}}function Ur(e,t){if(t==0)return{top:0,left:0};var n=yn(e,t);wt(J,n);var r=n.anchor,i=r.offsetTop,s=r.offsetLeft;if(v&&i==0&&s==0){var o=yt("span","x");r.parentNode.insertBefore(o,r.nextSibling),i=o.offsetTop}return{top:i,left:s}}function zr(e,t){var n,r=Kr(),i=r*(V(Dt,e.line)-(t?Yt:0));if(e.ch==0)n=0;else{var o=Ur(mn(e.line),e.ch);n=o.left,s.lineWrapping&&(i+=Math.max(0,o.top))}return{x:n,y:i,yBot:i+r}}function Wr(e,t){function h(e){var t=Ur(u,e);if(f){var r=Math.round(t.top/n);return c=r!=l,Math.max(0,t.left+(r-l)*Et.clientWidth)}return t.left}var n=Kr(),r=Yr(),i=Yt+Math.floor(t/n);if(i<0)return{line:0,ch:0};var o=X(Dt,i);if(o>=Dt.size)return{line:Dt.size-1,ch:mn(Dt.size-1).text.length};var u=mn(o),a=u.text,f=s.lineWrapping,l=f?i-V(Dt,o):0;if(e<=0&&l==0)return{line:o,ch:0};var c=!1,p=0,d=0,v=a.length,m,g=Math.min(v,Math.ceil((e+l*Et.clientWidth*.9)/r));for(;;){var y=h(g);if(!(y<=e&&g<v)){m=y,v=g;break}g=Math.min(v,Math.ceil(g*1.2))}if(e>m)return{line:o,ch:v};g=Math.floor(v*.8),y=h(g),y<e&&(p=g,d=y);for(;;){if(v-p<=1){var b=e-d<m-e;return{line:o,ch:b?p:v,after:b}}var w=Math.ceil((p+v)/2),E=h(w);E>e?(v=w,m=E,c&&(m+=1e3)):(p=w,d=E)}}function Xr(e){var t=zr(e,!0),n=ft(G);return{x:n.left+t.x,y:n.top+t.y,yBot:n.top+t.yBot}}function Kr(){if(Jr==null){Jr=yt("pre");for(var e=0;e<49;++e)Jr.appendChild(document.createTextNode("x")),Jr.appendChild(yt("br"));Jr.appendChild(document.createTextNode("x"))}var t=_.clientHeight;return t==$r?Vr:($r=t,wt(J,Jr.cloneNode(!0)),Vr=J.firstChild.offsetHeight/50||1,bt(J),Vr)}function Yr(){if(Et.clientWidth==Gr)return Qr;Gr=Et.clientWidth;var e=yt("span","x"),t=yt("pre",[e]);return wt(J,t),Qr=e.offsetWidth||10}function Zr(){return G.offsetTop}function ei(){return G.offsetLeft}function ti(e,t){var n=ft(Et,!0),r,i;try{r=e.clientX,i=e.clientY}catch(e){return null}if(!t&&(r-n.left>Et.clientWidth||i-n.top>Et.clientHeight))return null;var s=ft(G,!0);return Wr(r-s.left,i-s.top)}function ri(e){function i(){k.style.position="relative",S.style.cssText=r,g&&(M.scrollTop=n),Qn();if(S.selectionStart!=null){clearTimeout(ni);var e=S.value=" "+(vt(Bt.from,Bt.to)?"":S.value),t=0;Yn=" ",S.selectionStart=1,S.selectionEnd=e.length,ni=setTimeout(function i(){Yn==" "&&S.selectionStart==0?di(f.selectAll)(vn):t++<10?ni=setTimeout(i,500):er()},200)}}var t=ti(e),n=M.scrollTop;if(!t||E)return;(vt(Bt.from,Bt.to)||mt(t,Bt.from)||!mt(t,Bt.to))&&di(mr)(t.line,t.ch);var r=S.style.cssText;k.style.position="absolute",S.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: white; "+"border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",tr(),er(!0),vt(Bt.from,Bt.to)&&(S.value=Yn=" ");if(d){Y(e);var s=nt(window,"mouseup",function(){s(),setTimeout(i,20)},!0)}else setTimeout(i,50)}function ii(){clearInterval(Mt);var e=!0;F.style.visibility="",Mt=setInterval(function(){F.style.visibility=(e=!e)?"":"hidden"},s.cursorBlinkRate)}function oi(e){function v(e,t,n){if(!e.text)return;var r=e.styles,i=o?0:e.text.length-1,s;for(var a=o?0:r.length-2,f=o?r.length:-2;a!=f;a+=2*u){var l=r[a];if(r[a+1]!=h){i+=u*l.length;continue}for(var c=o?0:l.length-1,v=o?l.length:-1;c!=v;c+=u,i+=u)if(i>=t&&i<n&&d.test(s=l.charAt(c))){var m=si[s];if(m.charAt(1)==">"==o)p.push(s);else{if(p.pop()!=m.charAt(0))return{pos:i,match:!1};if(!p.length)return{pos:i,match:!0}}}}}var t=Bt.inverted?Bt.from:Bt.to,n=mn(t.line),r=t.ch-1,i=r>=0&&si[n.text.charAt(r)]||si[n.text.charAt(++r)];if(!i)return;var s=i.charAt(0),o=i.charAt(1)==">",u=o?1:-1,a=n.styles;for(var f=r+1,l=0,c=a.length;l<c;l+=2)if((f-=a[l].length)<=0){var h=a[l+1];break}var p=[n.text.charAt(r)],d=/[(){}[\]]/;for(var l=t.line,c=o?Math.min(l+100,Dt.size):Math.max(-1,l-100);l!=c;l+=u){var n=mn(l),m=l==t.line,g=v(n,m&&o?r+1:0,m&&!o?r:n.text.length);if(g)break}g||(g={pos:null,match:!1});var h=g.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",y=Dr({line:t.line,ch:r},{line:t.line,ch:r+1},h),b=g.pos!=null&&Dr({line:l,ch:g.pos},{line:l,ch:g.pos+1},h),w=di(function(){y.clear(),b&&b.clear()});e?setTimeout(w,800):nn=w}function ui(e){var t,n;for(var r=e,i=e-40;r>i;--r){if(r==0)return 0;var o=mn(r-1);if(o.stateAfter)return r;var u=o.indentation(s.tabSize);if(n==null||t>u)n=r-1,t=u}return n}function ai(e){var t=ui(e),n=t&&mn(t-1).stateAfter;return n?n=N(_t,n):n=C(_t),Dt.iter(t,e,function(r){r.process(_t,n,s.tabSize),r.stateAfter=t==e-1||t%5==0?N(_t,n):null}),n}function fi(){if(Pt>=en)return;var e=+(new Date)+s.workTime,t=N(_t,ai(Pt)),n=Pt;Dt.iter(Pt,en,function(n){Pt>=Zt?(n.highlight(_t,t,s.tabSize),n.stateAfter=N(_t,t)):(n.process(_t,t,s.tabSize),n.stateAfter=Pt%5==0?N(_t,t):null),++Pt;if(+(new Date)>e)return li(s.workDelay),!0}),en>n&&Pt>=Zt&&di(function(){$t.push({from:n,to:Pt})})()}function li(e){Pt<en&&Ot.set(e,fi)}function ci(){Xt=Vt=Jt=null,$t=[],Kt=!1,Gt=[]}function hi(){sn&&Wn();if(on&&!s.lineWrapping){var e=I.offsetWidth,t=Ur(rn,rn.text.length).left;m||(I.style.left=t+"px",G.style.minWidth=t+e+"px"),on=!1}var n,r;if(Kt){var i=rr();n=sr(i.x,i.y,i.x,i.yBot)}if($t.length||n&&n.scrollTop!=null)r=ur($t,!0,n&&n.scrollTop);r||(Kt&&cr(),Qt&&lr()),n&&nr(),Kt&&ii(),Ht&&(Xt===!0||Xt!==!1&&Kt)&&er(Vt),Kt&&s.matchBrackets&&setTimeout(di(function(){nn&&(nn(),nn=null),vt(Bt.from,Bt.to)&&oi(!1)}),20);var o=Kt,u=Gt;Jt&&s.onChange&&vn&&s.onChange(vn,Jt),o&&s.onCursorActivity&&s.onCursorActivity(vn);for(var a=0;a<u.length;++a)u[a](vn);r&&s.onUpdate&&s.onUpdate(vn)}function di(e){return function(){pi++||ci();try{var t=e.apply(this,arguments)}finally{--pi||hi()}return t}}function vi(e){fn.startCompound();try{return e()}finally{fn.endCompound()}}var s={},a=e.defaults;for(var w in a)a.hasOwnProperty(w)&&(s[w]=(i&&i.hasOwnProperty(w)?i:a)[w]);var S=yt("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em");S.setAttribute("wrap","off"),S.setAttribute("autocorrect","off"),S.setAttribute("autocapitalize","off");var k=yt("div",[S],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),L=yt("div",null,"CodeMirror-scrollbar-inner"),M=yt("div",[L],"CodeMirror-scrollbar"),_=yt("div"),j=yt("div",null,null,"position: relative; z-index: -1"),F=yt("pre"," ","CodeMirror-cursor"),I=yt("pre"," ","CodeMirror-cursor","visibility: hidden"),J=yt("div",null,null,"position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden;"),G=yt("div",[J,F,I,j,_],null,"position: relative; z-index: 0"),ot=yt("div",null,"CodeMirror-gutter-text"),ut=yt("div",[ot],"CodeMirror-gutter"),at=yt("div",[ut,yt("div",[G],"CodeMirror-lines")],null,"position: relative"),ct=yt("div",[at],null,"position: relative"),Et=yt("div",[ct],"CodeMirror-scroll");Et.setAttribute("tabIndex","-1");var Lt=yt("div",[k,M,Et],"CodeMirror"+(s.lineWrapping?" CodeMirror-wrap":""));r.appendChild?r.appendChild(Lt):r(Lt),Or(),Mr(),t&&(S.style.width="0px"),b||(Et.draggable=!0),G.style.outline="none",s.tabindex!=null&&(S.tabIndex=s.tabindex),s.autofocus&&tr(),!s.gutter&&!s.lineNumbers&&(ut.style.display="none"),x&&(k.style.height="1px",k.style.position="absolute"),T?(M.style.zIndex=-2,M.style.visibility="hidden"):m&&(M.style.minWidth="18px");var At=new rt,Ot=new rt,Mt,_t,Dt=new U([new R([new q("")])]),Pt=0,Ht;kr();var Bt={from:{line:0,ch:0},to:{line:0,ch:0},inverted:!1},jt,Ft,It,qt=0,Rt,Ut=!1,zt=!1,Wt=!1,Xt,Vt,$t,Jt,Kt,Qt,Gt,Yt=0,Zt=0,en=0,tn=0,nn,rn=mn(0),sn=!1,on=!0,un=!1,an=null;di(function(){bn(s.value||""),Xt=!1})();var fn=new $;nt(Et,"mousedown",di(xn)),nt(Et,"dblclick",di(Tn)),nt(G,"selectstart",Q),d||nt(Et,"contextmenu",ri),nt(Et,"scroll",Sn),nt(M,"scroll",En),nt(M,"mousedown",function(){Ht&&setTimeout(tr,0)});var ln=nt(window,"resize",function(){Lt.parentNode?ur(!0):ln()},!0);nt(S,"keyup",di(Pn)),nt(S,"input",Gn),nt(S,"keydown",di(_n)),nt(S,"keypress",di(Dn)),nt(S,"focus",Hn),nt(S,"blur",Bn),s.dragDrop&&(nt(Et,"dragstart",Cn),nt(Et,"dragenter",cn),nt(Et,"dragover",cn),nt(Et,"drop",di(Nn))),nt(Et,"paste",function(){tr(),Gn()}),nt(S,"paste",function(){Wt=!0,Gn()}),nt(S,"cut",di(function(){s.readOnly||Vn("")})),x&&nt(ct,"mouseup",function(){document.activeElement==S&&S.blur(),tr()});var hn;try{hn=document.activeElement==S}catch(pn){}hn||s.autofocus?setTimeout(Hn,20):Bn();var vn=Lt.CodeMirror={getValue:wn,setValue:di(bn),getSelection:Kn,replaceSelection:di(Vn),focus:function(){window.focus(),tr(),Hn(),Gn()},setOption:function(e,t){var n=s[e];s[e]=t,e=="mode"||e=="indentUnit"?kr():e=="readOnly"&&t=="nocursor"?(Bn(),S.blur()):e=="readOnly"&&!t?er(!0):e=="theme"?Or():e=="lineWrapping"&&n!=t?di(Ar)():e=="tabSize"?ur(!0):e=="keyMap"?Mr():e=="tabindex"&&(S.tabIndex=t);if(e=="lineNumbers"||e=="gutter"||e=="firstLineNumber"||e=="theme"||e=="lineNumberFormatter")Lr(),ur(!0)},getOption:function(e){return s[e]},getMode:function(){return _t},undo:di(In),redo:di(qn),indentLine:di(function(e,t){typeof t!="string"&&(t==null?t=s.smartIndent?"smart":"prev":t=t?"add":"subtract"),dn(e)&&Cr(e,t)}),indentSelection:di(Nr),historySize:function(){return{undo:fn.done.length,redo:fn.undone.length}},clearHistory:function(){fn=new $},setHistory:function(e){fn=new $,fn.done=e.done,fn.undone=e.undone},getHistory:function(){function e(e){for(var t=0,n=[],r;t<e.length;++t){n.push(r=[]);for(var i=0,s=e[t];i<s.length;++i){var o=[],u=s[i];r.push({start:u.start,added:u.added,old:o});for(var a=0;a<u.old.length;++a)o.push(P(u.old[a]))}}return n}return{done:e(fn.done),undone:e(fn.undone)}},matchBrackets:di(function(){oi(!0)}),getTokenAt:di(function(e){return e=yr(e),mn(e.line).getTokenAt(_t,ai(e.line),s.tabSize,e.ch)}),getStateAfter:function(e){return e=gr(e==null?Dt.size-1:e),ai(e+1)},cursorCoords:function(e,t){return e==null&&(e=Bt.inverted),this.charCoords(e?Bt.from:Bt.to,t)},charCoords:function(e,t){return e=yr(e),t=="local"?zr(e,!1):t=="div"?zr(e,!0):Xr(e)},coordsChar:function(e){var t=ft(G);return Wr(e.x-t.left,e.y-t.top)},markText:di(Dr),setBookmark:Pr,findMarksAt:Hr,setMarker:di(Br),clearMarker:di(jr),setLineClass:di(Ir),hideLine:di(function(e){return qr(e,!0)}),showLine:di(function(e){return qr(e,!1)}),onDeleteLine:function(e,t){if(typeof e=="number"){if(!dn(e))return null;e=mn(e)}return(e.handlers||(e.handlers=[])).push(t),e},lineInfo:Rr,getViewport:function(){return{from:Zt,to:en}},addWidget:function(e,t,n,r,i){e=zr(yr(e));var s=e.yBot,o=e.x;t.style.position="absolute",ct.appendChild(t);if(r=="over")s=e.y;else if(r=="near"){var u=Math.max(Et.offsetHeight,Dt.height*Kr()),a=Math.max(ct.clientWidth,G.clientWidth)-ei();e.yBot+t.offsetHeight>u&&e.y>t.offsetHeight&&(s=e.y-t.offsetHeight),o+t.offsetWidth>a&&(o=a-t.offsetWidth)}t.style.top=s+Zr()+"px",t.style.left=t.style.right="",i=="right"?(o=ct.clientWidth-t.offsetWidth,t.style.right="0px"):(i=="left"?o=0:i=="middle"&&(o=(ct.clientWidth-t.offsetWidth)/2),t.style.left=o+ei()+"px"),n&&ir(o,s,o+t.offsetWidth,s+t.offsetHeight)},lineCount:function(){return Dt.size},clipPos:yr,getCursor:function(e){return e==null&&(e=Bt.inverted),gt(e?Bt.from:Bt.to)},somethingSelected:function(){return!vt(Bt.from,Bt.to)},setCursor:di(function(e,t,n){t==null&&typeof e.line=="number"?mr(e.line,e.ch,n):mr(e,t,n)}),setSelection:di(function(e,t,n){(n?pr:dr)(yr(e),yr(t||e))}),getLine:function(e){if(dn(e))return mn(e).text},getLineHandle:function(e){if(dn(e))return mn(e)},setLine:di(function(e,t){dn(e)&&Xn(t,{line:e,ch:0},{line:e,ch:mn(e).text.length})}),removeLine:di(function(e){dn(e)&&Xn("",{line:e,ch:0},yr({line:e+1,ch:0}))}),replaceRange:di(Xn),getRange:function(e,t,n){return Jn(yr(e),yr(t),n)},triggerOnKeyDown:di(_n),execCommand:function(e){return f[e](vn)},moveH:di(wr),deleteH:di(Er),moveV:di(Sr),toggleOverwrite:function(){Ut?(Ut=!1,F.className=F.className.replace(" CodeMirror-overwrite","")):(Ut=!0,F.className+=" CodeMirror-overwrite")},posFromIndex:function(e){var t=0,n;return Dt.iter(0,Dt.size,function(r){var i=r.text.length+1;if(i>e)return n=e,!0;e-=i,++t}),yr({line:t,ch:n})},indexFromPos:function(e){if(e.line<0||e.ch<0)return 0;var t=e.ch;return Dt.iter(0,e.line,function(e){t+=e.text.length+1}),t},scrollTo:function(e,t){e!=null&&(Et.scrollLeft=e),t!=null&&(M.scrollTop=Et.scrollTop=t),ur([])},getScrollInfo:function(){return{x:Et.scrollLeft,y:M.scrollTop,height:M.scrollHeight,width:Et.scrollWidth}},setSize:function(e,t){function n(e){return e=String(e),/^\d+$/.test(e)?e+"px":e}e!=null&&(Lt.style.width=n(e)),t!=null&&(Et.style.height=n(t)),vn.refresh()},operation:function(e){return di(e)()},compoundChange:function(e){return vi(e)},refresh:function(){ur(!0,null,qt),M.scrollHeight>qt&&(M.scrollTop=qt)},getInputField:function(){return S},getWrapperElement:function(){return Lt},getScrollerElement:function(){return Et},getGutterElement:function(){return ut}},Ln,Mn=null,Yn="";_r.prototype.clear=di(function(){var e,t;for(var n=0;n<this.lines.length;++n){var r=this.lines[n],i=A(r.markedSpans,this);i.from!=null&&(e=W(r)),i.to!=null&&(t=W(r)),r.markedSpans=O(r.markedSpans,i)}e!=null&&$t.push({from:e,to:t+1}),this.lines.length=0,this.explicitlyCleared=!0}),_r.prototype.find=function(){var e,t;for(var n=0;n<this.lines.length;++n){var r=this.lines[n],i=A(r.markedSpans,this);if(i.from!=null||i.to!=null){var s=W(r);i.from!=null&&(e={line:s,ch:i.from}),i.to!=null&&(t={line:s,ch:i.to})}}return this.type=="bookmark"?e:e&&{from:e,to:t}};var Vr,$r,Jr,Qr,Gr=0,ni,si={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},pi=0;for(var mi in o)o.propertyIsEnumerable(mi)&&!vn.propertyIsEnumerable(mi)&&(vn[mi]=o[mi]);for(var gi=0;gi<u.length;++gi)u[gi](vn);return vn}function c(e){return typeof e=="string"?l[e]:e}function h(e,t,n,r,i){function s(t){t=c(t);var n=t[e];if(n===!1)return i&&i(),!0;if(n!=null&&r(n))return!0;if(t.nofallthrough)return i&&i(),!0;var o=t.fallthrough;if(o==null)return!1;if(Object.prototype.toString.call(o)!="[object Array]")return s(o);for(var u=0,a=o.length;u<a;++u)if(s(o[u]))return!0;return!1}return t&&s(t)?!0:s(n)}function p(e){var t=kt[tt(e,"keyCode")];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function N(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function C(e,t,n){return e.startState?e.startState(t,n):!0}function k(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8}function L(e,t,n){this.from=e,this.to=t,this.marker=n}function A(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function O(e,t){var n;for(var r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function M(e,t,n){if(e)for(var r=0,i;r<e.length;++r){var s=e[r],o=s.marker,u=s.from==null||(o.inclusiveLeft?s.from<=t:s.from<t);if(u||o.type=="bookmark"&&s.from==t&&s.from!=n){var a=s.to==null||(o.inclusiveRight?s.to>=t:s.to>t);(i||(i=[])).push({from:s.from,to:a?null:s.to,marker:o})}}return i}function _(e,t){if(e)for(var n=0,r;n<e.length;++n){var i=e[n],s=i.marker,o=i.to==null||(s.inclusiveRight?i.to>=t:i.to>t);if(o||s.type=="bookmark"&&i.from==t){var u=i.from==null||(s.inclusiveLeft?i.from<=t:i.from<t);(r||(r=[])).push({from:u?null:i.from-t,to:i.to==null?null:i.to-t,marker:s})}}return r}function D(e,t,n,r,i){if(!e&&!t)return i;var s=M(e,n),o=_(t,r),u=i.length==1,a=pt(i).length+(u?n:0);if(s)for(var f=0;f<s.length;++f){var l=s[f];if(l.to==null){var c=A(o,l.marker);c?u&&(l.to=c.to==null?null:c.to+a):l.to=n}}if(o)for(var f=0;f<o.length;++f){var l=o[f];l.to!=null&&(l.to+=a);if(l.from==null){var c=A(s,l.marker);c||(l.from=a,u&&(s||(s=[])).push(l))}else l.from+=a,u&&(s||(s=[])).push(l)}var h=[B(i[0],s)];if(!u){var p=i.length-2,d;if(p>0&&s)for(var f=0;f<s.length;++f)s[f].to==null&&(d||(d=[])).push({from:null,to:null,marker:s[f].marker});for(var f=0;f<p;++f)h.push(B(i[f+1],d));h.push(B(pt(i),o))}return h}function P(e){return typeof e=="string"?e:e.text}function H(e){if(typeof e=="string")return null;var t=e.markedSpans,n=null;for(var r=0;r<t.length;++r)t[r].marker.explicitlyCleared?n||(n=t.slice(0,r)):n&&n.push(t[r]);return n?n.length?n:null:t}function B(e,t){return t?{text:e,markedSpans:t}:e}function j(e){var t=e.markedSpans;if(!t)return;for(var n=0;n<t.length;++n){var r=t[n].marker.lines,i=xt(r,e);r.splice(i,1)}e.markedSpans=null}function F(e,t){if(!t)return;for(var n=0;n<t.length;++n)var r=t[n].marker.lines.push(e);e.markedSpans=t}function q(e,t){this.text=e,this.height=1,F(this,t)}function R(e){this.lines=e,this.parent=null;for(var t=0,n=e.length,r=0;t<n;++t)e[t].parent=this,r+=e[t].height;this.height=r}function U(e){this.children=e;var t=0,n=0;for(var r=0,i=e.length;r<i;++r){var s=e[r];t+=s.chunkSize(),n+=s.height,s.parent=this}this.size=t,this.height=n,this.parent=null}function z(e,t){while(!e.lines)for(var n=0;;++n){var r=e.children[n],i=r.chunkSize();if(t<i){e=r;break}t-=i}return e.lines[t]}function W(e){if(e.parent==null)return null;var t=e.parent,n=xt(t.lines,e);for(var r=t.parent;r;t=r,r=r.parent)for(var i=0,s=r.children.length;;++i){if(r.children[i]==t)break;n+=r.children[i].chunkSize()}return n}function X(e,t){var n=0;e:do{for(var r=0,i=e.children.length;r<i;++r){var s=e.children[r],o=s.height;if(t<o){e=s;continue e}t-=o,n+=s.chunkSize()}return n}while(!e.lines);for(var r=0,i=e.lines.length;r<i;++r){var u=e.lines[r],a=u.height;if(t<a)break;t-=a}return n+r}function V(e,t){var n=0;e:do{for(var r=0,i=e.children.length;r<i;++r){var s=e.children[r],o=s.chunkSize();if(t<o){e=s;continue e}t-=o,n+=s.height}return n}while(!e.lines);for(var r=0;r<t;++r)n+=e.lines[r].height;return n}function $(){this.time=0,this.done=[],this.undone=[],this.compound=0,this.closed=!1}function J(){Y(this)}function K(e){return e.stop||(e.stop=J),e}function Q(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function G(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Y(e){Q(e),G(e)}function Z(e){return e.target||e.srcElement}function et(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),n&&e.ctrlKey&&t==1&&(t=3),t}function tt(e,t){var n=e.override&&e.override.hasOwnProperty(t);return n?e.override[t]:e[t]}function nt(e,t,n,r){if(typeof e.addEventListener=="function"){e.addEventListener(t,n,!1);if(r)return function(){e.removeEventListener(t,n,!1)}}else{var i=function(e){n(e||window.event)};e.attachEvent("on"+t,i);if(r)return function(){e.detachEvent("on"+t,i)}}}function rt(){this.id=null}function at(e,t,n){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var r=0,i=0;r<t;++r)e.charAt(r)==" "?i+=n-i%n:++i;return i}function ft(e,t){try{var n=e.getBoundingClientRect();n={top:n.top,left:n.left}}catch(r){n={top:0,left:0}}if(!t)if(window.pageYOffset==null){var i=document.documentElement||document.body.parentNode;i.scrollTop==null&&(i=document.body),n.top+=i.scrollTop,n.left+=i.scrollLeft}else n.top+=window.pageYOffset,n.left+=window.pageXOffset;return n}function lt(e){return e.textContent||e.innerText||e.nodeValue||""}function ht(e){while(ct.length<=e)ct.push(pt(ct)+" ");return ct[e]}function pt(e){return e[e.length-1]}function dt(e){t?(e.selectionStart=0,e.selectionEnd=e.value.length):e.select()}function vt(e,t){return e.line==t.line&&e.ch==t.ch}function mt(e,t){return e.line<t.line||e.line==t.line&&e.ch<t.ch}function gt(e){return{line:e.line,ch:e.ch}}function yt(e,t,n,r){var i=document.createElement(e);n&&(i.className=n),r&&(i.style.cssText=r);if(typeof t=="string")Et(i,t);else if(t)for(var s=0;s<t.length;++s)i.appendChild(t[s]);return i}function bt(e){return e.innerHTML="",e}function wt(e,t){bt(e).appendChild(t)}function Et(e,t){g?(e.innerHTML="",e.appendChild(document.createTextNode(t))):e.textContent=t}function St(e,t){if(!t)return 0;if(!e)return t.length;for(var n=e.length,r=t.length;n>=0&&r>=0;--n,--r)if(e.charAt(n)!=t.charAt(r))break;return r+1}function xt(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;++n)if(e[n]==t)return n;return-1}function Tt(e){return/\w/.test(e)||e.toUpperCase()!=e.toLowerCase()||/[\u4E00-\u9FA5]/.test(e)}e.defaults={value:"",mode:null,theme:"default",indentUnit:2,indentWithTabs:!1,smartIndent:!0,tabSize:4,keyMap:"default",extraKeys:null,electricChars:!0,autoClearEmptyLines:!1,onKeyEvent:null,onDragEvent:null,lineWrapping:!1,lineNumbers:!1,gutter:!1,fixedGutter:!1,firstLineNumber:1,readOnly:!1,dragDrop:!0,onChange:null,onCursorActivity:null,onViewportChange:null,onGutterClick:null,onUpdate:null,onFocus:null,onBlur:null,onScroll:null,matchBrackets:!1,cursorBlinkRate:530,workTime:100,workDelay:200,pollInterval:100,undoDepth:40,tabindex:null,autofocus:null,lineNumberFormatter:function(e){return e}};var t=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),n=t||/Mac/.test(navigator.platform),r=/Win/.test(navigator.platform),i=e.modes={},s=e.mimeModes={};e.defineMode=function(t,n){!e.defaults.mode&&t!="null"&&(e.defaults.mode=t);if(arguments.length>2){n.dependencies=[];for(var r=2;r<arguments.length;++r)n.dependencies.push(arguments[r])}i[t]=n},e.defineMIME=function(e,t){s[e]=t},e.resolveMode=function(t){if(typeof t=="string"&&s.hasOwnProperty(t))t=s[t];else if(typeof t=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return typeof t=="string"?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=i[n.name];if(!r)return e.getMode(t,"text/plain");var s=r(t,n);if(a.hasOwnProperty(n.name)){var o=a[n.name];for(var u in o)o.hasOwnProperty(u)&&(s[u]=o[u])}return s.name=n.name,s},e.listModes=function(){var e=[];for(var t in i)i.propertyIsEnumerable(t)&&e.push(t);return e},e.listMIMEs=function(){var e=[];for(var t in s)s.propertyIsEnumerable(t)&&e.push({mime:t,mode:s[t]});return e};var o=e.extensions={};e.defineExtension=function(e,t){o[e]=t};var u=[];e.defineInitHook=function(e){u.push(e)};var a=e.modeExtensions={};e.extendMode=function(e,t){var n=a.hasOwnProperty(e)?a[e]:a[e]={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r])};var f=e.commands={selectAll:function(e){e.setSelection({line:0,ch:0},{line:e.lineCount()-1})},killLine:function(e){var t=e.getCursor(!0),n=e.getCursor(!1),r=!vt(t,n);!r&&e.getLine(t.line).length==t.ch?e.replaceRange("",t,{line:t.line+1,ch:0}):e.replaceRange("",t,r?n:{line:t.line})},deleteLine:function(e){var t=e.getCursor().line;e.replaceRange("",{line:t,ch:0},{line:t})},undo:function(e){e.undo()},redo:function(e){e.redo()},goDocStart:function(e){e.setCursor(0,0,!0)},goDocEnd:function(e){e.setSelection({line:e.lineCount()-1},null,!0)},goLineStart:function(e){e.setCursor(e.getCursor().line,0,!0)},goLineStartSmart:function(e){var t=e.getCursor(),n=e.getLine(t.line),r=Math.max(0,n.search(/\S/));e.setCursor(t.line,t.ch<=r&&t.ch?0:r,!0)},goLineEnd:function(e){e.setSelection({line:e.getCursor().line},null,!0)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goWordRight:function(e){e.moveH(1,"word")},delCharLeft:function(e){e.deleteH(-1,"char")},delCharRight:function(e){e.deleteH(1,"char")},delWordLeft:function(e){e.deleteH(-1,"word")},delWordRight:function(e){e.deleteH(1,"word")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection(" ","end")},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.replaceSelection(" ","end")},transposeChars:function(e){var t=e.getCursor(),n=e.getLine(t.line);t.ch>0&&t.ch<n.length-1&&e.replaceRange(n.charAt(t.ch)+n.charAt(t.ch-1),{line:t.line,ch:t.ch-1},{line:t.line,ch:t.ch+1})},newlineAndIndent:function(e){e.replaceSelection("\n","end"),e.indentLine(e.getCursor().line)},toggleOverwrite:function(e){e.toggleOverwrite()}},l=e.keyMap={};l.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharRight",Backspace:"delCharLeft",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"},l.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goWordLeft","Ctrl-Right":"goWordRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delWordLeft","Ctrl-Delete":"delWordRight","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore",fallthrough:"basic"},l.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goWordLeft","Alt-Right":"goWordRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delWordLeft","Ctrl-Alt-Backspace":"delWordRight","Alt-Delete":"delWordRight","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore",fallthrough:["basic","emacsy"]},l["default"]=n?l.macDefault:l.pcDefault,l.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageUp","Shift-Ctrl-V":"goPageDown","Ctrl-D":"delCharRight","Ctrl-H":"delCharLeft","Alt-D":"delWordRight","Alt-Backspace":"delWordLeft","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},e.isModifierKey=p,e.fromTextArea=function(t,n){function s(){t.value=a.getValue()}n||(n={}),n.value=t.value,!n.tabindex&&t.tabindex&&(n.tabindex=t.tabindex);if(n.autofocus==null){var r=document.body;try{r=document.activeElement}catch(i){}n.autofocus=r==t||t.getAttribute("autofocus")!=null&&r==document.body}if(t.form){var o=nt(t.form,"submit",s,!0);if(typeof t.form.submit=="function"){var u=t.form.submit;t.form.submit=function f(){s(),t.form.submit=u,t.form.submit(),t.form.submit=f}}}t.style.display="none";var a=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},n);return a.save=s,a.getTextArea=function(){return t},a.toTextArea=function(){s(),t.parentNode.removeChild(a.getWrapperElement()),t.style.display="",t.form&&(o(),typeof t.form.submit=="function"&&(t.form.submit=u))},a};var d=/gecko\/\d{7}/i.test(navigator.userAgent),v=/MSIE \d/.test(navigator.userAgent),m=/MSIE [1-7]\b/.test(navigator.userAgent),g=/MSIE [1-8]\b/.test(navigator.userAgent),y=v&&document.documentMode==5,b=/WebKit\//.test(navigator.userAgent),w=/Chrome\//.test(navigator.userAgent),E=/Opera\//.test(navigator.userAgent),S=/Apple Computer/.test(navigator.vendor),x=/KHTML\//.test(navigator.userAgent),T=/Mac OS X 10\D([7-9]|\d\d)\D/.test(navigator.userAgent);e.copyState=N,e.startState=C,e.innerMode=function(e,t){while(e.innerMode){var n=e.innerMode(t);t=n.state,e=n.mode}return n||{mode:e,state:t}},k.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)||undefined},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(e){var t=this.string.charAt(this.pos);if(typeof e=="string")var n=t==e;else var n=t&&(e.test?e.test(t):e(t));if(n)return++this.pos,t},eatWhile:function(e){var t=this.pos;while(this.eat(e));return this.pos>t},eatSpace:function(){var e=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return at(this.string,this.start,this.tabSize)},indentation:function(){return at(this.string,null,this.tabSize)},match:function(e,t,n){if(typeof e!="string"){var i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&t!==!1&&(this.pos+=i[0].length),i)}var r=function(e){return n?e.toLowerCase():e};if(r(this.string).indexOf(r(e),this.pos)==this.pos)return t!==!1&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)}},e.StringStream=k;var I=" ";d||v&&!m?I="":E&&(I=""),q.prototype={update:function(e,t){this.text=e,this.stateAfter=this.styles=null,j(this),F(this,t)},highlight:function(e,t,n){var r=new k(this.text,n),i=this.styles||(this.styles=[]),s=i.length=0;this.text==""&&e.blankLine&&e.blankLine(t);while(!r.eol()){var o=e.token(r,t),u=r.current();r.start=r.pos,s&&i[s-1]==o?i[s-2]+=u:u&&(i[s++]=u,i[s++]=o);if(r.pos>5e3){i[s++]=this.text.slice(r.pos),i[s++]=null;break}}},process:function(e,t,n){var r=new k(this.text,n);this.text==""&&e.blankLine&&e.blankLine(t);while(!r.eol()&&r.pos<=5e3)e.token(r,t),r.start=r.pos},getTokenAt:function(e,t,n,r){var i=this.text,s=new k(i,n);while(s.pos<r&&!s.eol()){s.start=s.pos;var o=e.token(s,t)}return{start:s.start,end:s.pos,string:s.current(),className:o||null,state:t}},indentation:function(e){return at(this.text,null,e)},getContent:function(e,t,n){function u(t,n,o){if(!n)return;r&&v&&n.charAt(0)==" "&&(n=" "+n.slice(1)),r=!1;if(!s.test(n)){i+=n.length;var u=document.createTextNode(n)}else{var u=document.createDocumentFragment(),a=0;for(;;){s.lastIndex=a;var f=s.exec(n),l=f?f.index-a:n.length-a;l&&(u.appendChild(document.createTextNode(n.slice(a,a+l))),i+=l);if(!f)break;a+=l+1;if(f[0]==" "){var c=e-i%e;u.appendChild(yt("span",ht(c),"cm-tab")),i+=c}else{var h=yt("span","•","cm-invalidchar");h.title="\\u"+f[0].charCodeAt(0).toString(16),u.appendChild(h),i+=1}}}o?t.appendChild(yt("span",[u],o)):t.appendChild(u)}function g(e){return e?"cm-"+e.replace(/ +/g," cm-"):null}var r=!0,i=0,s=/[\t\u0000-\u0019\u200b\u2028\u2029\uFEFF]/g,o=yt("pre"),a=u;if(t!=null){var f=0,l=o.anchor=yt("span");a=function(e,r,i){var s=r.length;if(t>=f&&t<f+s){var o=t-f;if(o){u(e,r.slice(0,o),i);if(n){var c=r.slice(o-1,o+1);ut.test(c)?e.appendChild(yt("wbr")):!m&&/\w\w/.test(c)&&e.appendChild(document.createTextNode(""))}}e.appendChild(l),u(l,E?r.slice(o,o+1):r.slice(o),i),E&&u(e,r.slice(o+1),i),t--,f+=s}else f+=s,u(e,r,i),f==t&&f==d?(Et(l,I),e.appendChild(l)):f>t+10&&/\s/.test(r)&&(a=function(){})}}var c=this.styles,h=this.text,p=this.markedSpans,d=h.length;if(!h&&t==null)a(o," ");else if(!p||!p.length)for(var y=0,b=0;b<d;y+=2){var w=c[y],S=c[y+1],x=w.length;b+x>d&&(w=w.slice(0,d-b)),b+=x,a(o,w,g(S))}else{p.sort(function(e,t){return e.from-t.from});var T=0,y=0,N="",S,C=0,k=p[0].from||0,L=[],A=0,O=function(){var e;while(A<p.length&&((e=p[A]).from==T||e.from==null))e.marker.type=="range"&&L.push(e),++A;k=A<p.length?p[A].from:Infinity;for(var t=0;t<L.length;++t){var n=L[t].to;n==null&&(n=Infinity),n==T?L.splice(t--,1):k=Math.min(n,k)}},M=0;while(T<d){k==T&&O();var _=Math.min(d,k);for(;;){if(N){var D=T+N.length,P=S;for(var H=0;H<L.length;++H){var B=L[H];P=(P?P+" ":"")+B.marker.style,B.marker.endStyle&&B.to===Math.min(D,_)&&(P+=" "+B.marker.endStyle),B.marker.startStyle&&B.from===T&&(P+=" "+B.marker.startStyle)}a(o,D>_?N.slice(0,_-T):N,P);if(D>=_){N=N.slice(_-T),T=_;break}T=D}N=c[y++],S=g(c[y++])}}}return o},cleanUp:function(){this.parent=null,j(this)}},R.prototype={chunkSize:function(){return this.lines.length},remove:function(e,t,n){for(var r=e,i=e+t;r<i;++r){var s=this.lines[r];this.height-=s.height,s.cleanUp();if(s.handlers)for(var o=0;o<s.handlers.length;++o)n.push(s.handlers[o])}this.lines.splice(e,t)},collapse:function(e){e.splice.apply(e,[e.length,0].concat(this.lines))},insertHeight:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0,i=t.length;r<i;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},U.prototype={chunkSize:function(){return this.size},remove:function(e,t,n){this.size-=t;for(var r=0;r<this.children.length;++r){var i=this.children[r],s=i.chunkSize();if(e<s){var o=Math.min(t,s-e),u=i.height;i.remove(e,o,n),this.height-=u-i.height,s==o&&(this.children.splice(r--,1),i.parent=null);if((t-=o)==0)break;e=0}else e-=s}if(this.size-t<25){var a=[];this.collapse(a),this.children=[new R(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0,n=this.children.length;t<n;++t)this.children[t].collapse(e)},insert:function(e,t){var n=0;for(var r=0,i=t.length;r<i;++r)n+=t[r].height;this.insertHeight(e,t,n)},insertHeight:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0,i=this.children.length;r<i;++r){var s=this.children[r],o=s.chunkSize();if(e<=o){s.insertHeight(e,t,n);if(s.lines&&s.lines.length>50){while(s.lines.length>50){var u=s.lines.splice(s.lines.length-25,25),a=new R(u);s.height-=a.height,this.children.splice(r+1,0,a),a.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new U(t);if(!e.parent){var r=new U(e.children);r.parent=e,e.children=[r,n],e=r}else{e.size-=n.size,e.height-=n.height;var i=xt(e.parent.children,e);e.parent.children.splice(i+1,0,n)}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iter:function(e,t,n){this.iterN(e,t-e,n)},iterN:function(e,t,n){for(var r=0,i=this.children.length;r<i;++r){var s=this.children[r],o=s.chunkSize();if(e<o){var u=Math.min(t,o-e);if(s.iterN(e,u,n))return!0;if((t-=u)==0)break;e=0}else e-=o}}},$.prototype={addChange:function(e,t,n){this.undone.length=0;var r=+(new Date),i=pt(this.done),s=i&&pt(i),o=r-this.time;if(i&&!this.closed&&this.compound)i.push({start:e,added:t,old:n});else if(o>400||!s||this.closed||s.start>e+n.length||s.start+s.added<e)this.done.push([{start:e,added:t,old:n}]),this.closed=!1;else{var u=Math.max(0,s.start-e),a=Math.max(0,e+n.length-(s.start+s.added));for(var f=u;f>0;--f)s.old.unshift(n[f-1]);for(var f=a;f>0;--f)s.old.push(n[n.length-f]);u&&(s.start=e),s.added+=t-(n.length-u-a)}this.time=r},startCompound:function(){this.compound++||(this.closed=!0)},endCompound:function(){--this.compound||(this.closed=!0)}},e.e_stop=Y,e.e_preventDefault=Q,e.e_stopPropagation=G,e.connect=nt,rt.prototype={set:function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)}};var it=e.Pass={toString:function(){return"CodeMirror.Pass"}},st=function(){if(g)return!1;var e=yt("div");return"draggable"in e||"dragDrop"in e}(),ot=function(){var e=yt("textarea");return e.value="foo\nbar",e.value.indexOf("\r")>-1?"\r\n":"\n"}(),ut=/^$/;d?ut=/$'/:S?ut=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/:w&&(ut=/\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/);var ct=[""],Nt="\n\nb".split(/\n/).length!=3?function(e){var t=0,n=[],r=e.length;while(t<=r){var i=e.indexOf("\n",t);i==-1&&(i=e.length);var s=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),o=s.indexOf("\r");o!=-1?(n.push(s.slice(0,o)),t+=o+1):(n.push(s),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)};e.splitLines=Nt;var Ct=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0};e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var kt={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",109:"-",107:"=",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};return e.keyNames=kt,function(){for(var e=0;e<10;e++)kt[e+48]=String(e);for(var e=65;e<=90;e++)kt[e]=String.fromCharCode(e);for(var e=1;e<=12;e++)kt[e+111]=kt[e+63235]="F"+e}(),e.version="2.35",e}(),define("CodeMirror",function(e){return function(){return e.CodeMirror}}(this)),CodeMirror.defineMode("mysql",function(e){function r(e){return new RegExp("^(?:"+e.join("|")+")$","i")}function u(e,t){var r=e.next();n=null;if(r=="$"||r=="?")return e.match(/^[\w\d]*/),"variable-2";if(r=="<"&&!e.match(/^[\s\u00a0=]/,!1))return e.match(/^[^\s\u00a0>]*>?/),"atom";if(r=='"'||r=="'")return t.tokenize=a(r),t.tokenize(e,t);if(r=="`")return t.tokenize=f(r),t.tokenize(e,t);if(/[{}\(\),\.;\[\]]/.test(r))return n=r,null;if(r!="-"){if(o.test(r))return e.eatWhile(o),null;if(r==":")return e.eatWhile(/[\w\d\._\-]/),"atom";e.eatWhile(/[_\w\d]/);if(e.eat(":"))return e.eatWhile(/[\w\d_\-]/),"atom";var l=e.current(),c;return i.test(l)?null:s.test(l)?"keyword":"variable"}var u=e.next();if(u=="-")return e.skipToEnd(),"comment"}function a(e){return function(t,n){var r=!1,i;while((i=t.next())!=null){if(i==e&&!r){n.tokenize=u;break}r=!r&&i=="\\"}return"string"}}function f(e){return function(t,n){var r=!1,i;while((i=t.next())!=null){if(i==e&&!r){n.tokenize=u;break}r=!r&&i=="\\"}return"variable-2"}}function l(e,t,n){e.context={prev:e.context,indent:e.indent,col:n,type:t}}function c(e){e.indent=e.context.indent,e.context=e.context.prev}var t=e.indentUnit,n,i=r(["str","lang","langmatches","datatype","bound","sameterm","isiri","isuri","isblank","isliteral","union","a"]),s=r(["ACCESSIBLE","ALTER","AS","BEFORE","BINARY","BY","CASE","CHARACTER","COLUMN","CONTINUE","CROSS","CURRENT_TIMESTAMP","DATABASE","DAY_MICROSECOND","DEC","DEFAULT","DESC","DISTINCT","DOUBLE","EACH","ENCLOSED","EXIT","FETCH","FLOAT8","FOREIGN","GRANT","HIGH_PRIORITY","HOUR_SECOND","IN","INNER","INSERT","INT2","INT8","INTO","JOIN","KILL","LEFT","LINEAR","LOCALTIME","LONG","LOOP","MATCH","MEDIUMTEXT","MINUTE_SECOND","NATURAL","NULL","OPTIMIZE","OR","OUTER","PRIMARY","RANGE","READ_WRITE","REGEXP","REPEAT","RESTRICT","RIGHT","SCHEMAS","SENSITIVE","SHOW","SPECIFIC","SQLSTATE","SQL_CALC_FOUND_ROWS","STARTING","TERMINATED","TINYINT","TRAILING","UNDO","UNLOCK","USAGE","UTC_DATE","VALUES","VARCHARACTER","WHERE","WRITE","ZEROFILL","ALL","AND","ASENSITIVE","BIGINT","BOTH","CASCADE","CHAR","COLLATE","CONSTRAINT","CREATE","CURRENT_TIME","CURSOR","DAY_HOUR","DAY_SECOND","DECLARE","DELETE","DETERMINISTIC","DIV","DUAL","ELSEIF","EXISTS","FALSE","FLOAT4","FORCE","FULLTEXT","HAVING","HOUR_MINUTE","IGNORE","INFILE","INSENSITIVE","INT1","INT4","INTERVAL","ITERATE","KEYS","LEAVE","LIMIT","LOAD","LOCK","LONGTEXT","MASTER_SSL_VERIFY_SERVER_CERT","MEDIUMINT","MINUTE_MICROSECOND","MODIFIES","NO_WRITE_TO_BINLOG","ON","OPTIONALLY","OUT","PRECISION","PURGE","READS","REFERENCES","RENAME","REQUIRE","REVOKE","SCHEMA","SELECT","SET","SPATIAL","SQLEXCEPTION","SQL_BIG_RESULT","SSL","TABLE","TINYBLOB","TO","TRUE","UNIQUE","UPDATE","USING","UTC_TIMESTAMP","VARCHAR","WHEN","WITH","YEAR_MONTH","ADD","ANALYZE","ASC","BETWEEN","BLOB","CALL","CHANGE","CHECK","CONDITION","CONVERT","CURRENT_DATE","CURRENT_USER","DATABASES","DAY_MINUTE","DECIMAL","DELAYED","DESCRIBE","DISTINCTROW","DROP","ELSE","ESCAPED","EXPLAIN","FLOAT","FOR","FROM","GROUP","HOUR_MICROSECOND","IF","INDEX","INOUT","INT","INT3","INTEGER","IS","KEY","LEADING","LIKE","LINES","LOCALTIMESTAMP","LONGBLOB","LOW_PRIORITY","MEDIUMBLOB","MIDDLEINT","MOD","NOT","NUMERIC","OPTION","ORDER","OUTFILE","PROCEDURE","READ","REAL","RELEASE","REPLACE","RETURN","RLIKE","SECOND_MICROSECOND","SEPARATOR","SMALLINT","SQL","SQLWARNING","SQL_SMALL_RESULT","STRAIGHT_JOIN","THEN","TINYTEXT","TRIGGER","UNION","UNSIGNED","USE","UTC_TIME","VARBINARY","VARYING","WHILE","XOR","FULL","COLUMNS","MIN","MAX","STDEV","COUNT"]),o=/[*+\-<>=&|]/;return{startState:function(e){return{tokenize:u,context:null,indent:0,col:0}},token:function(e,t){e.sol()&&(t.context&&t.context.align==null&&(t.context.align=!1),t.indent=e.indentation());if(e.eatSpace())return null;var r=t.tokenize(e,t);r!="comment"&&t.context&&t.context.align==null&&t.context.type!="pattern"&&(t.context.align=!0);if(n=="(")l(t,")",e.column());else if(n=="[")l(t,"]",e.column());else if(n=="{")l(t,"}",e.column());else if(/[\]\}\)]/.test(n)){while(t.context&&t.context.type=="pattern")c(t);t.context&&n==t.context.type&&c(t)}else n=="."&&t.context&&t.context.type=="pattern"?c(t):/atom|string|variable/.test(r)&&t.context&&(/[\}\]]/.test(t.context.type)?l(t,"pattern",e.column()):t.context.type=="pattern"&&!t.context.align&&(t.context.align=!0,t.context.col=e.column()));return r},indent:function(e,n){var r=n&&n.charAt(0),i=e.context;if(/[\]\}]/.test(r))while(i&&i.type=="pattern")i=i.prev;var s=i&&r==i.type;return i?i.type=="pattern"?i.col:i.align?i.col+(s?0:1):i.indent+(s?0:t):0}}}),CodeMirror.defineMIME("text/x-mysql","mysql"),define("MySQLCodeMirror",function(){}),define("FiddleEditor",["CodeMirror","MySQLCodeMirror","jQuery"],function(e,t,n){var r=function(t,r,i,s){return this.codeMirrorSupported=!/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent),this.codeMirrorSupported?(this.codeMirror=e.fromTextArea(document.getElementById(t),{mode:"mysql",matchBrackets:!0,extraKeys:{Tab:"indentMore"},lineNumbers:!0,onChange:function(){r.call(i)}}),n(this.codeMirror.getWrapperElement()).on("keypress",function(e){e.keyCode==13&&e.ctrlKey&&s&&(e.preventDefault(),s())})):(this.textArea=document.getElementById(t),n(this.textArea).on("change",function(){r.call(i)}),n(this.textArea).on("keyup",function(){r.call(i)}),n(this.textArea).on("keypress",function(e){e.keyCode==13&&e.ctrlKey&&s&&(e.preventDefault(),s())}),n(this.textArea).attr("fullscreen",!1)),this};return r.prototype.getValue=function(){return this.codeMirrorSupported?this.codeMirror.getValue():this.textArea.value},r.prototype.setValue=function(e){this.codeMirrorSupported?this.codeMirror.setValue(e):(this.textArea.value=e,n(this.textArea).trigger("change"))},r.prototype.refresh=function(){this.codeMirrorSupported&&this.codeMirror.refresh()},r.prototype.somethingSelected=function(){return this.codeMirrorSupported?this.codeMirror.somethingSelected():!1},r.prototype.getSelection=function(){return this.codeMirrorSupported?this.codeMirror.getSelection():this.textArea.value},r.prototype.getScrollerElement=function(){return this.codeMirrorSupported?this.codeMirror.getScrollerElement():null},r.prototype.getGutterElement=function(){return this.codeMirrorSupported?this.codeMirror.getGutterElement():null},r.prototype.isFullscreen=function(){return this.codeMirrorSupported?n(this.codeMirror.getScrollerElement()).hasClass("CodeMirror-fullscreen"):n(this.textArea).attr("fullscreen")==1},r.prototype.setFullscreen=function(e){if(e){var t=n(window).height()-40;this.codeMirrorSupported?(n(this.codeMirror.getScrollerElement()).addClass("CodeMirror-fullscreen").height(t),n(this.codeMirror.getGutterElement()).height(t)):(n(this.textArea).addClass("fullscreen"),n(this.textArea).height(t),n(this.textArea).attr("fullscreen",e))}else this.codeMirrorSupported?(n(this.codeMirror.getScrollerElement()).removeClass("CodeMirror-fullscreen"),n(this.codeMirror.getGutterElement()).css("height","auto"),n(this.codeMirror.getScrollerElement()).css("height","200px")):(n(this.textArea).removeClass("fullscreen"),n(this.textArea).height(100),n(this.textArea).attr("fullscreen",e))},r}),define("libs/renderTerminator",[],function(){var e=function(e,t){var n=e.find(".terminator a.btn");n.html(n.html().replace(/\[ .+ \]/,"[ "+t+" ]")),e.find(".terminator").data("statement_separator",t)};return e}),define("text!fiddle_backbone/templates/schemaOutput.html",[],function(){return' {{#if errorMessage}}\n <div class="alert alert-error database-error database-messages"><i class="icon-remove"></i>{{errorMessage}}</div> \n {{else}}\n <div class="alert alert-success database-messages"><i class="icon-ok"></i>Schema Ready</div> \n {{/if}}'}),define("text!fiddle_backbone/templates/schemaBrowser.html",[],function(){return' <h3>Schema Browser</h3>\n <ul class="tables">\n {{#each objects}}\n <li>\n <a href="#{{this.table_name}}"><i class="icon-plus"></i> {{this.table_name}}</a> ({{this.table_type}})\n <ul class="columns">\n {{#each this.columns}}\n <li>{{name}} {{type}}</li>\n {{/each}}\n </ul>\n </li>\n {{/each}}\n </ul>'}),define("fiddle_backbone/views/SchemaDef",["jQuery","Backbone","Handlebars","FiddleEditor","libs/renderTerminator","text!fiddle_backbone/templates/schemaOutput.html","text!fiddle_backbone/templates/schemaBrowser.html"],function(e,t,n,r,i,s,o){var u=t.View.extend({initialize:function(){this.editor=new r(this.id,this.handleSchemaChange,this,_.bind(function(){this.model.build()},this)),this.compiledOutputTemplate=n.compile(s),this.compiledSchemaBrowserTemplate=n.compile(o)},handleSchemaChange:function(){if(this.model.get("ddl")!=this.editor.getValue()||this.model.get("statement_separator")!=e(".panel.schema .terminator").data("statement_separator"))this.model.set({ddl:this.editor.getValue(),statement_separator:e(".panel.schema .terminator").data("statement_separator"),ready:!1}),e(".schema .helpTip").css("display",this.model.get("ddl").length?"none":"block"),e(".sql .helpTip").css("display",!this.model.get("ready")||this.model.get("loading")?"none":"block")},render:function(){this.editor.setValue(this.model.get("ddl")),this.updateDependents(),i(e(".panel.schema"),this.model.get("statement_separator"))},renderOutput:function(){this.options.output_el.html(this.compiledOutputTemplate(this.model.toJSON()))},renderSchemaBrowser:function(){this.options.browser_el.html(this.compiledSchemaBrowserTemplate({objects:this.model.get("schema_structure")}))},refresh:function(){this.editor.refresh()},updateDependents:function(){this.model.get("ready")?(e(".needsReadySchema").unblock(),e("#schemaBrowser").attr("disabled",!1),e(".schema .helpTip").css("display","none")):(e(".needsReadySchema").block({message:"Please build schema."}),e("#schemaBrowser").attr("disabled",!0),e(".schema .helpTip").css("display",this.model.get("loading")||this.model.get("ddl").length?"none":"block"))}});return u});var isIE=navigator.appVersion.indexOf("MSIE")!=-1?!0:!1,isWin=navigator.appVersion.toLowerCase().indexOf("win")!=-1?!0:!1,isOpera=navigator.userAgent.indexOf("Opera")!=-1?!0:!1;define("XPlans/oracle/flashver",function(){});var viewerMap={sqlmonitor:["11"],sqlpa:["11"],xplan:["11"],sql_detail:["11","11.2.0.2.0"],EmergencyADDM:["11"],ComparePeriodReport:["11"],AshViewer:["11"]},requiredMajorVersion=10,requiredMinorVersion=0,requiredRevision=0,hasProductInstall=DetectFlashVer(6,0,65),hasRequestedVersion=DetectFlashVer(requiredMajorVersion,requiredMinorVersion,requiredRevision);Vars=function(e){this.numVars=0;if(e!=null){var t,n,r=e.split("&"),i=r.length;for(var s=0;s<i;s++){var o=r[s];if(o.indexOf("=")!=-1&&o.length>3){var t=o.split("="),n=t[0],u=t[1];this[n]==null&&n.length>0&&u.length>0&&(this[n]=u,this.numVars++)}}}},Vars.prototype.toString=function(e){var t="";e==null&&(e="");for(var n in this)this[n]!=null&&typeof this[n]!="object"&&typeof this[n]!="function"&&n!="numVars"&&(t+=e+n+"="+this[n]+"&");return t.length>0&&(t=t.substr(0,t.length-1)),t},define("XPlans/oracle/loadswf",["XPlans/oracle/flashver"],function(e){return function(){return e.loadswf}}(this));if(typeof QP=="undefined"||!QP)var QP={};(function(){function e(e){var r=t(e),i=r[0];i.getContext!==null&&i.getContext!==undefined&&window.setTimeout(function(){var t=i.getContext("2d"),s=$(".qp-tr",e);i.width=s.outerWidth(!0),i.height=s.outerHeight(!0);var o=r.offset();$(".qp-tr",e).each(function(){var e=$("> * > .qp-node",$(this));$("> * > .qp-tr > * > .qp-node",$(this)).each(function(){n(t,o,e,$(this))})}),t.stroke()},1)}function t(e){var t=$("canvas",e);return t.length==0&&(e.prepend($("<canvas></canvas>").css("position","absolute").css("top",0).css("left",0)),t=$("canvas",e)),t}function n(e,t,n,r){var i=n.offset();i.top+=n.outerHeight()/2,i.left+=n.outerWidth();var s=r.offset();s.top+=r.outerHeight()/2;var o=i.left/2+s.left/2;e.moveTo(i.left-t.left,i.top-t.top),e.lineTo(o-t.left,i.top-t.top),e.lineTo(o-t.left,s.top-t.top),e.lineTo(s.left-t.left,s.top-t.top)}QP.drawLines=function(t){t===null||t===undefined?t=$(".qp-root").parent():t=$(t),e(t)}})(),define("XPlans/mssql",function(e){return function(){return e.QP}}(this)),define("text!fiddle_backbone/templates/queryTabularOutput.html",[],function(){return' {{#if id}}\n {{#each_with_index sets}}\n <div class="set" id="set_{{index}}">\n {{#if this.RESULTS.DATA.length}}\n <table class="results table table-bordered table-striped">\n <tr>\n {{#each this.RESULTS.COLUMNS}}\n <th>{{this}}</th>\n {{/each}}\n </tr>\n {{#each this.RESULTS.DATA}}\n <tr>\n {{#each this}}\n <td>{{result_display this this}}</td>\n {{/each}}\n </tr>\n {{/each}}\n </table>\n {{/if}}\n {{#if this.SUCCEEDED}}\n <div id="messages_{{index}}" class="alert alert-success database-messages">\n <i class="icon-ok"></i>\n Record Count: {{this.RESULTS.DATA.length}}; Execution Time: {{this.EXECUTIONTIME}}ms\n {{#if this.EXECUTIONPLAN.DATA.length}}\n <a href="#executionPlan" class="executionPlanLink"><i class="icon-plus"></i>View Execution Plan</a> \n {{/if}}\n <a href="#!{{../../schemaDef/dbType/id}}/{{../../schemaDef/short_code}}/{{../../id}}/{{index}}" class="setLink"><i class="icon-share-alt"></i> link</a>\n </div> \n \n {{#if this.EXECUTIONPLAN.DATA.length}}\n <table class="executionPlan table table-bordered">\n <tr>\n {{#each this.EXECUTIONPLAN.COLUMNS}}\n <th>{{this}}</th>\n {{/each}}\n </tr>\n {{#each this.EXECUTIONPLAN.DATA}}\n <tr>\n {{#each this}}\n <td><div style="position:relative">{{{this}}}</div></td>\n {{/each}}\n </tr>\n {{/each}}\n\n {{#if ../../../schemaDef/dbType/isSQLServer}}\n <tr>\n <td><a href="index.cfm/Fiddles/getSQLPlan?db_type_id={{../../../../schemaDef/dbType/id}}&short_code={{../../../../schemaDef/short_code}}&query_id={{../../../../id}}&id={{index}}">Download .sqlplan</a> | <a href="http://www.sqlsentry.net/plan-explorer/sql-server-query-view.asp?ad=201208-sqlfiddle-pe" target="_new">Download SQL Sentry Plan Explorer (free)</a></td>\n </tr>\n {{/if}}\n\n {{#if ../../../schemaDef/dbType/isPostgreSQL}}\n <tr>\n <td><form action="http://explain.depesz.com/" target="_new"><input type="hidden" name="title" value="{{../../schemaDef/dbType/id}}/{{../../schemaDef/short_code}}/{{../../id}}/{{index}}"><input type="hidden" name="plan" value=""><input type="submit" class="btn btn-info depesz" value="View on Depesz"></form></td>\n </tr>\n {{/if}}\n\n </table>\n {{/if}}\n \n {{else}}\n <div id="messages_{{index}}" class="alert alert-error database-messages"><i class="icon-remove"></i>{{this.ERRORMESSAGE}}</div> \n {{/if}}\n </div>\n {{/each_with_index}}\n \n <span id="donationSuggestion">Did this query solve the problem? If so, consider donating $5 to help make sure SQL Fiddle will be here next time you need help with a database problem. Thanks!</span>\n {{/if}}'}),define("text!fiddle_backbone/templates/queryPlaintextOutput.html",[],function(){return' {{#if id}}\n {{#each_with_index sets}}\n <div class="set" id="set_{{index}}">\n {{#if this.RESULTS.DATA.length}}\n <pre class="results">\n|{{#each_simple_value_with_index this.RESULTS.COLUMNS}} {{result_display_padded ../this/RESULTS/COLUMNWIDTHS}} |{{/each_simple_value_with_index}}\n-{{#each_simple_value_with_index this.RESULTS.COLUMNS}}-{{divider_display ../this/RESULTS/COLUMNWIDTHS}}--{{/each_simple_value_with_index}}{{#each this.RESULTS.DATA}}\n|{{#each_simple_value_with_index this}} {{result_display_padded ../../this/RESULTS/COLUMNWIDTHS}} |{{/each_simple_value_with_index}}{{/each}}\n </pre>\n {{/if}}\n {{#if this.SUCCEEDED}}\n <div id="messages_{{index}}" class="alert alert-success database-messages">\n <i class="icon-ok"></i>\n Record Count: {{this.RESULTS.DATA.length}}; Execution Time: {{this.EXECUTIONTIME}}ms\n {{#if this.EXECUTIONPLAN.DATA.length}}\n <a href="#executionPlan" class="executionPlanLink"><i class="icon-plus"></i>View Execution Plan</a>\n {{/if}}\n <a href="#!{{../../schemaDef/dbType/id}}/{{../../schemaDef/short_code}}/{{../../id}}/{{index}}" class="setLink"><i class="icon-share-alt"></i> link</a>\n </div> \n \n {{#if this.EXECUTIONPLAN.DATA.length}}\n <table class="executionPlan table table-bordered">\n <tr>\n {{#each this.EXECUTIONPLAN.COLUMNS}}\n <th>{{this}}</th>\n {{/each}}\n </tr>\n {{#each this.EXECUTIONPLAN.DATA}}\n <tr>\n {{#each this}}\n <td><div style="position:relative">{{{this}}}</div></td>\n {{/each}}\n </tr>\n {{/each}}\n\n {{#if ../../../schemaDef/dbType/isSQLServer}}\n <tr>\n <td><a href="index.cfm/Fiddles/getSQLPlan?db_type_id={{../../../../schemaDef/dbType/id}}&short_code={{../../../../schemaDef/short_code}}&query_id={{../../../../id}}&id={{index}}">Download .sqlplan</a></td>\n </tr>\n {{/if}}\n\n {{#if ../../../schemaDef/dbType/isPostgreSQL}}\n <tr>\n <td><form action="http://explain.depesz.com/" target="_new"><input type="hidden" name="title" value="{{../../schemaDef/dbType/id}}/{{../../schemaDef/short_code}}/{{../../id}}/{{index}}"><input type="hidden" name="plan" value=""><input type="submit" class="btn btn-info depesz" value="View on Depesz"></form></td>\n </tr>\n {{/if}}\n \n </table>\n {{/if}}\n \n {{else}}\n <div id="messages_{{index}}" class="alert alert-error database-error database-messages"><i class="icon-remove"></i>{{this.ERRORMESSAGE}}</div> \n {{/if}}\n </div>\n {{/each_with_index}}\n\n <span id="donationSuggestion">Did this query solve the problem? If so, consider donating $5 to help make sure SQL Fiddle will be here next time you need help with a database problem. Thanks!</span>\n {{/if}}'}),define("text!fiddle_backbone/templates/queryMarkdownOutput.html",[],function(){return'{{#if id}}\nMarkdown is useful for posting on sites like <a href="http://stackoverflow.com" target="_new">StackOverflow</a> and <a href="http://dba.stackexchange.com" target="_new">dba.se</a>. Also, those sites are great resources for getting help with database questions! \n<pre class="results">[SQL Fiddle][1]\n\n**{{schemaDef.dbType.full_name}} Schema Setup**:\n\n{{code_format schemaDef.ddl}}\n{{#each_with_index sets}}\n**Query {{add index 1}}**:\n\n{{code_format STATEMENT}}\n\n**[Results][{{add index 2}}]**:\n {{#if this.RESULTS.DATA.length}}\n |{{#each_simple_value_with_index this.RESULTS.COLUMNS}} {{result_display_padded ../this/RESULTS/COLUMNWIDTHS}} |{{/each_simple_value_with_index}}\n -{{#each_simple_value_with_index this.RESULTS.COLUMNS}}-{{divider_display ../this/RESULTS/COLUMNWIDTHS}}--{{/each_simple_value_with_index}}{{#each this.RESULTS.DATA}}\n |{{#each_simple_value_with_index this}} {{result_display_padded ../../this/RESULTS/COLUMNWIDTHS}} |{{/each_simple_value_with_index}}{{/each}}\n{{/if}}\n{{/each_with_index}}\n\n [1]: http://sqlfiddle.com/#!{{../schemaDef/dbType/id}}/{{../schemaDef/short_code}}/{{id}}\n{{#each_with_index sets}}\n [{{add index 2}}]: http://sqlfiddle.com/#!{{../../schemaDef/dbType/id}}/{{../../schemaDef/short_code}}/{{../../id}}/{{index}}\n{{/each_with_index}}\n</pre>\n\n<span id="donationSuggestion">Did this query solve the problem? If so, consider donating $5 to help make sure SQL Fiddle will be here next time you need help with a database problem. Thanks!</span>\n\n{{/if}}'}),define("HandlebarsHelpers/divider_display",["Handlebars"],function(e){e.registerHelper("divider_display",function(e){var t=[];return t.length=e[this.index]+1,t.join("-")})}),define("HandlebarsHelpers/each_simple_value_with_index",["Handlebars"],function(e){e.registerHelper("each_simple_value_with_index",function(e,t){var n="";k=0;for(var r=0,i=e.length;r<i;r++){var s={value:e[r]};s.index=k,s.first=k==0,s.last=k==e.length,n+=t(s),k++}return n})}),define("HandlebarsHelpers/each_with_index",["Handlebars"],function(e){e.registerHelper("each_with_index",function(e,t){var n="",r=0;for(var i=0,s=e.length;i<s;i++)if(e[i]){var o=e[i];o.index=r,o.first=r==0,o.last=r==e.length,n+=t(o),r++}return n})}),define("HandlebarsHelpers/result_display_padded",["Handlebars"],function(e){e.registerHelper("result_display_padded",function(e){var t=[];return t.length=e[this.index]-this.value.toString().length+1,t.join(" ")+this.value.toString()})}),define("HandlebarsHelpers/result_display",["jQuery","Handlebars"],function(e,t){t.registerHelper("result_display",function(n){var r=/\b((?:https?:\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?������]))/ig;return e.isPlainObject(n)?JSON.stringify(n):n==null?"(null)":n===!1?"false":typeof n=="string"&&n.match(r)&&t.Utils.escapeExpression(n)==n?new t.SafeString(n.replace(r,"<a href='$1' target='_new'>$1</a>")):n})}),define("HandlebarsHelpers/code_format",["Handlebars"],function(e){e.registerHelper("code_format",function(e){var t=[],n=e.split("\n");for(var r=0;r<n.length;r++)t.push(" "+n[r]);return t.join("\n")})}),define("HandlebarsHelpers/add",["Handlebars"],function(e){e.registerHelper("add",function(e,t){return e+t})}),define("fiddle_backbone/views/Query",["jQuery","Underscore","Backbone","Handlebars","FiddleEditor","libs/renderTerminator","XPlans/oracle/loadswf","XPlans/mssql","text!fiddle_backbone/templates/queryTabularOutput.html","text!fiddle_backbone/templates/queryPlaintextOutput.html","text!fiddle_backbone/templates/queryMarkdownOutput.html","HandlebarsHelpers/divider_display","HandlebarsHelpers/each_simple_value_with_index","HandlebarsHelpers/each_with_index","HandlebarsHelpers/result_display_padded","HandlebarsHelpers/result_display","HandlebarsHelpers/code_format","HandlebarsHelpers/add"],function(e,t,n,r,i,s,o,u,a,f,l){var c=n.View.extend({initialize:function(){this.editor=new i(this.id,this.handleQueryChange,this,t.bind(function(){this.model.execute()},this)),this.outputType="tabular",this.compiledOutputTemplate={},this.compiledOutputTemplate.tabular=r.compile(a),this.compiledOutputTemplate.plaintext=r.compile(f),this.compiledOutputTemplate.markdown=r.compile(l)},setOutputType:function(e){this.outputType=e},handleQueryChange:function(t){var n=this.model.get("schemaDef");this.model.set({sql:this.editor.getValue()}),e(".sql .helpTip").css("display",!n.get("ready")||n.get("loading")||this.model.get("sql").length?"none":"block")},render:function(){this.editor.setValue(this.model.get("sql")),this.model.id&&this.renderOutput(),s(e(".panel.sql"),this.model.get("statement_separator"))},renderOutput:function(){var n=this.model,r=this.model.toJSON();t.each(r.sets,function(e,n){if(e.RESULTS){var i=t.map(e.RESULTS.COLUMNS,function(e){return e.length});t.each(e.RESULTS.DATA,function(e){i=t.map(e,function(e,n){return t.max([e.toString().length,i[n]])})}),r.sets[n].RESULTS.COLUMNWIDTHS=i}}),r.schemaDef=this.model.get("schemaDef").toJSON(),r.schemaDef.dbType=this.model.get("schemaDef").get("dbType").toJSON(),r.schemaDef.dbType.isSQLServer=this.model.get("schemaDef").get("dbType").get("simple_name")=="SQL Server",r.schemaDef.dbType.isPostgreSQL=this.model.get("schemaDef").get("dbType").get("simple_name")=="PostgreSQL",this.options.output_el.html(this.compiledOutputTemplate[this.outputType](r)),e("script.oracle_xplan_xml").each(function(){e(this).siblings("div.oracle_xplan").html(o(e(this).text()))}),this.options.output_el.find("a.executionPlanLink").click(function(t){t.preventDefault(),e("i",this).toggleClass("icon-minus icon-plus"),e(this).closest(".set").find(".executionPlan").toggle(),e("i",this).hasClass("icon-minus")&&n.get("schemaDef").get("dbType").get("simple_name")=="SQL Server"&&u.drawLines(e(this).closest(".set").find(".executionPlan div"))})},refresh:function(){this.editor.refresh()},checkForSelectedText:function(){this.editor.somethingSelected()?this.model.set("sql",this.editor.getSelection()):this.model.set("sql",this.editor.getValue())}});return c}),define("fiddle_backbone/router",["jQuery","Underscore","Backbone","libs/renderTerminator","fiddle_backbone/models/UsedFiddle"],function(e,t,n,r,i){var s=function(s,o,u,a,f){var l=n.Router.extend({routes:{"!:db_type_id":"DBType","!:db_type_id/:short_code":"SchemaDef","!:db_type_id/:short_code/:query_id":"Query","!:db_type_id/:short_code/:query_id/:set_id":"SetAnchor"},DBType:function(e){s.setSelectedType(e,!0),f.render()},SchemaDef:function(e,t){this.loadContent(e,"!"+e+"/"+t)},Query:function(e,t,n){this.loadContent(e,"!"+e+"/"+t+"/"+n)},SetAnchor:function(n,r,i,a){var f=function(){e("#set_"+a).length&&(window.scrollTo(0,e("#set_"+a).offset().top-50),e("#set_"+a).addClass("highlight"))};!s.getSelectedType()||s.getSelectedType().get("id")!=n||o.get("short_code")!=r||u.get("id")!=i?(u.bind("reloaded",t.once(f)),this.loadContent(n,"!"+n+"/"+r+"/"+i)):(e(".set").removeClass("highlight"),f())},loadContent:function(n,f){this.DBType(n);if(u.get("pendingChanges")&&!confirm("Warning! You have made changes to your query which will be lost. Continue?'"))return!1;o.set("loading",!0),e(".helpTip").css("display","none"),e("body").block({message:"Loading..."}),e.getJSON("index.cfm/fiddles/loadContent",{fragment:f},function(f){o.set("loading",!1);if(f.short_code){var l=s.getSelectedType();l.get("context")=="browser"?(l.get("className")=="sqljs"&&o.get("browserEngines").websql.nativeSQLite&&confirm("Fiddle originally built with SQL.js, but you have WebSQL available - would you like to use that instead (it'll be faster to load)?")&&(s.setSelectedType(e("#db_type_id a:contains('WebSQL')").closest("li").attr("db_type_id")),l=s.getSelectedType(),o.set({ddl:f.ddl,dbType:l,statement_separator:f.schema_statement_separator}),f.sql&&(u.set({schemaDef:o,sql:f.sql,statement_separator:f.query_statement_separator}),o.on("built",t.once(function(){u.execute()}))),o.build()),o.get("browserEngines")[l.get("className")].buildSchema({short_code:e.trim(f.short_code),statement_separator:f.schema_statement_separator,ddl:f.ddl,success:function(){o.set({short_code:f.short_code,ddl:f.ddl,ready:!0,valid:!0,errorMessage:"",statement_separator:f.schema_statement_separator,dbType:s.getSelectedType()}),r(e(".panel.schema"),f.schema_statement_separator),f.sql?(a.insert(new i({fragment:"!"+n+"/"+f.short_code+"/"+f.id})),u.set({id:f.id,sql:f.sql,statement_separator:f.query_statement_separator})):a.insert(new i({fragment:"!"+n+"/"+f.short_code})),o.get("browserEngines")[l.get("className")].getSchemaStructure({callback:function(t){o.set({schema_structure:t}),o.trigger("reloaded"),f.sql?o.get("browserEngines")[l.get("className")].executeQuery({sql:f.sql,statement_separator:f.query_statement_separator,success:function(t){u.set({sets:t}),u.trigger("reloaded"),e("body").unblock()},error:function(t){u.set({sets:[]}),u.trigger("reloaded"),e("body").unblock()}}):e("body").unblock()}})},error:function(t){o.set({short_code:f.short_code,ddl:f.ddl,ready:!0,valid:!1,errorMessage:t,dbType:s.getSelectedType(),statement_separator:f.schema_statement_separator,schema_structure:[]}),r(e(".panel.schema"),f.schema_statement_separator),f.sql&&(u.set({id:f.id,sql:f.sql,statement_separator:f.query_statement_separator,schemaDef:o}),u.trigger("reloaded")),o.trigger("failed"),o.trigger("reloaded"),e("body").unblock()}})):(o.set({short_code:f.short_code,ddl:f.ddl,ready:!0,valid:!0,errorMessage:"",statement_separator:f.schema_statement_separator,schema_structure:f.schema_structure}),r(e(".panel.schema"),f.schema_statement_separator),o.trigger("reloaded"),f.sql?(a.insert(new i({fragment:"!"+n+"/"+f.short_code+"/"+f.id})),u.set({id:f.id,sql:f.sql,sets:f.sets,statement_separator:f.query_statement_separator}),u.trigger("reloaded")):a.insert(new i({fragment:"!"+n+"/"+f.short_code})),e("body").unblock())}else e("body").unblock()})}}),c=new l;return n.history.start({pushState:!1}),c};return{initialize:s}}),function(e){function u(n,u){var f=n==window,c=u&&u.message!==undefined?u.message:undefined;u=e.extend({},e.blockUI.defaults,u||{}),u.overlayCSS=e.extend({},e.blockUI.defaults.overlayCSS,u.overlayCSS||{});var v=e.extend({},e.blockUI.defaults.css,u.css||{}),m=e.extend({},e.blockUI.defaults.themedCSS,u.themedCSS||{});c=c===undefined?u.message:c,f&&s&&a(window,{fadeOut:0});if(c&&typeof c!="string"&&(c.parentNode||c.jquery)){var g=c.jquery?c[0]:c,y={};e(n).data("blockUI.history",y),y.el=g,y.parent=g.parentNode,y.display=g.style.display,y.position=g.style.position,y.parent&&y.parent.removeChild(g)}e(n).data("blockUI.onUnblock",u.onUnblock);var b=u.baseZ,w=e.browser.msie||u.forceIframe?e('<iframe class="blockUI" style="z-index:'+b++ +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+u.iframeSrc+'"></iframe>'):e('<div class="blockUI" style="display:none"></div>'),E=u.theme?e('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+b++ +';display:none"></div>'):e('<div class="blockUI blockOverlay" style="z-index:'+b++ +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>'),S,x;u.theme&&f?x='<div class="blockUI '+u.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(b+10)+';display:none;position:fixed">'+'<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(u.title||" ")+"</div>"+'<div class="ui-widget-content ui-dialog-content"></div>'+"</div>":u.theme?x='<div class="blockUI '+u.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(b+10)+';display:none;position:absolute">'+'<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(u.title||" ")+"</div>"+'<div class="ui-widget-content ui-dialog-content"></div>'+"</div>":f?x='<div class="blockUI '+u.blockMsgClass+' blockPage" style="z-index:'+(b+10)+';display:none;position:fixed"></div>':x='<div class="blockUI '+u.blockMsgClass+' blockElement" style="z-index:'+(b+10)+';display:none;position:absolute"></div>',S=e(x),c&&(u.theme?(S.css(m),S.addClass("ui-widget-content")):S.css(v)),!u.theme&&(!u.applyPlatformOpacityRules||!e.browser.mozilla||!/Linux/.test(navigator.platform))&&E.css(u.overlayCSS),E.css("position",f?"fixed":"absolute"),(e.browser.msie||u.forceIframe)&&w.css("opacity",0);var T=[w,E,S],N=f?e("body"):e(n);e.each(T,function(){this.appendTo(N)}),u.theme&&u.draggable&&e.fn.draggable&&S.draggable({handle:".ui-dialog-titlebar",cancel:"li"});var C=r&&(!e.boxModel||e("object,embed",f?null:n).length>0);if(i||C){f&&u.allowBodyStretch&&e.boxModel&&e("html,body").css("height","100%");if((i||!e.boxModel)&&!f)var k=d(n,"borderTopWidth"),L=d(n,"borderLeftWidth"),A=k?"(0 - "+k+")":0,O=L?"(0 - "+L+")":0;e.each([w,E,S],function(e,t){var n=t[0].style;n.position="absolute";if(e<2)f?n.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:"+u.quirksmodeOffsetHack+') + "px"'):n.setExpression("height",'this.parentNode.offsetHeight + "px"'),f?n.setExpression("width",'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):n.setExpression("width",'this.parentNode.offsetWidth + "px"'),O&&n.setExpression("left",O),A&&n.setExpression("top",A);else if(u.centerY)f&&n.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'),n.marginTop=0;else if(!u.centerY&&f){var r=u.css&&u.css.top?parseInt(u.css.top):0,i="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+r+') + "px"';n.setExpression("top",i)}})}c&&(u.theme?S.find(".ui-widget-content").append(c):S.append(c),(c.jquery||c.nodeType)&&e(c).show()),(e.browser.msie||u.forceIframe)&&u.showOverlay&&w.show();if(u.fadeIn){var M=u.onBlock?u.onBlock:t,_=u.showOverlay&&!c?M:t,D=c?M:t;u.showOverlay&&E._fadeIn(u.fadeIn,_),c&&S._fadeIn(u.fadeIn,D)}else u.showOverlay&&E.show(),c&&S.show(),u.onBlock&&u.onBlock();l(1,n,u),f?(s=S[0],o=e(":input:enabled:visible",s),u.focusInput&&setTimeout(h,20)):p(S[0],u.centerX,u.centerY);if(u.timeout){var P=setTimeout(function(){f?e.unblockUI(u):e(n).unblock(u)},u.timeout);e(n).data("blockUI.timeout",P)}}function a(t,n){var r=t==window,i=e(t),u=i.data("blockUI.history"),a=i.data("blockUI.timeout");a&&(clearTimeout(a),i.removeData("blockUI.timeout")),n=e.extend({},e.blockUI.defaults,n||{}),l(0,t,n),n.onUnblock===null&&(n.onUnblock=i.data("blockUI.onUnblock"),i.removeData("blockUI.onUnblock"));var c;r?c=e("body").children().filter(".blockUI").add("body > .blockUI"):c=e(".blockUI",t),r&&(s=o=null),n.fadeOut?(c.fadeOut(n.fadeOut),setTimeout(function(){f(c,u,n,t)},n.fadeOut)):f(c,u,n,t)}function f(t,n,r,i){t.each(function(e,t){this.parentNode&&this.parentNode.removeChild(this)}),n&&n.el&&(n.el.style.display=n.display,n.el.style.position=n.position,n.parent&&n.parent.appendChild(n.el),e(i).removeData("blockUI.history")),typeof r.onUnblock=="function"&&r.onUnblock(i,r)}function l(t,n,r){var i=n==window,o=e(n);if(!t&&(i&&!s||!i&&!o.data("blockUI.isBlocked")))return;i||o.data("blockUI.isBlocked",t);if(!r.bindEvents||t&&!r.showOverlay)return;var u="mousedown mouseup keydown keypress";t?e(document).bind(u,r,c):e(document).unbind(u,c)}function c(t){if(t.keyCode&&t.keyCode==9&&s&&t.data.constrainTabKey){var n=o,r=!t.shiftKey&&t.target===n[n.length-1],i=t.shiftKey&&t.target===n[0];if(r||i)return setTimeout(function(){h(i)},10),!1}var u=t.data;return e(t.target).parents("div."+u.blockMsgClass).length>0?!0:e(t.target).parents().children().filter("div.blockUI").length==0}function h(e){if(!o)return;var t=o[e===!0?o.length-1:0];t&&t.focus()}function p(e,t,n){var r=e.parentNode,i=e.style,s=(r.offsetWidth-e.offsetWidth)/2-d(r,"borderLeftWidth"),o=(r.offsetHeight-e.offsetHeight)/2-d(r,"borderTopWidth");t&&(i.left=s>0?s+"px":"0"),n&&(i.top=o>0?o+"px":"0")}function d(t,n){return parseInt(e.css(t,n))||0}if(/1\.(0|1|2)\.(0|1|2)/.test(e.fn.jquery)||/^1.1/.test(e.fn.jquery)){alert("blockUI requires jQuery v1.2.3 or later! You are using v"+e.fn.jquery);return}e.fn._fadeIn=e.fn.fadeIn;var t=function(){},n=document.documentMode||0,r=e.browser.msie&&(e.browser.version<8&&!n||n<8),i=e.browser.msie&&/MSIE 6.0/.test(navigator.userAgent)&&!n;e.blockUI=function(e){u(window,e)},e.unblockUI=function(e){a(window,e)},e.growlUI=function(t,n,r,i){var s=e('<div class="growlUI"></div>');t&&s.append("<h1>"+t+"</h1>"),n&&s.append("<h2>"+n+"</h2>"),r==undefined&&(r=3e3),e.blockUI({message:s,fadeIn:700,fadeOut:1e3,centerY:!1,timeout:r,showOverlay:!1,onUnblock:i,css:e.blockUI.defaults.growlCSS})},e.fn.block=function(t){return this.unblock({fadeOut:0}).each(function(){e.css(this,"position")=="static"&&(this.style.position="relative"),e.browser.msie&&(this.style.zoom=1),u(this,t)})},e.fn.unblock=function(e){return this.each(function(){a(this,e)})},e.blockUI.version=2.39,e.blockUI.defaults={message:"<h1>Please wait...</h1>",title:null,draggable:!0,theme:!1,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:.6,cursor:"wait"},growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:!1,baseZ:1e3,centerX:!0,centerY:!0,allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,applyPlatformOpacityRules:!0,onBlock:null,onUnblock:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg"};var s=null,o=[]}(jQuery),define("libs/jquery/jquery.blockUI",function(){}),function(e){e.cookie=function(t,n,r){if(arguments.length>1&&(!/Object/.test(Object.prototype.toString.call(n))||n===null||n===undefined)){r=e.extend({},r);if(n===null||n===undefined)r.expires=-1;if(typeof r.expires=="number"){var i=r.expires,s=r.expires=new Date;s.setDate(s.getDate()+i)}return n=String(n),document.cookie=[encodeURIComponent(t),"=",r.raw?n:encodeURIComponent(n),r.expires?"; expires="+r.expires.toUTCString():"",r.path?"; path="+r.path:"",r.domain?"; domain="+r.domain:"",r.secure?"; secure":""].join("")}r=n||{};var o=r.raw?function(e){return e}:decodeURIComponent,u=document.cookie.split("; ");for(var a=0,f;f=u[a]&&u[a].split("=");a++)if(o(f[0])===t)return o(f[1]||"");return null}}(jQuery),define("libs/jquery/jquery.cookie",function(){}),!function(e){var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning)return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning)return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=typeof n=="object"&&n;i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e(function(){e("body").on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();e(i).collapse(s)})})}(window.jQuery),define("Bootstrap/bootstrap-collapse",function(){}),!function(e){var t=function(t){this.element=e(t)};t.prototype={constructor:t,show:function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.attr("data-target"),i,s,o;r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("active"))return;i=n.find(".active a").last()[0],o=e.Event("show",{relatedTarget:i}),t.trigger(o);if(o.isDefaultPrevented())return;s=e(r),this.activate(t.parent("li"),n),this.activate(s,s.parent(),function(){t.trigger({type:"shown",relatedTarget:i})})},activate:function(t,n,r){function o(){i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var i=n.find("> .active"),s=r&&e.support.transition&&i.hasClass("fade");s?i.one(e.support.transition.end,o):o(),i.removeClass("in")}},e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("tab");i||r.data("tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e(function(){e("body").on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})})}(window.jQuery),define("Bootstrap/bootstrap-tab",function(){}),!function(e){function r(){e(t).parent().removeClass("open")}var t='[data-toggle="dropdown"]',n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),i,s,o;if(n.is(".disabled, :disabled"))return;return s=n.attr("data-target"),s||(s=n.attr("href"),s=s&&s.replace(/.*(?=#[^\s]*$)/,"")),i=e(s),i.length||(i=n.parent()),o=i.hasClass("open"),r(),o||i.toggleClass("open"),!1}},e.fn.dropdown=function(t){return this.each(function(){var r=e(this),i=r.data("dropdown");i||r.data("dropdown",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.dropdown.Constructor=n,e(function(){e("html").on("click.dropdown.data-api",r),e("body").on("click.dropdown",".dropdown form",function(e){e.stopPropagation()}).on("click.dropdown.data-api",t,n.prototype.toggle)})}(window.jQuery),define("Bootstrap/bootstrap-dropdown",function(){}),!function(e){function n(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),r.call(t)},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),r.call(t)})}function r(e){this.$element.hide().trigger("hidden"),i.call(this)}function i(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="modal-backdrop '+r+'" />').appendTo(document.body),this.options.backdrop!="static"&&this.$backdrop.click(e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,e.proxy(s,this)):s.call(this)):t&&t()}function s(){this.$backdrop.remove(),this.$backdrop=null}function o(){var t=this;this.isShown&&this.options.keyboard?e(document).on("keyup.dismiss.modal",function(e){e.which==27&&t.hide()}):this.isShown||e(document).off("keyup.dismiss.modal")}var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this))};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;e("body").addClass("modal-open"),this.isShown=!0,o.call(this),i.call(this,function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in"),n?t.$element.one(e.support.transition.end,function(){t.$element.trigger("shown")}):t.$element.trigger("shown")})},hide:function(t){t&&t.preventDefault();var i=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,e("body").removeClass("modal-open"),o.call(this),this.$element.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?n.call(this):r.call(this)}},e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e(function(){e("body").on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({},i.data(),n.data());t.preventDefault(),i.modal(s)})})}(window.jQuery),define("Bootstrap/bootstrap-modal",function(){}),!function(e){var t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var i,s;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,this.options.trigger!="manual"&&(i=this.options.trigger=="hover"?"mouseenter":"focus",s=this.options.trigger=="hover"?"mouseleave":"blur",this.$element.on(i,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s,this.options.selector,e.proxy(this.leave,this))),this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=e.extend({},e.fn[this.type].defaults,t,this.$element.data()),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);if(!n.options.delay||!n.options.delay.show)return n.show();clearTimeout(this.timeout),n.hoverState="in",this.timeout=setTimeout(function(){n.hoverState=="in"&&n.show()},n.options.delay.show)},leave:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var e,t,n,r,i,s,o;if(this.hasContent()&&this.enabled){e=this.tip(),this.setContent(),this.options.animation&&e.addClass("fade"),s=typeof this.options.placement=="function"?this.options.placement.call(this,e[0],this.$element[0]):this.options.placement,t=/in/.test(s),e.remove().css({top:0,left:0,display:"block"}).appendTo(t?this.$element:document.body),n=this.getPosition(t),r=e[0].offsetWidth,i=e[0].offsetHeight;switch(t?s.split(" ")[1]:s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}e.css(o).addClass(s).addClass("in")}},isHTML:function(e){return typeof e!="string"||e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3||/^(?:[^<]*<[\w\W]+>[^>]*$)/.exec(e)},setContent:function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.isHTML(t)?"html":"text"](t),e.removeClass("fade in top bottom left right")},hide:function(){function r(){var t=setTimeout(function(){n.off(e.support.transition.end).remove()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.remove()})}var t=this,n=this.tip();n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?r():n.remove()},fixTitle:function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(t){return e.extend({},t?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return this.$tip=this.$tip||e(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()}},e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover",title:"",delay:0}}(window.jQuery),define("Bootstrap/bootstrap-tooltip",function(){}),!function(e){var t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.isHTML(t)?"html":"text"](t),e.find(".popover-content > *")[this.isHTML(n)?"html":"text"](n),e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-content")||(typeof n.content=="function"?n.content.call(t[0]):n.content),e},tip:function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip}}),e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("popover"),s=typeof n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults,{placement:"right",content:"",template:'<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'})}(window.jQuery),define("Bootstrap/bootstrap-popover",function(){}),define("fiddle_backbone/app",["BrowserEngines/engines","fiddle_backbone/models/UsedFiddle","fiddle_backbone/models/MyFiddleHistory","fiddle_backbone/models/DBTypesList","fiddle_backbone/models/SchemaDef","fiddle_backbone/models/Query","fiddle_backbone/views/DBTypesList","fiddle_backbone/views/SchemaDef","fiddle_backbone/views/Query","fiddle_backbone/router","libs/renderTerminator","libs/jquery/jquery.blockUI","libs/jquery/jquery.cookie","Bootstrap/bootstrap-collapse","Bootstrap/bootstrap-tab","Bootstrap/bootstrap-dropdown","Bootstrap/bootstrap-modal","Bootstrap/bootstrap-tooltip","Bootstrap/bootstrap-popover"],function(e,t,n,r,i,s,o,u,a,f,l){var c=function(c){var h={},p=new n,d=new r,v=new i({browserEngines:e}),m=new s({schemaDef:v}),g=new o({el:$("#db_type_id")[0],collection:d}),y=new u({id:"schema_ddl",model:v,output_el:$("#output"),browser_el:$("#browser")}),b=new a({id:"sql",model:m,output_el:$("#output")});d.on("change",function(){g.render(),v.has("dbType")&&v.set("ready",v.get("dbType").id==this.getSelectedType().id)}),v.on("change",function(){this.hasChanged("ready")&&y.updateDependents(),this.hasChanged("errorMessage")&&y.renderOutput(),this.hasChanged("schema_structure")&&y.renderSchemaBrowser()}),v.on("reloaded",function(){this.set("dbType",d.getSelectedType()),y.render()}),m.on("reloaded",function(){this.set({pendingChanges:!1},{silent:!0}),b.render()}),v.on("built failed",function(){$("#buildSchema label").prop("disabled",!1),$("#buildSchema label").html($("#buildSchema label").data("originalValue")),y.renderOutput(),y.renderSchemaBrowser()}),m.on("change",function(){(this.hasChanged("sql")||this.hasChanged("statement_separator"))&&!this.hasChanged("id")&&!this.get("pendingChanges")&&this.set({pendingChanges:!0},{silent:!0})}),m.on("executed",function(){var e=$(".runQuery");e.prop("disabled",!1),e.html(e.data("originalValue")),this.set({pendingChanges:!1},{silent:!0}),b.renderOutput()}),$("#buildSchema").click(function(e){var t=$("label",this);e.preventDefault();if(t.prop("disabled"))return!1;t.data("originalValue",t.html()),t.prop("disabled",!0).text("Building Schema..."),v.build()});var w=function(e){var t=$(".runQuery");e.preventDefault();if(t.prop("disabled"))return!1;t.data("originalValue",t.html()),t.prop("disabled",!0).text("Executing SQL..."),b.checkForSelectedText(),m.execute()};return $(".runQuery").click(w),$(document).keyup(function(e){e.keyCode==116&&(e.preventDefault(),w(e))}),$("#runQueryOptions li a").click(function(e){e.preventDefault(),b.setOutputType(this.id),b.renderOutput()}),$("#queryPrettify").click(function(e){var t=$(this);t.attr("disabled",!0),e.preventDefault(),$.post("index.cfm/proxy/formatSQL",{sql:m.get("sql")},function(e){m.set({sql:e}),m.trigger("reloaded"),m.set({pendingChanges:!0}),t.attr("disabled",!1)})}),$(".terminator .dropdown-menu a").on("click",function(e){e.preventDefault(),l($(this).closest(".panel"),$(this).attr("href")),$(this).closest(".panel").hasClass("schema")?y.handleSchemaChange():m.set({pendingChanges:!0,statement_separator:$(this).attr("href")},{silent:!0})}),$("#output").on("click",".depesz",function(e){var t=$(this).closest(".set").find(".executionPlan tr:not(:first)").text();$(this).closest("form").find("[name=plan]").val(t)}),$(window).bind("beforeunload",function(){if(m.get("pendingChanges"))return"Warning! You have made changes to your query which will be lost. Continue?'"}),d.on("reset",function(){h=f.initialize(d,v,m,p,g),this.length&&!this.getSelectedType()&&this.setSelectedType(this.first().id,!0),g.render(),y.render(),b.render()}),p.on("change reset remove",function(){localStorage&&localStorage.setItem("fiddleHistory",JSON.stringify(this.toJSON()))}),$("#clear").click(function(e){e.preventDefault(),v.reset(),m.reset(),h.navigate("!"+d.getSelectedType().id,{trigger:!0})}),$("#sample").click(function(e){e.preventDefault(),h.navigate("!"+d.getSelectedType().get("sample_fragment"),{trigger:!0})}),d.on("change",function(){g.render(),m.id&&v.get("short_code").length&&v.get("dbType").id==this.getSelectedType().id?h.navigate("!"+this.getSelectedType().id+"/"+v.get("short_code")+"/"+m.id):v.get("short_code").length&&v.get("dbType").id==this.getSelectedType().id?h.navigate("!"+this.getSelectedType().id+"/"+v.get("short_code")):h.navigate("!"+this.getSelectedType().id),v.set("dbType",this.getSelectedType())}),v.on("built",function(){p.insert(new t({fragment:"!"+this.get("dbType").id+"/"+this.get("short_code")})),h.navigate("!"+this.get("dbType").id+"/"+this.get("short_code"))}),m.on("executed",function(){var e=this.get("schemaDef");p.insert(new t({fragment:"!"+e.get("dbType").id+"/"+e.get("short_code")+"/"+this.id})),h.navigate("!"+e.get("dbType").id+"/"+e.get("short_code")+"/"+this.id)}),d.reset(c),{dbTypes:d,schemaDef:v,schemaDefView:y,queryView:b}};return{initialize:c}});var dateFormat=function(){var e=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,t=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,n=/[^-+\dA-Z]/g,r=function(e,t){e=String(e),t=t||2;while(e.length<t)e="0"+e;return e};return function(i,s,o){var u=dateFormat;arguments.length==1&&Object.prototype.toString.call(i)=="[object String]"&&!/\d/.test(i)&&(s=i,i=undefined),i=i?new Date(i):new Date;if(isNaN(i))throw SyntaxError("invalid date");s=String(u.masks[s]||s||u.masks["default"]),s.slice(0,4)=="UTC:"&&(s=s.slice(4),o=!0);var a=o?"getUTC":"get",f=i[a+"Date"](),l=i[a+"Day"](),c=i[a+"Month"](),h=i[a+"FullYear"](),p=i[a+"Hours"](),d=i[a+"Minutes"](),v=i[a+"Seconds"](),m=i[a+"Milliseconds"](),g=o?0:i.getTimezoneOffset(),y={d:f,dd:r(f),ddd:u.i18n.dayNames[l],dddd:u.i18n.dayNames[l+7],m:c+1,mm:r(c+1),mmm:u.i18n.monthNames[c],mmmm:u.i18n.monthNames[c+12],yy:String(h).slice(2),yyyy:h,h:p%12||12,hh:r(p%12||12),H:p,HH:r(p),M:d,MM:r(d),s:v,ss:r(v),l:r(m,3),L:r(m>99?Math.round(m/10):m),t:p<12?"a":"p",tt:p<12?"am":"pm",T:p<12?"A":"P",TT:p<12?"AM":"PM",Z:o?"UTC":(String(i).match(t)||[""]).pop().replace(n,""),o:(g>0?"-":"+")+r(Math.floor(Math.abs(g)/60)*100+Math.abs(g)%60,4),S:["th","st","nd","rd"][f%10>3?0:(f%100-f%10!=10)*f%10]};return s.replace(e,function(e){return e in y?y[e]:e.slice(1,e.length-1)})}}();dateFormat.masks={"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"},dateFormat.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]},Date.prototype.format=function(e,t){return dateFormat(this,e,t)},define("DateFormat",function(e){return function(){return e.dateFormat}}(this)),define("text!DDLBuilder/templates/generic.sql",[],function(){return"CREATE TABLE {{{tablePrefix}}}{{tableName}}{{{tableSuffix}}}\n ({{#each_with_index columns}}{{#if index}}, {{/if}}{{{../fieldPrefix}}}{{name}}{{{../fieldSuffix}}} {{db_type}}{{/each_with_index}})\n{{separator}}\n \nINSERT INTO {{{tablePrefix}}}{{tableName}}{{{tableSuffix}}}\n ({{#each_with_index columns}}{{#if index}}, {{/if}}{{{../fieldPrefix}}}{{name}}{{{../fieldSuffix}}}{{/each_with_index}})\nVALUES\n {{#each_with_index data}}{{#if index}},\n {{/if}}({{#each_with_index r}}{{#if index}}, {{/if}}{{formatted_field ../..}}{{/each_with_index}}){{/each_with_index}}\n{{separator}}"}),define("text!DDLBuilder/templates/oracle.sql",[],function(){return"CREATE TABLE {{{tablePrefix}}}{{tableName}}{{{tableSuffix}}}\n ({{#each_with_index columns}}{{#if index}}, {{/if}}{{{../fieldPrefix}}}{{name}}{{{../fieldSuffix}}} {{db_type}}{{/each_with_index}})\n{{separator}}\n\nINSERT ALL {{#each_with_index data}}\n INTO {{{../tablePrefix}}}{{../tableName}}{{{../tableSuffix}}} ({{#each_with_index r}}{{#if index}}, {{/if}}{{{../../fieldPrefix}}}{{column_name_for_index ../..}}{{{../../fieldSuffix}}}{{/each_with_index}})\n VALUES ({{#each_with_index r}}{{#if index}}, {{/if}}{{formatted_field ../..}}{{/each_with_index}}){{/each_with_index}}\nSELECT * FROM dual\n{{separator}}"}),define("text!DDLBuilder/templates/sqlite.sql",[],function(){return"CREATE TABLE {{tablePrefix}}{{tableName}}{{tableSuffix}}\n ({{#each_with_index columns}}{{#if index}}, {{/if}}{{{../fieldPrefix}}}{{name}}{{{../fieldSuffix}}} {{db_type}}{{/each_with_index}})\n{{separator}}\n\n{{#each_with_index data}}\nINSERT INTO {{tablePrefix}}{{../tableName}}{{tableSuffix}}\n ({{#each_with_index ../columns}}{{#if index}}, {{/if}}{{{../../fieldPrefix}}}{{name}}{{{../../fieldSuffix}}}{{/each_with_index}})\nVALUES\n ({{#each_with_index r}}{{#if index}}, {{/if}}{{formatted_field ../..}}{{/each_with_index}})\n{{../separator}}\n\n{{/each_with_index}}"}),define("DDLBuilder/ddl_builder",["jQuery","Handlebars","DateFormat","text!./templates/generic.sql","text!./templates/oracle.sql","text!./templates/sqlite.sql","HandlebarsHelpers/each_with_index"],function(e,t,n,r,i,s){return ddl_builder=function(e){return e||(e={}),this.fieldPrefix="",this.fieldSuffix="",this.tablePrefix="",this.tableSuffix="",this.dateFormatMask="yyyy-mm-dd HH:MM:ss",this.charType="varchar",this.intType="int",this.floatType="numeric",this.dateType="datetime",this.valueSeparator="",this.column_count=0,this.definition={tableName:"Table1",columns:[],data:[]},this.ddlTemplate=r,this.compiledTemplate=t.compile(this.ddlTemplate),this.setup(e),this},ddl_builder.prototype.setup=function(e){for(var n in e)this[n]=e[n];return e.ddlTemplate&&(this.compiledTemplate=t.compile(this.ddlTemplate)),e.tableName&&(this.definition.tableName=e.tableName),this},ddl_builder.prototype.setupForDBType=function(e,t){switch(e){case"SQL Server":this.setup({statement_separator:t,fieldPrefix:"[",fieldSuffix:"]",tablePrefix:"[",tableSuffix:"]"});break;case"MySQL":this.setup({statement_separator:t,fieldPrefix:"`",fieldSuffix:"`",tablePrefix:"`",tableSuffix:"`"});break;case"PostgreSQL":this.setup({statement_separator:t,dateType:"timestamp",fieldPrefix:'"',fieldSuffix:'"'});break;case"Oracle":var n=i;this.setup({dateFormatMask:"dd-mmm-yyyy hh:MM:ss TT",statement_separator:t,ddlTemplate:n,dateType:"timestamp",charType:"varchar2",fieldPrefix:'"',fieldSuffix:'"'});break;case"SQLite":var n=s;this.setup({fieldPrefix:'"',fieldSuffix:'"',tablePrefix:'"',tableSuffix:'"',statement_separator:t,ddlTemplate:n,dateType:"DATE",charType:"TEXT",intType:"INTEGER",floatType:"REAL"})}return this},ddl_builder.prototype.populateDBTypes=function(){for(var e=0;e<this.definition.columns.length;e++)this.definition.columns[e].type=="charType"?this.definition.columns[e].db_type=this[this.definition.columns[e].type]+"("+this.definition.columns[e].length+")":this.definition.columns[e].db_type=this[this.definition.columns[e].type];this.definition.dateFormatMask=this.dateFormatMask},ddl_builder.prototype.populateWrappers=function(){this.definition.fieldPrefix=this.fieldPrefix,this.definition.fieldSuffix=this.fieldSuffix},ddl_builder.prototype.guessValueSeparator=function(t){var n=t.split("\n"),r=!1,i=0,s="";for(var o=0;o<n.length;o++)if(n[o].search(/[A-Z0-9_]/i)!=-1&&!r){var u=e.trim(n[o]).match(/([A-Z0-9_]+ ?)+([^A-Z0-9_]*)/gi);u.length==1&&(u=e.trim(n[o]).match(/([A-Z0-9_]+ ?)+?([^A-Z0-9_]*)/gi)),r=!0;for(var a=0;a<u.length;a++){var f=u[a].match(/[A-Z0-9_]+([^A-Z0-9_]*)$/i).pop();f.search(/^\s\s+$/)!=-1?f=new RegExp("\\s\\s+"):f.search(/^\t+$/)!=-1?f=new RegExp("\\t+"):f.search(/^\s+$/)!=-1?f=new RegExp("\\s+"):f=e.trim(f);if(f instanceof RegExp||f.length)if(s instanceof RegExp||!!s.length){if(s.toString()!=f.toString())return{status:!1,message:"Unable to find consistent column separator in header row"}}else s=f;else!(f instanceof RegExp)&&!(s instanceof RegExp)&&!s.length&&(s="\n")}s instanceof RegExp||s.length?i=e.trim(n[o]).split(s).length:i=1}else if(n[o].search(/[A-Z0-9_]/i)!=-1&&e.trim(n[o]).split(s).length!=i&&(s.toString()!=/\s\s+/.toString()||e.trim(n[o]).split(/\s+/).length!=i))return{status:!1,message:"Line "+o+' does not have the same number of columns as the header, based on separator "'+s+'".'};return{status:!0,separator:s,column_count:i}},ddl_builder.prototype.parse=function(t){if(!this.valueSeparator.length){var n=this.guessValueSeparator(t);if(!n.status)return"ERROR! "+n.message;this.column_count=n.column_count,this.valueSeparator=n.separator}var r=t.split("\n");for(var i=0;i<r.length;i++){var s=e.trim(r[i]).split(this.valueSeparator);if(e.trim(r[i]).length&&(s.length==this.column_count||this.valueSeparator.toString()==/\s\s+/.toString()&&(s=e.trim(r[i]).split(/\s+/)).length==this.column_count))if(!this.definition.columns.length)for(var o=0;o<s.length;o++){var u=e.trim(s[o]);u.length?this.definition.columns.push({name:u}):this.definition.columns.push(!1)}else{var a=[];for(var o=0;o<s.length;o++)if(this.definition.columns[o]!==!1){var u=e.trim(s[o]).replace(/'/g,"''");isNaN(u)||this.definition.columns[o].type=="dateType"||this.definition.columns[o].type=="charType"?this.definition.columns[o].type!="charType"&&!isNaN(Date.parse(u))?this.definition.columns[o].type="dateType":this.definition.columns[o].type="charType":this.definition.columns[o].type!="floatType"&&u%1!=0?this.definition.columns[o].type="floatType":this.definition.columns[o].type="intType";if(!this.definition.columns[o].length||u.length>this.definition.columns[o].length)this.definition.columns[o].length=u.length;a.push({v:u})}this.definition.data.push({r:a})}}return this.populateDBTypes(),this.populateWrappers(),this.render()},t.registerHelper("formatted_field",function(e){var r="",i=-1;for(var s=0;s<e.columns.length;s++){e.columns[s]&&i++;if(i==this.index){r=e.columns[s].type;break}}return!this.v.length||this.v.toUpperCase()=="NULL"?"NULL":r=="charType"?new t.SafeString("'"+this.v.replace(/'/g,"''")+"'"):r=="dateType"?new t.SafeString("'"+n(this.v,e.dateFormatMask)+"'"):this.v}),t.registerHelper("column_name_for_index",function(e){return e.columns[this.index].name}),ddl_builder.prototype.render=function(){return this.compiledTemplate(e.extend(this.definition,{separator:this.statement_separator}))},ddl_builder}),function(){function e(){function t(e){window.console&&window.console.log("ID Selector: "+e)}function n(e){var t=e+"=",n=document.cookie.split(";");for(var r=0;r<n.length;r++){var i=n[r];while(i.charAt(0)==" ")i=i.substring(1,i.length);if(i.indexOf(t)==0)return decodeURIComponent(i.substring(t.length,i.length))}return null}function k(e,t){this.grid=e,this.idx=t;var n=this.td=y.createElement("td");o=n.style,o.fontWeight="bold",o.padding="4px",o.verticalAlign="middle",o.cursor="pointer";var r=this;n.onmouseover=function(){r.onMouseOver()},n.onmouseout=function(){r.onMouseOut()},n.onclick=function(){r.onClick()};var i=u[t],s=y.createElement("img");s.src=i?"https://www.idselector.com/static/opicons/"+i.icon:"https://www.idselector.com/images/openid.ico",s.style.width="16px",s.style.height="16px",s.style.verticalAlign="middle",n.appendChild(s),n.appendChild(y.createTextNode(" ")),n.appendChild(y.createTextNode(i?i.shortname:"Other OpenID")),this.selected=!1}function L(){this.table=y.createElement("table"),this.table.style.backgroundColor="#FFF",this.table.style.width="100%",this.table.style.border="1px solid #6e91af",this.tbody=y.createElement("tbody"),this.table.appendChild(this.tbody),this.maxOffset=(Math.ceil(u.length/12)-1)*12,this.cells=[];for(var e=0;e<u.length;e++)this.cells[e]=new k(this,e);this.rows=[y.createElement("tr"),y.createElement("tr"),y.createElement("tr"),y.createElement("tr")],this.otherCell=new k(this,-1);var t=y.createElement("td");t.style.padding="4px",t.style.textAlign="right",t.style.verticalAlign="middle",t.colSpan=2,t.innerHTML='<a href="http://openid.net/" style="color:#6e91af;" target="_blank">Help</a>';var n=y.createElement("tr");n.style.borderTop="1px solid #AAA",n.appendChild(this.otherCell.td),n.appendChild(t);for(var r=0;r<4;r++)this.tbody.appendChild(this.rows[r]);this.tbody.appendChild(n),this.offset=0}function O(){var t=window.ActiveXObject?e?document.body.scrollLeft:document.documentElement.scrollLeft:window.pageXOffset,n=e?document.body.clientWidth:document.documentElement.clientWidth,r=n+t-401,i=f.offsetLeft,s=f.offsetTop;if(f.clientTop)s+=f.clientTop;else if(document.defaultView&&document.defaultView.getComputedStyle){var o=document.defaultView.getComputedStyle(f,"");s+=parseInt(o.getPropertyValue("border-top-width")),s+=parseInt(o.getPropertyValue("border-bottom-width"))}var u=f.offsetParent;while(u){i+=u.offsetLeft,s+=u.offsetTop;if(u.clientLeft)i+=u.clientLeft,s+=u.clientTop;else if(document.defaultView&&document.defaultView.getComputedStyle){var o=document.defaultView.getComputedStyle(u,"");s+=parseInt(o.getPropertyValue("border-top-width")),i+=parseInt(o.getPropertyValue("border-left-width"))}u=u.offsetParent}s+=f.offsetHeight,i=Math.max(Math.min(i,r),0);var a=v.style;a.left=i+"px",a.top=s+"px",a.display="block",a.height=b.offsetHeight+2+"px";var l=document.body.parentNode}function M(){v.style.display="none"}function _(e){if(e.isTextEdit){var t=e.createTextRange();t&&(t.move("character",e.value.length),t.select())}}function D(){f.value=="Click to Sign In"&&(f.value="http://"),_(f),O()}function B(e,t,n){if(n){var r=new Date;r.setTime(r.getTime()+n*24*60*60*1e3);var i="; expires="+r.toGMTString()}else var i="";document.cookie=e+"="+encodeURIComponent(t)+i+"; path=/"}var e=document.compatMode!="CSS1Compat",r=n("__openid_selector_openid"),i=n("__openid_selector_op_id"),s=n("__openid_selector_uname"),o,u=[{shortname:"myOpenID",url_suffix:".myopenid.com/",openid1:!0,openid2:!0,id:8,icon:"myopenid.ico",url_prefix:"http://",website:"https://www.myopenid.com/",longname:"myOpenID",usercalled:"username"},{shortname:"claimID",url_suffix:"",openid1:!0,openid2:!1,id:4,icon:"claimid.ico",url_prefix:"http://claimid.com/",website:"http://claimid.com/",longname:"claimID",usercalled:"username"},{shortname:"Clickpass",url_suffix:"",openid1:!0,openid2:!0,id:5,icon:"clickpass.ico",url_prefix:"http://clickpass.com/public/",website:"http://www.clickpass.com/",longname:"Clickpass",usercalled:"username"},{shortname:"Wordpress",url_suffix:".wordpress.com/",openid1:!0,openid2:!1,id:14,icon:"wordpress.ico",url_prefix:"http://",website:"http://www.wordpress.com/",longname:"Wordpress",usercalled:"username"},{shortname:"Blogger",url_suffix:".blogspot.com/",openid1:!0,openid2:!1,id:2,icon:"blogger.ico",url_prefix:"http://",website:"http://www.blogger.com/",longname:"Google Blogger",usercalled:"blog name"},{shortname:"Livejournal",url_suffix:".livejournal.com/",openid1:!0,openid2:!1,id:7,icon:"lj.ico",url_prefix:"http://",website:"http://www.livejournal.com/",longname:"Livejournal",usercalled:"username"},{shortname:"Technorati",url_suffix:"",openid1:!0,openid2:!1,id:10,icon:"technorati.ico",url_prefix:"http://technorati.com/people/technorati/",website:"http://www.technorati.com/",longname:"Technorati",usercalled:"username"},{shortname:"Flickr",url_suffix:"",openid1:!1,openid2:!0,id:6,icon:"flickr.ico",url_prefix:"http://www.flickr.com/photos/",website:"http://www.flickr.com/",longname:"Flickr",usercalled:"username"},{shortname:"Identity.net",url_suffix:".identity.net/",openid1:!0,openid2:!0,id:23,icon:"identity.ico",url_prefix:"http://",website:"http://identity.net/",longname:"Identity.net",usercalled:"username"},{shortname:"Google",url_suffix:"",openid1:!1,openid2:!0,id:26,icon:"google.ico",url_prefix:"",website:"https://www.google.com/accounts/o8/id",longname:"Google",usercalled:"username"},{shortname:"Yahoo!",url_suffix:"",openid1:!1,openid2:!0,id:15,icon:"yahoo.ico",url_prefix:"http://me.yahoo.com/",website:"http://yahoo.com/",longname:"Yahoo!",usercalled:"yahoo id"},{shortname:"AOL",url_suffix:"",openid1:!0,openid2:!1,id:1,icon:"aol.ico",url_prefix:"http://openid.aol.com/",website:"http://www.aol.com/",longname:"America Online/AIM",usercalled:"screenname"}],a=window.idselector_input_id?window.idselector_input_id:"openid_identifier",f=document.getElementById(a);if(f==null){t("couldn't find openid input box with id = "+a);for(H=0;!f&&H<document.forms.length;H++)f=document.forms[H].openid_identifier;for(H=0;!f&&H<document.forms.length;H++)f=document.forms[H].openid_url}if(f==null){t("couldn't find openid input box");return}var l=f.value,c=document.createElement("img");o=c.style,o.width="16px",o.height="16px",o.verticalAlign="middle",o.padding="0px",o.border="0px",o.margin="0px",o.display="inline";var h=document.createElement("div");h.innerHTML='<button type="button"></button>';var p=document.createElement("img");p.src="https://www.idselector.com/images/arrow.gif",p.style.display="inline";var d=h.firstChild;h.removeChild(d),d.id="__idselector_button",d.style.cursor="pointer",d.appendChild(c),d.appendChild(document.createTextNode(" ")),d.appendChild(p);var v=document.createElement("iframe");v.frameBorder=0,v.scrolling="no",o=v.style,o.display="none",o.position="absolute",o.width="400px",o.height="0px",o.margin="0px",o.padding="0px",o.zIndex=1e4,o.border="0px";var m=f.parentNode,g=null;window.idselector_target_id&&(g=document.getElementById(window.idselector_target_id),g||t("couldn't find element with id "+window.idselector_target_id)),g?g.insertBefore(d,g.firstChild):(m.insertBefore(d,f.nextSibling),m.insertBefore(document.createTextNode(" "),d)),document.body.appendChild(v);var y=v.contentWindow.document;y.open(),y.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><title>ID Selector</title><style type="text/css">html{color:#000;background:#6e91af;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:\'\';}abbr,acronym {border:0;font-variant:normal;}sup {vertical-align:text-top;}sub {vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}body {border:1px solid #6e91af;font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;}</style></head><body></body></html>'),y.close();var b=y.body,w=y.createElement("img");w.style.verticalAlign="middle",w.style.cursor="pointer",w.src="https://www.idselector.com/images/arrow_white_back.png";var E=y.createElement("img");E.style.verticalAlign="middle",E.style.cursor="pointer",E.src="https://www.idselector.com/images/arrow_white_forward.png";var S=y.createElement("div");S.style[document.all?"styleFloat":"cssFloat"]="right",S.innerHTML='<a href="https://www.myopenid.com/signup?affiliate_id=21239" style="color:#fff;" target="_blank">Get an OpenID</a>';var x=y.createElement("div");o=x.style,o.fontWeight="bold",o.color="#fff",o.padding="2px 8px 2px 8px",x.appendChild(S),x.appendChild(y.createTextNode("Sign in with OpenID using"));var T=y.createElement("span");T.appendChild(y.createTextNode("xxx:"));var N=y.createElement("input");N.type="text",N.size=20,o=N.style,o.verticalAlign="middle",o.padding="2px 2px 2px 20px",o.backgroundRepeat="no-repeat",o.backgroundPosition="2px 2px";var C=y.createElement("div");o=C.style,o.color="#fff",o.padding="2px 8px 2px 8px",o.textAlign="right",o.position="relative",C.appendChild(T),C.appendChild(y.createTextNode(" ")),C.appendChild(N),_id=k.prototype={},_id.onMouseOver=function(){this.selected||(this.td.style.backgroundColor="#eee")},_id.onMouseOut=function(){this.selected||(this.td.style.backgroundColor="")},_id.onClick=function(){this.grid.select(this),provider=u[this.idx],this.idx==-1?(f.value="http://",f.focus()):provider.openid2&&!provider.openid1?(f.focus(),setTimeout(M,1)):(N.focus(),N.select())},_id.setSelected=function(e){this.td.style.backgroundColor=e?"#c6d9e8":"",this.selected=e},_id=L.prototype={},_id.forward=function(){this.offset=Math.min(this.offset+12,this.maxOffset),this.gen()},_id.back=function(){this.offset=Math.max(this.offset-12,0),this.gen()},_id.gen=function(){for(var e=0;e<4;e++){var t=this.rows[e];while(t.firstChild)t.removeChild(t.firstChild)}for(var e=0;e<12;e++){var t=this.rows[Math.floor(e/3)],n=this.cells[this.offset+e];n?t.appendChild(n.td):t.appendChild(y.createElement("td"))}E.style.visibility=this.offset==this.maxOffset?"hidden":"",w.style.visibility=this.offset==0?"hidden":"",v.style.height=b.offsetHeight+2+"px"},_id.select=function(e){this.curr&&this.curr.setSelected(!1),this.curr=e,e.setSelected(!0);if(e.idx>-1){var t=u[e.idx];if(t.openid2&&!t.openid1)T.style.visibility="hidden",N.style.visibility="hidden",f.value=t.website;else{T.style.visibility="",N.style.visibility="",T.removeChild(T.firstChild);var n=y.createTextNode(t.longname+" "+t.usercalled+":");T.appendChild(n),N.style.backgroundImage="url(https://www.idselector.com/static/opicons/"+t.icon+")",f.value=t.url_prefix+"username"+t.url_suffix,N.value="username"}c.src="https://www.idselector.com/static/opicons/"+t.icon}else T.style.visibility="hidden",N.style.visibility="hidden",c.src="https://www.idselector.com/images/openid.ico"},_id.setName=function(e){var t=u[this.curr.idx];f.value=t.url_prefix+e+t.url_suffix};var A=new L;A.gen(),b.appendChild(x),b.appendChild(A.table),b.appendChild(C),d.onclick=function(e){return v.style.display=="none"?O():M(),e&&(e.cancelBubble=!0),!1},d.onfocus=function(){d.blur()},E.onclick=function(){A.forward()},w.onclick=function(){A.back()},f.onkeypress=function(e){var t;window.event?t=window.event.keyCode:e.which&&(t=e.which),t!=13&&t!=9&&A.select(A.otherCell)},N.onkeydown=function(e){var t;v.contentWindow.event?t=v.contentWindow.event.keyCode:e.which&&(t=e.which),(t==13||t==9)&&setTimeout(function(){f.onfocus=D,f.focus(),setTimeout(M,1)},1)},N.onkeyup=function(){var e=this.value;e||(e="username",this.value=e,this.select()),A.setName(e)},oldOnResize=window.onresize,window.onresize=function(e){try{v.style.display=="block"&&O()}finally{oldOnResize&&oldOnResize(e)}},oldOnScroll=window.onscroll,window.onscroll=function(e){try{v.style.display=="block"&&O()}finally{oldOnScroll&&oldOnScroll(e)}};if(i){var P=null;for(var H=0;H<u.length;H++)u[H].id==i&&(P=A.cells[H]);P&&(A.select(P),N.value=s)}A.curr||A.select(A.otherCell),r?f.value=r:l.length==0&&(f.value="Click to Sign In"),f.onfocus=D;var j=null;m=f.parentNode;while(m&&m.nodeType==1){if(m.nodeName=="FORM"){j=m;break}m=m.parentNode}if(j){var F=j.onsubmit;j.onsubmit=function(e){try{B("__openid_selector_openid",f.value,365);if(A.curr.idx>-1){var t=u[A.curr.idx].id;B("__openid_selector_op_id",t,365),B("__openid_selector_uname",N.value,365)}else B("__openid_selector_op_id","",-1),B("__openid_selector_uname","",-1)}finally{if(F)return F(e)}}}window.ActiveXObject?document.body.parentNode.attachEvent("onclick",function(){window.event.srcElement!=f&&window.event.srcElement!=d&&M()}):document.body.parentNode.addEventListener("click",function(e){e.target!=f&&e.target!=d&&M()},!1)}var t=window.onload;window.onload=function(n){try{e()}finally{return t&&t(n)}}}(),define("libs/idselector",function(){}),requirejs.config({paths:{jQuery:"libs/jquery/jquery",Underscore:"libs/underscore",Backbone:"libs/backbone",Bootstrap:"libs/bootstrap",Handlebars:"libs/handlebars-1.0.0.beta.6",HandlebarsHelpers:"libs/handlebarsHelpers",DateFormat:"libs/date.format",BrowserEngines:"libs/browserEngines",FiddleEditor:"libs/fiddleEditor",CodeMirror:"libs/codemirror/codemirror",MySQLCodeMirror:"libs/codemirror/mode/mysql/mysql",XPlans:"libs/xplans",DDLBuilder:"libs/ddl_builder"},shim:{Backbone:{deps:["Underscore","jQuery","libs/json2"],exports:"Backbone"},jQuery:{exports:"$"},Underscore:{exports:"_"},CodeMirror:{exports:"CodeMirror"},Handlebars:{exports:"Handlebars"},DateFormat:{exports:"dateFormat"},"XPlans/oracle/loadswf":{deps:["XPlans/oracle/flashver"],exports:"loadswf"},"XPlans/mssql":{exports:"QP"},MySQLCodeMirror:["CodeMirror"],"libs/jquery/jquery.blockUI":["jQuery"],"libs/jquery/jquery.cookie":["jQuery"],"Bootstrap/bootstrap-collapse":["jQuery"],"Bootstrap/bootstrap-tab":["jQuery"],"Bootstrap/bootstrap-dropdown":["jQuery"],"Bootstrap/bootstrap-modal":["jQuery"],"Bootstrap/bootstrap-tooltip":["jQuery"],"Bootstrap/bootstrap-popover":["jQuery","Bootstrap/bootstrap-tooltip"]}}),require(["jQuery","Underscore","dbTypes_cached","fiddle_backbone/app","DDLBuilder/ddl_builder","libs/idselector"],function(e,t,n,r,i){function u(t){e("#exit_fullscreen").css("display")=="none"?(e("body").css("overflow-y","hidden"),e(".navbar-fixed-top").css("position","fixed").css("margin",0),e("#exit_fullscreen").css("display","block"),e("#exit_fullscreen span").text("Exit Fullscreen "+t),e(".nav-collapse, .btn-navbar, #db_type_label_collapsed .navbar-text").css("display","none")):(e("body").css("overflow-y","auto"),e("body").css("height","100%"),e(".navbar-fixed-top").css("position","").css("margin",""),e("#exit_fullscreen").css("display","none"),e(".nav-collapse, .btn-navbar, #db_type_label_collapsed .navbar-text").css("display",""))}function a(){var t=e(window).height()-165;if(t>400){var n=e("#schema-output").width();e("#schema-output").height((t-10)*.7),e("#output").css("min-height",(t-10)*.3+"px"),fiddleBackbone.schemaDefView.editor.isFullscreen()?(e("#fiddleFormDDL .CodeMirror-scroll, #schema_ddl").css("height",e(window).height()+"px"),e("#fiddleFormDDL .CodeMirror-scroll .CodeMirror-gutter").height("height",e(window).height()+"px")):(e("#fiddleFormDDL .CodeMirror-scroll").css("height",e("#fiddleFormDDL").height()-(5+e("#fiddleFormDDL .action_buttons").height())+"px"),e("#schema_ddl").css("height",e("#fiddleFormDDL").height()-(15+e("#fiddleFormDDL .action_buttons").height())+"px"),e("#fiddleFormDDL .CodeMirror-scroll .CodeMirror-gutter").height(e("#fiddleFormDDL .CodeMirror-scroll").height()-2)),fiddleBackbone.queryView.editor.isFullscreen()?(e("#fiddleFormSQL .CodeMirror-scroll, #sql").css("height",e(window).height()+"px"),e("#fiddleFormSQL .CodeMirror-scroll .CodeMirror-gutter").css("height",e(window).height()+"px")):(e("#fiddleFormSQL .CodeMirror-scroll").css("height",e("#fiddleFormSQL").height()-(5+e("#fiddleFormSQL .action_buttons").height())+"px"),e("#sql").css("height",e("#fiddleFormSQL").height()-(15+e("#fiddleFormSQL .action_buttons").height())+"px"),e("#fiddleFormSQL .CodeMirror-scroll .CodeMirror-gutter").height(e("#fiddleFormSQL .CodeMirror-scroll").height()-2)),e("#browser").height(e("#fiddleFormDDL .CodeMirror-scroll").height());var r=function(t){var n={height:e(".blockMsg",t).height(),width:e(".blockMsg",t).width()},r={height:e(t).height(),width:e(t).width()};e(".blockMsg",t).css("top",(r.height-n.height)/2).css("left",(r.width-n.width)/2)};r(e("div.sql.panel")),r(e("#output")),fiddleBackbone.schemaDefView.refresh(),fiddleBackbone.queryView.refresh()}}e.blockUI.defaults.overlayCSS.cursor="auto",e.blockUI.defaults.css.cursor="auto",fiddleBackbone=r.initialize(n),e("#userInfo").on("click","#myFiddles",function(t){t.preventDefault(),e("#myFiddlesModal").modal("show"),e("#myFiddlesModal .modal-body").block({message:"Loading..."});var n=function(){var t=e(this);e(".tab-pane",this).removeClass("active"),e(e("#myFiddlesTabs li.active a").attr("href")).addClass("active"),t.unblock(),e(".preview-schema").popover({placement:"left",title:"Schema Structure",content:function(){return e(this).closest("td").find(".schemaPreviewWrapper").html()}}),e(".preview-ddl").popover({placement:"left",title:"Schema DDL",content:function(){return e(this).closest("td").find(".schemaPreviewWrapper").html()}}),e(".result-sets").popover({placement:"left",title:"Query Results",content:function(){return e(this).closest("td").find(".resultSetWrapper").html()}}),e(".preview-sql").popover({placement:"left",title:"SQL Statements",content:function(){return e(this).closest("td").find(".resultSetWrapper").html()}}),e(".showAll",this).click(function(t){t.preventDefault(),e("tr.for-schema-"+e(this).closest("tr").attr("id")).show("fast"),e(this).hide()}),e(".favorite",this).click(function(t){t.preventDefault();var r=this,i=e(this).closest("tr.queryLog");e.post("index.cfm/UserFiddles/setFavorite",{schema_def_id:e(this).attr("schema_def_id"),query_id:e(this).attr("query_id"),favorite:e(this).attr("href")=="#addFavorite"?1:0},function(){e(r).attr("href")=="#addFavorite"?e(r).attr("href","#removeFavorite").attr("title","Remove from favorites"):e(r).attr("href","#addFavorite").attr("title","Add to favorites"),e("i",r).toggleClass("icon-star-empty icon-star"),e(r).closest(".tab-pane").attr("id")=="favorites"&&e(".queryLog[schema_def_id="+e(r).attr("schema_def_id")+"][query_id="+e(r).attr("query_id")+"] a.favorite").replaceWith(r),e("#favorites").load("index.cfm/UserFiddles/getFavorites",{tz:(new Date).getTimezoneOffset()/60},n)})}),e(".forgetSchema",this).click(function(n){n.preventDefault();var r=e(this).closest("tr.schemaLog").attr("id");e.post("index.cfm/UserFiddles/forgetSchema",{schema_def_id:e(this).attr("schema_def_id")},function(){e("#"+r+",tr.for-schema-"+r,t).remove()})}),e(".forgetQuery",this).click(function(t){t.preventDefault();var n=e(this).closest("tr.queryLog");e.post("index.cfm/UserFiddles/forgetQuery",{schema_def_id:e(this).attr("schema_def_id"),query_id:e(this).attr("query_id")},function(){n.remove()})}),e(".forgetOtherQueries",this).click(function(t){t.preventDefault();var n=e(this).closest("tbody").find('tr.queryLog[schema_def_id="'+e(this).attr("schema_def_id")+'"][query_id!="'+e(this).attr("query_id")+'"]');e.post("index.cfm/UserFiddles/forgetOtherQueries",{schema_def_id:e(this).attr("schema_def_id"),query_id:e(this).attr("query_id")},function(){n.remove()})})};e("#myFiddlesModal .modal-body").load("index.cfm/UserFiddles",{tz:(new Date).getTimezoneOffset()/60},n)}),e("#myFiddlesTabs a").on("click",function(t){t.preventDefault(),e(this).tab("show")}),e("#myFiddlesModal .modal-body").on("click","a",function(t){e(this).hasClass("favorite")||e("#myFiddlesModal").modal("hide")}),e("#myFiddlesModal").on("hidden",function(){e(".popover-anchor",this).popover("hide")});if(e("#user_choices",this).length){var s=[];try{fullHistory=e.parseJSON(localStorage.getItem("fiddleHistory")),fullHistory.length&&(s=t.map(fullHistory,function(e,t){return[e.fragment,dateFormat(e.last_used,"mm/dd/yyyy HH:MM:ss")]}),e.post("index.cfm/UserFiddles/loadFromLocalStorage",{localHistory:JSON.stringify(s)},function(n){var r=e.parseJSON(n);fullHistory=t.reject(fullHistory,function(e){return t.find(r,function(t){return t[0]==e.fragment})}),localStorage.setItem("fiddleHistory",JSON.stringify(fullHistory))}))}catch(o){}}e("#loginModal form").submit(function(){e("#hash",this).val(window.location.hash)}),e("#loginModal").on("hidden",function(){e("iframe").css("display","none")}),e("#userInfo").on("click","#logout",function(t){t.preventDefault(),e("<form>",{action:e(this).attr("href"),method:"GET"}).append(e("<input>",{type:"hidden",name:"hash",value:window.location.hash})).submit()}),e("#textToDDLModal .btn").click(function(t){t.preventDefault();var n=(new i({tableName:e("#tableName").val()})).setupForDBType(fiddleBackbone.dbTypes.getSelectedType().get("simple_name"),fiddleBackbone.schemaDef.get("statement_separator")),r=n.parse(e("#raw").val());e("#parseResults").text(r),e(this).attr("id")=="appendDDL"&&(fiddleBackbone.schemaDef.set("ddl",fiddleBackbone.schemaDef.get("ddl")+"\n\n"+r),fiddleBackbone.schemaDef.trigger("reloaded"),e("#textToDDLModal").modal("hide"))}),e("#exit_fullscreen").on("click",function(e){e.preventDefault(),fiddleBackbone.schemaDefView.editor.setFullscreen(!1),fiddleBackbone.queryView.editor.setFullscreen(!1),u(""),a()}),e("#schemaFullscreen").on("click",function(e){e.preventDefault(),fiddleBackbone.schemaDefView.editor.setFullscreen(!0),u("Schema Editor")}),e("#queryFullscreen").on("click",function(e){e.preventDefault(),fiddleBackbone.queryView.editor.setFullscreen(!0),u("Query Editor")}),e("#schemaBrowser").on("click",function(t){t.preventDefault(),e(this).attr("disabled")||(e("#fiddleFormDDL .CodeMirror, .ddl_actions").css("display","none"),e("#browser, .browser_actions").css("display","block"))}),e("#browser").on("click",".tables a",function(t){t.preventDefault(),e("i",this).toggleClass("icon-minus icon-plus"),e(this).siblings(".columns").toggle()}),e("#ddlEdit").on("click",function(t){t.preventDefault(),e("#fiddleFormDDL .CodeMirror, .ddl_actions").css("display","block"),e("#browser, .browser_actions").css("display","none")}),e(window).bind("resize",a),setTimeout(a,1),e(".nav").on("click","a",function(t){e(".nav-collapse.in").collapse("hide")})}),define("main",function(){})
\ No newline at end of file diff --git a/src/main/webapp/stylesheets_min/_index.css b/src/main/webapp/stylesheets_min/_index.css index aacfd73..4fc9f4b 100644 --- a/src/main/webapp/stylesheets_min/_index.css +++ b/src/main/webapp/stylesheets_min/_index.css @@ -1,4 +1,4 @@ -.CodeMirror {line-height: 1em; font-family: monospace;}.CodeMirror-scroll {overflow: auto; height: 300px; position: relative; outline: none;}.CodeMirror-gutter {position: absolute; left: 0; top: 0; z-index: 10; background-color: #f7f7f7; border-right: 1px solid #eee; min-width: 2em; height: 100%;}.CodeMirror-gutter-text {color: #aaa; text-align: right; padding: .4em .2em .4em .4em; white-space: pre !important;}.CodeMirror-lines {padding: .4em; white-space: pre;}.CodeMirror pre {-moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; border-radius: 0; border-width: 0; margin: 0; padding: 0; background: transparent; font-family: inherit; font-size: inherit; padding: 0; margin: 0; white-space: pre; word-wrap: normal; line-height: inherit;}.CodeMirror-wrap pre {word-wrap: break-word; white-space: pre-wrap; word-break: normal;}.CodeMirror-wrap .CodeMirror-scroll {overflow-x: hidden;}.CodeMirror textarea {outline: none !important;}.CodeMirror pre.CodeMirror-cursor {z-index: 10; position: absolute; visibility: hidden; border-left: 1px solid black; border-right:none; width:0;}.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {}.CodeMirror-focused pre.CodeMirror-cursor {visibility: visible;}div.CodeMirror-selected {background: #d9d9d9;}.CodeMirror-focused div.CodeMirror-selected {background: #d7d4f0;}.CodeMirror-searching {background: #ffa; background: rgba(255, 255, 0, .4);}.cm-s-default span.cm-keyword {color: #708;}.cm-s-default span.cm-atom {color: #219;}.cm-s-default span.cm-number {color: #164;}.cm-s-default span.cm-def {color: #00f;}.cm-s-default span.cm-variable {color: black;}.cm-s-default span.cm-variable-2 {color: #05a;}.cm-s-default span.cm-variable-3 {color: #085;}.cm-s-default span.cm-property {color: black;}.cm-s-default span.cm-operator {color: black;}.cm-s-default span.cm-comment {color: #a50;}.cm-s-default span.cm-string {color: #a11;}.cm-s-default span.cm-string-2 {color: #f50;}.cm-s-default span.cm-meta {color: #555;}.cm-s-default span.cm-error {color: #f00;}.cm-s-default span.cm-qualifier {color: #555;}.cm-s-default span.cm-builtin {color: #30a;}.cm-s-default span.cm-bracket {color: #cc7;}.cm-s-default span.cm-tag {color: #170;}.cm-s-default span.cm-attribute {color: #00c;}.cm-s-default span.cm-header {color: #a0a;}.cm-s-default span.cm-quote {color: #090;}.cm-s-default span.cm-hr {color: #999;}.cm-s-default span.cm-link {color: #00c;}span.cm-header, span.cm-strong {font-weight: bold;}span.cm-em {font-style: italic;}span.cm-emstrong {font-style: italic; font-weight: bold;}span.cm-link {text-decoration: underline;}div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} +.CodeMirror {line-height: 1em; font-family: monospace; position: relative; overflow: hidden;}.CodeMirror-scroll {overflow: auto; height: 300px; position: relative; outline: none;}.CodeMirror-scrollbar {position: absolute; right: 0; top: 0; overflow-x: hidden; overflow-y: scroll; z-index: 5;}.CodeMirror-scrollbar-inner {width: 1px;}.CodeMirror-scrollbar.cm-sb-overlap {position: absolute; z-index: 1; float: none; right: 0; min-width: 12px;}.CodeMirror-scrollbar.cm-sb-nonoverlap {min-width: 12px;}.CodeMirror-scrollbar.cm-sb-ie7 {min-width: 18px;}.CodeMirror-gutter {position: absolute; left: 0; top: 0; z-index: 10; background-color: #f7f7f7; border-right: 1px solid #eee; min-width: 2em; height: 100%;}.CodeMirror-gutter-text {color: #aaa; text-align: right; padding: .4em .2em .4em .4em; white-space: pre !important; cursor: default;}.CodeMirror-lines {padding: .4em; white-space: pre; cursor: text;}.CodeMirror pre {-moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; border-radius: 0; border-width: 0; margin: 0; padding: 0; background: transparent; font-family: inherit; font-size: inherit; padding: 0; margin: 0; white-space: pre; word-wrap: normal; line-height: inherit; color: inherit; overflow: visible;}.CodeMirror-wrap pre {word-wrap: break-word; white-space: pre-wrap; word-break: normal;}.CodeMirror-wrap .CodeMirror-scroll {overflow-x: hidden;}.CodeMirror textarea {outline: none !important;}.CodeMirror pre.CodeMirror-cursor {z-index: 10; position: absolute; visibility: hidden; border-left: 1px solid black; border-right: none; width: 0;}.cm-keymap-fat-cursor pre.CodeMirror-cursor {width: auto; border: 0; background: transparent; background: rgba(0, 200, 0, .4); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);}.cm-keymap-fat-cursor pre.CodeMirror-cursor:not(#nonsense_id) {filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);}.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {}.CodeMirror-focused pre.CodeMirror-cursor {visibility: visible;}div.CodeMirror-selected {background: #d9d9d9;}.CodeMirror-focused div.CodeMirror-selected {background: #d7d4f0;}.CodeMirror-searching {background: #ffa; background: rgba(255, 255, 0, .4);}.cm-s-default span.cm-keyword {color: #708;}.cm-s-default span.cm-atom {color: #219;}.cm-s-default span.cm-number {color: #164;}.cm-s-default span.cm-def {color: #00f;}.cm-s-default span.cm-variable {color: black;}.cm-s-default span.cm-variable-2 {color: #05a;}.cm-s-default span.cm-variable-3 {color: #085;}.cm-s-default span.cm-property {color: black;}.cm-s-default span.cm-operator {color: black;}.cm-s-default span.cm-comment {color: #a50;}.cm-s-default span.cm-string {color: #a11;}.cm-s-default span.cm-string-2 {color: #f50;}.cm-s-default span.cm-meta {color: #555;}.cm-s-default span.cm-error {color: #f00;}.cm-s-default span.cm-qualifier {color: #555;}.cm-s-default span.cm-builtin {color: #30a;}.cm-s-default span.cm-bracket {color: #997;}.cm-s-default span.cm-tag {color: #170;}.cm-s-default span.cm-attribute {color: #00c;}.cm-s-default span.cm-header {color: blue;}.cm-s-default span.cm-quote {color: #090;}.cm-s-default span.cm-hr {color: #999;}.cm-s-default span.cm-link {color: #00c;}span.cm-header, span.cm-strong {font-weight: bold;}span.cm-em {font-style: italic;}span.cm-emstrong {font-style: italic; font-weight: bold;}span.cm-link {text-decoration: underline;}span.cm-invalidchar {color: #f00;}div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}@media print {.CodeMirror pre.CodeMirror-cursor {visibility: hidden;}} /*! * Bootstrap v2.0.4 * * Copyright 2012 Twitter, Inc * Licensed under the Apache License v2.0 * http://www.apache.org/licenses/LICENSE-2.0 * * Designed and built with all the love in the world @twitter by @mdo and @fat. */article,aside,details,figcaption,figure,footer,header,hgroup,nav,section {display: block;}audio,canvas,video {display: inline-block; *display: inline; *zoom: 1;}audio:not([controls]) {display: none;}html {font-size: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%;}a:focus {outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px;}a:hover,a:active {outline: 0;}sub,sup {position: relative; font-size: 75%; line-height: 0; vertical-align: baseline;}sup {top: -0.5em;}sub {bottom: -0.25em;}img {max-width: 100%; vertical-align: middle; border: 0; -ms-interpolation-mode: bicubic;}#map_canvas img {max-width: none;}button,input,select,textarea {margin: 0; font-size: 100%; vertical-align: middle;}button,input {*overflow: visible; line-height: normal;}button::-moz-focus-inner,input::-moz-focus-inner {padding: 0; border: 0;}button,input[type="button"],input[type="reset"],input[type="submit"] {cursor: pointer; -webkit-appearance: button;}input[type="search"] {-webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; -webkit-appearance: textfield;}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button {-webkit-appearance: none;}textarea {overflow: auto; vertical-align: top;}.clearfix {*zoom: 1;}.clearfix:before,.clearfix:after {display: table; content: "";}.clearfix:after {clear: both;}.hide-text {font: 0/0 a; color: transparent; text-shadow: none; background-color: transparent; border: 0;}.input-block-level {display: block; width: 100%; min-height: 28px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box;}body {margin: 0; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18px; color: #333333; background-color: #ffffff;}a {color: #0088cc; text-decoration: none;}a:hover {color: #005580; text-decoration: underline;}.row {margin-left: -20px; *zoom: 1;}.row:before,.row:after {display: table; content: "";}.row:after {clear: both;}[class*="span"] {float: left; margin-left: 20px;}.container,.navbar-fixed-top .container,.navbar-fixed-bottom .container {width: 940px;}.span12 {width: 940px;}.span11 {width: 860px;}.span10 {width: 780px;}.span9 {width: 700px;}.span8 {width: 620px;}.span7 {width: 540px;}.span6 {width: 460px;}.span5 {width: 380px;}.span4 {width: 300px;}.span3 {width: 220px;}.span2 {width: 140px;}.span1 {width: 60px;}.offset12 {margin-left: 980px;}.offset11 {margin-left: 900px;}.offset10 {margin-left: 820px;}.offset9 {margin-left: 740px;}.offset8 {margin-left: 660px;}.offset7 {margin-left: 580px;}.offset6 {margin-left: 500px;}.offset5 {margin-left: 420px;}.offset4 {margin-left: 340px;}.offset3 {margin-left: 260px;}.offset2 {margin-left: 180px;}.offset1 {margin-left: 100px;}.row-fluid {width: 100%; *zoom: 1;}.row-fluid:before,.row-fluid:after {display: table; content: "";}.row-fluid:after {clear: both;}.row-fluid [class*="span"] {display: block; width: 100%; min-height: 28px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; float: left; margin-left: 2.127659574%; *margin-left: 2.0744680846382977%;}.row-fluid [class*="span"]:first-child {margin-left: 0;}.row-fluid .span12 {width: 99.99999998999999%; *width: 99.94680850063828%;}.row-fluid .span11 {width: 91.489361693%; *width: 91.4361702036383%;}.row-fluid .span10 {width: 82.97872339599999%; *width: 82.92553190663828%;}.row-fluid .span9 {width: 74.468085099%; *width: 74.4148936096383%;}.row-fluid .span8 {width: 65.95744680199999%; *width: 65.90425531263828%;}.row-fluid .span7 {width: 57.446808505%; *width: 57.3936170156383%;}.row-fluid .span6 {width: 48.93617020799999%; *width: 48.88297871863829%;}.row-fluid .span5 {width: 40.425531911%; *width: 40.3723404216383%;}.row-fluid .span4 {width: 31.914893614%; *width: 31.8617021246383%;}.row-fluid .span3 {width: 23.404255317%; *width: 23.3510638276383%;}.row-fluid .span2 {width: 14.89361702%; *width: 14.8404255306383%;}.row-fluid .span1 {width: 6.382978723%; *width: 6.329787233638298%;}.container {margin-right: auto; margin-left: auto; *zoom: 1;}.container:before,.container:after {display: table; content: "";}.container:after {clear: both;}.container-fluid {padding-right: 20px; padding-left: 20px; *zoom: 1;}.container-fluid:before,.container-fluid:after {display: table; content: "";}.container-fluid:after {clear: both;}p {margin: 0 0 9px;}p small {font-size: 11px; color: #999999;}.lead {margin-bottom: 18px; font-size: 20px; font-weight: 200; line-height: 27px;}h1,h2,h3,h4,h5,h6 {margin: 0; font-family: inherit; font-weight: bold; color: inherit; text-rendering: optimizelegibility;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small {font-weight: normal; color: #999999;}h1 {font-size: 30px; line-height: 36px;}h1 small {font-size: 18px;}h2 {font-size: 24px; line-height: 36px;}h2 small {font-size: 18px;}h3 {font-size: 18px; line-height: 27px;}h3 small {font-size: 14px;}h4,h5,h6 {line-height: 18px;}h4 {font-size: 14px;}h4 small {font-size: 12px;}h5 {font-size: 12px;}h6 {font-size: 11px; color: #999999; text-transform: uppercase;}.page-header {padding-bottom: 17px; margin: 18px 0; border-bottom: 1px solid #eeeeee;}.page-header h1 {line-height: 1;}ul,ol {padding: 0; margin: 0 0 9px 25px;}ul ul,ul ol,ol ol,ol ul {margin-bottom: 0;}ul {list-style: disc;}ol {list-style: decimal;}li {line-height: 18px;}ul.unstyled,ol.unstyled {margin-left: 0; list-style: none;}dl {margin-bottom: 18px;}dt,dd {line-height: 18px;}dt {font-weight: bold; line-height: 17px;}dd {margin-left: 9px;}.dl-horizontal dt {float: left; width: 120px; clear: left; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}.dl-horizontal dd {margin-left: 130px;}hr {margin: 18px 0; border: 0; border-top: 1px solid #eeeeee; border-bottom: 1px solid #ffffff;}strong {font-weight: bold;}em {font-style: italic;}.muted {color: #999999;}abbr[title] {cursor: help; border-bottom: 1px dotted #999999;}abbr.initialism {font-size: 90%; text-transform: uppercase;}blockquote {padding: 0 0 0 15px; margin: 0 0 18px; border-left: 5px solid #eeeeee;}blockquote p {margin-bottom: 0; font-size: 16px; font-weight: 300; line-height: 22.5px;}blockquote small {display: block; line-height: 18px; color: #999999;}blockquote small:before {content: '\2014 \00A0';}blockquote.pull-right {float: right; padding-right: 15px; padding-left: 0; border-right: 5px solid #eeeeee; border-left: 0;}blockquote.pull-right p,blockquote.pull-right small {text-align: right;}q:before,q:after,blockquote:before,blockquote:after {content: "";}address {display: block; margin-bottom: 18px; font-style: normal; line-height: 18px;}small {font-size: 100%;}cite {font-style: normal;}code,pre {padding: 0 3px 2px; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; color: #333333; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px;}code {padding: 2px 4px; color: #d14; background-color: #f7f7f9; border: 1px solid #e1e1e8;}pre {display: block; padding: 8.5px; margin: 0 0 9px; font-size: 12.025px; line-height: 18px; word-break: break-all; word-wrap: break-word; white-space: pre; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, 0.15); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px;}pre.prettyprint {margin-bottom: 18px;}pre code {padding: 0; color: inherit; background-color: transparent; border: 0;}.pre-scrollable {max-height: 340px; overflow-y: scroll;}form {margin: 0 0 18px;}fieldset {padding: 0; margin: 0; border: 0;}legend {display: block; width: 100%; padding: 0; margin-bottom: 27px; font-size: 19.5px; line-height: 36px; color: #333333; border: 0; border-bottom: 1px solid #e5e5e5;}legend small {font-size: 13.5px; color: #999999;}label,input,button,select,textarea {font-size: 13px; font-weight: normal; line-height: 18px;}input,button,select,textarea {font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;}label {display: block; margin-bottom: 5px;}select,textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input {display: inline-block; height: 18px; padding: 4px; margin-bottom: 9px; font-size: 13px; line-height: 18px; color: #555555;}input,textarea {width: 210px;}textarea {height: auto;}textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input {background-color: #ffffff; border: 1px solid #cccccc; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; -moz-transition: border linear 0.2s, box-shadow linear 0.2s; -ms-transition: border linear 0.2s, box-shadow linear 0.2s; -o-transition: border linear 0.2s, box-shadow linear 0.2s; transition: border linear 0.2s, box-shadow linear 0.2s;}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus,.uneditable-input:focus {border-color: rgba(82, 168, 236, 0.8); outline: 0; outline: thin dotted \9; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);}input[type="radio"],input[type="checkbox"] {margin: 3px 0; *margin-top: 0; line-height: normal; cursor: pointer;}input[type="submit"],input[type="reset"],input[type="button"],input[type="radio"],input[type="checkbox"] {width: auto;}.uneditable-textarea {width: auto; height: auto;}select,input[type="file"] {height: 28px; *margin-top: 4px; line-height: 28px;}select {width: 220px; border: 1px solid #bbb;}select[multiple],select[size] {height: auto;}select:focus,input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus {outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px;}.radio,.checkbox {min-height: 18px; padding-left: 18px;}.radio input[type="radio"],.checkbox input[type="checkbox"] {float: left; margin-left: -18px;}.controls > .radio:first-child,.controls > .checkbox:first-child {padding-top: 5px;}.radio.inline,.checkbox.inline {display: inline-block; padding-top: 5px; margin-bottom: 0; vertical-align: middle;}.radio.inline + .radio.inline,.checkbox.inline + .checkbox.inline {margin-left: 10px;}.input-mini {width: 60px;}.input-small {width: 90px;}.input-medium {width: 150px;}.input-large {width: 210px;}.input-xlarge {width: 270px;}.input-xxlarge {width: 530px;}input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"] {float: none; margin-left: 0;}.input-append input[class*="span"],.input-append .uneditable-input[class*="span"],.input-prepend input[class*="span"],.input-prepend .uneditable-input[class*="span"],.row-fluid .input-prepend [class*="span"],.row-fluid .input-append [class*="span"] {display: inline-block;}input,textarea,.uneditable-input {margin-left: 0;}input.span12, textarea.span12, .uneditable-input.span12 {width: 930px;}input.span11, textarea.span11, .uneditable-input.span11 {width: 850px;}input.span10, textarea.span10, .uneditable-input.span10 {width: 770px;}input.span9, textarea.span9, .uneditable-input.span9 {width: 690px;}input.span8, textarea.span8, .uneditable-input.span8 {width: 610px;}input.span7, textarea.span7, .uneditable-input.span7 {width: 530px;}input.span6, textarea.span6, .uneditable-input.span6 {width: 450px;}input.span5, textarea.span5, .uneditable-input.span5 {width: 370px;}input.span4, textarea.span4, .uneditable-input.span4 {width: 290px;}input.span3, textarea.span3, .uneditable-input.span3 {width: 210px;}input.span2, textarea.span2, .uneditable-input.span2 {width: 130px;}input.span1, textarea.span1, .uneditable-input.span1 {width: 50px;}input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly] {cursor: not-allowed; background-color: #eeeeee; border-color: #ddd;}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"][readonly],input[type="checkbox"][readonly] {background-color: transparent;}.control-group.warning > label,.control-group.warning .help-block,.control-group.warning .help-inline {color: #c09853;}.control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea {color: #c09853; border-color: #c09853;}.control-group.warning .checkbox:focus,.control-group.warning .radio:focus,.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus {border-color: #a47e3c; -webkit-box-shadow: 0 0 6px #dbc59e; -moz-box-shadow: 0 0 6px #dbc59e; box-shadow: 0 0 6px #dbc59e;}.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on {color: #c09853; background-color: #fcf8e3; border-color: #c09853;}.control-group.error > label,.control-group.error .help-block,.control-group.error .help-inline {color: #b94a48;}.control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea {color: #b94a48; border-color: #b94a48;}.control-group.error .checkbox:focus,.control-group.error .radio:focus,.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus {border-color: #953b39; -webkit-box-shadow: 0 0 6px #d59392; -moz-box-shadow: 0 0 6px #d59392; box-shadow: 0 0 6px #d59392;}.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on {color: #b94a48; background-color: #f2dede; border-color: #b94a48;}.control-group.success > label,.control-group.success .help-block,.control-group.success .help-inline {color: #468847;}.control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea {color: #468847; border-color: #468847;}.control-group.success .checkbox:focus,.control-group.success .radio:focus,.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus {border-color: #356635; -webkit-box-shadow: 0 0 6px #7aba7b; -moz-box-shadow: 0 0 6px #7aba7b; box-shadow: 0 0 6px #7aba7b;}.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on {color: #468847; background-color: #dff0d8; border-color: #468847;}input:focus:required:invalid,textarea:focus:required:invalid,select:focus:required:invalid {color: #b94a48; border-color: #ee5f5b;}input:focus:required:invalid:focus,textarea:focus:required:invalid:focus,select:focus:required:invalid:focus {border-color: #e9322d; -webkit-box-shadow: 0 0 6px #f8b9b7; -moz-box-shadow: 0 0 6px #f8b9b7; box-shadow: 0 0 6px #f8b9b7;}.form-actions {padding: 17px 20px 18px; margin-top: 18px; margin-bottom: 18px; background-color: #f5f5f5; border-top: 1px solid #e5e5e5; *zoom: 1;}.form-actions:before,.form-actions:after {display: table; content: "";}.form-actions:after {clear: both;}.uneditable-input {overflow: hidden; white-space: nowrap; cursor: not-allowed; background-color: #ffffff; border-color: #eee; -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);}:-moz-placeholder {color: #999999;}:-ms-input-placeholder {color: #999999;}::-webkit-input-placeholder {color: #999999;}.help-block,.help-inline {color: #555555;}.help-block {display: block; margin-bottom: 9px;}.help-inline {display: inline-block; *display: inline; *zoom: 1; vertical-align: middle; padding-left: 5px;}.input-prepend,.input-append {margin-bottom: 5px;}.input-prepend input,.input-append input,.input-prepend select,.input-append select,.input-prepend .uneditable-input,.input-append .uneditable-input {position: relative; margin-bottom: 0; *margin-left: 0; vertical-align: middle; -webkit-border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0;}.input-prepend input:focus,.input-append input:focus,.input-prepend select:focus,.input-append select:focus,.input-prepend .uneditable-input:focus,.input-append .uneditable-input:focus {z-index: 2;}.input-prepend .uneditable-input,.input-append .uneditable-input {border-left-color: #ccc;}.input-prepend .add-on,.input-append .add-on {display: inline-block; width: auto; height: 18px; min-width: 16px; padding: 4px 5px; font-weight: normal; line-height: 18px; text-align: center; text-shadow: 0 1px 0 #ffffff; vertical-align: middle; background-color: #eeeeee; border: 1px solid #ccc;}.input-prepend .add-on,.input-append .add-on,.input-prepend .btn,.input-append .btn {margin-left: -1px; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0;}.input-prepend .active,.input-append .active {background-color: #a9dba9; border-color: #46a546;}.input-prepend .add-on,.input-prepend .btn {margin-right: -1px;}.input-prepend .add-on:first-child,.input-prepend .btn:first-child {-webkit-border-radius: 3px 0 0 3px; -moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px;}.input-append input,.input-append select,.input-append .uneditable-input {-webkit-border-radius: 3px 0 0 3px; -moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px;}.input-append .uneditable-input {border-right-color: #ccc; border-left-color: #eee;}.input-append .add-on:last-child,.input-append .btn:last-child {-webkit-border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0;}.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input {-webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0;}.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child {margin-right: -1px; -webkit-border-radius: 3px 0 0 3px; -moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px;}.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child {margin-left: -1px; -webkit-border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0;}.search-query {padding-right: 14px; padding-right: 4px \9; padding-left: 14px; padding-left: 4px \9; margin-bottom: 0; -webkit-border-radius: 14px; -moz-border-radius: 14px; border-radius: 14px;}.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append {display: inline-block; *display: inline; *zoom: 1; margin-bottom: 0;}.form-search .hide,.form-inline .hide,.form-horizontal .hide {display: none;}.form-search label,.form-inline label {display: inline-block;}.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend {margin-bottom: 0;}.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox {padding-left: 0; margin-bottom: 0; vertical-align: middle;}.form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"] {float: left; margin-right: 3px; margin-left: 0;}.control-group {margin-bottom: 9px;}legend + .control-group {margin-top: 18px; -webkit-margin-top-collapse: separate;}.form-horizontal .control-group {margin-bottom: 18px; *zoom: 1;}.form-horizontal .control-group:before,.form-horizontal .control-group:after {display: table; content: "";}.form-horizontal .control-group:after {clear: both;}.form-horizontal .control-label {float: left; width: 140px; padding-top: 5px; text-align: right;}.form-horizontal .controls {*display: inline-block; *padding-left: 20px; margin-left: 160px; *margin-left: 0;}.form-horizontal .controls:first-child {*padding-left: 160px;}.form-horizontal .help-block {margin-top: 9px; margin-bottom: 0;}.form-horizontal .form-actions {padding-left: 160px;}table {max-width: 100%; background-color: transparent; border-collapse: collapse; border-spacing: 0;}.table {width: 100%; margin-bottom: 18px;}.table th,.table td {padding: 8px; line-height: 18px; text-align: left; vertical-align: top; border-top: 1px solid #dddddd;}.table th {font-weight: bold;}.table thead th {vertical-align: bottom;}.table caption + thead tr:first-child th,.table caption + thead tr:first-child td,.table colgroup + thead tr:first-child th,.table colgroup + thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td {border-top: 0;}.table tbody + tbody {border-top: 2px solid #dddddd;}.table-condensed th,.table-condensed td {padding: 4px 5px;}.table-bordered {border: 1px solid #dddddd; border-collapse: separate; *border-collapse: collapsed; border-left: 0; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px;}.table-bordered th,.table-bordered td {border-left: 1px solid #dddddd;}.table-bordered caption + thead tr:first-child th,.table-bordered caption + tbody tr:first-child th,.table-bordered caption + tbody tr:first-child td,.table-bordered colgroup + thead tr:first-child th,.table-bordered colgroup + tbody tr:first-child th,.table-bordered colgroup + tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td {border-top: 0;}.table-bordered thead:first-child tr:first-child th:first-child,.table-bordered tbody:first-child tr:first-child td:first-child {-webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topleft: 4px;}.table-bordered thead:first-child tr:first-child th:last-child,.table-bordered tbody:first-child tr:first-child td:last-child {-webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-topright: 4px;}.table-bordered thead:last-child tr:last-child th:first-child,.table-bordered tbody:last-child tr:last-child td:first-child {-webkit-border-radius: 0 0 0 4px; -moz-border-radius: 0 0 0 4px; border-radius: 0 0 0 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px;}.table-bordered thead:last-child tr:last-child th:last-child,.table-bordered tbody:last-child tr:last-child td:last-child {-webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px;}.table-striped tbody tr:nth-child(odd) td,.table-striped tbody tr:nth-child(odd) th {background-color: #f9f9f9;}.table tbody tr:hover td,.table tbody tr:hover th {background-color: #f5f5f5;}table .span1 {float: none; width: 44px; margin-left: 0;}table .span2 {float: none; width: 124px; margin-left: 0;}table .span3 {float: none; width: 204px; margin-left: 0;}table .span4 {float: none; width: 284px; margin-left: 0;}table .span5 {float: none; width: 364px; margin-left: 0;}table .span6 {float: none; width: 444px; margin-left: 0;}table .span7 {float: none; width: 524px; margin-left: 0;}table .span8 {float: none; width: 604px; margin-left: 0;}table .span9 {float: none; width: 684px; margin-left: 0;}table .span10 {float: none; width: 764px; margin-left: 0;}table .span11 {float: none; width: 844px; margin-left: 0;}table .span12 {float: none; width: 924px; margin-left: 0;}table .span13 {float: none; width: 1004px; margin-left: 0;}table .span14 {float: none; width: 1084px; margin-left: 0;}table .span15 {float: none; width: 1164px; margin-left: 0;}table .span16 {float: none; width: 1244px; margin-left: 0;}table .span17 {float: none; width: 1324px; margin-left: 0;}table .span18 {float: none; width: 1404px; margin-left: 0;}table .span19 {float: none; width: 1484px; margin-left: 0;}table .span20 {float: none; width: 1564px; margin-left: 0;}table .span21 {float: none; width: 1644px; margin-left: 0;}table .span22 {float: none; width: 1724px; margin-left: 0;}table .span23 {float: none; width: 1804px; margin-left: 0;}table .span24 {float: none; width: 1884px; margin-left: 0;}[class^="icon-"],[class*=" icon-"] {display: inline-block; width: 14px; height: 14px; *margin-right: .3em; line-height: 14px; vertical-align: text-top; background-image: url("../../images/glyphicons-halflings.png"); background-position: 14px 14px; background-repeat: no-repeat;}[class^="icon-"]:last-child,[class*=" icon-"]:last-child {*margin-left: 0;}.icon-white {background-image: url("../../images/glyphicons-halflings-white.png");}.icon-glass {background-position: 0 0;}.icon-music {background-position: -24px 0;}.icon-search {background-position: -48px 0;}.icon-envelope {background-position: -72px 0;}.icon-heart {background-position: -96px 0;}.icon-star {background-position: -120px 0;}.icon-star-empty {background-position: -144px 0;}.icon-user {background-position: -168px 0;}.icon-film {background-position: -192px 0;}.icon-th-large {background-position: -216px 0;}.icon-th {background-position: -240px 0;}.icon-th-list {background-position: -264px 0;}.icon-ok {background-position: -288px 0;}.icon-remove {background-position: -312px 0;}.icon-zoom-in {background-position: -336px 0;}.icon-zoom-out {background-position: -360px 0;}.icon-off {background-position: -384px 0;}.icon-signal {background-position: -408px 0;}.icon-cog {background-position: -432px 0;}.icon-trash {background-position: -456px 0;}.icon-home {background-position: 0 -24px;}.icon-file {background-position: -24px -24px;}.icon-time {background-position: -48px -24px;}.icon-road {background-position: -72px -24px;}.icon-download-alt {background-position: -96px -24px;}.icon-download {background-position: -120px -24px;}.icon-upload {background-position: -144px -24px;}.icon-inbox {background-position: -168px -24px;}.icon-play-circle {background-position: -192px -24px;}.icon-repeat {background-position: -216px -24px;}.icon-refresh {background-position: -240px -24px;}.icon-list-alt {background-position: -264px -24px;}.icon-lock {background-position: -287px -24px;}.icon-flag {background-position: -312px -24px;}.icon-headphones {background-position: -336px -24px;}.icon-volume-off {background-position: -360px -24px;}.icon-volume-down {background-position: -384px -24px;}.icon-volume-up {background-position: -408px -24px;}.icon-qrcode {background-position: -432px -24px;}.icon-barcode {background-position: -456px -24px;}.icon-tag {background-position: 0 -48px;}.icon-tags {background-position: -25px -48px;}.icon-book {background-position: -48px -48px;}.icon-bookmark {background-position: -72px -48px;}.icon-print {background-position: -96px -48px;}.icon-camera {background-position: -120px -48px;}.icon-font {background-position: -144px -48px;}.icon-bold {background-position: -167px -48px;}.icon-italic {background-position: -192px -48px;}.icon-text-height {background-position: -216px -48px;}.icon-text-width {background-position: -240px -48px;}.icon-align-left {background-position: -264px -48px;}.icon-align-center {background-position: -288px -48px;}.icon-align-right {background-position: -312px -48px;}.icon-align-justify {background-position: -336px -48px;}.icon-list {background-position: -360px -48px;}.icon-indent-left {background-position: -384px -48px;}.icon-indent-right {background-position: -408px -48px;}.icon-facetime-video {background-position: -432px -48px;}.icon-picture {background-position: -456px -48px;}.icon-pencil {background-position: 0 -72px;}.icon-map-marker {background-position: -24px -72px;}.icon-adjust {background-position: -48px -72px;}.icon-tint {background-position: -72px -72px;}.icon-edit {background-position: -96px -72px;}.icon-share {background-position: -120px -72px;}.icon-check {background-position: -144px -72px;}.icon-move {background-position: -168px -72px;}.icon-step-backward {background-position: -192px -72px;}.icon-fast-backward {background-position: -216px -72px;}.icon-backward {background-position: -240px -72px;}.icon-play {background-position: -264px -72px;}.icon-pause {background-position: -288px -72px;}.icon-stop {background-position: -312px -72px;}.icon-forward {background-position: -336px -72px;}.icon-fast-forward {background-position: -360px -72px;}.icon-step-forward {background-position: -384px -72px;}.icon-eject {background-position: -408px -72px;}.icon-chevron-left {background-position: -432px -72px;}.icon-chevron-right {background-position: -456px -72px;}.icon-plus-sign {background-position: 0 -96px;}.icon-minus-sign {background-position: -24px -96px;}.icon-remove-sign {background-position: -48px -96px;}.icon-ok-sign {background-position: -72px -96px;}.icon-question-sign {background-position: -96px -96px;}.icon-info-sign {background-position: -120px -96px;}.icon-screenshot {background-position: -144px -96px;}.icon-remove-circle {background-position: -168px -96px;}.icon-ok-circle {background-position: -192px -96px;}.icon-ban-circle {background-position: -216px -96px;}.icon-arrow-left {background-position: -240px -96px;}.icon-arrow-right {background-position: -264px -96px;}.icon-arrow-up {background-position: -289px -96px;}.icon-arrow-down {background-position: -312px -96px;}.icon-share-alt {background-position: -336px -96px;}.icon-resize-full {background-position: -360px -96px;}.icon-resize-small {background-position: -384px -96px;}.icon-plus {background-position: -408px -96px;}.icon-minus {background-position: -433px -96px;}.icon-asterisk {background-position: -456px -96px;}.icon-exclamation-sign {background-position: 0 -120px;}.icon-gift {background-position: -24px -120px;}.icon-leaf {background-position: -48px -120px;}.icon-fire {background-position: -72px -120px;}.icon-eye-open {background-position: -96px -120px;}.icon-eye-close {background-position: -120px -120px;}.icon-warning-sign {background-position: -144px -120px;}.icon-plane {background-position: -168px -120px;}.icon-calendar {background-position: -192px -120px;}.icon-random {background-position: -216px -120px;}.icon-comment {background-position: -240px -120px;}.icon-magnet {background-position: -264px -120px;}.icon-chevron-up {background-position: -288px -120px;}.icon-chevron-down {background-position: -313px -119px;}.icon-retweet {background-position: -336px -120px;}.icon-shopping-cart {background-position: -360px -120px;}.icon-folder-close {background-position: -384px -120px;}.icon-folder-open {background-position: -408px -120px;}.icon-resize-vertical {background-position: -432px -119px;}.icon-resize-horizontal {background-position: -456px -118px;}.icon-hdd {background-position: 0 -144px;}.icon-bullhorn {background-position: -24px -144px;}.icon-bell {background-position: -48px -144px;}.icon-certificate {background-position: -72px -144px;}.icon-thumbs-up {background-position: -96px -144px;}.icon-thumbs-down {background-position: -120px -144px;}.icon-hand-right {background-position: -144px -144px;}.icon-hand-left {background-position: -168px -144px;}.icon-hand-up {background-position: -192px -144px;}.icon-hand-down {background-position: -216px -144px;}.icon-circle-arrow-right {background-position: -240px -144px;}.icon-circle-arrow-left {background-position: -264px -144px;}.icon-circle-arrow-up {background-position: -288px -144px;}.icon-circle-arrow-down {background-position: -312px -144px;}.icon-globe {background-position: -336px -144px;}.icon-wrench {background-position: -360px -144px;}.icon-tasks {background-position: -384px -144px;}.icon-filter {background-position: -408px -144px;}.icon-briefcase {background-position: -432px -144px;}.icon-fullscreen {background-position: -456px -144px;}.dropup,.dropdown {position: relative;}.dropdown-toggle {*margin-bottom: -3px;}.dropdown-toggle:active,.open .dropdown-toggle {outline: 0;}.caret {display: inline-block; width: 0; height: 0; vertical-align: top; border-top: 4px solid #000000; border-right: 4px solid transparent; border-left: 4px solid transparent; content: ""; opacity: 0.3; filter: alpha(opacity=30);}.dropdown .caret {margin-top: 8px; margin-left: 2px;}.dropdown:hover .caret,.open .caret {opacity: 1; filter: alpha(opacity=100);}.dropdown-menu {position: absolute; top: 100%; left: 0; z-index: 1000; display: none; float: left; min-width: 160px; padding: 4px 0; margin: 1px 0 0; list-style: none; background-color: #ffffff; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, 0.2); *border-right-width: 2px; *border-bottom-width: 2px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); -webkit-background-clip: padding-box; -moz-background-clip: padding; background-clip: padding-box;}.dropdown-menu.pull-right {right: 0; left: auto;}.dropdown-menu .divider {*width: 100%; height: 1px; margin: 8px 1px; *margin: -5px 0 5px; overflow: hidden; background-color: #e5e5e5; border-bottom: 1px solid #ffffff;}.dropdown-menu a {display: block; padding: 3px 15px; clear: both; font-weight: normal; line-height: 18px; color: #333333; white-space: nowrap;}.dropdown-menu li > a:hover,.dropdown-menu .active > a,.dropdown-menu .active > a:hover {color: #ffffff; text-decoration: none; background-color: #0088cc;}.open {*z-index: 1000;}.open > .dropdown-menu {display: block;}.pull-right > .dropdown-menu {right: 0; left: auto;}.dropup .caret,.navbar-fixed-bottom .dropdown .caret {border-top: 0; border-bottom: 4px solid #000000; content: "\2191";}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu {top: auto; bottom: 100%; margin-bottom: 1px;}.typeahead {margin-top: 2px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px;}.well {min-height: 20px; padding: 19px; margin-bottom: 20px; background-color: #f5f5f5; border: 1px solid #eee; border: 1px solid rgba(0, 0, 0, 0.05); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);}.well blockquote {border-color: #ddd; border-color: rgba(0, 0, 0, 0.15);}.well-large {padding: 24px; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px;}.well-small {padding: 9px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px;}.fade {opacity: 0; -webkit-transition: opacity 0.15s linear; -moz-transition: opacity 0.15s linear; -ms-transition: opacity 0.15s linear; -o-transition: opacity 0.15s linear; transition: opacity 0.15s linear;}.fade.in {opacity: 1;}.collapse {position: relative; height: 0; overflow: hidden; -webkit-transition: height 0.35s ease; -moz-transition: height 0.35s ease; -ms-transition: height 0.35s ease; -o-transition: height 0.35s ease; transition: height 0.35s ease;}.collapse.in {height: auto;}.close {float: right; font-size: 20px; font-weight: bold; line-height: 18px; color: #000000; text-shadow: 0 1px 0 #ffffff; opacity: 0.2; filter: alpha(opacity=20);}.close:hover {color: #000000; text-decoration: none; cursor: pointer; opacity: 0.4; filter: alpha(opacity=40);}button.close {padding: 0; cursor: pointer; background: transparent; border: 0; -webkit-appearance: none;}.btn {display: inline-block; *display: inline; *zoom: 1; padding: 4px 10px 4px; margin-bottom: 0; font-size: 13px; line-height: 18px; *line-height: 20px; color: #333333; text-align: center; text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); vertical-align: middle; cursor: pointer; background-color: #f5f5f5; background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); background-image: linear-gradient(top, #ffffff, #e6e6e6); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0); border-color: #e6e6e6 #e6e6e6 #bfbfbf; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #e6e6e6; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); border: 1px solid #cccccc; *border: 0; border-bottom-color: #b3b3b3; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; *margin-left: .3em; -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);}.btn:hover,.btn:active,.btn.active,.btn.disabled,.btn[disabled] {background-color: #e6e6e6; *background-color: #d9d9d9;}.btn:active,.btn.active {background-color: #cccccc \9;}.btn:first-child {*margin-left: 0;}.btn:hover {color: #333333; text-decoration: none; background-color: #e6e6e6; *background-color: #d9d9d9; background-position: 0 -15px; -webkit-transition: background-position 0.1s linear; -moz-transition: background-position 0.1s linear; -ms-transition: background-position 0.1s linear; -o-transition: background-position 0.1s linear; transition: background-position 0.1s linear;}.btn:focus {outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px;}.btn.active,.btn:active {background-color: #e6e6e6; background-color: #d9d9d9 \9; background-image: none; outline: 0; -webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); -moz-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);}.btn.disabled,.btn[disabled] {cursor: default; background-color: #e6e6e6; background-image: none; opacity: 0.65; filter: alpha(opacity=65); -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none;}.btn-large {padding: 9px 14px; font-size: 15px; line-height: normal; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px;}.btn-large [class^="icon-"] {margin-top: 1px;}.btn-small {padding: 5px 9px; font-size: 11px; line-height: 16px;}.btn-small [class^="icon-"] {margin-top: -1px;}.btn-mini {padding: 2px 6px; font-size: 11px; line-height: 14px;}.btn-primary,.btn-primary:hover,.btn-warning,.btn-warning:hover,.btn-danger,.btn-danger:hover,.btn-success,.btn-success:hover,.btn-info,.btn-info:hover,.btn-inverse,.btn-inverse:hover {color: #ffffff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);}.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active {color: rgba(255, 255, 255, 0.75);}.btn {border-color: #ccc; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);}.btn-primary {background-color: #0074cc; background-image: -moz-linear-gradient(top, #0088cc, #0055cc); background-image: -ms-linear-gradient(top, #0088cc, #0055cc); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0055cc)); background-image: -webkit-linear-gradient(top, #0088cc, #0055cc); background-image: -o-linear-gradient(top, #0088cc, #0055cc); background-image: linear-gradient(top, #0088cc, #0055cc); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0055cc', GradientType=0); border-color: #0055cc #0055cc #003580; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #0055cc; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled] {background-color: #0055cc; *background-color: #004ab3;}.btn-primary:active,.btn-primary.active {background-color: #004099 \9;}.btn-warning {background-color: #faa732; background-image: -moz-linear-gradient(top, #fbb450, #f89406); background-image: -ms-linear-gradient(top, #fbb450, #f89406); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); background-image: -webkit-linear-gradient(top, #fbb450, #f89406); background-image: -o-linear-gradient(top, #fbb450, #f89406); background-image: linear-gradient(top, #fbb450, #f89406); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0); border-color: #f89406 #f89406 #ad6704; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #f89406; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled] {background-color: #f89406; *background-color: #df8505;}.btn-warning:active,.btn-warning.active {background-color: #c67605 \9;}.btn-danger {background-color: #da4f49; background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f); background-image: -ms-linear-gradient(top, #ee5f5b, #bd362f); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f)); background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f); background-image: -o-linear-gradient(top, #ee5f5b, #bd362f); background-image: linear-gradient(top, #ee5f5b, #bd362f); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#bd362f', GradientType=0); border-color: #bd362f #bd362f #802420; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #bd362f; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled] {background-color: #bd362f; *background-color: #a9302a;}.btn-danger:active,.btn-danger.active {background-color: #942a25 \9;}.btn-success {background-color: #5bb75b; background-image: -moz-linear-gradient(top, #62c462, #51a351); background-image: -ms-linear-gradient(top, #62c462, #51a351); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351)); background-image: -webkit-linear-gradient(top, #62c462, #51a351); background-image: -o-linear-gradient(top, #62c462, #51a351); background-image: linear-gradient(top, #62c462, #51a351); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#51a351', GradientType=0); border-color: #51a351 #51a351 #387038; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #51a351; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-success:hover,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled] {background-color: #51a351; *background-color: #499249;}.btn-success:active,.btn-success.active {background-color: #408140 \9;}.btn-info {background-color: #49afcd; background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4); background-image: -ms-linear-gradient(top, #5bc0de, #2f96b4); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4)); background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4); background-image: -o-linear-gradient(top, #5bc0de, #2f96b4); background-image: linear-gradient(top, #5bc0de, #2f96b4); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#2f96b4', GradientType=0); border-color: #2f96b4 #2f96b4 #1f6377; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #2f96b4; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-info:hover,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled] {background-color: #2f96b4; *background-color: #2a85a0;}.btn-info:active,.btn-info.active {background-color: #24748c \9;}.btn-inverse {background-color: #414141; background-image: -moz-linear-gradient(top, #555555, #222222); background-image: -ms-linear-gradient(top, #555555, #222222); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#555555), to(#222222)); background-image: -webkit-linear-gradient(top, #555555, #222222); background-image: -o-linear-gradient(top, #555555, #222222); background-image: linear-gradient(top, #555555, #222222); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#555555', endColorstr='#222222', GradientType=0); border-color: #222222 #222222 #000000; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #222222; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-inverse:hover,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled] {background-color: #222222; *background-color: #151515;}.btn-inverse:active,.btn-inverse.active {background-color: #080808 \9;}button.btn,input[type="submit"].btn {*padding-top: 2px; *padding-bottom: 2px;}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner {padding: 0; border: 0;}button.btn.btn-large,input[type="submit"].btn.btn-large {*padding-top: 7px; *padding-bottom: 7px;}button.btn.btn-small,input[type="submit"].btn.btn-small {*padding-top: 3px; *padding-bottom: 3px;}button.btn.btn-mini,input[type="submit"].btn.btn-mini {*padding-top: 1px; *padding-bottom: 1px;}.btn-group {position: relative; *zoom: 1; *margin-left: .3em;}.btn-group:before,.btn-group:after {display: table; content: "";}.btn-group:after {clear: both;}.btn-group:first-child {*margin-left: 0;}.btn-group + .btn-group {margin-left: 5px;}.btn-toolbar {margin-top: 9px; margin-bottom: 9px;}.btn-toolbar .btn-group {display: inline-block; *display: inline; *zoom: 1;}.btn-group > .btn {position: relative; float: left; margin-left: -1px; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0;}.btn-group > .btn:first-child {margin-left: 0; -webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; border-bottom-left-radius: 4px;}.btn-group > .btn:last-child,.btn-group > .dropdown-toggle {-webkit-border-top-right-radius: 4px; -moz-border-radius-topright: 4px; border-top-right-radius: 4px; -webkit-border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; border-bottom-right-radius: 4px;}.btn-group > .btn.large:first-child {margin-left: 0; -webkit-border-top-left-radius: 6px; -moz-border-radius-topleft: 6px; border-top-left-radius: 6px; -webkit-border-bottom-left-radius: 6px; -moz-border-radius-bottomleft: 6px; border-bottom-left-radius: 6px;}.btn-group > .btn.large:last-child,.btn-group > .large.dropdown-toggle {-webkit-border-top-right-radius: 6px; -moz-border-radius-topright: 6px; border-top-right-radius: 6px; -webkit-border-bottom-right-radius: 6px; -moz-border-radius-bottomright: 6px; border-bottom-right-radius: 6px;}.btn-group > .btn:hover,.btn-group > .btn:focus,.btn-group > .btn:active,.btn-group > .btn.active {z-index: 2;}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle {outline: 0;}.btn-group > .dropdown-toggle {padding-left: 8px; padding-right: 8px; -webkit-box-shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); -moz-box-shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); box-shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); *padding-top: 4px; *padding-bottom: 4px;}.btn-group > .btn-mini.dropdown-toggle {padding-left: 5px; padding-right: 5px;}.btn-group > .btn-small.dropdown-toggle {*padding-top: 4px; *padding-bottom: 4px;}.btn-group > .btn-large.dropdown-toggle {padding-left: 12px; padding-right: 12px;}.btn-group.open .dropdown-toggle {background-image: none; -webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); -moz-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);}.btn-group.open .btn.dropdown-toggle {background-color: #e6e6e6;}.btn-group.open .btn-primary.dropdown-toggle {background-color: #0055cc;}.btn-group.open .btn-warning.dropdown-toggle {background-color: #f89406;}.btn-group.open .btn-danger.dropdown-toggle {background-color: #bd362f;}.btn-group.open .btn-success.dropdown-toggle {background-color: #51a351;}.btn-group.open .btn-info.dropdown-toggle {background-color: #2f96b4;}.btn-group.open .btn-inverse.dropdown-toggle {background-color: #222222;}.btn .caret {margin-top: 7px; margin-left: 0;}.btn:hover .caret,.open.btn-group .caret {opacity: 1; filter: alpha(opacity=100);}.btn-mini .caret {margin-top: 5px;}.btn-small .caret {margin-top: 6px;}.btn-large .caret {margin-top: 6px; border-left-width: 5px; border-right-width: 5px; border-top-width: 5px;}.dropup .btn-large .caret {border-bottom: 5px solid #000000; border-top: 0;}.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret {border-top-color: #ffffff; border-bottom-color: #ffffff; opacity: 0.75; filter: alpha(opacity=75);}.alert {padding: 8px 35px 8px 14px; margin-bottom: 18px; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); background-color: #fcf8e3; border: 1px solid #fbeed5; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; color: #c09853;}.alert-heading {color: inherit;}.alert .close {position: relative; top: -2px; right: -21px; line-height: 18px;}.alert-success {background-color: #dff0d8; border-color: #d6e9c6; color: #468847;}.alert-danger,.alert-error {background-color: #f2dede; border-color: #eed3d7; color: #b94a48;}.alert-info {background-color: #d9edf7; border-color: #bce8f1; color: #3a87ad;}.alert-block {padding-top: 14px; padding-bottom: 14px;}.alert-block > p,.alert-block > ul {margin-bottom: 0;}.alert-block p + p {margin-top: 5px;}.nav {margin-left: 0; margin-bottom: 18px; list-style: none;}.nav > li > a {display: block;}.nav > li > a:hover {text-decoration: none; background-color: #eeeeee;}.nav > .pull-right {float: right;}.nav .nav-header {display: block; padding: 3px 15px; font-size: 11px; font-weight: bold; line-height: 18px; color: #999999; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); text-transform: uppercase;}.nav li + .nav-header {margin-top: 9px;}.nav-list {padding-left: 15px; padding-right: 15px; margin-bottom: 0;}.nav-list > li > a,.nav-list .nav-header {margin-left: -15px; margin-right: -15px; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);}.nav-list > li > a {padding: 3px 15px;}.nav-list > .active > a,.nav-list > .active > a:hover {color: #ffffff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); background-color: #0088cc;}.nav-list [class^="icon-"] {margin-right: 2px;}.nav-list .divider {*width: 100%; height: 1px; margin: 8px 1px; *margin: -5px 0 5px; overflow: hidden; background-color: #e5e5e5; border-bottom: 1px solid #ffffff;}.nav-tabs,.nav-pills {*zoom: 1;}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after {display: table; content: "";}.nav-tabs:after,.nav-pills:after {clear: both;}.nav-tabs > li,.nav-pills > li {float: left;}.nav-tabs > li > a,.nav-pills > li > a {padding-right: 12px; padding-left: 12px; margin-right: 2px; line-height: 14px;}.nav-tabs {border-bottom: 1px solid #ddd;}.nav-tabs > li {margin-bottom: -1px;}.nav-tabs > li > a {padding-top: 8px; padding-bottom: 8px; line-height: 18px; border: 1px solid transparent; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0;}.nav-tabs > li > a:hover {border-color: #eeeeee #eeeeee #dddddd;}.nav-tabs > .active > a,.nav-tabs > .active > a:hover {color: #555555; background-color: #ffffff; border: 1px solid #ddd; border-bottom-color: transparent; cursor: default;}.nav-pills > li > a {padding-top: 8px; padding-bottom: 8px; margin-top: 2px; margin-bottom: 2px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px;}.nav-pills > .active > a,.nav-pills > .active > a:hover {color: #ffffff; background-color: #0088cc;}.nav-stacked > li {float: none;}.nav-stacked > li > a {margin-right: 0;}.nav-tabs.nav-stacked {border-bottom: 0;}.nav-tabs.nav-stacked > li > a {border: 1px solid #ddd; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0;}.nav-tabs.nav-stacked > li:first-child > a {-webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0;}.nav-tabs.nav-stacked > li:last-child > a {-webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px;}.nav-tabs.nav-stacked > li > a:hover {border-color: #ddd; z-index: 2;}.nav-pills.nav-stacked > li > a {margin-bottom: 3px;}.nav-pills.nav-stacked > li:last-child > a {margin-bottom: 1px;}.nav-tabs .dropdown-menu {-webkit-border-radius: 0 0 5px 5px; -moz-border-radius: 0 0 5px 5px; border-radius: 0 0 5px 5px;}.nav-pills .dropdown-menu {-webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px;}.nav-tabs .dropdown-toggle .caret,.nav-pills .dropdown-toggle .caret {border-top-color: #0088cc; border-bottom-color: #0088cc; margin-top: 6px;}.nav-tabs .dropdown-toggle:hover .caret,.nav-pills .dropdown-toggle:hover .caret {border-top-color: #005580; border-bottom-color: #005580;}.nav-tabs .active .dropdown-toggle .caret,.nav-pills .active .dropdown-toggle .caret {border-top-color: #333333; border-bottom-color: #333333;}.nav > .dropdown.active > a:hover {color: #000000; cursor: pointer;}.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav > li.dropdown.open.active > a:hover {color: #ffffff; background-color: #999999; border-color: #999999;}.nav li.dropdown.open .caret,.nav li.dropdown.open.active .caret,.nav li.dropdown.open a:hover .caret {border-top-color: #ffffff; border-bottom-color: #ffffff; opacity: 1; filter: alpha(opacity=100);}.tabs-stacked .open > a:hover {border-color: #999999;}.tabbable {*zoom: 1;}.tabbable:before,.tabbable:after {display: table; content: "";}.tabbable:after {clear: both;}.tab-content {overflow: auto;}.tabs-below > .nav-tabs,.tabs-right > .nav-tabs,.tabs-left > .nav-tabs {border-bottom: 0;}.tab-content > .tab-pane,.pill-content > .pill-pane {display: none;}.tab-content > .active,.pill-content > .active {display: block;}.tabs-below > .nav-tabs {border-top: 1px solid #ddd;}.tabs-below > .nav-tabs > li {margin-top: -1px; margin-bottom: 0;}.tabs-below > .nav-tabs > li > a {-webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px;}.tabs-below > .nav-tabs > li > a:hover {border-bottom-color: transparent; border-top-color: #ddd;}.tabs-below > .nav-tabs > .active > a,.tabs-below > .nav-tabs > .active > a:hover {border-color: transparent #ddd #ddd #ddd;}.tabs-left > .nav-tabs > li,.tabs-right > .nav-tabs > li {float: none;}.tabs-left > .nav-tabs > li > a,.tabs-right > .nav-tabs > li > a {min-width: 74px; margin-right: 0; margin-bottom: 3px;}.tabs-left > .nav-tabs {float: left; margin-right: 19px; border-right: 1px solid #ddd;}.tabs-left > .nav-tabs > li > a {margin-right: -1px; -webkit-border-radius: 4px 0 0 4px; -moz-border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px;}.tabs-left > .nav-tabs > li > a:hover {border-color: #eeeeee #dddddd #eeeeee #eeeeee;}.tabs-left > .nav-tabs .active > a,.tabs-left > .nav-tabs .active > a:hover {border-color: #ddd transparent #ddd #ddd; *border-right-color: #ffffff;}.tabs-right > .nav-tabs {float: right; margin-left: 19px; border-left: 1px solid #ddd;}.tabs-right > .nav-tabs > li > a {margin-left: -1px; -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0;}.tabs-right > .nav-tabs > li > a:hover {border-color: #eeeeee #eeeeee #eeeeee #dddddd;}.tabs-right > .nav-tabs .active > a,.tabs-right > .nav-tabs .active > a:hover {border-color: #ddd #ddd #ddd transparent; *border-left-color: #ffffff;}.navbar {*position: relative; *z-index: 2; overflow: visible; margin-bottom: 18px;}.navbar-inner {min-height: 40px; padding-left: 20px; padding-right: 20px; background-color: #2c2c2c; background-image: -moz-linear-gradient(top, #333333, #222222); background-image: -ms-linear-gradient(top, #333333, #222222); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222)); background-image: -webkit-linear-gradient(top, #333333, #222222); background-image: -o-linear-gradient(top, #333333, #222222); background-image: linear-gradient(top, #333333, #222222); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1); -moz-box-shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1); box-shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1);}.navbar .container {width: auto;}.nav-collapse.collapse {height: auto;}.navbar {color: #999999;}.navbar .brand:hover {text-decoration: none;}.navbar .brand {float: left; display: block; padding: 8px 20px 12px; margin-left: -20px; font-size: 20px; font-weight: 200; line-height: 1; color: #999999;}.navbar .navbar-text {margin-bottom: 0; line-height: 40px;}.navbar .navbar-link {color: #999999;}.navbar .navbar-link:hover {color: #ffffff;}.navbar .btn,.navbar .btn-group {margin-top: 5px;}.navbar .btn-group .btn {margin: 0;}.navbar-form {margin-bottom: 0; *zoom: 1;}.navbar-form:before,.navbar-form:after {display: table; content: "";}.navbar-form:after {clear: both;}.navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox {margin-top: 5px;}.navbar-form input,.navbar-form select {display: inline-block; margin-bottom: 0;}.navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"] {margin-top: 3px;}.navbar-form .input-append,.navbar-form .input-prepend {margin-top: 6px; white-space: nowrap;}.navbar-form .input-append input,.navbar-form .input-prepend input {margin-top: 0;}.navbar-search {position: relative; float: left; margin-top: 6px; margin-bottom: 0;}.navbar-search .search-query {padding: 4px 9px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 13px; font-weight: normal; line-height: 1; color: #ffffff; background-color: #626262; border: 1px solid #151515; -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.15); -moz-box-shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.15); box-shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.15); -webkit-transition: none; -moz-transition: none; -ms-transition: none; -o-transition: none; transition: none;}.navbar-search .search-query:-moz-placeholder {color: #cccccc;}.navbar-search .search-query:-ms-input-placeholder {color: #cccccc;}.navbar-search .search-query::-webkit-input-placeholder {color: #cccccc;}.navbar-search .search-query:focus,.navbar-search .search-query.focused {padding: 5px 10px; color: #333333; text-shadow: 0 1px 0 #ffffff; background-color: #ffffff; border: 0; -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); outline: 0;}.navbar-fixed-top,.navbar-fixed-bottom {position: fixed; right: 0; left: 0; z-index: 1030; margin-bottom: 0;}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner {padding-left: 0; padding-right: 0; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0;}.navbar-fixed-top .container,.navbar-fixed-bottom .container {width: 940px;}.navbar-fixed-top {top: 0;}.navbar-fixed-bottom {bottom: 0;}.navbar .nav {position: relative; left: 0; display: block; float: left; margin: 0 10px 0 0;}.navbar .nav.pull-right {float: right;}.navbar .nav > li {display: block; float: left;}.navbar .nav > li > a {float: none; padding: 9px 10px 11px; line-height: 19px; color: #999999; text-decoration: none; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);}.navbar .btn {display: inline-block; padding: 4px 10px 4px; margin: 5px 5px 6px; line-height: 18px;}.navbar .btn-group {margin: 0; padding: 5px 5px 6px;}.navbar .nav > li > a:hover {background-color: transparent; color: #ffffff; text-decoration: none;}.navbar .nav .active > a,.navbar .nav .active > a:hover {color: #ffffff; text-decoration: none; background-color: #222222;}.navbar .divider-vertical {height: 40px; width: 1px; margin: 0 9px; overflow: hidden; background-color: #222222; border-right: 1px solid #333333;}.navbar .nav.pull-right {margin-left: 10px; margin-right: 0;}.navbar .btn-navbar {display: none; float: right; padding: 7px 10px; margin-left: 5px; margin-right: 5px; background-color: #2c2c2c; background-image: -moz-linear-gradient(top, #333333, #222222); background-image: -ms-linear-gradient(top, #333333, #222222); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222)); background-image: -webkit-linear-gradient(top, #333333, #222222); background-image: -o-linear-gradient(top, #333333, #222222); background-image: linear-gradient(top, #333333, #222222); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0); border-color: #222222 #222222 #000000; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #222222; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075); -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075);}.navbar .btn-navbar:hover,.navbar .btn-navbar:active,.navbar .btn-navbar.active,.navbar .btn-navbar.disabled,.navbar .btn-navbar[disabled] {background-color: #222222; *background-color: #151515;}.navbar .btn-navbar:active,.navbar .btn-navbar.active {background-color: #080808 \9;}.navbar .btn-navbar .icon-bar {display: block; width: 18px; height: 2px; background-color: #f5f5f5; -webkit-border-radius: 1px; -moz-border-radius: 1px; border-radius: 1px; -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);}.btn-navbar .icon-bar + .icon-bar {margin-top: 3px;}.navbar .dropdown-menu:before {content: ''; display: inline-block; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 7px solid #ccc; border-bottom-color: rgba(0, 0, 0, 0.2); position: absolute; top: -7px; left: 9px;}.navbar .dropdown-menu:after {content: ''; display: inline-block; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid #ffffff; position: absolute; top: -6px; left: 10px;}.navbar-fixed-bottom .dropdown-menu:before {border-top: 7px solid #ccc; border-top-color: rgba(0, 0, 0, 0.2); border-bottom: 0; bottom: -7px; top: auto;}.navbar-fixed-bottom .dropdown-menu:after {border-top: 6px solid #ffffff; border-bottom: 0; bottom: -6px; top: auto;}.navbar .nav li.dropdown .dropdown-toggle .caret,.navbar .nav li.dropdown.open .caret {border-top-color: #ffffff; border-bottom-color: #ffffff;}.navbar .nav li.dropdown.active .caret {opacity: 1; filter: alpha(opacity=100);}.navbar .nav li.dropdown.open > .dropdown-toggle,.navbar .nav li.dropdown.active > .dropdown-toggle,.navbar .nav li.dropdown.open.active > .dropdown-toggle {background-color: transparent;}.navbar .nav li.dropdown.active > .dropdown-toggle:hover {color: #ffffff;}.navbar .pull-right .dropdown-menu,.navbar .dropdown-menu.pull-right {left: auto; right: 0;}.navbar .pull-right .dropdown-menu:before,.navbar .dropdown-menu.pull-right:before {left: auto; right: 12px;}.navbar .pull-right .dropdown-menu:after,.navbar .dropdown-menu.pull-right:after {left: auto; right: 13px;}.breadcrumb {padding: 7px 14px; margin: 0 0 18px; list-style: none; background-color: #fbfbfb; background-image: -moz-linear-gradient(top, #ffffff, #f5f5f5); background-image: -ms-linear-gradient(top, #ffffff, #f5f5f5); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f5f5f5)); background-image: -webkit-linear-gradient(top, #ffffff, #f5f5f5); background-image: -o-linear-gradient(top, #ffffff, #f5f5f5); background-image: linear-gradient(top, #ffffff, #f5f5f5); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f5f5f5', GradientType=0); border: 1px solid #ddd; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; -webkit-box-shadow: inset 0 1px 0 #ffffff; -moz-box-shadow: inset 0 1px 0 #ffffff; box-shadow: inset 0 1px 0 #ffffff;}.breadcrumb li {display: inline-block; *display: inline; *zoom: 1; text-shadow: 0 1px 0 #ffffff;}.breadcrumb .divider {padding: 0 5px; color: #999999;}.breadcrumb .active a {color: #333333;}.pagination {height: 36px; margin: 18px 0;}.pagination ul {display: inline-block; *display: inline; *zoom: 1; margin-left: 0; margin-bottom: 0; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);}.pagination li {display: inline;}.pagination a {float: left; padding: 0 14px; line-height: 34px; text-decoration: none; border: 1px solid #ddd; border-left-width: 0;}.pagination a:hover,.pagination .active a {background-color: #f5f5f5;}.pagination .active a {color: #999999; cursor: default;}.pagination .disabled span,.pagination .disabled a,.pagination .disabled a:hover {color: #999999; background-color: transparent; cursor: default;}.pagination li:first-child a {border-left-width: 1px; -webkit-border-radius: 3px 0 0 3px; -moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px;}.pagination li:last-child a {-webkit-border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0;}.pagination-centered {text-align: center;}.pagination-right {text-align: right;}.pager {margin-left: 0; margin-bottom: 18px; list-style: none; text-align: center; *zoom: 1;}.pager:before,.pager:after {display: table; content: "";}.pager:after {clear: both;}.pager li {display: inline;}.pager a {display: inline-block; padding: 5px 14px; background-color: #fff; border: 1px solid #ddd; -webkit-border-radius: 15px; -moz-border-radius: 15px; border-radius: 15px;}.pager a:hover {text-decoration: none; background-color: #f5f5f5;}.pager .next a {float: right;}.pager .previous a {float: left;}.pager .disabled a,.pager .disabled a:hover {color: #999999; background-color: #fff; cursor: default;}.modal-open .dropdown-menu {z-index: 2050;}.modal-open .dropdown.open {*z-index: 2050;}.modal-open .popover {z-index: 2060;}.modal-open .tooltip {z-index: 2070;}.modal-backdrop {position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1040; background-color: #000000;}.modal-backdrop.fade {opacity: 0;}.modal-backdrop,.modal-backdrop.fade.in {opacity: 0.8; filter: alpha(opacity=80);}.modal {position: fixed; top: 50%; left: 50%; z-index: 1050; overflow: auto; width: 560px; margin: -250px 0 0 -280px; background-color: #ffffff; border: 1px solid #999; border: 1px solid rgba(0, 0, 0, 0.3); *border: 1px solid #999; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); -webkit-background-clip: padding-box; -moz-background-clip: padding-box; background-clip: padding-box;}.modal.fade {-webkit-transition: opacity .3s linear, top .3s ease-out; -moz-transition: opacity .3s linear, top .3s ease-out; -ms-transition: opacity .3s linear, top .3s ease-out; -o-transition: opacity .3s linear, top .3s ease-out; transition: opacity .3s linear, top .3s ease-out; top: -25%;}.modal.fade.in {top: 50%;}.modal-header {padding: 9px 15px; border-bottom: 1px solid #eee;}.modal-header .close {margin-top: 2px;}.modal-body {overflow-y: auto; max-height: 400px; padding: 15px;}.modal-form {margin-bottom: 0;}.modal-footer {padding: 14px 15px 15px; margin-bottom: 0; text-align: right; background-color: #f5f5f5; border-top: 1px solid #ddd; -webkit-border-radius: 0 0 6px 6px; -moz-border-radius: 0 0 6px 6px; border-radius: 0 0 6px 6px; -webkit-box-shadow: inset 0 1px 0 #ffffff; -moz-box-shadow: inset 0 1px 0 #ffffff; box-shadow: inset 0 1px 0 #ffffff; *zoom: 1;}.modal-footer:before,.modal-footer:after {display: table; content: "";}.modal-footer:after {clear: both;}.modal-footer .btn + .btn {margin-left: 5px; margin-bottom: 0;}.modal-footer .btn-group .btn + .btn {margin-left: -1px;}.tooltip {position: absolute; z-index: 1020; display: block; visibility: visible; padding: 5px; font-size: 11px; opacity: 0; filter: alpha(opacity=0);}.tooltip.in {opacity: 0.8; filter: alpha(opacity=80);}.tooltip.top {margin-top: -2px;}.tooltip.right {margin-left: 2px;}.tooltip.bottom {margin-top: 2px;}.tooltip.left {margin-left: -2px;}.tooltip.top .tooltip-arrow {bottom: 0; left: 50%; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid #000000;}.tooltip.left .tooltip-arrow {top: 50%; right: 0; margin-top: -5px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 5px solid #000000;}.tooltip.bottom .tooltip-arrow {top: 0; left: 50%; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 5px solid #000000;}.tooltip.right .tooltip-arrow {top: 50%; left: 0; margin-top: -5px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-right: 5px solid #000000;}.tooltip-inner {max-width: 200px; padding: 3px 8px; color: #ffffff; text-align: center; text-decoration: none; background-color: #000000; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px;}.tooltip-arrow {position: absolute; width: 0; height: 0;}.popover {position: absolute; top: 0; left: 0; z-index: 1010; display: none; padding: 5px;}.popover.top {margin-top: -5px;}.popover.right {margin-left: 5px;}.popover.bottom {margin-top: 5px;}.popover.left {margin-left: -5px;}.popover.top .arrow {bottom: 0; left: 50%; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid #000000;}.popover.right .arrow {top: 50%; left: 0; margin-top: -5px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-right: 5px solid #000000;}.popover.bottom .arrow {top: 0; left: 50%; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 5px solid #000000;}.popover.left .arrow {top: 50%; right: 0; margin-top: -5px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 5px solid #000000;}.popover .arrow {position: absolute; width: 0; height: 0;}.popover-inner {padding: 3px; width: 280px; overflow: hidden; background: #000000; background: rgba(0, 0, 0, 0.8); -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);}.popover-title {padding: 9px 15px; line-height: 1; background-color: #f5f5f5; border-bottom: 1px solid #eee; -webkit-border-radius: 3px 3px 0 0; -moz-border-radius: 3px 3px 0 0; border-radius: 3px 3px 0 0;}.popover-content {padding: 14px; background-color: #ffffff; -webkit-border-radius: 0 0 3px 3px; -moz-border-radius: 0 0 3px 3px; border-radius: 0 0 3px 3px; -webkit-background-clip: padding-box; -moz-background-clip: padding-box; background-clip: padding-box;}.popover-content p,.popover-content ul,.popover-content ol {margin-bottom: 0;}.thumbnails {margin-left: -20px; list-style: none; *zoom: 1;}.thumbnails:before,.thumbnails:after {display: table; content: "";}.thumbnails:after {clear: both;}.row-fluid .thumbnails {margin-left: 0;}.thumbnails > li {float: left; margin-bottom: 18px; margin-left: 20px;}.thumbnail {display: block; padding: 4px; line-height: 1; border: 1px solid #ddd; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075); -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075);}a.thumbnail:hover {border-color: #0088cc; -webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); -moz-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);}.thumbnail > img {display: block; max-width: 100%; margin-left: auto; margin-right: auto;}.thumbnail .caption {padding: 9px;}.label,.badge {font-size: 10.998px; font-weight: bold; line-height: 14px; color: #ffffff; vertical-align: baseline; white-space: nowrap; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #999999;}.label {padding: 1px 4px 2px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px;}.badge {padding: 1px 9px 2px; -webkit-border-radius: 9px; -moz-border-radius: 9px; border-radius: 9px;}a.label:hover,a.badge:hover {color: #ffffff; text-decoration: none; cursor: pointer;}.label-important,.badge-important {background-color: #b94a48;}.label-important[href],.badge-important[href] {background-color: #953b39;}.label-warning,.badge-warning {background-color: #f89406;}.label-warning[href],.badge-warning[href] {background-color: #c67605;}.label-success,.badge-success {background-color: #468847;}.label-success[href],.badge-success[href] {background-color: #356635;}.label-info,.badge-info {background-color: #3a87ad;}.label-info[href],.badge-info[href] {background-color: #2d6987;}.label-inverse,.badge-inverse {background-color: #333333;}.label-inverse[href],.badge-inverse[href] {background-color: #1a1a1a;}@-webkit-keyframes progress-bar-stripes {from {background-position: 40px 0;} to {background-position: 0 0;}}@-moz-keyframes progress-bar-stripes {from {background-position: 40px 0;} to {background-position: 0 0;}}@-ms-keyframes progress-bar-stripes {from {background-position: 40px 0;} to {background-position: 0 0;}}@-o-keyframes progress-bar-stripes {from {background-position: 0 0;} to {background-position: 40px 0;}}@keyframes progress-bar-stripes {from {background-position: 40px 0;} to {background-position: 0 0;}}.progress {overflow: hidden; height: 18px; margin-bottom: 18px; background-color: #f7f7f7; background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9); background-image: -ms-linear-gradient(top, #f5f5f5, #f9f9f9); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9)); background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9); background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9); background-image: linear-gradient(top, #f5f5f5, #f9f9f9); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f5f5f5', endColorstr='#f9f9f9', GradientType=0); -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px;}.progress .bar {width: 0%; height: 18px; color: #ffffff; font-size: 12px; text-align: center; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #0e90d2; background-image: -moz-linear-gradient(top, #149bdf, #0480be); background-image: -ms-linear-gradient(top, #149bdf, #0480be); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be)); background-image: -webkit-linear-gradient(top, #149bdf, #0480be); background-image: -o-linear-gradient(top, #149bdf, #0480be); background-image: linear-gradient(top, #149bdf, #0480be); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#149bdf', endColorstr='#0480be', GradientType=0); -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; -webkit-transition: width 0.6s ease; -moz-transition: width 0.6s ease; -ms-transition: width 0.6s ease; -o-transition: width 0.6s ease; transition: width 0.6s ease;}.progress-striped .bar {background-color: #149bdf; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); -webkit-background-size: 40px 40px; -moz-background-size: 40px 40px; -o-background-size: 40px 40px; background-size: 40px 40px;}.progress.active .bar {-webkit-animation: progress-bar-stripes 2s linear infinite; -moz-animation: progress-bar-stripes 2s linear infinite; -ms-animation: progress-bar-stripes 2s linear infinite; -o-animation: progress-bar-stripes 2s linear infinite; animation: progress-bar-stripes 2s linear infinite;}.progress-danger .bar {background-color: #dd514c; background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35); background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35)); background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35); background-image: -o-linear-gradient(top, #ee5f5b, #c43c35); background-image: linear-gradient(top, #ee5f5b, #c43c35); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0);}.progress-danger.progress-striped .bar {background-color: #ee5f5b; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);}.progress-success .bar {background-color: #5eb95e; background-image: -moz-linear-gradient(top, #62c462, #57a957); background-image: -ms-linear-gradient(top, #62c462, #57a957); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957)); background-image: -webkit-linear-gradient(top, #62c462, #57a957); background-image: -o-linear-gradient(top, #62c462, #57a957); background-image: linear-gradient(top, #62c462, #57a957); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0);}.progress-success.progress-striped .bar {background-color: #62c462; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);}.progress-info .bar {background-color: #4bb1cf; background-image: -moz-linear-gradient(top, #5bc0de, #339bb9); background-image: -ms-linear-gradient(top, #5bc0de, #339bb9); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9)); background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9); background-image: -o-linear-gradient(top, #5bc0de, #339bb9); background-image: linear-gradient(top, #5bc0de, #339bb9); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0);}.progress-info.progress-striped .bar {background-color: #5bc0de; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);}.progress-warning .bar {background-color: #faa732; background-image: -moz-linear-gradient(top, #fbb450, #f89406); background-image: -ms-linear-gradient(top, #fbb450, #f89406); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); background-image: -webkit-linear-gradient(top, #fbb450, #f89406); background-image: -o-linear-gradient(top, #fbb450, #f89406); background-image: linear-gradient(top, #fbb450, #f89406); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0);}.progress-warning.progress-striped .bar {background-color: #fbb450; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);}.accordion {margin-bottom: 18px;}.accordion-group {margin-bottom: 2px; border: 1px solid #e5e5e5; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px;}.accordion-heading {border-bottom: 0;}.accordion-heading .accordion-toggle {display: block; padding: 8px 15px;}.accordion-toggle {cursor: pointer;}.accordion-inner {padding: 9px 15px; border-top: 1px solid #e5e5e5;}.carousel {position: relative; margin-bottom: 18px; line-height: 1;}.carousel-inner {overflow: hidden; width: 100%; position: relative;}.carousel .item {display: none; position: relative; -webkit-transition: 0.6s ease-in-out left; -moz-transition: 0.6s ease-in-out left; -ms-transition: 0.6s ease-in-out left; -o-transition: 0.6s ease-in-out left; transition: 0.6s ease-in-out left;}.carousel .item > img {display: block; line-height: 1;}.carousel .active,.carousel .next,.carousel .prev {display: block;}.carousel .active {left: 0;}.carousel .next,.carousel .prev {position: absolute; top: 0; width: 100%;}.carousel .next {left: 100%;}.carousel .prev {left: -100%;}.carousel .next.left,.carousel .prev.right {left: 0;}.carousel .active.left {left: -100%;}.carousel .active.right {left: 100%;}.carousel-control {position: absolute; top: 40%; left: 15px; width: 40px; height: 40px; margin-top: -20px; font-size: 60px; font-weight: 100; line-height: 30px; color: #ffffff; text-align: center; background: #222222; border: 3px solid #ffffff; -webkit-border-radius: 23px; -moz-border-radius: 23px; border-radius: 23px; opacity: 0.5; filter: alpha(opacity=50);}.carousel-control.right {left: auto; right: 15px;}.carousel-control:hover {color: #ffffff; text-decoration: none; opacity: 0.9; filter: alpha(opacity=90);}.carousel-caption {position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 15px 5px; background: #333333; background: rgba(0, 0, 0, 0.75);}.carousel-caption h4,.carousel-caption p {color: #ffffff;}.hero-unit {padding: 60px; margin-bottom: 30px; background-color: #eeeeee; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px;}.hero-unit h1 {margin-bottom: 0; font-size: 60px; line-height: 1; color: inherit; letter-spacing: -1px;}.hero-unit p {font-size: 18px; font-weight: 200; line-height: 27px; color: inherit;}.pull-right {float: right;}.pull-left {float: left;}.hide {display: none;}.show {display: block;}.invisible {visibility: hidden;} /*! * Bootstrap Responsive v2.0.4 * * Copyright 2012 Twitter, Inc * Licensed under the Apache License v2.0 * http://www.apache.org/licenses/LICENSE-2.0 * * Designed and built with all the love in the world @twitter by @mdo and @fat. */.clearfix {*zoom: 1;}.clearfix:before,.clearfix:after {display: table; content: "";}.clearfix:after {clear: both;}.hide-text {font: 0/0 a; color: transparent; text-shadow: none; background-color: transparent; border: 0;}.input-block-level {display: block; width: 100%; min-height: 28px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box;}.hidden {display: none; visibility: hidden;}.visible-phone {display: none !important;}.visible-tablet {display: none !important;}.hidden-desktop {display: none !important;}@media (max-width: 767px) {.visible-phone {display: inherit !important;} .hidden-phone {display: none !important;} .hidden-desktop {display: inherit !important;} .visible-desktop {display: none !important;}}@media (min-width: 768px) and (max-width: 979px) {.visible-tablet {display: inherit !important;} .hidden-tablet {display: none !important;} .hidden-desktop {display: inherit !important;} .visible-desktop {display: none !important ;}}@media (max-width: 480px) {.nav-collapse {-webkit-transform: translate3d(0, 0, 0);} .page-header h1 small {display: block; line-height: 18px;} input[type="checkbox"], input[type="radio"] {border: 1px solid #ccc;} .form-horizontal .control-group > label {float: none; width: auto; padding-top: 0; text-align: left;} .form-horizontal .controls {margin-left: 0;} .form-horizontal .control-list {padding-top: 0;} .form-horizontal .form-actions {padding-left: 10px; padding-right: 10px;} .modal {position: absolute; top: 10px; left: 10px; right: 10px; width: auto; margin: 0;} .modal.fade.in {top: auto;} .modal-header .close {padding: 10px; margin: -10px;} .carousel-caption {position: static;}}@media (max-width: 767px) {body {padding-left: 20px; padding-right: 20px;} .navbar-fixed-top, .navbar-fixed-bottom {margin-left: -20px; margin-right: -20px;} .container-fluid {padding: 0;} .dl-horizontal dt {float: none; clear: none; width: auto; text-align: left;} .dl-horizontal dd {margin-left: 0;} .container {width: auto;} .row-fluid {width: 100%;} .row, .thumbnails {margin-left: 0;} [class*="span"], .row-fluid [class*="span"] {float: none; display: block; width: auto; margin-left: 0;} .input-large, .input-xlarge, .input-xxlarge, input[class*="span"], select[class*="span"], textarea[class*="span"], .uneditable-input {display: block; width: 100%; min-height: 28px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box;} .input-prepend input, .input-append input, .input-prepend input[class*="span"], .input-append input[class*="span"] {display: inline-block; width: auto;}}@media (min-width: 768px) and (max-width: 979px) {.row {margin-left: -20px; *zoom: 1;} .row:before, .row:after {display: table; content: "";} .row:after {clear: both;} [class*="span"] {float: left; margin-left: 20px;} .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container {width: 724px;} .span12 {width: 724px;} .span11 {width: 662px;} .span10 {width: 600px;} .span9 {width: 538px;} .span8 {width: 476px;} .span7 {width: 414px;} .span6 {width: 352px;} .span5 {width: 290px;} .span4 {width: 228px;} .span3 {width: 166px;} .span2 {width: 104px;} .span1 {width: 42px;} .offset12 {margin-left: 764px;} .offset11 {margin-left: 702px;} .offset10 {margin-left: 640px;} .offset9 {margin-left: 578px;} .offset8 {margin-left: 516px;} .offset7 {margin-left: 454px;} .offset6 {margin-left: 392px;} .offset5 {margin-left: 330px;} .offset4 {margin-left: 268px;} .offset3 {margin-left: 206px;} .offset2 {margin-left: 144px;} .offset1 {margin-left: 82px;} .row-fluid {width: 100%; *zoom: 1;} .row-fluid:before, .row-fluid:after {display: table; content: "";} .row-fluid:after {clear: both;} .row-fluid [class*="span"] {display: block; width: 100%; min-height: 28px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; float: left; margin-left: 2.762430939%; *margin-left: 2.709239449638298%;} .row-fluid [class*="span"]:first-child {margin-left: 0;} .row-fluid .span12 {width: 99.999999993%; *width: 99.9468085036383%;} .row-fluid .span11 {width: 91.436464082%; *width: 91.38327259263829%;} .row-fluid .span10 {width: 82.87292817100001%; *width: 82.8197366816383%;} .row-fluid .span9 {width: 74.30939226%; *width: 74.25620077063829%;} .row-fluid .span8 {width: 65.74585634900001%; *width: 65.6926648596383%;} .row-fluid .span7 {width: 57.182320438000005%; *width: 57.129128948638304%;} .row-fluid .span6 {width: 48.618784527%; *width: 48.5655930376383%;} .row-fluid .span5 {width: 40.055248616%; *width: 40.0020571266383%;} .row-fluid .span4 {width: 31.491712705%; *width: 31.4385212156383%;} .row-fluid .span3 {width: 22.928176794%; *width: 22.874985304638297%;} .row-fluid .span2 {width: 14.364640883%; *width: 14.311449393638298%;} .row-fluid .span1 {width: 5.801104972%; *width: 5.747913482638298%;} input, textarea, .uneditable-input {margin-left: 0;} input.span12, textarea.span12, .uneditable-input.span12 {width: 714px;} input.span11, textarea.span11, .uneditable-input.span11 {width: 652px;} input.span10, textarea.span10, .uneditable-input.span10 {width: 590px;} input.span9, textarea.span9, .uneditable-input.span9 {width: 528px;} input.span8, textarea.span8, .uneditable-input.span8 {width: 466px;} input.span7, textarea.span7, .uneditable-input.span7 {width: 404px;} input.span6, textarea.span6, .uneditable-input.span6 {width: 342px;} input.span5, textarea.span5, .uneditable-input.span5 {width: 280px;} input.span4, textarea.span4, .uneditable-input.span4 {width: 218px;} input.span3, textarea.span3, .uneditable-input.span3 {width: 156px;} input.span2, textarea.span2, .uneditable-input.span2 {width: 94px;} input.span1, textarea.span1, .uneditable-input.span1 {width: 32px;}}@media (min-width: 1200px) {.row {margin-left: -30px; *zoom: 1;} .row:before, .row:after {display: table; content: "";} .row:after {clear: both;} [class*="span"] {float: left; margin-left: 30px;} .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container {width: 1170px;} .span12 {width: 1170px;} .span11 {width: 1070px;} .span10 {width: 970px;} .span9 {width: 870px;} .span8 {width: 770px;} .span7 {width: 670px;} .span6 {width: 570px;} .span5 {width: 470px;} .span4 {width: 370px;} .span3 {width: 270px;} .span2 {width: 170px;} .span1 {width: 70px;} .offset12 {margin-left: 1230px;} .offset11 {margin-left: 1130px;} .offset10 {margin-left: 1030px;} .offset9 {margin-left: 930px;} .offset8 {margin-left: 830px;} .offset7 {margin-left: 730px;} .offset6 {margin-left: 630px;} .offset5 {margin-left: 530px;} .offset4 {margin-left: 430px;} .offset3 {margin-left: 330px;} .offset2 {margin-left: 230px;} .offset1 {margin-left: 130px;} .row-fluid {width: 100%; *zoom: 1;} .row-fluid:before, .row-fluid:after {display: table; content: "";} .row-fluid:after {clear: both;} .row-fluid [class*="span"] {display: block; width: 100%; min-height: 28px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; float: left; margin-left: 2.564102564%; *margin-left: 2.510911074638298%;} .row-fluid [class*="span"]:first-child {margin-left: 0;} .row-fluid .span12 {width: 100%; *width: 99.94680851063829%;} .row-fluid .span11 {width: 91.45299145300001%; *width: 91.3997999636383%;} .row-fluid .span10 {width: 82.905982906%; *width: 82.8527914166383%;} .row-fluid .span9 {width: 74.358974359%; *width: 74.30578286963829%;} .row-fluid .span8 {width: 65.81196581200001%; *width: 65.7587743226383%;} .row-fluid .span7 {width: 57.264957265%; *width: 57.2117657756383%;} .row-fluid .span6 {width: 48.717948718%; *width: 48.6647572286383%;} .row-fluid .span5 {width: 40.170940171000005%; *width: 40.117748681638304%;} .row-fluid .span4 {width: 31.623931624%; *width: 31.5707401346383%;} .row-fluid .span3 {width: 23.076923077%; *width: 23.0237315876383%;} .row-fluid .span2 {width: 14.529914530000001%; *width: 14.4767230406383%;} .row-fluid .span1 {width: 5.982905983%; *width: 5.929714493638298%;} input, textarea, .uneditable-input {margin-left: 0;} input.span12, textarea.span12, .uneditable-input.span12 {width: 1160px;} input.span11, textarea.span11, .uneditable-input.span11 {width: 1060px;} input.span10, textarea.span10, .uneditable-input.span10 {width: 960px;} input.span9, textarea.span9, .uneditable-input.span9 {width: 860px;} input.span8, textarea.span8, .uneditable-input.span8 {width: 760px;} input.span7, textarea.span7, .uneditable-input.span7 {width: 660px;} input.span6, textarea.span6, .uneditable-input.span6 {width: 560px;} input.span5, textarea.span5, .uneditable-input.span5 {width: 460px;} input.span4, textarea.span4, .uneditable-input.span4 {width: 360px;} input.span3, textarea.span3, .uneditable-input.span3 {width: 260px;} input.span2, textarea.span2, .uneditable-input.span2 {width: 160px;} input.span1, textarea.span1, .uneditable-input.span1 {width: 60px;} .thumbnails {margin-left: -30px;} .thumbnails > li {margin-left: 30px;} .row-fluid .thumbnails {margin-left: 0;}}@media (max-width: 979px) {body {padding-top: 0;} .navbar-fixed-top, .navbar-fixed-bottom {position: static;} .navbar-fixed-top {margin-bottom: 18px;} .navbar-fixed-bottom {margin-top: 18px;} .navbar-fixed-top .navbar-inner, .navbar-fixed-bottom .navbar-inner {padding: 5px;} .navbar .container {width: auto; padding: 0;} .navbar .brand {padding-left: 10px; padding-right: 10px; margin: 0 0 0 -5px;} .nav-collapse {clear: both;} .nav-collapse .nav {float: none; margin: 0 0 9px;} .nav-collapse .nav > li {float: none;} .nav-collapse .nav > li > a {margin-bottom: 2px;} .nav-collapse .nav > .divider-vertical {display: none;} .nav-collapse .nav .nav-header {color: #999999; text-shadow: none;} .nav-collapse .nav > li > a, .nav-collapse .dropdown-menu a {padding: 6px 15px; font-weight: bold; color: #999999; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px;} .nav-collapse .btn {padding: 4px 10px 4px; font-weight: normal; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px;} .nav-collapse .dropdown-menu li + li a {margin-bottom: 2px;} .nav-collapse .nav > li > a:hover, .nav-collapse .dropdown-menu a:hover {background-color: #222222;} .nav-collapse.in .btn-group {margin-top: 5px; padding: 0;} .nav-collapse .dropdown-menu {position: static; top: auto; left: auto; float: none; display: block; max-width: none; margin: 0 15px; padding: 0; background-color: transparent; border: none; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none;} .nav-collapse .dropdown-menu:before, .nav-collapse .dropdown-menu:after {display: none;} .nav-collapse .dropdown-menu .divider {display: none;} .nav-collapse .navbar-form, .nav-collapse .navbar-search {float: none; padding: 9px 15px; margin: 9px 0; border-top: 1px solid #222222; border-bottom: 1px solid #222222; -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1); -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1);} .navbar .nav-collapse .nav.pull-right {float: none; margin-left: 0;} .nav-collapse, .nav-collapse.collapse {overflow: hidden; height: 0;} .navbar .btn-navbar {display: block;} .navbar-static .navbar-inner {padding-left: 10px; padding-right: 10px;}}@media (min-width: 980px) {.nav-collapse.collapse {height: auto !important; overflow: visible !important;}} @media (max-width: 440px) {#exit_fullscreen span, .helpTip {display: none !important;}}@media (min-width: 480px) and (max-width: 979px) {#db_type_label_collapsed {display: inline !important;}}@media (min-width: 820px) and (max-width: 1024px) {.nav-collapse .pull-right {display: none;}}@media (min-width: 820px) and (max-width: 1100px) {.nav-collapse .pull-right .optional {display: none;}}@media (max-width: 767px) {div.sql {width: 100% !important;} .helpTip {width: 180px !important; height: 30% !important;}}@media (min-width: 768px) and (max-width: 979px) {.helpTip {width: 100px !important; height: 50% !important;}}@media (max-width: 979px) {body {padding-top: 0px !important;} textarea.fullscreen {top: 50px !important;} #paypal_donate {padding-left: 15px;}}body {padding-top: 60px;}#db_type_label_collapsed,#exit_fullscreen {display: none;}#db_type_label_collapsed li {display: inline-block;}textarea.fullscreen {z-index: 10000; height: 100%; width: 100%; position: fixed; top: 40px; left: 0;}.schema {position: relative;}.helpTip {position: absolute; display: none; width: 180px; height: 60%; min-height: 50px; overflow-y: auto; right: 0px; z-index: 1001; margin: 10px 20px;}#browser,.browser_actions {padding-left: 15px; display: none; width: 100%;}#browser {overflow: auto; border: solid thin lightgray;}#sql,#schema_ddl {width: 98%; font-family: monospace; white-space: nowrap; overflow: auto; font-size: 10pt; min-height: 100px;}.tables,.columns {list-style-type: none;}.tables .columns {display: none;}.popover .tables .columns {display: block;}.resultSetWrapper,.schemaPreviewWrapper,.queryLog-hidden {display: none;}.resultSetPreview {list-style-type: none; margin: 0;}.resultSetPreview li {white-space: nowrap;}.resultSetPreview pre {margin-bottom: 2px; overflow-x: hidden; max-height: 75px; overflow-y: hidden; background-color: white;}.resultSetPreview > pre,.schemaPreview > pre {margin-bottom: 2px; overflow-x: hidden; max-height: 200px; overflow-y: hidden; background-color: white;}pre.results,.resultSetPreview li pre {font-family: monospace; font-size: 10pt;}.database-error {white-space: pre-wrap;}#runQueryOptions {min-width: 120px;}#donationSuggestion {font-size: 8pt; text-align: center; display: block;}#content .panel form textarea {display: block; margin: 0; resize: none;}#content .panel.schema {margin: 0;}#output {margin: 0; height: 50%; clear: both; padding-top: 5px;}#content #output form label {top: 10px;}#schema-output {margin: 0; height: 50%; padding-bottom: 5px;}#content form {margin: 0;}.tab-content .tab-pane {height: 100%;}.database-messages i {margin-right: 5px; opacity: .5;}#fiddleFormDDL {position: relative;}#content .panel form label {z-index: 250;}#fiddleFormDDL label a i {margin: 1px;}.executionPlan {width: 90%; margin-left: 10%; display: none;}.executionPlanLink,.setLink {margin-left: 20px;}.oracle_xplan {margin: 0px; overflow: hidden; width: 800px; height: 600px; border: solid thin black; display: inline-block;}.highlight {border: solid thin blue; margin: 5px;}.action_buttons {margin: 5px 0; padding: 0 10px;}.action_buttons > a,.action_buttons > div {margin-bottom: 3px; vertical-align: top; display: inline-block;}.action_buttons .dropdown-menu {text-align: right;}#content .CodeMirror {border: 1px solid #cccccc; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px;}.CodeMirror-scroll {height: 200px; overflow-y: scroll; overflow-x: auto;}.CodeMirror-fullscreen {display: block; position: fixed; top: 42px; left: 0; width: 100%; height: 100%; z-index: 9999; margin: 0; padding: 0; border: 0px solid #BBBBBB; opacity: 1; background-color: white;}#hosting {display: block; margin: 10px auto 0 auto; text-align: center;}#hosting h4 {text-align: center;}#hostingPartners {padding: 0px; display: inline-block; text-align: left; list-style-type: none;}#hostingPartners li {margin: 20px 0; font-family: sans-serif; font-size: 8pt; height: 50px; display: inline;}#hostingPartners a {display: inline-block; float: left;}#hostingPartners img {height: 90px; margin: 0 auto; text-align: center; display: block; border: none;}#hostingPartners span {float: left; display: block; width: 150px;}.modal {display: none;}#myFiddlesModal {width: 800px; margin: -250px 0 0 -420px;}#myFiddlesModal .modal-body {overflow-y: auto;}#myFiddlesTabs {margin-bottom: 0;}#raw,#parseResults {width: 90%;}#parseResults {height: 60px; overflow: auto;}#openid_identifier {width: 250px; margin: 0px; padding: 2px; padding-left: 20px; vertical-align: middle; background-image: url('http://www.idselector.com/images/openid.ico'); background-repeat: no-repeat; background-position: 3px 2px;}#gravatar {height: 20px; width: 20px; margin: 0 10px 0 5px;}.navbar .nav.pull-right {margin-left: 2px;}.nav-collapse > .nav {margin-right: 2px;}.navbar .brand {padding-left: 10px;}.container-fluid .pull-right {float: right !important;}.nav-collapse.in .pull-right {float: left !important;}.navbar .btn-navbar {background-color: #d6d6d6; background-image: -moz-linear-gradient(top, #ffffff, #999999); background-image: -ms-linear-gradient(top, #ffffff, #999999); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#999999)); background-image: -webkit-linear-gradient(top, #ffffff, #999999); background-image: -o-linear-gradient(top, #ffffff, #999999); background-image: linear-gradient(top, #ffffff, #999999); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#999999', GradientType=0); border-color: #999999 #999999 #737373; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);}.btn-navbar:hover,.btn-navbar:active,.btn-navbar.active,.btn-navbar.disabled,.btn-navbar[disabled] {background-color: #999999;}.btn-navbar:active,.btn-navbar.active {background-color: #808080 \9;}.navbar .brand {white-space: nowrap;}.navbar {color: black;}.navbar-inner {background-color: #d6d6d6; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#999999', GradientType=0); background-image: -moz-linear-gradient(top, #ffffff, #999999); background-image: -ms-linear-gradient(top, #ffffff, #999999); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#999999)); background-image: -webkit-linear-gradient(top, #ffffff, #999999); background-image: -o-linear-gradient(top, #ffffff, #999999); background-image: linear-gradient(top, #ffffff, #999999);}.navbar .nav > li > a {color: #333333; text-shadow: none;}.navbar .divider-vertical {background-color: #999; border-right: 1px solid white;}.navbar .nav .active > a,.navbar .nav .active > a:hover {color: #999999; text-decoration: none; background-color: #999999; background-color: rgba(0, 0, 0, 0.5);}.navbar .nav .active > a {color: #eeeeee;}.navbar .nav .active > a:hover {color: #eeeeee;}.navbar .nav > li > a i {margin-right: 5px;}.navbar .brand {color: #000000;}.dropdown-menu a i {margin-right: 5px;}.dropdown-toggle b.caret {color: #999999; opacity: .5;}.dropdown-menu.nav {z-index: 1050 !important;}.dropdown-menu.nav li > a:hover,.dropdown-menu.nav .active > a,.dropdown-menu.nav .active > a:hover {color: #ffffff; text-decoration: none; background-color: #0088cc;}.form-horizontal .control-group {margin-bottom: 6px;}.modal form {margin: 0;}.popover-inner {min-width: 280px; width: auto; overflow-x: visible; overflow-y: hidden; max-height: 400px;}.popover-inner .alert {max-width: 400px; overflow-x: hidden;}#sidebar .well {padding: 8px 0;}#content {height: 100%;}#content .panel {margin: 0;}#content .panel {min-height: 125px; height: 100%; position: relative;}#content .panel form {height: 100%;} diff --git a/src/main/webapp/stylesheets_min/codemirror.css b/src/main/webapp/stylesheets_min/codemirror.css index 34a9fca..18f7ab6 100644 --- a/src/main/webapp/stylesheets_min/codemirror.css +++ b/src/main/webapp/stylesheets_min/codemirror.css @@ -1 +1 @@ -.CodeMirror {line-height: 1em; font-family: monospace;}.CodeMirror-scroll {overflow: auto; height: 300px; position: relative; outline: none;}.CodeMirror-gutter {position: absolute; left: 0; top: 0; z-index: 10; background-color: #f7f7f7; border-right: 1px solid #eee; min-width: 2em; height: 100%;}.CodeMirror-gutter-text {color: #aaa; text-align: right; padding: .4em .2em .4em .4em; white-space: pre !important;}.CodeMirror-lines {padding: .4em; white-space: pre;}.CodeMirror pre {-moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; border-radius: 0; border-width: 0; margin: 0; padding: 0; background: transparent; font-family: inherit; font-size: inherit; padding: 0; margin: 0; white-space: pre; word-wrap: normal; line-height: inherit;}.CodeMirror-wrap pre {word-wrap: break-word; white-space: pre-wrap; word-break: normal;}.CodeMirror-wrap .CodeMirror-scroll {overflow-x: hidden;}.CodeMirror textarea {outline: none !important;}.CodeMirror pre.CodeMirror-cursor {z-index: 10; position: absolute; visibility: hidden; border-left: 1px solid black; border-right:none; width:0;}.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {}.CodeMirror-focused pre.CodeMirror-cursor {visibility: visible;}div.CodeMirror-selected {background: #d9d9d9;}.CodeMirror-focused div.CodeMirror-selected {background: #d7d4f0;}.CodeMirror-searching {background: #ffa; background: rgba(255, 255, 0, .4);}.cm-s-default span.cm-keyword {color: #708;}.cm-s-default span.cm-atom {color: #219;}.cm-s-default span.cm-number {color: #164;}.cm-s-default span.cm-def {color: #00f;}.cm-s-default span.cm-variable {color: black;}.cm-s-default span.cm-variable-2 {color: #05a;}.cm-s-default span.cm-variable-3 {color: #085;}.cm-s-default span.cm-property {color: black;}.cm-s-default span.cm-operator {color: black;}.cm-s-default span.cm-comment {color: #a50;}.cm-s-default span.cm-string {color: #a11;}.cm-s-default span.cm-string-2 {color: #f50;}.cm-s-default span.cm-meta {color: #555;}.cm-s-default span.cm-error {color: #f00;}.cm-s-default span.cm-qualifier {color: #555;}.cm-s-default span.cm-builtin {color: #30a;}.cm-s-default span.cm-bracket {color: #cc7;}.cm-s-default span.cm-tag {color: #170;}.cm-s-default span.cm-attribute {color: #00c;}.cm-s-default span.cm-header {color: #a0a;}.cm-s-default span.cm-quote {color: #090;}.cm-s-default span.cm-hr {color: #999;}.cm-s-default span.cm-link {color: #00c;}span.cm-header, span.cm-strong {font-weight: bold;}span.cm-em {font-style: italic;}span.cm-emstrong {font-style: italic; font-weight: bold;}span.cm-link {text-decoration: underline;}div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
\ No newline at end of file +.CodeMirror {line-height: 1em; font-family: monospace; position: relative; overflow: hidden;}.CodeMirror-scroll {overflow: auto; height: 300px; position: relative; outline: none;}.CodeMirror-scrollbar {position: absolute; right: 0; top: 0; overflow-x: hidden; overflow-y: scroll; z-index: 5;}.CodeMirror-scrollbar-inner {width: 1px;}.CodeMirror-scrollbar.cm-sb-overlap {position: absolute; z-index: 1; float: none; right: 0; min-width: 12px;}.CodeMirror-scrollbar.cm-sb-nonoverlap {min-width: 12px;}.CodeMirror-scrollbar.cm-sb-ie7 {min-width: 18px;}.CodeMirror-gutter {position: absolute; left: 0; top: 0; z-index: 10; background-color: #f7f7f7; border-right: 1px solid #eee; min-width: 2em; height: 100%;}.CodeMirror-gutter-text {color: #aaa; text-align: right; padding: .4em .2em .4em .4em; white-space: pre !important; cursor: default;}.CodeMirror-lines {padding: .4em; white-space: pre; cursor: text;}.CodeMirror pre {-moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; border-radius: 0; border-width: 0; margin: 0; padding: 0; background: transparent; font-family: inherit; font-size: inherit; padding: 0; margin: 0; white-space: pre; word-wrap: normal; line-height: inherit; color: inherit; overflow: visible;}.CodeMirror-wrap pre {word-wrap: break-word; white-space: pre-wrap; word-break: normal;}.CodeMirror-wrap .CodeMirror-scroll {overflow-x: hidden;}.CodeMirror textarea {outline: none !important;}.CodeMirror pre.CodeMirror-cursor {z-index: 10; position: absolute; visibility: hidden; border-left: 1px solid black; border-right: none; width: 0;}.cm-keymap-fat-cursor pre.CodeMirror-cursor {width: auto; border: 0; background: transparent; background: rgba(0, 200, 0, .4); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);}.cm-keymap-fat-cursor pre.CodeMirror-cursor:not(#nonsense_id) {filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);}.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {}.CodeMirror-focused pre.CodeMirror-cursor {visibility: visible;}div.CodeMirror-selected {background: #d9d9d9;}.CodeMirror-focused div.CodeMirror-selected {background: #d7d4f0;}.CodeMirror-searching {background: #ffa; background: rgba(255, 255, 0, .4);}.cm-s-default span.cm-keyword {color: #708;}.cm-s-default span.cm-atom {color: #219;}.cm-s-default span.cm-number {color: #164;}.cm-s-default span.cm-def {color: #00f;}.cm-s-default span.cm-variable {color: black;}.cm-s-default span.cm-variable-2 {color: #05a;}.cm-s-default span.cm-variable-3 {color: #085;}.cm-s-default span.cm-property {color: black;}.cm-s-default span.cm-operator {color: black;}.cm-s-default span.cm-comment {color: #a50;}.cm-s-default span.cm-string {color: #a11;}.cm-s-default span.cm-string-2 {color: #f50;}.cm-s-default span.cm-meta {color: #555;}.cm-s-default span.cm-error {color: #f00;}.cm-s-default span.cm-qualifier {color: #555;}.cm-s-default span.cm-builtin {color: #30a;}.cm-s-default span.cm-bracket {color: #997;}.cm-s-default span.cm-tag {color: #170;}.cm-s-default span.cm-attribute {color: #00c;}.cm-s-default span.cm-header {color: blue;}.cm-s-default span.cm-quote {color: #090;}.cm-s-default span.cm-hr {color: #999;}.cm-s-default span.cm-link {color: #00c;}span.cm-header, span.cm-strong {font-weight: bold;}span.cm-em {font-style: italic;}span.cm-emstrong {font-style: italic; font-weight: bold;}span.cm-link {text-decoration: underline;}span.cm-invalidchar {color: #f00;}div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}@media print {.CodeMirror pre.CodeMirror-cursor {visibility: hidden;}}
\ No newline at end of file |