From 9b409f75b8cc11015f0288de9d4357cca4781ece Mon Sep 17 00:00:00 2001 From: Mohsen Azimi Date: Tue, 17 Mar 2015 11:29:59 -0700 Subject: [PATCH] Encode/decode tags before using it in the URL Fixes #994 Conflicts: dist/swagger-ui.min.js --- dist/swagger-ui.js | 129 +++++++++++----------- dist/swagger-ui.min.js | 4 +- src/main/javascript/doc.js | 9 +- src/main/javascript/view/OperationView.js | 1 + src/main/template/operation.handlebars | 6 +- 5 files changed, 75 insertions(+), 74 deletions(-) diff --git a/dist/swagger-ui.js b/dist/swagger-ui.js index 5678f451..8f4c3a59 100644 --- a/dist/swagger-ui.js +++ b/dist/swagger-ui.js @@ -359,6 +359,7 @@ window.Docs = { // e.g. /docs/#!/words/get_search var fragments = $.param.fragment().split('/'); fragments.shift(); // get rid of the bang + fragments = _.map(fragments, decodeURIComponent); // decode encoded paths switch (fragments.length) { case 1: @@ -366,22 +367,22 @@ window.Docs = { var dom_id = 'resource_' + fragments[0]; Docs.expandEndpointListForResource(fragments[0]); - $("#"+dom_id).slideto({highlight: false}); + $('[id="' + dom_id + '"]').slideto({highlight: false}); break; case 2: // Refer to the endpoint DOM element, e.g. #words_get_search // Expand Resource Docs.expandEndpointListForResource(fragments[0]); - $("#"+dom_id).slideto({highlight: false}); + // $("#"+dom_id).slideto({highlight: false}); // Expand operation var li_dom_id = fragments.join('_'); var li_content_dom_id = li_dom_id + "_content"; - Docs.expandOperation($('#'+li_content_dom_id)); - $('#'+li_dom_id).slideto({highlight: false}); + Docs.expandOperation($('[id="' + li_content_dom_id + '"]')); + $('[id="' + li_dom_id + '"]').slideto({highlight: false}); break; } @@ -475,37 +476,37 @@ Handlebars.registerHelper('sanitize', function(html) { this["Handlebars"]["templates"]["main"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression, buffer = "
" + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.title : stack1), depth0)) - + "
\n
"; + + "
\r\n
"; stack1 = lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.description : stack1), depth0); if (stack1 != null) { buffer += stack1; } - buffer += "
\n"; + buffer += "\r\n"; stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.externalDocs : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.noop,"data":data}); if (stack1 != null) { buffer += stack1; } buffer += " "; stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.termsOfServiceUrl : stack1), {"name":"if","hash":{},"fn":this.program(4, data),"inverse":this.noop,"data":data}); if (stack1 != null) { buffer += stack1; } - buffer += "\n "; + buffer += "\r\n "; stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.name : stack1), {"name":"if","hash":{},"fn":this.program(6, data),"inverse":this.noop,"data":data}); if (stack1 != null) { buffer += stack1; } - buffer += "\n "; + buffer += "\r\n "; stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.url : stack1), {"name":"if","hash":{},"fn":this.program(8, data),"inverse":this.noop,"data":data}); if (stack1 != null) { buffer += stack1; } - buffer += "\n "; + buffer += "\r\n "; stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.email : stack1), {"name":"if","hash":{},"fn":this.program(10, data),"inverse":this.noop,"data":data}); if (stack1 != null) { buffer += stack1; } - buffer += "\n "; + buffer += "\r\n "; stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.license : stack1), {"name":"if","hash":{},"fn":this.program(12, data),"inverse":this.noop,"data":data}); if (stack1 != null) { buffer += stack1; } - return buffer + "\n"; + return buffer + "\r\n"; },"2":function(depth0,helpers,partials,data) { var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression; - return "
More documentations
\n

" + return "

More documentations
\r\n

" + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.externalDocs : depth0)) != null ? stack1.description : stack1), depth0)) - + "

\n \r\n " + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.externalDocs : depth0)) != null ? stack1.url : stack1), depth0)) - + "\n"; + + "\r\n"; },"4":function(depth0,helpers,partials,data) { var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression; return "
api version: " + escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.version : stack1), depth0)) - + "\n "; + + "\r\n "; },"16":function(depth0,helpers,partials,data) { var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; return " \n \n"; + + "\">\r\n \r\n"; },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "
\n"; + var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "
\r\n"; stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.info : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data}); if (stack1 != null) { buffer += stack1; } - buffer += "
\n
\n
    \n\n
    \n
    \n
    \n

    [ base url: " + buffer += "

    \r\n
    \r\n
      \r\n\r\n
      \r\n
      \r\n
      \r\n

      [ base url: " + escapeExpression(((helper = (helper = helpers.basePath || (depth0 != null ? depth0.basePath : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"basePath","hash":{},"data":data}) : helper))) - + "\n"; + + "\r\n"; stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.version : stack1), {"name":"if","hash":{},"fn":this.program(14, data),"inverse":this.noop,"data":data}); if (stack1 != null) { buffer += stack1; } - buffer += "]\n"; + buffer += "]\r\n"; stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.validatorUrl : depth0), {"name":"if","hash":{},"fn":this.program(16, data),"inverse":this.noop,"data":data}); if (stack1 != null) { buffer += stack1; } - return buffer + "

      \n
      \n
      \n"; + return buffer + " \r\n
      \r\n
      \r\n"; },"useData":true}); this["Handlebars"]["templates"]["operation"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { return "deprecated"; },"3":function(depth0,helpers,partials,data) { - return "

      Warning: Deprecated

      \n"; + return "

      Warning: Deprecated

      \r\n"; },"5":function(depth0,helpers,partials,data) { - var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, buffer = "

      Implementation Notes

      \n

      "; + var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, buffer = "

      Implementation Notes

      \r\n

      "; stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper)); if (stack1 != null) { buffer += stack1; } - return buffer + "

      \n"; + return buffer + "

      \r\n"; },"7":function(depth0,helpers,partials,data) { - return "
      \n "; + return "
      \r\n "; },"9":function(depth0,helpers,partials,data) { - var stack1, buffer = "
      \n"; + var stack1, buffer = "
      \r\n"; stack1 = helpers.each.call(depth0, depth0, {"name":"each","hash":{},"fn":this.program(10, data),"inverse":this.noop,"data":data}); if (stack1 != null) { buffer += stack1; } - return buffer + "
      \n"; + return buffer + "
      \r\n"; },"10":function(depth0,helpers,partials,data) { var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression, buffer = "
      " + escapeExpression(lambda((depth0 != null ? depth0.scope : depth0), depth0)) - + "
      \n"; + + "
      \r\n"; },"12":function(depth0,helpers,partials,data) { return "
      "; },"14":function(depth0,helpers,partials,data) { - return "
      \n \n
      \n"; + return "
      \r\n \r\n
      \r\n"; },"16":function(depth0,helpers,partials,data) { var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; return "

      Response Class (Status " + escapeExpression(((helper = (helper = helpers.successCode || (depth0 != null ? depth0.successCode : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"successCode","hash":{},"data":data}) : helper))) - + ")

      \n

      \n
      \n
      \n"; + + ")\r\n

      \r\n
      \r\n
      \r\n"; },"18":function(depth0,helpers,partials,data) { - return "

      Parameters

      \n \n \n \n \n \n \n \n \n \n \n \n\n \n
      ParameterValueDescriptionParameter TypeData Type
      \n"; + return "

      Parameters

      \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n
      ParameterValueDescriptionParameter TypeData Type
      \r\n"; },"20":function(depth0,helpers,partials,data) { - return "
      \n

      Response Messages

      \n \n \n \n \n \n \n \n \n \n \n\n \n
      HTTP Status CodeReasonResponse ModelHeaders
      \n"; + return "
      \r\n

      Response Messages

      \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n
      HTTP Status CodeReasonResponse ModelHeaders
      \r\n"; },"22":function(depth0,helpers,partials,data) { return ""; },"24":function(depth0,helpers,partials,data) { - return "
      \n \n \n \n
      \n"; + return "
      \r\n \r\n \r\n \r\n
      \r\n"; },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing, buffer = "\n \n"; + return buffer + " \r\n \r\n
      \r\n \r\n \r\n"; },"useData":true}); this["Handlebars"]["templates"]["param"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { var stack1, buffer = ""; @@ -956,11 +957,11 @@ this["Handlebars"]["templates"]["resource"] = Handlebars.template({"1":function( return " : "; },"3":function(depth0,helpers,partials,data) { var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return "
    • \n Raw\n
    • \n"; + + "'>Raw\r\n \r\n"; },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing, buffer = "
      \n

      \n \r\n

      \r\n Show/Hide\n \n
    • \n Show/Hide\r\n
    • \r\n
    • \r\n \n List Operations\n \n
    • \n
    • \n \r\n List Operations\r\n \r\n
    • \r\n
    • \r\n \n Expand Operations\n \n
    • \n"; + + "\">\r\n Expand Operations\r\n \r\n \r\n"; stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.url : depth0), {"name":"if","hash":{},"fn":this.program(3, data),"inverse":this.noop,"data":data}); if (stack1 != null) { buffer += stack1; } - return buffer + " \n

      \n\n"; + + "_endpoint_list' style='display:none'>\r\n\r\n\r\n"; },"useData":true}); this["Handlebars"]["templates"]["response_content_type"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { var stack1, buffer = ""; @@ -1020,23 +1021,23 @@ this["Handlebars"]["templates"]["signature"] = Handlebars.template({"compiler":[ },"useData":true}); this["Handlebars"]["templates"]["status_code"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { var lambda=this.lambda, escapeExpression=this.escapeExpression; - return " \n " + return " \r\n " + escapeExpression(lambda((data && data.key), depth0)) - + "\n " + + "\r\n " + escapeExpression(lambda((depth0 != null ? depth0.description : depth0), depth0)) - + "\n " + + "\r\n " + escapeExpression(lambda((depth0 != null ? depth0.type : depth0), depth0)) - + "\n \n"; + + "\r\n \r\n"; },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "" + escapeExpression(((helper = (helper = helpers.code || (depth0 != null ? depth0.code : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"code","hash":{},"data":data}) : helper))) - + "\n"; + + "\r\n"; stack1 = ((helper = (helper = helpers.message || (depth0 != null ? depth0.message : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"message","hash":{},"data":data}) : helper)); if (stack1 != null) { buffer += stack1; } - buffer += "\n\n\n \n \n"; + buffer += "\r\n\r\n"; + return buffer + " \r\n
      \r\n \r\n \r\n"; stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.headers : depth0), {"name":"each","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data}); if (stack1 != null) { buffer += stack1; } - return buffer + " \n
      \n
      \r\n"; },"useData":true}); 'use strict'; @@ -1341,6 +1342,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({ this.auths = opts.auths; this.parentId = this.model.parentId; this.nickname = this.model.nickname; + this.model.encodedParentId = encodeURIComponent(this.parentId); return this; }, @@ -1715,9 +1717,6 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({ if (window.authorizations) { window.authorizations.apply(obj); } - if (params === 0) { - obj.data.append('fake', 'true'); - } jQuery.ajax(obj); return false; // end of file-upload nastiness diff --git a/dist/swagger-ui.min.js b/dist/swagger-ui.min.js index a8b7dcc8..112f61c7 100644 --- a/dist/swagger-ui.min.js +++ b/dist/swagger-ui.min.js @@ -1,2 +1,2 @@ -(function(){"use strict";window.SwaggerUi=Backbone.Router.extend({dom_id:"swagger_ui",options:null,api:null,headerView:null,mainView:null,initialize:function(e){e=e||{},e.dom_id&&(this.dom_id=e.dom_id,delete e.dom_id),e.supportedSubmitMethods||(e.supportedSubmitMethods=["get","put","post","delete","head","options","patch"]),$("#"+this.dom_id).length||$("body").append('
      '),this.options=e,marked.setOptions({gfm:!0});var n=this;this.options.success=function(){return n.render()},this.options.progress=function(e){return n.showMessage(e)},this.options.failure=function(e){return n.onLoadFailure(e)},this.headerView=new SwaggerUi.Views.HeaderView({el:$("#header")}),this.headerView.on("update-swagger-ui",function(e){return n.updateSwaggerUi(e)})},setOption:function(e,n){this.options[e]=n},getOption:function(e){return this.options[e]},updateSwaggerUi:function(e){this.options.url=e.url,this.load()},load:function(){this.mainView&&this.mainView.clear();var e=this.options.url;e&&0!==e.indexOf("http")&&(e=this.buildUrl(window.location.href.toString(),e)),this.options.url=e,this.headerView.update(e),this.api=new SwaggerClient(this.options)},collapseAll:function(){Docs.collapseEndpointListForResource("")},listAll:function(){Docs.collapseOperationsForResource("")},expandAll:function(){Docs.expandOperationsForResource("")},render:function(){switch(this.showMessage("Finished Loading Resource Information. Rendering Swagger UI..."),this.mainView=new SwaggerUi.Views.MainView({model:this.api,el:$("#"+this.dom_id),swaggerOptions:this.options,router:this}).render(),this.showMessage(),this.options.docExpansion){case"full":this.expandAll();break;case"list":this.listAll()}this.renderGFM(),this.options.onComplete&&this.options.onComplete(this.api,this),setTimeout(Docs.shebang.bind(this),100)},buildUrl:function(e,n){if(0===n.indexOf("/")){var t=e.split("/");return e=t[0]+"//"+t[2],e+n}var a=e.length;return e.indexOf("?")>-1&&(a=Math.min(a,e.indexOf("?"))),e.indexOf("#")>-1&&(a=Math.min(a,e.indexOf("#"))),e=e.substring(0,a),-1!==e.indexOf("/",e.length-1)?e+n:e+"/"+n},showMessage:function(e){void 0===e&&(e=""),$("#message-bar").removeClass("message-fail"),$("#message-bar").addClass("message-success"),$("#message-bar").html(e)},onLoadFailure:function(e){void 0===e&&(e=""),$("#message-bar").removeClass("message-success"),$("#message-bar").addClass("message-fail");var n=$("#message-bar").html(e);return this.options.onFailure&&this.options.onFailure(e),n},renderGFM:function(){$(".markdown").each(function(){$(this).html(marked($(this).html()))})}}),window.SwaggerUi.Views={},function(){function e(e){"console"in window&&"function"==typeof window.console.warn&&console.warn(e)}window.authorizations={add:function(){if(e("using window.authorizations is depreciated. Please use waggerUi.api.clientAuthorizations.add()."),"undefined"==typeof window.swaggerUi)throw new TypeError("window.swaggerUi is not defined");window.swaggerUi instanceof SwaggerUi&&window.swaggerUi.api.clientAuthorizations.add.apply(window.swaggerUi.api.clientAuthorizations,arguments)}},window.ApiKeyAuthorization=function(){e("window.ApiKeyAuthorization is depreciated. Please use SwaggerClient.ApiKeyAuthorization."),SwaggerClient.ApiKeyAuthorization.apply(window,arguments)},window.PasswordAuthorization=function(){e("window.PasswordAuthorization is depreciated. Please use SwaggerClient.PasswordAuthorization."),SwaggerClient.PasswordAuthorization.apply(window,arguments)}}(),this.Handlebars=this.Handlebars||{},this.Handlebars.templates=this.Handlebars.templates||{},this.Handlebars.templates.apikey_button_view=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return"\n
      \n
      \n
      "+r((i=null!=(i=n.keyName||(null!=e?e.keyName:e))?i:l,typeof i===s?i.call(e,{name:"keyName",hash:{},data:a}):i))+'
      \n \n \n
      \n
      \n\n'},useData:!0}),this.Handlebars.templates.basic_auth_button_view=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(){return'
      \n
      \n
      \n
      Username
      \n \n
      Password
      \n \n \n
      \n
      \n\n'},useData:!0}),this.Handlebars.templates.content_type=Handlebars.template({1:function(e,n,t,a){var i,s="";return i=n.each.call(e,null!=e?e.produces:e,{name:"each",hash:{},fn:this.program(2,a),inverse:this.noop,data:a}),null!=i&&(s+=i),s},2:function(e){var n,t=this.lambda,a=' \n"},4:function(){return' \n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s='\n\n"},useData:!0}),$(function(){$.fn.vAlign=function(){return this.each(function(){var e=$(this).height(),n=$(this).parent().height(),t=(n-e)/2;$(this).css("margin-top",t)})},$.fn.stretchFormtasticInputWidthToParent=function(){return this.each(function(){var e=$(this).closest("form").innerWidth(),n=parseInt($(this).closest("form").css("padding-left"),10)+parseInt($(this).closest("form").css("padding-right"),10),t=parseInt($(this).css("padding-left"),10)+parseInt($(this).css("padding-right"),10);$(this).css("width",e-n-t)})},$("form.formtastic li.string input, form.formtastic textarea").stretchFormtasticInputWidthToParent(),$("ul.downplayed li div.content p").vAlign(),$("form.sandbox").submit(function(){var e=!0;return $(this).find("input.required").each(function(){$(this).removeClass("error"),""===$(this).val()&&($(this).addClass("error"),$(this).wiggle(),e=!1)}),e})}),Function.prototype.bind&&console&&"object"==typeof console.log&&["log","info","warn","error","assert","dir","clear","profile","profileEnd"].forEach(function(e){console[e]=this.bind(console[e],console)},Function.prototype.call),window.Docs={shebang:function(){var e=$.param.fragment().split("/");switch(e.shift(),e.length){case 1:var n="resource_"+e[0];Docs.expandEndpointListForResource(e[0]),$("#"+n).slideto({highlight:!1});break;case 2:Docs.expandEndpointListForResource(e[0]),$("#"+n).slideto({highlight:!1});var t=e.join("_"),a=t+"_content";Docs.expandOperation($("#"+a)),$("#"+t).slideto({highlight:!1})}},toggleEndpointListForResource:function(e){var n=$("li#resource_"+Docs.escapeResourceName(e)+" ul.endpoints");n.is(":visible")?Docs.collapseEndpointListForResource(e):Docs.expandEndpointListForResource(e)},expandEndpointListForResource:function(e){var e=Docs.escapeResourceName(e);if(""==e)return void $(".resource ul.endpoints").slideDown();$("li#resource_"+e).addClass("active");var n=$("li#resource_"+e+" ul.endpoints");n.slideDown()},collapseEndpointListForResource:function(e){var e=Docs.escapeResourceName(e);if(""==e)return void $(".resource ul.endpoints").slideUp();$("li#resource_"+e).removeClass("active");var n=$("li#resource_"+e+" ul.endpoints");n.slideUp()},expandOperationsForResource:function(e){return Docs.expandEndpointListForResource(e),""==e?void $(".resource ul.endpoints li.operation div.content").slideDown():void $("li#resource_"+Docs.escapeResourceName(e)+" li.operation div.content").each(function(){Docs.expandOperation($(this))})},collapseOperationsForResource:function(e){return Docs.expandEndpointListForResource(e),""==e?void $(".resource ul.endpoints li.operation div.content").slideUp():void $("li#resource_"+Docs.escapeResourceName(e)+" li.operation div.content").each(function(){Docs.collapseOperation($(this))})},escapeResourceName:function(e){return e.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g,"\\$&")},expandOperation:function(e){e.slideDown()},collapseOperation:function(e){e.slideUp()}},Handlebars.registerHelper("sanitize",function(e){return e=e.replace(/)<[^<]*)*<\/script>/gi,""),new Handlebars.SafeString(e)}),this.Handlebars.templates.main=Handlebars.template({1:function(e,n,t,a){var i,s=this.lambda,l=this.escapeExpression,r='
      '+l(s(null!=(i=null!=e?e.info:e)?i.title:i,e))+'
      \n
      ';return i=s(null!=(i=null!=e?e.info:e)?i.description:i,e),null!=i&&(r+=i),r+="
      \n",i=n["if"].call(e,null!=e?e.externalDocs:e,{name:"if",hash:{},fn:this.program(2,a),inverse:this.noop,data:a}),null!=i&&(r+=i),r+=" ",i=n["if"].call(e,null!=(i=null!=e?e.info:e)?i.termsOfServiceUrl:i,{name:"if",hash:{},fn:this.program(4,a),inverse:this.noop,data:a}),null!=i&&(r+=i),r+="\n ",i=n["if"].call(e,null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.name:i,{name:"if",hash:{},fn:this.program(6,a),inverse:this.noop,data:a}),null!=i&&(r+=i),r+="\n ",i=n["if"].call(e,null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.url:i,{name:"if",hash:{},fn:this.program(8,a),inverse:this.noop,data:a}),null!=i&&(r+=i),r+="\n ",i=n["if"].call(e,null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.email:i,{name:"if",hash:{},fn:this.program(10,a),inverse:this.noop,data:a}),null!=i&&(r+=i),r+="\n ",i=n["if"].call(e,null!=(i=null!=e?e.info:e)?i.license:i,{name:"if",hash:{},fn:this.program(12,a),inverse:this.noop,data:a}),null!=i&&(r+=i),r+"\n"},2:function(e){var n,t=this.lambda,a=this.escapeExpression;return"
      More documentations
      \n

      "+a(t(null!=(n=null!=e?e.externalDocs:e)?n.description:n,e))+'

      \n '+a(t(null!=(n=null!=e?e.externalDocs:e)?n.url:n,e))+"\n"},4:function(e){var n,t=this.lambda,a=this.escapeExpression;return''},6:function(e){var n,t=this.lambda,a=this.escapeExpression;return"
      Created by "+a(t(null!=(n=null!=(n=null!=e?e.info:e)?n.contact:n)?n.name:n,e))+"
      "},8:function(e){var n,t=this.lambda,a=this.escapeExpression;return""},10:function(e){var n,t=this.lambda,a=this.escapeExpression;return"'},12:function(e){var n,t=this.lambda,a=this.escapeExpression;return""},14:function(e){var n,t=this.lambda,a=this.escapeExpression;return' , api version: '+a(t(null!=(n=null!=e?e.info:e)?n.version:n,e))+"\n "},16:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return' \n \n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s,l="function",r=n.helperMissing,o=this.escapeExpression,u="
      \n";return i=n["if"].call(e,null!=e?e.info:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.noop,data:a}),null!=i&&(u+=i),u+="
      \n
      \n
        \n\n
        \n
        \n
        \n

        [ base url: "+o((s=null!=(s=n.basePath||(null!=e?e.basePath:e))?s:r,typeof s===l?s.call(e,{name:"basePath",hash:{},data:a}):s))+"\n",i=n["if"].call(e,null!=(i=null!=e?e.info:e)?i.version:i,{name:"if",hash:{},fn:this.program(14,a),inverse:this.noop,data:a}),null!=i&&(u+=i),u+="]\n",i=n["if"].call(e,null!=e?e.validatorUrl:e,{name:"if",hash:{},fn:this.program(16,a),inverse:this.noop,data:a}),null!=i&&(u+=i),u+"

        \n
        \n
        \n"},useData:!0}),this.Handlebars.templates.operation=Handlebars.template({1:function(){return"deprecated"},3:function(){return"

        Warning: Deprecated

        \n"},5:function(e,n,t,a){var i,s,l="function",r=n.helperMissing,o='

        Implementation Notes

        \n

        ';return s=null!=(s=n.description||(null!=e?e.description:e))?s:r,i=typeof s===l?s.call(e,{name:"description",hash:{},data:a}):s,null!=i&&(o+=i),o+"

        \n"},7:function(){return'
        \n '},9:function(e,n,t,a){var i,s=' \n"},10:function(e){var n,t=this.lambda,a=this.escapeExpression,i="
        "+a(t(null!=e?e.scope:e,e))+"
        \n"},12:function(){return"
        "},14:function(){return'
        \n \n
        \n'},16:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return"

        Response Class (Status "+r((i=null!=(i=n.successCode||(null!=e?e.successCode:e))?i:l,typeof i===s?i.call(e,{name:"successCode",hash:{},data:a}):i))+')

        \n

        \n
        \n
        \n'},18:function(){return'

        Parameters

        \n \n \n \n \n \n \n \n \n \n \n \n\n \n
        ParameterValueDescriptionParameter TypeData Type
        \n'},20:function(){return"
        \n

        Response Messages

        \n \n \n \n \n \n \n \n \n \n \n\n \n
        HTTP Status CodeReasonResponse ModelHeaders
        \n"},22:function(){return""},24:function(){return"
        \n \n \n \n
        \n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s,l,r="function",o=n.helperMissing,u=this.escapeExpression,p=n.blockHelperMissing,d="\n
          \n
        • \n \n \n
        • \n
        \n"},useData:!0}),this.Handlebars.templates.param=Handlebars.template({1:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(2,a),inverse:this.program(4,a),data:a}),null!=i&&(s+=i),s},2:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return' \n
        \n'},4:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(5,a),inverse:this.program(7,a),data:a}),null!=i&&(s+=i),s},5:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n
        \n
        \n'},7:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n
        \n
        \n'},9:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(2,a),inverse:this.program(10,a),data:a}),null!=i&&(s+=i),s},10:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(11,a),inverse:this.program(13,a),data:a}),null!=i&&(s+=i),s},11:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n"},13:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s,l="function",r=n.helperMissing,o=this.escapeExpression,u=""+o((s=null!=(s=n.name||(null!=e?e.name:e))?s:r,typeof s===l?s.call(e,{name:"name",hash:{},data:a}):s))+"\n\n\n";return i=n["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.program(9,a),data:a}),null!=i&&(u+=i),u+='\n\n',s=null!=(s=n.description||(null!=e?e.description:e))?s:r,i=typeof s===l?s.call(e,{name:"description",hash:{},data:a}):s,null!=i&&(u+=i),u+="\n",s=null!=(s=n.paramType||(null!=e?e.paramType:e))?s:r,i=typeof s===l?s.call(e,{name:"paramType",hash:{},data:a}):s,null!=i&&(u+=i),u+'\n\n \n\n'},useData:!0}),this.Handlebars.templates.param_list=Handlebars.template({1:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return""+r((i=null!=(i=n.name||(null!=e?e.name:e))?i:l,typeof i===s?i.call(e,{name:"name",hash:{},data:a}):i))+"\n"},3:function(){return" multiple='multiple'"},5:function(){return""},7:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(5,a),inverse:this.program(8,a),data:a}),null!=i&&(s+=i),s},8:function(e,n,t,a){var i,s=n.helperMissing,l="";return i=(n.isArray||e&&e.isArray||s).call(e,e,{name:"isArray",hash:{},fn:this.program(5,a),inverse:this.program(9,a),data:a}),null!=i&&(l+=i),l},9:function(){return" \n"},11:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e.isDefault:e,{name:"if",hash:{},fn:this.program(12,a),inverse:this.program(14,a),data:a}),null!=i&&(s+=i),s},12:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return' \n"},14:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s,l="function",r=n.helperMissing,o=this.escapeExpression,u="";return i=n["if"].call(e,null!=e?e.required:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.noop,data:a}),null!=i&&(u+=i),u+=""+o((s=null!=(s=n.name||(null!=e?e.name:e))?s:r,typeof s===l?s.call(e,{name:"name",hash:{},data:a}):s))+"\n\n \n\n',s=null!=(s=n.description||(null!=e?e.description:e))?s:r,i=typeof s===l?s.call(e,{name:"description",hash:{},data:a}):s,null!=i&&(u+=i),u+="\n",s=null!=(s=n.paramType||(null!=e?e.paramType:e))?s:r,i=typeof s===l?s.call(e,{name:"paramType",hash:{},data:a}):s,null!=i&&(u+=i),u+'\n'},useData:!0}),this.Handlebars.templates.param_readonly=Handlebars.template({1:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n"},3:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(4,a),inverse:this.program(6,a),data:a}),null!=i&&(s+=i),s},4:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" "+r((i=null!=(i=n["default"]||(null!=e?e["default"]:e))?i:l,typeof i===s?i.call(e,{name:"default",hash:{},data:a}):i))+"\n"},6:function(){return" (empty)\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s,l="function",r=n.helperMissing,o=this.escapeExpression,u=""+o((s=null!=(s=n.name||(null!=e?e.name:e))?s:r,typeof s===l?s.call(e,{name:"name",hash:{},data:a}):s))+"\n\n";return i=n["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.program(3,a),data:a}),null!=i&&(u+=i),u+='\n',s=null!=(s=n.description||(null!=e?e.description:e))?s:r,i=typeof s===l?s.call(e,{name:"description",hash:{},data:a}):s,null!=i&&(u+=i),u+="\n",s=null!=(s=n.paramType||(null!=e?e.paramType:e))?s:r,i=typeof s===l?s.call(e,{name:"paramType",hash:{},data:a}):s,null!=i&&(u+=i),u+'\n\n'},useData:!0}),this.Handlebars.templates.param_readonly_required=Handlebars.template({1:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n"},3:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(4,a),inverse:this.program(6,a),data:a}),null!=i&&(s+=i),s},4:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" "+r((i=null!=(i=n["default"]||(null!=e?e["default"]:e))?i:l,typeof i===s?i.call(e,{name:"default",hash:{},data:a}):i))+"\n"},6:function(){return" (empty)\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s,l="function",r=n.helperMissing,o=this.escapeExpression,u=""+o((s=null!=(s=n.name||(null!=e?e.name:e))?s:r,typeof s===l?s.call(e,{name:"name",hash:{},data:a}):s))+"\n\n";return i=n["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.program(3,a),data:a}),null!=i&&(u+=i),u+='\n',s=null!=(s=n.description||(null!=e?e.description:e))?s:r,i=typeof s===l?s.call(e,{name:"description",hash:{},data:a}):s,null!=i&&(u+=i),u+="\n",s=null!=(s=n.paramType||(null!=e?e.paramType:e))?s:r,i=typeof s===l?s.call(e,{name:"paramType",hash:{},data:a}):s,null!=i&&(u+=i),u+'\n\n'},useData:!0}),this.Handlebars.templates.param_required=Handlebars.template({1:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(2,a),inverse:this.program(4,a),data:a}),null!=i&&(s+=i),s},2:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return' \n"},4:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(5,a),inverse:this.program(7,a),data:a}),null!=i&&(s+=i),s},5:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n
        \n
        \n'},7:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n
        \n
        \n' -},9:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(10,a),inverse:this.program(12,a),data:a}),null!=i&&(s+=i),s},10:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n"},12:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(13,a),inverse:this.program(15,a),data:a}),null!=i&&(s+=i),s},13:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n"},15:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s,l="function",r=n.helperMissing,o=this.escapeExpression,u=""+o((s=null!=(s=n.name||(null!=e?e.name:e))?s:r,typeof s===l?s.call(e,{name:"name",hash:{},data:a}):s))+"\n\n";return i=n["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.program(9,a),data:a}),null!=i&&(u+=i),u+='\n\n ',s=null!=(s=n.description||(null!=e?e.description:e))?s:r,i=typeof s===l?s.call(e,{name:"description",hash:{},data:a}):s,null!=i&&(u+=i),u+="\n\n",s=null!=(s=n.paramType||(null!=e?e.paramType:e))?s:r,i=typeof s===l?s.call(e,{name:"paramType",hash:{},data:a}):s,null!=i&&(u+=i),u+'\n\n'},useData:!0}),this.Handlebars.templates.parameter_content_type=Handlebars.template({1:function(e,n,t,a){var i,s="";return i=n.each.call(e,null!=e?e.consumes:e,{name:"each",hash:{},fn:this.program(2,a),inverse:this.noop,data:a}),null!=i&&(s+=i),s},2:function(e){var n,t=this.lambda,a=' \n"},4:function(){return' \n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s='\n\n"},useData:!0}),this.Handlebars.templates.resource=Handlebars.template({1:function(){return" : "},3:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return"
      • \n Raw\n
      • \n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s,l,r="function",o=n.helperMissing,u=this.escapeExpression,p=n.blockHelperMissing,d="
        \n

        \n '+u((s=null!=(s=n.name||(null!=e?e.name:e))?s:o,typeof s===r?s.call(e,{name:"name",hash:{},data:a}):s))+" ";return s=null!=(s=n.summary||(null!=e?e.summary:e))?s:o,l={name:"summary",hash:{},fn:this.program(1,a),inverse:this.noop,data:a},i=typeof s===r?s.call(e,l):s,n.summary||(i=p.call(e,i,l)),null!=i&&(d+=i),s=null!=(s=n.summary||(null!=e?e.summary:e))?s:o,i=typeof s===r?s.call(e,{name:"summary",hash:{},data:a}):s,null!=i&&(d+=i),d+="\n

        \n \n
        \n\n"},useData:!0}),this.Handlebars.templates.response_content_type=Handlebars.template({1:function(e,n,t,a){var i,s="";return i=n.each.call(e,null!=e?e.produces:e,{name:"each",hash:{},fn:this.program(2,a),inverse:this.noop,data:a}),null!=i&&(s+=i),s},2:function(e){var n,t=this.lambda,a=' \n"},4:function(){return' \n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s='\n\n"},useData:!0}),this.Handlebars.templates.signature=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s,l="function",r=n.helperMissing,o=this.escapeExpression,u='
        \n\n
        \n\n
        \n
        \n ';return s=null!=(s=n.signature||(null!=e?e.signature:e))?s:r,i=typeof s===l?s.call(e,{name:"signature",hash:{},data:a}):s,null!=i&&(u+=i),u+'\n
        \n\n
        \n
        '+o((s=null!=(s=n.sampleJSON||(null!=e?e.sampleJSON:e))?s:r,typeof s===l?s.call(e,{name:"sampleJSON",hash:{},data:a}):s))+'
        \n \n
        \n
        \n\n'},useData:!0}),this.Handlebars.templates.status_code=Handlebars.template({1:function(e,n,t,a){var i=this.lambda,s=this.escapeExpression;return" \n "+s(i(a&&a.key,e))+"\n "+s(i(null!=e?e.description:e,e))+"\n "+s(i(null!=e?e.type:e,e))+"\n \n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s,l="function",r=n.helperMissing,o=this.escapeExpression,u=""+o((s=null!=(s=n.code||(null!=e?e.code:e))?s:r,typeof s===l?s.call(e,{name:"code",hash:{},data:a}):s))+"\n";return s=null!=(s=n.message||(null!=e?e.message:e))?s:r,i=typeof s===l?s.call(e,{name:"message",hash:{},data:a}):s,null!=i&&(u+=i),u+='\n\n\n \n \n',i=n.each.call(e,null!=e?e.headers:e,{name:"each",hash:{},fn:this.program(1,a),inverse:this.noop,data:a}),null!=i&&(u+=i),u+" \n
        \n"},useData:!0}),SwaggerUi.Views.ApiKeyButton=Backbone.View.extend({events:{"click #apikey_button":"toggleApiKeyContainer","click #apply_api_key":"applyApiKey"},initialize:function(e){this.options=e||{},this.router=this.options.router},render:function(){var e=this.template();return $(this.el).html(e(this.model)),this},applyApiKey:function(){var e=new SwaggerClient.ApiKeyAuthorization(this.model.name,$("#input_apiKey_entry").val(),this.model["in"]);this.router.api.clientAuthorizations.add(this.model.name,e),this.router.load(),$("#apikey_container").show()},toggleApiKeyContainer:function(){if($("#apikey_container").length){var e=$("#apikey_container").first();e.is(":visible")?e.hide():($(".auth_container").hide(),e.show())}},template:function(){return Handlebars.templates.apikey_button_view}}),SwaggerUi.Views.BasicAuthButton=Backbone.View.extend({initialize:function(e){this.options=e||{},this.router=this.options.router},render:function(){var e=this.template();return $(this.el).html(e(this.model)),this},events:{"click #basic_auth_button":"togglePasswordContainer","click #apply_basic_auth":"applyPassword"},applyPassword:function(){var e=$(".input_username").val(),n=$(".input_password").val(),t=new SwaggerClient.PasswordAuthorization("basic",e,n);this.router.api.clientAuthorizations.add(this.model.type,t),this.router.load(),$("#basic_auth_container").hide()},togglePasswordContainer:function(){if($("#basic_auth_container").length){var e=$("#basic_auth_container").show();e.is(":visible")?e.slideUp():($(".auth_container").hide(),e.show())}},template:function(){return Handlebars.templates.basic_auth_button_view}}),SwaggerUi.Views.ContentTypeView=Backbone.View.extend({initialize:function(){},render:function(){return $(this.el).html(Handlebars.templates.content_type(this.model)),$("label[for=contentType]",$(this.el)).text("Response Content Type"),this}}),SwaggerUi.Views.HeaderView=Backbone.View.extend({events:{"click #show-pet-store-icon":"showPetStore","click #show-wordnik-dev-icon":"showWordnikDev","click #explore":"showCustom","keyup #input_baseUrl":"showCustomOnKeyup","keyup #input_apiKey":"showCustomOnKeyup"},initialize:function(){},showPetStore:function(){this.trigger("update-swagger-ui",{url:"http://petstore.swagger.wordnik.com/api/api-docs"})},showWordnikDev:function(){this.trigger("update-swagger-ui",{url:"http://api.wordnik.com/v4/resources.json"})},showCustomOnKeyup:function(e){13===e.keyCode&&this.showCustom()},showCustom:function(e){e&&e.preventDefault(),this.trigger("update-swagger-ui",{url:$("#input_baseUrl").val(),apiKey:$("#input_apiKey").val()})},update:function(e,n,t){void 0===t&&(t=!1),$("#input_baseUrl").val(e),t&&this.trigger("update-swagger-ui",{url:e})}}),SwaggerUi.Views.MainView=Backbone.View.extend({initialize:function(e){e=e||{},this.router=e.router,this.model.auths=[];var n,t;for(n in this.model.securityDefinitions)t=this.model.securityDefinitions[n],this.model.auths.push({name:n,type:t.type,value:t});"2.0"===this.model.swaggerVersion&&(this.model.validatorUrl="validatorUrl"in e.swaggerOptions?e.swaggerOptions.validatorUrl:this.model.url.indexOf("localhost")>0?null:"http://online.swagger.io/validator")},render:function(){if(this.model.securityDefinitions)for(var e in this.model.securityDefinitions){var n,t=this.model.securityDefinitions[e];"apiKey"===t.type&&0===$("#apikey_button").length&&(n=new SwaggerUi.Views.ApiKeyButton({model:t,router:this.router}).render().el,$(".auth_main_container").append(n)),"basicAuth"===t.type&&0===$("#basic_auth_button").length&&(n=new SwaggerUi.Views.BasicAuthButton({model:t,router:this.router}).render().el,$(".auth_main_container").append(n))}$(this.el).html(Handlebars.templates.main(this.model));for(var a={},i=0,s=0;sl&&(t=l-o),i>t&&(t=i),a+u>r&&(a=r-u),s>a&&(a=s);var p={};p.top=a,p.left=t,n.css(p),$(e.currentTarget.parentNode).find("#api_information_panel").show()},mouseExit:function(e){$(e.currentTarget.parentNode).find("#api_information_panel").hide()},render:function(){var e,n,t,a,i,s,l,r,o,u,p,d,h,c,m,f,g,v,y,w,b,_,x,k,S,C,O,T,V,D,U,E,M,H,R,A,N,P;if(s=jQuery.inArray(this.model.method,this.model.supportedSubmitMethods())>=0,s||(this.model.isReadOnly=!0),this.model.description=this.model.description||this.model.notes,this.model.description&&(this.model.description=this.model.description.replace(/(?:\r\n|\r|\n)/g,"
        ")),this.model.oauth=null,f=this.model.authorizations||this.model.security)if(Array.isArray(f))for(o=0,u=f.length;u>o;o++){t=f[o];for(r in t){n=t[r];for(e in this.auths)if(n=this.auths[e],"oauth2"===n.type){this.model.oauth={},this.model.oauth.scopes=[],x=n.value.scopes;for(l in x)N=x[l],E=t[r].indexOf(l),E>=0&&(v={scope:l,description:N},this.model.oauth.scopes.push(v))}}}else for(l in f)if(N=f[l],"oauth2"===l)for(null===this.model.oauth&&(this.model.oauth={}),void 0===this.model.oauth.scopes&&(this.model.oauth.scopes=[]),m=0,p=N.length;p>m;m++)v=N[m],this.model.oauth.scopes.push(v);if("undefined"!=typeof this.model.responses){this.model.responseMessages=[],k=this.model.responses;for(a in k)P=k[a],D=null,U=this.model.responses[a].schema,U&&U.$ref&&(D=U.$ref,0===D.indexOf("#/definitions/")&&(D=D.substring("#/definitions/".length))),this.model.responseMessages.push({code:a,message:P.description,responseModel:D})}if("undefined"==typeof this.model.responseMessages&&(this.model.responseMessages=[]),M=null,this.model.successResponse){R=this.model.successResponse;for(r in R)P=R[r],this.model.successCode=r,"object"==typeof P&&"function"==typeof P.createJSONSample&&(M={sampleJSON:JSON.stringify(P.createJSONSample(),void 0,2),isParam:!1,signature:P.getMockSignature()})}else this.model.responseClassSignature&&"string"!==this.model.responseClassSignature&&(M={sampleJSON:this.model.responseSampleJSON,isParam:!1,signature:this.model.responseClassSignature});for($(this.el).html(Handlebars.templates.operation(this.model)),M?(V=new SwaggerUi.Views.SignatureView({model:M,router:this.router,tagName:"div"}),$(".model-signature",$(this.el)).append(V.render().el)):(this.model.responseClassSignature="string",$(".model-signature",$(this.el)).html(this.model.type)),i={isParam:!1},i.consumes=this.model.consumes,i.produces=this.model.produces,S=this.model.parameters,g=0,d=S.length;d>g;g++)w=S[g],A=w.type||w.dataType||"","undefined"==typeof A&&(D=w.schema,D&&D.$ref&&(_=D.$ref,A=0===_.indexOf("#/definitions/")?_.substring("#/definitions/".length):_)),A&&"file"===A.toLowerCase()&&(i.consumes||(i.consumes="multipart/form-data")),w.type=A;for(T=new SwaggerUi.Views.ResponseContentTypeView({model:i,router:this.router}),$(".response-content-type",$(this.el)).append(T.render().el),C=this.model.parameters,y=0,h=C.length;h>y;y++)w=C[y],this.addParameter(w,i.consumes);for(O=this.model.responseMessages,b=0,c=O.length;c>b;b++)H=O[b],this.addStatusCode(H);return this},addParameter:function(e,n){e.consumes=n;var t=new SwaggerUi.Views.ParameterView({model:e,tagName:"tr",readOnly:this.model.isReadOnly});$(".operation-params",$(this.el)).append(t.render().el)},addStatusCode:function(e){var n=new SwaggerUi.Views.StatusCodeView({model:e,tagName:"tr",router:this.router});$(".operation-status",$(this.el)).append(n.render().el)},submitOperation:function(e){var n,t,a,i,s,l,r,o,u,p,d,h,c,m,f,g;if(null!==e&&e.preventDefault(),t=$(".sandbox",$(this.el)),n=!0,t.find("input.required").each(function(){$(this).removeClass("error"),""===jQuery.trim($(this).val())&&($(this).addClass("error"),$(this).wiggle({callback:function(e){return function(){$(e).focus()}}(this)}),n=!1)}),t.find("textarea.required").each(function(){$(this).removeClass("error"),""===jQuery.trim($(this).val())&&($(this).addClass("error"),$(this).wiggle({callback:function(e){return function(){return $(e).focus()}}(this)}),n=!1)}),n){for(u={},h={parent:this},a=!1,c=t.find("input"),i=0,s=c.length;s>i;i++)d=c[i],null!==d.value&&jQuery.trim(d.value).length>0&&(u[d.name]=d.value),"file"===d.type&&(u[d.name]=d.files[0],a=!0);for(m=t.find("textarea"),o=0,l=m.length;l>o;o++)d=m[o],null!==d.value&&jQuery.trim(d.value).length>0&&(u[d.name]=d.value);for(f=t.find("select"),p=0,r=f.length;r>p;p++)d=f[p],g=this.getSelectedValue(d),null!==g&&jQuery.trim(g).length>0&&(u[d.name]=g);return h.responseContentType=$("div select[name=responseContentType]",$(this.el)).val(),h.requestContentType=$("div select[name=parameterContentType]",$(this.el)).val(),$(".response_throbber",$(this.el)).show(),a?this.handleFileUpload(u,t):this.model["do"](u,h,this.showCompleteStatus,this.showErrorStatus,this)}},success:function(e,n){n.showCompleteStatus(e)},handleFileUpload:function(e,n){var t,a,i,s,l,r,o,u,p,d,h,c,m,f,g,v,y,w,b;for(v=n.serializeArray(),s=0,l=v.length;l>s;s++)h=v[s],null!==h.value&&jQuery.trim(h.value).length>0&&(e[h.name]=h.value);for(t=new FormData,g=0,y=this.model.parameters,p=0,r=y.length;r>p;p++)f=y[p],("form"===f.paramType||"formData"===f["in"])&&"file"!==f.type.toLowerCase()&&void 0!==e[f.name]&&t.append(f.name,e[f.name]);for(i={},w=this.model.parameters,d=0,o=w.length;o>d;d++)f=w[d],"header"===f.paramType&&(i[f.name]=e[f.name]);for(b=n.find('input[type~="file"]'),m=0,u=b.length;u>m;m++)a=b[m],"undefined"!=typeof a.files[0]&&(t.append($(a).attr("name"),a.files[0]),g+=1);return this.invocationUrl=this.model.supportHeaderParams()?(i=this.model.getHeaderParams(e),delete i["Content-Type"],this.model.urlify(e,!1)):this.model.urlify(e,!0),$(".request_url",$(this.el)).html("
        "),$(".request_url pre",$(this.el)).text(this.invocationUrl),c={type:this.model.method,url:this.invocationUrl,headers:i,data:t,dataType:"json",contentType:!1,processData:!1,error:function(e){return function(n){return e.showErrorStatus(e.wrap(n),e)}}(this),success:function(e){return function(n){return e.showResponse(n,e)}}(this),complete:function(e){return function(n){return e.showCompleteStatus(e.wrap(n),e)}}(this)},window.authorizations&&window.authorizations.apply(c),0===g&&c.data.append("fake","true"),jQuery.ajax(c),!1},wrap:function(e){var n,t,a,i,s,l,r;for(a={},t=e.getAllResponseHeaders().split("\r"),s=0,l=t.length;l>s;s++)i=t[s],n=i.match(/^([^:]*?):(.*)$/),n||(n=[]),n.shift(),void 0!==n[0]&&void 0!==n[1]&&(a[n[0].trim()]=n[1].trim());return r={},r.content={},r.content.data=e.responseText,r.headers=a,r.request={},r.request.url=this.invocationUrl,r.status=e.status,r},getSelectedValue:function(e){if(e.multiple){for(var n=[],t=0,a=e.options.length;a>t;t++){var i=e.options[t];i.selected&&n.push(i.value)}return n.length>0?n:null}return e.value},hideResponse:function(e){e&&e.preventDefault(),$(".response",$(this.el)).slideUp(),$(".response_hider",$(this.el)).fadeOut()},showResponse:function(e){var n=JSON.stringify(e,null,"	").replace(/\n/g,"
        ");$(".response_body",$(this.el)).html(_.escape(n))},showErrorStatus:function(e,n){n.showStatus(e)},showCompleteStatus:function(e,n){n.showStatus(e)},formatXml:function(e){var n,t,a,i,s,l,r,o,u,p,d,h,c;for(d=/(>)(<)(\/*)/g,c=/[ ]*(.*)[ ]+\n/g,n=/(<.+>)(.+\n)/g,e=e.replace(d,"$1\n$2$3").replace(c,"$1\n").replace(n,"$1\n$2"),p=0,a="",o=e.split("\n"),i=0,l="other",h={"single->single":0,"single->closing":-1,"single->opening":0,"single->other":0,"closing->single":0,"closing->closing":-1,"closing->opening":0,"closing->other":0,"opening->single":1,"opening->closing":0,"opening->opening":1,"opening->other":1,"other->single":0,"other->closing":-1,"other->opening":0,"other->other":0},t=function(e){var n,t,s,r,o,u,p;u={single:Boolean(e.match(/<.+\/>/)),closing:Boolean(e.match(/<\/.+>/)),opening:Boolean(e.match(/<[^!?].*>/))},o=function(){var e;e=[];for(s in u)p=u[s],p&&e.push(s);return e}()[0],o=void 0===o?"other":o,n=l+"->"+o,l=o,r="",i+=h[n],r=function(){var e,n,a;for(a=[],t=e=0,n=i;n>=0?n>e:e>n;t=n>=0?++e:--e)a.push(" ");return a}().join(""),"opening->closing"===n?a=a.substr(0,a.length-1)+e+"\n":a+=r+e+"\n"},s=0,r=o.length;r>s;s++)u=o[s],t(u);return a},showStatus:function(e){var n,t;void 0===e.content?(t=e.data,n=e.url):(t=e.content.data,n=e.request.url);var a=e.headers,i=null;a&&(i=a["Content-Type"]||a["content-type"],i&&(i=i.split(";")[0].trim())),$(".response_body",$(this.el)).removeClass("json"),$(".response_body",$(this.el)).removeClass("xml");var s,l,r=function(e){var n=document.createElement("audio");return!(!n.canPlayType||!n.canPlayType(e).replace(/no/,""))};if(t)if("application/json"===i||/\+json$/.test(i)){var o=null;try{o=JSON.stringify(JSON.parse(t),null," ")}catch(u){o="can't parse JSON. Raw result:\n\n"+t}l=$("").text(o),s=$('
        ').append(l)}else"application/xml"===i||/\+xml$/.test(i)?(l=$("").text(this.formatXml(t)),s=$('
        ').append(l)):"text/html"===i?(l=$("").html(_.escape(t)),s=$('
        ').append(l)):/^image\//.test(i)?s=$("").attr("src",n):/^audio\//.test(i)&&r(i)?s=$("
        '),this.options=e,marked.setOptions({gfm:!0});var n=this;this.options.success=function(){return n.render()},this.options.progress=function(e){return n.showMessage(e)},this.options.failure=function(e){return n.onLoadFailure(e)},this.headerView=new SwaggerUi.Views.HeaderView({el:$("#header")}),this.headerView.on("update-swagger-ui",function(e){return n.updateSwaggerUi(e)})},setOption:function(e,n){this.options[e]=n},getOption:function(e){return this.options[e]},updateSwaggerUi:function(e){this.options.url=e.url,this.load()},load:function(){this.mainView&&this.mainView.clear();var e=this.options.url;e&&0!==e.indexOf("http")&&(e=this.buildUrl(window.location.href.toString(),e)),this.options.url=e,this.headerView.update(e),this.api=new SwaggerClient(this.options)},collapseAll:function(){Docs.collapseEndpointListForResource("")},listAll:function(){Docs.collapseOperationsForResource("")},expandAll:function(){Docs.expandOperationsForResource("")},render:function(){switch(this.showMessage("Finished Loading Resource Information. Rendering Swagger UI..."),this.mainView=new SwaggerUi.Views.MainView({model:this.api,el:$("#"+this.dom_id),swaggerOptions:this.options,router:this}).render(),this.showMessage(),this.options.docExpansion){case"full":this.expandAll();break;case"list":this.listAll()}this.renderGFM(),this.options.onComplete&&this.options.onComplete(this.api,this),setTimeout(Docs.shebang.bind(this),100)},buildUrl:function(e,n){if(0===n.indexOf("/")){var t=e.split("/");return e=t[0]+"//"+t[2],e+n}var a=e.length;return e.indexOf("?")>-1&&(a=Math.min(a,e.indexOf("?"))),e.indexOf("#")>-1&&(a=Math.min(a,e.indexOf("#"))),e=e.substring(0,a),-1!==e.indexOf("/",e.length-1)?e+n:e+"/"+n},showMessage:function(e){void 0===e&&(e=""),$("#message-bar").removeClass("message-fail"),$("#message-bar").addClass("message-success"),$("#message-bar").html(e)},onLoadFailure:function(e){void 0===e&&(e=""),$("#message-bar").removeClass("message-success"),$("#message-bar").addClass("message-fail");var n=$("#message-bar").html(e);return this.options.onFailure&&this.options.onFailure(e),n},renderGFM:function(){$(".markdown").each(function(){$(this).html(marked($(this).html()))})}}),window.SwaggerUi.Views={},function(){function e(e){"console"in window&&"function"==typeof window.console.warn&&console.warn(e)}window.authorizations={add:function(){if(e("using window.authorizations is depreciated. Please use waggerUi.api.clientAuthorizations.add()."),"undefined"==typeof window.swaggerUi)throw new TypeError("window.swaggerUi is not defined");window.swaggerUi instanceof SwaggerUi&&window.swaggerUi.api.clientAuthorizations.add.apply(window.swaggerUi.api.clientAuthorizations,arguments)}},window.ApiKeyAuthorization=function(){e("window.ApiKeyAuthorization is depreciated. Please use SwaggerClient.ApiKeyAuthorization."),SwaggerClient.ApiKeyAuthorization.apply(window,arguments)},window.PasswordAuthorization=function(){e("window.PasswordAuthorization is depreciated. Please use SwaggerClient.PasswordAuthorization."),SwaggerClient.PasswordAuthorization.apply(window,arguments)}}(),this.Handlebars=this.Handlebars||{},this.Handlebars.templates=this.Handlebars.templates||{},this.Handlebars.templates.apikey_button_view=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return"\n
        \n
        \n
        "+r((i=null!=(i=n.keyName||(null!=e?e.keyName:e))?i:l,typeof i===s?i.call(e,{name:"keyName",hash:{},data:a}):i))+'
        \n \n \n
        \n
        \n\n'},useData:!0}),this.Handlebars.templates.basic_auth_button_view=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(){return'
        \n
        \n
        \n
        Username
        \n \n
        Password
        \n \n \n
        \n
        \n\n'},useData:!0}),this.Handlebars.templates.content_type=Handlebars.template({1:function(e,n,t,a){var i,s="";return i=n.each.call(e,null!=e?e.produces:e,{name:"each",hash:{},fn:this.program(2,a),inverse:this.noop,data:a}),null!=i&&(s+=i),s},2:function(e){var n,t=this.lambda,a=' \n"},4:function(){return' \n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s='\n\n"},useData:!0}),$(function(){$.fn.vAlign=function(){return this.each(function(){var e=$(this).height(),n=$(this).parent().height(),t=(n-e)/2;$(this).css("margin-top",t)})},$.fn.stretchFormtasticInputWidthToParent=function(){return this.each(function(){var e=$(this).closest("form").innerWidth(),n=parseInt($(this).closest("form").css("padding-left"),10)+parseInt($(this).closest("form").css("padding-right"),10),t=parseInt($(this).css("padding-left"),10)+parseInt($(this).css("padding-right"),10);$(this).css("width",e-n-t)})},$("form.formtastic li.string input, form.formtastic textarea").stretchFormtasticInputWidthToParent(),$("ul.downplayed li div.content p").vAlign(),$("form.sandbox").submit(function(){var e=!0;return $(this).find("input.required").each(function(){$(this).removeClass("error"),""===$(this).val()&&($(this).addClass("error"),$(this).wiggle(),e=!1)}),e})}),Function.prototype.bind&&console&&"object"==typeof console.log&&["log","info","warn","error","assert","dir","clear","profile","profileEnd"].forEach(function(e){console[e]=this.bind(console[e],console)},Function.prototype.call),window.Docs={shebang:function(){var e=$.param.fragment().split("/");switch(e.shift(),e=_.map(e,decodeURIComponent),e.length){case 1:var n="resource_"+e[0];Docs.expandEndpointListForResource(e[0]),$('[id="'+n+'"]').slideto({highlight:!1});break;case 2:Docs.expandEndpointListForResource(e[0]);var t=e.join("_"),a=t+"_content";Docs.expandOperation($('[id="'+a+'"]')),$('[id="'+t+'"]').slideto({highlight:!1})}},toggleEndpointListForResource:function(e){var n=$("li#resource_"+Docs.escapeResourceName(e)+" ul.endpoints");n.is(":visible")?Docs.collapseEndpointListForResource(e):Docs.expandEndpointListForResource(e)},expandEndpointListForResource:function(e){var e=Docs.escapeResourceName(e);if(""==e)return void $(".resource ul.endpoints").slideDown();$("li#resource_"+e).addClass("active");var n=$("li#resource_"+e+" ul.endpoints");n.slideDown()},collapseEndpointListForResource:function(e){var e=Docs.escapeResourceName(e);if(""==e)return void $(".resource ul.endpoints").slideUp();$("li#resource_"+e).removeClass("active");var n=$("li#resource_"+e+" ul.endpoints");n.slideUp()},expandOperationsForResource:function(e){return Docs.expandEndpointListForResource(e),""==e?void $(".resource ul.endpoints li.operation div.content").slideDown():void $("li#resource_"+Docs.escapeResourceName(e)+" li.operation div.content").each(function(){Docs.expandOperation($(this))})},collapseOperationsForResource:function(e){return Docs.expandEndpointListForResource(e),""==e?void $(".resource ul.endpoints li.operation div.content").slideUp():void $("li#resource_"+Docs.escapeResourceName(e)+" li.operation div.content").each(function(){Docs.collapseOperation($(this))})},escapeResourceName:function(e){return e.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g,"\\$&")},expandOperation:function(e){e.slideDown()},collapseOperation:function(e){e.slideUp()}},Handlebars.registerHelper("sanitize",function(e){return e=e.replace(/)<[^<]*)*<\/script>/gi,""),new Handlebars.SafeString(e)}),this.Handlebars.templates.main=Handlebars.template({1:function(e,n,t,a){var i,s=this.lambda,l=this.escapeExpression,r='
        '+l(s(null!=(i=null!=e?e.info:e)?i.title:i,e))+'
        \r\n
        ';return i=s(null!=(i=null!=e?e.info:e)?i.description:i,e),null!=i&&(r+=i),r+="
        \r\n",i=n["if"].call(e,null!=e?e.externalDocs:e,{name:"if",hash:{},fn:this.program(2,a),inverse:this.noop,data:a}),null!=i&&(r+=i),r+=" ",i=n["if"].call(e,null!=(i=null!=e?e.info:e)?i.termsOfServiceUrl:i,{name:"if",hash:{},fn:this.program(4,a),inverse:this.noop,data:a}),null!=i&&(r+=i),r+="\r\n ",i=n["if"].call(e,null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.name:i,{name:"if",hash:{},fn:this.program(6,a),inverse:this.noop,data:a}),null!=i&&(r+=i),r+="\r\n ",i=n["if"].call(e,null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.url:i,{name:"if",hash:{},fn:this.program(8,a),inverse:this.noop,data:a}),null!=i&&(r+=i),r+="\r\n ",i=n["if"].call(e,null!=(i=null!=(i=null!=e?e.info:e)?i.contact:i)?i.email:i,{name:"if",hash:{},fn:this.program(10,a),inverse:this.noop,data:a}),null!=i&&(r+=i),r+="\r\n ",i=n["if"].call(e,null!=(i=null!=e?e.info:e)?i.license:i,{name:"if",hash:{},fn:this.program(12,a),inverse:this.noop,data:a}),null!=i&&(r+=i),r+"\r\n"},2:function(e){var n,t=this.lambda,a=this.escapeExpression;return"
        More documentations
        \r\n

        "+a(t(null!=(n=null!=e?e.externalDocs:e)?n.description:n,e))+'

        \r\n '+a(t(null!=(n=null!=e?e.externalDocs:e)?n.url:n,e))+"\r\n"},4:function(e){var n,t=this.lambda,a=this.escapeExpression;return''},6:function(e){var n,t=this.lambda,a=this.escapeExpression;return"
        Created by "+a(t(null!=(n=null!=(n=null!=e?e.info:e)?n.contact:n)?n.name:n,e))+"
        "},8:function(e){var n,t=this.lambda,a=this.escapeExpression;return""},10:function(e){var n,t=this.lambda,a=this.escapeExpression;return"'},12:function(e){var n,t=this.lambda,a=this.escapeExpression;return""},14:function(e){var n,t=this.lambda,a=this.escapeExpression;return' , api version: '+a(t(null!=(n=null!=e?e.info:e)?n.version:n,e))+"\r\n "},16:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return' \r\n \r\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s,l="function",r=n.helperMissing,o=this.escapeExpression,u="
        \r\n";return i=n["if"].call(e,null!=e?e.info:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.noop,data:a}),null!=i&&(u+=i),u+="
        \r\n
        \r\n
          \r\n\r\n
          \r\n
          \r\n
          \r\n

          [ base url: "+o((s=null!=(s=n.basePath||(null!=e?e.basePath:e))?s:r,typeof s===l?s.call(e,{name:"basePath",hash:{},data:a}):s))+"\r\n",i=n["if"].call(e,null!=(i=null!=e?e.info:e)?i.version:i,{name:"if",hash:{},fn:this.program(14,a),inverse:this.noop,data:a}),null!=i&&(u+=i),u+="]\r\n",i=n["if"].call(e,null!=e?e.validatorUrl:e,{name:"if",hash:{},fn:this.program(16,a),inverse:this.noop,data:a}),null!=i&&(u+=i),u+"

          \r\n
          \r\n
          \r\n"},useData:!0}),this.Handlebars.templates.operation=Handlebars.template({1:function(){return"deprecated"},3:function(){return"

          Warning: Deprecated

          \r\n"},5:function(e,n,t,a){var i,s,l="function",r=n.helperMissing,o='

          Implementation Notes

          \r\n

          ';return s=null!=(s=n.description||(null!=e?e.description:e))?s:r,i=typeof s===l?s.call(e,{name:"description",hash:{},data:a}):s,null!=i&&(o+=i),o+"

          \r\n"},7:function(){return'
          \r\n '},9:function(e,n,t,a){var i,s=' \r\n"},10:function(e){var n,t=this.lambda,a=this.escapeExpression,i="
          "+a(t(null!=e?e.scope:e,e))+"
          \r\n"},12:function(){return"
          "},14:function(){return'
          \r\n \r\n
          \r\n'},16:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return"

          Response Class (Status "+r((i=null!=(i=n.successCode||(null!=e?e.successCode:e))?i:l,typeof i===s?i.call(e,{name:"successCode",hash:{},data:a}):i))+')

          \r\n

          \r\n
          \r\n
          \r\n'},18:function(){return'

          Parameters

          \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n
          ParameterValueDescriptionParameter TypeData Type
          \r\n'},20:function(){return"
          \r\n

          Response Messages

          \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n
          HTTP Status CodeReasonResponse ModelHeaders
          \r\n"},22:function(){return""},24:function(){return"
          \r\n \r\n \r\n \r\n
          \r\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s,l,r="function",o=n.helperMissing,u=this.escapeExpression,p=n.blockHelperMissing,d="\r\n
            \r\n
          • \r\n \r\n \r\n
          • \r\n
          \r\n"},useData:!0}),this.Handlebars.templates.param=Handlebars.template({1:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(2,a),inverse:this.program(4,a),data:a}),null!=i&&(s+=i),s},2:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return' \n
          \n'},4:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(5,a),inverse:this.program(7,a),data:a}),null!=i&&(s+=i),s},5:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n
          \n
          \n'},7:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n
          \n
          \n'},9:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(2,a),inverse:this.program(10,a),data:a}),null!=i&&(s+=i),s},10:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(11,a),inverse:this.program(13,a),data:a}),null!=i&&(s+=i),s},11:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n"},13:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s,l="function",r=n.helperMissing,o=this.escapeExpression,u=""+o((s=null!=(s=n.name||(null!=e?e.name:e))?s:r,typeof s===l?s.call(e,{name:"name",hash:{},data:a}):s))+"\n\n\n";return i=n["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.program(9,a),data:a}),null!=i&&(u+=i),u+='\n\n',s=null!=(s=n.description||(null!=e?e.description:e))?s:r,i=typeof s===l?s.call(e,{name:"description",hash:{},data:a}):s,null!=i&&(u+=i),u+="\n",s=null!=(s=n.paramType||(null!=e?e.paramType:e))?s:r,i=typeof s===l?s.call(e,{name:"paramType",hash:{},data:a}):s,null!=i&&(u+=i),u+'\n\n \n\n'},useData:!0}),this.Handlebars.templates.param_list=Handlebars.template({1:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return""+r((i=null!=(i=n.name||(null!=e?e.name:e))?i:l,typeof i===s?i.call(e,{name:"name",hash:{},data:a}):i))+"\n"},3:function(){return" multiple='multiple'"},5:function(){return""},7:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(5,a),inverse:this.program(8,a),data:a}),null!=i&&(s+=i),s},8:function(e,n,t,a){var i,s=n.helperMissing,l="";return i=(n.isArray||e&&e.isArray||s).call(e,e,{name:"isArray",hash:{},fn:this.program(5,a),inverse:this.program(9,a),data:a}),null!=i&&(l+=i),l},9:function(){return" \n"},11:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e.isDefault:e,{name:"if",hash:{},fn:this.program(12,a),inverse:this.program(14,a),data:a}),null!=i&&(s+=i),s},12:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return' \n"},14:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s,l="function",r=n.helperMissing,o=this.escapeExpression,u="";return i=n["if"].call(e,null!=e?e.required:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.noop,data:a}),null!=i&&(u+=i),u+=""+o((s=null!=(s=n.name||(null!=e?e.name:e))?s:r,typeof s===l?s.call(e,{name:"name",hash:{},data:a}):s))+"\n\n \n\n',s=null!=(s=n.description||(null!=e?e.description:e))?s:r,i=typeof s===l?s.call(e,{name:"description",hash:{},data:a}):s,null!=i&&(u+=i),u+="\n",s=null!=(s=n.paramType||(null!=e?e.paramType:e))?s:r,i=typeof s===l?s.call(e,{name:"paramType",hash:{},data:a}):s,null!=i&&(u+=i),u+'\n'},useData:!0}),this.Handlebars.templates.param_readonly=Handlebars.template({1:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n"},3:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(4,a),inverse:this.program(6,a),data:a}),null!=i&&(s+=i),s},4:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" "+r((i=null!=(i=n["default"]||(null!=e?e["default"]:e))?i:l,typeof i===s?i.call(e,{name:"default",hash:{},data:a}):i))+"\n"},6:function(){return" (empty)\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s,l="function",r=n.helperMissing,o=this.escapeExpression,u=""+o((s=null!=(s=n.name||(null!=e?e.name:e))?s:r,typeof s===l?s.call(e,{name:"name",hash:{},data:a}):s))+"\n\n";return i=n["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.program(3,a),data:a}),null!=i&&(u+=i),u+='\n',s=null!=(s=n.description||(null!=e?e.description:e))?s:r,i=typeof s===l?s.call(e,{name:"description",hash:{},data:a}):s,null!=i&&(u+=i),u+="\n",s=null!=(s=n.paramType||(null!=e?e.paramType:e))?s:r,i=typeof s===l?s.call(e,{name:"paramType",hash:{},data:a}):s,null!=i&&(u+=i),u+'\n\n'},useData:!0}),this.Handlebars.templates.param_readonly_required=Handlebars.template({1:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n"},3:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(4,a),inverse:this.program(6,a),data:a}),null!=i&&(s+=i),s},4:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" "+r((i=null!=(i=n["default"]||(null!=e?e["default"]:e))?i:l,typeof i===s?i.call(e,{name:"default",hash:{},data:a}):i))+"\n"},6:function(){return" (empty)\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s,l="function",r=n.helperMissing,o=this.escapeExpression,u=""+o((s=null!=(s=n.name||(null!=e?e.name:e))?s:r,typeof s===l?s.call(e,{name:"name",hash:{},data:a}):s))+"\n\n";return i=n["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.program(3,a),data:a}),null!=i&&(u+=i),u+='\n',s=null!=(s=n.description||(null!=e?e.description:e))?s:r,i=typeof s===l?s.call(e,{name:"description",hash:{},data:a}):s,null!=i&&(u+=i),u+="\n",s=null!=(s=n.paramType||(null!=e?e.paramType:e))?s:r,i=typeof s===l?s.call(e,{name:"paramType",hash:{},data:a}):s,null!=i&&(u+=i),u+'\n\n'},useData:!0}),this.Handlebars.templates.param_required=Handlebars.template({1:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(2,a),inverse:this.program(4,a),data:a}),null!=i&&(s+=i),s},2:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return' \n"},4:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(5,a),inverse:this.program(7,a),data:a}),null!=i&&(s+=i),s},5:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n
          \n
          \n' +},7:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n
          \n
          \n'},9:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(10,a),inverse:this.program(12,a),data:a}),null!=i&&(s+=i),s},10:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n"},12:function(e,n,t,a){var i,s="";return i=n["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(13,a),inverse:this.program(15,a),data:a}),null!=i&&(s+=i),s},13:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n"},15:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return" \n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s,l="function",r=n.helperMissing,o=this.escapeExpression,u=""+o((s=null!=(s=n.name||(null!=e?e.name:e))?s:r,typeof s===l?s.call(e,{name:"name",hash:{},data:a}):s))+"\n\n";return i=n["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.program(9,a),data:a}),null!=i&&(u+=i),u+='\n\n ',s=null!=(s=n.description||(null!=e?e.description:e))?s:r,i=typeof s===l?s.call(e,{name:"description",hash:{},data:a}):s,null!=i&&(u+=i),u+="\n\n",s=null!=(s=n.paramType||(null!=e?e.paramType:e))?s:r,i=typeof s===l?s.call(e,{name:"paramType",hash:{},data:a}):s,null!=i&&(u+=i),u+'\n\n'},useData:!0}),this.Handlebars.templates.parameter_content_type=Handlebars.template({1:function(e,n,t,a){var i,s="";return i=n.each.call(e,null!=e?e.consumes:e,{name:"each",hash:{},fn:this.program(2,a),inverse:this.noop,data:a}),null!=i&&(s+=i),s},2:function(e){var n,t=this.lambda,a=' \n"},4:function(){return' \n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s='\n\n"},useData:!0}),this.Handlebars.templates.resource=Handlebars.template({1:function(){return" : "},3:function(e,n,t,a){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return"
        • \r\n Raw\r\n
        • \r\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s,l,r="function",o=n.helperMissing,u=this.escapeExpression,p=n.blockHelperMissing,d="
          \r\n

          \r\n '+u((s=null!=(s=n.name||(null!=e?e.name:e))?s:o,typeof s===r?s.call(e,{name:"name",hash:{},data:a}):s))+" ";return s=null!=(s=n.summary||(null!=e?e.summary:e))?s:o,l={name:"summary",hash:{},fn:this.program(1,a),inverse:this.noop,data:a},i=typeof s===r?s.call(e,l):s,n.summary||(i=p.call(e,i,l)),null!=i&&(d+=i),s=null!=(s=n.summary||(null!=e?e.summary:e))?s:o,i=typeof s===r?s.call(e,{name:"summary",hash:{},data:a}):s,null!=i&&(d+=i),d+="\r\n

          \r\n \r\n
          \r\n\r\n"},useData:!0}),this.Handlebars.templates.response_content_type=Handlebars.template({1:function(e,n,t,a){var i,s="";return i=n.each.call(e,null!=e?e.produces:e,{name:"each",hash:{},fn:this.program(2,a),inverse:this.noop,data:a}),null!=i&&(s+=i),s},2:function(e){var n,t=this.lambda,a=' \n"},4:function(){return' \n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s='\n\n"},useData:!0}),this.Handlebars.templates.signature=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s,l="function",r=n.helperMissing,o=this.escapeExpression,u='
          \n\n
          \n\n
          \n
          \n ';return s=null!=(s=n.signature||(null!=e?e.signature:e))?s:r,i=typeof s===l?s.call(e,{name:"signature",hash:{},data:a}):s,null!=i&&(u+=i),u+'\n
          \n\n
          \n
          '+o((s=null!=(s=n.sampleJSON||(null!=e?e.sampleJSON:e))?s:r,typeof s===l?s.call(e,{name:"sampleJSON",hash:{},data:a}):s))+'
          \n \n
          \n
          \n\n'},useData:!0}),this.Handlebars.templates.status_code=Handlebars.template({1:function(e,n,t,a){var i=this.lambda,s=this.escapeExpression;return" \r\n "+s(i(a&&a.key,e))+"\r\n "+s(i(null!=e?e.description:e,e))+"\r\n "+s(i(null!=e?e.type:e,e))+"\r\n \r\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,t,a){var i,s,l="function",r=n.helperMissing,o=this.escapeExpression,u=""+o((s=null!=(s=n.code||(null!=e?e.code:e))?s:r,typeof s===l?s.call(e,{name:"code",hash:{},data:a}):s))+"\r\n";return s=null!=(s=n.message||(null!=e?e.message:e))?s:r,i=typeof s===l?s.call(e,{name:"message",hash:{},data:a}):s,null!=i&&(u+=i),u+='\r\n\r\n\r\n \r\n \r\n',i=n.each.call(e,null!=e?e.headers:e,{name:"each",hash:{},fn:this.program(1,a),inverse:this.noop,data:a}),null!=i&&(u+=i),u+" \r\n
          \r\n"},useData:!0}),SwaggerUi.Views.ApiKeyButton=Backbone.View.extend({events:{"click #apikey_button":"toggleApiKeyContainer","click #apply_api_key":"applyApiKey"},initialize:function(e){this.options=e||{},this.router=this.options.router},render:function(){var e=this.template();return $(this.el).html(e(this.model)),this},applyApiKey:function(){var e=new SwaggerClient.ApiKeyAuthorization(this.model.name,$("#input_apiKey_entry").val(),this.model["in"]);this.router.api.clientAuthorizations.add(this.model.name,e),this.router.load(),$("#apikey_container").show()},toggleApiKeyContainer:function(){if($("#apikey_container").length){var e=$("#apikey_container").first();e.is(":visible")?e.hide():($(".auth_container").hide(),e.show())}},template:function(){return Handlebars.templates.apikey_button_view}}),SwaggerUi.Views.BasicAuthButton=Backbone.View.extend({initialize:function(e){this.options=e||{},this.router=this.options.router},render:function(){var e=this.template();return $(this.el).html(e(this.model)),this},events:{"click #basic_auth_button":"togglePasswordContainer","click #apply_basic_auth":"applyPassword"},applyPassword:function(){var e=$(".input_username").val(),n=$(".input_password").val(),t=new SwaggerClient.PasswordAuthorization("basic",e,n);this.router.api.clientAuthorizations.add(this.model.type,t),this.router.load(),$("#basic_auth_container").hide()},togglePasswordContainer:function(){if($("#basic_auth_container").length){var e=$("#basic_auth_container").show();e.is(":visible")?e.slideUp():($(".auth_container").hide(),e.show())}},template:function(){return Handlebars.templates.basic_auth_button_view}}),SwaggerUi.Views.ContentTypeView=Backbone.View.extend({initialize:function(){},render:function(){return $(this.el).html(Handlebars.templates.content_type(this.model)),$("label[for=contentType]",$(this.el)).text("Response Content Type"),this}}),SwaggerUi.Views.HeaderView=Backbone.View.extend({events:{"click #show-pet-store-icon":"showPetStore","click #show-wordnik-dev-icon":"showWordnikDev","click #explore":"showCustom","keyup #input_baseUrl":"showCustomOnKeyup","keyup #input_apiKey":"showCustomOnKeyup"},initialize:function(){},showPetStore:function(){this.trigger("update-swagger-ui",{url:"http://petstore.swagger.wordnik.com/api/api-docs"})},showWordnikDev:function(){this.trigger("update-swagger-ui",{url:"http://api.wordnik.com/v4/resources.json"})},showCustomOnKeyup:function(e){13===e.keyCode&&this.showCustom()},showCustom:function(e){e&&e.preventDefault(),this.trigger("update-swagger-ui",{url:$("#input_baseUrl").val(),apiKey:$("#input_apiKey").val()})},update:function(e,n,t){void 0===t&&(t=!1),$("#input_baseUrl").val(e),t&&this.trigger("update-swagger-ui",{url:e})}}),SwaggerUi.Views.MainView=Backbone.View.extend({initialize:function(e){e=e||{},this.router=e.router,this.model.auths=[];var n,t;for(n in this.model.securityDefinitions)t=this.model.securityDefinitions[n],this.model.auths.push({name:n,type:t.type,value:t});"2.0"===this.model.swaggerVersion&&(this.model.validatorUrl="validatorUrl"in e.swaggerOptions?e.swaggerOptions.validatorUrl:this.model.url.indexOf("localhost")>0?null:"http://online.swagger.io/validator")},render:function(){if(this.model.securityDefinitions)for(var e in this.model.securityDefinitions){var n,t=this.model.securityDefinitions[e];"apiKey"===t.type&&0===$("#apikey_button").length&&(n=new SwaggerUi.Views.ApiKeyButton({model:t,router:this.router}).render().el,$(".auth_main_container").append(n)),"basicAuth"===t.type&&0===$("#basic_auth_button").length&&(n=new SwaggerUi.Views.BasicAuthButton({model:t,router:this.router}).render().el,$(".auth_main_container").append(n))}$(this.el).html(Handlebars.templates.main(this.model));for(var a={},i=0,s=0;sl&&(t=l-o),i>t&&(t=i),a+u>r&&(a=r-u),s>a&&(a=s);var p={};p.top=a,p.left=t,n.css(p),$(e.currentTarget.parentNode).find("#api_information_panel").show()},mouseExit:function(e){$(e.currentTarget.parentNode).find("#api_information_panel").hide()},render:function(){var e,n,t,a,i,s,l,r,o,u,p,d,h,c,m,f,g,v,y,w,b,_,x,k,S,C,O,T,V,D,U,E,M,H,R,P,A,N;if(s=jQuery.inArray(this.model.method,this.model.supportedSubmitMethods())>=0,s||(this.model.isReadOnly=!0),this.model.description=this.model.description||this.model.notes,this.model.description&&(this.model.description=this.model.description.replace(/(?:\r\n|\r|\n)/g,"
          ")),this.model.oauth=null,f=this.model.authorizations||this.model.security)if(Array.isArray(f))for(o=0,u=f.length;u>o;o++){t=f[o];for(r in t){n=t[r];for(e in this.auths)if(n=this.auths[e],"oauth2"===n.type){this.model.oauth={},this.model.oauth.scopes=[],x=n.value.scopes;for(l in x)A=x[l],E=t[r].indexOf(l),E>=0&&(v={scope:l,description:A},this.model.oauth.scopes.push(v))}}}else for(l in f)if(A=f[l],"oauth2"===l)for(null===this.model.oauth&&(this.model.oauth={}),void 0===this.model.oauth.scopes&&(this.model.oauth.scopes=[]),m=0,p=A.length;p>m;m++)v=A[m],this.model.oauth.scopes.push(v);if("undefined"!=typeof this.model.responses){this.model.responseMessages=[],k=this.model.responses;for(a in k)N=k[a],D=null,U=this.model.responses[a].schema,U&&U.$ref&&(D=U.$ref,0===D.indexOf("#/definitions/")&&(D=D.substring("#/definitions/".length))),this.model.responseMessages.push({code:a,message:N.description,responseModel:D})}if("undefined"==typeof this.model.responseMessages&&(this.model.responseMessages=[]),M=null,this.model.successResponse){R=this.model.successResponse;for(r in R)N=R[r],this.model.successCode=r,"object"==typeof N&&"function"==typeof N.createJSONSample&&(M={sampleJSON:JSON.stringify(N.createJSONSample(),void 0,2),isParam:!1,signature:N.getMockSignature()})}else this.model.responseClassSignature&&"string"!==this.model.responseClassSignature&&(M={sampleJSON:this.model.responseSampleJSON,isParam:!1,signature:this.model.responseClassSignature});for($(this.el).html(Handlebars.templates.operation(this.model)),M?(V=new SwaggerUi.Views.SignatureView({model:M,router:this.router,tagName:"div"}),$(".model-signature",$(this.el)).append(V.render().el)):(this.model.responseClassSignature="string",$(".model-signature",$(this.el)).html(this.model.type)),i={isParam:!1},i.consumes=this.model.consumes,i.produces=this.model.produces,S=this.model.parameters,g=0,d=S.length;d>g;g++)w=S[g],P=w.type||w.dataType||"","undefined"==typeof P&&(D=w.schema,D&&D.$ref&&(_=D.$ref,P=0===_.indexOf("#/definitions/")?_.substring("#/definitions/".length):_)),P&&"file"===P.toLowerCase()&&(i.consumes||(i.consumes="multipart/form-data")),w.type=P;for(T=new SwaggerUi.Views.ResponseContentTypeView({model:i,router:this.router}),$(".response-content-type",$(this.el)).append(T.render().el),C=this.model.parameters,y=0,h=C.length;h>y;y++)w=C[y],this.addParameter(w,i.consumes);for(O=this.model.responseMessages,b=0,c=O.length;c>b;b++)H=O[b],this.addStatusCode(H);return this},addParameter:function(e,n){e.consumes=n;var t=new SwaggerUi.Views.ParameterView({model:e,tagName:"tr",readOnly:this.model.isReadOnly});$(".operation-params",$(this.el)).append(t.render().el)},addStatusCode:function(e){var n=new SwaggerUi.Views.StatusCodeView({model:e,tagName:"tr",router:this.router});$(".operation-status",$(this.el)).append(n.render().el)},submitOperation:function(e){var n,t,a,i,s,l,r,o,u,p,d,h,c,m,f,g;if(null!==e&&e.preventDefault(),t=$(".sandbox",$(this.el)),n=!0,t.find("input.required").each(function(){$(this).removeClass("error"),""===jQuery.trim($(this).val())&&($(this).addClass("error"),$(this).wiggle({callback:function(e){return function(){$(e).focus()}}(this)}),n=!1)}),t.find("textarea.required").each(function(){$(this).removeClass("error"),""===jQuery.trim($(this).val())&&($(this).addClass("error"),$(this).wiggle({callback:function(e){return function(){return $(e).focus()}}(this)}),n=!1)}),n){for(u={},h={parent:this},a=!1,c=t.find("input"),i=0,s=c.length;s>i;i++)d=c[i],null!==d.value&&jQuery.trim(d.value).length>0&&(u[d.name]=d.value),"file"===d.type&&(u[d.name]=d.files[0],a=!0);for(m=t.find("textarea"),o=0,l=m.length;l>o;o++)d=m[o],null!==d.value&&jQuery.trim(d.value).length>0&&(u[d.name]=d.value);for(f=t.find("select"),p=0,r=f.length;r>p;p++)d=f[p],g=this.getSelectedValue(d),null!==g&&jQuery.trim(g).length>0&&(u[d.name]=g);return h.responseContentType=$("div select[name=responseContentType]",$(this.el)).val(),h.requestContentType=$("div select[name=parameterContentType]",$(this.el)).val(),$(".response_throbber",$(this.el)).show(),a?this.handleFileUpload(u,t):this.model["do"](u,h,this.showCompleteStatus,this.showErrorStatus,this)}},success:function(e,n){n.showCompleteStatus(e)},handleFileUpload:function(e,n){var t,a,i,s,l,r,o,u,p,d,h,c,m,f,g,v,y,w,b;for(v=n.serializeArray(),s=0,l=v.length;l>s;s++)h=v[s],null!==h.value&&jQuery.trim(h.value).length>0&&(e[h.name]=h.value);for(t=new FormData,g=0,y=this.model.parameters,p=0,r=y.length;r>p;p++)f=y[p],("form"===f.paramType||"formData"===f["in"])&&"file"!==f.type.toLowerCase()&&void 0!==e[f.name]&&t.append(f.name,e[f.name]);for(i={},w=this.model.parameters,d=0,o=w.length;o>d;d++)f=w[d],"header"===f.paramType&&(i[f.name]=e[f.name]);for(b=n.find('input[type~="file"]'),m=0,u=b.length;u>m;m++)a=b[m],"undefined"!=typeof a.files[0]&&(t.append($(a).attr("name"),a.files[0]),g+=1);return this.invocationUrl=this.model.supportHeaderParams()?(i=this.model.getHeaderParams(e),delete i["Content-Type"],this.model.urlify(e,!1)):this.model.urlify(e,!0),$(".request_url",$(this.el)).html("
          "),$(".request_url pre",$(this.el)).text(this.invocationUrl),c={type:this.model.method,url:this.invocationUrl,headers:i,data:t,dataType:"json",contentType:!1,processData:!1,error:function(e){return function(n){return e.showErrorStatus(e.wrap(n),e)}}(this),success:function(e){return function(n){return e.showResponse(n,e)}}(this),complete:function(e){return function(n){return e.showCompleteStatus(e.wrap(n),e)}}(this)},window.authorizations&&window.authorizations.apply(c),jQuery.ajax(c),!1},wrap:function(e){var n,t,a,i,s,l,r;for(a={},t=e.getAllResponseHeaders().split("\r"),s=0,l=t.length;l>s;s++)i=t[s],n=i.match(/^([^:]*?):(.*)$/),n||(n=[]),n.shift(),void 0!==n[0]&&void 0!==n[1]&&(a[n[0].trim()]=n[1].trim());return r={},r.content={},r.content.data=e.responseText,r.headers=a,r.request={},r.request.url=this.invocationUrl,r.status=e.status,r},getSelectedValue:function(e){if(e.multiple){for(var n=[],t=0,a=e.options.length;a>t;t++){var i=e.options[t];i.selected&&n.push(i.value)}return n.length>0?n:null}return e.value},hideResponse:function(e){e&&e.preventDefault(),$(".response",$(this.el)).slideUp(),$(".response_hider",$(this.el)).fadeOut()},showResponse:function(e){var n=JSON.stringify(e,null,"	").replace(/\n/g,"
          ");$(".response_body",$(this.el)).html(_.escape(n))},showErrorStatus:function(e,n){n.showStatus(e)},showCompleteStatus:function(e,n){n.showStatus(e)},formatXml:function(e){var n,t,a,i,s,l,r,o,u,p,d,h,c;for(d=/(>)(<)(\/*)/g,c=/[ ]*(.*)[ ]+\n/g,n=/(<.+>)(.+\n)/g,e=e.replace(d,"$1\n$2$3").replace(c,"$1\n").replace(n,"$1\n$2"),p=0,a="",o=e.split("\n"),i=0,l="other",h={"single->single":0,"single->closing":-1,"single->opening":0,"single->other":0,"closing->single":0,"closing->closing":-1,"closing->opening":0,"closing->other":0,"opening->single":1,"opening->closing":0,"opening->opening":1,"opening->other":1,"other->single":0,"other->closing":-1,"other->opening":0,"other->other":0},t=function(e){var n,t,s,r,o,u,p;u={single:Boolean(e.match(/<.+\/>/)),closing:Boolean(e.match(/<\/.+>/)),opening:Boolean(e.match(/<[^!?].*>/))},o=function(){var e;e=[];for(s in u)p=u[s],p&&e.push(s);return e}()[0],o=void 0===o?"other":o,n=l+"->"+o,l=o,r="",i+=h[n],r=function(){var e,n,a;for(a=[],t=e=0,n=i;n>=0?n>e:e>n;t=n>=0?++e:--e)a.push(" ");return a}().join(""),"opening->closing"===n?a=a.substr(0,a.length-1)+e+"\n":a+=r+e+"\n"},s=0,r=o.length;r>s;s++)u=o[s],t(u);return a},showStatus:function(e){var n,t;void 0===e.content?(t=e.data,n=e.url):(t=e.content.data,n=e.request.url);var a=e.headers,i=null;a&&(i=a["Content-Type"]||a["content-type"],i&&(i=i.split(";")[0].trim())),$(".response_body",$(this.el)).removeClass("json"),$(".response_body",$(this.el)).removeClass("xml");var s,l,r=function(e){var n=document.createElement("audio");return!(!n.canPlayType||!n.canPlayType(e).replace(/no/,""))};if(t)if("application/json"===i||/\+json$/.test(i)){var o=null;try{o=JSON.stringify(JSON.parse(t),null," ")}catch(u){o="can't parse JSON. Raw result:\n\n"+t}l=$("").text(o),s=$('
          ').append(l)}else"application/xml"===i||/\+xml$/.test(i)?(l=$("").text(this.formatXml(t)),s=$('
          ').append(l)):"text/html"===i?(l=$("").html(_.escape(t)),s=$('
          ').append(l)):/^image\//.test(i)?s=$("").attr("src",n):/^audio\//.test(i)&&r(i)?s=$("