From 5b0300f6b05df79824fa0668fb5678c8a040ec8d Mon Sep 17 00:00:00 2001 From: Syd Amir Date: Wed, 1 Nov 2023 14:34:53 +0330 Subject: [PATCH] :art: generate new bundle of playground --- src/server/playground/dist/bundle-css.css | 128 +++++++++++++++++-- src/server/playground/dist/bundle-es.js | 6 +- src/server/playground/dist/bundle-es.js.map | 4 +- src/server/playground/dist/bundleContent.ts | 130 ++++++++++++++++++-- 4 files changed, 248 insertions(+), 20 deletions(-) diff --git a/src/server/playground/dist/bundle-css.css b/src/server/playground/dist/bundle-css.css index 818edf17..07d77f4f 100644 --- a/src/server/playground/dist/bundle-css.css +++ b/src/server/playground/dist/bundle-css.css @@ -961,9 +961,6 @@ textarea { color: black; font-size: 14px; } -.results { - margin-top: 5px; -} .results-buttons { position: absolute; top: 0; @@ -1052,6 +1049,7 @@ textarea { margin: 0 2rem; } .sequence-re { + overflow-wrap: anywhere; width: 50%; background-color: rgba(147, 147, 147, 0.1); border-radius: 10px 0 0 10px; @@ -1064,14 +1062,44 @@ textarea { } .detail-sequence { padding: 1rem; - color: red; -} -.detail-sequence p { color: bisque; + display: flex; + flex-direction: column; + gap: 15px; } -.detail-sequence p span { +.detail-sequence span span { color: #f1fa8c; } +.e2e-success { + color: #00b800; +} +.e2e-fail { + color: #c00; +} +.detail-sequence--sections { + display: flex; + flex-direction: column; + gap: 5px; + border: 1px solid gainsboro; + border-radius: 7px; + padding: 5px 10px; + position: relative; +} +.sequnce-description-label { + position: absolute; + top: 0; + right: 10px; + border: 1px solid gainsboro; + border-top: none; + border-radius: 0 0 7px 7px; + color: burlywood; + padding: 2px 6px; +} +.detail-sequence--sections--capture-items { + list-style: none; + padding: 0 0 0 10px; + margin-top: 0; +} .schema-modal { width: 97%; margin: 2rem auto 0 auto; @@ -1373,6 +1401,92 @@ textarea { color: bisque; height: 20px; } +.e2e-container--sequence-container { + display: flex; + flex-direction: column; + gap: 7px; + margin-top: 50px; +} +.information-container-label { + position: absolute; + top: -17px; + border: 1px solid gainsboro; + border-radius: 10px; + background-color: #002929; + padding: 2px 6px; +} +.e2e-container--sequence-container--information-container { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + gap: 30px; + position: relative; + border: 1px solid gainsboro; + border-radius: 10px; + background-color: #273f3f; + color: gainsboro; + padding: 50px 30px; + padding: "50px 30px"; + overflow-wrap: anywhere; +} +.information-container--request { + display: flex; + justify-content: space-between; + width: 100%; + border: 1px solid gainsboro; + border-radius: 7px; + padding: 15px 15px 0 15px; + position: relative; +} +.information-container--request--sections { + display: flex; + flex-direction: column; + padding: 5px; +} +.information-container--request--sections--item { + margin: 0; +} +.information-container--request--sections--item--content { + color: #f1fa8c; +} +.information-container--times { + display: flex; + gap: 10px; + padding: 10px 15px 0 15px; + border: 1px solid gainsboro; + border-radius: 7px; + width: 100%; + position: relative; +} +.information-container--times--sections { + flex-grow: 1; + border: 1px solid gainsboro; + border-radius: 7px; + padding: 5px 10px; + list-style: none; +} +.e2e-best { + color: gold; +} +.information-container--captures { + display: flex; + flex-wrap: wrap; + gap: 10px; + border: 1px solid gainsboro; + border-radius: 7px; + padding: 40px 15px 0 15px; + position: relative; + width: 100%; +} +.information-container--captures--sections { + flex-grow: 1; + border: 1px solid gainsboro; + border-radius: 7px; + padding: 20px 10px 5px 10px; + list-style: none; + margin-top: 0; + position: relative; +} .container-detail { display: flex; justify-content: space-between; diff --git a/src/server/playground/dist/bundle-es.js b/src/server/playground/dist/bundle-es.js index 9ee0188a..de0bd8d5 100644 --- a/src/server/playground/dist/bundle-es.js +++ b/src/server/playground/dist/bundle-es.js @@ -1,4 +1,4 @@ -import{createContext as Me,Fragment as h,h as e,hydrate as De}from"https://esm.sh/preact@10.5.15";import{useCallback as I,useContext as Oe,useEffect as B,useMemo as Fe,useReducer as Le,useRef as J,useState as S}from"https://esm.sh/preact@10.5.15/hooks";var q=()=>Date.now().toString(36)+Math.random().toString(36).substr(2);var tt={tabsData:[{service:"",schema:"",act:"",postFields:{},getFields:{},formData:{},response:null}],activeTab:0,setActiveTab:()=>({}),addTab:()=>({}),closeTab:()=>({}),setTabsData:()=>({})},st={schemasObj:{},actsObj:{},setService:()=>({}),setMethod:()=>({}),setSchema:()=>({}),setAct:()=>({}),setActsObj:()=>({}),setSchemasObj:()=>({}),setPostFields:()=>({}),resetPostFields:()=>({}),setGetFields:()=>({}),resetGetFields:()=>({}),setFormData:()=>({}),setResponse:()=>({})},at={history:[],deleteItemHistory:()=>({}),setHistory:()=>({})},ot={headers:{Authorization:""},setHeader:()=>({})},ue=()=>({id:q(),bodyHeaders:` +import{createContext as Me,Fragment as q,h as e,hydrate as De}from"https://esm.sh/preact@10.5.15";import{useCallback as I,useContext as Oe,useEffect as B,useMemo as Fe,useReducer as Le,useRef as J,useState as S}from"https://esm.sh/preact@10.5.15/hooks";var h=()=>Date.now().toString(36)+Math.random().toString(36).substr(2);var tt={tabsData:[{service:"",schema:"",act:"",postFields:{},getFields:{},formData:{},response:null}],activeTab:0,setActiveTab:()=>({}),addTab:()=>({}),closeTab:()=>({}),setTabsData:()=>({})},st={schemasObj:{},actsObj:{},setService:()=>({}),setMethod:()=>({}),setSchema:()=>({}),setAct:()=>({}),setActsObj:()=>({}),setSchemasObj:()=>({}),setPostFields:()=>({}),resetPostFields:()=>({}),setGetFields:()=>({}),resetGetFields:()=>({}),setFormData:()=>({}),setResponse:()=>({})},at={history:[],deleteItemHistory:()=>({}),setHistory:()=>({})},nt={headers:{Authorization:""},setHeader:()=>({})},ue=()=>({id:h(),bodyHeaders:` { "headers": { "Content-Type": "application/json", @@ -17,7 +17,7 @@ import{createContext as Me,Fragment as h,h as e,hydrate as De}from"https://esm.s } } } - `,repeat:1,captures:[]}),nt={e2eForms:[ue()],setE2eForms:()=>({}),addE2eForm:()=>({})},rt={modal:null,setModal:()=>({})},fe={...tt,...st,...at,...ot,...nt,...rt};function he(a,s){let{type:t,payload:o}=s;switch(t){case"SET_SELECTED_SERVICE":{let r=[...a.tabsData];return r[o.index]={...r[o.index],service:o.data},{...a,tabsData:[...r]}}case"SET_SCHEMA":{let r=[...a.tabsData];return r[o.index]={...r[o.index],schema:o.data},{...a,tabsData:[...r]}}case"SET_ACT":{let r=[...a.tabsData];return r[o.index]={...r[o.index],act:o.data},{...a,tabsData:[...r]}}case"SET_POST_FIELDS":{let r=[...a.tabsData];return r[o.index]={...r[o.index],postFields:o.data},{...a,tabsData:[...r]}}case"RESET_POST_FIELDS":{let r=[...a.tabsData];return r[o]={...r[o],postFields:{}},{...a,tabsData:[...r]}}case"SET_GET_FIELDS":{let r=[...a.tabsData];return r[o.index]={...r[o.index],getFields:o.data},{...a,tabsData:[...r]}}case"RESET_GET_FIELDS":{let r=[...a.tabsData];return r[o]={...r[o],getFields:{}},{...a,tabsData:[...r]}}case"SET_FORM_DATA":{let r=[...a.tabsData];return r[o.index]={...r[o.index],formData:o.data},{...a,tabsData:[...r]}}case"SET_HEADER":return{...a,headers:o};case"ADD_HISTORY":return{...a,history:o};case"SET_TABS_DATA":return{...a,tabsData:o};case"SET_RESPONSE":{let r=[...a.tabsData];return r[o.index]={...r[o.index],response:o.data},{...a,tabsData:[...r]}}case"ADD_TAB":return{...a,tabsData:[...a.tabsData,{service:"",schema:"",act:"",postFields:{},getFields:{},formData:{},response:null}],activeTab:a.tabsData.length};case"SET_ACTIVE_TAB":return{...a,activeTab:o};case"CLOSE_TAB":{let r=[...a.tabsData];return r.length>1&&r.splice(o,1),{...a,tabsData:[...r],activeTab:r.length>=1&&a.activeTab>=o&&a.activeTab!==0?a.activeTab-1:a.activeTab}}case"DELETE_ITEM_HISTORY":return{...a,history:a.history.slice(0,o).concat(a.history.slice(o+1))};case"SET_ACTS_OBJ":return{...a,actsObj:o};case"SET_SCHEMAS_OBJ":return{...a,schemasObj:o};case"SET_E2E_FORMS":return{...a,e2eForms:o};case"ADD_E2E_FORM":return{...a,e2eForms:[...a.e2eForms,o]};case"OPEN_MODAL":return{...a,modal:o};default:throw new Error("Unhandled action type")}}var be=Me(fe),He=a=>{let[s,t]=Le(he,fe),o=I(p=>t({type:"SET_SELECTED_SERVICE",payload:p}),[t]),r=I(p=>t({type:"SET_SCHEMA",payload:p}),[t]),m=I(p=>t({type:"SET_ACT",payload:p}),[t]),l=I(p=>t({type:"SET_POST_FIELDS",payload:p}),[t]),d=I(p=>t({type:"RESET_POST_FIELDS",payload:p}),[t]),i=I(p=>t({type:"SET_GET_FIELDS",payload:p}),[t]),C=I(p=>t({type:"RESET_GET_FIELDS",payload:p}),[t]),w=I(p=>t({type:"SET_FORM_DATA",payload:p}),[t]),T=I(p=>t({type:"SET_ACTIVE_TAB",payload:p}),[t]),N=I(p=>t({type:"ADD_TAB",payload:p}),[t]),F=I(p=>t({type:"CLOSE_TAB",payload:p}),[t]),$=I(p=>t({type:"DELETE_ITEM_HISTORY",payload:p}),[t]),z=I(p=>t({type:"SET_HEADER",payload:p}),[t]),Z=I(p=>t({type:"ADD_HISTORY",payload:p}),[t]),Y=I(p=>t({type:"SET_TABS_DATA",payload:p}),[t]),W=I(p=>t({type:"SET_RESPONSE",payload:p}),[t]),V=I(p=>t({type:"SET_SCHEMAS_OBJ",payload:p}),[t]),c=I(p=>t({type:"SET_ACTS_OBJ",payload:p}),[t]),b=I(p=>t({type:"SET_E2E_FORMS",payload:p}),[t]),y=I(p=>t({type:"ADD_E2E_FORM",payload:p}),[t]),E=I(p=>t({type:"OPEN_MODAL",payload:p}),[t]),M=Fe(()=>({...s,setService:o,setSchema:r,setAct:m,setPostFields:l,resetPostFields:d,setGetFields:i,resetGetFields:C,setFormData:w,setHeader:z,setHistory:Z,setTabsData:Y,setResponse:W,setActsObj:c,setSchemasObj:V,setActiveTab:T,addTab:N,closeTab:F,deleteItemHistory:$,setE2eForms:b,addE2eForm:y,setModal:E}),[s]);return e(be.Provider,{value:M,...a})};var j=()=>{let a=Oe(be);return a},Ae=a=>{let{children:s}=a;return e(He,null,s)};var le=a=>{let s={get:{},set:{}};for(let t in a)if(a[t]||a[t]===0){let o=t.split("."),r=s;for(;o.length>1;){let m=o.shift();r[m]=r[m]||{},r=r[m]}r[o[0]]=a[t]}return s};var ce=(a,s,t)=>{for(let o in a)typeof a[o]=="object"?ce(a[o],s,t?`${t}.${o}`:o):s[`${t}.${o}`]=a[o];return s};function te(){return e("svg",{width:"30px",height:"35px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M16.6725 16.6412L21 21M19 11C19 15.4183 15.4183 19 11 19C6.58172 19 3 15.4183 3 11C3 6.58172 6.58172 3 11 3C15.4183 3 19 6.58172 19 11Z",stroke:"#000000","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))}function G(){return e("svg",{width:"25px",height:"25px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.2501 7.06066L8.03039 10.2803L6.96973 9.21967L12.0001 4.18934L17.0304 9.21967L15.9697 10.2803L12.7501 7.06066L12.7501 16.5L11.2501 16.5L11.2501 7.06066Z",fill:"lightcoral"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12ZM3.00683 12C3.00683 16.9668 7.03321 20.9932 12 20.9932C16.9668 20.9932 20.9932 16.9668 20.9932 12C20.9932 7.03321 16.9668 3.00683 12 3.00683C7.03321 3.00683 3.00683 7.03321 3.00683 12Z",fill:"bisque"}))}function qe(){let{actsObj:a}=j(),s=()=>{let m=`data:text/json;chatset=utf-8,${encodeURIComponent(JSON.stringify(a))}`,l=document.createElement("a");l.href=m,l.download="acts.json",l.click()},t=["color-1","color-2","color-3","color-4","color-5","color-6","color-7"],o=m=>Object.keys(m).map((l,d)=>{let i=q();return e("div",{className:"schema"},e("div",{className:"schema-name",onClick:()=>{document.getElementById(i)?.classList.toggle("open")}},e("p",{className:"schema-title"},l),e("span",null,"...")),e("div",{className:"proceed-child-container",id:i},r(a[l])))}),r=m=>Object.keys(m).map((l,d)=>{let i=q();if(m[l]||m[l]===0)return e("div",{className:`inside-schema ${t[Math.floor(Math.random()*t.length)]}`},e("div",{className:`inside ${typeof m[l]=="object"&&m[l].schema!==null&&"schema-pointer"}`,onClick:()=>{document.getElementById(i)?.classList.toggle("open")}},e("p",{className:"schema-title"},l),m[l].type&&e("p",{className:"schema-title schema-type"},m[l].type),e("div",null," ",typeof m[l]=="object"&&m[l].schema!==null&&e("span",null,"..."))),e("div",{id:i,className:"proceed-child"},typeof m[l]=="object"&&m[l]!==null&&m[l].schema!==null&&r(m[l].validator?m[l].validator.schema:m[l].schema?m[l].schema:m[l])))});return e("div",{className:"schema-modal"}," ",e("div",{className:"results-buttons"},e("button",{className:" schema-export-button btn e2e-back-button e2e-export_results-button",onClick:s},e(G,null),e("span",null,"Export"))),e("div",{className:"search-box"},e("input",{className:"input",type:"text",placeholder:"search..."}),e("span",{className:"search-icon"},e(te,null))),e("div",{className:"schema-list"},o(a)))}function se(){return e("svg",{width:"25px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M9.00002 15.3802H13.92C15.62 15.3802 17 14.0002 17 12.3002C17 10.6002 15.62 9.22021 13.92 9.22021H7.15002",stroke:"lightcoral","stroke-width":"1.5","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M8.57 10.7701L7 9.19012L8.57 7.62012",stroke:"lightcoral","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12ZM3.00683 12C3.00683 16.9668 7.03321 20.9932 12 20.9932C16.9668 20.9932 20.9932 16.9668 20.9932 12C20.9932 7.03321 16.9668 3.00683 12 3.00683C7.03321 3.00683 3.00683 7.03321 3.00683 12Z",fill:"bisque"}))}var je=({setView:a})=>e("div",{className:"help"}," ",e("button",{className:"btn e2e-back-button",onClick:()=>{a("e2e")}},e(se,null),e("span",null,"Back")),e("section",{className:"e2e_help-content"},e("p",null,"With E2E Test, you can test the whole application by sending a sequence of HTTP requests."),e("p",null,"In the image below, you can see the first view of the E2E test modal page, which contains a button bar at the top and two separate requests."),e("img",{src:"https://github.com/MiaadTeam/lesan/assets/6236123/829b3288-3d69-4fd0-a1fc-22d011b8d079",alt:"full screen e2e",className:"e2e_help--fullscreen-img"}),e("hr",null),e("p",null,"In the button bar, you have these buttons:",e("img",{src:"https://github.com/MiaadTeam/lesan/assets/6236123/4edd6034-d6b2-4de9-8c43-8f2fe511aa14",alt:"full screen e2e",className:"e2e_help--fullscreen-img"}),e("ul",null,e("li",null,"Add: This button adds one request section."),e("li",null,"Run E2E Test: This button runs all requests and shows their results."),e("li",null,"Import: This button stands for importing an E2E config in JSON format."),e("li",null,"Export: This button stands for exporting an existing E2E config in JSON format."),e("li",null,"Help: This button switches to the help of the E2E modal page."))),e("hr",null),e("div",null,e("p",null,"Each request section have 2 side"),e("img",{src:"https://github.com/MiaadTeam/lesan/assets/6236123/fa9ceb35-21dd-493a-82cc-cd7391f5fc79",alt:"full screen e2e",className:"e2e_help--fullscreen-img"}),e("hr",null),e("section",{className:"e2e_help--section---right-side"},e("p",null,"The right side is a set of configurations for the repeat time of each request and capturing variables of the request response. In the Capture Variables section, you can add a pair of tuple inputs for the key name of the capture variable and its value. You can capture the value of a capture variable with braces syntax. For example, if you get back this response from a request:",e("pre",null,`{ + `,repeat:1,captures:[]}),ot={e2eForms:[ue()],setE2eForms:()=>({}),addE2eForm:()=>({})},it={modal:null,setModal:()=>({})},fe={...tt,...st,...at,...nt,...ot,...it};function qe(a,s){let{type:t,payload:n}=s;switch(t){case"SET_SELECTED_SERVICE":{let i=[...a.tabsData];return i[n.index]={...i[n.index],service:n.data},{...a,tabsData:[...i]}}case"SET_SCHEMA":{let i=[...a.tabsData];return i[n.index]={...i[n.index],schema:n.data},{...a,tabsData:[...i]}}case"SET_ACT":{let i=[...a.tabsData];return i[n.index]={...i[n.index],act:n.data},{...a,tabsData:[...i]}}case"SET_POST_FIELDS":{let i=[...a.tabsData];return i[n.index]={...i[n.index],postFields:n.data},{...a,tabsData:[...i]}}case"RESET_POST_FIELDS":{let i=[...a.tabsData];return i[n]={...i[n],postFields:{}},{...a,tabsData:[...i]}}case"SET_GET_FIELDS":{let i=[...a.tabsData];return i[n.index]={...i[n.index],getFields:n.data},{...a,tabsData:[...i]}}case"RESET_GET_FIELDS":{let i=[...a.tabsData];return i[n]={...i[n],getFields:{}},{...a,tabsData:[...i]}}case"SET_FORM_DATA":{let i=[...a.tabsData];return i[n.index]={...i[n.index],formData:n.data},{...a,tabsData:[...i]}}case"SET_HEADER":return{...a,headers:n};case"ADD_HISTORY":return{...a,history:n};case"SET_TABS_DATA":return{...a,tabsData:n};case"SET_RESPONSE":{let i=[...a.tabsData];return i[n.index]={...i[n.index],response:n.data},{...a,tabsData:[...i]}}case"ADD_TAB":return{...a,tabsData:[...a.tabsData,{service:"",schema:"",act:"",postFields:{},getFields:{},formData:{},response:null}],activeTab:a.tabsData.length};case"SET_ACTIVE_TAB":return{...a,activeTab:n};case"CLOSE_TAB":{let i=[...a.tabsData];return i.length>1&&i.splice(n,1),{...a,tabsData:[...i],activeTab:i.length>=1&&a.activeTab>=n&&a.activeTab!==0?a.activeTab-1:a.activeTab}}case"DELETE_ITEM_HISTORY":return{...a,history:a.history.slice(0,n).concat(a.history.slice(n+1))};case"SET_ACTS_OBJ":return{...a,actsObj:n};case"SET_SCHEMAS_OBJ":return{...a,schemasObj:n};case"SET_E2E_FORMS":return{...a,e2eForms:n};case"ADD_E2E_FORM":return{...a,e2eForms:[...a.e2eForms,n]};case"OPEN_MODAL":return{...a,modal:n};default:throw new Error("Unhandled action type")}}var ve=Me(fe),Ae=a=>{let[s,t]=Le(qe,fe),n=I(p=>t({type:"SET_SELECTED_SERVICE",payload:p}),[t]),i=I(p=>t({type:"SET_SCHEMA",payload:p}),[t]),m=I(p=>t({type:"SET_ACT",payload:p}),[t]),c=I(p=>t({type:"SET_POST_FIELDS",payload:p}),[t]),d=I(p=>t({type:"RESET_POST_FIELDS",payload:p}),[t]),r=I(p=>t({type:"SET_GET_FIELDS",payload:p}),[t]),C=I(p=>t({type:"RESET_GET_FIELDS",payload:p}),[t]),x=I(p=>t({type:"SET_FORM_DATA",payload:p}),[t]),T=I(p=>t({type:"SET_ACTIVE_TAB",payload:p}),[t]),w=I(p=>t({type:"ADD_TAB",payload:p}),[t]),F=I(p=>t({type:"CLOSE_TAB",payload:p}),[t]),$=I(p=>t({type:"DELETE_ITEM_HISTORY",payload:p}),[t]),z=I(p=>t({type:"SET_HEADER",payload:p}),[t]),Z=I(p=>t({type:"ADD_HISTORY",payload:p}),[t]),Y=I(p=>t({type:"SET_TABS_DATA",payload:p}),[t]),W=I(p=>t({type:"SET_RESPONSE",payload:p}),[t]),V=I(p=>t({type:"SET_SCHEMAS_OBJ",payload:p}),[t]),l=I(p=>t({type:"SET_ACTS_OBJ",payload:p}),[t]),f=I(p=>t({type:"SET_E2E_FORMS",payload:p}),[t]),y=I(p=>t({type:"ADD_E2E_FORM",payload:p}),[t]),N=I(p=>t({type:"OPEN_MODAL",payload:p}),[t]),M=Fe(()=>({...s,setService:n,setSchema:i,setAct:m,setPostFields:c,resetPostFields:d,setGetFields:r,resetGetFields:C,setFormData:x,setHeader:z,setHistory:Z,setTabsData:Y,setResponse:W,setActsObj:l,setSchemasObj:V,setActiveTab:T,addTab:w,closeTab:F,deleteItemHistory:$,setE2eForms:f,addE2eForm:y,setModal:N}),[s]);return e(ve.Provider,{value:M,...a})};var j=()=>{let a=Oe(ve);return a},He=a=>{let{children:s}=a;return e(Ae,null,s)};var ce=a=>{let s={get:{},set:{}};for(let t in a)if(a[t]||a[t]===0){let n=t.split("."),i=s;for(;n.length>1;){let m=n.shift();i[m]=i[m]||{},i=i[m]}i[n[0]]=a[t]}return s};var le=(a,s,t)=>{for(let n in a)typeof a[n]=="object"?le(a[n],s,t?`${t}.${n}`:n):s[`${t}.${n}`]=a[n];return s};function te(){return e("svg",{width:"30px",height:"35px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M16.6725 16.6412L21 21M19 11C19 15.4183 15.4183 19 11 19C6.58172 19 3 15.4183 3 11C3 6.58172 6.58172 3 11 3C15.4183 3 19 6.58172 19 11Z",stroke:"#000000","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))}function G(){return e("svg",{width:"25px",height:"25px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.2501 7.06066L8.03039 10.2803L6.96973 9.21967L12.0001 4.18934L17.0304 9.21967L15.9697 10.2803L12.7501 7.06066L12.7501 16.5L11.2501 16.5L11.2501 7.06066Z",fill:"lightcoral"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12ZM3.00683 12C3.00683 16.9668 7.03321 20.9932 12 20.9932C16.9668 20.9932 20.9932 16.9668 20.9932 12C20.9932 7.03321 16.9668 3.00683 12 3.00683C7.03321 3.00683 3.00683 7.03321 3.00683 12Z",fill:"bisque"}))}function he(){let{actsObj:a}=j(),s=()=>{let m=`data:text/json;chatset=utf-8,${encodeURIComponent(JSON.stringify(a))}`,c=document.createElement("a");c.href=m,c.download="acts.json",c.click()},t=["color-1","color-2","color-3","color-4","color-5","color-6","color-7"],n=m=>Object.keys(m).map((c,d)=>{let r=h();return e("div",{className:"schema"},e("div",{className:"schema-name",onClick:()=>{document.getElementById(r)?.classList.toggle("open")}},e("p",{className:"schema-title"},c),e("span",null,"...")),e("div",{className:"proceed-child-container",id:r},i(a[c])))}),i=m=>Object.keys(m).map((c,d)=>{let r=h();if(m[c]||m[c]===0)return e("div",{className:`inside-schema ${t[Math.floor(Math.random()*t.length)]}`},e("div",{className:`inside ${typeof m[c]=="object"&&m[c].schema!==null&&"schema-pointer"}`,onClick:()=>{document.getElementById(r)?.classList.toggle("open")}},e("p",{className:"schema-title"},c),m[c].type&&e("p",{className:"schema-title schema-type"},m[c].type),e("div",null," ",typeof m[c]=="object"&&m[c].schema!==null&&e("span",null,"..."))),e("div",{id:r,className:"proceed-child"},typeof m[c]=="object"&&m[c]!==null&&m[c].schema!==null&&i(m[c].validator?m[c].validator.schema:m[c].schema?m[c].schema:m[c])))});return e("div",{className:"schema-modal"}," ",e("div",{className:"results-buttons"},e("button",{className:" schema-export-button btn e2e-back-button e2e-export_results-button",onClick:s},e(G,null),e("span",null,"Export"))),e("div",{className:"search-box"},e("input",{className:"input",type:"text",placeholder:"search..."}),e("span",{className:"search-icon"},e(te,null))),e("div",{className:"schema-list"},n(a)))}function se(){return e("svg",{width:"25px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M9.00002 15.3802H13.92C15.62 15.3802 17 14.0002 17 12.3002C17 10.6002 15.62 9.22021 13.92 9.22021H7.15002",stroke:"lightcoral","stroke-width":"1.5","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M8.57 10.7701L7 9.19012L8.57 7.62012",stroke:"lightcoral","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12ZM3.00683 12C3.00683 16.9668 7.03321 20.9932 12 20.9932C16.9668 20.9932 20.9932 16.9668 20.9932 12C20.9932 7.03321 16.9668 3.00683 12 3.00683C7.03321 3.00683 3.00683 7.03321 3.00683 12Z",fill:"bisque"}))}var je=({setView:a})=>e("div",{className:"help"}," ",e("button",{className:"btn e2e-back-button",onClick:()=>{a("e2e")}},e(se,null),e("span",null,"Back")),e("section",{className:"e2e_help-content"},e("p",null,"With E2E Test, you can test the whole application by sending a sequence of HTTP requests."),e("p",null,"In the image below, you can see the first view of the E2E test modal page, which contains a button bar at the top and two separate requests."),e("img",{src:"https://github.com/MiaadTeam/lesan/assets/6236123/829b3288-3d69-4fd0-a1fc-22d011b8d079",alt:"full screen e2e",className:"e2e_help--fullscreen-img"}),e("hr",null),e("p",null,"In the button bar, you have these buttons:",e("img",{src:"https://github.com/MiaadTeam/lesan/assets/6236123/4edd6034-d6b2-4de9-8c43-8f2fe511aa14",alt:"full screen e2e",className:"e2e_help--fullscreen-img"}),e("ul",null,e("li",null,"Add: This button adds one request section."),e("li",null,"Run E2E Test: This button runs all requests and shows their results."),e("li",null,"Import: This button stands for importing an E2E config in JSON format."),e("li",null,"Export: This button stands for exporting an existing E2E config in JSON format."),e("li",null,"Help: This button switches to the help of the E2E modal page."))),e("hr",null),e("div",null,e("p",null,"Each request section have 2 side"),e("img",{src:"https://github.com/MiaadTeam/lesan/assets/6236123/fa9ceb35-21dd-493a-82cc-cd7391f5fc79",alt:"full screen e2e",className:"e2e_help--fullscreen-img"}),e("hr",null),e("section",{className:"e2e_help--section---right-side"},e("p",null,"The right side is a set of configurations for the repeat time of each request and capturing variables of the request response. In the Capture Variables section, you can add a pair of tuple inputs for the key name of the capture variable and its value. You can capture the value of a capture variable with braces syntax. For example, if you get back this response from a request:",e("pre",null,`{ `,` body: [ `,` { `,` _id: 64c6839c50adc3cb65726934, @@ -29,5 +29,5 @@ import{createContext as Me,Fragment as h,h as e,hydrate as De}from"https://esm.s `,` success: true `,` } `,`} -`),"You can capture _id with [body][0][_id] or for name: [body][0][name]."),e("img",{src:"https://github.com/MiaadTeam/lesan/assets/6236123/1cea1db3-44c2-49b5-8739-a9afa8a6e1fa",alt:"full screen e2e",className:"e2e_help--fullscreen-img"})),e("hr",null),e("section",{className:"e2e_help--section---right-side"},e("img",{src:"https://github.com/MiaadTeam/lesan/assets/6236123/5c9899fa-8be6-42d1-8f4f-8fd965264645",alt:"full screen e2e",className:"e2e_help--fullscreen-img"}),e("p",null,"The left side is a text area for writing headers and the body of the request in JSON format. In this text area, you can use a text parser to implement the captured value you captured before inside these symbols ","{}",".")),e("hr",null),e("p",null,"Also, we have some buttons on the top right side of each request section. With these buttons, you can move up and down and delete requests.",e("img",{src:"https://github.com/MiaadTeam/lesan/assets/6236123/900a5b98-3e7f-460a-a756-403ecaedcf86",alt:"full screen e2e",className:"e2e_help--fullscreen-img"}))),e("hr",null),e("div",null,e("p",null,"After clicking on the Run E2E Test button, you can see the result of each test. Also, in the result view, you can export the results in JSON format."),e("img",{src:"https://github.com/MiaadTeam/lesan/assets/6236123/8c367965-a1b7-40b8-8638-60d2d0ea2609",alt:"full screen e2e",className:"e2e_help--fullscreen-img"})),e("hr",null),e("div",null,e("p",null,"Additionally, you can go to the E2E Test modal page from the main page by clicking on the Test icon inside the response header section. This way, you can add a new test section and prepopulate the Header and Body text areas with the sent request from the main page.",e("img",{src:"https://github.com/MiaadTeam/lesan/assets/6236123/74dc9e93-2b41-4840-afc1-f4e8e83c9889",alt:"full screen e2e",className:"e2e_help--fullscreen-img"})))));function ae(){return e("svg",{width:"25px",height:"25px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M11 8C11 7.44772 11.4477 7 12 7C12.5523 7 13 7.44772 13 8V11H16C16.5523 11 17 11.4477 17 12C17 12.5523 16.5523 13 16 13H13V16C13 16.5523 12.5523 17 12 17C11.4477 17 11 16.5523 11 16V13H8C7.44771 13 7 12.5523 7 12C7 11.4477 7.44772 11 8 11H11V8Z",fill:"lightcoral"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12ZM3.00683 12C3.00683 16.9668 7.03321 20.9932 12 20.9932C16.9668 20.9932 20.9932 16.9668 20.9932 12C20.9932 7.03321 16.9668 3.00683 12 3.00683C7.03321 3.00683 3.00683 7.03321 3.00683 12Z",fill:"bisque"}))}var lt=()=>e("svg",{width:"25px",viewBox:"-0.5 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M12 22.4199C17.5228 22.4199 22 17.9428 22 12.4199C22 6.89707 17.5228 2.41992 12 2.41992C6.47715 2.41992 2 6.89707 2 12.4199C2 17.9428 6.47715 22.4199 12 22.4199Z",stroke:"bisque","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{id:"Vector",d:"M16 16L12 12M12 12L8 8M12 12L16 8M12 12L8 16",stroke:"lightcoral","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),U=lt;function ve(){return e("svg",{width:"25px",viewBox:"-0.5 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M12 22.4199C17.5228 22.4199 22 17.9428 22 12.4199C22 6.89707 17.5228 2.41992 12 2.41992C6.47715 2.41992 2 6.89707 2 12.4199C2 17.9428 6.47715 22.4199 12 22.4199Z",stroke:"bisque","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M16 10.99L13.13 14.05C12.9858 14.2058 12.811 14.3298 12.6166 14.4148C12.4221 14.4998 12.2122 14.5437 12 14.5437C11.7878 14.5437 11.5779 14.4998 11.3834 14.4148C11.189 14.3298 11.0142 14.2058 10.87 14.05L8 10.99",stroke:"lightcoral","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))}function oe(){return e("svg",{width:"25px",height:"25px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M12 17V16.9929M12 14.8571C12 11.6429 15 12.3571 15 9.85714C15 8.27919 13.6568 7 12 7C10.6567 7 9.51961 7.84083 9.13733 9",stroke:"lightcoral","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12ZM3.00683 12C3.00683 16.9668 7.03321 20.9932 12 20.9932C16.9668 20.9932 20.9932 16.9668 20.9932 12C20.9932 7.03321 16.9668 3.00683 12 3.00683C7.03321 3.00683 3.00683 7.03321 3.00683 12Z",fill:"bisque"}))}function ge(){return e("svg",{width:"25px",height:"25px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.75 13.9393L15.9697 10.7197L17.0303 11.7803L12 16.8107L6.96967 11.7803L8.03033 10.7197L11.25 13.9393L11.25 4.5L12.75 4.5L12.75 13.9393Z",fill:"lightcoral"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12ZM3.00683 12C3.00683 16.9668 7.03321 20.9932 12 20.9932C16.9668 20.9932 20.9932 16.9668 20.9932 12C20.9932 7.03321 16.9668 3.00683 12 3.00683C7.03321 3.00683 3.00683 7.03321 3.00683 12Z",fill:"bisque"}))}function ye(){return e("svg",{width:"25px",height:"25px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M13.8876 9.9348C14.9625 10.8117 15.5 11.2501 15.5 12C15.5 12.7499 14.9625 13.1883 13.8876 14.0652C13.5909 14.3073 13.2966 14.5352 13.0261 14.7251C12.7888 14.8917 12.5201 15.064 12.2419 15.2332C11.1695 15.8853 10.6333 16.2114 10.1524 15.8504C9.6715 15.4894 9.62779 14.7336 9.54038 13.2222C9.51566 12.7947 9.5 12.3757 9.5 12C9.5 11.6243 9.51566 11.2053 9.54038 10.7778C9.62779 9.26636 9.6715 8.51061 10.1524 8.1496C10.6333 7.78859 11.1695 8.11466 12.2419 8.76679C12.5201 8.93597 12.7888 9.10831 13.0261 9.27492C13.2966 9.46483 13.5909 9.69274 13.8876 9.9348Z",stroke:"lightcoral","stroke-width":"2"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12ZM3.00683 12C3.00683 16.9668 7.03321 20.9932 12 20.9932C16.9668 20.9932 20.9932 16.9668 20.9932 12C20.9932 7.03321 16.9668 3.00683 12 3.00683C7.03321 3.00683 3.00683 7.03321 3.00683 12Z",fill:"bisque"}))}function Ce(){return e("svg",{width:"25px",viewBox:"-0.5 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M12 22.4199C17.5228 22.4199 22 17.9428 22 12.4199C22 6.89707 17.5228 2.41992 12 2.41992C6.47715 2.41992 2 6.89707 2 12.4199C2 17.9428 6.47715 22.4199 12 22.4199Z",stroke:"bisque","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M8 13.8599L10.87 10.8C11.0125 10.6416 11.1868 10.5149 11.3815 10.4282C11.5761 10.3415 11.7869 10.2966 12 10.2966C12.2131 10.2966 12.4239 10.3415 12.6185 10.4282C12.8132 10.5149 12.9875 10.6416 13.13 10.8L16 13.8599",stroke:"lightcoral","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))}var Ve={fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial',display:"inline-block",borderRadius:3,padding:"10px 10px",color:"#f8f8f2",textShadow:"1px 1px black",whiteSpace:"pre-wrap"};var dt=/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,pt=a=>JSON.stringify(a,mt,2).replace(/&/g,"&").replace(//g,">").replace(dt,t=>{let o="cute-number",r=t;return/^"/.test(t)?/:$/.test(t)?(o="cute-key",r=r.replace(":",':')):t==='"undefined"'?o="cute-undefined":t==='"[Function]"'?o="cute-function":o="cute-string":/true|false/.test(t)?o="cute-boolean":/null/.test(t)&&(o="cute-null"),`${r}`}),mt=(a,s)=>typeof s=="function"?"[Function]":typeof s>"u"?"undefined":s,Be=a=>pt(a).replace(/"/g,"");var H=({jsonData:a})=>{let s=Be(a);return e(h,null,e("pre",{style:Ve,dangerouslySetInnerHTML:{__html:s}}))};function ne(){return e("svg",{fill:"#fff",height:"20px",width:"20px",version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 452.025 452.025"},e("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"}),e("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"}),e("g",{id:"SVGRepo_iconCarrier"}," ",e("g",null," ",e("g",null," ",e("path",{d:"M362.612,34.125h-55.2l13.6-13.6c4.7-4.7,4.7-12.3,0-17s-12.3-4.7-17,0l-34,34.1c-2.3,2.3-3.5,5.3-3.5,8.5 s1.3,6.2,3.5,8.5l34.1,34.1c2.3,2.3,5.4,3.5,8.5,3.5s6.1-1.2,8.5-3.5c4.7-4.7,4.7-12.3,0-17l-13.6-13.6h55.2c35.9,0,65,29.2,65,65 v40.3c0,6.6,5.4,12,12,12s12-5.4,12-12v-40.3C451.712,74.025,411.712,34.125,362.612,34.125z"})," ",e("path",{d:"M438.812,230.925h-197.1c-6.6,0-12,5.4-12,12v197.1c0,6.6,5.4,12,12,12h197.1c6.6,0,12-5.4,12-12v-197.1 C450.812,236.225,445.412,230.925,438.812,230.925z M426.812,428.025h-173.1v-173.1h173.1L426.812,428.025L426.812,428.025z"})," ",e("path",{d:"M147.912,363.325c-4.7-4.7-12.3-4.7-17,0c-4.7,4.7-4.7,12.3,0,17l13.6,13.6h-55.2c-35.9,0-65-29.2-65-65v-40.3 c0-6.6-5.4-12-12-12s-12,5.4-12,12v40.3c0,49.1,39.9,89,89,89h55.2l-13.6,13.6c-4.7,4.7-4.7,12.3,0,17c2.3,2.3,5.4,3.5,8.5,3.5 s6.1-1.2,8.5-3.5l34.1-34.1c4.7-4.7,4.7-12.3,0-17L147.912,363.325z"})," ",e("path",{d:"M13.212,24.025c3.2,0,6.3-1.3,8.5-3.5s3.5-5.3,3.5-8.5c0-3.1-1.3-6.3-3.5-8.5s-5.3-3.5-8.5-3.5s-6.3,1.3-8.5,3.5 s-3.5,5.3-3.5,8.5s1.3,6.3,3.5,8.5C7.012,22.725,10.012,24.025,13.212,24.025z"})," ",e("path",{d:"M111.812,24.025c6.6,0,12-5.4,12-12s-5.4-12-12-12s-12,5.4-12,12S105.112,24.025,111.812,24.025z"})," ",e("path",{d:"M62.512,24.025c6.6,0,12-5.4,12-12s-5.4-12-12-12s-12,5.4-12,12S55.912,24.025,62.512,24.025z"})," ",e("path",{d:"M161.012,24.025c6.6,0,12-5.4,12-12s-5.4-12-12-12s-12,5.4-12,12S154.412,24.025,161.012,24.025z"})," ",e("path",{d:"M210.312,0.025c-3.1,0-6.3,1.3-8.5,3.5s-3.5,5.3-3.5,8.5s1.3,6.3,3.5,8.5s5.3,3.5,8.5,3.5s6.3-1.3,8.5-3.5 s3.5-5.3,3.5-8.5s-1.3-6.3-3.5-8.5S213.512,0.025,210.312,0.025z"})," ",e("path",{d:"M210.312,147.925c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12C222.312,153.225,217.012,147.925,210.312,147.925z"})," ",e("path",{d:"M210.312,98.625c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12C222.312,103.925,217.012,98.625,210.312,98.625z"})," ",e("path",{d:"M210.312,49.325c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12C222.312,54.725,217.012,49.325,210.312,49.325z"})," ",e("path",{d:"M210.312,197.125c-3.2,0-6.3,1.3-8.5,3.5s-3.5,5.3-3.5,8.5c0,3.1,1.3,6.3,3.5,8.5s5.3,3.5,8.5,3.5s6.3-1.3,8.5-3.5 s3.5-5.3,3.5-8.5s-1.3-6.3-3.5-8.5C216.613,198.425,213.512,197.125,210.312,197.125z"})," ",e("path",{d:"M161.012,221.125c6.6,0,12-5.4,12-12s-5.4-12-12-12s-12,5.4-12,12C149.012,215.825,154.412,221.125,161.012,221.125z"})," ",e("path",{d:"M111.812,221.125c6.6,0,12-5.4,12-12s-5.4-12-12-12s-12,5.4-12,12C99.812,215.825,105.112,221.125,111.812,221.125z"})," ",e("path",{d:"M62.512,221.125c6.6,0,12-5.4,12-12s-5.4-12-12-12s-12,5.4-12,12C50.512,215.825,55.912,221.125,62.512,221.125z"})," ",e("path",{d:"M13.212,221.125c3.2,0,6.3-1.3,8.5-3.5s3.5-5.3,3.5-8.5s-1.3-6.3-3.5-8.5s-5.3-3.5-8.5-3.5s-6.3,1.3-8.5,3.5 s-3.5,5.3-3.5,8.5c0,3.1,1.3,6.3,3.5,8.5C7.012,219.825,10.012,221.125,13.212,221.125z"})," ",e("path",{d:"M13.212,171.925c6.6,0,12-5.4,12-12s-5.4-12-12-12s-12,5.4-12,12S6.612,171.925,13.212,171.925z"})," ",e("path",{d:"M13.212,122.625c6.6,0,12-5.4,12-12s-5.4-12-12-12s-12,5.4-12,12C1.212,117.225,6.612,122.625,13.212,122.625z"})," ",e("path",{d:"M13.212,73.325c6.6,0,12-5.4,12-12s-5.4-12-12-12s-12,5.4-12,12S6.612,73.325,13.212,73.325z"})," ")," ")," "))}var $e=({results:a,setIsShowE2eResponse:s})=>{let[t,o]=S(0);return e("div",{style:{display:"flex",minWidth:"100%",position:"relative"},id:a[t].id},e("section",{className:"container-re"},e("div",{className:"container-re--header"},e("span",{className:"container-re--header--icon",onClick:()=>s(!0)},e(ne,null)),e("span",{className:"container-re-title"},"REQUEST")),e(H,{jsonData:a[t].request}),e("div",{className:"pagination",style:{position:"absolute",bottom:"0px",right:"-87.5px",zIndex:"1",backgroundColor:"#2c2e2c",padding:"9px 5px 5px 5px",display:"flex",gap:"5px",width:"175px",justifyContent:"flex-start",overflowY:"scroll",overflowWrap:"anywhere",whiteSpace:"nowrap",border:"1px solid bisque",borderBottom:"none",borderRadius:"7px 7px 0 0",color:"gainsboro",flexWrap:"wrap",height:"42px"}},a.map((r,m)=>e("span",{className:"pagination--item",style:{cursor:"pointer"},onClick:()=>o(m),"data-show":t===m},m+1)))),e("section",{className:"container-re container-response"},e("div",{className:"container-re--header"},e("span",{className:"container-re-title"},"RESPONSE"),e("span",{className:"e2e-re-timeNumber-request"},a[t].responseTime,"ms")),e(H,{jsonData:a[t].response})))};function Pe({sequence:a}){let[s,t]=S(!0);return e("div",{key:a.id,className:"container-detail"},s?e(h,null,e("section",{className:"sequence-re"},e("div",{className:"container-re--header"},e("span",{className:"container-re--header--icon",onClick:()=>t(!1)},e(ne,null)),e("span",{className:"container-re-title"},"Body Header")),e(H,{jsonData:JSON.parse(a.bodyHeader)})),e("section",{className:"sequence-re sequence-response "},e("div",{className:"container-re--header"},e("span",{className:"container-re-title"},"Description")),e("div",{className:"detail-sequence"},e("p",null,"you send ",e("span",null,a.repeat)," times of this request"),e("p",null,"The best request performance is"," ",e("span",null,a.bestTime.time," ms")," in"," ",e("span",null,a.bestTime.resultIdx)," index"),e("p",null,"The worst request performance is"," ",e("span",null,a.worstTime.time," ms")," in"," ",e("span",null,a.worstTime.resultIdx)," index"),e("p",null,"the avrage time for each request is"," ",e("span",null,a.time/a.repeat," ms")),e("p",null,"and whole time is ",e("span",null,a.time," ms")),e("p",null,"this sequence sends ",e("span",null,a.success)," ",e("b",null,"success")," request and ",e("span",null,a.fails)," it be"," ",e("b",null,"fails")),e("span",null,"You capture these Items in this sequnece:"," ",a.captures.map(o=>e("ul",null,e("li",null,"key: ",o.key),e("li",null,"captured from: ",o.captured),e("li",null,"with value of: ",o.value),e("li",null,"inside model : ",o.model),e("li",null,"and act : ",o.act),e("li",null,"this item captured inside sequnce index:"," ",o.sequenceIdx)))),e("span",null,"You are using these capture items in this sequence:"," ",a.usedCaptures.map(o=>e("ul",null,e("li",null,"key: ",o.key),e("li",null,"captured from: ",o.captured),e("li",null,"with value of: ",o.value),e("li",null,"inside model : ",o.model),e("li",null,"and act : ",o.act),e("li",null,"this item captured inside sequnce index:"," ",o.sequenceIdx))))))):e($e,{results:a.results,setIsShowE2eResponse:t}))}function Ze({baseUrl:a}){let{e2eForms:s,setE2eForms:t}=j(),o={allReqPerformance:0,numberRequest:0,success:0,fails:0,bestTime:{sequenceIdx:0,resultIdx:0,time:Number.MAX_SAFE_INTEGER,act:"",model:""},worstTime:{sequenceIdx:0,resultIdx:0,act:"",model:"",time:0},sequenceDetail:[],allCaptureItems:[]},[r,m]=S(!1),[l,d]=S(o),i=(c,b)=>{if(!(c===0&&b<=0)){let y=s[c];s.splice(c,1),s.splice(b,0,y),t([...s])}},C=c=>{s[c],s.splice(c,1),t([...s])},[w,T]=S("e2e"),N=()=>{let c=`data:text/json;chatset=utf-8,${encodeURIComponent(JSON.stringify(s))}`,b=document.createElement("a");b.href=c,b.download="Configdata.json",b.click()},F=c=>{let b=new FileReader;b.readAsText(c.target.files[0],"UTF-8"),b.onload=y=>{let E=JSON.parse(y.target.result);t(E)}},$=()=>{let c=`data:text/json;chatset=utf-8,${encodeURIComponent(JSON.stringify(l))}`,b=document.createElement("a");b.href=c,b.download="data.json",b.click()},z=async({baseUrl:c,options:b})=>await(await fetch(`${c}lesan`,b)).json(),Z=(c,b,y)=>{for(let E in c){typeof c[E]=="object"&&Z(c[E],b,y);let M=c[E];if(typeof M=="string"&&M.includes("{")){let p=[];for(let D=0;DM.slice(D+1,O[P])).forEach(D=>{for(let P of b)P.key===D&&(y.push({key:c[E],value:c[E].replace(`{${D}}`,P.value)}),c[E]=c[E].replace(`{${D}}`,P.value))})}}return y},Y=async()=>{let c=new Set;for await(let b of s){let y=JSON.parse(b.bodyHeaders),E=Z(y,c,[]),M=(R,A)=>{for(let x of A)if(x.value===R)return x},p={method:"POST",headers:{"Content-Type":"application/json",...y.headers},body:JSON.stringify(y.body)},O,K=q();for(let R=0;R{let g=u.sequenceDetail,f=g.findIndex(v=>v.id===K),_=1;return f!==-1?(g[f].results.push(n),_=g[f].results.length,g[f].bestTime=g[f].bestTime.timex?g[f].worstTime:{resultIdx:_,time:x},O.success?g[f].success=g[f].success+1:g[f].fails=g[f].fails+1,g[f].time=g[f].time+x,g[f].repeat=g[f].repeat+1):g.push({id:K,bodyHeader:b.bodyHeaders,time:x,repeat:1,success:O.success?1:0,fails:O.success?0:1,bestTime:{resultIdx:_,time:x},worstTime:{resultIdx:_,time:x},captures:b.captures.map(({key:v,value:L})=>({key:v,value:L,sequenceIdx:g.length,model:y.body.model,act:y.body.act})),usedCaptures:E.map(({key:v,value:L})=>{let X=M(L,c);return{key:v,value:L,captured:X?.captured,sequenceIdx:X?.sequenceIdx,model:X?.model,act:X?.act}}),results:[n]}),{allReqPerformance:u.allReqPerformance+x,numberRequest:u.numberRequest+1,success:O.success?u.success+1:u.success,fails:O.success?u.fails:u.fails+1,bestTime:u.bestTime.timex?u.worstTime:{resultIdx:_,sequenceIdx:g.length,act:y.body.act,model:y.body.model,time:x},sequenceDetail:g,allCaptureItems:Array.from(c)}})}[...b.captures].filter(R=>R.key&&R.value).map(R=>{let A=R.value.split("["),x=[];return A.forEach(k=>{let n=k.slice(0,k.indexOf("]"));isNaN(Number(n))||(n=Number(n)),x.push(n)}),x.shift(),{key:R.key,parsedValue:x,value:R.value}}).forEach(R=>{if(R.parsedValue.length>0){let A=O;R.parsedValue.forEach(x=>{A=A[x]}),c.add({key:R.key,value:A,captured:R.value,act:y.body.act,model:y.body.model,sequenceIdx:l.sequenceDetail.length-1})}})}},W=c=>{let b=[...s];b[c].repeat+=1,t([...b])},V=c=>{let b=[...s];b[c].repeat>0&&(b[c].repeat-=1),t([...b])};return e("div",null,w==="result"?e("div",{style:{display:"flex",flexDirection:"column",gap:"7px",marginTop:"27px"}},e("div",{className:"results"},e("div",{className:"results-buttons"},e("button",{className:"btn e2e-back-button",onClick:()=>{d(o),T("e2e")}},e(se,null),e("span",null,"Back")),e("button",{className:"btn e2e-back-button e2e-export_results-button",onClick:$},e(G,null),e("span",null,"Export")))),e("div",{style:{padding:"30px",backgroundColor:"darkslategray",borderRadius:"10px",display:"flex",justifyContent:"space-between",flexWrap:"wrap",color:"gainsboro",border:"1px solid bisque"}},e("div",{style:{display:"flex",flexDirection:"column",padding:"5px"}},e("span",null,"All Request Count: ",l.numberRequest)," ","times",e("span",null," ","All Request Time: ",l.allReqPerformance," ms")),e("div",{style:{display:"flex",flexDirection:"column",padding:"5px"}},e("span",null,"All Success Request: ",l.success)," times",e("span",null,"All Fails Request : ",l.fails)," times"),e("div",{style:{display:"flex",flexDirection:"column",padding:"5px"}},e("span",null,"Best Request Time: ",l.bestTime.time," ms in"," ",e("b",null,"seqeunce")," index of ",l.bestTime.sequenceIdx," ","and ",e("b",null,"request")," index of ",l.bestTime.resultIdx," ","inside ",l.bestTime.model," ",e("b",null,"model")," and"," ",l.bestTime.act," ",e("b",null,"act")),e("span",null,"Worst Request Time: ",l.worstTime.time," ms in"," ",e("b",null,"seqeunce")," index of ",l.worstTime.sequenceIdx," ","and ",e("b",null,"request")," index of"," ",l.worstTime.resultIdx," inside"," ",l.worstTime.model," ",e("b",null,"model")," and"," ",l.worstTime.act," ",e("b",null,"act")),e("span",null,"All capture Items is:"," ",l.allCaptureItems.map(c=>e("ul",null,e("li",null,"key: ",c.key),e("li",null,"captured from: ",c.captured),e("li",null,"with value of: ",c.value),e("li",null,"inside model : ",c.model),e("li",null,"and act : ",c.act),e("li",null,"this item captured inside sequnce index:"," ",c.sequenceIdx)))))),e("div",null,l.sequenceDetail.map(c=>e("div",null,e(Pe,{sequence:c}))))):w==="e2e"?e(h,null,e("div",{className:"sidebar__section sidebar__section--headers"},s.map((c,b)=>e(h,null,e("div",{className:"sidebar__input-double",key:c.id},s.length>1&&e("div",{className:"e2e-move-buttons"},e("div",{className:"e2e-move-div",onClick:()=>i(b,b-1)},e(Ce,null)),e("div",{className:"e2e-move-div",onClick:()=>i(b,b+1)},e(ve,null)),e("div",{className:"e2e-move-div e2e-move-close",onClick:()=>C(b)},e(U,null))),e("div",{className:"sidebar__section-body-heading"},e("div",{className:"sidebar__section-heading"},"set test body and headers"),e("textarea",{placeholder:"please paste a request body here",value:c.bodyHeaders,name:`${c.id}-body`,rows:18,onChange:y=>{let E=[...s];E[b].bodyHeaders=y.target.value,t([...E])}})),e("div",{className:"sidebar__section-capture"},e("div",{className:"e2e_sidebar__section-heading"},"set repeat time"),e("div",{className:"repeat__number"},e("input",{className:"input",placeholder:"set repeat number",value:c.repeat,name:`${c.id}-repeat`,type:"number",onChange:y=>{let E=[...s];E[b].repeat=y.target.value,t([...E])}}),e("button",{className:"e2e-back-button e2e-export_results-button",onClick:()=>W(b)},"+"),e("button",{className:"e2e-back-button e2e-export_results-button",onClick:()=>V(b)},"-")),e("div",{className:"e2e_sidebar__section-heading"},"capture variables"),e("button",{className:"btn btn--add e2e-back-button e2e-export_results-button e2e-add-capture ",onClick:()=>{let y=[...s];y[b].captures.push({key:"",value:""}),t([...y])}},"add capture"),c.captures.map((y,E)=>e(h,null,e("div",{className:"sidebar__section-add-capture"},e("input",{className:"input",placeholder:"set a variable name",value:y.key,onChange:M=>{let p=[...s];p[b].captures[E].key=M.target.value,t([...p])}}),e("input",{className:"input",placeholder:"set a value for variable",value:y.value,onChange:M=>{let p=[...s];p[b].captures[E].value=M.target.value,t([...p])}})),e("hr",null)))))))),e("button",{className:"btn btn-show-results-buttons ",onClick:()=>m(!r)},"show btn"),e("div",{className:"results-buttons","data-show":r===!0},e("button",{className:"btn btn-e2e-action e2e-back-button e2e-export_results-button",onClick:()=>{t([...s,ue()])}},e(ae,null),e("span",null,"Add")),e("button",{className:"btn btn-e2e-action e2e-back-button e2e-run-botton e2e-export_results-button",onClick:async()=>{T("result"),await Y()}},e(ye,null),e("span",null,"Run E2E Test")),e("input",{id:"actual-btn",type:"file",onChange:F,hidden:!0}),e("label",{htmlFor:"actual-btn",className:"btn btn-e2e-action e2e-back-button e2e-export_results-button"},e(ge,null),e("span",null,"Import")),e("button",{className:"btn btn-e2e-action e2e-back-button e2e-export_results-button",onClick:N},e(G,null),e("span",null,"Export")),e("button",{onClick:()=>T("help"),className:"btn btn-e2e-action e2e-back-button e2e-export_results-button"},e(oe,null),e("span",null,"Help")))):w==="help"?e(je,{setView:T}):"")}function de(a){let s=Math.floor(a/36e5),t=Math.floor(a%36e5/6e4),o=Math.floor(a%36e4%6e4/1e3);return s>0?`${s}h ${t}m ${o}s`:t>0?`${t}m ${o}s`:o>0?`${o}s`:`${a}ms`}var Je=(a,s)=>{let t=J(!0);B(()=>{let o=()=>{};if(t.current?t.current=!1:o=a(),o&&typeof o=="function")return o},s)};function Te(){return e("svg",{id:"Layer_1","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 105.7 122.88",width:20},e("path",{fill:"white",d:"M30.46,14.57V5.22A5.18,5.18,0,0,1,32,1.55v0A5.19,5.19,0,0,1,35.68,0H70a5.22,5.22,0,0,1,3.67,1.53l0,0a5.22,5.22,0,0,1,1.53,3.67v9.35h27.08a3.36,3.36,0,0,1,3.38,3.37V29.58A3.38,3.38,0,0,1,102.32,33H98.51l-8.3,87.22a3,3,0,0,1-2.95,2.69H18.43a3,3,0,0,1-3-2.95L7.19,33H3.37A3.38,3.38,0,0,1,0,29.58V17.94a3.36,3.36,0,0,1,3.37-3.37Zm36.27,0V8.51H39v6.06ZM49.48,49.25a3.4,3.4,0,0,1,6.8,0v51.81a3.4,3.4,0,1,1-6.8,0V49.25ZM69.59,49a3.4,3.4,0,1,1,6.78.42L73,101.27a3.4,3.4,0,0,1-6.78-.43L69.59,49Zm-40.26.42A3.39,3.39,0,1,1,36.1,49l3.41,51.8a3.39,3.39,0,1,1-6.77.43L29.33,49.46ZM92.51,33.38H13.19l7.94,83.55H84.56l8-83.55Z"}))}function Ge({setFormFromHistory:a}){let{history:s,setHistory:t,deleteItemHistory:o}=j(),[r,m]=S("");return Je(()=>{localStorage.setItem("localHistory",JSON.stringify(s))},[s]),e(h,null,s&&s?.length>0?e("div",null,e("br",null),s.map((l,d)=>e("div",{className:"container-detail",id:l.id},e("section",{className:"container-re"},e("div",{style:{position:"relative",borderBottom:"1px solid gainsboro"}},e("span",{className:"container-re-title"},"REQUEST"),e("span",{className:"history-re-detail-date"},l.reqDate)),e("div",{className:"container-re-detail"},e("div",{className:"container-re-detail-title"}," ",e(H,{jsonData:l.request.body.model}),e("span",null,"|"),e("div",null,e(H,{jsonData:l.request.body.act}))),r===l.id?e("button",{onClick:()=>m(""),className:"history-re-detail-button"},"Hide",e("span",{className:"history-re-detail-button-icon"},"\u2013")):e("button",{onClick:()=>{m(l.id),document.getElementById(l.id)?.scrollIntoView()},className:"history-re-detail-button"},"Show"," ",e("span",{className:"history-re-detail-button-icon"},"+"))),e("div",{className:"history-re-detail-complete","data-show":r===l.id}," ",e(H,{jsonData:l.request}))),e("section",{className:"container-re container-response"},e("div",{className:"history-re-title_delete",style:{position:"relative",borderBottom:"1px solid gainsboro"}},e("span",{className:"history-re-delete",onClick:i=>{i.stopPropagation(),o(d)}},e(U,null)),e("span",{className:"container-re-title history-response-title"},"RESPONSE"),e("span",{className:"history-re-detail-date history-response-took"},de(l.response.tookTime))),e("div",{className:"container-re-detail"},e("div",{className:"history-re-detail-title"},e("div",{className:"history-re-response-title"}," ",e("span",{className:"history-re-response-title-status"},"success:"),e("div",{className:"history-re-response-info"},e(H,{jsonData:l.response.success})))),e("button",{onClick:()=>a(l.request),className:"history-re-detail-button"},"Use"," ",e("span",{className:"history-re-detail-button-icon"},"\u279C"," "))),e("div",{className:"history-re-detail-complete","data-show":r===l.id}," ",e(H,{jsonData:l.response})))))):e("span",{className:"no-history"},'"There is no history to display"'),s&&s.length>0?e("div",{className:"clear-history"},e("button",{className:"btn clear-history-button tooltip",onClick:()=>{confirm("Clear All History?")==!0&&t([])}},e(Te,null),e("span",{className:"tooltip-text"},"Clear History"))):"")}function Se(){return e("svg",{width:"25px",viewBox:"0 0 26 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"}),e("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"}),e("g",{id:"SVGRepo_iconCarrier"}," ",e("path",{d:"M4 6V19C4 20.6569 5.34315 22 7 22H17C18.6569 22 20 20.6569 20 19V9C20 7.34315 18.6569 6 17 6H4ZM4 6V5",stroke:"lightcoral","stroke-width":"1.5"})," ",e("path",{d:"M18 6.00002V6.75002H18.75V6.00002H18ZM15.7172 2.32614L15.6111 1.58368L15.7172 2.32614ZM4.91959 3.86865L4.81353 3.12619H4.81353L4.91959 3.86865ZM5.07107 6.75002H18V5.25002H5.07107V6.75002ZM18.75 6.00002V4.30604H17.25V6.00002H18.75ZM15.6111 1.58368L4.81353 3.12619L5.02566 4.61111L15.8232 3.0686L15.6111 1.58368ZM4.81353 3.12619C3.91638 3.25435 3.25 4.0227 3.25 4.92895H4.75C4.75 4.76917 4.86749 4.63371 5.02566 4.61111L4.81353 3.12619ZM18.75 4.30604C18.75 2.63253 17.2678 1.34701 15.6111 1.58368L15.8232 3.0686C16.5763 2.96103 17.25 3.54535 17.25 4.30604H18.75ZM5.07107 5.25002C4.89375 5.25002 4.75 5.10627 4.75 4.92895H3.25C3.25 5.9347 4.06532 6.75002 5.07107 6.75002V5.25002Z",fill:"lightcoral"})," ",e("path",{opacity:"0.5",d:"M8 12H16",stroke:"lightcoral","stroke-width":"1.5","stroke-linecap":"round"})," ",e("path",{opacity:"0.5",d:"M8 15.5H13.5",stroke:"lightcoral","stroke-width":"1.5","stroke-linecap":"round"})," "))}function Ee(){return e("svg",{width:"25px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{"fill-rule":"evenodd",opacity:"0.5","clip-rule":"evenodd",d:"M5.07868 5.06891C8.87402 1.27893 15.0437 1.31923 18.8622 5.13778C22.6824 8.95797 22.7211 15.1313 18.9262 18.9262C15.1312 22.7211 8.95793 22.6824 5.13774 18.8622C2.87389 16.5984 1.93904 13.5099 2.34047 10.5812C2.39672 10.1708 2.775 9.88377 3.18537 9.94002C3.59575 9.99627 3.88282 10.3745 3.82658 10.7849C3.4866 13.2652 4.27782 15.881 6.1984 17.8016C9.44288 21.0461 14.6664 21.0646 17.8655 17.8655C21.0646 14.6664 21.046 9.44292 17.8015 6.19844C14.5587 2.95561 9.33889 2.93539 6.13935 6.12957L6.88705 6.13333C7.30126 6.13541 7.63535 6.47288 7.63327 6.88709C7.63119 7.3013 7.29372 7.63539 6.87951 7.63331L4.33396 7.62052C3.92269 7.61845 3.58981 7.28556 3.58774 6.8743L3.57495 4.32874C3.57286 3.91454 3.90696 3.57707 4.32117 3.57498C4.73538 3.5729 5.07285 3.907 5.07493 4.32121L5.07868 5.06891Z",fill:"lightcoral"}),e("path",{d:"M12 7.25C12.4142 7.25 12.75 7.58579 12.75 8V11.6893L15.0303 13.9697C15.3232 14.2626 15.3232 14.7374 15.0303 15.0303C14.7374 15.3232 14.2626 15.3232 13.9697 15.0303L11.5429 12.6036C11.3554 12.416 11.25 12.1617 11.25 11.8964V8C11.25 7.58579 11.5858 7.25 12 7.25Z",fill:"lightcoral"}))}function xe(){return e("svg",{height:"25px",width:"25px",version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"#000000"},e("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"}),e("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"}),e("g",{id:"SVGRepo_iconCarrier"}," ",e("circle",{opacity:.34,style:"fill:lightcoral;",cx:"256.602",cy:"226.267",r:"171.059"})," ",e("path",{style:"fill:lightcoral",d:"M482.195,226.196C482.195,101.471,380.725,0,256.001,0S29.804,101.471,29.804,226.196 c0,7.409,6.007,13.416,13.416,13.416s13.416-6.008,13.416-13.416c0-109.93,89.434-199.363,199.363-199.363 s199.363,89.434,199.363,199.363c0,109.928-89.434,199.362-199.363,199.362h-23.276l33.282-37.255 c4.937-5.525,4.458-14.007-1.067-18.944c-5.525-4.937-14.008-4.457-18.944,1.068l-47.576,53.255c-7.788,8.718-7.788,21.866,0,30.584 l47.576,53.255c2.651,2.968,6.322,4.478,10.01,4.478c3.181,0,6.375-1.126,8.934-3.41c5.526-4.937,6.004-13.419,1.067-18.944 l-33.282-37.255h23.276C380.725,452.39,482.195,350.919,482.195,226.196z"})," "))}function _e(){return e("svg",{fill:"lightcoral",height:"25px",width:"25px",viewBox:"0 0 436.668 436.668"},e("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"}),e("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"}),e("g",{id:"SVGRepo_iconCarrier"}," ",e("g",null," ",e("path",{opacity:.34,d:"M203.334,85.818v59.141c4.884-0.8,9.893-1.223,15-1.223s10.116,0.423,15,1.223V85.818c14.657-5.935,25-20.296,25-37.081 c0-22.092-17.909-40-40-40s-40,17.908-40,40C178.334,65.522,188.677,79.883,203.334,85.818z"})," ",e("path",{opacity:.34,d:"M70.642,204.021l56.242,18.274c1.539-10.139,4.732-19.74,9.292-28.525L79.912,175.49 c-1.115-15.774-11.577-30.049-27.541-35.236c-21.01-6.827-43.576,4.672-50.403,25.682c-6.827,21.01,4.672,43.576,25.682,50.403 C43.614,221.525,60.468,216.126,70.642,204.021z"})," ",e("path",{opacity:.34,d:"M152.577,301.224l-34.792,47.887c-15.346-3.813-32.156,1.725-42.022,15.305c-12.985,17.872-9.023,42.887,8.849,55.872 s42.887,9.023,55.872-8.849c9.866-13.579,9.939-31.277,1.571-44.694l34.772-47.86C167.8,314.333,159.616,308.347,152.577,301.224z"})," ",e("path",{opacity:.34,d:"M318.883,349.112l-34.792-47.887c-7.039,7.122-15.223,13.109-24.25,17.661l34.772,47.86 c-8.369,13.417-8.296,31.115,1.571,44.694c12.985,17.872,38,21.834,55.872,8.849s21.834-38,8.849-55.872 C351.038,350.837,334.229,345.298,318.883,349.112z"})," ",e("path",{opacity:.34,d:"M434.699,165.936c-6.827-21.01-29.393-32.508-50.403-25.682c-15.964,5.187-26.426,19.462-27.541,35.236l-56.263,18.281 c4.559,8.784,7.752,18.386,9.292,28.525l56.242-18.274c10.174,12.105,27.028,17.504,42.992,12.318 C430.028,209.512,441.526,186.946,434.699,165.936z"})," ",e("path",{d:"M280.834,236.237c0-34.462-28.037-62.5-62.5-62.5s-62.5,28.038-62.5,62.5s28.037,62.5,62.5,62.5 S280.834,270.7,280.834,236.237z"})," ")," "))}function we(){return e("svg",{width:"25px",height:25,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M3 9.10986V14.8799C3 16.9999 3 16.9999 5 18.3499L10.5 21.5299C11.33 22.0099 12.68 22.0099 13.5 21.5299L19 18.3499C21 16.9999 21 16.9999 21 14.8899V9.10986C21 6.99986 21 6.99986 19 5.64986L13.5 2.46986C12.68 1.98986 11.33 1.98986 10.5 2.46986L5 5.64986C3 6.99986 3 6.99986 3 9.10986Z",stroke:"lightcoral","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",opacity:.34}),e("path",{d:"M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z",stroke:"lightcoral","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))}function Ne(){return e("svg",{width:"25px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{opacity:.5,d:"M9.74872 2.49415L18.1594 7.31987M9.74872 2.49415L2.65093 14.7455C1.31093 17.0584 2.10615 20.0159 4.42709 21.3513C6.74803 22.6867 9.7158 21.8942 11.0558 19.5813L12.5511 17.0003L14.1886 14.1738L15.902 11.2163L18.1594 7.31987M9.74872 2.49415L8.91283 2M18.1594 7.31987L19 7.80374",stroke:"lightcoral","stroke-width":"1.5","stroke-linecap":"round"}),e("path",{d:"M15.9021 11.2164L13.3441 9.74463M14.1887 14.1739L9.98577 11.7557M12.5512 17.0004L9.93848 15.4972",stroke:"lightcpral","stroke-width":"1.5","stroke-linecap":"round"}),e("path",{d:"M22 14.9166C22 16.0672 21.1046 16.9999 20 16.9999C18.8954 16.9999 18 16.0672 18 14.9166C18 14.1967 18.783 13.2358 19.3691 12.6174C19.7161 12.2512 20.2839 12.2512 20.6309 12.6174C21.217 13.2358 22 14.1967 22 14.9166Z",stroke:"lightcoral","stroke-width":"1.5"}))}function pe(){return e("svg",{width:"28px",fill:"white",viewBox:"0 0 32 32",style:"fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;",version:"1.1"},e("path",{d:"M9.101,7l8.899,0c1.857,-0 3.637,0.737 4.95,2.05c1.313,1.313 2.05,3.093 2.05,4.95l0,8.899c0.953,-0.195 1.837,-0.665 2.536,-1.363c0.937,-0.938 1.464,-2.21 1.464,-3.536c0,-2.977 0,-7.023 0,-10c0,-1.326 -0.527,-2.598 -1.464,-3.536c-0.938,-0.937 -2.21,-1.464 -3.536,-1.464c-2.977,0 -7.023,0 -10,0c-1.326,-0 -2.598,0.527 -3.536,1.464c-0.698,0.699 -1.168,1.583 -1.363,2.536Z"}),e("path",{d:"M23,14c0,-1.326 -0.527,-2.598 -1.464,-3.536c-0.938,-0.937 -2.21,-1.464 -3.536,-1.464c-2.977,0 -7.023,0 -10,0c-1.326,-0 -2.598,0.527 -3.536,1.464c-0.937,0.938 -1.464,2.21 -1.464,3.536c0,2.977 0,7.023 0,10c-0,1.326 0.527,2.598 1.464,3.536c0.938,0.937 2.21,1.464 3.536,1.464c2.977,-0 7.023,-0 10,-0c1.326,0 2.598,-0.527 3.536,-1.464c0.937,-0.938 1.464,-2.21 1.464,-3.536l0,-10Zm-15,10l10,0c0.552,0 1,-0.448 1,-1c0,-0.552 -0.448,-1 -1,-1l-10,0c-0.552,0 -1,0.448 -1,1c0,0.552 0.448,1 1,1Zm0,-4l10,0c0.552,0 1,-0.448 1,-1c0,-0.552 -0.448,-1 -1,-1l-10,0c-0.552,0 -1,0.448 -1,1c0,0.552 0.448,1 1,1Zm0,-4l10,0c0.552,0 1,-0.448 1,-1c0,-0.552 -0.448,-1 -1,-1l-10,0c-0.552,0 -1,0.448 -1,1c0,0.552 0.448,1 1,1Z"}),e("g",{id:"Icon"}))}function ke(){return e("svg",{width:25,height:25,fill:"#ffffff",version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 104.778 104.778"},e("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"}),e("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"}),e("g",{id:"SVGRepo_iconCarrier"}," ",e("g",null," ",e("path",{d:"M96.832,88.406l-23.02-39.908V21.959c4.385-1.595,7.447-5.797,7.447-10.618C81.26,5.089,76.176,0,69.928,0H42.6 c-6.251,0-11.334,5.089-11.334,11.341c0,4.815,3.07,9.017,7.457,10.618v26.55l-2.083,3.685V30.359c0-1.546-1.257-2.802-2.803-2.802 H8.723c-1.546,0-2.801,1.256-2.801,2.802v59.557c0,7.475,5.742,13.614,13.174,14.648c0.331,0.126,0.683,0.214,1.059,0.214h67.227 c4.79,0,8.433-1.762,10.282-4.979C99.503,96.598,99.208,92.543,96.832,88.406z M11.513,89.916v-6.079h8.254 c1.546,0,2.802-1.26,2.802-2.802c0-1.549-1.256-2.802-2.802-2.802h-8.254v-9.09h8.254c1.546,0,2.802-1.263,2.802-2.801 c0-1.555-1.256-2.802-2.802-2.802h-8.254v-9.097h8.254c1.546,0,2.802-1.256,2.802-2.801c0-1.55-1.256-2.803-2.802-2.803h-8.254 V33.149h19.512v56.767c0,5.095-4.375,9.248-9.756,9.248C15.883,99.17,11.513,95.011,11.513,89.916z M92.794,96.997 c-0.799,1.379-2.779,2.178-5.432,2.178H33.189c2.118-2.55,3.439-5.734,3.439-9.259V63.19c0.245-0.207,0.476-0.443,0.645-0.743 l6.679-11.82c0.236-0.422,0.364-0.898,0.364-1.379V19.776c0-1.415-1.048-2.603-2.449-2.78c-2.859-0.364-5.015-2.796-5.015-5.655 c0-3.161,2.571-5.738,5.731-5.738H69.91c3.165,0,5.734,2.577,5.734,5.738c0,2.859-2.155,5.286-5.017,5.655 c-1.401,0.178-2.446,1.365-2.446,2.78v29.472c0,0.493,0.122,0.977,0.374,1.401l23.396,40.559 C93.292,93.506,93.593,95.617,92.794,96.997z M76.466,79.53c0,5.412-4.377,9.794-9.801,9.794c-5.411,0-9.795-4.382-9.795-9.794 c0-5.406,4.384-9.795,9.795-9.795C72.089,69.735,76.466,74.124,76.466,79.53z M54.609,68.877c0,2.665-2.146,4.799-4.802,4.799 c-2.657,0-4.802-2.156-4.802-4.799c0-2.644,2.15-4.8,4.802-4.8C52.468,64.077,54.609,66.233,54.609,68.877z M58.195,58.048 c-1.672,0-3.015-1.341-3.015-3.01c0-1.667,1.343-3.009,3.015-3.009c1.663,0,3.015,1.343,3.015,3.009 C61.21,56.707,59.853,58.048,58.195,58.048z M49.534,86.315c0,1.669-1.352,3.009-3.016,3.009c-1.665,0-3.014-1.34-3.014-3.009 c0-1.663,1.349-3.016,3.014-3.016C48.182,83.3,49.534,84.652,49.534,86.315z M54.805,46.184c-2.185,0-3.956-1.771-3.956-3.957 c0-2.186,1.771-3.957,3.956-3.957c2.183,0,3.957,1.771,3.957,3.957C58.762,44.414,56.983,46.184,54.805,46.184z"})," ")," "))}function Re(){return e("svg",{version:"1.1",viewBox:"0 0 29.756 29.756",style:"enable-background:new 0 0 29.756 29.756;"},e("path",{d:"M29.049,5.009L28.19,4.151c-0.943-0.945-2.488-0.945-3.434,0L10.172,18.737l-5.175-5.173 c-0.943-0.944-2.489-0.944-3.432,0.001l-0.858,0.857c-0.943,0.944-0.943,2.489,0,3.433l7.744,7.752 c0.944,0.943,2.489,0.943,3.433,0L29.049,8.442C29.991,7.498,29.991,5.953,29.049,5.009z"}))}function Q(a){let s=J(null);return B(()=>{let t=o=>{s.current&&!s.current.contains(o?.target)&&a()};return document.addEventListener("click",t),()=>{document.removeEventListener("click",t)}},[s]),s}function re({className:a=""}){return e("svg",{width:25,height:25,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:a},e("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"}),e("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"}),e("g",{id:"SVGRepo_iconCarrier"}," ",e("path",{d:"M6 9L12 15L18 9M12 9H12.01",stroke:"lightcoral","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})," "))}function ie({items:a,onClickItem:s,incomeActiveItem:t,canShow:o}){let[r,m]=S(!1),[l,d]=S("");B(()=>{d(t||"")},[t]);let C=Q(()=>{m(!1)});return e("div",null,e("div",{className:"select",disabled:o},e("div",{className:`select--empty ${r===!0?"active-select--empty":""}`,ref:C,onClick:()=>m(!r)},e("div",{className:"select--empty--left-side"}," ",e("span",{className:`${l?"select-empty--left-side--clear":"select-empty--left-side--clear--inactive"}`,onClick:w=>{d(""),s(""),m(!1),w.stopPropagation()}},"x"),e("span",null,l)),e(re,null)),r&&e("div",{className:"select--sub-buttons","data-show":r},a?.map((w,T)=>e("div",{className:`option ${w===l?"active-option":""}`,onClick:()=>{d(w),s(w),m(!1)}},w)))))}var ut=({options:a,onChange:s})=>{let[t,o]=S([]),[r,m]=S(a),[l,d]=S(!1),i=N=>{if(t.includes(N)){let F=t.filter($=>$.value!==N.value);o(F),m([...r,N]),s(F)}else{let F=r.filter($=>$.value!==N.value);o([...t,N]),m(F),s([...t,N])}},C=()=>{o([]),s([]),m(a)},w=()=>{d(!l)},T=Q(()=>{d(!1)});return e("div",{ref:T,className:"multi-select__wrapper"},e("div",{className:"multi-select__field",onClick:w},e("div",{className:"multi-select__selected-item-wrapper"},t.map(N=>e("div",{className:"multi-select__selected-item",key:N},e("div",{className:"multi-select__selected-item-text"},N.label),e("div",{className:"multi-select__selected-item-btn",role:"button",onClick:F=>{F.stopPropagation(),i(N)}},"x")))),e("div",{className:"multi-select__icons-wrapper"},t.length?e("div",{className:"multi-select__close-icon-wrapper",role:"button",onClick:N=>{N.stopPropagation(),C()}},e("span",{className:"multi-select__close-icon"},"x")):null,e("div",{className:"multi-select__arrow-icon-wrapper",role:"button"},e(re,{className:"multi-select__arrow-icon"})))),l?e("div",{className:"multi-select__options"},r.length?r.map(N=>e("div",{key:N.value,onClick:F=>{F.stopPropagation(),i(N)},className:"multi-select__option"},e("div",{className:"multi-select__option-label"},N.label))):e("div",{className:"multi-select__option--no-option"},"No Options!")):null)},Ue=ut;var bt=({baseUrl:a,options:s})=>fetch(`${a}lesan`,s).then(t=>t.json()),ze=({urlAddress:a})=>{let{activeTab:s,tabsData:t,actsObj:o,headers:r,history:m,setService:l,setSchema:d,setAct:i,setPostFields:C,setGetFields:w,setFormData:T,setHistory:N,setResponse:F,resetGetFields:$,resetPostFields:z,addE2eForm:Z,setModal:Y}=j(),[W,V]=S(!1),c=(n,u,g,f)=>{for(let _ in g)g[_].type==="enums"?f[`${u}.${_}`]=n:c(n,`${u}.${_}`,g[_].schema,f);return f},b=J(null),y=n=>{let{name:u,value:g,type:f,alt:_}=n.target,v;f==="number"?v=Number(g):_==="array"||_==="boolean"?v=JSON.parse(g):v=g,T({data:{...t[s].formData,[u]:v},index:s})},E=({key:n,field:u,isMultiEnum:g=!1,formData:f})=>u.type==="array"?E({key:n,formData:f,field:u.schema,isMultiEnum:!0}):u.type==="enums"&&g?e(Ue,{options:Object.keys(u.schema).map(_=>({label:_,value:u.schema[_]})),onChange:_=>{let v=_.map(L=>L.value);T({data:{...f,[`set.${n}`]:v},index:s}),localStorage.setItem("localTabsData",JSON.stringify(t))}}):u.type==="enums"?e(ie,{onClickItem:_=>{T({data:{...f,[`set.${n}`]:_},index:s}),localStorage.setItem("localTabsData",JSON.stringify(t))},incomeActiveItem:f[`set.${n}`],items:Object.keys(u.schema)}):e("input",{className:"input",placeholder:n,id:n,value:f[`set.${n}`],name:`set.${n}`,type:u.type==="number"?"number":"string",alt:u.type,onChange:y}),M=({getField:n,keyName:u,margin:g})=>e("div",{style:{marginLeft:`${g+1}px`},className:"sidebar__section_container",key:`${s}.${u}`},e("div",{className:"sidebar__section-heading--subfields"},u),Object.keys(n.schema).map((f,_)=>n.schema[f].type==="enums"?e("div",{className:"input-cnt get-items",key:`${s}.${f}-${_}`},e("label",{htmlFor:f},u,".",f,":"),e("div",{className:"get-values"},e("span",{onClick:()=>{let v={...t[s].formData};delete v[`get.${u}.${f}`],T({data:v,index:s})}}),e("span",{className:t[s].formData[`get.${u}.${f}`]===0?"active":"",onClick:()=>{T({index:s,data:{...t[s].formData,[`get.${u}.${f}`]:0}})}},"0"),e("span",{className:t[s].formData[`get.${u}.${f}`]===1?"active":"",onClick:()=>{T({data:{...t[s].formData,[`get.${u}.${f}`]:1},index:s})}},"1"))):M({getField:n.schema[f],keyName:`${u}.${f}`,margin:g+1}))),p=()=>{let n=le(t[s].formData);return{body:{method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify({service:t[s].service,model:t[s].schema,act:t[s].act,details:n})}}},O=async n=>{n.preventDefault();let u=new Date().toLocaleDateString();V(!0),setTimeout(()=>{V(!1)},450);let g=performance.now(),f=await bt({baseUrl:a,options:p().body}),v=(performance.now()-g).toFixed(1);F({data:{...f,tookTime:v},index:s});let L=[{request:{...p().body,body:JSON.parse(p().body.body)},response:{...f,tookTime:v},id:q(),reqDate:u},...m];N(L),localStorage.setItem("localHistory",JSON.stringify(L)),localStorage.setItem("localTabsData",JSON.stringify(t))},K=t[s].service&&t[s].schema&&t[s].postFields&&t[s].getFields&&t[s].act,D=t[s].service,P=t[s].service&&t[s].schema,R=()=>{let n=JSON.stringify(t[s].response);navigator.clipboard.writeText(n)},A=()=>{let n=p();n.body.body=JSON.parse(n.body.body),navigator.clipboard.writeText(JSON.stringify(n))},x=()=>{let n=p();n.body.body=JSON.parse(n.body.body);let{method:u,...g}=n.body,f={id:q(),bodyHeaders:JSON.stringify({...g},null,2),repeat:1,captures:[]};Z(f),Y("E2E TEST")},k=(n,u)=>{if(u==="service"&&(l({data:n,index:s}),d({data:"",index:s})),u==="method"&&d({data:"",index:s}),u==="schema"&&d({data:n,index:s}),i({data:"",index:s}),$(s),z(s),u==="action"){let g=o[t[s].service][t[s].schema][n].validator.schema;b&&b.current&&b.current.reset(),i({data:n,index:s}),w({data:g.get.schema,index:s}),C({data:g.set.schema,index:s})}T({data:{},index:s}),localStorage.setItem("localTabsData",JSON.stringify(t))};return e(h,null,e("div",{className:"sidebar"},e("div",{className:"sidebar__sections-wrapper"},e("div",{className:"sidebar__section sidebar__section--services"},e("div",{className:"sidebar__section-heading"},"select services"),e(ie,{onClickItem:n=>k(n,"service"),items:Object.keys(o),incomeActiveItem:t[s].service?t[s].service:null})),e("div",{className:"sidebar__section sidebar__section--schema"},e("div",{onClick:()=>{},className:"sidebar__section-heading"},"select schema"),e(ie,{canShow:!D,onClickItem:n=>k(n,"schema"),items:D?Object.keys(o[t[s].service]):[],incomeActiveItem:t[s].schema?t[s].schema:null})),e("div",{className:"sidebar__section sidebar__section--act"},e("div",{className:"sidebar__section-heading"},"select action"),e(ie,{canShow:!P,onClickItem:n=>k(n,"action"),items:P?Object.keys(o[t[s].service][t[s].schema]):[],incomeActiveItem:t[s].act?t[s].act:null})))),K&&e("div",{className:"sidebar sidebar--fields"},e("form",{ref:b,onSubmit:O,className:"form--fields"},e("div",{className:"sidebar__section-heading sidebar__section-heading--fields"},"SET fields"),Object.keys(t[s].postFields).map(n=>e("div",{className:"input-cnt",key:`${s}.${n}-----`},e("label",{htmlFor:n},n," :"),E({key:n,field:t[s].postFields[n],formData:t[s].formData}))),e("div",{className:"sidebar__section-heading sidebar__section-heading--fields"},"GET fields"),e("div",{className:"input-cnt get-items border-bottom"},e("label",null,"All Items :"),e("div",{className:"get-values"},e("span",{onClick:()=>{let n=c(null,"get",t[s].getFields,{});T({data:{...t[s].formData,...n},index:s})}}),e("span",{onClick:()=>{let n=c(0,"get",t[s].getFields,{});T({data:{...t[s].formData,...n},index:s})}},"0"),e("span",{onClick:()=>{let n=c(1,"get",t[s].getFields,{});T({data:{...t[s].formData,...n},index:s})}},"1"))),Object.keys(t[s].getFields).map(n=>t[s].getFields[n].type==="enums"?e("div",{className:"input-cnt get-items",key:`${s}.${n}-------`},e("label",{htmlFor:n},n,":"),e("div",{className:"get-values"},e("span",{onClick:()=>{T({data:{...t[s].formData,[`get.${n}`]:null},index:s})}}),e("span",{className:t[s].formData[`get.${n}`]===0?"active":"",onClick:()=>{T({data:{...t[s].formData,[`get.${n}`]:0},index:s})}},"0"),e("span",{className:t[s].formData[`get.${n}`]===1?"active":"",onClick:()=>{T({data:{...t[s].formData,[`get.${n}`]:1},index:s})}},"1"))):M({getField:t[s].getFields[n],keyName:n,margin:0})),e("div",{class:"wrapper"},e("button",{class:"send-button","data-active":W},e("span",null,"Send"),e("div",{class:"successe"},e(Re,null)))))),e("div",{className:"response"},t[s].response&&e("div",{class:"response-detail"},e("div",{className:"response-detail-button_title"},e("p",{className:"response-detail-title"},"Response"),e("div",{className:"response-detail-buttons"},e("div",{className:"btn response-detail-button ",onClick:()=>A()},e(pe,null),e("span",{className:"tooltip-text"},"Copy Request")),e("div",{className:"btn response-detail-button ",onClick:()=>{R()}},e(pe,null),e("span",{className:"tooltip-text"},"Copy Response")),e("div",{className:"btn response-detail-button ",onClick:()=>{x()}},e(ke,null),e("span",{className:"tooltip-text"},"Run E2E Test")))),e("div",{className:"response-detail-info"},e("div",{style:{display:"flex",flexDirection:"column"}}," ",e(H,{jsonData:{body:t[s].response?.body,success:t[s].response?.success}})),e("span",{className:"response-took"},"took:",de(t[s].response?.tookTime)),t[s].response&&t[s].response?.success===!0?e("div",{className:"success"}):e("div",{className:"fail"})))))};var vt=()=>e("svg",{width:"15px",height:"15px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M20.04 10.1109L18.0252 8.09612L21.7071 4.41421C22.0976 4.02369 22.0976 3.39052 21.7071 3L21 2.29289C20.6095 1.90237 19.9763 1.90237 19.5858 2.29289L15.9039 5.9748L14.04 4.11089C13.754 3.82489 13.3239 3.73933 12.9502 3.89411C12.5765 4.04889 12.3329 4.41353 12.3329 4.81799V10.818C12.3329 11.3703 12.7806 11.818 13.3329 11.818H19.3329C19.7373 11.818 20.102 11.5744 20.2568 11.2007C20.4115 10.827 20.326 10.3969 20.04 10.1109Z",fill:"bisque"}),e("path",{d:"M3.96 13.8891L5.97478 15.9039L2.29289 19.5858C1.90237 19.9763 1.90237 20.6095 2.29289 21L3 21.7071C3.39052 22.0976 4.02369 22.0976 4.41421 21.7071L8.0961 18.0252L9.96 19.8891C10.246 20.1751 10.6761 20.2607 11.0498 20.1059C11.4235 19.9511 11.6671 19.5865 11.6671 19.182V13.182C11.6671 12.6297 11.2194 12.182 10.6671 12.182H4.66711C4.26265 12.182 3.89801 12.4256 3.74323 12.7993C3.58845 13.173 3.674 13.6031 3.96 13.8891Z",fill:"bisque"})),Ye=vt;var gt=()=>e("svg",{width:"15px",height:"15px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M7.69233 18.2781L9.70711 20.2929C9.9931 20.5789 10.0787 21.009 9.92388 21.3827C9.7691 21.7564 9.40446 22 9 22H3C2.44772 22 2 21.5523 2 21V15C2 14.5955 2.24364 14.2309 2.61732 14.0761C2.99099 13.9213 3.42111 14.0069 3.70711 14.2929L5.571 16.1568L9.25289 12.4749C9.64342 12.0844 10.2766 12.0844 10.6671 12.4749L11.3742 13.182C11.7647 13.5725 11.7647 14.2057 11.3742 14.5962L7.69233 18.2781Z",fill:"bisque"}),e("path",{d:"M16.3077 5.72187L14.2929 3.70711C14.0069 3.42111 13.9213 2.99099 14.0761 2.61732C14.2309 2.24364 14.5955 2 15 2H21C21.5523 2 22 2.44772 22 3V9C22 9.40446 21.7564 9.7691 21.3827 9.92388C21.009 10.0787 20.5789 9.9931 20.2929 9.70711L18.429 7.84319L14.7471 11.5251C14.3566 11.9156 13.7234 11.9156 13.3329 11.5251L12.6258 10.818C12.2352 10.4275 12.2352 9.7943 12.6258 9.40378L16.3077 5.72187Z",fill:"bisque"})),We=gt;function Ie(){return e("svg",{width:25,height:25,fill:"#000000",viewBox:"0 0 24 24",id:"up-direction","data-name":"Line Color",xmlns:"http://www.w3.org/2000/svg",class:"icon line-color"},e("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"}),e("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"}),e("g",{id:"SVGRepo_iconCarrier"},e("path",{id:"secondary",d:"M10,9.66V20a1,1,0,0,0,1,1h2a1,1,0,0,0,1-1V9.66",style:"fill: none; stroke: darkred; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2;"}),e("path",{id:"primary",d:"M14,9.66l3.4,2.92,2.6-3-7.35-6.3a1,1,0,0,0-1.3,0L4,9.54l2.6,3L10,9.66",style:"fill: none; stroke: darkred; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2;"})))}var yt=a=>{let[s,t]=S("myBtn none"),[o,r]=S(!1),m=J(null),l=()=>{m.current.scroll,document.getElementById("test")?.scroll({top:0,behavior:"smooth"})},d=i=>{i.currentTarget.scrollTop>20?t("myBtn"):t("none")};return e("div",{className:"modal-overlay",onClick:a.toggle},e("div",{className:o?"modal-box-fullscreen":"modal-box",onClick:i=>i.stopPropagation()},e("div",{className:"action-modal"},e("span",{className:"modal-close",onClick:a.toggle},e(U,null)),e("span",{className:"modal-fullscreen",onClick:()=>r(!o)},o?e(Ye,null):e(We,null)),e("span",{className:"modal-title"},a.title)),e("div",{className:"modal-content",id:"test",ref:m,onScroll:d},a.children,e("div",{className:s},e("button",{className:"myBtn-active tooltip",onClick:()=>l()},e(Ie,null),e("span",{className:"tooltip-text"},"Go To Top"))))))},Ke=yt;var Xe=()=>{let{schemasObj:a}=j(),[s,t]=S({});B(()=>{let d={};for(let i in a){d[i]={...d[i],pure:a[i].pure};for(let C in a[i].mainRelations)d[i]={...d[i],mainRelations:{...d[i].mainRelations,[C]:{type:"relation",extraDetails:a[i].mainRelations[C],schema:{...a[a[i].mainRelations[C].schemaName].pure}}}};for(let C in a[i].relatedRelations)d[i]={...d[i],relatedRelations:{...d[i].relatedRelations,[C]:{type:"relation",extraDetails:a[i].relatedRelations[C],schema:{...a[a[i].relatedRelations[C].schemaName].pure}}}}}t(d)},[]);let o=()=>{let d=`data:text/json;chatset=utf-8,${encodeURIComponent(JSON.stringify(a))}`,i=document.createElement("a");i.href=d,i.download="schemas.json",i.click()},r=["color-1","color-2","color-3","color-4","color-5","color-6","color-7"],m=d=>Object.keys(d).map(i=>{let C=q();return e("div",{className:"schema"},e("div",{className:"schema-name",onClick:()=>{document.getElementById(C)?.classList.toggle("open")}},e("p",{className:"schema-title"},i),e("span",null,"...")),e("div",{className:"proceed-child-container",id:C},l(d[i])))}),l=d=>Object.keys(d).map(i=>{let C=q();return e("div",{className:`inside-schema ${r[Math.floor(Math.random()*r.length)]}`},e("div",{className:`inside ${typeof d[i]=="object"&&d[i].schema!==null&&"schema-pointer"}`,onClick:()=>{document.getElementById(C)?.classList.toggle("open")}},e("p",{className:"schema-title"},i),e("div",{className:"schema-info"}," ",e("p",{className:"schema-title schema-type"}," ",d[i].type),e("div",{className:"schema-help"},d[i].extraDetails&&e(oe,null),d[i].extraDetails&&e("div",{className:" tooltip-text"},e(H,{jsonData:d[i].extraDetails}))),typeof d[i]=="object"&&d[i].schema!==null&&e("span",null,"..."))),e("div",{id:C,className:"proceed-child"},typeof d[i]=="object"&&d[i]!==null&&d[i].schema!==null&&l(d[i].pure?d[i].pure:d[i].relatedRelations?d[i].relatedRelations:d[i].mainRelation?d[i].mainRelation:d[i].type==="relation"?d[i].schema:d[i])))});return e("div",{className:"schema-modal"},e("div",{className:"results-buttons"},e("button",{className:" schema-export-button btn e2e-back-button e2e-export_results-button",onClick:o},e(G,null),e("span",null,"Export"))),e("div",{className:"search-box"},e("input",{className:"input",type:"text",placeholder:"search..."}),e("span",{className:"search-icon"},e(te,null))),e("div",{className:"schema-list"},m(s)))};function me(){return e("svg",{width:25,height:25,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M7.75 11.9999L10.58 14.8299L16.25 9.16992",stroke:"lightcoral","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})," ",e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12ZM3.00683 12C3.00683 16.9668 7.03321 20.9932 12 20.9932C16.9668 20.9932 20.9932 16.9668 20.9932 12C20.9932 7.03321 16.9668 3.00683 12 3.00683C7.03321 3.00683 3.00683 7.03321 3.00683 12Z",fill:"bisque"}))}function Qe({configUrl:a}){let s=i=>{r[i],r.splice(i,1),m([...r])},{headers:t,setHeader:o}=j(),[r,m]=S([{key:"",value:""}]),[l,d]=S("");return B(()=>{let i=[];for(let C in t)i.push({key:C,value:t[C]});m(i)},[]),e("div",{className:"setting modal-content"},e("div",{className:"url"},e("p",{className:"url-title"},"Fetch Config"),e("div",{className:"url-detail"}," ",e("input",{className:"input url-input ",placeholder:"Set URL",onChange:i=>d(i.target.value)}),e("button",{className:"setting_fetch-config--apply-button e2e-back-button e2e-add-capture ",onClick:()=>a(l)},e(me,null),e("span",null,"Apply")," "))),e("div",{className:"sidebar__section sidebar__section--headers"},e("div",{className:"sidebar__section-heading setting_heading"}," ",e("span",{className:"setting_heading--title"},"Set Headers"),e("button",{className:"setting_add-header--button e2e-back-button e2e-export_results-button e2e-add-capture ",onClick:()=>{m([...r,{key:"",value:""}])}},e(ae,null),e("span",null,"Add Header"))),e("div",{className:"setting_container--setheaders"},e("div",{className:"setting_set-headers"},r?.map((i,C)=>e("div",{key:`${C}____`,className:"setting_set-headers--inputs"},e("div",{className:"setting__set-headers--key-value setting__set-headers--key"},e("span",null,"Key:"),e("input",{className:"setting_set-headers--inputs--key input",placeholder:"Authotization",value:i.key,onChange:w=>{m(T=>(T[C].key=w.target.value,T))}})),e("div",{className:"setting__set-headers--key-value setting__set-headers--value"},e("span",null,"Value:"),e("input",{className:"setting_set-headers--inputs--value input",placeholder:"some string ...",value:i.value,onChange:w=>{m(T=>(T[C].value=w.target.value,T))}})),r.length>1&&e("div",{className:"setting_set-headers--delete-button e2e-move-div e2e-move-close",onClick:()=>s(C)},e(U,null))))),e("button",{className:"setting_set-headers--apply-button e2e-back-button e2e-add-capture ",onClick:()=>{let i={};for(let C of r){let{key:w,value:T}=C;i[w]=T}o(i)}},e(me,null),e("span",null,"Apply")))))}var Ct=({baseUrl:a})=>fetch(`${a}playground/static/get/schemas`).then(s=>s.json()),et=()=>{let{tabsData:a,setTabsData:s,activeTab:t,actsObj:o,addTab:r,setActiveTab:m,setService:l,setSchema:d,setAct:i,setPostFields:C,setGetFields:w,setFormData:T,setHistory:N,setResponse:F,resetGetFields:$,closeTab:z,resetPostFields:Z,setSchemasObj:Y,setActsObj:W,setModal:V,modal:c}=j(),[b,y]=S(""),[E,M]=S(!1),p=()=>window&&window.location?`${new URL(window.location.href).origin}/`:"http://localhost:1366/",[O,K]=S(""),P=Q(()=>{M(!1)});B(()=>{R(p());let k=JSON.parse(localStorage.getItem("localHistory"));k&&N(k)},[]);let R=k=>{k&&K(k),l({data:"",index:t}),d({data:"",index:t}),$(t),Z(t),T({data:{},index:t}),Ct({baseUrl:k||O}).then(({schemas:n,acts:u})=>{W(u),Y(n);let g=localStorage.getItem("localTabsData");if(g){g=JSON.parse(g);let f=[],_=v=>{f.pop();let L=le(v.formData);for(let ee in L.set)u[v.service][v.schema][v.act].validator.schema.set.schema[ee]===void 0&&delete L.set[ee];for(let ee in L.get)u[v.service][v.schema][v.act].validator.schema.get.schema[ee]===void 0&&delete L.get[ee];let X=ce(L,{},"");v.postFields=u[v.service][v.schema][v.act].validator.schema.set.schema,v.getFields=u[v.service][v.schema][v.act].validator.schema.get.schema,f.push({...v,formData:X})};for(let v of g)v.service&&v.service in u&&f.push(v),v.schema&&!(v.schema in u[v.service])&&f.pop(),v.act&&!(v.act in u[v.service][v.schema])&&f.pop(),v.service&&v.schema&&v.act&&v.act in u[v.service][v.schema]&&_(v);f.length<1&&f.push({service:"",schema:"",act:"",postFields:{},getFields:{},formData:{},response:null}),s(f)}})},A=()=>{V(null)},x=k=>{l({data:k.body.service,index:t}),d({data:k.body.model,index:t}),i({data:k.body.act,index:t});let n=o[k.body.service][k.body.model][k.body.act].validator.schema;w({data:n.get.schema,index:t}),C({data:n.set.schema,index:t}),F({data:null,index:t});let u=ce(k.body.details,{},"");T({data:u,index:t}),A()};return e("div",{className:"cnt"},e("div",{className:"tabs-container",style:{display:"flex"}},a.map((k,n)=>e(h,null,e("div",{className:"tab-name","data-tab":t===n,onClick:()=>{m(n)}}," ",e("span",{title:a[n].act?`${a[n].schema} | ${a[n].act}`:a[n].schema?`${a[n].service} | ${a[n].schema}`:a[n].service?a[n].service:`Tab ${n}`}," ",a[n].act?`${a[n].schema} | ${a[n].act}`:a[n].schema?`${a[n].service} | ${a[n].schema}`:a[n].service?a[n].service:`Tab ${n}`),e("span",{className:` tab-close ${t===n?"active-tab-close":""}`,onClick:u=>{u.stopPropagation(),z(n)},title:"Close tab"},"x")))),e("span",{className:"add-tab",title:"Open a new tab",onClick:()=>{r(null),localStorage.setItem("localTabsData",JSON.stringify(a))}},"+")),e(ze,{urlAddress:O}),e("button",{ref:P,className:"media--main-btn-wrapper ",onClick:()=>{M(!E)}},"menu"),e("div",{className:"main-btn-wrapper","data-show":E===!0},e("span",{className:"btn btn-modal ",onClick:()=>R()},e("span",{className:"btn-modal-title"},"Refetch"),e(xe,null)),e("span",{className:"btn btn-modal ",onClick:()=>V("SETTING")},e("span",{className:"btn-modal-title"},"Setting"),e(we,null)),e("span",{className:"btn btn-modal",onClick:()=>V("HISTORY")},e("span",{className:"btn-modal-title"},"History"),e(Ee,null)),e("span",{className:"btn btn-modal",onClick:()=>V("E2E TEST")},e("span",{className:"btn-modal-title"},"E2E Test"),e(Ne,null)),e("span",{className:" btn-modal-document","data-show":b==="document"},e("span",{className:"btn-modal-document--title","data-show":b==="document"},"Document")),e("span",{className:"btn btn-modal btn-doc",onClick:()=>V("SCHEMA"),onMouseEnter:()=>y("document"),onMouseLeave:()=>y("")},e("span",{className:"btn-modal-title"},"Schema"),e(_e,null)),e("span",{className:"btn btn-modal btn-doc ",onClick:()=>V("ACT"),onMouseEnter:()=>y("document"),onMouseLeave:()=>y("")},e("span",{className:"btn-modal-title"},"Act"),e(Se,null))),c!==null&&e(Ke,{toggle:A,title:c},c==="HISTORY"?e(Ge,{setFormFromHistory:x}):c==="SETTING"?e(Qe,{configUrl:R}):c==="E2E TEST"?e(Ze,{baseUrl:O}):c==="SCHEMA"?e(Xe,null):c==="ACT"?e(qe,null):e(h,null)))};De(e(Ae,null,e(et,null)),document.getElementById("root")); +`),"You can capture _id with [body][0][_id] or for name: [body][0][name]."),e("img",{src:"https://github.com/MiaadTeam/lesan/assets/6236123/1cea1db3-44c2-49b5-8739-a9afa8a6e1fa",alt:"full screen e2e",className:"e2e_help--fullscreen-img"})),e("hr",null),e("section",{className:"e2e_help--section---right-side"},e("img",{src:"https://github.com/MiaadTeam/lesan/assets/6236123/5c9899fa-8be6-42d1-8f4f-8fd965264645",alt:"full screen e2e",className:"e2e_help--fullscreen-img"}),e("p",null,"The left side is a text area for writing headers and the body of the request in JSON format. In this text area, you can use a text parser to implement the captured value you captured before inside these symbols ","{}",".")),e("hr",null),e("p",null,"Also, we have some buttons on the top right side of each request section. With these buttons, you can move up and down and delete requests.",e("img",{src:"https://github.com/MiaadTeam/lesan/assets/6236123/900a5b98-3e7f-460a-a756-403ecaedcf86",alt:"full screen e2e",className:"e2e_help--fullscreen-img"}))),e("hr",null),e("div",null,e("p",null,"After clicking on the Run E2E Test button, you can see the result of each test. Also, in the result view, you can export the results in JSON format."),e("img",{src:"https://github.com/MiaadTeam/lesan/assets/6236123/8c367965-a1b7-40b8-8638-60d2d0ea2609",alt:"full screen e2e",className:"e2e_help--fullscreen-img"})),e("hr",null),e("div",null,e("p",null,"Additionally, you can go to the E2E Test modal page from the main page by clicking on the Test icon inside the response header section. This way, you can add a new test section and prepopulate the Header and Body text areas with the sent request from the main page.",e("img",{src:"https://github.com/MiaadTeam/lesan/assets/6236123/74dc9e93-2b41-4840-afc1-f4e8e83c9889",alt:"full screen e2e",className:"e2e_help--fullscreen-img"})))));function ae(){return e("svg",{width:"25px",height:"25px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M11 8C11 7.44772 11.4477 7 12 7C12.5523 7 13 7.44772 13 8V11H16C16.5523 11 17 11.4477 17 12C17 12.5523 16.5523 13 16 13H13V16C13 16.5523 12.5523 17 12 17C11.4477 17 11 16.5523 11 16V13H8C7.44771 13 7 12.5523 7 12C7 11.4477 7.44772 11 8 11H11V8Z",fill:"lightcoral"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12ZM3.00683 12C3.00683 16.9668 7.03321 20.9932 12 20.9932C16.9668 20.9932 20.9932 16.9668 20.9932 12C20.9932 7.03321 16.9668 3.00683 12 3.00683C7.03321 3.00683 3.00683 7.03321 3.00683 12Z",fill:"bisque"}))}var ct=()=>e("svg",{width:"25px",viewBox:"-0.5 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M12 22.4199C17.5228 22.4199 22 17.9428 22 12.4199C22 6.89707 17.5228 2.41992 12 2.41992C6.47715 2.41992 2 6.89707 2 12.4199C2 17.9428 6.47715 22.4199 12 22.4199Z",stroke:"bisque","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{id:"Vector",d:"M16 16L12 12M12 12L8 8M12 12L16 8M12 12L8 16",stroke:"lightcoral","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),U=ct;function be(){return e("svg",{width:"25px",viewBox:"-0.5 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M12 22.4199C17.5228 22.4199 22 17.9428 22 12.4199C22 6.89707 17.5228 2.41992 12 2.41992C6.47715 2.41992 2 6.89707 2 12.4199C2 17.9428 6.47715 22.4199 12 22.4199Z",stroke:"bisque","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M16 10.99L13.13 14.05C12.9858 14.2058 12.811 14.3298 12.6166 14.4148C12.4221 14.4998 12.2122 14.5437 12 14.5437C11.7878 14.5437 11.5779 14.4998 11.3834 14.4148C11.189 14.3298 11.0142 14.2058 10.87 14.05L8 10.99",stroke:"lightcoral","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))}function ne(){return e("svg",{width:"25px",height:"25px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M12 17V16.9929M12 14.8571C12 11.6429 15 12.3571 15 9.85714C15 8.27919 13.6568 7 12 7C10.6567 7 9.51961 7.84083 9.13733 9",stroke:"lightcoral","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12ZM3.00683 12C3.00683 16.9668 7.03321 20.9932 12 20.9932C16.9668 20.9932 20.9932 16.9668 20.9932 12C20.9932 7.03321 16.9668 3.00683 12 3.00683C7.03321 3.00683 3.00683 7.03321 3.00683 12Z",fill:"bisque"}))}function ge(){return e("svg",{width:"25px",height:"25px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.75 13.9393L15.9697 10.7197L17.0303 11.7803L12 16.8107L6.96967 11.7803L8.03033 10.7197L11.25 13.9393L11.25 4.5L12.75 4.5L12.75 13.9393Z",fill:"lightcoral"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12ZM3.00683 12C3.00683 16.9668 7.03321 20.9932 12 20.9932C16.9668 20.9932 20.9932 16.9668 20.9932 12C20.9932 7.03321 16.9668 3.00683 12 3.00683C7.03321 3.00683 3.00683 7.03321 3.00683 12Z",fill:"bisque"}))}function ye(){return e("svg",{width:"25px",height:"25px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M13.8876 9.9348C14.9625 10.8117 15.5 11.2501 15.5 12C15.5 12.7499 14.9625 13.1883 13.8876 14.0652C13.5909 14.3073 13.2966 14.5352 13.0261 14.7251C12.7888 14.8917 12.5201 15.064 12.2419 15.2332C11.1695 15.8853 10.6333 16.2114 10.1524 15.8504C9.6715 15.4894 9.62779 14.7336 9.54038 13.2222C9.51566 12.7947 9.5 12.3757 9.5 12C9.5 11.6243 9.51566 11.2053 9.54038 10.7778C9.62779 9.26636 9.6715 8.51061 10.1524 8.1496C10.6333 7.78859 11.1695 8.11466 12.2419 8.76679C12.5201 8.93597 12.7888 9.10831 13.0261 9.27492C13.2966 9.46483 13.5909 9.69274 13.8876 9.9348Z",stroke:"lightcoral","stroke-width":"2"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12ZM3.00683 12C3.00683 16.9668 7.03321 20.9932 12 20.9932C16.9668 20.9932 20.9932 16.9668 20.9932 12C20.9932 7.03321 16.9668 3.00683 12 3.00683C7.03321 3.00683 3.00683 7.03321 3.00683 12Z",fill:"bisque"}))}function Ce(){return e("svg",{width:"25px",viewBox:"-0.5 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M12 22.4199C17.5228 22.4199 22 17.9428 22 12.4199C22 6.89707 17.5228 2.41992 12 2.41992C6.47715 2.41992 2 6.89707 2 12.4199C2 17.9428 6.47715 22.4199 12 22.4199Z",stroke:"bisque","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M8 13.8599L10.87 10.8C11.0125 10.6416 11.1868 10.5149 11.3815 10.4282C11.5761 10.3415 11.7869 10.2966 12 10.2966C12.2131 10.2966 12.4239 10.3415 12.6185 10.4282C12.8132 10.5149 12.9875 10.6416 13.13 10.8L16 13.8599",stroke:"lightcoral","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))}var Ve={fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial',display:"inline-block",borderRadius:3,padding:"10px 10px",color:"#f8f8f2",textShadow:"1px 1px black",whiteSpace:"pre-wrap"};var dt=/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,pt=a=>JSON.stringify(a,mt,2).replace(/&/g,"&").replace(//g,">").replace(dt,t=>{let n="cute-number",i=t;return/^"/.test(t)?/:$/.test(t)?(n="cute-key",i=i.replace(":",':')):t==='"undefined"'?n="cute-undefined":t==='"[Function]"'?n="cute-function":n="cute-string":/true|false/.test(t)?n="cute-boolean":/null/.test(t)&&(n="cute-null"),`${i}`}),mt=(a,s)=>typeof s=="function"?"[Function]":typeof s>"u"?"undefined":s,Be=a=>pt(a).replace(/"/g,"");var A=({jsonData:a})=>{let s=Be(a);return e(q,null,e("pre",{style:Ve,dangerouslySetInnerHTML:{__html:s}}))};function oe(){return e("svg",{fill:"#fff",height:"20px",width:"20px",version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 452.025 452.025"},e("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"}),e("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"}),e("g",{id:"SVGRepo_iconCarrier"}," ",e("g",null," ",e("g",null," ",e("path",{d:"M362.612,34.125h-55.2l13.6-13.6c4.7-4.7,4.7-12.3,0-17s-12.3-4.7-17,0l-34,34.1c-2.3,2.3-3.5,5.3-3.5,8.5 s1.3,6.2,3.5,8.5l34.1,34.1c2.3,2.3,5.4,3.5,8.5,3.5s6.1-1.2,8.5-3.5c4.7-4.7,4.7-12.3,0-17l-13.6-13.6h55.2c35.9,0,65,29.2,65,65 v40.3c0,6.6,5.4,12,12,12s12-5.4,12-12v-40.3C451.712,74.025,411.712,34.125,362.612,34.125z"})," ",e("path",{d:"M438.812,230.925h-197.1c-6.6,0-12,5.4-12,12v197.1c0,6.6,5.4,12,12,12h197.1c6.6,0,12-5.4,12-12v-197.1 C450.812,236.225,445.412,230.925,438.812,230.925z M426.812,428.025h-173.1v-173.1h173.1L426.812,428.025L426.812,428.025z"})," ",e("path",{d:"M147.912,363.325c-4.7-4.7-12.3-4.7-17,0c-4.7,4.7-4.7,12.3,0,17l13.6,13.6h-55.2c-35.9,0-65-29.2-65-65v-40.3 c0-6.6-5.4-12-12-12s-12,5.4-12,12v40.3c0,49.1,39.9,89,89,89h55.2l-13.6,13.6c-4.7,4.7-4.7,12.3,0,17c2.3,2.3,5.4,3.5,8.5,3.5 s6.1-1.2,8.5-3.5l34.1-34.1c4.7-4.7,4.7-12.3,0-17L147.912,363.325z"})," ",e("path",{d:"M13.212,24.025c3.2,0,6.3-1.3,8.5-3.5s3.5-5.3,3.5-8.5c0-3.1-1.3-6.3-3.5-8.5s-5.3-3.5-8.5-3.5s-6.3,1.3-8.5,3.5 s-3.5,5.3-3.5,8.5s1.3,6.3,3.5,8.5C7.012,22.725,10.012,24.025,13.212,24.025z"})," ",e("path",{d:"M111.812,24.025c6.6,0,12-5.4,12-12s-5.4-12-12-12s-12,5.4-12,12S105.112,24.025,111.812,24.025z"})," ",e("path",{d:"M62.512,24.025c6.6,0,12-5.4,12-12s-5.4-12-12-12s-12,5.4-12,12S55.912,24.025,62.512,24.025z"})," ",e("path",{d:"M161.012,24.025c6.6,0,12-5.4,12-12s-5.4-12-12-12s-12,5.4-12,12S154.412,24.025,161.012,24.025z"})," ",e("path",{d:"M210.312,0.025c-3.1,0-6.3,1.3-8.5,3.5s-3.5,5.3-3.5,8.5s1.3,6.3,3.5,8.5s5.3,3.5,8.5,3.5s6.3-1.3,8.5-3.5 s3.5-5.3,3.5-8.5s-1.3-6.3-3.5-8.5S213.512,0.025,210.312,0.025z"})," ",e("path",{d:"M210.312,147.925c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12C222.312,153.225,217.012,147.925,210.312,147.925z"})," ",e("path",{d:"M210.312,98.625c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12C222.312,103.925,217.012,98.625,210.312,98.625z"})," ",e("path",{d:"M210.312,49.325c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12C222.312,54.725,217.012,49.325,210.312,49.325z"})," ",e("path",{d:"M210.312,197.125c-3.2,0-6.3,1.3-8.5,3.5s-3.5,5.3-3.5,8.5c0,3.1,1.3,6.3,3.5,8.5s5.3,3.5,8.5,3.5s6.3-1.3,8.5-3.5 s3.5-5.3,3.5-8.5s-1.3-6.3-3.5-8.5C216.613,198.425,213.512,197.125,210.312,197.125z"})," ",e("path",{d:"M161.012,221.125c6.6,0,12-5.4,12-12s-5.4-12-12-12s-12,5.4-12,12C149.012,215.825,154.412,221.125,161.012,221.125z"})," ",e("path",{d:"M111.812,221.125c6.6,0,12-5.4,12-12s-5.4-12-12-12s-12,5.4-12,12C99.812,215.825,105.112,221.125,111.812,221.125z"})," ",e("path",{d:"M62.512,221.125c6.6,0,12-5.4,12-12s-5.4-12-12-12s-12,5.4-12,12C50.512,215.825,55.912,221.125,62.512,221.125z"})," ",e("path",{d:"M13.212,221.125c3.2,0,6.3-1.3,8.5-3.5s3.5-5.3,3.5-8.5s-1.3-6.3-3.5-8.5s-5.3-3.5-8.5-3.5s-6.3,1.3-8.5,3.5 s-3.5,5.3-3.5,8.5c0,3.1,1.3,6.3,3.5,8.5C7.012,219.825,10.012,221.125,13.212,221.125z"})," ",e("path",{d:"M13.212,171.925c6.6,0,12-5.4,12-12s-5.4-12-12-12s-12,5.4-12,12S6.612,171.925,13.212,171.925z"})," ",e("path",{d:"M13.212,122.625c6.6,0,12-5.4,12-12s-5.4-12-12-12s-12,5.4-12,12C1.212,117.225,6.612,122.625,13.212,122.625z"})," ",e("path",{d:"M13.212,73.325c6.6,0,12-5.4,12-12s-5.4-12-12-12s-12,5.4-12,12S6.612,73.325,13.212,73.325z"})," ")," ")," "))}var $e=({results:a,setIsShowE2eResponse:s})=>{let[t,n]=S(0);return e("div",{style:{display:"flex",minWidth:"100%",position:"relative"},id:a[t].id},e("section",{className:"container-re"},e("div",{className:"container-re--header"},e("span",{className:"container-re--header--icon",onClick:()=>s(!0)},e(oe,null)),e("span",{className:"container-re-title"},"REQUEST")),e(A,{jsonData:a[t].request}),e("div",{className:"pagination",style:{position:"absolute",bottom:"0px",right:"-87.5px",zIndex:"1",backgroundColor:"#2c2e2c",padding:"9px 5px 5px 5px",display:"flex",gap:"5px",maxWidth:"175px",width:"175px",justifyContent:"flex-start",overflowY:"scroll",overflowWrap:"anywhere",whiteSpace:"nowrap",border:"1px solid bisque",borderBottom:"none",borderRadius:"7px 7px 0 0",color:"gainsboro",flexWrap:"wrap",height:"42px"}},a.map((i,m)=>e("span",{className:"pagination--item",style:{cursor:"pointer"},onClick:()=>n(m),"data-show":t===m},m+1)))),e("section",{className:"container-re container-response"},e("div",{className:"container-re--header"},e("span",{className:"container-re-title"},"RESPONSE"),e("span",{className:"e2e-re-timeNumber-request"},a[t].responseTime,"ms")),e(A,{jsonData:a[t].response})))};function Pe({sequence:a}){let[s,t]=S(!0);return e("div",{key:a.id,className:"container-detail"},s?e(q,null,e("section",{className:"sequence-re"},e("div",{className:"container-re--header"},e("span",{className:"container-re--header--icon",onClick:()=>t(!1)},e(oe,null)),e("span",{className:"container-re-title"},"Body Header")),e(A,{jsonData:JSON.parse(a.bodyHeader)})),e("section",{className:"sequence-re sequence-response "},e("div",{className:"container-re--header"},e("span",{className:"container-re-title"},"Description")),e("div",{className:"detail-sequence"},e("div",{className:"detail-sequence--sections"},e("span",{className:"sequnce-description-label"},"Requests")," ",e("span",null,"All Request Count: ",e("span",null,a.repeat)," "),e("span",{className:"e2e-success"},"Success:",e("span",null," ",a.success)),e("span",{className:"e2e-fail"},"Fails: ",e("span",null,a.fails)),e("span",null,"All Request Time: ",e("span",null,a.time," ms")),e("span",null,"Avrage Time For Each Request:"," ",e("span",null,(a.time/a.repeat).toFixed(1)," ms"))),e("div",{className:"detail-sequence--sections"},e("span",{className:"sequnce-description-label"},"Best")," ",e("span",null,"Best Time: ",e("span",null,a.bestTime.time," ms")),e("span",null,"Request Index: ",e("span",null,a.bestTime.resultIdx))),e("div",{className:"detail-sequence--sections"},e("span",{className:"sequnce-description-label"},"Worst"),e("span",null,"Worst Time: ",e("span",null,a.worstTime.time," ms")," "),e("span",null," ","Request Index: ",e("span",null,a.worstTime.resultIdx))),e("div",{className:"detail-sequence--sections"},e("span",{className:"sequnce-description-label"},"Capture Items")," ",a.captures.map(n=>e("ul",{className:"detail-sequence--sections--capture-items"},e("li",null,"key:"," ",e("span",{className:"information-container--request--sections--item--content"},n.key)),e("li",null,"value :"," ",e("span",{className:"information-container--request--sections--item--content"},n.value)),e("li",null,"model :"," ",e("span",{className:"information-container--request--sections--item--content"},n.model)),e("li",null,"act :"," ",e("span",{className:"information-container--request--sections--item--content"},n.act)),e("li",null,"sequnce index:"," ",e("span",{className:"information-container--request--sections--item--content"}," ",n.sequenceIdx))))),a.usedCaptures.length>0&&e("div",{className:"detail-sequence--sections"},e("span",{className:"sequnce-description-label"},"Using Capture Items")," ",a.usedCaptures.map(n=>e("ul",{className:"detail-sequence--sections--capture-items"},e("li",null,"key:"," ",e("span",{className:"information-container--request--sections--item--content"}," ",n.key)),e("li",null,"captured from:"," ",e("span",{className:"information-container--request--sections--item--content"}," ",n.captured)),e("li",null,"value:"," ",e("span",{className:"information-container--request--sections--item--content"}," ",n.value)),e("li",null," ","model :"," ",e("span",{className:"information-container--request--sections--item--content"}," ",n.model)),e("li",null," ","act :"," ",e("span",{className:"information-container--request--sections--item--content"},n.act)),e("li",null,"sequnce index:"," ",e("span",{className:"information-container--request--sections--item--content"},n.sequenceIdx)))))))):e($e,{results:a.results,setIsShowE2eResponse:t}))}function Ze({baseUrl:a}){let{e2eForms:s,setE2eForms:t}=j(),n={allReqPerformance:0,numberRequest:0,success:0,fails:0,bestTime:{sequenceIdx:0,resultIdx:0,time:Number.MAX_SAFE_INTEGER,act:"",model:""},worstTime:{sequenceIdx:0,resultIdx:0,act:"",model:"",time:0},sequenceDetail:[],allCaptureItems:[]},[i,m]=S(!1),[c,d]=S(n),r=(l,f)=>{if(!(l===0&&f<=0)){let y=s[l];s.splice(l,1),s.splice(f,0,y),t([...s])}},C=l=>{s[l],s.splice(l,1),t([...s])},[x,T]=S("e2e"),w=()=>{let l=`data:text/json;chatset=utf-8,${encodeURIComponent(JSON.stringify(s))}`,f=document.createElement("a");f.href=l,f.download="Configdata.json",f.click()},F=l=>{let f=new FileReader;f.readAsText(l.target.files[0],"UTF-8"),f.onload=y=>{let N=JSON.parse(y.target.result);t(N)}},$=()=>{let l=`data:text/json;chatset=utf-8,${encodeURIComponent(JSON.stringify(c))}`,f=document.createElement("a");f.href=l,f.download="data.json",f.click()},z=async({baseUrl:l,options:f})=>await(await fetch(`${l}lesan`,f)).json(),Z=(l,f,y)=>{for(let N in l){typeof l[N]=="object"&&Z(l[N],f,y);let M=l[N];if(typeof M=="string"&&M.includes("{")){let p=[];for(let D=0;DM.slice(D+1,O[P])).forEach(D=>{for(let P of f)P.key===D&&(y.push({key:l[N],value:l[N].replace(`{${D}}`,P.value)}),l[N]=l[N].replace(`{${D}}`,P.value))})}}return y},Y=async()=>{let l=new Set;for await(let f of s){let y=JSON.parse(f.bodyHeaders),N=Z(y,l,[]),M=(R,H)=>{for(let E of H)if(E.value===R)return E},p={method:"POST",headers:{"Content-Type":"application/json",...y.headers},body:JSON.stringify(y.body)},O,K=h();for(let R=0;R{let g=u.sequenceDetail,v=g.findIndex(b=>b.id===K),_=1;return v!==-1?(g[v].results.push(o),_=g[v].results.length,g[v].bestTime=g[v].bestTime.timeE?g[v].worstTime:{resultIdx:_,time:E},O.success?g[v].success=g[v].success+1:g[v].fails=g[v].fails+1,g[v].time=g[v].time+E,g[v].repeat=g[v].repeat+1):g.push({id:K,bodyHeader:f.bodyHeaders,time:E,repeat:1,success:O.success?1:0,fails:O.success?0:1,bestTime:{resultIdx:_,time:E},worstTime:{resultIdx:_,time:E},captures:f.captures.map(({key:b,value:L})=>({key:b,value:L,sequenceIdx:g.length,model:y.body.model,act:y.body.act})),usedCaptures:N.map(({key:b,value:L})=>{let X=M(L,l);return{key:b,value:L,captured:X?.captured,sequenceIdx:X?.sequenceIdx,model:X?.model,act:X?.act}}),results:[o]}),{allReqPerformance:u.allReqPerformance+E,numberRequest:u.numberRequest+1,success:O.success?u.success+1:u.success,fails:O.success?u.fails:u.fails+1,bestTime:u.bestTime.timeE?u.worstTime:{resultIdx:_,sequenceIdx:g.length,act:y.body.act,model:y.body.model,time:E},sequenceDetail:g,allCaptureItems:Array.from(l)}})}[...f.captures].filter(R=>R.key&&R.value).map(R=>{let H=R.value.split("["),E=[];return H.forEach(k=>{let o=k.slice(0,k.indexOf("]"));isNaN(Number(o))||(o=Number(o)),E.push(o)}),E.shift(),{key:R.key,parsedValue:E,value:R.value}}).forEach(R=>{if(R.parsedValue.length>0){let H=O;R.parsedValue.forEach(E=>{H=H[E]}),l.add({key:R.key,value:H,captured:R.value,act:y.body.act,model:y.body.model,sequenceIdx:c.sequenceDetail.length-1})}})}},W=l=>{let f=[...s];f[l].repeat=+f[l].repeat+1,t([...f])},V=l=>{let f=[...s];f[l].repeat>0&&(f[l].repeat-=1),t([...f])};return e("div",{className:"e2e-container"},x==="result"?e("div",{className:"e2e-container--sequence-container"},e("div",{className:"results-buttons"},e("button",{className:"btn e2e-back-button",onClick:()=>{document.getElementById("modal")?.scroll({top:0,behavior:"smooth"}),d(n),T("e2e")}},e(se,null),e("span",null,"Back")),e("button",{className:"btn e2e-back-button e2e-export_results-button",onClick:$},e(G,null),e("span",null,"Export"))),e("div",{className:"e2e-container--sequence-container--information-container"},e("span",{className:"information-container-label"},"Information"),e("div",{className:"information-container--request"},e("span",{className:"information-container-label"},"Requests")," ",e("div",{className:"information-container--request--sections"},e("p",{className:"information-container--request--sections--item"},"All Request Count:"," ",e("span",{className:"information-container--request--sections--item--content"},c.numberRequest)," ","times")," ",e("p",{className:"information-container--request--sections--item"}," ","All Request Time:"," ",e("span",{className:"information-container--request--sections--item--content"},c.allReqPerformance)," ","ms")),e("div",{className:"information-container--request--sections"},e("p",{className:"information-container--request--sections--item"},"All ",e("span",{className:"e2e-success"},"Success")," Request:"," ",e("span",{className:"information-container--request--sections--item--content"},c.success," ")," ","times"),e("p",{className:"information-container--request--sections--item"},"All ",e("span",{className:"e2e-fail"},"Fails")," Request :"," ",e("span",{className:"information-container--request--sections--item--content"},c.fails," "),"times"))),e("div",{className:"information-container--times"},e("span",{className:"information-container-label"},"Times")," ",e("ul",{className:"information-container--times--sections"},e("li",null," ",e("span",{className:"e2e-best"},"Best ")," Request Time:"," ",e("span",{className:"e2e-best"},c.bestTime.time," "),"ms"," "),e("li",null," ","Seqeunce Index:"," ",e("span",{className:"information-container--request--sections--item--content"},c.bestTime.sequenceIdx," ")),e("li",null," ","Request Index:"," ",e("span",{className:"information-container--request--sections--item--content"},c.bestTime.resultIdx)," "),e("li",null,"Model:"," ",e("span",{className:"information-container--request--sections--item--content"},c.bestTime.model," ")," "),e("li",null,"Act:"," ",e("span",{className:"information-container--request--sections--item--content"},c.bestTime.act," "))),e("ul",{className:"information-container--times--sections"},e("li",null,"Worst Request Time:"," ",e("span",{className:"information-container--request--sections--item--content"},c.worstTime.time)," ","ms"," "),e("li",null," ","Seqeunce Index:"," ",e("span",{className:"information-container--request--sections--item--content"},c.worstTime.sequenceIdx," ")),e("li",null," ","Request Index:"," ",e("span",{className:"information-container--request--sections--item--content"},c.worstTime.resultIdx," ")),e("li",null,"Model:"," ",e("span",{className:"information-container--request--sections--item--content"},c.worstTime.model)),e("li",null,"act:"," ",e("span",{className:"information-container--request--sections--item--content"},c.worstTime.act)))),c.allCaptureItems.length>0&&e("div",{className:"information-container--captures"},e("span",{className:"information-container-label"},"Captures Information")," ",c.allCaptureItems.map(l=>e("ul",{className:"information-container--captures--sections"},e("span",{className:"information-container-label"},l.key),e("li",null,"Captured From:"," ",e("span",{className:"information-container--request--sections--item--content"},l.captured)),e("li",null,"Value Of"," ",e("span",{className:"information-container--request--sections--item--content"},": ",l.value)),e("li",null,"Model :"," ",e("span",{className:"information-container--request--sections--item--content"},l.model)),e("li",null,"Act :"," ",e("span",{className:"information-container--request--sections--item--content"},l.act)),e("li",null,"Captured Inside Sequnce Index:"," ",e("span",{className:"information-container--request--sections--item--content"},l.sequenceIdx)))))),e("div",{className:"e2e-sequesnce-wrapper"},c.sequenceDetail.map(l=>e(Pe,{sequence:l})))):x==="e2e"?e(q,null,e("div",{className:"sidebar__section sidebar__section--headers"},s.map((l,f)=>e(q,null,e("div",{className:"sidebar__input-double",key:l.id},s.length>1&&e("div",{className:"e2e-move-buttons"},e("div",{className:"e2e-move-div",onClick:()=>r(f,f-1)},e(Ce,null)),e("div",{className:"e2e-move-div",onClick:()=>r(f,f+1)},e(be,null)),e("div",{className:"e2e-move-div e2e-move-close",onClick:()=>C(f)},e(U,null))),e("div",{className:"sidebar__section-body-heading"},e("div",{className:"sidebar__section-heading"},"set test body and headers"),e("textarea",{placeholder:"please paste a request body here",value:l.bodyHeaders,name:`${l.id}-body`,rows:18,onChange:y=>{let N=[...s];N[f].bodyHeaders=y.target.value,t([...N])}})),e("div",{className:"sidebar__section-capture"},e("div",{className:"e2e_sidebar__section-heading"},"set repeat time"),e("div",{className:"repeat__number"},e("input",{className:"input",min:0,placeholder:"set repeat number",value:l.repeat,name:`${l.id}-repeat`,type:"number",onChange:y=>{let N=[...s];N[f].repeat=y.target.value,t([...N])}}),e("button",{className:"e2e-back-button e2e-export_results-button",onClick:()=>W(f)},"+"),e("button",{className:"e2e-back-button e2e-export_results-button",onClick:()=>V(f)},"-")),e("div",{className:"e2e_sidebar__section-heading"},"capture variables"),e("button",{className:"btn btn--add e2e-back-button e2e-export_results-button e2e-add-capture ",onClick:()=>{let y=[...s];y[f].captures.push({key:"",value:""}),t([...y])}},"add capture"),l.captures.map((y,N)=>e(q,null,e("div",{className:"sidebar__section-add-capture"},e("input",{className:"input",placeholder:"set a variable name",value:y.key,onChange:M=>{let p=[...s];p[f].captures[N].key=M.target.value,t([...p])}}),e("input",{className:"input",placeholder:"set a value for variable",value:y.value,onChange:M=>{let p=[...s];p[f].captures[N].value=M.target.value,t([...p])}})),e("hr",null)))))))),e("button",{className:"btn btn-show-results-buttons ",onClick:()=>m(!i)},"show btn"),e("div",{className:"results-buttons","data-show":i===!0},e("button",{className:"btn btn-e2e-action e2e-back-button e2e-export_results-button",onClick:()=>{t([...s,ue()])}},e(ae,null),e("span",null,"Add")),e("button",{className:"btn btn-e2e-action e2e-back-button e2e-run-botton e2e-export_results-button",onClick:async()=>{T("result"),await Y()}},e(ye,null),e("span",null,"Run E2E Test")),e("input",{id:"actual-btn",type:"file",onChange:F,hidden:!0}),e("label",{htmlFor:"actual-btn",className:"btn btn-e2e-action e2e-back-button e2e-export_results-button"},e(ge,null),e("span",null,"Import")),e("button",{className:"btn btn-e2e-action e2e-back-button e2e-export_results-button",onClick:w},e(G,null),e("span",null,"Export")),e("button",{onClick:()=>T("help"),className:"btn btn-e2e-action e2e-back-button e2e-export_results-button"},e(ne,null),e("span",null,"Help")))):x==="help"?e(je,{setView:T}):"")}function de(a){let s=Math.floor(a/36e5),t=Math.floor(a%36e5/6e4),n=Math.floor(a%36e4%6e4/1e3);return s>0?`${s}h ${t}m ${n}s`:t>0?`${t}m ${n}s`:n>0?`${n}s`:`${a}ms`}var Je=(a,s)=>{let t=J(!0);B(()=>{let n=()=>{};if(t.current?t.current=!1:n=a(),n&&typeof n=="function")return n},s)};function Te(){return e("svg",{id:"Layer_1","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 105.7 122.88",width:20},e("path",{fill:"white",d:"M30.46,14.57V5.22A5.18,5.18,0,0,1,32,1.55v0A5.19,5.19,0,0,1,35.68,0H70a5.22,5.22,0,0,1,3.67,1.53l0,0a5.22,5.22,0,0,1,1.53,3.67v9.35h27.08a3.36,3.36,0,0,1,3.38,3.37V29.58A3.38,3.38,0,0,1,102.32,33H98.51l-8.3,87.22a3,3,0,0,1-2.95,2.69H18.43a3,3,0,0,1-3-2.95L7.19,33H3.37A3.38,3.38,0,0,1,0,29.58V17.94a3.36,3.36,0,0,1,3.37-3.37Zm36.27,0V8.51H39v6.06ZM49.48,49.25a3.4,3.4,0,0,1,6.8,0v51.81a3.4,3.4,0,1,1-6.8,0V49.25ZM69.59,49a3.4,3.4,0,1,1,6.78.42L73,101.27a3.4,3.4,0,0,1-6.78-.43L69.59,49Zm-40.26.42A3.39,3.39,0,1,1,36.1,49l3.41,51.8a3.39,3.39,0,1,1-6.77.43L29.33,49.46ZM92.51,33.38H13.19l7.94,83.55H84.56l8-83.55Z"}))}function Ge({setFormFromHistory:a}){let{history:s,setHistory:t,deleteItemHistory:n}=j(),[i,m]=S("");return Je(()=>{localStorage.setItem("localHistory",JSON.stringify(s))},[s]),e(q,null,s&&s?.length>0?e("div",null,e("br",null),s.map((c,d)=>e("div",{className:"container-detail",id:c.id},e("section",{className:"container-re"},e("div",{style:{position:"relative",borderBottom:"1px solid gainsboro"}},e("span",{className:"container-re-title"},"REQUEST"),e("span",{className:"history-re-detail-date"},c.reqDate)),e("div",{className:"container-re-detail"},e("div",{className:"container-re-detail-title"}," ",e(A,{jsonData:c.request.body.model}),e("span",null,"|"),e("div",null,e(A,{jsonData:c.request.body.act}))),i===c.id?e("button",{onClick:()=>m(""),className:"history-re-detail-button"},"Hide",e("span",{className:"history-re-detail-button-icon"},"\u2013")):e("button",{onClick:()=>{m(c.id),document.getElementById(c.id)?.scrollIntoView()},className:"history-re-detail-button"},"Show"," ",e("span",{className:"history-re-detail-button-icon"},"+"))),e("div",{className:"history-re-detail-complete","data-show":i===c.id}," ",e(A,{jsonData:c.request}))),e("section",{className:"container-re container-response"},e("div",{className:"history-re-title_delete",style:{position:"relative",borderBottom:"1px solid gainsboro"}},e("span",{className:"history-re-delete",onClick:r=>{r.stopPropagation(),n(d)}},e(U,null)),e("span",{className:"container-re-title history-response-title"},"RESPONSE"),e("span",{className:"history-re-detail-date history-response-took"},de(c.response.tookTime))),e("div",{className:"container-re-detail"},e("div",{className:"history-re-detail-title"},e("div",{className:"history-re-response-title"}," ",e("span",{className:"history-re-response-title-status"},"success:"),e("div",{className:"history-re-response-info"},e(A,{jsonData:c.response.success})))),e("button",{onClick:()=>a(c.request),className:"history-re-detail-button"},"Use"," ",e("span",{className:"history-re-detail-button-icon"},"\u279C"," "))),e("div",{className:"history-re-detail-complete","data-show":i===c.id}," ",e(A,{jsonData:c.response})))))):e("span",{className:"no-history"},'"There is no history to display"'),s&&s.length>0?e("div",{className:"clear-history"},e("button",{className:"btn clear-history-button tooltip",onClick:()=>{confirm("Clear All History?")==!0&&t([])}},e(Te,null),e("span",{className:"tooltip-text"},"Clear History"))):"")}function Se(){return e("svg",{width:"25px",viewBox:"0 0 26 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"}),e("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"}),e("g",{id:"SVGRepo_iconCarrier"}," ",e("path",{d:"M4 6V19C4 20.6569 5.34315 22 7 22H17C18.6569 22 20 20.6569 20 19V9C20 7.34315 18.6569 6 17 6H4ZM4 6V5",stroke:"lightcoral","stroke-width":"1.5"})," ",e("path",{d:"M18 6.00002V6.75002H18.75V6.00002H18ZM15.7172 2.32614L15.6111 1.58368L15.7172 2.32614ZM4.91959 3.86865L4.81353 3.12619H4.81353L4.91959 3.86865ZM5.07107 6.75002H18V5.25002H5.07107V6.75002ZM18.75 6.00002V4.30604H17.25V6.00002H18.75ZM15.6111 1.58368L4.81353 3.12619L5.02566 4.61111L15.8232 3.0686L15.6111 1.58368ZM4.81353 3.12619C3.91638 3.25435 3.25 4.0227 3.25 4.92895H4.75C4.75 4.76917 4.86749 4.63371 5.02566 4.61111L4.81353 3.12619ZM18.75 4.30604C18.75 2.63253 17.2678 1.34701 15.6111 1.58368L15.8232 3.0686C16.5763 2.96103 17.25 3.54535 17.25 4.30604H18.75ZM5.07107 5.25002C4.89375 5.25002 4.75 5.10627 4.75 4.92895H3.25C3.25 5.9347 4.06532 6.75002 5.07107 6.75002V5.25002Z",fill:"lightcoral"})," ",e("path",{opacity:"0.5",d:"M8 12H16",stroke:"lightcoral","stroke-width":"1.5","stroke-linecap":"round"})," ",e("path",{opacity:"0.5",d:"M8 15.5H13.5",stroke:"lightcoral","stroke-width":"1.5","stroke-linecap":"round"})," "))}function Ne(){return e("svg",{width:"25px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{"fill-rule":"evenodd",opacity:"0.5","clip-rule":"evenodd",d:"M5.07868 5.06891C8.87402 1.27893 15.0437 1.31923 18.8622 5.13778C22.6824 8.95797 22.7211 15.1313 18.9262 18.9262C15.1312 22.7211 8.95793 22.6824 5.13774 18.8622C2.87389 16.5984 1.93904 13.5099 2.34047 10.5812C2.39672 10.1708 2.775 9.88377 3.18537 9.94002C3.59575 9.99627 3.88282 10.3745 3.82658 10.7849C3.4866 13.2652 4.27782 15.881 6.1984 17.8016C9.44288 21.0461 14.6664 21.0646 17.8655 17.8655C21.0646 14.6664 21.046 9.44292 17.8015 6.19844C14.5587 2.95561 9.33889 2.93539 6.13935 6.12957L6.88705 6.13333C7.30126 6.13541 7.63535 6.47288 7.63327 6.88709C7.63119 7.3013 7.29372 7.63539 6.87951 7.63331L4.33396 7.62052C3.92269 7.61845 3.58981 7.28556 3.58774 6.8743L3.57495 4.32874C3.57286 3.91454 3.90696 3.57707 4.32117 3.57498C4.73538 3.5729 5.07285 3.907 5.07493 4.32121L5.07868 5.06891Z",fill:"lightcoral"}),e("path",{d:"M12 7.25C12.4142 7.25 12.75 7.58579 12.75 8V11.6893L15.0303 13.9697C15.3232 14.2626 15.3232 14.7374 15.0303 15.0303C14.7374 15.3232 14.2626 15.3232 13.9697 15.0303L11.5429 12.6036C11.3554 12.416 11.25 12.1617 11.25 11.8964V8C11.25 7.58579 11.5858 7.25 12 7.25Z",fill:"lightcoral"}))}function Ee(){return e("svg",{height:"25px",width:"25px",version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"#000000"},e("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"}),e("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"}),e("g",{id:"SVGRepo_iconCarrier"}," ",e("circle",{opacity:.34,style:"fill:lightcoral;",cx:"256.602",cy:"226.267",r:"171.059"})," ",e("path",{style:"fill:lightcoral",d:"M482.195,226.196C482.195,101.471,380.725,0,256.001,0S29.804,101.471,29.804,226.196 c0,7.409,6.007,13.416,13.416,13.416s13.416-6.008,13.416-13.416c0-109.93,89.434-199.363,199.363-199.363 s199.363,89.434,199.363,199.363c0,109.928-89.434,199.362-199.363,199.362h-23.276l33.282-37.255 c4.937-5.525,4.458-14.007-1.067-18.944c-5.525-4.937-14.008-4.457-18.944,1.068l-47.576,53.255c-7.788,8.718-7.788,21.866,0,30.584 l47.576,53.255c2.651,2.968,6.322,4.478,10.01,4.478c3.181,0,6.375-1.126,8.934-3.41c5.526-4.937,6.004-13.419,1.067-18.944 l-33.282-37.255h23.276C380.725,452.39,482.195,350.919,482.195,226.196z"})," "))}function _e(){return e("svg",{fill:"lightcoral",height:"25px",width:"25px",viewBox:"0 0 436.668 436.668"},e("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"}),e("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"}),e("g",{id:"SVGRepo_iconCarrier"}," ",e("g",null," ",e("path",{opacity:.34,d:"M203.334,85.818v59.141c4.884-0.8,9.893-1.223,15-1.223s10.116,0.423,15,1.223V85.818c14.657-5.935,25-20.296,25-37.081 c0-22.092-17.909-40-40-40s-40,17.908-40,40C178.334,65.522,188.677,79.883,203.334,85.818z"})," ",e("path",{opacity:.34,d:"M70.642,204.021l56.242,18.274c1.539-10.139,4.732-19.74,9.292-28.525L79.912,175.49 c-1.115-15.774-11.577-30.049-27.541-35.236c-21.01-6.827-43.576,4.672-50.403,25.682c-6.827,21.01,4.672,43.576,25.682,50.403 C43.614,221.525,60.468,216.126,70.642,204.021z"})," ",e("path",{opacity:.34,d:"M152.577,301.224l-34.792,47.887c-15.346-3.813-32.156,1.725-42.022,15.305c-12.985,17.872-9.023,42.887,8.849,55.872 s42.887,9.023,55.872-8.849c9.866-13.579,9.939-31.277,1.571-44.694l34.772-47.86C167.8,314.333,159.616,308.347,152.577,301.224z"})," ",e("path",{opacity:.34,d:"M318.883,349.112l-34.792-47.887c-7.039,7.122-15.223,13.109-24.25,17.661l34.772,47.86 c-8.369,13.417-8.296,31.115,1.571,44.694c12.985,17.872,38,21.834,55.872,8.849s21.834-38,8.849-55.872 C351.038,350.837,334.229,345.298,318.883,349.112z"})," ",e("path",{opacity:.34,d:"M434.699,165.936c-6.827-21.01-29.393-32.508-50.403-25.682c-15.964,5.187-26.426,19.462-27.541,35.236l-56.263,18.281 c4.559,8.784,7.752,18.386,9.292,28.525l56.242-18.274c10.174,12.105,27.028,17.504,42.992,12.318 C430.028,209.512,441.526,186.946,434.699,165.936z"})," ",e("path",{d:"M280.834,236.237c0-34.462-28.037-62.5-62.5-62.5s-62.5,28.038-62.5,62.5s28.037,62.5,62.5,62.5 S280.834,270.7,280.834,236.237z"})," ")," "))}function xe(){return e("svg",{width:"25px",height:25,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M3 9.10986V14.8799C3 16.9999 3 16.9999 5 18.3499L10.5 21.5299C11.33 22.0099 12.68 22.0099 13.5 21.5299L19 18.3499C21 16.9999 21 16.9999 21 14.8899V9.10986C21 6.99986 21 6.99986 19 5.64986L13.5 2.46986C12.68 1.98986 11.33 1.98986 10.5 2.46986L5 5.64986C3 6.99986 3 6.99986 3 9.10986Z",stroke:"lightcoral","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",opacity:.34}),e("path",{d:"M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z",stroke:"lightcoral","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))}function we(){return e("svg",{width:"25px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{opacity:.5,d:"M9.74872 2.49415L18.1594 7.31987M9.74872 2.49415L2.65093 14.7455C1.31093 17.0584 2.10615 20.0159 4.42709 21.3513C6.74803 22.6867 9.7158 21.8942 11.0558 19.5813L12.5511 17.0003L14.1886 14.1738L15.902 11.2163L18.1594 7.31987M9.74872 2.49415L8.91283 2M18.1594 7.31987L19 7.80374",stroke:"lightcoral","stroke-width":"1.5","stroke-linecap":"round"}),e("path",{d:"M15.9021 11.2164L13.3441 9.74463M14.1887 14.1739L9.98577 11.7557M12.5512 17.0004L9.93848 15.4972",stroke:"lightcpral","stroke-width":"1.5","stroke-linecap":"round"}),e("path",{d:"M22 14.9166C22 16.0672 21.1046 16.9999 20 16.9999C18.8954 16.9999 18 16.0672 18 14.9166C18 14.1967 18.783 13.2358 19.3691 12.6174C19.7161 12.2512 20.2839 12.2512 20.6309 12.6174C21.217 13.2358 22 14.1967 22 14.9166Z",stroke:"lightcoral","stroke-width":"1.5"}))}function pe(){return e("svg",{width:"28px",fill:"white",viewBox:"0 0 32 32",style:"fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;",version:"1.1"},e("path",{d:"M9.101,7l8.899,0c1.857,-0 3.637,0.737 4.95,2.05c1.313,1.313 2.05,3.093 2.05,4.95l0,8.899c0.953,-0.195 1.837,-0.665 2.536,-1.363c0.937,-0.938 1.464,-2.21 1.464,-3.536c0,-2.977 0,-7.023 0,-10c0,-1.326 -0.527,-2.598 -1.464,-3.536c-0.938,-0.937 -2.21,-1.464 -3.536,-1.464c-2.977,0 -7.023,0 -10,0c-1.326,-0 -2.598,0.527 -3.536,1.464c-0.698,0.699 -1.168,1.583 -1.363,2.536Z"}),e("path",{d:"M23,14c0,-1.326 -0.527,-2.598 -1.464,-3.536c-0.938,-0.937 -2.21,-1.464 -3.536,-1.464c-2.977,0 -7.023,0 -10,0c-1.326,-0 -2.598,0.527 -3.536,1.464c-0.937,0.938 -1.464,2.21 -1.464,3.536c0,2.977 0,7.023 0,10c-0,1.326 0.527,2.598 1.464,3.536c0.938,0.937 2.21,1.464 3.536,1.464c2.977,-0 7.023,-0 10,-0c1.326,0 2.598,-0.527 3.536,-1.464c0.937,-0.938 1.464,-2.21 1.464,-3.536l0,-10Zm-15,10l10,0c0.552,0 1,-0.448 1,-1c0,-0.552 -0.448,-1 -1,-1l-10,0c-0.552,0 -1,0.448 -1,1c0,0.552 0.448,1 1,1Zm0,-4l10,0c0.552,0 1,-0.448 1,-1c0,-0.552 -0.448,-1 -1,-1l-10,0c-0.552,0 -1,0.448 -1,1c0,0.552 0.448,1 1,1Zm0,-4l10,0c0.552,0 1,-0.448 1,-1c0,-0.552 -0.448,-1 -1,-1l-10,0c-0.552,0 -1,0.448 -1,1c0,0.552 0.448,1 1,1Z"}),e("g",{id:"Icon"}))}function ke(){return e("svg",{width:25,height:25,fill:"#ffffff",version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 104.778 104.778"},e("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"}),e("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"}),e("g",{id:"SVGRepo_iconCarrier"}," ",e("g",null," ",e("path",{d:"M96.832,88.406l-23.02-39.908V21.959c4.385-1.595,7.447-5.797,7.447-10.618C81.26,5.089,76.176,0,69.928,0H42.6 c-6.251,0-11.334,5.089-11.334,11.341c0,4.815,3.07,9.017,7.457,10.618v26.55l-2.083,3.685V30.359c0-1.546-1.257-2.802-2.803-2.802 H8.723c-1.546,0-2.801,1.256-2.801,2.802v59.557c0,7.475,5.742,13.614,13.174,14.648c0.331,0.126,0.683,0.214,1.059,0.214h67.227 c4.79,0,8.433-1.762,10.282-4.979C99.503,96.598,99.208,92.543,96.832,88.406z M11.513,89.916v-6.079h8.254 c1.546,0,2.802-1.26,2.802-2.802c0-1.549-1.256-2.802-2.802-2.802h-8.254v-9.09h8.254c1.546,0,2.802-1.263,2.802-2.801 c0-1.555-1.256-2.802-2.802-2.802h-8.254v-9.097h8.254c1.546,0,2.802-1.256,2.802-2.801c0-1.55-1.256-2.803-2.802-2.803h-8.254 V33.149h19.512v56.767c0,5.095-4.375,9.248-9.756,9.248C15.883,99.17,11.513,95.011,11.513,89.916z M92.794,96.997 c-0.799,1.379-2.779,2.178-5.432,2.178H33.189c2.118-2.55,3.439-5.734,3.439-9.259V63.19c0.245-0.207,0.476-0.443,0.645-0.743 l6.679-11.82c0.236-0.422,0.364-0.898,0.364-1.379V19.776c0-1.415-1.048-2.603-2.449-2.78c-2.859-0.364-5.015-2.796-5.015-5.655 c0-3.161,2.571-5.738,5.731-5.738H69.91c3.165,0,5.734,2.577,5.734,5.738c0,2.859-2.155,5.286-5.017,5.655 c-1.401,0.178-2.446,1.365-2.446,2.78v29.472c0,0.493,0.122,0.977,0.374,1.401l23.396,40.559 C93.292,93.506,93.593,95.617,92.794,96.997z M76.466,79.53c0,5.412-4.377,9.794-9.801,9.794c-5.411,0-9.795-4.382-9.795-9.794 c0-5.406,4.384-9.795,9.795-9.795C72.089,69.735,76.466,74.124,76.466,79.53z M54.609,68.877c0,2.665-2.146,4.799-4.802,4.799 c-2.657,0-4.802-2.156-4.802-4.799c0-2.644,2.15-4.8,4.802-4.8C52.468,64.077,54.609,66.233,54.609,68.877z M58.195,58.048 c-1.672,0-3.015-1.341-3.015-3.01c0-1.667,1.343-3.009,3.015-3.009c1.663,0,3.015,1.343,3.015,3.009 C61.21,56.707,59.853,58.048,58.195,58.048z M49.534,86.315c0,1.669-1.352,3.009-3.016,3.009c-1.665,0-3.014-1.34-3.014-3.009 c0-1.663,1.349-3.016,3.014-3.016C48.182,83.3,49.534,84.652,49.534,86.315z M54.805,46.184c-2.185,0-3.956-1.771-3.956-3.957 c0-2.186,1.771-3.957,3.956-3.957c2.183,0,3.957,1.771,3.957,3.957C58.762,44.414,56.983,46.184,54.805,46.184z"})," ")," "))}function Re(){return e("svg",{version:"1.1",viewBox:"0 0 29.756 29.756",style:"enable-background:new 0 0 29.756 29.756;"},e("path",{d:"M29.049,5.009L28.19,4.151c-0.943-0.945-2.488-0.945-3.434,0L10.172,18.737l-5.175-5.173 c-0.943-0.944-2.489-0.944-3.432,0.001l-0.858,0.857c-0.943,0.944-0.943,2.489,0,3.433l7.744,7.752 c0.944,0.943,2.489,0.943,3.433,0L29.049,8.442C29.991,7.498,29.991,5.953,29.049,5.009z"}))}function Q(a){let s=J(null);return B(()=>{let t=n=>{s.current&&!s.current.contains(n?.target)&&a()};return document.addEventListener("click",t),()=>{document.removeEventListener("click",t)}},[s]),s}function ie({className:a=""}){return e("svg",{width:25,height:25,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:a},e("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"}),e("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"}),e("g",{id:"SVGRepo_iconCarrier"}," ",e("path",{d:"M6 9L12 15L18 9M12 9H12.01",stroke:"lightcoral","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})," "))}function re({items:a,onClickItem:s,incomeActiveItem:t,canShow:n}){let[i,m]=S(!1),[c,d]=S("");B(()=>{d(t||"")},[t]);let C=Q(()=>{m(!1)});return e("div",null,e("div",{className:"select",disabled:n},e("div",{className:`select--empty ${i===!0?"active-select--empty":""}`,ref:C,onClick:()=>m(!i)},e("div",{className:"select--empty--left-side"}," ",e("span",{className:`${c?"select-empty--left-side--clear":"select-empty--left-side--clear--inactive"}`,onClick:x=>{d(""),s(""),m(!1),x.stopPropagation()}},"x"),e("span",null,c)),e(ie,null)),i&&e("div",{className:"select--sub-buttons","data-show":i},a?.map((x,T)=>e("div",{className:`option ${x===c?"active-option":""}`,onClick:()=>{d(x),s(x),m(!1)}},x)))))}var ut=({options:a,onChange:s})=>{let[t,n]=S([]),[i,m]=S(a),[c,d]=S(!1),r=w=>{if(t.includes(w)){let F=t.filter($=>$.value!==w.value);n(F),m([...i,w]),s(F)}else{let F=i.filter($=>$.value!==w.value);n([...t,w]),m(F),s([...t,w])}},C=()=>{n([]),s([]),m(a)},x=()=>{d(!c)},T=Q(()=>{d(!1)});return e("div",{ref:T,className:"multi-select__wrapper"},e("div",{className:"multi-select__field",onClick:x},e("div",{className:"multi-select__selected-item-wrapper"},t.map(w=>e("div",{className:"multi-select__selected-item",key:w},e("div",{className:"multi-select__selected-item-text"},w.label),e("div",{className:"multi-select__selected-item-btn",role:"button",onClick:F=>{F.stopPropagation(),r(w)}},"x")))),e("div",{className:"multi-select__icons-wrapper"},t.length?e("div",{className:"multi-select__close-icon-wrapper",role:"button",onClick:w=>{w.stopPropagation(),C()}},e("span",{className:"multi-select__close-icon"},"x")):null,e("div",{className:"multi-select__arrow-icon-wrapper",role:"button"},e(ie,{className:"multi-select__arrow-icon"})))),c?e("div",{className:"multi-select__options"},i.length?i.map(w=>e("div",{key:w.value,onClick:F=>{F.stopPropagation(),r(w)},className:"multi-select__option"},e("div",{className:"multi-select__option-label"},w.label))):e("div",{className:"multi-select__option--no-option"},"No Options!")):null)},Ue=ut;var vt=({baseUrl:a,options:s})=>fetch(`${a}lesan`,s).then(t=>t.json()),ze=({urlAddress:a})=>{let{activeTab:s,tabsData:t,actsObj:n,headers:i,history:m,setService:c,setSchema:d,setAct:r,setPostFields:C,setGetFields:x,setFormData:T,setHistory:w,setResponse:F,resetGetFields:$,resetPostFields:z,addE2eForm:Z,setModal:Y}=j(),[W,V]=S(!1),l=(o,u,g,v)=>{for(let _ in g)g[_].type==="enums"?v[`${u}.${_}`]=o:l(o,`${u}.${_}`,g[_].schema,v);return v},f=J(null),y=o=>{let{name:u,value:g,type:v,alt:_}=o.target,b;v==="number"?b=Number(g):_==="array"||_==="boolean"?b=JSON.parse(g):b=g,T({data:{...t[s].formData,[u]:b},index:s})},N=({key:o,field:u,isMultiEnum:g=!1,formData:v})=>u.type==="array"?N({key:o,formData:v,field:u.schema,isMultiEnum:!0}):u.type==="enums"&&g?e(Ue,{options:Object.keys(u.schema).map(_=>({label:_,value:u.schema[_]})),onChange:_=>{let b=_.map(L=>L.value);T({data:{...v,[`set.${o}`]:b},index:s}),localStorage.setItem("localTabsData",JSON.stringify(t))}}):u.type==="enums"?e(re,{onClickItem:_=>{T({data:{...v,[`set.${o}`]:_},index:s}),localStorage.setItem("localTabsData",JSON.stringify(t))},incomeActiveItem:v[`set.${o}`],items:Object.keys(u.schema)}):e("input",{className:"input",placeholder:o,id:o,value:v[`set.${o}`],name:`set.${o}`,type:u.type==="number"?"number":"string",alt:g?"array":u.type,onChange:y}),M=({getField:o,keyName:u,margin:g})=>e("div",{style:{marginLeft:`${g+1}px`},className:"sidebar__section_container",key:`${s}.${u}`},e("div",{className:"sidebar__section-heading--subfields"},u),Object.keys(o.schema).map((v,_)=>o.schema[v].type==="enums"?e("div",{className:"input-cnt get-items",key:`${s}.${v}-${_}`},e("label",{htmlFor:v},u,".",v,":"),e("div",{className:"get-values"},e("span",{onClick:()=>{let b={...t[s].formData};delete b[`get.${u}.${v}`],T({data:b,index:s})}}),e("span",{className:t[s].formData[`get.${u}.${v}`]===0?"active":"",onClick:()=>{T({index:s,data:{...t[s].formData,[`get.${u}.${v}`]:0}})}},"0"),e("span",{className:t[s].formData[`get.${u}.${v}`]===1?"active":"",onClick:()=>{T({data:{...t[s].formData,[`get.${u}.${v}`]:1},index:s})}},"1"))):M({getField:o.schema[v],keyName:`${u}.${v}`,margin:g+1}))),p=()=>{let o=ce(t[s].formData);return{body:{method:"POST",headers:{"Content-Type":"application/json",...i},body:JSON.stringify({service:t[s].service,model:t[s].schema,act:t[s].act,details:o})}}},O=async o=>{o.preventDefault();let u=new Date().toLocaleDateString();V(!0),setTimeout(()=>{V(!1)},450);let g=performance.now(),v=await vt({baseUrl:a,options:p().body}),b=(performance.now()-g).toFixed(1);F({data:{...v,tookTime:b},index:s});let L=[{request:{...p().body,body:JSON.parse(p().body.body)},response:{...v,tookTime:b},id:h(),reqDate:u},...m];w(L),localStorage.setItem("localHistory",JSON.stringify(L)),localStorage.setItem("localTabsData",JSON.stringify(t))},K=t[s].service&&t[s].schema&&t[s].postFields&&t[s].getFields&&t[s].act,D=t[s].service,P=t[s].service&&t[s].schema,R=()=>{let o=JSON.stringify(t[s].response);navigator.clipboard.writeText(o)},H=()=>{let o=p();o.body.body=JSON.parse(o.body.body),navigator.clipboard.writeText(JSON.stringify(o))},E=()=>{let o=p();o.body.body=JSON.parse(o.body.body);let{method:u,...g}=o.body,v={id:h(),bodyHeaders:JSON.stringify({...g},null,2),repeat:1,captures:[]};Z(v),Y("E2E TEST")},k=(o,u)=>{if(u==="service"&&(c({data:o,index:s}),d({data:"",index:s})),u==="method"&&d({data:"",index:s}),u==="schema"&&d({data:o,index:s}),r({data:"",index:s}),$(s),z(s),u==="action"){let g=n[t[s].service][t[s].schema][o].validator.schema;f&&f.current&&f.current.reset(),r({data:o,index:s}),x({data:g.get.schema,index:s}),C({data:g.set.schema,index:s})}T({data:{},index:s}),localStorage.setItem("localTabsData",JSON.stringify(t))};return e(q,null,e("div",{className:"sidebar"},e("div",{className:"sidebar__sections-wrapper"},e("div",{className:"sidebar__section sidebar__section--services"},e("div",{className:"sidebar__section-heading"},"select services"),e(re,{onClickItem:o=>k(o,"service"),items:Object.keys(n),incomeActiveItem:t[s].service?t[s].service:null})),e("div",{className:"sidebar__section sidebar__section--schema"},e("div",{onClick:()=>{},className:"sidebar__section-heading"},"select schema"),e(re,{canShow:!D,onClickItem:o=>k(o,"schema"),items:D?Object.keys(n[t[s].service]):[],incomeActiveItem:t[s].schema?t[s].schema:null})),e("div",{className:"sidebar__section sidebar__section--act"},e("div",{className:"sidebar__section-heading"},"select action"),e(re,{canShow:!P,onClickItem:o=>k(o,"action"),items:P?Object.keys(n[t[s].service][t[s].schema]):[],incomeActiveItem:t[s].act?t[s].act:null})))),K&&e("div",{className:"sidebar sidebar--fields"},e("form",{ref:f,onSubmit:O,className:"form--fields"},e("div",{className:"sidebar__section-heading sidebar__section-heading--fields"},"SET fields"),Object.keys(t[s].postFields).map(o=>e("div",{className:"input-cnt",key:`${s}.${o}-----`},e("label",{htmlFor:o},o," :"),N({key:o,field:t[s].postFields[o],formData:t[s].formData}))),e("div",{className:"sidebar__section-heading sidebar__section-heading--fields"},"GET fields"),e("div",{className:"input-cnt get-items border-bottom"},e("label",null,"All Items :"),e("div",{className:"get-values"},e("span",{onClick:()=>{let o=l(null,"get",t[s].getFields,{});T({data:{...t[s].formData,...o},index:s})}}),e("span",{onClick:()=>{let o=l(0,"get",t[s].getFields,{});T({data:{...t[s].formData,...o},index:s})}},"0"),e("span",{onClick:()=>{let o=l(1,"get",t[s].getFields,{});T({data:{...t[s].formData,...o},index:s})}},"1"))),Object.keys(t[s].getFields).map(o=>t[s].getFields[o].type==="enums"?e("div",{className:"input-cnt get-items",key:`${s}.${o}-------`},e("label",{htmlFor:o},o,":"),e("div",{className:"get-values"},e("span",{onClick:()=>{T({data:{...t[s].formData,[`get.${o}`]:null},index:s})}}),e("span",{className:t[s].formData[`get.${o}`]===0?"active":"",onClick:()=>{T({data:{...t[s].formData,[`get.${o}`]:0},index:s})}},"0"),e("span",{className:t[s].formData[`get.${o}`]===1?"active":"",onClick:()=>{T({data:{...t[s].formData,[`get.${o}`]:1},index:s})}},"1"))):M({getField:t[s].getFields[o],keyName:o,margin:0})),e("div",{class:"wrapper"},e("button",{class:"send-button","data-active":W},e("span",null,"Send"),e("div",{class:"successe"},e(Re,null)))))),e("div",{className:"response"},t[s].response&&e("div",{class:"response-detail"},e("div",{className:"response-detail-button_title"},e("p",{className:"response-detail-title"},"Response"),e("div",{className:"response-detail-buttons"},e("div",{className:"btn response-detail-button ",onClick:()=>H()},e(pe,null),e("span",{className:"tooltip-text"},"Copy Request")),e("div",{className:"btn response-detail-button ",onClick:()=>{R()}},e(pe,null),e("span",{className:"tooltip-text"},"Copy Response")),e("div",{className:"btn response-detail-button ",onClick:()=>{E()}},e(ke,null),e("span",{className:"tooltip-text"},"Run E2E Test")))),e("div",{className:"response-detail-info"},e("div",{style:{display:"flex",flexDirection:"column"}}," ",e(A,{jsonData:{body:t[s].response?.body,success:t[s].response?.success}})),e("span",{className:"response-took"},"took:",de(t[s].response?.tookTime)),t[s].response&&t[s].response?.success===!0?e("div",{className:"success"}):e("div",{className:"fail"})))))};var bt=()=>e("svg",{width:"15px",height:"15px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M20.04 10.1109L18.0252 8.09612L21.7071 4.41421C22.0976 4.02369 22.0976 3.39052 21.7071 3L21 2.29289C20.6095 1.90237 19.9763 1.90237 19.5858 2.29289L15.9039 5.9748L14.04 4.11089C13.754 3.82489 13.3239 3.73933 12.9502 3.89411C12.5765 4.04889 12.3329 4.41353 12.3329 4.81799V10.818C12.3329 11.3703 12.7806 11.818 13.3329 11.818H19.3329C19.7373 11.818 20.102 11.5744 20.2568 11.2007C20.4115 10.827 20.326 10.3969 20.04 10.1109Z",fill:"bisque"}),e("path",{d:"M3.96 13.8891L5.97478 15.9039L2.29289 19.5858C1.90237 19.9763 1.90237 20.6095 2.29289 21L3 21.7071C3.39052 22.0976 4.02369 22.0976 4.41421 21.7071L8.0961 18.0252L9.96 19.8891C10.246 20.1751 10.6761 20.2607 11.0498 20.1059C11.4235 19.9511 11.6671 19.5865 11.6671 19.182V13.182C11.6671 12.6297 11.2194 12.182 10.6671 12.182H4.66711C4.26265 12.182 3.89801 12.4256 3.74323 12.7993C3.58845 13.173 3.674 13.6031 3.96 13.8891Z",fill:"bisque"})),Ye=bt;var gt=()=>e("svg",{width:"15px",height:"15px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M7.69233 18.2781L9.70711 20.2929C9.9931 20.5789 10.0787 21.009 9.92388 21.3827C9.7691 21.7564 9.40446 22 9 22H3C2.44772 22 2 21.5523 2 21V15C2 14.5955 2.24364 14.2309 2.61732 14.0761C2.99099 13.9213 3.42111 14.0069 3.70711 14.2929L5.571 16.1568L9.25289 12.4749C9.64342 12.0844 10.2766 12.0844 10.6671 12.4749L11.3742 13.182C11.7647 13.5725 11.7647 14.2057 11.3742 14.5962L7.69233 18.2781Z",fill:"bisque"}),e("path",{d:"M16.3077 5.72187L14.2929 3.70711C14.0069 3.42111 13.9213 2.99099 14.0761 2.61732C14.2309 2.24364 14.5955 2 15 2H21C21.5523 2 22 2.44772 22 3V9C22 9.40446 21.7564 9.7691 21.3827 9.92388C21.009 10.0787 20.5789 9.9931 20.2929 9.70711L18.429 7.84319L14.7471 11.5251C14.3566 11.9156 13.7234 11.9156 13.3329 11.5251L12.6258 10.818C12.2352 10.4275 12.2352 9.7943 12.6258 9.40378L16.3077 5.72187Z",fill:"bisque"})),We=gt;function Ie(){return e("svg",{width:25,height:25,fill:"#000000",viewBox:"0 0 24 24",id:"up-direction","data-name":"Line Color",xmlns:"http://www.w3.org/2000/svg",class:"icon line-color"},e("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"}),e("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"}),e("g",{id:"SVGRepo_iconCarrier"},e("path",{id:"secondary",d:"M10,9.66V20a1,1,0,0,0,1,1h2a1,1,0,0,0,1-1V9.66",style:"fill: none; stroke: darkred; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2;"}),e("path",{id:"primary",d:"M14,9.66l3.4,2.92,2.6-3-7.35-6.3a1,1,0,0,0-1.3,0L4,9.54l2.6,3L10,9.66",style:"fill: none; stroke: darkred; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2;"})))}var yt=a=>{let[s,t]=S("myBtn none"),[n,i]=S(!1),m=J(null),c=()=>{m.current.scroll,document.getElementById("modal")?.scroll({top:0,behavior:"smooth"})},d=r=>{r.currentTarget.scrollTop>20?t("myBtn"):t("none")};return e("div",{className:"modal-overlay",onClick:a.toggle},e("div",{className:n?"modal-box-fullscreen":"modal-box",onClick:r=>r.stopPropagation()},e("div",{className:"action-modal"},e("span",{className:"modal-close",onClick:a.toggle},e(U,null)),e("span",{className:"modal-fullscreen",onClick:()=>i(!n)},n?e(Ye,null):e(We,null)),e("span",{className:"modal-title"},a.title)),e("div",{className:"modal-content",id:"modal",ref:m,onScroll:d},a.children,e("div",{className:s},e("button",{className:"myBtn-active tooltip",onClick:()=>c()},e(Ie,null),e("span",{className:"tooltip-text"},"Go To Top"))))))},Ke=yt;var Xe=()=>{let{schemasObj:a}=j(),[s,t]=S({});B(()=>{let d={};for(let r in a){d[r]={...d[r],pure:a[r].pure};for(let C in a[r].mainRelations)d[r]={...d[r],mainRelations:{...d[r].mainRelations,[C]:{type:"relation",extraDetails:a[r].mainRelations[C],schema:{...a[a[r].mainRelations[C].schemaName].pure}}}};for(let C in a[r].relatedRelations)d[r]={...d[r],relatedRelations:{...d[r].relatedRelations,[C]:{type:"relation",extraDetails:a[r].relatedRelations[C],schema:{...a[a[r].relatedRelations[C].schemaName].pure}}}}}t(d)},[]);let n=()=>{let d=`data:text/json;chatset=utf-8,${encodeURIComponent(JSON.stringify(a))}`,r=document.createElement("a");r.href=d,r.download="schemas.json",r.click()},i=["color-1","color-2","color-3","color-4","color-5","color-6","color-7"],m=d=>Object.keys(d).map(r=>{let C=h();return e("div",{className:"schema"},e("div",{className:"schema-name",onClick:()=>{document.getElementById(C)?.classList.toggle("open")}},e("p",{className:"schema-title"},r),e("span",null,"...")),e("div",{className:"proceed-child-container",id:C},c(d[r])))}),c=d=>Object.keys(d).map(r=>{let C=h();return e("div",{className:`inside-schema ${i[Math.floor(Math.random()*i.length)]}`},e("div",{className:`inside ${typeof d[r]=="object"&&d[r].schema!==null&&"schema-pointer"}`,onClick:()=>{document.getElementById(C)?.classList.toggle("open")}},e("p",{className:"schema-title"},r),e("div",{className:"schema-info"}," ",e("p",{className:"schema-title schema-type"}," ",d[r].type),e("div",{className:"schema-help"},d[r].extraDetails&&e(ne,null),d[r].extraDetails&&e("div",{className:" tooltip-text"},e(A,{jsonData:d[r].extraDetails}))),typeof d[r]=="object"&&d[r].schema!==null&&e("span",null,"..."))),e("div",{id:C,className:"proceed-child"},typeof d[r]=="object"&&d[r]!==null&&d[r].schema!==null&&c(d[r].pure?d[r].pure:d[r].relatedRelations?d[r].relatedRelations:d[r].mainRelation?d[r].mainRelation:d[r].type==="relation"?d[r].schema:d[r])))});return e("div",{className:"schema-modal"},e("div",{className:"results-buttons"},e("button",{className:" schema-export-button btn e2e-back-button e2e-export_results-button",onClick:n},e(G,null),e("span",null,"Export"))),e("div",{className:"search-box"},e("input",{className:"input",type:"text",placeholder:"search..."}),e("span",{className:"search-icon"},e(te,null))),e("div",{className:"schema-list"},m(s)))};function me(){return e("svg",{width:25,height:25,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M7.75 11.9999L10.58 14.8299L16.25 9.16992",stroke:"lightcoral","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})," ",e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12ZM3.00683 12C3.00683 16.9668 7.03321 20.9932 12 20.9932C16.9668 20.9932 20.9932 16.9668 20.9932 12C20.9932 7.03321 16.9668 3.00683 12 3.00683C7.03321 3.00683 3.00683 7.03321 3.00683 12Z",fill:"bisque"}))}function Qe({configUrl:a}){let s=r=>{i[r],i.splice(r,1),m([...i])},{headers:t,setHeader:n}=j(),[i,m]=S([{key:"",value:""}]),[c,d]=S("");return B(()=>{let r=[];for(let C in t)r.push({key:C,value:t[C]});m(r)},[]),e("div",{className:"setting modal-content"},e("div",{className:"url"},e("p",{className:"url-title"},"Fetch Config"),e("div",{className:"url-detail"}," ",e("input",{className:"input url-input ",placeholder:"Set URL",onChange:r=>d(r.target.value)}),e("button",{className:"setting_fetch-config--apply-button e2e-back-button e2e-add-capture ",onClick:()=>a(c)},e(me,null),e("span",null,"Apply")," "))),e("div",{className:"sidebar__section sidebar__section--headers"},e("div",{className:"sidebar__section-heading setting_heading"}," ",e("span",{className:"setting_heading--title"},"Set Headers"),e("button",{className:"setting_add-header--button e2e-back-button e2e-export_results-button e2e-add-capture ",onClick:()=>{m([...i,{key:"",value:""}])}},e(ae,null),e("span",null,"Add Header"))),e("div",{className:"setting_container--setheaders"},e("div",{className:"setting_set-headers"},i?.map((r,C)=>e("div",{key:`${C}____`,className:"setting_set-headers--inputs"},e("div",{className:"setting__set-headers--key-value setting__set-headers--key"},e("span",null,"Key:"),e("input",{className:"setting_set-headers--inputs--key input",placeholder:"Authotization",value:r.key,onChange:x=>{m(T=>(T[C].key=x.target.value,T))}})),e("div",{className:"setting__set-headers--key-value setting__set-headers--value"},e("span",null,"Value:"),e("input",{className:"setting_set-headers--inputs--value input",placeholder:"some string ...",value:r.value,onChange:x=>{m(T=>(T[C].value=x.target.value,T))}})),i.length>1&&e("div",{className:"setting_set-headers--delete-button e2e-move-div e2e-move-close",onClick:()=>s(C)},e(U,null))))),e("button",{className:"setting_set-headers--apply-button e2e-back-button e2e-add-capture ",onClick:()=>{let r={};for(let C of i){let{key:x,value:T}=C;r[x]=T}n(r)}},e(me,null),e("span",null,"Apply")))))}var Ct=({baseUrl:a})=>fetch(`${a}playground/static/get/schemas`).then(s=>s.json()),et=()=>{let{tabsData:a,setTabsData:s,activeTab:t,actsObj:n,addTab:i,setActiveTab:m,setService:c,setSchema:d,setAct:r,setPostFields:C,setGetFields:x,setFormData:T,setHistory:w,setResponse:F,resetGetFields:$,closeTab:z,resetPostFields:Z,setSchemasObj:Y,setActsObj:W,setModal:V,modal:l}=j(),[f,y]=S(""),[N,M]=S(!1),p=()=>window&&window.location?`${new URL(window.location.href).origin}/`:"http://localhost:1366/",[O,K]=S(""),P=Q(()=>{M(!1)});B(()=>{R(p());let k=JSON.parse(localStorage.getItem("localHistory"));k&&w(k)},[]);let R=k=>{k&&K(k),c({data:"",index:t}),d({data:"",index:t}),$(t),Z(t),T({data:{},index:t}),Ct({baseUrl:k||O}).then(({schemas:o,acts:u})=>{W(u),Y(o);let g=localStorage.getItem("localTabsData");if(g){g=JSON.parse(g);let v=[],_=b=>{v.pop();let L=ce(b.formData);for(let ee in L.set)u[b.service][b.schema][b.act].validator.schema.set.schema[ee]===void 0&&delete L.set[ee];for(let ee in L.get)u[b.service][b.schema][b.act].validator.schema.get.schema[ee]===void 0&&delete L.get[ee];let X=le(L,{},"");b.postFields=u[b.service][b.schema][b.act].validator.schema.set.schema,b.getFields=u[b.service][b.schema][b.act].validator.schema.get.schema,v.push({...b,formData:X})};for(let b of g)b.service&&b.service in u&&v.push(b),b.schema&&!(b.schema in u[b.service])&&v.pop(),b.act&&!(b.act in u[b.service][b.schema])&&v.pop(),b.service&&b.schema&&b.act&&b.act in u[b.service][b.schema]&&_(b);v.length<1&&v.push({service:"",schema:"",act:"",postFields:{},getFields:{},formData:{},response:null}),s(v)}})},H=()=>{V(null)},E=k=>{c({data:k.body.service,index:t}),d({data:k.body.model,index:t}),r({data:k.body.act,index:t});let o=n[k.body.service][k.body.model][k.body.act].validator.schema;x({data:o.get.schema,index:t}),C({data:o.set.schema,index:t}),F({data:null,index:t});let u=le(k.body.details,{},"");T({data:u,index:t}),H()};return e("div",{className:"cnt"},e("div",{className:"tabs-container",style:{display:"flex"}},a.map((k,o)=>e(q,null,e("div",{className:"tab-name","data-tab":t===o,onClick:()=>{m(o)}}," ",e("span",{title:a[o].act?`${a[o].schema} | ${a[o].act}`:a[o].schema?`${a[o].service} | ${a[o].schema}`:a[o].service?a[o].service:`Tab ${o}`}," ",a[o].act?`${a[o].schema} | ${a[o].act}`:a[o].schema?`${a[o].service} | ${a[o].schema}`:a[o].service?a[o].service:`Tab ${o}`),e("span",{className:` tab-close ${t===o?"active-tab-close":""}`,onClick:u=>{u.stopPropagation(),z(o)},title:"Close tab"},"x")))),e("span",{className:"add-tab",title:"Open a new tab",onClick:()=>{i(null),localStorage.setItem("localTabsData",JSON.stringify(a))}},"+")),e(ze,{urlAddress:O}),e("button",{ref:P,className:"media--main-btn-wrapper ",onClick:()=>{M(!N)}},"menu"),e("div",{className:"main-btn-wrapper","data-show":N===!0},e("span",{className:"btn btn-modal ",onClick:()=>R()},e("span",{className:"btn-modal-title"},"Refetch"),e(Ee,null)),e("span",{className:"btn btn-modal ",onClick:()=>V("SETTING")},e("span",{className:"btn-modal-title"},"Setting"),e(xe,null)),e("span",{className:"btn btn-modal",onClick:()=>V("HISTORY")},e("span",{className:"btn-modal-title"},"History"),e(Ne,null)),e("span",{className:"btn btn-modal",onClick:()=>V("E2E TEST")},e("span",{className:"btn-modal-title"},"E2E Test"),e(we,null)),e("span",{className:" btn-modal-document","data-show":f==="document"},e("span",{className:"btn-modal-document--title","data-show":f==="document"},"Document")),e("span",{className:"btn btn-modal btn-doc",onClick:()=>V("SCHEMA"),onMouseEnter:()=>y("document"),onMouseLeave:()=>y("")},e("span",{className:"btn-modal-title"},"Schema"),e(_e,null)),e("span",{className:"btn btn-modal btn-doc ",onClick:()=>V("ACT"),onMouseEnter:()=>y("document"),onMouseLeave:()=>y("")},e("span",{className:"btn-modal-title"},"Act"),e(Se,null))),l!==null&&e(Ke,{toggle:H,title:l},l==="HISTORY"?e(Ge,{setFormFromHistory:E}):l==="SETTING"?e(Qe,{configUrl:R}):l==="E2E TEST"?e(Ze,{baseUrl:O}):l==="SCHEMA"?e(Xe,null):l==="ACT"?e(he,null):e(q,null)))};De(e(He,null,e(et,null)),document.getElementById("root")); //# sourceMappingURL=bundle-es.js.map diff --git a/src/server/playground/dist/bundle-es.js.map b/src/server/playground/dist/bundle-es.js.map index 6fbf4abf..f5fd7b1e 100644 --- a/src/server/playground/dist/bundle-es.js.map +++ b/src/server/playground/dist/bundle-es.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../reactDeps.ts", "../utils/uid.ts", "../comp/context/initials.ts", "../comp/context/reducer.ts", "../comp/context/provider.tsx", "../comp/ManagedLesanContext.tsx", "../utils/createNestedObjectsFromKeys.ts", "../utils/generateFormData.ts", "../comp/icon/Search.tsx", "../comp/icon/ExportIcon.tsx", "../comp/Act.tsx", "../comp/icon/BackIcon.tsx", "../comp/Help.tsx", "../comp/icon/AddIcon.tsx", "../comp/icon/deleteIcon.tsx", "../comp/icon/DownIcon.tsx", "../comp/icon/HelpIcon.tsx", "../comp/icon/ImportIcon.tsx", "../comp/icon/RunIcon.tsx", "../comp/icon/UpIcon.tsx", "../comp/styles.ts", "../comp/cutify.ts", "../comp/JSONVeiwer.tsx", "../comp/icon/InfoIcon.tsx", "../comp/ResultSlider.tsx", "../comp/SequenceSlider.tsx", "../comp/E2E.tsx", "../utils/convertMilliseconds.ts", "../comp/hooks/useNonInitialEffect.ts", "../comp/icon/DustbinIcon.tsx", "../comp/History.tsx", "../comp/icon/DocumentIcon.tsx", "../comp/icon/HistoryIcon.tsx", "../comp/icon/ReFetchIcon.tsx", "../comp/icon/SchemaIcon.tsx", "../comp/icon/SettingIcon.tsx", "../comp/icon/TestIcon.tsx", "../comp/icon/CopyIcon.tsx", "../comp/icon/RunTestIcon.tsx", "../comp/icon/SuccessIcon.tsx", "../comp/hooks/useOutsideClick.ts", "../comp/icon/ChevronDownIcon.tsx", "../comp/Selected.tsx", "../comp/MultiSelect.tsx", "../comp/Main.tsx", "../comp/icon/Fullscreen-exit.tsx", "../comp/icon/Fullscreen.tsx", "../comp/icon/Up2Icon.tsx", "../comp/Modal.tsx", "../comp/Schema.tsx", "../comp/icon/TickIcon.tsx", "../comp/Setting.tsx", "../comp/preact.tsx", "../hydrate.tsx"], - "sourcesContent": ["export {\n createContext,\n Fragment,\n h,\n hydrate,\n} from \"https://esm.sh/preact@10.5.15\";\nexport {\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useReducer,\n useRef,\n useState,\n \n} from \"https://esm.sh/preact@10.5.15/hooks\";\n\nexport type {\n FunctionalComponent,\n RefCallback,\n RefObject,\n} from \"https://esm.sh/preact@10.5.15\";\n\nexport type { Ref, EffectCallback, StateUpdater } from \"https://esm.sh/preact@10.5.15/hooks\";\n", "export const uid = () =>\n Date.now().toString(36) + Math.random().toString(36).substr(2);\n", "import { uid } from \"../../utils/uid.ts\";\nimport { IState } from \"./actionType.ts\";\n\nconst tabInitial = {\n tabsData: [\n {\n service: \"\",\n schema: \"\",\n act: \"\",\n postFields: {},\n getFields: {},\n formData: {},\n response: null,\n },\n ],\n activeTab: 0,\n setActiveTab: () => ({}),\n addTab: () => ({}),\n closeTab: () => ({}),\n setTabsData: () => ({}),\n};\n\nconst schemaInitial = {\n schemasObj: {},\n actsObj: {},\n\n setService: () => ({}),\n setMethod: () => ({}),\n setSchema: () => ({}),\n setAct: () => ({}),\n setActsObj: () => ({}),\n setSchemasObj: () => ({}),\n setPostFields: () => ({}),\n resetPostFields: () => ({}),\n setGetFields: () => ({}),\n resetGetFields: () => ({}),\n setFormData: () => ({}),\n setResponse: () => ({}),\n};\n\nconst historyInitial = {\n history: [],\n\n deleteItemHistory: () => ({}),\n\n setHistory: () => ({}),\n};\n\nconst headerInitial = {\n headers: { Authorization: \"\" },\n setHeader: () => ({}),\n};\n\nexport const e2eFirstInp = () => ({\n id: uid(),\n bodyHeaders: `\n{\n \"headers\": {\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"\"\n },\n \"body\": {\n \"service\": \"main\",\n \"contents\": \"dynamic\",\n \"model\": \"\",\n \"act\": \"\"\n \"details\": {\n \"get\": {\n },\n \"set\": {\n }\n }\n}\n}\n `,\n repeat: 1,\n captures: [],\n});\n\nconst e2eInitial = {\n e2eForms: [e2eFirstInp()],\n\n setE2eForms: () => ({}),\n addE2eForm: () => ({}),\n};\n\nconst modalInitial = {\n modal: null,\n setModal: () => ({}),\n};\n\n// TODO: Have to Find Someway to Prevent from Rewriting Function Types\nexport const initialState: IState = {\n ...tabInitial,\n ...schemaInitial,\n ...historyInitial,\n ...headerInitial,\n ...e2eInitial,\n ...modalInitial,\n};\n", "import { ACTION_TYPE, IState, TAction } from \"./actionType.ts\";\n\nexport function lesanReducer(state: IState, action: TAction): IState {\n const { type, payload } = action;\n switch (type) {\n case ACTION_TYPE.SET_SERVICE: {\n const copyTabsData = [...state.tabsData];\n copyTabsData[payload.index] = {\n ...copyTabsData[payload.index],\n service: payload.data,\n };\n return {\n ...state,\n tabsData: [...copyTabsData],\n };\n }\n case ACTION_TYPE.SET_SCHEMA: {\n const copyTabsData = [...state.tabsData];\n copyTabsData[payload.index] = {\n ...copyTabsData[payload.index],\n schema: payload.data,\n };\n return {\n ...state,\n tabsData: [...copyTabsData],\n };\n }\n case ACTION_TYPE.SET_ACT: {\n const copyTabsData = [...state.tabsData];\n copyTabsData[payload.index] = {\n ...copyTabsData[payload.index],\n act: payload.data,\n };\n return {\n ...state,\n tabsData: [...copyTabsData],\n };\n }\n case ACTION_TYPE.SET_POST_FIELDS: {\n const copyTabsData = [...state.tabsData];\n copyTabsData[payload.index] = {\n ...copyTabsData[payload.index],\n postFields: payload.data,\n };\n return {\n ...state,\n tabsData: [...copyTabsData],\n };\n }\n case ACTION_TYPE.RESET_POST_FIELDS: {\n const copyTabsData = [...state.tabsData];\n copyTabsData[payload] = { ...copyTabsData[payload], postFields: {} };\n return {\n ...state,\n tabsData: [...copyTabsData],\n };\n }\n case ACTION_TYPE.SET_GET_FIELDS: {\n const copyTabsData = [...state.tabsData];\n copyTabsData[payload.index] = {\n ...copyTabsData[payload.index],\n getFields: payload.data,\n };\n return {\n ...state,\n tabsData: [...copyTabsData],\n };\n }\n case ACTION_TYPE.RESET_GET_FIELDS: {\n const copyTabsData = [...state.tabsData];\n copyTabsData[payload] = { ...copyTabsData[payload], getFields: {} };\n return {\n ...state,\n tabsData: [...copyTabsData],\n };\n }\n case ACTION_TYPE.SET_FORM_DATA: {\n const copyTabsData = [...state.tabsData];\n copyTabsData[payload.index] = {\n ...copyTabsData[payload.index],\n formData: payload.data,\n };\n return {\n ...state,\n tabsData: [...copyTabsData],\n };\n }\n case ACTION_TYPE.SET_HEADER: {\n return {\n ...state,\n headers: payload,\n };\n }\n case ACTION_TYPE.SET_HISTORY: {\n return {\n ...state,\n history: payload,\n };\n }\n\n case ACTION_TYPE.SET_TABS_DATA: {\n return {\n ...state,\n tabsData: payload,\n };\n }\n\n case ACTION_TYPE.SET_RESPONSE: {\n const copyTabsData = [...state.tabsData];\n copyTabsData[payload.index] = {\n ...copyTabsData[payload.index],\n response: payload.data,\n };\n return {\n ...state,\n tabsData: [...copyTabsData],\n };\n }\n case ACTION_TYPE.ADD_TAB: {\n return {\n ...state,\n tabsData: [\n ...state.tabsData,\n {\n service: \"\",\n schema: \"\",\n act: \"\",\n postFields: {},\n getFields: {},\n formData: {},\n response: null,\n },\n ],\n activeTab: state.tabsData.length,\n };\n }\n case ACTION_TYPE.SET_ACTIVE_TAB: {\n return {\n ...state,\n activeTab: payload,\n };\n }\n case ACTION_TYPE.CLOSE_TAB: {\n const copyTabsData = [...state.tabsData];\n copyTabsData.length > 1 && copyTabsData.splice(payload, 1);\n return {\n ...state,\n tabsData: [...copyTabsData],\n activeTab: copyTabsData.length >= 1 &&\n state.activeTab >= payload &&\n state.activeTab !== 0\n ? state.activeTab - 1\n : state.activeTab,\n };\n }\n\n case ACTION_TYPE.DELETE_ITEM_HISTORY: {\n return {\n ...state,\n history: state.history\n .slice(0, payload)\n .concat(state.history.slice(payload + 1)),\n };\n }\n\n case ACTION_TYPE.SET_ACTS_OBJ: {\n return {\n ...state,\n actsObj: payload,\n };\n }\n case ACTION_TYPE.SET_SCHEMAS_OBJ: {\n return {\n ...state,\n schemasObj: payload,\n };\n }\n case ACTION_TYPE.SET_E2E_FORMS: {\n return {\n ...state,\n e2eForms: payload,\n };\n }\n case ACTION_TYPE.ADD_E2E_FORM: {\n return {\n ...state,\n e2eForms: [...state.e2eForms, payload],\n };\n }\n case ACTION_TYPE.OPEN_MODAL: {\n return {\n ...state,\n modal: payload,\n };\n }\n default:\n throw new Error(`Unhandled action type`);\n }\n}\n", "/** @jsx h */\nimport { h, useMemo } from \"../../reactDeps.ts\";\nimport { createContext } from \"../../reactDeps.ts\";\nimport { useCallback } from \"../../reactDeps.ts\";\nimport { useReducer } from \"../../reactDeps.ts\";\nimport { E2eForm, IState, MODAL_TYPES } from \"./actionType.ts\";\nimport { TObjectArray } from \"./actionType.ts\";\nimport { THistory } from \"./actionType.ts\";\nimport { TTabsData } from \"./actionType.ts\";\nimport { ACTION_TYPE } from \"./actionType.ts\";\nimport { initialState } from \"./initials.ts\";\nimport { lesanReducer } from \"./reducer.ts\";\n\nexport const LesanContext = createContext(initialState);\n\nexport const LesanProvider = (props: any) => {\n const [state, dispatch] = useReducer(lesanReducer, initialState);\n\n const setService = useCallback(\n (payload: { data: string; index: number }) =>\n dispatch({ type: ACTION_TYPE.SET_SERVICE, payload }),\n [dispatch],\n );\n\n const setSchema = useCallback(\n (payload: { data: string; index: number }) =>\n dispatch({ type: ACTION_TYPE.SET_SCHEMA, payload }),\n [dispatch],\n );\n\n const setAct = useCallback(\n (payload: { data: string; index: number }) =>\n dispatch({ type: ACTION_TYPE.SET_ACT, payload }),\n [dispatch],\n );\n\n const setPostFields = useCallback(\n (payload: { data: string; index: number }) =>\n dispatch({ type: ACTION_TYPE.SET_POST_FIELDS, payload }),\n [dispatch],\n );\n\n const resetPostFields = useCallback(\n (payload: number) =>\n dispatch({ type: ACTION_TYPE.RESET_POST_FIELDS, payload }),\n [dispatch],\n );\n\n const setGetFields = useCallback(\n (payload: { data: string; index: number }) =>\n dispatch({ type: ACTION_TYPE.SET_GET_FIELDS, payload }),\n [dispatch],\n );\n\n const resetGetFields = useCallback(\n (payload: number) =>\n dispatch({ type: ACTION_TYPE.RESET_GET_FIELDS, payload }),\n [dispatch],\n );\n\n const setFormData = useCallback(\n (payload: { data: any; index: number }) =>\n dispatch({ type: ACTION_TYPE.SET_FORM_DATA, payload }),\n [dispatch],\n );\n\n const setActiveTab = useCallback(\n (payload: number) =>\n dispatch({ type: ACTION_TYPE.SET_ACTIVE_TAB, payload }),\n [dispatch],\n );\n\n const addTab = useCallback(\n (payload: null) => dispatch({ type: ACTION_TYPE.ADD_TAB, payload }),\n [dispatch],\n );\n\n const closeTab = useCallback(\n (payload: number) => dispatch({ type: ACTION_TYPE.CLOSE_TAB, payload }),\n [dispatch],\n );\n\n const deleteItemHistory = useCallback(\n (payload: number) =>\n dispatch({ type: ACTION_TYPE.DELETE_ITEM_HISTORY, payload }),\n [dispatch],\n );\n\n const setHeader = useCallback(\n (payload: TObjectArray) =>\n dispatch({ type: ACTION_TYPE.SET_HEADER, payload }),\n [dispatch],\n );\n\n const setHistory = useCallback(\n (payload: THistory[]) =>\n dispatch({ type: ACTION_TYPE.SET_HISTORY, payload }),\n [dispatch],\n );\n\n const setTabsData = useCallback(\n (payload: TTabsData[]) =>\n dispatch({ type: ACTION_TYPE.SET_TABS_DATA, payload }),\n [dispatch],\n );\n\n const setResponse = useCallback(\n (payload: { data: any; index: number }) =>\n dispatch({ type: ACTION_TYPE.SET_RESPONSE, payload }),\n [dispatch],\n );\n\n const setSchemasObj = useCallback(\n (payload: Record) =>\n dispatch({ type: ACTION_TYPE.SET_SCHEMAS_OBJ, payload }),\n [dispatch],\n );\n const setActsObj = useCallback(\n (payload: Record) =>\n dispatch({ type: ACTION_TYPE.SET_ACTS_OBJ, payload }),\n [dispatch],\n );\n\n const setE2eForms = useCallback(\n (payload: E2eForm[]) =>\n dispatch({ type: ACTION_TYPE.SET_E2E_FORMS, payload }),\n [dispatch],\n );\n\n const addE2eForm = useCallback(\n (payload: E2eForm) => dispatch({ type: ACTION_TYPE.ADD_E2E_FORM, payload }),\n [dispatch],\n );\n const setModal = useCallback(\n (payload: MODAL_TYPES | null) =>\n dispatch({ type: ACTION_TYPE.OPEN_MODAL, payload }),\n [dispatch],\n );\n\n const value = useMemo(\n () => ({\n ...state,\n setService,\n setSchema,\n setAct,\n setPostFields,\n resetPostFields,\n setGetFields,\n resetGetFields,\n setFormData,\n setHeader,\n setHistory,\n setTabsData,\n setResponse,\n setActsObj,\n setSchemasObj,\n setActiveTab,\n addTab,\n closeTab,\n deleteItemHistory,\n setE2eForms,\n addE2eForm,\n setModal,\n }),\n [state],\n );\n\n return ;\n};\n", "/** @jsx h */\nimport { h, useContext } from \"../reactDeps.ts\";\nimport { LesanContext, LesanProvider } from \"./context/provider.tsx\";\n\nconst useLesan = () => {\n const context = useContext(LesanContext);\n if (context === undefined) {\n console.warn(`useLesan must be used within a LesanProvider`);\n }\n return context;\n};\n\nconst ManagedLesanContext = (props: { children: h.JSX.Element }) => {\n const { children } = props;\n\n return {children};\n};\n\nexport { ManagedLesanContext, useLesan };\n", "export const createNestedObjectsFromKeys = (\n obj: Record,\n): Record => {\n const result: Record = { get: {}, set: {} };\n\n // For each object path (property key) in the object\n for (const objectPath in obj) {\n if (obj[objectPath] || obj[objectPath] === 0) {\n // Split path into component parts\n const parts = objectPath.split(\".\");\n\n // Create sub-objects along path as needed\n let target: Record = result;\n while (parts.length > 1) {\n const part = parts.shift()!;\n target[part] = target[part] || {};\n target = target[part];\n }\n\n // Set value at end of path\n target[parts[0]] = obj[objectPath];\n }\n }\n\n return result;\n};\n", "export const generateFormData = (\n formData: Record,\n returnFormData: Record,\n keyname: string,\n) => {\n for (const key in formData) {\n typeof formData[key] === \"object\"\n ? generateFormData(\n formData[key],\n returnFormData,\n keyname ? `${keyname}.${key}` : key,\n )\n : (returnFormData[`${keyname}.${key}`] = formData[key]);\n }\n return returnFormData;\n};\n", "/** @jsx h */\nimport { h } from \"../../reactDeps.ts\";\n\nexport default function Search() {\n return (\n \n \n \n );\n};\n\n", "/** @jsx h */\nimport { h } from \"../../reactDeps.ts\";\n\nexport default function ExportIcon() {\n return (\n \n \n\n \n \n );\n}\n", "/** @jsx h */\nimport { Fragment, h, useEffect, useState } from \"../reactDeps.ts\";\nimport { useLesan } from \"./ManagedLesanContext.tsx\";\nimport Search from \"./icon/Search.tsx\";\nimport { uid } from \"../utils/uid.ts\";\nimport ExportIcon from \"./icon/ExportIcon.tsx\";\n\nexport function Act() {\n const { actsObj } = useLesan();\n const exportActs = () => {\n const jsonString = `data:text/json;chatset=utf-8,${\n encodeURIComponent(\n JSON.stringify(actsObj),\n )\n }`;\n const link = document.createElement(\"a\");\n link.href = jsonString;\n link.download = \"acts.json\";\n\n link.click();\n };\n\n const rainbowClass = [\n \"color-1\",\n \"color-2\",\n \"color-3\",\n \"color-4\",\n \"color-5\",\n \"color-6\",\n \"color-7\",\n ];\n\n const proceedActs = (acts: Record) => {\n return Object.keys(acts).map((act: any, index) => {\n const newUid = uid();\n return (\n
\n {\n document.getElementById(newUid)?.classList.toggle(\"open\");\n }}\n >\n

{act}

\n ...\n
\n
\n {proceedChildActs(actsObj[act])}\n
\n \n );\n });\n };\n\n const proceedChildActs = (childActs: Record) => {\n return Object.keys(childActs).map((childAct: any, index) => {\n const newUid = uid();\n\n if (childActs[childAct] || childActs[childAct] === 0) {\n return (\n \n {\n document.getElementById(newUid)?.classList.toggle(\"open\");\n }}\n >\n

{childAct}

\n {childActs[childAct].type && (\n

\n {childActs[childAct].type}\n

\n )}\n
\n {\" \"}\n {typeof childActs[childAct] === \"object\" &&\n childActs[childAct].schema !== null && ...}\n
\n \n
\n {typeof childActs[childAct] === \"object\" &&\n childActs[childAct] !== null &&\n childActs[childAct].schema !== null &&\n proceedChildActs(\n childActs[childAct].validator\n ? childActs[childAct].validator.schema\n : childActs[childAct].schema\n ? childActs[childAct].schema\n : childActs[childAct],\n )}\n
\n \n );\n }\n });\n };\n\n return (\n
\n {\" \"}\n
\n \n \n Export\n \n
\n
\n \n \n \n \n
\n
{proceedActs(actsObj)}
\n
\n );\n}\n", "/** @jsx h */\nimport { h } from \"../../reactDeps.ts\";\n\nexport default function BackIcon() {\n return (\n \n \n \n\n \n \n );\n}\n", "/** @jsx h */\n// import { StateUpdater } from \"https://esm.sh/v118/preact@10.5.15/hooks/src/index.js\";\nimport { StateUpdater, h, useState } from \"../reactDeps.ts\";\nimport BackIcon from \"./icon/BackIcon.tsx\";\n\ninterface IHelpProps {\n setView: StateUpdater<\"help\" | \"e2e\" | \"result\">;\n}\n\nexport const Help = ({setView}: IHelpProps) => {\n return (\n
\n {\" \"}\n {\n setView(\"e2e\");\n }}\n >\n \n Back\n \n
\n

\n With E2E Test, you can test the whole application by sending a\n sequence of HTTP requests.\n

\n

\n In the image below, you can see the first view of the E2E test\n modal page, which contains a button bar at the top and two\n separate requests.\n

\n \n\n
\n\n

\n In the button bar, you have these buttons:\n \n

    \n
  • Add: This button adds one request section.
  • \n
  • \n Run E2E Test: This button runs all requests and shows their\n results.\n
  • \n
  • \n Import: This button stands for importing an E2E config in JSON\n format.\n
  • \n
  • \n Export: This button stands for exporting an existing E2E\n config in JSON format.\n
  • \n
  • \n Help: This button switches to the help of the E2E modal page.\n
  • \n
\n

\n\n
\n\n
\n

Each request section have 2 side

\n \n\n
\n\n
\n

\n The right side is a set of configurations for the repeat time\n of each request and capturing variables of the request\n response. In the Capture Variables section, you can add a pair\n of tuple inputs for the key name of the capture variable and\n its value. You can capture the value of a capture variable\n with braces syntax. For example, if you get back this response\n from a request:\n

\n                    {\"{\\n\"}\n                    {\"  body: [\\n\"}\n                    {\"    {\\n\"}\n                    {\"      _id: 64c6839c50adc3cb65726934,\\n\"}\n                    {\"      name: \u0647\u0645\u062F\u0627\u0646,\\n\"}\n                    {\"      enName: Hamedan,\\n\"}\n                    {\"      abb: HM\\n\"}\n                    {\"    }\\n\"}\n                    {\"  ],\\n\"}\n                    {\"  success: true\\n\"}\n                    {\"  }\\n\"}\n                    {\"}\\n\"}\n                  
\n You can capture _id with [body][0][_id] or for name:\n [body][0][name].\n

\n \n
\n\n
\n\n
\n \n

\n The left side is a text area for writing headers and the body\n of the request in JSON format. In this text area, you can use\n a text parser to implement the captured value you captured\n before inside these symbols {\"{}\"}.\n

\n
\n\n
\n\n

\n Also, we have some buttons on the top right side of each request\n section. With these buttons, you can move up and down and delete\n requests.\n \n

\n
\n\n
\n\n
\n

\n After clicking on the Run E2E Test button, you can see the\n result of each test. Also, in the result view, you can export\n the results in JSON format.\n

\n \n
\n\n
\n\n
\n

\n Additionally, you can go to the E2E Test modal page from the\n main page by clicking on the Test icon inside the response\n header section. This way, you can add a new test section and\n prepopulate the Header and Body text areas with the sent request\n from the main page.\n \n

\n
\n
\n
\n )\n}", "/** @jsx h */\nimport { h } from \"../../reactDeps.ts\";\n\nexport default function AddIcon() {\n return (\n \n \n \n \n );\n}\n", "/** @jsx h */\nimport { h } from \"../../reactDeps.ts\";\n\nconst DeleteIcon = () => {\n return (\n \n \n \n \n );\n};\n\nexport default DeleteIcon;\n", "/** @jsx h */\nimport { h } from \"../../reactDeps.ts\";\n\nexport default function DownIcon() {\n return (\n \n \n \n \n );\n}\n", "/** @jsx h */\nimport { h } from \"../../reactDeps.ts\";\n\nexport default function HelpIcon() {\n return (\n \n \n\n \n \n );\n}\n", "/** @jsx h */\nimport { h } from \"../../reactDeps.ts\";\n\nexport default function ImportIcon() {\n return (\n \n \n\n \n \n );\n}\n", "/** @jsx h */\nimport { h } from \"../../reactDeps.ts\";\n\nexport default function RunIcon() {\n return (\n \n \n \n \n \n );\n}\n", "/** @jsx h */\nimport { h } from \"../../reactDeps.ts\";\n\nexport default function UpIcon() {\n return (\n \n \n \n \n );\n}\n", "export enum ClassNames {\n string = \"cute-string\",\n undefined = \"cute-undefined\",\n function = \"cute-function\",\n number = \"cute-number\",\n boolean = \"cute-boolean\",\n null = \"cute-null\",\n colon = \"cute-colon\",\n key = \"cute-key\",\n}\n\nexport const pre = {\n fontFamily: '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Helvetica, Arial',\n // fontSize: 15,\n // lineHeight: \"20px\",\n display: \"inline-block\",\n borderRadius: 3,\n padding: \"10px 10px\",\n // background: \"#272822\",\n color: \"#f8f8f2\",\n textShadow: \"1px 1px black\",\n // overflow: \"auto\",\n whiteSpace: \"pre-wrap\",\n // margin:'0'\n // width:'100%',\n};\n", "import { ClassNames } from \"./styles.ts\";\n\nconst regEx =\n /(\"(\\\\u[a-zA-Z0-9]{4}|\\\\[^u]|[^\\\\\"])*\"(\\s*:)?|\\b(true|false|null)\\b|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)/g;\nconst syntaxHighlight = (json: Object): string => {\n const jsonString = JSON.stringify(json, replacer, 2)\n .replace(/&/g, \"&\")\n .replace(//g, \">\");\n\n return jsonString.replace(regEx, (match) => {\n let className = ClassNames.number;\n let text = match;\n\n if (/^\"/.test(match)) {\n if (/:$/.test(match)) {\n className = ClassNames.key;\n text = text.replace(\":\", `:`);\n } else {\n if (match === \"\\\"undefined\\\"\") {\n className = ClassNames.undefined;\n } else if (match === \"\\\"[Function]\\\"\") {\n className = ClassNames.function;\n } else {\n className = ClassNames.string;\n }\n }\n } else if (/true|false/.test(match)) {\n className = ClassNames.boolean;\n } else if (/null/.test(match)) {\n className = ClassNames.null;\n }\n\n return `${text}`;\n });\n};\n\nconst replacer = (_: string, value: any) => {\n if (typeof value === \"function\") {\n return \"[Function]\";\n }\n\n if (typeof value === \"undefined\") {\n return \"undefined\";\n }\n\n return value;\n};\n\nexport const cutify = (json: Object): string => {\n return syntaxHighlight(json)\n .replace(/\"/g, \"\");\n};\n", "/** @jsx h */\nimport { Fragment, FunctionalComponent, h } from \"../reactDeps.ts\";\nimport { cutify } from \"./cutify.ts\";\nimport * as styles from \"./styles.ts\";\n\ninterface JSONViewerProps {\n jsonData: any;\n}\n\nexport const JSONViewer: FunctionalComponent = ({\n jsonData,\n}) => {\n const cutifiedJson = cutify(jsonData);\n return (\n \n \n \n );\n};\n", "/** @jsx h */\nimport { h } from \"../../reactDeps.ts\";\n\nexport default function InfoIcon() {\n return (\n // \n // \n // \n // \n // {\" \"}\n // \n // {\" \"}\n // \n // {\" \"}\n // {\" \"}\n // {\" \"}\n // {\" \"}\n // \n // {\" \"}\n // \n // {\" \"}\n // {\" \"}\n // {\" \"}\n // {\" \"}\n // \n // {\" \"}\n // \n // {\" \"}\n // {\" \"}\n // {\" \"}\n // {\" \"}\n // \n // \n \n \n \n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n {\" \"}\n {\" \"}\n {\" \"}\n {\" \"}\n {\" \"}\n {\" \"}\n {\" \"}\n {\" \"}\n {\" \"}\n {\" \"}\n {\" \"}\n {\" \"}\n {\" \"}\n {\" \"}\n {\" \"}\n {\" \"}\n {\" \"}\n {\" \"}\n {\" \"}\n {\" \"}\n {\" \"}\n \n \n );\n}\n", "/** @jsx h */\nimport { StateUpdater, h, useState } from \"../reactDeps.ts\";\nimport { TResults } from \"./E2E.tsx\";\nimport { JSONViewer } from \"./JSONVeiwer.tsx\";\nimport InfoIcon from \"./icon/InfoIcon.tsx\";\n\nexport const ResultSlider = ({\n results,\n setIsShowE2eResponse,\n}: {\n results: TResults[];\n setIsShowE2eResponse: StateUpdater;\n}) => {\n const [show, setShow] = useState(0);\n // const slice = () => {\n // const showSlice = results.slice(show, show + 5);\n // showSlice.map((result, index,arr) => {\n // const showslice = arr.slice(show,show + 5)\n // setShow(show)}>{index + 1}\n // })\n // };\n return (\n \n {/*
\n {\n setShow(show === results.length - 1 ? 0 : show + 1);\n }}\n >\n +\n \n {\n setShow(show === 0 ? results.length - 1 : show - 1);\n }}\n >\n -\n \n {\n setShow(0);\n }}\n >\n first\n \n {\n setShow(results.length - 1);\n }}\n >\n last\n \n
*/}\n
\n
\n setIsShowE2eResponse(true)}\n >\n \n \n REQUEST\n
\n \n \n {results.map((_re, index) => (\n setShow(index)}\n data-show={show === index}\n >\n {index + 1}\n \n ))}\n {/* {slice()} */}\n \n
\n
\n
\n RESPONSE\n \n {results[show].responseTime}ms\n \n
\n\n \n
\n \n );\n};\n", "/** @jsx h */\nimport { Fragment, h, useState } from \"../reactDeps.ts\";\nimport { TSequenceDetail } from \"./E2E.tsx\";\nimport { JSONViewer } from \"./JSONVeiwer.tsx\";\nimport { ResultSlider } from \"./ResultSlider.tsx\";\nimport InfoIcon from \"./icon/InfoIcon.tsx\";\n\nexport function SequenceSlider({ sequence }: { sequence: TSequenceDetail }) {\n const [isShowE2eResponse, setIsShowE2eResponse] = useState(true);\n\n return (\n
\n {isShowE2eResponse\n ? (\n \n
\n
\n setIsShowE2eResponse(false)}\n >\n \n \n Body Header\n
\n \n
\n
\n
\n Description\n
\n
\n

\n you send {sequence.repeat} times of this request\n

\n

\n The best request performance is{\" \"}\n {sequence.bestTime.time} ms in{\" \"}\n {sequence.bestTime.resultIdx} index\n

\n\n

\n The worst request performance is{\" \"}\n {sequence.worstTime.time} ms in{\" \"}\n {sequence.worstTime.resultIdx} index\n

\n\n

\n the avrage time for each request is{\" \"}\n {sequence.time / sequence.repeat} ms\n

\n

\n and whole time is {sequence.time} ms\n

\n

\n this sequence sends {sequence.success}{\" \"}\n success request and {sequence.fails} it be\n {\" \"}\n fails\n

\n \n You capture these Items in this sequnece:{\" \"}\n {sequence.captures.map((ci) => (\n
    \n
  • key: {ci.key}
  • \n
  • captured from: {ci.captured}
  • \n
  • with value of: {ci.value}
  • \n
  • inside model : {ci.model}
  • \n
  • and act : {ci.act}
  • \n
  • \n this item captured inside sequnce index:{\" \"}\n {ci.sequenceIdx}\n
  • \n
\n ))}\n
\n\n \n You are using these capture items in this sequence:{\" \"}\n {sequence.usedCaptures.map((ci) => (\n
    \n
  • key: {ci.key}
  • \n
  • captured from: {ci.captured}
  • \n
  • with value of: {ci.value}
  • \n
  • inside model : {ci.model}
  • \n
  • and act : {ci.act}
  • \n
  • \n this item captured inside sequnce index:{\" \"}\n {ci.sequenceIdx}\n
  • \n
\n ))}\n
\n\n {\n /* {sequence.captures.length && (\n

\n you capture theese in this sequence :\n {sequence.captures.map((capture) => (\n

\n `{capture.value} as \n {capture.key} with value of \n
\n ))}\n

\n )} */\n }\n
\n
\n
\n )\n : (\n \n )}\n
\n );\n}\n", "/** @jsx h */\nimport { Fragment, h, useState } from \"../reactDeps.ts\";\nimport { uid } from \"../utils/uid.ts\";\nimport { TRequest } from \"./context/actionType.ts\";\nimport { e2eFirstInp } from \"./context/initials.ts\";\nimport { Help } from \"./Help.tsx\";\nimport AddIcon from \"./icon/AddIcon.tsx\";\nimport BackIcon from \"./icon/BackIcon.tsx\";\nimport DeleteIcon from \"./icon/deleteIcon.tsx\";\nimport DownIcon from \"./icon/DownIcon.tsx\";\nimport ExportIcon from \"./icon/ExportIcon.tsx\";\nimport HelpIcon from \"./icon/HelpIcon.tsx\";\nimport ImportIcon from \"./icon/ImportIcon.tsx\";\nimport RunIcon from \"./icon/RunIcon.tsx\";\nimport UpIcon from \"./icon/UpIcon.tsx\";\nimport { useLesan } from \"./ManagedLesanContext.tsx\";\nimport { SequenceSlider } from \"./SequenceSlider.tsx\";\n\nexport type TResults = {\n id: string;\n request: Record;\n response: Record;\n responseTime: number;\n};\n\nexport type captureType = {\n key: string;\n value: string;\n captured?: any;\n sequenceIdx?: number;\n model?: string;\n act?: string;\n};\n\nexport type TSequenceDetail = {\n id: string;\n bodyHeader: string;\n time: number;\n repeat: number;\n success: number;\n fails: number;\n bestTime: { resultIdx: number; time: number };\n worstTime: { resultIdx: number; time: number };\n captures: captureType[];\n usedCaptures: captureType[];\n results: TResults[];\n};\n\nexport type TReqDetails = {\n allReqPerformance: number;\n numberRequest: number;\n success: number;\n fails: number;\n bestTime: {\n sequenceIdx: number;\n resultIdx: number;\n time: number;\n act: string;\n model: string;\n };\n worstTime: {\n sequenceIdx: number;\n resultIdx: number;\n time: number;\n act: string;\n model: string;\n };\n sequenceDetail: TSequenceDetail[];\n allCaptureItems: captureType[];\n};\n\nexport function E2E({ baseUrl }: { baseUrl: string; bodyHeaders?: string }) {\n const { e2eForms, setE2eForms } = useLesan();\n\n const initialRequestDetail: TReqDetails = {\n allReqPerformance: 0,\n numberRequest: 0,\n success: 0,\n fails: 0,\n bestTime: {\n sequenceIdx: 0,\n resultIdx: 0,\n time: Number.MAX_SAFE_INTEGER,\n act: \"\",\n model: \"\",\n },\n worstTime: { sequenceIdx: 0, resultIdx: 0, act: \"\", model: \"\", time: 0 },\n sequenceDetail: [],\n allCaptureItems: [],\n };\n\n const [isShowE2eButton, setIsShowE2eButton] = useState(false);\n const [requestDetail, setRequestDetail] = useState(\n initialRequestDetail,\n );\n\n const handleMove = (fromIndex: any, toIndex: any) => {\n if (fromIndex === 0 && toIndex <= 0) {\n return;\n } else {\n const element = e2eForms[fromIndex];\n e2eForms.splice(fromIndex, 1);\n e2eForms.splice(toIndex, 0, element);\n setE2eForms([...e2eForms]);\n }\n };\n\n const handleDelete = (fromIndex: any) => {\n e2eForms[fromIndex];\n e2eForms.splice(fromIndex, 1);\n setE2eForms([...e2eForms]);\n };\n\n const [view, setView] = useState<\"help\" | \"e2e\" | \"result\">(\"e2e\");\n\n const exportForm = () => {\n const jsonString = `data:text/json;chatset=utf-8,${\n encodeURIComponent(\n JSON.stringify(e2eForms),\n )\n }`;\n const link = document.createElement(\"a\");\n link.href = jsonString;\n link.download = \"Configdata.json\";\n\n link.click();\n };\n\n const jsonFileUpload = (e: any) => {\n const fileReader = new FileReader();\n fileReader.readAsText(e.target.files[0], \"UTF-8\");\n fileReader.onload = (e) => {\n const data = JSON.parse(e.target!.result as string);\n setE2eForms(data);\n };\n };\n\n const exportResults = () => {\n const jsonString = `data:text/json;chatset=utf-8,${\n encodeURIComponent(\n JSON.stringify(requestDetail),\n )\n }`;\n const link = document.createElement(\"a\");\n link.href = jsonString;\n link.download = \"data.json\";\n\n link.click();\n };\n\n const lesanAPI = async ({\n baseUrl,\n options,\n }: {\n baseUrl: string;\n options: TRequest;\n }) => {\n const fetching = await fetch(`${baseUrl}lesan`, options);\n return await fetching.json();\n };\n\n const replaceCaptureString = (\n obj: Record,\n variablesSet: Set,\n returnCaptures: captureType[],\n ) => {\n for (const key in obj) {\n if (typeof obj[key] === \"object\") {\n replaceCaptureString(obj[key], variablesSet, returnCaptures);\n }\n\n const value = obj[key];\n\n if (typeof value === \"string\" && value.includes(\"{\")) {\n const openBraceIndexes: number[] = [];\n for (let index = 0; index < value.length; index++) {\n if (value[index] === \"{\") {\n openBraceIndexes.push(index);\n }\n }\n\n const closeBraceIndexes: number[] = [];\n for (let index = 0; index < value.length; index++) {\n if (value[index] === \"}\") {\n closeBraceIndexes.push(index);\n }\n }\n\n const variablesName = openBraceIndexes.map((openBrace, index) => {\n return value.slice(openBrace + 1, closeBraceIndexes[index]);\n });\n\n variablesName.forEach((variableName) => {\n for (const setValue of variablesSet) {\n if (setValue.key === variableName) {\n returnCaptures.push({\n key: obj[key],\n value: obj[key].replace(`{${variableName}}`, setValue.value),\n });\n obj[key] = obj[key].replace(`{${variableName}}`, setValue.value);\n }\n }\n });\n }\n }\n return returnCaptures;\n };\n\n const runE2eTest = async () => {\n const parsedCaptures = new Set();\n\n for await (const e2eForm of e2eForms) {\n const parsedHeaderBody = JSON.parse(e2eForm.bodyHeaders);\n\n const usedCaptures = replaceCaptureString(\n parsedHeaderBody,\n parsedCaptures,\n [],\n );\n\n const findInParsedCaptures = (value: string, set: Set) => {\n for (const item of set) if (item.value === value) return item;\n };\n\n const body: TRequest = {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...parsedHeaderBody.headers,\n },\n body: JSON.stringify(parsedHeaderBody.body),\n };\n\n let jsonSendedRequest: any;\n\n const sequnceId = uid();\n for (let repeat = 0; repeat < e2eForm.repeat; repeat++) {\n const tResTime0 = performance.now();\n jsonSendedRequest = await lesanAPI({\n baseUrl: baseUrl,\n options: body,\n });\n const tResPerformance = performance.now() - tResTime0;\n\n const resultId = uid();\n const newResult = {\n id: resultId,\n request: { ...body, body: parsedHeaderBody.body },\n response: jsonSendedRequest,\n responseTime: tResPerformance,\n };\n\n // console.log(\"parsedCaptures is \", { parsedCaptures });\n setRequestDetail((preReqDetails) => {\n const sequnces = preReqDetails.sequenceDetail;\n const findedSequnceIdx = sequnces.findIndex((sq) =>\n sq.id === sequnceId\n );\n let resultIdx = 1;\n if (findedSequnceIdx !== -1) {\n sequnces[findedSequnceIdx].results.push(newResult);\n resultIdx = sequnces[findedSequnceIdx].results.length;\n sequnces[findedSequnceIdx].bestTime =\n (sequnces[findedSequnceIdx].bestTime.time < tResPerformance)\n ? sequnces[findedSequnceIdx].bestTime\n : { resultIdx, time: tResPerformance };\n sequnces[findedSequnceIdx].worstTime =\n (sequnces[findedSequnceIdx].worstTime.time > tResPerformance)\n ? sequnces[findedSequnceIdx].worstTime\n : { resultIdx, time: tResPerformance };\n if (jsonSendedRequest.success) {\n sequnces[findedSequnceIdx].success =\n sequnces[findedSequnceIdx].success + 1;\n } else {\n sequnces[findedSequnceIdx].fails =\n sequnces[findedSequnceIdx].fails + 1;\n }\n sequnces[findedSequnceIdx].time = sequnces[findedSequnceIdx].time +\n tResPerformance;\n sequnces[findedSequnceIdx].repeat =\n sequnces[findedSequnceIdx].repeat + 1;\n } else {\n sequnces.push({\n id: sequnceId,\n bodyHeader: e2eForm.bodyHeaders,\n time: tResPerformance,\n repeat: 1,\n success: jsonSendedRequest.success ? 1 : 0,\n fails: jsonSendedRequest.success ? 0 : 1,\n bestTime: { resultIdx, time: tResPerformance },\n worstTime: { resultIdx, time: tResPerformance },\n captures: e2eForm.captures.map(({ key, value }) => ({\n key,\n value,\n sequenceIdx: sequnces.length,\n model: parsedHeaderBody.body.model,\n act: parsedHeaderBody.body.act,\n })),\n usedCaptures: usedCaptures.map(({ key, value }) => {\n const findedInsideParsedCapture = findInParsedCaptures(\n value,\n parsedCaptures,\n );\n return {\n key,\n value,\n captured: findedInsideParsedCapture?.captured,\n sequenceIdx: findedInsideParsedCapture\n ?.sequenceIdx,\n model: findedInsideParsedCapture?.model,\n act: findedInsideParsedCapture?.act,\n };\n }),\n results: [newResult],\n });\n }\n\n return {\n allReqPerformance: preReqDetails.allReqPerformance +\n tResPerformance,\n numberRequest: preReqDetails.numberRequest + 1,\n success: jsonSendedRequest.success\n ? (preReqDetails.success + 1)\n : preReqDetails.success,\n fails: jsonSendedRequest.success\n ? (preReqDetails.fails)\n : preReqDetails.fails + 1,\n bestTime: preReqDetails.bestTime.time < tResPerformance\n ? preReqDetails.bestTime\n : {\n resultIdx,\n sequenceIdx: sequnces.length,\n act: parsedHeaderBody.body.act,\n model: parsedHeaderBody.body.model,\n time: tResPerformance,\n },\n worstTime: preReqDetails.worstTime.time > tResPerformance\n ? preReqDetails.worstTime\n : {\n resultIdx,\n sequenceIdx: sequnces.length,\n act: parsedHeaderBody.body.act,\n model: parsedHeaderBody.body.model,\n time: tResPerformance,\n },\n sequenceDetail: sequnces,\n allCaptureItems: Array.from(parsedCaptures),\n };\n });\n }\n\n const captures = [...e2eForm.captures].filter(\n (capture) => capture.key && capture.value,\n );\n\n const parsedCapuresValue = captures.map((capture) => {\n const parts = capture.value.split(\"[\");\n const parsedValue: (string | number)[] = [];\n\n parts.forEach((part: any) => {\n let slicedPart: string | number = part.slice(0, part.indexOf(\"]\"));\n if (!isNaN(Number(slicedPart))) {\n slicedPart = Number(slicedPart);\n }\n parsedValue.push(slicedPart);\n });\n parsedValue.shift();\n return { key: capture.key, parsedValue, value: capture.value };\n });\n // let getedValues: any;\n parsedCapuresValue.forEach((capture) => {\n if (capture.parsedValue.length > 0) {\n let getedValue: any = jsonSendedRequest;\n capture.parsedValue.forEach((capValue) => {\n getedValue = getedValue[capValue];\n });\n parsedCaptures.add({\n key: capture.key,\n value: getedValue,\n captured: capture.value,\n act: parsedHeaderBody.body.act,\n model: parsedHeaderBody.body.model,\n sequenceIdx: requestDetail.sequenceDetail.length - 1,\n });\n // getedValues = [...getedValue, ...e2eForm.captures];\n }\n });\n }\n };\n\n // plus repeat\n const plusRepeatHandler = (index: number) => {\n const copy = [...e2eForms];\n copy[index].repeat += 1;\n setE2eForms([...copy]);\n };\n\n // mines repeat\n const minesRepeatHandler = (index: number) => {\n const copy = [...e2eForms];\n if (copy[index].repeat > 0) {\n copy[index].repeat -= 1;\n }\n setE2eForms([...copy]);\n };\n\n return (\n
\n {view === \"result\"\n ? (\n \n
\n
\n {\n setRequestDetail(initialRequestDetail);\n setView(\"e2e\");\n }}\n >\n \n Back\n \n \n \n Export\n \n
\n {\n /* setIsShowE2eResponse(!isShowE2eResponse)}\n >\n REQUESTS\n \n {isShowE2eResponse ? : }\n \n
*/\n }\n
\n \n \n All Request Count: {requestDetail.numberRequest}\n {\" \"}\n times\n \n {\" \"}\n All Request Time: {requestDetail.allReqPerformance} ms\n \n \n \n All Success Request: {requestDetail.success} times\n All Fails Request : {requestDetail.fails} times\n \n \n \n Best Request Time: {requestDetail.bestTime.time} ms in{\" \"}\n seqeunce index of {requestDetail.bestTime.sequenceIdx}\n {\" \"}\n and request index of {requestDetail.bestTime.resultIdx}\n {\" \"}\n inside {requestDetail.bestTime.model} model and{\" \"}\n {requestDetail.bestTime.act} act\n \n \n Worst Request Time: {requestDetail.worstTime.time} ms in{\" \"}\n seqeunce index of {requestDetail.worstTime.sequenceIdx}\n {\" \"}\n and request index of{\" \"}\n {requestDetail.worstTime.resultIdx} inside{\" \"}\n {requestDetail.worstTime.model} model and{\" \"}\n {requestDetail.worstTime.act} act\n \n \n All capture Items is:{\" \"}\n {requestDetail.allCaptureItems.map((ci) => (\n
    \n
  • key: {ci.key}
  • \n
  • captured from: {ci.captured}
  • \n
  • with value of: {ci.value}
  • \n
  • inside model : {ci.model}
  • \n
  • and act : {ci.act}
  • \n
  • \n this item captured inside sequnce index:{\" \"}\n {ci.sequenceIdx}\n
  • \n
\n ))}\n
\n \n \n\n
\n {requestDetail.sequenceDetail.map((sequence) => {\n return (\n
\n \n
\n );\n })}\n
\n \n )\n : view === \"e2e\"\n ? (\n \n
\n {e2eForms.map((e2eForm, idx) => (\n \n
\n {e2eForms.length > 1 && (\n
\n handleMove(idx, idx - 1)}\n >\n \n
\n handleMove(idx, idx + 1)}\n >\n \n
\n handleDelete(idx)}\n >\n \n
\n \n )}\n
\n
\n set test body and headers\n
\n {\n const copy = [...e2eForms];\n copy[idx].bodyHeaders = e.target.value;\n setE2eForms([...copy]);\n }}\n />\n
\n
\n
\n set repeat time\n
\n
\n {\n const copy = [...e2eForms];\n copy[idx].repeat = e.target.value;\n setE2eForms([...copy]);\n }}\n />\n plusRepeatHandler(idx)}\n >\n +\n \n minesRepeatHandler(idx)}\n >\n -\n \n
\n
\n capture variables\n
\n {\n const copy = [...e2eForms];\n copy[idx].captures.push({ key: \"\", value: \"\" });\n setE2eForms([...copy]);\n }}\n >\n add capture\n \n\n {e2eForm.captures.map((capture, capId) => (\n \n
\n {\n const copy = [...e2eForms];\n copy[idx].captures[capId].key = e.target.value;\n setE2eForms([...copy]);\n }}\n />\n {\n const copy = [...e2eForms];\n copy[idx].captures[capId].value =\n e.target.value;\n setE2eForms([...copy]);\n }}\n />\n
\n
\n
\n ))}\n
\n \n
\n ))}\n \n setIsShowE2eButton(!isShowE2eButton)}\n >\n show btn\n \n \n {\n setE2eForms([...e2eForms, e2eFirstInp()]);\n }}\n >\n \n Add\n \n {\n setView(\"result\");\n await runE2eTest();\n }}\n >\n \n Run E2E Test\n \n