UNPKG

swagger-ui-svelte

Version:
2,027 lines (1,823 loc) 54.6 kB
import { SvelteComponent, init, safe_not_equal, element, text, space, empty, attr, insert, append, set_input_value, listen, set_data, detach, toggle_class, set_style, destroy_each, run_all, noop } from 'svelte/internal'; import { onMount } from 'svelte'; import { compile } from 'path-to-regexp'; /* src/SwaggerUISvelte.svelte generated by Svelte v3.25.1 */ function get_each_context_3(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[26] = list[i]; return child_ctx; } function get_each_context_2(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[23] = list[i]; return child_ctx; } function get_each_context_5(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[32] = list[i]; child_ctx[33] = list; child_ctx[34] = i; return child_ctx; } function get_each_context_8(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[29] = list[i]; return child_ctx; } function get_each_context_7(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[29] = list[i]; return child_ctx; } function get_each_context_6(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[35] = list[i]; return child_ctx; } function get_each_context_1(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[20] = list[i]; child_ctx[21] = list; child_ctx[22] = i; return child_ctx; } function get_each_context(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[17] = list[i]; child_ctx[19] = i; return child_ctx; } // (108:2) {:else} function create_else_block_5(ctx) { return { c() { document.title = "Swagger UI using Svelte"; }, m: noop, d: noop }; } // (106:2) {#if swagger} function create_if_block_16(ctx) { let title_value; document.title = title_value = /*swagger*/ ctx[0].info.title; return { c: noop, m: noop, d: noop }; } // (116:6) {#if swagger} function create_if_block(ctx) { let h1; let t0_value = /*swagger*/ ctx[0].info.title + ""; let t0; let t1; let h2; let t2_value = /*swagger*/ ctx[0].info.description + ""; let t2; let t3; let t4_value = /*swagger*/ ctx[0].info.version + ""; let t4; let t5; let div2; let t6; let div0; let t7; let div1; let label; let t9; let input; let t10; let each_1_anchor; let mounted; let dispose; let if_block = /*swagger*/ ctx[0].info.contact && create_if_block_15(ctx); let each_value = Object.entries(/*paths*/ ctx[6]); let each_blocks = []; for (let i = 0; i < each_value.length; i += 1) { each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i)); } return { c() { h1 = element("h1"); t0 = text(t0_value); t1 = space(); h2 = element("h2"); t2 = text(t2_value); t3 = text(" - "); t4 = text(t4_value); t5 = space(); div2 = element("div"); if (if_block) if_block.c(); t6 = space(); div0 = element("div"); t7 = space(); div1 = element("div"); label = element("label"); label.textContent = "Server:"; t9 = space(); input = element("input"); t10 = space(); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } each_1_anchor = empty(); attr(h1, "class", "title"); attr(h2, "class", "subtitle"); attr(div0, "class", "rf-col-offset-4"); attr(label, "class", "rf-label"); attr(label, "for", "text-input-text"); attr(input, "class", "rf-input"); attr(input, "type", "text"); attr(input, "placeholder", "Server URL"); attr(input, "id", "text-input-text"); attr(input, "name", "text-input-text"); attr(div1, "class", "rf-col-xs-12 rf-col-lg-4"); attr(div2, "class", "rf-grid-row"); }, m(target, anchor) { insert(target, h1, anchor); append(h1, t0); insert(target, t1, anchor); insert(target, h2, anchor); append(h2, t2); append(h2, t3); append(h2, t4); insert(target, t5, anchor); insert(target, div2, anchor); if (if_block) if_block.m(div2, null); append(div2, t6); append(div2, div0); append(div2, t7); append(div2, div1); append(div1, label); append(div1, t9); append(div1, input); set_input_value(input, /*baseurl*/ ctx[1]); insert(target, t10, anchor); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(target, anchor); } insert(target, each_1_anchor, anchor); if (!mounted) { dispose = listen(input, "input", /*input_input_handler*/ ctx[10]); mounted = true; } }, p(ctx, dirty) { if (dirty[0] & /*swagger*/ 1 && t0_value !== (t0_value = /*swagger*/ ctx[0].info.title + "")) set_data(t0, t0_value); if (dirty[0] & /*swagger*/ 1 && t2_value !== (t2_value = /*swagger*/ ctx[0].info.description + "")) set_data(t2, t2_value); if (dirty[0] & /*swagger*/ 1 && t4_value !== (t4_value = /*swagger*/ ctx[0].info.version + "")) set_data(t4, t4_value); if (/*swagger*/ ctx[0].info.contact) { if (if_block) { if_block.p(ctx, dirty); } else { if_block = create_if_block_15(ctx); if_block.c(); if_block.m(div2, t6); } } else if (if_block) { if_block.d(1); if_block = null; } if (dirty[0] & /*baseurl*/ 2 && input.value !== /*baseurl*/ ctx[1]) { set_input_value(input, /*baseurl*/ ctx[1]); } if (dirty[0] & /*paths, active, getSchema, responses, handleRequest, requestParams, requestBodyExample*/ 508) { each_value = Object.entries(/*paths*/ ctx[6]); let i; for (i = 0; i < each_value.length; i += 1) { const child_ctx = get_each_context(ctx, each_value, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { each_blocks[i] = create_each_block(child_ctx); each_blocks[i].c(); each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); } } for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } each_blocks.length = each_value.length; } }, d(detaching) { if (detaching) detach(h1); if (detaching) detach(t1); if (detaching) detach(h2); if (detaching) detach(t5); if (detaching) detach(div2); if (if_block) if_block.d(); if (detaching) detach(t10); destroy_each(each_blocks, detaching); if (detaching) detach(each_1_anchor); mounted = false; dispose(); } }; } // (120:6) {#if swagger.info.contact} function create_if_block_15(ctx) { let div; let a; let t0_value = /*swagger*/ ctx[0].info.contact.name + ""; let t0; let a_href_value; let t1; let t2_value = /*swagger*/ ctx[0].info.contact.email + ""; let t2; return { c() { div = element("div"); a = element("a"); t0 = text(t0_value); t1 = text(" - \n "); t2 = text(t2_value); attr(a, "href", a_href_value = /*swagger*/ ctx[0].info.contact.url); attr(a, "target", "_blank"); attr(div, "class", "rf-col-xs-12 rf-col-lg-4"); }, m(target, anchor) { insert(target, div, anchor); append(div, a); append(a, t0); append(div, t1); append(div, t2); }, p(ctx, dirty) { if (dirty[0] & /*swagger*/ 1 && t0_value !== (t0_value = /*swagger*/ ctx[0].info.contact.name + "")) set_data(t0, t0_value); if (dirty[0] & /*swagger*/ 1 && a_href_value !== (a_href_value = /*swagger*/ ctx[0].info.contact.url)) { attr(a, "href", a_href_value); } if (dirty[0] & /*swagger*/ 1 && t2_value !== (t2_value = /*swagger*/ ctx[0].info.contact.email + "")) set_data(t2, t2_value); }, d(detaching) { if (detaching) detach(div); } }; } // (145:18) {#if method.summary} function create_if_block_14(ctx) { let div; let t_value = /*method*/ ctx[20].summary + ""; let t; return { c() { div = element("div"); t = text(t_value); attr(div, "class", "rf-btn rf-btn--secondary"); }, m(target, anchor) { insert(target, div, anchor); append(div, t); }, p(ctx, dirty) { if (dirty[0] & /*paths*/ 64 && t_value !== (t_value = /*method*/ ctx[20].summary + "")) set_data(t, t_value); }, d(detaching) { if (detaching) detach(div); } }; } // (152:18) {#if method.requestBody && method.requestBody.content} function create_if_block_9(ctx) { let each_1_anchor; let each_value_6 = Object.entries(/*method*/ ctx[20].requestBody.content); let each_blocks = []; for (let i = 0; i < each_value_6.length; i += 1) { each_blocks[i] = create_each_block_6(get_each_context_6(ctx, each_value_6, i)); } return { c() { for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } each_1_anchor = empty(); }, m(target, anchor) { for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(target, anchor); } insert(target, each_1_anchor, anchor); }, p(ctx, dirty) { if (dirty[0] & /*paths, requestBodyExample, getSchema*/ 224) { each_value_6 = Object.entries(/*method*/ ctx[20].requestBody.content); let i; for (i = 0; i < each_value_6.length; i += 1) { const child_ctx = get_each_context_6(ctx, each_value_6, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { each_blocks[i] = create_each_block_6(child_ctx); each_blocks[i].c(); each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); } } for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } each_blocks.length = each_value_6.length; } }, d(detaching) { destroy_each(each_blocks, detaching); if (detaching) detach(each_1_anchor); } }; } // (184:26) {:else} function create_else_block_3(ctx) { let each_1_anchor; let each_value_8 = Object.entries(/*requestBody*/ ctx[35][1]["schema"]["properties"]); let each_blocks = []; for (let i = 0; i < each_value_8.length; i += 1) { each_blocks[i] = create_each_block_8(get_each_context_8(ctx, each_value_8, i)); } return { c() { for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } each_1_anchor = empty(); }, m(target, anchor) { for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(target, anchor); } insert(target, each_1_anchor, anchor); }, p(ctx, dirty) { if (dirty[0] & /*paths*/ 64) { each_value_8 = Object.entries(/*requestBody*/ ctx[35][1]["schema"]["properties"]); let i; for (i = 0; i < each_value_8.length; i += 1) { const child_ctx = get_each_context_8(ctx, each_value_8, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { each_blocks[i] = create_each_block_8(child_ctx); each_blocks[i].c(); each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); } } for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } each_blocks.length = each_value_8.length; } }, d(detaching) { destroy_each(each_blocks, detaching); if (detaching) detach(each_1_anchor); } }; } // (166:28) {#if '$ref' in requestBody[1]["schema"]} function create_if_block_11(ctx) { let each_1_anchor; let each_value_7 = Object.entries(/*getSchema*/ ctx[7](/*requestBody*/ ctx[35][1]["schema"]["$ref"]).properties); let each_blocks = []; for (let i = 0; i < each_value_7.length; i += 1) { each_blocks[i] = create_each_block_7(get_each_context_7(ctx, each_value_7, i)); } return { c() { for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } each_1_anchor = empty(); }, m(target, anchor) { for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(target, anchor); } insert(target, each_1_anchor, anchor); }, p(ctx, dirty) { if (dirty[0] & /*getSchema, paths*/ 192) { each_value_7 = Object.entries(/*getSchema*/ ctx[7](/*requestBody*/ ctx[35][1]["schema"]["$ref"]).properties); let i; for (i = 0; i < each_value_7.length; i += 1) { const child_ctx = get_each_context_7(ctx, each_value_7, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { each_blocks[i] = create_each_block_7(child_ctx); each_blocks[i].c(); each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); } } for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } each_blocks.length = each_value_7.length; } }, d(detaching) { destroy_each(each_blocks, detaching); if (detaching) detach(each_1_anchor); } }; } // (196:32) {:else} function create_else_block_4(ctx) { let t; return { c() { t = text("String"); }, m(target, anchor) { insert(target, t, anchor); }, p: noop, d(detaching) { if (detaching) detach(t); } }; } // (194:32) {#if property[1].type} function create_if_block_13(ctx) { let t_value = /*property*/ ctx[29][1].type + ""; let t; return { c() { t = text(t_value); }, m(target, anchor) { insert(target, t, anchor); }, p(ctx, dirty) { if (dirty[0] & /*paths*/ 64 && t_value !== (t_value = /*property*/ ctx[29][1].type + "")) set_data(t, t_value); }, d(detaching) { if (detaching) detach(t); } }; } // (185:26) {#each Object.entries(requestBody[1]["schema"]["properties"]) as property} function create_each_block_8(ctx) { let tr; let td0; let span; let t0_value = /*property*/ ctx[29][0] + ""; let t0; let t1; let td1; let raw_value = /*property*/ ctx[29][1].description + ""; let t2; let td2; let t3; function select_block_type_3(ctx, dirty) { if (/*property*/ ctx[29][1].type) return create_if_block_13; return create_else_block_4; } let current_block_type = select_block_type_3(ctx); let if_block = current_block_type(ctx); return { c() { tr = element("tr"); td0 = element("td"); span = element("span"); t0 = text(t0_value); t1 = space(); td1 = element("td"); t2 = space(); td2 = element("td"); if_block.c(); t3 = space(); }, m(target, anchor) { insert(target, tr, anchor); append(tr, td0); append(td0, span); append(span, t0); append(tr, t1); append(tr, td1); td1.innerHTML = raw_value; append(tr, t2); append(tr, td2); if_block.m(td2, null); append(tr, t3); }, p(ctx, dirty) { if (dirty[0] & /*paths*/ 64 && t0_value !== (t0_value = /*property*/ ctx[29][0] + "")) set_data(t0, t0_value); if (dirty[0] & /*paths*/ 64 && raw_value !== (raw_value = /*property*/ ctx[29][1].description + "")) td1.innerHTML = raw_value; if (current_block_type === (current_block_type = select_block_type_3(ctx)) && if_block) { if_block.p(ctx, dirty); } else { if_block.d(1); if_block = current_block_type(ctx); if (if_block) { if_block.c(); if_block.m(td2, null); } } }, d(detaching) { if (detaching) detach(tr); if_block.d(); } }; } // (178:32) {:else} function create_else_block_2(ctx) { let t; return { c() { t = text("String"); }, m(target, anchor) { insert(target, t, anchor); }, p: noop, d(detaching) { if (detaching) detach(t); } }; } // (176:32) {#if property[1].type} function create_if_block_12(ctx) { let t_value = /*property*/ ctx[29][1].type + ""; let t; return { c() { t = text(t_value); }, m(target, anchor) { insert(target, t, anchor); }, p(ctx, dirty) { if (dirty[0] & /*paths*/ 64 && t_value !== (t_value = /*property*/ ctx[29][1].type + "")) set_data(t, t_value); }, d(detaching) { if (detaching) detach(t); } }; } // (167:28) {#each Object.entries(getSchema(requestBody[1]["schema"]["$ref"]).properties) as property} function create_each_block_7(ctx) { let tr; let td0; let span; let t0_value = /*property*/ ctx[29][0] + ""; let t0; let t1; let td1; let raw_value = /*property*/ ctx[29][1].description + ""; let t2; let td2; let t3; function select_block_type_2(ctx, dirty) { if (/*property*/ ctx[29][1].type) return create_if_block_12; return create_else_block_2; } let current_block_type = select_block_type_2(ctx); let if_block = current_block_type(ctx); return { c() { tr = element("tr"); td0 = element("td"); span = element("span"); t0 = text(t0_value); t1 = space(); td1 = element("td"); t2 = space(); td2 = element("td"); if_block.c(); t3 = space(); }, m(target, anchor) { insert(target, tr, anchor); append(tr, td0); append(td0, span); append(span, t0); append(tr, t1); append(tr, td1); td1.innerHTML = raw_value; append(tr, t2); append(tr, td2); if_block.m(td2, null); append(tr, t3); }, p(ctx, dirty) { if (dirty[0] & /*paths*/ 64 && t0_value !== (t0_value = /*property*/ ctx[29][0] + "")) set_data(t0, t0_value); if (dirty[0] & /*paths*/ 64 && raw_value !== (raw_value = /*property*/ ctx[29][1].description + "")) td1.innerHTML = raw_value; if (current_block_type === (current_block_type = select_block_type_2(ctx)) && if_block) { if_block.p(ctx, dirty); } else { if_block.d(1); if_block = current_block_type(ctx); if (if_block) { if_block.c(); if_block.m(td2, null); } } }, d(detaching) { if (detaching) detach(tr); if_block.d(); } }; } // (206:22) {#if '$ref' in requestBody[1]["schema"]} function create_if_block_10(ctx) { let div; let label; let t0; let label_for_value; let t1; let textarea; let textarea_id_value; let mounted; let dispose; function textarea_input_handler() { /*textarea_input_handler*/ ctx[12].call(textarea, /*method*/ ctx[20]); } return { c() { div = element("div"); label = element("label"); t0 = text("Example"); t1 = space(); textarea = element("textarea"); attr(label, "class", "rf-label"); attr(label, "for", label_for_value = "textarea-" + /*method*/ ctx[20]["id"]); attr(textarea, "class", "rf-input"); attr(textarea, "id", textarea_id_value = "textarea-" + /*method*/ ctx[20]["id"]); attr(textarea, "name", "textarea"); attr(textarea, "placeholder", "Fixed size textarea"); attr(div, "class", "rf-input-group"); }, m(target, anchor) { insert(target, div, anchor); append(div, label); append(label, t0); append(div, t1); append(div, textarea); set_input_value(textarea, /*requestBodyExample*/ ctx[5][/*method*/ ctx[20]["id"]]); if (!mounted) { dispose = listen(textarea, "input", textarea_input_handler); mounted = true; } }, p(new_ctx, dirty) { ctx = new_ctx; if (dirty[0] & /*paths*/ 64 && label_for_value !== (label_for_value = "textarea-" + /*method*/ ctx[20]["id"])) { attr(label, "for", label_for_value); } if (dirty[0] & /*paths*/ 64 && textarea_id_value !== (textarea_id_value = "textarea-" + /*method*/ ctx[20]["id"])) { attr(textarea, "id", textarea_id_value); } if (dirty[0] & /*requestBodyExample, paths*/ 96) { set_input_value(textarea, /*requestBodyExample*/ ctx[5][/*method*/ ctx[20]["id"]]); } }, d(detaching) { if (detaching) detach(div); mounted = false; dispose(); } }; } // (153:18) {#each Object.entries(method.requestBody.content) as requestBody } function create_each_block_6(ctx) { let div1; let h4; let t0; let t1_value = /*requestBody*/ ctx[35][0] + ""; let t1; let t2; let div0; let table; let thead; let t9; let tbody; let t10; let br; let t11; let t12; function select_block_type_1(ctx, dirty) { if ("$ref" in /*requestBody*/ ctx[35][1]["schema"]) return create_if_block_11; return create_else_block_3; } let current_block_type = select_block_type_1(ctx); let if_block0 = current_block_type(ctx); let if_block1 = "$ref" in /*requestBody*/ ctx[35][1]["schema"] && create_if_block_10(ctx); return { c() { div1 = element("div"); h4 = element("h4"); t0 = text("Request Body - "); t1 = text(t1_value); t2 = space(); div0 = element("div"); table = element("table"); thead = element("thead"); thead.innerHTML = `<tr><th>Name</th> <th>Description</th> <th>Type</th> </tr><tr></tr>`; t9 = space(); tbody = element("tbody"); if_block0.c(); t10 = space(); br = element("br"); t11 = space(); if (if_block1) if_block1.c(); t12 = space(); attr(h4, "class", "subtitle"); attr(table, "class", "rf-table"); set_style(table, "width", "100%"); attr(div0, "class", "table-container"); attr(div1, "class", "swagger-parameters"); }, m(target, anchor) { insert(target, div1, anchor); append(div1, h4); append(h4, t0); append(h4, t1); append(div1, t2); append(div1, div0); append(div0, table); append(table, thead); append(table, t9); append(table, tbody); if_block0.m(tbody, null); append(div0, t10); append(div0, br); append(div0, t11); if (if_block1) if_block1.m(div0, null); append(div1, t12); }, p(ctx, dirty) { if (dirty[0] & /*paths*/ 64 && t1_value !== (t1_value = /*requestBody*/ ctx[35][0] + "")) set_data(t1, t1_value); if (current_block_type === (current_block_type = select_block_type_1(ctx)) && if_block0) { if_block0.p(ctx, dirty); } else { if_block0.d(1); if_block0 = current_block_type(ctx); if (if_block0) { if_block0.c(); if_block0.m(tbody, null); } } if ("$ref" in /*requestBody*/ ctx[35][1]["schema"]) { if (if_block1) { if_block1.p(ctx, dirty); } else { if_block1 = create_if_block_10(ctx); if_block1.c(); if_block1.m(div0, null); } } else if (if_block1) { if_block1.d(1); if_block1 = null; } }, d(detaching) { if (detaching) detach(div1); if_block0.d(); if (if_block1) if_block1.d(); } }; } // (216:18) {#if method.parameters && method.parameters.length > 0} function create_if_block_5(ctx) { let div1; let h4; let t1; let div0; let table; let thead; let t12; let tbody; let each_value_5 = /*method*/ ctx[20].parameters; let each_blocks = []; for (let i = 0; i < each_value_5.length; i += 1) { each_blocks[i] = create_each_block_5(get_each_context_5(ctx, each_value_5, i)); } return { c() { div1 = element("div"); h4 = element("h4"); h4.textContent = "Parameters"; t1 = space(); div0 = element("div"); table = element("table"); thead = element("thead"); thead.innerHTML = `<tr><th>Name</th> <th>Input</th> <th>Description</th> <th>Located in</th> <th>Type</th> </tr><tr></tr>`; t12 = space(); tbody = element("tbody"); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } attr(h4, "class", "subtitle"); attr(table, "class", "rf-table"); set_style(table, "width", "100%"); attr(div0, "class", "table-container"); attr(div1, "class", "swagger-parameters"); }, m(target, anchor) { insert(target, div1, anchor); append(div1, h4); append(div1, t1); append(div1, div0); append(div0, table); append(table, thead); append(table, t12); append(table, tbody); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(tbody, null); } }, p(ctx, dirty) { if (dirty[0] & /*paths, requestParams*/ 80) { each_value_5 = /*method*/ ctx[20].parameters; let i; for (i = 0; i < each_value_5.length; i += 1) { const child_ctx = get_each_context_5(ctx, each_value_5, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { each_blocks[i] = create_each_block_5(child_ctx); each_blocks[i].c(); each_blocks[i].m(tbody, null); } } for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } each_blocks.length = each_value_5.length; } }, d(detaching) { if (detaching) detach(div1); destroy_each(each_blocks, detaching); } }; } // (238:32) {:else} function create_else_block_1(ctx) { let span; let t_value = /*parameter*/ ctx[32].name + ""; let t; return { c() { span = element("span"); t = text(t_value); }, m(target, anchor) { insert(target, span, anchor); append(span, t); }, p(ctx, dirty) { if (dirty[0] & /*paths*/ 64 && t_value !== (t_value = /*parameter*/ ctx[32].name + "")) set_data(t, t_value); }, d(detaching) { if (detaching) detach(span); } }; } // (234:32) {#if parameter.required} function create_if_block_8(ctx) { let span; let t_value = /*parameter*/ ctx[32].name + ""; let t; return { c() { span = element("span"); t = text(t_value); attr(span, "class", "swagger-parameter-required"); }, m(target, anchor) { insert(target, span, anchor); append(span, t); }, p(ctx, dirty) { if (dirty[0] & /*paths*/ 64 && t_value !== (t_value = /*parameter*/ ctx[32].name + "")) set_data(t, t_value); }, d(detaching) { if (detaching) detach(span); } }; } // (256:32) {:else} function create_else_block(ctx) { let t; return { c() { t = text("String"); }, m(target, anchor) { insert(target, t, anchor); }, p: noop, d(detaching) { if (detaching) detach(t); } }; } // (250:32) {#if parameter.type} function create_if_block_6(ctx) { let t0_value = /*parameter*/ ctx[32].type + ""; let t0; let t1; let if_block_anchor; let if_block = /*parameter*/ ctx[32].items && create_if_block_7(ctx); return { c() { t0 = text(t0_value); t1 = space(); if (if_block) if_block.c(); if_block_anchor = empty(); }, m(target, anchor) { insert(target, t0, anchor); insert(target, t1, anchor); if (if_block) if_block.m(target, anchor); insert(target, if_block_anchor, anchor); }, p(ctx, dirty) { if (dirty[0] & /*paths*/ 64 && t0_value !== (t0_value = /*parameter*/ ctx[32].type + "")) set_data(t0, t0_value); if (/*parameter*/ ctx[32].items) { if (if_block) { if_block.p(ctx, dirty); } else { if_block = create_if_block_7(ctx); if_block.c(); if_block.m(if_block_anchor.parentNode, if_block_anchor); } } else if (if_block) { if_block.d(1); if_block = null; } }, d(detaching) { if (detaching) detach(t0); if (detaching) detach(t1); if (if_block) if_block.d(detaching); if (detaching) detach(if_block_anchor); } }; } // (252:34) {#if parameter.items } function create_if_block_7(ctx) { let t0; let t1_value = /*parameter*/ ctx[32].items.type + ""; let t1; return { c() { t0 = text("of\n "); t1 = text(t1_value); }, m(target, anchor) { insert(target, t0, anchor); insert(target, t1, anchor); }, p(ctx, dirty) { if (dirty[0] & /*paths*/ 64 && t1_value !== (t1_value = /*parameter*/ ctx[32].items.type + "")) set_data(t1, t1_value); }, d(detaching) { if (detaching) detach(t0); if (detaching) detach(t1); } }; } // (231:26) {#each method.parameters as parameter} function create_each_block_5(ctx) { let tr; let td0; let t0; let td1; let input; let input_placeholder_value; let t1; let td2; let raw_value = /*parameter*/ ctx[32].description + ""; let t2; let td3; let t3_value = /*parameter*/ ctx[32].in + ""; let t3; let t4; let td4; let t5; let mounted; let dispose; function select_block_type_4(ctx, dirty) { if (/*parameter*/ ctx[32].required) return create_if_block_8; return create_else_block_1; } let current_block_type = select_block_type_4(ctx); let if_block0 = current_block_type(ctx); function input_input_handler_1() { /*input_input_handler_1*/ ctx[13].call(input, /*method*/ ctx[20], /*parameter*/ ctx[32]); } function select_block_type_5(ctx, dirty) { if (/*parameter*/ ctx[32].type) return create_if_block_6; return create_else_block; } let current_block_type_1 = select_block_type_5(ctx); let if_block1 = current_block_type_1(ctx); return { c() { tr = element("tr"); td0 = element("td"); if_block0.c(); t0 = space(); td1 = element("td"); input = element("input"); t1 = space(); td2 = element("td"); t2 = space(); td3 = element("td"); t3 = text(t3_value); t4 = space(); td4 = element("td"); if_block1.c(); t5 = space(); attr(input, "class", "rf-input"); attr(input, "type", "text"); attr(input, "placeholder", input_placeholder_value = /*parameter*/ ctx[32].name); }, m(target, anchor) { insert(target, tr, anchor); append(tr, td0); if_block0.m(td0, null); append(tr, t0); append(tr, td1); append(td1, input); set_input_value(input, /*requestParams*/ ctx[4][`${/*method*/ ctx[20]["id"]}-${/*parameter*/ ctx[32].name}`]); append(tr, t1); append(tr, td2); td2.innerHTML = raw_value; append(tr, t2); append(tr, td3); append(td3, t3); append(tr, t4); append(tr, td4); if_block1.m(td4, null); append(tr, t5); if (!mounted) { dispose = listen(input, "input", input_input_handler_1); mounted = true; } }, p(new_ctx, dirty) { ctx = new_ctx; if (current_block_type === (current_block_type = select_block_type_4(ctx)) && if_block0) { if_block0.p(ctx, dirty); } else { if_block0.d(1); if_block0 = current_block_type(ctx); if (if_block0) { if_block0.c(); if_block0.m(td0, null); } } if (dirty[0] & /*paths*/ 64 && input_placeholder_value !== (input_placeholder_value = /*parameter*/ ctx[32].name)) { attr(input, "placeholder", input_placeholder_value); } if (dirty[0] & /*requestParams, paths*/ 80 && input.value !== /*requestParams*/ ctx[4][`${/*method*/ ctx[20]["id"]}-${/*parameter*/ ctx[32].name}`]) { set_input_value(input, /*requestParams*/ ctx[4][`${/*method*/ ctx[20]["id"]}-${/*parameter*/ ctx[32].name}`]); } if (dirty[0] & /*paths*/ 64 && raw_value !== (raw_value = /*parameter*/ ctx[32].description + "")) td2.innerHTML = raw_value; if (dirty[0] & /*paths*/ 64 && t3_value !== (t3_value = /*parameter*/ ctx[32].in + "")) set_data(t3, t3_value); if (current_block_type_1 === (current_block_type_1 = select_block_type_5(ctx)) && if_block1) { if_block1.p(ctx, dirty); } else { if_block1.d(1); if_block1 = current_block_type_1(ctx); if (if_block1) { if_block1.c(); if_block1.m(td4, null); } } }, d(detaching) { if (detaching) detach(tr); if_block0.d(); if_block1.d(); mounted = false; dispose(); } }; } // (270:18) {#if responses[method['id']] } function create_if_block_3(ctx) { let p0; let t0; let t1_value = /*responses*/ ctx[3][/*method*/ ctx[20]["id"]].url + ""; let t1; let t2; let h4; let t4; let div3; let div2; let div0; let t5_value = /*responses*/ ctx[3][/*method*/ ctx[20]["id"]].status + ""; let t5; let t6; let p1; let t7_value = /*responses*/ ctx[3][/*method*/ ctx[20]["id"]].statusText + ""; let t7; let t8; let div1; let p2; let t10; let pre; let code; let t11_value = [.../*responses*/ ctx[3][/*method*/ ctx[20]["id"]].headers.entries()].map(func).join(" \n") + ""; let t11; let t12; let show_if = Object.keys(/*responses*/ ctx[3][/*method*/ ctx[20]["id"]].body).length === 0 && /*responses*/ ctx[3][/*method*/ ctx[20]["id"]].body.constructor === Object; let if_block = show_if && create_if_block_4(ctx); return { c() { p0 = element("p"); t0 = text("Url: "); t1 = text(t1_value); t2 = space(); h4 = element("h4"); h4.textContent = "Result"; t4 = space(); div3 = element("div"); div2 = element("div"); div0 = element("div"); t5 = text(t5_value); t6 = space(); p1 = element("p"); t7 = text(t7_value); t8 = space(); div1 = element("div"); p2 = element("p"); p2.textContent = "Headers:"; t10 = space(); pre = element("pre"); code = element("code"); t11 = text(t11_value); t12 = space(); if (if_block) if_block.c(); attr(div0, "class", "rf-col-xs-12 rf-col-lg-2"); attr(div1, "class", "rf-col-xs-12 rf-col-lg-10"); attr(div2, "class", "rf-grid-row"); attr(div3, "class", "rf-callout"); }, m(target, anchor) { insert(target, p0, anchor); append(p0, t0); append(p0, t1); insert(target, t2, anchor); insert(target, h4, anchor); insert(target, t4, anchor); insert(target, div3, anchor); append(div3, div2); append(div2, div0); append(div0, t5); append(div0, t6); append(div0, p1); append(p1, t7); append(div2, t8); append(div2, div1); append(div1, p2); append(div1, t10); append(div1, pre); append(pre, code); append(code, t11); append(div1, t12); if (if_block) if_block.m(div1, null); }, p(ctx, dirty) { if (dirty[0] & /*responses, paths*/ 72 && t1_value !== (t1_value = /*responses*/ ctx[3][/*method*/ ctx[20]["id"]].url + "")) set_data(t1, t1_value); if (dirty[0] & /*responses, paths*/ 72 && t5_value !== (t5_value = /*responses*/ ctx[3][/*method*/ ctx[20]["id"]].status + "")) set_data(t5, t5_value); if (dirty[0] & /*responses, paths*/ 72 && t7_value !== (t7_value = /*responses*/ ctx[3][/*method*/ ctx[20]["id"]].statusText + "")) set_data(t7, t7_value); if (dirty[0] & /*responses, paths*/ 72 && t11_value !== (t11_value = [.../*responses*/ ctx[3][/*method*/ ctx[20]["id"]].headers.entries()].map(func).join(" \n") + "")) set_data(t11, t11_value); if (dirty[0] & /*responses, paths*/ 72) show_if = Object.keys(/*responses*/ ctx[3][/*method*/ ctx[20]["id"]].body).length === 0 && /*responses*/ ctx[3][/*method*/ ctx[20]["id"]].body.constructor === Object; if (show_if) { if (if_block) { if_block.p(ctx, dirty); } else { if_block = create_if_block_4(ctx); if_block.c(); if_block.m(div1, null); } } else if (if_block) { if_block.d(1); if_block = null; } }, d(detaching) { if (detaching) detach(p0); if (detaching) detach(t2); if (detaching) detach(h4); if (detaching) detach(t4); if (detaching) detach(div3); if (if_block) if_block.d(); } }; } // (287:26) {#if Object.keys(responses[method['id']].body).length === 0 && responses[method['id']].body.constructor === Object} function create_if_block_4(ctx) { let p; let t1; let t2_value = JSON.stringify(/*responses*/ ctx[3][/*method*/ ctx[20]["id"]].json(), null, 2) + ""; let t2; return { c() { p = element("p"); p.textContent = "Body:"; t1 = space(); t2 = text(t2_value); }, m(target, anchor) { insert(target, p, anchor); insert(target, t1, anchor); insert(target, t2, anchor); }, p(ctx, dirty) { if (dirty[0] & /*responses, paths*/ 72 && t2_value !== (t2_value = JSON.stringify(/*responses*/ ctx[3][/*method*/ ctx[20]["id"]].json(), null, 2) + "")) set_data(t2, t2_value); }, d(detaching) { if (detaching) detach(p); if (detaching) detach(t1); if (detaching) detach(t2); } }; } // (296:18) {#if method.responses} function create_if_block_1(ctx) { let div; let h4; let t1; let each_value_2 = Object.entries(/*method*/ ctx[20].responses); let each_blocks = []; for (let i = 0; i < each_value_2.length; i += 1) { each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i)); } return { c() { div = element("div"); h4 = element("h4"); h4.textContent = "Responses"; t1 = space(); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } attr(div, "class", "swagger-response"); }, m(target, anchor) { insert(target, div, anchor); append(div, h4); append(div, t1); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(div, null); } }, p(ctx, dirty) { if (dirty[0] & /*paths, getSchema*/ 192) { each_value_2 = Object.entries(/*method*/ ctx[20].responses); let i; for (i = 0; i < each_value_2.length; i += 1) { const child_ctx = get_each_context_2(ctx, each_value_2, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { each_blocks[i] = create_each_block_2(child_ctx); each_blocks[i].c(); each_blocks[i].m(div, null); } } for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } each_blocks.length = each_value_2.length; } }, d(detaching) { if (detaching) detach(div); destroy_each(each_blocks, detaching); } }; } // (311:32) {#if '$ref' in content[1].schema} function create_if_block_2(ctx) { let ul; let t0; let br; let t1; let pre; let code; let t2_value = JSON.stringify(/*getSchema*/ ctx[7](/*content*/ ctx[26][1].schema["$ref"]).example, null, 2) + ""; let t2; let t3; return { c() { ul = element("ul"); t0 = text("Example: "); br = element("br"); t1 = space(); pre = element("pre"); code = element("code"); t2 = text(t2_value); t3 = space(); }, m(target, anchor) { insert(target, ul, anchor); append(ul, t0); append(ul, br); append(ul, t1); append(ul, pre); append(pre, code); append(code, t2); append(ul, t3); }, p(ctx, dirty) { if (dirty[0] & /*paths*/ 64 && t2_value !== (t2_value = JSON.stringify(/*getSchema*/ ctx[7](/*content*/ ctx[26][1].schema["$ref"]).example, null, 2) + "")) set_data(t2, t2_value); }, d(detaching) { if (detaching) detach(ul); } }; } // (302:28) {#each Object.entries(response[1].content) as content} function create_each_block_3(ctx) { let div0; let t0_value = /*response*/ ctx[23][0] + ""; let t0; let t1; let p; let t2_value = /*response*/ ctx[23][1].description + ""; let t2; let t3; let div1; let t4; let t5_value = /*content*/ ctx[26][0] + ""; let t5; let t6; let t7; let if_block = "$ref" in /*content*/ ctx[26][1].schema && create_if_block_2(ctx); return { c() { div0 = element("div"); t0 = text(t0_value); t1 = space(); p = element("p"); t2 = text(t2_value); t3 = space(); div1 = element("div"); t4 = text("Content-type: "); t5 = text(t5_value); t6 = space(); if (if_block) if_block.c(); t7 = space(); attr(div0, "class", "rf-col-xs-12 rf-col-lg-2"); attr(div1, "class", "rf-col-xs-12 rf-col-lg-10"); }, m(target, anchor) { insert(target, div0, anchor); append(div0, t0); append(div0, t1); append(div0, p); append(p, t2); insert(target, t3, anchor); insert(target, div1, anchor); append(div1, t4); append(div1, t5); append(div1, t6); if (if_block) if_block.m(div1, null); append(div1, t7); }, p(ctx, dirty) { if (dirty[0] & /*paths*/ 64 && t0_value !== (t0_value = /*response*/ ctx[23][0] + "")) set_data(t0, t0_value); if (dirty[0] & /*paths*/ 64 && t2_value !== (t2_value = /*response*/ ctx[23][1].description + "")) set_data(t2, t2_value); if (dirty[0] & /*paths*/ 64 && t5_value !== (t5_value = /*content*/ ctx[26][0] + "")) set_data(t5, t5_value); if ("$ref" in /*content*/ ctx[26][1].schema) { if (if_block) { if_block.p(ctx, dirty); } else { if_block = create_if_block_2(ctx); if_block.c(); if_block.m(div1, t7); } } else if (if_block) { if_block.d(1); if_block = null; } }, d(detaching) { if (detaching) detach(div0); if (detaching) detach(t3); if (detaching) detach(div1); if (if_block) if_block.d(); } }; } // (299:22) {#each Object.entries(method.responses) as response} function create_each_block_2(ctx) { let div1; let div0; let t; let each_value_3 = Object.entries(/*response*/ ctx[23][1].content); let each_blocks = []; for (let i = 0; i < each_value_3.length; i += 1) { each_blocks[i] = create_each_block_3(get_each_context_3(ctx, each_value_3, i)); } return { c() { div1 = element("div"); div0 = element("div"); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } t = space(); attr(div0, "class", "rf-grid-row"); attr(div1, "class", "rf-callout"); }, m(target, anchor) { insert(target, div1, anchor); append(div1, div0); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(div0, null); } append(div1, t); }, p(ctx, dirty) { if (dirty[0] & /*getSchema, paths*/ 192) { each_value_3 = Object.entries(/*response*/ ctx[23][1].content); let i; for (i = 0; i < each_value_3.length; i += 1) { const child_ctx = get_each_context_3(ctx, each_value_3, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { each_blocks[i] = create_each_block_3(child_ctx); each_blocks[i].c(); each_blocks[i].m(div0, null); } } for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } each_blocks.length = each_value_3.length; } }, d(detaching) { if (detaching) detach(div1); destroy_each(each_blocks, detaching); } }; } // (136:12) {#each category[1] as method, methodIdx} function create_each_block_1(ctx) { let div3; let div1; let a; let t0_value = /*method*/ ctx[20].method + ""; let t0; let a_class_value; let a_href_value; let t1; let div0; let t2_value = /*method*/ ctx[20].route + ""; let t2; let t3; let t4; let div2; let t5; let t6; let button; let t8; let t9; let t10; let br; let mounted; let dispose; let if_block0 = /*method*/ ctx[20].summary && create_if_block_14(ctx); function click_handler(...args) { return /*click_handler*/ ctx[11](/*method*/ ctx[20], ...args); } let if_block1 = /*method*/ ctx[20].requestBody && /*method*/ ctx[20].requestBody.content && create_if_block_9(ctx); let if_block2 = /*method*/ ctx[20].parameters && /*method*/ ctx[20].parameters.length > 0 && create_if_block_5(ctx); function click_handler_1(...args) { return /*click_handler_1*/ ctx[14](/*method*/ ctx[20], ...args); } let if_block3 = /*responses*/ ctx[3][/*method*/ ctx[20]["id"]] && create_if_block_3(ctx); let if_block4 = /*method*/ ctx[20].responses && create_if_block_1(ctx); return { c() { div3 = element("div"); div1 = element("div"); a = element("a"); t0 = text(t0_value); t1 = space(); div0 = element("div"); t2 = text(t2_value); t3 = space(); if (if_block0) if_block0.c(); t4 = space(); div2 = element("div"); if (if_block1) if_block1.c(); t5 = space(); if (if_block2) if_block2.c(); t6 = space(); button = element("button"); button.textContent = "Execute"; t8 = space(); if (if_block3) if_block3.c(); t9 = space(); if (if_block4) if_block4.c(); t10 = space(); br = element("br"); attr(a, "class", a_class_value = "rf-btn rf-background--" + /*method*/ ctx[20].method); attr(a, "href", a_href_value = null); attr(div0, "class", "rf-btn rf-btn--secondary"); attr(div1, "class", "rf-grid-row"); attr(button, "class", "rf-btn"); attr(div2, "class", "swagger-method-details open"); toggle_class(div2, "open", /*active*/ ctx[2][/*method*/ ctx[20]["id"]]); attr(div3, "class", "box"); }, m(target, anchor) { insert(target, div3, anchor); append(div3, div1); append(div1, a); append(a, t0); append(div1, t1); append(div1, div0); append(div0, t2); append(div1, t3); if (if_block0) if_block0.m(div1, null); append(div3, t4); append(div3, div2); if (if_block1) if_block1.m(div2, null); append(div2, t5); if (if_block2) if_block2.m(div2, null); append(div2, t6); append(div2, button); append(div2, t8); if (if_block3) if_block3.m(div2, null); append(div2, t9); if (if_block4) if_block4.m(div2, null); insert(target, t10, anchor); insert(target, br, anchor); if (!mounted) { dispose = [ listen(div1, "click", click_handler), listen(button, "click", click_handler_1) ]; mounted = true; } }, p(new_ctx, dirty) { ctx = new_ctx; if (dirty[0] & /*paths*/ 64 && t0_value !== (t0_value = /*method*/ ctx[20].method + "")) set_data(t0, t0_value); if (dirty[0] & /*paths*/ 64 && a_class_value !== (a_class_value = "rf-btn rf-background--" + /*method*/ ctx[20].method)) { attr(a, "class", a_class_value); } if (dirty[0] & /*paths*/ 64 && t2_value !== (t2_value = /*method*/ ctx[20].route + "")) set_data(t2, t2_value); if (/*method*/ ctx[20].summary) { if (if_block0) { if_block0.p(ctx, dirty); } else { if_block0 = create_if_block_14(ctx); if_block0.c(); if_block0.m(div1, null); } } else if (if_block0) { if_block0.d(1); if_block0 = null; } if (/*method*/ ctx[20].requestBody && /*method*/ ctx[20].requestBody.content) { if (if_block1) { if_block1.p(ctx, dirty); } else { if_block1 = create_if_block_9(ctx); if_block1.c(); if_block1.m(div2, t5); } } else if (if_block1) { if_block1.d(1); if_block1 = null; } if (/*method*/ ctx[20].parameters && /*method*/ ctx[20].parameters.length > 0) { if (if_block2) { if_block2.p(ctx, dirty); } else { if_block2 = create_if_block_5(ctx); if_block2.c(); if_block2.m(div2, t6); } } else if (if_block2) { if_block2.d(1); if_block2 = null; } if (/*responses*/ ctx[3][/*method*/ ctx[20]["id"]]) { if (if_block3) { if_block3.p(ctx, dirty); } else { if_block3 = create_if_block_3(ctx); if_block3.c(); if_block3.m(div2, t9); } } else if (if_block3) { if_block3.d(1); if_block3 = null; } if (/*method*/ ctx[20].responses) { if (if_block4) { if_block4.p(ctx, dirty); } else { if_block4 = create_if_block_1(ctx); if_block4.c(); if_block4.m(div2, null); } } else if (if_block4) { if_block4.d(1); if_block4 = null; } if (dirty[0] & /*active, paths*/ 68) { toggle_class(div2, "open", /*active*/ ctx[2][/*method*/ ctx[20]["id"]]); } }, d(detaching) { if (detaching) detach(div3); if (if_block0) if_block0.d(); if (if_block1) if_block1.d(); if (if_block2) if_block2.d(); if (if_block3) if_block3.d(); if (if_block4) if_block4.d(); if (detaching) detach(t10); if (detaching) detach(br); mounted = false; run_all(dispose); } }; } // (133:8) {#each Object.entries(paths) as category, routeIdx} function create_each_block(ctx) { let div; let h3; let t0_value = /*category*/ ctx[17][0] + ""; let t0; let t1; let t2; let each_value_1 = /*category*/ ctx[17][1]; let each_blocks = []; for (let i = 0; i < each_value_1.length; i += 1) { each_blocks[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i)); } return { c() { div = element("div"); h3 = element("h3"); t0 = text(t0_value); t1 = space(); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } t2 = space(); attr(h3, "class", "title is-small is-3"); attr(div, "class", "box"); }, m(target, anchor) { insert(target, div, anchor); append(div, h3); append(h3, t0); append(div, t1); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(div, null); } append(div, t2); }, p(ctx, dirty) { if (dirty[0] & /*paths*/ 64 && t0_value !== (t0_value = /*category*/ ctx[17][0] + "")) set_data(t0, t0_value); if (dirty[0] & /*active, paths, getSchema, responses, handleRequest, requestParams, requestBodyExample*/ 508) { each_value_1 = /*category*/ ctx[17][1]; let i; for (i = 0; i < each_value_1.length; i += 1) { const child_ctx = get_each_context_1(ctx, each_value_1, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { each_blocks[i] = create_each_block_1(child_ctx); each_blocks[i].c(); each_blocks[i].m(div, t2); } } for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } each_blocks.length = each_value_1.length; } }, d(detaching) { if (detaching) detach(div); destroy_each(each_blocks, detaching); } }; } function create_fragment(ctx) { let if_block0_anchor; let t; let main; let div; function select_block_type(ctx, dirty) { if (/*swagger*/ ctx[0]) return create_if_block_16; return create_else_block_5; } let current_block_type = select_block_type(ctx); let if_block0 = current_block_type(ctx); let if_block1 = /*swagger*/ ctx[0] && create_if_block(ctx); return { c() { if_block0.c(); if_block0_anchor = empty(); t = space(); main = element("main"); div = element("div"); if (if_block1) if_block1.c(); attr(div, "class", "rf-container"); }, m(target, anchor) { if_block0.m(document.head, null); append(document.head, if_block0_anchor); insert(target, t, anchor); insert(target, main, anchor); append(main, div); if (if_block1) if_block1.m(div, null); }, p(ctx, dirty) { if (current_block_type !== (current_block_type = select_block_type(ctx))) { if_block0.d(1); if_block0 = current_block_type(ctx); if (if_block0) { if_block0.c(); if_block0.m(if_block0_anchor.parentNode, if_block0_anchor); } } if (/*swagger*/ ctx[0]) { if (if_block1) { if_block1.p(ctx, dirty); } else { if_block1 = create_if_block(ctx); if_block1.c(); if_block1.m(div, null); } } else if (if_block1) { if_block1.d(1); if_block1 = null; } }, i: noop, o: noop, d(detaching) { if_block0.d(detaching); detach(if_block0_anchor); if (detaching) detach(t); if (detaching) detach(main); if (if_block1) if_block1.d(); } }; } function getCwd() { return require("path").resolve(__dirname, "../public"); } const func = x => x.join(": "); function instance($$self, $$props, $$invalidate) { var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch(e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch(e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; let { swaggerUrl = "swagger-example.json" } = $$props; let swagger = null; let baseurl = ""; let