1import{r as p,j as e,a as u}from"./react-DwuEVfNv.js";import{i as B,aq as A,D as k,I as R,en as z,gW as L,M as W,g as _,bK as F,F as P,gX as H,C as O,a3 as w,c0 as b,c1 as f,c2 as S,bW as Y,j as g,bV as $,aa as I,bp as q,c3 as E,$ as K,a2 as M,bh as N,gY as U,gZ as D,g_ as V,g$ as G,bi as Q,bj as X,bk as Z,bA as J,ab as ee,ah as re,bl as se,bm as ne,q as te}from"./index-DQzPtNsy.js";import{D as ae}from"./DeleteConfirmDialog-BgG7Wekk.js";import{R as oe,H as ie,a as m,B as de,b as le,D as j}from"./index.parts-CaFfNV-h.js";import"./d3-q0zOtUjj.js";const ce=u(F)(["& code{font-size:",";}"],_[1]);function ue({children:n,availableCodes:i,onCreate:t}){const[a,d]=p.useState(!1),[l,r]=p.useState(!1);function c(o){const h=o.currentTarget.value;a&&o.key==="Enter"&&h&&(t(h),r(!1))}return e.jsxs(B,{open:l,onOpenChange:r,children:[n&&e.jsx(A,{asChild:!0,children:n}),e.jsx(pe,{children:e.jsxs(k,{children:[e.jsx(R,{placeholder:"Find or type new error code...",onKeyDown:c}),e.jsxs(xe,{children:[e.jsx(he,{onEmptyChange:d,children:e.jsxs(ce,{children:["Press ",e.jsx(z,{children:"enter"})," to add new code."]})}),e.jsx(L,{children:i.map(o=>e.jsx(W,{value:o,onClick:()=>{t(o),r(!1)},children:o},o))})]})]})})]})}var he=u(P)(["padding-inline:0;"]),xe=u(H)(["min-height:140px;"]),pe=u(O)(["min-width:280px;padding:2px;"]);function ge({errors:n=[],disabled:i,submitting:t=null,onBusinessExceptionChange:a,onWarningChange:d,onDelete:l}){return e.jsxs(oe,{children:[e.jsxs(ie,{children:[e.jsx(m,{children:"Code"}),e.jsx(m,{children:e.jsxs(w,{gap:1,yAlign:"center",children:[e.jsx("span",{children:"Business Exception"}),e.jsxs(b,{children:[e.jsx(f,{asChild:!0,children:e.jsx(S,{})}),e.jsx(me,{children:"If enabled, represents errors that are due to business restrictions, which are reported separately from technical issues."})]})]})}),e.jsx(m,{children:e.jsxs(w,{gap:1,yAlign:"center",children:[e.jsx("span",{children:"Non-Fatal Warning"}),e.jsxs(b,{children:[e.jsx(f,{asChild:!0,children:e.jsx(S,{})}),e.jsx(je,{children:"If enabled, you will not be alerted."})]})]})}),e.jsx(m,{})]}),e.jsx(de,{children:Y(n,r=>r?.errorCode).map((r,c)=>e.jsxs(le,{children:[e.jsx(j,{children:r?.errorCode??e.jsx(g,{width:"10ch",height:"1em"})}),e.jsx(j,{textAlign:"center",children:r?e.jsx($,{"aria-label":`Enable ${r.errorCode} business exception`,checked:r.isBusinessException,disabled:i||t===r,onChange:()=>a(r)}):e.jsx(g,{width:"42px",height:"22px",rounded:!0})}),e.jsx(j,{textAlign:"center",children:r?e.jsx($,{"aria-label":`Enable ${r.errorCode} warning only`,checked:r.errorSeverity==="warning",disabled:i||t===r,onChange:()=>d(r)}):e.jsx(g,{width:"42px",height:"22px",rounded:!0})}),e.jsx(j,{width:"40px",padding:"none",children:r?e.jsxs(b,{children:[e.jsx(f,{asChild:!0,children:e.jsx(I,{variant:"muted","aria-label":`Delete ${r.errorCode}`,disabled:i||t===r,onClick:()=>l(r),children:e.jsx(q,{})})}),e.jsx(E,{children:"Delete Custom Error"})]}):e.jsx(g,{size:"20px",rounded:!0})})]},c))})]})}var me=u(E)(["max-width:50ch;"]),je=u(E)(["max-width:50ch;"]);const Ce=Array.from({length:25},()=>null);function Se(){const n=K(),[i,t]=p.useState(null),[a,d]=p.useState(null),l=M();N("Categorize Errors | Settings");const{data:r,isLoading:c}=U(n),o=D(n,{meta:{errorToastContent:{id:"update-custom-error",title:"Failed to create custom error"}}}),h=D(n,{meta:{errorToastContent:{id:"update-custom-error",title:"Failed to update custom error"}},onSettled(){t(null)}}),y=V(n,{onSettled(){d(null)},meta:{errorToastContent:{id:"delete-custom-error",description:`"${a?.errorCode}" could not be deleted. Please try again later`}}}),{data:v}=G({environmentId:n}),T=p.useMemo(()=>{const s=Array.from(new Set(v?.data.map(x=>x.playerErrorCode||"")))??[],C=r?.data.map(x=>x.errorCode)??[];return s.filter(x=>!C.includes(x)).sort()},[v,r]);return e.jsxs(Q,{children:[e.jsxs(X,{children:[e.jsx(Z,{children:"Categorize Errors"}),e.jsxs(J,{children:["Categorizing errors allows you to set up rules to control how errors are handled in your environment. You can set rules to define both the type (technical or business rule exception) and severity (fatal or warning).",e.jsx("br",{}),e.jsx("br",{}),"Warning-level and business rule exception errors are excluded from playback failure metrics and alerting. Changes apply to views received after the rule has been set. ",e.jsx("br",{}),e.jsx("br",{}),e.jsx(ee,{href:`${re}/guides/error-categorization`,children:"Learn more in our guide"})]}),e.jsx(se,{children:e.jsx(ue,{availableCodes:T,onCreate:s=>{o.mutate({errorCode:s,errorSeverity:"fatal",isBusinessException:!1})},children:e.jsx("div",{children:e.jsx(I,{variant:"access",disabled:!l,children:"Add error code"})})})})]}),e.jsxs(ne,{gap:4,gutterY:2,children:[!c&&r?.data.length===0?e.jsx(te,{$bold:!0,children:"No custom errors found."}):e.jsx(ge,{errors:c?Ce:r?.data,disabled:!l,submitting:i||a,onBusinessExceptionChange:s=>{t(s),h.mutate({...s,isBusinessException:!s.isBusinessException})},onWarningChange:s=>{t(s);const C=s.errorSeverity==="warning";h.mutate({...s,errorSeverity:C?"fatal":"warning"})},onDelete:d}),a&&e.jsx(ae,{resource:"error code",name:a.errorCode,showPermanentWarning:!1,open:!0,onOpenChange:()=>d(null),isSubmitting:y.isLoading,onConfirm:()=>y.mutate(a.errorCode)})]})]})}export{Se as default}; 2//# sourceMappingURL=index.route-_sLzhFUO.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.