1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[203],{1752:function(e,t,n){e.exports=n(6616)},5671:function(e,t,n){"use strict";n.r(t);var r=n(2777),o=n(2262),s=n(5959),i=n(2179),a=n(7247),c=n(7294),l=n(9008),u=n.n(l),d=n(1752),f=n.n(d),m=n(5893);function p(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,a.Z)(e);if(t){var o=(0,a.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,i.Z)(this,n)}}var h=f()().publicRuntimeConfig,x="Create Run Button",b="Share Insomnia designs and collections directly from your website.",j=function(e){(0,s.Z)(n,e);var t=p(n);function n(e){var o;return(0,r.Z)(this,n),(o=t.call(this,e)).state={label:"",uri:"",src:"https://insomnia.rest/images/run.svg"},o}return(0,o.Z)(n,[{key:"changeLabel",value:function(e){this.setState({label:e.currentTarget.value})}},{key:"changeURI",value:function(e){this.setState({uri:e.currentTarget.value})}},{key:"renderButton",value:function(){var e,t,n=encodeURIComponent(null!==(e=this.state.label)&&void 0!==e&&e),r=encodeURIComponent(null!==(t=this.state.uri)&&void 0!==t&&t),o="https://insomnia.rest/run/?label=".concat(n,"&uri=").concat(r);return(0,m.jsx)("a",{href:o,target:"_blank",rel:"noopener noreferrer",children:(0,m.jsx)("img",{src:this.state.src,alt:"Run in Insomnia",className:"no-margin margin-center"})})}},{key:"renderCode",value:function(){var e,t,n=encodeURIComponent(null!==(e=this.state.label)&&void 0!==e&&e),r=encodeURIComponent(null!==(t=this.state.uri)&&void 0!==t&&t),o="https://insomnia.rest/run/?label=".concat(n,"&uri=").concat(r);return'<a href="'.concat(o,'" target="_blank"><img src="').concat(this.state.src,'" alt="Run in Insomnia"></a>')}},{key:"renderCodeMD",value:function(){var e,t,n=encodeURIComponent(null!==(e=this.state.label)&&void 0!==e&&e),r=encodeURIComponent(null!==(t=this.state.uri)&&void 0!==t&&t),o="https://insomnia.rest/run/?label=".concat(n,"&uri=").concat(r);return"[](").concat(o,")")}},{key:"render",value:function(){return(0,m.jsx)(c.Fragment,{children:(0,m.jsxs)("article",{className:"pb-28",children:[(0,m.jsxs)("header",{className:"max-w-lg mx-auto text-center pt-20 pb-16",children:[(0,m.jsx)("h1",{className:"text-4xl font-bold pb-4",children:"Insomnia Run Button"}),(0,m.jsx)("p",{className:"text-xl",children:"Create an embeddable run in Insomnia button for your website, Git repo, or API docs"})]}),(0,m.jsx)("div",{className:"max-w-lg mx-auto flex flex-row",children:(0,m.jsxs)("form",{action:"#",children:[(0,m.jsx)("div",{className:"my-4",children:(0,m.jsxs)("label",{className:"pb-2 text-sm font-medium",children:[(0,m.jsxs)("div",{children:["API Name ",(0,m.jsx)("small",{children:"(will display during import flow)"})]}),(0,m.jsx)("input",{className:"w-full border rounded p-3",type:"text",placeholder:"Awesome API",required:!0,autoFocus:!0,onChange:this.changeLabel.bind(this)})]})}),(0,m.jsx)("div",{className:"my-4",children:(0,m.jsxs)("label",{className:"pb-2 text-sm font-medium",children:[(0,m.jsx)("div",{children:"Import URL"}),(0,m.jsx)("input",{className:"w-full border rounded p-3",type:"text",placeholder:"https://some-api.com/insomnia.json",required:!0,onChange:this.changeURI.bind(this)})]})}),(0,m.jsxs)("div",{className:"my-4",children:[(0,m.jsx)("label",{className:"pb-2 text-sm font-medium",children:"Button Preview"}),(0,m.jsx)("div",{className:"text-xs py-6 bg-gray-100 rounded flex justify-center",children:this.renderButton()})]}),(0,m.jsxs)("div",{className:"my-4",children:[(0,m.jsxs)("label",{className:"pb-2 text-sm font-medium",children:["HTML Snippet ",(0,m.jsx)("small",{children:"(embed this on your website)"})]}),(0,m.jsx)("pre",{className:"text-xs p-3 bg-gray-100 rounded",children:(0,m.jsx)("code",{className:"whitespace-pre-wrap",children:this.renderCode()})})]}),(0,m.jsxs)("div",{className:"my-4",children:[(0,m.jsx)("label",{className:"pb-2 text-sm font-medium",children:"Markdown Snippet"}),(0,m.jsx)("pre",{className:"text-xs p-3 bg-gray-100 rounded",children:(0,m.jsx)("code",{className:"whitespace-pre-wrap",children:this.renderCodeMD()})})]})]})})]})})}}]),n}(c.Component);t.default=function(){return(0,m.jsxs)(c.Fragment,{children:[(0,m.jsxs)(u(),{children:[(0,m.jsx)("title",{children:"".concat(x," - ").concat(h.siteName)}),(0,m.jsx)("meta",{name:"description",content:b}),(0,m.jsx)("meta",{property:"og:title",content:x}
1,"title"),(0,m.jsx)("meta",{property:"og:description",content:b}),(0,m.jsx)("meta",{property:"og:image",content:h.siteCardImage})]}),(0,m.jsx)(j,{})]})}},3700:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/create-run-button",function(){return n(5671)}])},2777:function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,{Z:function(){return r}})},2262:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}n.d(t,{Z:function(){return o}})},7247:function(e,t,n){"use strict";function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,{Z:function(){return r}})},5959:function(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}n.d(t,{Z:function(){return o}})},2179:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(4027);function o(e,t){if(t&&("object"===r(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}}},function(e){e.O(0,[774,888,179],(function(){return t=3700,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
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.