From e461170bf330bec67130ad22f209bbee6da77441 Mon Sep 17 00:00:00 2001 From: Ruben Van Assche Date: Wed, 10 Nov 2021 14:03:27 +0100 Subject: [PATCH 1/2] Add support for recording raw sql queries --- resources/compiled/ignition.js | 2 +- resources/js/components/Tabs/ContextTab.vue | 1 + src/Actions/ShareReportAction.php | 1 + src/IgnitionServiceProvider.php | 2 + src/Middleware/AddExceptionInformation.php | 24 ++++++++++++ .../AddExceptionInformationTest.php | 38 +++++++++++++++++++ 6 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 src/Middleware/AddExceptionInformation.php create mode 100644 tests/Middleware/AddExceptionInformationTest.php diff --git a/resources/compiled/ignition.js b/resources/compiled/ignition.js index 69720bdb..e6514301 100644 --- a/resources/compiled/ignition.js +++ b/resources/compiled/ignition.js @@ -29,4 +29,4 @@ function(t){switch(t.source){case"bitbucket.org":return"x-token-auth:"+t.token+" * @author Feross Aboukhadijeh * @license MIT */ -t.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},function(t,e,n){"use strict";n.r(e);n(94);var r,o,i,a=n(6),s=n.n(a),c=n(31),u=n.n(c),l=n(32),f=n.n(l),p=n(7),d=n(0),h=Object(d.a)({},(function(){var t=this.$createElement,e=this._self._c||t;return e("svg",{staticStyle:{display:"none"},attrs:{xmlns:"http://www.w3.org/2000/svg"}},[e("symbol",{attrs:{id:"arrow-down-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"}},[e("path",{attrs:{d:"M413.1 222.5l22.2 22.2c9.4 9.4 9.4 24.6 0 33.9L241 473c-9.4 9.4-24.6 9.4-33.9 0L12.7 278.6c-9.4-9.4-9.4-24.6 0-33.9l22.2-22.2c9.5-9.5 25-9.3 34.3.4L184 343.4V56c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24v287.4l114.8-120.5c9.3-9.8 24.8-10 34.3-.4z"}})]),this._v(" "),e("symbol",{attrs:{id:"arrow-up-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"}},[e("path",{attrs:{d:"M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z"}})]),this._v(" "),e("symbol",{attrs:{id:"clipboard-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512"}},[e("path",{attrs:{d:"M336 64h-80c0-35.3-28.7-64-64-64s-64 28.7-64 64H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM192 40c13.3 0 24 10.7 24 24s-10.7 24-24 24-24-10.7-24-24 10.7-24 24-24zm144 418c0 3.3-2.7 6-6 6H54c-3.3 0-6-2.7-6-6V118c0-3.3 2.7-6 6-6h42v36c0 6.6 5.4 12 12 12h168c6.6 0 12-5.4 12-12v-36h42c3.3 0 6 2.7 6 6z"}})]),this._v(" "),e("symbol",{attrs:{id:"lightbulb-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512"}},[e("path",{attrs:{d:"M176 80c-52.94 0-96 43.06-96 96 0 8.84 7.16 16 16 16s16-7.16 16-16c0-35.3 28.72-64 64-64 8.84 0 16-7.16 16-16s-7.16-16-16-16zM96.06 459.17c0 3.15.93 6.22 2.68 8.84l24.51 36.84c2.97 4.46 7.97 7.14 13.32 7.14h78.85c5.36 0 10.36-2.68 13.32-7.14l24.51-36.84c1.74-2.62 2.67-5.7 2.68-8.84l.05-43.18H96.02l.04 43.18zM176 0C73.72 0 0 82.97 0 176c0 44.37 16.45 84.85 43.56 115.78 16.64 18.99 42.74 58.8 52.42 92.16v.06h48v-.12c-.01-4.77-.72-9.51-2.15-14.07-5.59-17.81-22.82-64.77-62.17-109.67-20.54-23.43-31.52-53.15-31.61-84.14-.2-73.64 59.67-128 127.95-128 70.58 0 128 57.42 128 128 0 30.97-11.24 60.85-31.65 84.14-39.11 44.61-56.42 91.47-62.1 109.46a47.507 47.507 0 0 0-2.22 14.3v.1h48v-.05c9.68-33.37 35.78-73.18 52.42-92.16C335.55 260.85 352 220.37 352 176 352 78.8 273.2 0 176 0z"}})]),this._v(" "),e("symbol",{attrs:{id:"pencil-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"}},[e("path",{attrs:{d:"M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z"}})]),this._v(" "),e("symbol",{attrs:{id:"plus-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"}},[e("path",{attrs:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm144 276c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92h-92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z"}})]),this._v(" "),e("symbol",{attrs:{id:"share-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"}},[e("path",{attrs:{d:"M503.691 189.836L327.687 37.851C312.281 24.546 288 35.347 288 56.015v80.053C127.371 137.907 0 170.1 0 322.326c0 61.441 39.581 122.309 83.333 154.132 13.653 9.931 33.111-2.533 28.077-18.631C66.066 312.814 132.917 274.316 288 272.085V360c0 20.7 24.3 31.453 39.687 18.164l176.004-152c11.071-9.562 11.086-26.753 0-36.328z"}})])])}),[],!1,null,null,null).exports,g=n(5),m={inject:["config"],props:["text"]},v=Object(d.a)(m,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"mt-12 card card-has-header card-no-props"},[e("div",{staticClass:"card-details card-danger"},[e("div",{staticClass:"card-details-overflow scrollbar p-4"},[e("div",{staticClass:"text-xl"},[this._t("default")],2)])])])}),[],!1,null,null,null).exports,b=n(13),_={props:{name:{required:!0}},data:function(){return{fullException:!1}},methods:{removeClamp:function(){this.fullException||(this.fullException=!0)}}},y=Object(d.a)(_,(function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"ui-exception-message",class:this.fullException?"ui-exception-message-full":"",on:{mousedown:this.removeClamp}},[this._v("\n "+this._s(this.name)+"\n")])}),[],!1,null,null,null).exports,E={components:{ExceptionClass:n(14).a,ExceptionMessage:y,LineNumber:b.a,FilePath:g.a},inject:["report"],computed:{firstFrame:function(){return this.report.stacktrace[0]}}},x={inject:["report","telescopeUrl","config"],components:{OccurrenceDetails:Object(d.a)(E,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"card-details-overflow scrollbar p-12 pt-10"},[n("div",{staticClass:"text-2xl"},[n("ExceptionClass",{attrs:{name:t.report.exception_class}}),t._v(" "),n("ExceptionMessage",{attrs:{name:t.report.message}})],1),t._v(" "),n("div",[n("a",{staticClass:"ui-url",attrs:{href:t.report.context.request.url,target:"_blank"}},[t._v("\n "+t._s(t.report.context.request.url)+"\n ")])])])}),[],!1,null,null,null).exports,FilePath:g.a}},k=Object(d.a)(x,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mt-12 card card-has-header card-no-props"},[n("div",{staticClass:"card-header"},[n("div",{staticClass:"grid items-center rounded-t border-b border-tint-300 text-xs text-tint-600 ",staticStyle:{"grid-template-columns":"1fr 1fr"}},[n("div",{staticClass:"grid cols-auto justify-start gap-2 px-4 py-2"},[n("div",{staticClass:"flex items-center"},[n("a",{attrs:{href:"http://flareapp.io/docs/ignition-for-laravel/introduction",target:"_blank",title:"Ignition docs"}},[n("svg",{staticClass:"w-4 h-5 mr-4",attrs:{viewBox:"0 0 428 988"}},[n("polygon",{staticStyle:{fill:"#FA4E79"},attrs:{points:"428,247.1 428,494.1 214,617.5 214,369.3 \t\t"}}),t._v(" "),n("polygon",{staticStyle:{fill:"#FFF082"},attrs:{points:"0,988 0,741 214,617.5 214,864.1 \t\t"}}),t._v(" "),n("polygon",{staticStyle:{fill:"#E6003A"},attrs:{points:"214,123.9 214,617.5 0,494.1 0,0 \t\t"}}),t._v(" "),n("polygon",{staticStyle:{fill:"#FFE100"},attrs:{points:"214,864.1 214,617.5 428,741 428,988 \t\t"}})])]),t._v(" "),n("FilePath",{attrs:{pathClass:"font-normal",file:t.report.application_path+t.config.directorySeparator,relative:!1}})],1)]),t._v(" "),n("div",{staticClass:"grid cols-auto items-center justify-end gap-4 px-4 py-2"},[t.telescopeUrl?n("div",[n("a",{staticClass:"link-dimmed sm:ml-6",attrs:{href:t.telescopeUrl,target:"_blank"}},[t._v("Telescope")])]):t._e()])])]),t._v(" "),n("div"),t._v(" "),n("div",{staticClass:"card-details"},[n("OccurrenceDetails")],1)])}),[],!1,null,null,null).exports,w=n(10),C=n.n(w),A=n(20),T=n.n(A),S=n(101)(),R=null,O={inject:["config"],props:{solution:{required:!0}},data:function(){return{isHidingSolutions:this.hasHideSolutionsCookie(),canExecuteSolutions:null,runningSolution:!1,executionSuccessful:null}},computed:{healthCheckEndpoint:function(){return this.solution.execute_endpoint.replace("execute-solution","health-check")}},created:function(){this.configureRunnableSolutions()},mounted:function(){this.isHidingSolutions&&this.$refs.solutionCard.classList.add("solution-hidden")},methods:{configureRunnableSolutions:function(){this.config.enableRunnableSolutions?this.checkExecutionEndpoint():this.canExecuteSolutions=!1},markdown:function(t){return S.render(t)},checkExecutionEndpoint:(o=T()(C.a.mark((function t(){var e;return C.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch(this.healthCheckEndpoint);case 3:return t.next=5,t.sent.json();case 5:e=t.sent,this.canExecuteSolutions=e.can_execute_commands,t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0),this.canExecuteSolutions=!1;case 12:case"end":return t.stop()}}),t,this,[[0,9]])}))),function(){return o.apply(this,arguments)}),execute:(r=T()(C.a.mark((function t(){var e;return C.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.runningSolution){t.next=2;break}return t.abrupt("return");case 2:return t.prev=2,this.runningSolution=!0,t.next=6,fetch(this.solution.execute_endpoint,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({solution:this.solution.class,parameters:this.solution.run_parameters})});case 6:e=t.sent,this.executionSuccessful=200===e.status,t.next=14;break;case 10:t.prev=10,t.t0=t.catch(2),console.error(t.t0),this.executionSuccessful=!1;case 14:return t.prev=14,this.runningSolution=!1,t.finish(14);case 17:case"end":return t.stop()}}),t,this,[[2,10,14,17]])}))),function(){return r.apply(this,arguments)}),refresh:function(){location.reload()},getUrlLabel:function(t){var e=document.createElement("a");return e.href=t,e.hostname},toggleSolutions:function(){var t=this;this.isHidingSolutions?(window.clearTimeout(R),this.toggleHidingSolutions()):(this.$refs.solutionCard.classList.add("solution-hiding"),R=window.setTimeout((function(){t.$refs.solutionCard.classList.remove("solution-hiding"),t.toggleHidingSolutions()}),100))},toggleHidingSolutions:function(){if(this.isHidingSolutions)return document.cookie="".concat("hide_solutions","=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/;"),void(this.isHidingSolutions=!1);var t=new Date;t.setTime(t.getTime()+31536e6),document.cookie="".concat("hide_solutions","=true;expires=").concat(t.toUTCString(),";path=/;"),this.isHidingSolutions=!0},hasHideSolutionsCookie:function(){return document.cookie.includes("hide_solutions")}}},N={components:{DangerCard:v,SolutionCard:Object(d.a)(O,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"solution-toggle",class:{"solution-toggle-show":t.isHidingSolutions},on:{click:t.toggleSolutions}},[t.isHidingSolutions?n("a",{staticClass:"link-solution",attrs:{target:"_blank"}},[n("Icon",{staticClass:"text-xs mr-1",attrs:{name:"lightbulb"}}),t._v(" Show solutions")],1):n("a",{staticClass:"link-solution",attrs:{target:"_blank"}},[t._v("Hide solutions")])]),t._v(" "),n("div",{ref:"solutionCard",staticClass:"solution",class:{"solution-hidden":t.isHidingSolutions}},[n("div",{staticClass:"solution-main"},[n("div",{staticClass:"solution-background mx-0"},[n("svg",{staticClass:"hidden absolute right-0 h-full | md:block",attrs:{x:"0px",y:"0px",viewBox:"0 0 299 452"}},[n("g",{staticStyle:{opacity:"0.075"}},[n("polygon",{staticStyle:{fill:"rgb(63,63,63)"},attrs:{points:"298.1,451.9 150.9,451.9 21,226.9 298.1,227.1"}}),t._v(" "),n("polygon",{staticStyle:{fill:"rgb(151,151,151)"},attrs:{points:"298.1,227.1 21,226.9 150.9,1.9 298.1,1.9"}})])])]),t._v(" "),n("div",{staticClass:"p-12"},[n("div",{staticClass:"solution-content ml-0"},[""!==t.solution.title?n("h2",{staticClass:"solution-title"},[t._v("\n "+t._s(t.solution.title)+"\n ")]):t._e(),t._v(" "),t.solution.description?n("div",{domProps:{innerHTML:t._s(t.markdown(t.solution.description))}}):t._e(),t._v(" "),t.solution.is_runnable?n("div",[n("p",{domProps:{innerHTML:t._s(t.markdown(t.solution.action_description))}}),t._v(" "),null===t.canExecuteSolutions?n("p",{staticClass:"py-4 text-sm italic"},[t._v("\n Loading...\n ")]):t._e(),t._v(" "),n("div",{staticClass:"mt-4"},[t.solution.is_runnable&&!0===t.canExecuteSolutions&&null===t.executionSuccessful?n("button",{staticClass:"button-secondary button-lg bg-tint-300 hover:bg-tint-400",attrs:{disabled:t.runningSolution},on:{click:t.execute}},[t.runningSolution?n("span",[t._v("Running...")]):t._e(),t._v(" "),t.runningSolution?t._e():n("span",[t._v(t._s(t.solution.run_button_text))])]):t._e(),t._v(" "),t.executionSuccessful?n("p",[n("strong",{staticClass:"font-semibold"},[t._v("The solution was executed successfully.")]),t._v(" "),n("a",{staticClass:"link-solution",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.refresh(e)}}},[t._v("Refresh now.")])]):t._e(),t._v(" "),!1===t.executionSuccessful?n("p",[t._v("\n Something went wrong when executing the solution. Please try\n refreshing the page and try again.\n ")]):t._e()])]):t._e(),t._v(" "),Object.entries(t.solution.links).length>0?n("div",{staticClass:"mt-8 grid justify-start"},[n("div",{staticClass:"border-t-2 border-gray-700 opacity-25 "}),t._v(" "),n("div",{staticClass:"pt-2 grid cols-auto-1fr gapx-4 gapy-2 text-sm"},[n("label",{staticClass:"font-semibold uppercase tracking-wider"},[t._v("Read more")]),t._v(" "),n("ul",t._l(t.solution.links,(function(e,r){return n("li",{key:r},[n("a",{staticClass:"link-solution",attrs:{href:e,target:"_blank"}},[t._v(t._s(r))])])})),0)])]):t._e()])])])])])}),[],!1,null,null,null).exports,ErrorCard:k,FilePath:g.a},inject:["report","solutions","appEnv","appDebug"],data:function(){return{activeSolutionKey:0}},computed:{firstFrame:function(){return this.report.stacktrace[0]},solution:function(){return this.solutions[this.activeSolutionKey]}}},I=Object(d.a)(N,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"layout-col z-10"},["local"!==this.appEnv&&!0===this.appDebug?n("DangerCard",[n("p",[n("code",[t._v("APP_DEBUG")]),t._v(" is set to "),n("code",[t._v("true")]),t._v(" while "),n("code",[t._v("APP_ENV")]),t._v(" is\n not "),n("code",[t._v("local")])]),t._v(" "),n("p",{staticClass:"text-base"},[t._v("\n This could make your application vulnerable to remote execution.\n "),n("a",{staticClass:"underline",attrs:{target:"_blank",rel:"noopener",href:"https://flareapp.io/docs/ignition-for-laravel/security"}},[t._v("Read more about Ignition security.")])])]):t._e(),t._v(" "),n("ErrorCard")],1),t._v(" "),t.solutions.length>0?n("div",{staticClass:"layout-col z-1"},[n("SolutionCard",t._b({},"SolutionCard",{solution:t.solution},!1)),t._v(" "),t.solutions.length>1?n("div",{staticClass:"absolute left-0 bottom-0 w-full h-8 mb-2 px-4 text-sm z-10"},[n("ul",{staticClass:"grid cols-auto place-center gap-1"},t._l(t.solutions,(function(e,r){return n("li",{key:e.class,on:{click:function(e){t.activeSolutionKey=r}}},[n("a",{staticClass:"grid place-center h-8 min-w-8 px-2 rounded-full",class:{"bg-tint-200 font-semibold":t.activeSolutionKey===r,"hover:bg-tint-100 cursor-pointer":t.activeSolutionKey!==r}},[t._v("\n "+t._s(r+1)+"\n ")])])})),0)]):t._e()],1):t._e()])}),[],!1,null,null,null).exports,L={components:{CheckboxField:n(35).a},props:["error","isLoading"],computed:{selectedTabs:function(){return this.tabs.filter((function(t){return t.checked})).map((function(t){return t.name}))}},data:function(){return{tabs:[{label:"Stack trace",name:"stackTraceTab",checked:!0},{label:"Request",name:"requestTab",checked:!0},{label:"App",name:"appTab",checked:!0},{label:"User",name:"userTab",checked:!0},{label:"Context",name:"contextTab",checked:!0},{label:"Debug",name:"debugTab",checked:!0}]}},methods:{shareError:function(){this.isLoading||this.$emit("share",this.selectedTabs)}}},D=Object(d.a)(L,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"grid cols-2 justify-start gapx-6 gapy-2"},t._l(t.tabs,(function(e){return n("CheckboxField",{key:e.name,staticClass:"text-gray-200 hover:text-white",attrs:{label:e.label,name:e.name},on:{change:function(t){e.checked=!e.checked}},model:{value:e.checked,callback:function(n){t.$set(e,"checked",n)},expression:"tab.checked"}})})),1),t._v(" "),n("div",{staticClass:"mt-4"},[t.error?n("div",{staticClass:"mb-3"},[t._v("\n We were unable to share your error."),n("br"),t._v("\n Please try again later.\n ")]):t._e(),t._v(" "),n("button",{staticClass:"button-secondary button-sm text-white bg-tint-600",attrs:{disabled:t.isLoading},on:{click:t.shareError}},[t._v("\n "+t._s(t.isLoading?"Sharing…":"Share")+"\n ")])])])}),[],!1,null,null,null).exports,M={props:{text:{required:!0}},data:function(){return{copied:!1,timeout:!1}},methods:{copy:function(t){var e=this;this.timeout&&window.clearTimeout(this.timeout);var n=document.createElement("textarea");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),this.copied=!0,this.timeout=window.setTimeout((function(){return e.copied=!1}),3e3)}}},P={components:{CopyButton:Object(d.a)(M,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("button",{attrs:{title:"Copy to clipboard"},on:{click:function(e){return t.copy(t.text)}}},[n("Icon",{class:t.copied?"fill-green-300":"fill-gray-200 hover:fill-white",attrs:{name:"clipboard"}}),t._v(" "),t.copied?n("div",{staticClass:"ml-2 absolute top-0 left-full text-green-300"},[t._v("\n Copied!\n ")]):t._e()],1)}),[],!1,null,null,null).exports},props:{publicUrl:{required:!0},ownerUrl:{required:!0}}},j={components:{ShareLinks:Object(d.a)(P,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"text-left"},[n("p",{staticClass:"mt-2 text-gray-300"},[t._v("Share your error with others:")]),t._v(" "),n("div",{staticClass:"grid cols-auto items-center justify-start gap-2 mt-2"},[n("a",{staticClass:"button-secondary button-sm bg-tint-600 hover:bg-tint-700 text-white",attrs:{href:t.publicUrl,target:"_blank"}},[t._v("Open public share")]),t._v(" "),n("CopyButton",{attrs:{text:t.publicUrl}})],1),t._v(" "),n("p",{staticClass:"mt-4 text-gray-300"},[t._v("Administer your shared error here:")]),t._v(" "),n("div",{staticClass:"grid cols-auto items-center justify-start gap-2 mt-2"},[n("a",{staticClass:"button-secondary button-sm bg-tint-600 hover:bg-tint-700 text-white",attrs:{href:t.ownerUrl,target:"_blank"}},[t._v("Open share admin")]),t._v(" "),n("CopyButton",{attrs:{text:t.ownerUrl}})],1)])}),[],!1,null,null,null).exports,ShareForm:D},inject:["report","shareEndpoint"],data:function(){return{shareHadError:!1,sharedErrorUrls:null,menuVisible:!1,isShareLoading:!1}},watch:{menuVisible:function(t){t?window.addEventListener("click",this.toggleMenu):window.removeEventListener("click",this.toggleMenu)}},methods:{toggleMenu:function(){this.menuVisible=!this.menuVisible},shareError:(i=T()(C.a.mark((function t(e){var n,r;return C.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.isShareLoading=!0,t.prev=1,t.next=4,fetch(this.shareEndpoint,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({report:JSON.stringify(this.report),tabs:e,lineSelection:window.location.hash})});case 4:return n=t.sent,t.next=7,n.json();case 7:r=t.sent,n.ok?this.sharedErrorUrls=r:this.shareHadError=!0,t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),this.shareHadError=!0;case 14:this.isShareLoading=!1;case 15:case"end":return t.stop()}}),t,this,[[1,11]])}))),function(t){return i.apply(this,arguments)})}},F={inject:["config"],components:{ShareButton:Object(d.a)(j,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{on:{click:function(t){t.stopPropagation()}}},[n("button",{staticClass:"tab",class:t.menuVisible?"tab-active":"",on:{click:t.toggleMenu}},[t._v("\n Share\n "),n("Icon",{staticClass:"ml-2",attrs:{name:"share"}})],1),t._v(" "),n("div",{staticClass:"dropdown z-10 right-0 top-full p-4 overflow-visible",class:{hidden:!t.menuVisible},staticStyle:{"min-width":"18rem","margin-right":"-1px"},on:{click:function(t){t.stopPropagation()}}},[n("div",{staticClass:"flex items-center mb-4"},[n("svg",{staticClass:"w-4 h-5 mr-2",attrs:{viewBox:"0 0 682 1024"}},[n("polygon",{staticStyle:{fill:"#51DB9E"},attrs:{points:"235.3,510.5 21.5,387 21.5,140.2 236.5,264.1 "}}),t._v(" "),n("polygon",{staticStyle:{fill:"#7900F5"},attrs:{points:"235.3,1004.8 21.5,881.4 21.5,634.5 234.8,757.9 "}}),t._v(" "),n("polygon",{staticStyle:{fill:"#94F2C8"},attrs:{points:"448.9,386.9 21.5,140.2 235.3,16.7 663.2,263.4 "}}),t._v(" "),n("polygon",{staticStyle:{fill:"#A475F4"},attrs:{points:"234.8,757.9 21.5,634.5 235.3,511 449.1,634.5 "}})]),t._v(" "),n("h5",{staticClass:"text-left font-semibold uppercase tracking-wider whitespace-no-wrap"},[t._v("\n "+t._s(t.sharedErrorUrls?"Shared":"Share")+" on Flare\n ")]),t._v(" "),n("a",{staticClass:"ml-auto underline",attrs:{target:"_blank",href:"https://flareapp.io/docs/ignition-for-laravel/sharing-errors",title:"Flare documentation"}},[t._v("Docs\n ")])]),t._v(" "),t.sharedErrorUrls?n("div",[n("ShareLinks",{attrs:{publicUrl:t.sharedErrorUrls.public_url,ownerUrl:t.sharedErrorUrls.owner_url}})],1):n("ShareForm",{attrs:{error:t.shareHadError,"is-loading":t.isShareLoading},on:{share:t.shareError}})],1)])}),[],!1,null,null,null).exports},props:{value:{required:!0},customTabs:{required:!0}},data:function(){return{defaultTabs:[{component:"StackTab",title:"Stack trace"},{component:"RequestTab",title:"Request"},{component:"AppTab",title:"App"},{component:"UserTab",title:"User"},{component:"ContextTab",title:"Context"},{component:"DebugTab",title:"Debug"}],shareButtonEnabled:this.config.enableShareButton}},mounted:function(){this.applyDefaultTabProps(),this.$emit("input",this.tabs[this.currentTabIndex])},computed:{currentTabIndex:function(){var t=this;return this.tabs.findIndex((function(e){return e.component===t.value.component}))},nextTab:function(){return this.tabs[this.currentTabIndex+1]||this.tabs[0]},previousTab:function(){return this.tabs[this.currentTabIndex-1]||this.tabs[this.tabs.length-1]},tabs:function(){var t={};return this.defaultTabs.forEach((function(e){t[e.component]=e})),this.customTabs.forEach((function(e){t[e.component]=e})),Object.values(t)}},methods:{applyDefaultTabProps:function(){var t=this;this.defaultTabs.map((function(e){return e.component===t.value.component&&(e.props=t.value.props||{}),e}))}}},U={props:{tab:{required:!0}},render:function(t){return t(this.tab.component,{props:this.tab.props||{}})}},$={props:{report:{required:!0},config:{required:!0},solutions:{required:!0},telescopeUrl:{required:!0},shareEndpoint:{required:!0},defaultTab:{required:!0},defaultTabProps:{required:!1},appEnv:{required:!0},appDebug:{required:!0}},data:function(){return{customTabs:window.tabs,tab:{component:this.defaultTab,props:this.defaultTabProps||{}}}},provide:function(){return{config:this.config,report:this.report,solutions:this.solutions,telescopeUrl:this.telescopeUrl,shareEndpoint:this.shareEndpoint,setTab:this.setTab,appEnv:this.appEnv,appDebug:this.appDebug}},components:{Summary:I,Tabs:Object(d.a)(F,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("nav",{staticClass:"tab-nav"},[n("ul",{staticClass:"tab-bar"},t._l(t.tabs,(function(e){return n("li",{key:e.component},[n("button",{staticClass:"tab",class:t.value.component===e.component?"tab-active":"",on:{click:function(n){return n.preventDefault(),t.$emit("input",e)}}},[t._v("\n "+t._s(e.title)+"\n ")])])})),0),t._v(" "),t.shareButtonEnabled?[n("div",{staticClass:"tab-delimiter"}),t._v(" "),n("ShareButton")]:t._e()],2)}),[],!1,null,null,null).exports,Details:Object(d.a)(U,void 0,void 0,!1,null,null,null).exports,IconSymbols:h},methods:{setTab:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.tab={component:t,props:e}}},created:function(){}},B=Object(d.a)($,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("IconSymbols"),t._v(" "),n("Summary"),t._v(" "),n("div",{staticClass:"layout-col mt-12"},[n("div",{staticClass:"tabs"},[n("Tabs",t._b({model:{value:t.tab,callback:function(e){t.tab=e},expression:"tab"}},"Tabs",{customTabs:t.customTabs},!1)),t._v(" "),n("div",{staticClass:"tab-main"},[n("Details",t._b({},"Details",{tab:t.tab},!1))],1)],1)])],1)}),[],!1,null,null,null).exports;function z(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function q(t){for(var e=1;e=this.selectedRange[0]&&t<=this.selectedRange[1])},editorUrl:function(t){return Object(c.a)(this.config,this.selectedFrame.file,t)},highlightedCode:function(t){var e=o.a.highlight("php",t||"",!0,this.highlightState);return this.highlightState=e.top,e.value||" "}}},l=n(0),f=Object(l.a)(u,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"stack-main"},[n("div",{staticClass:"stack-main-header"},[n("div",{staticClass:"grid cols-auto gap-2 justify-start items-center"},[n("ExceptionClass",{attrs:{name:t.selectedFrame.class||"",method:t.selectedFrame.method||""}})],1),t._v(" "),t.selectedFrame.file?n("FilePath",{staticClass:"mt-1",attrs:{"line-number":t.selectedFrame.line_number,file:t.selectedFrame.file,editable:!0}}):t._e()],1),t._v(" "),n("div",{staticClass:"stack-main-content"},[n("div",{staticClass:"stack-viewer scrollbar"},[n("div",{staticClass:"stack-ruler"},[n("div",{staticClass:"stack-lines"},t._l(t.selectedFrame.code_snippet,(function(e,r){return n("p",{key:r,staticClass:"stack-line cursor-pointer",class:{"stack-line-selected":t.withinSelectedRange(parseInt(r)),"stack-line-highlight":parseInt(r)===t.selectedFrame.line_number},on:{click:function(e){t.handleLineNumberClick(e,parseInt(r))}}},[t._v("\n "+t._s(r)+"\n ")])})),0)]),t._v(" "),n("pre",{ref:"codeContainer",staticClass:"stack-code",class:t.highlightTheme},[t._l(t.selectedFrame.code_snippet,(function(e,r){return n("p",{key:r,staticClass:"stack-code-line",class:{"stack-code-line-highlight":parseInt(r)===t.selectedFrame.line_number,"stack-code-line-selected":t.withinSelectedRange(parseInt(r))}},[n("span",{domProps:{innerHTML:t._s(t.highlightedCode(e))}}),n("a",{staticClass:"editor-link",attrs:{href:t.editorUrl(r)}},[n("Icon",{attrs:{name:"pencil"}})],1)])})),t._v("\n ")],2)])])])}),[],!1,null,null,null).exports,p={props:{frameGroup:{required:!0}},components:{ExceptionClass:i.a,FilePath:a.a,LineNumber:s.a}},d=Object(l.a)(p,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.frameGroup.expanded||"vendor"!==t.frameGroup.type?"unknown"===t.frameGroup.type?n("li",{staticClass:"stack-frame-group stack-frame-group-unknown"},[n("div",{staticClass:"stack-frame"},[n("button",{staticClass:"stack-frame-number"}),t._v(" "),n("div",{staticClass:"span-2 stack-frame-text"},[n("span",{staticClass:"text-left text-gray-500"},[t._v("\n "+t._s(t.frameGroup.frames.length>1?t.frameGroup.frames.length+" unknown frames":"1 unknown frame")+"\n ")])])])]):n("li",[n("ul",{staticClass:"stack-frame-group",class:"vendor"===t.frameGroup.type?"stack-frame-group-vendor":""},t._l(t.frameGroup.frames,(function(e,r){return n("li",{key:r,staticClass:"stack-frame | cursor-pointer",class:e.selected?"stack-frame-selected":"",on:{click:function(n){return t.$emit("select",e.frame_number)}}},[n("div",{staticClass:"stack-frame-number"},[t._v(t._s(e.frame_number))]),t._v(" "),n("div",{staticClass:"stack-frame-text"},[0===r?n("header",{staticClass:"stack-frame-header",class:e.class?"mb-1":""},[n("FilePath",{staticClass:"stack-frame-path",attrs:{pathClass:"vendor"===t.frameGroup.type?"text-gray-800":"text-purple-800",file:e.relative_file}})],1):t._e(),t._v(" "),e.class?n("span",{staticClass:"stack-frame-exception-class"},[n("ExceptionClass",{staticClass:"stack-frame-exception-class",attrs:{name:e.class}})],1):t._e()]),t._v(" "),n("div",{staticClass:"stack-frame-line"},[n("LineNumber",{attrs:{lineNumber:e.line_number}})],1)])})),0)]):n("li",{staticClass:"stack-frame-group stack-frame-group-vendor",on:{click:function(e){return t.$emit("expand")}}},[n("div",{staticClass:"stack-frame | cursor-pointer"},[n("button",{staticClass:"stack-frame-number"},[n("Icon",{staticClass:"align-middle text-gray-500",attrs:{name:"plus"}})],1),t._v(" "),n("div",{staticClass:"span-2 stack-frame-text"},[n("button",{staticClass:"text-left text-gray-500"},[t._v("\n "+t._s(t.frameGroup.frames.length>1?t.frameGroup.frames.length+" vendor frames…":"1 vendor frame…")+"\n ")])])])])}),[],!1,null,null,null).exports,h=n(6),g=n.n(h),m=n(4),v=n.n(m),b=n(15),_=n.n(b);function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function E(t){return t.map((function(e,n){return function(t){for(var e=1;e