-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2213.js
1 lines (1 loc) · 4.33 KB
/
2213.js
1
"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[2213],{82213:(e,s,n)=>{n.d(s,{DebugPanelEsperanto:()=>he});var t=n(30758),l=n(13505),a=n(21974),i=n(31105),c=n(17885),r=n(9198),o=n(71761),u=n(7130),d=n(82046),m=n(10189),h=n(11418),p=n(6164),v=n(48837),f=n(63099),b=n(94105),y=n(68498),x=n(85442),C=n(59278),k=n(50824),S=n(93048),g=n(42779),j=n(7887),E=n(99945),N=n(76818),M=n(17724),_=n(36964),O=n(73959),R=n(71572),I=n(97936),D=n(91575),w=n(64465),z=n(5827),A=n(15080),P=n(86227),B=n(59063),J=n(15e3),V=n(57915),W=n(14563),q=n(31444),F=n(74604),G=n(1482),H=n(56045),L=n(74876),X=n(34340),U=n(9006),Y=n(37992),$=n(90994),T=n(70297),Z=n(51055),K=n(71927),Q=n(46833);const ee=[o.B,u.ve,d.Pc,m.BM,y.CJ,y.NB,y.uC,y.RI,y.UF,y.FY,y.B3,y.Dt,y.s,y.Xk,y.Yl,h.r,p.pt,v.MI,f.J1,b.di,x.BO,C.Pm,k.Ww,S._w,g.rM,g.A5,g.qM,j.hN,E.NI,N.lb,M.xo,_.IU,O.EW,R.oW,I.Gy,D.LN,w.HG,Q._4,z.Ag,A._,P.y9,B.A,J.J4,V.tx,W.xV,q._q,F.hA,G.f_,H.Ms,L.NH,X.$A,U.sp,Y.GD,$.to1,$.hm7,$.hb0,$.Bl$,$.ZxE,Z.aA,K.FZ,T.zW];var se=n(4942);function ne(e){return JSON.parse(e,((e,s)=>null===s?void 0:s))}function te(e){return JSON.stringify(e,((e,s)=>void 0===s?null:"bigint"==typeof s?s.toString():s),2)}function le(){const{serviceMap:e,serviceNames:s}=(0,t.useMemo)((()=>{const e=function(e){return ee.sort(((e,s)=>e.SERVICE_ID.localeCompare(s.SERVICE_ID))).reduce(((s,n)=>(s[n.SERVICE_ID]={methods:n.METHODS,client:new n(e)},s)),{})}((0,se.X)());return{serviceMap:e,serviceNames:Object.keys(e)}}),[]),[n,l]=(0,t.useState)(s[0]),a=e[n].methods,i=e[n].client,c=Object.keys(a),[o,u]=(0,t.useState)(c[0]),d=a[o].requestType,m=a[o].isStreaming,h=i[o],p=(0,t.useCallback)(((s,n)=>{const t=s??Object.keys(e)[0],a=e[t].methods,i=n??Object.keys(a)[0];l(t),u(i)}),[e,l,u]),v=(0,t.useMemo)((()=>te((0,r.S)(d,{},{cleanPolicies:!0}))),[d]),f=(0,t.useMemo)((()=>(0,r.S)(d,{})),[d]),b=(0,t.useCallback)((e=>{try{return te((0,r.S)(d,ne(e),{cleanPolicies:!0}))}catch(s){return e}}),[d]),y=(0,t.useCallback)((async(e,s)=>{const n=d.fromPartial(ne(e));if(m)return h.call(i,n,(e=>{s(te(e))}));const t=await h.call(i,n);return s(te(t)),null}),[i,m,d,h]);return{services:s,methods:c,service:n,method:o,client:i,message:d,call:y,jsonReference:f,jsonString:v,prettify:b,update:p}}const ae="k0haAXLr7hf1SVRhhDf_",ie="JzYBuC4I28TFE0vRsOB2",ce="Jifrv_M5FQ_4004rxNlX",re="ai8gaZdopia8aUEGYxks",oe="sSRpW8Sztpp8r_xEe6yQ",ue="xoLDWOSxKz7zqi5PkIS1",de="GuzyU8s8JXVn4PKEcz1o";var me=n(86070);const he=()=>{const{services:e,methods:s,service:n,method:r,call:o,jsonReference:u,jsonString:d,prettify:m,update:h}=le(),p=(0,t.useRef)(null),[v,f]=(0,t.useState)(!1),[b,y]=(0,t.useState)([]),x=b.length>0,{Editor:C,setContent:k,getContent:S,setReference:g}=(0,c.h)({className:de,onDiagnostics:e=>y(e)}),{Editor:j,setContent:E}=(0,c.h)({className:de,readOnly:!0}),N=(0,t.useCallback)((()=>{null!==p.current&&(p.current.cancel(),p.current=null,f(!1))}),[f]),M=(0,t.useCallback)((async()=>{N();const e=await o(S()??"{}",(e=>{E(e)}));null!==e&&(p.current=e,f(!0))}),[o,N,S,E]),_=(0,t.useCallback)((async()=>{const e=m(S()??"{}");k(e)}),[m,S,k]);(0,t.useEffect)((()=>{g(u),k(d),E(""),N()}),[g,u,k,d,E,N]);const O=[{label:"Core",options:e.filter((e=>-1===e.indexOf("desktop"))).map((e=>({label:e,value:e})))},{label:"Desktop",options:e.filter((e=>-1!==e.indexOf("desktop"))).map((e=>({label:e,value:e})))}],R=s.map((e=>({label:e,value:e})));return(0,me.jsxs)("div",{className:ae,children:[(0,me.jsxs)("div",{className:ie,children:[(0,me.jsx)(l.E,{as:"p",variant:"bodyMedium",children:"Endpoint"}),(0,me.jsx)(i.Ay,{value:{label:n,value:n},options:O,onChange:e=>{h(e?.value??void 0)},styles:{menuList:s=>({...s,minHeight:`min(60vh, ${50*e.length}px)`})}}),(0,me.jsx)(i.Ay,{value:{label:r,value:r},options:R,onChange:e=>h(n,e?.value??void 0),styles:{menuList:e=>({...e,minHeight:`min(60vh, ${50*s.length}px)`})}})]}),(0,me.jsxs)("div",{className:ce,children:[(0,me.jsxs)("div",{className:oe,children:[(0,me.jsx)(l.E,{as:"p",variant:"bodyMedium",children:"Request"}),(0,me.jsx)(a.n,{className:ue,size:"small",disabled:x,onClick:_,children:"Prettify"}),(0,me.jsx)(a.n,{className:ue,size:"small",disabled:x,onClick:v?N:M,children:v?"Cancel":"Send"})]}),C]}),(0,me.jsxs)("div",{className:re,children:[(0,me.jsx)("div",{className:oe,children:(0,me.jsx)(l.E,{as:"p",variant:"bodyMedium",children:"Response"})}),j]})]})}}}]);