promptfoo 0.24.3 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/README.md +4 -1
  2. package/dist/package.json +1 -1
  3. package/dist/src/assertions.d.ts.map +1 -1
  4. package/dist/src/assertions.js +38 -5
  5. package/dist/src/assertions.js.map +1 -1
  6. package/dist/src/cache.js +1 -1
  7. package/dist/src/cache.js.map +1 -1
  8. package/dist/src/commands/list.d.ts +3 -0
  9. package/dist/src/commands/list.d.ts.map +1 -0
  10. package/dist/src/commands/list.js +83 -0
  11. package/dist/src/commands/list.js.map +1 -0
  12. package/dist/src/commands/show.d.ts +3 -0
  13. package/dist/src/commands/show.d.ts.map +1 -0
  14. package/dist/src/commands/show.js +144 -0
  15. package/dist/src/commands/show.js.map +1 -0
  16. package/dist/src/evaluator.d.ts.map +1 -1
  17. package/dist/src/evaluator.js +17 -0
  18. package/dist/src/evaluator.js.map +1 -1
  19. package/dist/src/main.js +6 -3
  20. package/dist/src/main.js.map +1 -1
  21. package/dist/src/prompts.js +1 -1
  22. package/dist/src/prompts.js.map +1 -1
  23. package/dist/src/providers/azureopenai.d.ts +1 -0
  24. package/dist/src/providers/azureopenai.d.ts.map +1 -1
  25. package/dist/src/providers/azureopenai.js +2 -1
  26. package/dist/src/providers/azureopenai.js.map +1 -1
  27. package/dist/src/providers/huggingface.d.ts +43 -0
  28. package/dist/src/providers/huggingface.d.ts.map +1 -0
  29. package/dist/src/providers/huggingface.js +115 -0
  30. package/dist/src/providers/huggingface.js.map +1 -0
  31. package/dist/src/providers/ollama.d.ts +1 -1
  32. package/dist/src/providers/ollama.d.ts.map +1 -1
  33. package/dist/src/providers/ollama.js +9 -4
  34. package/dist/src/providers/ollama.js.map +1 -1
  35. package/dist/src/providers/webhook.d.ts +2 -0
  36. package/dist/src/providers/webhook.d.ts.map +1 -1
  37. package/dist/src/providers/webhook.js +5 -1
  38. package/dist/src/providers/webhook.js.map +1 -1
  39. package/dist/src/providers.d.ts.map +1 -1
  40. package/dist/src/providers.js +17 -1
  41. package/dist/src/providers.js.map +1 -1
  42. package/dist/src/share.d.ts.map +1 -1
  43. package/dist/src/share.js +3 -1
  44. package/dist/src/share.js.map +1 -1
  45. package/dist/src/table.d.ts +1 -0
  46. package/dist/src/table.d.ts.map +1 -1
  47. package/dist/src/table.js +16 -1
  48. package/dist/src/table.js.map +1 -1
  49. package/dist/src/types.d.ts +52 -6
  50. package/dist/src/types.d.ts.map +1 -1
  51. package/dist/src/util.d.ts +20 -7
  52. package/dist/src/util.d.ts.map +1 -1
  53. package/dist/src/util.js +234 -10
  54. package/dist/src/util.js.map +1 -1
  55. package/dist/src/web/nextui/404/index.html +1 -1
  56. package/dist/src/web/nextui/404.html +1 -1
  57. package/dist/src/web/nextui/_next/static/chunks/21-8a2c661f5df627d6.js +1 -0
  58. package/dist/src/web/nextui/_next/static/chunks/238-84a998be247f92e7.js +2 -0
  59. package/dist/src/web/nextui/_next/static/chunks/293-f7537306415679fd.js +89 -0
  60. package/dist/src/web/nextui/_next/static/chunks/320-d41e321556b1b694.js +1 -0
  61. package/dist/src/web/nextui/_next/static/chunks/{226-7bbb6c98a19542fd.js → 502-683cf7d0202ccda6.js} +3 -3
  62. package/dist/src/web/nextui/_next/static/chunks/548-46c7c1d35ca1bc02.js +1 -0
  63. package/dist/src/web/nextui/_next/static/chunks/563-a961efef5193d79c.js +1 -0
  64. package/dist/src/web/nextui/_next/static/chunks/{109-cd1174ae3bb20050.js → 753-f62bfa32dbd9ff14.js} +1 -1
  65. package/dist/src/web/nextui/_next/static/chunks/808-90426be34a5d9784.js +1 -0
  66. package/dist/src/web/nextui/_next/static/chunks/891-0286b3010dc452ac.js +1 -0
  67. package/dist/src/web/nextui/_next/static/chunks/919-d71c386cf4a86911.js +44 -0
  68. package/dist/src/web/nextui/_next/static/chunks/975-380318b3b26ba688.js +1 -0
  69. package/dist/src/web/nextui/_next/static/chunks/app/auth/login/page-0c87ef00a5707e79.js +1 -0
  70. package/dist/src/web/nextui/_next/static/chunks/app/auth/signup/{page-2294d7d051fe8edc.js → page-d9f9ec167e1619d3.js} +1 -1
  71. package/dist/src/web/nextui/_next/static/chunks/app/datasets/page-84286ffe4467c5db.js +1 -0
  72. package/dist/src/web/nextui/_next/static/chunks/app/eval/[id]/{page-a2fd3bb5d30b33ff.js → page-b1abdf382b7fce34.js} +1 -1
  73. package/dist/src/web/nextui/_next/static/chunks/app/eval/page-8e06c28763a6f3ff.js +1 -0
  74. package/dist/src/web/nextui/_next/static/chunks/app/layout-48c7b442dc5873a7.js +1 -0
  75. package/dist/src/web/nextui/_next/static/chunks/app/prompts/page-b1f8e85f32a45c2a.js +1 -0
  76. package/dist/src/web/nextui/_next/static/chunks/app/setup/{page-a06cf4d87ca670b3.js → page-c0ba4386b34893c6.js} +1 -1
  77. package/dist/src/web/nextui/_next/static/chunks/{main-5aa6f10008676c74.js → main-4ff8304034a9c4dd.js} +1 -1
  78. package/dist/src/web/nextui/_next/static/chunks/webpack-cb669abeb3132738.js +1 -0
  79. package/dist/src/web/nextui/_next/static/css/02c518fafd180df2.css +1 -0
  80. package/dist/src/web/nextui/_next/static/css/2e8afc839fdb6c80.css +1 -0
  81. package/dist/src/web/nextui/_next/static/css/3338f9a156c6fd51.css +1 -0
  82. package/dist/src/web/nextui/auth/login/index.html +1 -1
  83. package/dist/src/web/nextui/auth/login/index.txt +6 -6
  84. package/dist/src/web/nextui/auth/signup/index.html +1 -1
  85. package/dist/src/web/nextui/auth/signup/index.txt +6 -6
  86. package/dist/src/web/nextui/datasets/index.html +1 -0
  87. package/dist/src/web/nextui/datasets/index.txt +12 -0
  88. package/dist/src/web/nextui/eval/index.html +1 -1
  89. package/dist/src/web/nextui/eval/index.txt +8 -8
  90. package/dist/src/web/nextui/index.html +1 -1
  91. package/dist/src/web/nextui/index.txt +5 -5
  92. package/dist/src/web/nextui/prompts/index.html +1 -0
  93. package/dist/src/web/nextui/prompts/index.txt +12 -0
  94. package/dist/src/web/nextui/setup/index.html +2 -2
  95. package/dist/src/web/nextui/setup/index.txt +7 -7
  96. package/dist/src/web/server.d.ts.map +1 -1
  97. package/dist/src/web/server.js +22 -21
  98. package/dist/src/web/server.js.map +1 -1
  99. package/package.json +1 -1
  100. package/dist/src/web/nextui/_next/static/chunks/189-042b0b24d67ce74a.js +0 -1
  101. package/dist/src/web/nextui/_next/static/chunks/452-f410013580f8a99c.js +0 -45
  102. package/dist/src/web/nextui/_next/static/chunks/482-7ffd5fba3f199131.js +0 -89
  103. package/dist/src/web/nextui/_next/static/chunks/558-02945bff7eb421d3.js +0 -1
  104. package/dist/src/web/nextui/_next/static/chunks/613-549d3513b4443850.js +0 -1
  105. package/dist/src/web/nextui/_next/static/chunks/685-a79f04e4019cbeea.js +0 -1
  106. package/dist/src/web/nextui/_next/static/chunks/891-f1107a7da5ba149b.js +0 -1
  107. package/dist/src/web/nextui/_next/static/chunks/app/auth/login/page-451e9394d69ec542.js +0 -1
  108. package/dist/src/web/nextui/_next/static/chunks/app/eval/page-7f8f2721bf28b45c.js +0 -1
  109. package/dist/src/web/nextui/_next/static/chunks/app/layout-a6a01a358b22e62d.js +0 -1
  110. package/dist/src/web/nextui/_next/static/chunks/webpack-e8fd16cd12fe69d0.js +0 -1
  111. package/dist/src/web/nextui/_next/static/css/3290c2c69da16f4f.css +0 -1
  112. package/dist/src/web/nextui/_next/static/css/76b5764bbb20737e.css +0 -1
  113. package/dist/src/web/nextui/_next/static/css/9f930133a80febed.css +0 -1
  114. /package/dist/src/web/nextui/_next/static/{YvSvJ02XgyNQCuOJXm3mH → u3pdaLciuOlCvOMUz3jbc}/_buildManifest.js +0 -0
  115. /package/dist/src/web/nextui/_next/static/{YvSvJ02XgyNQCuOJXm3mH → u3pdaLciuOlCvOMUz3jbc}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[975],{7328:function(e,t,r){var o=r(791),n=r(3428),i=r(2265),l=r(5959),a=r(5600),s=r(3382),d=r(5843),u=r(7927),p=r(9274),c=r(7437);let m=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],f=e=>{let{classes:t,disableUnderline:r}=e,o=(0,a.Z)({root:["root",!r&&"underline"],input:["input"]},p._,t);return(0,n.Z)({},t,o)},b=(0,d.ZP)(s.Ej,{shouldForwardProp:e=>(0,d.FO)(e)||"classes"===e,name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[...(0,s.Gx)(e,t),!r.disableUnderline&&t.underline]}})(({theme:e,ownerState:t})=>{var r;let o="light"===e.palette.mode,i=o?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)";return(0,n.Z)({position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:i,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)","@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:i}},[`&.${p.Z.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:i},[`&.${p.Z.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:o?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)"}},!t.disableUnderline&&{"&:after":{borderBottom:`2px solid ${null==(r=(e.vars||e).palette[t.color||"primary"])?void 0:r.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${p.Z.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${p.Z.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&:before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:o?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)"}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${p.Z.disabled}, .${p.Z.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${p.Z.disabled}:before`]:{borderBottomStyle:"dotted"}},t.startAdornment&&{paddingLeft:12},t.endAdornment&&{paddingRight:12},t.multiline&&(0,n.Z)({padding:"25px 12px 8px"},"small"===t.size&&{paddingTop:21,paddingBottom:4},t.hiddenLabel&&{paddingTop:16,paddingBottom:17}))}),h=(0,d.ZP)(s.rA,{name:"MuiFilledInput",slot:"Input",overridesResolver:s._o})(({theme:e,ownerState:t})=>(0,n.Z)({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:"light"===e.palette.mode?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===e.palette.mode?null:"#fff",caretColor:"light"===e.palette.mode?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},"small"===t.size&&{paddingTop:21,paddingBottom:4},t.hiddenLabel&&{paddingTop:16,paddingBottom:17},t.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0},t.startAdornment&&{paddingLeft:0},t.endAdornment&&{paddingRight:0},t.hiddenLabel&&"small"===t.size&&{paddingTop:8,paddingBottom:9})),v=i.forwardRef(function(e,t){var r,i,a,d;let p=(0,u.Z)({props:e,name:"MuiFilledInput"}),{components:v={},componentsProps:Z,fullWidth:g=!1,inputComponent:x="input",multiline:y=!1,slotProps:S,slots:w={},type:R="text"}=p,C=(0,o.Z)(p,m),k=(0,n.Z)({},p,{fullWidth:g,inputComponent:x,multiline:y,type:R}),P=f(p),F={root:{ownerState:k},input:{ownerState:k}},I=(null!=S?S:Z)?(0,l.Z)(null!=S?S:Z,F):F,M=null!=(r=null!=(i=w.root)?i:v.Root)?r:b,$=null!=(a=null!=(d=w.input)?d:v.Input)?a:h;return(0,c.jsx)(s.ZP,(0,n.Z)({slots:{root:M,input:$},componentsProps:I,fullWidth:g,inputComponent:x,multiline:y,ref:t,type:R},C,{classes:P}))});v.muiName="Input",t.Z=v},9274:function(e,t,r){r.d(t,{_:function(){return a}});var o=r(3428),n=r(6520),i=r(5702),l=r(7044);function a(e){return(0,i.Z)("MuiFilledInput",e)}let s=(0,o.Z)({},l.Z,(0,n.Z)("MuiFilledInput",["root","underline","input"]));t.Z=s},4081:function(e,t,r){r.d(t,{Z:function(){return S}});var o=r(791),n=r(3428),i=r(2265),l=r(7042),a=r(5600),s=r(7927),d=r(5843),u=r(5454),p=r(8702),c=r(673),m=r(2592),f=r(6520),b=r(5702);function h(e){return(0,b.Z)("MuiFormControl",e)}(0,f.Z)("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);var v=r(7437);let Z=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],g=e=>{let{classes:t,margin:r,fullWidth:o}=e,n={root:["root","none"!==r&&`margin${(0,p.Z)(r)}`,o&&"fullWidth"]};return(0,a.Z)(n,h,t)},x=(0,d.ZP)("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:e},t)=>(0,n.Z)({},t.root,t[`margin${(0,p.Z)(e.margin)}`],e.fullWidth&&t.fullWidth)})(({ownerState:e})=>(0,n.Z)({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},"normal"===e.margin&&{marginTop:16,marginBottom:8},"dense"===e.margin&&{marginTop:8,marginBottom:4},e.fullWidth&&{width:"100%"})),y=i.forwardRef(function(e,t){let r;let a=(0,s.Z)({props:e,name:"MuiFormControl"}),{children:d,className:p,color:f="primary",component:b="div",disabled:h=!1,error:y=!1,focused:S,fullWidth:w=!1,hiddenLabel:R=!1,margin:C="none",required:k=!1,size:P="medium",variant:F="outlined"}=a,I=(0,o.Z)(a,Z),M=(0,n.Z)({},a,{color:f,component:b,disabled:h,error:y,fullWidth:w,hiddenLabel:R,margin:C,required:k,size:P,variant:F}),$=g(M),[O,z]=i.useState(()=>{let e=!1;return d&&i.Children.forEach(d,t=>{if(!(0,c.Z)(t,["Input","Select"]))return;let r=(0,c.Z)(t,["Select"])?t.props.input:t;r&&(0,u.B7)(r.props)&&(e=!0)}),e}),[B,j]=i.useState(()=>{let e=!1;return d&&i.Children.forEach(d,t=>{(0,c.Z)(t,["Input","Select"])&&((0,u.vd)(t.props,!0)||(0,u.vd)(t.props.inputProps,!0))&&(e=!0)}),e}),[W,A]=i.useState(!1);h&&W&&A(!1);let N=void 0===S||h?W:S,L=i.useMemo(()=>({adornedStart:O,setAdornedStart:z,color:f,disabled:h,error:y,filled:B,focused:N,fullWidth:w,hiddenLabel:R,size:P,onBlur:()=>{A(!1)},onEmpty:()=>{j(!1)},onFilled:()=>{j(!0)},onFocus:()=>{A(!0)},registerEffect:r,required:k,variant:F}),[O,f,h,y,B,N,w,R,r,k,P,F]);return(0,v.jsx)(m.Z.Provider,{value:L,children:(0,v.jsx)(x,(0,n.Z)({as:b,ownerState:M,className:(0,l.Z)($.root,p),ref:t},I,{children:d}))})});var S=y},2592:function(e,t,r){var o=r(2265);let n=o.createContext(void 0);t.Z=n},4379:function(e,t,r){r.d(t,{Z:function(){return o}});function o({props:e,states:t,muiFormControl:r}){return t.reduce((t,o)=>(t[o]=e[o],r&&void 0===e[o]&&(t[o]=r[o]),t),{})}},9592:function(e,t,r){r.d(t,{Z:function(){return i}});var o=r(2265),n=r(2592);function i(){return o.useContext(n.Z)}},1711:function(e,t,r){var o=r(791),n=r(3428),i=r(2265),l=r(5600),a=r(5959),s=r(3382),d=r(5843),u=r(7927),p=r(466),c=r(7437);let m=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],f=e=>{let{classes:t,disableUnderline:r}=e,o=(0,l.Z)({root:["root",!r&&"underline"],input:["input"]},p.l,t);return(0,n.Z)({},t,o)},b=(0,d.ZP)(s.Ej,{shouldForwardProp:e=>(0,d.FO)(e)||"classes"===e,name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[...(0,s.Gx)(e,t),!r.disableUnderline&&t.underline]}})(({theme:e,ownerState:t})=>{let r="light"===e.palette.mode,o=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(o=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),(0,n.Z)({position:"relative"},t.formControl&&{"label + &":{marginTop:16}},!t.disableUnderline&&{"&:after":{borderBottom:`2px solid ${(e.vars||e).palette[t.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${p.Z.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${p.Z.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&:before":{borderBottom:`1px solid ${o}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${p.Z.disabled}, .${p.Z.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${o}`}},[`&.${p.Z.disabled}:before`]:{borderBottomStyle:"dotted"}})}),h=(0,d.ZP)(s.rA,{name:"MuiInput",slot:"Input",overridesResolver:s._o})({}),v=i.forwardRef(function(e,t){var r,i,l,d;let p=(0,u.Z)({props:e,name:"MuiInput"}),{disableUnderline:v,components:Z={},componentsProps:g,fullWidth:x=!1,inputComponent:y="input",multiline:S=!1,slotProps:w,slots:R={},type:C="text"}=p,k=(0,o.Z)(p,m),P=f(p),F={root:{ownerState:{disableUnderline:v}}},I=(null!=w?w:g)?(0,a.Z)(null!=w?w:g,F):F,M=null!=(r=null!=(i=R.root)?i:Z.Root)?r:b,$=null!=(l=null!=(d=R.input)?d:Z.Input)?l:h;return(0,c.jsx)(s.ZP,(0,n.Z)({slots:{root:M,input:$},slotProps:I,fullWidth:x,inputComponent:y,multiline:S,ref:t,type:C},k,{classes:P}))});v.muiName="Input",t.Z=v},466:function(e,t,r){r.d(t,{l:function(){return a}});var o=r(3428),n=r(6520),i=r(5702),l=r(7044);function a(e){return(0,i.Z)("MuiInput",e)}let s=(0,o.Z)({},l.Z,(0,n.Z)("MuiInput",["root","underline","input"]));t.Z=s},3382:function(e,t,r){r.d(t,{rA:function(){return z},Ej:function(){return O},ZP:function(){return W},_o:function(){return M},Gx:function(){return I}});var o=r(791),n=r(3428),i=r(18),l=r(2265),a=r(7042),s=r(5600),d=r(5446),u=r(3655),p=r(4379),c=r(2592),m=r(9592),f=r(5843),b=r(7927),h=r(8702),v=r(7663),Z=r(8519),g=r(9538),x=r(7437);function y(e){let{styles:t,defaultTheme:r={}}=e,o="function"==typeof t?e=>t(null==e||0===Object.keys(e).length?r:e):t;return(0,x.jsx)(g.xB,{styles:o})}var S=r(5270),w=function({styles:e,themeId:t,defaultTheme:r={}}){let o=(0,S.Z)(r),n="function"==typeof e?e(t&&o[t]||o):e;return(0,x.jsx)(y,{styles:n})},R=r(3794),C=r(3469),k=r(5454),P=r(7044);let F=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],I=(e,t)=>{let{ownerState:r}=e;return[t.root,r.formControl&&t.formControl,r.startAdornment&&t.adornedStart,r.endAdornment&&t.adornedEnd,r.error&&t.error,"small"===r.size&&t.sizeSmall,r.multiline&&t.multiline,r.color&&t[`color${(0,h.Z)(r.color)}`],r.fullWidth&&t.fullWidth,r.hiddenLabel&&t.hiddenLabel]},M=(e,t)=>{let{ownerState:r}=e;return[t.input,"small"===r.size&&t.inputSizeSmall,r.multiline&&t.inputMultiline,"search"===r.type&&t.inputTypeSearch,r.startAdornment&&t.inputAdornedStart,r.endAdornment&&t.inputAdornedEnd,r.hiddenLabel&&t.inputHiddenLabel]},$=e=>{let{classes:t,color:r,disabled:o,error:n,endAdornment:i,focused:l,formControl:a,fullWidth:d,hiddenLabel:u,multiline:p,readOnly:c,size:m,startAdornment:f,type:b}=e,v={root:["root",`color${(0,h.Z)(r)}`,o&&"disabled",n&&"error",d&&"fullWidth",l&&"focused",a&&"formControl","small"===m&&"sizeSmall",p&&"multiline",f&&"adornedStart",i&&"adornedEnd",u&&"hiddenLabel",c&&"readOnly"],input:["input",o&&"disabled","search"===b&&"inputTypeSearch",p&&"inputMultiline","small"===m&&"inputSizeSmall",u&&"inputHiddenLabel",f&&"inputAdornedStart",i&&"inputAdornedEnd",c&&"readOnly"]};return(0,s.Z)(v,P.u,t)},O=(0,f.ZP)("div",{name:"MuiInputBase",slot:"Root",overridesResolver:I})(({theme:e,ownerState:t})=>(0,n.Z)({},e.typography.body1,{color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${P.Z.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"}},t.multiline&&(0,n.Z)({padding:"4px 0 5px"},"small"===t.size&&{paddingTop:1}),t.fullWidth&&{width:"100%"})),z=(0,f.ZP)("input",{name:"MuiInputBase",slot:"Input",overridesResolver:M})(({theme:e,ownerState:t})=>{let r="light"===e.palette.mode,o=(0,n.Z)({color:"currentColor"},e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:r?.42:.5},{transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})}),i={opacity:"0 !important"},l=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:r?.42:.5};return(0,n.Z)({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":o,"&::-moz-placeholder":o,"&:-ms-input-placeholder":o,"&::-ms-input-placeholder":o,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${P.Z.formControl} &`]:{"&::-webkit-input-placeholder":i,"&::-moz-placeholder":i,"&:-ms-input-placeholder":i,"&::-ms-input-placeholder":i,"&:focus::-webkit-input-placeholder":l,"&:focus::-moz-placeholder":l,"&:focus:-ms-input-placeholder":l,"&:focus::-ms-input-placeholder":l},[`&.${P.Z.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},"small"===t.size&&{paddingTop:1},t.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},"search"===t.type&&{MozAppearance:"textfield"})}),B=(0,x.jsx)(function(e){return(0,x.jsx)(w,(0,n.Z)({},e,{defaultTheme:R.Z,themeId:C.Z}))},{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),j=l.forwardRef(function(e,t){var r;let s=(0,b.Z)({props:e,name:"MuiInputBase"}),{"aria-describedby":f,autoComplete:h,autoFocus:g,className:y,components:S={},componentsProps:w={},defaultValue:R,disabled:C,disableInjectingGlobalStyles:P,endAdornment:I,fullWidth:M=!1,id:j,inputComponent:W="input",inputProps:A={},inputRef:N,maxRows:L,minRows:E,multiline:T=!1,name:q,onBlur:D,onChange:H,onClick:U,onFocus:V,onKeyDown:_,onKeyUp:K,placeholder:X,readOnly:G,renderSuffix:J,rows:Q,slotProps:Y={},slots:ee={},startAdornment:et,type:er="text",value:eo}=s,en=(0,o.Z)(s,F),ei=null!=A.value?A.value:eo,{current:el}=l.useRef(null!=ei),ea=l.useRef(),es=l.useCallback(e=>{},[]),ed=(0,v.Z)(ea,N,A.ref,es),[eu,ep]=l.useState(!1),ec=(0,m.Z)(),em=(0,p.Z)({props:s,muiFormControl:ec,states:["color","disabled","error","hiddenLabel","size","required","filled"]});em.focused=ec?ec.focused:eu,l.useEffect(()=>{!ec&&C&&eu&&(ep(!1),D&&D())},[ec,C,eu,D]);let ef=ec&&ec.onFilled,eb=ec&&ec.onEmpty,eh=l.useCallback(e=>{(0,k.vd)(e)?ef&&ef():eb&&eb()},[ef,eb]);(0,Z.Z)(()=>{el&&eh({value:ei})},[ei,eh,el]),l.useEffect(()=>{eh(ea.current)},[]);let ev=W,eZ=A;T&&"input"===ev&&(eZ=Q?(0,n.Z)({type:void 0,minRows:Q,maxRows:Q},eZ):(0,n.Z)({type:void 0,maxRows:L,minRows:E},eZ),ev=d.u),l.useEffect(()=>{ec&&ec.setAdornedStart(!!et)},[ec,et]);let eg=(0,n.Z)({},s,{color:em.color||"primary",disabled:em.disabled,endAdornment:I,error:em.error,focused:em.focused,formControl:ec,fullWidth:M,hiddenLabel:em.hiddenLabel,multiline:T,size:em.size,startAdornment:et,type:er}),ex=$(eg),ey=ee.root||S.Root||O,eS=Y.root||w.root||{},ew=ee.input||S.Input||z;return eZ=(0,n.Z)({},eZ,null!=(r=Y.input)?r:w.input),(0,x.jsxs)(l.Fragment,{children:[!P&&B,(0,x.jsxs)(ey,(0,n.Z)({},eS,!(0,u.X)(ey)&&{ownerState:(0,n.Z)({},eg,eS.ownerState)},{ref:t,onClick:e=>{ea.current&&e.currentTarget===e.target&&ea.current.focus(),U&&U(e)}},en,{className:(0,a.Z)(ex.root,eS.className,y,G&&"MuiInputBase-readOnly"),children:[et,(0,x.jsx)(c.Z.Provider,{value:null,children:(0,x.jsx)(ew,(0,n.Z)({ownerState:eg,"aria-invalid":em.error,"aria-describedby":f,autoComplete:h,autoFocus:g,defaultValue:R,disabled:em.disabled,id:j,onAnimationStart:e=>{eh("mui-auto-fill-cancel"===e.animationName?ea.current:{value:"x"})},name:q,placeholder:X,readOnly:G,required:em.required,rows:Q,value:ei,onKeyDown:_,onKeyUp:K,type:er},eZ,!(0,u.X)(ew)&&{as:ev,ownerState:(0,n.Z)({},eg,eZ.ownerState)},{ref:ed,className:(0,a.Z)(ex.input,eZ.className,G&&"MuiInputBase-readOnly"),onBlur:e=>{D&&D(e),A.onBlur&&A.onBlur(e),ec&&ec.onBlur?ec.onBlur(e):ep(!1)},onChange:(e,...t)=>{if(!el){let t=e.target||ea.current;if(null==t)throw Error((0,i.Z)(1));eh({value:t.value})}A.onChange&&A.onChange(e,...t),H&&H(e,...t)},onFocus:e=>{if(em.disabled){e.stopPropagation();return}V&&V(e),A.onFocus&&A.onFocus(e),ec&&ec.onFocus?ec.onFocus(e):ep(!0)}}))}),I,J?J((0,n.Z)({},em,{startAdornment:et})):null]}))]})});var W=j},7044:function(e,t,r){r.d(t,{u:function(){return i}});var o=r(6520),n=r(5702);function i(e){return(0,n.Z)("MuiInputBase",e)}let l=(0,o.Z)("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);t.Z=l},5454:function(e,t,r){function o(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function n(e,t=!1){return e&&(o(e.value)&&""!==e.value||t&&o(e.defaultValue)&&""!==e.defaultValue)}function i(e){return e.startAdornment}r.d(t,{B7:function(){return i},vd:function(){return n}})},819:function(e,t,r){r.d(t,{Z:function(){return F}});var o=r(791),n=r(3428),i=r(2265),l=r(5600),a=r(7042),s=r(4379),d=r(9592),u=r(8702),p=r(7927),c=r(5843),m=r(6520),f=r(5702);function b(e){return(0,f.Z)("MuiFormLabel",e)}let h=(0,m.Z)("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]);var v=r(7437);let Z=["children","className","color","component","disabled","error","filled","focused","required"],g=e=>{let{classes:t,color:r,focused:o,disabled:n,error:i,filled:a,required:s}=e,d={root:["root",`color${(0,u.Z)(r)}`,n&&"disabled",i&&"error",a&&"filled",o&&"focused",s&&"required"],asterisk:["asterisk",i&&"error"]};return(0,l.Z)(d,b,t)},x=(0,c.ZP)("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:e},t)=>(0,n.Z)({},t.root,"secondary"===e.color&&t.colorSecondary,e.filled&&t.filled)})(({theme:e,ownerState:t})=>(0,n.Z)({color:(e.vars||e).palette.text.secondary},e.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${h.focused}`]:{color:(e.vars||e).palette[t.color].main},[`&.${h.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${h.error}`]:{color:(e.vars||e).palette.error.main}})),y=(0,c.ZP)("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(({theme:e})=>({[`&.${h.error}`]:{color:(e.vars||e).palette.error.main}})),S=i.forwardRef(function(e,t){let r=(0,p.Z)({props:e,name:"MuiFormLabel"}),{children:i,className:l,component:u="label"}=r,c=(0,o.Z)(r,Z),m=(0,d.Z)(),f=(0,s.Z)({props:r,muiFormControl:m,states:["color","required","focused","disabled","error","filled"]}),b=(0,n.Z)({},r,{color:f.color||"primary",component:u,disabled:f.disabled,error:f.error,filled:f.filled,focused:f.focused,required:f.required}),h=g(b);return(0,v.jsxs)(x,(0,n.Z)({as:u,ownerState:b,className:(0,a.Z)(h.root,l),ref:t},c,{children:[i,f.required&&(0,v.jsxs)(y,{ownerState:b,"aria-hidden":!0,className:h.asterisk,children:[" ","*"]})]}))});function w(e){return(0,f.Z)("MuiInputLabel",e)}(0,m.Z)("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);let R=["disableAnimation","margin","shrink","variant","className"],C=e=>{let{classes:t,formControl:r,size:o,shrink:i,disableAnimation:a,variant:s,required:d}=e,u=(0,l.Z)({root:["root",r&&"formControl",!a&&"animated",i&&"shrink","small"===o&&"sizeSmall",s],asterisk:[d&&"asterisk"]},w,t);return(0,n.Z)({},t,u)},k=(0,c.ZP)(S,{shouldForwardProp:e=>(0,c.FO)(e)||"classes"===e,name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[{[`& .${h.asterisk}`]:t.asterisk},t.root,r.formControl&&t.formControl,"small"===r.size&&t.sizeSmall,r.shrink&&t.shrink,!r.disableAnimation&&t.animated,t[r.variant]]}})(({theme:e,ownerState:t})=>(0,n.Z)({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},t.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},"small"===t.size&&{transform:"translate(0, 17px) scale(1)"},t.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!t.disableAnimation&&{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},"filled"===t.variant&&(0,n.Z)({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},"small"===t.size&&{transform:"translate(12px, 13px) scale(1)"},t.shrink&&(0,n.Z)({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},"small"===t.size&&{transform:"translate(12px, 4px) scale(0.75)"})),"outlined"===t.variant&&(0,n.Z)({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},"small"===t.size&&{transform:"translate(14px, 9px) scale(1)"},t.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),P=i.forwardRef(function(e,t){let r=(0,p.Z)({name:"MuiInputLabel",props:e}),{disableAnimation:i=!1,shrink:l,className:u}=r,c=(0,o.Z)(r,R),m=(0,d.Z)(),f=l;void 0===f&&m&&(f=m.filled||m.focused||m.adornedStart);let b=(0,s.Z)({props:r,muiFormControl:m,states:["size","variant","required"]}),h=(0,n.Z)({},r,{disableAnimation:i,formControl:m,shrink:f,size:b.size,variant:b.variant,required:b.required}),Z=C(h);return(0,v.jsx)(k,(0,n.Z)({"data-shrink":f,ownerState:h,ref:t,className:(0,a.Z)(Z.root,u)},c,{classes:Z}))});var F=P},923:function(e,t,r){r.d(t,{Z:function(){return R}});var o,n=r(791),i=r(3428),l=r(2265),a=r(5600),s=r(5843),d=r(7437);let u=["children","classes","className","label","notched"],p=(0,s.ZP)("fieldset")({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),c=(0,s.ZP)("legend")(({ownerState:e,theme:t})=>(0,i.Z)({float:"unset",width:"auto",overflow:"hidden"},!e.withLabel&&{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})},e.withLabel&&(0,i.Z)({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},e.notched&&{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})})));var m=r(9592),f=r(4379),b=r(130),h=r(3382),v=r(7927);let Z=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],g=e=>{let{classes:t}=e,r=(0,a.Z)({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},b.e,t);return(0,i.Z)({},t,r)},x=(0,s.ZP)(h.Ej,{shouldForwardProp:e=>(0,s.FO)(e)||"classes"===e,name:"MuiOutlinedInput",slot:"Root",overridesResolver:h.Gx})(({theme:e,ownerState:t})=>{let r="light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return(0,i.Z)({position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${b.Z.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${b.Z.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:r}},[`&.${b.Z.focused} .${b.Z.notchedOutline}`]:{borderColor:(e.vars||e).palette[t.color].main,borderWidth:2},[`&.${b.Z.error} .${b.Z.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${b.Z.disabled} .${b.Z.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}},t.startAdornment&&{paddingLeft:14},t.endAdornment&&{paddingRight:14},t.multiline&&(0,i.Z)({padding:"16.5px 14px"},"small"===t.size&&{padding:"8.5px 14px"}))}),y=(0,s.ZP)(function(e){let{className:t,label:r,notched:l}=e,a=(0,n.Z)(e,u),s=null!=r&&""!==r,m=(0,i.Z)({},e,{notched:l,withLabel:s});return(0,d.jsx)(p,(0,i.Z)({"aria-hidden":!0,className:t,ownerState:m},a,{children:(0,d.jsx)(c,{ownerState:m,children:s?(0,d.jsx)("span",{children:r}):o||(o=(0,d.jsx)("span",{className:"notranslate",children:"​"}))})}))},{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}}),S=(0,s.ZP)(h.rA,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:h._o})(({theme:e,ownerState:t})=>(0,i.Z)({padding:"16.5px 14px"},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:"light"===e.palette.mode?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===e.palette.mode?null:"#fff",caretColor:"light"===e.palette.mode?null:"#fff",borderRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},"small"===t.size&&{padding:"8.5px 14px"},t.multiline&&{padding:0},t.startAdornment&&{paddingLeft:0},t.endAdornment&&{paddingRight:0})),w=l.forwardRef(function(e,t){var r,o,a,s,u;let p=(0,v.Z)({props:e,name:"MuiOutlinedInput"}),{components:c={},fullWidth:b=!1,inputComponent:w="input",label:R,multiline:C=!1,notched:k,slots:P={},type:F="text"}=p,I=(0,n.Z)(p,Z),M=g(p),$=(0,m.Z)(),O=(0,f.Z)({props:p,muiFormControl:$,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),z=(0,i.Z)({},p,{color:O.color||"primary",disabled:O.disabled,error:O.error,focused:O.focused,formControl:$,fullWidth:b,hiddenLabel:O.hiddenLabel,multiline:C,size:O.size,type:F}),B=null!=(r=null!=(o=P.root)?o:c.Root)?r:x,j=null!=(a=null!=(s=P.input)?s:c.Input)?a:S;return(0,d.jsx)(h.ZP,(0,i.Z)({slots:{root:B,input:j},renderSuffix:e=>(0,d.jsx)(y,{ownerState:z,className:M.notchedOutline,label:null!=R&&""!==R&&O.required?u||(u=(0,d.jsxs)(l.Fragment,{children:[R," ","*"]})):R,notched:void 0!==k?k:!!(e.startAdornment||e.filled||e.focused)}),fullWidth:b,inputComponent:w,multiline:C,ref:t,type:F},I,{classes:(0,i.Z)({},M,{notchedOutline:null})}))});w.muiName="Input";var R=w},130:function(e,t,r){r.d(t,{e:function(){return a}});var o=r(3428),n=r(6520),i=r(5702),l=r(7044);function a(e){return(0,i.Z)("MuiOutlinedInput",e)}let s=(0,o.Z)({},l.Z,(0,n.Z)("MuiOutlinedInput",["root","notchedOutline","input"]));t.Z=s},654:function(e,t,r){r.d(t,{Z:function(){return ee}});var o,n=r(3428),i=r(791),l=r(2265),a=r(7042),s=r(5959),d=r(18);r(9176);var u=r(5600),p=r(3931),c=r(8702),m=r(3375),f=r(6520),b=r(5702);function h(e){return(0,b.Z)("MuiNativeSelect",e)}let v=(0,f.Z)("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var Z=r(5843),g=r(7437);let x=["className","disabled","error","IconComponent","inputRef","variant"],y=e=>{let{classes:t,variant:r,disabled:o,multiple:n,open:i,error:l}=e,a={select:["select",r,o&&"disabled",n&&"multiple",l&&"error"],icon:["icon",`icon${(0,c.Z)(r)}`,i&&"iconOpen",o&&"disabled"]};return(0,u.Z)(a,h,t)},S=({ownerState:e,theme:t})=>(0,n.Z)({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":(0,n.Z)({},t.vars?{backgroundColor:`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:"light"===t.palette.mode?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${v.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(t.vars||t).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},"filled"===e.variant&&{"&&&":{paddingRight:32}},"outlined"===e.variant&&{borderRadius:(t.vars||t).shape.borderRadius,"&:focus":{borderRadius:(t.vars||t).shape.borderRadius},"&&&":{paddingRight:32}}),w=(0,Z.ZP)("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Z.FO,overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.select,t[r.variant],r.error&&t.error,{[`&.${v.multiple}`]:t.multiple}]}})(S),R=({ownerState:e,theme:t})=>(0,n.Z)({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(t.vars||t).palette.action.active,[`&.${v.disabled}`]:{color:(t.vars||t).palette.action.disabled}},e.open&&{transform:"rotate(180deg)"},"filled"===e.variant&&{right:7},"outlined"===e.variant&&{right:7}),C=(0,Z.ZP)("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.icon,r.variant&&t[`icon${(0,c.Z)(r.variant)}`],r.open&&t.iconOpen]}})(R),k=l.forwardRef(function(e,t){let{className:r,disabled:o,error:s,IconComponent:d,inputRef:u,variant:p="standard"}=e,c=(0,i.Z)(e,x),m=(0,n.Z)({},e,{disabled:o,variant:p,error:s}),f=y(m);return(0,g.jsxs)(l.Fragment,{children:[(0,g.jsx)(w,(0,n.Z)({ownerState:m,className:(0,a.Z)(f.select,r),disabled:o,ref:u||t},c)),e.multiple?null:(0,g.jsx)(C,{as:d,ownerState:m,className:f.icon})]})});var P=r(5454),F=r(7663),I=r(3292);function M(e){return(0,b.Z)("MuiSelect",e)}let $=(0,f.Z)("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),O=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],z=(0,Z.ZP)("div",{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[{[`&.${$.select}`]:t.select},{[`&.${$.select}`]:t[r.variant]},{[`&.${$.error}`]:t.error},{[`&.${$.multiple}`]:t.multiple}]}})(S,{[`&.${$.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),B=(0,Z.ZP)("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.icon,r.variant&&t[`icon${(0,c.Z)(r.variant)}`],r.open&&t.iconOpen]}})(R),j=(0,Z.ZP)("input",{shouldForwardProp:e=>(0,Z.Dz)(e)&&"classes"!==e,name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,t)=>t.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function W(e,t){return"object"==typeof t&&null!==t?e===t:String(e)===String(t)}let A=e=>{let{classes:t,variant:r,disabled:o,multiple:n,open:i,error:l}=e,a={select:["select",r,o&&"disabled",n&&"multiple",l&&"error"],icon:["icon",`icon${(0,c.Z)(r)}`,i&&"iconOpen",o&&"disabled"],nativeInput:["nativeInput"]};return(0,u.Z)(a,M,t)},N=l.forwardRef(function(e,t){var r;let s,u;let{"aria-describedby":c,"aria-label":f,autoFocus:b,autoWidth:h,children:v,className:Z,defaultOpen:x,defaultValue:y,disabled:S,displayEmpty:w,error:R=!1,IconComponent:C,inputRef:k,labelId:M,MenuProps:$={},multiple:N,name:L,onBlur:E,onChange:T,onClose:q,onFocus:D,onOpen:H,open:U,readOnly:V,renderValue:_,SelectDisplayProps:K={},tabIndex:X,value:G,variant:J="standard"}=e,Q=(0,i.Z)(e,O),[Y,ee]=(0,I.Z)({controlled:G,default:y,name:"Select"}),[et,er]=(0,I.Z)({controlled:U,default:x,name:"Select"}),eo=l.useRef(null),en=l.useRef(null),[ei,el]=l.useState(null),{current:ea}=l.useRef(null!=U),[es,ed]=l.useState(),eu=(0,F.Z)(t,k),ep=l.useCallback(e=>{en.current=e,e&&el(e)},[]),ec=null==ei?void 0:ei.parentNode;l.useImperativeHandle(eu,()=>({focus:()=>{en.current.focus()},node:eo.current,value:Y}),[Y]),l.useEffect(()=>{x&&et&&ei&&!ea&&(ed(h?null:ec.clientWidth),en.current.focus())},[ei,h]),l.useEffect(()=>{b&&en.current.focus()},[b]),l.useEffect(()=>{if(!M)return;let e=(0,p.Z)(en.current).getElementById(M);if(e){let t=()=>{getSelection().isCollapsed&&en.current.focus()};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}},[M]);let em=(e,t)=>{e?H&&H(t):q&&q(t),ea||(ed(h?null:ec.clientWidth),er(e))},ef=l.Children.toArray(v),eb=e=>t=>{let r;if(t.currentTarget.hasAttribute("tabindex")){if(N){r=Array.isArray(Y)?Y.slice():[];let t=Y.indexOf(e.props.value);-1===t?r.push(e.props.value):r.splice(t,1)}else r=e.props.value;if(e.props.onClick&&e.props.onClick(t),Y!==r&&(ee(r),T)){let o=t.nativeEvent||t,n=new o.constructor(o.type,o);Object.defineProperty(n,"target",{writable:!0,value:{value:r,name:L}}),T(n,e)}N||em(!1,t)}},eh=null!==ei&&et;delete Q["aria-invalid"];let ev=[],eZ=!1;((0,P.vd)({value:Y})||w)&&(_?s=_(Y):eZ=!0);let eg=ef.map(e=>{let t;if(!l.isValidElement(e))return null;if(N){if(!Array.isArray(Y))throw Error((0,d.Z)(2));(t=Y.some(t=>W(t,e.props.value)))&&eZ&&ev.push(e.props.children)}else(t=W(Y,e.props.value))&&eZ&&(u=e.props.children);return l.cloneElement(e,{"aria-selected":t?"true":"false",onClick:eb(e),onKeyUp:t=>{" "===t.key&&t.preventDefault(),e.props.onKeyUp&&e.props.onKeyUp(t)},role:"option",selected:t,value:void 0,"data-value":e.props.value})});eZ&&(s=N?0===ev.length?null:ev.reduce((e,t,r)=>(e.push(t),r<ev.length-1&&e.push(", "),e),[]):u);let ex=es;!h&&ea&&ei&&(ex=ec.clientWidth);let ey=K.id||(L?`mui-component-select-${L}`:void 0),eS=(0,n.Z)({},e,{variant:J,value:Y,open:eh,error:R}),ew=A(eS);return(0,g.jsxs)(l.Fragment,{children:[(0,g.jsx)(z,(0,n.Z)({ref:ep,tabIndex:void 0!==X?X:S?null:0,role:"button","aria-disabled":S?"true":void 0,"aria-expanded":eh?"true":"false","aria-haspopup":"listbox","aria-label":f,"aria-labelledby":[M,ey].filter(Boolean).join(" ")||void 0,"aria-describedby":c,onKeyDown:e=>{V||-1===[" ","ArrowUp","ArrowDown","Enter"].indexOf(e.key)||(e.preventDefault(),em(!0,e))},onMouseDown:S||V?null:e=>{0===e.button&&(e.preventDefault(),en.current.focus(),em(!0,e))},onBlur:e=>{!eh&&E&&(Object.defineProperty(e,"target",{writable:!0,value:{value:Y,name:L}}),E(e))},onFocus:D},K,{ownerState:eS,className:(0,a.Z)(K.className,ew.select,Z),id:ey,children:null!=(r=s)&&("string"!=typeof r||r.trim())?s:o||(o=(0,g.jsx)("span",{className:"notranslate",children:"​"}))})),(0,g.jsx)(j,(0,n.Z)({"aria-invalid":R,value:Array.isArray(Y)?Y.join(","):Y,name:L,ref:eo,"aria-hidden":!0,onChange:e=>{let t=ef.find(t=>t.props.value===e.target.value);void 0!==t&&(ee(t.props.value),T&&T(e,t))},tabIndex:-1,disabled:S,className:ew.nativeInput,autoFocus:b,ownerState:eS},Q)),(0,g.jsx)(B,{as:C,className:ew.icon,ownerState:eS}),(0,g.jsx)(m.Z,(0,n.Z)({id:`menu-${L||""}`,anchorEl:ec,open:eh,onClose:e=>{em(!1,e)},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},$,{MenuListProps:(0,n.Z)({"aria-labelledby":M,role:"listbox",disableListWrap:!0},$.MenuListProps),PaperProps:(0,n.Z)({},$.PaperProps,{style:(0,n.Z)({minWidth:ex},null!=$.PaperProps?$.PaperProps.style:null)}),children:eg}))]})});var L=r(4379),E=r(9592),T=r(2246),q=r(1711),D=r(7328),H=r(923),U=r(7927);let V=["autoWidth","children","classes","className","defaultOpen","displayEmpty","IconComponent","id","input","inputProps","label","labelId","MenuProps","multiple","native","onClose","onOpen","open","renderValue","SelectDisplayProps","variant"],_=["root"],K=e=>{let{classes:t}=e;return t},X={name:"MuiSelect",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>(0,Z.FO)(e)&&"variant"!==e,slot:"Root"},G=(0,Z.ZP)(q.Z,X)(""),J=(0,Z.ZP)(H.Z,X)(""),Q=(0,Z.ZP)(D.Z,X)(""),Y=l.forwardRef(function(e,t){let r=(0,U.Z)({name:"MuiSelect",props:e}),{autoWidth:o=!1,children:d,classes:u={},className:p,defaultOpen:c=!1,displayEmpty:m=!1,IconComponent:f=T.Z,id:b,input:h,inputProps:v,label:Z,labelId:x,MenuProps:y,multiple:S=!1,native:w=!1,onClose:R,onOpen:C,open:P,renderValue:I,SelectDisplayProps:M,variant:$="outlined"}=r,O=(0,i.Z)(r,V),z=w?k:N,B=(0,E.Z)(),j=(0,L.Z)({props:r,muiFormControl:B,states:["variant","error"]}),W=j.variant||$,A=(0,n.Z)({},r,{variant:W,classes:u}),q=K(A),D=(0,i.Z)(q,_),H=h||({standard:(0,g.jsx)(G,{ownerState:A}),outlined:(0,g.jsx)(J,{label:Z,ownerState:A}),filled:(0,g.jsx)(Q,{ownerState:A})})[W],X=(0,F.Z)(t,H.ref);return(0,g.jsx)(l.Fragment,{children:l.cloneElement(H,(0,n.Z)({inputComponent:z,inputProps:(0,n.Z)({children:d,error:j.error,IconComponent:f,variant:W,type:void 0,multiple:S},w?{id:b}:{autoWidth:o,defaultOpen:c,displayEmpty:m,labelId:x,MenuProps:y,onClose:R,onOpen:C,open:P,renderValue:I,SelectDisplayProps:(0,n.Z)({id:b},M)},v,{classes:v?(0,s.Z)(D,v.classes):D},h?h.props.inputProps:{})},S&&w&&"outlined"===W?{notched:!0}:{},{ref:X,className:(0,a.Z)(H.props.className,p,q.root)},!h&&{variant:W},O))})});Y.muiName="Select";var ee=Y},1975:function(e,t,r){r.d(t,{Z:function(){return W}});var o,n=r(3428),i=r(791),l=r(2265),a=r(7042),s=r(5600),d=r(3449),u=r(5843),p=r(7927),c=r(1711),m=r(7328),f=r(923),b=r(819),h=r(4081),v=r(4379),Z=r(9592),g=r(8702),x=r(6520),y=r(5702);function S(e){return(0,y.Z)("MuiFormHelperText",e)}let w=(0,x.Z)("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var R=r(7437);let C=["children","className","component","disabled","error","filled","focused","margin","required","variant"],k=e=>{let{classes:t,contained:r,size:o,disabled:n,error:i,filled:l,focused:a,required:d}=e,u={root:["root",n&&"disabled",i&&"error",o&&`size${(0,g.Z)(o)}`,r&&"contained",a&&"focused",l&&"filled",d&&"required"]};return(0,s.Z)(u,S,t)},P=(0,u.ZP)("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,r.size&&t[`size${(0,g.Z)(r.size)}`],r.contained&&t.contained,r.filled&&t.filled]}})(({theme:e,ownerState:t})=>(0,n.Z)({color:(e.vars||e).palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${w.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${w.error}`]:{color:(e.vars||e).palette.error.main}},"small"===t.size&&{marginTop:4},t.contained&&{marginLeft:14,marginRight:14})),F=l.forwardRef(function(e,t){let r=(0,p.Z)({props:e,name:"MuiFormHelperText"}),{children:l,className:s,component:d="p"}=r,u=(0,i.Z)(r,C),c=(0,Z.Z)(),m=(0,v.Z)({props:r,muiFormControl:c,states:["variant","size","disabled","error","filled","focused","required"]}),f=(0,n.Z)({},r,{component:d,contained:"filled"===m.variant||"outlined"===m.variant,variant:m.variant,size:m.size,disabled:m.disabled,error:m.error,filled:m.filled,focused:m.focused,required:m.required}),b=k(f);return(0,R.jsx)(P,(0,n.Z)({as:d,ownerState:f,className:(0,a.Z)(b.root,s),ref:t},u,{children:" "===l?o||(o=(0,R.jsx)("span",{className:"notranslate",children:"​"})):l}))});var I=r(654);function M(e){return(0,y.Z)("MuiTextField",e)}(0,x.Z)("MuiTextField",["root"]);let $=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],O={standard:c.Z,filled:m.Z,outlined:f.Z},z=e=>{let{classes:t}=e;return(0,s.Z)({root:["root"]},M,t)},B=(0,u.ZP)(h.Z,{name:"MuiTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({}),j=l.forwardRef(function(e,t){let r=(0,p.Z)({props:e,name:"MuiTextField"}),{autoComplete:o,autoFocus:l=!1,children:s,className:u,color:c="primary",defaultValue:m,disabled:f=!1,error:h=!1,FormHelperTextProps:v,fullWidth:Z=!1,helperText:g,id:x,InputLabelProps:y,inputProps:S,InputProps:w,inputRef:C,label:k,maxRows:P,minRows:M,multiline:j=!1,name:W,onBlur:A,onChange:N,onFocus:L,placeholder:E,required:T=!1,rows:q,select:D=!1,SelectProps:H,type:U,value:V,variant:_="outlined"}=r,K=(0,i.Z)(r,$),X=(0,n.Z)({},r,{autoFocus:l,color:c,disabled:f,error:h,fullWidth:Z,multiline:j,required:T,select:D,variant:_}),G=z(X),J={};"outlined"===_&&(y&&void 0!==y.shrink&&(J.notched=y.shrink),J.label=k),D&&(H&&H.native||(J.id=void 0),J["aria-describedby"]=void 0);let Q=(0,d.Z)(x),Y=g&&Q?`${Q}-helper-text`:void 0,ee=k&&Q?`${Q}-label`:void 0,et=O[_],er=(0,R.jsx)(et,(0,n.Z)({"aria-describedby":Y,autoComplete:o,autoFocus:l,defaultValue:m,fullWidth:Z,multiline:j,name:W,rows:q,maxRows:P,minRows:M,type:U,value:V,id:Q,inputRef:C,onBlur:A,onChange:N,onFocus:L,placeholder:E,inputProps:S},J,w));return(0,R.jsxs)(B,(0,n.Z)({className:(0,a.Z)(G.root,u),disabled:f,error:h,fullWidth:Z,ref:t,required:T,color:c,variant:_,ownerState:X},K,{children:[null!=k&&""!==k&&(0,R.jsx)(b.Z,(0,n.Z)({htmlFor:Q,id:ee},y,{children:k})),D?(0,R.jsx)(I.Z,(0,n.Z)({"aria-describedby":Y,id:Q,labelId:ee,value:V,input:er},H,{children:s})):er,g&&(0,R.jsx)(F,(0,n.Z)({id:Y},v,{children:g}))]}))});var W=j},2246:function(e,t,r){r(2265);var o=r(9782),n=r(7437);t.Z=(0,o.Z)((0,n.jsx)("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown")}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[716],{8938:function(e,t,a){"use strict";a.d(t,{Z:function(){return W}});var n=a(791),i=a(3428),r=a(2265),s=a(7042),u=a(1380),o=a(5702),l=a(5600),d=a(8153),c=a(9190),h=a(4775),p=a(7437);let m=["className","component","disableGutters","fixed","maxWidth","classes"],x=(0,h.Z)(),f=(0,c.Z)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,t[`maxWidth${(0,u.Z)(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),g=e=>(0,d.Z)({props:e,name:"MuiContainer",defaultTheme:x}),b=(e,t)=>{let{classes:a,fixed:n,disableGutters:i,maxWidth:r}=e,s={root:["root",r&&`maxWidth${(0,u.Z)(String(r))}`,n&&"fixed",i&&"disableGutters"]};return(0,l.Z)(s,e=>(0,o.Z)(t,e),a)};var v=a(8702),C=a(5843),S=a(7927);let Z=function(e={}){let{createStyledComponent:t=f,useThemeProps:a=g,componentName:u="MuiContainer"}=e,o=t(({theme:e,ownerState:t})=>(0,i.Z)({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!t.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}),({theme:e,ownerState:t})=>t.fixed&&Object.keys(e.breakpoints.values).reduce((t,a)=>{let n=e.breakpoints.values[a];return 0!==n&&(t[e.breakpoints.up(a)]={maxWidth:`${n}${e.breakpoints.unit}`}),t},{}),({theme:e,ownerState:t})=>(0,i.Z)({},"xs"===t.maxWidth&&{[e.breakpoints.up("xs")]:{maxWidth:Math.max(e.breakpoints.values.xs,444)}},t.maxWidth&&"xs"!==t.maxWidth&&{[e.breakpoints.up(t.maxWidth)]:{maxWidth:`${e.breakpoints.values[t.maxWidth]}${e.breakpoints.unit}`}})),l=r.forwardRef(function(e,t){let r=a(e),{className:l,component:d="div",disableGutters:c=!1,fixed:h=!1,maxWidth:x="lg"}=r,f=(0,n.Z)(r,m),g=(0,i.Z)({},r,{component:d,disableGutters:c,fixed:h,maxWidth:x}),v=b(g,u);return(0,p.jsx)(o,(0,i.Z)({as:d,ownerState:g,className:(0,s.Z)(v.root,l),ref:t},f))});return l}({createStyledComponent:(0,C.ZP)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,t[`maxWidth${(0,v.Z)(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),useThemeProps:e=>(0,S.Z)({props:e,name:"MuiContainer"})});var W=Z},8642:function(e,t,a){Promise.resolve().then(a.bind(a,6722))},6722:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return p}});var n=a(7437),i=a(2265),r=a(1396),s=a.n(r),u=a(5551),o=a(1975),l=a(8938),d=a(3226),c=a(4033),h=a(3571);function p(){let e=(0,c.useRouter)(),[t,a]=i.useState(""),[r,p]=i.useState(""),[m,x]=i.useState(""),[f,g]=i.useState(!1),[b,v]=i.useState(null),C=i.useCallback(async()=>{let{data:e,error:t}=await h.OQ.auth.refreshSession();e&&v(e.user)},[]);i.useEffect(()=>{C()},[C]);let S=async a=>{if(g(!0),x(""),a.stopPropagation(),a.preventDefault(),!b){let{data:a,error:n}=await h.OQ.auth.signInWithPassword({email:t,password:r});n?x(n.message):e.push("/")}g(!1)};return b?(0,n.jsxs)("div",{style:{textAlign:"center"},children:["You're already logged in as ",b.email,"."]}):(0,n.jsxs)(l.Z,{component:"main",maxWidth:"xs",children:[(0,n.jsx)(d.Z,{component:"h1",variant:"h5",children:"Sign in"}),(0,n.jsx)("form",{children:!b&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.Z,{disabled:f,variant:"outlined",margin:"normal",required:!0,fullWidth:!0,id:"email",label:"Email Address",name:"email",autoComplete:"email",autoFocus:!0,onChange:e=>a(e.target.value),value:t,error:!!m}),(0,n.jsx)(o.Z,{disabled:f,variant:"outlined",margin:"normal",required:!0,fullWidth:!0,name:"password",label:"Password",type:"password",id:"password",autoComplete:"current-password",onChange:e=>p(e.target.value),value:r,error:!!m,helperText:m}),(0,n.jsx)(u.Z,{type:"submit",disabled:f,sx:{marginTop:"1em"},fullWidth:!0,variant:"contained",color:"primary",onClick:S,children:"Sign In"}),(0,n.jsxs)("p",{children:["Don't have an account yet? ",(0,n.jsx)(s(),{href:"/auth/signup",children:"Sign up"})]})]})})]})}},3571:function(e,t,a){"use strict";a.d(t,{Ho:function(){return c},OQ:function(){return s},aC:function(){return o}});var n=a(7437),i=a(2265),r=a(3082);let s=(0,r.createClientComponentClient)(),u=(0,i.createContext)({}),o=()=>(0,i.useContext)(u),l=(e,t)=>s.auth.signInWithPassword({email:e,password:t}),d=()=>s.auth.signOut(),c=e=>{let{children:t}=e,[a,r]=(0,i.useState)(null),[o,c]=(0,i.useState)(!1),h=(0,i.useCallback)(async()=>{let{data:e,error:t}=await s.auth.refreshSession();e&&r(e.user)},[]);return(0,i.useEffect)(()=>{h();let{data:e}=s.auth.onAuthStateChange(async(e,t)=>{"PASSWORD_RECOVERY"==e?c(!1):"SIGNED_IN"===e&&t?(r(t.user),c(!0)):"SIGNED_OUT"===e&&(c(!1),r(null))});return()=>{e.subscription.unsubscribe()}},[h]),(0,n.jsx)(u.Provider,{value:{loggedIn:o,user:a,login:l,logout:d},children:t})}}},function(e){e.O(0,[293,808,548,82,975,971,596,744],function(){return e(e.s=8642)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[271],{8938:function(e,t,a){"use strict";a.d(t,{Z:function(){return k}});var n=a(791),i=a(3428),r=a(2265),s=a(7042),o=a(1380),u=a(5702),l=a(5600),d=a(8153),c=a(9190),h=a(4775),p=a(7437);let m=["className","component","disableGutters","fixed","maxWidth","classes"],x=(0,h.Z)(),f=(0,c.Z)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,t[`maxWidth${(0,o.Z)(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),b=e=>(0,d.Z)({props:e,name:"MuiContainer",defaultTheme:x}),g=(e,t)=>{let{classes:a,fixed:n,disableGutters:i,maxWidth:r}=e,s={root:["root",r&&`maxWidth${(0,o.Z)(String(r))}`,n&&"fixed",i&&"disableGutters"]};return(0,l.Z)(s,e=>(0,u.Z)(t,e),a)};var v=a(8702),C=a(5843),S=a(7927);let Z=function(e={}){let{createStyledComponent:t=f,useThemeProps:a=b,componentName:o="MuiContainer"}=e,u=t(({theme:e,ownerState:t})=>(0,i.Z)({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!t.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}),({theme:e,ownerState:t})=>t.fixed&&Object.keys(e.breakpoints.values).reduce((t,a)=>{let n=e.breakpoints.values[a];return 0!==n&&(t[e.breakpoints.up(a)]={maxWidth:`${n}${e.breakpoints.unit}`}),t},{}),({theme:e,ownerState:t})=>(0,i.Z)({},"xs"===t.maxWidth&&{[e.breakpoints.up("xs")]:{maxWidth:Math.max(e.breakpoints.values.xs,444)}},t.maxWidth&&"xs"!==t.maxWidth&&{[e.breakpoints.up(t.maxWidth)]:{maxWidth:`${e.breakpoints.values[t.maxWidth]}${e.breakpoints.unit}`}})),l=r.forwardRef(function(e,t){let r=a(e),{className:l,component:d="div",disableGutters:c=!1,fixed:h=!1,maxWidth:x="lg"}=r,f=(0,n.Z)(r,m),b=(0,i.Z)({},r,{component:d,disableGutters:c,fixed:h,maxWidth:x}),v=g(b,o);return(0,p.jsx)(u,(0,i.Z)({as:d,ownerState:b,className:(0,s.Z)(v.root,l),ref:t},f))});return l}({createStyledComponent:(0,C.ZP)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,t[`maxWidth${(0,v.Z)(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),useThemeProps:e=>(0,S.Z)({props:e,name:"MuiContainer"})});var k=Z},1771:function(e,t,a){Promise.resolve().then(a.bind(a,3948))},3948:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return p}});var n=a(7437),i=a(2265),r=a(1396),s=a.n(r),o=a(5551),u=a(1975),l=a(8938),d=a(3226),c=a(4033),h=a(3571);function p(){let e=(0,c.useRouter)(),[t,a]=i.useState(""),[r,p]=i.useState(""),[m,x]=i.useState(""),[f,b]=i.useState(!1),[g,v]=i.useState(null),C=i.useCallback(async()=>{let{data:e,error:t}=await h.OQ.auth.refreshSession();e&&v(e.user)},[]);i.useEffect(()=>{C()},[C]);let S=async a=>{if(b(!0),x(""),a.stopPropagation(),a.preventDefault(),!g){let{data:a,error:n}=await h.OQ.auth.signUp({email:t,password:r,options:{emailRedirectTo:"".concat(location.origin,"/auth/callback")}});n?x(n.message):e.push("/")}b(!1)};return(0,n.jsxs)(l.Z,{component:"main",maxWidth:"xs",children:[(0,n.jsx)(d.Z,{component:"h1",variant:"h5",children:"Sign up"}),(0,n.jsx)("p",{children:(0,n.jsx)(d.Z,{variant:"body1",children:"An account helps you easily save, view, and share your evals."})}),(0,n.jsxs)("form",{children:[!g&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u.Z,{disabled:f,variant:"outlined",margin:"normal",required:!0,fullWidth:!0,id:"email",label:"Email Address",name:"email",autoComplete:"email",autoFocus:!0,onChange:e=>a(e.target.value),value:t,error:!!m}),(0,n.jsx)(u.Z,{disabled:f,variant:"outlined",margin:"normal",required:!0,fullWidth:!0,name:"password",label:"Password",type:"password",id:"password",autoComplete:"current-password",onChange:e=>p(e.target.value),value:r,error:!!m,helperText:m}),(0,n.jsx)(o.Z,{type:"submit",disabled:f,sx:{marginTop:"1em"},fullWidth:!0,variant:"contained",color:"primary",onClick:S,children:"Sign Up"})]}),(0,n.jsxs)("p",{children:["Already have an account? ",(0,n.jsx)(s(),{href:"/auth/login",children:"Sign in"})]})]})]})}},3571:function(e,t,a){"use strict";a.d(t,{Ho:function(){return c},OQ:function(){return s},aC:function(){return u}});var n=a(7437),i=a(2265),r=a(3082);let s=(0,r.createClientComponentClient)(),o=(0,i.createContext)({}),u=()=>(0,i.useContext)(o),l=(e,t)=>s.auth.signInWithPassword({email:e,password:t}),d=()=>s.auth.signOut(),c=e=>{let{children:t}=e,[a,r]=(0,i.useState)(null),[u,c]=(0,i.useState)(!1),h=(0,i.useCallback)(async()=>{let{data:e,error:t}=await s.auth.refreshSession();e&&r(e.user)},[]);return(0,i.useEffect)(()=>{h();let{data:e}=s.auth.onAuthStateChange(async(e,t)=>{"PASSWORD_RECOVERY"==e?c(!1):"SIGNED_IN"===e&&t?(r(t.user),c(!0)):"SIGNED_OUT"===e&&(c(!1),r(null))});return()=>{e.subscription.unsubscribe()}},[h]),(0,n.jsx)(o.Provider,{value:{loggedIn:u,user:a,login:l,logout:d},children:t})}},1396:function(e,t,a){e.exports=a(6685)}},function(e){e.O(0,[482,82,613,685,971,596,744],function(){return e(e.s=1771)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[271],{8938:function(e,t,a){"use strict";a.d(t,{Z:function(){return k}});var n=a(791),i=a(3428),r=a(2265),s=a(7042),o=a(1380),u=a(5702),l=a(5600),d=a(8153),c=a(9190),h=a(4775),p=a(7437);let m=["className","component","disableGutters","fixed","maxWidth","classes"],x=(0,h.Z)(),f=(0,c.Z)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,t[`maxWidth${(0,o.Z)(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),b=e=>(0,d.Z)({props:e,name:"MuiContainer",defaultTheme:x}),g=(e,t)=>{let{classes:a,fixed:n,disableGutters:i,maxWidth:r}=e,s={root:["root",r&&`maxWidth${(0,o.Z)(String(r))}`,n&&"fixed",i&&"disableGutters"]};return(0,l.Z)(s,e=>(0,u.Z)(t,e),a)};var v=a(8702),C=a(5843),S=a(7927);let Z=function(e={}){let{createStyledComponent:t=f,useThemeProps:a=b,componentName:o="MuiContainer"}=e,u=t(({theme:e,ownerState:t})=>(0,i.Z)({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!t.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}),({theme:e,ownerState:t})=>t.fixed&&Object.keys(e.breakpoints.values).reduce((t,a)=>{let n=e.breakpoints.values[a];return 0!==n&&(t[e.breakpoints.up(a)]={maxWidth:`${n}${e.breakpoints.unit}`}),t},{}),({theme:e,ownerState:t})=>(0,i.Z)({},"xs"===t.maxWidth&&{[e.breakpoints.up("xs")]:{maxWidth:Math.max(e.breakpoints.values.xs,444)}},t.maxWidth&&"xs"!==t.maxWidth&&{[e.breakpoints.up(t.maxWidth)]:{maxWidth:`${e.breakpoints.values[t.maxWidth]}${e.breakpoints.unit}`}})),l=r.forwardRef(function(e,t){let r=a(e),{className:l,component:d="div",disableGutters:c=!1,fixed:h=!1,maxWidth:x="lg"}=r,f=(0,n.Z)(r,m),b=(0,i.Z)({},r,{component:d,disableGutters:c,fixed:h,maxWidth:x}),v=g(b,o);return(0,p.jsx)(u,(0,i.Z)({as:d,ownerState:b,className:(0,s.Z)(v.root,l),ref:t},f))});return l}({createStyledComponent:(0,C.ZP)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,t[`maxWidth${(0,v.Z)(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),useThemeProps:e=>(0,S.Z)({props:e,name:"MuiContainer"})});var k=Z},1771:function(e,t,a){Promise.resolve().then(a.bind(a,3948))},3948:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return p}});var n=a(7437),i=a(2265),r=a(1396),s=a.n(r),o=a(5551),u=a(1975),l=a(8938),d=a(3226),c=a(4033),h=a(3571);function p(){let e=(0,c.useRouter)(),[t,a]=i.useState(""),[r,p]=i.useState(""),[m,x]=i.useState(""),[f,b]=i.useState(!1),[g,v]=i.useState(null),C=i.useCallback(async()=>{let{data:e,error:t}=await h.OQ.auth.refreshSession();e&&v(e.user)},[]);i.useEffect(()=>{C()},[C]);let S=async a=>{if(b(!0),x(""),a.stopPropagation(),a.preventDefault(),!g){let{data:a,error:n}=await h.OQ.auth.signUp({email:t,password:r,options:{emailRedirectTo:"".concat(location.origin,"/auth/callback")}});n?x(n.message):e.push("/")}b(!1)};return(0,n.jsxs)(l.Z,{component:"main",maxWidth:"xs",children:[(0,n.jsx)(d.Z,{component:"h1",variant:"h5",children:"Sign up"}),(0,n.jsx)("p",{children:(0,n.jsx)(d.Z,{variant:"body1",children:"An account helps you easily save, view, and share your evals."})}),(0,n.jsxs)("form",{children:[!g&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u.Z,{disabled:f,variant:"outlined",margin:"normal",required:!0,fullWidth:!0,id:"email",label:"Email Address",name:"email",autoComplete:"email",autoFocus:!0,onChange:e=>a(e.target.value),value:t,error:!!m}),(0,n.jsx)(u.Z,{disabled:f,variant:"outlined",margin:"normal",required:!0,fullWidth:!0,name:"password",label:"Password",type:"password",id:"password",autoComplete:"current-password",onChange:e=>p(e.target.value),value:r,error:!!m,helperText:m}),(0,n.jsx)(o.Z,{type:"submit",disabled:f,sx:{marginTop:"1em"},fullWidth:!0,variant:"contained",color:"primary",onClick:S,children:"Sign Up"})]}),(0,n.jsxs)("p",{children:["Already have an account? ",(0,n.jsx)(s(),{href:"/auth/login",children:"Sign in"})]})]})]})}},3571:function(e,t,a){"use strict";a.d(t,{Ho:function(){return c},OQ:function(){return s},aC:function(){return u}});var n=a(7437),i=a(2265),r=a(3082);let s=(0,r.createClientComponentClient)(),o=(0,i.createContext)({}),u=()=>(0,i.useContext)(o),l=(e,t)=>s.auth.signInWithPassword({email:e,password:t}),d=()=>s.auth.signOut(),c=e=>{let{children:t}=e,[a,r]=(0,i.useState)(null),[u,c]=(0,i.useState)(!1),h=(0,i.useCallback)(async()=>{let{data:e,error:t}=await s.auth.refreshSession();e&&r(e.user)},[]);return(0,i.useEffect)(()=>{h();let{data:e}=s.auth.onAuthStateChange(async(e,t)=>{"PASSWORD_RECOVERY"==e?c(!1):"SIGNED_IN"===e&&t?(r(t.user),c(!0)):"SIGNED_OUT"===e&&(c(!1),r(null))});return()=>{e.subscription.unsubscribe()}},[h]),(0,n.jsx)(o.Provider,{value:{loggedIn:u,user:a,login:l,logout:d},children:t})}}},function(e){e.O(0,[293,808,548,82,975,971,596,744],function(){return e(e.s=1771)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[958],{4303:function(e,t,s){Promise.resolve().then(s.bind(s,4260))},4260:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return k}});var i=s(7437),l=s(2265),n=s(1396),r=s.n(n),c=s(6507),d=s(2492),a=s(3701),o=s(9279),h=s(666),u=s(6988),v=s(4147),x=s(5781),p=s(8276),j=s(4033),Z=s(8339),m=s(5551),f=s(9394),C=s(2834),w=s(6337),y=s(1797),g=s(3226),I=s(5446);function E(e){var t,s,n,c,x;let{openDialog:p,handleClose:j,testCase:E}=e,[S,k]=(0,l.useState)(1);return(0,i.jsxs)(f.Z,{open:p,onClose:j,fullWidth:!0,maxWidth:"lg",children:[(0,i.jsxs)(y.Z,{children:["Dataset ",E.id.slice(0,6)]}),(0,i.jsxs)(w.Z,{children:[(0,i.jsx)(g.Z,{variant:"h6",style:{marginTop:"1rem"},children:"Test cases"}),(0,i.jsx)(I.u,{readOnly:!0,value:E&&Z.default.dump(E.testCases),style:{width:"100%",padding:"0.75rem"},maxRows:15}),(0,i.jsx)(g.Z,{variant:"h6",style:{marginTop:"1rem"},children:"Used in..."}),(0,i.jsxs)(a.Z,{children:[(0,i.jsx)(u.Z,{children:(0,i.jsxs)(v.Z,{children:[(0,i.jsx)(h.Z,{children:"Eval ID"}),(0,i.jsx)(h.Z,{children:"Prompt ID"}),(0,i.jsx)(h.Z,{children:"Raw score"}),(0,i.jsx)(h.Z,{children:"Pass rate"}),(0,i.jsx)(h.Z,{children:"Pass count"}),(0,i.jsx)(h.Z,{children:"Fail count"}),(0,i.jsx)(h.Z,{children:"Prompt"})]})}),(0,i.jsx)(o.Z,{children:null==E?void 0:null===(t=E.prompts)||void 0===t?void 0:t.slice((S-1)*10,10*S).sort((e,t)=>t.evalId.localeCompare(e.evalId)).map((e,t)=>{var s,l,d,a,o,u,p,j;return(0,i.jsxs)(v.Z,{hover:!0,children:[(0,i.jsx)(h.Z,{children:(0,i.jsx)(r(),{href:"/eval/?file=".concat(e.evalFilepath),children:e.evalId.slice(0,6)})}),(0,i.jsx)(h.Z,{style:{minWidth:"8em"},children:(0,i.jsx)(r(),{href:"/prompts/?id=".concat(e.id),children:e.id.slice(0,6)})}),(0,i.jsx)(h.Z,{children:null!==(n=null===(s=e.prompt.metrics)||void 0===s?void 0:s.score.toFixed(2))&&void 0!==n?n:"-"}),(0,i.jsx)(h.Z,{children:(null===(l=e.prompt.metrics)||void 0===l?void 0:l.testPassCount)!==void 0&&(null===(d=e.prompt.metrics)||void 0===d?void 0:d.testFailCount)!==void 0?((null===(a=e.prompt.metrics)||void 0===a?void 0:a.testPassCount)/((null===(o=e.prompt.metrics)||void 0===o?void 0:o.testPassCount)+(null===(u=e.prompt.metrics)||void 0===u?void 0:u.testFailCount))*100).toFixed(2)+"%":"-"}),(0,i.jsx)(h.Z,{children:null!==(c=null===(p=e.prompt.metrics)||void 0===p?void 0:p.testPassCount)&&void 0!==c?c:"-"}),(0,i.jsx)(h.Z,{children:null!==(x=null===(j=e.prompt.metrics)||void 0===j?void 0:j.testFailCount)&&void 0!==x?x:"-"}),(0,i.jsx)(h.Z,{children:e.prompt.raw.length>250?e.prompt.raw.slice(0,250)+"...":e.prompt.raw})]},t)})})]}),Math.ceil(((null==E?void 0:null===(s=E.prompts)||void 0===s?void 0:s.length)||0)/10)>1&&(0,i.jsx)(d.Z,{count:Math.ceil(E.prompts.length/10),page:S,onChange:(e,t)=>{k(t)}})]}),(0,i.jsx)(C.Z,{children:(0,i.jsx)(m.Z,{onClick:j,children:"Close"})})]})}var S=s(279);function k(){let e=(0,j.useSearchParams)(),[t,s]=(0,l.useState)([]),[n,Z]=(0,l.useState)("date"),[m,f]=(0,l.useState)("desc"),[C,w]=(0,l.useState)(1),[y,g]=(0,l.useState)(10),[I,k]=(0,l.useState)(!1),[P,T]=(0,l.useState)(0),_=e=>{let t=n===e&&"asc"===m?"desc":"asc";Z(e),f(t)};(0,l.useEffect)(()=>{fetch("".concat(S.CT,"/api/datasets")).then(e=>e.json()).then(e=>{let t=[...e.data].sort((e,t)=>null===n?0:"asc"===m?e[n]>t[n]?1:-1:e[n]<t[n]?1:-1);s(t)})},[n,m]),(0,l.useEffect)(()=>{let s=null==e?void 0:e.get("id");if(s){let e=t.findIndex(e=>e.id.startsWith(s));-1!==e&&D(e)}},[t,e]);let D=e=>{T(e),k(!0)};return(0,i.jsxs)(c.Z,{paddingX:2,children:[(0,i.jsxs)(a.Z,{children:[(0,i.jsx)(u.Z,{children:(0,i.jsxs)(v.Z,{children:[(0,i.jsx)(h.Z,{style:{width:"10%"},children:"ID"}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:(0,i.jsx)(x.Z,{active:"raw"===n,direction:"raw"===n?m:"asc",onClick:()=>_("raw"),children:"Info"})}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:"Variables"}),(0,i.jsx)(h.Z,{style:{width:"10%"},children:(0,i.jsx)(x.Z,{active:"count"===n,direction:"count"===n?m:"asc",onClick:()=>_("count"),children:"Total # evals"})}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:(0,i.jsx)(p.Z,{title:"The date of the most recent eval for this set of test cases",children:(0,i.jsx)(x.Z,{active:"date"===n,direction:"date"===n?m:"asc",onClick:()=>_("date"),children:"Most recent eval date"})})}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:(0,i.jsx)(p.Z,{title:"The ID of the most recent eval for this set of test cases",children:(0,i.jsx)(x.Z,{active:"evalId"===n,direction:"evalId"===n?m:"asc",onClick:()=>_("evalId"),children:"Most recent eval ID"})})})]})}),(0,i.jsx)(o.Z,{children:t.slice((C-1)*y,C*y).map((e,t)=>(0,i.jsxs)(v.Z,{hover:!0,onClick:()=>D(t),style:{cursor:"pointer"},children:[(0,i.jsx)(h.Z,{children:e.id.slice(0,6)}),(0,i.jsxs)(h.Z,{style:{width:"20%",whiteSpace:"pre-wrap"},children:[e.testCases.length," test cases"]}),(0,i.jsx)(h.Z,{style:{width:"20%",whiteSpace:"pre-wrap"},children:(()=>{if("string"==typeof e.testCases||"string"==typeof e.testCases[0])return"";let t=e.testCases.flatMap(e=>Object.keys(e.vars||{})),s=Array.from(new Set(t));return s.length>0?s.join(", "):"None"})()}),(0,i.jsx)(h.Z,{style:{width:"10%"},children:e.count}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:e.recentEvalDate||"Unknown"}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:e.recentEvalId?(0,i.jsx)(r(),{href:"/eval?file=".concat(e.recentEvalFilepath),children:e.recentEvalId.slice(0,6)}):"Unknown"})]},t))})]}),Math.ceil(t.length/y)>1&&(0,i.jsx)(d.Z,{count:Math.ceil(t.length/y),page:C,onChange:(e,t)=>w(t)}),t[P]&&(0,i.jsx)(E,{openDialog:I,handleClose:()=>{k(!1)},testCase:t[P]})]})}},279:function(e,t,s){"use strict";s.d(t,{CT:function(){return n},T8:function(){return l},eA:function(){return r}});var i=s(2601);let l=!i.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,n="http://localhost:15500",r=""}},function(e){e.O(0,[293,808,238,339,21,971,596,744],function(){return e(e.s=4303)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[421],{6427:function(e,n,t){Promise.resolve().then(t.t.bind(t,6656,23)),Promise.resolve().then(t.t.bind(t,6208,23)),Promise.resolve().then(t.t.bind(t,8169,23)),Promise.resolve().then(t.t.bind(t,3699,23)),Promise.resolve().then(t.bind(t,6891)),Promise.resolve().then(t.t.bind(t,4116,23))},3699:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(e,n){for(var t in n)Object.defineProperty(e,t,{enumerable:!0,get:n[t]})}(n,{suspense:function(){return o},NoSSR:function(){return i}}),t(1024),t(2265);let r=t(7669);function o(){let e=Error(r.NEXT_DYNAMIC_NO_SSR_CODE);throw e.digest=r.NEXT_DYNAMIC_NO_SSR_CODE,e}function i(e){let{children:n}=e;return n}},4116:function(){}},function(e){e.O(0,[674,482,82,613,189,452,226,891,971,596,744],function(){return e(e.s=6427)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[421],{6427:function(e,n,t){Promise.resolve().then(t.t.bind(t,6656,23)),Promise.resolve().then(t.t.bind(t,6208,23)),Promise.resolve().then(t.t.bind(t,8169,23)),Promise.resolve().then(t.t.bind(t,3699,23)),Promise.resolve().then(t.bind(t,6891)),Promise.resolve().then(t.t.bind(t,4116,23))},3699:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(e,n){for(var t in n)Object.defineProperty(e,t,{enumerable:!0,get:n[t]})}(n,{suspense:function(){return o},NoSSR:function(){return i}}),t(1024),t(2265);let r=t(7669);function o(){let e=Error(r.NEXT_DYNAMIC_NO_SSR_CODE);throw e.digest=r.NEXT_DYNAMIC_NO_SSR_CODE,e}function i(e){let{children:n}=e;return n}},4116:function(){}},function(e){e.O(0,[674,293,808,548,82,238,975,320,919,502,891,971,596,744],function(){return e(e.s=6427)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[11],{7304:function(e,n,s){Promise.resolve().then(s.t.bind(s,6685,23)),Promise.resolve().then(s.bind(s,6891))}},function(e){e.O(0,[674,293,808,548,82,238,975,320,919,502,891,971,596,744],function(){return e(e.s=7304)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{8845:function(e,t,n){Promise.resolve().then(n.bind(n,2112)),Promise.resolve().then(n.t.bind(n,9362,23)),Promise.resolve().then(n.t.bind(n,2471,23))},2112:function(e,t,n){"use strict";n.r(t),n.d(t,{PageShell:function(){return P}});var r=n(7437),s=n(2265),o=n(2135),i=n(606),a=n(5573),l=n(3571),u=n(1396),c=n.n(u),d=n(3457),h=n(4033),f=n(6691),m=n.n(f),x=n(6507);function g(){return(0,r.jsxs)(x.Z,{className:"logo",children:[(0,r.jsx)(m(),{width:25,height:25,src:"/logo.svg",alt:"Promptfoo logo"})," ",(0,r.jsx)("span",{children:"promptfoo"})]})}n(1320);var p=n(3283),j=n(3375),v=n(5507),b=n(2653);function k(){let{user:e,logout:t}=(0,l.aC)(),[n,o]=s.useState(null),i=async()=>{null==t||t(),a()},a=()=>{o(null)};return e?(0,r.jsxs)("div",{children:[(0,r.jsx)(b.Z,{edge:"end","aria-label":"account of current user","aria-controls":"menu-appbar","aria-haspopup":"true",onClick:e=>{o(e.currentTarget)},color:"inherit",children:(0,r.jsx)(p.Z,{sx:{width:"1em",height:"1em",bgcolor:"#1976d2"}})}),(0,r.jsxs)(j.Z,{id:"menu-appbar",anchorEl:n,anchorOrigin:{vertical:"top",horizontal:"right"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:!!n,onClose:a,children:[(0,r.jsxs)(v.Z,{disabled:!0,children:["Logged in as ",e.email]}),(0,r.jsx)(v.Z,{onClick:i,children:"Logout"})]})]}):(0,r.jsx)(c(),{href:"/auth/signup/",children:(0,r.jsx)(b.Z,{edge:"end","aria-label":"User not logged in","aria-controls":"menu-appbar","aria-haspopup":"true",color:"inherit",children:(0,r.jsx)(p.Z,{sx:{width:"1em",height:"1em"}})})})}var E=n(9864),C=n(7028);function N(e){let{darkMode:t,onToggleDarkMode:n}=e;return(0,r.jsx)("div",{className:"dark-mode-toggle",onClick:n,children:t?(0,r.jsx)(E.Z,{}):(0,r.jsx)(C.Z,{})})}n(2794);var _=n(279);n(5154);var O=n(2601);function S(e){let{href:t,label:n}=e,s=(0,h.usePathname)()||"";return(0,r.jsx)(c(),{href:t,className:s.startsWith(t)?"active":"",children:n})}function Z(e){let{darkMode:t,onToggleDarkMode:n}=e;return O.env.NEXT_PUBLIC_NO_BROWSING?(0,r.jsxs)(d.Z,{direction:"row",spacing:2,className:"nav",children:[(0,r.jsx)(g,{}),(0,r.jsx)(N,{darkMode:t,onToggleDarkMode:n})]}):(0,r.jsxs)(d.Z,{direction:"row",spacing:2,className:"nav",children:[(0,r.jsx)(g,{}),(0,r.jsx)(S,{href:"/setup",label:"New Eval"}),(0,r.jsx)(S,{href:"/eval",label:"Evals"}),(0,r.jsx)(S,{href:"/prompts",label:"Prompts"}),(0,r.jsx)(S,{href:"/datasets",label:"Datasets"}),(0,r.jsxs)("div",{className:"right-aligned",children:[_.T8?null:(0,r.jsx)(k,{}),(0,r.jsx)(N,{darkMode:t,onToggleDarkMode:n})]})]})}function P(e){let{children:t}=e,n=(0,o.Z)("(prefers-color-scheme: dark)"),[u,c]=s.useState(n),d=s.useMemo(()=>(0,i.Z)({typography:{fontFamily:"inherit"},palette:{mode:u||n?"dark":"light"}}),[u,n]);return s.useEffect(()=>{n&&document.documentElement.setAttribute("data-theme","dark")},[n]),(0,r.jsx)(s.StrictMode,{children:(0,r.jsx)(a.Z,{theme:d,children:(0,r.jsx)(l.Ho,{children:(0,r.jsxs)(T,{children:[(0,r.jsx)(Z,{darkMode:u,onToggleDarkMode:()=>{c(!u),u?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme","dark")}}),(0,r.jsx)("div",{children:t})]})})})})}function T(e){let{children:t}=e;return(0,r.jsx)("div",{children:t})}n(5587)},279:function(e,t,n){"use strict";n.d(t,{CT:function(){return o},T8:function(){return s},eA:function(){return i}});var r=n(2601);let s=!r.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,o="http://localhost:15500",i=""},3571:function(e,t,n){"use strict";n.d(t,{Ho:function(){return d},OQ:function(){return i},aC:function(){return l}});var r=n(7437),s=n(2265),o=n(3082);let i=(0,o.createClientComponentClient)(),a=(0,s.createContext)({}),l=()=>(0,s.useContext)(a),u=(e,t)=>i.auth.signInWithPassword({email:e,password:t}),c=()=>i.auth.signOut(),d=e=>{let{children:t}=e,[n,o]=(0,s.useState)(null),[l,d]=(0,s.useState)(!1),h=(0,s.useCallback)(async()=>{let{data:e,error:t}=await i.auth.refreshSession();e&&o(e.user)},[]);return(0,s.useEffect)(()=>{h();let{data:e}=i.auth.onAuthStateChange(async(e,t)=>{"PASSWORD_RECOVERY"==e?d(!1):"SIGNED_IN"===e&&t?(o(t.user),d(!0)):"SIGNED_OUT"===e&&(d(!1),o(null))});return()=>{e.subscription.unsubscribe()}},[h]),(0,r.jsx)(a.Provider,{value:{loggedIn:l,user:n,login:u,logout:c},children:t})}},2794:function(){},1320:function(){},5154:function(){},5587:function(){},2471:function(){}},function(e){e.O(0,[293,548,82,320,563,971,596,744],function(){return e(e.s=8845)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[794],{8050:function(e,t,n){Promise.resolve().then(n.bind(n,176))},176:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return S}});var i=n(7437),s=n(2265),l=n(1396),r=n.n(l),c=n(6507),d=n(2492),a=n(3701),o=n(9279),h=n(666),u=n(6988),x=n(4147),j=n(5781),Z=n(8276),v=n(4033),p=n(279),f=n(9394),m=n(2834),w=n(6337),C=n(1797),E=n(5446),P=n(3226),g=n(5551),y=e=>{var t;let{openDialog:n,handleClose:s,selectedPrompt:l}=e;return(0,i.jsxs)(f.Z,{open:n,onClose:s,fullWidth:!0,maxWidth:"lg",children:[(0,i.jsxs)(C.Z,{children:["Prompt ",l.id.slice(0,6)]}),(0,i.jsxs)(w.Z,{children:[(0,i.jsx)(P.Z,{variant:"h6",style:{marginTop:"1rem"},children:"Prompt"}),(0,i.jsx)(E.u,{readOnly:!0,value:null==l?void 0:null===(t=l.prompt)||void 0===t?void 0:t.raw,style:{width:"100%",padding:"0.75rem"},maxRows:50}),(0,i.jsx)(P.Z,{variant:"h6",style:{marginTop:"1rem"},children:"Used in..."}),(0,i.jsxs)(a.Z,{children:[(0,i.jsx)(u.Z,{children:(0,i.jsxs)(x.Z,{children:[(0,i.jsx)(h.Z,{children:"Eval ID"}),(0,i.jsx)(h.Z,{children:"Dataset ID"}),(0,i.jsx)(h.Z,{children:"Raw score"}),(0,i.jsx)(h.Z,{children:"Pass rate"}),(0,i.jsx)(h.Z,{children:"Pass count"}),(0,i.jsx)(h.Z,{children:"Fail count"})]})}),(0,i.jsx)(o.Z,{children:null==l?void 0:l.evals.sort((e,t)=>t.id.localeCompare(e.id)).map(e=>{var t,n,s,l,c,d;let a=null!==(l=null===(t=e.metrics)||void 0===t?void 0:t.testPassCount)&&void 0!==l?l:0,o=null!==(c=null===(n=e.metrics)||void 0===n?void 0:n.testFailCount)&&void 0!==c?c:0,u=a+o>0?(a/(a+o)*100).toFixed(2)+"%":"-";return(0,i.jsxs)(x.Z,{children:[(0,i.jsx)(h.Z,{children:(0,i.jsx)(r(),{href:"/eval/?file=".concat(e.filePath),children:e.id.slice(0,6)})}),(0,i.jsx)(h.Z,{children:(0,i.jsx)(r(),{href:"/datasets/?id=".concat(e.datasetId),children:e.datasetId.slice(0,6)})}),(0,i.jsx)(h.Z,{children:null!==(d=null===(s=e.metrics)||void 0===s?void 0:s.score.toFixed(2))&&void 0!==d?d:"-"}),(0,i.jsx)(h.Z,{children:u}),(0,i.jsx)(h.Z,{children:a}),(0,i.jsx)(h.Z,{children:o})]},"eval-".concat(e.id))})})]})]}),(0,i.jsx)(m.Z,{children:(0,i.jsx)(g.Z,{onClick:s,children:"Close"})})]})};function S(){let e=(0,v.useSearchParams)(),[t,n]=(0,s.useState)([]),[l,f]=(0,s.useState)("date"),[m,w]=(0,s.useState)("desc"),[C,E]=(0,s.useState)(1),[P,g]=(0,s.useState)(10),[S,_]=(0,s.useState)(!1),[k,D]=(0,s.useState)(0),I=e=>{let t=l===e&&"asc"===m?"desc":"asc";f(e),w(t)};(0,s.useEffect)(()=>{fetch("".concat(p.CT,"/api/prompts")).then(e=>e.json()).then(e=>{let t=[...e.data].sort((e,t)=>null===l?0:"asc"===m?e[l]>t[l]?1:-1:e[l]<t[l]?1:-1);n(t)})},[l,m]),(0,s.useEffect)(()=>{let n=null==e?void 0:e.get("id");if(n){let e=t.findIndex(e=>e.id.startsWith(n));-1!==e&&T(e)}},[t,e]);let T=e=>{_(!0),D(e)};return(0,i.jsxs)(c.Z,{paddingX:2,children:[(0,i.jsxs)(a.Z,{children:[(0,i.jsx)(u.Z,{children:(0,i.jsxs)(x.Z,{children:[(0,i.jsx)(h.Z,{style:{width:"10%"},children:"ID"}),(0,i.jsx)(h.Z,{style:{width:"60%"},children:(0,i.jsx)(j.Z,{active:"raw"===l,direction:"raw"===l?m:"asc",onClick:()=>I("raw"),children:"Prompt"})}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:(0,i.jsx)(Z.Z,{title:"The date of the most recent eval for this prompt",children:(0,i.jsx)(j.Z,{active:"date"===l,direction:"date"===l?m:"asc",onClick:()=>I("date"),children:"Most recent eval"})})}),(0,i.jsx)(h.Z,{style:{width:"10%"},children:(0,i.jsx)(j.Z,{active:"count"===l,direction:"count"===l?m:"asc",onClick:()=>I("count"),children:"# Evals"})})]})}),(0,i.jsx)(o.Z,{children:t.slice((C-1)*P,C*P).map((e,t)=>(0,i.jsxs)(x.Z,{hover:!0,children:[(0,i.jsx)(h.Z,{style:{width:"10%"},children:e.id.slice(0,6)}),(0,i.jsx)(h.Z,{style:{width:"60%",whiteSpace:"pre-wrap",cursor:"pointer"},onClick:()=>T(t),children:e.prompt.raw.length>500?e.prompt.raw.slice(0,500)+"...":e.prompt.raw}),(0,i.jsx)(h.Z,{style:{width:"20%"},children:e.recentEvalDate?(0,i.jsx)(r(),{href:"/eval?file=".concat(e.recentEvalId),children:e.recentEvalDate}):"Unknown"}),(0,i.jsx)(h.Z,{style:{width:"10%"},children:e.count})]},t))})]}),Math.ceil(t.length/P)>1&&(0,i.jsx)(d.Z,{count:Math.ceil(t.length/P),page:C,onChange:(e,t)=>E(t)}),t[k]&&(0,i.jsx)(y,{openDialog:S,handleClose:()=>{_(!1)},selectedPrompt:t[k]})]})}},279:function(e,t,n){"use strict";n.d(t,{CT:function(){return l},T8:function(){return s},eA:function(){return r}});var i=n(2601);let s=!i.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,l="http://localhost:15500",r=""}},function(e){e.O(0,[293,808,238,21,971,596,744],function(){return e(e.s=8050)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[413],{3515:function(e,t,n){Promise.resolve().then(n.bind(n,2378))},2378:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return ec}});var a=n(7437),r=n(2265),i=n(5551),l=n(8938),s=n(3226),o=n(6507),c=n(3457),d=n(9394),p=n(2834),u=n(6337),h=n(4173),x=n(1797),m=n(4740),j=n(4033),g=n(6882),f=n(1938),v=n(279),Z=()=>{let e=(0,j.useRouter)(),{env:t,description:n,providers:l,prompts:s,testCases:o}=(0,f.o)(),[c,d]=(0,r.useState)(!1),[p,u]=(0,r.useState)(0),h=async()=>{d(!0);try{let a=await fetch("".concat(v.eA,"/api/eval/"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:t,description:n,providers:l,prompts:s,tests:o})});if(!a.ok)throw Error("HTTP error! status: ".concat(a.status));let r=await a.json(),i=setInterval(async()=>{let t=await fetch("".concat(v.eA,"/api/eval/").concat(r.id,"/"));if(!t.ok)throw clearInterval(i),Error("HTTP error! status: ".concat(t.status));let n=await t.json();if("complete"===n.status)clearInterval(i),d(!1),v.T8?e.push("/eval"):e.push("/eval/remote:".concat(encodeURIComponent(r.id)));else if("failed"===n.status)throw clearInterval(i),d(!1),Error("Job failed");else{let e=0===n.total?0:Math.round(n.progress/n.total*100);u(e)}},1e3)}catch(e){console.error(e),d(!1),alert("An error occurred: ".concat(e.message))}};return(0,a.jsx)(i.Z,{variant:"contained",color:"primary",onClick:h,disabled:c,children:c?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g.Z,{size:24,sx:{marginRight:2}}),p.toFixed(0),"% complete"]}):"Run Evaluation"})},b=n(2057),y=n(8768),C=n(5873),_=n(1975),k=n(3295),A=()=>{let{env:e,setEnv:t}=(0,f.o)(),[n,l]=(0,r.useState)(!1),[s,o]=(0,r.useState)(e),c=()=>{l(!1)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.Z,{variant:"outlined",startIcon:(0,a.jsx)(k.Z,{}),onClick:()=>{l(!0)},children:"API keys"}),(0,a.jsxs)(d.Z,{open:n,onClose:c,fullWidth:!0,maxWidth:"md",children:[(0,a.jsx)(x.Z,{children:"Provider settings"}),(0,a.jsxs)(u.Z,{children:[(0,a.jsxs)(b.Z,{defaultExpanded:!0,children:[(0,a.jsx)(C.Z,{children:"OpenAI"}),(0,a.jsxs)(y.Z,{children:[(0,a.jsx)(_.Z,{label:"OpenAI API key",fullWidth:!0,margin:"normal",value:s.OPENAI_API_KEY,onChange:e=>o({...s,OPENAI_API_KEY:e.target.value})}),(0,a.jsx)(_.Z,{label:"OpenAI API host",fullWidth:!0,margin:"normal",value:s.OPENAI_API_HOST,onChange:e=>o({...s,OPENAI_API_HOST:e.target.value})}),(0,a.jsx)(_.Z,{label:"OpenAI organization",fullWidth:!0,margin:"normal",value:s.OPENAI_ORGANIZATION,onChange:e=>o({...s,OPENAI_ORGANIZATION:e.target.value})})]})]}),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Azure"}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Azure API key",fullWidth:!0,margin:"normal",value:s.AZURE_OPENAI_API_KEY,onChange:e=>o({...s,AZURE_OPENAI_API_KEY:e.target.value})})})]}),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Anthropic"}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Anthropic API key",fullWidth:!0,margin:"normal",value:s.ANTHROPIC_API_KEY,onChange:e=>o({...s,ANTHROPIC_API_KEY:e.target.value})})})]}),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Google Vertex AI"}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Vertex API Key",fullWidth:!0,margin:"normal",value:s.VERTEX_API_KEY,onChange:e=>o({...s,VERTEX_API_KEY:e.target.value})})}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Vertex Project ID",fullWidth:!0,margin:"normal",value:s.VERTEX_PROJECT_ID,onChange:e=>o({...s,VERTEX_PROJECT_ID:e.target.value})})}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Vertex Region",fullWidth:!0,margin:"normal",value:s.VERTEX_REGION,onChange:e=>o({...s,VERTEX_REGION:e.target.value})})})]}),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Replicate"}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Replicate API key",fullWidth:!0,margin:"normal",value:s.REPLICATE_API_KEY,onChange:e=>o({...s,REPLICATE_API_KEY:e.target.value})})})]})]}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:c,color:"primary",children:"Cancel"}),(0,a.jsx)(i.Z,{onClick:()=>{t(s),c()},color:"primary",variant:"contained",children:"Save"})]})]})]})},E=n(2653),I=n(3701),P=n(9279),S=n(666),T=n(5795),O=n(8489),w=n(8276),R=n(3391),N=n(6446),W=n(1280),z=n(9329),V=e=>{let{open:t,prompt:n,index:l,onAdd:s,onCancel:o}=e,[c,h]=r.useState(n),m=r.useRef(null);r.useEffect(()=>{h(n)},[n]);let j=e=>{s(c),h(""),e?o():m.current&&m.current.focus()};return(0,a.jsxs)(d.Z,{open:t,onClose:o,fullWidth:!0,maxWidth:"md",children:[(0,a.jsx)(x.Z,{children:"Edit Prompt ".concat(l+1)}),(0,a.jsx)(u.Z,{children:(0,a.jsx)(_.Z,{value:c,onChange:e=>h(e.target.value),fullWidth:!0,margin:"normal",multiline:!0,placeholder:"The quick brown {{animal1}} jumps over the lazy {{animal2}}.",helperText:"Tip: use the {{varname}} syntax to add variables to your prompt.",inputRef:m})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:j.bind(null,!0),color:"primary",variant:"contained",disabled:!c.length,children:"Add"}),(0,a.jsx)(i.Z,{onClick:j.bind(null,!1),color:"primary",variant:"contained",disabled:!c.length,children:"Add Another"}),(0,a.jsx)(i.Z,{onClick:o,color:"secondary",children:"Cancel"})]})]})};n(2280);var F=()=>{let[e,t]=(0,r.useState)(!1),[n,l]=(0,r.useState)(null),{prompts:o,setPrompts:d}=(0,f.o)(),p=(0,r.useRef)(null);(0,r.useEffect)(()=>{null!==n&&n>0&&p.current&&p.current.focus()},[n]);let u=e=>{l(e),t(!0)},h=(e,t)=>{e.stopPropagation();let n=o[t];d([...o,n])},x=(e,t)=>{d(o.map((n,a)=>a===e?t:n))},m=(e,t)=>{e.stopPropagation(),confirm("Are you sure you want to remove this prompt?")&&d(o.filter((e,n)=>n!==t))};return(0,a.jsxs)("div",{children:[(0,a.jsxs)(c.Z,{direction:"row",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(s.Z,{variant:"h5",children:"Prompts"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"file-input-add-prompt",children:(0,a.jsx)(w.Z,{title:"Upload prompt from file",children:(0,a.jsxs)("span",{children:[(0,a.jsx)(E.Z,{component:"span",children:(0,a.jsx)(W.Z,{})}),(0,a.jsx)("input",{id:"file-input-add-prompt",type:"file",accept:".txt,.md",onChange:e=>{var t;e.stopPropagation(),e.preventDefault();let n=null===(t=e.target.files)||void 0===t?void 0:t[0];if(n){let e=new FileReader;e.onload=e=>{var t,n;let a=null===(n=e.target)||void 0===n?void 0:null===(t=n.result)||void 0===t?void 0:t.toString();a&&d([...o,a])},e.readAsText(n)}},style:{display:"none"}})]})})}),(0,a.jsx)(i.Z,{color:"primary",onClick:()=>{t(!0)},variant:"contained",children:"Add Prompt"})]})]}),(0,a.jsx)(T.Z,{children:(0,a.jsx)(I.Z,{children:(0,a.jsx)(P.Z,{children:0===o.length?(0,a.jsx)(O.Z,{children:(0,a.jsx)(S.Z,{colSpan:2,align:"center",children:"No prompts added yet."})}):o.map((e,t)=>(0,a.jsxs)(O.Z,{sx:{"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",cursor:"pointer"}},onClick:()=>u(t),children:[(0,a.jsx)(S.Z,{children:(0,a.jsxs)(s.Z,{variant:"body2",children:["Prompt #".concat(t+1,": "),(e.length>250?e.slice(0,250)+" ...":e).split(/({{\w+}})/g).map((e,t)=>/{{\w+}}/g.test(e)?(0,a.jsx)("span",{className:"prompt-var-highlight",children:e},t):e)]})}),(0,a.jsxs)(S.Z,{align:"right",sx:{minWidth:150},children:[(0,a.jsx)(E.Z,{onClick:()=>u(t),size:"small",children:(0,a.jsx)(R.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>h(e,t),size:"small",children:(0,a.jsx)(z.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>m(e,t),size:"small",children:(0,a.jsx)(N.Z,{})})]})]},t))})})}),(0,a.jsx)(V,{open:e,prompt:null!==n?o[n]:"",index:null!==n?n:0,onAdd:e=>{null!==n?x(n,e):d([...o,e]),l(null)},onCancel:()=>{l(null),t(!1)}})]})},L=n(6988),K=e=>{let{onAdd:t,varsList:n,initialValues:i}=e,[l,d]=r.useState(i||{});return(0,r.useEffect)(()=>{let e={};n.forEach(t=>{e[t]=(null==i?void 0:i[t])||""}),d(e)},[n,i]),(0,a.jsxs)(o.Z,{my:2,children:[(0,a.jsx)(s.Z,{variant:"h6",mb:2,children:"Vars"}),n.length>0?(0,a.jsx)(c.Z,{direction:"row",spacing:2,alignItems:"center",children:Object.keys(l).map((e,n)=>(0,a.jsx)(c.Z,{direction:"row",spacing:2,alignItems:"center",children:(0,a.jsx)(_.Z,{placeholder:e,label:e,value:l[e],fullWidth:!0,onChange:n=>{let a=n.target.value,r={...l,[e]:a};d(r),t(r)}})},n))}):(0,a.jsxs)(s.Z,{variant:"subtitle1",gutterBottom:!0,children:["Add variables to your prompt using the ","{{varname}}"," syntax."]})]})},Y=n(8440);let J=["equals","contains","icontains","contains-all","contains-any","starts-with","regex","is-json","contains-json","similar","llm-rubric","model-graded-closedqa","model-graded-factuality","webhook","rouge-n","rouge-s","rouge-l","not-equals","not-contains","not-icontains","not-contains-all","not-contains-any","not-starts-with","not-regex","not-is-json","not-contains-json","not-similar","not-webhook","not-rouge-n","not-rouge-s","not-rouge-l"];var U=e=>{let{onAdd:t,initialValues:n}=e,[l,d]=(0,r.useState)(n||[]),p=e=>{let n=l.filter((t,n)=>n!==e);d(n),t(n)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.Z,{variant:"h6",children:"Asserts"}),(0,a.jsx)(o.Z,{my:l.length>0?2:0,children:(0,a.jsx)(c.Z,{direction:"column",spacing:2,children:l.map((e,n)=>(0,a.jsxs)(c.Z,{direction:"row",spacing:2,alignItems:"center",children:[(0,a.jsx)(Y.Z,{value:e.type,options:J,sx:{minWidth:200},onChange:(e,a)=>{let r=l.map((e,t)=>t===n?{...e,type:a}:e);d(r),t(r)},renderInput:e=>(0,a.jsx)(_.Z,{...e,label:"Type"})}),(0,a.jsx)(_.Z,{label:"Value",value:e.value,fullWidth:!0,onChange:e=>{let a=e.target.value,r=l.map((e,t)=>t===n?{...e,value:a}:e);d(r),t(r)}}),(0,a.jsx)(E.Z,{onClick:()=>p(n),size:"small",children:(0,a.jsx)(N.Z,{})})]},n))})}),(0,a.jsx)(i.Z,{color:"primary",onClick:()=>{let e=[...l,{type:"equals",value:""}];d(e),t(e)},children:"Add Assert"})]})},q=e=>{let{open:t,onAdd:n,varsList:l,initialValues:s,onCancel:c}=e,[h,m]=(0,r.useState)((null==s?void 0:s.description)||""),[j,g]=(0,r.useState)((null==s?void 0:s.vars)||{}),[f,v]=(0,r.useState)((null==s?void 0:s.assert)||[]),[Z,b]=(0,r.useState)(0);r.useEffect(()=>{s?(m(s.description||""),g(s.vars||{}),v(s.assert||[])):(m(""),g({}),v([]))},[s]);let y=e=>{n({description:h,vars:j,assert:f},e),e&&c(),m(""),g({}),v([]),b(e=>e+1)};return(0,a.jsxs)(d.Z,{open:t,onClose:c,fullWidth:!0,maxWidth:"md",children:[(0,a.jsx)(x.Z,{children:s?"Edit Test Case":"Add Test Case"}),(0,a.jsx)(u.Z,{children:(0,a.jsxs)(o.Z,{children:[(0,a.jsx)(K,{onAdd:e=>g(e),varsList:l,initialValues:null==s?void 0:s.vars}),(0,a.jsx)(U,{onAdd:e=>v(e),initialValues:(null==s?void 0:s.assert)||[]},Z)]})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:y.bind(void 0,!0),color:"primary",variant:"contained",children:s?"Update Test Case":"Add Test Case"}),!s&&(0,a.jsx)(i.Z,{onClick:y.bind(void 0,!1),color:"primary",variant:"contained",children:"Add Another"}),(0,a.jsx)(i.Z,{onClick:c,color:"secondary",children:"Cancel"})]})]})},B=e=>{let{varsList:t}=e,{testCases:n,setTestCases:l}=(0,f.o)(),[o,d]=r.useState(null),[p,u]=r.useState(!1),h=(e,t)=>{e.stopPropagation(),confirm("Are you sure you want to delete this test case?")&&l(n.filter((e,n)=>n!==t))},x=(e,t)=>{e.stopPropagation();let a=JSON.parse(JSON.stringify(n[t]));l([...n,a])};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(c.Z,{direction:"row",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(s.Z,{variant:"h5",children:"Test Cases"}),(0,a.jsx)(i.Z,{color:"primary",onClick:()=>u(!0),variant:"contained",children:"Add Test Case"})]}),(0,a.jsx)(T.Z,{children:(0,a.jsxs)(I.Z,{children:[(0,a.jsx)(L.Z,{children:(0,a.jsxs)(O.Z,{children:[(0,a.jsx)(S.Z,{children:"Description"}),(0,a.jsx)(S.Z,{children:"Assertions"}),(0,a.jsx)(S.Z,{children:"Variables"}),(0,a.jsx)(S.Z,{align:"right"})]})}),(0,a.jsx)(P.Z,{children:0===n.length?(0,a.jsx)(O.Z,{children:(0,a.jsx)(S.Z,{colSpan:4,align:"center",children:"No test cases added yet."})}):n.map((e,t)=>{var n;return(0,a.jsxs)(O.Z,{sx:{"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",cursor:"pointer"}},onClick:()=>{d(t),u(!0)},children:[(0,a.jsx)(S.Z,{children:(0,a.jsx)(s.Z,{variant:"body2",children:e.description||"Test Case #".concat(t+1)})}),(0,a.jsxs)(S.Z,{children:[(null===(n=e.assert)||void 0===n?void 0:n.length)||0," assertions"]}),(0,a.jsx)(S.Z,{children:Object.entries(e.vars||{}).map(e=>{let[t,n]=e;return t+"="+n}).join(", ")}),(0,a.jsxs)(S.Z,{align:"right",sx:{minWidth:150},children:[(0,a.jsx)(E.Z,{onClick:()=>{d(t),u(!0)},size:"small",children:(0,a.jsx)(R.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>x(e,t),size:"small",children:(0,a.jsx)(z.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>h(e,t),size:"small",children:(0,a.jsx)(N.Z,{})})]})]},t)})})]})}),(0,a.jsx)(q,{open:p,onAdd:(e,t)=>{if(null===o)l([...n,e]);else{let t=n.map((t,n)=>n===o?e:t);l(t),d(null)}t&&u(!1)},varsList:t,initialValues:null!==o?n[o]:void 0,onCancel:()=>{d(null),u(!1)}})]})},D=n(7827),H=e=>{let{onChange:t,...n}=e,[i,l]=r.useState(""),[s,o]=r.useState(!1);return(0,a.jsx)(_.Z,{...n,error:s,helperText:s?"Invalid JSON":"",value:i,onChange:e=>{let n=e.target.value;try{let e=JSON.parse(n);l(n),o(!1),t&&t(e)}catch(e){l(n),o(!0)}}})},X=e=>{let{open:t,providerId:n,config:l,onClose:s,onSave:c}=e,[h,m]=r.useState(l);return r.useEffect(()=>{m(l)},[l]),(0,a.jsxs)(d.Z,{open:t,onClose:s,fullWidth:!0,maxWidth:"md",children:[(0,a.jsxs)(x.Z,{children:["Edit ",n.length>50?n.slice(0,50)+"...":n]}),(0,a.jsx)(u.Z,{children:Object.keys(h).map(e=>{let t;let n=h[e];return"number"==typeof n||"boolean"==typeof n||"string"==typeof n?(t="number"==typeof n?t=>m({...h,[e]:parseFloat(t.target.value)}):"boolean"==typeof n?t=>m({...h,[e]:"true"===t.target.value}):t=>{let n=t.target.value.trim();if(n.startsWith("{")||n.startsWith("["))try{m({...h,[e]:JSON.parse(n)})}catch(t){m({...h,[e]:n})}else"null"===n?m({...h,[e]:null}):"undefined"===n?m({...h,[e]:void 0}):m({...h,[e]:n})},(0,a.jsx)(o.Z,{my:2,children:(0,a.jsx)(_.Z,{label:e,value:n,onChange:t,fullWidth:!0,InputLabelProps:{shrink:!0},type:"number"==typeof n?"number":"text"})},e)):(0,a.jsx)(o.Z,{my:2,children:(0,a.jsx)(H,{label:e,defaultValue:JSON.stringify(n),onChange:t=>{m({...h,[e]:t})},fullWidth:!0,multiline:!0,minRows:2,InputLabelProps:{shrink:!0}})},e)})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:s,children:"Cancel"}),(0,a.jsx)(i.Z,{onClick:()=>{c(h)},children:"Save"})]})]})};let G=[].concat(["replicate:replicate/flan-t5-small:69716ad8c34274043bf4a135b7315c7c569ec931d8f23d6826e249e1c142a264"].map(e=>({id:e,config:{temperature:.5,max_length:1024,repetition_penality:1}}))).concat(["replicate:replicate/codellama-7b-instruct:0103579e86fc75ba0d65912890fa19ef03c84a68554635319accf2e0ba93d3ae","replicate:replicate/codellama-13b-instruct:da5676342de1a5a335b848383af297f592b816b950a43d251a0a9edd0113604b","replicate:replicate/llama-2-70b-chat:2796ee9483c3fd7aa2e171d38f4ca12251a30609463dcfd4cd76703f22e96cdf"].map(e=>({id:e,config:{system_prompt:"",temperature:.75,top_p:.9,top_k:50,max_new_tokens:128,min_new_tokens:-1}}))).concat(["replicate:replicate/codellama-7b:6880b103613a9cd23950c5fd6c140197e519905bd0dd00e448c4858bdd06090a","replicate:replicate/codellama-13b-python:09b87c02dfa403e0c3289166dece62286b3bce49bae39a9c9204713cf94b8b7d","replicate:replicate/codellama-13b:1c914d844307b0588599b8393480a3ba917b660c7e9dfae681542b5325f228db","replicate:replicate/codellama-34b-python:9048743d22a7b19cd0abb018066809ea6af4f2b4717bef9aad3c5ae21ceac00d","replicate:replicate/codellama-34b:0666717e5ead8557dff55ee8f11924b5c0309f5f1ca52f64bb8eec405fdb38a7"].map(e=>({id:e,config:{temperature:.75,top_p:.9,top_k:50,max_new_tokens:128,min_new_tokens:-1}}))).concat(["replicate:a16z-infra/llama-2-7b-chat:7b0bfc9aff140d5b75bacbed23e91fd3c34b01a1e958d32132de6e0a19796e2c","replicate:a16z-infra/llama-2-13b-chat:2a7f981751ec7fdf87b5b91ad4db53683a98082e9ff7bfd12c8cd5ea85980a52"].map(e=>({id:e,config:{temperature:.95,top_p:.95,top_k:250,max_new_tokens:500,min_new_tokens:-1,repetition_penality:1,system_prompt:""}}))).concat(["anthropic:claude-1","anthropic:claude-1-100k","anthropic:claude-instant-1","anthropic:claude-instant-1-100k"].map(e=>({id:e,config:{max_tokens_to_sample:256,temperature:.5}}))).concat(["openai:gpt-3.5-turbo","openai:gpt-3.5-turbo-0301","openai:gpt-3.5-turbo-0613","openai:gpt-3.5-turbo-16k","openai:gpt-3.5-turbo-16k-0613","openai:gpt-4","openai:gpt-4-0314","openai:gpt-4-0613","openai:gpt-4-32k","openai:gpt-4-32k-0314"].map(e=>({id:e,config:{organization:"",apiHost:"api.openai.com",temperature:.5,max_tokens:1024,top_p:1,frequency_penalty:0,presence_penalty:0,function_call:void 0,functions:void 0,stop:void 0}}))).concat(["azureopenai:gpt-3.5-turbo","azureopenai:gpt-3.5-turbo-0301","azureopenai:gpt-3.5-turbo-0613","azureopenai:gpt-3.5-turbo-16k","azureopenai:gpt-3.5-turbo-16k-0613","azureopenai:gpt-4","azureopenai:gpt-4-0314","azureopenai:gpt-4-0613","azureopenai:gpt-4-32k","azureopenai:gpt-4-32k-0314"].map(e=>({id:e,config:{temperature:.5,max_tokens:1024,top_p:1,frequency_penalty:0,presence_penalty:0,function_call:void 0,functions:void 0,stop:void 0}}))).concat(["vertex:chat-bison@001","vertex:chat-bison","vertex:chat-bison-32k","vertex:chat-bison-32k@001"].map(e=>({id:e,config:{context:void 0,examples:void 0,temperature:0,maxOutputTokens:1024,topP:.95,topK:40,safetySettings:void 0,stopSequence:void 0}}))).sort((e,t)=>e.id.localeCompare(t.id)),M={anthropic:"Anthropic",azureopenai:"Azure",openai:"OpenAI",replicate:"Replicate"};var Q=e=>{let{providers:t,onChange:n}=e,[i,l]=r.useState(null),s=e=>"string"==typeof e?e:e.id||"Unknown provider",c=(e,t)=>"string"==typeof e?e:e.id||t,d=e=>{"string"==typeof e?alert("Cannot edit custom providers"):e.config?l(e):alert("There is no config for this provider")};return(0,a.jsxs)(o.Z,{mt:2,children:[(0,a.jsx)(Y.Z,{multiple:!0,freeSolo:!0,options:G,value:t,groupBy:e=>(function(e){if(!e)return"Other";let t=e.split(":")[0];return M[t]||t})(e.id),onChange:(e,t)=>{n(t.map(e=>"string"==typeof e?{id:e}:e))},getOptionLabel:e=>{if(!e)return"";let t="";"string"==typeof e&&(t=e),e.id&&"string"==typeof e.id&&(t=e.id);let n=t.split(":");return n.length>1?n[1]:"Unknown provider"},renderTags:(e,t)=>e.map((e,n)=>{let a=s(e),i=c(e,n);return(0,r.createElement)(D.Z,{variant:"outlined",label:a,...t({index:n}),key:i,onClick:()=>d(e)})}),renderInput:e=>(0,a.jsx)(_.Z,{...e,variant:"outlined",placeholder:"Select LLM providers",helperText:t.length>0?"Click a provider to configure its settings.":null})}),i&&i.id&&(0,a.jsx)(X,{open:!!i,providerId:i.id,config:i.config,onClose:()=>l(null),onSave:e=>{if(i){let a=t.map(t=>t.id===i.id?{...t,config:e}:t);n(a),l(null)}}})]})},$=n(3425),ee=n.n($),et=n(4759);n(5341),n(7555);var en=n(8339),ea=n(9963),er=n(1396),ei=n.n(er);n(695);var el=()=>{let{env:e,setEnv:t,description:n,setDescription:l,providers:c,setProviders:d,prompts:p,setPrompts:u,testCases:h,setTestCases:x}=(0,f.o)(),[m,j]=r.useState(""),[g,v]=r.useState(!0);r.useEffect(()=>{j(en.default.dump({env:e,description:n,providers:c,prompts:p,tests:h}))},[e,n,c,p,h]);let Z=e=>{t(e.env||{}),l(e.description||""),d(e.providers||[]),u(e.prompts||[]),x(e.tests||[])};return(0,a.jsxs)(o.Z,{mt:4,children:[(0,a.jsx)(s.Z,{variant:"h5",gutterBottom:!0,children:"Configuration"}),(0,a.jsxs)(s.Z,{variant:"body1",gutterBottom:!0,children:["This is the YAML config that defines the evaluation and is processed by promptfoo. See"," ",(0,a.jsx)(ei(),{target:"_blank",href:"https://promptfoo.dev/docs/configuration/guide",children:"configuration docs"})," ","to learn more."]}),(0,a.jsx)(i.Z,{variant:"text",color:"primary",startIcon:g?(0,a.jsx)(R.Z,{}):(0,a.jsx)(ea.Z,{}),onClick:()=>{if(!g)try{let e=en.default.load(m,{json:!0});Z(e)}catch(e){}v(!g)},children:g?"Edit YAML":"Save"}),(0,a.jsx)(ee(),{autoCapitalize:"off",value:m,onValueChange:e=>{g||j(e)},highlight:e=>(0,et.highlight)(e,et.languages.yaml),padding:10,style:{fontFamily:'"Fira code", "Fira Mono", monospace',fontSize:14},disabled:g,className:g?"":"glowing-border"})]})};n(284);var es=n(2601);function eo(e){let{error:t,resetErrorBoundary:n}=e;return(0,a.jsxs)("div",{role:"alert",children:[(0,a.jsx)("p",{children:"Something went wrong:"}),(0,a.jsx)("pre",{children:t.message}),(0,a.jsx)("button",{onClick:n,children:"Try again"})]})}var ec=()=>{let[e,t]=(0,r.useState)(!1),{description:n,setDescription:j,providers:g,setProviders:v,prompts:b,setPrompts:y,testCases:C,setTestCases:_}=(0,f.o)();if((0,r.useEffect)(()=>{f.o.persist.rehydrate()},[]),es.env.NEXT_PUBLIC_NO_BROWSING)return null;let k=(e=>{let t=/{{(\w+)}}/g,n=new Set;return e.forEach(e=>{let a;for(;null!==(a=t.exec(e));)n.add(a[1])}),Array.from(n)})(b);return(0,a.jsxs)(l.Z,{maxWidth:"lg",sx:{marginTop:"2rem"},children:[(0,a.jsxs)(c.Z,{direction:"row",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(s.Z,{variant:"h4",children:"Set up an evaluation"}),(0,a.jsxs)(c.Z,{direction:"row",spacing:2,children:[(0,a.jsx)(Z,{}),(0,a.jsx)(A,{}),(0,a.jsx)(i.Z,{variant:"outlined",color:"primary",onClick:()=>t(!0),children:"Reset"})]})]}),(0,a.jsx)(o.Z,{mt:4}),(0,a.jsx)(o.Z,{mt:2,children:(0,a.jsx)(m.SV,{FallbackComponent:eo,onReset:()=>{v([])},children:(0,a.jsxs)(c.Z,{direction:"column",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(s.Z,{variant:"h5",children:"Providers"}),(0,a.jsx)(Q,{providers:g,onChange:v})]})})}),(0,a.jsx)(o.Z,{mt:4}),(0,a.jsx)(m.SV,{FallbackComponent:eo,onReset:()=>{y([])},children:(0,a.jsx)(F,{})}),(0,a.jsx)(o.Z,{mt:6}),(0,a.jsx)(m.SV,{FallbackComponent:eo,onReset:()=>{_([])},children:(0,a.jsx)(B,{varsList:k})}),(0,a.jsx)(el,{}),(0,a.jsxs)(d.Z,{open:e,onClose:()=>t(!1),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[(0,a.jsx)(x.Z,{id:"alert-dialog-title",children:"Confirm Reset"}),(0,a.jsx)(u.Z,{children:(0,a.jsx)(h.Z,{id:"alert-dialog-description",children:"Are you sure you want to reset all the fields? This action cannot be undone."})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:()=>t(!1),children:"Cancel"}),(0,a.jsx)(i.Z,{onClick:()=>{j(""),v([]),y([]),_([]),t(!1)},autoFocus:!0,children:"Reset"})]})]})]})}},279:function(e,t,n){"use strict";n.d(t,{CT:function(){return i},T8:function(){return r},eA:function(){return l}});var a=n(2601);let r=!a.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,i="http://localhost:15500",l=""},1938:function(e,t,n){"use strict";n.d(t,{o:function(){return i}});var a=n(4660),r=n(4810);let i=(0,a.Ue)()((0,r.tJ)((e,t)=>({env:{},testCases:[],description:"",providers:[],prompts:[],setEnv:t=>e({env:t}),setTestCases:t=>e({testCases:t}),setDescription:t=>e({description:t}),setProviders:t=>e({providers:t}),setPrompts:t=>e({prompts:t}),setStateFromConfig:t=>{let n={};t.description&&(n.description=t.description||""),t.tests&&(n.testCases=t.tests),t.providers&&(n.providers=t.providers),t.prompts&&("string"==typeof t.prompts?n.prompts=[t.prompts]:Array.isArray(t.prompts)?n.prompts=t.prompts.filter(e=>!e.endsWith(".txt")&&!e.endsWith(".json")&&!e.endsWith(".yaml")):console.warn("Invalid prompts config",t.prompts)),e(n)},getTestSuite:()=>{let{description:e,testCases:n,providers:a,prompts:r,env:i}=t();return{env:i,description:e,providers:a,prompts:r,tests:n}}}),{name:"promptfoo",skipHydration:!0}))},2280:function(){},695:function(){},284:function(){}},function(e){e.O(0,[482,613,685,189,452,339,109,971,596,744],function(){return e(e.s=3515)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[413],{3515:function(e,t,n){Promise.resolve().then(n.bind(n,2378))},2378:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return ec}});var a=n(7437),r=n(2265),i=n(5551),l=n(8938),s=n(3226),o=n(6507),c=n(3457),d=n(9394),p=n(2834),u=n(6337),h=n(4173),x=n(1797),m=n(4740),j=n(4033),g=n(6882),f=n(1938),v=n(279),Z=()=>{let e=(0,j.useRouter)(),{env:t,description:n,providers:l,prompts:s,testCases:o}=(0,f.o)(),[c,d]=(0,r.useState)(!1),[p,u]=(0,r.useState)(0),h=async()=>{d(!0);try{let a=await fetch("".concat(v.eA,"/api/eval/"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:t,description:n,providers:l,prompts:s,tests:o})});if(!a.ok)throw Error("HTTP error! status: ".concat(a.status));let r=await a.json(),i=setInterval(async()=>{let t=await fetch("".concat(v.eA,"/api/eval/").concat(r.id,"/"));if(!t.ok)throw clearInterval(i),Error("HTTP error! status: ".concat(t.status));let n=await t.json();if("complete"===n.status)clearInterval(i),d(!1),v.T8?e.push("/eval"):e.push("/eval/remote:".concat(encodeURIComponent(r.id)));else if("failed"===n.status)throw clearInterval(i),d(!1),Error("Job failed");else{let e=0===n.total?0:Math.round(n.progress/n.total*100);u(e)}},1e3)}catch(e){console.error(e),d(!1),alert("An error occurred: ".concat(e.message))}};return(0,a.jsx)(i.Z,{variant:"contained",color:"primary",onClick:h,disabled:c,children:c?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g.Z,{size:24,sx:{marginRight:2}}),p.toFixed(0),"% complete"]}):"Run Evaluation"})},b=n(2057),y=n(8768),C=n(5873),_=n(1975),k=n(3295),A=()=>{let{env:e,setEnv:t}=(0,f.o)(),[n,l]=(0,r.useState)(!1),[s,o]=(0,r.useState)(e),c=()=>{l(!1)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.Z,{variant:"outlined",startIcon:(0,a.jsx)(k.Z,{}),onClick:()=>{l(!0)},children:"API keys"}),(0,a.jsxs)(d.Z,{open:n,onClose:c,fullWidth:!0,maxWidth:"md",children:[(0,a.jsx)(x.Z,{children:"Provider settings"}),(0,a.jsxs)(u.Z,{children:[(0,a.jsxs)(b.Z,{defaultExpanded:!0,children:[(0,a.jsx)(C.Z,{children:"OpenAI"}),(0,a.jsxs)(y.Z,{children:[(0,a.jsx)(_.Z,{label:"OpenAI API key",fullWidth:!0,margin:"normal",value:s.OPENAI_API_KEY,onChange:e=>o({...s,OPENAI_API_KEY:e.target.value})}),(0,a.jsx)(_.Z,{label:"OpenAI API host",fullWidth:!0,margin:"normal",value:s.OPENAI_API_HOST,onChange:e=>o({...s,OPENAI_API_HOST:e.target.value})}),(0,a.jsx)(_.Z,{label:"OpenAI organization",fullWidth:!0,margin:"normal",value:s.OPENAI_ORGANIZATION,onChange:e=>o({...s,OPENAI_ORGANIZATION:e.target.value})})]})]}),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Azure"}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Azure API key",fullWidth:!0,margin:"normal",value:s.AZURE_OPENAI_API_KEY,onChange:e=>o({...s,AZURE_OPENAI_API_KEY:e.target.value})})})]}),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Anthropic"}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Anthropic API key",fullWidth:!0,margin:"normal",value:s.ANTHROPIC_API_KEY,onChange:e=>o({...s,ANTHROPIC_API_KEY:e.target.value})})})]}),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Google Vertex AI"}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Vertex API Key",fullWidth:!0,margin:"normal",value:s.VERTEX_API_KEY,onChange:e=>o({...s,VERTEX_API_KEY:e.target.value})})}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Vertex Project ID",fullWidth:!0,margin:"normal",value:s.VERTEX_PROJECT_ID,onChange:e=>o({...s,VERTEX_PROJECT_ID:e.target.value})})}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Vertex Region",fullWidth:!0,margin:"normal",value:s.VERTEX_REGION,onChange:e=>o({...s,VERTEX_REGION:e.target.value})})})]}),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Replicate"}),(0,a.jsx)(y.Z,{children:(0,a.jsx)(_.Z,{label:"Replicate API key",fullWidth:!0,margin:"normal",value:s.REPLICATE_API_KEY,onChange:e=>o({...s,REPLICATE_API_KEY:e.target.value})})})]})]}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:c,color:"primary",children:"Cancel"}),(0,a.jsx)(i.Z,{onClick:()=>{t(s),c()},color:"primary",variant:"contained",children:"Save"})]})]})]})},E=n(2653),I=n(3701),P=n(9279),S=n(666),T=n(5795),O=n(4147),w=n(8276),R=n(3391),N=n(6446),W=n(1280),z=n(9329),V=e=>{let{open:t,prompt:n,index:l,onAdd:s,onCancel:o}=e,[c,h]=r.useState(n),m=r.useRef(null);r.useEffect(()=>{h(n)},[n]);let j=e=>{s(c),h(""),e?o():m.current&&m.current.focus()};return(0,a.jsxs)(d.Z,{open:t,onClose:o,fullWidth:!0,maxWidth:"md",children:[(0,a.jsx)(x.Z,{children:"Edit Prompt ".concat(l+1)}),(0,a.jsx)(u.Z,{children:(0,a.jsx)(_.Z,{value:c,onChange:e=>h(e.target.value),fullWidth:!0,margin:"normal",multiline:!0,placeholder:"The quick brown {{animal1}} jumps over the lazy {{animal2}}.",helperText:"Tip: use the {{varname}} syntax to add variables to your prompt.",inputRef:m})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:j.bind(null,!0),color:"primary",variant:"contained",disabled:!c.length,children:"Add"}),(0,a.jsx)(i.Z,{onClick:j.bind(null,!1),color:"primary",variant:"contained",disabled:!c.length,children:"Add Another"}),(0,a.jsx)(i.Z,{onClick:o,color:"secondary",children:"Cancel"})]})]})};n(2280);var F=()=>{let[e,t]=(0,r.useState)(!1),[n,l]=(0,r.useState)(null),{prompts:o,setPrompts:d}=(0,f.o)(),p=(0,r.useRef)(null);(0,r.useEffect)(()=>{null!==n&&n>0&&p.current&&p.current.focus()},[n]);let u=e=>{l(e),t(!0)},h=(e,t)=>{e.stopPropagation();let n=o[t];d([...o,n])},x=(e,t)=>{d(o.map((n,a)=>a===e?t:n))},m=(e,t)=>{e.stopPropagation(),confirm("Are you sure you want to remove this prompt?")&&d(o.filter((e,n)=>n!==t))};return(0,a.jsxs)("div",{children:[(0,a.jsxs)(c.Z,{direction:"row",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(s.Z,{variant:"h5",children:"Prompts"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"file-input-add-prompt",children:(0,a.jsx)(w.Z,{title:"Upload prompt from file",children:(0,a.jsxs)("span",{children:[(0,a.jsx)(E.Z,{component:"span",children:(0,a.jsx)(W.Z,{})}),(0,a.jsx)("input",{id:"file-input-add-prompt",type:"file",accept:".txt,.md",onChange:e=>{var t;e.stopPropagation(),e.preventDefault();let n=null===(t=e.target.files)||void 0===t?void 0:t[0];if(n){let e=new FileReader;e.onload=e=>{var t,n;let a=null===(n=e.target)||void 0===n?void 0:null===(t=n.result)||void 0===t?void 0:t.toString();a&&d([...o,a])},e.readAsText(n)}},style:{display:"none"}})]})})}),(0,a.jsx)(i.Z,{color:"primary",onClick:()=>{t(!0)},variant:"contained",children:"Add Prompt"})]})]}),(0,a.jsx)(T.Z,{children:(0,a.jsx)(I.Z,{children:(0,a.jsx)(P.Z,{children:0===o.length?(0,a.jsx)(O.Z,{children:(0,a.jsx)(S.Z,{colSpan:2,align:"center",children:"No prompts added yet."})}):o.map((e,t)=>(0,a.jsxs)(O.Z,{sx:{"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",cursor:"pointer"}},onClick:()=>u(t),children:[(0,a.jsx)(S.Z,{children:(0,a.jsxs)(s.Z,{variant:"body2",children:["Prompt #".concat(t+1,": "),(e.length>250?e.slice(0,250)+" ...":e).split(/({{\w+}})/g).map((e,t)=>/{{\w+}}/g.test(e)?(0,a.jsx)("span",{className:"prompt-var-highlight",children:e},t):e)]})}),(0,a.jsxs)(S.Z,{align:"right",sx:{minWidth:150},children:[(0,a.jsx)(E.Z,{onClick:()=>u(t),size:"small",children:(0,a.jsx)(R.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>h(e,t),size:"small",children:(0,a.jsx)(z.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>m(e,t),size:"small",children:(0,a.jsx)(N.Z,{})})]})]},t))})})}),(0,a.jsx)(V,{open:e,prompt:null!==n?o[n]:"",index:null!==n?n:0,onAdd:e=>{null!==n?x(n,e):d([...o,e]),l(null)},onCancel:()=>{l(null),t(!1)}})]})},L=n(6988),K=e=>{let{onAdd:t,varsList:n,initialValues:i}=e,[l,d]=r.useState(i||{});return(0,r.useEffect)(()=>{let e={};n.forEach(t=>{e[t]=(null==i?void 0:i[t])||""}),d(e)},[n,i]),(0,a.jsxs)(o.Z,{my:2,children:[(0,a.jsx)(s.Z,{variant:"h6",mb:2,children:"Vars"}),n.length>0?(0,a.jsx)(c.Z,{direction:"row",spacing:2,alignItems:"center",children:Object.keys(l).map((e,n)=>(0,a.jsx)(c.Z,{direction:"row",spacing:2,alignItems:"center",children:(0,a.jsx)(_.Z,{placeholder:e,label:e,value:l[e],fullWidth:!0,onChange:n=>{let a=n.target.value,r={...l,[e]:a};d(r),t(r)}})},n))}):(0,a.jsxs)(s.Z,{variant:"subtitle1",gutterBottom:!0,children:["Add variables to your prompt using the ","{{varname}}"," syntax."]})]})},Y=n(8440);let J=["equals","contains","icontains","contains-all","contains-any","starts-with","regex","is-json","contains-json","similar","llm-rubric","model-graded-closedqa","model-graded-factuality","webhook","rouge-n","rouge-s","rouge-l","not-equals","not-contains","not-icontains","not-contains-all","not-contains-any","not-starts-with","not-regex","not-is-json","not-contains-json","not-similar","not-webhook","not-rouge-n","not-rouge-s","not-rouge-l"];var U=e=>{let{onAdd:t,initialValues:n}=e,[l,d]=(0,r.useState)(n||[]),p=e=>{let n=l.filter((t,n)=>n!==e);d(n),t(n)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.Z,{variant:"h6",children:"Asserts"}),(0,a.jsx)(o.Z,{my:l.length>0?2:0,children:(0,a.jsx)(c.Z,{direction:"column",spacing:2,children:l.map((e,n)=>(0,a.jsxs)(c.Z,{direction:"row",spacing:2,alignItems:"center",children:[(0,a.jsx)(Y.Z,{value:e.type,options:J,sx:{minWidth:200},onChange:(e,a)=>{let r=l.map((e,t)=>t===n?{...e,type:a}:e);d(r),t(r)},renderInput:e=>(0,a.jsx)(_.Z,{...e,label:"Type"})}),(0,a.jsx)(_.Z,{label:"Value",value:e.value,fullWidth:!0,onChange:e=>{let a=e.target.value,r=l.map((e,t)=>t===n?{...e,value:a}:e);d(r),t(r)}}),(0,a.jsx)(E.Z,{onClick:()=>p(n),size:"small",children:(0,a.jsx)(N.Z,{})})]},n))})}),(0,a.jsx)(i.Z,{color:"primary",onClick:()=>{let e=[...l,{type:"equals",value:""}];d(e),t(e)},children:"Add Assert"})]})},q=e=>{let{open:t,onAdd:n,varsList:l,initialValues:s,onCancel:c}=e,[h,m]=(0,r.useState)((null==s?void 0:s.description)||""),[j,g]=(0,r.useState)((null==s?void 0:s.vars)||{}),[f,v]=(0,r.useState)((null==s?void 0:s.assert)||[]),[Z,b]=(0,r.useState)(0);r.useEffect(()=>{s?(m(s.description||""),g(s.vars||{}),v(s.assert||[])):(m(""),g({}),v([]))},[s]);let y=e=>{n({description:h,vars:j,assert:f},e),e&&c(),m(""),g({}),v([]),b(e=>e+1)};return(0,a.jsxs)(d.Z,{open:t,onClose:c,fullWidth:!0,maxWidth:"md",children:[(0,a.jsx)(x.Z,{children:s?"Edit Test Case":"Add Test Case"}),(0,a.jsx)(u.Z,{children:(0,a.jsxs)(o.Z,{children:[(0,a.jsx)(K,{onAdd:e=>g(e),varsList:l,initialValues:null==s?void 0:s.vars}),(0,a.jsx)(U,{onAdd:e=>v(e),initialValues:(null==s?void 0:s.assert)||[]},Z)]})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:y.bind(void 0,!0),color:"primary",variant:"contained",children:s?"Update Test Case":"Add Test Case"}),!s&&(0,a.jsx)(i.Z,{onClick:y.bind(void 0,!1),color:"primary",variant:"contained",children:"Add Another"}),(0,a.jsx)(i.Z,{onClick:c,color:"secondary",children:"Cancel"})]})]})},B=e=>{let{varsList:t}=e,{testCases:n,setTestCases:l}=(0,f.o)(),[o,d]=r.useState(null),[p,u]=r.useState(!1),h=(e,t)=>{e.stopPropagation(),confirm("Are you sure you want to delete this test case?")&&l(n.filter((e,n)=>n!==t))},x=(e,t)=>{e.stopPropagation();let a=JSON.parse(JSON.stringify(n[t]));l([...n,a])};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(c.Z,{direction:"row",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(s.Z,{variant:"h5",children:"Test Cases"}),(0,a.jsx)(i.Z,{color:"primary",onClick:()=>u(!0),variant:"contained",children:"Add Test Case"})]}),(0,a.jsx)(T.Z,{children:(0,a.jsxs)(I.Z,{children:[(0,a.jsx)(L.Z,{children:(0,a.jsxs)(O.Z,{children:[(0,a.jsx)(S.Z,{children:"Description"}),(0,a.jsx)(S.Z,{children:"Assertions"}),(0,a.jsx)(S.Z,{children:"Variables"}),(0,a.jsx)(S.Z,{align:"right"})]})}),(0,a.jsx)(P.Z,{children:0===n.length?(0,a.jsx)(O.Z,{children:(0,a.jsx)(S.Z,{colSpan:4,align:"center",children:"No test cases added yet."})}):n.map((e,t)=>{var n;return(0,a.jsxs)(O.Z,{sx:{"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",cursor:"pointer"}},onClick:()=>{d(t),u(!0)},children:[(0,a.jsx)(S.Z,{children:(0,a.jsx)(s.Z,{variant:"body2",children:e.description||"Test Case #".concat(t+1)})}),(0,a.jsxs)(S.Z,{children:[(null===(n=e.assert)||void 0===n?void 0:n.length)||0," assertions"]}),(0,a.jsx)(S.Z,{children:Object.entries(e.vars||{}).map(e=>{let[t,n]=e;return t+"="+n}).join(", ")}),(0,a.jsxs)(S.Z,{align:"right",sx:{minWidth:150},children:[(0,a.jsx)(E.Z,{onClick:()=>{d(t),u(!0)},size:"small",children:(0,a.jsx)(R.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>x(e,t),size:"small",children:(0,a.jsx)(z.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>h(e,t),size:"small",children:(0,a.jsx)(N.Z,{})})]})]},t)})})]})}),(0,a.jsx)(q,{open:p,onAdd:(e,t)=>{if(null===o)l([...n,e]);else{let t=n.map((t,n)=>n===o?e:t);l(t),d(null)}t&&u(!1)},varsList:t,initialValues:null!==o?n[o]:void 0,onCancel:()=>{d(null),u(!1)}})]})},D=n(7827),H=e=>{let{onChange:t,...n}=e,[i,l]=r.useState(""),[s,o]=r.useState(!1);return(0,a.jsx)(_.Z,{...n,error:s,helperText:s?"Invalid JSON":"",value:i,onChange:e=>{let n=e.target.value;try{let e=JSON.parse(n);l(n),o(!1),t&&t(e)}catch(e){l(n),o(!0)}}})},X=e=>{let{open:t,providerId:n,config:l,onClose:s,onSave:c}=e,[h,m]=r.useState(l);return r.useEffect(()=>{m(l)},[l]),(0,a.jsxs)(d.Z,{open:t,onClose:s,fullWidth:!0,maxWidth:"md",children:[(0,a.jsxs)(x.Z,{children:["Edit ",n.length>50?n.slice(0,50)+"...":n]}),(0,a.jsx)(u.Z,{children:Object.keys(h).map(e=>{let t;let n=h[e];return"number"==typeof n||"boolean"==typeof n||"string"==typeof n?(t="number"==typeof n?t=>m({...h,[e]:parseFloat(t.target.value)}):"boolean"==typeof n?t=>m({...h,[e]:"true"===t.target.value}):t=>{let n=t.target.value.trim();if(n.startsWith("{")||n.startsWith("["))try{m({...h,[e]:JSON.parse(n)})}catch(t){m({...h,[e]:n})}else"null"===n?m({...h,[e]:null}):"undefined"===n?m({...h,[e]:void 0}):m({...h,[e]:n})},(0,a.jsx)(o.Z,{my:2,children:(0,a.jsx)(_.Z,{label:e,value:n,onChange:t,fullWidth:!0,InputLabelProps:{shrink:!0},type:"number"==typeof n?"number":"text"})},e)):(0,a.jsx)(o.Z,{my:2,children:(0,a.jsx)(H,{label:e,defaultValue:JSON.stringify(n),onChange:t=>{m({...h,[e]:t})},fullWidth:!0,multiline:!0,minRows:2,InputLabelProps:{shrink:!0}})},e)})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:s,children:"Cancel"}),(0,a.jsx)(i.Z,{onClick:()=>{c(h)},children:"Save"})]})]})};let G=[].concat(["replicate:replicate/flan-t5-small:69716ad8c34274043bf4a135b7315c7c569ec931d8f23d6826e249e1c142a264"].map(e=>({id:e,config:{temperature:.5,max_length:1024,repetition_penality:1}}))).concat(["replicate:replicate/codellama-7b-instruct:0103579e86fc75ba0d65912890fa19ef03c84a68554635319accf2e0ba93d3ae","replicate:replicate/codellama-13b-instruct:da5676342de1a5a335b848383af297f592b816b950a43d251a0a9edd0113604b","replicate:replicate/llama-2-70b-chat:2796ee9483c3fd7aa2e171d38f4ca12251a30609463dcfd4cd76703f22e96cdf"].map(e=>({id:e,config:{system_prompt:"",temperature:.75,top_p:.9,top_k:50,max_new_tokens:128,min_new_tokens:-1}}))).concat(["replicate:replicate/codellama-7b:6880b103613a9cd23950c5fd6c140197e519905bd0dd00e448c4858bdd06090a","replicate:replicate/codellama-13b-python:09b87c02dfa403e0c3289166dece62286b3bce49bae39a9c9204713cf94b8b7d","replicate:replicate/codellama-13b:1c914d844307b0588599b8393480a3ba917b660c7e9dfae681542b5325f228db","replicate:replicate/codellama-34b-python:9048743d22a7b19cd0abb018066809ea6af4f2b4717bef9aad3c5ae21ceac00d","replicate:replicate/codellama-34b:0666717e5ead8557dff55ee8f11924b5c0309f5f1ca52f64bb8eec405fdb38a7"].map(e=>({id:e,config:{temperature:.75,top_p:.9,top_k:50,max_new_tokens:128,min_new_tokens:-1}}))).concat(["replicate:a16z-infra/llama-2-7b-chat:7b0bfc9aff140d5b75bacbed23e91fd3c34b01a1e958d32132de6e0a19796e2c","replicate:a16z-infra/llama-2-13b-chat:2a7f981751ec7fdf87b5b91ad4db53683a98082e9ff7bfd12c8cd5ea85980a52"].map(e=>({id:e,config:{temperature:.95,top_p:.95,top_k:250,max_new_tokens:500,min_new_tokens:-1,repetition_penality:1,system_prompt:""}}))).concat(["anthropic:claude-1","anthropic:claude-1-100k","anthropic:claude-instant-1","anthropic:claude-instant-1-100k"].map(e=>({id:e,config:{max_tokens_to_sample:256,temperature:.5}}))).concat(["openai:gpt-3.5-turbo","openai:gpt-3.5-turbo-0301","openai:gpt-3.5-turbo-0613","openai:gpt-3.5-turbo-16k","openai:gpt-3.5-turbo-16k-0613","openai:gpt-4","openai:gpt-4-0314","openai:gpt-4-0613","openai:gpt-4-32k","openai:gpt-4-32k-0314"].map(e=>({id:e,config:{organization:"",apiHost:"api.openai.com",temperature:.5,max_tokens:1024,top_p:1,frequency_penalty:0,presence_penalty:0,function_call:void 0,functions:void 0,stop:void 0}}))).concat(["azureopenai:gpt-3.5-turbo","azureopenai:gpt-3.5-turbo-0301","azureopenai:gpt-3.5-turbo-0613","azureopenai:gpt-3.5-turbo-16k","azureopenai:gpt-3.5-turbo-16k-0613","azureopenai:gpt-4","azureopenai:gpt-4-0314","azureopenai:gpt-4-0613","azureopenai:gpt-4-32k","azureopenai:gpt-4-32k-0314"].map(e=>({id:e,config:{temperature:.5,max_tokens:1024,top_p:1,frequency_penalty:0,presence_penalty:0,function_call:void 0,functions:void 0,stop:void 0}}))).concat(["vertex:chat-bison@001","vertex:chat-bison","vertex:chat-bison-32k","vertex:chat-bison-32k@001"].map(e=>({id:e,config:{context:void 0,examples:void 0,temperature:0,maxOutputTokens:1024,topP:.95,topK:40,safetySettings:void 0,stopSequence:void 0}}))).sort((e,t)=>e.id.localeCompare(t.id)),M={anthropic:"Anthropic",azureopenai:"Azure",openai:"OpenAI",replicate:"Replicate"};var Q=e=>{let{providers:t,onChange:n}=e,[i,l]=r.useState(null),s=e=>"string"==typeof e?e:e.id||"Unknown provider",c=(e,t)=>"string"==typeof e?e:e.id||t,d=e=>{"string"==typeof e?alert("Cannot edit custom providers"):e.config?l(e):alert("There is no config for this provider")};return(0,a.jsxs)(o.Z,{mt:2,children:[(0,a.jsx)(Y.Z,{multiple:!0,freeSolo:!0,options:G,value:t,groupBy:e=>(function(e){if(!e)return"Other";let t=e.split(":")[0];return M[t]||t})(e.id),onChange:(e,t)=>{n(t.map(e=>"string"==typeof e?{id:e}:e))},getOptionLabel:e=>{if(!e)return"";let t="";"string"==typeof e&&(t=e),e.id&&"string"==typeof e.id&&(t=e.id);let n=t.split(":");return n.length>1?n[1]:"Unknown provider"},renderTags:(e,t)=>e.map((e,n)=>{let a=s(e),i=c(e,n);return(0,r.createElement)(D.Z,{variant:"outlined",label:a,...t({index:n}),key:i,onClick:()=>d(e)})}),renderInput:e=>(0,a.jsx)(_.Z,{...e,variant:"outlined",placeholder:"Select LLM providers",helperText:t.length>0?"Click a provider to configure its settings.":null})}),i&&i.id&&(0,a.jsx)(X,{open:!!i,providerId:i.id,config:i.config,onClose:()=>l(null),onSave:e=>{if(i){let a=t.map(t=>t.id===i.id?{...t,config:e}:t);n(a),l(null)}}})]})},$=n(3425),ee=n.n($),et=n(4759);n(5341),n(7555);var en=n(8339),ea=n(9963),er=n(1396),ei=n.n(er);n(695);var el=()=>{let{env:e,setEnv:t,description:n,setDescription:l,providers:c,setProviders:d,prompts:p,setPrompts:u,testCases:h,setTestCases:x}=(0,f.o)(),[m,j]=r.useState(""),[g,v]=r.useState(!0);r.useEffect(()=>{j(en.default.dump({env:e,description:n,providers:c,prompts:p,tests:h}))},[e,n,c,p,h]);let Z=e=>{t(e.env||{}),l(e.description||""),d(e.providers||[]),u(e.prompts||[]),x(e.tests||[])};return(0,a.jsxs)(o.Z,{mt:4,children:[(0,a.jsx)(s.Z,{variant:"h5",gutterBottom:!0,children:"Configuration"}),(0,a.jsxs)(s.Z,{variant:"body1",gutterBottom:!0,children:["This is the YAML config that defines the evaluation and is processed by promptfoo. See"," ",(0,a.jsx)(ei(),{target:"_blank",href:"https://promptfoo.dev/docs/configuration/guide",children:"configuration docs"})," ","to learn more."]}),(0,a.jsx)(i.Z,{variant:"text",color:"primary",startIcon:g?(0,a.jsx)(R.Z,{}):(0,a.jsx)(ea.Z,{}),onClick:()=>{if(!g)try{let e=en.default.load(m,{json:!0});Z(e)}catch(e){}v(!g)},children:g?"Edit YAML":"Save"}),(0,a.jsx)(ee(),{autoCapitalize:"off",value:m,onValueChange:e=>{g||j(e)},highlight:e=>(0,et.highlight)(e,et.languages.yaml),padding:10,style:{fontFamily:'"Fira code", "Fira Mono", monospace',fontSize:14},disabled:g,className:g?"":"glowing-border"})]})};n(284);var es=n(2601);function eo(e){let{error:t,resetErrorBoundary:n}=e;return(0,a.jsxs)("div",{role:"alert",children:[(0,a.jsx)("p",{children:"Something went wrong:"}),(0,a.jsx)("pre",{children:t.message}),(0,a.jsx)("button",{onClick:n,children:"Try again"})]})}var ec=()=>{let[e,t]=(0,r.useState)(!1),{description:n,setDescription:j,providers:g,setProviders:v,prompts:b,setPrompts:y,testCases:C,setTestCases:_}=(0,f.o)();if((0,r.useEffect)(()=>{f.o.persist.rehydrate()},[]),es.env.NEXT_PUBLIC_NO_BROWSING)return null;let k=(e=>{let t=/{{(\w+)}}/g,n=new Set;return e.forEach(e=>{let a;for(;null!==(a=t.exec(e));)n.add(a[1])}),Array.from(n)})(b);return(0,a.jsxs)(l.Z,{maxWidth:"lg",sx:{marginTop:"2rem"},children:[(0,a.jsxs)(c.Z,{direction:"row",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(s.Z,{variant:"h4",children:"Set up an evaluation"}),(0,a.jsxs)(c.Z,{direction:"row",spacing:2,children:[(0,a.jsx)(Z,{}),(0,a.jsx)(A,{}),(0,a.jsx)(i.Z,{variant:"outlined",color:"primary",onClick:()=>t(!0),children:"Reset"})]})]}),(0,a.jsx)(o.Z,{mt:4}),(0,a.jsx)(o.Z,{mt:2,children:(0,a.jsx)(m.SV,{FallbackComponent:eo,onReset:()=>{v([])},children:(0,a.jsxs)(c.Z,{direction:"column",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(s.Z,{variant:"h5",children:"Providers"}),(0,a.jsx)(Q,{providers:g,onChange:v})]})})}),(0,a.jsx)(o.Z,{mt:4}),(0,a.jsx)(m.SV,{FallbackComponent:eo,onReset:()=>{y([])},children:(0,a.jsx)(F,{})}),(0,a.jsx)(o.Z,{mt:6}),(0,a.jsx)(m.SV,{FallbackComponent:eo,onReset:()=>{_([])},children:(0,a.jsx)(B,{varsList:k})}),(0,a.jsx)(el,{}),(0,a.jsxs)(d.Z,{open:e,onClose:()=>t(!1),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[(0,a.jsx)(x.Z,{id:"alert-dialog-title",children:"Confirm Reset"}),(0,a.jsx)(u.Z,{children:(0,a.jsx)(h.Z,{id:"alert-dialog-description",children:"Are you sure you want to reset all the fields? This action cannot be undone."})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(i.Z,{onClick:()=>t(!1),children:"Cancel"}),(0,a.jsx)(i.Z,{onClick:()=>{j(""),v([]),y([]),_([]),t(!1)},autoFocus:!0,children:"Reset"})]})]})]})}},279:function(e,t,n){"use strict";n.d(t,{CT:function(){return i},T8:function(){return r},eA:function(){return l}});var a=n(2601);let r=!a.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,i="http://localhost:15500",l=""},1938:function(e,t,n){"use strict";n.d(t,{o:function(){return i}});var a=n(4660),r=n(4810);let i=(0,a.Ue)()((0,r.tJ)((e,t)=>({env:{},testCases:[],description:"",providers:[],prompts:[],setEnv:t=>e({env:t}),setTestCases:t=>e({testCases:t}),setDescription:t=>e({description:t}),setProviders:t=>e({providers:t}),setPrompts:t=>e({prompts:t}),setStateFromConfig:t=>{let n={};t.description&&(n.description=t.description||""),t.tests&&(n.testCases=t.tests),t.providers&&(n.providers=t.providers),t.prompts&&("string"==typeof t.prompts?n.prompts=[t.prompts]:Array.isArray(t.prompts)?n.prompts=t.prompts.filter(e=>!e.endsWith(".txt")&&!e.endsWith(".json")&&!e.endsWith(".yaml")):console.warn("Invalid prompts config",t.prompts)),e(n)},getTestSuite:()=>{let{description:e,testCases:n,providers:a,prompts:r,env:i}=t();return{env:i,description:e,providers:a,prompts:r,tests:n}}}),{name:"promptfoo",skipHydration:!0}))},2280:function(){},695:function(){},284:function(){}},function(e){e.O(0,[293,808,548,238,975,320,339,919,753,971,596,744],function(){return e(e.s=3515)}),_N_E=e.O()}]);