PageSourceSearch

https://manojn8nagency-n8n-website-crm.hf.space/_nuxt/DRHav0Wi.js

js manojn8nagency-n8n-website-crm.hf.space collected 2026-10-03 17:08:49 UTC 109,696 bytes, 60 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CqoW3B-6.js","./Cclm7nkv.js","./nocodb-sdk.BvXJU_Me.css","./CIfvuEeO.js","./BBt0YQDp.js","./entry.C3yTtHEQ.css","./oMrgsE5_.js","./editor.DO5o-l7c.css","./BtDH1eqt.js","./Editor.zjdeUWJl.css"])))=>i.map(i=>d[i]);
2import{fG as eo,oG as Sr,oH as to,oI as Or,aK as ro,j as no,b as oo,s as io,D as ao,E as Tr,r as Ue,bW as so,e2 as co,c$ as lo,cY as de,g as Me,w as uo,d8 as fo,ac as Je,ad as we,ae,aU as Se,aV as ye,b7 as _e,a_ as ct,b3 as lt,d7 as po,aR as Er,z as oe,aY as ze,b9 as xr,b8 as yo,fY as ho,d3 as mo,dt as vo,hE as go,d9 as bo,cZ as $o,ba as wo,hD as So,i1 as Oo,cC as To,ew as Eo,cD as xo,t as Pr,bs as Po}from"./Cclm7nkv.js";import{N as Ro}from"./BBt0YQDp.js";import{u as jo}from"./CFegJRh7.js";import{i as ko}from"./BkfcOz2P.js";import"./DU4vzXOA.js";import"./BB1zRFyV.js";import"./BVceguTg.js";import"./DDbnJU0v.js";import"./Bkmccapt.js";import"./DpOf2hKv.js";import"./oMrgsE5_.js";import"./BHIsFFKD.js";import"./BuAYo6WC.js";import"./sBsgy6ez.js";import"./BEgFzqak.js";import"./CGPQtY94.js";import"./BmmlP3m7.js";import"./DWIx6EUE.js";import"./DJsy_p8a.js";import"./CFcy8-Ml.js";import"./CGWERL50.js";import"./D9MfhUWt.js";import"./DM9FKs4Q.js";import"./DQRNNJXq.js";import"./DJf31Huo.js";import"./D0HKgQdy.js";import"./AYOgI4j_.js";import"./CW24I83G.js";import"./C8eu_qKu.js";import"./2bNnKFqo.js";import"./Gte23L_U.js";import"./Bs9ymXrm.js";import"./CBZascpr.js";import"./BtDH1eqt.js";import"./BfVZXeNF.js";var Rr=(t,n)=>{const r=t[n.name];return r===void 0?(t[n.name]=n.value,t):Array.isArray(r)?(r.push(n.value),t):(t[n.name]=[r,n.value],t)},jr="",kr=`
3`,I=class{constructor({indent:t,join:n}={}){this.postProcessors=[],this.code=[],this.indentationCharacter=jr,this.lineJoin=kr,this.indentLine=(r,i=0)=>`${this.indentationCharacter.repeat(i)}${r}`,this.unshift=(r,i)=>{const f=this.indentLine(r,i);this.code.unshift(f)},this.push=(r,i)=>{const f=this.indentLine(r,i);this.code.push(f)},this.blank=()=>{this.code.push("")},this.join=()=>{const r=this.code.join(this.lineJoin);return this.postProcessors.reduce((f,c)=>c(f),r)},this.addPostProcessor=r=>{this.postProcessors=[...this.postProcessors,r]},this.indentationCharacter=t||jr,this.lineJoin=n??kr}},ut,Cr;function Co(){return Cr||(Cr=1,ut=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"}),ut}var ft,_r;function _o(){return _r||(_r=1,ft=function(t){var n=typeof t;return t!==null&&(n==="object"||n==="function")}),ft}var De={},Ar;function Ao(){return Ar||(Ar=1,Object.defineProperty(De,"__esModule",{value:!0}),De.default=t=>Object.getOwnPropertySymbols(t).filter(n=>Object.prototype.propertyIsEnumerable.call(t,n))),De}var pt,qr;function qo(){if(qr)return pt;qr=1;const t=Co(),n=_o(),r=Ao().default;return pt=(i,f,c)=>{const e=[];return function o(a,s,p){s=s||{},s.indent=s.indent||"	",p=p||"";let l;s.inlineCharacterLimit===void 0?l={newLine:`
4`,newLineOrSpace:`
5`,pad:p,indent:p+s.indent}:l={newLine:"@@__STRINGIFY_OBJECT_NEW_LINE__@@",newLineOrSpace:"@@__STRINGIFY_OBJECT_NEW_LINE_OR_SPACE__@@",pad:"@@__STRINGIFY_OBJECT_PAD__@@",indent:"@@__STRINGIFY_OBJECT_INDENT__@@"};const m=h=>{if(s.inlineCharacterLimit===void 0)return h;const u=h.replace(new RegExp(l.newLine,"g"),"").replace(new RegExp(l.newLineOrSpace,"g")," ").replace(new RegExp(l.pad+"|"+l.indent,"g"),"");return u.length<=s.inlineCharacterLimit?u:h.replace(new RegExp(l.newLine+"|"+l.newLineOrSpace,"g"),`
6`).replace(new RegExp(l.pad,"g"),p).replace(new RegExp(l.indent,"g"),p+s.indent)};if(e.indexOf(a)!==-1)return'"[Circular]"';if(a==null||typeof a=="number"||typeof a=="boolean"||typeof a=="function"||typeof a=="symbol"||t(a))return String(a);if(a instanceof Date)return`new Date('${a.toISOString()}')`;if(Array.isArray(a)){if(a.length===0)return"[]";e.push(a);const h="["+l.newLine+a.map((u,y)=>{const d=a.length-1===y?l.newLine:","+l.newLineOrSpace;let w=o(u,s,p+s.indent);return s.transform&&(w=s.transform(a,y,w)),l.indent+w+d}).join("")+l.pad+"]";return e.pop(),m(h)}if(n(a)){let h=Object.keys(a).concat(r(a));if(s.filter&&(h=h.filter(y=>s.filter(a,y))),h.length===0)return"{}";e.push(a);const u="{"+l.newLine+h.map((y,d)=>{const w=h.length-1===d?l.newLine:","+l.newLineOrSpace,v=typeof y=="symbol",E=!v&&/^[a-z$_][a-z$_0-9]*$/i.test(y),j=v||E?y:o(y,s);let P=o(a[y],s,p+s.indent);return s.transform&&(P=s.transform(a,y,P)),l.indent+String(j)+": "+P+w}).join("")+l.pad+"}";return e.pop(),m(u)}return a=String(a).replace(/[\r\n]/g,h=>h===`
7`?"\\n":"\\r"),s.singleQuotes===!1?(a=a.replace(/"/g,'\\"'),`"${a}"`):(a=a.replace(/\\?'/g,"\\'"),`'${a}'`)}(i,f,c)},pt}var No=qo();const le=eo(No);function He(t,n={}){const{delimiter:r='"',escapeChar:i="\\",escapeNewlines:f=!0}=n;return[...t.toString()].map(e=>e==="\b"?`${i}b`:e==="	"?`${i}t`:e===`
8`?f?`${i}n`:e:e==="\f"?`${i}f`:e==="\r"?f?`${i}r`:e:e===i?i+i:e===r?i+r:e<" "||e>"~"?JSON.stringify(e).slice(1,-1):e).join("")}var Fe=t=>He(t,{delimiter:"'"}),K=t=>He(t,{delimiter:'"'}),Io={info:{key:"libcurl",title:"Libcurl",link:"http://curl.haxx.se/libcurl",description:"Simple REST and HTTP API Client for C",extname:".c"},convert:({method:t,fullUrl:n,headersObj:r,allHeaders:i,postData:f})=>{const{push:c,blank:e,join:o}=new I;c("CURL *hnd = curl_easy_init();"),e(),c(`curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "${t.toUpperCase()}");`),c("curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);"),c(`curl_easy_setopt(hnd, CURLOPT_URL, "${n}");`);const a=Object.keys(r);return a.length&&(e(),c("struct curl_slist *headers = NULL;"),a.forEach(s=>{c(`headers = curl_slist_append(headers, "${s}: ${K(r[s])}");`)}),c("curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);")),i.cookie&&(e(),c(`curl_easy_setopt(hnd, CURLOPT_COOKIE, "${i.cookie}");`)),f.text&&(e(),c(`curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, ${JSON.stringify(f.text)});`)),e(),c("CURLcode ret = curl_easy_perform(hnd);"),o()}},Lo={info:{key:"c",title:"C",default:"libcurl",cli:"c"},clientsById:{libcurl:Io}},ee=(t,n)=>Object.keys(t).find(r=>r.toLowerCase()===n.toLowerCase()),ue=(t,n)=>{const r=ee(t,n);if(r)return t[r]},Qe=(t,n)=>!!ee(t,n),Uo=t=>["application/json","application/x-json","text/json","text/x-json","+json"].some(n=>t.indexOf(n)>-1),Nr=class{constructor(t){this.name="",this.toString=()=>`:${this.name}`,this.name=t}},Mo=class{constructor(t){this.path="",this.toString=()=>`(clojure.java.io/file "${this.path}")`,this.path=t}},In=t=>t===void 0?null:t===null?"null":t.constructor.name.toLowerCase(),Ln=t=>t===void 0?!0:In(t)==="object"?Object.keys(t).length===0:!1,Ir=t=>(Object.keys(t).filter(n=>
8Ln(t[n])).forEach(n=>{delete t[n]}),t),Ve=(t,n)=>{const r=" ".repeat(t);return n.replace(/\n/g,`
9${r}`)},sr=t=>{switch(In(t)){case"string":return`"${t.replace(/"/g,'\\"')}"`;case"file":return t.toString();case"keyword":return t.toString();case"null":return"nil";case"regexp":return`#"${t.source}"`;case"object":{const n=Object.keys(t).reduce((r,i)=>{const f=Ve(i.length+2,sr(t[i]));return`${r}:${i} ${f}
10 `},"").trim();return`{${Ve(1,n)}}`}case"array":{const n=t.reduce((r,i)=>`${r} ${sr(i)}`,"").trim();return`[${Ve(1,n)}]`}default:return t.toString()}},Ho={info:{key:"clj_http",title:"clj-http",link:"https://github.com/dakrone/clj-http",description:"An idiomatic clojure http client wrapping the apache client.",extname:".clj"},convert:({queryObj:t,method:n,postData:r,url:i,allHeaders:f},c)=>{const{push:e,join:o}=new I({indent:c==null?void 0:c.indent}),a=["get","post","put","delete","patch","head","options"];if(n=n.toLowerCase(),!a.includes(n))return e("Method not supported"),o();const s={headers:f,"query-params":t};switch(r.mimeType){case"application/json":{s["content-type"]=new Nr("json"),s["form-params"]=r.jsonObj;const p=ee(s.headers,"content-type");p&&delete s.headers[p]}break;case"application/x-www-form-urlencoded":{s["form-params"]=r.paramsObj;const p=ee(s.headers,"content-type");p&&delete s.headers[p]}break;case"text/plain":{s.body=r.text;const p=ee(s.headers,"content-type");p&&delete s.headers[p]}break;case"multipart/form-data":{if(r.params){s.multipart=r.params.map(l=>l.fileName&&!l.value?{name:l.name,content:new Mo(l.fileName)}:{name:l.name,content:l.value});const p=ee(s.headers,"content-type");p&&delete s.headers[p]}break}}switch(ue(s.headers,"accept")){case"application/json":{s.accept=new Nr("json");const p=ee(s.headers,"accept");p&&delete s.headers[p]}break}if(e(`(require '[clj-http.client :as client])
11`),Ln(Ir(s)))e(`(client/${n} "${i}")`);else{const p=11+n.length+i.length,l=Ve(p,sr(Ir(s)));e(`(client/${n} "${i}" ${l})`)}return o()}},Fo={info:{key:"clojure",title:"Clojure",default:"clj_http"},clientsById:{clj_http:Ho}},Bo=t=>{let n=ue(t,"accept-encoding");if(!n)return[];const r={gzip:"DecompressionMethods.GZip",deflate:"DecompressionMethods.Deflate"},i=[];return typeof n=="string"&&(n=[n]),n.forEach(f=>{f.split(",").forEach(c=>{const e=/\s*([^;\s]+)/.exec(c);if(e){const o=r[e[1]];o&&i.push(o)}})}),i},Wo={info:{key:"httpclient",title:"HttpClient",link:"https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient",description:".NET Standard HTTP Client",extname:".cs"},convert:({allHeaders:t,postData:n,method:r,fullUrl:i},f)=>{var h,u;const c={indent:"    ",...f},{push:e,join:o}=new I({indent:c.indent});e("using System.Net.Http.Headers;");let a="";const s=!!t.cookie,p=Bo(t);(s||p.length)&&(a="clientHandler",e("var clientHandler = new HttpClientHandler"),e("{"),s&&e("UseCookies = false,",1),p.length&&e(`AutomaticDecompression = ${p.join(" | ")},`,1),e("};")),e(`var client = new HttpClient(${a});`),e("var request = new HttpRequestMessage"),e("{");const l=["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","TRACE"];r=r.toUpperCase(),r&&l.includes(r)?r=`HttpMethod.${r[0]}${r.substring(1).toLowerCase()}`:r=`new HttpMethod("${r}")`,e(`Method = ${r},`,1),e(`RequestUri = new Uri("${i}"),`,1);const m=Object.keys(t).filter(y=>{switch(y.toLowerCase()){case"content-type":case"content-length":case"accept-encoding":return!1;default:return!0}});if(m.length&&(e("Headers =",1),e("{",1),m.forEach(y=>{e(`{ "${y}", "${K(t[y])}" },`,2)}),e("},",1)),n.text){const y=n.mimeType;switch(y){case"application/x-www-form-urlencoded":e("Content = new FormUrlEncodedContent(new Dictionary<string, string>",1),e("{",1),(h=n.params)==null||h.forEach(d=>{e(`{ "${d.name}", "${d.value}" },`,2)}),e("}),",1);break;case"multipart/form-data":e("Content = new MultipartFormDataContent",1),e("{",1),(u=n.params)==null||u.forEach(d=>{e(`new StringContent(${JSON.stringify(d.value||"")})`,2),e("{",2),e("Headers =",3),e("{",3),d.contentType&&e(`ContentType = new MediaTypeHeaderValue("${d.contentType}"),`,4),e('ContentDisposition = new ContentDispositionHeaderValue("form-data")',4),e("{",4),e(`Name = "${d.name}",`,5),d.fileName&&e(`FileName = "${d.fileName}",`,5),e("}",4),e("}",3),e("},",2)}),e("},",1);break;default:e(`Content = new StringContent(${JSON.stringify(n.text||"")})`,1),e("{",1),e("Headers =",2),e("{",2),e(`ContentType = new MediaTypeHeaderValue("${y}")`,3),e("}",2),e("}",1);break}}return e("};"),e("using (var response = await client.SendAsync(request))"),e("{"),e("response.EnsureSuccessStatusCode();",1),e("var body = await response.Content.ReadAsStringAsync();
11",1),e("Console.WriteLine(body);",1),e("}"),o()}};function Go(t){return t[0].toUpperCase()+t.slice(1).toLowerCase()}var Jo={info:{key:"restsharp",title:"RestSharp",link:"http://restsharp.org/",description:"Simple REST and HTTP API Client for .NET",extname:".cs",installation:"dotnet add package RestSharp"},convert:({method:t,fullUrl:n,headersObj:r,cookies:i,postData:f,uriObj:c})=>{const{push:e,join:o}=new I;if(!["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"].includes(t.toUpperCase()))return"Method not supported";e(`using RestSharp;
12
13`),e(`var options = new RestClientOptions("${n}");`),e("var client = new RestClient(options);"),e('var request = new RestRequest("");');const s=f.mimeType&&f.mimeType==="multipart/form-data";switch(s&&e("request.AlwaysMultipartFormData = true;"),Object.keys(r).forEach(p=>{if(f.mimeType&&p.toLowerCase()==="content-type"&&f.text){s&&f.boundary&&e(`request.FormBoundary = "${f.boundary}";`);return}e(`request.AddHeader("${p}", "${K(r[p])}");`)}),i.forEach(({name:p,value:l})=>{e(`request.AddCookie("${p}", "${K(l)}", "${c.pathname}", "${c.host}");`)}),f.mimeType){case"multipart/form-data":if(!f.params)break;f.params.forEach(p=>{p.fileName?e(`request.AddFile("${p.name}", "${p.fileName}");`):e(`request.AddParameter("${p.name}", "${p.value}");`)});break;case"application/x-www-form-urlencoded":if(!f.params)break;f.params.forEach(p=>{e(`request.AddParameter("${p.name}", "${p.value}");`)});break;case"application/json":{if(!f.text)break;const p=JSON.stringify(f.text);e(`request.AddJsonBody(${p}, false);`);break}default:if(!f.text)break;e(`request.AddStringBody("${f.text}", "${f.mimeType}");`)}return e(`var response = await client.${Go(t)}Async(request);
14`),e(`Console.WriteLine("{0}", response.Content);
15`),o()}},zo={info:{key:"csharp",title:"C#",default:"restsharp",cli:"dotnet"},clientsById:{httpclient:Wo,restsharp:Jo}},Do={info:{key:"native",title:"NewRequest",link:"http://golang.org/pkg/net/http/#NewRequest",description:"Golang HTTP client request",extname:".go"},convert:({postData:t,method:n,allHeaders:r,fullUrl:i},f={})=>{const{blank:c,push:e,join:o}=new I({indent:"	"}),{showBoilerplate:a=!0,checkErrors:s=!1,printBody:p=!0,timeout:l=-1}=f,m=s?"err":"_",h=a?1:0,u=()=>{s&&(e("if err != nil {",h),e("panic(err)",h+1),e("}",h))};a&&(e("package main"),c(),e("import ("),e('"fmt"',h),l>0&&e('"time"',h),t.text&&e('"strings"',h),e('"net/http"',h),p&&e('"io"',h),e(")"),c(),e("func main() {"),c());const y=l>0,d=y,w=d?"client":"http.DefaultClient";return d&&(e("client := http.Client{",h),y&&e(`Timeout: time.Duration(${l} * time.Second),`,h+1),e("}",h),c()),e(`url := "${i}"`,h),c(),t.text?(e(`payload := strings.NewReader(${JSON.stringify(t.text)})`,h),c(),e(`req, ${m} := http.NewRequest("${n}", url, payload)`,h),c()):(e(`req, ${m} := http.NewRequest("${n}", url, nil)`,h),c()),u(),Object.keys(r).length&&(Object.keys(r).forEach(v=>{e(`req.Header.Add("${v}", "${K(r[v])}")`,h)}),c()),e(`res, ${m} := ${w}.Do(req)`,h),u(),p&&(c(),e("defer res.Body.Close()",h),e(`body, ${m} := io.ReadAll(res.Body)`,h),u()),c(),p&&e("fmt.Println(string(body))",h),a&&(c(),e("}")),o()}},Vo={info:{key:"go",title:"Go",default:"native",cli:"go"},clientsById:{native:Do}},Lr=`\r
16`,Ko={info:{key:"http1.1",title:"HTTP/1.1",link:"https://tools.ietf.org/html/rfc7230",description:"HTTP/1.1 request string in accordance with RFC 7230",extname:null},convert:({method:t,fullUrl:n,uriObj:r,httpVersion:i,allHeaders:f,postData:c},e)=>{const o={absoluteURI:!1,autoContentLength:!0,autoHost:!0,...e},{blank:a,push:s,join:p}=new I({indent:"",join:Lr}),l=o.absoluteURI?n:r.path;s(`${t} ${l} ${i}`);const m=Object.keys(f);if(m.forEach(y=>{const d=y.toLowerCase().replace(/(^|-)(\w)/g,w=>w.toUpperCase());s(`${d}: ${f[y]}`)}),o.autoHost&&!m.includes("host")&&s(`Host: ${r.host}`),o.autoContentLength&&c.text&&!m.includes("content-length")){const y=Buffer.byteLength(c.text,"ascii").toString();s(`Content-Length: ${y}`)}a();const h=p(),u=c.text||"";return`${h}${Lr}${u}`}},Qo={info:{key:"http",title:"HTTP",default:"http1.1"},clientsById:{"http1.1":Ko}},Yo={info:{key:"asynchttp",title:"AsyncHttp",link:"https://github.com/AsyncHttpCl
16ient/async-http-client",description:"Asynchronous Http and WebSocket Client library for Java",extname:".java"},convert:({method:t,allHeaders:n,postData:r,fullUrl:i},f)=>{const c={indent:"  ",...f},{blank:e,push:o,join:a}=new I({indent:c.indent});return o("AsyncHttpClient client = new DefaultAsyncHttpClient();"),o(`client.prepare("${t.toUpperCase()}", "${i}")`),Object.keys(n).forEach(s=>{o(`.setHeader("${s}", "${K(n[s])}")`,1)}),r.text&&o(`.setBody(${JSON.stringify(r.text)})`,1),o(".execute()",1),o(".toCompletableFuture()",1),o(".thenAccept(System.out::println)",1),o(".join();",1),e(),o("client.close();"),a()}},Xo={info:{key:"nethttp",title:"java.net.http",link:"https://openjdk.java.net/groups/net/httpclient/intro.html",description:"Java Standardized HTTP Client API",extname:".java"},convert:({allHeaders:t,fullUrl:n,method:r,postData:i},f)=>{const c={indent:"  ",...f},{push:e,join:o}=new I({indent:c.indent});return e("HttpRequest request = HttpRequest.newBuilder()"),e(`.uri(URI.create("${n}"))`,2),Object.keys(t).forEach(a=>{e(`.header("${a}", "${K(t[a])}")`,2)}),i.text?e(`.method("${r.toUpperCase()}", HttpRequest.BodyPublishers.ofString(${JSON.stringify(i.text)}))`,2):e(`.method("${r.toUpperCase()}", HttpRequest.BodyPublishers.noBody())`,2),e(".build();",2),e("HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyH
16andlers.ofString());"),e("System.out.println(response.body());"),o()}},Zo={info:{key:"okhttp",title:"OkHttp",link:"http://square.github.io/okhttp/",description:"An HTTP Request Client Library",extname:".java"},convert:({postData:t,method:n,fullUrl:r,allHeaders:i},f)=>{const c={indent:"  ",...f},{push:e,blank:o,join:a}=new I({indent:c.indent}),s=["GET","POST","PUT","DELETE","PATCH","HEAD"],p=["POST","PUT","DELETE","PATCH"];return e("OkHttpClient client = new OkHttpClient();"),o(),t.text&&(t.boundary?e(`MediaType mediaType = MediaType.parse("${t.mimeType}; boundary=${t.boundary}");`):e(`MediaType mediaType = MediaType.parse("${t.mimeType}");`),e(`RequestBody body = RequestBody.create(mediaType, ${JSON.stringify(t.text)});`)),e("Request request = new Request.Builder()"),e(`.url("${r}")`,1),s.includes(n.toUpperCase())?p.includes(n.toUpperCase())?t.text?e(`.${n.toLowerCase()}(body)`,1):e(`.${n.toLowerCase()}(null)`,1):e(`.${n.toLowerCase()}()`,1):t.text?e(`.method("${n.toUpperCase()}", body)`,1):e(`.method("${n.toUpperCase()}
16", null)`,1),Object.keys(i).forEach(l=>{e(`.addHeader("${l}", "${K(i[l])}")`,1)}),e(".build();",1),o(),e("Response response = client.newCall(request).execute();"),a()}},ei={info:{key:"unirest",title:"Unirest",link:"http://unirest.io/java.html",description:"Lightweight HTTP Request Client Library",extname:".java"},convert:({method:t,allHeaders:n,postData:r,fullUrl:i},f)=>{const c={indent:"  ",...f},{join:e,push:o}=new I({indent:c.indent});return["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"].includes(t.toUpperCase())?o(`HttpResponse<String> response = Unirest.${t.toLowerCase()}("${i}")`):o(`HttpResponse<String> response = Unirest.customMethod("${t.toUpperCase()}","${i}")`),Object.keys(n).forEach(s=>{o(`.header("${s}", "${K(n[s])}")`,1)}),r.text&&o(`.body(${JSON.stringify(r.text)})`,1),o(".asString();",1),e()}},ti={info:{key:"java",title:"Java",default:"unirest"},clientsById:{asynchttp:Yo,nethttp:Xo,okhttp:Zo,unirest:ei}},ri={info:{key:"axios",title:"Axios",link:"https://github.com/axios/axios",description:"Promise based HTTP client for the browser and node.js",extname:".js",installation:"npm install axios --save"},convert:({allHeaders:t,method:n,url:r,queryObj:i,postData:f},c)=>{const e={indent:"  ",...c},{blank:o,push:a,join:s,addPostProcessor:p}=new I({indent:e.indent});a("import axios from 'axios';"),o();const l={method:n,url:r};switch(Object.keys(i).length&&(l.params=i),Object.keys(t).length&&(l.headers=t),f.mimeType){case"application/x-www-form-urlencoded":f.params&&(a("const encodedParams = new URLSearchParams();"),f.params.forEach(h=>{a(`encodedParams.set('${h.name}', '${h.value}');`)}),o(),l.data="encodedParams,",p(h=>h.replace(/'encodedParams,'/,"encodedParams,")));break;case"application/json":f.jsonObj&&(l.data=f.jsonObj);break;case"multipart/form-data":if(!f.params)break;a("const form = new FormData();"),f.params.forEach(h=>{a(`form.append('${h.name}', '${h.value||h.fileName||""}');`)}),o(),l.data="[form]";break;default:f.text&&(l.data=f.text)}const m=le(l,{indent:"  ",inlineCharacterLimit:80}).replace('"[form]"',"form");return a(`const options = ${m};`),o(),a("axios"),a(".request(options)",1),a(".then(res => console.log(res.data))",1),a(".catch(err => console.error(err));",1),s()}},ni={info:{key:"fetch",title:"fetch",link:"https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch",description:"Perform asynchronous HTTP requests with the Fetch API",extname:".js"},convert:({method:t,allHeaders:n,postData:r,fullUrl:i},f)=>{const c={indent:"  ",credentials:null,...f},{blank:e,join:o,push:a}=new I({indent:c.indent}),s={method:t};switch(Object.keys(n).length&&(s.headers=n),c.credentials!==null&&(s.credentials=c.credentials),r.mimeType){case"application/x-www-form-urlencoded":s.body=r.paramsObj?r.paramsObj:r.text;break;case"application/json":r.jsonObj&&(s.body=r.jsonObj);break;case"multipart/form-data":if(!r.params)break;const p=ee(n,"content-type");p&&delete n[p],a("const form = new FormData();"),r.params.forEach(l=>{a(`form.append('${l.name}', '${l.value||l.fileName||""}');`)}),e();break;default:r.text&&(s.body=r.text)}return s.headers&&!Object.keys(s.headers).length&&delete s.headers,a(`const options = ${le(s,{indent:c.indent,inlineCharacterLimit:80,transform:(p,l,m)=>{if(l==="body"){if(r.mimeType==="application/x-www-form-urlencoded")return`new URLSearchParams(${m})`;if(r.mimeType==="application/json")return`JSON.stringify(${m})`}return m}})};`),e(),r.params&&r.mimeType==="multipart/form-data"&&(a("options.body = form;"),e()),a(`fetch('${i}', options)`),a(".then(res => res.json())",1),a(".then(res => console.log(res))",1),a(".catch(err => console.error(err));",1),o()}},oi={info:{key:"jquery",title:"jQuery",link:"http://api.jquery.com/jquery.ajax/",description:"Perform an asynchronous HTTP (Ajax) requests with jQuery",extname:".js"},convert:({fullUrl:t,method:n,allHeaders:r,postData:i},f)=>{var l;const c={indent:"  ",...f},{blank:e,push:o,join:a}=new I({indent:c.indent}),s={async:!0,crossDomain:!0,url:t,method:n,headers:r};switch(i.mimeType){case"application/x-www-form-urlencoded":s.data=i.paramsObj?i.paramsObj:i.text;break;case"application/json":s.processData=!1,s.data=i.text;break;case"multipart/form-data":if(!i.params)break;if(o("const form = new FormData();
16"),i.params.forEach(m=>{o(`form.append('${m.name}', '${m.value||m.fileName||""}');`)}),s.processData=!1,s.contentType=!1,s.mimeType="multipart/form-data",s.data="[form]",Qe(r,"content-type")&&(l=ue(r,"content-type"))!=null&&l.includes("boundary")){const m=ee(r,"content-type");m&&delete s.headers[m]}e();break;default:i.text&&(s.data=i.text)}const p=le(s,{indent:c.indent}).replace("'[form]'","form");return o(`const settings = ${p};`),e(),o("$.ajax(settings).done(res => {"),o("console.log(res);",1),o("});"),a()}},ii={info:{key:"xhr",title:"XMLHttpRequest",link:"https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest",description:"W3C Standard API that provides scripted client functionality",extname:".js"},convert:({postData:t,allHeaders:n,method:r,fullUrl:i},f)=>{var s;const c={indent:"  ",cors:!0,...f},{blank:e,push:o,join:a}=new I({indent:c.indent});switch(t.mimeType){case"application/json":o(`const data = JSON.stringify(${le(t.jsonObj,{indent:c.indent})});`),e();break;case"multipart/form-data":if(!t.params)break;if(o("const data = new FormData();"),t.params.forEach(p=>{o(`data.append('${p.name}', '${p.value||p.fileName||""}');`)}),Qe(n,"content-type")&&(s=ue(n,"content-type"))!=null&&s.includes("boundary")){const p=ee(n,"content-type");p&&delete n[p]}e();break;default:o(`const data = ${t.text?`'${t.text}'`:"null"};`),e()}return o("const xhr = new XMLHttpRequest();"),c.cors&&o("xhr.withCredentials = true;"),e(),o("xhr.addEventListener('readystatechange', function () {"),o("if (this.readyState === this.DONE) {",1),o("console.log(this.responseText);",2),o("}",1),o("});"),e(),o(`xhr.open('${r}', '${i}');`),Object.keys(n).forEach(p=>{o(`xhr.setRequestHeader('${p}', '${Fe(n[p])}');`)}),e(),o("xhr.send(data);"),a()}},ai={info:{key:"javascript",title:"JavaScript",default:"fetch"},clientsById:{xhr:ii,axios:ri,fetch:ni,jquery:oi}},si={info:{key:"native",title:"Native JSON",link:"https://www.json.org/json-en.html",description:"A JSON represetation of any HAR payload.",extname:".json"},convert:({postData:t},n)=>{const r={indent:"  ",...n};let i="";switch(t.mimeType){case"application/x-www-form-urlencoded":i=t.paramsObj?t.paramsObj:t.text;break;case"application/json":t.jsonObj&&(i=t.jsonObj);break;case"multipart/form-data":if(!t.params)break;const f={};t.params.forEach(c=>{f[c.name]=c.value}),i=f;break;default:t.text&&(i=t.text)}return typeof i>"u"||i===""?"No JSON body":JSON.stringify(i,null,r.indent)}},ci={info:{key:"json",title:"JSON",default:"native"},clientsById:{native:si}},li={info:{key:"okhttp",title:"OkHttp",link:"http://square.github.io/okhttp/",description:"An HTTP Request Client Library",extname:".kt"},convert:({postData:t,fullUrl:n,method:r,allHeaders:i},f)=>{const c={indent:"  ",...f},{blank:e,join:o,push:a}=new I({indent:c.indent}),s=["GET","POST","PUT","DELETE","PATCH","HEAD"],p=["POST","PUT","DELETE","PATCH"];return a("val client = OkHttpClient()"),e(),t.text&&(t.boundary?a(`val mediaType = MediaType.parse("${t.mimeType}; boundary=${t.boundary}")`):a(`val mediaType = MediaType.parse("${t.mimeType}")`),a(`val body = RequestBody.create(mediaType, ${JSON.stringify(t.text)})`)),a("val request = Request.Builder()"),a(`.url("${n}")`,1),s.includes(r.toUpperCase())?p.includes(r.toUpperCase())?t.text?a(`.${r.toLowerCase()}(body)`,1):a(`.${r.toLowerCase()}(null)`,1):a(`.${r.toLowerCase()}()`,1):t.text?a(`.method("${r.toUpperCase()}", body)`,1):a(`.method("${r.toUpperCase()}
16", null)`,1),Object.keys(i).forEach(l=>{a(`.addHeader("${l}", "${K(i[l])}")`,1)}),a(".build()",1),e(),a("val response = client.newCall(request).execute()"),o()}},ui={info:{key:"kotlin",title:"Kotlin",default:"okhttp"},clientsById:{okhttp:li}},fi={info:{key:"axios",title:"Axios",link:"https://github.com/axios/axios",description:"Promise based HTTP client for the browser and node.js",extname:".js",installation:"npm install axios --save"},convert:({method:t,fullUrl:n,allHeaders:r,postData:i},f)=>{const c={indent:"  ",...f},{blank:e,join:o,push:a,addPostProcessor:s}=new I({indent:c.indent});a("import axios from 'axios';"),e();const p={method:t,url:n};switch(Object.keys(r).length&&(p.headers=r),i.mimeType){case"application/x-www-form-urlencoded":i.params&&(a("const encodedParams = new URLSearchParams();"),i.params.forEach(m=>{a(`encodedParams.set('${m.name}', '${m.value}');`)}),e(),p.data="encodedParams,",s(m=>m.replace(/'encodedParams,'/,"encodedParams,")));break;case"application/json":i.jsonObj&&(p.data=i.jsonObj);break;default:i.text&&(p.data=i.text)}const l=le(p,{indent:"  ",inlineCharacterLimit:80});return a(`const options = ${l};`),e(),a("axios"),a(".request(options)",1),a(".then(res => console.log(res.data))",1),a(".catch(err => console.error(err));",1),o()}},pi={info:{key:"fetch",title:"fetch",link:"https://nodejs.org/docs/latest/api/globals.html#fetch",description:"Perform asynchronous HTTP requests with the Fetch API",extname:".js"},convert:({method:t,fullUrl:n,postData:r,headersObj:i,cookies:f},c)=>{var y;const e={indent:"  ",...c};let o=!1;const{blank:a,push:s,join:p,unshift:l}=new I({indent:e.indent}),m=n,h={method:t};switch(Object.keys(i).length&&(h.headers=i),r.mimeType){case"application/x-www-form-urlencoded":s("const encodedParams = new URLSearchParams();"),(y=r.params)==null||y.forEach(w=>{s(`encodedParams.set('${w.name}', '${w.value}');`)}),h.body="encodedParams",a();break;case"application/json":r.jsonObj&&(h.body=r.jsonObj);break;case"multipart/form-data":if(!r.params)break;const d=ee(i,"content-type");d&&delete i[d],s("const formData = new FormData();"),r.params.forEach(w=>{if(!w.fileName&&!w.fileName&&!w.contentType){s(`formData.append('${w.name}', '${w.value}');`);return}w.fileName&&(o=!0,s(`formData.append('${w.name}', await new Response(fs.createReadStream('${w.fileName}')).blob());`))}),h.body="formData",a();break;default:r.text&&(h.body=r.text)}if(f.length){const d=f.map(({name:w,value:v})=>`${encodeURIComponent(w)}=${encodeURIComponent(v)}`).join("; ");h.headers||(h.headers={}),h.headers.cookie=d}s(`const url = '${m}';`),h.headers&&!Object.keys(h.headers).length&&delete h.headers;const u=le(h,{indent:"  ",inlineCharacterLimit:80,transform:(d,w,v)=>w==="body"&&r.mimeType==="application/json"?`JSON.stringify(${v})`:v});return s(`const options = ${u};`),a(),o&&l(`import fs from 'fs';
17`),s("fetch(url, options)"),s(".then(res => res.json())",1),s(".then(json => console.log(json))",1),s(".catch(err => console.error(err));",1),p().replace(/'encodedParams'/,"encodedParams").replace(/'formData'/,"formData")}},di={info:{key:"native",title:"HTTP",link:"http://nodejs.org/api/http.html#http_http_request_options_callback",description:"Node.js native HTTP interface",extname:".cjs"},convert:({uriObj:t,method:n,allHeaders:r,postData:i},f={})=>{var l;const{indent:c="  "}=f,{blank:e,join:o,push:a,unshift:s}=new I({indent:c}),p={method:n,hostname:t.hostname,port:t.port,path:t.path,headers:r};switch(a(`const http = require('${(l=t.protocol)==null?void 0:l.replace(":","")}');`),e(),a(`const options = ${le(p,{indent:c})};`),e(),a("const req = http.request(options, function (res) {"),a("const chunks = [];",1),e(),a("res.on('data', function (chunk) {",1),a("chunks.push(chunk);",2),a("});",1),e(),a("res.on('end', function () {",1),a("const body = Buffer.concat(chunks);",2),a("console.log(body.toString());",2),a("});",1),a("});"),e(),i.mimeType){case"application/x-www-form-urlencoded":i.paramsObj&&(s("const qs = require('querystring');"),a(`req.write(qs.stringify(${le(i.paramsObj,{indent:"  ",inlineCharacterLimit:80})}));`));break;case"application/json":i.jsonObj&&a(`req.write(JSON.stringify(${le(i.jsonObj,{indent:"  ",inlineCharacterLimit:80})}));`);break;default:i.text&&a(`req.write(${le(i.text,{indent:c}
17)});`)}return a("req.end();"),o()}},yi={info:{key:"node",title:"Node.js",default:"fetch",cli:"node %s"},clientsById:{native:di,axios:fi,fetch:pi}},dt=(t,n,r,i)=>{const f=`${t} *${n} = `,c=cr(r,i?f.length:void 0);return`${f}${c};`},cr=(t,n)=>{const r=n===void 0?", ":`,
18   ${" ".repeat(n)}`;switch(Object.prototype.toString.call(t)){case"[object Number]":return`@${t}`;case"[object Array]":return`@[ ${t.map(f=>cr(f)).join(r)} ]`;case"[object Object]":{const i=[];return Object.keys(t).forEach(f=>{i.push(`@"${f}": ${cr(t[f])}`)}),`@{ ${i.join(r)} }`}case"[object Boolean]":return t?"@YES":"@NO";default:return t==null?"":`@"${t.toString().replace(/"/g,'\\"')}"`}},hi={info:{key:"nsurlsession",title:"NSURLSession",link:"https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/index.html",description:"Foundation's NSURLSession request",extname:".m"},convert:({allHeaders:t,postData:n,method:r,fullUrl:i},f)=>{var p;const c={indent:"    ",pretty:!0,timeout:10,...f},{push:e,join:o,blank:a}=new I({indent:c.indent}),s={hasHeaders:!1,hasBody:!1};if(e("#import <Foundation/Foundation.h>"),Object.keys(t).length&&(s.hasHeaders=!0,a(),e(dt("NSDictionary","headers",t,c.pretty))),n.text||n.jsonObj||n.params)switch(s.hasBody=!0,n.mimeType){case"application/x-www-form-urlencoded":if((p=n.params)!=null&&p.length){a();const[l,...m]=n.params;e(`NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"${l.name}=${l.value}" dataUsingEncoding:NSUTF8StringEncoding]];`),m.forEach(({name:h,value:u})=>{e(`[postData appendData:[@"&${h}=${u}" dataUsingEncoding:NSUTF8StringEncoding]];`)})}else s.hasBody=!1;break;case"application/json":n.jsonObj&&(e(dt("NSDictionary","parameters",n.jsonObj,c.pretty)),a(),e("NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];"));break;case"multipart/form-data":e(dt("NSArray","parameters",n.params||[],c.pretty)),e(`NSString *boundary = @"${n.boundary}";`),a(),e("NSError *error;"),e("NSMutableString *body = [NSMutableString string];"),e("for (NSDictionary *param in parameters) {"),e('[body appendFormat:@"--%@\\r\\n", boundary];',1),e('if (param[@"fileName"]) {',1),e('[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"; filename=\\"%@\\"\\r\\n", param[@"name"], param[@"fileName"]];',2),e('[body appendFormat:@"Content-Type: %@\\r\\n\\r\\n", param[@"contentType"]];',2),e('[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];',2),e("if (error) {",2),e('NSLog(@"%@", error);',3),e("}",2),e("} else {",1),e('[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"\\r\\n\\r\\n", param[@"name"]];',2),e('[body appendFormat:@"%@", param[@"value"]];',2),e("}",1),e("}"),e('[body appendFormat:@"\\r\\n--%@--\\r\\n", boundary];'),e("NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];");break;default:a(),e(`NSData *postData = [[NSData alloc] initWithData:[@"${n.text}" dataUsingEncoding:NSUTF8StringEncoding]];`)}return a(),e(`NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"${i}"]`),e("                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy"),e(`                                                   timeoutInterval:${c.timeout.toFixed(1)}];`),e(`[request setHTTPMethod:@"${r}"];`),s.hasHeaders&&e("[request setAllHTTPHeaderFields:headers];"),s.hasBody&&e("[request setHTTPBody:postData];"),a(),e("NSURLSession *session = [NSURLSession sharedSession];"),e("NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request"),e("                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {"),e("                                            if (error) {",1),e('                                            NSLog(@"%@", error);',2),e("                                            } else {",1),e("                                            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;",2),e('                                            NSLog(@"%@", httpResponse);',2),e("                                            }",1),e("                                            }];"),e("[dataTask resume];"),o()}},mi={info:{key:"objc",title:"Objective-C",default:"nsurlsession"},clientsById:{nsurlsession:hi}},vi={info:{key:"cohttp",title:"CoHTTP",link:"https://github.com/mirage/ocaml-cohttp",description:"Cohttp is a very lightweight HTTP server using Lwt or Async for OCaml",extname:".ml",installation:"opam install c
18ohttp-lwt-unix cohttp-async"},convert:({fullUrl:t,allHeaders:n,postData:r,method:i},f)=>{const c={indent:"  ",...f},e=["get","post","head","delete","patch","put","options"],{push:o,blank:a,join:s}=new I({indent:c.indent});o("open Cohttp_lwt_unix"),o("open Cohttp"),o("open Lwt"),a(),o(`let uri = Uri.of_string "${t}" in`);const p=Object.keys(n);p.length===1?o(`let headers = Header.add (Header.init ()) "${p[0]}" "${K(n[p[0]])}" in`):p.length>1&&(o("let headers = Header.add_list (Header.init ()) ["),p.forEach(u=>{o(`("${u}", "${K(n[u])}");`,1)}),o("] in")),r.text&&o(`let body = Cohttp_lwt_body.of_string ${JSON.stringify(r.text)} in`),a();const l=p.length?"~headers ":"",m=r.text?"~body ":"",h=e.includes(i.toLowerCase())?`\`${i.toUpperCase()}`:`(Code.method_of_string "${i}")`;return o(`Client.call ${l}${m}${h} uri`),o(">>= fun (res, body_stream) ->"),o("(* Do stuff with the result *)",1),s()}},gi={info:{key:"ocaml",title:"OCaml",default:"cohttp"},clientsById:{cohttp:vi}},G=(t,n,r)=>{switch(r=r||"",n=n||"",Object.prototype.toString.call(t)){case"[object Boolean]":return t;case"[object Null]":return"null";case"[object Undefined]":return"null";case"[object String]":return`'${He(t,{delimiter:"'",escapeNewlines:!1})}'`;case"[object Number]":return t.toString();case"[object Array]":{const i=t.map(f=>G(f,`${n}${n}`,n)).join(`,
19${n}`);return`[
20${n}${i}
21${r}]`}case"[object Object]":{const i=[];for(const f in t)Object.prototype.hasOwnProperty.call(t,f)&&i.push(`${G(f,n)} => ${G(t[f],`${n}${n}`,n)}`);return`[
22${n}${i.join(`,
23${n}`)}
24${r}]`}default:return"null"}},Ur=["ACL","BASELINE_CONTROL","CHECKIN","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LABEL","LOCK","MERGE","MKACTIVITY","MKCOL","MKWORKSPACE","MOVE","OPTIONS","POST","PROPFIND","PROPPATCH","PUT","REPORT","TRACE","UNCHECKOUT","UNLOCK","UPDATE","VERSION_CONTROL"],bi={info:{key:"curl",title:"cURL",link:"http://php.net/manual/en/book.curl.php",description:"PHP with ext-curl",extname:".php"},convert:({uriObj:t,postData:n,fullUrl:r,method:i,httpVersion:f,cookies:c,headersObj:e},o={})=>{const{closingTag:a=!1,indent:s="  ",maxRedirects:p=10,namedErrors:l=!1,noTags:m=!1,shortTags:h=!1,timeout:u=30}=o,{push:y,blank:d,join:w}=new I({indent:s});m||(y(h?"<?":"<?php"),d()),y("$curl = curl_init();"),d();const v=[{escape:!0,name:"CURLOPT_PORT",value:t.port},{escape:!0,name:"CURLOPT_URL",value:r},{escape:!1,name:"CURLOPT_RETURNTRANSFER",value:"true"},{escape:!0,name:"CURLOPT_ENCODING",value:""},{escape:!1,name:"CURLOPT_MAXREDIRS",value:p},{escape:!1,name:"CURLOPT_TIMEOUT",value:u},{escape:!1,name:"CURLOPT_HTTP_VERSION",value:f==="HTTP/1.0"?"CURL_HTTP_VERSION_1_0":"CURL_HTTP_VERSION_1_1"},{escape:!0,name:"CURLOPT_CUSTOMREQUEST",value:i},{escape:!n.jsonObj,name:"CURLOPT_POSTFIELDS",value:n?n.jsonObj?`json_encode(${G(n.jsonObj,s.repeat(2),s)})`:n.text:void 0}];y("curl_setopt_array($curl, [");const E=new I({indent:s,join:`
25${s}`});v.forEach(({value:S,name:g,escape:O})=>{S!=null&&E.push(`${g} => ${O?JSON.stringify(S):S},`)});const j=c.map(S=>`${encodeURIComponent(S.name)}=${encodeURIComponent(S.value)}`);j.length&&E.push(`CURLOPT_COOKIE => "${j.join("; ")}",`);const P=Object.keys(e).sort().map(S=>`"${S}: ${K(e[S])}"`);return P.length&&(E.push("CURLOPT_HTTPHEADER => ["),E.push(P.join(`,
26${s}${s}`),1),E.push("],")),y(E.join(),1),y("]);"),d(),y("$response = curl_exec($curl);"),y("$err = curl_error($curl);"),d(),y("curl_close($curl);"),d(),y("if ($err) {"),y(l?'echo array_flip(get_defined_constants(true)["curl"])[$err];':'echo "cURL Error #:" . $err;',1),y("} else {"),y("echo $response;",1),y("}"),!m&&a&&(d(),y("?>")),w()}},$i={info:{key:"guzzle",title:"Guzzle",link:"http://docs.guzzlephp.org/en/stable/",description:"PHP with Guzzle",extname:".php",installation:"composer require guzzlehttp/guzzle"},convert:({postData:t,fullUrl:n,method:r,cookies:i,headersObj:f},c)=>{var y;const e={closingTag:!1,indent:"  ",noTags:!1,shortTags:!1,...c},{push:o,blank:a,join:s}=new I({indent:e.indent}),{code:p,push:l,join:m}=new I({indent:e.indent});switch(e.noTags||o(e.shortTags?"<?":"<?php"),o("require_once('vendor/autoload.php');"),a(),t.mimeType){case"application/x-www-form-urlencoded":l(`'form_params' => ${G(t.paramsObj,e.indent+e.indent,e.indent)},`,1);break;case"multipart/form-data":{const d=[];
26if(t.params&&t.params.forEach(w=>{if(w.fileName){const v={name:w.name,filename:w.fileName,contents:w.value};w.contentType&&(v.headers={"Content-Type":w.contentType}),d.push(v)}else w.value&&d.push({name:w.name,contents:w.value})}),d.length&&(l(`'multipart' => ${G(d,e.indent+e.indent,e.indent)}`,1),Qe(f,"content-type")&&(y=ue(f,"content-type"))!=null&&y.indexOf("boundary"))){const w=ee(f,"content-type");w&&delete f[w]}break}default:t.text&&l(`'body' => ${G(t.text)},`,1)}const h=Object.keys(f).sort().map(function(d){return`${e.indent}${e.indent}'${d}' => '${Fe(f[d])}',`}),u=i.map(d=>`${encodeURIComponent(d.name)}=${encodeURIComponent(d.value)}`).join("; ");return u.length&&h.push(`${e.indent}${e.indent}'cookie' => '${Fe(u)}',`),h.length&&(l("'headers' => [",1),l(h.join(`
27`)),l("],",1)),o("$client = new \\GuzzleHttp\\Client();"),a(),p.length?(o(`$response = $client->request('${r}', '${n}', [`),o(m()),o("]);")):o(`$response = $client->request('${r}', '${n}');`),a(),o("echo $response->getBody();"),!e.noTags&&e.closingTag&&(a(),o("?>")),s()}},wi={info:{key:"http1",title:"HTTP v1",link:"http://php.net/manual/en/book.http.php",description:"PHP with pecl/http v1",extname:".php"},convert:({method:t,url:n,postData:r,queryObj:i,headersObj:f,cookiesObj:c},e={})=>{const{closingTag:o=!1,indent:a="  ",noTags:s=!1,shortTags:p=!1}=e,{push:l,blank:m,join:h}=new I({indent:a});switch(s||(l(p?"<?":"<?php"),m()),Ur.includes(t.toUpperCase())||l(`HttpRequest::methodRegister('${t}');`),l("$request = new HttpRequest();"),l(`$request->setUrl(${G(n)});`),Ur.includes(t.toUpperCase())?l(`$request->setMethod(HTTP_METH_${t.toUpperCase()});`):l(`$request->setMethod(HttpRequest::HTTP_METH_${t.toUpperCase()});`),m(),Object.keys(i).length&&(l(`$request->setQueryData(${G(i,a)});`),m()),Object.keys(f).length&&(l(`$request->setHeaders(${G(f,a)});`),m()),Object.keys(c).length&&(l(`$request->setCookies(${G(c,a)});`),m()),r.mimeType){case"application/x-www-form-urlencoded":l(`$request->setContentType(${G(r.mimeType)});`),l(`$request->setPostFields(${G(r.paramsObj,a)});`),m();break;case"application/json":l(`$request->setContentType(${G(r.mimeType)});`),l(`$request->setBody(json_encode(${G(r.jsonObj,a)}));`),m();break;default:r.text&&(l(`$request->setBody(${G(r.text)});`),m())}return l("try {"),l("$response = $request->send();",1),m(),l("echo $response->getBody();",1),l("} catch (HttpException $ex) {"),l("echo $ex;",1),l("}"),!s&&o&&(m(),l("?>")),h()}},Si={info:{key:"http2",title:"HTTP v2",link:"http://devel-m6w6.rhcloud.com/mdref/http",description:"PHP with pecl/http v2",extname:".php"},convert:({postData:t,headersObj:n,method:r,queryObj:i,cookiesObj:f,url:c},e={})=>{var y;const{closingTag:o=!1,indent:a="  ",noTags:s=!1,shortTags:p=!1}=e,{push:l,blank:m,join:h}=new I({indent:a});let u=!1;switch(s||(l(p?"<?":"<?php"),m()),l("$client = new http\\Client;"),l("$request = new http\\Client\\Request;"),m(),t.mimeType){case"application/x-www-form-urlencoded":l("$body = new http\\Message\\Body;"),l(`$body->append(new http\\QueryString(${G(t.paramsObj,a)}));`),m(),u=!0;break;case"multipart/form-data":{if(!t.params)break;const d=[],w={};t.params.forEach(({name:j,fileName:P,value:S,contentType:g})=>{if(P){d.push({name:j,type:g,file:P,data:S});return}S&&(w[j]=S)});const v=Object.keys(w).length?G(w,a):"null",E=d.length?G(d,a):"null";if(l("$body = new http\\Message\\Body;"),l(`$body->addForm(${v}, ${E});`),Qe(n,"content-type")&&(y=ue(n,"content-type"))!=null&&y.indexOf("boundary")){const j=ee(n,"content-type");j&&delete n[j]}m(),u=!0;break}case"application/json":l("$body = new http\\Message\\Body;"),l(`$body->append(json_encode(${G(t.jsonObj,a)}));`),u=!0;break;default:t.text&&(l("$body = new http\\Message\\Body;"),l(`$body->append(${G(t.text)});`),m(),u=!0)}return l(`$request->setRequestUrl(${G(c)});`),l(`$request->setRequestMethod(${G(r)});`),u&&(l("$request->setBody($body);"),m()),Object.keys(i).length&&(l(`$request->setQuery(new http\\QueryString(${G(i,a)}));`),m()),Object.keys(n).length&&(l(`$request->setHeaders(${G(n,a)});`),m()),Object.keys(f).length&&(m(),l(`$client->setCookies(${G(f,a)});`),m()),l("$client->enqueue($request)->send();"),l("$response = $client->getResponse();"),m(),l("echo $response->getBody();"),!s&&o&&(m(),l("?>")),h()}},Oi={info:{key:"php",title:"PHP",default:"curl",cli:"php %s"},clientsById:{curl:bi,guzzle:$i,http1:wi,http2:Si}},Un=t=>({method:r,headersObj:i,cookies:f,uriObj:c,fullUrl:e,postData:o,allHeaders:a})=>{const{push:s,join:p}=new I;if(!["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"].includes(r.toUpperCase()))return"Method not supported";const m=[],h=Object.keys(i);return h.length&&(s("$headers=@{}"),h.forEach(u=>{u!=="connection"&&s(`$headers.Add("${u}", "${He(i[u],{escapeChar:"`"})}")`)}),m.push("-Headers $headers")),f.length&&(s("$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession"),f.forEach(u=>{s("$cookie = New-Object System.Net.Cookie"),s(`$cookie.Name = '${u.name}'`),s(`$cookie.Value = '${u.value}'`),s(`$cookie.Domain = '${c.host}'`),s("$session.Cookies.Add($cookie)")}),m.push("-WebSession $session")),o.text&&(m.push(`-ContentType '${He(ue(a,"content-type"),{delimiter:"'",escapeChar:"`"})}'`),m.push(`-Body '${o.text}'`)),s(`$response = ${t} -Uri '${e}' -Method ${r} ${m.join(" ")}`.trim()),p()},Ti={info:{key:"restmethod",title:"Invoke-RestMethod",link:"https://docs.microsoft.com/en-us
27/powershell/module/Microsoft.PowerShell.Utility/Invoke-RestMethod",description:"Powershell Invoke-RestMethod client",extname:".ps1"},convert:Un("Invoke-RestMethod")},Ei={info:{key:"webrequest",title:"Invoke-WebRequest",link:"https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Invoke-WebRequest",description:"Powershell Invoke-WebRequest client",extname:".ps1"},convert:Un("Invoke-WebRequest")},xi={info:{key:"powershell",title:"Powershell",default:"webrequest"},clientsById:{webrequest:Ei,restmethod:Ti}};function Mr(t,n,r,i,f){const c=i.repeat(f),e=i.repeat(f-1),o=r?`,
28${c}`:", ",a=t==="object"?"{":"[",s=t==="object"?"}":"]";return r?`${a}
29${c}${n.join(o)}
30${e}${s}`:t==="object"&&n.length>0?`${a} ${n.join(o)} ${s}`:`${a}${n.join(o)}${s}`}var Ae=(t,n,r)=>{switch(r=r===void 0?1:r+1,Object.prototype.toString.call(t)){case"[object Number]":return t;case"[object Array]":{let i=!1;const f=t.map(c=>(Object.prototype.toString.call(c)==="[object Object]"&&(i=Object.keys(c).length>1),Ae(c,n,r)));return Mr("array",f,i,n.indent,r)}case"[object Object]":{const i=[];for(const f in t)i.push(`"${f}": ${Ae(t[f],n,r)}`);return Mr("object",i,n.pretty&&i.length>1,n.indent,r)}case"[object Null]":return"None";case"[object Boolean]":return t?"True":"False";default:return t==null?"":`"${t.toString().replace(/"/g,'\\"')}"`}},Pi=["HEAD","GET","POST","PUT","PATCH","DELETE","OPTIONS"],Ri={info:{key:"requests",title:"Requests",link:"http://docs.python-requests.org/en/latest/api/#requests.request",description:"Requests HTTP library",extname:".py",installation:"python -m pip install requests"},convert:({fullUrl:t,postData:n,allHeaders:r,method:i},f)=>{const c={indent:"    ",pretty:!0,...f},{push:e,blank:o,join:a,addPostProcessor:s}=new I({indent:c.indent});e("import requests"),o(),e(`url = "${t}"`),o();const p=r;let l={};const m={};let h=!1,u=!1,y=!1;switch(n.mimeType){case"application/json":n.jsonObj&&(e(`payload = ${Ae(n.jsonObj,c)}`),y=!0,u=!0);break;case"multipart/form-data":if(!n.params)break;if(l={},n.params.forEach(v=>{v.fileName?(v.contentType?m[v.name]=`('${v.fileName}', open('${v.fileName}', 'rb'), '${v.contentType}')`:m[v.name]=`('${v.fileName}', open('${v.fileName}', 'rb'))`,h=!0):(l[v.name]=v.value,u=!0)}),h){e(`files = ${Ae(m,c)}`),u&&e(`payload = ${Ae(l,c)}`);const v=ee(p,"content-type");v&&delete p[v]}else{const v=JSON.stringify(n.text);v&&(e(`payload = ${v}`),u=!0)}s(v=>v.replace(/"\('(.+)', open\('(.+)', 'rb'\)\)"/g,'("$1", open("$2", "rb"))').replace(/"\('(.+)', open\('(.+)', 'rb'\), '(.+)'\)"/g,'("$1", open("$2", "rb"), "$3")'));break;default:{if(n.mimeType==="application/x-www-form-urlencoded"&&n.paramsObj){e(`payload = ${Ae(n.paramsObj,c)}`),u=!0;break}const v=JSON.stringify(n.text);v&&(e(`payload = ${v}`),u=!0)}}const d=Object.keys(p).length;if(d===0&&(u||h))o();else if(d===1)Object.keys(p).forEach(v=>{e(`headers = {"${v}": "${K(p[v])}"}`),o()});else if(d>1){let v=1;e("headers = {"),Object.keys(p).forEach(E=>{e(v!==d?`"${E}": "${K(p[E])}",`:`"${E}": "${K(p[E])}"`,1),v+=1}),e("}"),o()}let w=Pi.includes(i)?`response = requests.${i.toLowerCase()}(url`:`response = requests.request("${i}", url`;return u&&(y?w+=", json=payload":w+=", data=payload"),h&&(w+=", files=files"),d>0&&(w+=", headers=headers"),w+=")",e(w),o(),e("print(response.text)"),a()}},ji={info:{key:"python",title:"Python",default:"requests",cli:"python3 %s"},clientsById:{requests:Ri}},ki={info:{key:"httr",title:"httr",link:"https://cran.r-project.org/web/packages/httr/vignettes/quickstart.html",description:"httr: Tools for Working with URLs and HTTP",extname:".r"},convert:({url:t,queryObj:n,queryString:r,postData:i,allHeaders:f,method:c})=>{const{push:e,blank:o,join:a}=new I;e("library(httr)"),o(),e(`url <- "${t}"`),o();const s=n;delete n.key;const p=Object.keys(s).length;r.length===1?(e(`queryString <- list(${Object.keys(s)} = "${Object.values(s).toString()}")`),o()):r.length>1&&(e("queryString <- list("),Object.keys(s).forEach((P,S)=>{S!==p-1?e(`  ${P} = "${s[P].toString()}",`):e(`  ${P} = "${s[P].toString()}"`)}),e(")"),o());const l=JSON.stringify(i.text);if(l&&(e(`payload <- ${l}`),o()),i.text||i.jsonObj||i.params)switch(i.mimeType){case"application/x-www-form-urlencoded":e('encode <- "form"'),o();break;case"application/json":e('encode <- "json"'),o();break;case"multipart/form-data":e('encode <- "multipart"'),o();break;default:e('encode <- "raw"'),o();break}const m=ue(f,"cookie"),h=ue(f,"accept"),u=m?`set_cookies(\`${String(m).replace(/;/g,'", `').replace(/` /g,"`").replace(/[=]/g,'` = "')}")`:void 0,y=h?`accept("${K(h)}")`:void 0,d=`content_type("${K(i.mimeType)}")`,w=Object.entries(f).filter(([P])=>!["cookie","accept","content-type"].includes(P.toLowerCase())).map(([P,S])=>`'${P}' = '${Fe(S)}'`).join(", "),v=w?`add_headers(${w})`:void 0;let E=`response <- VERB("${c}", url`;l&&(E+=", body = payload"),r.length&&(E+=", query = queryString");const j=[v,d,y,u].filter(P=>!!P).join(", ");return j&&(E+=`, ${j}`),(i.text||i.jsonObj||i.params)&&(E+=", encode = encode"),E+=")",e(E),o(),e('content(response, "text")'),a()}},Ci={info:{key:"r",title:"R",default:"httr"},clientsById:{httr:ki}},_i={info:{key:"native",title:"net::http",link:"http://ruby-doc.org/stdlib-2.2.1/libdoc/net/http/rdoc/Net/HTTP.html",description:"Ruby HTTP client",extname:".rb"},convert:({uriObj:t,method:n,fullUrl:r,postData:i,allHeaders:f})=>{const{push:c,blank:e,join:o}=new I;
30c("require 'uri'"),c("require 'net/http'"),e();const a=n.toUpperCase(),s=["GET","POST","HEAD","DELETE","PATCH","PUT","OPTIONS","COPY","LOCK","UNLOCK","MOVE","TRACE"],p=a.charAt(0)+a.substring(1).toLowerCase();s.includes(a)||(c(`class Net::HTTP::${p} < Net::HTTPRequest`),c(`  METHOD = '${a.toUpperCase()}'`),c(`  REQUEST_HAS_BODY = '${i.text?"true":"false"}'`),c("  RESPONSE_HAS_BODY = true"),c("end"),e()),c(`url = URI("${r}")`),e(),c("http = Net::HTTP.new(url.host, url.port)"),t.protocol==="https:"&&c("http.use_ssl = true"),e(),c(`request = Net::HTTP::${p}.new(url)`);const l=Object.keys(f);return l.length&&l.forEach(m=>{c(`request["${m}"] = '${Fe(f[m])}'`)}),i.text&&c(`request.body = ${JSON.stringify(i.text)}`),e(),c("response = http.request(request)"),c("puts response.read_body"),o()}},Ai={info:{key:"ruby",title:"Ruby",default:"native"},clientsById:{native:_i}},Q=(t="")=>/^[a-z0-9-_/.@%^=:]+$/i.test(t)?t:`'${t.replace(/'/g,"'\\''")}'`,qi=t=>t.replace(/\r/g,"\\r").replace(/\n/g,"\\n"),Ni={"http1.0":"0","url ":"",cookie:"b",data:"d",form:"F",globoff:"g",header:"H",insecure:"k",request:"X"},Ii=t=>n=>{if(t){const r=Ni[n];return r?`-${r}`:""}return`--${n}`},Li={info:{key:"curl",title:"cURL",link:"http://curl.haxx.se/",description:"cURL is a command line tool and library for transferring data with URL syntax",extname:".sh"},convert:({fullUrl:t,method:n,httpVersion:r,headersObj:i,allHeaders:f,postData:c},e={})=>{var d;const{indent:o="  ",short:a=!1,binary:s=!1,globOff:p=!1}=e,l="  ",{push:m,join:h}=new I({...typeof o=="string"?{indent:o}:{},join:o!==!1?` \\
31${o}`:" "}),u=Ii(a);let y=Q(t);if(m(`curl ${u("request")} ${n}`),p&&(y=unescape(y),m(u("globoff"))),m(`${u("url ")}${y}`),r==="HTTP/1.0"&&m(u("http1.0")),ue(f,"accept-encoding")&&m("--compressed"),c.mimeType==="multipart/form-data"){const w=ee(i,"content-type");if(w){const v=i[w];if(w&&v){const E=String(v).replace(/; boundary.+?(?=(;|$))/,"");i[w]=E,f[w]=E}}}switch(Object.keys(i).sort().forEach(w=>{const v=`${w}: ${i[w]}`;m(`${u("header")} ${Q(v)}`)}),f.cookie&&m(`${u("cookie")} ${Q(f.cookie)}`),c.mimeType){case"multipart/form-data":(d=c.params)==null||d.forEach(v=>{let E="";v.fileName?E=`${v.name}='@${v.fileName}'`:E=Q(`${v.name}=${v.value}`),m(`${u("form")} ${E}`)});break;case"application/x-www-form-urlencoded":c.params?c.params.forEach(v=>{const E=v.name,j=encodeURIComponent(v.name),P=j!==E,S=P?j:E,g=s?"--data-binary":P?"--data-urlencode":u("data");m(`${g} ${Q(`${S}=${v.value}`)}`)}):m(`${s?"--data-binary":u("data")} ${Q(c.text)}`);break;default:if(!c.text)break;let w=!1;if(Uo(c.mimeType)&&c.text.length>20)try{const v=JSON.parse(c.text);w=!0,c.text.indexOf("'")>0?m(`${s?"--data-binary":u("data")} @- <<EOF
32${JSON.stringify(v,null,l)}
33EOF`):m(`${s?"--data-binary":u("data")} '
34${JSON.stringify(v,null,l)}
35'`)}catch{}w||m(`${s?"--data-binary":u("data")} ${Q(c.text)}`)}return h()}},Ui={info:{key:"httpie",title:"HTTPie",link:"http://httpie.org/",description:"a CLI, cURL-like tool for humans",extname:".sh",installation:"brew install httpie"},convert:({allHeaders:t,postData:n,queryObj:r,fullUrl:i,method:f,url:c},e)=>{const o={body:!1,cert:!1,headers:!1,indent:"  ",pretty:!1,print:!1,queryParams:!1,short:!1,style:!1,timeout:!1,verbose:!1,verify:!1,...e},{push:a,join:s,unshift:p}=new I({indent:o.indent,join:o.indent!==!1?` \\
36${o.indent}`:" "});let l=!1;const m=[];o.headers&&m.push(o.short?"-h":"--headers"),o.body&&m.push(o.short?"-b":"--body"),o.verbose&&m.push(o.short?"-v":"--verbose"),o.print&&m.push(`${o.short?"-p":"--print"}=${o.print}`),o.verify&&m.push(`--verify=${o.verify}`),o.cert&&m.push(`--cert=${o.cert}`),o.pretty&&m.push(`--pretty=${o.pretty}`),o.style&&m.push(`--style=${o.style}`),o.timeout&&m.push(`--timeout=${o.timeout}`),o.queryParams&&Object.keys(r).forEach(u=>{const y=r[u];Array.isArray(y)?y.forEach(d=>{a(`${u}==${Q(d)}`)}):a(`${u}==${Q(y)}`)}),Object.keys(t).sort().forEach(u=>{a(`${u}:${Q(t[u])}`)}),n.mimeType==="application/x-www-form-urlencoded"?n.params&&n.params.length&&(m.push(o.short?"-f":"--form"),n.params.forEach(u=>{a(`${u.name}=${Q(u.value)}`)})):l=!0;const h=m.length?`${m.join(" ")} `:"";if(c=Q(o.queryParams?c:i),p(`http ${h}${f} ${c}`),l&&n.text){const u=Q(n.text);p(`echo ${u} | `)}return s()}},Mi={info:{key:"wget",title:"Wget",link:"https://www.gnu.org/software/wget/",description:"a free software package for retrieving files using HTTP, HTTPS",extname:".sh"},convert:({method:t,postData:n,allHeaders:r,fullUrl:i},f)=>
36{const c={indent:"  ",short:!1,verbose:!1,...f},{push:e,join:o}=new I({...typeof c.indent=="string"?{indent:c.indent}:{},join:c.indent!==!1?` \\
37${c.indent}`:" "});return c.verbose?e(`wget ${c.short?"-v":"--verbose"}`):e(`wget ${c.short?"-q":"--quiet"}`),e(`--method ${Q(t)}`),Object.keys(r).forEach(a=>{const s=`${a}: ${r[a]}`;e(`--header ${Q(s)}`)}),n.text&&e(`--body-data ${qi(Q(n.text))}`),e(c.short?"-O":"--output-document"),e(`- ${Q(i)}`),o()}},Hi={info:{key:"shell",title:"Shell",default:"curl",cli:"%s"},clientsById:{curl:Li,httpie:Ui,wget:Mi}},Hr=(t,n)=>n.repeat(t),Fr=(t,n,r,i)=>{const f=Hr(i,r),c=Hr(i-1,r),e=n?`,
38${f}`:", ";return n?`[
39${f}${t.join(e)}
40${c}]`:`[${t.join(e)}]`},Br=(t,n,r)=>`let ${t} = ${Ke(n,r)}`,Ke=(t,n,r)=>{switch(r=r===void 0?1:r+1,Object.prototype.toString.call(t)){case"[object Number]":return t;case"[object Array]":{let i=!1;const f=t.map(c=>(Object.prototype.toString.call(c)==="[object Object]"&&(i=Object.keys(c).length>1),Ke(c,n,r)));return Fr(f,i,n.indent,r)}case"[object Object]":{const i=[];for(const f in t)i.push(`"${f}": ${Ke(t[f],n,r)}`);return Fr(i,n.pretty&&i.length>1,n.indent,r)}case"[object Boolean]":return t.toString();default:return t==null?"nil":`"${t.toString().replace(/"/g,'\\"')}"`}},Fi={info:{key:"urlsession",title:"URLSession",link:"https://developer.apple.com/documentation/foundation/urlsession",description:"Foundation's URLSession request",extname:".swift"},convert:({allHeaders:t,postData:n,uriObj:r,queryObj:i,method:f},c)=>{var m;const e={indent:"  ",pretty:!0,timeout:10,...c},{push:o,blank:a,join:s}=new I({indent:e.indent});o("import Foundation"),a();const p=n.text||n.jsonObj||n.params;if(p)switch(n.mimeType){case"application/x-www-form-urlencoded":if((m=n.params)!=null&&m.length){const h=n.params.map(u=>`"${u.name}": "${u.value}"`);e.pretty?(o("let parameters = ["),h.forEach(u=>o(`${u},`,1)),o("]")):o(`let parameters = [${h.join(", ")}]`),o('let joinedParameters = parameters.map { "\\($0.key)=\\($0.value)" }.joined(separator: "&")'),o("let postData = Data(joinedParameters.utf8)"),a()}break;case"application/json":n.jsonObj&&(o(`${Br("parameters",n.jsonObj,e)} as [String : Any?]`),a(),o("let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])"),a());break;case"multipart/form-data":o(Br("parameters",n.params,e)),a(),o(`let boundary = "${n.boundary}"`),a(),o('var body = ""'),o("for param in parameters {"),o('let paramName = param["name"]!',1),o('body += "--\\(boundary)\\r\\n"',1),o('body += "Content-Disposition:form-data; name=\\"\\(paramName)\\""',1),o('if let filename = param["fileName"] {',1),o('let contentType = param["contentType"]!',2),o("let fileContent = try String(contentsOfFile: filename, encoding: .utf8)",2),o('body += "; filename=\\"\\(filename)\\"\\r\\n"',2),o('body += "Content-Type: \\(contentType)\\r\\n\\r\\n"',2),o("body += fileContent",2),o('} else if let paramValue = param["value"] {',1),o('body += "\\r\\n\\r\\n\\(paramValue)"',2),o("}",1),o("}"),a(),o("let postData = Data(body.utf8)"),a();break;default:o(`let postData = Data("${n.text}".utf8)`),a()}o(`let url = URL(string: "${r.href}")!`);const l=i?Object.entries(i):[];return l.length<1?o("var request = URLRequest(url: url)"):(o("var components = URLComponents(url: url, resolvingAgainstBaseURL: true)!"),o("let queryItems: [URLQueryItem] = ["),l.forEach(h=>{const u=h[0],y=h[1];switch(Object.prototype.toString.call(y)){case"[object String]":o(`URLQueryItem(name: "${u}", value: "${y}"),`,1);break;case"[object Array]":y.forEach(d=>{o(`URLQueryItem(name: "${u}", value: "${d}"),`,1)});break}}),o("]"),o("components.queryItems = components.queryItems.map { $0 + queryItems } ?? queryItems"),a(),o("var request = URLRequest(url: components.url!)")),o(`request.httpMethod = "${f}"`),o(`request.timeoutInterval = ${e.timeout}`),Object.keys(t).length&&o(`request.allHTTPHeaderFields = ${Ke(t,e)}`),p&&o("request.httpBody = postData"),a(),o("let (data, _) = try await URLSession.shared.data(for: request)"),o("print(String(decoding: data, as: UTF8.self))"),s()}},Bi={info:{key:"swift",title:"Swift",default:"urlsession"},clientsById:{urlsession:Fi}}
vendor: 39,933 bytes, lines 40-43
40,Wi={c:Lo,clojure:Fo,csharp:zo,go:Vo,http:Qo,java:ti,javascript:ai,json:ci,kotlin:ui,node:yi,objc:mi,ocaml:gi,php:Oi,powershell:xi,python:ji,r:Ci,ruby:Ai,shell:Hi,swift:Bi},yt,Wr;function qe(){return Wr||(Wr=1,yt=TypeError),yt}var ht,Gr;function Ye(){if(Gr)return ht;Gr=1;var t=typeof Map=="function"&&Map.prototype,n=Object.getOwnPropertyDescriptor&&t?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=t&&n&&typeof n.get=="function"?n.get:null,i=t&&Map.prototype.forEach,f=typeof Set=="function"&&Set.prototype,c=Object.getOwnPropertyDescriptor&&f?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,e=f&&c&&typeof c.get=="function"?c.get:null,o=f&&Set.prototype.forEach,a=typeof WeakMap=="function"&&WeakMap.prototype,s=a?WeakMap.prototype.has:null,p=typeof WeakSet=="function"&&WeakSet.prototype,l=p?WeakSet.prototype.has:null,m=typeof WeakRef=="function"&&WeakRef.prototype,h=m?WeakRef.prototype.deref:null,u=Boolean.prototype.valueOf,y=Object.prototype.toString,d=Function.prototype.toString,w=String.prototype.match,v=String.prototype.slice,E=String.prototype.replace,j=String.prototype.toUpperCase,P=String.prototype.toLowerCase,S=RegExp.prototype.test,g=Array.prototype.concat,O=Array.prototype.join,x=Array.prototype.slice,R=Math.floor,k=typeof BigInt=="function"?BigInt.prototype.valueOf:null,C=Object.getOwnPropertySymbols,F=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,A=typeof Symbol=="function"&&typeof Symbol.iterator=="object",q=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===A||!0)?Symbol.toStringTag:null,L=Object.prototype.propertyIsEnumerable,N=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(b){return b.__proto__}:null);function T(b,$){if(b===1/0||b===-1/0||b!==b||b&&b>-1e3&&b<1e3||S.call(/e/,$))return $;var H=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof b=="number"){var W=b<0?-R(-b):R(b);if(W!==b){var J=String(W),_=v.call($,J.length+1);return E.call(J,H,"$&_")+"."+E.call(E.call(_,/([0-9]{3})/g,"$&_"),/_$/,"")}}return E.call($,H,"$&_")}var M=Ro,Y=M.custom,ie=V(Y)?Y:null,he={__proto__:null,double:'"',single:"'"},me={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};ht=function b($,H,W,J){var _=H||{};if(z(_,"quoteStyle")&&!z(he,_.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(z(_,"maxStringLength")&&(typeof _.maxStringLength=="number"?_.maxStringLength<0&&_.maxStringLength!==1/0:_.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var be=z(_,"customInspect")?_.customInspect:!0;if(typeof be!="boolean"&&be!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(z(_,"indent")&&_.indent!==null&&_.indent!=="	"&&!(parseInt(_.indent,10)===_.indent&&_.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(z(_,"numericSeparator")&&typeof _.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Ee=_.numericSeparator;if(typeof $>"u")return"undefined";if($===null)return"null";if(typeof $=="boolean")return $?"true":"false";if(typeof $=="string")return pr($,_);if(typeof $=="number"){if($===0)return 1/0/$>0?"0":"-0";var ne=String($);return Ee?T($,ne):ne}if(typeof $=="bigint"){var $e=String($)+"n";return Ee?T($,$e):$e}var tt=typeof _.depth>"u"?5:_.depth;if(typeof W>"u"&&(W=0),W>=tt&&tt>0&&typeof $=="object")return ge($)?"[Array]":"[Object]";var ke=Yn(_,W);if(typeof J>"u")J=[];else if(Oe(J,$)>=0)return"[Circular]";function ce(Ce,Ge,Zn){if(Ge&&(J=x.call(J),J.push(Ge)),Zn){var wr={depth:_.depth};return z(_,"quoteStyle")&&(wr.quoteStyle=_.quoteStyle),b(Ce,wr,W+1,J)}return b(Ce,_,W+1,J)}if(typeof $=="function"&&!pe($)){var yr=Ne($),hr=Be($,ce);return"[Function"+(yr?": "+yr:" (anonymous)")+"]"+(hr.length>0?" { "+O.call(hr,", ")+" }":"")}if(V($)){var mr=A?E.call(String($),/^(Symbol\(.*\))_[^)]*$/,"$1"):F.call($);return typeof $=="object"&&!A?Ie(mr):mr}if(Vn($)){for(var Le="<"+P.call(String($.nodeName)),rt=$.attributes||[],We=0;We<rt.length;We++)Le+=" "+rt[We].name+"="+ve(fe(rt[We].value),"double",_);return Le+=">",$.childNodes&&$.childNodes.length&&(Le+="..."),Le+="</"+P.call(String($.nodeName))+">",Le}if(ge($)){if($.length===0)return"[]";var nt=Be($,ce);return ke&&!Qn(nt)?"["+et(nt,ke)+"]":"[ "+O.call(nt,", ")+" ]"}if(X($)){var ot=Be($,ce);return!("cause"in Error.prototype)&&"cause"in $&&!L.call($,"cause")?"{ ["+String($)+"] "+O.call(g.call("[cause]: "+ce($.cause),ot),", ")+" }":ot.length===0?"["+String($)+"]":"{ ["+String($)+"] "+O.call(ot,", ")+" }"}if(typeof $=="object"&&be){if(ie&&typeof $[ie]=="function"&&M)return M($,{depth:tt-W});if(be!=="symbol"&&typeof $.inspect=="function")return $.inspect()}if(Te($)){var vr=[];return i&&i.call($,function(Ce,Ge){vr.push(ce(Ge,$,!0)+" => "+ce(Ce,$))}),dr("Map",r.call($),vr,ke)}if(Re($)){var gr=[];return o&&o.call($,function(Ce){gr.push(ce(Ce,$))}),dr("Set",e.call($),gr,ke)}if(se($))return Ze("WeakMap");if(je($))return Ze("WeakSet");if(Pe($))return Ze("WeakRef");if(D($))return Ie(ce(Number($)));if(te($))return Ie(ce(k.call($)));if(B($))return Ie(u.call($));if(U($))return Ie(ce(String($)));if(typeof window<"u"&&$===window)return"{ [object Window] }";if(typeof globalThis<"u"&&$===globalThis||typeof Sr<"u"&&$===Sr)return"{ [object globalThis] }";if(!xe($)&&!pe($)){var it=Be($,ce),br=N?N($)===Object.prototype:$ instanceof Object||$.constructor===Object,at=$ instanceof Object?"":"null prototype",$r=!br&&q&&Object($)===$&&q in $?v.call(re($),8,-1):at?"Object":"",Xn=br||typeof $.constructor!="function"?"":$.constructor.name?$.constructor.name+" ":"",st=Xn+($r||at?"["+O.call(g.call([],$r||[],at||[]),": ")+"] ":"");return it.length===0?st+"{}":ke?st+"{"+et(it,ke)+"}":st+"{ "+O.call(it,", ")+" }"}return String($)};function ve(b,$,H){var W=H.quoteStyle||$,J=he[W];return J+b+J}function fe(b){return E.call(String(b),/"/g,"&quot;")}function ge(b){return re(b)==="[object Array]"&&(!q||!(typeof b=="object"&&q in b))}function xe(b){return re(b)==="[object Date]"&&(!q||!(typeof b=="object"&&q in b))}function pe(b){return re(b)==="[object RegExp]"&&(!q||!(typeof b=="object"&&q in b))}function X(b){return re(b)==="[object Error]"&&(!q||!(typeof b=="object"&&q in b))}function U(b){return re(b)==="[object String]"&&(!q||!(typeof b=="object"&&q in b))}function D(b){return re(b)==="[object Number]"&&(!q||!(typeof b=="object"&&q in b))}function B(b){return re(b)==="[object Boolean]"&&(!q||!(typeof b=="object"&&q in b))}function V(b){if(A)return b&&typeof b=="object"&&b instanceof Symbol;if(typeof b=="symbol")return!0;if(!b||typeof b!="object"||!F)return!1;try{return F.call(b),!0}catch{}return!1}function te(b){if(!b||typeof b!="object"||!k)return!1;try{return k.call(b),!0}catch{}return!1}var Z=Object.prototype.hasOwnProperty||function(b){return b in this};function z(b,$){return Z.call(b,$)}function re(b){return y.call(b)}function Ne(b){if(b.name)return b.name;var $=w.call(d.call(b),/^function\s*([\w$]+)/);return $?$[1]:null}function Oe(b,$){if(b.indexOf)return b.indexOf($);for(var H=0,W=b.length;H<W;H++)if(b[H]===$)return H;return-1}function Te(b){if(!r||!b||typeof b!="object")return!1;try{r.call(b);try{e.call(b)}catch{return!0}return b instanceof Map}catch{}return!1}function se(b){if(!s||!b||typeof b!="object")return!1;try{s.call(b,s);try{l.call(b,l)}catch{return!0}return b instanceof WeakMap}catch{}return!1}function Pe(b){if(!h||!b||typeof b!="object")return!1;try{return h.call(b),!0}catch{}return!1}function Re(b){if(!e||!b||typeof b!="object")return!1;try{e.call(b);try{r.call(b)}catch{return!0}return b instanceof Set}catch{}return!1}function je(b){if(!l||!b||typeof b!="object")return!1;try{l.call(b,l);try{s.call(b,s)}catch{return!0}return b instanceof WeakSet}catch{}return!1}function Vn(b){return!b||typeof b!="object"?!1:typeof HTMLElement<"u"&&b instanceof HTMLElement?!0:typeof b.nodeName=="string"&&typeof b.getAttribute=="function"}function pr(b,$){if(b.length>$.maxStringLength){var H=b.length-$.maxStringLength,W="... "+H+" more character"+(H>1?"s":"");return pr(v.call(b,0,$.maxStringLength),$)+W}var J=me[$.quoteStyle||"single"];J.lastIndex=0;var _=E.call(E.call(b,J,"\\$1"),/[\x00-\x1f]/g,Kn);return ve(_,"single",$)}function Kn(b){var $=b.charCodeAt(0),H={8:"b",9:"t",10:"n",12:"f",13:"r"}[$];return H?"\\"+H:"\\x"+($<16?"0":"")+j.call($.toString(16))}function Ie(b){return"Object("+b+")"}function Ze(b){return b+" { ? }"}function dr(b,$,H,W){var J=W?et(H,W):O.call(H,", ");return b+" ("+$+") {"+J+"}"}function Qn(b){for(var $=0;$<b.length;$++)if(Oe(b[$],`
41`)>=0)return!1;return!0}function Yn(b,$){var H;if(b.indent==="	")H="	";else if(typeof b.indent=="number"&&b.indent>0)H=O.call(Array(b.indent+1)," ");else return null;return{base:H,prev:O.call(Array($+1),H)}}function et(b,$){if(b.length===0)return"";var H=`
42`+$.prev+$.base;return H+O.call(b,","+H)+`
43`+$.prev}function Be(b,$){var H=ge(b),W=[];if(H){W.length=b.length;for(var J=0;J<b.length;J++)W[J]=z(b,J)?$(b[J],b):""}var _=typeof C=="function"?C(b):[],be;if(A){be={};for(var Ee=0;Ee<_.length;Ee++)be["$"+_[Ee]]=_[Ee]}for(var ne in b)z(b,ne)&&(H&&String(Number(ne))===ne&&ne<b.length||A&&be["$"+ne]instanceof Symbol||(S.call(/[^\w$]/,ne)?W.push($(ne,b)+": "+$(b[ne],b)):W.push(ne+": "+$(b[ne],b))));if(typeof C=="function")for(var $e=0;$e<_.length;$e++)L.call(b,_[$e])&&W.push("["+$(_[$e])+"]: "+$(b[_[$e]],b));return W}return ht}var mt,Jr;function Gi(){if(Jr)return mt;Jr=1;var t=Ye(),n=qe(),r=function(o,a,s){for(var p=o,l;(l=p.next)!=null;p=l)if(l.key===a)return p.next=l.next,s||(l.next=o.next,o.next=l),l},i=function(o,a){if(o){var s=r(o,a);return s&&s.value}},f=function(o,a,s){var p=r(o,a);p?p.value=s:o.next={key:a,next:o.next,value:s}},c=function(o,a){return o?!!r(o,a):!1},e=function(o,a){if(o)return r(o,a,!0)};return mt=function(){var a,s={assert:function(p){if(!s.has(p))throw new n("Side channel does not contain "+t(p))},delete:function(p){var l=a&&a.next,m=e(a,p);return m&&l&&l===m&&(a=void 0),!!m},get:function(p){return i(a,p)},has:function(p){return c(a,p)},set:function(p,l){a||(a={next:void 0}),f(a,p,l)}};return s},mt}var vt,zr;function Ji(){return zr||(zr=1,vt=Object),vt}var gt,Dr;function zi(){return Dr||(Dr=1,gt=Error),gt}var bt,Vr;function Di(){return Vr||(Vr=1,bt=EvalError),bt}var $t,Kr;function Vi(){return Kr||(Kr=1,$t=RangeError),$t}var wt,Qr;function Ki(){return Qr||(Qr=1,wt=ReferenceError),wt}var St,Yr;function Qi(){return Yr||(Yr=1,St=SyntaxError),St}var Ot,Xr;function Yi(){return Xr||(Xr=1,Ot=URIError),Ot}var Tt,Zr;function Xi(){return Zr||(Zr=1,Tt=Math.abs),Tt}var Et,en;function Zi(){return en||(en=1,Et=Math.floor),Et}var xt,tn;function ea(){return tn||(tn=1,xt=Math.max),xt}var Pt,rn;function ta(){return rn||(rn=1,Pt=Math.min),Pt}var Rt,nn;function ra(){return nn||(nn=1,Rt=Math.pow),Rt}var jt,on;function na(){return on||(on=1,jt=Math.round),jt}var kt,an;function oa(){return an||(an=1,kt=Number.isNaN||function(n){return n!==n}),kt}var Ct,sn;function ia(){if(sn)return Ct;sn=1;var t=oa();return Ct=function(r){return t(r)||r===0?r:r<0?-1:1},Ct}var _t,cn;function aa(){return cn||(cn=1,_t=Object.getOwnPropertyDescriptor),_t}var At,ln;function Mn(){if(ln)return At;ln=1;var t=aa();if(t)try{t([],"length")}catch{t=null}return At=t,At}var qt,un;function sa(){if(un)return qt;un=1;var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return qt=t,qt}var Nt,fn;function ca(){return fn||(fn=1,Nt=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},r=Symbol("test"),i=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var f=42;n[r]=f;for(var c in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var e=Object.getOwnPropertySymbols(n);if(e.length!==1||e[0]!==r||!Object.prototype.propertyIsEnumerable.call(n,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(n,r);if(o.value!==f||o.enumerable!==!0)return!1}return!0}),Nt}var It,pn;function la(){if(pn)return It;pn=1;var t=typeof Symbol<"u"&&Symbol,n=ca();return It=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:n()},It}var Lt,dn;function Hn(){return dn||(dn=1,Lt=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Lt}var Ut,yn;function ua(){return yn||(yn=1,Ut=Object),Ut}var Mt,hn;function Fn(){if(hn)return Mt;hn=1;var t=ua();return Mt=t.getPrototypeOf||null,Mt}var Ht,mn;function fa(){if(mn)return Ht;mn=1;var t="Function.prototype.bind called on incompatible ",n=Object.prototype.toString,r=Math.max,i="[object Function]",f=function(a,s){for(var p=[],l=0;l<a.length;l+=1)p[l]=a[l];for(var m=0;m<s.length;m+=1)p[m+a.length]=s[m];return p},c=function(a,s){for(var p=[],l=s,m=0;l<a.length;l+=1,m+=1)p[m]=a[l];return p},e=function(o,a){for(var s="",p=0;p<o.length;p+=1)s+=o[p],p+1<o.length&&(s+=a);return s};return Ht=function(a){var s=this;if(typeof s!="function"||n.apply(s)!==i)throw new TypeError(t+s);for(var p=c(arguments,1),l,m=function(){if(this instanceof l){var w=s.apply(this,f(p,arguments));return Object(w)===w?w:this}return s.apply(a,f(p,arguments))},h=r(0,s.length-p.length),u=[],y=0;y<h;y++)u[y]="$"+y;if(l=Function("binder","return function ("+e(u,",")+"){ return binder.apply(this,arguments); }")(m),s.prototype){var d=function(){};d.prototype=s.prototype,l.prototype=new d,d.prototype=null}return l},Ht}var Ft,vn;function Xe(){if(vn)return Ft;vn=1;var t=fa();return Ft=Function.prototype.bind||t,Ft}var Bt,gn;function lr(){return gn||(gn=1,Bt=Function.prototype.call),Bt}var Wt,bn;function Bn(){return bn||(bn=1,Wt=Function.prototype.apply),Wt}var Gt,$n;function pa(){return $n||($n=1,Gt=typeof Reflect<"u"&&Reflect&&Reflect.apply),Gt}var Jt,wn;function da(){if(wn)return Jt;wn=1;var t=Xe(),n=Bn(),r=lr(),i=pa();return Jt=i||t.call(r,n),Jt}var zt,Sn;function Wn(){if(Sn)return zt;Sn=1;var t=Xe(),n=qe(),r=lr(),i=da();return zt=function(c){if(c.length<1||typeof c[0]!="function")throw new n("a function is required");return i(t,r,c)},zt}var Dt,On;function ya(){if(On)return Dt;On=1;var t=Wn(),n=Mn(),r;try{r=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var i=!!r&&n&&n(Object.prototype,"__proto__"),f=Object,c=f.getPrototypeOf;return Dt=i&&typeof i.get=="function"?t([i.get]):typeof c=="function"?function(o){return c(o==null?o:f(o))}:!1,Dt}var Vt,Tn;function ha(){if(Tn)return Vt;Tn=1;var t=Hn(),n=Fn(),r=ya();return Vt=t?function(f){return t(f)}:n?function(f){if(!f||typeof f!="object"&&typeof f!="function")throw new TypeError("getProto: not an object");return n(f)}:r?function(f){return r(f)}:null,Vt}var Kt,En;function ma(){if(En)return Kt;En=1;var t=Function.prototype.call,n=Object.prototype.hasOwnProperty,r=Xe();return Kt=r.call(t,n),Kt}var Qt,xn;function ur(){if(xn)return Qt;xn=1;var t,n=Ji(),r=zi(),i=Di(),f=Vi(),c=Ki(),e=Qi(),o=qe(),a=Yi(),s=Xi(),p=Zi(),l=ea(),m=ta(),h=ra(),u=na(),y=ia(),d=Function,w=function(X){try{return d('"use strict"; return ('+X+").constructor;")()}catch{}},v=Mn(),E=sa(),j=function(){throw new o},P=v?function(){try{return arguments.callee,j}catch{try{return v(arguments,"callee").get}catch{return j}}}():j,S=la()(),g=ha(),O=Fn(),x=Hn(),R=Bn(),k=lr(),C={},F=typeof Uint8Array>"u"||!g?t:g(Uint8Array),A={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":S&&g?g([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":C,"%AsyncGenerator%":C,"%AsyncGeneratorFunction%":C,"%AsyncIteratorPrototype%":C,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":i,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":d,"%GeneratorFunction%":C,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":S&&g?g(g([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!S||!g?t:g(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":v,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":f,"%ReferenceError%":c,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!S||!g?t:g(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":S&&g?g(""[Symbol.iterator]()):t,"%Symbol%":S?Symbol:t,"%SyntaxError%":e,"%ThrowTypeError%":P,"%TypedArray%":F,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":a,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":k,"%Function.prototype.apply%":R,"%Object.defineProperty%":E,"%Object.getPrototypeOf%":O,"%Math.abs%":s,"%Math.floor%":p,"%Math.max%":l,"%Math.min%":m,"%Math.pow%":h,"%Math.round%":u,"%Math.sign%":y,"%Reflect.getPrototypeOf%":x};if(g)try{null.error}catch(X){var q=g(g(X));A["%Error.prototype%"]=q}var L=function X(U){var D;if(U==="%AsyncFunction%")D=w("async function () {}");else if(U==="%GeneratorFunction%")D=w("function* () {}");else if(U==="%AsyncGeneratorFunction%")D=w("async function* () {}");else if(U==="%AsyncGenerator%"){var B=X("%AsyncGeneratorFunction%");B&&(D=B.prototype)}else if(U==="%AsyncIteratorPrototype%"){var V=X("%AsyncGenerator%");V&&g&&(D=g(V.prototype))}return A[U]=D,D},N={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},T=Xe(),M=ma(),Y=T.call(k,Array.prototype.concat),ie=T.call(R,Array.prototype.splice),he=T.call(k,String.prototype.replace),me=T.call(k,String.prototype.slice),ve=T.call(k,RegExp.prototype.exec),fe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ge=/\\(\\)?/g,xe=function(U){var D=me(U,0,1),B=me(U,-1);if(D==="%"&&B!=="%")throw new e("invalid intrinsic syntax, expected closing `%`");if(B==="%"&&D!=="%")throw new e("invalid intrinsic syntax, expected opening `%`");var V=[];return he(U,fe,function(te,Z,z,re){V[V.length]=z?he(re,ge,"$1"):Z||te}),V},pe=function(U,D){var B=U,V;if(M(N,B)&&(V=N[B],B="%"+V[0]+"%"),M(A,B)){var te=A[B];if(te===C&&(te=L(B)),typeof te>"u"&&!D)throw new o("intrinsic "+U+" exists, but is not available. Please file an issue!");return{alias:V,name:B,value:te}}throw new e("intrinsic "+U+" does not exist!")};return Qt=function(U,D){if(typeof U!="string"||U.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof D!="boolean")throw new o('"allowMissing" argument must be a boolean');if(ve(/^%?[^%]*%?$/,U)===null)throw new e("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var B=xe(U),V=B.length>0?B[0]:"",te=pe("%"+V+"%",D),Z=te.name,z=te.value,re=!1,Ne=te.alias;Ne&&(V=Ne[0],ie(B,Y([0,1],Ne)));for(var Oe=1,Te=!0;Oe<B.length;Oe+=1){var se=B[Oe],Pe=me(se,0,1),Re=me(se,-1);if((Pe==='"'||Pe==="'"||Pe==="`"||Re==='"'||Re==="'"||Re==="`")&&Pe!==Re)throw new e("property names with quotes must have matching quotes");if((se==="constructor"||!Te)&&(re=!0),V+="."+se,Z="%"+V+"%",M(A,Z))z=A[Z];else if(z!=null){if(!(se in z)){if(!D)throw new o("base intrinsic for "+U+" exists, but the property is not available.");return}if(v&&Oe+1>=B.length){var je=v(z,se);Te=!!je,Te&&"get"in je&&!("originalValue"in je.get)?z=je.get:z=z[se]}else Te=M(z,se),z=z[se];Te&&!re&&(A[Z]=z)}}return z},Qt}var Yt,Pn;function Gn(){if(Pn)return Yt;Pn=1;var t=ur(),n=Wn(),r=n([t("%String.prototype.indexOf%")]);return Yt=function(f,c){var e=t(f,!!c);return typeof e=="function"&&r(f,".prototype.")>-1?n([e]):e},Yt}var Xt,Rn;function Jn(){if(Rn)return Xt;Rn=1;var t=ur(),n=Gn(),r=Ye(),i=qe(),f=t("%Map%",!0),c=n("Map.prototype.get",!0),e=n("Map.prototype.set",!0),o=n("Map.prototype.has",!0),a=n("Map.prototype.delete",!0),s=n("Map.prototype.size",!0);return Xt=!!f&&function(){var l,m={assert:function(h){if(!m.has(h))throw new i("Side channel does not contain "+r(h))},delete:function(h){if(l){var u=a(l,h);return s(l)===0&&(l=void 0),u}return!1},get:function(h){if(l)return c(l,h)},has:function(h){return l?o(l,h):!1},set:function(h,u){l||(l=new f),e(l,h,u)}};return m},Xt}var Zt,jn;function va(){if(jn)return Zt;jn=1;var t=ur(),n=Gn(),r=Ye(),i=Jn(),f=qe(),c=t("%WeakMap%",!0),e=n("WeakMap.prototype.get",!0),o=n("WeakMap.prototype.set",!0),a=n("WeakMap.prototype.has",!0),s=n("WeakMap.prototype.delete",!0);return Zt=c?function(){var l,m,h={assert:function(u){if(!h.has(u))throw new f("Side channel does not contain "+r(u))},delete:function(u){if(c&&u&&(typeof u=="object"||typeof u=="function")){if(l)return s(l,u)}else if(i&&m)return m.delete(u);return!1},get:function(u){return c&&u&&(typeof u=="object"||typeof u=="function")&&l?e(l,u):m&&m.get(u)},has:function(u){return c&&u&&(typeof u=="object"||typeof u=="function")&&l?a(l,u):!!m&&m.has(u)},set:function(u,y){c&&u&&(typeof u=="object"||typeof u=="function")?(l||(l=new c),o(l,u,y)):i&&(m||(m=i()),m.set(u,y))}};return h}:i,Zt}var er,kn;function zn(){if(kn)return er;kn=1;var t=qe(),n=Ye(),r=Gi(),i=Jn(),f=va(),c=f||i||r;return er=function(){var o,a={assert:function(s){if(!a.has(s))throw new t("Side channel does not contain "+n(s))},delete:function(s){return!!o&&o.delete(s)},get:function(s){return o&&o.get(s)},has:function(s){return!!o&&o.has(s)},set:function(s,p){o||(o=c()),o.set(s,p)}};return a},er}var tr,Cn;function fr(){if(Cn)return tr;Cn=1;var t=String.prototype.replace,n=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return tr={default:r.RFC3986,formatters:{RFC1738:function(i){return t.call(i,n,"+")},RFC3986:function(i){return String(i)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986},tr}var rr,_n;function Dn(){if(_n)return rr;_n=1;var t=fr(),n=zn(),r=Object.prototype.hasOwnProperty,i=Array.isArray,f=n(),c=function(g,O){return f.set(g,O),g},e=function(g){return f.has(g)},o=function(g){return f.get(g)},a=function(g,O){f.set(g,O)},s=function(){for(var S=[],g=0;g<256;++g)S[S.length]="%"+((g<16?"0":"")+g.toString(16)).toUpperCase();return S}(),p=function(g){for(;g.length>1;){var O=g.pop(),x=O.obj[O.prop];if(i(x)){for(var R=[],k=0;k<x.length;++k)typeof x[k]<"u"&&(R[R.length]=x[k]);O.obj[O.prop]=R}}},l=function(g,O){for(var x=O&&O.plainObjects?{__proto__:null}:{},R=0;R<g.length;++R)typeof g[R]<"u"&&(x[R]=g[R]);return x},m=function S(g,O,x){if(!O)return g;if(typeof O!="object"&&typeof O!="function"){if(i(g)){var R=g.length;if(x&&typeof x.arrayLimit=="number"&&R>x.arrayLimit)return c(l(g.concat(O),x),R);g[R]=O}else if(g&&typeof g=="object")if(e(g)){var k=o(g)+1;g[k]=O,a(g,k)}else{if(x&&x.strictMerge)return[g,O];(x&&(x.plainObjects||x.allowPrototypes)||!r.call(Object.prototype,O))&&(g[O]=!0)}else return[g,O];return g}if(!g||typeof g!="object"){if(e(O)){for(var C=Object.keys(O),F=x&&x.plainObjects?{__proto__:null,0:g}:{0:g},A=0;A<C.length;A++){var q=parseInt(C[A],10);F[q+1]=O[C[A]]}return c(F,o(O)+1)}var L=[g].concat(O);return x&&typeof x.arrayLimit=="number"&&L.length>x.arrayLimit?c(l(L,x),L.length-1):L}var N=g;return i(g)&&!i(O)&&(N=l(g,x)),i(g)&&i(O)?(O.forEach(function(T,M){if(r.call(g,M)){var Y=g[M];Y&&typeof Y=="object"&&T&&typeof T=="object"?g[M]=S(Y,T,x):g[g.length]=T}else g[M]=T}),g):Object.keys(O).reduce(function(T,M){var Y=O[M];if(r.call(T,M)?T[M]=S(T[M],Y,x):T[M]=Y,e(O)&&!e(T)&&c(T,o(O)),e(T)){var ie=parseInt(M,10);String(ie)===M&&ie>=0&&ie>o(T)&&a(T,ie)}return T},N)},h=function(g,O){return Object.keys(O).reduce(function(x,R){return x[R]=O[R],x},g)},u=function(S,g,O){var x=S.replace(/\+/g," ");if(O==="iso-8859-1")return x.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(x)}catch{return x}},y=1024,d=function(g,O,x,R,k){if(g.length===0)return g;var C=g;if(typeof g=="symbol"?C=Symbol.prototype.toString.call(g):typeof g!="string"&&(C=String(g)),x==="iso-8859-1")return escape(C).replace(/%u[0-9a-f]{4}/gi,function(M){return"%26%23"+parseInt(M.slice(2),16)+"%3B"});for(var F="",A=0;A<C.length;A+=y){for(var q=C.length>=y?C.slice(A,A+y):C,L=[],N=0;N<q.length;++N){var T=q.charCodeAt(N);if(T===45||T===46||T===95||T===126||T>=48&&T<=57||T>=65&&T<=90||T>=97&&T<=122||k===t.RFC1738&&(T===40||T===41)){L[L.length]=q.charAt(N);continue}if(T<128){L[L.length]=s[T];continue}if(T<2048){L[L.length]=s[192|T>>6]+s[128|T&63];continue}if(T<55296||T>=57344){L[L.length]=s[224|T>>12]+s[128|T>>6&63]+s[128|T&63];continue}N+=1,T=65536+((T&1023)<<10|q.charCodeAt(N)&1023),L[L.length]=s[240|T>>18]+s[128|T>>12&63]+s[128|T>>6&63]+s[128|T&63]}F+=L.join("")}return F},w=function(g){for(var O=[{obj:{o:g},prop:"o"}],x=[],R=0;R<O.length;++R)for(var k=O[R],C=k.obj[k.prop],F=Object.keys(C),A=0;A<F.length;++A){var q=F[A],L=C[q];typeof L=="object"&&L!==null&&x.indexOf(L)===-1&&(O[O.length]={obj:C,prop:q},x[x.length]=L)}return p(O),g},v=function(g){return Object.prototype.toString.call(g)==="[object RegExp]"},E=function(g){return!g||typeof g!="object"?!1:!!(g.constructor&&g.constructor.isBuffer&&g.constructor.isBuffer(g))},j=function(g,O,x,R){if(e(g)){var k=o(g)+1;return g[k]=O,a(g,k),g}var C=[].concat(g,O);return C.length>x?c(l(C,{plainObjects:R}),C.length-1):C},P=function(g,O){if(i(g)){for(var x=[],R=0;R<g.length;R+=1)x[x.length]=O(g[R]);return x}return O(g)};return rr={arrayToObject:l,assign:h,combine:j,compact:w,decode:u,encode:d,isBuffer:E,isOverflow:e,isRegExp:v,markOverflow:c,maybeMap:P,merge:m},rr}var nr,An;function ga(){if(An)return nr;An=1;var t=zn(),n=Dn(),r=fr(),i=Object.prototype.hasOwnProperty,f={brackets:function(d){return d+"[]"},comma:"comma",indices:function(d,w){return d+"["+w+"]"},repeat:function(d){return d}},c=Array.isArray,e=Array.prototype.push,o=function(y,d){e.apply(y,c(d)?d:[d])},a=Date.prototype.toISOString,s=r.default,p={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:n.encode,encodeValuesOnly:!1,filter:void 0,format:s,formatter:r.formatters[s],indices:!1,serializeDate:function(d){return a.call(d)},skipNulls:!1,strictNullHandling:!1},l=function(d){return typeof d=="string"||typeof d=="number"||typeof d=="boolean"||typeof d=="symbol"||typeof d=="bigint"},m={},h=function y(d,w,v,E,j,P,S,g,O,x,R,k,C,F,A,q,L,N){for(var T=d,M=N,Y=0,ie=!1;(M=M.get(m))!==void 0&&!ie;){var he=M.get(d);if(Y+=1,typeof he<"u"){if(he===Y)throw new RangeError("Cyclic object value");ie=!0}typeof M.get(m)>"u"&&(Y=0)}if(typeof x=="function"?T=x(w,T):T instanceof Date?T=C(T):v==="comma"&&c(T)&&(T=n.maybeMap(T,function(Z){return Z instanceof Date?C(Z):Z})),T===null){if(P)return A(O&&!q?O(w,p.encoder,L,"key",F):w);T=""}if(l(T)||n.isBuffer(T)){if(O){var me=q?w:O(w,p.encoder,L,"key",F);return[A(me)+"="+A(O(T,p.encoder,L,"value",F))]}return[A(w)+"="+A(String(T))]}var ve=[];if(typeof T>"u")return ve;var fe;if(v==="comma"&&c(T))q&&O&&(T=n.maybeMap(T,function(Z){return Z==null?Z:O(Z)})),fe=[{value:T.length>0?T.join(",")||null:void 0}];else if(c(x))fe=x;else{var ge=Object.keys(T);fe=R?ge.sort(R):ge}var xe=g?String(w).replace(/\./g,"%2E"):String(w),pe=E&&c(T)&&T.length===1?xe+"[]":xe;if(j&&c(T)&&T.length===0)return pe+"[]";for(var X=0;X<fe.length;++X){var U=fe[X],D=typeof U=="object"&&U&&typeof U.value<"u"?U.value:T[U];if(!(S&&D===null)){var B=k&&g?String(U).replace(/\./g,"%2E"):String(U),V=c(T)?typeof v=="function"?v(pe,B):pe:pe+(k?"."+B:"["+B+"]");N.set(d,Y);var te=t();te.set(m,N),o(ve,y(D,V,v,E,j,P,S,g,v==="comma"&&q&&c(T)?null:O,x,R,k,C,F,A,q,L,te))}}return ve},u=function(d){if(!d)return p;if(typeof d.allowEmptyArrays<"u"&&typeof d.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof d.encodeDotInKeys<"u"&&typeof d.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(d.encoder!==null&&typeof d.encoder<"u"&&typeof d.encoder!="function")throw new TypeError("Encoder has to be a function.");var w=d.charset||p.charset;if(typeof d.charset<"u"&&d.charset!=="utf-8"&&d.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var v=r.default;if(typeof d.format<"u"){if(!i.call(r.formatters,d.format))throw new TypeError("Unknown format option provided.");v=d.format}var E=r.formatters[v],j=p.filter;(typeof d.filter=="function"||c(d.filter))&&(j=d.filter);var P;if(d.arrayFormat in f?P=d.arrayFormat:"indices"in d?P=d.indices?"indices":"repeat":P=p.arrayFormat,"commaRoundTrip"in d&&typeof d.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var S=typeof d.allowDots>"u"?d.encodeDotInKeys===!0?!0:p.allowDots:!!d.allowDots;return{addQueryPrefix:typeof d.addQueryPrefix=="boolean"?d.addQueryPrefix:p.addQueryPrefix,allowDots:S,allowEmptyArrays:typeof d.allowEmptyArrays=="boolean"?!!d.allowEmptyArrays:p.allowEmptyArrays,arrayFormat:P,charset:w,charsetSentinel:typeof d.charsetSentinel=="boolean"?d.charsetSentinel:p.charsetSentinel,commaRoundTrip:!!d.commaRoundTrip,delimiter:typeof d.delimiter>"u"?p.delimiter:d.delimiter,encode:typeof d.encode=="boolean"?d.encode:p.encode,encodeDotInKeys:typeof d.encodeDotInKeys=="boolean"?d.encodeDotInKeys:p.encodeDotInKeys,encoder:typeof d.encoder=="function"?d.encoder:p.encoder,encodeValuesOnly:typeof d.encodeValuesOnly=="boolean"?d.encodeValuesOnly:p.encodeValuesOnly,filter:j,format:v,formatter:E,serializeDate:typeof d.serializeDate=="function"?d.serializeDate:p.serializeDate,skipNulls:typeof d.skipNulls=="boolean"?d.skipNulls:p.skipNulls,sort:typeof d.sort=="function"?d.sort:null,strictNullHandling:typeof d.strictNullHandling=="boolean"?d.strictNullHandling:p.strictNullHandling}};return nr=function(y,d){var w=y,v=u(d),E,j;typeof v.filter=="function"?(j=v.filter,w=j("",w)):c(v.filter)&&(j=v.filter,E=j);var P=[];if(typeof w!="object"||w===null)return"";var S=f[v.arrayFormat],g=S==="comma"&&v.commaRoundTrip;E||(E=Object.keys(w)),v.sort&&E.sort(v.sort);for(var O=t(),x=0;x<E.length;++x){var R=E[x];if(!(typeof R>"u"||R===null)){var k=w[R];v.skipNulls&&k===null||o(P,h(k,R,S,g,v.allowEmptyArrays,v.strictNullHandling,v.skipNulls,v.encodeDotInKeys,v.encode?v.encoder:null,v.filter,v.sort,v.allowDots,v.serializeDate,v.format,v.formatter,v.encodeValuesOnly,v.charset,O))}}var C=P.join(v.delimiter),F=v.addQueryPrefix===!0?"?":"";return v.charsetSentinel&&(v.charset==="iso-8859-1"?F+="utf8=%26%2310003%3B"+v.delimiter:F+="utf8=%E2%9C%93"+v.delimiter),C.length>0?F+C:""},nr}var or,qn;function ba(){if(qn)return or;qn=1;var t=Dn(),n=Object.prototype.hasOwnProperty,r=Array.isArray,i={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:t.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},f=function(h){return h.replace(/&#(\d+);/g,function(u,y){return String.fromCharCode(parseInt(y,10))})},c=function(h,u,y){if(h&&typeof h=="string"&&u.comma&&h.indexOf(",")>-1)return h.split(",");if(u.throwOnLimitExceeded&&y>=u.arrayLimit)throw new RangeError("Array limit exceeded. Only "+u.arrayLimit+" element"+(u.arrayLimit===1?"":"s")+" allowed in an array.");return h},e="utf8=%26%2310003%3B",o="utf8=%E2%9C%93",a=function(u,y){var d={__proto__:null},w=y.ignoreQueryPrefix?u.replace(/^\?/,""):u;w=w.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var v=y.parameterLimit===1/0?void 0:y.parameterLimit,E=w.split(y.delimiter,y.throwOnLimitExceeded&&typeof v<"u"?v+1:v);if(y.throwOnLimitExceeded&&typeof v<"u"&&E.length>v)throw new RangeError("Parameter limit exceeded. Only "+v+" parameter"+(v===1?"":"s")+" allowed.");var j=-1,P,S=y.charset;if(y.charsetSentinel)for(P=0;P<E.length;++P)E[P].indexOf("utf8=")===0&&(E[P]===o?S="utf-8":E[P]===e&&(S="iso-8859-1"),j=P,P=E.length);for(P=0;P<E.length;++P)if(P!==j){var g=E[P],O=g.indexOf("]="),x=O===-1?g.indexOf("="):O+1,R,k;if(x===-1?(R=y.decoder(g,i.decoder,S,"key"),k=y.strictNullHandling?null:""):(R=y.decoder(g.slice(0,x),i.decoder,S,"key"),R!==null&&(k=t.maybeMap(c(g.slice(x+1),y,r(d[R])?d[R].length:0),function(F){return y.decoder(F,i.decoder,S,"value")}))),k&&y.interpretNumericEntities&&S==="iso-8859-1"&&(k=f(String(k))),g.indexOf("[]=")>-1&&(k=r(k)?[k]:k),y.comma&&r(k)&&k.length>y.arrayLimit){if(y.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+y.arrayLimit+" element"+(y.arrayLimit===1?"":"s")+" allowed in an array.");k=t.combine([],k,y.arrayLimit,y.plainObjects)}if(R!==null){var C=n.call(d,R);C&&(y.duplicates==="combine"||g.indexOf("[]=")>-1)?d[R]=t.combine(d[R],k,y.arrayLimit,y.plainObjects):(!C||y.duplicates==="last")&&(d[R]=k)}}return d},s=function(h,u,y,d){var w=0;if(h.length>0&&h[h.length-1]==="[]"){var v=h.slice(0,-1).join("");w=Array.isArray(u)&&u[v]?u[v].length:0}for(var E=d?u:c(u,y,w),j=h.length-1;j>=0;--j){var P,S=h[j];if(S==="[]"&&y.parseArrays)t.isOverflow(E)?P=E:P=y.allowEmptyArrays&&(E===""||y.strictNullHandling&&E===null)?[]:t.combine([],E,y.arrayLimit,y.plainObjects);else{P=y.plainObjects?{__proto__:null}:{};var g=S.charAt(0)==="["&&S.charAt(S.length-1)==="]"?S.slice(1,-1):S,O=y.decodeDotInKeys?g.replace(/%2E/g,"."):g,x=parseInt(O,10),R=!isNaN(x)&&S!==O&&String(x)===O&&x>=0&&y.parseArrays;if(!y.parseArrays&&O==="")P={0:E};else if(R&&x<y.arrayLimit)P=[],P[x]=E;else{if(R&&y.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+y.arrayLimit+" element"+(y.arrayLimit===1?"":"s")+" allowed in an array.");R?(P[x]=E,t.markOverflow(P,x)):O!=="__proto__"&&(P[O]=E)}}E=P}return E},p=function(u,y){var d=y.allowDots?u.replace(/\.([^.[]+)/g,"[$1]"):u;if(y.depth<=0)return!y.plainObjects&&n.call(Object.prototype,d)&&!y.allowPrototypes?void 0:[d];var w=[],v=d.indexOf("["),E=v>=0?d.slice(0,v):d;if(E){if(!y.plainObjects&&n.call(Object.prototype,E)&&!y.allowPrototypes)return;w[w.length]=E}for(var j=d.length,P=v,S=0;P>=0&&S<y.depth;){for(var g=1,O=P+1,x=-1;O<j&&x<0;){var R=d.charCodeAt(O);R===91?g+=1:R===93&&(g-=1,g===0&&(x=O)),O+=1}if(x<0)return w[w.length]="["+d.slice(P)+"]",w;var k=d.slice(P,x+1),C=k.slice(1,-1);if(!y.plainObjects&&n.call(Object.prototype,C)&&!y.allowPrototypes)return;w[w.length]=k,S+=1,P=d.indexOf("[",x+1)}if(P>=0){if(y.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+y.depth+" and strictDepth is true");w[w.length]="["+d.slice(P)+"]"}return w},l=function(u,y,d,w){if(u){var v=p(u,d);if(v)return s(v,y,d,w)}},m=function(u){if(!u)return i;if(typeof u.allowEmptyArrays<"u"&&typeof u.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof u.decodeDotInKeys<"u"&&typeof u.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(u.decoder!==null&&typeof u.decoder<"u"&&typeof u.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof u.charset<"u"&&u.charset!=="utf-8"&&u.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof u.throwOnLimitExceeded<"u"&&typeof u.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var y=typeof u.charset>"u"?i.charset:u.charset,d=typeof u.duplicates>"u"?i.duplicates:u.duplicates;if(d!=="combine"&&d!=="first"&&d!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var w=typeof u.allowDots>"u"?u.decodeDotInKeys===!0?!0:i.allowDots:!!u.allowDots;return{allowDots:w,allowEmptyArrays:typeof u.allowEmptyArrays=="boolean"?!!u.allowEmptyArrays:i.allowEmptyArrays,allowPrototypes:typeof u.allowPrototypes=="boolean"?u.allowPrototypes:i.allowPrototypes,allowSparse:typeof u.allowSparse=="boolean"?u.allowSparse:i.allowSparse,arrayLimit:typeof u.arrayLimit=="number"?u.arrayLimit:i.arrayLimit,charset
43:y,charsetSentinel:typeof u.charsetSentinel=="boolean"?u.charsetSentinel:i.charsetSentinel,comma:typeof u.comma=="boolean"?u.comma:i.comma,decodeDotInKeys:typeof u.decodeDotInKeys=="boolean"?u.decodeDotInKeys:i.decodeDotInKeys,decoder:typeof u.decoder=="function"?u.decoder:i.decoder,delimiter:typeof u.delimiter=="string"||t.isRegExp(u.delimiter)?u.delimiter:i.delimiter,depth:typeof u.depth=="number"||u.depth===!1?+u.depth:i.depth,duplicates:d,ignoreQueryPrefix:u.ignoreQueryPrefix===!0,interpretNumericEntities:typeof u.interpretNumericEntities=="boolean"?u.interpretNumericEntities:i.interpretNumericEntities,parameterLimit:typeof u.parameterLimit=="number"?u.parameterLimit:i.parameterLimit,parseArrays:u.parseArrays!==!1,plainObjects:typeof u.plainObjects=="boolean"?u.plainObjects:i.plainObjects,strictDepth:typeof u.strictDepth=="boolean"?!!u.strictDepth:i.strictDepth,strictMerge:typeof u.strictMerge=="boolean"?!!u.strictMerge:i.strictMerge,strictNullHandling:typeof u.strictNullHandling=="boolean"?u.strictNullHandling:i.strictNullHandling,throwOnLimitExceeded:typeof u.throwOnLimitExceeded=="boolean"?u.throwOnLimitExceeded:!1}};return or=function(h,u){var y=m(u);if(h===""||h===null||typeof h>"u")return y.plainObjects?{__proto__:null}:{};for(var d=typeof h=="string"?a(h,y):h,w=y.plainObjects?{__proto__:null}:{},v=Object.keys(d),E=0;E<v.length;++E){var j=v[E],P=l(j,d[j],y,typeof h=="string");w=t.merge(w,P,y)}return y.allowSparse===!0?w:t.compact(w)},or}var ir,Nn;function $a(){if(Nn)return ir;Nn=1;var t=ga(),n=ba(),r=fr();return ir={formats:r,parse:n,stringify:t},ir}var ar=$a(),wa=t=>typeof t=="object"&&"log"in t&&typeof t.log=="object"&&"entries"in t.log&&Array.isArray(t.log.entries),Sa=class{constructor(t,n={}){this.initCalled=!1,this.entries=[],this.requests=[],this.options={},this.options={harIsAlreadyEncoded:!1,...n},this.requests=[],wa(t)?this.entries=t.log.entries:this.entries=[{request:t}]}init(){return this.initCalled=!0,this.requests=this.entries.map(({request:t})=>{var r;const n={bodySize:0,headersSize:0,headers:[],cookies:[],httpVersion:"HTTP/1.1",queryString:[],postData:{mimeType:((r=t.postData)==null?void 0:r.mimeType)||"application/octet-stream"},...t};return n.postData&&!n.postData.mimeType&&(n.postData.mimeType="application/octet-stream"),this.prepare(n,this.options)}),this}prepare(t,n){var p,l,m;const r={...t,fullUrl:"",uriObj:{},queryObj:{},headersObj:{},cookiesObj:{},allHeaders:{}};if(r.queryString&&r.queryString.length&&(r.queryObj=r.queryString.reduce(Rr,{})),r.headers&&r.headers.length){const h=/^HTTP\/2/;r.headersObj=r.headers.reduce((u,{name:y,value:d})=>{const w=h.exec(r.httpVersion)?y.toLocaleLowerCase():y;return{...u,[w]:d}},{})}r.cookies&&r.cookies.length&&(r.cookiesObj=r.cookies.reduceRight((h,{name:u,value:y})=>({...h,[u]:y}),{}));const i=(p=r.cookies)==null?void 0:p.map(({name:h,value:u})=>n.harIsAlreadyEncoded?`${h}=${u}`:`${encodeURIComponent(h)}=${encodeURIComponent(u)}`);switch(i!=null&&i.length&&(r.allHeaders.cookie=i.join("; ")),r.postData.mimeType){case"multipart/mixed":case"multipart/related":case"multipart/form-data":case"multipart/alternative":if(r.postData.text="",r.postData.mimeType="multipart/form-data",(l=r.postData)!=null&&l.params){const h="---011000010111000001101001",u=`${h}--`,y=`\r
44`,d=j=>j.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),w=j=>j.replace(/\r?\n|\r/g,`\r
45`),v=[`--${h}`];(m=r.postData)==null||m.params.forEach((j,P)=>{const S=j.name,g=j.value||"",O=j.fileName||null,x=j.contentType||"application/octet-stream";O?(v.push(`Content-Disposition: form-data; name="${d(w(S))}"; filename="${O}"`),v.push(`Content-Type: ${x}`)):v.push(`Content-Disposition: form-data; name="${d(w(S))}"`),v.push(""),v.push(w(g)),P!==r.postData.params.length-1&&v.push(`--${h}`)}),v.push(`--${u}`),r.postData.boundary=h,r.postData.text=v.join(y);const E=ee(r.headersObj,"content-type")||"content-type";r.headersObj[E]=`multipart/form-data; boundary=${h}`}break;case"application/x-www-form-urlencoded":r.postData.params?(r.postData.paramsObj=r.postData.params.reduce(Rr,{}),r.postData.text=ar.stringify(r.postData.paramsObj)):r.postData.text="";break;case"text/json":case"text/x-json":case"application/json":case"application/x-json":if(r.postData.mimeType="application/json",r.postData.text)try{r.postData.jsonObj=JSON.parse(r.postData.text)}catch{r.postData.mimeType="text/plain"}break}const f={...r.allHeaders,...r.headersObj},c=to(r.url,!0,!0);r.queryObj={...r.queryObj,...c.query};let e;n.harIsAlreadyEncoded?e=ar.stringify(r.queryObj,{encode:!1,indices:!1}):e=ar.stringify(r.queryObj,{indices:!1});const o={...c,query:r.queryObj,search:e,path:e?`${c.pathname}?${e}`:c.pathname}
45,a=Or({...c,query:null,search:null}),s=Or({...c,...o});return{...r,allHeaders:f,fullUrl:s,url:a,uriObj:o}}convert(t,n,r){this.initCalled||this.init(),!r&&n&&(r=n);const i=Wi[t];if(!i)return!1;const{convert:f}=i.clientsById[n||i.info.default];return this.requests.map(e=>f(e,r))}};const Oa={class:"p-6",style:{height:"calc(100vh - var(--topbar-height) - var(--toolbar-height) - 16px)",maxHeight:"calc(100vh - var(--topbar-height) - var(--toolbar-height) - 16px)"}},Ta={class:"flex gap-4 max-w-[1000px] mx-auto h-full"},Ea={class:"p-2 text-xs text-nc-content-gray-muted uppercase font-semibold",style:{letterSpacing:"0.3px"}},xa={class:"flex gap-2 items-center"},Pa={class:"flex flex-col gap-1"},Ra={class:"p-2 text-xs text-nc-content-gray-muted uppercase font-semibold",style:{letterSpacing:"0.3px"}},ja=["href"],ka={dir:"ltr",class:"w-[calc(100%_-_264px)] flex flex-col gap-6 h-full max-h-full"},Ca={class:"nc-api-clents-tab-wrapper h-[calc(100%_-_56px)] flex flex-col mt-2"},_a={class:"flex items-center gap-2 text-small leading-[18px] min-w-80px justify-center"},Aa={class:"text-small leading-[18px] capitalize select-none"},qa=ro({__name:"Api",setup(t){const n=To(()=>xo(()=>import("./CqoW3B-6.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url)),{t:r}=no(),i=oo(),{base:f}=io(i),{appInfo:c}=ao(),e=Tr(so,Ue()),o=Tr(co,Ue()),{xWhere:a}=jo(),{queryParams:s}=ko(e,o,a),{copy:p}=lo(),l=Ue(!1),m=[{name:"shell",clients:["curl","wget"],icon:de.langShell},{name:"javascript",clients:["axios","fetch","jquery","xhr"],icon:de.langJavascript},{name:"node",clients:["axios","fetch","native"],icon:de.langNode},{name:"NocoDB-SDK",clients:["javascript","node"],icon:de.langNocodbSdk},{name:"php",icon:de.langPhp},{name:"python",clients:["requests"],icon:de.langPython},{name:"ruby",icon:de.langRuby},{name:"java",icon:de.langJava},{name:"c",icon:de.langC}],h=Ue(m[0].clients&&m[0].clients[0]),u=Ue(m[0].name),y=Me(()=>{var S,g;try{return new URL(`/api/v3/data/${(S=f.value)==null?void 0:S.id}/${(g=e.value)==null?void 0:g.id}/records`,c.value&&c.value.ncSiteUrl||"/").href}catch(O){return console.log("Failed to construct API URL",O),""}}),d=Me(()=>{const S=s.value||{},g=S.offset!=null&&S.limit?Math.floor(S.offset/S.limit)+1:1,O=S.limit;return{...g>1?{page:g}:{},...O?{pageSize:O}:{},...S.where?{where:S.where}:{}}}),w=Me(()=>{var S;return new Sa({method:"GET",headers:[{name:"xc-token",value:`CREATE_YOUR_API_TOKEN_FROM ${location.origin}/account/tokens`,comment:"API token"}],url:y.value,queryString:[...Object.entries(d.value).map(([g,O])=>({name:g,value:String(O)})),{name:"viewId",value:(S=o.value)==null?void 0:S.id}]})}),v=Me(()=>m.find(S=>S.name===u.value)),E=Me(()=>{var g,O,x,R,k,C,F;if(((g=v.value)==null?void 0:g.name)==="NocoDB-SDK")return`${h.value==="node"?'const { Api } = require("nocodb-sdk");':'import { Api } from "nocodb-sdk";'}
46
47const api = new Api({
48    baseURL: "${c.value&&c.value.ncSiteUrl||"/"}",
49    headers: {
50      "xc-token": "CREATE_YOUR_API_TOKEN_FROM ${location.origin}/account/tokens"
51    }
52})
53
54api.dbDataTableRow.list(
55    ${JSON.stringify((O=f.value)==null?void 0:O.id)},
56    ${JSON.stringify((x=e.value)==null?void 0:x.id)}, ${JSON.stringify({...d.value,...(R=o.value)!=null&&R.id?{viewId:o.value.id}:{}},null,4)}).then(function (data) {
57    console.log(data);
58}).catch(function (error) {
59    console.error(error);
60});`;const S=w.value.convert((k=v.value)==null?void 0:k.name,h.value||((C=v.value)==null?void 0:C.clients)&&((F=v.value)==null?void 0:F.clients[0]),{indent:"	"});return S&&S[0]?S[0]:""}),j=async()=>{try{await p(E.value),Pr.info(r("msg.info.copiedToClipboard")),l.value=!0,setTimeout(()=>{l.value=!1},5e3)}catch(S){Pr.error(S.message)}};uo(v,S=>{var g;h.value=(g=S==null?void 0:S.clients)==null?void 0:g[0]});const P=[{title:"Data APIs",href:"https://nocodb.com/apis/v3/data"},{title:"Meta APIs",href:"https://nocodb.com/apis/v3/meta"},{title:"Create API Token",href:"https://nocodb.com/docs/product-docs/account-settings/api-tokens#create-api-token"},{title:"Swagger",href:"https://nocodb.com/docs/product-docs/bases/actions-on-base#rest-apis"}];return(S,g)=>{const O=po,x=ho,R=mo,k=vo,C=$o,F=go,A=So,q=Oo,L=fo("e");return we(),Je("div",Oa,[ae("div",Ta,[Se(k,{class:"nc-api-snippets-menu !h-full w-[252px] min-w-[252px] nc-scrollbar-thin !pr-3 !rtl:pl-3 !rtl:pr-0"},{default:ye(()=>[ae("div",Ea,_e(S.$t("general.languages")),1),(we(),Je(ct,null,lt(m,N=>Se(O,{key:N.name,class:Er(["rounded-md capitalize select-none",{"active-menu":oe(u)===N.name}]),onClick:T=>u.value=N.name},{default:ye(()=>[ae("div",xa,[(we(),ze(yo(N.icon),{class:"!stroke-transparent h-5 w-5"})),xr(" "+_e(N.name),1)])]),_:2},1032,["class","onClick"])),64)),Se(x,{class:"!my-3"}),ae("div",Pa,[ae("div",Ra,_e(S.$t("labels.documentation")),1),(we(),Je(ct,null,lt(P,(N,T)=>ae("div",{key:T,class:"flex items-center gap-2 px-2 h-7"},[Se(R,{icon:"bookOpen",class:"flex-none w-4 h-4 text-nc-content-gray-subtle2"}),ae("a",{href:N.href,target:"_blank",rel:"noopener noreferrer",class:"!text-nc-content-gray-subtle text-small leading-[18px] !no-underline !hover:underline"},_e(N.title),9,ja)])),64))])]),_:1}),ae("div",ka,[ae("div",Ca,[Se(A,{"active-key":oe(h),"onUpdate:activeKey":g[0]||(g[0]=N=>wo(h)?h.value=N:null),class:"nc-api-clents-tab"},{rightExtra:ye(()=>{var N,T,M;return[bo((we(),ze(C,{type:"text",size:"small",class:"!hover:bg-nc-bg-gray-medium",onClick:j},{default:ye(()=>[ae("div",_a,[Se(R,{icon:oe(l)?"circleCheckSolid":"copy",class:Er(["h-4 w-4",{"text-nc-content-gray-subtle":!oe(l),"text-green-700":oe(l)}])},null,8,["icon","class"]),xr(" "+_e(oe(l)?S.$t("general.copied"):S.$t("general.copy")),1)])]),_:1}
60)),[[L,["c:snippet:copy",{client:((N=oe(v))==null?void 0:N.clients)&&(oe(h)||((T=oe(v))==null?void 0:T.clients[0])),lang:(M=oe(v))==null?void 0:M.name}]]])]}),default:ye(()=>{var N;return[(we(!0),Je(ct,null,lt(((N=oe(v))==null?void 0:N.clients)||["default"],T=>(we(),ze(F,{key:T,class:"!h-full"},{tab:ye(()=>[ae("div",Aa,_e(T),1)]),default:ye(()=>[g[1]||(g[1]=ae("div",null,null,-1))]),_:2,__:[1]},1024))),128))]}),_:1},8,["active-key"]),(we(),ze(Eo,null,{default:ye(()=>[Se(oe(n),{class:"h-[calc(100%_-_36px)] !bg-nc-bg-gray-extralight pl-2","model-value":oe(E),"read-only":!0,lang:"typescript",validate:!1,"disable-deep-compare":!0,"monaco-config":{minimap:{enabled:!1},fontSize:13,lineHeight:18,padding:{top:12,bottom:12},overviewRulerBorder:!1,overviewRulerLanes:0,hideCursorInOverviewRuler:!0,lineDecorationsWidth:12,lineNumbersMinChars:0,roundedSelection:!1,selectOnLineNumbers:!1,scrollBeyondLastLine:!1,contextmenu:!1,glyphMargin:!1,folding:!1,bracketPairColorization:{enabled:!1},wordWrap:"on",scrollbar:{horizontal:"hidden",verticalScrollbarSize:6},wrappingStrategy:"advanced",renderLineHighlight:"none",tabSize:4,detectIndentation:!1,insertSpaces:!0,lineNumbers:"off"},"hide-minimap":""},null,8,["model-value"])]),fallback:ye(()=>[Se(q,{class:"h-[calc(100%_-_36px)] w-full"})]),_:1}))])])])])}}}),ms=Object.assign(Po(qa,[["__scopeId","data-v-23c0d6c1"]]),{__name:"SmartsheetDetailsApi"});export{ms as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.