diff --git a/litellm/proxy/_experimental/out/404.html b/litellm/proxy/_experimental/out/404.html index 45de348c4d5c..57818f08886e 100644 --- a/litellm/proxy/_experimental/out/404.html +++ b/litellm/proxy/_experimental/out/404.html @@ -1 +1 @@ -404: This page could not be found.LiteLLM Dashboard

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.LiteLLM Dashboard

404

This page could not be found.

\ No newline at end of file diff --git a/litellm/proxy/_experimental/out/404/index.html b/litellm/proxy/_experimental/out/404/index.html index 45de348c4d5c..57818f08886e 100644 --- a/litellm/proxy/_experimental/out/404/index.html +++ b/litellm/proxy/_experimental/out/404/index.html @@ -1 +1 @@ -404: This page could not be found.LiteLLM Dashboard

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.LiteLLM Dashboard

404

This page could not be found.

\ No newline at end of file diff --git a/litellm/proxy/_experimental/out/__next.__PAGE__.txt b/litellm/proxy/_experimental/out/__next.__PAGE__.txt index 095c8f4339f6..8a9630fd35ce 100644 --- a/litellm/proxy/_experimental/out/__next.__PAGE__.txt +++ b/litellm/proxy/_experimental/out/__next.__PAGE__.txt @@ -1,10 +1,10 @@ 1:"$Sreact.fragment" 2:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -3:I[952683,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/bee4095c26818f05.js","/litellm-asset-prefix/_next/static/chunks/81937424fe90f746.js","/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/04711b0f8ffa7bbd.js","/litellm-asset-prefix/_next/static/chunks/eb1ba04e211a533f.js","/litellm-asset-prefix/_next/static/chunks/88c74f8b4b20d25a.js","/litellm-asset-prefix/_next/static/chunks/4cb93eefa53f21a3.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/84a27349dda457cd.js","/litellm-asset-prefix/_next/static/chunks/8ddf82e7e0b331fc.js","/litellm-asset-prefix/_next/static/chunks/1d7b3500478e93ae.js","/litellm-asset-prefix/_next/static/chunks/f0e079183e7bb90c.js","/litellm-asset-prefix/_next/static/chunks/10757c2146f43db4.js","/litellm-asset-prefix/_next/static/chunks/786e88f4abdd5c58.js","/litellm-asset-prefix/_next/static/chunks/ffa46de7b8384155.js","/litellm-asset-prefix/_next/static/chunks/31275eb5c6f6332f.js","/litellm-asset-prefix/_next/static/chunks/80f4410629229bf9.js","/litellm-asset-prefix/_next/static/chunks/75ee9aba04c74e23.js","/litellm-asset-prefix/_next/static/chunks/193886179a5779b5.js","/litellm-asset-prefix/_next/static/chunks/2063ca6435a47940.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/d7c18aec4a87a237.js","/litellm-asset-prefix/_next/static/chunks/dac86522fa98e760.js"],"default"] +3:I[952683,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/bee4095c26818f05.js","/litellm-asset-prefix/_next/static/chunks/81937424fe90f746.js","/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/04711b0f8ffa7bbd.js","/litellm-asset-prefix/_next/static/chunks/eb1ba04e211a533f.js","/litellm-asset-prefix/_next/static/chunks/1d7b3500478e93ae.js","/litellm-asset-prefix/_next/static/chunks/4cb93eefa53f21a3.js","/litellm-asset-prefix/_next/static/chunks/f0e079183e7bb90c.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/8ddf82e7e0b331fc.js","/litellm-asset-prefix/_next/static/chunks/193886179a5779b5.js","/litellm-asset-prefix/_next/static/chunks/80f4410629229bf9.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","/litellm-asset-prefix/_next/static/chunks/31275eb5c6f6332f.js","/litellm-asset-prefix/_next/static/chunks/a4315c6eaf401064.js","/litellm-asset-prefix/_next/static/chunks/10757c2146f43db4.js","/litellm-asset-prefix/_next/static/chunks/88c74f8b4b20d25a.js","/litellm-asset-prefix/_next/static/chunks/75ee9aba04c74e23.js","/litellm-asset-prefix/_next/static/chunks/786e88f4abdd5c58.js","/litellm-asset-prefix/_next/static/chunks/2063ca6435a47940.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/84a27349dda457cd.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/d7c18aec4a87a237.js","/litellm-asset-prefix/_next/static/chunks/51d99dfbdc051e05.js"],"default"] 6:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 7:"$Sreact.suspense" :HL["/litellm-asset-prefix/_next/static/chunks/3f3fa56b5786d58c.css","style"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/3f3fa56b5786d58c.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/bee4095c26818f05.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/81937424fe90f746.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/04711b0f8ffa7bbd.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/eb1ba04e211a533f.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/88c74f8b4b20d25a.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/4cb93eefa53f21a3.js","async":true}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/84a27349dda457cd.js","async":true}],["$","script","script-12",{"src":"/litellm-asset-prefix/_next/static/chunks/8ddf82e7e0b331fc.js","async":true}],["$","script","script-13",{"src":"/litellm-asset-prefix/_next/static/chunks/1d7b3500478e93ae.js","async":true}],["$","script","script-14",{"src":"/litellm-asset-prefix/_next/static/chunks/f0e079183e7bb90c.js","async":true}],["$","script","script-15",{"src":"/litellm-asset-prefix/_next/static/chunks/10757c2146f43db4.js","async":true}],["$","script","script-16",{"src":"/litellm-asset-prefix/_next/static/chunks/786e88f4abdd5c58.js","async":true}],["$","script","script-17",{"src":"/litellm-asset-prefix/_next/static/chunks/ffa46de7b8384155.js","async":true}],["$","script","script-18",{"src":"/litellm-asset-prefix/_next/static/chunks/31275eb5c6f6332f.js","async":true}],["$","script","script-19",{"src":"/litellm-asset-prefix/_next/static/chunks/80f4410629229bf9.js","async":true}],["$","script","script-20",{"src":"/litellm-asset-prefix/_next/static/chunks/75ee9aba04c74e23.js","async":true}],["$","script","script-21",{"src":"/litellm-asset-prefix/_next/static/chunks/193886179a5779b5.js","async":true}],["$","script","script-22",{"src":"/litellm-asset-prefix/_next/static/chunks/2063ca6435a47940.js","async":true}],["$","script","script-23",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true}],["$","script","script-24",{"src":"/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","async":true}],["$","script","script-25",{"src":"/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","async":true}],["$","script","script-26",{"src":"/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","async":true}],["$","script","script-27",{"src":"/litellm-asset-prefix/_next/static/chunks/d7c18aec4a87a237.js","async":true}],["$","script","script-28",{"src":"/litellm-asset-prefix/_next/static/chunks/dac86522fa98e760.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/3f3fa56b5786d58c.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/bee4095c26818f05.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/81937424fe90f746.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/04711b0f8ffa7bbd.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/eb1ba04e211a533f.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/1d7b3500478e93ae.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/4cb93eefa53f21a3.js","async":true}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/f0e079183e7bb90c.js","async":true}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","async":true}],["$","script","script-12",{"src":"/litellm-asset-prefix/_next/static/chunks/8ddf82e7e0b331fc.js","async":true}],["$","script","script-13",{"src":"/litellm-asset-prefix/_next/static/chunks/193886179a5779b5.js","async":true}],["$","script","script-14",{"src":"/litellm-asset-prefix/_next/static/chunks/80f4410629229bf9.js","async":true}],["$","script","script-15",{"src":"/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","async":true}],["$","script","script-16",{"src":"/litellm-asset-prefix/_next/static/chunks/31275eb5c6f6332f.js","async":true}],["$","script","script-17",{"src":"/litellm-asset-prefix/_next/static/chunks/a4315c6eaf401064.js","async":true}],["$","script","script-18",{"src":"/litellm-asset-prefix/_next/static/chunks/10757c2146f43db4.js","async":true}],["$","script","script-19",{"src":"/litellm-asset-prefix/_next/static/chunks/88c74f8b4b20d25a.js","async":true}],["$","script","script-20",{"src":"/litellm-asset-prefix/_next/static/chunks/75ee9aba04c74e23.js","async":true}],["$","script","script-21",{"src":"/litellm-asset-prefix/_next/static/chunks/786e88f4abdd5c58.js","async":true}],["$","script","script-22",{"src":"/litellm-asset-prefix/_next/static/chunks/2063ca6435a47940.js","async":true}],["$","script","script-23",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true}],["$","script","script-24",{"src":"/litellm-asset-prefix/_next/static/chunks/84a27349dda457cd.js","async":true}],["$","script","script-25",{"src":"/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","async":true}],["$","script","script-26",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true}],["$","script","script-27",{"src":"/litellm-asset-prefix/_next/static/chunks/d7c18aec4a87a237.js","async":true}],["$","script","script-28",{"src":"/litellm-asset-prefix/_next/static/chunks/51d99dfbdc051e05.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} 4:{} 5:"$0:rsc:props:children:0:props:serverProvidedParams:params" 8:null diff --git a/litellm/proxy/_experimental/out/__next._full.txt b/litellm/proxy/_experimental/out/__next._full.txt index 2b2b38502070..c5f18ea1744c 100644 --- a/litellm/proxy/_experimental/out/__next._full.txt +++ b/litellm/proxy/_experimental/out/__next._full.txt @@ -1,34 +1,34 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -8:I[952683,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/bee4095c26818f05.js","/litellm-asset-prefix/_next/static/chunks/81937424fe90f746.js","/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/04711b0f8ffa7bbd.js","/litellm-asset-prefix/_next/static/chunks/eb1ba04e211a533f.js","/litellm-asset-prefix/_next/static/chunks/88c74f8b4b20d25a.js","/litellm-asset-prefix/_next/static/chunks/4cb93eefa53f21a3.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/84a27349dda457cd.js","/litellm-asset-prefix/_next/static/chunks/8ddf82e7e0b331fc.js","/litellm-asset-prefix/_next/static/chunks/1d7b3500478e93ae.js","/litellm-asset-prefix/_next/static/chunks/f0e079183e7bb90c.js","/litellm-asset-prefix/_next/static/chunks/10757c2146f43db4.js","/litellm-asset-prefix/_next/static/chunks/786e88f4abdd5c58.js","/litellm-asset-prefix/_next/static/chunks/ffa46de7b8384155.js","/litellm-asset-prefix/_next/static/chunks/31275eb5c6f6332f.js","/litellm-asset-prefix/_next/static/chunks/80f4410629229bf9.js","/litellm-asset-prefix/_next/static/chunks/75ee9aba04c74e23.js","/litellm-asset-prefix/_next/static/chunks/193886179a5779b5.js","/litellm-asset-prefix/_next/static/chunks/2063ca6435a47940.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/d7c18aec4a87a237.js","/litellm-asset-prefix/_next/static/chunks/dac86522fa98e760.js"],"default"] +8:I[952683,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/bee4095c26818f05.js","/litellm-asset-prefix/_next/static/chunks/81937424fe90f746.js","/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/04711b0f8ffa7bbd.js","/litellm-asset-prefix/_next/static/chunks/eb1ba04e211a533f.js","/litellm-asset-prefix/_next/static/chunks/1d7b3500478e93ae.js","/litellm-asset-prefix/_next/static/chunks/4cb93eefa53f21a3.js","/litellm-asset-prefix/_next/static/chunks/f0e079183e7bb90c.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/8ddf82e7e0b331fc.js","/litellm-asset-prefix/_next/static/chunks/193886179a5779b5.js","/litellm-asset-prefix/_next/static/chunks/80f4410629229bf9.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","/litellm-asset-prefix/_next/static/chunks/31275eb5c6f6332f.js","/litellm-asset-prefix/_next/static/chunks/a4315c6eaf401064.js","/litellm-asset-prefix/_next/static/chunks/10757c2146f43db4.js","/litellm-asset-prefix/_next/static/chunks/88c74f8b4b20d25a.js","/litellm-asset-prefix/_next/static/chunks/75ee9aba04c74e23.js","/litellm-asset-prefix/_next/static/chunks/786e88f4abdd5c58.js","/litellm-asset-prefix/_next/static/chunks/2063ca6435a47940.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/84a27349dda457cd.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/d7c18aec4a87a237.js","/litellm-asset-prefix/_next/static/chunks/51d99dfbdc051e05.js"],"default"] 1a:I[168027,[],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] :HL["/litellm-asset-prefix/_next/static/chunks/3f3fa56b5786d58c.css","style"] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/3f3fa56b5786d58c.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/bee4095c26818f05.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/81937424fe90f746.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/04711b0f8ffa7bbd.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/eb1ba04e211a533f.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/88c74f8b4b20d25a.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/4cb93eefa53f21a3.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/84a27349dda457cd.js","async":true,"nonce":"$undefined"}],["$","script","script-12",{"src":"/litellm-asset-prefix/_next/static/chunks/8ddf82e7e0b331fc.js","async":true,"nonce":"$undefined"}],["$","script","script-13",{"src":"/litellm-asset-prefix/_next/static/chunks/1d7b3500478e93ae.js","async":true,"nonce":"$undefined"}],["$","script","script-14",{"src":"/litellm-asset-prefix/_next/static/chunks/f0e079183e7bb90c.js","async":true,"nonce":"$undefined"}],["$","script","script-15",{"src":"/litellm-asset-prefix/_next/static/chunks/10757c2146f43db4.js","async":true,"nonce":"$undefined"}],"$Lb","$Lc","$Ld","$Le","$Lf","$L10","$L11","$L12","$L13","$L14","$L15","$L16","$L17"],"$L18"]}],{},null,false,false]},null,false,false],"$L19",false]],"m":"$undefined","G":["$1a",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/3f3fa56b5786d58c.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/bee4095c26818f05.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/81937424fe90f746.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/04711b0f8ffa7bbd.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/eb1ba04e211a533f.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/1d7b3500478e93ae.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/4cb93eefa53f21a3.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/f0e079183e7bb90c.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","async":true,"nonce":"$undefined"}],["$","script","script-12",{"src":"/litellm-asset-prefix/_next/static/chunks/8ddf82e7e0b331fc.js","async":true,"nonce":"$undefined"}],["$","script","script-13",{"src":"/litellm-asset-prefix/_next/static/chunks/193886179a5779b5.js","async":true,"nonce":"$undefined"}],["$","script","script-14",{"src":"/litellm-asset-prefix/_next/static/chunks/80f4410629229bf9.js","async":true,"nonce":"$undefined"}],["$","script","script-15",{"src":"/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","async":true,"nonce":"$undefined"}],"$Lb","$Lc","$Ld","$Le","$Lf","$L10","$L11","$L12","$L13","$L14","$L15","$L16","$L17"],"$L18"]}],{},null,false,false]},null,false,false],"$L19",false]],"m":"$undefined","G":["$1a",[]],"S":true} 1b:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 1c:"$Sreact.suspense" 1e:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"] 20:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"MetadataBoundary"] -b:["$","script","script-16",{"src":"/litellm-asset-prefix/_next/static/chunks/786e88f4abdd5c58.js","async":true,"nonce":"$undefined"}] -c:["$","script","script-17",{"src":"/litellm-asset-prefix/_next/static/chunks/ffa46de7b8384155.js","async":true,"nonce":"$undefined"}] -d:["$","script","script-18",{"src":"/litellm-asset-prefix/_next/static/chunks/31275eb5c6f6332f.js","async":true,"nonce":"$undefined"}] -e:["$","script","script-19",{"src":"/litellm-asset-prefix/_next/static/chunks/80f4410629229bf9.js","async":true,"nonce":"$undefined"}] +b:["$","script","script-16",{"src":"/litellm-asset-prefix/_next/static/chunks/31275eb5c6f6332f.js","async":true,"nonce":"$undefined"}] +c:["$","script","script-17",{"src":"/litellm-asset-prefix/_next/static/chunks/a4315c6eaf401064.js","async":true,"nonce":"$undefined"}] +d:["$","script","script-18",{"src":"/litellm-asset-prefix/_next/static/chunks/10757c2146f43db4.js","async":true,"nonce":"$undefined"}] +e:["$","script","script-19",{"src":"/litellm-asset-prefix/_next/static/chunks/88c74f8b4b20d25a.js","async":true,"nonce":"$undefined"}] f:["$","script","script-20",{"src":"/litellm-asset-prefix/_next/static/chunks/75ee9aba04c74e23.js","async":true,"nonce":"$undefined"}] -10:["$","script","script-21",{"src":"/litellm-asset-prefix/_next/static/chunks/193886179a5779b5.js","async":true,"nonce":"$undefined"}] +10:["$","script","script-21",{"src":"/litellm-asset-prefix/_next/static/chunks/786e88f4abdd5c58.js","async":true,"nonce":"$undefined"}] 11:["$","script","script-22",{"src":"/litellm-asset-prefix/_next/static/chunks/2063ca6435a47940.js","async":true,"nonce":"$undefined"}] 12:["$","script","script-23",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true,"nonce":"$undefined"}] -13:["$","script","script-24",{"src":"/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","async":true,"nonce":"$undefined"}] +13:["$","script","script-24",{"src":"/litellm-asset-prefix/_next/static/chunks/84a27349dda457cd.js","async":true,"nonce":"$undefined"}] 14:["$","script","script-25",{"src":"/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","async":true,"nonce":"$undefined"}] -15:["$","script","script-26",{"src":"/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","async":true,"nonce":"$undefined"}] +15:["$","script","script-26",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}] 16:["$","script","script-27",{"src":"/litellm-asset-prefix/_next/static/chunks/d7c18aec4a87a237.js","async":true,"nonce":"$undefined"}] -17:["$","script","script-28",{"src":"/litellm-asset-prefix/_next/static/chunks/dac86522fa98e760.js","async":true,"nonce":"$undefined"}] +17:["$","script","script-28",{"src":"/litellm-asset-prefix/_next/static/chunks/51d99dfbdc051e05.js","async":true,"nonce":"$undefined"}] 18:["$","$L1b",null,{"children":["$","$1c",null,{"name":"Next.MetadataOutlet","children":"$@1d"}]}] 19:["$","$1","h",{"children":[null,["$","$L1e",null,{"children":"$L1f"}],["$","div",null,{"hidden":true,"children":["$","$L20",null,{"children":["$","$1c",null,{"name":"Next.Metadata","children":"$L21"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}] 9:{} diff --git a/litellm/proxy/_experimental/out/__next._head.txt b/litellm/proxy/_experimental/out/__next._head.txt index 870c89c7e114..5e208181bb38 100644 --- a/litellm/proxy/_experimental/out/__next._head.txt +++ b/litellm/proxy/_experimental/out/__next._head.txt @@ -3,4 +3,4 @@ 3:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"IconMark"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/__next._index.txt b/litellm/proxy/_experimental/out/__next._index.txt index 67c452e8c219..d3b4e1ec8d8c 100644 --- a/litellm/proxy/_experimental/out/__next._index.txt +++ b/litellm/proxy/_experimental/out/__next._index.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/__next._tree.txt b/litellm/proxy/_experimental/out/__next._tree.txt index 86dc121c5f9f..72353659a826 100644 --- a/litellm/proxy/_experimental/out/__next._tree.txt +++ b/litellm/proxy/_experimental/out/__next._tree.txt @@ -2,4 +2,4 @@ :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] :HL["/litellm-asset-prefix/_next/static/chunks/3f3fa56b5786d58c.css","style"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":true},"staleTime":300} diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/5da00c0630555f00.js b/litellm/proxy/_experimental/out/_next/static/chunks/2476fe06d2780024.js similarity index 67% rename from litellm/proxy/_experimental/out/_next/static/chunks/5da00c0630555f00.js rename to litellm/proxy/_experimental/out/_next/static/chunks/2476fe06d2780024.js index 01e4ffebd031..9b5ccf29e7df 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/5da00c0630555f00.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/2476fe06d2780024.js @@ -1,8 +1,8 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,321443,e=>{"use strict";var t=e.i(843476),n=e.i(271645),r=e.i(135214),i=e.i(247167),l=e.i(592968),o=e.i(981339),s=e.i(282786),a=e.i(888259),c=e.i(313603),d=e.i(646563),u=e.i(751904),f=e.i(44121),p=e.i(186515),h=e.i(928685),g=e.i(264843),x=e.i(477189),m=e.i(438957),y=e.i(447566),b=e.i(755151),v=e.i(492030),k=e.i(918789);function j(e,t){let n=String(e);if("string"!=typeof t)throw TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}var S=e.i(420061),w=e.i(997803),C=e.i(733644),z=e.i(457579);let E="phrasing",O=["autolink","link","image","label"];function T(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function A(e){this.config.enter.autolinkProtocol.call(this,e)}function M(e){this.config.exit.autolinkProtocol.call(this,e)}function R(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];(0,S.ok)("link"===t.type),t.url="http://"+this.sliceSerialize(e)}function L(e){this.config.exit.autolinkEmail.call(this,e)}function I(e){this.exit(e)}function D(e){!function(e,t,n){let r=(0,z.convert)((n||{}).ignore||[]),i=function(e){let t=[];if(!Array.isArray(e))throw TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r0?{type:"text",value:l}:void 0),!1===l?r.lastIndex=n+1:(s!==n&&d.push({type:"text",value:e.value.slice(s,n)}),Array.isArray(l)?d.push(...l):l&&d.push(l),s=n+u[0].length,c=!0),!r.global)break;u=r.exec(e.value)}return c?(s?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")"),i=j(e,"("),l=j(e,")");for(;-1!==r&&i>l;)e+=n.slice(0,r+1),r=(n=n.slice(r+1)).indexOf(")"),l++;return[e,n]}(n+r);if(!s[0])return!1;let a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function F(e,t,n,r){return!(!W(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function W(e,t){let n=e.input.charCodeAt(e.index-1);return(0===e.index||(0,w.unicodeWhitespace)(n)||(0,w.unicodePunctuation)(n))&&(!t||47!==n)}var P=e.i(431745);function N(){this.buffer()}function $(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function B(){this.buffer()}function H(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function U(e){let t=this.resume(),n=this.stack[this.stack.length-1];(0,S.ok)("footnoteReference"===n.type),n.identifier=(0,P.normalizeIdentifier)(this.sliceSerialize(e)).toLowerCase(),n.label=t}function V(e){this.exit(e)}function Y(e){let t=this.resume(),n=this.stack[this.stack.length-1];(0,S.ok)("footnoteDefinition"===n.type),n.identifier=(0,P.normalizeIdentifier)(this.sliceSerialize(e)).toLowerCase(),n.label=t}function q(e){this.exit(e)}function J(e,t,n,r){let i=n.createTracker(r),l=i.move("[^"),o=n.enter("footnoteReference"),s=n.enter("reference");return l+=i.move(n.safe(n.associationId(e),{after:"]",before:l})),s(),o(),l+=i.move("]")}function K(e,t,n){return 0===t?e:G(e,t,n)}function G(e,t,n){return(n?"":" ")+e}J.peek=function(){return"["};let X=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function Z(e){this.enter({type:"delete",children:[]},e)}function Q(e){this.exit(e)}function ee(e,t,n,r){let i=n.createTracker(r),l=n.enter("strikethrough"),o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),l(),o}function et(e){return e.length}function en(e){let t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:114*(82===t||114===t)}ee.peek=function(){return"~"};var er=e.i(682523);e.i(784801);e.i(900065);function ei(e,t,n){let r=e.value||"",i="`",l=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+l);let o=l.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(o=4*Math.ceil(o/4));let s=n.createTracker(r);s.move(l+" ".repeat(o-l.length)),s.shift(o);let a=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),function(e,t,n){return t?(n?"":" ".repeat(o))+e:(n?l:l+" ".repeat(o-l.length))+e});return a(),c};function eo(e){let t=e._align;(0,S.ok)(t,"expected `_align` on table"),this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function es(e){this.exit(e),this.data.inTable=void 0}function ea(e){this.enter({type:"tableRow",children:[]},e)}function ec(e){this.exit(e)}function ed(e){this.enter({type:"tableCell",children:[]},e)}function eu(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,ef));let n=this.stack[this.stack.length-1];(0,S.ok)("inlineCode"===n.type),n.value=t,this.exit(e)}function ef(e,t){return"|"===t?t:e}function ep(e){let t=this.stack[this.stack.length-2];(0,S.ok)("listItem"===t.type),t.checked="taskListCheckValueChecked"===e.type}function eh(e){let t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){let e=this.stack[this.stack.length-1];(0,S.ok)("paragraph"===e.type);let n=e.children[0];if(n&&"text"===n.type){let r,i=t.children,l=-1;for(;++l0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}eC[43]=ew,eC[45]=ew,eC[46]=ew,eC[95]=ew,eC[72]=[ew,eS],eC[104]=[ew,eS],eC[87]=[ew,ej],eC[119]=[ew,ej];var eR=e.i(653161),eL=e.i(204108);let eI={tokenize:function(e,t,n){let r=this;return(0,eL.factorySpace)(e,function(e){let i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function eD(e,t,n){let r,i=this,l=i.events.length,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);for(;l--;){let e=i.events[l][1];if("labelImage"===e.type){r=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(l){if(!r||!r._balanced)return n(l);let s=(0,P.normalizeIdentifier)(i.sliceSerialize({start:r.end,end:i.now()}));return 94===s.codePointAt(0)&&o.includes(s.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l)):n(l)}}function e_(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function eF(e,t,n){let r,i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),o=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),s};function s(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",a)}function a(s){if(o>999||93===s&&!r||null===s||91===s||(0,w.markdownLineEndingOrSpace)(s))return n(s);if(93===s){e.exit("chunkString");let r=e.exit("gfmFootnoteCallString");return l.includes((0,P.normalizeIdentifier)(i.sliceSerialize(r)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(s)}return(0,w.markdownLineEndingOrSpace)(s)||(r=!0),o++,e.consume(s),92===s?c:a}function c(t){return 91===t||92===t||93===t?(e.consume(t),o++,a):a(t)}}function eW(e,t,n){let r,i,l=this,o=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]),s=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),a};function a(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(s>999||93===t&&!i||null===t||91===t||(0,w.markdownLineEndingOrSpace)(t))return n(t);if(93===t){e.exit("chunkString");let n=e.exit("gfmFootnoteDefinitionLabelString");return r=(0,P.normalizeIdentifier)(l.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),u}return(0,w.markdownLineEndingOrSpace)(t)||(i=!0),s++,e.consume(t),92===t?d:c}function d(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}function u(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),o.includes(r)||o.push(r),(0,eL.factorySpace)(e,f,"gfmFootnoteDefinitionWhitespace")):n(t)}function f(e){return t(e)}}function eP(e,t,n){return e.check(eR.blankLine,t,e.attempt(eI,t,n))}function eN(e){e.exit("gfmFootnoteDefinition")}var e$=e.i(938402),eB=e.i(810291);class eH{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let i=0;if(0!==n||0!==r.length){for(;i0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}}function eU(e,t,n){let r,i=this,l=0,o=0;return function(e){let t=i.events.length-1;for(;t>-1;){let e=i.events[t][1].type;if("lineEnding"===e||"linePrefix"===e)t--;else break}let r=t>-1?i.events[t][1].type:null,l="tableHead"===r||"tableRow"===r?y:s;return l===y&&i.parser.lazy[i.now().line]?n(e):l(e)};function s(t){var n;return e.enter("tableHead"),e.enter("tableRow"),124===(n=t)||(r=!0,o+=1),a(n)}function a(t){return null===t?n(t):(0,w.markdownLineEnding)(t)?o>1?(o=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),u):n(t):(0,w.markdownSpace)(t)?(0,eL.factorySpace)(e,a,"whitespace")(t):(o+=1,r&&(r=!1,l+=1),124===t)?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),r=!0,a):(e.enter("data"),c(t))}function c(t){return null===t||124===t||(0,w.markdownLineEndingOrSpace)(t)?(e.exit("data"),a(t)):(e.consume(t),92===t?d:c)}function d(t){return 92===t||124===t?(e.consume(t),c):c(t)}function u(t){return(i.interrupt=!1,i.parser.lazy[i.now().line])?n(t):(e.enter("tableDelimiterRow"),r=!1,(0,w.markdownSpace)(t))?(0,eL.factorySpace)(e,f,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):f(t)}function f(t){return 45===t||58===t?h(t):124===t?(r=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),p):n(t)}function p(t){return(0,w.markdownSpace)(t)?(0,eL.factorySpace)(e,h,"whitespace")(t):h(t)}function h(t){return 58===t?(o+=1,r=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),g):45===t?(o+=1,g(t)):null===t||(0,w.markdownLineEnding)(t)?m(t):n(t)}function g(t){return 45===t?(e.enter("tableDelimiterFiller"),function t(n){return 45===n?(e.consume(n),t):58===n?(r=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(n),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(n))}(t)):n(t)}function x(t){return(0,w.markdownSpace)(t)?(0,eL.factorySpace)(e,m,"whitespace")(t):m(t)}function m(i){if(124===i)return f(i);if(null===i||(0,w.markdownLineEnding)(i))return r&&l===o?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(i)):n(i);return n(i)}function y(t){return e.enter("tableRow"),b(t)}function b(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),b):null===n||(0,w.markdownLineEnding)(n)?(e.exit("tableRow"),t(n)):(0,w.markdownSpace)(n)?(0,eL.factorySpace)(e,b,"whitespace")(n):(e.enter("data"),v(n))}function v(t){return null===t||124===t||(0,w.markdownLineEndingOrSpace)(t)?(e.exit("data"),b(t)):(e.consume(t),92===t?k:v)}function k(t){return 92===t||124===t?(e.consume(t),v):v(t)}}function eV(e,t){let n,r,i,l=-1,o=!0,s=0,a=[0,0,0,0],c=[0,0,0,0],d=!1,u=0,f=new eH;for(;++ln[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",o,t]])}return void 0!==i&&(l.end=Object.assign({},eJ(t.events,i)),e.add(i,0,[["exit",l,t]]),l=void 0),l}function eq(e,t,n,r,i){let l=[],o=eJ(t.events,n);i&&(i.end=Object.assign({},o),l.push(["exit",i,t])),r.end=Object.assign({},o),l.push(["exit",r,t]),e.add(n+1,0,l)}function eJ(e,t){let n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}let eK={name:"tasklistCheck",tokenize:function(e,t,n){let r=this;return function(t){return null===r.previous&&r._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),i):n(t)};function i(t){return(0,w.markdownLineEndingOrSpace)(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),l):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),l):n(t)}function l(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(t)}function o(r){return(0,w.markdownLineEnding)(r)?t(r):(0,w.markdownSpace)(r)?e.check({tokenize:eG},t,n)(r):n(r)}}};function eG(e,t,n){return(0,eL.factorySpace)(e,function(e){return null===e?n(e):t(e)},"whitespace")}let eX={};function eZ(e){var t;let n,r,i,l=e||eX,o=this.data(),s=o.micromarkExtensions||(o.micromarkExtensions=[]),a=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),c=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);s.push((t=l,(0,ex.combineExtensions)([{text:eC},{document:{91:{name:"gfmFootnoteDefinition",tokenize:eW,continuation:{tokenize:eP},exit:eN}},text:{91:{name:"gfmFootnoteCall",tokenize:eF},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:eD,resolveTo:e_}}},(n=(t||{}).singleTilde,r={name:"strikethrough",tokenize:function(e,t,r){let i=this.previous,l=this.events,o=0;return function(s){return 126===i&&"characterEscape"!==l[l.length-1][1].type?r(s):(e.enter("strikethroughSequenceTemporary"),function l(s){let a=(0,er.classifyCharacter)(i);if(126===s)return o>1?r(s):(e.consume(s),o++,l);if(o<2&&!n)return r(s);let c=e.exit("strikethroughSequenceTemporary"),d=(0,er.classifyCharacter)(s);return c._open=!d||2===d&&!!a,c._close=!a||2===a&&!!d,t(s)}(s))}},resolveAll:function(e,t){let n=-1;for(;++n0&&(l.shift(4),o+=l.move((i?"\n":" ")+n.indentLines(n.containerFlow(e,l.current()),i?G:K))),s(),o},footnoteReference:J},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:X}],handlers:{delete:ee}},function(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=ei(e,t,n);return n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&")),r},table:function(e,t,n,r){return s(function(e,t,n){let r=e.children,i=-1,l=[],o=t.enter("table");for(;++ic&&(c=e[d].length);++la[l])&&(a[l]=e)}t.push(o)}o[d]=t,s[d]=r}let f=-1;if("object"==typeof r&&"length"in r)for(;++fa[f]&&(a[f]=i),h[f]=i),p[f]=o}o.splice(1,0,p),s.splice(1,0,h),d=-1;let g=[];for(;++dt.updatedAt-e.updatedAt).slice(0,100)}var e2=e.i(464571),e4=e.i(311451),e6=e.i(212931),e5=e.i(883552),e3=e.i(343794),e8=e.i(430073),e7=e.i(611935),e9=e.i(908206),te=e.i(242064),tt=e.i(321883),tn=e.i(517455),tr=e.i(150073);let ti=n.createContext({});e.i(296059);var tl=e.i(915654),to=e.i(183293),ts=e.i(246422),ta=e.i(838378);let tc=(0,ts.genStyleHooks)("Avatar",e=>{let{colorTextLightSolid:t,colorTextPlaceholder:n}=e,r=(0,ta.mergeToken)(e,{avatarBg:n,avatarColor:t});return[(e=>{let{antCls:t,componentCls:n,iconCls:r,avatarBg:i,avatarColor:l,containerSize:o,containerSizeLG:s,containerSizeSM:a,textFontSize:c,textFontSizeLG:d,textFontSizeSM:u,iconFontSize:f,iconFontSizeLG:p,iconFontSizeSM:h,borderRadius:g,borderRadiusLG:x,borderRadiusSM:m,lineWidth:y,lineType:b}=e,v=(e,t,i,l)=>({width:e,height:e,borderRadius:"50%",fontSize:t,[`&${n}-square`]:{borderRadius:l},[`&${n}-icon`]:{fontSize:i,[`> ${r}`]:{margin:0}}});return{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,to.resetComponent)(e)),{position:"relative",display:"inline-flex",justifyContent:"center",alignItems:"center",overflow:"hidden",color:l,whiteSpace:"nowrap",textAlign:"center",verticalAlign:"middle",background:i,border:`${(0,tl.unit)(y)} ${b} transparent`,"&-image":{background:"transparent"},[`${t}-image-img`]:{display:"block"}}),v(o,c,f,g)),{"&-lg":Object.assign({},v(s,d,p,x)),"&-sm":Object.assign({},v(a,u,h,m)),"> img":{display:"block",width:"100%",height:"100%",objectFit:"cover"}})}})(r),(e=>{let{componentCls:t,groupBorderColor:n,groupOverlapping:r,groupSpace:i}=e;return{[`${t}-group`]:{display:"inline-flex",[t]:{borderColor:n},"> *:not(:first-child)":{marginInlineStart:r}},[`${t}-group-popover`]:{[`${t} + ${t}`]:{marginInlineStart:i}}}})(r)]},e=>{let{controlHeight:t,controlHeightLG:n,controlHeightSM:r,fontSize:i,fontSizeLG:l,fontSizeXL:o,fontSizeHeading3:s,marginXS:a,marginXXS:c,colorBorderBg:d}=e;return{containerSize:t,containerSizeLG:n,containerSizeSM:r,textFontSize:i,textFontSizeLG:i,textFontSizeSM:i,iconFontSize:Math.round((l+o)/2),iconFontSizeLG:s,iconFontSizeSM:i,groupSpace:c,groupOverlapping:-a,groupBorderColor:d}});var td=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let tu=n.forwardRef((e,t)=>{let r,{prefixCls:i,shape:l,size:o,src:s,srcSet:a,icon:c,className:d,rootClassName:u,style:f,alt:p,draggable:h,children:g,crossOrigin:x,gap:m=4,onError:y}=e,b=td(e,["prefixCls","shape","size","src","srcSet","icon","className","rootClassName","style","alt","draggable","children","crossOrigin","gap","onError"]),[v,k]=n.useState(1),[j,S]=n.useState(!1),[w,C]=n.useState(!0),z=n.useRef(null),E=n.useRef(null),O=(0,e7.composeRef)(t,z),{getPrefixCls:T,avatar:A}=n.useContext(te.ConfigContext),M=n.useContext(ti),R=()=>{if(!E.current||!z.current)return;let e=E.current.offsetWidth,t=z.current.offsetWidth;0!==e&&0!==t&&2*m{S(!0)},[]),n.useEffect(()=>{C(!0),k(1)},[s]),n.useEffect(R,[m]);let L=(0,tn.default)(e=>{var t,n;return null!=(n=null!=(t=null!=o?o:null==M?void 0:M.size)?t:e)?n:"default"}),I=Object.keys("object"==typeof L&&L||{}).some(e=>["xs","sm","md","lg","xl","xxl"].includes(e)),D=(0,tr.default)(I),_=n.useMemo(()=>{if("object"!=typeof L)return{};let e=L[e9.responsiveArray.find(e=>D[e])];return e?{width:e,height:e,fontSize:e&&(c||g)?e/2:18}:{}},[D,L,c,g]),F=T("avatar",i),W=(0,tt.default)(F),[P,N,$]=tc(F,W),B=(0,e3.default)({[`${F}-lg`]:"large"===L,[`${F}-sm`]:"small"===L}),H=n.isValidElement(s),U=l||(null==M?void 0:M.shape)||"circle",V=(0,e3.default)(F,B,null==A?void 0:A.className,`${F}-${U}`,{[`${F}-image`]:H||s&&w,[`${F}-icon`]:!!c},$,W,d,u,N),Y="number"==typeof L?{width:L,height:L,fontSize:c?L/2:18}:{};if("string"==typeof s&&w)r=n.createElement("img",{src:s,draggable:h,srcSet:a,onError:()=>{!1!==(null==y?void 0:y())&&C(!1)},alt:p,crossOrigin:x});else if(H)r=s;else if(c)r=c;else if(j||1!==v){let e=`scale(${v})`;r=n.createElement(e8.default,{onResize:R},n.createElement("span",{className:`${F}-string`,ref:E,style:{msTransform:e,WebkitTransform:e,transform:e}},g))}else r=n.createElement("span",{className:`${F}-string`,style:{opacity:0},ref:E},g);return P(n.createElement("span",Object.assign({},b,{style:Object.assign(Object.assign(Object.assign(Object.assign({},Y),_),null==A?void 0:A.style),f),className:V,ref:O}),r))});var tf=e.i(876556),tp=e.i(763731),th=e.i(829672);let tg=e=>{let{size:t,shape:r}=n.useContext(ti),i=n.useMemo(()=>({size:e.size||t,shape:e.shape||r}),[e.size,e.shape,t,r]);return n.createElement(ti.Provider,{value:i},e.children)};tu.Group=e=>{var t,r,i,l;let{getPrefixCls:o,direction:s}=n.useContext(te.ConfigContext),{prefixCls:a,className:c,rootClassName:d,style:u,maxCount:f,maxStyle:p,size:h,shape:g,maxPopoverPlacement:x,maxPopoverTrigger:m,children:y,max:b}=e,v=o("avatar",a),k=`${v}-group`,j=(0,tt.default)(v),[S,w,C]=tc(v,j),z=(0,e3.default)(k,{[`${k}-rtl`]:"rtl"===s},C,j,c,d,w),E=(0,tf.default)(y).map((e,t)=>(0,tp.cloneElement)(e,{key:`avatar-key-${t}`})),O=(null==b?void 0:b.count)||f,T=E.length;if(O&&O{let t=(0,tb.default)(),n=(0,tb.default)(e);return n.isSame(t,"day")?"Today":n.isSame(t.subtract(1,"day"),"day")?"Yesterday":n.isAfter(t.subtract(7,"day"))?"Last 7 Days":"Older"},tj=["Today","Yesterday","Last 7 Days","Older"],tS=({conv:e,isActive:r,onSelect:i,onDelete:o,onRename:s})=>{let[a,c]=(0,n.useState)(!1),[d,f]=(0,n.useState)(e.title),p=(0,n.useRef)(null);(0,n.useEffect)(()=>{a&&p.current&&(p.current.focus(),p.current.select())},[a]);let h=()=>{let t=d.trim();t&&t!==e.title&&s(e.id,t),c(!1)},g=e.title.length>40?e.title.slice(0,40)+"…":e.title;return(0,t.jsx)("div",{onClick:()=>!a&&i(e.id),className:"conversation-row group",style:{display:"flex",alignItems:"center",padding:"6px 8px",borderRadius:6,cursor:a?"default":"pointer",backgroundColor:r?"#e6f4ff":"transparent",transition:"background-color 0.15s",minHeight:34,position:"relative"},onMouseEnter:e=>{r||(e.currentTarget.style.backgroundColor="#f5f5f5")},onMouseLeave:e=>{r||(e.currentTarget.style.backgroundColor="transparent")},children:a?(0,t.jsx)(e4.Input,{ref:e=>{p.current=e?.input??null},size:"small",value:d,onChange:e=>f(e.target.value),onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),h()):"Escape"===t.key&&(t.preventDefault(),f(e.title),c(!1))},onBlur:h,onClick:e=>e.stopPropagation(),style:{flex:1,fontSize:13}}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tv,{style:{flex:1,fontSize:13,color:r?"#1677ff":"#333",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:r?500:400},title:e.title,children:g}),(0,t.jsxs)("div",{className:"conversation-actions",style:{display:"flex",gap:2,opacity:0,transition:"opacity 0.15s",flexShrink:0},onClick:e=>e.stopPropagation(),children:[(0,t.jsx)(l.Tooltip,{title:"Rename",children:(0,t.jsx)(e2.Button,{type:"text",size:"small",icon:(0,t.jsx)(u.EditOutlined,{style:{fontSize:12}}),onClick:t=>{t.stopPropagation(),f(e.title),c(!0)},style:{width:22,height:22,padding:0,minWidth:22}})}),(0,t.jsx)(e5.Popconfirm,{title:"Delete this conversation?",onConfirm:()=>o(e.id),okText:"Delete",cancelText:"Cancel",okButtonProps:{danger:!0},children:(0,t.jsx)(l.Tooltip,{title:"Delete",children:(0,t.jsx)(e2.Button,{type:"text",size:"small",danger:!0,icon:(0,t.jsx)(tm.DeleteOutlined,{style:{fontSize:12}}),style:{width:22,height:22,padding:0,minWidth:22}})})})]})]})})},tw=({open:e,conversations:r,onSelect:i,onClose:l})=>{let[o,s]=(0,n.useState)("");(0,n.useEffect)(()=>{e||s("")},[e]);let a=o.trim()?r.filter(e=>e.title.toLowerCase().includes(o.trim().toLowerCase())):r;return(0,t.jsxs)(e6.Modal,{open:e,onCancel:l,footer:null,title:null,width:480,styles:{body:{padding:"16px 16px 8px"}},children:[(0,t.jsx)(e4.Input,{autoFocus:!0,prefix:(0,t.jsx)(h.SearchOutlined,{style:{color:"#bbb"}}),placeholder:"Search conversations…",value:o,onChange:e=>s(e.target.value),style:{marginBottom:12},allowClear:!0}),(0,t.jsx)("div",{style:{maxHeight:320,overflowY:"auto"},children:0===a.length?(0,t.jsx)("div",{style:{textAlign:"center",padding:"24px 0",color:"#999"},children:"No conversations found"}):a.map(e=>{let n=e.title.length>55?e.title.slice(0,55)+"…":e.title;return(0,t.jsxs)("div",{onClick:()=>{i(e.id),l()},style:{display:"flex",alignItems:"center",gap:8,padding:"8px 10px",borderRadius:6,cursor:"pointer",transition:"background-color 0.1s"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#f0f5ff"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"},children:[(0,t.jsx)(g.MessageOutlined,{style:{color:"#999",flexShrink:0}}),(0,t.jsx)(tv,{style:{fontSize:13},children:n}),(0,t.jsx)(tv,{type:"secondary",style:{fontSize:11,marginLeft:"auto",flexShrink:0},children:(0,tb.default)(e.updatedAt).format("MMM D")})]},e.id)})})]})},tC=({conversations:e,activeConversationId:r,onSelect:i,onDelete:o,onNewChat:s,onRename:a})=>{let[c,u]=(0,n.useState)(!1),f=(0,n.useCallback)(e=>{"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),u(e=>!e))},[]);(0,n.useEffect)(()=>(document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)),[f]);let p=(e=>{let t=new Map;for(let n of e){let e=tk(n.updatedAt);t.has(e)||t.set(e,[]),t.get(e).push(n)}return tj.filter(e=>t.has(e)).map(e=>({group:e,items:t.get(e)}))})(e);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{children:` +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,321443,e=>{"use strict";var t=e.i(843476),n=e.i(271645),r=e.i(135214),i=e.i(247167),l=e.i(592968),o=e.i(981339),s=e.i(282786),a=e.i(888259),c=e.i(313603),d=e.i(646563),u=e.i(751904),f=e.i(44121),p=e.i(186515),h=e.i(928685),g=e.i(264843),x=e.i(477189),m=e.i(438957),y=e.i(447566),b=e.i(755151),v=e.i(492030),k=e.i(918789);function j(e,t){let n=String(e);if("string"!=typeof t)throw TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}var S=e.i(420061),w=e.i(997803),C=e.i(733644),z=e.i(457579);let E="phrasing",T=["autolink","link","image","label"];function O(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function A(e){this.config.enter.autolinkProtocol.call(this,e)}function M(e){this.config.exit.autolinkProtocol.call(this,e)}function R(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];(0,S.ok)("link"===t.type),t.url="http://"+this.sliceSerialize(e)}function L(e){this.config.exit.autolinkEmail.call(this,e)}function D(e){this.exit(e)}function I(e){!function(e,t,n){let r=(0,z.convert)((n||{}).ignore||[]),i=function(e){let t=[];if(!Array.isArray(e))throw TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r0?{type:"text",value:l}:void 0),!1===l?r.lastIndex=n+1:(s!==n&&d.push({type:"text",value:e.value.slice(s,n)}),Array.isArray(l)?d.push(...l):l&&d.push(l),s=n+u[0].length,c=!0),!r.global)break;u=r.exec(e.value)}return c?(s?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")"),i=j(e,"("),l=j(e,")");for(;-1!==r&&i>l;)e+=n.slice(0,r+1),r=(n=n.slice(r+1)).indexOf(")"),l++;return[e,n]}(n+r);if(!s[0])return!1;let a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function _(e,t,n,r){return!(!W(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function W(e,t){let n=e.input.charCodeAt(e.index-1);return(0===e.index||(0,w.unicodeWhitespace)(n)||(0,w.unicodePunctuation)(n))&&(!t||47!==n)}var $=e.i(431745);function P(){this.buffer()}function N(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function B(){this.buffer()}function H(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function U(e){let t=this.resume(),n=this.stack[this.stack.length-1];(0,S.ok)("footnoteReference"===n.type),n.identifier=(0,$.normalizeIdentifier)(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Y(e){this.exit(e)}function q(e){let t=this.resume(),n=this.stack[this.stack.length-1];(0,S.ok)("footnoteDefinition"===n.type),n.identifier=(0,$.normalizeIdentifier)(this.sliceSerialize(e)).toLowerCase(),n.label=t}function K(e){this.exit(e)}function G(e,t,n,r){let i=n.createTracker(r),l=i.move("[^"),o=n.enter("footnoteReference"),s=n.enter("reference");return l+=i.move(n.safe(n.associationId(e),{after:"]",before:l})),s(),o(),l+=i.move("]")}function V(e,t,n){return 0===t?e:J(e,t,n)}function J(e,t,n){return(n?"":" ")+e}G.peek=function(){return"["};let X=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function Z(e){this.enter({type:"delete",children:[]},e)}function Q(e){this.exit(e)}function ee(e,t,n,r){let i=n.createTracker(r),l=n.enter("strikethrough"),o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),l(),o}function et(e){return e.length}function en(e){let t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:114*(82===t||114===t)}ee.peek=function(){return"~"};var er=e.i(682523);e.i(784801);e.i(900065);function ei(e,t,n){let r=e.value||"",i="`",l=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+l);let o=l.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(o=4*Math.ceil(o/4));let s=n.createTracker(r);s.move(l+" ".repeat(o-l.length)),s.shift(o);let a=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),function(e,t,n){return t?(n?"":" ".repeat(o))+e:(n?l:l+" ".repeat(o-l.length))+e});return a(),c};function eo(e){let t=e._align;(0,S.ok)(t,"expected `_align` on table"),this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function es(e){this.exit(e),this.data.inTable=void 0}function ea(e){this.enter({type:"tableRow",children:[]},e)}function ec(e){this.exit(e)}function ed(e){this.enter({type:"tableCell",children:[]},e)}function eu(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,ef));let n=this.stack[this.stack.length-1];(0,S.ok)("inlineCode"===n.type),n.value=t,this.exit(e)}function ef(e,t){return"|"===t?t:e}function ep(e){let t=this.stack[this.stack.length-2];(0,S.ok)("listItem"===t.type),t.checked="taskListCheckValueChecked"===e.type}function eh(e){let t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){let e=this.stack[this.stack.length-1];(0,S.ok)("paragraph"===e.type);let n=e.children[0];if(n&&"text"===n.type){let r,i=t.children,l=-1;for(;++l0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}eC[43]=ew,eC[45]=ew,eC[46]=ew,eC[95]=ew,eC[72]=[ew,eS],eC[104]=[ew,eS],eC[87]=[ew,ej],eC[119]=[ew,ej];var eR=e.i(653161),eL=e.i(204108);let eD={tokenize:function(e,t,n){let r=this;return(0,eL.factorySpace)(e,function(e){let i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function eI(e,t,n){let r,i=this,l=i.events.length,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);for(;l--;){let e=i.events[l][1];if("labelImage"===e.type){r=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(l){if(!r||!r._balanced)return n(l);let s=(0,$.normalizeIdentifier)(i.sliceSerialize({start:r.end,end:i.now()}));return 94===s.codePointAt(0)&&o.includes(s.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l)):n(l)}}function eF(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function e_(e,t,n){let r,i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),o=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),s};function s(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",a)}function a(s){if(o>999||93===s&&!r||null===s||91===s||(0,w.markdownLineEndingOrSpace)(s))return n(s);if(93===s){e.exit("chunkString");let r=e.exit("gfmFootnoteCallString");return l.includes((0,$.normalizeIdentifier)(i.sliceSerialize(r)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(s)}return(0,w.markdownLineEndingOrSpace)(s)||(r=!0),o++,e.consume(s),92===s?c:a}function c(t){return 91===t||92===t||93===t?(e.consume(t),o++,a):a(t)}}function eW(e,t,n){let r,i,l=this,o=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]),s=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),a};function a(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(s>999||93===t&&!i||null===t||91===t||(0,w.markdownLineEndingOrSpace)(t))return n(t);if(93===t){e.exit("chunkString");let n=e.exit("gfmFootnoteDefinitionLabelString");return r=(0,$.normalizeIdentifier)(l.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),u}return(0,w.markdownLineEndingOrSpace)(t)||(i=!0),s++,e.consume(t),92===t?d:c}function d(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}function u(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),o.includes(r)||o.push(r),(0,eL.factorySpace)(e,f,"gfmFootnoteDefinitionWhitespace")):n(t)}function f(e){return t(e)}}function e$(e,t,n){return e.check(eR.blankLine,t,e.attempt(eD,t,n))}function eP(e){e.exit("gfmFootnoteDefinition")}var eN=e.i(938402),eB=e.i(810291);class eH{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let i=0;if(0!==n||0!==r.length){for(;i0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}}function eU(e,t,n){let r,i=this,l=0,o=0;return function(e){let t=i.events.length-1;for(;t>-1;){let e=i.events[t][1].type;if("lineEnding"===e||"linePrefix"===e)t--;else break}let r=t>-1?i.events[t][1].type:null,l="tableHead"===r||"tableRow"===r?y:s;return l===y&&i.parser.lazy[i.now().line]?n(e):l(e)};function s(t){var n;return e.enter("tableHead"),e.enter("tableRow"),124===(n=t)||(r=!0,o+=1),a(n)}function a(t){return null===t?n(t):(0,w.markdownLineEnding)(t)?o>1?(o=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),u):n(t):(0,w.markdownSpace)(t)?(0,eL.factorySpace)(e,a,"whitespace")(t):(o+=1,r&&(r=!1,l+=1),124===t)?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),r=!0,a):(e.enter("data"),c(t))}function c(t){return null===t||124===t||(0,w.markdownLineEndingOrSpace)(t)?(e.exit("data"),a(t)):(e.consume(t),92===t?d:c)}function d(t){return 92===t||124===t?(e.consume(t),c):c(t)}function u(t){return(i.interrupt=!1,i.parser.lazy[i.now().line])?n(t):(e.enter("tableDelimiterRow"),r=!1,(0,w.markdownSpace)(t))?(0,eL.factorySpace)(e,f,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):f(t)}function f(t){return 45===t||58===t?h(t):124===t?(r=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),p):n(t)}function p(t){return(0,w.markdownSpace)(t)?(0,eL.factorySpace)(e,h,"whitespace")(t):h(t)}function h(t){return 58===t?(o+=1,r=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),g):45===t?(o+=1,g(t)):null===t||(0,w.markdownLineEnding)(t)?m(t):n(t)}function g(t){return 45===t?(e.enter("tableDelimiterFiller"),function t(n){return 45===n?(e.consume(n),t):58===n?(r=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(n),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(n))}(t)):n(t)}function x(t){return(0,w.markdownSpace)(t)?(0,eL.factorySpace)(e,m,"whitespace")(t):m(t)}function m(i){if(124===i)return f(i);if(null===i||(0,w.markdownLineEnding)(i))return r&&l===o?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(i)):n(i);return n(i)}function y(t){return e.enter("tableRow"),b(t)}function b(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),b):null===n||(0,w.markdownLineEnding)(n)?(e.exit("tableRow"),t(n)):(0,w.markdownSpace)(n)?(0,eL.factorySpace)(e,b,"whitespace")(n):(e.enter("data"),v(n))}function v(t){return null===t||124===t||(0,w.markdownLineEndingOrSpace)(t)?(e.exit("data"),b(t)):(e.consume(t),92===t?k:v)}function k(t){return 92===t||124===t?(e.consume(t),v):v(t)}}function eY(e,t){let n,r,i,l=-1,o=!0,s=0,a=[0,0,0,0],c=[0,0,0,0],d=!1,u=0,f=new eH;for(;++ln[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",o,t]])}return void 0!==i&&(l.end=Object.assign({},eG(t.events,i)),e.add(i,0,[["exit",l,t]]),l=void 0),l}function eK(e,t,n,r,i){let l=[],o=eG(t.events,n);i&&(i.end=Object.assign({},o),l.push(["exit",i,t])),r.end=Object.assign({},o),l.push(["exit",r,t]),e.add(n+1,0,l)}function eG(e,t){let n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}let eV={name:"tasklistCheck",tokenize:function(e,t,n){let r=this;return function(t){return null===r.previous&&r._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),i):n(t)};function i(t){return(0,w.markdownLineEndingOrSpace)(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),l):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),l):n(t)}function l(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(t)}function o(r){return(0,w.markdownLineEnding)(r)?t(r):(0,w.markdownSpace)(r)?e.check({tokenize:eJ},t,n)(r):n(r)}}};function eJ(e,t,n){return(0,eL.factorySpace)(e,function(e){return null===e?n(e):t(e)},"whitespace")}let eX={};function eZ(e){var t;let n,r,i,l=e||eX,o=this.data(),s=o.micromarkExtensions||(o.micromarkExtensions=[]),a=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),c=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);s.push((t=l,(0,ex.combineExtensions)([{text:eC},{document:{91:{name:"gfmFootnoteDefinition",tokenize:eW,continuation:{tokenize:e$},exit:eP}},text:{91:{name:"gfmFootnoteCall",tokenize:e_},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:eI,resolveTo:eF}}},(n=(t||{}).singleTilde,r={name:"strikethrough",tokenize:function(e,t,r){let i=this.previous,l=this.events,o=0;return function(s){return 126===i&&"characterEscape"!==l[l.length-1][1].type?r(s):(e.enter("strikethroughSequenceTemporary"),function l(s){let a=(0,er.classifyCharacter)(i);if(126===s)return o>1?r(s):(e.consume(s),o++,l);if(o<2&&!n)return r(s);let c=e.exit("strikethroughSequenceTemporary"),d=(0,er.classifyCharacter)(s);return c._open=!d||2===d&&!!a,c._close=!a||2===a&&!!d,t(s)}(s))}},resolveAll:function(e,t){let n=-1;for(;++n0&&(l.shift(4),o+=l.move((i?"\n":" ")+n.indentLines(n.containerFlow(e,l.current()),i?J:V))),s(),o},footnoteReference:G},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:X}],handlers:{delete:ee}},function(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=ei(e,t,n);return n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&")),r},table:function(e,t,n,r){return s(function(e,t,n){let r=e.children,i=-1,l=[],o=t.enter("table");for(;++ic&&(c=e[d].length);++la[l])&&(a[l]=e)}t.push(o)}o[d]=t,s[d]=r}let f=-1;if("object"==typeof r&&"length"in r)for(;++fa[f]&&(a[f]=i),h[f]=i),p[f]=o}o.splice(1,0,p),s.splice(1,0,h),d=-1;let g=[];for(;++dt.updatedAt-e.updatedAt).slice(0,100)}var e2=e.i(464571),e4=e.i(311451),e6=e.i(212931),e5=e.i(883552),e8=e.i(343794),e3=e.i(430073),e7=e.i(611935),e9=e.i(908206),te=e.i(242064),tt=e.i(321883),tn=e.i(517455),tr=e.i(150073);let ti=n.createContext({});e.i(296059);var tl=e.i(915654),to=e.i(183293),ts=e.i(246422),ta=e.i(838378);let tc=(0,ts.genStyleHooks)("Avatar",e=>{let{colorTextLightSolid:t,colorTextPlaceholder:n}=e,r=(0,ta.mergeToken)(e,{avatarBg:n,avatarColor:t});return[(e=>{let{antCls:t,componentCls:n,iconCls:r,avatarBg:i,avatarColor:l,containerSize:o,containerSizeLG:s,containerSizeSM:a,textFontSize:c,textFontSizeLG:d,textFontSizeSM:u,iconFontSize:f,iconFontSizeLG:p,iconFontSizeSM:h,borderRadius:g,borderRadiusLG:x,borderRadiusSM:m,lineWidth:y,lineType:b}=e,v=(e,t,i,l)=>({width:e,height:e,borderRadius:"50%",fontSize:t,[`&${n}-square`]:{borderRadius:l},[`&${n}-icon`]:{fontSize:i,[`> ${r}`]:{margin:0}}});return{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,to.resetComponent)(e)),{position:"relative",display:"inline-flex",justifyContent:"center",alignItems:"center",overflow:"hidden",color:l,whiteSpace:"nowrap",textAlign:"center",verticalAlign:"middle",background:i,border:`${(0,tl.unit)(y)} ${b} transparent`,"&-image":{background:"transparent"},[`${t}-image-img`]:{display:"block"}}),v(o,c,f,g)),{"&-lg":Object.assign({},v(s,d,p,x)),"&-sm":Object.assign({},v(a,u,h,m)),"> img":{display:"block",width:"100%",height:"100%",objectFit:"cover"}})}})(r),(e=>{let{componentCls:t,groupBorderColor:n,groupOverlapping:r,groupSpace:i}=e;return{[`${t}-group`]:{display:"inline-flex",[t]:{borderColor:n},"> *:not(:first-child)":{marginInlineStart:r}},[`${t}-group-popover`]:{[`${t} + ${t}`]:{marginInlineStart:i}}}})(r)]},e=>{let{controlHeight:t,controlHeightLG:n,controlHeightSM:r,fontSize:i,fontSizeLG:l,fontSizeXL:o,fontSizeHeading3:s,marginXS:a,marginXXS:c,colorBorderBg:d}=e;return{containerSize:t,containerSizeLG:n,containerSizeSM:r,textFontSize:i,textFontSizeLG:i,textFontSizeSM:i,iconFontSize:Math.round((l+o)/2),iconFontSizeLG:s,iconFontSizeSM:i,groupSpace:c,groupOverlapping:-a,groupBorderColor:d}});var td=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let tu=n.forwardRef((e,t)=>{let r,{prefixCls:i,shape:l,size:o,src:s,srcSet:a,icon:c,className:d,rootClassName:u,style:f,alt:p,draggable:h,children:g,crossOrigin:x,gap:m=4,onError:y}=e,b=td(e,["prefixCls","shape","size","src","srcSet","icon","className","rootClassName","style","alt","draggable","children","crossOrigin","gap","onError"]),[v,k]=n.useState(1),[j,S]=n.useState(!1),[w,C]=n.useState(!0),z=n.useRef(null),E=n.useRef(null),T=(0,e7.composeRef)(t,z),{getPrefixCls:O,avatar:A}=n.useContext(te.ConfigContext),M=n.useContext(ti),R=()=>{if(!E.current||!z.current)return;let e=E.current.offsetWidth,t=z.current.offsetWidth;0!==e&&0!==t&&2*m{S(!0)},[]),n.useEffect(()=>{C(!0),k(1)},[s]),n.useEffect(R,[m]);let L=(0,tn.default)(e=>{var t,n;return null!=(n=null!=(t=null!=o?o:null==M?void 0:M.size)?t:e)?n:"default"}),D=Object.keys("object"==typeof L&&L||{}).some(e=>["xs","sm","md","lg","xl","xxl"].includes(e)),I=(0,tr.default)(D),F=n.useMemo(()=>{if("object"!=typeof L)return{};let e=L[e9.responsiveArray.find(e=>I[e])];return e?{width:e,height:e,fontSize:e&&(c||g)?e/2:18}:{}},[I,L,c,g]),_=O("avatar",i),W=(0,tt.default)(_),[$,P,N]=tc(_,W),B=(0,e8.default)({[`${_}-lg`]:"large"===L,[`${_}-sm`]:"small"===L}),H=n.isValidElement(s),U=l||(null==M?void 0:M.shape)||"circle",Y=(0,e8.default)(_,B,null==A?void 0:A.className,`${_}-${U}`,{[`${_}-image`]:H||s&&w,[`${_}-icon`]:!!c},N,W,d,u,P),q="number"==typeof L?{width:L,height:L,fontSize:c?L/2:18}:{};if("string"==typeof s&&w)r=n.createElement("img",{src:s,draggable:h,srcSet:a,onError:()=>{!1!==(null==y?void 0:y())&&C(!1)},alt:p,crossOrigin:x});else if(H)r=s;else if(c)r=c;else if(j||1!==v){let e=`scale(${v})`;r=n.createElement(e3.default,{onResize:R},n.createElement("span",{className:`${_}-string`,ref:E,style:{msTransform:e,WebkitTransform:e,transform:e}},g))}else r=n.createElement("span",{className:`${_}-string`,style:{opacity:0},ref:E},g);return $(n.createElement("span",Object.assign({},b,{style:Object.assign(Object.assign(Object.assign(Object.assign({},q),F),null==A?void 0:A.style),f),className:Y,ref:T}),r))});var tf=e.i(876556),tp=e.i(763731),th=e.i(829672);let tg=e=>{let{size:t,shape:r}=n.useContext(ti),i=n.useMemo(()=>({size:e.size||t,shape:e.shape||r}),[e.size,e.shape,t,r]);return n.createElement(ti.Provider,{value:i},e.children)};tu.Group=e=>{var t,r,i,l;let{getPrefixCls:o,direction:s}=n.useContext(te.ConfigContext),{prefixCls:a,className:c,rootClassName:d,style:u,maxCount:f,maxStyle:p,size:h,shape:g,maxPopoverPlacement:x,maxPopoverTrigger:m,children:y,max:b}=e,v=o("avatar",a),k=`${v}-group`,j=(0,tt.default)(v),[S,w,C]=tc(v,j),z=(0,e8.default)(k,{[`${k}-rtl`]:"rtl"===s},C,j,c,d,w),E=(0,tf.default)(y).map((e,t)=>(0,tp.cloneElement)(e,{key:`avatar-key-${t}`})),T=(null==b?void 0:b.count)||f,O=E.length;if(T&&T{let t=(0,tb.default)(),n=(0,tb.default)(e);return n.isSame(t,"day")?"Today":n.isSame(t.subtract(1,"day"),"day")?"Yesterday":n.isAfter(t.subtract(7,"day"))?"Last 7 Days":"Older"},tj=["Today","Yesterday","Last 7 Days","Older"],tS=({conv:e,isActive:r,onSelect:i,onDelete:o,onRename:s})=>{let[a,c]=(0,n.useState)(!1),[d,f]=(0,n.useState)(e.title),p=(0,n.useRef)(null);(0,n.useEffect)(()=>{a&&p.current&&(p.current.focus(),p.current.select())},[a]);let h=()=>{let t=d.trim();t&&t!==e.title&&s(e.id,t),c(!1)},g=e.title.length>40?e.title.slice(0,40)+"…":e.title;return(0,t.jsx)("div",{onClick:()=>!a&&i(e.id),className:"conversation-row group",style:{display:"flex",alignItems:"center",padding:"6px 8px",borderRadius:6,cursor:a?"default":"pointer",backgroundColor:r?"#e6f4ff":"transparent",transition:"background-color 0.15s",minHeight:34,position:"relative"},onMouseEnter:e=>{r||(e.currentTarget.style.backgroundColor="#f5f5f5")},onMouseLeave:e=>{r||(e.currentTarget.style.backgroundColor="transparent")},children:a?(0,t.jsx)(e4.Input,{ref:e=>{p.current=e?.input??null},size:"small",value:d,onChange:e=>f(e.target.value),onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),h()):"Escape"===t.key&&(t.preventDefault(),f(e.title),c(!1))},onBlur:h,onClick:e=>e.stopPropagation(),style:{flex:1,fontSize:13}}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tv,{style:{flex:1,fontSize:13,color:r?"#1677ff":"#333",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:r?500:400},title:e.title,children:g}),(0,t.jsxs)("div",{className:"conversation-actions",style:{display:"flex",gap:2,opacity:0,transition:"opacity 0.15s",flexShrink:0},onClick:e=>e.stopPropagation(),children:[(0,t.jsx)(l.Tooltip,{title:"Rename",children:(0,t.jsx)(e2.Button,{type:"text",size:"small",icon:(0,t.jsx)(u.EditOutlined,{style:{fontSize:12}}),onClick:t=>{t.stopPropagation(),f(e.title),c(!0)},style:{width:22,height:22,padding:0,minWidth:22}})}),(0,t.jsx)(e5.Popconfirm,{title:"Delete this conversation?",onConfirm:()=>o(e.id),okText:"Delete",cancelText:"Cancel",okButtonProps:{danger:!0},children:(0,t.jsx)(l.Tooltip,{title:"Delete",children:(0,t.jsx)(e2.Button,{type:"text",size:"small",danger:!0,icon:(0,t.jsx)(tm.DeleteOutlined,{style:{fontSize:12}}),style:{width:22,height:22,padding:0,minWidth:22}})})})]})]})})},tw=({open:e,conversations:r,onSelect:i,onClose:l})=>{let[o,s]=(0,n.useState)("");(0,n.useEffect)(()=>{e||s("")},[e]);let a=o.trim()?r.filter(e=>e.title.toLowerCase().includes(o.trim().toLowerCase())):r;return(0,t.jsxs)(e6.Modal,{open:e,onCancel:l,footer:null,title:null,width:480,styles:{body:{padding:"16px 16px 8px"}},children:[(0,t.jsx)(e4.Input,{autoFocus:!0,prefix:(0,t.jsx)(h.SearchOutlined,{style:{color:"#bbb"}}),placeholder:"Search conversations…",value:o,onChange:e=>s(e.target.value),style:{marginBottom:12},allowClear:!0}),(0,t.jsx)("div",{style:{maxHeight:320,overflowY:"auto"},children:0===a.length?(0,t.jsx)("div",{style:{textAlign:"center",padding:"24px 0",color:"#999"},children:"No conversations found"}):a.map(e=>{let n=e.title.length>55?e.title.slice(0,55)+"…":e.title;return(0,t.jsxs)("div",{onClick:()=>{i(e.id),l()},style:{display:"flex",alignItems:"center",gap:8,padding:"8px 10px",borderRadius:6,cursor:"pointer",transition:"background-color 0.1s"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#f0f5ff"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"},children:[(0,t.jsx)(g.MessageOutlined,{style:{color:"#999",flexShrink:0}}),(0,t.jsx)(tv,{style:{fontSize:13},children:n}),(0,t.jsx)(tv,{type:"secondary",style:{fontSize:11,marginLeft:"auto",flexShrink:0},children:(0,tb.default)(e.updatedAt).format("MMM D")})]},e.id)})})]})},tC=({conversations:e,activeConversationId:r,onSelect:i,onDelete:o,onNewChat:s,onRename:a})=>{let[c,u]=(0,n.useState)(!1),f=(0,n.useCallback)(e=>{"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),u(e=>!e))},[]);(0,n.useEffect)(()=>(document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)),[f]);let p=(e=>{let t=new Map;for(let n of e){let e=tk(n.updatedAt);t.has(e)||t.set(e,[]),t.get(e).push(n)}return tj.filter(e=>t.has(e)).map(e=>({group:e,items:t.get(e)}))})(e);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{children:` .conversation-row:hover .conversation-actions { opacity: 1 !important; } - `}),(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%",width:"100%",overflow:"hidden"},children:[(0,t.jsx)("div",{style:{padding:"12px 10px 8px"},children:(0,t.jsx)(l.Tooltip,{title:"Chats are saved locally in this browser. All requests are logged in Spend → Logs.",placement:"right",children:(0,t.jsx)(e2.Button,{type:"primary",icon:(0,t.jsx)(d.PlusOutlined,{}),onClick:s,style:{width:"100%"},children:"New Chat"})})}),(0,t.jsx)("div",{style:{flex:1,overflowY:"auto",padding:"0 6px"},children:0===p.length?(0,t.jsxs)("div",{style:{textAlign:"center",color:"#bbb",fontSize:12,marginTop:32,padding:"0 12px"},children:["No conversations yet.",(0,t.jsx)("br",{}),"Start a new chat above."]}):p.map(({group:e,items:n})=>(0,t.jsxs)("div",{style:{marginBottom:8},children:[(0,t.jsx)("div",{style:{fontSize:11,fontWeight:600,color:"#999",textTransform:"uppercase",letterSpacing:"0.04em",padding:"8px 8px 4px"},children:e}),n.map(e=>(0,t.jsx)(tS,{conv:e,isActive:e.id===r,onSelect:i,onDelete:o,onRename:a},e.id))]},e))}),(0,t.jsxs)("div",{style:{padding:"10px 12px",borderTop:"1px solid #f0f0f0",display:"flex",alignItems:"center",gap:8},children:[(0,t.jsx)(tu,{size:28,icon:(0,t.jsx)(ty.UserOutlined,{}),style:{backgroundColor:"#e0e7ff",color:"#4f46e5",flexShrink:0}}),(0,t.jsx)(tv,{style:{fontSize:13,color:"#555",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:"My Account"})]})]}),(0,t.jsx)(tw,{open:c,conversations:e,onSelect:i,onClose:()=>u(!1)})]})};var tz=e.i(366308),tE=e.i(166406),tO=e.i(362024),tT=e.i(650056),tA=e.i(219470),tM=e.i(966988),tR=e.i(355343);let{Panel:tL}=tO.Collapse,tI=/token|key|secret|password|auth/i;function tD(e){let t=new Date(e),n=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0");return`${n}:${r}`}function t_({node:e,className:n,children:r,...i}){let l=/language-(\w+)/.exec(n||"");return l?(0,t.jsx)(tT.Prism,{style:tA.coy,language:l[1],PreTag:"div",className:"rounded-md my-2",...i,children:String(r).replace(/\n$/,"")}):(0,t.jsx)("code",{className:`${n??""} px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono`,...i,children:r})}function tF({message:e,onEdit:r,isStreaming:i}){let[o,s]=(0,n.useState)(!1),[a,c]=(0,n.useState)(!1),[d,f]=(0,n.useState)(e.content),p=(0,n.useRef)(null);(0,n.useEffect)(()=>{a&&p.current&&(p.current.focus(),p.current.selectionStart=p.current.value.length)},[a]),(0,n.useEffect)(()=>{let e=p.current;e&&(e.style.height="auto",e.style.height=`${e.scrollHeight}px`)},[d,a]);let h=()=>{let t=d.trim();t&&t!==e.content&&r&&r(e.id,t),c(!1)};return a?(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:(0,t.jsxs)("div",{style:{width:"72%",background:"#fff",border:"1.5px solid #1677ff",borderRadius:12,overflow:"hidden",boxShadow:"0 0 0 3px rgba(22,119,255,0.1)"},children:[(0,t.jsx)("textarea",{ref:p,value:d,onChange:e=>f(e.target.value),onKeyDown:t=>{"Enter"!==t.key||t.shiftKey||(t.preventDefault(),h()),"Escape"===t.key&&(f(e.content),c(!1))},style:{width:"100%",padding:"10px 14px",border:"none",outline:"none",resize:"none",fontSize:14,lineHeight:"1.6",color:"#111827",fontFamily:"inherit",background:"transparent",boxSizing:"border-box",minHeight:40}}),(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8,padding:"6px 10px 8px",borderTop:"1px solid #f0f0f0"},children:[(0,t.jsx)("button",{onClick:()=>{f(e.content),c(!1)},style:{padding:"4px 12px",borderRadius:6,border:"1px solid #d1d5db",background:"#fff",color:"#374151",fontSize:13,cursor:"pointer"},children:"Cancel"}),(0,t.jsx)("button",{onClick:h,disabled:!d.trim(),style:{padding:"4px 12px",borderRadius:6,border:"none",background:d.trim()?"#1677ff":"#f3f4f6",color:d.trim()?"#fff":"#9ca3af",fontSize:13,fontWeight:500,cursor:d.trim()?"pointer":"not-allowed"},children:"Save & Send"})]})]})}):(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end",width:"100%"},onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"flex-end",gap:6,maxWidth:"72%"},children:[o&&!i&&r&&(0,t.jsx)(l.Tooltip,{title:"Edit message",children:(0,t.jsx)("button",{onClick:()=>{f(e.content),c(!0)},style:{background:"none",border:"none",cursor:"pointer",padding:"4px 6px",borderRadius:5,color:"#9ca3af",fontSize:13,flexShrink:0,display:"flex",alignItems:"center",transition:"color 0.15s"},onMouseEnter:e=>{e.currentTarget.style.color="#6b7280"},onMouseLeave:e=>{e.currentTarget.style.color="#9ca3af"},children:(0,t.jsx)(u.EditOutlined,{})})}),(0,t.jsx)("div",{style:{backgroundColor:"#f0f2f5",borderRadius:16,padding:"10px 14px",fontSize:14,lineHeight:"1.6",whiteSpace:"pre-wrap",wordBreak:"break-word",color:"#111827"},children:e.content})]}),(0,t.jsx)("span",{style:{fontSize:11,color:"#9ca3af",marginTop:4},children:tD(e.timestamp)})]})}function tW({message:e,isLastMessage:r,isStreaming:i,isTypingIndicator:l,mcpEvents:o}){let s=(0,n.useRef)(0),a=(0,n.useRef)(i);(0,n.useEffect)(()=>{a.current&&!i&&(s.current+=1),a.current=i},[i]);let c=r&&i&&!e.reasoningContent,d=!!e.reasoningContent||c;if(l)return(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"10px 4px"},children:(0,t.jsx)(t$,{})})});let u=e.content,f=!1;return u.endsWith("[stopped]")&&(u=u.slice(0,-9),f=!0),(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",maxWidth:"80%"},children:[d&&(c?(0,t.jsx)(tN,{}):(0,t.jsx)(tM.default,{reasoningContent:e.reasoningContent},s.current)),(0,t.jsxs)("div",{style:{fontSize:14,lineHeight:"1.7",color:"#111827",wordBreak:"break-word"},children:[(0,t.jsx)(k.default,{remarkPlugins:[eZ],components:{code:t_},children:u}),f&&(0,t.jsx)("span",{style:{color:"#9ca3af",fontStyle:"italic"},children:" [stopped]"})]}),(0,t.jsx)(tP,{text:u}),o&&o.length>0&&(0,t.jsx)("div",{style:{marginTop:8,maxWidth:"100%"},children:(0,t.jsx)(tR.default,{events:o})})]})}function tP({text:e}){let[r,i]=(0,n.useState)(!1);return(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",gap:4,marginTop:6},children:(0,t.jsx)(l.Tooltip,{title:r?"Copied!":"Copy",children:(0,t.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(e).then(()=>{i(!0),setTimeout(()=>i(!1),2e3)}).catch(()=>{})},style:{background:"none",border:"none",cursor:"pointer",padding:"4px 6px",borderRadius:5,color:r?"#52c41a":"#9ca3af",fontSize:13,display:"flex",alignItems:"center",gap:4,transition:"color 0.15s"},onMouseEnter:e=>{r||(e.currentTarget.style.color="#6b7280")},onMouseLeave:e=>{r||(e.currentTarget.style.color="#9ca3af")},children:r?(0,t.jsx)(v.CheckOutlined,{}):(0,t.jsx)(tE.CopyOutlined,{})})})})}function tN(){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{children:` + `}),(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%",width:"100%",overflow:"hidden"},children:[(0,t.jsx)("div",{style:{padding:"12px 10px 8px"},children:(0,t.jsx)(l.Tooltip,{title:"Chats are saved locally in this browser. All requests are logged in Spend → Logs.",placement:"right",children:(0,t.jsx)(e2.Button,{type:"primary",icon:(0,t.jsx)(d.PlusOutlined,{}),onClick:s,style:{width:"100%"},children:"New Chat"})})}),(0,t.jsx)("div",{style:{flex:1,overflowY:"auto",padding:"0 6px"},children:0===p.length?(0,t.jsxs)("div",{style:{textAlign:"center",color:"#bbb",fontSize:12,marginTop:32,padding:"0 12px"},children:["No conversations yet.",(0,t.jsx)("br",{}),"Start a new chat above."]}):p.map(({group:e,items:n})=>(0,t.jsxs)("div",{style:{marginBottom:8},children:[(0,t.jsx)("div",{style:{fontSize:11,fontWeight:600,color:"#999",textTransform:"uppercase",letterSpacing:"0.04em",padding:"8px 8px 4px"},children:e}),n.map(e=>(0,t.jsx)(tS,{conv:e,isActive:e.id===r,onSelect:i,onDelete:o,onRename:a},e.id))]},e))}),(0,t.jsxs)("div",{style:{padding:"10px 12px",borderTop:"1px solid #f0f0f0",display:"flex",alignItems:"center",gap:8},children:[(0,t.jsx)(tu,{size:28,icon:(0,t.jsx)(ty.UserOutlined,{}),style:{backgroundColor:"#e0e7ff",color:"#4f46e5",flexShrink:0}}),(0,t.jsx)(tv,{style:{fontSize:13,color:"#555",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:"My Account"})]})]}),(0,t.jsx)(tw,{open:c,conversations:e,onSelect:i,onClose:()=>u(!1)})]})};var tz=e.i(366308),tE=e.i(166406),tT=e.i(362024),tO=e.i(650056),tA=e.i(219470),tM=e.i(966988),tR=e.i(355343);let{Panel:tL}=tT.Collapse,tD=/token|key|secret|password|auth/i;function tI(e){let t=new Date(e),n=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0");return`${n}:${r}`}function tF({node:e,className:n,children:r,...i}){let l=/language-(\w+)/.exec(n||"");return l?(0,t.jsx)(tO.Prism,{style:tA.coy,language:l[1],PreTag:"div",className:"rounded-md my-2",...i,children:String(r).replace(/\n$/,"")}):(0,t.jsx)("code",{className:`${n??""} px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono`,...i,children:r})}function t_({message:e,onEdit:r,isStreaming:i}){let[o,s]=(0,n.useState)(!1),[a,c]=(0,n.useState)(!1),[d,f]=(0,n.useState)(e.content),p=(0,n.useRef)(null);(0,n.useEffect)(()=>{a&&p.current&&(p.current.focus(),p.current.selectionStart=p.current.value.length)},[a]),(0,n.useEffect)(()=>{let e=p.current;e&&(e.style.height="auto",e.style.height=`${e.scrollHeight}px`)},[d,a]);let h=()=>{let t=d.trim();t&&t!==e.content&&r&&r(e.id,t),c(!1)};return a?(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:(0,t.jsxs)("div",{style:{width:"72%",background:"#fff",border:"1.5px solid #1677ff",borderRadius:12,overflow:"hidden",boxShadow:"0 0 0 3px rgba(22,119,255,0.1)"},children:[(0,t.jsx)("textarea",{ref:p,value:d,onChange:e=>f(e.target.value),onKeyDown:t=>{"Enter"!==t.key||t.shiftKey||(t.preventDefault(),h()),"Escape"===t.key&&(f(e.content),c(!1))},style:{width:"100%",padding:"10px 14px",border:"none",outline:"none",resize:"none",fontSize:14,lineHeight:"1.6",color:"#111827",fontFamily:"inherit",background:"transparent",boxSizing:"border-box",minHeight:40}}),(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8,padding:"6px 10px 8px",borderTop:"1px solid #f0f0f0"},children:[(0,t.jsx)("button",{onClick:()=>{f(e.content),c(!1)},style:{padding:"4px 12px",borderRadius:6,border:"1px solid #d1d5db",background:"#fff",color:"#374151",fontSize:13,cursor:"pointer"},children:"Cancel"}),(0,t.jsx)("button",{onClick:h,disabled:!d.trim(),style:{padding:"4px 12px",borderRadius:6,border:"none",background:d.trim()?"#1677ff":"#f3f4f6",color:d.trim()?"#fff":"#9ca3af",fontSize:13,fontWeight:500,cursor:d.trim()?"pointer":"not-allowed"},children:"Save & Send"})]})]})}):(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end",width:"100%"},onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"flex-end",gap:6,maxWidth:"72%"},children:[o&&!i&&r&&(0,t.jsx)(l.Tooltip,{title:"Edit message",children:(0,t.jsx)("button",{onClick:()=>{f(e.content),c(!0)},style:{background:"none",border:"none",cursor:"pointer",padding:"4px 6px",borderRadius:5,color:"#9ca3af",fontSize:13,flexShrink:0,display:"flex",alignItems:"center",transition:"color 0.15s"},onMouseEnter:e=>{e.currentTarget.style.color="#6b7280"},onMouseLeave:e=>{e.currentTarget.style.color="#9ca3af"},children:(0,t.jsx)(u.EditOutlined,{})})}),(0,t.jsx)("div",{style:{backgroundColor:"#f0f2f5",borderRadius:16,padding:"10px 14px",fontSize:14,lineHeight:"1.6",whiteSpace:"pre-wrap",wordBreak:"break-word",color:"#111827"},children:e.content})]}),(0,t.jsx)("span",{style:{fontSize:11,color:"#9ca3af",marginTop:4},children:tI(e.timestamp)})]})}function tW({message:e,isLastMessage:r,isStreaming:i,isTypingIndicator:l,mcpEvents:o}){let s=(0,n.useRef)(0),a=(0,n.useRef)(i);(0,n.useEffect)(()=>{a.current&&!i&&(s.current+=1),a.current=i},[i]);let c=r&&i&&!e.reasoningContent,d=!!e.reasoningContent||c;if(l)return(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"10px 4px"},children:(0,t.jsx)(tN,{})})});let u=e.content,f=!1;return u.endsWith("[stopped]")&&(u=u.slice(0,-9),f=!0),(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",maxWidth:"80%"},children:[d&&(c?(0,t.jsx)(tP,{}):(0,t.jsx)(tM.default,{reasoningContent:e.reasoningContent},s.current)),(0,t.jsxs)("div",{style:{fontSize:14,lineHeight:"1.7",color:"#111827",wordBreak:"break-word"},children:[(0,t.jsx)(k.default,{remarkPlugins:[eZ],components:{code:tF},children:u}),f&&(0,t.jsx)("span",{style:{color:"#9ca3af",fontStyle:"italic"},children:" [stopped]"})]}),(0,t.jsx)(t$,{text:u}),o&&o.length>0&&(0,t.jsx)("div",{style:{marginTop:8,maxWidth:"100%"},children:(0,t.jsx)(tR.default,{events:o})})]})}function t$({text:e}){let[r,i]=(0,n.useState)(!1);return(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",gap:4,marginTop:6},children:(0,t.jsx)(l.Tooltip,{title:r?"Copied!":"Copy",children:(0,t.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(e).then(()=>{i(!0),setTimeout(()=>i(!1),2e3)}).catch(()=>{})},style:{background:"none",border:"none",cursor:"pointer",padding:"4px 6px",borderRadius:5,color:r?"#52c41a":"#9ca3af",fontSize:13,display:"flex",alignItems:"center",gap:4,transition:"color 0.15s"},onMouseEnter:e=>{r||(e.currentTarget.style.color="#6b7280")},onMouseLeave:e=>{r||(e.currentTarget.style.color="#9ca3af")},children:r?(0,t.jsx)(v.CheckOutlined,{}):(0,t.jsx)(tE.CopyOutlined,{})})})})}function tP(){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{children:` @keyframes thinking-pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } @@ -10,7 +10,7 @@ .chat-thinking-text { animation: thinking-pulse 1.4s ease-in-out infinite; } - `}),(0,t.jsx)("div",{style:{display:"inline-flex",alignItems:"center",gap:6,padding:"4px 10px",marginBottom:8,backgroundColor:"#f9fafb",border:"1px solid #e5e7eb",borderRadius:8,fontSize:12,color:"#6b7280"},children:(0,t.jsx)("span",{className:"chat-thinking-text",children:"Thinking..."})})]})}function t$(){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{children:` + `}),(0,t.jsx)("div",{style:{display:"inline-flex",alignItems:"center",gap:6,padding:"4px 10px",marginBottom:8,backgroundColor:"#f9fafb",border:"1px solid #e5e7eb",borderRadius:8,fontSize:12,color:"#6b7280"},children:(0,t.jsx)("span",{className:"chat-thinking-text",children:"Thinking..."})})]})}function tN(){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{children:` @keyframes chat-typing-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-4px); opacity: 1; } @@ -24,6 +24,6 @@ } .chat-dot:nth-child(2) { animation-delay: 0.2s; } .chat-dot:nth-child(3) { animation-delay: 0.4s; } - `}),(0,t.jsx)("div",{className:"chat-dot"}),(0,t.jsx)("div",{className:"chat-dot"}),(0,t.jsx)("div",{className:"chat-dot"})]})}function tB({message:e}){let n=e.toolArgs?function e(t){let n={};for(let[r,i]of Object.entries(t))tI.test(r)?n[r]="[redacted]":Array.isArray(i)?n[r]=i.map(t=>null===t||"object"!=typeof t||Array.isArray(t)?t:e(t)):null!==i&&"object"==typeof i?n[r]=e(i):n[r]=i;return n}(e.toolArgs):void 0;return(0,t.jsxs)("div",{style:{maxWidth:"80%"},children:[(0,t.jsx)(tO.Collapse,{size:"small",style:{backgroundColor:"#fafafa",border:"1px solid #e5e7eb",borderRadius:8},children:(0,t.jsxs)(tL,{header:(0,t.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:6,fontSize:13},children:[(0,t.jsx)(tz.ToolOutlined,{style:{color:"#6b7280"}}),(0,t.jsx)("span",{style:{color:"#374151",fontWeight:500},children:e.toolName??"Tool call"})]}),children:[void 0!==n&&(0,t.jsxs)("div",{style:{marginBottom:12*!!e.toolResult},children:[(0,t.jsx)("div",{style:{fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"#9ca3af",marginBottom:4},children:"Arguments"}),(0,t.jsx)("pre",{style:{margin:0,padding:"8px 10px",backgroundColor:"#f3f4f6",borderRadius:6,fontSize:12,fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace',whiteSpace:"pre-wrap",wordBreak:"break-word",color:"#374151"},children:JSON.stringify(n,null,2)})]}),e.toolResult&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"#9ca3af",marginBottom:4},children:"Result"}),(0,t.jsx)("div",{style:{fontSize:13,color:"#374151",whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:e.toolResult})]})]},"tool")}),(0,t.jsx)("div",{style:{fontSize:11,color:"#9ca3af",marginTop:4},children:tD(e.timestamp)})]})}let tH=({messages:e,isStreaming:n,onEditMessage:r})=>{let i=e.length-1,l=e[i]??null,o=n&&null!==l&&"assistant"===l.role&&""===l.content;return(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:16},children:e.map((e,l)=>{let s=l===i;return"user"===e.role?(0,t.jsx)(tF,{message:e,onEdit:r,isStreaming:n},e.id):"tool"===e.role?(0,t.jsx)(tB,{message:e},e.id):(0,t.jsx)(tW,{message:e,isLastMessage:s,isStreaming:n,isTypingIndicator:s&&o,mcpEvents:e.mcpEvents},e.id)})})};var tU=e.i(790848),tV=e.i(482725),tY=e.i(602869);let tq=({accessToken:e,selectedServers:r,onChange:i})=>{let[l,o]=(0,n.useState)([]),[s,c]=(0,n.useState)(!0),[d,u]=(0,n.useState)(new Set);(0,n.useEffect)(()=>{let t=!1;return(async()=>{c(!0);try{let n=await (0,tY.fetchMCPServers)(e);if(t)return;let r=Array.isArray(n)?n:n?.data??[];o(r)}catch{t||o([])}finally{t||c(!1)}})(),()=>{t=!0}},[e]);let f=async(t,n)=>{if(!n)return void i(r.filter(e=>e!==t));u(e=>new Set(e).add(t));try{let n=await (0,tY.listMCPTools)(e,t);if(n?.error)return void a.default.warning(`Could not load tools for ${t} — it will be excluded from this message.`);i([...r,t])}catch{a.default.warning(`Could not load tools for ${t} — it will be excluded from this message.`)}finally{u(e=>{let n=new Set(e);return n.delete(t),n})}};return(0,t.jsx)("div",{style:{maxWidth:320,maxHeight:400,overflowY:"auto",padding:"8px 0"},children:s?(0,t.jsx)("div",{style:{display:"flex",justifyContent:"center",padding:"24px 0"},children:(0,t.jsx)(tV.Spin,{})}):0===l.length?(0,t.jsx)("div",{style:{padding:"16px 12px",color:"#8c8c8c",fontSize:13,textAlign:"center"},children:"No MCP servers configured"}):l.map(e=>{let n=e.server_name??e.alias??e.server_id,i=r.includes(n),l=d.has(n);return(0,t.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:"8px 12px",gap:12},children:[e.mcp_info?.logo_url&&(0,t.jsx)("img",{src:e.mcp_info.logo_url,alt:`${n} logo`,style:{width:24,height:24,borderRadius:6,objectFit:"contain",flexShrink:0,marginTop:1},onError:e=>{e.target.style.display="none"}}),(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("div",{style:{fontWeight:500,fontSize:13,color:"#1f1f1f",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n}),e.description&&(0,t.jsx)("div",{style:{fontSize:12,color:"#8c8c8c",marginTop:2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.description})]}),(0,t.jsx)(tU.Switch,{size:"small",checked:i,loading:l,onChange:e=>f(n,e)})]},e.server_id)})})};var tJ=e.i(240647),tK=e.i(245704),tG=e.i(292335),tX=e.i(727749),tZ=e.i(122520),tQ=e.i(165615),t0=e.i(434166),t1=e.i(779129);let t2="litellm-user-mcp-oauth-flow-state",t4="litellm-user-mcp-oauth-result",t6=(e,t)=>{(0,t0.setSecureItem)(e,t)},t5=e=>(0,t0.getSecureItem)(e),t3=({server:e,accessToken:r,onConnect:i,variant:l="badge"})=>{let o=e.server_name??e.alias??e.server_id,{startOAuthFlow:s,status:a}=(({accessToken:e,serverId:t,serverAlias:r,scopes:i,clientId:l,onSuccess:o})=>{let[s,a]=(0,n.useState)("idle"),[c,d]=(0,n.useState)(null),u=(0,n.useRef)(!1),f=(0,n.useCallback)(async()=>{try{let n;a("authorizing"),d(null);let o=l??void 0;if(!o)try{let i=await (0,tY.registerMcpOAuthClient)(e,t,{client_name:r||t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"});o=i?.client_id,n=i?.client_secret}catch(e){}let s=(0,tQ.generateCodeVerifier)(),c=await (0,tQ.generateCodeChallenge)(s),u=crypto.randomUUID(),f=(0,t1.buildCallbackUrl)(),p=i?.filter(e=>e.trim()).join(" "),h=(0,tY.buildMcpOAuthAuthorizeUrl)({serverId:t,clientId:o,redirectUri:f,state:u,codeChallenge:c,scope:p}),g={state:u,codeVerifier:s,serverId:t,redirectUri:f,clientId:o,clientSecret:n,scopes:i};t6(t2,JSON.stringify(g));let x=new URL(window.location.href);x.searchParams.set("mcpOauthReturn","apps"),t6("litellm-mcp-oauth-return-url",x.toString()),window.location.href=h}catch(t){let e=(0,tZ.extractErrorMessage)(t);d(e),a("error"),tX.default.error(e)}},[e,t,r,i,l]),p=(0,n.useCallback)(async()=>{if(u.current)return;let n=t5(t4);if(!n)return;let r=t5(t2);if(!r)return;try{let e=JSON.parse(r);if(e.serverId&&e.serverId!==t)return}catch(e){}u.current=!0,(0,t1.clearStorage)(t4);let i=null,l=null;try{i=JSON.parse(n);let e=t5(t2);l=e?JSON.parse(e):null}catch(e){d("Failed to resume OAuth flow. Please retry."),a("error"),u.current=!1,(0,t1.clearStorage)(t2);return}try{if(!l?.state||!l.codeVerifier||!l.serverId)throw Error("OAuth session state was lost. Please retry.");if(!i?.state||i.state!==l.state)throw Error("OAuth state mismatch. Please retry.");if(i.error)throw Error(i.error_description||i.error);if(!i.code)throw Error("Authorization code missing in callback.");a("exchanging");let t=await (0,tY.exchangeMcpOAuthToken)({serverId:l.serverId,code:i.code,clientId:l.clientId,clientSecret:l.clientSecret,codeVerifier:l.codeVerifier,redirectUri:l.redirectUri,accessToken:e});await (0,tY.storeMCPOAuthUserCredential)(e,l.serverId,{access_token:t.access_token,refresh_token:t.refresh_token,expires_in:t.expires_in,scopes:l.scopes}),a("success"),d(null),tX.default.success("Connected successfully"),o()}catch(t){let e=(0,tZ.extractErrorMessage)(t);d(e),a("error"),tX.default.error(e)}finally{(0,t1.clearStorage)(t2),setTimeout(()=>{u.current=!1},1e3)}},[e,t,o]);return(0,n.useEffect)(()=>{p()},[p]),{startOAuthFlow:f,status:s,error:c}})({accessToken:r,serverId:e.server_id,serverAlias:o,onSuccess:(0,n.useCallback)(()=>i(e.server_id),[i,e.server_id])}),c="authorizing"===a||"exchanging"===a;return"button"===l?(0,t.jsx)(e2.Button,{type:"primary",loading:c,onClick:s,style:{borderRadius:8,fontWeight:600,height:38,minWidth:110},children:c?"Connecting…":"Connect"}):(0,t.jsx)("span",{onClick:e=>{e.stopPropagation(),c||s()},style:{fontSize:11,fontWeight:600,color:c?"#9ca3af":"#fff",background:c?"#e5e7eb":"#1677ff",borderRadius:6,padding:"2px 8px",cursor:c?"default":"pointer",flexShrink:0,whiteSpace:"nowrap"},children:c?"Connecting…":"Connect"})},t8=["#1677ff","#52c41a","#fa8c16","#eb2f96","#722ed1","#13c2c2","#fa541c","#2f54eb","#a0d911","#faad14"];function t7(e){let t=0;for(let n=0;n{let[l,s]=(0,n.useState)([]),[c,d]=(0,n.useState)(!0),[u,f]=(0,n.useState)(""),[p,g]=(0,n.useState)("all"),[x,m]=(0,n.useState)(new Set),[b,v]=(0,n.useState)(null),[k,j]=(0,n.useState)([]),[S,w]=(0,n.useState)(!1),[C,z]=(0,n.useState)({}),[E,O]=(0,n.useState)(!1),[T,A]=(0,n.useState)(new Set),M=(0,n.useRef)([]);(0,n.useEffect)(()=>{M.current=l},[l]);let R=(0,n.useRef)(r);(0,n.useEffect)(()=>{R.current=r},[r]);let L=(0,n.useRef)(i);(0,n.useEffect)(()=>{L.current=i},[i]);let I=e=>e.server_name??e.alias??e.server_id;(0,n.useEffect)(()=>{let t=!1;return d(!0),(0,tY.fetchMCPServers)(e).then(n=>{if(t)return;let r=Array.isArray(n)?n:n?.data??[];s(r),d(!1),O(!0);let i=r.length;0===i?O(!1):(r.forEach(n=>{(0,tY.listMCPTools)(e,n.server_id).then(e=>{if(t)return;let r=Array.isArray(e?.tools)?e.tools:[],i=I(n);z(e=>({...e,[i]:r.length}))}).catch(()=>{}).finally(()=>{t||0==(i-=1)&&O(!1)})}),r.filter(e=>e.auth_type===tG.AUTH_TYPE.OAUTH2).forEach(n=>{(0,tY.getMCPOAuthUserCredentialStatus)(e,n.server_id).then(e=>{t||e.has_credential&&!e.is_expired&&A(e=>new Set(e).add(n.server_id))}).catch(()=>{})}))}).catch(()=>{t||(s([]),d(!1))}),()=>{t=!0}},[e]),(0,n.useEffect)(()=>{if(0===T.size)return;let e=M.current.filter(e=>T.has(e.server_id)&&!R.current.includes(I(e))).map(I);e.length>0&&L.current([...R.current,...e])},[T]);let D=async(t,n,l)=>{if(!n){i(r.filter(e=>e!==t)),l&&A(e=>{let t=new Set(e);return t.delete(l),t});return}m(e=>new Set(e).add(t));try{let n=l??t,r=await (0,tY.listMCPTools)(e,n);if(r?.error)return void a.default.warning(`Could not load tools for ${t}`);R.current.includes(t)||i([...R.current,t])}catch{a.default.warning(`Could not load tools for ${t}`)}finally{m(e=>{let n=new Set(e);return n.delete(t),n})}};(0,n.useEffect)(()=>{if(!b)return void j([]);let t=!1;return w(!0),(0,tY.listMCPTools)(e,b.server_id).then(e=>{t||j(Array.isArray(e?.tools)?e.tools:[])}).catch(()=>{t||j([])}).finally(()=>{t||w(!1)}),()=>{t=!0}},[b,e]);let _=l.filter(e=>{let t=I(e),n=!u.trim()||t.toLowerCase().includes(u.toLowerCase())||(e.description??"").toLowerCase().includes(u.toLowerCase()),i="all"===p||r.includes(t);return n&&i}),F=l.filter(e=>r.includes(I(e))).length,W=Object.values(C).reduce((e,t)=>e+t,0);if(b){let n=I(b),i=r.includes(n),l=x.has(n),o=t7(n);return(0,t.jsxs)("div",{style:{width:"100%"},children:[(0,t.jsxs)("button",{onClick:()=>v(null),style:{display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",color:"#6b7280",fontSize:13,padding:"0 0 20px 0"},children:[(0,t.jsx)(y.ArrowLeftOutlined,{style:{fontSize:12}}),"Back"]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:20,marginBottom:28},children:[b.mcp_info?.logo_url?(0,t.jsx)("img",{src:b.mcp_info.logo_url,alt:`${n} logo`,style:{width:64,height:64,borderRadius:16,objectFit:"contain",flexShrink:0,background:"#f9fafb"},onError:e=>{let t=e.target;t.style.display="none",t.nextElementSibling&&(t.nextElementSibling.style.display="flex")}}):null,(0,t.jsx)("div",{style:{width:64,height:64,borderRadius:16,background:o,display:b.mcp_info?.logo_url?"none":"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontWeight:700,fontSize:28,flexShrink:0},children:n.charAt(0).toUpperCase()}),(0,t.jsxs)("div",{style:{flex:1},children:[(0,t.jsx)("h2",{style:{margin:"0 0 4px",fontSize:22,fontWeight:700,color:"#111827"},children:n}),(0,t.jsx)("p",{style:{margin:0,fontSize:14,color:"#6b7280"},children:b.description??"MCP server"})]}),b.auth_type===tG.AUTH_TYPE.OAUTH2?T.has(b.server_id)?(0,t.jsx)(e2.Button,{type:"default",danger:!0,onClick:async()=>{try{await (0,tY.deleteMCPOAuthUserCredential)(e,b.server_id)}catch(e){}A(e=>{let t=new Set(e);return t.delete(b.server_id),t}),L.current(R.current.filter(e=>e!==n))},style:{borderRadius:8,fontWeight:600,height:38,minWidth:110},children:"Disconnect"}):(0,t.jsx)(t3,{server:b,accessToken:e,onConnect:e=>{A(t=>new Set(t).add(e))},variant:"button"}):(0,t.jsx)(e2.Button,{type:i?"default":"primary",loading:l,onClick:()=>D(n,!i,b.server_id),style:{borderRadius:8,fontWeight:600,height:38,minWidth:110},children:i?"Disconnect":"Connect"})]}),(0,t.jsx)("h3",{style:{margin:"0 0 12px",fontSize:15,fontWeight:600,color:"#111827"},children:"Information"}),(0,t.jsx)("div",{style:{border:"1px solid #e5e7eb",borderRadius:10,overflow:"hidden",marginBottom:28},children:[["Server ID",b.server_id],["Transport",(0,tG.handleTransport)(b.transport,b.spec_path)],["Status",i?"Connected":"Not connected"]].filter(([,e])=>e).map(([e,n],r,i)=>(0,t.jsxs)("div",{style:{display:"flex",padding:"12px 16px",borderBottom:r(0,t.jsxs)("div",{style:{border:"1px solid #e5e7eb",borderRadius:8,padding:"10px 14px",background:"#fafafa"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4*!!e.description},children:[(0,t.jsx)(tz.ToolOutlined,{style:{fontSize:13,color:"#6b7280"}}),(0,t.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"#111827",fontFamily:"monospace"},children:e.name})]}),e.description&&(0,t.jsx)("p",{style:{margin:0,fontSize:12,color:"#6b7280",paddingLeft:21},children:e.description})]},e.name))})]})}return(0,t.jsxs)("div",{style:{width:"100%"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:20,gap:16,flexWrap:"wrap"},children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[(0,t.jsx)("h2",{style:{margin:0,fontSize:18,fontWeight:600,color:"#111827"},children:"MCP Servers"}),(0,t.jsx)("span",{style:{fontSize:10,fontWeight:600,color:"#1677ff",background:"#e8f4ff",borderRadius:4,padding:"1px 6px",letterSpacing:"0.05em",textTransform:"uppercase"},children:"Beta"})]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,t.jsx)("p",{style:{margin:0,fontSize:13,color:"#6b7280"},children:"Browse tools, authenticate once, use in chat — no setup needed."}),E?(0,t.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:5,fontSize:12,color:"#9ca3af"},children:[(0,t.jsx)(tV.Spin,{size:"small",style:{transform:"scale(0.7)"}}),"Loading tools..."]}):W>0?(0,t.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:4,fontSize:12,color:"#6b7280"},children:[(0,t.jsx)(tz.ToolOutlined,{style:{fontSize:11}}),W," tool",1!==W?"s":""," available"]}):null]})]}),(0,t.jsx)(e4.Input,{prefix:(0,t.jsx)(h.SearchOutlined,{style:{color:"#9ca3af",fontSize:13}}),placeholder:"Search servers...",value:u,onChange:e=>f(e.target.value),allowClear:!0,style:{width:220,borderRadius:8,fontSize:13},size:"middle"})]}),(0,t.jsx)("div",{style:{display:"flex",borderBottom:"1px solid #e5e7eb",marginBottom:16},children:["all","connected"].map(e=>(0,t.jsx)("button",{onClick:()=>g(e),style:{padding:"8px 16px",border:"none",borderBottom:p===e?"2px solid #1677ff":"2px solid transparent",cursor:"pointer",fontSize:13,fontWeight:p===e?600:400,background:"transparent",color:p===e?"#1677ff":"#6b7280",marginBottom:-1},children:"all"===e?"All":`Connected${F>0?` (${F})`:""}`},e))}),c?(0,t.jsx)("div",{style:{display:"flex",justifyContent:"center",padding:"48px 0"},children:(0,t.jsx)(tV.Spin,{})}):0===_.length?(0,t.jsx)("div",{style:{textAlign:"center",color:"#9ca3af",fontSize:13,padding:"48px 12px"},children:0===l.length?"No MCP servers configured. Add servers in Tools → MCP Servers.":"connected"===p?"No servers connected yet.":"No servers match your search."}):(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:0,border:"1px solid #e5e7eb",borderRadius:10,overflow:"hidden"},children:_.map((n,i)=>{let l=I(n),s=r.includes(l),a=t7(l),c=C[l];return(0,t.jsxs)("div",{onClick:()=>v(n),style:{display:"flex",alignItems:"center",gap:12,padding:"14px 16px",background:"#fff",borderRight:i%2==0?"1px solid #f3f4f6":"none",borderBottom:Math.floor(i/2){e.currentTarget.style.background="#fafafa"},onMouseLeave:e=>{e.currentTarget.style.background="#fff"},children:[n.mcp_info?.logo_url?(0,t.jsx)("img",{src:n.mcp_info.logo_url,alt:`${l} logo`,style:{width:38,height:38,borderRadius:10,objectFit:"contain",flexShrink:0,background:"#f9fafb"},onError:e=>{let t=e.target;t.style.display="none",t.nextElementSibling&&(t.nextElementSibling.style.display="flex")}}):null,(0,t.jsx)("div",{style:{width:38,height:38,borderRadius:10,background:a,display:n.mcp_info?.logo_url?"none":"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontWeight:700,fontSize:16,flexShrink:0},children:l.charAt(0).toUpperCase()}),(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("div",{style:{fontSize:14,fontWeight:500,color:"#111827",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l}),(0,t.jsxs)("div",{style:{fontSize:12,color:"#9ca3af",marginTop:1,display:"flex",alignItems:"center",gap:6},children:[(0,t.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.description??"MCP server"}),void 0!==c?c>0?(0,t.jsxs)("span",{style:{flexShrink:0,display:"flex",alignItems:"center",gap:3,color:"#9ca3af"},children:["· ",(0,t.jsx)(tz.ToolOutlined,{style:{fontSize:10}})," ",c]}):null:E?(0,t.jsx)(o.Skeleton.Input,{active:!0,size:"small",style:{width:28,height:12,minWidth:28,flexShrink:0}}):null]})]}),n.auth_type===tG.AUTH_TYPE.OAUTH2?T.has(n.server_id)?(0,t.jsx)(tK.CheckCircleOutlined,{style:{fontSize:14,color:"#52c41a",flexShrink:0}}):(0,t.jsx)(t3,{server:n,accessToken:e,onConnect:e=>{A(t=>new Set(t).add(e))},variant:"badge"}):s?(0,t.jsx)("span",{style:{width:7,height:7,borderRadius:"50%",background:"#1677ff",flexShrink:0}}):null,(0,t.jsx)(tJ.RightOutlined,{style:{fontSize:11,color:"#d1d5db",flexShrink:0}})]},n.server_id)})})]})};var ne=e.i(596239),nt=e.i(389083),nn=e.i(269200),nr=e.i(942232),ni=e.i(977572),nl=e.i(427612),no=e.i(64848),ns=e.i(496020);let na=({accessToken:e})=>{let[r,i]=(0,n.useState)([]),[l,o]=(0,n.useState)(!0),[s,c]=(0,n.useState)(new Set),d=(0,n.useCallback)(()=>{o(!0),(0,tY.listMCPUserCredentials)(e).then(i).catch(()=>i([])).finally(()=>o(!1))},[e]);(0,n.useEffect)(()=>{d()},[d]);let u=async t=>{c(e=>new Set(e).add(t));try{await (0,tY.deleteMCPOAuthUserCredential)(e,t),i(e=>e.filter(e=>e.server_id!==t))}catch{a.default.error("Failed to revoke connection. Please try again.")}finally{c(e=>{let n=new Set(e);return n.delete(t),n})}};return(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)("h2",{className:"text-base font-semibold text-gray-900 mb-0.5",children:"App Credentials"}),(0,t.jsx)("p",{className:"text-sm text-gray-500 m-0",children:"Your stored OAuth connections — used automatically in chat."})]}),l?(0,t.jsx)("div",{className:"flex justify-center py-12",children:(0,t.jsx)(tV.Spin,{})}):0===r.length?(0,t.jsxs)("div",{className:"text-center text-gray-400 text-sm py-12 border border-dashed border-gray-200 rounded-lg",children:[(0,t.jsx)(ne.LinkOutlined,{className:"text-2xl mb-3 block text-gray-300"}),"No connections yet.",(0,t.jsx)("br",{}),"Go to ",(0,t.jsx)("strong",{children:"Apps"})," and click ",(0,t.jsx)("strong",{children:"Connect"})," to authorize an MCP server."]}):(0,t.jsx)("div",{className:"rounded-lg border border-gray-200 overflow-hidden",children:(0,t.jsxs)(nn.Table,{children:[(0,t.jsx)(nl.TableHead,{children:(0,t.jsxs)(ns.TableRow,{children:[(0,t.jsx)(no.TableHeaderCell,{className:"text-xs font-medium text-gray-500 py-2 px-4",children:"App"}),(0,t.jsx)(no.TableHeaderCell,{className:"text-xs font-medium text-gray-500 py-2 px-4",children:"Connected"}),(0,t.jsx)(no.TableHeaderCell,{className:"text-xs font-medium text-gray-500 py-2 px-4",children:"Status"}),(0,t.jsx)(no.TableHeaderCell,{className:"text-xs font-medium text-gray-500 py-2 px-4 text-right",children:"Actions"})]})}),(0,t.jsx)(nr.TableBody,{children:r.map(e=>{let n=e.alias||e.server_name||e.server_id,r=s.has(e.server_id),i=function(e){if(!e)return"Does not expire";try{let t=new Date(e).getTime()-Date.now();if(t<=0)return"Expired";let n=Math.floor(t/1e3),r=Math.floor(n/60),i=Math.floor(r/60),l=Math.floor(i/24);if(l>0)return`Expires in ${l}d`;if(i>0)return`Expires in ${i}h`;return`Expires in ${r}m`}catch{return""}}(e.expires_at),l=function(e){if(!e)return"";try{let t=new Date(e),n=Date.now()-t.getTime(),r=Math.floor(n/1e3);if(r<60)return"just now";let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let l=Math.floor(i/60);if(l<24)return`${l}h ago`;return`${Math.floor(l/24)}d ago`}catch{return""}}(e.connected_at),o="Expired"===i;return(0,t.jsxs)(ns.TableRow,{className:"h-10 hover:bg-gray-50",children:[(0,t.jsx)(ni.TableCell,{className:"py-2 px-4",children:(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900",children:n})}),(0,t.jsx)(ni.TableCell,{className:"py-2 px-4",children:(0,t.jsx)("span",{className:"text-sm text-gray-500",children:l||"—"})}),(0,t.jsx)(ni.TableCell,{className:"py-2 px-4",children:(0,t.jsx)(nt.Badge,{color:o?"red":"green",size:"xs",children:i})}),(0,t.jsx)(ni.TableCell,{className:"py-2 px-4 text-right",children:(0,t.jsx)("button",{onClick:()=>u(e.server_id),disabled:r,title:"Revoke connection",className:`inline-flex items-center justify-center rounded-md border border-gray-200 px-2 py-1 text-gray-400 hover:text-red-500 hover:border-red-200 transition-colors ${r?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,style:{background:"none"},children:r?(0,t.jsx)(tV.Spin,{size:"small"}):(0,t.jsx)(tm.DeleteOutlined,{className:"text-sm"})})})]},e.server_id)})})]})})]})};var nc=e.i(689020),nd=e.i(254530),nu=e.i(452598),nf=e.i(612256),np=e.i(916925);let nh=["Write","Learn","Code","Brainstorm"],ng="litellm_chat_selected_models";function nx(){let e=new Date().getHours();return e>=5&&e<12?"Good morning":e>=12&&e<17?"Good afternoon":"Good evening"}function nm(e,t){return t?`${e}/ui/chat?id=${t}`:`${e}/ui/chat`}function ny(e){if(!e)return"";let t=e.toLowerCase(),n=t.indexOf("/");return n>0?t.slice(0,n):t.includes("claude")?"anthropic":t.includes("gemini")?"gemini":t.includes("gpt")||t.includes("chatgpt")||/^o[0-9]/.test(t)?"openai":t.includes("mistral")||t.includes("codestral")?"mistral":t.includes("llama")?"meta_llama":t.includes("deepseek")?"deepseek":t.includes("grok")?"xai":t.includes("command")?"cohere":t.includes("nova")||t.includes("titan")?"bedrock":""}async function nb(e,t,n,r,i,l,o){try{await (0,nd.makeOpenAIChatCompletionRequest)(t,t=>l(e,t),e,n,void 0,i,void 0,void 0,void 0,void 0,void 0,void 0,void 0,r.length>0?r:void 0)}catch(t){if(!(t instanceof Error&&"AbortError"===t.name)){let n=t instanceof Error?t.message:String(t);l(e,` + `}),(0,t.jsx)("div",{className:"chat-dot"}),(0,t.jsx)("div",{className:"chat-dot"}),(0,t.jsx)("div",{className:"chat-dot"})]})}function tB({message:e}){let n=e.toolArgs?function e(t){let n={};for(let[r,i]of Object.entries(t))tD.test(r)?n[r]="[redacted]":Array.isArray(i)?n[r]=i.map(t=>null===t||"object"!=typeof t||Array.isArray(t)?t:e(t)):null!==i&&"object"==typeof i?n[r]=e(i):n[r]=i;return n}(e.toolArgs):void 0;return(0,t.jsxs)("div",{style:{maxWidth:"80%"},children:[(0,t.jsx)(tT.Collapse,{size:"small",style:{backgroundColor:"#fafafa",border:"1px solid #e5e7eb",borderRadius:8},children:(0,t.jsxs)(tL,{header:(0,t.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:6,fontSize:13},children:[(0,t.jsx)(tz.ToolOutlined,{style:{color:"#6b7280"}}),(0,t.jsx)("span",{style:{color:"#374151",fontWeight:500},children:e.toolName??"Tool call"})]}),children:[void 0!==n&&(0,t.jsxs)("div",{style:{marginBottom:12*!!e.toolResult},children:[(0,t.jsx)("div",{style:{fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"#9ca3af",marginBottom:4},children:"Arguments"}),(0,t.jsx)("pre",{style:{margin:0,padding:"8px 10px",backgroundColor:"#f3f4f6",borderRadius:6,fontSize:12,fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace',whiteSpace:"pre-wrap",wordBreak:"break-word",color:"#374151"},children:JSON.stringify(n,null,2)})]}),e.toolResult&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"#9ca3af",marginBottom:4},children:"Result"}),(0,t.jsx)("div",{style:{fontSize:13,color:"#374151",whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:e.toolResult})]})]},"tool")}),(0,t.jsx)("div",{style:{fontSize:11,color:"#9ca3af",marginTop:4},children:tI(e.timestamp)})]})}let tH=({messages:e,isStreaming:n,onEditMessage:r})=>{let i=e.length-1,l=e[i]??null,o=n&&null!==l&&"assistant"===l.role&&""===l.content;return(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:16},children:e.map((e,l)=>{let s=l===i;return"user"===e.role?(0,t.jsx)(t_,{message:e,onEdit:r,isStreaming:n},e.id):"tool"===e.role?(0,t.jsx)(tB,{message:e},e.id):(0,t.jsx)(tW,{message:e,isLastMessage:s,isStreaming:n,isTypingIndicator:s&&o,mcpEvents:e.mcpEvents},e.id)})})};var tU=e.i(790848),tY=e.i(482725),tq=e.i(602869);let tK=({accessToken:e,selectedServers:r,onChange:i})=>{let[l,o]=(0,n.useState)([]),[s,c]=(0,n.useState)(!0),[d,u]=(0,n.useState)(new Set);(0,n.useEffect)(()=>{let t=!1;return(async()=>{c(!0);try{let n=await (0,tq.fetchMCPServers)(e);if(t)return;let r=Array.isArray(n)?n:n?.data??[];o(r)}catch{t||o([])}finally{t||c(!1)}})(),()=>{t=!0}},[e]);let f=async(t,n)=>{if(!n)return void i(r.filter(e=>e!==t));u(e=>new Set(e).add(t));try{let n=await (0,tq.listMCPTools)(e,t);if(n?.error)return void a.default.warning(`Could not load tools for ${t} — it will be excluded from this message.`);i([...r,t])}catch{a.default.warning(`Could not load tools for ${t} — it will be excluded from this message.`)}finally{u(e=>{let n=new Set(e);return n.delete(t),n})}};return(0,t.jsx)("div",{style:{maxWidth:320,maxHeight:400,overflowY:"auto",padding:"8px 0"},children:s?(0,t.jsx)("div",{style:{display:"flex",justifyContent:"center",padding:"24px 0"},children:(0,t.jsx)(tY.Spin,{})}):0===l.length?(0,t.jsx)("div",{style:{padding:"16px 12px",color:"#8c8c8c",fontSize:13,textAlign:"center"},children:"No MCP servers configured"}):l.map(e=>{let n=e.server_name??e.alias??e.server_id,i=r.includes(n),l=d.has(n);return(0,t.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:"8px 12px",gap:12},children:[e.mcp_info?.logo_url&&(0,t.jsx)("img",{src:e.mcp_info.logo_url,alt:`${n} logo`,style:{width:24,height:24,borderRadius:6,objectFit:"contain",flexShrink:0,marginTop:1},onError:e=>{e.target.style.display="none"}}),(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("div",{style:{fontWeight:500,fontSize:13,color:"#1f1f1f",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n}),e.description&&(0,t.jsx)("div",{style:{fontSize:12,color:"#8c8c8c",marginTop:2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.description})]}),(0,t.jsx)(tU.Switch,{size:"small",checked:i,loading:l,onChange:e=>f(n,e)})]},e.server_id)})})};var tG=e.i(240647),tV=e.i(245704),tJ=e.i(292335),tX=e.i(280024);let tZ=({server:e,accessToken:r,onConnect:i,variant:l="badge"})=>{let o=e.server_name??e.alias??e.server_id,{startOAuthFlow:s,status:a}=(0,tX.useUserMcpOAuthFlow)({accessToken:r,serverId:e.server_id,serverAlias:o,onSuccess:(0,n.useCallback)(()=>i(e.server_id),[i,e.server_id])}),c="authorizing"===a||"exchanging"===a;return"button"===l?(0,t.jsx)(e2.Button,{type:"primary",loading:c,onClick:s,style:{borderRadius:8,fontWeight:600,height:38,minWidth:110},children:c?"Connecting…":"Connect"}):(0,t.jsx)("span",{onClick:e=>{e.stopPropagation(),c||s()},style:{fontSize:11,fontWeight:600,color:c?"#9ca3af":"#fff",background:c?"#e5e7eb":"#1677ff",borderRadius:6,padding:"2px 8px",cursor:c?"default":"pointer",flexShrink:0,whiteSpace:"nowrap"},children:c?"Connecting…":"Connect"})},tQ=["#1677ff","#52c41a","#fa8c16","#eb2f96","#722ed1","#13c2c2","#fa541c","#2f54eb","#a0d911","#faad14"];function t0(e){let t=0;for(let n=0;n{let[l,s]=(0,n.useState)([]),[c,d]=(0,n.useState)(!0),[u,f]=(0,n.useState)(""),[p,g]=(0,n.useState)("all"),[x,m]=(0,n.useState)(new Set),[b,v]=(0,n.useState)(null),[k,j]=(0,n.useState)([]),[S,w]=(0,n.useState)(!1),[C,z]=(0,n.useState)({}),[E,T]=(0,n.useState)(!1),[O,A]=(0,n.useState)(new Set),M=(0,n.useRef)([]);(0,n.useEffect)(()=>{M.current=l},[l]);let R=(0,n.useRef)(r);(0,n.useEffect)(()=>{R.current=r},[r]);let L=(0,n.useRef)(i);(0,n.useEffect)(()=>{L.current=i},[i]);let D=e=>e.server_name??e.alias??e.server_id;(0,n.useEffect)(()=>{let t=!1;return d(!0),(0,tq.fetchMCPServers)(e).then(n=>{if(t)return;let r=Array.isArray(n)?n:n?.data??[];s(r),d(!1),T(!0);let i=r.length;0===i?T(!1):(r.forEach(n=>{(0,tq.listMCPTools)(e,n.server_id).then(e=>{if(t)return;let r=Array.isArray(e?.tools)?e.tools:[],i=D(n);z(e=>({...e,[i]:r.length}))}).catch(()=>{}).finally(()=>{t||0==(i-=1)&&T(!1)})}),r.filter(e=>e.auth_type===tJ.AUTH_TYPE.OAUTH2).forEach(n=>{(0,tq.getMCPOAuthUserCredentialStatus)(e,n.server_id).then(e=>{t||e.has_credential&&!e.is_expired&&A(e=>new Set(e).add(n.server_id))}).catch(()=>{})}))}).catch(()=>{t||(s([]),d(!1))}),()=>{t=!0}},[e]),(0,n.useEffect)(()=>{if(0===O.size)return;let e=M.current.filter(e=>O.has(e.server_id)&&!R.current.includes(D(e))).map(D);e.length>0&&L.current([...R.current,...e])},[O]);let I=async(t,n,l)=>{if(!n){i(r.filter(e=>e!==t)),l&&A(e=>{let t=new Set(e);return t.delete(l),t});return}m(e=>new Set(e).add(t));try{let n=l??t,r=await (0,tq.listMCPTools)(e,n);if(r?.error)return void a.default.warning(`Could not load tools for ${t}`);R.current.includes(t)||i([...R.current,t])}catch{a.default.warning(`Could not load tools for ${t}`)}finally{m(e=>{let n=new Set(e);return n.delete(t),n})}};(0,n.useEffect)(()=>{if(!b)return void j([]);let t=!1;return w(!0),(0,tq.listMCPTools)(e,b.server_id).then(e=>{t||j(Array.isArray(e?.tools)?e.tools:[])}).catch(()=>{t||j([])}).finally(()=>{t||w(!1)}),()=>{t=!0}},[b,e]);let F=l.filter(e=>{let t=D(e),n=!u.trim()||t.toLowerCase().includes(u.toLowerCase())||(e.description??"").toLowerCase().includes(u.toLowerCase()),i="all"===p||r.includes(t);return n&&i}),_=l.filter(e=>r.includes(D(e))).length,W=Object.values(C).reduce((e,t)=>e+t,0);if(b){let n=D(b),i=r.includes(n),l=x.has(n),o=t0(n);return(0,t.jsxs)("div",{style:{width:"100%"},children:[(0,t.jsxs)("button",{onClick:()=>v(null),style:{display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",color:"#6b7280",fontSize:13,padding:"0 0 20px 0"},children:[(0,t.jsx)(y.ArrowLeftOutlined,{style:{fontSize:12}}),"Back"]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:20,marginBottom:28},children:[b.mcp_info?.logo_url?(0,t.jsx)("img",{src:b.mcp_info.logo_url,alt:`${n} logo`,style:{width:64,height:64,borderRadius:16,objectFit:"contain",flexShrink:0,background:"#f9fafb"},onError:e=>{let t=e.target;t.style.display="none",t.nextElementSibling&&(t.nextElementSibling.style.display="flex")}}):null,(0,t.jsx)("div",{style:{width:64,height:64,borderRadius:16,background:o,display:b.mcp_info?.logo_url?"none":"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontWeight:700,fontSize:28,flexShrink:0},children:n.charAt(0).toUpperCase()}),(0,t.jsxs)("div",{style:{flex:1},children:[(0,t.jsx)("h2",{style:{margin:"0 0 4px",fontSize:22,fontWeight:700,color:"#111827"},children:n}),(0,t.jsx)("p",{style:{margin:0,fontSize:14,color:"#6b7280"},children:b.description??"MCP server"})]}),b.auth_type===tJ.AUTH_TYPE.OAUTH2?O.has(b.server_id)?(0,t.jsx)(e2.Button,{type:"default",danger:!0,onClick:async()=>{try{await (0,tq.deleteMCPOAuthUserCredential)(e,b.server_id)}catch(e){}A(e=>{let t=new Set(e);return t.delete(b.server_id),t}),L.current(R.current.filter(e=>e!==n))},style:{borderRadius:8,fontWeight:600,height:38,minWidth:110},children:"Disconnect"}):(0,t.jsx)(tZ,{server:b,accessToken:e,onConnect:e=>{A(t=>new Set(t).add(e))},variant:"button"}):(0,t.jsx)(e2.Button,{type:i?"default":"primary",loading:l,onClick:()=>I(n,!i,b.server_id),style:{borderRadius:8,fontWeight:600,height:38,minWidth:110},children:i?"Disconnect":"Connect"})]}),(0,t.jsx)("h3",{style:{margin:"0 0 12px",fontSize:15,fontWeight:600,color:"#111827"},children:"Information"}),(0,t.jsx)("div",{style:{border:"1px solid #e5e7eb",borderRadius:10,overflow:"hidden",marginBottom:28},children:[["Server ID",b.server_id],["Transport",(0,tJ.handleTransport)(b.transport,b.spec_path)],["Status",i?"Connected":"Not connected"]].filter(([,e])=>e).map(([e,n],r,i)=>(0,t.jsxs)("div",{style:{display:"flex",padding:"12px 16px",borderBottom:r(0,t.jsxs)("div",{style:{border:"1px solid #e5e7eb",borderRadius:8,padding:"10px 14px",background:"#fafafa"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4*!!e.description},children:[(0,t.jsx)(tz.ToolOutlined,{style:{fontSize:13,color:"#6b7280"}}),(0,t.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"#111827",fontFamily:"monospace"},children:e.name})]}),e.description&&(0,t.jsx)("p",{style:{margin:0,fontSize:12,color:"#6b7280",paddingLeft:21},children:e.description})]},e.name))})]})}return(0,t.jsxs)("div",{style:{width:"100%"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:20,gap:16,flexWrap:"wrap"},children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[(0,t.jsx)("h2",{style:{margin:0,fontSize:18,fontWeight:600,color:"#111827"},children:"MCP Servers"}),(0,t.jsx)("span",{style:{fontSize:10,fontWeight:600,color:"#1677ff",background:"#e8f4ff",borderRadius:4,padding:"1px 6px",letterSpacing:"0.05em",textTransform:"uppercase"},children:"Beta"})]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,t.jsx)("p",{style:{margin:0,fontSize:13,color:"#6b7280"},children:"Browse tools, authenticate once, use in chat — no setup needed."}),E?(0,t.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:5,fontSize:12,color:"#9ca3af"},children:[(0,t.jsx)(tY.Spin,{size:"small",style:{transform:"scale(0.7)"}}),"Loading tools..."]}):W>0?(0,t.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:4,fontSize:12,color:"#6b7280"},children:[(0,t.jsx)(tz.ToolOutlined,{style:{fontSize:11}}),W," tool",1!==W?"s":""," available"]}):null]})]}),(0,t.jsx)(e4.Input,{prefix:(0,t.jsx)(h.SearchOutlined,{style:{color:"#9ca3af",fontSize:13}}),placeholder:"Search servers...",value:u,onChange:e=>f(e.target.value),allowClear:!0,style:{width:220,borderRadius:8,fontSize:13},size:"middle"})]}),(0,t.jsx)("div",{style:{display:"flex",borderBottom:"1px solid #e5e7eb",marginBottom:16},children:["all","connected"].map(e=>(0,t.jsx)("button",{onClick:()=>g(e),style:{padding:"8px 16px",border:"none",borderBottom:p===e?"2px solid #1677ff":"2px solid transparent",cursor:"pointer",fontSize:13,fontWeight:p===e?600:400,background:"transparent",color:p===e?"#1677ff":"#6b7280",marginBottom:-1},children:"all"===e?"All":`Connected${_>0?` (${_})`:""}`},e))}),c?(0,t.jsx)("div",{style:{display:"flex",justifyContent:"center",padding:"48px 0"},children:(0,t.jsx)(tY.Spin,{})}):0===F.length?(0,t.jsx)("div",{style:{textAlign:"center",color:"#9ca3af",fontSize:13,padding:"48px 12px"},children:0===l.length?"No MCP servers configured. Add servers in Tools → MCP Servers.":"connected"===p?"No servers connected yet.":"No servers match your search."}):(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:0,border:"1px solid #e5e7eb",borderRadius:10,overflow:"hidden"},children:F.map((n,i)=>{let l=D(n),s=r.includes(l),a=t0(l),c=C[l];return(0,t.jsxs)("div",{onClick:()=>v(n),style:{display:"flex",alignItems:"center",gap:12,padding:"14px 16px",background:"#fff",borderRight:i%2==0?"1px solid #f3f4f6":"none",borderBottom:Math.floor(i/2){e.currentTarget.style.background="#fafafa"},onMouseLeave:e=>{e.currentTarget.style.background="#fff"},children:[n.mcp_info?.logo_url?(0,t.jsx)("img",{src:n.mcp_info.logo_url,alt:`${l} logo`,style:{width:38,height:38,borderRadius:10,objectFit:"contain",flexShrink:0,background:"#f9fafb"},onError:e=>{let t=e.target;t.style.display="none",t.nextElementSibling&&(t.nextElementSibling.style.display="flex")}}):null,(0,t.jsx)("div",{style:{width:38,height:38,borderRadius:10,background:a,display:n.mcp_info?.logo_url?"none":"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontWeight:700,fontSize:16,flexShrink:0},children:l.charAt(0).toUpperCase()}),(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("div",{style:{fontSize:14,fontWeight:500,color:"#111827",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l}),(0,t.jsxs)("div",{style:{fontSize:12,color:"#9ca3af",marginTop:1,display:"flex",alignItems:"center",gap:6},children:[(0,t.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.description??"MCP server"}),void 0!==c?c>0?(0,t.jsxs)("span",{style:{flexShrink:0,display:"flex",alignItems:"center",gap:3,color:"#9ca3af"},children:["· ",(0,t.jsx)(tz.ToolOutlined,{style:{fontSize:10}})," ",c]}):null:E?(0,t.jsx)(o.Skeleton.Input,{active:!0,size:"small",style:{width:28,height:12,minWidth:28,flexShrink:0}}):null]})]}),n.auth_type===tJ.AUTH_TYPE.OAUTH2?O.has(n.server_id)?(0,t.jsx)(tV.CheckCircleOutlined,{style:{fontSize:14,color:"#52c41a",flexShrink:0}}):(0,t.jsx)(tZ,{server:n,accessToken:e,onConnect:e=>{A(t=>new Set(t).add(e))},variant:"badge"}):s?(0,t.jsx)("span",{style:{width:7,height:7,borderRadius:"50%",background:"#1677ff",flexShrink:0}}):null,(0,t.jsx)(tG.RightOutlined,{style:{fontSize:11,color:"#d1d5db",flexShrink:0}})]},n.server_id)})})]})};var t2=e.i(596239),t4=e.i(389083),t6=e.i(269200),t5=e.i(942232),t8=e.i(977572),t3=e.i(427612),t7=e.i(64848),t9=e.i(496020);let ne=({accessToken:e})=>{let[r,i]=(0,n.useState)([]),[l,o]=(0,n.useState)(!0),[s,c]=(0,n.useState)(new Set),d=(0,n.useCallback)(()=>{o(!0),(0,tq.listMCPUserCredentials)(e).then(i).catch(()=>i([])).finally(()=>o(!1))},[e]);(0,n.useEffect)(()=>{d()},[d]);let u=async t=>{c(e=>new Set(e).add(t));try{await (0,tq.deleteMCPOAuthUserCredential)(e,t),i(e=>e.filter(e=>e.server_id!==t))}catch{a.default.error("Failed to revoke connection. Please try again.")}finally{c(e=>{let n=new Set(e);return n.delete(t),n})}};return(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)("h2",{className:"text-base font-semibold text-gray-900 mb-0.5",children:"App Credentials"}),(0,t.jsx)("p",{className:"text-sm text-gray-500 m-0",children:"Your stored OAuth connections — used automatically in chat."})]}),l?(0,t.jsx)("div",{className:"flex justify-center py-12",children:(0,t.jsx)(tY.Spin,{})}):0===r.length?(0,t.jsxs)("div",{className:"text-center text-gray-400 text-sm py-12 border border-dashed border-gray-200 rounded-lg",children:[(0,t.jsx)(t2.LinkOutlined,{className:"text-2xl mb-3 block text-gray-300"}),"No connections yet.",(0,t.jsx)("br",{}),"Go to ",(0,t.jsx)("strong",{children:"Apps"})," and click ",(0,t.jsx)("strong",{children:"Connect"})," to authorize an MCP server."]}):(0,t.jsx)("div",{className:"rounded-lg border border-gray-200 overflow-hidden",children:(0,t.jsxs)(t6.Table,{children:[(0,t.jsx)(t3.TableHead,{children:(0,t.jsxs)(t9.TableRow,{children:[(0,t.jsx)(t7.TableHeaderCell,{className:"text-xs font-medium text-gray-500 py-2 px-4",children:"App"}),(0,t.jsx)(t7.TableHeaderCell,{className:"text-xs font-medium text-gray-500 py-2 px-4",children:"Connected"}),(0,t.jsx)(t7.TableHeaderCell,{className:"text-xs font-medium text-gray-500 py-2 px-4",children:"Status"}),(0,t.jsx)(t7.TableHeaderCell,{className:"text-xs font-medium text-gray-500 py-2 px-4 text-right",children:"Actions"})]})}),(0,t.jsx)(t5.TableBody,{children:r.map(e=>{let n=e.alias||e.server_name||e.server_id,r=s.has(e.server_id),i=function(e){if(!e)return"Does not expire";try{let t=new Date(e).getTime()-Date.now();if(t<=0)return"Expired";let n=Math.floor(t/1e3),r=Math.floor(n/60),i=Math.floor(r/60),l=Math.floor(i/24);if(l>0)return`Expires in ${l}d`;if(i>0)return`Expires in ${i}h`;return`Expires in ${r}m`}catch{return""}}(e.expires_at),l=function(e){if(!e)return"";try{let t=new Date(e),n=Date.now()-t.getTime(),r=Math.floor(n/1e3);if(r<60)return"just now";let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let l=Math.floor(i/60);if(l<24)return`${l}h ago`;return`${Math.floor(l/24)}d ago`}catch{return""}}(e.connected_at),o="Expired"===i;return(0,t.jsxs)(t9.TableRow,{className:"h-10 hover:bg-gray-50",children:[(0,t.jsx)(t8.TableCell,{className:"py-2 px-4",children:(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900",children:n})}),(0,t.jsx)(t8.TableCell,{className:"py-2 px-4",children:(0,t.jsx)("span",{className:"text-sm text-gray-500",children:l||"—"})}),(0,t.jsx)(t8.TableCell,{className:"py-2 px-4",children:(0,t.jsx)(t4.Badge,{color:o?"red":"green",size:"xs",children:i})}),(0,t.jsx)(t8.TableCell,{className:"py-2 px-4 text-right",children:(0,t.jsx)("button",{onClick:()=>u(e.server_id),disabled:r,title:"Revoke connection",className:`inline-flex items-center justify-center rounded-md border border-gray-200 px-2 py-1 text-gray-400 hover:text-red-500 hover:border-red-200 transition-colors ${r?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,style:{background:"none"},children:r?(0,t.jsx)(tY.Spin,{size:"small"}):(0,t.jsx)(tm.DeleteOutlined,{className:"text-sm"})})})]},e.server_id)})})]})})]})};var nt=e.i(689020),nn=e.i(254530),nr=e.i(452598),ni=e.i(612256),nl=e.i(916925);let no=["Write","Learn","Code","Brainstorm"],ns="litellm_chat_selected_models";function na(){let e=new Date().getHours();return e>=5&&e<12?"Good morning":e>=12&&e<17?"Good afternoon":"Good evening"}function nc(e,t){return t?`${e}/ui/chat?id=${t}`:`${e}/ui/chat`}function nd(e){if(!e)return"";let t=e.toLowerCase(),n=t.indexOf("/");return n>0?t.slice(0,n):t.includes("claude")?"anthropic":t.includes("gemini")?"gemini":t.includes("gpt")||t.includes("chatgpt")||/^o[0-9]/.test(t)?"openai":t.includes("mistral")||t.includes("codestral")?"mistral":t.includes("llama")?"meta_llama":t.includes("deepseek")?"deepseek":t.includes("grok")?"xai":t.includes("command")?"cohere":t.includes("nova")||t.includes("titan")?"bedrock":""}async function nu(e,t,n,r,i,l,o){try{await (0,nn.makeOpenAIChatCompletionRequest)(t,t=>l(e,t),e,n,void 0,i,void 0,void 0,void 0,void 0,void 0,void 0,void 0,r.length>0?r:void 0)}catch(t){if(!(t instanceof Error&&"AbortError"===t.name)){let n=t instanceof Error?t.message:String(t);l(e,` -_Error: ${n}_`)}}finally{o(e)}}let nv=({accessToken:e,userRole:r,userId:j,userEmail:S})=>{let w,C=(0,eQ.useRouter)(),z=(0,eQ.useSearchParams)(),E=z.get("id"),{data:O}=(0,nf.useUIConfig)(),T=O?.server_root_path&&"/"!==O.server_root_path?O.server_root_path.replace(/\/+$/,""):"",A=`${(0,tY.getProxyBaseUrl)()}/get_image`,[M,R]=(0,n.useState)([]),[L,I]=(0,n.useState)([]),[D,_]=(0,n.useState)(!0),[F,W]=(0,n.useState)(!1),[P,N]=(0,n.useState)(""),[$,B]=(0,n.useState)([]),[H,U]=(0,n.useState)(null),[V,Y]=(0,n.useState)(!1),[q,J]=(0,n.useState)(""),[K,G]=(0,n.useState)(!1),[X,Z]=(0,n.useState)(!1),Q=z?.get("mcpOauthReturn"),[ee,et]=(0,n.useState)("apps"===Q?"apps":"chats"),[en,er]=(0,n.useState)(!1),[ei,el]=(0,n.useState)([]),[eo,es]=(0,n.useState)(new Set),ea=(0,n.useRef)({}),ec=(0,n.useRef)(null),ed=(0,n.useRef)(null),eu=(0,n.useRef)(null),[ef,ep]=(0,n.useState)(!1),eh=(0,n.useRef)(null),{conversations:eg,activeConversation:ex,storageUnavailable:em,staleId:ey,createConversation:eb,appendMessage:ev,updateLastAssistantMessage:ek,truncateFromMessage:ej,deleteConversation:eS,renameConversation:ew}=function(e){let[t,r]=(0,n.useState)([]),[i,l]=(0,n.useState)(!1),[o,s]=(0,n.useState)(!1),[a,c]=(0,n.useState)(e),d=(0,n.useRef)(!1),u=(0,n.useRef)(!1);(0,n.useEffect)(()=>{c(e),s(!1)},[e]),(0,n.useEffect)(()=>{let{conversations:t,storageUnavailable:n}=function(){try{let e=localStorage.getItem(e0);if(!e)return{conversations:[],storageUnavailable:!1};return{conversations:JSON.parse(e),storageUnavailable:!1}}catch{return{conversations:[],storageUnavailable:!0}}}();d.current=n,r(t),l(n),u.current=!0,null!==e&&(t.some(t=>t.id===e)||s(!0))},[]),(0,n.useEffect)(()=>{!u.current||d.current||!function(e){try{return localStorage.setItem(e0,JSON.stringify(e)),!0}catch{return!1}}(t)&&(d.current=!0,l(!0))},[t]);let f=(0,n.useCallback)(e=>{let t=crypto.randomUUID(),n=Date.now(),i={id:t,title:"New conversation",model:e,messages:[],mcpServerNames:[],createdAt:n,updatedAt:n};return r(e=>e1([i,...e])),c(t),t},[]),p=(0,n.useCallback)((e,t)=>{let n={...t,id:crypto.randomUUID(),timestamp:Date.now()};r(t=>e1(t.map(t=>{let r;if(t.id!==e)return t;let i=[...t.messages,n],l=t.title;return"New conversation"===l&&"user"===n.role&&0===t.messages.filter(e=>"user"===e.role).length&&(l=(r=n.content.trim()).length<=40?r:r.slice(0,40)+"…"),{...t,title:l,messages:i,updatedAt:Date.now()}})))},[]),h=(0,n.useCallback)((e,t)=>{r(n=>e1(n.map(n=>{if(n.id!==e)return n;let r=[...n.messages],i=r.reduceRight((e,t,n)=>-1!==e?e:"assistant"===t.role?n:-1,-1);return -1===i?n:(r[i]={...r[i],...t},{...n,messages:r,updatedAt:Date.now()})})))},[]),g=(0,n.useCallback)((e,t)=>{r(n=>e1(n.map(n=>{if(n.id!==e)return n;let r=n.messages.findIndex(e=>e.id===t);return -1===r?n:{...n,messages:n.messages.slice(0,r),updatedAt:Date.now()}})))},[]),x=(0,n.useCallback)(e=>{r(t=>e1(t.filter(t=>t.id!==e))),a===e&&c(null)},[a]),m=(0,n.useCallback)((e,t)=>{r(n=>e1(n.map(n=>n.id===e?{...n,title:t,updatedAt:Date.now()}:n)))},[]),y=(0,n.useCallback)(e=>{c(e),s(!1)},[]),b=null!==a?t.find(e=>e.id===a)??null:null;return{conversations:t,activeConversation:b,storageUnavailable:i,staleId:o,createConversation:f,appendMessage:p,updateLastAssistantMessage:h,truncateFromMessage:g,deleteConversation:x,renameConversation:m,setActiveConversationId:y}}(E);(0,n.useEffect)(()=>{if(Q&&1){let e=new URL(window.location.href);e.searchParams.delete("mcpOauthReturn"),window.history.replaceState({},"",e.toString())}},[]),(0,n.useEffect)(()=>{e&&(_(!0),(0,nc.fetchAvailableModels)(e).then(e=>{let t=(e||[]).map(e=>e.model_group??"").filter(Boolean);I(t);try{let e=localStorage.getItem(ng);if(e){let n=JSON.parse(e);if(Array.isArray(n)){let e=n.filter(e=>t.includes(e));if(e.length>0)return void R(e)}}}catch{}t.length>0&&(R([t[0]]),localStorage.setItem(ng,JSON.stringify([t[0]])))}).catch(()=>a.default.error("Could not load models")).finally(()=>_(!1)))},[e]),(0,n.useEffect)(()=>{ey&&C.replace(nm(T))},[ey,C]),(0,n.useEffect)(()=>{U(null)},[E]);let eC=(0,n.useCallback)(e=>{R(t=>{let n;if(t.includes(e))n=t.filter(t=>t!==e);else{if(t.length>=3)return t;n=[...t,e]}return localStorage.setItem(ng,JSON.stringify(n)),n})},[]),ez=M.length>1,eE=V||eo.size>0,eO=(0,n.useCallback)(async(t,n)=>{let r=t.trim();if(!r||0===M.length||V)return;let i=M[0];J("");let l=E;l||(l=eb(i),U(null),C.push(nm(T,l))),ev(l,{role:"user",content:r}),ev(l,{role:"assistant",content:""}),Y(!0),ec.current=new AbortController,n&&U(null);let o=n?null:H,s=n?[...n,{role:"user",content:r}]:o?[{role:"user",content:r}]:[...(ex?.messages??[]).filter(e=>"user"===e.role||"assistant"===e.role).map(e=>({role:e.role,content:e.content})),{role:"user",content:r}],a="",c="",d=[],u=!1;try{await (0,nu.makeOpenAIResponsesRequest)(s,(e,t)=>{a+=t,ek(l,{content:a})},i,e,void 0,ec.current.signal,e=>{c+=e,ek(l,{reasoningContent:c})},void 0,void 0,void 0,void 0,void 0,void 0,$.length>0?$:void 0,o,e=>U(e),e=>{d.push(e)}),u=!0}catch(e){e instanceof Error&&"AbortError"===e.name?ek(l,{content:a+" [stopped]"}):ek(l,{content:"[Something went wrong. The partial response has been saved.]"})}finally{d.length>0&&u&&ek(l,{mcpEvents:d}),Y(!1),ec.current=null}},[E,ex,M,$,e,eb,ev,ek,C,V,H]),eT=(0,n.useCallback)((t,n)=>{let r=t.trim();if(!r||0===M.length||eE)return;J("");let i={userMessage:r,responses:{}},l=n.length;el(e=>[...e,i]),es(new Set(M));let o={};M.forEach(e=>{o[e]=new AbortController}),ea.current=o,Promise.allSettled(M.map(t=>{let i=[];for(let e of n)i.push({role:"user",content:e.userMessage}),i.push({role:"assistant",content:e.responses[t]??""});return i.push({role:"user",content:r}),nb(t,i,e,$,o[t].signal,(e,t)=>el(n=>{let r=[...n],i={...r[l]};return i.responses={...i.responses,[e]:(i.responses[e]??"")+t},r[l]=i,r}),e=>es(t=>{let n=new Set(t);return n.delete(e),n}))}))},[M,e,$,eE]),eA=(0,n.useCallback)(()=>{ec.current?.abort(),Object.values(ea.current).forEach(e=>e.abort()),ea.current={}},[]),eM=(0,n.useCallback)((e,t)=>{if(!E||V)return;let n=ex?.messages??[],r=n.findIndex(t=>t.id===e),i=(-1===r?n:n.slice(0,r)).filter(e=>"user"===e.role||"assistant"===e.role).map(e=>({role:e.role,content:e.content}));ej(E,e),eO(t,i)},[E,V,ex,ej,eO]),eR=(0,n.useCallback)(e=>{ez?eT(e,ei):eO(e)},[ez,eO,eT,ei]),eL=e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),eR(q))};(0,n.useEffect)(()=>{let e=ed.current;e&&(e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,180)}px`)},[q]),(0,n.useEffect)(()=>{let e=eu.current;if(!e)return;let t=()=>{ep(e.scrollHeight-e.scrollTop-e.clientHeight>120),null!==eh.current&&(eh.current=e.scrollTop)};return e.addEventListener("scroll",t,{passive:!0}),()=>e.removeEventListener("scroll",t)},[ex]),(0,n.useEffect)(()=>{let e=eu.current;V?eh.current=e?.scrollTop??0:eh.current=null},[V]),(0,n.useLayoutEffect)(()=>{if(null===eh.current)return;let e=eu.current;e&&(e.scrollTop=eh.current)});let eI=(0,n.useRef)(0);(0,n.useLayoutEffect)(()=>{let e=ex?.messages?.length??0,t=eI.current;if(eI.current=e,e>t){let e=eu.current;e&&(e.scrollTop=e.scrollHeight)}},[ex?.messages]);let eD=ez?0===ei.length:!ex||0===ex.messages.length,e_=S?.split("@")[0]??j??"",eF=e_?`${nx()}, ${e_}`:nx(),eW=(w=(i.default.env.NEXT_PUBLIC_BASE_URL??"").replace(/^\/+|\/+$/g,""))?`${T}/${w}/`:`${T}/`,eP=(P?L.filter(e=>e.toLowerCase().includes(P.toLowerCase())):L).sort((e,t)=>{let n=M.includes(e),r=M.includes(t);return n&&!r?-1:!n&&r?1:0}),eN=(0,t.jsxs)("div",{style:{width:280,maxHeight:400,display:"flex",flexDirection:"column"},children:[(0,t.jsx)("div",{style:{padding:"8px 8px 4px"},children:(0,t.jsx)("input",{autoFocus:!0,value:P,onChange:e=>N(e.target.value),placeholder:"Search models...",style:{width:"100%",padding:"6px 10px",border:"1px solid #d1d5db",borderRadius:6,fontSize:13,outline:"none",boxSizing:"border-box"}})}),M.length>=3&&(0,t.jsxs)("div",{style:{padding:"4px 12px",fontSize:12,color:"#6b7280"},children:["Max ",3," models selected — deselect one to change."]}),(0,t.jsx)("div",{style:{flex:1,overflowY:"auto"},children:eP.map(e=>{let n=M.includes(e),r=!n&&M.length>=3,i=ny(e),{logo:l}=i?(0,np.getProviderLogoAndName)(i):{logo:""};return(0,t.jsxs)("button",{disabled:r,onClick:()=>eC(e),style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"7px 12px",background:n?"#eff6ff":"transparent",border:"none",cursor:r?"not-allowed":"pointer",textAlign:"left",opacity:r?.45:1,borderRadius:4},children:[(0,t.jsx)("span",{style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${n?"#1677ff":"#d1d5db"}`,background:n?"#1677ff":"#fff",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"all 0.1s"},children:n&&(0,t.jsx)(v.CheckOutlined,{style:{fontSize:10,color:"#fff"}})}),l?(0,t.jsx)("img",{src:l,alt:"",style:{width:16,height:16,objectFit:"contain",flexShrink:0},onError:e=>{e.currentTarget.style.display="none"}}):(0,t.jsx)("span",{style:{width:16,flexShrink:0}}),(0,t.jsx)("span",{style:{fontSize:13,color:"#111827",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e})]},e)})})]}),e$=(e,n,r,i=!1,o)=>(0,t.jsx)(l.Tooltip,{title:X?n:void 0,placement:"right",children:(0,t.jsxs)("button",{onClick:r,style:{display:"flex",alignItems:"center",gap:10,padding:"8px 10px",width:"100%",borderRadius:7,border:"none",cursor:"pointer",background:i?"#e8f4ff":"transparent",color:i?"#1677ff":"#374151",textAlign:"left",fontSize:14,justifyContent:X?"center":"flex-start",transition:"background 0.12s"},onMouseEnter:e=>{i||(e.currentTarget.style.background="#f5f5f5")},onMouseLeave:e=>{e.currentTarget.style.background=i?"#e8f4ff":"transparent"},children:[(0,t.jsx)("span",{style:{fontSize:16,flexShrink:0},children:e}),!X&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{style:{flex:1},children:n}),o&&(0,t.jsx)("span",{style:{fontSize:11,color:"#9ca3af"},children:o})]})]})},n),eB=D?(0,t.jsx)(o.Skeleton.Input,{active:!0,style:{width:160,height:28}}):(0,t.jsx)(s.Popover,{open:F,onOpenChange:e=>{W(e),e||N("")},content:eN,trigger:"click",placement:"bottomLeft",children:(0,t.jsxs)("button",{style:{display:"flex",alignItems:"center",gap:6,padding:"5px 10px",borderRadius:7,border:"1px solid transparent",cursor:"pointer",background:"transparent",color:"#111827",fontSize:14,fontWeight:500,maxWidth:480,overflow:"hidden"},onMouseEnter:e=>{e.currentTarget.style.background="#f5f5f5"},onMouseLeave:e=>{e.currentTarget.style.background="transparent"},children:[0===M.length?(0,t.jsx)("span",{style:{color:"#9ca3af"},children:"Select model"}):1===M.length?(0,t.jsxs)(t.Fragment,{children:[(()=>{let e=ny(M[0]),{logo:n}=e?(0,np.getProviderLogoAndName)(e):{logo:""};return n?(0,t.jsx)("img",{src:n,alt:"",style:{width:18,height:18,objectFit:"contain",flexShrink:0},onError:e=>{e.currentTarget.style.display="none"}}):null})(),(0,t.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:240},children:M[0]})]}):(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",gap:4,flexWrap:"nowrap",overflow:"hidden"},children:M.map(e=>{let n=ny(e),{logo:r}=n?(0,np.getProviderLogoAndName)(n):{logo:""};return(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",background:"#f0f4ff",borderRadius:10,fontSize:12,color:"#1677ff",fontWeight:500,flexShrink:0},children:[r&&(0,t.jsx)("img",{src:r,alt:"",style:{width:13,height:13,objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,t.jsx)("span",{style:{maxWidth:120,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e})]},e)})}),(0,t.jsx)(b.DownOutlined,{style:{fontSize:10,color:"#9ca3af",flexShrink:0,marginLeft:2}})]})}),eH=n=>(0,t.jsxs)("div",{style:{background:"#fff",borderRadius:12,border:"1px solid #e5e7eb",boxShadow:"0 1px 6px rgba(0,0,0,0.06)",overflow:"hidden"},children:[(0,t.jsx)("textarea",{ref:ed,value:q,onChange:e=>J(e.target.value),onKeyDown:eL,placeholder:n?"Send a message...":"How can I help you today?",style:{width:"100%",minHeight:n?52:80,padding:n?"16px 20px 8px":"20px 20px 8px",border:"none",outline:"none",resize:"none",fontSize:15,color:"#111827",background:"transparent",fontFamily:"inherit",boxSizing:"border-box"}}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:n?"4px 12px 10px":"8px 12px 12px",borderTop:"1px solid #f3f4f6"},children:[(0,t.jsx)(s.Popover,{open:K,onOpenChange:G,content:(0,t.jsx)(tq,{accessToken:e,selectedServers:$,onChange:B}),trigger:"click",placement:"topLeft",children:(0,t.jsxs)("button",{style:{background:"none",border:"1px solid #d1d5db",borderRadius:6,padding:"5px 10px",cursor:"pointer",fontSize:14,color:"#6b7280",display:"flex",alignItems:"center",gap:4},children:[(0,t.jsx)(d.PlusOutlined,{}),$.length>0&&(0,t.jsx)("span",{style:{fontSize:12,color:"#1677ff",fontWeight:500},children:$.length})]})}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[!ez&&(0,t.jsx)("span",{style:{fontSize:12,color:"#9ca3af",maxWidth:160,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n?$.length>0?`${$.length} tool${$.length>1?"s":""} connected`:"":M[0]||"No model"}),eE?(0,t.jsx)("button",{onClick:eA,style:{background:"none",border:"1.5px solid #d1d5db",borderRadius:"50%",width:32,height:32,cursor:"pointer",color:"#374151",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"border-color 0.15s"},onMouseEnter:e=>{e.currentTarget.style.borderColor="#9ca3af"},onMouseLeave:e=>{e.currentTarget.style.borderColor="#d1d5db"},children:(0,t.jsx)("div",{style:{width:10,height:10,background:"#374151",borderRadius:2}})}):(0,t.jsx)("button",{onClick:()=>eR(q),disabled:!q.trim()||D||0===M.length,style:{background:q.trim()&&M.length>0?"#1677ff":"#f3f4f6",border:"none",borderRadius:7,padding:"7px 16px",cursor:q.trim()&&M.length>0?"pointer":"not-allowed",color:q.trim()&&M.length>0?"#fff":"#9ca3af",fontSize:14,fontWeight:500,transition:"background 0.15s"},children:"Send"})]})]})]});return(0,t.jsxs)("div",{style:{display:"flex",height:"100vh",width:"100vw",background:"#ffffff",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{width:X?56:260,flexShrink:0,background:"#f9fafb",borderRight:"1px solid #e5e7eb",display:"flex",flexDirection:"column",overflow:"hidden",transition:"width 0.2s cubic-bezier(0.4, 0, 0.2, 1)"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",padding:"12px 10px",justifyContent:X?"center":"space-between",flexShrink:0},children:[!X&&(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,t.jsx)("img",{src:A,alt:"LiteLLM",style:{height:28,maxWidth:120,objectFit:"contain",flexShrink:0}}),(0,t.jsx)("span",{style:{fontWeight:700,fontSize:15,color:"#111827",letterSpacing:"-0.01em"},children:"LiteLLM"})]}),(0,t.jsx)(l.Tooltip,{title:X?"Expand sidebar":"Collapse sidebar",placement:"right",children:(0,t.jsx)("button",{onClick:()=>Z(e=>!e),style:{background:"none",border:"none",cursor:"pointer",padding:6,borderRadius:7,color:"#6b7280",fontSize:16,display:"flex",alignItems:"center"},children:X?(0,t.jsx)(p.MenuUnfoldOutlined,{}):(0,t.jsx)(f.MenuFoldOutlined,{})})})]}),(0,t.jsxs)("div",{style:{padding:"0 8px 4px",flexShrink:0},children:[e$((0,t.jsx)(u.EditOutlined,{}),"New chat",()=>C.push(nm(T))),e$((0,t.jsx)(h.SearchOutlined,{}),"Search chats",()=>et("chats"))]}),(0,t.jsx)("div",{style:{height:1,background:"#e5e7eb",margin:"4px 8px",flexShrink:0}}),(0,t.jsxs)("div",{style:{padding:"4px 8px",flexShrink:0},children:[e$((0,t.jsx)(g.MessageOutlined,{}),"Chats",()=>et("chats"),"chats"===ee),e$((0,t.jsx)(x.AppstoreOutlined,{}),"Apps",()=>et("apps"),"apps"===ee),e$((0,t.jsx)(m.KeyOutlined,{}),"Credentials",()=>et("credentials"),"credentials"===ee),(0,t.jsx)(l.Tooltip,{title:X?"Back to Developer Console UI":void 0,placement:"right",children:(0,t.jsxs)("a",{href:eW,style:{display:"flex",alignItems:"center",gap:10,padding:"8px 10px",width:"100%",borderRadius:7,color:"#6b7280",textDecoration:"none",fontSize:14,justifyContent:X?"center":"flex-start",boxSizing:"border-box"},onMouseEnter:e=>{e.currentTarget.style.background="#f5f5f5"},onMouseLeave:e=>{e.currentTarget.style.background="transparent"},children:[(0,t.jsx)(y.ArrowLeftOutlined,{style:{fontSize:16,flexShrink:0}}),!X&&(0,t.jsx)("span",{children:"Back to Developer Console UI"})]})})]}),(0,t.jsx)("div",{style:{height:1,background:"#e5e7eb",margin:"4px 8px",flexShrink:0}}),!X&&"chats"===ee&&(0,t.jsx)("div",{style:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column"},children:(0,t.jsx)(tC,{conversations:eg,activeConversationId:E,onSelect:e=>C.push(nm(T,e)),onDelete:eS,onNewChat:()=>C.push(nm(T)),onRename:ew})})]}),(0,t.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",minWidth:0},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",flexShrink:0,borderBottom:"1px solid #f0f0f0",background:"#fff",height:48},children:[(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0,flex:1},children:eB}),(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0},children:(0,t.jsx)(l.Tooltip,{title:"Settings",children:(0,t.jsx)("button",{style:{background:"none",border:"none",cursor:"pointer",padding:7,borderRadius:7,color:"#6b7280",fontSize:16,display:"flex",alignItems:"center"},children:(0,t.jsx)(c.SettingOutlined,{})})})})]}),em&&!en&&(0,t.jsxs)("div",{style:{background:"#fffbe6",borderBottom:"1px solid #ffe58f",padding:"6px 20px",fontSize:13,color:"#874d00",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,t.jsx)("span",{children:"Chat history won't be saved in this browser session."}),(0,t.jsx)("button",{onClick:()=>er(!0),style:{background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#874d00"},children:"×"})]}),(0,t.jsx)("div",{style:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column",background:"#fff"},children:"apps"===ee?(0,t.jsx)("div",{style:{flex:1,minHeight:0,overflow:"auto",maxWidth:800,margin:"0 auto",width:"100%",padding:"32px 24px"},children:(0,t.jsx)(t9,{accessToken:e,selectedServers:$,onChange:B})}):"credentials"===ee?(0,t.jsx)("div",{style:{flex:1,minHeight:0,overflow:"auto",maxWidth:800,margin:"0 auto",width:"100%",padding:"32px 24px"},children:(0,t.jsx)(na,{accessToken:e})}):eD?(0,t.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"0 24px 80px"},children:[(0,t.jsx)("h1",{style:{margin:"0 0 32px",fontSize:28,fontWeight:600,color:"#111827",fontFamily:"inherit",letterSpacing:"-0.01em",textAlign:"center"},children:ez?`Compare ${M.length} models`:eF}),ez?(0,t.jsx)("p",{style:{margin:"-16px 0 24px",fontSize:14,color:"#6b7280",textAlign:"center"},children:"Send a message to see responses side-by-side"}):(0,t.jsxs)("p",{style:{margin:"-16px 0 28px",fontSize:14,color:"#6b7280",textAlign:"center",maxWidth:520,lineHeight:1.6},children:["Chat with 100+ LLMs + MCP tools — authenticate once, use them here."," ",(0,t.jsx)("button",{onClick:()=>et("apps"),style:{background:"none",border:"none",cursor:"pointer",color:"#1677ff",fontSize:14,padding:0,fontWeight:500},children:"Open Apps →"})]}),(0,t.jsx)("div",{style:{width:"100%",maxWidth:680},children:eH(!1)}),!ez&&(0,t.jsx)("div",{style:{display:"flex",gap:8,marginTop:14,flexWrap:"wrap",justifyContent:"center"},children:nh.map(e=>(0,t.jsx)("button",{onClick:()=>J(e+": "),style:{background:"#f9fafb",border:"1px solid #e5e7eb",borderRadius:20,padding:"7px 16px",fontSize:14,color:"#374151",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.background="#f3f4f6"},onMouseLeave:e=>{e.currentTarget.style.background="#f9fafb"},children:e},e))})]}):(0,t.jsxs)("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",maxWidth:ez?M.length>=3?1200:960:760,margin:"0 auto",width:"100%",padding:"0 24px",position:"relative"},children:[(0,t.jsx)("div",{ref:eu,style:{flex:1,minHeight:0,overflow:"auto",paddingTop:24,overflowAnchor:"none"},children:ez?(0,t.jsx)("div",{style:{paddingBottom:8},children:ei.map((e,n)=>{let r=n===ei.length-1;return(0,t.jsxs)("div",{style:{marginBottom:32},children:[(0,t.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:20},children:(0,t.jsx)("div",{style:{background:"#f3f4f6",borderRadius:16,padding:"10px 16px",maxWidth:"75%",fontSize:14,color:"#111827",lineHeight:1.5},children:e.userMessage})}),(0,t.jsx)("div",{style:{display:"flex",gap:14,alignItems:"flex-start"},children:M.map((i,l)=>{let o=ny(i),{logo:s}=o?(0,np.getProviderLogoAndName)(o):{logo:""},a=e.responses[i]??"",c=r&&eo.has(i);return(0,t.jsxs)("div",{style:{flex:1,border:"1px solid #e5e7eb",borderRadius:12,overflow:"hidden",minWidth:0},children:[0===n&&(0,t.jsxs)("div",{style:{padding:"10px 14px",borderBottom:"1px solid #f0f0f0",display:"flex",alignItems:"center",gap:8,background:"#fafafa"},children:[s?(0,t.jsx)("img",{src:s,alt:"",style:{width:18,height:18,objectFit:"contain",flexShrink:0},onError:e=>{e.currentTarget.style.display="none"}}):(0,t.jsx)("div",{style:{width:18,height:18,borderRadius:"50%",background:"#e5e7eb",flexShrink:0}}),(0,t.jsxs)("span",{style:{fontWeight:600,fontSize:12,color:"#374151"},children:["Response ",l+1]}),(0,t.jsx)("span",{style:{fontSize:11,color:"#9ca3af",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0},children:i})]}),(0,t.jsxs)("div",{style:{padding:"14px 16px",minHeight:60,position:"relative"},children:[c&&(0,t.jsx)("span",{style:{position:"absolute",top:10,right:12,fontSize:9,color:"#1677ff"},children:"●"}),a?(0,t.jsx)(k.default,{remarkPlugins:[eZ],components:{p:({children:e})=>(0,t.jsx)("p",{style:{margin:"0 0 10px",lineHeight:1.6,fontSize:14,color:"#111827"},children:e}),code:({className:e,children:n})=>/language-(\w+)/.exec(e||"")?(0,t.jsx)("pre",{style:{background:"#f8f9fa",padding:"10px 12px",borderRadius:6,overflow:"auto",fontSize:13,margin:"8px 0"},children:(0,t.jsx)("code",{children:n})}):(0,t.jsx)("code",{style:{background:"#f3f4f6",padding:"2px 5px",borderRadius:3,fontSize:13},children:n})},children:a}):c?(0,t.jsx)("span",{style:{color:"#9ca3af",fontSize:14},children:"Generating…"}):(0,t.jsx)("span",{style:{color:"#9ca3af",fontSize:14},children:"—"})]})]},i)})})]},n)})}):(0,t.jsx)(tH,{messages:ex.messages,isStreaming:V,onEditMessage:eM})}),ef&&(0,t.jsx)("button",{onClick:()=>{let e=eu.current;e&&(e.scrollTo({top:e.scrollHeight,behavior:"smooth"}),null!==eh.current&&(eh.current=e.scrollHeight))},style:{position:"absolute",bottom:100,left:"50%",transform:"translateX(-50%)",width:34,height:34,borderRadius:"50%",background:"rgba(255,255,255,0.75)",backdropFilter:"blur(6px)",WebkitBackdropFilter:"blur(6px)",border:"1px solid rgba(0,0,0,0.1)",boxShadow:"0 1px 4px rgba(0,0,0,0.08)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#6b7280",zIndex:10,transition:"background 0.15s"},onMouseEnter:e=>{e.currentTarget.style.background="rgba(255,255,255,0.95)"},onMouseLeave:e=>{e.currentTarget.style.background="rgba(255,255,255,0.75)"},"aria-label":"Scroll to bottom",children:(0,t.jsx)(b.DownOutlined,{style:{fontSize:12}})}),(0,t.jsx)("div",{style:{padding:"12px 0 24px"},children:eH(!0)})]})})]})]})},nk=()=>{let{accessToken:e,userRole:n,userId:i,userEmail:l}=(0,r.default)();return(0,t.jsx)(nv,{accessToken:e??"",userRole:n??"",userId:i??"",userEmail:l??""})};e.s(["default",0,()=>(0,t.jsx)(n.Suspense,{children:(0,t.jsx)(nk,{})})],321443)}]); \ No newline at end of file +_Error: ${n}_`)}}finally{o(e)}}let nf=({accessToken:e,userRole:r,userId:j,userEmail:S})=>{let w,C=(0,eQ.useRouter)(),z=(0,eQ.useSearchParams)(),E=z.get("id"),{data:T}=(0,ni.useUIConfig)(),O=T?.server_root_path&&"/"!==T.server_root_path?T.server_root_path.replace(/\/+$/,""):"",A=`${(0,tq.getProxyBaseUrl)()}/get_image`,[M,R]=(0,n.useState)([]),[L,D]=(0,n.useState)([]),[I,F]=(0,n.useState)(!0),[_,W]=(0,n.useState)(!1),[$,P]=(0,n.useState)(""),[N,B]=(0,n.useState)([]),[H,U]=(0,n.useState)(null),[Y,q]=(0,n.useState)(!1),[K,G]=(0,n.useState)(""),[V,J]=(0,n.useState)(!1),[X,Z]=(0,n.useState)(!1),Q=z?.get("mcpOauthReturn"),[ee,et]=(0,n.useState)("apps"===Q?"apps":"chats"),[en,er]=(0,n.useState)(!1),[ei,el]=(0,n.useState)([]),[eo,es]=(0,n.useState)(new Set),ea=(0,n.useRef)({}),ec=(0,n.useRef)(null),ed=(0,n.useRef)(null),eu=(0,n.useRef)(null),[ef,ep]=(0,n.useState)(!1),eh=(0,n.useRef)(null),{conversations:eg,activeConversation:ex,storageUnavailable:em,staleId:ey,createConversation:eb,appendMessage:ev,updateLastAssistantMessage:ek,truncateFromMessage:ej,deleteConversation:eS,renameConversation:ew}=function(e){let[t,r]=(0,n.useState)([]),[i,l]=(0,n.useState)(!1),[o,s]=(0,n.useState)(!1),[a,c]=(0,n.useState)(e),d=(0,n.useRef)(!1),u=(0,n.useRef)(!1);(0,n.useEffect)(()=>{c(e),s(!1)},[e]),(0,n.useEffect)(()=>{let{conversations:t,storageUnavailable:n}=function(){try{let e=localStorage.getItem(e0);if(!e)return{conversations:[],storageUnavailable:!1};return{conversations:JSON.parse(e),storageUnavailable:!1}}catch{return{conversations:[],storageUnavailable:!0}}}();d.current=n,r(t),l(n),u.current=!0,null!==e&&(t.some(t=>t.id===e)||s(!0))},[]),(0,n.useEffect)(()=>{!u.current||d.current||!function(e){try{return localStorage.setItem(e0,JSON.stringify(e)),!0}catch{return!1}}(t)&&(d.current=!0,l(!0))},[t]);let f=(0,n.useCallback)(e=>{let t=crypto.randomUUID(),n=Date.now(),i={id:t,title:"New conversation",model:e,messages:[],mcpServerNames:[],createdAt:n,updatedAt:n};return r(e=>e1([i,...e])),c(t),t},[]),p=(0,n.useCallback)((e,t)=>{let n={...t,id:crypto.randomUUID(),timestamp:Date.now()};r(t=>e1(t.map(t=>{let r;if(t.id!==e)return t;let i=[...t.messages,n],l=t.title;return"New conversation"===l&&"user"===n.role&&0===t.messages.filter(e=>"user"===e.role).length&&(l=(r=n.content.trim()).length<=40?r:r.slice(0,40)+"…"),{...t,title:l,messages:i,updatedAt:Date.now()}})))},[]),h=(0,n.useCallback)((e,t)=>{r(n=>e1(n.map(n=>{if(n.id!==e)return n;let r=[...n.messages],i=r.reduceRight((e,t,n)=>-1!==e?e:"assistant"===t.role?n:-1,-1);return -1===i?n:(r[i]={...r[i],...t},{...n,messages:r,updatedAt:Date.now()})})))},[]),g=(0,n.useCallback)((e,t)=>{r(n=>e1(n.map(n=>{if(n.id!==e)return n;let r=n.messages.findIndex(e=>e.id===t);return -1===r?n:{...n,messages:n.messages.slice(0,r),updatedAt:Date.now()}})))},[]),x=(0,n.useCallback)(e=>{r(t=>e1(t.filter(t=>t.id!==e))),a===e&&c(null)},[a]),m=(0,n.useCallback)((e,t)=>{r(n=>e1(n.map(n=>n.id===e?{...n,title:t,updatedAt:Date.now()}:n)))},[]),y=(0,n.useCallback)(e=>{c(e),s(!1)},[]),b=null!==a?t.find(e=>e.id===a)??null:null;return{conversations:t,activeConversation:b,storageUnavailable:i,staleId:o,createConversation:f,appendMessage:p,updateLastAssistantMessage:h,truncateFromMessage:g,deleteConversation:x,renameConversation:m,setActiveConversationId:y}}(E);(0,n.useEffect)(()=>{if(Q&&1){let e=new URL(window.location.href);e.searchParams.delete("mcpOauthReturn"),window.history.replaceState({},"",e.toString())}},[]),(0,n.useEffect)(()=>{e&&(F(!0),(0,nt.fetchAvailableModels)(e).then(e=>{let t=(e||[]).map(e=>e.model_group??"").filter(Boolean);D(t);try{let e=localStorage.getItem(ns);if(e){let n=JSON.parse(e);if(Array.isArray(n)){let e=n.filter(e=>t.includes(e));if(e.length>0)return void R(e)}}}catch{}t.length>0&&(R([t[0]]),localStorage.setItem(ns,JSON.stringify([t[0]])))}).catch(()=>a.default.error("Could not load models")).finally(()=>F(!1)))},[e]),(0,n.useEffect)(()=>{ey&&C.replace(nc(O))},[ey,C]),(0,n.useEffect)(()=>{U(null)},[E]);let eC=(0,n.useCallback)(e=>{R(t=>{let n;if(t.includes(e))n=t.filter(t=>t!==e);else{if(t.length>=3)return t;n=[...t,e]}return localStorage.setItem(ns,JSON.stringify(n)),n})},[]),ez=M.length>1,eE=Y||eo.size>0,eT=(0,n.useCallback)(async(t,n)=>{let r=t.trim();if(!r||0===M.length||Y)return;let i=M[0];G("");let l=E;l||(l=eb(i),U(null),C.push(nc(O,l))),ev(l,{role:"user",content:r}),ev(l,{role:"assistant",content:""}),q(!0),ec.current=new AbortController,n&&U(null);let o=n?null:H,s=n?[...n,{role:"user",content:r}]:o?[{role:"user",content:r}]:[...(ex?.messages??[]).filter(e=>"user"===e.role||"assistant"===e.role).map(e=>({role:e.role,content:e.content})),{role:"user",content:r}],a="",c="",d=[],u=!1;try{await (0,nr.makeOpenAIResponsesRequest)(s,(e,t)=>{a+=t,ek(l,{content:a})},i,e,void 0,ec.current.signal,e=>{c+=e,ek(l,{reasoningContent:c})},void 0,void 0,void 0,void 0,void 0,void 0,N.length>0?N:void 0,o,e=>U(e),e=>{d.push(e)}),u=!0}catch(e){e instanceof Error&&"AbortError"===e.name?ek(l,{content:a+" [stopped]"}):ek(l,{content:"[Something went wrong. The partial response has been saved.]"})}finally{d.length>0&&u&&ek(l,{mcpEvents:d}),q(!1),ec.current=null}},[E,ex,M,N,e,eb,ev,ek,C,Y,H]),eO=(0,n.useCallback)((t,n)=>{let r=t.trim();if(!r||0===M.length||eE)return;G("");let i={userMessage:r,responses:{}},l=n.length;el(e=>[...e,i]),es(new Set(M));let o={};M.forEach(e=>{o[e]=new AbortController}),ea.current=o,Promise.allSettled(M.map(t=>{let i=[];for(let e of n)i.push({role:"user",content:e.userMessage}),i.push({role:"assistant",content:e.responses[t]??""});return i.push({role:"user",content:r}),nu(t,i,e,N,o[t].signal,(e,t)=>el(n=>{let r=[...n],i={...r[l]};return i.responses={...i.responses,[e]:(i.responses[e]??"")+t},r[l]=i,r}),e=>es(t=>{let n=new Set(t);return n.delete(e),n}))}))},[M,e,N,eE]),eA=(0,n.useCallback)(()=>{ec.current?.abort(),Object.values(ea.current).forEach(e=>e.abort()),ea.current={}},[]),eM=(0,n.useCallback)((e,t)=>{if(!E||Y)return;let n=ex?.messages??[],r=n.findIndex(t=>t.id===e),i=(-1===r?n:n.slice(0,r)).filter(e=>"user"===e.role||"assistant"===e.role).map(e=>({role:e.role,content:e.content}));ej(E,e),eT(t,i)},[E,Y,ex,ej,eT]),eR=(0,n.useCallback)(e=>{ez?eO(e,ei):eT(e)},[ez,eT,eO,ei]),eL=e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),eR(K))};(0,n.useEffect)(()=>{let e=ed.current;e&&(e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,180)}px`)},[K]),(0,n.useEffect)(()=>{let e=eu.current;if(!e)return;let t=()=>{ep(e.scrollHeight-e.scrollTop-e.clientHeight>120),null!==eh.current&&(eh.current=e.scrollTop)};return e.addEventListener("scroll",t,{passive:!0}),()=>e.removeEventListener("scroll",t)},[ex]),(0,n.useEffect)(()=>{let e=eu.current;Y?eh.current=e?.scrollTop??0:eh.current=null},[Y]),(0,n.useLayoutEffect)(()=>{if(null===eh.current)return;let e=eu.current;e&&(e.scrollTop=eh.current)});let eD=(0,n.useRef)(0);(0,n.useLayoutEffect)(()=>{let e=ex?.messages?.length??0,t=eD.current;if(eD.current=e,e>t){let e=eu.current;e&&(e.scrollTop=e.scrollHeight)}},[ex?.messages]);let eI=ez?0===ei.length:!ex||0===ex.messages.length,eF=S?.split("@")[0]??j??"",e_=eF?`${na()}, ${eF}`:na(),eW=(w=(i.default.env.NEXT_PUBLIC_BASE_URL??"").replace(/^\/+|\/+$/g,""))?`${O}/${w}/`:`${O}/`,e$=($?L.filter(e=>e.toLowerCase().includes($.toLowerCase())):L).sort((e,t)=>{let n=M.includes(e),r=M.includes(t);return n&&!r?-1:!n&&r?1:0}),eP=(0,t.jsxs)("div",{style:{width:280,maxHeight:400,display:"flex",flexDirection:"column"},children:[(0,t.jsx)("div",{style:{padding:"8px 8px 4px"},children:(0,t.jsx)("input",{autoFocus:!0,value:$,onChange:e=>P(e.target.value),placeholder:"Search models...",style:{width:"100%",padding:"6px 10px",border:"1px solid #d1d5db",borderRadius:6,fontSize:13,outline:"none",boxSizing:"border-box"}})}),M.length>=3&&(0,t.jsxs)("div",{style:{padding:"4px 12px",fontSize:12,color:"#6b7280"},children:["Max ",3," models selected — deselect one to change."]}),(0,t.jsx)("div",{style:{flex:1,overflowY:"auto"},children:e$.map(e=>{let n=M.includes(e),r=!n&&M.length>=3,i=nd(e),{logo:l}=i?(0,nl.getProviderLogoAndName)(i):{logo:""};return(0,t.jsxs)("button",{disabled:r,onClick:()=>eC(e),style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"7px 12px",background:n?"#eff6ff":"transparent",border:"none",cursor:r?"not-allowed":"pointer",textAlign:"left",opacity:r?.45:1,borderRadius:4},children:[(0,t.jsx)("span",{style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${n?"#1677ff":"#d1d5db"}`,background:n?"#1677ff":"#fff",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"all 0.1s"},children:n&&(0,t.jsx)(v.CheckOutlined,{style:{fontSize:10,color:"#fff"}})}),l?(0,t.jsx)("img",{src:l,alt:"",style:{width:16,height:16,objectFit:"contain",flexShrink:0},onError:e=>{e.currentTarget.style.display="none"}}):(0,t.jsx)("span",{style:{width:16,flexShrink:0}}),(0,t.jsx)("span",{style:{fontSize:13,color:"#111827",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e})]},e)})})]}),eN=(e,n,r,i=!1,o)=>(0,t.jsx)(l.Tooltip,{title:X?n:void 0,placement:"right",children:(0,t.jsxs)("button",{onClick:r,style:{display:"flex",alignItems:"center",gap:10,padding:"8px 10px",width:"100%",borderRadius:7,border:"none",cursor:"pointer",background:i?"#e8f4ff":"transparent",color:i?"#1677ff":"#374151",textAlign:"left",fontSize:14,justifyContent:X?"center":"flex-start",transition:"background 0.12s"},onMouseEnter:e=>{i||(e.currentTarget.style.background="#f5f5f5")},onMouseLeave:e=>{e.currentTarget.style.background=i?"#e8f4ff":"transparent"},children:[(0,t.jsx)("span",{style:{fontSize:16,flexShrink:0},children:e}),!X&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{style:{flex:1},children:n}),o&&(0,t.jsx)("span",{style:{fontSize:11,color:"#9ca3af"},children:o})]})]})},n),eB=I?(0,t.jsx)(o.Skeleton.Input,{active:!0,style:{width:160,height:28}}):(0,t.jsx)(s.Popover,{open:_,onOpenChange:e=>{W(e),e||P("")},content:eP,trigger:"click",placement:"bottomLeft",children:(0,t.jsxs)("button",{style:{display:"flex",alignItems:"center",gap:6,padding:"5px 10px",borderRadius:7,border:"1px solid transparent",cursor:"pointer",background:"transparent",color:"#111827",fontSize:14,fontWeight:500,maxWidth:480,overflow:"hidden"},onMouseEnter:e=>{e.currentTarget.style.background="#f5f5f5"},onMouseLeave:e=>{e.currentTarget.style.background="transparent"},children:[0===M.length?(0,t.jsx)("span",{style:{color:"#9ca3af"},children:"Select model"}):1===M.length?(0,t.jsxs)(t.Fragment,{children:[(()=>{let e=nd(M[0]),{logo:n}=e?(0,nl.getProviderLogoAndName)(e):{logo:""};return n?(0,t.jsx)("img",{src:n,alt:"",style:{width:18,height:18,objectFit:"contain",flexShrink:0},onError:e=>{e.currentTarget.style.display="none"}}):null})(),(0,t.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:240},children:M[0]})]}):(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",gap:4,flexWrap:"nowrap",overflow:"hidden"},children:M.map(e=>{let n=nd(e),{logo:r}=n?(0,nl.getProviderLogoAndName)(n):{logo:""};return(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",background:"#f0f4ff",borderRadius:10,fontSize:12,color:"#1677ff",fontWeight:500,flexShrink:0},children:[r&&(0,t.jsx)("img",{src:r,alt:"",style:{width:13,height:13,objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,t.jsx)("span",{style:{maxWidth:120,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e})]},e)})}),(0,t.jsx)(b.DownOutlined,{style:{fontSize:10,color:"#9ca3af",flexShrink:0,marginLeft:2}})]})}),eH=n=>(0,t.jsxs)("div",{style:{background:"#fff",borderRadius:12,border:"1px solid #e5e7eb",boxShadow:"0 1px 6px rgba(0,0,0,0.06)",overflow:"hidden"},children:[(0,t.jsx)("textarea",{ref:ed,value:K,onChange:e=>G(e.target.value),onKeyDown:eL,placeholder:n?"Send a message...":"How can I help you today?",style:{width:"100%",minHeight:n?52:80,padding:n?"16px 20px 8px":"20px 20px 8px",border:"none",outline:"none",resize:"none",fontSize:15,color:"#111827",background:"transparent",fontFamily:"inherit",boxSizing:"border-box"}}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:n?"4px 12px 10px":"8px 12px 12px",borderTop:"1px solid #f3f4f6"},children:[(0,t.jsx)(s.Popover,{open:V,onOpenChange:J,content:(0,t.jsx)(tK,{accessToken:e,selectedServers:N,onChange:B}),trigger:"click",placement:"topLeft",children:(0,t.jsxs)("button",{style:{background:"none",border:"1px solid #d1d5db",borderRadius:6,padding:"5px 10px",cursor:"pointer",fontSize:14,color:"#6b7280",display:"flex",alignItems:"center",gap:4},children:[(0,t.jsx)(d.PlusOutlined,{}),N.length>0&&(0,t.jsx)("span",{style:{fontSize:12,color:"#1677ff",fontWeight:500},children:N.length})]})}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[!ez&&(0,t.jsx)("span",{style:{fontSize:12,color:"#9ca3af",maxWidth:160,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n?N.length>0?`${N.length} tool${N.length>1?"s":""} connected`:"":M[0]||"No model"}),eE?(0,t.jsx)("button",{onClick:eA,style:{background:"none",border:"1.5px solid #d1d5db",borderRadius:"50%",width:32,height:32,cursor:"pointer",color:"#374151",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"border-color 0.15s"},onMouseEnter:e=>{e.currentTarget.style.borderColor="#9ca3af"},onMouseLeave:e=>{e.currentTarget.style.borderColor="#d1d5db"},children:(0,t.jsx)("div",{style:{width:10,height:10,background:"#374151",borderRadius:2}})}):(0,t.jsx)("button",{onClick:()=>eR(K),disabled:!K.trim()||I||0===M.length,style:{background:K.trim()&&M.length>0?"#1677ff":"#f3f4f6",border:"none",borderRadius:7,padding:"7px 16px",cursor:K.trim()&&M.length>0?"pointer":"not-allowed",color:K.trim()&&M.length>0?"#fff":"#9ca3af",fontSize:14,fontWeight:500,transition:"background 0.15s"},children:"Send"})]})]})]});return(0,t.jsxs)("div",{style:{display:"flex",height:"100vh",width:"100vw",background:"#ffffff",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{width:X?56:260,flexShrink:0,background:"#f9fafb",borderRight:"1px solid #e5e7eb",display:"flex",flexDirection:"column",overflow:"hidden",transition:"width 0.2s cubic-bezier(0.4, 0, 0.2, 1)"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",padding:"12px 10px",justifyContent:X?"center":"space-between",flexShrink:0},children:[!X&&(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,t.jsx)("img",{src:A,alt:"LiteLLM",style:{height:28,maxWidth:120,objectFit:"contain",flexShrink:0}}),(0,t.jsx)("span",{style:{fontWeight:700,fontSize:15,color:"#111827",letterSpacing:"-0.01em"},children:"LiteLLM"})]}),(0,t.jsx)(l.Tooltip,{title:X?"Expand sidebar":"Collapse sidebar",placement:"right",children:(0,t.jsx)("button",{onClick:()=>Z(e=>!e),style:{background:"none",border:"none",cursor:"pointer",padding:6,borderRadius:7,color:"#6b7280",fontSize:16,display:"flex",alignItems:"center"},children:X?(0,t.jsx)(p.MenuUnfoldOutlined,{}):(0,t.jsx)(f.MenuFoldOutlined,{})})})]}),(0,t.jsxs)("div",{style:{padding:"0 8px 4px",flexShrink:0},children:[eN((0,t.jsx)(u.EditOutlined,{}),"New chat",()=>C.push(nc(O))),eN((0,t.jsx)(h.SearchOutlined,{}),"Search chats",()=>et("chats"))]}),(0,t.jsx)("div",{style:{height:1,background:"#e5e7eb",margin:"4px 8px",flexShrink:0}}),(0,t.jsxs)("div",{style:{padding:"4px 8px",flexShrink:0},children:[eN((0,t.jsx)(g.MessageOutlined,{}),"Chats",()=>et("chats"),"chats"===ee),eN((0,t.jsx)(x.AppstoreOutlined,{}),"Apps",()=>et("apps"),"apps"===ee),eN((0,t.jsx)(m.KeyOutlined,{}),"Credentials",()=>et("credentials"),"credentials"===ee),(0,t.jsx)(l.Tooltip,{title:X?"Back to Developer Console UI":void 0,placement:"right",children:(0,t.jsxs)("a",{href:eW,style:{display:"flex",alignItems:"center",gap:10,padding:"8px 10px",width:"100%",borderRadius:7,color:"#6b7280",textDecoration:"none",fontSize:14,justifyContent:X?"center":"flex-start",boxSizing:"border-box"},onMouseEnter:e=>{e.currentTarget.style.background="#f5f5f5"},onMouseLeave:e=>{e.currentTarget.style.background="transparent"},children:[(0,t.jsx)(y.ArrowLeftOutlined,{style:{fontSize:16,flexShrink:0}}),!X&&(0,t.jsx)("span",{children:"Back to Developer Console UI"})]})})]}),(0,t.jsx)("div",{style:{height:1,background:"#e5e7eb",margin:"4px 8px",flexShrink:0}}),!X&&"chats"===ee&&(0,t.jsx)("div",{style:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column"},children:(0,t.jsx)(tC,{conversations:eg,activeConversationId:E,onSelect:e=>C.push(nc(O,e)),onDelete:eS,onNewChat:()=>C.push(nc(O)),onRename:ew})})]}),(0,t.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",minWidth:0},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",flexShrink:0,borderBottom:"1px solid #f0f0f0",background:"#fff",height:48},children:[(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0,flex:1},children:eB}),(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0},children:(0,t.jsx)(l.Tooltip,{title:"Settings",children:(0,t.jsx)("button",{style:{background:"none",border:"none",cursor:"pointer",padding:7,borderRadius:7,color:"#6b7280",fontSize:16,display:"flex",alignItems:"center"},children:(0,t.jsx)(c.SettingOutlined,{})})})})]}),em&&!en&&(0,t.jsxs)("div",{style:{background:"#fffbe6",borderBottom:"1px solid #ffe58f",padding:"6px 20px",fontSize:13,color:"#874d00",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,t.jsx)("span",{children:"Chat history won't be saved in this browser session."}),(0,t.jsx)("button",{onClick:()=>er(!0),style:{background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#874d00"},children:"×"})]}),(0,t.jsx)("div",{style:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column",background:"#fff"},children:"apps"===ee?(0,t.jsx)("div",{style:{flex:1,minHeight:0,overflow:"auto",maxWidth:800,margin:"0 auto",width:"100%",padding:"32px 24px"},children:(0,t.jsx)(t1,{accessToken:e,selectedServers:N,onChange:B})}):"credentials"===ee?(0,t.jsx)("div",{style:{flex:1,minHeight:0,overflow:"auto",maxWidth:800,margin:"0 auto",width:"100%",padding:"32px 24px"},children:(0,t.jsx)(ne,{accessToken:e})}):eI?(0,t.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"0 24px 80px"},children:[(0,t.jsx)("h1",{style:{margin:"0 0 32px",fontSize:28,fontWeight:600,color:"#111827",fontFamily:"inherit",letterSpacing:"-0.01em",textAlign:"center"},children:ez?`Compare ${M.length} models`:e_}),ez?(0,t.jsx)("p",{style:{margin:"-16px 0 24px",fontSize:14,color:"#6b7280",textAlign:"center"},children:"Send a message to see responses side-by-side"}):(0,t.jsxs)("p",{style:{margin:"-16px 0 28px",fontSize:14,color:"#6b7280",textAlign:"center",maxWidth:520,lineHeight:1.6},children:["Chat with 100+ LLMs + MCP tools — authenticate once, use them here."," ",(0,t.jsx)("button",{onClick:()=>et("apps"),style:{background:"none",border:"none",cursor:"pointer",color:"#1677ff",fontSize:14,padding:0,fontWeight:500},children:"Open Apps →"})]}),(0,t.jsx)("div",{style:{width:"100%",maxWidth:680},children:eH(!1)}),!ez&&(0,t.jsx)("div",{style:{display:"flex",gap:8,marginTop:14,flexWrap:"wrap",justifyContent:"center"},children:no.map(e=>(0,t.jsx)("button",{onClick:()=>G(e+": "),style:{background:"#f9fafb",border:"1px solid #e5e7eb",borderRadius:20,padding:"7px 16px",fontSize:14,color:"#374151",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.background="#f3f4f6"},onMouseLeave:e=>{e.currentTarget.style.background="#f9fafb"},children:e},e))})]}):(0,t.jsxs)("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",maxWidth:ez?M.length>=3?1200:960:760,margin:"0 auto",width:"100%",padding:"0 24px",position:"relative"},children:[(0,t.jsx)("div",{ref:eu,style:{flex:1,minHeight:0,overflow:"auto",paddingTop:24,overflowAnchor:"none"},children:ez?(0,t.jsx)("div",{style:{paddingBottom:8},children:ei.map((e,n)=>{let r=n===ei.length-1;return(0,t.jsxs)("div",{style:{marginBottom:32},children:[(0,t.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:20},children:(0,t.jsx)("div",{style:{background:"#f3f4f6",borderRadius:16,padding:"10px 16px",maxWidth:"75%",fontSize:14,color:"#111827",lineHeight:1.5},children:e.userMessage})}),(0,t.jsx)("div",{style:{display:"flex",gap:14,alignItems:"flex-start"},children:M.map((i,l)=>{let o=nd(i),{logo:s}=o?(0,nl.getProviderLogoAndName)(o):{logo:""},a=e.responses[i]??"",c=r&&eo.has(i);return(0,t.jsxs)("div",{style:{flex:1,border:"1px solid #e5e7eb",borderRadius:12,overflow:"hidden",minWidth:0},children:[0===n&&(0,t.jsxs)("div",{style:{padding:"10px 14px",borderBottom:"1px solid #f0f0f0",display:"flex",alignItems:"center",gap:8,background:"#fafafa"},children:[s?(0,t.jsx)("img",{src:s,alt:"",style:{width:18,height:18,objectFit:"contain",flexShrink:0},onError:e=>{e.currentTarget.style.display="none"}}):(0,t.jsx)("div",{style:{width:18,height:18,borderRadius:"50%",background:"#e5e7eb",flexShrink:0}}),(0,t.jsxs)("span",{style:{fontWeight:600,fontSize:12,color:"#374151"},children:["Response ",l+1]}),(0,t.jsx)("span",{style:{fontSize:11,color:"#9ca3af",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0},children:i})]}),(0,t.jsxs)("div",{style:{padding:"14px 16px",minHeight:60,position:"relative"},children:[c&&(0,t.jsx)("span",{style:{position:"absolute",top:10,right:12,fontSize:9,color:"#1677ff"},children:"●"}),a?(0,t.jsx)(k.default,{remarkPlugins:[eZ],components:{p:({children:e})=>(0,t.jsx)("p",{style:{margin:"0 0 10px",lineHeight:1.6,fontSize:14,color:"#111827"},children:e}),code:({className:e,children:n})=>/language-(\w+)/.exec(e||"")?(0,t.jsx)("pre",{style:{background:"#f8f9fa",padding:"10px 12px",borderRadius:6,overflow:"auto",fontSize:13,margin:"8px 0"},children:(0,t.jsx)("code",{children:n})}):(0,t.jsx)("code",{style:{background:"#f3f4f6",padding:"2px 5px",borderRadius:3,fontSize:13},children:n})},children:a}):c?(0,t.jsx)("span",{style:{color:"#9ca3af",fontSize:14},children:"Generating…"}):(0,t.jsx)("span",{style:{color:"#9ca3af",fontSize:14},children:"—"})]})]},i)})})]},n)})}):(0,t.jsx)(tH,{messages:ex.messages,isStreaming:Y,onEditMessage:eM})}),ef&&(0,t.jsx)("button",{onClick:()=>{let e=eu.current;e&&(e.scrollTo({top:e.scrollHeight,behavior:"smooth"}),null!==eh.current&&(eh.current=e.scrollHeight))},style:{position:"absolute",bottom:100,left:"50%",transform:"translateX(-50%)",width:34,height:34,borderRadius:"50%",background:"rgba(255,255,255,0.75)",backdropFilter:"blur(6px)",WebkitBackdropFilter:"blur(6px)",border:"1px solid rgba(0,0,0,0.1)",boxShadow:"0 1px 4px rgba(0,0,0,0.08)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#6b7280",zIndex:10,transition:"background 0.15s"},onMouseEnter:e=>{e.currentTarget.style.background="rgba(255,255,255,0.95)"},onMouseLeave:e=>{e.currentTarget.style.background="rgba(255,255,255,0.75)"},"aria-label":"Scroll to bottom",children:(0,t.jsx)(b.DownOutlined,{style:{fontSize:12}})}),(0,t.jsx)("div",{style:{padding:"12px 0 24px"},children:eH(!0)})]})})]})]})},np=()=>{let{accessToken:e,userRole:n,userId:i,userEmail:l}=(0,r.default)();return(0,t.jsx)(nf,{accessToken:e??"",userRole:n??"",userId:i??"",userEmail:l??""})};e.s(["default",0,()=>(0,t.jsx)(n.Suspense,{children:(0,t.jsx)(np,{})})],321443)}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/25c705f79a0254af.js b/litellm/proxy/_experimental/out/_next/static/chunks/39f15eb671ac68ef.js similarity index 93% rename from litellm/proxy/_experimental/out/_next/static/chunks/25c705f79a0254af.js rename to litellm/proxy/_experimental/out/_next/static/chunks/39f15eb671ac68ef.js index c572c3d34830..e184cf9c01b4 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/25c705f79a0254af.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/39f15eb671ac68ef.js @@ -140,4 +140,4 @@ ${i}${l}topRight `]:{animationName:T},"&-hidden":{display:"none"},[n]:Object.assign(Object.assign({},I(e)),{cursor:"pointer",transition:`background ${e.motionDurationSlow} ease`,borderRadius:e.borderRadiusSM,"&-group":{color:e.colorTextDescription,fontSize:e.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},m.textEllipsis),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${n}-option-disabled)`]:{backgroundColor:e.optionActiveBg},[`&-selected:not(${n}-option-disabled)`]:{color:e.optionSelectedColor,fontWeight:e.optionSelectedFontWeight,backgroundColor:e.optionSelectedBg,[`${n}-option-state`]:{color:e.colorPrimary}},"&-disabled":{[`&${n}-option-selected`]:{backgroundColor:e.colorBgContainerDisabled},color:e.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:e.calc(e.controlPaddingHorizontal).mul(2).equal()}},"&-empty":Object.assign(Object.assign({},I(e)),{color:e.colorTextDisabled})}),[`${s}:has(+ ${s})`]:{borderEndStartRadius:0,borderEndEndRadius:0,[`& + ${s}`]:{borderStartStartRadius:0,borderStartEndRadius:0}},"&-rtl":{direction:"rtl"}})},P(e,"slide-up"),P(e,"slide-down"),E(e,"move-up"),E(e,"move-down")]})(e),{[`${t}-rtl`]:{direction:"rtl"}},(0,g.genCompactItemStyle)(e,{borderElCls:`${t}-selector`,focusElCls:`${t}-focused`})]})(r),{[r.componentCls]:Object.assign(Object.assign(Object.assign(Object.assign({},{"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign({},M(r,{borderColor:r.colorBorder,hoverBorderHover:r.hoverBorderColor,activeBorderColor:r.activeBorderColor,activeOutlineColor:r.activeOutlineColor,color:r.colorText})),A(r,{status:"error",borderColor:r.colorError,hoverBorderHover:r.colorErrorHover,activeBorderColor:r.colorError,activeOutlineColor:r.colorErrorOutline,color:r.colorError})),A(r,{status:"warning",borderColor:r.colorWarning,hoverBorderHover:r.colorWarningHover,activeBorderColor:r.colorWarning,activeOutlineColor:r.colorWarningOutline,color:r.colorWarning})),{[`&${r.componentCls}-disabled`]:{[`&:not(${r.componentCls}-customize-input) ${r.componentCls}-selector`]:{background:r.colorBgContainerDisabled,color:r.colorTextDisabled}},[`&${r.componentCls}-multiple ${r.componentCls}-selection-item`]:{background:r.multipleItemBg,border:`${(0,F.unit)(r.lineWidth)} ${r.lineType} ${r.multipleItemBorderColor}`}})}),{"&-filled":Object.assign(Object.assign(Object.assign(Object.assign({},B(r,{bg:r.colorFillTertiary,hoverBg:r.colorFillSecondary,activeBorderColor:r.activeBorderColor,color:r.colorText})),z(r,{status:"error",bg:r.colorErrorBg,hoverBg:r.colorErrorBgHover,activeBorderColor:r.colorError,color:r.colorError})),z(r,{status:"warning",bg:r.colorWarningBg,hoverBg:r.colorWarningBgHover,activeBorderColor:r.colorWarning,color:r.colorWarning})),{[`&${r.componentCls}-disabled`]:{[`&:not(${r.componentCls}-customize-input) ${r.componentCls}-selector`]:{borderColor:r.colorBorder,background:r.colorBgContainerDisabled,color:r.colorTextDisabled}},[`&${r.componentCls}-multiple ${r.componentCls}-selection-item`]:{background:r.colorBgContainer,border:`${(0,F.unit)(r.lineWidth)} ${r.lineType} ${r.colorSplit}`}})}),{"&-borderless":{[`${r.componentCls}-selector`]:{background:"transparent",border:`${(0,F.unit)(r.lineWidth)} ${r.lineType} transparent`},[`&${r.componentCls}-disabled`]:{[`&:not(${r.componentCls}-customize-input) ${r.componentCls}-selector`]:{color:r.colorTextDisabled}},[`&${r.componentCls}-multiple ${r.componentCls}-selection-item`]:{background:r.multipleItemBg,border:`${(0,F.unit)(r.lineWidth)} ${r.lineType} ${r.multipleItemBorderColor}`},[`&${r.componentCls}-status-error`]:{[`${r.componentCls}-prefix, ${r.componentCls}-selection-item`]:{color:r.colorError}},[`&${r.componentCls}-status-warning`]:{[`${r.componentCls}-prefix, ${r.componentCls}-selection-item`]:{color:r.colorWarning}}}}),{"&-underlined":Object.assign(Object.assign(Object.assign(Object.assign({},L(r,{borderColor:r.colorBorder,hoverBorderHover:r.hoverBorderColor,activeBorderColor:r.activeBorderColor,activeOutlineColor:r.activeOutlineColor,color:r.colorText})),H(r,{status:"error",borderColor:r.colorError,hoverBorderHover:r.colorErrorHover,activeBorderColor:r.colorError,activeOutlineColor:r.colorErrorOutline,color:r.colorError})),H(r,{status:"warning",borderColor:r.colorWarning,hoverBorderHover:r.colorWarningHover,activeBorderColor:r.colorWarning,activeOutlineColor:r.colorWarningOutline,color:r.colorWarning})),{[`&${r.componentCls}-disabled`]:{[`&:not(${r.componentCls}-customize-input) ${r.componentCls}-selector`]:{color:r.colorTextDisabled}},[`&${r.componentCls}-multiple ${r.componentCls}-selection-item`]:{background:r.multipleItemBg,border:`${(0,F.unit)(r.lineWidth)} ${r.lineType} ${r.multipleItemBorderColor}`}})})}]},e=>{let{fontSize:t,lineHeight:r,lineWidth:n,controlHeight:o,controlHeightSM:a,controlHeightLG:i,paddingXXS:l,controlPaddingHorizontal:s,zIndexPopupBase:c,colorText:u,fontWeightStrong:d,controlItemBgActive:f,controlItemBgHover:p,colorBgContainer:m,colorFillSecondary:g,colorBgContainerDisabled:h,colorTextDisabled:v,colorPrimaryHover:y,colorPrimary:b,controlOutline:w}=e,C=2*l,x=2*n,S=Math.min(o-C,o-x),$=Math.min(a-C,a-x),E=Math.min(i-C,i-x);return{INTERNAL_FIXED_ITEM_MARGIN:Math.floor(l/2),zIndexPopup:c+50,optionSelectedColor:u,optionSelectedFontWeight:d,optionSelectedBg:f,optionActiveBg:p,optionPadding:`${(o-t*r)/2}px ${s}px`,optionFontSize:t,optionLineHeight:r,optionHeight:o,selectorBg:m,clearBg:m,singleItemHeightLG:i,multipleItemBg:g,multipleItemBorderColor:"transparent",multipleItemHeight:S,multipleItemHeightSM:$,multipleItemHeightLG:E,multipleSelectorBgDisabled:h,multipleItemColorDisabled:v,multipleItemBorderColorDisabled:"transparent",showArrowPaddingInlineEnd:Math.ceil(1.25*e.fontSize),hoverBorderColor:y,activeBorderColor:b,activeOutlineColor:w,selectAffixPadding:l}},{unitless:{optionLineHeight:!0,optionSelectedFontWeight:!0}});e.s(["default",0,D],950302)},121229,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"};var o=e.i(9583),a=r.forwardRef(function(e,a){return r.createElement(o.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["default",0,a],121229)},199133,327494,e=>{"use strict";e.i(247167);var t=e.i(271645),r=e.i(343794),n=e.i(123829),o=e.i(955492),a=e.i(869301),i=e.i(529681),l=e.i(122767),s=e.i(613541),c=e.i(805484),u=e.i(52956),d=e.i(242064),f=e.i(721132),p=e.i(937328),m=e.i(321883),g=e.i(517455),h=e.i(62139),v=e.i(792812),y=e.i(249616),b=e.i(104458),w=e.i(85566),C=e.i(950302),x=e.i(121229),S=e.i(726289),$=e.i(864517),E=e.i(247153),k=e.i(739295),O=e.i(38953),j=e.i(617206),T=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let _="SECRET_COMBOBOX_MODE_DO_NOT_USE",P=t.forwardRef((e,o)=>{var a,c,P,I,F,N,R,M;let A,{prefixCls:B,bordered:z,className:L,rootClassName:H,getPopupContainer:D,popupClassName:V,dropdownClassName:W,listHeight:U=256,placement:G,listItemHeight:q,size:K,disabled:X,notFoundContent:J,status:Y,builtinPlacements:Q,dropdownMatchSelectWidth:Z,popupMatchSelectWidth:ee,direction:et,style:er,allowClear:en,variant:eo,dropdownStyle:ea,transitionName:ei,tagRender:el,maxCount:es,prefix:ec,dropdownRender:eu,popupRender:ed,onDropdownVisibleChange:ef,onOpenChange:ep,styles:em,classNames:eg}=e,eh=T(e,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear","variant","dropdownStyle","transitionName","tagRender","maxCount","prefix","dropdownRender","popupRender","onDropdownVisibleChange","onOpenChange","styles","classNames"]),{getPopupContainer:ev,getPrefixCls:ey,renderEmpty:eb,direction:ew,virtual:eC,popupMatchSelectWidth:ex,popupOverflow:eS}=t.useContext(d.ConfigContext),{showSearch:e$,style:eE,styles:ek,className:eO,classNames:ej}=(0,d.useComponentConfig)("select"),[,eT]=(0,b.useToken)(),e_=null!=q?q:null==eT?void 0:eT.controlHeight,eP=ey("select",B),eI=ey(),eF=null!=et?et:ew,{compactSize:eN,compactItemClassnames:eR}=(0,y.useCompactItemContext)(eP,eF),[eM,eA]=(0,v.default)("select",eo,z),eB=(0,m.default)(eP),[ez,eL,eH]=(0,C.default)(eP,eB),eD=t.useMemo(()=>{let{mode:t}=e;if("combobox"!==t)return t===_?"combobox":t},[e.mode]),eV="multiple"===eD||"tags"===eD,eW=(N=e.suffixIcon,void 0!==(R=e.showArrow)?R:null!==N),eU=null!=(a=null!=ee?ee:Z)?a:ex,eG=(null==(c=null==em?void 0:em.popup)?void 0:c.root)||(null==(P=ek.popup)?void 0:P.root)||ea,eq=(M=ed||eu,t.default.useMemo(()=>{if(M)return(...e)=>t.default.createElement(j.default,{space:!0},M.apply(void 0,e))},[M])),{status:eK,hasFeedback:eX,isFormItemInput:eJ,feedbackIcon:eY}=t.useContext(h.FormItemInputContext),eQ=(0,u.getMergedStatus)(eK,Y);A=void 0!==J?J:"combobox"===eD?null:(null==eb?void 0:eb("Select"))||t.createElement(f.default,{componentName:"Select"});let{suffixIcon:eZ,itemIcon:e0,removeIcon:e1,clearIcon:e2}=function({suffixIcon:e,clearIcon:r,menuItemSelectedIcon:n,removeIcon:o,loading:a,multiple:i,hasFeedback:l,prefixCls:s,showSuffixIcon:c,feedbackIcon:u,showArrow:d,componentName:f}){let p=null!=r?r:t.createElement(S.default,null),m=r=>null!==e||l||d?t.createElement(t.Fragment,null,!1!==c&&r,l&&u):null,g=null;if(void 0!==e)g=m(e);else if(a)g=m(t.createElement(k.default,{spin:!0}));else{let e=`${s}-suffix`;g=({open:r,showSearch:n})=>r&&n?m(t.createElement(O.default,{className:e})):m(t.createElement(E.default,{className:e}))}let h=null;h=void 0!==n?n:i?t.createElement(x.default,null):null;return{clearIcon:p,suffixIcon:g,itemIcon:h,removeIcon:void 0!==o?o:t.createElement($.default,null)}}(Object.assign(Object.assign({},eh),{multiple:eV,hasFeedback:eX,feedbackIcon:eY,showSuffixIcon:eW,prefixCls:eP,componentName:"Select"})),e4=(0,i.default)(eh,["suffixIcon","itemIcon"]),e6=(0,r.default)((null==(I=null==eg?void 0:eg.popup)?void 0:I.root)||(null==(F=null==ej?void 0:ej.popup)?void 0:F.root)||V||W,{[`${eP}-dropdown-${eF}`]:"rtl"===eF},H,ej.root,null==eg?void 0:eg.root,eH,eB,eL),e5=(0,g.default)(e=>{var t;return null!=(t=null!=K?K:eN)?t:e}),e3=t.useContext(p.default),e7=(0,r.default)({[`${eP}-lg`]:"large"===e5,[`${eP}-sm`]:"small"===e5,[`${eP}-rtl`]:"rtl"===eF,[`${eP}-${eM}`]:eA,[`${eP}-in-form-item`]:eJ},(0,u.getStatusClassNames)(eP,eQ,eX),eR,eO,L,ej.root,null==eg?void 0:eg.root,H,eH,eB,eL),e8=t.useMemo(()=>void 0!==G?G:"rtl"===eF?"bottomRight":"bottomLeft",[G,eF]),[e9]=(0,l.useZIndex)("SelectLike",null==eG?void 0:eG.zIndex);return ez(t.createElement(n.default,Object.assign({ref:o,virtual:eC,showSearch:e$},e4,{style:Object.assign(Object.assign(Object.assign(Object.assign({},ek.root),null==em?void 0:em.root),eE),er),dropdownMatchSelectWidth:eU,transitionName:(0,s.getTransitionName)(eI,"slide-up",ei),builtinPlacements:(0,w.default)(Q,eS),listHeight:U,listItemHeight:e_,mode:eD,prefixCls:eP,placement:e8,direction:eF,prefix:ec,suffixIcon:eZ,menuItemSelectedIcon:e0,removeIcon:e1,allowClear:!0===en?{clearIcon:e2}:en,notFoundContent:A,className:e7,getPopupContainer:D||ev,dropdownClassName:e6,disabled:null!=X?X:e3,dropdownStyle:Object.assign(Object.assign({},eG),{zIndex:e9}),maxCount:eV?es:void 0,tagRender:eV?el:void 0,dropdownRender:eq,onDropdownVisibleChange:ep||ef})))}),I=(0,c.default)(P,"dropdownAlign");P.SECRET_COMBOBOX_MODE_DO_NOT_USE=_,P.Option=a.Option,P.OptGroup=o.OptGroup,P._InternalPanelDoNotUseOrYouWillBeFired=I,e.s(["default",0,P],327494),e.s(["Select",0,P],199133)},290571,e=>{"use strict";function t(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}"function"==typeof SuppressedError&&SuppressedError,e.s(["__rest",()=>t])},480731,e=>{"use strict";let t={Increase:"increase",ModerateIncrease:"moderateIncrease",Decrease:"decrease",ModerateDecrease:"moderateDecrease",Unchanged:"unchanged"},r={Slate:"slate",Gray:"gray",Zinc:"zinc",Neutral:"neutral",Stone:"stone",Red:"red",Orange:"orange",Amber:"amber",Yellow:"yellow",Lime:"lime",Green:"green",Emerald:"emerald",Teal:"teal",Cyan:"cyan",Sky:"sky",Blue:"blue",Indigo:"indigo",Violet:"violet",Purple:"purple",Fuchsia:"fuchsia",Pink:"pink",Rose:"rose"},n={XS:"xs",SM:"sm",MD:"md",LG:"lg",XL:"xl"},o={Left:"left",Right:"right"},a={Top:"top",Bottom:"bottom"};e.s(["BaseColors",()=>r,"DeltaTypes",()=>t,"HorizontalPositions",()=>o,"Sizes",()=>n,"VerticalPositions",()=>a])},673706,e=>{"use strict";e.i(480731);let t=["slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"],r=e=>e.toString(),n=e=>e.reduce((e,t)=>e+t,0),o=(e,t)=>{for(let r=0;r{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}function i(e){return t=>`tremor-${e}-${t}`}function l(e,r){let n=t.includes(e);if("white"===e||"black"===e||"transparent"===e||!r||!n){let t=e.includes("#")||e.includes("--")||e.includes("rgb")?`[${e}]`:e;return{bgColor:`bg-${t} dark:bg-${t}`,hoverBgColor:`hover:bg-${t} dark:hover:bg-${t}`,selectBgColor:`data-[selected]:bg-${t} dark:data-[selected]:bg-${t}`,textColor:`text-${t} dark:text-${t}`,selectTextColor:`data-[selected]:text-${t} dark:data-[selected]:text-${t}`,hoverTextColor:`hover:text-${t} dark:hover:text-${t}`,borderColor:`border-${t} dark:border-${t}`,selectBorderColor:`data-[selected]:border-${t} dark:data-[selected]:border-${t}`,hoverBorderColor:`hover:border-${t} dark:hover:border-${t}`,ringColor:`ring-${t} dark:ring-${t}`,strokeColor:`stroke-${t} dark:stroke-${t}`,fillColor:`fill-${t} dark:fill-${t}`}}return{bgColor:`bg-${e}-${r} dark:bg-${e}-${r}`,selectBgColor:`data-[selected]:bg-${e}-${r} dark:data-[selected]:bg-${e}-${r}`,hoverBgColor:`hover:bg-${e}-${r} dark:hover:bg-${e}-${r}`,textColor:`text-${e}-${r} dark:text-${e}-${r}`,selectTextColor:`data-[selected]:text-${e}-${r} dark:data-[selected]:text-${e}-${r}`,hoverTextColor:`hover:text-${e}-${r} dark:hover:text-${e}-${r}`,borderColor:`border-${e}-${r} dark:border-${e}-${r}`,selectBorderColor:`data-[selected]:border-${e}-${r} dark:data-[selected]:border-${e}-${r}`,hoverBorderColor:`hover:border-${e}-${r} dark:hover:border-${e}-${r}`,ringColor:`ring-${e}-${r} dark:ring-${e}-${r}`,strokeColor:`stroke-${e}-${r} dark:stroke-${e}-${r}`,fillColor:`fill-${e}-${r} dark:fill-${e}-${r}`}}e.s(["defaultValueFormatter",()=>r,"getColorClassNames",()=>l,"isValueInArray",()=>o,"makeClassName",()=>i,"mergeRefs",()=>a,"sumNumericArray",()=>n],673706)},689074,21243,98801,e=>{"use strict";var t=e.i(290571),r=e.i(271645);let n=e=>{var n=(0,t.__rest)(e,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},n),r.default.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z"}))};e.s(["default",()=>n],689074);let o=e=>{var n=(0,t.__rest)(e,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},n),r.default.createElement("path",{d:"M1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12ZM12.0003 17C14.7617 17 17.0003 14.7614 17.0003 12C17.0003 9.23858 14.7617 7 12.0003 7C9.23884 7 7.00026 9.23858 7.00026 12C7.00026 14.7614 9.23884 17 12.0003 17ZM12.0003 15C10.3434 15 9.00026 13.6569 9.00026 12C9.00026 10.3431 10.3434 9 12.0003 9C13.6571 9 15.0003 10.3431 15.0003 12C15.0003 13.6569 13.6571 15 12.0003 15Z"}))};e.s(["default",()=>o],21243);let a=e=>{var n=(0,t.__rest)(e,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},n),r.default.createElement("path",{d:"M4.52047 5.93457L1.39366 2.80777L2.80788 1.39355L22.6069 21.1925L21.1927 22.6068L17.8827 19.2968C16.1814 20.3755 14.1638 21.0002 12.0003 21.0002C6.60812 21.0002 2.12215 17.1204 1.18164 12.0002C1.61832 9.62282 2.81932 7.5129 4.52047 5.93457ZM14.7577 16.1718L13.2937 14.7078C12.902 14.8952 12.4634 15.0002 12.0003 15.0002C10.3434 15.0002 9.00026 13.657 9.00026 12.0002C9.00026 11.537 9.10522 11.0984 9.29263 10.7067L7.82866 9.24277C7.30514 10.0332 7.00026 10.9811 7.00026 12.0002C7.00026 14.7616 9.23884 17.0002 12.0003 17.0002C13.0193 17.0002 13.9672 16.6953 14.7577 16.1718ZM7.97446 3.76015C9.22127 3.26959 10.5793 3.00016 12.0003 3.00016C17.3924 3.00016 21.8784 6.87992 22.8189 12.0002C22.5067 13.6998 21.8038 15.2628 20.8068 16.5925L16.947 12.7327C16.9821 12.4936 17.0003 12.249 17.0003 12.0002C17.0003 9.23873 14.7617 7.00016 12.0003 7.00016C11.7514 7.00016 11.5068 7.01833 11.2677 7.05343L7.97446 3.76015Z"}))};e.s(["default",()=>a],98801)},444755,e=>{"use strict";let t=(e,r)=>{if(0===e.length)return r.classGroupId;let n=e[0],o=r.nextPart.get(n),a=o?t(e.slice(1),o):void 0;if(a)return a;if(0===r.validators.length)return;let i=e.join("-");return r.validators.find(({validator:e})=>e(i))?.classGroupId},r=/^\[(.+)\]$/,n=(e,t,r,i)=>{e.forEach(e=>{if("string"==typeof e){(""===e?t:o(t,e)).classGroupId=r;return}"function"==typeof e?a(e)?n(e(i),t,r,i):t.validators.push({validator:e,classGroupId:r}):Object.entries(e).forEach(([e,a])=>{n(a,o(t,e),r,i)})})},o=(e,t)=>{let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r},a=e=>e.isThemeGetter,i=(e,t)=>t?e.map(([e,r])=>[e,r.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,r])=>[t+e,r])):e)]):e,l=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(e=>{"["===e[0]?(t.push(...r.sort(),e),r=[]):r.push(e)}),t.push(...r.sort()),t},s=/\s+/;function c(){let e,t,r=0,n="";for(;r{let t;if("string"==typeof e)return e;let r="";for(let n=0;n{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,r=new Map,n=new Map,o=(o,a)=>{r.set(o,a),++t>e&&(t=0,n=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=n.get(e))?(o(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):o(e,t)}}})((s=o.reduce((e,t)=>t(e),e())).cacheSize),parseClassName:(e=>{let{separator:t,experimentalParseClassName:r}=e,n=1===t.length,o=t[0],a=t.length,i=e=>{let r,i=[],l=0,s=0;for(let c=0;cs?r-s:void 0}};return r?e=>r({className:e,parseClassName:i}):i})(s),...(e=>{let o=(e=>{let{theme:t,prefix:r}=e,o={nextPart:new Map,validators:[]};return i(Object.entries(e.classGroups),r).forEach(([e,r])=>{n(r,o,e,t)}),o})(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:l}=e;return{getClassGroupId:e=>{let n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),t(n,o)||(e=>{if(r.test(e)){let t=r.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}})(e)},getConflictingClassGroupIds:(e,t)=>{let r=a[e]||[];return t&&l[e]?[...r,...l[e]]:r}}})(s)}).cache.get,f=a.cache.set,p=m,m(l)};function m(e){let t=u(e);if(t)return t;let r=((e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,a=[],i=e.trim().split(s),c="";for(let e=i.length-1;e>=0;e-=1){let t=i[e],{modifiers:s,hasImportantModifier:u,baseClassName:d,maybePostfixModifierPosition:f}=r(t),p=!!f,m=n(p?d.substring(0,f):d);if(!m){if(!p||!(m=n(d))){c=t+(c.length>0?" "+c:c);continue}p=!1}let g=l(s).join(":"),h=u?g+"!":g,v=h+m;if(a.includes(v))continue;a.push(v);let y=o(m,p);for(let e=0;e0?" "+c:c)}return c})(e,a);return f(e,r),r}return function(){return p(c.apply(null,arguments))}}let f=e=>{let t=t=>t[e]||[];return t.isThemeGetter=!0,t},p=/^\[(?:([a-z-]+):)?(.+)\]$/i,m=/^\d+\/\d+$/,g=new Set(["px","full","screen"]),h=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,v=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,y=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,b=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,w=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,C=e=>S(e)||g.has(e)||m.test(e),x=e=>M(e,"length",A),S=e=>!!e&&!Number.isNaN(Number(e)),$=e=>M(e,"number",S),E=e=>!!e&&Number.isInteger(Number(e)),k=e=>e.endsWith("%")&&S(e.slice(0,-1)),O=e=>p.test(e),j=e=>h.test(e),T=new Set(["length","size","percentage"]),_=e=>M(e,T,B),P=e=>M(e,"position",B),I=new Set(["image","url"]),F=e=>M(e,I,L),N=e=>M(e,"",z),R=()=>!0,M=(e,t,r)=>{let n=p.exec(e);return!!n&&(n[1]?"string"==typeof t?n[1]===t:t.has(n[1]):r(n[2]))},A=e=>v.test(e)&&!y.test(e),B=()=>!1,z=e=>b.test(e),L=e=>w.test(e),H=()=>{let e=f("colors"),t=f("spacing"),r=f("blur"),n=f("brightness"),o=f("borderColor"),a=f("borderRadius"),i=f("borderSpacing"),l=f("borderWidth"),s=f("contrast"),c=f("grayscale"),u=f("hueRotate"),d=f("invert"),p=f("gap"),m=f("gradientColorStops"),g=f("gradientColorStopPositions"),h=f("inset"),v=f("margin"),y=f("opacity"),b=f("padding"),w=f("saturate"),T=f("scale"),I=f("sepia"),M=f("skew"),A=f("space"),B=f("translate"),z=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto",O,t],D=()=>[O,t],V=()=>["",C,x],W=()=>["auto",S,O],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["solid","dashed","dotted","double","none"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>["start","end","center","between","around","evenly","stretch"],X=()=>["","0",O],J=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>[S,O];return{cacheSize:500,separator:":",theme:{colors:[R],spacing:[C,x],blur:["none","",j,O],brightness:Y(),borderColor:[e],borderRadius:["none","","full",j,O],borderSpacing:D(),borderWidth:V(),contrast:Y(),grayscale:X(),hueRotate:Y(),invert:X(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[k,x],inset:H(),margin:H(),opacity:Y(),padding:D(),saturate:Y(),scale:Y(),sepia:X(),skew:Y(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",O]}],container:["container"],columns:[{columns:[j]}],"break-after":[{"break-after":J()}],"break-before":[{"break-before":J()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...U(),O]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",E,O]}],basis:[{basis:H()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",O]}],grow:[{grow:X()}],shrink:[{shrink:X()}],order:[{order:["first","last","none",E,O]}],"grid-cols":[{"grid-cols":[R]}],"col-start-end":[{col:["auto",{span:["full",E,O]},O]}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":[R]}],"row-start-end":[{row:["auto",{span:[E,O]},O]}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",O]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",O]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",O,t]}],"min-w":[{"min-w":[O,t,"min","max","fit"]}],"max-w":[{"max-w":[O,t,"none","full","min","max","fit","prose",{screen:[j]},j]}],h:[{h:[O,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[O,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[O,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[O,t,"auto","min","max","fit"]}],"font-size":[{text:["base",j,x]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",$]}],"font-family":[{font:[R]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",O]}],"line-clamp":[{"line-clamp":["none",S,$]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",C,O]}],"list-image":[{"list-image":["none",O]}],"list-style-type":[{list:["none","disc","decimal",O]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",C,x]}],"underline-offset":[{"underline-offset":["auto",C,O]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",O]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",O]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),P]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",_]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},F]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...G(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:G()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...G()]}],"outline-offset":[{"outline-offset":[C,O]}],"outline-w":[{outline:[C,x]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[C,x]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",j,N]}],"shadow-color":[{shadow:[R]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":q()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[s]}],"drop-shadow":[{"drop-shadow":["","none",j,O]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[I]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[s]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[I]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",O]}],duration:[{duration:Y()}],ease:[{ease:["linear","in","out","in-out",O]}],delay:[{delay:Y()}],animate:[{animate:["none","spin","ping","pulse","bounce",O]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[E,O]}],"translate-x":[{"translate-x":[B]}],"translate-y":[{"translate-y":[B]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",O]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",O]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",O]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[C,x,$]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},D=(e,t,r)=>{void 0!==r&&(e[t]=r)},V=(e,t)=>{if(t)for(let r in t)D(e,r,t[r])},W=(e,t)=>{if(t)for(let r in t){let n=t[r];void 0!==n&&(e[r]=(e[r]||[]).concat(n))}},U=((e,...t)=>"function"==typeof e?d(H,e,...t):d(()=>((e,{cacheSize:t,prefix:r,separator:n,experimentalParseClassName:o,extend:a={},override:i={}})=>{for(let a in D(e,"cacheSize",t),D(e,"prefix",r),D(e,"separator",n),D(e,"experimentalParseClassName",o),i)V(e[a],i[a]);for(let t in a)W(e[t],a[t]);return e})(H(),e),...t))({extend:{classGroups:{shadow:[{shadow:[{tremor:["input","card","dropdown"],"dark-tremor":["input","card","dropdown"]}]}],rounded:[{rounded:[{tremor:["small","default","full"],"dark-tremor":["small","default","full"]}]}],"font-size":[{text:[{tremor:["default","title","metric"],"dark-tremor":["default","title","metric"]}]}]}}});e.s(["tremorTwMerge",()=>U],444755)},779241,103471,677955,e=>{"use strict";var t=e.i(290571),r=e.i(271645),n=e.i(673706),o=e.i(689074),a=e.i(21243),i=e.i(98801),l=e.i(444755);let s=e=>["string","number"].includes(typeof e)?e:e instanceof Array?e.map(s).join(""):"object"==typeof e&&e?s(e.props.children):void 0;function c(e){let t=new Map;return r.default.Children.map(e,e=>{var r;t.set(e.props.value,null!=(r=s(e))?r:e.props.value)}),t}function u(e,t){return r.default.Children.map(t,t=>{var r;if((null!=(r=s(t))?r:t.props.value).toLowerCase().includes(e.toLowerCase()))return t})}let d=(e,t,r=!1)=>(0,l.tremorTwMerge)(t?"bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle":"bg-tremor-background dark:bg-dark-tremor-background",!t&&"hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted",e?"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis":"text-tremor-content dark:text-dark-tremor-content",t&&"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",r&&"text-red-500 placeholder:text-red-500 dark:text-red-500 dark:placeholder:text-red-500",r?"border-red-500 dark:border-red-500":"border-tremor-border dark:border-dark-tremor-border");function f(e){return null!=e&&""!==e}e.s(["constructValueToNameMapping",()=>c,"getFilteredOptions",()=>u,"getNodeText",()=>s,"getSelectButtonColors",()=>d,"hasValue",()=>f],103471);let p=r.default.forwardRef((e,s)=>{let{value:c,defaultValue:u,type:p,placeholder:m="Type...",icon:g,error:h=!1,errorMessage:v,disabled:y=!1,stepper:b,makeInputClassName:w,className:C,onChange:x,onValueChange:S,autoFocus:$,pattern:E}=e,k=(0,t.__rest)(e,["value","defaultValue","type","placeholder","icon","error","errorMessage","disabled","stepper","makeInputClassName","className","onChange","onValueChange","autoFocus","pattern"]),[O,j]=(0,r.useState)($||!1),[T,_]=(0,r.useState)(!1),P=(0,r.useCallback)(()=>_(!T),[T,_]),I=(0,r.useRef)(null),F=f(c||u);return r.default.useEffect(()=>{let e=()=>j(!0),t=()=>j(!1),r=I.current;return r&&(r.addEventListener("focus",e),r.addEventListener("blur",t),$&&r.focus()),()=>{r&&(r.removeEventListener("focus",e),r.removeEventListener("blur",t))}},[$]),r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{className:(0,l.tremorTwMerge)(w("root"),"relative w-full flex items-center min-w-[10rem] outline-none rounded-tremor-default transition duration-100 border","shadow-tremor-input","dark:shadow-dark-tremor-input",d(F,y,h),O&&(0,l.tremorTwMerge)("ring-2","border-tremor-brand-subtle ring-tremor-brand-muted","dark:border-dark-tremor-brand-subtle dark:ring-dark-tremor-brand-muted"),C)},g?r.default.createElement(g,{className:(0,l.tremorTwMerge)(w("icon"),"shrink-0 h-5 w-5 mx-2.5 absolute left-0 flex items-center","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}):null,r.default.createElement("input",Object.assign({ref:(0,n.mergeRefs)([I,s]),defaultValue:u,value:c,type:T?"text":p,className:(0,l.tremorTwMerge)(w("input"),"w-full bg-transparent focus:outline-none focus:ring-0 border-none text-tremor-default rounded-tremor-default transition duration-100 py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none","password"===p?h?"pr-16":"pr-12":h?"pr-8":"pr-3",g?"pl-10":"pl-3",y?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content"),placeholder:m,disabled:y,"data-testid":"base-input",onChange:e=>{null==x||x(e),null==S||S(e.target.value)},pattern:E},k)),"password"!==p||y?null:r.default.createElement("button",{className:(0,l.tremorTwMerge)(w("toggleButton"),"absolute inset-y-0 right-0 flex items-center px-2.5 rounded-lg"),type:"button",onClick:()=>P(),"aria-label":T?"Hide password":"Show Password"},T?r.default.createElement(i.default,{className:(0,l.tremorTwMerge)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0}):r.default.createElement(a.default,{className:(0,l.tremorTwMerge)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0})),h?r.default.createElement(o.default,{className:(0,l.tremorTwMerge)(w("errorIcon"),"text-red-500 shrink-0 h-5 w-5 absolute right-0 flex items-center","password"===p?"mr-10":"number"===p?b?"mr-20":"mr-3":"mx-2.5")}):null,null!=b?b:null),h&&v?r.default.createElement("p",{className:(0,l.tremorTwMerge)(w("errorMessage"),"text-sm text-red-500 mt-1")},v):null)});p.displayName="BaseInput",e.s(["default",()=>p],677955);let m=(0,n.makeClassName)("TextInput"),g=r.default.forwardRef((e,n)=>{let{type:o="text"}=e,a=(0,t.__rest)(e,["type"]);return r.default.createElement(p,Object.assign({ref:n,type:o,makeInputClassName:m},a))});g.displayName="TextInput",e.s(["TextInput",()=>g],779241)},827252,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"};var o=e.i(9583),a=r.forwardRef(function(e,a){return r.createElement(o.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["InfoCircleOutlined",0,a],827252)},592968,e=>{"use strict";var t=e.i(491816);e.s(["Tooltip",()=>t.default])},602869,122550,82946,431703,e=>{"use strict";e.s(["addAllowedIP",()=>eD,"adminGlobalActivity",()=>e2,"adminGlobalActivityPerModel",()=>e6,"adminGlobalCacheActivity",()=>e4,"adminSpendLogsCall",()=>eQ,"adminTopEndUsersCall",()=>e0,"adminTopKeysCall",()=>eZ,"adminTopModelsCall",()=>e5,"adminspendByProvider",()=>e1,"agentDailyActivityCall",()=>ej,"agentHubPublicModelsCall",()=>eA,"alertingSettingsCall",()=>en,"allEndUsersCall",()=>eX,"allTagNamesCall",()=>eK,"applyGuardrail",()=>nv,"approveGuardrailSubmission",()=>tG,"approveMCPServer",()=>rB,"availableTeamListCall",()=>eg,"budgetCreateCall",()=>ee,"budgetDeleteCall",()=>Z,"budgetUpdateCall",()=>et,"buildMcpOAuthAuthorizeUrl",()=>n_,"cacheTemporaryMcpServer",()=>nj,"cachingHealthCheckCall",()=>tA,"callMCPTool",()=>rq,"cancelModelCostMapReload",()=>K,"checkEuAiActCompliance",()=>nX,"checkGdprCompliance",()=>nJ,"claimOnboardingToken",()=>e_,"convertPromptFileToJson",()=>rh,"createAgentCall",()=>rv,"createGuardrailCall",()=>rb,"createMCPServer",()=>rT,"createMCPToolset",()=>rF,"createMemory",()=>or,"createPassThroughEndpoint",()=>tP,"createPolicyAttachmentCall",()=>ro,"createPolicyCall",()=>t3,"createPolicyVersion",()=>t9,"createPromptCall",()=>rp,"createSearchTool",()=>rH,"credentialCreateCall",()=>to,"credentialDeleteCall",()=>tl,"credentialGetCall",()=>ti,"credentialListCall",()=>ta,"credentialUpdateCall",()=>ts,"customerDailyActivityCall",()=>eO,"deleteAgentCall",()=>no,"deleteAllowedIP",()=>eV,"deleteCallback",()=>nk,"deleteClaudeCodePlugin",()=>nK,"deleteConfigFieldSetting",()=>tF,"deleteGuardrailCall",()=>nl,"deleteMCPOAuthUserCredential",()=>n6,"deleteMCPServer",()=>rP,"deleteMCPToolset",()=>rR,"deleteMemory",()=>oo,"deletePassThroughEndpointsCall",()=>tN,"deletePolicyAttachmentCall",()=>ra,"deletePolicyCall",()=>rt,"deletePromptCall",()=>rg,"deleteSearchTool",()=>rV,"deleteToolPolicyOverride",()=>n2,"disableClaudeCodePlugin",()=>nq,"discoverAgentCardCall",()=>ry,"enableClaudeCodePlugin",()=>nG,"enrichPolicyTemplate",()=>t1,"enrichPolicyTemplateStream",()=>t6,"estimateAttachmentImpactCall",()=>rc,"exchangeLoginCode",()=>nH,"exchangeMcpOAuthToken",()=>nP,"fetchAvailableSearchProviders",()=>rW,"fetchDiscoverableMCPServers",()=>r$,"fetchMCPAccessGroups",()=>rO,"fetchMCPClientIp",()=>rj,"fetchMCPServerHealth",()=>rk,"fetchMCPServers",()=>rE,"fetchMCPSubmissions",()=>rA,"fetchMCPToolsets",()=>rI,"fetchMemoryList",()=>ot,"fetchOpenAPIRegistry",()=>rS,"fetchSearchTools",()=>rL,"fetchToolDetail",()=>n0,"fetchToolPolicyOptions",()=>nY,"fetchToolsList",()=>nQ,"formatDate",()=>x,"getAgentCreateMetadata",()=>M,"getAgentInfo",()=>np,"getAgentsList",()=>nf,"getAllowedIPs",()=>eH,"getBudgetList",()=>tx,"getCacheSettingsCall",()=>tk,"getCallbackConfigsCall",()=>S,"getCallbacksCall",()=>tS,"getCategoryYaml",()=>nu,"getClaudeCodePluginsList",()=>nW,"getConfigFieldSetting",()=>t_,"getDefaultTeamSettings",()=>r0,"getEmailEventSettings",()=>nt,"getGeneralSettingsCall",()=>t$,"getGlobalLitellmHeaderName",()=>z,"getGuardrailInfo",()=>nm,"getGuardrailProviderSpecificParams",()=>nc,"getGuardrailUISettings",()=>ns,"getGuardrailsList",()=>tW,"getGuardrailsUsageDetail",()=>tX,"getGuardrailsUsageLogs",()=>tJ,"getGuardrailsUsageOverview",()=>tK,"getInProductNudgesCall",()=>$,"getInternalUserSettings",()=>rC,"getLicenseInfo",()=>n$,"getMCPOAuthUserCredentialStatus",()=>n5,"getMCPSemanticFilterSettings",()=>tH,"getMCPUserEnvVars",()=>n7,"getMajorAirlines",()=>nd,"getModelCostMapReloadStatus",()=>J,"getModelCostMapSource",()=>X,"getOnboardingCredentials",()=>eT,"getOpenAPISchema",()=>W,"getPassThroughEndpointsCall",()=>tT,"getPoliciesList",()=>tY,"getPolicyAttachmentsList",()=>rn,"getPolicyInfo",()=>rr,"getPolicyInfoWithGuardrails",()=>tZ,"getPolicyTemplates",()=>t0,"getPossibleUserRoles",()=>tr,"getPromptInfo",()=>rd,"getPromptVersions",()=>rf,"getPromptsList",()=>ru,"getProviderCreateMetadata",()=>R,"getProxyBaseUrl",()=>P,"getProxyUISettings",()=>tz,"getPublicModelHubInfo",()=>V,"getRemainingUsers",()=>nS,"getResolvedGuardrails",()=>rl,"getRouterSettingsCall",()=>tE,"getSSOSettings",()=>nw,"getTeamPermissionsCall",()=>r2,"getToolUsageLogs",()=>nZ,"getUISettings",()=>tL,"getUiConfig",()=>D,"getUiSettings",()=>nD,"handleError",()=>N,"individualModelHealthCheckCall",()=>tM,"invitationCreateCall",()=>er,"keyAliasesCall",()=>te,"keyCreateCall",()=>ea,"keyCreateForAgentCall",()=>ei,"keyCreateServiceAccountCall",()=>eo,"keyDeleteCall",()=>es,"keyInfoCall",()=>e3,"keyInfoV1Call",()=>e8,"keyListCall",()=>e9,"keyUpdateCall",()=>tc,"latestHealthChecksCall",()=>tB,"listGuardrailSubmissions",()=>tU,"listMCPTools",()=>rG,"listMCPUserCredentials",()=>n3,"listMCPUserEnvVarStatus",()=>n9,"listPolicyVersions",()=>t8,"loginCall",()=>nL,"makeAgentsPublicCall",()=>na,"makeMCPPublicCall",()=>ni,"makeModelGroupPublic",()=>H,"mcpHubPublicServersCall",()=>eB,"modelAvailableCall",()=>eU,"modelCostMap",()=>U,"modelCreateCall",()=>Y,"modelDeleteCall",()=>Q,"modelHubCall",()=>eL,"modelHubPublicModelsCall",()=>eM,"modelInfoCall",()=>eN,"modelInfoV1Call",()=>eR,"modelPatchUpdateCall",()=>td,"organizationCreateCall",()=>ey,"organizationDailyActivityCall",()=>ek,"organizationDeleteCall",()=>ew,"organizationInfoCall",()=>ev,"organizationListCall",()=>eh,"organizationMemberAddCall",()=>th,"organizationMemberDeleteCall",()=>tv,"organizationMemberUpdateCall",()=>ty,"organizationUpdateCall",()=>eb,"patchAgentCall",()=>ng,"perUserAnalyticsCall",()=>nz,"proxyBaseUrl",()=>_,"ragIngestCall",()=>ne,"regenerateKeyCall",()=>eP,"registerClaudeCodePlugin",()=>nU,"registerMCPServer",()=>rM,"registerMcpOAuthClient",()=>nT,"rejectGuardrailSubmission",()=>tq,"rejectMCPServer",()=>rz,"reloadModelCostMap",()=>G,"resetEmailEventSettings",()=>nn,"resolvePoliciesCall",()=>rs,"scheduleModelCostMapReload",()=>q,"searchToolQueryCall",()=>nF,"serverRootPath",()=>O,"serviceHealthCheck",()=>tC,"sessionSpendLogsCall",()=>r6,"setCallbacksCall",()=>tR,"setGlobalLitellmHeaderName",()=>B,"skillHubPublicCall",()=>ez,"storeMCPOAuthUserCredential",()=>n4,"storeMCPUserEnvVars",()=>n8,"suggestPolicyTemplates",()=>t2,"switchToWorkerUrl",()=>I,"tagCreateCall",()=>rK,"tagDailyActivityCall",()=>e$,"tagDauCall",()=>nN,"tagDeleteCall",()=>rZ,"tagDistinctCall",()=>nA,"tagInfoCall",()=>rJ,"tagListCall",()=>rQ,"tagMauCall",()=>nM,"tagUpdateCall",()=>rX,"tagWauCall",()=>nR,"tagsSpendLogsCall",()=>eq,"teamBulkMemberAddCall",()=>tp,"teamCreateCall",()=>tn,"teamDailyActivityCall",()=>eE,"teamDeleteCall",()=>eu,"teamInfoCall",()=>ep,"teamListCall",()=>em,"teamMemberAddCall",()=>tf,"teamMemberDeleteCall",()=>tg,"teamMemberUpdateCall",()=>tm,"teamPermissionsUpdateCall",()=>r4,"teamSpendLogsCall",()=>eG,"teamUpdateCall",()=>tu,"testCacheConnectionCall",()=>tO,"testConnectionRequest",()=>e7,"testCustomCodeGuardrail",()=>ny,"testMCPSemanticFilter",()=>tV,"testMCPToolsListRequest",()=>nO,"testPipelineCall",()=>ri,"testPoliciesAndGuardrails",()=>tQ,"testPolicyTemplate",()=>t4,"testSearchToolConnection",()=>rU,"transformRequestCall",()=>eC,"uiAuditLogsCall",()=>nx,"uiSpendLogDetailsCall",()=>rw,"uiSpendLogsCall",()=>eY,"updateCacheSettingsCall",()=>tj,"updateConfigFieldSetting",()=>tI,"updateDefaultTeamSettings",()=>r1,"updateEmailEventSettings",()=>nr,"updateGuardrailCall",()=>nh,"updateInternalUserSettings",()=>rx,"updateMCPSemanticFilterSettings",()=>tD,"updateMCPServer",()=>r_,"updateMCPToolset",()=>rN,"updateMemory",()=>on,"updatePassThroughEndpoint",()=>nE,"updatePolicyCall",()=>t7,"updatePolicyVersionStatus",()=>re,"updatePromptCall",()=>rm,"updateSSOSettings",()=>nC,"updateSearchTool",()=>rD,"updateToolPolicy",()=>n1,"updateUiSettings",()=>nV,"updateUsefulLinksCall",()=>eW,"usageAiChatStream",()=>t5,"userAgentSummaryCall",()=>nB,"userBulkUpdateUserCall",()=>tw,"userCreateCall",()=>el,"userDailyActivityAggregatedCall",()=>tt,"userDailyActivityCall",()=>eS,"userDeleteCall",()=>ec,"userFilterUICall",()=>eJ,"userGetInfoV2",()=>ef,"userListCall",()=>ed,"userUpdateUserCall",()=>tb,"validateBlockedWordsFile",()=>nb,"vectorStoreCreateCall",()=>r5,"vectorStoreDeleteCall",()=>r7,"vectorStoreInfoCall",()=>r8,"vectorStoreListCall",()=>r3,"vectorStoreSearchCall",()=>nI,"vectorStoreUpdateCall",()=>r9],602869);var t=e.i(247167),r=e.i(888259),n=e.i(268004);e.s(["default",()=>v,"jsonFields",()=>g],82946);var o=e.i(843476),a=e.i(271645),i=e.i(808613),l=e.i(311451),s=e.i(28651),c=e.i(199133),u=e.i(779241),d=e.i(827252),f=e.i(592968);let p=e=>e?e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()):e;function m(e,t){return e.length>t?e.substring(0,t)+"...":e}e.s(["formItemValidateJSON",0,(e,t)=>{if(!t)return Promise.resolve();try{return JSON.parse(t),Promise.resolve()}catch(e){return Promise.reject("Please enter valid JSON")}},"formatLabel",0,p,"truncateString",()=>m],122550);let g=["metadata","config","enforced_params","aliases"],h=(e,t)=>g.includes(e)||"json"===t.format,v=({schemaComponent:e,excludedFields:t=[],form:r,overrideLabels:n={},overrideTooltips:m={},customValidation:g={},defaultValues:v={}})=>{let[y,b]=(0,a.useState)(null),[w,C]=(0,a.useState)(null);return((0,a.useEffect)(()=>{(async()=>{try{let n=(await W()).components.schemas[e];if(!n)throw Error(`Schema component "${e}" not found`);b(n);let o={};Object.keys(n.properties).filter(e=>!t.includes(e)&&void 0!==v[e]).forEach(e=>{o[e]=v[e]}),r.setFieldsValue(o)}catch(e){console.error("Schema fetch error:",e),C(e instanceof Error?e.message:"Failed to fetch schema")}})()},[e,r,t]),w)?(0,o.jsxs)("div",{className:"text-red-500",children:["Error: ",w]}):y?.properties?(0,o.jsx)("div",{children:Object.entries(y.properties).filter(([e])=>!t.includes(e)).map(([e,t])=>{let r,a,b,w,C,x,S,$;return a=(e=>{if(e.type)return e.type;if(e.anyOf){let t=e.anyOf.map(e=>e.type);if(t.includes("number")||t.includes("integer"))return"number";t.includes("string")}return"string"})(t),b=y?.required?.includes(e),w=n[e]||t.title||p(e),C=m[e]||t.description,x=[],b&&x.push({required:!0,message:`${w} is required`}),g[e]&&x.push({validator:g[e]}),h(e,t)&&x.push({validator:async(e,t)=>{if(t&&!(e=>{if(!e)return!0;try{return JSON.parse(e),!0}catch{return!1}})(t))throw Error("Please enter valid JSON")}}),S=C?(0,o.jsxs)("span",{children:[w," ",(0,o.jsx)(f.Tooltip,{title:C,children:(0,o.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}):w,r=h(e,t)?(0,o.jsx)(l.Input.TextArea,{rows:4,placeholder:"Enter as JSON",className:"font-mono"}):t.enum?(0,o.jsx)(c.Select,{children:t.enum.map(e=>(0,o.jsx)(c.Select.Option,{value:e,children:e},e))}):"number"===a||"integer"===a?(0,o.jsx)(s.InputNumber,{style:{width:"100%"},precision:"integer"===a?0:void 0}):"duration"===e?(0,o.jsx)(u.TextInput,{placeholder:"eg: 30s, 30h, 30d"}):(0,o.jsx)(u.TextInput,{placeholder:C||""}),(0,o.jsx)(i.Form.Item,{label:S,name:e,className:"mt-8",rules:x,initialValue:v[e],help:(0,o.jsx)("div",{className:"text-xs text-gray-500",children:($=({max_budget:"Enter maximum budget in USD (e.g., 100.50)",budget_duration:"Select a time period for budget reset",tpm_limit:"Enter maximum tokens per minute (whole number)",rpm_limit:"Enter maximum requests per minute (whole number)",duration:"Enter duration (e.g., 30s, 24h, 7d)",metadata:'Enter JSON object with key-value pairs\nExample: {"team": "research", "project": "nlp"}',config:'Enter configuration as JSON object\nExample: {"setting": "value"}',permissions:"Enter comma-separated permission strings",enforced_params:'Enter parameters as JSON object\nExample: {"param": "value"}',blocked:"Enter true/false or specific block conditions",aliases:'Enter aliases as JSON object\nExample: {"alias1": "value1", "alias2": "value2"}',models:"Select one or more model names",key_alias:"Enter a unique identifier for this key",tags:"Enter comma-separated tag strings"})[e]||({string:"Text input",number:"Numeric input",integer:"Whole number input",boolean:"True/False value"})[a]||"Text input",h(e,t)?`${$} Must be valid JSON format`:t.enum?`Select from available options -Allowed values: ${t.enum.join(", ")}`:$)}),children:r},e)})}):null};var y=e.i(727749);class b extends Error{status;body;constructor(e,t,r){super(e),this.name="ApiError",this.status=t,this.body=r}}let w=e=>{let t=e?.detail,r=Array.isArray(t)?t.map(e=>e?.msg||JSON.stringify(e)).join("; "):"string"==typeof t?t:void 0;return e?.error&&(e.error.message||("string"==typeof e.error?e.error:void 0))||e?.message||r||JSON.stringify(e)};function C(e){let{getBaseUrl:t,getAuthHeaderName:r,onError:n,fetchImpl:o}=e;async function a(e,i,l={}){let{accessToken:s,body:c,rawBody:u,query:d,headers:f,signal:p}=l,m=((e,t)=>{if(!t)return e;let r=new URLSearchParams;for(let[e,n]of Object.entries(t))null!=n&&(Array.isArray(n)?n.forEach(t=>null!=t&&r.append(e,String(t))):r.append(e,String(n)));let n=r.toString();return n?e.includes("?")?`${e}&${n}`:`${e}?${n}`:e})(`${t()}${i}`,d),g={};void 0===u&&(g["Content-Type"]="application/json"),s&&(g[r?r():"Authorization"]=`Bearer ${s}`),f&&Object.assign(g,f);let h={method:e,headers:g,signal:p};void 0!==u?h.body=u:void 0!==c&&(h.body=JSON.stringify(c));let v=await (o??fetch)(m,h);if(!v.ok){let e,t=await v.text(),r=t;try{r=JSON.parse(t),e=w(r)}catch{e=t||`HTTP ${v.status}`}throw n?.(e),new b(e,v.status,r)}let y=await v.text();return y?JSON.parse(y):void 0}return{request:a,get:(e,t)=>a("GET",e,t),post:(e,t)=>a("POST",e,t),put:(e,t)=>a("PUT",e,t),delete:(e,t)=>a("DELETE",e,t),patch:(e,t)=>a("PATCH",e,t)}}e.s(["createApiClient",()=>C,"deriveErrorMessage",0,w],431703);let x=e=>{let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${n}`},S=async e=>{try{return await L.get("/callbacks/configs",{accessToken:e})}catch(e){throw console.error("Failed to get callbacks:",e),e}},$=async e=>{try{return await L.get("/in_product_nudges",{accessToken:e})}catch(e){throw console.error("Failed to get in-product nudges:",e),e}},E=e=>t.default.env.NEXT_PUBLIC_BASE_URL?t.default.env.NEXT_PUBLIC_BASE_URL:e,k=E(null),O="/",j="litellm_worker_url",T=window.localStorage.getItem(j),_=(()=>{if(!T)return null;try{let e=new URL(T);if("http:"===e.protocol||"https:"===e.protocol)return T}catch{}return window.localStorage.removeItem(j),null})()??k;console.log=function(){};let P=()=>{if(_)return _;let e=window.location;return e?.origin??""};function I(e){(!e||function(e){try{let t=new URL(e);return"http:"===t.protocol||"https:"===t.protocol}catch{return!1}}(e))&&(e?window.localStorage.setItem(j,e):window.localStorage.removeItem(j),_=e??k)}let F=0,N=async e=>{let t=Date.now();if(t-F>6e4){if(("string"==typeof e?e:JSON.stringify(e)).includes("Authentication Error - Expired Key")){y.default.info("UI Session Expired. Logging out."),F=t,(0,n.clearTokenCookies)();let e=window.location;e&&(window.location.href=e.pathname)}F=t}else console.log("Error suppressed to prevent spam:",e)},R=async()=>{let e=_?`${_}/public/providers/fields`:"/public/providers/fields",t=await fetch(e,{method:"GET"});if(!t.ok){let e=await t.text();throw console.error("Failed to fetch provider create metadata:",t.status,e),Error("Failed to load provider configuration")}return await t.json()},M=async()=>{let e=_?`${_}/public/agents/fields`:"/public/agents/fields",t=await fetch(e,{method:"GET"});if(!t.ok){let e=await t.text();throw console.error("Failed to fetch agent create metadata:",t.status,e),Error("Failed to load agent configuration")}return await t.json()},A="Authorization";function B(e="Authorization"){console.log(`setGlobalLitellmHeaderName: ${e}`),A=e}function z(){return A}let L=C({getBaseUrl:P,getAuthHeaderName:z,onError:N}),H=async(e,t)=>{let r=_?`${_}/model_group/make_public`:"/model_group/make_public";return(await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({model_groups:t})})).json()},D=async()=>{console.log("Getting UI config");let e=k?`${k}/litellm/.well-known/litellm-ui-config`:"/litellm/.well-known/litellm-ui-config",t=await fetch(e),r=await t.json();return console.log("jsonData in getUiConfig:",r),((e,t=null)=>{window.localStorage.getItem(j)||(_=(({explicitBase:e,serverRootPath:t})=>{let r,n=(e??"").trim().replace(/\/+$/,""),o=""===(r=(t??"").trim())||"/"===r?"":(r.startsWith("/")?r:`/${r}`).replace(/\/+$/,"");return""===o||n.endsWith(o)?n:`${n}${o}`})({explicitBase:t||E(window.location?.origin??null),serverRootPath:e}))})(r.server_root_path,r.proxy_base_url),r},V=async()=>{let e=_?`${_}/public/model_hub/info`:"/public/model_hub/info",t=await fetch(e);return await t.json()},W=async()=>{let e=_?`${_}/openapi.json`:"/openapi.json",t=await fetch(e);return await t.json()},U=async()=>{try{let e=_?`${_}/public/litellm_model_cost_map`:"/public/litellm_model_cost_map",t=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}}),r=await t.json();return console.log(`received litellm model cost data: ${r}`),r}catch(e){throw console.error("Failed to get model cost map:",e),e}},G=async e=>{try{let t=_?`${_}/reload/model_cost_map`:"/reload/model_cost_map",r=await fetch(t,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}}),n=await r.json();return console.log(`Model cost map reload response: ${n}`),n}catch(e){throw console.error("Failed to reload model cost map:",e),e}},q=async(e,t)=>{try{let r=_?`${_}/schedule/model_cost_map_reload?hours=${t}`:`/schedule/model_cost_map_reload?hours=${t}`,n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}}),o=await n.json();return console.log(`Schedule model cost map reload response: ${o}`),o}catch(e){throw console.error("Failed to schedule model cost map reload:",e),e}},K=async e=>{try{let t=_?`${_}/schedule/model_cost_map_reload`:"/schedule/model_cost_map_reload",r=await fetch(t,{method:"DELETE",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}}),n=await r.json();return console.log(`Cancel model cost map reload response: ${n}`),n}catch(e){throw console.error("Failed to cancel model cost map reload:",e),e}},X=async e=>{try{let t=_?`${_}/model/cost_map/source`:"/model/cost_map/source",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw Error(`HTTP ${r.status}: ${e}`)}let n=await r.json();return console.log("Model cost map source info:",n),n}catch(e){throw console.error("Failed to get model cost map source info:",e),e}},J=async e=>{try{let t=_?`${_}/schedule/model_cost_map_reload/status`:"/schedule/model_cost_map_reload/status";console.log("Fetching status from URL:",t);let r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){console.error(`Status request failed with status: ${r.status}`);let e=await r.text();throw console.error("Error response:",e),Error(`HTTP ${r.status}: ${e}`)}let n=await r.json();return console.log("Model cost map reload status:",n),n}catch(e){throw console.error("Failed to get model cost map reload status:",e),e}},Y=async(e,t)=>{try{let n=await L.post("/model/new",{accessToken:e,body:{...t}});return console.log("API Response:",n),r.default.destroy(),y.default.success(`Model ${t.model_name} created successfully`),n}catch(e){throw console.error("Failed to create key:",e),e}},Q=async(e,t)=>{console.log(`model_id in model delete call: ${t}`);try{let r=await L.post("/model/delete",{accessToken:e,body:{id:t}});return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},Z=async(e,t)=>{if(console.log(`budget_id in budget delete call: ${t}`),null!=e)try{let r=await L.post("/budget/delete",{accessToken:e,body:{id:t}});return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},ee=async(e,t)=>{try{console.log("Form Values in budgetCreateCall:",t),console.log("Form Values after check:",t);let r=await L.post("/budget/new",{accessToken:e,body:{...t}});return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},et=async(e,t)=>{try{console.log("Form Values in budgetUpdateCall:",t),console.log("Form Values after check:",t);let r=await L.post("/budget/update",{accessToken:e,body:{...t}});return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},er=async(e,t)=>{try{let r=await L.post("/invitation/new",{accessToken:e,body:{user_id:t}});return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},en=async e=>{try{return await L.get("/alerting/settings",{accessToken:e})}catch(e){throw console.error("Failed to get callbacks:",e),e}},eo=async(e,t)=>{try{for(let e of(console.log("Form Values in keyCreateServiceAccountCall:",t),t.description&&(t.metadata||(t.metadata={}),t.metadata.description=t.description,delete t.description,t.metadata=JSON.stringify(t.metadata)),g))if(t[e]){console.log(`formValues.${e}:`,t[e]);try{t[e]=JSON.parse(t[e])}catch(t){throw Error(`Failed to parse ${e}: `+t)}}console.log("Form Values after check:",t);let r=_?`${_}/key/service-account/generate`:"/key/service-account/generate",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!n.ok){let e=await n.text();throw N(e),console.error("Error response from the server:",e),Error(e)}let o=await n.json();return console.log("API Response:",o),o}catch(e){throw console.error("Failed to create key:",e),e}},ea=async(e,t,r)=>{try{for(let e of(console.log("Form Values in keyCreateCall:",r),r.description&&(r.metadata||(r.metadata={}),r.metadata.description=r.description,delete r.description,r.metadata=JSON.stringify(r.metadata)),g))if(r[e]){console.log(`formValues.${e}:`,r[e]);try{r[e]=JSON.parse(r[e])}catch(t){throw Error(`Failed to parse ${e}: `+t)}}console.log("Form Values after check:",r);let n=_?`${_}/key/generate`:"/key/generate",o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...r})});if(!o.ok){let e=await o.text();throw N(e),console.error("Error response from the server:",e),Error(e)}let a=await o.json();return console.log("API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},ei=async(e,t,r,n,o,a)=>{let i=_?`${_}/key/generate`:"/key/generate",l={agent_id:t,key_alias:r,models:n.length>0?n:[]};a&&(l.team_id=a),o&&Object.keys(o).length>0&&(l.metadata=o);let s=await fetch(i,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(l)});if(!s.ok)throw N(await s.text()),Error("Failed to create key for agent");return s.json()},el=async(e,t,r)=>{try{if(console.log("Form Values in keyCreateCall:",r),r.description&&(r.metadata||(r.metadata={}),r.metadata.description=r.description,delete r.description,r.metadata=JSON.stringify(r.metadata)),r.auto_create_key=!1,r.metadata){console.log("formValues.metadata:",r.metadata);try{r.metadata=JSON.parse(r.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}console.log("Form Values after check:",r);let n=_?`${_}/user/new`:"/user/new",o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...r})});if(!o.ok){let e=await o.text();throw N(e),console.error("Error response from the server:",e),Error(e)}let a=await o.json();return console.log("API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},es=async(e,t)=>{try{return console.log("in keyDeleteCall:",t),await L.post("/key/delete",{accessToken:e,body:{keys:[t]}})}catch(e){throw console.error("Failed to create key:",e),e}},ec=async(e,t)=>{try{return console.log("in userDeleteCall:",t),await L.post("/user/delete",{accessToken:e,body:{user_ids:t}})}catch(e){throw console.error("Failed to delete user(s):",e),e}},eu=async(e,t)=>{try{return console.log("in teamDeleteCall:",t),await L.post("/team/delete",{accessToken:e,body:{team_ids:[t]}})}catch(e){throw console.error("Failed to delete key:",e),e}},ed=async(e,t=null,r=null,n=null,o=null,a=null,i=null,l=null,s=null,c=null,u=null)=>{try{return await L.get("/user/list",{accessToken:e,query:{user_ids:t&&t.length>0?t.join(","):void 0,page:r||void 0,page_size:n||void 0,user_email:o||void 0,role:a||void 0,team:i||void 0,sso_user_ids:l||void 0,sort_by:s||void 0,sort_order:c||void 0,organization_ids:u&&u.length>0?u.join(","):void 0}})}catch(e){throw console.error("Failed to create key:",e),e}},ef=async(e,t)=>{try{return await L.get("/v2/user/info",{accessToken:e,query:{user_id:t||void 0}})}catch(e){throw console.error("Failed to fetch user info v2:",e),e}},ep=async(e,t)=>{try{return await L.get("/team/info",{accessToken:e,query:{team_id:t||void 0}})}catch(e){throw console.error("Failed to create key:",e),e}},em=async(e,t,r=null,n=null,o=null)=>{try{return await L.get("/team/list",{accessToken:e,query:{user_id:r||void 0,organization_id:t||void 0,team_id:n||void 0,team_alias:o||void 0}})}catch(e){throw console.error("Failed to create key:",e),e}},eg=async e=>{try{console.log("in availableTeamListCall");let t=await L.get("/team/available",{accessToken:e});return console.log("/team/available_teams API Response:",t),t}catch(e){throw e}},eh=async(e,t=null,r=null)=>{try{return await L.get("/organization/list",{accessToken:e,query:{org_id:t||void 0,org_alias:r||void 0}})}catch(e){throw console.error("Failed to create key:",e),e}},ev=async(e,t)=>{try{let r=_?`${_}/organization/info`:"/organization/info";t&&(r=`${r}?organization_id=${t}`),console.log("in teamInfoCall");let n=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.json(),t=w(e);throw N(t),Error(t)}let o=await n.json();return console.log("API Response:",o),o}catch(e){throw console.error("Failed to create key:",e),e}},ey=async(e,t)=>{try{if(console.log("Form Values in organizationCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw console.error("Failed to parse metadata:",e),Error("Failed to parse metadata: "+e)}}let r=await L.post("/organization/new",{accessToken:e,body:{...t}});return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},eb=async(e,t)=>{try{console.log("Form Values in organizationUpdateCall:",t);let r=await L.patch("/organization/update",{accessToken:e,body:{...t}});return console.log("Update Team Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},ew=async(e,t)=>{try{let r=_?`${_}/organization/delete`:"/organization/delete",n=await fetch(r,{method:"DELETE",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({organization_ids:[t]})});if(!n.ok){let e=await n.text();throw N(e),Error(`Error deleting organization: ${e}`)}return await n.json()}catch(e){throw console.error("Failed to delete organization:",e),e}},eC=async(e,t)=>{try{let r=_?`${_}/utils/transform_request`:"/utils/transform_request",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){let e=await n.json(),t=w(e);throw N(t),Error(t)}return await n.json()}catch(e){throw console.error("Failed to create key:",e),e}},ex=async({accessToken:e,endpoint:t,startTime:r,endTime:n,page:o=1,extraQueryParams:a})=>{try{let i,l,s,c,u=(i=t.startsWith("/")?t:`/${t}`,l=_?`${_}${i}`:i,(s=new URLSearchParams).append("start_date",x(r)),s.append("end_date",x(n)),s.append("page_size","1000"),s.append("page",o.toString()),s.append("timezone",new Date().getTimezoneOffset().toString()),a&&Object.entries(a).forEach(([e,t])=>{((e,t,r)=>{if(null!=r){if(Array.isArray(r)){r.length>0&&e.append(t,r.join(","));return}e.append(t,`${r}`)}})(s,e,t)}),(c=s.toString())?`${l}?${c}`:l),d=await fetch(u,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!d.ok){let e=await d.json(),t=w(e);throw N(t),Error(t)}return await d.json()}catch(e){throw console.error(`Failed to fetch daily activity (${t}):`,e),e}},eS=async(e,t,r,n=1,o=null)=>ex({accessToken:e,endpoint:"/user/daily/activity",startTime:t,endTime:r,page:n,extraQueryParams:{user_id:o}}),e$=async(e,t,r,n=1,o=null)=>ex({accessToken:e,endpoint:"/tag/daily/activity",startTime:t,endTime:r,page:n,extraQueryParams:{tags:o}}),eE=async(e,t,r,n=1,o=null)=>ex({accessToken:e,endpoint:"/team/daily/activity",startTime:t,endTime:r,page:n,extraQueryParams:{team_ids:o,exclude_team_ids:"litellm-dashboard"}}),ek=async(e,t,r,n=1,o=null)=>ex({accessToken:e,endpoint:"/organization/daily/activity",startTime:t,endTime:r,page:n,extraQueryParams:{organization_ids:o}}),eO=async(e,t,r,n=1,o=null)=>ex({accessToken:e,endpoint:"/customer/daily/activity",startTime:t,endTime:r,page:n,extraQueryParams:{end_user_ids:o}}),ej=async(e,t,r,n=1,o=null)=>ex({accessToken:e,endpoint:"/agent/daily/activity",startTime:t,endTime:r,page:n,extraQueryParams:{agent_ids:o}}),eT=async e=>{try{let t=_?`${_}/onboarding/get_token`:"/onboarding/get_token";t+=`?invite_link=${e}`;let r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json"}});if(!r.ok){let e=await r.json(),t=w(e);throw N(t),Error(t)}return await r.json()}catch(e){throw console.error("Failed to create key:",e),e}},e_=async(e,t,r,n)=>{try{let o=await L.post("/onboarding/claim_token",{accessToken:e,body:{invitation_link:t,user_id:r,password:n}});return console.log(o),o}catch(e){throw console.error("Failed to delete key:",e),e}},eP=async(e,t,r)=>{try{let n=_?`${_}/key/${t}/regenerate`:`/key/${t}/regenerate`,o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!o.ok){let e=await o.json(),t=w(e);throw N(t),Error(t)}let a=await o.json();return console.log("Regenerate key Response:",a),a}catch(e){throw console.error("Failed to regenerate key:",e),e}},eI=!1,eF=null,eN=async(e,t,r,n=1,o=50,a,i,l,s,c)=>{try{console.log("modelInfoCall:",e,t,r,n,o,a,i,l,s,c);let u=_?`${_}/v2/model/info`:"/v2/model/info",d=new URLSearchParams;d.append("include_team_models","true"),d.append("page",n.toString()),d.append("size",o.toString()),a&&a.trim()&&d.append("search",a.trim()),i&&i.trim()&&d.append("modelId",i.trim()),l&&l.trim()&&d.append("teamId",l.trim()),s&&s.trim()&&d.append("sortBy",s.trim()),c&&c.trim()&&d.append("sortOrder",c.trim()),d.toString()&&(u+=`?${d.toString()}`);let f=await fetch(u,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!f.ok){let e=await f.text();throw e+=`error shown=${eI}`,eI||(e.includes("No model list passed")&&(e="No Models Exist. Click Add Model to get started."),y.default.info(e),eI=!0,eF&&clearTimeout(eF),eF=setTimeout(()=>{eI=!1},1e4)),Error("Network response was not ok")}let p=await f.json();return console.log("modelInfoCall:",p),p}catch(e){throw console.error("Failed to create key:",e),e}},eR=async(e,t)=>{try{let r=_?`${_}/v1/model/info`:"/v1/model/info";r+=`?litellm_model_id=${t}`;let n=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.json(),t=w(e);throw N(t),Error(t)}let o=await n.json();return console.log("modelInfoV1Call:",o),o}catch(e){throw console.error("Failed to create key:",e),e}},eM=async()=>{let e=_?`${_}/public/model_hub`:"/public/model_hub",t=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}});return t.ok?t.json():(console.error(`modelHubPublicModelsCall failed with status ${t.status}`),[])},eA=async()=>{let e=_?`${_}/public/agent_hub`:"/public/agent_hub",t=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}});return t.ok?t.json():(console.error(`agentHubPublicModelsCall failed with status ${t.status}`),[])},eB=async()=>{let e=_?`${_}/public/mcp_hub`:"/public/mcp_hub",t=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}});return t.ok?t.json():(console.error(`mcpHubPublicServersCall failed with status ${t.status}`),[])},ez=async()=>{let e=_?`${_}/public/skill_hub`:"/public/skill_hub",t=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}});return t.ok?t.json():(console.error(`skillHubPublicCall failed with status ${t.status}`),{plugins:[]})},eL=async e=>{try{let t=await L.get("/model_group/info",{accessToken:e});return console.log("modelHubCall:",t),t}catch(e){throw console.error("Failed to create key:",e),e}},eH=async e=>{try{let t=await L.get("/get/allowed_ips",{accessToken:e});return console.log("getAllowedIPs:",t),t.data}catch(e){throw console.error("Failed to get allowed IPs:",e),e}},eD=async(e,t)=>{try{let r=await L.post("/add/allowed_ip",{accessToken:e,body:{ip:t}});return console.log("addAllowedIP:",r),r}catch(e){throw console.error("Failed to add allowed IP:",e),e}},eV=async(e,t)=>{try{let r=await L.post("/delete/allowed_ip",{accessToken:e,body:{ip:t}});return console.log("deleteAllowedIP:",r),r}catch(e){throw console.error("Failed to delete allowed IP:",e),e}},eW=async(e,t)=>{try{return await L.post("/model_hub/update_useful_links",{accessToken:e,body:{useful_links:t}})}catch(e){throw console.error("Failed to create key:",e),e}},eU=async(e,t,r,n=!1,o=null,a=!1,i=!1,l)=>{console.log("in /models calls, globalLitellmHeaderName",A);try{return await L.get("/models",{accessToken:e,query:{include_model_access_groups:"True",return_wildcard_routes:!0===n?"True":void 0,only_model_access_groups:!0===i?"True":void 0,team_id:o||void 0,scope:l||void 0}})}catch(e){throw console.error("Failed to create key:",e),e}},eG=async e=>{try{let t=await L.get("/global/spend/teams",{accessToken:e});return console.log(t),t}catch(e){throw console.error("Failed to create key:",e),e}},eq=async(e,t,r,n)=>{try{let o=_?`${_}/global/spend/tags`:"/global/spend/tags";t&&r&&(o=`${o}?start_date=${t}&end_date=${r}`),n&&(o+=`&tags=${n.join(",")}`),console.log("in tagsSpendLogsCall:",o);let a=await fetch(`${o}`,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=w(e);throw N(t),Error(t)}let i=await a.json();return console.log(i),i}catch(e){throw console.error("Failed to create key:",e),e}},eK=async e=>{try{let t=await L.get("/global/spend/all_tag_names",{accessToken:e});return console.log(t),t}catch(e){throw console.error("Failed to create key:",e),e}},eX=async e=>{try{let t=await L.get("/customer/list",{accessToken:e});return console.log(t),t}catch(e){throw console.error("Failed to fetch end users:",e),e}},eJ=async(e,t)=>{try{return await L.get("/user/filter/ui",{accessToken:e,query:{user_email:t.get("user_email")||void 0,user_id:t.get("user_id")||void 0,team_id:t.get("team_id")||void 0}})}catch(e){throw console.error("Failed to create key:",e),e}},eY=async({accessToken:e,start_date:t,end_date:r,page:n=1,page_size:o=50,params:a={}})=>{try{let i=_?`${_}/spend/logs/ui`:"/spend/logs/ui",l=new URLSearchParams;for(let[e,i]of(l.append("start_date",t),l.append("end_date",r),l.append("page",n.toString()),l.append("page_size",o.toString()),Object.entries(a)))null!=i&&("min_spend"===e||"max_spend"===e?l.append(e,i.toString()):"string"==typeof i&&""!==i&&l.append(e,String(i)));let s=l.toString();s&&(i+=`?${s}`);let c=await fetch(i,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!c.ok){let e=await c.json(),t=w(e);throw N(t),Error(t)}let u=await c.json();return console.log("Spend Logs Response:",u),u}catch(e){throw console.error("Failed to fetch spend logs:",e),e}},eQ=async e=>{try{let t=await L.get("/global/spend/logs",{accessToken:e});return console.log(t),t}catch(e){throw console.error("Failed to create key:",e),e}},eZ=async e=>{try{let t=_?`${_}/global/spend/keys?limit=5`:"/global/spend/keys?limit=5",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.json(),t=w(e);throw N(t),Error(t)}let n=await r.json();return console.log(n),n}catch(e){throw console.error("Failed to create key:",e),e}},e0=async(e,t,r,n)=>{try{let o=await L.post("/global/spend/end_users",{accessToken:e,body:t?{api_key:t,startTime:r,endTime:n}:{startTime:r,endTime:n}});return console.log(o),o}catch(e){throw console.error("Failed to create key:",e),e}},e1=async(e,t,r,n)=>{try{let o=await L.get("/global/spend/provider",{accessToken:e,query:{...r&&n?{start_date:r,end_date:n}:{},...t?{api_key:t}:{}}});return console.log(o),o}catch(e){throw console.error("Failed to fetch spend data:",e),e}},e2=async(e,t,r)=>{try{let n=await L.get("/global/activity",{accessToken:e,query:t&&r?{start_date:t,end_date:r}:void 0});return console.log(n),n}catch(e){throw console.error("Failed to fetch spend data:",e),e}},e4=async(e,t,r)=>{try{let n=_?`${_}/global/activity/cache_hits`:"/global/activity/cache_hits";t&&r&&(n+=`?start_date=${t}&end_date=${r}`);let o={method:"GET",headers:{[A]:`Bearer ${e}`}},a=await fetch(n,o);if(!a.ok){let e=await a.json(),t=w(e);throw N(t),Error(t)}let i=await a.json();return console.log(i),i}catch(e){throw console.error("Failed to fetch spend data:",e),e}},e6=async(e,t,r)=>{try{let n=_?`${_}/global/activity/model`:"/global/activity/model";t&&r&&(n+=`?start_date=${t}&end_date=${r}`);let o={method:"GET",headers:{[A]:`Bearer ${e}`}},a=await fetch(n,o);if(!a.ok){let e=await a.json(),t=w(e);throw N(t),Error(t)}let i=await a.json();return console.log(i),i}catch(e){throw console.error("Failed to fetch spend data:",e),e}},e5=async e=>{try{let t=_?`${_}/global/spend/models?limit=5`:"/global/spend/models?limit=5",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.json(),t=w(e);throw N(t),Error(t)}let n=await r.json();return console.log(n),n}catch(e){throw console.error("Failed to create key:",e),e}},e3=async(e,t)=>{try{let r=_?`${_}/v2/key/info`:"/v2/key/info",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({keys:t})});if(!n.ok){let e=await n.text();if(e.includes("Invalid proxy server token passed"))throw Error("Invalid proxy server token passed");throw N(e),Error("Network response was not ok")}let o=await n.json();return console.log(o),o}catch(e){throw console.error("Failed to create key:",e),e}},e7=async(e,t,r,n)=>{try{console.log("Sending model connection test request:",JSON.stringify(t));let o=_?`${_}/health/test_connection`:"/health/test_connection",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",[A]:`Bearer ${e}`},body:JSON.stringify({litellm_params:t,model_info:r,mode:n})}),i=a.headers.get("content-type");if(!i||!i.includes("application/json")){let e=await a.text();throw console.error("Received non-JSON response:",e),Error(`Received non-JSON response (${a.status}: ${a.statusText}). Check network tab for details.`)}let l=await a.json();if((!a.ok||"error"===l.status)&&"error"!==l.status)return{status:"error",message:l.error?.message||`Connection test failed: ${a.status} ${a.statusText}`};return l}catch(e){throw console.error("Model connection test error:",e),e}},e8=async(e,t)=>{try{console.log("entering keyInfoV1Call");let r=_?`${_}/key/info`:"/key/info";r=`${r}?key=${t}`;let n=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(console.log("response",n),!n.ok){let e=await n.text();N(e),y.default.fromBackend("Failed to fetch key info - "+e)}let o=await n.json();return console.log("data",o),o}catch(e){throw console.error("Failed to fetch key info:",e),e}},e9=async(e,t,r,n,o,a,i,l,s=null,c=null,u=null,d=null)=>{try{return await L.get("/key/list",{accessToken:e,query:{team_id:r||void 0,organization_id:t||void 0,key_alias:n||void 0,key_hash:a||void 0,user_id:o||void 0,page:i?i.toString():void 0,size:l?l.toString():void 0,sort_by:s||void 0,sort_order:c||void 0,expand:u||void 0,status:d||void 0,return_full_object:"true",include_team_keys:"true",include_created_by_keys:"true"}})}catch(e){throw console.error("Failed to create key:",e),e}},te=async(e,t=1,r=50,n,o)=>{try{return await L.get("/key/aliases",{accessToken:e,query:{page:String(t),size:String(r),search:n||void 0,team_id:o||void 0}})}catch(e){throw console.error("Failed to fetch key aliases:",e),e}},tt=async(e,t,r,n=null)=>{try{let o=e=>{let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${n}`};return await L.get("/user/daily/activity/aggregated",{accessToken:e,query:{start_date:o(t),end_date:o(r),timezone:new Date().getTimezoneOffset().toString(),user_id:n||void 0}})}catch(e){throw console.error("Failed to fetch aggregated user daily activity:",e),e}},tr=async e=>{try{let t=await L.get("/user/available_roles",{accessToken:e});return console.log("response from user/available_role",t),t}catch(e){throw e}},tn=async(e,t)=>{try{if(console.log("Form Values in teamCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let r=await L.post("/team/new",{accessToken:e,body:{...t}});return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},to=async(e,t)=>{try{if(console.log("Form Values in credentialCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let r=await L.post("/credentials",{accessToken:e,body:{...t}});return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},ta=async e=>{try{console.log("in credentialListCall");let t=await L.get("/credentials",{accessToken:e});return console.log("/credentials API Response:",t),t}catch(e){throw console.error("Failed to create key:",e),e}},ti=async(e,t,r)=>{try{let n="/credentials";t?n+=`/by_name/${t}`:r&&(n+=`/by_model/${r}`),console.log("in credentialListCall");let o=await L.get(n,{accessToken:e});return console.log("/credentials API Response:",o),o}catch(e){throw console.error("Failed to create key:",e),e}},tl=async(e,t)=>{try{console.log("in credentialDeleteCall:",t);let r=await L.delete(`/credentials/${t}`,{accessToken:e});return console.log(r),r}catch(e){throw console.error("Failed to delete key:",e),e}},ts=async(e,t,r)=>{try{if(console.log("Form Values in credentialUpdateCall:",r),r.metadata){console.log("formValues.metadata:",r.metadata);try{r.metadata=JSON.parse(r.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let n=await L.patch(`/credentials/${t}`,{accessToken:e,body:{...r}});return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},tc=async(e,t)=>{try{if(console.log("Form Values in keyUpdateCall:",t),t.model_tpm_limit){console.log("formValues.model_tpm_limit:",t.model_tpm_limit);try{t.model_tpm_limit=JSON.parse(t.model_tpm_limit)}catch(e){throw Error("Failed to parse model_tpm_limit: "+e)}}if(t.model_rpm_limit){console.log("formValues.model_rpm_limit:",t.model_rpm_limit);try{t.model_rpm_limit=JSON.parse(t.model_rpm_limit)}catch(e){throw Error("Failed to parse model_rpm_limit: "+e)}}let r=_?`${_}/key/update`:"/key/update",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!n.ok){let e=await n.text();throw N(e),console.error("Error response from the server:",e),Error(e)}let o=await n.json();return console.log("Update key Response:",o),o}catch(e){throw console.error("Failed to create key:",e),e}},tu=async(e,t)=>{try{console.log("Form Values in teamUpateCall:",t);let r=_?`${_}/team/update`:"/team/update",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!n.ok){let e=await n.text();throw N(e),console.error("Error response from the server:",e),y.default.fromBackend("Failed to update team settings: "+e),Error(e)}let o=await n.json();return console.log("Update Team Response:",o),o}catch(e){throw console.error("Failed to update team:",e),e}},td=async(e,t,r)=>{try{console.log("Form Values in modelUpateCall:",t);let n=_?`${_}/model/${r}/update`:`/model/${r}/update`,o=await fetch(n,{method:"PATCH",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!o.ok){let e=await o.text();throw N(e),console.error("Error update from the server:",e),Error("Network response was not ok")}let a=await o.json();return console.log("Update model Response:",a),a}catch(e){throw console.error("Failed to update model:",e),e}},tf=async(e,t,r)=>{try{console.log("Form Values in teamMemberAddCall:",r);let n=_?`${_}/team/member_add`:"/team/member_add",o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({team_id:t,member:r})});if(!o.ok){let e=await o.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let r=t?.detail?.error||"Failed to add team member",n=Error(r);throw n.raw=t,n}let a=await o.json();return console.log("API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},tp=async(e,t,r,n,o)=>{try{console.log("Bulk add team members:",{teamId:t,members:r,maxBudgetInTeam:n});let a=_?`${_}/team/bulk_member_add`:"/team/bulk_member_add",i={team_id:t};o?i.all_users=!0:i.members=r,null!=n&&(i.max_budget_in_team=n);let l=await fetch(a,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(i)});if(!l.ok){let e=await l.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let r=t?.detail?.error||"Failed to bulk add team members",n=Error(r);throw n.raw=t,n}let s=await l.json();return console.log("Bulk team member add API Response:",s),s}catch(e){throw console.error("Failed to bulk add team members:",e),e}},tm=async(e,t,r)=>{try{console.log("Form Values in teamMemberUpdateCall:",r),console.log("Budget value:",r.max_budget_in_team),console.log("TPM limit:",r.tpm_limit),console.log("RPM limit:",r.rpm_limit);let n=_?`${_}/team/member_update`:"/team/member_update",o={team_id:t,role:r.role,user_id:r.user_id};void 0!==r.user_email&&(o.user_email=r.user_email),void 0!==r.max_budget_in_team&&null!==r.max_budget_in_team&&(o.max_budget_in_team=r.max_budget_in_team),void 0!==r.tpm_limit&&null!==r.tpm_limit&&(o.tpm_limit=r.tpm_limit),void 0!==r.rpm_limit&&null!==r.rpm_limit&&(o.rpm_limit=r.rpm_limit),void 0!==r.allowed_models&&(o.allowed_models=r.allowed_models),console.log("Final request body:",o);let a=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(o)});if(!a.ok){let e=await a.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let r=t?.detail?.error||"Failed to add team member",n=Error(r);throw n.raw=t,n}let i=await a.json();return console.log("API Response:",i),i}catch(e){throw console.error("Failed to update team member:",e),e}},tg=async(e,t,r)=>{try{console.log("Form Values in teamMemberAddCall:",r);let n=await L.post("/team/member_delete",{accessToken:e,body:{team_id:t,...void 0!==r.user_email&&{user_email:r.user_email},...void 0!==r.user_id&&{user_id:r.user_id}}});return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},th=async(e,t,r)=>{try{console.log("Form Values in teamMemberAddCall:",r);let n=_?`${_}/organization/member_add`:"/organization/member_add",o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,member:r})});if(!o.ok){let e=await o.text();throw N(e),console.error("Error response from the server:",e),Error(e)}let a=await o.json();return console.log("API Response:",a),a}catch(e){throw console.error("Failed to create organization member:",e),e}},tv=async(e,t,r)=>{try{console.log("Form Values in organizationMemberDeleteCall:",r);let n=await L.delete("/organization/member_delete",{accessToken:e,body:{organization_id:t,user_id:r}});return console.log("API Response:",n),n}catch(e){throw console.error("Failed to delete organization member:",e),e}},ty=async(e,t,r)=>{try{console.log("Form Values in organizationMemberUpdateCall:",r);let n=await L.patch("/organization/member_update",{accessToken:e,body:{organization_id:t,...r}});return console.log("API Response:",n),n}catch(e){throw console.error("Failed to update organization member:",e),e}},tb=async(e,t,r)=>{try{console.log("Form Values in userUpdateUserCall:",t);let n={...t};null!==r&&(n.user_role=r);let o=await L.post("/user/update",{accessToken:e,body:n});return console.log("API Response:",o),o}catch(e){throw console.error("Failed to create key:",e),e}},tw=async(e,t,r,n=!1)=>{try{let o;if(console.log("Form Values in userUpdateUserCall:",t),n)o={all_users:!0,user_updates:t};else if(r&&r.length>0){let e=[];for(let n of r)e.push({user_id:n,...t});o={users:e}}else throw Error("Must provide either userIds or set allUsers=true");let a=await L.post("/user/bulk_update",{accessToken:e,body:o});return console.log("API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},tC=async(e,t)=>{try{let r=_?`${_}/health/services?service=${t}`:`/health/services?service=${t}`;console.log("Checking Slack Budget Alerts service health");let n=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.text();throw N(e),Error(e)}return await n.json()}catch(e){throw console.error("Failed to perform health check:",e),e}},tx=async e=>{try{return await L.get("/budget/list",{accessToken:e})}catch(e){throw console.error("Failed to get callbacks:",e),e}},tS=async(e,t,r)=>{try{return await L.get("/get/config/callbacks",{accessToken:e})}catch(e){throw console.error("Failed to get callbacks:",e),e}},t$=async e=>{try{let t=_?`${_}/config/list?config_type=general_settings`:"/config/list?config_type=general_settings",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.json(),t=w(e);throw N(t),Error(t)}return await r.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tE=async e=>{try{return await L.get("/router/settings",{accessToken:e})}catch(e){throw console.error("Failed to get router settings:",e),e}},tk=async e=>{try{return await L.get("/cache/settings",{accessToken:e})}catch(e){throw console.error("Failed to get cache settings:",e),e}},tO=async(e,t)=>{try{return await L.post("/cache/settings/test",{accessToken:e,body:{cache_settings:t}})}catch(e){throw console.error("Failed to test cache connection:",e),e}},tj=async(e,t)=>{try{return await L.post("/cache/settings",{accessToken:e,body:{cache_settings:t}})}catch(e){throw console.error("Failed to update cache settings:",e),e}},tT=async(e,t)=>{try{let r="/config/pass_through_endpoint";return t&&(r+=`/team/${t}`),await L.get(r,{accessToken:e})}catch(e){throw console.error("Failed to get callbacks:",e),e}},t_=async(e,t)=>{try{let r=_?`${_}/config/field/info?field_name=${t}`:`/config/field/info?field_name=${t}`,n=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.json(),t=w(e);throw N(t),Error(t)}return await n.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tP=async(e,t)=>{try{return await L.post("/config/pass_through_endpoint",{accessToken:e,body:{...t}})}catch(e){throw console.error("Failed to set callbacks:",e),e}},tI=async(e,t,r)=>{try{let n=await L.post("/config/field/update",{accessToken:e,body:{field_name:t,field_value:r,config_type:"general_settings"}});return y.default.success("Successfully updated value!"),n}catch(e){throw console.error("Failed to set callbacks:",e),e}},tF=async(e,t)=>{try{let r=await L.post("/config/field/delete",{accessToken:e,body:{field_name:t,config_type:"general_settings"}});return y.default.success("Field reset on proxy"),r}catch(e){throw console.error("Failed to get callbacks:",e),e}},tN=async(e,t)=>{try{let r=_?`${_}/config/pass_through_endpoint?endpoint_id=${t}`:`/config/pass_through_endpoint?endpoint_id=${t}`,n=await fetch(r,{method:"DELETE",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.json(),t=w(e);throw N(t),Error(t)}return await n.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tR=async(e,t)=>{try{return await L.post("/config/update",{accessToken:e,body:{...t}})}catch(e){throw console.error("Failed to set callbacks:",e),e}},tM=async(e,t)=>{try{let r=_?`${_}/health?model_id=${encodeURIComponent(t)}`:`/health?model_id=${encodeURIComponent(t)}`,n=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.json(),t=w(e);throw N(t),Error(t)}return await n.json()}catch(e){throw console.error(`Failed to call /health for model id ${t}:`,e),e}},tA=async e=>{try{let t=_?`${_}/cache/ping`:"/cache/ping",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw N(e),Error(e)}return await r.json()}catch(e){throw console.error("Failed to call /cache/ping:",e),e}},tB=async e=>{try{let t=_?`${_}/health/latest`:"/health/latest",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw N(e),Error(e)}return await r.json()}catch(e){throw console.error("Failed to call /health/latest:",e),e}},tz=async e=>{try{return console.log("Getting proxy UI settings"),console.log("proxyBaseUrl in getProxyUISettings:",_),await L.get("/sso/get/ui_settings",{accessToken:e})}catch(e){throw console.error("Failed to get callbacks:",e),e}},tL=async e=>{try{let t=_?`${_}/get/ui_settings`:"/get/ui_settings",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.json(),t=w(e);return console.error("Failed to get UI settings:",t),null}return await r.json()}catch(e){return console.error("Failed to get UI settings:",e),null}},tH=async e=>{try{return await L.get("/get/mcp_semantic_filter_settings",{accessToken:e})}catch(e){throw console.error("Failed to get MCP semantic filter settings:",e),e}},tD=async(e,t)=>{try{let r=_?`${_}/update/mcp_semantic_filter_settings`:"/update/mcp_semantic_filter_settings",n=await fetch(r,{method:"PATCH",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){let e=await n.json(),t=w(e);throw N(t),Error(t)}return await n.json()}catch(e){throw console.error("Failed to update MCP semantic filter settings:",e),e}},tV=async(e,t,r)=>{try{let n=_?`${_}/v1/responses`:"/v1/responses",o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({model:t,input:[{role:"user",content:r,type:"message"}],tools:[{type:"mcp",server_url:"litellm_proxy",require_approval:"never"}],tool_choice:"required"})}),a=o.headers.get("x-litellm-semantic-filter"),i=o.headers.get("x-litellm-semantic-filter-tools");if(!o.ok){let e=await o.json(),t=w(e);throw N(t),Error(t)}return{data:await o.json(),headers:{filter:a,tools:i}}}catch(e){throw console.error("Failed to test MCP semantic filter:",e),e}},tW=async e=>{try{let t=_?`${_}/v2/guardrails/list`:"/v2/guardrails/list",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok)throw Error(`v2 guardrails/list returned ${r.status}`);return await r.json()}catch(t){console.log("v2/guardrails/list failed, falling back to v1:",t);try{let t=_?`${_}/guardrails/list`:"/guardrails/list",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.json(),t=w(e);throw N(t),Error(t)}return await r.json()}catch(e){throw console.error("Failed to get guardrails list:",e),e}}},tU=async(e,t)=>L.get("/guardrails/submissions",{accessToken:e,query:{...t?.status?{status:t.status}:{},...t?.team_id?{team_id:t.team_id}:{},...t?.team_guardrail!==void 0?{team_guardrail:t.team_guardrail}:{},...t?.search?{search:t.search}:{}}}),tG=async(e,t)=>L.post(`/guardrails/submissions/${encodeURIComponent(t)}/approve`,{accessToken:e}),tq=async(e,t)=>L.post(`/guardrails/submissions/${encodeURIComponent(t)}/reject`,{accessToken:e}),tK=async(e,t,r)=>{try{let n=_?`${_}/guardrails/usage/overview`:"/guardrails/usage/overview",o=new URLSearchParams;t&&o.append("start_date",t),r&&o.append("end_date",r),o.toString()&&(n+=`?${o.toString()}`);let a=await fetch(n,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!a.ok){let e=await a.json();throw Error(w(e))}return a.json()}catch(e){throw console.error("Failed to get guardrails usage overview:",e),e}},tX=async(e,t,r,n)=>{try{let o=_?`${_}/guardrails/usage/detail/${encodeURIComponent(t)}`:`/guardrails/usage/detail/${encodeURIComponent(t)}`,a=new URLSearchParams;r&&a.append("start_date",r),n&&a.append("end_date",n),a.toString()&&(o+=`?${a.toString()}`);let i=await fetch(o,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!i.ok){let e=await i.json();throw Error(w(e))}return i.json()}catch(e){throw console.error("Failed to get guardrails usage detail:",e),e}},tJ=async(e,t)=>{try{let r=_?`${_}/guardrails/usage/logs`:"/guardrails/usage/logs",n=new URLSearchParams;t.guardrailId&&n.append("guardrail_id",t.guardrailId),t.policyId&&n.append("policy_id",t.policyId),null!=t.page&&n.append("page",String(t.page)),null!=t.pageSize&&n.append("page_size",String(t.pageSize)),t.action&&n.append("action",t.action),t.startDate&&n.append("start_date",t.startDate),t.endDate&&n.append("end_date",t.endDate),n.toString()&&(r+=`?${n.toString()}`);let o=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.json();throw Error(w(e))}return o.json()}catch(e){throw console.error("Failed to get guardrails usage logs:",e),e}},tY=async e=>{try{return await L.get("/policies/list",{accessToken:e})}catch(e){throw console.error("Failed to get policies list:",e),e}},tQ=async(e,t,r)=>{try{let n=_?`${_}/utils/test_policies_and_guardrails`:"/utils/test_policies_and_guardrails",o=await fetch(n,{method:"POST",signal:r,headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({policy_names:t.policy_names??null,guardrail_names:t.guardrail_names??null,inputs:t.inputs??null,inputs_list:t.inputs_list??null,request_data:t.request_data??{},input_type:t.input_type??"request",agent_id:t.agent_id??null})});if(!o.ok){let e=await o.text(),t="Failed to test policies and guardrails";try{let r=JSON.parse(e);r.detail?t="string"==typeof r.detail?r.detail:JSON.stringify(r.detail):r.message&&(t=r.message)}catch{t=e||t}throw N(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to test policies and guardrails:",e),e}},tZ=async(e,t)=>{try{return await L.get(`/policy/info/${t}`,{accessToken:e})}catch(e){throw console.error(`Failed to get policy info for ${t}:`,e),e}},t0=async e=>{try{return await L.get("/policy/templates",{accessToken:e})}catch(e){throw console.error("Failed to get policy templates:",e),e}},t1=async(e,t,r,n,o)=>{try{let a=_?`${_}/policy/templates/enrich`:"/policy/templates/enrich",i={template_id:t,parameters:r};n&&(i.model=n),o&&(i.competitors=o);let l=await fetch(a,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(i)});if(!l.ok){let e=await l.json(),t=w(e);throw N(t),Error(t)}return await l.json()}catch(e){throw console.error("Failed to enrich policy template:",e),e}},t2=async(e,t,r,n)=>{try{return await L.post("/policy/templates/suggest",{accessToken:e,body:{attack_examples:t.filter(e=>e.trim()),description:r,model:n}})}catch(e){throw console.error("Failed to suggest policy templates:",e),e}},t4=async(e,t,r)=>{try{return await L.post("/policy/templates/test",{accessToken:e,body:{guardrail_definitions:t,text:r}})}catch(e){throw console.error("Failed to test policy template:",e),e}},t6=async(e,t,r,n,o,a,i,l,s)=>{let c=_?`${_}/policy/templates/enrich/stream`:"/policy/templates/enrich/stream",u={template_id:t,parameters:r,model:n};l?.instruction&&(u.instruction=l.instruction),l?.existingCompetitors&&(u.competitors=l.existingCompetitors);let d=await fetch(c,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(u)});if(!d.ok){let e=w(await d.json());throw N(e),Error(e)}let f=d.body?.getReader();if(!f)throw Error("No response body");let p=new TextDecoder,m="";for(;;){let{done:e,value:t}=await f.read();if(e)break;let r=(m+=p.decode(t,{stream:!0})).split("\n");for(let e of(m=r.pop()||"",r))if(e.startsWith("data: "))try{let t=JSON.parse(e.slice(6));"competitor"===t.type?o(t.name):"status"===t.type?s?.(t.message):"done"===t.type?a(t):"error"===t.type&&i?.(t.message)}catch{}}},t5=async(e,t,r,n,o,a,i,l,s)=>{let c=_?`${_}/usage/ai/chat`:"/usage/ai/chat",u=await fetch(c,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({messages:t,model:r}),signal:s});if(!u.ok){let e=w(await u.json());throw N(e),Error(e)}let d=u.body?.getReader();if(!d)throw Error("No response body");let f=new TextDecoder,p="";for(;;){let{done:e,value:t}=await d.read();if(e)break;let r=(p+=f.decode(t,{stream:!0})).split("\n");for(let e of(p=r.pop()||"",r))if(e.startsWith("data: "))try{let t=JSON.parse(e.slice(6));"chunk"===t.type?n(t.content):"status"===t.type?i?.(t.message):"tool_call"===t.type?l?.(t):"done"===t.type?o():"error"===t.type&&a?.(t.message)}catch{}}},t3=async(e,t)=>{try{return await L.post("/policies",{accessToken:e,body:t})}catch(e){throw console.error("Failed to create policy:",e),e}},t7=async(e,t,r)=>{try{return await L.put(`/policies/${t}`,{accessToken:e,body:r})}catch(e){throw console.error("Failed to update policy:",e),e}},t8=async(e,t)=>{try{let r=encodeURIComponent(t),n=_?`${_}/policies/name/${r}/versions`:`/policies/name/${r}/versions`,o=await fetch(n,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=w(e);throw N(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to list policy versions:",e),e}},t9=async(e,t,r)=>{try{let n=encodeURIComponent(t),o=_?`${_}/policies/name/${n}/versions`:`/policies/name/${n}/versions`,a=await fetch(o,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({source_policy_id:r??void 0})});if(!a.ok){let e=await a.json(),t=w(e);throw N(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to create policy version:",e),e}},re=async(e,t,r)=>{try{return await L.put(`/policies/${t}/status`,{accessToken:e,body:{version_status:r}})}catch(e){throw console.error("Failed to update policy version status:",e),e}},rt=async(e,t)=>{try{return await L.delete(`/policies/${t}`,{accessToken:e})}catch(e){throw console.error("Failed to delete policy:",e),e}},rr=async(e,t)=>{try{return await L.get(`/policies/${t}`,{accessToken:e})}catch(e){throw console.error("Failed to get policy info:",e),e}},rn=async e=>{try{return await L.get("/policies/attachments/list",{accessToken:e})}catch(e){throw console.error("Failed to get policy attachments list:",e),e}},ro=async(e,t)=>{try{return await L.post("/policies/attachments",{accessToken:e,body:t})}catch(e){throw console.error("Failed to create policy attachment:",e),e}},ra=async(e,t)=>{try{let r=_?`${_}/policies/attachments/${t}`:`/policies/attachments/${t}`,n=await fetch(r,{method:"DELETE",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.json(),t=w(e);throw N(t),Error(t)}return await n.json()}catch(e){throw console.error("Failed to delete policy attachment:",e),e}},ri=async(e,t,r)=>{try{return await L.post("/policies/test-pipeline",{accessToken:e,body:{pipeline:t,test_messages:r}})}catch(e){throw console.error("Failed to test pipeline:",e),e}},rl=async(e,t)=>{try{let r=_?`${_}/policies/${t}/resolved-guardrails`:`/policies/${t}/resolved-guardrails`,n=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.json(),t=w(e);throw N(t),Error(t)}return await n.json()}catch(e){throw console.error("Failed to get resolved guardrails:",e),e}},rs=async(e,t)=>{try{return await L.post("/policies/resolve",{accessToken:e,body:t})}catch(e){throw console.error("Failed to resolve policies:",e),e}},rc=async(e,t)=>{try{let r=_?`${_}/policies/attachments/estimate-impact`:"/policies/attachments/estimate-impact",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){let e=await n.json(),t=w(e);throw N(t),Error(t)}return await n.json()}catch(e){throw console.error("Failed to estimate attachment impact:",e),e}},ru=async(e,t)=>{try{return await L.get("/prompts/list",{accessToken:e,query:{environment:t||void 0}})}catch(e){throw console.error("Failed to get prompts list:",e),e}},rd=async(e,t,r)=>{try{return await L.get(`/prompts/${t}/info`,{accessToken:e,query:{environment:r||void 0}})}catch(e){throw console.error("Failed to get prompt info:",e),e}},rf=async(e,t,r)=>{try{let n=_?`${_}/prompts/${t}/versions`:`/prompts/${t}/versions`;r&&(n+=`?environment=${encodeURIComponent(r)}`);let o=await fetch(n,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=w(e);throw 404!==o.status&&N(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get prompt versions:",e),e}},rp=async(e,t)=>{try{return await L.post("/prompts",{accessToken:e,body:t})}catch(e){throw console.error("Failed to create prompt:",e),e}},rm=async(e,t,r)=>{try{return await L.put(`/prompts/${t}`,{accessToken:e,body:r})}catch(e){throw console.error("Failed to update prompt:",e),e}},rg=async(e,t)=>{try{return await L.delete(`/prompts/${t}`,{accessToken:e})}catch(e){throw console.error("Failed to delete prompt:",e),e}},rh=async(e,t)=>{try{let r=new FormData;r.append("file",t);let n=_?`${_}/utils/dotprompt_json_converter`:"/utils/dotprompt_json_converter",o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`},body:r});if(!o.ok){let e=await o.json(),t=w(e);throw N(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to convert prompt file:",e),e}},rv=async(e,t)=>{try{let r=_?`${_}/v1/agents`:"/v1/agents",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!n.ok){let e=await n.text();throw N(e),Error(e)}let o=await n.json();return console.log("Create agent response:",o),o}catch(e){throw console.error("Failed to create agent:",e),e}},ry=async(e,t,r)=>{let n=_?`${_}/v1/a2a/discover`:"/v1/a2a/discover",o={url:t};r?.discovery_mode&&(o.discovery_mode=r.discovery_mode),r?.params&&(o.params=r.params);let a=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(o)});if(!a.ok){let e=await a.text();throw N(e),Error(e)}return await a.json()},rb=async(e,t)=>{try{let r=_?`${_}/guardrails`:"/guardrails",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({guardrail:t})});if(!n.ok){let e=await n.text();throw N(e),Error(e)}let o=await n.json();return console.log("Create guardrail response:",o),o}catch(e){throw console.error("Failed to create guardrail:",e),e}},rw=async(e,t,r)=>{try{let n=_?`${_}/spend/logs/ui/${t}?start_date=${encodeURIComponent(r)}`:`/spend/logs/ui/${t}?start_date=${encodeURIComponent(r)}`;console.log("Fetching log details from:",n);let o=await fetch(n,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=w(e);throw N(t),Error(t)}let a=await o.json();return console.log("Fetched log details:",a),a}catch(e){throw console.error("Failed to fetch log details:",e),e}},rC=async e=>{try{let t=await L.get("/get/internal_user_settings",{accessToken:e});return console.log("Fetched SSO settings:",t),t}catch(e){throw console.error("Failed to fetch SSO settings:",e),e}},rx=async(e,t)=>{try{let r=_?`${_}/update/internal_user_settings`:"/update/internal_user_settings";console.log("Updating internal user settings:",t);let n=await fetch(r,{method:"PATCH",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){let e=await n.text();throw N(e),Error(e)}let o=await n.json();return console.log("Updated internal user settings:",o),y.default.success("Internal user settings updated successfully"),o}catch(e){throw console.error("Failed to update internal user settings:",e),e}},rS=async e=>{try{let t=_?`${_}/v1/mcp/openapi-registry`:"/v1/mcp/openapi-registry",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.json();throw Error(w(e))}return await r.json()}catch(e){throw console.error("Failed to fetch OpenAPI registry:",e),e}},r$=async e=>{try{return await L.get("/v1/mcp/discover",{accessToken:e})}catch(e){throw console.error("Failed to fetch discoverable MCP servers:",e),e}},rE=async(e,t)=>{try{return await L.get("/v1/mcp/server",{accessToken:e,query:{team_id:t||void 0}})}catch(e){throw console.error("Failed to fetch MCP servers:",e),e}},rk=async(e,t)=>{try{return await L.get("/v1/mcp/server/health",{accessToken:e,query:{server_ids:t&&t.length>0?t:void 0}})}catch(e){throw console.error("Failed to fetch MCP server health:",e),e}},rO=async e=>{try{let t=await L.get("/v1/mcp/access_groups",{accessToken:e});return console.log("Fetched MCP access groups:",t),t.access_groups||[]}catch(e){throw console.error("Failed to fetch MCP access groups:",e),e}},rj=async e=>{try{let t=_?`${_}/v1/mcp/network/client-ip`:"/v1/mcp/network/client-ip",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`}});if(!r.ok)return null;return(await r.json()).ip||null}catch{return null}},rT=async(e,t)=>{try{console.log("Form Values in createMCPServer:",t);let r=await L.post("/v1/mcp/server",{accessToken:e,body:{...t}});return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},r_=async(e,t)=>{try{return await L.put("/v1/mcp/server",{accessToken:e,body:t})}catch(e){throw console.error("Failed to update MCP server:",e),e}},rP=async(e,t)=>{try{console.log("in deleteMCPServer:",t),await L.delete(`/v1/mcp/server/${t}`,{accessToken:e})}catch(e){throw console.error("Failed to delete key:",e),e}},rI=async e=>{try{return await L.get("/v1/mcp/toolset",{accessToken:e})}catch(e){throw console.error("Failed to fetch MCP toolsets:",e),e}},rF=async(e,t)=>{try{return await L.post("/v1/mcp/toolset",{accessToken:e,body:t})}catch(e){throw console.error("Failed to create MCP toolset:",e),e}},rN=async(e,t)=>{try{return await L.put("/v1/mcp/toolset",{accessToken:e,body:t})}catch(e){throw console.error("Failed to update MCP toolset:",e),e}},rR=async(e,t)=>{try{await L.delete(`/v1/mcp/toolset/${t}`,{accessToken:e})}catch(e){throw console.error("Failed to delete MCP toolset:",e),e}},rM=async(e,t)=>{try{return await L.post("/v1/mcp/server/register",{accessToken:e,body:t})}catch(e){throw console.error("Failed to register MCP server:",e),e}},rA=async e=>{try{let t=(_?`${_}`:"")+"/v1/mcp/server/submissions",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.json().catch(()=>({})),t=w(e);throw N(t),Error(t)}return r.json()}catch(e){throw console.error("Failed to fetch MCP submissions:",e),e}},rB=async(e,t)=>{try{let r=(_?`${_}`:"")+`/v1/mcp/server/${encodeURIComponent(t)}/approve`,n=await fetch(r,{method:"PUT",headers:{[A]:`Bearer ${e}`}});if(!n.ok){let e=await n.json().catch(()=>({})),t=w(e);throw N(t),Error(t)}return n.json()}catch(e){throw console.error("Failed to approve MCP server:",e),e}},rz=async(e,t,r)=>{try{let n=(_?`${_}`:"")+`/v1/mcp/server/${encodeURIComponent(t)}/reject`,o=await fetch(n,{method:"PUT",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({review_notes:r??null})});if(!o.ok){let e=await o.json().catch(()=>({})),t=w(e);throw N(t),Error(t)}return o.json()}catch(e){throw console.error("Failed to reject MCP server:",e),e}},rL=async e=>{try{let t=await L.get("/search_tools/list",{accessToken:e});return console.log("Fetched search tools:",t),t}catch(e){throw console.error("Failed to fetch search tools:",e),e}},rH=async(e,t)=>{try{console.log("Creating search tool with values:",t);let r=await L.post("/search_tools",{accessToken:e,body:{search_tool:t}});return console.log("Created search tool:",r),r}catch(e){throw console.error("Failed to create search tool:",e),e}},rD=async(e,t,r)=>{try{console.log("Updating search tool with ID:",t,"values:",r);let n=await L.put(`/search_tools/${t}`,{accessToken:e,body:{search_tool:r}});return console.log("Updated search tool:",n),n}catch(e){throw console.error("Failed to update search tool:",e),e}},rV=async(e,t)=>{try{console.log("Deleting search tool:",t);let r=await L.delete(`/search_tools/${t}`,{accessToken:e});return console.log("Deleted search tool:",r),r}catch(e){throw console.error("Failed to delete search tool:",e),e}},rW=async e=>{try{let t=_?`${_}/search_tools/ui/available_providers`:"/search_tools/ui/available_providers";console.log("Fetching available search providers from:",t);let r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.json(),t=w(e);throw N(t),Error(t)}let n=await r.json();return console.log("Fetched available search providers:",n),n}catch(e){throw console.error("Failed to fetch available search providers:",e),e}},rU=async(e,t)=>{try{let r=await L.post("/search_tools/test_connection",{accessToken:e,body:{litellm_params:t}});return console.log("Test connection response:",r),r}catch(e){throw console.error("Failed to test search tool connection:",e),e}},rG=async(e,t,r)=>{let n,o=_?`${_}/mcp-rest/tools/list?server_id=${t}`:`/mcp-rest/tools/list?server_id=${t}`;console.log("Fetching MCP tools from:",o);let a={[A]:`Bearer ${e}`,"Content-Type":"application/json",...r};try{n=await fetch(o,{method:"GET",headers:a})}catch(e){return console.error("Failed to fetch MCP tools (network error):",e),{tools:[],error:"network_error",message:e instanceof Error?e.message:"Failed to fetch MCP tools",stack_trace:null}}let i=null;try{i=await n.json()}catch(e){return console.error("Failed to parse MCP tools response:",e),{tools:[],error:"parse_error",message:"Failed to parse MCP tools response",status:n.status,statusText:n.statusText,stack_trace:null}}if(console.log("Fetched MCP tools response:",i),!n.ok){let e=i&&(i.message||i.error)||"Failed to fetch MCP tools";return{tools:[],error:i&&i.error||`http_${n.status}`,message:e,status:n.status,statusText:n.statusText,details:i,stack_trace:null}}return i},rq=async(e,t,r,n,o)=>{try{let a=_?`${_}/mcp-rest/tools/call`:"/mcp-rest/tools/call";console.log("Calling MCP tool:",r,"with arguments:",n,"for server:",t);let i={[A]:`Bearer ${e}`,"Content-Type":"application/json",...o?.customHeaders||{}},l={server_id:t,name:r,arguments:n};o?.guardrails&&o.guardrails.length>0&&(l.litellm_metadata={guardrails:o.guardrails});let s=await fetch(a,{method:"POST",headers:i,body:JSON.stringify(l)});if(!s.ok){let e="Network response was not ok",t=null,r=await s.text();try{let n=JSON.parse(r);n.detail?"string"==typeof n.detail?e=n.detail:"object"==typeof n.detail&&(e=n.detail.message||n.detail.error||"An error occurred",t=n.detail):e=n.message||n.error||e}catch(t){console.error("Failed to parse JSON error response:",t),r&&(e=r)}let n=Error(e);throw n.status=s.status,n.statusText=s.statusText,n.details=t,N(e),n}let c=await s.json();return console.log("MCP tool call response:",c),c}catch(e){throw console.error("Failed to call MCP tool:",e),console.error("Error type:",typeof e),e instanceof Error&&(console.error("Error message:",e.message),console.error("Error stack:",e.stack)),e}},rK=async(e,t)=>{try{let r=_?`${_}/tag/new`:"/tag/new",n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",[A]:`Bearer ${e}`},body:JSON.stringify(t)});if(!n.ok){let e=await n.text();await N(e);return}return await n.json()}catch(e){throw console.error("Error creating tag:",e),e}},rX=async(e,t)=>{try{let r=_?`${_}/tag/update`:"/tag/update",n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",[A]:`Bearer ${e}`},body:JSON.stringify(t)});if(!n.ok){let e=await n.text();await N(e);return}return await n.json()}catch(e){throw console.error("Error updating tag:",e),e}},rJ=async(e,t)=>{try{let r=_?`${_}/tag/info`:"/tag/info",n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",[A]:`Bearer ${e}`},body:JSON.stringify({names:t})});if(!n.ok){let e=await n.text();return await N(e),{}}return await n.json()}catch(e){throw console.error("Error getting tag info:",e),e}},rY=e=>{let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${n}`},rQ=async(e,t,r)=>{try{let n=_?`${_}/tag/list`:"/tag/list";if(t&&r){let e=new URLSearchParams({start_date:rY(t),end_date:rY(r)});n=`${n}?${e.toString()}`}let o=await fetch(n,{method:"GET",headers:{[A]:`Bearer ${e}`}});if(!o.ok){let e=await o.text();return await N(e),{}}return await o.json()}catch(e){throw console.error("Error listing tags:",e),e}},rZ=async(e,t)=>{try{let r=_?`${_}/tag/delete`:"/tag/delete",n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",[A]:`Bearer ${e}`},body:JSON.stringify({name:t})});if(!n.ok){let e=await n.text();await N(e);return}return await n.json()}catch(e){throw console.error("Error deleting tag:",e),e}},r0=async e=>{try{let t=await L.get("/get/default_team_settings",{accessToken:e});return console.log("Fetched default team settings:",t),t}catch(e){throw console.error("Failed to fetch default team settings:",e),e}},r1=async(e,t)=>{try{console.log("Updating default team settings:",t);let r=await L.patch("/update/default_team_settings",{accessToken:e,body:t});return console.log("Updated default team settings:",r),r}catch(e){throw console.error("Failed to update default team settings:",e),e}},r2=async(e,t)=>{try{let r=_?`${_}/team/permissions_list?team_id=${t}`:`/team/permissions_list?team_id=${t}`,n=await fetch(r,{method:"GET",headers:{"Content-Type":"application/json",[A]:`Bearer ${e}`}});if(!n.ok){let e=await n.json(),t=w(e);return console.error("Available permissions fetch failed:",t),{all_available_permissions:[],team_member_permissions:[]}}return await n.json()}catch(e){throw console.error("Failed to get team permissions:",e),e}},r4=async(e,t,r)=>{try{let n=await L.post("/team/permissions_update",{accessToken:e,body:{team_id:t,team_member_permissions:r}});return console.log("Team permissions response:",n),n}catch(e){throw console.error("Failed to update team permissions:",e),e}},r6=async(e,t)=>{try{let r=_?`${_}/spend/logs/session/ui?session_id=${encodeURIComponent(t)}`:`/spend/logs/session/ui?session_id=${encodeURIComponent(t)}`,n=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.json(),t=w(e);throw N(t),Error(t)}return await n.json()}catch(e){throw console.error("Failed to fetch session logs:",e),e}},r5=async(e,t)=>{try{let r=_?`${_}/vector_store/new`:"/vector_store/new",n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",[A]:`Bearer ${e}`},body:JSON.stringify(t)});if(!n.ok){let e=await n.json();throw Error(e.detail||"Failed to create vector store")}return await n.json()}catch(e){throw console.error("Error creating vector store:",e),e}},r3=async(e,t=1,r=100)=>{try{let t=_?`${_}/vector_store/list`:"/vector_store/list",r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",[A]:`Bearer ${e}`}});if(!r.ok){let e=await r.json();throw Error(e.detail||"Failed to list vector stores")}return await r.json()}catch(e){throw console.error("Error listing vector stores:",e),e}},r7=async(e,t)=>{try{let r=_?`${_}/vector_store/delete`:"/vector_store/delete",n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",[A]:`Bearer ${e}`},body:JSON.stringify({vector_store_id:t})});if(!n.ok){let e=await n.json();throw Error(e.detail||"Failed to delete vector store")}return await n.json()}catch(e){throw console.error("Error deleting vector store:",e),e}},r8=async(e,t)=>{try{let r=_?`${_}/vector_store/info`:"/vector_store/info",n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",[A]:`Bearer ${e}`},body:JSON.stringify({vector_store_id:t})});if(!n.ok){let e=await n.json();throw Error(e.detail||"Failed to get vector store info")}return await n.json()}catch(e){throw console.error("Error getting vector store info:",e),e}},r9=async(e,t)=>{try{let r=_?`${_}/vector_store/update`:"/vector_store/update",n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",[A]:`Bearer ${e}`},body:JSON.stringify(t)});if(!n.ok){let e=await n.json();throw Error(e.detail||"Failed to update vector store")}return await n.json()}catch(e){throw console.error("Error updating vector store:",e),e}},ne=async(e,t,r,n,o,a,i)=>{try{let l=_?`${_}/rag/ingest`:"/rag/ingest",s=new FormData;s.append("file",t);let c={ingest_options:{vector_store:{custom_llm_provider:r,...n&&{vector_store_id:n},...i&&i}}};(o||a)&&(c.ingest_options.litellm_vector_store_params={},o&&(c.ingest_options.litellm_vector_store_params.vector_store_name=o),a&&(c.ingest_options.litellm_vector_store_params.vector_store_description=a)),s.append("request",JSON.stringify(c));let u=await fetch(l,{method:"POST",headers:{[A]:`Bearer ${e}`},body:s});if(!u.ok){let e=await u.json();throw Error(e.error?.message||e.detail||"Failed to ingest document")}return await u.json()}catch(e){throw console.error("Error ingesting document:",e),e}},nt=async e=>{try{let t=_?`${_}/email/event_settings`:"/email/event_settings",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw N(e),Error("Failed to get email event settings")}let n=await r.json();return console.log("Email event settings response:",n),n}catch(e){throw console.error("Failed to get email event settings:",e),e}},nr=async(e,t)=>{try{let r=_?`${_}/email/event_settings`:"/email/event_settings",n=await fetch(r,{method:"PATCH",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){let e=await n.text();throw N(e),Error("Failed to update email event settings")}let o=await n.json();return console.log("Update email event settings response:",o),o}catch(e){throw console.error("Failed to update email event settings:",e),e}},nn=async e=>{try{let t=_?`${_}/email/event_settings/reset`:"/email/event_settings/reset",r=await fetch(t,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw N(e),Error("Failed to reset email event settings")}let n=await r.json();return console.log("Reset email event settings response:",n),n}catch(e){throw console.error("Failed to reset email event settings:",e),e}},no=async(e,t)=>{try{let r=_?`${_}/v1/agents/${t}`:`/v1/agents/${t}`,n=await fetch(r,{method:"DELETE",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.text();throw N(e),Error(e)}let o=await n.json();return console.log("Delete agent response:",o),o}catch(e){throw console.error("Failed to delete agent:",e),e}},na=async(e,t)=>{try{let r=_?`${_}/v1/agents/make_public`:"/v1/agents/make_public",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({agent_ids:t})});if(!n.ok){let e=await n.text();throw N(e),Error(e)}let o=await n.json();return console.log("Make agents public response:",o),o}catch(e){throw console.error("Failed to make agents public:",e),e}},ni=async(e,t)=>{try{let r=_?`${_}/v1/mcp/make_public`:"/v1/mcp/make_public",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({mcp_server_ids:t})});if(!n.ok){let e=await n.text();throw N(e),Error(e)}let o=await n.json();return console.log("Make agents public response:",o),o}catch(e){throw console.error("Failed to make agents public:",e),e}},nl=async(e,t)=>{try{let r=_?`${_}/guardrails/${t}`:`/guardrails/${t}`,n=await fetch(r,{method:"DELETE",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.text();throw N(e),Error(e)}let o=await n.json();return console.log("Delete guardrail response:",o),o}catch(e){throw console.error("Failed to delete guardrail:",e),e}},ns=async e=>{try{let t=_?`${_}/guardrails/ui/add_guardrail_settings`:"/guardrails/ui/add_guardrail_settings",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw N(e),Error("Failed to get guardrail UI settings")}let n=await r.json();return console.log("Guardrail UI settings response:",n),n}catch(e){throw console.error("Failed to get guardrail UI settings:",e),e}},nc=async e=>{try{let t=_?`${_}/guardrails/ui/provider_specific_params`:"/guardrails/ui/provider_specific_params",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw N(e),Error("Failed to get guardrail provider specific parameters")}let n=await r.json();return console.log("Guardrail provider specific params response:",n),n}catch(e){throw console.error("Failed to get guardrail provider specific parameters:",e),e}},nu=async(e,t)=>{try{let r=encodeURIComponent(t),n=_?`${_}/guardrails/ui/category_yaml/${r}`:`/guardrails/ui/category_yaml/${r}`;console.log(`Fetching category YAML from: ${n}`);let o=await fetch(n,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw console.error(`Failed to get category YAML. Status: ${o.status}, Error:`,e),N(e),Error(`Failed to get category YAML: ${o.status} ${e}`)}let a=await o.json();return console.log("Category YAML response:",a),a}catch(e){throw console.error("Failed to get category YAML:",e),e}},nd=async e=>{try{let t=_?`${_}/guardrails/ui/major_airlines`:"/guardrails/ui/major_airlines",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw console.error(`Failed to get major airlines. Status: ${r.status}, Error:`,e),N(e),Error(`Failed to get major airlines: ${r.status} ${e}`)}return await r.json()}catch(e){throw console.error("Failed to get major airlines:",e),e}},nf=async(e,t=!1)=>{try{let r=t?"?health_check=true":"",n=_?`${_}/v1/agents${r}`:`/v1/agents${r}`,o=await fetch(n,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw N(e),Error("Failed to get agents list")}let a=await o.json();return console.log("Agents list response:",a),{agents:a}}catch(e){throw console.error("Failed to get agents list:",e),e}},np=async(e,t)=>{try{let r=_?`${_}/v1/agents/${t}`:`/v1/agents/${t}`,n=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.text();throw N(e),Error("Failed to get agent info")}let o=await n.json();return console.log("Agent info response:",o),o}catch(e){throw console.error("Failed to get agent info:",e),e}},nm=async(e,t)=>{try{let r=_?`${_}/guardrails/${t}/info`:`/guardrails/${t}/info`,n=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.text();throw N(e),Error("Failed to get guardrail info")}let o=await n.json();return console.log("Guardrail info response:",o),o}catch(e){throw console.error("Failed to get guardrail info:",e),e}},ng=async(e,t,r)=>{try{let n=_?`${_}/v1/agents/${t}`:`/v1/agents/${t}`,o=await fetch(n,{method:"PATCH",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!o.ok){let e=await o.text();throw N(e),Error("Failed to patch agent")}let a=await o.json();return console.log("Patch agent response:",a),a}catch(e){throw console.error("Failed to update guardrail:",e),e}},nh=async(e,t,r)=>{try{let n=_?`${_}/guardrails/${t}`:`/guardrails/${t}`,o=await fetch(n,{method:"PATCH",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!o.ok){let e=await o.text();throw N(e),Error("Failed to update guardrail")}let a=await o.json();return console.log("Update guardrail response:",a),a}catch(e){throw console.error("Failed to update guardrail:",e),e}},nv=async(e,t,r,n,o)=>{try{let a=_?`${_}/guardrails/apply_guardrail`:"/guardrails/apply_guardrail",i={guardrail_name:t,text:r};n&&(i.language=n),o&&o.length>0&&(i.entities=o);let l=await fetch(a,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(i)});if(!l.ok){let e=await l.text(),t="Failed to apply guardrail";try{let r=JSON.parse(e);r.error?.message?t=r.error.message:r.detail?t=r.detail:r.message&&(t=r.message)}catch(r){t=e||t}throw N(e),Error(t)}let s=await l.json();return console.log("Apply guardrail response:",s),s}catch(e){throw console.error("Failed to apply guardrail:",e),e}},ny=async(e,t)=>{try{let r=_?`${_}/guardrails/test_custom_code`:"/guardrails/test_custom_code",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){let e=await n.text(),t="Failed to test custom code guardrail";try{let r=JSON.parse(e);r.error?.message?t=r.error.message:r.detail?t=r.detail:r.message&&(t=r.message)}catch(r){t=e||t}throw N(e),Error(t)}let o=await n.json();return console.log("Test custom code guardrail response:",o),o}catch(e){throw console.error("Failed to test custom code guardrail:",e),e}},nb=async(e,t)=>{try{let r=_?`${_}/guardrails/validate_blocked_words_file`:"/guardrails/validate_blocked_words_file",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({file_content:t})});if(!n.ok){let e=await n.text();throw N(e),Error("Failed to validate blocked words file")}let o=await n.json();return console.log("Validate blocked words file response:",o),o}catch(e){throw console.error("Failed to validate blocked words file:",e),e}},nw=async e=>{try{let t=await L.get("/get/sso_settings",{accessToken:e});return console.log("Fetched SSO configuration:",t),t}catch(e){throw console.error("Failed to fetch SSO configuration:",e),e}},nC=async(e,t)=>{try{let r=_?`${_}/update/sso_settings`:"/update/sso_settings";console.log("Updating SSO configuration:",t);let n=await fetch(r,{method:"PATCH",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){let e=await n.json(),t="object"==typeof e?.detail?e.detail?.error||e.detail?.message:e?.detail,r="string"==typeof t&&t.length>0?t:w(e);N(r);let o=Error(r);throw e?.detail!==void 0&&(o.detail=e.detail),o.rawError=e,o}let o=await n.json();return console.log("Updated SSO configuration:",o),o}catch(e){throw console.error("Failed to update SSO configuration:",e),e}},nx=async({accessToken:e,page:t=1,page_size:r=50,params:n={}})=>{try{let o=_?`${_}/audit`:"/audit",a=new URLSearchParams;for(let[e,o]of(a.append("page",t.toString()),a.append("page_size",r.toString()),Object.entries(n)))null!=o&&""!==o&&a.append(e,String(o));o+=`?${a.toString()}`;let i=await fetch(o,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!i.ok){let e=await i.json(),t=w(e);throw N(t),Error(t)}return await i.json()}catch(e){throw console.error("Failed to fetch audit logs:",e),e}},nS=async e=>{try{let t=_?`${_}/user/available_users`:"/user/available_users",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`}});if(!r.ok){if(404===r.status)return null;let e=await r.text();throw N(e),Error("Network response was not ok")}return await r.json()}catch(e){throw console.error("Failed to fetch remaining users:",e),e}},n$=async e=>{try{let t=_?`${_}/health/license`:"/health/license",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`}});if(!r.ok){if(404===r.status)return null;let e=await r.text();throw N(e),Error("Network response was not ok")}return await r.json()}catch(e){throw console.error("Failed to fetch license info:",e),e}},nE=async(e,t,r)=>{try{let n=_?`${_}/config/pass_through_endpoint/${encodeURIComponent(t)}`:`/config/pass_through_endpoint/${encodeURIComponent(t)}`,o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!o.ok){let e=await o.json(),t=w(e);throw N(t),Error(t)}let a=await o.json();return y.default.success("Pass through endpoint updated successfully"),a}catch(e){throw console.error("Failed to update pass through endpoint:",e),e}},nk=async(e,t)=>{try{return await L.post("/config/callback/delete",{accessToken:e,body:{callback_name:t}})}catch(e){throw console.error("Failed to delete specific callback:",e),e}},nO=async(e,t,r)=>{try{console.log("Testing MCP tools list with config:",JSON.stringify(t));let n=_?`${_}/mcp-rest/test/tools/list`:"/mcp-rest/test/tools/list",o={"Content-Type":"application/json"};e&&(o["x-litellm-api-key"]=e),r?o.Authorization=`Bearer ${r}`:e&&(o[A]=`Bearer ${e}`);let a=await fetch(n,{method:"POST",headers:o,body:JSON.stringify(t)}),i=a.headers.get("content-type");if(!i||!i.includes("application/json")){let e=await a.text();throw console.error("Received non-JSON response:",e),Error(`Received non-JSON response (${a.status}: ${a.statusText}). Check network tab for details.`)}let l=await a.json();if((!a.ok||l.error)&&!l.error)return{tools:[],error:"request_failed",message:l.message||`MCP tools list failed: ${a.status} ${a.statusText}`};return l}catch(e){throw console.error("MCP tools list test error:",e),e}},nj=async(e,t)=>{let r=_?`${_}/v1/mcp/server/oauth/session`:"/v1/mcp/server/oauth/session",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)}),o=await n.json();if(!n.ok)throw Error(w(o)||o?.error||"Failed to cache MCP server");return o},nT=async(e,t,r)=>{let n=P(),o=encodeURIComponent(t.trim()),a=`${n}/v1/mcp/server/oauth/${o}/register`,i=await fetch(a,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json, text/event-stream"},body:JSON.stringify(r)}),l=await i.json();if(!i.ok)throw Error(w(l)||l?.detail||"Failed to register OAuth client");return l},n_=({serverId:e,clientId:t,redirectUri:r,state:n,codeChallenge:o,scope:a})=>{let i=P(),l=encodeURIComponent(e.trim()),s=`${i}/v1/mcp/server/oauth/${l}/authorize`,c=new URLSearchParams({redirect_uri:r,state:n,response_type:"code",code_challenge:o,code_challenge_method:"S256"});return t&&t.trim().length>0&&c.set("client_id",t),a&&a.trim().length>0&&c.set("scope",a),`${s}?${c.toString()}`},nP=async({serverId:e,code:t,clientId:r,clientSecret:n,codeVerifier:o,redirectUri:a,accessToken:i})=>{let l=P(),s=encodeURIComponent(e.trim()),c=`${l}/v1/mcp/server/oauth/${s}/token`,u=new URLSearchParams;u.set("grant_type","authorization_code"),u.set("code",t),r&&r.trim().length>0&&u.set("client_id",r),n&&n.trim().length>0&&u.set("client_secret",n),u.set("code_verifier",o),u.set("redirect_uri",a);let d={"Content-Type":"application/x-www-form-urlencoded"};i&&(d.Authorization=`Bearer ${i}`);let f=await fetch(c,{method:"POST",headers:d,body:u.toString()}),p=await f.json();if(!f.ok)throw Error(w(p)||p?.detail||"OAuth token exchange failed");return p},nI=async(e,t,r)=>{try{let n=`${P()}/v1/vector_stores/${t}/search`,o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({query:r})});if(!o.ok){let e=await o.text();return await N(e),null}return await o.json()}catch(e){throw console.error("Error testing vector store search:",e),e}},nF=async(e,t,r,n)=>{try{let o=`${P()}/v1/search/${t}`,a=await fetch(o,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({query:r,max_results:n||5})});if(!a.ok){let e=await a.text();return await N(e),null}return await a.json()}catch(e){throw console.error("Error querying search tool:",e),e}},nN=async(e,t,r,n)=>{try{let o,a,i,l=n&&n.length>0;return await L.get("/tag/dau",{accessToken:e,query:{end_date:(o=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),`${o}-${a}-${i}`),tag_filters:l?n:void 0,tag_filter:!l&&r?r:void 0}})}catch(e){throw console.error("Failed to fetch DAU:",e),e}},nR=async(e,t,r,n)=>{try{let o,a,i,l=n&&n.length>0;return await L.get("/tag/wau",{accessToken:e,query:{end_date:(o=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),`${o}-${a}-${i}`),tag_filters:l?n:void 0,tag_filter:!l&&r?r:void 0}})}catch(e){throw console.error("Failed to fetch WAU:",e),e}},nM=async(e,t,r,n)=>{try{let o,a,i,l=n&&n.length>0;return await L.get("/tag/mau",{accessToken:e,query:{end_date:(o=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),`${o}-${a}-${i}`),tag_filters:l?n:void 0,tag_filter:!l&&r?r:void 0}})}catch(e){throw console.error("Failed to fetch MAU:",e),e}},nA=async e=>{try{return await L.get("/tag/distinct",{accessToken:e})}catch(e){throw console.error("Failed to fetch distinct tags:",e),e}},nB=async(e,t,r,n)=>{try{let o=e=>{let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${n}`};return await L.get("/tag/summary",{accessToken:e,query:{start_date:o(t),end_date:o(r),tag_filters:n&&n.length>0?n:void 0}})}catch(e){throw console.error("Failed to fetch user agent summary:",e),e}},nz=async(e,t=1,r=50,n)=>{try{return await L.get("/tag/user-agent/per-user-analytics",{accessToken:e,query:{page:t.toString(),page_size:r.toString(),tag_filters:n&&n.length>0?n:void 0}})}catch(e){throw console.error("Failed to fetch per-user analytics:",e),e}},nL=async(e,t,r)=>{let o=P(),a=r?"/v3/login":"/v2/login",i=o?`${o}${a}`:a,l=JSON.stringify({username:e,password:t}),s=await fetch(i,{method:"POST",body:l,credentials:"include",headers:{"Content-Type":"application/json"}});if(!s.ok)throw Error(w(await s.json()));let c=await s.json();if(r&&c.code){let e=o?`${o}/v3/login/exchange`:"/v3/login/exchange",t=await fetch(e,{method:"POST",body:JSON.stringify({code:c.code}),credentials:"include",headers:{"Content-Type":"application/json"}});if(!t.ok)throw Error(w(await t.json()));let r=await t.json();return r.token&&(0,n.storeLoginToken)(r.token),r}return c.token&&(0,n.storeLoginToken)(c.token),c},nH=async(e,t)=>{let r=t||P(),n=await fetch(`${r}/v3/login/exchange`,{method:"POST",body:JSON.stringify({code:e}),headers:{"Content-Type":"application/json"}});if(!n.ok)throw Error(w(await n.json()));let o=await n.json();return o.token&&(document.cookie=`token=${o.token}; path=/; SameSite=Lax`),o.token},nD=async()=>{let e=P(),t=e?`${e}/get/ui_settings`:"/get/ui_settings",r=await fetch(t,{method:"GET"});if(!r.ok)throw Error(w(await r.json()));return await r.json()},nV=async(e,t)=>{let r=P(),n=r?`${r}/update/ui_settings`:"/update/ui_settings",o=await fetch(n,{method:"PATCH",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!o.ok)throw Error(w(await o.json()));return await o.json()},nW=async(e,t=!1)=>{try{let r=P(),n=r?`${r}/claude-code/plugins?enabled_only=${t}`:`/claude-code/plugins?enabled_only=${t}`,o=await fetch(n,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.text(),t=w(JSON.parse(e));throw N(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to fetch Claude Code plugins list:",e),e}},nU=async(e,t)=>{try{let r=P(),n=r?`${r}/claude-code/plugins`:"/claude-code/plugins",o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!o.ok){let e=await o.text(),t=w(JSON.parse(e));throw N(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to register Claude Code plugin:",e),e}},nG=async(e,t)=>{try{let r=P(),n=r?`${r}/claude-code/plugins/${t}/enable`:`/claude-code/plugins/${t}/enable`,o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.text(),t=w(JSON.parse(e));throw N(t),Error(t)}return await o.json()}catch(e){throw console.error(`Failed to enable plugin "${t}":`,e),e}},nq=async(e,t)=>{try{let r=P(),n=r?`${r}/claude-code/plugins/${t}/disable`:`/claude-code/plugins/${t}/disable`,o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.text(),t=w(JSON.parse(e));throw N(t),Error(t)}return await o.json()}catch(e){throw console.error(`Failed to disable plugin "${t}":`,e),e}},nK=async(e,t)=>{try{let r=P(),n=r?`${r}/claude-code/plugins/${t}`:`/claude-code/plugins/${t}`,o=await fetch(n,{method:"DELETE",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.text(),t=w(JSON.parse(e));throw N(t),Error(t)}return await o.json()}catch(e){throw console.error(`Failed to delete plugin "${t}":`,e),e}},nX=async(e,t)=>{let r=_?`${_}/compliance/eu-ai-act`:"/compliance/eu-ai-act",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw Error(await n.text());return n.json()},nJ=async(e,t)=>{let r=_?`${_}/compliance/gdpr`:"/compliance/gdpr",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw Error(await n.text());return n.json()},nY=async e=>{let t=_?`${_}/v1/tool/policy/options`:"/v1/tool/policy/options",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok)throw Error(await r.text());return r.json()},nQ=async e=>{let t=_?`${_}/v1/tool/list`:"/v1/tool/list",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok)throw Error(await r.text());return(await r.json()).tools??[]},nZ=async(e,t,r)=>{let n=encodeURIComponent(t),o=_?`${_}/v1/tool/${n}/logs`:`/v1/tool/${n}/logs`,a=new URLSearchParams;null!=r.page&&a.append("page",String(r.page)),null!=r.pageSize&&a.append("page_size",String(r.pageSize)),r.startDate&&a.append("start_date",r.startDate),r.endDate&&a.append("end_date",r.endDate);let i=a.toString()?`${o}?${a.toString()}`:o,l=await fetch(i,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!l.ok)throw Error(w(await l.json().catch(()=>({}))));return l.json()},n0=async(e,t)=>{let r=encodeURIComponent(t),n=_?`${_}/v1/tool/${r}/detail`:`/v1/tool/${r}/detail`,o=await fetch(n,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok)throw Error(await o.text());return o.json()},n1=async(e,t,r,n)=>{let o=_?`${_}/v1/tool/policy`:"/v1/tool/policy",a={tool_name:t};null!=r.input_policy&&(a.input_policy=r.input_policy),null!=r.output_policy&&(a.output_policy=r.output_policy),n?.team_id!=null&&(a.team_id=n.team_id||void 0),n?.key_hash!=null&&(a.key_hash=n.key_hash||void 0),n?.key_alias!=null&&(a.key_alias=n.key_alias||void 0);let i=await fetch(o,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(a)});if(!i.ok)throw Error(await i.text());return i.json()},n2=async(e,t,r)=>{let n=encodeURIComponent(t),o=new URLSearchParams;null!=r.team_id&&""!==r.team_id&&o.set("team_id",r.team_id),null!=r.key_hash&&""!==r.key_hash&&o.set("key_hash",r.key_hash);let a=o.toString(),i=_?`${_}/v1/tool/${n}/overrides${a?`?${a}`:""}`:`/v1/tool/${n}/overrides${a?`?${a}`:""}`,l=await fetch(i,{method:"DELETE",headers:{[A]:`Bearer ${e}`}});if(!l.ok)throw Error(await l.text());return l.json()},n4=async(e,t,r)=>{let n=_?`${_}/v1/mcp/server/${t}/oauth-user-credential`:`/v1/mcp/server/${t}/oauth-user-credential`,o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!o.ok){let e=await o.json().catch(()=>({})),t=e?.detail;throw Error((Array.isArray(t)?t.map(e=>e&&"object"==typeof e?e.msg??JSON.stringify(e):String(e)).join("; "):"string"==typeof t?t:t&&"string"==typeof t.error?t.error:void 0)||"Failed to store OAuth credential")}return o.json()},n6=async(e,t)=>{let r=_?`${_}/v1/mcp/server/${t}/oauth-user-credential`:`/v1/mcp/server/${t}/oauth-user-credential`,n=await fetch(r,{method:"DELETE",headers:{[A]:`Bearer ${e}`}});if(!n.ok){let e=await n.json().catch(()=>({})),t=e?.detail;throw Error((Array.isArray(t)?t.map(e=>e&&"object"==typeof e?e.msg??JSON.stringify(e):String(e)).join("; "):"string"==typeof t?t:t&&"string"==typeof t.error?t.error:void 0)||"Failed to revoke OAuth credential")}return n.json()},n5=async(e,t)=>{let r=_?`${_}/v1/mcp/server/${t}/oauth-user-credential/status`:`/v1/mcp/server/${t}/oauth-user-credential/status`,n=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`}});return n.ok?n.json():{server_id:t,has_credential:!1,is_expired:!1}},n3=async e=>{let t=_?`${_}/v1/mcp/user-credentials`:"/v1/mcp/user-credentials",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`}});return r.ok?r.json():[]},n7=async(e,t)=>L.get(`/v1/mcp/server/${t}/user-env-vars`,{accessToken:e}),n8=async(e,t,r)=>L.post(`/v1/mcp/server/${t}/user-env-vars`,{accessToken:e,body:{values:r}}),n9=async e=>{try{return await L.get("/v1/mcp/user-env-vars/status",{accessToken:e})}catch{return[]}},oe=e=>e.split("/").map(encodeURIComponent).join("/"),ot=async(e,t={})=>{let r=_?`${_}/v1/memory`:"/v1/memory",n=new URLSearchParams;t.keyPrefix?n.append("key_prefix",t.keyPrefix):t.key&&n.append("key",t.key),null!=t.page&&n.append("page",String(t.page)),null!=t.pageSize&&n.append("page_size",String(t.pageSize));let o=n.toString()?`${r}?${n.toString()}`:r,a=await fetch(o,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!a.ok)throw Error(await a.text());return a.json()},or=async(e,t)=>{let r=_?`${_}/v1/memory`:"/v1/memory",n={key:t.key,value:t.value};void 0!==t.metadata&&(n.metadata=t.metadata);let o=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(n)});if(!o.ok)throw Error(await o.text());return o.json()},on=async(e,t,r)=>{let n=oe(t),o=_?`${_}/v1/memory/${n}`:`/v1/memory/${n}`,a=await fetch(o,{method:"PUT",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!a.ok)throw Error(await a.text());return a.json()},oo=async(e,t)=>{let r=oe(t),n=_?`${_}/v1/memory/${r}`:`/v1/memory/${r}`,o=await fetch(n,{method:"DELETE",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok)throw Error(await o.text())}},180166,e=>{"use strict";var t={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},r=new class{#e=t;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function n(e){setTimeout(e,0)}e.s(["systemSetTimeoutZero",()=>n,"timeoutManager",()=>r])},619273,e=>{"use strict";var t=e.i(180166),r="u"=0&&e!==1/0}function i(e,t){return Math.max(e+(t||0)-Date.now(),0)}function l(e,t){return"function"==typeof e?e(t):e}function s(e,t){return"function"==typeof e?e(t):e}function c(e,t){let{type:r="all",exact:n,fetchStatus:o,predicate:a,queryKey:i,stale:l}=e;if(i){if(n){if(t.queryHash!==d(i,t.options))return!1}else if(!p(t.queryKey,i))return!1}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof l||t.isStale()===l)&&(!o||o===t.state.fetchStatus)&&(!a||!!a(t))}function u(e,t){let{exact:r,status:n,predicate:o,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(f(t.options.mutationKey)!==f(a))return!1}else if(!p(t.options.mutationKey,a))return!1}return(!n||t.state.status===n)&&(!o||!!o(t))}function d(e,t){return(t?.queryKeyHashFn||f)(e)}function f(e){return JSON.stringify(e,(e,t)=>v(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function p(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(r=>p(e[r],t[r]))}var m=Object.prototype.hasOwnProperty;function g(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function h(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function v(e){if(!y(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!y(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function y(e){return"[object Object]"===Object.prototype.toString.call(e)}function b(e){return new Promise(r=>{t.timeoutManager.setTimeout(r,e)})}function w(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r,n=0){if(t===r)return t;if(n>500)return r;let o=h(t)&&h(r);if(!o&&!(v(t)&&v(r)))return r;let a=(o?t:Object.keys(t)).length,i=o?r:Object.keys(r),l=i.length,s=o?Array(l):{},c=0;for(let u=0;ur?n.slice(1):n}function S(e,t,r=0){let n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var $=Symbol();function E(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==$?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}function k(e,t){return"function"==typeof e?e(...t):!!e}function O(e,t,r){let n,o=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(n??=t(),o||(o=!0,n.aborted?r():n.addEventListener("abort",r,{once:!0})),n)}),e}e.s(["addConsumeAwareSignal",()=>O,"addToEnd",()=>x,"addToStart",()=>S,"ensureQueryFn",()=>E,"functionalUpdate",()=>o,"hashKey",()=>f,"hashQueryKeyByOptions",()=>d,"isServer",()=>r,"isValidTimeout",()=>a,"keepPreviousData",()=>C,"matchMutation",()=>u,"matchQuery",()=>c,"noop",()=>n,"partialMatchKey",()=>p,"replaceData",()=>w,"resolveEnabled",()=>s,"resolveStaleTime",()=>l,"shallowEqualObjects",()=>g,"shouldThrowError",()=>k,"skipToken",()=>$,"sleep",()=>b,"timeUntilStale",()=>i])},540143,e=>{"use strict";let t,r,n,o,a,i;var l=e.i(180166).systemSetTimeoutZero,s=(t=[],r=0,n=e=>{e()},o=e=>{e()},a=l,{batch:e=>{let i;r++;try{i=e()}finally{let e;--r||(e=t,t=[],e.length&&a(()=>{o(()=>{e.forEach(e=>{n(e)})})}))}return i},batchCalls:e=>(...t)=>{i(()=>{e(...t)})},schedule:i=e=>{r?t.push(e):a(()=>{n(e)})},setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{o=e},setScheduler:e=>{a=e}});e.s(["notifyManager",()=>s])},915823,e=>{"use strict";var t=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};e.s(["Subscribable",()=>t])},175555,e=>{"use strict";var t=e.i(915823),r=e.i(619273),n=new class extends t.Subscribable{#r;#n;#o;constructor(){super(),this.#o=e=>{if(!r.isServer&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#n||this.setEventListener(this.#o)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#o=e,this.#n?.(),this.#n=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#r!==e&&(this.#r=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#r?this.#r:globalThis.document?.visibilityState!=="hidden"}};e.s(["focusManager",()=>n])},936553,814448,793803,e=>{"use strict";var t=e.i(175555),r=e.i(915823),n=e.i(619273),o=new class extends r.Subscribable{#a=!0;#n;#o;constructor(){super(),this.#o=e=>{if(!n.isServer&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#n||this.setEventListener(this.#o)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#o=e,this.#n?.(),this.#n=e(this.setOnline.bind(this))}setOnline(e){this.#a!==e&&(this.#a=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#a}};function a(){let e,t,r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}function i(e){return Math.min(1e3*2**e,3e4)}function l(e){return(e??"online")!=="online"||o.isOnline()}e.s(["onlineManager",()=>o],814448),e.s(["pendingThenable",()=>a],793803);var s=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function c(e){let r,c=!1,u=0,d=a(),f=()=>t.focusManager.isFocused()&&("always"===e.networkMode||o.isOnline())&&e.canRun(),p=()=>l(e.networkMode)&&e.canRun(),m=e=>{"pending"===d.status&&(r?.(),d.resolve(e))},g=e=>{"pending"===d.status&&(r?.(),d.reject(e))},h=()=>new Promise(t=>{r=e=>{("pending"!==d.status||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,"pending"===d.status&&e.onContinue?.()}),v=()=>{let t;if("pending"!==d.status)return;let r=0===u?e.initialPromise:void 0;try{t=r??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(m).catch(t=>{if("pending"!==d.status)return;let r=e.retry??3*!n.isServer,o=e.retryDelay??i,a="function"==typeof o?o(u,t):o,l=!0===r||"number"==typeof r&&uf()?void 0:h()).then(()=>{c?g(t):v()}))})};return{promise:d,status:()=>d.status,cancel:t=>{if("pending"===d.status){let r=new s(t);g(r),e.onCancel?.(r)}},continue:()=>(r?.(),d),cancelRetry:()=>{c=!0},continueRetry:()=>{c=!1},canStart:p,start:()=>(p()?v():h().then(v),d)}}e.s(["CancelledError",()=>s,"canFetch",()=>l,"createRetryer",()=>c],936553)},88587,e=>{"use strict";var t=e.i(180166),r=e.i(619273),n=class{#i;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,r.isValidTimeout)(this.gcTime)&&(this.#i=t.timeoutManager.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(r.isServer?1/0:3e5))}clearGcTimeout(){this.#i&&(t.timeoutManager.clearTimeout(this.#i),this.#i=void 0)}};e.s(["Removable",()=>n])},286491,e=>{"use strict";var t=e.i(619273),r=e.i(540143),n=e.i(936553),o=e.i(88587),a=class extends o.Removable{#l;#s;#c;#u;#d;#f;#p;constructor(e){super(),this.#p=!1,this.#f=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#u=e.client,this.#c=this.#u.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#l=s(this.options),this.state=e.state??this.#l,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#d?.promise}setOptions(e){if(this.options={...this.#f,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=s(this.options);void 0!==e.data&&(this.setState(l(e.data,e.dataUpdatedAt)),this.#l=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#c.remove(this)}setData(e,r){let n=(0,t.replaceData)(this.state.data,e,this.options);return this.#m({data:n,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),n}setState(e,t){this.#m({type:"setState",state:e,setStateOptions:t})}cancel(e){let r=this.#d?.promise;return this.#d?.cancel(e),r?r.then(t.noop).catch(t.noop):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#l)}isActive(){return this.observers.some(e=>!1!==(0,t.resolveEnabled)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===t.skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,t.resolveStaleTime)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,t.timeUntilStale)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#d?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#d?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#c.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#d&&(this.#p?this.#d.cancel({revert:!0}):this.#d.cancelRetry()),this.scheduleGc()),this.#c.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#m({type:"invalidate"})}async fetch(e,r){let o;if("idle"!==this.state.fetchStatus&&this.#d?.status()!=="rejected"){if(void 0!==this.state.data&&r?.cancelRefetch)this.cancel({silent:!0});else if(this.#d)return this.#d.continueRetry(),this.#d.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let a=new AbortController,i=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#p=!0,a.signal)})},l=()=>{let e,n=(0,t.ensureQueryFn)(this.options,r),o=(i(e={client:this.#u,queryKey:this.queryKey,meta:this.meta}),e);return(this.#p=!1,this.options.persister)?this.options.persister(n,o,this):n(o)},s=(i(o={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:this.#u,state:this.state,fetchFn:l}),o);this.options.behavior?.onFetch(s,this),this.#s=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==s.fetchOptions?.meta)&&this.#m({type:"fetch",meta:s.fetchOptions?.meta}),this.#d=(0,n.createRetryer)({initialPromise:r?.initialPromise,fn:s.fetchFn,onCancel:e=>{e instanceof n.CancelledError&&e.revert&&this.setState({...this.#s,fetchStatus:"idle"}),a.abort()},onFail:(e,t)=>{this.#m({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#m({type:"pause"})},onContinue:()=>{this.#m({type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0});try{let e=await this.#d.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#c.config.onSuccess?.(e,this),this.#c.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof n.CancelledError){if(e.silent)return this.#d.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#m({type:"error",error:e}),this.#c.config.onError?.(e,this),this.#c.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#m(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...i(t.data,this.options),fetchMeta:e.meta??null};case"success":let r={...t,...l(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#s=e.manual?r:void 0,r;case"error":let n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),r.notifyManager.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#c.notify({query:this,type:"updated",action:e})})}};function i(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,n.canFetch)(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function l(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function s(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}e.s(["Query",()=>a,"fetchState",()=>i])},912598,e=>{"use strict";var t=e.i(271645),r=e.i(843476),n=t.createContext(void 0),o=e=>{let r=t.useContext(n);if(e)return e;if(!r)throw Error("No QueryClient set, use QueryClientProvider to set one");return r},a=({client:e,children:o})=>(t.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,r.jsx)(n.Provider,{value:e,children:o}));e.s(["QueryClientProvider",()=>a,"useQueryClient",()=>o])}]); \ No newline at end of file +Allowed values: ${t.enum.join(", ")}`:$)}),children:r},e)})}):null};var y=e.i(727749);class b extends Error{status;body;constructor(e,t,r){super(e),this.name="ApiError",this.status=t,this.body=r}}let w=e=>{let t=e?.detail,r=Array.isArray(t)?t.map(e=>e?.msg||JSON.stringify(e)).join("; "):"string"==typeof t?t:void 0;return e?.error&&(e.error.message||("string"==typeof e.error?e.error:void 0))||e?.message||r||JSON.stringify(e)};function C(e){let{getBaseUrl:t,getAuthHeaderName:r,onError:n,fetchImpl:o}=e;async function a(e,i,l={}){let{accessToken:s,body:c,rawBody:u,query:d,headers:f,signal:p}=l,m=((e,t)=>{if(!t)return e;let r=new URLSearchParams;for(let[e,n]of Object.entries(t))null!=n&&(Array.isArray(n)?n.forEach(t=>null!=t&&r.append(e,String(t))):r.append(e,String(n)));let n=r.toString();return n?e.includes("?")?`${e}&${n}`:`${e}?${n}`:e})(`${t()}${i}`,d),g={};void 0===u&&(g["Content-Type"]="application/json"),s&&(g[r?r():"Authorization"]=`Bearer ${s}`),f&&Object.assign(g,f);let h={method:e,headers:g,signal:p};void 0!==u?h.body=u:void 0!==c&&(h.body=JSON.stringify(c));let v=await (o??fetch)(m,h);if(!v.ok){let e,t=await v.text(),r=t;try{r=JSON.parse(t),e=w(r)}catch{e=t||`HTTP ${v.status}`}throw n?.(e),new b(e,v.status,r)}let y=await v.text();return y?JSON.parse(y):void 0}return{request:a,get:(e,t)=>a("GET",e,t),post:(e,t)=>a("POST",e,t),put:(e,t)=>a("PUT",e,t),delete:(e,t)=>a("DELETE",e,t),patch:(e,t)=>a("PATCH",e,t)}}e.s(["createApiClient",()=>C,"deriveErrorMessage",0,w],431703);let x=e=>{let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${n}`},S=async e=>{try{return await L.get("/callbacks/configs",{accessToken:e})}catch(e){throw console.error("Failed to get callbacks:",e),e}},$=async e=>{try{return await L.get("/in_product_nudges",{accessToken:e})}catch(e){throw console.error("Failed to get in-product nudges:",e),e}},E=e=>t.default.env.NEXT_PUBLIC_BASE_URL?t.default.env.NEXT_PUBLIC_BASE_URL:e,k=E(null),O="/",j="litellm_worker_url",T=window.localStorage.getItem(j),_=(()=>{if(!T)return null;try{let e=new URL(T);if("http:"===e.protocol||"https:"===e.protocol)return T}catch{}return window.localStorage.removeItem(j),null})()??k;console.log=function(){};let P=()=>{if(_)return _;let e=window.location;return e?.origin??""};function I(e){(!e||function(e){try{let t=new URL(e);return"http:"===t.protocol||"https:"===t.protocol}catch{return!1}}(e))&&(e?window.localStorage.setItem(j,e):window.localStorage.removeItem(j),_=e??k)}let F=0,N=async e=>{let t=Date.now();if(t-F>6e4){if(("string"==typeof e?e:JSON.stringify(e)).includes("Authentication Error - Expired Key")){y.default.info("UI Session Expired. Logging out."),F=t,(0,n.clearTokenCookies)();let e=window.location;e&&(window.location.href=e.pathname)}F=t}else console.log("Error suppressed to prevent spam:",e)},R=async()=>{let e=_?`${_}/public/providers/fields`:"/public/providers/fields",t=await fetch(e,{method:"GET"});if(!t.ok){let e=await t.text();throw console.error("Failed to fetch provider create metadata:",t.status,e),Error("Failed to load provider configuration")}return await t.json()},M=async()=>{let e=_?`${_}/public/agents/fields`:"/public/agents/fields",t=await fetch(e,{method:"GET"});if(!t.ok){let e=await t.text();throw console.error("Failed to fetch agent create metadata:",t.status,e),Error("Failed to load agent configuration")}return await t.json()},A="Authorization";function B(e="Authorization"){console.log(`setGlobalLitellmHeaderName: ${e}`),A=e}function z(){return A}let L=C({getBaseUrl:P,getAuthHeaderName:z,onError:N}),H=async(e,t)=>{let r=_?`${_}/model_group/make_public`:"/model_group/make_public";return(await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({model_groups:t})})).json()},D=async()=>{console.log("Getting UI config");let e=k?`${k}/litellm/.well-known/litellm-ui-config`:"/litellm/.well-known/litellm-ui-config",t=await fetch(e),r=await t.json();return console.log("jsonData in getUiConfig:",r),((e,t=null)=>{window.localStorage.getItem(j)||(_=(({explicitBase:e,serverRootPath:t})=>{let r,n=(e??"").trim().replace(/\/+$/,""),o=""===(r=(t??"").trim())||"/"===r?"":(r.startsWith("/")?r:`/${r}`).replace(/\/+$/,"");return""===o||n.endsWith(o)?n:`${n}${o}`})({explicitBase:t||E(window.location?.origin??null),serverRootPath:e}))})(r.server_root_path,r.proxy_base_url),r},V=async()=>{let e=_?`${_}/public/model_hub/info`:"/public/model_hub/info",t=await fetch(e);return await t.json()},W=async()=>{let e=_?`${_}/openapi.json`:"/openapi.json",t=await fetch(e);return await t.json()},U=async()=>{try{let e=_?`${_}/public/litellm_model_cost_map`:"/public/litellm_model_cost_map",t=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}}),r=await t.json();return console.log(`received litellm model cost data: ${r}`),r}catch(e){throw console.error("Failed to get model cost map:",e),e}},G=async e=>{try{let t=_?`${_}/reload/model_cost_map`:"/reload/model_cost_map",r=await fetch(t,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}}),n=await r.json();return console.log(`Model cost map reload response: ${n}`),n}catch(e){throw console.error("Failed to reload model cost map:",e),e}},q=async(e,t)=>{try{let r=_?`${_}/schedule/model_cost_map_reload?hours=${t}`:`/schedule/model_cost_map_reload?hours=${t}`,n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}}),o=await n.json();return console.log(`Schedule model cost map reload response: ${o}`),o}catch(e){throw console.error("Failed to schedule model cost map reload:",e),e}},K=async e=>{try{let t=_?`${_}/schedule/model_cost_map_reload`:"/schedule/model_cost_map_reload",r=await fetch(t,{method:"DELETE",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}}),n=await r.json();return console.log(`Cancel model cost map reload response: ${n}`),n}catch(e){throw console.error("Failed to cancel model cost map reload:",e),e}},X=async e=>{try{let t=_?`${_}/model/cost_map/source`:"/model/cost_map/source",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw Error(`HTTP ${r.status}: ${e}`)}let n=await r.json();return console.log("Model cost map source info:",n),n}catch(e){throw console.error("Failed to get model cost map source info:",e),e}},J=async e=>{try{let t=_?`${_}/schedule/model_cost_map_reload/status`:"/schedule/model_cost_map_reload/status";console.log("Fetching status from URL:",t);let r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){console.error(`Status request failed with status: ${r.status}`);let e=await r.text();throw console.error("Error response:",e),Error(`HTTP ${r.status}: ${e}`)}let n=await r.json();return console.log("Model cost map reload status:",n),n}catch(e){throw console.error("Failed to get model cost map reload status:",e),e}},Y=async(e,t)=>{try{let n=await L.post("/model/new",{accessToken:e,body:{...t}});return console.log("API Response:",n),r.default.destroy(),y.default.success(`Model ${t.model_name} created successfully`),n}catch(e){throw console.error("Failed to create key:",e),e}},Q=async(e,t)=>{console.log(`model_id in model delete call: ${t}`);try{let r=await L.post("/model/delete",{accessToken:e,body:{id:t}});return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},Z=async(e,t)=>{if(console.log(`budget_id in budget delete call: ${t}`),null!=e)try{let r=await L.post("/budget/delete",{accessToken:e,body:{id:t}});return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},ee=async(e,t)=>{try{console.log("Form Values in budgetCreateCall:",t),console.log("Form Values after check:",t);let r=await L.post("/budget/new",{accessToken:e,body:{...t}});return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},et=async(e,t)=>{try{console.log("Form Values in budgetUpdateCall:",t),console.log("Form Values after check:",t);let r=await L.post("/budget/update",{accessToken:e,body:{...t}});return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},er=async(e,t)=>{try{let r=await L.post("/invitation/new",{accessToken:e,body:{user_id:t}});return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},en=async e=>{try{return await L.get("/alerting/settings",{accessToken:e})}catch(e){throw console.error("Failed to get callbacks:",e),e}},eo=async(e,t)=>{try{for(let e of(console.log("Form Values in keyCreateServiceAccountCall:",t),t.description&&(t.metadata||(t.metadata={}),t.metadata.description=t.description,delete t.description,t.metadata=JSON.stringify(t.metadata)),g))if(t[e]){console.log(`formValues.${e}:`,t[e]);try{t[e]=JSON.parse(t[e])}catch(t){throw Error(`Failed to parse ${e}: `+t)}}console.log("Form Values after check:",t);let r=_?`${_}/key/service-account/generate`:"/key/service-account/generate",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!n.ok){let e=await n.text();throw N(e),console.error("Error response from the server:",e),Error(e)}let o=await n.json();return console.log("API Response:",o),o}catch(e){throw console.error("Failed to create key:",e),e}},ea=async(e,t,r)=>{try{for(let e of(console.log("Form Values in keyCreateCall:",r),r.description&&(r.metadata||(r.metadata={}),r.metadata.description=r.description,delete r.description,r.metadata=JSON.stringify(r.metadata)),g))if(r[e]){console.log(`formValues.${e}:`,r[e]);try{r[e]=JSON.parse(r[e])}catch(t){throw Error(`Failed to parse ${e}: `+t)}}console.log("Form Values after check:",r);let n=_?`${_}/key/generate`:"/key/generate",o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...r})});if(!o.ok){let e=await o.text();throw N(e),console.error("Error response from the server:",e),Error(e)}let a=await o.json();return console.log("API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},ei=async(e,t,r,n,o,a)=>{let i=_?`${_}/key/generate`:"/key/generate",l={agent_id:t,key_alias:r,models:n.length>0?n:[]};a&&(l.team_id=a),o&&Object.keys(o).length>0&&(l.metadata=o);let s=await fetch(i,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(l)});if(!s.ok)throw N(await s.text()),Error("Failed to create key for agent");return s.json()},el=async(e,t,r)=>{try{if(console.log("Form Values in keyCreateCall:",r),r.description&&(r.metadata||(r.metadata={}),r.metadata.description=r.description,delete r.description,r.metadata=JSON.stringify(r.metadata)),r.auto_create_key=!1,r.metadata){console.log("formValues.metadata:",r.metadata);try{r.metadata=JSON.parse(r.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}console.log("Form Values after check:",r);let n=_?`${_}/user/new`:"/user/new",o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...r})});if(!o.ok){let e=await o.text();throw N(e),console.error("Error response from the server:",e),Error(e)}let a=await o.json();return console.log("API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},es=async(e,t)=>{try{return console.log("in keyDeleteCall:",t),await L.post("/key/delete",{accessToken:e,body:{keys:[t]}})}catch(e){throw console.error("Failed to create key:",e),e}},ec=async(e,t)=>{try{return console.log("in userDeleteCall:",t),await L.post("/user/delete",{accessToken:e,body:{user_ids:t}})}catch(e){throw console.error("Failed to delete user(s):",e),e}},eu=async(e,t)=>{try{return console.log("in teamDeleteCall:",t),await L.post("/team/delete",{accessToken:e,body:{team_ids:[t]}})}catch(e){throw console.error("Failed to delete key:",e),e}},ed=async(e,t=null,r=null,n=null,o=null,a=null,i=null,l=null,s=null,c=null,u=null)=>{try{return await L.get("/user/list",{accessToken:e,query:{user_ids:t&&t.length>0?t.join(","):void 0,page:r||void 0,page_size:n||void 0,user_email:o||void 0,role:a||void 0,team:i||void 0,sso_user_ids:l||void 0,sort_by:s||void 0,sort_order:c||void 0,organization_ids:u&&u.length>0?u.join(","):void 0}})}catch(e){throw console.error("Failed to create key:",e),e}},ef=async(e,t)=>{try{return await L.get("/v2/user/info",{accessToken:e,query:{user_id:t||void 0}})}catch(e){throw console.error("Failed to fetch user info v2:",e),e}},ep=async(e,t)=>{try{return await L.get("/team/info",{accessToken:e,query:{team_id:t||void 0}})}catch(e){throw console.error("Failed to create key:",e),e}},em=async(e,t,r=null,n=null,o=null)=>{try{return await L.get("/team/list",{accessToken:e,query:{user_id:r||void 0,organization_id:t||void 0,team_id:n||void 0,team_alias:o||void 0}})}catch(e){throw console.error("Failed to create key:",e),e}},eg=async e=>{try{console.log("in availableTeamListCall");let t=await L.get("/team/available",{accessToken:e});return console.log("/team/available_teams API Response:",t),t}catch(e){throw e}},eh=async(e,t=null,r=null)=>{try{return await L.get("/organization/list",{accessToken:e,query:{org_id:t||void 0,org_alias:r||void 0}})}catch(e){throw console.error("Failed to create key:",e),e}},ev=async(e,t)=>{try{let r=_?`${_}/organization/info`:"/organization/info";t&&(r=`${r}?organization_id=${t}`),console.log("in teamInfoCall");let n=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.json(),t=w(e);throw N(t),Error(t)}let o=await n.json();return console.log("API Response:",o),o}catch(e){throw console.error("Failed to create key:",e),e}},ey=async(e,t)=>{try{if(console.log("Form Values in organizationCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw console.error("Failed to parse metadata:",e),Error("Failed to parse metadata: "+e)}}let r=await L.post("/organization/new",{accessToken:e,body:{...t}});return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},eb=async(e,t)=>{try{console.log("Form Values in organizationUpdateCall:",t);let r=await L.patch("/organization/update",{accessToken:e,body:{...t}});return console.log("Update Team Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},ew=async(e,t)=>{try{let r=_?`${_}/organization/delete`:"/organization/delete",n=await fetch(r,{method:"DELETE",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({organization_ids:[t]})});if(!n.ok){let e=await n.text();throw N(e),Error(`Error deleting organization: ${e}`)}return await n.json()}catch(e){throw console.error("Failed to delete organization:",e),e}},eC=async(e,t)=>{try{let r=_?`${_}/utils/transform_request`:"/utils/transform_request",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){let e=await n.json(),t=w(e);throw N(t),Error(t)}return await n.json()}catch(e){throw console.error("Failed to create key:",e),e}},ex=async({accessToken:e,endpoint:t,startTime:r,endTime:n,page:o=1,extraQueryParams:a})=>{try{let i,l,s,c,u=(i=t.startsWith("/")?t:`/${t}`,l=_?`${_}${i}`:i,(s=new URLSearchParams).append("start_date",x(r)),s.append("end_date",x(n)),s.append("page_size","1000"),s.append("page",o.toString()),s.append("timezone",new Date().getTimezoneOffset().toString()),a&&Object.entries(a).forEach(([e,t])=>{((e,t,r)=>{if(null!=r){if(Array.isArray(r)){r.length>0&&e.append(t,r.join(","));return}e.append(t,`${r}`)}})(s,e,t)}),(c=s.toString())?`${l}?${c}`:l),d=await fetch(u,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!d.ok){let e=await d.json(),t=w(e);throw N(t),Error(t)}return await d.json()}catch(e){throw console.error(`Failed to fetch daily activity (${t}):`,e),e}},eS=async(e,t,r,n=1,o=null)=>ex({accessToken:e,endpoint:"/user/daily/activity",startTime:t,endTime:r,page:n,extraQueryParams:{user_id:o}}),e$=async(e,t,r,n=1,o=null)=>ex({accessToken:e,endpoint:"/tag/daily/activity",startTime:t,endTime:r,page:n,extraQueryParams:{tags:o}}),eE=async(e,t,r,n=1,o=null)=>ex({accessToken:e,endpoint:"/team/daily/activity",startTime:t,endTime:r,page:n,extraQueryParams:{team_ids:o,exclude_team_ids:"litellm-dashboard"}}),ek=async(e,t,r,n=1,o=null)=>ex({accessToken:e,endpoint:"/organization/daily/activity",startTime:t,endTime:r,page:n,extraQueryParams:{organization_ids:o}}),eO=async(e,t,r,n=1,o=null)=>ex({accessToken:e,endpoint:"/customer/daily/activity",startTime:t,endTime:r,page:n,extraQueryParams:{end_user_ids:o}}),ej=async(e,t,r,n=1,o=null)=>ex({accessToken:e,endpoint:"/agent/daily/activity",startTime:t,endTime:r,page:n,extraQueryParams:{agent_ids:o}}),eT=async e=>{try{let t=_?`${_}/onboarding/get_token`:"/onboarding/get_token";t+=`?invite_link=${e}`;let r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json"}});if(!r.ok){let e=await r.json(),t=w(e);throw N(t),Error(t)}return await r.json()}catch(e){throw console.error("Failed to create key:",e),e}},e_=async(e,t,r,n)=>{try{let o=await L.post("/onboarding/claim_token",{accessToken:e,body:{invitation_link:t,user_id:r,password:n}});return console.log(o),o}catch(e){throw console.error("Failed to delete key:",e),e}},eP=async(e,t,r)=>{try{let n=_?`${_}/key/${t}/regenerate`:`/key/${t}/regenerate`,o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!o.ok){let e=await o.json(),t=w(e);throw N(t),Error(t)}let a=await o.json();return console.log("Regenerate key Response:",a),a}catch(e){throw console.error("Failed to regenerate key:",e),e}},eI=!1,eF=null,eN=async(e,t,r,n=1,o=50,a,i,l,s,c)=>{try{console.log("modelInfoCall:",e,t,r,n,o,a,i,l,s,c);let u=_?`${_}/v2/model/info`:"/v2/model/info",d=new URLSearchParams;d.append("include_team_models","true"),d.append("page",n.toString()),d.append("size",o.toString()),a&&a.trim()&&d.append("search",a.trim()),i&&i.trim()&&d.append("modelId",i.trim()),l&&l.trim()&&d.append("teamId",l.trim()),s&&s.trim()&&d.append("sortBy",s.trim()),c&&c.trim()&&d.append("sortOrder",c.trim()),d.toString()&&(u+=`?${d.toString()}`);let f=await fetch(u,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!f.ok){let e=await f.text();throw e+=`error shown=${eI}`,eI||(e.includes("No model list passed")&&(e="No Models Exist. Click Add Model to get started."),y.default.info(e),eI=!0,eF&&clearTimeout(eF),eF=setTimeout(()=>{eI=!1},1e4)),Error("Network response was not ok")}let p=await f.json();return console.log("modelInfoCall:",p),p}catch(e){throw console.error("Failed to create key:",e),e}},eR=async(e,t)=>{try{let r=_?`${_}/v1/model/info`:"/v1/model/info";r+=`?litellm_model_id=${t}`;let n=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.json(),t=w(e);throw N(t),Error(t)}let o=await n.json();return console.log("modelInfoV1Call:",o),o}catch(e){throw console.error("Failed to create key:",e),e}},eM=async()=>{let e=_?`${_}/public/model_hub`:"/public/model_hub",t=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}});return t.ok?t.json():(console.error(`modelHubPublicModelsCall failed with status ${t.status}`),[])},eA=async()=>{let e=_?`${_}/public/agent_hub`:"/public/agent_hub",t=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}});return t.ok?t.json():(console.error(`agentHubPublicModelsCall failed with status ${t.status}`),[])},eB=async()=>{let e=_?`${_}/public/mcp_hub`:"/public/mcp_hub",t=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}});return t.ok?t.json():(console.error(`mcpHubPublicServersCall failed with status ${t.status}`),[])},ez=async()=>{let e=_?`${_}/public/skill_hub`:"/public/skill_hub",t=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}});return t.ok?t.json():(console.error(`skillHubPublicCall failed with status ${t.status}`),{plugins:[]})},eL=async e=>{try{let t=await L.get("/model_group/info",{accessToken:e});return console.log("modelHubCall:",t),t}catch(e){throw console.error("Failed to create key:",e),e}},eH=async e=>{try{let t=await L.get("/get/allowed_ips",{accessToken:e});return console.log("getAllowedIPs:",t),t.data}catch(e){throw console.error("Failed to get allowed IPs:",e),e}},eD=async(e,t)=>{try{let r=await L.post("/add/allowed_ip",{accessToken:e,body:{ip:t}});return console.log("addAllowedIP:",r),r}catch(e){throw console.error("Failed to add allowed IP:",e),e}},eV=async(e,t)=>{try{let r=await L.post("/delete/allowed_ip",{accessToken:e,body:{ip:t}});return console.log("deleteAllowedIP:",r),r}catch(e){throw console.error("Failed to delete allowed IP:",e),e}},eW=async(e,t)=>{try{return await L.post("/model_hub/update_useful_links",{accessToken:e,body:{useful_links:t}})}catch(e){throw console.error("Failed to create key:",e),e}},eU=async(e,t,r,n=!1,o=null,a=!1,i=!1,l)=>{console.log("in /models calls, globalLitellmHeaderName",A);try{return await L.get("/models",{accessToken:e,query:{include_model_access_groups:"True",return_wildcard_routes:!0===n?"True":void 0,only_model_access_groups:!0===i?"True":void 0,team_id:o||void 0,scope:l||void 0}})}catch(e){throw console.error("Failed to create key:",e),e}},eG=async e=>{try{let t=await L.get("/global/spend/teams",{accessToken:e});return console.log(t),t}catch(e){throw console.error("Failed to create key:",e),e}},eq=async(e,t,r,n)=>{try{let o=_?`${_}/global/spend/tags`:"/global/spend/tags";t&&r&&(o=`${o}?start_date=${t}&end_date=${r}`),n&&(o+=`&tags=${n.join(",")}`),console.log("in tagsSpendLogsCall:",o);let a=await fetch(`${o}`,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=w(e);throw N(t),Error(t)}let i=await a.json();return console.log(i),i}catch(e){throw console.error("Failed to create key:",e),e}},eK=async e=>{try{let t=await L.get("/global/spend/all_tag_names",{accessToken:e});return console.log(t),t}catch(e){throw console.error("Failed to create key:",e),e}},eX=async e=>{try{let t=await L.get("/customer/list",{accessToken:e});return console.log(t),t}catch(e){throw console.error("Failed to fetch end users:",e),e}},eJ=async(e,t)=>{try{return await L.get("/user/filter/ui",{accessToken:e,query:{user_email:t.get("user_email")||void 0,user_id:t.get("user_id")||void 0,team_id:t.get("team_id")||void 0}})}catch(e){throw console.error("Failed to create key:",e),e}},eY=async({accessToken:e,start_date:t,end_date:r,page:n=1,page_size:o=50,params:a={}})=>{try{let i=_?`${_}/spend/logs/ui`:"/spend/logs/ui",l=new URLSearchParams;for(let[e,i]of(l.append("start_date",t),l.append("end_date",r),l.append("page",n.toString()),l.append("page_size",o.toString()),Object.entries(a)))null!=i&&("min_spend"===e||"max_spend"===e?l.append(e,i.toString()):"string"==typeof i&&""!==i&&l.append(e,String(i)));let s=l.toString();s&&(i+=`?${s}`);let c=await fetch(i,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!c.ok){let e=await c.json(),t=w(e);throw N(t),Error(t)}let u=await c.json();return console.log("Spend Logs Response:",u),u}catch(e){throw console.error("Failed to fetch spend logs:",e),e}},eQ=async e=>{try{let t=await L.get("/global/spend/logs",{accessToken:e});return console.log(t),t}catch(e){throw console.error("Failed to create key:",e),e}},eZ=async e=>{try{let t=_?`${_}/global/spend/keys?limit=5`:"/global/spend/keys?limit=5",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.json(),t=w(e);throw N(t),Error(t)}let n=await r.json();return console.log(n),n}catch(e){throw console.error("Failed to create key:",e),e}},e0=async(e,t,r,n)=>{try{let o=await L.post("/global/spend/end_users",{accessToken:e,body:t?{api_key:t,startTime:r,endTime:n}:{startTime:r,endTime:n}});return console.log(o),o}catch(e){throw console.error("Failed to create key:",e),e}},e1=async(e,t,r,n)=>{try{let o=await L.get("/global/spend/provider",{accessToken:e,query:{...r&&n?{start_date:r,end_date:n}:{},...t?{api_key:t}:{}}});return console.log(o),o}catch(e){throw console.error("Failed to fetch spend data:",e),e}},e2=async(e,t,r)=>{try{let n=await L.get("/global/activity",{accessToken:e,query:t&&r?{start_date:t,end_date:r}:void 0});return console.log(n),n}catch(e){throw console.error("Failed to fetch spend data:",e),e}},e4=async(e,t,r)=>{try{let n=_?`${_}/global/activity/cache_hits`:"/global/activity/cache_hits";t&&r&&(n+=`?start_date=${t}&end_date=${r}`);let o={method:"GET",headers:{[A]:`Bearer ${e}`}},a=await fetch(n,o);if(!a.ok){let e=await a.json(),t=w(e);throw N(t),Error(t)}let i=await a.json();return console.log(i),i}catch(e){throw console.error("Failed to fetch spend data:",e),e}},e6=async(e,t,r)=>{try{let n=_?`${_}/global/activity/model`:"/global/activity/model";t&&r&&(n+=`?start_date=${t}&end_date=${r}`);let o={method:"GET",headers:{[A]:`Bearer ${e}`}},a=await fetch(n,o);if(!a.ok){let e=await a.json(),t=w(e);throw N(t),Error(t)}let i=await a.json();return console.log(i),i}catch(e){throw console.error("Failed to fetch spend data:",e),e}},e5=async e=>{try{let t=_?`${_}/global/spend/models?limit=5`:"/global/spend/models?limit=5",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.json(),t=w(e);throw N(t),Error(t)}let n=await r.json();return console.log(n),n}catch(e){throw console.error("Failed to create key:",e),e}},e3=async(e,t)=>{try{let r=_?`${_}/v2/key/info`:"/v2/key/info",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({keys:t})});if(!n.ok){let e=await n.text();if(e.includes("Invalid proxy server token passed"))throw Error("Invalid proxy server token passed");throw N(e),Error("Network response was not ok")}let o=await n.json();return console.log(o),o}catch(e){throw console.error("Failed to create key:",e),e}},e7=async(e,t,r,n)=>{try{console.log("Sending model connection test request:",JSON.stringify(t));let o=_?`${_}/health/test_connection`:"/health/test_connection",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",[A]:`Bearer ${e}`},body:JSON.stringify({litellm_params:t,model_info:r,mode:n})}),i=a.headers.get("content-type");if(!i||!i.includes("application/json")){let e=await a.text();throw console.error("Received non-JSON response:",e),Error(`Received non-JSON response (${a.status}: ${a.statusText}). Check network tab for details.`)}let l=await a.json();if((!a.ok||"error"===l.status)&&"error"!==l.status)return{status:"error",message:l.error?.message||`Connection test failed: ${a.status} ${a.statusText}`};return l}catch(e){throw console.error("Model connection test error:",e),e}},e8=async(e,t)=>{try{console.log("entering keyInfoV1Call");let r=_?`${_}/key/info`:"/key/info";r=`${r}?key=${t}`;let n=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(console.log("response",n),!n.ok){let e=await n.text();N(e),y.default.fromBackend("Failed to fetch key info - "+e)}let o=await n.json();return console.log("data",o),o}catch(e){throw console.error("Failed to fetch key info:",e),e}},e9=async(e,t,r,n,o,a,i,l,s=null,c=null,u=null,d=null)=>{try{return await L.get("/key/list",{accessToken:e,query:{team_id:r||void 0,organization_id:t||void 0,key_alias:n||void 0,key_hash:a||void 0,user_id:o||void 0,page:i?i.toString():void 0,size:l?l.toString():void 0,sort_by:s||void 0,sort_order:c||void 0,expand:u||void 0,status:d||void 0,return_full_object:"true",include_team_keys:"true",include_created_by_keys:"true"}})}catch(e){throw console.error("Failed to create key:",e),e}},te=async(e,t=1,r=50,n,o)=>{try{return await L.get("/key/aliases",{accessToken:e,query:{page:String(t),size:String(r),search:n||void 0,team_id:o||void 0}})}catch(e){throw console.error("Failed to fetch key aliases:",e),e}},tt=async(e,t,r,n=null)=>{try{let o=e=>{let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${n}`};return await L.get("/user/daily/activity/aggregated",{accessToken:e,query:{start_date:o(t),end_date:o(r),timezone:new Date().getTimezoneOffset().toString(),user_id:n||void 0}})}catch(e){throw console.error("Failed to fetch aggregated user daily activity:",e),e}},tr=async e=>{try{let t=await L.get("/user/available_roles",{accessToken:e});return console.log("response from user/available_role",t),t}catch(e){throw e}},tn=async(e,t)=>{try{if(console.log("Form Values in teamCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let r=await L.post("/team/new",{accessToken:e,body:{...t}});return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},to=async(e,t)=>{try{if(console.log("Form Values in credentialCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let r=await L.post("/credentials",{accessToken:e,body:{...t}});return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},ta=async e=>{try{console.log("in credentialListCall");let t=await L.get("/credentials",{accessToken:e});return console.log("/credentials API Response:",t),t}catch(e){throw console.error("Failed to create key:",e),e}},ti=async(e,t,r)=>{try{let n="/credentials";t?n+=`/by_name/${t}`:r&&(n+=`/by_model/${r}`),console.log("in credentialListCall");let o=await L.get(n,{accessToken:e});return console.log("/credentials API Response:",o),o}catch(e){throw console.error("Failed to create key:",e),e}},tl=async(e,t)=>{try{console.log("in credentialDeleteCall:",t);let r=await L.delete(`/credentials/${t}`,{accessToken:e});return console.log(r),r}catch(e){throw console.error("Failed to delete key:",e),e}},ts=async(e,t,r)=>{try{if(console.log("Form Values in credentialUpdateCall:",r),r.metadata){console.log("formValues.metadata:",r.metadata);try{r.metadata=JSON.parse(r.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let n=await L.patch(`/credentials/${t}`,{accessToken:e,body:{...r}});return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},tc=async(e,t)=>{try{if(console.log("Form Values in keyUpdateCall:",t),t.model_tpm_limit){console.log("formValues.model_tpm_limit:",t.model_tpm_limit);try{t.model_tpm_limit=JSON.parse(t.model_tpm_limit)}catch(e){throw Error("Failed to parse model_tpm_limit: "+e)}}if(t.model_rpm_limit){console.log("formValues.model_rpm_limit:",t.model_rpm_limit);try{t.model_rpm_limit=JSON.parse(t.model_rpm_limit)}catch(e){throw Error("Failed to parse model_rpm_limit: "+e)}}let r=_?`${_}/key/update`:"/key/update",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!n.ok){let e=await n.text();throw N(e),console.error("Error response from the server:",e),Error(e)}let o=await n.json();return console.log("Update key Response:",o),o}catch(e){throw console.error("Failed to create key:",e),e}},tu=async(e,t)=>{try{console.log("Form Values in teamUpateCall:",t);let r=_?`${_}/team/update`:"/team/update",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!n.ok){let e=await n.text();throw N(e),console.error("Error response from the server:",e),y.default.fromBackend("Failed to update team settings: "+e),Error(e)}let o=await n.json();return console.log("Update Team Response:",o),o}catch(e){throw console.error("Failed to update team:",e),e}},td=async(e,t,r)=>{try{console.log("Form Values in modelUpateCall:",t);let n=_?`${_}/model/${r}/update`:`/model/${r}/update`,o=await fetch(n,{method:"PATCH",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!o.ok){let e=await o.text();throw N(e),console.error("Error update from the server:",e),Error("Network response was not ok")}let a=await o.json();return console.log("Update model Response:",a),a}catch(e){throw console.error("Failed to update model:",e),e}},tf=async(e,t,r)=>{try{console.log("Form Values in teamMemberAddCall:",r);let n=_?`${_}/team/member_add`:"/team/member_add",o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({team_id:t,member:r})});if(!o.ok){let e=await o.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let r=t?.detail?.error||"Failed to add team member",n=Error(r);throw n.raw=t,n}let a=await o.json();return console.log("API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},tp=async(e,t,r,n,o)=>{try{console.log("Bulk add team members:",{teamId:t,members:r,maxBudgetInTeam:n});let a=_?`${_}/team/bulk_member_add`:"/team/bulk_member_add",i={team_id:t};o?i.all_users=!0:i.members=r,null!=n&&(i.max_budget_in_team=n);let l=await fetch(a,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(i)});if(!l.ok){let e=await l.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let r=t?.detail?.error||"Failed to bulk add team members",n=Error(r);throw n.raw=t,n}let s=await l.json();return console.log("Bulk team member add API Response:",s),s}catch(e){throw console.error("Failed to bulk add team members:",e),e}},tm=async(e,t,r)=>{try{console.log("Form Values in teamMemberUpdateCall:",r),console.log("Budget value:",r.max_budget_in_team),console.log("TPM limit:",r.tpm_limit),console.log("RPM limit:",r.rpm_limit);let n=_?`${_}/team/member_update`:"/team/member_update",o={team_id:t,role:r.role,user_id:r.user_id};void 0!==r.user_email&&(o.user_email=r.user_email),void 0!==r.max_budget_in_team&&null!==r.max_budget_in_team&&(o.max_budget_in_team=r.max_budget_in_team),void 0!==r.tpm_limit&&null!==r.tpm_limit&&(o.tpm_limit=r.tpm_limit),void 0!==r.rpm_limit&&null!==r.rpm_limit&&(o.rpm_limit=r.rpm_limit),void 0!==r.allowed_models&&(o.allowed_models=r.allowed_models),console.log("Final request body:",o);let a=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(o)});if(!a.ok){let e=await a.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let r=t?.detail?.error||"Failed to add team member",n=Error(r);throw n.raw=t,n}let i=await a.json();return console.log("API Response:",i),i}catch(e){throw console.error("Failed to update team member:",e),e}},tg=async(e,t,r)=>{try{console.log("Form Values in teamMemberAddCall:",r);let n=await L.post("/team/member_delete",{accessToken:e,body:{team_id:t,...void 0!==r.user_email&&{user_email:r.user_email},...void 0!==r.user_id&&{user_id:r.user_id}}});return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},th=async(e,t,r)=>{try{console.log("Form Values in teamMemberAddCall:",r);let n=_?`${_}/organization/member_add`:"/organization/member_add",o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,member:r})});if(!o.ok){let e=await o.text();throw N(e),console.error("Error response from the server:",e),Error(e)}let a=await o.json();return console.log("API Response:",a),a}catch(e){throw console.error("Failed to create organization member:",e),e}},tv=async(e,t,r)=>{try{console.log("Form Values in organizationMemberDeleteCall:",r);let n=await L.delete("/organization/member_delete",{accessToken:e,body:{organization_id:t,user_id:r}});return console.log("API Response:",n),n}catch(e){throw console.error("Failed to delete organization member:",e),e}},ty=async(e,t,r)=>{try{console.log("Form Values in organizationMemberUpdateCall:",r);let n=await L.patch("/organization/member_update",{accessToken:e,body:{organization_id:t,...r}});return console.log("API Response:",n),n}catch(e){throw console.error("Failed to update organization member:",e),e}},tb=async(e,t,r)=>{try{console.log("Form Values in userUpdateUserCall:",t);let n={...t};null!==r&&(n.user_role=r);let o=await L.post("/user/update",{accessToken:e,body:n});return console.log("API Response:",o),o}catch(e){throw console.error("Failed to create key:",e),e}},tw=async(e,t,r,n=!1)=>{try{let o;if(console.log("Form Values in userUpdateUserCall:",t),n)o={all_users:!0,user_updates:t};else if(r&&r.length>0){let e=[];for(let n of r)e.push({user_id:n,...t});o={users:e}}else throw Error("Must provide either userIds or set allUsers=true");let a=await L.post("/user/bulk_update",{accessToken:e,body:o});return console.log("API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},tC=async(e,t)=>{try{let r=_?`${_}/health/services?service=${t}`:`/health/services?service=${t}`;console.log("Checking Slack Budget Alerts service health");let n=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.text();throw N(e),Error(e)}return await n.json()}catch(e){throw console.error("Failed to perform health check:",e),e}},tx=async e=>{try{return await L.get("/budget/list",{accessToken:e})}catch(e){throw console.error("Failed to get callbacks:",e),e}},tS=async(e,t,r)=>{try{return await L.get("/get/config/callbacks",{accessToken:e})}catch(e){throw console.error("Failed to get callbacks:",e),e}},t$=async e=>{try{let t=_?`${_}/config/list?config_type=general_settings`:"/config/list?config_type=general_settings",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.json(),t=w(e);throw N(t),Error(t)}return await r.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tE=async e=>{try{return await L.get("/router/settings",{accessToken:e})}catch(e){throw console.error("Failed to get router settings:",e),e}},tk=async e=>{try{return await L.get("/cache/settings",{accessToken:e})}catch(e){throw console.error("Failed to get cache settings:",e),e}},tO=async(e,t)=>{try{return await L.post("/cache/settings/test",{accessToken:e,body:{cache_settings:t}})}catch(e){throw console.error("Failed to test cache connection:",e),e}},tj=async(e,t)=>{try{return await L.post("/cache/settings",{accessToken:e,body:{cache_settings:t}})}catch(e){throw console.error("Failed to update cache settings:",e),e}},tT=async(e,t)=>{try{let r="/config/pass_through_endpoint";return t&&(r+=`/team/${t}`),await L.get(r,{accessToken:e})}catch(e){throw console.error("Failed to get callbacks:",e),e}},t_=async(e,t)=>{try{let r=_?`${_}/config/field/info?field_name=${t}`:`/config/field/info?field_name=${t}`,n=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.json(),t=w(e);throw N(t),Error(t)}return await n.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tP=async(e,t)=>{try{return await L.post("/config/pass_through_endpoint",{accessToken:e,body:{...t}})}catch(e){throw console.error("Failed to set callbacks:",e),e}},tI=async(e,t,r)=>{try{let n=await L.post("/config/field/update",{accessToken:e,body:{field_name:t,field_value:r,config_type:"general_settings"}});return y.default.success("Successfully updated value!"),n}catch(e){throw console.error("Failed to set callbacks:",e),e}},tF=async(e,t)=>{try{let r=await L.post("/config/field/delete",{accessToken:e,body:{field_name:t,config_type:"general_settings"}});return y.default.success("Field reset on proxy"),r}catch(e){throw console.error("Failed to get callbacks:",e),e}},tN=async(e,t)=>{try{let r=_?`${_}/config/pass_through_endpoint?endpoint_id=${t}`:`/config/pass_through_endpoint?endpoint_id=${t}`,n=await fetch(r,{method:"DELETE",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.json(),t=w(e);throw N(t),Error(t)}return await n.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tR=async(e,t)=>{try{return await L.post("/config/update",{accessToken:e,body:{...t}})}catch(e){throw console.error("Failed to set callbacks:",e),e}},tM=async(e,t)=>{try{let r=_?`${_}/health?model_id=${encodeURIComponent(t)}`:`/health?model_id=${encodeURIComponent(t)}`,n=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.json(),t=w(e);throw N(t),Error(t)}return await n.json()}catch(e){throw console.error(`Failed to call /health for model id ${t}:`,e),e}},tA=async e=>{try{let t=_?`${_}/cache/ping`:"/cache/ping",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw N(e),Error(e)}return await r.json()}catch(e){throw console.error("Failed to call /cache/ping:",e),e}},tB=async e=>{try{let t=_?`${_}/health/latest`:"/health/latest",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw N(e),Error(e)}return await r.json()}catch(e){throw console.error("Failed to call /health/latest:",e),e}},tz=async e=>{try{return console.log("Getting proxy UI settings"),console.log("proxyBaseUrl in getProxyUISettings:",_),await L.get("/sso/get/ui_settings",{accessToken:e})}catch(e){throw console.error("Failed to get callbacks:",e),e}},tL=async e=>{try{let t=_?`${_}/get/ui_settings`:"/get/ui_settings",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.json(),t=w(e);return console.error("Failed to get UI settings:",t),null}return await r.json()}catch(e){return console.error("Failed to get UI settings:",e),null}},tH=async e=>{try{return await L.get("/get/mcp_semantic_filter_settings",{accessToken:e})}catch(e){throw console.error("Failed to get MCP semantic filter settings:",e),e}},tD=async(e,t)=>{try{let r=_?`${_}/update/mcp_semantic_filter_settings`:"/update/mcp_semantic_filter_settings",n=await fetch(r,{method:"PATCH",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){let e=await n.json(),t=w(e);throw N(t),Error(t)}return await n.json()}catch(e){throw console.error("Failed to update MCP semantic filter settings:",e),e}},tV=async(e,t,r)=>{try{let n=_?`${_}/v1/responses`:"/v1/responses",o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({model:t,input:[{role:"user",content:r,type:"message"}],tools:[{type:"mcp",server_url:"litellm_proxy",require_approval:"never"}],tool_choice:"required"})}),a=o.headers.get("x-litellm-semantic-filter"),i=o.headers.get("x-litellm-semantic-filter-tools");if(!o.ok){let e=await o.json(),t=w(e);throw N(t),Error(t)}return{data:await o.json(),headers:{filter:a,tools:i}}}catch(e){throw console.error("Failed to test MCP semantic filter:",e),e}},tW=async e=>{try{let t=_?`${_}/v2/guardrails/list`:"/v2/guardrails/list",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok)throw Error(`v2 guardrails/list returned ${r.status}`);return await r.json()}catch(t){console.log("v2/guardrails/list failed, falling back to v1:",t);try{let t=_?`${_}/guardrails/list`:"/guardrails/list",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.json(),t=w(e);throw N(t),Error(t)}return await r.json()}catch(e){throw console.error("Failed to get guardrails list:",e),e}}},tU=async(e,t)=>L.get("/guardrails/submissions",{accessToken:e,query:{...t?.status?{status:t.status}:{},...t?.team_id?{team_id:t.team_id}:{},...t?.team_guardrail!==void 0?{team_guardrail:t.team_guardrail}:{},...t?.search?{search:t.search}:{}}}),tG=async(e,t)=>L.post(`/guardrails/submissions/${encodeURIComponent(t)}/approve`,{accessToken:e}),tq=async(e,t)=>L.post(`/guardrails/submissions/${encodeURIComponent(t)}/reject`,{accessToken:e}),tK=async(e,t,r)=>{try{let n=_?`${_}/guardrails/usage/overview`:"/guardrails/usage/overview",o=new URLSearchParams;t&&o.append("start_date",t),r&&o.append("end_date",r),o.toString()&&(n+=`?${o.toString()}`);let a=await fetch(n,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!a.ok){let e=await a.json();throw Error(w(e))}return a.json()}catch(e){throw console.error("Failed to get guardrails usage overview:",e),e}},tX=async(e,t,r,n)=>{try{let o=_?`${_}/guardrails/usage/detail/${encodeURIComponent(t)}`:`/guardrails/usage/detail/${encodeURIComponent(t)}`,a=new URLSearchParams;r&&a.append("start_date",r),n&&a.append("end_date",n),a.toString()&&(o+=`?${a.toString()}`);let i=await fetch(o,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!i.ok){let e=await i.json();throw Error(w(e))}return i.json()}catch(e){throw console.error("Failed to get guardrails usage detail:",e),e}},tJ=async(e,t)=>{try{let r=_?`${_}/guardrails/usage/logs`:"/guardrails/usage/logs",n=new URLSearchParams;t.guardrailId&&n.append("guardrail_id",t.guardrailId),t.policyId&&n.append("policy_id",t.policyId),null!=t.page&&n.append("page",String(t.page)),null!=t.pageSize&&n.append("page_size",String(t.pageSize)),t.action&&n.append("action",t.action),t.startDate&&n.append("start_date",t.startDate),t.endDate&&n.append("end_date",t.endDate),n.toString()&&(r+=`?${n.toString()}`);let o=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.json();throw Error(w(e))}return o.json()}catch(e){throw console.error("Failed to get guardrails usage logs:",e),e}},tY=async e=>{try{return await L.get("/policies/list",{accessToken:e})}catch(e){throw console.error("Failed to get policies list:",e),e}},tQ=async(e,t,r)=>{try{let n=_?`${_}/utils/test_policies_and_guardrails`:"/utils/test_policies_and_guardrails",o=await fetch(n,{method:"POST",signal:r,headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({policy_names:t.policy_names??null,guardrail_names:t.guardrail_names??null,inputs:t.inputs??null,inputs_list:t.inputs_list??null,request_data:t.request_data??{},input_type:t.input_type??"request",agent_id:t.agent_id??null})});if(!o.ok){let e=await o.text(),t="Failed to test policies and guardrails";try{let r=JSON.parse(e);r.detail?t="string"==typeof r.detail?r.detail:JSON.stringify(r.detail):r.message&&(t=r.message)}catch{t=e||t}throw N(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to test policies and guardrails:",e),e}},tZ=async(e,t)=>{try{return await L.get(`/policy/info/${t}`,{accessToken:e})}catch(e){throw console.error(`Failed to get policy info for ${t}:`,e),e}},t0=async e=>{try{return await L.get("/policy/templates",{accessToken:e})}catch(e){throw console.error("Failed to get policy templates:",e),e}},t1=async(e,t,r,n,o)=>{try{let a=_?`${_}/policy/templates/enrich`:"/policy/templates/enrich",i={template_id:t,parameters:r};n&&(i.model=n),o&&(i.competitors=o);let l=await fetch(a,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(i)});if(!l.ok){let e=await l.json(),t=w(e);throw N(t),Error(t)}return await l.json()}catch(e){throw console.error("Failed to enrich policy template:",e),e}},t2=async(e,t,r,n)=>{try{return await L.post("/policy/templates/suggest",{accessToken:e,body:{attack_examples:t.filter(e=>e.trim()),description:r,model:n}})}catch(e){throw console.error("Failed to suggest policy templates:",e),e}},t4=async(e,t,r)=>{try{return await L.post("/policy/templates/test",{accessToken:e,body:{guardrail_definitions:t,text:r}})}catch(e){throw console.error("Failed to test policy template:",e),e}},t6=async(e,t,r,n,o,a,i,l,s)=>{let c=_?`${_}/policy/templates/enrich/stream`:"/policy/templates/enrich/stream",u={template_id:t,parameters:r,model:n};l?.instruction&&(u.instruction=l.instruction),l?.existingCompetitors&&(u.competitors=l.existingCompetitors);let d=await fetch(c,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(u)});if(!d.ok){let e=w(await d.json());throw N(e),Error(e)}let f=d.body?.getReader();if(!f)throw Error("No response body");let p=new TextDecoder,m="";for(;;){let{done:e,value:t}=await f.read();if(e)break;let r=(m+=p.decode(t,{stream:!0})).split("\n");for(let e of(m=r.pop()||"",r))if(e.startsWith("data: "))try{let t=JSON.parse(e.slice(6));"competitor"===t.type?o(t.name):"status"===t.type?s?.(t.message):"done"===t.type?a(t):"error"===t.type&&i?.(t.message)}catch{}}},t5=async(e,t,r,n,o,a,i,l,s)=>{let c=_?`${_}/usage/ai/chat`:"/usage/ai/chat",u=await fetch(c,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({messages:t,model:r}),signal:s});if(!u.ok){let e=w(await u.json());throw N(e),Error(e)}let d=u.body?.getReader();if(!d)throw Error("No response body");let f=new TextDecoder,p="";for(;;){let{done:e,value:t}=await d.read();if(e)break;let r=(p+=f.decode(t,{stream:!0})).split("\n");for(let e of(p=r.pop()||"",r))if(e.startsWith("data: "))try{let t=JSON.parse(e.slice(6));"chunk"===t.type?n(t.content):"status"===t.type?i?.(t.message):"tool_call"===t.type?l?.(t):"done"===t.type?o():"error"===t.type&&a?.(t.message)}catch{}}},t3=async(e,t)=>{try{return await L.post("/policies",{accessToken:e,body:t})}catch(e){throw console.error("Failed to create policy:",e),e}},t7=async(e,t,r)=>{try{return await L.put(`/policies/${t}`,{accessToken:e,body:r})}catch(e){throw console.error("Failed to update policy:",e),e}},t8=async(e,t)=>{try{let r=encodeURIComponent(t),n=_?`${_}/policies/name/${r}/versions`:`/policies/name/${r}/versions`,o=await fetch(n,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=w(e);throw N(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to list policy versions:",e),e}},t9=async(e,t,r)=>{try{let n=encodeURIComponent(t),o=_?`${_}/policies/name/${n}/versions`:`/policies/name/${n}/versions`,a=await fetch(o,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({source_policy_id:r??void 0})});if(!a.ok){let e=await a.json(),t=w(e);throw N(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to create policy version:",e),e}},re=async(e,t,r)=>{try{return await L.put(`/policies/${t}/status`,{accessToken:e,body:{version_status:r}})}catch(e){throw console.error("Failed to update policy version status:",e),e}},rt=async(e,t)=>{try{return await L.delete(`/policies/${t}`,{accessToken:e})}catch(e){throw console.error("Failed to delete policy:",e),e}},rr=async(e,t)=>{try{return await L.get(`/policies/${t}`,{accessToken:e})}catch(e){throw console.error("Failed to get policy info:",e),e}},rn=async e=>{try{return await L.get("/policies/attachments/list",{accessToken:e})}catch(e){throw console.error("Failed to get policy attachments list:",e),e}},ro=async(e,t)=>{try{return await L.post("/policies/attachments",{accessToken:e,body:t})}catch(e){throw console.error("Failed to create policy attachment:",e),e}},ra=async(e,t)=>{try{let r=_?`${_}/policies/attachments/${t}`:`/policies/attachments/${t}`,n=await fetch(r,{method:"DELETE",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.json(),t=w(e);throw N(t),Error(t)}return await n.json()}catch(e){throw console.error("Failed to delete policy attachment:",e),e}},ri=async(e,t,r)=>{try{return await L.post("/policies/test-pipeline",{accessToken:e,body:{pipeline:t,test_messages:r}})}catch(e){throw console.error("Failed to test pipeline:",e),e}},rl=async(e,t)=>{try{let r=_?`${_}/policies/${t}/resolved-guardrails`:`/policies/${t}/resolved-guardrails`,n=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.json(),t=w(e);throw N(t),Error(t)}return await n.json()}catch(e){throw console.error("Failed to get resolved guardrails:",e),e}},rs=async(e,t)=>{try{return await L.post("/policies/resolve",{accessToken:e,body:t})}catch(e){throw console.error("Failed to resolve policies:",e),e}},rc=async(e,t)=>{try{let r=_?`${_}/policies/attachments/estimate-impact`:"/policies/attachments/estimate-impact",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){let e=await n.json(),t=w(e);throw N(t),Error(t)}return await n.json()}catch(e){throw console.error("Failed to estimate attachment impact:",e),e}},ru=async(e,t)=>{try{return await L.get("/prompts/list",{accessToken:e,query:{environment:t||void 0}})}catch(e){throw console.error("Failed to get prompts list:",e),e}},rd=async(e,t,r)=>{try{return await L.get(`/prompts/${t}/info`,{accessToken:e,query:{environment:r||void 0}})}catch(e){throw console.error("Failed to get prompt info:",e),e}},rf=async(e,t,r)=>{try{let n=_?`${_}/prompts/${t}/versions`:`/prompts/${t}/versions`;r&&(n+=`?environment=${encodeURIComponent(r)}`);let o=await fetch(n,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=w(e);throw 404!==o.status&&N(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get prompt versions:",e),e}},rp=async(e,t)=>{try{return await L.post("/prompts",{accessToken:e,body:t})}catch(e){throw console.error("Failed to create prompt:",e),e}},rm=async(e,t,r)=>{try{return await L.put(`/prompts/${t}`,{accessToken:e,body:r})}catch(e){throw console.error("Failed to update prompt:",e),e}},rg=async(e,t)=>{try{return await L.delete(`/prompts/${t}`,{accessToken:e})}catch(e){throw console.error("Failed to delete prompt:",e),e}},rh=async(e,t)=>{try{let r=new FormData;r.append("file",t);let n=_?`${_}/utils/dotprompt_json_converter`:"/utils/dotprompt_json_converter",o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`},body:r});if(!o.ok){let e=await o.json(),t=w(e);throw N(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to convert prompt file:",e),e}},rv=async(e,t)=>{try{let r=_?`${_}/v1/agents`:"/v1/agents",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!n.ok){let e=await n.text();throw N(e),Error(e)}let o=await n.json();return console.log("Create agent response:",o),o}catch(e){throw console.error("Failed to create agent:",e),e}},ry=async(e,t,r)=>{let n=_?`${_}/v1/a2a/discover`:"/v1/a2a/discover",o={url:t};r?.discovery_mode&&(o.discovery_mode=r.discovery_mode),r?.params&&(o.params=r.params);let a=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(o)});if(!a.ok){let e=await a.text();throw N(e),Error(e)}return await a.json()},rb=async(e,t)=>{try{let r=_?`${_}/guardrails`:"/guardrails",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({guardrail:t})});if(!n.ok){let e=await n.text();throw N(e),Error(e)}let o=await n.json();return console.log("Create guardrail response:",o),o}catch(e){throw console.error("Failed to create guardrail:",e),e}},rw=async(e,t,r)=>{try{let n=_?`${_}/spend/logs/ui/${t}?start_date=${encodeURIComponent(r)}`:`/spend/logs/ui/${t}?start_date=${encodeURIComponent(r)}`;console.log("Fetching log details from:",n);let o=await fetch(n,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=w(e);throw N(t),Error(t)}let a=await o.json();return console.log("Fetched log details:",a),a}catch(e){throw console.error("Failed to fetch log details:",e),e}},rC=async e=>{try{let t=await L.get("/get/internal_user_settings",{accessToken:e});return console.log("Fetched SSO settings:",t),t}catch(e){throw console.error("Failed to fetch SSO settings:",e),e}},rx=async(e,t)=>{try{let r=_?`${_}/update/internal_user_settings`:"/update/internal_user_settings";console.log("Updating internal user settings:",t);let n=await fetch(r,{method:"PATCH",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){let e=await n.text();throw N(e),Error(e)}let o=await n.json();return console.log("Updated internal user settings:",o),y.default.success("Internal user settings updated successfully"),o}catch(e){throw console.error("Failed to update internal user settings:",e),e}},rS=async e=>{try{let t=_?`${_}/v1/mcp/openapi-registry`:"/v1/mcp/openapi-registry",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.json();throw Error(w(e))}return await r.json()}catch(e){throw console.error("Failed to fetch OpenAPI registry:",e),e}},r$=async e=>{try{return await L.get("/v1/mcp/discover",{accessToken:e})}catch(e){throw console.error("Failed to fetch discoverable MCP servers:",e),e}},rE=async(e,t)=>{try{return await L.get("/v1/mcp/server",{accessToken:e,query:{team_id:t||void 0}})}catch(e){throw console.error("Failed to fetch MCP servers:",e),e}},rk=async(e,t)=>{try{return await L.get("/v1/mcp/server/health",{accessToken:e,query:{server_ids:t&&t.length>0?t:void 0}})}catch(e){throw console.error("Failed to fetch MCP server health:",e),e}},rO=async e=>{try{let t=await L.get("/v1/mcp/access_groups",{accessToken:e});return console.log("Fetched MCP access groups:",t),t.access_groups||[]}catch(e){throw console.error("Failed to fetch MCP access groups:",e),e}},rj=async e=>{try{let t=_?`${_}/v1/mcp/network/client-ip`:"/v1/mcp/network/client-ip",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`}});if(!r.ok)return null;return(await r.json()).ip||null}catch{return null}},rT=async(e,t)=>{try{console.log("Form Values in createMCPServer:",t);let r=await L.post("/v1/mcp/server",{accessToken:e,body:{...t}});return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},r_=async(e,t)=>{try{return await L.put("/v1/mcp/server",{accessToken:e,body:t})}catch(e){throw console.error("Failed to update MCP server:",e),e}},rP=async(e,t)=>{try{console.log("in deleteMCPServer:",t),await L.delete(`/v1/mcp/server/${t}`,{accessToken:e})}catch(e){throw console.error("Failed to delete key:",e),e}},rI=async e=>{try{return await L.get("/v1/mcp/toolset",{accessToken:e})}catch(e){throw console.error("Failed to fetch MCP toolsets:",e),e}},rF=async(e,t)=>{try{return await L.post("/v1/mcp/toolset",{accessToken:e,body:t})}catch(e){throw console.error("Failed to create MCP toolset:",e),e}},rN=async(e,t)=>{try{return await L.put("/v1/mcp/toolset",{accessToken:e,body:t})}catch(e){throw console.error("Failed to update MCP toolset:",e),e}},rR=async(e,t)=>{try{await L.delete(`/v1/mcp/toolset/${t}`,{accessToken:e})}catch(e){throw console.error("Failed to delete MCP toolset:",e),e}},rM=async(e,t)=>{try{return await L.post("/v1/mcp/server/register",{accessToken:e,body:t})}catch(e){throw console.error("Failed to register MCP server:",e),e}},rA=async e=>{try{let t=(_?`${_}`:"")+"/v1/mcp/server/submissions",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.json().catch(()=>({})),t=w(e);throw N(t),Error(t)}return r.json()}catch(e){throw console.error("Failed to fetch MCP submissions:",e),e}},rB=async(e,t)=>{try{let r=(_?`${_}`:"")+`/v1/mcp/server/${encodeURIComponent(t)}/approve`,n=await fetch(r,{method:"PUT",headers:{[A]:`Bearer ${e}`}});if(!n.ok){let e=await n.json().catch(()=>({})),t=w(e);throw N(t),Error(t)}return n.json()}catch(e){throw console.error("Failed to approve MCP server:",e),e}},rz=async(e,t,r)=>{try{let n=(_?`${_}`:"")+`/v1/mcp/server/${encodeURIComponent(t)}/reject`,o=await fetch(n,{method:"PUT",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({review_notes:r??null})});if(!o.ok){let e=await o.json().catch(()=>({})),t=w(e);throw N(t),Error(t)}return o.json()}catch(e){throw console.error("Failed to reject MCP server:",e),e}},rL=async e=>{try{let t=await L.get("/search_tools/list",{accessToken:e});return console.log("Fetched search tools:",t),t}catch(e){throw console.error("Failed to fetch search tools:",e),e}},rH=async(e,t)=>{try{console.log("Creating search tool with values:",t);let r=await L.post("/search_tools",{accessToken:e,body:{search_tool:t}});return console.log("Created search tool:",r),r}catch(e){throw console.error("Failed to create search tool:",e),e}},rD=async(e,t,r)=>{try{console.log("Updating search tool with ID:",t,"values:",r);let n=await L.put(`/search_tools/${t}`,{accessToken:e,body:{search_tool:r}});return console.log("Updated search tool:",n),n}catch(e){throw console.error("Failed to update search tool:",e),e}},rV=async(e,t)=>{try{console.log("Deleting search tool:",t);let r=await L.delete(`/search_tools/${t}`,{accessToken:e});return console.log("Deleted search tool:",r),r}catch(e){throw console.error("Failed to delete search tool:",e),e}},rW=async e=>{try{let t=_?`${_}/search_tools/ui/available_providers`:"/search_tools/ui/available_providers";console.log("Fetching available search providers from:",t);let r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.json(),t=w(e);throw N(t),Error(t)}let n=await r.json();return console.log("Fetched available search providers:",n),n}catch(e){throw console.error("Failed to fetch available search providers:",e),e}},rU=async(e,t)=>{try{let r=await L.post("/search_tools/test_connection",{accessToken:e,body:{litellm_params:t}});return console.log("Test connection response:",r),r}catch(e){throw console.error("Failed to test search tool connection:",e),e}},rG=async(e,t,r,n)=>{let o,a=`server_id=${t}${n?"&include_disabled_tools=true":""}`,i=_?`${_}/mcp-rest/tools/list?${a}`:`/mcp-rest/tools/list?${a}`;console.log("Fetching MCP tools from:",i);let l={[A]:`Bearer ${e}`,"Content-Type":"application/json",...r};try{o=await fetch(i,{method:"GET",headers:l})}catch(e){return console.error("Failed to fetch MCP tools (network error):",e),{tools:[],error:"network_error",message:e instanceof Error?e.message:"Failed to fetch MCP tools",stack_trace:null}}let s=null;try{s=await o.json()}catch(e){return console.error("Failed to parse MCP tools response:",e),{tools:[],error:"parse_error",message:"Failed to parse MCP tools response",status:o.status,statusText:o.statusText,stack_trace:null}}if(console.log("Fetched MCP tools response:",s),!o.ok){let e=s&&(s.message||s.error)||"Failed to fetch MCP tools";return{tools:[],error:s&&s.error||`http_${o.status}`,message:e,status:o.status,statusText:o.statusText,details:s,stack_trace:null}}return s},rq=async(e,t,r,n,o)=>{try{let a=_?`${_}/mcp-rest/tools/call`:"/mcp-rest/tools/call";console.log("Calling MCP tool:",r,"with arguments:",n,"for server:",t);let i={[A]:`Bearer ${e}`,"Content-Type":"application/json",...o?.customHeaders||{}},l={server_id:t,name:r,arguments:n};o?.guardrails&&o.guardrails.length>0&&(l.litellm_metadata={guardrails:o.guardrails});let s=await fetch(a,{method:"POST",headers:i,body:JSON.stringify(l)});if(!s.ok){let e="Network response was not ok",t=null,r=await s.text();try{let n=JSON.parse(r);n.detail?"string"==typeof n.detail?e=n.detail:"object"==typeof n.detail&&(e=n.detail.message||n.detail.error||"An error occurred",t=n.detail):e=n.message||n.error||e}catch(t){console.error("Failed to parse JSON error response:",t),r&&(e=r)}let n=Error(e);throw n.status=s.status,n.statusText=s.statusText,n.details=t,N(e),n}let c=await s.json();return console.log("MCP tool call response:",c),c}catch(e){throw console.error("Failed to call MCP tool:",e),console.error("Error type:",typeof e),e instanceof Error&&(console.error("Error message:",e.message),console.error("Error stack:",e.stack)),e}},rK=async(e,t)=>{try{let r=_?`${_}/tag/new`:"/tag/new",n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",[A]:`Bearer ${e}`},body:JSON.stringify(t)});if(!n.ok){let e=await n.text();await N(e);return}return await n.json()}catch(e){throw console.error("Error creating tag:",e),e}},rX=async(e,t)=>{try{let r=_?`${_}/tag/update`:"/tag/update",n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",[A]:`Bearer ${e}`},body:JSON.stringify(t)});if(!n.ok){let e=await n.text();await N(e);return}return await n.json()}catch(e){throw console.error("Error updating tag:",e),e}},rJ=async(e,t)=>{try{let r=_?`${_}/tag/info`:"/tag/info",n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",[A]:`Bearer ${e}`},body:JSON.stringify({names:t})});if(!n.ok){let e=await n.text();return await N(e),{}}return await n.json()}catch(e){throw console.error("Error getting tag info:",e),e}},rY=e=>{let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${n}`},rQ=async(e,t,r)=>{try{let n=_?`${_}/tag/list`:"/tag/list";if(t&&r){let e=new URLSearchParams({start_date:rY(t),end_date:rY(r)});n=`${n}?${e.toString()}`}let o=await fetch(n,{method:"GET",headers:{[A]:`Bearer ${e}`}});if(!o.ok){let e=await o.text();return await N(e),{}}return await o.json()}catch(e){throw console.error("Error listing tags:",e),e}},rZ=async(e,t)=>{try{let r=_?`${_}/tag/delete`:"/tag/delete",n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",[A]:`Bearer ${e}`},body:JSON.stringify({name:t})});if(!n.ok){let e=await n.text();await N(e);return}return await n.json()}catch(e){throw console.error("Error deleting tag:",e),e}},r0=async e=>{try{let t=await L.get("/get/default_team_settings",{accessToken:e});return console.log("Fetched default team settings:",t),t}catch(e){throw console.error("Failed to fetch default team settings:",e),e}},r1=async(e,t)=>{try{console.log("Updating default team settings:",t);let r=await L.patch("/update/default_team_settings",{accessToken:e,body:t});return console.log("Updated default team settings:",r),r}catch(e){throw console.error("Failed to update default team settings:",e),e}},r2=async(e,t)=>{try{let r=_?`${_}/team/permissions_list?team_id=${t}`:`/team/permissions_list?team_id=${t}`,n=await fetch(r,{method:"GET",headers:{"Content-Type":"application/json",[A]:`Bearer ${e}`}});if(!n.ok){let e=await n.json(),t=w(e);return console.error("Available permissions fetch failed:",t),{all_available_permissions:[],team_member_permissions:[]}}return await n.json()}catch(e){throw console.error("Failed to get team permissions:",e),e}},r4=async(e,t,r)=>{try{let n=await L.post("/team/permissions_update",{accessToken:e,body:{team_id:t,team_member_permissions:r}});return console.log("Team permissions response:",n),n}catch(e){throw console.error("Failed to update team permissions:",e),e}},r6=async(e,t)=>{try{let r=_?`${_}/spend/logs/session/ui?session_id=${encodeURIComponent(t)}`:`/spend/logs/session/ui?session_id=${encodeURIComponent(t)}`,n=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.json(),t=w(e);throw N(t),Error(t)}return await n.json()}catch(e){throw console.error("Failed to fetch session logs:",e),e}},r5=async(e,t)=>{try{let r=_?`${_}/vector_store/new`:"/vector_store/new",n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",[A]:`Bearer ${e}`},body:JSON.stringify(t)});if(!n.ok){let e=await n.json();throw Error(e.detail||"Failed to create vector store")}return await n.json()}catch(e){throw console.error("Error creating vector store:",e),e}},r3=async(e,t=1,r=100)=>{try{let t=_?`${_}/vector_store/list`:"/vector_store/list",r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",[A]:`Bearer ${e}`}});if(!r.ok){let e=await r.json();throw Error(e.detail||"Failed to list vector stores")}return await r.json()}catch(e){throw console.error("Error listing vector stores:",e),e}},r7=async(e,t)=>{try{let r=_?`${_}/vector_store/delete`:"/vector_store/delete",n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",[A]:`Bearer ${e}`},body:JSON.stringify({vector_store_id:t})});if(!n.ok){let e=await n.json();throw Error(e.detail||"Failed to delete vector store")}return await n.json()}catch(e){throw console.error("Error deleting vector store:",e),e}},r8=async(e,t)=>{try{let r=_?`${_}/vector_store/info`:"/vector_store/info",n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",[A]:`Bearer ${e}`},body:JSON.stringify({vector_store_id:t})});if(!n.ok){let e=await n.json();throw Error(e.detail||"Failed to get vector store info")}return await n.json()}catch(e){throw console.error("Error getting vector store info:",e),e}},r9=async(e,t)=>{try{let r=_?`${_}/vector_store/update`:"/vector_store/update",n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",[A]:`Bearer ${e}`},body:JSON.stringify(t)});if(!n.ok){let e=await n.json();throw Error(e.detail||"Failed to update vector store")}return await n.json()}catch(e){throw console.error("Error updating vector store:",e),e}},ne=async(e,t,r,n,o,a,i)=>{try{let l=_?`${_}/rag/ingest`:"/rag/ingest",s=new FormData;s.append("file",t);let c={ingest_options:{vector_store:{custom_llm_provider:r,...n&&{vector_store_id:n},...i&&i}}};(o||a)&&(c.ingest_options.litellm_vector_store_params={},o&&(c.ingest_options.litellm_vector_store_params.vector_store_name=o),a&&(c.ingest_options.litellm_vector_store_params.vector_store_description=a)),s.append("request",JSON.stringify(c));let u=await fetch(l,{method:"POST",headers:{[A]:`Bearer ${e}`},body:s});if(!u.ok){let e=await u.json();throw Error(e.error?.message||e.detail||"Failed to ingest document")}return await u.json()}catch(e){throw console.error("Error ingesting document:",e),e}},nt=async e=>{try{let t=_?`${_}/email/event_settings`:"/email/event_settings",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw N(e),Error("Failed to get email event settings")}let n=await r.json();return console.log("Email event settings response:",n),n}catch(e){throw console.error("Failed to get email event settings:",e),e}},nr=async(e,t)=>{try{let r=_?`${_}/email/event_settings`:"/email/event_settings",n=await fetch(r,{method:"PATCH",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){let e=await n.text();throw N(e),Error("Failed to update email event settings")}let o=await n.json();return console.log("Update email event settings response:",o),o}catch(e){throw console.error("Failed to update email event settings:",e),e}},nn=async e=>{try{let t=_?`${_}/email/event_settings/reset`:"/email/event_settings/reset",r=await fetch(t,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw N(e),Error("Failed to reset email event settings")}let n=await r.json();return console.log("Reset email event settings response:",n),n}catch(e){throw console.error("Failed to reset email event settings:",e),e}},no=async(e,t)=>{try{let r=_?`${_}/v1/agents/${t}`:`/v1/agents/${t}`,n=await fetch(r,{method:"DELETE",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.text();throw N(e),Error(e)}let o=await n.json();return console.log("Delete agent response:",o),o}catch(e){throw console.error("Failed to delete agent:",e),e}},na=async(e,t)=>{try{let r=_?`${_}/v1/agents/make_public`:"/v1/agents/make_public",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({agent_ids:t})});if(!n.ok){let e=await n.text();throw N(e),Error(e)}let o=await n.json();return console.log("Make agents public response:",o),o}catch(e){throw console.error("Failed to make agents public:",e),e}},ni=async(e,t)=>{try{let r=_?`${_}/v1/mcp/make_public`:"/v1/mcp/make_public",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({mcp_server_ids:t})});if(!n.ok){let e=await n.text();throw N(e),Error(e)}let o=await n.json();return console.log("Make agents public response:",o),o}catch(e){throw console.error("Failed to make agents public:",e),e}},nl=async(e,t)=>{try{let r=_?`${_}/guardrails/${t}`:`/guardrails/${t}`,n=await fetch(r,{method:"DELETE",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.text();throw N(e),Error(e)}let o=await n.json();return console.log("Delete guardrail response:",o),o}catch(e){throw console.error("Failed to delete guardrail:",e),e}},ns=async e=>{try{let t=_?`${_}/guardrails/ui/add_guardrail_settings`:"/guardrails/ui/add_guardrail_settings",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw N(e),Error("Failed to get guardrail UI settings")}let n=await r.json();return console.log("Guardrail UI settings response:",n),n}catch(e){throw console.error("Failed to get guardrail UI settings:",e),e}},nc=async e=>{try{let t=_?`${_}/guardrails/ui/provider_specific_params`:"/guardrails/ui/provider_specific_params",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw N(e),Error("Failed to get guardrail provider specific parameters")}let n=await r.json();return console.log("Guardrail provider specific params response:",n),n}catch(e){throw console.error("Failed to get guardrail provider specific parameters:",e),e}},nu=async(e,t)=>{try{let r=encodeURIComponent(t),n=_?`${_}/guardrails/ui/category_yaml/${r}`:`/guardrails/ui/category_yaml/${r}`;console.log(`Fetching category YAML from: ${n}`);let o=await fetch(n,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw console.error(`Failed to get category YAML. Status: ${o.status}, Error:`,e),N(e),Error(`Failed to get category YAML: ${o.status} ${e}`)}let a=await o.json();return console.log("Category YAML response:",a),a}catch(e){throw console.error("Failed to get category YAML:",e),e}},nd=async e=>{try{let t=_?`${_}/guardrails/ui/major_airlines`:"/guardrails/ui/major_airlines",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw console.error(`Failed to get major airlines. Status: ${r.status}, Error:`,e),N(e),Error(`Failed to get major airlines: ${r.status} ${e}`)}return await r.json()}catch(e){throw console.error("Failed to get major airlines:",e),e}},nf=async(e,t=!1)=>{try{let r=t?"?health_check=true":"",n=_?`${_}/v1/agents${r}`:`/v1/agents${r}`,o=await fetch(n,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw N(e),Error("Failed to get agents list")}let a=await o.json();return console.log("Agents list response:",a),{agents:a}}catch(e){throw console.error("Failed to get agents list:",e),e}},np=async(e,t)=>{try{let r=_?`${_}/v1/agents/${t}`:`/v1/agents/${t}`,n=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.text();throw N(e),Error("Failed to get agent info")}let o=await n.json();return console.log("Agent info response:",o),o}catch(e){throw console.error("Failed to get agent info:",e),e}},nm=async(e,t)=>{try{let r=_?`${_}/guardrails/${t}/info`:`/guardrails/${t}/info`,n=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.text();throw N(e),Error("Failed to get guardrail info")}let o=await n.json();return console.log("Guardrail info response:",o),o}catch(e){throw console.error("Failed to get guardrail info:",e),e}},ng=async(e,t,r)=>{try{let n=_?`${_}/v1/agents/${t}`:`/v1/agents/${t}`,o=await fetch(n,{method:"PATCH",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!o.ok){let e=await o.text();throw N(e),Error("Failed to patch agent")}let a=await o.json();return console.log("Patch agent response:",a),a}catch(e){throw console.error("Failed to update guardrail:",e),e}},nh=async(e,t,r)=>{try{let n=_?`${_}/guardrails/${t}`:`/guardrails/${t}`,o=await fetch(n,{method:"PATCH",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!o.ok){let e=await o.text();throw N(e),Error("Failed to update guardrail")}let a=await o.json();return console.log("Update guardrail response:",a),a}catch(e){throw console.error("Failed to update guardrail:",e),e}},nv=async(e,t,r,n,o)=>{try{let a=_?`${_}/guardrails/apply_guardrail`:"/guardrails/apply_guardrail",i={guardrail_name:t,text:r};n&&(i.language=n),o&&o.length>0&&(i.entities=o);let l=await fetch(a,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(i)});if(!l.ok){let e=await l.text(),t="Failed to apply guardrail";try{let r=JSON.parse(e);r.error?.message?t=r.error.message:r.detail?t=r.detail:r.message&&(t=r.message)}catch(r){t=e||t}throw N(e),Error(t)}let s=await l.json();return console.log("Apply guardrail response:",s),s}catch(e){throw console.error("Failed to apply guardrail:",e),e}},ny=async(e,t)=>{try{let r=_?`${_}/guardrails/test_custom_code`:"/guardrails/test_custom_code",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){let e=await n.text(),t="Failed to test custom code guardrail";try{let r=JSON.parse(e);r.error?.message?t=r.error.message:r.detail?t=r.detail:r.message&&(t=r.message)}catch(r){t=e||t}throw N(e),Error(t)}let o=await n.json();return console.log("Test custom code guardrail response:",o),o}catch(e){throw console.error("Failed to test custom code guardrail:",e),e}},nb=async(e,t)=>{try{let r=_?`${_}/guardrails/validate_blocked_words_file`:"/guardrails/validate_blocked_words_file",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({file_content:t})});if(!n.ok){let e=await n.text();throw N(e),Error("Failed to validate blocked words file")}let o=await n.json();return console.log("Validate blocked words file response:",o),o}catch(e){throw console.error("Failed to validate blocked words file:",e),e}},nw=async e=>{try{let t=await L.get("/get/sso_settings",{accessToken:e});return console.log("Fetched SSO configuration:",t),t}catch(e){throw console.error("Failed to fetch SSO configuration:",e),e}},nC=async(e,t)=>{try{let r=_?`${_}/update/sso_settings`:"/update/sso_settings";console.log("Updating SSO configuration:",t);let n=await fetch(r,{method:"PATCH",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){let e=await n.json(),t="object"==typeof e?.detail?e.detail?.error||e.detail?.message:e?.detail,r="string"==typeof t&&t.length>0?t:w(e);N(r);let o=Error(r);throw e?.detail!==void 0&&(o.detail=e.detail),o.rawError=e,o}let o=await n.json();return console.log("Updated SSO configuration:",o),o}catch(e){throw console.error("Failed to update SSO configuration:",e),e}},nx=async({accessToken:e,page:t=1,page_size:r=50,params:n={}})=>{try{let o=_?`${_}/audit`:"/audit",a=new URLSearchParams;for(let[e,o]of(a.append("page",t.toString()),a.append("page_size",r.toString()),Object.entries(n)))null!=o&&""!==o&&a.append(e,String(o));o+=`?${a.toString()}`;let i=await fetch(o,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!i.ok){let e=await i.json(),t=w(e);throw N(t),Error(t)}return await i.json()}catch(e){throw console.error("Failed to fetch audit logs:",e),e}},nS=async e=>{try{let t=_?`${_}/user/available_users`:"/user/available_users",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`}});if(!r.ok){if(404===r.status)return null;let e=await r.text();throw N(e),Error("Network response was not ok")}return await r.json()}catch(e){throw console.error("Failed to fetch remaining users:",e),e}},n$=async e=>{try{let t=_?`${_}/health/license`:"/health/license",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`}});if(!r.ok){if(404===r.status)return null;let e=await r.text();throw N(e),Error("Network response was not ok")}return await r.json()}catch(e){throw console.error("Failed to fetch license info:",e),e}},nE=async(e,t,r)=>{try{let n=_?`${_}/config/pass_through_endpoint/${encodeURIComponent(t)}`:`/config/pass_through_endpoint/${encodeURIComponent(t)}`,o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!o.ok){let e=await o.json(),t=w(e);throw N(t),Error(t)}let a=await o.json();return y.default.success("Pass through endpoint updated successfully"),a}catch(e){throw console.error("Failed to update pass through endpoint:",e),e}},nk=async(e,t)=>{try{return await L.post("/config/callback/delete",{accessToken:e,body:{callback_name:t}})}catch(e){throw console.error("Failed to delete specific callback:",e),e}},nO=async(e,t,r)=>{try{console.log("Testing MCP tools list with config:",JSON.stringify(t));let n=_?`${_}/mcp-rest/test/tools/list`:"/mcp-rest/test/tools/list",o={"Content-Type":"application/json"};e&&(o["x-litellm-api-key"]=e),r?o.Authorization=`Bearer ${r}`:e&&(o[A]=`Bearer ${e}`);let a=await fetch(n,{method:"POST",headers:o,body:JSON.stringify(t)}),i=a.headers.get("content-type");if(!i||!i.includes("application/json")){let e=await a.text();throw console.error("Received non-JSON response:",e),Error(`Received non-JSON response (${a.status}: ${a.statusText}). Check network tab for details.`)}let l=await a.json();if((!a.ok||l.error)&&!l.error)return{tools:[],error:"request_failed",message:l.message||`MCP tools list failed: ${a.status} ${a.statusText}`};return l}catch(e){throw console.error("MCP tools list test error:",e),e}},nj=async(e,t)=>{let r=_?`${_}/v1/mcp/server/oauth/session`:"/v1/mcp/server/oauth/session",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)}),o=await n.json();if(!n.ok)throw Error(w(o)||o?.error||"Failed to cache MCP server");return o},nT=async(e,t,r)=>{let n=P(),o=encodeURIComponent(t.trim()),a=`${n}/v1/mcp/server/oauth/${o}/register`,i=await fetch(a,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json, text/event-stream"},body:JSON.stringify(r)}),l=await i.json();if(!i.ok)throw Error(w(l)||l?.detail||"Failed to register OAuth client");return l},n_=({serverId:e,clientId:t,redirectUri:r,state:n,codeChallenge:o,scope:a})=>{let i=P(),l=encodeURIComponent(e.trim()),s=`${i}/v1/mcp/server/oauth/${l}/authorize`,c=new URLSearchParams({redirect_uri:r,state:n,response_type:"code",code_challenge:o,code_challenge_method:"S256"});return t&&t.trim().length>0&&c.set("client_id",t),a&&a.trim().length>0&&c.set("scope",a),`${s}?${c.toString()}`},nP=async({serverId:e,code:t,clientId:r,clientSecret:n,codeVerifier:o,redirectUri:a,accessToken:i})=>{let l=P(),s=encodeURIComponent(e.trim()),c=`${l}/v1/mcp/server/oauth/${s}/token`,u=new URLSearchParams;u.set("grant_type","authorization_code"),u.set("code",t),r&&r.trim().length>0&&u.set("client_id",r),n&&n.trim().length>0&&u.set("client_secret",n),u.set("code_verifier",o),u.set("redirect_uri",a);let d={"Content-Type":"application/x-www-form-urlencoded"};i&&(d.Authorization=`Bearer ${i}`);let f=await fetch(c,{method:"POST",headers:d,body:u.toString()}),p=await f.json();if(!f.ok)throw Error(w(p)||p?.detail||"OAuth token exchange failed");return p},nI=async(e,t,r)=>{try{let n=`${P()}/v1/vector_stores/${t}/search`,o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({query:r})});if(!o.ok){let e=await o.text();return await N(e),null}return await o.json()}catch(e){throw console.error("Error testing vector store search:",e),e}},nF=async(e,t,r,n)=>{try{let o=`${P()}/v1/search/${t}`,a=await fetch(o,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({query:r,max_results:n||5})});if(!a.ok){let e=await a.text();return await N(e),null}return await a.json()}catch(e){throw console.error("Error querying search tool:",e),e}},nN=async(e,t,r,n)=>{try{let o,a,i,l=n&&n.length>0;return await L.get("/tag/dau",{accessToken:e,query:{end_date:(o=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),`${o}-${a}-${i}`),tag_filters:l?n:void 0,tag_filter:!l&&r?r:void 0}})}catch(e){throw console.error("Failed to fetch DAU:",e),e}},nR=async(e,t,r,n)=>{try{let o,a,i,l=n&&n.length>0;return await L.get("/tag/wau",{accessToken:e,query:{end_date:(o=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),`${o}-${a}-${i}`),tag_filters:l?n:void 0,tag_filter:!l&&r?r:void 0}})}catch(e){throw console.error("Failed to fetch WAU:",e),e}},nM=async(e,t,r,n)=>{try{let o,a,i,l=n&&n.length>0;return await L.get("/tag/mau",{accessToken:e,query:{end_date:(o=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),`${o}-${a}-${i}`),tag_filters:l?n:void 0,tag_filter:!l&&r?r:void 0}})}catch(e){throw console.error("Failed to fetch MAU:",e),e}},nA=async e=>{try{return await L.get("/tag/distinct",{accessToken:e})}catch(e){throw console.error("Failed to fetch distinct tags:",e),e}},nB=async(e,t,r,n)=>{try{let o=e=>{let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${n}`};return await L.get("/tag/summary",{accessToken:e,query:{start_date:o(t),end_date:o(r),tag_filters:n&&n.length>0?n:void 0}})}catch(e){throw console.error("Failed to fetch user agent summary:",e),e}},nz=async(e,t=1,r=50,n)=>{try{return await L.get("/tag/user-agent/per-user-analytics",{accessToken:e,query:{page:t.toString(),page_size:r.toString(),tag_filters:n&&n.length>0?n:void 0}})}catch(e){throw console.error("Failed to fetch per-user analytics:",e),e}},nL=async(e,t,r)=>{let o=P(),a=r?"/v3/login":"/v2/login",i=o?`${o}${a}`:a,l=JSON.stringify({username:e,password:t}),s=await fetch(i,{method:"POST",body:l,credentials:"include",headers:{"Content-Type":"application/json"}});if(!s.ok)throw Error(w(await s.json()));let c=await s.json();if(r&&c.code){let e=o?`${o}/v3/login/exchange`:"/v3/login/exchange",t=await fetch(e,{method:"POST",body:JSON.stringify({code:c.code}),credentials:"include",headers:{"Content-Type":"application/json"}});if(!t.ok)throw Error(w(await t.json()));let r=await t.json();return r.token&&(0,n.storeLoginToken)(r.token),r}return c.token&&(0,n.storeLoginToken)(c.token),c},nH=async(e,t)=>{let r=t||P(),n=await fetch(`${r}/v3/login/exchange`,{method:"POST",body:JSON.stringify({code:e}),headers:{"Content-Type":"application/json"}});if(!n.ok)throw Error(w(await n.json()));let o=await n.json();return o.token&&(document.cookie=`token=${o.token}; path=/; SameSite=Lax`),o.token},nD=async()=>{let e=P(),t=e?`${e}/get/ui_settings`:"/get/ui_settings",r=await fetch(t,{method:"GET"});if(!r.ok)throw Error(w(await r.json()));return await r.json()},nV=async(e,t)=>{let r=P(),n=r?`${r}/update/ui_settings`:"/update/ui_settings",o=await fetch(n,{method:"PATCH",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!o.ok)throw Error(w(await o.json()));return await o.json()},nW=async(e,t=!1)=>{try{let r=P(),n=r?`${r}/claude-code/plugins?enabled_only=${t}`:`/claude-code/plugins?enabled_only=${t}`,o=await fetch(n,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.text(),t=w(JSON.parse(e));throw N(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to fetch Claude Code plugins list:",e),e}},nU=async(e,t)=>{try{let r=P(),n=r?`${r}/claude-code/plugins`:"/claude-code/plugins",o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!o.ok){let e=await o.text(),t=w(JSON.parse(e));throw N(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to register Claude Code plugin:",e),e}},nG=async(e,t)=>{try{let r=P(),n=r?`${r}/claude-code/plugins/${t}/enable`:`/claude-code/plugins/${t}/enable`,o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.text(),t=w(JSON.parse(e));throw N(t),Error(t)}return await o.json()}catch(e){throw console.error(`Failed to enable plugin "${t}":`,e),e}},nq=async(e,t)=>{try{let r=P(),n=r?`${r}/claude-code/plugins/${t}/disable`:`/claude-code/plugins/${t}/disable`,o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.text(),t=w(JSON.parse(e));throw N(t),Error(t)}return await o.json()}catch(e){throw console.error(`Failed to disable plugin "${t}":`,e),e}},nK=async(e,t)=>{try{let r=P(),n=r?`${r}/claude-code/plugins/${t}`:`/claude-code/plugins/${t}`,o=await fetch(n,{method:"DELETE",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.text(),t=w(JSON.parse(e));throw N(t),Error(t)}return await o.json()}catch(e){throw console.error(`Failed to delete plugin "${t}":`,e),e}},nX=async(e,t)=>{let r=_?`${_}/compliance/eu-ai-act`:"/compliance/eu-ai-act",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw Error(await n.text());return n.json()},nJ=async(e,t)=>{let r=_?`${_}/compliance/gdpr`:"/compliance/gdpr",n=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw Error(await n.text());return n.json()},nY=async e=>{let t=_?`${_}/v1/tool/policy/options`:"/v1/tool/policy/options",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok)throw Error(await r.text());return r.json()},nQ=async e=>{let t=_?`${_}/v1/tool/list`:"/v1/tool/list",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok)throw Error(await r.text());return(await r.json()).tools??[]},nZ=async(e,t,r)=>{let n=encodeURIComponent(t),o=_?`${_}/v1/tool/${n}/logs`:`/v1/tool/${n}/logs`,a=new URLSearchParams;null!=r.page&&a.append("page",String(r.page)),null!=r.pageSize&&a.append("page_size",String(r.pageSize)),r.startDate&&a.append("start_date",r.startDate),r.endDate&&a.append("end_date",r.endDate);let i=a.toString()?`${o}?${a.toString()}`:o,l=await fetch(i,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!l.ok)throw Error(w(await l.json().catch(()=>({}))));return l.json()},n0=async(e,t)=>{let r=encodeURIComponent(t),n=_?`${_}/v1/tool/${r}/detail`:`/v1/tool/${r}/detail`,o=await fetch(n,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok)throw Error(await o.text());return o.json()},n1=async(e,t,r,n)=>{let o=_?`${_}/v1/tool/policy`:"/v1/tool/policy",a={tool_name:t};null!=r.input_policy&&(a.input_policy=r.input_policy),null!=r.output_policy&&(a.output_policy=r.output_policy),n?.team_id!=null&&(a.team_id=n.team_id||void 0),n?.key_hash!=null&&(a.key_hash=n.key_hash||void 0),n?.key_alias!=null&&(a.key_alias=n.key_alias||void 0);let i=await fetch(o,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(a)});if(!i.ok)throw Error(await i.text());return i.json()},n2=async(e,t,r)=>{let n=encodeURIComponent(t),o=new URLSearchParams;null!=r.team_id&&""!==r.team_id&&o.set("team_id",r.team_id),null!=r.key_hash&&""!==r.key_hash&&o.set("key_hash",r.key_hash);let a=o.toString(),i=_?`${_}/v1/tool/${n}/overrides${a?`?${a}`:""}`:`/v1/tool/${n}/overrides${a?`?${a}`:""}`,l=await fetch(i,{method:"DELETE",headers:{[A]:`Bearer ${e}`}});if(!l.ok)throw Error(await l.text());return l.json()},n4=async(e,t,r)=>{let n=_?`${_}/v1/mcp/server/${t}/oauth-user-credential`:`/v1/mcp/server/${t}/oauth-user-credential`,o=await fetch(n,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!o.ok){let e=await o.json().catch(()=>({})),t=e?.detail;throw Error((Array.isArray(t)?t.map(e=>e&&"object"==typeof e?e.msg??JSON.stringify(e):String(e)).join("; "):"string"==typeof t?t:t&&"string"==typeof t.error?t.error:void 0)||"Failed to store OAuth credential")}return o.json()},n6=async(e,t)=>{let r=_?`${_}/v1/mcp/server/${t}/oauth-user-credential`:`/v1/mcp/server/${t}/oauth-user-credential`,n=await fetch(r,{method:"DELETE",headers:{[A]:`Bearer ${e}`}});if(!n.ok){let e=await n.json().catch(()=>({})),t=e?.detail;throw Error((Array.isArray(t)?t.map(e=>e&&"object"==typeof e?e.msg??JSON.stringify(e):String(e)).join("; "):"string"==typeof t?t:t&&"string"==typeof t.error?t.error:void 0)||"Failed to revoke OAuth credential")}return n.json()},n5=async(e,t)=>{let r=_?`${_}/v1/mcp/server/${t}/oauth-user-credential/status`:`/v1/mcp/server/${t}/oauth-user-credential/status`,n=await fetch(r,{method:"GET",headers:{[A]:`Bearer ${e}`}});return n.ok?n.json():{server_id:t,has_credential:!1,is_expired:!1}},n3=async e=>{let t=_?`${_}/v1/mcp/user-credentials`:"/v1/mcp/user-credentials",r=await fetch(t,{method:"GET",headers:{[A]:`Bearer ${e}`}});return r.ok?r.json():[]},n7=async(e,t)=>L.get(`/v1/mcp/server/${t}/user-env-vars`,{accessToken:e}),n8=async(e,t,r)=>L.post(`/v1/mcp/server/${t}/user-env-vars`,{accessToken:e,body:{values:r}}),n9=async e=>{try{return await L.get("/v1/mcp/user-env-vars/status",{accessToken:e})}catch{return[]}},oe=e=>e.split("/").map(encodeURIComponent).join("/"),ot=async(e,t={})=>{let r=_?`${_}/v1/memory`:"/v1/memory",n=new URLSearchParams;t.keyPrefix?n.append("key_prefix",t.keyPrefix):t.key&&n.append("key",t.key),null!=t.page&&n.append("page",String(t.page)),null!=t.pageSize&&n.append("page_size",String(t.pageSize));let o=n.toString()?`${r}?${n.toString()}`:r,a=await fetch(o,{method:"GET",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!a.ok)throw Error(await a.text());return a.json()},or=async(e,t)=>{let r=_?`${_}/v1/memory`:"/v1/memory",n={key:t.key,value:t.value};void 0!==t.metadata&&(n.metadata=t.metadata);let o=await fetch(r,{method:"POST",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(n)});if(!o.ok)throw Error(await o.text());return o.json()},on=async(e,t,r)=>{let n=oe(t),o=_?`${_}/v1/memory/${n}`:`/v1/memory/${n}`,a=await fetch(o,{method:"PUT",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!a.ok)throw Error(await a.text());return a.json()},oo=async(e,t)=>{let r=oe(t),n=_?`${_}/v1/memory/${r}`:`/v1/memory/${r}`,o=await fetch(n,{method:"DELETE",headers:{[A]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok)throw Error(await o.text())}},180166,e=>{"use strict";var t={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},r=new class{#e=t;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function n(e){setTimeout(e,0)}e.s(["systemSetTimeoutZero",()=>n,"timeoutManager",()=>r])},619273,e=>{"use strict";var t=e.i(180166),r="u"=0&&e!==1/0}function i(e,t){return Math.max(e+(t||0)-Date.now(),0)}function l(e,t){return"function"==typeof e?e(t):e}function s(e,t){return"function"==typeof e?e(t):e}function c(e,t){let{type:r="all",exact:n,fetchStatus:o,predicate:a,queryKey:i,stale:l}=e;if(i){if(n){if(t.queryHash!==d(i,t.options))return!1}else if(!p(t.queryKey,i))return!1}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof l||t.isStale()===l)&&(!o||o===t.state.fetchStatus)&&(!a||!!a(t))}function u(e,t){let{exact:r,status:n,predicate:o,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(f(t.options.mutationKey)!==f(a))return!1}else if(!p(t.options.mutationKey,a))return!1}return(!n||t.state.status===n)&&(!o||!!o(t))}function d(e,t){return(t?.queryKeyHashFn||f)(e)}function f(e){return JSON.stringify(e,(e,t)=>v(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function p(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(r=>p(e[r],t[r]))}var m=Object.prototype.hasOwnProperty;function g(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function h(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function v(e){if(!y(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!y(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function y(e){return"[object Object]"===Object.prototype.toString.call(e)}function b(e){return new Promise(r=>{t.timeoutManager.setTimeout(r,e)})}function w(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r,n=0){if(t===r)return t;if(n>500)return r;let o=h(t)&&h(r);if(!o&&!(v(t)&&v(r)))return r;let a=(o?t:Object.keys(t)).length,i=o?r:Object.keys(r),l=i.length,s=o?Array(l):{},c=0;for(let u=0;ur?n.slice(1):n}function S(e,t,r=0){let n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var $=Symbol();function E(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==$?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}function k(e,t){return"function"==typeof e?e(...t):!!e}function O(e,t,r){let n,o=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(n??=t(),o||(o=!0,n.aborted?r():n.addEventListener("abort",r,{once:!0})),n)}),e}e.s(["addConsumeAwareSignal",()=>O,"addToEnd",()=>x,"addToStart",()=>S,"ensureQueryFn",()=>E,"functionalUpdate",()=>o,"hashKey",()=>f,"hashQueryKeyByOptions",()=>d,"isServer",()=>r,"isValidTimeout",()=>a,"keepPreviousData",()=>C,"matchMutation",()=>u,"matchQuery",()=>c,"noop",()=>n,"partialMatchKey",()=>p,"replaceData",()=>w,"resolveEnabled",()=>s,"resolveStaleTime",()=>l,"shallowEqualObjects",()=>g,"shouldThrowError",()=>k,"skipToken",()=>$,"sleep",()=>b,"timeUntilStale",()=>i])},540143,e=>{"use strict";let t,r,n,o,a,i;var l=e.i(180166).systemSetTimeoutZero,s=(t=[],r=0,n=e=>{e()},o=e=>{e()},a=l,{batch:e=>{let i;r++;try{i=e()}finally{let e;--r||(e=t,t=[],e.length&&a(()=>{o(()=>{e.forEach(e=>{n(e)})})}))}return i},batchCalls:e=>(...t)=>{i(()=>{e(...t)})},schedule:i=e=>{r?t.push(e):a(()=>{n(e)})},setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{o=e},setScheduler:e=>{a=e}});e.s(["notifyManager",()=>s])},915823,e=>{"use strict";var t=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};e.s(["Subscribable",()=>t])},175555,e=>{"use strict";var t=e.i(915823),r=e.i(619273),n=new class extends t.Subscribable{#r;#n;#o;constructor(){super(),this.#o=e=>{if(!r.isServer&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#n||this.setEventListener(this.#o)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#o=e,this.#n?.(),this.#n=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#r!==e&&(this.#r=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#r?this.#r:globalThis.document?.visibilityState!=="hidden"}};e.s(["focusManager",()=>n])},936553,814448,793803,e=>{"use strict";var t=e.i(175555),r=e.i(915823),n=e.i(619273),o=new class extends r.Subscribable{#a=!0;#n;#o;constructor(){super(),this.#o=e=>{if(!n.isServer&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#n||this.setEventListener(this.#o)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#o=e,this.#n?.(),this.#n=e(this.setOnline.bind(this))}setOnline(e){this.#a!==e&&(this.#a=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#a}};function a(){let e,t,r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}function i(e){return Math.min(1e3*2**e,3e4)}function l(e){return(e??"online")!=="online"||o.isOnline()}e.s(["onlineManager",()=>o],814448),e.s(["pendingThenable",()=>a],793803);var s=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function c(e){let r,c=!1,u=0,d=a(),f=()=>t.focusManager.isFocused()&&("always"===e.networkMode||o.isOnline())&&e.canRun(),p=()=>l(e.networkMode)&&e.canRun(),m=e=>{"pending"===d.status&&(r?.(),d.resolve(e))},g=e=>{"pending"===d.status&&(r?.(),d.reject(e))},h=()=>new Promise(t=>{r=e=>{("pending"!==d.status||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,"pending"===d.status&&e.onContinue?.()}),v=()=>{let t;if("pending"!==d.status)return;let r=0===u?e.initialPromise:void 0;try{t=r??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(m).catch(t=>{if("pending"!==d.status)return;let r=e.retry??3*!n.isServer,o=e.retryDelay??i,a="function"==typeof o?o(u,t):o,l=!0===r||"number"==typeof r&&uf()?void 0:h()).then(()=>{c?g(t):v()}))})};return{promise:d,status:()=>d.status,cancel:t=>{if("pending"===d.status){let r=new s(t);g(r),e.onCancel?.(r)}},continue:()=>(r?.(),d),cancelRetry:()=>{c=!0},continueRetry:()=>{c=!1},canStart:p,start:()=>(p()?v():h().then(v),d)}}e.s(["CancelledError",()=>s,"canFetch",()=>l,"createRetryer",()=>c],936553)},88587,e=>{"use strict";var t=e.i(180166),r=e.i(619273),n=class{#i;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,r.isValidTimeout)(this.gcTime)&&(this.#i=t.timeoutManager.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(r.isServer?1/0:3e5))}clearGcTimeout(){this.#i&&(t.timeoutManager.clearTimeout(this.#i),this.#i=void 0)}};e.s(["Removable",()=>n])},286491,e=>{"use strict";var t=e.i(619273),r=e.i(540143),n=e.i(936553),o=e.i(88587),a=class extends o.Removable{#l;#s;#c;#u;#d;#f;#p;constructor(e){super(),this.#p=!1,this.#f=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#u=e.client,this.#c=this.#u.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#l=s(this.options),this.state=e.state??this.#l,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#d?.promise}setOptions(e){if(this.options={...this.#f,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=s(this.options);void 0!==e.data&&(this.setState(l(e.data,e.dataUpdatedAt)),this.#l=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#c.remove(this)}setData(e,r){let n=(0,t.replaceData)(this.state.data,e,this.options);return this.#m({data:n,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),n}setState(e,t){this.#m({type:"setState",state:e,setStateOptions:t})}cancel(e){let r=this.#d?.promise;return this.#d?.cancel(e),r?r.then(t.noop).catch(t.noop):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#l)}isActive(){return this.observers.some(e=>!1!==(0,t.resolveEnabled)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===t.skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,t.resolveStaleTime)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,t.timeUntilStale)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#d?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#d?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#c.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#d&&(this.#p?this.#d.cancel({revert:!0}):this.#d.cancelRetry()),this.scheduleGc()),this.#c.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#m({type:"invalidate"})}async fetch(e,r){let o;if("idle"!==this.state.fetchStatus&&this.#d?.status()!=="rejected"){if(void 0!==this.state.data&&r?.cancelRefetch)this.cancel({silent:!0});else if(this.#d)return this.#d.continueRetry(),this.#d.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let a=new AbortController,i=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#p=!0,a.signal)})},l=()=>{let e,n=(0,t.ensureQueryFn)(this.options,r),o=(i(e={client:this.#u,queryKey:this.queryKey,meta:this.meta}),e);return(this.#p=!1,this.options.persister)?this.options.persister(n,o,this):n(o)},s=(i(o={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:this.#u,state:this.state,fetchFn:l}),o);this.options.behavior?.onFetch(s,this),this.#s=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==s.fetchOptions?.meta)&&this.#m({type:"fetch",meta:s.fetchOptions?.meta}),this.#d=(0,n.createRetryer)({initialPromise:r?.initialPromise,fn:s.fetchFn,onCancel:e=>{e instanceof n.CancelledError&&e.revert&&this.setState({...this.#s,fetchStatus:"idle"}),a.abort()},onFail:(e,t)=>{this.#m({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#m({type:"pause"})},onContinue:()=>{this.#m({type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0});try{let e=await this.#d.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#c.config.onSuccess?.(e,this),this.#c.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof n.CancelledError){if(e.silent)return this.#d.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#m({type:"error",error:e}),this.#c.config.onError?.(e,this),this.#c.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#m(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...i(t.data,this.options),fetchMeta:e.meta??null};case"success":let r={...t,...l(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#s=e.manual?r:void 0,r;case"error":let n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),r.notifyManager.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#c.notify({query:this,type:"updated",action:e})})}};function i(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,n.canFetch)(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function l(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function s(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}e.s(["Query",()=>a,"fetchState",()=>i])},912598,e=>{"use strict";var t=e.i(271645),r=e.i(843476),n=t.createContext(void 0),o=e=>{let r=t.useContext(n);if(e)return e;if(!r)throw Error("No QueryClient set, use QueryClientProvider to set one");return r},a=({client:e,children:o})=>(t.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,r.jsx)(n.Provider,{value:e,children:o}));e.s(["QueryClientProvider",()=>a,"useQueryClient",()=>o])}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/dac86522fa98e760.js b/litellm/proxy/_experimental/out/_next/static/chunks/51d99dfbdc051e05.js similarity index 80% rename from litellm/proxy/_experimental/out/_next/static/chunks/dac86522fa98e760.js rename to litellm/proxy/_experimental/out/_next/static/chunks/51d99dfbdc051e05.js index d397219843c7..2ab5129855d0 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/dac86522fa98e760.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/51d99dfbdc051e05.js @@ -1,4 +1,4 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,233525,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},349356,e=>{e.v({AElig:"Æ",AMP:"&",Aacute:"Á",Acirc:"Â",Agrave:"À",Aring:"Å",Atilde:"Ã",Auml:"Ä",COPY:"©",Ccedil:"Ç",ETH:"Ð",Eacute:"É",Ecirc:"Ê",Egrave:"È",Euml:"Ë",GT:">",Iacute:"Í",Icirc:"Î",Igrave:"Ì",Iuml:"Ï",LT:"<",Ntilde:"Ñ",Oacute:"Ó",Ocirc:"Ô",Ograve:"Ò",Oslash:"Ø",Otilde:"Õ",Ouml:"Ö",QUOT:'"',REG:"®",THORN:"Þ",Uacute:"Ú",Ucirc:"Û",Ugrave:"Ù",Uuml:"Ü",Yacute:"Ý",aacute:"á",acirc:"â",acute:"´",aelig:"æ",agrave:"à",amp:"&",aring:"å",atilde:"ã",auml:"ä",brvbar:"¦",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",curren:"¤",deg:"°",divide:"÷",eacute:"é",ecirc:"ê",egrave:"è",eth:"ð",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",iacute:"í",icirc:"î",iexcl:"¡",igrave:"ì",iquest:"¿",iuml:"ï",laquo:"«",lt:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",ntilde:"ñ",oacute:"ó",ocirc:"ô",ograve:"ò",ordf:"ª",ordm:"º",oslash:"ø",otilde:"õ",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',raquo:"»",reg:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",thorn:"þ",times:"×",uacute:"ú",ucirc:"û",ugrave:"ù",uml:"¨",uuml:"ü",yacute:"ý",yen:"¥",yuml:"ÿ"})},137429,e=>{e.v({0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"})},367240,54943,555436,e=>{"use strict";var t=e.i(475254);let r=(0,t.default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",()=>r],367240);let n=(0,t.default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["default",()=>n],54943),e.s(["Search",()=>n],555436)},19732,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 472a40 40 0 1080 0 40 40 0 10-80 0zm367 352.9L696.3 352V178H768v-68H256v68h71.7v174L145 824.9c-2.8 7.4-4.3 15.2-4.3 23.1 0 35.3 28.7 64 64 64h614.6c7.9 0 15.7-1.5 23.1-4.3 33-12.7 49.4-49.8 36.6-82.8zM395.7 364.7V180h232.6v184.7L719.2 600c-20.7-5.3-42.1-8-63.9-8-61.2 0-119.2 21.5-165.3 60a188.78 188.78 0 01-121.3 43.9c-32.7 0-64.1-8.3-91.8-23.7l118.8-307.5zM210.5 844l41.7-107.8c35.7 18.1 75.4 27.8 116.6 27.8 61.2 0 119.2-21.5 165.3-60 33.9-28.2 76.3-43.9 121.3-43.9 35 0 68.4 9.5 97.6 27.1L813.5 844h-603z"}}]},name:"experiment",theme:"outlined"};var i=e.i(9583),o=r.forwardRef(function(e,o){return r.createElement(i.default,(0,t.default)({},e,{ref:o,icon:n}))});e.s(["ExperimentOutlined",0,o],19732)},872934,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"}}]},name:"export",theme:"outlined"};var i=e.i(9583),o=r.forwardRef(function(e,o){return r.createElement(i.default,(0,t.default)({},e,{ref:o,icon:n}))});e.s(["ExportOutlined",0,o],872934)},232164,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M483.2 790.3L861.4 412c1.7-1.7 2.5-4 2.3-6.3l-25.5-301.4c-.7-7.8-6.8-13.9-14.6-14.6L522.2 64.3c-2.3-.2-4.7.6-6.3 2.3L137.7 444.8a8.03 8.03 0 000 11.3l334.2 334.2c3.1 3.2 8.2 3.2 11.3 0zm62.6-651.7l224.6 19 19 224.6L477.5 694 233.9 450.5l311.9-311.9zm60.16 186.23a48 48 0 1067.88-67.89 48 48 0 10-67.88 67.89zM889.7 539.8l-39.6-39.5a8.03 8.03 0 00-11.3 0l-362 361.3-237.6-237a8.03 8.03 0 00-11.3 0l-39.6 39.5a8.03 8.03 0 000 11.3l243.2 242.8 39.6 39.5c3.1 3.1 8.2 3.1 11.3 0l407.3-406.6c3.1-3.1 3.1-8.2 0-11.3z"}}]},name:"tags",theme:"outlined"};var i=e.i(9583),o=r.forwardRef(function(e,o){return r.createElement(i.default,(0,t.default)({},e,{ref:o,icon:n}))});e.s(["TagsOutlined",0,o],232164)},878894,664659,531278,e=>{"use strict";var t=e.i(475254);let r=(0,t.default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["AlertTriangle",()=>r],878894);var n=e.i(631171);e.s(["ChevronDown",()=>n.default],664659);let i=(0,t.default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",()=>i],531278)},190272,785913,e=>{"use strict";var t,r,n=((t={}).AUDIO_SPEECH="audio_speech",t.AUDIO_TRANSCRIPTION="audio_transcription",t.IMAGE_GENERATION="image_generation",t.VIDEO_GENERATION="video_generation",t.CHAT="chat",t.RESPONSES="responses",t.IMAGE_EDITS="image_edits",t.ANTHROPIC_MESSAGES="anthropic_messages",t.EMBEDDING="embedding",t),i=((r={}).IMAGE="image",r.VIDEO="video",r.CHAT="chat",r.RESPONSES="responses",r.IMAGE_EDITS="image_edits",r.ANTHROPIC_MESSAGES="anthropic_messages",r.EMBEDDINGS="embeddings",r.SPEECH="speech",r.TRANSCRIPTION="transcription",r.A2A_AGENTS="a2a_agents",r.MCP="mcp",r.REALTIME="realtime",r.INTERACTIONS="interactions",r);let o={image_generation:"image",video_generation:"video",chat:"chat",responses:"responses",image_edits:"image_edits",anthropic_messages:"anthropic_messages",audio_speech:"speech",audio_transcription:"transcription",embedding:"embeddings"};e.s(["EndpointType",()=>i,"getEndpointType",0,e=>{if(console.log("getEndpointType:",e),Object.values(n).includes(e)){let t=o[e];return console.log("endpointType:",t),t}return"chat"}],785913),e.s(["generateCodeSnippet",0,e=>{let t,{apiKeySource:r,accessToken:n,apiKey:o,inputMessage:a,chatHistory:s,selectedTags:l,selectedVectorStores:c,selectedGuardrails:d,selectedPolicies:u,selectedMCPServers:p,mcpServers:m,mcpServerToolRestrictions:g,selectedVoice:h,endpointType:f,selectedModel:b,selectedSdk:y,proxySettings:v}=e,_="session"===r?n:o,x=window.location.origin,k=v?.LITELLM_UI_API_DOC_BASE_URL;k&&k.trim()?x=k:v?.PROXY_BASE_URL&&(x=v.PROXY_BASE_URL);let w=a||"Your prompt here",$=w.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),O=s.filter(e=>!e.isImage).map(({role:e,content:t})=>({role:e,content:t})),S={};l.length>0&&(S.tags=l),c.length>0&&(S.vector_stores=c),d.length>0&&(S.guardrails=d),u.length>0&&(S.policies=u);let j=b||"your-model-name",E="azure"===y?`import openai +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,233525,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},349356,e=>{e.v({AElig:"Æ",AMP:"&",Aacute:"Á",Acirc:"Â",Agrave:"À",Aring:"Å",Atilde:"Ã",Auml:"Ä",COPY:"©",Ccedil:"Ç",ETH:"Ð",Eacute:"É",Ecirc:"Ê",Egrave:"È",Euml:"Ë",GT:">",Iacute:"Í",Icirc:"Î",Igrave:"Ì",Iuml:"Ï",LT:"<",Ntilde:"Ñ",Oacute:"Ó",Ocirc:"Ô",Ograve:"Ò",Oslash:"Ø",Otilde:"Õ",Ouml:"Ö",QUOT:'"',REG:"®",THORN:"Þ",Uacute:"Ú",Ucirc:"Û",Ugrave:"Ù",Uuml:"Ü",Yacute:"Ý",aacute:"á",acirc:"â",acute:"´",aelig:"æ",agrave:"à",amp:"&",aring:"å",atilde:"ã",auml:"ä",brvbar:"¦",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",curren:"¤",deg:"°",divide:"÷",eacute:"é",ecirc:"ê",egrave:"è",eth:"ð",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",iacute:"í",icirc:"î",iexcl:"¡",igrave:"ì",iquest:"¿",iuml:"ï",laquo:"«",lt:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",ntilde:"ñ",oacute:"ó",ocirc:"ô",ograve:"ò",ordf:"ª",ordm:"º",oslash:"ø",otilde:"õ",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',raquo:"»",reg:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",thorn:"þ",times:"×",uacute:"ú",ucirc:"û",ugrave:"ù",uml:"¨",uuml:"ü",yacute:"ý",yen:"¥",yuml:"ÿ"})},137429,e=>{e.v({0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"})},367240,54943,555436,e=>{"use strict";var t=e.i(475254);let r=(0,t.default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",()=>r],367240);let n=(0,t.default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["default",()=>n],54943),e.s(["Search",()=>n],555436)},19732,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 472a40 40 0 1080 0 40 40 0 10-80 0zm367 352.9L696.3 352V178H768v-68H256v68h71.7v174L145 824.9c-2.8 7.4-4.3 15.2-4.3 23.1 0 35.3 28.7 64 64 64h614.6c7.9 0 15.7-1.5 23.1-4.3 33-12.7 49.4-49.8 36.6-82.8zM395.7 364.7V180h232.6v184.7L719.2 600c-20.7-5.3-42.1-8-63.9-8-61.2 0-119.2 21.5-165.3 60a188.78 188.78 0 01-121.3 43.9c-32.7 0-64.1-8.3-91.8-23.7l118.8-307.5zM210.5 844l41.7-107.8c35.7 18.1 75.4 27.8 116.6 27.8 61.2 0 119.2-21.5 165.3-60 33.9-28.2 76.3-43.9 121.3-43.9 35 0 68.4 9.5 97.6 27.1L813.5 844h-603z"}}]},name:"experiment",theme:"outlined"};var i=e.i(9583),o=r.forwardRef(function(e,o){return r.createElement(i.default,(0,t.default)({},e,{ref:o,icon:n}))});e.s(["ExperimentOutlined",0,o],19732)},872934,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"}}]},name:"export",theme:"outlined"};var i=e.i(9583),o=r.forwardRef(function(e,o){return r.createElement(i.default,(0,t.default)({},e,{ref:o,icon:n}))});e.s(["ExportOutlined",0,o],872934)},232164,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M483.2 790.3L861.4 412c1.7-1.7 2.5-4 2.3-6.3l-25.5-301.4c-.7-7.8-6.8-13.9-14.6-14.6L522.2 64.3c-2.3-.2-4.7.6-6.3 2.3L137.7 444.8a8.03 8.03 0 000 11.3l334.2 334.2c3.1 3.2 8.2 3.2 11.3 0zm62.6-651.7l224.6 19 19 224.6L477.5 694 233.9 450.5l311.9-311.9zm60.16 186.23a48 48 0 1067.88-67.89 48 48 0 10-67.88 67.89zM889.7 539.8l-39.6-39.5a8.03 8.03 0 00-11.3 0l-362 361.3-237.6-237a8.03 8.03 0 00-11.3 0l-39.6 39.5a8.03 8.03 0 000 11.3l243.2 242.8 39.6 39.5c3.1 3.1 8.2 3.1 11.3 0l407.3-406.6c3.1-3.1 3.1-8.2 0-11.3z"}}]},name:"tags",theme:"outlined"};var i=e.i(9583),o=r.forwardRef(function(e,o){return r.createElement(i.default,(0,t.default)({},e,{ref:o,icon:n}))});e.s(["TagsOutlined",0,o],232164)},878894,664659,531278,e=>{"use strict";var t=e.i(475254);let r=(0,t.default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["AlertTriangle",()=>r],878894);var n=e.i(631171);e.s(["ChevronDown",()=>n.default],664659);let i=(0,t.default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",()=>i],531278)},190272,785913,e=>{"use strict";var t,r,n=((t={}).AUDIO_SPEECH="audio_speech",t.AUDIO_TRANSCRIPTION="audio_transcription",t.IMAGE_GENERATION="image_generation",t.VIDEO_GENERATION="video_generation",t.CHAT="chat",t.RESPONSES="responses",t.IMAGE_EDITS="image_edits",t.ANTHROPIC_MESSAGES="anthropic_messages",t.EMBEDDING="embedding",t),i=((r={}).IMAGE="image",r.VIDEO="video",r.CHAT="chat",r.RESPONSES="responses",r.IMAGE_EDITS="image_edits",r.ANTHROPIC_MESSAGES="anthropic_messages",r.EMBEDDINGS="embeddings",r.SPEECH="speech",r.TRANSCRIPTION="transcription",r.A2A_AGENTS="a2a_agents",r.MCP="mcp",r.REALTIME="realtime",r.INTERACTIONS="interactions",r);let o={image_generation:"image",video_generation:"video",chat:"chat",responses:"responses",image_edits:"image_edits",anthropic_messages:"anthropic_messages",audio_speech:"speech",audio_transcription:"transcription",embedding:"embeddings"};e.s(["EndpointType",()=>i,"getEndpointType",0,e=>{if(console.log("getEndpointType:",e),Object.values(n).includes(e)){let t=o[e];return console.log("endpointType:",t),t}return"chat"}],785913),e.s(["generateCodeSnippet",0,e=>{let t,{apiKeySource:r,accessToken:n,apiKey:o,inputMessage:a,chatHistory:s,selectedTags:l,selectedVectorStores:c,selectedGuardrails:u,selectedPolicies:d,selectedMCPServers:p,mcpServers:m,mcpServerToolRestrictions:g,selectedVoice:h,endpointType:f,selectedModel:b,selectedSdk:y,proxySettings:v}=e,_="session"===r?n:o,x=window.location.origin,w=v?.LITELLM_UI_API_DOC_BASE_URL;w&&w.trim()?x=w:v?.PROXY_BASE_URL&&(x=v.PROXY_BASE_URL);let k=a||"Your prompt here",$=k.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),O=s.filter(e=>!e.isImage).map(({role:e,content:t})=>({role:e,content:t})),S={};l.length>0&&(S.tags=l),c.length>0&&(S.vector_stores=c),u.length>0&&(S.guardrails=u),d.length>0&&(S.policies=d);let j=b||"your-model-name",E="azure"===y?`import openai client = openai.AzureOpenAI( api_key="${_||"YOUR_LITELLM_API_KEY"}", @@ -10,7 +10,7 @@ client = openai.OpenAI( api_key="${_||"YOUR_LITELLM_API_KEY"}", base_url="${x}" )`;switch(f){case i.CHAT:{let e=Object.keys(S).length>0,r="";if(e){let e=JSON.stringify({metadata:S},null,2).split("\n").map(e=>" ".repeat(4)+e).join("\n").trim();r=`, - extra_body=${e}`}let n=O.length>0?O:[{role:"user",content:w}];t=` + extra_body=${e}`}let n=O.length>0?O:[{role:"user",content:k}];t=` import base64 # Helper function to encode images to base64 @@ -50,7 +50,7 @@ print(response) # ) # print(response_with_file) `;break}case i.RESPONSES:{let e=Object.keys(S).length>0,r="";if(e){let e=JSON.stringify({metadata:S},null,2).split("\n").map(e=>" ".repeat(4)+e).join("\n").trim();r=`, - extra_body=${e}`}let n=O.length>0?O:[{role:"user",content:w}];t=` + extra_body=${e}`}let n=O.length>0?O:[{role:"user",content:k}];t=` import base64 # Helper function to encode images to base64 @@ -417,21 +417,21 @@ print(f"Audio saved to {output_filename}") # ) # response.stream_to_file("output_speech.mp3") `;break;default:t="\n# Code generation for this endpoint is not implemented yet."}return`${E} -${t}`}],190272)},596239,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"};var i=e.i(9583),o=r.forwardRef(function(e,o){return r.createElement(i.default,(0,t.default)({},e,{ref:o,icon:n}))});e.s(["LinkOutlined",0,o],596239)},928685,e=>{"use strict";var t=e.i(38953);e.s(["SearchOutlined",()=>t.default])},44121,186515,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 000 13.8z"}}]},name:"menu-fold",theme:"outlined"};var i=e.i(9583),o=r.forwardRef(function(e,o){return r.createElement(i.default,(0,t.default)({},e,{ref:o,icon:n}))});e.s(["MenuFoldOutlined",0,o],44121);let a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 000-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0014.4 7z"}}]},name:"menu-unfold",theme:"outlined"};var s=r.forwardRef(function(e,n){return r.createElement(i.default,(0,t.default)({},e,{ref:n,icon:a}))});e.s(["MenuUnfoldOutlined",0,s],186515)},283713,e=>{"use strict";var t=e.i(271645),r=e.i(602869),n=e.i(612256);let i="litellm_selected_worker_id";e.s(["useWorker",0,()=>{let{data:e}=(0,n.useUIConfig)(),o=e?.is_control_plane??!1,a=e?.workers??[],[s,l]=(0,t.useState)(()=>localStorage.getItem(i));(0,t.useEffect)(()=>{if(!s||0===a.length)return;let e=a.find(e=>e.worker_id===s);e&&(0,r.switchToWorkerUrl)(e.url)},[s,a]);let c=a.find(e=>e.worker_id===s)??null,d=(0,t.useCallback)(e=>{let t=a.find(t=>t.worker_id===e);t&&(l(e),localStorage.setItem(i,e),(0,r.switchToWorkerUrl)(t.url))},[a]);return{isControlPlane:o,workers:a,selectedWorkerId:s,selectedWorker:c,selectWorker:d,disconnectFromWorker:(0,t.useCallback)(()=>{l(null),localStorage.removeItem(i),(0,r.switchToWorkerUrl)(null)},[])}}])},295320,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M704 446H320c-4.4 0-8 3.6-8 8v402c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8V454c0-4.4-3.6-8-8-8zm-328 64h272v117H376V510zm272 290H376V683h272v117z"}},{tag:"path",attrs:{d:"M424 748a32 32 0 1064 0 32 32 0 10-64 0zm0-178a32 32 0 1064 0 32 32 0 10-64 0z"}},{tag:"path",attrs:{d:"M811.4 368.9C765.6 248 648.9 162 512.2 162S258.8 247.9 213 368.8C126.9 391.5 63.5 470.2 64 563.6 64.6 668 145.6 752.9 247.6 762c4.7.4 8.7-3.3 8.7-8v-60.4c0-4-3-7.4-7-7.9-27-3.4-52.5-15.2-72.1-34.5-24-23.5-37.2-55.1-37.2-88.6 0-28 9.1-54.4 26.2-76.4 16.7-21.4 40.2-36.9 66.1-43.7l37.9-10 13.9-36.7c8.6-22.8 20.6-44.2 35.7-63.5 14.9-19.2 32.6-36 52.4-50 41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.3c19.9 14 37.5 30.8 52.4 50 15.1 19.3 27.1 40.7 35.7 63.5l13.8 36.6 37.8 10c54.2 14.4 92.1 63.7 92.1 120 0 33.6-13.2 65.1-37.2 88.6-19.5 19.2-44.9 31.1-71.9 34.5-4 .5-6.9 3.9-6.9 7.9V754c0 4.7 4.1 8.4 8.8 8 101.7-9.2 182.5-94 183.2-198.2.6-93.4-62.7-172.1-148.6-194.9z"}}]},name:"cloud-server",theme:"outlined"};var i=e.i(9583),o=r.forwardRef(function(e,o){return r.createElement(i.default,(0,t.default)({},e,{ref:o,icon:n}))});e.s(["CloudServerOutlined",0,o],295320)},326373,e=>{"use strict";var t=e.i(21539);e.s(["Dropdown",()=>t.default])},755151,e=>{"use strict";var t=e.i(247153);e.s(["DownOutlined",()=>t.default])},62478,e=>{"use strict";var t=e.i(602869);let r=async e=>{if(!e)return null;try{return await (0,t.getProxyUISettings)(e)}catch(e){return console.error("Error fetching proxy settings:",e),null}};e.s(["fetchProxySettings",0,r])},602073,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64L128 192v384c0 212.1 171.9 384 384 384s384-171.9 384-384V192L512 64zm312 512c0 172.3-139.7 312-312 312S200 748.3 200 576V246l312-110 312 110v330z"}},{tag:"path",attrs:{d:"M378.4 475.1a35.91 35.91 0 00-50.9 0 35.91 35.91 0 000 50.9l129.4 129.4 2.1 2.1a33.98 33.98 0 0048.1 0L730.6 434a33.98 33.98 0 000-48.1l-2.8-2.8a33.98 33.98 0 00-48.1 0L483 579.7 378.4 475.1z"}}]},name:"safety",theme:"outlined"};var i=e.i(9583),o=r.forwardRef(function(e,o){return r.createElement(i.default,(0,t.default)({},e,{ref:o,icon:n}))});e.s(["SafetyOutlined",0,o],602073)},818581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return i}});let n=e.r(271645);function i(e,t){let r=(0,n.useRef)(null),i=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=i.current;t&&(i.current=null,t())}else e&&(r.current=o(e,n)),t&&(i.current=o(t,n))},[e,t])}function o(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},560445,e=>{"use strict";e.i(247167);var t=e.i(271645),r=e.i(201072),n=e.i(726289),i=e.i(864517),o=e.i(562901),a=e.i(779573),s=e.i(343794),l=e.i(361275),c=e.i(244009),d=e.i(611935),u=e.i(763731),p=e.i(242064);e.i(296059);var m=e.i(915654),g=e.i(183293),h=e.i(246422);let f=(e,t,r,n,i)=>({background:e,border:`${(0,m.unit)(n.lineWidth)} ${n.lineType} ${t}`,[`${i}-icon`]:{color:r}}),b=(0,h.genStyleHooks)("Alert",e=>[(e=>{let{componentCls:t,motionDurationSlow:r,marginXS:n,marginSM:i,fontSize:o,fontSizeLG:a,lineHeight:s,borderRadiusLG:l,motionEaseInOutCirc:c,withDescriptionIconSize:d,colorText:u,colorTextHeading:p,withDescriptionPadding:m,defaultPadding:h}=e;return{[t]:Object.assign(Object.assign({},(0,g.resetComponent)(e)),{position:"relative",display:"flex",alignItems:"center",padding:h,wordWrap:"break-word",borderRadius:l,[`&${t}-rtl`]:{direction:"rtl"},[`${t}-content`]:{flex:1,minWidth:0},[`${t}-icon`]:{marginInlineEnd:n,lineHeight:0},"&-description":{display:"none",fontSize:o,lineHeight:s},"&-message":{color:p},[`&${t}-motion-leave`]:{overflow:"hidden",opacity:1,transition:`max-height ${r} ${c}, opacity ${r} ${c}, +${t}`}],190272)},596239,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"};var i=e.i(9583),o=r.forwardRef(function(e,o){return r.createElement(i.default,(0,t.default)({},e,{ref:o,icon:n}))});e.s(["LinkOutlined",0,o],596239)},928685,e=>{"use strict";var t=e.i(38953);e.s(["SearchOutlined",()=>t.default])},44121,186515,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 000 13.8z"}}]},name:"menu-fold",theme:"outlined"};var i=e.i(9583),o=r.forwardRef(function(e,o){return r.createElement(i.default,(0,t.default)({},e,{ref:o,icon:n}))});e.s(["MenuFoldOutlined",0,o],44121);let a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 000-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0014.4 7z"}}]},name:"menu-unfold",theme:"outlined"};var s=r.forwardRef(function(e,n){return r.createElement(i.default,(0,t.default)({},e,{ref:n,icon:a}))});e.s(["MenuUnfoldOutlined",0,s],186515)},283713,e=>{"use strict";var t=e.i(271645),r=e.i(602869),n=e.i(612256);let i="litellm_selected_worker_id";e.s(["useWorker",0,()=>{let{data:e}=(0,n.useUIConfig)(),o=e?.is_control_plane??!1,a=e?.workers??[],[s,l]=(0,t.useState)(()=>localStorage.getItem(i));(0,t.useEffect)(()=>{if(!s||0===a.length)return;let e=a.find(e=>e.worker_id===s);e&&(0,r.switchToWorkerUrl)(e.url)},[s,a]);let c=a.find(e=>e.worker_id===s)??null,u=(0,t.useCallback)(e=>{let t=a.find(t=>t.worker_id===e);t&&(l(e),localStorage.setItem(i,e),(0,r.switchToWorkerUrl)(t.url))},[a]);return{isControlPlane:o,workers:a,selectedWorkerId:s,selectedWorker:c,selectWorker:u,disconnectFromWorker:(0,t.useCallback)(()=>{l(null),localStorage.removeItem(i),(0,r.switchToWorkerUrl)(null)},[])}}])},295320,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M704 446H320c-4.4 0-8 3.6-8 8v402c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8V454c0-4.4-3.6-8-8-8zm-328 64h272v117H376V510zm272 290H376V683h272v117z"}},{tag:"path",attrs:{d:"M424 748a32 32 0 1064 0 32 32 0 10-64 0zm0-178a32 32 0 1064 0 32 32 0 10-64 0z"}},{tag:"path",attrs:{d:"M811.4 368.9C765.6 248 648.9 162 512.2 162S258.8 247.9 213 368.8C126.9 391.5 63.5 470.2 64 563.6 64.6 668 145.6 752.9 247.6 762c4.7.4 8.7-3.3 8.7-8v-60.4c0-4-3-7.4-7-7.9-27-3.4-52.5-15.2-72.1-34.5-24-23.5-37.2-55.1-37.2-88.6 0-28 9.1-54.4 26.2-76.4 16.7-21.4 40.2-36.9 66.1-43.7l37.9-10 13.9-36.7c8.6-22.8 20.6-44.2 35.7-63.5 14.9-19.2 32.6-36 52.4-50 41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.3c19.9 14 37.5 30.8 52.4 50 15.1 19.3 27.1 40.7 35.7 63.5l13.8 36.6 37.8 10c54.2 14.4 92.1 63.7 92.1 120 0 33.6-13.2 65.1-37.2 88.6-19.5 19.2-44.9 31.1-71.9 34.5-4 .5-6.9 3.9-6.9 7.9V754c0 4.7 4.1 8.4 8.8 8 101.7-9.2 182.5-94 183.2-198.2.6-93.4-62.7-172.1-148.6-194.9z"}}]},name:"cloud-server",theme:"outlined"};var i=e.i(9583),o=r.forwardRef(function(e,o){return r.createElement(i.default,(0,t.default)({},e,{ref:o,icon:n}))});e.s(["CloudServerOutlined",0,o],295320)},326373,e=>{"use strict";var t=e.i(21539);e.s(["Dropdown",()=>t.default])},755151,e=>{"use strict";var t=e.i(247153);e.s(["DownOutlined",()=>t.default])},62478,e=>{"use strict";var t=e.i(602869);let r=async e=>{if(!e)return null;try{return await (0,t.getProxyUISettings)(e)}catch(e){return console.error("Error fetching proxy settings:",e),null}};e.s(["fetchProxySettings",0,r])},602073,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64L128 192v384c0 212.1 171.9 384 384 384s384-171.9 384-384V192L512 64zm312 512c0 172.3-139.7 312-312 312S200 748.3 200 576V246l312-110 312 110v330z"}},{tag:"path",attrs:{d:"M378.4 475.1a35.91 35.91 0 00-50.9 0 35.91 35.91 0 000 50.9l129.4 129.4 2.1 2.1a33.98 33.98 0 0048.1 0L730.6 434a33.98 33.98 0 000-48.1l-2.8-2.8a33.98 33.98 0 00-48.1 0L483 579.7 378.4 475.1z"}}]},name:"safety",theme:"outlined"};var i=e.i(9583),o=r.forwardRef(function(e,o){return r.createElement(i.default,(0,t.default)({},e,{ref:o,icon:n}))});e.s(["SafetyOutlined",0,o],602073)},818581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return i}});let n=e.r(271645);function i(e,t){let r=(0,n.useRef)(null),i=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=i.current;t&&(i.current=null,t())}else e&&(r.current=o(e,n)),t&&(i.current=o(t,n))},[e,t])}function o(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},560445,e=>{"use strict";e.i(247167);var t=e.i(271645),r=e.i(201072),n=e.i(726289),i=e.i(864517),o=e.i(562901),a=e.i(779573),s=e.i(343794),l=e.i(361275),c=e.i(244009),u=e.i(611935),d=e.i(763731),p=e.i(242064);e.i(296059);var m=e.i(915654),g=e.i(183293),h=e.i(246422);let f=(e,t,r,n,i)=>({background:e,border:`${(0,m.unit)(n.lineWidth)} ${n.lineType} ${t}`,[`${i}-icon`]:{color:r}}),b=(0,h.genStyleHooks)("Alert",e=>[(e=>{let{componentCls:t,motionDurationSlow:r,marginXS:n,marginSM:i,fontSize:o,fontSizeLG:a,lineHeight:s,borderRadiusLG:l,motionEaseInOutCirc:c,withDescriptionIconSize:u,colorText:d,colorTextHeading:p,withDescriptionPadding:m,defaultPadding:h}=e;return{[t]:Object.assign(Object.assign({},(0,g.resetComponent)(e)),{position:"relative",display:"flex",alignItems:"center",padding:h,wordWrap:"break-word",borderRadius:l,[`&${t}-rtl`]:{direction:"rtl"},[`${t}-content`]:{flex:1,minWidth:0},[`${t}-icon`]:{marginInlineEnd:n,lineHeight:0},"&-description":{display:"none",fontSize:o,lineHeight:s},"&-message":{color:p},[`&${t}-motion-leave`]:{overflow:"hidden",opacity:1,transition:`max-height ${r} ${c}, opacity ${r} ${c}, padding-top ${r} ${c}, padding-bottom ${r} ${c}, - margin-bottom ${r} ${c}`},[`&${t}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}}),[`${t}-with-description`]:{alignItems:"flex-start",padding:m,[`${t}-icon`]:{marginInlineEnd:i,fontSize:d,lineHeight:0},[`${t}-message`]:{display:"block",marginBottom:n,color:p,fontSize:a},[`${t}-description`]:{display:"block",color:u}},[`${t}-banner`]:{marginBottom:0,border:"0 !important",borderRadius:0}}})(e),(e=>{let{componentCls:t,colorSuccess:r,colorSuccessBorder:n,colorSuccessBg:i,colorWarning:o,colorWarningBorder:a,colorWarningBg:s,colorError:l,colorErrorBorder:c,colorErrorBg:d,colorInfo:u,colorInfoBorder:p,colorInfoBg:m}=e;return{[t]:{"&-success":f(i,n,r,e,t),"&-info":f(m,p,u,e,t),"&-warning":f(s,a,o,e,t),"&-error":Object.assign(Object.assign({},f(d,c,l,e,t)),{[`${t}-description > pre`]:{margin:0,padding:0}})}}})(e),(e=>{let{componentCls:t,iconCls:r,motionDurationMid:n,marginXS:i,fontSizeIcon:o,colorIcon:a,colorIconHover:s}=e;return{[t]:{"&-action":{marginInlineStart:i},[`${t}-close-icon`]:{marginInlineStart:i,padding:0,overflow:"hidden",fontSize:o,lineHeight:(0,m.unit)(o),backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",[`${r}-close`]:{color:a,transition:`color ${n}`,"&:hover":{color:s}}},"&-close-text":{color:a,transition:`color ${n}`,"&:hover":{color:s}}}}})(e)],e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:`${e.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`}));var y=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);it.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};let v={success:r.default,info:a.default,error:n.default,warning:o.default},_=e=>{let{icon:r,prefixCls:n,type:i}=e,o=v[i]||null;return r?(0,u.replaceElement)(r,t.createElement("span",{className:`${n}-icon`},r),()=>({className:(0,s.default)(`${n}-icon`,r.props.className)})):t.createElement(o,{className:`${n}-icon`})},x=e=>{let{isClosable:r,prefixCls:n,closeIcon:o,handleClose:a,ariaProps:s}=e,l=!0===o||void 0===o?t.createElement(i.default,null):o;return r?t.createElement("button",Object.assign({type:"button",onClick:a,className:`${n}-close-icon`,tabIndex:0},s),l):null},k=t.forwardRef((e,r)=>{let{description:n,prefixCls:i,message:o,banner:a,className:u,rootClassName:m,style:g,onMouseEnter:h,onMouseLeave:f,onClick:v,afterClose:k,showIcon:w,closable:$,closeText:O,closeIcon:S,action:j,id:E}=e,C=y(e,["description","prefixCls","message","banner","className","rootClassName","style","onMouseEnter","onMouseLeave","onClick","afterClose","showIcon","closable","closeText","closeIcon","action","id"]),[M,I]=t.useState(!1),T=t.useRef(null);t.useImperativeHandle(r,()=>({nativeElement:T.current}));let{getPrefixCls:z,direction:N,closable:A,closeIcon:P,className:R,style:L}=(0,p.useComponentConfig)("alert"),H=z("alert",i),[D,B,U]=b(H),F=t=>{var r;I(!0),null==(r=e.onClose)||r.call(e,t)},W=t.useMemo(()=>void 0!==e.type?e.type:a?"warning":"info",[e.type,a]),V=t.useMemo(()=>"object"==typeof $&&!!$.closeIcon||!!O||("boolean"==typeof $?$:!1!==S&&null!=S||!!A),[O,S,$,A]),G=!!a&&void 0===w||w,q=(0,s.default)(H,`${H}-${W}`,{[`${H}-with-description`]:!!n,[`${H}-no-icon`]:!G,[`${H}-banner`]:!!a,[`${H}-rtl`]:"rtl"===N},R,u,m,U,B),Y=(0,c.default)(C,{aria:!0,data:!0}),K=t.useMemo(()=>"object"==typeof $&&$.closeIcon?$.closeIcon:O||(void 0!==S?S:"object"==typeof A&&A.closeIcon?A.closeIcon:P),[S,$,A,O,P]),J=t.useMemo(()=>{let e=null!=$?$:A;if("object"==typeof e){let{closeIcon:t}=e;return y(e,["closeIcon"])}return{}},[$,A]);return D(t.createElement(l.default,{visible:!M,motionName:`${H}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:k},({className:r,style:i},a)=>t.createElement("div",Object.assign({id:E,ref:(0,d.composeRef)(T,a),"data-show":!M,className:(0,s.default)(q,r),style:Object.assign(Object.assign(Object.assign({},L),g),i),onMouseEnter:h,onMouseLeave:f,onClick:v,role:"alert"},Y),G?t.createElement(_,{description:n,icon:e.icon,prefixCls:H,type:W}):null,t.createElement("div",{className:`${H}-content`},o?t.createElement("div",{className:`${H}-message`},o):null,n?t.createElement("div",{className:`${H}-description`},n):null),j?t.createElement("div",{className:`${H}-action`},j):null,t.createElement(x,{isClosable:V,prefixCls:H,closeIcon:K,handleClose:F,ariaProps:J}))))});var w=e.i(278409),$=e.i(233848),O=e.i(487806),S=e.i(479671),j=e.i(480002),E=e.i(868917);let C=function(e){function r(){var e,t,n;return(0,w.default)(this,r),t=r,n=arguments,t=(0,O.default)(t),(e=(0,j.default)(this,(0,S.default)()?Reflect.construct(t,n||[],(0,O.default)(this).constructor):t.apply(this,n))).state={error:void 0,info:{componentStack:""}},e}return(0,E.default)(r,e),(0,$.default)(r,[{key:"componentDidCatch",value:function(e,t){this.setState({error:e,info:t})}},{key:"render",value:function(){let{message:e,description:r,id:n,children:i}=this.props,{error:o,info:a}=this.state,s=(null==a?void 0:a.componentStack)||null,l=void 0===e?(o||"").toString():e;return o?t.createElement(k,{id:n,type:"error",message:l,description:t.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},void 0===r?s:r)}):i}}])}(t.Component);k.ErrorBoundary=C,e.s(["Alert",0,k],560445)},175712,e=>{"use strict";e.i(247167);var t=e.i(271645),r=e.i(343794),n=e.i(529681),i=e.i(242064),o=e.i(517455),a=e.i(185793),s=e.i(721369),l=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);it.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};let c=e=>{var{prefixCls:n,className:o,hoverable:a=!0}=e,s=l(e,["prefixCls","className","hoverable"]);let{getPrefixCls:c}=t.useContext(i.ConfigContext),d=c("card",n),u=(0,r.default)(`${d}-grid`,o,{[`${d}-grid-hoverable`]:a});return t.createElement("div",Object.assign({},s,{className:u}))};e.i(296059);var d=e.i(915654),u=e.i(183293),p=e.i(246422),m=e.i(838378);let g=(0,p.genStyleHooks)("Card",e=>{let t=(0,m.mergeToken)(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize});return[(e=>{let{componentCls:t,cardShadow:r,cardHeadPadding:n,colorBorderSecondary:i,boxShadowTertiary:o,bodyPadding:a,extraColor:s}=e;return{[t]:Object.assign(Object.assign({},(0,u.resetComponent)(e)),{position:"relative",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,[`&:not(${t}-bordered)`]:{boxShadow:o},[`${t}-head`]:(e=>{let{antCls:t,componentCls:r,headerHeight:n,headerPadding:i,tabsMarginBottom:o}=e;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:n,marginBottom:-1,padding:`0 ${(0,d.unit)(i)}`,color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:`${(0,d.unit)(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`,borderRadius:`${(0,d.unit)(e.borderRadiusLG)} ${(0,d.unit)(e.borderRadiusLG)} 0 0`},(0,u.clearFix)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},u.textEllipsis),{[` + margin-bottom ${r} ${c}`},[`&${t}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}}),[`${t}-with-description`]:{alignItems:"flex-start",padding:m,[`${t}-icon`]:{marginInlineEnd:i,fontSize:u,lineHeight:0},[`${t}-message`]:{display:"block",marginBottom:n,color:p,fontSize:a},[`${t}-description`]:{display:"block",color:d}},[`${t}-banner`]:{marginBottom:0,border:"0 !important",borderRadius:0}}})(e),(e=>{let{componentCls:t,colorSuccess:r,colorSuccessBorder:n,colorSuccessBg:i,colorWarning:o,colorWarningBorder:a,colorWarningBg:s,colorError:l,colorErrorBorder:c,colorErrorBg:u,colorInfo:d,colorInfoBorder:p,colorInfoBg:m}=e;return{[t]:{"&-success":f(i,n,r,e,t),"&-info":f(m,p,d,e,t),"&-warning":f(s,a,o,e,t),"&-error":Object.assign(Object.assign({},f(u,c,l,e,t)),{[`${t}-description > pre`]:{margin:0,padding:0}})}}})(e),(e=>{let{componentCls:t,iconCls:r,motionDurationMid:n,marginXS:i,fontSizeIcon:o,colorIcon:a,colorIconHover:s}=e;return{[t]:{"&-action":{marginInlineStart:i},[`${t}-close-icon`]:{marginInlineStart:i,padding:0,overflow:"hidden",fontSize:o,lineHeight:(0,m.unit)(o),backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",[`${r}-close`]:{color:a,transition:`color ${n}`,"&:hover":{color:s}}},"&-close-text":{color:a,transition:`color ${n}`,"&:hover":{color:s}}}}})(e)],e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:`${e.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`}));var y=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);it.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};let v={success:r.default,info:a.default,error:n.default,warning:o.default},_=e=>{let{icon:r,prefixCls:n,type:i}=e,o=v[i]||null;return r?(0,d.replaceElement)(r,t.createElement("span",{className:`${n}-icon`},r),()=>({className:(0,s.default)(`${n}-icon`,r.props.className)})):t.createElement(o,{className:`${n}-icon`})},x=e=>{let{isClosable:r,prefixCls:n,closeIcon:o,handleClose:a,ariaProps:s}=e,l=!0===o||void 0===o?t.createElement(i.default,null):o;return r?t.createElement("button",Object.assign({type:"button",onClick:a,className:`${n}-close-icon`,tabIndex:0},s),l):null},w=t.forwardRef((e,r)=>{let{description:n,prefixCls:i,message:o,banner:a,className:d,rootClassName:m,style:g,onMouseEnter:h,onMouseLeave:f,onClick:v,afterClose:w,showIcon:k,closable:$,closeText:O,closeIcon:S,action:j,id:E}=e,C=y(e,["description","prefixCls","message","banner","className","rootClassName","style","onMouseEnter","onMouseLeave","onClick","afterClose","showIcon","closable","closeText","closeIcon","action","id"]),[I,M]=t.useState(!1),T=t.useRef(null);t.useImperativeHandle(r,()=>({nativeElement:T.current}));let{getPrefixCls:z,direction:A,closable:N,closeIcon:P,className:R,style:L}=(0,p.useComponentConfig)("alert"),H=z("alert",i),[D,U,B]=b(H),F=t=>{var r;M(!0),null==(r=e.onClose)||r.call(e,t)},V=t.useMemo(()=>void 0!==e.type?e.type:a?"warning":"info",[e.type,a]),W=t.useMemo(()=>"object"==typeof $&&!!$.closeIcon||!!O||("boolean"==typeof $?$:!1!==S&&null!=S||!!N),[O,S,$,N]),G=!!a&&void 0===k||k,q=(0,s.default)(H,`${H}-${V}`,{[`${H}-with-description`]:!!n,[`${H}-no-icon`]:!G,[`${H}-banner`]:!!a,[`${H}-rtl`]:"rtl"===A},R,d,m,B,U),Y=(0,c.default)(C,{aria:!0,data:!0}),K=t.useMemo(()=>"object"==typeof $&&$.closeIcon?$.closeIcon:O||(void 0!==S?S:"object"==typeof N&&N.closeIcon?N.closeIcon:P),[S,$,N,O,P]),J=t.useMemo(()=>{let e=null!=$?$:N;if("object"==typeof e){let{closeIcon:t}=e;return y(e,["closeIcon"])}return{}},[$,N]);return D(t.createElement(l.default,{visible:!I,motionName:`${H}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:w},({className:r,style:i},a)=>t.createElement("div",Object.assign({id:E,ref:(0,u.composeRef)(T,a),"data-show":!I,className:(0,s.default)(q,r),style:Object.assign(Object.assign(Object.assign({},L),g),i),onMouseEnter:h,onMouseLeave:f,onClick:v,role:"alert"},Y),G?t.createElement(_,{description:n,icon:e.icon,prefixCls:H,type:V}):null,t.createElement("div",{className:`${H}-content`},o?t.createElement("div",{className:`${H}-message`},o):null,n?t.createElement("div",{className:`${H}-description`},n):null),j?t.createElement("div",{className:`${H}-action`},j):null,t.createElement(x,{isClosable:W,prefixCls:H,closeIcon:K,handleClose:F,ariaProps:J}))))});var k=e.i(278409),$=e.i(233848),O=e.i(487806),S=e.i(479671),j=e.i(480002),E=e.i(868917);let C=function(e){function r(){var e,t,n;return(0,k.default)(this,r),t=r,n=arguments,t=(0,O.default)(t),(e=(0,j.default)(this,(0,S.default)()?Reflect.construct(t,n||[],(0,O.default)(this).constructor):t.apply(this,n))).state={error:void 0,info:{componentStack:""}},e}return(0,E.default)(r,e),(0,$.default)(r,[{key:"componentDidCatch",value:function(e,t){this.setState({error:e,info:t})}},{key:"render",value:function(){let{message:e,description:r,id:n,children:i}=this.props,{error:o,info:a}=this.state,s=(null==a?void 0:a.componentStack)||null,l=void 0===e?(o||"").toString():e;return o?t.createElement(w,{id:n,type:"error",message:l,description:t.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},void 0===r?s:r)}):i}}])}(t.Component);w.ErrorBoundary=C,e.s(["Alert",0,w],560445)},175712,e=>{"use strict";e.i(247167);var t=e.i(271645),r=e.i(343794),n=e.i(529681),i=e.i(242064),o=e.i(517455),a=e.i(185793),s=e.i(721369),l=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);it.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};let c=e=>{var{prefixCls:n,className:o,hoverable:a=!0}=e,s=l(e,["prefixCls","className","hoverable"]);let{getPrefixCls:c}=t.useContext(i.ConfigContext),u=c("card",n),d=(0,r.default)(`${u}-grid`,o,{[`${u}-grid-hoverable`]:a});return t.createElement("div",Object.assign({},s,{className:d}))};e.i(296059);var u=e.i(915654),d=e.i(183293),p=e.i(246422),m=e.i(838378);let g=(0,p.genStyleHooks)("Card",e=>{let t=(0,m.mergeToken)(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize});return[(e=>{let{componentCls:t,cardShadow:r,cardHeadPadding:n,colorBorderSecondary:i,boxShadowTertiary:o,bodyPadding:a,extraColor:s}=e;return{[t]:Object.assign(Object.assign({},(0,d.resetComponent)(e)),{position:"relative",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,[`&:not(${t}-bordered)`]:{boxShadow:o},[`${t}-head`]:(e=>{let{antCls:t,componentCls:r,headerHeight:n,headerPadding:i,tabsMarginBottom:o}=e;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:n,marginBottom:-1,padding:`0 ${(0,u.unit)(i)}`,color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:`${(0,u.unit)(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`,borderRadius:`${(0,u.unit)(e.borderRadiusLG)} ${(0,u.unit)(e.borderRadiusLG)} 0 0`},(0,d.clearFix)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},d.textEllipsis),{[` > ${r}-typography, > ${r}-typography-edit-content - `]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),[`${t}-tabs-top`]:{clear:"both",marginBottom:o,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,"&-bar":{borderBottom:`${(0,d.unit)(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`}}})})(e),[`${t}-extra`]:{marginInlineStart:"auto",color:s,fontWeight:"normal",fontSize:e.fontSize},[`${t}-body`]:{padding:a,borderRadius:`0 0 ${(0,d.unit)(e.borderRadiusLG)} ${(0,d.unit)(e.borderRadiusLG)}`},[`${t}-grid`]:(e=>{let{cardPaddingBase:t,colorBorderSecondary:r,cardShadow:n,lineWidth:i}=e;return{width:"33.33%",padding:t,border:0,borderRadius:0,boxShadow:` - ${(0,d.unit)(i)} 0 0 0 ${r}, - 0 ${(0,d.unit)(i)} 0 0 ${r}, - ${(0,d.unit)(i)} ${(0,d.unit)(i)} 0 0 ${r}, - ${(0,d.unit)(i)} 0 0 0 ${r} inset, - 0 ${(0,d.unit)(i)} 0 0 ${r} inset; - `,transition:`all ${e.motionDurationMid}`,"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:n}}})(e),[`${t}-cover`]:{"> *":{display:"block",width:"100%",borderRadius:`${(0,d.unit)(e.borderRadiusLG)} ${(0,d.unit)(e.borderRadiusLG)} 0 0`}},[`${t}-actions`]:(e=>{let{componentCls:t,iconCls:r,actionsLiMargin:n,cardActionsIconSize:i,colorBorderSecondary:o,actionsBg:a}=e;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:a,borderTop:`${(0,d.unit)(e.lineWidth)} ${e.lineType} ${o}`,display:"flex",borderRadius:`0 0 ${(0,d.unit)(e.borderRadiusLG)} ${(0,d.unit)(e.borderRadiusLG)}`},(0,u.clearFix)()),{"& > li":{margin:n,color:e.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:e.calc(e.cardActionsIconSize).mul(2).equal(),fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer","&:hover":{color:e.colorPrimary,transition:`color ${e.motionDurationMid}`},[`a:not(${t}-btn), > ${r}`]:{display:"inline-block",width:"100%",color:e.colorIcon,lineHeight:(0,d.unit)(e.fontHeight),transition:`color ${e.motionDurationMid}`,"&:hover":{color:e.colorPrimary}},[`> ${r}`]:{fontSize:i,lineHeight:(0,d.unit)(e.calc(i).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:`${(0,d.unit)(e.lineWidth)} ${e.lineType} ${o}`}}})})(e),[`${t}-meta`]:Object.assign(Object.assign({margin:`${(0,d.unit)(e.calc(e.marginXXS).mul(-1).equal())} 0`,display:"flex"},(0,u.clearFix)()),{"&-avatar":{paddingInlineEnd:e.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:e.marginXS}},"&-title":Object.assign({color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},u.textEllipsis),"&-description":{color:e.colorTextDescription}})}),[`${t}-bordered`]:{border:`${(0,d.unit)(e.lineWidth)} ${e.lineType} ${i}`,[`${t}-cover`]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},[`${t}-hoverable`]:{cursor:"pointer",transition:`box-shadow ${e.motionDurationMid}, border-color ${e.motionDurationMid}`,"&:hover":{borderColor:"transparent",boxShadow:r}},[`${t}-contain-grid`]:{borderRadius:`${(0,d.unit)(e.borderRadiusLG)} ${(0,d.unit)(e.borderRadiusLG)} 0 0 `,[`${t}-body`]:{display:"flex",flexWrap:"wrap"},[`&:not(${t}-loading) ${t}-body`]:{marginBlockStart:e.calc(e.lineWidth).mul(-1).equal(),marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),padding:0}},[`${t}-contain-tabs`]:{[`> div${t}-head`]:{minHeight:0,[`${t}-head-title, ${t}-extra`]:{paddingTop:n}}},[`${t}-type-inner`]:(e=>{let{componentCls:t,colorFillAlter:r,headerPadding:n,bodyPadding:i}=e;return{[`${t}-head`]:{padding:`0 ${(0,d.unit)(n)}`,background:r,"&-title":{fontSize:e.fontSize}},[`${t}-body`]:{padding:`${(0,d.unit)(e.padding)} ${(0,d.unit)(i)}`}}})(e),[`${t}-loading`]:(e=>{let{componentCls:t}=e;return{overflow:"hidden",[`${t}-body`]:{userSelect:"none"}}})(e),[`${t}-rtl`]:{direction:"rtl"}}})(t),(e=>{let{componentCls:t,bodyPaddingSM:r,headerPaddingSM:n,headerHeightSM:i,headerFontSizeSM:o}=e;return{[`${t}-small`]:{[`> ${t}-head`]:{minHeight:i,padding:`0 ${(0,d.unit)(n)}`,fontSize:o,[`> ${t}-head-wrapper`]:{[`> ${t}-extra`]:{fontSize:e.fontSize}}},[`> ${t}-body`]:{padding:r}},[`${t}-small${t}-contain-tabs`]:{[`> ${t}-head`]:{[`${t}-head-title, ${t}-extra`]:{paddingTop:0,display:"flex",alignItems:"center"}}}}})(t)]},e=>{var t,r;return{headerBg:"transparent",headerFontSize:e.fontSizeLG,headerFontSizeSM:e.fontSize,headerHeight:e.fontSizeLG*e.lineHeightLG+2*e.padding,headerHeightSM:e.fontSize*e.lineHeight+2*e.paddingXS,actionsBg:e.colorBgContainer,actionsLiMargin:`${e.paddingSM}px 0`,tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText,bodyPaddingSM:12,headerPaddingSM:12,bodyPadding:null!=(t=e.bodyPadding)?t:e.paddingLG,headerPadding:null!=(r=e.headerPadding)?r:e.paddingLG}});var h=e.i(792812),f=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);it.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};let b=e=>{let{actionClasses:r,actions:n=[],actionStyle:i}=e;return t.createElement("ul",{className:r,style:i},n.map((e,r)=>{let i=`action-${r}`;return t.createElement("li",{style:{width:`${100/n.length}%`},key:i},t.createElement("span",null,e))}))},y=t.forwardRef((e,l)=>{let d,{prefixCls:u,className:p,rootClassName:m,style:y,extra:v,headStyle:_={},bodyStyle:x={},title:k,loading:w,bordered:$,variant:O,size:S,type:j,cover:E,actions:C,tabList:M,children:I,activeTabKey:T,defaultActiveTabKey:z,tabBarExtraContent:N,hoverable:A,tabProps:P={},classNames:R,styles:L}=e,H=f(e,["prefixCls","className","rootClassName","style","extra","headStyle","bodyStyle","title","loading","bordered","variant","size","type","cover","actions","tabList","children","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","tabProps","classNames","styles"]),{getPrefixCls:D,direction:B,card:U}=t.useContext(i.ConfigContext),[F]=(0,h.default)("card",O,$),W=e=>{var t;return(0,r.default)(null==(t=null==U?void 0:U.classNames)?void 0:t[e],null==R?void 0:R[e])},V=e=>{var t;return Object.assign(Object.assign({},null==(t=null==U?void 0:U.styles)?void 0:t[e]),null==L?void 0:L[e])},G=t.useMemo(()=>{let e=!1;return t.Children.forEach(I,t=>{(null==t?void 0:t.type)===c&&(e=!0)}),e},[I]),q=D("card",u),[Y,K,J]=g(q),X=t.createElement(a.default,{loading:!0,active:!0,paragraph:{rows:4},title:!1},I),Q=void 0!==T,Z=Object.assign(Object.assign({},P),{[Q?"activeKey":"defaultActiveKey"]:Q?T:z,tabBarExtraContent:N}),ee=(0,o.default)(S),et=ee&&"default"!==ee?ee:"large",er=M?t.createElement(s.default,Object.assign({size:et},Z,{className:`${q}-head-tabs`,onChange:t=>{var r;null==(r=e.onTabChange)||r.call(e,t)},items:M.map(e=>{var{tab:t}=e;return Object.assign({label:t},f(e,["tab"]))})})):null;if(k||v||er){let e=(0,r.default)(`${q}-head`,W("header")),n=(0,r.default)(`${q}-head-title`,W("title")),i=(0,r.default)(`${q}-extra`,W("extra")),o=Object.assign(Object.assign({},_),V("header"));d=t.createElement("div",{className:e,style:o},t.createElement("div",{className:`${q}-head-wrapper`},k&&t.createElement("div",{className:n,style:V("title")},k),v&&t.createElement("div",{className:i,style:V("extra")},v)),er)}let en=(0,r.default)(`${q}-cover`,W("cover")),ei=E?t.createElement("div",{className:en,style:V("cover")},E):null,eo=(0,r.default)(`${q}-body`,W("body")),ea=Object.assign(Object.assign({},x),V("body")),es=t.createElement("div",{className:eo,style:ea},w?X:I),el=(0,r.default)(`${q}-actions`,W("actions")),ec=(null==C?void 0:C.length)?t.createElement(b,{actionClasses:el,actionStyle:V("actions"),actions:C}):null,ed=(0,n.default)(H,["onTabChange"]),eu=(0,r.default)(q,null==U?void 0:U.className,{[`${q}-loading`]:w,[`${q}-bordered`]:"borderless"!==F,[`${q}-hoverable`]:A,[`${q}-contain-grid`]:G,[`${q}-contain-tabs`]:null==M?void 0:M.length,[`${q}-${ee}`]:ee,[`${q}-type-${j}`]:!!j,[`${q}-rtl`]:"rtl"===B},p,m,K,J),ep=Object.assign(Object.assign({},null==U?void 0:U.style),y);return Y(t.createElement("div",Object.assign({ref:l},ed,{className:eu,style:ep}),d,ei,es,ec))});var v=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);it.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};y.Grid=c,y.Meta=e=>{let{prefixCls:n,className:o,avatar:a,title:s,description:l}=e,c=v(e,["prefixCls","className","avatar","title","description"]),{getPrefixCls:d}=t.useContext(i.ConfigContext),u=d("card",n),p=(0,r.default)(`${u}-meta`,o),m=a?t.createElement("div",{className:`${u}-meta-avatar`},a):null,g=s?t.createElement("div",{className:`${u}-meta-title`},s):null,h=l?t.createElement("div",{className:`${u}-meta-description`},l):null,f=g||h?t.createElement("div",{className:`${u}-meta-detail`},g,h):null;return t.createElement("div",Object.assign({},c,{className:p}),m,f)},e.s(["Card",0,y],175712)},954616,e=>{"use strict";var t=e.i(271645),r=e.i(114272),n=e.i(540143),i=e.i(915823),o=e.i(619273),a=class extends i.Subscribable{#e;#t=void 0;#r;#n;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,o.shallowEqualObjects)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,o.hashKey)(t.mutationKey)!==(0,o.hashKey)(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#o(e)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#i(),this.#o()}mutate(e,t){return this.#n=t,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(e)}#i(){let e=this.#r?.state??(0,r.getDefaultState)();this.#t={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#o(e){n.notifyManager.batch(()=>{if(this.#n&&this.hasListeners()){let t=this.#t.variables,r=this.#t.context,n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#n.onSuccess?.(e.data,t,r,n)}catch(e){Promise.reject(e)}try{this.#n.onSettled?.(e.data,null,t,r,n)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#n.onError?.(e.error,t,r,n)}catch(e){Promise.reject(e)}try{this.#n.onSettled?.(void 0,e.error,t,r,n)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},s=e.i(912598);function l(e,r){let i=(0,s.useQueryClient)(r),[l]=t.useState(()=>new a(i,e));t.useEffect(()=>{l.setOptions(e)},[l,e]);let c=t.useSyncExternalStore(t.useCallback(e=>l.subscribe(n.notifyManager.batchCalls(e)),[l]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),d=t.useCallback((e,t)=>{l.mutate(e,t).catch(o.noop)},[l]);if(c.error&&(0,o.shouldThrowError)(l.options.throwOnError,[c.error]))throw c.error;return{...c,mutate:d,mutateAsync:c.mutate}}e.s(["useMutation",()=>l],954616)},566606,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(618566),i=e.i(947293),o=e.i(602869),a=e.i(954616),s=e.i(266027),l=e.i(612256);let c=(0,e.i(243652).createQueryKeys)("onboarding");var d=e.i(268004),u=e.i(482725),p=e.i(56456);function m(){return(0,t.jsx)("div",{className:"mx-auto w-full max-w-md mt-10 flex justify-center",children:(0,t.jsx)(u.Spin,{indicator:(0,t.jsx)(p.LoadingOutlined,{spin:!0}),size:"large"})})}var g=e.i(560445),h=e.i(464571);function f(){return(0,t.jsxs)("div",{className:"mx-auto w-full max-w-md mt-10",children:[(0,t.jsx)(g.Alert,{type:"error",message:"Failed to load invitation",description:"The invitation link may be invalid or expired.",showIcon:!0}),(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(h.Button,{href:"/ui/login",children:"Back to Login"})})]})}var b=e.i(175712),y=e.i(808613),v=e.i(311451),_=e.i(898586);function x({variant:e,userEmail:n,isPending:i,claimError:o,onSubmit:a}){let[s]=y.Form.useForm();return r.default.useEffect(()=>{n&&s.setFieldValue("user_email",n)},[n,s]),(0,t.jsx)("div",{className:"mx-auto w-full max-w-md mt-10",children:(0,t.jsxs)(b.Card,{children:[(0,t.jsx)(_.Typography.Title,{level:5,className:"text-center mb-5",children:"🚅 LiteLLM"}),(0,t.jsx)(_.Typography.Title,{level:3,children:"reset_password"===e?"Reset Password":"Sign Up"}),(0,t.jsx)(_.Typography.Text,{children:"reset_password"===e?"Reset your password to access Admin UI.":"Claim your user account to login to Admin UI."}),"signup"===e&&(0,t.jsx)(g.Alert,{className:"mt-4",type:"info",message:"SSO",description:(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)("span",{children:"SSO is under the Enterprise Tier."}),(0,t.jsx)(h.Button,{type:"primary",size:"small",href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})]}),showIcon:!0}),(0,t.jsxs)(y.Form,{className:"mt-10 mb-5",layout:"vertical",form:s,onFinish:e=>a({password:e.password}),children:[(0,t.jsx)(y.Form.Item,{label:"Email Address",name:"user_email",children:(0,t.jsx)(v.Input,{type:"email",disabled:!0})}),(0,t.jsx)(y.Form.Item,{label:"Password",name:"password",rules:[{required:!0,message:"password required to sign up"}],help:"reset_password"===e?"Enter your new password":"Create a password for your account",children:(0,t.jsx)(v.Input.Password,{})}),o&&(0,t.jsx)(g.Alert,{type:"error",message:o,showIcon:!0,className:"mb-4"}),(0,t.jsx)("div",{className:"mt-10",children:(0,t.jsx)(h.Button,{htmlType:"submit",loading:i,children:"reset_password"===e?"Reset Password":"Sign Up"})})]})]})})}function k({variant:e}){let u=(0,n.useSearchParams)().get("invitation_id"),[p,g]=r.default.useState(null),{data:h,isLoading:b,isError:y}=(e=>{let{isLoading:t}=(0,l.useUIConfig)();return(0,s.useQuery)({queryKey:c.detail(e??""),queryFn:async()=>{if(!e)throw Error("inviteId is required");return(0,o.getOnboardingCredentials)(e)},enabled:!!e&&!t})})(u),{mutate:v,isPending:_}=(0,a.useMutation)({mutationFn:async({accessToken:e,inviteId:t,userId:r,password:n})=>await (0,o.claimOnboardingToken)(e,t,r,n)}),k=h?.token?(0,i.jwtDecode)(h.token):null,w=k?.user_email??"",$=k?.user_id??null,O=k?.key??null;return b?(0,t.jsx)(m,{}):y?(0,t.jsx)(f,{}):(0,t.jsx)(x,{variant:e,userEmail:w,isPending:_,claimError:p,onSubmit:e=>{O&&$&&u&&(g(null),v({accessToken:O,inviteId:u,userId:$,password:e.password},{onSuccess:e=>{if(!e?.token)return void g("Failed to start session. Please try again.");(0,d.clearTokenCookies)(),(0,d.storeLoginToken)(e.token);let t=(0,o.getProxyBaseUrl)();window.location.href=t?`${t}/ui/?login=success`:"/ui/?login=success"},onError:e=>{g(e.message||"Failed to submit. Please try again.")}}))}})}function w(){let e=(0,n.useSearchParams)().get("action");return(0,t.jsx)(k,{variant:"reset_password"===e?"reset_password":"signup"})}function $(){return(0,t.jsx)(r.Suspense,{fallback:(0,t.jsx)("div",{className:"flex items-center justify-center min-h-screen",children:"Loading..."}),children:(0,t.jsx)(w,{})})}e.s(["default",()=>$],566606)},936578,571303,e=>{"use strict";var t=e.i(843476),r=e.i(115504),n=e.i(271645);function i({className:e="",...i}){var o,a;let s=(0,n.useId)();return o=()=>{let e=document.getAnimations().filter(e=>e instanceof CSSAnimation&&"spin"===e.animationName),t=e.find(e=>e.effect.target?.getAttribute("data-spinner-id")===s),r=e.find(e=>e.effect instanceof KeyframeEffect&&e.effect.target?.getAttribute("data-spinner-id")!==s);t&&r&&(t.currentTime=r.currentTime)},a=[s],(0,n.useLayoutEffect)(o,a),(0,t.jsxs)("svg",{"data-spinner-id":s,className:(0,r.cx)("pointer-events-none size-12 animate-spin text-current",e),fill:"none",viewBox:"0 0 24 24",...i,children:[(0,t.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,t.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}function o(){return(0,t.jsxs)("div",{className:(0,r.cx)("h-screen","flex items-center justify-center gap-4"),children:[(0,t.jsx)("div",{className:"text-lg font-medium py-2 pr-4 border-r border-r-gray-200",children:"🚅 LiteLLM"}),(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,t.jsx)(i,{className:"size-4"}),(0,t.jsx)("span",{className:"text-gray-600 text-sm",children:"Loading..."})]})]})}e.s(["UiLoadingSpinner",()=>i],571303),e.s(["default",()=>o],936578)},673709,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(678784);let i=(0,e.i(475254).default)("clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]);var o=e.i(650056);let a={'code[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"]::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},prolog:{color:"hsl(230, 4%, 64%)"},cdata:{color:"hsl(230, 4%, 64%)"},doctype:{color:"hsl(230, 8%, 24%)"},punctuation:{color:"hsl(230, 8%, 24%)"},entity:{color:"hsl(230, 8%, 24%)",cursor:"help"},"attr-name":{color:"hsl(35, 99%, 36%)"},"class-name":{color:"hsl(35, 99%, 36%)"},boolean:{color:"hsl(35, 99%, 36%)"},constant:{color:"hsl(35, 99%, 36%)"},number:{color:"hsl(35, 99%, 36%)"},atrule:{color:"hsl(35, 99%, 36%)"},keyword:{color:"hsl(301, 63%, 40%)"},property:{color:"hsl(5, 74%, 59%)"},tag:{color:"hsl(5, 74%, 59%)"},symbol:{color:"hsl(5, 74%, 59%)"},deleted:{color:"hsl(5, 74%, 59%)"},important:{color:"hsl(5, 74%, 59%)"},selector:{color:"hsl(119, 34%, 47%)"},string:{color:"hsl(119, 34%, 47%)"},char:{color:"hsl(119, 34%, 47%)"},builtin:{color:"hsl(119, 34%, 47%)"},inserted:{color:"hsl(119, 34%, 47%)"},regex:{color:"hsl(119, 34%, 47%)"},"attr-value":{color:"hsl(119, 34%, 47%)"},"attr-value > .token.punctuation":{color:"hsl(119, 34%, 47%)"},variable:{color:"hsl(221, 87%, 60%)"},operator:{color:"hsl(221, 87%, 60%)"},function:{color:"hsl(221, 87%, 60%)"},url:{color:"hsl(198, 99%, 37%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(230, 8%, 24%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(230, 8%, 24%)"},".language-css .token.selector":{color:"hsl(5, 74%, 59%)"},".language-css .token.property":{color:"hsl(230, 8%, 24%)"},".language-css .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.string.url":{color:"hsl(119, 34%, 47%)"},".language-css .token.important":{color:"hsl(301, 63%, 40%)"},".language-css .token.atrule .token.rule":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.operator":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(344, 84%, 43%)"},".language-json .token.operator":{color:"hsl(230, 8%, 24%)"},".language-json .token.null.keyword":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.url":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.operator":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.content":{color:"hsl(221, 87%, 60%)"},".language-markdown .token.url > .token.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.url-reference.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(119, 34%, 47%)"},".language-markdown .token.bold .token.content":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.italic .token.content":{color:"hsl(301, 63%, 40%)"},".language-markdown .token.strike .token.content":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.list.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(5, 74%, 59%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.cr:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.lf:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.space:before":{color:"hsla(230, 8%, 24%, 0.2)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},".line-highlight.line-highlight":{background:"hsla(230, 8%, 24%, 0.05)"},".line-highlight.line-highlight:before":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(230, 8%, 24%, 0.05)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".command-line .command-line-prompt":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(230, 1%, 62%)"},".command-line .command-line-prompt > span:before":{color:"hsl(230, 1%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(301, 63%, 40%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(0, 0, 95%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(0, 0, 95%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(0, 0, 95%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(0, 0, 95%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(0, 0%, 100%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(230, 8%, 24%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(230, 8%, 24%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(230, 8%, 24%)"}};e.s(["default",0,({code:e,language:s})=>{let[l,c]=(0,r.useState)(!1);return(0,t.jsxs)("div",{className:"relative rounded-lg border border-gray-200 overflow-hidden",children:[(0,t.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(e),c(!0),setTimeout(()=>c(!1),2e3)},className:"absolute top-3 right-3 p-2 rounded-md bg-gray-100 hover:bg-gray-200 text-gray-600 z-10","aria-label":"Copy code",children:l?(0,t.jsx)(n.CheckIcon,{size:16}):(0,t.jsx)(i,{size:16})}),(0,t.jsx)(o.Prism,{language:s,style:a,customStyle:{margin:0,padding:"1.5rem",borderRadius:"0.5rem",fontSize:"0.9rem",backgroundColor:"#fafafa"},showLineNumbers:!0,children:e})]})}],673709)},794357,546467,778917,592392,e=>{"use strict";var t=e.i(843476),r=e.i(599724),n=e.i(197647),i=e.i(653824),o=e.i(881073),a=e.i(404206),s=e.i(723731),l=e.i(350967),c=e.i(673709);let d=(0,e.i(475254).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["default",()=>d],546467),e.s(["ExternalLink",()=>d],778917);let u=({href:e,className:r})=>(0,t.jsxs)("a",{href:e,target:"_blank",rel:"noopener noreferrer",title:"Open documentation in a new tab",className:function(...e){return e.filter(Boolean).join(" ")}("inline-flex items-center gap-2 rounded-xl border border-zinc-200 bg-white/80 px-3.5 py-2 text-sm font-medium text-zinc-700 shadow-sm","hover:bg-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 active:translate-y-[0.5px]",r),children:[(0,t.jsx)("span",{children:"API Reference Docs"}),(0,t.jsx)(d,{"aria-hidden":!0,className:"h-4 w-4 opacity-80"}),(0,t.jsx)("span",{className:"sr-only",children:"(opens in a new tab)"})]});e.s(["default",0,({proxySettings:e})=>{let d="",p=e?.LITELLM_UI_API_DOC_BASE_URL;return p&&p.trim()?d=p:e?.PROXY_BASE_URL&&(d=e.PROXY_BASE_URL),(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(l.Grid,{className:"gap-2 p-8 h-[80vh] w-full mt-2",children:(0,t.jsxs)("div",{className:"mb-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:"OpenAI Compatible Proxy: API Reference"}),(0,t.jsx)(u,{className:"ml-3 shrink-0",href:"https://docs.litellm.ai/docs/proxy/user_keys"})]}),(0,t.jsxs)(r.Text,{className:"mt-2 mb-2",children:["LiteLLM is OpenAI Compatible. This means your API Key works with the OpenAI SDK. Just replace the base_url to point to your litellm proxy. Example Below"," "]}),(0,t.jsxs)(i.TabGroup,{children:[(0,t.jsxs)(o.TabList,{children:[(0,t.jsx)(n.Tab,{children:"OpenAI Python SDK"}),(0,t.jsx)(n.Tab,{children:"LlamaIndex"}),(0,t.jsx)(n.Tab,{children:"Langchain Py"})]}),(0,t.jsxs)(s.TabPanels,{children:[(0,t.jsx)(a.TabPanel,{children:(0,t.jsx)(c.default,{language:"python",code:`import openai + `]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),[`${t}-tabs-top`]:{clear:"both",marginBottom:o,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,"&-bar":{borderBottom:`${(0,u.unit)(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`}}})})(e),[`${t}-extra`]:{marginInlineStart:"auto",color:s,fontWeight:"normal",fontSize:e.fontSize},[`${t}-body`]:{padding:a,borderRadius:`0 0 ${(0,u.unit)(e.borderRadiusLG)} ${(0,u.unit)(e.borderRadiusLG)}`},[`${t}-grid`]:(e=>{let{cardPaddingBase:t,colorBorderSecondary:r,cardShadow:n,lineWidth:i}=e;return{width:"33.33%",padding:t,border:0,borderRadius:0,boxShadow:` + ${(0,u.unit)(i)} 0 0 0 ${r}, + 0 ${(0,u.unit)(i)} 0 0 ${r}, + ${(0,u.unit)(i)} ${(0,u.unit)(i)} 0 0 ${r}, + ${(0,u.unit)(i)} 0 0 0 ${r} inset, + 0 ${(0,u.unit)(i)} 0 0 ${r} inset; + `,transition:`all ${e.motionDurationMid}`,"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:n}}})(e),[`${t}-cover`]:{"> *":{display:"block",width:"100%",borderRadius:`${(0,u.unit)(e.borderRadiusLG)} ${(0,u.unit)(e.borderRadiusLG)} 0 0`}},[`${t}-actions`]:(e=>{let{componentCls:t,iconCls:r,actionsLiMargin:n,cardActionsIconSize:i,colorBorderSecondary:o,actionsBg:a}=e;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:a,borderTop:`${(0,u.unit)(e.lineWidth)} ${e.lineType} ${o}`,display:"flex",borderRadius:`0 0 ${(0,u.unit)(e.borderRadiusLG)} ${(0,u.unit)(e.borderRadiusLG)}`},(0,d.clearFix)()),{"& > li":{margin:n,color:e.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:e.calc(e.cardActionsIconSize).mul(2).equal(),fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer","&:hover":{color:e.colorPrimary,transition:`color ${e.motionDurationMid}`},[`a:not(${t}-btn), > ${r}`]:{display:"inline-block",width:"100%",color:e.colorIcon,lineHeight:(0,u.unit)(e.fontHeight),transition:`color ${e.motionDurationMid}`,"&:hover":{color:e.colorPrimary}},[`> ${r}`]:{fontSize:i,lineHeight:(0,u.unit)(e.calc(i).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:`${(0,u.unit)(e.lineWidth)} ${e.lineType} ${o}`}}})})(e),[`${t}-meta`]:Object.assign(Object.assign({margin:`${(0,u.unit)(e.calc(e.marginXXS).mul(-1).equal())} 0`,display:"flex"},(0,d.clearFix)()),{"&-avatar":{paddingInlineEnd:e.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:e.marginXS}},"&-title":Object.assign({color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},d.textEllipsis),"&-description":{color:e.colorTextDescription}})}),[`${t}-bordered`]:{border:`${(0,u.unit)(e.lineWidth)} ${e.lineType} ${i}`,[`${t}-cover`]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},[`${t}-hoverable`]:{cursor:"pointer",transition:`box-shadow ${e.motionDurationMid}, border-color ${e.motionDurationMid}`,"&:hover":{borderColor:"transparent",boxShadow:r}},[`${t}-contain-grid`]:{borderRadius:`${(0,u.unit)(e.borderRadiusLG)} ${(0,u.unit)(e.borderRadiusLG)} 0 0 `,[`${t}-body`]:{display:"flex",flexWrap:"wrap"},[`&:not(${t}-loading) ${t}-body`]:{marginBlockStart:e.calc(e.lineWidth).mul(-1).equal(),marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),padding:0}},[`${t}-contain-tabs`]:{[`> div${t}-head`]:{minHeight:0,[`${t}-head-title, ${t}-extra`]:{paddingTop:n}}},[`${t}-type-inner`]:(e=>{let{componentCls:t,colorFillAlter:r,headerPadding:n,bodyPadding:i}=e;return{[`${t}-head`]:{padding:`0 ${(0,u.unit)(n)}`,background:r,"&-title":{fontSize:e.fontSize}},[`${t}-body`]:{padding:`${(0,u.unit)(e.padding)} ${(0,u.unit)(i)}`}}})(e),[`${t}-loading`]:(e=>{let{componentCls:t}=e;return{overflow:"hidden",[`${t}-body`]:{userSelect:"none"}}})(e),[`${t}-rtl`]:{direction:"rtl"}}})(t),(e=>{let{componentCls:t,bodyPaddingSM:r,headerPaddingSM:n,headerHeightSM:i,headerFontSizeSM:o}=e;return{[`${t}-small`]:{[`> ${t}-head`]:{minHeight:i,padding:`0 ${(0,u.unit)(n)}`,fontSize:o,[`> ${t}-head-wrapper`]:{[`> ${t}-extra`]:{fontSize:e.fontSize}}},[`> ${t}-body`]:{padding:r}},[`${t}-small${t}-contain-tabs`]:{[`> ${t}-head`]:{[`${t}-head-title, ${t}-extra`]:{paddingTop:0,display:"flex",alignItems:"center"}}}}})(t)]},e=>{var t,r;return{headerBg:"transparent",headerFontSize:e.fontSizeLG,headerFontSizeSM:e.fontSize,headerHeight:e.fontSizeLG*e.lineHeightLG+2*e.padding,headerHeightSM:e.fontSize*e.lineHeight+2*e.paddingXS,actionsBg:e.colorBgContainer,actionsLiMargin:`${e.paddingSM}px 0`,tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText,bodyPaddingSM:12,headerPaddingSM:12,bodyPadding:null!=(t=e.bodyPadding)?t:e.paddingLG,headerPadding:null!=(r=e.headerPadding)?r:e.paddingLG}});var h=e.i(792812),f=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);it.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};let b=e=>{let{actionClasses:r,actions:n=[],actionStyle:i}=e;return t.createElement("ul",{className:r,style:i},n.map((e,r)=>{let i=`action-${r}`;return t.createElement("li",{style:{width:`${100/n.length}%`},key:i},t.createElement("span",null,e))}))},y=t.forwardRef((e,l)=>{let u,{prefixCls:d,className:p,rootClassName:m,style:y,extra:v,headStyle:_={},bodyStyle:x={},title:w,loading:k,bordered:$,variant:O,size:S,type:j,cover:E,actions:C,tabList:I,children:M,activeTabKey:T,defaultActiveTabKey:z,tabBarExtraContent:A,hoverable:N,tabProps:P={},classNames:R,styles:L}=e,H=f(e,["prefixCls","className","rootClassName","style","extra","headStyle","bodyStyle","title","loading","bordered","variant","size","type","cover","actions","tabList","children","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","tabProps","classNames","styles"]),{getPrefixCls:D,direction:U,card:B}=t.useContext(i.ConfigContext),[F]=(0,h.default)("card",O,$),V=e=>{var t;return(0,r.default)(null==(t=null==B?void 0:B.classNames)?void 0:t[e],null==R?void 0:R[e])},W=e=>{var t;return Object.assign(Object.assign({},null==(t=null==B?void 0:B.styles)?void 0:t[e]),null==L?void 0:L[e])},G=t.useMemo(()=>{let e=!1;return t.Children.forEach(M,t=>{(null==t?void 0:t.type)===c&&(e=!0)}),e},[M]),q=D("card",d),[Y,K,J]=g(q),X=t.createElement(a.default,{loading:!0,active:!0,paragraph:{rows:4},title:!1},M),Q=void 0!==T,Z=Object.assign(Object.assign({},P),{[Q?"activeKey":"defaultActiveKey"]:Q?T:z,tabBarExtraContent:A}),ee=(0,o.default)(S),et=ee&&"default"!==ee?ee:"large",er=I?t.createElement(s.default,Object.assign({size:et},Z,{className:`${q}-head-tabs`,onChange:t=>{var r;null==(r=e.onTabChange)||r.call(e,t)},items:I.map(e=>{var{tab:t}=e;return Object.assign({label:t},f(e,["tab"]))})})):null;if(w||v||er){let e=(0,r.default)(`${q}-head`,V("header")),n=(0,r.default)(`${q}-head-title`,V("title")),i=(0,r.default)(`${q}-extra`,V("extra")),o=Object.assign(Object.assign({},_),W("header"));u=t.createElement("div",{className:e,style:o},t.createElement("div",{className:`${q}-head-wrapper`},w&&t.createElement("div",{className:n,style:W("title")},w),v&&t.createElement("div",{className:i,style:W("extra")},v)),er)}let en=(0,r.default)(`${q}-cover`,V("cover")),ei=E?t.createElement("div",{className:en,style:W("cover")},E):null,eo=(0,r.default)(`${q}-body`,V("body")),ea=Object.assign(Object.assign({},x),W("body")),es=t.createElement("div",{className:eo,style:ea},k?X:M),el=(0,r.default)(`${q}-actions`,V("actions")),ec=(null==C?void 0:C.length)?t.createElement(b,{actionClasses:el,actionStyle:W("actions"),actions:C}):null,eu=(0,n.default)(H,["onTabChange"]),ed=(0,r.default)(q,null==B?void 0:B.className,{[`${q}-loading`]:k,[`${q}-bordered`]:"borderless"!==F,[`${q}-hoverable`]:N,[`${q}-contain-grid`]:G,[`${q}-contain-tabs`]:null==I?void 0:I.length,[`${q}-${ee}`]:ee,[`${q}-type-${j}`]:!!j,[`${q}-rtl`]:"rtl"===U},p,m,K,J),ep=Object.assign(Object.assign({},null==B?void 0:B.style),y);return Y(t.createElement("div",Object.assign({ref:l},eu,{className:ed,style:ep}),u,ei,es,ec))});var v=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);it.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};y.Grid=c,y.Meta=e=>{let{prefixCls:n,className:o,avatar:a,title:s,description:l}=e,c=v(e,["prefixCls","className","avatar","title","description"]),{getPrefixCls:u}=t.useContext(i.ConfigContext),d=u("card",n),p=(0,r.default)(`${d}-meta`,o),m=a?t.createElement("div",{className:`${d}-meta-avatar`},a):null,g=s?t.createElement("div",{className:`${d}-meta-title`},s):null,h=l?t.createElement("div",{className:`${d}-meta-description`},l):null,f=g||h?t.createElement("div",{className:`${d}-meta-detail`},g,h):null;return t.createElement("div",Object.assign({},c,{className:p}),m,f)},e.s(["Card",0,y],175712)},954616,e=>{"use strict";var t=e.i(271645),r=e.i(114272),n=e.i(540143),i=e.i(915823),o=e.i(619273),a=class extends i.Subscribable{#e;#t=void 0;#r;#n;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,o.shallowEqualObjects)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,o.hashKey)(t.mutationKey)!==(0,o.hashKey)(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#o(e)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#i(),this.#o()}mutate(e,t){return this.#n=t,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(e)}#i(){let e=this.#r?.state??(0,r.getDefaultState)();this.#t={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#o(e){n.notifyManager.batch(()=>{if(this.#n&&this.hasListeners()){let t=this.#t.variables,r=this.#t.context,n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#n.onSuccess?.(e.data,t,r,n)}catch(e){Promise.reject(e)}try{this.#n.onSettled?.(e.data,null,t,r,n)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#n.onError?.(e.error,t,r,n)}catch(e){Promise.reject(e)}try{this.#n.onSettled?.(void 0,e.error,t,r,n)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},s=e.i(912598);function l(e,r){let i=(0,s.useQueryClient)(r),[l]=t.useState(()=>new a(i,e));t.useEffect(()=>{l.setOptions(e)},[l,e]);let c=t.useSyncExternalStore(t.useCallback(e=>l.subscribe(n.notifyManager.batchCalls(e)),[l]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),u=t.useCallback((e,t)=>{l.mutate(e,t).catch(o.noop)},[l]);if(c.error&&(0,o.shouldThrowError)(l.options.throwOnError,[c.error]))throw c.error;return{...c,mutate:u,mutateAsync:c.mutate}}e.s(["useMutation",()=>l],954616)},566606,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(618566),i=e.i(947293),o=e.i(602869),a=e.i(954616),s=e.i(266027),l=e.i(612256);let c=(0,e.i(243652).createQueryKeys)("onboarding");var u=e.i(268004),d=e.i(482725),p=e.i(56456);function m(){return(0,t.jsx)("div",{className:"mx-auto w-full max-w-md mt-10 flex justify-center",children:(0,t.jsx)(d.Spin,{indicator:(0,t.jsx)(p.LoadingOutlined,{spin:!0}),size:"large"})})}var g=e.i(560445),h=e.i(464571);function f(){return(0,t.jsxs)("div",{className:"mx-auto w-full max-w-md mt-10",children:[(0,t.jsx)(g.Alert,{type:"error",message:"Failed to load invitation",description:"The invitation link may be invalid or expired.",showIcon:!0}),(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(h.Button,{href:"/ui/login",children:"Back to Login"})})]})}var b=e.i(175712),y=e.i(808613),v=e.i(311451),_=e.i(898586);function x({variant:e,userEmail:n,isPending:i,claimError:o,onSubmit:a}){let[s]=y.Form.useForm();return r.default.useEffect(()=>{n&&s.setFieldValue("user_email",n)},[n,s]),(0,t.jsx)("div",{className:"mx-auto w-full max-w-md mt-10",children:(0,t.jsxs)(b.Card,{children:[(0,t.jsx)(_.Typography.Title,{level:5,className:"text-center mb-5",children:"🚅 LiteLLM"}),(0,t.jsx)(_.Typography.Title,{level:3,children:"reset_password"===e?"Reset Password":"Sign Up"}),(0,t.jsx)(_.Typography.Text,{children:"reset_password"===e?"Reset your password to access Admin UI.":"Claim your user account to login to Admin UI."}),"signup"===e&&(0,t.jsx)(g.Alert,{className:"mt-4",type:"info",message:"SSO",description:(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)("span",{children:"SSO is under the Enterprise Tier."}),(0,t.jsx)(h.Button,{type:"primary",size:"small",href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})]}),showIcon:!0}),(0,t.jsxs)(y.Form,{className:"mt-10 mb-5",layout:"vertical",form:s,onFinish:e=>a({password:e.password}),children:[(0,t.jsx)(y.Form.Item,{label:"Email Address",name:"user_email",children:(0,t.jsx)(v.Input,{type:"email",disabled:!0})}),(0,t.jsx)(y.Form.Item,{label:"Password",name:"password",rules:[{required:!0,message:"password required to sign up"}],help:"reset_password"===e?"Enter your new password":"Create a password for your account",children:(0,t.jsx)(v.Input.Password,{})}),o&&(0,t.jsx)(g.Alert,{type:"error",message:o,showIcon:!0,className:"mb-4"}),(0,t.jsx)("div",{className:"mt-10",children:(0,t.jsx)(h.Button,{htmlType:"submit",loading:i,children:"reset_password"===e?"Reset Password":"Sign Up"})})]})]})})}function w({variant:e}){let d=(0,n.useSearchParams)().get("invitation_id"),[p,g]=r.default.useState(null),{data:h,isLoading:b,isError:y}=(e=>{let{isLoading:t}=(0,l.useUIConfig)();return(0,s.useQuery)({queryKey:c.detail(e??""),queryFn:async()=>{if(!e)throw Error("inviteId is required");return(0,o.getOnboardingCredentials)(e)},enabled:!!e&&!t})})(d),{mutate:v,isPending:_}=(0,a.useMutation)({mutationFn:async({accessToken:e,inviteId:t,userId:r,password:n})=>await (0,o.claimOnboardingToken)(e,t,r,n)}),w=h?.token?(0,i.jwtDecode)(h.token):null,k=w?.user_email??"",$=w?.user_id??null,O=w?.key??null;return b?(0,t.jsx)(m,{}):y?(0,t.jsx)(f,{}):(0,t.jsx)(x,{variant:e,userEmail:k,isPending:_,claimError:p,onSubmit:e=>{O&&$&&d&&(g(null),v({accessToken:O,inviteId:d,userId:$,password:e.password},{onSuccess:e=>{if(!e?.token)return void g("Failed to start session. Please try again.");(0,u.clearTokenCookies)(),(0,u.storeLoginToken)(e.token);let t=(0,o.getProxyBaseUrl)();window.location.href=t?`${t}/ui/?login=success`:"/ui/?login=success"},onError:e=>{g(e.message||"Failed to submit. Please try again.")}}))}})}function k(){let e=(0,n.useSearchParams)().get("action");return(0,t.jsx)(w,{variant:"reset_password"===e?"reset_password":"signup"})}function $(){return(0,t.jsx)(r.Suspense,{fallback:(0,t.jsx)("div",{className:"flex items-center justify-center min-h-screen",children:"Loading..."}),children:(0,t.jsx)(k,{})})}e.s(["default",()=>$],566606)},936578,571303,e=>{"use strict";var t=e.i(843476),r=e.i(115504),n=e.i(271645);function i({className:e="",...i}){var o,a;let s=(0,n.useId)();return o=()=>{let e=document.getAnimations().filter(e=>e instanceof CSSAnimation&&"spin"===e.animationName),t=e.find(e=>e.effect.target?.getAttribute("data-spinner-id")===s),r=e.find(e=>e.effect instanceof KeyframeEffect&&e.effect.target?.getAttribute("data-spinner-id")!==s);t&&r&&(t.currentTime=r.currentTime)},a=[s],(0,n.useLayoutEffect)(o,a),(0,t.jsxs)("svg",{"data-spinner-id":s,className:(0,r.cx)("pointer-events-none size-12 animate-spin text-current",e),fill:"none",viewBox:"0 0 24 24",...i,children:[(0,t.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,t.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}function o(){return(0,t.jsxs)("div",{className:(0,r.cx)("h-screen","flex items-center justify-center gap-4"),children:[(0,t.jsx)("div",{className:"text-lg font-medium py-2 pr-4 border-r border-r-gray-200",children:"🚅 LiteLLM"}),(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,t.jsx)(i,{className:"size-4"}),(0,t.jsx)("span",{className:"text-gray-600 text-sm",children:"Loading..."})]})]})}e.s(["UiLoadingSpinner",()=>i],571303),e.s(["default",()=>o],936578)},673709,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(678784);let i=(0,e.i(475254).default)("clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]);var o=e.i(650056);let a={'code[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"]::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},prolog:{color:"hsl(230, 4%, 64%)"},cdata:{color:"hsl(230, 4%, 64%)"},doctype:{color:"hsl(230, 8%, 24%)"},punctuation:{color:"hsl(230, 8%, 24%)"},entity:{color:"hsl(230, 8%, 24%)",cursor:"help"},"attr-name":{color:"hsl(35, 99%, 36%)"},"class-name":{color:"hsl(35, 99%, 36%)"},boolean:{color:"hsl(35, 99%, 36%)"},constant:{color:"hsl(35, 99%, 36%)"},number:{color:"hsl(35, 99%, 36%)"},atrule:{color:"hsl(35, 99%, 36%)"},keyword:{color:"hsl(301, 63%, 40%)"},property:{color:"hsl(5, 74%, 59%)"},tag:{color:"hsl(5, 74%, 59%)"},symbol:{color:"hsl(5, 74%, 59%)"},deleted:{color:"hsl(5, 74%, 59%)"},important:{color:"hsl(5, 74%, 59%)"},selector:{color:"hsl(119, 34%, 47%)"},string:{color:"hsl(119, 34%, 47%)"},char:{color:"hsl(119, 34%, 47%)"},builtin:{color:"hsl(119, 34%, 47%)"},inserted:{color:"hsl(119, 34%, 47%)"},regex:{color:"hsl(119, 34%, 47%)"},"attr-value":{color:"hsl(119, 34%, 47%)"},"attr-value > .token.punctuation":{color:"hsl(119, 34%, 47%)"},variable:{color:"hsl(221, 87%, 60%)"},operator:{color:"hsl(221, 87%, 60%)"},function:{color:"hsl(221, 87%, 60%)"},url:{color:"hsl(198, 99%, 37%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(230, 8%, 24%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(230, 8%, 24%)"},".language-css .token.selector":{color:"hsl(5, 74%, 59%)"},".language-css .token.property":{color:"hsl(230, 8%, 24%)"},".language-css .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.string.url":{color:"hsl(119, 34%, 47%)"},".language-css .token.important":{color:"hsl(301, 63%, 40%)"},".language-css .token.atrule .token.rule":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.operator":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(344, 84%, 43%)"},".language-json .token.operator":{color:"hsl(230, 8%, 24%)"},".language-json .token.null.keyword":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.url":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.operator":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.content":{color:"hsl(221, 87%, 60%)"},".language-markdown .token.url > .token.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.url-reference.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(119, 34%, 47%)"},".language-markdown .token.bold .token.content":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.italic .token.content":{color:"hsl(301, 63%, 40%)"},".language-markdown .token.strike .token.content":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.list.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(5, 74%, 59%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.cr:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.lf:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.space:before":{color:"hsla(230, 8%, 24%, 0.2)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},".line-highlight.line-highlight":{background:"hsla(230, 8%, 24%, 0.05)"},".line-highlight.line-highlight:before":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(230, 8%, 24%, 0.05)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".command-line .command-line-prompt":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(230, 1%, 62%)"},".command-line .command-line-prompt > span:before":{color:"hsl(230, 1%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(301, 63%, 40%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(0, 0, 95%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(0, 0, 95%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(0, 0, 95%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(0, 0, 95%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(0, 0%, 100%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(230, 8%, 24%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(230, 8%, 24%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(230, 8%, 24%)"}};e.s(["default",0,({code:e,language:s})=>{let[l,c]=(0,r.useState)(!1);return(0,t.jsxs)("div",{className:"relative rounded-lg border border-gray-200 overflow-hidden",children:[(0,t.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(e),c(!0),setTimeout(()=>c(!1),2e3)},className:"absolute top-3 right-3 p-2 rounded-md bg-gray-100 hover:bg-gray-200 text-gray-600 z-10","aria-label":"Copy code",children:l?(0,t.jsx)(n.CheckIcon,{size:16}):(0,t.jsx)(i,{size:16})}),(0,t.jsx)(o.Prism,{language:s,style:a,customStyle:{margin:0,padding:"1.5rem",borderRadius:"0.5rem",fontSize:"0.9rem",backgroundColor:"#fafafa"},showLineNumbers:!0,children:e})]})}],673709)},794357,546467,778917,592392,e=>{"use strict";var t=e.i(843476),r=e.i(599724),n=e.i(197647),i=e.i(653824),o=e.i(881073),a=e.i(404206),s=e.i(723731),l=e.i(350967),c=e.i(673709);let u=(0,e.i(475254).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["default",()=>u],546467),e.s(["ExternalLink",()=>u],778917);let d=({href:e,className:r})=>(0,t.jsxs)("a",{href:e,target:"_blank",rel:"noopener noreferrer",title:"Open documentation in a new tab",className:function(...e){return e.filter(Boolean).join(" ")}("inline-flex items-center gap-2 rounded-xl border border-zinc-200 bg-white/80 px-3.5 py-2 text-sm font-medium text-zinc-700 shadow-sm","hover:bg-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 active:translate-y-[0.5px]",r),children:[(0,t.jsx)("span",{children:"API Reference Docs"}),(0,t.jsx)(u,{"aria-hidden":!0,className:"h-4 w-4 opacity-80"}),(0,t.jsx)("span",{className:"sr-only",children:"(opens in a new tab)"})]});e.s(["default",0,({proxySettings:e})=>{let u="",p=e?.LITELLM_UI_API_DOC_BASE_URL;return p&&p.trim()?u=p:e?.PROXY_BASE_URL&&(u=e.PROXY_BASE_URL),(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(l.Grid,{className:"gap-2 p-8 h-[80vh] w-full mt-2",children:(0,t.jsxs)("div",{className:"mb-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:"OpenAI Compatible Proxy: API Reference"}),(0,t.jsx)(d,{className:"ml-3 shrink-0",href:"https://docs.litellm.ai/docs/proxy/user_keys"})]}),(0,t.jsxs)(r.Text,{className:"mt-2 mb-2",children:["LiteLLM is OpenAI Compatible. This means your API Key works with the OpenAI SDK. Just replace the base_url to point to your litellm proxy. Example Below"," "]}),(0,t.jsxs)(i.TabGroup,{children:[(0,t.jsxs)(o.TabList,{children:[(0,t.jsx)(n.Tab,{children:"OpenAI Python SDK"}),(0,t.jsx)(n.Tab,{children:"LlamaIndex"}),(0,t.jsx)(n.Tab,{children:"Langchain Py"})]}),(0,t.jsxs)(s.TabPanels,{children:[(0,t.jsx)(a.TabPanel,{children:(0,t.jsx)(c.default,{language:"python",code:`import openai client = openai.OpenAI( api_key="your_api_key", - base_url="${d}" # LiteLLM Proxy is OpenAI compatible, Read More: https://docs.litellm.ai/docs/proxy/user_keys + base_url="${u}" # LiteLLM Proxy is OpenAI compatible, Read More: https://docs.litellm.ai/docs/proxy/user_keys ) response = client.chat.completions.create( @@ -453,14 +453,14 @@ from llama_index import VectorStoreIndex, SimpleDirectoryReader, ServiceContext llm = AzureOpenAI( engine="azure-gpt-3.5", # model_name on litellm proxy temperature=0.0, - azure_endpoint="${d}", # litellm proxy endpoint + azure_endpoint="${u}", # litellm proxy endpoint api_key="sk-1234", # litellm proxy API Key api_version="2023-07-01-preview", ) embed_model = AzureOpenAIEmbedding( deployment_name="azure-embedding-model", - azure_endpoint="${d}", + azure_endpoint="${u}", api_key="sk-1234", api_version="2023-07-01-preview", ) @@ -480,7 +480,7 @@ from langchain.prompts.chat import ( from langchain.schema import HumanMessage, SystemMessage chat = ChatOpenAI( - openai_api_base="${d}", + openai_api_base="${u}", model = "gpt-3.5-turbo", temperature=0.1 ) @@ -495,4 +495,4 @@ messages = [ ] response = chat(messages) -print(response)`})})]})]})]})})})}],794357);var p=e.i(271645),m=e.i(62478),g=e.i(135214);function h(){let{accessToken:e}=(0,g.default)(),[t,r]=(0,p.useState)({PROXY_BASE_URL:"",PROXY_LOGOUT_URL:"",LITELLM_UI_API_DOC_BASE_URL:null});return(0,p.useEffect)(()=>{e&&(0,m.fetchProxySettings)(e).then(e=>{e&&r(e)})},[e]),t}e.s(["default",()=>h],592392)},751904,883552,e=>{"use strict";var t=e.i(401361);e.s(["EditOutlined",()=>t.default],751904),e.i(247167);var r=e.i(271645),n=e.i(562901),i=e.i(343794),o=e.i(914949),a=e.i(529681),s=e.i(242064),l=e.i(829672),c=e.i(285781),d=e.i(836938),u=e.i(920228),p=e.i(62405),m=e.i(408850),g=e.i(87414),h=e.i(310730);let f=(0,e.i(246422).genStyleHooks)("Popconfirm",e=>(e=>{let{componentCls:t,iconCls:r,antCls:n,zIndexPopup:i,colorText:o,colorWarning:a,marginXXS:s,marginXS:l,fontSize:c,fontWeightStrong:d,colorTextHeading:u}=e;return{[t]:{zIndex:i,[`&${n}-popover`]:{fontSize:c},[`${t}-message`]:{marginBottom:l,display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${t}-message-icon ${r}`]:{color:a,fontSize:c,lineHeight:1,marginInlineEnd:l},[`${t}-title`]:{fontWeight:d,color:u,"&:only-child":{fontWeight:"normal"}},[`${t}-description`]:{marginTop:s,color:o}},[`${t}-buttons`]:{textAlign:"end",whiteSpace:"nowrap",button:{marginInlineStart:l}}}}})(e),e=>{let{zIndexPopupBase:t}=e;return{zIndexPopup:t+60}},{resetStyle:!1});var b=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);it.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};let y=e=>{let{prefixCls:t,okButtonProps:i,cancelButtonProps:o,title:a,description:l,cancelText:h,okText:f,okType:b="primary",icon:y=r.createElement(n.default,null),showCancel:v=!0,close:_,onConfirm:x,onCancel:k,onPopupClick:w}=e,{getPrefixCls:$}=r.useContext(s.ConfigContext),[O]=(0,m.useLocale)("Popconfirm",g.default.Popconfirm),S=(0,d.getRenderPropValue)(a),j=(0,d.getRenderPropValue)(l);return r.createElement("div",{className:`${t}-inner-content`,onClick:w},r.createElement("div",{className:`${t}-message`},y&&r.createElement("span",{className:`${t}-message-icon`},y),r.createElement("div",{className:`${t}-message-text`},S&&r.createElement("div",{className:`${t}-title`},S),j&&r.createElement("div",{className:`${t}-description`},j))),r.createElement("div",{className:`${t}-buttons`},v&&r.createElement(u.default,Object.assign({onClick:k,size:"small"},o),h||(null==O?void 0:O.cancelText)),r.createElement(c.default,{buttonProps:Object.assign(Object.assign({size:"small"},(0,p.convertLegacyProps)(b)),i),actionFn:x,close:_,prefixCls:$("btn"),quitOnNullishReturnValue:!0,emitEvent:!0},f||(null==O?void 0:O.okText))))};var v=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);it.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};let _=r.forwardRef((e,t)=>{var c,d;let{prefixCls:u,placement:p="top",trigger:m="click",okType:g="primary",icon:h=r.createElement(n.default,null),children:b,overlayClassName:_,onOpenChange:x,onVisibleChange:k,overlayStyle:w,styles:$,classNames:O}=e,S=v(e,["prefixCls","placement","trigger","okType","icon","children","overlayClassName","onOpenChange","onVisibleChange","overlayStyle","styles","classNames"]),{getPrefixCls:j,className:E,style:C,classNames:M,styles:I}=(0,s.useComponentConfig)("popconfirm"),[T,z]=(0,o.default)(!1,{value:null!=(c=e.open)?c:e.visible,defaultValue:null!=(d=e.defaultOpen)?d:e.defaultVisible}),N=(e,t)=>{z(e,!0),null==k||k(e),null==x||x(e,t)},A=j("popconfirm",u),P=(0,i.default)(A,E,_,M.root,null==O?void 0:O.root),R=(0,i.default)(M.body,null==O?void 0:O.body),[L]=f(A);return L(r.createElement(l.default,Object.assign({},(0,a.default)(S,["title"]),{trigger:m,placement:p,onOpenChange:(t,r)=>{let{disabled:n=!1}=e;n||N(t,r)},open:T,ref:t,classNames:{root:P,body:R},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},I.root),C),w),null==$?void 0:$.root),body:Object.assign(Object.assign({},I.body),null==$?void 0:$.body)},content:r.createElement(y,Object.assign({okType:g,icon:h},e,{prefixCls:A,close:e=>{N(!1,e)},onConfirm:t=>{var r;return null==(r=e.onConfirm)?void 0:r.call(void 0,t)},onCancel:t=>{var r;N(!1,t),null==(r=e.onCancel)||r.call(void 0,t)}})),"data-popover-inject":!0}),b))});_._InternalPanelDoNotUseOrYouWillBeFired=e=>{let{prefixCls:t,placement:n,className:o,style:a}=e,l=b(e,["prefixCls","placement","className","style"]),{getPrefixCls:c}=r.useContext(s.ConfigContext),d=c("popconfirm",t),[u]=f(d);return u(r.createElement(h.default,{placement:n,className:(0,i.default)(d,o),style:a,content:r.createElement(y,Object.assign({prefixCls:d},l))}))},e.s(["Popconfirm",0,_],883552)},822315,(e,t,r)=>{e.e,t.exports=function(){"use strict";var e="millisecond",t="second",r="minute",n="hour",i="week",o="month",a="quarter",s="year",l="date",c="Invalid Date",d=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,u=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},m="en",g={};g[m]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}};var h="$isDayjsObject",f=function(e){return e instanceof _||!(!e||!e[h])},b=function e(t,r,n){var i;if(!t)return m;if("string"==typeof t){var o=t.toLowerCase();g[o]&&(i=o),r&&(g[o]=r,i=o);var a=t.split("-");if(!i&&a.length>1)return e(a[0])}else{var s=t.name;g[s]=t,i=s}return!n&&i&&(m=i),i||!n&&m},y=function(e,t){if(f(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new _(r)},v={s:p,z:function(e){var t=-e.utcOffset(),r=Math.abs(t);return(t<=0?"+":"-")+p(Math.floor(r/60),2,"0")+":"+p(r%60,2,"0")},m:function e(t,r){if(t.date(){"use strict";function t(e,t){window.sessionStorage.setItem(e,btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))))}function r(e){try{let t=window.sessionStorage.getItem(e);if(null===t)return null;return decodeURIComponent(atob(t).split("").map(e=>"%"+e.charCodeAt(0).toString(16).padStart(2,"0")).join(""))}catch{return null}}e.s(["getSecureItem",()=>r,"setSecureItem",()=>t])},438957,366308,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M608 112c-167.9 0-304 136.1-304 304 0 70.3 23.9 135 63.9 186.5l-41.1 41.1-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-44.9 44.9-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-65.3 65.3a8.03 8.03 0 000 11.3l42.3 42.3c3.1 3.1 8.2 3.1 11.3 0l253.6-253.6A304.06 304.06 0 00608 720c167.9 0 304-136.1 304-304S775.9 112 608 112zm161.2 465.2C726.2 620.3 668.9 644 608 644c-60.9 0-118.2-23.7-161.2-66.8-43.1-43-66.8-100.3-66.8-161.2 0-60.9 23.7-118.2 66.8-161.2 43-43.1 100.3-66.8 161.2-66.8 60.9 0 118.2 23.7 161.2 66.8 43.1 43 66.8 100.3 66.8 161.2 0 60.9-23.7 118.2-66.8 161.2z"}}]},name:"key",theme:"outlined"};var i=e.i(9583),o=r.forwardRef(function(e,o){return r.createElement(i.default,(0,t.default)({},e,{ref:o,icon:n}))});e.s(["KeyOutlined",0,o],438957);let a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M876.6 239.5c-.5-.9-1.2-1.8-2-2.5-5-5-13.1-5-18.1 0L684.2 409.3l-67.9-67.9L788.7 169c.8-.8 1.4-1.6 2-2.5 3.6-6.1 1.6-13.9-4.5-17.5-98.2-58-226.8-44.7-311.3 39.7-67 67-89.2 162-66.5 247.4l-293 293c-3 3-2.8 7.9.3 11l169.7 169.7c3.1 3.1 8.1 3.3 11 .3l292.9-292.9c85.5 22.8 180.5.7 247.6-66.4 84.4-84.5 97.7-213.1 39.7-311.3zM786 499.8c-58.1 58.1-145.3 69.3-214.6 33.6l-8.8 8.8-.1-.1-274 274.1-79.2-79.2 230.1-230.1s0 .1.1.1l52.8-52.8c-35.7-69.3-24.5-156.5 33.6-214.6a184.2 184.2 0 01144-53.5L537 318.9a32.05 32.05 0 000 45.3l124.5 124.5a32.05 32.05 0 0045.3 0l132.8-132.8c3.7 51.8-14.4 104.8-53.6 143.9z"}}]},name:"tool",theme:"outlined"};var s=r.forwardRef(function(e,n){return r.createElement(i.default,(0,t.default)({},e,{ref:n,icon:a}))});e.s(["ToolOutlined",0,s],366308)},477189,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"}}]},name:"appstore",theme:"outlined"};var i=e.i(9583),o=r.forwardRef(function(e,o){return r.createElement(i.default,(0,t.default)({},e,{ref:o,icon:n}))});e.s(["AppstoreOutlined",0,o],477189)},264843,292335,122520,165615,779129,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z"}}]},name:"message",theme:"outlined"};var i=e.i(9583),o=r.forwardRef(function(e,o){return r.createElement(i.default,(0,t.default)({},e,{ref:o,icon:n}))});e.s(["MessageOutlined",0,o],264843);let a={NONE:"none",API_KEY:"api_key",BEARER_TOKEN:"bearer_token",TOKEN:"token",BASIC:"basic",OAUTH2:"oauth2",AWS_SIGV4:"aws_sigv4"},s="client_credentials";function l(e){return e.auth_type!==a.OAUTH2?null:e.oauth2_flow===s?"m2m":e.delegate_auth_to_upstream?"passthrough":"obo"}let c={SSE:"sse",HTTP:"http",STDIO:"stdio",OPENAPI:"openapi"};function d(e){if(e instanceof Error)return e.message;if(e&&"object"==typeof e){let t=e.detail;return"string"==typeof t?t:Array.isArray(t)?t.map(e=>e&&"object"==typeof e?"string"==typeof e.msg?e.msg:JSON.stringify(e):String(e)).join("; "):t&&"object"==typeof t&&"string"==typeof t.error?t.error:"string"==typeof e.message?e.message:JSON.stringify(e)}return String(e)}e.s(["AUTH_TYPE",0,a,"MCP_OAUTH2_FLOW_M2M",0,s,"OAUTH_FLOW",0,{INTERACTIVE:"interactive",M2M:"m2m"},"TRANSPORT",0,c,"getMcpOAuthMode",()=>l,"handleAuth",0,e=>null==e?a.NONE:e,"handleTransport",0,(e,t)=>null==e?c.SSE:t&&e!==c.STDIO?c.OPENAPI:e],292335),e.s(["extractErrorMessage",()=>d],122520);let u=e=>{let t=new Uint8Array(e),r="";return t.forEach(e=>r+=String.fromCharCode(e)),btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},p=async e=>{let t=new TextEncoder().encode(e);return u(await window.crypto.subtle.digest("SHA-256",t))};e.s(["generateCodeChallenge",0,p,"generateCodeVerifier",0,()=>{let e=new Uint8Array(32);return window.crypto.getRandomValues(e),u(e.buffer)}],165615),e.i(602869),e.s(["buildCallbackUrl",0,()=>{{let e=window.location.pathname||"",t=e.indexOf("/ui"),r=t>=0?e.slice(0,t+3).replace(/\/+$/,""):"";return`${window.location.origin}${r}/mcp/oauth/callback`}},"clearStorage",0,(...e)=>{e.forEach(e=>{try{window.sessionStorage.removeItem(e)}catch(e){}})}],779129)}]); \ No newline at end of file +print(response)`})})]})]})]})})})}],794357);var p=e.i(271645),m=e.i(62478),g=e.i(135214);function h(){let{accessToken:e}=(0,g.default)(),[t,r]=(0,p.useState)({PROXY_BASE_URL:"",PROXY_LOGOUT_URL:"",LITELLM_UI_API_DOC_BASE_URL:null});return(0,p.useEffect)(()=>{e&&(0,m.fetchProxySettings)(e).then(e=>{e&&r(e)})},[e]),t}e.s(["default",()=>h],592392)},751904,883552,e=>{"use strict";var t=e.i(401361);e.s(["EditOutlined",()=>t.default],751904),e.i(247167);var r=e.i(271645),n=e.i(562901),i=e.i(343794),o=e.i(914949),a=e.i(529681),s=e.i(242064),l=e.i(829672),c=e.i(285781),u=e.i(836938),d=e.i(920228),p=e.i(62405),m=e.i(408850),g=e.i(87414),h=e.i(310730);let f=(0,e.i(246422).genStyleHooks)("Popconfirm",e=>(e=>{let{componentCls:t,iconCls:r,antCls:n,zIndexPopup:i,colorText:o,colorWarning:a,marginXXS:s,marginXS:l,fontSize:c,fontWeightStrong:u,colorTextHeading:d}=e;return{[t]:{zIndex:i,[`&${n}-popover`]:{fontSize:c},[`${t}-message`]:{marginBottom:l,display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${t}-message-icon ${r}`]:{color:a,fontSize:c,lineHeight:1,marginInlineEnd:l},[`${t}-title`]:{fontWeight:u,color:d,"&:only-child":{fontWeight:"normal"}},[`${t}-description`]:{marginTop:s,color:o}},[`${t}-buttons`]:{textAlign:"end",whiteSpace:"nowrap",button:{marginInlineStart:l}}}}})(e),e=>{let{zIndexPopupBase:t}=e;return{zIndexPopup:t+60}},{resetStyle:!1});var b=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);it.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};let y=e=>{let{prefixCls:t,okButtonProps:i,cancelButtonProps:o,title:a,description:l,cancelText:h,okText:f,okType:b="primary",icon:y=r.createElement(n.default,null),showCancel:v=!0,close:_,onConfirm:x,onCancel:w,onPopupClick:k}=e,{getPrefixCls:$}=r.useContext(s.ConfigContext),[O]=(0,m.useLocale)("Popconfirm",g.default.Popconfirm),S=(0,u.getRenderPropValue)(a),j=(0,u.getRenderPropValue)(l);return r.createElement("div",{className:`${t}-inner-content`,onClick:k},r.createElement("div",{className:`${t}-message`},y&&r.createElement("span",{className:`${t}-message-icon`},y),r.createElement("div",{className:`${t}-message-text`},S&&r.createElement("div",{className:`${t}-title`},S),j&&r.createElement("div",{className:`${t}-description`},j))),r.createElement("div",{className:`${t}-buttons`},v&&r.createElement(d.default,Object.assign({onClick:w,size:"small"},o),h||(null==O?void 0:O.cancelText)),r.createElement(c.default,{buttonProps:Object.assign(Object.assign({size:"small"},(0,p.convertLegacyProps)(b)),i),actionFn:x,close:_,prefixCls:$("btn"),quitOnNullishReturnValue:!0,emitEvent:!0},f||(null==O?void 0:O.okText))))};var v=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);it.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};let _=r.forwardRef((e,t)=>{var c,u;let{prefixCls:d,placement:p="top",trigger:m="click",okType:g="primary",icon:h=r.createElement(n.default,null),children:b,overlayClassName:_,onOpenChange:x,onVisibleChange:w,overlayStyle:k,styles:$,classNames:O}=e,S=v(e,["prefixCls","placement","trigger","okType","icon","children","overlayClassName","onOpenChange","onVisibleChange","overlayStyle","styles","classNames"]),{getPrefixCls:j,className:E,style:C,classNames:I,styles:M}=(0,s.useComponentConfig)("popconfirm"),[T,z]=(0,o.default)(!1,{value:null!=(c=e.open)?c:e.visible,defaultValue:null!=(u=e.defaultOpen)?u:e.defaultVisible}),A=(e,t)=>{z(e,!0),null==w||w(e),null==x||x(e,t)},N=j("popconfirm",d),P=(0,i.default)(N,E,_,I.root,null==O?void 0:O.root),R=(0,i.default)(I.body,null==O?void 0:O.body),[L]=f(N);return L(r.createElement(l.default,Object.assign({},(0,a.default)(S,["title"]),{trigger:m,placement:p,onOpenChange:(t,r)=>{let{disabled:n=!1}=e;n||A(t,r)},open:T,ref:t,classNames:{root:P,body:R},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},M.root),C),k),null==$?void 0:$.root),body:Object.assign(Object.assign({},M.body),null==$?void 0:$.body)},content:r.createElement(y,Object.assign({okType:g,icon:h},e,{prefixCls:N,close:e=>{A(!1,e)},onConfirm:t=>{var r;return null==(r=e.onConfirm)?void 0:r.call(void 0,t)},onCancel:t=>{var r;A(!1,t),null==(r=e.onCancel)||r.call(void 0,t)}})),"data-popover-inject":!0}),b))});_._InternalPanelDoNotUseOrYouWillBeFired=e=>{let{prefixCls:t,placement:n,className:o,style:a}=e,l=b(e,["prefixCls","placement","className","style"]),{getPrefixCls:c}=r.useContext(s.ConfigContext),u=c("popconfirm",t),[d]=f(u);return d(r.createElement(h.default,{placement:n,className:(0,i.default)(u,o),style:a,content:r.createElement(y,Object.assign({prefixCls:u},l))}))},e.s(["Popconfirm",0,_],883552)},822315,(e,t,r)=>{e.e,t.exports=function(){"use strict";var e="millisecond",t="second",r="minute",n="hour",i="week",o="month",a="quarter",s="year",l="date",c="Invalid Date",u=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},m="en",g={};g[m]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}};var h="$isDayjsObject",f=function(e){return e instanceof _||!(!e||!e[h])},b=function e(t,r,n){var i;if(!t)return m;if("string"==typeof t){var o=t.toLowerCase();g[o]&&(i=o),r&&(g[o]=r,i=o);var a=t.split("-");if(!i&&a.length>1)return e(a[0])}else{var s=t.name;g[s]=t,i=s}return!n&&i&&(m=i),i||!n&&m},y=function(e,t){if(f(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new _(r)},v={s:p,z:function(e){var t=-e.utcOffset(),r=Math.abs(t);return(t<=0?"+":"-")+p(Math.floor(r/60),2,"0")+":"+p(r%60,2,"0")},m:function e(t,r){if(t.date(){"use strict";function t(e,t){window.sessionStorage.setItem(e,btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))))}function r(e){try{let t=window.sessionStorage.getItem(e);if(null===t)return null;return decodeURIComponent(atob(t).split("").map(e=>"%"+e.charCodeAt(0).toString(16).padStart(2,"0")).join(""))}catch{return null}}e.s(["getSecureItem",()=>r,"setSecureItem",()=>t])},438957,366308,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M608 112c-167.9 0-304 136.1-304 304 0 70.3 23.9 135 63.9 186.5l-41.1 41.1-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-44.9 44.9-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-65.3 65.3a8.03 8.03 0 000 11.3l42.3 42.3c3.1 3.1 8.2 3.1 11.3 0l253.6-253.6A304.06 304.06 0 00608 720c167.9 0 304-136.1 304-304S775.9 112 608 112zm161.2 465.2C726.2 620.3 668.9 644 608 644c-60.9 0-118.2-23.7-161.2-66.8-43.1-43-66.8-100.3-66.8-161.2 0-60.9 23.7-118.2 66.8-161.2 43-43.1 100.3-66.8 161.2-66.8 60.9 0 118.2 23.7 161.2 66.8 43.1 43 66.8 100.3 66.8 161.2 0 60.9-23.7 118.2-66.8 161.2z"}}]},name:"key",theme:"outlined"};var i=e.i(9583),o=r.forwardRef(function(e,o){return r.createElement(i.default,(0,t.default)({},e,{ref:o,icon:n}))});e.s(["KeyOutlined",0,o],438957);let a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M876.6 239.5c-.5-.9-1.2-1.8-2-2.5-5-5-13.1-5-18.1 0L684.2 409.3l-67.9-67.9L788.7 169c.8-.8 1.4-1.6 2-2.5 3.6-6.1 1.6-13.9-4.5-17.5-98.2-58-226.8-44.7-311.3 39.7-67 67-89.2 162-66.5 247.4l-293 293c-3 3-2.8 7.9.3 11l169.7 169.7c3.1 3.1 8.1 3.3 11 .3l292.9-292.9c85.5 22.8 180.5.7 247.6-66.4 84.4-84.5 97.7-213.1 39.7-311.3zM786 499.8c-58.1 58.1-145.3 69.3-214.6 33.6l-8.8 8.8-.1-.1-274 274.1-79.2-79.2 230.1-230.1s0 .1.1.1l52.8-52.8c-35.7-69.3-24.5-156.5 33.6-214.6a184.2 184.2 0 01144-53.5L537 318.9a32.05 32.05 0 000 45.3l124.5 124.5a32.05 32.05 0 0045.3 0l132.8-132.8c3.7 51.8-14.4 104.8-53.6 143.9z"}}]},name:"tool",theme:"outlined"};var s=r.forwardRef(function(e,n){return r.createElement(i.default,(0,t.default)({},e,{ref:n,icon:a}))});e.s(["ToolOutlined",0,s],366308)},477189,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"}}]},name:"appstore",theme:"outlined"};var i=e.i(9583),o=r.forwardRef(function(e,o){return r.createElement(i.default,(0,t.default)({},e,{ref:o,icon:n}))});e.s(["AppstoreOutlined",0,o],477189)},264843,292335,122520,165615,779129,280024,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z"}}]},name:"message",theme:"outlined"};var i=e.i(9583),o=r.forwardRef(function(e,o){return r.createElement(i.default,(0,t.default)({},e,{ref:o,icon:n}))});e.s(["MessageOutlined",0,o],264843);let a={NONE:"none",API_KEY:"api_key",BEARER_TOKEN:"bearer_token",TOKEN:"token",BASIC:"basic",OAUTH2:"oauth2",AWS_SIGV4:"aws_sigv4"},s="client_credentials";function l(e){return e.auth_type!==a.OAUTH2?null:e.oauth2_flow===s?"m2m":e.delegate_auth_to_upstream?"passthrough":"obo"}let c={SSE:"sse",HTTP:"http",STDIO:"stdio",OPENAPI:"openapi"};e.s(["AUTH_TYPE",0,a,"MCP_OAUTH2_FLOW_M2M",0,s,"OAUTH_FLOW",0,{INTERACTIVE:"interactive",M2M:"m2m"},"TRANSPORT",0,c,"getMcpOAuthMode",()=>l,"handleAuth",0,e=>null==e?a.NONE:e,"handleTransport",0,(e,t)=>null==e?c.SSE:t&&e!==c.STDIO?c.OPENAPI:e],292335);var u=e.i(602869),d=e.i(727749);function p(e){if(e instanceof Error)return e.message;if(e&&"object"==typeof e){let t=e.detail;return"string"==typeof t?t:Array.isArray(t)?t.map(e=>e&&"object"==typeof e?"string"==typeof e.msg?e.msg:JSON.stringify(e):String(e)).join("; "):t&&"object"==typeof t&&"string"==typeof t.error?t.error:"string"==typeof e.message?e.message:JSON.stringify(e)}return String(e)}e.s(["extractErrorMessage",()=>p],122520);let m=e=>{let t=new Uint8Array(e),r="";return t.forEach(e=>r+=String.fromCharCode(e)),btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},g=()=>{let e=new Uint8Array(32);return window.crypto.getRandomValues(e),m(e.buffer)},h=async e=>{let t=new TextEncoder().encode(e);return m(await window.crypto.subtle.digest("SHA-256",t))};e.s(["generateCodeChallenge",0,h,"generateCodeVerifier",0,g],165615);var f=e.i(434166);let b=()=>{{let e=window.location.pathname||"",t=e.indexOf("/ui"),r=t>=0?e.slice(0,t+3).replace(/\/+$/,""):"";return`${window.location.origin}${r}/mcp/oauth/callback`}},y=(...e)=>{e.forEach(e=>{try{window.sessionStorage.removeItem(e)}catch(e){}})};e.s(["TOOLS_OAUTH_UI_STATE_KEY",0,"litellm-mcp-oauth-tools-state","buildCallbackUrl",0,b,"clearStorage",0,y],779129);let v="litellm-user-mcp-oauth-flow-state",_="litellm-user-mcp-oauth-result",x=(e,t)=>{(0,f.setSecureItem)(e,t)},w=e=>(0,f.getSecureItem)(e);e.s(["useUserMcpOAuthFlow",0,({accessToken:e,serverId:t,serverAlias:n,scopes:i,clientId:o,onSuccess:a})=>{let[s,l]=(0,r.useState)("idle"),[c,m]=(0,r.useState)(null),f=(0,r.useRef)(!1),k=(0,r.useCallback)(async()=>{try{let r;l("authorizing"),m(null);let a=o??void 0;if(!a)try{let i=await (0,u.registerMcpOAuthClient)(e,t,{client_name:n||t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"});a=i?.client_id,r=i?.client_secret}catch(e){}let s=g(),c=await h(s),d=crypto.randomUUID(),p=b(),f=i?.filter(e=>e.trim()).join(" "),y=(0,u.buildMcpOAuthAuthorizeUrl)({serverId:t,clientId:a,redirectUri:p,state:d,codeChallenge:c,scope:f}),_={state:d,codeVerifier:s,serverId:t,redirectUri:p,clientId:a,clientSecret:r,scopes:i};x(v,JSON.stringify(_));let w=new URL(window.location.href);w.searchParams.set("mcpOauthReturn","apps"),x("litellm-mcp-oauth-return-url",w.toString()),window.location.href=y}catch(t){let e=p(t);m(e),l("error"),d.default.error(e)}},[e,t,n,i,o]),$=(0,r.useCallback)(async()=>{if(f.current)return;let r=w(_);if(!r)return;let n=w(v);if(!n)return;try{let e=JSON.parse(n);if(e.serverId&&e.serverId!==t)return}catch(e){}f.current=!0,y(_);let i=null,o=null;try{i=JSON.parse(r);let e=w(v);o=e?JSON.parse(e):null}catch(e){m("Failed to resume OAuth flow. Please retry."),l("error"),f.current=!1,y(v);return}try{if(!o?.state||!o.codeVerifier||!o.serverId)throw Error("OAuth session state was lost. Please retry.");if(!i?.state||i.state!==o.state)throw Error("OAuth state mismatch. Please retry.");if(i.error)throw Error(i.error_description||i.error);if(!i.code)throw Error("Authorization code missing in callback.");l("exchanging");let t=await (0,u.exchangeMcpOAuthToken)({serverId:o.serverId,code:i.code,clientId:o.clientId,clientSecret:o.clientSecret,codeVerifier:o.codeVerifier,redirectUri:o.redirectUri,accessToken:e});await (0,u.storeMCPOAuthUserCredential)(e,o.serverId,{access_token:t.access_token,refresh_token:t.refresh_token,expires_in:t.expires_in,scopes:o.scopes}),l("success"),m(null),d.default.success("Connected successfully"),a()}catch(t){let e=p(t);m(e),l("error"),d.default.error(e)}finally{y(v),setTimeout(()=>{f.current=!1},1e3)}},[e,t,a]);return(0,r.useEffect)(()=>{$()},[$]),{startOAuthFlow:k,status:s,error:c}}],280024)}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/ffa46de7b8384155.js b/litellm/proxy/_experimental/out/_next/static/chunks/a4315c6eaf401064.js similarity index 84% rename from litellm/proxy/_experimental/out/_next/static/chunks/ffa46de7b8384155.js rename to litellm/proxy/_experimental/out/_next/static/chunks/a4315c6eaf401064.js index 1e530c3adbde..f58def80e175 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/ffa46de7b8384155.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/a4315c6eaf401064.js @@ -391,7 +391,7 @@ Return a structured verdict with confidence and justification.`,kx=`{ "headers": { "x-litellm-api-key": "Bearer " } } } -}`,s=async()=>{try{await navigator.clipboard.writeText(a),t(!0),setTimeout(()=>t(!1),1500)}catch{}};return(0,_.jsxs)("div",{className:"mb-6 rounded-lg border border-gray-200 bg-gray-50 px-5 py-4",children:[(0,_.jsx)("p",{className:"text-sm font-medium text-gray-700 mb-1",children:"How toolsets work"}),(0,_.jsxs)("p",{className:"text-sm text-gray-500 mb-3",children:["Create a toolset, assign it to a key via"," ",(0,_.jsx)("span",{className:"font-medium text-gray-700",children:"API Keys → Edit Key → MCP Servers"}),", then point your MCP client at the toolset URL. The client only sees the tools you picked."]}),(0,_.jsx)("div",{className:"text-xs text-gray-400 mb-1",children:"Claude Code / Cursor config"}),(0,_.jsxs)("div",{className:"relative",children:[(0,_.jsx)("pre",{className:"bg-white border border-gray-200 rounded px-4 py-3 text-xs font-mono text-gray-700 overflow-x-auto leading-relaxed pr-14",children:a}),(0,_.jsx)("button",{type:"button",onClick:s,className:"absolute top-2 right-2 px-2 py-1 text-xs rounded border bg-white hover:bg-gray-50 text-gray-400 hover:text-gray-600 border-gray-200 transition-colors",children:e?"✓":"copy"})]})]})}function LV({accessToken:e,userRole:t}){let r=(0,eh.useQueryClient)(),{data:a=[],isLoading:s}=(0,Lz.useMCPToolsets)(),[n,l]=(0,T.useState)(!1),[i,o]=(0,T.useState)(null),[d,c]=(0,T.useState)(null),[u,m]=(0,T.useState)(!1),p="Admin"===t||"proxy_admin"===t,h=async(t,a,s)=>{e&&(await (0,Q.createMCPToolset)(e,{toolset_name:t,description:a,tools:s}),LB.message.success("Toolset created"),r.invalidateQueries({queryKey:["mcpToolsets"]}))},f=async(t,a,s)=>{e&&i&&(await (0,Q.updateMCPToolset)(e,{toolset_id:i.toolset_id,toolset_name:t,description:a,tools:s}),LB.message.success("Toolset updated"),r.invalidateQueries({queryKey:["mcpToolsets"]}),o(null))},x=async()=>{if(e&&d){m(!0);try{await (0,Q.deleteMCPToolset)(e,d),LB.message.success("Toolset deleted"),r.invalidateQueries({queryKey:["mcpToolsets"]}),c(null)}finally{m(!1)}}},g=(0,Q.getProxyBaseUrl)(),y=[{header:"Toolset ID",accessorKey:"toolset_id",cell:({row:e})=>(0,_.jsxs)("span",{className:"font-mono text-xs bg-gray-100 px-2 py-0.5 rounded text-gray-600",children:[e.original.toolset_id.slice(0,8),"…"]})},{header:"Name",accessorKey:"toolset_name",cell:({row:e})=>{let t=`${g}/toolset/${e.original.toolset_name}/mcp`;return(0,_.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("span",{className:"inline-block w-2 h-2 rounded-full bg-purple-500 flex-shrink-0"}),(0,_.jsx)("span",{className:"font-medium text-gray-900",children:e.original.toolset_name})]}),(0,_.jsx)("button",{type:"button",className:"text-xs text-gray-400 hover:text-purple-600 font-mono truncate max-w-xs text-left transition-colors",onClick:()=>navigator.clipboard.writeText(t),title:"Click to copy endpoint URL",children:t})]})}},{header:"Description",accessorKey:"description",cell:({row:e})=>(0,_.jsx)("span",{className:"text-sm text-gray-500",children:e.original.description||"—"})},{header:"Tools",accessorKey:"tools",cell:({row:e})=>{let t=e.original.tools;return(0,_.jsxs)("div",{className:"flex flex-wrap gap-1 max-w-xs",children:[t.slice(0,4).map((e,t)=>(0,_.jsx)("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded bg-purple-50 border border-purple-200 text-purple-700 text-xs",children:e.tool_name},t)),t.length>4&&(0,_.jsxs)("span",{className:"text-xs text-gray-400 self-center",children:["+",t.length-4," more"]})]})}},{header:"Created",accessorKey:"created_at",cell:({row:e})=>(0,_.jsx)("span",{className:"text-xs text-gray-500",children:e.original.created_at?new Date(e.original.created_at).toLocaleDateString():"—"})},...p?[{header:"",id:"actions",cell:({row:e})=>(0,_.jsxs)("div",{className:"flex items-center gap-1 justify-end",children:[(0,_.jsx)("button",{type:"button",className:"p-1.5 rounded-lg hover:bg-gray-100 text-gray-400 hover:text-gray-700 transition-colors",onClick:()=>o(e.original),children:(0,_.jsx)(CC.PencilIcon,{className:"h-4 w-4"})}),(0,_.jsx)("button",{type:"button",className:"p-1.5 rounded-lg hover:bg-red-50 text-gray-400 hover:text-red-500 transition-colors",onClick:()=>c(e.original.toolset_id),children:(0,_.jsx)(jO.TrashIcon,{className:"h-4 w-4"})})]})}]:[]];return(0,_.jsxs)("div",{className:"mt-4",children:[(0,_.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(X.Title,{children:"MCP Toolsets"}),(0,_.jsx)(Z.Text,{className:"text-gray-500 text-sm",children:"Curated collections of tools from one or more MCP servers. Assign toolsets to keys and teams via the MCP permissions dropdown."})]}),p&&(0,_.jsx)(S.Button,{icon:CO.PlusIcon,onClick:()=>l(!0),children:"New Toolset"})]}),(0,_.jsx)(LW,{}),(0,_.jsx)(LH.DataTable,{data:a,columns:y,renderSubComponent:()=>(0,_.jsx)("div",{}),getRowCanExpand:()=>!1,isLoading:s,noDataMessage:"No toolsets yet. Click 'New Toolset' to create one.",loadingMessage:"Loading toolsets...",enableSorting:!0}),(0,_.jsx)(LU,{open:n,onClose:()=>l(!1),onSave:h,accessToken:e}),i&&(0,_.jsx)(LU,{open:!!i,onClose:()=>o(null),onSave:f,accessToken:e,initialToolset:i}),(0,_.jsx)(q.Modal,{open:!!d,onCancel:()=>c(null),onOk:x,okText:"Delete",okButtonProps:{danger:!0,loading:u},title:"Delete Toolset",children:(0,_.jsx)("p",{children:"Are you sure you want to delete this toolset? Keys and teams using it will lose access to the scoped tools."})})]})}var LG=e.i(909119),LK=e.i(292335);let LJ="rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500",LQ=({label:e,tooltip:t})=>(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:[e,(0,_.jsx)(tB.Tooltip,{title:t,children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),LX=({isM2M:e,isEditing:t=!1,oauthFlow:r,initialFlowType:a,docsUrl:s})=>{let n=t?" (leave blank to keep existing)":"";return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"OAuth Flow Type",tooltip:"Choose how the proxy authenticates with this MCP server. M2M is for server-to-server communication using client credentials. Interactive (PKCE) is for user-facing flows that require browser-based authorization."}),name:"oauth_flow_type",...a?{initialValue:a}:{},children:(0,_.jsxs)(eE.Select,{className:"rounded-lg",size:"large",children:[(0,_.jsx)(eE.Select.Option,{value:LK.OAUTH_FLOW.M2M,children:(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{className:"font-medium",children:"Machine-to-Machine (M2M)"}),(0,_.jsx)("span",{className:"text-gray-400 text-xs ml-2",children:"server-to-server, no user interaction"})]})}),(0,_.jsx)(eE.Select.Option,{value:LK.OAUTH_FLOW.INTERACTIVE,children:(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{className:"font-medium",children:"Interactive (PKCE)"}),(0,_.jsx)("span",{className:"text-gray-400 text-xs ml-2",children:"browser-based user authorization"})]})})]})}),e?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"Client ID",tooltip:"OAuth2 client ID for the client_credentials grant."}),name:["credentials","client_id"],rules:[{required:!0,message:"Client ID is required for M2M OAuth"}],children:(0,_.jsx)(et.TextInput,{type:"password",placeholder:`Enter OAuth client ID${n}`,className:LJ})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"Client Secret",tooltip:"OAuth2 client secret for the client_credentials grant."}),name:["credentials","client_secret"],rules:[{required:!0,message:"Client Secret is required for M2M OAuth"}],children:(0,_.jsx)(et.TextInput,{type:"password",placeholder:`Enter OAuth client secret${n}`,className:LJ})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"Token URL",tooltip:"Token endpoint URL for the client_credentials grant."}),name:"token_url",rules:[{required:!0,message:"Token URL is required for M2M OAuth"}],children:(0,_.jsx)(et.TextInput,{placeholder:"https://auth.example.com/oauth/token",className:LJ})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"Scopes (optional)",tooltip:"Optional scopes to request with the client_credentials grant."}),name:["credentials","scopes"],children:(0,_.jsx)(eE.Select,{mode:"tags",tokenSeparators:[","],placeholder:"Add scopes",className:"rounded-lg",size:"large"})})]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"flex items-center justify-between w-full",children:[(0,_.jsx)(LQ,{label:"Client ID (optional)",tooltip:"Provide only if your MCP server cannot handle dynamic client registration."}),s&&(0,_.jsx)("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-blue-500 hover:text-blue-700 ml-2 font-normal",onClick:e=>e.stopPropagation(),children:"Create OAuth App →"})]}),name:["credentials","client_id"],children:(0,_.jsx)(et.TextInput,{type:"password",placeholder:`Enter client ID${n}`,className:LJ})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"Client Secret (optional)",tooltip:"Provide only if your MCP server cannot handle dynamic client registration."}),name:["credentials","client_secret"],children:(0,_.jsx)(et.TextInput,{type:"password",placeholder:`Enter client secret${n}`,className:LJ})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"Scopes (optional)",tooltip:"Optional scopes requested during token exchange. Separate multiple scopes with enter or commas."}),name:["credentials","scopes"],children:(0,_.jsx)(eE.Select,{mode:"tags",tokenSeparators:[","],placeholder:"Add scopes",className:"rounded-lg",size:"large"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"Authorization URL (optional)",tooltip:"Optional override for the authorization endpoint."}),name:"authorization_url",children:(0,_.jsx)(et.TextInput,{placeholder:"https://example.com/oauth/authorize",className:LJ})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"Token URL (optional)",tooltip:"Optional override for the token endpoint."}),name:"token_url",children:(0,_.jsx)(et.TextInput,{placeholder:"https://example.com/oauth/token",className:LJ})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"Registration URL (optional)",tooltip:"Optional override for the dynamic client registration endpoint."}),name:"registration_url",children:(0,_.jsx)(et.TextInput,{placeholder:"https://example.com/oauth/register",className:LJ})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"Token Validation Rules (optional)",tooltip:'JSON object of key-value rules checked against the OAuth token response before storing. Supports dot-notation for nested fields (e.g. {"organization": "my-org", "team.id": "123"}). Tokens that fail validation are rejected with HTTP 403.'}),name:"token_validation_json",rules:[{validator:(e,t)=>{if(!t||""===t.trim())return Promise.resolve();try{return JSON.parse(t),Promise.resolve()}catch{return Promise.reject(Error("Must be valid JSON"))}}}],children:(0,_.jsx)($.Input.TextArea,{placeholder:'{\n "organization": "my-org",\n "team.id": "123"\n}',rows:4,className:"font-mono text-sm rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"Token Storage TTL (seconds, optional)",tooltip:"How long to cache each user's OAuth access token in Redis before evicting it (regardless of the token's own expires_in). Leave blank to derive the TTL from the token's expires_in, or fall back to the 12-hour default."}),name:"token_storage_ttl_seconds",children:(0,_.jsx)(tq.InputNumber,{min:1,placeholder:"e.g. 3600",className:"w-full rounded-lg",style:{width:"100%"}})}),r&&(0,_.jsxs)("div",{className:"rounded-lg border border-dashed border-gray-300 p-4 space-y-2",children:[(0,_.jsx)("p",{className:"text-sm text-gray-600",children:"Use OAuth to fetch a fresh access token and temporarily save it in the session as the authentication value."}),(0,_.jsx)(S.Button,{variant:"secondary",onClick:r.startOAuthFlow,disabled:"authorizing"===r.status||"exchanging"===r.status,children:"authorizing"===r.status?"Waiting for authorization...":"exchanging"===r.status?"Exchanging authorization code...":"Authorize & Fetch Token"}),r.error&&(0,_.jsx)("p",{className:"text-sm text-red-500",children:r.error}),"success"===r.status&&r.tokenResponse?.access_token&&(0,_.jsxs)("p",{className:"text-sm text-green-600",children:["Token fetched. Expires in ",r.tokenResponse.expires_in??"?"," seconds."]})]})]})]})};var LZ=e.i(906579),L0=e.i(458505);let L1=({value:e={},onChange:t,tools:r=[],disabled:a=!1})=>(0,_.jsx)(P.Card,{children:(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,_.jsx)(L0.DollarOutlined,{className:"text-green-600"}),(0,_.jsx)(X.Title,{children:"Cost Configuration"}),(0,_.jsx)(tB.Tooltip,{title:"Configure costs for this MCP server's tool calls. Set a default rate and per-tool overrides.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"text-gray-400"})})]}),(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:["Default Cost per Query ($)",(0,_.jsx)(tB.Tooltip,{title:"Default cost charged for each tool call to this server.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-1 text-gray-400"})})]}),(0,_.jsx)(tq.InputNumber,{min:0,step:1e-4,precision:4,placeholder:"0.0000",value:e.default_cost_per_query,onChange:r=>{let a={...e,default_cost_per_query:r};t?.(a)},disabled:a,style:{width:"200px"},addonBefore:"$"}),(0,_.jsx)(Z.Text,{className:"block mt-1 text-gray-500 text-sm",children:"Set a default cost for all tool calls to this server"})]}),r.length>0&&(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsxs)("label",{className:"block text-sm font-medium text-gray-700",children:["Tool-Specific Costs ($)",(0,_.jsx)(tB.Tooltip,{title:"Override the default cost for specific tools. Leave blank to use the default rate.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-1 text-gray-400"})})]}),(0,_.jsx)(tl.Collapse,{items:[{key:"1",label:(0,_.jsxs)("div",{className:"flex items-center",children:[(0,_.jsx)(Nd.ToolOutlined,{className:"mr-2 text-blue-500"}),(0,_.jsx)("span",{className:"font-medium",children:"Available Tools"}),(0,_.jsx)(LZ.Badge,{count:r.length,style:{backgroundColor:"#52c41a",marginLeft:"8px"}})]}),children:(0,_.jsx)("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:r.map((r,s)=>(0,_.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg",children:[(0,_.jsxs)("div",{className:"flex-1",children:[(0,_.jsx)(Z.Text,{className:"font-medium text-gray-900",children:r.name}),r.description&&(0,_.jsx)(Z.Text,{className:"text-gray-500 text-sm block mt-1",children:r.description})]}),(0,_.jsx)("div",{className:"ml-4",children:(0,_.jsx)(tq.InputNumber,{min:0,step:1e-4,precision:4,placeholder:"Use default",value:e.tool_name_to_cost_per_query?.[r.name],onChange:a=>{var s;let n;return s=r.name,n={...e,tool_name_to_cost_per_query:{...e.tool_name_to_cost_per_query,[s]:a}},void t?.(n)},disabled:a,style:{width:"120px"},addonBefore:"$"})})]},s))})}]})]})]}),(e.default_cost_per_query||e.tool_name_to_cost_per_query&&Object.keys(e.tool_name_to_cost_per_query).length>0)&&(0,_.jsxs)("div",{className:"mt-6 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,_.jsx)(Z.Text,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,_.jsxs)("div",{className:"mt-2 space-y-1",children:[e.default_cost_per_query&&(0,_.jsxs)(Z.Text,{className:"text-blue-700",children:["• Default cost: $",e.default_cost_per_query.toFixed(4)," per query"]}),e.tool_name_to_cost_per_query&&Object.entries(e.tool_name_to_cost_per_query).map(([e,t])=>null!=t&&(0,_.jsxs)(Z.Text,{className:"text-blue-700",children:["• ",e,": $",t.toFixed(4)," per query"]},e))]})]})]})}),L2=({formValues:e,tools:t,isLoadingTools:r,toolsError:a,toolsErrorStackTrace:s,canFetchTools:n,fetchTools:l})=>n||e.url||e.spec_path?(0,_.jsx)(P.Card,{children:(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(tz.CheckCircleOutlined,{className:"text-blue-600"}),(0,_.jsx)(X.Title,{children:"Connection Status"})]}),!n&&(e.url||e.spec_path)&&(0,_.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,_.jsx)(Nd.ToolOutlined,{className:"text-2xl mb-2"}),(0,_.jsx)(Z.Text,{children:"Complete required fields to test connection"}),(0,_.jsx)("br",{}),(0,_.jsx)(Z.Text,{className:"text-sm",children:"Fill in URL, Transport, and Authentication to test MCP server connection"})]}),n&&(0,_.jsxs)("div",{children:[(0,_.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-gray-700 font-medium",children:r?"Testing connection to MCP server...":t.length>0?"Connection successful":a?"Connection failed":"Ready to test connection"}),(0,_.jsx)("br",{}),(0,_.jsxs)(Z.Text,{className:"text-gray-500 text-sm",children:["Server: ",e.url||e.spec_path]})]}),r&&(0,_.jsxs)("div",{className:"flex items-center text-blue-600",children:[(0,_.jsx)(rm.Spin,{size:"small",className:"mr-2"}),(0,_.jsx)(Z.Text,{className:"text-blue-600",children:"Connecting..."})]}),!r&&!a&&t.length>0&&(0,_.jsxs)("div",{className:"flex items-center text-green-600",children:[(0,_.jsx)(tz.CheckCircleOutlined,{className:"mr-1"}),(0,_.jsx)(Z.Text,{className:"text-green-600 font-medium",children:"Connected"})]}),a&&(0,_.jsxs)("div",{className:"flex items-center text-red-600",children:[(0,_.jsx)(eo.ExclamationCircleOutlined,{className:"mr-1"}),(0,_.jsx)(Z.Text,{className:"text-red-600 font-medium",children:"Failed"})]})]}),r&&(0,_.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,_.jsx)(rm.Spin,{size:"large"}),(0,_.jsx)(Z.Text,{className:"ml-3",children:"Testing connection and loading tools..."})]}),a&&(0,_.jsx)(B.Alert,{message:"Connection Failed",description:(0,_.jsxs)("div",{children:[(0,_.jsx)("div",{children:a}),s&&(0,_.jsx)(tl.Collapse,{items:[{key:"stack-trace",label:"Stack Trace",children:(0,_.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:"12px",fontFamily:"monospace",margin:0,padding:"8px",backgroundColor:"#f5f5f5",borderRadius:"4px",maxHeight:"400px",overflow:"auto"},children:s})}],style:{marginTop:"12px"}})]}),type:"error",showIcon:!0,action:(0,_.jsx)(z.Button,{icon:(0,_.jsx)(rg.ReloadOutlined,{}),onClick:l,size:"small",children:"Retry"})}),!r&&0===t.length&&!a&&(0,_.jsxs)("div",{className:"text-center py-6 text-gray-500 border rounded-lg border-dashed",children:[(0,_.jsx)(tz.CheckCircleOutlined,{className:"text-2xl mb-2 text-green-500"}),(0,_.jsx)(Z.Text,{className:"text-green-600 font-medium",children:"Connection successful!"}),(0,_.jsx)("br",{}),(0,_.jsx)(Z.Text,{className:"text-gray-500",children:"No tools found for this MCP server"})]})]})]})}):null,L4=({accessToken:e,oauthAccessToken:t,formValues:r,enabled:a=!0})=>{let[s,n]=(0,T.useState)([]),[l,i]=(0,T.useState)(!1),[o,d]=(0,T.useState)(null),[c,u]=(0,T.useState)(null),[m,p]=(0,T.useState)(!1),h=r.auth_type===LK.AUTH_TYPE.OAUTH2&&r.oauth_flow_type===LK.OAUTH_FLOW.M2M,f=r.auth_type===LK.AUTH_TYPE.OAUTH2&&!h,x=r.transport===LK.TRANSPORT.OPENAPI,g=x?!!r.spec_path:!!r.url,y=x?!!(g&&e):!!(g&&r.transport&&r.auth_type&&e&&(!f||t)),_=JSON.stringify(r.static_headers??{}),b=JSON.stringify(r.credentials??{}),v=async()=>{if(e&&(r.url||r.spec_path)&&(!f||t||x)){i(!0),d(null);try{let a=Array.isArray(r.static_headers)?r.static_headers.reduce((e,t)=>{let r=t?.header?.trim();return r&&(e[r]=t?.value!=null?String(t.value):""),e},{}):!Array.isArray(r.static_headers)&&r.static_headers&&"object"==typeof r.static_headers?Object.entries(r.static_headers).reduce((e,[t,r])=>(t&&(e[t]=null!=r?String(r):""),e),{}):{},s=r.credentials&&"object"==typeof r.credentials?Object.entries(r.credentials).reduce((e,[t,r])=>{if(null==r||""===r)return e;if("scopes"===t){if(Array.isArray(r)){let a=r.filter(e=>null!=e&&""!==e);a.length>0&&(e[t]=a)}}else e[t]=r;return e},{}):void 0,l=r.transport===LK.TRANSPORT.OPENAPI?"http":r.transport,i={server_id:r.server_id||"",server_name:r.server_name||"",url:r.url,spec_path:r.spec_path,transport:l,auth_type:r.auth_type,authorization_url:r.authorization_url,token_url:r.token_url,registration_url:r.registration_url,mcp_info:r.mcp_info,static_headers:a};s&&Object.keys(s).length>0&&(i.credentials=s);let o=await (0,Q.testMCPToolsListRequest)(e,i,t);if(o.tools&&!o.error)n(o.tools),d(null),u(null),o.tools.length>0&&!m&&p(!0);else{let e=o.message||"Failed to retrieve tools list";d(e),u(o.stack_trace||null),n([]),p(!1)}}catch(e){console.error("Tools fetch error:",e),d(e instanceof Error?e.message:String(e)),u(null),n([]),p(!1)}finally{i(!1)}}},j=()=>{n([]),d(null),u(null),p(!1)};return(0,T.useEffect)(()=>{a&&(y?v():j())},[r.url,r.spec_path,r.transport,r.auth_type,e,a,t,y,_,b]),{tools:s,isLoadingTools:l,toolsError:o,toolsErrorStackTrace:c,hasShownSuccessMessage:m,canFetchTools:y,fetchTools:v,clearTools:j}};var L5=e.i(531516);let L6=({tool:e,isEnabled:t,isEditExpanded:r,toolNameToDisplayName:a,toolNameToDescription:s,onToggle:n,onToggleExpand:l,onDisplayNameChange:i,onDescriptionChange:o})=>(0,_.jsxs)("div",{className:`rounded-lg border transition-colors ${t?"bg-blue-50 border-blue-300 hover:border-blue-400":"bg-gray-50 border-gray-200 hover:border-gray-300"}`,children:[(0,_.jsx)("div",{className:"p-4 cursor-pointer",onClick:()=>n(e.name),children:(0,_.jsxs)("div",{className:"flex items-start gap-3",children:[(0,_.jsx)(eA.Checkbox,{checked:t,onChange:()=>n(e.name)}),(0,_.jsxs)("div",{className:"flex-1",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(Z.Text,{className:"font-medium text-gray-900",children:a[e.name]||e.name}),(0,_.jsx)("span",{className:`px-2 py-0.5 text-xs rounded-full font-medium ${t?"bg-green-100 text-green-800":"bg-red-100 text-red-800"}`,children:t?"Enabled":"Disabled"}),a[e.name]&&(0,_.jsx)("span",{className:"px-2 py-0.5 text-xs rounded-full font-medium bg-purple-100 text-purple-800",children:"Custom name"})]}),(s[e.name]||e.description)&&(0,_.jsx)(Z.Text,{className:"text-gray-500 text-sm block mt-1",children:s[e.name]||e.description}),(0,_.jsx)(Z.Text,{className:"text-gray-400 text-xs block mt-1",children:t?"✓ Users can call this tool":"✗ Users cannot call this tool"})]}),(0,_.jsx)("button",{type:"button",onClick:t=>l(e.name,t),className:`p-1.5 rounded-md transition-colors ${r?"bg-blue-100 text-blue-600":"text-gray-400 hover:text-gray-600 hover:bg-gray-100"}`,title:"Edit display name and description",children:(0,_.jsx)(wX.EditOutlined,{})})]})}),r&&(0,_.jsxs)("div",{className:"px-4 pb-4 pt-3 border-t border-gray-200 space-y-3 bg-gray-50 rounded-b-lg",onClick:e=>e.stopPropagation(),children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-xs font-medium text-gray-600 mb-1 block",children:"Display Name"}),(0,_.jsx)($.Input,{placeholder:e.name,value:a[e.name]||"",onChange:t=>i(e.name,t.target.value)}),(0,_.jsx)(Z.Text,{className:"text-xs text-gray-400 mt-1 block",children:"Override how this tool's name appears to users. Leave blank to use original."})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-xs font-medium text-gray-600 mb-1 block",children:"Description"}),(0,_.jsx)($.Input.TextArea,{placeholder:e.description||"No description",value:s[e.name]||"",onChange:t=>o(e.name,t.target.value),rows:2}),(0,_.jsx)(Z.Text,{className:"text-xs text-gray-400 mt-1 block",children:"Override the tool description shown to users. Leave blank to use original."})]})]})]}),L3=({accessToken:e,oauthAccessToken:t,formValues:r,allowedTools:a,existingAllowedTools:s,onAllowedToolsChange:n,toolNameToDisplayName:l,toolNameToDescription:i,onToolNameToDisplayNameChange:o,onToolNameToDescriptionChange:d,hasToolAllowlistInteraction:c=!1,onToolAllowlistInteraction:u,keyTools:m,externalTools:p,externalIsLoading:h,externalError:f,externalCanFetch:x,isEditMode:g=!1})=>{let y=(0,T.useRef)([]),[b,v]=(0,T.useState)(""),[j,w]=(0,T.useState)("crud"),k=(0,T.useRef)(!1),S=(0,T.useRef)(""),[N,M]=(0,T.useState)(new Set),C=void 0!==p,L=L4({accessToken:e,oauthAccessToken:t,formValues:r,enabled:!C}),O=C?p:L.tools,D=C?h??!1:L.isLoadingTools,A=C?f??null:L.toolsError,E=C?x??!1:L.canFetchTools,I=(0,T.useMemo)(()=>{if(!m||0===m.length||0===O.length)return[];let e=new Set,t=[];for(let r of m){let a=r.name.split("_").map(e=>e.toLowerCase()).filter(e=>e.length>1);if(0===a.length)continue;let s=e=>e.toLowerCase().replace(/[-_/]/g," "),n=O.find(t=>{if(e.has(t.name))return!1;let r=s(t.name);return a.every(e=>r.includes(e))});if(!n){let t=a.find(e=>e.length>3)??a[a.length-1];n=O.find(r=>!e.has(r.name)&&s(r.name).includes(t))}n&&(t.push(n),e.add(n.name))}return t},[m,O]),Y=(0,T.useMemo)(()=>new Set(I.map(e=>e.name)),[I]),F=(0,T.useMemo)(()=>O.filter(e=>{let t=b.toLowerCase();return e.name.toLowerCase().includes(t)||e.description&&e.description.toLowerCase().includes(t)}),[O,b]),R=(0,T.useMemo)(()=>F.filter(e=>Y.has(e.name)),[F,Y]),B=(0,T.useMemo)(()=>F.filter(e=>!Y.has(e.name)),[F,Y]);(0,T.useEffect)(()=>{let e=O.map(e=>e.name).sort().join(","),t=y.current.map(e=>e.name).sort().join(","),r=I.map(e=>e.name).sort().join(",");if(r!==S.current&&(S.current=r,""!==r&&(k.current=!1)),O.length>0&&e!==t){let e=O.map(e=>e.name);k.current?n(a.filter(t=>e.includes(t))):(k.current=!0,null!==s?n(s.filter(t=>e.includes(t))):g?n(c?a.filter(t=>e.includes(t)):[]):I.length>0?n(I.map(e=>e.name).filter(t=>e.includes(t))):n(e))}y.current=O},[O,a,s,n,I,c,g]);let z=g&&null===s&&0===a.length&&!c,H=(0,T.useMemo)(()=>z?O.map(e=>e.name):a,[a,z,O]),q=(0,T.useMemo)(()=>new Set(H),[H]),U=e=>{u?.(),n(e)},W=e=>{q.has(e)?U(H.filter(t=>t!==e)):U([...H,e])},V=(e,t)=>{t.stopPropagation(),M(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},G=(e,t)=>{let r={...l};t?r[e]=t:delete r[e],o(r)},K=(e,t)=>{let r={...i};t?r[e]=t:delete r[e],d(r)};return E||r.url||r.spec_path?(0,_.jsx)(P.Card,{children:(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsxs)("div",{className:"flex items-center justify-between",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(Nd.ToolOutlined,{className:"text-blue-600"}),(0,_.jsx)(X.Title,{children:"Tool Configuration"}),O.length>0&&(0,_.jsx)(LZ.Badge,{count:O.length,style:{backgroundColor:"#52c41a"}})]}),O.length>0&&(0,_.jsx)(t$.Radio.Group,{value:j,onChange:e=>w(e.target.value),size:"small",optionType:"button",buttonStyle:"solid",options:[{label:"Risk Groups",value:"crud"},{label:"Flat List",value:"flat"}]})]}),(0,_.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,_.jsxs)(Z.Text,{className:"text-blue-800 text-sm",children:[(0,_.jsx)("strong",{children:"Select which tools users can call:"})," Only checked tools will be available for users to invoke. Unchecked tools will be blocked from execution."]})}),D&&(0,_.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,_.jsx)(rm.Spin,{size:"large"}),(0,_.jsx)(Z.Text,{className:"ml-3",children:"Loading tools from spec..."})]}),A&&!D&&(0,_.jsxs)("div",{className:"text-center py-6 text-red-500 border rounded-lg border-dashed border-red-300 bg-red-50",children:[(0,_.jsx)(Nd.ToolOutlined,{className:"text-2xl mb-2"}),(0,_.jsx)(Z.Text,{className:"text-red-600 font-medium",children:"Unable to load tools"}),(0,_.jsx)("br",{}),(0,_.jsx)(Z.Text,{className:"text-sm text-red-500",children:A})]}),!D&&!A&&0===O.length&&E&&(m&&m.length>0?(0,_.jsxs)("div",{className:"text-center py-4 text-gray-400 border rounded-lg border-dashed",children:[(0,_.jsx)(Nd.ToolOutlined,{className:"text-2xl mb-2"}),(0,_.jsx)(Z.Text,{children:"No tools loaded from spec"}),(0,_.jsxs)(Z.Text,{className:"text-sm block mt-1",children:["Expected tools: ",m.map(e=>e.name).join(", ")]})]}):(0,_.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,_.jsx)(Nd.ToolOutlined,{className:"text-2xl mb-2"}),(0,_.jsx)(Z.Text,{children:"No tools available for configuration"}),(0,_.jsx)("br",{}),(0,_.jsx)(Z.Text,{className:"text-sm",children:"Connect to an MCP server with tools to configure them"})]})),!E&&(r.url||r.spec_path)&&(0,_.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,_.jsx)(Nd.ToolOutlined,{className:"text-2xl mb-2"}),(0,_.jsx)(Z.Text,{children:"Complete required fields to configure tools"}),(0,_.jsx)("br",{}),(0,_.jsx)(Z.Text,{className:"text-sm",children:"Fill in URL, Transport, and Authentication to load available tools"})]}),!D&&!A&&O.length>0&&(0,_.jsxs)("div",{className:"space-y-3",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-green-50 rounded-lg border border-green-200",children:[(0,_.jsx)(tz.CheckCircleOutlined,{className:"text-green-600"}),(0,_.jsxs)(Z.Text,{className:"text-green-700 font-medium",children:[H.length," of ",O.length," ",1===O.length?"tool":"tools"," enabled for user access"]})]}),(0,_.jsx)($.Input,{placeholder:"Search tools by name or description...",prefix:(0,_.jsx)(ry.SearchOutlined,{className:"text-gray-400"}),value:b,onChange:e=>v(e.target.value),allowClear:!0,className:"rounded-lg",size:"large"}),"crud"===j&&(0,_.jsx)(L5.default,{tools:O,searchFilter:b,value:z?void 0:a,onChange:U}),"flat"===j&&(0,_.jsx)(_.Fragment,{children:0===F.length?(0,_.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,_.jsx)(ry.SearchOutlined,{className:"text-2xl mb-2"}),(0,_.jsxs)(Z.Text,{children:['No tools found matching "',b,'"']})]}):(0,_.jsxs)("div",{className:"space-y-2",children:[R.length>0&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("div",{className:"flex items-center justify-between px-1",children:[(0,_.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide",children:"Suggested tools"}),(0,_.jsxs)("div",{className:"flex gap-2",children:[(0,_.jsx)("button",{type:"button",onClick:()=>{let e=I.map(e=>e.name).filter(e=>!q.has(e));0!==e.length&&U([...H,...e])},className:"text-xs text-blue-600 hover:text-blue-700",children:"Enable all"}),(0,_.jsx)("button",{type:"button",onClick:()=>{U(H.filter(e=>!Y.has(e)))},className:"text-xs text-gray-500 hover:text-gray-700",children:"Disable all"})]})]}),R.map(e=>(0,_.jsx)(L6,{tool:e,isEnabled:q.has(e.name),isEditExpanded:N.has(e.name),toolNameToDisplayName:l,toolNameToDescription:i,onToggle:W,onToggleExpand:V,onDisplayNameChange:G,onDescriptionChange:K},e.name))]}),B.length>0&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("div",{className:"flex items-center justify-between px-1 pt-2",children:[(0,_.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide",children:R.length>0?"All tools":"Tools"}),(0,_.jsxs)("div",{className:"flex gap-2",children:[(0,_.jsx)("button",{type:"button",onClick:()=>{let e=O.filter(e=>!Y.has(e.name)).map(e=>e.name).filter(e=>!q.has(e));0!==e.length&&U([...H,...e])},className:"text-xs text-blue-600 hover:text-blue-700",children:"Enable all"}),(0,_.jsx)("button",{type:"button",onClick:()=>{U(H.filter(e=>Y.has(e)))},className:"text-xs text-gray-500 hover:text-gray-700",children:"Disable all"})]})]}),B.map(e=>(0,_.jsx)(L6,{tool:e,isEnabled:q.has(e.name),isEditExpanded:N.has(e.name),toolNameToDisplayName:l,toolNameToDescription:i,onToggle:W,onToggleExpand:V,onDisplayNameChange:G,onDescriptionChange:K},e.name))]})]})})]})]})}):null},L8=({isVisible:e,required:t=!0})=>e?(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Stdio Configuration (JSON)",(0,_.jsx)(tB.Tooltip,{title:"Paste your stdio MCP server configuration in JSON format. You can use the full mcpServers structure from config.yaml or just the inner server configuration.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"stdio_config",rules:[...t?[{required:!0,message:"Please enter stdio configuration"}]:[],{validator:(e,t)=>{if(!t)return Promise.resolve();try{return JSON.parse(t),Promise.resolve()}catch{return Promise.reject("Please enter valid JSON")}}}],children:(0,_.jsx)($.Input.TextArea,{placeholder:`{ +}`,s=async()=>{try{await navigator.clipboard.writeText(a),t(!0),setTimeout(()=>t(!1),1500)}catch{}};return(0,_.jsxs)("div",{className:"mb-6 rounded-lg border border-gray-200 bg-gray-50 px-5 py-4",children:[(0,_.jsx)("p",{className:"text-sm font-medium text-gray-700 mb-1",children:"How toolsets work"}),(0,_.jsxs)("p",{className:"text-sm text-gray-500 mb-3",children:["Create a toolset, assign it to a key via"," ",(0,_.jsx)("span",{className:"font-medium text-gray-700",children:"API Keys → Edit Key → MCP Servers"}),", then point your MCP client at the toolset URL. The client only sees the tools you picked."]}),(0,_.jsx)("div",{className:"text-xs text-gray-400 mb-1",children:"Claude Code / Cursor config"}),(0,_.jsxs)("div",{className:"relative",children:[(0,_.jsx)("pre",{className:"bg-white border border-gray-200 rounded px-4 py-3 text-xs font-mono text-gray-700 overflow-x-auto leading-relaxed pr-14",children:a}),(0,_.jsx)("button",{type:"button",onClick:s,className:"absolute top-2 right-2 px-2 py-1 text-xs rounded border bg-white hover:bg-gray-50 text-gray-400 hover:text-gray-600 border-gray-200 transition-colors",children:e?"✓":"copy"})]})]})}function LV({accessToken:e,userRole:t}){let r=(0,eh.useQueryClient)(),{data:a=[],isLoading:s}=(0,Lz.useMCPToolsets)(),[n,l]=(0,T.useState)(!1),[i,o]=(0,T.useState)(null),[d,c]=(0,T.useState)(null),[u,m]=(0,T.useState)(!1),p="Admin"===t||"proxy_admin"===t,h=async(t,a,s)=>{e&&(await (0,Q.createMCPToolset)(e,{toolset_name:t,description:a,tools:s}),LB.message.success("Toolset created"),r.invalidateQueries({queryKey:["mcpToolsets"]}))},f=async(t,a,s)=>{e&&i&&(await (0,Q.updateMCPToolset)(e,{toolset_id:i.toolset_id,toolset_name:t,description:a,tools:s}),LB.message.success("Toolset updated"),r.invalidateQueries({queryKey:["mcpToolsets"]}),o(null))},x=async()=>{if(e&&d){m(!0);try{await (0,Q.deleteMCPToolset)(e,d),LB.message.success("Toolset deleted"),r.invalidateQueries({queryKey:["mcpToolsets"]}),c(null)}finally{m(!1)}}},g=(0,Q.getProxyBaseUrl)(),y=[{header:"Toolset ID",accessorKey:"toolset_id",cell:({row:e})=>(0,_.jsxs)("span",{className:"font-mono text-xs bg-gray-100 px-2 py-0.5 rounded text-gray-600",children:[e.original.toolset_id.slice(0,8),"…"]})},{header:"Name",accessorKey:"toolset_name",cell:({row:e})=>{let t=`${g}/toolset/${e.original.toolset_name}/mcp`;return(0,_.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("span",{className:"inline-block w-2 h-2 rounded-full bg-purple-500 flex-shrink-0"}),(0,_.jsx)("span",{className:"font-medium text-gray-900",children:e.original.toolset_name})]}),(0,_.jsx)("button",{type:"button",className:"text-xs text-gray-400 hover:text-purple-600 font-mono truncate max-w-xs text-left transition-colors",onClick:()=>navigator.clipboard.writeText(t),title:"Click to copy endpoint URL",children:t})]})}},{header:"Description",accessorKey:"description",cell:({row:e})=>(0,_.jsx)("span",{className:"text-sm text-gray-500",children:e.original.description||"—"})},{header:"Tools",accessorKey:"tools",cell:({row:e})=>{let t=e.original.tools;return(0,_.jsxs)("div",{className:"flex flex-wrap gap-1 max-w-xs",children:[t.slice(0,4).map((e,t)=>(0,_.jsx)("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded bg-purple-50 border border-purple-200 text-purple-700 text-xs",children:e.tool_name},t)),t.length>4&&(0,_.jsxs)("span",{className:"text-xs text-gray-400 self-center",children:["+",t.length-4," more"]})]})}},{header:"Created",accessorKey:"created_at",cell:({row:e})=>(0,_.jsx)("span",{className:"text-xs text-gray-500",children:e.original.created_at?new Date(e.original.created_at).toLocaleDateString():"—"})},...p?[{header:"",id:"actions",cell:({row:e})=>(0,_.jsxs)("div",{className:"flex items-center gap-1 justify-end",children:[(0,_.jsx)("button",{type:"button",className:"p-1.5 rounded-lg hover:bg-gray-100 text-gray-400 hover:text-gray-700 transition-colors",onClick:()=>o(e.original),children:(0,_.jsx)(CC.PencilIcon,{className:"h-4 w-4"})}),(0,_.jsx)("button",{type:"button",className:"p-1.5 rounded-lg hover:bg-red-50 text-gray-400 hover:text-red-500 transition-colors",onClick:()=>c(e.original.toolset_id),children:(0,_.jsx)(jO.TrashIcon,{className:"h-4 w-4"})})]})}]:[]];return(0,_.jsxs)("div",{className:"mt-4",children:[(0,_.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(X.Title,{children:"MCP Toolsets"}),(0,_.jsx)(Z.Text,{className:"text-gray-500 text-sm",children:"Curated collections of tools from one or more MCP servers. Assign toolsets to keys and teams via the MCP permissions dropdown."})]}),p&&(0,_.jsx)(S.Button,{icon:CO.PlusIcon,onClick:()=>l(!0),children:"New Toolset"})]}),(0,_.jsx)(LW,{}),(0,_.jsx)(LH.DataTable,{data:a,columns:y,renderSubComponent:()=>(0,_.jsx)("div",{}),getRowCanExpand:()=>!1,isLoading:s,noDataMessage:"No toolsets yet. Click 'New Toolset' to create one.",loadingMessage:"Loading toolsets...",enableSorting:!0}),(0,_.jsx)(LU,{open:n,onClose:()=>l(!1),onSave:h,accessToken:e}),i&&(0,_.jsx)(LU,{open:!!i,onClose:()=>o(null),onSave:f,accessToken:e,initialToolset:i}),(0,_.jsx)(q.Modal,{open:!!d,onCancel:()=>c(null),onOk:x,okText:"Delete",okButtonProps:{danger:!0,loading:u},title:"Delete Toolset",children:(0,_.jsx)("p",{children:"Are you sure you want to delete this toolset? Keys and teams using it will lose access to the scoped tools."})})]})}var LG=e.i(909119),LK=e.i(292335);let LJ="rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500",LQ=({label:e,tooltip:t})=>(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:[e,(0,_.jsx)(tB.Tooltip,{title:t,children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),LX=({isM2M:e,isEditing:t=!1,oauthFlow:r,initialFlowType:a,docsUrl:s})=>{let n=t?" (leave blank to keep existing)":"";return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"OAuth Flow Type",tooltip:"Choose how the proxy authenticates with this MCP server. M2M is for server-to-server communication using client credentials. Interactive (PKCE) is for user-facing flows that require browser-based authorization."}),name:"oauth_flow_type",...a?{initialValue:a}:{},children:(0,_.jsxs)(eE.Select,{className:"rounded-lg",size:"large",children:[(0,_.jsx)(eE.Select.Option,{value:LK.OAUTH_FLOW.M2M,children:(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{className:"font-medium",children:"Machine-to-Machine (M2M)"}),(0,_.jsx)("span",{className:"text-gray-400 text-xs ml-2",children:"server-to-server, no user interaction"})]})}),(0,_.jsx)(eE.Select.Option,{value:LK.OAUTH_FLOW.INTERACTIVE,children:(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{className:"font-medium",children:"Interactive (PKCE)"}),(0,_.jsx)("span",{className:"text-gray-400 text-xs ml-2",children:"browser-based user authorization"})]})})]})}),e?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"Client ID",tooltip:"OAuth2 client ID for the client_credentials grant."}),name:["credentials","client_id"],rules:[{required:!0,message:"Client ID is required for M2M OAuth"}],children:(0,_.jsx)(et.TextInput,{type:"password",placeholder:`Enter OAuth client ID${n}`,className:LJ})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"Client Secret",tooltip:"OAuth2 client secret for the client_credentials grant."}),name:["credentials","client_secret"],rules:[{required:!0,message:"Client Secret is required for M2M OAuth"}],children:(0,_.jsx)(et.TextInput,{type:"password",placeholder:`Enter OAuth client secret${n}`,className:LJ})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"Token URL",tooltip:"Token endpoint URL for the client_credentials grant."}),name:"token_url",rules:[{required:!0,message:"Token URL is required for M2M OAuth"}],children:(0,_.jsx)(et.TextInput,{placeholder:"https://auth.example.com/oauth/token",className:LJ})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"Scopes (optional)",tooltip:"Optional scopes to request with the client_credentials grant."}),name:["credentials","scopes"],children:(0,_.jsx)(eE.Select,{mode:"tags",tokenSeparators:[","],placeholder:"Add scopes",className:"rounded-lg",size:"large"})})]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"flex items-center justify-between w-full",children:[(0,_.jsx)(LQ,{label:"Client ID (optional)",tooltip:"Provide only if your MCP server cannot handle dynamic client registration."}),s&&(0,_.jsx)("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-blue-500 hover:text-blue-700 ml-2 font-normal",onClick:e=>e.stopPropagation(),children:"Create OAuth App →"})]}),name:["credentials","client_id"],children:(0,_.jsx)(et.TextInput,{type:"password",placeholder:`Enter client ID${n}`,className:LJ})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"Client Secret (optional)",tooltip:"Provide only if your MCP server cannot handle dynamic client registration."}),name:["credentials","client_secret"],children:(0,_.jsx)(et.TextInput,{type:"password",placeholder:`Enter client secret${n}`,className:LJ})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"Scopes (optional)",tooltip:"Optional scopes requested during token exchange. Separate multiple scopes with enter or commas."}),name:["credentials","scopes"],children:(0,_.jsx)(eE.Select,{mode:"tags",tokenSeparators:[","],placeholder:"Add scopes",className:"rounded-lg",size:"large"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"Authorization URL (optional)",tooltip:"Optional override for the authorization endpoint."}),name:"authorization_url",children:(0,_.jsx)(et.TextInput,{placeholder:"https://example.com/oauth/authorize",className:LJ})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"Token URL (optional)",tooltip:"Optional override for the token endpoint."}),name:"token_url",children:(0,_.jsx)(et.TextInput,{placeholder:"https://example.com/oauth/token",className:LJ})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"Registration URL (optional)",tooltip:"Optional override for the dynamic client registration endpoint."}),name:"registration_url",children:(0,_.jsx)(et.TextInput,{placeholder:"https://example.com/oauth/register",className:LJ})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"Token Validation Rules (optional)",tooltip:'JSON object of key-value rules checked against the OAuth token response before storing. Supports dot-notation for nested fields (e.g. {"organization": "my-org", "team.id": "123"}). Tokens that fail validation are rejected with HTTP 403.'}),name:"token_validation_json",rules:[{validator:(e,t)=>{if(!t||""===t.trim())return Promise.resolve();try{return JSON.parse(t),Promise.resolve()}catch{return Promise.reject(Error("Must be valid JSON"))}}}],children:(0,_.jsx)($.Input.TextArea,{placeholder:'{\n "organization": "my-org",\n "team.id": "123"\n}',rows:4,className:"font-mono text-sm rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)(LQ,{label:"Token Storage TTL (seconds, optional)",tooltip:"How long to cache each user's OAuth access token in Redis before evicting it (regardless of the token's own expires_in). Leave blank to derive the TTL from the token's expires_in, or fall back to the 12-hour default."}),name:"token_storage_ttl_seconds",children:(0,_.jsx)(tq.InputNumber,{min:1,placeholder:"e.g. 3600",className:"w-full rounded-lg",style:{width:"100%"}})}),r&&(0,_.jsxs)("div",{className:"rounded-lg border border-dashed border-gray-300 p-4 space-y-2",children:[(0,_.jsx)("p",{className:"text-sm text-gray-600",children:"Use OAuth to fetch a fresh access token and temporarily save it in the session as the authentication value."}),(0,_.jsx)(S.Button,{variant:"secondary",onClick:r.startOAuthFlow,disabled:"authorizing"===r.status||"exchanging"===r.status,children:"authorizing"===r.status?"Waiting for authorization...":"exchanging"===r.status?"Exchanging authorization code...":"Authorize & Fetch Token"}),r.error&&(0,_.jsx)("p",{className:"text-sm text-red-500",children:r.error}),"success"===r.status&&r.tokenResponse?.access_token&&(0,_.jsxs)("p",{className:"text-sm text-green-600",children:["Token fetched. Expires in ",r.tokenResponse.expires_in??"?"," seconds."]})]})]})]})};var LZ=e.i(906579),L0=e.i(458505);let L1=({value:e={},onChange:t,tools:r=[],disabled:a=!1})=>(0,_.jsx)(P.Card,{children:(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,_.jsx)(L0.DollarOutlined,{className:"text-green-600"}),(0,_.jsx)(X.Title,{children:"Cost Configuration"}),(0,_.jsx)(tB.Tooltip,{title:"Configure costs for this MCP server's tool calls. Set a default rate and per-tool overrides.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"text-gray-400"})})]}),(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:["Default Cost per Query ($)",(0,_.jsx)(tB.Tooltip,{title:"Default cost charged for each tool call to this server.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-1 text-gray-400"})})]}),(0,_.jsx)(tq.InputNumber,{min:0,step:1e-4,precision:4,placeholder:"0.0000",value:e.default_cost_per_query,onChange:r=>{let a={...e,default_cost_per_query:r};t?.(a)},disabled:a,style:{width:"200px"},addonBefore:"$"}),(0,_.jsx)(Z.Text,{className:"block mt-1 text-gray-500 text-sm",children:"Set a default cost for all tool calls to this server"})]}),r.length>0&&(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsxs)("label",{className:"block text-sm font-medium text-gray-700",children:["Tool-Specific Costs ($)",(0,_.jsx)(tB.Tooltip,{title:"Override the default cost for specific tools. Leave blank to use the default rate.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-1 text-gray-400"})})]}),(0,_.jsx)(tl.Collapse,{items:[{key:"1",label:(0,_.jsxs)("div",{className:"flex items-center",children:[(0,_.jsx)(Nd.ToolOutlined,{className:"mr-2 text-blue-500"}),(0,_.jsx)("span",{className:"font-medium",children:"Available Tools"}),(0,_.jsx)(LZ.Badge,{count:r.length,style:{backgroundColor:"#52c41a",marginLeft:"8px"}})]}),children:(0,_.jsx)("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:r.map((r,s)=>(0,_.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg",children:[(0,_.jsxs)("div",{className:"flex-1",children:[(0,_.jsx)(Z.Text,{className:"font-medium text-gray-900",children:r.name}),r.description&&(0,_.jsx)(Z.Text,{className:"text-gray-500 text-sm block mt-1",children:r.description})]}),(0,_.jsx)("div",{className:"ml-4",children:(0,_.jsx)(tq.InputNumber,{min:0,step:1e-4,precision:4,placeholder:"Use default",value:e.tool_name_to_cost_per_query?.[r.name],onChange:a=>{var s;let n;return s=r.name,n={...e,tool_name_to_cost_per_query:{...e.tool_name_to_cost_per_query,[s]:a}},void t?.(n)},disabled:a,style:{width:"120px"},addonBefore:"$"})})]},s))})}]})]})]}),(e.default_cost_per_query||e.tool_name_to_cost_per_query&&Object.keys(e.tool_name_to_cost_per_query).length>0)&&(0,_.jsxs)("div",{className:"mt-6 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,_.jsx)(Z.Text,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,_.jsxs)("div",{className:"mt-2 space-y-1",children:[e.default_cost_per_query&&(0,_.jsxs)(Z.Text,{className:"text-blue-700",children:["• Default cost: $",e.default_cost_per_query.toFixed(4)," per query"]}),e.tool_name_to_cost_per_query&&Object.entries(e.tool_name_to_cost_per_query).map(([e,t])=>null!=t&&(0,_.jsxs)(Z.Text,{className:"text-blue-700",children:["• ",e,": $",t.toFixed(4)," per query"]},e))]})]})]})}),L2=({formValues:e,tools:t,isLoadingTools:r,toolsError:a,toolsErrorStackTrace:s,canFetchTools:n,fetchTools:l})=>n||e.url||e.spec_path?(0,_.jsx)(P.Card,{children:(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(tz.CheckCircleOutlined,{className:"text-blue-600"}),(0,_.jsx)(X.Title,{children:"Connection Status"})]}),!n&&(e.url||e.spec_path)&&(0,_.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,_.jsx)(Nd.ToolOutlined,{className:"text-2xl mb-2"}),(0,_.jsx)(Z.Text,{children:"Complete required fields to test connection"}),(0,_.jsx)("br",{}),(0,_.jsx)(Z.Text,{className:"text-sm",children:"Fill in URL, Transport, and Authentication to test MCP server connection"})]}),n&&(0,_.jsxs)("div",{children:[(0,_.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-gray-700 font-medium",children:r?"Testing connection to MCP server...":t.length>0?"Connection successful":a?"Connection failed":"Ready to test connection"}),(0,_.jsx)("br",{}),(0,_.jsxs)(Z.Text,{className:"text-gray-500 text-sm",children:["Server: ",e.url||e.spec_path]})]}),r&&(0,_.jsxs)("div",{className:"flex items-center text-blue-600",children:[(0,_.jsx)(rm.Spin,{size:"small",className:"mr-2"}),(0,_.jsx)(Z.Text,{className:"text-blue-600",children:"Connecting..."})]}),!r&&!a&&t.length>0&&(0,_.jsxs)("div",{className:"flex items-center text-green-600",children:[(0,_.jsx)(tz.CheckCircleOutlined,{className:"mr-1"}),(0,_.jsx)(Z.Text,{className:"text-green-600 font-medium",children:"Connected"})]}),a&&(0,_.jsxs)("div",{className:"flex items-center text-red-600",children:[(0,_.jsx)(eo.ExclamationCircleOutlined,{className:"mr-1"}),(0,_.jsx)(Z.Text,{className:"text-red-600 font-medium",children:"Failed"})]})]}),r&&(0,_.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,_.jsx)(rm.Spin,{size:"large"}),(0,_.jsx)(Z.Text,{className:"ml-3",children:"Testing connection and loading tools..."})]}),a&&(0,_.jsx)(B.Alert,{message:"Connection Failed",description:(0,_.jsxs)("div",{children:[(0,_.jsx)("div",{children:a}),s&&(0,_.jsx)(tl.Collapse,{items:[{key:"stack-trace",label:"Stack Trace",children:(0,_.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:"12px",fontFamily:"monospace",margin:0,padding:"8px",backgroundColor:"#f5f5f5",borderRadius:"4px",maxHeight:"400px",overflow:"auto"},children:s})}],style:{marginTop:"12px"}})]}),type:"error",showIcon:!0,action:(0,_.jsx)(z.Button,{icon:(0,_.jsx)(rg.ReloadOutlined,{}),onClick:l,size:"small",children:"Retry"})}),!r&&0===t.length&&!a&&(0,_.jsxs)("div",{className:"text-center py-6 text-gray-500 border rounded-lg border-dashed",children:[(0,_.jsx)(tz.CheckCircleOutlined,{className:"text-2xl mb-2 text-green-500"}),(0,_.jsx)(Z.Text,{className:"text-green-600 font-medium",children:"Connection successful!"}),(0,_.jsx)("br",{}),(0,_.jsx)(Z.Text,{className:"text-gray-500",children:"No tools found for this MCP server"})]})]})]})}):null;var L4=e.i(531516);let L5=({tool:e,isEnabled:t,isEditExpanded:r,toolNameToDisplayName:a,toolNameToDescription:s,onToggle:n,onToggleExpand:l,onDisplayNameChange:i,onDescriptionChange:o})=>(0,_.jsxs)("div",{className:`rounded-lg border transition-colors ${t?"bg-blue-50 border-blue-300 hover:border-blue-400":"bg-gray-50 border-gray-200 hover:border-gray-300"}`,children:[(0,_.jsx)("div",{className:"p-4 cursor-pointer",onClick:()=>n(e.name),children:(0,_.jsxs)("div",{className:"flex items-start gap-3",children:[(0,_.jsx)(eA.Checkbox,{checked:t,onChange:()=>n(e.name)}),(0,_.jsxs)("div",{className:"flex-1",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(Z.Text,{className:"font-medium text-gray-900",children:a[e.name]||e.name}),(0,_.jsx)("span",{className:`px-2 py-0.5 text-xs rounded-full font-medium ${t?"bg-green-100 text-green-800":"bg-red-100 text-red-800"}`,children:t?"Enabled":"Disabled"}),a[e.name]&&(0,_.jsx)("span",{className:"px-2 py-0.5 text-xs rounded-full font-medium bg-purple-100 text-purple-800",children:"Custom name"})]}),(s[e.name]||e.description)&&(0,_.jsx)(Z.Text,{className:"text-gray-500 text-sm block mt-1",children:s[e.name]||e.description}),(0,_.jsx)(Z.Text,{className:"text-gray-400 text-xs block mt-1",children:t?"✓ Users can call this tool":"✗ Users cannot call this tool"})]}),(0,_.jsx)("button",{type:"button",onClick:t=>l(e.name,t),className:`p-1.5 rounded-md transition-colors ${r?"bg-blue-100 text-blue-600":"text-gray-400 hover:text-gray-600 hover:bg-gray-100"}`,title:"Edit display name and description",children:(0,_.jsx)(wX.EditOutlined,{})})]})}),r&&(0,_.jsxs)("div",{className:"px-4 pb-4 pt-3 border-t border-gray-200 space-y-3 bg-gray-50 rounded-b-lg",onClick:e=>e.stopPropagation(),children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-xs font-medium text-gray-600 mb-1 block",children:"Display Name"}),(0,_.jsx)($.Input,{placeholder:e.name,value:a[e.name]||"",onChange:t=>i(e.name,t.target.value)}),(0,_.jsx)(Z.Text,{className:"text-xs text-gray-400 mt-1 block",children:"Override how this tool's name appears to users. Leave blank to use original."})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-xs font-medium text-gray-600 mb-1 block",children:"Description"}),(0,_.jsx)($.Input.TextArea,{placeholder:e.description||"No description",value:s[e.name]||"",onChange:t=>o(e.name,t.target.value),rows:2}),(0,_.jsx)(Z.Text,{className:"text-xs text-gray-400 mt-1 block",children:"Override the tool description shown to users. Leave blank to use original."})]})]})]}),L6=({accessToken:e,formValues:t,allowedTools:r,existingAllowedTools:a,onAllowedToolsChange:s,toolNameToDisplayName:n,toolNameToDescription:l,onToolNameToDisplayNameChange:i,onToolNameToDescriptionChange:o,hasToolAllowlistInteraction:d=!1,onToolAllowlistInteraction:c,keyTools:u,externalTools:m,externalIsLoading:p,externalError:h,externalCanFetch:f,isEditMode:x=!1})=>{let g=(0,T.useRef)([]),[y,b]=(0,T.useState)(""),[v,j]=(0,T.useState)("crud"),w=(0,T.useRef)(!1),k=(0,T.useRef)(""),[S,N]=(0,T.useState)(new Set),M=m??[],C=p??!1,L=h??null,O=f??!1,D=(0,T.useMemo)(()=>{if(!u||0===u.length||0===M.length)return[];let e=new Set,t=[];for(let r of u){let a=r.name.split("_").map(e=>e.toLowerCase()).filter(e=>e.length>1);if(0===a.length)continue;let s=e=>e.toLowerCase().replace(/[-_/]/g," "),n=M.find(t=>{if(e.has(t.name))return!1;let r=s(t.name);return a.every(e=>r.includes(e))});if(!n){let t=a.find(e=>e.length>3)??a[a.length-1];n=M.find(r=>!e.has(r.name)&&s(r.name).includes(t))}n&&(t.push(n),e.add(n.name))}return t},[u,M]),A=(0,T.useMemo)(()=>new Set(D.map(e=>e.name)),[D]),E=(0,T.useMemo)(()=>M.filter(e=>{let t=y.toLowerCase();return e.name.toLowerCase().includes(t)||e.description&&e.description.toLowerCase().includes(t)}),[M,y]),I=(0,T.useMemo)(()=>E.filter(e=>A.has(e.name)),[E,A]),Y=(0,T.useMemo)(()=>E.filter(e=>!A.has(e.name)),[E,A]);(0,T.useEffect)(()=>{let e=M.map(e=>e.name).sort().join(","),t=g.current.map(e=>e.name).sort().join(","),n=D.map(e=>e.name).sort().join(",");if(n!==k.current&&(k.current=n,""!==n&&(w.current=!1)),M.length>0&&e!==t){let e=M.map(e=>e.name);w.current?s(r.filter(t=>e.includes(t))):(w.current=!0,null!==a?s(a.filter(t=>e.includes(t))):x?s(d?r.filter(t=>e.includes(t)):[]):D.length>0?s(D.map(e=>e.name).filter(t=>e.includes(t))):s(e))}g.current=M},[M,r,a,s,D,d,x]);let F=x&&null===a&&0===r.length&&!d,R=(0,T.useMemo)(()=>F?M.map(e=>e.name):r,[r,F,M]),B=(0,T.useMemo)(()=>new Set(R),[R]),z=e=>{c?.(),s(e)},H=e=>{B.has(e)?z(R.filter(t=>t!==e)):z([...R,e])},q=(e,t)=>{t.stopPropagation(),N(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},U=(e,t)=>{let r={...n};t?r[e]=t:delete r[e],i(r)},W=(e,t)=>{let r={...l};t?r[e]=t:delete r[e],o(r)};return O||t.url||t.spec_path?(0,_.jsx)(P.Card,{children:(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsxs)("div",{className:"flex items-center justify-between",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(Nd.ToolOutlined,{className:"text-blue-600"}),(0,_.jsx)(X.Title,{children:"Tool Configuration"}),M.length>0&&(0,_.jsx)(LZ.Badge,{count:M.length,style:{backgroundColor:"#52c41a"}})]}),M.length>0&&(0,_.jsx)(t$.Radio.Group,{value:v,onChange:e=>j(e.target.value),size:"small",optionType:"button",buttonStyle:"solid",options:[{label:"Risk Groups",value:"crud"},{label:"Flat List",value:"flat"}]})]}),(0,_.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,_.jsxs)(Z.Text,{className:"text-blue-800 text-sm",children:[(0,_.jsx)("strong",{children:"Select which tools users can call:"})," Only checked tools will be available for users to invoke. Unchecked tools will be blocked from execution."]})}),C&&(0,_.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,_.jsx)(rm.Spin,{size:"large"}),(0,_.jsx)(Z.Text,{className:"ml-3",children:"Loading tools from spec..."})]}),L&&!C&&(0,_.jsxs)("div",{className:"text-center py-6 text-red-500 border rounded-lg border-dashed border-red-300 bg-red-50",children:[(0,_.jsx)(Nd.ToolOutlined,{className:"text-2xl mb-2"}),(0,_.jsx)(Z.Text,{className:"text-red-600 font-medium",children:"Unable to load tools"}),(0,_.jsx)("br",{}),(0,_.jsx)(Z.Text,{className:"text-sm text-red-500",children:L})]}),!C&&!L&&0===M.length&&O&&(u&&u.length>0?(0,_.jsxs)("div",{className:"text-center py-4 text-gray-400 border rounded-lg border-dashed",children:[(0,_.jsx)(Nd.ToolOutlined,{className:"text-2xl mb-2"}),(0,_.jsx)(Z.Text,{children:"No tools loaded from spec"}),(0,_.jsxs)(Z.Text,{className:"text-sm block mt-1",children:["Expected tools: ",u.map(e=>e.name).join(", ")]})]}):(0,_.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,_.jsx)(Nd.ToolOutlined,{className:"text-2xl mb-2"}),(0,_.jsx)(Z.Text,{children:"No tools available for configuration"}),(0,_.jsx)("br",{}),(0,_.jsx)(Z.Text,{className:"text-sm",children:"Connect to an MCP server with tools to configure them"})]})),!O&&(t.url||t.spec_path)&&(0,_.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,_.jsx)(Nd.ToolOutlined,{className:"text-2xl mb-2"}),(0,_.jsx)(Z.Text,{children:"Complete required fields to configure tools"}),(0,_.jsx)("br",{}),(0,_.jsx)(Z.Text,{className:"text-sm",children:"Fill in URL, Transport, and Authentication to load available tools"})]}),!C&&!L&&M.length>0&&(0,_.jsxs)("div",{className:"space-y-3",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-green-50 rounded-lg border border-green-200",children:[(0,_.jsx)(tz.CheckCircleOutlined,{className:"text-green-600"}),(0,_.jsxs)(Z.Text,{className:"text-green-700 font-medium",children:[R.length," of ",M.length," ",1===M.length?"tool":"tools"," enabled for user access"]})]}),(0,_.jsx)($.Input,{placeholder:"Search tools by name or description...",prefix:(0,_.jsx)(ry.SearchOutlined,{className:"text-gray-400"}),value:y,onChange:e=>b(e.target.value),allowClear:!0,className:"rounded-lg",size:"large"}),"crud"===v&&(0,_.jsx)(L4.default,{tools:M,searchFilter:y,value:F?void 0:r,onChange:z}),"flat"===v&&(0,_.jsx)(_.Fragment,{children:0===E.length?(0,_.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,_.jsx)(ry.SearchOutlined,{className:"text-2xl mb-2"}),(0,_.jsxs)(Z.Text,{children:['No tools found matching "',y,'"']})]}):(0,_.jsxs)("div",{className:"space-y-2",children:[I.length>0&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("div",{className:"flex items-center justify-between px-1",children:[(0,_.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide",children:"Suggested tools"}),(0,_.jsxs)("div",{className:"flex gap-2",children:[(0,_.jsx)("button",{type:"button",onClick:()=>{let e=D.map(e=>e.name).filter(e=>!B.has(e));0!==e.length&&z([...R,...e])},className:"text-xs text-blue-600 hover:text-blue-700",children:"Enable all"}),(0,_.jsx)("button",{type:"button",onClick:()=>{z(R.filter(e=>!A.has(e)))},className:"text-xs text-gray-500 hover:text-gray-700",children:"Disable all"})]})]}),I.map(e=>(0,_.jsx)(L5,{tool:e,isEnabled:B.has(e.name),isEditExpanded:S.has(e.name),toolNameToDisplayName:n,toolNameToDescription:l,onToggle:H,onToggleExpand:q,onDisplayNameChange:U,onDescriptionChange:W},e.name))]}),Y.length>0&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("div",{className:"flex items-center justify-between px-1 pt-2",children:[(0,_.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide",children:I.length>0?"All tools":"Tools"}),(0,_.jsxs)("div",{className:"flex gap-2",children:[(0,_.jsx)("button",{type:"button",onClick:()=>{let e=M.filter(e=>!A.has(e.name)).map(e=>e.name).filter(e=>!B.has(e));0!==e.length&&z([...R,...e])},className:"text-xs text-blue-600 hover:text-blue-700",children:"Enable all"}),(0,_.jsx)("button",{type:"button",onClick:()=>{z(R.filter(e=>A.has(e)))},className:"text-xs text-gray-500 hover:text-gray-700",children:"Disable all"})]})]}),Y.map(e=>(0,_.jsx)(L5,{tool:e,isEnabled:B.has(e.name),isEditExpanded:S.has(e.name),toolNameToDisplayName:n,toolNameToDescription:l,onToggle:H,onToggleExpand:q,onDisplayNameChange:U,onDescriptionChange:W},e.name))]})]})})]})]})}):null},L3=({isVisible:e,required:t=!0})=>e?(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Stdio Configuration (JSON)",(0,_.jsx)(tB.Tooltip,{title:"Paste your stdio MCP server configuration in JSON format. You can use the full mcpServers structure from config.yaml or just the inner server configuration.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"stdio_config",rules:[...t?[{required:!0,message:"Please enter stdio configuration"}]:[],{validator:(e,t)=>{if(!t)return Promise.resolve();try{return JSON.parse(t),Promise.resolve()}catch{return Promise.reject("Please enter valid JSON")}}}],children:(0,_.jsx)($.Input.TextArea,{placeholder:`{ "mcpServers": { "circleci-mcp-server": { "command": "npx", @@ -402,9 +402,9 @@ Return a structured verdict with confidence and justification.`,kx=`{ } } } -}`,rows:12,className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500 font-mono text-sm"})}):null,{Panel:L7}=tl.Collapse,L9=({availableAccessGroups:e,mcpServer:t,searchValue:r,setSearchValue:a,getAccessGroupOptions:s})=>{let n=H.Form.useFormInstance(),l=H.Form.useWatch("auth_type",n),i=l===LK.AUTH_TYPE.OAUTH2,o=l===LK.AUTH_TYPE.NONE||null==l,d=H.Form.useWatch("extra_headers",n),c=Array.isArray(d)&&d.some(e=>"string"==typeof e&&"authorization"===e.toLowerCase()),u=o&&c,m=H.Form.useWatch("delegate_auth_to_upstream",n),p=H.Form.useWatch("available_on_public_internet",n),h=i&&!0===m&&!1===p;return(0,T.useEffect)(()=>{if(t){if(t.static_headers){let e=Object.entries(t.static_headers).map(([e,t])=>({header:e,value:null!=t?String(t):""}));n.setFieldValue("static_headers",e)}Array.isArray(t.env_vars)&&t.env_vars.length>0&&n.setFieldValue("env_vars",t.env_vars.map(e=>({name:e.name,value:e.value??"",scope:e.scope??"global",description:e.description??""}))),"boolean"==typeof t.allow_all_keys&&n.setFieldValue("allow_all_keys",t.allow_all_keys),"boolean"==typeof t.available_on_public_internet&&n.setFieldValue("available_on_public_internet",t.available_on_public_internet),"boolean"==typeof t.delegate_auth_to_upstream&&n.setFieldValue("delegate_auth_to_upstream",t.delegate_auth_to_upstream),"boolean"==typeof t.oauth_passthrough&&n.setFieldValue("oauth_passthrough",t.oauth_passthrough)}else n.setFieldValue("allow_all_keys",!1),n.setFieldValue("available_on_public_internet",!0),n.setFieldValue("delegate_auth_to_upstream",!1),n.setFieldValue("oauth_passthrough",!1)},[t,n]),(0,T.useEffect)(()=>{i||n.setFieldValue("delegate_auth_to_upstream",!1)},[i,n]),(0,T.useEffect)(()=>{u||n.setFieldValue("oauth_passthrough",!1)},[u,n]),(0,_.jsx)(tl.Collapse,{className:"bg-gray-50 border border-gray-200 rounded-lg",expandIconPosition:"end",ghost:!1,children:(0,_.jsx)(L7,{header:(0,_.jsxs)("div",{className:"flex items-center",children:[(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,_.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Permission Management / Access Control"})]}),(0,_.jsx)("p",{className:"text-sm text-gray-600 ml-4",children:"Configure access permissions and security settings (Optional)"})]}),className:"border-0",forceRender:!0,children:(0,_.jsxs)("div",{className:"space-y-6 pt-4",children:[(0,_.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Allow All LiteLLM Keys",(0,_.jsx)(tB.Tooltip,{title:"When enabled, every API key can access this MCP server.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),(0,_.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:'Enable if this server should be "public" to all keys.'})]}),(0,_.jsx)(H.Form.Item,{name:"allow_all_keys",valuePropName:"checked",initialValue:t?.allow_all_keys??!1,className:"mb-0",children:(0,_.jsx)(e_.Switch,{})})]}),(0,_.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Internal network only",(0,_.jsx)(tB.Tooltip,{title:"When on, only requests from within your internal network are accepted. Turn off to allow external clients (other clusters, ChatGPT, etc). API key authentication is always required regardless of this setting.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),(0,_.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:"Turn on to restrict access to callers within your internal network only."})]}),(0,_.jsx)(H.Form.Item,{name:"available_on_public_internet",valuePropName:"checked",getValueProps:e=>({checked:!e}),getValueFromEvent:e=>!e,initialValue:!0,className:"mb-0",children:(0,_.jsx)(e_.Switch,{})})]}),i&&(0,_.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Delegate auth to upstream (PKCE passthrough)",(0,_.jsx)(tB.Tooltip,{title:"When on, LiteLLM skips its own API key/SSO check for this server and lets the client complete PKCE directly with the upstream MCP server. Only honored when Auth Type is oauth2. No spend tracking or per-key rate limiting will run on this route.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),(0,_.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:"Bypass LiteLLM auth so clients authenticate directly with the upstream OAuth MCP server."})]}),(0,_.jsx)(H.Form.Item,{name:"delegate_auth_to_upstream",valuePropName:"checked",initialValue:t?.delegate_auth_to_upstream??!1,className:"mb-0",children:(0,_.jsx)(e_.Switch,{})})]}),u&&(0,_.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth pass-through",(0,_.jsx)(tB.Tooltip,{title:"When on, this server is treated as an OAuth pass-through: the gateway proxies the upstream /.well-known/oauth-protected-resource metadata, emits spec-compliant 401 challenges when no bearer is supplied, and propagates upstream 401/403 responses. Only honored when Auth Type is None and 'Authorization' is in Extra Headers.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),(0,_.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:"Forward upstream OAuth discovery and 401 challenges so clients negotiate OAuth directly with the upstream MCP server."})]}),(0,_.jsx)(H.Form.Item,{name:"oauth_passthrough",valuePropName:"checked",initialValue:t?.oauth_passthrough??!1,className:"mb-0",children:(0,_.jsx)(e_.Switch,{})})]}),h&&(0,_.jsx)(B.Alert,{type:"warning",showIcon:!0,className:"mb-2",message:"Internal server with upstream OAuth delegation",description:"This MCP server is configured as internal-only but delegates auth to upstream. Anonymous users will be able to reach the upstream OAuth2 /authorize flow without a LiteLLM session. Ensure your upstream provider and network enforce access controls."}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Access Groups",(0,_.jsx)(tB.Tooltip,{title:"Specify access groups for this MCP server. Users must be in at least one of these groups to access the server.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"mcp_access_groups",className:"mb-4",children:(0,_.jsx)(eE.Select,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"value",filterOption:(e,t)=>(t?.value??"").toLowerCase().includes(e.toLowerCase()),onSearch:e=>a(e),tokenSeparators:[","],options:s(),maxTagCount:"responsive",allowClear:!0})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Extra Headers",(0,_.jsx)(tB.Tooltip,{title:"Forward custom headers from incoming requests to this MCP server (e.g., Authorization, X-Custom-Header, User-Agent)",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})}),t?.extra_headers&&t.extra_headers.length>0&&(0,_.jsxs)("span",{className:"ml-2 text-xs bg-blue-100 text-blue-700 px-2 py-1 rounded-full",children:[t.extra_headers.length," configured"]})]}),name:"extra_headers",children:(0,_.jsx)(eE.Select,{mode:"tags",placeholder:t?.extra_headers&&t.extra_headers.length>0?`Currently: ${t.extra_headers.join(", ")}`:"Enter header names (e.g., Authorization, X-Custom-Header)",className:"rounded-lg",size:"large",tokenSeparators:[","],allowClear:!0})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Static Headers",(0,_.jsx)(tB.Tooltip,{title:"Send these key-value headers with every request to this MCP server.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),required:!1,children:(0,_.jsx)(H.Form.List,{name:"static_headers",children:(e,{add:t,remove:r})=>(0,_.jsxs)("div",{className:"space-y-3",children:[e.map(({key:e,name:t,...a})=>(0,_.jsxs)(U.Space,{className:"flex w-full",align:"baseline",size:"middle",children:[(0,_.jsx)(H.Form.Item,{...a,name:[t,"header"],className:"flex-1",rules:[{required:!0,message:"Header name is required"}],children:(0,_.jsx)($.Input,{size:"large",allowClear:!0,className:"rounded-lg",placeholder:"Header name (e.g., X-API-Key)"})}),(0,_.jsx)(H.Form.Item,{...a,name:[t,"value"],className:"flex-1",rules:[{required:!0,message:"Header value is required"}],children:(0,_.jsx)($.Input,{size:"large",allowClear:!0,className:"rounded-lg",placeholder:"Header value"})}),(0,_.jsx)(t0.MinusCircleOutlined,{onClick:()=>r(t),className:"text-gray-500 hover:text-red-500 cursor-pointer"})]},e)),(0,_.jsx)(z.Button,{type:"dashed",onClick:()=>t(),icon:(0,_.jsx)(tZ.PlusOutlined,{}),block:!0,children:"Add Static Header"})]})})})]})},"permissions")})},Oe=({accessToken:e,selectedName:t,onSelect:r})=>{let[a,s]=(0,T.useState)([]),[n,l]=(0,T.useState)(!1),[i,o]=(0,T.useState)(new Set);return((0,T.useEffect)(()=>{e&&(l(!0),(0,Q.fetchOpenAPIRegistry)(e).then(e=>s(e.apis??[])).catch(()=>s([])).finally(()=>l(!1)))},[e]),n)?(0,_.jsxs)("div",{className:"mb-4",children:[(0,_.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Popular APIs"}),(0,_.jsx)("div",{className:"flex justify-center py-6",children:(0,_.jsx)(rm.Spin,{size:"small"})})]}):0===a.length?null:(0,_.jsxs)("div",{className:"mb-4",children:[(0,_.jsx)("span",{className:"text-sm font-medium text-gray-700 block mb-2",children:"Popular APIs"}),(0,_.jsx)("div",{className:"grid grid-cols-5 gap-2",children:a.map(e=>{let a=t===e.name,s=i.has(e.name);return(0,_.jsxs)("button",{type:"button",title:e.description,onClick:()=>r(e),className:`flex flex-col items-center gap-1.5 p-3 rounded-lg border transition-all cursor-pointer - ${a?"border-blue-500 bg-blue-50 shadow-sm":"border-gray-200 hover:border-blue-300 hover:bg-gray-50"}`,children:[s?(0,_.jsx)("span",{className:"w-7 h-7 rounded-full bg-gray-200 flex items-center justify-center text-sm font-bold text-gray-600",children:e.title.charAt(0)}):(0,_.jsx)("img",{src:e.icon_url,alt:e.title,className:"w-7 h-7 object-contain",onError:()=>{var t;return t=e.name,void o(e=>new Set(e).add(t))}}),(0,_.jsx)("span",{className:"text-xs text-gray-600 text-center leading-tight font-medium",children:e.title})]},e.name)})}),(0,_.jsx)("p",{className:"text-xs text-gray-400 mt-2",children:"Select an API to pre-fill the spec URL and OAuth 2.0 settings, or enter your own spec URL below."})]})},Ot=({form:e,accessToken:t,onValuesChange:r,onKeyToolsChange:a,onLogoUrlChange:s,onOAuthDocsUrlChange:n})=>{let[l,i]=(0,T.useState)(null);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(Oe,{accessToken:t,selectedName:l,onSelect:t=>{i(t.name),a?.(t.key_tools??[]),s?.(t.icon_url||void 0);let l={spec_path:t.spec_url};t.oauth?(l.auth_type=LK.AUTH_TYPE.OAUTH2,l.oauth_flow_type=LK.OAUTH_FLOW.INTERACTIVE,l.authorization_url=t.oauth.authorization_url,l.token_url=t.oauth.token_url,e.setFieldsValue(l),n?.(t.oauth.docs_url??null)):(e.resetFields(["auth_type","authorization_url","token_url"]),e.setFieldsValue(l),n?.(null)),r(l)}}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OpenAPI Spec URL",(0,_.jsx)(tB.Tooltip,{title:"URL to an OpenAPI specification (JSON or YAML). MCP tools will be automatically generated from the API endpoints defined in the spec.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"spec_path",rules:[{required:!0,message:"Please enter an OpenAPI spec URL"}],children:(0,_.jsx)($.Input,{placeholder:"https://petstore3.swagger.io/api/v3/openapi.json",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500",onChange:()=>{i(null),a?.([]),n?.(null)}})})]})},Or="/ui/assets/logos/",Oa=[{name:"GitHub",url:`${Or}github.svg`},{name:"Slack",url:`${Or}slack.svg`},{name:"Notion",url:`${Or}notion.svg`},{name:"Linear",url:`${Or}linear.svg`},{name:"Jira",url:`${Or}jira.svg`},{name:"Figma",url:`${Or}figma.svg`},{name:"Gmail",url:`${Or}gmail.svg`},{name:"Google Drive",url:`${Or}google_drive.svg`},{name:"Stripe",url:`${Or}stripe.svg`},{name:"Shopify",url:`${Or}shopify.svg`},{name:"Salesforce",url:`${Or}salesforce.svg`},{name:"HubSpot",url:`${Or}hubspot.svg`},{name:"Twilio",url:`${Or}twilio.svg`},{name:"Cloudflare",url:`${Or}cloudflare.svg`},{name:"Sentry",url:`${Or}sentry.svg`},{name:"PostgreSQL",url:`${Or}postgresql.svg`},{name:"Snowflake",url:`${Or}snowflake.svg`},{name:"Zapier",url:`${Or}zapier.svg`},{name:"Google",url:`${Or}google.svg`},{name:"GitLab",url:`${Or}gitlab.svg`}],Os=({value:e,onChange:t})=>{let[r,a]=(0,T.useState)(new Set);return(0,_.jsxs)("div",{children:[(0,_.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,_.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Logo"}),(0,_.jsx)(tB.Tooltip,{title:"Select a well-known logo or paste a URL to any image. The logo is shown on the admin and chat pages.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"text-blue-400 hover:text-blue-600 cursor-help"})})]}),e&&(0,_.jsxs)("div",{className:"flex items-center gap-3 mb-3 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[(0,_.jsx)("img",{src:e,alt:"Selected logo",className:"w-10 h-10 object-contain rounded",onError:e=>{e.target.style.display="none"}}),(0,_.jsx)("div",{className:"flex-1 min-w-0",children:(0,_.jsx)("div",{className:"text-xs text-gray-500 truncate",children:e})}),(0,_.jsx)("button",{type:"button",onClick:()=>t?.(void 0),className:"text-xs text-gray-400 hover:text-red-500 cursor-pointer bg-transparent border-none",children:"✕"})]}),(0,_.jsx)("div",{className:"grid grid-cols-10 gap-1.5 mb-3",children:Oa.map(s=>{let n=e===s.url;return r.has(s.url)?null:(0,_.jsx)(tB.Tooltip,{title:s.name,children:(0,_.jsx)("button",{type:"button",onClick:()=>{var r;return r=s.url,void t?.(e===r?void 0:r)},className:`flex items-center justify-center p-2 rounded-lg border transition-all cursor-pointer - ${n?"border-blue-500 bg-blue-50 shadow-sm":"border-gray-200 hover:border-blue-300 hover:bg-gray-50"}`,style:{width:40,height:40},children:(0,_.jsx)("img",{src:s.url,alt:s.name,className:"w-5 h-5 object-contain",onError:()=>{var e;return e=s.url,void a(t=>new Set(t).add(e))}})})},s.name)})}),(0,_.jsx)($.Input,{prefix:(0,_.jsx)(en.LinkOutlined,{className:"text-gray-400"}),placeholder:"Or paste a custom logo URL...",value:e&&!Oa.some(t=>t.url===e)?e:"",onChange:e=>{let r=e.target.value.trim();t?.(r||void 0)},className:"rounded-lg",size:"small"})]})},{Text:On}=V.Typography,Ol=[{value:"global",label:"Instance"},{value:"user",label:"Per-user"}],Oi=({name:e,restField:t})=>"user"===H.Form.useWatch(["env_vars",e,"scope"])?(0,_.jsx)(H.Form.Item,{...t,name:[e,"description"],className:"mb-0",children:(0,_.jsx)($.Input,{addonBefore:(0,_.jsx)(tB.Tooltip,{title:"Per-user variables have no shared value. This text is only a hint shown to each user when they fill in their own value.",children:(0,_.jsxs)("span",{className:"text-xs text-gray-500 cursor-help whitespace-nowrap",children:[(0,_.jsx)(tK.InfoCircleOutlined,{className:"mr-1"}),"Hint"]})}),placeholder:"e.g. Your DB username",styles:{input:{color:"#9ca3af"}}})}):(0,_.jsx)(H.Form.Item,{...t,name:[e,"value"],className:"mb-0",children:(0,_.jsx)($.Input,{placeholder:"e.g. postgresql",className:"rounded-md font-mono"})}),Oo=()=>(0,_.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-gray-50 p-4",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,_.jsx)(On,{strong:!0,className:"text-sm",children:"Variables"}),(0,_.jsx)(tB.Tooltip,{title:(0,_.jsxs)(_.Fragment,{children:["Define variables you can interpolate in Static Headers or Authentication using"," ",(0,_.jsx)("code",{children:"${VAR_NAME}"}),". ",(0,_.jsx)("br",{}),(0,_.jsx)("b",{children:"Instance"}),": admin-defined value used for every user.",(0,_.jsx)("br",{}),(0,_.jsx)("b",{children:"Per-user"}),": each user supplies their own value (e.g. personal credentials) via the MCP Gateway dashboard."]}),children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"text-blue-400 hover:text-blue-600 cursor-help"})})]}),(0,_.jsxs)(On,{className:"text-xs text-gray-600 block mb-3",children:["Reference these in Static Headers or Authentication as ",(0,_.jsx)("code",{children:"${VAR_NAME}"}),". For example:"," ",(0,_.jsx)("code",{className:"bg-white px-1 rounded border border-gray-200",children:"${DB_PROTOCOL}://${CORP_USERNAME}:${CORP_PASSWORD}@${DB_HOSTNAME}"})]}),(0,_.jsx)(H.Form.List,{name:"env_vars",children:(e,{add:t,remove:r})=>(0,_.jsxs)("div",{className:"space-y-2",children:[e.length>0&&(0,_.jsxs)("div",{className:"flex gap-3 px-1 text-xs font-medium text-gray-500 uppercase tracking-wide",children:[(0,_.jsx)("div",{style:{flex:1},children:"Variable Name"}),(0,_.jsx)("div",{style:{flex:1},children:"Value / Description"}),(0,_.jsx)("div",{style:{width:160},children:"Scope"}),(0,_.jsx)("div",{style:{width:24}})]}),e.map(({key:e,name:t,...a})=>(0,_.jsxs)("div",{className:"flex gap-3 items-start",children:[(0,_.jsx)(H.Form.Item,{...a,name:[t,"name"],className:"mb-0",style:{flex:1},rules:[{required:!0,message:"Variable name is required"},{pattern:/^[A-Za-z_][A-Za-z0-9_]*$/,message:"Use letters, digits, underscores; cannot start with a digit."}],children:(0,_.jsx)($.Input,{placeholder:"e.g. DB_PROTOCOL",className:"rounded-md font-mono"})}),(0,_.jsx)("div",{style:{flex:1},children:(0,_.jsx)(Oi,{name:t,restField:a})}),(0,_.jsx)(H.Form.Item,{...a,name:[t,"scope"],className:"mb-0",initialValue:"global",style:{width:160},children:(0,_.jsx)(eE.Select,{options:Ol})}),(0,_.jsx)("div",{style:{width:24,height:32},className:"flex items-center justify-center",children:(0,_.jsx)(t0.MinusCircleOutlined,{onClick:()=>r(t),className:"text-gray-500 hover:text-red-500 cursor-pointer"})})]},e)),(0,_.jsx)(z.Button,{type:"dashed",onClick:()=>t({scope:"global"}),icon:(0,_.jsx)(tZ.PlusOutlined,{}),block:!0,children:"Add Variable"})]})})]}),Od=e=>{try{let t=e.indexOf("/mcp/");if(-1===t)return{token:null,baseUrl:e};let r=e.split("/mcp/");if(2!==r.length)return{token:null,baseUrl:e};let a=r[0]+"/mcp/",s=r[1];if(!s)return{token:null,baseUrl:e};return{token:s,baseUrl:a}}catch(t){return console.error("Error parsing MCP URL:",t),{token:null,baseUrl:e}}},Oc=e=>{let{token:t}=Od(e);return{maskedUrl:(e=>{let{token:t,baseUrl:r}=Od(e);return t?r+"...":e})(e),hasToken:!!t}},Ou=e=>e?/^https?:\/\/[^\s/$.?#].[^\s]*$/i.test(e)?Promise.resolve():Promise.reject("Please enter a valid URL (e.g., http://service-name.domain:1234/path or https://example.com)"):Promise.resolve(),Om=e=>e&&(e.includes("-")||e.includes(" "))?Promise.reject("Cannot contain '-' (hyphen) or spaces. Please use '_' (underscore) instead."):Promise.resolve(),Op=e=>{if(!Array.isArray(e))return[];let t=new Set,r=[];for(let a of e){if(!a||"object"!=typeof a)continue;let e=String(a.name??"").trim();if(!e||t.has(e)||!/^[A-Za-z_][A-Za-z0-9_]*$/.test(e))continue;let s="user"===a.scope?"user":"global";r.push({name:e,value:"user"===s?"":String(a.value??""),scope:s,description:a.description||void 0}),t.add(e)}return r};var Oh=e.i(122520),Of=e.i(165615),Ox=e.i(434166);let Og=({accessToken:e,getCredentials:t,getTemporaryPayload:r,onTokenReceived:a,onBeforeRedirect:s})=>{let[n,l]=(0,T.useState)("idle"),[i,o]=(0,T.useState)(null),[d,c]=(0,T.useState)(null),u=(0,T.useRef)(!1),m="litellm-mcp-oauth-flow-state",p="litellm-mcp-oauth-result",h="litellm-mcp-oauth-return-url",f=(e,t)=>{(0,Ox.setSecureItem)(e,t)},x=e=>{try{return(0,Ox.getSecureItem)(e)}catch(t){return console.warn(`Failed to get storage item ${e}`,t),null}},g=()=>{try{window.sessionStorage.removeItem(m),window.sessionStorage.removeItem(p),window.sessionStorage.removeItem(h),window.localStorage.removeItem(m),window.localStorage.removeItem(p),window.localStorage.removeItem(h)}catch(e){console.warn("Failed to clear OAuth storage",e)}},y=()=>{let e,t,r;return r=((t=(e=window.location.pathname||"").indexOf("/ui"))>=0?e.slice(0,t+3):"").replace(/\/+$/,""),`${window.location.origin}${r}/mcp/oauth/callback`},_=(0,T.useCallback)(async()=>{let a=t()||{};if(!e){o("Missing admin token"),J.default.error("Access token missing. Please re-authenticate and try again.");return}let n=r();if(!n||!n.url||!n.transport){let e="Please complete server URL and transport before starting OAuth.";o(e),J.default.error(e);return}try{l("authorizing"),o(null);let t=await (0,Q.cacheTemporaryMcpServer)(e,n),r=t?.server_id?.trim();if(!r)throw Error("Temporary MCP server identifier missing. Please retry.");let i={};if(!(n.credentials?.client_id&&n.credentials?.client_secret)){let t=await (0,Q.registerMcpOAuthClient)(e,r,{client_name:n.alias||n.server_name||r,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:n.credentials&&n.credentials.client_secret?"client_secret_post":"none"});i={clientId:t?.client_id,clientSecret:t?.client_secret}}let d=(0,Of.generateCodeVerifier)(),c=await (0,Of.generateCodeChallenge)(d),u=crypto.randomUUID(),p=i.clientId||a.client_id,x=Array.isArray(a.scopes)?a.scopes.filter(e=>e&&e.trim().length>0).join(" "):void 0,g=(0,Q.buildMcpOAuthAuthorizeUrl)({serverId:r,clientId:p,redirectUri:y(),state:u,codeChallenge:c,scope:x}),_={state:u,codeVerifier:d,clientId:p,clientSecret:i.clientSecret||a.client_secret,serverId:r,redirectUri:y()};if(s)try{s()}catch(e){console.error("Failed to prepare for OAuth redirect",e)}try{f(m,JSON.stringify(_)),f(h,window.location.href)}catch(e){throw Error("Unable to access browser storage for OAuth. Please enable storage and retry.")}window.location.href=g}catch(t){console.error("Failed to start OAuth flow",t),l("error");let e=(0,Oh.extractErrorMessage)(t);o(e),J.default.error(e)}},[e,t,r,s]),b=(0,T.useCallback)(async()=>{if(u.current)return;let t=null,r=null;try{let e=x(p);if(!e)return;let a=x(m);if(!a)return;u.current=!0,t=JSON.parse(e),r=JSON.parse(a)}catch(e){g(),u.current=!1,o("Failed to resume OAuth flow. Please retry."),l("error"),J.default.error("Failed to resume OAuth flow. Please retry.");return}if(!t){u.current=!1;return}try{window.sessionStorage.removeItem(p),window.localStorage.removeItem(p)}catch(e){}try{if(!r||!r.state||!r.codeVerifier||!r.serverId)throw Error("OAuth session state was lost. This can happen if you have strict browser privacy settings. Please try again and ensure cookies/storage is enabled.");if(!t.state||t.state!==r.state)throw Error("OAuth state mismatch. Please retry.");if(t.error)throw Error(t.error_description||t.error);if(!t.code)throw Error("Authorization code missing in callback.");l("exchanging");let s=await (0,Q.exchangeMcpOAuthToken)({serverId:r.serverId,code:t.code,clientId:r.clientId,clientSecret:r.clientSecret,codeVerifier:r.codeVerifier,redirectUri:r.redirectUri,accessToken:e});a(s),c(s),l("success"),o(null),J.default.success("OAuth token retrieved successfully")}catch(t){let e=(0,Oh.extractErrorMessage)(t);o(e),l("error"),J.default.error(e)}finally{g(),setTimeout(()=>{u.current=!1},1e3)}},[a]);return(0,T.useEffect)(()=>{b()},[b]),{startOAuthFlow:_,status:n,error:i,tokenResponse:d}},Oy="../ui/assets/logos/mcp_logo.png",O_=[LK.AUTH_TYPE.API_KEY,LK.AUTH_TYPE.BEARER_TOKEN,LK.AUTH_TYPE.TOKEN,LK.AUTH_TYPE.BASIC],Ob=[...O_,LK.AUTH_TYPE.OAUTH2,LK.AUTH_TYPE.AWS_SIGV4],Ov="litellm-mcp-oauth-create-state",Oj=e=>Array.isArray(e)?e.reduce((e,t)=>{let r=t?.header?.trim();return r&&(e[r]=(t?.value??"").trim()),e},{}):{},Ow=({userID:e,userRole:t,accessToken:r,onCreateSuccess:a,isModalVisible:s,setModalVisible:n,availableAccessGroups:l,prefillData:i,onBackToDiscovery:o})=>{let[d]=H.Form.useForm(),[c,u]=(0,T.useState)(!1),[m,p]=(0,T.useState)({}),[h,f]=(0,T.useState)({}),[x,g]=(0,T.useState)(null),[y,b]=(0,T.useState)(!1),[v,j]=(0,T.useState)([]),[w,k]=(0,T.useState)(!1),[N,M]=(0,T.useState)({}),[C,L]=(0,T.useState)({}),[O,D]=(0,T.useState)(""),[P,A]=(0,T.useState)([]),[E,I]=(0,T.useState)(""),[Y,F]=(0,T.useState)(null),[R,B]=(0,T.useState)(void 0),[z,U]=(0,T.useState)(null),{tools:W,isLoadingTools:V,toolsError:G,toolsErrorStackTrace:K,canFetchTools:X,fetchTools:Z,clearTools:ee}=L4({accessToken:r,oauthAccessToken:Y,formValues:h,enabled:!0}),er=h.auth_type,ea=!!er&&O_.includes(er),es=er===LK.AUTH_TYPE.OAUTH2,en=er===LK.AUTH_TYPE.AWS_SIGV4,el=es&&h.oauth_flow_type===LK.OAUTH_FLOW.M2M,{startOAuthFlow:ei,status:eo,error:ed,tokenResponse:ec}=Og({accessToken:r,getCredentials:()=>d.getFieldValue("credentials"),getTemporaryPayload:()=>{let e=d.getFieldsValue(!0),t=e.transport||O,r=e.url||(t===LK.TRANSPORT.OPENAPI?e.spec_path:void 0);if(!r||!t)return null;let a=Oj(e.static_headers);return{server_id:void 0,server_name:e.server_name,alias:e.alias,description:e.description,url:r,transport:t===LK.TRANSPORT.OPENAPI?"http":t,auth_type:LK.AUTH_TYPE.OAUTH2,credentials:e.credentials,authorization_url:e.authorization_url,token_url:e.token_url,registration_url:e.registration_url,mcp_access_groups:e.mcp_access_groups,static_headers:a,command:e.command,args:e.args,env:e.env}},onTokenReceived:e=>{if(F(e?.access_token??null),e?.access_token){let t={access_token:e.access_token,...e.refresh_token&&{refresh_token:e.refresh_token},...e.expires_in&&{expires_in:e.expires_in},...e.scope&&{scope:e.scope}};d.setFieldsValue({credentials:t}),J.default.success("OAuth authorization successful! Please click 'Create MCP Server' to save the configuration.")}},onBeforeRedirect:()=>{try{let e=d.getFieldsValue(!0);(0,Ox.setSecureItem)(Ov,JSON.stringify({modalVisible:s,formValues:e,transportType:O,costConfig:m,allowedTools:v,hasToolAllowlistInteraction:w,searchValue:E,aliasManuallyEdited:y,logoUrl:R}))}catch(e){console.warn("Failed to persist MCP create state",e)}}});T.default.useEffect(()=>{let e=(0,Ox.getSecureItem)(Ov);if(e)try{let t=JSON.parse(e);t.modalVisible&&n(!0);let r=t.formValues?.transport||t.transportType||"";r&&D(r),t.formValues&&g({values:t.formValues,transport:r}),t.costConfig&&p(t.costConfig),t.allowedTools&&j(t.allowedTools),"boolean"==typeof t.hasToolAllowlistInteraction&&k(t.hasToolAllowlistInteraction),t.searchValue&&I(t.searchValue),"boolean"==typeof t.aliasManuallyEdited&&b(t.aliasManuallyEdited),t.logoUrl&&B(t.logoUrl)}catch(e){console.error("Failed to restore MCP create state",e)}finally{window.sessionStorage.removeItem(Ov)}},[d,n]),T.default.useEffect(()=>{x&&(O||x.transport,(!x.transport||O)&&(d.setFieldsValue(x.values),f(x.values),g(null)))},[x,d,O]),T.default.useEffect(()=>{if(!s||!i)return;let e=(i.name||"").replace(/[^a-zA-Z0-9_]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,""),t=i.transport||"";D(t);let r={server_name:e,alias:e,description:i.description||"",transport:t};if("stdio"===t){let e={};if(i.command&&(e.command=i.command),i.args&&i.args.length>0&&(e.args=i.args),i.env_vars&&i.env_vars.length>0){let t={};for(let e of i.env_vars)t[e.name]=e.description?`<${e.description}>`:"";e.env=t}Object.keys(e).length>0&&(r.stdio_config=JSON.stringify(e,null,2))}else i.url&&(r.url=i.url);d.setFieldsValue(r),f(r),b(!1)},[s,i,d]);let eu=async t=>{u(!0);try{let{static_headers:s,env_vars:l,stdio_config:i,credentials:o,allow_all_keys:c,available_on_public_internet:h,delegate_auth_to_upstream:f,oauth_passthrough:x,token_validation_json:g,...y}=t,_=y.mcp_access_groups,S=Oj(s),T=Op(l),M=o&&"object"==typeof o?Object.entries(o).reduce((e,[t,r])=>{if(null==r||""===r)return e;if("scopes"===t){if(Array.isArray(r)){let a=r.filter(e=>null!=e&&""!==e);a.length>0&&(e[t]=a)}}else e[t]=r;return e},{}):void 0,L={};if(i&&"stdio"===O)try{let e=JSON.parse(i),t=e;if(e.mcpServers&&"object"==typeof e.mcpServers){let r=Object.keys(e.mcpServers);if(r.length>0){let a=r[0];t=e.mcpServers[a],y.server_name||(y.server_name=a.replace(/-/g,"_"))}}L={command:t.command,args:t.args,env:t.env},console.log("Parsed stdio config:",L)}catch(e){J.default.fromBackend("Invalid JSON in stdio configuration");return}y.transport===LK.TRANSPORT.OPENAPI&&(y.transport="http");let D=null;if(g&&""!==g.trim())try{D=JSON.parse(g)}catch{J.default.fromBackend("Invalid JSON in Token Validation Rules"),u(!1);return}let P={...y,...L,stdio_config:void 0,mcp_info:{server_name:y.server_name||y.url,description:y.description,logo_url:R||void 0,mcp_server_cost_info:Object.keys(m).length>0?m:null,tool_allowlist_enforced:w||v.length>0},mcp_access_groups:_,alias:y.alias,allowed_tools:v,tool_name_to_display_name:N,tool_name_to_description:C,allow_all_keys:!!c,available_on_public_internet:!!h,delegate_auth_to_upstream:!!f,oauth_passthrough:!!x,static_headers:S,env_vars:T,...null!==D&&{token_validation:D}};if(y.auth_type&&Ob.includes(y.auth_type)&&M&&Object.keys(M).length>0&&(P.credentials=M),console.log(`Payload: ${JSON.stringify(P)}`),null!=r){let s=ep?await (0,Q.createMCPServer)(r,P):await (0,Q.registerMCPServer)(r,P);if(ec?.access_token&&s?.server_id){let a=(0,LK.getMcpOAuthMode)({auth_type:y.auth_type,oauth2_flow:t.oauth_flow_type===LK.OAUTH_FLOW.M2M?LK.MCP_OAUTH2_FLOW_M2M:null,delegate_auth_to_upstream:!!f});if("obo"===a){let e=ec.scope;await (0,Q.storeMCPOAuthUserCredential)(r,s.server_id,{access_token:ec.access_token,refresh_token:ec.refresh_token,expires_in:ec.expires_in,scopes:"string"==typeof e&&e?e.split(" "):void 0})}else(0,LG.setToken)(s.server_id,{access_token:ec.access_token,expires_in:ec.expires_in,refresh_token:ec.refresh_token,token_type:ec.token_type},e)}J.default.success(ep?"MCP Server created successfully":"MCP Server submitted for admin review"),d.resetFields(),p({}),ee(),j([]),k(!1),b(!1),B(void 0),n(!1),a(s)}}catch(t){let e=t instanceof Error?t.message:String(t);J.default.fromBackend(ep?`Error creating MCP Server: ${e}`:`Error submitting MCP Server: ${e}`)}finally{u(!1)}},em=()=>{d.resetFields(),p({}),ee(),j([]),k(!1),b(!1),B(void 0),n(!1)};T.default.useEffect(()=>{if(!y&&h.server_name){let e=h.server_name.replace(/\s+/g,"_");d.setFieldsValue({alias:e}),f(t=>({...t,alias:e}))}},[h.server_name]),T.default.useEffect(()=>{s||f({})},[s]);let ep=(0,ts.isAdminRole)(t);return(0,_.jsx)(q.Modal,{title:(0,_.jsxs)("div",{className:"flex items-center pb-4 border-b border-gray-100",style:{gap:12},children:[o&&(0,_.jsx)("button",{onClick:o,className:"text-sm text-blue-600 hover:text-blue-800 cursor-pointer bg-transparent border-none",style:{flexShrink:0},children:"←"}),(0,_.jsx)("img",{src:Oy,alt:"MCP Logo",className:"w-8 h-8 object-contain",style:{height:"20px",width:"20px",objectFit:"contain"}}),(0,_.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:ep?"Add New MCP Server":"Submit MCP Server for Review"})]}),open:s,width:1e3,onCancel:em,footer:null,forceRender:!0,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,_.jsx)("div",{className:"mt-6",children:(0,_.jsxs)(H.Form,{form:d,onFinish:eu,onValuesChange:(e,t)=>f(t),layout:"vertical",className:"space-y-6",children:[!ep&&(0,_.jsx)("div",{className:"rounded-md bg-blue-50 border border-blue-200 px-4 py-3 text-sm text-blue-800",children:"Your submission will be sent for admin review before it becomes active. Note: the request must be made with a team-scoped API key."}),(0,_.jsxs)("div",{className:"grid grid-cols-1 gap-6",children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Server Name",(0,_.jsx)(tB.Tooltip,{title:"Best practice: Use a descriptive name that indicates the server's purpose (e.g., 'GitHub_MCP', 'Email_Service'). Cannot contain spaces or hyphens; use underscores instead. Names must comply with SEP-986 and will be rejected if invalid (https://modelcontextprotocol.io/specification/2025-11-25/server/tools#tool-names).",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"server_name",rules:[{required:!1,message:"Please enter a server name"},{validator:(e,t)=>Om(t)}],children:(0,_.jsx)(et.TextInput,{placeholder:"e.g., GitHub_MCP, Zapier_MCP, etc.",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Alias",(0,_.jsx)(tB.Tooltip,{title:"A short, unique identifier for this server. Defaults to the server name if not provided. Cannot contain spaces or hyphens; use underscores instead.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"alias",rules:[{required:!1},{validator:(e,t)=>Om(t)}],children:(0,_.jsx)(et.TextInput,{placeholder:"e.g., GitHub_MCP, Zapier_MCP, etc.",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500",onChange:()=>b(!0)})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Description"}),name:"description",rules:[{required:!1,message:"Please enter a server description"}],children:(0,_.jsx)(et.TextInput,{placeholder:"Brief description of what this server does",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(Os,{value:R,onChange:B}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"GitHub / Source URL"}),name:"source_url",children:(0,_.jsx)(et.TextInput,{placeholder:"https://github.com/org/mcp-server",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Transport Type"}),name:"transport",rules:[{required:!0,message:"Please select a transport type"}],children:(0,_.jsxs)(eE.Select,{placeholder:"Select transport",className:"rounded-lg",size:"large",onChange:e=>{D(e),"stdio"===e?d.setFieldsValue({url:void 0,spec_path:void 0,auth_type:void 0,credentials:void 0}):e===LK.TRANSPORT.OPENAPI?d.setFieldsValue({url:void 0,command:void 0,args:void 0,env:void 0}):d.setFieldsValue({spec_path:void 0,command:void 0,args:void 0,env:void 0})},value:O,children:[(0,_.jsx)(eE.Select.Option,{value:"http",children:"Streamable HTTP (Recommended)"}),(0,_.jsx)(eE.Select.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,_.jsx)(eE.Select.Option,{value:"stdio",children:"Standard Input/Output (stdio)"}),(0,_.jsx)(eE.Select.Option,{value:LK.TRANSPORT.OPENAPI,children:"OpenAPI Spec"})]})}),("http"===O||"sse"===O)&&(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"MCP Server URL"}),name:"url",rules:[{required:!0,message:"Please enter a server URL"},{validator:(e,t)=>Ou(t)}],children:(0,_.jsx)($.Input,{placeholder:"https://your-mcp-server.com",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),O===LK.TRANSPORT.OPENAPI&&(0,_.jsx)(Ot,{form:d,accessToken:s?r:null,onValuesChange:e=>f(t=>({...t,...e})),onKeyToolsChange:A,onLogoUrlChange:B,onOAuthDocsUrlChange:U}),O===LK.TRANSPORT.OPENAPI&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:["BYOK (Bring Your Own Key)",(0,_.jsx)(tB.Tooltip,{title:"When enabled, each user provides their own API key for this service. Keys are stored per-user and never shared.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"is_byok",valuePropName:"checked",children:(0,_.jsx)(e_.Switch,{})}),(0,_.jsx)(H.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.is_byok!==t.is_byok||e.auth_type!==t.auth_type,children:({getFieldValue:e})=>e("is_byok")?(0,_.jsxs)(_.Fragment,{children:[e("auth_type")&&"none"!==e("auth_type")&&(0,_.jsxs)("div",{className:"mb-4 p-3 bg-blue-50 rounded-lg text-sm text-blue-700 flex items-start gap-2",children:[(0,_.jsx)(tK.InfoCircleOutlined,{className:"mt-0.5 flex-shrink-0"}),(0,_.jsxs)("span",{children:["User keys will be sent as:"," ",(0,_.jsxs)("code",{className:"font-mono bg-blue-100 px-1 rounded",children:["bearer_token"===e("auth_type")&&"Authorization: Bearer {key}","token"===e("auth_type")&&"Authorization: token {key}","api_key"===e("auth_type")&&"x-api-key: {key}","basic"===e("auth_type")&&"Authorization: Basic {key}","authorization"===e("auth_type")&&"Authorization: {key}"]}),!e("auth_type")&&"Set Authentication Type below to specify the format."]})]}),!e("auth_type")&&(0,_.jsxs)("div",{className:"mb-4 p-3 bg-yellow-50 rounded-lg text-sm text-yellow-700 flex items-start gap-2",children:[(0,_.jsx)(tK.InfoCircleOutlined,{className:"mt-0.5 flex-shrink-0"}),(0,_.jsxs)("span",{children:["Set the ",(0,_.jsx)("strong",{children:"Authentication Type"})," below to specify how user keys are sent (e.g., Bearer Token, API Key header)."]})]}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Access Description",(0,_.jsx)(tB.Tooltip,{title:"List of permissions shown to users in the connection modal (e.g. 'Create and manage Jira issues')",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"byok_description",children:(0,_.jsx)(eE.Select,{mode:"tags",placeholder:"Add access description items (press Enter after each)",className:"w-full",tokenSeparators:[","]})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["API Key Help URL",(0,_.jsx)(tB.Tooltip,{title:"Optional link shown to users to help them find their API key",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"byok_api_key_help_url",children:(0,_.jsx)($.Input,{placeholder:"https://docs.example.com/api-keys"})})]}):null})]}),"stdio"!==O&&""!==O&&(0,_.jsx)(tl.Collapse,{defaultActiveKey:["auth"],className:"mb-4",items:[{key:"auth",label:(0,_.jsx)("span",{className:"text-sm font-semibold text-gray-700",children:"Authentication"}),children:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(H.Form.Item,{name:"auth_type",rules:[{required:!0,message:"Please select an auth type"}],children:(0,_.jsxs)(eE.Select,{placeholder:"Select auth type",className:"rounded-lg",size:"large",children:[(0,_.jsx)(eE.Select.Option,{value:"none",children:"None"}),(0,_.jsx)(eE.Select.Option,{value:"api_key",children:"API Key"}),(0,_.jsx)(eE.Select.Option,{value:"bearer_token",children:"Bearer Token"}),(0,_.jsx)(eE.Select.Option,{value:"token",children:"Token"}),(0,_.jsx)(eE.Select.Option,{value:"basic",children:"Basic Auth"}),(0,_.jsx)(eE.Select.Option,{value:"oauth2",children:"OAuth"}),(0,_.jsx)(eE.Select.Option,{value:"aws_sigv4",children:"AWS SigV4 (Bedrock AgentCore MCPs)"})]})}),ea&&(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Authentication Value",(0,_.jsx)(tB.Tooltip,{title:"Token, password, or header value to send with each request for the selected auth type.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","auth_value"],rules:[{validator:(e,t)=>t&&"string"==typeof t&&""===t.trim()?Promise.reject(Error("Authentication value cannot be empty whitespace")):Promise.resolve()}],children:(0,_.jsx)(et.TextInput,{type:"password",placeholder:"Enter token or secret",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),es&&(0,_.jsx)(LX,{isM2M:el,initialFlowType:LK.OAUTH_FLOW.INTERACTIVE,docsUrl:z,oauthFlow:{startOAuthFlow:ei,status:eo,error:ed,tokenResponse:ec}})]})}]}),"stdio"!==O&&""!==O&&en&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("p",{className:"text-sm text-gray-500 mb-2",children:["For MCP servers hosted on AWS Bedrock AgentCore."," ",(0,_.jsx)("a",{href:"https://docs.litellm.ai/docs/mcp_aws_sigv4",target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:text-blue-700",children:"View docs →"})]}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Region",(0,_.jsx)(tB.Tooltip,{title:"AWS region for SigV4 signing (e.g., us-east-1)",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_region_name"],rules:[{required:!0,message:"AWS region is required for SigV4 auth"}],children:(0,_.jsx)($.Input,{placeholder:"us-east-1",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Service Name",(0,_.jsx)(tB.Tooltip,{title:"AWS service name for SigV4 signing. Defaults to 'bedrock-agentcore'.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_service_name"],children:(0,_.jsx)($.Input,{placeholder:"bedrock-agentcore",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Access Key ID",(0,_.jsx)(tB.Tooltip,{title:"Optional. If not provided, falls back to the boto3 credential chain (IAM role, env vars, etc.).",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_access_key_id"],dependencies:[["credentials","aws_secret_access_key"]],rules:[({getFieldValue:e})=>({validator:(t,r)=>e(["credentials","aws_secret_access_key"])&&!r?Promise.reject(Error("Access Key ID is required when Secret Access Key is provided")):Promise.resolve()})],children:(0,_.jsx)($.Input.Password,{placeholder:"AKIA... (optional — uses IAM role if blank)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Secret Access Key",(0,_.jsx)(tB.Tooltip,{title:"Optional. Required if AWS Access Key ID is provided.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_secret_access_key"],dependencies:[["credentials","aws_access_key_id"]],rules:[({getFieldValue:e})=>({validator:(t,r)=>e(["credentials","aws_access_key_id"])&&!r?Promise.reject(Error("Secret Access Key is required when Access Key ID is provided")):Promise.resolve()})],children:(0,_.jsx)($.Input.Password,{placeholder:"Enter secret key (optional — uses IAM role if blank)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Session Token",(0,_.jsx)(tB.Tooltip,{title:"Optional. Only needed for temporary STS credentials.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_session_token"],children:(0,_.jsx)($.Input.Password,{placeholder:"Enter session token (optional)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Role ARN",(0,_.jsx)(tB.Tooltip,{title:"Optional. IAM role ARN to assume via STS before signing. If set, LiteLLM calls sts:AssumeRole to get temporary credentials. Uses ambient credentials (IAM role, env vars) as the source identity unless explicit keys are also provided.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_role_name"],children:(0,_.jsx)($.Input,{placeholder:"arn:aws:iam::123456789012:role/MyRole (optional)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Session Name",(0,_.jsx)(tB.Tooltip,{title:"Optional. Session name for the AssumeRole call — appears in CloudTrail logs. Auto-generated if omitted.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_session_name"],children:(0,_.jsx)($.Input,{placeholder:"litellm-prod (optional, auto-generated if blank)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})})]}),(0,_.jsx)(L8,{isVisible:"stdio"===O})]}),(0,_.jsx)("div",{className:"mt-8",children:(0,_.jsx)(Oo,{})}),(0,_.jsx)("div",{className:"mt-8",children:(0,_.jsx)(L9,{availableAccessGroups:l,mcpServer:null,searchValue:E,setSearchValue:I,getAccessGroupOptions:()=>{let e=l.map(e=>({value:e,label:(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,_.jsx)("span",{className:"font-medium",children:e})]})}));return E&&!l.some(e=>e.toLowerCase().includes(E.toLowerCase()))&&e.push({value:E,label:(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,_.jsx)("span",{className:"font-medium",children:E}),(0,_.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e}})}),(0,_.jsx)("div",{className:"mt-8 pt-6 border-t border-gray-200",children:(0,_.jsx)(L2,{formValues:h,tools:W,isLoadingTools:V,toolsError:G,toolsErrorStackTrace:K,canFetchTools:X,fetchTools:Z})}),(0,_.jsx)("div",{className:"mt-6",children:(0,_.jsx)(L3,{accessToken:r,oauthAccessToken:Y,formValues:h,allowedTools:v,existingAllowedTools:null,onAllowedToolsChange:j,hasToolAllowlistInteraction:w,onToolAllowlistInteraction:()=>k(!0),toolNameToDisplayName:N,toolNameToDescription:C,onToolNameToDisplayNameChange:M,onToolNameToDescriptionChange:L,keyTools:P,externalTools:W,externalIsLoading:V,externalError:G,externalCanFetch:X})}),(0,_.jsx)("div",{className:"mt-6",children:(0,_.jsx)(L1,{value:m,onChange:p,tools:W.filter(e=>v.includes(e.name)),disabled:!1})}),(0,_.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:[(0,_.jsx)(S.Button,{variant:"secondary",onClick:em,children:"Cancel"}),(0,_.jsx)(S.Button,{variant:"primary",loading:c,children:c?"Creating...":"Add MCP Server"})]})]})})})},Ok=(0,eT.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]),OS=(0,eT.default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]),ON=(0,eT.default)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);var Cu=Cu;let OT=(0,eT.default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),{Title:OM,Text:OC}=V.Typography,{Panel:OL}=tl.Collapse,OO=({icon:e,title:t,description:r,children:a,serverName:s,accessGroups:n=["dev-group"]})=>{let[l,i]=(0,T.useState)(!1);return(0,_.jsxs)(eg.Card,{className:"border border-gray-200",children:[(0,_.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,_.jsx)("span",{className:"p-2 rounded-lg bg-gray-50",children:e}),(0,_.jsxs)("div",{children:[(0,_.jsx)(OM,{level:5,className:"mb-0",children:t}),(0,_.jsx)(OC,{className:"text-gray-600",children:r})]})]}),s&&("Implementation Example"===t||"Configuration"===t)&&(0,_.jsxs)(H.Form.Item,{className:"mb-4",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,_.jsx)(e_.Switch,{size:"small",checked:l,onChange:i}),(0,_.jsxs)(OC,{className:"text-sm",children:["Limit tools to specific MCP servers or MCP groups by passing the ",(0,_.jsx)("code",{children:"x-mcp-servers"})," header"]})]}),l&&(0,_.jsx)(B.Alert,{className:"mt-2",type:"info",showIcon:!0,message:"Two Options",description:(0,_.jsxs)("div",{children:[(0,_.jsxs)("p",{children:[(0,_.jsx)("strong",{children:"Option 1:"})," Get a specific server: ",(0,_.jsxs)("code",{children:['"',s.replace(/\s+/g,"_"),'"']})]}),(0,_.jsxs)("p",{children:[(0,_.jsx)("strong",{children:"Option 2:"})," Get a group of MCPs: ",(0,_.jsx)("code",{children:'"dev-group"'})]}),(0,_.jsxs)("p",{className:"mt-2 text-sm text-gray-600",children:["You can also mix both: ",(0,_.jsx)("code",{children:'"Server1,dev-group"'})]})]})})]}),T.default.Children.map(a,e=>{if(T.default.isValidElement(e)&&e.props.hasOwnProperty("code")&&e.props.hasOwnProperty("copyKey")){let t=e.props.code;if(t&&t.includes('"headers":'))return T.default.cloneElement(e,{code:t.replace(/"headers":\s*{[^}]*}/,`"headers": ${JSON.stringify((()=>{let e={"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"};if(l&&s){let t=[s.replace(/\s+/g,"_"),...n].join(",");e["x-mcp-servers"]=t}return e})(),null,8)}`)})}return e})]})},OD=({currentServerAccessGroups:e=[]})=>{let t=(0,Q.getProxyBaseUrl)(),[r,a]=(0,T.useState)({}),[s,n]=(0,T.useState)({openai:[],litellm:[],cursor:[],http:[]}),[l]=(0,T.useState)("Zapier_MCP"),i=async(e,t)=>{await (0,rV.copyToClipboard)(e)&&(a(e=>({...e,[t]:!0})),setTimeout(()=>{a(e=>({...e,[t]:!1}))},2e3))},o=({code:e,copyKey:t,title:a,className:s=""})=>(0,_.jsxs)("div",{className:"relative group",children:[a&&(0,_.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,_.jsx)(Ok,{size:16,className:"text-blue-600"}),(0,_.jsx)(OC,{strong:!0,className:"text-gray-700",children:a})]}),(0,_.jsxs)(eg.Card,{className:`bg-gray-50 border border-gray-200 relative ${s}`,children:[(0,_.jsx)(z.Button,{type:"text",size:"small",icon:r[t]?(0,_.jsx)(M_.CheckIcon,{size:12}):(0,_.jsx)(Mb.CopyIcon,{size:12}),onClick:()=>i(e,t),className:`absolute top-2 right-2 z-10 transition-all duration-200 ${r[t]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`}),(0,_.jsx)("pre",{className:"text-sm overflow-x-auto pr-10 text-gray-800 font-mono leading-relaxed",children:e})]})]}),d=({step:e,title:t,children:r})=>(0,_.jsxs)("div",{className:"flex gap-4",children:[(0,_.jsx)("div",{className:"flex-shrink-0",children:(0,_.jsx)("div",{className:"w-8 h-8 bg-blue-600 text-white rounded-full flex items-center justify-center text-sm font-semibold",children:e})}),(0,_.jsxs)("div",{className:"flex-1",children:[(0,_.jsx)(OC,{strong:!0,className:"text-gray-800 block mb-2",children:t}),r]})]});return(0,_.jsx)("div",{children:(0,_.jsxs)(U.Space,{direction:"vertical",size:"large",className:"w-full",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(X.Title,{className:"text-3xl font-bold text-gray-900 mb-3",children:"Connect to your MCP client"}),(0,_.jsx)(Z.Text,{className:"text-lg text-gray-600",children:"Use tools directly from any MCP client with LiteLLM MCP. Enable your AI assistant to perform real-world tasks through a simple, secure connection."})]}),(0,_.jsxs)(rF.TabGroup,{className:"w-full",children:[(0,_.jsx)(rR.TabList,{className:"flex justify-start mt-8 mb-6",children:(0,_.jsxs)("div",{className:"flex bg-gray-100 p-1 rounded-lg",children:[(0,_.jsx)(rY.Tab,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,_.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,_.jsx)(Ok,{size:18}),"OpenAI API"]})}),(0,_.jsx)(rY.Tab,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,_.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,_.jsx)(OT,{size:18}),"LiteLLM Proxy"]})}),(0,_.jsx)(rY.Tab,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,_.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,_.jsx)(OS,{size:18}),"Cursor"]})}),(0,_.jsx)(rY.Tab,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,_.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,_.jsx)(ON,{size:18}),"Streamable HTTP"]})})]})}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsx)(rB.TabPanel,{className:"mt-6",children:(0,_.jsx)(()=>(0,_.jsxs)(U.Space,{direction:"vertical",size:"large",className:"w-full",children:[(0,_.jsxs)("div",{className:"bg-gradient-to-r from-blue-50 to-indigo-50 p-6 rounded-lg border border-blue-100",children:[(0,_.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,_.jsx)(Ok,{className:"text-blue-600",size:24}),(0,_.jsx)(OM,{level:4,className:"mb-0 text-blue-900",children:"OpenAI Responses API Integration"})]}),(0,_.jsx)(OC,{className:"text-blue-700",children:"Connect OpenAI Responses API to your LiteLLM MCP server for seamless tool integration"})]}),(0,_.jsxs)(U.Space,{direction:"vertical",size:"large",className:"w-full",children:[(0,_.jsx)(OO,{icon:(0,_.jsx)(Cm,{className:"text-blue-600",size:16}),title:"API Key Setup",description:"Configure your OpenAI API key for authentication",children:(0,_.jsxs)(U.Space,{direction:"vertical",size:"middle",className:"w-full",children:[(0,_.jsx)("div",{children:(0,_.jsxs)(OC,{children:["Get your API key from the"," ",(0,_.jsxs)("a",{href:"https://platform.openai.com/api-keys",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700 inline-flex items-center gap-1",children:["OpenAI platform ",(0,_.jsx)(Cu.default,{size:12})]})]})}),(0,_.jsx)(o,{title:"Environment Variable",code:'export OPENAI_API_KEY="sk-..."',copyKey:"openai-env"})]})}),(0,_.jsx)(OO,{icon:(0,_.jsx)(Cp,{className:"text-blue-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,_.jsx)(o,{title:"Server URL",code:`${t}/mcp`,copyKey:"openai-server-url"})}),(0,_.jsx)(OO,{icon:(0,_.jsx)(Ok,{className:"text-blue-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the Responses API",serverName:"Zapier Gmail",accessGroups:["dev-group"],children:(0,_.jsx)(o,{code:`curl --location 'https://api.openai.com/v1/responses' \\ +}`,rows:12,className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500 font-mono text-sm"})}):null,{Panel:L8}=tl.Collapse,L7=({availableAccessGroups:e,mcpServer:t,searchValue:r,setSearchValue:a,getAccessGroupOptions:s})=>{let n=H.Form.useFormInstance(),l=H.Form.useWatch("auth_type",n),i=l===LK.AUTH_TYPE.OAUTH2,o=l===LK.AUTH_TYPE.NONE||null==l,d=H.Form.useWatch("extra_headers",n),c=Array.isArray(d)&&d.some(e=>"string"==typeof e&&"authorization"===e.toLowerCase()),u=o&&c,m=H.Form.useWatch("delegate_auth_to_upstream",n),p=H.Form.useWatch("available_on_public_internet",n),h=i&&!0===m&&!1===p;return(0,T.useEffect)(()=>{if(t){if(t.static_headers){let e=Object.entries(t.static_headers).map(([e,t])=>({header:e,value:null!=t?String(t):""}));n.setFieldValue("static_headers",e)}Array.isArray(t.env_vars)&&t.env_vars.length>0&&n.setFieldValue("env_vars",t.env_vars.map(e=>({name:e.name,value:e.value??"",scope:e.scope??"global",description:e.description??""}))),"boolean"==typeof t.allow_all_keys&&n.setFieldValue("allow_all_keys",t.allow_all_keys),"boolean"==typeof t.available_on_public_internet&&n.setFieldValue("available_on_public_internet",t.available_on_public_internet),"boolean"==typeof t.delegate_auth_to_upstream&&n.setFieldValue("delegate_auth_to_upstream",t.delegate_auth_to_upstream),"boolean"==typeof t.oauth_passthrough&&n.setFieldValue("oauth_passthrough",t.oauth_passthrough)}else n.setFieldValue("allow_all_keys",!1),n.setFieldValue("available_on_public_internet",!0),n.setFieldValue("delegate_auth_to_upstream",!1),n.setFieldValue("oauth_passthrough",!1)},[t,n]),(0,T.useEffect)(()=>{i||n.setFieldValue("delegate_auth_to_upstream",!1)},[i,n]),(0,T.useEffect)(()=>{u||n.setFieldValue("oauth_passthrough",!1)},[u,n]),(0,_.jsx)(tl.Collapse,{className:"bg-gray-50 border border-gray-200 rounded-lg",expandIconPosition:"end",ghost:!1,children:(0,_.jsx)(L8,{header:(0,_.jsxs)("div",{className:"flex items-center",children:[(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,_.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Permission Management / Access Control"})]}),(0,_.jsx)("p",{className:"text-sm text-gray-600 ml-4",children:"Configure access permissions and security settings (Optional)"})]}),className:"border-0",forceRender:!0,children:(0,_.jsxs)("div",{className:"space-y-6 pt-4",children:[(0,_.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Allow All LiteLLM Keys",(0,_.jsx)(tB.Tooltip,{title:"When enabled, every API key can access this MCP server.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),(0,_.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:'Enable if this server should be "public" to all keys.'})]}),(0,_.jsx)(H.Form.Item,{name:"allow_all_keys",valuePropName:"checked",initialValue:t?.allow_all_keys??!1,className:"mb-0",children:(0,_.jsx)(e_.Switch,{})})]}),(0,_.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Internal network only",(0,_.jsx)(tB.Tooltip,{title:"When on, only requests from within your internal network are accepted. Turn off to allow external clients (other clusters, ChatGPT, etc). API key authentication is always required regardless of this setting.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),(0,_.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:"Turn on to restrict access to callers within your internal network only."})]}),(0,_.jsx)(H.Form.Item,{name:"available_on_public_internet",valuePropName:"checked",getValueProps:e=>({checked:!e}),getValueFromEvent:e=>!e,initialValue:!0,className:"mb-0",children:(0,_.jsx)(e_.Switch,{})})]}),i&&(0,_.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Delegate auth to upstream (PKCE passthrough)",(0,_.jsx)(tB.Tooltip,{title:"When on, LiteLLM skips its own API key/SSO check for this server and lets the client complete PKCE directly with the upstream MCP server. Only honored when Auth Type is oauth2. No spend tracking or per-key rate limiting will run on this route.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),(0,_.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:"Bypass LiteLLM auth so clients authenticate directly with the upstream OAuth MCP server."})]}),(0,_.jsx)(H.Form.Item,{name:"delegate_auth_to_upstream",valuePropName:"checked",initialValue:t?.delegate_auth_to_upstream??!1,className:"mb-0",children:(0,_.jsx)(e_.Switch,{})})]}),u&&(0,_.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth pass-through",(0,_.jsx)(tB.Tooltip,{title:"When on, this server is treated as an OAuth pass-through: the gateway proxies the upstream /.well-known/oauth-protected-resource metadata, emits spec-compliant 401 challenges when no bearer is supplied, and propagates upstream 401/403 responses. Only honored when Auth Type is None and 'Authorization' is in Extra Headers.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),(0,_.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:"Forward upstream OAuth discovery and 401 challenges so clients negotiate OAuth directly with the upstream MCP server."})]}),(0,_.jsx)(H.Form.Item,{name:"oauth_passthrough",valuePropName:"checked",initialValue:t?.oauth_passthrough??!1,className:"mb-0",children:(0,_.jsx)(e_.Switch,{})})]}),h&&(0,_.jsx)(B.Alert,{type:"warning",showIcon:!0,className:"mb-2",message:"Internal server with upstream OAuth delegation",description:"This MCP server is configured as internal-only but delegates auth to upstream. Anonymous users will be able to reach the upstream OAuth2 /authorize flow without a LiteLLM session. Ensure your upstream provider and network enforce access controls."}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Access Groups",(0,_.jsx)(tB.Tooltip,{title:"Specify access groups for this MCP server. Users must be in at least one of these groups to access the server.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"mcp_access_groups",className:"mb-4",children:(0,_.jsx)(eE.Select,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"value",filterOption:(e,t)=>(t?.value??"").toLowerCase().includes(e.toLowerCase()),onSearch:e=>a(e),tokenSeparators:[","],options:s(),maxTagCount:"responsive",allowClear:!0})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Extra Headers",(0,_.jsx)(tB.Tooltip,{title:"Forward custom headers from incoming requests to this MCP server (e.g., Authorization, X-Custom-Header, User-Agent)",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})}),t?.extra_headers&&t.extra_headers.length>0&&(0,_.jsxs)("span",{className:"ml-2 text-xs bg-blue-100 text-blue-700 px-2 py-1 rounded-full",children:[t.extra_headers.length," configured"]})]}),name:"extra_headers",children:(0,_.jsx)(eE.Select,{mode:"tags",placeholder:t?.extra_headers&&t.extra_headers.length>0?`Currently: ${t.extra_headers.join(", ")}`:"Enter header names (e.g., Authorization, X-Custom-Header)",className:"rounded-lg",size:"large",tokenSeparators:[","],allowClear:!0})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Static Headers",(0,_.jsx)(tB.Tooltip,{title:"Send these key-value headers with every request to this MCP server.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),required:!1,children:(0,_.jsx)(H.Form.List,{name:"static_headers",children:(e,{add:t,remove:r})=>(0,_.jsxs)("div",{className:"space-y-3",children:[e.map(({key:e,name:t,...a})=>(0,_.jsxs)(U.Space,{className:"flex w-full",align:"baseline",size:"middle",children:[(0,_.jsx)(H.Form.Item,{...a,name:[t,"header"],className:"flex-1",rules:[{required:!0,message:"Header name is required"}],children:(0,_.jsx)($.Input,{size:"large",allowClear:!0,className:"rounded-lg",placeholder:"Header name (e.g., X-API-Key)"})}),(0,_.jsx)(H.Form.Item,{...a,name:[t,"value"],className:"flex-1",rules:[{required:!0,message:"Header value is required"}],children:(0,_.jsx)($.Input,{size:"large",allowClear:!0,className:"rounded-lg",placeholder:"Header value"})}),(0,_.jsx)(t0.MinusCircleOutlined,{onClick:()=>r(t),className:"text-gray-500 hover:text-red-500 cursor-pointer"})]},e)),(0,_.jsx)(z.Button,{type:"dashed",onClick:()=>t(),icon:(0,_.jsx)(tZ.PlusOutlined,{}),block:!0,children:"Add Static Header"})]})})})]})},"permissions")})},L9=({accessToken:e,selectedName:t,onSelect:r})=>{let[a,s]=(0,T.useState)([]),[n,l]=(0,T.useState)(!1),[i,o]=(0,T.useState)(new Set);return((0,T.useEffect)(()=>{e&&(l(!0),(0,Q.fetchOpenAPIRegistry)(e).then(e=>s(e.apis??[])).catch(()=>s([])).finally(()=>l(!1)))},[e]),n)?(0,_.jsxs)("div",{className:"mb-4",children:[(0,_.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Popular APIs"}),(0,_.jsx)("div",{className:"flex justify-center py-6",children:(0,_.jsx)(rm.Spin,{size:"small"})})]}):0===a.length?null:(0,_.jsxs)("div",{className:"mb-4",children:[(0,_.jsx)("span",{className:"text-sm font-medium text-gray-700 block mb-2",children:"Popular APIs"}),(0,_.jsx)("div",{className:"grid grid-cols-5 gap-2",children:a.map(e=>{let a=t===e.name,s=i.has(e.name);return(0,_.jsxs)("button",{type:"button",title:e.description,onClick:()=>r(e),className:`flex flex-col items-center gap-1.5 p-3 rounded-lg border transition-all cursor-pointer + ${a?"border-blue-500 bg-blue-50 shadow-sm":"border-gray-200 hover:border-blue-300 hover:bg-gray-50"}`,children:[s?(0,_.jsx)("span",{className:"w-7 h-7 rounded-full bg-gray-200 flex items-center justify-center text-sm font-bold text-gray-600",children:e.title.charAt(0)}):(0,_.jsx)("img",{src:e.icon_url,alt:e.title,className:"w-7 h-7 object-contain",onError:()=>{var t;return t=e.name,void o(e=>new Set(e).add(t))}}),(0,_.jsx)("span",{className:"text-xs text-gray-600 text-center leading-tight font-medium",children:e.title})]},e.name)})}),(0,_.jsx)("p",{className:"text-xs text-gray-400 mt-2",children:"Select an API to pre-fill the spec URL and OAuth 2.0 settings, or enter your own spec URL below."})]})},Oe=({form:e,accessToken:t,onValuesChange:r,onKeyToolsChange:a,onLogoUrlChange:s,onOAuthDocsUrlChange:n})=>{let[l,i]=(0,T.useState)(null);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(L9,{accessToken:t,selectedName:l,onSelect:t=>{i(t.name),a?.(t.key_tools??[]),s?.(t.icon_url||void 0);let l={spec_path:t.spec_url};t.oauth?(l.auth_type=LK.AUTH_TYPE.OAUTH2,l.oauth_flow_type=LK.OAUTH_FLOW.INTERACTIVE,l.authorization_url=t.oauth.authorization_url,l.token_url=t.oauth.token_url,e.setFieldsValue(l),n?.(t.oauth.docs_url??null)):(e.resetFields(["auth_type","authorization_url","token_url"]),e.setFieldsValue(l),n?.(null)),r(l)}}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OpenAPI Spec URL",(0,_.jsx)(tB.Tooltip,{title:"URL to an OpenAPI specification (JSON or YAML). MCP tools will be automatically generated from the API endpoints defined in the spec.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"spec_path",rules:[{required:!0,message:"Please enter an OpenAPI spec URL"}],children:(0,_.jsx)($.Input,{placeholder:"https://petstore3.swagger.io/api/v3/openapi.json",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500",onChange:()=>{i(null),a?.([]),n?.(null)}})})]})},Ot="/ui/assets/logos/",Or=[{name:"GitHub",url:`${Ot}github.svg`},{name:"Slack",url:`${Ot}slack.svg`},{name:"Notion",url:`${Ot}notion.svg`},{name:"Linear",url:`${Ot}linear.svg`},{name:"Jira",url:`${Ot}jira.svg`},{name:"Figma",url:`${Ot}figma.svg`},{name:"Gmail",url:`${Ot}gmail.svg`},{name:"Google Drive",url:`${Ot}google_drive.svg`},{name:"Stripe",url:`${Ot}stripe.svg`},{name:"Shopify",url:`${Ot}shopify.svg`},{name:"Salesforce",url:`${Ot}salesforce.svg`},{name:"HubSpot",url:`${Ot}hubspot.svg`},{name:"Twilio",url:`${Ot}twilio.svg`},{name:"Cloudflare",url:`${Ot}cloudflare.svg`},{name:"Sentry",url:`${Ot}sentry.svg`},{name:"PostgreSQL",url:`${Ot}postgresql.svg`},{name:"Snowflake",url:`${Ot}snowflake.svg`},{name:"Zapier",url:`${Ot}zapier.svg`},{name:"Google",url:`${Ot}google.svg`},{name:"GitLab",url:`${Ot}gitlab.svg`}],Oa=({value:e,onChange:t})=>{let[r,a]=(0,T.useState)(new Set);return(0,_.jsxs)("div",{children:[(0,_.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,_.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Logo"}),(0,_.jsx)(tB.Tooltip,{title:"Select a well-known logo or paste a URL to any image. The logo is shown on the admin and chat pages.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"text-blue-400 hover:text-blue-600 cursor-help"})})]}),e&&(0,_.jsxs)("div",{className:"flex items-center gap-3 mb-3 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[(0,_.jsx)("img",{src:e,alt:"Selected logo",className:"w-10 h-10 object-contain rounded",onError:e=>{e.target.style.display="none"}}),(0,_.jsx)("div",{className:"flex-1 min-w-0",children:(0,_.jsx)("div",{className:"text-xs text-gray-500 truncate",children:e})}),(0,_.jsx)("button",{type:"button",onClick:()=>t?.(void 0),className:"text-xs text-gray-400 hover:text-red-500 cursor-pointer bg-transparent border-none",children:"✕"})]}),(0,_.jsx)("div",{className:"grid grid-cols-10 gap-1.5 mb-3",children:Or.map(s=>{let n=e===s.url;return r.has(s.url)?null:(0,_.jsx)(tB.Tooltip,{title:s.name,children:(0,_.jsx)("button",{type:"button",onClick:()=>{var r;return r=s.url,void t?.(e===r?void 0:r)},className:`flex items-center justify-center p-2 rounded-lg border transition-all cursor-pointer + ${n?"border-blue-500 bg-blue-50 shadow-sm":"border-gray-200 hover:border-blue-300 hover:bg-gray-50"}`,style:{width:40,height:40},children:(0,_.jsx)("img",{src:s.url,alt:s.name,className:"w-5 h-5 object-contain",onError:()=>{var e;return e=s.url,void a(t=>new Set(t).add(e))}})})},s.name)})}),(0,_.jsx)($.Input,{prefix:(0,_.jsx)(en.LinkOutlined,{className:"text-gray-400"}),placeholder:"Or paste a custom logo URL...",value:e&&!Or.some(t=>t.url===e)?e:"",onChange:e=>{let r=e.target.value.trim();t?.(r||void 0)},className:"rounded-lg",size:"small"})]})},{Text:Os}=V.Typography,On=[{value:"global",label:"Instance"},{value:"user",label:"Per-user"}],Ol=({name:e,restField:t})=>"user"===H.Form.useWatch(["env_vars",e,"scope"])?(0,_.jsx)(H.Form.Item,{...t,name:[e,"description"],className:"mb-0",children:(0,_.jsx)($.Input,{addonBefore:(0,_.jsx)(tB.Tooltip,{title:"Per-user variables have no shared value. This text is only a hint shown to each user when they fill in their own value.",children:(0,_.jsxs)("span",{className:"text-xs text-gray-500 cursor-help whitespace-nowrap",children:[(0,_.jsx)(tK.InfoCircleOutlined,{className:"mr-1"}),"Hint"]})}),placeholder:"e.g. Your DB username",styles:{input:{color:"#9ca3af"}}})}):(0,_.jsx)(H.Form.Item,{...t,name:[e,"value"],className:"mb-0",children:(0,_.jsx)($.Input,{placeholder:"e.g. postgresql",className:"rounded-md font-mono"})}),Oi=()=>(0,_.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-gray-50 p-4",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,_.jsx)(Os,{strong:!0,className:"text-sm",children:"Variables"}),(0,_.jsx)(tB.Tooltip,{title:(0,_.jsxs)(_.Fragment,{children:["Define variables you can interpolate in Static Headers or Authentication using"," ",(0,_.jsx)("code",{children:"${VAR_NAME}"}),". ",(0,_.jsx)("br",{}),(0,_.jsx)("b",{children:"Instance"}),": admin-defined value used for every user.",(0,_.jsx)("br",{}),(0,_.jsx)("b",{children:"Per-user"}),": each user supplies their own value (e.g. personal credentials) via the MCP Gateway dashboard."]}),children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"text-blue-400 hover:text-blue-600 cursor-help"})})]}),(0,_.jsxs)(Os,{className:"text-xs text-gray-600 block mb-3",children:["Reference these in Static Headers or Authentication as ",(0,_.jsx)("code",{children:"${VAR_NAME}"}),". For example:"," ",(0,_.jsx)("code",{className:"bg-white px-1 rounded border border-gray-200",children:"${DB_PROTOCOL}://${CORP_USERNAME}:${CORP_PASSWORD}@${DB_HOSTNAME}"})]}),(0,_.jsx)(H.Form.List,{name:"env_vars",children:(e,{add:t,remove:r})=>(0,_.jsxs)("div",{className:"space-y-2",children:[e.length>0&&(0,_.jsxs)("div",{className:"flex gap-3 px-1 text-xs font-medium text-gray-500 uppercase tracking-wide",children:[(0,_.jsx)("div",{style:{flex:1},children:"Variable Name"}),(0,_.jsx)("div",{style:{flex:1},children:"Value / Description"}),(0,_.jsx)("div",{style:{width:160},children:"Scope"}),(0,_.jsx)("div",{style:{width:24}})]}),e.map(({key:e,name:t,...a})=>(0,_.jsxs)("div",{className:"flex gap-3 items-start",children:[(0,_.jsx)(H.Form.Item,{...a,name:[t,"name"],className:"mb-0",style:{flex:1},rules:[{required:!0,message:"Variable name is required"},{pattern:/^[A-Za-z_][A-Za-z0-9_]*$/,message:"Use letters, digits, underscores; cannot start with a digit."}],children:(0,_.jsx)($.Input,{placeholder:"e.g. DB_PROTOCOL",className:"rounded-md font-mono"})}),(0,_.jsx)("div",{style:{flex:1},children:(0,_.jsx)(Ol,{name:t,restField:a})}),(0,_.jsx)(H.Form.Item,{...a,name:[t,"scope"],className:"mb-0",initialValue:"global",style:{width:160},children:(0,_.jsx)(eE.Select,{options:On})}),(0,_.jsx)("div",{style:{width:24,height:32},className:"flex items-center justify-center",children:(0,_.jsx)(t0.MinusCircleOutlined,{onClick:()=>r(t),className:"text-gray-500 hover:text-red-500 cursor-pointer"})})]},e)),(0,_.jsx)(z.Button,{type:"dashed",onClick:()=>t({scope:"global"}),icon:(0,_.jsx)(tZ.PlusOutlined,{}),block:!0,children:"Add Variable"})]})})]}),Oo=e=>{try{let t=e.indexOf("/mcp/");if(-1===t)return{token:null,baseUrl:e};let r=e.split("/mcp/");if(2!==r.length)return{token:null,baseUrl:e};let a=r[0]+"/mcp/",s=r[1];if(!s)return{token:null,baseUrl:e};return{token:s,baseUrl:a}}catch(t){return console.error("Error parsing MCP URL:",t),{token:null,baseUrl:e}}},Od=e=>{let{token:t}=Oo(e);return{maskedUrl:(e=>{let{token:t,baseUrl:r}=Oo(e);return t?r+"...":e})(e),hasToken:!!t}},Oc=e=>e?/^https?:\/\/[^\s/$.?#].[^\s]*$/i.test(e)?Promise.resolve():Promise.reject("Please enter a valid URL (e.g., http://service-name.domain:1234/path or https://example.com)"):Promise.resolve(),Ou=e=>e&&(e.includes("-")||e.includes(" "))?Promise.reject("Cannot contain '-' (hyphen) or spaces. Please use '_' (underscore) instead."):Promise.resolve(),Om=e=>{if(!Array.isArray(e))return[];let t=new Set,r=[];for(let a of e){if(!a||"object"!=typeof a)continue;let e=String(a.name??"").trim();if(!e||t.has(e)||!/^[A-Za-z_][A-Za-z0-9_]*$/.test(e))continue;let s="user"===a.scope?"user":"global";r.push({name:e,value:"user"===s?"":String(a.value??""),scope:s,description:a.description||void 0}),t.add(e)}return r};var Op=e.i(122520),Oh=e.i(165615),Of=e.i(434166);let Ox=({accessToken:e,getCredentials:t,getTemporaryPayload:r,onTokenReceived:a,onBeforeRedirect:s,flowSource:n})=>{let[l,i]=(0,T.useState)("idle"),[o,d]=(0,T.useState)(null),[c,u]=(0,T.useState)(null),m=(0,T.useRef)(!1),p="litellm-mcp-oauth-flow-state",h="litellm-mcp-oauth-result",f="litellm-mcp-oauth-return-url",x=(e,t)=>{(0,Of.setSecureItem)(e,t)},g=e=>{try{return(0,Of.getSecureItem)(e)}catch(t){return console.warn(`Failed to get storage item ${e}`,t),null}},y=()=>{try{window.sessionStorage.removeItem(p),window.sessionStorage.removeItem(h),window.sessionStorage.removeItem(f),window.localStorage.removeItem(p),window.localStorage.removeItem(h),window.localStorage.removeItem(f)}catch(e){console.warn("Failed to clear OAuth storage",e)}},_=()=>{let e,t,r;return r=((t=(e=window.location.pathname||"").indexOf("/ui"))>=0?e.slice(0,t+3):"").replace(/\/+$/,""),`${window.location.origin}${r}/mcp/oauth/callback`},b=(0,T.useCallback)(async()=>{let a=t()||{};if(!e){d("Missing admin token"),J.default.error("Access token missing. Please re-authenticate and try again.");return}let l=r();if(!l||!l.url||!l.transport){let e="Please complete server URL and transport before starting OAuth.";d(e),J.default.error(e);return}try{i("authorizing"),d(null);let t=await (0,Q.cacheTemporaryMcpServer)(e,l),r=t?.server_id?.trim();if(!r)throw Error("Temporary MCP server identifier missing. Please retry.");let o={};if(!(l.credentials?.client_id&&l.credentials?.client_secret)){let t=await (0,Q.registerMcpOAuthClient)(e,r,{client_name:l.alias||l.server_name||r,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:l.credentials&&l.credentials.client_secret?"client_secret_post":"none"});o={clientId:t?.client_id,clientSecret:t?.client_secret}}let c=(0,Oh.generateCodeVerifier)(),u=await (0,Oh.generateCodeChallenge)(c),m=crypto.randomUUID(),h=o.clientId||a.client_id,g=Array.isArray(a.scopes)?a.scopes.filter(e=>e&&e.trim().length>0).join(" "):void 0,y=(0,Q.buildMcpOAuthAuthorizeUrl)({serverId:r,clientId:h,redirectUri:_(),state:m,codeChallenge:u,scope:g}),b={state:m,codeVerifier:c,clientId:h,clientSecret:o.clientSecret||a.client_secret,serverId:r,redirectUri:_(),flowSource:n};if(s)try{s()}catch(e){console.error("Failed to prepare for OAuth redirect",e)}try{x(p,JSON.stringify(b)),x(f,window.location.href)}catch(e){throw Error("Unable to access browser storage for OAuth. Please enable storage and retry.")}window.location.href=y}catch(t){console.error("Failed to start OAuth flow",t),i("error");let e=(0,Op.extractErrorMessage)(t);d(e),J.default.error(e)}},[e,t,r,s]),v=(0,T.useCallback)(async()=>{if(m.current)return;let t=null,r=null;try{let e=g(h);if(!e)return;let a=g(p);if(!a)return;m.current=!0,t=JSON.parse(e),r=JSON.parse(a)}catch(e){y(),m.current=!1,d("Failed to resume OAuth flow. Please retry."),i("error"),J.default.error("Failed to resume OAuth flow. Please retry.");return}if(!t||r?.flowSource!==n){m.current=!1;return}try{window.sessionStorage.removeItem(h),window.localStorage.removeItem(h)}catch(e){}try{if(!r||!r.state||!r.codeVerifier||!r.serverId)throw Error("OAuth session state was lost. This can happen if you have strict browser privacy settings. Please try again and ensure cookies/storage is enabled.");if(!t.state||t.state!==r.state)throw Error("OAuth state mismatch. Please retry.");if(t.error)throw Error(t.error_description||t.error);if(!t.code)throw Error("Authorization code missing in callback.");i("exchanging");let s=await (0,Q.exchangeMcpOAuthToken)({serverId:r.serverId,code:t.code,clientId:r.clientId,clientSecret:r.clientSecret,codeVerifier:r.codeVerifier,redirectUri:r.redirectUri,accessToken:e});a(s),u(s),i("success"),d(null),J.default.success("OAuth token retrieved successfully")}catch(t){let e=(0,Op.extractErrorMessage)(t);d(e),i("error"),J.default.error(e)}finally{y(),setTimeout(()=>{m.current=!1},1e3)}},[a]);return(0,T.useEffect)(()=>{v()},[v]),{startOAuthFlow:b,status:l,error:o,tokenResponse:c,reset:(0,T.useCallback)(()=>{i("idle"),d(null),u(null),m.current=!1},[])}},Og="../ui/assets/logos/mcp_logo.png",Oy=[LK.AUTH_TYPE.API_KEY,LK.AUTH_TYPE.BEARER_TOKEN,LK.AUTH_TYPE.TOKEN,LK.AUTH_TYPE.BASIC],O_=[...Oy,LK.AUTH_TYPE.OAUTH2,LK.AUTH_TYPE.AWS_SIGV4],Ob="litellm-mcp-oauth-create-state",Ov=e=>Array.isArray(e)?e.reduce((e,t)=>{let r=t?.header?.trim();return r&&(e[r]=(t?.value??"").trim()),e},{}):{},Oj=({userID:e,userRole:t,accessToken:r,onCreateSuccess:a,isModalVisible:s,setModalVisible:n,availableAccessGroups:l,prefillData:i,onBackToDiscovery:o})=>{let[d]=H.Form.useForm(),[c,u]=(0,T.useState)(!1),[m,p]=(0,T.useState)({}),[h,f]=(0,T.useState)({}),[x,g]=(0,T.useState)(null),[y,b]=(0,T.useState)(!1),[v,j]=(0,T.useState)([]),[w,k]=(0,T.useState)(!1),[N,M]=(0,T.useState)({}),[C,L]=(0,T.useState)({}),[O,D]=(0,T.useState)(""),[P,A]=(0,T.useState)([]),[E,I]=(0,T.useState)(""),[Y,F]=(0,T.useState)(null),[R,B]=(0,T.useState)(void 0),[z,U]=(0,T.useState)(null),{tools:W,isLoadingTools:V,toolsError:G,toolsErrorStackTrace:K,canFetchTools:X,fetchTools:Z,clearTools:ee}=(({accessToken:e,oauthAccessToken:t,formValues:r,enabled:a=!0})=>{let[s,n]=(0,T.useState)([]),[l,i]=(0,T.useState)(!1),[o,d]=(0,T.useState)(null),[c,u]=(0,T.useState)(null),[m,p]=(0,T.useState)(!1),h=r.auth_type===LK.AUTH_TYPE.OAUTH2&&r.oauth_flow_type===LK.OAUTH_FLOW.M2M,f=r.auth_type===LK.AUTH_TYPE.OAUTH2&&!h,x=r.transport===LK.TRANSPORT.OPENAPI,g=x?!!r.spec_path:!!r.url,y=x?!!(g&&e):!!(g&&r.transport&&r.auth_type&&e&&(!f||t)),_=JSON.stringify(r.static_headers??{}),b=JSON.stringify(r.credentials??{}),v=async()=>{if(e&&(r.url||r.spec_path)&&(!f||t||x)){i(!0),d(null);try{let a=Array.isArray(r.static_headers)?r.static_headers.reduce((e,t)=>{let r=t?.header?.trim();return r&&(e[r]=t?.value!=null?String(t.value):""),e},{}):!Array.isArray(r.static_headers)&&r.static_headers&&"object"==typeof r.static_headers?Object.entries(r.static_headers).reduce((e,[t,r])=>(t&&(e[t]=null!=r?String(r):""),e),{}):{},s=r.credentials&&"object"==typeof r.credentials?Object.entries(r.credentials).reduce((e,[t,r])=>{if(null==r||""===r)return e;if("scopes"===t){if(Array.isArray(r)){let a=r.filter(e=>null!=e&&""!==e);a.length>0&&(e[t]=a)}}else e[t]=r;return e},{}):void 0,l=r.transport===LK.TRANSPORT.OPENAPI?"http":r.transport,i={server_id:r.server_id||"",server_name:r.server_name||"",url:r.url,spec_path:r.spec_path,transport:l,auth_type:r.auth_type,authorization_url:r.authorization_url,token_url:r.token_url,registration_url:r.registration_url,mcp_info:r.mcp_info,static_headers:a};s&&Object.keys(s).length>0&&(i.credentials=s);let o=await (0,Q.testMCPToolsListRequest)(e,i,t);if(o.tools&&!o.error)n(o.tools),d(null),u(null),o.tools.length>0&&!m&&p(!0);else{let e=o.message||"Failed to retrieve tools list";d(e),u(o.stack_trace||null),n([]),p(!1)}}catch(e){console.error("Tools fetch error:",e),d(e instanceof Error?e.message:String(e)),u(null),n([]),p(!1)}finally{i(!1)}}},j=(0,T.useCallback)(()=>{n([]),d(null),u(null),p(!1)},[]);return(0,T.useEffect)(()=>{a&&(y?v():j())},[r.url,r.spec_path,r.transport,r.auth_type,e,a,t,y,_,b]),{tools:s,isLoadingTools:l,toolsError:o,toolsErrorStackTrace:c,hasShownSuccessMessage:m,canFetchTools:y,fetchTools:v,clearTools:j}})({accessToken:r,oauthAccessToken:Y,formValues:h,enabled:!0}),er=h.auth_type,ea=!!er&&Oy.includes(er),es=er===LK.AUTH_TYPE.OAUTH2,en=er===LK.AUTH_TYPE.AWS_SIGV4,el=es&&h.oauth_flow_type===LK.OAUTH_FLOW.M2M,{startOAuthFlow:ei,status:eo,error:ed,tokenResponse:ec,reset:eu}=Ox({accessToken:r,getCredentials:()=>d.getFieldValue("credentials"),getTemporaryPayload:()=>{let e=d.getFieldsValue(!0),t=e.transport||O,r=e.url||(t===LK.TRANSPORT.OPENAPI?e.spec_path:void 0);if(!r||!t)return null;let a=Ov(e.static_headers);return{server_id:void 0,server_name:e.server_name,alias:e.alias,description:e.description,url:r,transport:t===LK.TRANSPORT.OPENAPI?"http":t,auth_type:LK.AUTH_TYPE.OAUTH2,credentials:e.credentials,authorization_url:e.authorization_url,token_url:e.token_url,registration_url:e.registration_url,mcp_access_groups:e.mcp_access_groups,static_headers:a,command:e.command,args:e.args,env:e.env}},onTokenReceived:e=>{if(F(e?.access_token??null),e?.access_token){let t={access_token:e.access_token,...e.refresh_token&&{refresh_token:e.refresh_token},...e.expires_in&&{expires_in:e.expires_in},...e.scope&&{scope:e.scope}};d.setFieldsValue({credentials:t}),J.default.success("OAuth authorization successful! Please click 'Create MCP Server' to save the configuration.")}},onBeforeRedirect:()=>{try{let e=d.getFieldsValue(!0);(0,Of.setSecureItem)(Ob,JSON.stringify({modalVisible:s,formValues:e,transportType:O,costConfig:m,allowedTools:v,hasToolAllowlistInteraction:w,searchValue:E,aliasManuallyEdited:y,logoUrl:R}))}catch(e){console.warn("Failed to persist MCP create state",e)}},flowSource:"create"});T.default.useEffect(()=>{let e=(0,Of.getSecureItem)(Ob);if(e)try{let t=JSON.parse(e);t.modalVisible&&n(!0);let r=t.formValues?.transport||t.transportType||"";r&&D(r),t.formValues&&g({values:t.formValues,transport:r}),t.costConfig&&p(t.costConfig),t.allowedTools&&j(t.allowedTools),"boolean"==typeof t.hasToolAllowlistInteraction&&k(t.hasToolAllowlistInteraction),t.searchValue&&I(t.searchValue),"boolean"==typeof t.aliasManuallyEdited&&b(t.aliasManuallyEdited),t.logoUrl&&B(t.logoUrl)}catch(e){console.error("Failed to restore MCP create state",e)}finally{window.sessionStorage.removeItem(Ob)}},[d,n]),T.default.useEffect(()=>{x&&(O||x.transport,(!x.transport||O)&&(d.setFieldsValue(x.values),f(x.values),g(null)))},[x,d,O]),T.default.useEffect(()=>{if(!s||!i)return;let e=(i.name||"").replace(/[^a-zA-Z0-9_]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,""),t=i.transport||"";D(t);let r={server_name:e,alias:e,description:i.description||"",transport:t};if("stdio"===t){let e={};if(i.command&&(e.command=i.command),i.args&&i.args.length>0&&(e.args=i.args),i.env_vars&&i.env_vars.length>0){let t={};for(let e of i.env_vars)t[e.name]=e.description?`<${e.description}>`:"";e.env=t}Object.keys(e).length>0&&(r.stdio_config=JSON.stringify(e,null,2))}else i.url&&(r.url=i.url);d.setFieldsValue(r),f(r),b(!1)},[s,i,d]);let em=async t=>{u(!0);try{let{static_headers:s,env_vars:l,stdio_config:i,credentials:o,allow_all_keys:c,available_on_public_internet:h,delegate_auth_to_upstream:f,oauth_passthrough:x,token_validation_json:g,...y}=t,_=y.mcp_access_groups,S=Ov(s),T=Om(l),M=o&&"object"==typeof o?Object.entries(o).reduce((e,[t,r])=>{if(null==r||""===r)return e;if("scopes"===t){if(Array.isArray(r)){let a=r.filter(e=>null!=e&&""!==e);a.length>0&&(e[t]=a)}}else e[t]=r;return e},{}):void 0,L={};if(i&&"stdio"===O)try{let e=JSON.parse(i),t=e;if(e.mcpServers&&"object"==typeof e.mcpServers){let r=Object.keys(e.mcpServers);if(r.length>0){let a=r[0];t=e.mcpServers[a],y.server_name||(y.server_name=a.replace(/-/g,"_"))}}L={command:t.command,args:t.args,env:t.env},console.log("Parsed stdio config:",L)}catch(e){J.default.fromBackend("Invalid JSON in stdio configuration");return}y.transport===LK.TRANSPORT.OPENAPI&&(y.transport="http");let D=null;if(g&&""!==g.trim())try{D=JSON.parse(g)}catch{J.default.fromBackend("Invalid JSON in Token Validation Rules"),u(!1);return}let P={...y,...L,stdio_config:void 0,mcp_info:{server_name:y.server_name||y.url,description:y.description,logo_url:R||void 0,mcp_server_cost_info:Object.keys(m).length>0?m:null,tool_allowlist_enforced:w||v.length>0},mcp_access_groups:_,alias:y.alias,allowed_tools:v,tool_name_to_display_name:N,tool_name_to_description:C,allow_all_keys:!!c,available_on_public_internet:!!h,delegate_auth_to_upstream:!!f,oauth_passthrough:!!x,static_headers:S,env_vars:T,...null!==D&&{token_validation:D}};if(y.auth_type&&O_.includes(y.auth_type)&&M&&Object.keys(M).length>0&&(P.credentials=M),console.log(`Payload: ${JSON.stringify(P)}`),null!=r){let s=eh?await (0,Q.createMCPServer)(r,P):await (0,Q.registerMCPServer)(r,P);if(ec?.access_token&&s?.server_id){let a=(0,LK.getMcpOAuthMode)({auth_type:y.auth_type,oauth2_flow:t.oauth_flow_type===LK.OAUTH_FLOW.M2M?LK.MCP_OAUTH2_FLOW_M2M:null,delegate_auth_to_upstream:!!f});if("obo"===a){let e=ec.scope;await (0,Q.storeMCPOAuthUserCredential)(r,s.server_id,{access_token:ec.access_token,refresh_token:ec.refresh_token,expires_in:ec.expires_in,scopes:"string"==typeof e&&e?e.split(" "):void 0})}else(0,LG.setToken)(s.server_id,{access_token:ec.access_token,expires_in:ec.expires_in,refresh_token:ec.refresh_token,token_type:ec.token_type},e)}J.default.success(eh?"MCP Server created successfully":"MCP Server submitted for admin review"),d.resetFields(),p({}),ee(),j([]),k(!1),b(!1),B(void 0),n(!1),a(s)}}catch(t){let e=t instanceof Error?t.message:String(t);J.default.fromBackend(eh?`Error creating MCP Server: ${e}`:`Error submitting MCP Server: ${e}`)}finally{u(!1)}},ep=()=>{d.resetFields(),p({}),ee(),j([]),k(!1),b(!1),B(void 0),n(!1)};T.default.useEffect(()=>{if(!y&&h.server_name){let e=h.server_name.replace(/\s+/g,"_");d.setFieldsValue({alias:e}),f(t=>({...t,alias:e}))}},[h.server_name]),T.default.useEffect(()=>{s||(d.resetFields(),f({}),F(null),ee(),eu())},[s,d,ee,eu]);let eh=(0,ts.isAdminRole)(t);return(0,_.jsx)(q.Modal,{title:(0,_.jsxs)("div",{className:"flex items-center pb-4 border-b border-gray-100",style:{gap:12},children:[o&&(0,_.jsx)("button",{onClick:o,className:"text-sm text-blue-600 hover:text-blue-800 cursor-pointer bg-transparent border-none",style:{flexShrink:0},children:"←"}),(0,_.jsx)("img",{src:Og,alt:"MCP Logo",className:"w-8 h-8 object-contain",style:{height:"20px",width:"20px",objectFit:"contain"}}),(0,_.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:eh?"Add New MCP Server":"Submit MCP Server for Review"})]}),open:s,width:1e3,onCancel:ep,footer:null,forceRender:!0,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,_.jsx)("div",{className:"mt-6",children:(0,_.jsxs)(H.Form,{form:d,onFinish:em,onValuesChange:(e,t)=>f(t),layout:"vertical",className:"space-y-6",children:[!eh&&(0,_.jsx)("div",{className:"rounded-md bg-blue-50 border border-blue-200 px-4 py-3 text-sm text-blue-800",children:"Your submission will be sent for admin review before it becomes active. Note: the request must be made with a team-scoped API key."}),(0,_.jsxs)("div",{className:"grid grid-cols-1 gap-6",children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Server Name",(0,_.jsx)(tB.Tooltip,{title:"Best practice: Use a descriptive name that indicates the server's purpose (e.g., 'GitHub_MCP', 'Email_Service'). Cannot contain spaces or hyphens; use underscores instead. Names must comply with SEP-986 and will be rejected if invalid (https://modelcontextprotocol.io/specification/2025-11-25/server/tools#tool-names).",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"server_name",rules:[{required:!1,message:"Please enter a server name"},{validator:(e,t)=>Ou(t)}],children:(0,_.jsx)(et.TextInput,{placeholder:"e.g., GitHub_MCP, Zapier_MCP, etc.",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Alias",(0,_.jsx)(tB.Tooltip,{title:"A short, unique identifier for this server. Defaults to the server name if not provided. Cannot contain spaces or hyphens; use underscores instead.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"alias",rules:[{required:!1},{validator:(e,t)=>Ou(t)}],children:(0,_.jsx)(et.TextInput,{placeholder:"e.g., GitHub_MCP, Zapier_MCP, etc.",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500",onChange:()=>b(!0)})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Description"}),name:"description",rules:[{required:!1,message:"Please enter a server description"}],children:(0,_.jsx)(et.TextInput,{placeholder:"Brief description of what this server does",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(Oa,{value:R,onChange:B}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"GitHub / Source URL"}),name:"source_url",children:(0,_.jsx)(et.TextInput,{placeholder:"https://github.com/org/mcp-server",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Transport Type"}),name:"transport",rules:[{required:!0,message:"Please select a transport type"}],children:(0,_.jsxs)(eE.Select,{placeholder:"Select transport",className:"rounded-lg",size:"large",onChange:e=>{D(e),"stdio"===e?d.setFieldsValue({url:void 0,spec_path:void 0,auth_type:void 0,credentials:void 0}):e===LK.TRANSPORT.OPENAPI?d.setFieldsValue({url:void 0,command:void 0,args:void 0,env:void 0}):d.setFieldsValue({spec_path:void 0,command:void 0,args:void 0,env:void 0})},value:O,children:[(0,_.jsx)(eE.Select.Option,{value:"http",children:"Streamable HTTP (Recommended)"}),(0,_.jsx)(eE.Select.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,_.jsx)(eE.Select.Option,{value:"stdio",children:"Standard Input/Output (stdio)"}),(0,_.jsx)(eE.Select.Option,{value:LK.TRANSPORT.OPENAPI,children:"OpenAPI Spec"})]})}),("http"===O||"sse"===O)&&(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"MCP Server URL"}),name:"url",rules:[{required:!0,message:"Please enter a server URL"},{validator:(e,t)=>Oc(t)}],children:(0,_.jsx)($.Input,{placeholder:"https://your-mcp-server.com",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),O===LK.TRANSPORT.OPENAPI&&(0,_.jsx)(Oe,{form:d,accessToken:s?r:null,onValuesChange:e=>f(t=>({...t,...e})),onKeyToolsChange:A,onLogoUrlChange:B,onOAuthDocsUrlChange:U}),O===LK.TRANSPORT.OPENAPI&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:["BYOK (Bring Your Own Key)",(0,_.jsx)(tB.Tooltip,{title:"When enabled, each user provides their own API key for this service. Keys are stored per-user and never shared.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"is_byok",valuePropName:"checked",children:(0,_.jsx)(e_.Switch,{})}),(0,_.jsx)(H.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.is_byok!==t.is_byok||e.auth_type!==t.auth_type,children:({getFieldValue:e})=>e("is_byok")?(0,_.jsxs)(_.Fragment,{children:[e("auth_type")&&"none"!==e("auth_type")&&(0,_.jsxs)("div",{className:"mb-4 p-3 bg-blue-50 rounded-lg text-sm text-blue-700 flex items-start gap-2",children:[(0,_.jsx)(tK.InfoCircleOutlined,{className:"mt-0.5 flex-shrink-0"}),(0,_.jsxs)("span",{children:["User keys will be sent as:"," ",(0,_.jsxs)("code",{className:"font-mono bg-blue-100 px-1 rounded",children:["bearer_token"===e("auth_type")&&"Authorization: Bearer {key}","token"===e("auth_type")&&"Authorization: token {key}","api_key"===e("auth_type")&&"x-api-key: {key}","basic"===e("auth_type")&&"Authorization: Basic {key}","authorization"===e("auth_type")&&"Authorization: {key}"]}),!e("auth_type")&&"Set Authentication Type below to specify the format."]})]}),!e("auth_type")&&(0,_.jsxs)("div",{className:"mb-4 p-3 bg-yellow-50 rounded-lg text-sm text-yellow-700 flex items-start gap-2",children:[(0,_.jsx)(tK.InfoCircleOutlined,{className:"mt-0.5 flex-shrink-0"}),(0,_.jsxs)("span",{children:["Set the ",(0,_.jsx)("strong",{children:"Authentication Type"})," below to specify how user keys are sent (e.g., Bearer Token, API Key header)."]})]}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Access Description",(0,_.jsx)(tB.Tooltip,{title:"List of permissions shown to users in the connection modal (e.g. 'Create and manage Jira issues')",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"byok_description",children:(0,_.jsx)(eE.Select,{mode:"tags",placeholder:"Add access description items (press Enter after each)",className:"w-full",tokenSeparators:[","]})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["API Key Help URL",(0,_.jsx)(tB.Tooltip,{title:"Optional link shown to users to help them find their API key",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"byok_api_key_help_url",children:(0,_.jsx)($.Input,{placeholder:"https://docs.example.com/api-keys"})})]}):null})]}),"stdio"!==O&&""!==O&&(0,_.jsx)(tl.Collapse,{defaultActiveKey:["auth"],className:"mb-4",items:[{key:"auth",label:(0,_.jsx)("span",{className:"text-sm font-semibold text-gray-700",children:"Authentication"}),children:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(H.Form.Item,{name:"auth_type",rules:[{required:!0,message:"Please select an auth type"}],children:(0,_.jsxs)(eE.Select,{placeholder:"Select auth type",className:"rounded-lg",size:"large",children:[(0,_.jsx)(eE.Select.Option,{value:"none",children:"None"}),(0,_.jsx)(eE.Select.Option,{value:"api_key",children:"API Key"}),(0,_.jsx)(eE.Select.Option,{value:"bearer_token",children:"Bearer Token"}),(0,_.jsx)(eE.Select.Option,{value:"token",children:"Token"}),(0,_.jsx)(eE.Select.Option,{value:"basic",children:"Basic Auth"}),(0,_.jsx)(eE.Select.Option,{value:"oauth2",children:"OAuth"}),(0,_.jsx)(eE.Select.Option,{value:"aws_sigv4",children:"AWS SigV4 (Bedrock AgentCore MCPs)"})]})}),ea&&(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Authentication Value",(0,_.jsx)(tB.Tooltip,{title:"Token, password, or header value to send with each request for the selected auth type.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","auth_value"],rules:[{validator:(e,t)=>t&&"string"==typeof t&&""===t.trim()?Promise.reject(Error("Authentication value cannot be empty whitespace")):Promise.resolve()}],children:(0,_.jsx)(et.TextInput,{type:"password",placeholder:"Enter token or secret",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),es&&(0,_.jsx)(LX,{isM2M:el,initialFlowType:LK.OAUTH_FLOW.INTERACTIVE,docsUrl:z,oauthFlow:{startOAuthFlow:ei,status:eo,error:ed,tokenResponse:ec}})]})}]}),"stdio"!==O&&""!==O&&en&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("p",{className:"text-sm text-gray-500 mb-2",children:["For MCP servers hosted on AWS Bedrock AgentCore."," ",(0,_.jsx)("a",{href:"https://docs.litellm.ai/docs/mcp_aws_sigv4",target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:text-blue-700",children:"View docs →"})]}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Region",(0,_.jsx)(tB.Tooltip,{title:"AWS region for SigV4 signing (e.g., us-east-1)",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_region_name"],rules:[{required:!0,message:"AWS region is required for SigV4 auth"}],children:(0,_.jsx)($.Input,{placeholder:"us-east-1",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Service Name",(0,_.jsx)(tB.Tooltip,{title:"AWS service name for SigV4 signing. Defaults to 'bedrock-agentcore'.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_service_name"],children:(0,_.jsx)($.Input,{placeholder:"bedrock-agentcore",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Access Key ID",(0,_.jsx)(tB.Tooltip,{title:"Optional. If not provided, falls back to the boto3 credential chain (IAM role, env vars, etc.).",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_access_key_id"],dependencies:[["credentials","aws_secret_access_key"]],rules:[({getFieldValue:e})=>({validator:(t,r)=>e(["credentials","aws_secret_access_key"])&&!r?Promise.reject(Error("Access Key ID is required when Secret Access Key is provided")):Promise.resolve()})],children:(0,_.jsx)($.Input.Password,{placeholder:"AKIA... (optional — uses IAM role if blank)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Secret Access Key",(0,_.jsx)(tB.Tooltip,{title:"Optional. Required if AWS Access Key ID is provided.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_secret_access_key"],dependencies:[["credentials","aws_access_key_id"]],rules:[({getFieldValue:e})=>({validator:(t,r)=>e(["credentials","aws_access_key_id"])&&!r?Promise.reject(Error("Secret Access Key is required when Access Key ID is provided")):Promise.resolve()})],children:(0,_.jsx)($.Input.Password,{placeholder:"Enter secret key (optional — uses IAM role if blank)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Session Token",(0,_.jsx)(tB.Tooltip,{title:"Optional. Only needed for temporary STS credentials.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_session_token"],children:(0,_.jsx)($.Input.Password,{placeholder:"Enter session token (optional)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Role ARN",(0,_.jsx)(tB.Tooltip,{title:"Optional. IAM role ARN to assume via STS before signing. If set, LiteLLM calls sts:AssumeRole to get temporary credentials. Uses ambient credentials (IAM role, env vars) as the source identity unless explicit keys are also provided.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_role_name"],children:(0,_.jsx)($.Input,{placeholder:"arn:aws:iam::123456789012:role/MyRole (optional)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Session Name",(0,_.jsx)(tB.Tooltip,{title:"Optional. Session name for the AssumeRole call — appears in CloudTrail logs. Auto-generated if omitted.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_session_name"],children:(0,_.jsx)($.Input,{placeholder:"litellm-prod (optional, auto-generated if blank)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})})]}),(0,_.jsx)(L3,{isVisible:"stdio"===O})]}),(0,_.jsx)("div",{className:"mt-8",children:(0,_.jsx)(Oi,{})}),(0,_.jsx)("div",{className:"mt-8",children:(0,_.jsx)(L7,{availableAccessGroups:l,mcpServer:null,searchValue:E,setSearchValue:I,getAccessGroupOptions:()=>{let e=l.map(e=>({value:e,label:(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,_.jsx)("span",{className:"font-medium",children:e})]})}));return E&&!l.some(e=>e.toLowerCase().includes(E.toLowerCase()))&&e.push({value:E,label:(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,_.jsx)("span",{className:"font-medium",children:E}),(0,_.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e}})}),(0,_.jsx)("div",{className:"mt-8 pt-6 border-t border-gray-200",children:(0,_.jsx)(L2,{formValues:h,tools:W,isLoadingTools:V,toolsError:G,toolsErrorStackTrace:K,canFetchTools:X,fetchTools:Z})}),(0,_.jsx)("div",{className:"mt-6",children:(0,_.jsx)(L6,{accessToken:r,formValues:h,allowedTools:v,existingAllowedTools:null,onAllowedToolsChange:j,hasToolAllowlistInteraction:w,onToolAllowlistInteraction:()=>k(!0),toolNameToDisplayName:N,toolNameToDescription:C,onToolNameToDisplayNameChange:M,onToolNameToDescriptionChange:L,keyTools:P,externalTools:W,externalIsLoading:V,externalError:G,externalCanFetch:X})}),(0,_.jsx)("div",{className:"mt-6",children:(0,_.jsx)(L1,{value:m,onChange:p,tools:W.filter(e=>v.includes(e.name)),disabled:!1})}),(0,_.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:[(0,_.jsx)(S.Button,{variant:"secondary",onClick:ep,children:"Cancel"}),(0,_.jsx)(S.Button,{variant:"primary",loading:c,children:c?"Creating...":"Add MCP Server"})]})]})})})},Ow=(0,eT.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]),Ok=(0,eT.default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]),OS=(0,eT.default)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);var Cu=Cu;let ON=(0,eT.default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),{Title:OT,Text:OM}=V.Typography,{Panel:OC}=tl.Collapse,OL=({icon:e,title:t,description:r,children:a,serverName:s,accessGroups:n=["dev-group"]})=>{let[l,i]=(0,T.useState)(!1);return(0,_.jsxs)(eg.Card,{className:"border border-gray-200",children:[(0,_.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,_.jsx)("span",{className:"p-2 rounded-lg bg-gray-50",children:e}),(0,_.jsxs)("div",{children:[(0,_.jsx)(OT,{level:5,className:"mb-0",children:t}),(0,_.jsx)(OM,{className:"text-gray-600",children:r})]})]}),s&&("Implementation Example"===t||"Configuration"===t)&&(0,_.jsxs)(H.Form.Item,{className:"mb-4",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,_.jsx)(e_.Switch,{size:"small",checked:l,onChange:i}),(0,_.jsxs)(OM,{className:"text-sm",children:["Limit tools to specific MCP servers or MCP groups by passing the ",(0,_.jsx)("code",{children:"x-mcp-servers"})," header"]})]}),l&&(0,_.jsx)(B.Alert,{className:"mt-2",type:"info",showIcon:!0,message:"Two Options",description:(0,_.jsxs)("div",{children:[(0,_.jsxs)("p",{children:[(0,_.jsx)("strong",{children:"Option 1:"})," Get a specific server: ",(0,_.jsxs)("code",{children:['"',s.replace(/\s+/g,"_"),'"']})]}),(0,_.jsxs)("p",{children:[(0,_.jsx)("strong",{children:"Option 2:"})," Get a group of MCPs: ",(0,_.jsx)("code",{children:'"dev-group"'})]}),(0,_.jsxs)("p",{className:"mt-2 text-sm text-gray-600",children:["You can also mix both: ",(0,_.jsx)("code",{children:'"Server1,dev-group"'})]})]})})]}),T.default.Children.map(a,e=>{if(T.default.isValidElement(e)&&e.props.hasOwnProperty("code")&&e.props.hasOwnProperty("copyKey")){let t=e.props.code;if(t&&t.includes('"headers":'))return T.default.cloneElement(e,{code:t.replace(/"headers":\s*{[^}]*}/,`"headers": ${JSON.stringify((()=>{let e={"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"};if(l&&s){let t=[s.replace(/\s+/g,"_"),...n].join(",");e["x-mcp-servers"]=t}return e})(),null,8)}`)})}return e})]})},OO=({currentServerAccessGroups:e=[]})=>{let t=(0,Q.getProxyBaseUrl)(),[r,a]=(0,T.useState)({}),[s,n]=(0,T.useState)({openai:[],litellm:[],cursor:[],http:[]}),[l]=(0,T.useState)("Zapier_MCP"),i=async(e,t)=>{await (0,rV.copyToClipboard)(e)&&(a(e=>({...e,[t]:!0})),setTimeout(()=>{a(e=>({...e,[t]:!1}))},2e3))},o=({code:e,copyKey:t,title:a,className:s=""})=>(0,_.jsxs)("div",{className:"relative group",children:[a&&(0,_.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,_.jsx)(Ow,{size:16,className:"text-blue-600"}),(0,_.jsx)(OM,{strong:!0,className:"text-gray-700",children:a})]}),(0,_.jsxs)(eg.Card,{className:`bg-gray-50 border border-gray-200 relative ${s}`,children:[(0,_.jsx)(z.Button,{type:"text",size:"small",icon:r[t]?(0,_.jsx)(M_.CheckIcon,{size:12}):(0,_.jsx)(Mb.CopyIcon,{size:12}),onClick:()=>i(e,t),className:`absolute top-2 right-2 z-10 transition-all duration-200 ${r[t]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`}),(0,_.jsx)("pre",{className:"text-sm overflow-x-auto pr-10 text-gray-800 font-mono leading-relaxed",children:e})]})]}),d=({step:e,title:t,children:r})=>(0,_.jsxs)("div",{className:"flex gap-4",children:[(0,_.jsx)("div",{className:"flex-shrink-0",children:(0,_.jsx)("div",{className:"w-8 h-8 bg-blue-600 text-white rounded-full flex items-center justify-center text-sm font-semibold",children:e})}),(0,_.jsxs)("div",{className:"flex-1",children:[(0,_.jsx)(OM,{strong:!0,className:"text-gray-800 block mb-2",children:t}),r]})]});return(0,_.jsx)("div",{children:(0,_.jsxs)(U.Space,{direction:"vertical",size:"large",className:"w-full",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(X.Title,{className:"text-3xl font-bold text-gray-900 mb-3",children:"Connect to your MCP client"}),(0,_.jsx)(Z.Text,{className:"text-lg text-gray-600",children:"Use tools directly from any MCP client with LiteLLM MCP. Enable your AI assistant to perform real-world tasks through a simple, secure connection."})]}),(0,_.jsxs)(rF.TabGroup,{className:"w-full",children:[(0,_.jsx)(rR.TabList,{className:"flex justify-start mt-8 mb-6",children:(0,_.jsxs)("div",{className:"flex bg-gray-100 p-1 rounded-lg",children:[(0,_.jsx)(rY.Tab,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,_.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,_.jsx)(Ow,{size:18}),"OpenAI API"]})}),(0,_.jsx)(rY.Tab,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,_.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,_.jsx)(ON,{size:18}),"LiteLLM Proxy"]})}),(0,_.jsx)(rY.Tab,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,_.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,_.jsx)(Ok,{size:18}),"Cursor"]})}),(0,_.jsx)(rY.Tab,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,_.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,_.jsx)(OS,{size:18}),"Streamable HTTP"]})})]})}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsx)(rB.TabPanel,{className:"mt-6",children:(0,_.jsx)(()=>(0,_.jsxs)(U.Space,{direction:"vertical",size:"large",className:"w-full",children:[(0,_.jsxs)("div",{className:"bg-gradient-to-r from-blue-50 to-indigo-50 p-6 rounded-lg border border-blue-100",children:[(0,_.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,_.jsx)(Ow,{className:"text-blue-600",size:24}),(0,_.jsx)(OT,{level:4,className:"mb-0 text-blue-900",children:"OpenAI Responses API Integration"})]}),(0,_.jsx)(OM,{className:"text-blue-700",children:"Connect OpenAI Responses API to your LiteLLM MCP server for seamless tool integration"})]}),(0,_.jsxs)(U.Space,{direction:"vertical",size:"large",className:"w-full",children:[(0,_.jsx)(OL,{icon:(0,_.jsx)(Cm,{className:"text-blue-600",size:16}),title:"API Key Setup",description:"Configure your OpenAI API key for authentication",children:(0,_.jsxs)(U.Space,{direction:"vertical",size:"middle",className:"w-full",children:[(0,_.jsx)("div",{children:(0,_.jsxs)(OM,{children:["Get your API key from the"," ",(0,_.jsxs)("a",{href:"https://platform.openai.com/api-keys",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700 inline-flex items-center gap-1",children:["OpenAI platform ",(0,_.jsx)(Cu.default,{size:12})]})]})}),(0,_.jsx)(o,{title:"Environment Variable",code:'export OPENAI_API_KEY="sk-..."',copyKey:"openai-env"})]})}),(0,_.jsx)(OL,{icon:(0,_.jsx)(Cp,{className:"text-blue-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,_.jsx)(o,{title:"Server URL",code:`${t}/mcp`,copyKey:"openai-server-url"})}),(0,_.jsx)(OL,{icon:(0,_.jsx)(Ow,{className:"text-blue-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the Responses API",serverName:"Zapier Gmail",accessGroups:["dev-group"],children:(0,_.jsx)(o,{code:`curl --location 'https://api.openai.com/v1/responses' \\ --header 'Content-Type: application/json' \\ --header "Authorization: Bearer $OPENAI_API_KEY" \\ --data '{ @@ -423,7 +423,7 @@ Return a structured verdict with confidence and justification.`,kx=`{ ], "input": "Run available tools", "tool_choice": "required" -}'`,copyKey:"openai-curl",className:"text-xs"})})]})]}),{})}),(0,_.jsx)(rB.TabPanel,{className:"mt-6",children:(0,_.jsx)(()=>(0,_.jsxs)(U.Space,{direction:"vertical",size:"large",className:"w-full",children:[(0,_.jsxs)("div",{className:"bg-gradient-to-r from-emerald-50 to-green-50 p-6 rounded-lg border border-emerald-100",children:[(0,_.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,_.jsx)(OT,{className:"text-emerald-600",size:24}),(0,_.jsx)(OM,{level:4,className:"mb-0 text-emerald-900",children:"LiteLLM Proxy API Integration"})]}),(0,_.jsx)(OC,{className:"text-emerald-700",children:"Connect to LiteLLM Proxy Responses API for seamless tool integration with multiple model providers"})]}),(0,_.jsxs)(U.Space,{direction:"vertical",size:"large",className:"w-full",children:[(0,_.jsx)(OO,{icon:(0,_.jsx)(Cm,{className:"text-emerald-600",size:16}),title:"Virtual Key Setup",description:"Configure your LiteLLM Proxy Virtual Key for authentication",children:(0,_.jsxs)(U.Space,{direction:"vertical",size:"middle",className:"w-full",children:[(0,_.jsx)("div",{children:(0,_.jsx)(OC,{children:"Get your Virtual Key from your LiteLLM Proxy dashboard or contact your administrator"})}),(0,_.jsx)(o,{title:"Environment Variable",code:'export LITELLM_API_KEY="sk-..."',copyKey:"litellm-env"})]})}),(0,_.jsx)(OO,{icon:(0,_.jsx)(Cp,{className:"text-emerald-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,_.jsx)(o,{title:"Server URL",code:`${t}/mcp`,copyKey:"litellm-server-url"})}),(0,_.jsx)(OO,{icon:(0,_.jsx)(Ok,{className:"text-emerald-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the LiteLLM Proxy Responses API",serverName:l,accessGroups:["dev-group"],children:(0,_.jsx)(o,{code:`curl --location '${t}/v1/responses' \\ +}'`,copyKey:"openai-curl",className:"text-xs"})})]})]}),{})}),(0,_.jsx)(rB.TabPanel,{className:"mt-6",children:(0,_.jsx)(()=>(0,_.jsxs)(U.Space,{direction:"vertical",size:"large",className:"w-full",children:[(0,_.jsxs)("div",{className:"bg-gradient-to-r from-emerald-50 to-green-50 p-6 rounded-lg border border-emerald-100",children:[(0,_.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,_.jsx)(ON,{className:"text-emerald-600",size:24}),(0,_.jsx)(OT,{level:4,className:"mb-0 text-emerald-900",children:"LiteLLM Proxy API Integration"})]}),(0,_.jsx)(OM,{className:"text-emerald-700",children:"Connect to LiteLLM Proxy Responses API for seamless tool integration with multiple model providers"})]}),(0,_.jsxs)(U.Space,{direction:"vertical",size:"large",className:"w-full",children:[(0,_.jsx)(OL,{icon:(0,_.jsx)(Cm,{className:"text-emerald-600",size:16}),title:"Virtual Key Setup",description:"Configure your LiteLLM Proxy Virtual Key for authentication",children:(0,_.jsxs)(U.Space,{direction:"vertical",size:"middle",className:"w-full",children:[(0,_.jsx)("div",{children:(0,_.jsx)(OM,{children:"Get your Virtual Key from your LiteLLM Proxy dashboard or contact your administrator"})}),(0,_.jsx)(o,{title:"Environment Variable",code:'export LITELLM_API_KEY="sk-..."',copyKey:"litellm-env"})]})}),(0,_.jsx)(OL,{icon:(0,_.jsx)(Cp,{className:"text-emerald-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,_.jsx)(o,{title:"Server URL",code:`${t}/mcp`,copyKey:"litellm-server-url"})}),(0,_.jsx)(OL,{icon:(0,_.jsx)(Ow,{className:"text-emerald-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the LiteLLM Proxy Responses API",serverName:l,accessGroups:["dev-group"],children:(0,_.jsx)(o,{code:`curl --location '${t}/v1/responses' \\ --header 'Content-Type: application/json' \\ --header "Authorization: Bearer $LITELLM_VIRTUAL_KEY" \\ --data '{ @@ -442,7 +442,7 @@ Return a structured verdict with confidence and justification.`,kx=`{ ], "input": "Run available tools", "tool_choice": "required" -}'`,copyKey:"litellm-curl",className:"text-xs"})})]})]}),{})}),(0,_.jsx)(rB.TabPanel,{className:"mt-6",children:(0,_.jsx)(()=>(0,_.jsxs)(U.Space,{direction:"vertical",size:"large",className:"w-full",children:[(0,_.jsxs)("div",{className:"bg-gradient-to-r from-purple-50 to-blue-50 p-6 rounded-lg border border-purple-100",children:[(0,_.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,_.jsx)(OS,{className:"text-purple-600",size:24}),(0,_.jsx)(OM,{level:4,className:"mb-0 text-purple-900",children:"Cursor IDE Integration"})]}),(0,_.jsx)(OC,{className:"text-purple-700",children:"Use tools directly from Cursor IDE with LiteLLM MCP. Enable your AI assistant to perform real-world tasks without leaving your coding environment."})]}),(0,_.jsxs)(eg.Card,{className:"border border-gray-200",children:[(0,_.jsx)(OM,{level:5,className:"mb-4 text-gray-800",children:"Setup Instructions"}),(0,_.jsxs)(U.Space,{direction:"vertical",size:"large",className:"w-full",children:[(0,_.jsx)(d,{step:1,title:"Open Cursor Settings",children:(0,_.jsxs)(OC,{className:"text-gray-600",children:["Use the keyboard shortcut ",(0,_.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"⇧+⌘+J"})," (Mac) or"," ",(0,_.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+Shift+J"})," (Windows/Linux)"]})}),(0,_.jsx)(d,{step:2,title:"Navigate to MCP Tools",children:(0,_.jsx)(OC,{className:"text-gray-600",children:'Go to the "MCP Tools" tab and click "New MCP Server"'})}),(0,_.jsxs)(d,{step:3,title:"Add Configuration",children:[(0,_.jsxs)(OC,{className:"text-gray-600 mb-3",children:["Copy the JSON configuration below and paste it into Cursor, then save with"," ",(0,_.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Cmd+S"})," or"," ",(0,_.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+S"})]}),(0,_.jsx)(OO,{icon:(0,_.jsx)(Ok,{className:"text-purple-600",size:16}),title:"Configuration",description:"Cursor MCP configuration",serverName:"Zapier Gmail",accessGroups:["dev-group"],children:(0,_.jsx)(o,{code:`{ +}'`,copyKey:"litellm-curl",className:"text-xs"})})]})]}),{})}),(0,_.jsx)(rB.TabPanel,{className:"mt-6",children:(0,_.jsx)(()=>(0,_.jsxs)(U.Space,{direction:"vertical",size:"large",className:"w-full",children:[(0,_.jsxs)("div",{className:"bg-gradient-to-r from-purple-50 to-blue-50 p-6 rounded-lg border border-purple-100",children:[(0,_.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,_.jsx)(Ok,{className:"text-purple-600",size:24}),(0,_.jsx)(OT,{level:4,className:"mb-0 text-purple-900",children:"Cursor IDE Integration"})]}),(0,_.jsx)(OM,{className:"text-purple-700",children:"Use tools directly from Cursor IDE with LiteLLM MCP. Enable your AI assistant to perform real-world tasks without leaving your coding environment."})]}),(0,_.jsxs)(eg.Card,{className:"border border-gray-200",children:[(0,_.jsx)(OT,{level:5,className:"mb-4 text-gray-800",children:"Setup Instructions"}),(0,_.jsxs)(U.Space,{direction:"vertical",size:"large",className:"w-full",children:[(0,_.jsx)(d,{step:1,title:"Open Cursor Settings",children:(0,_.jsxs)(OM,{className:"text-gray-600",children:["Use the keyboard shortcut ",(0,_.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"⇧+⌘+J"})," (Mac) or"," ",(0,_.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+Shift+J"})," (Windows/Linux)"]})}),(0,_.jsx)(d,{step:2,title:"Navigate to MCP Tools",children:(0,_.jsx)(OM,{className:"text-gray-600",children:'Go to the "MCP Tools" tab and click "New MCP Server"'})}),(0,_.jsxs)(d,{step:3,title:"Add Configuration",children:[(0,_.jsxs)(OM,{className:"text-gray-600 mb-3",children:["Copy the JSON configuration below and paste it into Cursor, then save with"," ",(0,_.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Cmd+S"})," or"," ",(0,_.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+S"})]}),(0,_.jsx)(OL,{icon:(0,_.jsx)(Ow,{className:"text-purple-600",size:16}),title:"Configuration",description:"Cursor MCP configuration",serverName:"Zapier Gmail",accessGroups:["dev-group"],children:(0,_.jsx)(o,{code:`{ "mcpServers": { "Zapier_MCP": { "url": "${t}/mcp", @@ -452,9 +452,9 @@ Return a structured verdict with confidence and justification.`,kx=`{ } } } -}`,copyKey:"cursor-config",className:"text-xs"})})]})]})]})]}),{})}),(0,_.jsx)(rB.TabPanel,{className:"mt-6",children:(0,_.jsx)(()=>(0,_.jsxs)(U.Space,{direction:"vertical",size:"large",className:"w-full",children:[(0,_.jsxs)("div",{className:"bg-gradient-to-r from-green-50 to-teal-50 p-6 rounded-lg border border-green-100",children:[(0,_.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,_.jsx)(ON,{className:"text-green-600",size:24}),(0,_.jsx)(OM,{level:4,className:"mb-0 text-green-900",children:"Streamable HTTP Transport"})]}),(0,_.jsx)(OC,{className:"text-green-700",children:"Connect to LiteLLM MCP using HTTP transport. Compatible with any MCP client that supports HTTP streaming."})]}),(0,_.jsx)(OO,{icon:(0,_.jsx)(ON,{className:"text-green-600",size:16}),title:"Universal MCP Connection",description:"Use this URL with any MCP client that supports HTTP transport",children:(0,_.jsxs)(U.Space,{direction:"vertical",size:"middle",className:"w-full",children:[(0,_.jsx)("div",{children:(0,_.jsx)(OC,{children:"Each MCP client supports different transports. Refer to your client documentation to determine the appropriate transport method."})}),(0,_.jsx)(o,{title:"Server URL",code:`${t}/mcp`,copyKey:"http-server-url"}),(0,_.jsx)(o,{title:"Headers Configuration",code:JSON.stringify({"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"},null,2),copyKey:"http-headers"}),(0,_.jsx)("div",{className:"mt-4",children:(0,_.jsx)(z.Button,{type:"link",className:"p-0 h-auto text-blue-600 hover:text-blue-700",href:"https://modelcontextprotocol.io/docs/concepts/transports",icon:(0,_.jsx)(Cu.default,{size:14}),children:"Learn more about MCP transports"})})]})})]}),{})})]})]})]})})};var OP=e.i(562901),OP=OP;let OA={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"more",theme:"outlined"};var OE=T.forwardRef(function(e,t){return T.createElement(rf.default,(0,rp.default)({},e,{ref:t,icon:OA}))}),OI=e.i(962944);let{Text:OY}=V.Typography,OF={healthy:{dot:"bg-green-500"},unhealthy:{dot:"bg-red-500"},unknown:{dot:"bg-gray-300"}},OR=e=>e.stopPropagation(),OB=({status:e,isLoadingHealth:t,isRechecking:r,onRecheck:a,lastCheck:s,error:n,dotClass:l})=>{if(t||r)return(0,_.jsx)(eN.Tag,{className:"m-0",children:(0,_.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs text-gray-500",children:[(0,_.jsx)("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-gray-300"}),"Checking"]})});let i=(0,_.jsxs)("div",{className:"max-w-xs",children:[(0,_.jsxs)("div",{className:"font-semibold mb-1",children:["Health: ",e]}),s&&(0,_.jsxs)("div",{className:"text-xs mb-1",children:["Last check: ",new Date(s).toLocaleString()]}),n&&(0,_.jsxs)("div",{className:"text-xs",children:[(0,_.jsx)("div",{className:"font-medium text-red-300 mb-1",children:"Error"}),(0,_.jsx)("div",{className:"break-words",children:n})]}),!s&&!n&&(0,_.jsx)("div",{className:"text-xs text-gray-400",children:"No health data"}),a&&(0,_.jsx)("div",{className:"mt-1 text-xs text-gray-300",children:"Click to recheck"})]});return(0,_.jsx)(tB.Tooltip,{title:i,placement:"top",children:(0,_.jsx)(eN.Tag,{className:`m-0 ${a?"cursor-pointer hover:opacity-80":"cursor-default"}`,onClick:a?e=>{e.stopPropagation(),a()}:void 0,children:(0,_.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,_.jsx)("span",{className:`h-1.5 w-1.5 rounded-full ${l}`}),e.charAt(0).toUpperCase()+e.slice(1)]})})})},Oz=({connected:e,onConnect:t})=>e?(0,_.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[(0,_.jsx)("span",{className:"text-gray-500",children:"BYOK credential"}),(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-green-200 bg-green-50 px-2 py-0.5 font-medium text-green-700",children:[(0,_.jsx)(kQ.CheckOutlined,{style:{fontSize:10}})," Connected"]}),t&&(0,_.jsx)("button",{type:"button",onClick:e=>{OR(e),t()},className:"text-xs text-gray-400 transition-colors hover:text-blue-600",children:"Update"})]})]}):(0,_.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[(0,_.jsx)("span",{className:"text-gray-500",children:"BYOK credential"}),t?(0,_.jsx)("button",{type:"button",onClick:e=>{OR(e),t()},className:"rounded-md bg-blue-600 px-3 py-1 text-xs font-medium text-white shadow-sm transition-colors hover:bg-blue-700",children:"Connect"}):(0,_.jsx)("span",{className:"text-gray-400",children:"—"})]}),OH=({server:e,missingUserFields:t,isLoadingHealth:r,isRechecking:a,onClick:s,onRecheckHealth:n,onByokConnect:l,onOpenFillFields:i,onDelete:o})=>{let d=e.alias||e.server_name||"",c=e.server_name||d||e.server_id,u=e.mcp_info?.logo_url??void 0,[m,p]=(0,T.useState)(null),h=u&&m!==u?u:void 0,f=e.transport||"http",x=e.spec_path&&"stdio"!==f?"openapi":f,g=e.auth_type||"none",y=e.status||"unknown",b=OF[y]??OF.unknown,v=e.available_on_public_internet,j=(e.mcp_access_groups??[]).filter(e=>"string"==typeof e),w=t??[],k=w.length>0,S=k?"border-2 border-red-300 bg-red-50/40 hover:border-red-400 hover:shadow-md":"border border-gray-200 bg-white hover:border-gray-300 hover:shadow-md",N=e.url||"",{maskedUrl:M}=N?Oc(N):{maskedUrl:""},C="",L="";"stdio"===f?L=C=[e.command,...e.args??[]].filter(e=>"string"==typeof e&&e.length>0).join(" "):e.spec_path?(C=e.spec_path,L=e.spec_path):N&&(C=M,L=N);let O=[];return n&&O.push({key:"test-connection",label:"Test Connection",icon:(0,_.jsx)(OI.ThunderboltOutlined,{}),disabled:a,onClick:({domEvent:e})=>{e.stopPropagation(),n()}}),o&&(O.length>0&&O.push({key:"divider",type:"divider"}),O.push({key:"delete",label:"Delete",icon:(0,_.jsx)(jQ.DeleteOutlined,{}),danger:!0,onClick:({domEvent:e})=>{e.stopPropagation(),o()}})),(0,_.jsxs)("div",{role:"button",tabIndex:0,onClick:s,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),s())},className:`group relative flex h-full cursor-pointer flex-col gap-3 rounded-lg p-4 transition-all duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400 ${S}`,children:[(0,_.jsxs)("div",{className:"flex items-start gap-3",children:[h?(0,_.jsx)("img",{src:h,alt:`${c} logo`,className:"h-10 w-10 flex-shrink-0 rounded object-contain",onError:()=>p(h)}):(0,_.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded bg-gray-100 font-semibold text-gray-500",children:(c||"?").slice(0,2).toUpperCase()}),(0,_.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,_.jsx)("div",{className:"block w-full truncate text-left font-semibold text-gray-900",title:c,children:c}),(0,_.jsxs)("div",{className:"mt-0.5 flex items-center gap-2 text-xs text-gray-500",children:[d&&(0,_.jsx)("span",{className:"truncate",children:d}),d&&(0,_.jsx)("span",{className:"text-gray-300",children:"·"}),(0,_.jsx)(tB.Tooltip,{title:e.server_id,children:(0,_.jsx)("span",{className:"font-mono text-blue-600",children:e.server_id.slice(0,7)})})]})]}),O.length>0&&(0,_.jsx)(Tn.Dropdown,{menu:{items:O},trigger:["click"],placement:"bottomRight",children:(0,_.jsx)("button",{type:"button",onClick:OR,onKeyDown:OR,"aria-label":"Server actions",className:"-mr-1 -mt-1 inline-flex h-8 w-8 items-center justify-center rounded-md text-gray-500 transition-colors hover:bg-gray-100 hover:text-blue-600",children:(0,_.jsx)(OE,{style:{fontSize:20}})})})]}),C?(0,_.jsx)(tB.Tooltip,{title:L,children:(0,_.jsx)(OY,{className:"truncate font-mono text-xs text-gray-500",ellipsis:!0,children:C})}):(0,_.jsx)("div",{className:"h-[18px]","aria-hidden":!0}),(0,_.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,_.jsx)(OB,{status:y,isLoadingHealth:r,isRechecking:a,onRecheck:n,lastCheck:e.last_health_check,error:e.health_check_error,dotClass:b.dot}),(0,_.jsx)(eN.Tag,{className:"m-0",children:x.toUpperCase()}),(0,_.jsx)(eN.Tag,{className:"m-0",children:g}),(0,_.jsx)(eN.Tag,{color:v?"green":"orange",className:"m-0",children:(0,_.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,_.jsx)("span",{className:`h-1.5 w-1.5 rounded-full ${v?"bg-green-500":"bg-orange-500"}`}),v?"Public":"Internal"]})}),j.slice(0,2).map(e=>(0,_.jsx)(tB.Tooltip,{title:e,children:(0,_.jsx)(eN.Tag,{className:"m-0 max-w-[120px] truncate",children:e})},e)),j.length>2&&(0,_.jsx)(tB.Tooltip,{title:j.slice(2).join(", "),children:(0,_.jsxs)(eN.Tag,{className:"m-0",children:["+",j.length-2]})})]}),(e.is_byok||k)&&(0,_.jsxs)("div",{className:"mt-auto flex flex-col gap-2",children:[e.is_byok&&(0,_.jsx)(Oz,{connected:!!e.has_user_credential,onConnect:l}),k&&(0,_.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[(0,_.jsx)(tB.Tooltip,{title:(0,_.jsxs)("div",{children:[(0,_.jsx)("div",{className:"font-semibold mb-1",children:"Missing user fields:"}),(0,_.jsx)("ul",{className:"ml-3",children:w.map(e=>(0,_.jsxs)("li",{children:["• ",e]},e))})]}),children:(0,_.jsxs)("span",{className:"inline-flex items-center gap-1 font-semibold text-red-700",children:[(0,_.jsx)(OP.default,{}),w.length," user field",1===w.length?"":"s"," missing"]})}),i&&(0,_.jsx)("button",{type:"button",onClick:e=>{OR(e),i()},className:"rounded-md bg-red-600 px-3 py-1 text-xs font-medium text-white shadow-sm transition-colors hover:bg-red-700",children:"Set"})]})]})]})},O$=T.forwardRef(function(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"}))});function Oq(e){if(!e)return[];if(Array.isArray(e))return e.map(e=>OU(e)).filter(e=>void 0!==e);let t=OU(e);return void 0===t?[]:[t]}function OU(e,t){if(!e)return;let r=void 0!==t?t:e.default;if("object"===e.type){let t="object"!=typeof r||null===r||Array.isArray(r)?{}:{...r};return e.properties&&Object.entries(e.properties).forEach(([e,r])=>{t[e]=OU(r,t[e])}),t}if("array"===e.type){if(Array.isArray(r)){let t=e.items;if(!t)return r;if(0===r.length){let e=Oq(t);return e.length?e:r}return Array.isArray(t)?r.map((e,r)=>OU(t[r]??t[t.length-1],e)):r.map(e=>OU(t,e))}return void 0!==r?r:Oq(e.items)}if(void 0!==r)return r;switch(e.type){case"integer":case"number":return 0;case"boolean":return!1;default:return""}}let OW=e=>{let t=OU(e);if("object"===e.type||"array"===e.type){let r="array"===e.type?[]:{};return JSON.stringify(t??r,null,2)}return t};function OV({tool:e,onSubmit:t,isLoading:r,result:a,error:s,onClose:n}){let[l]=H.Form.useForm(),[i,o]=T.default.useState("formatted"),[d,c]=T.default.useState(null),[u,m]=T.default.useState(null),p=T.default.useMemo(()=>"string"==typeof e.inputSchema?{type:"object",properties:{input:{type:"string",description:"Input for this tool"}},required:["input"]}:e.inputSchema,[e.inputSchema]),h=T.default.useMemo(()=>p.properties&&p.properties.params&&"object"===p.properties.params.type&&p.properties.params.properties?{type:"object",properties:p.properties.params.properties,required:p.properties.params.required||[]}:p,[p]);T.default.useEffect(()=>{if(l.resetFields(),!h.properties)return;let e={};Object.entries(h.properties).forEach(([t,r])=>{e[t]=OW(r)}),l.setFieldsValue(e)},[l,h,e]),T.default.useEffect(()=>{d&&(a||s)&&m(Date.now()-d)},[a,s,d]);let f=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();let r=document.execCommand("copy");if(document.body.removeChild(t),!r)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},x=async()=>{await f(JSON.stringify(a,null,2))?J.default.success("Result copied to clipboard"):J.default.fromBackend("Failed to copy result")},g=async()=>{await f(e.name)?J.default.success("Tool name copied to clipboard"):J.default.fromBackend("Failed to copy tool name")};return(0,_.jsxs)("div",{className:"space-y-4 h-full",children:[(0,_.jsxs)("div",{className:"flex items-center justify-between pb-3 border-b border-gray-200",children:[(0,_.jsxs)("div",{className:"flex items-center space-x-3",children:[e.mcp_info.logo_url&&(0,_.jsx)("img",{src:e.mcp_info.logo_url,alt:`${e.mcp_info.server_name} logo`,className:"w-6 h-6 object-contain"}),(0,_.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,_.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,_.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Test Tool:"}),(0,_.jsxs)("div",{className:"group inline-flex items-center space-x-1 bg-slate-50 hover:bg-slate-100 px-3 py-1 rounded-md cursor-pointer transition-colors border border-slate-200",onClick:g,title:"Click to copy tool name",children:[(0,_.jsx)("span",{className:"font-mono text-slate-700 font-medium text-sm",children:e.name}),(0,_.jsx)("svg",{className:"w-3 h-3 text-slate-400 group-hover:text-slate-600 transition-colors",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})]})]}),(0,_.jsx)("p",{className:"text-xs text-gray-600",children:e.description}),(0,_.jsxs)("p",{className:"text-xs text-gray-500",children:["Provider: ",e.mcp_info.server_name]})]})]}),(0,_.jsx)(S.Button,{onClick:n,variant:"light",size:"sm",className:"text-gray-500 hover:text-gray-700",children:(0,_.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,_.jsxs)("div",{className:"grid grid-cols-2 gap-4 h-full",children:[(0,_.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,_.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,_.jsxs)("div",{className:"flex items-center justify-between",children:[(0,_.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Input Parameters"}),(0,_.jsx)(tB.Tooltip,{title:"Configure the input parameters for this tool call",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"text-gray-400 hover:text-gray-600"})})]})}),(0,_.jsx)("div",{className:"p-4",children:(0,_.jsxs)(H.Form,{form:l,onFinish:e=>{c(Date.now()),m(null);let r={};Object.entries(e).forEach(([e,t])=>{let a=h.properties?.[e],s="string"==typeof t?t.trim():t;if(a&&null!=s&&""!==s)switch(a.type){case"boolean":r[e]="true"===s||!0===s;break;case"number":case"integer":{let t=Number(s);r[e]=Number.isNaN(t)?s:"integer"===a.type?Math.trunc(t):t;break}case"object":case"array":try{let t="string"==typeof s?JSON.parse(s):s,n="object"===a.type&&null!==t&&"object"==typeof t&&!Array.isArray(t),l="array"===a.type&&Array.isArray(t);"object"===a.type&&n||"array"===a.type&&l?r[e]=t:r[e]=s}catch(t){r[e]=s}break;case"string":r[e]=String(s);break;default:r[e]=s}else null!=s&&""!==s&&(r[e]=s)}),t(p.properties&&p.properties.params&&"object"===p.properties.params.type&&p.properties.params.properties?{params:r}:r)},layout:"vertical",className:"space-y-3",children:["string"==typeof e.inputSchema?(0,_.jsx)("div",{className:"space-y-3",children:(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Input ",(0,_.jsx)("span",{className:"text-red-500",children:"*"})]}),name:"input",rules:[{required:!0,message:"Please enter input for this tool"}],className:"mb-3",children:(0,_.jsx)(et.TextInput,{placeholder:"Enter input for this tool",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})})}):void 0===h.properties?(0,_.jsx)("div",{className:"text-center py-6 bg-gray-50 rounded-lg border border-gray-200",children:(0,_.jsxs)("div",{className:"max-w-sm mx-auto",children:[(0,_.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"No Parameters Required"}),(0,_.jsx)("p",{className:"text-xs text-gray-500",children:"This tool can be called without any input parameters."})]})}):(0,_.jsx)("div",{className:"space-y-3",children:Object.entries(h.properties).map(([t,r])=>{let a=OW(r),s=`${e.name}-${t}`;return(0,_.jsxs)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:[t," ",h.required?.includes(t)&&(0,_.jsx)("span",{className:"text-red-500",children:"*"}),r.description&&(0,_.jsx)(tB.Tooltip,{title:r.description,children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:t,initialValue:a,rules:[{required:h.required?.includes(t),message:`Please enter ${t}`},..."object"===r.type||"array"===r.type?[{validator:(e,a)=>{if((null==a||""===a)&&!h.required?.includes(t))return Promise.resolve();try{let e="string"==typeof a?JSON.parse(a):a,t="object"===r.type&&null!==e&&"object"==typeof e&&!Array.isArray(e),s="array"===r.type&&Array.isArray(e);if("object"===r.type&&t||"array"===r.type&&s)return Promise.resolve();return Promise.reject(Error("object"===r.type?"Please enter a JSON object":"Please enter a JSON array"))}catch(e){return Promise.reject(Error("Invalid JSON"))}}}]:[]],className:"mb-3",children:["string"===r.type&&r.enum&&(0,_.jsxs)("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors",defaultValue:a??"",children:[!h.required?.includes(t)&&(0,_.jsxs)("option",{value:"",children:["Select ",t]}),r.enum.map(e=>(0,_.jsx)("option",{value:e,children:e},e))]}),"string"===r.type&&!r.enum&&(0,_.jsx)(et.TextInput,{placeholder:r.description||`Enter ${t}`,defaultValue:a??"",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"}),("number"===r.type||"integer"===r.type)&&(0,_.jsx)("input",{type:"number",step:"integer"===r.type?1:"any",placeholder:r.description||`Enter ${t}`,defaultValue:a??0,className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors"}),"boolean"===r.type&&(0,_.jsxs)(eE.Select,{placeholder:`Select ${t}`,allowClear:!h.required?.includes(t),className:"w-full",children:[(0,_.jsx)(eE.Select.Option,{value:!0,children:"True"}),(0,_.jsx)(eE.Select.Option,{value:!1,children:"False"})]}),("object"===r.type||"array"===r.type)&&(0,_.jsxs)("div",{className:"space-y-2",children:[(0,_.jsx)("textarea",{rows:"object"===r.type?6:4,placeholder:r.description||("object"===r.type?`Enter JSON object for ${t}`:`Enter JSON array for ${t}`),defaultValue:a??("object"===r.type?"{}":"[]"),spellCheck:!1,"data-testid":`textarea-${t}`,className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm font-mono"}),(0,_.jsx)("p",{className:"text-xs text-gray-500",children:"object"===r.type?"Provide a valid JSON object.":"Provide a valid JSON array."})]})]},s)})}),(0,_.jsx)("div",{className:"pt-3 border-t border-gray-100",children:(0,_.jsx)(S.Button,{type:"button",onClick:()=>l.submit(),disabled:r,variant:"primary",className:"w-full",loading:r,children:r?"Calling Tool...":a||s?"Call Again":"Call Tool"})})]})})]}),(0,_.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,_.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,_.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Tool Result"})}),(0,_.jsx)("div",{className:"p-4",children:a||s||r?(0,_.jsxs)("div",{className:"space-y-3",children:[a&&!r&&!s&&(0,_.jsx)("div",{className:"p-2 bg-green-50 border border-green-200 rounded-lg",children:(0,_.jsxs)("div",{className:"flex items-center justify-between",children:[(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)("svg",{className:"h-4 w-4 text-green-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,_.jsx)("h4",{className:"text-xs font-medium text-green-900",children:"Tool executed successfully"}),null!==u&&(0,_.jsxs)("span",{className:"text-xs text-green-600 ml-1",children:["• ",(u/1e3).toFixed(2),"s"]})]}),(0,_.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,_.jsxs)("div",{className:"flex bg-white rounded border border-green-300 p-0.5",children:[(0,_.jsx)("button",{onClick:()=>o("formatted"),className:`px-2 py-1 text-xs font-medium rounded transition-colors ${"formatted"===i?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"}`,children:"Formatted"}),(0,_.jsx)("button",{onClick:()=>o("json"),className:`px-2 py-1 text-xs font-medium rounded transition-colors ${"json"===i?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"}`,children:"JSON"})]}),(0,_.jsx)("button",{onClick:x,className:"p-1 hover:bg-green-100 rounded text-green-700",title:"Copy response",children:(0,_.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,_.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,_.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]})}),(0,_.jsxs)("div",{className:"max-h-96 overflow-y-auto",children:[r&&(0,_.jsxs)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:[(0,_.jsxs)("div",{className:"relative",children:[(0,_.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-gray-200"}),(0,_.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,_.jsx)("p",{className:"text-sm font-medium mt-3",children:"Calling tool..."}),(0,_.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"Please wait while we process your request"})]}),s&&(0,_.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:(0,_.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,_.jsx)("div",{className:"flex-shrink-0",children:(0,_.jsx)("svg",{className:"h-4 w-4 text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,_.jsxs)("div",{className:"flex-1",children:[(0,_.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,_.jsx)("h4",{className:"text-xs font-medium text-red-900",children:"Tool Call Failed"}),null!==u&&(0,_.jsxs)("span",{className:"text-xs text-red-600",children:["• ",(u/1e3).toFixed(2),"s"]})]}),(0,_.jsx)("div",{className:"bg-white border border-red-200 rounded p-2 max-h-48 overflow-y-auto",children:(0,_.jsx)("pre",{className:"text-xs whitespace-pre-wrap text-red-700 font-mono",children:s.message})})]})]})}),a&&!r&&!s&&(0,_.jsx)("div",{className:"space-y-3",children:"formatted"===i?a.map((e,t)=>(0,_.jsxs)("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:["text"===e.type&&(0,_.jsxs)("div",{children:[(0,_.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,_.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Text Response"})}),(0,_.jsx)("div",{className:"p-3",children:(0,_.jsx)("div",{className:"bg-white rounded border border-gray-200 max-h-64 overflow-y-auto",children:(0,_.jsx)("div",{className:"p-3 space-y-2",children:e.text.split("\n\n").map((e,t)=>{if(""===e.trim())return null;if(e.startsWith("##")){let r=e.replace(/^#+\s/,"");return(0,_.jsx)("div",{className:"border-b border-gray-200 pb-1 mb-2",children:(0,_.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:r})},t)}let r=/(https?:\/\/[^\s\)]+)/g;if(r.test(e)){let a=e.split(r);return(0,_.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded p-2",children:(0,_.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap",children:a.map((e,t)=>r.test(e)?(0,_.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline break-all",children:e},t):e)})},t)}return e.includes("Score:")?(0,_.jsx)("div",{className:"bg-green-50 border-l-4 border-green-400 p-2 rounded-r",children:(0,_.jsx)("p",{className:"text-xs text-green-800 font-medium whitespace-pre-wrap",children:e})},t):(0,_.jsx)("div",{className:"bg-gray-50 rounded p-2 border border-gray-200",children:(0,_.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap font-mono",children:e})},t)}).filter(Boolean)})})})]}),"image"===e.type&&e.url&&(0,_.jsxs)("div",{children:[(0,_.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,_.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Image Response"})}),(0,_.jsx)("div",{className:"p-3",children:(0,_.jsx)("div",{className:"bg-gray-50 rounded p-3 border border-gray-200",children:(0,_.jsx)("img",{src:e.url,alt:"Tool result",className:"max-w-full h-auto rounded shadow-sm"})})})]}),"embedded_resource"===e.type&&(0,_.jsxs)("div",{children:[(0,_.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,_.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Embedded Resource"})}),(0,_.jsx)("div",{className:"p-3",children:(0,_.jsxs)("div",{className:"flex items-center space-x-2 p-3 bg-blue-50 border border-blue-200 rounded",children:[(0,_.jsx)("div",{className:"flex-shrink-0",children:(0,_.jsx)("svg",{className:"h-5 w-5 text-blue-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),(0,_.jsxs)("div",{className:"flex-1",children:[(0,_.jsxs)("p",{className:"text-xs font-medium text-blue-900",children:["Resource Type: ",e.resource_type]}),e.url&&(0,_.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-xs text-blue-600 hover:text-blue-800 hover:underline mt-1 transition-colors",children:["View Resource",(0,_.jsxs)("svg",{className:"ml-1 h-3 w-3",fill:"currentColor",viewBox:"0 0 20 20",children:[(0,_.jsx)("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),(0,_.jsx)("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"})]})]})]})]})})]})]},t)):(0,_.jsx)("div",{className:"bg-white rounded border border-gray-200",children:(0,_.jsx)("div",{className:"p-3 overflow-auto max-h-80 bg-gray-50",children:(0,_.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all text-gray-800",children:JSON.stringify(a,null,2)})})})})]})]}):(0,_.jsx)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:(0,_.jsxs)("div",{className:"text-center max-w-sm",children:[(0,_.jsx)("div",{className:"mb-3",children:(0,_.jsx)("svg",{className:"mx-auto h-12 w-12 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),(0,_.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"Ready to Call Tool"}),(0,_.jsx)("p",{className:"text-xs text-gray-500 leading-relaxed",children:'Configure the input parameters and click "Call Tool" to see the results here.'})]})})})]})]})]})}function OG(e){return e.toLowerCase().trim().replace(/[^a-z0-9_]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"")}var OK=e.i(779129);let OJ="litellm-tools-mcp-oauth-flow-state",OQ="litellm-tools-mcp-oauth-result";var OX=e.i(2781);let OZ=({serverId:e,accessToken:t,auth_type:r,oauth2_flow:a,delegate_auth_to_upstream:s,userRole:n,userID:l,serverAlias:i,extraHeaders:o})=>{let[d,c]=(0,T.useState)(null),[u,m]=(0,T.useState)(null),[p,h]=(0,T.useState)(null),[f,x]=(0,T.useState)(""),[g,y]=(0,T.useState)({}),[b,v]=(0,T.useState)(!1),j="passthrough"===(0,LK.getMcpOAuthMode)({auth_type:r,oauth2_flow:a,delegate_auth_to_upstream:s}),[w,k]=(0,T.useState)(()=>j&&(0,LG.isTokenValid)(e,l)?(0,LG.getToken)(e,l)?.access_token??null:null);(0,T.useEffect)(()=>{j?k((0,LG.isTokenValid)(e,l)?(0,LG.getToken)(e,l)?.access_token??null:null):k(null)},[e,l,j]);let{startOAuthFlow:S,status:N,error:M}=(({accessToken:e,serverId:t,serverAlias:r,userId:a,scopes:s,clientId:n,onSuccess:l})=>{let[i,o]=(0,T.useState)("idle"),[d,c]=(0,T.useState)(null),u=(0,T.useRef)(!1),m=(0,T.useRef)(l);m.current=l;let p=(0,T.useCallback)(async()=>{try{let a;o("authorizing"),c(null);let l=n??void 0;if(!l)try{let s=await (0,Q.registerMcpOAuthClient)(e,t,{client_name:r||t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"});l=s?.client_id,a=s?.client_secret}catch(e){}let i=(0,Of.generateCodeVerifier)(),d=await (0,Of.generateCodeChallenge)(i),u=crypto.randomUUID(),m=(0,OK.buildCallbackUrl)(),p=s?.filter(e=>e.trim()).join(" "),h=(0,Q.buildMcpOAuthAuthorizeUrl)({serverId:t,clientId:l,redirectUri:m,state:u,codeChallenge:d,scope:p}),f={state:u,codeVerifier:i,serverId:t,redirectUri:m,clientId:l,clientSecret:a,scopes:s};(0,Ox.setSecureItem)(OJ,JSON.stringify(f)),(0,Ox.setSecureItem)("litellm-mcp-oauth-return-url",window.location.href),window.location.href=h}catch(t){let e=(0,Oh.extractErrorMessage)(t);c(e),o("error"),J.default.error(e)}},[e,t,r,s,n]),h=(0,T.useCallback)(async()=>{if(u.current)return;let r=(0,Ox.getSecureItem)(OQ);if(!r)return;let s=(0,Ox.getSecureItem)(OJ);if(!s)return;let n=null;try{if((n=JSON.parse(s)).serverId&&n.serverId!==t)return}catch(e){}u.current=!0,(0,OK.clearStorage)(OQ);let l=null,i=null;try{l=JSON.parse(r),i=n}catch(e){c("Failed to resume OAuth flow. Please retry."),o("error"),u.current=!1,(0,OK.clearStorage)(OJ);return}try{if(!i?.state||!i.codeVerifier||!i.serverId)throw Error("OAuth session state was lost. Please retry.");if(!l?.state||l.state!==i.state)throw Error("OAuth state mismatch. Please retry.");if(l.error)throw Error(l.error_description||l.error);if(!l.code)throw Error("Authorization code missing in callback.");o("exchanging");let t=await (0,Q.exchangeMcpOAuthToken)({serverId:i.serverId,code:l.code,clientId:i.clientId,clientSecret:i.clientSecret,codeVerifier:i.codeVerifier,redirectUri:i.redirectUri,accessToken:e});(0,LG.setToken)(i.serverId,{access_token:t.access_token,expires_in:t.expires_in,refresh_token:t.refresh_token,token_type:t.token_type},a),o("success"),c(null),J.default.success("Connected successfully"),m.current(t.access_token)}catch(t){let e=(0,Oh.extractErrorMessage)(t);c(e),o("error"),J.default.error(e)}finally{(0,OK.clearStorage)(OJ),setTimeout(()=>{u.current=!1},1e3)}},[e,t,a]);return(0,T.useEffect)(()=>{h()},[h]),{startOAuthFlow:p,status:i,error:d}})({accessToken:t??"",serverId:e,serverAlias:i,userId:l,onSuccess:k}),C=o&&o.length>0,L=()=>{let e={};if(j&&w)if(i){let t=OG(i);t?e[`x-mcp-${t}-authorization`]=`Bearer ${w}`:e["x-mcp-auth"]=`Bearer ${w}`}else e["x-mcp-auth"]=`Bearer ${w}`;if(i&&C){let t=OG(i);t&&Object.entries(g).forEach(([r,a])=>{a&&a.trim()&&(e[`x-mcp-${t}-${r.toLowerCase()}`]=a)})}return Object.keys(e).length>0?e:void 0},{data:O,isLoading:D,error:A,refetch:E}=(0,ev.useQuery)({queryKey:["mcpTools",e,g,w],queryFn:async()=>{if(!t)throw Error("Access Token required");let r=await (0,Q.listMCPTools)(t,e,L());if(r?.error){let t=r.status;401===t&&(0,LG.removeToken)(e,l);let a=Error(r.message||r.error||"Failed to fetch MCP tools");throw a.status=t,a.statusText=r.statusText,a.details=r.details,a}return r},enabled:!!t&&(!j||null!==w),staleTime:3e4,retry:(e,t)=>t?.status!==401&&t?.response?.status!==401&&e<2});(0,T.useEffect)(()=>{401===(A?.status??A?.response?.status)&&((0,LG.removeToken)(e,l),k(null))},[A,e,l]);let{mutate:I,isPending:Y}=(0,ep.useMutation)({mutationFn:async r=>{if(!t)throw Error("Access Token required");try{return await (0,Q.callMCPTool)(t,e,r.tool.name,r.arguments,{customHeaders:L()})}catch(e){throw e}},onSuccess:e=>{m(e.content),h(null)},onError:t=>{h(t),m(null),(t?.status===401||t?.response?.status===401)&&((0,LG.removeToken)(e,l),k(null))}}),F=O?.tools||[],R=F.filter(e=>{let t=f.toLowerCase();return e.name.toLowerCase().includes(t)||e.description&&e.description.toLowerCase().includes(t)||e.mcp_info.server_name&&e.mcp_info.server_name.toLowerCase().includes(t)});return(0,_.jsx)("div",{className:"w-full h-screen p-4 bg-white",children:(0,_.jsx)(P.Card,{className:"w-full rounded-xl shadow-md overflow-hidden",children:(0,_.jsxs)("div",{className:"flex h-auto w-full gap-4",children:[(0,_.jsxs)("div",{className:"w-1/4 p-4 bg-gray-50 flex flex-col",children:[(0,_.jsx)(X.Title,{className:"text-xl font-semibold mb-6 mt-2",children:"MCP Tools"}),(0,_.jsxs)("div",{className:"flex flex-col flex-1",children:[C&&(0,_.jsxs)("div",{className:"mb-4 p-3 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,_.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,_.jsxs)("div",{className:"flex items-center",children:[(0,_.jsx)(el.KeyOutlined,{className:"text-blue-600 mr-2"}),(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-blue-800",children:"Additional Headers"})]}),(0,_.jsx)(z.Button,{size:"small",type:"link",onClick:()=>v(!b),className:"text-blue-700 p-0 h-auto",children:b?"Hide":"Configure"})]}),!b&&0===Object.keys(g).length&&(0,_.jsx)(Z.Text,{className:"text-xs text-blue-700",children:'This server requires additional headers. Click "Configure" to provide values.'}),b&&(0,_.jsxs)("div",{className:"mt-3 space-y-2",children:[o?.map(e=>(0,_.jsxs)("div",{children:[(0,_.jsx)("label",{className:"block text-xs font-medium text-gray-700 mb-1",children:e}),(0,_.jsx)($.Input,{size:"small",placeholder:`Enter ${e}`,value:g[e]||"",onChange:t=>{y({...g,[e]:t.target.value})},prefix:(0,_.jsx)(el.KeyOutlined,{className:"text-gray-400"}),className:"rounded"})]},e)),(0,_.jsx)(z.Button,{size:"small",type:"primary",onClick:()=>{E(),v(!1)},disabled:Object.values(g).every(e=>!e||!e.trim()),className:"w-full mt-2",children:"Load Tools"})]}),!b&&Object.keys(g).length>0&&(0,_.jsx)("div",{className:"mt-2",children:(0,_.jsxs)(Z.Text,{className:"text-xs text-green-700 flex items-center",children:[(0,_.jsx)("span",{className:"inline-block w-2 h-2 bg-green-500 rounded-full mr-2"}),Object.keys(g).length," header(s) configured"]})})]}),(0,_.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,_.jsxs)(Z.Text,{className:"font-medium block mb-3 text-gray-700 flex items-center",children:[(0,_.jsx)(Nd.ToolOutlined,{className:"mr-2"})," Available Tools",F.length>0&&(0,_.jsx)("span",{className:"ml-2 bg-blue-100 text-blue-800 text-xs font-medium px-2 py-0.5 rounded-full",children:F.length})]}),j&&!w&&(0,_.jsxs)("div",{className:"p-4 text-center bg-white border border-gray-200 rounded-lg",children:[(0,_.jsx)(OX.LockOutlined,{className:"text-2xl text-gray-400 mb-2"}),(0,_.jsx)("p",{className:"text-xs font-medium text-gray-700 mb-1",children:"Authentication required"}),(0,_.jsx)("p",{className:"text-xs text-gray-500 mb-3",children:"Authenticate to view available tools"}),(0,_.jsx)(z.Button,{size:"small",type:"primary",loading:"authorizing"===N||"exchanging"===N,onClick:S,disabled:!t,children:"Authorize"}),M&&(0,_.jsx)("p",{className:"text-xs text-red-500 mt-2",children:M})]}),!j||w?(0,_.jsxs)(_.Fragment,{children:[F.length>0&&(0,_.jsx)("div",{className:"mb-3",children:(0,_.jsx)($.Input,{placeholder:"Search tools...",prefix:(0,_.jsx)(ry.SearchOutlined,{className:"text-gray-400"}),value:f,onChange:e=>x(e.target.value),allowClear:!0,className:"rounded-lg",size:"middle"})}),D&&(0,_.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 bg-white border border-gray-200 rounded-lg",children:[(0,_.jsxs)("div",{className:"relative mb-3",children:[(0,_.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-gray-200"}),(0,_.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,_.jsx)("p",{className:"text-xs font-medium text-gray-700",children:"Loading tools..."})]}),(O?.error||A)&&!D&&!F.length&&(0,_.jsx)("div",{className:"p-3 text-xs text-red-800 rounded-lg bg-red-50 border border-red-200",children:(0,_.jsxs)("p",{className:"font-medium",children:["Error: ",O?.message||A?.message]})}),!D&&!O?.error&&!A&&(!F||0===F.length)&&(0,_.jsxs)("div",{className:"p-4 text-center bg-white border border-gray-200 rounded-lg",children:[(0,_.jsx)("div",{className:"mx-auto w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center mb-2",children:(0,_.jsx)("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 8.172V5L8 4z"})})}),(0,_.jsx)("p",{className:"text-xs font-medium text-gray-700 mb-1",children:"No tools available"}),(0,_.jsx)("p",{className:"text-xs text-gray-500",children:"No tools found for this server"})]}),!D&&!O?.error&&F.length>0&&(0,_.jsx)(_.Fragment,{children:0===R.length?(0,_.jsxs)("div",{className:"p-4 text-center bg-white border border-gray-200 rounded-lg",children:[(0,_.jsx)(ry.SearchOutlined,{className:"text-2xl text-gray-400 mb-2"}),(0,_.jsx)("p",{className:"text-xs font-medium text-gray-700 mb-1",children:"No tools found"}),(0,_.jsxs)("p",{className:"text-xs text-gray-500",children:['No tools match "',f,'"']})]}):(0,_.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto min-h-0 mcp-tools-scrollable",style:{maxHeight:"400px",scrollbarWidth:"auto",scrollbarColor:"#cbd5e0 #f7fafc"},children:R.map(e=>(0,_.jsxs)("div",{className:`border rounded-lg p-3 cursor-pointer transition-all hover:shadow-sm ${d?.name===e.name?"border-blue-500 bg-blue-50 ring-1 ring-blue-200":"border-gray-200 bg-white hover:border-gray-300"}`,onClick:()=>{c(e),m(null),h(null)},children:[(0,_.jsxs)("div",{className:"flex items-start space-x-2",children:[e.mcp_info.logo_url&&(0,_.jsx)("img",{src:e.mcp_info.logo_url,alt:`${e.mcp_info.server_name} logo`,className:"w-4 h-4 object-contain flex-shrink-0 mt-0.5"}),(0,_.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,_.jsx)("h4",{className:"font-mono text-xs font-medium text-gray-900 truncate",children:e.name}),(0,_.jsx)("p",{className:"text-xs text-gray-500 truncate",children:e.mcp_info.server_name}),(0,_.jsx)("p",{className:"text-xs text-gray-600 mt-1 line-clamp-2 leading-relaxed",children:e.description})]})]}),d?.name===e.name&&(0,_.jsx)("div",{className:"mt-2 pt-2 border-t border-blue-200",children:(0,_.jsxs)("div",{className:"flex items-center text-xs font-medium text-blue-700",children:[(0,_.jsx)("svg",{className:"w-3 h-3 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:(0,_.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Selected"]})})]},e.name))})})]}):null]})]})]}),(0,_.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,_.jsx)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:(0,_.jsx)(X.Title,{className:"text-xl font-semibold mb-0",children:"Tool Testing Playground"})}),(0,_.jsx)("div",{className:"flex-1 overflow-auto p-4",children:d?(0,_.jsx)("div",{className:"h-full",children:(0,_.jsx)(OV,{tool:d,onSubmit:e=>{I({tool:d,arguments:e})},result:u,error:p,isLoading:Y,onClose:()=>c(null)})}):(0,_.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,_.jsx)(tV.RobotOutlined,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,_.jsx)(Z.Text,{className:"text-lg font-medium text-gray-600 mb-2",children:"Select a Tool to Test"}),(0,_.jsx)(Z.Text,{className:"text-center text-gray-500 max-w-md",children:"Choose a tool from the left sidebar to start testing its functionality with custom inputs."})]})})]})]})})})},O0=[LK.AUTH_TYPE.API_KEY,LK.AUTH_TYPE.BEARER_TOKEN,LK.AUTH_TYPE.TOKEN,LK.AUTH_TYPE.BASIC],O1=[...O0,LK.AUTH_TYPE.OAUTH2,LK.AUTH_TYPE.AWS_SIGV4],O2="litellm-mcp-oauth-edit-state",O4=({mcpServer:e,accessToken:t,onCancel:r,onSuccess:a,availableAccessGroups:s})=>{let[n]=H.Form.useForm(),[l,i]=(0,T.useState)({}),[o,d]=(0,T.useState)([]),[c,u]=(0,T.useState)(!1),[m,p]=(0,T.useState)(null),[h,f]=(0,T.useState)(""),[x,g]=(0,T.useState)(!1),[y,b]=(0,T.useState)([]),[v,j]=(0,T.useState)(!1),[w,k]=(0,T.useState)({}),[N,M]=(0,T.useState)({}),[C,L]=(0,T.useState)(null),[O,D]=(0,T.useState)(e.mcp_info?.logo_url||void 0),P=H.Form.useWatch("auth_type",n),A=H.Form.useWatch("transport",n),E="stdio"===A,I=A===LK.TRANSPORT.OPENAPI,Y=!!P&&O0.includes(P),F=P===LK.AUTH_TYPE.OAUTH2,R=P===LK.AUTH_TYPE.AWS_SIGV4,B=H.Form.useWatch("oauth_flow_type",n),q=F&&B===LK.OAUTH_FLOW.M2M,[U,W]=(0,T.useState)(null),V=H.Form.useWatch("url",n),G=H.Form.useWatch("spec_path",n),K=H.Form.useWatch("server_name",n),X=H.Form.useWatch("auth_type",n),Z=H.Form.useWatch("static_headers",n),ee=H.Form.useWatch("credentials",n),et=H.Form.useWatch("authorization_url",n),er=H.Form.useWatch("token_url",n),ea=H.Form.useWatch("registration_url",n),es=!!e.mcp_info?.tool_allowlist_enforced||(e.allowed_tools?.length??0)>0,en=es?e.allowed_tools??[]:null,{startOAuthFlow:el,status:ei,error:eo,tokenResponse:ed}=Og({accessToken:t,getCredentials:()=>n.getFieldValue("credentials"),getTemporaryPayload:()=>{let t=n.getFieldsValue(!0),r=t.url||e.url,a=t.transport||e.transport;if(!r||!a)return null;let s=Array.isArray(t.static_headers)?t.static_headers.reduce((e,t)=>{let r=t?.header?.trim();return r&&(e[r]=(t?.value??"").trim()),e},{}):{};return{server_id:e.server_id,server_name:t.server_name||e.server_name||e.alias,alias:t.alias||e.alias,description:t.description||e.description,url:r,transport:a,auth_type:LK.AUTH_TYPE.OAUTH2,credentials:t.credentials,mcp_access_groups:t.mcp_access_groups||e.mcp_access_groups,static_headers:s,command:t.command,args:t.args,env:t.env}},onTokenReceived:e=>{if(W(e?.access_token??null),e?.access_token){let t={access_token:e.access_token,...e.refresh_token&&{refresh_token:e.refresh_token},...e.expires_in&&{expires_in:e.expires_in},...e.scope&&{scope:e.scope}};n.setFieldsValue({credentials:t}),J.default.success("OAuth authorization successful! Please click 'Update MCP Server' to save the credentials.")}},onBeforeRedirect:()=>{try{let t=n.getFieldsValue(!0);(0,Ox.setSecureItem)(O2,JSON.stringify({serverId:e.server_id,formValues:t,costConfig:l,allowedTools:y,hasToolAllowlistInteraction:v,searchValue:h,aliasManuallyEdited:x}))}catch(e){console.warn("Failed to persist MCP edit state",e)}}}),ec=T.default.useMemo(()=>e.static_headers?Object.entries(e.static_headers).map(([e,t])=>({header:e,value:null!=t?String(t):""})):[],[e.static_headers]),eu=T.default.useMemo(()=>Array.isArray(e.env_vars)?e.env_vars.map(e=>({name:e.name,value:e.value??"",scope:"user"===e.scope?"user":"global",description:e.description??""})):[],[e.env_vars]),em=T.default.useMemo(()=>{let t=e.env??void 0;if(!t||0===Object.keys(t).length)return"";try{return JSON.stringify(t,null,2)}catch{return""}},[e.env]),ep=T.default.useMemo(()=>e.spec_path&&"stdio"!==e.transport?LK.TRANSPORT.OPENAPI:e.transport,[e]),eh=T.default.useMemo(()=>({...e,transport:ep,static_headers:ec,env_vars:eu,extra_headers:e.extra_headers||[],oauth_flow_type:e.token_url?LK.OAUTH_FLOW.M2M:LK.OAUTH_FLOW.INTERACTIVE,token_validation_json:e.token_validation?JSON.stringify(e.token_validation,null,2):void 0}),[e,ep,ec,eu,em]);(0,T.useEffect)(()=>{e.mcp_info?.mcp_server_cost_info&&i(e.mcp_info.mcp_server_cost_info)},[e]),(0,T.useEffect)(()=>{j(!1)},[e.server_id]),(0,T.useEffect)(()=>{es&&b(e.allowed_tools??[]),k(e.tool_name_to_display_name??{}),M(e.tool_name_to_description??{})},[e,es]),(0,T.useEffect)(()=>{let t=(0,Ox.getSecureItem)(O2);if(t)try{let r=JSON.parse(t);if(!r||r.serverId!==e.server_id)return;r.formValues&&L({...e,...r.formValues}),r.costConfig&&i(r.costConfig),r.allowedTools&&b(r.allowedTools),"boolean"==typeof r.hasToolAllowlistInteraction&&j(r.hasToolAllowlistInteraction),r.searchValue&&f(r.searchValue),"boolean"==typeof r.aliasManuallyEdited&&g(r.aliasManuallyEdited)}catch(e){console.error("Failed to restore MCP edit state",e)}finally{window.sessionStorage.removeItem(O2)}},[n,e]),(0,T.useEffect)(()=>{if(!C)return;let t=C.transport||e.transport;t&&t!==n.getFieldValue("transport")?n.setFieldsValue({transport:t}):(n.setFieldsValue(C),L(null))},[C,n,e.transport]),(0,T.useEffect)(()=>{if(e.mcp_access_groups){let t=e.mcp_access_groups.map(e=>"string"==typeof e?e:e.name||String(e));n.setFieldValue("mcp_access_groups",t)}},[e]),(0,T.useEffect)(()=>{e.server_id&&""!==e.server_id.trim()&&ef()},[e,t]);let ef=async()=>{if(t&&e.server_id){u(!0),p(null);try{let r=await (0,Q.listMCPTools)(t,e.server_id);r.tools&&!r.error?d(r.tools):(console.error("Failed to fetch tools:",r.message),d([]),p(r.message||"Failed to load tools"))}catch(e){console.error("Tools fetch error:",e),d([]),p(e instanceof Error?e.message:"Failed to load tools")}finally{u(!1)}}},ex=async r=>{if(t)try{let s,n,{static_headers:i,env_vars:o,credentials:d,stdio_config:c,env_json:u,command:m,args:p,allow_all_keys:h,available_on_public_internet:f,delegate_auth_to_upstream:x,oauth_passthrough:g,token_validation_json:_,...b}=r,j=(b.mcp_access_groups||[]).map(e=>"string"==typeof e?e:e.name||String(e)),k=Array.isArray(i)?i.reduce((e,t)=>{let r=t?.header?.trim();return r&&(e[r]=(t?.value??"").trim()),e},{}):{},S=Op(o),T=d&&"object"==typeof d?Object.entries(d).reduce((e,[t,r])=>{if(null==r||""===r)return e;if("scopes"===t){if(Array.isArray(r)){let a=r.filter(e=>null!=e&&""!==e);a.length>0&&(e[t]=a)}}else e[t]=r;return e},{}):void 0,M={};if("stdio"===b.transport)if(c)try{let e=JSON.parse(c),t=e;if(e?.mcpServers&&"object"==typeof e.mcpServers){let r=Object.keys(e.mcpServers);r.length>0&&(t=e.mcpServers[r[0]])}let r=Array.isArray(t?.args)?t.args.map(e=>String(e)).filter(e=>""!==e.trim()):[],a=t?.env&&"object"==typeof t.env&&!Array.isArray(t.env)?Object.entries(t.env).reduce((e,[t,r])=>(null==t||""===String(t).trim()||(e[String(t)]=null==r?"":String(r)),e),{}):{};if(!(M={command:t?.command?String(t.command):void 0,args:r,env:a}).command)return void J.default.fromBackend("Stdio configuration must include a command")}catch{J.default.fromBackend("Invalid JSON in stdio configuration");return}else{let e={};if(u)try{let t=JSON.parse(u);t&&"object"==typeof t&&!Array.isArray(t)&&(e=Object.entries(t).reduce((e,[t,r])=>(null==t||""===String(t).trim()||(e[String(t)]=null==r?"":String(r)),e),{}))}catch{J.default.fromBackend("Invalid JSON in stdio env configuration");return}let t=Array.isArray(p)?p.map(e=>String(e)).filter(e=>""!==e.trim()):[],r=m?String(m).trim():"";if(!r)return void J.default.fromBackend("Stdio transport requires a command");M={command:r,args:t,env:e}}b.transport===LK.TRANSPORT.OPENAPI&&(b.transport="http");let C=null;if(_&&""!==_.trim())try{C=JSON.parse(_)}catch{J.default.fromBackend("Invalid JSON in Token Validation Rules");return}let L=b.server_name||b.url||e.server_name||e.url||b.alias||e.alias||"unknown",D=es||v||y.length>0,P={...b,...M,stdio_config:void 0,env_json:void 0,server_id:e.server_id,mcp_info:{...e.mcp_info??{},server_name:L,description:b.description,logo_url:O||void 0,mcp_server_cost_info:Object.keys(l).length>0?l:null,tool_allowlist_enforced:D},mcp_access_groups:j,alias:b.alias,extra_headers:b.extra_headers||[],...D?{allowed_tools:y}:{},tool_name_to_display_name:Object.keys(w).length>0?w:null,tool_name_to_description:Object.keys(N).length>0?N:null,disallowed_tools:b.disallowed_tools||[],static_headers:k,env_vars:S,allow_all_keys:!!(h??e.allow_all_keys),available_on_public_internet:!!(f??e.available_on_public_internet),delegate_auth_to_upstream:b.auth_type===LK.AUTH_TYPE.OAUTH2&&!!(x??e.delegate_auth_to_upstream),oauth_passthrough:(s=b.auth_type===LK.AUTH_TYPE.NONE||null==b.auth_type,n=(Array.isArray(b.extra_headers)?b.extra_headers:[]).some(e=>"string"==typeof e&&"authorization"===e.toLowerCase()),!!s&&!!n&&!!(g??e.oauth_passthrough)),...null!==C||e.token_validation?{token_validation:C}:{}};b.auth_type&&O1.includes(b.auth_type)&&T&&Object.keys(T).length>0&&(P.credentials=T);let A=await (0,Q.updateMCPServer)(t,P);J.default.success("MCP Server updated successfully"),a(A)}catch(e){J.default.fromBackend("Failed to update MCP Server"+(e?.message?`: ${e.message}`:""))}};return(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)(rR.TabList,{className:"grid w-full grid-cols-2",children:[(0,_.jsx)(rY.Tab,{children:"Server Configuration"}),(0,_.jsx)(rY.Tab,{children:"Cost Configuration"})]}),(0,_.jsxs)(rz.TabPanels,{className:"mt-6",children:[(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(H.Form,{form:n,onFinish:ex,initialValues:eh,layout:"vertical",children:[(0,_.jsx)(H.Form.Item,{label:"MCP Server Name",name:"server_name",rules:[{validator:(e,t)=>Om(t)}],children:(0,_.jsx)($.Input,{className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:"Alias",name:"alias",rules:[{validator:(e,t)=>Om(t)}],children:(0,_.jsx)($.Input,{onChange:()=>g(!0),className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:"Description",name:"description",children:(0,_.jsx)($.Input,{className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(Os,{value:O,onChange:D}),(0,_.jsx)(H.Form.Item,{label:"Transport Type",name:"transport",rules:[{required:!0}],children:(0,_.jsxs)(eE.Select,{onChange:e=>{"stdio"===e?n.setFieldsValue({url:void 0,spec_path:void 0,auth_type:void 0,credentials:void 0,authorization_url:void 0,token_url:void 0,registration_url:void 0}):e===LK.TRANSPORT.OPENAPI?n.setFieldsValue({url:void 0,command:void 0,args:void 0,env_json:void 0,stdio_config:void 0}):n.setFieldsValue({spec_path:void 0,command:void 0,args:void 0,env_json:void 0,stdio_config:void 0})},children:[(0,_.jsx)(eE.Select.Option,{value:"http",children:"Streamable HTTP (Recommended)"}),(0,_.jsx)(eE.Select.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,_.jsx)(eE.Select.Option,{value:"stdio",children:"Standard Input/Output (stdio)"}),(0,_.jsx)(eE.Select.Option,{value:LK.TRANSPORT.OPENAPI,children:"OpenAPI Spec"})]})}),!E&&!I&&(0,_.jsx)(H.Form.Item,{label:"MCP Server URL",name:"url",rules:[{required:!0,message:"Please enter a server URL"},{validator:(e,t)=>Ou(t)}],children:(0,_.jsx)($.Input,{placeholder:"https://your-mcp-server.com",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),I&&(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OpenAPI Spec URL",(0,_.jsx)(tB.Tooltip,{title:"URL to an OpenAPI specification (JSON or YAML). MCP tools will be automatically generated from the API endpoints defined in the spec.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"spec_path",rules:[{required:!0,message:"Please enter an OpenAPI spec URL"}],children:(0,_.jsx)($.Input,{placeholder:"https://petstore3.swagger.io/api/v3/openapi.json",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),!E&&(0,_.jsx)(H.Form.Item,{label:"Authentication",name:"auth_type",rules:[{required:!0}],children:(0,_.jsxs)(eE.Select,{children:[(0,_.jsx)(eE.Select.Option,{value:"none",children:"None"}),(0,_.jsx)(eE.Select.Option,{value:"api_key",children:"API Key"}),(0,_.jsx)(eE.Select.Option,{value:"bearer_token",children:"Bearer Token"}),(0,_.jsx)(eE.Select.Option,{value:"token",children:"Token"}),(0,_.jsx)(eE.Select.Option,{value:"basic",children:"Basic Auth"}),(0,_.jsx)(eE.Select.Option,{value:"oauth2",children:"OAuth"}),(0,_.jsx)(eE.Select.Option,{value:"aws_sigv4",children:"AWS SigV4 (Bedrock AgentCore MCPs)"})]})}),E&&(0,_.jsxs)("div",{className:"rounded-lg border border-gray-200 p-4 space-y-4",children:[(0,_.jsx)("p",{className:"text-sm text-gray-600",children:"Configure the stdio transport used to launch the MCP server process. You can either fill in the fields below or paste a JSON configuration."}),(0,_.jsx)(H.Form.Item,{label:"Command",name:"command",rules:[{required:!0,message:"Please enter a command for stdio transport"}],children:(0,_.jsx)($.Input,{placeholder:"e.g., npx",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:"Args",name:"args",children:(0,_.jsx)(eE.Select,{mode:"tags",size:"large",tokenSeparators:[","],placeholder:"Add args (press enter or comma)",className:"rounded-lg"})}),(0,_.jsx)(H.Form.Item,{label:"Environment (JSON object)",name:"env_json",rules:[{validator:(e,t)=>{if(!t)return Promise.resolve();try{let e=JSON.parse(t);if(e&&"object"==typeof e&&!Array.isArray(e))return Promise.resolve();return Promise.reject(Error("Env must be a JSON object"))}catch{return Promise.reject(Error("Please enter valid JSON"))}}}],children:(0,_.jsx)($.Input.TextArea,{rows:6,className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500 font-mono text-sm",placeholder:`{ +}`,copyKey:"cursor-config",className:"text-xs"})})]})]})]})]}),{})}),(0,_.jsx)(rB.TabPanel,{className:"mt-6",children:(0,_.jsx)(()=>(0,_.jsxs)(U.Space,{direction:"vertical",size:"large",className:"w-full",children:[(0,_.jsxs)("div",{className:"bg-gradient-to-r from-green-50 to-teal-50 p-6 rounded-lg border border-green-100",children:[(0,_.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,_.jsx)(OS,{className:"text-green-600",size:24}),(0,_.jsx)(OT,{level:4,className:"mb-0 text-green-900",children:"Streamable HTTP Transport"})]}),(0,_.jsx)(OM,{className:"text-green-700",children:"Connect to LiteLLM MCP using HTTP transport. Compatible with any MCP client that supports HTTP streaming."})]}),(0,_.jsx)(OL,{icon:(0,_.jsx)(OS,{className:"text-green-600",size:16}),title:"Universal MCP Connection",description:"Use this URL with any MCP client that supports HTTP transport",children:(0,_.jsxs)(U.Space,{direction:"vertical",size:"middle",className:"w-full",children:[(0,_.jsx)("div",{children:(0,_.jsx)(OM,{children:"Each MCP client supports different transports. Refer to your client documentation to determine the appropriate transport method."})}),(0,_.jsx)(o,{title:"Server URL",code:`${t}/mcp`,copyKey:"http-server-url"}),(0,_.jsx)(o,{title:"Headers Configuration",code:JSON.stringify({"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"},null,2),copyKey:"http-headers"}),(0,_.jsx)("div",{className:"mt-4",children:(0,_.jsx)(z.Button,{type:"link",className:"p-0 h-auto text-blue-600 hover:text-blue-700",href:"https://modelcontextprotocol.io/docs/concepts/transports",icon:(0,_.jsx)(Cu.default,{size:14}),children:"Learn more about MCP transports"})})]})})]}),{})})]})]})]})})};var OD=e.i(562901),OD=OD;let OP={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"more",theme:"outlined"};var OA=T.forwardRef(function(e,t){return T.createElement(rf.default,(0,rp.default)({},e,{ref:t,icon:OP}))}),OE=e.i(962944);let{Text:OI}=V.Typography,OY={healthy:{dot:"bg-green-500"},unhealthy:{dot:"bg-red-500"},unknown:{dot:"bg-gray-300"}},OF=e=>e.stopPropagation(),OR=({status:e,isLoadingHealth:t,isRechecking:r,onRecheck:a,lastCheck:s,error:n,dotClass:l})=>{if(t||r)return(0,_.jsx)(eN.Tag,{className:"m-0",children:(0,_.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs text-gray-500",children:[(0,_.jsx)("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-gray-300"}),"Checking"]})});let i=(0,_.jsxs)("div",{className:"max-w-xs",children:[(0,_.jsxs)("div",{className:"font-semibold mb-1",children:["Health: ",e]}),s&&(0,_.jsxs)("div",{className:"text-xs mb-1",children:["Last check: ",new Date(s).toLocaleString()]}),n&&(0,_.jsxs)("div",{className:"text-xs",children:[(0,_.jsx)("div",{className:"font-medium text-red-300 mb-1",children:"Error"}),(0,_.jsx)("div",{className:"break-words",children:n})]}),!s&&!n&&(0,_.jsx)("div",{className:"text-xs text-gray-400",children:"No health data"}),a&&(0,_.jsx)("div",{className:"mt-1 text-xs text-gray-300",children:"Click to recheck"})]});return(0,_.jsx)(tB.Tooltip,{title:i,placement:"top",children:(0,_.jsx)(eN.Tag,{className:`m-0 ${a?"cursor-pointer hover:opacity-80":"cursor-default"}`,onClick:a?e=>{e.stopPropagation(),a()}:void 0,children:(0,_.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,_.jsx)("span",{className:`h-1.5 w-1.5 rounded-full ${l}`}),e.charAt(0).toUpperCase()+e.slice(1)]})})})},OB=({connected:e,onConnect:t})=>e?(0,_.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[(0,_.jsx)("span",{className:"text-gray-500",children:"BYOK credential"}),(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-green-200 bg-green-50 px-2 py-0.5 font-medium text-green-700",children:[(0,_.jsx)(kQ.CheckOutlined,{style:{fontSize:10}})," Connected"]}),t&&(0,_.jsx)("button",{type:"button",onClick:e=>{OF(e),t()},className:"text-xs text-gray-400 transition-colors hover:text-blue-600",children:"Update"})]})]}):(0,_.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[(0,_.jsx)("span",{className:"text-gray-500",children:"BYOK credential"}),t?(0,_.jsx)("button",{type:"button",onClick:e=>{OF(e),t()},className:"rounded-md bg-blue-600 px-3 py-1 text-xs font-medium text-white shadow-sm transition-colors hover:bg-blue-700",children:"Connect"}):(0,_.jsx)("span",{className:"text-gray-400",children:"—"})]}),Oz=({server:e,missingUserFields:t,isLoadingHealth:r,isRechecking:a,onClick:s,onRecheckHealth:n,onByokConnect:l,onOpenFillFields:i,onDelete:o})=>{let d=e.alias||e.server_name||"",c=e.server_name||d||e.server_id,u=e.mcp_info?.logo_url??void 0,[m,p]=(0,T.useState)(null),h=u&&m!==u?u:void 0,f=e.transport||"http",x=e.spec_path&&"stdio"!==f?"openapi":f,g=e.auth_type||"none",y=e.status||"unknown",b=OY[y]??OY.unknown,v=e.available_on_public_internet,j=(e.mcp_access_groups??[]).filter(e=>"string"==typeof e),w=t??[],k=w.length>0,S=k?"border-2 border-red-300 bg-red-50/40 hover:border-red-400 hover:shadow-md":"border border-gray-200 bg-white hover:border-gray-300 hover:shadow-md",N=e.url||"",{maskedUrl:M}=N?Od(N):{maskedUrl:""},C="",L="";"stdio"===f?L=C=[e.command,...e.args??[]].filter(e=>"string"==typeof e&&e.length>0).join(" "):e.spec_path?(C=e.spec_path,L=e.spec_path):N&&(C=M,L=N);let O=[];return n&&O.push({key:"test-connection",label:"Test Connection",icon:(0,_.jsx)(OE.ThunderboltOutlined,{}),disabled:a,onClick:({domEvent:e})=>{e.stopPropagation(),n()}}),o&&(O.length>0&&O.push({key:"divider",type:"divider"}),O.push({key:"delete",label:"Delete",icon:(0,_.jsx)(jQ.DeleteOutlined,{}),danger:!0,onClick:({domEvent:e})=>{e.stopPropagation(),o()}})),(0,_.jsxs)("div",{role:"button",tabIndex:0,onClick:s,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),s())},className:`group relative flex h-full cursor-pointer flex-col gap-3 rounded-lg p-4 transition-all duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400 ${S}`,children:[(0,_.jsxs)("div",{className:"flex items-start gap-3",children:[h?(0,_.jsx)("img",{src:h,alt:`${c} logo`,className:"h-10 w-10 flex-shrink-0 rounded object-contain",onError:()=>p(h)}):(0,_.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded bg-gray-100 font-semibold text-gray-500",children:(c||"?").slice(0,2).toUpperCase()}),(0,_.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,_.jsx)("div",{className:"block w-full truncate text-left font-semibold text-gray-900",title:c,children:c}),(0,_.jsxs)("div",{className:"mt-0.5 flex items-center gap-2 text-xs text-gray-500",children:[d&&(0,_.jsx)("span",{className:"truncate",children:d}),d&&(0,_.jsx)("span",{className:"text-gray-300",children:"·"}),(0,_.jsx)(tB.Tooltip,{title:e.server_id,children:(0,_.jsx)("span",{className:"font-mono text-blue-600",children:e.server_id.slice(0,7)})})]})]}),O.length>0&&(0,_.jsx)(Tn.Dropdown,{menu:{items:O},trigger:["click"],placement:"bottomRight",children:(0,_.jsx)("button",{type:"button",onClick:OF,onKeyDown:OF,"aria-label":"Server actions",className:"-mr-1 -mt-1 inline-flex h-8 w-8 items-center justify-center rounded-md text-gray-500 transition-colors hover:bg-gray-100 hover:text-blue-600",children:(0,_.jsx)(OA,{style:{fontSize:20}})})})]}),C?(0,_.jsx)(tB.Tooltip,{title:L,children:(0,_.jsx)(OI,{className:"truncate font-mono text-xs text-gray-500",ellipsis:!0,children:C})}):(0,_.jsx)("div",{className:"h-[18px]","aria-hidden":!0}),(0,_.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,_.jsx)(OR,{status:y,isLoadingHealth:r,isRechecking:a,onRecheck:n,lastCheck:e.last_health_check,error:e.health_check_error,dotClass:b.dot}),(0,_.jsx)(eN.Tag,{className:"m-0",children:x.toUpperCase()}),(0,_.jsx)(eN.Tag,{className:"m-0",children:g}),(0,_.jsx)(eN.Tag,{color:v?"green":"orange",className:"m-0",children:(0,_.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,_.jsx)("span",{className:`h-1.5 w-1.5 rounded-full ${v?"bg-green-500":"bg-orange-500"}`}),v?"Public":"Internal"]})}),j.slice(0,2).map(e=>(0,_.jsx)(tB.Tooltip,{title:e,children:(0,_.jsx)(eN.Tag,{className:"m-0 max-w-[120px] truncate",children:e})},e)),j.length>2&&(0,_.jsx)(tB.Tooltip,{title:j.slice(2).join(", "),children:(0,_.jsxs)(eN.Tag,{className:"m-0",children:["+",j.length-2]})})]}),(e.is_byok||k)&&(0,_.jsxs)("div",{className:"mt-auto flex flex-col gap-2",children:[e.is_byok&&(0,_.jsx)(OB,{connected:!!e.has_user_credential,onConnect:l}),k&&(0,_.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[(0,_.jsx)(tB.Tooltip,{title:(0,_.jsxs)("div",{children:[(0,_.jsx)("div",{className:"font-semibold mb-1",children:"Missing user fields:"}),(0,_.jsx)("ul",{className:"ml-3",children:w.map(e=>(0,_.jsxs)("li",{children:["• ",e]},e))})]}),children:(0,_.jsxs)("span",{className:"inline-flex items-center gap-1 font-semibold text-red-700",children:[(0,_.jsx)(OD.default,{}),w.length," user field",1===w.length?"":"s"," missing"]})}),i&&(0,_.jsx)("button",{type:"button",onClick:e=>{OF(e),i()},className:"rounded-md bg-red-600 px-3 py-1 text-xs font-medium text-white shadow-sm transition-colors hover:bg-red-700",children:"Set"})]})]})]})},OH=T.forwardRef(function(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"}))});function O$(e){if(!e)return[];if(Array.isArray(e))return e.map(e=>Oq(e)).filter(e=>void 0!==e);let t=Oq(e);return void 0===t?[]:[t]}function Oq(e,t){if(!e)return;let r=void 0!==t?t:e.default;if("object"===e.type){let t="object"!=typeof r||null===r||Array.isArray(r)?{}:{...r};return e.properties&&Object.entries(e.properties).forEach(([e,r])=>{t[e]=Oq(r,t[e])}),t}if("array"===e.type){if(Array.isArray(r)){let t=e.items;if(!t)return r;if(0===r.length){let e=O$(t);return e.length?e:r}return Array.isArray(t)?r.map((e,r)=>Oq(t[r]??t[t.length-1],e)):r.map(e=>Oq(t,e))}return void 0!==r?r:O$(e.items)}if(void 0!==r)return r;switch(e.type){case"integer":case"number":return 0;case"boolean":return!1;default:return""}}let OU=e=>{let t=Oq(e);if("object"===e.type||"array"===e.type){let r="array"===e.type?[]:{};return JSON.stringify(t??r,null,2)}return t};function OW({tool:e,onSubmit:t,isLoading:r,result:a,error:s,onClose:n}){let[l]=H.Form.useForm(),[i,o]=T.default.useState("formatted"),[d,c]=T.default.useState(null),[u,m]=T.default.useState(null),p=T.default.useMemo(()=>"string"==typeof e.inputSchema?{type:"object",properties:{input:{type:"string",description:"Input for this tool"}},required:["input"]}:e.inputSchema,[e.inputSchema]),h=T.default.useMemo(()=>p.properties&&p.properties.params&&"object"===p.properties.params.type&&p.properties.params.properties?{type:"object",properties:p.properties.params.properties,required:p.properties.params.required||[]}:p,[p]);T.default.useEffect(()=>{if(l.resetFields(),!h.properties)return;let e={};Object.entries(h.properties).forEach(([t,r])=>{e[t]=OU(r)}),l.setFieldsValue(e)},[l,h,e]),T.default.useEffect(()=>{d&&(a||s)&&m(Date.now()-d)},[a,s,d]);let f=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();let r=document.execCommand("copy");if(document.body.removeChild(t),!r)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},x=async()=>{await f(JSON.stringify(a,null,2))?J.default.success("Result copied to clipboard"):J.default.fromBackend("Failed to copy result")},g=async()=>{await f(e.name)?J.default.success("Tool name copied to clipboard"):J.default.fromBackend("Failed to copy tool name")};return(0,_.jsxs)("div",{className:"space-y-4 h-full",children:[(0,_.jsxs)("div",{className:"flex items-center justify-between pb-3 border-b border-gray-200",children:[(0,_.jsxs)("div",{className:"flex items-center space-x-3",children:[e.mcp_info.logo_url&&(0,_.jsx)("img",{src:e.mcp_info.logo_url,alt:`${e.mcp_info.server_name} logo`,className:"w-6 h-6 object-contain"}),(0,_.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,_.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,_.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Test Tool:"}),(0,_.jsxs)("div",{className:"group inline-flex items-center space-x-1 bg-slate-50 hover:bg-slate-100 px-3 py-1 rounded-md cursor-pointer transition-colors border border-slate-200",onClick:g,title:"Click to copy tool name",children:[(0,_.jsx)("span",{className:"font-mono text-slate-700 font-medium text-sm",children:e.name}),(0,_.jsx)("svg",{className:"w-3 h-3 text-slate-400 group-hover:text-slate-600 transition-colors",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})]})]}),(0,_.jsx)("p",{className:"text-xs text-gray-600",children:e.description}),(0,_.jsxs)("p",{className:"text-xs text-gray-500",children:["Provider: ",e.mcp_info.server_name]})]})]}),(0,_.jsx)(S.Button,{onClick:n,variant:"light",size:"sm",className:"text-gray-500 hover:text-gray-700",children:(0,_.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,_.jsxs)("div",{className:"grid grid-cols-2 gap-4 h-full",children:[(0,_.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,_.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,_.jsxs)("div",{className:"flex items-center justify-between",children:[(0,_.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Input Parameters"}),(0,_.jsx)(tB.Tooltip,{title:"Configure the input parameters for this tool call",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"text-gray-400 hover:text-gray-600"})})]})}),(0,_.jsx)("div",{className:"p-4",children:(0,_.jsxs)(H.Form,{form:l,onFinish:e=>{c(Date.now()),m(null);let r={};Object.entries(e).forEach(([e,t])=>{let a=h.properties?.[e],s="string"==typeof t?t.trim():t;if(a&&null!=s&&""!==s)switch(a.type){case"boolean":r[e]="true"===s||!0===s;break;case"number":case"integer":{let t=Number(s);r[e]=Number.isNaN(t)?s:"integer"===a.type?Math.trunc(t):t;break}case"object":case"array":try{let t="string"==typeof s?JSON.parse(s):s,n="object"===a.type&&null!==t&&"object"==typeof t&&!Array.isArray(t),l="array"===a.type&&Array.isArray(t);"object"===a.type&&n||"array"===a.type&&l?r[e]=t:r[e]=s}catch(t){r[e]=s}break;case"string":r[e]=String(s);break;default:r[e]=s}else null!=s&&""!==s&&(r[e]=s)}),t(p.properties&&p.properties.params&&"object"===p.properties.params.type&&p.properties.params.properties?{params:r}:r)},layout:"vertical",className:"space-y-3",children:["string"==typeof e.inputSchema?(0,_.jsx)("div",{className:"space-y-3",children:(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Input ",(0,_.jsx)("span",{className:"text-red-500",children:"*"})]}),name:"input",rules:[{required:!0,message:"Please enter input for this tool"}],className:"mb-3",children:(0,_.jsx)(et.TextInput,{placeholder:"Enter input for this tool",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})})}):void 0===h.properties?(0,_.jsx)("div",{className:"text-center py-6 bg-gray-50 rounded-lg border border-gray-200",children:(0,_.jsxs)("div",{className:"max-w-sm mx-auto",children:[(0,_.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"No Parameters Required"}),(0,_.jsx)("p",{className:"text-xs text-gray-500",children:"This tool can be called without any input parameters."})]})}):(0,_.jsx)("div",{className:"space-y-3",children:Object.entries(h.properties).map(([t,r])=>{let a=OU(r),s=`${e.name}-${t}`;return(0,_.jsxs)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:[t," ",h.required?.includes(t)&&(0,_.jsx)("span",{className:"text-red-500",children:"*"}),r.description&&(0,_.jsx)(tB.Tooltip,{title:r.description,children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:t,initialValue:a,rules:[{required:h.required?.includes(t),message:`Please enter ${t}`},..."object"===r.type||"array"===r.type?[{validator:(e,a)=>{if((null==a||""===a)&&!h.required?.includes(t))return Promise.resolve();try{let e="string"==typeof a?JSON.parse(a):a,t="object"===r.type&&null!==e&&"object"==typeof e&&!Array.isArray(e),s="array"===r.type&&Array.isArray(e);if("object"===r.type&&t||"array"===r.type&&s)return Promise.resolve();return Promise.reject(Error("object"===r.type?"Please enter a JSON object":"Please enter a JSON array"))}catch(e){return Promise.reject(Error("Invalid JSON"))}}}]:[]],className:"mb-3",children:["string"===r.type&&r.enum&&(0,_.jsxs)("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors",defaultValue:a??"",children:[!h.required?.includes(t)&&(0,_.jsxs)("option",{value:"",children:["Select ",t]}),r.enum.map(e=>(0,_.jsx)("option",{value:e,children:e},e))]}),"string"===r.type&&!r.enum&&(0,_.jsx)(et.TextInput,{placeholder:r.description||`Enter ${t}`,defaultValue:a??"",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"}),("number"===r.type||"integer"===r.type)&&(0,_.jsx)("input",{type:"number",step:"integer"===r.type?1:"any",placeholder:r.description||`Enter ${t}`,defaultValue:a??0,className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors"}),"boolean"===r.type&&(0,_.jsxs)(eE.Select,{placeholder:`Select ${t}`,allowClear:!h.required?.includes(t),className:"w-full",children:[(0,_.jsx)(eE.Select.Option,{value:!0,children:"True"}),(0,_.jsx)(eE.Select.Option,{value:!1,children:"False"})]}),("object"===r.type||"array"===r.type)&&(0,_.jsxs)("div",{className:"space-y-2",children:[(0,_.jsx)("textarea",{rows:"object"===r.type?6:4,placeholder:r.description||("object"===r.type?`Enter JSON object for ${t}`:`Enter JSON array for ${t}`),defaultValue:a??("object"===r.type?"{}":"[]"),spellCheck:!1,"data-testid":`textarea-${t}`,className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm font-mono"}),(0,_.jsx)("p",{className:"text-xs text-gray-500",children:"object"===r.type?"Provide a valid JSON object.":"Provide a valid JSON array."})]})]},s)})}),(0,_.jsx)("div",{className:"pt-3 border-t border-gray-100",children:(0,_.jsx)(S.Button,{type:"button",onClick:()=>l.submit(),disabled:r,variant:"primary",className:"w-full",loading:r,children:r?"Calling Tool...":a||s?"Call Again":"Call Tool"})})]})})]}),(0,_.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,_.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,_.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Tool Result"})}),(0,_.jsx)("div",{className:"p-4",children:a||s||r?(0,_.jsxs)("div",{className:"space-y-3",children:[a&&!r&&!s&&(0,_.jsx)("div",{className:"p-2 bg-green-50 border border-green-200 rounded-lg",children:(0,_.jsxs)("div",{className:"flex items-center justify-between",children:[(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)("svg",{className:"h-4 w-4 text-green-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,_.jsx)("h4",{className:"text-xs font-medium text-green-900",children:"Tool executed successfully"}),null!==u&&(0,_.jsxs)("span",{className:"text-xs text-green-600 ml-1",children:["• ",(u/1e3).toFixed(2),"s"]})]}),(0,_.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,_.jsxs)("div",{className:"flex bg-white rounded border border-green-300 p-0.5",children:[(0,_.jsx)("button",{onClick:()=>o("formatted"),className:`px-2 py-1 text-xs font-medium rounded transition-colors ${"formatted"===i?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"}`,children:"Formatted"}),(0,_.jsx)("button",{onClick:()=>o("json"),className:`px-2 py-1 text-xs font-medium rounded transition-colors ${"json"===i?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"}`,children:"JSON"})]}),(0,_.jsx)("button",{onClick:x,className:"p-1 hover:bg-green-100 rounded text-green-700",title:"Copy response",children:(0,_.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,_.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,_.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]})}),(0,_.jsxs)("div",{className:"max-h-96 overflow-y-auto",children:[r&&(0,_.jsxs)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:[(0,_.jsxs)("div",{className:"relative",children:[(0,_.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-gray-200"}),(0,_.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,_.jsx)("p",{className:"text-sm font-medium mt-3",children:"Calling tool..."}),(0,_.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"Please wait while we process your request"})]}),s&&(0,_.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:(0,_.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,_.jsx)("div",{className:"flex-shrink-0",children:(0,_.jsx)("svg",{className:"h-4 w-4 text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,_.jsxs)("div",{className:"flex-1",children:[(0,_.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,_.jsx)("h4",{className:"text-xs font-medium text-red-900",children:"Tool Call Failed"}),null!==u&&(0,_.jsxs)("span",{className:"text-xs text-red-600",children:["• ",(u/1e3).toFixed(2),"s"]})]}),(0,_.jsx)("div",{className:"bg-white border border-red-200 rounded p-2 max-h-48 overflow-y-auto",children:(0,_.jsx)("pre",{className:"text-xs whitespace-pre-wrap text-red-700 font-mono",children:s.message})})]})]})}),a&&!r&&!s&&(0,_.jsx)("div",{className:"space-y-3",children:"formatted"===i?a.map((e,t)=>(0,_.jsxs)("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:["text"===e.type&&(0,_.jsxs)("div",{children:[(0,_.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,_.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Text Response"})}),(0,_.jsx)("div",{className:"p-3",children:(0,_.jsx)("div",{className:"bg-white rounded border border-gray-200 max-h-64 overflow-y-auto",children:(0,_.jsx)("div",{className:"p-3 space-y-2",children:e.text.split("\n\n").map((e,t)=>{if(""===e.trim())return null;if(e.startsWith("##")){let r=e.replace(/^#+\s/,"");return(0,_.jsx)("div",{className:"border-b border-gray-200 pb-1 mb-2",children:(0,_.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:r})},t)}let r=/(https?:\/\/[^\s\)]+)/g;if(r.test(e)){let a=e.split(r);return(0,_.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded p-2",children:(0,_.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap",children:a.map((e,t)=>r.test(e)?(0,_.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline break-all",children:e},t):e)})},t)}return e.includes("Score:")?(0,_.jsx)("div",{className:"bg-green-50 border-l-4 border-green-400 p-2 rounded-r",children:(0,_.jsx)("p",{className:"text-xs text-green-800 font-medium whitespace-pre-wrap",children:e})},t):(0,_.jsx)("div",{className:"bg-gray-50 rounded p-2 border border-gray-200",children:(0,_.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap font-mono",children:e})},t)}).filter(Boolean)})})})]}),"image"===e.type&&e.url&&(0,_.jsxs)("div",{children:[(0,_.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,_.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Image Response"})}),(0,_.jsx)("div",{className:"p-3",children:(0,_.jsx)("div",{className:"bg-gray-50 rounded p-3 border border-gray-200",children:(0,_.jsx)("img",{src:e.url,alt:"Tool result",className:"max-w-full h-auto rounded shadow-sm"})})})]}),"embedded_resource"===e.type&&(0,_.jsxs)("div",{children:[(0,_.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,_.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Embedded Resource"})}),(0,_.jsx)("div",{className:"p-3",children:(0,_.jsxs)("div",{className:"flex items-center space-x-2 p-3 bg-blue-50 border border-blue-200 rounded",children:[(0,_.jsx)("div",{className:"flex-shrink-0",children:(0,_.jsx)("svg",{className:"h-5 w-5 text-blue-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),(0,_.jsxs)("div",{className:"flex-1",children:[(0,_.jsxs)("p",{className:"text-xs font-medium text-blue-900",children:["Resource Type: ",e.resource_type]}),e.url&&(0,_.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-xs text-blue-600 hover:text-blue-800 hover:underline mt-1 transition-colors",children:["View Resource",(0,_.jsxs)("svg",{className:"ml-1 h-3 w-3",fill:"currentColor",viewBox:"0 0 20 20",children:[(0,_.jsx)("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),(0,_.jsx)("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"})]})]})]})]})})]})]},t)):(0,_.jsx)("div",{className:"bg-white rounded border border-gray-200",children:(0,_.jsx)("div",{className:"p-3 overflow-auto max-h-80 bg-gray-50",children:(0,_.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all text-gray-800",children:JSON.stringify(a,null,2)})})})})]})]}):(0,_.jsx)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:(0,_.jsxs)("div",{className:"text-center max-w-sm",children:[(0,_.jsx)("div",{className:"mb-3",children:(0,_.jsx)("svg",{className:"mx-auto h-12 w-12 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),(0,_.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"Ready to Call Tool"}),(0,_.jsx)("p",{className:"text-xs text-gray-500 leading-relaxed",children:'Configure the input parameters and click "Call Tool" to see the results here.'})]})})})]})]})]})}function OV(e){return e.toLowerCase().trim().replace(/[^a-z0-9_]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"")}function OG(e,t){let r=e?OV(e):"";return{[r?`x-mcp-${r}-authorization`:"x-mcp-auth"]:`Bearer ${t}`}}var OK=e.i(779129);let OJ="litellm-tools-mcp-oauth-flow-state",OQ="litellm-tools-mcp-oauth-result";var OX=e.i(280024),OZ=e.i(2781);let O0=({serverId:e,accessToken:t,auth_type:r,oauth2_flow:a,delegate_auth_to_upstream:s,userRole:n,userID:l,serverAlias:i,extraHeaders:o})=>{let[d,c]=(0,T.useState)(null),[u,m]=(0,T.useState)(null),[p,h]=(0,T.useState)(null),[f,x]=(0,T.useState)(""),[g,y]=(0,T.useState)({}),[b,v]=(0,T.useState)(!1),j=(0,LK.getMcpOAuthMode)({auth_type:r,oauth2_flow:a,delegate_auth_to_upstream:s}),w="passthrough"===j,k="obo"===j,[S,N]=(0,T.useState)(()=>w&&(0,LG.isTokenValid)(e,l)?(0,LG.getToken)(e,l)?.access_token??null:null);(0,T.useEffect)(()=>{w?N((0,LG.isTokenValid)(e,l)?(0,LG.getToken)(e,l)?.access_token??null:null):N(null)},[e,l,w]);let{startOAuthFlow:M,status:C,error:L}=(({accessToken:e,serverId:t,serverAlias:r,userId:a,scopes:s,clientId:n,onSuccess:l})=>{let[i,o]=(0,T.useState)("idle"),[d,c]=(0,T.useState)(null),u=(0,T.useRef)(!1),m=(0,T.useRef)(l);m.current=l;let p=(0,T.useCallback)(async()=>{try{let a;o("authorizing"),c(null);let l=n??void 0;if(!l)try{let s=await (0,Q.registerMcpOAuthClient)(e,t,{client_name:r||t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"});l=s?.client_id,a=s?.client_secret}catch(e){}let i=(0,Oh.generateCodeVerifier)(),d=await (0,Oh.generateCodeChallenge)(i),u=crypto.randomUUID(),m=(0,OK.buildCallbackUrl)(),p=s?.filter(e=>e.trim()).join(" "),h=(0,Q.buildMcpOAuthAuthorizeUrl)({serverId:t,clientId:l,redirectUri:m,state:u,codeChallenge:d,scope:p}),f={state:u,codeVerifier:i,serverId:t,redirectUri:m,clientId:l,clientSecret:a,scopes:s};(0,Of.setSecureItem)(OJ,JSON.stringify(f)),(0,Of.setSecureItem)("litellm-mcp-oauth-return-url",window.location.href),window.location.href=h}catch(t){let e=(0,Op.extractErrorMessage)(t);c(e),o("error"),J.default.error(e)}},[e,t,r,s,n]),h=(0,T.useCallback)(async()=>{if(u.current)return;let r=(0,Of.getSecureItem)(OQ);if(!r)return;let s=(0,Of.getSecureItem)(OJ);if(!s)return;let n=null;try{if((n=JSON.parse(s)).serverId&&n.serverId!==t)return}catch(e){}u.current=!0,(0,OK.clearStorage)(OQ);let l=null,i=null;try{l=JSON.parse(r),i=n}catch(e){c("Failed to resume OAuth flow. Please retry."),o("error"),u.current=!1,(0,OK.clearStorage)(OJ);return}try{if(!i?.state||!i.codeVerifier||!i.serverId)throw Error("OAuth session state was lost. Please retry.");if(!l?.state||l.state!==i.state)throw Error("OAuth state mismatch. Please retry.");if(l.error)throw Error(l.error_description||l.error);if(!l.code)throw Error("Authorization code missing in callback.");o("exchanging");let t=await (0,Q.exchangeMcpOAuthToken)({serverId:i.serverId,code:l.code,clientId:i.clientId,clientSecret:i.clientSecret,codeVerifier:i.codeVerifier,redirectUri:i.redirectUri,accessToken:e});(0,LG.setToken)(i.serverId,{access_token:t.access_token,expires_in:t.expires_in,refresh_token:t.refresh_token,token_type:t.token_type},a),o("success"),c(null),J.default.success("Connected successfully"),m.current(t.access_token)}catch(t){let e=(0,Op.extractErrorMessage)(t);c(e),o("error"),J.default.error(e)}finally{(0,OK.clearStorage)(OJ),setTimeout(()=>{u.current=!1},1e3)}},[e,t,a]);return(0,T.useEffect)(()=>{h()},[h]),{startOAuthFlow:p,status:i,error:d}})({accessToken:t??"",serverId:e,serverAlias:i,userId:l,onSuccess:N}),{data:O,isLoading:D,isError:A,refetch:E}=(0,ev.useQuery)({queryKey:["mcpOauthUserCredStatus",e,l],queryFn:()=>(0,Q.getMCPOAuthUserCredentialStatus)(t??"",e),enabled:!!t&&k,staleTime:3e4}),I=!!O?.has_credential,Y=k&&!D&&(A||!!O&&!I),F=k&&D,R=o&&o.length>0,B=()=>{let e={};if(w&&S&&Object.assign(e,OG(i,S)),i&&R){let t=OV(i);t&&Object.entries(g).forEach(([r,a])=>{a&&a.trim()&&(e[`x-mcp-${t}-${r.toLowerCase()}`]=a)})}return Object.keys(e).length>0?e:void 0},{data:H,isLoading:q,error:U,refetch:W}=(0,ev.useQuery)({queryKey:["mcpTools",e,g,S],queryFn:async()=>{if(!t)throw Error("Access Token required");let r=await (0,Q.listMCPTools)(t,e,B());if(r?.error){let t=r.status;401===t&&(0,LG.removeToken)(e,l);let a=Error(r.message||r.error||"Failed to fetch MCP tools");throw a.status=t,a.statusText=r.statusText,a.details=r.details,a}return r},enabled:!!t&&(w?null!==S:!k||I),staleTime:3e4,retry:(e,t)=>t?.status!==401&&t?.response?.status!==401&&e<2}),V=(0,T.useCallback)(()=>{E(),W()},[E,W]),{startOAuthFlow:G,status:K,error:ee}=(0,OX.useUserMcpOAuthFlow)({accessToken:t??"",serverId:e,serverAlias:i,onSuccess:V}),et=(0,T.useCallback)(()=>{try{(0,Of.setSecureItem)(OK.TOOLS_OAUTH_UI_STATE_KEY,JSON.stringify({serverId:e}))}catch(e){}G()},[e,G]);(0,T.useEffect)(()=>{401===(U?.status??U?.response?.status)&&((0,LG.removeToken)(e,l),N(null))},[U,e,l]);let{mutate:er,isPending:ea}=(0,ep.useMutation)({mutationFn:async r=>{if(!t)throw Error("Access Token required");try{return await (0,Q.callMCPTool)(t,e,r.tool.name,r.arguments,{customHeaders:B()})}catch(e){throw e}},onSuccess:e=>{m(e.content),h(null)},onError:t=>{h(t),m(null),(t?.status===401||t?.response?.status===401)&&((0,LG.removeToken)(e,l),N(null))}}),es=H?.tools||[],en=w&&!S||Y,ei=q||F,eo=es.filter(e=>{let t=f.toLowerCase();return e.name.toLowerCase().includes(t)||e.description&&e.description.toLowerCase().includes(t)||e.mcp_info.server_name&&e.mcp_info.server_name.toLowerCase().includes(t)});return(0,_.jsx)("div",{className:"w-full h-screen p-4 bg-white",children:(0,_.jsx)(P.Card,{className:"w-full rounded-xl shadow-md overflow-hidden",children:(0,_.jsxs)("div",{className:"flex h-auto w-full gap-4",children:[(0,_.jsxs)("div",{className:"w-1/4 p-4 bg-gray-50 flex flex-col",children:[(0,_.jsx)(X.Title,{className:"text-xl font-semibold mb-6 mt-2",children:"MCP Tools"}),(0,_.jsxs)("div",{className:"flex flex-col flex-1",children:[R&&(0,_.jsxs)("div",{className:"mb-4 p-3 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,_.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,_.jsxs)("div",{className:"flex items-center",children:[(0,_.jsx)(el.KeyOutlined,{className:"text-blue-600 mr-2"}),(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-blue-800",children:"Additional Headers"})]}),(0,_.jsx)(z.Button,{size:"small",type:"link",onClick:()=>v(!b),className:"text-blue-700 p-0 h-auto",children:b?"Hide":"Configure"})]}),!b&&0===Object.keys(g).length&&(0,_.jsx)(Z.Text,{className:"text-xs text-blue-700",children:'This server requires additional headers. Click "Configure" to provide values.'}),b&&(0,_.jsxs)("div",{className:"mt-3 space-y-2",children:[o?.map(e=>(0,_.jsxs)("div",{children:[(0,_.jsx)("label",{className:"block text-xs font-medium text-gray-700 mb-1",children:e}),(0,_.jsx)($.Input,{size:"small",placeholder:`Enter ${e}`,value:g[e]||"",onChange:t=>{y({...g,[e]:t.target.value})},prefix:(0,_.jsx)(el.KeyOutlined,{className:"text-gray-400"}),className:"rounded"})]},e)),(0,_.jsx)(z.Button,{size:"small",type:"primary",onClick:()=>{W(),v(!1)},disabled:Object.values(g).every(e=>!e||!e.trim()),className:"w-full mt-2",children:"Load Tools"})]}),!b&&Object.keys(g).length>0&&(0,_.jsx)("div",{className:"mt-2",children:(0,_.jsxs)(Z.Text,{className:"text-xs text-green-700 flex items-center",children:[(0,_.jsx)("span",{className:"inline-block w-2 h-2 bg-green-500 rounded-full mr-2"}),Object.keys(g).length," header(s) configured"]})})]}),(0,_.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,_.jsxs)(Z.Text,{className:"font-medium block mb-3 text-gray-700 flex items-center",children:[(0,_.jsx)(Nd.ToolOutlined,{className:"mr-2"})," Available Tools",es.length>0&&(0,_.jsx)("span",{className:"ml-2 bg-blue-100 text-blue-800 text-xs font-medium px-2 py-0.5 rounded-full",children:es.length})]}),w&&!S&&(0,_.jsxs)("div",{className:"p-4 text-center bg-white border border-gray-200 rounded-lg",children:[(0,_.jsx)(OZ.LockOutlined,{className:"text-2xl text-gray-400 mb-2"}),(0,_.jsx)("p",{className:"text-xs font-medium text-gray-700 mb-1",children:"Authentication required"}),(0,_.jsx)("p",{className:"text-xs text-gray-500 mb-3",children:"Authenticate to view available tools"}),(0,_.jsx)(z.Button,{size:"small",type:"primary",loading:"authorizing"===C||"exchanging"===C,onClick:M,disabled:!t,children:"Authorize"}),L&&(0,_.jsx)("p",{className:"text-xs text-red-500 mt-2",children:L})]}),Y&&(0,_.jsxs)("div",{className:"p-4 text-center bg-white border border-gray-200 rounded-lg",children:[(0,_.jsx)(OZ.LockOutlined,{className:"text-2xl text-gray-400 mb-2"}),(0,_.jsx)("p",{className:"text-xs font-medium text-gray-700 mb-1",children:"Authentication required"}),(0,_.jsx)("p",{className:"text-xs text-gray-500 mb-3",children:"Authenticate with the upstream provider to view available tools"}),(0,_.jsx)(z.Button,{size:"small",type:"primary",loading:"authorizing"===K||"exchanging"===K,onClick:et,disabled:!t,children:"Authorize"}),ee&&(0,_.jsx)("p",{className:"text-xs text-red-500 mt-2",children:ee})]}),en?null:(0,_.jsxs)(_.Fragment,{children:[es.length>0&&(0,_.jsx)("div",{className:"mb-3",children:(0,_.jsx)($.Input,{placeholder:"Search tools...",prefix:(0,_.jsx)(ry.SearchOutlined,{className:"text-gray-400"}),value:f,onChange:e=>x(e.target.value),allowClear:!0,className:"rounded-lg",size:"middle"})}),ei&&(0,_.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 bg-white border border-gray-200 rounded-lg",children:[(0,_.jsxs)("div",{className:"relative mb-3",children:[(0,_.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-gray-200"}),(0,_.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,_.jsx)("p",{className:"text-xs font-medium text-gray-700",children:"Loading tools..."})]}),(H?.error||U)&&!ei&&!es.length&&(0,_.jsx)("div",{className:"p-3 text-xs text-red-800 rounded-lg bg-red-50 border border-red-200",children:(0,_.jsxs)("p",{className:"font-medium",children:["Error: ",H?.message||U?.message]})}),!ei&&!H?.error&&!U&&(!es||0===es.length)&&(0,_.jsxs)("div",{className:"p-4 text-center bg-white border border-gray-200 rounded-lg",children:[(0,_.jsx)("div",{className:"mx-auto w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center mb-2",children:(0,_.jsx)("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 8.172V5L8 4z"})})}),(0,_.jsx)("p",{className:"text-xs font-medium text-gray-700 mb-1",children:"No tools available"}),(0,_.jsx)("p",{className:"text-xs text-gray-500",children:"No tools found for this server"})]}),!ei&&!H?.error&&es.length>0&&(0,_.jsx)(_.Fragment,{children:0===eo.length?(0,_.jsxs)("div",{className:"p-4 text-center bg-white border border-gray-200 rounded-lg",children:[(0,_.jsx)(ry.SearchOutlined,{className:"text-2xl text-gray-400 mb-2"}),(0,_.jsx)("p",{className:"text-xs font-medium text-gray-700 mb-1",children:"No tools found"}),(0,_.jsxs)("p",{className:"text-xs text-gray-500",children:['No tools match "',f,'"']})]}):(0,_.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto min-h-0 mcp-tools-scrollable",style:{maxHeight:"400px",scrollbarWidth:"auto",scrollbarColor:"#cbd5e0 #f7fafc"},children:eo.map(e=>(0,_.jsxs)("div",{className:`border rounded-lg p-3 cursor-pointer transition-all hover:shadow-sm ${d?.name===e.name?"border-blue-500 bg-blue-50 ring-1 ring-blue-200":"border-gray-200 bg-white hover:border-gray-300"}`,onClick:()=>{c(e),m(null),h(null)},children:[(0,_.jsxs)("div",{className:"flex items-start space-x-2",children:[e.mcp_info.logo_url&&(0,_.jsx)("img",{src:e.mcp_info.logo_url,alt:`${e.mcp_info.server_name} logo`,className:"w-4 h-4 object-contain flex-shrink-0 mt-0.5"}),(0,_.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,_.jsx)("h4",{className:"font-mono text-xs font-medium text-gray-900 truncate",children:e.name}),(0,_.jsx)("p",{className:"text-xs text-gray-500 truncate",children:e.mcp_info.server_name}),(0,_.jsx)("p",{className:"text-xs text-gray-600 mt-1 line-clamp-2 leading-relaxed",children:e.description})]})]}),d?.name===e.name&&(0,_.jsx)("div",{className:"mt-2 pt-2 border-t border-blue-200",children:(0,_.jsxs)("div",{className:"flex items-center text-xs font-medium text-blue-700",children:[(0,_.jsx)("svg",{className:"w-3 h-3 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:(0,_.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Selected"]})})]},e.name))})})]})]})]})]}),(0,_.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,_.jsx)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:(0,_.jsx)(X.Title,{className:"text-xl font-semibold mb-0",children:"Tool Testing Playground"})}),(0,_.jsx)("div",{className:"flex-1 overflow-auto p-4",children:d?(0,_.jsx)("div",{className:"h-full",children:(0,_.jsx)(OW,{tool:d,onSubmit:e=>{er({tool:d,arguments:e})},result:u,error:p,isLoading:ea,onClose:()=>c(null)})}):(0,_.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,_.jsx)(tV.RobotOutlined,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,_.jsx)(Z.Text,{className:"text-lg font-medium text-gray-600 mb-2",children:"Select a Tool to Test"}),(0,_.jsx)(Z.Text,{className:"text-center text-gray-500 max-w-md",children:"Choose a tool from the left sidebar to start testing its functionality with custom inputs."})]})})]})]})})})},O1=[LK.AUTH_TYPE.API_KEY,LK.AUTH_TYPE.BEARER_TOKEN,LK.AUTH_TYPE.TOKEN,LK.AUTH_TYPE.BASIC],O2=[...O1,LK.AUTH_TYPE.OAUTH2,LK.AUTH_TYPE.AWS_SIGV4],O4="litellm-mcp-oauth-edit-state",O5=({mcpServer:e,accessToken:t,userID:r,onCancel:a,onSuccess:s,availableAccessGroups:n})=>{let[l]=H.Form.useForm(),[i,o]=(0,T.useState)({}),[d,c]=(0,T.useState)([]),[u,m]=(0,T.useState)(!1),[p,h]=(0,T.useState)(null),[f,x]=(0,T.useState)(""),[g,y]=(0,T.useState)(!1),[b,v]=(0,T.useState)([]),[j,w]=(0,T.useState)(!1),[k,N]=(0,T.useState)({}),[M,C]=(0,T.useState)({}),[L,O]=(0,T.useState)(null),[D,P]=(0,T.useState)(e.mcp_info?.logo_url||void 0),A=H.Form.useWatch("auth_type",l),E=H.Form.useWatch("transport",l),I="stdio"===E,Y=E===LK.TRANSPORT.OPENAPI,F=!!A&&O1.includes(A),R=A===LK.AUTH_TYPE.OAUTH2,B=A===LK.AUTH_TYPE.AWS_SIGV4,q=H.Form.useWatch("oauth_flow_type",l),U=R&&q===LK.OAUTH_FLOW.M2M,W=H.Form.useWatch("url",l),V=H.Form.useWatch("spec_path",l),G=H.Form.useWatch("server_name",l),K=H.Form.useWatch("auth_type",l),X=H.Form.useWatch("static_headers",l),Z=H.Form.useWatch("credentials",l),ee=H.Form.useWatch("authorization_url",l),et=H.Form.useWatch("token_url",l),er=H.Form.useWatch("registration_url",l),ea=!!e.mcp_info?.tool_allowlist_enforced||(e.allowed_tools?.length??0)>0,es=ea?e.allowed_tools??[]:null,{startOAuthFlow:en,status:el,error:ei,tokenResponse:eo}=Ox({accessToken:t,getCredentials:()=>l.getFieldValue("credentials"),getTemporaryPayload:()=>{let t=l.getFieldsValue(!0),r=t.url||e.url,a=t.transport||e.transport;if(!r||!a)return null;let s=Array.isArray(t.static_headers)?t.static_headers.reduce((e,t)=>{let r=t?.header?.trim();return r&&(e[r]=(t?.value??"").trim()),e},{}):{};return{server_id:e.server_id,server_name:t.server_name||e.server_name||e.alias,alias:t.alias||e.alias,description:t.description||e.description,url:r,transport:a,auth_type:LK.AUTH_TYPE.OAUTH2,credentials:t.credentials,mcp_access_groups:t.mcp_access_groups||e.mcp_access_groups,static_headers:s,command:t.command,args:t.args,env:t.env}},onTokenReceived:e=>{if(e?.access_token){let t={access_token:e.access_token,...e.refresh_token&&{refresh_token:e.refresh_token},...e.expires_in&&{expires_in:e.expires_in},...e.scope&&{scope:e.scope}};l.setFieldsValue({credentials:t}),J.default.success("OAuth authorization successful! Please click 'Update MCP Server' to save the credentials.")}},onBeforeRedirect:()=>{try{let t=l.getFieldsValue(!0);(0,Of.setSecureItem)(O4,JSON.stringify({serverId:e.server_id,formValues:t,costConfig:i,allowedTools:b,hasToolAllowlistInteraction:j,searchValue:f,aliasManuallyEdited:g}))}catch(e){console.warn("Failed to persist MCP edit state",e)}},flowSource:"edit"}),ed=T.default.useMemo(()=>e.static_headers?Object.entries(e.static_headers).map(([e,t])=>({header:e,value:null!=t?String(t):""})):[],[e.static_headers]),ec=T.default.useMemo(()=>Array.isArray(e.env_vars)?e.env_vars.map(e=>({name:e.name,value:e.value??"",scope:"user"===e.scope?"user":"global",description:e.description??""})):[],[e.env_vars]),eu=T.default.useMemo(()=>{let t=e.env??void 0;if(!t||0===Object.keys(t).length)return"";try{return JSON.stringify(t,null,2)}catch{return""}},[e.env]),em=T.default.useMemo(()=>e.spec_path&&"stdio"!==e.transport?LK.TRANSPORT.OPENAPI:e.transport,[e]),ep=T.default.useMemo(()=>({...e,transport:em,static_headers:ed,env_vars:ec,extra_headers:e.extra_headers||[],oauth_flow_type:e.token_url?LK.OAUTH_FLOW.M2M:LK.OAUTH_FLOW.INTERACTIVE,token_validation_json:e.token_validation?JSON.stringify(e.token_validation,null,2):void 0}),[e,em,ed,ec,eu]),eh=T.default.useRef(null);(0,T.useEffect)(()=>{e.server_id&&eh.current!==e.server_id&&(eh.current=e.server_id,l.setFieldsValue(ep))},[e.server_id,ep,l]),(0,T.useEffect)(()=>{e.mcp_info?.mcp_server_cost_info&&o(e.mcp_info.mcp_server_cost_info)},[e]),(0,T.useEffect)(()=>{w(!1)},[e.server_id]),(0,T.useEffect)(()=>{ea&&v(e.allowed_tools??[]),N(e.tool_name_to_display_name??{}),C(e.tool_name_to_description??{})},[e,ea]),(0,T.useEffect)(()=>{let t=(0,Of.getSecureItem)(O4);if(t)try{let r=JSON.parse(t);if(!r||r.serverId!==e.server_id)return;r.formValues&&O({...e,...r.formValues}),r.costConfig&&o(r.costConfig),r.allowedTools&&v(r.allowedTools),"boolean"==typeof r.hasToolAllowlistInteraction&&w(r.hasToolAllowlistInteraction),r.searchValue&&x(r.searchValue),"boolean"==typeof r.aliasManuallyEdited&&y(r.aliasManuallyEdited)}catch(e){console.error("Failed to restore MCP edit state",e)}finally{window.sessionStorage.removeItem(O4)}},[l,e]),(0,T.useEffect)(()=>{if(!L)return;let t=L.transport||e.transport;t&&t!==l.getFieldValue("transport")?l.setFieldsValue({transport:t}):(l.setFieldsValue(L),O(null))},[L,l,e.transport,E]),(0,T.useEffect)(()=>{if(e.mcp_access_groups){let t=e.mcp_access_groups.map(e=>"string"==typeof e?e:e.name||String(e));l.setFieldValue("mcp_access_groups",t)}},[e]),(0,T.useEffect)(()=>{e.server_id&&""!==e.server_id.trim()&&ef()},[e,t,r,eo?.access_token]);let ef=async()=>{let a;if(t&&e.server_id){if("passthrough"===(0,LK.getMcpOAuthMode)({auth_type:e.auth_type,oauth2_flow:e.oauth2_flow,delegate_auth_to_upstream:e.delegate_auth_to_upstream})){let t=eo?.access_token??((0,LG.isTokenValid)(e.server_id,r)?(0,LG.getToken)(e.server_id,r)?.access_token??null:null);if(!t){c([]),h("Authenticate with this server in the Tools tab to load and configure its tools.");return}a=OG(e.alias,t)}m(!0),h(null);try{let r=await (0,Q.listMCPTools)(t,e.server_id,a,!0);r.tools&&!r.error?c(r.tools):(c([]),h(r.message||"Failed to load tools"))}catch(e){c([]),h(e instanceof Error?e.message:"Failed to load tools")}finally{m(!1)}}},ex=async a=>{if(t)try{let n,l,{static_headers:o,env_vars:d,credentials:c,stdio_config:u,env_json:m,command:p,args:h,allow_all_keys:f,available_on_public_internet:x,delegate_auth_to_upstream:g,oauth_passthrough:y,token_validation_json:_,...v}=a,w=(v.mcp_access_groups||[]).map(e=>"string"==typeof e?e:e.name||String(e)),S=Array.isArray(o)?o.reduce((e,t)=>{let r=t?.header?.trim();return r&&(e[r]=(t?.value??"").trim()),e},{}):{},N=Om(d),T=c&&"object"==typeof c?Object.entries(c).reduce((e,[t,r])=>{if(null==r||""===r)return e;if("scopes"===t){if(Array.isArray(r)){let a=r.filter(e=>null!=e&&""!==e);a.length>0&&(e[t]=a)}}else e[t]=r;return e},{}):void 0,C={};if("stdio"===v.transport)if(u)try{let e=JSON.parse(u),t=e;if(e?.mcpServers&&"object"==typeof e.mcpServers){let r=Object.keys(e.mcpServers);r.length>0&&(t=e.mcpServers[r[0]])}let r=Array.isArray(t?.args)?t.args.map(e=>String(e)).filter(e=>""!==e.trim()):[],a=t?.env&&"object"==typeof t.env&&!Array.isArray(t.env)?Object.entries(t.env).reduce((e,[t,r])=>(null==t||""===String(t).trim()||(e[String(t)]=null==r?"":String(r)),e),{}):{};if(!(C={command:t?.command?String(t.command):void 0,args:r,env:a}).command)return void J.default.fromBackend("Stdio configuration must include a command")}catch{J.default.fromBackend("Invalid JSON in stdio configuration");return}else{let e={};if(m)try{let t=JSON.parse(m);t&&"object"==typeof t&&!Array.isArray(t)&&(e=Object.entries(t).reduce((e,[t,r])=>(null==t||""===String(t).trim()||(e[String(t)]=null==r?"":String(r)),e),{}))}catch{J.default.fromBackend("Invalid JSON in stdio env configuration");return}let t=Array.isArray(h)?h.map(e=>String(e)).filter(e=>""!==e.trim()):[],r=p?String(p).trim():"";if(!r)return void J.default.fromBackend("Stdio transport requires a command");C={command:r,args:t,env:e}}v.transport===LK.TRANSPORT.OPENAPI&&(v.transport="http");let L=null;if(_&&""!==_.trim())try{L=JSON.parse(_)}catch{J.default.fromBackend("Invalid JSON in Token Validation Rules");return}let O=v.server_name||v.url||e.server_name||e.url||v.alias||e.alias||"unknown",P=ea||j||b.length>0,A={...v,...C,stdio_config:void 0,env_json:void 0,server_id:e.server_id,mcp_info:{...e.mcp_info??{},server_name:O,description:v.description,logo_url:D||void 0,mcp_server_cost_info:Object.keys(i).length>0?i:null,tool_allowlist_enforced:P},mcp_access_groups:w,alias:v.alias,extra_headers:v.extra_headers||[],...P?{allowed_tools:b}:{},tool_name_to_display_name:Object.keys(k).length>0?k:null,tool_name_to_description:Object.keys(M).length>0?M:null,disallowed_tools:v.disallowed_tools||[],static_headers:S,env_vars:N,allow_all_keys:!!(f??e.allow_all_keys),available_on_public_internet:!!(x??e.available_on_public_internet),delegate_auth_to_upstream:v.auth_type===LK.AUTH_TYPE.OAUTH2&&!!(g??e.delegate_auth_to_upstream),oauth_passthrough:(n=v.auth_type===LK.AUTH_TYPE.NONE||null==v.auth_type,l=(Array.isArray(v.extra_headers)?v.extra_headers:[]).some(e=>"string"==typeof e&&"authorization"===e.toLowerCase()),!!n&&!!l&&!!(y??e.oauth_passthrough)),...null!==L||e.token_validation?{token_validation:L}:{}};v.auth_type&&O2.includes(v.auth_type)&&T&&Object.keys(T).length>0&&(A.credentials=T);let E=await (0,Q.updateMCPServer)(t,A);if(eo?.access_token){let a=(0,LK.getMcpOAuthMode)({auth_type:v.auth_type,oauth2_flow:U?LK.MCP_OAUTH2_FLOW_M2M:null,delegate_auth_to_upstream:!!(g??e.delegate_auth_to_upstream)});try{if("obo"===a){let r=eo.scope;await (0,Q.storeMCPOAuthUserCredential)(t,e.server_id,{access_token:eo.access_token,refresh_token:eo.refresh_token,expires_in:eo.expires_in,scopes:"string"==typeof r&&r?r.split(" "):void 0})}else"passthrough"===a&&(0,LG.setToken)(e.server_id,{access_token:eo.access_token,expires_in:eo.expires_in,refresh_token:eo.refresh_token,token_type:eo.token_type},r)}catch(t){let e=t instanceof Error?t.message:"";J.default.fromBackend("MCP Server updated, but failed to persist OAuth token"+(e?`: ${e}`:""));return}}J.default.success("MCP Server updated successfully"),s(E)}catch(e){J.default.fromBackend("Failed to update MCP Server"+(e?.message?`: ${e.message}`:""))}};return(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)(rR.TabList,{className:"grid w-full grid-cols-2",children:[(0,_.jsx)(rY.Tab,{children:"Server Configuration"}),(0,_.jsx)(rY.Tab,{children:"Cost Configuration"})]}),(0,_.jsxs)(rz.TabPanels,{className:"mt-6",children:[(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(H.Form,{form:l,onFinish:ex,initialValues:ep,layout:"vertical",children:[(0,_.jsx)(H.Form.Item,{label:"MCP Server Name",name:"server_name",rules:[{validator:(e,t)=>Ou(t)}],children:(0,_.jsx)($.Input,{className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:"Alias",name:"alias",rules:[{validator:(e,t)=>Ou(t)}],children:(0,_.jsx)($.Input,{onChange:()=>y(!0),className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:"Description",name:"description",children:(0,_.jsx)($.Input,{className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(Oa,{value:D,onChange:P}),(0,_.jsx)(H.Form.Item,{label:"Transport Type",name:"transport",rules:[{required:!0}],children:(0,_.jsxs)(eE.Select,{onChange:e=>{"stdio"===e?l.setFieldsValue({url:void 0,spec_path:void 0,auth_type:void 0,credentials:void 0,authorization_url:void 0,token_url:void 0,registration_url:void 0}):e===LK.TRANSPORT.OPENAPI?l.setFieldsValue({url:void 0,command:void 0,args:void 0,env_json:void 0,stdio_config:void 0}):l.setFieldsValue({spec_path:void 0,command:void 0,args:void 0,env_json:void 0,stdio_config:void 0})},children:[(0,_.jsx)(eE.Select.Option,{value:"http",children:"Streamable HTTP (Recommended)"}),(0,_.jsx)(eE.Select.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,_.jsx)(eE.Select.Option,{value:"stdio",children:"Standard Input/Output (stdio)"}),(0,_.jsx)(eE.Select.Option,{value:LK.TRANSPORT.OPENAPI,children:"OpenAPI Spec"})]})}),!I&&!Y&&(0,_.jsx)(H.Form.Item,{label:"MCP Server URL",name:"url",rules:[{required:!0,message:"Please enter a server URL"},{validator:(e,t)=>Oc(t)}],children:(0,_.jsx)($.Input,{placeholder:"https://your-mcp-server.com",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),Y&&(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OpenAPI Spec URL",(0,_.jsx)(tB.Tooltip,{title:"URL to an OpenAPI specification (JSON or YAML). MCP tools will be automatically generated from the API endpoints defined in the spec.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"spec_path",rules:[{required:!0,message:"Please enter an OpenAPI spec URL"}],children:(0,_.jsx)($.Input,{placeholder:"https://petstore3.swagger.io/api/v3/openapi.json",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),!I&&(0,_.jsx)(H.Form.Item,{label:"Authentication",name:"auth_type",rules:[{required:!0}],children:(0,_.jsxs)(eE.Select,{children:[(0,_.jsx)(eE.Select.Option,{value:"none",children:"None"}),(0,_.jsx)(eE.Select.Option,{value:"api_key",children:"API Key"}),(0,_.jsx)(eE.Select.Option,{value:"bearer_token",children:"Bearer Token"}),(0,_.jsx)(eE.Select.Option,{value:"token",children:"Token"}),(0,_.jsx)(eE.Select.Option,{value:"basic",children:"Basic Auth"}),(0,_.jsx)(eE.Select.Option,{value:"oauth2",children:"OAuth"}),(0,_.jsx)(eE.Select.Option,{value:"aws_sigv4",children:"AWS SigV4 (Bedrock AgentCore MCPs)"})]})}),I&&(0,_.jsxs)("div",{className:"rounded-lg border border-gray-200 p-4 space-y-4",children:[(0,_.jsx)("p",{className:"text-sm text-gray-600",children:"Configure the stdio transport used to launch the MCP server process. You can either fill in the fields below or paste a JSON configuration."}),(0,_.jsx)(H.Form.Item,{label:"Command",name:"command",rules:[{required:!0,message:"Please enter a command for stdio transport"}],children:(0,_.jsx)($.Input,{placeholder:"e.g., npx",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:"Args",name:"args",children:(0,_.jsx)(eE.Select,{mode:"tags",size:"large",tokenSeparators:[","],placeholder:"Add args (press enter or comma)",className:"rounded-lg"})}),(0,_.jsx)(H.Form.Item,{label:"Environment (JSON object)",name:"env_json",rules:[{validator:(e,t)=>{if(!t)return Promise.resolve();try{let e=JSON.parse(t);if(e&&"object"==typeof e&&!Array.isArray(e))return Promise.resolve();return Promise.reject(Error("Env must be a JSON object"))}catch{return Promise.reject(Error("Please enter valid JSON"))}}}],children:(0,_.jsx)($.Input.TextArea,{rows:6,className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500 font-mono text-sm",placeholder:`{ "KEY": "value" -}`})}),(0,_.jsx)(L8,{isVisible:!0,required:!1})]}),!E&&Y&&(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Authentication Value",(0,_.jsx)(tB.Tooltip,{title:"Token, password, or header value to send with each request for the selected auth type.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","auth_value"],rules:[{validator:(e,t)=>t&&"string"==typeof t&&""===t.trim()?Promise.reject(Error("Authentication value cannot be empty")):Promise.resolve()}],children:(0,_.jsx)($.Input.Password,{placeholder:"Enter token or secret (leave blank to keep existing)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),!E&&F&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Client ID (optional)",(0,_.jsx)(tB.Tooltip,{title:"Provide only if your MCP server cannot handle dynamic client registration.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","client_id"],children:(0,_.jsx)($.Input.Password,{placeholder:"Enter OAuth client ID (leave blank to keep existing)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Client Secret (optional)",(0,_.jsx)(tB.Tooltip,{title:"Provide only if your MCP server cannot handle dynamic client registration.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","client_secret"],children:(0,_.jsx)($.Input.Password,{placeholder:"Enter OAuth client secret (leave blank to keep existing)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Scopes (optional)",(0,_.jsx)(tB.Tooltip,{title:"Add scopes to override the default scope list used for this MCP server.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","scopes"],children:(0,_.jsx)(eE.Select,{mode:"tags",tokenSeparators:[","],placeholder:"Add scopes",className:"rounded-lg",size:"large"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Authorization URL Override (optional)",(0,_.jsx)(tB.Tooltip,{title:"Optional override for the authorization endpoint.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"authorization_url",children:(0,_.jsx)($.Input,{placeholder:"https://example.com/oauth/authorize",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Token URL Override (optional)",(0,_.jsx)(tB.Tooltip,{title:"Optional override for the token endpoint.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"token_url",children:(0,_.jsx)($.Input,{placeholder:"https://example.com/oauth/token",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Registration URL Override (optional)",(0,_.jsx)(tB.Tooltip,{title:"Optional override for the dynamic client registration endpoint.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"registration_url",children:(0,_.jsx)($.Input,{placeholder:"https://example.com/oauth/register",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),!q&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Token Validation Rules (optional)",(0,_.jsx)(tB.Tooltip,{title:'JSON object of key-value rules checked against the OAuth token response before storing. Supports dot-notation for nested fields (e.g. {"organization": "my-org", "team.id": "123"}). Tokens that fail validation are rejected with HTTP 403.',children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"token_validation_json",rules:[{validator:(e,t)=>{if(!t||""===t.trim())return Promise.resolve();try{return JSON.parse(t),Promise.resolve()}catch{return Promise.reject(Error("Must be valid JSON"))}}}],children:(0,_.jsx)($.Input.TextArea,{placeholder:'{\n "organization": "my-org",\n "team.id": "123"\n}',rows:4,className:"font-mono text-sm rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Token Storage TTL (seconds, optional)",(0,_.jsx)(tB.Tooltip,{title:"How long to cache each user's OAuth access token in Redis before evicting it (regardless of the token's own expires_in). Leave blank to derive the TTL from the token's expires_in, or fall back to the 12-hour default.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"token_storage_ttl_seconds",children:(0,_.jsx)(tq.InputNumber,{min:1,placeholder:"e.g. 3600",style:{width:"100%"},className:"rounded-lg"})})]}),(0,_.jsxs)("div",{className:"rounded-lg border border-dashed border-gray-300 p-4 space-y-2",children:[(0,_.jsx)("p",{className:"text-sm text-gray-600",children:"Use OAuth to fetch a fresh access token and temporarily save it in the session as the authentication value."}),(0,_.jsx)(S.Button,{variant:"secondary",onClick:el,disabled:"authorizing"===ei||"exchanging"===ei,children:"authorizing"===ei?"Waiting for authorization...":"exchanging"===ei?"Exchanging authorization code...":"Authorize & Fetch Token"}),eo&&(0,_.jsx)("p",{className:"text-sm text-red-500",children:eo}),"success"===ei&&ed?.access_token&&(0,_.jsxs)("p",{className:"text-sm text-green-600",children:["Token fetched. Expires in ",ed.expires_in??"?"," seconds."]})]})]}),!E&&R&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("p",{className:"text-sm text-gray-500 mb-2",children:["For MCP servers hosted on AWS Bedrock AgentCore."," ",(0,_.jsx)("a",{href:"https://docs.litellm.ai/docs/mcp_aws_sigv4",target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:text-blue-700",children:"View docs →"})]}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Region",(0,_.jsx)(tB.Tooltip,{title:"AWS region for SigV4 signing (e.g., us-east-1)",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_region_name"],rules:[],children:(0,_.jsx)($.Input,{placeholder:"us-east-1 (leave blank to keep existing)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Service Name",(0,_.jsx)(tB.Tooltip,{title:"AWS service name for SigV4 signing. Defaults to 'bedrock-agentcore'.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_service_name"],children:(0,_.jsx)($.Input,{placeholder:"bedrock-agentcore (leave blank to keep existing)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Access Key ID",(0,_.jsx)(tB.Tooltip,{title:"Optional. If not provided, falls back to the boto3 credential chain (IAM role, env vars, etc.).",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_access_key_id"],rules:[],children:(0,_.jsx)($.Input.Password,{placeholder:"Leave blank to keep existing",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Secret Access Key",(0,_.jsx)(tB.Tooltip,{title:"Optional. Required if AWS Access Key ID is provided.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_secret_access_key"],rules:[],children:(0,_.jsx)($.Input.Password,{placeholder:"Leave blank to keep existing",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Session Token",(0,_.jsx)(tB.Tooltip,{title:"Optional. Only needed for temporary STS credentials.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_session_token"],children:(0,_.jsx)($.Input.Password,{placeholder:"Leave blank to keep existing",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Role ARN",(0,_.jsx)(tB.Tooltip,{title:"Optional. IAM role ARN to assume via STS before signing. If set, LiteLLM calls sts:AssumeRole to get temporary credentials.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_role_name"],children:(0,_.jsx)($.Input,{placeholder:"Leave blank to keep existing",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Session Name",(0,_.jsx)(tB.Tooltip,{title:"Optional. Session name for the AssumeRole call — appears in CloudTrail logs. Auto-generated if omitted.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_session_name"],children:(0,_.jsx)($.Input,{placeholder:"Leave blank to keep existing",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})})]}),(0,_.jsx)("div",{className:"mt-6",children:(0,_.jsx)(Oo,{})}),(0,_.jsx)("div",{className:"mt-6",children:(0,_.jsx)(L9,{availableAccessGroups:s,mcpServer:e,searchValue:h,setSearchValue:f,getAccessGroupOptions:()=>{let e=s.map(e=>({value:e,label:(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,_.jsx)("span",{className:"font-medium",children:e})]})}));return h&&!s.some(e=>e.toLowerCase().includes(h.toLowerCase()))&&e.push({value:h,label:(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,_.jsx)("span",{className:"font-medium",children:h}),(0,_.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e}})}),(0,_.jsx)("div",{className:"mt-6",children:(0,_.jsx)(L3,{accessToken:t,oauthAccessToken:U,formValues:{server_id:e.server_id,server_name:K??e.server_name,url:V??e.url,spec_path:G??e.spec_path,transport:A??e.transport,auth_type:X??e.auth_type,mcp_info:e.mcp_info,oauth_flow_type:er??e.token_url?LK.OAUTH_FLOW.M2M:LK.OAUTH_FLOW.INTERACTIVE,static_headers:Z??e.static_headers,credentials:ee,authorization_url:et??e.authorization_url,token_url:er??e.token_url,registration_url:ea??e.registration_url},allowedTools:y,existingAllowedTools:en,hasToolAllowlistInteraction:v,isEditMode:!0,onAllowedToolsChange:b,onToolAllowlistInteraction:()=>j(!0),toolNameToDisplayName:w,toolNameToDescription:N,onToolNameToDisplayNameChange:k,onToolNameToDescriptionChange:M})}),(0,_.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,_.jsx)(z.Button,{onClick:r,children:"Cancel"}),(0,_.jsx)(S.Button,{type:"submit",children:"Save Changes"})]})]})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsx)(L1,{value:l,onChange:i,tools:o,disabled:c}),(0,_.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,_.jsx)(z.Button,{onClick:r,children:"Cancel"}),(0,_.jsx)(S.Button,{onClick:()=>n.submit(),children:"Save Changes"})]})]})})]})]})},O5=({costConfig:e})=>{let t=e?.default_cost_per_query!==void 0&&e?.default_cost_per_query!==null,r=e?.tool_name_to_cost_per_query&&Object.keys(e.tool_name_to_cost_per_query).length>0;return t||r?(0,_.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,_.jsxs)("div",{className:"space-y-4",children:[t&&e?.default_cost_per_query!==void 0&&e?.default_cost_per_query!==null&&(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Default Cost per Query"}),(0,_.jsxs)("div",{className:"text-green-600 font-mono",children:["$",e.default_cost_per_query.toFixed(4)]})]}),r&&e?.tool_name_to_cost_per_query&&(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Tool-Specific Costs"}),(0,_.jsx)("div",{className:"mt-2 space-y-2",children:Object.entries(e.tool_name_to_cost_per_query).map(([e,t])=>null!=t&&(0,_.jsxs)("div",{className:"flex justify-between items-center p-3 bg-gray-50 rounded-lg",children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:e}),(0,_.jsxs)(Z.Text,{className:"text-green-600 font-mono",children:["$",t.toFixed(4)," per query"]})]},e))})]}),(0,_.jsxs)("div",{className:"mt-4 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,_.jsx)(Z.Text,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,_.jsxs)("div",{className:"mt-2 space-y-1",children:[t&&e?.default_cost_per_query!==void 0&&e?.default_cost_per_query!==null&&(0,_.jsxs)(Z.Text,{className:"text-blue-700",children:["• Default cost: $",e.default_cost_per_query.toFixed(4)," per query"]}),r&&e?.tool_name_to_cost_per_query&&(0,_.jsxs)(Z.Text,{className:"text-blue-700",children:["• ",Object.keys(e.tool_name_to_cost_per_query).length," tool(s) with custom pricing"]})]})]})]})}):(0,_.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,_.jsx)("div",{className:"space-y-4",children:(0,_.jsx)("div",{className:"p-4 bg-gray-50 border border-gray-200 rounded-lg",children:(0,_.jsx)(Z.Text,{className:"text-gray-600",children:"No cost configuration set for this server. Tool calls will be charged at $0.00 per tool call."})})})})},O6=({mcpServer:e,onBack:t,isEditing:r,isProxyAdmin:a,accessToken:s,userRole:n,userID:l,availableAccessGroups:i})=>{let[o,d]=(0,T.useState)(r),[c,u]=(0,T.useState)(!1),[m,p]=(0,T.useState)({}),[h,f]=(0,T.useState)(0),x=e.url??"",{maskedUrl:g,hasToken:y}=x?Oc(x):{maskedUrl:"—",hasToken:!1},b=(e,t)=>e?y?t?e:g:e:"—",v=async(e,t)=>{await (0,rV.copyToClipboard)(e)&&(p(e=>({...e,[t]:!0})),setTimeout(()=>{p(e=>({...e,[t]:!1}))},2e3))},j=e=>{let t=e.toUpperCase();return(0,_.jsx)("span",{className:"inline-flex items-center text-sm font-medium px-2.5 py-0.5 rounded border bg-gray-50 text-gray-700 border-gray-200",children:t})},w=e=>(0,_.jsx)("span",{className:"inline-flex items-center text-sm font-medium px-2.5 py-0.5 rounded border bg-gray-50 text-gray-700 border-gray-200",children:e});return(0,_.jsxs)("div",{className:"p-4 max-w-full",children:[(0,_.jsxs)("div",{className:"mb-6",children:[(0,_.jsx)(S.Button,{icon:rH.ArrowLeftIcon,variant:"light",className:"mb-4",onClick:t,children:"Back to All Servers"}),(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(X.Title,{className:"text-2xl",children:e.server_name||e.alias||"Unnamed Server"}),(0,_.jsx)(z.Button,{type:"text",size:"small",icon:m["mcp-server_name"]?(0,_.jsx)(M_.CheckIcon,{size:12}):(0,_.jsx)(Mb.CopyIcon,{size:12}),onClick:()=>v(e.server_name||e.alias,"mcp-server_name"),className:`transition-all duration-200 ${m["mcp-server_name"]?"text-green-600 bg-green-50 border-green-200":"text-gray-400 hover:text-gray-600 hover:bg-gray-100"}`}),e.alias&&e.server_name&&e.alias!==e.server_name&&(0,_.jsx)("span",{className:"ml-2 inline-flex items-center text-xs font-medium px-2 py-0.5 rounded bg-gray-100 text-gray-600 border border-gray-200 font-mono",children:e.alias})]}),(0,_.jsxs)("div",{className:"flex items-center gap-1.5 mt-1",children:[(0,_.jsx)(Z.Text,{className:"text-gray-400 font-mono text-xs",children:e.server_id}),(0,_.jsx)(z.Button,{type:"text",size:"small",icon:m["mcp-server-id"]?(0,_.jsx)(M_.CheckIcon,{size:10}):(0,_.jsx)(Mb.CopyIcon,{size:10}),onClick:()=>v(e.server_id,"mcp-server-id"),className:`transition-all duration-200 ${m["mcp-server-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-300 hover:text-gray-500 hover:bg-gray-50"}`})]}),e.description&&(0,_.jsx)(Z.Text,{className:"text-gray-500 mt-2",children:e.description})]}),(0,_.jsxs)(rF.TabGroup,{index:h,onIndexChange:f,children:[(0,_.jsx)(rR.TabList,{className:"mb-4",children:[(0,_.jsx)(rY.Tab,{children:"Overview"},"overview"),(0,_.jsx)(rY.Tab,{children:"MCP Tools"},"tools"),...a?[(0,_.jsx)(rY.Tab,{children:"Settings"},"settings")]:[]]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsxs)(ee.Grid,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-4",children:[(0,_.jsxs)(P.Card,{className:"p-4",children:[(0,_.jsx)(Z.Text,{className:"text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Transport"}),(0,_.jsx)("div",{className:"mt-3",children:j((0,LK.handleTransport)(e.transport??void 0,e.spec_path??void 0))})]}),(0,_.jsxs)(P.Card,{className:"p-4",children:[(0,_.jsx)(Z.Text,{className:"text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Authentication"}),(0,_.jsx)("div",{className:"mt-3",children:w((0,LK.handleAuth)(e.auth_type??void 0))})]}),(0,_.jsxs)(P.Card,{className:"p-4",children:[(0,_.jsx)(Z.Text,{className:"text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Host URL"}),(0,_.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,_.jsx)(Z.Text,{className:"break-all overflow-wrap-anywhere font-mono text-sm",children:b(e.url,c)}),y&&a&&(0,_.jsx)("button",{onClick:()=>u(!c),className:"p-1 hover:bg-gray-100 rounded flex-shrink-0",children:(0,_.jsx)(yi.Icon,{icon:c?O$:Lr,size:"sm",className:"text-gray-500"})})]})]})]}),(0,_.jsxs)(P.Card,{className:"mt-4 p-4",children:[(0,_.jsx)(Z.Text,{className:"text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Cost Configuration"}),(0,_.jsx)("div",{className:"mt-3",children:(0,_.jsx)(O5,{costConfig:e.mcp_info?.mcp_server_cost_info})})]})]}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(OZ,{serverId:e.server_id,accessToken:s,auth_type:e.auth_type,oauth2_flow:e.oauth2_flow,delegate_auth_to_upstream:e.delegate_auth_to_upstream,tokenUrl:e.token_url,userRole:n,userID:l,serverAlias:e.alias,extraHeaders:e.extra_headers})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,_.jsx)(X.Title,{children:"MCP Server Settings"}),o?null:(0,_.jsx)(S.Button,{variant:"light",onClick:()=>d(!0),children:"Edit Settings"})]}),o?(0,_.jsx)(O4,{mcpServer:e,accessToken:s,onCancel:()=>d(!1),onSuccess:e=>{d(!1),t()},availableAccessGroups:i}):(0,_.jsxs)("div",{className:"divide-y divide-gray-100",children:[(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Server Name"}),(0,_.jsx)("div",{className:"col-span-2 text-sm text-gray-900",children:e.server_name||(0,_.jsx)("span",{className:"text-gray-400",children:"—"})})]}),(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Alias"}),(0,_.jsx)("div",{className:"col-span-2 text-sm font-mono text-gray-900",children:e.alias||(0,_.jsx)("span",{className:"text-gray-400",children:"—"})})]}),(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Description"}),(0,_.jsx)("div",{className:"col-span-2 text-sm text-gray-900",children:e.description||(0,_.jsx)("span",{className:"text-gray-400",children:"—"})})]}),(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"URL"}),(0,_.jsxs)("div",{className:"col-span-2 text-sm font-mono text-gray-900 break-all flex items-center gap-2",children:[b(e.url,c),y&&(0,_.jsx)("button",{onClick:()=>u(!c),className:"p-1 hover:bg-gray-100 rounded flex-shrink-0",children:(0,_.jsx)(yi.Icon,{icon:c?O$:Lr,size:"sm",className:"text-gray-500"})})]})]}),(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Transport"}),(0,_.jsx)("div",{className:"col-span-2",children:j((0,LK.handleTransport)(e.transport,e.spec_path))})]}),(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Authentication"}),(0,_.jsx)("div",{className:"col-span-2",children:w((0,LK.handleAuth)(e.auth_type))})]}),(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Extra Headers"}),(0,_.jsx)("div",{className:"col-span-2 text-sm text-gray-900",children:e.extra_headers&&e.extra_headers.length>0?e.extra_headers.join(", "):(0,_.jsx)("span",{className:"text-gray-400",children:"—"})})]}),(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Allow All Keys"}),(0,_.jsx)("div",{className:"col-span-2",children:e.allow_all_keys?(0,_.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-green-50 text-green-700 rounded-full border border-green-200 text-xs font-medium",children:[(0,_.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-green-500"}),"Enabled"]}):(0,_.jsx)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-gray-50 text-gray-600 rounded-full border border-gray-200 text-xs font-medium",children:"Disabled"})})]}),(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Network Access"}),(0,_.jsx)("div",{className:"col-span-2",children:e.available_on_public_internet?(0,_.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-green-50 text-green-700 rounded-full border border-green-200 text-xs font-medium",children:[(0,_.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-green-500"}),"Public"]}):(0,_.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-orange-50 text-orange-700 rounded-full border border-orange-200 text-xs font-medium",children:[(0,_.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-orange-500"}),"Internal only"]})})]}),"oauth2"===(0,LK.handleAuth)(e.auth_type)&&(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Delegate Auth to Upstream"}),(0,_.jsx)("div",{className:"col-span-2",children:e.delegate_auth_to_upstream?(0,_.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-green-50 text-green-700 rounded-full border border-green-200 text-xs font-medium",children:[(0,_.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-green-500"}),"Enabled (PKCE passthrough)"]}):(0,_.jsx)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-gray-50 text-gray-600 rounded-full border border-gray-200 text-xs font-medium",children:"Disabled"})})]}),"oauth2"!==(0,LK.handleAuth)(e.auth_type)&&Array.isArray(e.extra_headers)&&e.extra_headers.some(e=>"string"==typeof e&&"authorization"===e.toLowerCase())&&(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"OAuth Pass-through"}),(0,_.jsx)("div",{className:"col-span-2",children:e.oauth_passthrough?(0,_.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-green-50 text-green-700 rounded-full border border-green-200 text-xs font-medium",children:[(0,_.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-green-500"}),"Enabled"]}):(0,_.jsx)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-gray-50 text-gray-600 rounded-full border border-gray-200 text-xs font-medium",children:"Disabled"})})]}),(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Access Groups"}),(0,_.jsx)("div",{className:"col-span-2",children:e.mcp_access_groups&&e.mcp_access_groups.length>0?(0,_.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.mcp_access_groups.map((e,t)=>(0,_.jsx)("span",{className:"inline-flex items-center text-xs font-medium px-2 py-0.5 rounded bg-gray-100 text-gray-700 border border-gray-200",children:"string"==typeof e?e:e?.name??""},t))}):(0,_.jsx)("span",{className:"text-sm text-gray-400",children:"—"})})]}),(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Allowed Tools"}),(0,_.jsx)("div",{className:"col-span-2",children:e.allowed_tools&&e.allowed_tools.length>0?(0,_.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.allowed_tools.map((e,t)=>(0,_.jsx)("span",{className:"inline-flex items-center text-xs font-mono font-medium px-2 py-0.5 rounded bg-blue-50 text-blue-700 border border-blue-200",children:e},t))}):(0,_.jsx)("span",{className:"inline-flex items-center text-xs font-medium px-2 py-0.5 rounded bg-green-50 text-green-700 border border-green-200",children:"All tools enabled"})})]}),(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Cost"}),(0,_.jsx)("div",{className:"col-span-2",children:(0,_.jsx)(O5,{costConfig:e.mcp_info?.mcp_server_cost_info})})]})]})]})})]})]})]})},O3=(0,ej.createQueryKeys)("mcpSemanticFilterSettings"),O8=(0,ej.createQueryKeys)("mcpSemanticFilterSettings");var O7=e.i(992619);function O9({accessToken:e,testQuery:t,setTestQuery:r,testModel:a,setTestModel:s,isTesting:n,onTest:l,filterEnabled:i,testResult:o,curlCommand:d}){return(0,_.jsx)(eg.Card,{title:"Test Configuration",style:{marginBottom:16},children:(0,_.jsx)(W.Tabs,{defaultActiveKey:"test",items:[{key:"test",label:"Test",children:(0,_.jsxs)(U.Space,{direction:"vertical",style:{width:"100%"},size:"large",children:[(0,_.jsxs)("div",{children:[(0,_.jsxs)(V.Typography.Text,{strong:!0,style:{display:"block",marginBottom:8},children:[(0,_.jsx)(kh.PlayCircleOutlined,{})," Test Query"]}),(0,_.jsx)($.Input.TextArea,{placeholder:"Enter a test query to see which tools would be selected...",value:t,onChange:e=>r(e.target.value),rows:4,disabled:n})]}),(0,_.jsx)("div",{children:(0,_.jsx)(O7.default,{accessToken:e||"",value:a,onChange:s,disabled:n,showLabel:!0,labelText:"Select Model"})}),(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(kh.PlayCircleOutlined,{}),onClick:l,loading:n,disabled:!t||!a||!i,block:!0,children:"Test Filter"}),!i&&(0,_.jsx)(B.Alert,{type:"warning",message:"Semantic filtering is disabled",description:"Enable semantic filtering and save settings to test the filter.",showIcon:!0}),o&&(0,_.jsxs)("div",{children:[(0,_.jsx)(V.Typography.Title,{level:5,children:"Results"}),(0,_.jsx)(B.Alert,{type:"success",message:`${o.selectedTools} tools selected`,description:`Filtered from ${o.totalTools} available tools`,showIcon:!0,style:{marginBottom:16}}),(0,_.jsxs)("div",{children:[(0,_.jsx)(V.Typography.Text,{strong:!0,style:{display:"block",marginBottom:8},children:"Selected Tools:"}),(0,_.jsx)("ul",{style:{paddingLeft:20,margin:0},children:o.tools.map((e,t)=>(0,_.jsx)("li",{style:{marginBottom:4},children:(0,_.jsx)(V.Typography.Text,{children:e})},t))})]})]})]})},{key:"api",label:"API Usage",children:(0,_.jsxs)("div",{children:[(0,_.jsxs)(U.Space,{style:{marginBottom:8},children:[(0,_.jsx)(wZ.CodeOutlined,{}),(0,_.jsx)(V.Typography.Text,{strong:!0,children:"API Usage"})]}),(0,_.jsx)(V.Typography.Text,{type:"secondary",style:{display:"block",marginBottom:8},children:"Use this curl command to test the semantic filter with your current configuration."}),(0,_.jsx)(V.Typography.Text,{strong:!0,style:{display:"block",marginBottom:8},children:"Response headers to check:"}),(0,_.jsxs)("ul",{style:{paddingLeft:20,margin:"0 0 12px 0"},children:[(0,_.jsxs)("li",{children:[(0,_.jsx)(V.Typography.Text,{children:"x-litellm-semantic-filter: shows total tools → selected tools"}),(0,_.jsx)(V.Typography.Text,{type:"secondary",style:{display:"block"},children:"Example: 10→3"})]}),(0,_.jsxs)("li",{children:[(0,_.jsx)(V.Typography.Text,{children:"x-litellm-semantic-filter-tools: CSV of selected tool names"}),(0,_.jsx)(V.Typography.Text,{type:"secondary",style:{display:"block"},children:"Example: wikipedia-fetch,github-search,slack-post"})]})]}),(0,_.jsx)("pre",{style:{background:"#f5f5f5",padding:12,borderRadius:4,overflow:"auto",fontSize:12,margin:0},children:d})]})}]})})}let De=async({accessToken:e,testModel:t,testQuery:r,setIsTesting:a,setTestResult:s})=>{if(!r||!t||!e)return void J.default.error("Please enter a query and select a model");a(!0),s(null);try{let{headers:a}=await (0,Q.testMCPSemanticFilter)(e,t,r),n=(e=>{if(!e.filter)return null;let[t,r]=e.filter.split("->").map(Number);return{totalTools:t,selectedTools:r,tools:e.tools?e.tools.split(",").map(e=>e.trim()):[]}})(a);if(!n)return void J.default.warning("Semantic filter is not enabled or no tools were filtered");s(n),J.default.success("Semantic filter test completed successfully")}catch(e){console.error("Test failed:",e),J.default.error("Failed to test semantic filter")}finally{a(!1)}};function Dt({accessToken:e}){var t;let r,{data:a,isLoading:s,isError:n,error:l}=(()=>{let{accessToken:e}=(0,k.default)();return(0,ev.useQuery)({queryKey:O3.list({}),queryFn:async()=>await (0,Q.getMCPSemanticFilterSettings)(e),enabled:!!e,staleTime:36e5,gcTime:36e5})})(),{mutate:i,isPending:o,error:d}=(t=e||"",r=(0,eh.useQueryClient)(),(0,ep.useMutation)({mutationFn:async e=>{if(!t)throw Error("Access token is required");return(0,Q.updateMCPSemanticFilterSettings)(t,e)},onSuccess:()=>{r.invalidateQueries({queryKey:O8.all})}})),[c]=H.Form.useForm(),[u,m]=(0,T.useState)(!1),[p,h]=(0,T.useState)(!1),[f,x]=(0,T.useState)([]),[g,y]=(0,T.useState)(!0),[b,v]=(0,T.useState)(""),[j,w]=(0,T.useState)("gpt-4o"),[S,N]=(0,T.useState)(null),[M,C]=(0,T.useState)(!1),L=a?.field_schema,O=a?.values??{};(0,T.useEffect)(()=>{(async()=>{if(e)try{y(!0);let t=(await (0,jh.fetchAvailableModels)(e)).filter(e=>"embedding"===e.mode);x(t)}catch(e){console.error("Error fetching embedding models:",e)}finally{y(!1)}})()},[e]),(0,T.useEffect)(()=>{O&&(c.setFieldsValue({enabled:O.enabled??!1,embedding_model:O.embedding_model??"text-embedding-3-small",top_k:O.top_k??10,similarity_threshold:O.similarity_threshold??.3}),h(!1))},[O,c]);let D=async()=>{try{let e=await c.validateFields();i(e,{onSuccess:()=>{h(!1),m(!0),setTimeout(()=>m(!1),3e3),J.default.success("Settings updated successfully. Changes will be applied across all pods within 10 seconds.")},onError:e=>{J.default.fromBackend(e)}})}catch(e){console.error("Form validation failed:",e)}},P=async()=>{e&&await De({accessToken:e,testModel:j,testQuery:b,setIsTesting:C,setTestResult:N})};return e?(0,_.jsx)("div",{style:{width:"100%"},children:s?(0,_.jsx)(ey.Skeleton,{active:!0}):n?(0,_.jsx)(B.Alert,{type:"error",message:"Could not load MCP Semantic Filter settings",description:l instanceof Error?l.message:void 0,style:{marginBottom:24}}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(B.Alert,{type:"info",message:"Semantic Tool Filtering",description:"Filter MCP tools semantically based on query relevance. This reduces context window size and improves tool selection accuracy. Click 'Save Settings' to apply changes across all pods (takes effect within 10 seconds).",showIcon:!0,style:{marginBottom:24}}),u&&(0,_.jsx)(B.Alert,{type:"success",message:"Settings saved successfully",icon:(0,_.jsx)(tz.CheckCircleOutlined,{}),showIcon:!0,closable:!0,style:{marginBottom:16}}),d&&(0,_.jsx)(B.Alert,{type:"error",message:"Could not update settings",description:d instanceof Error?d.message:void 0,style:{marginBottom:16}}),(0,_.jsxs)(wl.Row,{gutter:24,children:[(0,_.jsx)(wi.Col,{xs:24,lg:12,children:(0,_.jsxs)(H.Form,{form:c,layout:"vertical",disabled:o,onValuesChange:()=>{h(!0)},children:[(0,_.jsxs)(eg.Card,{style:{marginBottom:16},children:[(0,_.jsx)(H.Form.Item,{name:"enabled",label:(0,_.jsxs)(U.Space,{children:[(0,_.jsx)(V.Typography.Text,{strong:!0,children:"Enable Semantic Filtering"}),(0,_.jsx)(tB.Tooltip,{title:"When enabled, only the most relevant MCP tools will be included in requests based on semantic similarity",children:(0,_.jsx)(T1.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),valuePropName:"checked",children:(0,_.jsx)(e_.Switch,{disabled:o})}),(0,_.jsx)(V.Typography.Text,{type:"secondary",style:{display:"block",marginTop:-16,marginBottom:16},children:L?.properties?.enabled?.description})]}),(0,_.jsxs)(eg.Card,{title:"Configuration",style:{marginBottom:16},children:[(0,_.jsx)(H.Form.Item,{name:"embedding_model",label:(0,_.jsxs)(U.Space,{children:[(0,_.jsx)(V.Typography.Text,{strong:!0,children:"Embedding Model"}),(0,_.jsx)(tB.Tooltip,{title:"The model used to generate embeddings for semantic matching",children:(0,_.jsx)(T1.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),children:(0,_.jsx)(eE.Select,{options:f.map(e=>({label:e.model_group,value:e.model_group})),placeholder:g?"Loading models...":"Select embedding model",showSearch:!0,disabled:o||g,loading:g,notFoundContent:g?"Loading...":"No embedding models available"})}),(0,_.jsx)(H.Form.Item,{name:"top_k",label:(0,_.jsxs)(U.Space,{children:[(0,_.jsx)(V.Typography.Text,{strong:!0,children:"Top K Results"}),(0,_.jsx)(tB.Tooltip,{title:"Maximum number of tools to return after filtering",children:(0,_.jsx)(T1.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),children:(0,_.jsx)(tq.InputNumber,{min:1,max:100,style:{width:"100%"},disabled:o})}),(0,_.jsx)(H.Form.Item,{name:"similarity_threshold",label:(0,_.jsxs)(U.Space,{children:[(0,_.jsx)(V.Typography.Text,{strong:!0,children:"Similarity Threshold"}),(0,_.jsx)(tB.Tooltip,{title:"Minimum similarity score (0-1) for a tool to be included",children:(0,_.jsx)(T1.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),children:(0,_.jsx)(TZ.Slider,{min:0,max:1,step:.05,marks:{0:"0.0",.3:"0.3",.5:"0.5",.7:"0.7",1:"1.0"},disabled:o})})]}),(0,_.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8},children:(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(MC.SaveOutlined,{}),onClick:D,loading:o,disabled:!p,children:"Save Settings"})})]})}),(0,_.jsx)(wi.Col,{xs:24,lg:12,children:(0,_.jsx)(O9,{accessToken:e,testQuery:b,setTestQuery:v,testModel:j,setTestModel:w,isTesting:M,onTest:P,filterEnabled:!!O.enabled,testResult:S,curlCommand:`curl --location 'http://localhost:4000/v1/responses' \\ +}`})}),(0,_.jsx)(L3,{isVisible:!0,required:!1})]}),!I&&F&&(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Authentication Value",(0,_.jsx)(tB.Tooltip,{title:"Token, password, or header value to send with each request for the selected auth type.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","auth_value"],rules:[{validator:(e,t)=>t&&"string"==typeof t&&""===t.trim()?Promise.reject(Error("Authentication value cannot be empty")):Promise.resolve()}],children:(0,_.jsx)($.Input.Password,{placeholder:"Enter token or secret (leave blank to keep existing)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),!I&&R&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Client ID (optional)",(0,_.jsx)(tB.Tooltip,{title:"Provide only if your MCP server cannot handle dynamic client registration.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","client_id"],children:(0,_.jsx)($.Input.Password,{placeholder:"Enter OAuth client ID (leave blank to keep existing)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Client Secret (optional)",(0,_.jsx)(tB.Tooltip,{title:"Provide only if your MCP server cannot handle dynamic client registration.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","client_secret"],children:(0,_.jsx)($.Input.Password,{placeholder:"Enter OAuth client secret (leave blank to keep existing)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Scopes (optional)",(0,_.jsx)(tB.Tooltip,{title:"Add scopes to override the default scope list used for this MCP server.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","scopes"],children:(0,_.jsx)(eE.Select,{mode:"tags",tokenSeparators:[","],placeholder:"Add scopes",className:"rounded-lg",size:"large"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Authorization URL Override (optional)",(0,_.jsx)(tB.Tooltip,{title:"Optional override for the authorization endpoint.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"authorization_url",children:(0,_.jsx)($.Input,{placeholder:"https://example.com/oauth/authorize",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Token URL Override (optional)",(0,_.jsx)(tB.Tooltip,{title:"Optional override for the token endpoint.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"token_url",children:(0,_.jsx)($.Input,{placeholder:"https://example.com/oauth/token",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Registration URL Override (optional)",(0,_.jsx)(tB.Tooltip,{title:"Optional override for the dynamic client registration endpoint.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"registration_url",children:(0,_.jsx)($.Input,{placeholder:"https://example.com/oauth/register",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),!U&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Token Validation Rules (optional)",(0,_.jsx)(tB.Tooltip,{title:'JSON object of key-value rules checked against the OAuth token response before storing. Supports dot-notation for nested fields (e.g. {"organization": "my-org", "team.id": "123"}). Tokens that fail validation are rejected with HTTP 403.',children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"token_validation_json",rules:[{validator:(e,t)=>{if(!t||""===t.trim())return Promise.resolve();try{return JSON.parse(t),Promise.resolve()}catch{return Promise.reject(Error("Must be valid JSON"))}}}],children:(0,_.jsx)($.Input.TextArea,{placeholder:'{\n "organization": "my-org",\n "team.id": "123"\n}',rows:4,className:"font-mono text-sm rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Token Storage TTL (seconds, optional)",(0,_.jsx)(tB.Tooltip,{title:"How long to cache each user's OAuth access token in Redis before evicting it (regardless of the token's own expires_in). Leave blank to derive the TTL from the token's expires_in, or fall back to the 12-hour default.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"token_storage_ttl_seconds",children:(0,_.jsx)(tq.InputNumber,{min:1,placeholder:"e.g. 3600",style:{width:"100%"},className:"rounded-lg"})})]}),(0,_.jsxs)("div",{className:"rounded-lg border border-dashed border-gray-300 p-4 space-y-2",children:[(0,_.jsx)("p",{className:"text-sm text-gray-600",children:"Use OAuth to fetch a fresh access token and temporarily save it in the session as the authentication value."}),(0,_.jsx)(S.Button,{variant:"secondary",onClick:en,disabled:"authorizing"===el||"exchanging"===el,children:"authorizing"===el?"Waiting for authorization...":"exchanging"===el?"Exchanging authorization code...":"Authorize & Fetch Token"}),ei&&(0,_.jsx)("p",{className:"text-sm text-red-500",children:ei}),"success"===el&&eo?.access_token&&(0,_.jsxs)("p",{className:"text-sm text-green-600",children:["Token fetched. Expires in ",eo.expires_in??"?"," seconds."]})]})]}),!I&&B&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("p",{className:"text-sm text-gray-500 mb-2",children:["For MCP servers hosted on AWS Bedrock AgentCore."," ",(0,_.jsx)("a",{href:"https://docs.litellm.ai/docs/mcp_aws_sigv4",target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:text-blue-700",children:"View docs →"})]}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Region",(0,_.jsx)(tB.Tooltip,{title:"AWS region for SigV4 signing (e.g., us-east-1)",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_region_name"],rules:[],children:(0,_.jsx)($.Input,{placeholder:"us-east-1 (leave blank to keep existing)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Service Name",(0,_.jsx)(tB.Tooltip,{title:"AWS service name for SigV4 signing. Defaults to 'bedrock-agentcore'.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_service_name"],children:(0,_.jsx)($.Input,{placeholder:"bedrock-agentcore (leave blank to keep existing)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Access Key ID",(0,_.jsx)(tB.Tooltip,{title:"Optional. If not provided, falls back to the boto3 credential chain (IAM role, env vars, etc.).",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_access_key_id"],rules:[],children:(0,_.jsx)($.Input.Password,{placeholder:"Leave blank to keep existing",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Secret Access Key",(0,_.jsx)(tB.Tooltip,{title:"Optional. Required if AWS Access Key ID is provided.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_secret_access_key"],rules:[],children:(0,_.jsx)($.Input.Password,{placeholder:"Leave blank to keep existing",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Session Token",(0,_.jsx)(tB.Tooltip,{title:"Optional. Only needed for temporary STS credentials.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_session_token"],children:(0,_.jsx)($.Input.Password,{placeholder:"Leave blank to keep existing",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Role ARN",(0,_.jsx)(tB.Tooltip,{title:"Optional. IAM role ARN to assume via STS before signing. If set, LiteLLM calls sts:AssumeRole to get temporary credentials.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_role_name"],children:(0,_.jsx)($.Input,{placeholder:"Leave blank to keep existing",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["AWS Session Name",(0,_.jsx)(tB.Tooltip,{title:"Optional. Session name for the AssumeRole call — appears in CloudTrail logs. Auto-generated if omitted.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","aws_session_name"],children:(0,_.jsx)($.Input,{placeholder:"Leave blank to keep existing",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})})]}),(0,_.jsx)("div",{className:"mt-6",children:(0,_.jsx)(Oi,{})}),(0,_.jsx)("div",{className:"mt-6",children:(0,_.jsx)(L7,{availableAccessGroups:n,mcpServer:e,searchValue:f,setSearchValue:x,getAccessGroupOptions:()=>{let e=n.map(e=>({value:e,label:(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,_.jsx)("span",{className:"font-medium",children:e})]})}));return f&&!n.some(e=>e.toLowerCase().includes(f.toLowerCase()))&&e.push({value:f,label:(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,_.jsx)("span",{className:"font-medium",children:f}),(0,_.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e}})}),(0,_.jsx)("div",{className:"mt-6",children:(0,_.jsx)(L6,{accessToken:t,formValues:{server_id:e.server_id,server_name:G??e.server_name,url:W??e.url,spec_path:V??e.spec_path,transport:E??e.transport,auth_type:K??e.auth_type,mcp_info:e.mcp_info,oauth_flow_type:et??e.token_url?LK.OAUTH_FLOW.M2M:LK.OAUTH_FLOW.INTERACTIVE,static_headers:X??e.static_headers,credentials:Z,authorization_url:ee??e.authorization_url,token_url:et??e.token_url,registration_url:er??e.registration_url},allowedTools:b,existingAllowedTools:es,hasToolAllowlistInteraction:j,isEditMode:!0,onAllowedToolsChange:v,onToolAllowlistInteraction:()=>w(!0),toolNameToDisplayName:k,toolNameToDescription:M,onToolNameToDisplayNameChange:N,onToolNameToDescriptionChange:C,externalTools:d,externalIsLoading:u,externalError:p,externalCanFetch:!0})}),(0,_.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,_.jsx)(z.Button,{onClick:a,children:"Cancel"}),(0,_.jsx)(S.Button,{type:"submit",children:"Save Changes"})]})]})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsx)(L1,{value:i,onChange:o,tools:d,disabled:u}),(0,_.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,_.jsx)(z.Button,{onClick:a,children:"Cancel"}),(0,_.jsx)(S.Button,{onClick:()=>l.submit(),children:"Save Changes"})]})]})})]})]})},O6=({costConfig:e})=>{let t=e?.default_cost_per_query!==void 0&&e?.default_cost_per_query!==null,r=e?.tool_name_to_cost_per_query&&Object.keys(e.tool_name_to_cost_per_query).length>0;return t||r?(0,_.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,_.jsxs)("div",{className:"space-y-4",children:[t&&e?.default_cost_per_query!==void 0&&e?.default_cost_per_query!==null&&(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Default Cost per Query"}),(0,_.jsxs)("div",{className:"text-green-600 font-mono",children:["$",e.default_cost_per_query.toFixed(4)]})]}),r&&e?.tool_name_to_cost_per_query&&(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Tool-Specific Costs"}),(0,_.jsx)("div",{className:"mt-2 space-y-2",children:Object.entries(e.tool_name_to_cost_per_query).map(([e,t])=>null!=t&&(0,_.jsxs)("div",{className:"flex justify-between items-center p-3 bg-gray-50 rounded-lg",children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:e}),(0,_.jsxs)(Z.Text,{className:"text-green-600 font-mono",children:["$",t.toFixed(4)," per query"]})]},e))})]}),(0,_.jsxs)("div",{className:"mt-4 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,_.jsx)(Z.Text,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,_.jsxs)("div",{className:"mt-2 space-y-1",children:[t&&e?.default_cost_per_query!==void 0&&e?.default_cost_per_query!==null&&(0,_.jsxs)(Z.Text,{className:"text-blue-700",children:["• Default cost: $",e.default_cost_per_query.toFixed(4)," per query"]}),r&&e?.tool_name_to_cost_per_query&&(0,_.jsxs)(Z.Text,{className:"text-blue-700",children:["• ",Object.keys(e.tool_name_to_cost_per_query).length," tool(s) with custom pricing"]})]})]})]})}):(0,_.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,_.jsx)("div",{className:"space-y-4",children:(0,_.jsx)("div",{className:"p-4 bg-gray-50 border border-gray-200 rounded-lg",children:(0,_.jsx)(Z.Text,{className:"text-gray-600",children:"No cost configuration set for this server. Tool calls will be charged at $0.00 per tool call."})})})})},O3=({mcpServer:e,onBack:t,isEditing:r,isProxyAdmin:a,accessToken:s,userRole:n,userID:l,availableAccessGroups:i,initialTabIndex:o=0})=>{let d=function(e,t){if(!e)return!1;let r=(0,Of.getSecureItem)(O4);if(!r)return!1;try{return JSON.parse(r)?.serverId===t}catch{return!1}}(a,e.server_id),[c,u]=(0,T.useState)(r||d),[m,p]=(0,T.useState)(!1),[h,f]=(0,T.useState)({}),[x,g]=(0,T.useState)(d?2:o),y=e.url??"",{maskedUrl:b,hasToken:v}=y?Od(y):{maskedUrl:"—",hasToken:!1},j=(e,t)=>e?v?t?e:b:e:"—",w=async(e,t)=>{await (0,rV.copyToClipboard)(e)&&(f(e=>({...e,[t]:!0})),setTimeout(()=>{f(e=>({...e,[t]:!1}))},2e3))},k=e=>{let t=e.toUpperCase();return(0,_.jsx)("span",{className:"inline-flex items-center text-sm font-medium px-2.5 py-0.5 rounded border bg-gray-50 text-gray-700 border-gray-200",children:t})},N=e=>(0,_.jsx)("span",{className:"inline-flex items-center text-sm font-medium px-2.5 py-0.5 rounded border bg-gray-50 text-gray-700 border-gray-200",children:e});return(0,_.jsxs)("div",{className:"p-4 max-w-full",children:[(0,_.jsxs)("div",{className:"mb-6",children:[(0,_.jsx)(S.Button,{icon:rH.ArrowLeftIcon,variant:"light",className:"mb-4",onClick:t,children:"Back to All Servers"}),(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(X.Title,{className:"text-2xl",children:e.server_name||e.alias||"Unnamed Server"}),(0,_.jsx)(z.Button,{type:"text",size:"small",icon:h["mcp-server_name"]?(0,_.jsx)(M_.CheckIcon,{size:12}):(0,_.jsx)(Mb.CopyIcon,{size:12}),onClick:()=>w(e.server_name||e.alias,"mcp-server_name"),className:`transition-all duration-200 ${h["mcp-server_name"]?"text-green-600 bg-green-50 border-green-200":"text-gray-400 hover:text-gray-600 hover:bg-gray-100"}`}),e.alias&&e.server_name&&e.alias!==e.server_name&&(0,_.jsx)("span",{className:"ml-2 inline-flex items-center text-xs font-medium px-2 py-0.5 rounded bg-gray-100 text-gray-600 border border-gray-200 font-mono",children:e.alias})]}),(0,_.jsxs)("div",{className:"flex items-center gap-1.5 mt-1",children:[(0,_.jsx)(Z.Text,{className:"text-gray-400 font-mono text-xs",children:e.server_id}),(0,_.jsx)(z.Button,{type:"text",size:"small",icon:h["mcp-server-id"]?(0,_.jsx)(M_.CheckIcon,{size:10}):(0,_.jsx)(Mb.CopyIcon,{size:10}),onClick:()=>w(e.server_id,"mcp-server-id"),className:`transition-all duration-200 ${h["mcp-server-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-300 hover:text-gray-500 hover:bg-gray-50"}`})]}),e.description&&(0,_.jsx)(Z.Text,{className:"text-gray-500 mt-2",children:e.description})]}),(0,_.jsxs)(rF.TabGroup,{index:x,onIndexChange:g,children:[(0,_.jsx)(rR.TabList,{className:"mb-4",children:[(0,_.jsx)(rY.Tab,{children:"Overview"},"overview"),(0,_.jsx)(rY.Tab,{children:"MCP Tools"},"tools"),...a?[(0,_.jsx)(rY.Tab,{children:"Settings"},"settings")]:[]]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsxs)(ee.Grid,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-4",children:[(0,_.jsxs)(P.Card,{className:"p-4",children:[(0,_.jsx)(Z.Text,{className:"text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Transport"}),(0,_.jsx)("div",{className:"mt-3",children:k((0,LK.handleTransport)(e.transport??void 0,e.spec_path??void 0))})]}),(0,_.jsxs)(P.Card,{className:"p-4",children:[(0,_.jsx)(Z.Text,{className:"text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Authentication"}),(0,_.jsx)("div",{className:"mt-3",children:N((0,LK.handleAuth)(e.auth_type??void 0))})]}),(0,_.jsxs)(P.Card,{className:"p-4",children:[(0,_.jsx)(Z.Text,{className:"text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Host URL"}),(0,_.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,_.jsx)(Z.Text,{className:"break-all overflow-wrap-anywhere font-mono text-sm",children:j(e.url,m)}),v&&a&&(0,_.jsx)("button",{onClick:()=>p(!m),className:"p-1 hover:bg-gray-100 rounded flex-shrink-0",children:(0,_.jsx)(yi.Icon,{icon:m?OH:Lr,size:"sm",className:"text-gray-500"})})]})]})]}),(0,_.jsxs)(P.Card,{className:"mt-4 p-4",children:[(0,_.jsx)(Z.Text,{className:"text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Cost Configuration"}),(0,_.jsx)("div",{className:"mt-3",children:(0,_.jsx)(O6,{costConfig:e.mcp_info?.mcp_server_cost_info})})]})]}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(O0,{serverId:e.server_id,accessToken:s,auth_type:e.auth_type,oauth2_flow:e.oauth2_flow,delegate_auth_to_upstream:e.delegate_auth_to_upstream,tokenUrl:e.token_url,userRole:n,userID:l,serverAlias:e.alias,extraHeaders:e.extra_headers})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,_.jsx)(X.Title,{children:"MCP Server Settings"}),c?null:(0,_.jsx)(S.Button,{variant:"light",onClick:()=>u(!0),children:"Edit Settings"})]}),c?(0,_.jsx)(O5,{mcpServer:e,accessToken:s,userID:l,onCancel:()=>u(!1),onSuccess:e=>{u(!1),t()},availableAccessGroups:i}):(0,_.jsxs)("div",{className:"divide-y divide-gray-100",children:[(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Server Name"}),(0,_.jsx)("div",{className:"col-span-2 text-sm text-gray-900",children:e.server_name||(0,_.jsx)("span",{className:"text-gray-400",children:"—"})})]}),(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Alias"}),(0,_.jsx)("div",{className:"col-span-2 text-sm font-mono text-gray-900",children:e.alias||(0,_.jsx)("span",{className:"text-gray-400",children:"—"})})]}),(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Description"}),(0,_.jsx)("div",{className:"col-span-2 text-sm text-gray-900",children:e.description||(0,_.jsx)("span",{className:"text-gray-400",children:"—"})})]}),(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"URL"}),(0,_.jsxs)("div",{className:"col-span-2 text-sm font-mono text-gray-900 break-all flex items-center gap-2",children:[j(e.url,m),v&&(0,_.jsx)("button",{onClick:()=>p(!m),className:"p-1 hover:bg-gray-100 rounded flex-shrink-0",children:(0,_.jsx)(yi.Icon,{icon:m?OH:Lr,size:"sm",className:"text-gray-500"})})]})]}),(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Transport"}),(0,_.jsx)("div",{className:"col-span-2",children:k((0,LK.handleTransport)(e.transport,e.spec_path))})]}),(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Authentication"}),(0,_.jsx)("div",{className:"col-span-2",children:N((0,LK.handleAuth)(e.auth_type))})]}),(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Extra Headers"}),(0,_.jsx)("div",{className:"col-span-2 text-sm text-gray-900",children:e.extra_headers&&e.extra_headers.length>0?e.extra_headers.join(", "):(0,_.jsx)("span",{className:"text-gray-400",children:"—"})})]}),(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Allow All Keys"}),(0,_.jsx)("div",{className:"col-span-2",children:e.allow_all_keys?(0,_.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-green-50 text-green-700 rounded-full border border-green-200 text-xs font-medium",children:[(0,_.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-green-500"}),"Enabled"]}):(0,_.jsx)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-gray-50 text-gray-600 rounded-full border border-gray-200 text-xs font-medium",children:"Disabled"})})]}),(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Network Access"}),(0,_.jsx)("div",{className:"col-span-2",children:e.available_on_public_internet?(0,_.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-green-50 text-green-700 rounded-full border border-green-200 text-xs font-medium",children:[(0,_.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-green-500"}),"Public"]}):(0,_.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-orange-50 text-orange-700 rounded-full border border-orange-200 text-xs font-medium",children:[(0,_.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-orange-500"}),"Internal only"]})})]}),"oauth2"===(0,LK.handleAuth)(e.auth_type)&&(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Delegate Auth to Upstream"}),(0,_.jsx)("div",{className:"col-span-2",children:e.delegate_auth_to_upstream?(0,_.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-green-50 text-green-700 rounded-full border border-green-200 text-xs font-medium",children:[(0,_.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-green-500"}),"Enabled (PKCE passthrough)"]}):(0,_.jsx)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-gray-50 text-gray-600 rounded-full border border-gray-200 text-xs font-medium",children:"Disabled"})})]}),"oauth2"!==(0,LK.handleAuth)(e.auth_type)&&Array.isArray(e.extra_headers)&&e.extra_headers.some(e=>"string"==typeof e&&"authorization"===e.toLowerCase())&&(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"OAuth Pass-through"}),(0,_.jsx)("div",{className:"col-span-2",children:e.oauth_passthrough?(0,_.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-green-50 text-green-700 rounded-full border border-green-200 text-xs font-medium",children:[(0,_.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-green-500"}),"Enabled"]}):(0,_.jsx)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-gray-50 text-gray-600 rounded-full border border-gray-200 text-xs font-medium",children:"Disabled"})})]}),(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Access Groups"}),(0,_.jsx)("div",{className:"col-span-2",children:e.mcp_access_groups&&e.mcp_access_groups.length>0?(0,_.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.mcp_access_groups.map((e,t)=>(0,_.jsx)("span",{className:"inline-flex items-center text-xs font-medium px-2 py-0.5 rounded bg-gray-100 text-gray-700 border border-gray-200",children:"string"==typeof e?e:e?.name??""},t))}):(0,_.jsx)("span",{className:"text-sm text-gray-400",children:"—"})})]}),(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Allowed Tools"}),(0,_.jsx)("div",{className:"col-span-2",children:e.allowed_tools&&e.allowed_tools.length>0?(0,_.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.allowed_tools.map((e,t)=>(0,_.jsx)("span",{className:"inline-flex items-center text-xs font-mono font-medium px-2 py-0.5 rounded bg-blue-50 text-blue-700 border border-blue-200",children:e},t))}):(0,_.jsx)("span",{className:"inline-flex items-center text-xs font-medium px-2 py-0.5 rounded bg-green-50 text-green-700 border border-green-200",children:"All tools enabled"})})]}),(0,_.jsxs)("div",{className:"py-3 grid grid-cols-3 gap-4",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-500",children:"Cost"}),(0,_.jsx)("div",{className:"col-span-2",children:(0,_.jsx)(O6,{costConfig:e.mcp_info?.mcp_server_cost_info})})]})]})]})})]})]})]})},O8=(0,ej.createQueryKeys)("mcpSemanticFilterSettings"),O7=(0,ej.createQueryKeys)("mcpSemanticFilterSettings");var O9=e.i(992619);function De({accessToken:e,testQuery:t,setTestQuery:r,testModel:a,setTestModel:s,isTesting:n,onTest:l,filterEnabled:i,testResult:o,curlCommand:d}){return(0,_.jsx)(eg.Card,{title:"Test Configuration",style:{marginBottom:16},children:(0,_.jsx)(W.Tabs,{defaultActiveKey:"test",items:[{key:"test",label:"Test",children:(0,_.jsxs)(U.Space,{direction:"vertical",style:{width:"100%"},size:"large",children:[(0,_.jsxs)("div",{children:[(0,_.jsxs)(V.Typography.Text,{strong:!0,style:{display:"block",marginBottom:8},children:[(0,_.jsx)(kh.PlayCircleOutlined,{})," Test Query"]}),(0,_.jsx)($.Input.TextArea,{placeholder:"Enter a test query to see which tools would be selected...",value:t,onChange:e=>r(e.target.value),rows:4,disabled:n})]}),(0,_.jsx)("div",{children:(0,_.jsx)(O9.default,{accessToken:e||"",value:a,onChange:s,disabled:n,showLabel:!0,labelText:"Select Model"})}),(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(kh.PlayCircleOutlined,{}),onClick:l,loading:n,disabled:!t||!a||!i,block:!0,children:"Test Filter"}),!i&&(0,_.jsx)(B.Alert,{type:"warning",message:"Semantic filtering is disabled",description:"Enable semantic filtering and save settings to test the filter.",showIcon:!0}),o&&(0,_.jsxs)("div",{children:[(0,_.jsx)(V.Typography.Title,{level:5,children:"Results"}),(0,_.jsx)(B.Alert,{type:"success",message:`${o.selectedTools} tools selected`,description:`Filtered from ${o.totalTools} available tools`,showIcon:!0,style:{marginBottom:16}}),(0,_.jsxs)("div",{children:[(0,_.jsx)(V.Typography.Text,{strong:!0,style:{display:"block",marginBottom:8},children:"Selected Tools:"}),(0,_.jsx)("ul",{style:{paddingLeft:20,margin:0},children:o.tools.map((e,t)=>(0,_.jsx)("li",{style:{marginBottom:4},children:(0,_.jsx)(V.Typography.Text,{children:e})},t))})]})]})]})},{key:"api",label:"API Usage",children:(0,_.jsxs)("div",{children:[(0,_.jsxs)(U.Space,{style:{marginBottom:8},children:[(0,_.jsx)(wZ.CodeOutlined,{}),(0,_.jsx)(V.Typography.Text,{strong:!0,children:"API Usage"})]}),(0,_.jsx)(V.Typography.Text,{type:"secondary",style:{display:"block",marginBottom:8},children:"Use this curl command to test the semantic filter with your current configuration."}),(0,_.jsx)(V.Typography.Text,{strong:!0,style:{display:"block",marginBottom:8},children:"Response headers to check:"}),(0,_.jsxs)("ul",{style:{paddingLeft:20,margin:"0 0 12px 0"},children:[(0,_.jsxs)("li",{children:[(0,_.jsx)(V.Typography.Text,{children:"x-litellm-semantic-filter: shows total tools → selected tools"}),(0,_.jsx)(V.Typography.Text,{type:"secondary",style:{display:"block"},children:"Example: 10→3"})]}),(0,_.jsxs)("li",{children:[(0,_.jsx)(V.Typography.Text,{children:"x-litellm-semantic-filter-tools: CSV of selected tool names"}),(0,_.jsx)(V.Typography.Text,{type:"secondary",style:{display:"block"},children:"Example: wikipedia-fetch,github-search,slack-post"})]})]}),(0,_.jsx)("pre",{style:{background:"#f5f5f5",padding:12,borderRadius:4,overflow:"auto",fontSize:12,margin:0},children:d})]})}]})})}let Dt=async({accessToken:e,testModel:t,testQuery:r,setIsTesting:a,setTestResult:s})=>{if(!r||!t||!e)return void J.default.error("Please enter a query and select a model");a(!0),s(null);try{let{headers:a}=await (0,Q.testMCPSemanticFilter)(e,t,r),n=(e=>{if(!e.filter)return null;let[t,r]=e.filter.split("->").map(Number);return{totalTools:t,selectedTools:r,tools:e.tools?e.tools.split(",").map(e=>e.trim()):[]}})(a);if(!n)return void J.default.warning("Semantic filter is not enabled or no tools were filtered");s(n),J.default.success("Semantic filter test completed successfully")}catch(e){console.error("Test failed:",e),J.default.error("Failed to test semantic filter")}finally{a(!1)}};function Dr({accessToken:e}){var t;let r,{data:a,isLoading:s,isError:n,error:l}=(()=>{let{accessToken:e}=(0,k.default)();return(0,ev.useQuery)({queryKey:O8.list({}),queryFn:async()=>await (0,Q.getMCPSemanticFilterSettings)(e),enabled:!!e,staleTime:36e5,gcTime:36e5})})(),{mutate:i,isPending:o,error:d}=(t=e||"",r=(0,eh.useQueryClient)(),(0,ep.useMutation)({mutationFn:async e=>{if(!t)throw Error("Access token is required");return(0,Q.updateMCPSemanticFilterSettings)(t,e)},onSuccess:()=>{r.invalidateQueries({queryKey:O7.all})}})),[c]=H.Form.useForm(),[u,m]=(0,T.useState)(!1),[p,h]=(0,T.useState)(!1),[f,x]=(0,T.useState)([]),[g,y]=(0,T.useState)(!0),[b,v]=(0,T.useState)(""),[j,w]=(0,T.useState)("gpt-4o"),[S,N]=(0,T.useState)(null),[M,C]=(0,T.useState)(!1),L=a?.field_schema,O=a?.values??{};(0,T.useEffect)(()=>{(async()=>{if(e)try{y(!0);let t=(await (0,jh.fetchAvailableModels)(e)).filter(e=>"embedding"===e.mode);x(t)}catch(e){console.error("Error fetching embedding models:",e)}finally{y(!1)}})()},[e]),(0,T.useEffect)(()=>{O&&(c.setFieldsValue({enabled:O.enabled??!1,embedding_model:O.embedding_model??"text-embedding-3-small",top_k:O.top_k??10,similarity_threshold:O.similarity_threshold??.3}),h(!1))},[O,c]);let D=async()=>{try{let e=await c.validateFields();i(e,{onSuccess:()=>{h(!1),m(!0),setTimeout(()=>m(!1),3e3),J.default.success("Settings updated successfully. Changes will be applied across all pods within 10 seconds.")},onError:e=>{J.default.fromBackend(e)}})}catch(e){console.error("Form validation failed:",e)}},P=async()=>{e&&await Dt({accessToken:e,testModel:j,testQuery:b,setIsTesting:C,setTestResult:N})};return e?(0,_.jsx)("div",{style:{width:"100%"},children:s?(0,_.jsx)(ey.Skeleton,{active:!0}):n?(0,_.jsx)(B.Alert,{type:"error",message:"Could not load MCP Semantic Filter settings",description:l instanceof Error?l.message:void 0,style:{marginBottom:24}}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(B.Alert,{type:"info",message:"Semantic Tool Filtering",description:"Filter MCP tools semantically based on query relevance. This reduces context window size and improves tool selection accuracy. Click 'Save Settings' to apply changes across all pods (takes effect within 10 seconds).",showIcon:!0,style:{marginBottom:24}}),u&&(0,_.jsx)(B.Alert,{type:"success",message:"Settings saved successfully",icon:(0,_.jsx)(tz.CheckCircleOutlined,{}),showIcon:!0,closable:!0,style:{marginBottom:16}}),d&&(0,_.jsx)(B.Alert,{type:"error",message:"Could not update settings",description:d instanceof Error?d.message:void 0,style:{marginBottom:16}}),(0,_.jsxs)(wl.Row,{gutter:24,children:[(0,_.jsx)(wi.Col,{xs:24,lg:12,children:(0,_.jsxs)(H.Form,{form:c,layout:"vertical",disabled:o,onValuesChange:()=>{h(!0)},children:[(0,_.jsxs)(eg.Card,{style:{marginBottom:16},children:[(0,_.jsx)(H.Form.Item,{name:"enabled",label:(0,_.jsxs)(U.Space,{children:[(0,_.jsx)(V.Typography.Text,{strong:!0,children:"Enable Semantic Filtering"}),(0,_.jsx)(tB.Tooltip,{title:"When enabled, only the most relevant MCP tools will be included in requests based on semantic similarity",children:(0,_.jsx)(T1.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),valuePropName:"checked",children:(0,_.jsx)(e_.Switch,{disabled:o})}),(0,_.jsx)(V.Typography.Text,{type:"secondary",style:{display:"block",marginTop:-16,marginBottom:16},children:L?.properties?.enabled?.description})]}),(0,_.jsxs)(eg.Card,{title:"Configuration",style:{marginBottom:16},children:[(0,_.jsx)(H.Form.Item,{name:"embedding_model",label:(0,_.jsxs)(U.Space,{children:[(0,_.jsx)(V.Typography.Text,{strong:!0,children:"Embedding Model"}),(0,_.jsx)(tB.Tooltip,{title:"The model used to generate embeddings for semantic matching",children:(0,_.jsx)(T1.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),children:(0,_.jsx)(eE.Select,{options:f.map(e=>({label:e.model_group,value:e.model_group})),placeholder:g?"Loading models...":"Select embedding model",showSearch:!0,disabled:o||g,loading:g,notFoundContent:g?"Loading...":"No embedding models available"})}),(0,_.jsx)(H.Form.Item,{name:"top_k",label:(0,_.jsxs)(U.Space,{children:[(0,_.jsx)(V.Typography.Text,{strong:!0,children:"Top K Results"}),(0,_.jsx)(tB.Tooltip,{title:"Maximum number of tools to return after filtering",children:(0,_.jsx)(T1.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),children:(0,_.jsx)(tq.InputNumber,{min:1,max:100,style:{width:"100%"},disabled:o})}),(0,_.jsx)(H.Form.Item,{name:"similarity_threshold",label:(0,_.jsxs)(U.Space,{children:[(0,_.jsx)(V.Typography.Text,{strong:!0,children:"Similarity Threshold"}),(0,_.jsx)(tB.Tooltip,{title:"Minimum similarity score (0-1) for a tool to be included",children:(0,_.jsx)(T1.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),children:(0,_.jsx)(TZ.Slider,{min:0,max:1,step:.05,marks:{0:"0.0",.3:"0.3",.5:"0.5",.7:"0.7",1:"1.0"},disabled:o})})]}),(0,_.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8},children:(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(MC.SaveOutlined,{}),onClick:D,loading:o,disabled:!p,children:"Save Settings"})})]})}),(0,_.jsx)(wi.Col,{xs:24,lg:12,children:(0,_.jsx)(De,{accessToken:e,testQuery:b,setTestQuery:v,testModel:j,setTestModel:w,isTesting:M,onTest:P,filterEnabled:!!O.enabled,testResult:S,curlCommand:`curl --location 'http://localhost:4000/v1/responses' \\ --header 'Content-Type: application/json' \\ --header 'Authorization: Bearer sk-1234' \\ --data '{ @@ -474,7 +474,7 @@ Return a structured verdict with confidence and justification.`,kx=`{ } ], "tool_choice": "required" -}'`})})]})]})}):(0,_.jsx)("div",{className:"p-6 text-center text-gray-500",children:"Please log in to configure semantic filter settings."})}let{Text:Dr}=V.Typography,Da=({accessToken:e})=>{let t,[r,a]=(0,T.useState)(!0),[s,n]=(0,T.useState)(!1),[l,i]=(0,T.useState)([]),[o,d]=(0,T.useState)(null);(0,T.useEffect)(()=>{c(),u()},[e]);let c=async()=>{if(e){a(!0);try{for(let t of(await (0,Q.getGeneralSettingsCall)(e)))"mcp_internal_ip_ranges"===t.field_name&&t.field_value&&i(t.field_value)}catch(e){console.error("Failed to load MCP network settings:",e)}finally{a(!1)}}},u=async()=>{if(!e)return;let t=await (0,Q.fetchMCPClientIp)(e);t&&d(t)},m=async()=>{if(e){n(!0);try{l.length>0?await (0,Q.updateConfigFieldSetting)(e,"mcp_internal_ip_ranges",l):await (0,Q.deleteConfigFieldSetting)(e,"mcp_internal_ip_ranges")}catch(e){console.error("Failed to save MCP network settings:",e)}finally{n(!1)}}};if(r)return(0,_.jsx)("div",{className:"flex justify-center py-12",children:(0,_.jsx)(rm.Spin,{})});let p=o?4!==(t=o.split(".")).length?o+"/32":`${t[0]}.${t[1]}.${t[2]}.0/24`:null;return(0,_.jsxs)("div",{className:"space-y-6 p-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Dr,{className:"text-lg font-semibold",children:"Private IP Ranges"}),(0,_.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:'Define which IP ranges are part of your private network. Callers from these IPs can see all MCP servers. Callers from any other IP can only see servers marked "Available on Public Internet".'})]}),(0,_.jsxs)(eg.Card,{children:[o&&(0,_.jsxs)("div",{className:"mb-4 p-3 bg-blue-50 rounded-lg",children:[(0,_.jsxs)(Dr,{className:"text-sm text-blue-700",children:["Your current IP: ",(0,_.jsx)("span",{className:"font-mono font-medium",children:o})]}),p&&!l.includes(p)&&(0,_.jsxs)("div",{className:"mt-1",children:[(0,_.jsx)(Dr,{className:"text-sm text-blue-600",children:"Suggested range: "}),(0,_.jsx)(eN.Tag,{className:"cursor-pointer font-mono",color:"blue",icon:(0,_.jsx)(tZ.PlusOutlined,{}),onClick:()=>{!l.includes(p)&&i([...l,p])},children:p})]})]}),(0,_.jsx)("div",{className:"flex items-center mb-2",children:(0,_.jsx)(Dr,{className:"font-medium",children:"Your Private Network Ranges"})}),(0,_.jsx)(eE.Select,{mode:"tags",value:l,onChange:i,placeholder:"Leave empty to use defaults: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 127.0.0.0/8",tokenSeparators:[","],className:"w-full",size:"large",allowClear:!0}),(0,_.jsx)("p",{className:"text-xs text-gray-400 mt-2",children:"Enter CIDR ranges (e.g., 10.0.0.0/8). When empty, standard private IP ranges are used."})]}),(0,_.jsx)("div",{className:"flex justify-end",children:(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(MC.SaveOutlined,{}),onClick:m,loading:s,children:"Save"})})]})},{Search:Ds}=$.Input,{Text:Dn}=V.Typography,Dl=["#3B82F6","#10B981","#F59E0B","#EF4444","#8B5CF6","#EC4899","#06B6D4","#84CC16"],Di=({isVisible:e,onClose:t,onSelectServer:r,onCustomServer:a,accessToken:s})=>{let[n,l]=(0,T.useState)([]),[i,o]=(0,T.useState)([]),[d,c]=(0,T.useState)(!1),[u,m]=(0,T.useState)(null),[p,h]=(0,T.useState)(""),[f,x]=(0,T.useState)("All");(0,T.useEffect)(()=>{e&&s&&(c(!0),m(null),(0,Q.fetchDiscoverableMCPServers)(s).then(e=>{l(e.servers||[]),o(e.categories||[])}).catch(e=>{m(e.message||"Failed to load MCP servers")}).finally(()=>{c(!1)}))},[e,s]),(0,T.useEffect)(()=>{e&&(h(""),x("All"))},[e]);let g=(0,T.useMemo)(()=>{let e=n;if("All"!==f&&(e=e.filter(e=>e.category===f)),p.trim()){let t=p.toLowerCase();e=e.filter(e=>e.name.toLowerCase().includes(t)||e.title.toLowerCase().includes(t)||e.description.toLowerCase().includes(t))}return e},[n,f,p]),y=(0,T.useMemo)(()=>{let e={};for(let t of g){let r=t.category||"Other";e[r]||(e[r]=[]),e[r].push(t)}return e},[g]);return(0,_.jsxs)(q.Modal,{title:(0,_.jsxs)("div",{className:"flex items-center justify-between pb-4 border-b border-gray-100",children:[(0,_.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,_.jsx)("img",{src:Oy,alt:"MCP Logo",className:"w-8 h-8 object-contain",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"}}),(0,_.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add MCP Server"})]}),(0,_.jsx)("button",{onClick:a,className:"text-sm text-blue-600 hover:text-blue-800 cursor-pointer bg-transparent border-none font-medium",children:"+ Custom Server"})]}),open:e,onCancel:t,footer:null,width:1e3,className:"top-8",styles:{body:{padding:"24px",maxHeight:"70vh",overflowY:"auto"},header:{padding:"24px 24px 0 24px",border:"none"}},children:[(0,_.jsx)("div",{style:{display:"flex",gap:6,flexWrap:"wrap",marginBottom:12},children:["All",...i].map(e=>{let t=f===e;return(0,_.jsx)("button",{onClick:()=>x(e),style:{padding:"4px 12px",borderRadius:4,border:t?"1px solid #111827":"1px solid #e5e7eb",background:t?"#111827":"#fff",color:t?"#fff":"#4b5563",cursor:"pointer",fontSize:12,fontWeight:t?500:400,lineHeight:"20px"},children:e},e)})}),(0,_.jsx)(Ds,{placeholder:"Search servers...",value:p,onChange:e=>h(e.target.value),style:{marginBottom:16},allowClear:!0}),d&&(0,_.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:Array.from({length:8}).map((e,t)=>(0,_.jsx)("div",{style:{height:36,borderRadius:6,background:"#f9fafb"}},t))}),u&&(0,_.jsx)("div",{style:{textAlign:"center",padding:"32px 0",color:"#9ca3af"},children:(0,_.jsxs)(Dn,{children:["Failed to load servers: ",u]})}),!d&&!u&&0===g.length&&(0,_.jsx)("div",{style:{textAlign:"center",padding:"32px 0",color:"#9ca3af"},children:(0,_.jsxs)(Dn,{children:["No servers found."," ",(0,_.jsx)("a",{onClick:a,style:{color:"#2563eb",cursor:"pointer"},children:"Add a custom server"})]})}),!d&&!u&&Object.entries(y).map(([e,t])=>(0,_.jsxs)("div",{style:{marginBottom:16},children:[(0,_.jsx)("div",{style:{fontSize:11,fontWeight:500,color:"#9ca3af",textTransform:"uppercase",letterSpacing:"0.05em",padding:"6px 0",borderBottom:"1px solid #f3f4f6",marginBottom:4},children:e}),(0,_.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0 16px"},children:t.map(e=>{var t;let a,s,n=(a=(t=e.title||e.name).charAt(0).toUpperCase(),s=t.split("").reduce((e,t)=>e+t.charCodeAt(0),0)%Dl.length,{initial:a,backgroundColor:Dl[s]});return(0,_.jsxs)("div",{onClick:()=>r(e),style:{display:"flex",alignItems:"center",padding:"8px 10px",borderRadius:6,cursor:"pointer",transition:"background 0.1s ease"},onMouseEnter:e=>{e.currentTarget.style.background="#f9fafb"},onMouseLeave:e=>{e.currentTarget.style.background="transparent"},children:[e.icon_url?(0,_.jsx)("img",{src:e.icon_url,alt:e.title,style:{width:20,height:20,objectFit:"contain",flexShrink:0,marginRight:12},onError:e=>{let t=e.currentTarget;t.style.display="none";let r=t.nextElementSibling;r&&(r.style.display="flex")}}):null,(0,_.jsx)("div",{style:{width:20,height:20,borderRadius:4,backgroundColor:n.backgroundColor,color:"#fff",display:e.icon_url?"none":"flex",alignItems:"center",justifyContent:"center",fontWeight:600,fontSize:11,flexShrink:0,marginRight:12},children:n.initial}),(0,_.jsx)("span",{style:{fontSize:14,fontWeight:400,color:"#111827",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title||e.name}),(0,_.jsx)("span",{style:{color:"#d1d5db",fontSize:14,flexShrink:0,marginLeft:8},children:"›"})]},e.name)})})]},e))]})};var Do=e.i(611052);let{Text:Dd,Title:Dc}=V.Typography,Du=({server:e,open:t,accessToken:r,onClose:a,onSaved:s})=>{let[n]=H.Form.useForm(),{data:l,isLoading:i,isError:o}=(0,ev.useQuery)({queryKey:["mcpUserEnvVars",e?.server_id],queryFn:()=>(0,Q.getMCPUserEnvVars)(r,e.server_id),enabled:t&&!!e&&!!r}),d=(0,ep.useMutation)({mutationFn:t=>(0,Q.storeMCPUserEnvVars)(r,e.server_id,t),onSuccess:e=>{J.default.success("Credentials saved"),s?.(e),a()},onError:e=>{J.default.fromBackend(`Failed to save env vars: ${e instanceof Error?e.message:String(e)}`)}}),c=e?.server_name||e?.alias||e?.server_id||"MCP Server",u=l?.required??[],m=d.isPending;return(0,_.jsx)(q.Modal,{open:t,onCancel:a,footer:null,width:520,destroyOnHidden:!0,afterOpenChange:e=>{e&&n.resetFields()},title:(0,_.jsxs)("div",{children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(Dc,{level:5,style:{margin:0},children:"Set your credentials"}),(0,_.jsx)(eN.Tag,{color:"blue",children:"Per-user"})]}),(0,_.jsx)(Dd,{type:"secondary",className:"text-xs",children:c})]}),children:(0,_.jsx)("div",{className:"space-y-4 mt-2",children:i?(0,_.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,_.jsx)(rm.Spin,{})}):o?(0,_.jsx)(B.Alert,{type:"error",showIcon:!0,message:"Failed to load env vars"}):0===u.length?(0,_.jsx)(B.Alert,{type:"info",showIcon:!0,message:"No per-user fields configured for this server."}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(Dd,{className:"text-sm text-gray-600 block",children:"These values are private to you. Your admin configured this MCP server to require these per-user credentials. Saved values are never shown back; leave an already-set field blank to keep it, or enter a value to set or change it."}),(0,_.jsxs)(H.Form,{form:n,layout:"vertical",onFinish:t=>{if(!e||!r)return;let a={};for(let[e,r]of Object.entries(t))a[e]=(r??"").trim();d.mutate(a)},disabled:m,children:[u.map(e=>(0,_.jsx)(H.Form.Item,{name:e.name,label:(0,_.jsxs)("span",{className:"flex items-center gap-2",children:[(0,_.jsx)("span",{className:"font-mono text-sm font-semibold",children:e.name}),e.is_set&&(0,_.jsx)(eN.Tag,{color:"green",children:"Set"})]}),extra:e.description||void 0,rules:e.is_set?void 0:[{required:!0,message:`${e.name} is required`}],children:(0,_.jsx)($.Input.Password,{placeholder:e.is_set?"Enter a new value to overwrite":e.description||`Enter your ${e.name}`,visibilityToggle:!0})},e.name)),(0,_.jsxs)("div",{className:"flex items-center justify-end gap-2 pt-2 border-t border-gray-100",children:[(0,_.jsx)(z.Button,{onClick:a,disabled:m,children:"Cancel"}),(0,_.jsx)(z.Button,{type:"primary",htmlType:"submit",loading:m,children:"Save Credentials"})]})]})]})})})},Dm=[{value:"created_desc",label:"Recently created"},{value:"updated_desc",label:"Recently updated"},{value:"name_asc",label:"Name (A→Z)"},{value:"health",label:"Health (unhealthy first)"}],Dp={unhealthy:0,unknown:1,healthy:2},{Text:Dh,Title:Df}=V.Typography,{Option:Dx}=eE.Select,Dg=({accessToken:e,userRole:t,userID:r})=>{let{data:a,isLoading:s,refetch:n}=(0,LM.useMCPServers)(),{data:l,isLoading:i,recheckServerHealth:o,recheckingServerIds:d}=(()=>{let{accessToken:e}=(0,k.default)(),t=(0,eh.useQueryClient)(),[r,a]=(0,T.useState)(new Set),s=(0,ev.useQuery)({queryKey:LC.lists(),queryFn:async()=>await (0,Q.fetchMCPServerHealth)(e),enabled:!!e,refetchInterval:3e4}),n=(0,T.useCallback)(async r=>{if(e){a(e=>new Set(e).add(r));try{let a=await (0,Q.fetchMCPServerHealth)(e,[r]);t.setQueriesData({queryKey:LC.lists()},e=>e?e.map(e=>a.find(t=>t.server_id===e.server_id)??e):a)}finally{a(e=>{let t=new Set(e);return t.delete(r),t})}}},[e,t]);return{...s,recheckServerHealth:n,recheckingServerIds:r}})(),c=(0,T.useMemo)(()=>{if(!a)return[];if(!l)return a;let e=new Map(l.map(e=>[e.server_id,e.status]));return a.map(t=>{let r=e.get(t.server_id);return{...t,status:r||t.status}})},[a,l]),[u,m]=(0,T.useState)(null),[p,h]=(0,T.useState)(!1),[f,x]=(0,T.useState)(null),[g,y]=(0,T.useState)(!1),[b,v]=(0,T.useState)("all"),[j,w]=(0,T.useState)("all"),[N,M]=(0,T.useState)([]),[C,L]=(0,T.useState)(!1),[O,D]=(0,T.useState)(!1),[P,A]=(0,T.useState)(null),[E,I]=(0,T.useState)(!1),[Y,F]=(0,T.useState)(null),[R,B]=(0,T.useState)(null),[z,H]=(0,T.useState)(()=>new URLSearchParams(window.location.search).get("fill_env_vars")),[U,W]=(0,T.useState)(""),[V,K]=(0,T.useState)("created_desc"),ee="Internal User"===t,{data:et,refetch:er}=(0,ev.useQuery)({queryKey:["mcpUserEnvVarStatus"],queryFn:()=>(0,Q.listMCPUserEnvVarStatus)(e),enabled:!!e}),ea=(0,T.useMemo)(()=>{let e={};for(let t of et??[])e[t.server_id]=(t.required??[]).filter(e=>!e.is_set).map(e=>e.name);return e},[et]);(0,T.useEffect)(()=>{if(!z)return;let e=new URLSearchParams(window.location.search);if(!e.has("fill_env_vars"))return;e.delete("fill_env_vars");let t=e.toString(),r=window.location.pathname+(t?`?${t}`:"")+window.location.hash;window.history.replaceState({},"",r)},[z]);let es=(0,T.useMemo)(()=>z?c.find(e=>e.server_id===z)??null:null,[z,c]),en=R??es;(0,T.useEffect)(()=>{try{let e=(0,Ox.getSecureItem)("litellm-mcp-oauth-edit-state");if(!e)return;let t=JSON.parse(e);t?.serverId&&(x(t.serverId),y(!0))}catch(e){console.error("Failed to restore MCP edit view state",e)}},[]);let el=T.default.useMemo(()=>{if(!c)return[];let e=new Set,t=[];return c.forEach(r=>{r.teams&&r.teams.forEach(r=>{let a=r.team_id;e.has(a)||(e.add(a),t.push(r))})}),t},[c]),ei=T.default.useMemo(()=>c?Array.from(new Set(c.flatMap(e=>e.mcp_access_groups).filter(e=>null!=e))):[],[c]),eo=(0,T.useCallback)((e,t)=>{if(!c)return M([]);let r=c;"personal"===e?M([]):("all"!==e&&(r=r.filter(t=>t.teams?.some(t=>t.team_id===e))),"all"!==t&&(r=r.filter(e=>e.mcp_access_groups?.some(e=>"string"==typeof e?e===t:e&&e.name===t))),M([...r].sort((e,t)=>e.created_at||t.created_at?e.created_at?t.created_at?new Date(t.created_at).getTime()-new Date(e.created_at).getTime():-1:1:0)))},[c]);(0,T.useEffect)(()=>{eo(b,j)},[c,b,j,eo]);let ed=(0,T.useMemo)(()=>{let e=U.trim().toLowerCase();return[...e?N.filter(t=>{let r=(t.server_name||"").toLowerCase(),a=(t.alias||"").toLowerCase(),s=(t.url||"").toLowerCase(),n=t.server_id.toLowerCase();return r.includes(e)||a.includes(e)||s.includes(e)||n.includes(e)}):N].sort((e,t)=>((e,t,r)=>{switch(r){case"name_asc":{let r=(e.server_name||e.alias||e.server_id).toLowerCase(),a=(t.server_name||t.alias||t.server_id).toLowerCase();return r.localeCompare(a)}case"updated_desc":{let r=e.updated_at?new Date(e.updated_at).getTime():0;return(t.updated_at?new Date(t.updated_at).getTime():0)-r}case"health":{let r=Dp[e.status??"unknown"]??1,a=Dp[t.status??"unknown"]??1;if(r!==a)return r-a;let s=e.created_at?new Date(e.created_at).getTime():0;return(t.created_at?new Date(t.created_at).getTime():0)-s}default:{let r=e.created_at?new Date(e.created_at).getTime():0;return(t.created_at?new Date(t.created_at).getTime():0)-r}}})(e,t,V))},[N,U,V]),ec=async()=>{if(null!=u&&null!=e)try{I(!0),await (0,Q.deleteMCPServer)(e,u),J.default.success("Deleted MCP Server successfully"),f===u&&(y(!1),x(null)),n()}catch(e){console.error("Error deleting the mcp server:",e)}finally{I(!1),h(!1),m(null)}},eu=u?(a||[]).find(e=>e.server_id===u):null,em=T.default.useMemo(()=>N.find(e=>e.server_id===f)||{server_id:"",server_name:"",alias:"",url:"",transport:"",auth_type:"",created_at:"",created_by:"",updated_at:"",updated_by:""},[N,f]),ep=T.default.useCallback(()=>{y(!1),x(null),n()},[n]);return e&&t&&r?(0,_.jsxs)("div",{className:"w-full h-full p-6",children:[(0,_.jsx)(q.Modal,{open:p,title:"Delete MCP Server?",onOk:ec,okText:E?"Deleting...":"Delete",onCancel:()=>{h(!1),m(null)},cancelText:"Cancel",cancelButtonProps:{disabled:E},okButtonProps:{danger:!0},confirmLoading:E,children:(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsx)(Dh,{className:"text-gray-600",children:"This action is permanent and cannot be undone. All associated configurations will be removed."}),eu&&(0,_.jsx)("div",{className:"mt-3 p-4 bg-gray-50 rounded-lg border border-gray-200",children:(0,_.jsxs)(eS.Descriptions,{column:1,size:"small",colon:!1,children:[eu.server_name&&(0,_.jsx)(eS.Descriptions.Item,{label:(0,_.jsx)("span",{className:"text-gray-500 text-sm",children:"Name"}),children:(0,_.jsx)(Dh,{strong:!0,className:"text-sm",children:eu.server_name})}),(0,_.jsx)(eS.Descriptions.Item,{label:(0,_.jsx)("span",{className:"text-gray-500 text-sm",children:"ID"}),children:(0,_.jsx)(Dh,{code:!0,className:"text-xs",children:eu.server_id})}),eu.url&&(0,_.jsx)(eS.Descriptions.Item,{label:(0,_.jsx)("span",{className:"text-gray-500 text-sm",children:"URL"}),children:(0,_.jsx)(Dh,{code:!0,className:"text-xs break-all",children:eu.url})})]})})]})}),(0,_.jsx)(Ow,{userRole:t,userID:r,accessToken:e,onCreateSuccess:e=>{M(t=>[...t,e]),L(!1),n()},isModalVisible:C,setModalVisible:L,availableAccessGroups:ei,prefillData:P,onBackToDiscovery:()=>{L(!1),A(null),D(!0)}}),(0,_.jsxs)("div",{className:"flex items-center justify-between",children:[(0,_.jsxs)("div",{children:[(0,_.jsxs)("div",{className:"flex items-center gap-3",children:[(0,_.jsx)(X.Title,{children:"MCP Servers"}),N.length>0&&(0,_.jsx)("span",{className:"inline-flex items-center text-xs font-medium px-2 py-0.5 rounded-full bg-gray-100 text-gray-600 border border-gray-200",children:N.length})]}),(0,_.jsx)(Z.Text,{className:"text-tremor-content mt-1",children:"Configure and manage your MCP servers"})]}),(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ts.isAdminRole)(t)&&(0,_.jsx)(S.Button,{className:"flex-shrink-0",onClick:()=>D(!0),children:"+ Add New MCP Server"}),!(0,ts.isAdminRole)(t)&&(0,_.jsx)(S.Button,{className:"flex-shrink-0",onClick:()=>{A(null),L(!0)},variant:"secondary",children:"+ Submit MCP Server"})]})]}),(0,_.jsx)(Di,{isVisible:O,onClose:()=>D(!1),onSelectServer:e=>{A(e),D(!1),L(!0)},onCustomServer:()=>{A(null),D(!1),L(!0)},accessToken:e}),(0,_.jsxs)(rF.TabGroup,{className:"w-full h-full",children:[(0,_.jsx)(rR.TabList,{className:"flex justify-between mt-2 w-full items-center",children:(0,_.jsxs)("div",{className:"flex",children:[(0,_.jsx)(rY.Tab,{children:"All Servers"}),(0,_.jsx)(rY.Tab,{children:"Toolsets"}),(0,_.jsx)(rY.Tab,{children:"Connect"}),(0,_.jsx)(rY.Tab,{children:"Semantic Filter"}),(0,_.jsx)(rY.Tab,{children:"Network Settings"}),(0,ts.isAdminRole)(t)&&(0,_.jsx)(rY.Tab,{children:(0,_.jsxs)("span",{className:"flex items-center gap-2",children:["Submitted MCPs ",(0,_.jsx)(G.default,{})]})})]})}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsx)(rB.TabPanel,{children:f?(0,_.jsx)(O6,{mcpServer:em,onBack:ep,isProxyAdmin:(0,ts.isAdminRole)(t),isEditing:g,accessToken:e,userID:r,userRole:t,availableAccessGroups:ei},f):(0,_.jsxs)("div",{className:"w-full h-full",children:[(0,_.jsx)("div",{className:"w-full",children:(0,_.jsx)("div",{className:"flex flex-col space-y-4",children:(0,_.jsxs)("div",{className:"flex items-center gap-6 bg-white rounded-lg px-4 py-3 border border-gray-200",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-600 whitespace-nowrap",children:"Team"}),(0,_.jsxs)(eE.Select,{value:b,onChange:e=>{v(e),eo(e,j)},style:{width:220},size:"middle",children:[(0,_.jsx)(Dx,{value:"all",children:(0,_.jsx)("span",{className:"font-medium",children:ee?"All Available Servers":"All Servers"})}),(0,_.jsx)(Dx,{value:"personal",children:(0,_.jsx)("span",{className:"font-medium",children:"Personal"})}),el.map(e=>(0,_.jsx)(Dx,{value:e.team_id,children:(0,_.jsx)("span",{className:"font-medium",children:e.team_alias||e.team_id})},e.team_id))]})]}),(0,_.jsx)("div",{className:"h-6 w-px bg-gray-200"}),(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsxs)(Z.Text,{className:"text-sm font-medium text-gray-600 whitespace-nowrap",children:["Access Group",(0,_.jsx)(tB.Tooltip,{title:"An MCP Access Group is a set of users or teams that have permission to access specific MCP servers. Use access groups to control and organize who can connect to which servers.",children:(0,_.jsx)(T1.QuestionCircleOutlined,{style:{marginLeft:4,color:"#9ca3af"}})})]}),(0,_.jsxs)(eE.Select,{value:j,onChange:e=>{w(e),eo(b,e)},style:{width:220},size:"middle",children:[(0,_.jsx)(Dx,{value:"all",children:(0,_.jsx)("span",{className:"font-medium",children:"All Access Groups"})}),ei.map(e=>(0,_.jsx)(Dx,{value:e,children:(0,_.jsx)("span",{className:"font-medium",children:e})},e))]})]})]})})}),(0,_.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-3",children:[(0,_.jsx)($.Input,{allowClear:!0,prefix:(0,_.jsx)(ry.SearchOutlined,{className:"text-gray-400"}),placeholder:"Search by name, alias, URL, or ID",value:U,onChange:e=>W(e.target.value),style:{maxWidth:320}}),(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(Z.Text,{className:"whitespace-nowrap text-sm font-medium text-gray-600",children:"Sort"}),(0,_.jsx)(eE.Select,{value:V,onChange:e=>K(e),style:{width:220},size:"middle",children:Dm.map(e=>(0,_.jsx)(Dx,{value:e.value,children:e.label},e.value))})]}),(0,_.jsxs)("div",{className:"ml-auto text-xs text-gray-500",children:[ed.length," of ",N.length," servers"]})]}),(0,_.jsx)("div",{className:"mt-4 w-full",children:s?(0,_.jsx)("div",{className:"flex items-center justify-center rounded-lg border border-dashed border-gray-200 bg-white p-12",children:(0,_.jsx)(rm.Spin,{tip:"Loading MCP servers..."})}):0===ed.length?(0,_.jsx)("div",{className:"rounded-lg border border-dashed border-gray-200 bg-white p-12",children:(0,_.jsx)(e0.Empty,{description:0===N.length?"No MCP servers configured. Click '+ Add New MCP Server' to get started.":"No servers match the current filters or search."})}):(0,_.jsx)("div",{"data-testid":"mcp-servers-grid",className:"grid auto-rows-fr grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3",children:ed.map(e=>(0,_.jsx)(OH,{server:e,missingUserFields:ea[e.server_id],isLoadingHealth:i,isRechecking:d?.has(e.server_id),onClick:()=>{x(e.server_id),y(!0)},onRecheckHealth:o?()=>o(e.server_id):void 0,onByokConnect:e.is_byok?()=>F(e):void 0,onOpenFillFields:()=>B(e),onDelete:(0,ts.isAdminRole)(t)?()=>{m(e.server_id),h(!0)}:void 0},e.server_id))})})]})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(LV,{accessToken:e,userRole:t})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(OD,{})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Dt,{accessToken:e})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Da,{accessToken:e})}),(0,ts.isAdminRole)(t)&&(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(LR,{accessToken:e})})]})]}),Y&&(0,_.jsx)(Do.ByokCredentialModal,{server:Y,open:!!Y,onClose:()=>F(null),onSuccess:e=>{n(),F(null)},accessToken:e||""}),(0,_.jsx)(Du,{server:en,open:!!en,accessToken:e,onClose:()=>{B(null),H(null)},onSaved:()=>{er()}})]}):(console.log("Missing required authentication parameters",{accessToken:e,userRole:t,userID:r}),(0,_.jsx)("div",{className:"p-6 text-center text-gray-500",children:"Missing required authentication parameters."}))};var Dy=e.i(934879),D_=e.i(402874),Db=e.i(152473),Dv=e.i(410160),Dj=e.i(914949),Dw=e.i(529681),Dk=function(e,t){if(!e)return null;var r={left:e.offsetLeft,right:e.parentElement.clientWidth-e.clientWidth-e.offsetLeft,width:e.clientWidth,top:e.offsetTop,bottom:e.parentElement.clientHeight-e.clientHeight-e.offsetTop,height:e.clientHeight};return t?{left:0,right:0,width:0,top:r.top,bottom:r.bottom,height:r.height}:{left:r.left,right:r.right,width:r.width,top:0,bottom:0,height:0}},DS=function(e){return void 0!==e?"".concat(e,"px"):void 0};function DN(e){var t=e.prefixCls,r=e.containerRef,a=e.value,s=e.getValueIndex,n=e.motionName,l=e.onMotionStart,i=e.onMotionEnd,o=e.direction,d=e.vertical,c=void 0!==d&&d,u=T.useRef(null),m=T.useState(a),p=(0,k_.default)(m,2),h=p[0],f=p[1],x=function(e){var a,n=s(e),l=null==(a=r.current)?void 0:a.querySelectorAll(".".concat(t,"-item"))[n];return(null==l?void 0:l.offsetParent)&&l},g=T.useState(null),y=(0,k_.default)(g,2),_=y[0],b=y[1],v=T.useState(null),j=(0,k_.default)(v,2),w=j[0],k=j[1];(0,kv.default)(function(){if(h!==a){var e=x(h),t=x(a),r=Dk(e,c),s=Dk(t,c);f(a),b(r),k(s),e&&t?l():i()}},[a]);var S=T.useMemo(function(){if(c){var e;return DS(null!=(e=null==_?void 0:_.top)?e:0)}return"rtl"===o?DS(-(null==_?void 0:_.right)):DS(null==_?void 0:_.left)},[c,o,_]),N=T.useMemo(function(){if(c){var e;return DS(null!=(e=null==w?void 0:w.top)?e:0)}return"rtl"===o?DS(-(null==w?void 0:w.right)):DS(null==w?void 0:w.left)},[c,o,w]);return _&&w?T.createElement(kS.default,{visible:!0,motionName:n,motionAppear:!0,onAppearStart:function(){return c?{transform:"translateY(var(--thumb-start-top))",height:"var(--thumb-start-height)"}:{transform:"translateX(var(--thumb-start-left))",width:"var(--thumb-start-width)"}},onAppearActive:function(){return c?{transform:"translateY(var(--thumb-active-top))",height:"var(--thumb-active-height)"}:{transform:"translateX(var(--thumb-active-left))",width:"var(--thumb-active-width)"}},onVisibleChanged:function(){b(null),k(null),i()}},function(e,r){var a=e.className,s=e.style,n=(0,ky.default)((0,ky.default)({},s),{},{"--thumb-start-left":S,"--thumb-start-width":DS(null==_?void 0:_.width),"--thumb-active-left":N,"--thumb-active-width":DS(null==w?void 0:w.width),"--thumb-start-top":S,"--thumb-start-height":DS(null==_?void 0:_.height),"--thumb-active-top":N,"--thumb-active-height":DS(null==w?void 0:w.height)}),l={ref:(0,kM.composeRef)(u,r),style:n,className:(0,j1.default)("".concat(t,"-thumb"),a)};return T.createElement("div",l)}):null}var DT=["prefixCls","direction","vertical","options","disabled","defaultValue","value","name","onChange","className","motionName"],DM=function(e){var t=e.prefixCls,r=e.className,a=e.disabled,s=e.checked,n=e.label,l=e.title,i=e.value,o=e.name,d=e.onChange,c=e.onFocus,u=e.onBlur,m=e.onKeyDown,p=e.onKeyUp,h=e.onMouseDown;return T.createElement("label",{className:(0,j1.default)(r,(0,kk.default)({},"".concat(t,"-item-disabled"),a)),onMouseDown:h},T.createElement("input",{name:o,className:"".concat(t,"-item-input"),type:"radio",disabled:a,checked:s,onChange:function(e){a||d(e,i)},onFocus:c,onBlur:u,onKeyDown:m,onKeyUp:p}),T.createElement("div",{className:"".concat(t,"-item-label"),title:l},n))},DC=T.forwardRef(function(e,t){var r,a=e.prefixCls,s=void 0===a?"rc-segmented":a,n=e.direction,l=e.vertical,i=e.options,o=void 0===i?[]:i,d=e.disabled,c=e.defaultValue,u=e.value,m=e.name,p=e.onChange,h=e.className,f=e.motionName,x=(0,kT.default)(e,DT),g=T.useRef(null),y=T.useMemo(function(){return(0,kM.composeRef)(g,t)},[g,t]),_=T.useMemo(function(){return o.map(function(e){if("object"===(0,Dv.default)(e)&&null!==e){var t=function(e){if(void 0!==e.title)return e.title;if("object"!==(0,Dv.default)(e.label)){var t;return null==(t=e.label)?void 0:t.toString()}}(e);return(0,ky.default)((0,ky.default)({},e),{},{title:t})}return{label:null==e?void 0:e.toString(),title:null==e?void 0:e.toString(),value:e}})},[o]),b=(0,Dj.default)(null==(r=_[0])?void 0:r.value,{value:u,defaultValue:c}),v=(0,k_.default)(b,2),j=v[0],w=v[1],k=T.useState(!1),S=(0,k_.default)(k,2),N=S[0],M=S[1],C=function(e,t){w(t),null==p||p(t)},L=(0,Dw.default)(x,["children"]),O=T.useState(!1),D=(0,k_.default)(O,2),P=D[0],A=D[1],E=T.useState(!1),I=(0,k_.default)(E,2),Y=I[0],F=I[1],R=function(){F(!0)},B=function(){F(!1)},z=function(){A(!1)},H=function(e){"Tab"===e.key&&A(!0)},$=function(e){var t=_.findIndex(function(e){return e.value===j}),r=_.length,a=_[(t+e+r)%r];a&&(w(a.value),null==p||p(a.value))},q=function(e){switch(e.key){case"ArrowLeft":case"ArrowUp":$(-1);break;case"ArrowRight":case"ArrowDown":$(1)}};return T.createElement("div",(0,rp.default)({role:"radiogroup","aria-label":"segmented control",tabIndex:d?void 0:0,"aria-orientation":l?"vertical":"horizontal"},L,{className:(0,j1.default)(s,(0,kk.default)((0,kk.default)((0,kk.default)({},"".concat(s,"-rtl"),"rtl"===n),"".concat(s,"-disabled"),d),"".concat(s,"-vertical"),l),void 0===h?"":h),ref:y}),T.createElement("div",{className:"".concat(s,"-group")},T.createElement(DN,{vertical:l,prefixCls:s,value:j,containerRef:g,motionName:"".concat(s,"-").concat(void 0===f?"thumb-motion":f),direction:n,getValueIndex:function(e){return _.findIndex(function(t){return t.value===e})},onMotionStart:function(){M(!0)},onMotionEnd:function(){M(!1)}}),_.map(function(e){return T.createElement(DM,(0,rp.default)({},e,{name:m,key:e.value,prefixCls:s,className:(0,j1.default)(e.className,"".concat(s,"-item"),(0,kk.default)((0,kk.default)({},"".concat(s,"-item-selected"),e.value===j&&!N),"".concat(s,"-item-focused"),Y&&P&&e.value===j)),checked:e.value===j,onChange:C,onFocus:R,onBlur:B,onKeyDown:q,onKeyUp:H,onMouseDown:z,disabled:!!d||!!e.disabled}))})))});function DL(e,t){return{[`${e}, ${e}:hover, ${e}:focus`]:{color:t.colorTextDisabled,cursor:"not-allowed"}}}function DO(e){return{background:e.itemSelectedBg,boxShadow:e.boxShadowTertiary}}let DD=Object.assign({overflow:"hidden"},j3.textEllipsis),DP=(0,j8.genStyleHooks)("Segmented",e=>{let{lineWidth:t,calc:r}=e;return(e=>{let{componentCls:t}=e,r=e.calc(e.controlHeight).sub(e.calc(e.trackPadding).mul(2)).equal(),a=e.calc(e.controlHeightLG).sub(e.calc(e.trackPadding).mul(2)).equal(),s=e.calc(e.controlHeightSM).sub(e.calc(e.trackPadding).mul(2)).equal();return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,j3.resetComponent)(e)),{display:"inline-block",padding:e.trackPadding,color:e.itemColor,background:e.trackBg,borderRadius:e.borderRadius,transition:`all ${e.motionDurationMid}`}),(0,j3.genFocusStyle)(e)),{[`${t}-group`]:{position:"relative",display:"flex",alignItems:"stretch",justifyItems:"flex-start",flexDirection:"row",width:"100%"},[`&${t}-rtl`]:{direction:"rtl"},[`&${t}-vertical`]:{[`${t}-group`]:{flexDirection:"column"},[`${t}-thumb`]:{width:"100%",height:0,padding:`0 ${(0,kq.unit)(e.paddingXXS)}`}},[`&${t}-block`]:{display:"flex"},[`&${t}-block ${t}-item`]:{flex:1,minWidth:0},[`${t}-item`]:{position:"relative",textAlign:"center",cursor:"pointer",transition:`color ${e.motionDurationMid}`,borderRadius:e.borderRadiusSM,transform:"translateZ(0)","&-selected":Object.assign(Object.assign({},DO(e)),{color:e.itemSelectedColor}),"&-focused":(0,j3.genFocusOutline)(e),"&::after":{content:'""',position:"absolute",zIndex:-1,width:"100%",height:"100%",top:0,insetInlineStart:0,borderRadius:"inherit",opacity:0,transition:`opacity ${e.motionDurationMid}, background-color ${e.motionDurationMid}`,pointerEvents:"none"},[`&:not(${t}-item-selected):not(${t}-item-disabled)`]:{"&:hover, &:active":{color:e.itemHoverColor},"&:hover::after":{opacity:1,backgroundColor:e.itemHoverBg},"&:active::after":{opacity:1,backgroundColor:e.itemActiveBg}},"&-label":Object.assign({minHeight:r,lineHeight:(0,kq.unit)(r),padding:`0 ${(0,kq.unit)(e.segmentedPaddingHorizontal)}`},DD),"&-icon + *":{marginInlineStart:e.calc(e.marginSM).div(2).equal()},"&-input":{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:0,opacity:0,pointerEvents:"none"}},[`${t}-thumb`]:Object.assign(Object.assign({},DO(e)),{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:"100%",padding:`${(0,kq.unit)(e.paddingXXS)} 0`,borderRadius:e.borderRadiusSM,[`& ~ ${t}-item:not(${t}-item-selected):not(${t}-item-disabled)::after`]:{backgroundColor:"transparent"}}),[`&${t}-lg`]:{borderRadius:e.borderRadiusLG,[`${t}-item-label`]:{minHeight:a,lineHeight:(0,kq.unit)(a),padding:`0 ${(0,kq.unit)(e.segmentedPaddingHorizontal)}`,fontSize:e.fontSizeLG},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadius}},[`&${t}-sm`]:{borderRadius:e.borderRadiusSM,[`${t}-item-label`]:{minHeight:s,lineHeight:(0,kq.unit)(s),padding:`0 ${(0,kq.unit)(e.segmentedPaddingHorizontalSM)}`},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadiusXS}}}),DL(`&-disabled ${t}-item`,e)),DL(`${t}-item-disabled`,e)),{[`${t}-thumb-motion-appear-active`]:{transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOut}, width ${e.motionDurationSlow} ${e.motionEaseInOut}`,willChange:"transform, width"},[`&${t}-shape-round`]:{borderRadius:9999,[`${t}-item, ${t}-thumb`]:{borderRadius:9999}}})}})((0,j7.mergeToken)(e,{segmentedPaddingHorizontal:r(e.controlPaddingHorizontal).sub(t).equal(),segmentedPaddingHorizontalSM:r(e.controlPaddingHorizontalSM).sub(t).equal()}))},e=>{let{colorTextLabel:t,colorText:r,colorFillSecondary:a,colorBgElevated:s,colorFill:n,lineWidthBold:l,colorBgLayout:i}=e;return{trackPadding:l,trackBg:i,itemColor:t,itemHoverColor:r,itemHoverBg:a,itemSelectedBg:s,itemActiveBg:n,itemSelectedColor:r}});var DA=function(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&0>t.indexOf(a)&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,a=Object.getOwnPropertySymbols(e);st.indexOf(a[s])&&Object.prototype.propertyIsEnumerable.call(e,a[s])&&(r[a[s]]=e[a[s]]);return r};let DE=T.forwardRef((e,t)=>{let r=(0,kI.default)(),{prefixCls:a,className:s,rootClassName:n,block:l,options:i=[],size:o="middle",style:d,vertical:c,shape:u="default",name:m=r}=e,p=DA(e,["prefixCls","className","rootClassName","block","options","size","style","vertical","shape","name"]),{getPrefixCls:h,direction:f,className:x,style:g}=(0,j4.useComponentConfig)("segmented"),y=h("segmented",a),[_,b,v]=DP(y),j=(0,Mq.default)(o),w=T.useMemo(()=>i.map(e=>{if("object"==typeof e&&(null==e?void 0:e.icon)){let{icon:t,label:r}=e;return Object.assign(Object.assign({},DA(e,["icon","label"])),{label:T.createElement(T.Fragment,null,T.createElement("span",{className:`${y}-item-icon`},t),r&&T.createElement("span",null,r))})}return e}),[i,y]),k=(0,j1.default)(s,n,x,{[`${y}-block`]:l,[`${y}-sm`]:"small"===j,[`${y}-lg`]:"large"===j,[`${y}-vertical`]:c,[`${y}-shape-${u}`]:"round"===u},b,v),S=Object.assign(Object.assign({},g),d);return _(T.createElement(DC,Object.assign({},p,{name:m,className:k,style:S,options:w,ref:t,prefixCls:y,direction:f,vertical:c})))}),DI=(0,ej.createQueryKeys)("agents"),DY=()=>{let{accessToken:e,userRole:t}=(0,k.default)();return(0,ev.useQuery)({queryKey:DI.list({}),queryFn:async()=>await (0,Q.getAgentsList)(e),enabled:!!e&&ts.all_admin_roles.includes(t||"")})},DF=(0,ej.createQueryKeys)("customers");var DR=e.i(738014),DB=e.i(621482);let Dz=(0,ej.createQueryKeys)("infiniteUsers"),DH=50;var D$=e.i(980187),Dq=["layout","type","stroke","connectNulls","isRange","ref"],DU=["key"];function DW(e){return(DW="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function DV(e,t){if(null==e)return{};var r,a,s=function(e,t){if(null==e)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function DG(){return(DG=Object.assign.bind()).apply(this,arguments)}function DK(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function DJ(e){for(var t=1;t0||!(0,uq.default)(i,a)||!(0,uq.default)(o,s))?this.renderAreaWithAnimation(e,t):this.renderAreaStatically(a,s,e,t)}},{key:"render",value:function(){var e,t=this.props,r=t.hide,a=t.dot,s=t.points,n=t.className,l=t.top,i=t.left,o=t.xAxis,d=t.yAxis,c=t.width,u=t.height,m=t.isAnimationActive,p=t.id;if(r||!s||!s.length)return null;var h=this.state.isAnimationFinished,f=1===s.length,x=(0,r7.default)("recharts-area",n),g=o&&o.allowDataOverflow,y=d&&d.allowDataOverflow,_=g||y,b=(0,as.default)(p)?this.id:p,v=null!=(e=aq(a,!1))?e:{r:3,strokeWidth:2},j=v.r,w=v.strokeWidth,k=(aH(a)?a:{}).clipDot,S=void 0===k||k,N=2*(void 0===j?3:j)+(void 0===w?2:w);return T.default.createElement(a7,{className:x},g||y?T.default.createElement("defs",null,T.default.createElement("clipPath",{id:"clipPath-".concat(b)},T.default.createElement("rect",{x:g?i:i-c/2,y:y?l:l-u/2,width:g?c:2*c,height:y?u:2*u})),!S&&T.default.createElement("clipPath",{id:"clipPath-dots-".concat(b)},T.default.createElement("rect",{x:i-N/2,y:l-N/2,width:c+N,height:u+N}))):null,f?null:this.renderArea(_,b),(a||f)&&this.renderDots(_,S,b),(!m||h)&&pX.renderCallByParent(this.props,s))}}],r=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,curBaseLine:e.baseLine,prevPoints:t.curPoints,prevBaseLine:t.curBaseLine}:e.points!==t.curPoints||e.baseLine!==t.curBaseLine?{curPoints:e.points,curBaseLine:e.baseLine}:null}}],t&&DQ(a.prototype,t),r&&DQ(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}(T.PureComponent);D1(D4,"displayName","Area"),D1(D4,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!sb.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"}),D1(D4,"getBaseValue",function(e,t,r,a){var s=e.layout,n=e.baseValue,l=t.props.baseValue,i=null!=l?l:n;if(ai(i)&&"number"==typeof i)return i;var o="horizontal"===s?a:r,d=o.scale.domain();if("number"===o.type){var c=Math.max(d[0],d[1]),u=Math.min(d[0],d[1]);return"dataMin"===i?u:"dataMax"===i||c<0?c:Math.max(Math.min(d[0],d[1]),0)}return"dataMin"===i?d[0]:"dataMax"===i?d[1]:d[0]}),D1(D4,"getComposedData",function(e){var t,r=e.props,a=e.item,s=e.xAxis,n=e.yAxis,l=e.xAxisTicks,i=e.yAxisTicks,o=e.bandSize,d=e.dataKey,c=e.stackedData,u=e.dataStartIndex,m=e.displayedData,p=e.offset,h=r.layout,f=c&&c.length,x=D4.getBaseValue(r,a,s,n),g="horizontal"===h,y=!1,_=m.map(function(e,t){f?r=c[u+t]:Array.isArray(r=mk(e,d))?y=!0:r=[x,r];var r,a=null==r[1]||f&&null==mk(e,d);return g?{x:mV({axis:s,ticks:l,bandSize:o,entry:e,index:t}),y:a?null:n.scale(r[1]),value:r,payload:e}:{x:a?null:s.scale(r[1]),y:mV({axis:n,ticks:i,bandSize:o,entry:e,index:t}),value:r,payload:e}});return t=f||y?_.map(function(e){var t=Array.isArray(e.value)?e.value[0]:null;return g?{x:e.x,y:null!=t&&null!=e.y?n.scale(t):null}:{x:null!=t?s.scale(t):null,y:e.y}}):g?n.scale(x):s.scale(x),DJ({points:_,baseLine:t,layout:h,isRange:y},p)}),D1(D4,"renderDotItem",function(e,t){var r;if(T.default.isValidElement(e))r=T.default.cloneElement(e,t);else if((0,ay.default)(e))r=e(t);else{var a=(0,r7.default)("recharts-area-dot","boolean"!=typeof e?e.className:""),s=t.key,n=DV(t,DU);r=T.default.createElement(nw,DG({},n,{key:s,className:a}))}return r});var D5=x6({chartName:"AreaChart",GraphicalChild:D4,axisComponents:[{axisType:"xAxis",AxisComp:gS},{axisType:"yAxis",AxisComp:gA}],formatAxisMap:hW}),D6=["type","layout","connectNulls","ref"],D3=["key"];function D8(e){return(D8="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function D7(e,t){if(null==e)return{};var r,a,s=function(e,t){if(null==e)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function D9(){return(D9=Object.assign.bind()).apply(this,arguments)}function Pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function Pt(e){for(var t=1;ttypeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Pa(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Pa(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pa(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=Array(t);ri){d=[].concat(Pr(s.slice(0,c)),[i-u]);break}var m=d.length%2==0?[0,o]:[o];return[].concat(Pr(a.repeat(s,l)),Pr(d),m).map(function(e){return"".concat(e,"px")}).join(", ")}),Po(e,"id",ac("recharts-line-")),Po(e,"pathRef",function(t){e.mainCurve=t}),Po(e,"handleAnimationEnd",function(){e.setState({isAnimationFinished:!0}),e.props.onAnimationEnd&&e.props.onAnimationEnd()}),Po(e,"handleAnimationStart",function(){e.setState({isAnimationFinished:!1}),e.props.onAnimationStart&&e.props.onAnimationStart()}),e}if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");return a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),e&&Pi(a,e),t=[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();this.setState({totalLength:e})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();e!==this.state.totalLength&&this.setState({totalLength:e})}}},{key:"getTotalLength",value:function(){var e=this.mainCurve;try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch(e){return 0}}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var r=this.props,a=r.points,s=r.xAxis,n=r.yAxis,l=r.layout,i=aF(r.children,mp);if(!i)return null;var o=function(e,t){return{x:e.x,y:e.y,value:e.value,errorVal:mk(e.payload,t)}};return T.default.createElement(a7,{clipPath:e?"url(#clipPath-".concat(t,")"):null},i.map(function(e){return T.default.cloneElement(e,{key:"bar-".concat(e.props.dataKey),data:a,xAxis:s,yAxis:n,layout:l,dataPointFormatter:o})}))}},{key:"renderDots",value:function(e,t,r){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var s=this.props,n=s.dot,l=s.points,i=s.dataKey,o=aq(this.props,!1),d=aq(n,!0),c=l.map(function(e,t){var r=Pt(Pt(Pt({key:"dot-".concat(t),r:3},o),d),{},{index:t,cx:e.x,cy:e.y,value:e.value,dataKey:i,payload:e.payload,points:l});return a.renderDotItem(n,r)}),u={clipPath:e?"url(#clipPath-".concat(t?"":"dots-").concat(r,")"):null};return T.default.createElement(a7,D9({className:"recharts-line-dots",key:"dots"},u),c)}},{key:"renderCurveStatically",value:function(e,t,r,a){var s=this.props,n=s.type,l=s.layout,i=s.connectNulls,o=Pt(Pt(Pt({},aq((s.ref,D7(s,D6)),!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:t?"url(#clipPath-".concat(r,")"):null,points:e},a),{},{type:n,layout:l,connectNulls:i});return T.default.createElement(xx,D9({},o,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(e,t){var r=this,a=this.props,s=a.points,n=a.strokeDasharray,l=a.isAnimationActive,i=a.animationBegin,o=a.animationDuration,d=a.animationEasing,c=a.animationId,u=a.animateNewValues,m=a.width,p=a.height,h=this.state,f=h.prevPoints,x=h.totalLength;return T.default.createElement(lD,{begin:i,duration:o,isActive:l,easing:d,from:{t:0},to:{t:1},key:"line-".concat(c),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(a){var l,i=a.t;if(f){var o=f.length/s.length,d=s.map(function(e,t){var r=Math.floor(t*o);if(f[r]){var a=f[r],s=ah(a.x,e.x),n=ah(a.y,e.y);return Pt(Pt({},e),{},{x:s(i),y:n(i)})}if(u){var l=ah(2*m,e.x),d=ah(p/2,e.y);return Pt(Pt({},e),{},{x:l(i),y:d(i)})}return Pt(Pt({},e),{},{x:e.x,y:e.y})});return r.renderCurveStatically(d,e,t)}var c=ah(0,x)(i);if(n){var h="".concat(n).split(/[,\s]+/gim).map(function(e){return parseFloat(e)});l=r.getStrokeDasharray(c,x,h)}else l=r.generateSimpleStrokeDasharray(x,c);return r.renderCurveStatically(s,e,t,{strokeDasharray:l})})}},{key:"renderCurve",value:function(e,t){var r=this.props,a=r.points,s=r.isAnimationActive,n=this.state,l=n.prevPoints,i=n.totalLength;return s&&a&&a.length&&(!l&&i>0||!(0,uq.default)(l,a))?this.renderCurveWithAnimation(e,t):this.renderCurveStatically(a,e,t)}},{key:"render",value:function(){var e,t=this.props,r=t.hide,a=t.dot,s=t.points,n=t.className,l=t.xAxis,i=t.yAxis,o=t.top,d=t.left,c=t.width,u=t.height,m=t.isAnimationActive,p=t.id;if(r||!s||!s.length)return null;var h=this.state.isAnimationFinished,f=1===s.length,x=(0,r7.default)("recharts-line",n),g=l&&l.allowDataOverflow,y=i&&i.allowDataOverflow,_=g||y,b=(0,as.default)(p)?this.id:p,v=null!=(e=aq(a,!1))?e:{r:3,strokeWidth:2},j=v.r,w=v.strokeWidth,k=(aH(a)?a:{}).clipDot,S=void 0===k||k,N=2*(void 0===j?3:j)+(void 0===w?2:w);return T.default.createElement(a7,{className:x},g||y?T.default.createElement("defs",null,T.default.createElement("clipPath",{id:"clipPath-".concat(b)},T.default.createElement("rect",{x:g?d:d-c/2,y:y?o:o-u/2,width:g?c:2*c,height:y?u:2*u})),!S&&T.default.createElement("clipPath",{id:"clipPath-dots-".concat(b)},T.default.createElement("rect",{x:d-N/2,y:o-N/2,width:c+N,height:u+N}))):null,!f&&this.renderCurve(_,b),this.renderErrorBar(_,b),(f||a)&&this.renderDots(_,S,b),(!m||h)&&pX.renderCallByParent(this.props,s))}}],r=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,prevPoints:t.curPoints}:e.points!==t.curPoints?{curPoints:e.points}:null}},{key:"repeat",value:function(e,t){for(var r=e.length%2!=0?[].concat(Pr(e),[0]):e,a=[],s=0;s{let{data:r=[],categories:a=[],index:s,stack:n=!1,colors:l=M.themeColorRange,valueFormatter:i=L.defaultValueFormatter,startEndOnly:o=!1,showXAxis:d=!0,showYAxis:c=!0,yAxisWidth:u=56,intervalType:m="equidistantPreserveStart",showAnimation:p=!1,animationDuration:h=900,showTooltip:f=!0,showLegend:x=!0,showGridLines:g=!0,showGradient:y=!0,autoMinValue:_=!1,curveType:b="linear",minValue:v,maxValue:j,connectNulls:w=!1,allowDecimals:k=!0,noDataText:S,className:O,onValueChange:D,enableLegendSlider:P=!1,customTooltip:A,rotateLabelX:E,padding:I=!d&&!c||o&&!c?{left:0,right:0}:{left:20,right:20},tickGap:Y=5,xAxisLabel:F,yAxisLabel:R}=e,B=(0,N.__rest)(e,["data","categories","index","stack","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","showAnimation","animationDuration","showTooltip","showLegend","showGridLines","showGradient","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","padding","tickGap","xAxisLabel","yAxisLabel"]),[z,H]=(0,T.useState)(60),[$,q]=(0,T.useState)(void 0),[U,W]=(0,T.useState)(void 0),V=yt(a,l),G=yr(_,v,j),K=!!D;function J(e){K&&(e===U&&!$||ys(r,e)&&$&&$.dataKey===e?(W(void 0),null==D||D(null)):(W(e),null==D||D({eventType:"category",categoryClicked:e})),q(void 0))}return T.default.createElement("div",Object.assign({ref:t,className:(0,C.tremorTwMerge)("w-full h-80",O)},B),T.default.createElement(aZ,{className:"h-full w-full"},(null==r?void 0:r.length)?T.default.createElement(D5,{data:r,onClick:K&&(U||$)?()=>{q(void 0),W(void 0),null==D||D(null)}:void 0,margin:{bottom:F?30:void 0,left:R?20:void 0,right:R?5:void 0,top:5}},g?T.default.createElement(gZ,{className:(0,C.tremorTwMerge)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,T.default.createElement(gS,{padding:I,hide:!d,dataKey:s,tick:{transform:"translate(0, 6)"},ticks:o?[r[0][s],r[r.length-1][s]]:void 0,fill:"",stroke:"",className:(0,C.tremorTwMerge)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),interval:o?"preserveStartEnd":m,tickLine:!1,axisLine:!1,minTickGap:Y,angle:null==E?void 0:E.angle,dy:null==E?void 0:E.verticalShift,height:null==E?void 0:E.xAxisHeight},F&&T.default.createElement(pI,{position:"insideBottom",offset:-20,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},F)),T.default.createElement(gA,{width:u,hide:!c,axisLine:!1,tickLine:!1,type:"number",domain:G,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,C.tremorTwMerge)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:i,allowDecimals:k},R&&T.default.createElement(pI,{position:"insideLeft",style:{textAnchor:"middle"},angle:-90,offset:-15,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},R)),T.default.createElement(sD,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:f?({active:e,payload:t,label:r})=>A?T.default.createElement(A,{payload:null==t?void 0:t.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!=(t=V.get(e.dataKey))?t:r8.BaseColors.Gray})}),active:e,label:r}):T.default.createElement(g9,{active:e,payload:t,label:r,valueFormatter:i,categoryColors:V}):T.default.createElement(T.default.Fragment,null),position:{y:0}}),x?T.default.createElement(nv,{verticalAlign:"top",height:z,content:({payload:e})=>g3({payload:e},V,H,U,K?e=>J(e):void 0,P)}):null,a.map(e=>{var t,r,a;let s=(null!=(t=V.get(e))?t:r8.BaseColors.Gray).replace("#","");return T.default.createElement("defs",{key:e},y?T.default.createElement("linearGradient",{className:(0,L.getColorClassNames)(null!=(r=V.get(e))?r:r8.BaseColors.Gray,M.colorPalette.text).textColor,id:s,x1:"0",y1:"0",x2:"0",y2:"1"},T.default.createElement("stop",{offset:"5%",stopColor:"currentColor",stopOpacity:$||U&&U!==e?.15:.4}),T.default.createElement("stop",{offset:"95%",stopColor:"currentColor",stopOpacity:0})):T.default.createElement("linearGradient",{className:(0,L.getColorClassNames)(null!=(a=V.get(e))?a:r8.BaseColors.Gray,M.colorPalette.text).textColor,id:s,x1:"0",y1:"0",x2:"0",y2:"1"},T.default.createElement("stop",{stopColor:"currentColor",stopOpacity:$||U&&U!==e?.1:.3})))}),a.map(e=>{var t,a;let s=(null!=(t=V.get(e))?t:r8.BaseColors.Gray).replace("#","");return T.default.createElement(D4,{className:(0,L.getColorClassNames)(null!=(a=V.get(e))?a:r8.BaseColors.Gray,M.colorPalette.text).strokeColor,strokeOpacity:$||U&&U!==e?.3:1,activeDot:e=>{var t;let{cx:a,cy:s,stroke:n,strokeLinecap:l,strokeLinejoin:i,strokeWidth:o,dataKey:d}=e;return T.default.createElement(nw,{className:(0,C.tremorTwMerge)("stroke-tremor-background dark:stroke-dark-tremor-background",D?"cursor-pointer":"",(0,L.getColorClassNames)(null!=(t=V.get(d))?t:r8.BaseColors.Gray,M.colorPalette.text).fillColor),cx:a,cy:s,r:5,fill:"",stroke:n,strokeLinecap:l,strokeLinejoin:i,strokeWidth:o,onClick:(t,a)=>{a.stopPropagation(),K&&(e.index===(null==$?void 0:$.index)&&e.dataKey===(null==$?void 0:$.dataKey)||ys(r,e.dataKey)&&U&&U===e.dataKey?(W(void 0),q(void 0),null==D||D(null)):(W(e.dataKey),q({index:e.index,dataKey:e.dataKey}),null==D||D(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}})},dot:t=>{var a;let{stroke:s,strokeLinecap:n,strokeLinejoin:l,strokeWidth:i,cx:o,cy:d,dataKey:c,index:u}=t;return ys(r,e)&&!($||U&&U!==e)||(null==$?void 0:$.index)===u&&(null==$?void 0:$.dataKey)===e?T.default.createElement(nw,{key:u,cx:o,cy:d,r:5,stroke:s,fill:"",strokeLinecap:n,strokeLinejoin:l,strokeWidth:i,className:(0,C.tremorTwMerge)("stroke-tremor-background dark:stroke-dark-tremor-background",D?"cursor-pointer":"",(0,L.getColorClassNames)(null!=(a=V.get(c))?a:r8.BaseColors.Gray,M.colorPalette.text).fillColor)}):T.default.createElement(T.Fragment,{key:u})},key:e,name:e,type:b,dataKey:e,stroke:"",fill:`url(#${s})`,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:p,animationDuration:h,stackId:n?"a":void 0,connectNulls:w})}),D?a.map(e=>T.default.createElement(Pc,{className:(0,C.tremorTwMerge)("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:b,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:w,onClick:(e,t)=>{t.stopPropagation();let{name:r}=e;J(r)}})):null):T.default.createElement(ye,{noDataText:S})))});Pu.displayName="AreaChart";let Pm={blue:"#3b82f6",cyan:"#06b6d4",indigo:"#6366f1",green:"#22c55e",red:"#ef4444",purple:"#8b5cf6",emerald:"#37bc7d"},Pp=({active:e,payload:t,label:r})=>e&&t&&t.length?(0,_.jsxs)("div",{className:"w-56 rounded-tremor-default border border-tremor-border bg-tremor-background p-2 text-tremor-default shadow-tremor-dropdown",children:[(0,_.jsx)("p",{className:"text-tremor-content-strong",children:r}),t.map(e=>{let t=e.dataKey?.toString();if(!t||!e.payload)return null;let r=((e,t)=>{let r=t.substring(t.indexOf(".")+1);if(e.metrics&&r in e.metrics)return e.metrics[r]})(e.payload,t),a=t.includes("spend"),s=void 0!==r?a?`$${r.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`:r.toLocaleString():"N/A",n=Pm[e.color]||e.color;return(0,_.jsxs)("div",{className:"flex items-center justify-between space-x-4",children:[(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full ring-2 ring-white drop-shadow-md",style:{backgroundColor:n}}),(0,_.jsx)("p",{className:"font-medium text-tremor-content dark:text-dark-tremor-content",children:t.replace("metrics.","").replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")})]}),(0,_.jsx)("p",{className:"font-medium text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",children:s})]},t)})]}):null,Ph=({categories:e,colors:t})=>(0,_.jsx)("div",{className:"flex items-center justify-end space-x-4",children:e.map((e,r)=>{let a=Pm[t[r]]||t[r];return(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full ring-4 ring-white",style:{backgroundColor:a}}),(0,_.jsx)("p",{className:"text-sm text-tremor-content dark:text-dark-tremor-content",children:e.replace("metrics.","").replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")})]},e)})}),Pf=[{title:"Model",dataIndex:"model",key:"model",render:e=>e||"-"},{title:"Spend (USD)",dataIndex:"spend",key:"spend",render:e=>`$${(0,rV.formatNumberWithCommas)(e,2)}`},{title:"Successful",dataIndex:"successful_requests",key:"successful_requests",render:e=>(0,_.jsx)("span",{className:"text-green-600",children:e?.toLocaleString()||0})},{title:"Failed",dataIndex:"failed_requests",key:"failed_requests",render:e=>(0,_.jsx)("span",{className:"text-red-600",children:e?.toLocaleString()||0})},{title:"Tokens",dataIndex:"tokens",key:"tokens",render:e=>e?.toLocaleString()||0}],Px=({topModels:e})=>{let[t,r]=(0,T.useState)("table");return 0===e.length?null:(0,_.jsxs)(P.Card,{className:"mt-4",children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,_.jsx)(X.Title,{children:"Model Usage"}),(0,_.jsxs)("div",{className:"flex space-x-2",children:[(0,_.jsx)("button",{onClick:()=>r("table"),className:`px-3 py-1 text-sm rounded-md ${"table"===t?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"}`,children:"Table"}),(0,_.jsx)("button",{onClick:()=>r("chart"),className:`px-3 py-1 text-sm rounded-md ${"chart"===t?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"}`,children:"Chart"})]})]}),"chart"===t?(0,_.jsx)("div",{className:"max-h-[234px] overflow-y-auto",children:(0,_.jsx)(yn,{style:{height:40*e.length},data:e.map(e=>({key:e.model,spend:e.spend})),index:"key",categories:["spend"],colors:["cyan"],valueFormatter:e=>`$${(0,rV.formatNumberWithCommas)(e,2)}`,layout:"vertical",yAxisWidth:180,tickGap:5,showLegend:!1})}):(0,_.jsx)(eK.Table,{columns:Pf,dataSource:e,rowKey:"model",size:"small",pagination:!1,scroll:e.length>5?{y:195}:void 0})]})};function Pg(e){return e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?e/1e3+"k":e.toString()}function Py(e){return 0===e?"$0":e>=1e6?"$"+e/1e6+"M":e>=1e3?"$"+e/1e3+"k":"$"+e}let P_=({modelName:e,metrics:t,hidePromptCachingMetrics:r=!1})=>(0,_.jsxs)("div",{className:"space-y-2",children:[(0,_.jsxs)(ee.Grid,{numItems:4,className:"gap-4",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Total Requests"}),(0,_.jsx)(X.Title,{children:t.total_requests.toLocaleString()})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Total Successful Requests"}),(0,_.jsx)(X.Title,{children:t.total_successful_requests.toLocaleString()})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Total Tokens"}),(0,_.jsx)(X.Title,{children:t.total_tokens.toLocaleString()}),(0,_.jsxs)(Z.Text,{children:[Math.round(t.total_tokens/t.total_successful_requests)," avg per successful request"]})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Total Spend"}),(0,_.jsxs)(X.Title,{children:["$",(0,rV.formatNumberWithCommas)(t.total_spend,2)]}),(0,_.jsxs)(Z.Text,{children:["$",(0,rV.formatNumberWithCommas)(t.total_spend/t.total_successful_requests,3)," per successful request"]})]})]}),t.top_api_keys&&t.top_api_keys.length>0&&(0,_.jsxs)(P.Card,{className:"mt-4",children:[(0,_.jsx)(X.Title,{children:"Top Virtual Keys by Spend"}),(0,_.jsx)("div",{className:"mt-3",children:(0,_.jsx)("div",{className:"grid grid-cols-1 gap-2",children:t.top_api_keys.map((e,t)=>(0,_.jsxs)("div",{className:"flex justify-between items-center p-3 bg-gray-50 rounded-lg",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:e.key_alias||`${e.api_key.substring(0,10)}...`}),e.team_id&&(0,_.jsxs)(Z.Text,{className:"text-xs text-gray-500",children:["Team: ",e.team_id]})]}),(0,_.jsxs)("div",{className:"text-right",children:[(0,_.jsxs)(Z.Text,{className:"font-medium",children:["$",(0,rV.formatNumberWithCommas)(e.spend,2)]}),(0,_.jsxs)(Z.Text,{className:"text-xs text-gray-500",children:[e.requests.toLocaleString()," requests | ",e.tokens.toLocaleString()," tokens"]})]})]},e.api_key))})})]}),t.top_models&&t.top_models.length>0&&(0,_.jsx)(Px,{topModels:t.top_models}),(0,_.jsxs)(P.Card,{className:"mt-4",children:[(0,_.jsxs)("div",{className:"flex justify-between items-center",children:[(0,_.jsx)(X.Title,{children:"Spend per day"}),(0,_.jsx)(Ph,{categories:["metrics.spend"],colors:["green"]})]}),(0,_.jsx)(yn,{className:"mt-4",data:t.daily_data,index:"date",categories:["metrics.spend"],colors:["green"],valueFormatter:e=>`$${(0,rV.formatNumberWithCommas)(e,2,!0)}`,yAxisWidth:72})]}),(0,_.jsxs)(ee.Grid,{numItems:2,className:"gap-4 mt-4",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center",children:[(0,_.jsx)(X.Title,{children:"Total Tokens"}),(0,_.jsx)(Ph,{categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"]})]}),(0,_.jsx)(Pu,{className:"mt-4",data:t.daily_data,index:"date",categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"],valueFormatter:Pg,customTooltip:Pp,showLegend:!1})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center",children:[(0,_.jsx)(X.Title,{children:"Requests per day"}),(0,_.jsx)(Ph,{categories:["metrics.api_requests"],colors:["blue"]})]}),(0,_.jsx)(yn,{className:"mt-4",data:t.daily_data,index:"date",categories:["metrics.api_requests"],colors:["blue"],valueFormatter:Pg,customTooltip:Pp,showLegend:!1})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center",children:[(0,_.jsx)(X.Title,{children:"Success vs Failed Requests"}),(0,_.jsx)(Ph,{categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"]})]}),(0,_.jsx)(Pu,{className:"mt-4",data:t.daily_data,index:"date",categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"],valueFormatter:Pg,customTooltip:Pp,showLegend:!1})]}),!r&&(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center",children:[(0,_.jsx)(X.Title,{children:"Prompt Caching Metrics"}),(0,_.jsx)(Ph,{categories:["metrics.cache_read_input_tokens","metrics.cache_creation_input_tokens"],colors:["cyan","purple"]})]}),(0,_.jsxs)("div",{className:"mb-2",children:[(0,_.jsxs)(Z.Text,{children:["Cache Read: ",t.total_cache_read_input_tokens?.toLocaleString()||0," tokens"]}),(0,_.jsxs)(Z.Text,{children:["Cache Creation: ",t.total_cache_creation_input_tokens?.toLocaleString()||0," tokens"]})]}),(0,_.jsx)(Pu,{className:"mt-4",data:t.daily_data,index:"date",categories:["metrics.cache_read_input_tokens","metrics.cache_creation_input_tokens"],colors:["cyan","purple"],valueFormatter:Pg,customTooltip:Pp,showLegend:!1})]})]})]}),Pb=({modelMetrics:e,hidePromptCachingMetrics:t=!1})=>{let r=Object.keys(e).sort((t,r)=>""===t?1:""===r?-1:e[r].total_spend-e[t].total_spend),a={total_requests:0,total_successful_requests:0,total_tokens:0,total_spend:0,total_cache_read_input_tokens:0,total_cache_creation_input_tokens:0,daily_data:{}};Object.values(e).forEach(e=>{a.total_requests+=e.total_requests,a.total_successful_requests+=e.total_successful_requests,a.total_tokens+=e.total_tokens,a.total_spend+=e.total_spend,a.total_cache_read_input_tokens+=e.total_cache_read_input_tokens||0,a.total_cache_creation_input_tokens+=e.total_cache_creation_input_tokens||0,e.daily_data.forEach(e=>{a.daily_data[e.date]||(a.daily_data[e.date]={prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,spend:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0}),a.daily_data[e.date].prompt_tokens+=e.metrics.prompt_tokens,a.daily_data[e.date].completion_tokens+=e.metrics.completion_tokens,a.daily_data[e.date].total_tokens+=e.metrics.total_tokens,a.daily_data[e.date].api_requests+=e.metrics.api_requests,a.daily_data[e.date].spend+=e.metrics.spend,a.daily_data[e.date].successful_requests+=e.metrics.successful_requests,a.daily_data[e.date].failed_requests+=e.metrics.failed_requests,a.daily_data[e.date].cache_read_input_tokens+=e.metrics.cache_read_input_tokens||0,a.daily_data[e.date].cache_creation_input_tokens+=e.metrics.cache_creation_input_tokens||0})});let s=Object.entries(a.daily_data).map(([e,t])=>({date:e,metrics:t})).sort((e,t)=>new Date(e.date).getTime()-new Date(t.date).getTime());return(0,_.jsxs)("div",{className:"space-y-8",children:[(0,_.jsxs)("div",{className:"border rounded-lg p-4",children:[(0,_.jsx)(X.Title,{children:"Overall Usage"}),(0,_.jsxs)(ee.Grid,{numItems:4,className:"gap-4 mb-4",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Total Requests"}),(0,_.jsx)(X.Title,{children:a.total_requests.toLocaleString()})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Total Successful Requests"}),(0,_.jsx)(X.Title,{children:a.total_successful_requests.toLocaleString()})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Total Tokens"}),(0,_.jsx)(X.Title,{children:a.total_tokens.toLocaleString()})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Total Spend"}),(0,_.jsxs)(X.Title,{children:["$",(0,rV.formatNumberWithCommas)(a.total_spend,2)]})]})]}),(0,_.jsxs)(ee.Grid,{numItems:2,className:"gap-4",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center",children:[(0,_.jsx)(X.Title,{children:"Total Tokens Over Time"}),(0,_.jsx)(Ph,{categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"]})]}),(0,_.jsx)(Pu,{className:"mt-4",data:s,index:"date",categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"],valueFormatter:Pg,customTooltip:Pp,showLegend:!1})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center",children:[(0,_.jsx)(X.Title,{children:"Total Requests Over Time"}),(0,_.jsx)(Ph,{categories:["metrics.successful_requests","metrics.failed_requests"],colors:["emerald","red"]})]}),(0,_.jsx)(Pu,{className:"mt-4",data:s,index:"date",categories:["metrics.successful_requests","metrics.failed_requests"],colors:["emerald","red"],valueFormatter:e=>e.toLocaleString(),customTooltip:Pp,showLegend:!1})]})]})]}),(0,_.jsx)(tl.Collapse,{defaultActiveKey:r[0],children:r.map(r=>(0,_.jsx)(tl.Collapse.Panel,{header:(0,_.jsxs)("div",{className:"flex justify-between items-center w-full",children:[(0,_.jsx)(X.Title,{children:e[r].label||"Unknown Item"}),(0,_.jsxs)("div",{className:"flex space-x-4 text-sm text-gray-500",children:[(0,_.jsxs)("span",{children:["$",(0,rV.formatNumberWithCommas)(e[r].total_spend,2)]}),(0,_.jsxs)("span",{children:[e[r].total_requests.toLocaleString()," requests"]})]})]}),children:(0,_.jsx)(P_,{modelName:r||"Unknown Model",metrics:e[r],hidePromptCachingMetrics:t})},r))})]})},Pv=(e,t,r=[])=>{let a={};return e.results.forEach(e=>{Object.entries(e.breakdown[t]||{}).forEach(([s,n])=>{a[s]||(a[s]={label:"api_keys"===t?((e,t,r)=>{let a=e.metadata.key_alias||`key-hash-${t}`,s=e.metadata.team_id;if(s){let e=(0,D$.resolveTeamAliasFromTeamID)(s,r);return e?`${a} (team: ${e})`:`${a} (team_id: ${s})`}return a})(n,s,r):"entities"===t&&(n.metadata?.agent_name||n.metadata?.team_alias)||s,total_requests:0,total_successful_requests:0,total_failed_requests:0,total_tokens:0,prompt_tokens:0,completion_tokens:0,total_spend:0,total_cache_read_input_tokens:0,total_cache_creation_input_tokens:0,top_api_keys:[],top_models:[],daily_data:[]}),a[s].total_requests+=n.metrics.api_requests,a[s].prompt_tokens+=n.metrics.prompt_tokens,a[s].completion_tokens+=n.metrics.completion_tokens,a[s].total_tokens+=n.metrics.total_tokens,a[s].total_spend+=n.metrics.spend,a[s].total_successful_requests+=n.metrics.successful_requests,a[s].total_failed_requests+=n.metrics.failed_requests,a[s].total_cache_read_input_tokens+=n.metrics.cache_read_input_tokens||0,a[s].total_cache_creation_input_tokens+=n.metrics.cache_creation_input_tokens||0,a[s].daily_data.push({date:e.date,metrics:{prompt_tokens:n.metrics.prompt_tokens,completion_tokens:n.metrics.completion_tokens,total_tokens:n.metrics.total_tokens,api_requests:n.metrics.api_requests,spend:n.metrics.spend,successful_requests:n.metrics.successful_requests,failed_requests:n.metrics.failed_requests,cache_read_input_tokens:n.metrics.cache_read_input_tokens||0,cache_creation_input_tokens:n.metrics.cache_creation_input_tokens||0}})})}),"api_keys"!==t&&Object.entries(a).forEach(([r,s])=>{let n={};e.results.forEach(e=>{let a=e.breakdown[t]?.[r];a&&"api_key_breakdown"in a&&Object.entries(a.api_key_breakdown||{}).forEach(([e,t])=>{n[e]||(n[e]={api_key:e,key_alias:t.metadata.key_alias,team_id:t.metadata.team_id,spend:0,requests:0,tokens:0}),n[e].spend+=t.metrics.spend,n[e].requests+=t.metrics.api_requests,n[e].tokens+=t.metrics.total_tokens})}),a[r].top_api_keys=Object.values(n).sort((e,t)=>t.spend-e.spend).slice(0,5)}),"api_keys"===t&&Object.entries(a).forEach(([t,r])=>{let s={};e.results.forEach(e=>{Object.entries(e.breakdown.models||{}).forEach(([e,r])=>{if(r&&"api_key_breakdown"in r){let a=r.api_key_breakdown?.[t];a&&(s[e]||(s[e]={model:e,spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0}),s[e].spend+=a.metrics.spend,s[e].requests+=a.metrics.api_requests,s[e].successful_requests+=a.metrics.successful_requests||0,s[e].failed_requests+=a.metrics.failed_requests||0,s[e].tokens+=a.metrics.total_tokens)}})}),a[t].top_models=Object.values(s).sort((e,t)=>t.spend-e.spend)}),Object.values(a).forEach(e=>{e.daily_data.sort((e,t)=>new Date(e.date).getTime()-new Date(t.date).getTime())}),a},Pj=({isOpen:e,onClose:t,accessToken:r})=>{let[a]=H.Form.useForm(),[s,n]=(0,T.useState)(!1),[l,i]=(0,T.useState)(null),[o,d]=(0,T.useState)(!1),[c,u]=(0,T.useState)("cloudzero"),[m,p]=(0,T.useState)(!1);(0,T.useEffect)(()=>{e&&r&&h()},[e,r]);let h=async()=>{d(!0);try{let e=await fetch("/cloudzero/settings",{method:"GET",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${r}`,"Content-Type":"application/json"}});if(e.ok){let t=await e.json();i(t),a.setFieldsValue({connection_id:t.connection_id})}else if(404!==e.status){let t=await e.json();J.default.fromBackend(`Failed to load existing settings: ${t.error||"Unknown error"}`)}}catch(e){console.error("Error loading CloudZero settings:",e),J.default.fromBackend("Failed to load existing settings")}finally{d(!1)}},f=async e=>{if(!r)return void J.default.fromBackend("No access token available");n(!0);try{let t=l?"/cloudzero/settings":"/cloudzero/init",a=l?"PUT":"POST",s={...e,timezone:"UTC"},n=await fetch(t,{method:a,headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify(s)}),o=await n.json();if(n.ok)return J.default.success(o.message||"CloudZero settings saved successfully"),i({api_key_masked:e.api_key.substring(0,4)+"****"+e.api_key.slice(-4),connection_id:e.connection_id,status:"configured"}),!0;return J.default.fromBackend(o.error||"Failed to save CloudZero settings"),!1}catch(e){return console.error("Error saving CloudZero settings:",e),J.default.fromBackend("Failed to save CloudZero settings"),!1}finally{n(!1)}},x=async()=>{if(!r)return void J.default.fromBackend("No access token available");p(!0);try{let e=await fetch("/cloudzero/export",{method:"POST",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify({limit:1e5,operation:"replace_hourly"})}),a=await e.json();e.ok?(J.default.success(a.message||"Export to CloudZero completed successfully"),t()):J.default.fromBackend(a.error||"Failed to export to CloudZero")}catch(e){console.error("Error exporting to CloudZero:",e),J.default.fromBackend("Failed to export to CloudZero")}finally{p(!1)}},g=async()=>{p(!0);try{J.default.info("CSV export functionality coming soon!"),t()}catch(e){console.error("Error exporting CSV:",e),J.default.fromBackend("Failed to export CSV")}finally{p(!1)}},y=async()=>{if("cloudzero"===c){if(!l){let e=await a.validateFields();if(!await f(e))return}await x()}else await g()},b=()=>{a.resetFields(),u("cloudzero"),i(null),t()},v=[{value:"cloudzero",label:(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("img",{src:"/cloudzero.png",alt:"CloudZero",className:"w-5 h-5",onError:e=>{e.target.style.display="none"}}),(0,_.jsx)("span",{children:"Export to CloudZero"})]})},{value:"csv",label:(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),(0,_.jsx)("span",{children:"Export to CSV"})]})}];return(0,_.jsx)(q.Modal,{title:"Export Data",open:e,onCancel:b,footer:null,width:600,destroyOnHidden:!0,children:(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium mb-2 block",children:"Export Destination"}),(0,_.jsx)(eE.Select,{value:c,onChange:u,options:v,className:"w-full",size:"large"})]}),"cloudzero"===c&&(0,_.jsx)("div",{children:o?(0,_.jsx)("div",{className:"flex justify-center py-8",children:(0,_.jsx)(rm.Spin,{size:"large"})}):(0,_.jsxs)(_.Fragment,{children:[l&&(0,_.jsx)(D,{title:"Existing CloudZero Configuration",icon:()=>(0,_.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),color:"green",className:"mb-4",children:(0,_.jsxs)(Z.Text,{children:["API Key: ",l.api_key_masked,(0,_.jsx)("br",{}),"Connection ID: ",l.connection_id]})}),!l&&(0,_.jsxs)(H.Form,{form:a,layout:"vertical",children:[(0,_.jsx)(H.Form.Item,{label:"CloudZero API Key",name:"api_key",rules:[{required:!0,message:"Please enter your CloudZero API key"}],children:(0,_.jsx)(et.TextInput,{type:"password",placeholder:"Enter your CloudZero API key"})}),(0,_.jsx)(H.Form.Item,{label:"Connection ID",name:"connection_id",rules:[{required:!0,message:"Please enter the CloudZero connection ID"}],children:(0,_.jsx)(et.TextInput,{placeholder:"Enter CloudZero connection ID"})})]})]})}),"csv"===c&&(0,_.jsx)(D,{title:"CSV Export",icon:()=>(0,_.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),color:"blue",children:(0,_.jsx)(Z.Text,{children:"Export your usage data as a CSV file for analysis in spreadsheet applications."})}),(0,_.jsxs)("div",{className:"flex justify-end space-x-2 pt-4",children:[(0,_.jsx)(S.Button,{variant:"secondary",onClick:b,children:"Cancel"}),(0,_.jsx)(S.Button,{onClick:y,loading:s||m,disabled:s||m,children:"cloudzero"===c?"Export to CloudZero":"Export CSV"})]})]})})},Pw=({value:e,onChange:t})=>(0,_.jsxs)("div",{children:[(0,_.jsx)("label",{className:"text-sm font-medium text-gray-700 block mb-2",children:"Format"}),(0,_.jsx)(eE.Select,{value:e,onChange:t,className:"w-full",options:[{value:"csv",label:"CSV (Excel, Google Sheets)"},{value:"json",label:"JSON (includes metadata)"}]})]}),Pk=({dateRange:e,selectedFilters:t})=>(0,_.jsxs)("div",{className:"text-sm text-gray-500",children:[e.from?.toLocaleDateString()," - ",e.to?.toLocaleDateString(),t.length>0&&` \xb7 ${t.length} filter${t.length>1?"s":""}`]}),PS=({value:e,onChange:t,entityType:r})=>(0,_.jsxs)("div",{children:[(0,_.jsx)("label",{className:"text-sm font-medium text-gray-700 block mb-2",children:"Export type"}),(0,_.jsx)(t$.Radio.Group,{value:e,onChange:e=>t(e.target.value),className:"w-full",children:(0,_.jsxs)("div",{className:"space-y-2",children:[(0,_.jsxs)("label",{className:"flex items-start p-3 border border-gray-200 rounded-lg hover:bg-gray-50 cursor-pointer transition-colors",children:[(0,_.jsx)(t$.Radio,{value:"daily",className:"mt-0.5"}),(0,_.jsxs)("div",{className:"ml-3 flex-1",children:[(0,_.jsxs)("div",{className:"font-medium text-sm",children:["Day-by-day breakdown by ",r]}),(0,_.jsxs)("div",{className:"text-xs text-gray-500 mt-0.5",children:["Daily metrics for each ",r]})]})]}),(0,_.jsxs)("label",{className:"flex items-start p-3 border border-gray-200 rounded-lg hover:bg-gray-50 cursor-pointer transition-colors",children:[(0,_.jsx)(t$.Radio,{value:"daily_with_keys",className:"mt-0.5"}),(0,_.jsxs)("div",{className:"ml-3 flex-1",children:[(0,_.jsxs)("div",{className:"font-medium text-sm",children:["Day-by-day breakdown by ",r," and key"]}),(0,_.jsxs)("div",{className:"text-xs text-gray-500 mt-0.5",children:["Daily metrics for each ",r,", split by API key"]})]})]}),(0,_.jsxs)("label",{className:"flex items-start p-3 border border-gray-200 rounded-lg hover:bg-gray-50 cursor-pointer transition-colors",children:[(0,_.jsx)(t$.Radio,{value:"daily_with_models",className:"mt-0.5"}),(0,_.jsxs)("div",{className:"ml-3 flex-1",children:[(0,_.jsxs)("div",{className:"font-medium text-sm",children:["Day-by-day by ",r," and model"]}),(0,_.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:"Daily metrics split by model"})]})]})]})})]});var PN=e.i(59935);let PT=(e,t)=>({id:e,alias:t[e]||e}),PM=["spend","api_requests","successful_requests","failed_requests","total_tokens","prompt_tokens","completion_tokens","cache_read_input_tokens","cache_creation_input_tokens"],PC=e=>{let t=e.entities;return t&&Object.keys(t).length>0?t:(e=>{let t=e.api_keys;if(!t||0===Object.keys(t).length)return{};let r={};for(let[e,a]of Object.entries(t)){let t=a?.metadata?.team_id||"Unassigned";r[t]||(r[t]={metrics:Object.fromEntries(PM.map(e=>[e,0])),api_key_breakdown:{}});let s=r[t].metrics,n=a?.metrics||{};for(let e of PM)s[e]+=n[e]||0;r[t].api_key_breakdown[e]=a}return r})(e)},PL=(e,t,r,a={})=>{switch(t){case"daily":default:return((e,t,r={})=>{let a=[];return e.results.forEach(e=>{Object.entries(PC(e.breakdown)).forEach(([s,n])=>{let{id:l,alias:i}=PT(s,r);a.push({Date:e.date,[t]:i,[`${t} ID`]:l,"Spend ($)":(0,rV.formatNumberWithCommas)(n.metrics.spend,4),Requests:n.metrics.api_requests,"Successful Requests":n.metrics.successful_requests,"Failed Requests":n.metrics.failed_requests,"Total Tokens":n.metrics.total_tokens,"Prompt Tokens":n.metrics.prompt_tokens||0,"Completion Tokens":n.metrics.completion_tokens||0})})}),a.sort((e,t)=>new Date(e.Date).getTime()-new Date(t.Date).getTime())})(e,r,a);case"daily_with_keys":return((e,t,r={})=>{let a={};return e.results.forEach(e=>{Object.entries(PC(e.breakdown)).forEach(([t,s])=>{let{id:n,alias:l}=PT(t,r);Object.entries(s.api_key_breakdown||{}).forEach(([t,r])=>{let s=r?.metadata?.key_alias||null,i=`${e.date}_${n}_${t}`;a[i]?(a[i].metrics.spend+=r.metrics?.spend||0,a[i].metrics.api_requests+=r.metrics?.api_requests||0,a[i].metrics.successful_requests+=r.metrics?.successful_requests||0,a[i].metrics.failed_requests+=r.metrics?.failed_requests||0,a[i].metrics.total_tokens+=r.metrics?.total_tokens||0,a[i].metrics.prompt_tokens+=r.metrics?.prompt_tokens||0,a[i].metrics.completion_tokens+=r.metrics?.completion_tokens||0):a[i]={Date:e.date,entityId:n,entityAlias:l,keyId:t,keyAlias:s,metrics:{spend:r.metrics?.spend||0,api_requests:r.metrics?.api_requests||0,successful_requests:r.metrics?.successful_requests||0,failed_requests:r.metrics?.failed_requests||0,total_tokens:r.metrics?.total_tokens||0,prompt_tokens:r.metrics?.prompt_tokens||0,completion_tokens:r.metrics?.completion_tokens||0}}})})}),Object.values(a).map(e=>({Date:e.Date,[t]:e.entityAlias,[`${t} ID`]:e.entityId,"Key Alias":e.keyAlias||"-","Key ID":e.keyId,"Spend ($)":(0,rV.formatNumberWithCommas)(e.metrics.spend,4),Requests:e.metrics.api_requests,"Successful Requests":e.metrics.successful_requests,"Failed Requests":e.metrics.failed_requests,"Total Tokens":e.metrics.total_tokens,"Prompt Tokens":e.metrics.prompt_tokens,"Completion Tokens":e.metrics.completion_tokens})).sort((e,t)=>new Date(e.Date).getTime()-new Date(t.Date).getTime())})(e,r,a);case"daily_with_models":return((e,t,r={})=>{let a=[];return e.results.forEach(e=>{let s={};Object.entries(PC(e.breakdown)).forEach(([t,r])=>{s[t]||(s[t]={}),Object.entries(e.breakdown.models||{}).forEach(([e,a])=>{Object.entries(r.api_key_breakdown||{}).forEach(([r,a])=>{s[t][e]||(s[t][e]={spend:0,requests:0,successful:0,failed:0,tokens:0}),s[t][e].spend+=a.metrics.spend||0,s[t][e].requests+=a.metrics.api_requests||0,s[t][e].successful+=a.metrics.successful_requests||0,s[t][e].failed+=a.metrics.failed_requests||0,s[t][e].tokens+=a.metrics.total_tokens||0})})}),Object.entries(s).forEach(([s,n])=>{let{id:l,alias:i}=PT(s,r);Object.entries(n).forEach(([r,s])=>{a.push({Date:e.date,[t]:i,[`${t} ID`]:l,Model:r,"Spend ($)":(0,rV.formatNumberWithCommas)(s.spend,4),Requests:s.requests,Successful:s.successful,Failed:s.failed,"Total Tokens":s.tokens})})})}),a.sort((e,t)=>new Date(e.Date).getTime()-new Date(t.Date).getTime())})(e,r,a)}},PO=({isOpen:e,onClose:t,entityType:r,spendData:a,dateRange:s,selectedFilters:n,customTitle:l})=>{let[i,o]=(0,T.useState)("csv"),[d,c]=(0,T.useState)("daily"),[u,m]=(0,T.useState)(!1),{data:p,isLoading:h}=(0,jY.useTeams)(),f=r.charAt(0).toUpperCase()+r.slice(1),x=l||`Export ${f} Usage`,g=(0,T.useMemo)(()=>(0,D$.createTeamAliasMap)(p),[p]),y=async e=>{let l=e||i;m(!0);try{"csv"===l?(((e,t,r,a,s={})=>{let n=PL(e,t,r,s),l=new Blob([PN.default.unparse(n)],{type:"text/csv;charset=utf-8;"}),i=window.URL.createObjectURL(l),o=document.createElement("a");o.href=i,o.download=`${a}_usage_${t}_${new Date().toISOString().split("T")[0]}.csv`,document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(i)})(a,d,f,r,g),J.default.success(`${f} usage data exported successfully as CSV`)):(((e,t,r,a,s,n,l={})=>{let i=PL(e,t,r,l),o={export_date:new Date().toISOString(),entity_type:a,date_range:{from:s.from?.toISOString(),to:s.to?.toISOString()},filters_applied:n.length>0?n:"None",export_scope:t,summary:{total_spend:e.metadata.total_spend,total_requests:e.metadata.total_api_requests,successful_requests:e.metadata.total_successful_requests,failed_requests:e.metadata.total_failed_requests,total_tokens:e.metadata.total_tokens}},d=new Blob([JSON.stringify({metadata:o,data:i},null,2)],{type:"application/json"}),c=window.URL.createObjectURL(d),u=document.createElement("a");u.href=c,u.download=`${a}_usage_${t}_${new Date().toISOString().split("T")[0]}.json`,document.body.appendChild(u),u.click(),document.body.removeChild(u),window.URL.revokeObjectURL(c)})(a,d,f,r,s,n,g),J.default.success(`${f} usage data exported successfully as JSON`)),t()}catch(e){console.error("Error exporting data:",e),J.default.fromBackend("Failed to export data")}finally{m(!1)}};return(0,_.jsx)(q.Modal,{title:(0,_.jsx)("span",{className:"text-base font-semibold",children:x}),open:e,onCancel:t,footer:null,width:480,children:(0,_.jsxs)("div",{className:"space-y-5 py-2",children:[h?(0,_.jsx)(ey.Skeleton,{active:!0}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(Pk,{dateRange:s,selectedFilters:n}),(0,_.jsx)(PS,{value:d,onChange:c,entityType:r}),(0,_.jsx)(Pw,{value:i,onChange:o})]}),h?(0,_.jsxs)("div",{className:"flex items-center justify-end gap-2 pt-4 border-t",children:[(0,_.jsx)(ey.Skeleton.Button,{active:!0}),(0,_.jsx)(ey.Skeleton.Button,{active:!0})]}):(0,_.jsxs)("div",{className:"flex items-center justify-end gap-2 pt-4 border-t",children:[(0,_.jsx)(z.Button,{variant:"outlined",onClick:t,disabled:u,children:"Cancel"}),(0,_.jsx)(z.Button,{onClick:()=>y(),loading:u||h,disabled:u||h,type:"primary",children:u?"Exporting...":`Export ${i.toUpperCase()}`})]})]})})},PD=({dateValue:e,entityType:t,spendData:r,showFilters:a=!1,filterLabel:s,filterPlaceholder:n,selectedFilters:l=[],onFiltersChange:i,filterOptions:o=[],filterMode:d="multiple",customTitle:c,compactLayout:u=!1,teams:m=[]})=>{let[p,h]=(0,T.useState)(!1);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"mb-4",children:(0,_.jsxs)("div",{className:`grid ${a&&o.length>0?"grid-cols-[1fr_auto]":"grid-cols-[auto]"} items-end gap-4`,children:[a&&o.length>0&&(0,_.jsxs)("div",{children:[s&&(0,_.jsx)(Z.Text,{className:"mb-2",children:s}),(0,_.jsx)(eE.Select,{mode:"single"===d?void 0:"multiple",style:{width:"100%"},placeholder:n,value:"single"===d?l[0]??void 0:l,onChange:e=>{"single"===d?i?.(e?[e]:[]):i?.(e)},options:o,allowClear:!0})]}),(0,_.jsx)("div",{className:"justify-self-end",children:(0,_.jsx)(S.Button,{onClick:()=>h(!0),icon:()=>(0,_.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),children:"Export Data"})})]})}),(0,_.jsx)(PO,{isOpen:p,onClose:()=>h(!1),entityType:t,spendData:r,dateRange:e,selectedFilters:l,customTitle:c,teams:m})]})};var PP=e.i(571303);let PA=({isDateChanging:e=!1})=>(0,_.jsx)("div",{className:"flex items-center justify-center h-40",children:(0,_.jsxs)("div",{className:"flex items-center justify-center gap-3",children:[(0,_.jsx)(PP.UiLoadingSpinner,{className:"size-5"}),(0,_.jsxs)("div",{className:"flex flex-col",children:[(0,_.jsx)("span",{className:"text-gray-600 text-sm font-medium",children:e?"Processing date selection...":"Loading chart data..."}),(0,_.jsx)("span",{className:"text-gray-400 text-xs mt-1",children:e?"This will only take a moment":"Fetching your data"})]})]})}),PE=T.default.forwardRef((e,t)=>{let{color:r,children:a,className:s}=e,n=(0,N.__rest)(e,["color","children","className"]);return T.default.createElement("p",Object.assign({ref:t,className:(0,C.tremorTwMerge)("font-semibold text-tremor-metric",r?(0,L.getColorClassNames)(r,M.colorPalette.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",s)},n),a)});PE.displayName="Metric";let PI=({accessToken:e,selectedTags:t,formatAbbreviatedNumber:r})=>{let a,s,n,l,[i,o]=(0,T.useState)({results:[],total_count:0,page:1,page_size:50,total_pages:0}),[d,c]=(0,T.useState)(!1),[u,m]=(0,T.useState)(1),p=async()=>{if(e){c(!0);try{let r=await (0,Q.perUserAnalyticsCall)(e,u,50,t.length>0?t:void 0);o(r)}catch(e){console.error("Failed to fetch per-user data:",e)}finally{c(!1)}}};return(0,T.useEffect)(()=>{p()},[e,t,u]),(0,_.jsxs)("div",{className:"mb-6",children:[(0,_.jsx)(X.Title,{children:"Per User Usage"}),(0,_.jsx)(yv.Subtitle,{children:"Individual developer usage metrics"}),(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)(rR.TabList,{className:"mb-6",children:[(0,_.jsx)(rY.Tab,{children:"User Details"}),(0,_.jsx)(rY.Tab,{children:"Usage Distribution"})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsxs)(A.Table,{children:[(0,_.jsx)(Y.TableHead,{children:(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(F.TableHeaderCell,{children:"User ID"}),(0,_.jsx)(F.TableHeaderCell,{children:"User Email"}),(0,_.jsx)(F.TableHeaderCell,{children:"User Agent"}),(0,_.jsx)(F.TableHeaderCell,{className:"text-right",children:"Success Generations"}),(0,_.jsx)(F.TableHeaderCell,{className:"text-right",children:"Total Tokens"}),(0,_.jsx)(F.TableHeaderCell,{className:"text-right",children:"Failed Requests"}),(0,_.jsx)(F.TableHeaderCell,{className:"text-right",children:"Total Cost"})]})}),(0,_.jsx)(E.TableBody,{children:i.results.slice(0,10).map((e,t)=>(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(I.TableCell,{children:(0,_.jsx)(Z.Text,{className:"font-medium",children:e.user_id})}),(0,_.jsx)(I.TableCell,{children:(0,_.jsx)(Z.Text,{children:e.user_email||"N/A"})}),(0,_.jsx)(I.TableCell,{children:(0,_.jsx)(Z.Text,{children:e.user_agent||"Unknown"})}),(0,_.jsx)(I.TableCell,{className:"text-right",children:(0,_.jsx)(Z.Text,{children:r(e.successful_requests)})}),(0,_.jsx)(I.TableCell,{className:"text-right",children:(0,_.jsx)(Z.Text,{children:r(e.total_tokens)})}),(0,_.jsx)(I.TableCell,{className:"text-right",children:(0,_.jsx)(Z.Text,{children:r(e.failed_requests)})}),(0,_.jsx)(I.TableCell,{className:"text-right",children:(0,_.jsxs)(Z.Text,{children:["$",r(e.spend,4)]})})]},t))})]}),i.results.length>10&&(0,_.jsxs)("div",{className:"mt-4 flex justify-between items-center",children:[(0,_.jsxs)(Z.Text,{className:"text-sm text-gray-500",children:["Showing 10 of ",i.total_count," results"]}),(0,_.jsxs)("div",{className:"flex gap-2",children:[(0,_.jsx)(S.Button,{size:"sm",variant:"secondary",onClick:()=>{u>1&&m(u-1)},disabled:1===u,children:"Previous"}),(0,_.jsx)(S.Button,{size:"sm",variant:"secondary",onClick:()=>{u=i.total_pages,children:"Next"})]})]})]}),(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsxs)("div",{className:"mb-4",children:[(0,_.jsx)(X.Title,{className:"text-lg",children:"User Usage Distribution"}),(0,_.jsx)(yv.Subtitle,{children:"Number of users by successful request frequency"})]}),(0,_.jsx)(yn,{data:(a=new Map,i.results.forEach(e=>{let t=e.user_agent||"Unknown";a.set(t,(a.get(t)||0)+1)}),s=Array.from(a.entries()).sort(([,e],[,t])=>t-e).slice(0,8).map(([e])=>e),n={"1-9 requests":{range:[1,9],agents:{}},"10-99 requests":{range:[10,99],agents:{}},"100-999 requests":{range:[100,999],agents:{}},"1K-9.9K requests":{range:[1e3,9999],agents:{}},"10K-99.9K requests":{range:[1e4,99999],agents:{}},"100K+ requests":{range:[1e5,1/0],agents:{}}},i.results.forEach(e=>{let t=e.successful_requests,r=e.user_agent||"Unknown";s.includes(r)&&Object.entries(n).forEach(([e,a])=>{t>=a.range[0]&&t<=a.range[1]&&(a.agents[r]||(a.agents[r]=0),a.agents[r]++)})}),Object.entries(n).map(([e,t])=>{let r={category:e};return s.forEach(e=>{r[e]=t.agents[e]||0}),r})),index:"category",categories:(l=new Map,i.results.forEach(e=>{let t=e.user_agent||"Unknown";l.set(t,(l.get(t)||0)+1)}),Array.from(l.entries()).sort(([,e],[,t])=>t-e).slice(0,8).map(([e])=>e)),colors:["blue","green","orange","red","purple","yellow","pink","indigo"],valueFormatter:e=>`${e} users`,yAxisWidth:80,showLegend:!0,stack:!0})]})]})]})]})},PY=({accessToken:e,userRole:t,dateValue:r,onDateChange:a})=>{let[s,n]=(0,T.useState)({results:[]}),[l,i]=(0,T.useState)({results:[]}),[o,d]=(0,T.useState)({results:[]}),[c,u]=(0,T.useState)({results:[]}),[m,p]=(0,T.useState)(""),[h,f]=(0,T.useState)([]),[x,g]=(0,T.useState)([]),[y,b]=(0,T.useState)(!1),[v,j]=(0,T.useState)(!1),[w,k]=(0,T.useState)(!1),[S,N]=(0,T.useState)(!1),[M,C]=(0,T.useState)(!1),L=new Date,O=async()=>{if(e){b(!0);try{let t=await (0,Q.tagDistinctCall)(e);f(t.results.map(e=>e.tag))}catch(e){console.error("Failed to fetch available tags:",e)}finally{b(!1)}}},D=async()=>{if(e){j(!0);try{let t=await (0,Q.tagDauCall)(e,L,m||void 0,x.length>0?x:void 0);n(t)}catch(e){console.error("Failed to fetch DAU data:",e)}finally{j(!1)}}},A=async()=>{if(e){k(!0);try{let t=await (0,Q.tagWauCall)(e,L,m||void 0,x.length>0?x:void 0);i(t)}catch(e){console.error("Failed to fetch WAU data:",e)}finally{k(!1)}}},E=async()=>{if(e){N(!0);try{let t=await (0,Q.tagMauCall)(e,L,m||void 0,x.length>0?x:void 0);d(t)}catch(e){console.error("Failed to fetch MAU data:",e)}finally{N(!1)}}},I=async()=>{if(e&&r.from&&r.to){C(!0);try{let t=await (0,Q.userAgentSummaryCall)(e,r.from,r.to,x.length>0?x:void 0);u(t)}catch(e){console.error("Failed to fetch user agent summary data:",e)}finally{C(!1)}}};(0,T.useEffect)(()=>{O()},[e]),(0,T.useEffect)(()=>{if(!e)return;let t=setTimeout(()=>{D(),A(),E()},50);return()=>clearTimeout(t)},[e,m,x]),(0,T.useEffect)(()=>{if(!r.from||!r.to)return;let e=setTimeout(()=>{I()},50);return()=>clearTimeout(e)},[e,r,x]);let Y=e=>e.startsWith("User-Agent: ")?e.replace("User-Agent: ",""):e,F=e=>Object.entries(e.reduce((e,t)=>(e[t.tag]=(e[t.tag]||0)+t.active_users,e),{})).sort(([,e],[,t])=>t-e).map(([e])=>e),R=F(s.results).slice(0,10),B=F(l.results).slice(0,10),z=F(o.results).slice(0,10),H=(()=>{let e=[],t=new Date;for(let r=6;r>=0;r--){let a=new Date(t);a.setDate(a.getDate()-r);let s={date:a.toISOString().split("T")[0]};R.forEach(e=>{s[Y(e)]=0}),e.push(s)}return s.results.forEach(t=>{let r=Y(t.tag),a=e.find(e=>e.date===t.date);a&&(a[r]=t.active_users)}),e})(),$=(()=>{let e=[];for(let t=1;t<=7;t++){let r={week:`Week ${t}`};B.forEach(e=>{r[Y(e)]=0}),e.push(r)}return l.results.forEach(t=>{let r=Y(t.tag),a=t.date.match(/Week (\d+)/);if(a){let s=`Week ${a[1]}`,n=e.find(e=>e.week===s);n&&(n[r]=t.active_users)}}),e})(),q=(()=>{let e=[];for(let t=1;t<=7;t++){let r={month:`Month ${t}`};z.forEach(e=>{r[Y(e)]=0}),e.push(r)}return o.results.forEach(t=>{let r=Y(t.tag),a=t.date.match(/Month (\d+)/);if(a){let s=`Month ${a[1]}`,n=e.find(e=>e.month===s);n&&(n[r]=t.active_users)}}),e})(),U=(e,t=0)=>{if(e>=1e8||e>=1e7)return(e/1e6).toFixed(t)+"M";if(e>=1e6)return(e/1e6).toFixed(t)+"M";if(e>=1e4)return(e/1e3).toFixed(t)+"K";if(e>=1e3)return(e/1e3).toFixed(t)+"K";else return e.toFixed(t)};return(0,_.jsxs)("div",{className:"space-y-6 mt-6",children:[(0,_.jsx)(P.Card,{children:(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsxs)("div",{className:"flex justify-between items-start",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(X.Title,{children:"Summary by User Agent"}),(0,_.jsx)(yv.Subtitle,{children:"Performance metrics for different user agents"})]}),(0,_.jsxs)("div",{className:"w-96",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium block mb-2",children:"Filter by User Agents"}),(0,_.jsx)(eE.Select,{mode:"multiple",placeholder:"All User Agents",value:x,onChange:g,style:{width:"100%"},showSearch:!0,allowClear:!0,loading:y,optionFilterProp:"label",className:"rounded-md",maxTagCount:"responsive",children:h.map(e=>{let t=Y(e),r=t.length>50?`${t.substring(0,50)}...`:t;return(0,_.jsx)(eE.Select.Option,{value:e,label:r,title:t,children:r},e)})})]})]}),M?(0,_.jsx)(PA,{isDateChanging:!1}):(0,_.jsxs)(ee.Grid,{numItems:4,className:"gap-4",children:[(c.results||[]).slice(0,4).map((e,t)=>{let r=Y(e.tag),a=r.length>15?r.substring(0,15)+"...":r;return(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(tB.Tooltip,{title:r,placement:"top",children:(0,_.jsx)(X.Title,{className:"truncate",children:a})}),(0,_.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-sm text-gray-600",children:"Success Requests"}),(0,_.jsx)(PE,{className:"text-lg",children:U(e.successful_requests)})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-sm text-gray-600",children:"Total Tokens"}),(0,_.jsx)(PE,{className:"text-lg",children:U(e.total_tokens)})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-sm text-gray-600",children:"Total Cost"}),(0,_.jsxs)(PE,{className:"text-lg",children:["$",U(e.total_spend,4)]})]})]})]},t)}),Array.from({length:Math.max(0,4-(c.results||[]).length)}).map((e,t)=>(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"No Data"}),(0,_.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-sm text-gray-600",children:"Success Requests"}),(0,_.jsx)(PE,{className:"text-lg",children:"-"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-sm text-gray-600",children:"Total Tokens"}),(0,_.jsx)(PE,{className:"text-lg",children:"-"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-sm text-gray-600",children:"Total Cost"}),(0,_.jsx)(PE,{className:"text-lg",children:"-"})]})]})]},`empty-${t}`))]})]})}),(0,_.jsx)(P.Card,{children:(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)(rR.TabList,{className:"mb-6",children:[(0,_.jsx)(rY.Tab,{children:"DAU/WAU/MAU"}),(0,_.jsx)(rY.Tab,{children:"Per User Usage (Last 30 Days)"})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsxs)("div",{className:"mb-6",children:[(0,_.jsx)(X.Title,{children:"DAU, WAU & MAU per Agent"}),(0,_.jsx)(yv.Subtitle,{children:"Active users across different time periods"})]}),(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)(rR.TabList,{className:"mb-6",children:[(0,_.jsx)(rY.Tab,{children:"DAU"}),(0,_.jsx)(rY.Tab,{children:"WAU"}),(0,_.jsx)(rY.Tab,{children:"MAU"})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsx)("div",{className:"mb-4",children:(0,_.jsx)(X.Title,{className:"text-lg",children:"Daily Active Users - Last 7 Days"})}),v?(0,_.jsx)(PA,{isDateChanging:!1}):(0,_.jsx)(yn,{data:H,index:"date",categories:R.map(Y),valueFormatter:e=>U(e),yAxisWidth:60,showLegend:!0,stack:!0})]}),(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsx)("div",{className:"mb-4",children:(0,_.jsx)(X.Title,{className:"text-lg",children:"Weekly Active Users - Last 7 Weeks"})}),w?(0,_.jsx)(PA,{isDateChanging:!1}):(0,_.jsx)(yn,{data:$,index:"week",categories:B.map(Y),valueFormatter:e=>U(e),yAxisWidth:60,showLegend:!0,stack:!0})]}),(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsx)("div",{className:"mb-4",children:(0,_.jsx)(X.Title,{className:"text-lg",children:"Monthly Active Users - Last 7 Months"})}),S?(0,_.jsx)(PA,{isDateChanging:!1}):(0,_.jsx)(yn,{data:q,index:"month",categories:z.map(Y),valueFormatter:e=>U(e),yAxisWidth:60,showLegend:!0,stack:!0})]})]})]})]}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(PI,{accessToken:e,selectedTags:x,formatAbbreviatedNumber:U})})]})]})})]})},PF=({userSpend:e,userMaxBudget:t,selectedTeam:r})=>{let{accessToken:a,userRole:s,userId:n}=(0,k.default)(),[l,i]=(0,T.useState)(null!==e?e:0),[o,d]=(0,T.useState)(r?Number((0,rV.formatNumberWithCommas)(r.max_budget,4)):null);(0,T.useEffect)(()=>{if(r)if("Default Team"===r.team_alias)d(t);else{let e=!1;if(r.team_memberships)for(let t of r.team_memberships)t.user_id===n&&"max_budget"in t.litellm_budget_table&&null!==t.litellm_budget_table.max_budget&&(d(t.litellm_budget_table.max_budget),e=!0);e||d(r.max_budget)}else d(t)},[r,t]);let[c,u]=(0,T.useState)([]);(0,T.useEffect)(()=>{let e=async()=>{if(!a||!n||!s)return};(async()=>{try{if(null===n||null===s)return;if(null!==a){let e=(await (0,Q.modelAvailableCall)(a,n,s)).data.map(e=>e.id);console.log("available_model_names:",e),u(e)}}catch(e){console.error("Error fetching user models:",e)}})(),e()},[s,a,n]),(0,T.useEffect)(()=>{null!==e&&i(e)},[e]);let m=[];r&&r.models&&(m=r.models),m&&m.includes("all-proxy-models")?(console.log("user models:",c),m=c):m&&m.includes("all-team-models")?m=r.models:m&&0===m.length&&(m=c);let p=null!==o?`$${(0,rV.formatNumberWithCommas)(Number(o),4)} limit`:"No limit",h=void 0!==l?(0,rV.formatNumberWithCommas)(l,4):null;return console.log(`spend in view user spend: ${l}`),(0,_.jsx)("div",{className:"flex items-center",children:(0,_.jsxs)("div",{className:"flex justify-between gap-x-6",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Total Spend"}),(0,_.jsxs)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:["$",h]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Max Budget"}),(0,_.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:p})]})]})})},PR=["total_spend","total_prompt_tokens","total_completion_tokens","total_tokens","total_api_requests","total_successful_requests","total_failed_requests","total_cache_read_input_tokens","total_cache_creation_input_tokens"],PB={results:[],metadata:{total_spend:0,total_prompt_tokens:0,total_completion_tokens:0,total_tokens:0,total_api_requests:0,total_successful_requests:0,total_failed_requests:0,total_cache_read_input_tokens:0,total_cache_creation_input_tokens:0,total_pages:1,has_more:!1,page:1}};function Pz({fetchFn:e,args:t,enabled:r}){let[a,s]=(0,T.useState)(PB),[n,l]=(0,T.useState)(!1),[i,o]=(0,T.useState)(!1),[d,c]=(0,T.useState)({currentPage:0,totalPages:0}),[u,m]=(0,T.useState)(!1),p=(0,T.useRef)(0),h=(0,T.useRef)(!1),f=(0,T.useRef)(null),x=(0,T.useRef)(t);x.current=t;let g=JSON.stringify(t),y=(0,T.useCallback)(()=>{h.current=!0,m(!0),o(!1),null!==f.current&&(clearTimeout(f.current),f.current=null)},[]);return(0,T.useEffect)(()=>{if(!r){s(PB),l(!1),o(!1),c({currentPage:0,totalPages:0}),m(!1);return}let t=++p.current;h.current=!1,m(!1);let a=()=>p.current!==t||h.current,n=e=>new Promise(t=>{f.current=setTimeout(()=>{f.current=null,t()},e)});return(async()=>{let t=x.current;l(!0),o(!1),c({currentPage:1,totalPages:1});try{let r=[...t.slice(0,3),1,...t.slice(3)],i=await e(...r);if(a())return;s(i);let d=i.metadata?.total_pages||1;if(c({currentPage:1,totalPages:d}),d<=1)return void l(!1);l(!1),o(!0);let u=[...i.results],m={...i.metadata};for(let r=2;r<=d;r++){if(a()||(await n(300),a()))return;let l=[...t.slice(0,3),r,...t.slice(3)],i=await e(...l);if(a())return;u=[...u,...i.results],(m=function(e,t){let r={...e};for(let a of PR)r[a]=(e[a]||0)+(t[a]||0);return r}(m,i.metadata)).total_pages=d,m.has_more=r{p.current++,null!==f.current&&(clearTimeout(f.current),f.current=null)}},[r,e,g]),{data:a,loading:n,isFetchingMore:i,progress:d,cancelled:u,cancel:y}}let PH=({endpointData:e})=>{let t=e||{},r=T.default.useMemo(()=>Object.entries(t).map(([e,t])=>({endpoint:e,"metrics.successful_requests":t.metrics.successful_requests,"metrics.failed_requests":t.metrics.failed_requests,metrics:{successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests}})),[t]);return(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center",children:[(0,_.jsx)(X.Title,{children:"Success vs Failed Requests by Endpoint"}),(0,_.jsx)(Ph,{categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"]})]}),(0,_.jsx)(yn,{className:"mt-4",data:r,index:"endpoint",categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"],valueFormatter:e=>e.toLocaleString(),customTooltip:Pp,showLegend:!1,stack:!0,yAxisWidth:60})]})};var P$=x6({chartName:"LineChart",GraphicalChild:Pc,axisComponents:[{axisType:"xAxis",AxisComp:gS},{axisType:"yAxis",AxisComp:gA}],formatAxisMap:hW});let Pq=T.default.forwardRef((e,t)=>{let{data:r=[],categories:a=[],index:s,colors:n=M.themeColorRange,valueFormatter:l=L.defaultValueFormatter,startEndOnly:i=!1,showXAxis:o=!0,showYAxis:d=!0,yAxisWidth:c=56,intervalType:u="equidistantPreserveStart",animationDuration:m=900,showAnimation:p=!1,showTooltip:h=!0,showLegend:f=!0,showGridLines:x=!0,autoMinValue:g=!1,curveType:y="linear",minValue:_,maxValue:b,connectNulls:v=!1,allowDecimals:j=!0,noDataText:w,className:k,onValueChange:S,enableLegendSlider:O=!1,customTooltip:D,rotateLabelX:P,padding:A=o||d?{left:20,right:20}:{left:0,right:0},tickGap:E=5,xAxisLabel:I,yAxisLabel:Y}=e,F=(0,N.__rest)(e,["data","categories","index","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","animationDuration","showAnimation","showTooltip","showLegend","showGridLines","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","padding","tickGap","xAxisLabel","yAxisLabel"]),[R,B]=(0,T.useState)(60),[z,H]=(0,T.useState)(void 0),[$,q]=(0,T.useState)(void 0),U=yt(a,n),W=yr(g,_,b),V=!!S;function G(e){V&&(e===$&&!z||ys(r,e)&&z&&z.dataKey===e?(q(void 0),null==S||S(null)):(q(e),null==S||S({eventType:"category",categoryClicked:e})),H(void 0))}return T.default.createElement("div",Object.assign({ref:t,className:(0,C.tremorTwMerge)("w-full h-80",k)},F),T.default.createElement(aZ,{className:"h-full w-full"},(null==r?void 0:r.length)?T.default.createElement(P$,{data:r,onClick:V&&($||z)?()=>{H(void 0),q(void 0),null==S||S(null)}:void 0,margin:{bottom:I?30:void 0,left:Y?20:void 0,right:Y?5:void 0,top:5}},x?T.default.createElement(gZ,{className:(0,C.tremorTwMerge)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,T.default.createElement(gS,{padding:A,hide:!o,dataKey:s,interval:i?"preserveStartEnd":u,tick:{transform:"translate(0, 6)"},ticks:i?[r[0][s],r[r.length-1][s]]:void 0,fill:"",stroke:"",className:(0,C.tremorTwMerge)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,minTickGap:E,angle:null==P?void 0:P.angle,dy:null==P?void 0:P.verticalShift,height:null==P?void 0:P.xAxisHeight},I&&T.default.createElement(pI,{position:"insideBottom",offset:-20,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},I)),T.default.createElement(gA,{width:c,hide:!d,axisLine:!1,tickLine:!1,type:"number",domain:W,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,C.tremorTwMerge)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:l,allowDecimals:j},Y&&T.default.createElement(pI,{position:"insideLeft",style:{textAnchor:"middle"},angle:-90,offset:-15,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},Y)),T.default.createElement(sD,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:h?({active:e,payload:t,label:r})=>D?T.default.createElement(D,{payload:null==t?void 0:t.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!=(t=U.get(e.dataKey))?t:r8.BaseColors.Gray})}),active:e,label:r}):T.default.createElement(g9,{active:e,payload:t,label:r,valueFormatter:l,categoryColors:U}):T.default.createElement(T.default.Fragment,null),position:{y:0}}),f?T.default.createElement(nv,{verticalAlign:"top",height:R,content:({payload:e})=>g3({payload:e},U,B,$,V?e=>G(e):void 0,O)}):null,a.map(e=>{var t;return T.default.createElement(Pc,{className:(0,C.tremorTwMerge)((0,L.getColorClassNames)(null!=(t=U.get(e))?t:r8.BaseColors.Gray,M.colorPalette.text).strokeColor),strokeOpacity:z||$&&$!==e?.3:1,activeDot:e=>{var t;let{cx:a,cy:s,stroke:n,strokeLinecap:l,strokeLinejoin:i,strokeWidth:o,dataKey:d}=e;return T.default.createElement(nw,{className:(0,C.tremorTwMerge)("stroke-tremor-background dark:stroke-dark-tremor-background",S?"cursor-pointer":"",(0,L.getColorClassNames)(null!=(t=U.get(d))?t:r8.BaseColors.Gray,M.colorPalette.text).fillColor),cx:a,cy:s,r:5,fill:"",stroke:n,strokeLinecap:l,strokeLinejoin:i,strokeWidth:o,onClick:(t,a)=>{a.stopPropagation(),V&&(e.index===(null==z?void 0:z.index)&&e.dataKey===(null==z?void 0:z.dataKey)||ys(r,e.dataKey)&&$&&$===e.dataKey?(q(void 0),H(void 0),null==S||S(null)):(q(e.dataKey),H({index:e.index,dataKey:e.dataKey}),null==S||S(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}})},dot:t=>{var a;let{stroke:s,strokeLinecap:n,strokeLinejoin:l,strokeWidth:i,cx:o,cy:d,dataKey:c,index:u}=t;return ys(r,e)&&!(z||$&&$!==e)||(null==z?void 0:z.index)===u&&(null==z?void 0:z.dataKey)===e?T.default.createElement(nw,{key:u,cx:o,cy:d,r:5,stroke:s,fill:"",strokeLinecap:n,strokeLinejoin:l,strokeWidth:i,className:(0,C.tremorTwMerge)("stroke-tremor-background dark:stroke-dark-tremor-background",S?"cursor-pointer":"",(0,L.getColorClassNames)(null!=(a=U.get(c))?a:r8.BaseColors.Gray,M.colorPalette.text).fillColor)}):T.default.createElement(T.Fragment,{key:u})},key:e,name:e,type:y,dataKey:e,stroke:"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:p,animationDuration:m,connectNulls:v})}),S?a.map(e=>T.default.createElement(Pc,{className:(0,C.tremorTwMerge)("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:y,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:v,onClick:(e,t)=>{t.stopPropagation();let{name:r}=e;G(r)}})):null):T.default.createElement(ye,{noDataText:w})))});Pq.displayName="LineChart";let PU=function({dailyData:e,endpointData:t}){let r=(0,T.useMemo)(()=>{var t;let r,a;return e?.results&&0!==e.results.length?(t=e.results,r=[],a=new Set,t.forEach(e=>{e.breakdown.endpoints&&Object.keys(e.breakdown.endpoints).forEach(e=>a.add(e))}),t.forEach(e=>{let t={date:new Date(e.date).toLocaleDateString("en-US",{month:"short",day:"numeric"})};a.forEach(r=>{let a=e.breakdown.endpoints?.[r];t[r]=a?.metrics.api_requests||0}),r.push(t)}),r.reverse()):[]},[e]),a=(0,T.useMemo)(()=>0===r.length?[]:Object.keys(r[0]).filter(e=>"date"!==e),[r]);return(0,_.jsxs)(P.Card,{className:"mb-6",children:[(0,_.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,_.jsx)(X.Title,{children:"Endpoint Usage Trends"})}),(0,_.jsx)(Pq,{className:"h-80",data:r,index:"date",categories:a,colors:["blue","cyan","indigo","violet","purple","fuchsia","pink","rose","red","orange"].slice(0,a.length),valueFormatter:e=>e.toLocaleString(),showLegend:!0,showGridLines:!0,yAxisWidth:60,connectNulls:!0,curveType:"natural"})]})};var PW=e.i(309821),PW=PW;let PV=({endpointData:e})=>{let t=Object.entries(e).map(([e,t])=>{var r,a;return{key:e,endpoint:e,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,api_requests:t.metrics.api_requests,total_tokens:t.metrics.total_tokens,spend:t.metrics.spend,successRate:(r=t.metrics.successful_requests,0===(a=t.metrics.api_requests)?0:r/a*100)}}),r=[{title:"Endpoint",dataIndex:"endpoint",key:"endpoint",render:e=>(0,_.jsx)("span",{className:"font-medium",children:e})},{title:"Successful / Failed",key:"requests",render:(e,t)=>{let r=t.api_requests>0?t.successful_requests/t.api_requests*100:0,a=t.api_requests>0?t.failed_requests/t.api_requests*100:0,s={"0%":"#22c55e"};return r>0&&r<100&&(s[`${r}%`]="#22c55e",s[`${r+.01}%`]="#ef4444"),s["100%"]=a>0?"#ef4444":"#22c55e",(0,_.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,_.jsx)("div",{className:"flex-1 relative",children:(0,_.jsx)(PW.default,{percent:r+a,size:"small",strokeColor:s,showInfo:!1})}),(0,_.jsxs)("div",{className:"flex items-center space-x-2 text-sm min-w-[100px]",children:[(0,_.jsx)("span",{className:"text-green-600 font-medium",children:t.successful_requests.toLocaleString()}),(0,_.jsx)("span",{className:"text-gray-400",children:"/"}),(0,_.jsx)("span",{className:"text-red-600 font-medium",children:t.failed_requests.toLocaleString()})]})]})}},{title:"Total Request",dataIndex:"api_requests",key:"api_requests",render:e=>e.toLocaleString()},{title:"Success Rate",dataIndex:"successRate",key:"successRate",render:e=>{let t=e.toFixed(2);return(0,_.jsxs)("span",{className:e>=95?"text-green-600 font-medium":e>=80?"text-yellow-600 font-medium":"text-red-600 font-medium",children:[t,"%"]})}},{title:"Total Tokens",dataIndex:"total_tokens",key:"total_tokens",render:e=>e.toLocaleString()},{title:"Spend",dataIndex:"spend",key:"spend",render:e=>`$${(0,rV.formatNumberWithCommas)(e,2)}`}];return(0,_.jsx)(eK.Table,{columns:r,dataSource:t,pagination:!1})},PG=({userSpendData:e})=>{let t=(0,T.useMemo)(()=>{let t={};return e?.results&&e.results.forEach(e=>{Object.entries(e.breakdown.endpoints||{}).forEach(([e,r])=>{t[e]||(t[e]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:r.metadata||{},api_key_breakdown:{}}),t[e].metrics.spend+=r.metrics.spend,t[e].metrics.prompt_tokens+=r.metrics.prompt_tokens,t[e].metrics.completion_tokens+=r.metrics.completion_tokens,t[e].metrics.total_tokens+=r.metrics.total_tokens,t[e].metrics.api_requests+=r.metrics.api_requests,t[e].metrics.successful_requests+=r.metrics.successful_requests||0,t[e].metrics.failed_requests+=r.metrics.failed_requests||0,t[e].metrics.cache_read_input_tokens+=r.metrics.cache_read_input_tokens||0,t[e].metrics.cache_creation_input_tokens+=r.metrics.cache_creation_input_tokens||0})}),t},[e]);return(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsx)(PV,{endpointData:t}),(0,_.jsx)(PH,{endpointData:t}),(0,_.jsx)(PU,{dailyData:e,endpointData:t})]})};var PK=e.i(214541),PJ=["points","className","baseLinePoints","connectNulls"];function PQ(){return(PQ=Object.assign.bind()).apply(this,arguments)}function PX(e){return function(e){if(Array.isArray(e))return PZ(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return PZ(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return PZ(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function PZ(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=Array(t);r0&&void 0!==arguments[0]?arguments[0]:[],t=[[]];return e.forEach(function(e){P0(e)?t[t.length-1].push(e):t[t.length-1].length>0&&t.push([])}),P0(e[0])&&t[t.length-1].push(e[0]),t[t.length-1].length<=0&&(t=t.slice(0,-1)),t},P2=function(e,t){var r=P1(e);t&&(r=[r.reduce(function(e,t){return[].concat(PX(e),PX(t))},[])]);var a=r.map(function(e){return e.reduce(function(e,t,r){return"".concat(e).concat(0===r?"M":"L").concat(t.x,",").concat(t.y)},"")}).join("");return 1===r.length?"".concat(a,"Z"):a},P4=function(e,t,r){var a=P2(e,r);return"".concat("Z"===a.slice(-1)?a.slice(0,-1):a,"L").concat(P2(t.reverse(),r).slice(1))},P5=function(e){var t=e.points,r=e.className,a=e.baseLinePoints,s=e.connectNulls,n=function(e,t){if(null==e)return{};var r,a,s=function(e,t){if(null==e)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}(e,PJ);if(!t||!t.length)return null;var l=(0,r7.default)("recharts-polygon",r);if(a&&a.length){var i=n.stroke&&"none"!==n.stroke,o=P4(t,a,s);return T.default.createElement("g",{className:l},T.default.createElement("path",PQ({},aq(n,!0),{fill:"Z"===o.slice(-1)?n.fill:"none",stroke:"none",d:o})),i?T.default.createElement("path",PQ({},aq(n,!0),{fill:"none",d:P2(t,s)})):null,i?T.default.createElement("path",PQ({},aq(n,!0),{fill:"none",d:P2(a,s)})):null)}var d=P2(t,s);return T.default.createElement("path",PQ({},aq(n,!0),{fill:"Z"===d.slice(-1)?n.fill:"none",className:l,d:d}))};function P6(e){return(P6="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P3(){return(P3=Object.assign.bind()).apply(this,arguments)}function P8(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function P7(e){for(var t=1;t1e-5?"outer"===t?"start":"end":r<-1e-5?"outer"===t?"end":"start":"middle"}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.cx,r=e.cy,a=e.radius,s=e.axisLine,n=e.axisLineType,l=P7(P7({},aq(this.props,!1)),{},{fill:"none"},aq(s,!1));if("circle"===n)return T.default.createElement(nw,P3({className:"recharts-polar-angle-axis-line"},l,{cx:t,cy:r,r:a}));var i=this.props.ticks.map(function(e){return p_(t,r,a,e.coordinate)});return T.default.createElement(P5,P3({className:"recharts-polar-angle-axis-line"},l,{points:i}))}},{key:"renderTicks",value:function(){var e=this,t=this.props,r=t.ticks,s=t.tick,n=t.tickLine,l=t.tickFormatter,i=t.stroke,o=aq(this.props,!1),d=aq(s,!1),c=P7(P7({},o),{},{fill:"none"},aq(n,!1)),u=r.map(function(t,r){var u=e.getTickLineCoord(t),m=P7(P7(P7({textAnchor:e.getTickTextAnchor(t)},o),{},{stroke:"none",fill:i},d),{},{index:r,payload:t,x:u.x2,y:u.y2});return T.default.createElement(a7,P3({className:(0,r7.default)("recharts-polar-angle-axis-tick",pS(s)),key:"tick-".concat(t.coordinate)},aM(e.props,t,r)),n&&T.default.createElement("line",P3({className:"recharts-polar-angle-axis-tick-line"},c,u)),s&&a.renderTickItem(s,m,l?l(t.value,r):t.value))});return T.default.createElement(a7,{className:"recharts-polar-angle-axis-ticks"},u)}},{key:"render",value:function(){var e=this.props,t=e.ticks,r=e.radius,a=e.axisLine;return!(r<=0)&&t&&t.length?T.default.createElement(a7,{className:(0,r7.default)("recharts-polar-angle-axis",this.props.className)},a&&this.renderAxisLine(),this.renderTicks()):null}}],r=[{key:"renderTickItem",value:function(e,t,r){return T.default.isValidElement(e)?T.default.cloneElement(e,t):(0,ay.default)(e)?e(t):T.default.createElement(iX,P3({},t,{className:"recharts-polar-angle-axis-tick-value"}),r)}}],t&&P9(a.prototype,t),r&&P9(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}(T.PureComponent);Aa(Al,"displayName","PolarAngleAxis"),Aa(Al,"axisType","angleAxis"),Aa(Al,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var Ai=e.i(419530),Ao=e.i(549673),Ad=["cx","cy","angle","ticks","axisLine"],Ac=["ticks","tick","angle","tickFormatter","stroke"];function Au(e){return(Au="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Am(){return(Am=Object.assign.bind()).apply(this,arguments)}function Ap(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function Ah(e){for(var t=1;t=0)continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Ax(e,t){for(var r=0;r0?(0,ar.default)(e,"paddingAngle",0):0;if(r){var i=ah(r.endAngle-r.startAngle,e.endAngle-e.startAngle),o=AN(AN({},e),{},{startAngle:n+l,endAngle:n+i(a)+l});s.push(o),n=o.endAngle}else{var c=ah(0,e.endAngle-e.startAngle)(a),u=AN(AN({},e),{},{startAngle:n+l,endAngle:n+c+l});s.push(u),n=u.endAngle}}),T.default.createElement(a7,null,e.renderSectorsStatically(s))})}},{key:"attachKeyboardHandlers",value:function(e){var t=this;e.onkeydown=function(e){if(!e.altKey)switch(e.key){case"ArrowLeft":var r=++t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[r].focus(),t.setState({sectorToFocus:r});break;case"ArrowRight":var a=--t.state.sectorToFocus<0?t.sectorRefs.length-1:t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[a].focus(),t.setState({sectorToFocus:a});break;case"Escape":t.sectorRefs[t.state.sectorToFocus].blur(),t.setState({sectorToFocus:0})}}}},{key:"renderSectors",value:function(){var e=this.props,t=e.sectors,r=e.isAnimationActive,a=this.state.prevSectors;return r&&t&&t.length&&(!a||!(0,uq.default)(a,t))?this.renderSectorsWithAnimation():this.renderSectorsStatically(t)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var e=this,t=this.props,r=t.hide,a=t.sectors,s=t.className,n=t.label,l=t.cx,i=t.cy,o=t.innerRadius,d=t.outerRadius,c=t.isAnimationActive,u=this.state.isAnimationFinished;if(r||!a||!a.length||!ai(l)||!ai(i)||!ai(o)||!ai(d))return null;var m=(0,r7.default)("recharts-pie",s);return T.default.createElement(a7,{tabIndex:this.props.rootTabIndex,className:m,ref:function(t){e.pieRef=t}},this.renderSectors(),n&&this.renderLabels(a),pI.renderCallByParent(this.props,null,!1),(!c||u)&&pX.renderCallByParent(this.props,a,!1))}}],r=[{key:"getDerivedStateFromProps",value:function(e,t){return t.prevIsAnimationActive!==e.isAnimationActive?{prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:[],isAnimationFinished:!0}:e.isAnimationActive&&e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:t.curSectors,isAnimationFinished:!0}:e.sectors!==t.curSectors?{curSectors:e.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(e,t){return e>t?"start":e=360?b:b-1)*c,j=l.reduce(function(e,t){var r=mk(t,_,0);return e+(ai(r)?r:0)},0);return j>0&&(t=l.map(function(e,t){var a,s=mk(e,_,0),n=mk(e,m,t),l=(ai(s)?s:0)/j,d=(a=t?r.endAngle+an(g)*c*(0!==s):o)+an(g)*((0!==s?f:0)+l*v),u=(a+d)/2,p=(x.innerRadius+x.outerRadius)/2,y=[{name:n,value:s,payload:e,dataKey:_,type:h}],b=p_(x.cx,x.cy,p,u);return r=AN(AN(AN({percent:l,cornerRadius:i,name:n,tooltipPayload:y,midAngle:u,middleRadius:p,tooltipPosition:b},e),x),{},{value:mk(e,_),startAngle:a,endAngle:d,payload:e,paddingAngle:an(g)*c})})),AN(AN({},x),{},{sectors:t,data:l})});var AA=x6({chartName:"PieChart",GraphicalChild:AP,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Al},{axisType:"radiusAxis",AxisComp:Aj}],formatAxisMap:function(e,t,r,a,s){var n=e.width,l=e.height,i=e.startAngle,o=e.endAngle,d=au(e.cx,n,n/2),c=au(e.cy,l,l/2),u=pb(n,l,r),m=au(e.innerRadius,u,0),p=au(e.outerRadius,u,.8*u);return Object.keys(t).reduce(function(e,r){var n,l=t[r],u=l.domain,h=l.reversed;if((0,as.default)(l.range))"angleAxis"===a?n=[i,o]:"radiusAxis"===a&&(n=[m,p]),h&&(n=[n[1],n[0]]);else{var f,x=function(e){if(Array.isArray(e))return e}(f=n=l.range)||function(e,t){var r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a,s,n,l,i=[],o=!0,d=!1;try{n=(r=r.call(e)).next,!1;for(;!(o=(a=n.call(r)).done)&&(i.push(a.value),2!==i.length);o=!0);}catch(e){d=!0,s=e}finally{try{if(!o&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(d)throw s}}return i}}(f,2)||function(e,t){if(e){if("string"==typeof e)return pg(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pg(e,2)}}(f,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();i=x[0],o=x[1]}var g=mR(l,s),y=g.realScaleType,_=g.scale;_.domain(u).range(n),mB(_);var b=mW(_,pf(pf({},l),{},{realScaleType:y})),v=pf(pf(pf({},l),b),{},{range:n,radius:p,realScaleType:y,scale:_,cx:d,cy:c,innerRadius:m,outerRadius:p,startAngle:i,endAngle:o});return pf(pf({},e),{},px({},r,v))},{})},defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});let AE=({active:e,payload:t,valueFormatter:r})=>{if(e&&(null==t?void 0:t[0])){let e=null==t?void 0:t[0];return T.default.createElement(g8,null,T.default.createElement("div",{className:(0,C.tremorTwMerge)("px-4 py-2")},T.default.createElement(g7,{value:r(e.value),name:e.name,color:e.payload.color})))}return null},AI=e=>{let{cx:t,cy:r,innerRadius:a,outerRadius:s,startAngle:n,endAngle:l,className:i}=e;return T.default.createElement("g",null,T.default.createElement(hi,{cx:t,cy:r,innerRadius:a,outerRadius:s,startAngle:n,endAngle:l,className:i,fill:"",opacity:.3,style:{outline:"none"}}))},AY=T.default.forwardRef((e,t)=>{let{data:r=[],category:a="value",index:s="name",colors:n=M.themeColorRange,variant:l="donut",valueFormatter:i=L.defaultValueFormatter,label:o,showLabel:d=!0,animationDuration:c=900,showAnimation:u=!1,showTooltip:m=!0,noDataText:p,onValueChange:h,customTooltip:f,className:x}=e,g=(0,N.__rest)(e,["data","category","index","colors","variant","valueFormatter","label","showLabel","animationDuration","showAnimation","showTooltip","noDataText","onValueChange","customTooltip","className"]),y="donut"==l,_=o||i((0,L.sumNumericArray)(r.map(e=>e[a]))),[b,v]=T.default.useState(void 0),j=!!h;return(0,T.useEffect)(()=>{let e=document.querySelectorAll(".recharts-pie-sector");e&&e.forEach(e=>{e.setAttribute("style","outline: none")})},[b]),T.default.createElement("div",Object.assign({ref:t,className:(0,C.tremorTwMerge)("w-full h-40",x)},g),T.default.createElement(aZ,{className:"h-full w-full"},(null==r?void 0:r.length)?T.default.createElement(AA,{onClick:j&&b?()=>{v(void 0),null==h||h(null)}:void 0,margin:{top:0,left:0,right:0,bottom:0}},d&&y?T.default.createElement("text",{className:(0,C.tremorTwMerge)("fill-tremor-content-emphasis","dark:fill-dark-tremor-content-emphasis"),x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle"},_):null,T.default.createElement(AP,{className:(0,C.tremorTwMerge)("stroke-tremor-background dark:stroke-dark-tremor-background",h?"cursor-pointer":"cursor-default"),data:r.map((e,t)=>{let r=t{var r;return f?T.default.createElement(f,{payload:null==t?void 0:t.map(e=>{var r,a,s;return Object.assign(Object.assign({},e),{color:null!=(s=null==(a=null==(r=null==t?void 0:t[0])?void 0:r.payload)?void 0:a.color)?s:r8.BaseColors.Gray})}),active:e,label:null==(r=null==t?void 0:t[0])?void 0:r.name}):T.default.createElement(AE,{active:e,payload:t,valueFormatter:i})}:T.default.createElement(T.default.Fragment,null)})):T.default.createElement(ye,{noDataText:p})))});AY.displayName="DonutChart";let{Text:AF}=V.Typography,AR=({value:e=[],onChange:t,disabled:r,organizationId:a,pageSize:s=20,placeholder:n="Search teams by alias..."})=>{let[l,i]=(0,T.useState)(""),[o,d]=(0,Db.useDebouncedState)("",{wait:300}),{data:c,fetchNextPage:u,hasNextPage:m,isFetchingNextPage:p,isLoading:h}=(0,jY.useInfiniteTeams)(s,o||void 0,a),f=(0,T.useMemo)(()=>{if(!c?.pages)return[];let e=new Set,t=[];for(let r of c.pages)for(let a of r.teams)e.has(a.team_id)||(e.add(a.team_id),t.push(a));return t},[c]);return(0,_.jsx)(eE.Select,{mode:"multiple",showSearch:!0,placeholder:n,value:e,onChange:e=>t?.(e),disabled:r,allowClear:!0,filterOption:!1,onSearch:e=>{i(e),d(e)},searchValue:l,onPopupScroll:e=>{let t=e.currentTarget;(t.scrollTop+t.clientHeight)/t.scrollHeight>=.8&&m&&!p&&u()},loading:h,notFoundContent:h?(0,_.jsx)(wo.LoadingOutlined,{spin:!0}):"No teams found",style:{width:"100%"},popupRender:e=>(0,_.jsxs)(_.Fragment,{children:[e,p&&(0,_.jsx)("div",{style:{textAlign:"center",padding:8},children:(0,_.jsx)(wo.LoadingOutlined,{spin:!0})})]}),children:f.map(e=>(0,_.jsxs)(eE.Select.Option,{value:e.team_id,children:[(0,_.jsx)("span",{className:"font-medium",children:e.team_alias})," ",(0,_.jsxs)(AF,{type:"secondary",children:["(",e.team_id,")"]})]},e.team_id))})};var AB=e.i(20147);let Az=({topKeys:e,teams:t,showTags:r=!1,topKeysLimit:a,setTopKeysLimit:s})=>{let{accessToken:n,userRole:l,userId:i,premiumUser:o}=(0,k.default)(),[d,c]=(0,T.useState)(!1),[u,m]=(0,T.useState)(null),[p,h]=(0,T.useState)(void 0),[f,x]=(0,T.useState)("table"),[g,y]=(0,T.useState)(new Set),b=async e=>{if(n)try{let t=await (0,Q.keyInfoV1Call)(n,e.api_key),r=(e=>{let{key:t,info:r}=e;return{token:t,...r}})(t);h(r),m(e.api_key),c(!0)}catch(e){console.error("Error fetching key info:",e)}},v=()=>{c(!1),m(null),h(void 0)};T.default.useEffect(()=>{let e=e=>{"Escape"===e.key&&d&&v()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[d]);let j=[{header:"Key ID",accessorKey:"api_key",cell:e=>(0,_.jsx)("div",{className:"overflow-hidden",children:(0,_.jsx)(tB.Tooltip,{title:e.getValue(),children:(0,_.jsx)(S.Button,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>b(e.row.original),children:e.getValue()?`${e.getValue().slice(0,7)}...`:"-"})})})},{header:"Key Alias",accessorKey:"key_alias",cell:e=>e.getValue()||"-"}],w={header:"Spend (USD)",accessorKey:"spend",cell:e=>{let t=e.getValue();return t>0&&t<.01?"<$0.01":`$${(0,rV.formatNumberWithCommas)(t,2)}`}},N=r?[...j,{header:"Tags",accessorKey:"tags",cell:e=>{let t=e.getValue(),r=e.row.original.api_key,a=g.has(r);if(!t||0===t.length)return"-";let s=t.sort((e,t)=>t.usage-e.usage),n=a?s:s.slice(0,2),l=t.length>2;return(0,_.jsx)("div",{className:"overflow-hidden",children:(0,_.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[n.map((e,t)=>(0,_.jsx)(tB.Tooltip,{title:(0,_.jsxs)("div",{children:[(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{className:"text-gray-300",children:"Tag Name:"})," ",e.tag]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{className:"text-gray-300",children:"Spend:"})," ",e.usage>0&&e.usage<.01?"<$0.01":`$${(0,rV.formatNumberWithCommas)(e.usage,2)}`]})]}),children:(0,_.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[e.tag.slice(0,7),"..."]})},t)),l&&(0,_.jsx)("button",{onClick:()=>{y(e=>{let t=new Set(e);return t.has(r)?t.delete(r):t.add(r),t})},className:"ml-1 p-1 hover:bg-gray-200 rounded-full transition-colors",title:a?"Show fewer tags":"Show all tags",children:a?(0,_.jsx)(jC.ChevronUpIcon,{className:"h-3 w-3 text-gray-500"}):(0,_.jsx)(jM.ChevronDownIcon,{className:"h-3 w-3 text-gray-500"})})]})})}},w]:[...j,w],M=e.map(e=>({...e,display_key_alias:e.key_alias&&e.key_alias.length>10?`${e.key_alias.slice(0,10)}...`:e.key_alias||"-"}));return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("div",{className:"mb-4 flex justify-between items-center",children:[(0,_.jsx)(DE,{options:[{label:"5",value:5},{label:"10",value:10},{label:"25",value:25},{label:"50",value:50}],value:a,onChange:e=>s(e)}),(0,_.jsxs)("div",{className:"flex space-x-2",children:[(0,_.jsx)("button",{onClick:()=>x("table"),className:`px-3 py-1 text-sm rounded-md ${"table"===f?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"}`,children:"Table View"}),(0,_.jsx)("button",{onClick:()=>x("chart"),className:`px-3 py-1 text-sm rounded-md ${"chart"===f?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"}`,children:"Chart View"})]})]}),"chart"===f?(0,_.jsx)("div",{className:"relative max-h-[600px] overflow-y-auto",children:(0,_.jsx)(yn,{className:"mt-4 cursor-pointer hover:opacity-90",style:{height:52*Math.min(M.length,a)},data:M,index:"display_key_alias",categories:["spend"],colors:["cyan"],yAxisWidth:120,tickGap:5,layout:"vertical",showLegend:!1,valueFormatter:e=>`$${(0,rV.formatNumberWithCommas)(e,2)}`,onValueChange:e=>b(e),showTooltip:!0,customTooltip:e=>{let t=e.payload?.[0]?.payload;return(0,_.jsx)("div",{className:"relative z-50 p-3 bg-black/90 shadow-lg rounded-lg text-white max-w-xs",children:(0,_.jsxs)("div",{className:"space-y-1.5",children:[(0,_.jsxs)("div",{className:"text-sm",children:[(0,_.jsx)("span",{className:"text-gray-300",children:"Key Alias: "}),(0,_.jsx)("span",{className:"font-mono text-gray-100 break-all",children:t?.key_alias})]}),(0,_.jsxs)("div",{className:"text-sm",children:[(0,_.jsx)("span",{className:"text-gray-300",children:"Key ID: "}),(0,_.jsx)("span",{className:"font-mono text-gray-100 break-all",children:t?.api_key})]}),(0,_.jsxs)("div",{className:"text-sm",children:[(0,_.jsx)("span",{className:"text-gray-300",children:"Spend: "}),(0,_.jsxs)("span",{className:"text-white font-medium",children:["$",(0,rV.formatNumberWithCommas)(t?.spend,2)]})]})]})})}})}):(0,_.jsx)("div",{className:"border rounded-lg overflow-hidden max-h-[600px] overflow-y-auto",children:(0,_.jsx)(LH.DataTable,{columns:N,data:e,renderSubComponent:()=>(0,_.jsx)(_.Fragment,{}),getRowCanExpand:()=>!1,isLoading:!1})}),d&&u&&p&&(console.log("Rendering modal with:",{isModalOpen:d,selectedKey:u,keyData:p}),(0,_.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",onClick:e=>{e.target===e.currentTarget&&v()},children:(0,_.jsxs)("div",{className:"bg-white rounded-lg shadow-xl relative w-11/12 max-w-6xl max-h-[90vh] overflow-y-auto min-h-[750px]",children:[(0,_.jsx)("button",{onClick:v,className:"absolute top-4 right-4 text-gray-500 hover:text-gray-700 focus:outline-none","aria-label":"Close",children:(0,_.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})}),(0,_.jsx)("div",{className:"p-6 h-full",children:(0,_.jsx)(AB.default,{keyId:u,onClose:v,keyData:p,teams:t})})]})}))]})};function AH({topModels:e,topModelsLimit:t,setTopModelsLimit:r}){let[a,s]=(0,T.useState)("table"),n=[{header:"Model",accessorKey:"key",cell:e=>e.getValue()||"-"},{header:"Spend (USD)",accessorKey:"spend",cell:e=>{let t=e.getValue();return`$${(0,rV.formatNumberWithCommas)(t,2)}`}},{header:"Successful",accessorKey:"successful_requests",cell:e=>(0,_.jsx)("span",{className:"text-green-600",children:e.getValue()?.toLocaleString()||0})},{header:"Failed",accessorKey:"failed_requests",cell:e=>(0,_.jsx)("span",{className:"text-red-600",children:e.getValue()?.toLocaleString()||0})},{header:"Tokens",accessorKey:"tokens",cell:e=>e.getValue()?.toLocaleString()||0}],l=e.slice(0,t);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("div",{className:"mb-4 flex justify-between items-center",children:[(0,_.jsx)(DE,{options:[{label:"5",value:5},{label:"10",value:10},{label:"25",value:25},{label:"50",value:50}],value:t,onChange:e=>r(e)}),(0,_.jsxs)("div",{className:"flex space-x-2",children:[(0,_.jsx)("button",{onClick:()=>s("table"),className:`px-3 py-1 text-sm rounded-md ${"table"===a?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"}`,children:"Table View"}),(0,_.jsx)("button",{onClick:()=>s("chart"),className:`px-3 py-1 text-sm rounded-md ${"chart"===a?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"}`,children:"Chart View"})]})]}),"chart"===a?(0,_.jsx)("div",{className:"relative max-h-[600px] overflow-y-auto",children:(0,_.jsx)(yn,{className:"mt-4 cursor-pointer hover:opacity-90",style:{height:52*Math.min(l.length,t)},data:l,index:"key",categories:["spend"],colors:["cyan"],valueFormatter:e=>`$${(0,rV.formatNumberWithCommas)(e,2)}`,layout:"vertical",yAxisWidth:200,tickGap:5,showLegend:!1})}):(0,_.jsx)("div",{className:"border rounded-lg overflow-hidden max-h-[600px] overflow-y-auto",children:(0,_.jsx)(LH.DataTable,{columns:n,data:l,renderSubComponent:()=>(0,_.jsx)(_.Fragment,{}),getRowCanExpand:()=>!1,isLoading:!1})})]})}let A$={tag:Q.tagDailyActivityCall,team:Q.teamDailyActivityCall,organization:Q.organizationDailyActivityCall,customer:Q.customerDailyActivityCall,agent:Q.agentDailyActivityCall,user:Q.userDailyActivityCall},Aq=({accessToken:e,entityType:t,entityId:r,entityList:a,dateValue:s})=>{let n,l,i,{teams:o}=(0,PK.default)(),[d,c]=(0,T.useState)([]),[u,m]=(0,T.useState)(5),[p,h]=(0,T.useState)(5),[f,x]=(0,T.useState)(5),g=(0,T.useMemo)(()=>s.from?new Date(s.from):null,[s.from]),y=(0,T.useMemo)(()=>s.to?new Date(s.to):null,[s.to]),b=(0,T.useMemo)(()=>"user"===t?d.length>0?d[0]:null:d.length>0?d:null,[t,d]),v=A$[t],j=!!e&&!!g&&!!y,{data:w,isFetchingMore:k,progress:S,cancelled:N,cancel:M}=Pz({fetchFn:v,args:[e,g,y,b],enabled:j}),{data:C,isFetchingMore:L,progress:O,cancelled:D,cancel:H}=Pz({fetchFn:Q.agentDailyActivityCall,args:[e,g,y,null],enabled:j&&"team"===t}),$=Pv(w,"models",o||[]),q=Pv(w,"api_keys",o||[]),U="team"===t?Pv(C,"entities",o||[]):{},W=()=>{let e={};return w.results.forEach(t=>{Object.entries(t.breakdown.providers||{}).forEach(([t,r])=>{e[t]||(e[t]={provider:t,spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0});try{e[t].spend+=r.metrics.spend,e[t].requests+=r.metrics.api_requests,e[t].successful_requests+=r.metrics.successful_requests,e[t].failed_requests+=r.metrics.failed_requests,e[t].tokens+=r.metrics.total_tokens}catch(e){console.error(`Error processing provider ${t}: ${e}`)}})}),Object.values(e).filter(e=>e.spend>0).sort((e,t)=>t.spend-e.spend)},V=(e,t)=>{if(a){let t=a.find(t=>t.value===e);if(t)return t.label}return t?.team_alias?t.team_alias:e},G=()=>{var e;let t={};return w.results.forEach(e=>{Object.entries(e.breakdown.entities||{}).forEach(([e,r])=>{t[e]||(t[e]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{alias:V(e,r.metadata),id:e}}),t[e].metrics.spend+=r.metrics.spend,t[e].metrics.api_requests+=r.metrics.api_requests,t[e].metrics.successful_requests+=r.metrics.successful_requests,t[e].metrics.failed_requests+=r.metrics.failed_requests,t[e].metrics.total_tokens+=r.metrics.total_tokens})}),e=Object.values(t).sort((e,t)=>t.metrics.spend-e.metrics.spend),0===d.length?e:e.filter(e=>d.includes(e.metadata.id))},K=t.charAt(0).toUpperCase()+t.slice(1);return(0,_.jsxs)("div",{style:{width:"100%"},className:"relative",children:[k&&(0,_.jsx)(B.Alert,{banner:!0,type:"warning",className:"mb-2",message:(0,_.jsxs)("div",{className:"flex items-center justify-between",children:[(0,_.jsxs)("span",{children:[(0,_.jsx)(wo.LoadingOutlined,{spin:!0,className:"mr-2"}),"Currently fetching spend data: fetched ",S.currentPage," / ",S.totalPages," pages. Charts will update periodically as data loads. Moving off of this page will stop and reset this. To continue using the UI in the meantime,"," ",(0,_.jsxs)("a",{href:window.location.href,target:"_blank",rel:"noopener noreferrer",children:["open a new tab ",(0,_.jsx)(MD.ExportOutlined,{})]}),"."]}),(0,_.jsx)(z.Button,{type:"primary",danger:!0,onClick:M,children:"Stop"})]})}),N&&(0,_.jsx)(B.Alert,{banner:!0,type:"info",className:"mb-2",message:(0,_.jsxs)("span",{children:["Showing partial data (",S.currentPage,"/",S.totalPages," pages loaded)"]})}),L&&"team"===t&&(0,_.jsx)(B.Alert,{banner:!0,type:"warning",className:"mb-2",message:(0,_.jsxs)("div",{className:"flex items-center justify-between",children:[(0,_.jsxs)("span",{children:[(0,_.jsx)(wo.LoadingOutlined,{spin:!0,className:"mr-2"}),"Currently fetching agent data: fetched ",O.currentPage," / ",O.totalPages," pages. Charts will update periodically as data loads. Moving off of this page will stop and reset this. To continue using the UI in the meantime,"," ",(0,_.jsxs)("a",{href:window.location.href,target:"_blank",rel:"noopener noreferrer",children:["open a new tab ",(0,_.jsx)(MD.ExportOutlined,{})]}),"."]}),(0,_.jsx)(z.Button,{type:"primary",danger:!0,onClick:H,children:"Stop"})]})}),D&&"team"===t&&(0,_.jsx)(B.Alert,{banner:!0,type:"info",className:"mb-2",message:(0,_.jsxs)("span",{children:["Showing partial agent data (",O.currentPage,"/",O.totalPages," pages loaded)"]})}),"team"===t&&(0,_.jsxs)("div",{className:"mb-4",children:[(0,_.jsx)(Z.Text,{className:"mb-2",children:"Filter by team"}),(0,_.jsx)(AR,{value:d,onChange:c})]}),(0,_.jsx)(PD,{dateValue:s,entityType:t,spendData:w,showFilters:"team"!==t&&null!==a&&a.length>0,filterLabel:`Filter by ${t}`,filterPlaceholder:`Select ${t} to filter...`,selectedFilters:d,onFiltersChange:c,filterOptions:(()=>{if(a)return a})()||void 0,filterMode:"user"===t?"single":"multiple",teams:o||[]}),(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)(rR.TabList,{variant:"solid",className:"mt-1",children:[(0,_.jsx)(rY.Tab,{children:"Cost"}),(0,_.jsx)(rY.Tab,{children:"agent"===t?"Request / Token Consumption":"Model Activity"}),"team"===t?(0,_.jsx)(rY.Tab,{children:"Agent Activity"}):(0,_.jsx)(_.Fragment,{}),(0,_.jsx)(rY.Tab,{children:"Key Activity"}),(0,_.jsx)(rY.Tab,{children:"Endpoint Activity"})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(ee.Grid,{numItems:2,className:"gap-2 w-full",children:[(0,_.jsx)(yl.Col,{numColSpan:2,children:(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)(X.Title,{children:[K," Spend Overview"]}),(0,_.jsxs)(ee.Grid,{numItems:5,className:"gap-4 mt-4",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Total Spend"}),(0,_.jsxs)(Z.Text,{className:"text-2xl font-bold mt-2",children:["$",(0,rV.formatNumberWithCommas)(w.metadata.total_spend,2)]})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Total Requests"}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2",children:w.metadata.total_api_requests.toLocaleString()})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Successful Requests"}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2 text-green-600",children:w.metadata.total_successful_requests.toLocaleString()})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Failed Requests"}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2 text-red-600",children:w.metadata.total_failed_requests.toLocaleString()})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Total Tokens"}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2",children:w.metadata.total_tokens.toLocaleString()})]})]})]})}),(0,_.jsx)(yl.Col,{numColSpan:2,children:(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Daily Spend"}),(0,_.jsx)(yn,{data:[...w.results].sort((e,t)=>new Date(e.date).getTime()-new Date(t.date).getTime()),index:"date",categories:["metrics.spend"],colors:["cyan"],valueFormatter:Py,yAxisWidth:100,showLegend:!1,customTooltip:({payload:e,active:t})=>{if(!t||!e?.[0])return null;let r=e[0].payload,a=Object.keys(r.breakdown.entities||{}).length;return(0,_.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,_.jsx)("p",{className:"font-bold",children:r.date}),(0,_.jsxs)("p",{className:"text-cyan-500",children:["Total Spend: $",(0,rV.formatNumberWithCommas)(r.metrics.spend,2)]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Total Requests: ",r.metrics.api_requests]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Successful: ",r.metrics.successful_requests]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Failed: ",r.metrics.failed_requests]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Total Tokens: ",r.metrics.total_tokens]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Total ",K,"s: ",a]}),(0,_.jsxs)("div",{className:"mt-2 border-t pt-2",children:[(0,_.jsxs)("p",{className:"font-semibold",children:["Spend by ",K,":"]}),Object.entries(r.breakdown.entities||{}).sort(([,e],[,t])=>{let r=e.metrics.spend;return t.metrics.spend-r}).slice(0,5).map(([e,t])=>(0,_.jsxs)("p",{className:"text-sm text-gray-600",children:[V(e,t.metadata),": $",(0,rV.formatNumberWithCommas)(t.metrics.spend,2)]},e)),a>5&&(0,_.jsxs)("p",{className:"text-sm text-gray-500 italic",children:["...and ",a-5," more"]})]})]})}})]})}),(0,_.jsx)(yl.Col,{numColSpan:2,children:(0,_.jsx)(P.Card,{children:(0,_.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,_.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,_.jsxs)(X.Title,{children:["Spend Per ",K]}),(0,_.jsx)(yv.Subtitle,{className:"text-xs",children:"Showing Top 5 by Spend"}),(0,_.jsxs)("div",{className:"flex items-center text-sm text-gray-500",children:[(0,_.jsxs)("span",{children:["Get Started by Tracking cost per ",K," "]}),(0,_.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/enterprise#spend-tracking",className:"text-blue-500 hover:text-blue-700 ml-1",children:"here"})]})]}),(0,_.jsxs)(ee.Grid,{numItems:2,className:"gap-6",children:[(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsx)(yn,{className:"mt-4 h-52",data:G().slice(0,5).map(e=>({...e,metadata:{...e.metadata,alias_display:e.metadata.alias&&e.metadata.alias.length>15?`${e.metadata.alias.slice(0,15)}...`:e.metadata.alias}})),index:"metadata.alias_display",categories:["metrics.spend"],colors:["cyan"],valueFormatter:Py,layout:"vertical",showLegend:!1,yAxisWidth:150,customTooltip:({payload:e,active:t})=>{if(!t||!e?.[0])return null;let r=e[0].payload;return(0,_.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,_.jsx)("p",{className:"font-bold",children:r.metadata.alias}),(0,_.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",(0,rV.formatNumberWithCommas)(r.metrics.spend,4)]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Requests: ",r.metrics.api_requests.toLocaleString()]}),(0,_.jsxs)("p",{className:"text-green-600",children:["Successful: ",r.metrics.successful_requests.toLocaleString()]}),(0,_.jsxs)("p",{className:"text-red-600",children:["Failed: ",r.metrics.failed_requests.toLocaleString()]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",r.metrics.total_tokens.toLocaleString()]})]})}})}),(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsx)("div",{className:"h-52 overflow-y-auto",children:(0,_.jsxs)(A.Table,{children:[(0,_.jsx)(Y.TableHead,{children:(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(F.TableHeaderCell,{children:K}),(0,_.jsx)(F.TableHeaderCell,{children:"Spend"}),(0,_.jsx)(F.TableHeaderCell,{className:"text-green-600",children:"Successful"}),(0,_.jsx)(F.TableHeaderCell,{className:"text-red-600",children:"Failed"}),(0,_.jsx)(F.TableHeaderCell,{children:"Tokens"})]})}),(0,_.jsx)(E.TableBody,{children:G().filter(e=>e.metrics.spend>0).map(e=>(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(I.TableCell,{children:e.metadata.alias}),(0,_.jsxs)(I.TableCell,{children:["$",(0,rV.formatNumberWithCommas)(e.metrics.spend,4)]}),(0,_.jsx)(I.TableCell,{className:"text-green-600",children:e.metrics.successful_requests.toLocaleString()}),(0,_.jsx)(I.TableCell,{className:"text-red-600",children:e.metrics.failed_requests.toLocaleString()}),(0,_.jsx)(I.TableCell,{children:e.metrics.total_tokens.toLocaleString()})]},e.metadata.id))})]})})})]})]})})}),(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Top Virtual Keys"}),(0,_.jsx)(Az,{topKeys:(console.log("debugTags",{spendData:w}),n={},w.results.forEach(e=>{let{breakdown:t}=e,{entities:r}=t;console.log("debugTags",{entities:r});let a=Object.keys(r).reduce((e,t)=>{let{api_key_breakdown:a}=r[t];return Object.keys(a).forEach(r=>{let s={tag:t,usage:a[r].metrics.spend};e[r]?e[r].push(s):e[r]=[s]}),e},{});console.log("debugTags",{tagDictionary:a}),Object.entries(e.breakdown.api_keys||{}).forEach(([e,t])=>{n[e]||(n[e]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{key_alias:t.metadata.key_alias,team_id:t.metadata.team_id||null,tags:a[e]||[]}},console.log("debugTags",{keySpend:n})),n[e].metrics.spend+=t.metrics.spend,n[e].metrics.prompt_tokens+=t.metrics.prompt_tokens,n[e].metrics.completion_tokens+=t.metrics.completion_tokens,n[e].metrics.total_tokens+=t.metrics.total_tokens,n[e].metrics.api_requests+=t.metrics.api_requests,n[e].metrics.successful_requests+=t.metrics.successful_requests,n[e].metrics.failed_requests+=t.metrics.failed_requests,n[e].metrics.cache_read_input_tokens+=t.metrics.cache_read_input_tokens||0,n[e].metrics.cache_creation_input_tokens+=t.metrics.cache_creation_input_tokens||0})}),Object.entries(n).map(([e,t])=>({api_key:e,key_alias:t.metadata.key_alias||"-",tags:t.metadata.tags||"-",spend:t.metrics.spend})).sort((e,t)=>t.spend-e.spend).slice(0,u)),teams:null,showTags:"tag"===t,topKeysLimit:u,setTopKeysLimit:m})]})}),(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"agent"===t?"Top Agents":"Top Models"}),(0,_.jsx)(AH,{topModels:(l={},w.results.forEach(e=>{Object.entries(e.breakdown.models||{}).forEach(([e,t])=>{l[e]||(l[e]={spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0});try{l[e].spend+=t.metrics.spend}catch(r){console.error(`Error adding spend for ${e}: ${r}, got metrics: ${JSON.stringify(t)}`)}l[e].requests+=t.metrics.api_requests,l[e].successful_requests+=t.metrics.successful_requests,l[e].failed_requests+=t.metrics.failed_requests,l[e].tokens+=t.metrics.total_tokens})}),Object.entries(l).map(([e,t])=>({key:e,...t})).sort((e,t)=>t.spend-e.spend).slice(0,p)),topModelsLimit:p,setTopModelsLimit:h})]})}),"team"===t&&(0,_.jsx)(yl.Col,{numColSpan:2,children:(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Top Agents Driving Spend"}),(0,_.jsx)(AH,{topModels:(i={},C.results.forEach(e=>{Object.entries(e.breakdown.entities||{}).forEach(([e,t])=>{i[e]||(i[e]={spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0,agent_name:t.metadata?.agent_name||e}),i[e].spend+=t.metrics.spend,i[e].requests+=t.metrics.api_requests,i[e].successful_requests+=t.metrics.successful_requests,i[e].failed_requests+=t.metrics.failed_requests,i[e].tokens+=t.metrics.total_tokens})}),Object.entries(i).map(([e,t])=>({key:t.agent_name,...t})).sort((e,t)=>t.spend-e.spend).slice(0,f)),topModelsLimit:f,setTopModelsLimit:x})]})}),(0,_.jsx)(yl.Col,{numColSpan:2,children:(0,_.jsx)(P.Card,{children:(0,_.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,_.jsx)(X.Title,{children:"Provider Usage"}),(0,_.jsxs)(ee.Grid,{numItems:2,children:[(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsx)(AY,{className:"mt-4 h-40",data:W(),index:"provider",category:"spend",valueFormatter:e=>`$${(0,rV.formatNumberWithCommas)(e,2)}`,colors:["cyan","blue","indigo","violet","purple"]})}),(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsxs)(A.Table,{children:[(0,_.jsx)(Y.TableHead,{children:(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(F.TableHeaderCell,{children:"Provider"}),(0,_.jsx)(F.TableHeaderCell,{children:"Spend"}),(0,_.jsx)(F.TableHeaderCell,{className:"text-green-600",children:"Successful"}),(0,_.jsx)(F.TableHeaderCell,{className:"text-red-600",children:"Failed"}),(0,_.jsx)(F.TableHeaderCell,{children:"Tokens"})]})}),(0,_.jsx)(E.TableBody,{children:W().map(e=>(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(I.TableCell,{children:(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[e.provider&&(0,_.jsx)("img",{src:(0,j$.getProviderLogoAndName)(e.provider).logo,alt:`${e.provider} logo`,className:"w-4 h-4",onError:t=>{let r=t.target,a=r.parentElement;if(a){let t=document.createElement("div");t.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",t.textContent=e.provider?.charAt(0)||"-",a.replaceChild(t,r)}}}),(0,_.jsx)("span",{children:e.provider})]})}),(0,_.jsxs)(I.TableCell,{children:["$",(0,rV.formatNumberWithCommas)(e.spend,2)]}),(0,_.jsx)(I.TableCell,{className:"text-green-600",children:e.successful_requests.toLocaleString()}),(0,_.jsx)(I.TableCell,{className:"text-red-600",children:e.failed_requests.toLocaleString()}),(0,_.jsx)(I.TableCell,{children:e.tokens.toLocaleString()})]},e.provider))})]})})]})]})})})]})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Pb,{modelMetrics:$,hidePromptCachingMetrics:"agent"===t})}),"team"===t?(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Pb,{modelMetrics:U})}):(0,_.jsx)(_.Fragment,{}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Pb,{modelMetrics:q,hidePromptCachingMetrics:"agent"===t})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(PG,{userSpendData:w})})]})]})]})},AU=({loading:e,isDateChanging:t,providerSpend:r})=>{let[a,s]=(0,T.useState)(!1),[n,l]=(0,T.useState)(!1),i=r.filter(e=>e.provider?.toLowerCase()==="unknown"?n:!!a||e.spend>0);return(0,_.jsxs)(P.Card,{className:"h-full",children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,_.jsx)(X.Title,{children:"Spend by Provider"}),(0,_.jsxs)("div",{className:"flex items-center gap-4",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("label",{className:"text-sm text-gray-700",children:"Show Zero Spend"}),(0,_.jsx)(wL.Switch,{checked:a,onChange:s})]}),(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsxs)("div",{className:"flex items-center gap-1",children:[(0,_.jsx)("label",{className:"text-sm text-gray-700",children:"Show Unknown"}),(0,_.jsx)(tB.Tooltip,{title:"Requests that failed to route to a provider",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"text-gray-400 hover:text-gray-600"})})]}),(0,_.jsx)(wL.Switch,{checked:n,onChange:l})]})]})]}),e?(0,_.jsx)(PA,{isDateChanging:t}):(0,_.jsxs)(ee.Grid,{numItems:2,children:[(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsx)(AY,{className:"mt-4 h-40",data:i,index:"provider",category:"spend",valueFormatter:e=>`$${(0,rV.formatNumberWithCommas)(e,2)}`,colors:["cyan"]})}),(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsxs)(A.Table,{children:[(0,_.jsx)(Y.TableHead,{children:(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(F.TableHeaderCell,{children:"Provider"}),(0,_.jsx)(F.TableHeaderCell,{children:"Spend"}),(0,_.jsx)(F.TableHeaderCell,{className:"text-green-600",children:"Successful"}),(0,_.jsx)(F.TableHeaderCell,{className:"text-red-600",children:"Failed"}),(0,_.jsx)(F.TableHeaderCell,{children:"Tokens"})]})}),(0,_.jsx)(E.TableBody,{children:i.map(e=>(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(I.TableCell,{children:(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[e.provider&&(0,_.jsx)(wY.ProviderLogo,{provider:e.provider,className:"w-4 h-4"}),(0,_.jsx)("span",{children:e.provider})]})}),(0,_.jsxs)(I.TableCell,{children:["$",(0,rV.formatNumberWithCommas)(e.spend,2)]}),(0,_.jsx)(I.TableCell,{className:"text-green-600",children:e.successful_requests.toLocaleString()}),(0,_.jsx)(I.TableCell,{className:"text-red-600",children:e.failed_requests.toLocaleString()}),(0,_.jsx)(I.TableCell,{children:e.tokens.toLocaleString()})]},e.provider))})]})})]})]})};var AW=e.i(918789);let{TextArea:AV}=$.Input,AG={get_usage_data:"📊",get_team_usage_data:"👥",get_tag_usage_data:"🏷️"},AK=({step:e})=>{let t=AG[e.tool_name]||"🔧",r=e.arguments,a=r.start_date&&r.end_date?`${r.start_date} → ${r.end_date}`:"",s=r.team_ids||r.tags||r.user_id||"";return(0,_.jsxs)("div",{className:"flex items-start gap-2 px-3 py-2 rounded-lg bg-gray-100 border border-gray-200 text-xs",children:[(0,_.jsx)("span",{className:"flex-shrink-0 mt-0.5",children:"running"===e.status?(0,_.jsx)(rm.Spin,{size:"small"}):"error"===e.status?(0,_.jsx)("span",{className:"text-red-500",children:"✗"}):(0,_.jsx)("span",{className:"text-green-600",children:"✓"})}),(0,_.jsxs)("div",{className:"min-w-0",children:[(0,_.jsxs)("div",{className:"font-medium text-gray-700",children:[t," ",e.tool_label]}),a&&(0,_.jsx)("div",{className:"text-gray-500 mt-0.5",children:a}),s&&(0,_.jsxs)("div",{className:"text-gray-500 mt-0.5",children:["Filter: ",s]}),"error"===e.status&&e.error&&(0,_.jsx)("div",{className:"text-red-600 mt-0.5",children:e.error})]})]})},AJ=({content:e})=>(0,_.jsx)(AW.default,{components:{p:({children:e})=>(0,_.jsx)("p",{className:"mb-2 last:mb-0",children:e}),strong:({children:e})=>(0,_.jsx)("strong",{className:"font-semibold",children:e}),ul:({children:e})=>(0,_.jsx)("ul",{className:"list-disc pl-4 mb-2 space-y-0.5",children:e}),ol:({children:e})=>(0,_.jsx)("ol",{className:"list-decimal pl-4 mb-2 space-y-0.5",children:e}),li:({children:e})=>(0,_.jsx)("li",{children:e}),h1:({children:e})=>(0,_.jsx)("h4",{className:"font-semibold text-sm mt-2 mb-1",children:e}),h2:({children:e})=>(0,_.jsx)("h4",{className:"font-semibold text-sm mt-2 mb-1",children:e}),h3:({children:e})=>(0,_.jsx)("h4",{className:"font-semibold text-sm mt-2 mb-1",children:e}),code:({children:e,className:t})=>t?.includes("language-")?(0,_.jsx)("pre",{className:"bg-gray-100 rounded p-2 my-1 overflow-x-auto text-xs",children:(0,_.jsx)("code",{children:e})}):(0,_.jsx)("code",{className:"px-1 py-0.5 rounded bg-gray-100 text-xs font-mono",children:e}),table:({children:e})=>(0,_.jsx)("div",{className:"overflow-x-auto my-2",children:(0,_.jsx)("table",{className:"text-xs border-collapse w-full",children:e})}),th:({children:e})=>(0,_.jsx)("th",{className:"border border-gray-200 px-2 py-1 bg-gray-50 font-medium text-left",children:e}),td:({children:e})=>(0,_.jsx)("td",{className:"border border-gray-200 px-2 py-1",children:e})},children:e}),AQ=({open:e,onClose:t,accessToken:r})=>{let[a,s]=(0,T.useState)([]),[n,l]=(0,T.useState)(""),[i,o]=(0,T.useState)(!1),[d,c]=(0,T.useState)(void 0),[u,m]=(0,T.useState)([]),[p,h]=(0,T.useState)(!1),[f,x]=(0,T.useState)(""),[g,y]=(0,T.useState)(null),[b,v]=(0,T.useState)([]),j=(0,T.useRef)(null),w=(0,T.useRef)(null);(0,T.useEffect)(()=>{e&&0===u.length&&k()},[e]),(0,T.useEffect)(()=>{"function"==typeof j.current?.scrollIntoView&&j.current.scrollIntoView({behavior:"smooth"})},[a,f,b,g]);let k=async()=>{if(r){h(!0);try{let e=await (0,Q.modelHubCall)(r);if(e?.data?.length>0){let t=e.data.map(e=>e.model_group).sort();m(t)}}catch(e){console.error("Failed to load models:",e)}finally{h(!1)}}},S=async()=>{if(!r||!n.trim()||i)return;let e=[...a,{role:"user",content:n.trim()}];s(e),l(""),o(!0),x(""),y(null),v([]);let t=new AbortController;w.current=t;let c="",u=[];try{await (0,Q.usageAiChatStream)(r,e.slice(-20).map(e=>({role:e.role,content:e.content})),d||"",e=>{y(null),c+=e,x(c)},()=>{y(null),v([]),s(e=>[...e,{role:"assistant",content:c,toolCalls:u.length>0?[...u]:void 0}]),x("")},e=>{y(null),v([]),s(t=>[...t,{role:"assistant",content:`Error: ${e}`}]),x("")},e=>{y(e)},e=>{let t=u.findIndex(t=>t.tool_name===e.tool_name);t>=0?u[t]={...e}:u.push({...e}),v([...u])},t.signal)}catch(r){if(r?.name==="AbortError"||t.signal.aborted)return;let e=r?.message||"Failed to get response. Please try again.";s(t=>[...t,{role:"assistant",content:`Error: ${e}`}]),x("")}finally{o(!1),w.current=null}};return(0,_.jsxs)("div",{"data-testid":"usage-ai-chat-panel",className:`fixed top-0 right-0 h-full bg-white border-l border-gray-200 shadow-2xl z-50 flex flex-col transition-transform duration-300 ease-in-out ${e?"translate-x-0":"translate-x-full"}`,style:{width:420},children:[(0,_.jsxs)("div",{className:"px-5 pt-5 pb-3 border-b border-gray-100 flex-shrink-0",children:[(0,_.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("svg",{className:"w-5 h-5 text-blue-600",viewBox:"0 0 16 16",fill:"currentColor",children:(0,_.jsx)("path",{d:"M8 1l1.5 3.5L13 6l-3.5 1.5L8 11 6.5 7.5 3 6l3.5-1.5L8 1zm4 7l.75 1.75L14.5 10.5l-1.75.75L12 13l-.75-1.75L9.5 10.5l1.75-.75L12 8zM4 9l.75 1.75L6.5 11.5l-1.75.75L4 14l-.75-1.75L1.5 11.5l1.75-.75L4 9z"})}),(0,_.jsx)("h3",{className:"text-base font-semibold text-gray-900",children:"Ask AI"})]}),(0,_.jsx)("button",{onClick:()=>{w.current&&w.current.abort(),t()},className:"text-gray-400 hover:text-gray-600 transition-colors p-1 rounded-md hover:bg-gray-100",children:(0,_.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,_.jsx)("p",{className:"text-xs text-gray-500",children:"Ask about your spend, models, keys, and trends"})]}),(0,_.jsx)("div",{className:"px-5 py-3 border-b border-gray-100 flex-shrink-0",children:(0,_.jsx)(eE.Select,{placeholder:"Select a model (optional, defaults to gpt-4o-mini)",value:d,onChange:e=>c(e),loading:p,showSearch:!0,allowClear:!0,size:"small",className:"w-full",options:u.map(e=>({label:e,value:e})),filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase())})}),(0,_.jsxs)("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 bg-gray-50",children:[0===a.length&&!f&&!i&&(0,_.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-gray-400",children:[(0,_.jsx)("svg",{className:"w-8 h-8 mb-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})}),(0,_.jsx)("p",{className:"text-sm font-medium",children:"Ask a question about your usage"}),(0,_.jsx)("p",{className:"text-xs mt-1",children:'e.g. "Which model costs me the most?"'})]}),a.map((e,t)=>(0,_.jsx)("div",{children:"user"===e.role?(0,_.jsx)("div",{className:"flex justify-end",children:(0,_.jsx)("div",{className:"max-w-[88%] rounded-xl px-3.5 py-2 text-sm leading-relaxed bg-blue-600 text-white",children:e.content})}):(0,_.jsxs)("div",{className:"space-y-2",children:[e.toolCalls&&e.toolCalls.length>0&&(0,_.jsx)("div",{className:"space-y-1.5",children:e.toolCalls.map((e,t)=>(0,_.jsx)(AK,{step:e},t))}),(0,_.jsx)("div",{className:"max-w-[95%] rounded-xl px-3.5 py-2.5 text-sm leading-relaxed bg-white border border-gray-200 text-gray-800",children:(0,_.jsx)(AJ,{content:e.content})})]})},t)),i&&b.length>0&&(0,_.jsx)("div",{className:"space-y-1.5",children:b.map((e,t)=>(0,_.jsx)(AK,{step:e},t))}),i&&!f&&(0,_.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 text-xs text-gray-500",children:[(0,_.jsx)(rm.Spin,{size:"small"}),(0,_.jsx)("span",{className:"italic",children:g||"Thinking..."})]}),f&&(0,_.jsx)("div",{className:"max-w-[95%] rounded-xl px-3.5 py-2.5 text-sm leading-relaxed bg-white border border-gray-200 text-gray-800",children:(0,_.jsx)(AJ,{content:f})}),(0,_.jsx)("div",{ref:j})]}),(0,_.jsxs)("div",{className:"px-4 py-3 border-t border-gray-200 bg-white flex-shrink-0",children:[(0,_.jsxs)("div",{className:"flex gap-2",children:[(0,_.jsx)(AV,{value:n,onChange:e=>l(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),S())},placeholder:"Ask about your usage...",autoSize:{minRows:1,maxRows:3},className:"flex-1",disabled:i}),(0,_.jsx)(z.Button,{type:"primary",onClick:S,disabled:!n.trim()||i,loading:i,children:"Send"})]}),(0,_.jsxs)("div",{className:"flex justify-between items-center mt-2",children:[(0,_.jsx)("button",{onClick:()=>{s([]),x(""),v([]),y(null)},className:"text-xs text-gray-400 hover:text-gray-600 transition-colors",disabled:0===a.length,children:"Clear chat"}),(0,_.jsx)("span",{className:"text-xs text-gray-400",children:"Enter to send"})]})]})]})};var AX=e.i(299251),AZ=e.i(153702),A0=e.i(160818),A1=e.i(777579);let A2={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M922.9 701.9H327.4l29.9-60.9 496.8-.9c16.8 0 31.2-12 34.2-28.6l68.8-385.1c1.8-10.1-.9-20.5-7.5-28.4a34.99 34.99 0 00-26.6-12.5l-632-2.1-5.4-25.4c-3.4-16.2-18-28-34.6-28H96.5a35.3 35.3 0 100 70.6h125.9L246 312.8l58.1 281.3-74.8 122.1a34.96 34.96 0 00-3 36.8c6 11.9 18.1 19.4 31.5 19.4h62.8a102.43 102.43 0 00-20.6 61.7c0 56.6 46 102.6 102.6 102.6s102.6-46 102.6-102.6c0-22.3-7.4-44-20.6-61.7h161.1a102.43 102.43 0 00-20.6 61.7c0 56.6 46 102.6 102.6 102.6s102.6-46 102.6-102.6c0-22.3-7.4-44-20.6-61.7H923c19.4 0 35.3-15.8 35.3-35.3a35.42 35.42 0 00-35.4-35.2zM305.7 253l575.8 1.9-56.4 315.8-452.3.8L305.7 253zm96.9 612.7c-17.4 0-31.6-14.2-31.6-31.6 0-17.4 14.2-31.6 31.6-31.6s31.6 14.2 31.6 31.6a31.6 31.6 0 01-31.6 31.6zm325.1 0c-17.4 0-31.6-14.2-31.6-31.6 0-17.4 14.2-31.6 31.6-31.6s31.6 14.2 31.6 31.6a31.6 31.6 0 01-31.6 31.6z"}}]},name:"shopping-cart",theme:"outlined"};var A4=T.forwardRef(function(e,t){return T.createElement(rf.default,(0,rp.default)({},e,{ref:t,icon:A2}))}),A5=e.i(232164),A6=e.i(645526),A3=e.i(771674);let A8=[{value:"global",label:"Global Usage",showForAdmin:"Global Usage",showForNonAdmin:"Your Usage",description:"View usage across all resources",descriptionForAdmin:"View usage across all resources",descriptionForNonAdmin:"View your usage",icon:(0,_.jsx)(A0.GlobalOutlined,{style:{fontSize:"16px"}})},{value:"my-usage",label:"Your Usage",description:"View your own usage",icon:(0,_.jsx)(A3.UserOutlined,{style:{fontSize:"16px"}}),adminOnly:!0},{value:"organization",label:"Organization Usage",showForAdmin:"Organization Usage",showForNonAdmin:"Your Organization Usage",description:"View organization-level usage",descriptionForAdmin:"View usage across all organizations",descriptionForNonAdmin:"View your organization's usage",icon:(0,_.jsx)(AX.BankOutlined,{style:{fontSize:"16px"}})},{value:"team",label:"Team Usage",description:"View usage by team",icon:(0,_.jsx)(A6.TeamOutlined,{style:{fontSize:"16px"}})},{value:"customer",label:"Customer Usage",description:"View usage by customer accounts",icon:(0,_.jsx)(A4,{style:{fontSize:"16px"}}),adminOnly:!0},{value:"tag",label:"Tag Usage",description:"View usage grouped by tags",icon:(0,_.jsx)(A5.TagsOutlined,{style:{fontSize:"16px"}}),adminOnly:!0},{value:"agent",label:"Agent Usage (A2A)",description:"View usage by AI agents",icon:(0,_.jsx)(tV.RobotOutlined,{style:{fontSize:"16px"}}),adminOnly:!0},{value:"user",label:"User Usage",description:"View usage by individual users",icon:(0,_.jsx)(A3.UserOutlined,{style:{fontSize:"16px"}}),adminOnly:!0},{value:"user-agent-activity",label:"User Agent Activity",description:"View detailed user agent activity logs",icon:(0,_.jsx)(A1.LineChartOutlined,{style:{fontSize:"16px"}}),adminOnly:!0}],A7=({value:e,onChange:t,isAdmin:r,canViewTagUsage:a=!1,title:s="Usage View",description:n="Select the usage data you want to view","data-id":l})=>{let i=A8.filter(e=>"tag"===e.value&&!!a||!e.adminOnly||!!r).map(e=>{let t=e.label,a=e.description;return e.showForAdmin&&e.showForNonAdmin&&(t=r?e.showForAdmin:e.showForNonAdmin),e.descriptionForAdmin&&e.descriptionForNonAdmin&&(a=r?e.descriptionForAdmin:e.descriptionForNonAdmin),{value:e.value,label:t,description:a,icon:e.icon,badgeText:e.badgeText}});return(0,_.jsx)("div",{className:"w-full","data-id":l,children:(0,_.jsxs)("div",{className:"flex flex-wrap items-center justify-start gap-4",children:[(0,_.jsxs)("div",{className:"flex items-stretch gap-2 min-w-0",children:[(0,_.jsx)("div",{className:"flex-shrink-0 flex items-center",children:(0,_.jsx)(AZ.BarChartOutlined,{style:{fontSize:"32px"}})}),(0,_.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,_.jsx)("h3",{className:"text-sm font-semibold text-gray-900 mb-0.5 leading-tight",children:s}),(0,_.jsx)("p",{className:"text-xs text-gray-600 leading-tight",children:n})]})]}),(0,_.jsx)("div",{className:"flex-shrink-0",children:(0,_.jsx)(eE.Select,{value:e,onChange:t,className:"w-54 sm:w-64 md:w-72",size:"large",options:i.map(e=>({value:e.value,label:e.label})),optionRender:e=>{let t=i.find(t=>t.value===e.value);return t?(0,_.jsxs)("div",{className:"flex items-center gap-2 py-1",children:[(0,_.jsx)("div",{className:"flex-shrink-0 mt-0.5",children:t.icon}),(0,_.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,_.jsx)("div",{className:"text-sm font-medium text-gray-900",children:t.label}),(0,_.jsx)("div",{className:"text-xs text-gray-600 mt-0.5",children:t.description})]}),t.badgeText&&(0,_.jsx)("div",{className:"items-center",children:(0,_.jsx)(LZ.Badge,{color:"blue",count:t.badgeText})})]}):e.label},labelRender:e=>{let t=i.find(t=>t.value===e.value);return t?(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("div",{children:t.icon}),(0,_.jsx)("span",{className:"text-sm",children:t.label})]}):e.label}})})]})})},A9=({teams:e,organizations:t})=>{let r,{accessToken:a,userRole:s,userId:n,premiumUser:l}=(0,k.default)(),[i,o]=(0,T.useState)(null),[d,c]=(0,T.useState)(!1),[u,m]=(0,T.useState)(!1),[p,h]=(0,T.useState)(!1),f=(0,T.useMemo)(()=>new Date(Date.now()-6048e5),[]),x=(0,T.useMemo)(()=>new Date,[]),[g,y]=(0,T.useState)({from:f,to:x}),[b,v]=(0,T.useState)([]),{data:j=[]}=(()=>{let{accessToken:e,userRole:t}=(0,k.default)();return(0,ev.useQuery)({queryKey:DF.list({}),queryFn:async()=>await (0,Q.allEndUsersCall)(e),enabled:!!e&&ts.all_admin_roles.includes(t)})})(),{data:w}=DY(),{data:S}=(0,DR.useCurrentUser)();console.log(`currentUser: ${JSON.stringify(S)}`),console.log(`currentUser max budget: ${S?.max_budget}`);let N=ts.all_admin_roles.includes(s||""),M=N||ts.internalUserRoles.includes(s||""),[C,L]=(0,T.useState)(""),[O,D]=(0,Db.useDebouncedState)("",{wait:300}),{data:A,fetchNextPage:E,hasNextPage:I,isFetchingNextPage:Y,isLoading:F}=((e=DH,t)=>{let{accessToken:r,userRole:a}=(0,k.default)();return(0,DB.useInfiniteQuery)({queryKey:Dz.list({filters:{pageSize:e,...t&&{searchEmail:t}}}),queryFn:async({pageParam:a})=>await (0,Q.userListCall)(r,null,a,e,t||null),initialPageParam:1,getNextPageParam:e=>{if(e.page{if(!A?.pages)return[];let e=new Set,t=[];for(let r of A.pages)for(let a of r.users)e.has(a.user_id)||(e.add(a.user_id),t.push({value:a.user_id,label:a.user_alias?`${a.user_alias} (${a.user_id})`:a.user_email?`${a.user_email} (${a.user_id})`:a.user_id}));return t},[A]),[H,$]=(0,T.useState)(N?null:n||null),[q,U]=(0,T.useState)("groups"),[W,G]=(0,T.useState)(!1),[K,J]=(0,T.useState)(!1),[et,er]=(0,T.useState)(!1),[ea,es]=(0,T.useState)("global"),[en,el]=(0,T.useState)(!0),[ei,eo]=(0,T.useState)(5),[ed,ec]=(0,T.useState)(5),[eu,em]=(0,T.useState)(!1);(0,T.useEffect)(()=>{!N&&n&&$(n)},[N,n]);let ep="my-usage"!==ea&&N?H:n||null,eh=(0,T.useMemo)(()=>g.from?new Date(g.from):null,[g.from]),ef=(0,T.useMemo)(()=>g.to?new Date(g.to):null,[g.to]);(0,T.useEffect)(()=>{if(!a)return;let e=!1;return(async()=>{try{let t=await (0,Q.tagListCall)(a,eh,ef);if(e)return;v(Object.values(t).map(e=>({label:e.name,value:e.name})))}catch(t){e||console.error("Failed to fetch tag list",t)}})(),()=>{e=!0}},[a,eh,ef]);let ex=(0,T.useRef)(0);(0,T.useEffect)(()=>{if(!a||!eh||!ef)return;let e=++ex.current;m(!0),c(!1),o(null),(0,Q.userDailyActivityAggregatedCall)(a,eh,ef,ep).then(t=>{ex.current===e&&(o(t),m(!1),h(!1))}).catch(()=>{ex.current===e&&(c(!0),m(!1))})},[a,eh,ef,ep]);let eg=Pz({fetchFn:Q.userDailyActivityCall,args:[a,eh,ef,ep],enabled:d&&!!a&&!!eh&&!!ef}),ey=(0,T.useMemo)(()=>i||(d?eg.data:{results:[],metadata:{}}),[i,d,eg.data]),e_=u||eg.loading;(0,T.useEffect)(()=>{d&&!eg.loading&&eg.data.results.length>0&&h(!1)},[d,eg.loading,eg.data.results.length]);let eb=(0,T.useCallback)(e=>{h(!0),y(e)},[]),ej=ey.metadata?.total_spend||0,ew=(0,T.useMemo)(()=>{let e={};return ey.results.forEach(t=>{Object.entries(t.breakdown.models||{}).forEach(([t,r])=>{e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=r.metrics.spend,e[t].metrics.prompt_tokens+=r.metrics.prompt_tokens,e[t].metrics.completion_tokens+=r.metrics.completion_tokens,e[t].metrics.total_tokens+=r.metrics.total_tokens,e[t].metrics.api_requests+=r.metrics.api_requests,e[t].metrics.successful_requests+=r.metrics.successful_requests||0,e[t].metrics.failed_requests+=r.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=r.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=r.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(([e,t])=>({key:e,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens})).sort((e,t)=>t.spend-e.spend).slice(0,ed)},[ey.results,ed]),ek=(0,T.useMemo)(()=>{let e={};return ey.results.forEach(t=>{Object.entries(t.breakdown.model_groups||{}).forEach(([t,r])=>{e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=r.metrics.spend,e[t].metrics.prompt_tokens+=r.metrics.prompt_tokens,e[t].metrics.completion_tokens+=r.metrics.completion_tokens,e[t].metrics.total_tokens+=r.metrics.total_tokens,e[t].metrics.api_requests+=r.metrics.api_requests,e[t].metrics.successful_requests+=r.metrics.successful_requests||0,e[t].metrics.failed_requests+=r.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=r.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=r.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(([e,t])=>({key:e,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens})).sort((e,t)=>t.spend-e.spend).slice(0,ed)},[ey.results,ed]),eS=(0,T.useMemo)(()=>{let e={};return ey.results.forEach(t=>{Object.entries(t.breakdown.providers||{}).forEach(([t,r])=>{e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=r.metrics.spend,e[t].metrics.prompt_tokens+=r.metrics.prompt_tokens,e[t].metrics.completion_tokens+=r.metrics.completion_tokens,e[t].metrics.total_tokens+=r.metrics.total_tokens,e[t].metrics.api_requests+=r.metrics.api_requests,e[t].metrics.successful_requests+=r.metrics.successful_requests||0,e[t].metrics.failed_requests+=r.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=r.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=r.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(([e,t])=>({provider:e,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}))},[ey.results]),eN=(0,T.useMemo)(()=>{let e={};return ey.results.forEach(t=>{Object.entries(t.breakdown.api_keys||{}).forEach(([t,r])=>{e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{key_alias:r.metadata.key_alias,team_id:null,tags:r.metadata.tags||[]}}),e[t].metrics.spend+=r.metrics.spend,e[t].metrics.prompt_tokens+=r.metrics.prompt_tokens,e[t].metrics.completion_tokens+=r.metrics.completion_tokens,e[t].metrics.total_tokens+=r.metrics.total_tokens,e[t].metrics.api_requests+=r.metrics.api_requests,e[t].metrics.successful_requests+=r.metrics.successful_requests,e[t].metrics.failed_requests+=r.metrics.failed_requests,e[t].metrics.cache_read_input_tokens+=r.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=r.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(([e,t])=>({api_key:e,key_alias:t.metadata.key_alias||"-",tags:t.metadata.tags||[],spend:t.metrics.spend})).sort((e,t)=>t.spend-e.spend).slice(0,ei)},[ey.results,ei]),eT=(0,T.useMemo)(()=>[...ey.results].sort((e,t)=>new Date(e.date).getTime()-new Date(t.date).getTime()),[ey.results]),eM=(0,T.useMemo)(()=>Pv(ey,"models",e),[ey,e]),eC=(0,T.useMemo)(()=>Pv(ey,"api_keys",e),[ey,e]),eL=(0,T.useMemo)(()=>Pv(ey,"mcp_servers",e),[ey,e]);return(0,_.jsxs)("div",{style:{width:"100%"},className:"p-8 relative",children:[(0,_.jsx)("div",{className:"flex items-end justify-between gap-6 mb-6",children:(0,_.jsxs)("div",{className:"flex-1",children:[(0,_.jsxs)("div",{className:"flex items-end justify-between gap-6 mb-4 w-full",children:[(0,_.jsx)(A7,{value:ea,onChange:e=>es(e),isAdmin:N,canViewTagUsage:M}),(0,_.jsx)(ko,{value:g,onValueChange:eb})]}),eg.isFetchingMore&&(0,_.jsx)(B.Alert,{banner:!0,type:"warning",className:"mb-2",message:(0,_.jsxs)("div",{className:"flex items-center justify-between",children:[(0,_.jsxs)("span",{children:[(0,_.jsx)(wo.LoadingOutlined,{spin:!0,className:"mr-2"}),"Currently fetching spend data: fetched ",eg.progress.currentPage," /"," ",eg.progress.totalPages," pages. Charts will update periodically as data loads. Moving off of this page will stop and reset this. To continue using the UI in the meantime,"," ",(0,_.jsxs)("a",{href:window.location.href,target:"_blank",rel:"noopener noreferrer",children:["open a new tab ",(0,_.jsx)(MD.ExportOutlined,{})]}),"."]}),(0,_.jsx)(z.Button,{type:"primary",danger:!0,onClick:eg.cancel,children:"Stop"})]})}),eg.cancelled&&(0,_.jsx)(B.Alert,{banner:!0,type:"info",className:"mb-2",message:(0,_.jsxs)("span",{children:["Showing partial data (",eg.progress.currentPage,"/",eg.progress.totalPages," ","pages loaded)"]})}),("global"===ea||"my-usage"===ea)&&(0,_.jsxs)(_.Fragment,{children:[N&&"global"===ea&&(0,_.jsxs)("div",{className:"mb-4",children:[(0,_.jsx)(Z.Text,{className:"mb-2",children:"Filter by user"}),(0,_.jsx)(eE.Select,{showSearch:!0,allowClear:!0,style:{width:"100%"},placeholder:"Select user to filter...",value:H,onChange:e=>$(e??null),filterOption:!1,onSearch:e=>{L(e),D(e)},searchValue:C,onPopupScroll:e=>{let t=e.currentTarget;(t.scrollTop+t.clientHeight)/t.scrollHeight>=.8&&I&&!Y&&E()},loading:F,notFoundContent:F?(0,_.jsx)(wo.LoadingOutlined,{spin:!0}):"No users found",options:R,popupRender:e=>(0,_.jsxs)(_.Fragment,{children:[e,Y&&(0,_.jsx)("div",{style:{textAlign:"center",padding:8},children:(0,_.jsx)(wo.LoadingOutlined,{spin:!0})})]})})]}),(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center",children:[(0,_.jsxs)(rR.TabList,{variant:"solid",className:"mt-1",children:[(0,_.jsx)(rY.Tab,{children:"Cost"}),(0,_.jsx)(rY.Tab,{children:"Model Activity"}),(0,_.jsx)(rY.Tab,{children:"Key Activity"}),(0,_.jsx)(rY.Tab,{children:"MCP Server Activity"}),(0,_.jsx)(rY.Tab,{children:"Endpoint Activity"})]}),(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(z.Button,{onClick:()=>er(!0),icon:(0,_.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"currentColor",children:(0,_.jsx)("path",{d:"M8 1l1.5 3.5L13 6l-3.5 1.5L8 11 6.5 7.5 3 6l3.5-1.5L8 1zm4 7l.75 1.75L14.5 10.5l-1.75.75L12 13l-.75-1.75L9.5 10.5l1.75-.75L12 8zM4 9l.75 1.75L6.5 11.5l-1.75.75L4 14l-.75-1.75L1.5 11.5l1.75-.75L4 9z"})}),children:"Ask AI"}),(0,_.jsx)(z.Button,{onClick:()=>J(!0),icon:(0,_.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),children:"Export Data"})]})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(ee.Grid,{numItems:2,className:"gap-2 w-full",children:[(0,_.jsxs)(yl.Col,{numColSpan:2,children:[(0,_.jsx)("div",{className:"flex items-center gap-4 mt-2 mb-2",children:(0,_.jsxs)(Z.Text,{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content text-lg",children:["Project Spend"," ",g.from&&g.to&&(0,_.jsxs)(_.Fragment,{children:[g.from.toLocaleDateString("en-US",{month:"short",day:"numeric",year:g.from.getFullYear()!==g.to.getFullYear()?"numeric":void 0})," - ",g.to.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]})]})}),(0,_.jsx)(PF,{userSpend:ej,selectedTeam:null,userMaxBudget:S?.max_budget||null})]}),(0,_.jsx)(yl.Col,{numColSpan:2,children:(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Usage Metrics"}),(0,_.jsxs)(ee.Grid,{numItems:5,className:"gap-4 mt-4",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Total Requests"}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2",children:ey.metadata?.total_api_requests?.toLocaleString()||0})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Successful Requests"}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2 text-green-600",children:ey.metadata?.total_successful_requests?.toLocaleString()||0})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(X.Title,{children:"Failed Requests"}),(0,_.jsx)(tB.Tooltip,{title:"Includes requests that failed to route to a provider, tool usage failures, and other request errors where the provider cannot be determined.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"text-gray-400 hover:text-gray-600"})})]}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2 text-red-600",children:ey.metadata?.total_failed_requests?.toLocaleString()||0})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Average Cost per Request"}),(0,_.jsxs)(Z.Text,{className:"text-2xl font-bold mt-2",children:["$",(0,rV.formatNumberWithCommas)((ej||0)/(ey.metadata?.total_api_requests||1),4)]})]}),(0,_.jsxs)(P.Card,{className:"cursor-pointer hover:bg-gray-50 transition-colors",onClick:()=>em(!eu),children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(X.Title,{children:"Total Tokens"}),eu?(0,_.jsx)(wd.DownOutlined,{className:"text-gray-400 text-xs"}):(0,_.jsx)(wc.RightOutlined,{className:"text-gray-400 text-xs"})]}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2",children:ey.metadata?.total_tokens?.toLocaleString()||0})]})]}),eu&&(0,_.jsxs)(ee.Grid,{numItems:4,className:"gap-4 mt-4",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Input Tokens"}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2 text-blue-600",children:(ey.metadata?.total_prompt_tokens||0).toLocaleString()})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Output Tokens"}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2 text-cyan-600",children:ey.metadata?.total_completion_tokens?.toLocaleString()||0})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Cache Read Tokens"}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2 text-green-600",children:ey.metadata?.total_cache_read_input_tokens?.toLocaleString()||0})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Cache Write Tokens"}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2 text-purple-600",children:ey.metadata?.total_cache_creation_input_tokens?.toLocaleString()||0})]})]})]})}),(0,_.jsx)(yl.Col,{numColSpan:2,children:(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Daily Spend"}),e_?(0,_.jsx)(PA,{isDateChanging:p}):(0,_.jsx)(yn,{data:eT,index:"date",categories:["metrics.spend"],colors:["cyan"],valueFormatter:Py,yAxisWidth:100,showLegend:!1,customTooltip:({payload:e,active:t})=>{if(!t||!e?.[0])return null;let r=e[0].payload;return(0,_.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,_.jsx)("p",{className:"font-bold",children:r.date}),(0,_.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",(0,rV.formatNumberWithCommas)(r.metrics.spend,2)]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Requests: ",r.metrics.api_requests]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Successful: ",r.metrics.successful_requests]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Failed: ",r.metrics.failed_requests]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",r.metrics.total_tokens]})]})}})]})}),(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsxs)(P.Card,{className:"h-full",children:[(0,_.jsx)(X.Title,{children:"Top Virtual Keys"}),(0,_.jsx)(Az,{topKeys:eN,teams:null,topKeysLimit:ei,setTopKeysLimit:eo})]})}),(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsxs)(P.Card,{className:"h-full",children:[(0,_.jsx)(X.Title,{children:"groups"===q?"Top Public Model Names":"Top Litellm Models"}),(0,_.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,_.jsx)(DE,{options:[{label:"5",value:5},{label:"10",value:10},{label:"25",value:25},{label:"50",value:50}],value:ed,onChange:e=>ec(e)}),(0,_.jsxs)("div",{className:"flex bg-gray-100 rounded-lg p-1",children:[(0,_.jsx)("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${"groups"===q?"bg-white shadow-sm text-gray-900":"text-gray-600 hover:text-gray-900"}`,onClick:()=>U("groups"),children:"Public Model Name"}),(0,_.jsx)("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${"individual"===q?"bg-white shadow-sm text-gray-900":"text-gray-600 hover:text-gray-900"}`,onClick:()=>U("individual"),children:"Litellm Model Name"})]})]}),e_?(0,_.jsx)(PA,{isDateChanging:p}):(0,_.jsx)("div",{className:"relative max-h-[600px] overflow-y-auto",children:(r="groups"===q?ek:ew,(0,_.jsx)(yn,{className:"mt-4",style:{height:52*Math.min(r.length,ed)},data:r,index:"key",categories:["spend"],colors:["cyan"],valueFormatter:Py,layout:"vertical",yAxisWidth:200,showLegend:!1,customTooltip:({payload:e,active:t})=>{if(!t||!e?.[0])return null;let r=e[0].payload;return(0,_.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,_.jsx)("p",{className:"font-bold",children:r.key}),(0,_.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",(0,rV.formatNumberWithCommas)(r.spend,2)]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Total Requests: ",r.requests.toLocaleString()]}),(0,_.jsxs)("p",{className:"text-green-600",children:["Successful: ",r.successful_requests.toLocaleString()]}),(0,_.jsxs)("p",{className:"text-red-600",children:["Failed: ",r.failed_requests.toLocaleString()]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",r.tokens.toLocaleString()]})]})}}))})]})}),(0,_.jsx)(yl.Col,{numColSpan:2,children:(0,_.jsx)(AU,{loading:e_,isDateChanging:p,providerSpend:eS})})]})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Pb,{modelMetrics:eM})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Pb,{modelMetrics:eC})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Pb,{modelMetrics:eL})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(PG,{userSpendData:ey})})]})]})]}),"organization"===ea&&(0,_.jsx)(Aq,{accessToken:a,entityType:"organization",userID:n,userRole:s,dateValue:g,entityList:t?.map(e=>({label:e.organization_alias,value:e.organization_id}))||null,premiumUser:l}),"team"===ea&&(0,_.jsx)(Aq,{accessToken:a,entityType:"team",userID:n,userRole:s,entityList:e?.map(e=>({label:e.team_alias,value:e.team_id}))||null,premiumUser:l,dateValue:g}),"customer"===ea&&(0,_.jsx)(Aq,{accessToken:a,entityType:"customer",userID:n,userRole:s,entityList:j?.map(e=>({label:e.alias||e.user_id,value:e.user_id}))||null,premiumUser:l,dateValue:g}),"tag"===ea&&(0,_.jsxs)(_.Fragment,{children:[en&&(0,_.jsx)(B.Alert,{banner:!0,type:"info",message:"Reusable credentials are automatically tracked as tags",description:(0,_.jsxs)(V.Typography.Text,{children:["When a reusable credential is used, it will appear as a tag prefixed with"," ",(0,_.jsx)(V.Typography.Text,{code:!0,children:"Credential: "}),"in this view."]}),closable:!0,onClose:()=>el(!1),className:"mb-5"}),(0,_.jsx)(Aq,{accessToken:a,entityType:"tag",userID:n,userRole:s,entityList:b,premiumUser:l,dateValue:g})]}),"agent"===ea&&(0,_.jsx)(Aq,{accessToken:a,entityType:"agent",userID:n,userRole:s,entityList:w?.agents?.map(e=>({label:e.agent_name,value:e.agent_id}))||null,premiumUser:l,dateValue:g}),"user"===ea&&(0,_.jsx)(Aq,{accessToken:a,entityType:"user",userID:n,userRole:s,entityList:R.length>0?R:null,premiumUser:l,dateValue:g}),"user-agent-activity"===ea&&(0,_.jsx)(PY,{accessToken:a,userRole:s,dateValue:g})]})}),(0,_.jsx)(Pj,{isOpen:W,onClose:()=>G(!1),accessToken:a}),(0,_.jsx)(PO,{isOpen:K,onClose:()=>J(!1),entityType:"team",spendData:{results:ey.results,metadata:ey.metadata},dateRange:g,selectedFilters:[],customTitle:"Export Usage Data"}),(0,_.jsx)(AQ,{open:et,onClose:()=>er(!1),accessToken:a})]})};var Ee=e.i(109799);let Et=({accessToken:e,userID:t})=>{let[r,a]=(0,T.useState)([]);(0,T.useEffect)(()=>{(async()=>{if(e&&t)try{let t=await (0,Q.availableTeamListCall)(e);a(t)}catch(e){console.error("Error fetching available teams:",e)}})()},[e,t]);let s=async r=>{if(e&&t)try{await (0,Q.teamMemberAddCall)(e,r,{user_id:t,role:"user"}),J.default.success("Successfully joined team"),a(e=>e.filter(e=>e.team_id!==r))}catch(e){console.error("Error joining team:",e),J.default.fromBackend("Failed to join team")}};return(0,_.jsx)(P.Card,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,_.jsxs)(A.Table,{children:[(0,_.jsx)(Y.TableHead,{children:(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(F.TableHeaderCell,{children:"Team Name"}),(0,_.jsx)(F.TableHeaderCell,{children:"Description"}),(0,_.jsx)(F.TableHeaderCell,{children:"Members"}),(0,_.jsx)(F.TableHeaderCell,{children:"Models"}),(0,_.jsx)(F.TableHeaderCell,{children:"Actions"})]})}),(0,_.jsxs)(E.TableBody,{children:[r.map(e=>(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(I.TableCell,{children:(0,_.jsx)(Z.Text,{children:e.team_alias})}),(0,_.jsx)(I.TableCell,{children:(0,_.jsx)(Z.Text,{children:e.description||"No description available"})}),(0,_.jsx)(I.TableCell,{children:(0,_.jsxs)(Z.Text,{children:[e.members_with_roles.length," members"]})}),(0,_.jsx)(I.TableCell,{children:(0,_.jsx)("div",{className:"flex flex-col",children:e.models&&0!==e.models.length?e.models.map((e,t)=>(0,_.jsx)(tR.Badge,{size:"xs",className:"mb-1",color:"blue",children:(0,_.jsx)(Z.Text,{children:e.length>30?`${e.slice(0,30)}...`:e})},t)):(0,_.jsx)(tR.Badge,{size:"xs",color:"red",children:(0,_.jsx)(Z.Text,{children:"All Proxy Models"})})})}),(0,_.jsx)(I.TableCell,{children:(0,_.jsx)(S.Button,{size:"xs",variant:"secondary",onClick:()=>s(e.team_id),children:"Join Team"})})]},e.team_id)),0===r.length&&(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:5,className:"text-center",children:(0,_.jsxs)(Z.Text,{children:["No available teams to join. See how to set available teams"," ",(0,_.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/self_serve#all-settings-for-self-serve--sso-flow",target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:text-blue-700 underline",children:"here"}),"."]})})})]})]})})};var Er=e.i(56567),Ea=e.i(860585),Es=e.i(162386);let{Title:En,Text:El}=V.Typography,Ei=["/key/generate","/key/update","/key/delete","/key/regenerate","/key/service-account/generate","/key/{key_id}/regenerate","/key/block","/key/unblock","/key/bulk_update","/key/{key_id}/reset_spend","/key/info","/key/list","/key/aliases","/team/daily/activity"],Eo=({label:e,description:t,isEditing:r,viewContent:a,editContent:s})=>(0,_.jsxs)(wl.Row,{className:"py-5 border-b border-gray-100 last:border-0",children:[(0,_.jsxs)(wi.Col,{span:8,className:"pr-6",children:[(0,_.jsx)("div",{className:"text-sm font-semibold text-gray-900",children:e}),(0,_.jsx)("div",{className:"text-xs text-gray-500 mt-1 leading-relaxed",children:t})]}),(0,_.jsx)(wi.Col,{span:16,className:"flex items-center",children:(0,_.jsx)("div",{className:"w-full",children:r?s:a})})]}),Ed=()=>(0,_.jsx)(El,{className:"text-gray-400 italic",children:"Not set"}),Ec=(e,t)=>e&&0!==e.length?(0,_.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map(e=>(0,_.jsx)(eN.Tag,{color:"blue",children:t?t(e):e},e))}):(0,_.jsx)(Ed,{}),Eu={max_budget:null,budget_duration:null,tpm_limit:null,rpm_limit:null,models:[],team_member_permissions:[]},Em=({accessToken:e})=>{let[t,r]=(0,T.useState)(!0),[a,s]=(0,T.useState)(Eu),[n,l]=(0,T.useState)(!1),[i,o]=(0,T.useState)(Eu),[d,c]=(0,T.useState)(!1),[u,m]=(0,T.useState)(!1);(0,T.useEffect)(()=>{(async()=>{if(!e)return r(!1);try{let t=await (0,Q.getDefaultTeamSettings)(e),r={...Eu,...t.values||{}};s(r),o(r)}catch(e){console.error("Error fetching team SSO settings:",e),m(!0),J.default.fromBackend("Failed to fetch team settings")}finally{r(!1)}})()},[e]);let p=async()=>{if(e){c(!0);try{let t=await (0,Q.updateDefaultTeamSettings)(e,i),r={...Eu,...t.settings||{}};s(r),o(r),l(!1),J.default.success("Default team settings updated successfully")}catch(e){console.error("Error updating team settings:",e),J.default.fromBackend("Failed to update team settings")}finally{c(!1)}}},h=(e,t)=>{o(r=>({...r,[e]:t}))};return t?(0,_.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,_.jsx)(rm.Spin,{size:"large"})}):u?(0,_.jsx)(eg.Card,{children:(0,_.jsx)(El,{children:"No team settings available or you do not have permission to view them."})}):(0,_.jsxs)(eg.Card,{styles:{body:{padding:32}},children:[(0,_.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(En,{level:3,className:"m-0 text-gray-900",children:"Default Team Settings"}),(0,_.jsx)(El,{className:"text-gray-500 mt-1 block",children:"These settings will be applied by default when creating new teams."})]}),(0,_.jsx)("div",{children:n?(0,_.jsxs)("div",{className:"flex gap-3",children:[(0,_.jsx)(z.Button,{onClick:()=>{l(!1),o(a)},disabled:d,children:"Cancel"}),(0,_.jsx)(z.Button,{type:"primary",onClick:p,loading:d,icon:(0,_.jsx)(MC.SaveOutlined,{}),children:"Save Changes"})]}):(0,_.jsx)(z.Button,{onClick:()=>l(!0),icon:(0,_.jsx)(wX.EditOutlined,{}),children:"Edit Settings"})})]}),(0,_.jsxs)("div",{className:"mt-8",children:[(0,_.jsxs)("div",{className:"mb-8",children:[(0,_.jsx)("div",{className:"text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:"Budget & Rate Limits"}),(0,_.jsxs)("div",{className:"border-t border-gray-100",children:[(0,_.jsx)(Eo,{label:"Max Budget",description:"Maximum budget (in USD) for new automatically created teams.",isEditing:n,viewContent:null!=a.max_budget?(0,_.jsxs)(El,{children:["$",Number(a.max_budget).toLocaleString()]}):(0,_.jsx)(Ed,{}),editContent:(0,_.jsx)(tq.InputNumber,{className:"w-full",style:{maxWidth:320},value:i.max_budget,onChange:e=>h("max_budget",e),placeholder:"Not set",prefix:"$",min:0})}),(0,_.jsx)(Eo,{label:"Budget Duration",description:"How frequently the team's budget resets.",isEditing:n,viewContent:a.budget_duration?(0,_.jsx)(El,{children:(0,Ea.getBudgetDurationLabel)(a.budget_duration)}):(0,_.jsx)(Ed,{}),editContent:(0,_.jsx)(Ea.default,{value:i.budget_duration||null,onChange:e=>h("budget_duration",e),style:{maxWidth:320}})}),(0,_.jsx)(Eo,{label:"TPM Limit",description:"Maximum tokens per minute allowed across all models.",isEditing:n,viewContent:null!=a.tpm_limit?(0,_.jsx)(El,{children:a.tpm_limit.toLocaleString()}):(0,_.jsx)(Ed,{}),editContent:(0,_.jsx)(tq.InputNumber,{className:"w-full",style:{maxWidth:320},value:i.tpm_limit,onChange:e=>h("tpm_limit",e),placeholder:"Not set",min:0})}),(0,_.jsx)(Eo,{label:"RPM Limit",description:"Maximum requests per minute allowed across all models.",isEditing:n,viewContent:null!=a.rpm_limit?(0,_.jsx)(El,{children:a.rpm_limit.toLocaleString()}):(0,_.jsx)(Ed,{}),editContent:(0,_.jsx)(tq.InputNumber,{className:"w-full",style:{maxWidth:320},value:i.rpm_limit,onChange:e=>h("rpm_limit",e),placeholder:"Not set",min:0})})]})]}),(0,_.jsxs)("div",{className:"mb-8",children:[(0,_.jsx)("div",{className:"text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:"Access & Permissions"}),(0,_.jsxs)("div",{className:"border-t border-gray-100",children:[(0,_.jsx)(Eo,{label:"Models",description:"Default list of models that new teams can access.",isEditing:n,viewContent:Ec(a.models,tQ.getModelDisplayName),editContent:(0,_.jsx)(Es.ModelSelect,{value:i.models||[],onChange:e=>h("models",e),context:"global",style:{width:"100%"},options:{includeSpecialOptions:!0}})}),(0,_.jsx)(Eo,{label:"Team Member Permissions",description:"Default permissions granted to members of newly created teams. /key/info and /key/health are always included.",isEditing:n,viewContent:Ec(a.team_member_permissions),editContent:(0,_.jsx)(eE.Select,{mode:"multiple",style:{width:"100%"},value:i.team_member_permissions||[],onChange:e=>h("team_member_permissions",e),placeholder:"Select permissions",tagRender:({label:e,closable:t,onClose:r})=>(0,_.jsx)(eN.Tag,{color:"blue",closable:t,onClose:r,className:"mr-1 mt-1 mb-1",children:e}),children:Ei.map(e=>(0,_.jsx)(eE.Select.Option,{value:e,children:e},e))})})]})]})]})]})};var Ep=e.i(372943),Eh=MV,PW=PW,Ef=e.i(368869);let Ex=(0,eT.default)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);var Cl=Cl,Eg=e.i(98740),Eg=Eg;function Ey({size:e,fontSize:t}){let r=(0,_.jsx)(wo.LoadingOutlined,{style:t?{fontSize:t}:void 0,spin:!0});return(0,_.jsx)(rm.Spin,{indicator:r,size:e})}var E_=e.i(363256),Eb=e.i(9314),Ev=e.i(844565),Ej=e.i(552130),Ew=e.i(533882),Ek=e.i(651904),ES=e.i(460285),EN=e.i(916940),ET=e.i(471145);let EM=(e,t,r)=>"Admin"===e||!!r&&!!t&&r.some(e=>e.members?.some(e=>e.user_id===t&&"org_admin"===e.user_role)),EC=(e,t,r)=>"Admin"===e?r||[]:r&&t?r.filter(e=>e.members?.some(e=>e.user_id===t&&"org_admin"===e.user_role)):[],EL=({teams:e,searchParams:t,accessToken:r,setTeams:a,userID:s,userRole:n,organizations:l,premiumUser:i=!1})=>{let o,d,c,u,m;console.log(`organizations: ${JSON.stringify(l)}`);let{data:p}=(0,Ee.useOrganizations)(),[h,f]=(0,T.useState)(!0),[x,g]=(0,T.useState)(null),[y,b]=(0,T.useState)(1),[v,j]=(0,T.useState)(10),[w,k]=(0,T.useState)(0),[S,N]=(0,T.useState)(null),[M,C]=(0,T.useState)(null),[L,O]=(0,T.useState)({search:"",organization_id:"",sort_by:"created_at",sort_order:"desc"}),D=(0,T.useRef)(null),[P,A]=(0,T.useState)(!1),E=async(e={})=>{if(!r)return;let t=e.page??y,l=e.size??v,i=e.sortBy??L.sort_by,o=e.sortOrder??L.sort_order,d=e.organizationID??L.organization_id,c=e.search??L.search;f(!0),g(null);try{let e=await (0,jY.teamListCall)(r,t,l,{organizationID:d||null,search:c||null,userID:"Admin"!==n&&"Admin Viewer"!==n?s:null,sortBy:i||null,sortOrder:o||null});a(e.teams??[]),k(e.total??0)}catch(e){g(e?.message||"Failed to fetch teams")}finally{f(!1)}};(0,T.useEffect)(()=>{E()},[r]);let[I]=H.Form.useForm(),[Y]=H.Form.useForm(),[F,R]=(0,T.useState)(""),[B,G]=(0,T.useState)(!1),[K,X]=(0,T.useState)(null),[Z,ee]=(0,T.useState)(null),[er,ea]=(0,T.useState)(!1),[es,en]=(0,T.useState)(!1),[el,ei]=(0,T.useState)(!1),[eo,ed]=(0,T.useState)(!1),[ec,eu]=(0,T.useState)([]),[em,ep]=(0,T.useState)(!1),[eh,ef]=(0,T.useState)(null),[ex,ey]=(0,T.useState)([]),[eb,ev]=(0,T.useState)({}),[ej,ew]=(0,T.useState)(!1),[ek,eS]=(0,T.useState)([]),[eT,eM]=(0,T.useState)([]),[eC,eL]=(0,T.useState)([]),[eO,eD]=(0,T.useState)([]),[eP,eA]=(0,T.useState)(!1),[eI,eY]=(0,T.useState)({}),[eF,eR]=(0,T.useState)(null),[eB,ez]=(0,T.useState)(0);(0,T.useEffect)(()=>{let e;console.log(`currentOrgForCreateTeam: ${M}`);let t=(e=[],M&&M.models.length>0?(console.log(`organization.models: ${M.models}`),e=M.models):e=ec,(0,tQ.unfurlWildcardModelsInList)(e,ec));console.log(`models: ${t}`),ey(t),I.setFieldValue("models",[])},[M,ec]),(0,T.useEffect)(()=>{if(es){let e=EC(n,s,l);if(1===e.length){let t=e[0];I.setFieldValue("organization_id",t.organization_id),C(t)}else I.setFieldValue("organization_id",S?.organization_id||null),C(S)}},[es,n,s,l,S]),(0,T.useEffect)(()=>{let e=async()=>{try{if(null==r)return;let e=(await (0,Q.getPoliciesList)(r)).policies.map(e=>e.policy_name);eM(e)}catch(e){console.error("Failed to fetch policies:",e)}};(async()=>{try{if(null==r)return;let e=(await (0,Q.getGuardrailsList)(r)).guardrails.map(e=>e.guardrail_name);eS(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})(),e()},[r]);let e$=async()=>{try{if(null==r)return;let e=await (0,Q.fetchMCPAccessGroups)(r);eD(e)}catch(e){console.error("Failed to fetch MCP access groups:",e)}};(0,T.useEffect)(()=>{e$()},[r]),(0,T.useEffect)(()=>{e&&ev(e.reduce((e,t)=>(e[t.team_id]={keys:t.keys||[],keys_count:t.keys_count??t.keys?.length??0,team_info:{members_with_roles:t.members_with_roles||[]}},e),{}))},[e]);let eq=async e=>{ef(e),ep(!0)},eU=async()=>{if(null!=eh&&null!=e&&null!=r)try{ew(!0),await (0,Q.teamDeleteCall)(r,eh.team_id),await E(),J.default.success("Team deleted successfully")}catch(e){J.default.fromBackend("Error deleting the team: "+e)}finally{ew(!1),ep(!1),ef(null)}};(0,T.useEffect)(()=>{(async()=>{try{if(null===s||null===n||null===r)return;let e=await (0,tQ.fetchAvailableModelsForTeamOrKey)(s,n,r);e&&eu(e)}catch(e){console.error("Error fetching user models:",e)}})()},[r,s,n,e]);let eW=async t=>{try{if(console.log(`formValues: ${JSON.stringify(t)}`),null!=r){let a=t?.team_alias,s=e?.map(e=>e.team_alias)??[],n=t?.organization_id||S?.organization_id;if(""===n||"string"!=typeof n?t.organization_id=null:t.organization_id=n.trim(),s.includes(a))throw Error(`Team alias ${a} already exists, please pick another alias`);if(J.default.info("Creating Team"),eC.length>0){let e={};if(t.metadata)try{e=JSON.parse(t.metadata)}catch(e){console.warn("Invalid JSON in metadata field, starting with empty object")}e={...e,logging:eC.filter(e=>e.callback_name)},t.metadata=JSON.stringify(e)}if(t.secret_manager_settings&&"string"==typeof t.secret_manager_settings)if(""===t.secret_manager_settings.trim())delete t.secret_manager_settings;else try{t.secret_manager_settings=JSON.parse(t.secret_manager_settings)}catch(e){throw Error("Failed to parse secret manager settings: "+e)}let l=Array.isArray(t.object_permission_search_tools)&&t.object_permission_search_tools.length>0;if(t.allowed_vector_store_ids&&t.allowed_vector_store_ids.length>0||t.allowed_mcp_servers_and_groups&&(t.allowed_mcp_servers_and_groups.servers?.length>0||t.allowed_mcp_servers_and_groups.accessGroups?.length>0||t.allowed_mcp_servers_and_groups.toolPermissions)){if(t.object_permission||(t.object_permission={}),t.allowed_vector_store_ids&&t.allowed_vector_store_ids.length>0&&(t.object_permission.vector_stores=t.allowed_vector_store_ids,delete t.allowed_vector_store_ids),t.allowed_mcp_servers_and_groups){let{servers:e,accessGroups:r}=t.allowed_mcp_servers_and_groups;e&&e.length>0&&(t.object_permission.mcp_servers=e),r&&r.length>0&&(t.object_permission.mcp_access_groups=r),delete t.allowed_mcp_servers_and_groups}t.mcp_tool_permissions&&Object.keys(t.mcp_tool_permissions).length>0&&(t.object_permission.mcp_tool_permissions=t.mcp_tool_permissions,delete t.mcp_tool_permissions)}if(t.allowed_mcp_access_groups&&t.allowed_mcp_access_groups.length>0&&(t.object_permission||(t.object_permission={}),t.object_permission.mcp_access_groups=t.allowed_mcp_access_groups,delete t.allowed_mcp_access_groups),t.allowed_agents_and_groups){let{agents:e,accessGroups:r}=t.allowed_agents_and_groups;t.object_permission||(t.object_permission={}),e&&e.length>0&&(t.object_permission.agents=e),r&&r.length>0&&(t.object_permission.agent_access_groups=r),delete t.allowed_agents_and_groups}l&&(t.object_permission||(t.object_permission={}),t.object_permission.search_tools=t.object_permission_search_tools,delete t.object_permission_search_tools),Object.keys(eI).length>0&&(t.model_aliases=eI),eF?.router_settings&&Object.values(eF.router_settings).some(e=>null!=e&&""!==e)&&(t.router_settings=eF.router_settings),await (0,Q.teamCreateCall)(r,t),J.default.success("Team created"),await E({page:y,size:v}),I.resetFields(),eL([]),eY({}),eR(null),ez(e=>e+1),en(!1)}}catch(e){console.error("Error creating the team:",e),J.default.fromBackend("Error creating the team: "+e)}},eV=async(e,t)=>{let l={...L,[e]:t};if(O(l),b(1),r)try{let e=await (0,jY.teamListCall)(r,1,v,{organizationID:l.organization_id||null,search:l.search||null,userID:"Admin"!==n&&"Admin Viewer"!==n?s:null,sortBy:l.sort_by||null,sortOrder:l.sort_order||null});a(e.teams??[]),k(e.total??0)}catch(e){console.error("Error fetching teams:",e)}},{token:eG}=Ef.theme.useToken(),{Title:eJ,Text:eQ}=V.Typography,{Content:eX}=Ep.Layout,eZ=(0,T.useMemo)(()=>[{title:"Team ID",dataIndex:"team_id",key:"team_id",width:170,ellipsis:!0,render:(e,t)=>(0,_.jsx)(tB.Tooltip,{title:e,children:(0,_.jsx)(eQ,{ellipsis:!0,className:"text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs cursor-pointer",style:{fontSize:14,padding:"1px 8px"},onClick:()=>ee(t.team_id),"data-testid":"team-id-cell",children:e})})},{title:"Team Alias",dataIndex:"team_alias",key:"team_alias",ellipsis:!0,sorter:!0,render:e=>(0,_.jsx)(eQ,{style:{fontSize:14},children:e||(0,_.jsx)(eQ,{type:"secondary",italic:!0,children:"—"})})},{title:"Organization",key:"organization",width:160,ellipsis:!0,render:(e,t)=>{let r=((e,t)=>{if(!e||!t)return e||"N/A";let r=t.find(t=>t.organization_id===e);return r?.organization_alias||e})(t.organization_id,p||l);return t.organization_id?(0,_.jsx)(eQ,{ellipsis:!0,style:{fontSize:14},children:r}):(0,_.jsx)(eQ,{type:"secondary",children:"—"})}},{title:"Resources",key:"resources",width:240,render:(e,t)=>{let r=eb?.[t.team_id]?.team_info?.members_with_roles?.length??0,a=t.models?.length??0,s=eb?.[t.team_id]?.keys_count??0;return(0,_.jsxs)(tg.Flex,{gap:12,align:"center",children:[(0,_.jsx)(tB.Tooltip,{title:`${r} Members`,children:(0,_.jsx)(eN.Tag,{color:"purple",style:{fontSize:14,padding:"2px 8px",margin:0},children:(0,_.jsxs)(tg.Flex,{align:"center",gap:6,children:[(0,_.jsx)(Eg.default,{size:14}),r]})})}),(0,_.jsx)(tB.Tooltip,{title:`${a} Models`,children:(0,_.jsx)(eN.Tag,{color:"blue",style:{fontSize:14,padding:"2px 8px",margin:0},children:(0,_.jsxs)(tg.Flex,{align:"center",gap:6,children:[(0,_.jsx)(Ex,{size:14}),a]})})}),(0,_.jsx)(tB.Tooltip,{title:`${s} Keys`,children:(0,_.jsx)(eN.Tag,{color:"cyan",style:{fontSize:14,padding:"2px 8px",margin:0},children:(0,_.jsxs)(tg.Flex,{align:"center",gap:6,children:[(0,_.jsx)(Cm,{size:14}),s]})})})]})}},{title:"Spend / Budget",key:"spend",width:200,sorter:!0,render:(e,t)=>{let r=t.spend??0,a=t.max_budget,s=`$${r.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`,n=null!=a?`$${a.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`:"Unlimited",l=null!=a&&a>0?Math.min(r/a*100,100):null;return(0,_.jsxs)(tg.Flex,{vertical:!0,gap:2,children:[(0,_.jsxs)(eQ,{style:{fontSize:13},children:[s,(0,_.jsxs)(eQ,{type:"secondary",style:{fontSize:12},children:[" / ",n]})]}),null!=l&&(0,_.jsx)(PW.default,{percent:l,size:"small",showInfo:!1,strokeColor:l>=90?"#ff4d4f":l>=70?"#faad14":"#1677ff",style:{marginBottom:0}})]})}},{title:"Created",dataIndex:"created_at",key:"created_at",width:130,ellipsis:!0,sorter:!0,render:e=>(0,_.jsx)(eQ,{type:"secondary",style:{fontSize:13},children:e?new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):"—"})},{title:"Actions",key:"actions",width:120,align:"right",render:(e,t)=>(0,_.jsxs)(U.Space,{size:4,children:[(0,_.jsx)(rG.default,{variant:"Copy",tooltipText:"Copy Team ID",onClick:()=>{navigator.clipboard.writeText(t.team_id).then(()=>LB.message.success("Team ID copied")).catch(()=>LB.message.error("Failed to copy"))}}),"Admin"===n&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(rG.default,{variant:"Edit",tooltipText:"Edit team",dataTestId:"edit-team-button",onClick:()=>{ee(t.team_id),ea(!0)}}),(0,_.jsx)(rG.default,{variant:"Delete",tooltipText:"Delete team",dataTestId:"delete-team-button",onClick:()=>eq(t)})]})]})}],[n,eb,p,l]),e0=(0,T.useMemo)(()=>e??[],[e]),e1=[{key:"your-teams",label:"Your Teams",children:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(eg.Card,{styles:{body:{padding:0}},children:[(0,_.jsxs)(tg.Flex,{justify:"space-between",align:"center",style:{padding:"12px 16px"},children:[(0,_.jsxs)(tg.Flex,{gap:12,align:"center",children:[(0,_.jsx)($.Input,{prefix:(0,_.jsx)(Cl.default,{size:16}),suffix:P?(0,_.jsx)(Ey,{size:"small"}):null,placeholder:"Search teams by name or ID...",onChange:e=>{var t;return t=e.target.value,void(D.current&&clearTimeout(D.current),A(!0),D.current=setTimeout(async()=>{try{O(e=>({...e,search:t})),b(1),await E({page:1,search:t})}finally{A(!1)}},300))},allowClear:!0,style:{maxWidth:400}}),(0,_.jsx)(E_.default,{organizations:l,value:L.organization_id||void 0,onChange:e=>eV("organization_id",e||""),loading:h})]}),(0,_.jsx)(Eh.default,{current:y,total:w,pageSize:v,onChange:(e,t)=>{b(e),j(t),E({page:e,size:t})},size:"small",showTotal:e=>`${e} teams`,showSizeChanger:!0,pageSizeOptions:["10","20","50"]})]}),h?(0,_.jsx)(tg.Flex,{justify:"center",align:"center",style:{padding:"80px 0"},children:(0,_.jsx)(Ey,{fontSize:48})}):x?(0,_.jsxs)(tg.Flex,{vertical:!0,align:"center",gap:16,style:{padding:"64px 0"},children:[(0,_.jsx)(eQ,{type:"danger",style:{fontSize:15},children:"Failed to load teams"}),(0,_.jsx)(eQ,{type:"secondary",style:{fontSize:13},children:x}),(0,_.jsx)(z.Button,{icon:(0,_.jsx)(rg.ReloadOutlined,{}),onClick:()=>{E()},children:"Retry"})]}):(0,_.jsx)(eK.Table,{columns:eZ,dataSource:e0,rowKey:"team_id",pagination:!1,onChange:(e,t,r)=>{let a=Array.isArray(r)?r[0]:r,s=a.order?a.columnKey:"created_at",n="ascend"===a.order?"asc":(a.order,"desc");O(e=>({...e,sort_by:s,sort_order:n})),E({sortBy:s,sortOrder:n})},locale:{emptyText:(0,_.jsxs)("div",{style:{padding:"64px 0",textAlign:"center"},children:[(0,_.jsx)(A6.TeamOutlined,{style:{fontSize:40,color:"#d9d9d9",marginBottom:12}}),(0,_.jsx)("div",{children:(0,_.jsx)(eQ,{style:{fontSize:15,color:"#595959"},children:"No teams yet"})}),(0,_.jsx)("div",{style:{marginTop:4},children:(0,_.jsx)(eQ,{type:"secondary",style:{fontSize:13},children:"Create your first team to organize members and manage access to models."})}),EM(n,s,l)&&(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(tZ.PlusOutlined,{}),onClick:()=>en(!0),style:{marginTop:16},"data-testid":"create-team-button",children:"Create Team"})]})},scroll:{x:1e3},size:"middle"})]}),(0,_.jsx)(eH.default,{isOpen:em,title:"Delete Team?",alertMessage:0===(o=eh?.keys_count??eh?.keys?.length??0)?void 0:`Warning: This team has ${o} keys associated with it. Deleting the team will also delete all associated keys. This action is irreversible.`,message:"Are you sure you want to delete this team and all its keys? This action cannot be undone.",resourceInformationTitle:"Team Information",resourceInformation:[{label:"Team ID",value:eh?.team_id,code:!0},{label:"Team Name",value:eh?.team_alias},{label:"Keys",value:eh?.keys_count??eh?.keys?.length??0},{label:"Members",value:eh?.members_with_roles?.length}],requiredConfirmation:eh?.team_alias,onCancel:()=>{ep(!1),ef(null)},onOk:eU,confirmLoading:ej})]})},{key:"available-teams",label:"Available Teams",children:(0,_.jsx)(Et,{accessToken:r,userID:s})},...(0,ts.isProxyAdminRole)(n||"")?[{key:"default-settings",label:"Default Team Settings",children:(0,_.jsx)(Em,{accessToken:r,userID:s||"",userRole:n||""})}]:[]];return(0,_.jsxs)(eX,{style:{padding:eG.paddingLG,paddingInline:2*eG.paddingLG},children:[Z?(0,_.jsx)(Er.default,{teamId:Z,onUpdate:e=>{a(t=>null==t?t:t.map(t=>e.team_id===t.team_id?(0,rV.updateExistingKeys)(t,e):t)),E()},onClose:()=>{ee(null),ea(!1)},accessToken:r,is_team_admin:(e=>{if(null==e||null==e.members_with_roles)return!1;for(let t=0;te.team_id===Z)),is_proxy_admin:"Admin"==n,userModels:ec,editTeam:er,premiumUser:i}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(tg.Flex,{justify:"space-between",align:"center",style:{marginBottom:16},children:[(0,_.jsxs)(U.Space,{direction:"vertical",size:0,children:[(0,_.jsxs)(eJ,{level:2,style:{margin:0},children:[(0,_.jsx)(A6.TeamOutlined,{style:{marginRight:8}}),"Teams"]}),(0,_.jsx)(eQ,{type:"secondary",children:"Manage teams, members, and their access to models and budgets"})]}),EM(n,s,l)&&(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(tZ.PlusOutlined,{}),onClick:()=>en(!0),"data-testid":"create-team-button",children:"Create Team"})]}),(0,_.jsx)(W.Tabs,{items:e1})]}),EM(n,s,l)&&(0,_.jsx)(q.Modal,{title:"Create Team",open:es,width:1e3,footer:null,onOk:()=>{en(!1),I.resetFields(),eL([]),eY({}),eR(null),ez(e=>e+1)},onCancel:()=>{en(!1),I.resetFields(),eL([]),eY({}),eR(null),ez(e=>e+1)},children:(0,_.jsxs)(H.Form,{form:I,onFinish:eW,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(H.Form.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,_.jsx)(et.TextInput,{placeholder:"","data-testid":"team-name-input"})}),(d=EC(n,s,l),c="Admin"!==n,u=1===d.length,m=0===d.length,(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Organization"," ",(0,_.jsx)(tB.Tooltip,{title:(0,_.jsxs)("span",{children:["Organizations can have multiple teams. Learn more about"," ",(0,_.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/user_management_heirarchy",target:"_blank",rel:"noopener noreferrer",style:{color:"#1890ff",textDecoration:"underline"},onClick:e=>e.stopPropagation(),children:"user management hierarchy"})]}),children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"organization_id",initialValue:S?S.organization_id:null,className:"mt-8",rules:c?[{required:!0,message:"Please select an organization"}]:[],help:u?"You can only create teams within this organization":c?"required":"",children:(0,_.jsx)(eE.Select,{showSearch:!0,allowClear:!c,disabled:u,placeholder:m?"No organizations available":"Search or select an Organization",onChange:e=>{I.setFieldValue("organization_id",e),C(d?.find(t=>t.organization_id===e)||null)},filterOption:(e,t)=>!!t&&(t.children?.toString()||"").toLowerCase().includes(e.toLowerCase()),optionFilterProp:"children",children:d?.map(e=>(0,_.jsxs)(eE.Select.Option,{value:e.organization_id,children:[(0,_.jsx)("span",{className:"font-medium",children:e.organization_alias})," ",(0,_.jsxs)("span",{className:"text-gray-500",children:["(",e.organization_id,")"]})]},e.organization_id))})}),c&&!u&&d.length>1&&(0,_.jsx)("div",{className:"mb-8 p-4 bg-blue-50 border border-blue-200 rounded-md",children:(0,_.jsx)(eQ,{style:{color:"#1e40af",fontSize:14},children:"Please select an organization to create a team for. You can only create teams within organizations where you are an admin."})})]})),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Models"," ",(0,_.jsx)(tB.Tooltip,{title:"These are the models that your selected team has access to",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),rules:[{required:!0,message:"Please select at least one model"}],name:"models",children:(0,_.jsx)(Es.ModelSelect,{value:I.getFieldValue("models")||[],onChange:e=>I.setFieldValue("models",e),organizationID:I.getFieldValue("organization_id"),options:{includeSpecialOptions:!0,showAllProxyModelsOverride:!I.getFieldValue("organization_id")},context:"team",dataTestId:"create-team-models-select"})}),(0,_.jsx)(H.Form.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,_.jsx)(jf.default,{step:.01,precision:2,width:200})}),(0,_.jsx)(H.Form.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,_.jsxs)(eE.Select,{defaultValue:null,placeholder:"n/a",children:[(0,_.jsx)(eE.Select.Option,{value:"24h",children:"daily"}),(0,_.jsx)(eE.Select.Option,{value:"7d",children:"weekly"}),(0,_.jsx)(eE.Select.Option,{value:"30d",children:"monthly"})]})}),(0,_.jsx)(H.Form.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,_.jsx)(jf.default,{step:1,width:400})}),(0,_.jsx)(H.Form.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,_.jsx)(jf.default,{step:1,width:400})}),(0,_.jsxs)(rX.Accordion,{className:"mt-20 mb-8",onClick:()=>{eP||(e$(),eA(!0))},children:[(0,_.jsx)(rZ.AccordionHeader,{children:(0,_.jsx)("b",{children:"Additional Settings"})}),(0,_.jsxs)(r0.AccordionBody,{children:[(0,_.jsx)(H.Form.Item,{label:"Team ID",name:"team_id",help:"ID of the team you want to create. If not provided, it will be generated automatically.",children:(0,_.jsx)(et.TextInput,{onChange:e=>{e.target.value=e.target.value.trim()}})}),(0,_.jsx)(H.Form.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",normalize:e=>e?Number(e):void 0,tooltip:"This is the individual budget for a user in the team.",children:(0,_.jsx)(jf.default,{step:.01,precision:2,width:200})}),(0,_.jsx)(H.Form.Item,{label:"Team Member Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,_.jsx)(et.TextInput,{placeholder:"e.g., 30d"})}),(0,_.jsx)(H.Form.Item,{label:"Team Member RPM Limit",name:"team_member_rpm_limit",tooltip:"The RPM (Requests Per Minute) limit for individual team members",children:(0,_.jsx)(jf.default,{step:1,width:400})}),(0,_.jsx)(H.Form.Item,{label:"Team Member TPM Limit",name:"team_member_tpm_limit",tooltip:"The TPM (Tokens Per Minute) limit for individual team members",children:(0,_.jsx)(jf.default,{step:1,width:400})}),(0,_.jsx)(H.Form.Item,{label:"Metadata",name:"metadata",help:"Additional team metadata. Enter metadata as JSON object.",children:(0,_.jsx)($.Input.TextArea,{rows:4})}),(0,_.jsx)(H.Form.Item,{label:"Secret Manager Settings",name:"secret_manager_settings",help:i?"Enter secret manager configuration as a JSON object.":"Premium feature - Upgrade to manage secret manager settings.",rules:[{validator:async(e,t)=>{if(!t)return Promise.resolve();try{return JSON.parse(t),Promise.resolve()}catch(e){return Promise.reject(Error("Please enter valid JSON"))}}}],children:(0,_.jsx)($.Input.TextArea,{rows:4,placeholder:'{"namespace": "admin", "mount": "secret", "path_prefix": "litellm"}',disabled:!i})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Guardrails"," ",(0,_.jsx)(tB.Tooltip,{title:"Setup your first guardrail",children:(0,_.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-8",help:"Select existing guardrails or enter new ones",children:(0,_.jsx)(eE.Select,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:ek.map(e=>({value:e,label:e}))})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Disable Global Guardrails"," ",(0,_.jsx)(tB.Tooltip,{title:"When enabled, this team will bypass any guardrails configured to run on every request (global guardrails)",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"disable_global_guardrails",className:"mt-4",valuePropName:"checked",help:"Bypass global guardrails for this team",children:(0,_.jsx)(e_.Switch,{disabled:!i,checkedChildren:i?"Yes":"Premium feature - Upgrade to disable global guardrails by team",unCheckedChildren:i?"No":"Premium feature - Upgrade to disable global guardrails by team"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Policies"," ",(0,_.jsx)(tB.Tooltip,{title:"Apply policies to this team to control guardrails and other settings",children:(0,_.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/guardrail_policies",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})})]}),name:"policies",className:"mt-8",help:"Select existing policies or enter new ones",children:(0,_.jsx)(eE.Select,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter policies",options:eT.map(e=>({value:e,label:e}))})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Access Groups"," ",(0,_.jsx)(tB.Tooltip,{title:"Assign access groups to this team. Access groups control which models, MCP servers, and agents this team can use",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"access_group_ids",className:"mt-8",help:"Select access groups to assign to this team",children:(0,_.jsx)(Eb.default,{placeholder:"Select access groups (optional)"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,_.jsx)(tB.Tooltip,{title:"Select which vector stores this team can access by default. Leave empty for access to all vector stores",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-8",help:"Select vector stores this team can access. Leave empty for access to all vector stores",children:(0,_.jsx)(EN.default,{onChange:e=>I.setFieldValue("allowed_vector_store_ids",e),value:I.getFieldValue("allowed_vector_store_ids"),accessToken:r||"",placeholder:"Select vector stores (optional)"})}),(0,_.jsx)(H.Form.Item,{label:"Allowed Pass Through Routes",name:"allowed_passthrough_routes",className:"mt-8",children:(0,_.jsx)(tB.Tooltip,{title:i?(0,ts.isProxyAdminRole)(n||"")?"":"Only proxy admins can set allowed pass through routes":"Premium feature - Upgrade to set allowed pass through routes",placement:"top",children:(0,_.jsx)(Ev.default,{onChange:e=>I.setFieldValue("allowed_passthrough_routes",e),value:I.getFieldValue("allowed_passthrough_routes"),accessToken:r||"",placeholder:"Select pass through routes (optional)",disabled:!i||!(0,ts.isProxyAdminRole)(n||"")})})})]})]}),(0,_.jsxs)(rX.Accordion,{className:"mt-8 mb-8",children:[(0,_.jsx)(rZ.AccordionHeader,{children:(0,_.jsx)("b",{children:"MCP Settings"})}),(0,_.jsxs)(r0.AccordionBody,{children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,_.jsx)(tB.Tooltip,{title:"Select which MCP servers or access groups this team can access",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",className:"mt-4",help:"Select MCP servers or access groups this team can access",children:(0,_.jsx)(rO.default,{onChange:e=>I.setFieldValue("allowed_mcp_servers_and_groups",e),value:I.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:r||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,_.jsx)(H.Form.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,_.jsx)($.Input,{type:"hidden"})}),(0,_.jsx)(H.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.allowed_mcp_servers_and_groups!==t.allowed_mcp_servers_and_groups||e.mcp_tool_permissions!==t.mcp_tool_permissions,children:()=>(0,_.jsx)("div",{className:"mt-6",children:(0,_.jsx)(rD.default,{accessToken:r||"",selectedServers:I.getFieldValue("allowed_mcp_servers_and_groups")?.servers||[],toolPermissions:I.getFieldValue("mcp_tool_permissions")||{},onChange:e=>I.setFieldsValue({mcp_tool_permissions:e})})})})]})]}),(0,_.jsxs)(rX.Accordion,{className:"mt-8 mb-8",children:[(0,_.jsx)(rZ.AccordionHeader,{children:(0,_.jsx)("b",{children:"Agent Settings"})}),(0,_.jsx)(r0.AccordionBody,{children:(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Allowed Agents"," ",(0,_.jsx)(tB.Tooltip,{title:"Select which agents or access groups this team can access",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"allowed_agents_and_groups",className:"mt-4",help:"Select agents or access groups this team can access",children:(0,_.jsx)(Ej.default,{onChange:e=>I.setFieldValue("allowed_agents_and_groups",e),value:I.getFieldValue("allowed_agents_and_groups"),accessToken:r||"",placeholder:"Select agents or access groups (optional)"})})})]}),(0,_.jsxs)(rX.Accordion,{className:"mt-8 mb-8",children:[(0,_.jsx)(rZ.AccordionHeader,{children:(0,_.jsx)("b",{children:"Search Tool Settings"})}),(0,_.jsx)(r0.AccordionBody,{children:(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Allowed Search Tools"," ",(0,_.jsx)(tB.Tooltip,{title:"Select which search tools this team can access. Leave empty to allow all search tools.",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"object_permission_search_tools",className:"mt-4",help:"Restrict which configured search tools keys on this team may call.",children:(0,_.jsx)(ET.default,{onChange:e=>I.setFieldValue("object_permission_search_tools",e),value:I.getFieldValue("object_permission_search_tools"),accessToken:r||"",placeholder:"Select search tools (optional, empty = all allowed)"})})})]}),(0,_.jsxs)(rX.Accordion,{className:"mt-8 mb-8",children:[(0,_.jsx)(rZ.AccordionHeader,{children:(0,_.jsx)("b",{children:"Logging Settings"})}),(0,_.jsx)(r0.AccordionBody,{children:(0,_.jsx)("div",{className:"mt-4",children:(0,_.jsx)(Ek.default,{value:eC,onChange:eL,premiumUser:i})})})]}),(0,_.jsxs)(rX.Accordion,{className:"mt-8 mb-8",children:[(0,_.jsx)(rZ.AccordionHeader,{children:(0,_.jsx)("b",{children:"Router Settings"})}),(0,_.jsx)(r0.AccordionBody,{children:(0,_.jsx)("div",{className:"mt-4 w-full",children:(0,_.jsx)(ES.default,{accessToken:r||"",value:eF||void 0,onChange:eR,modelData:ec.length>0?{data:ec.map(e=>({model_name:e}))}:void 0},eB)})})]},`router-settings-accordion-${eB}`),(0,_.jsxs)(rX.Accordion,{className:"mt-8 mb-8",children:[(0,_.jsx)(rZ.AccordionHeader,{children:(0,_.jsx)("b",{children:"Model Aliases"})}),(0,_.jsx)(r0.AccordionBody,{children:(0,_.jsxs)("div",{className:"mt-4",children:[(0,_.jsx)(eQ,{type:"secondary",style:{fontSize:14,marginBottom:16,display:"block"},children:"Create custom aliases for models that can be used by team members in API calls. This allows you to create shortcuts for specific models."}),(0,_.jsx)(Ew.default,{accessToken:r||"",initialModelAliases:eI,onAliasUpdate:eY,showExampleConfig:!1})]})})]})]}),(0,_.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,_.jsx)(z.Button,{htmlType:"submit","data-testid":"create-team-submit",children:"Create Team"})})]})})]})};var EO=e.i(702597),ED=e.i(846835),EP=e.i(147612);let EA=e=>{let t=new Set,r=/\{\{(\w+)\}\}/g;if(e.messages.forEach(e=>{let a;for(;null!==(a=r.exec(e.content));)t.add(a[1])}),e.developerMessage){let a;for(;null!==(a=r.exec(e.developerMessage));)t.add(a[1])}return Array.from(t)},EE=e=>{let t=EA(e),r=`--- +}'`})})]})]})}):(0,_.jsx)("div",{className:"p-6 text-center text-gray-500",children:"Please log in to configure semantic filter settings."})}let{Text:Da}=V.Typography,Ds=({accessToken:e})=>{let t,[r,a]=(0,T.useState)(!0),[s,n]=(0,T.useState)(!1),[l,i]=(0,T.useState)([]),[o,d]=(0,T.useState)(null);(0,T.useEffect)(()=>{c(),u()},[e]);let c=async()=>{if(e){a(!0);try{for(let t of(await (0,Q.getGeneralSettingsCall)(e)))"mcp_internal_ip_ranges"===t.field_name&&t.field_value&&i(t.field_value)}catch(e){console.error("Failed to load MCP network settings:",e)}finally{a(!1)}}},u=async()=>{if(!e)return;let t=await (0,Q.fetchMCPClientIp)(e);t&&d(t)},m=async()=>{if(e){n(!0);try{l.length>0?await (0,Q.updateConfigFieldSetting)(e,"mcp_internal_ip_ranges",l):await (0,Q.deleteConfigFieldSetting)(e,"mcp_internal_ip_ranges")}catch(e){console.error("Failed to save MCP network settings:",e)}finally{n(!1)}}};if(r)return(0,_.jsx)("div",{className:"flex justify-center py-12",children:(0,_.jsx)(rm.Spin,{})});let p=o?4!==(t=o.split(".")).length?o+"/32":`${t[0]}.${t[1]}.${t[2]}.0/24`:null;return(0,_.jsxs)("div",{className:"space-y-6 p-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Da,{className:"text-lg font-semibold",children:"Private IP Ranges"}),(0,_.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:'Define which IP ranges are part of your private network. Callers from these IPs can see all MCP servers. Callers from any other IP can only see servers marked "Available on Public Internet".'})]}),(0,_.jsxs)(eg.Card,{children:[o&&(0,_.jsxs)("div",{className:"mb-4 p-3 bg-blue-50 rounded-lg",children:[(0,_.jsxs)(Da,{className:"text-sm text-blue-700",children:["Your current IP: ",(0,_.jsx)("span",{className:"font-mono font-medium",children:o})]}),p&&!l.includes(p)&&(0,_.jsxs)("div",{className:"mt-1",children:[(0,_.jsx)(Da,{className:"text-sm text-blue-600",children:"Suggested range: "}),(0,_.jsx)(eN.Tag,{className:"cursor-pointer font-mono",color:"blue",icon:(0,_.jsx)(tZ.PlusOutlined,{}),onClick:()=>{!l.includes(p)&&i([...l,p])},children:p})]})]}),(0,_.jsx)("div",{className:"flex items-center mb-2",children:(0,_.jsx)(Da,{className:"font-medium",children:"Your Private Network Ranges"})}),(0,_.jsx)(eE.Select,{mode:"tags",value:l,onChange:i,placeholder:"Leave empty to use defaults: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 127.0.0.0/8",tokenSeparators:[","],className:"w-full",size:"large",allowClear:!0}),(0,_.jsx)("p",{className:"text-xs text-gray-400 mt-2",children:"Enter CIDR ranges (e.g., 10.0.0.0/8). When empty, standard private IP ranges are used."})]}),(0,_.jsx)("div",{className:"flex justify-end",children:(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(MC.SaveOutlined,{}),onClick:m,loading:s,children:"Save"})})]})},{Search:Dn}=$.Input,{Text:Dl}=V.Typography,Di=["#3B82F6","#10B981","#F59E0B","#EF4444","#8B5CF6","#EC4899","#06B6D4","#84CC16"],Do=({isVisible:e,onClose:t,onSelectServer:r,onCustomServer:a,accessToken:s})=>{let[n,l]=(0,T.useState)([]),[i,o]=(0,T.useState)([]),[d,c]=(0,T.useState)(!1),[u,m]=(0,T.useState)(null),[p,h]=(0,T.useState)(""),[f,x]=(0,T.useState)("All");(0,T.useEffect)(()=>{e&&s&&(c(!0),m(null),(0,Q.fetchDiscoverableMCPServers)(s).then(e=>{l(e.servers||[]),o(e.categories||[])}).catch(e=>{m(e.message||"Failed to load MCP servers")}).finally(()=>{c(!1)}))},[e,s]),(0,T.useEffect)(()=>{e&&(h(""),x("All"))},[e]);let g=(0,T.useMemo)(()=>{let e=n;if("All"!==f&&(e=e.filter(e=>e.category===f)),p.trim()){let t=p.toLowerCase();e=e.filter(e=>e.name.toLowerCase().includes(t)||e.title.toLowerCase().includes(t)||e.description.toLowerCase().includes(t))}return e},[n,f,p]),y=(0,T.useMemo)(()=>{let e={};for(let t of g){let r=t.category||"Other";e[r]||(e[r]=[]),e[r].push(t)}return e},[g]);return(0,_.jsxs)(q.Modal,{title:(0,_.jsxs)("div",{className:"flex items-center justify-between pb-4 border-b border-gray-100",children:[(0,_.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,_.jsx)("img",{src:Og,alt:"MCP Logo",className:"w-8 h-8 object-contain",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"}}),(0,_.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add MCP Server"})]}),(0,_.jsx)("button",{onClick:a,className:"text-sm text-blue-600 hover:text-blue-800 cursor-pointer bg-transparent border-none font-medium",children:"+ Custom Server"})]}),open:e,onCancel:t,footer:null,width:1e3,className:"top-8",styles:{body:{padding:"24px",maxHeight:"70vh",overflowY:"auto"},header:{padding:"24px 24px 0 24px",border:"none"}},children:[(0,_.jsx)("div",{style:{display:"flex",gap:6,flexWrap:"wrap",marginBottom:12},children:["All",...i].map(e=>{let t=f===e;return(0,_.jsx)("button",{onClick:()=>x(e),style:{padding:"4px 12px",borderRadius:4,border:t?"1px solid #111827":"1px solid #e5e7eb",background:t?"#111827":"#fff",color:t?"#fff":"#4b5563",cursor:"pointer",fontSize:12,fontWeight:t?500:400,lineHeight:"20px"},children:e},e)})}),(0,_.jsx)(Dn,{placeholder:"Search servers...",value:p,onChange:e=>h(e.target.value),style:{marginBottom:16},allowClear:!0}),d&&(0,_.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:Array.from({length:8}).map((e,t)=>(0,_.jsx)("div",{style:{height:36,borderRadius:6,background:"#f9fafb"}},t))}),u&&(0,_.jsx)("div",{style:{textAlign:"center",padding:"32px 0",color:"#9ca3af"},children:(0,_.jsxs)(Dl,{children:["Failed to load servers: ",u]})}),!d&&!u&&0===g.length&&(0,_.jsx)("div",{style:{textAlign:"center",padding:"32px 0",color:"#9ca3af"},children:(0,_.jsxs)(Dl,{children:["No servers found."," ",(0,_.jsx)("a",{onClick:a,style:{color:"#2563eb",cursor:"pointer"},children:"Add a custom server"})]})}),!d&&!u&&Object.entries(y).map(([e,t])=>(0,_.jsxs)("div",{style:{marginBottom:16},children:[(0,_.jsx)("div",{style:{fontSize:11,fontWeight:500,color:"#9ca3af",textTransform:"uppercase",letterSpacing:"0.05em",padding:"6px 0",borderBottom:"1px solid #f3f4f6",marginBottom:4},children:e}),(0,_.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0 16px"},children:t.map(e=>{var t;let a,s,n=(a=(t=e.title||e.name).charAt(0).toUpperCase(),s=t.split("").reduce((e,t)=>e+t.charCodeAt(0),0)%Di.length,{initial:a,backgroundColor:Di[s]});return(0,_.jsxs)("div",{onClick:()=>r(e),style:{display:"flex",alignItems:"center",padding:"8px 10px",borderRadius:6,cursor:"pointer",transition:"background 0.1s ease"},onMouseEnter:e=>{e.currentTarget.style.background="#f9fafb"},onMouseLeave:e=>{e.currentTarget.style.background="transparent"},children:[e.icon_url?(0,_.jsx)("img",{src:e.icon_url,alt:e.title,style:{width:20,height:20,objectFit:"contain",flexShrink:0,marginRight:12},onError:e=>{let t=e.currentTarget;t.style.display="none";let r=t.nextElementSibling;r&&(r.style.display="flex")}}):null,(0,_.jsx)("div",{style:{width:20,height:20,borderRadius:4,backgroundColor:n.backgroundColor,color:"#fff",display:e.icon_url?"none":"flex",alignItems:"center",justifyContent:"center",fontWeight:600,fontSize:11,flexShrink:0,marginRight:12},children:n.initial}),(0,_.jsx)("span",{style:{fontSize:14,fontWeight:400,color:"#111827",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title||e.name}),(0,_.jsx)("span",{style:{color:"#d1d5db",fontSize:14,flexShrink:0,marginLeft:8},children:"›"})]},e.name)})})]},e))]})};var Dd=e.i(611052);let{Text:Dc,Title:Du}=V.Typography,Dm=({server:e,open:t,accessToken:r,onClose:a,onSaved:s})=>{let[n]=H.Form.useForm(),{data:l,isLoading:i,isError:o}=(0,ev.useQuery)({queryKey:["mcpUserEnvVars",e?.server_id],queryFn:()=>(0,Q.getMCPUserEnvVars)(r,e.server_id),enabled:t&&!!e&&!!r}),d=(0,ep.useMutation)({mutationFn:t=>(0,Q.storeMCPUserEnvVars)(r,e.server_id,t),onSuccess:e=>{J.default.success("Credentials saved"),s?.(e),a()},onError:e=>{J.default.fromBackend(`Failed to save env vars: ${e instanceof Error?e.message:String(e)}`)}}),c=e?.server_name||e?.alias||e?.server_id||"MCP Server",u=l?.required??[],m=d.isPending;return(0,_.jsx)(q.Modal,{open:t,onCancel:a,footer:null,width:520,destroyOnHidden:!0,afterOpenChange:e=>{e&&n.resetFields()},title:(0,_.jsxs)("div",{children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(Du,{level:5,style:{margin:0},children:"Set your credentials"}),(0,_.jsx)(eN.Tag,{color:"blue",children:"Per-user"})]}),(0,_.jsx)(Dc,{type:"secondary",className:"text-xs",children:c})]}),children:(0,_.jsx)("div",{className:"space-y-4 mt-2",children:i?(0,_.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,_.jsx)(rm.Spin,{})}):o?(0,_.jsx)(B.Alert,{type:"error",showIcon:!0,message:"Failed to load env vars"}):0===u.length?(0,_.jsx)(B.Alert,{type:"info",showIcon:!0,message:"No per-user fields configured for this server."}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(Dc,{className:"text-sm text-gray-600 block",children:"These values are private to you. Your admin configured this MCP server to require these per-user credentials. Saved values are never shown back; leave an already-set field blank to keep it, or enter a value to set or change it."}),(0,_.jsxs)(H.Form,{form:n,layout:"vertical",onFinish:t=>{if(!e||!r)return;let a={};for(let[e,r]of Object.entries(t))a[e]=(r??"").trim();d.mutate(a)},disabled:m,children:[u.map(e=>(0,_.jsx)(H.Form.Item,{name:e.name,label:(0,_.jsxs)("span",{className:"flex items-center gap-2",children:[(0,_.jsx)("span",{className:"font-mono text-sm font-semibold",children:e.name}),e.is_set&&(0,_.jsx)(eN.Tag,{color:"green",children:"Set"})]}),extra:e.description||void 0,rules:e.is_set?void 0:[{required:!0,message:`${e.name} is required`}],children:(0,_.jsx)($.Input.Password,{placeholder:e.is_set?"Enter a new value to overwrite":e.description||`Enter your ${e.name}`,visibilityToggle:!0})},e.name)),(0,_.jsxs)("div",{className:"flex items-center justify-end gap-2 pt-2 border-t border-gray-100",children:[(0,_.jsx)(z.Button,{onClick:a,disabled:m,children:"Cancel"}),(0,_.jsx)(z.Button,{type:"primary",htmlType:"submit",loading:m,children:"Save Credentials"})]})]})]})})})},Dp=[{value:"created_desc",label:"Recently created"},{value:"updated_desc",label:"Recently updated"},{value:"name_asc",label:"Name (A→Z)"},{value:"health",label:"Health (unhealthy first)"}],Dh={unhealthy:0,unknown:1,healthy:2},{Text:Df,Title:Dx}=V.Typography,Dg=()=>{try{let e=(0,Of.getSecureItem)(OK.TOOLS_OAUTH_UI_STATE_KEY);if(!e)return null;return JSON.parse(e)?.serverId??null}catch{return null}},{Option:Dy}=eE.Select,D_=({accessToken:e,userRole:t,userID:r})=>{let{data:a,isLoading:s,refetch:n}=(0,LM.useMCPServers)(),{data:l,isLoading:i,recheckServerHealth:o,recheckingServerIds:d}=(()=>{let{accessToken:e}=(0,k.default)(),t=(0,eh.useQueryClient)(),[r,a]=(0,T.useState)(new Set),s=(0,ev.useQuery)({queryKey:LC.lists(),queryFn:async()=>await (0,Q.fetchMCPServerHealth)(e),enabled:!!e,refetchInterval:3e4}),n=(0,T.useCallback)(async r=>{if(e){a(e=>new Set(e).add(r));try{let a=await (0,Q.fetchMCPServerHealth)(e,[r]);t.setQueriesData({queryKey:LC.lists()},e=>e?e.map(e=>a.find(t=>t.server_id===e.server_id)??e):a)}finally{a(e=>{let t=new Set(e);return t.delete(r),t})}}},[e,t]);return{...s,recheckServerHealth:n,recheckingServerIds:r}})(),c=(0,T.useMemo)(()=>{if(!a)return[];if(!l)return a;let e=new Map(l.map(e=>[e.server_id,e.status]));return a.map(t=>{let r=e.get(t.server_id);return{...t,status:r||t.status}})},[a,l]),[u,m]=(0,T.useState)(null),[p,h]=(0,T.useState)(!1),[f,x]=(0,T.useState)(Dg),[g,y]=(0,T.useState)(f),[b,v]=(0,T.useState)(!1),[j,w]=(0,T.useState)("all"),[N,M]=(0,T.useState)("all"),[C,L]=(0,T.useState)([]),[O,D]=(0,T.useState)(!1),[P,A]=(0,T.useState)(!1),[E,I]=(0,T.useState)(null),[Y,F]=(0,T.useState)(!1),[R,B]=(0,T.useState)(null),[z,H]=(0,T.useState)(null),[U,W]=(0,T.useState)(()=>new URLSearchParams(window.location.search).get("fill_env_vars")),[V,K]=(0,T.useState)(""),[ee,et]=(0,T.useState)("created_desc"),er="Internal User"===t,{data:ea,refetch:es}=(0,ev.useQuery)({queryKey:["mcpUserEnvVarStatus"],queryFn:()=>(0,Q.listMCPUserEnvVarStatus)(e),enabled:!!e}),en=(0,T.useMemo)(()=>{let e={};for(let t of ea??[])e[t.server_id]=(t.required??[]).filter(e=>!e.is_set).map(e=>e.name);return e},[ea]);(0,T.useEffect)(()=>{if(!U)return;let e=new URLSearchParams(window.location.search);if(!e.has("fill_env_vars"))return;e.delete("fill_env_vars");let t=e.toString(),r=window.location.pathname+(t?`?${t}`:"")+window.location.hash;window.history.replaceState({},"",r)},[U]);let el=(0,T.useMemo)(()=>U?c.find(e=>e.server_id===U)??null:null,[U,c]),ei=z??el;(0,T.useEffect)(()=>{try{let e=(0,Of.getSecureItem)("litellm-mcp-oauth-edit-state");if(!e)return;let t=JSON.parse(e);t?.serverId&&(y(t.serverId),v(!0))}catch(e){console.error("Failed to restore MCP edit view state",e)}},[]),(0,T.useEffect)(()=>{try{window.sessionStorage.removeItem(OK.TOOLS_OAUTH_UI_STATE_KEY)}catch{}},[]);let eo=T.default.useMemo(()=>{if(!c)return[];let e=new Set,t=[];return c.forEach(r=>{r.teams&&r.teams.forEach(r=>{let a=r.team_id;e.has(a)||(e.add(a),t.push(r))})}),t},[c]),ed=T.default.useMemo(()=>c?Array.from(new Set(c.flatMap(e=>e.mcp_access_groups).filter(e=>null!=e))):[],[c]),ec=(0,T.useCallback)((e,t)=>{if(!c)return L([]);let r=c;"personal"===e?L([]):("all"!==e&&(r=r.filter(t=>t.teams?.some(t=>t.team_id===e))),"all"!==t&&(r=r.filter(e=>e.mcp_access_groups?.some(e=>"string"==typeof e?e===t:e&&e.name===t))),L([...r].sort((e,t)=>e.created_at||t.created_at?e.created_at?t.created_at?new Date(t.created_at).getTime()-new Date(e.created_at).getTime():-1:1:0)))},[c]);(0,T.useEffect)(()=>{ec(j,N)},[c,j,N,ec]);let eu=(0,T.useMemo)(()=>{let e=V.trim().toLowerCase();return[...e?C.filter(t=>{let r=(t.server_name||"").toLowerCase(),a=(t.alias||"").toLowerCase(),s=(t.url||"").toLowerCase(),n=t.server_id.toLowerCase();return r.includes(e)||a.includes(e)||s.includes(e)||n.includes(e)}):C].sort((e,t)=>((e,t,r)=>{switch(r){case"name_asc":{let r=(e.server_name||e.alias||e.server_id).toLowerCase(),a=(t.server_name||t.alias||t.server_id).toLowerCase();return r.localeCompare(a)}case"updated_desc":{let r=e.updated_at?new Date(e.updated_at).getTime():0;return(t.updated_at?new Date(t.updated_at).getTime():0)-r}case"health":{let r=Dh[e.status??"unknown"]??1,a=Dh[t.status??"unknown"]??1;if(r!==a)return r-a;let s=e.created_at?new Date(e.created_at).getTime():0;return(t.created_at?new Date(t.created_at).getTime():0)-s}default:{let r=e.created_at?new Date(e.created_at).getTime():0;return(t.created_at?new Date(t.created_at).getTime():0)-r}}})(e,t,ee))},[C,V,ee]),em=async()=>{if(null!=u&&null!=e)try{F(!0),await (0,Q.deleteMCPServer)(e,u),J.default.success("Deleted MCP Server successfully"),g===u&&(v(!1),y(null)),n()}catch(e){console.error("Error deleting the mcp server:",e)}finally{F(!1),h(!1),m(null)}},ep=u?(a||[]).find(e=>e.server_id===u):null,ef=T.default.useMemo(()=>C.find(e=>e.server_id===g)||{server_id:"",server_name:"",alias:"",url:"",transport:"",auth_type:"",created_at:"",created_by:"",updated_at:"",updated_by:""},[C,g]),ex=T.default.useCallback(()=>{v(!1),y(null),x(null),n()},[n]);return e&&t&&r?(0,_.jsxs)("div",{className:"w-full h-full p-6",children:[(0,_.jsx)(q.Modal,{open:p,title:"Delete MCP Server?",onOk:em,okText:Y?"Deleting...":"Delete",onCancel:()=>{h(!1),m(null)},cancelText:"Cancel",cancelButtonProps:{disabled:Y},okButtonProps:{danger:!0},confirmLoading:Y,children:(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsx)(Df,{className:"text-gray-600",children:"This action is permanent and cannot be undone. All associated configurations will be removed."}),ep&&(0,_.jsx)("div",{className:"mt-3 p-4 bg-gray-50 rounded-lg border border-gray-200",children:(0,_.jsxs)(eS.Descriptions,{column:1,size:"small",colon:!1,children:[ep.server_name&&(0,_.jsx)(eS.Descriptions.Item,{label:(0,_.jsx)("span",{className:"text-gray-500 text-sm",children:"Name"}),children:(0,_.jsx)(Df,{strong:!0,className:"text-sm",children:ep.server_name})}),(0,_.jsx)(eS.Descriptions.Item,{label:(0,_.jsx)("span",{className:"text-gray-500 text-sm",children:"ID"}),children:(0,_.jsx)(Df,{code:!0,className:"text-xs",children:ep.server_id})}),ep.url&&(0,_.jsx)(eS.Descriptions.Item,{label:(0,_.jsx)("span",{className:"text-gray-500 text-sm",children:"URL"}),children:(0,_.jsx)(Df,{code:!0,className:"text-xs break-all",children:ep.url})})]})})]})}),(0,_.jsx)(Oj,{userRole:t,userID:r,accessToken:e,onCreateSuccess:e=>{L(t=>[...t,e]),D(!1),n()},isModalVisible:O,setModalVisible:D,availableAccessGroups:ed,prefillData:E,onBackToDiscovery:()=>{D(!1),I(null),A(!0)}}),(0,_.jsxs)("div",{className:"flex items-center justify-between",children:[(0,_.jsxs)("div",{children:[(0,_.jsxs)("div",{className:"flex items-center gap-3",children:[(0,_.jsx)(X.Title,{children:"MCP Servers"}),C.length>0&&(0,_.jsx)("span",{className:"inline-flex items-center text-xs font-medium px-2 py-0.5 rounded-full bg-gray-100 text-gray-600 border border-gray-200",children:C.length})]}),(0,_.jsx)(Z.Text,{className:"text-tremor-content mt-1",children:"Configure and manage your MCP servers"})]}),(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ts.isAdminRole)(t)&&(0,_.jsx)(S.Button,{className:"flex-shrink-0",onClick:()=>A(!0),children:"+ Add New MCP Server"}),!(0,ts.isAdminRole)(t)&&(0,_.jsx)(S.Button,{className:"flex-shrink-0",onClick:()=>{I(null),D(!0)},variant:"secondary",children:"+ Submit MCP Server"})]})]}),(0,_.jsx)(Do,{isVisible:P,onClose:()=>A(!1),onSelectServer:e=>{I(e),A(!1),D(!0)},onCustomServer:()=>{I(null),A(!1),D(!0)},accessToken:e}),(0,_.jsxs)(rF.TabGroup,{className:"w-full h-full",children:[(0,_.jsx)(rR.TabList,{className:"flex justify-between mt-2 w-full items-center",children:(0,_.jsxs)("div",{className:"flex",children:[(0,_.jsx)(rY.Tab,{children:"All Servers"}),(0,_.jsx)(rY.Tab,{children:"Toolsets"}),(0,_.jsx)(rY.Tab,{children:"Connect"}),(0,_.jsx)(rY.Tab,{children:"Semantic Filter"}),(0,_.jsx)(rY.Tab,{children:"Network Settings"}),(0,ts.isAdminRole)(t)&&(0,_.jsx)(rY.Tab,{children:(0,_.jsxs)("span",{className:"flex items-center gap-2",children:["Submitted MCPs ",(0,_.jsx)(G.default,{})]})})]})}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsx)(rB.TabPanel,{children:g?(0,_.jsx)(O3,{mcpServer:ef,onBack:ex,isProxyAdmin:(0,ts.isAdminRole)(t),isEditing:b,accessToken:e,userID:r,userRole:t,availableAccessGroups:ed,initialTabIndex:+(g===f)},g):(0,_.jsxs)("div",{className:"w-full h-full",children:[(0,_.jsx)("div",{className:"w-full",children:(0,_.jsx)("div",{className:"flex flex-col space-y-4",children:(0,_.jsxs)("div",{className:"flex items-center gap-6 bg-white rounded-lg px-4 py-3 border border-gray-200",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-600 whitespace-nowrap",children:"Team"}),(0,_.jsxs)(eE.Select,{value:j,onChange:e=>{w(e),ec(e,N)},style:{width:220},size:"middle",children:[(0,_.jsx)(Dy,{value:"all",children:(0,_.jsx)("span",{className:"font-medium",children:er?"All Available Servers":"All Servers"})}),(0,_.jsx)(Dy,{value:"personal",children:(0,_.jsx)("span",{className:"font-medium",children:"Personal"})}),eo.map(e=>(0,_.jsx)(Dy,{value:e.team_id,children:(0,_.jsx)("span",{className:"font-medium",children:e.team_alias||e.team_id})},e.team_id))]})]}),(0,_.jsx)("div",{className:"h-6 w-px bg-gray-200"}),(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsxs)(Z.Text,{className:"text-sm font-medium text-gray-600 whitespace-nowrap",children:["Access Group",(0,_.jsx)(tB.Tooltip,{title:"An MCP Access Group is a set of users or teams that have permission to access specific MCP servers. Use access groups to control and organize who can connect to which servers.",children:(0,_.jsx)(T1.QuestionCircleOutlined,{style:{marginLeft:4,color:"#9ca3af"}})})]}),(0,_.jsxs)(eE.Select,{value:N,onChange:e=>{M(e),ec(j,e)},style:{width:220},size:"middle",children:[(0,_.jsx)(Dy,{value:"all",children:(0,_.jsx)("span",{className:"font-medium",children:"All Access Groups"})}),ed.map(e=>(0,_.jsx)(Dy,{value:e,children:(0,_.jsx)("span",{className:"font-medium",children:e})},e))]})]})]})})}),(0,_.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-3",children:[(0,_.jsx)($.Input,{allowClear:!0,prefix:(0,_.jsx)(ry.SearchOutlined,{className:"text-gray-400"}),placeholder:"Search by name, alias, URL, or ID",value:V,onChange:e=>K(e.target.value),style:{maxWidth:320}}),(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(Z.Text,{className:"whitespace-nowrap text-sm font-medium text-gray-600",children:"Sort"}),(0,_.jsx)(eE.Select,{value:ee,onChange:e=>et(e),style:{width:220},size:"middle",children:Dp.map(e=>(0,_.jsx)(Dy,{value:e.value,children:e.label},e.value))})]}),(0,_.jsxs)("div",{className:"ml-auto text-xs text-gray-500",children:[eu.length," of ",C.length," servers"]})]}),(0,_.jsx)("div",{className:"mt-4 w-full",children:s?(0,_.jsx)("div",{className:"flex items-center justify-center rounded-lg border border-dashed border-gray-200 bg-white p-12",children:(0,_.jsx)(rm.Spin,{tip:"Loading MCP servers..."})}):0===eu.length?(0,_.jsx)("div",{className:"rounded-lg border border-dashed border-gray-200 bg-white p-12",children:(0,_.jsx)(e0.Empty,{description:0===C.length?"No MCP servers configured. Click '+ Add New MCP Server' to get started.":"No servers match the current filters or search."})}):(0,_.jsx)("div",{"data-testid":"mcp-servers-grid",className:"grid auto-rows-fr grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3",children:eu.map(e=>(0,_.jsx)(Oz,{server:e,missingUserFields:en[e.server_id],isLoadingHealth:i,isRechecking:d?.has(e.server_id),onClick:()=>{y(e.server_id),v(!0)},onRecheckHealth:o?()=>o(e.server_id):void 0,onByokConnect:e.is_byok?()=>B(e):void 0,onOpenFillFields:()=>H(e),onDelete:(0,ts.isAdminRole)(t)?()=>{m(e.server_id),h(!0)}:void 0},e.server_id))})})]})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(LV,{accessToken:e,userRole:t})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(OO,{})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Dr,{accessToken:e})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Ds,{accessToken:e})}),(0,ts.isAdminRole)(t)&&(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(LR,{accessToken:e})})]})]}),R&&(0,_.jsx)(Dd.ByokCredentialModal,{server:R,open:!!R,onClose:()=>B(null),onSuccess:e=>{n(),B(null)},accessToken:e||""}),(0,_.jsx)(Dm,{server:ei,open:!!ei,accessToken:e,onClose:()=>{H(null),W(null)},onSaved:()=>{es()}})]}):(console.log("Missing required authentication parameters",{accessToken:e,userRole:t,userID:r}),(0,_.jsx)("div",{className:"p-6 text-center text-gray-500",children:"Missing required authentication parameters."}))};var Db=e.i(934879),Dv=e.i(402874),Dj=e.i(152473),Dw=e.i(410160),Dk=e.i(914949),DS=e.i(529681),DN=function(e,t){if(!e)return null;var r={left:e.offsetLeft,right:e.parentElement.clientWidth-e.clientWidth-e.offsetLeft,width:e.clientWidth,top:e.offsetTop,bottom:e.parentElement.clientHeight-e.clientHeight-e.offsetTop,height:e.clientHeight};return t?{left:0,right:0,width:0,top:r.top,bottom:r.bottom,height:r.height}:{left:r.left,right:r.right,width:r.width,top:0,bottom:0,height:0}},DT=function(e){return void 0!==e?"".concat(e,"px"):void 0};function DM(e){var t=e.prefixCls,r=e.containerRef,a=e.value,s=e.getValueIndex,n=e.motionName,l=e.onMotionStart,i=e.onMotionEnd,o=e.direction,d=e.vertical,c=void 0!==d&&d,u=T.useRef(null),m=T.useState(a),p=(0,k_.default)(m,2),h=p[0],f=p[1],x=function(e){var a,n=s(e),l=null==(a=r.current)?void 0:a.querySelectorAll(".".concat(t,"-item"))[n];return(null==l?void 0:l.offsetParent)&&l},g=T.useState(null),y=(0,k_.default)(g,2),_=y[0],b=y[1],v=T.useState(null),j=(0,k_.default)(v,2),w=j[0],k=j[1];(0,kv.default)(function(){if(h!==a){var e=x(h),t=x(a),r=DN(e,c),s=DN(t,c);f(a),b(r),k(s),e&&t?l():i()}},[a]);var S=T.useMemo(function(){if(c){var e;return DT(null!=(e=null==_?void 0:_.top)?e:0)}return"rtl"===o?DT(-(null==_?void 0:_.right)):DT(null==_?void 0:_.left)},[c,o,_]),N=T.useMemo(function(){if(c){var e;return DT(null!=(e=null==w?void 0:w.top)?e:0)}return"rtl"===o?DT(-(null==w?void 0:w.right)):DT(null==w?void 0:w.left)},[c,o,w]);return _&&w?T.createElement(kS.default,{visible:!0,motionName:n,motionAppear:!0,onAppearStart:function(){return c?{transform:"translateY(var(--thumb-start-top))",height:"var(--thumb-start-height)"}:{transform:"translateX(var(--thumb-start-left))",width:"var(--thumb-start-width)"}},onAppearActive:function(){return c?{transform:"translateY(var(--thumb-active-top))",height:"var(--thumb-active-height)"}:{transform:"translateX(var(--thumb-active-left))",width:"var(--thumb-active-width)"}},onVisibleChanged:function(){b(null),k(null),i()}},function(e,r){var a=e.className,s=e.style,n=(0,ky.default)((0,ky.default)({},s),{},{"--thumb-start-left":S,"--thumb-start-width":DT(null==_?void 0:_.width),"--thumb-active-left":N,"--thumb-active-width":DT(null==w?void 0:w.width),"--thumb-start-top":S,"--thumb-start-height":DT(null==_?void 0:_.height),"--thumb-active-top":N,"--thumb-active-height":DT(null==w?void 0:w.height)}),l={ref:(0,kM.composeRef)(u,r),style:n,className:(0,j1.default)("".concat(t,"-thumb"),a)};return T.createElement("div",l)}):null}var DC=["prefixCls","direction","vertical","options","disabled","defaultValue","value","name","onChange","className","motionName"],DL=function(e){var t=e.prefixCls,r=e.className,a=e.disabled,s=e.checked,n=e.label,l=e.title,i=e.value,o=e.name,d=e.onChange,c=e.onFocus,u=e.onBlur,m=e.onKeyDown,p=e.onKeyUp,h=e.onMouseDown;return T.createElement("label",{className:(0,j1.default)(r,(0,kk.default)({},"".concat(t,"-item-disabled"),a)),onMouseDown:h},T.createElement("input",{name:o,className:"".concat(t,"-item-input"),type:"radio",disabled:a,checked:s,onChange:function(e){a||d(e,i)},onFocus:c,onBlur:u,onKeyDown:m,onKeyUp:p}),T.createElement("div",{className:"".concat(t,"-item-label"),title:l},n))},DO=T.forwardRef(function(e,t){var r,a=e.prefixCls,s=void 0===a?"rc-segmented":a,n=e.direction,l=e.vertical,i=e.options,o=void 0===i?[]:i,d=e.disabled,c=e.defaultValue,u=e.value,m=e.name,p=e.onChange,h=e.className,f=e.motionName,x=(0,kT.default)(e,DC),g=T.useRef(null),y=T.useMemo(function(){return(0,kM.composeRef)(g,t)},[g,t]),_=T.useMemo(function(){return o.map(function(e){if("object"===(0,Dw.default)(e)&&null!==e){var t=function(e){if(void 0!==e.title)return e.title;if("object"!==(0,Dw.default)(e.label)){var t;return null==(t=e.label)?void 0:t.toString()}}(e);return(0,ky.default)((0,ky.default)({},e),{},{title:t})}return{label:null==e?void 0:e.toString(),title:null==e?void 0:e.toString(),value:e}})},[o]),b=(0,Dk.default)(null==(r=_[0])?void 0:r.value,{value:u,defaultValue:c}),v=(0,k_.default)(b,2),j=v[0],w=v[1],k=T.useState(!1),S=(0,k_.default)(k,2),N=S[0],M=S[1],C=function(e,t){w(t),null==p||p(t)},L=(0,DS.default)(x,["children"]),O=T.useState(!1),D=(0,k_.default)(O,2),P=D[0],A=D[1],E=T.useState(!1),I=(0,k_.default)(E,2),Y=I[0],F=I[1],R=function(){F(!0)},B=function(){F(!1)},z=function(){A(!1)},H=function(e){"Tab"===e.key&&A(!0)},$=function(e){var t=_.findIndex(function(e){return e.value===j}),r=_.length,a=_[(t+e+r)%r];a&&(w(a.value),null==p||p(a.value))},q=function(e){switch(e.key){case"ArrowLeft":case"ArrowUp":$(-1);break;case"ArrowRight":case"ArrowDown":$(1)}};return T.createElement("div",(0,rp.default)({role:"radiogroup","aria-label":"segmented control",tabIndex:d?void 0:0,"aria-orientation":l?"vertical":"horizontal"},L,{className:(0,j1.default)(s,(0,kk.default)((0,kk.default)((0,kk.default)({},"".concat(s,"-rtl"),"rtl"===n),"".concat(s,"-disabled"),d),"".concat(s,"-vertical"),l),void 0===h?"":h),ref:y}),T.createElement("div",{className:"".concat(s,"-group")},T.createElement(DM,{vertical:l,prefixCls:s,value:j,containerRef:g,motionName:"".concat(s,"-").concat(void 0===f?"thumb-motion":f),direction:n,getValueIndex:function(e){return _.findIndex(function(t){return t.value===e})},onMotionStart:function(){M(!0)},onMotionEnd:function(){M(!1)}}),_.map(function(e){return T.createElement(DL,(0,rp.default)({},e,{name:m,key:e.value,prefixCls:s,className:(0,j1.default)(e.className,"".concat(s,"-item"),(0,kk.default)((0,kk.default)({},"".concat(s,"-item-selected"),e.value===j&&!N),"".concat(s,"-item-focused"),Y&&P&&e.value===j)),checked:e.value===j,onChange:C,onFocus:R,onBlur:B,onKeyDown:q,onKeyUp:H,onMouseDown:z,disabled:!!d||!!e.disabled}))})))});function DD(e,t){return{[`${e}, ${e}:hover, ${e}:focus`]:{color:t.colorTextDisabled,cursor:"not-allowed"}}}function DP(e){return{background:e.itemSelectedBg,boxShadow:e.boxShadowTertiary}}let DA=Object.assign({overflow:"hidden"},j3.textEllipsis),DE=(0,j8.genStyleHooks)("Segmented",e=>{let{lineWidth:t,calc:r}=e;return(e=>{let{componentCls:t}=e,r=e.calc(e.controlHeight).sub(e.calc(e.trackPadding).mul(2)).equal(),a=e.calc(e.controlHeightLG).sub(e.calc(e.trackPadding).mul(2)).equal(),s=e.calc(e.controlHeightSM).sub(e.calc(e.trackPadding).mul(2)).equal();return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,j3.resetComponent)(e)),{display:"inline-block",padding:e.trackPadding,color:e.itemColor,background:e.trackBg,borderRadius:e.borderRadius,transition:`all ${e.motionDurationMid}`}),(0,j3.genFocusStyle)(e)),{[`${t}-group`]:{position:"relative",display:"flex",alignItems:"stretch",justifyItems:"flex-start",flexDirection:"row",width:"100%"},[`&${t}-rtl`]:{direction:"rtl"},[`&${t}-vertical`]:{[`${t}-group`]:{flexDirection:"column"},[`${t}-thumb`]:{width:"100%",height:0,padding:`0 ${(0,kq.unit)(e.paddingXXS)}`}},[`&${t}-block`]:{display:"flex"},[`&${t}-block ${t}-item`]:{flex:1,minWidth:0},[`${t}-item`]:{position:"relative",textAlign:"center",cursor:"pointer",transition:`color ${e.motionDurationMid}`,borderRadius:e.borderRadiusSM,transform:"translateZ(0)","&-selected":Object.assign(Object.assign({},DP(e)),{color:e.itemSelectedColor}),"&-focused":(0,j3.genFocusOutline)(e),"&::after":{content:'""',position:"absolute",zIndex:-1,width:"100%",height:"100%",top:0,insetInlineStart:0,borderRadius:"inherit",opacity:0,transition:`opacity ${e.motionDurationMid}, background-color ${e.motionDurationMid}`,pointerEvents:"none"},[`&:not(${t}-item-selected):not(${t}-item-disabled)`]:{"&:hover, &:active":{color:e.itemHoverColor},"&:hover::after":{opacity:1,backgroundColor:e.itemHoverBg},"&:active::after":{opacity:1,backgroundColor:e.itemActiveBg}},"&-label":Object.assign({minHeight:r,lineHeight:(0,kq.unit)(r),padding:`0 ${(0,kq.unit)(e.segmentedPaddingHorizontal)}`},DA),"&-icon + *":{marginInlineStart:e.calc(e.marginSM).div(2).equal()},"&-input":{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:0,opacity:0,pointerEvents:"none"}},[`${t}-thumb`]:Object.assign(Object.assign({},DP(e)),{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:"100%",padding:`${(0,kq.unit)(e.paddingXXS)} 0`,borderRadius:e.borderRadiusSM,[`& ~ ${t}-item:not(${t}-item-selected):not(${t}-item-disabled)::after`]:{backgroundColor:"transparent"}}),[`&${t}-lg`]:{borderRadius:e.borderRadiusLG,[`${t}-item-label`]:{minHeight:a,lineHeight:(0,kq.unit)(a),padding:`0 ${(0,kq.unit)(e.segmentedPaddingHorizontal)}`,fontSize:e.fontSizeLG},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadius}},[`&${t}-sm`]:{borderRadius:e.borderRadiusSM,[`${t}-item-label`]:{minHeight:s,lineHeight:(0,kq.unit)(s),padding:`0 ${(0,kq.unit)(e.segmentedPaddingHorizontalSM)}`},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadiusXS}}}),DD(`&-disabled ${t}-item`,e)),DD(`${t}-item-disabled`,e)),{[`${t}-thumb-motion-appear-active`]:{transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOut}, width ${e.motionDurationSlow} ${e.motionEaseInOut}`,willChange:"transform, width"},[`&${t}-shape-round`]:{borderRadius:9999,[`${t}-item, ${t}-thumb`]:{borderRadius:9999}}})}})((0,j7.mergeToken)(e,{segmentedPaddingHorizontal:r(e.controlPaddingHorizontal).sub(t).equal(),segmentedPaddingHorizontalSM:r(e.controlPaddingHorizontalSM).sub(t).equal()}))},e=>{let{colorTextLabel:t,colorText:r,colorFillSecondary:a,colorBgElevated:s,colorFill:n,lineWidthBold:l,colorBgLayout:i}=e;return{trackPadding:l,trackBg:i,itemColor:t,itemHoverColor:r,itemHoverBg:a,itemSelectedBg:s,itemActiveBg:n,itemSelectedColor:r}});var DI=function(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&0>t.indexOf(a)&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,a=Object.getOwnPropertySymbols(e);st.indexOf(a[s])&&Object.prototype.propertyIsEnumerable.call(e,a[s])&&(r[a[s]]=e[a[s]]);return r};let DY=T.forwardRef((e,t)=>{let r=(0,kI.default)(),{prefixCls:a,className:s,rootClassName:n,block:l,options:i=[],size:o="middle",style:d,vertical:c,shape:u="default",name:m=r}=e,p=DI(e,["prefixCls","className","rootClassName","block","options","size","style","vertical","shape","name"]),{getPrefixCls:h,direction:f,className:x,style:g}=(0,j4.useComponentConfig)("segmented"),y=h("segmented",a),[_,b,v]=DE(y),j=(0,Mq.default)(o),w=T.useMemo(()=>i.map(e=>{if("object"==typeof e&&(null==e?void 0:e.icon)){let{icon:t,label:r}=e;return Object.assign(Object.assign({},DI(e,["icon","label"])),{label:T.createElement(T.Fragment,null,T.createElement("span",{className:`${y}-item-icon`},t),r&&T.createElement("span",null,r))})}return e}),[i,y]),k=(0,j1.default)(s,n,x,{[`${y}-block`]:l,[`${y}-sm`]:"small"===j,[`${y}-lg`]:"large"===j,[`${y}-vertical`]:c,[`${y}-shape-${u}`]:"round"===u},b,v),S=Object.assign(Object.assign({},g),d);return _(T.createElement(DO,Object.assign({},p,{name:m,className:k,style:S,options:w,ref:t,prefixCls:y,direction:f,vertical:c})))}),DF=(0,ej.createQueryKeys)("agents"),DR=()=>{let{accessToken:e,userRole:t}=(0,k.default)();return(0,ev.useQuery)({queryKey:DF.list({}),queryFn:async()=>await (0,Q.getAgentsList)(e),enabled:!!e&&ts.all_admin_roles.includes(t||"")})},DB=(0,ej.createQueryKeys)("customers");var Dz=e.i(738014),DH=e.i(621482);let D$=(0,ej.createQueryKeys)("infiniteUsers"),Dq=50;var DU=e.i(980187),DW=["layout","type","stroke","connectNulls","isRange","ref"],DV=["key"];function DG(e){return(DG="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function DK(e,t){if(null==e)return{};var r,a,s=function(e,t){if(null==e)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function DJ(){return(DJ=Object.assign.bind()).apply(this,arguments)}function DQ(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function DX(e){for(var t=1;t0||!(0,uq.default)(i,a)||!(0,uq.default)(o,s))?this.renderAreaWithAnimation(e,t):this.renderAreaStatically(a,s,e,t)}},{key:"render",value:function(){var e,t=this.props,r=t.hide,a=t.dot,s=t.points,n=t.className,l=t.top,i=t.left,o=t.xAxis,d=t.yAxis,c=t.width,u=t.height,m=t.isAnimationActive,p=t.id;if(r||!s||!s.length)return null;var h=this.state.isAnimationFinished,f=1===s.length,x=(0,r7.default)("recharts-area",n),g=o&&o.allowDataOverflow,y=d&&d.allowDataOverflow,_=g||y,b=(0,as.default)(p)?this.id:p,v=null!=(e=aq(a,!1))?e:{r:3,strokeWidth:2},j=v.r,w=v.strokeWidth,k=(aH(a)?a:{}).clipDot,S=void 0===k||k,N=2*(void 0===j?3:j)+(void 0===w?2:w);return T.default.createElement(a7,{className:x},g||y?T.default.createElement("defs",null,T.default.createElement("clipPath",{id:"clipPath-".concat(b)},T.default.createElement("rect",{x:g?i:i-c/2,y:y?l:l-u/2,width:g?c:2*c,height:y?u:2*u})),!S&&T.default.createElement("clipPath",{id:"clipPath-dots-".concat(b)},T.default.createElement("rect",{x:i-N/2,y:l-N/2,width:c+N,height:u+N}))):null,f?null:this.renderArea(_,b),(a||f)&&this.renderDots(_,S,b),(!m||h)&&pX.renderCallByParent(this.props,s))}}],r=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,curBaseLine:e.baseLine,prevPoints:t.curPoints,prevBaseLine:t.curBaseLine}:e.points!==t.curPoints||e.baseLine!==t.curBaseLine?{curPoints:e.points,curBaseLine:e.baseLine}:null}}],t&&DZ(a.prototype,t),r&&DZ(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}(T.PureComponent);D4(D6,"displayName","Area"),D4(D6,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!sb.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"}),D4(D6,"getBaseValue",function(e,t,r,a){var s=e.layout,n=e.baseValue,l=t.props.baseValue,i=null!=l?l:n;if(ai(i)&&"number"==typeof i)return i;var o="horizontal"===s?a:r,d=o.scale.domain();if("number"===o.type){var c=Math.max(d[0],d[1]),u=Math.min(d[0],d[1]);return"dataMin"===i?u:"dataMax"===i||c<0?c:Math.max(Math.min(d[0],d[1]),0)}return"dataMin"===i?d[0]:"dataMax"===i?d[1]:d[0]}),D4(D6,"getComposedData",function(e){var t,r=e.props,a=e.item,s=e.xAxis,n=e.yAxis,l=e.xAxisTicks,i=e.yAxisTicks,o=e.bandSize,d=e.dataKey,c=e.stackedData,u=e.dataStartIndex,m=e.displayedData,p=e.offset,h=r.layout,f=c&&c.length,x=D6.getBaseValue(r,a,s,n),g="horizontal"===h,y=!1,_=m.map(function(e,t){f?r=c[u+t]:Array.isArray(r=mk(e,d))?y=!0:r=[x,r];var r,a=null==r[1]||f&&null==mk(e,d);return g?{x:mV({axis:s,ticks:l,bandSize:o,entry:e,index:t}),y:a?null:n.scale(r[1]),value:r,payload:e}:{x:a?null:s.scale(r[1]),y:mV({axis:n,ticks:i,bandSize:o,entry:e,index:t}),value:r,payload:e}});return t=f||y?_.map(function(e){var t=Array.isArray(e.value)?e.value[0]:null;return g?{x:e.x,y:null!=t&&null!=e.y?n.scale(t):null}:{x:null!=t?s.scale(t):null,y:e.y}}):g?n.scale(x):s.scale(x),DX({points:_,baseLine:t,layout:h,isRange:y},p)}),D4(D6,"renderDotItem",function(e,t){var r;if(T.default.isValidElement(e))r=T.default.cloneElement(e,t);else if((0,ay.default)(e))r=e(t);else{var a=(0,r7.default)("recharts-area-dot","boolean"!=typeof e?e.className:""),s=t.key,n=DK(t,DV);r=T.default.createElement(nw,DJ({},n,{key:s,className:a}))}return r});var D3=x6({chartName:"AreaChart",GraphicalChild:D6,axisComponents:[{axisType:"xAxis",AxisComp:gS},{axisType:"yAxis",AxisComp:gA}],formatAxisMap:hW}),D8=["type","layout","connectNulls","ref"],D7=["key"];function D9(e){return(D9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Pe(e,t){if(null==e)return{};var r,a,s=function(e,t){if(null==e)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Pt(){return(Pt=Object.assign.bind()).apply(this,arguments)}function Pr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function Pa(e){for(var t=1;ttypeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Pn(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Pn(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=Array(t);ri){d=[].concat(Ps(s.slice(0,c)),[i-u]);break}var m=d.length%2==0?[0,o]:[o];return[].concat(Ps(a.repeat(s,l)),Ps(d),m).map(function(e){return"".concat(e,"px")}).join(", ")}),Pc(e,"id",ac("recharts-line-")),Pc(e,"pathRef",function(t){e.mainCurve=t}),Pc(e,"handleAnimationEnd",function(){e.setState({isAnimationFinished:!0}),e.props.onAnimationEnd&&e.props.onAnimationEnd()}),Pc(e,"handleAnimationStart",function(){e.setState({isAnimationFinished:!1}),e.props.onAnimationStart&&e.props.onAnimationStart()}),e}if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");return a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),e&&Pd(a,e),t=[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();this.setState({totalLength:e})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();e!==this.state.totalLength&&this.setState({totalLength:e})}}},{key:"getTotalLength",value:function(){var e=this.mainCurve;try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch(e){return 0}}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var r=this.props,a=r.points,s=r.xAxis,n=r.yAxis,l=r.layout,i=aF(r.children,mp);if(!i)return null;var o=function(e,t){return{x:e.x,y:e.y,value:e.value,errorVal:mk(e.payload,t)}};return T.default.createElement(a7,{clipPath:e?"url(#clipPath-".concat(t,")"):null},i.map(function(e){return T.default.cloneElement(e,{key:"bar-".concat(e.props.dataKey),data:a,xAxis:s,yAxis:n,layout:l,dataPointFormatter:o})}))}},{key:"renderDots",value:function(e,t,r){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var s=this.props,n=s.dot,l=s.points,i=s.dataKey,o=aq(this.props,!1),d=aq(n,!0),c=l.map(function(e,t){var r=Pa(Pa(Pa({key:"dot-".concat(t),r:3},o),d),{},{index:t,cx:e.x,cy:e.y,value:e.value,dataKey:i,payload:e.payload,points:l});return a.renderDotItem(n,r)}),u={clipPath:e?"url(#clipPath-".concat(t?"":"dots-").concat(r,")"):null};return T.default.createElement(a7,Pt({className:"recharts-line-dots",key:"dots"},u),c)}},{key:"renderCurveStatically",value:function(e,t,r,a){var s=this.props,n=s.type,l=s.layout,i=s.connectNulls,o=Pa(Pa(Pa({},aq((s.ref,Pe(s,D8)),!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:t?"url(#clipPath-".concat(r,")"):null,points:e},a),{},{type:n,layout:l,connectNulls:i});return T.default.createElement(xx,Pt({},o,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(e,t){var r=this,a=this.props,s=a.points,n=a.strokeDasharray,l=a.isAnimationActive,i=a.animationBegin,o=a.animationDuration,d=a.animationEasing,c=a.animationId,u=a.animateNewValues,m=a.width,p=a.height,h=this.state,f=h.prevPoints,x=h.totalLength;return T.default.createElement(lD,{begin:i,duration:o,isActive:l,easing:d,from:{t:0},to:{t:1},key:"line-".concat(c),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(a){var l,i=a.t;if(f){var o=f.length/s.length,d=s.map(function(e,t){var r=Math.floor(t*o);if(f[r]){var a=f[r],s=ah(a.x,e.x),n=ah(a.y,e.y);return Pa(Pa({},e),{},{x:s(i),y:n(i)})}if(u){var l=ah(2*m,e.x),d=ah(p/2,e.y);return Pa(Pa({},e),{},{x:l(i),y:d(i)})}return Pa(Pa({},e),{},{x:e.x,y:e.y})});return r.renderCurveStatically(d,e,t)}var c=ah(0,x)(i);if(n){var h="".concat(n).split(/[,\s]+/gim).map(function(e){return parseFloat(e)});l=r.getStrokeDasharray(c,x,h)}else l=r.generateSimpleStrokeDasharray(x,c);return r.renderCurveStatically(s,e,t,{strokeDasharray:l})})}},{key:"renderCurve",value:function(e,t){var r=this.props,a=r.points,s=r.isAnimationActive,n=this.state,l=n.prevPoints,i=n.totalLength;return s&&a&&a.length&&(!l&&i>0||!(0,uq.default)(l,a))?this.renderCurveWithAnimation(e,t):this.renderCurveStatically(a,e,t)}},{key:"render",value:function(){var e,t=this.props,r=t.hide,a=t.dot,s=t.points,n=t.className,l=t.xAxis,i=t.yAxis,o=t.top,d=t.left,c=t.width,u=t.height,m=t.isAnimationActive,p=t.id;if(r||!s||!s.length)return null;var h=this.state.isAnimationFinished,f=1===s.length,x=(0,r7.default)("recharts-line",n),g=l&&l.allowDataOverflow,y=i&&i.allowDataOverflow,_=g||y,b=(0,as.default)(p)?this.id:p,v=null!=(e=aq(a,!1))?e:{r:3,strokeWidth:2},j=v.r,w=v.strokeWidth,k=(aH(a)?a:{}).clipDot,S=void 0===k||k,N=2*(void 0===j?3:j)+(void 0===w?2:w);return T.default.createElement(a7,{className:x},g||y?T.default.createElement("defs",null,T.default.createElement("clipPath",{id:"clipPath-".concat(b)},T.default.createElement("rect",{x:g?d:d-c/2,y:y?o:o-u/2,width:g?c:2*c,height:y?u:2*u})),!S&&T.default.createElement("clipPath",{id:"clipPath-dots-".concat(b)},T.default.createElement("rect",{x:d-N/2,y:o-N/2,width:c+N,height:u+N}))):null,!f&&this.renderCurve(_,b),this.renderErrorBar(_,b),(f||a)&&this.renderDots(_,S,b),(!m||h)&&pX.renderCallByParent(this.props,s))}}],r=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,prevPoints:t.curPoints}:e.points!==t.curPoints?{curPoints:e.points}:null}},{key:"repeat",value:function(e,t){for(var r=e.length%2!=0?[].concat(Ps(e),[0]):e,a=[],s=0;s{let{data:r=[],categories:a=[],index:s,stack:n=!1,colors:l=M.themeColorRange,valueFormatter:i=L.defaultValueFormatter,startEndOnly:o=!1,showXAxis:d=!0,showYAxis:c=!0,yAxisWidth:u=56,intervalType:m="equidistantPreserveStart",showAnimation:p=!1,animationDuration:h=900,showTooltip:f=!0,showLegend:x=!0,showGridLines:g=!0,showGradient:y=!0,autoMinValue:_=!1,curveType:b="linear",minValue:v,maxValue:j,connectNulls:w=!1,allowDecimals:k=!0,noDataText:S,className:O,onValueChange:D,enableLegendSlider:P=!1,customTooltip:A,rotateLabelX:E,padding:I=!d&&!c||o&&!c?{left:0,right:0}:{left:20,right:20},tickGap:Y=5,xAxisLabel:F,yAxisLabel:R}=e,B=(0,N.__rest)(e,["data","categories","index","stack","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","showAnimation","animationDuration","showTooltip","showLegend","showGridLines","showGradient","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","padding","tickGap","xAxisLabel","yAxisLabel"]),[z,H]=(0,T.useState)(60),[$,q]=(0,T.useState)(void 0),[U,W]=(0,T.useState)(void 0),V=yt(a,l),G=yr(_,v,j),K=!!D;function J(e){K&&(e===U&&!$||ys(r,e)&&$&&$.dataKey===e?(W(void 0),null==D||D(null)):(W(e),null==D||D({eventType:"category",categoryClicked:e})),q(void 0))}return T.default.createElement("div",Object.assign({ref:t,className:(0,C.tremorTwMerge)("w-full h-80",O)},B),T.default.createElement(aZ,{className:"h-full w-full"},(null==r?void 0:r.length)?T.default.createElement(D3,{data:r,onClick:K&&(U||$)?()=>{q(void 0),W(void 0),null==D||D(null)}:void 0,margin:{bottom:F?30:void 0,left:R?20:void 0,right:R?5:void 0,top:5}},g?T.default.createElement(gZ,{className:(0,C.tremorTwMerge)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,T.default.createElement(gS,{padding:I,hide:!d,dataKey:s,tick:{transform:"translate(0, 6)"},ticks:o?[r[0][s],r[r.length-1][s]]:void 0,fill:"",stroke:"",className:(0,C.tremorTwMerge)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),interval:o?"preserveStartEnd":m,tickLine:!1,axisLine:!1,minTickGap:Y,angle:null==E?void 0:E.angle,dy:null==E?void 0:E.verticalShift,height:null==E?void 0:E.xAxisHeight},F&&T.default.createElement(pI,{position:"insideBottom",offset:-20,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},F)),T.default.createElement(gA,{width:u,hide:!c,axisLine:!1,tickLine:!1,type:"number",domain:G,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,C.tremorTwMerge)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:i,allowDecimals:k},R&&T.default.createElement(pI,{position:"insideLeft",style:{textAnchor:"middle"},angle:-90,offset:-15,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},R)),T.default.createElement(sD,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:f?({active:e,payload:t,label:r})=>A?T.default.createElement(A,{payload:null==t?void 0:t.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!=(t=V.get(e.dataKey))?t:r8.BaseColors.Gray})}),active:e,label:r}):T.default.createElement(g9,{active:e,payload:t,label:r,valueFormatter:i,categoryColors:V}):T.default.createElement(T.default.Fragment,null),position:{y:0}}),x?T.default.createElement(nv,{verticalAlign:"top",height:z,content:({payload:e})=>g3({payload:e},V,H,U,K?e=>J(e):void 0,P)}):null,a.map(e=>{var t,r,a;let s=(null!=(t=V.get(e))?t:r8.BaseColors.Gray).replace("#","");return T.default.createElement("defs",{key:e},y?T.default.createElement("linearGradient",{className:(0,L.getColorClassNames)(null!=(r=V.get(e))?r:r8.BaseColors.Gray,M.colorPalette.text).textColor,id:s,x1:"0",y1:"0",x2:"0",y2:"1"},T.default.createElement("stop",{offset:"5%",stopColor:"currentColor",stopOpacity:$||U&&U!==e?.15:.4}),T.default.createElement("stop",{offset:"95%",stopColor:"currentColor",stopOpacity:0})):T.default.createElement("linearGradient",{className:(0,L.getColorClassNames)(null!=(a=V.get(e))?a:r8.BaseColors.Gray,M.colorPalette.text).textColor,id:s,x1:"0",y1:"0",x2:"0",y2:"1"},T.default.createElement("stop",{stopColor:"currentColor",stopOpacity:$||U&&U!==e?.1:.3})))}),a.map(e=>{var t,a;let s=(null!=(t=V.get(e))?t:r8.BaseColors.Gray).replace("#","");return T.default.createElement(D6,{className:(0,L.getColorClassNames)(null!=(a=V.get(e))?a:r8.BaseColors.Gray,M.colorPalette.text).strokeColor,strokeOpacity:$||U&&U!==e?.3:1,activeDot:e=>{var t;let{cx:a,cy:s,stroke:n,strokeLinecap:l,strokeLinejoin:i,strokeWidth:o,dataKey:d}=e;return T.default.createElement(nw,{className:(0,C.tremorTwMerge)("stroke-tremor-background dark:stroke-dark-tremor-background",D?"cursor-pointer":"",(0,L.getColorClassNames)(null!=(t=V.get(d))?t:r8.BaseColors.Gray,M.colorPalette.text).fillColor),cx:a,cy:s,r:5,fill:"",stroke:n,strokeLinecap:l,strokeLinejoin:i,strokeWidth:o,onClick:(t,a)=>{a.stopPropagation(),K&&(e.index===(null==$?void 0:$.index)&&e.dataKey===(null==$?void 0:$.dataKey)||ys(r,e.dataKey)&&U&&U===e.dataKey?(W(void 0),q(void 0),null==D||D(null)):(W(e.dataKey),q({index:e.index,dataKey:e.dataKey}),null==D||D(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}})},dot:t=>{var a;let{stroke:s,strokeLinecap:n,strokeLinejoin:l,strokeWidth:i,cx:o,cy:d,dataKey:c,index:u}=t;return ys(r,e)&&!($||U&&U!==e)||(null==$?void 0:$.index)===u&&(null==$?void 0:$.dataKey)===e?T.default.createElement(nw,{key:u,cx:o,cy:d,r:5,stroke:s,fill:"",strokeLinecap:n,strokeLinejoin:l,strokeWidth:i,className:(0,C.tremorTwMerge)("stroke-tremor-background dark:stroke-dark-tremor-background",D?"cursor-pointer":"",(0,L.getColorClassNames)(null!=(a=V.get(c))?a:r8.BaseColors.Gray,M.colorPalette.text).fillColor)}):T.default.createElement(T.Fragment,{key:u})},key:e,name:e,type:b,dataKey:e,stroke:"",fill:`url(#${s})`,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:p,animationDuration:h,stackId:n?"a":void 0,connectNulls:w})}),D?a.map(e=>T.default.createElement(Pm,{className:(0,C.tremorTwMerge)("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:b,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:w,onClick:(e,t)=>{t.stopPropagation();let{name:r}=e;J(r)}})):null):T.default.createElement(ye,{noDataText:S})))});Pp.displayName="AreaChart";let Ph={blue:"#3b82f6",cyan:"#06b6d4",indigo:"#6366f1",green:"#22c55e",red:"#ef4444",purple:"#8b5cf6",emerald:"#37bc7d"},Pf=({active:e,payload:t,label:r})=>e&&t&&t.length?(0,_.jsxs)("div",{className:"w-56 rounded-tremor-default border border-tremor-border bg-tremor-background p-2 text-tremor-default shadow-tremor-dropdown",children:[(0,_.jsx)("p",{className:"text-tremor-content-strong",children:r}),t.map(e=>{let t=e.dataKey?.toString();if(!t||!e.payload)return null;let r=((e,t)=>{let r=t.substring(t.indexOf(".")+1);if(e.metrics&&r in e.metrics)return e.metrics[r]})(e.payload,t),a=t.includes("spend"),s=void 0!==r?a?`$${r.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`:r.toLocaleString():"N/A",n=Ph[e.color]||e.color;return(0,_.jsxs)("div",{className:"flex items-center justify-between space-x-4",children:[(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full ring-2 ring-white drop-shadow-md",style:{backgroundColor:n}}),(0,_.jsx)("p",{className:"font-medium text-tremor-content dark:text-dark-tremor-content",children:t.replace("metrics.","").replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")})]}),(0,_.jsx)("p",{className:"font-medium text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",children:s})]},t)})]}):null,Px=({categories:e,colors:t})=>(0,_.jsx)("div",{className:"flex items-center justify-end space-x-4",children:e.map((e,r)=>{let a=Ph[t[r]]||t[r];return(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full ring-4 ring-white",style:{backgroundColor:a}}),(0,_.jsx)("p",{className:"text-sm text-tremor-content dark:text-dark-tremor-content",children:e.replace("metrics.","").replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")})]},e)})}),Pg=[{title:"Model",dataIndex:"model",key:"model",render:e=>e||"-"},{title:"Spend (USD)",dataIndex:"spend",key:"spend",render:e=>`$${(0,rV.formatNumberWithCommas)(e,2)}`},{title:"Successful",dataIndex:"successful_requests",key:"successful_requests",render:e=>(0,_.jsx)("span",{className:"text-green-600",children:e?.toLocaleString()||0})},{title:"Failed",dataIndex:"failed_requests",key:"failed_requests",render:e=>(0,_.jsx)("span",{className:"text-red-600",children:e?.toLocaleString()||0})},{title:"Tokens",dataIndex:"tokens",key:"tokens",render:e=>e?.toLocaleString()||0}],Py=({topModels:e})=>{let[t,r]=(0,T.useState)("table");return 0===e.length?null:(0,_.jsxs)(P.Card,{className:"mt-4",children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,_.jsx)(X.Title,{children:"Model Usage"}),(0,_.jsxs)("div",{className:"flex space-x-2",children:[(0,_.jsx)("button",{onClick:()=>r("table"),className:`px-3 py-1 text-sm rounded-md ${"table"===t?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"}`,children:"Table"}),(0,_.jsx)("button",{onClick:()=>r("chart"),className:`px-3 py-1 text-sm rounded-md ${"chart"===t?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"}`,children:"Chart"})]})]}),"chart"===t?(0,_.jsx)("div",{className:"max-h-[234px] overflow-y-auto",children:(0,_.jsx)(yn,{style:{height:40*e.length},data:e.map(e=>({key:e.model,spend:e.spend})),index:"key",categories:["spend"],colors:["cyan"],valueFormatter:e=>`$${(0,rV.formatNumberWithCommas)(e,2)}`,layout:"vertical",yAxisWidth:180,tickGap:5,showLegend:!1})}):(0,_.jsx)(eK.Table,{columns:Pg,dataSource:e,rowKey:"model",size:"small",pagination:!1,scroll:e.length>5?{y:195}:void 0})]})};function P_(e){return e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?e/1e3+"k":e.toString()}function Pb(e){return 0===e?"$0":e>=1e6?"$"+e/1e6+"M":e>=1e3?"$"+e/1e3+"k":"$"+e}let Pv=({modelName:e,metrics:t,hidePromptCachingMetrics:r=!1})=>(0,_.jsxs)("div",{className:"space-y-2",children:[(0,_.jsxs)(ee.Grid,{numItems:4,className:"gap-4",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Total Requests"}),(0,_.jsx)(X.Title,{children:t.total_requests.toLocaleString()})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Total Successful Requests"}),(0,_.jsx)(X.Title,{children:t.total_successful_requests.toLocaleString()})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Total Tokens"}),(0,_.jsx)(X.Title,{children:t.total_tokens.toLocaleString()}),(0,_.jsxs)(Z.Text,{children:[Math.round(t.total_tokens/t.total_successful_requests)," avg per successful request"]})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Total Spend"}),(0,_.jsxs)(X.Title,{children:["$",(0,rV.formatNumberWithCommas)(t.total_spend,2)]}),(0,_.jsxs)(Z.Text,{children:["$",(0,rV.formatNumberWithCommas)(t.total_spend/t.total_successful_requests,3)," per successful request"]})]})]}),t.top_api_keys&&t.top_api_keys.length>0&&(0,_.jsxs)(P.Card,{className:"mt-4",children:[(0,_.jsx)(X.Title,{children:"Top Virtual Keys by Spend"}),(0,_.jsx)("div",{className:"mt-3",children:(0,_.jsx)("div",{className:"grid grid-cols-1 gap-2",children:t.top_api_keys.map((e,t)=>(0,_.jsxs)("div",{className:"flex justify-between items-center p-3 bg-gray-50 rounded-lg",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:e.key_alias||`${e.api_key.substring(0,10)}...`}),e.team_id&&(0,_.jsxs)(Z.Text,{className:"text-xs text-gray-500",children:["Team: ",e.team_id]})]}),(0,_.jsxs)("div",{className:"text-right",children:[(0,_.jsxs)(Z.Text,{className:"font-medium",children:["$",(0,rV.formatNumberWithCommas)(e.spend,2)]}),(0,_.jsxs)(Z.Text,{className:"text-xs text-gray-500",children:[e.requests.toLocaleString()," requests | ",e.tokens.toLocaleString()," tokens"]})]})]},e.api_key))})})]}),t.top_models&&t.top_models.length>0&&(0,_.jsx)(Py,{topModels:t.top_models}),(0,_.jsxs)(P.Card,{className:"mt-4",children:[(0,_.jsxs)("div",{className:"flex justify-between items-center",children:[(0,_.jsx)(X.Title,{children:"Spend per day"}),(0,_.jsx)(Px,{categories:["metrics.spend"],colors:["green"]})]}),(0,_.jsx)(yn,{className:"mt-4",data:t.daily_data,index:"date",categories:["metrics.spend"],colors:["green"],valueFormatter:e=>`$${(0,rV.formatNumberWithCommas)(e,2,!0)}`,yAxisWidth:72})]}),(0,_.jsxs)(ee.Grid,{numItems:2,className:"gap-4 mt-4",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center",children:[(0,_.jsx)(X.Title,{children:"Total Tokens"}),(0,_.jsx)(Px,{categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"]})]}),(0,_.jsx)(Pp,{className:"mt-4",data:t.daily_data,index:"date",categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"],valueFormatter:P_,customTooltip:Pf,showLegend:!1})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center",children:[(0,_.jsx)(X.Title,{children:"Requests per day"}),(0,_.jsx)(Px,{categories:["metrics.api_requests"],colors:["blue"]})]}),(0,_.jsx)(yn,{className:"mt-4",data:t.daily_data,index:"date",categories:["metrics.api_requests"],colors:["blue"],valueFormatter:P_,customTooltip:Pf,showLegend:!1})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center",children:[(0,_.jsx)(X.Title,{children:"Success vs Failed Requests"}),(0,_.jsx)(Px,{categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"]})]}),(0,_.jsx)(Pp,{className:"mt-4",data:t.daily_data,index:"date",categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"],valueFormatter:P_,customTooltip:Pf,showLegend:!1})]}),!r&&(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center",children:[(0,_.jsx)(X.Title,{children:"Prompt Caching Metrics"}),(0,_.jsx)(Px,{categories:["metrics.cache_read_input_tokens","metrics.cache_creation_input_tokens"],colors:["cyan","purple"]})]}),(0,_.jsxs)("div",{className:"mb-2",children:[(0,_.jsxs)(Z.Text,{children:["Cache Read: ",t.total_cache_read_input_tokens?.toLocaleString()||0," tokens"]}),(0,_.jsxs)(Z.Text,{children:["Cache Creation: ",t.total_cache_creation_input_tokens?.toLocaleString()||0," tokens"]})]}),(0,_.jsx)(Pp,{className:"mt-4",data:t.daily_data,index:"date",categories:["metrics.cache_read_input_tokens","metrics.cache_creation_input_tokens"],colors:["cyan","purple"],valueFormatter:P_,customTooltip:Pf,showLegend:!1})]})]})]}),Pj=({modelMetrics:e,hidePromptCachingMetrics:t=!1})=>{let r=Object.keys(e).sort((t,r)=>""===t?1:""===r?-1:e[r].total_spend-e[t].total_spend),a={total_requests:0,total_successful_requests:0,total_tokens:0,total_spend:0,total_cache_read_input_tokens:0,total_cache_creation_input_tokens:0,daily_data:{}};Object.values(e).forEach(e=>{a.total_requests+=e.total_requests,a.total_successful_requests+=e.total_successful_requests,a.total_tokens+=e.total_tokens,a.total_spend+=e.total_spend,a.total_cache_read_input_tokens+=e.total_cache_read_input_tokens||0,a.total_cache_creation_input_tokens+=e.total_cache_creation_input_tokens||0,e.daily_data.forEach(e=>{a.daily_data[e.date]||(a.daily_data[e.date]={prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,spend:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0}),a.daily_data[e.date].prompt_tokens+=e.metrics.prompt_tokens,a.daily_data[e.date].completion_tokens+=e.metrics.completion_tokens,a.daily_data[e.date].total_tokens+=e.metrics.total_tokens,a.daily_data[e.date].api_requests+=e.metrics.api_requests,a.daily_data[e.date].spend+=e.metrics.spend,a.daily_data[e.date].successful_requests+=e.metrics.successful_requests,a.daily_data[e.date].failed_requests+=e.metrics.failed_requests,a.daily_data[e.date].cache_read_input_tokens+=e.metrics.cache_read_input_tokens||0,a.daily_data[e.date].cache_creation_input_tokens+=e.metrics.cache_creation_input_tokens||0})});let s=Object.entries(a.daily_data).map(([e,t])=>({date:e,metrics:t})).sort((e,t)=>new Date(e.date).getTime()-new Date(t.date).getTime());return(0,_.jsxs)("div",{className:"space-y-8",children:[(0,_.jsxs)("div",{className:"border rounded-lg p-4",children:[(0,_.jsx)(X.Title,{children:"Overall Usage"}),(0,_.jsxs)(ee.Grid,{numItems:4,className:"gap-4 mb-4",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Total Requests"}),(0,_.jsx)(X.Title,{children:a.total_requests.toLocaleString()})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Total Successful Requests"}),(0,_.jsx)(X.Title,{children:a.total_successful_requests.toLocaleString()})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Total Tokens"}),(0,_.jsx)(X.Title,{children:a.total_tokens.toLocaleString()})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Total Spend"}),(0,_.jsxs)(X.Title,{children:["$",(0,rV.formatNumberWithCommas)(a.total_spend,2)]})]})]}),(0,_.jsxs)(ee.Grid,{numItems:2,className:"gap-4",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center",children:[(0,_.jsx)(X.Title,{children:"Total Tokens Over Time"}),(0,_.jsx)(Px,{categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"]})]}),(0,_.jsx)(Pp,{className:"mt-4",data:s,index:"date",categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"],valueFormatter:P_,customTooltip:Pf,showLegend:!1})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center",children:[(0,_.jsx)(X.Title,{children:"Total Requests Over Time"}),(0,_.jsx)(Px,{categories:["metrics.successful_requests","metrics.failed_requests"],colors:["emerald","red"]})]}),(0,_.jsx)(Pp,{className:"mt-4",data:s,index:"date",categories:["metrics.successful_requests","metrics.failed_requests"],colors:["emerald","red"],valueFormatter:e=>e.toLocaleString(),customTooltip:Pf,showLegend:!1})]})]})]}),(0,_.jsx)(tl.Collapse,{defaultActiveKey:r[0],children:r.map(r=>(0,_.jsx)(tl.Collapse.Panel,{header:(0,_.jsxs)("div",{className:"flex justify-between items-center w-full",children:[(0,_.jsx)(X.Title,{children:e[r].label||"Unknown Item"}),(0,_.jsxs)("div",{className:"flex space-x-4 text-sm text-gray-500",children:[(0,_.jsxs)("span",{children:["$",(0,rV.formatNumberWithCommas)(e[r].total_spend,2)]}),(0,_.jsxs)("span",{children:[e[r].total_requests.toLocaleString()," requests"]})]})]}),children:(0,_.jsx)(Pv,{modelName:r||"Unknown Model",metrics:e[r],hidePromptCachingMetrics:t})},r))})]})},Pw=(e,t,r=[])=>{let a={};return e.results.forEach(e=>{Object.entries(e.breakdown[t]||{}).forEach(([s,n])=>{a[s]||(a[s]={label:"api_keys"===t?((e,t,r)=>{let a=e.metadata.key_alias||`key-hash-${t}`,s=e.metadata.team_id;if(s){let e=(0,DU.resolveTeamAliasFromTeamID)(s,r);return e?`${a} (team: ${e})`:`${a} (team_id: ${s})`}return a})(n,s,r):"entities"===t&&(n.metadata?.agent_name||n.metadata?.team_alias)||s,total_requests:0,total_successful_requests:0,total_failed_requests:0,total_tokens:0,prompt_tokens:0,completion_tokens:0,total_spend:0,total_cache_read_input_tokens:0,total_cache_creation_input_tokens:0,top_api_keys:[],top_models:[],daily_data:[]}),a[s].total_requests+=n.metrics.api_requests,a[s].prompt_tokens+=n.metrics.prompt_tokens,a[s].completion_tokens+=n.metrics.completion_tokens,a[s].total_tokens+=n.metrics.total_tokens,a[s].total_spend+=n.metrics.spend,a[s].total_successful_requests+=n.metrics.successful_requests,a[s].total_failed_requests+=n.metrics.failed_requests,a[s].total_cache_read_input_tokens+=n.metrics.cache_read_input_tokens||0,a[s].total_cache_creation_input_tokens+=n.metrics.cache_creation_input_tokens||0,a[s].daily_data.push({date:e.date,metrics:{prompt_tokens:n.metrics.prompt_tokens,completion_tokens:n.metrics.completion_tokens,total_tokens:n.metrics.total_tokens,api_requests:n.metrics.api_requests,spend:n.metrics.spend,successful_requests:n.metrics.successful_requests,failed_requests:n.metrics.failed_requests,cache_read_input_tokens:n.metrics.cache_read_input_tokens||0,cache_creation_input_tokens:n.metrics.cache_creation_input_tokens||0}})})}),"api_keys"!==t&&Object.entries(a).forEach(([r,s])=>{let n={};e.results.forEach(e=>{let a=e.breakdown[t]?.[r];a&&"api_key_breakdown"in a&&Object.entries(a.api_key_breakdown||{}).forEach(([e,t])=>{n[e]||(n[e]={api_key:e,key_alias:t.metadata.key_alias,team_id:t.metadata.team_id,spend:0,requests:0,tokens:0}),n[e].spend+=t.metrics.spend,n[e].requests+=t.metrics.api_requests,n[e].tokens+=t.metrics.total_tokens})}),a[r].top_api_keys=Object.values(n).sort((e,t)=>t.spend-e.spend).slice(0,5)}),"api_keys"===t&&Object.entries(a).forEach(([t,r])=>{let s={};e.results.forEach(e=>{Object.entries(e.breakdown.models||{}).forEach(([e,r])=>{if(r&&"api_key_breakdown"in r){let a=r.api_key_breakdown?.[t];a&&(s[e]||(s[e]={model:e,spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0}),s[e].spend+=a.metrics.spend,s[e].requests+=a.metrics.api_requests,s[e].successful_requests+=a.metrics.successful_requests||0,s[e].failed_requests+=a.metrics.failed_requests||0,s[e].tokens+=a.metrics.total_tokens)}})}),a[t].top_models=Object.values(s).sort((e,t)=>t.spend-e.spend)}),Object.values(a).forEach(e=>{e.daily_data.sort((e,t)=>new Date(e.date).getTime()-new Date(t.date).getTime())}),a},Pk=({isOpen:e,onClose:t,accessToken:r})=>{let[a]=H.Form.useForm(),[s,n]=(0,T.useState)(!1),[l,i]=(0,T.useState)(null),[o,d]=(0,T.useState)(!1),[c,u]=(0,T.useState)("cloudzero"),[m,p]=(0,T.useState)(!1);(0,T.useEffect)(()=>{e&&r&&h()},[e,r]);let h=async()=>{d(!0);try{let e=await fetch("/cloudzero/settings",{method:"GET",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${r}`,"Content-Type":"application/json"}});if(e.ok){let t=await e.json();i(t),a.setFieldsValue({connection_id:t.connection_id})}else if(404!==e.status){let t=await e.json();J.default.fromBackend(`Failed to load existing settings: ${t.error||"Unknown error"}`)}}catch(e){console.error("Error loading CloudZero settings:",e),J.default.fromBackend("Failed to load existing settings")}finally{d(!1)}},f=async e=>{if(!r)return void J.default.fromBackend("No access token available");n(!0);try{let t=l?"/cloudzero/settings":"/cloudzero/init",a=l?"PUT":"POST",s={...e,timezone:"UTC"},n=await fetch(t,{method:a,headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify(s)}),o=await n.json();if(n.ok)return J.default.success(o.message||"CloudZero settings saved successfully"),i({api_key_masked:e.api_key.substring(0,4)+"****"+e.api_key.slice(-4),connection_id:e.connection_id,status:"configured"}),!0;return J.default.fromBackend(o.error||"Failed to save CloudZero settings"),!1}catch(e){return console.error("Error saving CloudZero settings:",e),J.default.fromBackend("Failed to save CloudZero settings"),!1}finally{n(!1)}},x=async()=>{if(!r)return void J.default.fromBackend("No access token available");p(!0);try{let e=await fetch("/cloudzero/export",{method:"POST",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify({limit:1e5,operation:"replace_hourly"})}),a=await e.json();e.ok?(J.default.success(a.message||"Export to CloudZero completed successfully"),t()):J.default.fromBackend(a.error||"Failed to export to CloudZero")}catch(e){console.error("Error exporting to CloudZero:",e),J.default.fromBackend("Failed to export to CloudZero")}finally{p(!1)}},g=async()=>{p(!0);try{J.default.info("CSV export functionality coming soon!"),t()}catch(e){console.error("Error exporting CSV:",e),J.default.fromBackend("Failed to export CSV")}finally{p(!1)}},y=async()=>{if("cloudzero"===c){if(!l){let e=await a.validateFields();if(!await f(e))return}await x()}else await g()},b=()=>{a.resetFields(),u("cloudzero"),i(null),t()},v=[{value:"cloudzero",label:(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("img",{src:"/cloudzero.png",alt:"CloudZero",className:"w-5 h-5",onError:e=>{e.target.style.display="none"}}),(0,_.jsx)("span",{children:"Export to CloudZero"})]})},{value:"csv",label:(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),(0,_.jsx)("span",{children:"Export to CSV"})]})}];return(0,_.jsx)(q.Modal,{title:"Export Data",open:e,onCancel:b,footer:null,width:600,destroyOnHidden:!0,children:(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium mb-2 block",children:"Export Destination"}),(0,_.jsx)(eE.Select,{value:c,onChange:u,options:v,className:"w-full",size:"large"})]}),"cloudzero"===c&&(0,_.jsx)("div",{children:o?(0,_.jsx)("div",{className:"flex justify-center py-8",children:(0,_.jsx)(rm.Spin,{size:"large"})}):(0,_.jsxs)(_.Fragment,{children:[l&&(0,_.jsx)(D,{title:"Existing CloudZero Configuration",icon:()=>(0,_.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),color:"green",className:"mb-4",children:(0,_.jsxs)(Z.Text,{children:["API Key: ",l.api_key_masked,(0,_.jsx)("br",{}),"Connection ID: ",l.connection_id]})}),!l&&(0,_.jsxs)(H.Form,{form:a,layout:"vertical",children:[(0,_.jsx)(H.Form.Item,{label:"CloudZero API Key",name:"api_key",rules:[{required:!0,message:"Please enter your CloudZero API key"}],children:(0,_.jsx)(et.TextInput,{type:"password",placeholder:"Enter your CloudZero API key"})}),(0,_.jsx)(H.Form.Item,{label:"Connection ID",name:"connection_id",rules:[{required:!0,message:"Please enter the CloudZero connection ID"}],children:(0,_.jsx)(et.TextInput,{placeholder:"Enter CloudZero connection ID"})})]})]})}),"csv"===c&&(0,_.jsx)(D,{title:"CSV Export",icon:()=>(0,_.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),color:"blue",children:(0,_.jsx)(Z.Text,{children:"Export your usage data as a CSV file for analysis in spreadsheet applications."})}),(0,_.jsxs)("div",{className:"flex justify-end space-x-2 pt-4",children:[(0,_.jsx)(S.Button,{variant:"secondary",onClick:b,children:"Cancel"}),(0,_.jsx)(S.Button,{onClick:y,loading:s||m,disabled:s||m,children:"cloudzero"===c?"Export to CloudZero":"Export CSV"})]})]})})},PS=({value:e,onChange:t})=>(0,_.jsxs)("div",{children:[(0,_.jsx)("label",{className:"text-sm font-medium text-gray-700 block mb-2",children:"Format"}),(0,_.jsx)(eE.Select,{value:e,onChange:t,className:"w-full",options:[{value:"csv",label:"CSV (Excel, Google Sheets)"},{value:"json",label:"JSON (includes metadata)"}]})]}),PN=({dateRange:e,selectedFilters:t})=>(0,_.jsxs)("div",{className:"text-sm text-gray-500",children:[e.from?.toLocaleDateString()," - ",e.to?.toLocaleDateString(),t.length>0&&` \xb7 ${t.length} filter${t.length>1?"s":""}`]}),PT=({value:e,onChange:t,entityType:r})=>(0,_.jsxs)("div",{children:[(0,_.jsx)("label",{className:"text-sm font-medium text-gray-700 block mb-2",children:"Export type"}),(0,_.jsx)(t$.Radio.Group,{value:e,onChange:e=>t(e.target.value),className:"w-full",children:(0,_.jsxs)("div",{className:"space-y-2",children:[(0,_.jsxs)("label",{className:"flex items-start p-3 border border-gray-200 rounded-lg hover:bg-gray-50 cursor-pointer transition-colors",children:[(0,_.jsx)(t$.Radio,{value:"daily",className:"mt-0.5"}),(0,_.jsxs)("div",{className:"ml-3 flex-1",children:[(0,_.jsxs)("div",{className:"font-medium text-sm",children:["Day-by-day breakdown by ",r]}),(0,_.jsxs)("div",{className:"text-xs text-gray-500 mt-0.5",children:["Daily metrics for each ",r]})]})]}),(0,_.jsxs)("label",{className:"flex items-start p-3 border border-gray-200 rounded-lg hover:bg-gray-50 cursor-pointer transition-colors",children:[(0,_.jsx)(t$.Radio,{value:"daily_with_keys",className:"mt-0.5"}),(0,_.jsxs)("div",{className:"ml-3 flex-1",children:[(0,_.jsxs)("div",{className:"font-medium text-sm",children:["Day-by-day breakdown by ",r," and key"]}),(0,_.jsxs)("div",{className:"text-xs text-gray-500 mt-0.5",children:["Daily metrics for each ",r,", split by API key"]})]})]}),(0,_.jsxs)("label",{className:"flex items-start p-3 border border-gray-200 rounded-lg hover:bg-gray-50 cursor-pointer transition-colors",children:[(0,_.jsx)(t$.Radio,{value:"daily_with_models",className:"mt-0.5"}),(0,_.jsxs)("div",{className:"ml-3 flex-1",children:[(0,_.jsxs)("div",{className:"font-medium text-sm",children:["Day-by-day by ",r," and model"]}),(0,_.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:"Daily metrics split by model"})]})]})]})})]});var PM=e.i(59935);let PC=(e,t)=>({id:e,alias:t[e]||e}),PL=["spend","api_requests","successful_requests","failed_requests","total_tokens","prompt_tokens","completion_tokens","cache_read_input_tokens","cache_creation_input_tokens"],PO=e=>{let t=e.entities;return t&&Object.keys(t).length>0?t:(e=>{let t=e.api_keys;if(!t||0===Object.keys(t).length)return{};let r={};for(let[e,a]of Object.entries(t)){let t=a?.metadata?.team_id||"Unassigned";r[t]||(r[t]={metrics:Object.fromEntries(PL.map(e=>[e,0])),api_key_breakdown:{}});let s=r[t].metrics,n=a?.metrics||{};for(let e of PL)s[e]+=n[e]||0;r[t].api_key_breakdown[e]=a}return r})(e)},PD=(e,t,r,a={})=>{switch(t){case"daily":default:return((e,t,r={})=>{let a=[];return e.results.forEach(e=>{Object.entries(PO(e.breakdown)).forEach(([s,n])=>{let{id:l,alias:i}=PC(s,r);a.push({Date:e.date,[t]:i,[`${t} ID`]:l,"Spend ($)":(0,rV.formatNumberWithCommas)(n.metrics.spend,4),Requests:n.metrics.api_requests,"Successful Requests":n.metrics.successful_requests,"Failed Requests":n.metrics.failed_requests,"Total Tokens":n.metrics.total_tokens,"Prompt Tokens":n.metrics.prompt_tokens||0,"Completion Tokens":n.metrics.completion_tokens||0})})}),a.sort((e,t)=>new Date(e.Date).getTime()-new Date(t.Date).getTime())})(e,r,a);case"daily_with_keys":return((e,t,r={})=>{let a={};return e.results.forEach(e=>{Object.entries(PO(e.breakdown)).forEach(([t,s])=>{let{id:n,alias:l}=PC(t,r);Object.entries(s.api_key_breakdown||{}).forEach(([t,r])=>{let s=r?.metadata?.key_alias||null,i=`${e.date}_${n}_${t}`;a[i]?(a[i].metrics.spend+=r.metrics?.spend||0,a[i].metrics.api_requests+=r.metrics?.api_requests||0,a[i].metrics.successful_requests+=r.metrics?.successful_requests||0,a[i].metrics.failed_requests+=r.metrics?.failed_requests||0,a[i].metrics.total_tokens+=r.metrics?.total_tokens||0,a[i].metrics.prompt_tokens+=r.metrics?.prompt_tokens||0,a[i].metrics.completion_tokens+=r.metrics?.completion_tokens||0):a[i]={Date:e.date,entityId:n,entityAlias:l,keyId:t,keyAlias:s,metrics:{spend:r.metrics?.spend||0,api_requests:r.metrics?.api_requests||0,successful_requests:r.metrics?.successful_requests||0,failed_requests:r.metrics?.failed_requests||0,total_tokens:r.metrics?.total_tokens||0,prompt_tokens:r.metrics?.prompt_tokens||0,completion_tokens:r.metrics?.completion_tokens||0}}})})}),Object.values(a).map(e=>({Date:e.Date,[t]:e.entityAlias,[`${t} ID`]:e.entityId,"Key Alias":e.keyAlias||"-","Key ID":e.keyId,"Spend ($)":(0,rV.formatNumberWithCommas)(e.metrics.spend,4),Requests:e.metrics.api_requests,"Successful Requests":e.metrics.successful_requests,"Failed Requests":e.metrics.failed_requests,"Total Tokens":e.metrics.total_tokens,"Prompt Tokens":e.metrics.prompt_tokens,"Completion Tokens":e.metrics.completion_tokens})).sort((e,t)=>new Date(e.Date).getTime()-new Date(t.Date).getTime())})(e,r,a);case"daily_with_models":return((e,t,r={})=>{let a=[];return e.results.forEach(e=>{let s={};Object.entries(PO(e.breakdown)).forEach(([t,r])=>{s[t]||(s[t]={}),Object.entries(e.breakdown.models||{}).forEach(([e,a])=>{Object.entries(r.api_key_breakdown||{}).forEach(([r,a])=>{s[t][e]||(s[t][e]={spend:0,requests:0,successful:0,failed:0,tokens:0}),s[t][e].spend+=a.metrics.spend||0,s[t][e].requests+=a.metrics.api_requests||0,s[t][e].successful+=a.metrics.successful_requests||0,s[t][e].failed+=a.metrics.failed_requests||0,s[t][e].tokens+=a.metrics.total_tokens||0})})}),Object.entries(s).forEach(([s,n])=>{let{id:l,alias:i}=PC(s,r);Object.entries(n).forEach(([r,s])=>{a.push({Date:e.date,[t]:i,[`${t} ID`]:l,Model:r,"Spend ($)":(0,rV.formatNumberWithCommas)(s.spend,4),Requests:s.requests,Successful:s.successful,Failed:s.failed,"Total Tokens":s.tokens})})})}),a.sort((e,t)=>new Date(e.Date).getTime()-new Date(t.Date).getTime())})(e,r,a)}},PP=({isOpen:e,onClose:t,entityType:r,spendData:a,dateRange:s,selectedFilters:n,customTitle:l})=>{let[i,o]=(0,T.useState)("csv"),[d,c]=(0,T.useState)("daily"),[u,m]=(0,T.useState)(!1),{data:p,isLoading:h}=(0,jY.useTeams)(),f=r.charAt(0).toUpperCase()+r.slice(1),x=l||`Export ${f} Usage`,g=(0,T.useMemo)(()=>(0,DU.createTeamAliasMap)(p),[p]),y=async e=>{let l=e||i;m(!0);try{"csv"===l?(((e,t,r,a,s={})=>{let n=PD(e,t,r,s),l=new Blob([PM.default.unparse(n)],{type:"text/csv;charset=utf-8;"}),i=window.URL.createObjectURL(l),o=document.createElement("a");o.href=i,o.download=`${a}_usage_${t}_${new Date().toISOString().split("T")[0]}.csv`,document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(i)})(a,d,f,r,g),J.default.success(`${f} usage data exported successfully as CSV`)):(((e,t,r,a,s,n,l={})=>{let i=PD(e,t,r,l),o={export_date:new Date().toISOString(),entity_type:a,date_range:{from:s.from?.toISOString(),to:s.to?.toISOString()},filters_applied:n.length>0?n:"None",export_scope:t,summary:{total_spend:e.metadata.total_spend,total_requests:e.metadata.total_api_requests,successful_requests:e.metadata.total_successful_requests,failed_requests:e.metadata.total_failed_requests,total_tokens:e.metadata.total_tokens}},d=new Blob([JSON.stringify({metadata:o,data:i},null,2)],{type:"application/json"}),c=window.URL.createObjectURL(d),u=document.createElement("a");u.href=c,u.download=`${a}_usage_${t}_${new Date().toISOString().split("T")[0]}.json`,document.body.appendChild(u),u.click(),document.body.removeChild(u),window.URL.revokeObjectURL(c)})(a,d,f,r,s,n,g),J.default.success(`${f} usage data exported successfully as JSON`)),t()}catch(e){console.error("Error exporting data:",e),J.default.fromBackend("Failed to export data")}finally{m(!1)}};return(0,_.jsx)(q.Modal,{title:(0,_.jsx)("span",{className:"text-base font-semibold",children:x}),open:e,onCancel:t,footer:null,width:480,children:(0,_.jsxs)("div",{className:"space-y-5 py-2",children:[h?(0,_.jsx)(ey.Skeleton,{active:!0}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(PN,{dateRange:s,selectedFilters:n}),(0,_.jsx)(PT,{value:d,onChange:c,entityType:r}),(0,_.jsx)(PS,{value:i,onChange:o})]}),h?(0,_.jsxs)("div",{className:"flex items-center justify-end gap-2 pt-4 border-t",children:[(0,_.jsx)(ey.Skeleton.Button,{active:!0}),(0,_.jsx)(ey.Skeleton.Button,{active:!0})]}):(0,_.jsxs)("div",{className:"flex items-center justify-end gap-2 pt-4 border-t",children:[(0,_.jsx)(z.Button,{variant:"outlined",onClick:t,disabled:u,children:"Cancel"}),(0,_.jsx)(z.Button,{onClick:()=>y(),loading:u||h,disabled:u||h,type:"primary",children:u?"Exporting...":`Export ${i.toUpperCase()}`})]})]})})},PA=({dateValue:e,entityType:t,spendData:r,showFilters:a=!1,filterLabel:s,filterPlaceholder:n,selectedFilters:l=[],onFiltersChange:i,filterOptions:o=[],filterMode:d="multiple",customTitle:c,compactLayout:u=!1,teams:m=[]})=>{let[p,h]=(0,T.useState)(!1);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"mb-4",children:(0,_.jsxs)("div",{className:`grid ${a&&o.length>0?"grid-cols-[1fr_auto]":"grid-cols-[auto]"} items-end gap-4`,children:[a&&o.length>0&&(0,_.jsxs)("div",{children:[s&&(0,_.jsx)(Z.Text,{className:"mb-2",children:s}),(0,_.jsx)(eE.Select,{mode:"single"===d?void 0:"multiple",style:{width:"100%"},placeholder:n,value:"single"===d?l[0]??void 0:l,onChange:e=>{"single"===d?i?.(e?[e]:[]):i?.(e)},options:o,allowClear:!0})]}),(0,_.jsx)("div",{className:"justify-self-end",children:(0,_.jsx)(S.Button,{onClick:()=>h(!0),icon:()=>(0,_.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),children:"Export Data"})})]})}),(0,_.jsx)(PP,{isOpen:p,onClose:()=>h(!1),entityType:t,spendData:r,dateRange:e,selectedFilters:l,customTitle:c,teams:m})]})};var PE=e.i(571303);let PI=({isDateChanging:e=!1})=>(0,_.jsx)("div",{className:"flex items-center justify-center h-40",children:(0,_.jsxs)("div",{className:"flex items-center justify-center gap-3",children:[(0,_.jsx)(PE.UiLoadingSpinner,{className:"size-5"}),(0,_.jsxs)("div",{className:"flex flex-col",children:[(0,_.jsx)("span",{className:"text-gray-600 text-sm font-medium",children:e?"Processing date selection...":"Loading chart data..."}),(0,_.jsx)("span",{className:"text-gray-400 text-xs mt-1",children:e?"This will only take a moment":"Fetching your data"})]})]})}),PY=T.default.forwardRef((e,t)=>{let{color:r,children:a,className:s}=e,n=(0,N.__rest)(e,["color","children","className"]);return T.default.createElement("p",Object.assign({ref:t,className:(0,C.tremorTwMerge)("font-semibold text-tremor-metric",r?(0,L.getColorClassNames)(r,M.colorPalette.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",s)},n),a)});PY.displayName="Metric";let PF=({accessToken:e,selectedTags:t,formatAbbreviatedNumber:r})=>{let a,s,n,l,[i,o]=(0,T.useState)({results:[],total_count:0,page:1,page_size:50,total_pages:0}),[d,c]=(0,T.useState)(!1),[u,m]=(0,T.useState)(1),p=async()=>{if(e){c(!0);try{let r=await (0,Q.perUserAnalyticsCall)(e,u,50,t.length>0?t:void 0);o(r)}catch(e){console.error("Failed to fetch per-user data:",e)}finally{c(!1)}}};return(0,T.useEffect)(()=>{p()},[e,t,u]),(0,_.jsxs)("div",{className:"mb-6",children:[(0,_.jsx)(X.Title,{children:"Per User Usage"}),(0,_.jsx)(yv.Subtitle,{children:"Individual developer usage metrics"}),(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)(rR.TabList,{className:"mb-6",children:[(0,_.jsx)(rY.Tab,{children:"User Details"}),(0,_.jsx)(rY.Tab,{children:"Usage Distribution"})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsxs)(A.Table,{children:[(0,_.jsx)(Y.TableHead,{children:(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(F.TableHeaderCell,{children:"User ID"}),(0,_.jsx)(F.TableHeaderCell,{children:"User Email"}),(0,_.jsx)(F.TableHeaderCell,{children:"User Agent"}),(0,_.jsx)(F.TableHeaderCell,{className:"text-right",children:"Success Generations"}),(0,_.jsx)(F.TableHeaderCell,{className:"text-right",children:"Total Tokens"}),(0,_.jsx)(F.TableHeaderCell,{className:"text-right",children:"Failed Requests"}),(0,_.jsx)(F.TableHeaderCell,{className:"text-right",children:"Total Cost"})]})}),(0,_.jsx)(E.TableBody,{children:i.results.slice(0,10).map((e,t)=>(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(I.TableCell,{children:(0,_.jsx)(Z.Text,{className:"font-medium",children:e.user_id})}),(0,_.jsx)(I.TableCell,{children:(0,_.jsx)(Z.Text,{children:e.user_email||"N/A"})}),(0,_.jsx)(I.TableCell,{children:(0,_.jsx)(Z.Text,{children:e.user_agent||"Unknown"})}),(0,_.jsx)(I.TableCell,{className:"text-right",children:(0,_.jsx)(Z.Text,{children:r(e.successful_requests)})}),(0,_.jsx)(I.TableCell,{className:"text-right",children:(0,_.jsx)(Z.Text,{children:r(e.total_tokens)})}),(0,_.jsx)(I.TableCell,{className:"text-right",children:(0,_.jsx)(Z.Text,{children:r(e.failed_requests)})}),(0,_.jsx)(I.TableCell,{className:"text-right",children:(0,_.jsxs)(Z.Text,{children:["$",r(e.spend,4)]})})]},t))})]}),i.results.length>10&&(0,_.jsxs)("div",{className:"mt-4 flex justify-between items-center",children:[(0,_.jsxs)(Z.Text,{className:"text-sm text-gray-500",children:["Showing 10 of ",i.total_count," results"]}),(0,_.jsxs)("div",{className:"flex gap-2",children:[(0,_.jsx)(S.Button,{size:"sm",variant:"secondary",onClick:()=>{u>1&&m(u-1)},disabled:1===u,children:"Previous"}),(0,_.jsx)(S.Button,{size:"sm",variant:"secondary",onClick:()=>{u=i.total_pages,children:"Next"})]})]})]}),(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsxs)("div",{className:"mb-4",children:[(0,_.jsx)(X.Title,{className:"text-lg",children:"User Usage Distribution"}),(0,_.jsx)(yv.Subtitle,{children:"Number of users by successful request frequency"})]}),(0,_.jsx)(yn,{data:(a=new Map,i.results.forEach(e=>{let t=e.user_agent||"Unknown";a.set(t,(a.get(t)||0)+1)}),s=Array.from(a.entries()).sort(([,e],[,t])=>t-e).slice(0,8).map(([e])=>e),n={"1-9 requests":{range:[1,9],agents:{}},"10-99 requests":{range:[10,99],agents:{}},"100-999 requests":{range:[100,999],agents:{}},"1K-9.9K requests":{range:[1e3,9999],agents:{}},"10K-99.9K requests":{range:[1e4,99999],agents:{}},"100K+ requests":{range:[1e5,1/0],agents:{}}},i.results.forEach(e=>{let t=e.successful_requests,r=e.user_agent||"Unknown";s.includes(r)&&Object.entries(n).forEach(([e,a])=>{t>=a.range[0]&&t<=a.range[1]&&(a.agents[r]||(a.agents[r]=0),a.agents[r]++)})}),Object.entries(n).map(([e,t])=>{let r={category:e};return s.forEach(e=>{r[e]=t.agents[e]||0}),r})),index:"category",categories:(l=new Map,i.results.forEach(e=>{let t=e.user_agent||"Unknown";l.set(t,(l.get(t)||0)+1)}),Array.from(l.entries()).sort(([,e],[,t])=>t-e).slice(0,8).map(([e])=>e)),colors:["blue","green","orange","red","purple","yellow","pink","indigo"],valueFormatter:e=>`${e} users`,yAxisWidth:80,showLegend:!0,stack:!0})]})]})]})]})},PR=({accessToken:e,userRole:t,dateValue:r,onDateChange:a})=>{let[s,n]=(0,T.useState)({results:[]}),[l,i]=(0,T.useState)({results:[]}),[o,d]=(0,T.useState)({results:[]}),[c,u]=(0,T.useState)({results:[]}),[m,p]=(0,T.useState)(""),[h,f]=(0,T.useState)([]),[x,g]=(0,T.useState)([]),[y,b]=(0,T.useState)(!1),[v,j]=(0,T.useState)(!1),[w,k]=(0,T.useState)(!1),[S,N]=(0,T.useState)(!1),[M,C]=(0,T.useState)(!1),L=new Date,O=async()=>{if(e){b(!0);try{let t=await (0,Q.tagDistinctCall)(e);f(t.results.map(e=>e.tag))}catch(e){console.error("Failed to fetch available tags:",e)}finally{b(!1)}}},D=async()=>{if(e){j(!0);try{let t=await (0,Q.tagDauCall)(e,L,m||void 0,x.length>0?x:void 0);n(t)}catch(e){console.error("Failed to fetch DAU data:",e)}finally{j(!1)}}},A=async()=>{if(e){k(!0);try{let t=await (0,Q.tagWauCall)(e,L,m||void 0,x.length>0?x:void 0);i(t)}catch(e){console.error("Failed to fetch WAU data:",e)}finally{k(!1)}}},E=async()=>{if(e){N(!0);try{let t=await (0,Q.tagMauCall)(e,L,m||void 0,x.length>0?x:void 0);d(t)}catch(e){console.error("Failed to fetch MAU data:",e)}finally{N(!1)}}},I=async()=>{if(e&&r.from&&r.to){C(!0);try{let t=await (0,Q.userAgentSummaryCall)(e,r.from,r.to,x.length>0?x:void 0);u(t)}catch(e){console.error("Failed to fetch user agent summary data:",e)}finally{C(!1)}}};(0,T.useEffect)(()=>{O()},[e]),(0,T.useEffect)(()=>{if(!e)return;let t=setTimeout(()=>{D(),A(),E()},50);return()=>clearTimeout(t)},[e,m,x]),(0,T.useEffect)(()=>{if(!r.from||!r.to)return;let e=setTimeout(()=>{I()},50);return()=>clearTimeout(e)},[e,r,x]);let Y=e=>e.startsWith("User-Agent: ")?e.replace("User-Agent: ",""):e,F=e=>Object.entries(e.reduce((e,t)=>(e[t.tag]=(e[t.tag]||0)+t.active_users,e),{})).sort(([,e],[,t])=>t-e).map(([e])=>e),R=F(s.results).slice(0,10),B=F(l.results).slice(0,10),z=F(o.results).slice(0,10),H=(()=>{let e=[],t=new Date;for(let r=6;r>=0;r--){let a=new Date(t);a.setDate(a.getDate()-r);let s={date:a.toISOString().split("T")[0]};R.forEach(e=>{s[Y(e)]=0}),e.push(s)}return s.results.forEach(t=>{let r=Y(t.tag),a=e.find(e=>e.date===t.date);a&&(a[r]=t.active_users)}),e})(),$=(()=>{let e=[];for(let t=1;t<=7;t++){let r={week:`Week ${t}`};B.forEach(e=>{r[Y(e)]=0}),e.push(r)}return l.results.forEach(t=>{let r=Y(t.tag),a=t.date.match(/Week (\d+)/);if(a){let s=`Week ${a[1]}`,n=e.find(e=>e.week===s);n&&(n[r]=t.active_users)}}),e})(),q=(()=>{let e=[];for(let t=1;t<=7;t++){let r={month:`Month ${t}`};z.forEach(e=>{r[Y(e)]=0}),e.push(r)}return o.results.forEach(t=>{let r=Y(t.tag),a=t.date.match(/Month (\d+)/);if(a){let s=`Month ${a[1]}`,n=e.find(e=>e.month===s);n&&(n[r]=t.active_users)}}),e})(),U=(e,t=0)=>{if(e>=1e8||e>=1e7)return(e/1e6).toFixed(t)+"M";if(e>=1e6)return(e/1e6).toFixed(t)+"M";if(e>=1e4)return(e/1e3).toFixed(t)+"K";if(e>=1e3)return(e/1e3).toFixed(t)+"K";else return e.toFixed(t)};return(0,_.jsxs)("div",{className:"space-y-6 mt-6",children:[(0,_.jsx)(P.Card,{children:(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsxs)("div",{className:"flex justify-between items-start",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(X.Title,{children:"Summary by User Agent"}),(0,_.jsx)(yv.Subtitle,{children:"Performance metrics for different user agents"})]}),(0,_.jsxs)("div",{className:"w-96",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium block mb-2",children:"Filter by User Agents"}),(0,_.jsx)(eE.Select,{mode:"multiple",placeholder:"All User Agents",value:x,onChange:g,style:{width:"100%"},showSearch:!0,allowClear:!0,loading:y,optionFilterProp:"label",className:"rounded-md",maxTagCount:"responsive",children:h.map(e=>{let t=Y(e),r=t.length>50?`${t.substring(0,50)}...`:t;return(0,_.jsx)(eE.Select.Option,{value:e,label:r,title:t,children:r},e)})})]})]}),M?(0,_.jsx)(PI,{isDateChanging:!1}):(0,_.jsxs)(ee.Grid,{numItems:4,className:"gap-4",children:[(c.results||[]).slice(0,4).map((e,t)=>{let r=Y(e.tag),a=r.length>15?r.substring(0,15)+"...":r;return(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(tB.Tooltip,{title:r,placement:"top",children:(0,_.jsx)(X.Title,{className:"truncate",children:a})}),(0,_.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-sm text-gray-600",children:"Success Requests"}),(0,_.jsx)(PY,{className:"text-lg",children:U(e.successful_requests)})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-sm text-gray-600",children:"Total Tokens"}),(0,_.jsx)(PY,{className:"text-lg",children:U(e.total_tokens)})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-sm text-gray-600",children:"Total Cost"}),(0,_.jsxs)(PY,{className:"text-lg",children:["$",U(e.total_spend,4)]})]})]})]},t)}),Array.from({length:Math.max(0,4-(c.results||[]).length)}).map((e,t)=>(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"No Data"}),(0,_.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-sm text-gray-600",children:"Success Requests"}),(0,_.jsx)(PY,{className:"text-lg",children:"-"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-sm text-gray-600",children:"Total Tokens"}),(0,_.jsx)(PY,{className:"text-lg",children:"-"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-sm text-gray-600",children:"Total Cost"}),(0,_.jsx)(PY,{className:"text-lg",children:"-"})]})]})]},`empty-${t}`))]})]})}),(0,_.jsx)(P.Card,{children:(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)(rR.TabList,{className:"mb-6",children:[(0,_.jsx)(rY.Tab,{children:"DAU/WAU/MAU"}),(0,_.jsx)(rY.Tab,{children:"Per User Usage (Last 30 Days)"})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsxs)("div",{className:"mb-6",children:[(0,_.jsx)(X.Title,{children:"DAU, WAU & MAU per Agent"}),(0,_.jsx)(yv.Subtitle,{children:"Active users across different time periods"})]}),(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)(rR.TabList,{className:"mb-6",children:[(0,_.jsx)(rY.Tab,{children:"DAU"}),(0,_.jsx)(rY.Tab,{children:"WAU"}),(0,_.jsx)(rY.Tab,{children:"MAU"})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsx)("div",{className:"mb-4",children:(0,_.jsx)(X.Title,{className:"text-lg",children:"Daily Active Users - Last 7 Days"})}),v?(0,_.jsx)(PI,{isDateChanging:!1}):(0,_.jsx)(yn,{data:H,index:"date",categories:R.map(Y),valueFormatter:e=>U(e),yAxisWidth:60,showLegend:!0,stack:!0})]}),(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsx)("div",{className:"mb-4",children:(0,_.jsx)(X.Title,{className:"text-lg",children:"Weekly Active Users - Last 7 Weeks"})}),w?(0,_.jsx)(PI,{isDateChanging:!1}):(0,_.jsx)(yn,{data:$,index:"week",categories:B.map(Y),valueFormatter:e=>U(e),yAxisWidth:60,showLegend:!0,stack:!0})]}),(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsx)("div",{className:"mb-4",children:(0,_.jsx)(X.Title,{className:"text-lg",children:"Monthly Active Users - Last 7 Months"})}),S?(0,_.jsx)(PI,{isDateChanging:!1}):(0,_.jsx)(yn,{data:q,index:"month",categories:z.map(Y),valueFormatter:e=>U(e),yAxisWidth:60,showLegend:!0,stack:!0})]})]})]})]}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(PF,{accessToken:e,selectedTags:x,formatAbbreviatedNumber:U})})]})]})})]})},PB=({userSpend:e,userMaxBudget:t,selectedTeam:r})=>{let{accessToken:a,userRole:s,userId:n}=(0,k.default)(),[l,i]=(0,T.useState)(null!==e?e:0),[o,d]=(0,T.useState)(r?Number((0,rV.formatNumberWithCommas)(r.max_budget,4)):null);(0,T.useEffect)(()=>{if(r)if("Default Team"===r.team_alias)d(t);else{let e=!1;if(r.team_memberships)for(let t of r.team_memberships)t.user_id===n&&"max_budget"in t.litellm_budget_table&&null!==t.litellm_budget_table.max_budget&&(d(t.litellm_budget_table.max_budget),e=!0);e||d(r.max_budget)}else d(t)},[r,t]);let[c,u]=(0,T.useState)([]);(0,T.useEffect)(()=>{let e=async()=>{if(!a||!n||!s)return};(async()=>{try{if(null===n||null===s)return;if(null!==a){let e=(await (0,Q.modelAvailableCall)(a,n,s)).data.map(e=>e.id);console.log("available_model_names:",e),u(e)}}catch(e){console.error("Error fetching user models:",e)}})(),e()},[s,a,n]),(0,T.useEffect)(()=>{null!==e&&i(e)},[e]);let m=[];r&&r.models&&(m=r.models),m&&m.includes("all-proxy-models")?(console.log("user models:",c),m=c):m&&m.includes("all-team-models")?m=r.models:m&&0===m.length&&(m=c);let p=null!==o?`$${(0,rV.formatNumberWithCommas)(Number(o),4)} limit`:"No limit",h=void 0!==l?(0,rV.formatNumberWithCommas)(l,4):null;return console.log(`spend in view user spend: ${l}`),(0,_.jsx)("div",{className:"flex items-center",children:(0,_.jsxs)("div",{className:"flex justify-between gap-x-6",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Total Spend"}),(0,_.jsxs)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:["$",h]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Max Budget"}),(0,_.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:p})]})]})})},Pz=["total_spend","total_prompt_tokens","total_completion_tokens","total_tokens","total_api_requests","total_successful_requests","total_failed_requests","total_cache_read_input_tokens","total_cache_creation_input_tokens"],PH={results:[],metadata:{total_spend:0,total_prompt_tokens:0,total_completion_tokens:0,total_tokens:0,total_api_requests:0,total_successful_requests:0,total_failed_requests:0,total_cache_read_input_tokens:0,total_cache_creation_input_tokens:0,total_pages:1,has_more:!1,page:1}};function P$({fetchFn:e,args:t,enabled:r}){let[a,s]=(0,T.useState)(PH),[n,l]=(0,T.useState)(!1),[i,o]=(0,T.useState)(!1),[d,c]=(0,T.useState)({currentPage:0,totalPages:0}),[u,m]=(0,T.useState)(!1),p=(0,T.useRef)(0),h=(0,T.useRef)(!1),f=(0,T.useRef)(null),x=(0,T.useRef)(t);x.current=t;let g=JSON.stringify(t),y=(0,T.useCallback)(()=>{h.current=!0,m(!0),o(!1),null!==f.current&&(clearTimeout(f.current),f.current=null)},[]);return(0,T.useEffect)(()=>{if(!r){s(PH),l(!1),o(!1),c({currentPage:0,totalPages:0}),m(!1);return}let t=++p.current;h.current=!1,m(!1);let a=()=>p.current!==t||h.current,n=e=>new Promise(t=>{f.current=setTimeout(()=>{f.current=null,t()},e)});return(async()=>{let t=x.current;l(!0),o(!1),c({currentPage:1,totalPages:1});try{let r=[...t.slice(0,3),1,...t.slice(3)],i=await e(...r);if(a())return;s(i);let d=i.metadata?.total_pages||1;if(c({currentPage:1,totalPages:d}),d<=1)return void l(!1);l(!1),o(!0);let u=[...i.results],m={...i.metadata};for(let r=2;r<=d;r++){if(a()||(await n(300),a()))return;let l=[...t.slice(0,3),r,...t.slice(3)],i=await e(...l);if(a())return;u=[...u,...i.results],(m=function(e,t){let r={...e};for(let a of Pz)r[a]=(e[a]||0)+(t[a]||0);return r}(m,i.metadata)).total_pages=d,m.has_more=r{p.current++,null!==f.current&&(clearTimeout(f.current),f.current=null)}},[r,e,g]),{data:a,loading:n,isFetchingMore:i,progress:d,cancelled:u,cancel:y}}let Pq=({endpointData:e})=>{let t=e||{},r=T.default.useMemo(()=>Object.entries(t).map(([e,t])=>({endpoint:e,"metrics.successful_requests":t.metrics.successful_requests,"metrics.failed_requests":t.metrics.failed_requests,metrics:{successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests}})),[t]);return(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center",children:[(0,_.jsx)(X.Title,{children:"Success vs Failed Requests by Endpoint"}),(0,_.jsx)(Px,{categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"]})]}),(0,_.jsx)(yn,{className:"mt-4",data:r,index:"endpoint",categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"],valueFormatter:e=>e.toLocaleString(),customTooltip:Pf,showLegend:!1,stack:!0,yAxisWidth:60})]})};var PU=x6({chartName:"LineChart",GraphicalChild:Pm,axisComponents:[{axisType:"xAxis",AxisComp:gS},{axisType:"yAxis",AxisComp:gA}],formatAxisMap:hW});let PW=T.default.forwardRef((e,t)=>{let{data:r=[],categories:a=[],index:s,colors:n=M.themeColorRange,valueFormatter:l=L.defaultValueFormatter,startEndOnly:i=!1,showXAxis:o=!0,showYAxis:d=!0,yAxisWidth:c=56,intervalType:u="equidistantPreserveStart",animationDuration:m=900,showAnimation:p=!1,showTooltip:h=!0,showLegend:f=!0,showGridLines:x=!0,autoMinValue:g=!1,curveType:y="linear",minValue:_,maxValue:b,connectNulls:v=!1,allowDecimals:j=!0,noDataText:w,className:k,onValueChange:S,enableLegendSlider:O=!1,customTooltip:D,rotateLabelX:P,padding:A=o||d?{left:20,right:20}:{left:0,right:0},tickGap:E=5,xAxisLabel:I,yAxisLabel:Y}=e,F=(0,N.__rest)(e,["data","categories","index","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","animationDuration","showAnimation","showTooltip","showLegend","showGridLines","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","padding","tickGap","xAxisLabel","yAxisLabel"]),[R,B]=(0,T.useState)(60),[z,H]=(0,T.useState)(void 0),[$,q]=(0,T.useState)(void 0),U=yt(a,n),W=yr(g,_,b),V=!!S;function G(e){V&&(e===$&&!z||ys(r,e)&&z&&z.dataKey===e?(q(void 0),null==S||S(null)):(q(e),null==S||S({eventType:"category",categoryClicked:e})),H(void 0))}return T.default.createElement("div",Object.assign({ref:t,className:(0,C.tremorTwMerge)("w-full h-80",k)},F),T.default.createElement(aZ,{className:"h-full w-full"},(null==r?void 0:r.length)?T.default.createElement(PU,{data:r,onClick:V&&($||z)?()=>{H(void 0),q(void 0),null==S||S(null)}:void 0,margin:{bottom:I?30:void 0,left:Y?20:void 0,right:Y?5:void 0,top:5}},x?T.default.createElement(gZ,{className:(0,C.tremorTwMerge)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,T.default.createElement(gS,{padding:A,hide:!o,dataKey:s,interval:i?"preserveStartEnd":u,tick:{transform:"translate(0, 6)"},ticks:i?[r[0][s],r[r.length-1][s]]:void 0,fill:"",stroke:"",className:(0,C.tremorTwMerge)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,minTickGap:E,angle:null==P?void 0:P.angle,dy:null==P?void 0:P.verticalShift,height:null==P?void 0:P.xAxisHeight},I&&T.default.createElement(pI,{position:"insideBottom",offset:-20,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},I)),T.default.createElement(gA,{width:c,hide:!d,axisLine:!1,tickLine:!1,type:"number",domain:W,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,C.tremorTwMerge)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:l,allowDecimals:j},Y&&T.default.createElement(pI,{position:"insideLeft",style:{textAnchor:"middle"},angle:-90,offset:-15,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},Y)),T.default.createElement(sD,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:h?({active:e,payload:t,label:r})=>D?T.default.createElement(D,{payload:null==t?void 0:t.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!=(t=U.get(e.dataKey))?t:r8.BaseColors.Gray})}),active:e,label:r}):T.default.createElement(g9,{active:e,payload:t,label:r,valueFormatter:l,categoryColors:U}):T.default.createElement(T.default.Fragment,null),position:{y:0}}),f?T.default.createElement(nv,{verticalAlign:"top",height:R,content:({payload:e})=>g3({payload:e},U,B,$,V?e=>G(e):void 0,O)}):null,a.map(e=>{var t;return T.default.createElement(Pm,{className:(0,C.tremorTwMerge)((0,L.getColorClassNames)(null!=(t=U.get(e))?t:r8.BaseColors.Gray,M.colorPalette.text).strokeColor),strokeOpacity:z||$&&$!==e?.3:1,activeDot:e=>{var t;let{cx:a,cy:s,stroke:n,strokeLinecap:l,strokeLinejoin:i,strokeWidth:o,dataKey:d}=e;return T.default.createElement(nw,{className:(0,C.tremorTwMerge)("stroke-tremor-background dark:stroke-dark-tremor-background",S?"cursor-pointer":"",(0,L.getColorClassNames)(null!=(t=U.get(d))?t:r8.BaseColors.Gray,M.colorPalette.text).fillColor),cx:a,cy:s,r:5,fill:"",stroke:n,strokeLinecap:l,strokeLinejoin:i,strokeWidth:o,onClick:(t,a)=>{a.stopPropagation(),V&&(e.index===(null==z?void 0:z.index)&&e.dataKey===(null==z?void 0:z.dataKey)||ys(r,e.dataKey)&&$&&$===e.dataKey?(q(void 0),H(void 0),null==S||S(null)):(q(e.dataKey),H({index:e.index,dataKey:e.dataKey}),null==S||S(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}})},dot:t=>{var a;let{stroke:s,strokeLinecap:n,strokeLinejoin:l,strokeWidth:i,cx:o,cy:d,dataKey:c,index:u}=t;return ys(r,e)&&!(z||$&&$!==e)||(null==z?void 0:z.index)===u&&(null==z?void 0:z.dataKey)===e?T.default.createElement(nw,{key:u,cx:o,cy:d,r:5,stroke:s,fill:"",strokeLinecap:n,strokeLinejoin:l,strokeWidth:i,className:(0,C.tremorTwMerge)("stroke-tremor-background dark:stroke-dark-tremor-background",S?"cursor-pointer":"",(0,L.getColorClassNames)(null!=(a=U.get(c))?a:r8.BaseColors.Gray,M.colorPalette.text).fillColor)}):T.default.createElement(T.Fragment,{key:u})},key:e,name:e,type:y,dataKey:e,stroke:"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:p,animationDuration:m,connectNulls:v})}),S?a.map(e=>T.default.createElement(Pm,{className:(0,C.tremorTwMerge)("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:y,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:v,onClick:(e,t)=>{t.stopPropagation();let{name:r}=e;G(r)}})):null):T.default.createElement(ye,{noDataText:w})))});PW.displayName="LineChart";let PV=function({dailyData:e,endpointData:t}){let r=(0,T.useMemo)(()=>{var t;let r,a;return e?.results&&0!==e.results.length?(t=e.results,r=[],a=new Set,t.forEach(e=>{e.breakdown.endpoints&&Object.keys(e.breakdown.endpoints).forEach(e=>a.add(e))}),t.forEach(e=>{let t={date:new Date(e.date).toLocaleDateString("en-US",{month:"short",day:"numeric"})};a.forEach(r=>{let a=e.breakdown.endpoints?.[r];t[r]=a?.metrics.api_requests||0}),r.push(t)}),r.reverse()):[]},[e]),a=(0,T.useMemo)(()=>0===r.length?[]:Object.keys(r[0]).filter(e=>"date"!==e),[r]);return(0,_.jsxs)(P.Card,{className:"mb-6",children:[(0,_.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,_.jsx)(X.Title,{children:"Endpoint Usage Trends"})}),(0,_.jsx)(PW,{className:"h-80",data:r,index:"date",categories:a,colors:["blue","cyan","indigo","violet","purple","fuchsia","pink","rose","red","orange"].slice(0,a.length),valueFormatter:e=>e.toLocaleString(),showLegend:!0,showGridLines:!0,yAxisWidth:60,connectNulls:!0,curveType:"natural"})]})};var PG=e.i(309821),PG=PG;let PK=({endpointData:e})=>{let t=Object.entries(e).map(([e,t])=>{var r,a;return{key:e,endpoint:e,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,api_requests:t.metrics.api_requests,total_tokens:t.metrics.total_tokens,spend:t.metrics.spend,successRate:(r=t.metrics.successful_requests,0===(a=t.metrics.api_requests)?0:r/a*100)}}),r=[{title:"Endpoint",dataIndex:"endpoint",key:"endpoint",render:e=>(0,_.jsx)("span",{className:"font-medium",children:e})},{title:"Successful / Failed",key:"requests",render:(e,t)=>{let r=t.api_requests>0?t.successful_requests/t.api_requests*100:0,a=t.api_requests>0?t.failed_requests/t.api_requests*100:0,s={"0%":"#22c55e"};return r>0&&r<100&&(s[`${r}%`]="#22c55e",s[`${r+.01}%`]="#ef4444"),s["100%"]=a>0?"#ef4444":"#22c55e",(0,_.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,_.jsx)("div",{className:"flex-1 relative",children:(0,_.jsx)(PG.default,{percent:r+a,size:"small",strokeColor:s,showInfo:!1})}),(0,_.jsxs)("div",{className:"flex items-center space-x-2 text-sm min-w-[100px]",children:[(0,_.jsx)("span",{className:"text-green-600 font-medium",children:t.successful_requests.toLocaleString()}),(0,_.jsx)("span",{className:"text-gray-400",children:"/"}),(0,_.jsx)("span",{className:"text-red-600 font-medium",children:t.failed_requests.toLocaleString()})]})]})}},{title:"Total Request",dataIndex:"api_requests",key:"api_requests",render:e=>e.toLocaleString()},{title:"Success Rate",dataIndex:"successRate",key:"successRate",render:e=>{let t=e.toFixed(2);return(0,_.jsxs)("span",{className:e>=95?"text-green-600 font-medium":e>=80?"text-yellow-600 font-medium":"text-red-600 font-medium",children:[t,"%"]})}},{title:"Total Tokens",dataIndex:"total_tokens",key:"total_tokens",render:e=>e.toLocaleString()},{title:"Spend",dataIndex:"spend",key:"spend",render:e=>`$${(0,rV.formatNumberWithCommas)(e,2)}`}];return(0,_.jsx)(eK.Table,{columns:r,dataSource:t,pagination:!1})},PJ=({userSpendData:e})=>{let t=(0,T.useMemo)(()=>{let t={};return e?.results&&e.results.forEach(e=>{Object.entries(e.breakdown.endpoints||{}).forEach(([e,r])=>{t[e]||(t[e]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:r.metadata||{},api_key_breakdown:{}}),t[e].metrics.spend+=r.metrics.spend,t[e].metrics.prompt_tokens+=r.metrics.prompt_tokens,t[e].metrics.completion_tokens+=r.metrics.completion_tokens,t[e].metrics.total_tokens+=r.metrics.total_tokens,t[e].metrics.api_requests+=r.metrics.api_requests,t[e].metrics.successful_requests+=r.metrics.successful_requests||0,t[e].metrics.failed_requests+=r.metrics.failed_requests||0,t[e].metrics.cache_read_input_tokens+=r.metrics.cache_read_input_tokens||0,t[e].metrics.cache_creation_input_tokens+=r.metrics.cache_creation_input_tokens||0})}),t},[e]);return(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsx)(PK,{endpointData:t}),(0,_.jsx)(Pq,{endpointData:t}),(0,_.jsx)(PV,{dailyData:e,endpointData:t})]})};var PQ=e.i(214541),PX=["points","className","baseLinePoints","connectNulls"];function PZ(){return(PZ=Object.assign.bind()).apply(this,arguments)}function P0(e){return function(e){if(Array.isArray(e))return P1(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return P1(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return P1(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P1(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=Array(t);r0&&void 0!==arguments[0]?arguments[0]:[],t=[[]];return e.forEach(function(e){P2(e)?t[t.length-1].push(e):t[t.length-1].length>0&&t.push([])}),P2(e[0])&&t[t.length-1].push(e[0]),t[t.length-1].length<=0&&(t=t.slice(0,-1)),t},P5=function(e,t){var r=P4(e);t&&(r=[r.reduce(function(e,t){return[].concat(P0(e),P0(t))},[])]);var a=r.map(function(e){return e.reduce(function(e,t,r){return"".concat(e).concat(0===r?"M":"L").concat(t.x,",").concat(t.y)},"")}).join("");return 1===r.length?"".concat(a,"Z"):a},P6=function(e,t,r){var a=P5(e,r);return"".concat("Z"===a.slice(-1)?a.slice(0,-1):a,"L").concat(P5(t.reverse(),r).slice(1))},P3=function(e){var t=e.points,r=e.className,a=e.baseLinePoints,s=e.connectNulls,n=function(e,t){if(null==e)return{};var r,a,s=function(e,t){if(null==e)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}(e,PX);if(!t||!t.length)return null;var l=(0,r7.default)("recharts-polygon",r);if(a&&a.length){var i=n.stroke&&"none"!==n.stroke,o=P6(t,a,s);return T.default.createElement("g",{className:l},T.default.createElement("path",PZ({},aq(n,!0),{fill:"Z"===o.slice(-1)?n.fill:"none",stroke:"none",d:o})),i?T.default.createElement("path",PZ({},aq(n,!0),{fill:"none",d:P5(t,s)})):null,i?T.default.createElement("path",PZ({},aq(n,!0),{fill:"none",d:P5(a,s)})):null)}var d=P5(t,s);return T.default.createElement("path",PZ({},aq(n,!0),{fill:"Z"===d.slice(-1)?n.fill:"none",className:l,d:d}))};function P8(e){return(P8="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P7(){return(P7=Object.assign.bind()).apply(this,arguments)}function P9(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function Ae(e){for(var t=1;t1e-5?"outer"===t?"start":"end":r<-1e-5?"outer"===t?"end":"start":"middle"}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.cx,r=e.cy,a=e.radius,s=e.axisLine,n=e.axisLineType,l=Ae(Ae({},aq(this.props,!1)),{},{fill:"none"},aq(s,!1));if("circle"===n)return T.default.createElement(nw,P7({className:"recharts-polar-angle-axis-line"},l,{cx:t,cy:r,r:a}));var i=this.props.ticks.map(function(e){return p_(t,r,a,e.coordinate)});return T.default.createElement(P3,P7({className:"recharts-polar-angle-axis-line"},l,{points:i}))}},{key:"renderTicks",value:function(){var e=this,t=this.props,r=t.ticks,s=t.tick,n=t.tickLine,l=t.tickFormatter,i=t.stroke,o=aq(this.props,!1),d=aq(s,!1),c=Ae(Ae({},o),{},{fill:"none"},aq(n,!1)),u=r.map(function(t,r){var u=e.getTickLineCoord(t),m=Ae(Ae(Ae({textAnchor:e.getTickTextAnchor(t)},o),{},{stroke:"none",fill:i},d),{},{index:r,payload:t,x:u.x2,y:u.y2});return T.default.createElement(a7,P7({className:(0,r7.default)("recharts-polar-angle-axis-tick",pS(s)),key:"tick-".concat(t.coordinate)},aM(e.props,t,r)),n&&T.default.createElement("line",P7({className:"recharts-polar-angle-axis-tick-line"},c,u)),s&&a.renderTickItem(s,m,l?l(t.value,r):t.value))});return T.default.createElement(a7,{className:"recharts-polar-angle-axis-ticks"},u)}},{key:"render",value:function(){var e=this.props,t=e.ticks,r=e.radius,a=e.axisLine;return!(r<=0)&&t&&t.length?T.default.createElement(a7,{className:(0,r7.default)("recharts-polar-angle-axis",this.props.className)},a&&this.renderAxisLine(),this.renderTicks()):null}}],r=[{key:"renderTickItem",value:function(e,t,r){return T.default.isValidElement(e)?T.default.cloneElement(e,t):(0,ay.default)(e)?e(t):T.default.createElement(iX,P7({},t,{className:"recharts-polar-angle-axis-tick-value"}),r)}}],t&&At(a.prototype,t),r&&At(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}(T.PureComponent);An(Ao,"displayName","PolarAngleAxis"),An(Ao,"axisType","angleAxis"),An(Ao,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var Ad=e.i(419530),Ac=e.i(549673),Au=["cx","cy","angle","ticks","axisLine"],Am=["ticks","tick","angle","tickFormatter","stroke"];function Ap(e){return(Ap="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ah(){return(Ah=Object.assign.bind()).apply(this,arguments)}function Af(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function Ax(e){for(var t=1;t=0)continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Ay(e,t){for(var r=0;r0?(0,ar.default)(e,"paddingAngle",0):0;if(r){var i=ah(r.endAngle-r.startAngle,e.endAngle-e.startAngle),o=AM(AM({},e),{},{startAngle:n+l,endAngle:n+i(a)+l});s.push(o),n=o.endAngle}else{var c=ah(0,e.endAngle-e.startAngle)(a),u=AM(AM({},e),{},{startAngle:n+l,endAngle:n+c+l});s.push(u),n=u.endAngle}}),T.default.createElement(a7,null,e.renderSectorsStatically(s))})}},{key:"attachKeyboardHandlers",value:function(e){var t=this;e.onkeydown=function(e){if(!e.altKey)switch(e.key){case"ArrowLeft":var r=++t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[r].focus(),t.setState({sectorToFocus:r});break;case"ArrowRight":var a=--t.state.sectorToFocus<0?t.sectorRefs.length-1:t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[a].focus(),t.setState({sectorToFocus:a});break;case"Escape":t.sectorRefs[t.state.sectorToFocus].blur(),t.setState({sectorToFocus:0})}}}},{key:"renderSectors",value:function(){var e=this.props,t=e.sectors,r=e.isAnimationActive,a=this.state.prevSectors;return r&&t&&t.length&&(!a||!(0,uq.default)(a,t))?this.renderSectorsWithAnimation():this.renderSectorsStatically(t)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var e=this,t=this.props,r=t.hide,a=t.sectors,s=t.className,n=t.label,l=t.cx,i=t.cy,o=t.innerRadius,d=t.outerRadius,c=t.isAnimationActive,u=this.state.isAnimationFinished;if(r||!a||!a.length||!ai(l)||!ai(i)||!ai(o)||!ai(d))return null;var m=(0,r7.default)("recharts-pie",s);return T.default.createElement(a7,{tabIndex:this.props.rootTabIndex,className:m,ref:function(t){e.pieRef=t}},this.renderSectors(),n&&this.renderLabels(a),pI.renderCallByParent(this.props,null,!1),(!c||u)&&pX.renderCallByParent(this.props,a,!1))}}],r=[{key:"getDerivedStateFromProps",value:function(e,t){return t.prevIsAnimationActive!==e.isAnimationActive?{prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:[],isAnimationFinished:!0}:e.isAnimationActive&&e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:t.curSectors,isAnimationFinished:!0}:e.sectors!==t.curSectors?{curSectors:e.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(e,t){return e>t?"start":e=360?b:b-1)*c,j=l.reduce(function(e,t){var r=mk(t,_,0);return e+(ai(r)?r:0)},0);return j>0&&(t=l.map(function(e,t){var a,s=mk(e,_,0),n=mk(e,m,t),l=(ai(s)?s:0)/j,d=(a=t?r.endAngle+an(g)*c*(0!==s):o)+an(g)*((0!==s?f:0)+l*v),u=(a+d)/2,p=(x.innerRadius+x.outerRadius)/2,y=[{name:n,value:s,payload:e,dataKey:_,type:h}],b=p_(x.cx,x.cy,p,u);return r=AM(AM(AM({percent:l,cornerRadius:i,name:n,tooltipPayload:y,midAngle:u,middleRadius:p,tooltipPosition:b},e),x),{},{value:mk(e,_),startAngle:a,endAngle:d,payload:e,paddingAngle:an(g)*c})})),AM(AM({},x),{},{sectors:t,data:l})});var AI=x6({chartName:"PieChart",GraphicalChild:AE,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Ao},{axisType:"radiusAxis",AxisComp:Ak}],formatAxisMap:function(e,t,r,a,s){var n=e.width,l=e.height,i=e.startAngle,o=e.endAngle,d=au(e.cx,n,n/2),c=au(e.cy,l,l/2),u=pb(n,l,r),m=au(e.innerRadius,u,0),p=au(e.outerRadius,u,.8*u);return Object.keys(t).reduce(function(e,r){var n,l=t[r],u=l.domain,h=l.reversed;if((0,as.default)(l.range))"angleAxis"===a?n=[i,o]:"radiusAxis"===a&&(n=[m,p]),h&&(n=[n[1],n[0]]);else{var f,x=function(e){if(Array.isArray(e))return e}(f=n=l.range)||function(e,t){var r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a,s,n,l,i=[],o=!0,d=!1;try{n=(r=r.call(e)).next,!1;for(;!(o=(a=n.call(r)).done)&&(i.push(a.value),2!==i.length);o=!0);}catch(e){d=!0,s=e}finally{try{if(!o&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(d)throw s}}return i}}(f,2)||function(e,t){if(e){if("string"==typeof e)return pg(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pg(e,2)}}(f,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();i=x[0],o=x[1]}var g=mR(l,s),y=g.realScaleType,_=g.scale;_.domain(u).range(n),mB(_);var b=mW(_,pf(pf({},l),{},{realScaleType:y})),v=pf(pf(pf({},l),b),{},{range:n,radius:p,realScaleType:y,scale:_,cx:d,cy:c,innerRadius:m,outerRadius:p,startAngle:i,endAngle:o});return pf(pf({},e),{},px({},r,v))},{})},defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});let AY=({active:e,payload:t,valueFormatter:r})=>{if(e&&(null==t?void 0:t[0])){let e=null==t?void 0:t[0];return T.default.createElement(g8,null,T.default.createElement("div",{className:(0,C.tremorTwMerge)("px-4 py-2")},T.default.createElement(g7,{value:r(e.value),name:e.name,color:e.payload.color})))}return null},AF=e=>{let{cx:t,cy:r,innerRadius:a,outerRadius:s,startAngle:n,endAngle:l,className:i}=e;return T.default.createElement("g",null,T.default.createElement(hi,{cx:t,cy:r,innerRadius:a,outerRadius:s,startAngle:n,endAngle:l,className:i,fill:"",opacity:.3,style:{outline:"none"}}))},AR=T.default.forwardRef((e,t)=>{let{data:r=[],category:a="value",index:s="name",colors:n=M.themeColorRange,variant:l="donut",valueFormatter:i=L.defaultValueFormatter,label:o,showLabel:d=!0,animationDuration:c=900,showAnimation:u=!1,showTooltip:m=!0,noDataText:p,onValueChange:h,customTooltip:f,className:x}=e,g=(0,N.__rest)(e,["data","category","index","colors","variant","valueFormatter","label","showLabel","animationDuration","showAnimation","showTooltip","noDataText","onValueChange","customTooltip","className"]),y="donut"==l,_=o||i((0,L.sumNumericArray)(r.map(e=>e[a]))),[b,v]=T.default.useState(void 0),j=!!h;return(0,T.useEffect)(()=>{let e=document.querySelectorAll(".recharts-pie-sector");e&&e.forEach(e=>{e.setAttribute("style","outline: none")})},[b]),T.default.createElement("div",Object.assign({ref:t,className:(0,C.tremorTwMerge)("w-full h-40",x)},g),T.default.createElement(aZ,{className:"h-full w-full"},(null==r?void 0:r.length)?T.default.createElement(AI,{onClick:j&&b?()=>{v(void 0),null==h||h(null)}:void 0,margin:{top:0,left:0,right:0,bottom:0}},d&&y?T.default.createElement("text",{className:(0,C.tremorTwMerge)("fill-tremor-content-emphasis","dark:fill-dark-tremor-content-emphasis"),x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle"},_):null,T.default.createElement(AE,{className:(0,C.tremorTwMerge)("stroke-tremor-background dark:stroke-dark-tremor-background",h?"cursor-pointer":"cursor-default"),data:r.map((e,t)=>{let r=t{var r;return f?T.default.createElement(f,{payload:null==t?void 0:t.map(e=>{var r,a,s;return Object.assign(Object.assign({},e),{color:null!=(s=null==(a=null==(r=null==t?void 0:t[0])?void 0:r.payload)?void 0:a.color)?s:r8.BaseColors.Gray})}),active:e,label:null==(r=null==t?void 0:t[0])?void 0:r.name}):T.default.createElement(AY,{active:e,payload:t,valueFormatter:i})}:T.default.createElement(T.default.Fragment,null)})):T.default.createElement(ye,{noDataText:p})))});AR.displayName="DonutChart";let{Text:AB}=V.Typography,Az=({value:e=[],onChange:t,disabled:r,organizationId:a,pageSize:s=20,placeholder:n="Search teams by alias..."})=>{let[l,i]=(0,T.useState)(""),[o,d]=(0,Dj.useDebouncedState)("",{wait:300}),{data:c,fetchNextPage:u,hasNextPage:m,isFetchingNextPage:p,isLoading:h}=(0,jY.useInfiniteTeams)(s,o||void 0,a),f=(0,T.useMemo)(()=>{if(!c?.pages)return[];let e=new Set,t=[];for(let r of c.pages)for(let a of r.teams)e.has(a.team_id)||(e.add(a.team_id),t.push(a));return t},[c]);return(0,_.jsx)(eE.Select,{mode:"multiple",showSearch:!0,placeholder:n,value:e,onChange:e=>t?.(e),disabled:r,allowClear:!0,filterOption:!1,onSearch:e=>{i(e),d(e)},searchValue:l,onPopupScroll:e=>{let t=e.currentTarget;(t.scrollTop+t.clientHeight)/t.scrollHeight>=.8&&m&&!p&&u()},loading:h,notFoundContent:h?(0,_.jsx)(wo.LoadingOutlined,{spin:!0}):"No teams found",style:{width:"100%"},popupRender:e=>(0,_.jsxs)(_.Fragment,{children:[e,p&&(0,_.jsx)("div",{style:{textAlign:"center",padding:8},children:(0,_.jsx)(wo.LoadingOutlined,{spin:!0})})]}),children:f.map(e=>(0,_.jsxs)(eE.Select.Option,{value:e.team_id,children:[(0,_.jsx)("span",{className:"font-medium",children:e.team_alias})," ",(0,_.jsxs)(AB,{type:"secondary",children:["(",e.team_id,")"]})]},e.team_id))})};var AH=e.i(20147);let A$=({topKeys:e,teams:t,showTags:r=!1,topKeysLimit:a,setTopKeysLimit:s})=>{let{accessToken:n,userRole:l,userId:i,premiumUser:o}=(0,k.default)(),[d,c]=(0,T.useState)(!1),[u,m]=(0,T.useState)(null),[p,h]=(0,T.useState)(void 0),[f,x]=(0,T.useState)("table"),[g,y]=(0,T.useState)(new Set),b=async e=>{if(n)try{let t=await (0,Q.keyInfoV1Call)(n,e.api_key),r=(e=>{let{key:t,info:r}=e;return{token:t,...r}})(t);h(r),m(e.api_key),c(!0)}catch(e){console.error("Error fetching key info:",e)}},v=()=>{c(!1),m(null),h(void 0)};T.default.useEffect(()=>{let e=e=>{"Escape"===e.key&&d&&v()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[d]);let j=[{header:"Key ID",accessorKey:"api_key",cell:e=>(0,_.jsx)("div",{className:"overflow-hidden",children:(0,_.jsx)(tB.Tooltip,{title:e.getValue(),children:(0,_.jsx)(S.Button,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>b(e.row.original),children:e.getValue()?`${e.getValue().slice(0,7)}...`:"-"})})})},{header:"Key Alias",accessorKey:"key_alias",cell:e=>e.getValue()||"-"}],w={header:"Spend (USD)",accessorKey:"spend",cell:e=>{let t=e.getValue();return t>0&&t<.01?"<$0.01":`$${(0,rV.formatNumberWithCommas)(t,2)}`}},N=r?[...j,{header:"Tags",accessorKey:"tags",cell:e=>{let t=e.getValue(),r=e.row.original.api_key,a=g.has(r);if(!t||0===t.length)return"-";let s=t.sort((e,t)=>t.usage-e.usage),n=a?s:s.slice(0,2),l=t.length>2;return(0,_.jsx)("div",{className:"overflow-hidden",children:(0,_.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[n.map((e,t)=>(0,_.jsx)(tB.Tooltip,{title:(0,_.jsxs)("div",{children:[(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{className:"text-gray-300",children:"Tag Name:"})," ",e.tag]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{className:"text-gray-300",children:"Spend:"})," ",e.usage>0&&e.usage<.01?"<$0.01":`$${(0,rV.formatNumberWithCommas)(e.usage,2)}`]})]}),children:(0,_.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[e.tag.slice(0,7),"..."]})},t)),l&&(0,_.jsx)("button",{onClick:()=>{y(e=>{let t=new Set(e);return t.has(r)?t.delete(r):t.add(r),t})},className:"ml-1 p-1 hover:bg-gray-200 rounded-full transition-colors",title:a?"Show fewer tags":"Show all tags",children:a?(0,_.jsx)(jC.ChevronUpIcon,{className:"h-3 w-3 text-gray-500"}):(0,_.jsx)(jM.ChevronDownIcon,{className:"h-3 w-3 text-gray-500"})})]})})}},w]:[...j,w],M=e.map(e=>({...e,display_key_alias:e.key_alias&&e.key_alias.length>10?`${e.key_alias.slice(0,10)}...`:e.key_alias||"-"}));return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("div",{className:"mb-4 flex justify-between items-center",children:[(0,_.jsx)(DY,{options:[{label:"5",value:5},{label:"10",value:10},{label:"25",value:25},{label:"50",value:50}],value:a,onChange:e=>s(e)}),(0,_.jsxs)("div",{className:"flex space-x-2",children:[(0,_.jsx)("button",{onClick:()=>x("table"),className:`px-3 py-1 text-sm rounded-md ${"table"===f?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"}`,children:"Table View"}),(0,_.jsx)("button",{onClick:()=>x("chart"),className:`px-3 py-1 text-sm rounded-md ${"chart"===f?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"}`,children:"Chart View"})]})]}),"chart"===f?(0,_.jsx)("div",{className:"relative max-h-[600px] overflow-y-auto",children:(0,_.jsx)(yn,{className:"mt-4 cursor-pointer hover:opacity-90",style:{height:52*Math.min(M.length,a)},data:M,index:"display_key_alias",categories:["spend"],colors:["cyan"],yAxisWidth:120,tickGap:5,layout:"vertical",showLegend:!1,valueFormatter:e=>`$${(0,rV.formatNumberWithCommas)(e,2)}`,onValueChange:e=>b(e),showTooltip:!0,customTooltip:e=>{let t=e.payload?.[0]?.payload;return(0,_.jsx)("div",{className:"relative z-50 p-3 bg-black/90 shadow-lg rounded-lg text-white max-w-xs",children:(0,_.jsxs)("div",{className:"space-y-1.5",children:[(0,_.jsxs)("div",{className:"text-sm",children:[(0,_.jsx)("span",{className:"text-gray-300",children:"Key Alias: "}),(0,_.jsx)("span",{className:"font-mono text-gray-100 break-all",children:t?.key_alias})]}),(0,_.jsxs)("div",{className:"text-sm",children:[(0,_.jsx)("span",{className:"text-gray-300",children:"Key ID: "}),(0,_.jsx)("span",{className:"font-mono text-gray-100 break-all",children:t?.api_key})]}),(0,_.jsxs)("div",{className:"text-sm",children:[(0,_.jsx)("span",{className:"text-gray-300",children:"Spend: "}),(0,_.jsxs)("span",{className:"text-white font-medium",children:["$",(0,rV.formatNumberWithCommas)(t?.spend,2)]})]})]})})}})}):(0,_.jsx)("div",{className:"border rounded-lg overflow-hidden max-h-[600px] overflow-y-auto",children:(0,_.jsx)(LH.DataTable,{columns:N,data:e,renderSubComponent:()=>(0,_.jsx)(_.Fragment,{}),getRowCanExpand:()=>!1,isLoading:!1})}),d&&u&&p&&(console.log("Rendering modal with:",{isModalOpen:d,selectedKey:u,keyData:p}),(0,_.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",onClick:e=>{e.target===e.currentTarget&&v()},children:(0,_.jsxs)("div",{className:"bg-white rounded-lg shadow-xl relative w-11/12 max-w-6xl max-h-[90vh] overflow-y-auto min-h-[750px]",children:[(0,_.jsx)("button",{onClick:v,className:"absolute top-4 right-4 text-gray-500 hover:text-gray-700 focus:outline-none","aria-label":"Close",children:(0,_.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})}),(0,_.jsx)("div",{className:"p-6 h-full",children:(0,_.jsx)(AH.default,{keyId:u,onClose:v,keyData:p,teams:t})})]})}))]})};function Aq({topModels:e,topModelsLimit:t,setTopModelsLimit:r}){let[a,s]=(0,T.useState)("table"),n=[{header:"Model",accessorKey:"key",cell:e=>e.getValue()||"-"},{header:"Spend (USD)",accessorKey:"spend",cell:e=>{let t=e.getValue();return`$${(0,rV.formatNumberWithCommas)(t,2)}`}},{header:"Successful",accessorKey:"successful_requests",cell:e=>(0,_.jsx)("span",{className:"text-green-600",children:e.getValue()?.toLocaleString()||0})},{header:"Failed",accessorKey:"failed_requests",cell:e=>(0,_.jsx)("span",{className:"text-red-600",children:e.getValue()?.toLocaleString()||0})},{header:"Tokens",accessorKey:"tokens",cell:e=>e.getValue()?.toLocaleString()||0}],l=e.slice(0,t);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("div",{className:"mb-4 flex justify-between items-center",children:[(0,_.jsx)(DY,{options:[{label:"5",value:5},{label:"10",value:10},{label:"25",value:25},{label:"50",value:50}],value:t,onChange:e=>r(e)}),(0,_.jsxs)("div",{className:"flex space-x-2",children:[(0,_.jsx)("button",{onClick:()=>s("table"),className:`px-3 py-1 text-sm rounded-md ${"table"===a?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"}`,children:"Table View"}),(0,_.jsx)("button",{onClick:()=>s("chart"),className:`px-3 py-1 text-sm rounded-md ${"chart"===a?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"}`,children:"Chart View"})]})]}),"chart"===a?(0,_.jsx)("div",{className:"relative max-h-[600px] overflow-y-auto",children:(0,_.jsx)(yn,{className:"mt-4 cursor-pointer hover:opacity-90",style:{height:52*Math.min(l.length,t)},data:l,index:"key",categories:["spend"],colors:["cyan"],valueFormatter:e=>`$${(0,rV.formatNumberWithCommas)(e,2)}`,layout:"vertical",yAxisWidth:200,tickGap:5,showLegend:!1})}):(0,_.jsx)("div",{className:"border rounded-lg overflow-hidden max-h-[600px] overflow-y-auto",children:(0,_.jsx)(LH.DataTable,{columns:n,data:l,renderSubComponent:()=>(0,_.jsx)(_.Fragment,{}),getRowCanExpand:()=>!1,isLoading:!1})})]})}let AU={tag:Q.tagDailyActivityCall,team:Q.teamDailyActivityCall,organization:Q.organizationDailyActivityCall,customer:Q.customerDailyActivityCall,agent:Q.agentDailyActivityCall,user:Q.userDailyActivityCall},AW=({accessToken:e,entityType:t,entityId:r,entityList:a,dateValue:s})=>{let n,l,i,{teams:o}=(0,PQ.default)(),[d,c]=(0,T.useState)([]),[u,m]=(0,T.useState)(5),[p,h]=(0,T.useState)(5),[f,x]=(0,T.useState)(5),g=(0,T.useMemo)(()=>s.from?new Date(s.from):null,[s.from]),y=(0,T.useMemo)(()=>s.to?new Date(s.to):null,[s.to]),b=(0,T.useMemo)(()=>"user"===t?d.length>0?d[0]:null:d.length>0?d:null,[t,d]),v=AU[t],j=!!e&&!!g&&!!y,{data:w,isFetchingMore:k,progress:S,cancelled:N,cancel:M}=P$({fetchFn:v,args:[e,g,y,b],enabled:j}),{data:C,isFetchingMore:L,progress:O,cancelled:D,cancel:H}=P$({fetchFn:Q.agentDailyActivityCall,args:[e,g,y,null],enabled:j&&"team"===t}),$=Pw(w,"models",o||[]),q=Pw(w,"api_keys",o||[]),U="team"===t?Pw(C,"entities",o||[]):{},W=()=>{let e={};return w.results.forEach(t=>{Object.entries(t.breakdown.providers||{}).forEach(([t,r])=>{e[t]||(e[t]={provider:t,spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0});try{e[t].spend+=r.metrics.spend,e[t].requests+=r.metrics.api_requests,e[t].successful_requests+=r.metrics.successful_requests,e[t].failed_requests+=r.metrics.failed_requests,e[t].tokens+=r.metrics.total_tokens}catch(e){console.error(`Error processing provider ${t}: ${e}`)}})}),Object.values(e).filter(e=>e.spend>0).sort((e,t)=>t.spend-e.spend)},V=(e,t)=>{if(a){let t=a.find(t=>t.value===e);if(t)return t.label}return t?.team_alias?t.team_alias:e},G=()=>{var e;let t={};return w.results.forEach(e=>{Object.entries(e.breakdown.entities||{}).forEach(([e,r])=>{t[e]||(t[e]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{alias:V(e,r.metadata),id:e}}),t[e].metrics.spend+=r.metrics.spend,t[e].metrics.api_requests+=r.metrics.api_requests,t[e].metrics.successful_requests+=r.metrics.successful_requests,t[e].metrics.failed_requests+=r.metrics.failed_requests,t[e].metrics.total_tokens+=r.metrics.total_tokens})}),e=Object.values(t).sort((e,t)=>t.metrics.spend-e.metrics.spend),0===d.length?e:e.filter(e=>d.includes(e.metadata.id))},K=t.charAt(0).toUpperCase()+t.slice(1);return(0,_.jsxs)("div",{style:{width:"100%"},className:"relative",children:[k&&(0,_.jsx)(B.Alert,{banner:!0,type:"warning",className:"mb-2",message:(0,_.jsxs)("div",{className:"flex items-center justify-between",children:[(0,_.jsxs)("span",{children:[(0,_.jsx)(wo.LoadingOutlined,{spin:!0,className:"mr-2"}),"Currently fetching spend data: fetched ",S.currentPage," / ",S.totalPages," pages. Charts will update periodically as data loads. Moving off of this page will stop and reset this. To continue using the UI in the meantime,"," ",(0,_.jsxs)("a",{href:window.location.href,target:"_blank",rel:"noopener noreferrer",children:["open a new tab ",(0,_.jsx)(MD.ExportOutlined,{})]}),"."]}),(0,_.jsx)(z.Button,{type:"primary",danger:!0,onClick:M,children:"Stop"})]})}),N&&(0,_.jsx)(B.Alert,{banner:!0,type:"info",className:"mb-2",message:(0,_.jsxs)("span",{children:["Showing partial data (",S.currentPage,"/",S.totalPages," pages loaded)"]})}),L&&"team"===t&&(0,_.jsx)(B.Alert,{banner:!0,type:"warning",className:"mb-2",message:(0,_.jsxs)("div",{className:"flex items-center justify-between",children:[(0,_.jsxs)("span",{children:[(0,_.jsx)(wo.LoadingOutlined,{spin:!0,className:"mr-2"}),"Currently fetching agent data: fetched ",O.currentPage," / ",O.totalPages," pages. Charts will update periodically as data loads. Moving off of this page will stop and reset this. To continue using the UI in the meantime,"," ",(0,_.jsxs)("a",{href:window.location.href,target:"_blank",rel:"noopener noreferrer",children:["open a new tab ",(0,_.jsx)(MD.ExportOutlined,{})]}),"."]}),(0,_.jsx)(z.Button,{type:"primary",danger:!0,onClick:H,children:"Stop"})]})}),D&&"team"===t&&(0,_.jsx)(B.Alert,{banner:!0,type:"info",className:"mb-2",message:(0,_.jsxs)("span",{children:["Showing partial agent data (",O.currentPage,"/",O.totalPages," pages loaded)"]})}),"team"===t&&(0,_.jsxs)("div",{className:"mb-4",children:[(0,_.jsx)(Z.Text,{className:"mb-2",children:"Filter by team"}),(0,_.jsx)(Az,{value:d,onChange:c})]}),(0,_.jsx)(PA,{dateValue:s,entityType:t,spendData:w,showFilters:"team"!==t&&null!==a&&a.length>0,filterLabel:`Filter by ${t}`,filterPlaceholder:`Select ${t} to filter...`,selectedFilters:d,onFiltersChange:c,filterOptions:(()=>{if(a)return a})()||void 0,filterMode:"user"===t?"single":"multiple",teams:o||[]}),(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)(rR.TabList,{variant:"solid",className:"mt-1",children:[(0,_.jsx)(rY.Tab,{children:"Cost"}),(0,_.jsx)(rY.Tab,{children:"agent"===t?"Request / Token Consumption":"Model Activity"}),"team"===t?(0,_.jsx)(rY.Tab,{children:"Agent Activity"}):(0,_.jsx)(_.Fragment,{}),(0,_.jsx)(rY.Tab,{children:"Key Activity"}),(0,_.jsx)(rY.Tab,{children:"Endpoint Activity"})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(ee.Grid,{numItems:2,className:"gap-2 w-full",children:[(0,_.jsx)(yl.Col,{numColSpan:2,children:(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)(X.Title,{children:[K," Spend Overview"]}),(0,_.jsxs)(ee.Grid,{numItems:5,className:"gap-4 mt-4",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Total Spend"}),(0,_.jsxs)(Z.Text,{className:"text-2xl font-bold mt-2",children:["$",(0,rV.formatNumberWithCommas)(w.metadata.total_spend,2)]})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Total Requests"}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2",children:w.metadata.total_api_requests.toLocaleString()})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Successful Requests"}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2 text-green-600",children:w.metadata.total_successful_requests.toLocaleString()})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Failed Requests"}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2 text-red-600",children:w.metadata.total_failed_requests.toLocaleString()})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Total Tokens"}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2",children:w.metadata.total_tokens.toLocaleString()})]})]})]})}),(0,_.jsx)(yl.Col,{numColSpan:2,children:(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Daily Spend"}),(0,_.jsx)(yn,{data:[...w.results].sort((e,t)=>new Date(e.date).getTime()-new Date(t.date).getTime()),index:"date",categories:["metrics.spend"],colors:["cyan"],valueFormatter:Pb,yAxisWidth:100,showLegend:!1,customTooltip:({payload:e,active:t})=>{if(!t||!e?.[0])return null;let r=e[0].payload,a=Object.keys(r.breakdown.entities||{}).length;return(0,_.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,_.jsx)("p",{className:"font-bold",children:r.date}),(0,_.jsxs)("p",{className:"text-cyan-500",children:["Total Spend: $",(0,rV.formatNumberWithCommas)(r.metrics.spend,2)]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Total Requests: ",r.metrics.api_requests]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Successful: ",r.metrics.successful_requests]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Failed: ",r.metrics.failed_requests]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Total Tokens: ",r.metrics.total_tokens]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Total ",K,"s: ",a]}),(0,_.jsxs)("div",{className:"mt-2 border-t pt-2",children:[(0,_.jsxs)("p",{className:"font-semibold",children:["Spend by ",K,":"]}),Object.entries(r.breakdown.entities||{}).sort(([,e],[,t])=>{let r=e.metrics.spend;return t.metrics.spend-r}).slice(0,5).map(([e,t])=>(0,_.jsxs)("p",{className:"text-sm text-gray-600",children:[V(e,t.metadata),": $",(0,rV.formatNumberWithCommas)(t.metrics.spend,2)]},e)),a>5&&(0,_.jsxs)("p",{className:"text-sm text-gray-500 italic",children:["...and ",a-5," more"]})]})]})}})]})}),(0,_.jsx)(yl.Col,{numColSpan:2,children:(0,_.jsx)(P.Card,{children:(0,_.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,_.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,_.jsxs)(X.Title,{children:["Spend Per ",K]}),(0,_.jsx)(yv.Subtitle,{className:"text-xs",children:"Showing Top 5 by Spend"}),(0,_.jsxs)("div",{className:"flex items-center text-sm text-gray-500",children:[(0,_.jsxs)("span",{children:["Get Started by Tracking cost per ",K," "]}),(0,_.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/enterprise#spend-tracking",className:"text-blue-500 hover:text-blue-700 ml-1",children:"here"})]})]}),(0,_.jsxs)(ee.Grid,{numItems:2,className:"gap-6",children:[(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsx)(yn,{className:"mt-4 h-52",data:G().slice(0,5).map(e=>({...e,metadata:{...e.metadata,alias_display:e.metadata.alias&&e.metadata.alias.length>15?`${e.metadata.alias.slice(0,15)}...`:e.metadata.alias}})),index:"metadata.alias_display",categories:["metrics.spend"],colors:["cyan"],valueFormatter:Pb,layout:"vertical",showLegend:!1,yAxisWidth:150,customTooltip:({payload:e,active:t})=>{if(!t||!e?.[0])return null;let r=e[0].payload;return(0,_.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,_.jsx)("p",{className:"font-bold",children:r.metadata.alias}),(0,_.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",(0,rV.formatNumberWithCommas)(r.metrics.spend,4)]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Requests: ",r.metrics.api_requests.toLocaleString()]}),(0,_.jsxs)("p",{className:"text-green-600",children:["Successful: ",r.metrics.successful_requests.toLocaleString()]}),(0,_.jsxs)("p",{className:"text-red-600",children:["Failed: ",r.metrics.failed_requests.toLocaleString()]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",r.metrics.total_tokens.toLocaleString()]})]})}})}),(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsx)("div",{className:"h-52 overflow-y-auto",children:(0,_.jsxs)(A.Table,{children:[(0,_.jsx)(Y.TableHead,{children:(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(F.TableHeaderCell,{children:K}),(0,_.jsx)(F.TableHeaderCell,{children:"Spend"}),(0,_.jsx)(F.TableHeaderCell,{className:"text-green-600",children:"Successful"}),(0,_.jsx)(F.TableHeaderCell,{className:"text-red-600",children:"Failed"}),(0,_.jsx)(F.TableHeaderCell,{children:"Tokens"})]})}),(0,_.jsx)(E.TableBody,{children:G().filter(e=>e.metrics.spend>0).map(e=>(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(I.TableCell,{children:e.metadata.alias}),(0,_.jsxs)(I.TableCell,{children:["$",(0,rV.formatNumberWithCommas)(e.metrics.spend,4)]}),(0,_.jsx)(I.TableCell,{className:"text-green-600",children:e.metrics.successful_requests.toLocaleString()}),(0,_.jsx)(I.TableCell,{className:"text-red-600",children:e.metrics.failed_requests.toLocaleString()}),(0,_.jsx)(I.TableCell,{children:e.metrics.total_tokens.toLocaleString()})]},e.metadata.id))})]})})})]})]})})}),(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Top Virtual Keys"}),(0,_.jsx)(A$,{topKeys:(console.log("debugTags",{spendData:w}),n={},w.results.forEach(e=>{let{breakdown:t}=e,{entities:r}=t;console.log("debugTags",{entities:r});let a=Object.keys(r).reduce((e,t)=>{let{api_key_breakdown:a}=r[t];return Object.keys(a).forEach(r=>{let s={tag:t,usage:a[r].metrics.spend};e[r]?e[r].push(s):e[r]=[s]}),e},{});console.log("debugTags",{tagDictionary:a}),Object.entries(e.breakdown.api_keys||{}).forEach(([e,t])=>{n[e]||(n[e]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{key_alias:t.metadata.key_alias,team_id:t.metadata.team_id||null,tags:a[e]||[]}},console.log("debugTags",{keySpend:n})),n[e].metrics.spend+=t.metrics.spend,n[e].metrics.prompt_tokens+=t.metrics.prompt_tokens,n[e].metrics.completion_tokens+=t.metrics.completion_tokens,n[e].metrics.total_tokens+=t.metrics.total_tokens,n[e].metrics.api_requests+=t.metrics.api_requests,n[e].metrics.successful_requests+=t.metrics.successful_requests,n[e].metrics.failed_requests+=t.metrics.failed_requests,n[e].metrics.cache_read_input_tokens+=t.metrics.cache_read_input_tokens||0,n[e].metrics.cache_creation_input_tokens+=t.metrics.cache_creation_input_tokens||0})}),Object.entries(n).map(([e,t])=>({api_key:e,key_alias:t.metadata.key_alias||"-",tags:t.metadata.tags||"-",spend:t.metrics.spend})).sort((e,t)=>t.spend-e.spend).slice(0,u)),teams:null,showTags:"tag"===t,topKeysLimit:u,setTopKeysLimit:m})]})}),(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"agent"===t?"Top Agents":"Top Models"}),(0,_.jsx)(Aq,{topModels:(l={},w.results.forEach(e=>{Object.entries(e.breakdown.models||{}).forEach(([e,t])=>{l[e]||(l[e]={spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0});try{l[e].spend+=t.metrics.spend}catch(r){console.error(`Error adding spend for ${e}: ${r}, got metrics: ${JSON.stringify(t)}`)}l[e].requests+=t.metrics.api_requests,l[e].successful_requests+=t.metrics.successful_requests,l[e].failed_requests+=t.metrics.failed_requests,l[e].tokens+=t.metrics.total_tokens})}),Object.entries(l).map(([e,t])=>({key:e,...t})).sort((e,t)=>t.spend-e.spend).slice(0,p)),topModelsLimit:p,setTopModelsLimit:h})]})}),"team"===t&&(0,_.jsx)(yl.Col,{numColSpan:2,children:(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Top Agents Driving Spend"}),(0,_.jsx)(Aq,{topModels:(i={},C.results.forEach(e=>{Object.entries(e.breakdown.entities||{}).forEach(([e,t])=>{i[e]||(i[e]={spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0,agent_name:t.metadata?.agent_name||e}),i[e].spend+=t.metrics.spend,i[e].requests+=t.metrics.api_requests,i[e].successful_requests+=t.metrics.successful_requests,i[e].failed_requests+=t.metrics.failed_requests,i[e].tokens+=t.metrics.total_tokens})}),Object.entries(i).map(([e,t])=>({key:t.agent_name,...t})).sort((e,t)=>t.spend-e.spend).slice(0,f)),topModelsLimit:f,setTopModelsLimit:x})]})}),(0,_.jsx)(yl.Col,{numColSpan:2,children:(0,_.jsx)(P.Card,{children:(0,_.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,_.jsx)(X.Title,{children:"Provider Usage"}),(0,_.jsxs)(ee.Grid,{numItems:2,children:[(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsx)(AR,{className:"mt-4 h-40",data:W(),index:"provider",category:"spend",valueFormatter:e=>`$${(0,rV.formatNumberWithCommas)(e,2)}`,colors:["cyan","blue","indigo","violet","purple"]})}),(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsxs)(A.Table,{children:[(0,_.jsx)(Y.TableHead,{children:(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(F.TableHeaderCell,{children:"Provider"}),(0,_.jsx)(F.TableHeaderCell,{children:"Spend"}),(0,_.jsx)(F.TableHeaderCell,{className:"text-green-600",children:"Successful"}),(0,_.jsx)(F.TableHeaderCell,{className:"text-red-600",children:"Failed"}),(0,_.jsx)(F.TableHeaderCell,{children:"Tokens"})]})}),(0,_.jsx)(E.TableBody,{children:W().map(e=>(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(I.TableCell,{children:(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[e.provider&&(0,_.jsx)("img",{src:(0,j$.getProviderLogoAndName)(e.provider).logo,alt:`${e.provider} logo`,className:"w-4 h-4",onError:t=>{let r=t.target,a=r.parentElement;if(a){let t=document.createElement("div");t.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",t.textContent=e.provider?.charAt(0)||"-",a.replaceChild(t,r)}}}),(0,_.jsx)("span",{children:e.provider})]})}),(0,_.jsxs)(I.TableCell,{children:["$",(0,rV.formatNumberWithCommas)(e.spend,2)]}),(0,_.jsx)(I.TableCell,{className:"text-green-600",children:e.successful_requests.toLocaleString()}),(0,_.jsx)(I.TableCell,{className:"text-red-600",children:e.failed_requests.toLocaleString()}),(0,_.jsx)(I.TableCell,{children:e.tokens.toLocaleString()})]},e.provider))})]})})]})]})})})]})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Pj,{modelMetrics:$,hidePromptCachingMetrics:"agent"===t})}),"team"===t?(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Pj,{modelMetrics:U})}):(0,_.jsx)(_.Fragment,{}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Pj,{modelMetrics:q,hidePromptCachingMetrics:"agent"===t})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(PJ,{userSpendData:w})})]})]})]})},AV=({loading:e,isDateChanging:t,providerSpend:r})=>{let[a,s]=(0,T.useState)(!1),[n,l]=(0,T.useState)(!1),i=r.filter(e=>e.provider?.toLowerCase()==="unknown"?n:!!a||e.spend>0);return(0,_.jsxs)(P.Card,{className:"h-full",children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,_.jsx)(X.Title,{children:"Spend by Provider"}),(0,_.jsxs)("div",{className:"flex items-center gap-4",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("label",{className:"text-sm text-gray-700",children:"Show Zero Spend"}),(0,_.jsx)(wL.Switch,{checked:a,onChange:s})]}),(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsxs)("div",{className:"flex items-center gap-1",children:[(0,_.jsx)("label",{className:"text-sm text-gray-700",children:"Show Unknown"}),(0,_.jsx)(tB.Tooltip,{title:"Requests that failed to route to a provider",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"text-gray-400 hover:text-gray-600"})})]}),(0,_.jsx)(wL.Switch,{checked:n,onChange:l})]})]})]}),e?(0,_.jsx)(PI,{isDateChanging:t}):(0,_.jsxs)(ee.Grid,{numItems:2,children:[(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsx)(AR,{className:"mt-4 h-40",data:i,index:"provider",category:"spend",valueFormatter:e=>`$${(0,rV.formatNumberWithCommas)(e,2)}`,colors:["cyan"]})}),(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsxs)(A.Table,{children:[(0,_.jsx)(Y.TableHead,{children:(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(F.TableHeaderCell,{children:"Provider"}),(0,_.jsx)(F.TableHeaderCell,{children:"Spend"}),(0,_.jsx)(F.TableHeaderCell,{className:"text-green-600",children:"Successful"}),(0,_.jsx)(F.TableHeaderCell,{className:"text-red-600",children:"Failed"}),(0,_.jsx)(F.TableHeaderCell,{children:"Tokens"})]})}),(0,_.jsx)(E.TableBody,{children:i.map(e=>(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(I.TableCell,{children:(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[e.provider&&(0,_.jsx)(wY.ProviderLogo,{provider:e.provider,className:"w-4 h-4"}),(0,_.jsx)("span",{children:e.provider})]})}),(0,_.jsxs)(I.TableCell,{children:["$",(0,rV.formatNumberWithCommas)(e.spend,2)]}),(0,_.jsx)(I.TableCell,{className:"text-green-600",children:e.successful_requests.toLocaleString()}),(0,_.jsx)(I.TableCell,{className:"text-red-600",children:e.failed_requests.toLocaleString()}),(0,_.jsx)(I.TableCell,{children:e.tokens.toLocaleString()})]},e.provider))})]})})]})]})};var AG=e.i(918789);let{TextArea:AK}=$.Input,AJ={get_usage_data:"📊",get_team_usage_data:"👥",get_tag_usage_data:"🏷️"},AQ=({step:e})=>{let t=AJ[e.tool_name]||"🔧",r=e.arguments,a=r.start_date&&r.end_date?`${r.start_date} → ${r.end_date}`:"",s=r.team_ids||r.tags||r.user_id||"";return(0,_.jsxs)("div",{className:"flex items-start gap-2 px-3 py-2 rounded-lg bg-gray-100 border border-gray-200 text-xs",children:[(0,_.jsx)("span",{className:"flex-shrink-0 mt-0.5",children:"running"===e.status?(0,_.jsx)(rm.Spin,{size:"small"}):"error"===e.status?(0,_.jsx)("span",{className:"text-red-500",children:"✗"}):(0,_.jsx)("span",{className:"text-green-600",children:"✓"})}),(0,_.jsxs)("div",{className:"min-w-0",children:[(0,_.jsxs)("div",{className:"font-medium text-gray-700",children:[t," ",e.tool_label]}),a&&(0,_.jsx)("div",{className:"text-gray-500 mt-0.5",children:a}),s&&(0,_.jsxs)("div",{className:"text-gray-500 mt-0.5",children:["Filter: ",s]}),"error"===e.status&&e.error&&(0,_.jsx)("div",{className:"text-red-600 mt-0.5",children:e.error})]})]})},AX=({content:e})=>(0,_.jsx)(AG.default,{components:{p:({children:e})=>(0,_.jsx)("p",{className:"mb-2 last:mb-0",children:e}),strong:({children:e})=>(0,_.jsx)("strong",{className:"font-semibold",children:e}),ul:({children:e})=>(0,_.jsx)("ul",{className:"list-disc pl-4 mb-2 space-y-0.5",children:e}),ol:({children:e})=>(0,_.jsx)("ol",{className:"list-decimal pl-4 mb-2 space-y-0.5",children:e}),li:({children:e})=>(0,_.jsx)("li",{children:e}),h1:({children:e})=>(0,_.jsx)("h4",{className:"font-semibold text-sm mt-2 mb-1",children:e}),h2:({children:e})=>(0,_.jsx)("h4",{className:"font-semibold text-sm mt-2 mb-1",children:e}),h3:({children:e})=>(0,_.jsx)("h4",{className:"font-semibold text-sm mt-2 mb-1",children:e}),code:({children:e,className:t})=>t?.includes("language-")?(0,_.jsx)("pre",{className:"bg-gray-100 rounded p-2 my-1 overflow-x-auto text-xs",children:(0,_.jsx)("code",{children:e})}):(0,_.jsx)("code",{className:"px-1 py-0.5 rounded bg-gray-100 text-xs font-mono",children:e}),table:({children:e})=>(0,_.jsx)("div",{className:"overflow-x-auto my-2",children:(0,_.jsx)("table",{className:"text-xs border-collapse w-full",children:e})}),th:({children:e})=>(0,_.jsx)("th",{className:"border border-gray-200 px-2 py-1 bg-gray-50 font-medium text-left",children:e}),td:({children:e})=>(0,_.jsx)("td",{className:"border border-gray-200 px-2 py-1",children:e})},children:e}),AZ=({open:e,onClose:t,accessToken:r})=>{let[a,s]=(0,T.useState)([]),[n,l]=(0,T.useState)(""),[i,o]=(0,T.useState)(!1),[d,c]=(0,T.useState)(void 0),[u,m]=(0,T.useState)([]),[p,h]=(0,T.useState)(!1),[f,x]=(0,T.useState)(""),[g,y]=(0,T.useState)(null),[b,v]=(0,T.useState)([]),j=(0,T.useRef)(null),w=(0,T.useRef)(null);(0,T.useEffect)(()=>{e&&0===u.length&&k()},[e]),(0,T.useEffect)(()=>{"function"==typeof j.current?.scrollIntoView&&j.current.scrollIntoView({behavior:"smooth"})},[a,f,b,g]);let k=async()=>{if(r){h(!0);try{let e=await (0,Q.modelHubCall)(r);if(e?.data?.length>0){let t=e.data.map(e=>e.model_group).sort();m(t)}}catch(e){console.error("Failed to load models:",e)}finally{h(!1)}}},S=async()=>{if(!r||!n.trim()||i)return;let e=[...a,{role:"user",content:n.trim()}];s(e),l(""),o(!0),x(""),y(null),v([]);let t=new AbortController;w.current=t;let c="",u=[];try{await (0,Q.usageAiChatStream)(r,e.slice(-20).map(e=>({role:e.role,content:e.content})),d||"",e=>{y(null),c+=e,x(c)},()=>{y(null),v([]),s(e=>[...e,{role:"assistant",content:c,toolCalls:u.length>0?[...u]:void 0}]),x("")},e=>{y(null),v([]),s(t=>[...t,{role:"assistant",content:`Error: ${e}`}]),x("")},e=>{y(e)},e=>{let t=u.findIndex(t=>t.tool_name===e.tool_name);t>=0?u[t]={...e}:u.push({...e}),v([...u])},t.signal)}catch(r){if(r?.name==="AbortError"||t.signal.aborted)return;let e=r?.message||"Failed to get response. Please try again.";s(t=>[...t,{role:"assistant",content:`Error: ${e}`}]),x("")}finally{o(!1),w.current=null}};return(0,_.jsxs)("div",{"data-testid":"usage-ai-chat-panel",className:`fixed top-0 right-0 h-full bg-white border-l border-gray-200 shadow-2xl z-50 flex flex-col transition-transform duration-300 ease-in-out ${e?"translate-x-0":"translate-x-full"}`,style:{width:420},children:[(0,_.jsxs)("div",{className:"px-5 pt-5 pb-3 border-b border-gray-100 flex-shrink-0",children:[(0,_.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("svg",{className:"w-5 h-5 text-blue-600",viewBox:"0 0 16 16",fill:"currentColor",children:(0,_.jsx)("path",{d:"M8 1l1.5 3.5L13 6l-3.5 1.5L8 11 6.5 7.5 3 6l3.5-1.5L8 1zm4 7l.75 1.75L14.5 10.5l-1.75.75L12 13l-.75-1.75L9.5 10.5l1.75-.75L12 8zM4 9l.75 1.75L6.5 11.5l-1.75.75L4 14l-.75-1.75L1.5 11.5l1.75-.75L4 9z"})}),(0,_.jsx)("h3",{className:"text-base font-semibold text-gray-900",children:"Ask AI"})]}),(0,_.jsx)("button",{onClick:()=>{w.current&&w.current.abort(),t()},className:"text-gray-400 hover:text-gray-600 transition-colors p-1 rounded-md hover:bg-gray-100",children:(0,_.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,_.jsx)("p",{className:"text-xs text-gray-500",children:"Ask about your spend, models, keys, and trends"})]}),(0,_.jsx)("div",{className:"px-5 py-3 border-b border-gray-100 flex-shrink-0",children:(0,_.jsx)(eE.Select,{placeholder:"Select a model (optional, defaults to gpt-4o-mini)",value:d,onChange:e=>c(e),loading:p,showSearch:!0,allowClear:!0,size:"small",className:"w-full",options:u.map(e=>({label:e,value:e})),filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase())})}),(0,_.jsxs)("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 bg-gray-50",children:[0===a.length&&!f&&!i&&(0,_.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-gray-400",children:[(0,_.jsx)("svg",{className:"w-8 h-8 mb-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})}),(0,_.jsx)("p",{className:"text-sm font-medium",children:"Ask a question about your usage"}),(0,_.jsx)("p",{className:"text-xs mt-1",children:'e.g. "Which model costs me the most?"'})]}),a.map((e,t)=>(0,_.jsx)("div",{children:"user"===e.role?(0,_.jsx)("div",{className:"flex justify-end",children:(0,_.jsx)("div",{className:"max-w-[88%] rounded-xl px-3.5 py-2 text-sm leading-relaxed bg-blue-600 text-white",children:e.content})}):(0,_.jsxs)("div",{className:"space-y-2",children:[e.toolCalls&&e.toolCalls.length>0&&(0,_.jsx)("div",{className:"space-y-1.5",children:e.toolCalls.map((e,t)=>(0,_.jsx)(AQ,{step:e},t))}),(0,_.jsx)("div",{className:"max-w-[95%] rounded-xl px-3.5 py-2.5 text-sm leading-relaxed bg-white border border-gray-200 text-gray-800",children:(0,_.jsx)(AX,{content:e.content})})]})},t)),i&&b.length>0&&(0,_.jsx)("div",{className:"space-y-1.5",children:b.map((e,t)=>(0,_.jsx)(AQ,{step:e},t))}),i&&!f&&(0,_.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 text-xs text-gray-500",children:[(0,_.jsx)(rm.Spin,{size:"small"}),(0,_.jsx)("span",{className:"italic",children:g||"Thinking..."})]}),f&&(0,_.jsx)("div",{className:"max-w-[95%] rounded-xl px-3.5 py-2.5 text-sm leading-relaxed bg-white border border-gray-200 text-gray-800",children:(0,_.jsx)(AX,{content:f})}),(0,_.jsx)("div",{ref:j})]}),(0,_.jsxs)("div",{className:"px-4 py-3 border-t border-gray-200 bg-white flex-shrink-0",children:[(0,_.jsxs)("div",{className:"flex gap-2",children:[(0,_.jsx)(AK,{value:n,onChange:e=>l(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),S())},placeholder:"Ask about your usage...",autoSize:{minRows:1,maxRows:3},className:"flex-1",disabled:i}),(0,_.jsx)(z.Button,{type:"primary",onClick:S,disabled:!n.trim()||i,loading:i,children:"Send"})]}),(0,_.jsxs)("div",{className:"flex justify-between items-center mt-2",children:[(0,_.jsx)("button",{onClick:()=>{s([]),x(""),v([]),y(null)},className:"text-xs text-gray-400 hover:text-gray-600 transition-colors",disabled:0===a.length,children:"Clear chat"}),(0,_.jsx)("span",{className:"text-xs text-gray-400",children:"Enter to send"})]})]})]})};var A0=e.i(299251),A1=e.i(153702),A2=e.i(160818),A4=e.i(777579);let A5={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M922.9 701.9H327.4l29.9-60.9 496.8-.9c16.8 0 31.2-12 34.2-28.6l68.8-385.1c1.8-10.1-.9-20.5-7.5-28.4a34.99 34.99 0 00-26.6-12.5l-632-2.1-5.4-25.4c-3.4-16.2-18-28-34.6-28H96.5a35.3 35.3 0 100 70.6h125.9L246 312.8l58.1 281.3-74.8 122.1a34.96 34.96 0 00-3 36.8c6 11.9 18.1 19.4 31.5 19.4h62.8a102.43 102.43 0 00-20.6 61.7c0 56.6 46 102.6 102.6 102.6s102.6-46 102.6-102.6c0-22.3-7.4-44-20.6-61.7h161.1a102.43 102.43 0 00-20.6 61.7c0 56.6 46 102.6 102.6 102.6s102.6-46 102.6-102.6c0-22.3-7.4-44-20.6-61.7H923c19.4 0 35.3-15.8 35.3-35.3a35.42 35.42 0 00-35.4-35.2zM305.7 253l575.8 1.9-56.4 315.8-452.3.8L305.7 253zm96.9 612.7c-17.4 0-31.6-14.2-31.6-31.6 0-17.4 14.2-31.6 31.6-31.6s31.6 14.2 31.6 31.6a31.6 31.6 0 01-31.6 31.6zm325.1 0c-17.4 0-31.6-14.2-31.6-31.6 0-17.4 14.2-31.6 31.6-31.6s31.6 14.2 31.6 31.6a31.6 31.6 0 01-31.6 31.6z"}}]},name:"shopping-cart",theme:"outlined"};var A6=T.forwardRef(function(e,t){return T.createElement(rf.default,(0,rp.default)({},e,{ref:t,icon:A5}))}),A3=e.i(232164),A8=e.i(645526),A7=e.i(771674);let A9=[{value:"global",label:"Global Usage",showForAdmin:"Global Usage",showForNonAdmin:"Your Usage",description:"View usage across all resources",descriptionForAdmin:"View usage across all resources",descriptionForNonAdmin:"View your usage",icon:(0,_.jsx)(A2.GlobalOutlined,{style:{fontSize:"16px"}})},{value:"my-usage",label:"Your Usage",description:"View your own usage",icon:(0,_.jsx)(A7.UserOutlined,{style:{fontSize:"16px"}}),adminOnly:!0},{value:"organization",label:"Organization Usage",showForAdmin:"Organization Usage",showForNonAdmin:"Your Organization Usage",description:"View organization-level usage",descriptionForAdmin:"View usage across all organizations",descriptionForNonAdmin:"View your organization's usage",icon:(0,_.jsx)(A0.BankOutlined,{style:{fontSize:"16px"}})},{value:"team",label:"Team Usage",description:"View usage by team",icon:(0,_.jsx)(A8.TeamOutlined,{style:{fontSize:"16px"}})},{value:"customer",label:"Customer Usage",description:"View usage by customer accounts",icon:(0,_.jsx)(A6,{style:{fontSize:"16px"}}),adminOnly:!0},{value:"tag",label:"Tag Usage",description:"View usage grouped by tags",icon:(0,_.jsx)(A3.TagsOutlined,{style:{fontSize:"16px"}}),adminOnly:!0},{value:"agent",label:"Agent Usage (A2A)",description:"View usage by AI agents",icon:(0,_.jsx)(tV.RobotOutlined,{style:{fontSize:"16px"}}),adminOnly:!0},{value:"user",label:"User Usage",description:"View usage by individual users",icon:(0,_.jsx)(A7.UserOutlined,{style:{fontSize:"16px"}}),adminOnly:!0},{value:"user-agent-activity",label:"User Agent Activity",description:"View detailed user agent activity logs",icon:(0,_.jsx)(A4.LineChartOutlined,{style:{fontSize:"16px"}}),adminOnly:!0}],Ee=({value:e,onChange:t,isAdmin:r,canViewTagUsage:a=!1,title:s="Usage View",description:n="Select the usage data you want to view","data-id":l})=>{let i=A9.filter(e=>"tag"===e.value&&!!a||!e.adminOnly||!!r).map(e=>{let t=e.label,a=e.description;return e.showForAdmin&&e.showForNonAdmin&&(t=r?e.showForAdmin:e.showForNonAdmin),e.descriptionForAdmin&&e.descriptionForNonAdmin&&(a=r?e.descriptionForAdmin:e.descriptionForNonAdmin),{value:e.value,label:t,description:a,icon:e.icon,badgeText:e.badgeText}});return(0,_.jsx)("div",{className:"w-full","data-id":l,children:(0,_.jsxs)("div",{className:"flex flex-wrap items-center justify-start gap-4",children:[(0,_.jsxs)("div",{className:"flex items-stretch gap-2 min-w-0",children:[(0,_.jsx)("div",{className:"flex-shrink-0 flex items-center",children:(0,_.jsx)(A1.BarChartOutlined,{style:{fontSize:"32px"}})}),(0,_.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,_.jsx)("h3",{className:"text-sm font-semibold text-gray-900 mb-0.5 leading-tight",children:s}),(0,_.jsx)("p",{className:"text-xs text-gray-600 leading-tight",children:n})]})]}),(0,_.jsx)("div",{className:"flex-shrink-0",children:(0,_.jsx)(eE.Select,{value:e,onChange:t,className:"w-54 sm:w-64 md:w-72",size:"large",options:i.map(e=>({value:e.value,label:e.label})),optionRender:e=>{let t=i.find(t=>t.value===e.value);return t?(0,_.jsxs)("div",{className:"flex items-center gap-2 py-1",children:[(0,_.jsx)("div",{className:"flex-shrink-0 mt-0.5",children:t.icon}),(0,_.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,_.jsx)("div",{className:"text-sm font-medium text-gray-900",children:t.label}),(0,_.jsx)("div",{className:"text-xs text-gray-600 mt-0.5",children:t.description})]}),t.badgeText&&(0,_.jsx)("div",{className:"items-center",children:(0,_.jsx)(LZ.Badge,{color:"blue",count:t.badgeText})})]}):e.label},labelRender:e=>{let t=i.find(t=>t.value===e.value);return t?(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("div",{children:t.icon}),(0,_.jsx)("span",{className:"text-sm",children:t.label})]}):e.label}})})]})})},Et=({teams:e,organizations:t})=>{let r,{accessToken:a,userRole:s,userId:n,premiumUser:l}=(0,k.default)(),[i,o]=(0,T.useState)(null),[d,c]=(0,T.useState)(!1),[u,m]=(0,T.useState)(!1),[p,h]=(0,T.useState)(!1),f=(0,T.useMemo)(()=>new Date(Date.now()-6048e5),[]),x=(0,T.useMemo)(()=>new Date,[]),[g,y]=(0,T.useState)({from:f,to:x}),[b,v]=(0,T.useState)([]),{data:j=[]}=(()=>{let{accessToken:e,userRole:t}=(0,k.default)();return(0,ev.useQuery)({queryKey:DB.list({}),queryFn:async()=>await (0,Q.allEndUsersCall)(e),enabled:!!e&&ts.all_admin_roles.includes(t)})})(),{data:w}=DR(),{data:S}=(0,Dz.useCurrentUser)();console.log(`currentUser: ${JSON.stringify(S)}`),console.log(`currentUser max budget: ${S?.max_budget}`);let N=ts.all_admin_roles.includes(s||""),M=N||ts.internalUserRoles.includes(s||""),[C,L]=(0,T.useState)(""),[O,D]=(0,Dj.useDebouncedState)("",{wait:300}),{data:A,fetchNextPage:E,hasNextPage:I,isFetchingNextPage:Y,isLoading:F}=((e=Dq,t)=>{let{accessToken:r,userRole:a}=(0,k.default)();return(0,DH.useInfiniteQuery)({queryKey:D$.list({filters:{pageSize:e,...t&&{searchEmail:t}}}),queryFn:async({pageParam:a})=>await (0,Q.userListCall)(r,null,a,e,t||null),initialPageParam:1,getNextPageParam:e=>{if(e.page{if(!A?.pages)return[];let e=new Set,t=[];for(let r of A.pages)for(let a of r.users)e.has(a.user_id)||(e.add(a.user_id),t.push({value:a.user_id,label:a.user_alias?`${a.user_alias} (${a.user_id})`:a.user_email?`${a.user_email} (${a.user_id})`:a.user_id}));return t},[A]),[H,$]=(0,T.useState)(N?null:n||null),[q,U]=(0,T.useState)("groups"),[W,G]=(0,T.useState)(!1),[K,J]=(0,T.useState)(!1),[et,er]=(0,T.useState)(!1),[ea,es]=(0,T.useState)("global"),[en,el]=(0,T.useState)(!0),[ei,eo]=(0,T.useState)(5),[ed,ec]=(0,T.useState)(5),[eu,em]=(0,T.useState)(!1);(0,T.useEffect)(()=>{!N&&n&&$(n)},[N,n]);let ep="my-usage"!==ea&&N?H:n||null,eh=(0,T.useMemo)(()=>g.from?new Date(g.from):null,[g.from]),ef=(0,T.useMemo)(()=>g.to?new Date(g.to):null,[g.to]);(0,T.useEffect)(()=>{if(!a)return;let e=!1;return(async()=>{try{let t=await (0,Q.tagListCall)(a,eh,ef);if(e)return;v(Object.values(t).map(e=>({label:e.name,value:e.name})))}catch(t){e||console.error("Failed to fetch tag list",t)}})(),()=>{e=!0}},[a,eh,ef]);let ex=(0,T.useRef)(0);(0,T.useEffect)(()=>{if(!a||!eh||!ef)return;let e=++ex.current;m(!0),c(!1),o(null),(0,Q.userDailyActivityAggregatedCall)(a,eh,ef,ep).then(t=>{ex.current===e&&(o(t),m(!1),h(!1))}).catch(()=>{ex.current===e&&(c(!0),m(!1))})},[a,eh,ef,ep]);let eg=P$({fetchFn:Q.userDailyActivityCall,args:[a,eh,ef,ep],enabled:d&&!!a&&!!eh&&!!ef}),ey=(0,T.useMemo)(()=>i||(d?eg.data:{results:[],metadata:{}}),[i,d,eg.data]),e_=u||eg.loading;(0,T.useEffect)(()=>{d&&!eg.loading&&eg.data.results.length>0&&h(!1)},[d,eg.loading,eg.data.results.length]);let eb=(0,T.useCallback)(e=>{h(!0),y(e)},[]),ej=ey.metadata?.total_spend||0,ew=(0,T.useMemo)(()=>{let e={};return ey.results.forEach(t=>{Object.entries(t.breakdown.models||{}).forEach(([t,r])=>{e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=r.metrics.spend,e[t].metrics.prompt_tokens+=r.metrics.prompt_tokens,e[t].metrics.completion_tokens+=r.metrics.completion_tokens,e[t].metrics.total_tokens+=r.metrics.total_tokens,e[t].metrics.api_requests+=r.metrics.api_requests,e[t].metrics.successful_requests+=r.metrics.successful_requests||0,e[t].metrics.failed_requests+=r.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=r.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=r.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(([e,t])=>({key:e,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens})).sort((e,t)=>t.spend-e.spend).slice(0,ed)},[ey.results,ed]),ek=(0,T.useMemo)(()=>{let e={};return ey.results.forEach(t=>{Object.entries(t.breakdown.model_groups||{}).forEach(([t,r])=>{e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=r.metrics.spend,e[t].metrics.prompt_tokens+=r.metrics.prompt_tokens,e[t].metrics.completion_tokens+=r.metrics.completion_tokens,e[t].metrics.total_tokens+=r.metrics.total_tokens,e[t].metrics.api_requests+=r.metrics.api_requests,e[t].metrics.successful_requests+=r.metrics.successful_requests||0,e[t].metrics.failed_requests+=r.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=r.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=r.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(([e,t])=>({key:e,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens})).sort((e,t)=>t.spend-e.spend).slice(0,ed)},[ey.results,ed]),eS=(0,T.useMemo)(()=>{let e={};return ey.results.forEach(t=>{Object.entries(t.breakdown.providers||{}).forEach(([t,r])=>{e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=r.metrics.spend,e[t].metrics.prompt_tokens+=r.metrics.prompt_tokens,e[t].metrics.completion_tokens+=r.metrics.completion_tokens,e[t].metrics.total_tokens+=r.metrics.total_tokens,e[t].metrics.api_requests+=r.metrics.api_requests,e[t].metrics.successful_requests+=r.metrics.successful_requests||0,e[t].metrics.failed_requests+=r.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=r.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=r.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(([e,t])=>({provider:e,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}))},[ey.results]),eN=(0,T.useMemo)(()=>{let e={};return ey.results.forEach(t=>{Object.entries(t.breakdown.api_keys||{}).forEach(([t,r])=>{e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{key_alias:r.metadata.key_alias,team_id:null,tags:r.metadata.tags||[]}}),e[t].metrics.spend+=r.metrics.spend,e[t].metrics.prompt_tokens+=r.metrics.prompt_tokens,e[t].metrics.completion_tokens+=r.metrics.completion_tokens,e[t].metrics.total_tokens+=r.metrics.total_tokens,e[t].metrics.api_requests+=r.metrics.api_requests,e[t].metrics.successful_requests+=r.metrics.successful_requests,e[t].metrics.failed_requests+=r.metrics.failed_requests,e[t].metrics.cache_read_input_tokens+=r.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=r.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(([e,t])=>({api_key:e,key_alias:t.metadata.key_alias||"-",tags:t.metadata.tags||[],spend:t.metrics.spend})).sort((e,t)=>t.spend-e.spend).slice(0,ei)},[ey.results,ei]),eT=(0,T.useMemo)(()=>[...ey.results].sort((e,t)=>new Date(e.date).getTime()-new Date(t.date).getTime()),[ey.results]),eM=(0,T.useMemo)(()=>Pw(ey,"models",e),[ey,e]),eC=(0,T.useMemo)(()=>Pw(ey,"api_keys",e),[ey,e]),eL=(0,T.useMemo)(()=>Pw(ey,"mcp_servers",e),[ey,e]);return(0,_.jsxs)("div",{style:{width:"100%"},className:"p-8 relative",children:[(0,_.jsx)("div",{className:"flex items-end justify-between gap-6 mb-6",children:(0,_.jsxs)("div",{className:"flex-1",children:[(0,_.jsxs)("div",{className:"flex items-end justify-between gap-6 mb-4 w-full",children:[(0,_.jsx)(Ee,{value:ea,onChange:e=>es(e),isAdmin:N,canViewTagUsage:M}),(0,_.jsx)(ko,{value:g,onValueChange:eb})]}),eg.isFetchingMore&&(0,_.jsx)(B.Alert,{banner:!0,type:"warning",className:"mb-2",message:(0,_.jsxs)("div",{className:"flex items-center justify-between",children:[(0,_.jsxs)("span",{children:[(0,_.jsx)(wo.LoadingOutlined,{spin:!0,className:"mr-2"}),"Currently fetching spend data: fetched ",eg.progress.currentPage," /"," ",eg.progress.totalPages," pages. Charts will update periodically as data loads. Moving off of this page will stop and reset this. To continue using the UI in the meantime,"," ",(0,_.jsxs)("a",{href:window.location.href,target:"_blank",rel:"noopener noreferrer",children:["open a new tab ",(0,_.jsx)(MD.ExportOutlined,{})]}),"."]}),(0,_.jsx)(z.Button,{type:"primary",danger:!0,onClick:eg.cancel,children:"Stop"})]})}),eg.cancelled&&(0,_.jsx)(B.Alert,{banner:!0,type:"info",className:"mb-2",message:(0,_.jsxs)("span",{children:["Showing partial data (",eg.progress.currentPage,"/",eg.progress.totalPages," ","pages loaded)"]})}),("global"===ea||"my-usage"===ea)&&(0,_.jsxs)(_.Fragment,{children:[N&&"global"===ea&&(0,_.jsxs)("div",{className:"mb-4",children:[(0,_.jsx)(Z.Text,{className:"mb-2",children:"Filter by user"}),(0,_.jsx)(eE.Select,{showSearch:!0,allowClear:!0,style:{width:"100%"},placeholder:"Select user to filter...",value:H,onChange:e=>$(e??null),filterOption:!1,onSearch:e=>{L(e),D(e)},searchValue:C,onPopupScroll:e=>{let t=e.currentTarget;(t.scrollTop+t.clientHeight)/t.scrollHeight>=.8&&I&&!Y&&E()},loading:F,notFoundContent:F?(0,_.jsx)(wo.LoadingOutlined,{spin:!0}):"No users found",options:R,popupRender:e=>(0,_.jsxs)(_.Fragment,{children:[e,Y&&(0,_.jsx)("div",{style:{textAlign:"center",padding:8},children:(0,_.jsx)(wo.LoadingOutlined,{spin:!0})})]})})]}),(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center",children:[(0,_.jsxs)(rR.TabList,{variant:"solid",className:"mt-1",children:[(0,_.jsx)(rY.Tab,{children:"Cost"}),(0,_.jsx)(rY.Tab,{children:"Model Activity"}),(0,_.jsx)(rY.Tab,{children:"Key Activity"}),(0,_.jsx)(rY.Tab,{children:"MCP Server Activity"}),(0,_.jsx)(rY.Tab,{children:"Endpoint Activity"})]}),(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(z.Button,{onClick:()=>er(!0),icon:(0,_.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"currentColor",children:(0,_.jsx)("path",{d:"M8 1l1.5 3.5L13 6l-3.5 1.5L8 11 6.5 7.5 3 6l3.5-1.5L8 1zm4 7l.75 1.75L14.5 10.5l-1.75.75L12 13l-.75-1.75L9.5 10.5l1.75-.75L12 8zM4 9l.75 1.75L6.5 11.5l-1.75.75L4 14l-.75-1.75L1.5 11.5l1.75-.75L4 9z"})}),children:"Ask AI"}),(0,_.jsx)(z.Button,{onClick:()=>J(!0),icon:(0,_.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),children:"Export Data"})]})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(ee.Grid,{numItems:2,className:"gap-2 w-full",children:[(0,_.jsxs)(yl.Col,{numColSpan:2,children:[(0,_.jsx)("div",{className:"flex items-center gap-4 mt-2 mb-2",children:(0,_.jsxs)(Z.Text,{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content text-lg",children:["Project Spend"," ",g.from&&g.to&&(0,_.jsxs)(_.Fragment,{children:[g.from.toLocaleDateString("en-US",{month:"short",day:"numeric",year:g.from.getFullYear()!==g.to.getFullYear()?"numeric":void 0})," - ",g.to.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]})]})}),(0,_.jsx)(PB,{userSpend:ej,selectedTeam:null,userMaxBudget:S?.max_budget||null})]}),(0,_.jsx)(yl.Col,{numColSpan:2,children:(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Usage Metrics"}),(0,_.jsxs)(ee.Grid,{numItems:5,className:"gap-4 mt-4",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Total Requests"}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2",children:ey.metadata?.total_api_requests?.toLocaleString()||0})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Successful Requests"}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2 text-green-600",children:ey.metadata?.total_successful_requests?.toLocaleString()||0})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(X.Title,{children:"Failed Requests"}),(0,_.jsx)(tB.Tooltip,{title:"Includes requests that failed to route to a provider, tool usage failures, and other request errors where the provider cannot be determined.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"text-gray-400 hover:text-gray-600"})})]}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2 text-red-600",children:ey.metadata?.total_failed_requests?.toLocaleString()||0})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Average Cost per Request"}),(0,_.jsxs)(Z.Text,{className:"text-2xl font-bold mt-2",children:["$",(0,rV.formatNumberWithCommas)((ej||0)/(ey.metadata?.total_api_requests||1),4)]})]}),(0,_.jsxs)(P.Card,{className:"cursor-pointer hover:bg-gray-50 transition-colors",onClick:()=>em(!eu),children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(X.Title,{children:"Total Tokens"}),eu?(0,_.jsx)(wd.DownOutlined,{className:"text-gray-400 text-xs"}):(0,_.jsx)(wc.RightOutlined,{className:"text-gray-400 text-xs"})]}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2",children:ey.metadata?.total_tokens?.toLocaleString()||0})]})]}),eu&&(0,_.jsxs)(ee.Grid,{numItems:4,className:"gap-4 mt-4",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Input Tokens"}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2 text-blue-600",children:(ey.metadata?.total_prompt_tokens||0).toLocaleString()})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Output Tokens"}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2 text-cyan-600",children:ey.metadata?.total_completion_tokens?.toLocaleString()||0})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Cache Read Tokens"}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2 text-green-600",children:ey.metadata?.total_cache_read_input_tokens?.toLocaleString()||0})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Cache Write Tokens"}),(0,_.jsx)(Z.Text,{className:"text-2xl font-bold mt-2 text-purple-600",children:ey.metadata?.total_cache_creation_input_tokens?.toLocaleString()||0})]})]})]})}),(0,_.jsx)(yl.Col,{numColSpan:2,children:(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Daily Spend"}),e_?(0,_.jsx)(PI,{isDateChanging:p}):(0,_.jsx)(yn,{data:eT,index:"date",categories:["metrics.spend"],colors:["cyan"],valueFormatter:Pb,yAxisWidth:100,showLegend:!1,customTooltip:({payload:e,active:t})=>{if(!t||!e?.[0])return null;let r=e[0].payload;return(0,_.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,_.jsx)("p",{className:"font-bold",children:r.date}),(0,_.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",(0,rV.formatNumberWithCommas)(r.metrics.spend,2)]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Requests: ",r.metrics.api_requests]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Successful: ",r.metrics.successful_requests]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Failed: ",r.metrics.failed_requests]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",r.metrics.total_tokens]})]})}})]})}),(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsxs)(P.Card,{className:"h-full",children:[(0,_.jsx)(X.Title,{children:"Top Virtual Keys"}),(0,_.jsx)(A$,{topKeys:eN,teams:null,topKeysLimit:ei,setTopKeysLimit:eo})]})}),(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsxs)(P.Card,{className:"h-full",children:[(0,_.jsx)(X.Title,{children:"groups"===q?"Top Public Model Names":"Top Litellm Models"}),(0,_.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,_.jsx)(DY,{options:[{label:"5",value:5},{label:"10",value:10},{label:"25",value:25},{label:"50",value:50}],value:ed,onChange:e=>ec(e)}),(0,_.jsxs)("div",{className:"flex bg-gray-100 rounded-lg p-1",children:[(0,_.jsx)("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${"groups"===q?"bg-white shadow-sm text-gray-900":"text-gray-600 hover:text-gray-900"}`,onClick:()=>U("groups"),children:"Public Model Name"}),(0,_.jsx)("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${"individual"===q?"bg-white shadow-sm text-gray-900":"text-gray-600 hover:text-gray-900"}`,onClick:()=>U("individual"),children:"Litellm Model Name"})]})]}),e_?(0,_.jsx)(PI,{isDateChanging:p}):(0,_.jsx)("div",{className:"relative max-h-[600px] overflow-y-auto",children:(r="groups"===q?ek:ew,(0,_.jsx)(yn,{className:"mt-4",style:{height:52*Math.min(r.length,ed)},data:r,index:"key",categories:["spend"],colors:["cyan"],valueFormatter:Pb,layout:"vertical",yAxisWidth:200,showLegend:!1,customTooltip:({payload:e,active:t})=>{if(!t||!e?.[0])return null;let r=e[0].payload;return(0,_.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,_.jsx)("p",{className:"font-bold",children:r.key}),(0,_.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",(0,rV.formatNumberWithCommas)(r.spend,2)]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Total Requests: ",r.requests.toLocaleString()]}),(0,_.jsxs)("p",{className:"text-green-600",children:["Successful: ",r.successful_requests.toLocaleString()]}),(0,_.jsxs)("p",{className:"text-red-600",children:["Failed: ",r.failed_requests.toLocaleString()]}),(0,_.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",r.tokens.toLocaleString()]})]})}}))})]})}),(0,_.jsx)(yl.Col,{numColSpan:2,children:(0,_.jsx)(AV,{loading:e_,isDateChanging:p,providerSpend:eS})})]})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Pj,{modelMetrics:eM})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Pj,{modelMetrics:eC})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Pj,{modelMetrics:eL})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(PJ,{userSpendData:ey})})]})]})]}),"organization"===ea&&(0,_.jsx)(AW,{accessToken:a,entityType:"organization",userID:n,userRole:s,dateValue:g,entityList:t?.map(e=>({label:e.organization_alias,value:e.organization_id}))||null,premiumUser:l}),"team"===ea&&(0,_.jsx)(AW,{accessToken:a,entityType:"team",userID:n,userRole:s,entityList:e?.map(e=>({label:e.team_alias,value:e.team_id}))||null,premiumUser:l,dateValue:g}),"customer"===ea&&(0,_.jsx)(AW,{accessToken:a,entityType:"customer",userID:n,userRole:s,entityList:j?.map(e=>({label:e.alias||e.user_id,value:e.user_id}))||null,premiumUser:l,dateValue:g}),"tag"===ea&&(0,_.jsxs)(_.Fragment,{children:[en&&(0,_.jsx)(B.Alert,{banner:!0,type:"info",message:"Reusable credentials are automatically tracked as tags",description:(0,_.jsxs)(V.Typography.Text,{children:["When a reusable credential is used, it will appear as a tag prefixed with"," ",(0,_.jsx)(V.Typography.Text,{code:!0,children:"Credential: "}),"in this view."]}),closable:!0,onClose:()=>el(!1),className:"mb-5"}),(0,_.jsx)(AW,{accessToken:a,entityType:"tag",userID:n,userRole:s,entityList:b,premiumUser:l,dateValue:g})]}),"agent"===ea&&(0,_.jsx)(AW,{accessToken:a,entityType:"agent",userID:n,userRole:s,entityList:w?.agents?.map(e=>({label:e.agent_name,value:e.agent_id}))||null,premiumUser:l,dateValue:g}),"user"===ea&&(0,_.jsx)(AW,{accessToken:a,entityType:"user",userID:n,userRole:s,entityList:R.length>0?R:null,premiumUser:l,dateValue:g}),"user-agent-activity"===ea&&(0,_.jsx)(PR,{accessToken:a,userRole:s,dateValue:g})]})}),(0,_.jsx)(Pk,{isOpen:W,onClose:()=>G(!1),accessToken:a}),(0,_.jsx)(PP,{isOpen:K,onClose:()=>J(!1),entityType:"team",spendData:{results:ey.results,metadata:ey.metadata},dateRange:g,selectedFilters:[],customTitle:"Export Usage Data"}),(0,_.jsx)(AZ,{open:et,onClose:()=>er(!1),accessToken:a})]})};var Er=e.i(109799);let Ea=({accessToken:e,userID:t})=>{let[r,a]=(0,T.useState)([]);(0,T.useEffect)(()=>{(async()=>{if(e&&t)try{let t=await (0,Q.availableTeamListCall)(e);a(t)}catch(e){console.error("Error fetching available teams:",e)}})()},[e,t]);let s=async r=>{if(e&&t)try{await (0,Q.teamMemberAddCall)(e,r,{user_id:t,role:"user"}),J.default.success("Successfully joined team"),a(e=>e.filter(e=>e.team_id!==r))}catch(e){console.error("Error joining team:",e),J.default.fromBackend("Failed to join team")}};return(0,_.jsx)(P.Card,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,_.jsxs)(A.Table,{children:[(0,_.jsx)(Y.TableHead,{children:(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(F.TableHeaderCell,{children:"Team Name"}),(0,_.jsx)(F.TableHeaderCell,{children:"Description"}),(0,_.jsx)(F.TableHeaderCell,{children:"Members"}),(0,_.jsx)(F.TableHeaderCell,{children:"Models"}),(0,_.jsx)(F.TableHeaderCell,{children:"Actions"})]})}),(0,_.jsxs)(E.TableBody,{children:[r.map(e=>(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(I.TableCell,{children:(0,_.jsx)(Z.Text,{children:e.team_alias})}),(0,_.jsx)(I.TableCell,{children:(0,_.jsx)(Z.Text,{children:e.description||"No description available"})}),(0,_.jsx)(I.TableCell,{children:(0,_.jsxs)(Z.Text,{children:[e.members_with_roles.length," members"]})}),(0,_.jsx)(I.TableCell,{children:(0,_.jsx)("div",{className:"flex flex-col",children:e.models&&0!==e.models.length?e.models.map((e,t)=>(0,_.jsx)(tR.Badge,{size:"xs",className:"mb-1",color:"blue",children:(0,_.jsx)(Z.Text,{children:e.length>30?`${e.slice(0,30)}...`:e})},t)):(0,_.jsx)(tR.Badge,{size:"xs",color:"red",children:(0,_.jsx)(Z.Text,{children:"All Proxy Models"})})})}),(0,_.jsx)(I.TableCell,{children:(0,_.jsx)(S.Button,{size:"xs",variant:"secondary",onClick:()=>s(e.team_id),children:"Join Team"})})]},e.team_id)),0===r.length&&(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:5,className:"text-center",children:(0,_.jsxs)(Z.Text,{children:["No available teams to join. See how to set available teams"," ",(0,_.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/self_serve#all-settings-for-self-serve--sso-flow",target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:text-blue-700 underline",children:"here"}),"."]})})})]})]})})};var Es=e.i(56567),En=e.i(860585),El=e.i(162386);let{Title:Ei,Text:Eo}=V.Typography,Ed=["/key/generate","/key/update","/key/delete","/key/regenerate","/key/service-account/generate","/key/{key_id}/regenerate","/key/block","/key/unblock","/key/bulk_update","/key/{key_id}/reset_spend","/key/info","/key/list","/key/aliases","/team/daily/activity"],Ec=({label:e,description:t,isEditing:r,viewContent:a,editContent:s})=>(0,_.jsxs)(wl.Row,{className:"py-5 border-b border-gray-100 last:border-0",children:[(0,_.jsxs)(wi.Col,{span:8,className:"pr-6",children:[(0,_.jsx)("div",{className:"text-sm font-semibold text-gray-900",children:e}),(0,_.jsx)("div",{className:"text-xs text-gray-500 mt-1 leading-relaxed",children:t})]}),(0,_.jsx)(wi.Col,{span:16,className:"flex items-center",children:(0,_.jsx)("div",{className:"w-full",children:r?s:a})})]}),Eu=()=>(0,_.jsx)(Eo,{className:"text-gray-400 italic",children:"Not set"}),Em=(e,t)=>e&&0!==e.length?(0,_.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map(e=>(0,_.jsx)(eN.Tag,{color:"blue",children:t?t(e):e},e))}):(0,_.jsx)(Eu,{}),Ep={max_budget:null,budget_duration:null,tpm_limit:null,rpm_limit:null,models:[],team_member_permissions:[]},Eh=({accessToken:e})=>{let[t,r]=(0,T.useState)(!0),[a,s]=(0,T.useState)(Ep),[n,l]=(0,T.useState)(!1),[i,o]=(0,T.useState)(Ep),[d,c]=(0,T.useState)(!1),[u,m]=(0,T.useState)(!1);(0,T.useEffect)(()=>{(async()=>{if(!e)return r(!1);try{let t=await (0,Q.getDefaultTeamSettings)(e),r={...Ep,...t.values||{}};s(r),o(r)}catch(e){console.error("Error fetching team SSO settings:",e),m(!0),J.default.fromBackend("Failed to fetch team settings")}finally{r(!1)}})()},[e]);let p=async()=>{if(e){c(!0);try{let t=await (0,Q.updateDefaultTeamSettings)(e,i),r={...Ep,...t.settings||{}};s(r),o(r),l(!1),J.default.success("Default team settings updated successfully")}catch(e){console.error("Error updating team settings:",e),J.default.fromBackend("Failed to update team settings")}finally{c(!1)}}},h=(e,t)=>{o(r=>({...r,[e]:t}))};return t?(0,_.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,_.jsx)(rm.Spin,{size:"large"})}):u?(0,_.jsx)(eg.Card,{children:(0,_.jsx)(Eo,{children:"No team settings available or you do not have permission to view them."})}):(0,_.jsxs)(eg.Card,{styles:{body:{padding:32}},children:[(0,_.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Ei,{level:3,className:"m-0 text-gray-900",children:"Default Team Settings"}),(0,_.jsx)(Eo,{className:"text-gray-500 mt-1 block",children:"These settings will be applied by default when creating new teams."})]}),(0,_.jsx)("div",{children:n?(0,_.jsxs)("div",{className:"flex gap-3",children:[(0,_.jsx)(z.Button,{onClick:()=>{l(!1),o(a)},disabled:d,children:"Cancel"}),(0,_.jsx)(z.Button,{type:"primary",onClick:p,loading:d,icon:(0,_.jsx)(MC.SaveOutlined,{}),children:"Save Changes"})]}):(0,_.jsx)(z.Button,{onClick:()=>l(!0),icon:(0,_.jsx)(wX.EditOutlined,{}),children:"Edit Settings"})})]}),(0,_.jsxs)("div",{className:"mt-8",children:[(0,_.jsxs)("div",{className:"mb-8",children:[(0,_.jsx)("div",{className:"text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:"Budget & Rate Limits"}),(0,_.jsxs)("div",{className:"border-t border-gray-100",children:[(0,_.jsx)(Ec,{label:"Max Budget",description:"Maximum budget (in USD) for new automatically created teams.",isEditing:n,viewContent:null!=a.max_budget?(0,_.jsxs)(Eo,{children:["$",Number(a.max_budget).toLocaleString()]}):(0,_.jsx)(Eu,{}),editContent:(0,_.jsx)(tq.InputNumber,{className:"w-full",style:{maxWidth:320},value:i.max_budget,onChange:e=>h("max_budget",e),placeholder:"Not set",prefix:"$",min:0})}),(0,_.jsx)(Ec,{label:"Budget Duration",description:"How frequently the team's budget resets.",isEditing:n,viewContent:a.budget_duration?(0,_.jsx)(Eo,{children:(0,En.getBudgetDurationLabel)(a.budget_duration)}):(0,_.jsx)(Eu,{}),editContent:(0,_.jsx)(En.default,{value:i.budget_duration||null,onChange:e=>h("budget_duration",e),style:{maxWidth:320}})}),(0,_.jsx)(Ec,{label:"TPM Limit",description:"Maximum tokens per minute allowed across all models.",isEditing:n,viewContent:null!=a.tpm_limit?(0,_.jsx)(Eo,{children:a.tpm_limit.toLocaleString()}):(0,_.jsx)(Eu,{}),editContent:(0,_.jsx)(tq.InputNumber,{className:"w-full",style:{maxWidth:320},value:i.tpm_limit,onChange:e=>h("tpm_limit",e),placeholder:"Not set",min:0})}),(0,_.jsx)(Ec,{label:"RPM Limit",description:"Maximum requests per minute allowed across all models.",isEditing:n,viewContent:null!=a.rpm_limit?(0,_.jsx)(Eo,{children:a.rpm_limit.toLocaleString()}):(0,_.jsx)(Eu,{}),editContent:(0,_.jsx)(tq.InputNumber,{className:"w-full",style:{maxWidth:320},value:i.rpm_limit,onChange:e=>h("rpm_limit",e),placeholder:"Not set",min:0})})]})]}),(0,_.jsxs)("div",{className:"mb-8",children:[(0,_.jsx)("div",{className:"text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:"Access & Permissions"}),(0,_.jsxs)("div",{className:"border-t border-gray-100",children:[(0,_.jsx)(Ec,{label:"Models",description:"Default list of models that new teams can access.",isEditing:n,viewContent:Em(a.models,tQ.getModelDisplayName),editContent:(0,_.jsx)(El.ModelSelect,{value:i.models||[],onChange:e=>h("models",e),context:"global",style:{width:"100%"},options:{includeSpecialOptions:!0}})}),(0,_.jsx)(Ec,{label:"Team Member Permissions",description:"Default permissions granted to members of newly created teams. /key/info and /key/health are always included.",isEditing:n,viewContent:Em(a.team_member_permissions),editContent:(0,_.jsx)(eE.Select,{mode:"multiple",style:{width:"100%"},value:i.team_member_permissions||[],onChange:e=>h("team_member_permissions",e),placeholder:"Select permissions",tagRender:({label:e,closable:t,onClose:r})=>(0,_.jsx)(eN.Tag,{color:"blue",closable:t,onClose:r,className:"mr-1 mt-1 mb-1",children:e}),children:Ed.map(e=>(0,_.jsx)(eE.Select.Option,{value:e,children:e},e))})})]})]})]})]})};var Ef=e.i(372943),Ex=MV,PG=PG,Eg=e.i(368869);let Ey=(0,eT.default)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);var Cl=Cl,E_=e.i(98740),E_=E_;function Eb({size:e,fontSize:t}){let r=(0,_.jsx)(wo.LoadingOutlined,{style:t?{fontSize:t}:void 0,spin:!0});return(0,_.jsx)(rm.Spin,{indicator:r,size:e})}var Ev=e.i(363256),Ej=e.i(9314),Ew=e.i(844565),Ek=e.i(552130),ES=e.i(533882),EN=e.i(651904),ET=e.i(460285),EM=e.i(916940),EC=e.i(471145);let EL=(e,t,r)=>"Admin"===e||!!r&&!!t&&r.some(e=>e.members?.some(e=>e.user_id===t&&"org_admin"===e.user_role)),EO=(e,t,r)=>"Admin"===e?r||[]:r&&t?r.filter(e=>e.members?.some(e=>e.user_id===t&&"org_admin"===e.user_role)):[],ED=({teams:e,searchParams:t,accessToken:r,setTeams:a,userID:s,userRole:n,organizations:l,premiumUser:i=!1})=>{let o,d,c,u,m;console.log(`organizations: ${JSON.stringify(l)}`);let{data:p}=(0,Er.useOrganizations)(),[h,f]=(0,T.useState)(!0),[x,g]=(0,T.useState)(null),[y,b]=(0,T.useState)(1),[v,j]=(0,T.useState)(10),[w,k]=(0,T.useState)(0),[S,N]=(0,T.useState)(null),[M,C]=(0,T.useState)(null),[L,O]=(0,T.useState)({search:"",organization_id:"",sort_by:"created_at",sort_order:"desc"}),D=(0,T.useRef)(null),[P,A]=(0,T.useState)(!1),E=async(e={})=>{if(!r)return;let t=e.page??y,l=e.size??v,i=e.sortBy??L.sort_by,o=e.sortOrder??L.sort_order,d=e.organizationID??L.organization_id,c=e.search??L.search;f(!0),g(null);try{let e=await (0,jY.teamListCall)(r,t,l,{organizationID:d||null,search:c||null,userID:"Admin"!==n&&"Admin Viewer"!==n?s:null,sortBy:i||null,sortOrder:o||null});a(e.teams??[]),k(e.total??0)}catch(e){g(e?.message||"Failed to fetch teams")}finally{f(!1)}};(0,T.useEffect)(()=>{E()},[r]);let[I]=H.Form.useForm(),[Y]=H.Form.useForm(),[F,R]=(0,T.useState)(""),[B,G]=(0,T.useState)(!1),[K,X]=(0,T.useState)(null),[Z,ee]=(0,T.useState)(null),[er,ea]=(0,T.useState)(!1),[es,en]=(0,T.useState)(!1),[el,ei]=(0,T.useState)(!1),[eo,ed]=(0,T.useState)(!1),[ec,eu]=(0,T.useState)([]),[em,ep]=(0,T.useState)(!1),[eh,ef]=(0,T.useState)(null),[ex,ey]=(0,T.useState)([]),[eb,ev]=(0,T.useState)({}),[ej,ew]=(0,T.useState)(!1),[ek,eS]=(0,T.useState)([]),[eT,eM]=(0,T.useState)([]),[eC,eL]=(0,T.useState)([]),[eO,eD]=(0,T.useState)([]),[eP,eA]=(0,T.useState)(!1),[eI,eY]=(0,T.useState)({}),[eF,eR]=(0,T.useState)(null),[eB,ez]=(0,T.useState)(0);(0,T.useEffect)(()=>{let e;console.log(`currentOrgForCreateTeam: ${M}`);let t=(e=[],M&&M.models.length>0?(console.log(`organization.models: ${M.models}`),e=M.models):e=ec,(0,tQ.unfurlWildcardModelsInList)(e,ec));console.log(`models: ${t}`),ey(t),I.setFieldValue("models",[])},[M,ec]),(0,T.useEffect)(()=>{if(es){let e=EO(n,s,l);if(1===e.length){let t=e[0];I.setFieldValue("organization_id",t.organization_id),C(t)}else I.setFieldValue("organization_id",S?.organization_id||null),C(S)}},[es,n,s,l,S]),(0,T.useEffect)(()=>{let e=async()=>{try{if(null==r)return;let e=(await (0,Q.getPoliciesList)(r)).policies.map(e=>e.policy_name);eM(e)}catch(e){console.error("Failed to fetch policies:",e)}};(async()=>{try{if(null==r)return;let e=(await (0,Q.getGuardrailsList)(r)).guardrails.map(e=>e.guardrail_name);eS(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})(),e()},[r]);let e$=async()=>{try{if(null==r)return;let e=await (0,Q.fetchMCPAccessGroups)(r);eD(e)}catch(e){console.error("Failed to fetch MCP access groups:",e)}};(0,T.useEffect)(()=>{e$()},[r]),(0,T.useEffect)(()=>{e&&ev(e.reduce((e,t)=>(e[t.team_id]={keys:t.keys||[],keys_count:t.keys_count??t.keys?.length??0,team_info:{members_with_roles:t.members_with_roles||[]}},e),{}))},[e]);let eq=async e=>{ef(e),ep(!0)},eU=async()=>{if(null!=eh&&null!=e&&null!=r)try{ew(!0),await (0,Q.teamDeleteCall)(r,eh.team_id),await E(),J.default.success("Team deleted successfully")}catch(e){J.default.fromBackend("Error deleting the team: "+e)}finally{ew(!1),ep(!1),ef(null)}};(0,T.useEffect)(()=>{(async()=>{try{if(null===s||null===n||null===r)return;let e=await (0,tQ.fetchAvailableModelsForTeamOrKey)(s,n,r);e&&eu(e)}catch(e){console.error("Error fetching user models:",e)}})()},[r,s,n,e]);let eW=async t=>{try{if(console.log(`formValues: ${JSON.stringify(t)}`),null!=r){let a=t?.team_alias,s=e?.map(e=>e.team_alias)??[],n=t?.organization_id||S?.organization_id;if(""===n||"string"!=typeof n?t.organization_id=null:t.organization_id=n.trim(),s.includes(a))throw Error(`Team alias ${a} already exists, please pick another alias`);if(J.default.info("Creating Team"),eC.length>0){let e={};if(t.metadata)try{e=JSON.parse(t.metadata)}catch(e){console.warn("Invalid JSON in metadata field, starting with empty object")}e={...e,logging:eC.filter(e=>e.callback_name)},t.metadata=JSON.stringify(e)}if(t.secret_manager_settings&&"string"==typeof t.secret_manager_settings)if(""===t.secret_manager_settings.trim())delete t.secret_manager_settings;else try{t.secret_manager_settings=JSON.parse(t.secret_manager_settings)}catch(e){throw Error("Failed to parse secret manager settings: "+e)}let l=Array.isArray(t.object_permission_search_tools)&&t.object_permission_search_tools.length>0;if(t.allowed_vector_store_ids&&t.allowed_vector_store_ids.length>0||t.allowed_mcp_servers_and_groups&&(t.allowed_mcp_servers_and_groups.servers?.length>0||t.allowed_mcp_servers_and_groups.accessGroups?.length>0||t.allowed_mcp_servers_and_groups.toolPermissions)){if(t.object_permission||(t.object_permission={}),t.allowed_vector_store_ids&&t.allowed_vector_store_ids.length>0&&(t.object_permission.vector_stores=t.allowed_vector_store_ids,delete t.allowed_vector_store_ids),t.allowed_mcp_servers_and_groups){let{servers:e,accessGroups:r}=t.allowed_mcp_servers_and_groups;e&&e.length>0&&(t.object_permission.mcp_servers=e),r&&r.length>0&&(t.object_permission.mcp_access_groups=r),delete t.allowed_mcp_servers_and_groups}t.mcp_tool_permissions&&Object.keys(t.mcp_tool_permissions).length>0&&(t.object_permission.mcp_tool_permissions=t.mcp_tool_permissions,delete t.mcp_tool_permissions)}if(t.allowed_mcp_access_groups&&t.allowed_mcp_access_groups.length>0&&(t.object_permission||(t.object_permission={}),t.object_permission.mcp_access_groups=t.allowed_mcp_access_groups,delete t.allowed_mcp_access_groups),t.allowed_agents_and_groups){let{agents:e,accessGroups:r}=t.allowed_agents_and_groups;t.object_permission||(t.object_permission={}),e&&e.length>0&&(t.object_permission.agents=e),r&&r.length>0&&(t.object_permission.agent_access_groups=r),delete t.allowed_agents_and_groups}l&&(t.object_permission||(t.object_permission={}),t.object_permission.search_tools=t.object_permission_search_tools,delete t.object_permission_search_tools),Object.keys(eI).length>0&&(t.model_aliases=eI),eF?.router_settings&&Object.values(eF.router_settings).some(e=>null!=e&&""!==e)&&(t.router_settings=eF.router_settings),await (0,Q.teamCreateCall)(r,t),J.default.success("Team created"),await E({page:y,size:v}),I.resetFields(),eL([]),eY({}),eR(null),ez(e=>e+1),en(!1)}}catch(e){console.error("Error creating the team:",e),J.default.fromBackend("Error creating the team: "+e)}},eV=async(e,t)=>{let l={...L,[e]:t};if(O(l),b(1),r)try{let e=await (0,jY.teamListCall)(r,1,v,{organizationID:l.organization_id||null,search:l.search||null,userID:"Admin"!==n&&"Admin Viewer"!==n?s:null,sortBy:l.sort_by||null,sortOrder:l.sort_order||null});a(e.teams??[]),k(e.total??0)}catch(e){console.error("Error fetching teams:",e)}},{token:eG}=Eg.theme.useToken(),{Title:eJ,Text:eQ}=V.Typography,{Content:eX}=Ef.Layout,eZ=(0,T.useMemo)(()=>[{title:"Team ID",dataIndex:"team_id",key:"team_id",width:170,ellipsis:!0,render:(e,t)=>(0,_.jsx)(tB.Tooltip,{title:e,children:(0,_.jsx)(eQ,{ellipsis:!0,className:"text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs cursor-pointer",style:{fontSize:14,padding:"1px 8px"},onClick:()=>ee(t.team_id),"data-testid":"team-id-cell",children:e})})},{title:"Team Alias",dataIndex:"team_alias",key:"team_alias",ellipsis:!0,sorter:!0,render:e=>(0,_.jsx)(eQ,{style:{fontSize:14},children:e||(0,_.jsx)(eQ,{type:"secondary",italic:!0,children:"—"})})},{title:"Organization",key:"organization",width:160,ellipsis:!0,render:(e,t)=>{let r=((e,t)=>{if(!e||!t)return e||"N/A";let r=t.find(t=>t.organization_id===e);return r?.organization_alias||e})(t.organization_id,p||l);return t.organization_id?(0,_.jsx)(eQ,{ellipsis:!0,style:{fontSize:14},children:r}):(0,_.jsx)(eQ,{type:"secondary",children:"—"})}},{title:"Resources",key:"resources",width:240,render:(e,t)=>{let r=eb?.[t.team_id]?.team_info?.members_with_roles?.length??0,a=t.models?.length??0,s=eb?.[t.team_id]?.keys_count??0;return(0,_.jsxs)(tg.Flex,{gap:12,align:"center",children:[(0,_.jsx)(tB.Tooltip,{title:`${r} Members`,children:(0,_.jsx)(eN.Tag,{color:"purple",style:{fontSize:14,padding:"2px 8px",margin:0},children:(0,_.jsxs)(tg.Flex,{align:"center",gap:6,children:[(0,_.jsx)(E_.default,{size:14}),r]})})}),(0,_.jsx)(tB.Tooltip,{title:`${a} Models`,children:(0,_.jsx)(eN.Tag,{color:"blue",style:{fontSize:14,padding:"2px 8px",margin:0},children:(0,_.jsxs)(tg.Flex,{align:"center",gap:6,children:[(0,_.jsx)(Ey,{size:14}),a]})})}),(0,_.jsx)(tB.Tooltip,{title:`${s} Keys`,children:(0,_.jsx)(eN.Tag,{color:"cyan",style:{fontSize:14,padding:"2px 8px",margin:0},children:(0,_.jsxs)(tg.Flex,{align:"center",gap:6,children:[(0,_.jsx)(Cm,{size:14}),s]})})})]})}},{title:"Spend / Budget",key:"spend",width:200,sorter:!0,render:(e,t)=>{let r=t.spend??0,a=t.max_budget,s=`$${r.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`,n=null!=a?`$${a.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`:"Unlimited",l=null!=a&&a>0?Math.min(r/a*100,100):null;return(0,_.jsxs)(tg.Flex,{vertical:!0,gap:2,children:[(0,_.jsxs)(eQ,{style:{fontSize:13},children:[s,(0,_.jsxs)(eQ,{type:"secondary",style:{fontSize:12},children:[" / ",n]})]}),null!=l&&(0,_.jsx)(PG.default,{percent:l,size:"small",showInfo:!1,strokeColor:l>=90?"#ff4d4f":l>=70?"#faad14":"#1677ff",style:{marginBottom:0}})]})}},{title:"Created",dataIndex:"created_at",key:"created_at",width:130,ellipsis:!0,sorter:!0,render:e=>(0,_.jsx)(eQ,{type:"secondary",style:{fontSize:13},children:e?new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):"—"})},{title:"Actions",key:"actions",width:120,align:"right",render:(e,t)=>(0,_.jsxs)(U.Space,{size:4,children:[(0,_.jsx)(rG.default,{variant:"Copy",tooltipText:"Copy Team ID",onClick:()=>{navigator.clipboard.writeText(t.team_id).then(()=>LB.message.success("Team ID copied")).catch(()=>LB.message.error("Failed to copy"))}}),"Admin"===n&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(rG.default,{variant:"Edit",tooltipText:"Edit team",dataTestId:"edit-team-button",onClick:()=>{ee(t.team_id),ea(!0)}}),(0,_.jsx)(rG.default,{variant:"Delete",tooltipText:"Delete team",dataTestId:"delete-team-button",onClick:()=>eq(t)})]})]})}],[n,eb,p,l]),e0=(0,T.useMemo)(()=>e??[],[e]),e1=[{key:"your-teams",label:"Your Teams",children:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(eg.Card,{styles:{body:{padding:0}},children:[(0,_.jsxs)(tg.Flex,{justify:"space-between",align:"center",style:{padding:"12px 16px"},children:[(0,_.jsxs)(tg.Flex,{gap:12,align:"center",children:[(0,_.jsx)($.Input,{prefix:(0,_.jsx)(Cl.default,{size:16}),suffix:P?(0,_.jsx)(Eb,{size:"small"}):null,placeholder:"Search teams by name or ID...",onChange:e=>{var t;return t=e.target.value,void(D.current&&clearTimeout(D.current),A(!0),D.current=setTimeout(async()=>{try{O(e=>({...e,search:t})),b(1),await E({page:1,search:t})}finally{A(!1)}},300))},allowClear:!0,style:{maxWidth:400}}),(0,_.jsx)(Ev.default,{organizations:l,value:L.organization_id||void 0,onChange:e=>eV("organization_id",e||""),loading:h})]}),(0,_.jsx)(Ex.default,{current:y,total:w,pageSize:v,onChange:(e,t)=>{b(e),j(t),E({page:e,size:t})},size:"small",showTotal:e=>`${e} teams`,showSizeChanger:!0,pageSizeOptions:["10","20","50"]})]}),h?(0,_.jsx)(tg.Flex,{justify:"center",align:"center",style:{padding:"80px 0"},children:(0,_.jsx)(Eb,{fontSize:48})}):x?(0,_.jsxs)(tg.Flex,{vertical:!0,align:"center",gap:16,style:{padding:"64px 0"},children:[(0,_.jsx)(eQ,{type:"danger",style:{fontSize:15},children:"Failed to load teams"}),(0,_.jsx)(eQ,{type:"secondary",style:{fontSize:13},children:x}),(0,_.jsx)(z.Button,{icon:(0,_.jsx)(rg.ReloadOutlined,{}),onClick:()=>{E()},children:"Retry"})]}):(0,_.jsx)(eK.Table,{columns:eZ,dataSource:e0,rowKey:"team_id",pagination:!1,onChange:(e,t,r)=>{let a=Array.isArray(r)?r[0]:r,s=a.order?a.columnKey:"created_at",n="ascend"===a.order?"asc":(a.order,"desc");O(e=>({...e,sort_by:s,sort_order:n})),E({sortBy:s,sortOrder:n})},locale:{emptyText:(0,_.jsxs)("div",{style:{padding:"64px 0",textAlign:"center"},children:[(0,_.jsx)(A8.TeamOutlined,{style:{fontSize:40,color:"#d9d9d9",marginBottom:12}}),(0,_.jsx)("div",{children:(0,_.jsx)(eQ,{style:{fontSize:15,color:"#595959"},children:"No teams yet"})}),(0,_.jsx)("div",{style:{marginTop:4},children:(0,_.jsx)(eQ,{type:"secondary",style:{fontSize:13},children:"Create your first team to organize members and manage access to models."})}),EL(n,s,l)&&(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(tZ.PlusOutlined,{}),onClick:()=>en(!0),style:{marginTop:16},"data-testid":"create-team-button",children:"Create Team"})]})},scroll:{x:1e3},size:"middle"})]}),(0,_.jsx)(eH.default,{isOpen:em,title:"Delete Team?",alertMessage:0===(o=eh?.keys_count??eh?.keys?.length??0)?void 0:`Warning: This team has ${o} keys associated with it. Deleting the team will also delete all associated keys. This action is irreversible.`,message:"Are you sure you want to delete this team and all its keys? This action cannot be undone.",resourceInformationTitle:"Team Information",resourceInformation:[{label:"Team ID",value:eh?.team_id,code:!0},{label:"Team Name",value:eh?.team_alias},{label:"Keys",value:eh?.keys_count??eh?.keys?.length??0},{label:"Members",value:eh?.members_with_roles?.length}],requiredConfirmation:eh?.team_alias,onCancel:()=>{ep(!1),ef(null)},onOk:eU,confirmLoading:ej})]})},{key:"available-teams",label:"Available Teams",children:(0,_.jsx)(Ea,{accessToken:r,userID:s})},...(0,ts.isProxyAdminRole)(n||"")?[{key:"default-settings",label:"Default Team Settings",children:(0,_.jsx)(Eh,{accessToken:r,userID:s||"",userRole:n||""})}]:[]];return(0,_.jsxs)(eX,{style:{padding:eG.paddingLG,paddingInline:2*eG.paddingLG},children:[Z?(0,_.jsx)(Es.default,{teamId:Z,onUpdate:e=>{a(t=>null==t?t:t.map(t=>e.team_id===t.team_id?(0,rV.updateExistingKeys)(t,e):t)),E()},onClose:()=>{ee(null),ea(!1)},accessToken:r,is_team_admin:(e=>{if(null==e||null==e.members_with_roles)return!1;for(let t=0;te.team_id===Z)),is_proxy_admin:"Admin"==n,userModels:ec,editTeam:er,premiumUser:i}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(tg.Flex,{justify:"space-between",align:"center",style:{marginBottom:16},children:[(0,_.jsxs)(U.Space,{direction:"vertical",size:0,children:[(0,_.jsxs)(eJ,{level:2,style:{margin:0},children:[(0,_.jsx)(A8.TeamOutlined,{style:{marginRight:8}}),"Teams"]}),(0,_.jsx)(eQ,{type:"secondary",children:"Manage teams, members, and their access to models and budgets"})]}),EL(n,s,l)&&(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(tZ.PlusOutlined,{}),onClick:()=>en(!0),"data-testid":"create-team-button",children:"Create Team"})]}),(0,_.jsx)(W.Tabs,{items:e1})]}),EL(n,s,l)&&(0,_.jsx)(q.Modal,{title:"Create Team",open:es,width:1e3,footer:null,onOk:()=>{en(!1),I.resetFields(),eL([]),eY({}),eR(null),ez(e=>e+1)},onCancel:()=>{en(!1),I.resetFields(),eL([]),eY({}),eR(null),ez(e=>e+1)},children:(0,_.jsxs)(H.Form,{form:I,onFinish:eW,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(H.Form.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,_.jsx)(et.TextInput,{placeholder:"","data-testid":"team-name-input"})}),(d=EO(n,s,l),c="Admin"!==n,u=1===d.length,m=0===d.length,(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Organization"," ",(0,_.jsx)(tB.Tooltip,{title:(0,_.jsxs)("span",{children:["Organizations can have multiple teams. Learn more about"," ",(0,_.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/user_management_heirarchy",target:"_blank",rel:"noopener noreferrer",style:{color:"#1890ff",textDecoration:"underline"},onClick:e=>e.stopPropagation(),children:"user management hierarchy"})]}),children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"organization_id",initialValue:S?S.organization_id:null,className:"mt-8",rules:c?[{required:!0,message:"Please select an organization"}]:[],help:u?"You can only create teams within this organization":c?"required":"",children:(0,_.jsx)(eE.Select,{showSearch:!0,allowClear:!c,disabled:u,placeholder:m?"No organizations available":"Search or select an Organization",onChange:e=>{I.setFieldValue("organization_id",e),C(d?.find(t=>t.organization_id===e)||null)},filterOption:(e,t)=>!!t&&(t.children?.toString()||"").toLowerCase().includes(e.toLowerCase()),optionFilterProp:"children",children:d?.map(e=>(0,_.jsxs)(eE.Select.Option,{value:e.organization_id,children:[(0,_.jsx)("span",{className:"font-medium",children:e.organization_alias})," ",(0,_.jsxs)("span",{className:"text-gray-500",children:["(",e.organization_id,")"]})]},e.organization_id))})}),c&&!u&&d.length>1&&(0,_.jsx)("div",{className:"mb-8 p-4 bg-blue-50 border border-blue-200 rounded-md",children:(0,_.jsx)(eQ,{style:{color:"#1e40af",fontSize:14},children:"Please select an organization to create a team for. You can only create teams within organizations where you are an admin."})})]})),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Models"," ",(0,_.jsx)(tB.Tooltip,{title:"These are the models that your selected team has access to",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),rules:[{required:!0,message:"Please select at least one model"}],name:"models",children:(0,_.jsx)(El.ModelSelect,{value:I.getFieldValue("models")||[],onChange:e=>I.setFieldValue("models",e),organizationID:I.getFieldValue("organization_id"),options:{includeSpecialOptions:!0,showAllProxyModelsOverride:!I.getFieldValue("organization_id")},context:"team",dataTestId:"create-team-models-select"})}),(0,_.jsx)(H.Form.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,_.jsx)(jf.default,{step:.01,precision:2,width:200})}),(0,_.jsx)(H.Form.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,_.jsxs)(eE.Select,{defaultValue:null,placeholder:"n/a",children:[(0,_.jsx)(eE.Select.Option,{value:"24h",children:"daily"}),(0,_.jsx)(eE.Select.Option,{value:"7d",children:"weekly"}),(0,_.jsx)(eE.Select.Option,{value:"30d",children:"monthly"})]})}),(0,_.jsx)(H.Form.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,_.jsx)(jf.default,{step:1,width:400})}),(0,_.jsx)(H.Form.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,_.jsx)(jf.default,{step:1,width:400})}),(0,_.jsxs)(rX.Accordion,{className:"mt-20 mb-8",onClick:()=>{eP||(e$(),eA(!0))},children:[(0,_.jsx)(rZ.AccordionHeader,{children:(0,_.jsx)("b",{children:"Additional Settings"})}),(0,_.jsxs)(r0.AccordionBody,{children:[(0,_.jsx)(H.Form.Item,{label:"Team ID",name:"team_id",help:"ID of the team you want to create. If not provided, it will be generated automatically.",children:(0,_.jsx)(et.TextInput,{onChange:e=>{e.target.value=e.target.value.trim()}})}),(0,_.jsx)(H.Form.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",normalize:e=>e?Number(e):void 0,tooltip:"This is the individual budget for a user in the team.",children:(0,_.jsx)(jf.default,{step:.01,precision:2,width:200})}),(0,_.jsx)(H.Form.Item,{label:"Team Member Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,_.jsx)(et.TextInput,{placeholder:"e.g., 30d"})}),(0,_.jsx)(H.Form.Item,{label:"Team Member RPM Limit",name:"team_member_rpm_limit",tooltip:"The RPM (Requests Per Minute) limit for individual team members",children:(0,_.jsx)(jf.default,{step:1,width:400})}),(0,_.jsx)(H.Form.Item,{label:"Team Member TPM Limit",name:"team_member_tpm_limit",tooltip:"The TPM (Tokens Per Minute) limit for individual team members",children:(0,_.jsx)(jf.default,{step:1,width:400})}),(0,_.jsx)(H.Form.Item,{label:"Metadata",name:"metadata",help:"Additional team metadata. Enter metadata as JSON object.",children:(0,_.jsx)($.Input.TextArea,{rows:4})}),(0,_.jsx)(H.Form.Item,{label:"Secret Manager Settings",name:"secret_manager_settings",help:i?"Enter secret manager configuration as a JSON object.":"Premium feature - Upgrade to manage secret manager settings.",rules:[{validator:async(e,t)=>{if(!t)return Promise.resolve();try{return JSON.parse(t),Promise.resolve()}catch(e){return Promise.reject(Error("Please enter valid JSON"))}}}],children:(0,_.jsx)($.Input.TextArea,{rows:4,placeholder:'{"namespace": "admin", "mount": "secret", "path_prefix": "litellm"}',disabled:!i})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Guardrails"," ",(0,_.jsx)(tB.Tooltip,{title:"Setup your first guardrail",children:(0,_.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-8",help:"Select existing guardrails or enter new ones",children:(0,_.jsx)(eE.Select,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:ek.map(e=>({value:e,label:e}))})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Disable Global Guardrails"," ",(0,_.jsx)(tB.Tooltip,{title:"When enabled, this team will bypass any guardrails configured to run on every request (global guardrails)",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"disable_global_guardrails",className:"mt-4",valuePropName:"checked",help:"Bypass global guardrails for this team",children:(0,_.jsx)(e_.Switch,{disabled:!i,checkedChildren:i?"Yes":"Premium feature - Upgrade to disable global guardrails by team",unCheckedChildren:i?"No":"Premium feature - Upgrade to disable global guardrails by team"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Policies"," ",(0,_.jsx)(tB.Tooltip,{title:"Apply policies to this team to control guardrails and other settings",children:(0,_.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/guardrail_policies",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})})]}),name:"policies",className:"mt-8",help:"Select existing policies or enter new ones",children:(0,_.jsx)(eE.Select,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter policies",options:eT.map(e=>({value:e,label:e}))})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Access Groups"," ",(0,_.jsx)(tB.Tooltip,{title:"Assign access groups to this team. Access groups control which models, MCP servers, and agents this team can use",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"access_group_ids",className:"mt-8",help:"Select access groups to assign to this team",children:(0,_.jsx)(Ej.default,{placeholder:"Select access groups (optional)"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,_.jsx)(tB.Tooltip,{title:"Select which vector stores this team can access by default. Leave empty for access to all vector stores",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-8",help:"Select vector stores this team can access. Leave empty for access to all vector stores",children:(0,_.jsx)(EM.default,{onChange:e=>I.setFieldValue("allowed_vector_store_ids",e),value:I.getFieldValue("allowed_vector_store_ids"),accessToken:r||"",placeholder:"Select vector stores (optional)"})}),(0,_.jsx)(H.Form.Item,{label:"Allowed Pass Through Routes",name:"allowed_passthrough_routes",className:"mt-8",children:(0,_.jsx)(tB.Tooltip,{title:i?(0,ts.isProxyAdminRole)(n||"")?"":"Only proxy admins can set allowed pass through routes":"Premium feature - Upgrade to set allowed pass through routes",placement:"top",children:(0,_.jsx)(Ew.default,{onChange:e=>I.setFieldValue("allowed_passthrough_routes",e),value:I.getFieldValue("allowed_passthrough_routes"),accessToken:r||"",placeholder:"Select pass through routes (optional)",disabled:!i||!(0,ts.isProxyAdminRole)(n||"")})})})]})]}),(0,_.jsxs)(rX.Accordion,{className:"mt-8 mb-8",children:[(0,_.jsx)(rZ.AccordionHeader,{children:(0,_.jsx)("b",{children:"MCP Settings"})}),(0,_.jsxs)(r0.AccordionBody,{children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,_.jsx)(tB.Tooltip,{title:"Select which MCP servers or access groups this team can access",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",className:"mt-4",help:"Select MCP servers or access groups this team can access",children:(0,_.jsx)(rO.default,{onChange:e=>I.setFieldValue("allowed_mcp_servers_and_groups",e),value:I.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:r||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,_.jsx)(H.Form.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,_.jsx)($.Input,{type:"hidden"})}),(0,_.jsx)(H.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.allowed_mcp_servers_and_groups!==t.allowed_mcp_servers_and_groups||e.mcp_tool_permissions!==t.mcp_tool_permissions,children:()=>(0,_.jsx)("div",{className:"mt-6",children:(0,_.jsx)(rD.default,{accessToken:r||"",selectedServers:I.getFieldValue("allowed_mcp_servers_and_groups")?.servers||[],toolPermissions:I.getFieldValue("mcp_tool_permissions")||{},onChange:e=>I.setFieldsValue({mcp_tool_permissions:e})})})})]})]}),(0,_.jsxs)(rX.Accordion,{className:"mt-8 mb-8",children:[(0,_.jsx)(rZ.AccordionHeader,{children:(0,_.jsx)("b",{children:"Agent Settings"})}),(0,_.jsx)(r0.AccordionBody,{children:(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Allowed Agents"," ",(0,_.jsx)(tB.Tooltip,{title:"Select which agents or access groups this team can access",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"allowed_agents_and_groups",className:"mt-4",help:"Select agents or access groups this team can access",children:(0,_.jsx)(Ek.default,{onChange:e=>I.setFieldValue("allowed_agents_and_groups",e),value:I.getFieldValue("allowed_agents_and_groups"),accessToken:r||"",placeholder:"Select agents or access groups (optional)"})})})]}),(0,_.jsxs)(rX.Accordion,{className:"mt-8 mb-8",children:[(0,_.jsx)(rZ.AccordionHeader,{children:(0,_.jsx)("b",{children:"Search Tool Settings"})}),(0,_.jsx)(r0.AccordionBody,{children:(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Allowed Search Tools"," ",(0,_.jsx)(tB.Tooltip,{title:"Select which search tools this team can access. Leave empty to allow all search tools.",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"object_permission_search_tools",className:"mt-4",help:"Restrict which configured search tools keys on this team may call.",children:(0,_.jsx)(EC.default,{onChange:e=>I.setFieldValue("object_permission_search_tools",e),value:I.getFieldValue("object_permission_search_tools"),accessToken:r||"",placeholder:"Select search tools (optional, empty = all allowed)"})})})]}),(0,_.jsxs)(rX.Accordion,{className:"mt-8 mb-8",children:[(0,_.jsx)(rZ.AccordionHeader,{children:(0,_.jsx)("b",{children:"Logging Settings"})}),(0,_.jsx)(r0.AccordionBody,{children:(0,_.jsx)("div",{className:"mt-4",children:(0,_.jsx)(EN.default,{value:eC,onChange:eL,premiumUser:i})})})]}),(0,_.jsxs)(rX.Accordion,{className:"mt-8 mb-8",children:[(0,_.jsx)(rZ.AccordionHeader,{children:(0,_.jsx)("b",{children:"Router Settings"})}),(0,_.jsx)(r0.AccordionBody,{children:(0,_.jsx)("div",{className:"mt-4 w-full",children:(0,_.jsx)(ET.default,{accessToken:r||"",value:eF||void 0,onChange:eR,modelData:ec.length>0?{data:ec.map(e=>({model_name:e}))}:void 0},eB)})})]},`router-settings-accordion-${eB}`),(0,_.jsxs)(rX.Accordion,{className:"mt-8 mb-8",children:[(0,_.jsx)(rZ.AccordionHeader,{children:(0,_.jsx)("b",{children:"Model Aliases"})}),(0,_.jsx)(r0.AccordionBody,{children:(0,_.jsxs)("div",{className:"mt-4",children:[(0,_.jsx)(eQ,{type:"secondary",style:{fontSize:14,marginBottom:16,display:"block"},children:"Create custom aliases for models that can be used by team members in API calls. This allows you to create shortcuts for specific models."}),(0,_.jsx)(ES.default,{accessToken:r||"",initialModelAliases:eI,onAliasUpdate:eY,showExampleConfig:!1})]})})]})]}),(0,_.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,_.jsx)(z.Button,{htmlType:"submit","data-testid":"create-team-submit",children:"Create Team"})})]})})]})};var EP=e.i(702597),EA=e.i(846835),EE=e.i(147612);let EI=e=>{let t=new Set,r=/\{\{(\w+)\}\}/g;if(e.messages.forEach(e=>{let a;for(;null!==(a=r.exec(e.content));)t.add(a[1])}),e.developerMessage){let a;for(;null!==(a=r.exec(e.developerMessage));)t.add(a[1])}return Array.from(t)},EY=e=>{let t=EI(e),r=`--- model: ${e.model} `;return void 0!==e.config.temperature&&(r+=`temperature: ${e.config.temperature} `),void 0!==e.config.max_tokens&&(r+=`max_tokens: ${e.config.max_tokens} @@ -492,9 +492,9 @@ model: ${e.model} `),e.messages.forEach(e=>{let t=e.role.charAt(0).toUpperCase()+e.role.slice(1);r+=`${t}: ${e.content} -`}),r.trim()},EI=e=>{let t=Number(e);return Number.isFinite(t)?t:void 0},EY=e=>{let t=e?.prompt_spec?.litellm_params?.dotprompt_content||"";if(!t)throw Error("No dotprompt_content found in API response");let r=t.split("---");if(r.length<3)throw Error("Invalid dotprompt format");let a=r[1],s=r.slice(2).join("---").trim(),n=(e=>{let t={config:{},tools:[]},r=e.split("\n");for(let e of(t.tools=(e=>{let t=[],r=!1;for(let a of e){let e=a.trim();if(!r){("tools:"===e||e.startsWith("tools:"))&&(r=!0);continue}if(a.length>0&&!/^\s/.test(a)&&"-"!==e&&!e.startsWith("-"))break;let s=e.match(/^-+\s*(.+)$/);if(!s)continue;let n=s[1].trim();if(n)try{let e=JSON.parse(n);t.push({name:e?.function?.name||"Unnamed Tool",description:e?.function?.description||"",json:JSON.stringify(e,null,2)})}catch{}}return t})(r),r)){let r=e.trim();if(!r||r.startsWith("input:")||r.startsWith("output:")||r.startsWith("schema:")||r.startsWith("format:")||r.startsWith("tools:")||r.startsWith("-"))continue;let a=r.indexOf(":");if(a<=0)continue;let s=r.substring(0,a).trim(),n=r.substring(a+1).trim();if("model"===s){t.model=n;continue}"temperature"===s&&(t.config.temperature=EI(n)),"max_tokens"===s&&(t.config.max_tokens=EI(n)),"top_p"===s&&(t.config.top_p=EI(n))}return t})(a),l=(e=>{let t=/^(System|Developer|User|Assistant):(?:\s(.*)|\s*)$/,r=[],a="",s=null,n=[],l=()=>{if(!s)return;let e=n.join("\n").trim();"developer"===s?e&&(a=a?`${a} +`}),r.trim()},EF=e=>{let t=Number(e);return Number.isFinite(t)?t:void 0},ER=e=>{let t=e?.prompt_spec?.litellm_params?.dotprompt_content||"";if(!t)throw Error("No dotprompt_content found in API response");let r=t.split("---");if(r.length<3)throw Error("Invalid dotprompt format");let a=r[1],s=r.slice(2).join("---").trim(),n=(e=>{let t={config:{},tools:[]},r=e.split("\n");for(let e of(t.tools=(e=>{let t=[],r=!1;for(let a of e){let e=a.trim();if(!r){("tools:"===e||e.startsWith("tools:"))&&(r=!0);continue}if(a.length>0&&!/^\s/.test(a)&&"-"!==e&&!e.startsWith("-"))break;let s=e.match(/^-+\s*(.+)$/);if(!s)continue;let n=s[1].trim();if(n)try{let e=JSON.parse(n);t.push({name:e?.function?.name||"Unnamed Tool",description:e?.function?.description||"",json:JSON.stringify(e,null,2)})}catch{}}return t})(r),r)){let r=e.trim();if(!r||r.startsWith("input:")||r.startsWith("output:")||r.startsWith("schema:")||r.startsWith("format:")||r.startsWith("tools:")||r.startsWith("-"))continue;let a=r.indexOf(":");if(a<=0)continue;let s=r.substring(0,a).trim(),n=r.substring(a+1).trim();if("model"===s){t.model=n;continue}"temperature"===s&&(t.config.temperature=EF(n)),"max_tokens"===s&&(t.config.max_tokens=EF(n)),"top_p"===s&&(t.config.top_p=EF(n))}return t})(a),l=(e=>{let t=/^(System|Developer|User|Assistant):(?:\s(.*)|\s*)$/,r=[],a="",s=null,n=[],l=()=>{if(!s)return;let e=n.join("\n").trim();"developer"===s?e&&(a=a?`${a} -${e}`:e):e?r.push({role:s,content:e}):r.push({role:s,content:""})};for(let r of e.split("\n")){let e=r.match(t);if(e){l(),s=e[1].toLowerCase(),n=[e[2]??""];continue}s&&n.push(r)}return l(),{developerMessage:a,messages:r}})(s),i=e?.prompt_spec?.prompt_id||"Unnamed Prompt";return{name:EF(i)||i,model:n.model||"gpt-4o",config:n.config,tools:n.tools,developerMessage:l.developerMessage,messages:l.messages.length>0?l.messages:[{role:"user",content:"Enter task specifics. Use {{template_variables}} for dynamic inputs"}],environment:e?.prompt_spec?.environment||e?.prompt_spec?.prompt_info?.environment||"development"}},EF=e=>e?e.replace(/[._-]v\d+$/,""):"",ER=e=>e?.prompt_id||"",EB=e=>{try{let t=e.litellm_params;if(t?.dotprompt_content){let e=t.dotprompt_content.match(/model:\s*([^\n]+)/);if(e)return e[1].trim()}if(t?.prompt_data?.model)return t.prompt_data.model;if(t?.model)return t.model;return null}catch(e){return console.error("Error extracting model:",e),null}},Ez=({promptsList:e,isLoading:t,onPromptClick:r,onDeleteClick:a,accessToken:s,isAdmin:n})=>{let[l,i]=(0,T.useState)([{id:"created_at",desc:!0}]),[o,d]=(0,T.useState)(new Map);(0,T.useEffect)(()=>{(async()=>{if(s)try{let e=await (0,Q.modelHubCall)(s);if(e?.data){let t=new Map;e.data.forEach(e=>{t.set(e.model_group,e)}),d(t)}}catch(e){console.error("Error fetching model hub data:",e)}})()},[s]);let c=e=>e?new Date(e).toLocaleString():"-",u=[{header:"Prompt ID",accessorKey:"prompt_id",cell:e=>{let t=String(e.getValue()||""),a=t.length>25?`${t.slice(0,25)}...`:t;return(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(tB.Tooltip,{title:t,children:(0,_.jsx)(S.Button,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate min-w-[220px] justify-start",onClick:()=>e.getValue()&&r?.(e.getValue()),children:a})}),(0,_.jsx)(tB.Tooltip,{title:"Copy prompt ID",children:(0,_.jsx)(ei.CopyOutlined,{onClick:e=>{e.stopPropagation(),navigator.clipboard.writeText(t)},className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]})}},{header:"Model",accessorKey:"model",cell:({row:e})=>{let t=EB(e.original);if(!t)return(0,_.jsx)("span",{className:"text-xs text-gray-400",children:"-"});let r=((e,t)=>{if(!e)return null;let r=t.get(e);return r&&r.providers&&r.providers.length>0?r.providers[0]:null})(t,o),{logo:a}=(0,j$.getProviderLogoAndName)(r||"");return(0,_.jsx)(tB.Tooltip,{title:t,children:(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)("div",{className:"flex-shrink-0",children:r&&a?(0,_.jsx)("img",{src:a,alt:`${r} logo`,className:"w-4 h-4",onError:e=>{let t=e.currentTarget,a=t.parentElement;if(a&&a.contains(t))try{let e=document.createElement("div");e.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=r?.charAt(0)||"-",a.replaceChild(e,t)}catch(e){console.error("Failed to replace provider logo fallback:",e)}}}):(0,_.jsx)("div",{className:"w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",children:"-"})}),(0,_.jsx)("span",{className:"max-w-[15ch] truncate block",children:t})]})})}},{header:"Created At",accessorKey:"created_at",cell:({row:e})=>{let t=e.original;return(0,_.jsx)(tB.Tooltip,{title:t.created_at,children:(0,_.jsx)("span",{className:"text-xs",children:c(t.created_at)})})}},{header:"Updated At",accessorKey:"updated_at",cell:({row:e})=>{let t=e.original;return(0,_.jsx)(tB.Tooltip,{title:t.updated_at,children:(0,_.jsx)("span",{className:"text-xs",children:c(t.updated_at)})})}},{header:"Environment",accessorKey:"environment",cell:({row:e})=>{let t=e.original.environment||"development";return(0,_.jsx)("span",{className:`text-xs px-2 py-0.5 rounded ${{production:"text-red-600 bg-red-50",staging:"text-yellow-600 bg-yellow-50",development:"text-green-600 bg-green-50"}[t]||"text-gray-600 bg-gray-50"}`,children:t})}},{header:"Created By",accessorKey:"created_by",cell:({row:e})=>{let t=e.original;return(0,_.jsx)("span",{className:"text-xs text-gray-600",children:t.created_by||"-"})}},{header:"Type",accessorKey:"prompt_info.prompt_type",cell:({row:e})=>{let t=e.original;return(0,_.jsx)(tB.Tooltip,{title:t.prompt_info.prompt_type,children:(0,_.jsx)("span",{className:"text-xs",children:t.prompt_info.prompt_type})})}},...n?[{header:"Actions",id:"actions",enableSorting:!1,cell:({row:e})=>{let t=e.original,r=t.prompt_id||"Unknown Prompt";return(0,_.jsx)("div",{className:"flex items-center gap-1",children:(0,_.jsx)(tB.Tooltip,{title:"Delete prompt",children:(0,_.jsx)(S.Button,{size:"xs",variant:"light",color:"red",onClick:e=>{e.stopPropagation(),a?.(t.prompt_id,r)},icon:jO.TrashIcon,className:"text-red-500 hover:text-red-700 hover:bg-red-50"})})})}}]:[]],m=(0,jD.useReactTable)({data:e,columns:u,state:{sorting:l},onSortingChange:i,getCoreRowModel:(0,jP.getCoreRowModel)(),getSortedRowModel:(0,jP.getSortedRowModel)(),enableSorting:!0});return(0,_.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,_.jsx)("div",{className:"overflow-x-auto",children:(0,_.jsxs)(A.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,_.jsx)(Y.TableHead,{children:m.getHeaderGroups().map(e=>(0,_.jsx)(R.TableRow,{children:e.headers.map(e=>(0,_.jsx)(F.TableHeaderCell,{className:"py-1 h-8",onClick:e.column.getToggleSortingHandler(),children:(0,_.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,_.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,jD.flexRender)(e.column.columnDef.header,e.getContext())}),(0,_.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,_.jsx)(jC.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,_.jsx)(jM.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,_.jsx)(jL.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,_.jsx)(E.TableBody,{children:t?(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:u.length,className:"h-8 text-center",children:(0,_.jsx)("div",{className:"text-center text-gray-500",children:(0,_.jsx)("p",{children:"Loading..."})})})}):e.length>0?m.getRowModel().rows.map(e=>(0,_.jsx)(R.TableRow,{className:"h-8",children:e.getVisibleCells().map(e=>(0,_.jsx)(I.TableCell,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,jD.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:u.length,className:"h-8 text-center",children:(0,_.jsx)("div",{className:"text-center text-gray-500",children:(0,_.jsx)("p",{children:"No prompts found"})})})})})]})})})};var EH=e.i(219470);let E$=({promptId:e,model:t,promptVariables:r={},accessToken:a,version:s="1",proxySettings:n})=>{let[l,i]=(0,T.useState)(!1),[o,d]=(0,T.useState)("curl"),[c,u]=(0,T.useState)("basic"),[m,p]=(0,T.useState)(""),h=window.location.origin,f=n?.LITELLM_UI_API_DOC_BASE_URL;f&&f.trim()?h=f:n?.PROXY_BASE_URL&&(h=n.PROXY_BASE_URL);let x=a||"sk-1234";return T.default.useEffect(()=>{l&&p((()=>{let a=Object.keys(r).length>0;if("curl"===o)if("basic"===c)return`curl -X POST '${h}/chat/completions' \\ +${e}`:e):e?r.push({role:s,content:e}):r.push({role:s,content:""})};for(let r of e.split("\n")){let e=r.match(t);if(e){l(),s=e[1].toLowerCase(),n=[e[2]??""];continue}s&&n.push(r)}return l(),{developerMessage:a,messages:r}})(s),i=e?.prompt_spec?.prompt_id||"Unnamed Prompt";return{name:EB(i)||i,model:n.model||"gpt-4o",config:n.config,tools:n.tools,developerMessage:l.developerMessage,messages:l.messages.length>0?l.messages:[{role:"user",content:"Enter task specifics. Use {{template_variables}} for dynamic inputs"}],environment:e?.prompt_spec?.environment||e?.prompt_spec?.prompt_info?.environment||"development"}},EB=e=>e?e.replace(/[._-]v\d+$/,""):"",Ez=e=>e?.prompt_id||"",EH=e=>{try{let t=e.litellm_params;if(t?.dotprompt_content){let e=t.dotprompt_content.match(/model:\s*([^\n]+)/);if(e)return e[1].trim()}if(t?.prompt_data?.model)return t.prompt_data.model;if(t?.model)return t.model;return null}catch(e){return console.error("Error extracting model:",e),null}},E$=({promptsList:e,isLoading:t,onPromptClick:r,onDeleteClick:a,accessToken:s,isAdmin:n})=>{let[l,i]=(0,T.useState)([{id:"created_at",desc:!0}]),[o,d]=(0,T.useState)(new Map);(0,T.useEffect)(()=>{(async()=>{if(s)try{let e=await (0,Q.modelHubCall)(s);if(e?.data){let t=new Map;e.data.forEach(e=>{t.set(e.model_group,e)}),d(t)}}catch(e){console.error("Error fetching model hub data:",e)}})()},[s]);let c=e=>e?new Date(e).toLocaleString():"-",u=[{header:"Prompt ID",accessorKey:"prompt_id",cell:e=>{let t=String(e.getValue()||""),a=t.length>25?`${t.slice(0,25)}...`:t;return(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(tB.Tooltip,{title:t,children:(0,_.jsx)(S.Button,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate min-w-[220px] justify-start",onClick:()=>e.getValue()&&r?.(e.getValue()),children:a})}),(0,_.jsx)(tB.Tooltip,{title:"Copy prompt ID",children:(0,_.jsx)(ei.CopyOutlined,{onClick:e=>{e.stopPropagation(),navigator.clipboard.writeText(t)},className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]})}},{header:"Model",accessorKey:"model",cell:({row:e})=>{let t=EH(e.original);if(!t)return(0,_.jsx)("span",{className:"text-xs text-gray-400",children:"-"});let r=((e,t)=>{if(!e)return null;let r=t.get(e);return r&&r.providers&&r.providers.length>0?r.providers[0]:null})(t,o),{logo:a}=(0,j$.getProviderLogoAndName)(r||"");return(0,_.jsx)(tB.Tooltip,{title:t,children:(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)("div",{className:"flex-shrink-0",children:r&&a?(0,_.jsx)("img",{src:a,alt:`${r} logo`,className:"w-4 h-4",onError:e=>{let t=e.currentTarget,a=t.parentElement;if(a&&a.contains(t))try{let e=document.createElement("div");e.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=r?.charAt(0)||"-",a.replaceChild(e,t)}catch(e){console.error("Failed to replace provider logo fallback:",e)}}}):(0,_.jsx)("div",{className:"w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",children:"-"})}),(0,_.jsx)("span",{className:"max-w-[15ch] truncate block",children:t})]})})}},{header:"Created At",accessorKey:"created_at",cell:({row:e})=>{let t=e.original;return(0,_.jsx)(tB.Tooltip,{title:t.created_at,children:(0,_.jsx)("span",{className:"text-xs",children:c(t.created_at)})})}},{header:"Updated At",accessorKey:"updated_at",cell:({row:e})=>{let t=e.original;return(0,_.jsx)(tB.Tooltip,{title:t.updated_at,children:(0,_.jsx)("span",{className:"text-xs",children:c(t.updated_at)})})}},{header:"Environment",accessorKey:"environment",cell:({row:e})=>{let t=e.original.environment||"development";return(0,_.jsx)("span",{className:`text-xs px-2 py-0.5 rounded ${{production:"text-red-600 bg-red-50",staging:"text-yellow-600 bg-yellow-50",development:"text-green-600 bg-green-50"}[t]||"text-gray-600 bg-gray-50"}`,children:t})}},{header:"Created By",accessorKey:"created_by",cell:({row:e})=>{let t=e.original;return(0,_.jsx)("span",{className:"text-xs text-gray-600",children:t.created_by||"-"})}},{header:"Type",accessorKey:"prompt_info.prompt_type",cell:({row:e})=>{let t=e.original;return(0,_.jsx)(tB.Tooltip,{title:t.prompt_info.prompt_type,children:(0,_.jsx)("span",{className:"text-xs",children:t.prompt_info.prompt_type})})}},...n?[{header:"Actions",id:"actions",enableSorting:!1,cell:({row:e})=>{let t=e.original,r=t.prompt_id||"Unknown Prompt";return(0,_.jsx)("div",{className:"flex items-center gap-1",children:(0,_.jsx)(tB.Tooltip,{title:"Delete prompt",children:(0,_.jsx)(S.Button,{size:"xs",variant:"light",color:"red",onClick:e=>{e.stopPropagation(),a?.(t.prompt_id,r)},icon:jO.TrashIcon,className:"text-red-500 hover:text-red-700 hover:bg-red-50"})})})}}]:[]],m=(0,jD.useReactTable)({data:e,columns:u,state:{sorting:l},onSortingChange:i,getCoreRowModel:(0,jP.getCoreRowModel)(),getSortedRowModel:(0,jP.getSortedRowModel)(),enableSorting:!0});return(0,_.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,_.jsx)("div",{className:"overflow-x-auto",children:(0,_.jsxs)(A.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,_.jsx)(Y.TableHead,{children:m.getHeaderGroups().map(e=>(0,_.jsx)(R.TableRow,{children:e.headers.map(e=>(0,_.jsx)(F.TableHeaderCell,{className:"py-1 h-8",onClick:e.column.getToggleSortingHandler(),children:(0,_.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,_.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,jD.flexRender)(e.column.columnDef.header,e.getContext())}),(0,_.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,_.jsx)(jC.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,_.jsx)(jM.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,_.jsx)(jL.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,_.jsx)(E.TableBody,{children:t?(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:u.length,className:"h-8 text-center",children:(0,_.jsx)("div",{className:"text-center text-gray-500",children:(0,_.jsx)("p",{children:"Loading..."})})})}):e.length>0?m.getRowModel().rows.map(e=>(0,_.jsx)(R.TableRow,{className:"h-8",children:e.getVisibleCells().map(e=>(0,_.jsx)(I.TableCell,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,jD.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:u.length,className:"h-8 text-center",children:(0,_.jsx)("div",{className:"text-center text-gray-500",children:(0,_.jsx)("p",{children:"No prompts found"})})})})})]})})})};var Eq=e.i(219470);let EU=({promptId:e,model:t,promptVariables:r={},accessToken:a,version:s="1",proxySettings:n})=>{let[l,i]=(0,T.useState)(!1),[o,d]=(0,T.useState)("curl"),[c,u]=(0,T.useState)("basic"),[m,p]=(0,T.useState)(""),h=window.location.origin,f=n?.LITELLM_UI_API_DOC_BASE_URL;f&&f.trim()?h=f:n?.PROXY_BASE_URL&&(h=n.PROXY_BASE_URL);let x=a||"sk-1234";return T.default.useEffect(()=>{l&&p((()=>{let a=Object.keys(r).length>0;if("curl"===o)if("basic"===c)return`curl -X POST '${h}/chat/completions' \\ -H 'Content-Type: application/json' \\ -H 'Authorization: Bearer ${x}' \\ -d '{ @@ -611,7 +611,7 @@ async function main() { console.log(response); } -main();`}})())},[l,o,c,e,t,r]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(S.Button,{variant:"secondary",icon:wZ.CodeOutlined,onClick:()=>{i(!0)},children:"Get Code"}),(0,_.jsxs)(q.Modal,{title:"Generated Code",open:l,onCancel:()=>{i(!1)},footer:null,width:800,children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium block mb-1 text-gray-700",children:"Language"}),(0,_.jsx)(eE.Select,{value:o,onChange:e=>d(e),style:{width:180},options:[{value:"curl",label:"cURL"},{value:"python",label:"Python (OpenAI SDK)"},{value:"javascript",label:"JavaScript (OpenAI SDK)"}]})]}),(0,_.jsx)(z.Button,{onClick:()=>{navigator.clipboard.writeText(m),J.default.success("Copied to clipboard!")},children:"Copy to Clipboard"})]}),(0,_.jsx)(W.Tabs,{activeKey:c,onChange:u,items:[{label:"Basic",key:"basic"},{label:"With Messages",key:"messages"},{label:"With Version",key:"version"}]}),(0,_.jsx)(rJ.Prism,{language:"curl"===o?"bash":"python"===o?"python":"javascript",style:EH.coy,wrapLines:!0,wrapLongLines:!0,className:"rounded-md mt-0",customStyle:{maxHeight:"60vh",overflowY:"auto",marginTop:0,borderTopLeftRadius:0,borderTopRightRadius:0},children:m})]})]})},Eq=({promptId:e,onClose:t,accessToken:r,isAdmin:a,onDelete:s,onEdit:n})=>{let[l,i]=(0,T.useState)(null),[o,d]=(0,T.useState)(null),[c,u]=(0,T.useState)(null),[m,p]=(0,T.useState)(!0),[h,f]=(0,T.useState)({}),[x,g]=(0,T.useState)(!1),[y,b]=(0,T.useState)(!1),[v,j]=(0,T.useState)([]),[w,k]=(0,T.useState)(null),[N,M]=(0,T.useState)([]),[C,L]=(0,T.useState)(null),[O,D]=(0,T.useState)(!1),B=async t=>{try{if(p(!0),!r)return;let a=await (0,Q.getPromptInfo)(r,e,t);i(a.prompt_spec),d(a.raw_prompt_template),u(a),a.environments&&a.environments.length>0&&(j(a.environments),w||k(a.prompt_spec.environment||a.environments[0])),L(a.prompt_spec.version||null)}catch(e){J.default.fromBackend("Failed to load prompt information"),console.error("Error fetching prompt info:",e)}finally{p(!1)}},H=async t=>{if(r){D(!0);try{let a=await (0,Q.getPromptVersions)(r,e,t);M(a.prompts||[])}catch{M([])}finally{D(!1)}}},$=(0,T.useRef)(!0);if((0,T.useEffect)(()=>{k(null),j([]),M([]),B()},[e,r]),(0,T.useEffect)(()=>{if($.current){$.current=!1,w&&r&&H(w);return}w&&r&&(B(w),H(w))},[w]),m&&!l)return(0,_.jsx)("div",{className:"p-4",children:"Loading..."});if(!l)return(0,_.jsx)("div",{className:"p-4",children:"Prompt not found"});let U=e=>e?new Date(e).toLocaleString():"-",W=async(e,t)=>{await (0,rV.copyToClipboard)(e)&&(f(e=>({...e,[t]:!0})),setTimeout(()=>{f(e=>({...e,[t]:!1}))},2e3))},V=async()=>{if(r&&l){b(!0);try{await (0,Q.deletePromptCall)(r,et),J.default.success(`Prompt "${et}" deleted successfully`),s?.(),t()}catch(e){console.error("Error deleting prompt:",e),J.default.fromBackend("Failed to delete prompt")}finally{b(!1),g(!1)}}},G=async t=>{if(!r||!w)return;let a=t.version||1;L(a);try{let t=`${e}.v${a}`,s=await (0,Q.getPromptInfo)(r,t,w);i(s.prompt_spec),d(s.raw_prompt_template),u(s)}catch{J.default.fromBackend(`Failed to load version v${a}`)}},K=l&&EB(l)||"gpt-4o",et=ER(l),er=(e=>{let t;if(e?.version)return String(e.version);var r=(t=ER(e),e?.litellm_params?.prompt_id||t);if(!r)return"1";let a=r.match(/[._-]v(\d+)$/);return a?a[1]:"1"})(l),ea=N.length>0?Math.max(...N.map(e=>e.version||1)):null,es=null!==ea&&null!==C&&CW(et,"prompt-id"),className:`left-2 z-10 transition-all duration-200 ${h["prompt-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`})]})]}),(0,_.jsxs)("div",{className:"flex gap-2",children:[(0,_.jsx)(E$,{promptId:et,model:K,promptVariables:(e=>{let t;if(!e)return{};let r={},a=/\{\{(\w+)\}\}/g;for(;null!==(t=a.exec(e));){let e=t[1];r[e]||(r[e]=`example_${e}`)}return r})(o?.content),accessToken:r,version:er}),(0,_.jsx)(S.Button,{icon:CC.PencilIcon,variant:"primary",onClick:()=>n?.(c),className:"flex items-center",children:"Prompt Studio"}),a&&(0,_.jsx)(S.Button,{icon:jO.TrashIcon,variant:"secondary",onClick:()=>{g(!0)},className:"flex items-center",children:"Delete Prompt"})]})]})]}),v.length>0&&(0,_.jsx)("div",{className:"flex gap-2 mb-4",children:[...v].sort((e,t)=>{let r={development:0,staging:1,production:2};return(r[e]??99)-(r[t]??99)}).map(e=>(0,_.jsxs)("button",{onClick:()=>{k(e),L(null)},className:`px-4 py-2 rounded-lg text-sm font-medium transition-all ${w===e?"production"===e?"bg-red-100 text-red-800 border-2 border-red-300":"staging"===e?"bg-yellow-100 text-yellow-800 border-2 border-yellow-300":"bg-green-100 text-green-800 border-2 border-green-300":"bg-gray-100 text-gray-600 border-2 border-transparent hover:bg-gray-200"}`,children:[e,N.length>0&&w===e&&(0,_.jsxs)("span",{className:"ml-1 text-xs opacity-75",children:["(v",ea,")"]})]},e))}),es&&(0,_.jsxs)("div",{className:"mb-4 p-3 bg-amber-50 border border-amber-200 rounded-lg flex items-center justify-between",children:[(0,_.jsxs)(Z.Text,{className:"text-amber-800",children:["Viewing v",C," — not the latest version (v",ea,")"]}),(0,_.jsx)(S.Button,{variant:"light",size:"xs",onClick:()=>{let e=N.find(e=>e.version===ea);e&&G(e)},children:"Go to latest"})]}),(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)(rR.TabList,{className:"mb-4",children:[(0,_.jsx)(rY.Tab,{children:"Overview"},"overview"),o?(0,_.jsx)(rY.Tab,{children:"Prompt Template"},"prompt-template"):(0,_.jsx)(_.Fragment,{}),(0,_.jsx)(rY.Tab,{children:"Raw JSON"},"raw-json")]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsxs)(ee.Grid,{numItems:1,numItemsSm:2,numItemsLg:4,className:"gap-4",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Version"}),(0,_.jsxs)("div",{className:"mt-2",children:[(0,_.jsx)(X.Title,{children:er}),(0,_.jsxs)(tR.Badge,{color:"blue",className:"mt-1",children:["v",er]})]})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Prompt Type"}),(0,_.jsx)("div",{className:"mt-2",children:(0,_.jsx)(X.Title,{children:l.prompt_info?.prompt_type||"-"})})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Created By"}),(0,_.jsx)("div",{className:"mt-2",children:(0,_.jsx)(X.Title,{className:"text-sm",children:l.created_by||"-"})})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Created At"}),(0,_.jsxs)("div",{className:"mt-2",children:[(0,_.jsx)(X.Title,{className:"text-sm",children:U(l.created_at)}),(0,_.jsxs)(Z.Text,{className:"text-xs",children:["Updated: ",U(l.updated_at)]})]})]})]}),(0,_.jsxs)(P.Card,{className:"mt-6",children:[(0,_.jsxs)(X.Title,{className:"mb-3",children:["Version History — ",w]}),O?(0,_.jsx)(Z.Text,{children:"Loading versions..."}):N.length>0?(0,_.jsxs)(A.Table,{children:[(0,_.jsx)(Y.TableHead,{children:(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(F.TableHeaderCell,{children:"Version"}),(0,_.jsx)(F.TableHeaderCell,{children:"Created By"}),(0,_.jsx)(F.TableHeaderCell,{children:"Date"}),(0,_.jsx)(F.TableHeaderCell,{children:"Actions"})]})}),(0,_.jsx)(E.TableBody,{children:N.map(e=>{let t=e.version||1,r=t===C,a=t===ea;return(0,_.jsxs)(R.TableRow,{className:`cursor-pointer hover:bg-blue-50 transition-colors ${r?"bg-blue-50":""}`,onClick:()=>G(e),children:[(0,_.jsxs)(I.TableCell,{children:[(0,_.jsxs)("span",{className:r?"font-bold":"",children:["v",t]}),a&&(0,_.jsx)(tR.Badge,{color:"blue",className:"ml-2",size:"xs",children:"latest"})]}),(0,_.jsx)(I.TableCell,{children:(0,_.jsx)("span",{className:"text-sm",children:e.created_by||"-"})}),(0,_.jsx)(I.TableCell,{children:(0,_.jsx)("span",{className:"text-sm",children:U(e.created_at)})}),(0,_.jsx)(I.TableCell,{children:(0,_.jsx)(S.Button,{icon:CC.PencilIcon,variant:"light",size:"xs",onClick:t=>{t.stopPropagation();let a={prompt_spec:{...e,prompt_id:et,environment:w},raw_prompt_template:r?o:null};n?.(a)},children:"Edit"})})]},t)})})]}):(0,_.jsxs)(Z.Text,{className:"text-gray-400",children:["No versions found in ",w]})]})]}),o&&(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,_.jsx)(X.Title,{children:"Prompt Template"}),(0,_.jsx)(z.Button,{type:"text",size:"small",icon:h["prompt-content"]?(0,_.jsx)(M_.CheckIcon,{size:16}):(0,_.jsx)(Mb.CopyIcon,{size:16}),onClick:()=>W(o.content,"prompt-content"),className:`transition-all duration-200 ${h["prompt-content"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`,children:h["prompt-content"]?"Copied!":"Copy Content"})]}),(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Template ID"}),(0,_.jsx)("div",{className:"font-mono text-sm bg-gray-50 p-2 rounded",children:o.litellm_prompt_id})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Content"}),(0,_.jsx)("div",{className:"mt-2 p-4 bg-gray-50 rounded-md border overflow-auto max-h-96",children:(0,_.jsx)("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:o.content})})]}),o.metadata&&Object.keys(o.metadata).length>0&&(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Template Metadata"}),(0,_.jsx)("div",{className:"mt-2 p-3 bg-gray-50 rounded-md border",children:(0,_.jsx)("pre",{className:"text-xs text-gray-800 whitespace-pre-wrap overflow-auto max-h-64",children:JSON.stringify(o.metadata,null,2)})})]})]})]})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,_.jsx)(X.Title,{children:"Raw API Response"}),(0,_.jsx)(z.Button,{type:"text",size:"small",icon:h["raw-json"]?(0,_.jsx)(M_.CheckIcon,{size:16}):(0,_.jsx)(Mb.CopyIcon,{size:16}),onClick:()=>W(JSON.stringify(c,null,2),"raw-json"),className:`transition-all duration-200 ${h["raw-json"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`,children:h["raw-json"]?"Copied!":"Copy JSON"})]}),(0,_.jsx)("div",{className:"p-4 bg-gray-50 rounded-md border overflow-auto",children:(0,_.jsx)("pre",{className:"text-xs text-gray-800 whitespace-pre-wrap",children:JSON.stringify(c,null,2)})})]})})]})]}),(0,_.jsxs)(q.Modal,{title:"Delete Prompt",open:x,onOk:V,onCancel:()=>{g(!1)},confirmLoading:y,okText:"Delete",okButtonProps:{danger:!0},children:[(0,_.jsxs)("p",{children:["Are you sure you want to delete prompt: ",(0,_.jsx)("strong",{children:et}),"?"]}),(0,_.jsx)("p",{children:"This action cannot be undone."})]})]})},{Option:EU}=eE.Select,EW=({visible:e,onClose:t,accessToken:r,onSuccess:a})=>{let[s]=H.Form.useForm(),[n,l]=(0,T.useState)(!1),[i,o]=(0,T.useState)([]),[d,c]=(0,T.useState)("dotprompt"),u=()=>{s.resetFields(),o([]),c("dotprompt"),t()},m=async()=>{try{let e=await s.validateFields();if(console.log("values: ",e),!r)return void J.default.fromBackend("Access token is required");if("dotprompt"===d&&0===i.length)return void J.default.fromBackend("Please upload a .prompt file");l(!0);let t={};if("dotprompt"===d&&i.length>0){let a=i[0].originFileObj;try{let s=await (0,Q.convertPromptFileToJson)(r,a);console.log("Conversion result:",s),t={prompt_id:e.prompt_id,litellm_params:{prompt_integration:"dotprompt",prompt_id:s.prompt_id,prompt_data:s.json_data},prompt_info:{prompt_type:"db"}}}catch(e){console.error("Error converting prompt file:",e),J.default.fromBackend("Failed to convert prompt file to JSON"),l(!1);return}}try{await (0,Q.createPromptCall)(r,t),J.default.success("Prompt created successfully!"),u(),a()}catch(e){console.error("Error creating prompt:",e),J.default.fromBackend("Failed to create prompt")}}catch(e){console.error("Form validation error:",e)}finally{l(!1)}};return(0,_.jsx)(q.Modal,{title:"Add New Prompt",open:e,onCancel:u,footer:[(0,_.jsx)(z.Button,{onClick:u,children:"Cancel"},"cancel"),(0,_.jsx)(z.Button,{loading:n,onClick:m,children:"Create Prompt"},"submit")],width:600,children:(0,_.jsxs)(H.Form,{form:s,layout:"vertical",requiredMark:!1,children:[(0,_.jsx)(H.Form.Item,{label:"Prompt ID",name:"prompt_id",rules:[{required:!0,message:"Please enter a prompt ID"},{pattern:/^[a-zA-Z0-9_-]+$/,message:"Prompt ID can only contain letters, numbers, underscores, and hyphens"}],children:(0,_.jsx)(et.TextInput,{placeholder:"Enter unique prompt ID (e.g., my_prompt_id)"})}),(0,_.jsx)(H.Form.Item,{label:"Prompt Integration",name:"prompt_integration",initialValue:"dotprompt",children:(0,_.jsx)(eE.Select,{value:d,onChange:c,children:(0,_.jsx)(EU,{value:"dotprompt",children:"dotprompt"})})}),"dotprompt"===d&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(eG.Divider,{}),(0,_.jsxs)(H.Form.Item,{label:"Prompt File",extra:"Upload a .prompt file that follows the Dotprompt specification",children:[(0,_.jsx)(Tl.Upload,{...{beforeUpload:e=>(e.name.endsWith(".prompt")||J.default.fromBackend("Please upload a .prompt file"),!1),fileList:i,onChange:({fileList:e})=>{o(e.slice(-1))},onRemove:()=>{o([])}},children:(0,_.jsx)(z.Button,{icon:(0,_.jsx)(Ti.UploadOutlined,{}),children:"Select .prompt File"})}),i.length>0&&(0,_.jsxs)("div",{className:"mt-2 text-sm text-gray-600",children:["Selected: ",i[0].name]})]})]})]})})},EV=`{ +main();`}})())},[l,o,c,e,t,r]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(S.Button,{variant:"secondary",icon:wZ.CodeOutlined,onClick:()=>{i(!0)},children:"Get Code"}),(0,_.jsxs)(q.Modal,{title:"Generated Code",open:l,onCancel:()=>{i(!1)},footer:null,width:800,children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium block mb-1 text-gray-700",children:"Language"}),(0,_.jsx)(eE.Select,{value:o,onChange:e=>d(e),style:{width:180},options:[{value:"curl",label:"cURL"},{value:"python",label:"Python (OpenAI SDK)"},{value:"javascript",label:"JavaScript (OpenAI SDK)"}]})]}),(0,_.jsx)(z.Button,{onClick:()=>{navigator.clipboard.writeText(m),J.default.success("Copied to clipboard!")},children:"Copy to Clipboard"})]}),(0,_.jsx)(W.Tabs,{activeKey:c,onChange:u,items:[{label:"Basic",key:"basic"},{label:"With Messages",key:"messages"},{label:"With Version",key:"version"}]}),(0,_.jsx)(rJ.Prism,{language:"curl"===o?"bash":"python"===o?"python":"javascript",style:Eq.coy,wrapLines:!0,wrapLongLines:!0,className:"rounded-md mt-0",customStyle:{maxHeight:"60vh",overflowY:"auto",marginTop:0,borderTopLeftRadius:0,borderTopRightRadius:0},children:m})]})]})},EW=({promptId:e,onClose:t,accessToken:r,isAdmin:a,onDelete:s,onEdit:n})=>{let[l,i]=(0,T.useState)(null),[o,d]=(0,T.useState)(null),[c,u]=(0,T.useState)(null),[m,p]=(0,T.useState)(!0),[h,f]=(0,T.useState)({}),[x,g]=(0,T.useState)(!1),[y,b]=(0,T.useState)(!1),[v,j]=(0,T.useState)([]),[w,k]=(0,T.useState)(null),[N,M]=(0,T.useState)([]),[C,L]=(0,T.useState)(null),[O,D]=(0,T.useState)(!1),B=async t=>{try{if(p(!0),!r)return;let a=await (0,Q.getPromptInfo)(r,e,t);i(a.prompt_spec),d(a.raw_prompt_template),u(a),a.environments&&a.environments.length>0&&(j(a.environments),w||k(a.prompt_spec.environment||a.environments[0])),L(a.prompt_spec.version||null)}catch(e){J.default.fromBackend("Failed to load prompt information"),console.error("Error fetching prompt info:",e)}finally{p(!1)}},H=async t=>{if(r){D(!0);try{let a=await (0,Q.getPromptVersions)(r,e,t);M(a.prompts||[])}catch{M([])}finally{D(!1)}}},$=(0,T.useRef)(!0);if((0,T.useEffect)(()=>{k(null),j([]),M([]),B()},[e,r]),(0,T.useEffect)(()=>{if($.current){$.current=!1,w&&r&&H(w);return}w&&r&&(B(w),H(w))},[w]),m&&!l)return(0,_.jsx)("div",{className:"p-4",children:"Loading..."});if(!l)return(0,_.jsx)("div",{className:"p-4",children:"Prompt not found"});let U=e=>e?new Date(e).toLocaleString():"-",W=async(e,t)=>{await (0,rV.copyToClipboard)(e)&&(f(e=>({...e,[t]:!0})),setTimeout(()=>{f(e=>({...e,[t]:!1}))},2e3))},V=async()=>{if(r&&l){b(!0);try{await (0,Q.deletePromptCall)(r,et),J.default.success(`Prompt "${et}" deleted successfully`),s?.(),t()}catch(e){console.error("Error deleting prompt:",e),J.default.fromBackend("Failed to delete prompt")}finally{b(!1),g(!1)}}},G=async t=>{if(!r||!w)return;let a=t.version||1;L(a);try{let t=`${e}.v${a}`,s=await (0,Q.getPromptInfo)(r,t,w);i(s.prompt_spec),d(s.raw_prompt_template),u(s)}catch{J.default.fromBackend(`Failed to load version v${a}`)}},K=l&&EH(l)||"gpt-4o",et=Ez(l),er=(e=>{let t;if(e?.version)return String(e.version);var r=(t=Ez(e),e?.litellm_params?.prompt_id||t);if(!r)return"1";let a=r.match(/[._-]v(\d+)$/);return a?a[1]:"1"})(l),ea=N.length>0?Math.max(...N.map(e=>e.version||1)):null,es=null!==ea&&null!==C&&CW(et,"prompt-id"),className:`left-2 z-10 transition-all duration-200 ${h["prompt-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`})]})]}),(0,_.jsxs)("div",{className:"flex gap-2",children:[(0,_.jsx)(EU,{promptId:et,model:K,promptVariables:(e=>{let t;if(!e)return{};let r={},a=/\{\{(\w+)\}\}/g;for(;null!==(t=a.exec(e));){let e=t[1];r[e]||(r[e]=`example_${e}`)}return r})(o?.content),accessToken:r,version:er}),(0,_.jsx)(S.Button,{icon:CC.PencilIcon,variant:"primary",onClick:()=>n?.(c),className:"flex items-center",children:"Prompt Studio"}),a&&(0,_.jsx)(S.Button,{icon:jO.TrashIcon,variant:"secondary",onClick:()=>{g(!0)},className:"flex items-center",children:"Delete Prompt"})]})]})]}),v.length>0&&(0,_.jsx)("div",{className:"flex gap-2 mb-4",children:[...v].sort((e,t)=>{let r={development:0,staging:1,production:2};return(r[e]??99)-(r[t]??99)}).map(e=>(0,_.jsxs)("button",{onClick:()=>{k(e),L(null)},className:`px-4 py-2 rounded-lg text-sm font-medium transition-all ${w===e?"production"===e?"bg-red-100 text-red-800 border-2 border-red-300":"staging"===e?"bg-yellow-100 text-yellow-800 border-2 border-yellow-300":"bg-green-100 text-green-800 border-2 border-green-300":"bg-gray-100 text-gray-600 border-2 border-transparent hover:bg-gray-200"}`,children:[e,N.length>0&&w===e&&(0,_.jsxs)("span",{className:"ml-1 text-xs opacity-75",children:["(v",ea,")"]})]},e))}),es&&(0,_.jsxs)("div",{className:"mb-4 p-3 bg-amber-50 border border-amber-200 rounded-lg flex items-center justify-between",children:[(0,_.jsxs)(Z.Text,{className:"text-amber-800",children:["Viewing v",C," — not the latest version (v",ea,")"]}),(0,_.jsx)(S.Button,{variant:"light",size:"xs",onClick:()=>{let e=N.find(e=>e.version===ea);e&&G(e)},children:"Go to latest"})]}),(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)(rR.TabList,{className:"mb-4",children:[(0,_.jsx)(rY.Tab,{children:"Overview"},"overview"),o?(0,_.jsx)(rY.Tab,{children:"Prompt Template"},"prompt-template"):(0,_.jsx)(_.Fragment,{}),(0,_.jsx)(rY.Tab,{children:"Raw JSON"},"raw-json")]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsxs)(ee.Grid,{numItems:1,numItemsSm:2,numItemsLg:4,className:"gap-4",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Version"}),(0,_.jsxs)("div",{className:"mt-2",children:[(0,_.jsx)(X.Title,{children:er}),(0,_.jsxs)(tR.Badge,{color:"blue",className:"mt-1",children:["v",er]})]})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Prompt Type"}),(0,_.jsx)("div",{className:"mt-2",children:(0,_.jsx)(X.Title,{children:l.prompt_info?.prompt_type||"-"})})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Created By"}),(0,_.jsx)("div",{className:"mt-2",children:(0,_.jsx)(X.Title,{className:"text-sm",children:l.created_by||"-"})})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Created At"}),(0,_.jsxs)("div",{className:"mt-2",children:[(0,_.jsx)(X.Title,{className:"text-sm",children:U(l.created_at)}),(0,_.jsxs)(Z.Text,{className:"text-xs",children:["Updated: ",U(l.updated_at)]})]})]})]}),(0,_.jsxs)(P.Card,{className:"mt-6",children:[(0,_.jsxs)(X.Title,{className:"mb-3",children:["Version History — ",w]}),O?(0,_.jsx)(Z.Text,{children:"Loading versions..."}):N.length>0?(0,_.jsxs)(A.Table,{children:[(0,_.jsx)(Y.TableHead,{children:(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(F.TableHeaderCell,{children:"Version"}),(0,_.jsx)(F.TableHeaderCell,{children:"Created By"}),(0,_.jsx)(F.TableHeaderCell,{children:"Date"}),(0,_.jsx)(F.TableHeaderCell,{children:"Actions"})]})}),(0,_.jsx)(E.TableBody,{children:N.map(e=>{let t=e.version||1,r=t===C,a=t===ea;return(0,_.jsxs)(R.TableRow,{className:`cursor-pointer hover:bg-blue-50 transition-colors ${r?"bg-blue-50":""}`,onClick:()=>G(e),children:[(0,_.jsxs)(I.TableCell,{children:[(0,_.jsxs)("span",{className:r?"font-bold":"",children:["v",t]}),a&&(0,_.jsx)(tR.Badge,{color:"blue",className:"ml-2",size:"xs",children:"latest"})]}),(0,_.jsx)(I.TableCell,{children:(0,_.jsx)("span",{className:"text-sm",children:e.created_by||"-"})}),(0,_.jsx)(I.TableCell,{children:(0,_.jsx)("span",{className:"text-sm",children:U(e.created_at)})}),(0,_.jsx)(I.TableCell,{children:(0,_.jsx)(S.Button,{icon:CC.PencilIcon,variant:"light",size:"xs",onClick:t=>{t.stopPropagation();let a={prompt_spec:{...e,prompt_id:et,environment:w},raw_prompt_template:r?o:null};n?.(a)},children:"Edit"})})]},t)})})]}):(0,_.jsxs)(Z.Text,{className:"text-gray-400",children:["No versions found in ",w]})]})]}),o&&(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,_.jsx)(X.Title,{children:"Prompt Template"}),(0,_.jsx)(z.Button,{type:"text",size:"small",icon:h["prompt-content"]?(0,_.jsx)(M_.CheckIcon,{size:16}):(0,_.jsx)(Mb.CopyIcon,{size:16}),onClick:()=>W(o.content,"prompt-content"),className:`transition-all duration-200 ${h["prompt-content"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`,children:h["prompt-content"]?"Copied!":"Copy Content"})]}),(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Template ID"}),(0,_.jsx)("div",{className:"font-mono text-sm bg-gray-50 p-2 rounded",children:o.litellm_prompt_id})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Content"}),(0,_.jsx)("div",{className:"mt-2 p-4 bg-gray-50 rounded-md border overflow-auto max-h-96",children:(0,_.jsx)("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:o.content})})]}),o.metadata&&Object.keys(o.metadata).length>0&&(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Template Metadata"}),(0,_.jsx)("div",{className:"mt-2 p-3 bg-gray-50 rounded-md border",children:(0,_.jsx)("pre",{className:"text-xs text-gray-800 whitespace-pre-wrap overflow-auto max-h-64",children:JSON.stringify(o.metadata,null,2)})})]})]})]})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,_.jsx)(X.Title,{children:"Raw API Response"}),(0,_.jsx)(z.Button,{type:"text",size:"small",icon:h["raw-json"]?(0,_.jsx)(M_.CheckIcon,{size:16}):(0,_.jsx)(Mb.CopyIcon,{size:16}),onClick:()=>W(JSON.stringify(c,null,2),"raw-json"),className:`transition-all duration-200 ${h["raw-json"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`,children:h["raw-json"]?"Copied!":"Copy JSON"})]}),(0,_.jsx)("div",{className:"p-4 bg-gray-50 rounded-md border overflow-auto",children:(0,_.jsx)("pre",{className:"text-xs text-gray-800 whitespace-pre-wrap",children:JSON.stringify(c,null,2)})})]})})]})]}),(0,_.jsxs)(q.Modal,{title:"Delete Prompt",open:x,onOk:V,onCancel:()=>{g(!1)},confirmLoading:y,okText:"Delete",okButtonProps:{danger:!0},children:[(0,_.jsxs)("p",{children:["Are you sure you want to delete prompt: ",(0,_.jsx)("strong",{children:et}),"?"]}),(0,_.jsx)("p",{children:"This action cannot be undone."})]})]})},{Option:EV}=eE.Select,EG=({visible:e,onClose:t,accessToken:r,onSuccess:a})=>{let[s]=H.Form.useForm(),[n,l]=(0,T.useState)(!1),[i,o]=(0,T.useState)([]),[d,c]=(0,T.useState)("dotprompt"),u=()=>{s.resetFields(),o([]),c("dotprompt"),t()},m=async()=>{try{let e=await s.validateFields();if(console.log("values: ",e),!r)return void J.default.fromBackend("Access token is required");if("dotprompt"===d&&0===i.length)return void J.default.fromBackend("Please upload a .prompt file");l(!0);let t={};if("dotprompt"===d&&i.length>0){let a=i[0].originFileObj;try{let s=await (0,Q.convertPromptFileToJson)(r,a);console.log("Conversion result:",s),t={prompt_id:e.prompt_id,litellm_params:{prompt_integration:"dotprompt",prompt_id:s.prompt_id,prompt_data:s.json_data},prompt_info:{prompt_type:"db"}}}catch(e){console.error("Error converting prompt file:",e),J.default.fromBackend("Failed to convert prompt file to JSON"),l(!1);return}}try{await (0,Q.createPromptCall)(r,t),J.default.success("Prompt created successfully!"),u(),a()}catch(e){console.error("Error creating prompt:",e),J.default.fromBackend("Failed to create prompt")}}catch(e){console.error("Form validation error:",e)}finally{l(!1)}};return(0,_.jsx)(q.Modal,{title:"Add New Prompt",open:e,onCancel:u,footer:[(0,_.jsx)(z.Button,{onClick:u,children:"Cancel"},"cancel"),(0,_.jsx)(z.Button,{loading:n,onClick:m,children:"Create Prompt"},"submit")],width:600,children:(0,_.jsxs)(H.Form,{form:s,layout:"vertical",requiredMark:!1,children:[(0,_.jsx)(H.Form.Item,{label:"Prompt ID",name:"prompt_id",rules:[{required:!0,message:"Please enter a prompt ID"},{pattern:/^[a-zA-Z0-9_-]+$/,message:"Prompt ID can only contain letters, numbers, underscores, and hyphens"}],children:(0,_.jsx)(et.TextInput,{placeholder:"Enter unique prompt ID (e.g., my_prompt_id)"})}),(0,_.jsx)(H.Form.Item,{label:"Prompt Integration",name:"prompt_integration",initialValue:"dotprompt",children:(0,_.jsx)(eE.Select,{value:d,onChange:c,children:(0,_.jsx)(EV,{value:"dotprompt",children:"dotprompt"})})}),"dotprompt"===d&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(eG.Divider,{}),(0,_.jsxs)(H.Form.Item,{label:"Prompt File",extra:"Upload a .prompt file that follows the Dotprompt specification",children:[(0,_.jsx)(Tl.Upload,{...{beforeUpload:e=>(e.name.endsWith(".prompt")||J.default.fromBackend("Please upload a .prompt file"),!1),fileList:i,onChange:({fileList:e})=>{o(e.slice(-1))},onRemove:()=>{o([])}},children:(0,_.jsx)(z.Button,{icon:(0,_.jsx)(Ti.UploadOutlined,{}),children:"Select .prompt File"})}),i.length>0&&(0,_.jsxs)("div",{className:"mt-2 text-sm text-gray-600",children:["Selected: ",i[0].name]})]})]})]})})},EK=`{ "type": "function", "function": { "name": "get_current_weather", @@ -631,7 +631,7 @@ main();`}})())},[l,o,c,e,t,r]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(S.Butt "required": ["location"] } } -}`,EG=({visible:e,initialJson:t,onSave:r,onClose:a})=>{let[s,n]=(0,T.useState)(t||EV),[l,i]=(0,T.useState)(null),o=()=>{i(null),a()};return(0,_.jsx)(q.Modal,{title:(0,_.jsx)("div",{className:"flex items-center justify-between",children:(0,_.jsx)("span",{className:"text-lg font-medium",children:"Add Tool"})}),open:e,onCancel:o,width:800,footer:[(0,_.jsx)(z.Button,{onClick:o,children:"Cancel"},"cancel"),(0,_.jsx)(z.Button,{type:"primary",onClick:()=>{try{JSON.parse(s),i(null),r(s)}catch(e){i("Invalid JSON format. Please check your syntax.")}},children:"Add"},"save")],children:(0,_.jsxs)("div",{className:"space-y-3",children:[l&&(0,_.jsx)("div",{className:"p-3 bg-red-50 border border-red-200 rounded text-red-600 text-sm",children:l}),(0,_.jsx)("textarea",{value:s,onChange:e=>n(e.target.value),className:"w-full min-h-[400px] px-4 py-3 border border-gray-300 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none",placeholder:"Paste your tool JSON here..."})]})})},EK=(0,eT.default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),EJ=(0,eT.default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),EQ=(0,eT.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]),EX=({promptName:e,onNameChange:t,onBack:r,onSave:a,isSaving:s,editMode:n=!1,onShowHistory:l,version:i,promptModel:o="gpt-4o",promptVariables:d={},accessToken:c,proxySettings:u,environment:m,onEnvironmentChange:p})=>(0,_.jsxs)("div",{className:"bg-white border-b border-gray-200 px-6 py-3 flex items-center justify-between",children:[(0,_.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,_.jsx)(S.Button,{icon:EK,variant:"light",onClick:r,size:"xs",children:"Back"}),(0,_.jsx)($.Input,{value:e,onChange:e=>t(e.target.value),className:"text-base font-medium border-none shadow-none",style:{width:"200px"}}),i&&(0,_.jsx)("span",{className:"px-2 py-0.5 text-xs bg-blue-100 text-blue-700 rounded font-medium",children:i}),(0,_.jsx)(eE.Select,{value:m,onChange:p,style:{width:140},size:"small",options:[{label:"Development",value:"development"},{label:"Staging",value:"staging"},{label:"Production",value:"production"}]}),(0,_.jsx)("span",{className:"px-2 py-0.5 text-xs bg-gray-100 text-gray-600 rounded",children:"Draft"}),(0,_.jsx)("span",{className:"text-xs text-gray-400",children:"Unsaved changes"})]}),(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)(E$,{promptId:e,model:o,promptVariables:d,accessToken:c,version:i?.replace("v","")||"1",proxySettings:u}),n&&l&&(0,_.jsx)(S.Button,{icon:EQ,variant:"secondary",onClick:l,children:"History"}),(0,_.jsx)(S.Button,{icon:EJ,onClick:a,loading:s,disabled:s,children:n?"Update":"Save"})]})]});var LL=LL;let EZ=({model:e,temperature:t=1,maxTokens:r=1e3,accessToken:a,onModelChange:s,onTemperatureChange:n,onMaxTokensChange:l})=>{let[i,o]=(0,T.useState)(!1);return(0,_.jsxs)("div",{className:"flex items-center gap-3",children:[(0,_.jsx)("div",{className:"w-[300px]",children:(0,_.jsx)(O7.default,{accessToken:a||"",value:e,onChange:s,showLabel:!1})}),(0,_.jsxs)("button",{onClick:()=>o(!i),className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50",children:[(0,_.jsx)(LL.default,{size:16}),(0,_.jsx)("span",{children:"Parameters"})]}),i&&(0,_.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-30",children:(0,_.jsxs)("div",{className:"bg-white rounded-lg shadow-xl p-6 w-96",children:[(0,_.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,_.jsx)("h3",{className:"text-lg font-semibold",children:"Model Parameters"}),(0,_.jsx)("button",{onClick:()=>o(!1),className:"text-gray-400 hover:text-gray-600",children:"✕"})]}),(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsx)("div",{children:(0,_.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,_.jsx)(Z.Text,{className:"text-sm text-gray-700",children:"Temperature"}),(0,_.jsx)($.Input,{type:"number",size:"small",min:0,max:2,step:.1,value:t,onChange:e=>n(parseFloat(e.target.value)||0),className:"w-20"})]})}),(0,_.jsx)("div",{children:(0,_.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,_.jsx)(Z.Text,{className:"text-sm text-gray-700",children:"Max Tokens"}),(0,_.jsx)($.Input,{type:"number",size:"small",min:1,max:32768,value:r,onChange:e=>l(parseInt(e.target.value)||1e3),className:"w-24"})]})})]})]})})]})};var Ci=Ci;let E0=(0,eT.default)("trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]),E1=({tools:e,onAddTool:t,onEditTool:r,onRemoveTool:a})=>(0,_.jsxs)(P.Card,{className:"p-3",children:[(0,_.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium",children:"Tools"}),(0,_.jsxs)("button",{onClick:t,className:"text-xs text-blue-600 hover:text-blue-700 flex items-center",children:[(0,_.jsx)(Ci.default,{size:14,className:"mr-1"}),"Add"]})]}),0===e.length?(0,_.jsx)(Z.Text,{className:"text-gray-500 text-xs",children:"No tools added"}):(0,_.jsx)("div",{className:"space-y-2",children:e.map((e,t)=>(0,_.jsxs)("div",{className:"flex items-center justify-between p-2 bg-gray-50 border border-gray-200 rounded",children:[(0,_.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,_.jsx)("div",{className:"font-medium text-xs truncate",children:e.name}),(0,_.jsx)("div",{className:"text-xs text-gray-500 truncate",children:e.description})]}),(0,_.jsxs)("div",{className:"flex items-center space-x-1 ml-2",children:[(0,_.jsx)("button",{onClick:()=>r(t),className:"text-xs text-blue-600 hover:text-blue-700",children:"Edit"}),(0,_.jsx)("button",{onClick:()=>a(t),className:"text-gray-400 hover:text-red-500",children:(0,_.jsx)(E0,{size:14})})]})]},t))})]}),{TextArea:E2}=$.Input,E4=({value:e,onChange:t,placeholder:r,rows:a=4,className:s})=>{let[n,l]=(0,T.useState)(null),[i,o]=(0,T.useState)(""),d=()=>{i.trim()&&n&&(t(e.substring(0,n.start)+`{{${i}}}`+e.substring(n.end)),l(null),o(""))},c=(()=>{let t,r=/\{\{(\w+)\}\}/g,a=[];for(;null!==(t=r.exec(e));)a.push({name:t[1],start:t.index,end:t.index+t[0].length});return a})();return(0,_.jsxs)("div",{className:`variable-textarea-container ${s}`,children:[(0,_.jsx)("style",{children:` +}`,EJ=({visible:e,initialJson:t,onSave:r,onClose:a})=>{let[s,n]=(0,T.useState)(t||EK),[l,i]=(0,T.useState)(null),o=()=>{i(null),a()};return(0,_.jsx)(q.Modal,{title:(0,_.jsx)("div",{className:"flex items-center justify-between",children:(0,_.jsx)("span",{className:"text-lg font-medium",children:"Add Tool"})}),open:e,onCancel:o,width:800,footer:[(0,_.jsx)(z.Button,{onClick:o,children:"Cancel"},"cancel"),(0,_.jsx)(z.Button,{type:"primary",onClick:()=>{try{JSON.parse(s),i(null),r(s)}catch(e){i("Invalid JSON format. Please check your syntax.")}},children:"Add"},"save")],children:(0,_.jsxs)("div",{className:"space-y-3",children:[l&&(0,_.jsx)("div",{className:"p-3 bg-red-50 border border-red-200 rounded text-red-600 text-sm",children:l}),(0,_.jsx)("textarea",{value:s,onChange:e=>n(e.target.value),className:"w-full min-h-[400px] px-4 py-3 border border-gray-300 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none",placeholder:"Paste your tool JSON here..."})]})})},EQ=(0,eT.default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),EX=(0,eT.default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),EZ=(0,eT.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]),E0=({promptName:e,onNameChange:t,onBack:r,onSave:a,isSaving:s,editMode:n=!1,onShowHistory:l,version:i,promptModel:o="gpt-4o",promptVariables:d={},accessToken:c,proxySettings:u,environment:m,onEnvironmentChange:p})=>(0,_.jsxs)("div",{className:"bg-white border-b border-gray-200 px-6 py-3 flex items-center justify-between",children:[(0,_.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,_.jsx)(S.Button,{icon:EQ,variant:"light",onClick:r,size:"xs",children:"Back"}),(0,_.jsx)($.Input,{value:e,onChange:e=>t(e.target.value),className:"text-base font-medium border-none shadow-none",style:{width:"200px"}}),i&&(0,_.jsx)("span",{className:"px-2 py-0.5 text-xs bg-blue-100 text-blue-700 rounded font-medium",children:i}),(0,_.jsx)(eE.Select,{value:m,onChange:p,style:{width:140},size:"small",options:[{label:"Development",value:"development"},{label:"Staging",value:"staging"},{label:"Production",value:"production"}]}),(0,_.jsx)("span",{className:"px-2 py-0.5 text-xs bg-gray-100 text-gray-600 rounded",children:"Draft"}),(0,_.jsx)("span",{className:"text-xs text-gray-400",children:"Unsaved changes"})]}),(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)(EU,{promptId:e,model:o,promptVariables:d,accessToken:c,version:i?.replace("v","")||"1",proxySettings:u}),n&&l&&(0,_.jsx)(S.Button,{icon:EZ,variant:"secondary",onClick:l,children:"History"}),(0,_.jsx)(S.Button,{icon:EX,onClick:a,loading:s,disabled:s,children:n?"Update":"Save"})]})]});var LL=LL;let E1=({model:e,temperature:t=1,maxTokens:r=1e3,accessToken:a,onModelChange:s,onTemperatureChange:n,onMaxTokensChange:l})=>{let[i,o]=(0,T.useState)(!1);return(0,_.jsxs)("div",{className:"flex items-center gap-3",children:[(0,_.jsx)("div",{className:"w-[300px]",children:(0,_.jsx)(O9.default,{accessToken:a||"",value:e,onChange:s,showLabel:!1})}),(0,_.jsxs)("button",{onClick:()=>o(!i),className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50",children:[(0,_.jsx)(LL.default,{size:16}),(0,_.jsx)("span",{children:"Parameters"})]}),i&&(0,_.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-30",children:(0,_.jsxs)("div",{className:"bg-white rounded-lg shadow-xl p-6 w-96",children:[(0,_.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,_.jsx)("h3",{className:"text-lg font-semibold",children:"Model Parameters"}),(0,_.jsx)("button",{onClick:()=>o(!1),className:"text-gray-400 hover:text-gray-600",children:"✕"})]}),(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsx)("div",{children:(0,_.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,_.jsx)(Z.Text,{className:"text-sm text-gray-700",children:"Temperature"}),(0,_.jsx)($.Input,{type:"number",size:"small",min:0,max:2,step:.1,value:t,onChange:e=>n(parseFloat(e.target.value)||0),className:"w-20"})]})}),(0,_.jsx)("div",{children:(0,_.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,_.jsx)(Z.Text,{className:"text-sm text-gray-700",children:"Max Tokens"}),(0,_.jsx)($.Input,{type:"number",size:"small",min:1,max:32768,value:r,onChange:e=>l(parseInt(e.target.value)||1e3),className:"w-24"})]})})]})]})})]})};var Ci=Ci;let E2=(0,eT.default)("trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]),E4=({tools:e,onAddTool:t,onEditTool:r,onRemoveTool:a})=>(0,_.jsxs)(P.Card,{className:"p-3",children:[(0,_.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium",children:"Tools"}),(0,_.jsxs)("button",{onClick:t,className:"text-xs text-blue-600 hover:text-blue-700 flex items-center",children:[(0,_.jsx)(Ci.default,{size:14,className:"mr-1"}),"Add"]})]}),0===e.length?(0,_.jsx)(Z.Text,{className:"text-gray-500 text-xs",children:"No tools added"}):(0,_.jsx)("div",{className:"space-y-2",children:e.map((e,t)=>(0,_.jsxs)("div",{className:"flex items-center justify-between p-2 bg-gray-50 border border-gray-200 rounded",children:[(0,_.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,_.jsx)("div",{className:"font-medium text-xs truncate",children:e.name}),(0,_.jsx)("div",{className:"text-xs text-gray-500 truncate",children:e.description})]}),(0,_.jsxs)("div",{className:"flex items-center space-x-1 ml-2",children:[(0,_.jsx)("button",{onClick:()=>r(t),className:"text-xs text-blue-600 hover:text-blue-700",children:"Edit"}),(0,_.jsx)("button",{onClick:()=>a(t),className:"text-gray-400 hover:text-red-500",children:(0,_.jsx)(E2,{size:14})})]})]},t))})]}),{TextArea:E5}=$.Input,E6=({value:e,onChange:t,placeholder:r,rows:a=4,className:s})=>{let[n,l]=(0,T.useState)(null),[i,o]=(0,T.useState)(""),d=()=>{i.trim()&&n&&(t(e.substring(0,n.start)+`{{${i}}}`+e.substring(n.end)),l(null),o(""))},c=(()=>{let t,r=/\{\{(\w+)\}\}/g,a=[];for(;null!==(t=r.exec(e));)a.push({name:t[1],start:t.index,end:t.index+t[0].length});return a})();return(0,_.jsxs)("div",{className:`variable-textarea-container ${s}`,children:[(0,_.jsx)("style",{children:` .variable-highlight-text { color: #f97316; background-color: #fff7ed; @@ -640,7 +640,7 @@ main();`}})())},[l,o,c,e,t,r]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(S.Butt border: 1px solid #fed7aa; font-family: monospace; } - `}),(0,_.jsx)(E2,{value:e,onChange:e=>t(e.target.value),placeholder:r,rows:a,className:"font-sans"}),c.length>0&&(0,_.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2 items-center",children:[(0,_.jsx)("span",{className:"text-xs text-gray-500 mr-1",children:"Detected variables:"}),c.map((e,t)=>(0,_.jsx)(La.Popover,{content:(0,_.jsxs)("div",{className:"p-2",style:{minWidth:"200px"},children:[(0,_.jsx)("div",{className:"text-xs text-gray-500 mb-2",children:"Edit variable name"}),(0,_.jsx)($.Input,{size:"small",value:i,onChange:e=>o(e.target.value),onPressEnter:d,placeholder:"Variable name",autoFocus:!0}),(0,_.jsxs)("div",{className:"flex gap-2 mt-2",children:[(0,_.jsx)("button",{onClick:d,className:"text-xs px-2 py-1 bg-blue-500 text-white rounded hover:bg-blue-600",children:"Save"}),(0,_.jsx)("button",{onClick:()=>{l(null),o("")},className:"text-xs px-2 py-1 bg-gray-200 text-gray-700 rounded hover:bg-gray-300",children:"Cancel"})]})]}),open:n?.start===e.start,onOpenChange:e=>{e||(l(null),o(""))},trigger:"click",children:(0,_.jsx)(eN.Tag,{color:"orange",className:"cursor-pointer hover:opacity-80 transition-all m-0",icon:(0,_.jsx)(wX.EditOutlined,{}),onClick:()=>{l({oldName:e.name,start:e.start,end:e.end}),o(e.name)},children:e.name})},`${e.start}-${t}`))]})]})},E5=({value:e,onChange:t})=>(0,_.jsxs)(P.Card,{className:"p-3",children:[(0,_.jsx)(Z.Text,{className:"block mb-2 text-sm font-medium",children:"Developer message"}),(0,_.jsx)(Z.Text,{className:"text-gray-500 text-xs mb-2",children:"Optional system instructions for the model"}),(0,_.jsx)(E4,{value:e,onChange:t,rows:3,placeholder:"e.g., You are a helpful assistant..."})]});var Ci=Ci;let E6=(0,eT.default)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),{Option:E3}=eE.Select,E8=({messages:e,onAddMessage:t,onUpdateMessage:r,onRemoveMessage:a,onMoveMessage:s})=>{let[n,l]=(0,T.useState)(null),[i,o]=(0,T.useState)(null),d=()=>{l(null),o(null)};return(0,_.jsxs)(P.Card,{className:"p-3",children:[(0,_.jsxs)("div",{className:"mb-2",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium",children:"Prompt messages"}),(0,_.jsxs)(Z.Text,{className:"text-gray-500 text-xs mt-1",children:["Use ",(0,_.jsx)("code",{className:"bg-gray-100 px-1 rounded text-xs",children:"{{variable}}"})," syntax for template variables"]})]}),(0,_.jsx)("div",{className:"space-y-2",children:e.map((t,c)=>(0,_.jsxs)("div",{draggable:!0,onDragStart:()=>{l(c)},onDragOver:e=>{e.preventDefault(),o(c)},onDrop:e=>{e.preventDefault(),null!==n&&n!==c&&s(n,c),l(null),o(null)},onDragEnd:d,className:`border border-gray-300 rounded overflow-hidden bg-white transition-all ${n===c?"opacity-50":""} ${i===c&&n!==c?"border-blue-500 border-2":""}`,children:[(0,_.jsxs)("div",{className:"bg-gray-50 px-2 py-1.5 border-b border-gray-300 flex items-center justify-between",children:[(0,_.jsxs)(eE.Select,{value:t.role,onChange:e=>r(c,"role",e),style:{width:100},size:"small",bordered:!1,children:[(0,_.jsx)(E3,{value:"user",children:"User"}),(0,_.jsx)(E3,{value:"assistant",children:"Assistant"}),(0,_.jsx)(E3,{value:"system",children:"System"})]}),(0,_.jsxs)("div",{className:"flex items-center gap-1",children:[e.length>1&&(0,_.jsx)("button",{onClick:()=>a(c),className:"text-gray-400 hover:text-red-500",children:(0,_.jsx)(E0,{size:14})}),(0,_.jsx)("div",{className:"cursor-grab active:cursor-grabbing text-gray-400 hover:text-gray-600",children:(0,_.jsx)(E6,{size:16})})]})]}),(0,_.jsx)("div",{className:"p-2",children:(0,_.jsx)(E4,{value:t.content,onChange:e=>r(c,"content",e),rows:3,placeholder:"Enter prompt content..."})})]},c))}),(0,_.jsxs)("button",{onClick:t,className:"mt-2 text-xs text-blue-600 hover:text-blue-700 flex items-center",children:[(0,_.jsx)(Ci.default,{size:14,className:"mr-1"}),"Add message"]})]})};var E7=e.i(447593);let E9=({extractedVariables:e,variables:t,onVariableChange:r})=>0===e.length?null:(0,_.jsxs)("div",{className:"p-4 border-b border-gray-200 bg-blue-50",children:[(0,_.jsx)("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Fill in template variables to start testing"}),(0,_.jsx)("div",{className:"space-y-2",children:e.map(e=>(0,_.jsxs)("div",{children:[(0,_.jsxs)("label",{className:"block text-xs text-gray-600 mb-1 font-medium",children:["{{",e,"}}"]}),(0,_.jsx)($.Input,{value:t[e]||"",onChange:t=>r(e,t.target.value),placeholder:`Enter value for ${e}`,size:"small"})]},e))})]}),Ie=({hasVariables:e})=>(0,_.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,_.jsx)(tV.RobotOutlined,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,_.jsx)("span",{className:"text-base",children:e?"Fill in the variables above, then type a message to start testing":"Type a message below to start testing your prompt"})]});var It=e.i(989022);let Ir=({message:e})=>(0,_.jsx)("div",{className:`mb-4 flex ${"user"===e.role?"justify-end":"justify-start"}`,children:(0,_.jsxs)("div",{className:"max-w-[85%] rounded-lg shadow-sm p-3.5 px-4",style:{backgroundColor:"user"===e.role?"#f0f8ff":"#ffffff",border:"user"===e.role?"1px solid #e6f0fa":"1px solid #f0f0f0"},children:[(0,_.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,_.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-1",style:{backgroundColor:"user"===e.role?"#e6f0fa":"#f5f5f5"},children:"user"===e.role?(0,_.jsx)(A3.UserOutlined,{style:{fontSize:"12px",color:"#2563eb"}}):(0,_.jsx)(tV.RobotOutlined,{style:{fontSize:"12px",color:"#4b5563"}})}),(0,_.jsx)("strong",{className:"text-sm capitalize",children:e.role}),"assistant"===e.role&&e.model&&(0,_.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-gray-100 text-gray-600 font-normal",children:e.model})]}),(0,_.jsxs)("div",{className:"whitespace-pre-wrap break-words max-w-full message-content",style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",hyphens:"auto"},children:["assistant"===e.role?(0,_.jsx)(AW.default,{components:{code({node:e,inline:t,className:r,children:a,...s}){let n=/language-(\w+)/.exec(r||"");return!t&&n?(0,_.jsx)(rJ.Prism,{style:EH.coy,language:n[1],PreTag:"div",className:"rounded-md my-2",wrapLines:!0,wrapLongLines:!0,...s,children:String(a).replace(/\n$/,"")}):(0,_.jsx)("code",{className:`${r} px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono`,style:{wordBreak:"break-word"},...s,children:a})},pre:({node:e,...t})=>(0,_.jsx)("pre",{style:{overflowX:"auto",maxWidth:"100%"},...t})},children:e.content}):(0,_.jsx)("div",{className:"whitespace-pre-wrap",children:e.content}),"assistant"===e.role&&(e.timeToFirstToken||e.totalLatency||e.usage)&&(0,_.jsx)(It.default,{timeToFirstToken:e.timeToFirstToken,totalLatency:e.totalLatency,usage:e.usage})]})]})}),Ia=({messages:e,isLoading:t,hasVariables:r,messagesEndRef:a})=>{let s=(0,_.jsx)(wo.LoadingOutlined,{style:{fontSize:24},spin:!0});return(0,_.jsxs)("div",{className:"flex-1 overflow-y-auto p-4 pb-0",children:[0===e.length&&(0,_.jsx)(Ie,{hasVariables:r}),e.map((e,t)=>(0,_.jsx)(Ir,{message:e},t)),t&&(0,_.jsx)("div",{className:"flex justify-center items-center my-4",children:(0,_.jsx)(rm.Spin,{indicator:s})}),(0,_.jsx)("div",{ref:a,style:{height:"1px"}})]})},Is=({extractedVariables:e,variables:t})=>{let r=e.filter(e=>!t[e]||""===t[e].trim());return 0===r.length?null:(0,_.jsx)("div",{className:"mb-3 p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,_.jsxs)("div",{className:"flex items-start gap-2",children:[(0,_.jsx)("span",{className:"text-yellow-600 text-sm",children:"⚠️"}),(0,_.jsxs)("div",{className:"flex-1",children:[(0,_.jsx)("p",{className:"text-sm text-yellow-800 font-medium mb-1",children:"Please fill in all template variables above"}),(0,_.jsxs)("p",{className:"text-xs text-yellow-700",children:["Missing: ",r.map(e=>`{{${e}}}`).join(", ")]})]})]})})};var In=e.i(132104);let{TextArea:Il}=$.Input,Ii=({inputMessage:e,isLoading:t,isDisabled:r,onInputChange:a,onSend:s,onKeyDown:n,onCancel:l})=>(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsxs)("div",{className:"flex items-center flex-1 bg-white border border-gray-300 rounded-xl px-3 py-1 min-h-[44px]",children:[(0,_.jsx)(Il,{value:e,onChange:e=>a(e.target.value),onKeyDown:n,placeholder:"Type your message... (Shift+Enter for new line)",disabled:t,className:"flex-1",autoSize:{minRows:1,maxRows:4},style:{resize:"none",border:"none",boxShadow:"none",background:"transparent",padding:"4px 0",fontSize:"14px",lineHeight:"20px"}}),(0,_.jsx)(S.Button,{onClick:s,disabled:r,className:"flex-shrink-0 ml-2 !w-8 !h-8 !min-w-8 !p-0 !rounded-full !bg-blue-600 hover:!bg-blue-700 disabled:!bg-gray-300 !border-none !text-white disabled:!text-gray-500 !flex !items-center !justify-center",children:(0,_.jsx)(In.ArrowUpOutlined,{style:{fontSize:"14px"}})})]}),t&&(0,_.jsx)(S.Button,{onClick:l,className:"bg-red-50 hover:bg-red-100 text-red-600 border-red-200",children:"Cancel"})]}),Io=({prompt:e,accessToken:t})=>{let{isLoading:r,messages:a,inputMessage:s,variables:n,variablesFilled:l,extractedVariables:i,allVariablesFilled:o,messagesEndRef:d,setInputMessage:c,handleSendMessage:u,handleCancelRequest:m,handleClearConversation:p,handleKeyDown:h,handleVariableChange:f}=((e,t)=>{let[r,a]=(0,T.useState)(!1),[s,n]=(0,T.useState)([]),[l,i]=(0,T.useState)(""),[o,d]=(0,T.useState)({}),[c,u]=(0,T.useState)(!1),[m,p]=(0,T.useState)(null),h=(0,T.useRef)(null),f=EA(e),x=f.every(e=>o[e]&&""!==o[e].trim());(0,T.useEffect)(()=>{h.current&&setTimeout(()=>{h.current?.scrollIntoView({behavior:"smooth",block:"end"})},100)},[s]);let g=async()=>{let r;if(!t)return void J.default.fromBackend("Access token is required");if(f.length>0&&!x)return void J.default.fromBackend("Please fill in all template variables");if(!l.trim())return;!c&&f.length>0&&u(!0);let d={role:"user",content:l};n(e=>[...e,d]),i("");let m=new AbortController;p(m),a(!0);let h=Date.now();try{let a,i,d=EE(e),c=(0,Q.getProxyBaseUrl)(),u={dotprompt_content:d};0===s.length?u.prompt_variables=o:u.conversation_history=[...s.map(e=>({role:e.role,content:e.content})),{role:"user",content:l}];let p=await fetch(`${c}/prompts/test`,{method:"POST",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify(u),signal:m.signal});if(!p.ok){let e=await p.text();throw Error(`HTTP error! status: ${p.status}, ${e}`)}if(!p.body)throw Error("No response body");let f=p.body.getReader(),x=new TextDecoder,g="";for(n(e=>[...e,{role:"assistant",content:""}]);;){let{done:e,value:t}=await f.read();if(e)break;for(let e of x.decode(t).split("\n"))if(e.startsWith("data: ")){let t=e.slice(6);if("[DONE]"===t)continue;try{let e=JSON.parse(t);!a&&e.model&&(a=e.model),e.usage&&(i=e.usage);let s=e.choices?.[0]?.delta?.content;s&&(r||(r=Date.now()-h),g+=s,n(e=>{let t=[...e];return t[t.length-1]={role:"assistant",content:g,model:a,timeToFirstToken:r},t}))}catch(e){console.error("Error parsing chunk:",e)}}}let y=Date.now()-h;n(e=>{let t=[...e];return t[t.length-1]={...t[t.length-1],totalLatency:y,usage:i},t})}catch(e){"AbortError"===e.name?console.log("Request was cancelled"):(console.error("Error testing prompt:",e),n(t=>{let r=t[t.length-1];return r&&"assistant"===r.role&&""===r.content?[...t.slice(0,-1),{role:"assistant",content:`Error: ${e.message}`}]:[...t,{role:"assistant",content:`Error: ${e.message}`}]}))}finally{a(!1),p(null)}};return{isLoading:r,messages:s,inputMessage:l,variables:o,variablesFilled:c,extractedVariables:f,allVariablesFilled:x,messagesEndRef:h,setInputMessage:i,handleSendMessage:g,handleCancelRequest:()=>{m&&(m.abort(),p(null),a(!1),J.default.info("Request cancelled"))},handleClearConversation:()=>{n([]),u(!1),J.default.success("Chat history cleared.")},handleKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),g())},handleVariableChange:(e,t)=>{d({...o,[e]:t})}}})(e,t);return(0,_.jsxs)("div",{className:"flex flex-col h-full bg-white",children:[!l&&(0,_.jsx)(E9,{extractedVariables:i,variables:n,onVariableChange:f}),a.length>0&&(0,_.jsx)("div",{className:"p-3 border-b border-gray-200 bg-white flex justify-end",children:(0,_.jsx)(S.Button,{onClick:p,className:"bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:E7.ClearOutlined,children:"Clear Chat"})}),(0,_.jsx)(Ia,{messages:a,isLoading:r,hasVariables:i.length>0,messagesEndRef:d}),(0,_.jsxs)("div",{className:"p-4 border-t border-gray-200 bg-white",children:[(0,_.jsx)(Is,{extractedVariables:i,variables:n}),(0,_.jsx)(Ii,{inputMessage:s,isLoading:r,isDisabled:r||!s.trim()||i.length>0&&!o,onInputChange:c,onSend:u,onKeyDown:h,onCancel:m})]})]})},Id=({visible:e,promptName:t,isSaving:r,onNameChange:a,onPublish:s,onCancel:n})=>(0,_.jsx)(q.Modal,{title:"Publish Prompt",open:e,onCancel:n,footer:[(0,_.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,_.jsx)(S.Button,{variant:"secondary",onClick:n,children:"Cancel"}),(0,_.jsx)(S.Button,{onClick:s,loading:r,children:"Publish"})]},"footer")],children:(0,_.jsxs)("div",{className:"py-4",children:[(0,_.jsx)(Z.Text,{className:"mb-2",children:"Name"}),(0,_.jsx)($.Input,{value:t,onChange:e=>a(e.target.value),placeholder:"Enter prompt name",onPressEnter:s,autoFocus:!0}),(0,_.jsx)(Z.Text,{className:"text-gray-500 text-xs mt-2",children:"Published prompts can be used in API calls and are versioned for easy tracking."})]})}),Ic=({prompt:e})=>{let t=EE(e);return(0,_.jsxs)("div",{className:"p-6",children:[(0,_.jsxs)("div",{className:"mb-4",children:[(0,_.jsx)("h3",{className:"text-sm font-medium text-gray-700 mb-2",children:"Generated .prompt file"}),(0,_.jsx)("p",{className:"text-xs text-gray-500",children:"This is the dotprompt format that will be saved to the database"})]}),(0,_.jsx)("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-4 overflow-auto",children:(0,_.jsx)("pre",{className:"text-sm text-gray-900 font-mono whitespace-pre-wrap",children:t})})]})},{Text:Iu}=V.Typography,Im=({isOpen:e,onClose:t,accessToken:r,promptId:a,activeVersionId:s,onSelectVersion:n})=>{let[l,i]=(0,T.useState)([]),[o,d]=(0,T.useState)(!1);(0,T.useEffect)(()=>{e&&r&&a&&c()},[e,r,a]);let c=async()=>{d(!0);try{let e=a.includes(".v")?a.split(".v")[0]:a,t=await (0,Q.getPromptVersions)(r,e);i(t.prompts)}catch(e){console.error("Error fetching prompt versions:",e)}finally{d(!1)}},u=e=>{if(e.version)return`v${e.version}`;let t=e.litellm_params?.prompt_id||e.prompt_id;return t.includes(".v")?`v${t.split(".v")[1]}`:t.includes("_v")?`v${t.split("_v")[1]}`:"v1"};return(0,_.jsx)(kJ,{title:"Version History",placement:"right",onClose:t,open:e,width:400,mask:!1,maskClosable:!1,children:o?(0,_.jsx)(ey.Skeleton,{active:!0,paragraph:{rows:4}}):0===l.length?(0,_.jsx)("div",{className:"text-center py-8 text-gray-500",children:"No version history available."}):(0,_.jsx)(M1,{dataSource:l,renderItem:(e,t)=>{var r;let a=e.version||parseInt(u(e).replace("v","")),l=null;s&&(s.includes(".v")?l=parseInt(s.split(".v")[1]):s.includes("_v")&&(l=parseInt(s.split("_v")[1])));let i=l?a===l:0===t;return(0,_.jsxs)("div",{className:`mb-4 p-4 rounded-lg border cursor-pointer transition-all hover:shadow-md ${i?"border-blue-500 bg-blue-50":"border-gray-200 bg-white hover:border-blue-300"}`,onClick:()=>n?.(e),children:[(0,_.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(eN.Tag,{className:"m-0",children:u(e)}),0===t&&(0,_.jsx)(eN.Tag,{color:"blue",className:"m-0",children:"Latest"})]}),i&&(0,_.jsx)(eN.Tag,{color:"green",className:"m-0",children:"Active"})]}),(0,_.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,_.jsx)(Iu,{className:"text-sm text-gray-600 font-medium",children:(r=e.created_at)?new Date(r).toLocaleString():"-"}),(0,_.jsx)(Iu,{type:"secondary",className:"text-xs",children:e.prompt_info?.prompt_type==="db"?"Saved to Database":"Config Prompt"})]})]},`${e.prompt_id}-v${e.version||a}`)}})})},Ip=({onClose:e,onSuccess:t,accessToken:r,initialPromptData:a})=>{let[s,n]=(0,T.useState)((()=>{if(a)try{return EY(a)}catch(e){console.error("Error parsing existing prompt:",e),J.default.fromBackend("Failed to parse prompt data")}return{name:"New prompt",model:"gpt-4o",config:{temperature:1,max_tokens:1e3},tools:[],developerMessage:"",messages:[{role:"user",content:"Enter task specifics. Use {{template_variables}} for dynamic inputs"}],environment:"development"}})()),[l,i]=(0,T.useState)(!!a),[o,d]=(0,T.useState)(!1),[c,u]=(0,T.useState)((()=>{if(!a?.prompt_spec)return;let e=a.prompt_spec.prompt_id,t=a.prompt_spec.version||a.prompt_spec.litellm_params?.prompt_id;return"number"==typeof t?`${e}.v${t}`:"string"==typeof t&&(t.includes(".v")||t.includes("_v"))?t:e})()),[m,p]=(0,T.useState)(!1),[h,f]=(0,T.useState)(!1),[x,g]=(0,T.useState)(null),[y,b]=(0,T.useState)(!1),[v,j]=(0,T.useState)("pretty"),w=e=>{void 0!==e?g(e):g(null),p(!0)},k=async()=>{if(!r)return void J.default.fromBackend("Access token is required");if(!s.name||""===s.name.trim())return void J.default.fromBackend("Please enter a valid prompt name");b(!0);try{let n=s.name.replace(/[^a-zA-Z0-9_-]/g,"_").toLowerCase(),i=EE(s),o={prompt_id:n,litellm_params:{prompt_integration:"dotprompt",prompt_id:n,dotprompt_content:i},prompt_info:{prompt_type:"db",environment:s.environment}};l&&a?.prompt_spec?.prompt_id?(await (0,Q.updatePromptCall)(r,a.prompt_spec.prompt_id,o),J.default.success("Prompt updated successfully!")):(await (0,Q.createPromptCall)(r,o),J.default.success("Prompt created successfully!")),t(),e()}catch(e){console.error("Error saving prompt:",e),J.default.fromBackend(l?"Failed to update prompt":"Failed to save prompt")}finally{b(!1),f(!1)}},S=c&&c.includes(".v")?`v${c.split(".v")[1]}`:null;return(0,_.jsxs)("div",{className:"flex h-full bg-white",children:[(0,_.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,_.jsx)(EX,{promptName:s.name,onNameChange:e=>n({...s,name:e}),onBack:e,onSave:()=>{s.name&&""!==s.name.trim()&&"New prompt"!==s.name?k():f(!0)},isSaving:y,editMode:l,onShowHistory:()=>d(!0),version:S,promptModel:s.model,promptVariables:(()=>{let e,t={},r=[s.developerMessage,...s.messages.map(e=>e.content)].join(" "),a=/\{\{(\w+)\}\}/g;for(;null!==(e=a.exec(r));){let r=e[1];t[r]||(t[r]=`example_${r}`)}return t})(),accessToken:r,environment:s.environment,onEnvironmentChange:async e=>{if(n({...s,environment:e}),l&&r&&a?.prompt_spec?.prompt_id)try{let t=await (0,Q.getPromptInfo)(r,a.prompt_spec.prompt_id,e);if(t?.prompt_spec){let r=EY(t);n({...r,environment:e});let a=t.prompt_spec.version||1;u(`${t.prompt_spec.prompt_id}.v${a}`)}}catch{}}}),(0,_.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,_.jsxs)("div",{className:"w-1/2 overflow-y-auto bg-white border-r border-gray-200 flex-shrink-0",children:[(0,_.jsxs)("div",{className:"border-b border-gray-200 bg-white px-6 py-4 flex items-center gap-3",children:[(0,_.jsx)(EZ,{model:s.model,temperature:s.config.temperature,maxTokens:s.config.max_tokens,accessToken:r,onModelChange:e=>n({...s,model:e}),onTemperatureChange:e=>n({...s,config:{...s.config,temperature:e}}),onMaxTokensChange:e=>n({...s,config:{...s.config,max_tokens:e}})}),(0,_.jsxs)("div",{className:"ml-auto inline-flex items-center bg-gray-200 rounded-full p-0.5",children:[(0,_.jsx)("button",{className:`px-3 py-1 text-xs font-medium rounded-full transition-colors ${"pretty"===v?"bg-white text-gray-900 shadow-sm":"text-gray-600"}`,onClick:()=>j("pretty"),children:"PRETTY"}),(0,_.jsx)("button",{className:`px-3 py-1 text-xs font-medium rounded-full transition-colors ${"dotprompt"===v?"bg-white text-gray-900 shadow-sm":"text-gray-600"}`,onClick:()=>j("dotprompt"),children:"DOTPROMPT"})]})]}),"pretty"===v?(0,_.jsxs)("div",{className:"p-6 space-y-4 pb-20",children:[(0,_.jsx)(E1,{tools:s.tools,onAddTool:()=>w(),onEditTool:w,onRemoveTool:e=>{n({...s,tools:s.tools.filter((t,r)=>r!==e)})}}),(0,_.jsx)(E5,{value:s.developerMessage,onChange:e=>n({...s,developerMessage:e})}),(0,_.jsx)(E8,{messages:s.messages,onAddMessage:()=>{n({...s,messages:[...s.messages,{role:"user",content:""}]})},onUpdateMessage:(e,t,r)=>{let a=[...s.messages];a[e][t]=r,n({...s,messages:a})},onRemoveMessage:e=>{s.messages.length>1&&n({...s,messages:s.messages.filter((t,r)=>r!==e)})},onMoveMessage:(e,t)=>{let r=[...s.messages],[a]=r.splice(e,1);r.splice(t,0,a),n({...s,messages:r})}})]}):(0,_.jsx)(Ic,{prompt:s})]}),(0,_.jsx)("div",{className:"w-1/2 flex-shrink-0",children:(0,_.jsx)(Io,{prompt:s,accessToken:r})})]})]}),(0,_.jsx)(Id,{visible:h,promptName:s.name,isSaving:y,onNameChange:e=>n({...s,name:e}),onPublish:k,onCancel:()=>f(!1)}),m&&(0,_.jsx)(EG,{visible:m,initialJson:null!==x?s.tools[x].json:"",onSave:e=>{try{let t=JSON.parse(e),r={name:t.function?.name||"Unnamed Tool",description:t.function?.description||"",json:e};if(null!==x){let e=[...s.tools];e[x]=r,n({...s,tools:e})}else n({...s,tools:[...s.tools,r]});p(!1),g(null)}catch(e){J.default.fromBackend("Invalid JSON format")}},onClose:()=>{p(!1),g(null)}}),(0,_.jsx)(Im,{isOpen:o,onClose:()=>d(!1),accessToken:r,promptId:a?.prompt_spec?.prompt_id||s.name,activeVersionId:c,onSelectVersion:e=>{try{let t=EY({prompt_spec:e});n(t);let r=e.version||1;u(`${e.prompt_id}.v${r}`)}catch(e){console.error("Error loading version:",e),J.default.fromBackend("Failed to load prompt version")}}})]})},Ih=({accessToken:e,userRole:t})=>{let[r,a]=(0,T.useState)([]),[s,n]=(0,T.useState)(!1),[l,i]=(0,T.useState)(void 0),[o,d]=(0,T.useState)(null),[c,u]=(0,T.useState)(!1),[m,p]=(0,T.useState)(!1),[h,f]=(0,T.useState)(null),[x,g]=(0,T.useState)(!1),[y,b]=(0,T.useState)(null);t&&(0,ts.isAdminRole)(t);let v=!!t&&(0,ts.isProxyAdminRole)(t),j=async()=>{if(e){n(!0);try{let t=await (0,Q.getPromptsList)(e,l);console.log(`prompts: ${JSON.stringify(t)}`),a(t.prompts)}catch(e){console.error("Error fetching prompts:",e)}finally{n(!1)}}};(0,T.useEffect)(()=>{j()},[e,l]);let w=()=>{j(),p(!1),f(null),d(null)},k=async()=>{if(y&&e){g(!0);try{await (0,Q.deletePromptCall)(e,y.id),J.default.success(`Prompt "${y.name}" deleted successfully`),j()}catch(e){console.error("Error deleting prompt:",e),J.default.fromBackend("Failed to delete prompt")}finally{g(!1),b(null)}}};return(0,_.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[m?(0,_.jsx)(Ip,{onClose:()=>{p(!1),f(null)},onSuccess:w,accessToken:e,initialPromptData:h}):o?(0,_.jsx)(Eq,{promptId:o,onClose:()=>d(null),accessToken:e,isAdmin:v,onDelete:j,onEdit:e=>{f(e),p(!0)}}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,_.jsx)("div",{className:"flex gap-2",children:v&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(S.Button,{onClick:()=>{o&&d(null),f(null),p(!0)},disabled:!e,children:"+ Add New Prompt"}),(0,_.jsx)(S.Button,{onClick:()=>{o&&d(null),u(!0)},disabled:!e,variant:"secondary",children:"Upload .prompt File"})]})}),(0,_.jsx)(eE.Select,{placeholder:"All Environments",allowClear:!0,value:l,onChange:e=>i(e),style:{width:180},options:[{label:"Development",value:"development"},{label:"Staging",value:"staging"},{label:"Production",value:"production"}]})]}),(0,_.jsx)(Ez,{promptsList:r,isLoading:s,onPromptClick:e=>{d(e)},onDeleteClick:(e,t)=>{b({id:e,name:t})},accessToken:e,isAdmin:v})]}),(0,_.jsx)(EW,{visible:c,onClose:()=>{u(!1)},accessToken:e,onSuccess:w}),y&&(0,_.jsxs)(q.Modal,{title:"Delete Prompt",open:null!==y,onOk:k,onCancel:()=>{b(null)},confirmLoading:x,okText:"Delete",okButtonProps:{danger:!0},children:[(0,_.jsxs)("p",{children:["Are you sure you want to delete prompt: ",y.name," ?"]}),(0,_.jsx)("p",{children:"This action cannot be undone."})]})]})};var If=e.i(976883),Ix=e.i(657688),Ig=e.i(437902);let{Text:Iy}=V.Typography,I_=({litellmParams:e,accessToken:t,onTestComplete:r})=>{let[a,s]=(0,T.useState)(!0),[n,l]=(0,T.useState)(null),[i,o]=(0,T.useState)(!1);(0,T.useEffect)(()=>{(async()=>{s(!0);try{let r=await (0,Q.testSearchToolConnection)(t,e);l(r),"success"===r.status&&J.default.success("Connection test successful!")}catch(e){l({status:"error",message:e instanceof Error?e.message:"Unknown error occurred",error_type:"NetworkError"})}finally{s(!1),r&&r()}})()},[t,e,r]);let d=n?.message?(e=>{if(!e)return"Unknown error";let t=e.split("stack trace:")[0].trim().replace(/^litellm\.(.*?)Error:\s*/,"").replace(/^AuthenticationError:\s*/,"");if(t.includes("")||t.includes("(.*?)<\/title>/);return e?e[1]:t.includes("401")||t.includes("Authorization Required")?"Authentication failed: Invalid API key or credentials":"Authentication error - please check your API key"}return t.length>200?t.substring(0,200)+"...":t})(n.message):"Unknown error";return a?(0,_.jsx)("div",{style:{padding:"24px",borderRadius:"8px",backgroundColor:"#fff"},children:(0,_.jsxs)("div",{style:{textAlign:"center",padding:"32px 20px"},className:"jsx-dc9a0e2d897fe63b",children:[(0,_.jsx)("div",{style:{marginBottom:"16px"},className:"jsx-dc9a0e2d897fe63b loading-spinner",children:(0,_.jsx)("div",{style:{border:"3px solid #f3f3f3",borderTop:"3px solid #1890ff",borderRadius:"50%",width:"30px",height:"30px",animation:"spin 1s linear infinite",margin:"0 auto"},className:"jsx-dc9a0e2d897fe63b"})}),(0,_.jsxs)(Iy,{style:{fontSize:"16px"},children:["Testing connection to ",e.search_provider||"search provider","..."]}),(0,_.jsx)(Ig.default,{id:"dc9a0e2d897fe63b",children:"@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}"})]})}):n?(0,_.jsxs)("div",{style:{padding:"24px",borderRadius:"8px",backgroundColor:"#fff"},children:["success"===n.status?(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"32px 20px"},children:[(0,_.jsx)("div",{style:{color:"#52c41a",fontSize:"24px",display:"flex",alignItems:"center"},children:(0,_.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"check-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,_.jsx)("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"})})}),(0,_.jsxs)("div",{style:{marginLeft:"12px"},children:[(0,_.jsxs)(Iy,{type:"success",style:{fontSize:"18px",fontWeight:500,display:"block"},children:["Connection to ",e.search_provider," successful!"]}),n.test_query&&(0,_.jsxs)(Iy,{style:{fontSize:"14px",color:"#666",marginTop:"8px",display:"block"},children:["Test query:"," ",(0,_.jsx)("code",{style:{backgroundColor:"#f0f0f0",padding:"2px 6px",borderRadius:"4px"},children:n.test_query})]}),void 0!==n.results_count&&(0,_.jsxs)(Iy,{style:{fontSize:"14px",color:"#666",display:"block"},children:["Results retrieved: ",n.results_count]})]})]}):(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)("div",{children:[(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:"20px"},children:[(0,_.jsx)(km.WarningOutlined,{style:{color:"#ff4d4f",fontSize:"24px",marginRight:"12px"}}),(0,_.jsxs)(Iy,{type:"danger",style:{fontSize:"18px",fontWeight:500},children:["Connection to ",e.search_provider||"search provider"," failed"]})]}),(0,_.jsxs)("div",{style:{backgroundColor:"#fff2f0",border:"1px solid #ffccc7",borderRadius:"8px",padding:"16px",marginBottom:"20px",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.03)"},children:[(0,_.jsxs)(Iy,{strong:!0,style:{display:"block",marginBottom:"8px"},children:["Error:"," "]}),(0,_.jsx)(Iy,{type:"danger",style:{fontSize:"14px",lineHeight:"1.5"},children:d}),n.error_type&&(0,_.jsx)("div",{style:{marginTop:"8px"},children:(0,_.jsxs)(Iy,{style:{fontSize:"13px",color:"#666"},children:["Error type:"," ",(0,_.jsx)("code",{style:{backgroundColor:"#ffebee",padding:"2px 6px",borderRadius:"4px",color:"#d32f2f"},children:n.error_type})]})}),n.message&&(0,_.jsx)("div",{style:{marginTop:"12px"},children:(0,_.jsx)(z.Button,{type:"link",onClick:()=>o(!i),style:{paddingLeft:0,height:"auto"},children:i?"Hide Details":"Show Details"})})]}),i&&(0,_.jsxs)("div",{style:{marginBottom:"20px"},children:[(0,_.jsx)(Iy,{strong:!0,style:{display:"block",marginBottom:"8px",fontSize:"15px"},children:"Full Error Details"}),(0,_.jsx)("pre",{style:{backgroundColor:"#f5f5f5",padding:"16px",borderRadius:"8px",fontSize:"13px",maxHeight:"200px",overflow:"auto",border:"1px solid #e8e8e8",lineHeight:"1.5",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:n.message})]}),(0,_.jsxs)("div",{style:{backgroundColor:"#fffbf0",border:"1px solid #ffe58f",borderLeft:"4px solid #faad14",borderRadius:"8px",padding:"16px"},children:[(0,_.jsx)(Iy,{strong:!0,style:{display:"block",marginBottom:"8px",color:"#d48806"},children:"Troubleshooting tips:"}),(0,_.jsxs)("ul",{style:{margin:"8px 0",paddingLeft:"20px",color:"#ad6800"},children:[(0,_.jsx)("li",{style:{marginBottom:"6px"},children:"Verify your API key is correct and active"}),(0,_.jsx)("li",{style:{marginBottom:"6px"},children:"Check if the search provider service is operational"}),(0,_.jsx)("li",{style:{marginBottom:"6px"},children:"Ensure you have sufficient credits/quota with the provider"}),(0,_.jsx)("li",{style:{marginBottom:"6px"},children:"Review the provider's documentation for any additional requirements"})]})]})]})}),(0,_.jsx)(eG.Divider,{style:{margin:"24px 0 16px"}}),(0,_.jsx)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:(0,_.jsx)(z.Button,{type:"link",href:"https://docs.litellm.ai/docs/search",target:"_blank",icon:(0,_.jsx)(tK.InfoCircleOutlined,{}),children:"View Search Documentation"})})]}):null},{TextArea:Ib}=$.Input,Iv=({providerName:e,displayName:t})=>(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,_.jsx)(Ix.default,{src:`../ui/assets/logos/${e}.png`,alt:"",width:20,height:20,style:{marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,_.jsx)("span",{children:t})]}),Ij=({userRole:e,accessToken:t,onCreateSuccess:r,isModalVisible:a,setModalVisible:s})=>{let[n]=H.Form.useForm(),[l,i]=(0,T.useState)(!1),[o,d]=(0,T.useState)({}),[c,u]=(0,T.useState)(!1),[m,p]=(0,T.useState)(!1),[h,f]=(0,T.useState)(""),{data:x,isLoading:g}=(0,ev.useQuery)({queryKey:["searchProviders"],queryFn:()=>{if(!t)throw Error("Access Token required");return(0,Q.fetchAvailableSearchProviders)(t)},enabled:!!t&&a}),y=x?.providers||[],b=async e=>{i(!0);try{let a={search_tool_name:e.search_tool_name,litellm_params:{search_provider:e.search_provider,api_key:e.api_key,api_base:e.api_base,timeout:e.timeout?parseFloat(e.timeout):void 0,max_retries:e.max_retries?parseInt(e.max_retries):void 0},search_tool_info:e.description?{description:e.description}:void 0};if(console.log("Creating search tool with payload:",a),null!=t){let e=await (0,Q.createSearchTool)(t,a);J.default.success("Search tool created successfully"),n.resetFields(),d({}),s(!1),r(e)}}catch(e){J.default.error("Error creating search tool: "+e)}finally{i(!1)}},v=async()=>{try{await n.validateFields(["search_provider","api_key"]),p(!0),f(`test-${Date.now()}`),u(!0)}catch(e){J.default.error("Please fill in Search Provider and API Key before testing")}};return(T.default.useEffect(()=>{a||d({})},[a]),(0,ts.isAdminRole)(e))?(0,_.jsxs)(q.Modal,{title:(0,_.jsxs)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:[(0,_.jsx)("span",{className:"text-2xl",children:"🔍"}),(0,_.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add New Search Tool"})]}),open:a,width:800,onCancel:()=>{n.resetFields(),d({}),s(!1)},footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:[(0,_.jsx)("div",{className:"mt-6",children:(0,_.jsxs)(H.Form,{form:n,onFinish:b,onValuesChange:(e,t)=>d(t),layout:"vertical",className:"space-y-6",children:[(0,_.jsxs)("div",{className:"grid grid-cols-1 gap-6",children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Search Tool Name",(0,_.jsx)(tB.Tooltip,{title:"A unique name to identify this search tool configuration (e.g., 'perplexity-search', 'tavily-news-search').",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"search_tool_name",rules:[{required:!0,message:"Please enter a search tool name"},{pattern:/^[a-zA-Z0-9_-]+$/,message:"Name can only contain letters, numbers, hyphens, and underscores"}],children:(0,_.jsx)(et.TextInput,{placeholder:"e.g., perplexity-search, my-tavily-tool",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Search Provider",(0,_.jsx)(tB.Tooltip,{title:"Select the search provider you want to use. Each provider has different capabilities and pricing.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"search_provider",rules:[{required:!0,message:"Please select a search provider"}],children:(0,_.jsx)(eE.Select,{placeholder:"Select a search provider",className:"rounded-lg",size:"large",loading:g,showSearch:!0,optionFilterProp:"children",optionLabelProp:"label",children:y.map(e=>(0,_.jsx)(eE.Select.Option,{value:e.provider_name,label:(0,_.jsx)(Iv,{providerName:e.provider_name,displayName:e.ui_friendly_name}),children:(0,_.jsx)(Iv,{providerName:e.provider_name,displayName:e.ui_friendly_name})},e.provider_name))})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["API Key",(0,_.jsx)(tB.Tooltip,{title:"The API key for authenticating with the search provider. This will be securely stored.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"api_key",rules:[{required:!1,message:"Please enter an API key"}],children:(0,_.jsx)(et.TextInput,{type:"password",placeholder:"Enter your API key",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Description (Optional)"}),name:"description",children:(0,_.jsx)(Ib,{rows:3,placeholder:"Brief description of this search tool's purpose",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})})]}),(0,_.jsxs)("div",{className:"flex justify-between items-center pt-6 border-t border-gray-100",children:[(0,_.jsx)(tB.Tooltip,{title:"Get help on our github",children:(0,_.jsx)(V.Typography.Link,{href:"https://github.com/BerriAI/litellm/issues",target:"_blank",children:"Need Help?"})}),(0,_.jsxs)("div",{className:"space-x-2",children:[(0,_.jsx)(S.Button,{onClick:v,loading:m,children:"Test Connection"}),(0,_.jsx)(S.Button,{loading:l,type:"submit",children:"Add Search Tool"})]})]})]})}),(0,_.jsx)(q.Modal,{title:"Connection Test Results",open:c,onCancel:()=>{u(!1),p(!1)},footer:[(0,_.jsx)(S.Button,{onClick:()=>{u(!1),p(!1)},children:"Close"},"close")],width:700,children:c&&t&&(0,_.jsx)(I_,{litellmParams:{search_provider:o.search_provider,api_key:o.api_key,api_base:o.api_base},accessToken:t,onTestComplete:()=>p(!1)},h)})]}):null},{Text:Iw}=V.Typography,Ik=({searchToolName:e,accessToken:t,className:r=""})=>{let[a,s]=(0,T.useState)(""),[n,l]=(0,T.useState)(!1),[i,o]=(0,T.useState)([]),[d,c]=(0,T.useState)({}),[u,m]=(0,T.useState)(!1),p=async()=>{if(!a.trim())return void tU.default.warning("Please enter a search query");l(!0);let r=performance.now();try{let s=await (0,Q.searchToolQueryCall)(t,e,a),n=performance.now(),l=Math.round(n-r),i={query:a,response:s,timestamp:Date.now(),latency:l};o(e=>[i,...e])}catch(e){console.error("Error querying search tool:",e),J.default.fromBackend("Failed to query search tool")}finally{l(!1)}},h=e=>new Date(e).toLocaleString(),f=(0,_.jsx)(wo.LoadingOutlined,{style:{fontSize:24},spin:!0}),x=i.length>0?i[0]:null;return(0,_.jsxs)(P.Card,{className:"mt-6",children:[(0,_.jsx)("div",{className:"mb-6",children:(0,_.jsx)(X.Title,{children:"Test Search Tool"})}),(0,_.jsxs)("div",{className:"flex flex-col",style:{minHeight:"600px"},children:[(0,_.jsx)("div",{className:"mb-6",children:(0,_.jsxs)("div",{className:"flex items-stretch gap-3",children:[(0,_.jsxs)("div",{className:"flex items-center flex-1 bg-white rounded-lg px-4 transition-all duration-200",style:{border:u?"2px solid #3b82f6":"2px solid #e5e7eb",boxShadow:u?"0 0 0 3px rgba(59, 130, 246, 0.1)":"0 1px 2px 0 rgba(0, 0, 0, 0.05)",height:"48px"},children:[(0,_.jsx)(ry.SearchOutlined,{className:"text-gray-400 mr-3",style:{fontSize:"18px"}}),(0,_.jsx)($.Input,{value:a,onChange:e=>s(e.target.value),onFocus:()=>m(!0),onBlur:()=>m(!1),onPressEnter:e=>{e.shiftKey||(e.preventDefault(),p())},placeholder:"Enter your search query...",disabled:n,bordered:!1,style:{fontSize:"15px",padding:0,height:"100%",boxShadow:"none"}})]}),(0,_.jsx)(z.Button,{type:"primary",onClick:p,disabled:n||!a.trim(),icon:(0,_.jsx)(ry.SearchOutlined,{}),loading:n,style:{height:"48px",paddingLeft:"24px",paddingRight:"24px",borderRadius:"8px",fontWeight:500,fontSize:"15px",backgroundColor:n||!a.trim()?void 0:"#1890ff",borderColor:n||!a.trim()?void 0:"#1890ff",boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05)"},children:"Search"})]})}),(0,_.jsx)("div",{className:"flex-1",children:x||n?(0,_.jsxs)("div",{children:[n&&(0,_.jsxs)("div",{className:"flex flex-col justify-center items-center py-16",children:[(0,_.jsx)(rm.Spin,{indicator:f}),(0,_.jsx)(Iw,{className:"mt-4 text-gray-600 font-medium",children:"Searching..."})]}),x&&!n&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"mb-6 p-4 bg-blue-50 border border-blue-200 rounded-lg",style:{boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05)"},children:(0,_.jsxs)("div",{className:"flex items-center justify-between",children:[(0,_.jsxs)("div",{className:"flex-1",children:[(0,_.jsx)(Iw,{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide",children:"Search Query"}),(0,_.jsx)("div",{className:"text-base font-semibold text-gray-900 mt-1.5",children:x.query})]}),(0,_.jsxs)("div",{className:"text-right ml-4",children:[(0,_.jsx)(Iw,{className:"text-xs text-gray-500",children:h(x.timestamp)}),(0,_.jsxs)("div",{className:"flex items-center gap-3 mt-1",children:[(0,_.jsxs)("div",{className:"text-sm font-semibold text-blue-600",children:[x.response?.results?.length||0," ",x.response?.results?.length===1?"result":"results"]}),void 0!==x.latency&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("span",{className:"text-gray-400",children:"•"}),(0,_.jsxs)("div",{className:"text-sm font-semibold text-green-600",children:[x.latency,"ms"]})]})]})]})]})}),x.response&&x.response.results&&x.response.results.length>0?(0,_.jsx)("div",{className:"space-y-3",children:x.response.results.map((e,t)=>{let r=d[`0-${t}`]||!1;return(0,_.jsx)("div",{className:"bg-white border border-gray-200 rounded-lg overflow-hidden transition-all duration-200",style:{boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05)"},onMouseEnter:e=>{e.currentTarget.style.boxShadow="0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",e.currentTarget.style.borderColor="#e0e7ff"},onMouseLeave:e=>{e.currentTarget.style.boxShadow="0 1px 2px 0 rgba(0, 0, 0, 0.05)",e.currentTarget.style.borderColor="#e5e7eb"},children:(0,_.jsxs)("div",{className:"p-5",children:[(0,_.jsxs)("div",{className:"flex items-start justify-between gap-3 mb-2",children:[(0,_.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-lg font-semibold text-blue-600 hover:text-blue-700 flex-1 leading-snug",style:{textDecoration:"none"},onMouseEnter:e=>e.currentTarget.style.textDecoration="underline",onMouseLeave:e=>e.currentTarget.style.textDecoration="none",children:e.title}),(0,_.jsx)(z.Button,{type:"text",size:"small",className:"flex-shrink-0",icon:(0,_.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})}),onClick:()=>window.open(e.url,"_blank"),style:{color:"#6b7280"}})]}),(0,_.jsx)("div",{className:"text-sm text-green-700 mb-3 truncate font-medium",children:e.url}),(0,_.jsx)("div",{className:"text-sm text-gray-700 leading-relaxed",children:r?e.snippet:`${e.snippet.substring(0,200)}${e.snippet.length>200?"...":""}`}),e.snippet.length>200&&(0,_.jsx)(z.Button,{type:"link",size:"small",className:"mt-3 p-0 h-auto",onClick:()=>{let e;return e=`0-${t}`,void c(t=>({...t,[e]:!t[e]}))},style:{fontSize:"13px",fontWeight:500,color:"#3b82f6"},children:r?"Show less":"Show more"})]})},t)})}):(0,_.jsxs)("div",{className:"text-center py-12 bg-gray-50 border border-gray-200 rounded-lg",children:[(0,_.jsx)("div",{className:"flex items-center justify-center w-16 h-16 rounded-full bg-gray-100 mx-auto mb-4",children:(0,_.jsx)(ry.SearchOutlined,{style:{fontSize:"24px",color:"#9ca3af"}})}),(0,_.jsx)(Iw,{className:"text-gray-600 font-medium",children:"No results found"}),(0,_.jsx)(Iw,{className:"text-sm text-gray-500 mt-1",children:"Try a different search query"})]})]}),i.length>1&&(0,_.jsxs)("div",{className:"mt-8 pt-6 border-t border-gray-200",children:[(0,_.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,_.jsx)(Iw,{className:"text-sm font-semibold text-gray-700",children:"Previous Searches"}),(0,_.jsx)(z.Button,{onClick:()=>{o([]),c({}),J.default.success("Search history cleared")},size:"small",type:"link",style:{fontSize:"13px",fontWeight:500},children:"Clear All"})]}),(0,_.jsx)("div",{className:"space-y-2",children:i.slice(1,6).map((e,t)=>(0,_.jsxs)("div",{className:"p-3 bg-gray-50 border border-gray-200 rounded-lg cursor-pointer transition-all duration-200 hover:bg-gray-100 hover:border-gray-300",onClick:()=>{s(e.query)},children:[(0,_.jsx)("div",{className:"text-sm font-medium text-gray-800 truncate",children:e.query}),(0,_.jsxs)("div",{className:"text-xs text-gray-500 mt-1.5 flex items-center gap-2",children:[(0,_.jsxs)("span",{className:"font-medium text-blue-600",children:[e.response?.results?.length||0," ",e.response?.results?.length===1?"result":"results"]}),void 0!==e.latency&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("span",{children:"•"}),(0,_.jsxs)("span",{className:"font-medium text-green-600",children:[e.latency,"ms"]})]}),(0,_.jsx)("span",{children:"•"}),(0,_.jsx)("span",{children:h(e.timestamp)})]})]},t+1))})]})]}):(0,_.jsxs)("div",{className:"h-full flex flex-col items-center justify-center p-8",children:[(0,_.jsx)("div",{className:"flex items-center justify-center w-24 h-24 rounded-full bg-gray-100 mb-6",children:(0,_.jsx)(ry.SearchOutlined,{style:{fontSize:"48px",color:"#9ca3af"}})}),(0,_.jsx)(Iw,{className:"text-lg text-gray-600 font-medium",children:"Test your search tool"}),(0,_.jsx)(Iw,{className:"text-sm text-gray-500 mt-2",children:"Enter a query above to see search results"})]})})]})]})},IS=({searchTool:e,onBack:t,isEditing:r,accessToken:a,availableProviders:s})=>{var n;let l,[i,o]=(0,T.useState)({}),d=async(e,t)=>{await (0,rV.copyToClipboard)(e)&&(o(e=>({...e,[t]:!0})),setTimeout(()=>{o(e=>({...e,[t]:!1}))},2e3))};return(0,_.jsxs)("div",{className:"p-4 max-w-full",children:[(0,_.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,_.jsxs)("div",{children:[(0,_.jsx)(S.Button,{icon:rH.ArrowLeftIcon,variant:"light",className:"mb-4",onClick:t,children:"Back to All Search Tools"}),(0,_.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,_.jsx)(X.Title,{children:e.search_tool_name}),(0,_.jsx)(z.Button,{type:"text",size:"small",icon:i["search-tool-name"]?(0,_.jsx)(M_.CheckIcon,{size:12}):(0,_.jsx)(Mb.CopyIcon,{size:12}),onClick:()=>d(e.search_tool_name,"search-tool-name"),className:`left-2 z-10 transition-all duration-200 ${i["search-tool-name"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`})]}),(0,_.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,_.jsx)(Z.Text,{className:"text-gray-500 font-mono",children:e.search_tool_id}),(0,_.jsx)(z.Button,{type:"text",size:"small",icon:i["search-tool-id"]?(0,_.jsx)(M_.CheckIcon,{size:12}):(0,_.jsx)(Mb.CopyIcon,{size:12}),onClick:()=>d(e.search_tool_id,"search-tool-id"),className:`left-2 z-10 transition-all duration-200 ${i["search-tool-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`})]})]})}),(0,_.jsxs)(ee.Grid,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Provider"}),(0,_.jsx)("div",{className:"mt-2",children:(0,_.jsx)(X.Title,{children:(n=e.litellm_params.search_provider,l=s.find(e=>e.provider_name===n),l?.ui_friendly_name||n)})})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"API Key"}),(0,_.jsx)("div",{className:"mt-2",children:(0,_.jsx)(Z.Text,{children:e.litellm_params.api_key?"****":"Not set"})})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Created At"}),(0,_.jsx)("div",{className:"mt-2",children:(0,_.jsx)(Z.Text,{children:e.created_at?new Date(e.created_at).toLocaleString():"Unknown"})})]})]}),e.search_tool_info?.description&&(0,_.jsxs)(P.Card,{className:"mt-6",children:[(0,_.jsx)(Z.Text,{children:"Description"}),(0,_.jsx)("div",{className:"mt-2",children:(0,_.jsx)(Z.Text,{children:e.search_tool_info.description})})]}),(0,_.jsx)("div",{className:"mt-6",children:a&&(0,_.jsx)(Ik,{searchToolName:e.search_tool_name,accessToken:a})})]})},IN=({accessToken:e,userRole:t,userID:r})=>{let{data:a,isLoading:s,refetch:n}=(0,ev.useQuery)({queryKey:["searchTools"],queryFn:()=>{if(!e)throw Error("Access Token required");return(0,Q.fetchSearchTools)(e).then(e=>e.search_tools||[])},enabled:!!e}),{data:l,isLoading:i}=(0,ev.useQuery)({queryKey:["searchProviders"],queryFn:()=>{if(!e)throw Error("Access Token required");return(0,Q.fetchAvailableSearchProviders)(e)},enabled:!!e}),o=l?.providers||[],[d,c]=(0,T.useState)(null),[u,m]=(0,T.useState)(!1),[p,h]=(0,T.useState)(!1),[f,x]=(0,T.useState)(null),[g,y]=(0,T.useState)(!1),[b,v]=(0,T.useState)(!1),[j,w]=(0,T.useState)(!1),[k]=H.Form.useForm(),N=T.default.useMemo(()=>{let e,t,r;return e=e=>{x(e),y(!1)},t=e=>{let t=a?.find(t=>t.search_tool_id===e);t&&(k.setFieldsValue({search_tool_name:t.search_tool_name,search_provider:t.litellm_params.search_provider,api_key:t.litellm_params.api_key,api_base:t.litellm_params.api_base,timeout:t.litellm_params.timeout,max_retries:t.litellm_params.max_retries,description:t.search_tool_info?.description}),x(e),w(!0))},r=M,[{title:"Search Tool ID",dataIndex:"search_tool_id",key:"search_tool_id",render:(t,r)=>r.is_from_config?(0,_.jsx)("span",{className:"text-xs",children:"-"}):(0,_.jsx)("button",{onClick:()=>e(r.search_tool_id),className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left cursor-pointer max-w-40",children:(0,_.jsx)("span",{className:"truncate block",children:r.search_tool_id})})},{title:"Name",dataIndex:"search_tool_name",key:"search_tool_name",render:e=>(0,_.jsx)("span",{className:"font-medium",children:e})},{title:"Provider",key:"provider",render:(e,t)=>{let r=t.litellm_params.search_provider,a=o.find(e=>e.provider_name===r),s=a?.ui_friendly_name||r;return(0,_.jsx)("span",{className:"text-sm",children:s})}},{title:"Created At",dataIndex:"created_at",key:"created_at",render:(e,t)=>(0,_.jsx)("span",{className:"text-xs",children:t.created_at?new Date(t.created_at).toLocaleDateString():"-"})},{title:"Updated At",dataIndex:"updated_at",key:"updated_at",render:(e,t)=>(0,_.jsx)("span",{className:"text-xs",children:t.updated_at?new Date(t.updated_at).toLocaleDateString():"-"})},{title:"Source",key:"source",render:(e,t)=>{let r=t.is_from_config??!1;return(0,_.jsx)(eN.Tag,{color:r?"default":"blue",children:r?"Config":"DB"})}},{title:"Actions",key:"actions",render:(e,a)=>{let s=a.search_tool_id,n=a.is_from_config??!1;return(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(rG.default,{variant:"Edit",tooltipText:"Edit search tool",disabled:n,disabledTooltipText:"Config search tool cannot be edited on the dashboard. Please edit it from the config file.",onClick:()=>{s&&!n&&t(s)}}),(0,_.jsx)(rG.default,{variant:"Delete",tooltipText:"Delete search tool",disabled:n,disabledTooltipText:"Config search tool cannot be deleted on the dashboard. Please delete it from the config file.",onClick:()=>{s&&!n&&r(s)}})]})}}]},[o,a,k]);function M(e){c(e),m(!0)}let C=async()=>{if(null!=d&&null!=e){h(!0);try{await (0,Q.deleteSearchTool)(e,d),J.default.success("Deleted search tool successfully"),m(!1),c(null),n()}catch(e){console.error("Error deleting the search tool:",e),J.default.error("Failed to delete search tool")}finally{h(!1)}}},L=a?.find(e=>e.search_tool_id===d),O=L?o.find(e=>e.provider_name===L.litellm_params.search_provider):null,D=async()=>{if(e&&f)try{let t=await k.validateFields(),r={search_tool_name:t.search_tool_name,litellm_params:{search_provider:t.search_provider,api_key:t.api_key,api_base:t.api_base,timeout:t.timeout?parseFloat(t.timeout):void 0,max_retries:t.max_retries?parseInt(t.max_retries):void 0},search_tool_info:t.description?{description:t.description}:void 0};await (0,Q.updateSearchTool)(e,f,r),J.default.success("Search tool updated successfully"),w(!1),k.resetFields(),x(null),n()}catch(e){console.error("Failed to update search tool:",e),J.default.error("Failed to update search tool")}};return e&&t&&r?(0,_.jsxs)("div",{className:"w-full h-full p-6",children:[(0,_.jsx)(eH.default,{isOpen:u,title:"Delete Search Tool",message:"Are you sure you want to delete this search tool? This action cannot be undone.",resourceInformationTitle:"Search Tool Information",resourceInformation:L?[{label:"Name",value:L.search_tool_name},{label:"ID",value:L.search_tool_id,code:!0},{label:"Provider",value:O?.ui_friendly_name||L.litellm_params.search_provider},{label:"Description",value:L.search_tool_info?.description||"-"}]:[],onCancel:()=>{m(!1),c(null)},onOk:C,confirmLoading:p}),(0,_.jsx)(Ij,{userRole:t,accessToken:e,onCreateSuccess:e=>{v(!1),n()},isModalVisible:b,setModalVisible:v}),(0,_.jsx)(q.Modal,{title:"Edit Search Tool",open:j,onOk:D,onCancel:()=>{w(!1),k.resetFields(),x(null)},width:600,children:(0,_.jsxs)(H.Form,{form:k,layout:"vertical",children:[(0,_.jsx)(H.Form.Item,{name:"search_tool_name",label:"Search Tool Name",rules:[{required:!0,message:"Please enter a search tool name"}],children:(0,_.jsx)($.Input,{placeholder:"e.g., my-perplexity-search"})}),(0,_.jsx)(H.Form.Item,{name:"search_provider",label:"Search Provider",rules:[{required:!0,message:"Please select a search provider"}],children:(0,_.jsx)(eE.Select,{placeholder:"Select a search provider",loading:i,children:o.map(e=>(0,_.jsx)(eE.Select.Option,{value:e.provider_name,children:e.ui_friendly_name},e.provider_name))})}),(0,_.jsx)(H.Form.Item,{name:"api_key",label:"API Key",extra:"API key for the search provider",children:(0,_.jsx)($.Input.Password,{placeholder:"Enter API key"})}),(0,_.jsx)(H.Form.Item,{name:"description",label:"Description",children:(0,_.jsx)($.Input.TextArea,{rows:3,placeholder:"Description of this search tool"})})]})}),(0,_.jsx)(X.Title,{children:"Search Tools"}),(0,_.jsx)(Z.Text,{className:"text-tremor-content mt-2",children:"Configure and manage your search providers"}),(0,ts.isAdminRole)(t)&&(0,_.jsx)(S.Button,{className:"mt-4 mb-4",onClick:()=>v(!0),children:"+ Add New Search Tool"}),(0,_.jsx)(()=>f?(0,_.jsx)(IS,{searchTool:a?.find(e=>e.search_tool_id===f)||{search_tool_id:"",search_tool_name:"",litellm_params:{search_provider:""}},onBack:()=>{y(!1),x(null),n()},isEditing:g,accessToken:e,availableProviders:o}):(0,_.jsx)("div",{className:"w-full h-full",children:(0,_.jsx)(rm.Spin,{spinning:s,indicator:(0,_.jsx)(wo.LoadingOutlined,{spin:!0}),size:"large",children:(0,_.jsx)(eK.Table,{bordered:!0,dataSource:a||[],columns:N,rowKey:e=>e.search_tool_id||e.search_tool_name,pagination:!1,locale:{emptyText:"No search tools configured"},size:"small"})})}),{})]}):(console.log("Missing required authentication parameters",{accessToken:e,userRole:t,userID:r}),(0,_.jsx)("div",{className:"p-6 text-center text-gray-500",children:"Missing required authentication parameters."}))},{Title:IT}=V.Typography,IM=({accessToken:e})=>{let[t,r]=(0,T.useState)(!0),[a,s]=(0,T.useState)([]);(0,T.useEffect)(()=>{n()},[e]);let n=async()=>{if(e){r(!0);try{let t=await (0,Q.getEmailEventSettings)(e);s(t.settings)}catch(e){console.error("Failed to fetch email event settings:",e),J.default.fromBackend(e)}finally{r(!1)}}},l=async()=>{if(e)try{await (0,Q.updateEmailEventSettings)(e,{settings:a}),J.default.success("Email event settings updated successfully")}catch(e){console.error("Failed to update email event settings:",e),J.default.fromBackend(e)}},i=async()=>{if(e)try{await (0,Q.resetEmailEventSettings)(e),J.default.success("Email event settings reset to defaults"),n()}catch(e){console.error("Failed to reset email event settings:",e),J.default.fromBackend(e)}};return(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(IT,{level:4,children:"Email Notifications"}),(0,_.jsx)(Z.Text,{children:"Select which events should trigger email notifications."}),(0,_.jsx)(eG.Divider,{}),t?(0,_.jsx)("div",{style:{textAlign:"center",padding:"20px"},children:(0,_.jsx)(rm.Spin,{size:"large"})}):(0,_.jsx)("div",{className:"space-y-4",children:a.map(e=>(0,_.jsxs)("div",{className:"flex items-center",children:[(0,_.jsx)(eA.Checkbox,{checked:e.enabled,onChange:t=>{var r,n;return r=e.event,n=t.target.checked,void s(a.map(e=>e.event===r?{...e,enabled:n}:e))}}),(0,_.jsxs)("div",{className:"ml-3",children:[(0,_.jsx)(Z.Text,{children:e.event}),(0,_.jsx)("div",{className:"text-sm text-gray-500 block",children:(e=>{if(e.includes("Virtual Key Created"))return"An email will be sent to the user when a new virtual key is created with their user ID";{if(e.includes("New User Invitation"))return"An email will be sent to the email address of the user when a new user is created";let t=e.split(/(?=[A-Z])/).join(" ").toLowerCase();return`Receive an email notification when ${t}`}})(e.event)})]})]},e.event))}),(0,_.jsxs)("div",{className:"mt-6 flex space-x-4",children:[(0,_.jsx)(S.Button,{onClick:l,disabled:t,children:"Save Changes"}),(0,_.jsx)(S.Button,{onClick:i,variant:"secondary",disabled:t,children:"Reset to Defaults"})]})]})},{Title:IC}=V.Typography,IL=({accessToken:e,premiumUser:t,alerts:r})=>{let a=async()=>{if(!e)return;let t={};r.filter(e=>"email"===e.name).forEach(e=>{Object.entries(e.variables??{}).forEach(([e,r])=>{let a=document.querySelector(`input[name="${e}"]`);a&&a.value&&(t[e]=a?.value)})}),console.log("updatedVariables",t);try{await (0,Q.setCallbacksCall)(e,{general_settings:{alerting:["email"]},environment_variables:t}),J.default.success("Email settings updated successfully")}catch(e){J.default.fromBackend(e)}};return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"mt-6 mb-6",children:(0,_.jsx)(IM,{accessToken:e})}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(IC,{level:4,children:"Email Server Settings"}),(0,_.jsxs)(Z.Text,{children:[(0,_.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/email",target:"_blank",style:{color:"blue"},children:[" ","LiteLLM Docs: email alerts"]})," ",(0,_.jsx)("br",{})]}),(0,_.jsx)("div",{className:"flex w-full",children:r.filter(e=>"email"===e.name).map((e,r)=>(0,_.jsx)(I.TableCell,{children:(0,_.jsx)("ul",{children:(0,_.jsx)(ee.Grid,{numItems:2,children:Object.entries(e.variables??{}).map(([e,r])=>(0,_.jsxs)("li",{className:"mx-2 my-2",children:[!0!=t&&("EMAIL_LOGO_URL"===e||"EMAIL_SUPPORT_CONTACT"===e)?(0,_.jsxs)("div",{children:[(0,_.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:(0,_.jsxs)(Z.Text,{className:"mt-2",children:[" ✨ ",e]})}),(0,_.jsx)(et.TextInput,{name:e,defaultValue:r,type:"password",disabled:!0,style:{width:"400px"}})]}):(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"mt-2",children:e}),(0,_.jsx)(et.TextInput,{name:e,defaultValue:r,type:"password",style:{width:"400px"}})]}),(0,_.jsxs)("p",{style:{fontSize:"small",fontStyle:"italic"},children:["SMTP_HOST"===e&&(0,_.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP host address, e.g. `smtp.resend.com`",(0,_.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_PORT"===e&&(0,_.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP port number, e.g. `587`",(0,_.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_USERNAME"===e&&(0,_.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP username, e.g. `username`",(0,_.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_PASSWORD"===e&&(0,_.jsx)("span",{style:{color:"red"},children:" Required * "}),"SMTP_SENDER_EMAIL"===e&&(0,_.jsxs)("div",{style:{color:"gray"},children:["Enter the sender email address, e.g. `sender@berri.ai`",(0,_.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"TEST_EMAIL_ADDRESS"===e&&(0,_.jsxs)("div",{style:{color:"gray"},children:["Email Address to send `Test Email Alert` to. example: `info@berri.ai`",(0,_.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"EMAIL_LOGO_URL"===e&&(0,_.jsx)("div",{style:{color:"gray"},children:"(Optional) Customize the Logo that appears in the email, pass a url to your logo"}),"EMAIL_SUPPORT_CONTACT"===e&&(0,_.jsx)("div",{style:{color:"gray"},children:"(Optional) Customize the support email address that appears in the email. Default is support@berri.ai"})]})]},e))})})},r))}),(0,_.jsx)(S.Button,{className:"mt-2",onClick:()=>a(),children:"Save Changes"}),(0,_.jsx)(S.Button,{onClick:async()=>{if(e)try{await (0,Q.serviceHealthCheck)(e,"email"),J.default.success("Email test triggered. Check your configured email inbox/logs.")}catch(e){J.default.fromBackend(e)}},className:"mx-2",children:"Test Email Alerts"})]})]})};var IO=e.i(905536);let ID=({alertingSettings:e,handleInputChange:t,handleResetField:r,handleSubmit:a,premiumUser:s})=>{let[n]=H.Form.useForm();return(0,_.jsxs)(H.Form,{form:n,onFinish:()=>{console.log("INSIDE ONFINISH");let e=n.getFieldsValue(),t=Object.entries(e).every(([e,t])=>"boolean"!=typeof t&&(""===t||null==t));console.log(`formData: ${JSON.stringify(e)}, isEmpty: ${t}`),t?console.log("Some form fields are empty."):a(e)},labelAlign:"left",children:[e.map((e,a)=>(0,_.jsxs)(R.TableRow,{children:[(0,_.jsxs)(I.TableCell,{align:"center",children:[(0,_.jsx)(Z.Text,{children:e.field_name}),(0,_.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:e.field_description})]}),e.premium_field?s?(0,_.jsx)(H.Form.Item,{name:e.field_name,children:(0,_.jsx)(I.TableCell,{children:"Integer"===e.field_type?(0,_.jsx)(tq.InputNumber,{step:1,value:e.field_value,onChange:r=>t(e.field_name,r)}):"Boolean"===e.field_type?(0,_.jsx)(wL.Switch,{checked:e.field_value,onChange:r=>t(e.field_name,r)}):(0,_.jsx)($.Input,{value:e.field_value,onChange:r=>t(e.field_name,r)})})}):(0,_.jsx)(I.TableCell,{children:(0,_.jsx)(S.Button,{className:"flex items-center justify-center",children:(0,_.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Enterprise Feature"})})}):(0,_.jsx)(H.Form.Item,{name:e.field_name,className:"mb-0",valuePropName:"Boolean"===e.field_type?"checked":"value",children:(0,_.jsx)(I.TableCell,{children:"Integer"===e.field_type?(0,_.jsx)(tq.InputNumber,{step:1,value:e.field_value,onChange:r=>t(e.field_name,r),className:"p-0"}):"Boolean"===e.field_type?(0,_.jsx)(wL.Switch,{checked:e.field_value,onChange:r=>{t(e.field_name,r),n.setFieldsValue({[e.field_name]:r})}}):(0,_.jsx)($.Input,{value:e.field_value,onChange:r=>t(e.field_name,r)})})}),(0,_.jsx)(I.TableCell,{children:!0==e.stored_in_db?(0,_.jsx)(tR.Badge,{icon:jr.CheckCircleIcon,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,_.jsx)(tR.Badge,{className:"text-gray bg-white outline",children:"In Config"}):(0,_.jsx)(tR.Badge,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,_.jsx)(I.TableCell,{children:(0,_.jsx)(yi.Icon,{icon:jO.TrashIcon,color:"red",onClick:()=>r(e.field_name,a),children:"Reset"})})]},a)),(0,_.jsx)("div",{children:(0,_.jsx)(z.Button,{htmlType:"submit",children:"Update Settings"})})]})},IP=({accessToken:e,premiumUser:t})=>{let[r,a]=(0,T.useState)([]);return(0,T.useEffect)(()=>{e&&(0,Q.alertingSettingsCall)(e).then(e=>{a(e)})},[e]),(0,_.jsx)(ID,{alertingSettings:r,handleInputChange:(e,t)=>{let s=r.map(r=>r.field_name===e?{...r,field_value:t}:r);console.log(`updatedSettings: ${JSON.stringify(s)}`),a(s)},handleResetField:(t,s)=>{if(e)try{let e=r.map(e=>e.field_name===t?{...e,stored_in_db:null,field_value:e.field_default_value}:e);a(e)}catch(e){console.log("ERROR OCCURRED!")}},handleSubmit:t=>{if(!e)return;if(console.log(`formValues: ${t}`),null==t||void 0==t)return;let a={};r.forEach(e=>{a[e.field_name]=e.field_value});let s={...t,...a};console.log(`mergedFormValues: ${JSON.stringify(s)}`);let{slack_alerting:n,...l}=s;console.log(`slack_alerting: ${n}, alertingArgs: ${JSON.stringify(l)}`);try{(0,Q.updateConfigFieldSetting)(e,"alerting_args",l),"boolean"==typeof n&&(!0==n?(0,Q.updateConfigFieldSetting)(e,"alerting",["slack"]):(0,Q.updateConfigFieldSetting)(e,"alerting",[])),J.default.success("Wait 10s for proxy to update.")}catch(e){}},premiumUser:t})},IA=(0,ej.createQueryKeys)("cloudZeroSettings"),IE=async e=>{let t=(0,Q.getProxyBaseUrl)(),r=t?`${t}/cloudzero/settings`:"/cloudzero/settings",a=await fetch(r,{method:"GET",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!a.ok){let e="Failed to fetch CloudZero settings";try{let t=await a.json();"object"==typeof t&&null!==t?e=t?.error?.message||t?.error||t?.message||t?.detail||("string"==typeof t?.error?t.error:e):"string"==typeof t&&(e=t)}catch{e=a.statusText||e}throw Error(e)}let s=await a.json();return s&&(s.api_key_masked||s.connection_id)?s:null},II=async(e,t)=>{let r=(0,Q.getProxyBaseUrl)(),a=r?`${r}/cloudzero/settings`:"/cloudzero/settings",s=await fetch(a,{method:"PUT",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({...t.connection_id&&{connection_id:t.connection_id},...t.timezone&&{timezone:t.timezone},...t.api_key&&{api_key:t.api_key}})});if(!s.ok){let e="Failed to update CloudZero settings";try{let t=await s.json();"object"==typeof t&&null!==t?e=t?.error?.message||t?.error||t?.message||t?.detail||("string"==typeof t?.error?t.error:e):"string"==typeof t&&(e=t)}catch{e=s.statusText||e}throw Error(e)}return await s.json()},IY=async e=>{let t=(0,Q.getProxyBaseUrl)(),r=t?`${t}/cloudzero/delete`:"/cloudzero/delete",a=await fetch(r,{method:"DELETE",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!a.ok){let e="Failed to delete CloudZero settings";try{let t=await a.json();"object"==typeof t&&null!==t?e=t?.error?.message||t?.error||t?.message||t?.detail||("string"==typeof t?.error?t.error:e):"string"==typeof t&&(e=t)}catch{e=a.statusText||e}throw Error(e)}return await a.json()},{Title:IF,Paragraph:IR}=V.Typography;function IB({startCreation:e}){return(0,_.jsx)("div",{className:"bg-white p-12 rounded-lg border border-dashed border-gray-300 text-center max-w-2xl mx-auto mt-8",children:(0,_.jsx)(e0.Empty,{image:e0.Empty.PRESENTED_IMAGE_SIMPLE,description:(0,_.jsxs)("div",{className:"space-y-2",children:[(0,_.jsx)(IF,{level:4,children:"No CloudZero Integration Found"}),(0,_.jsx)(IR,{type:"secondary",className:"max-w-md mx-auto",children:"Connect your CloudZero account to start tracking and analyzing your cloud costs directly from LiteLLM."})]}),children:(0,_.jsx)(z.Button,{type:"primary",size:"large",onClick:e,className:"flex items-center gap-2 mx-auto mt-4",children:"Add CloudZero Integration"})})})}let Iz=async(e,t)=>{let r=(0,Q.getProxyBaseUrl)(),a=r?`${r}/cloudzero/init`:"/cloudzero/init",s=await fetch(a,{method:"POST",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({connection_id:t.connection_id,timezone:t.timezone??"UTC",...t.api_key&&{api_key:t.api_key}})});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(e?.error?.message||e?.message||e?.detail||"Failed to create CloudZero integration")}return await s.json()};function IH({open:e,onOk:t,onCancel:r}){let a,{accessToken:s}=(0,k.default)(),[n]=H.Form.useForm(),l=(a=s||"",(0,ep.useMutation)({mutationFn:async e=>{if(!a)throw Error("Access token is required");return await Iz(a,e)}}));(0,T.useEffect)(()=>{e&&n.resetFields()},[e,n]);let i=async()=>{try{let e=await n.validateFields();l.mutate({connection_id:e.connection_id,timezone:e.timezone||"UTC",...e.api_key&&{api_key:e.api_key}},{onSuccess:()=>{tU.default.success("CloudZero integration created successfully"),n.resetFields(),t()},onError:e=>{e?.errorFields||tU.default.error(e?.message||"Failed to create CloudZero integration")}})}catch(e){if(e?.errorFields)return;tU.default.error(e?.message||"Failed to create CloudZero integration")}};return(0,_.jsx)(q.Modal,{title:"Create CloudZero Integration",open:e,onOk:i,onCancel:()=>{n.resetFields(),r()},confirmLoading:l.isPending,okText:l.isPending?"Creating...":"Create",cancelText:"Cancel",okButtonProps:{disabled:l.isPending},cancelButtonProps:{disabled:l.isPending},children:(0,_.jsxs)(H.Form,{form:n,layout:"vertical",onFinish:i,children:[(0,_.jsx)(H.Form.Item,{label:"CloudZero API Key",name:"api_key",rules:[{required:!0,message:"Please enter your CloudZero API key"}],children:(0,_.jsx)($.Input.Password,{placeholder:"Enter your CloudZero API key"})}),(0,_.jsx)(H.Form.Item,{label:"Connection ID",name:"connection_id",rules:[{required:!0,message:"Please enter your CloudZero connection ID"}],children:(0,_.jsx)($.Input,{placeholder:"Enter your CloudZero connection ID"})}),(0,_.jsx)(H.Form.Item,{label:"Timezone",name:"timezone",tooltip:"Timezone for date handling (defaults to UTC if not provided)",children:(0,_.jsx)($.Input,{placeholder:"UTC"})})]})})}let I$=async(e,t={})=>{let r=(0,Q.getProxyBaseUrl)(),a=r?`${r}/cloudzero/dry-run`:"/cloudzero/dry-run",s=await fetch(a,{method:"POST",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({limit:t.limit??10})});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(e?.error?.message||e?.message||e?.detail||"Failed to perform dry run")}return await s.json()},Iq=async(e,t={})=>{let r=(0,Q.getProxyBaseUrl)(),a=r?`${r}/cloudzero/export`:"/cloudzero/export",s=await fetch(a,{method:"POST",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({operation:t.operation??"replace_hourly"})});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(e?.error?.message||e?.message||e?.detail||"Failed to export data")}return await s.json()};var IU=e.i(883552);let IW=(0,eT.default)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);var IV=e.i(431343),IG=e.i(569074);function IK({open:e,onOk:t,onCancel:r,settings:a}){var s;let n,{accessToken:l}=(0,k.default)(),[i]=H.Form.useForm(),o=(s=l||"",n=(0,eh.useQueryClient)(),(0,ep.useMutation)({mutationFn:async e=>{if(!s)throw Error("Access token is required");return await II(s,e)},onSuccess:()=>{n.invalidateQueries({queryKey:IA.list({})})}}));(0,T.useEffect)(()=>{e&&a?i.setFieldsValue({connection_id:a.connection_id,timezone:a.timezone||"UTC",api_key:""}):e&&i.resetFields()},[e,a,i]);let d=async()=>{try{let e=await i.validateFields();o.mutate({connection_id:e.connection_id,timezone:e.timezone||"UTC",...e.api_key&&{api_key:e.api_key}},{onSuccess:()=>{tU.default.success("CloudZero integration updated successfully"),i.resetFields(),t()},onError:e=>{e?.errorFields||tU.default.error(e?.message||"Failed to update CloudZero integration")}})}catch(e){if(e?.errorFields)return;tU.default.error(e?.message||"Failed to update CloudZero integration")}};return(0,_.jsx)(q.Modal,{title:"Edit CloudZero Integration",open:e,onOk:d,onCancel:()=>{i.resetFields(),r()},confirmLoading:o.isPending,okText:o.isPending?"Updating...":"Update",cancelText:"Cancel",okButtonProps:{disabled:o.isPending},cancelButtonProps:{disabled:o.isPending},children:(0,_.jsxs)(H.Form,{form:i,layout:"vertical",onFinish:d,children:[(0,_.jsx)(H.Form.Item,{label:"CloudZero API Key",name:"api_key",rules:[{required:!1,message:"Please enter your CloudZero API key"}],tooltip:"Leave empty to keep the existing API key",children:(0,_.jsx)($.Input.Password,{placeholder:"Leave empty to keep existing"})}),(0,_.jsx)(H.Form.Item,{label:"Connection ID",name:"connection_id",rules:[{required:!0,message:"Please enter your CloudZero connection ID"}],children:(0,_.jsx)($.Input,{placeholder:"Enter your CloudZero connection ID"})}),(0,_.jsx)(H.Form.Item,{label:"Timezone",name:"timezone",tooltip:"Timezone for date handling (defaults to UTC if not provided)",children:(0,_.jsx)($.Input,{placeholder:"UTC"})})]})})}function IJ({settings:e,onSettingsUpdated:t}){var r;let a,s,n,{accessToken:l}=(0,k.default)(),[i,o]=(0,T.useState)(!1),[d,c]=(0,T.useState)(!1),u=(a=l||"",(0,ep.useMutation)({mutationFn:async(e={})=>{if(!a)throw Error("Access token is required");return await I$(a,e)}})),m=(s=l||"",(0,ep.useMutation)({mutationFn:async(e={})=>{if(!s)throw Error("Access token is required");return await Iq(s,e)}})),p=(r=l||"",n=(0,eh.useQueryClient)(),(0,ep.useMutation)({mutationFn:async()=>{if(!r)throw Error("Access token is required");return await IY(r)},onSuccess:()=>{n.invalidateQueries({queryKey:IA.list({})})}})),h=u.data?JSON.stringify(u.data,null,2):null,f=async()=>{o(!1),t()};return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"space-y-6 w-full max-w-4xl mx-auto",children:(0,_.jsxs)(eg.Card,{title:(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("span",{className:"text-lg font-semibold",children:"CloudZero Configuration"}),(0,_.jsx)(eN.Tag,{color:"success",className:"ml-2 capitalize",children:e.status||"Active"})]}),extra:(0,_.jsxs)("div",{className:"flex gap-2",children:[(0,_.jsx)(z.Button,{icon:(0,_.jsx)(eM,{size:16}),onClick:()=>{o(!0)},className:"flex items-center gap-2",children:"Edit"}),(0,_.jsx)(z.Button,{danger:!0,icon:(0,_.jsx)(eL.Trash2,{size:16}),onClick:()=>{c(!0)},className:"flex items-center gap-2",children:"Delete"})]}),className:"shadow-sm",children:[(0,_.jsxs)(eS.Descriptions,{bordered:!0,column:{xxl:1,xl:1,lg:1,md:1,sm:1,xs:1},children:[(0,_.jsx)(eS.Descriptions.Item,{label:"API Key (Redacted)",children:(0,_.jsx)("span",{className:"font-mono text-gray-600",children:e.api_key_masked||(0,_.jsx)("span",{className:"text-gray-400 italic",children:"Not configured"})})}),(0,_.jsx)(eS.Descriptions.Item,{label:"Connection ID",children:(0,_.jsx)("span",{className:"font-mono text-gray-600",children:e.connection_id||(0,_.jsx)("span",{className:"text-gray-400 italic",children:"Not configured"})})}),(0,_.jsx)(eS.Descriptions.Item,{label:"Timezone",children:e.timezone||(0,_.jsx)("span",{className:"text-gray-400 italic",children:"Default (UTC)"})})]}),(0,_.jsx)(eG.Divider,{orientation:"left",className:"text-gray-500",children:"Actions"}),(0,_.jsxs)("div",{className:"flex flex-wrap gap-4 mb-6",children:[(0,_.jsx)(z.Button,{onClick:()=>{l&&u.mutate({limit:10},{onSuccess:e=>{tU.default.success("Dry run completed successfully")},onError:e=>{tU.default.error(e?.message||"Failed to perform dry run")}})},loading:u.isPending,icon:(0,_.jsx)(IV.Play,{size:16}),className:"flex items-center gap-2",children:"Run Dry Run Simulation"}),(0,_.jsx)(IU.Popconfirm,{title:"Export Data to CloudZero",description:"This will push the current accumulated cost data to CloudZero. Continue?",onConfirm:()=>{l&&m.mutate({operation:"replace_hourly"},{onSuccess:()=>{tU.default.success("Data successfully exported to CloudZero")},onError:e=>{tU.default.error(e?.message||"Failed to export data")}})},okText:"Export",cancelText:"Cancel",children:(0,_.jsx)(z.Button,{type:"primary",loading:m.isPending,icon:(0,_.jsx)(IG.Upload,{size:16}),className:"flex items-center gap-2",children:"Export Data Now"})})]}),h&&(0,_.jsx)("div",{className:"mt-6 animate-in fade-in slide-in-from-top-4 duration-300",children:(0,_.jsx)(B.Alert,{message:"Dry Run Results",description:(0,_.jsxs)("div",{className:"mt-2",children:[(0,_.jsxs)("p",{className:"mb-2 text-gray-600",children:["Simulation output for connection: ",e.connection_id]}),(0,_.jsx)("pre",{className:"bg-gray-50 p-4 rounded-md border border-gray-200 overflow-x-auto text-xs font-mono text-gray-800",children:h})]}),type:"info",showIcon:!0,icon:(0,_.jsx)(IW,{className:"text-blue-500"})})})]})}),(0,_.jsx)(IK,{open:i,onOk:f,onCancel:()=>{o(!1)},settings:e}),(0,_.jsx)(eH.default,{isOpen:d,title:"Delete CloudZero Integration?",message:"Are you sure you want to delete this CloudZero integration? All associated settings and configurations will be permanently removed.",resourceInformationTitle:"Integration Details",resourceInformation:[{label:"Connection ID",value:e.connection_id,code:!0},{label:"Timezone",value:e.timezone||"Default (UTC)"}],onCancel:()=>{c(!1)},onOk:()=>{l&&p.mutate(void 0,{onSuccess:()=>{tU.default.success("CloudZero integration deleted successfully"),c(!1),t()},onError:e=>{tU.default.error(e?.message||"Failed to delete CloudZero integration")}})},confirmLoading:p.isPending})]})}function IQ(){let{accessToken:e}=(0,k.default)(),{data:t,isLoading:r,error:a}=(0,ev.useQuery)({queryKey:IA.list({}),queryFn:async()=>await IE(e),enabled:!!e,staleTime:36e5,gcTime:36e5}),s=(0,eh.useQueryClient)(),n=(0,ej.createQueryKeys)("cloudZeroSettings"),[l,i]=(0,T.useState)(!1),o=async()=>{i(!1),await s.invalidateQueries({queryKey:n.list({})})};return r?(0,_.jsx)(eg.Card,{children:(0,_.jsx)(V.Typography.Text,{children:"Loading CloudZero settings..."})}):a?(0,_.jsx)(eg.Card,{children:(0,_.jsxs)(V.Typography.Text,{className:"text-red-600",children:["Error loading CloudZero settings: ",a instanceof Error?a.message:String(a)]})}):t?(0,_.jsx)(_.Fragment,{children:(0,_.jsx)(IJ,{settings:t,onSettingsUpdated:o})}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(IB,{startCreation:()=>i(!0)}),(0,_.jsx)(IH,{open:l,onOk:o,onCancel:()=>{i(!1)}})]})}var IX=e.i(335771);let IZ=[{value:"success",label:"Success"},{value:"failure",label:"Failure"},{value:"success_and_failure",label:"Success & Failure"}],I0=({callbacks:e,availableCallbacks:t={},onTest:r=()=>{},onEdit:a=()=>{},onDelete:s=()=>{},onAdd:n=()=>{}})=>{let l=[{title:(0,_.jsx)("span",{className:"font-medium text-gray-700",children:"Callback Name"}),dataIndex:"name",key:"name",render:(e,r)=>{let a=r.name;console.log("availableCallbacks",t);let s=t[a]?.ui_callback_name||a;return(0,_.jsx)("div",{className:"font-medium text-gray-800",children:s})}},{title:(0,_.jsx)("span",{className:"font-medium text-gray-700",children:"Mode"}),key:"mode",render:(e,t)=>{let r=t.mode||"success",a=IZ.find(e=>e.value===r)?.label||r,s="success"===r?"bg-green-100 text-green-800":"failure"===r?"bg-red-100 text-red-800":"bg-blue-100 text-blue-800";return(0,_.jsx)("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${s}`,children:a})},width:240},{title:(0,_.jsx)("span",{className:"font-medium text-gray-700 text-right w-full block",children:"Actions"}),key:"actions",align:"right",render:(e,t)=>(0,_.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,_.jsx)(rG.default,{variant:"Test",tooltipText:"Test Callback",onClick:()=>r(t)}),(0,_.jsx)(rG.default,{variant:"Edit",tooltipText:"Edit Callback",onClick:()=>a(t)}),(0,_.jsx)(rG.default,{variant:"Delete",tooltipText:"Delete Callback",onClick:()=>s(t)})]}),width:240}];return(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)("div",{className:"w-full mt-4",children:[(0,_.jsx)(S.Button,{onClick:n,className:"mx-auto",children:"+ Add Callback"}),(0,_.jsx)("div",{className:"flex justify-between items-center my-2",children:(0,_.jsx)(IX.default,{level:4,children:"Active Logging Callbacks"})}),0===e.length?(0,_.jsx)("div",{className:"flex flex-col items-center justify-center p-8 bg-gray-50 border border-gray-200 rounded-lg",children:(0,_.jsxs)("div",{className:"text-center",children:[(0,_.jsx)("h3",{className:"text-lg font-medium text-gray-700 mb-2",children:"No callbacks configured"}),(0,_.jsx)("p",{className:"text-gray-500",children:"Add your first callback to start logging data to external services."})]})}):(0,_.jsx)("div",{className:"bg-white border border-gray-200 rounded-lg overflow-hidden",children:(0,_.jsx)(eK.Table,{columns:l,dataSource:e,rowKey:e=>e.name,pagination:!1,rowClassName:()=>"hover:bg-gray-50"})})]})})},{Title:I1,Paragraph:I2}=V.Typography,I4=({params:e,callbackConfigs:t,selectedCallback:r})=>e&&0!==e.length?(0,_.jsx)("div",{className:"space-y-4 mt-6 p-4 bg-gray-50 rounded-lg border",children:e.map(e=>{let a=t.find(e=>e.id===r),s=a?.dynamic_params?.[e]||{},n=s.type||"text",l=s.ui_name||e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),i=s.required||!1;return(0,_.jsx)(IO.default,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:[l," "]}),name:e,className:"mb-4",rules:i?[{required:!0,message:`Please enter the ${l.toLowerCase()}`}]:void 0,children:"password"===n?(0,_.jsx)($.Input.Password,{size:"large",placeholder:`Enter your ${l.toLowerCase()}`,className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}):"number"===n?(0,_.jsx)($.Input,{type:"number",size:"large",placeholder:`Enter ${l.toLowerCase()}`,className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",min:0,max:1,step:.1}):(0,_.jsx)($.Input,{size:"large",placeholder:`Enter your ${l.toLowerCase()}`,className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"})},e)})}):null,I5=({callbackConfigs:e,selectedCallback:t,onCallbackChange:r,disabled:a=!1})=>(0,_.jsx)(IO.default,{label:"Callback",name:"callback",rules:a?void 0:[{required:!0,message:"Please select a callback"}],children:(0,_.jsx)(eE.Select,{placeholder:"Choose a logging callback...",size:"large",className:"w-full",showSearch:!0,disabled:a,value:t,filterOption:(e,t)=>(t?.value?.toString()??"").toLowerCase().includes(e.toLowerCase()),onChange:r,children:e.map(e=>{let t=e.logo,r=t&&(t.includes("/")||t.startsWith("data:")||t.startsWith("http"))?t:`../ui/assets/logos/${t}`;return(0,_.jsx)(ju.SelectItem,{value:e.id,children:(0,_.jsxs)("div",{className:"flex items-center space-x-3 py-1",children:[(0,_.jsx)("div",{className:"w-6 h-6 flex items-center justify-center",children:(0,_.jsx)("img",{src:r,alt:`${e.displayName} logo`,className:"w-6 h-6 rounded object-contain",onError:e=>{e.currentTarget.style.display="none"}})}),(0,_.jsx)("span",{className:"font-medium text-gray-900",children:e.displayName})]})},e.id)})})}),I6=(e,t,r)=>{if(!e)return r?Object.keys(r):[];let a=t.find(t=>t.id===e);return a?.dynamic_params?Object.keys(a.dynamic_params):r?Object.keys(r):[]},I3=({accessToken:e,userRole:t,userID:r,premiumUser:a})=>{let[s,n]=(0,T.useState)([]),[l,i]=(0,T.useState)([]),[o,d]=(0,T.useState)(!1),[c]=H.Form.useForm(),[u]=H.Form.useForm(),[m,p]=(0,T.useState)(null),[h,f]=(0,T.useState)(""),[x,g]=(0,T.useState)({}),[y,b]=(0,T.useState)([]),[v,j]=(0,T.useState)(!1),[w,k]=(0,T.useState)([]),[N,M]=(0,T.useState)({}),[C,L]=(0,T.useState)([]),[O,D]=(0,T.useState)(!1),[B,$]=(0,T.useState)(null),[U,W]=(0,T.useState)(!1),[V,G]=(0,T.useState)(null),[K,X]=(0,T.useState)(!1),[er,ea]=(0,T.useState)(!1),[es,en]=(0,T.useState)(!1);(0,T.useEffect)(()=>{e&&(0,Q.getCallbackConfigsCall)(e).then(e=>{k(e||[])}).catch(e=>{J.default.fromBackend("Failed to load callback configs: "+(0,ec.parseErrorMessage)(e))})},[e]),(0,T.useEffect)(()=>{if(O&&B){let e=Object.fromEntries(Object.entries(B.variables||{}).map(([e,t])=>[e,t??""]));u.setFieldsValue({...e,callback:B.name})}},[O,B,u]);let el=e=>{y.includes(e)?b(y.filter(t=>t!==e)):b([...y,e])},ei={llm_exceptions:"LLM Exceptions",llm_too_slow:"LLM Responses Too Slow",llm_requests_hanging:"LLM Requests Hanging",budget_alerts:"Budget Alerts (API Keys, Users)",db_exceptions:"Database Exceptions (Read/Write)",daily_reports:"Weekly/Monthly Spend Reports",outage_alerts:"Outage Alerts",region_outage_alerts:"Region Outage Alerts"};(0,T.useEffect)(()=>{e&&t&&r&&(0,Q.getCallbacksCall)(e,r,t).then(e=>{n(e.callbacks),M(e.available_callbacks);let t=e.alerts;if(t&&t.length>0){let e=t[0],r=e.variables.SLACK_WEBHOOK_URL;b(e.active_alerts),f(r),g(e.alerts_to_webhook)}i(t)})},[e,t,r]);let eo=e=>y&&y.includes(e),ed=async(a,s,l)=>{if(e){l?X(!0):ea(!0);try{if(await (0,Q.setCallbacksCall)(e,{environment_variables:a,litellm_settings:{success_callback:[s]}}),J.default.success(l?"Callback updated successfully":`Callback ${s} added successfully`),l?(D(!1),u.resetFields(),$(null)):(j(!1),c.resetFields(),p(null),L([])),r&&t){let a=await (0,Q.getCallbacksCall)(e,r,t);n(a.callbacks)}}catch(e){J.default.fromBackend(e)}finally{l?X(!1):ea(!1)}}},eu=async e=>{B&&await ed(e,B.name,!0)},em=async e=>{let t=e?.callback;t&&await ed(e,t,!1)},ep=async()=>{if(!e)return;let t={};Object.entries(ei).forEach(([e,r])=>{let a=document.querySelector(`input[name="${e}"]`),s=a?.value||"";t[e]=s});try{await (0,Q.setCallbacksCall)(e,{general_settings:{alert_to_webhook_url:t,alert_types:y}})}catch(e){J.default.fromBackend(e)}J.default.success("Alerts updated successfully")},eh=async()=>{if(V&&e)try{if(en(!0),await (0,Q.deleteCallback)(e,V.name),J.default.success(`Callback ${V.name} deleted successfully`),r&&t){let a=await (0,Q.getCallbacksCall)(e,r,t);n(a.callbacks)}W(!1),G(null)}catch(e){console.error("Failed to delete callback:",e),J.default.fromBackend(e)}finally{en(!1)}};return e?(0,_.jsxs)("div",{className:"w-full mx-4",children:[(0,_.jsx)(ee.Grid,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)(rR.TabList,{variant:"line",defaultValue:"1",children:[(0,_.jsx)(rY.Tab,{value:"1",children:"Logging Callbacks"}),(0,_.jsx)(rY.Tab,{value:"2",children:"CloudZero Cost Tracking"}),(0,_.jsx)(rY.Tab,{value:"2",children:"Alerting Types"}),(0,_.jsx)(rY.Tab,{value:"3",children:"Alerting Settings"}),(0,_.jsx)(rY.Tab,{value:"4",children:"Email Alerts"})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(I0,{callbacks:s,availableCallbacks:N,onAdd:()=>j(!0),onEdit:e=>{$(e),D(!0)},onDelete:e=>{G(e),W(!0)},onTest:async t=>{try{await (0,Q.serviceHealthCheck)(e,t.name),J.default.success("Health check triggered")}catch(e){J.default.fromBackend((0,ec.parseErrorMessage)(e))}}})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)("div",{className:"p-8",children:(0,_.jsx)(IQ,{})})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)(Z.Text,{className:"my-2",children:["Alerts are only supported for Slack Webhook URLs. Get your webhook urls from"," ",(0,_.jsx)("a",{href:"https://api.slack.com/messaging/webhooks",target:"_blank",style:{color:"blue"},children:"here"})]}),(0,_.jsxs)(A.Table,{children:[(0,_.jsx)(Y.TableHead,{children:(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(F.TableHeaderCell,{}),(0,_.jsx)(F.TableHeaderCell,{}),(0,_.jsx)(F.TableHeaderCell,{children:"Slack Webhook URL"})]})}),(0,_.jsx)(E.TableBody,{children:Object.entries(ei).map(([e,t],r)=>(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(I.TableCell,{children:"region_outage_alerts"==e?a?(0,_.jsx)(wL.Switch,{id:"switch",name:"switch",checked:eo(e),onChange:()=>el(e)}):(0,_.jsx)(S.Button,{className:"flex items-center justify-center",children:(0,_.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Enterprise Feature"})}):(0,_.jsx)(wL.Switch,{id:"switch",name:"switch",checked:eo(e),onChange:()=>el(e)})}),(0,_.jsx)(I.TableCell,{children:(0,_.jsx)(Z.Text,{children:t})}),(0,_.jsx)(I.TableCell,{children:(0,_.jsx)(et.TextInput,{name:e,type:"password",defaultValue:x&&x[e]?x[e]:h})})]},r))})]}),(0,_.jsx)(S.Button,{size:"xs",className:"mt-2",onClick:ep,children:"Save Changes"}),(0,_.jsx)(S.Button,{onClick:async()=>{try{await (0,Q.serviceHealthCheck)(e,"slack"),J.default.success("Alert test triggered. Test request to slack made - check logs/alerts on slack to verify")}catch(e){J.default.fromBackend((0,ec.parseErrorMessage)(e))}},className:"mx-2",children:"Test Alerts"})]})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(IP,{accessToken:e,premiumUser:a})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(IL,{accessToken:e,premiumUser:a,alerts:l})})]})]})}),(0,_.jsxs)(q.Modal,{title:"Add Logging Callback",open:v,width:800,onCancel:()=>{j(!1),p(null),L([])},footer:null,children:[(0,_.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/logging",className:"mb-8 mt-4",target:"_blank",style:{color:"blue"},children:[" ","LiteLLM Docs: Logging"]}),(0,_.jsxs)(H.Form,{form:c,onFinish:em,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,_.jsx)(I5,{callbackConfigs:w,selectedCallback:m,onCallbackChange:e=>{p(e),L(I6(e,w))}}),(0,_.jsx)(I4,{params:C,callbackConfigs:w,selectedCallback:m}),(0,_.jsxs)("div",{className:"flex justify-end space-x-3 pt-6 mt-6 border-t border-gray-200",children:[(0,_.jsx)(z.Button,{onClick:()=>{j(!1),p(null),L([]),c.resetFields()},disabled:er,children:"Cancel"}),(0,_.jsx)(z.Button,{htmlType:"submit",loading:er,disabled:er,children:er?"Adding...":"Add Callback"})]})]})]}),(0,_.jsx)(q.Modal,{open:O,width:800,title:"Edit Callback Settings",onCancel:()=>{D(!1),$(null),u.resetFields()},footer:null,children:(0,_.jsxs)(H.Form,{form:u,onFinish:eu,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[B&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(I5,{callbackConfigs:w,selectedCallback:B.name,onCallbackChange:()=>{},disabled:!0}),(0,_.jsx)(I4,{params:I6(B.name,w,B.variables),callbackConfigs:w,selectedCallback:B.name})]}),(0,_.jsxs)("div",{className:"flex justify-end space-x-3 pt-6 mt-6 border-t border-gray-200",children:[(0,_.jsx)(z.Button,{onClick:()=>{D(!1),$(null),u.resetFields()},disabled:K,children:"Cancel"}),(0,_.jsx)(z.Button,{onClick:()=>{u.submit()},loading:K,disabled:K,children:K?"Saving...":"Save Changes"})]})]})}),(0,_.jsx)(eH.default,{isOpen:U,title:"Delete Callback",message:"Are you sure you want to delete this callback? This action cannot be undone.",resourceInformationTitle:"Callback Information",resourceInformation:[{label:"Callback Name",value:V?.name},{label:"Mode",value:V?.mode||"success"}],onCancel:()=>{W(!1),G(null)},onOk:eh,confirmLoading:es})]}):null};var I8=e.i(686311),I7=e.i(37727),I9=e.i(643531),Ye=e.i(636772),Yt=e.i(115571);function Yr({onOpen:e,onDismiss:t,isVisible:r,title:a,description:s,buttonText:n,icon:l,accentColor:i,buttonStyle:o}){let d=(0,Ye.useDisableShowPrompts)(),[c,u]=(0,T.useState)(100),[m,p]=(0,T.useState)(!1);return((0,T.useEffect)(()=>{if(!r){u(100),p(!1);return}let e=Date.now(),t=setInterval(()=>{let r=Math.max(0,100-(Date.now()-e)/15e3*100);u(r),r<=0&&clearInterval(t)},50);return()=>clearInterval(t)},[r]),(0,T.useEffect)(()=>{if(m){let e=setTimeout(()=>{p(!1),t()},5e3);return()=>clearTimeout(e)}},[m,t]),m)?(0,_.jsx)("div",{className:`fixed bottom-6 right-6 z-40 w-80 bg-white rounded-lg shadow-xl border border-gray-200 overflow-hidden transform transition-all duration-300 ease-out ${r?"translate-y-0 opacity-100 scale-100":"translate-y-4 opacity-0 scale-95"}`,children:(0,_.jsx)("div",{className:"p-4",children:(0,_.jsxs)("div",{className:"flex items-center gap-3",children:[(0,_.jsx)("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-green-100 flex items-center justify-center",children:(0,_.jsx)(I9.Check,{className:"h-5 w-5 text-green-600"})}),(0,_.jsx)("div",{className:"flex-1",children:(0,_.jsx)("p",{className:"text-sm text-gray-700 font-medium",children:"Got it, we will not ask again. Reactivate this at any time in the User Menu."})})]})})}):!r||d?null:(0,_.jsxs)("div",{className:`fixed bottom-6 right-6 z-40 w-80 bg-white rounded-lg shadow-xl border border-gray-200 overflow-hidden transform transition-all duration-300 ease-out ${r?"translate-y-0 opacity-100 scale-100":"translate-y-4 opacity-0 scale-95"}`,children:[(0,_.jsx)("div",{className:"h-1 bg-gray-100 w-full",children:(0,_.jsx)("div",{className:"h-full transition-all duration-100 ease-linear",style:{width:`${c}%`,backgroundColor:i}})}),(0,_.jsxs)("div",{className:"p-4",children:[(0,_.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",style:{color:i},children:[(0,_.jsx)(l,{className:"h-5 w-5"}),(0,_.jsx)("span",{className:"font-semibold text-sm",children:a})]}),(0,_.jsx)("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 transition-colors p-0.5 rounded hover:bg-gray-100",children:(0,_.jsx)(I7.X,{className:"h-4 w-4"})})]}),(0,_.jsx)("p",{className:"text-sm text-gray-600 mb-3",children:s}),(0,_.jsxs)("div",{className:"space-y-2",children:[(0,_.jsx)(z.Button,{type:"primary",block:!0,onClick:e,style:o,children:n}),(0,_.jsx)(z.Button,{variant:"outlined",danger:!0,block:!0,onClick:()=>{(0,Yt.setLocalStorageItem)("disableShowPrompts","true"),(0,Yt.emitLocalStorageChange)("disableShowPrompts"),p(!0)},className:"text-xs",children:"Don't ask me again"})]})]})]})}function Ya({onOpen:e,onDismiss:t,isVisible:r}){return(0,_.jsx)(Yr,{onOpen:e,onDismiss:t,isVisible:r,title:"Quick feedback",description:"Help us improve LiteLLM! Share your experience in 5 quick questions.",buttonText:"Share feedback",icon:I8.MessageSquare,accentColor:"#3b82f6"})}var PW=PW;let Ys=[{id:"oss_adoption",label:"OSS Adoption",description:"Stars, contributors, forks, community support"},{id:"ai_integration",label:"AI Integration",description:"LiteLLM had the logging/guardrail integration we needed - Langfuse, OTEL, S3 logging, Azure Content Safety guardrails"},{id:"unified_api",label:"Unified API",description:"LiteLLM had the best OpenAI-compatible API across providers - OpenAI, Anthropic, Gemini, etc."},{id:"breadth_of_models",label:"Breadth of Models/Providers",description:"LiteLLM had the provider + endpoint combinations we needed - /ocr endpoint with Mistral OCR, /batches endppint with Bedrock API, etc."},{id:"other",label:"Other",description:"Something else not listed above"}];function Yn({isOpen:e,onClose:t,onComplete:r}){let[a,s]=(0,T.useState)(1),[n,l]=(0,T.useState)({usingAtCompany:null,companyName:"",startDate:"",reasons:[],otherReason:"",email:""}),[i,o]=(0,T.useState)(!1),d=!0===n.usingAtCompany?5:4;if(!e)return null;let c=async()=>{o(!0);try{let e={oss_adoption:"OSS Adoption (stars, contributors, forks)",ai_integration:"AI Integration (Langfuse, OTEL, S3, Azure Content Safety)",unified_api:"Unified API (OpenAI-compatible)",breadth_of_models:"Breadth of Models/Providers (/ocr, /batches, Bedrock, Azure OCR)"},t=n.reasons.map(t=>"other"===t&&n.otherReason?`Other: ${n.otherReason}`:e[t]||t),r=new URLSearchParams({"entry.2015264290":n.usingAtCompany?"Yes":"No","entry.1876243786":n.companyName||"","entry.1282591459":n.startDate,"entry.393456108":t.join(", "),"entry.928142208":n.email||""});await fetch("https://feedback.litellm.ai/survey",{method:"POST",mode:"no-cors",body:r})}catch(e){console.error("Failed to submit survey:",e)}o(!1),r()},u=(e,t)=>{l(r=>({...r,[e]:t}))},m=e=>{l(t=>({...t,reasons:t.reasons.includes(e)?t.reasons.filter(t=>t!==e):[...t.reasons,e]}))},p=()=>{if(!1===n.usingAtCompany){if(1===a)return 1;if(3===a)return 2;if(4===a)return 3;if(5===a)return 4}return a},h=5===a;return(0,_.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6",children:[(0,_.jsx)("div",{className:"fixed inset-0 bg-black/40 backdrop-blur-sm",onClick:t}),(0,_.jsxs)("div",{className:"relative w-full max-w-lg bg-white rounded-xl shadow-2xl overflow-hidden flex flex-col max-h-[90vh] transform transition-all duration-300 ease-out",children:[(0,_.jsxs)("div",{className:"px-6 py-4 border-b border-gray-100 flex items-center justify-between bg-gray-50/50",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2 text-blue-600",children:[(0,_.jsx)(I8.MessageSquare,{className:"h-5 w-5"}),(0,_.jsx)("span",{className:"font-semibold text-sm tracking-wide uppercase",children:"Quick Feedback"})]}),(0,_.jsx)("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 transition-colors p-1 rounded-full hover:bg-gray-100",children:(0,_.jsx)(I7.X,{className:"h-5 w-5"})})]}),(0,_.jsx)(PW.default,{percent:p()/d*100,showInfo:!1,strokeColor:"#2563eb",className:"m-0"}),(0,_.jsx)("div",{className:"p-8 flex-1 overflow-y-auto",children:1===a?(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Are you using LiteLLM at your company?"}),(0,_.jsx)("p",{className:"text-gray-500",children:"Help us understand how our product is being used in professional environments."}),(0,_.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 pt-4",children:[(0,_.jsxs)("button",{onClick:()=>u("usingAtCompany",!0),className:`p-6 rounded-lg border-2 text-left transition-all ${!0===n.usingAtCompany?"border-blue-600 bg-blue-50 ring-1 ring-blue-600":"border-gray-200 hover:border-blue-300 hover:bg-gray-50"}`,children:[(0,_.jsx)("span",{className:"block text-lg font-semibold text-gray-900 mb-1",children:"Yes"}),(0,_.jsx)("span",{className:"text-sm text-gray-500",children:"We use it for work"})]}),(0,_.jsxs)("button",{onClick:()=>u("usingAtCompany",!1),className:`p-6 rounded-lg border-2 text-left transition-all ${!1===n.usingAtCompany?"border-blue-600 bg-blue-50 ring-1 ring-blue-600":"border-gray-200 hover:border-blue-300 hover:bg-gray-50"}`,children:[(0,_.jsx)("span",{className:"block text-lg font-semibold text-gray-900 mb-1",children:"No"}),(0,_.jsx)("span",{className:"text-sm text-gray-500",children:"Personal project / Hobby"})]})]})]}):2===a&&!0===n.usingAtCompany?(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"What company are you using LiteLLM at?"}),(0,_.jsx)("p",{className:"text-gray-500",children:"This helps us understand our user base better."}),(0,_.jsx)($.Input,{size:"large",placeholder:"Enter your company name",value:n.companyName,onChange:e=>u("companyName",e.target.value),autoFocus:!0})]}):3===a?(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"When did you start using LiteLLM?"}),(0,_.jsx)(t$.Radio.Group,{value:n.startDate,onChange:e=>u("startDate",e.target.value),className:"w-full",children:(0,_.jsx)(U.Space,{direction:"vertical",className:"w-full",children:["Less than a month ago","1-3 months ago","3-6 months ago","More than 6 months ago"].map(e=>(0,_.jsx)("label",{className:`flex items-center p-4 rounded-lg border cursor-pointer transition-all w-full ${n.startDate===e?"border-blue-600 bg-blue-50 ring-1 ring-blue-600":"border-gray-200 hover:bg-gray-50"}`,children:(0,_.jsx)(t$.Radio,{value:e,children:e})},e))})})]}):4===a?(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Why did you pick LiteLLM over other AI Gateways?"}),(0,_.jsx)("p",{className:"text-gray-500",children:"Select all that apply."}),(0,_.jsx)("div",{className:"space-y-3",children:Ys.map(e=>{let t=n.reasons.includes(e.id);return(0,_.jsxs)("div",{children:[(0,_.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>m(e.id),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),m(e.id))},className:`flex items-start p-4 rounded-lg border cursor-pointer transition-all ${t?"border-blue-600 bg-blue-50 ring-1 ring-blue-600":"border-gray-200 hover:bg-gray-50"}`,children:[(0,_.jsx)(eA.Checkbox,{checked:t,className:"mt-0.5 pointer-events-none"}),(0,_.jsxs)("div",{className:"ml-3",children:[(0,_.jsx)("span",{className:"block font-medium text-gray-900",children:e.label}),(0,_.jsx)("span",{className:"text-sm text-gray-500",children:e.description})]})]}),"other"===e.id&&t&&(0,_.jsx)($.Input,{className:"mt-2 ml-7",placeholder:"Please specify...",value:n.otherReason,onChange:e=>u("otherReason",e.target.value),onClick:e=>e.stopPropagation(),autoFocus:!0})]},e.id)})})]}):5===a?(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Want to share more?"}),(0,_.jsx)("p",{className:"text-gray-500",children:"Leave your email and we may reach out to learn more about your experience. This is completely optional."}),(0,_.jsx)($.Input,{size:"large",type:"email",placeholder:"your@email.com (optional)",value:n.email,onChange:e=>u("email",e.target.value),autoFocus:!0}),(0,_.jsx)("p",{className:"text-xs text-gray-400",children:"We will only use this to follow up on your feedback. No spam, ever."})]}):null}),(0,_.jsxs)("div",{className:"px-6 py-4 bg-gray-50 border-t border-gray-200 flex items-center justify-between",children:[(0,_.jsxs)("div",{className:"text-sm text-gray-500 font-medium",children:["Step ",p()," of ",d]}),(0,_.jsxs)("div",{className:"flex gap-3",children:[a>1&&(0,_.jsx)(z.Button,{onClick:()=>{3===a&&!1===n.usingAtCompany?s(1):s(a-1)},disabled:i,icon:(0,_.jsx)(EK,{className:"h-4 w-4"}),children:"Back"}),(0,_.jsxs)(z.Button,{type:"primary",onClick:()=>{1===a&&!1===n.usingAtCompany?s(3):a<5?s(a+1):c()},disabled:!(1===a?null!==n.usingAtCompany:2===a?n.companyName.trim().length>0:3===a?""!==n.startDate:4===a?n.reasons.includes("other")?n.reasons.length>0&&n.otherReason.trim().length>0:n.reasons.length>0:5===a)||i,loading:i,className:"min-w-[100px]",children:[h?"Submit":"Next",!h&&(0,_.jsx)(wF,{className:"ml-2 h-4 w-4"})]})]})]})]})]})}function Yl({onOpen:e,onDismiss:t,isVisible:r}){return(0,_.jsx)(Yr,{onOpen:e,onDismiss:t,isVisible:r,title:"Claude Code Feedback",description:"Help us improve your Claude Code experience with LiteLLM! Share your feedback in 4 quick questions.",buttonText:"Share feedback",icon:Ok,accentColor:"#7c3aed",buttonStyle:{backgroundColor:"#7c3aed",borderColor:"#7c3aed"}})}function Yi({isOpen:e,onClose:t,onComplete:r}){return e?(0,_.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6",children:[(0,_.jsx)("div",{className:"fixed inset-0 bg-black/40 backdrop-blur-sm",onClick:t}),(0,_.jsxs)("div",{className:"relative w-full max-w-md bg-white rounded-xl shadow-2xl overflow-hidden transform transition-all duration-300 ease-out",children:[(0,_.jsxs)("div",{className:"px-6 py-4 border-b border-gray-100 flex items-center justify-between bg-gray-50/50",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2 text-purple-600",children:[(0,_.jsx)(Ok,{className:"h-5 w-5"}),(0,_.jsx)("span",{className:"font-semibold text-sm tracking-wide uppercase",children:"Claude Code Feedback"})]}),(0,_.jsx)("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 transition-colors p-1 rounded-full hover:bg-gray-100",children:(0,_.jsx)(I7.X,{className:"h-5 w-5"})})]}),(0,_.jsxs)("div",{className:"p-8",children:[(0,_.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Help us improve your experience"}),(0,_.jsx)("p",{className:"text-gray-600 mb-6",children:"We'd love to hear about your experience using LiteLLM with Claude Code. Your feedback helps us improve the product for everyone."}),(0,_.jsx)("p",{className:"text-sm text-gray-500 mb-6",children:"This brief survey takes about 2-3 minutes to complete."}),(0,_.jsx)(z.Button,{type:"primary",size:"large",block:!0,onClick:()=>{window.open("https://forms.gle/LZeJQ3XytBakckYa9","_blank","noopener,noreferrer"),r()},icon:(0,_.jsx)(ww.ExternalLink,{className:"h-4 w-4"}),style:{backgroundColor:"#7c3aed",borderColor:"#7c3aed"},children:"Open Feedback Form"})]})]})]}):null}let Yo=({tagId:e,onClose:t,accessToken:r,is_admin:a,editTag:s})=>{let[n]=H.Form.useForm(),[l,i]=(0,T.useState)(null),[o,d]=(0,T.useState)(s),[c,u]=(0,T.useState)([]),[m,p]=(0,T.useState)({}),h=async(e,t)=>{await (0,rV.copyToClipboard)(e)&&(p(e=>({...e,[t]:!0})),setTimeout(()=>{p(e=>({...e,[t]:!1}))},2e3))},f=async()=>{if(r)try{let t=(await (0,Q.tagInfoCall)(r,[e]))[e];t&&(i(t),s&&n.setFieldsValue({name:t.name,description:t.description,models:t.models,max_budget:t.litellm_budget_table?.max_budget,budget_duration:t.litellm_budget_table?.budget_duration}))}catch(e){console.error("Error fetching tag details:",e),J.default.fromBackend("Error fetching tag details: "+e)}};(0,T.useEffect)(()=>{f()},[e,r]),(0,T.useEffect)(()=>{r&&(0,EO.fetchUserModels)("dummy-user","Admin",r,u)},[r]);let x=async e=>{if(r)try{await (0,Q.tagUpdateCall)(r,{name:e.name,description:e.description,models:e.models,max_budget:e.max_budget,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit,budget_duration:e.budget_duration}),J.default.success("Tag updated successfully"),d(!1),f()}catch(e){console.error("Error updating tag:",e),J.default.fromBackend("Error updating tag: "+e)}};return l?(0,_.jsxs)("div",{className:"p-4",children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(S.Button,{onClick:t,className:"mb-4",children:"← Back to Tags"}),(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Tag Name:"}),(0,_.jsx)("span",{className:"font-mono px-2 py-1 bg-gray-100 rounded text-sm border border-gray-200",children:l.name}),(0,_.jsx)(z.Button,{type:"text",size:"small",icon:m["tag-name"]?(0,_.jsx)(M_.CheckIcon,{size:12}):(0,_.jsx)(Mb.CopyIcon,{size:12}),onClick:()=>h(l.name,"tag-name"),className:`transition-all duration-200 ${m["tag-name"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`})]}),(0,_.jsx)(Z.Text,{className:"text-gray-500",children:l.description||"No description"})]}),a&&!o&&(0,_.jsx)(S.Button,{onClick:()=>d(!0),children:"Edit Tag"})]}),o?(0,_.jsx)(P.Card,{children:(0,_.jsxs)(H.Form,{form:n,onFinish:x,layout:"vertical",initialValues:l,children:[(0,_.jsx)(H.Form.Item,{label:"Tag Name",name:"name",rules:[{required:!0,message:"Please input a tag name"}],children:(0,_.jsx)($.Input,{className:"rounded-md border-gray-300"})}),(0,_.jsx)(H.Form.Item,{label:"Description",name:"description",children:(0,_.jsx)($.Input.TextArea,{rows:4})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Allowed Models",(0,_.jsx)(tB.Tooltip,{title:"Select which models are allowed to process this type of data",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,_.jsx)(eE.Select,{mode:"multiple",placeholder:"Select Models",children:c.map(e=>(0,_.jsx)(eE.Select.Option,{value:e,children:(0,tQ.getModelDisplayName)(e)},e))})}),(0,_.jsxs)(rX.Accordion,{className:"mt-4 mb-4",children:[(0,_.jsx)(rZ.AccordionHeader,{children:(0,_.jsx)(X.Title,{className:"m-0",children:"Budget & Rate Limits"})}),(0,_.jsxs)(r0.AccordionBody,{children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Max Budget (USD)"," ",(0,_.jsx)(tB.Tooltip,{title:"Maximum amount in USD this tag can spend",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"max_budget",children:(0,_.jsx)(jf.default,{step:.01,precision:2,width:200})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Reset Budget"," ",(0,_.jsx)(tB.Tooltip,{title:"How often the budget should reset",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"budget_duration",children:(0,_.jsx)(Ea.default,{onChange:e=>n.setFieldValue("budget_duration",e)})}),(0,_.jsx)("div",{className:"mt-4 p-3 bg-gray-50 rounded-md border border-gray-200",children:(0,_.jsxs)("p",{className:"text-sm text-gray-600",children:["TPM/RPM limits for tags are not currently supported. If you need this feature, please"," ",(0,_.jsx)("a",{href:"https://github.com/BerriAI/litellm/issues/new",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline",children:"create a GitHub issue"}),"."]})})]})]}),(0,_.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,_.jsx)(S.Button,{onClick:()=>d(!1),children:"Cancel"}),(0,_.jsx)(S.Button,{type:"submit",children:"Save Changes"})]})]})}):(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Tag Details"}),(0,_.jsxs)("div",{className:"space-y-4 mt-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Name"}),(0,_.jsx)(Z.Text,{children:l.name})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Description"}),(0,_.jsx)(Z.Text,{children:l.description||"-"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Allowed Models"}),(0,_.jsx)("div",{className:"flex flex-wrap gap-2 mt-2",children:l.models&&0!==l.models.length?l.models.map(e=>(0,_.jsx)(tR.Badge,{color:"blue",children:(0,_.jsx)(tB.Tooltip,{title:`ID: ${e}`,children:l.model_info?.[e]||e})},e)):(0,_.jsx)(tR.Badge,{color:"red",children:"All Models"})})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Created"}),(0,_.jsx)(Z.Text,{children:l.created_at?new Date(l.created_at).toLocaleString():"-"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Last Updated"}),(0,_.jsx)(Z.Text,{children:l.updated_at?new Date(l.updated_at).toLocaleString():"-"})]})]})]}),l.litellm_budget_table&&(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Budget & Rate Limits"}),(0,_.jsxs)("div",{className:"space-y-4 mt-4",children:[void 0!==l.litellm_budget_table.max_budget&&null!==l.litellm_budget_table.max_budget&&(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Max Budget"}),(0,_.jsxs)(Z.Text,{children:["$",l.litellm_budget_table.max_budget]})]}),l.litellm_budget_table.budget_duration&&(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Budget Duration"}),(0,_.jsx)(Z.Text,{children:l.litellm_budget_table.budget_duration})]}),void 0!==l.litellm_budget_table.tpm_limit&&null!==l.litellm_budget_table.tpm_limit&&(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"TPM Limit"}),(0,_.jsx)(Z.Text,{children:l.litellm_budget_table.tpm_limit.toLocaleString()})]}),void 0!==l.litellm_budget_table.rpm_limit&&null!==l.litellm_budget_table.rpm_limit&&(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"RPM Limit"}),(0,_.jsx)(Z.Text,{children:l.litellm_budget_table.rpm_limit.toLocaleString()})]})]})]})]})]}):(0,_.jsx)("div",{children:"Loading..."})},Yd="This is just a spend tag that was passed dynamically in a request. It does not control any LLM models.",Yc=({data:e,onEdit:t,onDelete:r,onSelectTag:a})=>{let[s,n]=T.default.useState([{id:"created_at",desc:!0}]),l=[{header:"Tag Name",accessorKey:"name",cell:({row:e})=>{let t=e.original,r=t.description===Yd;return(0,_.jsx)("div",{className:"overflow-hidden",children:(0,_.jsx)(tB.Tooltip,{title:r?"You cannot view the information of a dynamically generated spend tag":t.name,children:(0,_.jsx)(S.Button,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5",onClick:()=>a(t.name),disabled:r,children:t.name})})})}},{header:"Description",accessorKey:"description",cell:({row:e})=>{let t=e.original;return(0,_.jsx)(tB.Tooltip,{title:t.description,children:(0,_.jsx)("span",{className:"text-xs",children:t.description||"-"})})}},{header:"Allowed Models",accessorKey:"models",cell:({row:e})=>{let t=e.original;return(0,_.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:t?.models?.length===0?(0,_.jsx)(tR.Badge,{size:"xs",className:"mb-1",color:"red",children:"All Models"}):t?.models?.map(e=>(0,_.jsx)(tR.Badge,{size:"xs",className:"mb-1",color:"blue",children:(0,_.jsx)(tB.Tooltip,{title:`ID: ${e}`,children:(0,_.jsx)(Z.Text,{children:t.model_info?.[e]||e})})},e))})}},{header:"Created",accessorKey:"created_at",sortingFn:"datetime",cell:({row:e})=>{let t=e.original;return(0,_.jsx)("span",{className:"text-xs",children:new Date(t.created_at).toLocaleDateString()})}},{id:"actions",header:"Actions",cell:({row:e})=>{let a=e.original,s=a.description===Yd;return(0,_.jsxs)("div",{className:"flex space-x-2",children:[s?(0,_.jsx)(tB.Tooltip,{title:"Dynamically generated spend tags cannot be edited",children:(0,_.jsx)(yi.Icon,{icon:jR.PencilAltIcon,size:"sm",className:"opacity-50 cursor-not-allowed","aria-label":"Edit tag (disabled)"})}):(0,_.jsx)(tB.Tooltip,{title:"Edit tag",children:(0,_.jsx)(yi.Icon,{icon:jR.PencilAltIcon,size:"sm",onClick:()=>t(a),className:"cursor-pointer hover:text-blue-500"})}),s?(0,_.jsx)(tB.Tooltip,{title:"Dynamically generated spend tags cannot be deleted",children:(0,_.jsx)(yi.Icon,{icon:jO.TrashIcon,size:"sm",className:"opacity-50 cursor-not-allowed","aria-label":"Delete tag (disabled)"})}):(0,_.jsx)(tB.Tooltip,{title:"Delete tag",children:(0,_.jsx)(yi.Icon,{icon:jO.TrashIcon,size:"sm",onClick:()=>r(a.name),className:"cursor-pointer hover:text-red-500"})})]})}}],i=(0,jD.useReactTable)({data:e,columns:l,state:{sorting:s},onSortingChange:n,getCoreRowModel:(0,jP.getCoreRowModel)(),getSortedRowModel:(0,jP.getSortedRowModel)(),enableSorting:!0});return(0,_.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,_.jsx)("div",{className:"overflow-x-auto",children:(0,_.jsxs)(A.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,_.jsx)(Y.TableHead,{children:i.getHeaderGroups().map(e=>(0,_.jsx)(R.TableRow,{children:e.headers.map(e=>(0,_.jsx)(F.TableHeaderCell,{className:`py-1 h-8 ${"actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""}`,onClick:e.column.getToggleSortingHandler(),children:(0,_.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,_.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,jD.flexRender)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,_.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,_.jsx)(jC.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,_.jsx)(jM.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,_.jsx)(jL.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,_.jsx)(E.TableBody,{children:i.getRowModel().rows.length>0?i.getRowModel().rows.map(e=>(0,_.jsx)(R.TableRow,{className:"h-8",children:e.getVisibleCells().map(e=>(0,_.jsx)(I.TableCell,{className:`py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ${"actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""}`,children:(0,jD.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:l.length,className:"h-8 text-center",children:(0,_.jsx)("div",{className:"text-center text-gray-500",children:(0,_.jsx)("p",{children:"No tags found"})})})})})]})})})},Yu=({visible:e,onCancel:t,onSubmit:r,availableModels:a})=>{let[s]=H.Form.useForm();return(0,_.jsx)(q.Modal,{title:"Create New Tag",open:e,width:800,footer:null,onCancel:()=>{s.resetFields(),t()},children:(0,_.jsxs)(H.Form,{form:s,onFinish:e=>{r(e),s.resetFields()},labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,_.jsx)(H.Form.Item,{label:"Tag Name",name:"tag_name",rules:[{required:!0,message:"Please input a tag name"}],children:(0,_.jsx)(et.TextInput,{})}),(0,_.jsx)(H.Form.Item,{label:"Description",name:"description",children:(0,_.jsx)($.Input.TextArea,{rows:4})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Allowed Models",(0,_.jsx)(tB.Tooltip,{title:"Select which models are allowed to process requests from this tag",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"allowed_llms",children:(0,_.jsx)(eE.Select,{mode:"multiple",placeholder:"Select Models",children:a.map(e=>(0,_.jsx)(eE.Select.Option,{value:e.model_info.id,children:(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:e.model_name}),(0,_.jsxs)("span",{className:"text-gray-400 ml-2",children:["(",e.model_info.id,")"]})]})},e.model_info.id))})}),(0,_.jsxs)(rX.Accordion,{className:"mt-4 mb-4",children:[(0,_.jsx)(rZ.AccordionHeader,{children:(0,_.jsx)(X.Title,{className:"m-0",children:"Budget & Rate Limits (Optional)"})}),(0,_.jsxs)(r0.AccordionBody,{children:[(0,_.jsx)(H.Form.Item,{className:"mt-4",label:(0,_.jsxs)("span",{children:["Max Budget (USD)"," ",(0,_.jsx)(tB.Tooltip,{title:"Maximum amount in USD this tag can spend. When reached, requests with this tag will be blocked",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"max_budget",children:(0,_.jsx)(jf.default,{step:.01,precision:2,width:200})}),(0,_.jsx)(H.Form.Item,{className:"mt-4",label:(0,_.jsxs)("span",{children:["Reset Budget"," ",(0,_.jsx)(tB.Tooltip,{title:"How often the budget should reset. For example, setting 'daily' will reset the budget every 24 hours",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"budget_duration",children:(0,_.jsx)(Ea.default,{onChange:e=>s.setFieldValue("budget_duration",e)})}),(0,_.jsx)("div",{className:"mt-4 p-3 bg-gray-50 rounded-md border border-gray-200",children:(0,_.jsxs)("p",{className:"text-sm text-gray-600",children:["TPM/RPM limits for tags are not currently supported. If you need this feature, please"," ",(0,_.jsx)("a",{href:"https://github.com/BerriAI/litellm/issues/new",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline",children:"create a GitHub issue"}),"."]})})]})]}),(0,_.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,_.jsx)(S.Button,{type:"submit",children:"Create Tag"})})]})})},Ym=({accessToken:e,userID:t,userRole:r})=>{let[a,s]=(0,T.useState)([]),[n,l]=(0,T.useState)(!1),[i,o]=(0,T.useState)(null),[d,c]=(0,T.useState)(!1),[u,m]=(0,T.useState)(!1),[p,h]=(0,T.useState)(null),[f,x]=(0,T.useState)(""),[g,y]=(0,T.useState)([]),b=async()=>{if(e)try{let t=await (0,Q.tagListCall)(e);console.log("List tags response:",t),s(Object.values(t))}catch(e){console.error("Error fetching tags:",e),J.default.fromBackend("Error fetching tags: "+e)}},v=async t=>{if(e)try{await (0,Q.tagCreateCall)(e,{name:t.tag_name,description:t.description,models:t.allowed_llms,max_budget:t.max_budget,soft_budget:t.soft_budget,tpm_limit:t.tpm_limit,rpm_limit:t.rpm_limit,budget_duration:t.budget_duration}),J.default.success("Tag created successfully"),l(!1),b()}catch(e){console.error("Error creating tag:",e),J.default.fromBackend("Error creating tag: "+e)}},j=async e=>{h(e),m(!0)},w=async()=>{if(e&&p){try{await (0,Q.tagDeleteCall)(e,p),J.default.success("Tag deleted successfully"),b()}catch(e){console.error("Error deleting tag:",e),J.default.fromBackend("Error deleting tag: "+e)}m(!1),h(null)}};return(0,T.useEffect)(()=>{t&&r&&e&&(async()=>{try{let a=await (0,Q.modelInfoCall)(e,t,r);a&&a.data&&y(a.data)}catch(e){console.error("Error fetching models:",e),J.default.fromBackend("Error fetching models: "+e)}})()},[e,t,r]),(0,T.useEffect)(()=>{b()},[e]),(0,_.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:i?(0,_.jsx)(Yo,{tagId:i,onClose:()=>{o(null),c(!1)},accessToken:e,is_admin:"Admin"===r,editTag:d}):(0,_.jsxs)("div",{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,_.jsxs)("div",{className:"flex justify-between mt-2 w-full items-center mb-4",children:[(0,_.jsx)("h1",{children:"Tag Management"}),(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[f&&(0,_.jsxs)(Z.Text,{children:["Last Refreshed: ",f]}),(0,_.jsx)(yi.Icon,{icon:jt.RefreshIcon,variant:"shadow",size:"xs",className:"self-center cursor-pointer",onClick:()=>{b(),x(new Date().toLocaleString())}})]})]}),(0,_.jsxs)(Z.Text,{className:"mb-4",children:["Click on a tag name to view and edit its details.",(0,_.jsxs)("p",{children:["You can use tags to restrict the usage of certain LLMs based on tags passed in the request. Read more about tag routing"," ",(0,_.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/tag_routing",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})]}),(0,_.jsx)(S.Button,{className:"mb-4",onClick:()=>l(!0),children:"+ Create New Tag"}),(0,_.jsx)(ee.Grid,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsx)(Yc,{data:a,onEdit:e=>{o(e.name),c(!0)},onDelete:j,onSelectTag:o})})}),(0,_.jsx)(Yu,{visible:n,onCancel:()=>l(!1),onSubmit:v,availableModels:g}),u&&(0,_.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,_.jsxs)("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[(0,_.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,_.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,_.jsxs)("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full",children:[(0,_.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,_.jsx)("div",{className:"sm:flex sm:items-start",children:(0,_.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,_.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Tag"}),(0,_.jsx)("div",{className:"mt-2",children:(0,_.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this tag?"})})]})})}),(0,_.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,_.jsx)(S.Button,{onClick:w,color:"red",className:"ml-2",children:"Delete"}),(0,_.jsx)(S.Button,{onClick:()=>{m(!1),h(null)},children:"Cancel"})]})]})]})})]})})},Yp=({accessToken:e})=>{let[t,r]=(0,T.useState)(`{ + `}),(0,_.jsx)(E5,{value:e,onChange:e=>t(e.target.value),placeholder:r,rows:a,className:"font-sans"}),c.length>0&&(0,_.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2 items-center",children:[(0,_.jsx)("span",{className:"text-xs text-gray-500 mr-1",children:"Detected variables:"}),c.map((e,t)=>(0,_.jsx)(La.Popover,{content:(0,_.jsxs)("div",{className:"p-2",style:{minWidth:"200px"},children:[(0,_.jsx)("div",{className:"text-xs text-gray-500 mb-2",children:"Edit variable name"}),(0,_.jsx)($.Input,{size:"small",value:i,onChange:e=>o(e.target.value),onPressEnter:d,placeholder:"Variable name",autoFocus:!0}),(0,_.jsxs)("div",{className:"flex gap-2 mt-2",children:[(0,_.jsx)("button",{onClick:d,className:"text-xs px-2 py-1 bg-blue-500 text-white rounded hover:bg-blue-600",children:"Save"}),(0,_.jsx)("button",{onClick:()=>{l(null),o("")},className:"text-xs px-2 py-1 bg-gray-200 text-gray-700 rounded hover:bg-gray-300",children:"Cancel"})]})]}),open:n?.start===e.start,onOpenChange:e=>{e||(l(null),o(""))},trigger:"click",children:(0,_.jsx)(eN.Tag,{color:"orange",className:"cursor-pointer hover:opacity-80 transition-all m-0",icon:(0,_.jsx)(wX.EditOutlined,{}),onClick:()=>{l({oldName:e.name,start:e.start,end:e.end}),o(e.name)},children:e.name})},`${e.start}-${t}`))]})]})},E3=({value:e,onChange:t})=>(0,_.jsxs)(P.Card,{className:"p-3",children:[(0,_.jsx)(Z.Text,{className:"block mb-2 text-sm font-medium",children:"Developer message"}),(0,_.jsx)(Z.Text,{className:"text-gray-500 text-xs mb-2",children:"Optional system instructions for the model"}),(0,_.jsx)(E6,{value:e,onChange:t,rows:3,placeholder:"e.g., You are a helpful assistant..."})]});var Ci=Ci;let E8=(0,eT.default)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),{Option:E7}=eE.Select,E9=({messages:e,onAddMessage:t,onUpdateMessage:r,onRemoveMessage:a,onMoveMessage:s})=>{let[n,l]=(0,T.useState)(null),[i,o]=(0,T.useState)(null),d=()=>{l(null),o(null)};return(0,_.jsxs)(P.Card,{className:"p-3",children:[(0,_.jsxs)("div",{className:"mb-2",children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium",children:"Prompt messages"}),(0,_.jsxs)(Z.Text,{className:"text-gray-500 text-xs mt-1",children:["Use ",(0,_.jsx)("code",{className:"bg-gray-100 px-1 rounded text-xs",children:"{{variable}}"})," syntax for template variables"]})]}),(0,_.jsx)("div",{className:"space-y-2",children:e.map((t,c)=>(0,_.jsxs)("div",{draggable:!0,onDragStart:()=>{l(c)},onDragOver:e=>{e.preventDefault(),o(c)},onDrop:e=>{e.preventDefault(),null!==n&&n!==c&&s(n,c),l(null),o(null)},onDragEnd:d,className:`border border-gray-300 rounded overflow-hidden bg-white transition-all ${n===c?"opacity-50":""} ${i===c&&n!==c?"border-blue-500 border-2":""}`,children:[(0,_.jsxs)("div",{className:"bg-gray-50 px-2 py-1.5 border-b border-gray-300 flex items-center justify-between",children:[(0,_.jsxs)(eE.Select,{value:t.role,onChange:e=>r(c,"role",e),style:{width:100},size:"small",bordered:!1,children:[(0,_.jsx)(E7,{value:"user",children:"User"}),(0,_.jsx)(E7,{value:"assistant",children:"Assistant"}),(0,_.jsx)(E7,{value:"system",children:"System"})]}),(0,_.jsxs)("div",{className:"flex items-center gap-1",children:[e.length>1&&(0,_.jsx)("button",{onClick:()=>a(c),className:"text-gray-400 hover:text-red-500",children:(0,_.jsx)(E2,{size:14})}),(0,_.jsx)("div",{className:"cursor-grab active:cursor-grabbing text-gray-400 hover:text-gray-600",children:(0,_.jsx)(E8,{size:16})})]})]}),(0,_.jsx)("div",{className:"p-2",children:(0,_.jsx)(E6,{value:t.content,onChange:e=>r(c,"content",e),rows:3,placeholder:"Enter prompt content..."})})]},c))}),(0,_.jsxs)("button",{onClick:t,className:"mt-2 text-xs text-blue-600 hover:text-blue-700 flex items-center",children:[(0,_.jsx)(Ci.default,{size:14,className:"mr-1"}),"Add message"]})]})};var Ie=e.i(447593);let It=({extractedVariables:e,variables:t,onVariableChange:r})=>0===e.length?null:(0,_.jsxs)("div",{className:"p-4 border-b border-gray-200 bg-blue-50",children:[(0,_.jsx)("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Fill in template variables to start testing"}),(0,_.jsx)("div",{className:"space-y-2",children:e.map(e=>(0,_.jsxs)("div",{children:[(0,_.jsxs)("label",{className:"block text-xs text-gray-600 mb-1 font-medium",children:["{{",e,"}}"]}),(0,_.jsx)($.Input,{value:t[e]||"",onChange:t=>r(e,t.target.value),placeholder:`Enter value for ${e}`,size:"small"})]},e))})]}),Ir=({hasVariables:e})=>(0,_.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,_.jsx)(tV.RobotOutlined,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,_.jsx)("span",{className:"text-base",children:e?"Fill in the variables above, then type a message to start testing":"Type a message below to start testing your prompt"})]});var Ia=e.i(989022);let Is=({message:e})=>(0,_.jsx)("div",{className:`mb-4 flex ${"user"===e.role?"justify-end":"justify-start"}`,children:(0,_.jsxs)("div",{className:"max-w-[85%] rounded-lg shadow-sm p-3.5 px-4",style:{backgroundColor:"user"===e.role?"#f0f8ff":"#ffffff",border:"user"===e.role?"1px solid #e6f0fa":"1px solid #f0f0f0"},children:[(0,_.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,_.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-1",style:{backgroundColor:"user"===e.role?"#e6f0fa":"#f5f5f5"},children:"user"===e.role?(0,_.jsx)(A7.UserOutlined,{style:{fontSize:"12px",color:"#2563eb"}}):(0,_.jsx)(tV.RobotOutlined,{style:{fontSize:"12px",color:"#4b5563"}})}),(0,_.jsx)("strong",{className:"text-sm capitalize",children:e.role}),"assistant"===e.role&&e.model&&(0,_.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-gray-100 text-gray-600 font-normal",children:e.model})]}),(0,_.jsxs)("div",{className:"whitespace-pre-wrap break-words max-w-full message-content",style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",hyphens:"auto"},children:["assistant"===e.role?(0,_.jsx)(AG.default,{components:{code({node:e,inline:t,className:r,children:a,...s}){let n=/language-(\w+)/.exec(r||"");return!t&&n?(0,_.jsx)(rJ.Prism,{style:Eq.coy,language:n[1],PreTag:"div",className:"rounded-md my-2",wrapLines:!0,wrapLongLines:!0,...s,children:String(a).replace(/\n$/,"")}):(0,_.jsx)("code",{className:`${r} px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono`,style:{wordBreak:"break-word"},...s,children:a})},pre:({node:e,...t})=>(0,_.jsx)("pre",{style:{overflowX:"auto",maxWidth:"100%"},...t})},children:e.content}):(0,_.jsx)("div",{className:"whitespace-pre-wrap",children:e.content}),"assistant"===e.role&&(e.timeToFirstToken||e.totalLatency||e.usage)&&(0,_.jsx)(Ia.default,{timeToFirstToken:e.timeToFirstToken,totalLatency:e.totalLatency,usage:e.usage})]})]})}),In=({messages:e,isLoading:t,hasVariables:r,messagesEndRef:a})=>{let s=(0,_.jsx)(wo.LoadingOutlined,{style:{fontSize:24},spin:!0});return(0,_.jsxs)("div",{className:"flex-1 overflow-y-auto p-4 pb-0",children:[0===e.length&&(0,_.jsx)(Ir,{hasVariables:r}),e.map((e,t)=>(0,_.jsx)(Is,{message:e},t)),t&&(0,_.jsx)("div",{className:"flex justify-center items-center my-4",children:(0,_.jsx)(rm.Spin,{indicator:s})}),(0,_.jsx)("div",{ref:a,style:{height:"1px"}})]})},Il=({extractedVariables:e,variables:t})=>{let r=e.filter(e=>!t[e]||""===t[e].trim());return 0===r.length?null:(0,_.jsx)("div",{className:"mb-3 p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,_.jsxs)("div",{className:"flex items-start gap-2",children:[(0,_.jsx)("span",{className:"text-yellow-600 text-sm",children:"⚠️"}),(0,_.jsxs)("div",{className:"flex-1",children:[(0,_.jsx)("p",{className:"text-sm text-yellow-800 font-medium mb-1",children:"Please fill in all template variables above"}),(0,_.jsxs)("p",{className:"text-xs text-yellow-700",children:["Missing: ",r.map(e=>`{{${e}}}`).join(", ")]})]})]})})};var Ii=e.i(132104);let{TextArea:Io}=$.Input,Id=({inputMessage:e,isLoading:t,isDisabled:r,onInputChange:a,onSend:s,onKeyDown:n,onCancel:l})=>(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsxs)("div",{className:"flex items-center flex-1 bg-white border border-gray-300 rounded-xl px-3 py-1 min-h-[44px]",children:[(0,_.jsx)(Io,{value:e,onChange:e=>a(e.target.value),onKeyDown:n,placeholder:"Type your message... (Shift+Enter for new line)",disabled:t,className:"flex-1",autoSize:{minRows:1,maxRows:4},style:{resize:"none",border:"none",boxShadow:"none",background:"transparent",padding:"4px 0",fontSize:"14px",lineHeight:"20px"}}),(0,_.jsx)(S.Button,{onClick:s,disabled:r,className:"flex-shrink-0 ml-2 !w-8 !h-8 !min-w-8 !p-0 !rounded-full !bg-blue-600 hover:!bg-blue-700 disabled:!bg-gray-300 !border-none !text-white disabled:!text-gray-500 !flex !items-center !justify-center",children:(0,_.jsx)(Ii.ArrowUpOutlined,{style:{fontSize:"14px"}})})]}),t&&(0,_.jsx)(S.Button,{onClick:l,className:"bg-red-50 hover:bg-red-100 text-red-600 border-red-200",children:"Cancel"})]}),Ic=({prompt:e,accessToken:t})=>{let{isLoading:r,messages:a,inputMessage:s,variables:n,variablesFilled:l,extractedVariables:i,allVariablesFilled:o,messagesEndRef:d,setInputMessage:c,handleSendMessage:u,handleCancelRequest:m,handleClearConversation:p,handleKeyDown:h,handleVariableChange:f}=((e,t)=>{let[r,a]=(0,T.useState)(!1),[s,n]=(0,T.useState)([]),[l,i]=(0,T.useState)(""),[o,d]=(0,T.useState)({}),[c,u]=(0,T.useState)(!1),[m,p]=(0,T.useState)(null),h=(0,T.useRef)(null),f=EI(e),x=f.every(e=>o[e]&&""!==o[e].trim());(0,T.useEffect)(()=>{h.current&&setTimeout(()=>{h.current?.scrollIntoView({behavior:"smooth",block:"end"})},100)},[s]);let g=async()=>{let r;if(!t)return void J.default.fromBackend("Access token is required");if(f.length>0&&!x)return void J.default.fromBackend("Please fill in all template variables");if(!l.trim())return;!c&&f.length>0&&u(!0);let d={role:"user",content:l};n(e=>[...e,d]),i("");let m=new AbortController;p(m),a(!0);let h=Date.now();try{let a,i,d=EY(e),c=(0,Q.getProxyBaseUrl)(),u={dotprompt_content:d};0===s.length?u.prompt_variables=o:u.conversation_history=[...s.map(e=>({role:e.role,content:e.content})),{role:"user",content:l}];let p=await fetch(`${c}/prompts/test`,{method:"POST",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify(u),signal:m.signal});if(!p.ok){let e=await p.text();throw Error(`HTTP error! status: ${p.status}, ${e}`)}if(!p.body)throw Error("No response body");let f=p.body.getReader(),x=new TextDecoder,g="";for(n(e=>[...e,{role:"assistant",content:""}]);;){let{done:e,value:t}=await f.read();if(e)break;for(let e of x.decode(t).split("\n"))if(e.startsWith("data: ")){let t=e.slice(6);if("[DONE]"===t)continue;try{let e=JSON.parse(t);!a&&e.model&&(a=e.model),e.usage&&(i=e.usage);let s=e.choices?.[0]?.delta?.content;s&&(r||(r=Date.now()-h),g+=s,n(e=>{let t=[...e];return t[t.length-1]={role:"assistant",content:g,model:a,timeToFirstToken:r},t}))}catch(e){console.error("Error parsing chunk:",e)}}}let y=Date.now()-h;n(e=>{let t=[...e];return t[t.length-1]={...t[t.length-1],totalLatency:y,usage:i},t})}catch(e){"AbortError"===e.name?console.log("Request was cancelled"):(console.error("Error testing prompt:",e),n(t=>{let r=t[t.length-1];return r&&"assistant"===r.role&&""===r.content?[...t.slice(0,-1),{role:"assistant",content:`Error: ${e.message}`}]:[...t,{role:"assistant",content:`Error: ${e.message}`}]}))}finally{a(!1),p(null)}};return{isLoading:r,messages:s,inputMessage:l,variables:o,variablesFilled:c,extractedVariables:f,allVariablesFilled:x,messagesEndRef:h,setInputMessage:i,handleSendMessage:g,handleCancelRequest:()=>{m&&(m.abort(),p(null),a(!1),J.default.info("Request cancelled"))},handleClearConversation:()=>{n([]),u(!1),J.default.success("Chat history cleared.")},handleKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),g())},handleVariableChange:(e,t)=>{d({...o,[e]:t})}}})(e,t);return(0,_.jsxs)("div",{className:"flex flex-col h-full bg-white",children:[!l&&(0,_.jsx)(It,{extractedVariables:i,variables:n,onVariableChange:f}),a.length>0&&(0,_.jsx)("div",{className:"p-3 border-b border-gray-200 bg-white flex justify-end",children:(0,_.jsx)(S.Button,{onClick:p,className:"bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:Ie.ClearOutlined,children:"Clear Chat"})}),(0,_.jsx)(In,{messages:a,isLoading:r,hasVariables:i.length>0,messagesEndRef:d}),(0,_.jsxs)("div",{className:"p-4 border-t border-gray-200 bg-white",children:[(0,_.jsx)(Il,{extractedVariables:i,variables:n}),(0,_.jsx)(Id,{inputMessage:s,isLoading:r,isDisabled:r||!s.trim()||i.length>0&&!o,onInputChange:c,onSend:u,onKeyDown:h,onCancel:m})]})]})},Iu=({visible:e,promptName:t,isSaving:r,onNameChange:a,onPublish:s,onCancel:n})=>(0,_.jsx)(q.Modal,{title:"Publish Prompt",open:e,onCancel:n,footer:[(0,_.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,_.jsx)(S.Button,{variant:"secondary",onClick:n,children:"Cancel"}),(0,_.jsx)(S.Button,{onClick:s,loading:r,children:"Publish"})]},"footer")],children:(0,_.jsxs)("div",{className:"py-4",children:[(0,_.jsx)(Z.Text,{className:"mb-2",children:"Name"}),(0,_.jsx)($.Input,{value:t,onChange:e=>a(e.target.value),placeholder:"Enter prompt name",onPressEnter:s,autoFocus:!0}),(0,_.jsx)(Z.Text,{className:"text-gray-500 text-xs mt-2",children:"Published prompts can be used in API calls and are versioned for easy tracking."})]})}),Im=({prompt:e})=>{let t=EY(e);return(0,_.jsxs)("div",{className:"p-6",children:[(0,_.jsxs)("div",{className:"mb-4",children:[(0,_.jsx)("h3",{className:"text-sm font-medium text-gray-700 mb-2",children:"Generated .prompt file"}),(0,_.jsx)("p",{className:"text-xs text-gray-500",children:"This is the dotprompt format that will be saved to the database"})]}),(0,_.jsx)("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-4 overflow-auto",children:(0,_.jsx)("pre",{className:"text-sm text-gray-900 font-mono whitespace-pre-wrap",children:t})})]})},{Text:Ip}=V.Typography,Ih=({isOpen:e,onClose:t,accessToken:r,promptId:a,activeVersionId:s,onSelectVersion:n})=>{let[l,i]=(0,T.useState)([]),[o,d]=(0,T.useState)(!1);(0,T.useEffect)(()=>{e&&r&&a&&c()},[e,r,a]);let c=async()=>{d(!0);try{let e=a.includes(".v")?a.split(".v")[0]:a,t=await (0,Q.getPromptVersions)(r,e);i(t.prompts)}catch(e){console.error("Error fetching prompt versions:",e)}finally{d(!1)}},u=e=>{if(e.version)return`v${e.version}`;let t=e.litellm_params?.prompt_id||e.prompt_id;return t.includes(".v")?`v${t.split(".v")[1]}`:t.includes("_v")?`v${t.split("_v")[1]}`:"v1"};return(0,_.jsx)(kJ,{title:"Version History",placement:"right",onClose:t,open:e,width:400,mask:!1,maskClosable:!1,children:o?(0,_.jsx)(ey.Skeleton,{active:!0,paragraph:{rows:4}}):0===l.length?(0,_.jsx)("div",{className:"text-center py-8 text-gray-500",children:"No version history available."}):(0,_.jsx)(M1,{dataSource:l,renderItem:(e,t)=>{var r;let a=e.version||parseInt(u(e).replace("v","")),l=null;s&&(s.includes(".v")?l=parseInt(s.split(".v")[1]):s.includes("_v")&&(l=parseInt(s.split("_v")[1])));let i=l?a===l:0===t;return(0,_.jsxs)("div",{className:`mb-4 p-4 rounded-lg border cursor-pointer transition-all hover:shadow-md ${i?"border-blue-500 bg-blue-50":"border-gray-200 bg-white hover:border-blue-300"}`,onClick:()=>n?.(e),children:[(0,_.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(eN.Tag,{className:"m-0",children:u(e)}),0===t&&(0,_.jsx)(eN.Tag,{color:"blue",className:"m-0",children:"Latest"})]}),i&&(0,_.jsx)(eN.Tag,{color:"green",className:"m-0",children:"Active"})]}),(0,_.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,_.jsx)(Ip,{className:"text-sm text-gray-600 font-medium",children:(r=e.created_at)?new Date(r).toLocaleString():"-"}),(0,_.jsx)(Ip,{type:"secondary",className:"text-xs",children:e.prompt_info?.prompt_type==="db"?"Saved to Database":"Config Prompt"})]})]},`${e.prompt_id}-v${e.version||a}`)}})})},If=({onClose:e,onSuccess:t,accessToken:r,initialPromptData:a})=>{let[s,n]=(0,T.useState)((()=>{if(a)try{return ER(a)}catch(e){console.error("Error parsing existing prompt:",e),J.default.fromBackend("Failed to parse prompt data")}return{name:"New prompt",model:"gpt-4o",config:{temperature:1,max_tokens:1e3},tools:[],developerMessage:"",messages:[{role:"user",content:"Enter task specifics. Use {{template_variables}} for dynamic inputs"}],environment:"development"}})()),[l,i]=(0,T.useState)(!!a),[o,d]=(0,T.useState)(!1),[c,u]=(0,T.useState)((()=>{if(!a?.prompt_spec)return;let e=a.prompt_spec.prompt_id,t=a.prompt_spec.version||a.prompt_spec.litellm_params?.prompt_id;return"number"==typeof t?`${e}.v${t}`:"string"==typeof t&&(t.includes(".v")||t.includes("_v"))?t:e})()),[m,p]=(0,T.useState)(!1),[h,f]=(0,T.useState)(!1),[x,g]=(0,T.useState)(null),[y,b]=(0,T.useState)(!1),[v,j]=(0,T.useState)("pretty"),w=e=>{void 0!==e?g(e):g(null),p(!0)},k=async()=>{if(!r)return void J.default.fromBackend("Access token is required");if(!s.name||""===s.name.trim())return void J.default.fromBackend("Please enter a valid prompt name");b(!0);try{let n=s.name.replace(/[^a-zA-Z0-9_-]/g,"_").toLowerCase(),i=EY(s),o={prompt_id:n,litellm_params:{prompt_integration:"dotprompt",prompt_id:n,dotprompt_content:i},prompt_info:{prompt_type:"db",environment:s.environment}};l&&a?.prompt_spec?.prompt_id?(await (0,Q.updatePromptCall)(r,a.prompt_spec.prompt_id,o),J.default.success("Prompt updated successfully!")):(await (0,Q.createPromptCall)(r,o),J.default.success("Prompt created successfully!")),t(),e()}catch(e){console.error("Error saving prompt:",e),J.default.fromBackend(l?"Failed to update prompt":"Failed to save prompt")}finally{b(!1),f(!1)}},S=c&&c.includes(".v")?`v${c.split(".v")[1]}`:null;return(0,_.jsxs)("div",{className:"flex h-full bg-white",children:[(0,_.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,_.jsx)(E0,{promptName:s.name,onNameChange:e=>n({...s,name:e}),onBack:e,onSave:()=>{s.name&&""!==s.name.trim()&&"New prompt"!==s.name?k():f(!0)},isSaving:y,editMode:l,onShowHistory:()=>d(!0),version:S,promptModel:s.model,promptVariables:(()=>{let e,t={},r=[s.developerMessage,...s.messages.map(e=>e.content)].join(" "),a=/\{\{(\w+)\}\}/g;for(;null!==(e=a.exec(r));){let r=e[1];t[r]||(t[r]=`example_${r}`)}return t})(),accessToken:r,environment:s.environment,onEnvironmentChange:async e=>{if(n({...s,environment:e}),l&&r&&a?.prompt_spec?.prompt_id)try{let t=await (0,Q.getPromptInfo)(r,a.prompt_spec.prompt_id,e);if(t?.prompt_spec){let r=ER(t);n({...r,environment:e});let a=t.prompt_spec.version||1;u(`${t.prompt_spec.prompt_id}.v${a}`)}}catch{}}}),(0,_.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,_.jsxs)("div",{className:"w-1/2 overflow-y-auto bg-white border-r border-gray-200 flex-shrink-0",children:[(0,_.jsxs)("div",{className:"border-b border-gray-200 bg-white px-6 py-4 flex items-center gap-3",children:[(0,_.jsx)(E1,{model:s.model,temperature:s.config.temperature,maxTokens:s.config.max_tokens,accessToken:r,onModelChange:e=>n({...s,model:e}),onTemperatureChange:e=>n({...s,config:{...s.config,temperature:e}}),onMaxTokensChange:e=>n({...s,config:{...s.config,max_tokens:e}})}),(0,_.jsxs)("div",{className:"ml-auto inline-flex items-center bg-gray-200 rounded-full p-0.5",children:[(0,_.jsx)("button",{className:`px-3 py-1 text-xs font-medium rounded-full transition-colors ${"pretty"===v?"bg-white text-gray-900 shadow-sm":"text-gray-600"}`,onClick:()=>j("pretty"),children:"PRETTY"}),(0,_.jsx)("button",{className:`px-3 py-1 text-xs font-medium rounded-full transition-colors ${"dotprompt"===v?"bg-white text-gray-900 shadow-sm":"text-gray-600"}`,onClick:()=>j("dotprompt"),children:"DOTPROMPT"})]})]}),"pretty"===v?(0,_.jsxs)("div",{className:"p-6 space-y-4 pb-20",children:[(0,_.jsx)(E4,{tools:s.tools,onAddTool:()=>w(),onEditTool:w,onRemoveTool:e=>{n({...s,tools:s.tools.filter((t,r)=>r!==e)})}}),(0,_.jsx)(E3,{value:s.developerMessage,onChange:e=>n({...s,developerMessage:e})}),(0,_.jsx)(E9,{messages:s.messages,onAddMessage:()=>{n({...s,messages:[...s.messages,{role:"user",content:""}]})},onUpdateMessage:(e,t,r)=>{let a=[...s.messages];a[e][t]=r,n({...s,messages:a})},onRemoveMessage:e=>{s.messages.length>1&&n({...s,messages:s.messages.filter((t,r)=>r!==e)})},onMoveMessage:(e,t)=>{let r=[...s.messages],[a]=r.splice(e,1);r.splice(t,0,a),n({...s,messages:r})}})]}):(0,_.jsx)(Im,{prompt:s})]}),(0,_.jsx)("div",{className:"w-1/2 flex-shrink-0",children:(0,_.jsx)(Ic,{prompt:s,accessToken:r})})]})]}),(0,_.jsx)(Iu,{visible:h,promptName:s.name,isSaving:y,onNameChange:e=>n({...s,name:e}),onPublish:k,onCancel:()=>f(!1)}),m&&(0,_.jsx)(EJ,{visible:m,initialJson:null!==x?s.tools[x].json:"",onSave:e=>{try{let t=JSON.parse(e),r={name:t.function?.name||"Unnamed Tool",description:t.function?.description||"",json:e};if(null!==x){let e=[...s.tools];e[x]=r,n({...s,tools:e})}else n({...s,tools:[...s.tools,r]});p(!1),g(null)}catch(e){J.default.fromBackend("Invalid JSON format")}},onClose:()=>{p(!1),g(null)}}),(0,_.jsx)(Ih,{isOpen:o,onClose:()=>d(!1),accessToken:r,promptId:a?.prompt_spec?.prompt_id||s.name,activeVersionId:c,onSelectVersion:e=>{try{let t=ER({prompt_spec:e});n(t);let r=e.version||1;u(`${e.prompt_id}.v${r}`)}catch(e){console.error("Error loading version:",e),J.default.fromBackend("Failed to load prompt version")}}})]})},Ix=({accessToken:e,userRole:t})=>{let[r,a]=(0,T.useState)([]),[s,n]=(0,T.useState)(!1),[l,i]=(0,T.useState)(void 0),[o,d]=(0,T.useState)(null),[c,u]=(0,T.useState)(!1),[m,p]=(0,T.useState)(!1),[h,f]=(0,T.useState)(null),[x,g]=(0,T.useState)(!1),[y,b]=(0,T.useState)(null);t&&(0,ts.isAdminRole)(t);let v=!!t&&(0,ts.isProxyAdminRole)(t),j=async()=>{if(e){n(!0);try{let t=await (0,Q.getPromptsList)(e,l);console.log(`prompts: ${JSON.stringify(t)}`),a(t.prompts)}catch(e){console.error("Error fetching prompts:",e)}finally{n(!1)}}};(0,T.useEffect)(()=>{j()},[e,l]);let w=()=>{j(),p(!1),f(null),d(null)},k=async()=>{if(y&&e){g(!0);try{await (0,Q.deletePromptCall)(e,y.id),J.default.success(`Prompt "${y.name}" deleted successfully`),j()}catch(e){console.error("Error deleting prompt:",e),J.default.fromBackend("Failed to delete prompt")}finally{g(!1),b(null)}}};return(0,_.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[m?(0,_.jsx)(If,{onClose:()=>{p(!1),f(null)},onSuccess:w,accessToken:e,initialPromptData:h}):o?(0,_.jsx)(EW,{promptId:o,onClose:()=>d(null),accessToken:e,isAdmin:v,onDelete:j,onEdit:e=>{f(e),p(!0)}}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,_.jsx)("div",{className:"flex gap-2",children:v&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(S.Button,{onClick:()=>{o&&d(null),f(null),p(!0)},disabled:!e,children:"+ Add New Prompt"}),(0,_.jsx)(S.Button,{onClick:()=>{o&&d(null),u(!0)},disabled:!e,variant:"secondary",children:"Upload .prompt File"})]})}),(0,_.jsx)(eE.Select,{placeholder:"All Environments",allowClear:!0,value:l,onChange:e=>i(e),style:{width:180},options:[{label:"Development",value:"development"},{label:"Staging",value:"staging"},{label:"Production",value:"production"}]})]}),(0,_.jsx)(E$,{promptsList:r,isLoading:s,onPromptClick:e=>{d(e)},onDeleteClick:(e,t)=>{b({id:e,name:t})},accessToken:e,isAdmin:v})]}),(0,_.jsx)(EG,{visible:c,onClose:()=>{u(!1)},accessToken:e,onSuccess:w}),y&&(0,_.jsxs)(q.Modal,{title:"Delete Prompt",open:null!==y,onOk:k,onCancel:()=>{b(null)},confirmLoading:x,okText:"Delete",okButtonProps:{danger:!0},children:[(0,_.jsxs)("p",{children:["Are you sure you want to delete prompt: ",y.name," ?"]}),(0,_.jsx)("p",{children:"This action cannot be undone."})]})]})};var Ig=e.i(976883),Iy=e.i(657688),I_=e.i(437902);let{Text:Ib}=V.Typography,Iv=({litellmParams:e,accessToken:t,onTestComplete:r})=>{let[a,s]=(0,T.useState)(!0),[n,l]=(0,T.useState)(null),[i,o]=(0,T.useState)(!1);(0,T.useEffect)(()=>{(async()=>{s(!0);try{let r=await (0,Q.testSearchToolConnection)(t,e);l(r),"success"===r.status&&J.default.success("Connection test successful!")}catch(e){l({status:"error",message:e instanceof Error?e.message:"Unknown error occurred",error_type:"NetworkError"})}finally{s(!1),r&&r()}})()},[t,e,r]);let d=n?.message?(e=>{if(!e)return"Unknown error";let t=e.split("stack trace:")[0].trim().replace(/^litellm\.(.*?)Error:\s*/,"").replace(/^AuthenticationError:\s*/,"");if(t.includes("")||t.includes("(.*?)<\/title>/);return e?e[1]:t.includes("401")||t.includes("Authorization Required")?"Authentication failed: Invalid API key or credentials":"Authentication error - please check your API key"}return t.length>200?t.substring(0,200)+"...":t})(n.message):"Unknown error";return a?(0,_.jsx)("div",{style:{padding:"24px",borderRadius:"8px",backgroundColor:"#fff"},children:(0,_.jsxs)("div",{style:{textAlign:"center",padding:"32px 20px"},className:"jsx-dc9a0e2d897fe63b",children:[(0,_.jsx)("div",{style:{marginBottom:"16px"},className:"jsx-dc9a0e2d897fe63b loading-spinner",children:(0,_.jsx)("div",{style:{border:"3px solid #f3f3f3",borderTop:"3px solid #1890ff",borderRadius:"50%",width:"30px",height:"30px",animation:"spin 1s linear infinite",margin:"0 auto"},className:"jsx-dc9a0e2d897fe63b"})}),(0,_.jsxs)(Ib,{style:{fontSize:"16px"},children:["Testing connection to ",e.search_provider||"search provider","..."]}),(0,_.jsx)(I_.default,{id:"dc9a0e2d897fe63b",children:"@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}"})]})}):n?(0,_.jsxs)("div",{style:{padding:"24px",borderRadius:"8px",backgroundColor:"#fff"},children:["success"===n.status?(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"32px 20px"},children:[(0,_.jsx)("div",{style:{color:"#52c41a",fontSize:"24px",display:"flex",alignItems:"center"},children:(0,_.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"check-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,_.jsx)("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"})})}),(0,_.jsxs)("div",{style:{marginLeft:"12px"},children:[(0,_.jsxs)(Ib,{type:"success",style:{fontSize:"18px",fontWeight:500,display:"block"},children:["Connection to ",e.search_provider," successful!"]}),n.test_query&&(0,_.jsxs)(Ib,{style:{fontSize:"14px",color:"#666",marginTop:"8px",display:"block"},children:["Test query:"," ",(0,_.jsx)("code",{style:{backgroundColor:"#f0f0f0",padding:"2px 6px",borderRadius:"4px"},children:n.test_query})]}),void 0!==n.results_count&&(0,_.jsxs)(Ib,{style:{fontSize:"14px",color:"#666",display:"block"},children:["Results retrieved: ",n.results_count]})]})]}):(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)("div",{children:[(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:"20px"},children:[(0,_.jsx)(km.WarningOutlined,{style:{color:"#ff4d4f",fontSize:"24px",marginRight:"12px"}}),(0,_.jsxs)(Ib,{type:"danger",style:{fontSize:"18px",fontWeight:500},children:["Connection to ",e.search_provider||"search provider"," failed"]})]}),(0,_.jsxs)("div",{style:{backgroundColor:"#fff2f0",border:"1px solid #ffccc7",borderRadius:"8px",padding:"16px",marginBottom:"20px",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.03)"},children:[(0,_.jsxs)(Ib,{strong:!0,style:{display:"block",marginBottom:"8px"},children:["Error:"," "]}),(0,_.jsx)(Ib,{type:"danger",style:{fontSize:"14px",lineHeight:"1.5"},children:d}),n.error_type&&(0,_.jsx)("div",{style:{marginTop:"8px"},children:(0,_.jsxs)(Ib,{style:{fontSize:"13px",color:"#666"},children:["Error type:"," ",(0,_.jsx)("code",{style:{backgroundColor:"#ffebee",padding:"2px 6px",borderRadius:"4px",color:"#d32f2f"},children:n.error_type})]})}),n.message&&(0,_.jsx)("div",{style:{marginTop:"12px"},children:(0,_.jsx)(z.Button,{type:"link",onClick:()=>o(!i),style:{paddingLeft:0,height:"auto"},children:i?"Hide Details":"Show Details"})})]}),i&&(0,_.jsxs)("div",{style:{marginBottom:"20px"},children:[(0,_.jsx)(Ib,{strong:!0,style:{display:"block",marginBottom:"8px",fontSize:"15px"},children:"Full Error Details"}),(0,_.jsx)("pre",{style:{backgroundColor:"#f5f5f5",padding:"16px",borderRadius:"8px",fontSize:"13px",maxHeight:"200px",overflow:"auto",border:"1px solid #e8e8e8",lineHeight:"1.5",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:n.message})]}),(0,_.jsxs)("div",{style:{backgroundColor:"#fffbf0",border:"1px solid #ffe58f",borderLeft:"4px solid #faad14",borderRadius:"8px",padding:"16px"},children:[(0,_.jsx)(Ib,{strong:!0,style:{display:"block",marginBottom:"8px",color:"#d48806"},children:"Troubleshooting tips:"}),(0,_.jsxs)("ul",{style:{margin:"8px 0",paddingLeft:"20px",color:"#ad6800"},children:[(0,_.jsx)("li",{style:{marginBottom:"6px"},children:"Verify your API key is correct and active"}),(0,_.jsx)("li",{style:{marginBottom:"6px"},children:"Check if the search provider service is operational"}),(0,_.jsx)("li",{style:{marginBottom:"6px"},children:"Ensure you have sufficient credits/quota with the provider"}),(0,_.jsx)("li",{style:{marginBottom:"6px"},children:"Review the provider's documentation for any additional requirements"})]})]})]})}),(0,_.jsx)(eG.Divider,{style:{margin:"24px 0 16px"}}),(0,_.jsx)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:(0,_.jsx)(z.Button,{type:"link",href:"https://docs.litellm.ai/docs/search",target:"_blank",icon:(0,_.jsx)(tK.InfoCircleOutlined,{}),children:"View Search Documentation"})})]}):null},{TextArea:Ij}=$.Input,Iw=({providerName:e,displayName:t})=>(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,_.jsx)(Iy.default,{src:`../ui/assets/logos/${e}.png`,alt:"",width:20,height:20,style:{marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,_.jsx)("span",{children:t})]}),Ik=({userRole:e,accessToken:t,onCreateSuccess:r,isModalVisible:a,setModalVisible:s})=>{let[n]=H.Form.useForm(),[l,i]=(0,T.useState)(!1),[o,d]=(0,T.useState)({}),[c,u]=(0,T.useState)(!1),[m,p]=(0,T.useState)(!1),[h,f]=(0,T.useState)(""),{data:x,isLoading:g}=(0,ev.useQuery)({queryKey:["searchProviders"],queryFn:()=>{if(!t)throw Error("Access Token required");return(0,Q.fetchAvailableSearchProviders)(t)},enabled:!!t&&a}),y=x?.providers||[],b=async e=>{i(!0);try{let a={search_tool_name:e.search_tool_name,litellm_params:{search_provider:e.search_provider,api_key:e.api_key,api_base:e.api_base,timeout:e.timeout?parseFloat(e.timeout):void 0,max_retries:e.max_retries?parseInt(e.max_retries):void 0},search_tool_info:e.description?{description:e.description}:void 0};if(console.log("Creating search tool with payload:",a),null!=t){let e=await (0,Q.createSearchTool)(t,a);J.default.success("Search tool created successfully"),n.resetFields(),d({}),s(!1),r(e)}}catch(e){J.default.error("Error creating search tool: "+e)}finally{i(!1)}},v=async()=>{try{await n.validateFields(["search_provider","api_key"]),p(!0),f(`test-${Date.now()}`),u(!0)}catch(e){J.default.error("Please fill in Search Provider and API Key before testing")}};return(T.default.useEffect(()=>{a||d({})},[a]),(0,ts.isAdminRole)(e))?(0,_.jsxs)(q.Modal,{title:(0,_.jsxs)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:[(0,_.jsx)("span",{className:"text-2xl",children:"🔍"}),(0,_.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add New Search Tool"})]}),open:a,width:800,onCancel:()=>{n.resetFields(),d({}),s(!1)},footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:[(0,_.jsx)("div",{className:"mt-6",children:(0,_.jsxs)(H.Form,{form:n,onFinish:b,onValuesChange:(e,t)=>d(t),layout:"vertical",className:"space-y-6",children:[(0,_.jsxs)("div",{className:"grid grid-cols-1 gap-6",children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Search Tool Name",(0,_.jsx)(tB.Tooltip,{title:"A unique name to identify this search tool configuration (e.g., 'perplexity-search', 'tavily-news-search').",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"search_tool_name",rules:[{required:!0,message:"Please enter a search tool name"},{pattern:/^[a-zA-Z0-9_-]+$/,message:"Name can only contain letters, numbers, hyphens, and underscores"}],children:(0,_.jsx)(et.TextInput,{placeholder:"e.g., perplexity-search, my-tavily-tool",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Search Provider",(0,_.jsx)(tB.Tooltip,{title:"Select the search provider you want to use. Each provider has different capabilities and pricing.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"search_provider",rules:[{required:!0,message:"Please select a search provider"}],children:(0,_.jsx)(eE.Select,{placeholder:"Select a search provider",className:"rounded-lg",size:"large",loading:g,showSearch:!0,optionFilterProp:"children",optionLabelProp:"label",children:y.map(e=>(0,_.jsx)(eE.Select.Option,{value:e.provider_name,label:(0,_.jsx)(Iw,{providerName:e.provider_name,displayName:e.ui_friendly_name}),children:(0,_.jsx)(Iw,{providerName:e.provider_name,displayName:e.ui_friendly_name})},e.provider_name))})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["API Key",(0,_.jsx)(tB.Tooltip,{title:"The API key for authenticating with the search provider. This will be securely stored.",children:(0,_.jsx)(tK.InfoCircleOutlined,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"api_key",rules:[{required:!1,message:"Please enter an API key"}],children:(0,_.jsx)(et.TextInput,{type:"password",placeholder:"Enter your API key",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Description (Optional)"}),name:"description",children:(0,_.jsx)(Ij,{rows:3,placeholder:"Brief description of this search tool's purpose",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})})]}),(0,_.jsxs)("div",{className:"flex justify-between items-center pt-6 border-t border-gray-100",children:[(0,_.jsx)(tB.Tooltip,{title:"Get help on our github",children:(0,_.jsx)(V.Typography.Link,{href:"https://github.com/BerriAI/litellm/issues",target:"_blank",children:"Need Help?"})}),(0,_.jsxs)("div",{className:"space-x-2",children:[(0,_.jsx)(S.Button,{onClick:v,loading:m,children:"Test Connection"}),(0,_.jsx)(S.Button,{loading:l,type:"submit",children:"Add Search Tool"})]})]})]})}),(0,_.jsx)(q.Modal,{title:"Connection Test Results",open:c,onCancel:()=>{u(!1),p(!1)},footer:[(0,_.jsx)(S.Button,{onClick:()=>{u(!1),p(!1)},children:"Close"},"close")],width:700,children:c&&t&&(0,_.jsx)(Iv,{litellmParams:{search_provider:o.search_provider,api_key:o.api_key,api_base:o.api_base},accessToken:t,onTestComplete:()=>p(!1)},h)})]}):null},{Text:IS}=V.Typography,IN=({searchToolName:e,accessToken:t,className:r=""})=>{let[a,s]=(0,T.useState)(""),[n,l]=(0,T.useState)(!1),[i,o]=(0,T.useState)([]),[d,c]=(0,T.useState)({}),[u,m]=(0,T.useState)(!1),p=async()=>{if(!a.trim())return void tU.default.warning("Please enter a search query");l(!0);let r=performance.now();try{let s=await (0,Q.searchToolQueryCall)(t,e,a),n=performance.now(),l=Math.round(n-r),i={query:a,response:s,timestamp:Date.now(),latency:l};o(e=>[i,...e])}catch(e){console.error("Error querying search tool:",e),J.default.fromBackend("Failed to query search tool")}finally{l(!1)}},h=e=>new Date(e).toLocaleString(),f=(0,_.jsx)(wo.LoadingOutlined,{style:{fontSize:24},spin:!0}),x=i.length>0?i[0]:null;return(0,_.jsxs)(P.Card,{className:"mt-6",children:[(0,_.jsx)("div",{className:"mb-6",children:(0,_.jsx)(X.Title,{children:"Test Search Tool"})}),(0,_.jsxs)("div",{className:"flex flex-col",style:{minHeight:"600px"},children:[(0,_.jsx)("div",{className:"mb-6",children:(0,_.jsxs)("div",{className:"flex items-stretch gap-3",children:[(0,_.jsxs)("div",{className:"flex items-center flex-1 bg-white rounded-lg px-4 transition-all duration-200",style:{border:u?"2px solid #3b82f6":"2px solid #e5e7eb",boxShadow:u?"0 0 0 3px rgba(59, 130, 246, 0.1)":"0 1px 2px 0 rgba(0, 0, 0, 0.05)",height:"48px"},children:[(0,_.jsx)(ry.SearchOutlined,{className:"text-gray-400 mr-3",style:{fontSize:"18px"}}),(0,_.jsx)($.Input,{value:a,onChange:e=>s(e.target.value),onFocus:()=>m(!0),onBlur:()=>m(!1),onPressEnter:e=>{e.shiftKey||(e.preventDefault(),p())},placeholder:"Enter your search query...",disabled:n,bordered:!1,style:{fontSize:"15px",padding:0,height:"100%",boxShadow:"none"}})]}),(0,_.jsx)(z.Button,{type:"primary",onClick:p,disabled:n||!a.trim(),icon:(0,_.jsx)(ry.SearchOutlined,{}),loading:n,style:{height:"48px",paddingLeft:"24px",paddingRight:"24px",borderRadius:"8px",fontWeight:500,fontSize:"15px",backgroundColor:n||!a.trim()?void 0:"#1890ff",borderColor:n||!a.trim()?void 0:"#1890ff",boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05)"},children:"Search"})]})}),(0,_.jsx)("div",{className:"flex-1",children:x||n?(0,_.jsxs)("div",{children:[n&&(0,_.jsxs)("div",{className:"flex flex-col justify-center items-center py-16",children:[(0,_.jsx)(rm.Spin,{indicator:f}),(0,_.jsx)(IS,{className:"mt-4 text-gray-600 font-medium",children:"Searching..."})]}),x&&!n&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"mb-6 p-4 bg-blue-50 border border-blue-200 rounded-lg",style:{boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05)"},children:(0,_.jsxs)("div",{className:"flex items-center justify-between",children:[(0,_.jsxs)("div",{className:"flex-1",children:[(0,_.jsx)(IS,{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide",children:"Search Query"}),(0,_.jsx)("div",{className:"text-base font-semibold text-gray-900 mt-1.5",children:x.query})]}),(0,_.jsxs)("div",{className:"text-right ml-4",children:[(0,_.jsx)(IS,{className:"text-xs text-gray-500",children:h(x.timestamp)}),(0,_.jsxs)("div",{className:"flex items-center gap-3 mt-1",children:[(0,_.jsxs)("div",{className:"text-sm font-semibold text-blue-600",children:[x.response?.results?.length||0," ",x.response?.results?.length===1?"result":"results"]}),void 0!==x.latency&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("span",{className:"text-gray-400",children:"•"}),(0,_.jsxs)("div",{className:"text-sm font-semibold text-green-600",children:[x.latency,"ms"]})]})]})]})]})}),x.response&&x.response.results&&x.response.results.length>0?(0,_.jsx)("div",{className:"space-y-3",children:x.response.results.map((e,t)=>{let r=d[`0-${t}`]||!1;return(0,_.jsx)("div",{className:"bg-white border border-gray-200 rounded-lg overflow-hidden transition-all duration-200",style:{boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05)"},onMouseEnter:e=>{e.currentTarget.style.boxShadow="0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",e.currentTarget.style.borderColor="#e0e7ff"},onMouseLeave:e=>{e.currentTarget.style.boxShadow="0 1px 2px 0 rgba(0, 0, 0, 0.05)",e.currentTarget.style.borderColor="#e5e7eb"},children:(0,_.jsxs)("div",{className:"p-5",children:[(0,_.jsxs)("div",{className:"flex items-start justify-between gap-3 mb-2",children:[(0,_.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-lg font-semibold text-blue-600 hover:text-blue-700 flex-1 leading-snug",style:{textDecoration:"none"},onMouseEnter:e=>e.currentTarget.style.textDecoration="underline",onMouseLeave:e=>e.currentTarget.style.textDecoration="none",children:e.title}),(0,_.jsx)(z.Button,{type:"text",size:"small",className:"flex-shrink-0",icon:(0,_.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})}),onClick:()=>window.open(e.url,"_blank"),style:{color:"#6b7280"}})]}),(0,_.jsx)("div",{className:"text-sm text-green-700 mb-3 truncate font-medium",children:e.url}),(0,_.jsx)("div",{className:"text-sm text-gray-700 leading-relaxed",children:r?e.snippet:`${e.snippet.substring(0,200)}${e.snippet.length>200?"...":""}`}),e.snippet.length>200&&(0,_.jsx)(z.Button,{type:"link",size:"small",className:"mt-3 p-0 h-auto",onClick:()=>{let e;return e=`0-${t}`,void c(t=>({...t,[e]:!t[e]}))},style:{fontSize:"13px",fontWeight:500,color:"#3b82f6"},children:r?"Show less":"Show more"})]})},t)})}):(0,_.jsxs)("div",{className:"text-center py-12 bg-gray-50 border border-gray-200 rounded-lg",children:[(0,_.jsx)("div",{className:"flex items-center justify-center w-16 h-16 rounded-full bg-gray-100 mx-auto mb-4",children:(0,_.jsx)(ry.SearchOutlined,{style:{fontSize:"24px",color:"#9ca3af"}})}),(0,_.jsx)(IS,{className:"text-gray-600 font-medium",children:"No results found"}),(0,_.jsx)(IS,{className:"text-sm text-gray-500 mt-1",children:"Try a different search query"})]})]}),i.length>1&&(0,_.jsxs)("div",{className:"mt-8 pt-6 border-t border-gray-200",children:[(0,_.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,_.jsx)(IS,{className:"text-sm font-semibold text-gray-700",children:"Previous Searches"}),(0,_.jsx)(z.Button,{onClick:()=>{o([]),c({}),J.default.success("Search history cleared")},size:"small",type:"link",style:{fontSize:"13px",fontWeight:500},children:"Clear All"})]}),(0,_.jsx)("div",{className:"space-y-2",children:i.slice(1,6).map((e,t)=>(0,_.jsxs)("div",{className:"p-3 bg-gray-50 border border-gray-200 rounded-lg cursor-pointer transition-all duration-200 hover:bg-gray-100 hover:border-gray-300",onClick:()=>{s(e.query)},children:[(0,_.jsx)("div",{className:"text-sm font-medium text-gray-800 truncate",children:e.query}),(0,_.jsxs)("div",{className:"text-xs text-gray-500 mt-1.5 flex items-center gap-2",children:[(0,_.jsxs)("span",{className:"font-medium text-blue-600",children:[e.response?.results?.length||0," ",e.response?.results?.length===1?"result":"results"]}),void 0!==e.latency&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("span",{children:"•"}),(0,_.jsxs)("span",{className:"font-medium text-green-600",children:[e.latency,"ms"]})]}),(0,_.jsx)("span",{children:"•"}),(0,_.jsx)("span",{children:h(e.timestamp)})]})]},t+1))})]})]}):(0,_.jsxs)("div",{className:"h-full flex flex-col items-center justify-center p-8",children:[(0,_.jsx)("div",{className:"flex items-center justify-center w-24 h-24 rounded-full bg-gray-100 mb-6",children:(0,_.jsx)(ry.SearchOutlined,{style:{fontSize:"48px",color:"#9ca3af"}})}),(0,_.jsx)(IS,{className:"text-lg text-gray-600 font-medium",children:"Test your search tool"}),(0,_.jsx)(IS,{className:"text-sm text-gray-500 mt-2",children:"Enter a query above to see search results"})]})})]})]})},IT=({searchTool:e,onBack:t,isEditing:r,accessToken:a,availableProviders:s})=>{var n;let l,[i,o]=(0,T.useState)({}),d=async(e,t)=>{await (0,rV.copyToClipboard)(e)&&(o(e=>({...e,[t]:!0})),setTimeout(()=>{o(e=>({...e,[t]:!1}))},2e3))};return(0,_.jsxs)("div",{className:"p-4 max-w-full",children:[(0,_.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,_.jsxs)("div",{children:[(0,_.jsx)(S.Button,{icon:rH.ArrowLeftIcon,variant:"light",className:"mb-4",onClick:t,children:"Back to All Search Tools"}),(0,_.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,_.jsx)(X.Title,{children:e.search_tool_name}),(0,_.jsx)(z.Button,{type:"text",size:"small",icon:i["search-tool-name"]?(0,_.jsx)(M_.CheckIcon,{size:12}):(0,_.jsx)(Mb.CopyIcon,{size:12}),onClick:()=>d(e.search_tool_name,"search-tool-name"),className:`left-2 z-10 transition-all duration-200 ${i["search-tool-name"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`})]}),(0,_.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,_.jsx)(Z.Text,{className:"text-gray-500 font-mono",children:e.search_tool_id}),(0,_.jsx)(z.Button,{type:"text",size:"small",icon:i["search-tool-id"]?(0,_.jsx)(M_.CheckIcon,{size:12}):(0,_.jsx)(Mb.CopyIcon,{size:12}),onClick:()=>d(e.search_tool_id,"search-tool-id"),className:`left-2 z-10 transition-all duration-200 ${i["search-tool-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`})]})]})}),(0,_.jsxs)(ee.Grid,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Provider"}),(0,_.jsx)("div",{className:"mt-2",children:(0,_.jsx)(X.Title,{children:(n=e.litellm_params.search_provider,l=s.find(e=>e.provider_name===n),l?.ui_friendly_name||n)})})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"API Key"}),(0,_.jsx)("div",{className:"mt-2",children:(0,_.jsx)(Z.Text,{children:e.litellm_params.api_key?"****":"Not set"})})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Created At"}),(0,_.jsx)("div",{className:"mt-2",children:(0,_.jsx)(Z.Text,{children:e.created_at?new Date(e.created_at).toLocaleString():"Unknown"})})]})]}),e.search_tool_info?.description&&(0,_.jsxs)(P.Card,{className:"mt-6",children:[(0,_.jsx)(Z.Text,{children:"Description"}),(0,_.jsx)("div",{className:"mt-2",children:(0,_.jsx)(Z.Text,{children:e.search_tool_info.description})})]}),(0,_.jsx)("div",{className:"mt-6",children:a&&(0,_.jsx)(IN,{searchToolName:e.search_tool_name,accessToken:a})})]})},IM=({accessToken:e,userRole:t,userID:r})=>{let{data:a,isLoading:s,refetch:n}=(0,ev.useQuery)({queryKey:["searchTools"],queryFn:()=>{if(!e)throw Error("Access Token required");return(0,Q.fetchSearchTools)(e).then(e=>e.search_tools||[])},enabled:!!e}),{data:l,isLoading:i}=(0,ev.useQuery)({queryKey:["searchProviders"],queryFn:()=>{if(!e)throw Error("Access Token required");return(0,Q.fetchAvailableSearchProviders)(e)},enabled:!!e}),o=l?.providers||[],[d,c]=(0,T.useState)(null),[u,m]=(0,T.useState)(!1),[p,h]=(0,T.useState)(!1),[f,x]=(0,T.useState)(null),[g,y]=(0,T.useState)(!1),[b,v]=(0,T.useState)(!1),[j,w]=(0,T.useState)(!1),[k]=H.Form.useForm(),N=T.default.useMemo(()=>{let e,t,r;return e=e=>{x(e),y(!1)},t=e=>{let t=a?.find(t=>t.search_tool_id===e);t&&(k.setFieldsValue({search_tool_name:t.search_tool_name,search_provider:t.litellm_params.search_provider,api_key:t.litellm_params.api_key,api_base:t.litellm_params.api_base,timeout:t.litellm_params.timeout,max_retries:t.litellm_params.max_retries,description:t.search_tool_info?.description}),x(e),w(!0))},r=M,[{title:"Search Tool ID",dataIndex:"search_tool_id",key:"search_tool_id",render:(t,r)=>r.is_from_config?(0,_.jsx)("span",{className:"text-xs",children:"-"}):(0,_.jsx)("button",{onClick:()=>e(r.search_tool_id),className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left cursor-pointer max-w-40",children:(0,_.jsx)("span",{className:"truncate block",children:r.search_tool_id})})},{title:"Name",dataIndex:"search_tool_name",key:"search_tool_name",render:e=>(0,_.jsx)("span",{className:"font-medium",children:e})},{title:"Provider",key:"provider",render:(e,t)=>{let r=t.litellm_params.search_provider,a=o.find(e=>e.provider_name===r),s=a?.ui_friendly_name||r;return(0,_.jsx)("span",{className:"text-sm",children:s})}},{title:"Created At",dataIndex:"created_at",key:"created_at",render:(e,t)=>(0,_.jsx)("span",{className:"text-xs",children:t.created_at?new Date(t.created_at).toLocaleDateString():"-"})},{title:"Updated At",dataIndex:"updated_at",key:"updated_at",render:(e,t)=>(0,_.jsx)("span",{className:"text-xs",children:t.updated_at?new Date(t.updated_at).toLocaleDateString():"-"})},{title:"Source",key:"source",render:(e,t)=>{let r=t.is_from_config??!1;return(0,_.jsx)(eN.Tag,{color:r?"default":"blue",children:r?"Config":"DB"})}},{title:"Actions",key:"actions",render:(e,a)=>{let s=a.search_tool_id,n=a.is_from_config??!1;return(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(rG.default,{variant:"Edit",tooltipText:"Edit search tool",disabled:n,disabledTooltipText:"Config search tool cannot be edited on the dashboard. Please edit it from the config file.",onClick:()=>{s&&!n&&t(s)}}),(0,_.jsx)(rG.default,{variant:"Delete",tooltipText:"Delete search tool",disabled:n,disabledTooltipText:"Config search tool cannot be deleted on the dashboard. Please delete it from the config file.",onClick:()=>{s&&!n&&r(s)}})]})}}]},[o,a,k]);function M(e){c(e),m(!0)}let C=async()=>{if(null!=d&&null!=e){h(!0);try{await (0,Q.deleteSearchTool)(e,d),J.default.success("Deleted search tool successfully"),m(!1),c(null),n()}catch(e){console.error("Error deleting the search tool:",e),J.default.error("Failed to delete search tool")}finally{h(!1)}}},L=a?.find(e=>e.search_tool_id===d),O=L?o.find(e=>e.provider_name===L.litellm_params.search_provider):null,D=async()=>{if(e&&f)try{let t=await k.validateFields(),r={search_tool_name:t.search_tool_name,litellm_params:{search_provider:t.search_provider,api_key:t.api_key,api_base:t.api_base,timeout:t.timeout?parseFloat(t.timeout):void 0,max_retries:t.max_retries?parseInt(t.max_retries):void 0},search_tool_info:t.description?{description:t.description}:void 0};await (0,Q.updateSearchTool)(e,f,r),J.default.success("Search tool updated successfully"),w(!1),k.resetFields(),x(null),n()}catch(e){console.error("Failed to update search tool:",e),J.default.error("Failed to update search tool")}};return e&&t&&r?(0,_.jsxs)("div",{className:"w-full h-full p-6",children:[(0,_.jsx)(eH.default,{isOpen:u,title:"Delete Search Tool",message:"Are you sure you want to delete this search tool? This action cannot be undone.",resourceInformationTitle:"Search Tool Information",resourceInformation:L?[{label:"Name",value:L.search_tool_name},{label:"ID",value:L.search_tool_id,code:!0},{label:"Provider",value:O?.ui_friendly_name||L.litellm_params.search_provider},{label:"Description",value:L.search_tool_info?.description||"-"}]:[],onCancel:()=>{m(!1),c(null)},onOk:C,confirmLoading:p}),(0,_.jsx)(Ik,{userRole:t,accessToken:e,onCreateSuccess:e=>{v(!1),n()},isModalVisible:b,setModalVisible:v}),(0,_.jsx)(q.Modal,{title:"Edit Search Tool",open:j,onOk:D,onCancel:()=>{w(!1),k.resetFields(),x(null)},width:600,children:(0,_.jsxs)(H.Form,{form:k,layout:"vertical",children:[(0,_.jsx)(H.Form.Item,{name:"search_tool_name",label:"Search Tool Name",rules:[{required:!0,message:"Please enter a search tool name"}],children:(0,_.jsx)($.Input,{placeholder:"e.g., my-perplexity-search"})}),(0,_.jsx)(H.Form.Item,{name:"search_provider",label:"Search Provider",rules:[{required:!0,message:"Please select a search provider"}],children:(0,_.jsx)(eE.Select,{placeholder:"Select a search provider",loading:i,children:o.map(e=>(0,_.jsx)(eE.Select.Option,{value:e.provider_name,children:e.ui_friendly_name},e.provider_name))})}),(0,_.jsx)(H.Form.Item,{name:"api_key",label:"API Key",extra:"API key for the search provider",children:(0,_.jsx)($.Input.Password,{placeholder:"Enter API key"})}),(0,_.jsx)(H.Form.Item,{name:"description",label:"Description",children:(0,_.jsx)($.Input.TextArea,{rows:3,placeholder:"Description of this search tool"})})]})}),(0,_.jsx)(X.Title,{children:"Search Tools"}),(0,_.jsx)(Z.Text,{className:"text-tremor-content mt-2",children:"Configure and manage your search providers"}),(0,ts.isAdminRole)(t)&&(0,_.jsx)(S.Button,{className:"mt-4 mb-4",onClick:()=>v(!0),children:"+ Add New Search Tool"}),(0,_.jsx)(()=>f?(0,_.jsx)(IT,{searchTool:a?.find(e=>e.search_tool_id===f)||{search_tool_id:"",search_tool_name:"",litellm_params:{search_provider:""}},onBack:()=>{y(!1),x(null),n()},isEditing:g,accessToken:e,availableProviders:o}):(0,_.jsx)("div",{className:"w-full h-full",children:(0,_.jsx)(rm.Spin,{spinning:s,indicator:(0,_.jsx)(wo.LoadingOutlined,{spin:!0}),size:"large",children:(0,_.jsx)(eK.Table,{bordered:!0,dataSource:a||[],columns:N,rowKey:e=>e.search_tool_id||e.search_tool_name,pagination:!1,locale:{emptyText:"No search tools configured"},size:"small"})})}),{})]}):(console.log("Missing required authentication parameters",{accessToken:e,userRole:t,userID:r}),(0,_.jsx)("div",{className:"p-6 text-center text-gray-500",children:"Missing required authentication parameters."}))},{Title:IC}=V.Typography,IL=({accessToken:e})=>{let[t,r]=(0,T.useState)(!0),[a,s]=(0,T.useState)([]);(0,T.useEffect)(()=>{n()},[e]);let n=async()=>{if(e){r(!0);try{let t=await (0,Q.getEmailEventSettings)(e);s(t.settings)}catch(e){console.error("Failed to fetch email event settings:",e),J.default.fromBackend(e)}finally{r(!1)}}},l=async()=>{if(e)try{await (0,Q.updateEmailEventSettings)(e,{settings:a}),J.default.success("Email event settings updated successfully")}catch(e){console.error("Failed to update email event settings:",e),J.default.fromBackend(e)}},i=async()=>{if(e)try{await (0,Q.resetEmailEventSettings)(e),J.default.success("Email event settings reset to defaults"),n()}catch(e){console.error("Failed to reset email event settings:",e),J.default.fromBackend(e)}};return(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(IC,{level:4,children:"Email Notifications"}),(0,_.jsx)(Z.Text,{children:"Select which events should trigger email notifications."}),(0,_.jsx)(eG.Divider,{}),t?(0,_.jsx)("div",{style:{textAlign:"center",padding:"20px"},children:(0,_.jsx)(rm.Spin,{size:"large"})}):(0,_.jsx)("div",{className:"space-y-4",children:a.map(e=>(0,_.jsxs)("div",{className:"flex items-center",children:[(0,_.jsx)(eA.Checkbox,{checked:e.enabled,onChange:t=>{var r,n;return r=e.event,n=t.target.checked,void s(a.map(e=>e.event===r?{...e,enabled:n}:e))}}),(0,_.jsxs)("div",{className:"ml-3",children:[(0,_.jsx)(Z.Text,{children:e.event}),(0,_.jsx)("div",{className:"text-sm text-gray-500 block",children:(e=>{if(e.includes("Virtual Key Created"))return"An email will be sent to the user when a new virtual key is created with their user ID";{if(e.includes("New User Invitation"))return"An email will be sent to the email address of the user when a new user is created";let t=e.split(/(?=[A-Z])/).join(" ").toLowerCase();return`Receive an email notification when ${t}`}})(e.event)})]})]},e.event))}),(0,_.jsxs)("div",{className:"mt-6 flex space-x-4",children:[(0,_.jsx)(S.Button,{onClick:l,disabled:t,children:"Save Changes"}),(0,_.jsx)(S.Button,{onClick:i,variant:"secondary",disabled:t,children:"Reset to Defaults"})]})]})},{Title:IO}=V.Typography,ID=({accessToken:e,premiumUser:t,alerts:r})=>{let a=async()=>{if(!e)return;let t={};r.filter(e=>"email"===e.name).forEach(e=>{Object.entries(e.variables??{}).forEach(([e,r])=>{let a=document.querySelector(`input[name="${e}"]`);a&&a.value&&(t[e]=a?.value)})}),console.log("updatedVariables",t);try{await (0,Q.setCallbacksCall)(e,{general_settings:{alerting:["email"]},environment_variables:t}),J.default.success("Email settings updated successfully")}catch(e){J.default.fromBackend(e)}};return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"mt-6 mb-6",children:(0,_.jsx)(IL,{accessToken:e})}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(IO,{level:4,children:"Email Server Settings"}),(0,_.jsxs)(Z.Text,{children:[(0,_.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/email",target:"_blank",style:{color:"blue"},children:[" ","LiteLLM Docs: email alerts"]})," ",(0,_.jsx)("br",{})]}),(0,_.jsx)("div",{className:"flex w-full",children:r.filter(e=>"email"===e.name).map((e,r)=>(0,_.jsx)(I.TableCell,{children:(0,_.jsx)("ul",{children:(0,_.jsx)(ee.Grid,{numItems:2,children:Object.entries(e.variables??{}).map(([e,r])=>(0,_.jsxs)("li",{className:"mx-2 my-2",children:[!0!=t&&("EMAIL_LOGO_URL"===e||"EMAIL_SUPPORT_CONTACT"===e)?(0,_.jsxs)("div",{children:[(0,_.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:(0,_.jsxs)(Z.Text,{className:"mt-2",children:[" ✨ ",e]})}),(0,_.jsx)(et.TextInput,{name:e,defaultValue:r,type:"password",disabled:!0,style:{width:"400px"}})]}):(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"mt-2",children:e}),(0,_.jsx)(et.TextInput,{name:e,defaultValue:r,type:"password",style:{width:"400px"}})]}),(0,_.jsxs)("p",{style:{fontSize:"small",fontStyle:"italic"},children:["SMTP_HOST"===e&&(0,_.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP host address, e.g. `smtp.resend.com`",(0,_.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_PORT"===e&&(0,_.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP port number, e.g. `587`",(0,_.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_USERNAME"===e&&(0,_.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP username, e.g. `username`",(0,_.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_PASSWORD"===e&&(0,_.jsx)("span",{style:{color:"red"},children:" Required * "}),"SMTP_SENDER_EMAIL"===e&&(0,_.jsxs)("div",{style:{color:"gray"},children:["Enter the sender email address, e.g. `sender@berri.ai`",(0,_.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"TEST_EMAIL_ADDRESS"===e&&(0,_.jsxs)("div",{style:{color:"gray"},children:["Email Address to send `Test Email Alert` to. example: `info@berri.ai`",(0,_.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"EMAIL_LOGO_URL"===e&&(0,_.jsx)("div",{style:{color:"gray"},children:"(Optional) Customize the Logo that appears in the email, pass a url to your logo"}),"EMAIL_SUPPORT_CONTACT"===e&&(0,_.jsx)("div",{style:{color:"gray"},children:"(Optional) Customize the support email address that appears in the email. Default is support@berri.ai"})]})]},e))})})},r))}),(0,_.jsx)(S.Button,{className:"mt-2",onClick:()=>a(),children:"Save Changes"}),(0,_.jsx)(S.Button,{onClick:async()=>{if(e)try{await (0,Q.serviceHealthCheck)(e,"email"),J.default.success("Email test triggered. Check your configured email inbox/logs.")}catch(e){J.default.fromBackend(e)}},className:"mx-2",children:"Test Email Alerts"})]})]})};var IP=e.i(905536);let IA=({alertingSettings:e,handleInputChange:t,handleResetField:r,handleSubmit:a,premiumUser:s})=>{let[n]=H.Form.useForm();return(0,_.jsxs)(H.Form,{form:n,onFinish:()=>{console.log("INSIDE ONFINISH");let e=n.getFieldsValue(),t=Object.entries(e).every(([e,t])=>"boolean"!=typeof t&&(""===t||null==t));console.log(`formData: ${JSON.stringify(e)}, isEmpty: ${t}`),t?console.log("Some form fields are empty."):a(e)},labelAlign:"left",children:[e.map((e,a)=>(0,_.jsxs)(R.TableRow,{children:[(0,_.jsxs)(I.TableCell,{align:"center",children:[(0,_.jsx)(Z.Text,{children:e.field_name}),(0,_.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:e.field_description})]}),e.premium_field?s?(0,_.jsx)(H.Form.Item,{name:e.field_name,children:(0,_.jsx)(I.TableCell,{children:"Integer"===e.field_type?(0,_.jsx)(tq.InputNumber,{step:1,value:e.field_value,onChange:r=>t(e.field_name,r)}):"Boolean"===e.field_type?(0,_.jsx)(wL.Switch,{checked:e.field_value,onChange:r=>t(e.field_name,r)}):(0,_.jsx)($.Input,{value:e.field_value,onChange:r=>t(e.field_name,r)})})}):(0,_.jsx)(I.TableCell,{children:(0,_.jsx)(S.Button,{className:"flex items-center justify-center",children:(0,_.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Enterprise Feature"})})}):(0,_.jsx)(H.Form.Item,{name:e.field_name,className:"mb-0",valuePropName:"Boolean"===e.field_type?"checked":"value",children:(0,_.jsx)(I.TableCell,{children:"Integer"===e.field_type?(0,_.jsx)(tq.InputNumber,{step:1,value:e.field_value,onChange:r=>t(e.field_name,r),className:"p-0"}):"Boolean"===e.field_type?(0,_.jsx)(wL.Switch,{checked:e.field_value,onChange:r=>{t(e.field_name,r),n.setFieldsValue({[e.field_name]:r})}}):(0,_.jsx)($.Input,{value:e.field_value,onChange:r=>t(e.field_name,r)})})}),(0,_.jsx)(I.TableCell,{children:!0==e.stored_in_db?(0,_.jsx)(tR.Badge,{icon:jr.CheckCircleIcon,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,_.jsx)(tR.Badge,{className:"text-gray bg-white outline",children:"In Config"}):(0,_.jsx)(tR.Badge,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,_.jsx)(I.TableCell,{children:(0,_.jsx)(yi.Icon,{icon:jO.TrashIcon,color:"red",onClick:()=>r(e.field_name,a),children:"Reset"})})]},a)),(0,_.jsx)("div",{children:(0,_.jsx)(z.Button,{htmlType:"submit",children:"Update Settings"})})]})},IE=({accessToken:e,premiumUser:t})=>{let[r,a]=(0,T.useState)([]);return(0,T.useEffect)(()=>{e&&(0,Q.alertingSettingsCall)(e).then(e=>{a(e)})},[e]),(0,_.jsx)(IA,{alertingSettings:r,handleInputChange:(e,t)=>{let s=r.map(r=>r.field_name===e?{...r,field_value:t}:r);console.log(`updatedSettings: ${JSON.stringify(s)}`),a(s)},handleResetField:(t,s)=>{if(e)try{let e=r.map(e=>e.field_name===t?{...e,stored_in_db:null,field_value:e.field_default_value}:e);a(e)}catch(e){console.log("ERROR OCCURRED!")}},handleSubmit:t=>{if(!e)return;if(console.log(`formValues: ${t}`),null==t||void 0==t)return;let a={};r.forEach(e=>{a[e.field_name]=e.field_value});let s={...t,...a};console.log(`mergedFormValues: ${JSON.stringify(s)}`);let{slack_alerting:n,...l}=s;console.log(`slack_alerting: ${n}, alertingArgs: ${JSON.stringify(l)}`);try{(0,Q.updateConfigFieldSetting)(e,"alerting_args",l),"boolean"==typeof n&&(!0==n?(0,Q.updateConfigFieldSetting)(e,"alerting",["slack"]):(0,Q.updateConfigFieldSetting)(e,"alerting",[])),J.default.success("Wait 10s for proxy to update.")}catch(e){}},premiumUser:t})},II=(0,ej.createQueryKeys)("cloudZeroSettings"),IY=async e=>{let t=(0,Q.getProxyBaseUrl)(),r=t?`${t}/cloudzero/settings`:"/cloudzero/settings",a=await fetch(r,{method:"GET",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!a.ok){let e="Failed to fetch CloudZero settings";try{let t=await a.json();"object"==typeof t&&null!==t?e=t?.error?.message||t?.error||t?.message||t?.detail||("string"==typeof t?.error?t.error:e):"string"==typeof t&&(e=t)}catch{e=a.statusText||e}throw Error(e)}let s=await a.json();return s&&(s.api_key_masked||s.connection_id)?s:null},IF=async(e,t)=>{let r=(0,Q.getProxyBaseUrl)(),a=r?`${r}/cloudzero/settings`:"/cloudzero/settings",s=await fetch(a,{method:"PUT",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({...t.connection_id&&{connection_id:t.connection_id},...t.timezone&&{timezone:t.timezone},...t.api_key&&{api_key:t.api_key}})});if(!s.ok){let e="Failed to update CloudZero settings";try{let t=await s.json();"object"==typeof t&&null!==t?e=t?.error?.message||t?.error||t?.message||t?.detail||("string"==typeof t?.error?t.error:e):"string"==typeof t&&(e=t)}catch{e=s.statusText||e}throw Error(e)}return await s.json()},IR=async e=>{let t=(0,Q.getProxyBaseUrl)(),r=t?`${t}/cloudzero/delete`:"/cloudzero/delete",a=await fetch(r,{method:"DELETE",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!a.ok){let e="Failed to delete CloudZero settings";try{let t=await a.json();"object"==typeof t&&null!==t?e=t?.error?.message||t?.error||t?.message||t?.detail||("string"==typeof t?.error?t.error:e):"string"==typeof t&&(e=t)}catch{e=a.statusText||e}throw Error(e)}return await a.json()},{Title:IB,Paragraph:Iz}=V.Typography;function IH({startCreation:e}){return(0,_.jsx)("div",{className:"bg-white p-12 rounded-lg border border-dashed border-gray-300 text-center max-w-2xl mx-auto mt-8",children:(0,_.jsx)(e0.Empty,{image:e0.Empty.PRESENTED_IMAGE_SIMPLE,description:(0,_.jsxs)("div",{className:"space-y-2",children:[(0,_.jsx)(IB,{level:4,children:"No CloudZero Integration Found"}),(0,_.jsx)(Iz,{type:"secondary",className:"max-w-md mx-auto",children:"Connect your CloudZero account to start tracking and analyzing your cloud costs directly from LiteLLM."})]}),children:(0,_.jsx)(z.Button,{type:"primary",size:"large",onClick:e,className:"flex items-center gap-2 mx-auto mt-4",children:"Add CloudZero Integration"})})})}let I$=async(e,t)=>{let r=(0,Q.getProxyBaseUrl)(),a=r?`${r}/cloudzero/init`:"/cloudzero/init",s=await fetch(a,{method:"POST",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({connection_id:t.connection_id,timezone:t.timezone??"UTC",...t.api_key&&{api_key:t.api_key}})});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(e?.error?.message||e?.message||e?.detail||"Failed to create CloudZero integration")}return await s.json()};function Iq({open:e,onOk:t,onCancel:r}){let a,{accessToken:s}=(0,k.default)(),[n]=H.Form.useForm(),l=(a=s||"",(0,ep.useMutation)({mutationFn:async e=>{if(!a)throw Error("Access token is required");return await I$(a,e)}}));(0,T.useEffect)(()=>{e&&n.resetFields()},[e,n]);let i=async()=>{try{let e=await n.validateFields();l.mutate({connection_id:e.connection_id,timezone:e.timezone||"UTC",...e.api_key&&{api_key:e.api_key}},{onSuccess:()=>{tU.default.success("CloudZero integration created successfully"),n.resetFields(),t()},onError:e=>{e?.errorFields||tU.default.error(e?.message||"Failed to create CloudZero integration")}})}catch(e){if(e?.errorFields)return;tU.default.error(e?.message||"Failed to create CloudZero integration")}};return(0,_.jsx)(q.Modal,{title:"Create CloudZero Integration",open:e,onOk:i,onCancel:()=>{n.resetFields(),r()},confirmLoading:l.isPending,okText:l.isPending?"Creating...":"Create",cancelText:"Cancel",okButtonProps:{disabled:l.isPending},cancelButtonProps:{disabled:l.isPending},children:(0,_.jsxs)(H.Form,{form:n,layout:"vertical",onFinish:i,children:[(0,_.jsx)(H.Form.Item,{label:"CloudZero API Key",name:"api_key",rules:[{required:!0,message:"Please enter your CloudZero API key"}],children:(0,_.jsx)($.Input.Password,{placeholder:"Enter your CloudZero API key"})}),(0,_.jsx)(H.Form.Item,{label:"Connection ID",name:"connection_id",rules:[{required:!0,message:"Please enter your CloudZero connection ID"}],children:(0,_.jsx)($.Input,{placeholder:"Enter your CloudZero connection ID"})}),(0,_.jsx)(H.Form.Item,{label:"Timezone",name:"timezone",tooltip:"Timezone for date handling (defaults to UTC if not provided)",children:(0,_.jsx)($.Input,{placeholder:"UTC"})})]})})}let IU=async(e,t={})=>{let r=(0,Q.getProxyBaseUrl)(),a=r?`${r}/cloudzero/dry-run`:"/cloudzero/dry-run",s=await fetch(a,{method:"POST",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({limit:t.limit??10})});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(e?.error?.message||e?.message||e?.detail||"Failed to perform dry run")}return await s.json()},IW=async(e,t={})=>{let r=(0,Q.getProxyBaseUrl)(),a=r?`${r}/cloudzero/export`:"/cloudzero/export",s=await fetch(a,{method:"POST",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({operation:t.operation??"replace_hourly"})});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(e?.error?.message||e?.message||e?.detail||"Failed to export data")}return await s.json()};var IV=e.i(883552);let IG=(0,eT.default)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);var IK=e.i(431343),IJ=e.i(569074);function IQ({open:e,onOk:t,onCancel:r,settings:a}){var s;let n,{accessToken:l}=(0,k.default)(),[i]=H.Form.useForm(),o=(s=l||"",n=(0,eh.useQueryClient)(),(0,ep.useMutation)({mutationFn:async e=>{if(!s)throw Error("Access token is required");return await IF(s,e)},onSuccess:()=>{n.invalidateQueries({queryKey:II.list({})})}}));(0,T.useEffect)(()=>{e&&a?i.setFieldsValue({connection_id:a.connection_id,timezone:a.timezone||"UTC",api_key:""}):e&&i.resetFields()},[e,a,i]);let d=async()=>{try{let e=await i.validateFields();o.mutate({connection_id:e.connection_id,timezone:e.timezone||"UTC",...e.api_key&&{api_key:e.api_key}},{onSuccess:()=>{tU.default.success("CloudZero integration updated successfully"),i.resetFields(),t()},onError:e=>{e?.errorFields||tU.default.error(e?.message||"Failed to update CloudZero integration")}})}catch(e){if(e?.errorFields)return;tU.default.error(e?.message||"Failed to update CloudZero integration")}};return(0,_.jsx)(q.Modal,{title:"Edit CloudZero Integration",open:e,onOk:d,onCancel:()=>{i.resetFields(),r()},confirmLoading:o.isPending,okText:o.isPending?"Updating...":"Update",cancelText:"Cancel",okButtonProps:{disabled:o.isPending},cancelButtonProps:{disabled:o.isPending},children:(0,_.jsxs)(H.Form,{form:i,layout:"vertical",onFinish:d,children:[(0,_.jsx)(H.Form.Item,{label:"CloudZero API Key",name:"api_key",rules:[{required:!1,message:"Please enter your CloudZero API key"}],tooltip:"Leave empty to keep the existing API key",children:(0,_.jsx)($.Input.Password,{placeholder:"Leave empty to keep existing"})}),(0,_.jsx)(H.Form.Item,{label:"Connection ID",name:"connection_id",rules:[{required:!0,message:"Please enter your CloudZero connection ID"}],children:(0,_.jsx)($.Input,{placeholder:"Enter your CloudZero connection ID"})}),(0,_.jsx)(H.Form.Item,{label:"Timezone",name:"timezone",tooltip:"Timezone for date handling (defaults to UTC if not provided)",children:(0,_.jsx)($.Input,{placeholder:"UTC"})})]})})}function IX({settings:e,onSettingsUpdated:t}){var r;let a,s,n,{accessToken:l}=(0,k.default)(),[i,o]=(0,T.useState)(!1),[d,c]=(0,T.useState)(!1),u=(a=l||"",(0,ep.useMutation)({mutationFn:async(e={})=>{if(!a)throw Error("Access token is required");return await IU(a,e)}})),m=(s=l||"",(0,ep.useMutation)({mutationFn:async(e={})=>{if(!s)throw Error("Access token is required");return await IW(s,e)}})),p=(r=l||"",n=(0,eh.useQueryClient)(),(0,ep.useMutation)({mutationFn:async()=>{if(!r)throw Error("Access token is required");return await IR(r)},onSuccess:()=>{n.invalidateQueries({queryKey:II.list({})})}})),h=u.data?JSON.stringify(u.data,null,2):null,f=async()=>{o(!1),t()};return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"space-y-6 w-full max-w-4xl mx-auto",children:(0,_.jsxs)(eg.Card,{title:(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("span",{className:"text-lg font-semibold",children:"CloudZero Configuration"}),(0,_.jsx)(eN.Tag,{color:"success",className:"ml-2 capitalize",children:e.status||"Active"})]}),extra:(0,_.jsxs)("div",{className:"flex gap-2",children:[(0,_.jsx)(z.Button,{icon:(0,_.jsx)(eM,{size:16}),onClick:()=>{o(!0)},className:"flex items-center gap-2",children:"Edit"}),(0,_.jsx)(z.Button,{danger:!0,icon:(0,_.jsx)(eL.Trash2,{size:16}),onClick:()=>{c(!0)},className:"flex items-center gap-2",children:"Delete"})]}),className:"shadow-sm",children:[(0,_.jsxs)(eS.Descriptions,{bordered:!0,column:{xxl:1,xl:1,lg:1,md:1,sm:1,xs:1},children:[(0,_.jsx)(eS.Descriptions.Item,{label:"API Key (Redacted)",children:(0,_.jsx)("span",{className:"font-mono text-gray-600",children:e.api_key_masked||(0,_.jsx)("span",{className:"text-gray-400 italic",children:"Not configured"})})}),(0,_.jsx)(eS.Descriptions.Item,{label:"Connection ID",children:(0,_.jsx)("span",{className:"font-mono text-gray-600",children:e.connection_id||(0,_.jsx)("span",{className:"text-gray-400 italic",children:"Not configured"})})}),(0,_.jsx)(eS.Descriptions.Item,{label:"Timezone",children:e.timezone||(0,_.jsx)("span",{className:"text-gray-400 italic",children:"Default (UTC)"})})]}),(0,_.jsx)(eG.Divider,{orientation:"left",className:"text-gray-500",children:"Actions"}),(0,_.jsxs)("div",{className:"flex flex-wrap gap-4 mb-6",children:[(0,_.jsx)(z.Button,{onClick:()=>{l&&u.mutate({limit:10},{onSuccess:e=>{tU.default.success("Dry run completed successfully")},onError:e=>{tU.default.error(e?.message||"Failed to perform dry run")}})},loading:u.isPending,icon:(0,_.jsx)(IK.Play,{size:16}),className:"flex items-center gap-2",children:"Run Dry Run Simulation"}),(0,_.jsx)(IV.Popconfirm,{title:"Export Data to CloudZero",description:"This will push the current accumulated cost data to CloudZero. Continue?",onConfirm:()=>{l&&m.mutate({operation:"replace_hourly"},{onSuccess:()=>{tU.default.success("Data successfully exported to CloudZero")},onError:e=>{tU.default.error(e?.message||"Failed to export data")}})},okText:"Export",cancelText:"Cancel",children:(0,_.jsx)(z.Button,{type:"primary",loading:m.isPending,icon:(0,_.jsx)(IJ.Upload,{size:16}),className:"flex items-center gap-2",children:"Export Data Now"})})]}),h&&(0,_.jsx)("div",{className:"mt-6 animate-in fade-in slide-in-from-top-4 duration-300",children:(0,_.jsx)(B.Alert,{message:"Dry Run Results",description:(0,_.jsxs)("div",{className:"mt-2",children:[(0,_.jsxs)("p",{className:"mb-2 text-gray-600",children:["Simulation output for connection: ",e.connection_id]}),(0,_.jsx)("pre",{className:"bg-gray-50 p-4 rounded-md border border-gray-200 overflow-x-auto text-xs font-mono text-gray-800",children:h})]}),type:"info",showIcon:!0,icon:(0,_.jsx)(IG,{className:"text-blue-500"})})})]})}),(0,_.jsx)(IQ,{open:i,onOk:f,onCancel:()=>{o(!1)},settings:e}),(0,_.jsx)(eH.default,{isOpen:d,title:"Delete CloudZero Integration?",message:"Are you sure you want to delete this CloudZero integration? All associated settings and configurations will be permanently removed.",resourceInformationTitle:"Integration Details",resourceInformation:[{label:"Connection ID",value:e.connection_id,code:!0},{label:"Timezone",value:e.timezone||"Default (UTC)"}],onCancel:()=>{c(!1)},onOk:()=>{l&&p.mutate(void 0,{onSuccess:()=>{tU.default.success("CloudZero integration deleted successfully"),c(!1),t()},onError:e=>{tU.default.error(e?.message||"Failed to delete CloudZero integration")}})},confirmLoading:p.isPending})]})}function IZ(){let{accessToken:e}=(0,k.default)(),{data:t,isLoading:r,error:a}=(0,ev.useQuery)({queryKey:II.list({}),queryFn:async()=>await IY(e),enabled:!!e,staleTime:36e5,gcTime:36e5}),s=(0,eh.useQueryClient)(),n=(0,ej.createQueryKeys)("cloudZeroSettings"),[l,i]=(0,T.useState)(!1),o=async()=>{i(!1),await s.invalidateQueries({queryKey:n.list({})})};return r?(0,_.jsx)(eg.Card,{children:(0,_.jsx)(V.Typography.Text,{children:"Loading CloudZero settings..."})}):a?(0,_.jsx)(eg.Card,{children:(0,_.jsxs)(V.Typography.Text,{className:"text-red-600",children:["Error loading CloudZero settings: ",a instanceof Error?a.message:String(a)]})}):t?(0,_.jsx)(_.Fragment,{children:(0,_.jsx)(IX,{settings:t,onSettingsUpdated:o})}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(IH,{startCreation:()=>i(!0)}),(0,_.jsx)(Iq,{open:l,onOk:o,onCancel:()=>{i(!1)}})]})}var I0=e.i(335771);let I1=[{value:"success",label:"Success"},{value:"failure",label:"Failure"},{value:"success_and_failure",label:"Success & Failure"}],I2=({callbacks:e,availableCallbacks:t={},onTest:r=()=>{},onEdit:a=()=>{},onDelete:s=()=>{},onAdd:n=()=>{}})=>{let l=[{title:(0,_.jsx)("span",{className:"font-medium text-gray-700",children:"Callback Name"}),dataIndex:"name",key:"name",render:(e,r)=>{let a=r.name;console.log("availableCallbacks",t);let s=t[a]?.ui_callback_name||a;return(0,_.jsx)("div",{className:"font-medium text-gray-800",children:s})}},{title:(0,_.jsx)("span",{className:"font-medium text-gray-700",children:"Mode"}),key:"mode",render:(e,t)=>{let r=t.mode||"success",a=I1.find(e=>e.value===r)?.label||r,s="success"===r?"bg-green-100 text-green-800":"failure"===r?"bg-red-100 text-red-800":"bg-blue-100 text-blue-800";return(0,_.jsx)("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${s}`,children:a})},width:240},{title:(0,_.jsx)("span",{className:"font-medium text-gray-700 text-right w-full block",children:"Actions"}),key:"actions",align:"right",render:(e,t)=>(0,_.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,_.jsx)(rG.default,{variant:"Test",tooltipText:"Test Callback",onClick:()=>r(t)}),(0,_.jsx)(rG.default,{variant:"Edit",tooltipText:"Edit Callback",onClick:()=>a(t)}),(0,_.jsx)(rG.default,{variant:"Delete",tooltipText:"Delete Callback",onClick:()=>s(t)})]}),width:240}];return(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)("div",{className:"w-full mt-4",children:[(0,_.jsx)(S.Button,{onClick:n,className:"mx-auto",children:"+ Add Callback"}),(0,_.jsx)("div",{className:"flex justify-between items-center my-2",children:(0,_.jsx)(I0.default,{level:4,children:"Active Logging Callbacks"})}),0===e.length?(0,_.jsx)("div",{className:"flex flex-col items-center justify-center p-8 bg-gray-50 border border-gray-200 rounded-lg",children:(0,_.jsxs)("div",{className:"text-center",children:[(0,_.jsx)("h3",{className:"text-lg font-medium text-gray-700 mb-2",children:"No callbacks configured"}),(0,_.jsx)("p",{className:"text-gray-500",children:"Add your first callback to start logging data to external services."})]})}):(0,_.jsx)("div",{className:"bg-white border border-gray-200 rounded-lg overflow-hidden",children:(0,_.jsx)(eK.Table,{columns:l,dataSource:e,rowKey:e=>e.name,pagination:!1,rowClassName:()=>"hover:bg-gray-50"})})]})})},{Title:I4,Paragraph:I5}=V.Typography,I6=({params:e,callbackConfigs:t,selectedCallback:r})=>e&&0!==e.length?(0,_.jsx)("div",{className:"space-y-4 mt-6 p-4 bg-gray-50 rounded-lg border",children:e.map(e=>{let a=t.find(e=>e.id===r),s=a?.dynamic_params?.[e]||{},n=s.type||"text",l=s.ui_name||e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),i=s.required||!1;return(0,_.jsx)(IP.default,{label:(0,_.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:[l," "]}),name:e,className:"mb-4",rules:i?[{required:!0,message:`Please enter the ${l.toLowerCase()}`}]:void 0,children:"password"===n?(0,_.jsx)($.Input.Password,{size:"large",placeholder:`Enter your ${l.toLowerCase()}`,className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}):"number"===n?(0,_.jsx)($.Input,{type:"number",size:"large",placeholder:`Enter ${l.toLowerCase()}`,className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",min:0,max:1,step:.1}):(0,_.jsx)($.Input,{size:"large",placeholder:`Enter your ${l.toLowerCase()}`,className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"})},e)})}):null,I3=({callbackConfigs:e,selectedCallback:t,onCallbackChange:r,disabled:a=!1})=>(0,_.jsx)(IP.default,{label:"Callback",name:"callback",rules:a?void 0:[{required:!0,message:"Please select a callback"}],children:(0,_.jsx)(eE.Select,{placeholder:"Choose a logging callback...",size:"large",className:"w-full",showSearch:!0,disabled:a,value:t,filterOption:(e,t)=>(t?.value?.toString()??"").toLowerCase().includes(e.toLowerCase()),onChange:r,children:e.map(e=>{let t=e.logo,r=t&&(t.includes("/")||t.startsWith("data:")||t.startsWith("http"))?t:`../ui/assets/logos/${t}`;return(0,_.jsx)(ju.SelectItem,{value:e.id,children:(0,_.jsxs)("div",{className:"flex items-center space-x-3 py-1",children:[(0,_.jsx)("div",{className:"w-6 h-6 flex items-center justify-center",children:(0,_.jsx)("img",{src:r,alt:`${e.displayName} logo`,className:"w-6 h-6 rounded object-contain",onError:e=>{e.currentTarget.style.display="none"}})}),(0,_.jsx)("span",{className:"font-medium text-gray-900",children:e.displayName})]})},e.id)})})}),I8=(e,t,r)=>{if(!e)return r?Object.keys(r):[];let a=t.find(t=>t.id===e);return a?.dynamic_params?Object.keys(a.dynamic_params):r?Object.keys(r):[]},I7=({accessToken:e,userRole:t,userID:r,premiumUser:a})=>{let[s,n]=(0,T.useState)([]),[l,i]=(0,T.useState)([]),[o,d]=(0,T.useState)(!1),[c]=H.Form.useForm(),[u]=H.Form.useForm(),[m,p]=(0,T.useState)(null),[h,f]=(0,T.useState)(""),[x,g]=(0,T.useState)({}),[y,b]=(0,T.useState)([]),[v,j]=(0,T.useState)(!1),[w,k]=(0,T.useState)([]),[N,M]=(0,T.useState)({}),[C,L]=(0,T.useState)([]),[O,D]=(0,T.useState)(!1),[B,$]=(0,T.useState)(null),[U,W]=(0,T.useState)(!1),[V,G]=(0,T.useState)(null),[K,X]=(0,T.useState)(!1),[er,ea]=(0,T.useState)(!1),[es,en]=(0,T.useState)(!1);(0,T.useEffect)(()=>{e&&(0,Q.getCallbackConfigsCall)(e).then(e=>{k(e||[])}).catch(e=>{J.default.fromBackend("Failed to load callback configs: "+(0,ec.parseErrorMessage)(e))})},[e]),(0,T.useEffect)(()=>{if(O&&B){let e=Object.fromEntries(Object.entries(B.variables||{}).map(([e,t])=>[e,t??""]));u.setFieldsValue({...e,callback:B.name})}},[O,B,u]);let el=e=>{y.includes(e)?b(y.filter(t=>t!==e)):b([...y,e])},ei={llm_exceptions:"LLM Exceptions",llm_too_slow:"LLM Responses Too Slow",llm_requests_hanging:"LLM Requests Hanging",budget_alerts:"Budget Alerts (API Keys, Users)",db_exceptions:"Database Exceptions (Read/Write)",daily_reports:"Weekly/Monthly Spend Reports",outage_alerts:"Outage Alerts",region_outage_alerts:"Region Outage Alerts"};(0,T.useEffect)(()=>{e&&t&&r&&(0,Q.getCallbacksCall)(e,r,t).then(e=>{n(e.callbacks),M(e.available_callbacks);let t=e.alerts;if(t&&t.length>0){let e=t[0],r=e.variables.SLACK_WEBHOOK_URL;b(e.active_alerts),f(r),g(e.alerts_to_webhook)}i(t)})},[e,t,r]);let eo=e=>y&&y.includes(e),ed=async(a,s,l)=>{if(e){l?X(!0):ea(!0);try{if(await (0,Q.setCallbacksCall)(e,{environment_variables:a,litellm_settings:{success_callback:[s]}}),J.default.success(l?"Callback updated successfully":`Callback ${s} added successfully`),l?(D(!1),u.resetFields(),$(null)):(j(!1),c.resetFields(),p(null),L([])),r&&t){let a=await (0,Q.getCallbacksCall)(e,r,t);n(a.callbacks)}}catch(e){J.default.fromBackend(e)}finally{l?X(!1):ea(!1)}}},eu=async e=>{B&&await ed(e,B.name,!0)},em=async e=>{let t=e?.callback;t&&await ed(e,t,!1)},ep=async()=>{if(!e)return;let t={};Object.entries(ei).forEach(([e,r])=>{let a=document.querySelector(`input[name="${e}"]`),s=a?.value||"";t[e]=s});try{await (0,Q.setCallbacksCall)(e,{general_settings:{alert_to_webhook_url:t,alert_types:y}})}catch(e){J.default.fromBackend(e)}J.default.success("Alerts updated successfully")},eh=async()=>{if(V&&e)try{if(en(!0),await (0,Q.deleteCallback)(e,V.name),J.default.success(`Callback ${V.name} deleted successfully`),r&&t){let a=await (0,Q.getCallbacksCall)(e,r,t);n(a.callbacks)}W(!1),G(null)}catch(e){console.error("Failed to delete callback:",e),J.default.fromBackend(e)}finally{en(!1)}};return e?(0,_.jsxs)("div",{className:"w-full mx-4",children:[(0,_.jsx)(ee.Grid,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)(rR.TabList,{variant:"line",defaultValue:"1",children:[(0,_.jsx)(rY.Tab,{value:"1",children:"Logging Callbacks"}),(0,_.jsx)(rY.Tab,{value:"2",children:"CloudZero Cost Tracking"}),(0,_.jsx)(rY.Tab,{value:"2",children:"Alerting Types"}),(0,_.jsx)(rY.Tab,{value:"3",children:"Alerting Settings"}),(0,_.jsx)(rY.Tab,{value:"4",children:"Email Alerts"})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(I2,{callbacks:s,availableCallbacks:N,onAdd:()=>j(!0),onEdit:e=>{$(e),D(!0)},onDelete:e=>{G(e),W(!0)},onTest:async t=>{try{await (0,Q.serviceHealthCheck)(e,t.name),J.default.success("Health check triggered")}catch(e){J.default.fromBackend((0,ec.parseErrorMessage)(e))}}})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)("div",{className:"p-8",children:(0,_.jsx)(IZ,{})})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)(Z.Text,{className:"my-2",children:["Alerts are only supported for Slack Webhook URLs. Get your webhook urls from"," ",(0,_.jsx)("a",{href:"https://api.slack.com/messaging/webhooks",target:"_blank",style:{color:"blue"},children:"here"})]}),(0,_.jsxs)(A.Table,{children:[(0,_.jsx)(Y.TableHead,{children:(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(F.TableHeaderCell,{}),(0,_.jsx)(F.TableHeaderCell,{}),(0,_.jsx)(F.TableHeaderCell,{children:"Slack Webhook URL"})]})}),(0,_.jsx)(E.TableBody,{children:Object.entries(ei).map(([e,t],r)=>(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(I.TableCell,{children:"region_outage_alerts"==e?a?(0,_.jsx)(wL.Switch,{id:"switch",name:"switch",checked:eo(e),onChange:()=>el(e)}):(0,_.jsx)(S.Button,{className:"flex items-center justify-center",children:(0,_.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Enterprise Feature"})}):(0,_.jsx)(wL.Switch,{id:"switch",name:"switch",checked:eo(e),onChange:()=>el(e)})}),(0,_.jsx)(I.TableCell,{children:(0,_.jsx)(Z.Text,{children:t})}),(0,_.jsx)(I.TableCell,{children:(0,_.jsx)(et.TextInput,{name:e,type:"password",defaultValue:x&&x[e]?x[e]:h})})]},r))})]}),(0,_.jsx)(S.Button,{size:"xs",className:"mt-2",onClick:ep,children:"Save Changes"}),(0,_.jsx)(S.Button,{onClick:async()=>{try{await (0,Q.serviceHealthCheck)(e,"slack"),J.default.success("Alert test triggered. Test request to slack made - check logs/alerts on slack to verify")}catch(e){J.default.fromBackend((0,ec.parseErrorMessage)(e))}},className:"mx-2",children:"Test Alerts"})]})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(IE,{accessToken:e,premiumUser:a})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(ID,{accessToken:e,premiumUser:a,alerts:l})})]})]})}),(0,_.jsxs)(q.Modal,{title:"Add Logging Callback",open:v,width:800,onCancel:()=>{j(!1),p(null),L([])},footer:null,children:[(0,_.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/logging",className:"mb-8 mt-4",target:"_blank",style:{color:"blue"},children:[" ","LiteLLM Docs: Logging"]}),(0,_.jsxs)(H.Form,{form:c,onFinish:em,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,_.jsx)(I3,{callbackConfigs:w,selectedCallback:m,onCallbackChange:e=>{p(e),L(I8(e,w))}}),(0,_.jsx)(I6,{params:C,callbackConfigs:w,selectedCallback:m}),(0,_.jsxs)("div",{className:"flex justify-end space-x-3 pt-6 mt-6 border-t border-gray-200",children:[(0,_.jsx)(z.Button,{onClick:()=>{j(!1),p(null),L([]),c.resetFields()},disabled:er,children:"Cancel"}),(0,_.jsx)(z.Button,{htmlType:"submit",loading:er,disabled:er,children:er?"Adding...":"Add Callback"})]})]})]}),(0,_.jsx)(q.Modal,{open:O,width:800,title:"Edit Callback Settings",onCancel:()=>{D(!1),$(null),u.resetFields()},footer:null,children:(0,_.jsxs)(H.Form,{form:u,onFinish:eu,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[B&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(I3,{callbackConfigs:w,selectedCallback:B.name,onCallbackChange:()=>{},disabled:!0}),(0,_.jsx)(I6,{params:I8(B.name,w,B.variables),callbackConfigs:w,selectedCallback:B.name})]}),(0,_.jsxs)("div",{className:"flex justify-end space-x-3 pt-6 mt-6 border-t border-gray-200",children:[(0,_.jsx)(z.Button,{onClick:()=>{D(!1),$(null),u.resetFields()},disabled:K,children:"Cancel"}),(0,_.jsx)(z.Button,{onClick:()=>{u.submit()},loading:K,disabled:K,children:K?"Saving...":"Save Changes"})]})]})}),(0,_.jsx)(eH.default,{isOpen:U,title:"Delete Callback",message:"Are you sure you want to delete this callback? This action cannot be undone.",resourceInformationTitle:"Callback Information",resourceInformation:[{label:"Callback Name",value:V?.name},{label:"Mode",value:V?.mode||"success"}],onCancel:()=>{W(!1),G(null)},onOk:eh,confirmLoading:es})]}):null};var I9=e.i(686311),Ye=e.i(37727),Yt=e.i(643531),Yr=e.i(636772),Ya=e.i(115571);function Ys({onOpen:e,onDismiss:t,isVisible:r,title:a,description:s,buttonText:n,icon:l,accentColor:i,buttonStyle:o}){let d=(0,Yr.useDisableShowPrompts)(),[c,u]=(0,T.useState)(100),[m,p]=(0,T.useState)(!1);return((0,T.useEffect)(()=>{if(!r){u(100),p(!1);return}let e=Date.now(),t=setInterval(()=>{let r=Math.max(0,100-(Date.now()-e)/15e3*100);u(r),r<=0&&clearInterval(t)},50);return()=>clearInterval(t)},[r]),(0,T.useEffect)(()=>{if(m){let e=setTimeout(()=>{p(!1),t()},5e3);return()=>clearTimeout(e)}},[m,t]),m)?(0,_.jsx)("div",{className:`fixed bottom-6 right-6 z-40 w-80 bg-white rounded-lg shadow-xl border border-gray-200 overflow-hidden transform transition-all duration-300 ease-out ${r?"translate-y-0 opacity-100 scale-100":"translate-y-4 opacity-0 scale-95"}`,children:(0,_.jsx)("div",{className:"p-4",children:(0,_.jsxs)("div",{className:"flex items-center gap-3",children:[(0,_.jsx)("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-green-100 flex items-center justify-center",children:(0,_.jsx)(Yt.Check,{className:"h-5 w-5 text-green-600"})}),(0,_.jsx)("div",{className:"flex-1",children:(0,_.jsx)("p",{className:"text-sm text-gray-700 font-medium",children:"Got it, we will not ask again. Reactivate this at any time in the User Menu."})})]})})}):!r||d?null:(0,_.jsxs)("div",{className:`fixed bottom-6 right-6 z-40 w-80 bg-white rounded-lg shadow-xl border border-gray-200 overflow-hidden transform transition-all duration-300 ease-out ${r?"translate-y-0 opacity-100 scale-100":"translate-y-4 opacity-0 scale-95"}`,children:[(0,_.jsx)("div",{className:"h-1 bg-gray-100 w-full",children:(0,_.jsx)("div",{className:"h-full transition-all duration-100 ease-linear",style:{width:`${c}%`,backgroundColor:i}})}),(0,_.jsxs)("div",{className:"p-4",children:[(0,_.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",style:{color:i},children:[(0,_.jsx)(l,{className:"h-5 w-5"}),(0,_.jsx)("span",{className:"font-semibold text-sm",children:a})]}),(0,_.jsx)("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 transition-colors p-0.5 rounded hover:bg-gray-100",children:(0,_.jsx)(Ye.X,{className:"h-4 w-4"})})]}),(0,_.jsx)("p",{className:"text-sm text-gray-600 mb-3",children:s}),(0,_.jsxs)("div",{className:"space-y-2",children:[(0,_.jsx)(z.Button,{type:"primary",block:!0,onClick:e,style:o,children:n}),(0,_.jsx)(z.Button,{variant:"outlined",danger:!0,block:!0,onClick:()=>{(0,Ya.setLocalStorageItem)("disableShowPrompts","true"),(0,Ya.emitLocalStorageChange)("disableShowPrompts"),p(!0)},className:"text-xs",children:"Don't ask me again"})]})]})]})}function Yn({onOpen:e,onDismiss:t,isVisible:r}){return(0,_.jsx)(Ys,{onOpen:e,onDismiss:t,isVisible:r,title:"Quick feedback",description:"Help us improve LiteLLM! Share your experience in 5 quick questions.",buttonText:"Share feedback",icon:I9.MessageSquare,accentColor:"#3b82f6"})}var PG=PG;let Yl=[{id:"oss_adoption",label:"OSS Adoption",description:"Stars, contributors, forks, community support"},{id:"ai_integration",label:"AI Integration",description:"LiteLLM had the logging/guardrail integration we needed - Langfuse, OTEL, S3 logging, Azure Content Safety guardrails"},{id:"unified_api",label:"Unified API",description:"LiteLLM had the best OpenAI-compatible API across providers - OpenAI, Anthropic, Gemini, etc."},{id:"breadth_of_models",label:"Breadth of Models/Providers",description:"LiteLLM had the provider + endpoint combinations we needed - /ocr endpoint with Mistral OCR, /batches endppint with Bedrock API, etc."},{id:"other",label:"Other",description:"Something else not listed above"}];function Yi({isOpen:e,onClose:t,onComplete:r}){let[a,s]=(0,T.useState)(1),[n,l]=(0,T.useState)({usingAtCompany:null,companyName:"",startDate:"",reasons:[],otherReason:"",email:""}),[i,o]=(0,T.useState)(!1),d=!0===n.usingAtCompany?5:4;if(!e)return null;let c=async()=>{o(!0);try{let e={oss_adoption:"OSS Adoption (stars, contributors, forks)",ai_integration:"AI Integration (Langfuse, OTEL, S3, Azure Content Safety)",unified_api:"Unified API (OpenAI-compatible)",breadth_of_models:"Breadth of Models/Providers (/ocr, /batches, Bedrock, Azure OCR)"},t=n.reasons.map(t=>"other"===t&&n.otherReason?`Other: ${n.otherReason}`:e[t]||t),r=new URLSearchParams({"entry.2015264290":n.usingAtCompany?"Yes":"No","entry.1876243786":n.companyName||"","entry.1282591459":n.startDate,"entry.393456108":t.join(", "),"entry.928142208":n.email||""});await fetch("https://feedback.litellm.ai/survey",{method:"POST",mode:"no-cors",body:r})}catch(e){console.error("Failed to submit survey:",e)}o(!1),r()},u=(e,t)=>{l(r=>({...r,[e]:t}))},m=e=>{l(t=>({...t,reasons:t.reasons.includes(e)?t.reasons.filter(t=>t!==e):[...t.reasons,e]}))},p=()=>{if(!1===n.usingAtCompany){if(1===a)return 1;if(3===a)return 2;if(4===a)return 3;if(5===a)return 4}return a},h=5===a;return(0,_.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6",children:[(0,_.jsx)("div",{className:"fixed inset-0 bg-black/40 backdrop-blur-sm",onClick:t}),(0,_.jsxs)("div",{className:"relative w-full max-w-lg bg-white rounded-xl shadow-2xl overflow-hidden flex flex-col max-h-[90vh] transform transition-all duration-300 ease-out",children:[(0,_.jsxs)("div",{className:"px-6 py-4 border-b border-gray-100 flex items-center justify-between bg-gray-50/50",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2 text-blue-600",children:[(0,_.jsx)(I9.MessageSquare,{className:"h-5 w-5"}),(0,_.jsx)("span",{className:"font-semibold text-sm tracking-wide uppercase",children:"Quick Feedback"})]}),(0,_.jsx)("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 transition-colors p-1 rounded-full hover:bg-gray-100",children:(0,_.jsx)(Ye.X,{className:"h-5 w-5"})})]}),(0,_.jsx)(PG.default,{percent:p()/d*100,showInfo:!1,strokeColor:"#2563eb",className:"m-0"}),(0,_.jsx)("div",{className:"p-8 flex-1 overflow-y-auto",children:1===a?(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Are you using LiteLLM at your company?"}),(0,_.jsx)("p",{className:"text-gray-500",children:"Help us understand how our product is being used in professional environments."}),(0,_.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 pt-4",children:[(0,_.jsxs)("button",{onClick:()=>u("usingAtCompany",!0),className:`p-6 rounded-lg border-2 text-left transition-all ${!0===n.usingAtCompany?"border-blue-600 bg-blue-50 ring-1 ring-blue-600":"border-gray-200 hover:border-blue-300 hover:bg-gray-50"}`,children:[(0,_.jsx)("span",{className:"block text-lg font-semibold text-gray-900 mb-1",children:"Yes"}),(0,_.jsx)("span",{className:"text-sm text-gray-500",children:"We use it for work"})]}),(0,_.jsxs)("button",{onClick:()=>u("usingAtCompany",!1),className:`p-6 rounded-lg border-2 text-left transition-all ${!1===n.usingAtCompany?"border-blue-600 bg-blue-50 ring-1 ring-blue-600":"border-gray-200 hover:border-blue-300 hover:bg-gray-50"}`,children:[(0,_.jsx)("span",{className:"block text-lg font-semibold text-gray-900 mb-1",children:"No"}),(0,_.jsx)("span",{className:"text-sm text-gray-500",children:"Personal project / Hobby"})]})]})]}):2===a&&!0===n.usingAtCompany?(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"What company are you using LiteLLM at?"}),(0,_.jsx)("p",{className:"text-gray-500",children:"This helps us understand our user base better."}),(0,_.jsx)($.Input,{size:"large",placeholder:"Enter your company name",value:n.companyName,onChange:e=>u("companyName",e.target.value),autoFocus:!0})]}):3===a?(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"When did you start using LiteLLM?"}),(0,_.jsx)(t$.Radio.Group,{value:n.startDate,onChange:e=>u("startDate",e.target.value),className:"w-full",children:(0,_.jsx)(U.Space,{direction:"vertical",className:"w-full",children:["Less than a month ago","1-3 months ago","3-6 months ago","More than 6 months ago"].map(e=>(0,_.jsx)("label",{className:`flex items-center p-4 rounded-lg border cursor-pointer transition-all w-full ${n.startDate===e?"border-blue-600 bg-blue-50 ring-1 ring-blue-600":"border-gray-200 hover:bg-gray-50"}`,children:(0,_.jsx)(t$.Radio,{value:e,children:e})},e))})})]}):4===a?(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Why did you pick LiteLLM over other AI Gateways?"}),(0,_.jsx)("p",{className:"text-gray-500",children:"Select all that apply."}),(0,_.jsx)("div",{className:"space-y-3",children:Yl.map(e=>{let t=n.reasons.includes(e.id);return(0,_.jsxs)("div",{children:[(0,_.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>m(e.id),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),m(e.id))},className:`flex items-start p-4 rounded-lg border cursor-pointer transition-all ${t?"border-blue-600 bg-blue-50 ring-1 ring-blue-600":"border-gray-200 hover:bg-gray-50"}`,children:[(0,_.jsx)(eA.Checkbox,{checked:t,className:"mt-0.5 pointer-events-none"}),(0,_.jsxs)("div",{className:"ml-3",children:[(0,_.jsx)("span",{className:"block font-medium text-gray-900",children:e.label}),(0,_.jsx)("span",{className:"text-sm text-gray-500",children:e.description})]})]}),"other"===e.id&&t&&(0,_.jsx)($.Input,{className:"mt-2 ml-7",placeholder:"Please specify...",value:n.otherReason,onChange:e=>u("otherReason",e.target.value),onClick:e=>e.stopPropagation(),autoFocus:!0})]},e.id)})})]}):5===a?(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Want to share more?"}),(0,_.jsx)("p",{className:"text-gray-500",children:"Leave your email and we may reach out to learn more about your experience. This is completely optional."}),(0,_.jsx)($.Input,{size:"large",type:"email",placeholder:"your@email.com (optional)",value:n.email,onChange:e=>u("email",e.target.value),autoFocus:!0}),(0,_.jsx)("p",{className:"text-xs text-gray-400",children:"We will only use this to follow up on your feedback. No spam, ever."})]}):null}),(0,_.jsxs)("div",{className:"px-6 py-4 bg-gray-50 border-t border-gray-200 flex items-center justify-between",children:[(0,_.jsxs)("div",{className:"text-sm text-gray-500 font-medium",children:["Step ",p()," of ",d]}),(0,_.jsxs)("div",{className:"flex gap-3",children:[a>1&&(0,_.jsx)(z.Button,{onClick:()=>{3===a&&!1===n.usingAtCompany?s(1):s(a-1)},disabled:i,icon:(0,_.jsx)(EQ,{className:"h-4 w-4"}),children:"Back"}),(0,_.jsxs)(z.Button,{type:"primary",onClick:()=>{1===a&&!1===n.usingAtCompany?s(3):a<5?s(a+1):c()},disabled:!(1===a?null!==n.usingAtCompany:2===a?n.companyName.trim().length>0:3===a?""!==n.startDate:4===a?n.reasons.includes("other")?n.reasons.length>0&&n.otherReason.trim().length>0:n.reasons.length>0:5===a)||i,loading:i,className:"min-w-[100px]",children:[h?"Submit":"Next",!h&&(0,_.jsx)(wF,{className:"ml-2 h-4 w-4"})]})]})]})]})]})}function Yo({onOpen:e,onDismiss:t,isVisible:r}){return(0,_.jsx)(Ys,{onOpen:e,onDismiss:t,isVisible:r,title:"Claude Code Feedback",description:"Help us improve your Claude Code experience with LiteLLM! Share your feedback in 4 quick questions.",buttonText:"Share feedback",icon:Ow,accentColor:"#7c3aed",buttonStyle:{backgroundColor:"#7c3aed",borderColor:"#7c3aed"}})}function Yd({isOpen:e,onClose:t,onComplete:r}){return e?(0,_.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6",children:[(0,_.jsx)("div",{className:"fixed inset-0 bg-black/40 backdrop-blur-sm",onClick:t}),(0,_.jsxs)("div",{className:"relative w-full max-w-md bg-white rounded-xl shadow-2xl overflow-hidden transform transition-all duration-300 ease-out",children:[(0,_.jsxs)("div",{className:"px-6 py-4 border-b border-gray-100 flex items-center justify-between bg-gray-50/50",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2 text-purple-600",children:[(0,_.jsx)(Ow,{className:"h-5 w-5"}),(0,_.jsx)("span",{className:"font-semibold text-sm tracking-wide uppercase",children:"Claude Code Feedback"})]}),(0,_.jsx)("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 transition-colors p-1 rounded-full hover:bg-gray-100",children:(0,_.jsx)(Ye.X,{className:"h-5 w-5"})})]}),(0,_.jsxs)("div",{className:"p-8",children:[(0,_.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Help us improve your experience"}),(0,_.jsx)("p",{className:"text-gray-600 mb-6",children:"We'd love to hear about your experience using LiteLLM with Claude Code. Your feedback helps us improve the product for everyone."}),(0,_.jsx)("p",{className:"text-sm text-gray-500 mb-6",children:"This brief survey takes about 2-3 minutes to complete."}),(0,_.jsx)(z.Button,{type:"primary",size:"large",block:!0,onClick:()=>{window.open("https://forms.gle/LZeJQ3XytBakckYa9","_blank","noopener,noreferrer"),r()},icon:(0,_.jsx)(ww.ExternalLink,{className:"h-4 w-4"}),style:{backgroundColor:"#7c3aed",borderColor:"#7c3aed"},children:"Open Feedback Form"})]})]})]}):null}let Yc=({tagId:e,onClose:t,accessToken:r,is_admin:a,editTag:s})=>{let[n]=H.Form.useForm(),[l,i]=(0,T.useState)(null),[o,d]=(0,T.useState)(s),[c,u]=(0,T.useState)([]),[m,p]=(0,T.useState)({}),h=async(e,t)=>{await (0,rV.copyToClipboard)(e)&&(p(e=>({...e,[t]:!0})),setTimeout(()=>{p(e=>({...e,[t]:!1}))},2e3))},f=async()=>{if(r)try{let t=(await (0,Q.tagInfoCall)(r,[e]))[e];t&&(i(t),s&&n.setFieldsValue({name:t.name,description:t.description,models:t.models,max_budget:t.litellm_budget_table?.max_budget,budget_duration:t.litellm_budget_table?.budget_duration}))}catch(e){console.error("Error fetching tag details:",e),J.default.fromBackend("Error fetching tag details: "+e)}};(0,T.useEffect)(()=>{f()},[e,r]),(0,T.useEffect)(()=>{r&&(0,EP.fetchUserModels)("dummy-user","Admin",r,u)},[r]);let x=async e=>{if(r)try{await (0,Q.tagUpdateCall)(r,{name:e.name,description:e.description,models:e.models,max_budget:e.max_budget,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit,budget_duration:e.budget_duration}),J.default.success("Tag updated successfully"),d(!1),f()}catch(e){console.error("Error updating tag:",e),J.default.fromBackend("Error updating tag: "+e)}};return l?(0,_.jsxs)("div",{className:"p-4",children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(S.Button,{onClick:t,className:"mb-4",children:"← Back to Tags"}),(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Tag Name:"}),(0,_.jsx)("span",{className:"font-mono px-2 py-1 bg-gray-100 rounded text-sm border border-gray-200",children:l.name}),(0,_.jsx)(z.Button,{type:"text",size:"small",icon:m["tag-name"]?(0,_.jsx)(M_.CheckIcon,{size:12}):(0,_.jsx)(Mb.CopyIcon,{size:12}),onClick:()=>h(l.name,"tag-name"),className:`transition-all duration-200 ${m["tag-name"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`})]}),(0,_.jsx)(Z.Text,{className:"text-gray-500",children:l.description||"No description"})]}),a&&!o&&(0,_.jsx)(S.Button,{onClick:()=>d(!0),children:"Edit Tag"})]}),o?(0,_.jsx)(P.Card,{children:(0,_.jsxs)(H.Form,{form:n,onFinish:x,layout:"vertical",initialValues:l,children:[(0,_.jsx)(H.Form.Item,{label:"Tag Name",name:"name",rules:[{required:!0,message:"Please input a tag name"}],children:(0,_.jsx)($.Input,{className:"rounded-md border-gray-300"})}),(0,_.jsx)(H.Form.Item,{label:"Description",name:"description",children:(0,_.jsx)($.Input.TextArea,{rows:4})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Allowed Models",(0,_.jsx)(tB.Tooltip,{title:"Select which models are allowed to process this type of data",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,_.jsx)(eE.Select,{mode:"multiple",placeholder:"Select Models",children:c.map(e=>(0,_.jsx)(eE.Select.Option,{value:e,children:(0,tQ.getModelDisplayName)(e)},e))})}),(0,_.jsxs)(rX.Accordion,{className:"mt-4 mb-4",children:[(0,_.jsx)(rZ.AccordionHeader,{children:(0,_.jsx)(X.Title,{className:"m-0",children:"Budget & Rate Limits"})}),(0,_.jsxs)(r0.AccordionBody,{children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Max Budget (USD)"," ",(0,_.jsx)(tB.Tooltip,{title:"Maximum amount in USD this tag can spend",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"max_budget",children:(0,_.jsx)(jf.default,{step:.01,precision:2,width:200})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Reset Budget"," ",(0,_.jsx)(tB.Tooltip,{title:"How often the budget should reset",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"budget_duration",children:(0,_.jsx)(En.default,{onChange:e=>n.setFieldValue("budget_duration",e)})}),(0,_.jsx)("div",{className:"mt-4 p-3 bg-gray-50 rounded-md border border-gray-200",children:(0,_.jsxs)("p",{className:"text-sm text-gray-600",children:["TPM/RPM limits for tags are not currently supported. If you need this feature, please"," ",(0,_.jsx)("a",{href:"https://github.com/BerriAI/litellm/issues/new",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline",children:"create a GitHub issue"}),"."]})})]})]}),(0,_.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,_.jsx)(S.Button,{onClick:()=>d(!1),children:"Cancel"}),(0,_.jsx)(S.Button,{type:"submit",children:"Save Changes"})]})]})}):(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Tag Details"}),(0,_.jsxs)("div",{className:"space-y-4 mt-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Name"}),(0,_.jsx)(Z.Text,{children:l.name})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Description"}),(0,_.jsx)(Z.Text,{children:l.description||"-"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Allowed Models"}),(0,_.jsx)("div",{className:"flex flex-wrap gap-2 mt-2",children:l.models&&0!==l.models.length?l.models.map(e=>(0,_.jsx)(tR.Badge,{color:"blue",children:(0,_.jsx)(tB.Tooltip,{title:`ID: ${e}`,children:l.model_info?.[e]||e})},e)):(0,_.jsx)(tR.Badge,{color:"red",children:"All Models"})})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Created"}),(0,_.jsx)(Z.Text,{children:l.created_at?new Date(l.created_at).toLocaleString():"-"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Last Updated"}),(0,_.jsx)(Z.Text,{children:l.updated_at?new Date(l.updated_at).toLocaleString():"-"})]})]})]}),l.litellm_budget_table&&(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Budget & Rate Limits"}),(0,_.jsxs)("div",{className:"space-y-4 mt-4",children:[void 0!==l.litellm_budget_table.max_budget&&null!==l.litellm_budget_table.max_budget&&(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Max Budget"}),(0,_.jsxs)(Z.Text,{children:["$",l.litellm_budget_table.max_budget]})]}),l.litellm_budget_table.budget_duration&&(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Budget Duration"}),(0,_.jsx)(Z.Text,{children:l.litellm_budget_table.budget_duration})]}),void 0!==l.litellm_budget_table.tpm_limit&&null!==l.litellm_budget_table.tpm_limit&&(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"TPM Limit"}),(0,_.jsx)(Z.Text,{children:l.litellm_budget_table.tpm_limit.toLocaleString()})]}),void 0!==l.litellm_budget_table.rpm_limit&&null!==l.litellm_budget_table.rpm_limit&&(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"RPM Limit"}),(0,_.jsx)(Z.Text,{children:l.litellm_budget_table.rpm_limit.toLocaleString()})]})]})]})]})]}):(0,_.jsx)("div",{children:"Loading..."})},Yu="This is just a spend tag that was passed dynamically in a request. It does not control any LLM models.",Ym=({data:e,onEdit:t,onDelete:r,onSelectTag:a})=>{let[s,n]=T.default.useState([{id:"created_at",desc:!0}]),l=[{header:"Tag Name",accessorKey:"name",cell:({row:e})=>{let t=e.original,r=t.description===Yu;return(0,_.jsx)("div",{className:"overflow-hidden",children:(0,_.jsx)(tB.Tooltip,{title:r?"You cannot view the information of a dynamically generated spend tag":t.name,children:(0,_.jsx)(S.Button,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5",onClick:()=>a(t.name),disabled:r,children:t.name})})})}},{header:"Description",accessorKey:"description",cell:({row:e})=>{let t=e.original;return(0,_.jsx)(tB.Tooltip,{title:t.description,children:(0,_.jsx)("span",{className:"text-xs",children:t.description||"-"})})}},{header:"Allowed Models",accessorKey:"models",cell:({row:e})=>{let t=e.original;return(0,_.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:t?.models?.length===0?(0,_.jsx)(tR.Badge,{size:"xs",className:"mb-1",color:"red",children:"All Models"}):t?.models?.map(e=>(0,_.jsx)(tR.Badge,{size:"xs",className:"mb-1",color:"blue",children:(0,_.jsx)(tB.Tooltip,{title:`ID: ${e}`,children:(0,_.jsx)(Z.Text,{children:t.model_info?.[e]||e})})},e))})}},{header:"Created",accessorKey:"created_at",sortingFn:"datetime",cell:({row:e})=>{let t=e.original;return(0,_.jsx)("span",{className:"text-xs",children:new Date(t.created_at).toLocaleDateString()})}},{id:"actions",header:"Actions",cell:({row:e})=>{let a=e.original,s=a.description===Yu;return(0,_.jsxs)("div",{className:"flex space-x-2",children:[s?(0,_.jsx)(tB.Tooltip,{title:"Dynamically generated spend tags cannot be edited",children:(0,_.jsx)(yi.Icon,{icon:jR.PencilAltIcon,size:"sm",className:"opacity-50 cursor-not-allowed","aria-label":"Edit tag (disabled)"})}):(0,_.jsx)(tB.Tooltip,{title:"Edit tag",children:(0,_.jsx)(yi.Icon,{icon:jR.PencilAltIcon,size:"sm",onClick:()=>t(a),className:"cursor-pointer hover:text-blue-500"})}),s?(0,_.jsx)(tB.Tooltip,{title:"Dynamically generated spend tags cannot be deleted",children:(0,_.jsx)(yi.Icon,{icon:jO.TrashIcon,size:"sm",className:"opacity-50 cursor-not-allowed","aria-label":"Delete tag (disabled)"})}):(0,_.jsx)(tB.Tooltip,{title:"Delete tag",children:(0,_.jsx)(yi.Icon,{icon:jO.TrashIcon,size:"sm",onClick:()=>r(a.name),className:"cursor-pointer hover:text-red-500"})})]})}}],i=(0,jD.useReactTable)({data:e,columns:l,state:{sorting:s},onSortingChange:n,getCoreRowModel:(0,jP.getCoreRowModel)(),getSortedRowModel:(0,jP.getSortedRowModel)(),enableSorting:!0});return(0,_.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,_.jsx)("div",{className:"overflow-x-auto",children:(0,_.jsxs)(A.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,_.jsx)(Y.TableHead,{children:i.getHeaderGroups().map(e=>(0,_.jsx)(R.TableRow,{children:e.headers.map(e=>(0,_.jsx)(F.TableHeaderCell,{className:`py-1 h-8 ${"actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""}`,onClick:e.column.getToggleSortingHandler(),children:(0,_.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,_.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,jD.flexRender)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,_.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,_.jsx)(jC.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,_.jsx)(jM.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,_.jsx)(jL.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,_.jsx)(E.TableBody,{children:i.getRowModel().rows.length>0?i.getRowModel().rows.map(e=>(0,_.jsx)(R.TableRow,{className:"h-8",children:e.getVisibleCells().map(e=>(0,_.jsx)(I.TableCell,{className:`py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ${"actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""}`,children:(0,jD.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:l.length,className:"h-8 text-center",children:(0,_.jsx)("div",{className:"text-center text-gray-500",children:(0,_.jsx)("p",{children:"No tags found"})})})})})]})})})},Yp=({visible:e,onCancel:t,onSubmit:r,availableModels:a})=>{let[s]=H.Form.useForm();return(0,_.jsx)(q.Modal,{title:"Create New Tag",open:e,width:800,footer:null,onCancel:()=>{s.resetFields(),t()},children:(0,_.jsxs)(H.Form,{form:s,onFinish:e=>{r(e),s.resetFields()},labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,_.jsx)(H.Form.Item,{label:"Tag Name",name:"tag_name",rules:[{required:!0,message:"Please input a tag name"}],children:(0,_.jsx)(et.TextInput,{})}),(0,_.jsx)(H.Form.Item,{label:"Description",name:"description",children:(0,_.jsx)($.Input.TextArea,{rows:4})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Allowed Models",(0,_.jsx)(tB.Tooltip,{title:"Select which models are allowed to process requests from this tag",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"allowed_llms",children:(0,_.jsx)(eE.Select,{mode:"multiple",placeholder:"Select Models",children:a.map(e=>(0,_.jsx)(eE.Select.Option,{value:e.model_info.id,children:(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:e.model_name}),(0,_.jsxs)("span",{className:"text-gray-400 ml-2",children:["(",e.model_info.id,")"]})]})},e.model_info.id))})}),(0,_.jsxs)(rX.Accordion,{className:"mt-4 mb-4",children:[(0,_.jsx)(rZ.AccordionHeader,{children:(0,_.jsx)(X.Title,{className:"m-0",children:"Budget & Rate Limits (Optional)"})}),(0,_.jsxs)(r0.AccordionBody,{children:[(0,_.jsx)(H.Form.Item,{className:"mt-4",label:(0,_.jsxs)("span",{children:["Max Budget (USD)"," ",(0,_.jsx)(tB.Tooltip,{title:"Maximum amount in USD this tag can spend. When reached, requests with this tag will be blocked",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"max_budget",children:(0,_.jsx)(jf.default,{step:.01,precision:2,width:200})}),(0,_.jsx)(H.Form.Item,{className:"mt-4",label:(0,_.jsxs)("span",{children:["Reset Budget"," ",(0,_.jsx)(tB.Tooltip,{title:"How often the budget should reset. For example, setting 'daily' will reset the budget every 24 hours",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"budget_duration",children:(0,_.jsx)(En.default,{onChange:e=>s.setFieldValue("budget_duration",e)})}),(0,_.jsx)("div",{className:"mt-4 p-3 bg-gray-50 rounded-md border border-gray-200",children:(0,_.jsxs)("p",{className:"text-sm text-gray-600",children:["TPM/RPM limits for tags are not currently supported. If you need this feature, please"," ",(0,_.jsx)("a",{href:"https://github.com/BerriAI/litellm/issues/new",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline",children:"create a GitHub issue"}),"."]})})]})]}),(0,_.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,_.jsx)(S.Button,{type:"submit",children:"Create Tag"})})]})})},Yh=({accessToken:e,userID:t,userRole:r})=>{let[a,s]=(0,T.useState)([]),[n,l]=(0,T.useState)(!1),[i,o]=(0,T.useState)(null),[d,c]=(0,T.useState)(!1),[u,m]=(0,T.useState)(!1),[p,h]=(0,T.useState)(null),[f,x]=(0,T.useState)(""),[g,y]=(0,T.useState)([]),b=async()=>{if(e)try{let t=await (0,Q.tagListCall)(e);console.log("List tags response:",t),s(Object.values(t))}catch(e){console.error("Error fetching tags:",e),J.default.fromBackend("Error fetching tags: "+e)}},v=async t=>{if(e)try{await (0,Q.tagCreateCall)(e,{name:t.tag_name,description:t.description,models:t.allowed_llms,max_budget:t.max_budget,soft_budget:t.soft_budget,tpm_limit:t.tpm_limit,rpm_limit:t.rpm_limit,budget_duration:t.budget_duration}),J.default.success("Tag created successfully"),l(!1),b()}catch(e){console.error("Error creating tag:",e),J.default.fromBackend("Error creating tag: "+e)}},j=async e=>{h(e),m(!0)},w=async()=>{if(e&&p){try{await (0,Q.tagDeleteCall)(e,p),J.default.success("Tag deleted successfully"),b()}catch(e){console.error("Error deleting tag:",e),J.default.fromBackend("Error deleting tag: "+e)}m(!1),h(null)}};return(0,T.useEffect)(()=>{t&&r&&e&&(async()=>{try{let a=await (0,Q.modelInfoCall)(e,t,r);a&&a.data&&y(a.data)}catch(e){console.error("Error fetching models:",e),J.default.fromBackend("Error fetching models: "+e)}})()},[e,t,r]),(0,T.useEffect)(()=>{b()},[e]),(0,_.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:i?(0,_.jsx)(Yc,{tagId:i,onClose:()=>{o(null),c(!1)},accessToken:e,is_admin:"Admin"===r,editTag:d}):(0,_.jsxs)("div",{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,_.jsxs)("div",{className:"flex justify-between mt-2 w-full items-center mb-4",children:[(0,_.jsx)("h1",{children:"Tag Management"}),(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[f&&(0,_.jsxs)(Z.Text,{children:["Last Refreshed: ",f]}),(0,_.jsx)(yi.Icon,{icon:jt.RefreshIcon,variant:"shadow",size:"xs",className:"self-center cursor-pointer",onClick:()=>{b(),x(new Date().toLocaleString())}})]})]}),(0,_.jsxs)(Z.Text,{className:"mb-4",children:["Click on a tag name to view and edit its details.",(0,_.jsxs)("p",{children:["You can use tags to restrict the usage of certain LLMs based on tags passed in the request. Read more about tag routing"," ",(0,_.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/tag_routing",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})]}),(0,_.jsx)(S.Button,{className:"mb-4",onClick:()=>l(!0),children:"+ Create New Tag"}),(0,_.jsx)(ee.Grid,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsx)(Ym,{data:a,onEdit:e=>{o(e.name),c(!0)},onDelete:j,onSelectTag:o})})}),(0,_.jsx)(Yp,{visible:n,onCancel:()=>l(!1),onSubmit:v,availableModels:g}),u&&(0,_.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,_.jsxs)("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[(0,_.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,_.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,_.jsxs)("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full",children:[(0,_.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,_.jsx)("div",{className:"sm:flex sm:items-start",children:(0,_.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,_.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Tag"}),(0,_.jsx)("div",{className:"mt-2",children:(0,_.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this tag?"})})]})})}),(0,_.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,_.jsx)(S.Button,{onClick:w,color:"red",className:"ml-2",children:"Delete"}),(0,_.jsx)(S.Button,{onClick:()=>{m(!1),h(null)},children:"Cancel"})]})]})]})})]})})},Yf=({accessToken:e})=>{let[t,r]=(0,T.useState)(`{ "model": "openai/gpt-4o", "messages": [ { @@ -674,4 +674,4 @@ ${e} } ], "temperature": 0.7 - }'`}),(0,_.jsx)(z.Button,{type:"text",icon:(0,_.jsx)(ei.CopyOutlined,{}),style:{position:"absolute",right:"8px",top:"8px"},size:"small",onClick:()=>{navigator.clipboard.writeText(a||""),J.default.success("Copied to clipboard")}})]})]})]}),(0,_.jsx)("div",{className:"mt-4 text-right w-full",children:(0,_.jsxs)("p",{className:"text-sm text-gray-500",children:["Found an error? File an issue"," ",(0,_.jsx)("a",{href:"https://github.com/BerriAI/litellm/issues",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})})]})};var Yh=e.i(275144);let Yf=({userID:e,userRole:t,accessToken:r})=>{let{logoUrl:a,setLogoUrl:s,faviconUrl:n,setFaviconUrl:l}=(0,Yh.useTheme)(),[i,o]=(0,T.useState)(""),[d,c]=(0,T.useState)(""),[u,m]=(0,T.useState)(!1);(0,T.useEffect)(()=>{r&&p()},[r]);let p=async()=>{try{let e=(0,Q.getProxyBaseUrl)(),t=e?`${e}/get/ui_theme_settings`:"/get/ui_theme_settings",a=await fetch(t,{method:"GET",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${r}`,"Content-Type":"application/json"}});if(a.ok){let e=await a.json();o(e.values?.logo_url||""),c(e.values?.favicon_url||""),s(e.values?.logo_url||null),l(e.values?.favicon_url||null)}}catch(e){console.error("Error fetching theme settings:",e)}},h=async()=>{m(!0);try{let e=(0,Q.getProxyBaseUrl)(),t=e?`${e}/update/ui_theme_settings`:"/update/ui_theme_settings";if((await fetch(t,{method:"PATCH",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify({logo_url:i||null,favicon_url:d||null})})).ok)J.default.success("Theme settings updated successfully!"),s(i||null),l(d||null);else throw Error("Failed to update settings")}catch(e){console.error("Error updating theme settings:",e),J.default.fromBackend("Failed to update theme settings")}finally{m(!1)}},f=async()=>{o(""),c(""),s(null),l(null),m(!0);try{let e=(0,Q.getProxyBaseUrl)(),t=e?`${e}/update/ui_theme_settings`:"/update/ui_theme_settings";if((await fetch(t,{method:"PATCH",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify({logo_url:null,favicon_url:null})})).ok)J.default.success("Theme settings reset to default!");else throw Error("Failed to reset")}catch(e){console.error("Error resetting theme settings:",e),J.default.fromBackend("Failed to reset theme settings")}finally{m(!1)}};return r?(0,_.jsxs)("div",{className:"w-full mx-auto max-w-4xl px-6 py-8",children:[(0,_.jsxs)("div",{className:"mb-8",children:[(0,_.jsx)(X.Title,{className:"text-2xl font-bold mb-2",children:"UI Theme Customization"}),(0,_.jsx)(Z.Text,{className:"text-gray-600",children:"Customize your LiteLLM admin dashboard with a custom logo and favicon."})]}),(0,_.jsx)(P.Card,{className:"shadow-sm p-6",children:(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Custom Logo URL"}),(0,_.jsx)(et.TextInput,{placeholder:"https://example.com/logo.png",value:i,onValueChange:e=>{o(e),s(e||null)},className:"w-full"}),(0,_.jsx)(Z.Text,{className:"text-xs text-gray-500 mt-1",children:"Enter a URL for your custom logo or leave empty for default"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Custom Favicon URL"}),(0,_.jsx)(et.TextInput,{placeholder:"https://example.com/favicon.ico",value:d,onValueChange:e=>{c(e),l(e||null)},className:"w-full"}),(0,_.jsx)(Z.Text,{className:"text-xs text-gray-500 mt-1",children:"Enter a URL for your custom favicon (.ico, .png, or .svg) or leave empty for default"})]}),(0,_.jsxs)("div",{className:"flex gap-3 pt-4",children:[(0,_.jsx)(S.Button,{onClick:h,loading:u,disabled:u,color:"indigo",children:"Save Changes"}),(0,_.jsx)(S.Button,{onClick:f,loading:u,disabled:u,variant:"secondary",color:"gray",children:"Reset to Default"})]})]})})]}):null},Yx=(0,L.makeClassName)("BarList");function Yg(e,t){let{data:r=[],color:a,valueFormatter:s=L.defaultValueFormatter,showAnimation:n=!1,onValueChange:l,sortOrder:i="descending",className:o}=e,d=(0,N.__rest)(e,["data","color","valueFormatter","showAnimation","onValueChange","sortOrder","className"]),c=l?"button":"div",u=T.default.useMemo(()=>"none"===i?r:[...r].sort((e,t)=>"ascending"===i?e.value-t.value:t.value-e.value),[r,i]),m=T.default.useMemo(()=>{let e=Math.max(...u.map(e=>e.value),0);return u.map(t=>0===t.value?0:Math.max(t.value/e*100,2))},[u]);return T.default.createElement("div",Object.assign({ref:t,className:(0,C.tremorTwMerge)(Yx("root"),"flex justify-between space-x-6",o),"aria-sort":i},d),T.default.createElement("div",{className:(0,C.tremorTwMerge)(Yx("bars"),"relative w-full space-y-1.5")},u.map((e,t)=>{var r,s,i;let o=e.icon;return T.default.createElement(c,{key:null!=(r=e.key)?r:t,onClick:()=>{null==l||l(e)},className:(0,C.tremorTwMerge)(Yx("bar"),"group w-full flex items-center rounded-tremor-small",l?["cursor-pointer","hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-subtle/40"]:"")},T.default.createElement("div",{className:(0,C.tremorTwMerge)("flex items-center rounded transition-all bg-opacity-40","h-8",e.color||a?[(0,L.getColorClassNames)(null!=(s=e.color)?s:a,M.colorPalette.background).bgColor,l?"group-hover:bg-opacity-30":""]:"bg-tremor-brand-subtle dark:bg-dark-tremor-brand-subtle/60",!l||e.color||a?"":"group-hover:bg-tremor-brand-subtle/30 group-hover:dark:bg-dark-tremor-brand-subtle/70",t===u.length-1?"mb-0":"",n?"duration-500":""),style:{width:`${m[t]}%`,transition:n?"all 1s":""}},T.default.createElement("div",{className:(0,C.tremorTwMerge)("absolute left-2 pr-4 flex max-w-full")},o?T.default.createElement(o,{className:(0,C.tremorTwMerge)(Yx("barIcon"),"flex-none h-5 w-5 mr-2","text-tremor-content","dark:text-dark-tremor-content")}):null,e.href?T.default.createElement("a",{href:e.href,target:null!=(i=e.target)?i:"_blank",rel:"noreferrer",className:(0,C.tremorTwMerge)(Yx("barLink"),"whitespace-nowrap hover:underline truncate text-tremor-default",l?"cursor-pointer":"","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis"),onClick:e=>e.stopPropagation()},e.name):T.default.createElement("p",{className:(0,C.tremorTwMerge)(Yx("barText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e.name))))})),T.default.createElement("div",{className:Yx("labels")},u.map((e,t)=>{var r;return T.default.createElement("div",{key:null!=(r=e.key)?r:t,className:(0,C.tremorTwMerge)(Yx("labelWrapper"),"flex justify-end items-center","h-8",t===u.length-1?"mb-0":"mb-1.5")},T.default.createElement("p",{className:(0,C.tremorTwMerge)(Yx("labelText"),"whitespace-nowrap leading-none truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},s(e.value)))})))}Yg.displayName="BarList";let Yy=T.default.forwardRef(Yg);console.log("process.env.NODE_ENV","production");let Y_=e=>null!==e&&("Admin"===e||"Admin Viewer"===e),Yb=({accessToken:e,token:t,userRole:r,userID:a,keys:s,premiumUser:n})=>{let l=new Date,[i,o]=(0,T.useState)([]),[d,c]=(0,T.useState)([]),[u,m]=(0,T.useState)([]),[p,h]=(0,T.useState)([]),[f,x]=(0,T.useState)([]),[g,y]=(0,T.useState)([]),[b,v]=(0,T.useState)([]),[j,w]=(0,T.useState)([]),[k,N]=(0,T.useState)([]),[M,C]=(0,T.useState)([]),[L,O]=(0,T.useState)({}),[D,B]=(0,T.useState)([]),[z,H]=(0,T.useState)(""),[$,q]=(0,T.useState)(["all-tags"]),[U,W]=(0,T.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[V,G]=(0,T.useState)(null),[K,J]=(0,T.useState)(0),et=new Date(l.getFullYear(),l.getMonth(),1),er=new Date(l.getFullYear(),l.getMonth()+1,0),ea=ed(et),es=ed(er);function en(e){return new Intl.NumberFormat("en-US",{maximumFractionDigits:0,notation:"compact",compactDisplay:"short"}).format(e)}console.log("keys in usage",s),console.log("premium user in usage",n);let el=async()=>{if(e)try{let t=await (0,Q.getProxyUISettings)(e);return console.log("usage tab: proxy_settings",t),t}catch(e){console.error("Error fetching proxy settings:",e)}};(0,T.useEffect)(()=>{eo(U.from,U.to)},[U,$]);let ei=async(t,r,a)=>{if(!t||!r||!e)return;console.log("uiSelectedKey",a);let s=await (0,Q.adminTopEndUsersCall)(e,a,t.toISOString(),r.toISOString());console.log("End user data updated successfully",s),h(s)},eo=async(t,r)=>{if(!t||!r||!e)return;let a=await el();a?.DISABLE_EXPENSIVE_DB_QUERIES||(y((await (0,Q.tagsSpendLogsCall)(e,t.toISOString(),r.toISOString(),0===$.length?void 0:$)).spend_per_tag),console.log("Tag spend data updated successfully"))};function ed(e){let t=e.getFullYear(),r=e.getMonth()+1,a=e.getDate();return`${t}-${r<10?"0"+r:r}-${a<10?"0"+a:a}`}console.log(`Start date is ${ea}`),console.log(`End date is ${es}`);let ec=async(e,t,r)=>{try{let r=await e();t(r)}catch(e){console.error(r,e)}},eu=(e,t,r,a)=>{let s=[],n=new Date(t),l=new Map(e.map(e=>{let t=(e=>{if(e.includes("-"))return e;{let[t,r]=e.split(" ");return new Date(new Date().getFullYear(),new Date(`${t} 01 2024`).getMonth(),parseInt(r)).toISOString().split("T")[0]}})(e.date);return[t,{...e,date:t}]}));for(;n<=r;){let e=n.toISOString().split("T")[0];if(l.has(e))s.push(l.get(e));else{let t={date:e,api_requests:0,total_tokens:0};a.forEach(e=>{t[e]||(t[e]=0)}),s.push(t)}n.setDate(n.getDate()+1)}return s},em=async()=>{if(e)try{let t=await (0,Q.adminSpendLogsCall)(e),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),1),s=new Date(r.getFullYear(),r.getMonth()+1,0),n=eu(t,a,s,[]),l=Number(n.reduce((e,t)=>e+(t.spend||0),0).toFixed(2));J(l),o(n)}catch(e){console.error("Error fetching overall spend:",e)}},ep=async()=>{e&&await ec(async()=>(await (0,Q.adminTopKeysCall)(e)).map(e=>({key:e.api_key.substring(0,10),api_key:e.api_key,key_alias:e.key_alias,spend:Number(e.total_spend.toFixed(2))})),c,"Error fetching top keys")},eh=async()=>{e&&await ec(async()=>(await (0,Q.adminTopModelsCall)(e)).map(e=>({key:e.model,spend:(0,rV.formatNumberWithCommas)(e.total_spend,2)})),m,"Error fetching top models")},ef=async()=>{e&&await ec(async()=>{let t=await (0,Q.teamSpendLogsCall)(e),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),1),s=new Date(r.getFullYear(),r.getMonth()+1,0);return x(eu(t.daily_spend,a,s,t.teams)),w(t.teams),t.total_spend_per_team.map(e=>({name:e.team_id||"",value:(0,rV.formatNumberWithCommas)(e.total_spend||0,2)}))},N,"Error fetching team spend")},ex=async()=>{if(e)try{let t=await (0,Q.adminGlobalActivity)(e,ea,es),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),1),s=new Date(r.getFullYear(),r.getMonth()+1,0),n=eu(t.daily_data||[],a,s,["api_requests","total_tokens"]);O({...t,daily_data:n})}catch(e){console.error("Error fetching global activity:",e)}},eg=async()=>{if(e)try{let t=await (0,Q.adminGlobalActivityPerModel)(e,ea,es),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),1),s=new Date(r.getFullYear(),r.getMonth()+1,0),n=t.map(e=>({...e,daily_data:eu(e.daily_data||[],a,s,["api_requests","total_tokens"])}));B(n)}catch(e){console.error("Error fetching global activity per model:",e)}};return((0,T.useEffect)(()=>{(async()=>{if(e&&t&&r&&a){let a=await el();!(a&&(G(a),a?.DISABLE_EXPENSIVE_DB_QUERIES))&&(console.log("fetching data - valiue of proxySettings",V),em(),ec(()=>e&&t?(0,Q.adminspendByProvider)(e,t,ea,es):Promise.reject("No access token or token"),C,"Error fetching provider spend"),ep(),eh(),ex(),eg(),Y_(r)&&(ef(),e&&ec(async()=>(await (0,Q.allTagNamesCall)(e)).tag_names,v,"Error fetching tag names"),e&&ec(()=>(0,Q.tagsSpendLogsCall)(e,U.from?.toISOString(),U.to?.toISOString(),void 0),e=>y(e.spend_per_tag),"Error fetching top tags"),e&&ec(()=>(0,Q.adminTopEndUsersCall)(e,null,void 0,void 0),h,"Error fetching top end users")))}})()},[e,t,r,a,ea,es]),V?.DISABLE_EXPENSIVE_DB_QUERIES)?(0,_.jsx)("div",{style:{width:"100%"},className:"p-8",children:(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Database Query Limit Reached"}),(0,_.jsxs)(Z.Text,{className:"mt-4",children:["SpendLogs in DB has ",V.NUM_SPEND_LOGS_ROWS," rows.",(0,_.jsx)("br",{}),"Please follow our guide to view usage when SpendLogs has more than 1M rows."]}),(0,_.jsx)(S.Button,{className:"mt-4",children:(0,_.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/spending_monitoring",target:"_blank",children:"View Usage Guide"})})]})}):(0,_.jsx)("div",{style:{width:"100%"},className:"p-8",children:(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)(rR.TabList,{className:"mt-2",children:[(0,_.jsx)(rY.Tab,{children:"All Up"}),Y_(r)?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(rY.Tab,{children:"Team Based Usage"}),(0,_.jsx)(rY.Tab,{children:"Customer Usage"}),(0,_.jsx)(rY.Tab,{children:"Tag Based Usage"})]}):(0,_.jsx)(_.Fragment,{children:(0,_.jsx)("div",{})})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)(rR.TabList,{variant:"solid",className:"mt-1",children:[(0,_.jsx)(rY.Tab,{children:"Cost"}),(0,_.jsx)(rY.Tab,{children:"Activity"})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(ee.Grid,{numItems:2,className:"gap-2 h-[100vh] w-full",children:[(0,_.jsxs)(yl.Col,{numColSpan:2,children:[(0,_.jsxs)(Z.Text,{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content mb-2 mt-2 text-lg",children:["Project Spend ",new Date().toLocaleString("default",{month:"long"})," 1 -"," ",new Date(new Date().getFullYear(),new Date().getMonth()+1,0).getDate()]}),(0,_.jsx)(PF,{userSpend:K,selectedTeam:null,userMaxBudget:null})]}),(0,_.jsx)(yl.Col,{numColSpan:2,children:(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Monthly Spend"}),(0,_.jsx)(yn,{data:i,index:"date",categories:["spend"],colors:["cyan"],valueFormatter:e=>`$ ${(0,rV.formatNumberWithCommas)(e,2)}`,yAxisWidth:100,tickGap:5})]})}),(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsxs)(P.Card,{className:"h-full",children:[(0,_.jsx)(X.Title,{children:"Top Virtual Keys"}),(0,_.jsx)(Az,{topKeys:d,teams:null,topKeysLimit:5,setTopKeysLimit:()=>{}})]})}),(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsxs)(P.Card,{className:"h-full",children:[(0,_.jsx)(X.Title,{children:"Top Models"}),(0,_.jsx)(yn,{className:"mt-4 h-40",data:u,index:"key",categories:["spend"],colors:["cyan"],yAxisWidth:200,layout:"vertical",showXAxis:!1,showLegend:!1,valueFormatter:e=>`$${(0,rV.formatNumberWithCommas)(e,2)}`})]})}),(0,_.jsx)(yl.Col,{numColSpan:1}),(0,_.jsx)(yl.Col,{numColSpan:2,children:(0,_.jsxs)(P.Card,{className:"mb-2",children:[(0,_.jsx)(X.Title,{children:"Spend by Provider"}),(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)(ee.Grid,{numItems:2,children:[(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsx)(AY,{className:"mt-4 h-40",variant:"pie",data:M,index:"provider",category:"spend",colors:["cyan"],valueFormatter:e=>`$${(0,rV.formatNumberWithCommas)(e,2)}`})}),(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsxs)(A.Table,{children:[(0,_.jsx)(Y.TableHead,{children:(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(F.TableHeaderCell,{children:"Provider"}),(0,_.jsx)(F.TableHeaderCell,{children:"Spend"})]})}),(0,_.jsx)(E.TableBody,{children:M.map(e=>(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(I.TableCell,{children:e.provider}),(0,_.jsx)(I.TableCell,{children:1e-5>parseFloat(e.spend.toFixed(2))?"less than 0.00":(0,rV.formatNumberWithCommas)(e.spend,2)})]},e.provider))})]})})]})})]})})]})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(ee.Grid,{numItems:1,className:"gap-2 h-[75vh] w-full",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"All Up"}),(0,_.jsxs)(ee.Grid,{numItems:2,children:[(0,_.jsxs)(yl.Col,{children:[(0,_.jsxs)(yv.Subtitle,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",en(L.sum_api_requests)]}),(0,_.jsx)(Pu,{className:"h-40",data:L.daily_data,valueFormatter:en,index:"date",colors:["cyan"],categories:["api_requests"],onValueChange:e=>console.log(e)})]}),(0,_.jsxs)(yl.Col,{children:[(0,_.jsxs)(yv.Subtitle,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",en(L.sum_total_tokens)]}),(0,_.jsx)(yn,{className:"h-40",data:L.daily_data,valueFormatter:en,index:"date",colors:["cyan"],categories:["total_tokens"],onValueChange:e=>console.log(e)})]})]})]}),(0,_.jsx)(_.Fragment,{children:D.map((e,t)=>(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:e.model}),(0,_.jsxs)(ee.Grid,{numItems:2,children:[(0,_.jsxs)(yl.Col,{children:[(0,_.jsxs)(yv.Subtitle,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",en(e.sum_api_requests)]}),(0,_.jsx)(Pu,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["api_requests"],valueFormatter:en,onValueChange:e=>console.log(e)})]}),(0,_.jsxs)(yl.Col,{children:[(0,_.jsxs)(yv.Subtitle,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",en(e.sum_total_tokens)]}),(0,_.jsx)(yn,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["total_tokens"],valueFormatter:en,onValueChange:e=>console.log(e)})]})]})]},t))})]})})]})]})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(ee.Grid,{numItems:2,className:"gap-2 h-[75vh] w-full",children:[(0,_.jsxs)(yl.Col,{numColSpan:2,children:[(0,_.jsxs)(P.Card,{className:"mb-2",children:[(0,_.jsx)(X.Title,{children:"Total Spend Per Team"}),(0,_.jsx)(Yy,{data:k})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Daily Spend Per Team"}),(0,_.jsx)(yn,{className:"h-72",data:f,showLegend:!0,index:"date",categories:j,yAxisWidth:80,stack:!0})]})]}),(0,_.jsx)(yl.Col,{numColSpan:2})]})}),(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsxs)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:["Customers of your LLM API calls. Tracked when a `user` param is passed in your LLM calls"," ",(0,_.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/users",target:"_blank",children:"docs here"})]}),(0,_.jsxs)(ee.Grid,{numItems:2,children:[(0,_.jsx)(yl.Col,{children:(0,_.jsx)(je,{value:U,onValueChange:e=>{W(e),ei(e.from,e.to,null)}})}),(0,_.jsxs)(yl.Col,{children:[(0,_.jsx)(Z.Text,{children:"Select Key"}),(0,_.jsxs)(jc.Select,{defaultValue:"all-keys",children:[(0,_.jsx)(ju.SelectItem,{value:"all-keys",onClick:()=>{ei(U.from,U.to,null)},children:"All Keys"},"all-keys"),s?.map((e,t)=>e&&null!==e.key_alias&&e.key_alias.length>0?(0,_.jsx)(ju.SelectItem,{value:String(t),onClick:()=>{ei(U.from,U.to,e.token)},children:e.key_alias},t):null)]})]})]}),(0,_.jsx)(P.Card,{className:"mt-4",children:(0,_.jsxs)(A.Table,{className:"max-h-[70vh] min-h-[500px]",children:[(0,_.jsx)(Y.TableHead,{children:(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(F.TableHeaderCell,{children:"Customer"}),(0,_.jsx)(F.TableHeaderCell,{children:"Spend"}),(0,_.jsx)(F.TableHeaderCell,{children:"Total Events"})]})}),(0,_.jsx)(E.TableBody,{children:p?.map((e,t)=>(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(I.TableCell,{children:e.end_user}),(0,_.jsx)(I.TableCell,{children:(0,rV.formatNumberWithCommas)(e.total_spend,2)}),(0,_.jsx)(I.TableCell,{children:e.total_count})]},t))})]})})]}),(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsxs)(ee.Grid,{numItems:2,children:[(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsx)(je,{className:"mb-4",value:U,onValueChange:e=>{W(e),eo(e.from,e.to)}})}),(0,_.jsx)(yl.Col,{children:n?(0,_.jsx)("div",{children:(0,_.jsxs)(yy,{value:$,onValueChange:e=>q(e),children:[(0,_.jsx)(yb,{value:"all-tags",onClick:()=>q(["all-tags"]),children:"All Tags"},"all-tags"),b&&b.filter(e=>"all-tags"!==e).map((e,t)=>(0,_.jsx)(yb,{value:String(e),children:e},e))]})}):(0,_.jsx)("div",{children:(0,_.jsxs)(yy,{value:$,onValueChange:e=>q(e),children:[(0,_.jsx)(yb,{value:"all-tags",onClick:()=>q(["all-tags"]),children:"All Tags"},"all-tags"),b&&b.filter(e=>"all-tags"!==e).map((e,t)=>(0,_.jsxs)(ju.SelectItem,{value:String(e),disabled:!0,children:["✨ ",e," (Enterprise only Feature)"]},e))]})})})]}),(0,_.jsxs)(ee.Grid,{numItems:2,className:"gap-2 h-[75vh] w-full mb-4",children:[(0,_.jsx)(yl.Col,{numColSpan:2,children:(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Spend Per Tag"}),(0,_.jsxs)(Z.Text,{children:["Get Started by Tracking cost per tag"," ",(0,_.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/cost_tracking",target:"_blank",children:"here"})]}),(0,_.jsx)(yn,{className:"h-72",data:g,index:"name",categories:["spend"],colors:["cyan"]})]})}),(0,_.jsx)(yl.Col,{numColSpan:2})]})]})]})]})})};var Yv=e.i(693569),Yj=e.i(263147);let Yw=async(e,t)=>{let r=(0,Q.getProxyBaseUrl)(),a=`${r}/v1/access_group/${encodeURIComponent(t)}`,s=await fetch(a,{method:"DELETE",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!s.ok){let e=await s.json(),t=(0,td.deriveErrorMessage)(e);throw(0,Q.handleError)(t),Error(t)}};var Eh=MV,Yk=e.i(657150),Yk=Yk,Cl=Cl,YS=e.i(446891);let YN=async(e,t)=>{let r=(0,Q.getProxyBaseUrl)(),a=`${r}/v1/access_group/${encodeURIComponent(t)}`,s=await fetch(a,{method:"GET",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!s.ok){let e=await s.json(),t=(0,td.deriveErrorMessage)(e);throw(0,Q.handleError)(t),Error(t)}return s.json()};var Yk=Yk,Eg=Eg,YT=e.i(304911),Yk=Yk,Cf=Cf;let{TextArea:YM}=$.Input;function YC({form:e,isNameDisabled:t=!1}){let{data:r}=DY(),{data:a}=(0,LM.useMCPServers)(),s=r?.agents??[],n=[{key:"1",label:(0,_.jsxs)(U.Space,{align:"center",size:4,children:[(0,_.jsx)(Cf.default,{size:16}),"General Info"]}),children:(0,_.jsxs)("div",{style:{paddingTop:16},children:[(0,_.jsx)(H.Form.Item,{name:"name",label:"Group Name",rules:[{required:!0,message:"Please enter the access group name"}],children:(0,_.jsx)($.Input,{placeholder:"e.g. Engineering Team",disabled:t})}),(0,_.jsx)(H.Form.Item,{name:"description",label:"Description",children:(0,_.jsx)(YM,{rows:4,placeholder:"Describe the purpose of this access group..."})})]})},{key:"2",label:(0,_.jsxs)(U.Space,{align:"center",size:4,children:[(0,_.jsx)(Ex,{size:16}),"Models"]}),children:(0,_.jsx)("div",{style:{paddingTop:16},children:(0,_.jsx)(H.Form.Item,{name:"modelIds",label:"Allowed Models",children:(0,_.jsx)(Es.ModelSelect,{context:"global",value:e.getFieldValue("modelIds")??[],onChange:t=>e.setFieldsValue({modelIds:t}),style:{width:"100%"}})})})},{key:"3",label:(0,_.jsxs)(U.Space,{align:"center",size:4,children:[(0,_.jsx)(Cp,{size:16}),"MCP Servers"]}),children:(0,_.jsx)("div",{style:{paddingTop:16},children:(0,_.jsx)(H.Form.Item,{name:"mcpServerIds",label:"Allowed MCP Servers",children:(0,_.jsx)(eE.Select,{mode:"multiple",placeholder:"Select MCP servers",style:{width:"100%"},optionFilterProp:"label",allowClear:!0,options:(a??[]).map(e=>({label:e.server_name??e.server_id,value:e.server_id}))})})})},{key:"4",label:(0,_.jsxs)(U.Space,{align:"center",size:4,children:[(0,_.jsx)(Yk.default,{size:16}),"Agents"]}),children:(0,_.jsx)("div",{style:{paddingTop:16},children:(0,_.jsx)(H.Form.Item,{name:"agentIds",label:"Allowed Agents",children:(0,_.jsx)(eE.Select,{mode:"multiple",placeholder:"Select agents",style:{width:"100%"},optionFilterProp:"label",allowClear:!0,options:s.map(e=>({label:e.agent_name,value:e.agent_id}))})})})}];return(0,_.jsx)(H.Form,{form:e,layout:"vertical",name:"access_group_form",initialValues:{modelIds:[],mcpServerIds:[],agentIds:[]},children:(0,_.jsx)(W.Tabs,{defaultActiveKey:"1",items:n})})}let YL=async(e,t,r)=>{let a=(0,Q.getProxyBaseUrl)(),s=`${a}/v1/access_group/${encodeURIComponent(t)}`,n=await fetch(s,{method:"PUT",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!n.ok){let e=await n.json(),t=(0,td.deriveErrorMessage)(e);throw(0,Q.handleError)(t),Error(t)}return n.json()};function YO({visible:e,accessGroup:t,onCancel:r,onSuccess:a}){let[s]=H.Form.useForm(),n=(()=>{let{accessToken:e}=(0,k.default)(),t=(0,eh.useQueryClient)();return(0,ep.useMutation)({mutationFn:async({accessGroupId:t,params:r})=>{if(!e)throw Error("Access token is required");return YL(e,t,r)},onSuccess:(e,{accessGroupId:r})=>{t.invalidateQueries({queryKey:Yj.accessGroupKeys.all}),t.invalidateQueries({queryKey:Yj.accessGroupKeys.detail(r)})}})})();return(0,T.useEffect)(()=>{e&&t&&s.setFieldsValue({name:t.access_group_name,description:t.description??"",modelIds:t.access_model_names??[],mcpServerIds:t.access_mcp_server_ids??[],agentIds:t.access_agent_ids??[]})},[e,t,s]),(0,_.jsx)(q.Modal,{title:"Edit Access Group",open:e,onOk:()=>{s.validateFields().then(e=>{let s={access_group_name:e.name,description:e.description,access_model_names:e.modelIds,access_mcp_server_ids:e.mcpServerIds,access_agent_ids:e.agentIds};n.mutate({accessGroupId:t.access_group_id,params:s},{onSuccess:()=>{tU.default.success("Access group updated successfully"),a?.(),r()}})}).catch(e=>{console.log("Validate Failed:",e)})},onCancel:r,width:700,okText:"Save Changes",cancelText:"Cancel",confirmLoading:n.isPending,destroyOnHidden:!0,children:(0,_.jsx)(YC,{form:s})})}let{Title:YD,Text:YP}=V.Typography,{Content:YA}=Ep.Layout;function YE({accessGroupId:e,onBack:t}){let{data:r,isLoading:a}=(e=>{let{accessToken:t,userRole:r}=(0,k.default)(),a=(0,eh.useQueryClient)();return(0,ev.useQuery)({queryKey:Yj.accessGroupKeys.detail(e),queryFn:async()=>YN(t,e),enabled:!!(t&&e)&&ts.all_admin_roles.includes(r||""),initialData:()=>{if(!e)return;let t=a.getQueryData(Yj.accessGroupKeys.list({}));return t?.find(t=>t.access_group_id===e)}})})(e),{token:s}=Ef.theme.useToken(),[n,l]=(0,T.useState)(!1),[i,o]=(0,T.useState)(!1),[d,c]=(0,T.useState)(!1);if(a)return(0,_.jsx)(YA,{style:{padding:s.paddingLG,paddingInline:2*s.paddingLG},children:(0,_.jsx)(tg.Flex,{justify:"center",align:"center",style:{minHeight:300},children:(0,_.jsx)(rm.Spin,{size:"large"})})});if(!r)return(0,_.jsxs)(YA,{style:{padding:s.paddingLG,paddingInline:2*s.paddingLG},children:[(0,_.jsx)(z.Button,{icon:(0,_.jsx)(EK,{size:16}),onClick:t,type:"text",style:{marginBottom:16}}),(0,_.jsx)(e0.Empty,{description:"Access group not found"})]});let u=r.access_model_names??[],m=r.access_mcp_server_ids??[],p=r.access_agent_ids??[],h=r.assigned_key_ids??[],f=r.assigned_team_ids??[],x=i?h:h.slice(0,5),g=d?f:f.slice(0,5),y=[{key:"models",label:(0,_.jsxs)(tg.Flex,{align:"center",gap:8,children:[(0,_.jsx)(Ex,{size:16}),"Models",(0,_.jsx)(eN.Tag,{style:{marginInlineEnd:0},children:u?.length})]}),children:u?.length>0?(0,_.jsx)(M1,{grid:{gutter:16,xs:1,sm:2,md:3,lg:4},dataSource:u,renderItem:e=>(0,_.jsx)(M1.Item,{children:(0,_.jsx)(eg.Card,{size:"small",children:(0,_.jsx)(YP,{code:!0,children:e})})})}):(0,_.jsx)(e0.Empty,{description:"No models assigned to this group"})},{key:"mcp",label:(0,_.jsxs)(tg.Flex,{align:"center",gap:8,children:[(0,_.jsx)(Cp,{size:16}),"MCP Servers",(0,_.jsx)(eN.Tag,{children:m?.length})]}),children:m?.length>0?(0,_.jsx)(M1,{grid:{gutter:16,xs:1,sm:2,md:3,lg:4},dataSource:m,renderItem:e=>(0,_.jsx)(M1.Item,{children:(0,_.jsx)(eg.Card,{size:"small",children:(0,_.jsx)(YP,{code:!0,children:e})})})}):(0,_.jsx)(e0.Empty,{description:"No MCP servers assigned to this group"})},{key:"agents",label:(0,_.jsxs)(tg.Flex,{align:"center",gap:8,children:[(0,_.jsx)(Yk.default,{size:16}),"Agents",(0,_.jsx)(eN.Tag,{children:p?.length})]}),children:p?.length>0?(0,_.jsx)(M1,{grid:{gutter:16,xs:1,sm:2,md:3,lg:4},dataSource:p,renderItem:e=>(0,_.jsx)(M1.Item,{children:(0,_.jsx)(eg.Card,{size:"small",children:(0,_.jsx)(YP,{code:!0,children:e})})})}):(0,_.jsx)(e0.Empty,{description:"No agents assigned to this group"})}];return(0,_.jsxs)(YA,{style:{padding:s.paddingLG,paddingInline:2*s.paddingLG},children:[(0,_.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:24},children:[(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16},children:[(0,_.jsx)(z.Button,{icon:(0,_.jsx)(EK,{size:16}),onClick:t,type:"text"}),(0,_.jsxs)("div",{children:[(0,_.jsx)(YD,{level:2,style:{margin:0},children:r.access_group_name}),(0,_.jsxs)(YP,{type:"secondary",children:["ID: ",(0,_.jsx)(YP,{copyable:!0,children:r.access_group_id})]})]})]}),(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(eM,{size:16}),onClick:()=>{l(!0)},children:"Edit Access Group"})]}),(0,_.jsx)(wl.Row,{style:{marginBottom:24},children:(0,_.jsx)(eg.Card,{children:(0,_.jsxs)(eS.Descriptions,{title:"Group Details",column:1,children:[(0,_.jsx)(eS.Descriptions.Item,{label:"Description",children:r.description||"—"}),(0,_.jsxs)(eS.Descriptions.Item,{label:"Created",children:[new Date(r.created_at).toLocaleString(),r.created_by&&(0,_.jsxs)(YP,{children:[" ","by"," ",(0,_.jsx)(YT.default,{userId:r.created_by})]})]}),(0,_.jsxs)(eS.Descriptions.Item,{label:"Last Updated",children:[new Date(r.updated_at).toLocaleString(),r.updated_by&&(0,_.jsxs)(YP,{children:[" ","by"," ",(0,_.jsx)(YT.default,{userId:r.updated_by})]})]})]})})}),(0,_.jsxs)(wl.Row,{gutter:[16,16],style:{marginBottom:24},children:[(0,_.jsx)(wi.Col,{xs:24,lg:12,children:(0,_.jsx)(eg.Card,{title:(0,_.jsxs)(tg.Flex,{align:"center",gap:8,children:[(0,_.jsx)(Cm,{size:16}),"Attached Keys",(0,_.jsx)(eN.Tag,{children:h?.length})]}),extra:h?.length>5?(0,_.jsx)(z.Button,{type:"link",onClick:()=>o(!i),children:i?"Show Less":`View All (${h?.length})`}):null,children:h?.length>0?(0,_.jsx)(tg.Flex,{wrap:"wrap",gap:8,children:x.map(e=>(0,_.jsx)(eN.Tag,{children:(0,_.jsx)(YP,{code:!0,style:{fontSize:12},children:e.length>20?`${e.slice(0,10)}...${e.slice(-6)}`:e})},e))}):(0,_.jsx)(e0.Empty,{description:"No keys attached",image:e0.Empty.PRESENTED_IMAGE_SIMPLE})})}),(0,_.jsx)(wi.Col,{xs:24,lg:12,children:(0,_.jsx)(eg.Card,{title:(0,_.jsxs)(tg.Flex,{align:"center",gap:8,children:[(0,_.jsx)(Eg.default,{size:16}),"Attached Teams",(0,_.jsx)(eN.Tag,{children:f?.length})]}),extra:f?.length>5?(0,_.jsx)(z.Button,{type:"link",onClick:()=>c(!d),children:d?"Show Less":`View All (${f?.length})`}):null,children:f?.length>0?(0,_.jsx)(tg.Flex,{wrap:"wrap",gap:8,children:g.map(e=>(0,_.jsx)(eN.Tag,{children:(0,_.jsx)(YP,{code:!0,style:{fontSize:12},children:e})},e))}):(0,_.jsx)(e0.Empty,{description:"No teams attached",image:e0.Empty.PRESENTED_IMAGE_SIMPLE})})})]}),(0,_.jsx)(eg.Card,{children:(0,_.jsx)(W.Tabs,{defaultActiveKey:"models",items:y})}),(0,_.jsx)(YO,{visible:n,accessGroup:r,onCancel:()=>l(!1)})]})}let YI=async(e,t)=>{let r=(0,Q.getProxyBaseUrl)(),a=`${r}/v1/access_group`,s=await fetch(a,{method:"POST",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!s.ok){let e=await s.json(),t=(0,td.deriveErrorMessage)(e);throw(0,Q.handleError)(t),Error(t)}return s.json()};function YY({visible:e,onCancel:t,onSuccess:r}){let[a]=H.Form.useForm(),s=(()=>{let{accessToken:e}=(0,k.default)(),t=(0,eh.useQueryClient)();return(0,ep.useMutation)({mutationFn:async t=>{if(!e)throw Error("Access token is required");return YI(e,t)},onSuccess:()=>{t.invalidateQueries({queryKey:Yj.accessGroupKeys.all})}})})();return(0,_.jsx)(q.Modal,{title:"Create Access Group",open:e,onOk:()=>{a.validateFields().then(e=>{let n={access_group_name:e.name,description:e.description,access_model_names:e.modelIds,access_mcp_server_ids:e.mcpServerIds,access_agent_ids:e.agentIds};s.mutate(n,{onSuccess:()=>{tU.default.success("Access group created successfully"),a.resetFields(),r?.(),t()}})}).catch(e=>{console.log("Validate Failed:",e)})},onCancel:t,width:700,okText:"Create Group",cancelText:"Cancel",confirmLoading:s.isPending,destroyOnClose:!0,children:(0,_.jsx)(YC,{form:a})})}let{Title:YF,Text:YR}=V.Typography,{Content:YB}=Ep.Layout;function Yz(e){return{id:e.access_group_id,name:e.access_group_name,description:e.description??"",modelIds:e.access_model_names,mcpServerIds:e.access_mcp_server_ids,agentIds:e.access_agent_ids,keyIds:e.assigned_key_ids,teamIds:e.assigned_team_ids,createdAt:e.created_at,createdBy:e.created_by??"",updatedAt:e.updated_at,updatedBy:e.updated_by??""}}function YH(){let{token:e}=Ef.theme.useToken(),{userRole:t}=(0,k.default)(),r=(0,ts.isProxyAdminRole)(t??""),{data:a,isLoading:s}=(0,Yj.useAccessGroups)(),n=(0,T.useMemo)(()=>(a??[]).map(Yz),[a]),[l,i]=(0,T.useState)(null),[o,d]=(0,T.useState)(!1),[c,u]=(0,T.useState)(""),[m,p]=(0,T.useState)(1),[h,f]=(0,T.useState)([]),[x,g]=(0,T.useState)(null),y=(()=>{let{accessToken:e}=(0,k.default)(),t=(0,eh.useQueryClient)();return(0,ep.useMutation)({mutationFn:async t=>{if(!e)throw Error("Access token is required");return Yw(e,t)},onSuccess:()=>{t.invalidateQueries({queryKey:Yj.accessGroupKeys.all})}})})();(0,T.useEffect)(()=>{p(1)},[c]);let b=(0,T.useMemo)(()=>n.filter(e=>e.name.toLowerCase().includes(c.toLowerCase())||e.id.toLowerCase().includes(c.toLowerCase())||e.description.toLowerCase().includes(c.toLowerCase())),[n,c]),v=(0,T.useMemo)(()=>[{id:"id",accessorKey:"id",header:()=>(0,_.jsx)("span",{children:"ID"}),enableSorting:!1,size:170,cell:({row:e})=>{let t=e.original;return(0,_.jsx)(tB.Tooltip,{title:t.id,children:(0,_.jsx)(YR,{ellipsis:!0,className:"text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs cursor-pointer",style:{fontSize:14,padding:"1px 8px"},onClick:()=>i(t.id),children:t.id})})}},{id:"name",accessorKey:"name",header:()=>(0,_.jsx)("span",{children:"Name"}),enableSorting:!0,cell:({getValue:e})=>e()},{id:"resources",header:()=>(0,_.jsx)("span",{children:"Resources"}),enableSorting:!1,cell:({row:e})=>{let t=e.original,r=t.modelIds??[],a=t.mcpServerIds??[],s=t.agentIds??[];return(0,_.jsxs)(tg.Flex,{gap:12,align:"center",children:[(0,_.jsx)(tB.Tooltip,{title:`${r?.length} Models`,children:(0,_.jsx)(eN.Tag,{color:"blue",style:{fontSize:14,padding:"2px 8px",margin:0},children:(0,_.jsxs)(tg.Flex,{align:"center",gap:6,children:[(0,_.jsx)(Ex,{size:14}),r?.length]})})}),(0,_.jsx)(tB.Tooltip,{title:`${a?.length} MCP Servers`,children:(0,_.jsx)(eN.Tag,{color:"cyan",style:{fontSize:14,padding:"2px 8px",margin:0},children:(0,_.jsxs)(tg.Flex,{align:"center",gap:6,children:[(0,_.jsx)(Cp,{size:14}),a?.length]})})}),(0,_.jsx)(tB.Tooltip,{title:`${s?.length} Agents`,children:(0,_.jsx)(eN.Tag,{color:"purple",style:{fontSize:14,padding:"2px 8px",margin:0},children:(0,_.jsxs)(tg.Flex,{align:"center",gap:6,children:[(0,_.jsx)(Yk.default,{size:14}),s?.length]})})})]})}},{id:"createdAt",accessorKey:"createdAt",header:()=>(0,_.jsx)("span",{children:"Created"}),enableSorting:!0,sortingFn:"datetime",cell:({getValue:e})=>new Date(e()).toLocaleDateString(),meta:{responsive:["lg"]}},{id:"updatedAt",accessorKey:"updatedAt",header:()=>(0,_.jsx)("span",{children:"Updated"}),enableSorting:!1,cell:({getValue:e})=>new Date(e()).toLocaleDateString(),meta:{responsive:["xl"]}},...r?[{id:"actions",header:()=>(0,_.jsx)("span",{children:"Actions"}),enableSorting:!1,cell:({row:e})=>(0,_.jsx)(U.Space,{children:(0,_.jsx)(rG.default,{variant:"Delete",tooltipText:"Delete access group",onClick:()=>g(e.original)})})}]:[]],[r]),j=(0,jD.useReactTable)({data:b,columns:v,state:{sorting:h},onSortingChange:f,getCoreRowModel:(0,jP.getCoreRowModel)(),getSortedRowModel:(0,jP.getSortedRowModel)(),getRowId:e=>e.id}),w=j.getRowModel().rows,S=w.slice((m-1)*10,10*m),N=(0,T.useMemo)(()=>new Map(S.map(e=>[e.original.id,e])),[S]),M=(j.getHeaderGroups()[0]?.headers??[]).map(e=>{let t=e.column.getCanSort(),r=e.column.getIsSorted(),a=e.column.columnDef.meta,s={title:(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.isPlaceholder?null:(0,jD.flexRender)(e.column.columnDef.header,e.getContext()),t&&(0,_.jsx)(YS.TableHeaderSortDropdown,{sortState:!1!==r&&r,onSortChange:t=>{f(!1===t?[]:[{id:e.column.id,desc:"desc"===t}])},columnId:e.column.id})]}),key:e.id,width:e.column.columnDef.size,render:(t,r)=>{let a=N.get(r.id);if(!a)return null;let s=a.getVisibleCells().find(t=>t.column.id===e.id);return s?(0,jD.flexRender)(s.column.columnDef.cell,s.getContext()):null}};return a?.responsive&&(s.responsive=a.responsive),s}),C=S.map(e=>e.original);return l?(0,_.jsx)(YE,{accessGroupId:l,onBack:()=>i(null)}):(0,_.jsxs)(YB,{style:{padding:e.paddingLG,paddingInline:2*e.paddingLG},children:[(0,_.jsxs)(tg.Flex,{justify:"space-between",align:"center",style:{marginBottom:16},children:[(0,_.jsxs)(U.Space,{direction:"vertical",size:0,children:[(0,_.jsx)(YF,{level:2,style:{margin:0},children:"Access Groups"}),(0,_.jsx)(YR,{type:"secondary",children:"Manage resource permissions for your organization"})]}),r&&(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(tZ.PlusOutlined,{}),onClick:()=>d(!0),children:"Create Access Group"})]}),(0,_.jsxs)(eg.Card,{styles:{body:{padding:0}},children:[(0,_.jsxs)(tg.Flex,{justify:"space-between",align:"center",style:{padding:"12px 16px"},children:[(0,_.jsx)($.Input,{prefix:(0,_.jsx)(Cl.default,{size:16}),placeholder:"Search groups by name, ID, or description...",style:{maxWidth:400},value:c,onChange:e=>u(e.target.value),allowClear:!0}),(0,_.jsx)(Eh.default,{current:m,total:w?.length,pageSize:10,onChange:e=>p(e),size:"small",showTotal:e=>`${e} groups`,showSizeChanger:!1})]}),(0,_.jsx)(eK.Table,{columns:M,dataSource:C,rowKey:"id",loading:s,pagination:!1})]}),(0,_.jsx)(YY,{visible:o,onCancel:()=>d(!1)}),(0,_.jsx)(eH.default,{isOpen:!!x,title:"Delete Access Group",message:"Are you sure you want to delete this access group? This action cannot be undone.",resourceInformationTitle:"Access Group Information",resourceInformation:[{label:"ID",value:x?.id,code:!0},{label:"Name",value:x?.name},{label:"Description",value:x?.description||"—"}],onCancel:()=>g(null),onOk:()=>{x&&y.mutate(x.id,{onSuccess:()=>{g(null)}})},confirmLoading:y.isPending})]})}var Y$=e.i(510674),Eh=MV,Cl=Cl;let Yq={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M484 443.1V528h-84.5c-4.1 0-7.5 3.1-7.5 7v42c0 3.8 3.4 7 7.5 7H484v84.9c0 3.9 3.2 7.1 7 7.1h42c3.9 0 7-3.2 7-7.1V584h84.5c4.1 0 7.5-3.2 7.5-7v-42c0-3.9-3.4-7-7.5-7H540v-84.9c0-3.9-3.1-7.1-7-7.1h-42c-3.8 0-7 3.2-7 7.1zm396-144.7H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder-add",theme:"outlined"};var YU=T.forwardRef(function(e,t){return T.createElement(rf.default,(0,rp.default)({},e,{ref:t,icon:Yq}))});let YW=async(e,t)=>{let r=(0,Q.getProxyBaseUrl)(),a=`${r}/project/new`,s=await fetch(a,{method:"POST",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!s.ok){let e=await s.json(),t=(0,td.deriveErrorMessage)(e);throw(0,Q.handleError)(t),Error(t)}return s.json()};function YV({form:e}){let{accessToken:t,userId:r,userRole:a}=(0,k.default)(),{data:s}=(0,jY.useTeams)(),[n,l]=(0,T.useState)(null),[i,o]=(0,T.useState)([]),[d,c]=(0,T.useState)([]);(0,T.useEffect)(()=>{(async()=>{if(t)try{let e=(await (0,Q.getGuardrailsList)(t)).guardrails.map(e=>e.guardrail_name);c(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[t]);let u=H.Form.useWatch("team_id",e);return(0,T.useEffect)(()=>{if(u&&s){let e=s.find(e=>e.team_id===u)??null;e&&e.team_id!==n?.team_id&&l(e)}},[u,s,n?.team_id]),(0,T.useEffect)(()=>{r&&a&&t&&n?(0,EO.fetchTeamModels)(r,a,t,n.team_id).then(e=>{o(Array.from(new Set([...n.models??[],...e])))}):o([])},[n,t,r,a]),(0,_.jsxs)(H.Form,{form:e,layout:"vertical",name:"project_form",initialValues:{isBlocked:!1},style:{marginTop:24},children:[(0,_.jsx)(V.Typography.Text,{strong:!0,style:{fontSize:13,color:"#374151",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Basic Information"}),(0,_.jsx)(eG.Divider,{style:{marginTop:8,marginBottom:16}}),(0,_.jsxs)(wl.Row,{gutter:24,children:[(0,_.jsx)(wi.Col,{span:12,children:(0,_.jsx)(H.Form.Item,{name:"project_alias",label:"Project Name",rules:[{required:!0,message:"Please enter a project name"}],children:(0,_.jsx)($.Input,{placeholder:"e.g. Customer Support Bot"})})}),(0,_.jsx)(wi.Col,{span:12,children:(0,_.jsx)(H.Form.Item,{name:"team_id",label:"Team",rules:[{required:!0,message:"Please select a team"}],children:(0,_.jsx)(eE.Select,{showSearch:!0,placeholder:"Search or select a team",onChange:t=>{l(s?.find(e=>e.team_id===t)??null),e.setFieldValue("models",[])},allowClear:!0,optionLabelProp:"label",filterOption:(e,t)=>{let r=s?.find(e=>e.team_id===t?.value);if(!r)return!1;let a=e.toLowerCase().trim();return(r.team_alias||"").toLowerCase().includes(a)||r.team_id.toLowerCase().includes(a)},children:s?.map(e=>(0,_.jsxs)(eE.Select.Option,{value:e.team_id,label:e.team_alias||e.team_id,children:[(0,_.jsx)("span",{style:{fontWeight:500},children:e.team_alias})," ",(0,_.jsxs)("span",{style:{color:"#9ca3af"},children:["(",e.team_id,")"]})]},e.team_id))})})})]}),(0,_.jsx)(wl.Row,{children:(0,_.jsx)(wi.Col,{span:24,children:(0,_.jsx)(H.Form.Item,{name:"description",label:"Description",children:(0,_.jsx)($.Input.TextArea,{placeholder:"Describe the purpose of this project",rows:3})})})}),(0,_.jsx)(wl.Row,{children:(0,_.jsx)(wi.Col,{span:24,children:(0,_.jsx)(H.Form.Item,{name:"models",label:"Allowed Models (scoped to selected team's models)",help:n?void 0:"Select a team first to see available models",children:(0,_.jsxs)(eE.Select,{mode:"multiple",placeholder:n?"Select models":"Select a team first",disabled:!n,allowClear:!0,maxTagCount:"responsive",onChange:t=>{t.includes("all-team-models")&&e.setFieldsValue({models:["all-team-models"]})},children:[(0,_.jsx)(eE.Select.Option,{value:"all-team-models",children:"All Team Models"},"all-team-models"),i.map(e=>(0,_.jsx)(eE.Select.Option,{value:e,children:(0,tQ.getModelDisplayName)(e)},e))]})})})}),(0,_.jsx)(wl.Row,{gutter:24,children:(0,_.jsx)(wi.Col,{span:12,children:(0,_.jsx)(H.Form.Item,{name:"max_budget",label:"Max Budget (USD)",children:(0,_.jsx)(tq.InputNumber,{prefix:"$",style:{width:"100%"},placeholder:"0.00",min:0,precision:2})})})}),(0,_.jsx)(wl.Row,{children:(0,_.jsx)(wi.Col,{span:24,children:(0,_.jsx)(tl.Collapse,{ghost:!0,style:{background:"#f9fafb",borderRadius:8,border:"1px solid #e5e7eb"},items:[{key:"1",label:(0,_.jsx)(V.Typography.Text,{strong:!0,style:{color:"#374151"},children:"Advanced Settings"}),children:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(tg.Flex,{align:"center",gap:12,children:[(0,_.jsx)(V.Typography.Text,{strong:!0,children:"Block Project"}),(0,_.jsx)(H.Form.Item,{name:"isBlocked",valuePropName:"checked",noStyle:!0,children:(0,_.jsx)(e_.Switch,{})})]}),(0,_.jsx)(H.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.isBlocked!==t.isBlocked,children:({getFieldValue:e})=>e("isBlocked")?(0,_.jsx)(B.Alert,{banner:!0,type:"warning",showIcon:!0,message:"All API requests using keys under this project will be rejected.",style:{marginTop:12}}):null}),(0,_.jsx)(eG.Divider,{}),(0,_.jsx)(H.Form.Item,{label:"Guardrails",name:"guardrails",help:"Select existing guardrails or enter new ones",children:(0,_.jsx)(eE.Select,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:d.map(e=>({value:e,label:e}))})}),(0,_.jsx)(eG.Divider,{}),(0,_.jsx)(V.Typography.Text,{strong:!0,style:{display:"block",marginBottom:12},children:"Model-Specific Limits"}),(0,_.jsx)(H.Form.List,{name:"modelLimits",children:(t,{add:r,remove:a})=>(0,_.jsxs)(_.Fragment,{children:[t.map(({key:t,name:r,...s})=>(0,_.jsxs)(U.Space,{style:{display:"flex",marginBottom:8},align:"baseline",children:[(0,_.jsx)(H.Form.Item,{...s,name:[r,"model"],rules:[{required:!0,message:"Missing model"},{validator:(t,r)=>r&&(e.getFieldValue("modelLimits")??[]).filter(e=>e?.model===r).length>1?Promise.reject(Error("Duplicate model")):Promise.resolve()}],children:(0,_.jsx)($.Input,{placeholder:"Model name (e.g. gpt-4)"})}),(0,_.jsx)(H.Form.Item,{...s,name:[r,"tpm"],children:(0,_.jsx)(tq.InputNumber,{placeholder:"TPM Limit",min:0})}),(0,_.jsx)(H.Form.Item,{...s,name:[r,"rpm"],children:(0,_.jsx)(tq.InputNumber,{placeholder:"RPM Limit",min:0})}),(0,_.jsx)(t0.MinusCircleOutlined,{onClick:()=>a(r),style:{color:"#ef4444"}})]},t)),(0,_.jsx)(H.Form.Item,{children:(0,_.jsx)(z.Button,{type:"dashed",onClick:()=>r(),block:!0,icon:(0,_.jsx)(tZ.PlusOutlined,{}),children:"Add Model Limit"})})]})}),(0,_.jsx)(eG.Divider,{}),(0,_.jsx)(V.Typography.Text,{strong:!0,style:{display:"block",marginBottom:12},children:"Metadata"}),(0,_.jsx)(H.Form.List,{name:"metadata",children:(t,{add:r,remove:a})=>(0,_.jsxs)(_.Fragment,{children:[t.map(({key:t,name:r,...s})=>(0,_.jsxs)(U.Space,{style:{display:"flex",marginBottom:8},align:"baseline",children:[(0,_.jsx)(H.Form.Item,{...s,name:[r,"key"],rules:[{required:!0,message:"Missing key"},{validator:(t,r)=>r&&(e.getFieldValue("metadata")??[]).filter(e=>e?.key===r).length>1?Promise.reject(Error("Duplicate key")):Promise.resolve()}],children:(0,_.jsx)($.Input,{placeholder:"Key"})}),(0,_.jsx)(H.Form.Item,{...s,name:[r,"value"],rules:[{required:!0,message:"Missing value"}],children:(0,_.jsx)($.Input,{placeholder:"Value"})}),(0,_.jsx)(t0.MinusCircleOutlined,{onClick:()=>a(r),style:{color:"#ef4444"}})]},t)),(0,_.jsx)(H.Form.Item,{children:(0,_.jsx)(z.Button,{type:"dashed",onClick:()=>r(),block:!0,icon:(0,_.jsx)(tZ.PlusOutlined,{}),children:"Add Key-Value Pair"})})]})})]})}]})})})]})}function YG(e){let t={},r={};for(let a of e.modelLimits??[])a.model&&(null!=a.rpm&&(t[a.model]=a.rpm),null!=a.tpm&&(r[a.model]=a.tpm));let a={};for(let t of e.metadata??[])t.key&&(a[t.key]=t.value);return{project_alias:e.project_alias,description:e.description,models:e.models??[],max_budget:e.max_budget,blocked:e.isBlocked??!1,...e.guardrails&&e.guardrails.length>0&&{guardrails:e.guardrails},...Object.keys(t).length>0&&{model_rpm_limit:t},...Object.keys(r).length>0&&{model_tpm_limit:r},...Object.keys(a).length>0&&{metadata:a}}}function YK({isOpen:e,onClose:t}){let[r]=H.Form.useForm(),a=(()=>{let{accessToken:e}=(0,k.default)(),t=(0,eh.useQueryClient)();return(0,ep.useMutation)({mutationFn:async t=>{if(!e)throw Error("Access token is required");return YW(e,t)},onSuccess:()=>{t.invalidateQueries({queryKey:Y$.projectKeys.all})}})})(),s=async()=>{try{let e=await r.validateFields(),s={...YG(e),team_id:e.team_id};a.mutate(s,{onSuccess:()=>{tU.default.success("Project created successfully"),r.resetFields(),t()},onError:e=>{tU.default.error(e.message||"Failed to create project")}})}catch(e){console.error("Validation failed:",e)}},n=()=>{r.resetFields(),t()};return(0,_.jsx)(q.Modal,{title:(0,_.jsx)(V.Typography.Text,{strong:!0,style:{fontSize:18},children:"Create New Project"}),open:e,onCancel:n,width:720,destroyOnHidden:!0,footer:[(0,_.jsx)(z.Button,{onClick:n,children:"Cancel"},"cancel"),(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(YU,{}),loading:a.isPending,onClick:s,children:"Create Project"},"submit")],children:(0,_.jsx)(YV,{form:r})})}let YJ=async(e,t)=>{let r=(0,Q.getProxyBaseUrl)(),a=`${r}/project/info?project_id=${encodeURIComponent(t)}`,s=await fetch(a,{method:"GET",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!s.ok){let e=await s.json(),t=(0,td.deriveErrorMessage)(e);throw(0,Q.handleError)(t),Error(t)}return s.json()};var PW=PW;let YQ=(0,eT.default)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);var Eg=Eg;let YX=async(e,t,r)=>{let a=(0,Q.getProxyBaseUrl)(),s=`${a}/project/update`,n=await fetch(s,{method:"POST",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({project_id:t,...r})});if(!n.ok){let e=await n.json(),t=(0,td.deriveErrorMessage)(e);throw(0,Q.handleError)(t),Error(t)}return n.json()};function YZ({isOpen:e,project:t,onClose:r,onSuccess:a}){let[s]=H.Form.useForm(),n=(()=>{let{accessToken:e}=(0,k.default)(),t=(0,eh.useQueryClient)();return(0,ep.useMutation)({mutationFn:async({projectId:t,params:r})=>{if(!e)throw Error("Access token is required");return YX(e,t,r)},onSuccess:()=>{t.invalidateQueries({queryKey:Y$.projectKeys.all})}})})();(0,T.useEffect)(()=>{if(e&&t){let e=t.metadata??{},r=e.model_rpm_limit??{},a=e.model_tpm_limit??{},n=Array.isArray(e.guardrails)?e.guardrails:[],l=[];for(let e of new Set([...Object.keys(r),...Object.keys(a)]))l.push({model:e,rpm:r[e],tpm:a[e]});let i=new Set(["model_rpm_limit","model_tpm_limit","guardrails"]),o=[];for(let[t,r]of Object.entries(e))i.has(t)||o.push({key:t,value:String(r)});s.setFieldsValue({project_alias:t.project_alias??"",team_id:t.team_id??"",description:t.description??"",models:t.models??[],max_budget:t.litellm_budget_table?.max_budget??void 0,isBlocked:t.blocked,guardrails:n.length>0?n:void 0,modelLimits:l.length>0?l:void 0,metadata:o.length>0?o:void 0})}},[e,t,s]);let l=async()=>{try{let e=await s.validateFields(),l={...YG(e),team_id:e.team_id};n.mutate({projectId:t.project_id,params:l},{onSuccess:()=>{tU.default.success("Project updated successfully"),a?.(),r()},onError:e=>{tU.default.error(e.message||"Failed to update project")}})}catch(e){console.error("Validation failed:",e)}};return(0,_.jsx)(q.Modal,{title:(0,_.jsx)(V.Typography.Text,{strong:!0,style:{fontSize:18},children:"Edit Project"}),open:e,onCancel:r,width:720,destroyOnHidden:!0,footer:[(0,_.jsx)(z.Button,{onClick:r,children:"Cancel"},"cancel"),(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(MC.SaveOutlined,{}),loading:n.isPending,onClick:l,children:"Save Changes"},"submit")],children:(0,_.jsx)(YV,{form:s})})}let{Title:Y0,Text:Y1}=V.Typography,{Content:Y2}=Ep.Layout;function Y4({projectId:e,onBack:t}){let r,a,s,n,{data:l,isLoading:i}=(e=>{let{accessToken:t,userRole:r}=(0,k.default)(),a=(0,eh.useQueryClient)();return(0,ev.useQuery)({queryKey:Y$.projectKeys.detail(e),queryFn:async()=>YJ(t,e),enabled:!!(t&&e)&&ts.all_admin_roles.includes(r||""),initialData:()=>{if(!e)return;let t=a.getQueryData(Y$.projectKeys.list({}));return t?.find(t=>t.project_id===e)}})})(e),{data:o}=(0,jY.useTeam)(l?.team_id??void 0),d=o?.team_info??o,{token:c}=Ef.theme.useToken(),[u,m]=(0,T.useState)(!1),p=l?.spend??0,h=l?.litellm_budget_table?.max_budget??null,f=null!=h&&h>0,x=f?Math.min(p/h*100,100):0,g=(0,T.useMemo)(()=>Object.entries(l?.model_spend??{}).map(([e,t])=>({model:e,spend:t})).sort((e,t)=>t.spend-e.spend),[l?.model_spend]);return i?(0,_.jsx)(Y2,{style:{padding:c.paddingLG,paddingInline:2*c.paddingLG},children:(0,_.jsx)(tg.Flex,{justify:"center",align:"center",style:{minHeight:300},children:(0,_.jsx)(rm.Spin,{indicator:(0,_.jsx)(wo.LoadingOutlined,{spin:!0}),size:"large"})})}):l?(0,_.jsxs)(Y2,{style:{padding:c.paddingLG,paddingInline:2*c.paddingLG},children:[(0,_.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:24},children:[(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16},children:[(0,_.jsx)(z.Button,{icon:(0,_.jsx)(EK,{size:16}),onClick:t,type:"text"}),(0,_.jsxs)("div",{children:[(0,_.jsxs)(tg.Flex,{align:"center",gap:8,children:[(0,_.jsx)(Y0,{level:2,style:{margin:0},children:l.project_alias??l.project_id}),(0,_.jsx)(eN.Tag,{color:l.blocked?"red":"green",children:l.blocked?"Blocked":"Active"})]}),(0,_.jsxs)(Y1,{type:"secondary",children:["ID: ",(0,_.jsx)(Y1,{copyable:!0,children:l.project_id})]})]})]}),(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(eM,{size:16}),onClick:()=>m(!0),children:"Edit Project"})]}),(0,_.jsx)(wl.Row,{style:{marginBottom:24},children:(0,_.jsx)(eg.Card,{children:(0,_.jsxs)(eS.Descriptions,{title:"Project Details",column:1,children:[(0,_.jsx)(eS.Descriptions.Item,{label:"Description",children:l.description||"—"}),(0,_.jsxs)(eS.Descriptions.Item,{label:"Created",children:[new Date(l.created_at).toLocaleString(),l.created_by&&(0,_.jsxs)(Y1,{children:[" ","by"," ",(0,_.jsx)(YT.default,{userId:l.created_by})]})]}),(0,_.jsxs)(eS.Descriptions.Item,{label:"Last Updated",children:[new Date(l.updated_at).toLocaleString(),l.updated_by&&(0,_.jsxs)(Y1,{children:[" ","by"," ",(0,_.jsx)(YT.default,{userId:l.updated_by})]})]})]})})}),(0,_.jsxs)(wl.Row,{gutter:[16,16],style:{marginBottom:24},children:[(0,_.jsx)(wi.Col,{xs:24,lg:8,children:(0,_.jsx)(eg.Card,{title:(0,_.jsxs)(tg.Flex,{align:"center",gap:8,children:[(0,_.jsx)(YQ,{size:16}),"Budget"]}),style:{height:"100%"},children:(0,_.jsxs)(tg.Flex,{vertical:!0,gap:16,children:[(0,_.jsxs)("div",{children:[(0,_.jsxs)(Y1,{strong:!0,style:{fontSize:28,lineHeight:1},children:["$",p.toFixed(2)]}),(0,_.jsx)("br",{}),(0,_.jsx)(Y1,{type:"secondary",children:f?`of $${h.toFixed(2)} budget`:"No budget limit"})]}),f&&(0,_.jsxs)("div",{children:[(0,_.jsx)(PW.default,{percent:Math.round(10*x)/10,strokeColor:x>=90?"#f5222d":x>=70?"#faad14":"#52c41a",showInfo:!1}),(0,_.jsxs)(Y1,{type:"secondary",style:{fontSize:12},children:[(Math.round(10*x)/10).toFixed(1),"% utilized"]})]})]})})}),(0,_.jsx)(wi.Col,{xs:24,lg:16,children:(0,_.jsx)(eg.Card,{title:"Spend by Model",style:{height:"100%"},children:g.length>0?(0,_.jsx)(yn,{data:g,index:"model",categories:["spend"],colors:["cyan"],layout:"vertical",valueFormatter:e=>`$${e.toFixed(4)}`,yAxisWidth:140,showLegend:!1,style:{height:Math.max(40*g.length,120)}}):(0,_.jsx)(e0.Empty,{description:"No model spend recorded yet",image:e0.Empty.PRESENTED_IMAGE_SIMPLE})})})]}),(0,_.jsxs)(wl.Row,{gutter:[16,16],style:{marginBottom:24},children:[(0,_.jsx)(wi.Col,{xs:24,lg:12,children:(0,_.jsx)(eg.Card,{title:(0,_.jsxs)(tg.Flex,{align:"center",gap:8,children:[(0,_.jsx)(Cm,{size:16}),"Keys"]}),style:{height:"100%"},children:(0,_.jsx)(e0.Empty,{description:"No keys to display",image:e0.Empty.PRESENTED_IMAGE_SIMPLE})})}),(0,_.jsx)(wi.Col,{xs:24,lg:12,children:(0,_.jsx)(eg.Card,{title:(0,_.jsxs)(tg.Flex,{align:"center",gap:8,children:[(0,_.jsx)(Eg.default,{size:16}),"Team"]}),style:{height:"100%"},children:d?(r=d.max_budget??null,a=d.spend??0,n=(s=null!=r&&r>0)?Math.min(a/r*100,100):0,(0,_.jsxs)(tg.Flex,{vertical:!0,gap:12,children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Y1,{strong:!0,style:{fontSize:16},children:d.team_alias||d.team_id}),(0,_.jsx)("br",{}),(0,_.jsxs)(Y1,{type:"secondary",style:{fontSize:12},children:["ID:"," ",(0,_.jsx)(Y1,{copyable:!0,style:{fontSize:12},children:d.team_id})]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Y1,{type:"secondary",style:{fontSize:12,display:"block",marginBottom:4},children:"Models"}),(d.models?.length??0)>0?(0,_.jsx)(tg.Flex,{wrap:"wrap",gap:4,style:{maxHeight:60,overflow:"hidden"},children:d.models?.map(e=>(0,_.jsx)(eN.Tag,{style:{margin:0},children:e},e))}):(0,_.jsx)(Y1,{type:"secondary",children:"All models"})]}),(0,_.jsxs)("div",{children:[(0,_.jsxs)(tg.Flex,{justify:"space-between",align:"center",style:{marginBottom:2},children:[(0,_.jsx)(Y1,{type:"secondary",style:{fontSize:12},children:"Spend"}),(0,_.jsxs)(Y1,{style:{fontSize:12},children:["$",a.toFixed(2),s?(0,_.jsxs)(Y1,{type:"secondary",style:{fontSize:12},children:[" ","/ $",r.toFixed(2)]}):(0,_.jsxs)(Y1,{type:"secondary",style:{fontSize:12},children:[" ","(Unlimited)"]})]})]}),s&&(0,_.jsx)(PW.default,{percent:Math.round(10*n)/10,strokeColor:n>=90?"#f5222d":n>=70?"#faad14":"#52c41a",size:"small",showInfo:!1})]}),(0,_.jsxs)(tg.Flex,{justify:"space-between",children:[(0,_.jsx)(Y1,{type:"secondary",style:{fontSize:12},children:"Members"}),(0,_.jsx)(Y1,{style:{fontSize:12},children:d.members_with_roles?.length??0})]})]})):l.team_id?(0,_.jsx)(tg.Flex,{justify:"center",align:"center",style:{padding:16},children:(0,_.jsx)(rm.Spin,{indicator:(0,_.jsx)(wo.LoadingOutlined,{spin:!0}),size:"small"})}):(0,_.jsx)(e0.Empty,{description:"No team assigned",image:e0.Empty.PRESENTED_IMAGE_SIMPLE})})})]}),(0,_.jsx)(YZ,{isOpen:u,project:l,onClose:()=>m(!1)})]}):(0,_.jsxs)(Y2,{style:{padding:c.paddingLG,paddingInline:2*c.paddingLG},children:[(0,_.jsx)(z.Button,{icon:(0,_.jsx)(EK,{size:16}),onClick:t,type:"text",style:{marginBottom:16}}),(0,_.jsx)(e0.Empty,{description:"Project not found"})]})}let{Title:Y5,Text:Y6}=V.Typography,{Content:Y3}=Ep.Layout;function Y8(){let{token:e}=Ef.theme.useToken(),{data:t,isLoading:r}=(0,Y$.useProjects)(),{data:a,isLoading:s}=(0,jY.useTeams)(),[n,l]=(0,T.useState)(null),[i,o]=(0,T.useState)(!1),[d,c]=(0,T.useState)(""),[u,m]=(0,T.useState)(1);(0,T.useEffect)(()=>{m(1)},[d]);let p=(0,T.useMemo)(()=>{let e=new Map;for(let t of a??[])e.set(t.team_id,t.team_alias??t.team_id);return e},[a]),h=(0,T.useMemo)(()=>{let e=t??[];if(!d)return e;let r=d.toLowerCase();return e.filter(e=>{let t=p.get(e.team_id??"")??"";return(e.project_alias??"").toLowerCase().includes(r)||e.project_id.toLowerCase().includes(r)||(e.description??"").toLowerCase().includes(r)||t.toLowerCase().includes(r)})},[t,d,p]),f=[{title:"ID",dataIndex:"project_id",key:"project_id",width:170,render:e=>(0,_.jsx)(tB.Tooltip,{title:e,children:(0,_.jsx)(Y6,{ellipsis:!0,className:"text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs cursor-pointer",style:{fontSize:14,padding:"1px 8px"},onClick:()=>l(e),children:e})})},{title:"Name",dataIndex:"project_alias",key:"project_alias",sorter:(e,t)=>(e.project_alias??"").localeCompare(t.project_alias??""),render:e=>e??"—"},{title:"Team",key:"team",sorter:(e,t)=>{let r=p.get(e.team_id??"")??"",a=p.get(t.team_id??"")??"";return r.localeCompare(a)},render:(e,t)=>{if(!t.team_id)return"—";let r=p.get(t.team_id);return r||(s?(0,_.jsx)(rm.Spin,{indicator:(0,_.jsx)(wo.LoadingOutlined,{spin:!0}),size:"small"}):t.team_id)}},{title:"Models",key:"models",render:(e,t)=>{let r=t.models??[];return(0,_.jsx)(tB.Tooltip,{title:r.length>0?r.join(", "):"No models",children:(0,_.jsx)(eN.Tag,{color:"blue",style:{fontSize:14,padding:"2px 8px",margin:0},children:(0,_.jsxs)(tg.Flex,{align:"center",gap:6,children:[(0,_.jsx)(Ex,{size:14}),r.length]})})})}},{title:"Status",dataIndex:"blocked",key:"status",render:e=>(0,_.jsx)(eN.Tag,{color:e?"red":"green",children:e?"Blocked":"Active"})},{title:"Created",dataIndex:"created_at",key:"created_at",sorter:(e,t)=>new Date(e.created_at).getTime()-new Date(t.created_at).getTime(),responsive:["lg"],render:e=>new Date(e).toLocaleDateString()},{title:"Updated",dataIndex:"updated_at",key:"updated_at",responsive:["xl"],render:e=>new Date(e).toLocaleDateString()}];return n?(0,_.jsx)(Y4,{projectId:n,onBack:()=>l(null)}):(0,_.jsxs)(Y3,{style:{padding:e.paddingLG,paddingInline:2*e.paddingLG},children:[(0,_.jsxs)(tg.Flex,{justify:"space-between",align:"center",style:{marginBottom:16},children:[(0,_.jsxs)(U.Space,{direction:"vertical",size:0,children:[(0,_.jsx)(Y5,{level:2,style:{margin:0},children:"Projects"}),(0,_.jsx)(Y6,{type:"secondary",children:"Manage projects within your teams"})]}),(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(tZ.PlusOutlined,{}),onClick:()=>o(!0),children:"Create Project"})]}),(0,_.jsxs)(eg.Card,{styles:{body:{padding:0}},children:[(0,_.jsxs)(tg.Flex,{justify:"space-between",align:"center",style:{padding:"12px 16px"},children:[(0,_.jsx)($.Input,{prefix:(0,_.jsx)(Cl.default,{size:16}),placeholder:"Search projects by name, ID, description, or team...",style:{maxWidth:400},value:d,onChange:e=>c(e.target.value),allowClear:!0}),(0,_.jsx)(Eh.default,{current:u,total:h.length,pageSize:10,onChange:e=>m(e),size:"small",showTotal:e=>`${e} projects`,showSizeChanger:!1})]}),(0,_.jsx)(eK.Table,{columns:f,dataSource:h.slice((u-1)*10,10*u),rowKey:"project_id",loading:r,pagination:!1})]}),(0,_.jsx)(YK,{isOpen:i,onClose:()=>o(!1)})]})}let Y7=({data:e,onView:t,onEdit:r,onDelete:a})=>{let[s,n]=T.default.useState([{id:"created_at",desc:!0}]),l=[{header:"Vector Store ID",accessorKey:"vector_store_id",cell:({row:e})=>{let r=e.original;return(0,_.jsx)("button",{onClick:()=>t(r.vector_store_id),className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",children:r.vector_store_id.length>15?`${r.vector_store_id.slice(0,15)}...`:r.vector_store_id})}},{header:"Name",accessorKey:"vector_store_name",cell:({row:e})=>{let t=e.original;return(0,_.jsx)(tB.Tooltip,{title:t.vector_store_name,children:(0,_.jsx)("span",{className:"text-xs",children:t.vector_store_name||"-"})})}},{header:"Description",accessorKey:"vector_store_description",cell:({row:e})=>{let t=e.original;return(0,_.jsx)(tB.Tooltip,{title:t.vector_store_description,children:(0,_.jsx)("span",{className:"text-xs",children:t.vector_store_description||"-"})})}},{header:"Files",accessorKey:"vector_store_metadata",cell:({row:e})=>{let t=e.original,r=t.vector_store_metadata?.ingested_files||[];if(0===r.length)return(0,_.jsx)("span",{className:"text-xs text-gray-400",children:"-"});let a=r.map(e=>e.filename||e.file_url||"Unknown").join(", "),s=1===r.length?r[0].filename||r[0].file_url||"1 file":`${r.length} files`;return(0,_.jsx)(tB.Tooltip,{title:a,children:(0,_.jsx)("span",{className:"text-xs text-blue-600",children:s})})}},{header:"Provider",accessorKey:"custom_llm_provider",cell:({row:e})=>{let t=e.original,{displayName:r,logo:a}=(0,j$.getProviderLogoAndName)(t.custom_llm_provider);return(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[a&&(0,_.jsx)("img",{src:a,alt:r,className:"h-4 w-4"}),(0,_.jsx)("span",{className:"text-xs",children:r})]})}},{header:"Created At",accessorKey:"created_at",sortingFn:"datetime",cell:({row:e})=>{let t=e.original;return(0,_.jsx)("span",{className:"text-xs",children:new Date(t.created_at).toLocaleDateString()})}},{header:"Updated At",accessorKey:"updated_at",sortingFn:"datetime",cell:({row:e})=>{let t=e.original;return(0,_.jsx)("span",{className:"text-xs",children:new Date(t.updated_at).toLocaleDateString()})}},{id:"actions",header:"",cell:({row:e})=>{let t=e.original;return(0,_.jsxs)("div",{className:"flex space-x-2",children:[(0,_.jsx)(rG.default,{variant:"Edit",tooltipText:"Edit vector store",onClick:()=>r(t.vector_store_id)}),(0,_.jsx)(rG.default,{variant:"Delete",tooltipText:"Delete vector store",onClick:()=>a(t.vector_store_id)})]})}}],i=(0,jD.useReactTable)({data:e,columns:l,state:{sorting:s},onSortingChange:n,getCoreRowModel:(0,jP.getCoreRowModel)(),getSortedRowModel:(0,jP.getSortedRowModel)(),enableSorting:!0});return(0,_.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,_.jsx)("div",{className:"overflow-x-auto",children:(0,_.jsxs)(A.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,_.jsx)(Y.TableHead,{children:i.getHeaderGroups().map(e=>(0,_.jsx)(R.TableRow,{children:e.headers.map(e=>(0,_.jsx)(F.TableHeaderCell,{className:`py-1 h-8 ${"actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""}`,onClick:e.column.getToggleSortingHandler(),children:(0,_.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,_.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,jD.flexRender)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,_.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,_.jsx)(jC.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,_.jsx)(jM.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,_.jsx)(jL.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,_.jsx)(E.TableBody,{children:i.getRowModel().rows.length>0?i.getRowModel().rows.map(e=>(0,_.jsx)(R.TableRow,{className:"h-8",children:e.getVisibleCells().map(e=>(0,_.jsx)(I.TableCell,{className:`py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ${"actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""}`,children:(0,jD.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:l.length,className:"h-8 text-center",children:(0,_.jsx)("div",{className:"text-center text-gray-500",children:(0,_.jsx)("p",{children:"No vector stores found"})})})})})]})})})};var Y9=((c={}).Bedrock="Amazon Bedrock",c.S3Vectors="Amazon S3 Vectors",c.PgVector="PostgreSQL pgvector (LiteLLM Connector)",c.VertexRagEngine="Vertex AI RAG Engine",c.VertexAiSearch="Vertex AI Search",c.OpenAI="OpenAI",c.Azure="Azure OpenAI",c.Milvus="Milvus",c);let Fe={Bedrock:"bedrock",PgVector:"pg_vector",VertexRagEngine:"vertex_ai",VertexAiSearch:"vertex_ai/search_api",OpenAI:"openai",Azure:"azure",Milvus:"milvus",S3Vectors:"s3_vectors"},Ft="../ui/assets/logos/",Fr={"Amazon Bedrock":`${Ft}bedrock.svg`,"PostgreSQL pgvector (LiteLLM Connector)":`${Ft}postgresql.svg`,"Vertex AI RAG Engine":`${Ft}google.svg`,"Vertex AI Search":`${Ft}google.svg`,OpenAI:`${Ft}openai_small.svg`,"Azure OpenAI":`${Ft}microsoft_azure.svg`,Milvus:`${Ft}milvus.svg`,"Amazon S3 Vectors":`${Ft}s3_vector.png`},Fa={bedrock:[],pg_vector:[{name:"api_base",label:"API Base",tooltip:"Enter the base URL of your deployed litellm-pgvector server (e.g., http://your-server:8000)",placeholder:"http://your-deployed-server:8000",required:!0,type:"text"},{name:"api_key",label:"API Key",tooltip:"Enter the API key from your deployed litellm-pgvector server",placeholder:"your-deployed-api-key",required:!0,type:"password"}],vertex_rag_engine:[],"vertex_ai/search_api":[{name:"vertex_project",label:"Vertex Project",tooltip:"Google Cloud project ID that hosts the Vertex AI Search data store.",placeholder:"my-gcp-project-id",required:!0,type:"text"},{name:"vertex_location",label:"Vertex Location",tooltip:"Vertex AI Search data store location. Must be one of global, us, or eu.",required:!0,type:"select",options:[{value:"global",label:"global"},{value:"us",label:"us"},{value:"eu",label:"eu"}],initialValue:"global"},{name:"vertex_collection_id",label:"Collection ID (optional)",tooltip:"Discovery Engine collection ID. Leave blank to use the default collection.",placeholder:"e.g. my-custom-collection",required:!1,type:"text"},{name:"vertex_engine_id",label:"Engine ID (optional)",tooltip:"Search app (engine) ID. Required for website, healthcare, and connector-based data stores (Workspace, Slack, Jira, etc.) because these sources route search through an engine. Leave blank to query the data store directly.",placeholder:"e.g. my-search-app_1234567890",required:!1,type:"text"}],openai:[{name:"api_key",label:"API Key",tooltip:"Enter your OpenAI API key",placeholder:"sk-...",required:!0,type:"password"}],azure:[{name:"api_key",label:"API Key",tooltip:"Enter your Azure OpenAI API key",placeholder:"your-azure-api-key",required:!0,type:"password"},{name:"api_base",label:"API Base",tooltip:"Enter your Azure OpenAI endpoint (e.g., https://your-resource.openai.azure.com/)",placeholder:"https://your-resource.openai.azure.com/",required:!0,type:"text"}],milvus:[{name:"api_key",label:"API Key",tooltip:"To obtain a token, you should use a colon (:) to concatenate the username and password that you use to access your Milvus instance (e.g., username:password)",placeholder:"username:password or api key",required:!0,type:"password"},{name:"api_base",label:"API Base",tooltip:"Enter your Milvus endpoint (e.g., https://your-milvus-endpoint.com/)",placeholder:"https://your-milvus-endpoint.com/",required:!0,type:"text"},{name:"embedding_model",label:"Embedding Model",tooltip:"Select the embedding model to use",placeholder:"text-embedding-3-small",required:!0,type:"select"}],s3_vectors:[{name:"vector_bucket_name",label:"Vector Bucket Name",tooltip:"S3 bucket name for vector storage (will be auto-created if it doesn't exist)",placeholder:"my-vector-bucket",required:!0,type:"text"},{name:"index_name",label:"Index Name",tooltip:"Name for the vector index (optional, will be auto-generated if not provided)",placeholder:"my-vector-index",required:!1,type:"text"},{name:"aws_region_name",label:"AWS Region",tooltip:"AWS region where the S3 bucket is located (e.g., us-west-2)",placeholder:"us-west-2",required:!0,type:"text"},{name:"embedding_model",label:"Embedding Model",tooltip:"Select the embedding model to use for vector generation",placeholder:"text-embedding-3-small",required:!0,type:"select"}]},Fs=e=>Fa[e]||[],Fn=({isVisible:e,onCancel:t,onSuccess:r,accessToken:a,credentials:s})=>{let[n]=H.Form.useForm(),[l,i]=(0,T.useState)("{}"),[o,d]=(0,T.useState)("bedrock"),[c,u]=(0,T.useState)([]),m=H.Form.useWatch("vertex_engine_id",n);(0,T.useEffect)(()=>{a&&(async()=>{try{let e=await (0,jh.fetchAvailableModels)(a);e.length>0&&u(e)}catch(e){console.error("Error fetching model info:",e)}})()},[a]);let p=async e=>{if(a)try{let t={};try{t=l.trim()?JSON.parse(l):{}}catch(e){J.default.fromBackend("Invalid JSON in metadata field");return}let s={vector_store_id:e.vector_store_id,custom_llm_provider:e.custom_llm_provider,vector_store_name:e.vector_store_name,vector_store_description:e.vector_store_description,vector_store_metadata:t,litellm_credential_name:e.litellm_credential_name};s.litellm_params=Fs(e.custom_llm_provider).reduce((t,r)=>("milvus"===e.custom_llm_provider&&"embedding_model"===r.name?t.litellm_embedding_model=e[r.name]:t[r.name]=e[r.name],t),{}),await (0,Q.vectorStoreCreateCall)(a,s),J.default.success("Vector store created successfully"),n.resetFields(),i("{}"),r()}catch(e){console.error("Error creating vector store:",e),J.default.fromBackend("Error creating vector store: "+e)}},h=()=>{n.resetFields(),i("{}"),d("bedrock"),t()};return(0,_.jsx)(q.Modal,{title:"Add New Vector Store",open:e,width:1e3,footer:null,onCancel:h,children:(0,_.jsxs)(H.Form,{form:n,onFinish:p,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Provider"," ",(0,_.jsx)(tB.Tooltip,{title:"Select the provider for this vector store",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"custom_llm_provider",rules:[{required:!0,message:"Please select a provider"}],initialValue:"bedrock",children:(0,_.jsx)(eE.Select,{onChange:e=>d(e),children:Object.entries(Y9).map(([e,t])=>(0,_.jsx)(eE.Select.Option,{value:Fe[e],children:(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)("img",{src:Fr[t],alt:`${e} logo`,className:"w-5 h-5",onError:e=>{let r=e.target,a=r.parentElement;if(a){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),a.replaceChild(e,r)}}}),(0,_.jsx)("span",{children:t})]})},e))})}),"pg_vector"===o&&(0,_.jsx)(B.Alert,{message:"PG Vector Setup Required",description:(0,_.jsxs)("div",{children:[(0,_.jsx)("p",{children:"LiteLLM provides a server to connect to PG Vector. To use this provider:"}),(0,_.jsxs)("ol",{style:{marginLeft:"16px",marginTop:"8px"},children:[(0,_.jsxs)("li",{children:["Deploy the litellm-pgvector server from:"," ",(0,_.jsx)("a",{href:"https://github.com/BerriAI/litellm-pgvector",target:"_blank",rel:"noopener noreferrer",children:"https://github.com/BerriAI/litellm-pgvector"})]}),(0,_.jsx)("li",{children:"Configure your PostgreSQL database with pgvector extension"}),(0,_.jsx)("li",{children:"Start the server and note the API base URL and API key"}),(0,_.jsx)("li",{children:"Enter those details in the fields below"})]})]}),type:"info",showIcon:!0,style:{marginBottom:"16px"}}),"vertex_rag_engine"===o&&(0,_.jsx)(B.Alert,{message:"Vertex AI RAG Engine Setup",description:(0,_.jsxs)("div",{children:[(0,_.jsx)("p",{children:"To use Vertex AI RAG Engine:"}),(0,_.jsxs)("ol",{style:{marginLeft:"16px",marginTop:"8px"},children:[(0,_.jsxs)("li",{children:["Set up your Vertex AI RAG Engine corpus following the guide:"," ",(0,_.jsx)("a",{href:"https://cloud.google.com/vertex-ai/generative-ai/docs/rag-engine/rag-overview",target:"_blank",rel:"noopener noreferrer",children:"Vertex AI RAG Engine Overview"})]}),(0,_.jsx)("li",{children:"Create a corpus in your Google Cloud project"}),(0,_.jsx)("li",{children:"Note the corpus ID from the Vertex AI console"}),(0,_.jsx)("li",{children:"Enter the corpus ID in the Vector Store ID field below"})]})]}),type:"info",showIcon:!0,style:{marginBottom:"16px"}}),"vertex_ai/search_api"===o&&(0,_.jsx)(B.Alert,{message:"Vertex AI Search Setup",description:(0,_.jsxs)("div",{children:[(0,_.jsx)("p",{children:"To use Vertex AI Search (Discovery Engine):"}),(0,_.jsxs)("ol",{style:{marginLeft:"16px",marginTop:"8px"},children:[(0,_.jsxs)("li",{children:["Enable the Discovery Engine API on your Google Cloud project and create a data store following the guide:"," ",(0,_.jsx)("a",{href:"https://cloud.google.com/generative-ai-app-builder/docs/create-data-store-es",target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"underline"},children:"Create a Vertex AI Search data store"})]}),(0,_.jsx)("li",{children:"Pick a supported location: global, us, or eu"}),(0,_.jsx)("li",{children:"For most data store types (Cloud Storage, BigQuery, Media): copy the data store ID and enter it in the Vector Store ID field below."}),(0,_.jsxs)("li",{children:["For website, healthcare, and connector-based sources (Drive, Gmail, Slack, Jira, etc.): create a search app on top of the data store, then copy the ",(0,_.jsx)("strong",{children:"Engine ID"})," and enter it in the Engine ID field. The Vector Store ID is still required as the LiteLLM-side name for this record, but it isn't used in the GCP URL when Engine ID is set."]})]})]}),type:"info",showIcon:!0,style:{marginBottom:"16px"}}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Vector Store ID"," ",(0,_.jsx)(tB.Tooltip,{title:"Enter the vector store ID from your api provider",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"vector_store_id",rules:[{required:!0,message:"Please input the vector store ID from your api provider"}],children:(0,_.jsx)(et.TextInput,{placeholder:"vertex_rag_engine"===o?"6917529027641081856 (Get corpus ID from Vertex AI console)":"vertex_ai/search_api"===o?m?"Any identifier you'll use to reference this in LiteLLM":"my-datastore_1234567890 (Get data store ID from Vertex AI Search console)":"Enter vector store ID from your provider"})}),Fs(o).map(e=>{if("select"===e.type){let t=e.options??c.filter(e=>"embedding"===e.mode||null===e.mode).map(e=>({value:e.model_group,label:e.model_group}));return(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:[e.label," ",(0,_.jsx)(tB.Tooltip,{title:e.tooltip,children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:e.name,initialValue:e.initialValue,rules:e.required?[{required:!0,message:`Please select the ${e.label.toLowerCase()}`}]:[],children:(0,_.jsx)(eE.Select,{placeholder:e.placeholder,showSearch:!0,filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase()),options:t,style:{width:"100%"}})},e.name)}return(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:[e.label," ",(0,_.jsx)(tB.Tooltip,{title:e.tooltip,children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:e.name,rules:e.required?[{required:!0,message:`Please input the ${e.label.toLowerCase()}`}]:[],children:(0,_.jsx)(et.TextInput,{type:e.type||"text",placeholder:e.placeholder})},e.name)}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Vector Store Name"," ",(0,_.jsx)(tB.Tooltip,{title:"Custom name you want to give to the vector store, this name will be rendered on the LiteLLM UI",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"vector_store_name",children:(0,_.jsx)(et.TextInput,{})}),(0,_.jsx)(H.Form.Item,{label:"Description",name:"vector_store_description",children:(0,_.jsx)($.Input.TextArea,{rows:4})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Existing Credentials"," ",(0,_.jsx)(tB.Tooltip,{title:"Optionally select API provider credentials for this vector store eg. Bedrock API KEY",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"litellm_credential_name",children:(0,_.jsx)(eE.Select,{showSearch:!0,placeholder:"Select or search for existing credentials",optionFilterProp:"children",filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase()),options:[{value:null,label:"None"},...s.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Metadata"," ",(0,_.jsx)(tB.Tooltip,{title:"JSON metadata for the vector store (optional)",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),children:(0,_.jsx)($.Input.TextArea,{rows:4,value:l,onChange:e=>i(e.target.value),placeholder:'{"key": "value"}'})}),(0,_.jsxs)("div",{className:"flex justify-end space-x-3",children:[(0,_.jsx)(S.Button,{onClick:h,variant:"secondary",children:"Cancel"}),(0,_.jsx)(S.Button,{variant:"primary",type:"submit",children:"Create"})]})]})})};var Fl=e.i(84899),Fi=e.i(210612);let{TextArea:Fo}=$.Input,{Text:Fd,Title:Fc}=V.Typography,Fu=({vectorStoreId:e,accessToken:t,className:r=""})=>{let[a,s]=(0,T.useState)(""),[n,l]=(0,T.useState)(!1),[i,o]=(0,T.useState)([]),[d,c]=(0,T.useState)({}),u=async()=>{if(!a.trim())return void tU.default.warning("Please enter a search query");l(!0);try{let r=await (0,Q.vectorStoreSearchCall)(t,e,a),n={query:a,response:r,timestamp:Date.now()};o(e=>[n,...e]),s("")}catch(e){console.error("Error searching vector store:",e),J.default.fromBackend("Failed to search vector store")}finally{l(!1)}};return(0,_.jsx)(eg.Card,{className:"w-full rounded-xl shadow-md",children:(0,_.jsxs)("div",{className:"flex flex-col h-[600px]",children:[(0,_.jsxs)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:[(0,_.jsxs)("div",{className:"flex items-center",children:[(0,_.jsx)(Fi.DatabaseOutlined,{className:"mr-2 text-blue-500"}),(0,_.jsx)(Fc,{level:4,className:"mb-0",children:"Test Vector Store"})]}),i.length>0&&(0,_.jsx)(z.Button,{onClick:()=>{o([]),c({}),J.default.success("Search history cleared")},size:"small",children:"Clear History"})]}),(0,_.jsxs)("div",{className:"flex-1 overflow-auto p-4 pb-0",children:[0===i.length?(0,_.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,_.jsx)(Fi.DatabaseOutlined,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,_.jsx)(Fd,{children:"Test your vector store by entering a search query below"})]}):(0,_.jsx)("div",{className:"space-y-4",children:i.map((e,t)=>(0,_.jsxs)("div",{className:"space-y-2",children:[(0,_.jsx)("div",{className:"text-right",children:(0,_.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3 bg-blue-50 border border-blue-200",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,_.jsx)("strong",{className:"text-sm",children:"Query"}),(0,_.jsx)("span",{className:"text-xs text-gray-500",children:new Date(e.timestamp).toLocaleString()})]}),(0,_.jsx)("div",{className:"text-left",children:e.query})]})}),(0,_.jsx)("div",{className:"text-left",children:(0,_.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3 bg-white border border-gray-200",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,_.jsx)(Fi.DatabaseOutlined,{className:"text-green-500"}),(0,_.jsx)("strong",{className:"text-sm",children:"Vector Store Results"}),e.response&&(0,_.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded bg-gray-100 text-gray-600",children:[e.response.data?.length||0," results"]})]}),e.response&&e.response.data&&e.response.data.length>0?(0,_.jsx)("div",{className:"space-y-3",children:e.response.data.map((e,r)=>{let a=d[`${t}-${r}`]||!1;return(0,_.jsxs)("div",{className:"border rounded-lg overflow-hidden bg-gray-50",children:[(0,_.jsxs)("div",{className:"flex justify-between items-center p-3 cursor-pointer hover:bg-gray-100 transition-colors",onClick:()=>{let e;return e=`${t}-${r}`,void c(t=>({...t,[e]:!t[e]}))},children:[(0,_.jsxs)("div",{className:"flex items-center",children:[a?(0,_.jsx)(wd.DownOutlined,{className:"text-gray-500 mr-2"}):(0,_.jsx)(wc.RightOutlined,{className:"text-gray-500 mr-2"}),(0,_.jsxs)("span",{className:"font-medium text-sm",children:["Result ",r+1]}),!a&&e.content&&e.content[0]&&(0,_.jsxs)("span",{className:"ml-2 text-xs text-gray-500 truncate max-w-md",children:["- ",e.content[0].text.substring(0,100),"..."]})]}),(0,_.jsxs)("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded",children:["Score: ",e.score.toFixed(4)]})]}),a&&(0,_.jsxs)("div",{className:"border-t bg-white p-3",children:[e.content&&e.content.map((e,t)=>(0,_.jsxs)("div",{className:"mb-3",children:[(0,_.jsxs)("div",{className:"text-xs text-gray-500 mb-1",children:["Content (",e.type,")"]}),(0,_.jsx)("div",{className:"text-sm bg-gray-50 p-3 rounded border text-gray-800 max-h-40 overflow-y-auto",children:e.text})]},t)),(e.file_id||e.filename||e.attributes)&&(0,_.jsxs)("div",{className:"mt-3 pt-3 border-t border-gray-200",children:[(0,_.jsx)("div",{className:"text-xs text-gray-500 mb-2 font-medium",children:"Metadata"}),(0,_.jsxs)("div",{className:"space-y-2 text-xs",children:[e.file_id&&(0,_.jsxs)("div",{className:"bg-gray-50 p-2 rounded",children:[(0,_.jsx)("span",{className:"font-medium",children:"File ID:"})," ",e.file_id]}),e.filename&&(0,_.jsxs)("div",{className:"bg-gray-50 p-2 rounded",children:[(0,_.jsx)("span",{className:"font-medium",children:"Filename:"})," ",e.filename]}),e.attributes&&Object.keys(e.attributes).length>0&&(0,_.jsxs)("div",{className:"bg-gray-50 p-2 rounded",children:[(0,_.jsx)("span",{className:"font-medium block mb-1",children:"Attributes:"}),(0,_.jsx)("pre",{className:"text-xs bg-white p-2 rounded border overflow-x-auto",children:JSON.stringify(e.attributes,null,2)})]})]})]})]})]},r)})}):(0,_.jsx)("div",{className:"text-gray-500 text-sm",children:"No results found"})]})}),ts(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),u())},placeholder:"Enter your search query... (Shift+Enter for new line)",disabled:n,autoSize:{minRows:1,maxRows:4},style:{resize:"none"}})}),(0,_.jsx)(z.Button,{type:"primary",onClick:u,disabled:n||!a.trim(),icon:(0,_.jsx)(Fl.SendOutlined,{}),loading:n,children:"Search"})]})})]})})},Fm=({vectorStoreId:e,onClose:t,accessToken:r,is_admin:a,editVectorStore:s})=>{let[n]=H.Form.useForm(),[l,i]=(0,T.useState)(null),[o,d]=(0,T.useState)(s),[c,u]=(0,T.useState)("{}"),[m,p]=(0,T.useState)([]),[h,f]=(0,T.useState)("details"),x=async()=>{if(r)try{let t=await (0,Q.vectorStoreInfoCall)(r,e);if(t&&t.vector_store){if(i(t.vector_store),t.vector_store.vector_store_metadata){let e="string"==typeof t.vector_store.vector_store_metadata?JSON.parse(t.vector_store.vector_store_metadata):t.vector_store.vector_store_metadata;u(JSON.stringify(e,null,2))}s&&n.setFieldsValue({vector_store_id:t.vector_store.vector_store_id,custom_llm_provider:t.vector_store.custom_llm_provider,vector_store_name:t.vector_store.vector_store_name,vector_store_description:t.vector_store.vector_store_description})}}catch(e){console.error("Error fetching vector store details:",e),J.default.fromBackend("Error fetching vector store details: "+e)}},g=async()=>{if(r)try{let e=await (0,Q.credentialListCall)(r);console.log("List credentials response:",e),p(e.credentials||[])}catch(e){console.error("Error fetching credentials:",e)}};(0,T.useEffect)(()=>{x(),g()},[e,r]);let y=async e=>{if(r)try{let t={};try{t=c?JSON.parse(c):{}}catch(e){J.default.fromBackend("Invalid JSON in metadata field");return}let a={vector_store_id:e.vector_store_id,custom_llm_provider:e.custom_llm_provider,vector_store_name:e.vector_store_name,vector_store_description:e.vector_store_description,vector_store_metadata:t};await (0,Q.vectorStoreUpdateCall)(r,a),J.default.success("Vector store updated successfully"),d(!1),x()}catch(e){console.error("Error updating vector store:",e),J.default.fromBackend("Error updating vector store: "+e)}};return l?(0,_.jsxs)("div",{className:"p-4 max-w-full",children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(S.Button,{icon:rH.ArrowLeftIcon,variant:"light",className:"mb-4",onClick:t,children:"Back to Vector Stores"}),(0,_.jsxs)(X.Title,{children:["Vector Store ID: ",l.vector_store_id]}),(0,_.jsx)(Z.Text,{className:"text-gray-500",children:l.vector_store_description||"No description"})]}),a&&!o&&(0,_.jsx)(S.Button,{onClick:()=>d(!0),children:"Edit Vector Store"})]}),(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)(rR.TabList,{className:"mb-6",children:[(0,_.jsx)(rY.Tab,{children:"Details"}),(0,_.jsx)(rY.Tab,{children:"Test Vector Store"})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsx)(rB.TabPanel,{children:o?(0,_.jsxs)("div",{children:[(0,_.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,_.jsx)(X.Title,{children:"Edit Vector Store"})}),(0,_.jsx)(P.Card,{children:(0,_.jsxs)(H.Form,{form:n,onFinish:y,layout:"vertical",initialValues:l,children:[(0,_.jsx)(H.Form.Item,{label:"Vector Store ID",name:"vector_store_id",rules:[{required:!0,message:"Please input a vector store ID"}],children:(0,_.jsx)($.Input,{disabled:!0})}),(0,_.jsx)(H.Form.Item,{label:"Vector Store Name",name:"vector_store_name",children:(0,_.jsx)($.Input,{})}),(0,_.jsx)(H.Form.Item,{label:"Description",name:"vector_store_description",children:(0,_.jsx)($.Input.TextArea,{rows:4})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Provider"," ",(0,_.jsx)(tB.Tooltip,{title:"Select the provider for this vector store",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"custom_llm_provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,_.jsx)(eE.Select,{children:Object.entries(j$.Providers).map(([e,t])=>"Bedrock"===e?(0,_.jsx)(eE.Select.Option,{value:j$.provider_map[e],children:(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)("img",{src:j$.providerLogoMap[t],alt:`${e} logo`,className:"w-5 h-5",onError:e=>{let r=e.target,a=r.parentElement;if(a){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),a.replaceChild(e,r)}}}),(0,_.jsx)("span",{children:t})]})},e):null)})}),(0,_.jsx)("div",{className:"mb-4",children:(0,_.jsx)(Z.Text,{className:"text-sm text-gray-500 mb-2",children:"Either select existing credentials OR enter provider credentials below"})}),(0,_.jsx)(H.Form.Item,{label:"Existing Credentials",name:"litellm_credential_name",children:(0,_.jsx)(eE.Select,{showSearch:!0,placeholder:"Select or search for existing credentials",optionFilterProp:"children",filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase()),options:[{value:null,label:"None"},...m.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,_.jsxs)("div",{className:"flex items-center my-4",children:[(0,_.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,_.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"OR"}),(0,_.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Metadata"," ",(0,_.jsx)(tB.Tooltip,{title:"JSON metadata for the vector store",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),children:(0,_.jsx)($.Input.TextArea,{rows:4,value:c,onChange:e=>u(e.target.value),placeholder:'{"key": "value"}'})}),(0,_.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,_.jsx)(z.Button,{onClick:()=>d(!1),children:"Cancel"}),(0,_.jsx)(z.Button,{type:"primary",htmlType:"submit",children:"Save Changes"})]})]})})]}):(0,_.jsxs)("div",{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,_.jsx)(X.Title,{children:"Vector Store Details"}),a&&(0,_.jsx)(S.Button,{onClick:()=>d(!0),children:"Edit Vector Store"})]}),(0,_.jsx)(P.Card,{children:(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"ID"}),(0,_.jsx)(Z.Text,{children:l.vector_store_id})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Name"}),(0,_.jsx)(Z.Text,{children:l.vector_store_name||"-"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Description"}),(0,_.jsx)(Z.Text,{children:l.vector_store_description||"-"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Provider"}),(0,_.jsx)("div",{className:"flex items-center space-x-2 mt-1",children:(()=>{let e=l.custom_llm_provider||"bedrock",{displayName:t,logo:r}=(()=>{let t=Object.keys(j$.provider_map).find(t=>j$.provider_map[t].toLowerCase()===e.toLowerCase());if(!t)return{displayName:e,logo:""};let r=j$.Providers[t],a=j$.providerLogoMap[r];return{displayName:r,logo:a}})();return(0,_.jsxs)(_.Fragment,{children:[r&&(0,_.jsx)("img",{src:r,alt:`${t} logo`,className:"w-5 h-5",onError:e=>{let r=e.target,a=r.parentElement;if(a){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),a.replaceChild(e,r)}}}),(0,_.jsx)(tR.Badge,{color:"blue",children:t})]})})()})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Metadata"}),(0,_.jsx)("div",{className:"bg-gray-50 p-3 rounded mt-2 font-mono text-xs overflow-auto max-h-48",children:(0,_.jsx)("pre",{children:c})})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Created"}),(0,_.jsx)(Z.Text,{children:l.created_at?new Date(l.created_at).toLocaleString():"-"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Last Updated"}),(0,_.jsx)(Z.Text,{children:l.updated_at?new Date(l.updated_at).toLocaleString():"-"})]})]})})]})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Fu,{vectorStoreId:l.vector_store_id,accessToken:r||""})})]})]})]}):(0,_.jsx)("div",{children:"Loading..."})},Fp={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M885.2 446.3l-.2-.8-112.2-285.1c-5-16.1-19.9-27.2-36.8-27.2H281.2c-17 0-32.1 11.3-36.9 27.6L139.4 443l-.3.7-.2.8c-1.3 4.9-1.7 9.9-1 14.8-.1 1.6-.2 3.2-.2 4.8V830a60.9 60.9 0 0060.8 60.8h627.2c33.5 0 60.8-27.3 60.9-60.8V464.1c0-1.3 0-2.6-.1-3.7.4-4.9 0-9.6-1.3-14.1zm-295.8-43l-.3 15.7c-.8 44.9-31.8 75.1-77.1 75.1-22.1 0-41.1-7.1-54.8-20.6S436 441.2 435.6 419l-.3-15.7H229.5L309 210h399.2l81.7 193.3H589.4zm-375 76.8h157.3c24.3 57.1 76 90.8 140.4 90.8 33.7 0 65-9.4 90.3-27.2 22.2-15.6 39.5-37.4 50.7-63.6h156.5V814H214.4V480.1z"}}]},name:"inbox",theme:"outlined"};var Fh=T.forwardRef(function(e,t){return T.createElement(rf.default,(0,rp.default)({},e,{ref:t,icon:Fp}))}),Ff=e.i(984125),Ff=Ff;let Fx=({documents:e,onRemove:t})=>{let r=[{title:"Name",dataIndex:"name",key:"name",render:(e,t)=>(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)("span",{className:"text-sm",children:e}),t.size&&(0,_.jsxs)("span",{className:"text-xs text-gray-400",children:["(",(e=>{if(!e)return"-";let t=e/1024;return t<1024?`${t.toFixed(2)} KB`:`${(t/1024).toFixed(2)} MB`})(t.size),")"]})]})},{title:"Status",dataIndex:"status",key:"status",width:150,render:e=>{let t;return t=({uploading:{color:"blue",text:"Uploading"},done:{color:"green",text:"Ready"},error:{color:"red",text:"Error"},removed:{color:"default",text:"Removed"}})[e],(0,_.jsx)(LZ.Badge,{color:t.color,text:t.text})}},{title:"Actions",key:"actions",width:120,render:(e,r)=>(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)(tB.Tooltip,{title:"View details",children:(0,_.jsx)(Ff.default,{className:"cursor-pointer text-gray-600 hover:text-blue-500",onClick:()=>console.log("View",r)})}),(0,_.jsx)(tB.Tooltip,{title:"Copy ID",children:(0,_.jsx)(ei.CopyOutlined,{className:"cursor-pointer text-gray-600 hover:text-blue-500",onClick:()=>{var e;return e=r.uid,void(navigator.clipboard.writeText(e),tU.default.success("Document ID copied to clipboard"))}})}),(0,_.jsx)(tB.Tooltip,{title:"Remove",children:(0,_.jsx)(jQ.DeleteOutlined,{className:"cursor-pointer text-gray-600 hover:text-red-500",onClick:()=>t(r.uid)})})]})}];return(0,_.jsx)(eK.Table,{dataSource:e,columns:r,rowKey:"uid",pagination:!1,locale:{emptyText:"No documents uploaded yet. Upload documents above to get started."},size:"small"})},Fg=({accessToken:e,providerParams:t,onParamsChange:r})=>{let[a,s]=(0,T.useState)([]),[n,l]=(0,T.useState)(!1);(0,T.useEffect)(()=>{e&&(async()=>{l(!0);try{let t=(await (0,jh.fetchAvailableModels)(e)).filter(e=>"embedding"===e.mode);s(t)}catch(e){console.error("Error fetching embedding models:",e)}finally{l(!1)}})()},[e]);let i=(e,a)=>{r({...t,[e]:a})};return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(B.Alert,{message:"AWS S3 Vectors Setup",description:(0,_.jsxs)("div",{children:[(0,_.jsx)("p",{children:"AWS S3 Vectors allows you to store and query vector embeddings directly in S3:"}),(0,_.jsxs)("ul",{style:{marginLeft:"16px",marginTop:"8px"},children:[(0,_.jsx)("li",{children:"Vector buckets and indexes will be automatically created if they don't exist"}),(0,_.jsx)("li",{children:"Vector dimensions are auto-detected from your selected embedding model"}),(0,_.jsx)("li",{children:"Ensure your AWS credentials have permissions for S3 Vectors operations"}),(0,_.jsxs)("li",{children:["Learn more:"," ",(0,_.jsx)("a",{href:"https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-vector-buckets.html",target:"_blank",rel:"noopener noreferrer",children:"AWS S3 Vectors Documentation"})]})]})]}),type:"info",showIcon:!0,style:{marginBottom:"16px"}}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Vector Bucket Name"," ",(0,_.jsx)(tB.Tooltip,{title:"S3 bucket name for vector storage (must be at least 3 characters, lowercase letters, numbers, hyphens, and periods only)",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),required:!0,validateStatus:t.vector_bucket_name&&t.vector_bucket_name.length<3?"error":void 0,help:t.vector_bucket_name&&t.vector_bucket_name.length<3?"Bucket name must be at least 3 characters":void 0,children:(0,_.jsx)($.Input,{value:t.vector_bucket_name||"",onChange:e=>i("vector_bucket_name",e.target.value),placeholder:"my-vector-bucket (min 3 chars)",size:"large",className:"rounded-md"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Index Name"," ",(0,_.jsx)(tB.Tooltip,{title:"Name for the vector index (optional, will be auto-generated if not provided). If provided, must be at least 3 characters.",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),validateStatus:t.index_name&&t.index_name.length>0&&t.index_name.length<3?"error":void 0,help:t.index_name&&t.index_name.length>0&&t.index_name.length<3?"Index name must be at least 3 characters if provided":void 0,children:(0,_.jsx)($.Input,{value:t.index_name||"",onChange:e=>i("index_name",e.target.value),placeholder:"my-vector-index (optional, min 3 chars)",size:"large",className:"rounded-md"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["AWS Region"," ",(0,_.jsx)(tB.Tooltip,{title:"AWS region where the S3 bucket is located (e.g., us-west-2)",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),required:!0,children:(0,_.jsx)($.Input,{value:t.aws_region_name||"",onChange:e=>i("aws_region_name",e.target.value),placeholder:"us-west-2",size:"large",className:"rounded-md"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Embedding Model"," ",(0,_.jsx)(tB.Tooltip,{title:"Select the embedding model to use for vector generation",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),required:!0,children:(0,_.jsx)(eE.Select,{value:t.embedding_model||void 0,onChange:e=>i("embedding_model",e),placeholder:"Select an embedding model",size:"large",showSearch:!0,loading:n,filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase()),options:a.map(e=>({value:e.model_group,label:e.model_group})),style:{width:"100%"}})})]})},{Dragger:Fy}=Tl.Upload,F_=({accessToken:e,onSuccess:t})=>{let[r]=H.Form.useForm(),[a,s]=(0,T.useState)([]),[n,l]=(0,T.useState)(!1),[i,o]=(0,T.useState)("bedrock"),[d,c]=(0,T.useState)(""),[u,m]=(0,T.useState)(""),[p,h]=(0,T.useState)([]),[f,x]=(0,T.useState)({}),g={name:"file",multiple:!0,accept:".pdf,.txt,.docx,.md,.doc",beforeUpload:e=>{if(!["application/pdf","text/plain","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/msword","text/markdown"].includes(e.type))return tU.default.error(`${e.name} is not a supported file type. Please upload PDF, TXT, DOCX, or MD files.`),Tl.Upload.LIST_IGNORE;if(!(e.size/1024/1024<50))return tU.default.error(`${e.name} must be smaller than 50MB!`),Tl.Upload.LIST_IGNORE;let t={uid:e.uid,name:e.name,status:"done",size:e.size,type:e.type,originFileObj:e};return s(e=>[...e,t]),!1},onRemove:e=>{s(t=>t.filter(t=>t.uid!==e.uid))},fileList:a.map(e=>({uid:e.uid,name:e.name,status:e.status,size:e.size})),showUploadList:!1},y=async()=>{let r;if(0===a.length)return void tU.default.warning("Please upload at least one document");if(!i)return void tU.default.warning("Please select a provider");for(let e of Fs(i).filter(e=>e.required))if(!f[e.name])return void tU.default.warning(`Please provide ${e.label}`);if("s3_vectors"===i){if(f.vector_bucket_name&&f.vector_bucket_name.length<3)return void tU.default.warning("Vector bucket name must be at least 3 characters");if(f.index_name&&f.index_name.length>0&&f.index_name.length<3)return void tU.default.warning("Index name must be at least 3 characters if provided")}if(!e)return void tU.default.error("No access token available");l(!0);let n=[];try{for(let t of a)if(t.originFileObj){s(e=>e.map(e=>e.uid===t.uid?{...e,status:"uploading"}:e));try{let a=await (0,Q.ragIngestCall)(e,t.originFileObj,i,r,d||void 0,u||void 0,f);!r&&a.vector_store_id&&(r=a.vector_store_id),n.push(a),s(e=>e.map(e=>e.uid===t.uid?{...e,status:"done"}:e))}catch(e){throw console.error(`Error ingesting ${t.name}:`,e),s(e=>e.map(e=>e.uid===t.uid?{...e,status:"error"}:e)),e}}h(n),J.default.success(`Successfully created vector store with ${n.length} document(s). Vector Store ID: ${r}`),t&&r&&t(r),setTimeout(()=>{s([]),h([])},3e3)}catch(e){console.error("Error creating vector store:",e),J.default.fromBackend(`Failed to create vector store: ${e}`)}finally{l(!1)}};return(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(X.Title,{children:"Create Vector Store"}),(0,_.jsx)(Z.Text,{className:"text-gray-500",children:"Upload documents and select a provider to create a new vector store with embedded content."})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"mb-4",children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Step 1: Upload Documents"}),(0,_.jsx)(Z.Text,{className:"text-sm text-gray-500 block mt-1",children:"Upload one or more documents (PDF, TXT, DOCX, MD). Maximum file size: 50MB per file."})]}),(0,_.jsxs)(Fy,{...g,children:[(0,_.jsx)("p",{className:"ant-upload-drag-icon",children:(0,_.jsx)(Fh,{style:{fontSize:"48px",color:"#1890ff"}})}),(0,_.jsx)("p",{className:"ant-upload-text",children:"Click or drag files to this area to upload"}),(0,_.jsx)("p",{className:"ant-upload-hint",children:"Support for single or bulk upload. Supported formats: PDF, TXT, DOCX, MD"})]})]}),a.length>0&&(0,_.jsxs)(P.Card,{children:[(0,_.jsx)("div",{className:"mb-4",children:(0,_.jsxs)(Z.Text,{className:"font-medium",children:["Uploaded Documents (",a.length,")"]})}),(0,_.jsx)(Fx,{documents:a,onRemove:e=>{s(t=>t.filter(t=>t.uid!==e))}})]}),(0,_.jsx)(P.Card,{children:(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Step 2: Configure Vector Store"}),(0,_.jsx)(Z.Text,{className:"text-sm text-gray-500 block mt-1",children:"Choose the provider and optionally provide a name and description for your vector store."})]}),(0,_.jsxs)(H.Form,{form:r,layout:"vertical",children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Vector Store Name"," ",(0,_.jsx)(tB.Tooltip,{title:"Optional: Give your vector store a meaningful name",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),children:(0,_.jsx)($.Input,{value:d,onChange:e=>c(e.target.value),placeholder:"e.g., Product Documentation, Customer Support KB",size:"large",className:"rounded-md"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Description"," ",(0,_.jsx)(tB.Tooltip,{title:"Optional: Describe what this vector store contains",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),children:(0,_.jsx)($.Input.TextArea,{value:u,onChange:e=>m(e.target.value),placeholder:"e.g., Contains all product documentation and user guides",rows:2,size:"large",className:"rounded-md"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Provider"," ",(0,_.jsx)(tB.Tooltip,{title:"Select the provider for embedding and vector store operations",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),required:!0,children:(0,_.jsx)(eE.Select,{value:i,onChange:o,placeholder:"Select a provider",size:"large",style:{width:"100%"},children:Object.entries(Y9).map(([e,t])=>(0,_.jsx)(eE.Select.Option,{value:Fe[e],children:(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)("img",{src:Fr[t],alt:`${e} logo`,className:"w-5 h-5",onError:e=>{let r=e.target,a=r.parentElement;if(a){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),a.replaceChild(e,r)}}}),(0,_.jsx)("span",{children:t})]})},e))})}),"s3_vectors"===i&&(0,_.jsx)(Fg,{accessToken:e,providerParams:f,onParamsChange:x}),"s3_vectors"!==i&&Fs(i).map(e=>"select"===e.type?(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:[e.label," ",(0,_.jsx)(tB.Tooltip,{title:e.tooltip,children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),required:e.required,children:(0,_.jsx)($.Input,{value:f[e.name]||"",onChange:t=>x(r=>({...r,[e.name]:t.target.value})),placeholder:e.placeholder,size:"large",className:"rounded-md"})},e.name):(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:[e.label," ",(0,_.jsx)(tB.Tooltip,{title:e.tooltip,children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),required:e.required,children:(0,_.jsx)($.Input,{type:"password"===e.type?"password":"text",value:f[e.name]||"",onChange:t=>x(r=>({...r,[e.name]:t.target.value})),placeholder:e.placeholder,size:"large",className:"rounded-md"})},e.name))]}),(0,_.jsx)("div",{className:"flex justify-end",children:(0,_.jsx)(z.Button,{type:"primary",size:"large",onClick:y,loading:n,disabled:0===a.length||!i,children:n?"Creating Vector Store...":"Create Vector Store"})})]})}),p.length>0&&(0,_.jsx)(B.Alert,{message:"Vector Store Created Successfully",description:(0,_.jsxs)("div",{children:[(0,_.jsxs)("p",{children:[(0,_.jsx)("strong",{children:"Vector Store ID:"})," ",p[0]?.vector_store_id]}),(0,_.jsxs)("p",{children:[(0,_.jsx)("strong",{children:"Documents Ingested:"})," ",p.length]})]}),type:"success",showIcon:!0,closable:!0})]})},{Text:Fb,Title:Fv}=V.Typography,Fj=({accessToken:e,vectorStores:t})=>{let[r,a]=(0,T.useState)(t.length>0?t[0].vector_store_id:void 0);return e?0===t.length?(0,_.jsx)(eg.Card,{children:(0,_.jsx)("div",{className:"text-center py-8",children:(0,_.jsx)(Fb,{type:"secondary",children:"No vector stores available. Create one first to test it."})})}):(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsx)(eg.Card,{children:(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Fv,{level:5,children:"Select Vector Store"}),(0,_.jsx)(Fb,{type:"secondary",children:"Choose a vector store to test search queries against"})]}),(0,_.jsx)(eE.Select,{value:r,onChange:a,placeholder:"Select a vector store",size:"large",style:{width:"100%"},showSearch:!0,optionFilterProp:"children",children:t.map(e=>(0,_.jsx)(eE.Select.Option,{value:e.vector_store_id,children:(0,_.jsxs)("div",{className:"flex flex-col",children:[(0,_.jsx)("span",{className:"font-medium",children:e.vector_store_name||e.vector_store_id}),e.vector_store_name&&(0,_.jsx)("span",{className:"text-xs text-gray-500 font-mono",children:e.vector_store_id})]})},e.vector_store_id))})]})}),r&&(0,_.jsx)(Fu,{vectorStoreId:r,accessToken:e})]}):(0,_.jsx)(eg.Card,{children:(0,_.jsx)(Fb,{type:"secondary",children:"Access token is required to test vector stores."})})},Fw=({accessToken:e,userID:t,userRole:r})=>{let[a,s]=(0,T.useState)([]),[n,l]=(0,T.useState)(!1),[i,o]=(0,T.useState)(!1),[d,c]=(0,T.useState)(null),[u,m]=(0,T.useState)(""),[p,h]=(0,T.useState)([]),[f,x]=(0,T.useState)(null),[g,y]=(0,T.useState)(!1),[b,v]=(0,T.useState)(!1),j=async()=>{if(e)try{let t=await (0,Q.vectorStoreListCall)(e);console.log("List vector stores response:",t),s(t.data||[])}catch(e){console.error("Error fetching vector stores:",e),J.default.fromBackend("Error fetching vector stores: "+e)}},w=async()=>{if(e)try{let t=await (0,Q.credentialListCall)(e);console.log("List credentials response:",t),h(t.credentials||[])}catch(e){console.error("Error fetching credentials:",e),J.default.fromBackend("Error fetching credentials: "+e)}},k=async e=>{c(e),o(!0)},N=async()=>{if(e&&d){v(!0);try{await (0,Q.vectorStoreDeleteCall)(e,d),J.default.success("Vector store deleted successfully"),j()}catch(e){console.error("Error deleting vector store:",e),J.default.fromBackend("Error deleting vector store: "+e)}finally{v(!1),o(!1),c(null)}}};return(0,T.useEffect)(()=>{j(),w()},[e]),f?(0,_.jsx)("div",{className:"w-full h-full",children:(0,_.jsx)(Fm,{vectorStoreId:f,onClose:()=>{x(null),y(!1),j()},accessToken:e,is_admin:(0,ts.isAdminRole)(r||""),editVectorStore:g})}):(0,_.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,_.jsxs)("div",{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,_.jsxs)("div",{className:"flex justify-between mt-2 w-full items-center mb-4",children:[(0,_.jsx)("h1",{children:"Vector Store Management"}),(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[u&&(0,_.jsxs)(Z.Text,{children:["Last Refreshed: ",u]}),(0,_.jsx)(yi.Icon,{icon:jt.RefreshIcon,variant:"shadow",size:"xs",className:"self-center cursor-pointer",onClick:()=>{j(),w(),m(new Date().toLocaleString())}})]})]}),(0,_.jsx)(Z.Text,{className:"mb-4",children:(0,_.jsx)("p",{children:"You can use vector stores to store and retrieve LLM embeddings."})}),(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)(rR.TabList,{className:"mb-6",children:[(0,_.jsx)(rY.Tab,{children:"Create Vector Store"}),(0,_.jsx)(rY.Tab,{children:"Manage Vector Stores"}),(0,_.jsx)(rY.Tab,{children:"Test Vector Store"})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(F_,{accessToken:e,onSuccess:e=>{console.log("Vector store created:",e),j()}})}),(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsx)(S.Button,{className:"mb-4",onClick:()=>l(!0),children:"+ Add Vector Store"}),(0,_.jsx)(ee.Grid,{numItems:1,className:"gap-2 pt-2 pb-2 w-full mt-2",children:(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsx)(Y7,{data:a,onView:e=>{x(e),y(!1)},onEdit:e=>{x(e),y(!0)},onDelete:k})})})]}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Fj,{accessToken:e,vectorStores:a})})]})]}),(0,_.jsx)(Fn,{isVisible:n,onCancel:()=>l(!1),onSuccess:()=>{l(!1),j()},accessToken:e,credentials:p}),(0,_.jsx)(eH.default,{isOpen:i,title:"Delete Vector Store",message:"Are you sure you want to delete this vector store? This action cannot be undone.",resourceInformationTitle:"Vector Store Information",resourceInformation:[{label:"Vector Store ID",value:d,code:!0}],onCancel:()=>o(!1),onOk:N,confirmLoading:b})]})})},Fk={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M536.1 273H488c-4.4 0-8 3.6-8 8v275.3c0 2.6 1.2 5 3.3 6.5l165.3 120.7c3.6 2.6 8.6 1.9 11.2-1.7l28.6-39c2.7-3.7 1.9-8.7-1.7-11.2L544.1 528.5V281c0-4.4-3.6-8-8-8zm219.8 75.2l156.8 38.3c5 1.2 9.9-2.6 9.9-7.7l.8-161.5c0-6.7-7.7-10.5-12.9-6.3L752.9 334.1a8 8 0 003 14.1zm167.7 301.1l-56.7-19.5a8 8 0 00-10.1 4.8c-1.9 5.1-3.9 10.1-6 15.1-17.8 42.1-43.3 80-75.9 112.5a353 353 0 01-112.5 75.9 352.18 352.18 0 01-137.7 27.8c-47.8 0-94.1-9.3-137.7-27.8a353 353 0 01-112.5-75.9c-32.5-32.5-58-70.4-75.9-112.5A353.44 353.44 0 01171 512c0-47.8 9.3-94.2 27.8-137.8 17.8-42.1 43.3-80 75.9-112.5a353 353 0 01112.5-75.9C430.6 167.3 477 158 524.8 158s94.1 9.3 137.7 27.8A353 353 0 01775 261.7c10.2 10.3 19.8 21 28.6 32.3l59.8-46.8C784.7 146.6 662.2 81.9 524.6 82 285 82.1 92.6 276.7 95 516.4 97.4 751.9 288.9 942 524.8 942c185.5 0 343.5-117.6 403.7-282.3 1.5-4.2-.7-8.9-4.9-10.4z"}}]},name:"history",theme:"outlined"};var FS=T.forwardRef(function(e,t){return T.createElement(rf.default,(0,rp.default)({},e,{ref:t,icon:Fk}))});let FN=[{value:"untrusted",label:"untrusted",color:"#92400e",bg:"#fef3c7",border:"#fcd34d"},{value:"trusted",label:"trusted",color:"#065f46",bg:"#d1fae5",border:"#6ee7b7"},{value:"blocked",label:"blocked",color:"#991b1b",bg:"#fee2e2",border:"#fca5a5"}],FT=[{value:"untrusted",label:"untrusted",color:"#92400e",bg:"#fef3c7",border:"#fcd34d"},{value:"trusted",label:"trusted",color:"#065f46",bg:"#d1fae5",border:"#6ee7b7"}],FM=({value:e,toolName:t,saving:r,onChange:a,policyType:s="input",size:n="small",minWidth:l=110,stopPropagation:i=!0})=>{let o="output"===s?FT:FN,d=FN.find(t=>t.value===e)??FN[0];return(0,_.jsx)(eE.Select,{size:n,value:e,disabled:r,loading:r,onChange:e=>a(t,e),onClick:e=>i&&e.stopPropagation(),style:{minWidth:l,fontWeight:500,backgroundColor:d.bg,borderColor:d.border,color:d.color,borderRadius:999,fontSize:"small"===n?11:12},popupMatchSelectWidth:!1,options:o.map(e=>({value:e.value,label:(0,_.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:12,fontWeight:500,color:e.color},children:[(0,_.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:e.color,display:"inline-block",flexShrink:0}}),e.label]})}))})},FC="tool-detail";function FL({toolName:e,onBack:t,accessToken:r}){let a=(0,eh.useQueryClient)(),[s,n]=(0,T.useState)(!1),[l,i]=(0,T.useState)(!1),[o,d]=(0,T.useState)(!1),[c,u]=(0,T.useState)("team"),[m,p]=(0,T.useState)(null),[h,f]=(0,T.useState)(null),x=(0,T.useMemo)(()=>{let e,t,r;return e=new Date,(t=new Date).setDate(t.getDate()-90),{start:(r=e=>e.toISOString().slice(0,19).replace("T"," "))(t),end:r(e)}},[]),{data:g,isLoading:y,error:b}=(0,ev.useQuery)({queryKey:[FC,e],queryFn:()=>(0,Q.fetchToolDetail)(r,e),enabled:!!r&&!!e}),{data:v}=(0,ev.useQuery)({queryKey:["tool-policy-options"],queryFn:()=>(0,Q.fetchToolPolicyOptions)(r),enabled:!!r,staleTime:6e4}),{data:j}=(0,ev.useQuery)({queryKey:["teams-list-tool-detail"],queryFn:()=>(0,Q.teamListCall)(r,null,null),enabled:!!r}),{data:w}=(0,ev.useQuery)({queryKey:["keys-list-tool-detail"],queryFn:()=>(0,Q.keyListCall)(r,null,null,null,null,null,1,100),enabled:!!r}),{data:k,isLoading:S}=(0,ev.useQuery)({queryKey:["tool-usage-logs",e,x.start,x.end],queryFn:()=>(0,Q.getToolUsageLogs)(r,e,{page:1,pageSize:50,startDate:x.start,endDate:x.end}),enabled:!!r&&!!e}),N=(0,T.useMemo)(()=>(k?.logs??[]).map(e=>({id:e.id,timestamp:e.timestamp,action:"passed",model:e.model??void 0,input_snippet:e.input_snippet??void 0})),[k?.logs]);(0,T.useMemo)(()=>(Array.isArray(j)?j:j?.data??[]).map(e=>({team_id:e.team_id??e.id??"",team_alias:e.team_alias??e.team_id??"",models:[],max_budget:null,budget_duration:null,tpm_limit:null,rpm_limit:null,organization_id:"",created_at:"",keys:[],members_with_roles:[],spend:0})),[j]);let M=(0,T.useMemo)(()=>(w?.keys??w?.data??[]).map(e=>({token:e.token??e.api_key??e.key_hash??"",key_alias:e.key_alias??(e.token??e.api_key??e.key_hash)?.toString?.()?.substring?.(0,8)})),[w]),C=(0,T.useCallback)(()=>{a.invalidateQueries({queryKey:[FC,e]})},[a,e]),L=(0,T.useCallback)(async(t,a)=>{if(r){i(!0);try{await (0,Q.updateToolPolicy)(r,e,{input_policy:a}),C()}catch(e){alert(`Failed to update input policy: ${e instanceof Error?e.message:String(e)}`)}finally{i(!1)}}},[r,e,C]),O=(0,T.useCallback)(async(t,a)=>{if(r){d(!0);try{await (0,Q.updateToolPolicy)(r,e,{output_policy:a}),C()}catch(e){alert(`Failed to update output policy: ${e instanceof Error?e.message:String(e)}`)}finally{d(!1)}}},[r,e,C]),D=(0,T.useCallback)(async()=>{if(!r||!e)return;let t="team"===c;if((!t||m)&&(t||h?.token)){n(!0);try{await (0,Q.updateToolPolicy)(r,e,{input_policy:"blocked"},{team_id:t?m:void 0,key_hash:t?void 0:h.token,key_alias:t?void 0:h.key_alias}),C(),p(null),f(null)}catch(e){alert(`Failed to add override: ${e instanceof Error?e.message:String(e)}`)}finally{n(!1)}}},[r,e,c,m,h,C]),P=(0,T.useCallback)(async t=>{if(r&&e){n(!0);try{await (0,Q.deleteToolPolicyOverride)(r,e,{team_id:t.team_id??void 0,key_hash:t.key_hash??void 0}),C()}catch(e){alert(`Failed to remove override: ${e instanceof Error?e.message:String(e)}`)}finally{n(!1)}}},[r,e,C]);if(y&&!g)return(0,_.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,_.jsx)(rm.Spin,{size:"large"})});if(b&&!g)return(0,_.jsxs)("div",{children:[(0,_.jsx)(z.Button,{type:"link",icon:(0,_.jsx)(kd.ArrowLeftOutlined,{}),onClick:t,className:"pl-0 mb-4",children:"Back to Tool Policies"}),(0,_.jsx)("p",{className:"text-red-600",children:"Failed to load tool details."})]});if(!g)return null;let{tool:A,overrides:E}=g,I=v?.input_policies?.find(e=>e.value===A.input_policy)?.description,Y=v?.output_policies?.find(e=>e.value===A.output_policy)?.description;return(0,_.jsxs)("div",{children:[(0,_.jsxs)("div",{className:"mb-6",children:[(0,_.jsx)(z.Button,{type:"link",icon:(0,_.jsx)(kd.ArrowLeftOutlined,{}),onClick:t,className:"pl-0 mb-4",children:"Back to Tool Policies"}),(0,_.jsx)("div",{className:"flex items-start justify-between",children:(0,_.jsxs)("div",{children:[(0,_.jsxs)("div",{className:"flex items-center gap-3 mb-1 flex-wrap",children:[(0,_.jsx)(Nd.ToolOutlined,{className:"text-xl text-gray-400"}),(0,_.jsx)("h1",{className:"text-xl font-semibold text-gray-900 font-mono",children:A.tool_name}),(0,_.jsx)("span",{className:"inline-flex items-center px-2.5 py-1 text-xs font-medium rounded-md bg-gray-100 text-gray-700 border border-gray-200",children:A.origin??"—"}),(0,_.jsxs)("span",{className:"inline-flex items-center px-2.5 py-1 text-xs font-medium rounded-md bg-indigo-50 text-indigo-700 border border-indigo-200",children:[(A.call_count??0).toLocaleString()," calls"]})]}),(0,_.jsxs)("dl",{className:"mt-3 flex flex-wrap gap-x-6 gap-y-1 text-sm text-gray-600",children:[A.user_agent&&(0,_.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,_.jsx)("dt",{className:"font-medium text-gray-500 whitespace-nowrap",children:"User Agent:"}),(0,_.jsx)("dd",{className:"font-mono truncate max-w-[40ch]",title:A.user_agent,children:A.user_agent})]}),A.created_at&&(0,_.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,_.jsx)("dt",{className:"font-medium text-gray-500 whitespace-nowrap",children:"First Discovered:"}),(0,_.jsx)("dd",{children:new Date(A.created_at).toLocaleString()})]}),A.last_used_at&&(0,_.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,_.jsx)("dt",{className:"font-medium text-gray-500 whitespace-nowrap",children:"Last Used:"}),(0,_.jsx)("dd",{children:new Date(A.last_used_at).toLocaleString()})]})]})]})})]}),(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,_.jsxs)("section",{className:"bg-white rounded-lg border border-gray-200 p-5 shadow-sm",children:[(0,_.jsx)("h2",{className:"text-sm font-semibold text-gray-700 mb-1",children:"Input Policy"}),(0,_.jsx)("p",{className:"text-xs text-gray-500 mb-3",children:I??"Controls what data this tool is allowed to accept."}),(0,_.jsx)(FM,{value:A.input_policy,toolName:A.tool_name,saving:l,onChange:L,policyType:"input",size:"middle",minWidth:140,stopPropagation:!1})]}),(0,_.jsxs)("section",{className:"bg-white rounded-lg border border-gray-200 p-5 shadow-sm",children:[(0,_.jsx)("h2",{className:"text-sm font-semibold text-gray-700 mb-1",children:"Output Policy"}),(0,_.jsx)("p",{className:"text-xs text-gray-500 mb-3",children:Y??"Controls how this tool's output is trusted by downstream tools."}),(0,_.jsx)(FM,{value:A.output_policy,toolName:A.tool_name,saving:o,onChange:O,policyType:"output",size:"middle",minWidth:140,stopPropagation:!1})]})]}),E.length>0&&(0,_.jsxs)("section",{className:"bg-white rounded-lg border border-gray-200 p-5 shadow-sm",children:[(0,_.jsx)("h2",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Blocked for team or key"}),(0,_.jsx)("ul",{className:"border rounded-md divide-y divide-gray-100 bg-red-50/30",children:E.map(e=>(0,_.jsxs)("li",{className:"flex items-center justify-between px-3 py-2.5 text-sm",children:[(0,_.jsxs)("span",{className:"text-gray-700",children:[e.team_id?`Team: ${e.team_id}`:"",e.team_id&&e.key_hash?" · ":"",e.key_hash?`Key: ${e.key_alias||e.key_hash.substring(0,8)}`:"",e.team_id||e.key_hash?"":"—"]}),(0,_.jsx)(z.Button,{type:"link",danger:!0,size:"small",disabled:s,onClick:()=>P(e),children:"Remove"})]},e.override_id))})]}),(0,_.jsxs)("section",{className:"bg-white rounded-lg border border-gray-200 p-5 shadow-sm",children:[(0,_.jsx)("h2",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Block for team or key"}),(0,_.jsxs)("div",{className:"flex flex-col gap-4 max-w-md",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{className:"text-sm font-medium text-gray-700 block mb-2",children:"Scope"}),(0,_.jsxs)("div",{className:"flex items-center gap-6",children:[(0,_.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,_.jsx)("input",{type:"radio",checked:"team"===c,onChange:()=>u("team"),className:"align-middle"}),"Team"]}),(0,_.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,_.jsx)("input",{type:"radio",checked:"key"===c,onChange:()=>u("key"),className:"align-middle"}),"Key"]})]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{className:"text-sm font-medium text-gray-700 block mb-2",children:"team"===c?"Team":"Key"}),"team"===c?(0,_.jsx)(tX.default,{value:m??void 0,onChange:e=>p(e||null)}):(0,_.jsx)(eE.Select,{placeholder:"Select key",allowClear:!0,showSearch:!0,optionFilterProp:"label",value:h?h.token:void 0,onChange:e=>{f(M.find(t=>t.token===e)??null)},options:M.map(e=>({value:e.token,label:e.key_alias||e.token?.substring?.(0,12)||e.token})),className:"w-full",style:{minWidth:200}})]}),(0,_.jsxs)(z.Button,{type:"primary",danger:!0,disabled:s||("team"===c?!m:!h?.token),loading:s,onClick:D,children:["Block for ",c]})]})]}),(0,_.jsxs)("section",{className:"bg-white rounded-lg border border-gray-200 p-5 shadow-sm",children:[(0,_.jsxs)("h2",{className:"text-sm font-semibold text-gray-700 mb-3 flex items-center gap-2",children:[(0,_.jsx)(FS,{}),"Recent logs"]}),(0,_.jsx)(N4,{guardrailName:A.tool_name,filterAction:"passed",logs:N,logsLoading:S,totalLogs:k?.total??0,accessToken:r,startDate:x.start,endDate:x.end})]})]})]})}let FO=({utcTime:e})=>(0,_.jsx)("span",{style:{fontFamily:"monospace",width:"180px",display:"inline-block"},children:(e=>{try{return new Date(e).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0}).replace(",","")}catch(e){return"Error converting time"}})(e)});var FD=e.i(969550);function FP(e){return`${e.getUTCFullYear()}-${String(e.getUTCMonth()+1).padStart(2,"0")}-${String(e.getUTCDate()).padStart(2,"0")}`}function FA(e,t){if(!e)return!1;try{let r=new Date(e);return FP(r)===t}catch{return!1}}function FE(e,t){return e.filter(e=>FA(e.created_at,t)).length}let FI=({accessToken:e,onSelectTool:t})=>{let[r,a]=(0,T.useState)([]),[s,n]=(0,T.useState)(!0),[l,i]=(0,T.useState)(!1),[o,d]=(0,T.useState)(null),[c,u]=(0,T.useState)(null),[m,p]=(0,T.useState)(null),[h,f]=(0,T.useState)(""),[x,g]=(0,T.useState)("created_at"),[y,b]=(0,T.useState)("desc"),[v,j]=(0,T.useState)(1),[w,k]=(0,T.useState)(!0),[S,N]=(0,T.useState)({}),M=(0,T.useDeferredValue)(l),C=l||M,L=(0,T.useCallback)(async()=>{if(e){i(!0),d(null);try{let t=await (0,Q.fetchToolsList)(e);a(t)}catch(e){d(e.message??"Failed to load tools")}finally{i(!1),n(!1)}}},[e]);(0,T.useEffect)(()=>{L()},[L]),(0,T.useEffect)(()=>{if(!w)return;let e=setInterval(L,15e3);return()=>clearInterval(e)},[w,L]);let O=async(t,r)=>{if(e){u(t);try{await (0,Q.updateToolPolicy)(e,t,{input_policy:r}),a(e=>e.map(e=>e.tool_name===t?{...e,input_policy:r}:e))}catch(e){alert(`Failed to update input policy: ${e.message}`)}finally{u(null)}}},D=async(t,r)=>{if(e){p(t);try{await (0,Q.updateToolPolicy)(e,t,{output_policy:r}),a(e=>e.map(e=>e.tool_name===t?{...e,output_policy:r}:e))}catch(e){alert(`Failed to update output policy: ${e.message}`)}finally{p(null)}}},P=Array.from(new Set(r.map(e=>e.team_id).filter(Boolean))).map(e=>({label:e,value:e})),B=Array.from(new Set(r.map(e=>e.key_alias).filter(Boolean))).map(e=>({label:e,value:e})),z=[{name:"Input Policy",label:"Input Policy",options:FN.map(e=>({label:e.label,value:e.value}))},{name:"Output Policy",label:"Output Policy",options:FT.map(e=>({label:e.label,value:e.value}))},{name:"Team Name",label:"Team Name",options:P},{name:"Key Name",label:"Key Name",options:B}],{newToday:H,newYesterday:$,trendSubtitle:q,totalTools:U,blockedCount:W,activeTeamsCount:V,needsReviewTools:G}=(0,T.useMemo)(()=>{let e=new Date,t=FP(e),a=new Date(e);a.setUTCDate(a.getUTCDate()-1);let s=FP(a),n=FE(r,t),l=FE(r,s),i=function(e,t){let r=e-t;if(0!==r)return r>0?`+${r} since yesterday`:`${r} since yesterday`}(n,l),o=r.length,d=r.filter(e=>"blocked"===e.input_policy).length;return{newToday:n,newYesterday:l,trendSubtitle:i,totalTools:o,blockedCount:d,activeTeamsCount:new Set(r.map(e=>e.team_id).filter(Boolean)).size,needsReviewTools:r.filter(e=>FA(e.created_at,t)&&"untrusted"===e.input_policy)}},[r]),K=({label:e,field:t})=>(0,_.jsxs)("div",{className:"flex items-center gap-1",children:[(0,_.jsx)("span",{children:e}),(0,_.jsx)(YS.TableHeaderSortDropdown,{sortState:x===t&&y,onSortChange:e=>{!1===e?(g("created_at"),b("desc")):(g(t),b(e)),j(1)}})]}),J=r.filter(e=>{if(h){let t=h.toLowerCase();if(!(e.tool_name.toLowerCase().includes(t)||(e.team_id??"").toLowerCase().includes(t)||(e.key_alias??"").toLowerCase().includes(t)||(e.key_hash??"").toLowerCase().includes(t)||e.input_policy.toLowerCase().includes(t)||e.output_policy.toLowerCase().includes(t)))return!1}return(!S["Input Policy"]||e.input_policy===S["Input Policy"])&&(!S["Output Policy"]||e.output_policy===S["Output Policy"])&&(!S["Team Name"]||e.team_id===S["Team Name"])&&(!S["Key Name"]||e.key_alias===S["Key Name"])}),X=[...J].sort((e,t)=>{let r=e[x]??"",a=t[x]??"";return ra?"desc"===y?-1:1:0}),Z=Math.max(1,Math.ceil(X.length/50)),ee=X.slice((v-1)*50,50*v);return(0,_.jsxs)("div",{className:"w-full",children:[(0,_.jsx)("h1",{className:"text-2xl font-semibold text-gray-900 mb-6",children:"Tool Policies"}),(0,_.jsxs)("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4 mb-6",children:[(0,_.jsx)(N5,{label:"New Today",value:H,valueColor:"text-green-600",subtitle:q,icon:(0,_.jsx)("svg",{className:"w-4 h-4 text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"})})}),(0,_.jsx)(N5,{label:"Total Tools Discovered",value:U}),(0,_.jsx)(N5,{label:"Blocked Tools",value:W,valueColor:W>0?"text-red-600":void 0}),(0,_.jsx)(N5,{label:"Active Teams",value:V>0?V:"—"})]}),G.length>0&&(0,_.jsxs)("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4 mb-6",children:[(0,_.jsx)("h2",{className:"text-sm font-semibold text-amber-900 mb-1",children:"Needs Review"}),(0,_.jsxs)("p",{className:"text-sm text-amber-800 mb-3",children:[G.length," new tool",1!==G.length?"s":""," discovered that require policy decisions."]}),(0,_.jsx)("div",{className:"flex flex-wrap gap-2",children:G.map(e=>(0,_.jsxs)("span",{className:"inline-flex items-center gap-2 px-3 py-1.5 bg-white border border-amber-200 rounded-md text-sm",children:[(0,_.jsx)("span",{className:"font-mono text-amber-900 truncate max-w-[200px]",title:e.tool_name,children:e.tool_name}),(0,_.jsx)("button",{type:"button",onClick:()=>(e=>{let t=X.findIndex(t=>t.tool_id===e);if(t>=0){let r=Math.floor(t/50)+1;r!==v&&j(r),requestAnimationFrame(()=>{setTimeout(()=>{document.getElementById(`tool-row-${e}`)?.scrollIntoView({behavior:"smooth",block:"center"})},100)})}})(e.tool_id),className:"text-amber-700 hover:text-amber-900 font-medium text-xs whitespace-nowrap",children:"Review"})]},e.tool_id))})]}),(0,_.jsxs)("div",{className:"bg-white rounded-lg shadow w-full max-w-full box-border",children:[(0,_.jsxs)("div",{className:"border-b px-6 py-4 w-full max-w-full box-border",children:[(0,_.jsxs)("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between space-y-4 md:space-y-0 w-full max-w-full box-border",children:[(0,_.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,_.jsxs)("div",{className:"relative w-64",children:[(0,_.jsx)("input",{type:"text",placeholder:"Search by Tool Name",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:h,onChange:e=>{f(e.target.value),j(1)}}),(0,_.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("span",{className:"text-sm font-medium text-gray-900",children:"Live Tail"}),(0,_.jsx)(e_.Switch,{checked:w,onChange:k})]}),(0,_.jsxs)("button",{onClick:L,disabled:C,className:"flex items-center gap-1.5 px-3 py-2 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-60",children:[(0,_.jsx)("svg",{className:`w-4 h-4 ${C?"animate-spin":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),C?"Fetching":"Fetch"]})]}),(0,_.jsxs)("div",{className:"flex items-center gap-4 text-sm text-gray-600 whitespace-nowrap",children:[(0,_.jsxs)("span",{children:["Showing ",0===J.length?0:(v-1)*50+1," -"," ",Math.min(50*v,J.length)," of ",J.length," results"]}),(0,_.jsxs)("span",{children:["Page ",v," of ",Z]}),(0,_.jsxs)("div",{className:"flex gap-1",children:[(0,_.jsx)("button",{onClick:()=>j(e=>Math.max(1,e-1)),disabled:1===v,className:"px-3 py-1.5 border rounded-md text-sm hover:bg-gray-50 disabled:opacity-40",children:"Previous"}),(0,_.jsx)("button",{onClick:()=>j(e=>Math.min(Z,e+1)),disabled:v===Z,className:"px-3 py-1.5 border rounded-md text-sm hover:bg-gray-50 disabled:opacity-40",children:"Next"})]})]})]}),(0,_.jsx)("div",{className:"mt-3",children:(0,_.jsx)(FD.default,{options:z,onApplyFilters:e=>{N(e),j(1)},onResetFilters:()=>{N({}),j(1)},buttonLabel:"Filters"})})]}),w&&(0,_.jsxs)("div",{className:"bg-green-50 border-b border-green-100 px-6 py-2 flex items-center justify-between",children:[(0,_.jsx)("span",{className:"text-sm text-green-700",children:"Auto-refreshing every 15 seconds"}),(0,_.jsx)("button",{onClick:()=>k(!1),className:"text-xs text-green-600 underline",children:"Stop"})]}),o&&(0,_.jsx)("div",{className:"mx-6 mt-4 p-3 bg-red-50 border border-red-200 rounded text-sm text-red-700",children:o}),(0,_.jsxs)(A.Table,{className:"[&_td]:py-0.5 [&_th]:py-1 w-full",children:[(0,_.jsx)(Y.TableHead,{children:(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:(0,_.jsx)(K,{label:"Discovered",field:"created_at"})}),(0,_.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:(0,_.jsx)(K,{label:"Tool Name",field:"tool_name"})}),(0,_.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:(0,_.jsx)(K,{label:"Input Policy",field:"input_policy"})}),(0,_.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:(0,_.jsx)(K,{label:"Output Policy",field:"output_policy"})}),(0,_.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:(0,_.jsx)(K,{label:"# Calls",field:"call_count"})}),(0,_.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:(0,_.jsx)(K,{label:"Team Name",field:"team_id"})}),(0,_.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:"Key Hash"}),(0,_.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:(0,_.jsx)(K,{label:"Key Name",field:"key_alias"})}),(0,_.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:"User Agent"})]})}),(0,_.jsx)(E.TableBody,{children:s?(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:9,className:"h-8 text-center text-gray-500",children:"Loading tools…"})}):0===ee.length?(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:9,className:"h-8 text-center text-gray-500",children:"No tools discovered yet. Make a chat completion that returns tool_calls to start auto-discovery."})}):ee.map(e=>(0,_.jsxs)(R.TableRow,{id:`tool-row-${e.tool_id}`,className:"h-8 hover:bg-gray-50",children:[(0,_.jsx)(I.TableCell,{className:"py-0.5 max-h-8 overflow-hidden whitespace-nowrap",children:(0,_.jsx)(FO,{utcTime:e.created_at??""})}),(0,_.jsx)(I.TableCell,{className:"py-0.5 max-h-8 overflow-hidden",children:(0,_.jsx)("button",{type:"button",onClick:()=>t?.(e.tool_name),className:"text-left w-full font-mono text-xs max-w-[20ch] truncate block font-medium text-blue-600 hover:text-blue-800 hover:underline focus:outline-none focus:ring-0",children:(0,_.jsx)(tB.Tooltip,{title:t?"Click to view details and block for team/key":e.tool_name,children:(0,_.jsx)("span",{children:e.tool_name})})})}),(0,_.jsx)(I.TableCell,{className:"py-0.5 max-h-8",children:(0,_.jsx)(FM,{value:e.input_policy,toolName:e.tool_name,saving:c===e.tool_name,onChange:O,policyType:"input"})}),(0,_.jsx)(I.TableCell,{className:"py-0.5 max-h-8",children:(0,_.jsx)(FM,{value:e.output_policy,toolName:e.tool_name,saving:m===e.tool_name,onChange:D,policyType:"output"})}),(0,_.jsx)(I.TableCell,{className:"py-0.5 max-h-8",children:(0,_.jsx)("div",{className:"flex items-center justify-end h-8 tabular-nums text-sm font-mono text-gray-700",children:(e.call_count??0).toLocaleString()})}),(0,_.jsx)(I.TableCell,{className:"py-0.5 max-h-8 overflow-hidden whitespace-nowrap",children:(0,_.jsx)(tB.Tooltip,{title:e.team_id??"-",children:(0,_.jsx)("span",{className:"max-w-[15ch] truncate block",children:e.team_id??"-"})})}),(0,_.jsx)(I.TableCell,{className:"py-0.5 max-h-8 overflow-hidden whitespace-nowrap",children:(0,_.jsx)(tB.Tooltip,{title:e.key_hash??"-",children:(0,_.jsx)("span",{className:"font-mono max-w-[15ch] truncate block text-blue-600",children:e.key_hash??"-"})})}),(0,_.jsx)(I.TableCell,{className:"py-0.5 max-h-8 overflow-hidden whitespace-nowrap",children:(0,_.jsx)(tB.Tooltip,{title:e.key_alias??"-",children:(0,_.jsx)("span",{className:"max-w-[15ch] truncate block",children:e.key_alias??"-"})})}),(0,_.jsx)(I.TableCell,{className:"py-0.5 max-h-8 overflow-hidden whitespace-nowrap",children:(0,_.jsx)(tB.Tooltip,{title:e.user_agent??"-",children:(0,_.jsx)("span",{className:"font-mono max-w-[20ch] truncate block text-xs text-gray-500",children:e.user_agent??"-"})})})]},e.tool_id))})]}),Z>1&&(0,_.jsxs)("div",{className:"border-t px-6 py-3 flex items-center justify-between text-sm text-gray-600",children:[(0,_.jsxs)("span",{children:["Showing ",(v-1)*50+1," - ",Math.min(50*v,X.length)," of"," ",X.length]}),(0,_.jsxs)("div",{className:"flex gap-1",children:[(0,_.jsx)("button",{onClick:()=>j(e=>Math.max(1,e-1)),disabled:1===v,className:"px-3 py-1.5 border rounded-md hover:bg-gray-50 disabled:opacity-40",children:"Previous"}),(0,_.jsx)("button",{onClick:()=>j(e=>Math.min(Z,e+1)),disabled:v===Z,className:"px-3 py-1.5 border rounded-md hover:bg-gray-50 disabled:opacity-40",children:"Next"})]})]})]})]})};function FY({accessToken:e,userRole:t}){let[r,a]=(0,T.useState)({type:"overview"});return(0,_.jsx)("div",{className:"p-6 w-full min-w-0 flex-1",children:"detail"===r.type?(0,_.jsx)(FL,{toolName:r.toolName,onBack:()=>{a({type:"overview"})},accessToken:e}):(0,_.jsx)(FI,{accessToken:e,userRole:t,onSelectTool:e=>{a({type:"detail",toolName:e})}})})}var Ff=Ff;let{Text:FF}=V.Typography,FR=({open:e,mode:t,initialRow:r,onClose:a,onSave:s})=>{let[n]=H.Form.useForm(),[l,i]=(0,T.useState)(!1);(0,T.useEffect)(()=>{e&&("edit"===t&&r?n.setFieldsValue({key:r.key,value:r.value,metadata:null!=r.metadata?JSON.stringify(r.metadata,null,2):""}):n.resetFields())},[e,t,r,n]);let o=async()=>{let e=await n.validateFields();i(!0);let r=await s(e.key.trim(),e.value??"",e.metadata??"","create"===t);i(!1),r&&(n.resetFields(),a())};return(0,_.jsx)(q.Modal,{open:e,title:"create"===t?"Create memory":`Edit ${r?.key??""}`,onCancel:()=>{n.resetFields(),a()},onOk:o,okText:"create"===t?"Create":"Save",confirmLoading:l,width:640,destroyOnClose:!0,children:(0,_.jsxs)(H.Form,{form:n,layout:"vertical",children:[(0,_.jsx)(H.Form.Item,{label:"Key",name:"key",rules:[{required:!0,message:"Key is required"}],tooltip:"Globally unique — two memories cannot share a key. Namespace your own keys if you need per-user isolation (e.g. user:123:notes).",children:(0,_.jsx)($.Input,{placeholder:"e.g. user_role",disabled:"edit"===t})}),(0,_.jsx)(H.Form.Item,{label:"Value",name:"value",rules:[{required:!0,message:"Value is required"}],tooltip:"Markdown/text injected into LLM context. Plain strings are fine.",children:(0,_.jsx)($.Input.TextArea,{rows:8,placeholder:"What the agent should remember…"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Metadata ",(0,_.jsx)(FF,{type:"secondary",children:"(optional JSON)"})]}),name:"metadata",tooltip:"Optional structured metadata — must be valid JSON if provided.",children:(0,_.jsx)($.Input.TextArea,{rows:4,placeholder:'{"tags": ["example"]}',style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace"}})})]})})},{Text:FB,Paragraph:Fz,Title:FH}=V.Typography;function F$(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}let Fq=({accessToken:e})=>{let[t,r]=(0,T.useState)(""),[a,s]=(0,T.useState)(""),[n,l]=(0,T.useState)(null),[i,o]=(0,T.useState)(null),[d,c]=(0,T.useState)(null),[u,m]=(0,T.useState)(!1),[p,h]=(0,T.useState)(1);T.default.useEffect(()=>{h(1)},[a]);let f=(0,eh.useQueryClient)(),x="memoryList",{data:g,isLoading:y,isFetching:b}=(0,ev.useQuery)({queryKey:[x,a,p],queryFn:()=>{if(!e)throw Error("Access token required");return(0,Q.fetchMemoryList)(e,{keyPrefix:a||void 0,page:p,pageSize:50})},enabled:!!e}),v=(0,T.useMemo)(()=>g?.memories??[],[g]),j=g?.total??0,w=()=>f.invalidateQueries({queryKey:[x]}),k=(0,ep.useMutation)({mutationFn:t=>{if(!e)throw Error("Access token required");return(0,Q.createMemory)(e,t)},onSuccess:e=>{LB.message.success(`Created ${e.key}`),w()},onError:e=>{LB.message.error(`Save failed: ${e.message}`)}}),S=(0,ep.useMutation)({mutationFn:t=>{if(!e)throw Error("Access token required");let{key:r,...a}=t;return(0,Q.updateMemory)(e,r,a)},onSuccess:e=>{LB.message.success(`Updated ${e.key}`),w()},onError:e=>{LB.message.error(`Save failed: ${e.message}`)}}),N=(0,ep.useMutation)({mutationFn:t=>{if(!e)throw Error("Access token required");return(0,Q.deleteMemory)(e,t).then(()=>t)},onSuccess:e=>{LB.message.success(`Deleted ${e}`),w()},onError:e=>{LB.message.error(`Delete failed: ${e.message}`)}}),M=async()=>{if(d)try{await N.mutateAsync(d.key),c(null)}catch{}},C=async(t,r,a,s)=>{let n;if(!e)return!1;if(a.trim())try{n=JSON.parse(a)}catch{return LB.message.error("Metadata must be valid JSON (or leave empty)."),!1}else n=s?void 0:null;try{return s?await k.mutateAsync({key:t,value:r,metadata:n}):await S.mutateAsync({key:t,value:r,metadata:n}),!0}catch{return!1}},L=(e,t)=>{if(!e)return(0,_.jsx)(FB,{type:"secondary",children:"-"});let r=e.length>10?`${e.slice(0,7)}...`:e,a="font-mono text-blue-600 bg-blue-50 text-xs font-medium px-2 py-0.5 rounded-md border border-blue-200 inline-block max-w-[15ch] truncate whitespace-nowrap";return(0,_.jsx)(tB.Tooltip,{title:e,children:t?(0,_.jsx)("button",{onClick:t,className:`${a} hover:bg-blue-100 cursor-pointer transition-colors text-left`,children:r}):(0,_.jsx)("span",{className:a,children:r})})},O=[{title:"ID",dataIndex:"memory_id",key:"memory_id",width:140,render:(e,t)=>L(t.memory_id,()=>l(t))},{title:"Name",dataIndex:"key",key:"key",width:200,render:e=>(0,_.jsx)(FB,{code:!0,children:e})},{title:"Preview",dataIndex:"value",key:"value",render:e=>(0,_.jsx)(FB,{type:"secondary",style:{whiteSpace:"pre-wrap"},children:function(e,t=120){if(!e)return"";let r=e.trim();return r.length<=t?r:`${r.slice(0,t)}…`}(e)})},{title:"User ID",dataIndex:"user_id",key:"user_id",width:160,render:e=>L(e)},{title:"Team ID",dataIndex:"team_id",key:"team_id",width:160,render:e=>L(e)},{title:"Updated",dataIndex:"updated_at",key:"updated_at",width:180,render:e=>(0,_.jsx)(FB,{type:"secondary",children:F$(e)})},{title:"",key:"actions",width:140,render:(e,t)=>(0,_.jsxs)(U.Space,{size:4,children:[(0,_.jsx)(z.Button,{size:"small",type:"text",icon:(0,_.jsx)(Ff.default,{}),onClick:()=>l(t),"aria-label":"View"}),(0,_.jsx)(z.Button,{size:"small",type:"text",icon:(0,_.jsx)(wX.EditOutlined,{}),onClick:()=>o(t),"aria-label":"Edit"}),(0,_.jsx)(z.Button,{size:"small",type:"text",danger:!0,icon:(0,_.jsx)(jQ.DeleteOutlined,{}),onClick:()=>{c(t)},"aria-label":"Delete"})]})}];return(0,_.jsxs)("div",{className:"w-full",style:{padding:24},children:[(0,_.jsxs)(U.Space,{direction:"vertical",size:"large",style:{width:"100%"},children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(FH,{level:3,style:{marginBottom:4},children:"Memory"}),(0,_.jsxs)(Fz,{type:"secondary",style:{marginBottom:0},children:["Inspect what your agents have stored under ",(0,_.jsx)(FB,{code:!0,children:"/v1/memory"}),". Scoped to memories visible to your user / team (admins see all)."]})]}),(0,_.jsxs)(eg.Card,{children:[(0,_.jsxs)(U.Space,{style:{width:"100%",justifyContent:"space-between",marginBottom:16},wrap:!0,children:[(0,_.jsxs)(U.Space,{children:[(0,_.jsx)($.Input,{allowClear:!0,placeholder:'Filter by key prefix, e.g. "user:"',prefix:(0,_.jsx)(ry.SearchOutlined,{}),value:t,onChange:e=>r(e.target.value),onPressEnter:()=>s(t.trim()),onClear:()=>{r(""),s("")},style:{width:280}}),(0,_.jsx)(z.Button,{type:"primary",ghost:!0,onClick:()=>s(t.trim()),children:"Search"}),(0,_.jsx)(z.Button,{icon:(0,_.jsx)(rg.ReloadOutlined,{}),onClick:()=>w(),loading:b&&!y,children:"Refresh"})]}),(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(tZ.PlusOutlined,{}),onClick:()=>m(!0),children:"New memory"})]}),(0,_.jsx)(eK.Table,{rowKey:"memory_id",loading:y,dataSource:v,columns:O,pagination:{current:p,pageSize:50,total:j,showSizeChanger:!1,showTotal:(e,t)=>`${t[0]}–${t[1]} of ${e}`,onChange:e=>h(e)},locale:{emptyText:(0,_.jsx)(e0.Empty,{description:a?`No memories with keys starting with "${a}"`:"No memories stored yet"})}})]})]}),(0,_.jsx)(kJ,{open:!!n,onClose:()=>l(null),title:n?(0,_.jsx)(U.Space,{children:(0,_.jsx)(FB,{code:!0,children:n.key})}):"Memory",width:720,destroyOnClose:!0,children:n&&(0,_.jsxs)(U.Space,{direction:"vertical",size:"middle",style:{width:"100%"},children:[(0,_.jsxs)(U.Space,{size:"large",wrap:!0,children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(FB,{strong:!0,style:{display:"block"},children:"Memory ID"}),(0,_.jsx)(FB,{code:!0,style:{fontSize:12},children:n.memory_id})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(FB,{strong:!0,style:{display:"block"},children:"User ID"}),(0,_.jsx)(FB,{type:n.user_id?void 0:"secondary",children:n.user_id??"-"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(FB,{strong:!0,style:{display:"block"},children:"Team ID"}),(0,_.jsx)(FB,{type:n.team_id?void 0:"secondary",children:n.team_id??"-"})]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(FB,{strong:!0,children:"Value"}),(0,_.jsx)(Fz,{style:{background:"#fafafa",padding:12,borderRadius:6,whiteSpace:"pre-wrap",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:13},children:n.value})]}),void 0!==n.metadata&&null!==n.metadata&&(0,_.jsxs)("div",{children:[(0,_.jsx)(FB,{strong:!0,children:"Metadata"}),(0,_.jsx)(Fz,{style:{background:"#fafafa",padding:12,borderRadius:6,whiteSpace:"pre-wrap",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:12},children:JSON.stringify(n.metadata,null,2)})]}),(0,_.jsxs)(U.Space,{split:(0,_.jsx)(FB,{type:"secondary",children:"·"}),wrap:!0,size:"small",style:{color:"rgba(0,0,0,0.45)"},children:[(0,_.jsxs)(FB,{type:"secondary",children:["Created ",F$(n.created_at),n.created_by?` by ${n.created_by}`:""]}),(0,_.jsxs)(FB,{type:"secondary",children:["Updated ",F$(n.updated_at),n.updated_by?` by ${n.updated_by}`:""]})]})]})}),(0,_.jsx)(FR,{open:u||!!i,mode:i?"edit":"create",initialRow:i??void 0,onClose:()=>{m(!1),o(null)},onSave:C}),(0,_.jsx)(eH.default,{isOpen:!!d,title:"Delete memory",message:"This action cannot be undone.",resourceInformationTitle:"Memory",resourceInformation:d?[{label:"Key",value:d.key,code:!0},{label:"Memory ID",value:d.memory_id,code:!0},{label:"User ID",value:d.user_id??"-",code:!0},{label:"Team ID",value:d.team_id??"-",code:!0}]:[],onCancel:()=>{N.isPending||c(null)},onOk:M,confirmLoading:N.isPending,requiredConfirmation:d?.key})]})},{Text:FU}=V.Typography,FW={pending:"#a1a1aa",running:"#3b82f6",paused:"#f59e0b",completed:"#22c55e",failed:"#ef4444"},FV={"step.started":{bar:"#f0fdf4",border:"#86efac",text:"#16a34a"},"step.failed":{bar:"#fef2f2",border:"#fca5a5",text:"#dc2626"},"hook.waiting":{bar:"#fffbeb",border:"#fcd34d",text:"#d97706"},"hook.received":{bar:"#eff6ff",border:"#93c5fd",text:"#2563eb"}};function FG(e){let t=Date.now()-new Date(e).getTime();if(isNaN(t))return e;let r=Math.floor(t/1e3);if(r<60)return`${r}s ago`;let a=Math.floor(r/60);if(a<60)return`${a}m ago`;let s=Math.floor(a/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function FK(e){return e<0?"":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function FJ(e){let t=e.metadata?.title;return t?String(t):e.workflow_type??e.run_id.slice(0,8)}function FQ(e){return e.slice(0,8)}let FX=({status:e,size:t=8})=>(0,_.jsx)("span",{style:{display:"inline-block",width:t,height:t,borderRadius:"50%",background:FW[e]??"#a1a1aa",flexShrink:0}}),FZ=({value:e})=>{let[t,r]=(0,T.useState)(!1);return e.length<=120?(0,_.jsx)("span",{style:{color:"#27272a",wordBreak:"break-all"},children:e}):(0,_.jsxs)("span",{style:{color:"#27272a",wordBreak:"break-all"},children:[t?e:e.slice(0,120)+"…",(0,_.jsx)("button",{onClick:()=>r(e=>!e),style:{background:"none",border:"none",padding:"0 4px",cursor:"pointer",color:"#2563eb",fontSize:11,flexShrink:0},children:t?"less":"more"})]})},F0=({run:e})=>{let t=e.metadata??{},r=[{key:"state",label:"state"},{key:"worktree_path",label:"worktree"},{key:"grill_session_id",label:"grill session"},{key:"session_id",label:"session"}],a=new Set(["title",...r.map(e=>e.key)]),s=Object.entries(t).filter(([e,t])=>!a.has(e)&&null!=t&&""!==t);return(0,_.jsxs)("div",{style:{borderRadius:8,border:"1px solid #e4e4e7",marginBottom:16,overflow:"hidden"},children:[(0,_.jsxs)("div",{style:{padding:"14px 20px",borderBottom:"1px solid #f4f4f5",display:"flex",alignItems:"center",gap:10},children:[(0,_.jsx)(FX,{status:e.status,size:10}),(0,_.jsx)("span",{style:{fontSize:14,fontWeight:600,color:"#18181b",flex:1},children:FJ(e)}),(0,_.jsx)("span",{style:{fontFamily:"monospace",fontSize:11,color:"#a1a1aa",background:"#f4f4f5",padding:"2px 8px",borderRadius:4},children:FQ(e.run_id)}),(0,_.jsx)("span",{style:{fontSize:11,color:"#a1a1aa",background:"#f4f4f5",padding:"2px 8px",borderRadius:4},children:e.workflow_type})]}),(0,_.jsxs)("div",{style:{padding:"12px 20px",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:"8px 24px",fontFamily:"monospace",fontSize:12},children:[(0,_.jsx)(F1,{label:"status",children:(0,_.jsx)("span",{style:{textTransform:"capitalize",color:"#27272a"},children:e.status})}),(0,_.jsx)(F1,{label:"created",children:(0,_.jsx)("span",{style:{color:"#27272a"},children:FG(e.created_at)})}),t.pr_url&&(0,_.jsx)(F1,{label:"pr",children:(0,_.jsx)("a",{href:String(t.pr_url),target:"_blank",rel:"noopener noreferrer",style:{color:"#2563eb",textDecoration:"none",wordBreak:"break-all"},children:String(t.pr_url)})}),r.map(({key:e,label:r})=>{let a=t[e];if(null==a||""===a)return null;let s="object"==typeof a?JSON.stringify(a):String(a);return(0,_.jsx)(F1,{label:r,children:(0,_.jsx)(FZ,{value:s})},e)}),s.map(([e,t])=>{let r="object"==typeof t?JSON.stringify(t):String(t);return(0,_.jsx)(F1,{label:e,children:(0,_.jsx)(FZ,{value:r})},e)})]})]})},F1=({label:e,children:t})=>(0,_.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:1},children:[(0,_.jsx)("span",{style:{fontSize:10,color:"#a1a1aa",textTransform:"uppercase",letterSpacing:"0.06em"},children:e}),(0,_.jsx)("span",{style:{fontSize:12},children:t})]}),F2=({run:e,events:t})=>{if(0===t.length)return(0,_.jsx)("div",{style:{padding:"16px 0",color:"#a1a1aa",fontSize:12,fontFamily:"monospace"},children:"No events recorded"});let r=new Date(e.created_at).getTime(),a=Math.max(...t.map(e=>new Date(e.created_at).getTime())),s=Math.max(a-r,1),n=FK(a-r);return(0,_.jsxs)("div",{style:{fontFamily:"monospace",fontSize:12},children:[(0,_.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"160px 1fr",gap:"0 12px",marginBottom:2},children:[(0,_.jsx)("div",{}),(0,_.jsx)("div",{style:{position:"relative",height:16},children:[0,100].map(e=>(0,_.jsx)("span",{style:{position:"absolute",left:`${e}%`,transform:100===e?"translateX(-100%)":void 0,fontSize:10,color:"#a1a1aa"},children:0===e?"0":n},e))})]}),(0,_.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"160px 1fr",gap:"0 12px",marginBottom:4},children:[(0,_.jsx)("div",{style:{color:"#3f3f46",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingTop:2},children:FJ(e)}),(0,_.jsx)("div",{style:{height:24,background:"#f4f4f5",border:"1px solid #d4d4d8",borderRadius:4,display:"flex",alignItems:"center",paddingLeft:8},children:(0,_.jsx)("span",{style:{color:"#71717a",fontSize:11},children:n})})]}),(0,_.jsx)("div",{style:{display:"grid",gridTemplateColumns:"160px 1fr",gap:"0 12px",rowGap:3},children:t.map(e=>{let n=new Date(e.created_at).getTime(),l=(n-r)/s*100,i=t.findIndex(t=>t.sequence_number>e.sequence_number),o=i>=0?new Date(t[i].created_at).getTime():a+Math.max(.12*s,500),d=Math.max(8,(o-n)/s*100),c=FV[e.event_type]??{bar:"#f4f4f5",border:"#d4d4d8",text:"#52525b"},u=FK(o-n);return(0,_.jsxs)(T.default.Fragment,{children:[(0,_.jsx)("div",{style:{color:c.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingTop:2,paddingLeft:12},children:e.step_name||e.event_type}),(0,_.jsx)("div",{style:{position:"relative",height:24},children:(0,_.jsx)(tB.Tooltip,{title:(0,_.jsxs)("div",{style:{fontFamily:"monospace",fontSize:11,lineHeight:1.6},children:[(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{style:{color:"#a1a1aa"},children:"type: "}),(0,_.jsx)("span",{style:{color:c.text},children:e.event_type})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{style:{color:"#a1a1aa"},children:"step: "}),e.step_name]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{style:{color:"#a1a1aa"},children:"seq: "}),e.sequence_number]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{style:{color:"#a1a1aa"},children:"time: "}),FG(e.created_at)]}),e.data&&Object.keys(e.data).length>0&&(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{style:{color:"#a1a1aa"},children:"data: "}),JSON.stringify(e.data)]})]}),children:(0,_.jsxs)("div",{style:{position:"absolute",left:`${Math.min(l,92)}%`,width:`${Math.min(d,100-Math.min(l,92))}%`,height:"100%",background:c.bar,border:`1px solid ${c.border}`,borderRadius:4,display:"flex",alignItems:"center",paddingLeft:8,cursor:"default",overflow:"hidden",gap:6},children:[(0,_.jsx)("span",{style:{color:c.text,whiteSpace:"nowrap",fontSize:11},children:e.event_type}),u&&(0,_.jsx)("span",{style:{color:"#a1a1aa",whiteSpace:"nowrap",fontSize:11},children:u})]})})})]},e.event_id)})})]})},F4=({msg:e})=>{let t={user:"#2563eb",assistant:"#16a34a",system:"#7c3aed",tool_result:"#d97706"}[e.role]??"#52525b";return(0,_.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"80px 1fr",gap:"0 16px",padding:"10px 0",borderBottom:"1px solid #f4f4f5",fontFamily:"monospace",fontSize:12,alignItems:"start"},children:[(0,_.jsxs)("span",{style:{color:t,paddingTop:1},children:["[",e.role,"]"]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{style:{color:"#27272a",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word",display:"block"},children:e.content}),(0,_.jsx)("span",{style:{color:"#a1a1aa",fontSize:11,marginTop:2,display:"block"},children:FG(e.created_at)})]})]})},F5=({accessToken:e})=>{let[t,r]=(0,T.useState)([]),[a,s]=(0,T.useState)(!1),[n,l]=(0,T.useState)(null),[i,o]=(0,T.useState)([]),[d,c]=(0,T.useState)([]),[u,m]=(0,T.useState)(!1),[p,h]=(0,T.useState)(!1),f=(0,T.useCallback)(async()=>{if(e){s(!0);try{let t=await fetch(`${Q.proxyBaseUrl??""}/v1/workflows/runs?limit=100`,{headers:{Authorization:`Bearer ${e}`}});if(!t.ok)throw Error(`HTTP ${t.status}`);let a=await t.json();r(a.runs??[])}catch(e){console.error("workflow runs fetch failed:",e)}finally{s(!1)}}},[e]),x=(0,T.useCallback)(async t=>{if(e){l(t),h(!0),m(!0),o([]),c([]);try{let r=Q.proxyBaseUrl??"",[a,s]=await Promise.all([fetch(`${r}/v1/workflows/runs/${t.run_id}/events`,{headers:{Authorization:`Bearer ${e}`}}),fetch(`${r}/v1/workflows/runs/${t.run_id}/messages`,{headers:{Authorization:`Bearer ${e}`}})]),n=a.ok?await a.json():{events:[]},l=s.ok?await s.json():{messages:[]};o([...n.events??[]].sort((e,t)=>e.sequence_number-t.sequence_number)),c([...l.messages??[]].sort((e,t)=>e.sequence_number-t.sequence_number))}catch(e){console.error("workflow run detail fetch failed:",e)}finally{m(!1)}}},[e]);(0,T.useEffect)(()=>{f()},[f]);let g=[{title:"Run",dataIndex:"run_id",key:"run",render:(e,t)=>(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,_.jsx)(FX,{status:t.status,size:7}),(0,_.jsxs)("div",{children:[(0,_.jsx)("div",{style:{fontSize:13,color:"#18181b",fontWeight:500,lineHeight:1.4},children:FJ(t)}),(0,_.jsx)("div",{style:{fontFamily:"monospace",fontSize:11,color:"#a1a1aa"},children:FQ(t.run_id)})]})]})},{title:"Type",dataIndex:"workflow_type",key:"workflow_type",render:e=>(0,_.jsx)("span",{style:{fontFamily:"monospace",fontSize:12,color:"#71717a"},children:e})},{title:"Status",dataIndex:"status",key:"status",render:(e,t)=>{let r=t.metadata?.state;return(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,_.jsx)(FX,{status:e,size:7}),(0,_.jsx)("span",{style:{fontSize:12,color:"#52525b",textTransform:"capitalize"},children:r??e})]})}},{title:"Created",dataIndex:"created_at",key:"created_at",render:e=>(0,_.jsx)("span",{style:{fontSize:12,color:"#a1a1aa"},children:FG(e)})}];return(0,_.jsxs)("div",{style:{padding:"24px 32px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',minHeight:"calc(100vh - 64px)",background:"#fff"},children:[(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:20},children:[(0,_.jsxs)("div",{children:[(0,_.jsx)("div",{style:{fontSize:18,fontWeight:600,color:"#18181b"},children:"Workflow Runs"}),(0,_.jsx)("div",{style:{fontSize:13,color:"#71717a",marginTop:2},children:"Durable state tracking for agents and automated workflows"})]}),(0,_.jsx)(z.Button,{icon:(0,_.jsx)(rg.ReloadOutlined,{}),onClick:f,loading:a,style:{color:"#71717a",borderColor:"#e4e4e7"},children:"Refresh"})]}),(0,_.jsx)("div",{className:"rounded-lg custom-border overflow-x-auto w-full",children:(0,_.jsx)(eK.Table,{dataSource:t,columns:g,rowKey:"run_id",loading:a,size:"small",pagination:{pageSize:50,hideOnSinglePage:!0,size:"small"},onRow:e=>({onClick:()=>x(e),style:{cursor:"pointer"}}),locale:{emptyText:(0,_.jsx)(e0.Empty,{description:(0,_.jsx)("span",{style:{color:"#a1a1aa",fontSize:13},children:"No workflow runs yet"}),image:e0.Empty.PRESENTED_IMAGE_SIMPLE})},className:"[&_.ant-table-cell]:py-0.5 [&_.ant-table-thead_.ant-table-cell]:py-1",style:{border:"none"}})}),(0,_.jsx)(kJ,{open:p,onClose:()=>h(!1),width:680,title:null,closable:!1,bodyStyle:{padding:0},styles:{body:{padding:0}},children:n?u?(0,_.jsx)("div",{style:{display:"flex",justifyContent:"center",padding:80},children:(0,_.jsx)(rm.Spin,{})}):(0,_.jsxs)("div",{style:{padding:"24px 28px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:[(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[(0,_.jsx)("button",{onClick:()=>h(!1),style:{background:"none",border:"none",cursor:"pointer",padding:"4px 0",fontSize:12,color:"#a1a1aa",display:"flex",alignItems:"center",gap:4},children:"← close"}),(0,_.jsx)(z.Button,{size:"small",icon:(0,_.jsx)(rg.ReloadOutlined,{}),onClick:()=>x(n),loading:u,style:{color:"#71717a",borderColor:"#e4e4e7"},children:"Refresh"})]}),(0,_.jsx)(F0,{run:n}),(0,_.jsx)(tl.Collapse,{defaultActiveKey:["timeline"],ghost:!1,style:{border:"1px solid #e4e4e7",borderRadius:8,overflow:"hidden"},items:[{key:"timeline",label:(0,_.jsxs)("span",{style:{fontSize:12,fontWeight:500,color:"#3f3f46"},children:["Timeline",(0,_.jsxs)("span",{style:{marginLeft:6,fontSize:11,color:"#a1a1aa",fontWeight:400},children:[i.length," ",1===i.length?"event":"events"]})]}),children:(0,_.jsx)("div",{style:{padding:"4px 4px 12px"},children:(0,_.jsx)(F2,{run:n,events:i})})},{key:"messages",label:(0,_.jsxs)("span",{style:{fontSize:12,fontWeight:500,color:"#3f3f46"},children:["Messages",(0,_.jsx)("span",{style:{marginLeft:6,fontSize:11,color:"#a1a1aa",fontWeight:400},children:d.length})]}),children:0===d.length?(0,_.jsx)("div",{style:{padding:"12px 4px",color:"#a1a1aa",fontSize:12,fontFamily:"monospace"},children:"No messages"}):(0,_.jsx)("div",{style:{paddingBottom:4},children:d.map(e=>(0,_.jsx)(F4,{msg:e},e.message_id))})}]})]}):null})]})};var F6=e.i(207082);function F3({keys:e,totalCount:t,isLoading:r,isFetching:a,pageIndex:s,pageSize:n,onPageChange:l}){let[i,o]=(0,T.useState)([{id:"deleted_at",desc:!0}]),[d,c]=(0,T.useState)({pageIndex:s,pageSize:n});T.default.useEffect(()=>{c({pageIndex:s,pageSize:n})},[s,n]);let u=[{id:"token",accessorKey:"token",header:"Key ID",size:150,maxSize:250,cell:e=>{let t=e.getValue();return(0,_.jsx)(tB.Tooltip,{title:t,children:(0,_.jsx)("span",{className:"font-mono text-blue-500 text-xs truncate block max-w-[250px]",children:t||"-"})})}},{id:"key_alias",accessorKey:"key_alias",header:"Key Alias",size:150,maxSize:200,cell:e=>{let t=e.getValue();return(0,_.jsx)(tB.Tooltip,{title:t,children:(0,_.jsx)("span",{className:"font-mono text-xs truncate block max-w-[200px]",children:t??"-"})})}},{id:"team_alias",accessorKey:"team_alias",header:"Team Alias",size:120,maxSize:180,cell:e=>{let t=e.getValue();return(0,_.jsx)("span",{className:"truncate block max-w-[180px]",children:t||"-"})}},{id:"spend",accessorKey:"spend",header:"Spend (USD)",size:100,maxSize:140,cell:e=>(0,_.jsx)("span",{className:"block max-w-[140px]",children:(0,rV.formatNumberWithCommas)(e.getValue(),4)})},{id:"max_budget",accessorKey:"max_budget",header:"Budget (USD)",size:110,maxSize:150,cell:e=>{let t=e.getValue();return(0,_.jsx)("span",{className:"block max-w-[150px]",children:null===t?"Unlimited":`$${(0,rV.formatNumberWithCommas)(t)}`})}},{id:"user_email",accessorKey:"user_email",header:"User Email",size:160,maxSize:250,cell:e=>{let t=e.getValue();return(0,_.jsx)(tB.Tooltip,{title:t,children:(0,_.jsx)("span",{className:"font-mono text-xs truncate block max-w-[250px]",children:t??"-"})})}},{id:"user_id",accessorKey:"user_id",header:"User ID",size:120,maxSize:200,cell:e=>{let t=e.getValue();return(0,_.jsx)(tB.Tooltip,{title:t||void 0,children:(0,_.jsx)("span",{className:"truncate block max-w-[200px]",children:t||"-"})})}},{id:"created_at",accessorKey:"created_at",header:"Created At",size:120,maxSize:140,cell:e=>{let t=e.getValue();return(0,_.jsx)("span",{className:"block max-w-[140px]",children:t?new Date(t).toLocaleDateString():"-"})}},{id:"created_by",accessorKey:"created_by",header:"Created By",size:120,maxSize:180,cell:e=>{let t=e.row.original.created_by;return(0,_.jsx)(tB.Tooltip,{title:t||void 0,children:(0,_.jsx)("span",{className:"truncate block max-w-[180px]",children:t||"-"})})}},{id:"deleted_at",accessorKey:"deleted_at",header:"Deleted At",size:120,maxSize:140,cell:e=>{let t=e.row.original.deleted_at;return(0,_.jsx)("span",{className:"block max-w-[140px]",children:t?new Date(t).toLocaleDateString():"-"})}},{id:"deleted_by",accessorKey:"deleted_by",header:"Deleted By",size:120,maxSize:180,cell:e=>{let t=e.row.original.deleted_by;return(0,_.jsx)(tB.Tooltip,{title:t||void 0,children:(0,_.jsx)("span",{className:"truncate block max-w-[180px]",children:t||"-"})})}}],m=(0,jD.useReactTable)({data:e,columns:u,columnResizeMode:"onChange",columnResizeDirection:"ltr",state:{sorting:i,pagination:d},onSortingChange:o,onPaginationChange:e=>{let t="function"==typeof e?e(d):e;c(t),l(t.pageIndex)},getCoreRowModel:(0,jP.getCoreRowModel)(),getSortedRowModel:(0,jP.getSortedRowModel)(),getPaginationRowModel:(0,jP.getPaginationRowModel)(),enableSorting:!0,manualSorting:!1,manualPagination:!0,pageCount:Math.ceil(t/n)}),{pageIndex:p}=m.getState().pagination,h=p*n+1,f=Math.min((p+1)*n,t),x=`${h} - ${f}`;return(0,_.jsx)("div",{className:"w-full h-full overflow-hidden",children:(0,_.jsxs)("div",{className:"border-b py-4 flex-1 overflow-hidden",children:[(0,_.jsxs)("div",{className:"flex items-center justify-between w-full mb-4",children:[r||a?(0,_.jsx)("span",{className:"inline-flex text-sm text-gray-700",children:"Loading..."}):(0,_.jsxs)("span",{className:"inline-flex text-sm text-gray-700",children:["Showing ",x," of ",t," results"]}),(0,_.jsxs)("div",{className:"inline-flex items-center gap-2",children:[r||a?(0,_.jsx)("span",{className:"text-sm text-gray-700",children:"Loading..."}):(0,_.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",p+1," of ",m.getPageCount()]}),(0,_.jsx)("button",{onClick:()=>m.previousPage(),disabled:r||a||!m.getCanPreviousPage(),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,_.jsx)("button",{onClick:()=>m.nextPage(),disabled:r||a||!m.getCanNextPage(),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]}),(0,_.jsx)("div",{className:"h-[75vh] overflow-auto",children:(0,_.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,_.jsx)("div",{className:"overflow-x-auto",children:(0,_.jsxs)(A.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",style:{width:m.getCenterTotalSize()},children:[(0,_.jsx)(Y.TableHead,{children:m.getHeaderGroups().map(e=>(0,_.jsx)(R.TableRow,{children:e.headers.map(e=>(0,_.jsx)(F.TableHeaderCell,{"data-header-id":e.id,className:"py-1 h-8 relative hover:bg-gray-50",style:{width:e.getSize(),maxWidth:e.column.columnDef.maxSize,position:"relative"},onMouseEnter:()=>{let t=document.querySelector(`[data-header-id="${e.id}"] .resizer`);t&&(t.style.opacity="0.5")},onMouseLeave:()=>{let t=document.querySelector(`[data-header-id="${e.id}"] .resizer`);t&&!e.column.getIsResizing()&&(t.style.opacity="0")},onClick:e.column.getToggleSortingHandler(),children:(0,_.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,_.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,jD.flexRender)(e.column.columnDef.header,e.getContext())}),(0,_.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,_.jsx)(jC.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,_.jsx)(jM.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,_.jsx)(jL.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})}),(0,_.jsx)("div",{onDoubleClick:()=>e.column.resetSize(),onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:`resizer ${m.options.columnResizeDirection} ${e.column.getIsResizing()?"isResizing":""}`,style:{position:"absolute",right:0,top:0,height:"100%",width:"5px",background:e.column.getIsResizing()?"#3b82f6":"transparent",cursor:"col-resize",userSelect:"none",touchAction:"none",opacity:+!!e.column.getIsResizing()}})]})},e.id))},e.id))}),(0,_.jsx)(E.TableBody,{children:r||a?(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:u.length,className:"h-8 text-center",children:(0,_.jsx)("div",{className:"text-center text-gray-500",children:(0,_.jsx)("p",{children:"🚅 Loading keys..."})})})}):e.length>0?m.getRowModel().rows.map(e=>(0,_.jsx)(R.TableRow,{className:"h-8",children:e.getVisibleCells().map(e=>(0,_.jsx)(I.TableCell,{style:{width:e.column.getSize(),maxWidth:e.column.columnDef.maxSize,whiteSpace:"pre-wrap",overflow:"hidden"},className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,jD.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:u.length,className:"h-8 text-center",children:(0,_.jsx)("div",{className:"text-center text-gray-500",children:(0,_.jsx)("p",{children:"No deleted keys found"})})})})})]})})})})]})})}function F8(){let{premiumUser:e}=(0,k.default)(),[t,r]=(0,T.useState)(0),[a]=(0,T.useState)(50),{data:s,isPending:n,isFetching:l}=(0,F6.useDeletedKeys)(t+1,a);return(0,_.jsxs)("div",{className:"flex flex-col gap-4",children:[!e&&(0,_.jsx)(B.Alert,{type:"info",banner:!0,showIcon:!0,message:"Coming soon to Enterprise",description:"Deleted key auditing is graduating from beta into our Enterprise audit & compliance suite."}),(0,_.jsx)(F3,{keys:s?.keys||[],totalCount:s?.total_count||0,isLoading:n,isFetching:l,pageIndex:t,pageSize:a,onPageChange:r})]})}function F7({teams:e,isLoading:t,isFetching:r}){let[a,s]=(0,T.useState)([{id:"deleted_at",desc:!0}]),n=[{id:"team_alias",accessorKey:"team_alias",header:"Team Name",size:150,maxSize:200,cell:e=>{let t=e.getValue();return(0,_.jsx)(tB.Tooltip,{title:t||void 0,children:(0,_.jsx)("span",{className:"truncate block max-w-[200px]",children:t||"-"})})}},{id:"team_id",accessorKey:"team_id",header:"Team ID",size:150,maxSize:250,cell:e=>{let t=e.getValue();return(0,_.jsx)(tB.Tooltip,{title:t,children:(0,_.jsx)("span",{className:"font-mono text-blue-500 text-xs truncate block max-w-[250px]",children:t||"-"})})}},{id:"created_at",accessorKey:"created_at",header:"Created",size:120,maxSize:140,cell:e=>{let t=e.getValue();return(0,_.jsx)("span",{className:"block max-w-[140px]",children:t?new Date(t).toLocaleDateString():"-"})}},{id:"spend",accessorKey:"spend",header:"Spend (USD)",size:100,maxSize:140,cell:e=>{let t=e.row.original.spend;return(0,_.jsx)("span",{className:"block max-w-[140px]",children:void 0!==t?(0,rV.formatNumberWithCommas)(t,4):"-"})}},{id:"max_budget",accessorKey:"max_budget",header:"Budget (USD)",size:110,maxSize:150,cell:e=>{let t=e.getValue();return(0,_.jsx)("span",{className:"block max-w-[150px]",children:null==t?"No limit":`$${(0,rV.formatNumberWithCommas)(t)}`})}},{id:"models",accessorKey:"models",header:"Models",size:200,maxSize:300,cell:e=>{let t=e.getValue();return Array.isArray(t)&&0!==t.length?(0,_.jsxs)("div",{className:"flex flex-wrap gap-1 max-w-[300px]",children:[t.slice(0,3).map((e,t)=>"all-proxy-models"===e?(0,_.jsx)(tR.Badge,{size:"xs",color:"red",children:(0,_.jsx)(Z.Text,{children:"All Proxy Models"})},t):(0,_.jsx)(tR.Badge,{size:"xs",color:"blue",children:(0,_.jsx)(Z.Text,{children:e.length>30?`${(0,tQ.getModelDisplayName)(e).slice(0,30)}...`:(0,tQ.getModelDisplayName)(e)})},t)),t.length>3&&(0,_.jsx)(tR.Badge,{size:"xs",color:"gray",children:(0,_.jsxs)(Z.Text,{children:["+",t.length-3," ",t.length-3==1?"more model":"more models"]})})]}):(0,_.jsx)(tR.Badge,{size:"xs",color:"red",children:(0,_.jsx)(Z.Text,{children:"All Proxy Models"})})}},{id:"organization_id",accessorKey:"organization_id",header:"Organization",size:150,maxSize:200,cell:e=>{let t=e.getValue();return(0,_.jsx)(tB.Tooltip,{title:t||void 0,children:(0,_.jsx)("span",{className:"truncate block max-w-[200px]",children:t||"-"})})}},{id:"deleted_at",accessorKey:"deleted_at",header:"Deleted At",size:120,maxSize:140,cell:e=>{let t=e.row.original.deleted_at;return(0,_.jsx)("span",{className:"block max-w-[140px]",children:t?new Date(t).toLocaleDateString():"-"})}},{id:"deleted_by",accessorKey:"deleted_by",header:"Deleted By",size:120,maxSize:180,cell:e=>{let t=e.row.original.deleted_by;return(0,_.jsx)(tB.Tooltip,{title:t||void 0,children:(0,_.jsx)("span",{className:"truncate block max-w-[180px]",children:t||"-"})})}}],l=(0,jD.useReactTable)({data:e,columns:n,columnResizeMode:"onChange",columnResizeDirection:"ltr",state:{sorting:a},onSortingChange:s,getCoreRowModel:(0,jP.getCoreRowModel)(),getSortedRowModel:(0,jP.getSortedRowModel)(),enableSorting:!0,manualSorting:!1});return(0,_.jsx)("div",{className:"w-full h-full overflow-hidden",children:(0,_.jsxs)("div",{className:"border-b py-4 flex-1 overflow-hidden",children:[(0,_.jsx)("div",{className:"flex items-center justify-between w-full mb-4",children:t||r?(0,_.jsx)("span",{className:"inline-flex text-sm text-gray-700",children:"Loading..."}):(0,_.jsxs)("span",{className:"inline-flex text-sm text-gray-700",children:["Showing ",e.length," ",1===e.length?"team":"teams"]})}),(0,_.jsx)("div",{className:"h-[75vh] overflow-auto",children:(0,_.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,_.jsx)("div",{className:"overflow-x-auto",children:(0,_.jsxs)(A.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",style:{width:l.getCenterTotalSize()},children:[(0,_.jsx)(Y.TableHead,{children:l.getHeaderGroups().map(e=>(0,_.jsx)(R.TableRow,{children:e.headers.map(e=>(0,_.jsx)(F.TableHeaderCell,{"data-header-id":e.id,className:"py-1 h-8 relative hover:bg-gray-50",style:{width:e.getSize(),maxWidth:e.column.columnDef.maxSize,position:"relative"},onMouseEnter:()=>{let t=document.querySelector(`[data-header-id="${e.id}"] .resizer`);t&&(t.style.opacity="0.5")},onMouseLeave:()=>{let t=document.querySelector(`[data-header-id="${e.id}"] .resizer`);t&&!e.column.getIsResizing()&&(t.style.opacity="0")},onClick:e.column.getToggleSortingHandler(),children:(0,_.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,_.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,jD.flexRender)(e.column.columnDef.header,e.getContext())}),(0,_.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,_.jsx)(jC.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,_.jsx)(jM.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,_.jsx)(jL.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})}),(0,_.jsx)("div",{onDoubleClick:()=>e.column.resetSize(),onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:`resizer ${l.options.columnResizeDirection} ${e.column.getIsResizing()?"isResizing":""}`,style:{position:"absolute",right:0,top:0,height:"100%",width:"5px",background:e.column.getIsResizing()?"#3b82f6":"transparent",cursor:"col-resize",userSelect:"none",touchAction:"none",opacity:+!!e.column.getIsResizing()}})]})},e.id))},e.id))}),(0,_.jsx)(E.TableBody,{children:t||r?(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:n.length,className:"h-8 text-center",children:(0,_.jsx)("div",{className:"text-center text-gray-500",children:(0,_.jsx)("p",{children:"🚅 Loading teams..."})})})}):e.length>0?l.getRowModel().rows.map(e=>(0,_.jsx)(R.TableRow,{className:"h-8",children:e.getVisibleCells().map(e=>(0,_.jsx)(I.TableCell,{style:{width:e.column.getSize(),maxWidth:e.column.columnDef.maxSize,whiteSpace:"pre-wrap",overflow:"hidden"},className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,jD.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:n.length,className:"h-8 text-center",children:(0,_.jsx)("div",{className:"text-center text-gray-500",children:(0,_.jsx)("p",{children:"No deleted teams found"})})})})})]})})})})]})})}function F9(){let{premiumUser:e}=(0,k.default)(),{data:t,isPending:r,isFetching:a}=(0,jY.useDeletedTeams)(1,100);return(0,_.jsxs)("div",{className:"flex flex-col gap-4",children:[!e&&(0,_.jsx)(B.Alert,{type:"info",banner:!0,showIcon:!0,message:"Coming soon to Enterprise",description:"Deleted team auditing is graduating from beta into our Enterprise audit & compliance suite."}),(0,_.jsx)(F7,{teams:t||[],isLoading:r,isFetching:a})]})}var Re=e.i(619273),Eh=MV;let{Text:Rt}=V.Typography,Rr={LiteLLM_VerificationToken:"Keys",LiteLLM_TeamTable:"Teams",LiteLLM_UserTable:"Users",LiteLLM_OrganizationTable:"Organizations",LiteLLM_ProxyModelTable:"Models"},Ra={created:"green",updated:"blue",deleted:"red",rotated:"orange"};function Rs({label:e,value:t}){let[r,a]=(0,T.useState)(!1),s=(0,T.useCallback)(async()=>{try{let e=JSON.stringify(t,null,2);if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(e);else{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select(),document.execCommand("copy"),document.body.removeChild(t)}a(!0),setTimeout(()=>a(!1),2e3)}catch(e){console.error("Copy failed:",e)}},[t]);return(0,_.jsxs)("div",{className:"bg-white rounded border overflow-hidden",children:[(0,_.jsxs)("div",{className:"flex justify-between items-center px-3 py-2 border-b bg-gray-50",children:[(0,_.jsx)("span",{className:"text-xs font-semibold text-gray-600",children:e}),(0,_.jsx)("button",{onClick:s,className:"p-1 hover:bg-gray-200 rounded text-gray-500 hover:text-gray-700 transition-colors",title:"Copy JSON",children:r?(0,_.jsx)(kQ.CheckOutlined,{className:"text-green-600"}):(0,_.jsx)(ei.CopyOutlined,{})})]}),(0,_.jsx)("pre",{className:"p-3 bg-white text-xs font-mono overflow-auto max-h-96 whitespace-pre-wrap break-all m-0",children:JSON.stringify(t,null,2)})]})}function Rn({label:e,value:t}){return(0,_.jsxs)("div",{className:"flex items-start gap-2 py-1.5",children:[(0,_.jsx)("span",{className:"text-xs text-gray-500 w-36 shrink-0",children:e}),(0,_.jsx)("span",{className:"text-xs text-gray-900 break-all",children:t})]})}function Rl({log:e}){let{action:t,table_name:r,before_value:a,updated_values:s}=e,n="LiteLLM_VerificationToken"===r,l="updated"===t||"rotated"===t,i=a,o=s;if(l&&a&&s){let e={},t={};new Set([...Object.keys(a),...Object.keys(s)]).forEach(r=>{JSON.stringify(a[r])!==JSON.stringify(s[r])&&(r in a&&(e[r]=a[r]),r in s&&(t[r]=s[r]))}),Object.keys(a).forEach(r=>{r in s||r in e||(e[r]=a[r],t[r]=void 0)}),Object.keys(s).forEach(r=>{r in a||r in t||(t[r]=s[r],e[r]=void 0)}),i=Object.keys(e).length>0?e:{note:"No differing fields detected"},o=Object.keys(t).length>0?t:{note:"No differing fields detected"}}let d=(e,t)=>{if(!t||0===Object.keys(t).length)return(0,_.jsxs)("div",{className:"bg-white rounded border overflow-hidden",children:[(0,_.jsx)("div",{className:"flex items-center px-3 py-2 border-b bg-gray-50",children:(0,_.jsx)("span",{className:"text-xs font-semibold text-gray-600",children:e})}),(0,_.jsx)("p",{className:"px-3 py-3 text-xs text-gray-400 italic m-0",children:"N/A"})]});if(n&&l){let r=["token","spend","max_budget"];if(Object.keys(t).every(e=>r.includes(e))&&!("note"in t))return(0,_.jsxs)("div",{className:"bg-white rounded border overflow-hidden",children:[(0,_.jsx)("div",{className:"flex items-center px-3 py-2 border-b bg-gray-50",children:(0,_.jsx)("span",{className:"text-xs font-semibold text-gray-600",children:e})}),(0,_.jsxs)("div",{className:"px-3 py-3 space-y-1 text-xs",children:[void 0!==t.token&&(0,_.jsxs)("p",{children:[(0,_.jsx)("span",{className:"text-gray-500",children:"Token:"})," ",t.token??"N/A"]}),void 0!==t.spend&&(0,_.jsxs)("p",{children:[(0,_.jsx)("span",{className:"text-gray-500",children:"Spend:"})," $",Number(t.spend).toFixed(6)]}),void 0!==t.max_budget&&(0,_.jsxs)("p",{children:[(0,_.jsx)("span",{className:"text-gray-500",children:"Max Budget:"})," $",Number(t.max_budget).toFixed(6)]})]})]})}return(0,_.jsx)(Rs,{label:e,value:t})};return(0,_.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[d("Before",i),d("After",o)]})}function Ri({open:e,onClose:t,log:r}){if(!r)return null;let a=Rr[r.table_name]??r.table_name,s=Ra[r.action]??"default";return(0,_.jsxs)(kJ,{placement:"right",width:"60%",open:e,onClose:t,closable:!1,mask:!0,maskClosable:!0,styles:{body:{padding:0,display:"flex",flexDirection:"column"},header:{display:"none"}},children:[(0,_.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b bg-white shrink-0",children:[(0,_.jsxs)("div",{className:"flex items-center gap-3",children:[(0,_.jsx)(eN.Tag,{color:s,className:"capitalize m-0",children:r.action}),(0,_.jsx)("span",{className:"text-sm text-gray-500",children:kl.default.utc(r.updated_at).local().format("MMM D, YYYY HH:mm:ss")})]}),(0,_.jsx)("button",{onClick:t,className:"w-8 h-8 flex items-center justify-center rounded hover:bg-gray-100 text-gray-500","aria-label":"Close",children:(0,_.jsx)(kp.CloseOutlined,{})})]}),(0,_.jsxs)("div",{className:"px-6 py-5",children:[(0,_.jsxs)("div",{className:"bg-gray-50 border rounded-lg p-4 mb-5",children:[(0,_.jsx)("p",{className:"text-xs font-semibold text-gray-700 mb-2 uppercase tracking-wide",children:"Details"}),(0,_.jsx)(Rn,{label:"Table",value:a}),(0,_.jsx)(Rn,{label:"Object ID",value:(0,_.jsx)(Rt,{copyable:!0,className:"font-mono text-xs",children:r.object_id})}),(0,_.jsx)(Rn,{label:"Changed By",value:(0,_.jsx)(YT.default,{userId:r.changed_by})}),(0,_.jsx)(Rn,{label:"API Key (Hash)",value:r.changed_by_api_key?(0,_.jsx)(Rt,{copyable:!0,className:"font-mono text-xs break-all",children:r.changed_by_api_key}):"—"})]}),(0,_.jsx)(Rl,{log:r})]})]})}let{Search:Ro}=$.Input,Rd={LiteLLM_VerificationToken:"Keys",LiteLLM_TeamTable:"Teams",LiteLLM_UserTable:"Users",LiteLLM_OrganizationTable:"Organizations",LiteLLM_ProxyModelTable:"Models"},Rc={created:"green",updated:"blue",deleted:"red",rotated:"orange"};function Ru({userID:e,userRole:t,token:r,accessToken:a,isActive:s,premiumUser:n}){let[l,i]=(0,T.useState)(1),[o,d]=(0,T.useState)(""),[c,u]=(0,T.useState)(""),[m,p]=(0,T.useState)(""),[h,f]=(0,T.useState)(""),[x,g]=(0,T.useState)(void 0),[y,b]=(0,T.useState)(void 0),[v,j]=(0,T.useState)(null),[w,k]=(0,T.useState)(!1),S=(0,ev.useQuery)({queryKey:["audit_logs",l,50,o,c,m,h,x,y],queryFn:async()=>a&&r&&t&&e?(0,Q.uiAuditLogsCall)({accessToken:a,page:l,page_size:50,params:{object_id:o||void 0,changed_by:c||void 0,object_key_hash:m||void 0,object_team_id:h||void 0,action:x||void 0,table_name:y||void 0,sort_by:"updated_at",sort_order:"desc"}}):{audit_logs:[],total:0,page:1,page_size:50,total_pages:0},enabled:!!a&&!!r&&!!t&&!!e&&s,placeholderData:Re.keepPreviousData}),N=[{title:"Timestamp",dataIndex:"updated_at",key:"updated_at",width:200,render:e=>(0,_.jsx)("span",{className:"font-mono text-xs whitespace-nowrap",children:kl.default.utc(e).local().format("MMM D, YYYY HH:mm:ss")})},{title:"Action",dataIndex:"action",key:"action",width:100,render:e=>(0,_.jsx)(eN.Tag,{color:Rc[e]??"default",className:"capitalize",children:e})},{title:"Table",dataIndex:"table_name",key:"table_name",width:130,render:e=>Rd[e]??e},{title:"Object ID",dataIndex:"object_id",key:"object_id",render:e=>(0,_.jsx)("span",{className:"font-mono text-xs",children:e})},{title:"Changed By",dataIndex:"changed_by",key:"changed_by",width:200,render:e=>(0,_.jsx)(YT.default,{userId:e})},{title:"API Key (Hash)",dataIndex:"changed_by_api_key",key:"changed_by_api_key",width:140,render:e=>e?(0,_.jsxs)("span",{className:"font-mono text-xs",children:[e.slice(0,12),"…"]}):"—"}];if(!n)return(0,_.jsxs)("div",{style:{textAlign:"center",marginTop:"20px"},children:[(0,_.jsx)("h1",{style:{display:"block",marginBottom:"10px"},children:"✨ Enterprise Feature."}),(0,_.jsx)("p",{style:{display:"block",marginBottom:"10px"},children:"This is a LiteLLM Enterprise feature, and requires a valid key to use."}),(0,_.jsx)("p",{style:{display:"block",marginBottom:"20px",fontStyle:"italic"},children:"Here's a preview of what Audit Logs offer:"}),(0,_.jsx)("img",{src:"../ui/assets/audit-logs-preview.png",alt:"Audit Logs Preview",style:{maxWidth:"100%",maxHeight:"700px",borderRadius:"8px",boxShadow:"0 4px 8px rgba(0,0,0,0.1)",margin:"0 auto"},onError:e=>{e.target.style.display="none"}})]});let M=S.data?.audit_logs??[],C=S.data?.total??0;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,_.jsxs)("div",{className:"border-b px-6 py-4",children:[(0,_.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,_.jsx)("h1",{className:"text-xl font-semibold",children:"Audit Logs"})}),(0,_.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,_.jsx)(Ro,{placeholder:"Object ID",allowClear:!0,style:{width:200},onSearch:e=>{d(e),i(1)},onChange:e=>{e.target.value||(d(""),i(1))}}),(0,_.jsx)(Ro,{placeholder:"Changed By",allowClear:!0,style:{width:180},onSearch:e=>{u(e),i(1)},onChange:e=>{e.target.value||(u(""),i(1))}}),(0,_.jsx)(Ro,{placeholder:"Team ID",allowClear:!0,style:{width:180},onSearch:e=>{f(e),i(1)},onChange:e=>{e.target.value||(f(""),i(1))}}),(0,_.jsx)(Ro,{placeholder:"Key Hash",allowClear:!0,style:{width:180},onSearch:e=>{p(e),i(1)},onChange:e=>{e.target.value||(p(""),i(1))}}),(0,_.jsx)(eE.Select,{placeholder:"All Actions",allowClear:!0,style:{width:140},options:[{label:"Created",value:"created"},{label:"Updated",value:"updated"},{label:"Deleted",value:"deleted"},{label:"Rotated",value:"rotated"}],onChange:e=>{g(e),i(1)}}),(0,_.jsx)(eE.Select,{placeholder:"All Tables",allowClear:!0,style:{width:150},options:[{label:"Keys",value:"LiteLLM_VerificationToken"},{label:"Teams",value:"LiteLLM_TeamTable"},{label:"Users",value:"LiteLLM_UserTable"},{label:"Organizations",value:"LiteLLM_OrganizationTable"},{label:"Models",value:"LiteLLM_ProxyModelTable"}],onChange:e=>{b(e),i(1)}}),(0,_.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,_.jsx)(z.Button,{icon:(0,_.jsx)(rg.ReloadOutlined,{spin:S.isFetching}),onClick:()=>S.refetch(),disabled:S.isFetching}),(0,_.jsx)(Eh.default,{current:l,pageSize:50,total:C,showTotal:e=>`${e} total`,showSizeChanger:!1,size:"small",onChange:e=>i(e)})]})]})]}),(0,_.jsx)(eK.Table,{columns:N,dataSource:M,rowKey:"id",loading:{spinning:S.isLoading,indicator:(0,_.jsx)(rm.Spin,{indicator:(0,_.jsx)(wo.LoadingOutlined,{spin:!0}),size:"small"})},size:"small",pagination:!1,onRow:e=>({onClick:()=>{j(e),k(!0)},style:{cursor:"pointer"}})})]}),(0,_.jsx)(Ri,{open:w,onClose:()=>k(!1),log:v})]})}let Rm=({size:e=12})=>(0,_.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0 text-gray-400",children:(0,_.jsx)("path",{d:"M12 3l1.912 5.813a2 2 0 0 0 1.275 1.275L21 12l-5.813 1.912a2 2 0 0 0-1.275 1.275L12 21l-1.912-5.813a2 2 0 0 0-1.275-1.275L3 12l5.813-1.912a2 2 0 0 0 1.275-1.275L12 3z"})}),Rp=({size:e=10})=>(0,_.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0",children:(0,_.jsx)("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})}),Rh=({size:e=12})=>(0,_.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0",children:[(0,_.jsx)("path",{d:"M12 8V4H8"}),(0,_.jsx)("rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"}),(0,_.jsx)("path",{d:"M2 14h2"}),(0,_.jsx)("path",{d:"M20 14h2"}),(0,_.jsx)("path",{d:"M15 13v2"}),(0,_.jsx)("path",{d:"M9 13v2"})]}),Rf=({count:e})=>(0,_.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-blue-50 text-blue-700 border border-blue-200 rounded-full text-[11px] font-medium whitespace-nowrap",children:[(0,_.jsx)(Rm,{}),null!=e?e:"LLM"]}),Rx=({count:e})=>(0,_.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-amber-50 text-amber-700 border border-amber-200 rounded-full text-[11px] font-medium whitespace-nowrap",children:[(0,_.jsx)(Rp,{}),null!=e?e:"MCP"]}),Rg=({count:e})=>(0,_.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-violet-50 text-violet-700 border border-violet-200 rounded-full text-[11px] font-medium whitespace-nowrap",children:[(0,_.jsx)(Rh,{}),null!=e?e:"Agent"]}),Ry=({label:e,field:t,sortBy:r,sortOrder:a,onSortChange:s})=>(0,_.jsxs)("div",{className:"flex items-center gap-1",children:[(0,_.jsx)("span",{children:e}),(0,_.jsx)(YS.TableHeaderSortDropdown,{sortState:r===t&&a,onSortChange:e=>{!1===e?s("startTime","desc"):s(t,e)}})]}),R_=e=>[{header:e?()=>(0,_.jsx)(Ry,{label:"Time",field:"startTime",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"Time",accessorKey:"startTime",cell:e=>(0,_.jsx)(FO,{utcTime:e.getValue()})},{header:"Type",id:"type",cell:e=>{let t=e.row.original,r=t.session_total_count||1,a=k4.includes(t.call_type),s=k5.includes(t.call_type),n=t.session_llm_count??(a||s?0:r),l=t.session_agent_count??(s?r:0),i=t.session_mcp_count??(a?r:0);if(a)return(0,_.jsx)(Rx,{});if(s&&r<=1)return(0,_.jsx)(Rg,{});if(r<=1)return(0,_.jsx)(Rf,{});let o=(0,_.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-blue-50 text-blue-700 border border-blue-200 rounded-full text-[11px] font-medium whitespace-nowrap",children:[(0,_.jsx)(Rm,{}),(0,_.jsx)("span",{children:r}),l>0&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("span",{className:"text-blue-300",children:"·"}),(0,_.jsx)(Rh,{size:10})]}),i>0&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("span",{className:"text-blue-300",children:"·"}),(0,_.jsx)(Rp,{})]})]}),d=[n>0&&`${n} LLM`,l>0&&`${l} Agent`,i>0&&`${i} MCP`].filter(Boolean);return(0,_.jsx)(tB.Tooltip,{title:d.join(" • "),children:o})}},{header:"Status",accessorKey:"metadata.status",cell:e=>{let t="failure"!==(e.getValue()||"Success").toLowerCase();return(0,_.jsx)("span",{className:`px-2 py-1 rounded-md text-xs font-medium inline-block text-center w-16 ${t?"bg-green-100 text-green-800":"bg-red-100 text-red-800"}`,children:t?"Success":"Failure"})}},{header:"Session ID",accessorKey:"session_id",cell:e=>{let t=String(e.getValue()||""),r=e.row.original.onSessionClick;return(0,_.jsx)(tB.Tooltip,{title:String(e.getValue()||""),children:(0,_.jsx)(S.Button,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal text-xs max-w-[15ch] truncate block",onClick:()=>r?.(t),children:String(e.getValue()||"")})})}},{header:"Request ID",accessorKey:"request_id",cell:e=>(0,_.jsx)(tB.Tooltip,{title:String(e.getValue()||""),children:(0,_.jsx)("span",{className:"font-mono text-xs max-w-[15ch] truncate block",children:String(e.getValue()||"")})})},{header:e?()=>(0,_.jsx)(Ry,{label:"Cost",field:"spend",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"Cost",accessorKey:"spend",cell:e=>{let t=e.row.original,r=t.mcp_tool_call_count||0,a=t.mcp_tool_call_spend||0;return(0,_.jsxs)("div",{className:"flex flex-col",children:[(0,_.jsx)(tB.Tooltip,{title:`$${String(e.getValue()||0)}`,children:(0,_.jsx)("span",{children:(0,rV.getSpendString)(e.getValue()||0)})}),r>0&&a>0&&(0,_.jsxs)("span",{className:"text-[10px] text-amber-600",children:["incl. ",(0,rV.getSpendString)(a)," from ",r," MCP"]})]})}},{header:e?()=>(0,_.jsx)(Ry,{label:"Duration (s)",field:"request_duration_ms",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"Duration (s)",accessorKey:"request_duration_ms",cell:e=>{let t=e.getValue();if(null==t)return(0,_.jsx)("span",{children:"-"});let r=(t/1e3).toFixed(2);return(0,_.jsx)(tB.Tooltip,{title:`${t}ms`,children:(0,_.jsx)("span",{className:"max-w-[15ch] truncate block",children:r})})}},{header:e?()=>(0,_.jsx)(Ry,{label:"TTFT (s)",field:"ttft_ms",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"TTFT (s)",accessorKey:"completionStartTime",cell:e=>{let t=e.row.original,r=e.getValue();if(!r||r===t.endTime)return(0,_.jsx)("span",{children:"-"});let a=new Date(r).getTime()-new Date(t.startTime).getTime();if(a<=0)return(0,_.jsx)("span",{children:"-"});let s=(a/1e3).toFixed(2);return(0,_.jsx)(tB.Tooltip,{title:`${a}ms`,children:(0,_.jsx)("span",{className:"max-w-[15ch] truncate block",children:s})})}},{header:"Team Name",accessorKey:"metadata.user_api_key_team_alias",cell:e=>(0,_.jsx)(tB.Tooltip,{title:String(e.getValue()||"-"),children:(0,_.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Key Hash",accessorKey:"metadata.user_api_key",cell:e=>{let t=String(e.getValue()||"-"),r=e.row.original.onKeyHashClick;return(0,_.jsx)(tB.Tooltip,{title:t,children:(0,_.jsx)("span",{className:"font-mono max-w-[15ch] truncate block cursor-pointer hover:text-blue-600",onClick:()=>r?.(t),children:t})})}},{header:"Key Name",accessorKey:"metadata.user_api_key_alias",cell:e=>(0,_.jsx)(tB.Tooltip,{title:String(e.getValue()||"-"),children:(0,_.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:e?()=>(0,_.jsx)(Ry,{label:"Model",field:"model",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"Model",accessorKey:"model",cell:e=>{let t=e.row.original,r=t.custom_llm_provider,a=String(e.getValue()||"");return(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[r&&(0,_.jsx)("img",{src:t.metadata?.mcp_tool_call_metadata?.mcp_server_logo_url?t.metadata.mcp_tool_call_metadata.mcp_server_logo_url:r?(0,j$.getProviderLogoAndName)(r).logo:"",alt:"",className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,_.jsx)(tB.Tooltip,{title:a,children:(0,_.jsx)("span",{className:"max-w-[15ch] truncate block",children:a})})]})}},{header:e?()=>(0,_.jsx)(Ry,{label:"Tokens",field:"total_tokens",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"Tokens",accessorKey:"total_tokens",cell:e=>{let t=e.row.original;return(0,_.jsxs)("span",{className:"text-sm",children:[String(t.total_tokens||"0"),(0,_.jsxs)("span",{className:"text-gray-400 text-xs ml-1",children:["(",String(t.prompt_tokens||"0"),"+",String(t.completion_tokens||"0"),")"]})]})}},{header:"Internal User",accessorKey:"user",cell:e=>(0,_.jsx)(tB.Tooltip,{title:String(e.getValue()||"-"),children:(0,_.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"End User",accessorKey:"end_user",cell:e=>(0,_.jsx)(tB.Tooltip,{title:String(e.getValue()||"-"),children:(0,_.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Tags",accessorKey:"request_tags",cell:e=>{let t=e.getValue();if(!t||0===Object.keys(t).length)return"-";let r=Object.entries(t),a=r[0],s=r.slice(1);return(0,_.jsx)("div",{className:"flex flex-wrap gap-1",children:(0,_.jsx)(tB.Tooltip,{title:(0,_.jsx)("div",{className:"flex flex-col gap-1",children:r.map(([e,t])=>(0,_.jsxs)("span",{children:[e,": ",String(t)]},e))}),children:(0,_.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[a[0],": ",String(a[1]),s.length>0&&` +${s.length}`]})})})}}];R_();let Rb=({value:e,onChange:t})=>(0,_.jsx)(tX.default,{value:e,onChange:t});var Rv=e.i(50882);let{Text:Rj}=V.Typography,Rw=({value:e,onChange:t,placeholder:r="Select a model",style:a,pageSize:s=50,allowClear:n=!0,disabled:l=!1})=>{let[i,o]=(0,T.useState)(""),[d,c]=(0,Db.useDebouncedState)("",{wait:300}),{data:u,fetchNextPage:m,hasNextPage:p,isFetchingNextPage:h,isLoading:f}=(0,wK.useInfiniteModelInfo)(s,d||void 0),x=(0,T.useMemo)(()=>{if(!u?.pages)return[];let e=new Set,t=[];for(let r of u.pages)for(let a of r.data){let r=a.model_info?.id??"",s=a.model_name??"";!r||e.has(r)||(e.add(r),t.push({label:s?`${s} (${r})`:r,value:r,modelName:s,modelId:r}))}return t},[u]);return(0,_.jsx)(eE.Select,{value:e||void 0,onChange:e=>{let r="string"==typeof e?e:Array.isArray(e)?e[0]??"":"";t?.(r)},placeholder:r,style:{width:"100%",...a},allowClear:n,disabled:l,showSearch:!0,filterOption:!1,onSearch:e=>{o(e),c(e)},searchValue:i,onPopupScroll:e=>{let t=e.currentTarget;(t.scrollTop+t.clientHeight)/t.scrollHeight>=.8&&p&&!h&&m()},loading:f,notFoundContent:f?(0,_.jsx)(wo.LoadingOutlined,{spin:!0}):"No models found",options:x,optionRender:e=>{let{modelName:t,modelId:r}=e.data;return(0,_.jsx)(_.Fragment,{children:t?(0,_.jsxs)(U.Space,{direction:"vertical",children:[(0,_.jsxs)(U.Space,{direction:"horizontal",children:[(0,_.jsx)(Rj,{strong:!0,children:"Model name:"}),(0,_.jsx)(Rj,{ellipsis:!0,children:t})]}),(0,_.jsxs)(Rj,{ellipsis:!0,type:"secondary",children:["Model ID: ",r]})]}):(0,_.jsxs)(Rj,{ellipsis:!0,type:"secondary",children:["Model ID: ",r]})})},popupRender:e=>(0,_.jsxs)(_.Fragment,{children:[e,h&&(0,_.jsx)("div",{style:{textAlign:"center",padding:8},children:(0,_.jsx)(wo.LoadingOutlined,{spin:!0})})]})})};var Rk=e.i(633627);let RS="Team ID",RN="Key Hash",RT="Request ID",RM="Model",RC="Public model / search tool",RL="User ID",RO="End User",RD="Status",RP="Key Alias",RA="Error Code",RE="Error Message",RI=[RN,RE,RT,RL,RC],RY={[RS]:"",[RN]:"",[RT]:"",[RM]:"",[RC]:"",[RL]:"",[RO]:"",[RD]:"",[RP]:"",[RA]:"",[RE]:""};var RF=e.i(772345);function RR({searchTerm:e,onSearchChange:t,startTime:r,onStartTimeChange:a,endTime:s,onEndTimeChange:n,isCustomDate:l,onIsCustomDateChange:i,selectedTimeInterval:o,onSelectedTimeIntervalChange:d,isLiveTail:c,onIsLiveTailChange:u,currentPage:m,onCurrentPageChange:p,pageSize:h,isLoading:f,isButtonLoading:x,onRefetch:g,filteredLogs:y}){let[b,v]=(0,T.useState)(!1),j=(0,T.useRef)(null);(0,T.useEffect)(()=>{function e(e){j.current&&!j.current.contains(e.target)&&v(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let w=k6.find(e=>e.value===o.value&&e.unit===o.unit),k=l?((e,t,r)=>{if(e)return`${(0,kl.default)(t).format("MMM D, h:mm A")} - ${(0,kl.default)(r).format("MMM D, h:mm A")}`;let a=(0,kl.default)(),s=(0,kl.default)(t),n=a.diff(s,"minutes");if(n>=0&&n<2)return"Last 1 Minute";if(n>=2&&n<16)return"Last 15 Minutes";if(n>=16&&n<61)return"Last Hour";let l=a.diff(s,"hours");return l>=1&&l<5?"Last 4 Hours":l>=5&&l<25?"Last 24 Hours":l>=25&&l<169?"Last 7 Days":`${s.format("MMM D")} - ${a.format("MMM D")}`})(l,r,s):w?.label;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"border-b px-6 py-4 w-full max-w-full box-border",children:(0,_.jsxs)("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between space-y-4 md:space-y-0 w-full max-w-full box-border",children:[(0,_.jsxs)("div",{className:"flex flex-wrap items-center gap-3 w-full max-w-full box-border",children:[(0,_.jsxs)("div",{className:"relative w-64 min-w-0 flex-shrink-0",children:[(0,_.jsx)("input",{type:"text",placeholder:"Search by Request ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:e,onChange:e=>t(e.target.value)}),(0,_.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,_.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-shrink",children:[(0,_.jsxs)("div",{className:"relative z-50",ref:j,children:[(0,_.jsxs)("button",{onClick:()=>v(!b),className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",children:[(0,_.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),k]}),b&&(0,_.jsx)("div",{className:"absolute left-0 mt-2 w-64 bg-white rounded-lg shadow-lg border p-2 z-50",children:(0,_.jsxs)("div",{className:"space-y-1",children:[k6.map(e=>(0,_.jsx)("button",{className:`w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ${k===e.label?"bg-blue-50 text-blue-600":""}`,onClick:()=>{p(1),n((0,kl.default)().format("YYYY-MM-DDTHH:mm")),a((0,kl.default)().subtract(e.value,e.unit).format("YYYY-MM-DDTHH:mm")),d({value:e.value,unit:e.unit}),i(!1),v(!1)},children:e.label},e.label)),(0,_.jsx)("div",{className:"border-t my-2"}),(0,_.jsx)("button",{className:`w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ${l?"bg-blue-50 text-blue-600":""}`,onClick:()=>i(!l),children:"Custom Range"})]})})]}),(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("span",{className:"text-sm font-medium text-gray-900",children:"Live Tail"}),(0,_.jsx)(e_.Switch,{checked:c,defaultChecked:!0,onChange:u})]}),(0,_.jsx)(z.Button,{type:"default",icon:(0,_.jsx)(RF.SyncOutlined,{spin:x}),onClick:g,disabled:x,title:"Fetch data",children:x?"Fetching":"Fetch"})]}),l&&(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("div",{children:(0,_.jsx)("input",{type:"datetime-local",value:r,onChange:e=>{a(e.target.value),p(1)},className:"px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})}),(0,_.jsx)("span",{className:"text-gray-500",children:"to"}),(0,_.jsx)("div",{children:(0,_.jsx)("input",{type:"datetime-local",value:s,onChange:e=>{n(e.target.value),p(1)},className:"px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})})]})]}),(0,_.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,_.jsxs)("span",{className:"text-sm text-gray-700 whitespace-nowrap",children:["Showing ",f?"...":y?(m-1)*h+1:0," -"," ",f?"...":y?Math.min(m*h,y.total):0," of"," ",f?"...":y?y.total:0," results"]}),(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsxs)("span",{className:"text-sm text-gray-700 min-w-[90px]",children:["Page ",f?"...":m," of"," ",f?"...":y?y.total_pages:1]}),(0,_.jsx)("button",{onClick:()=>p(e=>Math.max(1,e-1)),disabled:f||1===m,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,_.jsx)("button",{onClick:()=>p(e=>Math.min(y.total_pages||1,e+1)),disabled:f||m===(y.total_pages||1),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]})]})}),c&&1===m&&(0,_.jsxs)("div",{className:"mb-4 px-4 py-2 bg-green-50 border border-green-200 rounded-md flex items-center justify-between",children:[(0,_.jsx)("div",{className:"flex items-center gap-2",children:(0,_.jsx)("span",{className:"text-sm text-green-700",children:"Auto-refreshing every 15 seconds"})}),(0,_.jsx)("button",{onClick:()=>u(!1),className:"text-sm text-green-600 hover:text-green-800",children:"Stop"})]})]})}function RB({accessToken:e,token:t,userRole:r,userID:a,premiumUser:s}){let[n,l]=(0,T.useState)(""),[i,o]=(0,T.useState)(1),[d]=(0,T.useState)(50),[c,u]=(0,T.useState)((0,kl.default)().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),[m,p]=(0,T.useState)((0,kl.default)().format("YYYY-MM-DDTHH:mm")),[h,f]=(0,T.useState)(!1),[x,g]=(0,T.useState)(RY),[y,b]=(0,T.useState)(null),[v,j]=(0,T.useState)(null),[w,k]=(0,T.useState)(r&&ts.internalUserRoles.includes(r)),[S,N]=(0,T.useState)("request logs"),[M,C]=(0,T.useState)(null),[L,O]=(0,T.useState)(!1),[D,P]=(0,T.useState)(null),[A,E]=(0,T.useState)("startTime"),[I,Y]=(0,T.useState)("desc"),[F,R]=(0,T.useState)({value:24,unit:"hours"}),[B,z]=(0,T.useState)(()=>{let e=sessionStorage.getItem("isLiveTail");return null===e||JSON.parse(e)});(0,T.useEffect)(()=>{sessionStorage.setItem("isLiveTail",JSON.stringify(B))},[B]),(0,T.useEffect)(()=>{(async()=>{v&&e&&b({...(await (0,Q.keyInfoV1Call)(e,v)).info,token:v,api_key:v})})()},[v,e]),(0,T.useEffect)(()=>{r&&ts.internalUserRoles.includes(r)&&k(!0)},[r]);let{logsQuery:H,filteredLogs:$,allTeams:q,handleFilterChange:U,handleFilterReset:W}=function({accessToken:e,token:t,userRole:r,userID:a,filters:s,setFilters:n,filterByCurrentUser:l,activeTab:i,isLiveTail:o,startTime:d,endTime:c,pageSize:u=K.defaultPageSize,isCustomDate:m,setCurrentPage:p,sortBy:h="startTime",sortOrder:f="desc",currentPage:x=1}){let[g,y]=function(e,t){let[r,a]=(0,T.useState)(e);return(0,T.useEffect)(()=>{let t=setTimeout(()=>a(e),300);return()=>clearTimeout(t)},[e,300]),[r,a]}(s,0),_=(0,T.useMemo)(()=>{let e={...s};for(let t of RI)e[t]=g[t];return e},[s,g]),b=(0,ev.useQuery)({queryKey:["logs","table",x,u,d,c,m,_,l?a:null,h,f],queryFn:async()=>{if(!e||!t||!r||!a)return{data:[],total:0,page:1,page_size:u,total_pages:0};let s=(0,kl.default)(d).utc().format("YYYY-MM-DD HH:mm:ss"),n=m?(0,kl.default)(c).utc().format("YYYY-MM-DD HH:mm:ss"):(0,kl.default)().utc().format("YYYY-MM-DD HH:mm:ss");return await (0,Q.uiSpendLogsCall)({accessToken:e,start_date:s,end_date:n,page:x,page_size:u,params:{api_key:_[RN]||void 0,team_id:_[RS]||void 0,request_id:_[RT]||void 0,user_id:_[RL]||(l?a??void 0:void 0),end_user:_[RO]||void 0,status_filter:_[RD]||void 0,model_id:_[RM]||void 0,model:_[RC]||void 0,key_alias:_[RP]||void 0,error_code:_[RA]||void 0,error_message:_[RE]||void 0,sort_by:h,sort_order:f}})},enabled:!!e&&!!t&&!!r&&!!a&&"request logs"===i,refetchInterval:!!o&&1===x&&15e3,placeholderData:Re.keepPreviousData,refetchIntervalInBackground:!1}),v=b.data??{data:[],total:0,page:1,page_size:u,total_pages:0},{data:j}=(0,ev.useQuery)({queryKey:["allTeamsForLogFilters",e],queryFn:async()=>e&&await (0,Rk.fetchAllTeams)(e)||[],enabled:!!e});return{logsQuery:b,filteredLogs:v,allTeams:j,handleFilterChange:e=>{n(t=>{let r={...t,...e};for(let e of Object.keys(RY))e in r||(r[e]=RY[e]);return JSON.stringify(r)!==JSON.stringify(t)&&p(1),r})},handleFilterReset:()=>{n(RY),y(RY),p(1)}}}({accessToken:e,token:t,userRole:r,userID:a,filters:x,setFilters:g,filterByCurrentUser:!!w,activeTab:S,isLiveTail:B,startTime:c,endTime:m,pageSize:d,isCustomDate:h,setCurrentPage:o,sortBy:A,sortOrder:I,currentPage:i}),V=(0,T.useCallback)(()=>{W(),u((0,kl.default)().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),p((0,kl.default)().format("YYYY-MM-DDTHH:mm")),f(!1),R({value:24,unit:"hours"}),o(1)},[W]),G=(0,T.useCallback)((e,t)=>{E(e),Y(t),o(1)},[]),J=(0,T.useMemo)(()=>R_({sortBy:A,sortOrder:I,onSortChange:G}),[A,I,G]),X=(0,T.useMemo)(()=>{let e=$.data.filter(e=>!n||e.request_id.includes(n)||e.model.includes(n)||e.user&&e.user.includes(n)),t=e.reduce((e,t)=>(t.session_id&&(e[t.session_id]||(e[t.session_id]={llm:0,agent:0,mcp:0}),k4.includes(t.call_type)?e[t.session_id].mcp+=1:k5.includes(t.call_type)?e[t.session_id].agent+=1:e[t.session_id].llm+=1),e),{}),r=new Map;for(let t of e){if(!t.session_id||1>=(t.session_total_count||1))continue;let e=k4.includes(t.call_type),a=r.get(t.session_id);a&&(!a.isMcp||e)||r.set(t.session_id,{requestId:t.request_id,isMcp:e})}return e.map(e=>{let r=e.session_id?t[e.session_id]:void 0;return{...e,request_duration_ms:e.request_duration_ms,session_llm_count:r?.llm??void 0,session_mcp_count:r?.mcp??void 0,session_agent_count:r?.agent??void 0,onKeyHashClick:e=>j(e),onSessionClick:t=>{t&&(P(t),C(e),O(!0))}}}).filter(e=>!e.session_id||1>=(e.session_total_count||1)||r.get(e.session_id)?.requestId===e.request_id)},[$.data,n]),Z=(0,T.useDeferredValue)(X),ee=Z!==X,et=H.isFetching||ee,er=H.isPlaceholderData,ea=H.isLoading||er;return e&&t&&r&&a?(0,_.jsxs)("div",{className:"w-full max-w-screen p-6 overflow-x-hidden box-border",children:[(0,_.jsxs)(rF.TabGroup,{defaultIndex:0,onIndexChange:e=>N(0===e?"request logs":"audit logs"),children:[(0,_.jsxs)(rR.TabList,{children:[(0,_.jsx)(rY.Tab,{children:"Request Logs"}),(0,_.jsx)(rY.Tab,{children:"Audit Logs"}),(0,_.jsx)(rY.Tab,{children:"Deleted Keys"}),(0,_.jsx)(rY.Tab,{children:"Deleted Teams"})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,_.jsx)("h1",{className:"text-xl font-semibold",children:"Request Logs"})}),y&&v&&y.api_key===v?(0,_.jsx)(AB.default,{keyId:v,keyData:y,teams:q??[],onClose:()=>j(null),backButtonText:"Back to Logs"}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(FD.default,{options:[{name:"Team ID",label:"Team ID",customComponent:Rb},{name:"Status",label:"Status",isSearchable:!1,options:[{label:"Success",value:"success"},{label:"Failure",value:"failure"}]},{name:"Key Alias",label:"Key Alias",customComponent:Rv.PaginatedKeyAliasSelect},{name:"End User",label:"End User",isSearchable:!0,searchFn:async t=>{let r=await (0,Q.allEndUsersCall)(e);return(r?.map(e=>e.user_id)||[]).filter(e=>e.toLowerCase().includes(t.toLowerCase())).map(e=>({label:e,value:e}))}},{name:"Error Code",label:"Error Code",isSearchable:!0,searchFn:async e=>{if(!e)return k2;let t=e.toLowerCase(),r=k2.filter(e=>e.label.toLowerCase().includes(t));return!k2.some(t=>t.value===e.trim())&&e.trim()&&r.push({label:`Use custom code: ${e.trim()}`,value:e.trim()}),r}},{name:"Error Message",label:"Error Message",isSearchable:!1},{name:"Key Hash",label:"Key Hash",isSearchable:!1},{name:"Model",label:"Model",customComponent:Rw},{name:RC,label:"Public model / search tool",isSearchable:!1}],onApplyFilters:U,onResetFilters:V}),(0,_.jsxs)("div",{className:"bg-white rounded-lg shadow w-full max-w-full box-border",children:[(0,_.jsx)(RR,{searchTerm:n,onSearchChange:l,startTime:c,onStartTimeChange:u,endTime:m,onEndTimeChange:p,isCustomDate:h,onIsCustomDateChange:f,selectedTimeInterval:F,onSelectedTimeIntervalChange:R,isLiveTail:B,onIsLiveTailChange:z,currentPage:i,onCurrentPageChange:o,pageSize:d,isLoading:ea,isButtonLoading:et,onRefetch:()=>H.refetch(),filteredLogs:$}),(0,_.jsx)(LH.DataTable,{columns:J,data:Z,onRowClick:e=>{if(e.session_id&&(e.session_total_count||1)>1){P(e.session_id),C(e),O(!0);return}P(null),C(e),O(!0)},isLoading:ea})]})]})]}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Ru,{userID:a,userRole:r,token:t,accessToken:e,isActive:"audit logs"===S,premiumUser:s})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(F8,{})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(F9,{})})]})]}),(0,_.jsx)(N1,{open:L,onClose:()=>{O(!1),P(null)},logEntry:M,sessionId:D,accessToken:e,allLogs:X,onSelectLog:C,startTime:(0,kl.default)(c).utc().format("YYYY-MM-DD HH:mm:ss")})]}):(0,_.jsx)("div",{className:"flex items-center justify-center h-64",children:(0,_.jsx)(Ey,{size:"large"})})}function Rz({userData:e,onCancel:t,onSubmit:r,teams:a,accessToken:s,userID:n,userRole:l,userModels:i,possibleUIRoles:o,isBulkEdit:d=!1}){let[c]=H.Form.useForm(),[u,m]=(0,T.useState)(!1);return T.default.useEffect(()=>{let t=e.user_info?.max_budget,r=null==t;m(r),c.setFieldsValue({user_id:e.user_id,user_email:e.user_info?.user_email,user_alias:e.user_info?.user_alias,user_role:e.user_info?.user_role,models:e.user_info?.models||[],max_budget:r?"":t,budget_duration:e.user_info?.budget_duration,metadata:e.user_info?.metadata?JSON.stringify(e.user_info.metadata,null,2):void 0})},[e,c]),(0,_.jsxs)(H.Form,{form:c,onFinish:e=>{if(e.metadata&&"string"==typeof e.metadata)try{e.metadata=JSON.parse(e.metadata)}catch(e){console.error("Error parsing metadata JSON:",e);return}(u||""===e.max_budget||void 0===e.max_budget)&&(e.max_budget=null),r(e)},layout:"vertical",children:[!d&&(0,_.jsx)(H.Form.Item,{label:"User ID",name:"user_id",children:(0,_.jsx)(et.TextInput,{disabled:!0})}),!d&&(0,_.jsx)(H.Form.Item,{label:"Email",name:"user_email",children:(0,_.jsx)(et.TextInput,{})}),(0,_.jsx)(H.Form.Item,{label:"User Alias",name:"user_alias",children:(0,_.jsx)(et.TextInput,{})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Global Proxy Role"," ",(0,_.jsx)(tB.Tooltip,{title:"This is the role that the user will globally on the proxy. This role is independent of any team/org specific roles.",children:(0,_.jsx)(tK.InfoCircleOutlined,{})})]}),name:"user_role",children:(0,_.jsx)(eE.Select,{children:o&&Object.entries(o).map(([e,{ui_label:t,description:r}])=>(0,_.jsx)(ju.SelectItem,{value:e,title:t,children:(0,_.jsxs)("div",{className:"flex",children:[t," ",(0,_.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:r})]})},e))})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Personal Models"," ",(0,_.jsx)(tB.Tooltip,{title:"Select which models this user can access outside of team-scope. Choose 'All Proxy Models' to grant access to all models available on the proxy.",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,_.jsxs)(eE.Select,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},disabled:!ts.all_admin_roles.includes(l||""),children:[(0,_.jsx)(eE.Select.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),(0,_.jsx)(eE.Select.Option,{value:"no-default-models",children:"No Default Models"},"no-default-models"),i.map(e=>(0,_.jsx)(eE.Select.Option,{value:e,children:(0,tQ.getModelDisplayName)(e)},e))]})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[(0,_.jsx)("span",{children:"Max Budget (USD)"}),(0,_.jsx)(eA.Checkbox,{checked:u,onChange:e=>{let t=e.target.checked;m(t),t&&c.setFieldsValue({max_budget:""})},children:"Unlimited Budget"})]}),name:"max_budget",rules:[{validator:(e,t)=>u||""!==t&&null!=t?Promise.resolve():Promise.reject(Error("Please enter a budget or select Unlimited Budget"))}],children:(0,_.jsx)(jf.default,{step:.01,precision:2,style:{width:"100%"},disabled:u})}),(0,_.jsx)(H.Form.Item,{label:"Reset Budget",name:"budget_duration",children:(0,_.jsx)(Ea.default,{})}),(0,_.jsx)(H.Form.Item,{label:"Metadata",name:"metadata",children:(0,_.jsx)(C8,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,_.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,_.jsx)(S.Button,{variant:"secondary",type:"button",onClick:t,children:"Cancel"}),(0,_.jsx)(S.Button,{type:"submit",children:"Save Changes"})]})]})}let{Text:RH,Title:R$}=V.Typography,Rq=({open:e,onCancel:t,selectedUsers:r,possibleUIRoles:a,accessToken:s,onSuccess:n,teams:l,userRole:i,userModels:o,allowAllUsers:d=!1})=>{let[c,u]=(0,T.useState)(!1),[m,p]=(0,T.useState)([]),[h,f]=(0,T.useState)(null),[x,g]=(0,T.useState)(!1),[y,b]=(0,T.useState)(!1),v=()=>{p([]),f(null),g(!1),b(!1),t()},j=T.default.useMemo(()=>({user_id:"bulk_edit",user_info:{user_email:"",user_role:"",teams:[],models:[],max_budget:null,spend:0,metadata:{},created_at:null,updated_at:null},keys:[],teams:l||[]}),[l,e]),w=async e=>{if(console.log("formValues",e),!s)return void J.default.fromBackend("Access token not found");u(!0);try{let a=r.map(e=>e.user_id),l={};e.user_role&&""!==e.user_role&&(l.user_role=e.user_role),null!==e.max_budget&&void 0!==e.max_budget&&(l.max_budget=e.max_budget),e.models&&e.models.length>0&&(l.models=e.models),e.budget_duration&&""!==e.budget_duration&&(l.budget_duration=e.budget_duration),e.metadata&&Object.keys(e.metadata).length>0&&(l.metadata=e.metadata);let i=Object.keys(l).length>0,o=x&&m.length>0;if(!i&&!o)return void J.default.fromBackend("Please modify at least one field or select teams to add users to");let d=[];if(i)if(y){let e=await (0,Q.userBulkUpdateUserCall)(s,l,void 0,!0);d.push(`Updated all users (${e.total_requested} total)`)}else await (0,Q.userBulkUpdateUserCall)(s,l,a),d.push(`Updated ${a.length} user(s)`);if(o){let e=[];for(let t of m)try{let a=null;a=y?null:r.map(e=>({user_id:e.user_id,role:"user",user_email:e.user_email||null}));let n=await (0,Q.teamBulkMemberAddCall)(s,t,a||null,h||void 0,y);console.log("result",n),e.push({teamId:t,success:!0,successfulAdditions:n.successful_additions,failedAdditions:n.failed_additions})}catch(r){console.error(`Failed to add users to team ${t}:`,r),e.push({teamId:t,success:!1,error:r})}let t=e.filter(e=>e.success),a=e.filter(e=>!e.success);if(t.length>0){let e=t.reduce((e,t)=>e+t.successfulAdditions,0);d.push(`Added users to ${t.length} team(s) (${e} total additions)`)}a.length>0&&tU.default.warning(`Failed to add users to ${a.length} team(s)`)}d.length>0&&J.default.success(d.join(". ")),p([]),f(null),g(!1),b(!1),n(),t()}catch(e){console.error("Bulk operation failed:",e),J.default.fromBackend("Failed to perform bulk operations")}finally{u(!1)}};return(0,_.jsxs)(q.Modal,{open:e,onCancel:v,footer:null,title:y?"Bulk Edit All Users":`Bulk Edit ${r.length} User(s)`,width:800,children:[d&&(0,_.jsxs)("div",{className:"mb-4",children:[(0,_.jsx)(eA.Checkbox,{checked:y,onChange:e=>b(e.target.checked),children:(0,_.jsx)(RH,{strong:!0,children:"Update ALL users in the system"})}),y&&(0,_.jsx)("div",{style:{marginTop:8},children:(0,_.jsx)(RH,{type:"warning",style:{fontSize:"12px"},children:"⚠️ This will apply changes to ALL users in the system, not just the selected ones."})})]}),!y&&(0,_.jsxs)("div",{className:"mb-4",children:[(0,_.jsxs)(R$,{level:5,children:["Selected Users (",r.length,"):"]}),(0,_.jsx)(eK.Table,{size:"small",bordered:!0,dataSource:r,pagination:!1,scroll:{y:200},rowKey:"user_id",columns:[{title:"User ID",dataIndex:"user_id",key:"user_id",width:"30%",render:e=>(0,_.jsx)(RH,{strong:!0,style:{fontSize:"12px"},children:e.length>20?`${e.slice(0,20)}...`:e})},{title:"Email",dataIndex:"user_email",key:"user_email",width:"25%",render:e=>(0,_.jsx)(RH,{type:"secondary",style:{fontSize:"12px"},children:e||"No email"})},{title:"Current Role",dataIndex:"user_role",key:"user_role",width:"25%",render:e=>(0,_.jsx)(RH,{style:{fontSize:"12px"},children:a?.[e]?.ui_label||e})},{title:"Budget",dataIndex:"max_budget",key:"max_budget",width:"20%",render:e=>(0,_.jsx)(RH,{style:{fontSize:"12px"},children:null!==e?`$${e}`:"Unlimited"})}]})]}),(0,_.jsx)(eG.Divider,{}),(0,_.jsx)("div",{className:"mb-4",children:(0,_.jsxs)(RH,{children:[(0,_.jsx)("strong",{children:"Instructions:"})," Fill in the fields below with the values you want to apply to all selected users. You can bulk edit: role, budget, models, and metadata. You can also add users to teams."]})}),(0,_.jsx)(eg.Card,{title:"Team Management",size:"small",className:"mb-4",style:{backgroundColor:"#fafafa"},children:(0,_.jsxs)(U.Space,{direction:"vertical",style:{width:"100%"},children:[(0,_.jsx)(eA.Checkbox,{checked:x,onChange:e=>g(e.target.checked),children:"Add selected users to teams"}),x&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(RH,{strong:!0,children:"Select Teams:"}),(0,_.jsx)(eE.Select,{mode:"multiple",placeholder:"Select teams to add users to",value:m,onChange:p,style:{width:"100%",marginTop:8},options:l?.map(e=>({label:e.team_alias||e.team_id,value:e.team_id}))||[]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(RH,{strong:!0,children:"Team Budget (Optional):"}),(0,_.jsx)(tq.InputNumber,{placeholder:"Max budget per user in team",value:h,onChange:e=>f(e),style:{width:"100%",marginTop:8},min:0,step:.01,precision:2}),(0,_.jsx)(RH,{type:"secondary",style:{fontSize:"12px"},children:"Leave empty for unlimited budget within team limits"})]}),(0,_.jsx)(RH,{type:"secondary",style:{fontSize:"12px"},children:'Users will be added with "user" role by default. All users will be added to each selected team.'})]})]})}),(0,_.jsx)(Rz,{userData:j,onCancel:v,onSubmit:w,teams:l,accessToken:s,userID:"bulk_edit",userRole:i,userModels:o,possibleUIRoles:a,isBulkEdit:!0}),c&&(0,_.jsx)("div",{style:{textAlign:"center",marginTop:"10px"},children:(0,_.jsxs)(RH,{children:["Updating ",y?"all users":r.length," user(s)..."]})})]})};var RU=e.i(371455);let RW=({visible:e,possibleUIRoles:t,onCancel:r,user:a,onSubmit:s})=>{let[n,l]=(0,T.useState)(a),[i]=H.Form.useForm();(0,T.useEffect)(()=>{i.resetFields()},[a]);let o=async()=>{i.resetFields(),r()},d=async e=>{s(e),i.resetFields(),r()};return a?(0,_.jsx)(q.Modal,{open:e,onCancel:o,footer:null,title:"Edit User "+a.user_id,width:1e3,children:(0,_.jsx)(H.Form,{form:i,onFinish:d,initialValues:a,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(H.Form.Item,{className:"mt-8",label:"User Email",tooltip:"Email of the User",name:"user_email",children:(0,_.jsx)(et.TextInput,{})}),(0,_.jsx)(H.Form.Item,{label:"user_id",name:"user_id",hidden:!0,children:(0,_.jsx)(et.TextInput,{})}),(0,_.jsx)(H.Form.Item,{label:"User Role",name:"user_role",children:(0,_.jsx)(eE.Select,{children:t&&Object.entries(t).map(([e,{ui_label:t,description:r}])=>(0,_.jsx)(ju.SelectItem,{value:e,title:t,children:(0,_.jsxs)("div",{className:"flex",children:[t," ",(0,_.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:r})]})},e))})}),(0,_.jsx)(H.Form.Item,{label:"Spend (USD)",name:"spend",tooltip:"(float) - Spend of all LLM calls completed by this user",help:"Across all keys (including keys with team_id).",children:(0,_.jsx)(tq.InputNumber,{min:0,step:.01})}),(0,_.jsx)(H.Form.Item,{label:"User Budget (USD)",name:"max_budget",tooltip:"(float) - Maximum budget of this user",help:"Maximum budget of this user.",children:(0,_.jsx)(jf.default,{min:0,step:.01})}),(0,_.jsx)(H.Form.Item,{label:"Reset Budget",name:"budget_duration",children:(0,_.jsx)(Ea.default,{})}),(0,_.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,_.jsx)(z.Button,{htmlType:"submit",children:"Save"})}),(0,_.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,_.jsx)(z.Button,{htmlType:"submit",children:"Save"})})]})})}):null};var RV=e.i(172372);let RG=({accessToken:e,possibleUIRoles:t,userID:r,userRole:a})=>{let[s,n]=(0,T.useState)(!0),[l,i]=(0,T.useState)(null),[o,d]=(0,T.useState)(!1),[c,u]=(0,T.useState)({}),[m,p]=(0,T.useState)(!1),[h,f]=(0,T.useState)([]),{Paragraph:x}=V.Typography,{Option:g}=eE.Select;(0,T.useEffect)(()=>{(async()=>{if(!e)return n(!1);try{let t=await (0,Q.getInternalUserSettings)(e);if(i(t),u(t.values||{}),e)try{let t=await (0,Q.modelAvailableCall)(e,r,a);if(t&&t.data){let e=t.data.map(e=>e.id);f(e)}}catch(e){console.error("Error fetching available models:",e)}}catch(e){console.error("Error fetching SSO settings:",e),J.default.fromBackend("Failed to fetch SSO settings")}finally{n(!1)}})()},[e]);let y=async()=>{if(e){p(!0);try{let t=Object.entries(c).reduce((e,[t,r])=>(e[t]=""===r?null:r,e),{}),r=await (0,Q.updateInternalUserSettings)(e,t);i({...l,values:r.settings}),d(!1)}catch(e){console.error("Error updating SSO settings:",e),J.default.fromBackend("Failed to update settings: "+e)}finally{p(!1)}}},b=(e,t)=>{u(r=>({...r,[e]:t}))},v=e=>e&&Array.isArray(e)?e.map(e=>"string"==typeof e?{team_id:e,user_role:"user"}:"object"==typeof e&&e.team_id?{team_id:e.team_id,max_budget_in_team:e.max_budget_in_team,user_role:e.user_role||"user"}:{team_id:"",user_role:"user"}):[];return s?(0,_.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,_.jsx)(rm.Spin,{size:"large"})}):l?(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,_.jsx)(X.Title,{children:"Default User Settings"}),!s&&l&&(o?(0,_.jsxs)("div",{className:"flex gap-2",children:[(0,_.jsx)(z.Button,{onClick:()=>{d(!1),u(l.values||{})},disabled:m,children:"Cancel"}),(0,_.jsx)(z.Button,{type:"primary",onClick:y,loading:m,children:"Save Changes"})]}):(0,_.jsx)(z.Button,{type:"primary",onClick:()=>d(!0),children:"Edit Settings"}))]}),l?.field_schema?.description&&(0,_.jsx)(x,{className:"mb-4",children:l.field_schema.description}),(0,_.jsx)(ea,{}),(0,_.jsx)("div",{className:"mt-4 space-y-4",children:(()=>{let{values:e,field_schema:r}=l;return r&&r.properties?Object.entries(r.properties).map(([r,a])=>{let s=e[r],n=r.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,_.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200 last:border-0",children:[(0,_.jsx)(Z.Text,{className:"font-medium text-lg",children:n}),(0,_.jsx)(x,{className:"text-sm text-gray-500 mt-1",children:a.description||"No description available"}),o?(0,_.jsx)("div",{className:"mt-2",children:((e,r,a)=>{let s=r.type;if("teams"===e){let t,r;return(0,_.jsx)("div",{className:"mt-2",children:(t=v(c[e]||[]),r=(e,r,a)=>{let s=[...t];s[e]={...s[e],[r]:a},b("teams",s)},(0,_.jsxs)("div",{className:"space-y-3",children:[t.map((e,a)=>(0,_.jsxs)("div",{className:"border rounded-lg p-4 bg-gray-50",children:[(0,_.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,_.jsxs)(Z.Text,{className:"font-medium",children:["Team ",a+1]}),(0,_.jsx)(z.Button,{size:"small",danger:!0,icon:(0,_.jsx)(jQ.DeleteOutlined,{}),onClick:()=>{b("teams",t.filter((e,t)=>t!==a))},children:"Remove"})]}),(0,_.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium mb-1",children:"Team ID"}),(0,_.jsx)(et.TextInput,{value:e.team_id,onChange:e=>r(a,"team_id",e.target.value),placeholder:"Enter team ID"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium mb-1",children:"Max Budget in Team"}),(0,_.jsx)(tq.InputNumber,{style:{width:"100%"},value:e.max_budget_in_team,onChange:e=>r(a,"max_budget_in_team",e),placeholder:"Optional",min:0,step:.01,precision:2})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium mb-1",children:"User Role"}),(0,_.jsxs)(eE.Select,{style:{width:"100%"},value:e.user_role,onChange:e=>r(a,"user_role",e),children:[(0,_.jsx)(g,{value:"user",children:"User"}),(0,_.jsx)(g,{value:"admin",children:"Admin"})]})]})]})]},a)),(0,_.jsx)(z.Button,{icon:(0,_.jsx)(tZ.PlusOutlined,{}),onClick:()=>{b("teams",[...t,{team_id:"",user_role:"user"}])},className:"w-full",children:"Add Team"})]}))})}if("user_role"===e&&t)return(0,_.jsx)(eE.Select,{style:{width:"100%"},value:c[e]||"",onChange:t=>b(e,t),className:"mt-2",children:Object.entries(t).filter(([e])=>e.includes("internal_user")).map(([e,{ui_label:t,description:r}])=>(0,_.jsx)(g,{value:e,children:(0,_.jsxs)("div",{className:"flex items-center",children:[(0,_.jsx)("span",{children:t}),(0,_.jsx)("span",{className:"ml-2 text-xs text-gray-500",children:r})]})},e))});if("budget_duration"===e)return(0,_.jsx)(Ea.default,{value:c[e]||null,onChange:t=>b(e,t),className:"mt-2"});if("boolean"===s)return(0,_.jsx)("div",{className:"mt-2",children:(0,_.jsx)(e_.Switch,{checked:!!c[e],onChange:t=>b(e,t)})});if("array"===s&&r.items?.enum)return(0,_.jsx)(eE.Select,{mode:"multiple",style:{width:"100%"},value:c[e]||[],onChange:t=>b(e,t),className:"mt-2",children:r.items.enum.map(e=>(0,_.jsx)(g,{value:e,children:e},e))});else if("models"===e)return(0,_.jsxs)(eE.Select,{mode:"multiple",style:{width:"100%"},value:c[e]||[],onChange:t=>b(e,t),className:"mt-2",children:[(0,_.jsx)(g,{value:"no-default-models",children:"No Default Models"},"no-default-models"),(0,_.jsx)(g,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),h.map(e=>(0,_.jsx)(g,{value:e,children:(0,tQ.getModelDisplayName)(e)},e))]});else if("string"===s&&r.enum)return(0,_.jsx)(eE.Select,{style:{width:"100%"},value:c[e]||"",onChange:t=>b(e,t),className:"mt-2",children:r.enum.map(e=>(0,_.jsx)(g,{value:e,children:e},e))});else return(0,_.jsx)(et.TextInput,{value:void 0!==c[e]?String(c[e]):"",onChange:t=>b(e,t.target.value),placeholder:r.description||"",className:"mt-2"})})(r,a,0)}):(0,_.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:((e,r)=>{if(null==r)return(0,_.jsx)("span",{className:"text-gray-400",children:"Not set"});if("teams"===e&&Array.isArray(r)){if(0===r.length)return(0,_.jsx)("span",{className:"text-gray-400",children:"No teams assigned"});let e=v(r);return(0,_.jsx)("div",{className:"space-y-2 mt-1",children:e.map((e,t)=>(0,_.jsx)("div",{className:"border rounded-lg p-3 bg-white",children:(0,_.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2 text-sm",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{className:"font-medium text-gray-600",children:"Team ID:"}),(0,_.jsx)("p",{className:"text-gray-900",children:e.team_id||"Not specified"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{className:"font-medium text-gray-600",children:"Max Budget:"}),(0,_.jsx)("p",{className:"text-gray-900",children:void 0!==e.max_budget_in_team?`$${(0,rV.formatNumberWithCommas)(e.max_budget_in_team,4)}`:"No limit"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{className:"font-medium text-gray-600",children:"Role:"}),(0,_.jsx)("p",{className:"text-gray-900 capitalize",children:e.user_role})]})]})},t))})}if("user_role"===e&&t&&t[r]){let{ui_label:e,description:a}=t[r];return(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{className:"font-medium",children:e}),a&&(0,_.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:a})]})}if("budget_duration"===e)return(0,_.jsx)("span",{children:(0,Ea.getBudgetDurationLabel)(r)});if("boolean"==typeof r)return(0,_.jsx)("span",{children:r?"Enabled":"Disabled"});if("models"===e&&Array.isArray(r))return 0===r.length?(0,_.jsx)("span",{className:"text-gray-400",children:"None"}):(0,_.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:r.map((e,t)=>(0,_.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:(0,tQ.getModelDisplayName)(e)},t))});if("object"==typeof r)return Array.isArray(r)?0===r.length?(0,_.jsx)("span",{className:"text-gray-400",children:"None"}):(0,_.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:r.map((e,t)=>(0,_.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:"object"==typeof e?JSON.stringify(e):String(e)},t))}):(0,_.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(r,null,2)});return(0,_.jsx)("span",{children:String(r)})})(r,s)})]},r)}):(0,_.jsx)(Z.Text,{children:"No schema information available"})})()})]}):(0,_.jsx)(P.Card,{children:(0,_.jsx)(Z.Text,{children:"No settings available or you do not have permission to view them."})})};var RK=e.i(502275);let RJ=(e,t,r,a,s,n)=>{let l=[{header:"User ID",accessorKey:"user_id",enableSorting:!0,cell:({row:e})=>(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)(tB.Tooltip,{title:e.original.user_id,children:(0,_.jsx)("span",{className:"text-xs",children:e.original.user_id?`${e.original.user_id.slice(0,7)}...`:"-"})}),e.original.user_id&&(0,_.jsx)(tB.Tooltip,{title:"Copy User ID",children:(0,_.jsx)(ei.CopyOutlined,{onClick:t=>{t.stopPropagation(),(0,rV.copyToClipboard)(e.original.user_id,"User ID copied to clipboard")},className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]})},{header:"Email",accessorKey:"user_email",enableSorting:!0,cell:({row:e})=>(0,_.jsx)("span",{className:"text-xs",children:e.original.user_email||"-"})},{id:"status",header:"Status",enableSorting:!1,cell:({row:e})=>e.original.metadata?.scim_active===!1?(0,_.jsx)(tB.Tooltip,{title:"Deactivated via SCIM (external identity provider). The user's virtual keys are blocked.",children:(0,_.jsx)(eN.Tag,{color:"red","data-testid":`user-status-${e.original.user_id}`,children:"Inactive"})}):(0,_.jsx)(eN.Tag,{color:"green","data-testid":`user-status-${e.original.user_id}`,children:"Active"})},{header:"Global Proxy Role",accessorKey:"user_role",enableSorting:!0,cell:({row:t})=>(0,_.jsx)("span",{className:"text-xs",children:e?.[t.original.user_role]?.ui_label||"-"})},{header:"User Alias",accessorKey:"user_alias",enableSorting:!1,cell:({row:e})=>(0,_.jsx)("span",{className:"text-xs",children:e.original.user_alias||"-"})},{header:"Spend (USD)",accessorKey:"spend",enableSorting:!0,cell:({row:e})=>(0,_.jsx)("span",{className:"text-xs",children:e.original.spend?(0,rV.formatNumberWithCommas)(e.original.spend,4):"-"})},{header:"Budget (USD)",accessorKey:"max_budget",enableSorting:!1,cell:({row:e})=>(0,_.jsx)("span",{className:"text-xs",children:null!==e.original.max_budget?e.original.max_budget:"Unlimited"})},{header:()=>(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("span",{children:"SSO ID"}),(0,_.jsx)(tB.Tooltip,{title:"SSO ID is the ID of the user in the SSO provider. If the user is not using SSO, this will be null.",children:(0,_.jsx)(RK.InformationCircleIcon,{className:"w-4 h-4"})})]}),accessorKey:"sso_user_id",enableSorting:!1,cell:({row:e})=>(0,_.jsx)("span",{className:"text-xs",children:null!==e.original.sso_user_id?e.original.sso_user_id:"-"})},{header:"Virtual Keys",accessorKey:"key_count",enableSorting:!1,cell:({row:e})=>(0,_.jsx)(ee.Grid,{numItems:2,children:e.original.key_count>0?(0,_.jsxs)(tR.Badge,{size:"xs",color:"indigo",children:[e.original.key_count," ",1===e.original.key_count?"Key":"Keys"]}):(0,_.jsx)(tR.Badge,{size:"xs",color:"gray",children:"No Keys"})})},{header:"Created At",accessorKey:"created_at",enableSorting:!0,cell:({row:e})=>(0,_.jsx)("span",{className:"text-xs",children:e.original.created_at?new Date(e.original.created_at).toLocaleDateString():"-"})},{header:"Updated At",accessorKey:"updated_at",enableSorting:!1,cell:({row:e})=>(0,_.jsx)("span",{className:"text-xs",children:e.original.updated_at?new Date(e.original.updated_at).toLocaleDateString():"-"})},{id:"actions",header:"Actions",enableSorting:!1,cell:({row:e})=>(0,_.jsxs)("div",{className:"flex gap-2",children:[(0,_.jsx)(tB.Tooltip,{title:"Edit user details",children:(0,_.jsx)(yi.Icon,{icon:jR.PencilAltIcon,size:"sm",onClick:()=>s(e.original.user_id,!0),className:"cursor-pointer hover:text-blue-600"})}),(0,_.jsx)(tB.Tooltip,{title:"Delete user",children:(0,_.jsx)(yi.Icon,{icon:jO.TrashIcon,size:"sm",onClick:()=>r(e.original),className:"cursor-pointer hover:text-red-600"})}),(0,_.jsx)(tB.Tooltip,{title:"Reset Password",children:(0,_.jsx)(yi.Icon,{icon:jt.RefreshIcon,size:"sm",onClick:()=>a(e.original.user_id),className:"cursor-pointer hover:text-green-600"})})]})}];if(n){let{onSelectUser:e,onSelectAll:t,isUserSelected:r,isAllSelected:a,isIndeterminate:s}=n;return[{id:"select",enableSorting:!1,header:()=>(0,_.jsx)(eA.Checkbox,{indeterminate:s,checked:a,onChange:e=>t(e.target.checked),onClick:e=>e.stopPropagation()}),cell:({row:t})=>(0,_.jsx)(eA.Checkbox,{checked:r(t.original),onChange:r=>e(t.original,r.target.checked),onClick:e=>e.stopPropagation()})},...l]}return l};function RQ({userId:e,onClose:t,accessToken:r,userRole:a,onDelete:s,possibleUIRoles:n,initialTab:l=0,startInEditMode:i=!1}){let[o,d]=(0,T.useState)(null),[c,u]=(0,T.useState)([]),[m,p]=(0,T.useState)(!1),[h,f]=(0,T.useState)(!1),[x,g]=(0,T.useState)(!0),[y,b]=(0,T.useState)(i),[v,j]=(0,T.useState)([]),[w,k]=(0,T.useState)(!1),[N,M]=(0,T.useState)(null),[C,L]=(0,T.useState)(null),[O,D]=(0,T.useState)(l),[B,$]=(0,T.useState)({}),[U,W]=(0,T.useState)(!1),[V,G]=(0,T.useState)(!1),[K,et]=(0,T.useState)(!1),[er,ea]=(0,T.useState)(null),[es,en]=(0,T.useState)(!1),[el,ei]=(0,T.useState)(!1),[eo,ed]=(0,T.useState)([]),[ec,eu]=(0,T.useState)(""),[em,ep]=(0,T.useState)("user"),[eh,ef]=(0,T.useState)(!1);T.default.useEffect(()=>{L((0,Q.getProxyBaseUrl)())},[]),T.default.useEffect(()=>{console.log(`userId: ${e}, userRole: ${a}, accessToken: ${r}`),(async()=>{try{if(!r)return;let t=await (0,Q.userGetInfoV2)(r,e);if(d(t),t.teams&&t.teams.length>0)try{let e=t.teams.map(async e=>{try{let t=await (0,Q.teamInfoCall)(r,e);return{team_id:e,team_alias:t?.team_info?.team_alias||null}}catch{return{team_id:e,team_alias:null}}}),a=await Promise.all(e);u(a)}catch{u(t.teams.map(e=>({team_id:e,team_alias:null})))}let s=(await (0,Q.modelAvailableCall)(r,e,a||"")).data.map(e=>e.id);j(s)}catch(e){console.error("Error fetching user data:",e),J.default.fromBackend("Failed to fetch user data")}finally{g(!1)}})()},[r,e,a]);let ex="proxy_admin"===a||"Admin"===a,eg=async()=>{if(r){ef(!0);try{let e=await (0,Q.teamListCall)(r,null);ed((e||[]).map(e=>({team_id:e.team_id,team_alias:e.team_alias||e.team_id})))}catch(e){console.error("Error fetching teams:",e)}finally{ef(!1)}}},ey=async()=>{if(r&&ec){en(!0);try{await (0,Q.teamMemberAddCall)(r,ec,{role:em,user_id:e}),J.default.success("User added to team successfully"),G(!1);let t=await (0,Q.userGetInfoV2)(r,e);if(d(t),t.teams&&t.teams.length>0){let e=t.teams.map(async e=>{try{let t=await (0,Q.teamInfoCall)(r,e);return{team_id:e,team_alias:t?.team_info?.team_alias||null}}catch{return{team_id:e,team_alias:null}}});u(await Promise.all(e))}else u([])}catch(e){console.error("Error adding user to team:",e),J.default.fromBackend(e?.message||"Failed to add user to team")}finally{en(!1)}}},e_=async()=>{if(r&&er){ei(!0);try{await (0,Q.teamMemberDeleteCall)(r,er.team_id,{role:"user",user_id:e}),J.default.success("User removed from team successfully"),et(!1),ea(null);let t=await (0,Q.userGetInfoV2)(r,e);if(d(t),t.teams&&t.teams.length>0){let e=t.teams.map(async e=>{try{let t=await (0,Q.teamInfoCall)(r,e);return{team_id:e,team_alias:t?.team_info?.team_alias||null}}catch{return{team_id:e,team_alias:null}}});u(await Promise.all(e))}else u([])}catch(e){console.error("Error removing user from team:",e),J.default.fromBackend(e?.message||"Failed to remove user from team")}finally{ei(!1)}}},eb=eo.filter(e=>!c.some(t=>t.team_id===e.team_id)),ev=async()=>{if(!r)return void J.default.fromBackend("Access token not found");try{J.default.success("Generating password reset link...");let t=await (0,Q.invitationCreateCall)(r,e);M(t),k(!0)}catch(e){J.default.fromBackend("Failed to generate password reset link")}},ej=async()=>{try{if(!r)return;f(!0),await (0,Q.userDeleteCall)(r,[e]),J.default.success("User deleted successfully"),s&&s(),t()}catch(e){console.error("Error deleting user:",e),J.default.fromBackend("Failed to delete user")}finally{p(!1),f(!1)}},ew=async e=>{try{if(!r||!o)return;await (0,Q.userUpdateUserCall)(r,e,null),d({...o,user_email:e.user_email??o.user_email,user_alias:e.user_alias??o.user_alias,models:e.models??o.models,max_budget:e.max_budget??o.max_budget,budget_duration:e.budget_duration??o.budget_duration,metadata:e.metadata??o.metadata}),J.default.success("User updated successfully"),b(!1)}catch(e){console.error("Error updating user:",e),J.default.fromBackend("Failed to update user")}};if(x)return(0,_.jsxs)("div",{className:"p-4",children:[(0,_.jsx)(S.Button,{icon:rH.ArrowLeftIcon,variant:"light",onClick:t,className:"mb-4",children:"Back to Users"}),(0,_.jsx)(Z.Text,{children:"Loading user data..."})]});if(!o)return(0,_.jsxs)("div",{className:"p-4",children:[(0,_.jsx)(S.Button,{icon:rH.ArrowLeftIcon,variant:"light",onClick:t,className:"mb-4",children:"Back to Users"}),(0,_.jsx)(Z.Text,{children:"User not found"})]});let ek=async(e,t)=>{await (0,rV.copyToClipboard)(e)&&($(e=>({...e,[t]:!0})),setTimeout(()=>{$(e=>({...e,[t]:!1}))},2e3))},eS={user_id:o.user_id,user_info:{user_email:o.user_email,user_alias:o.user_alias,user_role:o.user_role,models:o.models,max_budget:o.max_budget,budget_duration:o.budget_duration,metadata:o.metadata}};return(0,_.jsxs)("div",{className:"p-4",children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(S.Button,{icon:rH.ArrowLeftIcon,variant:"light",onClick:t,className:"mb-4",children:"Back to Users"}),(0,_.jsx)(X.Title,{children:o.user_email||"User"}),(0,_.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,_.jsx)(Z.Text,{className:"text-gray-500 font-mono",children:o.user_id}),(0,_.jsx)(z.Button,{type:"text",size:"small",icon:B["user-id"]?(0,_.jsx)(M_.CheckIcon,{size:12}):(0,_.jsx)(Mb.CopyIcon,{size:12}),onClick:()=>ek(o.user_id,"user-id"),className:`left-2 z-10 transition-all duration-200 ${B["user-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`})]})]}),a&&ts.rolesWithWriteAccess.includes(a)&&(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)(S.Button,{icon:jt.RefreshIcon,variant:"secondary",onClick:ev,className:"flex items-center",children:"Reset Password"}),(0,_.jsx)(S.Button,{icon:jO.TrashIcon,variant:"secondary",onClick:()=>p(!0),className:"flex items-center text-red-500 border-red-500 hover:text-red-600 hover:border-red-600",children:"Delete User"})]})]}),(0,_.jsx)(eH.default,{isOpen:m,title:"Delete User?",message:"Are you sure you want to delete this user? This action cannot be undone.",resourceInformationTitle:"User Information",resourceInformation:[{label:"Email",value:o.user_email},{label:"User ID",value:o.user_id,code:!0},{label:"Global Proxy Role",value:o.user_role&&n?.[o.user_role]?.ui_label||o.user_role||"-"},{label:"Total Spend (USD)",value:null!==o.spend&&void 0!==o.spend?o.spend.toFixed(2):void 0}],onCancel:()=>{p(!1)},onOk:ej,confirmLoading:h}),(0,_.jsxs)(rF.TabGroup,{defaultIndex:O,onIndexChange:D,children:[(0,_.jsxs)(rR.TabList,{className:"mb-4",children:[(0,_.jsx)(rY.Tab,{children:"Overview"}),(0,_.jsx)(rY.Tab,{children:"Details"})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(ee.Grid,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Spend"}),(0,_.jsxs)("div",{className:"mt-2",children:[(0,_.jsxs)(X.Title,{children:["$",(0,rV.formatNumberWithCommas)(o.spend||0,4)]}),(0,_.jsxs)(Z.Text,{children:["of"," ",null!==o.max_budget?`$${(0,rV.formatNumberWithCommas)(o.max_budget,4)}`:"Unlimited"]})]})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,_.jsx)(Z.Text,{children:"Teams"}),ex&&(0,_.jsx)(S.Button,{icon:CO.PlusIcon,variant:"light",size:"xs",onClick:()=>{eu(""),ep("user"),G(!0),eg()},children:"Add Team"})]}),(0,_.jsxs)("div",{className:"mt-2",children:[c.length>0?(0,_.jsx)("div",{className:"max-h-60 overflow-y-auto",children:(0,_.jsxs)(A.Table,{children:[(0,_.jsx)(Y.TableHead,{children:(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(F.TableHeaderCell,{children:"Team Name"}),ex&&(0,_.jsx)(F.TableHeaderCell,{className:"text-right",children:"Actions"})]})}),(0,_.jsx)(E.TableBody,{children:c.slice(0,U?c.length:20).map(e=>(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(I.TableCell,{children:e.team_alias||e.team_id}),ex&&(0,_.jsx)(I.TableCell,{className:"text-right",children:(0,_.jsx)(S.Button,{icon:jO.TrashIcon,variant:"light",size:"xs",color:"red",onClick:()=>{ea(e),et(!0)}})})]},e.team_id))})]})}):(0,_.jsx)(Z.Text,{children:"No teams"}),!U&&c.length>20&&(0,_.jsxs)(S.Button,{variant:"light",size:"xs",className:"mt-2",onClick:()=>W(!0),children:["+",c.length-20," more"]}),U&&c.length>20&&(0,_.jsx)(S.Button,{variant:"light",size:"xs",className:"mt-2",onClick:()=>W(!1),children:"Show Less"})]})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Personal Models"}),(0,_.jsx)("div",{className:"mt-2",children:o.models?.length&&o.models?.length>0?o.models?.map((e,t)=>(0,_.jsx)(Z.Text,{children:e},t)):(0,_.jsx)(Z.Text,{children:"All proxy models"})})]})]})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,_.jsx)(X.Title,{children:"User Settings"}),!y&&a&&ts.rolesWithWriteAccess.includes(a)&&(0,_.jsx)(S.Button,{onClick:()=>b(!0),children:"Edit Settings"})]}),y&&o?(0,_.jsx)(Rz,{userData:eS,onCancel:()=>b(!1),onSubmit:ew,teams:c,accessToken:r,userID:e,userRole:a,userModels:v,possibleUIRoles:n}):(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"User ID"}),(0,_.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,_.jsx)(Z.Text,{className:"font-mono",children:o.user_id}),(0,_.jsx)(z.Button,{type:"text",size:"small",icon:B["user-id"]?(0,_.jsx)(M_.CheckIcon,{size:12}):(0,_.jsx)(Mb.CopyIcon,{size:12}),onClick:()=>ek(o.user_id,"user-id"),className:`left-2 z-10 transition-all duration-200 ${B["user-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`})]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Email"}),(0,_.jsx)(Z.Text,{children:o.user_email||"Not Set"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"User Alias"}),(0,_.jsx)(Z.Text,{children:o.user_alias||"Not Set"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Global Proxy Role"}),(0,_.jsx)(Z.Text,{children:o.user_role||"Not Set"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Created"}),(0,_.jsx)(Z.Text,{children:o.created_at?new Date(o.created_at).toLocaleString():"Unknown"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Last Updated"}),(0,_.jsx)(Z.Text,{children:o.updated_at?new Date(o.updated_at).toLocaleString():"Unknown"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Personal Models"}),(0,_.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:o.models?.length&&o.models?.length>0?o.models?.map((e,t)=>(0,_.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e},t)):(0,_.jsx)(Z.Text,{children:"All proxy models"})})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Max Budget"}),(0,_.jsx)(Z.Text,{children:null!==o.max_budget&&void 0!==o.max_budget?`$${(0,rV.formatNumberWithCommas)(o.max_budget,4)}`:"Unlimited"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Budget Reset"}),(0,_.jsx)(Z.Text,{children:(0,Ea.getBudgetDurationLabel)(o.budget_duration??null)})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Metadata"}),(0,_.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(o.metadata||{},null,2)})]})]})]})})]})]}),(0,_.jsx)(RV.default,{isInvitationLinkModalVisible:w,setIsInvitationLinkModalVisible:k,baseUrl:C||"",invitationLinkData:N,modalType:"resetPassword"}),(0,_.jsx)(eH.default,{isOpen:K,title:"Remove from Team",alertMessage:"Removing this user from the team will also delete any keys the user created for this team.",message:"Are you sure you want to remove this user from the team? This action cannot be undone.",resourceInformationTitle:"Team Membership",resourceInformation:[{label:"Team",value:er?.team_alias||er?.team_id},{label:"User ID",value:o?.user_id,code:!0},{label:"Email",value:o?.user_email}],onCancel:()=>{et(!1),ea(null)},onOk:e_,confirmLoading:el}),(0,_.jsx)(q.Modal,{title:"Add User to Team",open:V,onCancel:()=>G(!1),footer:null,width:500,maskClosable:!es,children:(0,_.jsxs)(H.Form,{layout:"vertical",onFinish:ey,children:[(0,_.jsx)(H.Form.Item,{label:"Team",required:!0,children:(0,_.jsx)(eE.Select,{showSearch:!0,value:ec||void 0,onChange:eu,placeholder:"Select a team",filterOption:(e,t)=>{let r=eb.find(e=>e.team_id===t?.value);return!!r&&r.team_alias.toLowerCase().includes(e.toLowerCase())},loading:eh,children:eb.map(e=>(0,_.jsx)(eE.Select.Option,{value:e.team_id,children:e.team_alias},e.team_id))})}),(0,_.jsx)(H.Form.Item,{label:"Member Role",children:(0,_.jsxs)(eE.Select,{value:em,onChange:ep,children:[(0,_.jsx)(eE.Select.Option,{value:"user",children:(0,_.jsxs)(tB.Tooltip,{title:"Can view team info, but not manage it",children:[(0,_.jsx)("span",{className:"font-medium",children:"user"}),(0,_.jsx)("span",{className:"ml-2 text-gray-500 text-sm",children:"- Can view team info, but not manage it"})]})}),(0,_.jsx)(eE.Select.Option,{value:"admin",children:(0,_.jsxs)(tB.Tooltip,{title:"Can create team keys, add members, and manage settings",children:[(0,_.jsx)("span",{className:"font-medium",children:"admin"}),(0,_.jsx)("span",{className:"ml-2 text-gray-500 text-sm",children:"- Can create team keys, add members, and manage settings"})]})})]})}),(0,_.jsx)("div",{className:"text-right mt-4",children:(0,_.jsx)(z.Button,{type:"primary",htmlType:"submit",loading:es,disabled:!ec,children:es?"Adding...":"Add to Team"})})]})})]})}var RX=e.i(655913),RZ=e.i(38419),R0=e.i(78334),R1=e.i(555436),R2=e.i(284614);let R4=(0,eT.default)("circle-user-round",[["path",{d:"M18 20a6 6 0 0 0-12 0",key:"1qehca"}],["circle",{cx:"12",cy:"10",r:"4",key:"1h16sb"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);function R5({data:e=[],columns:t,isLoading:r=!1,onSortChange:a,currentSort:s,accessToken:n,userRole:l,possibleUIRoles:i,handleEdit:o,handleDelete:d,handleResetPassword:c,selectedUsers:u=[],onSelectionChange:m,enableSelection:p=!1,filters:h,updateFilters:f,initialFilters:x,teams:g,userListResponse:y,currentPage:b,handlePageChange:v}){let[j,w]=T.default.useState([{id:s?.sortBy||"created_at",desc:s?.sortOrder==="desc"}]),[k,S]=T.default.useState(null),[N,M]=T.default.useState(!1),[C,L]=T.default.useState(!1),O=(e,t=!1)=>{S(e),M(t)},D=(e,t)=>{m&&(t?m([...u,e]):m(u.filter(t=>t.user_id!==e.user_id)))},P=t=>{m&&(t?m(e):m([]))},B=e=>u.some(t=>t.user_id===e.user_id),z=e.length>0&&u.length===e.length,H=u.length>0&&u.lengthi?RJ(i,o,d,c,O,p?{selectedUsers:u,onSelectUser:D,onSelectAll:P,isUserSelected:B,isAllSelected:z,isIndeterminate:H}:void 0):t,[i,o,d,c,O,t,p,u,z,H]),q=(0,jD.useReactTable)({data:e,columns:$,state:{sorting:j},onSortingChange:e=>{let t="function"==typeof e?e(j):e;if(w(t),t&&Array.isArray(t)&&t.length>0&&t[0]){let e=t[0];if(e.id){let t=e.id,r=e.desc?"desc":"asc";a?.(t,r)}}else a?.("created_at","desc")},getCoreRowModel:(0,jP.getCoreRowModel)(),manualSorting:!0,enableSorting:!0});return(T.default.useEffect(()=>{s&&w([{id:s.sortBy,desc:"desc"===s.sortOrder}])},[s]),k)?(0,_.jsx)(RQ,{userId:k,onClose:()=>{S(null),M(!1)},accessToken:n,userRole:l,possibleUIRoles:i,initialTab:+!!N,startInEditMode:N}):(0,_.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,_.jsx)("div",{className:"border-b px-6 py-4",children:(0,_.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,_.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,_.jsx)(RX.FilterInput,{placeholder:"Search by email...",value:h.email,onChange:e=>f({email:e}),icon:R1.Search}),(0,_.jsx)(RZ.FiltersButton,{onClick:()=>L(!C),active:C,hasActiveFilters:!!(h.user_id||h.user_role||h.team)}),(0,_.jsx)(R0.ResetFiltersButton,{onClick:()=>{f(x)}})]}),C&&(0,_.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,_.jsx)(RX.FilterInput,{placeholder:"Filter by User ID",value:h.user_id,onChange:e=>f({user_id:e}),icon:R2.User}),(0,_.jsx)(RX.FilterInput,{placeholder:"Filter by SSO ID",value:h.sso_user_id,onChange:e=>f({sso_user_id:e}),icon:R4}),(0,_.jsx)("div",{className:"w-64",children:(0,_.jsx)(jc.Select,{value:h.user_role,onValueChange:e=>f({user_role:e}),placeholder:"Select Role",children:i&&Object.entries(i).map(([e,t])=>(0,_.jsx)(ju.SelectItem,{value:e,children:t.ui_label},e))})}),(0,_.jsx)("div",{className:"w-64",children:(0,_.jsx)(jc.Select,{value:h.team,onValueChange:e=>f({team:e}),placeholder:"Select Team",children:g?.map(e=>(0,_.jsx)(ju.SelectItem,{value:e.team_id,children:e.team_alias||e.team_id},e.team_id))})})]}),(0,_.jsxs)("div",{className:"flex justify-between items-center",children:[r?(0,_.jsx)(ey.Skeleton.Input,{active:!0,style:{width:192,height:20}}):(0,_.jsxs)("span",{className:"text-sm text-gray-700",children:["Showing"," ",y&&y.users&&y.users.length>0?(y.page-1)*y.page_size+1:0," ","-"," ",y&&y.users?Math.min(y.page*y.page_size,y.total):0," ","of ",y?y.total:0," results"]}),(0,_.jsx)("div",{className:"flex space-x-2",children:r?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(ey.Skeleton.Button,{active:!0,size:"small",style:{width:80,height:30}}),(0,_.jsx)(ey.Skeleton.Button,{active:!0,size:"small",style:{width:60,height:30}})]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("button",{onClick:()=>v(b-1),disabled:1===b,className:`px-3 py-1 text-sm border rounded-md ${1===b?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"}`,children:"Previous"}),(0,_.jsx)("button",{onClick:()=>v(b+1),disabled:!y||b>=y.total_pages,className:`px-3 py-1 text-sm border rounded-md ${!y||b>=y.total_pages?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"}`,children:"Next"})]})})]})]})}),(0,_.jsx)("div",{className:"overflow-auto",children:(0,_.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,_.jsx)("div",{className:"overflow-x-auto",children:(0,_.jsxs)(A.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,_.jsx)(Y.TableHead,{children:q.getHeaderGroups().map(e=>(0,_.jsx)(R.TableRow,{children:e.headers.map(e=>(0,_.jsx)(F.TableHeaderCell,{className:`py-1 h-8 ${"actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""} ${e.column.getCanSort()?"cursor-pointer hover:bg-gray-50":""}`,onClick:e.column.getToggleSortingHandler(),children:(0,_.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,_.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,jD.flexRender)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&e.column.getCanSort()&&(0,_.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,_.jsx)(jC.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,_.jsx)(jM.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,_.jsx)(jL.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,_.jsx)(E.TableBody,{children:r?(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:$.length,className:"h-8 text-center",children:(0,_.jsx)("div",{className:"text-center text-gray-500",children:(0,_.jsx)("p",{children:"🚅 Loading users..."})})})}):e.length>0?q.getRowModel().rows.map(e=>(0,_.jsx)(R.TableRow,{className:"h-8",children:e.getVisibleCells().map(e=>(0,_.jsx)(I.TableCell,{className:`py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ${"actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""}`,onClick:()=>{"user_id"===e.column.id&&O(e.getValue(),!1)},style:{cursor:"user_id"===e.column.id?"pointer":"default",color:"user_id"===e.column.id?"#3b82f6":"inherit"},children:(0,jD.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:$.length,className:"h-8 text-center",children:(0,_.jsx)("div",{className:"text-center text-gray-500",children:(0,_.jsx)("p",{children:"No users found"})})})})})]})})})})]})}let{Text:R6,Title:R3}=V.Typography,R8={email:"",user_id:"",user_role:"",sso_user_id:"",team:"",model:"",min_spend:null,max_spend:null,sort_by:"created_at",sort_order:"desc"},R7=({accessToken:e,token:t,userRole:r,userID:a,teams:s,orgAdminOrgIds:n})=>{let l=!!r&&(0,ts.isProxyAdminRole)(r),i=(0,eh.useQueryClient)(),[o,d]=(0,T.useState)(1),[c,u]=(0,T.useState)(!1),[m,p]=(0,T.useState)(null),[h,f]=(0,T.useState)(!1),[x,g]=(0,T.useState)(!1),[y,b]=(0,T.useState)(null),[v,j]=(0,T.useState)("users"),[w,k]=(0,T.useState)(R8),[S,N,M]=(0,Db.useDebouncedState)(w,{wait:300}),[C,L]=(0,T.useState)(!1),[O,D]=(0,T.useState)(null),[P,A]=(0,T.useState)(null),[E,I]=(0,T.useState)([]),[Y,F]=(0,T.useState)(!1),[R,B]=(0,T.useState)(!1),[H,$]=(0,T.useState)([]),q=e=>{b(e),f(!0)};(0,T.useEffect)(()=>()=>{M.cancel()},[M]),(0,T.useEffect)(()=>{A((0,Q.getProxyBaseUrl)())},[]),(0,T.useEffect)(()=>{(async()=>{try{if(!a||!r||!e)return;let t=(await (0,Q.modelAvailableCall)(e,a,r)).data.map(e=>e.id);console.log("available_model_names:",t),$(t)}catch(e){console.error("Error fetching user models:",e)}})()},[e,a,r]);let U=e=>{k(t=>{let r={...t,...e};return N(r),r})},W=(e,t)=>{U({sort_by:e,sort_order:t})},V=async t=>{if(!e)return void J.default.fromBackend("Access token not found");try{J.default.success("Generating password reset link...");let r=await (0,Q.invitationCreateCall)(e,t);D(r),L(!0)}catch(e){J.default.fromBackend("Failed to generate password reset link")}},G=async()=>{if(y&&e)try{g(!0),await (0,Q.userDeleteCall)(e,[y.user_id]),i.setQueriesData({queryKey:["userList"]},e=>{if(void 0===e)return e;let t=e.users.filter(e=>e.user_id!==y.user_id);return{...e,users:t}}),J.default.success("User deleted successfully")}catch(e){console.error("Error deleting user:",e),J.default.fromBackend("Failed to delete user")}finally{f(!1),b(null),g(!1)}},K=async()=>{p(null),u(!1)},X=async s=>{if(console.log("inside handleEditSubmit:",s),e&&t&&r&&a){try{let t=await (0,Q.userUpdateUserCall)(e,s,null);i.setQueriesData({queryKey:["userList"]},e=>{if(void 0===e)return e;let r=e.users.map(e=>e.user_id===t.data.user_id?(0,rV.updateExistingKeys)(e,t.data):e);return{...e,users:r}}),J.default.success(`User ${s.user_id} updated successfully`)}catch(e){console.error("There was an error updating the user",e)}p(null),u(!1)}},Z=async e=>{d(e)},ee=e=>{I(e)},et=(0,ev.useQuery)({queryKey:["userList",{debouncedFilter:S,currentPage:o,orgAdminOrgIds:n}],queryFn:async()=>{if(!e)throw Error("Access token required");return await (0,Q.userListCall)(e,S.user_id?[S.user_id]:null,o,25,S.email||null,S.user_role||null,S.team||null,S.sso_user_id||null,S.sort_by,S.sort_order,n?n.map(e=>e.organization_id):null)},enabled:!!(e&&t&&r&&a),placeholderData:e=>e}),er=et.data,ea=(0,ev.useQuery)({queryKey:["userRoles"],initialData:()=>({}),queryFn:async()=>{if(!e)throw Error("Access token required");return await (0,Q.getPossibleUserRoles)(e)},enabled:!!(e&&t&&r&&a)}).data,es=RJ(ea,e=>{p(e),u(!0)},q,V,()=>{});return(0,_.jsxs)("div",{className:"w-full p-8 overflow-hidden",children:[(0,_.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,_.jsx)("div",{className:"flex space-x-3",children:et.isLoading?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(ey.Skeleton.Button,{active:!0,size:"default",shape:"default",style:{width:110,height:36}}),(0,_.jsx)(ey.Skeleton.Button,{active:!0,size:"default",shape:"default",style:{width:145,height:36}}),(0,_.jsx)(ey.Skeleton.Button,{active:!0,size:"default",shape:"default",style:{width:110,height:36}})]}):a&&e?(0,_.jsxs)(_.Fragment,{children:[l&&(0,_.jsx)(RU.CreateUserButton,{userID:a,accessToken:e,teams:s,possibleUIRoles:ea}),l&&(0,_.jsx)(z.Button,{onClick:()=>{B(!R),I([])},type:R?"primary":"default",className:"flex items-center",children:R?"Cancel Selection":"Select Users"}),l&&R&&(0,_.jsxs)(z.Button,{type:"primary",onClick:()=>{0===E.length?J.default.fromBackend("Please select users to edit"):F(!0)},disabled:0===E.length,className:"flex items-center",children:["Bulk Edit (",E.length," selected)"]})]}):null})}),l?(0,_.jsxs)(rF.TabGroup,{defaultIndex:0,onIndexChange:e=>j(0===e?"users":"settings"),children:[(0,_.jsxs)(rR.TabList,{className:"mb-4",children:[(0,_.jsx)(rY.Tab,{children:"Users"}),(0,_.jsx)(rY.Tab,{children:"Default User Settings"})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(R5,{data:et.data?.users||[],columns:es,isLoading:et.isLoading,accessToken:e,userRole:r,onSortChange:W,currentSort:{sortBy:w.sort_by,sortOrder:w.sort_order},possibleUIRoles:ea,handleEdit:e=>{p(e),u(!0)},handleDelete:q,handleResetPassword:V,enableSelection:R,selectedUsers:E,onSelectionChange:ee,filters:w,updateFilters:U,initialFilters:R8,teams:s,userListResponse:er,currentPage:o,handlePageChange:Z})}),(0,_.jsx)(rB.TabPanel,{children:a&&r&&e?(0,_.jsx)(RG,{accessToken:e,possibleUIRoles:ea,userID:a,userRole:r}):(0,_.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,_.jsx)(ey.Skeleton,{active:!0,paragraph:{rows:4}})})})]})]}):(0,_.jsx)(R5,{data:et.data?.users||[],columns:es,isLoading:et.isLoading,accessToken:e,userRole:r,onSortChange:W,currentSort:{sortBy:w.sort_by,sortOrder:w.sort_order},possibleUIRoles:ea,handleEdit:e=>{p(e),u(!0)},handleDelete:q,handleResetPassword:V,enableSelection:!1,selectedUsers:[],onSelectionChange:ee,filters:w,updateFilters:U,initialFilters:R8,teams:s,userListResponse:er,currentPage:o,handlePageChange:Z}),(0,_.jsx)(RW,{visible:c,possibleUIRoles:ea,onCancel:K,user:m,onSubmit:X}),(0,_.jsx)(eH.default,{isOpen:h,title:"Delete User?",message:"Are you sure you want to delete this user? This action cannot be undone.",resourceInformationTitle:"User Information",resourceInformation:[{label:"Email",value:y?.user_email},{label:"User ID",value:y?.user_id,code:!0},{label:"Global Proxy Role",value:y&&ea?.[y.user_role]?.ui_label||y?.user_role||"-"},{label:"Total Spend (USD)",value:y?.spend?.toFixed(2)}],onCancel:()=>{f(!1),b(null)},onOk:G,confirmLoading:x}),(0,_.jsx)(RV.default,{isInvitationLinkModalVisible:C,setIsInvitationLinkModalVisible:L,baseUrl:P||"",invitationLinkData:O,modalType:"resetPassword"}),(0,_.jsx)(Rq,{open:Y,onCancel:()=>F(!1),selectedUsers:E,possibleUIRoles:ea,accessToken:e,onSuccess:()=>{i.invalidateQueries({queryKey:["userList"]}),I([]),B(!1)},teams:s,userRole:r,userModels:H,allowAllUsers:!!r&&(0,ts.isAdminRole)(r)})]})};var R9=e.i(557951),Be=e.i(321836),Bt=e.i(618566),Br=e.i(592143);let Ba={};function Bs(){let{authLoading:e,token:t,userID:r,userRole:a,userEmail:s,accessToken:n,premiumUser:l,setUserRole:i,setUserEmail:o}=(0,R9.useAuth)(),[d,c]=(0,T.useState)(null),[u,m]=(0,T.useState)([]),[p,h]=(0,T.useState)([]),[f,x]=(0,T.useState)([]),[g,y]=(0,T.useState)({PROXY_BASE_URL:"",PROXY_LOGOUT_URL:""}),k=(0,Bt.useRouter)(),S=(0,Bt.useSearchParams)(),[N,M]=(0,T.useState)({data:[]}),[C,L]=(0,T.useState)(!1),[O,D]=(0,T.useState)(!0),[P,A]=(0,T.useState)(!1),[E,I]=(0,T.useState)(!1),[Y,F]=(0,T.useState)(!1),[R,B]=(0,T.useState)(!1),[z,H]=(0,T.useState)(!1),$=S.get("invitation_id"),q="true"===S.get("create"),U=(0,T.useMemo)(()=>{if(!q)return;let e=S.get("owned_by"),t=S.get("team_id"),r=S.get("key_alias"),a=S.get("models"),s=S.get("key_type");if(!e&&!t&&!r&&!a&&!s)return;let n=e&&["you","service_account","another_user"].includes(e)?e:void 0,l=s&&["default","llm_api","management"].includes(s)?s:void 0,i=r?r.trim().slice(0,256):void 0,o=a?a.split(",").slice(0,100).map(e=>e.trim().slice(0,256)).filter(e=>e.length>0):void 0;return{owned_by:n,team_id:t?.trim()||void 0,key_alias:i,models:o&&o.length>0?o:void 0,key_type:l}},[S,q]),[W,V]=(0,T.useState)(()=>S.get("page")||"api-keys"),[G,K]=(0,T.useState)(!1),J=(0,T.useRef)(!1),X=e=>{m(t=>t?[...t,e]:[e]),L(()=>!C)},Z=!1===e&&null===t&&null===$;(0,T.useEffect)(()=>{if(Z){(0,Be.storeReturnUrl)();let e=(Q.proxyBaseUrl||"")+"/ui/login",t=(0,Be.buildLoginUrlWithReturn)(e);window.location.replace(t)}},[Z]);let ee=W in Ba;return((0,T.useEffect)(()=>{if(!e&&ee){let e=(Q.proxyBaseUrl||"")+"/ui";k.replace(`${e}/${Ba[W]}`)}},[e,ee,W,k]),(0,T.useEffect)(()=>{if(e||!t||J.current)return;J.current=!0;let r=(0,Be.consumeReturnUrl)();if(r&&(0,Be.isValidReturnUrl)(r)){let e=new URL(r,window.location.origin);if(e.origin!==window.location.origin)return;let t=window.location.href;(0,Be.normalizeUrlForCompare)(r)!==(0,Be.normalizeUrlForCompare)(t)&&window.location.replace(e.href)}},[e,t]),(0,T.useEffect)(()=>{t||(J.current=!1)},[t]),(0,T.useEffect)(()=>{n&&r&&a&&(0,EO.fetchUserModels)(r,a,n,x),n&&r&&a&&(0,jY.teamListCall)(n,1,100,{userID:"Admin"!==a&&"Admin Viewer"!==a?r:null}).then(e=>c(e.teams??[])).catch(console.error),n&&(0,ED.fetchOrganizations)(n,h)},[n,r,a]),(0,T.useEffect)(()=>{n&&t&&(async()=>{try{let e=await (0,Q.getInProductNudgesCall)(n),t=e?.is_claude_code_enabled||!1;I(t),t&&(F(!0),D(!1))}catch(e){console.error("Failed to fetch in-product nudges:",e)}})()},[n,t]),(0,T.useEffect)(()=>{if(O&&!P){let e=setTimeout(()=>{D(!1)},15e3);return()=>clearTimeout(e)}},[O,P]),(0,T.useEffect)(()=>{if(Y&&!R){let e=setTimeout(()=>{F(!1)},15e3);return()=>clearTimeout(e)}},[Y,R]),e||Z||ee)?(0,_.jsx)(jF.default,{}):(0,_.jsx)(T.Suspense,{fallback:(0,_.jsx)(jF.default,{}),children:(0,_.jsx)(Br.ConfigProvider,{theme:{algorithm:z?Ef.theme.darkAlgorithm:Ef.theme.defaultAlgorithm},children:(0,_.jsx)(Yh.ThemeProvider,{accessToken:n,children:$?(0,_.jsx)(Yv.default,{userID:r,userRole:a,premiumUser:l,teams:d,keys:u,setUserRole:i,userEmail:s,setUserEmail:o,setTeams:c,setKeys:m,organizations:p,addKey:X,createClicked:C}):(0,_.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,_.jsx)(D_.default,{setProxySettings:y,proxySettings:g,accessToken:n,isPublicPage:!1,sidebarCollapsed:G,onToggleSidebar:()=>{K(!G)}}),(0,_.jsxs)("div",{className:"flex flex-1",children:[(0,_.jsx)("div",{className:"mt-2",children:(0,_.jsx)(v.default,{setPage:e=>{let t=new URLSearchParams(S);t.set("page",e),window.history.pushState(null,"",`?${t.toString()}`),V(e)},defaultSelectedKey:W,sidebarCollapsed:G})}),"api-keys"==W?(0,_.jsx)(Yv.default,{userID:r,userRole:a,premiumUser:l,teams:d,keys:u,setUserRole:i,userEmail:s,setUserEmail:o,setTeams:c,setKeys:m,organizations:p,addKey:X,createClicked:C,autoOpenCreate:q,prefillData:U}):"models"==W?(0,_.jsx)(j.default,{token:t,keys:u,modelData:N,setModelData:M,premiumUser:l,teams:d}):"llm-playground"==W?(0,_.jsx)(w.default,{}):"users"==W?(0,_.jsx)(R7,{userID:r,userRole:a,token:t,keys:u,teams:d,accessToken:n,setKeys:m}):"teams"==W?(0,_.jsx)(EL,{teams:d,setTeams:c,accessToken:n,userID:r,userRole:a,organizations:p,premiumUser:l,searchParams:S}):"organizations"==W?(0,_.jsx)(ED.default,{organizations:p,setOrganizations:h,userModels:f,accessToken:n,userRole:a,premiumUser:l}):"admin-panel"==W?(0,_.jsx)(tF,{proxySettings:g}):"api_ref"==W||"api-reference"==W?(0,_.jsx)(b.default,{proxySettings:g}):"logging-and-alerts"==W?(0,_.jsx)(I3,{userID:r,userRole:a,accessToken:n,premiumUser:l}):"budgets"==W?(0,_.jsx)(r3,{accessToken:n}):"guardrails"==W?(0,_.jsx)(CM,{accessToken:n,userRole:a}):"policies"==W?(0,_.jsx)(LT,{accessToken:n,userRole:a}):"agents"==W?(0,_.jsx)(rK,{accessToken:n,userRole:a,teams:d}):"prompts"==W?(0,_.jsx)(Ih,{accessToken:n,userRole:a}):"transform-request"==W?(0,_.jsx)(Yp,{accessToken:n}):"router-settings"==W?(0,_.jsx)(ks,{userID:r,userRole:a,accessToken:n,modelData:N}):"ui-theme"==W?(0,_.jsx)(Yf,{userID:r,userRole:a,accessToken:n}):"cost-tracking"==W?(0,_.jsx)(wC,{userID:r,userRole:a,accessToken:n}):"model-hub-table"==W?(0,ts.isAdminRole)(a)?(0,_.jsx)(Dy.default,{accessToken:n,publicPage:!1,premiumUser:l,userRole:a}):(0,_.jsx)(If.default,{accessToken:n,isEmbedded:!0}):"caching"==W?(0,_.jsx)(jj,{userID:r,userRole:a,token:t,accessToken:n,premiumUser:l}):"pass-through-settings"==W?(0,_.jsx)(EP.default,{userID:r,userRole:a,accessToken:n,modelData:N,premiumUser:l}):"logs"==W?(0,_.jsx)(RB,{userID:r,userRole:a,token:t,accessToken:n,premiumUser:l}):"mcp-servers"==W?(0,_.jsx)(Dg,{accessToken:n,userRole:a,userID:r}):"search-tools"==W?(0,_.jsx)(IN,{accessToken:n,userRole:a,userID:r}):"tag-management"==W?(0,_.jsx)(Ym,{accessToken:n,userRole:a,userID:r}):"skills"==W||"claude-code-plugins"==W?(0,_.jsx)(jI,{accessToken:n,userRole:a}):"access-groups"==W?(0,_.jsx)(YH,{}):"projects"==W?(0,_.jsx)(Y8,{}):"vector-stores"==W?(0,_.jsx)(Fw,{accessToken:n,userRole:a,userID:r}):"tool-policies"==W?(0,_.jsx)(FY,{accessToken:n,userRole:a}):"workflows"==W?(0,_.jsx)(F5,{accessToken:n}):"memory"==W?(0,_.jsx)(Fq,{accessToken:n,userID:r,userRole:a}):"guardrails-monitor"==W?(0,_.jsx)(Ts,{accessToken:n}):"new_usage"==W?(0,_.jsx)(A9,{teams:d??[],organizations:p??[]}):(0,_.jsx)(Yb,{userID:r,userRole:a,token:t,accessToken:n,keys:u,premiumUser:l})]}),(0,_.jsx)(Ya,{isVisible:O,onOpen:()=>{D(!1),A(!0)},onDismiss:()=>{D(!1)}}),(0,_.jsx)(Yn,{isOpen:P,onClose:()=>{A(!1),D(!0)},onComplete:()=>{A(!1)}}),(0,_.jsx)(Yl,{isVisible:Y,onOpen:()=>{F(!1),B(!0)},onDismiss:()=>{F(!1)}}),(0,_.jsx)(Yi,{isOpen:R,onClose:()=>{B(!1),F(!0)},onComplete:()=>{B(!1)}})]})})})})}function Bn(){return(0,_.jsx)(T.Suspense,{fallback:(0,_.jsx)(jF.default,{}),children:(0,_.jsx)(Bs,{})})}e.s(["default",()=>Bn],952683)}]); \ No newline at end of file + }'`}),(0,_.jsx)(z.Button,{type:"text",icon:(0,_.jsx)(ei.CopyOutlined,{}),style:{position:"absolute",right:"8px",top:"8px"},size:"small",onClick:()=>{navigator.clipboard.writeText(a||""),J.default.success("Copied to clipboard")}})]})]})]}),(0,_.jsx)("div",{className:"mt-4 text-right w-full",children:(0,_.jsxs)("p",{className:"text-sm text-gray-500",children:["Found an error? File an issue"," ",(0,_.jsx)("a",{href:"https://github.com/BerriAI/litellm/issues",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})})]})};var Yx=e.i(275144);let Yg=({userID:e,userRole:t,accessToken:r})=>{let{logoUrl:a,setLogoUrl:s,faviconUrl:n,setFaviconUrl:l}=(0,Yx.useTheme)(),[i,o]=(0,T.useState)(""),[d,c]=(0,T.useState)(""),[u,m]=(0,T.useState)(!1);(0,T.useEffect)(()=>{r&&p()},[r]);let p=async()=>{try{let e=(0,Q.getProxyBaseUrl)(),t=e?`${e}/get/ui_theme_settings`:"/get/ui_theme_settings",a=await fetch(t,{method:"GET",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${r}`,"Content-Type":"application/json"}});if(a.ok){let e=await a.json();o(e.values?.logo_url||""),c(e.values?.favicon_url||""),s(e.values?.logo_url||null),l(e.values?.favicon_url||null)}}catch(e){console.error("Error fetching theme settings:",e)}},h=async()=>{m(!0);try{let e=(0,Q.getProxyBaseUrl)(),t=e?`${e}/update/ui_theme_settings`:"/update/ui_theme_settings";if((await fetch(t,{method:"PATCH",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify({logo_url:i||null,favicon_url:d||null})})).ok)J.default.success("Theme settings updated successfully!"),s(i||null),l(d||null);else throw Error("Failed to update settings")}catch(e){console.error("Error updating theme settings:",e),J.default.fromBackend("Failed to update theme settings")}finally{m(!1)}},f=async()=>{o(""),c(""),s(null),l(null),m(!0);try{let e=(0,Q.getProxyBaseUrl)(),t=e?`${e}/update/ui_theme_settings`:"/update/ui_theme_settings";if((await fetch(t,{method:"PATCH",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify({logo_url:null,favicon_url:null})})).ok)J.default.success("Theme settings reset to default!");else throw Error("Failed to reset")}catch(e){console.error("Error resetting theme settings:",e),J.default.fromBackend("Failed to reset theme settings")}finally{m(!1)}};return r?(0,_.jsxs)("div",{className:"w-full mx-auto max-w-4xl px-6 py-8",children:[(0,_.jsxs)("div",{className:"mb-8",children:[(0,_.jsx)(X.Title,{className:"text-2xl font-bold mb-2",children:"UI Theme Customization"}),(0,_.jsx)(Z.Text,{className:"text-gray-600",children:"Customize your LiteLLM admin dashboard with a custom logo and favicon."})]}),(0,_.jsx)(P.Card,{className:"shadow-sm p-6",children:(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Custom Logo URL"}),(0,_.jsx)(et.TextInput,{placeholder:"https://example.com/logo.png",value:i,onValueChange:e=>{o(e),s(e||null)},className:"w-full"}),(0,_.jsx)(Z.Text,{className:"text-xs text-gray-500 mt-1",children:"Enter a URL for your custom logo or leave empty for default"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Custom Favicon URL"}),(0,_.jsx)(et.TextInput,{placeholder:"https://example.com/favicon.ico",value:d,onValueChange:e=>{c(e),l(e||null)},className:"w-full"}),(0,_.jsx)(Z.Text,{className:"text-xs text-gray-500 mt-1",children:"Enter a URL for your custom favicon (.ico, .png, or .svg) or leave empty for default"})]}),(0,_.jsxs)("div",{className:"flex gap-3 pt-4",children:[(0,_.jsx)(S.Button,{onClick:h,loading:u,disabled:u,color:"indigo",children:"Save Changes"}),(0,_.jsx)(S.Button,{onClick:f,loading:u,disabled:u,variant:"secondary",color:"gray",children:"Reset to Default"})]})]})})]}):null},Yy=(0,L.makeClassName)("BarList");function Y_(e,t){let{data:r=[],color:a,valueFormatter:s=L.defaultValueFormatter,showAnimation:n=!1,onValueChange:l,sortOrder:i="descending",className:o}=e,d=(0,N.__rest)(e,["data","color","valueFormatter","showAnimation","onValueChange","sortOrder","className"]),c=l?"button":"div",u=T.default.useMemo(()=>"none"===i?r:[...r].sort((e,t)=>"ascending"===i?e.value-t.value:t.value-e.value),[r,i]),m=T.default.useMemo(()=>{let e=Math.max(...u.map(e=>e.value),0);return u.map(t=>0===t.value?0:Math.max(t.value/e*100,2))},[u]);return T.default.createElement("div",Object.assign({ref:t,className:(0,C.tremorTwMerge)(Yy("root"),"flex justify-between space-x-6",o),"aria-sort":i},d),T.default.createElement("div",{className:(0,C.tremorTwMerge)(Yy("bars"),"relative w-full space-y-1.5")},u.map((e,t)=>{var r,s,i;let o=e.icon;return T.default.createElement(c,{key:null!=(r=e.key)?r:t,onClick:()=>{null==l||l(e)},className:(0,C.tremorTwMerge)(Yy("bar"),"group w-full flex items-center rounded-tremor-small",l?["cursor-pointer","hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-subtle/40"]:"")},T.default.createElement("div",{className:(0,C.tremorTwMerge)("flex items-center rounded transition-all bg-opacity-40","h-8",e.color||a?[(0,L.getColorClassNames)(null!=(s=e.color)?s:a,M.colorPalette.background).bgColor,l?"group-hover:bg-opacity-30":""]:"bg-tremor-brand-subtle dark:bg-dark-tremor-brand-subtle/60",!l||e.color||a?"":"group-hover:bg-tremor-brand-subtle/30 group-hover:dark:bg-dark-tremor-brand-subtle/70",t===u.length-1?"mb-0":"",n?"duration-500":""),style:{width:`${m[t]}%`,transition:n?"all 1s":""}},T.default.createElement("div",{className:(0,C.tremorTwMerge)("absolute left-2 pr-4 flex max-w-full")},o?T.default.createElement(o,{className:(0,C.tremorTwMerge)(Yy("barIcon"),"flex-none h-5 w-5 mr-2","text-tremor-content","dark:text-dark-tremor-content")}):null,e.href?T.default.createElement("a",{href:e.href,target:null!=(i=e.target)?i:"_blank",rel:"noreferrer",className:(0,C.tremorTwMerge)(Yy("barLink"),"whitespace-nowrap hover:underline truncate text-tremor-default",l?"cursor-pointer":"","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis"),onClick:e=>e.stopPropagation()},e.name):T.default.createElement("p",{className:(0,C.tremorTwMerge)(Yy("barText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e.name))))})),T.default.createElement("div",{className:Yy("labels")},u.map((e,t)=>{var r;return T.default.createElement("div",{key:null!=(r=e.key)?r:t,className:(0,C.tremorTwMerge)(Yy("labelWrapper"),"flex justify-end items-center","h-8",t===u.length-1?"mb-0":"mb-1.5")},T.default.createElement("p",{className:(0,C.tremorTwMerge)(Yy("labelText"),"whitespace-nowrap leading-none truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},s(e.value)))})))}Y_.displayName="BarList";let Yb=T.default.forwardRef(Y_);console.log("process.env.NODE_ENV","production");let Yv=e=>null!==e&&("Admin"===e||"Admin Viewer"===e),Yj=({accessToken:e,token:t,userRole:r,userID:a,keys:s,premiumUser:n})=>{let l=new Date,[i,o]=(0,T.useState)([]),[d,c]=(0,T.useState)([]),[u,m]=(0,T.useState)([]),[p,h]=(0,T.useState)([]),[f,x]=(0,T.useState)([]),[g,y]=(0,T.useState)([]),[b,v]=(0,T.useState)([]),[j,w]=(0,T.useState)([]),[k,N]=(0,T.useState)([]),[M,C]=(0,T.useState)([]),[L,O]=(0,T.useState)({}),[D,B]=(0,T.useState)([]),[z,H]=(0,T.useState)(""),[$,q]=(0,T.useState)(["all-tags"]),[U,W]=(0,T.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[V,G]=(0,T.useState)(null),[K,J]=(0,T.useState)(0),et=new Date(l.getFullYear(),l.getMonth(),1),er=new Date(l.getFullYear(),l.getMonth()+1,0),ea=ed(et),es=ed(er);function en(e){return new Intl.NumberFormat("en-US",{maximumFractionDigits:0,notation:"compact",compactDisplay:"short"}).format(e)}console.log("keys in usage",s),console.log("premium user in usage",n);let el=async()=>{if(e)try{let t=await (0,Q.getProxyUISettings)(e);return console.log("usage tab: proxy_settings",t),t}catch(e){console.error("Error fetching proxy settings:",e)}};(0,T.useEffect)(()=>{eo(U.from,U.to)},[U,$]);let ei=async(t,r,a)=>{if(!t||!r||!e)return;console.log("uiSelectedKey",a);let s=await (0,Q.adminTopEndUsersCall)(e,a,t.toISOString(),r.toISOString());console.log("End user data updated successfully",s),h(s)},eo=async(t,r)=>{if(!t||!r||!e)return;let a=await el();a?.DISABLE_EXPENSIVE_DB_QUERIES||(y((await (0,Q.tagsSpendLogsCall)(e,t.toISOString(),r.toISOString(),0===$.length?void 0:$)).spend_per_tag),console.log("Tag spend data updated successfully"))};function ed(e){let t=e.getFullYear(),r=e.getMonth()+1,a=e.getDate();return`${t}-${r<10?"0"+r:r}-${a<10?"0"+a:a}`}console.log(`Start date is ${ea}`),console.log(`End date is ${es}`);let ec=async(e,t,r)=>{try{let r=await e();t(r)}catch(e){console.error(r,e)}},eu=(e,t,r,a)=>{let s=[],n=new Date(t),l=new Map(e.map(e=>{let t=(e=>{if(e.includes("-"))return e;{let[t,r]=e.split(" ");return new Date(new Date().getFullYear(),new Date(`${t} 01 2024`).getMonth(),parseInt(r)).toISOString().split("T")[0]}})(e.date);return[t,{...e,date:t}]}));for(;n<=r;){let e=n.toISOString().split("T")[0];if(l.has(e))s.push(l.get(e));else{let t={date:e,api_requests:0,total_tokens:0};a.forEach(e=>{t[e]||(t[e]=0)}),s.push(t)}n.setDate(n.getDate()+1)}return s},em=async()=>{if(e)try{let t=await (0,Q.adminSpendLogsCall)(e),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),1),s=new Date(r.getFullYear(),r.getMonth()+1,0),n=eu(t,a,s,[]),l=Number(n.reduce((e,t)=>e+(t.spend||0),0).toFixed(2));J(l),o(n)}catch(e){console.error("Error fetching overall spend:",e)}},ep=async()=>{e&&await ec(async()=>(await (0,Q.adminTopKeysCall)(e)).map(e=>({key:e.api_key.substring(0,10),api_key:e.api_key,key_alias:e.key_alias,spend:Number(e.total_spend.toFixed(2))})),c,"Error fetching top keys")},eh=async()=>{e&&await ec(async()=>(await (0,Q.adminTopModelsCall)(e)).map(e=>({key:e.model,spend:(0,rV.formatNumberWithCommas)(e.total_spend,2)})),m,"Error fetching top models")},ef=async()=>{e&&await ec(async()=>{let t=await (0,Q.teamSpendLogsCall)(e),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),1),s=new Date(r.getFullYear(),r.getMonth()+1,0);return x(eu(t.daily_spend,a,s,t.teams)),w(t.teams),t.total_spend_per_team.map(e=>({name:e.team_id||"",value:(0,rV.formatNumberWithCommas)(e.total_spend||0,2)}))},N,"Error fetching team spend")},ex=async()=>{if(e)try{let t=await (0,Q.adminGlobalActivity)(e,ea,es),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),1),s=new Date(r.getFullYear(),r.getMonth()+1,0),n=eu(t.daily_data||[],a,s,["api_requests","total_tokens"]);O({...t,daily_data:n})}catch(e){console.error("Error fetching global activity:",e)}},eg=async()=>{if(e)try{let t=await (0,Q.adminGlobalActivityPerModel)(e,ea,es),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),1),s=new Date(r.getFullYear(),r.getMonth()+1,0),n=t.map(e=>({...e,daily_data:eu(e.daily_data||[],a,s,["api_requests","total_tokens"])}));B(n)}catch(e){console.error("Error fetching global activity per model:",e)}};return((0,T.useEffect)(()=>{(async()=>{if(e&&t&&r&&a){let a=await el();!(a&&(G(a),a?.DISABLE_EXPENSIVE_DB_QUERIES))&&(console.log("fetching data - valiue of proxySettings",V),em(),ec(()=>e&&t?(0,Q.adminspendByProvider)(e,t,ea,es):Promise.reject("No access token or token"),C,"Error fetching provider spend"),ep(),eh(),ex(),eg(),Yv(r)&&(ef(),e&&ec(async()=>(await (0,Q.allTagNamesCall)(e)).tag_names,v,"Error fetching tag names"),e&&ec(()=>(0,Q.tagsSpendLogsCall)(e,U.from?.toISOString(),U.to?.toISOString(),void 0),e=>y(e.spend_per_tag),"Error fetching top tags"),e&&ec(()=>(0,Q.adminTopEndUsersCall)(e,null,void 0,void 0),h,"Error fetching top end users")))}})()},[e,t,r,a,ea,es]),V?.DISABLE_EXPENSIVE_DB_QUERIES)?(0,_.jsx)("div",{style:{width:"100%"},className:"p-8",children:(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Database Query Limit Reached"}),(0,_.jsxs)(Z.Text,{className:"mt-4",children:["SpendLogs in DB has ",V.NUM_SPEND_LOGS_ROWS," rows.",(0,_.jsx)("br",{}),"Please follow our guide to view usage when SpendLogs has more than 1M rows."]}),(0,_.jsx)(S.Button,{className:"mt-4",children:(0,_.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/spending_monitoring",target:"_blank",children:"View Usage Guide"})})]})}):(0,_.jsx)("div",{style:{width:"100%"},className:"p-8",children:(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)(rR.TabList,{className:"mt-2",children:[(0,_.jsx)(rY.Tab,{children:"All Up"}),Yv(r)?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(rY.Tab,{children:"Team Based Usage"}),(0,_.jsx)(rY.Tab,{children:"Customer Usage"}),(0,_.jsx)(rY.Tab,{children:"Tag Based Usage"})]}):(0,_.jsx)(_.Fragment,{children:(0,_.jsx)("div",{})})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)(rR.TabList,{variant:"solid",className:"mt-1",children:[(0,_.jsx)(rY.Tab,{children:"Cost"}),(0,_.jsx)(rY.Tab,{children:"Activity"})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(ee.Grid,{numItems:2,className:"gap-2 h-[100vh] w-full",children:[(0,_.jsxs)(yl.Col,{numColSpan:2,children:[(0,_.jsxs)(Z.Text,{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content mb-2 mt-2 text-lg",children:["Project Spend ",new Date().toLocaleString("default",{month:"long"})," 1 -"," ",new Date(new Date().getFullYear(),new Date().getMonth()+1,0).getDate()]}),(0,_.jsx)(PB,{userSpend:K,selectedTeam:null,userMaxBudget:null})]}),(0,_.jsx)(yl.Col,{numColSpan:2,children:(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Monthly Spend"}),(0,_.jsx)(yn,{data:i,index:"date",categories:["spend"],colors:["cyan"],valueFormatter:e=>`$ ${(0,rV.formatNumberWithCommas)(e,2)}`,yAxisWidth:100,tickGap:5})]})}),(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsxs)(P.Card,{className:"h-full",children:[(0,_.jsx)(X.Title,{children:"Top Virtual Keys"}),(0,_.jsx)(A$,{topKeys:d,teams:null,topKeysLimit:5,setTopKeysLimit:()=>{}})]})}),(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsxs)(P.Card,{className:"h-full",children:[(0,_.jsx)(X.Title,{children:"Top Models"}),(0,_.jsx)(yn,{className:"mt-4 h-40",data:u,index:"key",categories:["spend"],colors:["cyan"],yAxisWidth:200,layout:"vertical",showXAxis:!1,showLegend:!1,valueFormatter:e=>`$${(0,rV.formatNumberWithCommas)(e,2)}`})]})}),(0,_.jsx)(yl.Col,{numColSpan:1}),(0,_.jsx)(yl.Col,{numColSpan:2,children:(0,_.jsxs)(P.Card,{className:"mb-2",children:[(0,_.jsx)(X.Title,{children:"Spend by Provider"}),(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)(ee.Grid,{numItems:2,children:[(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsx)(AR,{className:"mt-4 h-40",variant:"pie",data:M,index:"provider",category:"spend",colors:["cyan"],valueFormatter:e=>`$${(0,rV.formatNumberWithCommas)(e,2)}`})}),(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsxs)(A.Table,{children:[(0,_.jsx)(Y.TableHead,{children:(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(F.TableHeaderCell,{children:"Provider"}),(0,_.jsx)(F.TableHeaderCell,{children:"Spend"})]})}),(0,_.jsx)(E.TableBody,{children:M.map(e=>(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(I.TableCell,{children:e.provider}),(0,_.jsx)(I.TableCell,{children:1e-5>parseFloat(e.spend.toFixed(2))?"less than 0.00":(0,rV.formatNumberWithCommas)(e.spend,2)})]},e.provider))})]})})]})})]})})]})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(ee.Grid,{numItems:1,className:"gap-2 h-[75vh] w-full",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"All Up"}),(0,_.jsxs)(ee.Grid,{numItems:2,children:[(0,_.jsxs)(yl.Col,{children:[(0,_.jsxs)(yv.Subtitle,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",en(L.sum_api_requests)]}),(0,_.jsx)(Pp,{className:"h-40",data:L.daily_data,valueFormatter:en,index:"date",colors:["cyan"],categories:["api_requests"],onValueChange:e=>console.log(e)})]}),(0,_.jsxs)(yl.Col,{children:[(0,_.jsxs)(yv.Subtitle,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",en(L.sum_total_tokens)]}),(0,_.jsx)(yn,{className:"h-40",data:L.daily_data,valueFormatter:en,index:"date",colors:["cyan"],categories:["total_tokens"],onValueChange:e=>console.log(e)})]})]})]}),(0,_.jsx)(_.Fragment,{children:D.map((e,t)=>(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:e.model}),(0,_.jsxs)(ee.Grid,{numItems:2,children:[(0,_.jsxs)(yl.Col,{children:[(0,_.jsxs)(yv.Subtitle,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",en(e.sum_api_requests)]}),(0,_.jsx)(Pp,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["api_requests"],valueFormatter:en,onValueChange:e=>console.log(e)})]}),(0,_.jsxs)(yl.Col,{children:[(0,_.jsxs)(yv.Subtitle,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",en(e.sum_total_tokens)]}),(0,_.jsx)(yn,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["total_tokens"],valueFormatter:en,onValueChange:e=>console.log(e)})]})]})]},t))})]})})]})]})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(ee.Grid,{numItems:2,className:"gap-2 h-[75vh] w-full",children:[(0,_.jsxs)(yl.Col,{numColSpan:2,children:[(0,_.jsxs)(P.Card,{className:"mb-2",children:[(0,_.jsx)(X.Title,{children:"Total Spend Per Team"}),(0,_.jsx)(Yb,{data:k})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Daily Spend Per Team"}),(0,_.jsx)(yn,{className:"h-72",data:f,showLegend:!0,index:"date",categories:j,yAxisWidth:80,stack:!0})]})]}),(0,_.jsx)(yl.Col,{numColSpan:2})]})}),(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsxs)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:["Customers of your LLM API calls. Tracked when a `user` param is passed in your LLM calls"," ",(0,_.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/users",target:"_blank",children:"docs here"})]}),(0,_.jsxs)(ee.Grid,{numItems:2,children:[(0,_.jsx)(yl.Col,{children:(0,_.jsx)(je,{value:U,onValueChange:e=>{W(e),ei(e.from,e.to,null)}})}),(0,_.jsxs)(yl.Col,{children:[(0,_.jsx)(Z.Text,{children:"Select Key"}),(0,_.jsxs)(jc.Select,{defaultValue:"all-keys",children:[(0,_.jsx)(ju.SelectItem,{value:"all-keys",onClick:()=>{ei(U.from,U.to,null)},children:"All Keys"},"all-keys"),s?.map((e,t)=>e&&null!==e.key_alias&&e.key_alias.length>0?(0,_.jsx)(ju.SelectItem,{value:String(t),onClick:()=>{ei(U.from,U.to,e.token)},children:e.key_alias},t):null)]})]})]}),(0,_.jsx)(P.Card,{className:"mt-4",children:(0,_.jsxs)(A.Table,{className:"max-h-[70vh] min-h-[500px]",children:[(0,_.jsx)(Y.TableHead,{children:(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(F.TableHeaderCell,{children:"Customer"}),(0,_.jsx)(F.TableHeaderCell,{children:"Spend"}),(0,_.jsx)(F.TableHeaderCell,{children:"Total Events"})]})}),(0,_.jsx)(E.TableBody,{children:p?.map((e,t)=>(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(I.TableCell,{children:e.end_user}),(0,_.jsx)(I.TableCell,{children:(0,rV.formatNumberWithCommas)(e.total_spend,2)}),(0,_.jsx)(I.TableCell,{children:e.total_count})]},t))})]})})]}),(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsxs)(ee.Grid,{numItems:2,children:[(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsx)(je,{className:"mb-4",value:U,onValueChange:e=>{W(e),eo(e.from,e.to)}})}),(0,_.jsx)(yl.Col,{children:n?(0,_.jsx)("div",{children:(0,_.jsxs)(yy,{value:$,onValueChange:e=>q(e),children:[(0,_.jsx)(yb,{value:"all-tags",onClick:()=>q(["all-tags"]),children:"All Tags"},"all-tags"),b&&b.filter(e=>"all-tags"!==e).map((e,t)=>(0,_.jsx)(yb,{value:String(e),children:e},e))]})}):(0,_.jsx)("div",{children:(0,_.jsxs)(yy,{value:$,onValueChange:e=>q(e),children:[(0,_.jsx)(yb,{value:"all-tags",onClick:()=>q(["all-tags"]),children:"All Tags"},"all-tags"),b&&b.filter(e=>"all-tags"!==e).map((e,t)=>(0,_.jsxs)(ju.SelectItem,{value:String(e),disabled:!0,children:["✨ ",e," (Enterprise only Feature)"]},e))]})})})]}),(0,_.jsxs)(ee.Grid,{numItems:2,className:"gap-2 h-[75vh] w-full mb-4",children:[(0,_.jsx)(yl.Col,{numColSpan:2,children:(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(X.Title,{children:"Spend Per Tag"}),(0,_.jsxs)(Z.Text,{children:["Get Started by Tracking cost per tag"," ",(0,_.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/cost_tracking",target:"_blank",children:"here"})]}),(0,_.jsx)(yn,{className:"h-72",data:g,index:"name",categories:["spend"],colors:["cyan"]})]})}),(0,_.jsx)(yl.Col,{numColSpan:2})]})]})]})]})})};var Yw=e.i(693569),Yk=e.i(263147);let YS=async(e,t)=>{let r=(0,Q.getProxyBaseUrl)(),a=`${r}/v1/access_group/${encodeURIComponent(t)}`,s=await fetch(a,{method:"DELETE",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!s.ok){let e=await s.json(),t=(0,td.deriveErrorMessage)(e);throw(0,Q.handleError)(t),Error(t)}};var Ex=MV,YN=e.i(657150),YN=YN,Cl=Cl,YT=e.i(446891);let YM=async(e,t)=>{let r=(0,Q.getProxyBaseUrl)(),a=`${r}/v1/access_group/${encodeURIComponent(t)}`,s=await fetch(a,{method:"GET",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!s.ok){let e=await s.json(),t=(0,td.deriveErrorMessage)(e);throw(0,Q.handleError)(t),Error(t)}return s.json()};var YN=YN,E_=E_,YC=e.i(304911),YN=YN,Cf=Cf;let{TextArea:YL}=$.Input;function YO({form:e,isNameDisabled:t=!1}){let{data:r}=DR(),{data:a}=(0,LM.useMCPServers)(),s=r?.agents??[],n=[{key:"1",label:(0,_.jsxs)(U.Space,{align:"center",size:4,children:[(0,_.jsx)(Cf.default,{size:16}),"General Info"]}),children:(0,_.jsxs)("div",{style:{paddingTop:16},children:[(0,_.jsx)(H.Form.Item,{name:"name",label:"Group Name",rules:[{required:!0,message:"Please enter the access group name"}],children:(0,_.jsx)($.Input,{placeholder:"e.g. Engineering Team",disabled:t})}),(0,_.jsx)(H.Form.Item,{name:"description",label:"Description",children:(0,_.jsx)(YL,{rows:4,placeholder:"Describe the purpose of this access group..."})})]})},{key:"2",label:(0,_.jsxs)(U.Space,{align:"center",size:4,children:[(0,_.jsx)(Ey,{size:16}),"Models"]}),children:(0,_.jsx)("div",{style:{paddingTop:16},children:(0,_.jsx)(H.Form.Item,{name:"modelIds",label:"Allowed Models",children:(0,_.jsx)(El.ModelSelect,{context:"global",value:e.getFieldValue("modelIds")??[],onChange:t=>e.setFieldsValue({modelIds:t}),style:{width:"100%"}})})})},{key:"3",label:(0,_.jsxs)(U.Space,{align:"center",size:4,children:[(0,_.jsx)(Cp,{size:16}),"MCP Servers"]}),children:(0,_.jsx)("div",{style:{paddingTop:16},children:(0,_.jsx)(H.Form.Item,{name:"mcpServerIds",label:"Allowed MCP Servers",children:(0,_.jsx)(eE.Select,{mode:"multiple",placeholder:"Select MCP servers",style:{width:"100%"},optionFilterProp:"label",allowClear:!0,options:(a??[]).map(e=>({label:e.server_name??e.server_id,value:e.server_id}))})})})},{key:"4",label:(0,_.jsxs)(U.Space,{align:"center",size:4,children:[(0,_.jsx)(YN.default,{size:16}),"Agents"]}),children:(0,_.jsx)("div",{style:{paddingTop:16},children:(0,_.jsx)(H.Form.Item,{name:"agentIds",label:"Allowed Agents",children:(0,_.jsx)(eE.Select,{mode:"multiple",placeholder:"Select agents",style:{width:"100%"},optionFilterProp:"label",allowClear:!0,options:s.map(e=>({label:e.agent_name,value:e.agent_id}))})})})}];return(0,_.jsx)(H.Form,{form:e,layout:"vertical",name:"access_group_form",initialValues:{modelIds:[],mcpServerIds:[],agentIds:[]},children:(0,_.jsx)(W.Tabs,{defaultActiveKey:"1",items:n})})}let YD=async(e,t,r)=>{let a=(0,Q.getProxyBaseUrl)(),s=`${a}/v1/access_group/${encodeURIComponent(t)}`,n=await fetch(s,{method:"PUT",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!n.ok){let e=await n.json(),t=(0,td.deriveErrorMessage)(e);throw(0,Q.handleError)(t),Error(t)}return n.json()};function YP({visible:e,accessGroup:t,onCancel:r,onSuccess:a}){let[s]=H.Form.useForm(),n=(()=>{let{accessToken:e}=(0,k.default)(),t=(0,eh.useQueryClient)();return(0,ep.useMutation)({mutationFn:async({accessGroupId:t,params:r})=>{if(!e)throw Error("Access token is required");return YD(e,t,r)},onSuccess:(e,{accessGroupId:r})=>{t.invalidateQueries({queryKey:Yk.accessGroupKeys.all}),t.invalidateQueries({queryKey:Yk.accessGroupKeys.detail(r)})}})})();return(0,T.useEffect)(()=>{e&&t&&s.setFieldsValue({name:t.access_group_name,description:t.description??"",modelIds:t.access_model_names??[],mcpServerIds:t.access_mcp_server_ids??[],agentIds:t.access_agent_ids??[]})},[e,t,s]),(0,_.jsx)(q.Modal,{title:"Edit Access Group",open:e,onOk:()=>{s.validateFields().then(e=>{let s={access_group_name:e.name,description:e.description,access_model_names:e.modelIds,access_mcp_server_ids:e.mcpServerIds,access_agent_ids:e.agentIds};n.mutate({accessGroupId:t.access_group_id,params:s},{onSuccess:()=>{tU.default.success("Access group updated successfully"),a?.(),r()}})}).catch(e=>{console.log("Validate Failed:",e)})},onCancel:r,width:700,okText:"Save Changes",cancelText:"Cancel",confirmLoading:n.isPending,destroyOnHidden:!0,children:(0,_.jsx)(YO,{form:s})})}let{Title:YA,Text:YE}=V.Typography,{Content:YI}=Ef.Layout;function YY({accessGroupId:e,onBack:t}){let{data:r,isLoading:a}=(e=>{let{accessToken:t,userRole:r}=(0,k.default)(),a=(0,eh.useQueryClient)();return(0,ev.useQuery)({queryKey:Yk.accessGroupKeys.detail(e),queryFn:async()=>YM(t,e),enabled:!!(t&&e)&&ts.all_admin_roles.includes(r||""),initialData:()=>{if(!e)return;let t=a.getQueryData(Yk.accessGroupKeys.list({}));return t?.find(t=>t.access_group_id===e)}})})(e),{token:s}=Eg.theme.useToken(),[n,l]=(0,T.useState)(!1),[i,o]=(0,T.useState)(!1),[d,c]=(0,T.useState)(!1);if(a)return(0,_.jsx)(YI,{style:{padding:s.paddingLG,paddingInline:2*s.paddingLG},children:(0,_.jsx)(tg.Flex,{justify:"center",align:"center",style:{minHeight:300},children:(0,_.jsx)(rm.Spin,{size:"large"})})});if(!r)return(0,_.jsxs)(YI,{style:{padding:s.paddingLG,paddingInline:2*s.paddingLG},children:[(0,_.jsx)(z.Button,{icon:(0,_.jsx)(EQ,{size:16}),onClick:t,type:"text",style:{marginBottom:16}}),(0,_.jsx)(e0.Empty,{description:"Access group not found"})]});let u=r.access_model_names??[],m=r.access_mcp_server_ids??[],p=r.access_agent_ids??[],h=r.assigned_key_ids??[],f=r.assigned_team_ids??[],x=i?h:h.slice(0,5),g=d?f:f.slice(0,5),y=[{key:"models",label:(0,_.jsxs)(tg.Flex,{align:"center",gap:8,children:[(0,_.jsx)(Ey,{size:16}),"Models",(0,_.jsx)(eN.Tag,{style:{marginInlineEnd:0},children:u?.length})]}),children:u?.length>0?(0,_.jsx)(M1,{grid:{gutter:16,xs:1,sm:2,md:3,lg:4},dataSource:u,renderItem:e=>(0,_.jsx)(M1.Item,{children:(0,_.jsx)(eg.Card,{size:"small",children:(0,_.jsx)(YE,{code:!0,children:e})})})}):(0,_.jsx)(e0.Empty,{description:"No models assigned to this group"})},{key:"mcp",label:(0,_.jsxs)(tg.Flex,{align:"center",gap:8,children:[(0,_.jsx)(Cp,{size:16}),"MCP Servers",(0,_.jsx)(eN.Tag,{children:m?.length})]}),children:m?.length>0?(0,_.jsx)(M1,{grid:{gutter:16,xs:1,sm:2,md:3,lg:4},dataSource:m,renderItem:e=>(0,_.jsx)(M1.Item,{children:(0,_.jsx)(eg.Card,{size:"small",children:(0,_.jsx)(YE,{code:!0,children:e})})})}):(0,_.jsx)(e0.Empty,{description:"No MCP servers assigned to this group"})},{key:"agents",label:(0,_.jsxs)(tg.Flex,{align:"center",gap:8,children:[(0,_.jsx)(YN.default,{size:16}),"Agents",(0,_.jsx)(eN.Tag,{children:p?.length})]}),children:p?.length>0?(0,_.jsx)(M1,{grid:{gutter:16,xs:1,sm:2,md:3,lg:4},dataSource:p,renderItem:e=>(0,_.jsx)(M1.Item,{children:(0,_.jsx)(eg.Card,{size:"small",children:(0,_.jsx)(YE,{code:!0,children:e})})})}):(0,_.jsx)(e0.Empty,{description:"No agents assigned to this group"})}];return(0,_.jsxs)(YI,{style:{padding:s.paddingLG,paddingInline:2*s.paddingLG},children:[(0,_.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:24},children:[(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16},children:[(0,_.jsx)(z.Button,{icon:(0,_.jsx)(EQ,{size:16}),onClick:t,type:"text"}),(0,_.jsxs)("div",{children:[(0,_.jsx)(YA,{level:2,style:{margin:0},children:r.access_group_name}),(0,_.jsxs)(YE,{type:"secondary",children:["ID: ",(0,_.jsx)(YE,{copyable:!0,children:r.access_group_id})]})]})]}),(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(eM,{size:16}),onClick:()=>{l(!0)},children:"Edit Access Group"})]}),(0,_.jsx)(wl.Row,{style:{marginBottom:24},children:(0,_.jsx)(eg.Card,{children:(0,_.jsxs)(eS.Descriptions,{title:"Group Details",column:1,children:[(0,_.jsx)(eS.Descriptions.Item,{label:"Description",children:r.description||"—"}),(0,_.jsxs)(eS.Descriptions.Item,{label:"Created",children:[new Date(r.created_at).toLocaleString(),r.created_by&&(0,_.jsxs)(YE,{children:[" ","by"," ",(0,_.jsx)(YC.default,{userId:r.created_by})]})]}),(0,_.jsxs)(eS.Descriptions.Item,{label:"Last Updated",children:[new Date(r.updated_at).toLocaleString(),r.updated_by&&(0,_.jsxs)(YE,{children:[" ","by"," ",(0,_.jsx)(YC.default,{userId:r.updated_by})]})]})]})})}),(0,_.jsxs)(wl.Row,{gutter:[16,16],style:{marginBottom:24},children:[(0,_.jsx)(wi.Col,{xs:24,lg:12,children:(0,_.jsx)(eg.Card,{title:(0,_.jsxs)(tg.Flex,{align:"center",gap:8,children:[(0,_.jsx)(Cm,{size:16}),"Attached Keys",(0,_.jsx)(eN.Tag,{children:h?.length})]}),extra:h?.length>5?(0,_.jsx)(z.Button,{type:"link",onClick:()=>o(!i),children:i?"Show Less":`View All (${h?.length})`}):null,children:h?.length>0?(0,_.jsx)(tg.Flex,{wrap:"wrap",gap:8,children:x.map(e=>(0,_.jsx)(eN.Tag,{children:(0,_.jsx)(YE,{code:!0,style:{fontSize:12},children:e.length>20?`${e.slice(0,10)}...${e.slice(-6)}`:e})},e))}):(0,_.jsx)(e0.Empty,{description:"No keys attached",image:e0.Empty.PRESENTED_IMAGE_SIMPLE})})}),(0,_.jsx)(wi.Col,{xs:24,lg:12,children:(0,_.jsx)(eg.Card,{title:(0,_.jsxs)(tg.Flex,{align:"center",gap:8,children:[(0,_.jsx)(E_.default,{size:16}),"Attached Teams",(0,_.jsx)(eN.Tag,{children:f?.length})]}),extra:f?.length>5?(0,_.jsx)(z.Button,{type:"link",onClick:()=>c(!d),children:d?"Show Less":`View All (${f?.length})`}):null,children:f?.length>0?(0,_.jsx)(tg.Flex,{wrap:"wrap",gap:8,children:g.map(e=>(0,_.jsx)(eN.Tag,{children:(0,_.jsx)(YE,{code:!0,style:{fontSize:12},children:e})},e))}):(0,_.jsx)(e0.Empty,{description:"No teams attached",image:e0.Empty.PRESENTED_IMAGE_SIMPLE})})})]}),(0,_.jsx)(eg.Card,{children:(0,_.jsx)(W.Tabs,{defaultActiveKey:"models",items:y})}),(0,_.jsx)(YP,{visible:n,accessGroup:r,onCancel:()=>l(!1)})]})}let YF=async(e,t)=>{let r=(0,Q.getProxyBaseUrl)(),a=`${r}/v1/access_group`,s=await fetch(a,{method:"POST",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!s.ok){let e=await s.json(),t=(0,td.deriveErrorMessage)(e);throw(0,Q.handleError)(t),Error(t)}return s.json()};function YR({visible:e,onCancel:t,onSuccess:r}){let[a]=H.Form.useForm(),s=(()=>{let{accessToken:e}=(0,k.default)(),t=(0,eh.useQueryClient)();return(0,ep.useMutation)({mutationFn:async t=>{if(!e)throw Error("Access token is required");return YF(e,t)},onSuccess:()=>{t.invalidateQueries({queryKey:Yk.accessGroupKeys.all})}})})();return(0,_.jsx)(q.Modal,{title:"Create Access Group",open:e,onOk:()=>{a.validateFields().then(e=>{let n={access_group_name:e.name,description:e.description,access_model_names:e.modelIds,access_mcp_server_ids:e.mcpServerIds,access_agent_ids:e.agentIds};s.mutate(n,{onSuccess:()=>{tU.default.success("Access group created successfully"),a.resetFields(),r?.(),t()}})}).catch(e=>{console.log("Validate Failed:",e)})},onCancel:t,width:700,okText:"Create Group",cancelText:"Cancel",confirmLoading:s.isPending,destroyOnClose:!0,children:(0,_.jsx)(YO,{form:a})})}let{Title:YB,Text:Yz}=V.Typography,{Content:YH}=Ef.Layout;function Y$(e){return{id:e.access_group_id,name:e.access_group_name,description:e.description??"",modelIds:e.access_model_names,mcpServerIds:e.access_mcp_server_ids,agentIds:e.access_agent_ids,keyIds:e.assigned_key_ids,teamIds:e.assigned_team_ids,createdAt:e.created_at,createdBy:e.created_by??"",updatedAt:e.updated_at,updatedBy:e.updated_by??""}}function Yq(){let{token:e}=Eg.theme.useToken(),{userRole:t}=(0,k.default)(),r=(0,ts.isProxyAdminRole)(t??""),{data:a,isLoading:s}=(0,Yk.useAccessGroups)(),n=(0,T.useMemo)(()=>(a??[]).map(Y$),[a]),[l,i]=(0,T.useState)(null),[o,d]=(0,T.useState)(!1),[c,u]=(0,T.useState)(""),[m,p]=(0,T.useState)(1),[h,f]=(0,T.useState)([]),[x,g]=(0,T.useState)(null),y=(()=>{let{accessToken:e}=(0,k.default)(),t=(0,eh.useQueryClient)();return(0,ep.useMutation)({mutationFn:async t=>{if(!e)throw Error("Access token is required");return YS(e,t)},onSuccess:()=>{t.invalidateQueries({queryKey:Yk.accessGroupKeys.all})}})})();(0,T.useEffect)(()=>{p(1)},[c]);let b=(0,T.useMemo)(()=>n.filter(e=>e.name.toLowerCase().includes(c.toLowerCase())||e.id.toLowerCase().includes(c.toLowerCase())||e.description.toLowerCase().includes(c.toLowerCase())),[n,c]),v=(0,T.useMemo)(()=>[{id:"id",accessorKey:"id",header:()=>(0,_.jsx)("span",{children:"ID"}),enableSorting:!1,size:170,cell:({row:e})=>{let t=e.original;return(0,_.jsx)(tB.Tooltip,{title:t.id,children:(0,_.jsx)(Yz,{ellipsis:!0,className:"text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs cursor-pointer",style:{fontSize:14,padding:"1px 8px"},onClick:()=>i(t.id),children:t.id})})}},{id:"name",accessorKey:"name",header:()=>(0,_.jsx)("span",{children:"Name"}),enableSorting:!0,cell:({getValue:e})=>e()},{id:"resources",header:()=>(0,_.jsx)("span",{children:"Resources"}),enableSorting:!1,cell:({row:e})=>{let t=e.original,r=t.modelIds??[],a=t.mcpServerIds??[],s=t.agentIds??[];return(0,_.jsxs)(tg.Flex,{gap:12,align:"center",children:[(0,_.jsx)(tB.Tooltip,{title:`${r?.length} Models`,children:(0,_.jsx)(eN.Tag,{color:"blue",style:{fontSize:14,padding:"2px 8px",margin:0},children:(0,_.jsxs)(tg.Flex,{align:"center",gap:6,children:[(0,_.jsx)(Ey,{size:14}),r?.length]})})}),(0,_.jsx)(tB.Tooltip,{title:`${a?.length} MCP Servers`,children:(0,_.jsx)(eN.Tag,{color:"cyan",style:{fontSize:14,padding:"2px 8px",margin:0},children:(0,_.jsxs)(tg.Flex,{align:"center",gap:6,children:[(0,_.jsx)(Cp,{size:14}),a?.length]})})}),(0,_.jsx)(tB.Tooltip,{title:`${s?.length} Agents`,children:(0,_.jsx)(eN.Tag,{color:"purple",style:{fontSize:14,padding:"2px 8px",margin:0},children:(0,_.jsxs)(tg.Flex,{align:"center",gap:6,children:[(0,_.jsx)(YN.default,{size:14}),s?.length]})})})]})}},{id:"createdAt",accessorKey:"createdAt",header:()=>(0,_.jsx)("span",{children:"Created"}),enableSorting:!0,sortingFn:"datetime",cell:({getValue:e})=>new Date(e()).toLocaleDateString(),meta:{responsive:["lg"]}},{id:"updatedAt",accessorKey:"updatedAt",header:()=>(0,_.jsx)("span",{children:"Updated"}),enableSorting:!1,cell:({getValue:e})=>new Date(e()).toLocaleDateString(),meta:{responsive:["xl"]}},...r?[{id:"actions",header:()=>(0,_.jsx)("span",{children:"Actions"}),enableSorting:!1,cell:({row:e})=>(0,_.jsx)(U.Space,{children:(0,_.jsx)(rG.default,{variant:"Delete",tooltipText:"Delete access group",onClick:()=>g(e.original)})})}]:[]],[r]),j=(0,jD.useReactTable)({data:b,columns:v,state:{sorting:h},onSortingChange:f,getCoreRowModel:(0,jP.getCoreRowModel)(),getSortedRowModel:(0,jP.getSortedRowModel)(),getRowId:e=>e.id}),w=j.getRowModel().rows,S=w.slice((m-1)*10,10*m),N=(0,T.useMemo)(()=>new Map(S.map(e=>[e.original.id,e])),[S]),M=(j.getHeaderGroups()[0]?.headers??[]).map(e=>{let t=e.column.getCanSort(),r=e.column.getIsSorted(),a=e.column.columnDef.meta,s={title:(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.isPlaceholder?null:(0,jD.flexRender)(e.column.columnDef.header,e.getContext()),t&&(0,_.jsx)(YT.TableHeaderSortDropdown,{sortState:!1!==r&&r,onSortChange:t=>{f(!1===t?[]:[{id:e.column.id,desc:"desc"===t}])},columnId:e.column.id})]}),key:e.id,width:e.column.columnDef.size,render:(t,r)=>{let a=N.get(r.id);if(!a)return null;let s=a.getVisibleCells().find(t=>t.column.id===e.id);return s?(0,jD.flexRender)(s.column.columnDef.cell,s.getContext()):null}};return a?.responsive&&(s.responsive=a.responsive),s}),C=S.map(e=>e.original);return l?(0,_.jsx)(YY,{accessGroupId:l,onBack:()=>i(null)}):(0,_.jsxs)(YH,{style:{padding:e.paddingLG,paddingInline:2*e.paddingLG},children:[(0,_.jsxs)(tg.Flex,{justify:"space-between",align:"center",style:{marginBottom:16},children:[(0,_.jsxs)(U.Space,{direction:"vertical",size:0,children:[(0,_.jsx)(YB,{level:2,style:{margin:0},children:"Access Groups"}),(0,_.jsx)(Yz,{type:"secondary",children:"Manage resource permissions for your organization"})]}),r&&(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(tZ.PlusOutlined,{}),onClick:()=>d(!0),children:"Create Access Group"})]}),(0,_.jsxs)(eg.Card,{styles:{body:{padding:0}},children:[(0,_.jsxs)(tg.Flex,{justify:"space-between",align:"center",style:{padding:"12px 16px"},children:[(0,_.jsx)($.Input,{prefix:(0,_.jsx)(Cl.default,{size:16}),placeholder:"Search groups by name, ID, or description...",style:{maxWidth:400},value:c,onChange:e=>u(e.target.value),allowClear:!0}),(0,_.jsx)(Ex.default,{current:m,total:w?.length,pageSize:10,onChange:e=>p(e),size:"small",showTotal:e=>`${e} groups`,showSizeChanger:!1})]}),(0,_.jsx)(eK.Table,{columns:M,dataSource:C,rowKey:"id",loading:s,pagination:!1})]}),(0,_.jsx)(YR,{visible:o,onCancel:()=>d(!1)}),(0,_.jsx)(eH.default,{isOpen:!!x,title:"Delete Access Group",message:"Are you sure you want to delete this access group? This action cannot be undone.",resourceInformationTitle:"Access Group Information",resourceInformation:[{label:"ID",value:x?.id,code:!0},{label:"Name",value:x?.name},{label:"Description",value:x?.description||"—"}],onCancel:()=>g(null),onOk:()=>{x&&y.mutate(x.id,{onSuccess:()=>{g(null)}})},confirmLoading:y.isPending})]})}var YU=e.i(510674),Ex=MV,Cl=Cl;let YW={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M484 443.1V528h-84.5c-4.1 0-7.5 3.1-7.5 7v42c0 3.8 3.4 7 7.5 7H484v84.9c0 3.9 3.2 7.1 7 7.1h42c3.9 0 7-3.2 7-7.1V584h84.5c4.1 0 7.5-3.2 7.5-7v-42c0-3.9-3.4-7-7.5-7H540v-84.9c0-3.9-3.1-7.1-7-7.1h-42c-3.8 0-7 3.2-7 7.1zm396-144.7H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder-add",theme:"outlined"};var YV=T.forwardRef(function(e,t){return T.createElement(rf.default,(0,rp.default)({},e,{ref:t,icon:YW}))});let YG=async(e,t)=>{let r=(0,Q.getProxyBaseUrl)(),a=`${r}/project/new`,s=await fetch(a,{method:"POST",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!s.ok){let e=await s.json(),t=(0,td.deriveErrorMessage)(e);throw(0,Q.handleError)(t),Error(t)}return s.json()};function YK({form:e}){let{accessToken:t,userId:r,userRole:a}=(0,k.default)(),{data:s}=(0,jY.useTeams)(),[n,l]=(0,T.useState)(null),[i,o]=(0,T.useState)([]),[d,c]=(0,T.useState)([]);(0,T.useEffect)(()=>{(async()=>{if(t)try{let e=(await (0,Q.getGuardrailsList)(t)).guardrails.map(e=>e.guardrail_name);c(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[t]);let u=H.Form.useWatch("team_id",e);return(0,T.useEffect)(()=>{if(u&&s){let e=s.find(e=>e.team_id===u)??null;e&&e.team_id!==n?.team_id&&l(e)}},[u,s,n?.team_id]),(0,T.useEffect)(()=>{r&&a&&t&&n?(0,EP.fetchTeamModels)(r,a,t,n.team_id).then(e=>{o(Array.from(new Set([...n.models??[],...e])))}):o([])},[n,t,r,a]),(0,_.jsxs)(H.Form,{form:e,layout:"vertical",name:"project_form",initialValues:{isBlocked:!1},style:{marginTop:24},children:[(0,_.jsx)(V.Typography.Text,{strong:!0,style:{fontSize:13,color:"#374151",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Basic Information"}),(0,_.jsx)(eG.Divider,{style:{marginTop:8,marginBottom:16}}),(0,_.jsxs)(wl.Row,{gutter:24,children:[(0,_.jsx)(wi.Col,{span:12,children:(0,_.jsx)(H.Form.Item,{name:"project_alias",label:"Project Name",rules:[{required:!0,message:"Please enter a project name"}],children:(0,_.jsx)($.Input,{placeholder:"e.g. Customer Support Bot"})})}),(0,_.jsx)(wi.Col,{span:12,children:(0,_.jsx)(H.Form.Item,{name:"team_id",label:"Team",rules:[{required:!0,message:"Please select a team"}],children:(0,_.jsx)(eE.Select,{showSearch:!0,placeholder:"Search or select a team",onChange:t=>{l(s?.find(e=>e.team_id===t)??null),e.setFieldValue("models",[])},allowClear:!0,optionLabelProp:"label",filterOption:(e,t)=>{let r=s?.find(e=>e.team_id===t?.value);if(!r)return!1;let a=e.toLowerCase().trim();return(r.team_alias||"").toLowerCase().includes(a)||r.team_id.toLowerCase().includes(a)},children:s?.map(e=>(0,_.jsxs)(eE.Select.Option,{value:e.team_id,label:e.team_alias||e.team_id,children:[(0,_.jsx)("span",{style:{fontWeight:500},children:e.team_alias})," ",(0,_.jsxs)("span",{style:{color:"#9ca3af"},children:["(",e.team_id,")"]})]},e.team_id))})})})]}),(0,_.jsx)(wl.Row,{children:(0,_.jsx)(wi.Col,{span:24,children:(0,_.jsx)(H.Form.Item,{name:"description",label:"Description",children:(0,_.jsx)($.Input.TextArea,{placeholder:"Describe the purpose of this project",rows:3})})})}),(0,_.jsx)(wl.Row,{children:(0,_.jsx)(wi.Col,{span:24,children:(0,_.jsx)(H.Form.Item,{name:"models",label:"Allowed Models (scoped to selected team's models)",help:n?void 0:"Select a team first to see available models",children:(0,_.jsxs)(eE.Select,{mode:"multiple",placeholder:n?"Select models":"Select a team first",disabled:!n,allowClear:!0,maxTagCount:"responsive",onChange:t=>{t.includes("all-team-models")&&e.setFieldsValue({models:["all-team-models"]})},children:[(0,_.jsx)(eE.Select.Option,{value:"all-team-models",children:"All Team Models"},"all-team-models"),i.map(e=>(0,_.jsx)(eE.Select.Option,{value:e,children:(0,tQ.getModelDisplayName)(e)},e))]})})})}),(0,_.jsx)(wl.Row,{gutter:24,children:(0,_.jsx)(wi.Col,{span:12,children:(0,_.jsx)(H.Form.Item,{name:"max_budget",label:"Max Budget (USD)",children:(0,_.jsx)(tq.InputNumber,{prefix:"$",style:{width:"100%"},placeholder:"0.00",min:0,precision:2})})})}),(0,_.jsx)(wl.Row,{children:(0,_.jsx)(wi.Col,{span:24,children:(0,_.jsx)(tl.Collapse,{ghost:!0,style:{background:"#f9fafb",borderRadius:8,border:"1px solid #e5e7eb"},items:[{key:"1",label:(0,_.jsx)(V.Typography.Text,{strong:!0,style:{color:"#374151"},children:"Advanced Settings"}),children:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(tg.Flex,{align:"center",gap:12,children:[(0,_.jsx)(V.Typography.Text,{strong:!0,children:"Block Project"}),(0,_.jsx)(H.Form.Item,{name:"isBlocked",valuePropName:"checked",noStyle:!0,children:(0,_.jsx)(e_.Switch,{})})]}),(0,_.jsx)(H.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.isBlocked!==t.isBlocked,children:({getFieldValue:e})=>e("isBlocked")?(0,_.jsx)(B.Alert,{banner:!0,type:"warning",showIcon:!0,message:"All API requests using keys under this project will be rejected.",style:{marginTop:12}}):null}),(0,_.jsx)(eG.Divider,{}),(0,_.jsx)(H.Form.Item,{label:"Guardrails",name:"guardrails",help:"Select existing guardrails or enter new ones",children:(0,_.jsx)(eE.Select,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:d.map(e=>({value:e,label:e}))})}),(0,_.jsx)(eG.Divider,{}),(0,_.jsx)(V.Typography.Text,{strong:!0,style:{display:"block",marginBottom:12},children:"Model-Specific Limits"}),(0,_.jsx)(H.Form.List,{name:"modelLimits",children:(t,{add:r,remove:a})=>(0,_.jsxs)(_.Fragment,{children:[t.map(({key:t,name:r,...s})=>(0,_.jsxs)(U.Space,{style:{display:"flex",marginBottom:8},align:"baseline",children:[(0,_.jsx)(H.Form.Item,{...s,name:[r,"model"],rules:[{required:!0,message:"Missing model"},{validator:(t,r)=>r&&(e.getFieldValue("modelLimits")??[]).filter(e=>e?.model===r).length>1?Promise.reject(Error("Duplicate model")):Promise.resolve()}],children:(0,_.jsx)($.Input,{placeholder:"Model name (e.g. gpt-4)"})}),(0,_.jsx)(H.Form.Item,{...s,name:[r,"tpm"],children:(0,_.jsx)(tq.InputNumber,{placeholder:"TPM Limit",min:0})}),(0,_.jsx)(H.Form.Item,{...s,name:[r,"rpm"],children:(0,_.jsx)(tq.InputNumber,{placeholder:"RPM Limit",min:0})}),(0,_.jsx)(t0.MinusCircleOutlined,{onClick:()=>a(r),style:{color:"#ef4444"}})]},t)),(0,_.jsx)(H.Form.Item,{children:(0,_.jsx)(z.Button,{type:"dashed",onClick:()=>r(),block:!0,icon:(0,_.jsx)(tZ.PlusOutlined,{}),children:"Add Model Limit"})})]})}),(0,_.jsx)(eG.Divider,{}),(0,_.jsx)(V.Typography.Text,{strong:!0,style:{display:"block",marginBottom:12},children:"Metadata"}),(0,_.jsx)(H.Form.List,{name:"metadata",children:(t,{add:r,remove:a})=>(0,_.jsxs)(_.Fragment,{children:[t.map(({key:t,name:r,...s})=>(0,_.jsxs)(U.Space,{style:{display:"flex",marginBottom:8},align:"baseline",children:[(0,_.jsx)(H.Form.Item,{...s,name:[r,"key"],rules:[{required:!0,message:"Missing key"},{validator:(t,r)=>r&&(e.getFieldValue("metadata")??[]).filter(e=>e?.key===r).length>1?Promise.reject(Error("Duplicate key")):Promise.resolve()}],children:(0,_.jsx)($.Input,{placeholder:"Key"})}),(0,_.jsx)(H.Form.Item,{...s,name:[r,"value"],rules:[{required:!0,message:"Missing value"}],children:(0,_.jsx)($.Input,{placeholder:"Value"})}),(0,_.jsx)(t0.MinusCircleOutlined,{onClick:()=>a(r),style:{color:"#ef4444"}})]},t)),(0,_.jsx)(H.Form.Item,{children:(0,_.jsx)(z.Button,{type:"dashed",onClick:()=>r(),block:!0,icon:(0,_.jsx)(tZ.PlusOutlined,{}),children:"Add Key-Value Pair"})})]})})]})}]})})})]})}function YJ(e){let t={},r={};for(let a of e.modelLimits??[])a.model&&(null!=a.rpm&&(t[a.model]=a.rpm),null!=a.tpm&&(r[a.model]=a.tpm));let a={};for(let t of e.metadata??[])t.key&&(a[t.key]=t.value);return{project_alias:e.project_alias,description:e.description,models:e.models??[],max_budget:e.max_budget,blocked:e.isBlocked??!1,...e.guardrails&&e.guardrails.length>0&&{guardrails:e.guardrails},...Object.keys(t).length>0&&{model_rpm_limit:t},...Object.keys(r).length>0&&{model_tpm_limit:r},...Object.keys(a).length>0&&{metadata:a}}}function YQ({isOpen:e,onClose:t}){let[r]=H.Form.useForm(),a=(()=>{let{accessToken:e}=(0,k.default)(),t=(0,eh.useQueryClient)();return(0,ep.useMutation)({mutationFn:async t=>{if(!e)throw Error("Access token is required");return YG(e,t)},onSuccess:()=>{t.invalidateQueries({queryKey:YU.projectKeys.all})}})})(),s=async()=>{try{let e=await r.validateFields(),s={...YJ(e),team_id:e.team_id};a.mutate(s,{onSuccess:()=>{tU.default.success("Project created successfully"),r.resetFields(),t()},onError:e=>{tU.default.error(e.message||"Failed to create project")}})}catch(e){console.error("Validation failed:",e)}},n=()=>{r.resetFields(),t()};return(0,_.jsx)(q.Modal,{title:(0,_.jsx)(V.Typography.Text,{strong:!0,style:{fontSize:18},children:"Create New Project"}),open:e,onCancel:n,width:720,destroyOnHidden:!0,footer:[(0,_.jsx)(z.Button,{onClick:n,children:"Cancel"},"cancel"),(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(YV,{}),loading:a.isPending,onClick:s,children:"Create Project"},"submit")],children:(0,_.jsx)(YK,{form:r})})}let YX=async(e,t)=>{let r=(0,Q.getProxyBaseUrl)(),a=`${r}/project/info?project_id=${encodeURIComponent(t)}`,s=await fetch(a,{method:"GET",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!s.ok){let e=await s.json(),t=(0,td.deriveErrorMessage)(e);throw(0,Q.handleError)(t),Error(t)}return s.json()};var PG=PG;let YZ=(0,eT.default)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);var E_=E_;let Y0=async(e,t,r)=>{let a=(0,Q.getProxyBaseUrl)(),s=`${a}/project/update`,n=await fetch(s,{method:"POST",headers:{[(0,Q.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({project_id:t,...r})});if(!n.ok){let e=await n.json(),t=(0,td.deriveErrorMessage)(e);throw(0,Q.handleError)(t),Error(t)}return n.json()};function Y1({isOpen:e,project:t,onClose:r,onSuccess:a}){let[s]=H.Form.useForm(),n=(()=>{let{accessToken:e}=(0,k.default)(),t=(0,eh.useQueryClient)();return(0,ep.useMutation)({mutationFn:async({projectId:t,params:r})=>{if(!e)throw Error("Access token is required");return Y0(e,t,r)},onSuccess:()=>{t.invalidateQueries({queryKey:YU.projectKeys.all})}})})();(0,T.useEffect)(()=>{if(e&&t){let e=t.metadata??{},r=e.model_rpm_limit??{},a=e.model_tpm_limit??{},n=Array.isArray(e.guardrails)?e.guardrails:[],l=[];for(let e of new Set([...Object.keys(r),...Object.keys(a)]))l.push({model:e,rpm:r[e],tpm:a[e]});let i=new Set(["model_rpm_limit","model_tpm_limit","guardrails"]),o=[];for(let[t,r]of Object.entries(e))i.has(t)||o.push({key:t,value:String(r)});s.setFieldsValue({project_alias:t.project_alias??"",team_id:t.team_id??"",description:t.description??"",models:t.models??[],max_budget:t.litellm_budget_table?.max_budget??void 0,isBlocked:t.blocked,guardrails:n.length>0?n:void 0,modelLimits:l.length>0?l:void 0,metadata:o.length>0?o:void 0})}},[e,t,s]);let l=async()=>{try{let e=await s.validateFields(),l={...YJ(e),team_id:e.team_id};n.mutate({projectId:t.project_id,params:l},{onSuccess:()=>{tU.default.success("Project updated successfully"),a?.(),r()},onError:e=>{tU.default.error(e.message||"Failed to update project")}})}catch(e){console.error("Validation failed:",e)}};return(0,_.jsx)(q.Modal,{title:(0,_.jsx)(V.Typography.Text,{strong:!0,style:{fontSize:18},children:"Edit Project"}),open:e,onCancel:r,width:720,destroyOnHidden:!0,footer:[(0,_.jsx)(z.Button,{onClick:r,children:"Cancel"},"cancel"),(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(MC.SaveOutlined,{}),loading:n.isPending,onClick:l,children:"Save Changes"},"submit")],children:(0,_.jsx)(YK,{form:s})})}let{Title:Y2,Text:Y4}=V.Typography,{Content:Y5}=Ef.Layout;function Y6({projectId:e,onBack:t}){let r,a,s,n,{data:l,isLoading:i}=(e=>{let{accessToken:t,userRole:r}=(0,k.default)(),a=(0,eh.useQueryClient)();return(0,ev.useQuery)({queryKey:YU.projectKeys.detail(e),queryFn:async()=>YX(t,e),enabled:!!(t&&e)&&ts.all_admin_roles.includes(r||""),initialData:()=>{if(!e)return;let t=a.getQueryData(YU.projectKeys.list({}));return t?.find(t=>t.project_id===e)}})})(e),{data:o}=(0,jY.useTeam)(l?.team_id??void 0),d=o?.team_info??o,{token:c}=Eg.theme.useToken(),[u,m]=(0,T.useState)(!1),p=l?.spend??0,h=l?.litellm_budget_table?.max_budget??null,f=null!=h&&h>0,x=f?Math.min(p/h*100,100):0,g=(0,T.useMemo)(()=>Object.entries(l?.model_spend??{}).map(([e,t])=>({model:e,spend:t})).sort((e,t)=>t.spend-e.spend),[l?.model_spend]);return i?(0,_.jsx)(Y5,{style:{padding:c.paddingLG,paddingInline:2*c.paddingLG},children:(0,_.jsx)(tg.Flex,{justify:"center",align:"center",style:{minHeight:300},children:(0,_.jsx)(rm.Spin,{indicator:(0,_.jsx)(wo.LoadingOutlined,{spin:!0}),size:"large"})})}):l?(0,_.jsxs)(Y5,{style:{padding:c.paddingLG,paddingInline:2*c.paddingLG},children:[(0,_.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:24},children:[(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16},children:[(0,_.jsx)(z.Button,{icon:(0,_.jsx)(EQ,{size:16}),onClick:t,type:"text"}),(0,_.jsxs)("div",{children:[(0,_.jsxs)(tg.Flex,{align:"center",gap:8,children:[(0,_.jsx)(Y2,{level:2,style:{margin:0},children:l.project_alias??l.project_id}),(0,_.jsx)(eN.Tag,{color:l.blocked?"red":"green",children:l.blocked?"Blocked":"Active"})]}),(0,_.jsxs)(Y4,{type:"secondary",children:["ID: ",(0,_.jsx)(Y4,{copyable:!0,children:l.project_id})]})]})]}),(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(eM,{size:16}),onClick:()=>m(!0),children:"Edit Project"})]}),(0,_.jsx)(wl.Row,{style:{marginBottom:24},children:(0,_.jsx)(eg.Card,{children:(0,_.jsxs)(eS.Descriptions,{title:"Project Details",column:1,children:[(0,_.jsx)(eS.Descriptions.Item,{label:"Description",children:l.description||"—"}),(0,_.jsxs)(eS.Descriptions.Item,{label:"Created",children:[new Date(l.created_at).toLocaleString(),l.created_by&&(0,_.jsxs)(Y4,{children:[" ","by"," ",(0,_.jsx)(YC.default,{userId:l.created_by})]})]}),(0,_.jsxs)(eS.Descriptions.Item,{label:"Last Updated",children:[new Date(l.updated_at).toLocaleString(),l.updated_by&&(0,_.jsxs)(Y4,{children:[" ","by"," ",(0,_.jsx)(YC.default,{userId:l.updated_by})]})]})]})})}),(0,_.jsxs)(wl.Row,{gutter:[16,16],style:{marginBottom:24},children:[(0,_.jsx)(wi.Col,{xs:24,lg:8,children:(0,_.jsx)(eg.Card,{title:(0,_.jsxs)(tg.Flex,{align:"center",gap:8,children:[(0,_.jsx)(YZ,{size:16}),"Budget"]}),style:{height:"100%"},children:(0,_.jsxs)(tg.Flex,{vertical:!0,gap:16,children:[(0,_.jsxs)("div",{children:[(0,_.jsxs)(Y4,{strong:!0,style:{fontSize:28,lineHeight:1},children:["$",p.toFixed(2)]}),(0,_.jsx)("br",{}),(0,_.jsx)(Y4,{type:"secondary",children:f?`of $${h.toFixed(2)} budget`:"No budget limit"})]}),f&&(0,_.jsxs)("div",{children:[(0,_.jsx)(PG.default,{percent:Math.round(10*x)/10,strokeColor:x>=90?"#f5222d":x>=70?"#faad14":"#52c41a",showInfo:!1}),(0,_.jsxs)(Y4,{type:"secondary",style:{fontSize:12},children:[(Math.round(10*x)/10).toFixed(1),"% utilized"]})]})]})})}),(0,_.jsx)(wi.Col,{xs:24,lg:16,children:(0,_.jsx)(eg.Card,{title:"Spend by Model",style:{height:"100%"},children:g.length>0?(0,_.jsx)(yn,{data:g,index:"model",categories:["spend"],colors:["cyan"],layout:"vertical",valueFormatter:e=>`$${e.toFixed(4)}`,yAxisWidth:140,showLegend:!1,style:{height:Math.max(40*g.length,120)}}):(0,_.jsx)(e0.Empty,{description:"No model spend recorded yet",image:e0.Empty.PRESENTED_IMAGE_SIMPLE})})})]}),(0,_.jsxs)(wl.Row,{gutter:[16,16],style:{marginBottom:24},children:[(0,_.jsx)(wi.Col,{xs:24,lg:12,children:(0,_.jsx)(eg.Card,{title:(0,_.jsxs)(tg.Flex,{align:"center",gap:8,children:[(0,_.jsx)(Cm,{size:16}),"Keys"]}),style:{height:"100%"},children:(0,_.jsx)(e0.Empty,{description:"No keys to display",image:e0.Empty.PRESENTED_IMAGE_SIMPLE})})}),(0,_.jsx)(wi.Col,{xs:24,lg:12,children:(0,_.jsx)(eg.Card,{title:(0,_.jsxs)(tg.Flex,{align:"center",gap:8,children:[(0,_.jsx)(E_.default,{size:16}),"Team"]}),style:{height:"100%"},children:d?(r=d.max_budget??null,a=d.spend??0,n=(s=null!=r&&r>0)?Math.min(a/r*100,100):0,(0,_.jsxs)(tg.Flex,{vertical:!0,gap:12,children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Y4,{strong:!0,style:{fontSize:16},children:d.team_alias||d.team_id}),(0,_.jsx)("br",{}),(0,_.jsxs)(Y4,{type:"secondary",style:{fontSize:12},children:["ID:"," ",(0,_.jsx)(Y4,{copyable:!0,style:{fontSize:12},children:d.team_id})]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Y4,{type:"secondary",style:{fontSize:12,display:"block",marginBottom:4},children:"Models"}),(d.models?.length??0)>0?(0,_.jsx)(tg.Flex,{wrap:"wrap",gap:4,style:{maxHeight:60,overflow:"hidden"},children:d.models?.map(e=>(0,_.jsx)(eN.Tag,{style:{margin:0},children:e},e))}):(0,_.jsx)(Y4,{type:"secondary",children:"All models"})]}),(0,_.jsxs)("div",{children:[(0,_.jsxs)(tg.Flex,{justify:"space-between",align:"center",style:{marginBottom:2},children:[(0,_.jsx)(Y4,{type:"secondary",style:{fontSize:12},children:"Spend"}),(0,_.jsxs)(Y4,{style:{fontSize:12},children:["$",a.toFixed(2),s?(0,_.jsxs)(Y4,{type:"secondary",style:{fontSize:12},children:[" ","/ $",r.toFixed(2)]}):(0,_.jsxs)(Y4,{type:"secondary",style:{fontSize:12},children:[" ","(Unlimited)"]})]})]}),s&&(0,_.jsx)(PG.default,{percent:Math.round(10*n)/10,strokeColor:n>=90?"#f5222d":n>=70?"#faad14":"#52c41a",size:"small",showInfo:!1})]}),(0,_.jsxs)(tg.Flex,{justify:"space-between",children:[(0,_.jsx)(Y4,{type:"secondary",style:{fontSize:12},children:"Members"}),(0,_.jsx)(Y4,{style:{fontSize:12},children:d.members_with_roles?.length??0})]})]})):l.team_id?(0,_.jsx)(tg.Flex,{justify:"center",align:"center",style:{padding:16},children:(0,_.jsx)(rm.Spin,{indicator:(0,_.jsx)(wo.LoadingOutlined,{spin:!0}),size:"small"})}):(0,_.jsx)(e0.Empty,{description:"No team assigned",image:e0.Empty.PRESENTED_IMAGE_SIMPLE})})})]}),(0,_.jsx)(Y1,{isOpen:u,project:l,onClose:()=>m(!1)})]}):(0,_.jsxs)(Y5,{style:{padding:c.paddingLG,paddingInline:2*c.paddingLG},children:[(0,_.jsx)(z.Button,{icon:(0,_.jsx)(EQ,{size:16}),onClick:t,type:"text",style:{marginBottom:16}}),(0,_.jsx)(e0.Empty,{description:"Project not found"})]})}let{Title:Y3,Text:Y8}=V.Typography,{Content:Y7}=Ef.Layout;function Y9(){let{token:e}=Eg.theme.useToken(),{data:t,isLoading:r}=(0,YU.useProjects)(),{data:a,isLoading:s}=(0,jY.useTeams)(),[n,l]=(0,T.useState)(null),[i,o]=(0,T.useState)(!1),[d,c]=(0,T.useState)(""),[u,m]=(0,T.useState)(1);(0,T.useEffect)(()=>{m(1)},[d]);let p=(0,T.useMemo)(()=>{let e=new Map;for(let t of a??[])e.set(t.team_id,t.team_alias??t.team_id);return e},[a]),h=(0,T.useMemo)(()=>{let e=t??[];if(!d)return e;let r=d.toLowerCase();return e.filter(e=>{let t=p.get(e.team_id??"")??"";return(e.project_alias??"").toLowerCase().includes(r)||e.project_id.toLowerCase().includes(r)||(e.description??"").toLowerCase().includes(r)||t.toLowerCase().includes(r)})},[t,d,p]),f=[{title:"ID",dataIndex:"project_id",key:"project_id",width:170,render:e=>(0,_.jsx)(tB.Tooltip,{title:e,children:(0,_.jsx)(Y8,{ellipsis:!0,className:"text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs cursor-pointer",style:{fontSize:14,padding:"1px 8px"},onClick:()=>l(e),children:e})})},{title:"Name",dataIndex:"project_alias",key:"project_alias",sorter:(e,t)=>(e.project_alias??"").localeCompare(t.project_alias??""),render:e=>e??"—"},{title:"Team",key:"team",sorter:(e,t)=>{let r=p.get(e.team_id??"")??"",a=p.get(t.team_id??"")??"";return r.localeCompare(a)},render:(e,t)=>{if(!t.team_id)return"—";let r=p.get(t.team_id);return r||(s?(0,_.jsx)(rm.Spin,{indicator:(0,_.jsx)(wo.LoadingOutlined,{spin:!0}),size:"small"}):t.team_id)}},{title:"Models",key:"models",render:(e,t)=>{let r=t.models??[];return(0,_.jsx)(tB.Tooltip,{title:r.length>0?r.join(", "):"No models",children:(0,_.jsx)(eN.Tag,{color:"blue",style:{fontSize:14,padding:"2px 8px",margin:0},children:(0,_.jsxs)(tg.Flex,{align:"center",gap:6,children:[(0,_.jsx)(Ey,{size:14}),r.length]})})})}},{title:"Status",dataIndex:"blocked",key:"status",render:e=>(0,_.jsx)(eN.Tag,{color:e?"red":"green",children:e?"Blocked":"Active"})},{title:"Created",dataIndex:"created_at",key:"created_at",sorter:(e,t)=>new Date(e.created_at).getTime()-new Date(t.created_at).getTime(),responsive:["lg"],render:e=>new Date(e).toLocaleDateString()},{title:"Updated",dataIndex:"updated_at",key:"updated_at",responsive:["xl"],render:e=>new Date(e).toLocaleDateString()}];return n?(0,_.jsx)(Y6,{projectId:n,onBack:()=>l(null)}):(0,_.jsxs)(Y7,{style:{padding:e.paddingLG,paddingInline:2*e.paddingLG},children:[(0,_.jsxs)(tg.Flex,{justify:"space-between",align:"center",style:{marginBottom:16},children:[(0,_.jsxs)(U.Space,{direction:"vertical",size:0,children:[(0,_.jsx)(Y3,{level:2,style:{margin:0},children:"Projects"}),(0,_.jsx)(Y8,{type:"secondary",children:"Manage projects within your teams"})]}),(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(tZ.PlusOutlined,{}),onClick:()=>o(!0),children:"Create Project"})]}),(0,_.jsxs)(eg.Card,{styles:{body:{padding:0}},children:[(0,_.jsxs)(tg.Flex,{justify:"space-between",align:"center",style:{padding:"12px 16px"},children:[(0,_.jsx)($.Input,{prefix:(0,_.jsx)(Cl.default,{size:16}),placeholder:"Search projects by name, ID, description, or team...",style:{maxWidth:400},value:d,onChange:e=>c(e.target.value),allowClear:!0}),(0,_.jsx)(Ex.default,{current:u,total:h.length,pageSize:10,onChange:e=>m(e),size:"small",showTotal:e=>`${e} projects`,showSizeChanger:!1})]}),(0,_.jsx)(eK.Table,{columns:f,dataSource:h.slice((u-1)*10,10*u),rowKey:"project_id",loading:r,pagination:!1})]}),(0,_.jsx)(YQ,{isOpen:i,onClose:()=>o(!1)})]})}let Fe=({data:e,onView:t,onEdit:r,onDelete:a})=>{let[s,n]=T.default.useState([{id:"created_at",desc:!0}]),l=[{header:"Vector Store ID",accessorKey:"vector_store_id",cell:({row:e})=>{let r=e.original;return(0,_.jsx)("button",{onClick:()=>t(r.vector_store_id),className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",children:r.vector_store_id.length>15?`${r.vector_store_id.slice(0,15)}...`:r.vector_store_id})}},{header:"Name",accessorKey:"vector_store_name",cell:({row:e})=>{let t=e.original;return(0,_.jsx)(tB.Tooltip,{title:t.vector_store_name,children:(0,_.jsx)("span",{className:"text-xs",children:t.vector_store_name||"-"})})}},{header:"Description",accessorKey:"vector_store_description",cell:({row:e})=>{let t=e.original;return(0,_.jsx)(tB.Tooltip,{title:t.vector_store_description,children:(0,_.jsx)("span",{className:"text-xs",children:t.vector_store_description||"-"})})}},{header:"Files",accessorKey:"vector_store_metadata",cell:({row:e})=>{let t=e.original,r=t.vector_store_metadata?.ingested_files||[];if(0===r.length)return(0,_.jsx)("span",{className:"text-xs text-gray-400",children:"-"});let a=r.map(e=>e.filename||e.file_url||"Unknown").join(", "),s=1===r.length?r[0].filename||r[0].file_url||"1 file":`${r.length} files`;return(0,_.jsx)(tB.Tooltip,{title:a,children:(0,_.jsx)("span",{className:"text-xs text-blue-600",children:s})})}},{header:"Provider",accessorKey:"custom_llm_provider",cell:({row:e})=>{let t=e.original,{displayName:r,logo:a}=(0,j$.getProviderLogoAndName)(t.custom_llm_provider);return(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[a&&(0,_.jsx)("img",{src:a,alt:r,className:"h-4 w-4"}),(0,_.jsx)("span",{className:"text-xs",children:r})]})}},{header:"Created At",accessorKey:"created_at",sortingFn:"datetime",cell:({row:e})=>{let t=e.original;return(0,_.jsx)("span",{className:"text-xs",children:new Date(t.created_at).toLocaleDateString()})}},{header:"Updated At",accessorKey:"updated_at",sortingFn:"datetime",cell:({row:e})=>{let t=e.original;return(0,_.jsx)("span",{className:"text-xs",children:new Date(t.updated_at).toLocaleDateString()})}},{id:"actions",header:"",cell:({row:e})=>{let t=e.original;return(0,_.jsxs)("div",{className:"flex space-x-2",children:[(0,_.jsx)(rG.default,{variant:"Edit",tooltipText:"Edit vector store",onClick:()=>r(t.vector_store_id)}),(0,_.jsx)(rG.default,{variant:"Delete",tooltipText:"Delete vector store",onClick:()=>a(t.vector_store_id)})]})}}],i=(0,jD.useReactTable)({data:e,columns:l,state:{sorting:s},onSortingChange:n,getCoreRowModel:(0,jP.getCoreRowModel)(),getSortedRowModel:(0,jP.getSortedRowModel)(),enableSorting:!0});return(0,_.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,_.jsx)("div",{className:"overflow-x-auto",children:(0,_.jsxs)(A.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,_.jsx)(Y.TableHead,{children:i.getHeaderGroups().map(e=>(0,_.jsx)(R.TableRow,{children:e.headers.map(e=>(0,_.jsx)(F.TableHeaderCell,{className:`py-1 h-8 ${"actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""}`,onClick:e.column.getToggleSortingHandler(),children:(0,_.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,_.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,jD.flexRender)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,_.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,_.jsx)(jC.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,_.jsx)(jM.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,_.jsx)(jL.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,_.jsx)(E.TableBody,{children:i.getRowModel().rows.length>0?i.getRowModel().rows.map(e=>(0,_.jsx)(R.TableRow,{className:"h-8",children:e.getVisibleCells().map(e=>(0,_.jsx)(I.TableCell,{className:`py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ${"actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""}`,children:(0,jD.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:l.length,className:"h-8 text-center",children:(0,_.jsx)("div",{className:"text-center text-gray-500",children:(0,_.jsx)("p",{children:"No vector stores found"})})})})})]})})})};var Ft=((c={}).Bedrock="Amazon Bedrock",c.S3Vectors="Amazon S3 Vectors",c.PgVector="PostgreSQL pgvector (LiteLLM Connector)",c.VertexRagEngine="Vertex AI RAG Engine",c.VertexAiSearch="Vertex AI Search",c.OpenAI="OpenAI",c.Azure="Azure OpenAI",c.Milvus="Milvus",c);let Fr={Bedrock:"bedrock",PgVector:"pg_vector",VertexRagEngine:"vertex_ai",VertexAiSearch:"vertex_ai/search_api",OpenAI:"openai",Azure:"azure",Milvus:"milvus",S3Vectors:"s3_vectors"},Fa="../ui/assets/logos/",Fs={"Amazon Bedrock":`${Fa}bedrock.svg`,"PostgreSQL pgvector (LiteLLM Connector)":`${Fa}postgresql.svg`,"Vertex AI RAG Engine":`${Fa}google.svg`,"Vertex AI Search":`${Fa}google.svg`,OpenAI:`${Fa}openai_small.svg`,"Azure OpenAI":`${Fa}microsoft_azure.svg`,Milvus:`${Fa}milvus.svg`,"Amazon S3 Vectors":`${Fa}s3_vector.png`},Fn={bedrock:[],pg_vector:[{name:"api_base",label:"API Base",tooltip:"Enter the base URL of your deployed litellm-pgvector server (e.g., http://your-server:8000)",placeholder:"http://your-deployed-server:8000",required:!0,type:"text"},{name:"api_key",label:"API Key",tooltip:"Enter the API key from your deployed litellm-pgvector server",placeholder:"your-deployed-api-key",required:!0,type:"password"}],vertex_rag_engine:[],"vertex_ai/search_api":[{name:"vertex_project",label:"Vertex Project",tooltip:"Google Cloud project ID that hosts the Vertex AI Search data store.",placeholder:"my-gcp-project-id",required:!0,type:"text"},{name:"vertex_location",label:"Vertex Location",tooltip:"Vertex AI Search data store location. Must be one of global, us, or eu.",required:!0,type:"select",options:[{value:"global",label:"global"},{value:"us",label:"us"},{value:"eu",label:"eu"}],initialValue:"global"},{name:"vertex_collection_id",label:"Collection ID (optional)",tooltip:"Discovery Engine collection ID. Leave blank to use the default collection.",placeholder:"e.g. my-custom-collection",required:!1,type:"text"},{name:"vertex_engine_id",label:"Engine ID (optional)",tooltip:"Search app (engine) ID. Required for website, healthcare, and connector-based data stores (Workspace, Slack, Jira, etc.) because these sources route search through an engine. Leave blank to query the data store directly.",placeholder:"e.g. my-search-app_1234567890",required:!1,type:"text"}],openai:[{name:"api_key",label:"API Key",tooltip:"Enter your OpenAI API key",placeholder:"sk-...",required:!0,type:"password"}],azure:[{name:"api_key",label:"API Key",tooltip:"Enter your Azure OpenAI API key",placeholder:"your-azure-api-key",required:!0,type:"password"},{name:"api_base",label:"API Base",tooltip:"Enter your Azure OpenAI endpoint (e.g., https://your-resource.openai.azure.com/)",placeholder:"https://your-resource.openai.azure.com/",required:!0,type:"text"}],milvus:[{name:"api_key",label:"API Key",tooltip:"To obtain a token, you should use a colon (:) to concatenate the username and password that you use to access your Milvus instance (e.g., username:password)",placeholder:"username:password or api key",required:!0,type:"password"},{name:"api_base",label:"API Base",tooltip:"Enter your Milvus endpoint (e.g., https://your-milvus-endpoint.com/)",placeholder:"https://your-milvus-endpoint.com/",required:!0,type:"text"},{name:"embedding_model",label:"Embedding Model",tooltip:"Select the embedding model to use",placeholder:"text-embedding-3-small",required:!0,type:"select"}],s3_vectors:[{name:"vector_bucket_name",label:"Vector Bucket Name",tooltip:"S3 bucket name for vector storage (will be auto-created if it doesn't exist)",placeholder:"my-vector-bucket",required:!0,type:"text"},{name:"index_name",label:"Index Name",tooltip:"Name for the vector index (optional, will be auto-generated if not provided)",placeholder:"my-vector-index",required:!1,type:"text"},{name:"aws_region_name",label:"AWS Region",tooltip:"AWS region where the S3 bucket is located (e.g., us-west-2)",placeholder:"us-west-2",required:!0,type:"text"},{name:"embedding_model",label:"Embedding Model",tooltip:"Select the embedding model to use for vector generation",placeholder:"text-embedding-3-small",required:!0,type:"select"}]},Fl=e=>Fn[e]||[],Fi=({isVisible:e,onCancel:t,onSuccess:r,accessToken:a,credentials:s})=>{let[n]=H.Form.useForm(),[l,i]=(0,T.useState)("{}"),[o,d]=(0,T.useState)("bedrock"),[c,u]=(0,T.useState)([]),m=H.Form.useWatch("vertex_engine_id",n);(0,T.useEffect)(()=>{a&&(async()=>{try{let e=await (0,jh.fetchAvailableModels)(a);e.length>0&&u(e)}catch(e){console.error("Error fetching model info:",e)}})()},[a]);let p=async e=>{if(a)try{let t={};try{t=l.trim()?JSON.parse(l):{}}catch(e){J.default.fromBackend("Invalid JSON in metadata field");return}let s={vector_store_id:e.vector_store_id,custom_llm_provider:e.custom_llm_provider,vector_store_name:e.vector_store_name,vector_store_description:e.vector_store_description,vector_store_metadata:t,litellm_credential_name:e.litellm_credential_name};s.litellm_params=Fl(e.custom_llm_provider).reduce((t,r)=>("milvus"===e.custom_llm_provider&&"embedding_model"===r.name?t.litellm_embedding_model=e[r.name]:t[r.name]=e[r.name],t),{}),await (0,Q.vectorStoreCreateCall)(a,s),J.default.success("Vector store created successfully"),n.resetFields(),i("{}"),r()}catch(e){console.error("Error creating vector store:",e),J.default.fromBackend("Error creating vector store: "+e)}},h=()=>{n.resetFields(),i("{}"),d("bedrock"),t()};return(0,_.jsx)(q.Modal,{title:"Add New Vector Store",open:e,width:1e3,footer:null,onCancel:h,children:(0,_.jsxs)(H.Form,{form:n,onFinish:p,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Provider"," ",(0,_.jsx)(tB.Tooltip,{title:"Select the provider for this vector store",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"custom_llm_provider",rules:[{required:!0,message:"Please select a provider"}],initialValue:"bedrock",children:(0,_.jsx)(eE.Select,{onChange:e=>d(e),children:Object.entries(Ft).map(([e,t])=>(0,_.jsx)(eE.Select.Option,{value:Fr[e],children:(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)("img",{src:Fs[t],alt:`${e} logo`,className:"w-5 h-5",onError:e=>{let r=e.target,a=r.parentElement;if(a){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),a.replaceChild(e,r)}}}),(0,_.jsx)("span",{children:t})]})},e))})}),"pg_vector"===o&&(0,_.jsx)(B.Alert,{message:"PG Vector Setup Required",description:(0,_.jsxs)("div",{children:[(0,_.jsx)("p",{children:"LiteLLM provides a server to connect to PG Vector. To use this provider:"}),(0,_.jsxs)("ol",{style:{marginLeft:"16px",marginTop:"8px"},children:[(0,_.jsxs)("li",{children:["Deploy the litellm-pgvector server from:"," ",(0,_.jsx)("a",{href:"https://github.com/BerriAI/litellm-pgvector",target:"_blank",rel:"noopener noreferrer",children:"https://github.com/BerriAI/litellm-pgvector"})]}),(0,_.jsx)("li",{children:"Configure your PostgreSQL database with pgvector extension"}),(0,_.jsx)("li",{children:"Start the server and note the API base URL and API key"}),(0,_.jsx)("li",{children:"Enter those details in the fields below"})]})]}),type:"info",showIcon:!0,style:{marginBottom:"16px"}}),"vertex_rag_engine"===o&&(0,_.jsx)(B.Alert,{message:"Vertex AI RAG Engine Setup",description:(0,_.jsxs)("div",{children:[(0,_.jsx)("p",{children:"To use Vertex AI RAG Engine:"}),(0,_.jsxs)("ol",{style:{marginLeft:"16px",marginTop:"8px"},children:[(0,_.jsxs)("li",{children:["Set up your Vertex AI RAG Engine corpus following the guide:"," ",(0,_.jsx)("a",{href:"https://cloud.google.com/vertex-ai/generative-ai/docs/rag-engine/rag-overview",target:"_blank",rel:"noopener noreferrer",children:"Vertex AI RAG Engine Overview"})]}),(0,_.jsx)("li",{children:"Create a corpus in your Google Cloud project"}),(0,_.jsx)("li",{children:"Note the corpus ID from the Vertex AI console"}),(0,_.jsx)("li",{children:"Enter the corpus ID in the Vector Store ID field below"})]})]}),type:"info",showIcon:!0,style:{marginBottom:"16px"}}),"vertex_ai/search_api"===o&&(0,_.jsx)(B.Alert,{message:"Vertex AI Search Setup",description:(0,_.jsxs)("div",{children:[(0,_.jsx)("p",{children:"To use Vertex AI Search (Discovery Engine):"}),(0,_.jsxs)("ol",{style:{marginLeft:"16px",marginTop:"8px"},children:[(0,_.jsxs)("li",{children:["Enable the Discovery Engine API on your Google Cloud project and create a data store following the guide:"," ",(0,_.jsx)("a",{href:"https://cloud.google.com/generative-ai-app-builder/docs/create-data-store-es",target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"underline"},children:"Create a Vertex AI Search data store"})]}),(0,_.jsx)("li",{children:"Pick a supported location: global, us, or eu"}),(0,_.jsx)("li",{children:"For most data store types (Cloud Storage, BigQuery, Media): copy the data store ID and enter it in the Vector Store ID field below."}),(0,_.jsxs)("li",{children:["For website, healthcare, and connector-based sources (Drive, Gmail, Slack, Jira, etc.): create a search app on top of the data store, then copy the ",(0,_.jsx)("strong",{children:"Engine ID"})," and enter it in the Engine ID field. The Vector Store ID is still required as the LiteLLM-side name for this record, but it isn't used in the GCP URL when Engine ID is set."]})]})]}),type:"info",showIcon:!0,style:{marginBottom:"16px"}}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Vector Store ID"," ",(0,_.jsx)(tB.Tooltip,{title:"Enter the vector store ID from your api provider",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"vector_store_id",rules:[{required:!0,message:"Please input the vector store ID from your api provider"}],children:(0,_.jsx)(et.TextInput,{placeholder:"vertex_rag_engine"===o?"6917529027641081856 (Get corpus ID from Vertex AI console)":"vertex_ai/search_api"===o?m?"Any identifier you'll use to reference this in LiteLLM":"my-datastore_1234567890 (Get data store ID from Vertex AI Search console)":"Enter vector store ID from your provider"})}),Fl(o).map(e=>{if("select"===e.type){let t=e.options??c.filter(e=>"embedding"===e.mode||null===e.mode).map(e=>({value:e.model_group,label:e.model_group}));return(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:[e.label," ",(0,_.jsx)(tB.Tooltip,{title:e.tooltip,children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:e.name,initialValue:e.initialValue,rules:e.required?[{required:!0,message:`Please select the ${e.label.toLowerCase()}`}]:[],children:(0,_.jsx)(eE.Select,{placeholder:e.placeholder,showSearch:!0,filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase()),options:t,style:{width:"100%"}})},e.name)}return(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:[e.label," ",(0,_.jsx)(tB.Tooltip,{title:e.tooltip,children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:e.name,rules:e.required?[{required:!0,message:`Please input the ${e.label.toLowerCase()}`}]:[],children:(0,_.jsx)(et.TextInput,{type:e.type||"text",placeholder:e.placeholder})},e.name)}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Vector Store Name"," ",(0,_.jsx)(tB.Tooltip,{title:"Custom name you want to give to the vector store, this name will be rendered on the LiteLLM UI",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"vector_store_name",children:(0,_.jsx)(et.TextInput,{})}),(0,_.jsx)(H.Form.Item,{label:"Description",name:"vector_store_description",children:(0,_.jsx)($.Input.TextArea,{rows:4})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Existing Credentials"," ",(0,_.jsx)(tB.Tooltip,{title:"Optionally select API provider credentials for this vector store eg. Bedrock API KEY",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"litellm_credential_name",children:(0,_.jsx)(eE.Select,{showSearch:!0,placeholder:"Select or search for existing credentials",optionFilterProp:"children",filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase()),options:[{value:null,label:"None"},...s.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Metadata"," ",(0,_.jsx)(tB.Tooltip,{title:"JSON metadata for the vector store (optional)",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),children:(0,_.jsx)($.Input.TextArea,{rows:4,value:l,onChange:e=>i(e.target.value),placeholder:'{"key": "value"}'})}),(0,_.jsxs)("div",{className:"flex justify-end space-x-3",children:[(0,_.jsx)(S.Button,{onClick:h,variant:"secondary",children:"Cancel"}),(0,_.jsx)(S.Button,{variant:"primary",type:"submit",children:"Create"})]})]})})};var Fo=e.i(84899),Fd=e.i(210612);let{TextArea:Fc}=$.Input,{Text:Fu,Title:Fm}=V.Typography,Fp=({vectorStoreId:e,accessToken:t,className:r=""})=>{let[a,s]=(0,T.useState)(""),[n,l]=(0,T.useState)(!1),[i,o]=(0,T.useState)([]),[d,c]=(0,T.useState)({}),u=async()=>{if(!a.trim())return void tU.default.warning("Please enter a search query");l(!0);try{let r=await (0,Q.vectorStoreSearchCall)(t,e,a),n={query:a,response:r,timestamp:Date.now()};o(e=>[n,...e]),s("")}catch(e){console.error("Error searching vector store:",e),J.default.fromBackend("Failed to search vector store")}finally{l(!1)}};return(0,_.jsx)(eg.Card,{className:"w-full rounded-xl shadow-md",children:(0,_.jsxs)("div",{className:"flex flex-col h-[600px]",children:[(0,_.jsxs)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:[(0,_.jsxs)("div",{className:"flex items-center",children:[(0,_.jsx)(Fd.DatabaseOutlined,{className:"mr-2 text-blue-500"}),(0,_.jsx)(Fm,{level:4,className:"mb-0",children:"Test Vector Store"})]}),i.length>0&&(0,_.jsx)(z.Button,{onClick:()=>{o([]),c({}),J.default.success("Search history cleared")},size:"small",children:"Clear History"})]}),(0,_.jsxs)("div",{className:"flex-1 overflow-auto p-4 pb-0",children:[0===i.length?(0,_.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,_.jsx)(Fd.DatabaseOutlined,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,_.jsx)(Fu,{children:"Test your vector store by entering a search query below"})]}):(0,_.jsx)("div",{className:"space-y-4",children:i.map((e,t)=>(0,_.jsxs)("div",{className:"space-y-2",children:[(0,_.jsx)("div",{className:"text-right",children:(0,_.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3 bg-blue-50 border border-blue-200",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,_.jsx)("strong",{className:"text-sm",children:"Query"}),(0,_.jsx)("span",{className:"text-xs text-gray-500",children:new Date(e.timestamp).toLocaleString()})]}),(0,_.jsx)("div",{className:"text-left",children:e.query})]})}),(0,_.jsx)("div",{className:"text-left",children:(0,_.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3 bg-white border border-gray-200",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,_.jsx)(Fd.DatabaseOutlined,{className:"text-green-500"}),(0,_.jsx)("strong",{className:"text-sm",children:"Vector Store Results"}),e.response&&(0,_.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded bg-gray-100 text-gray-600",children:[e.response.data?.length||0," results"]})]}),e.response&&e.response.data&&e.response.data.length>0?(0,_.jsx)("div",{className:"space-y-3",children:e.response.data.map((e,r)=>{let a=d[`${t}-${r}`]||!1;return(0,_.jsxs)("div",{className:"border rounded-lg overflow-hidden bg-gray-50",children:[(0,_.jsxs)("div",{className:"flex justify-between items-center p-3 cursor-pointer hover:bg-gray-100 transition-colors",onClick:()=>{let e;return e=`${t}-${r}`,void c(t=>({...t,[e]:!t[e]}))},children:[(0,_.jsxs)("div",{className:"flex items-center",children:[a?(0,_.jsx)(wd.DownOutlined,{className:"text-gray-500 mr-2"}):(0,_.jsx)(wc.RightOutlined,{className:"text-gray-500 mr-2"}),(0,_.jsxs)("span",{className:"font-medium text-sm",children:["Result ",r+1]}),!a&&e.content&&e.content[0]&&(0,_.jsxs)("span",{className:"ml-2 text-xs text-gray-500 truncate max-w-md",children:["- ",e.content[0].text.substring(0,100),"..."]})]}),(0,_.jsxs)("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded",children:["Score: ",e.score.toFixed(4)]})]}),a&&(0,_.jsxs)("div",{className:"border-t bg-white p-3",children:[e.content&&e.content.map((e,t)=>(0,_.jsxs)("div",{className:"mb-3",children:[(0,_.jsxs)("div",{className:"text-xs text-gray-500 mb-1",children:["Content (",e.type,")"]}),(0,_.jsx)("div",{className:"text-sm bg-gray-50 p-3 rounded border text-gray-800 max-h-40 overflow-y-auto",children:e.text})]},t)),(e.file_id||e.filename||e.attributes)&&(0,_.jsxs)("div",{className:"mt-3 pt-3 border-t border-gray-200",children:[(0,_.jsx)("div",{className:"text-xs text-gray-500 mb-2 font-medium",children:"Metadata"}),(0,_.jsxs)("div",{className:"space-y-2 text-xs",children:[e.file_id&&(0,_.jsxs)("div",{className:"bg-gray-50 p-2 rounded",children:[(0,_.jsx)("span",{className:"font-medium",children:"File ID:"})," ",e.file_id]}),e.filename&&(0,_.jsxs)("div",{className:"bg-gray-50 p-2 rounded",children:[(0,_.jsx)("span",{className:"font-medium",children:"Filename:"})," ",e.filename]}),e.attributes&&Object.keys(e.attributes).length>0&&(0,_.jsxs)("div",{className:"bg-gray-50 p-2 rounded",children:[(0,_.jsx)("span",{className:"font-medium block mb-1",children:"Attributes:"}),(0,_.jsx)("pre",{className:"text-xs bg-white p-2 rounded border overflow-x-auto",children:JSON.stringify(e.attributes,null,2)})]})]})]})]})]},r)})}):(0,_.jsx)("div",{className:"text-gray-500 text-sm",children:"No results found"})]})}),ts(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),u())},placeholder:"Enter your search query... (Shift+Enter for new line)",disabled:n,autoSize:{minRows:1,maxRows:4},style:{resize:"none"}})}),(0,_.jsx)(z.Button,{type:"primary",onClick:u,disabled:n||!a.trim(),icon:(0,_.jsx)(Fo.SendOutlined,{}),loading:n,children:"Search"})]})})]})})},Fh=({vectorStoreId:e,onClose:t,accessToken:r,is_admin:a,editVectorStore:s})=>{let[n]=H.Form.useForm(),[l,i]=(0,T.useState)(null),[o,d]=(0,T.useState)(s),[c,u]=(0,T.useState)("{}"),[m,p]=(0,T.useState)([]),[h,f]=(0,T.useState)("details"),x=async()=>{if(r)try{let t=await (0,Q.vectorStoreInfoCall)(r,e);if(t&&t.vector_store){if(i(t.vector_store),t.vector_store.vector_store_metadata){let e="string"==typeof t.vector_store.vector_store_metadata?JSON.parse(t.vector_store.vector_store_metadata):t.vector_store.vector_store_metadata;u(JSON.stringify(e,null,2))}s&&n.setFieldsValue({vector_store_id:t.vector_store.vector_store_id,custom_llm_provider:t.vector_store.custom_llm_provider,vector_store_name:t.vector_store.vector_store_name,vector_store_description:t.vector_store.vector_store_description})}}catch(e){console.error("Error fetching vector store details:",e),J.default.fromBackend("Error fetching vector store details: "+e)}},g=async()=>{if(r)try{let e=await (0,Q.credentialListCall)(r);console.log("List credentials response:",e),p(e.credentials||[])}catch(e){console.error("Error fetching credentials:",e)}};(0,T.useEffect)(()=>{x(),g()},[e,r]);let y=async e=>{if(r)try{let t={};try{t=c?JSON.parse(c):{}}catch(e){J.default.fromBackend("Invalid JSON in metadata field");return}let a={vector_store_id:e.vector_store_id,custom_llm_provider:e.custom_llm_provider,vector_store_name:e.vector_store_name,vector_store_description:e.vector_store_description,vector_store_metadata:t};await (0,Q.vectorStoreUpdateCall)(r,a),J.default.success("Vector store updated successfully"),d(!1),x()}catch(e){console.error("Error updating vector store:",e),J.default.fromBackend("Error updating vector store: "+e)}};return l?(0,_.jsxs)("div",{className:"p-4 max-w-full",children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(S.Button,{icon:rH.ArrowLeftIcon,variant:"light",className:"mb-4",onClick:t,children:"Back to Vector Stores"}),(0,_.jsxs)(X.Title,{children:["Vector Store ID: ",l.vector_store_id]}),(0,_.jsx)(Z.Text,{className:"text-gray-500",children:l.vector_store_description||"No description"})]}),a&&!o&&(0,_.jsx)(S.Button,{onClick:()=>d(!0),children:"Edit Vector Store"})]}),(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)(rR.TabList,{className:"mb-6",children:[(0,_.jsx)(rY.Tab,{children:"Details"}),(0,_.jsx)(rY.Tab,{children:"Test Vector Store"})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsx)(rB.TabPanel,{children:o?(0,_.jsxs)("div",{children:[(0,_.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,_.jsx)(X.Title,{children:"Edit Vector Store"})}),(0,_.jsx)(P.Card,{children:(0,_.jsxs)(H.Form,{form:n,onFinish:y,layout:"vertical",initialValues:l,children:[(0,_.jsx)(H.Form.Item,{label:"Vector Store ID",name:"vector_store_id",rules:[{required:!0,message:"Please input a vector store ID"}],children:(0,_.jsx)($.Input,{disabled:!0})}),(0,_.jsx)(H.Form.Item,{label:"Vector Store Name",name:"vector_store_name",children:(0,_.jsx)($.Input,{})}),(0,_.jsx)(H.Form.Item,{label:"Description",name:"vector_store_description",children:(0,_.jsx)($.Input.TextArea,{rows:4})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Provider"," ",(0,_.jsx)(tB.Tooltip,{title:"Select the provider for this vector store",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"custom_llm_provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,_.jsx)(eE.Select,{children:Object.entries(j$.Providers).map(([e,t])=>"Bedrock"===e?(0,_.jsx)(eE.Select.Option,{value:j$.provider_map[e],children:(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)("img",{src:j$.providerLogoMap[t],alt:`${e} logo`,className:"w-5 h-5",onError:e=>{let r=e.target,a=r.parentElement;if(a){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),a.replaceChild(e,r)}}}),(0,_.jsx)("span",{children:t})]})},e):null)})}),(0,_.jsx)("div",{className:"mb-4",children:(0,_.jsx)(Z.Text,{className:"text-sm text-gray-500 mb-2",children:"Either select existing credentials OR enter provider credentials below"})}),(0,_.jsx)(H.Form.Item,{label:"Existing Credentials",name:"litellm_credential_name",children:(0,_.jsx)(eE.Select,{showSearch:!0,placeholder:"Select or search for existing credentials",optionFilterProp:"children",filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase()),options:[{value:null,label:"None"},...m.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,_.jsxs)("div",{className:"flex items-center my-4",children:[(0,_.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,_.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"OR"}),(0,_.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Metadata"," ",(0,_.jsx)(tB.Tooltip,{title:"JSON metadata for the vector store",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),children:(0,_.jsx)($.Input.TextArea,{rows:4,value:c,onChange:e=>u(e.target.value),placeholder:'{"key": "value"}'})}),(0,_.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,_.jsx)(z.Button,{onClick:()=>d(!1),children:"Cancel"}),(0,_.jsx)(z.Button,{type:"primary",htmlType:"submit",children:"Save Changes"})]})]})})]}):(0,_.jsxs)("div",{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,_.jsx)(X.Title,{children:"Vector Store Details"}),a&&(0,_.jsx)(S.Button,{onClick:()=>d(!0),children:"Edit Vector Store"})]}),(0,_.jsx)(P.Card,{children:(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"ID"}),(0,_.jsx)(Z.Text,{children:l.vector_store_id})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Name"}),(0,_.jsx)(Z.Text,{children:l.vector_store_name||"-"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Description"}),(0,_.jsx)(Z.Text,{children:l.vector_store_description||"-"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Provider"}),(0,_.jsx)("div",{className:"flex items-center space-x-2 mt-1",children:(()=>{let e=l.custom_llm_provider||"bedrock",{displayName:t,logo:r}=(()=>{let t=Object.keys(j$.provider_map).find(t=>j$.provider_map[t].toLowerCase()===e.toLowerCase());if(!t)return{displayName:e,logo:""};let r=j$.Providers[t],a=j$.providerLogoMap[r];return{displayName:r,logo:a}})();return(0,_.jsxs)(_.Fragment,{children:[r&&(0,_.jsx)("img",{src:r,alt:`${t} logo`,className:"w-5 h-5",onError:e=>{let r=e.target,a=r.parentElement;if(a){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),a.replaceChild(e,r)}}}),(0,_.jsx)(tR.Badge,{color:"blue",children:t})]})})()})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Metadata"}),(0,_.jsx)("div",{className:"bg-gray-50 p-3 rounded mt-2 font-mono text-xs overflow-auto max-h-48",children:(0,_.jsx)("pre",{children:c})})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Created"}),(0,_.jsx)(Z.Text,{children:l.created_at?new Date(l.created_at).toLocaleString():"-"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Last Updated"}),(0,_.jsx)(Z.Text,{children:l.updated_at?new Date(l.updated_at).toLocaleString():"-"})]})]})})]})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Fp,{vectorStoreId:l.vector_store_id,accessToken:r||""})})]})]})]}):(0,_.jsx)("div",{children:"Loading..."})},Ff={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M885.2 446.3l-.2-.8-112.2-285.1c-5-16.1-19.9-27.2-36.8-27.2H281.2c-17 0-32.1 11.3-36.9 27.6L139.4 443l-.3.7-.2.8c-1.3 4.9-1.7 9.9-1 14.8-.1 1.6-.2 3.2-.2 4.8V830a60.9 60.9 0 0060.8 60.8h627.2c33.5 0 60.8-27.3 60.9-60.8V464.1c0-1.3 0-2.6-.1-3.7.4-4.9 0-9.6-1.3-14.1zm-295.8-43l-.3 15.7c-.8 44.9-31.8 75.1-77.1 75.1-22.1 0-41.1-7.1-54.8-20.6S436 441.2 435.6 419l-.3-15.7H229.5L309 210h399.2l81.7 193.3H589.4zm-375 76.8h157.3c24.3 57.1 76 90.8 140.4 90.8 33.7 0 65-9.4 90.3-27.2 22.2-15.6 39.5-37.4 50.7-63.6h156.5V814H214.4V480.1z"}}]},name:"inbox",theme:"outlined"};var Fx=T.forwardRef(function(e,t){return T.createElement(rf.default,(0,rp.default)({},e,{ref:t,icon:Ff}))}),Fg=e.i(984125),Fg=Fg;let Fy=({documents:e,onRemove:t})=>{let r=[{title:"Name",dataIndex:"name",key:"name",render:(e,t)=>(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)("span",{className:"text-sm",children:e}),t.size&&(0,_.jsxs)("span",{className:"text-xs text-gray-400",children:["(",(e=>{if(!e)return"-";let t=e/1024;return t<1024?`${t.toFixed(2)} KB`:`${(t/1024).toFixed(2)} MB`})(t.size),")"]})]})},{title:"Status",dataIndex:"status",key:"status",width:150,render:e=>{let t;return t=({uploading:{color:"blue",text:"Uploading"},done:{color:"green",text:"Ready"},error:{color:"red",text:"Error"},removed:{color:"default",text:"Removed"}})[e],(0,_.jsx)(LZ.Badge,{color:t.color,text:t.text})}},{title:"Actions",key:"actions",width:120,render:(e,r)=>(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)(tB.Tooltip,{title:"View details",children:(0,_.jsx)(Fg.default,{className:"cursor-pointer text-gray-600 hover:text-blue-500",onClick:()=>console.log("View",r)})}),(0,_.jsx)(tB.Tooltip,{title:"Copy ID",children:(0,_.jsx)(ei.CopyOutlined,{className:"cursor-pointer text-gray-600 hover:text-blue-500",onClick:()=>{var e;return e=r.uid,void(navigator.clipboard.writeText(e),tU.default.success("Document ID copied to clipboard"))}})}),(0,_.jsx)(tB.Tooltip,{title:"Remove",children:(0,_.jsx)(jQ.DeleteOutlined,{className:"cursor-pointer text-gray-600 hover:text-red-500",onClick:()=>t(r.uid)})})]})}];return(0,_.jsx)(eK.Table,{dataSource:e,columns:r,rowKey:"uid",pagination:!1,locale:{emptyText:"No documents uploaded yet. Upload documents above to get started."},size:"small"})},F_=({accessToken:e,providerParams:t,onParamsChange:r})=>{let[a,s]=(0,T.useState)([]),[n,l]=(0,T.useState)(!1);(0,T.useEffect)(()=>{e&&(async()=>{l(!0);try{let t=(await (0,jh.fetchAvailableModels)(e)).filter(e=>"embedding"===e.mode);s(t)}catch(e){console.error("Error fetching embedding models:",e)}finally{l(!1)}})()},[e]);let i=(e,a)=>{r({...t,[e]:a})};return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(B.Alert,{message:"AWS S3 Vectors Setup",description:(0,_.jsxs)("div",{children:[(0,_.jsx)("p",{children:"AWS S3 Vectors allows you to store and query vector embeddings directly in S3:"}),(0,_.jsxs)("ul",{style:{marginLeft:"16px",marginTop:"8px"},children:[(0,_.jsx)("li",{children:"Vector buckets and indexes will be automatically created if they don't exist"}),(0,_.jsx)("li",{children:"Vector dimensions are auto-detected from your selected embedding model"}),(0,_.jsx)("li",{children:"Ensure your AWS credentials have permissions for S3 Vectors operations"}),(0,_.jsxs)("li",{children:["Learn more:"," ",(0,_.jsx)("a",{href:"https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-vector-buckets.html",target:"_blank",rel:"noopener noreferrer",children:"AWS S3 Vectors Documentation"})]})]})]}),type:"info",showIcon:!0,style:{marginBottom:"16px"}}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Vector Bucket Name"," ",(0,_.jsx)(tB.Tooltip,{title:"S3 bucket name for vector storage (must be at least 3 characters, lowercase letters, numbers, hyphens, and periods only)",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),required:!0,validateStatus:t.vector_bucket_name&&t.vector_bucket_name.length<3?"error":void 0,help:t.vector_bucket_name&&t.vector_bucket_name.length<3?"Bucket name must be at least 3 characters":void 0,children:(0,_.jsx)($.Input,{value:t.vector_bucket_name||"",onChange:e=>i("vector_bucket_name",e.target.value),placeholder:"my-vector-bucket (min 3 chars)",size:"large",className:"rounded-md"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Index Name"," ",(0,_.jsx)(tB.Tooltip,{title:"Name for the vector index (optional, will be auto-generated if not provided). If provided, must be at least 3 characters.",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),validateStatus:t.index_name&&t.index_name.length>0&&t.index_name.length<3?"error":void 0,help:t.index_name&&t.index_name.length>0&&t.index_name.length<3?"Index name must be at least 3 characters if provided":void 0,children:(0,_.jsx)($.Input,{value:t.index_name||"",onChange:e=>i("index_name",e.target.value),placeholder:"my-vector-index (optional, min 3 chars)",size:"large",className:"rounded-md"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["AWS Region"," ",(0,_.jsx)(tB.Tooltip,{title:"AWS region where the S3 bucket is located (e.g., us-west-2)",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),required:!0,children:(0,_.jsx)($.Input,{value:t.aws_region_name||"",onChange:e=>i("aws_region_name",e.target.value),placeholder:"us-west-2",size:"large",className:"rounded-md"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Embedding Model"," ",(0,_.jsx)(tB.Tooltip,{title:"Select the embedding model to use for vector generation",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),required:!0,children:(0,_.jsx)(eE.Select,{value:t.embedding_model||void 0,onChange:e=>i("embedding_model",e),placeholder:"Select an embedding model",size:"large",showSearch:!0,loading:n,filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase()),options:a.map(e=>({value:e.model_group,label:e.model_group})),style:{width:"100%"}})})]})},{Dragger:Fb}=Tl.Upload,Fv=({accessToken:e,onSuccess:t})=>{let[r]=H.Form.useForm(),[a,s]=(0,T.useState)([]),[n,l]=(0,T.useState)(!1),[i,o]=(0,T.useState)("bedrock"),[d,c]=(0,T.useState)(""),[u,m]=(0,T.useState)(""),[p,h]=(0,T.useState)([]),[f,x]=(0,T.useState)({}),g={name:"file",multiple:!0,accept:".pdf,.txt,.docx,.md,.doc",beforeUpload:e=>{if(!["application/pdf","text/plain","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/msword","text/markdown"].includes(e.type))return tU.default.error(`${e.name} is not a supported file type. Please upload PDF, TXT, DOCX, or MD files.`),Tl.Upload.LIST_IGNORE;if(!(e.size/1024/1024<50))return tU.default.error(`${e.name} must be smaller than 50MB!`),Tl.Upload.LIST_IGNORE;let t={uid:e.uid,name:e.name,status:"done",size:e.size,type:e.type,originFileObj:e};return s(e=>[...e,t]),!1},onRemove:e=>{s(t=>t.filter(t=>t.uid!==e.uid))},fileList:a.map(e=>({uid:e.uid,name:e.name,status:e.status,size:e.size})),showUploadList:!1},y=async()=>{let r;if(0===a.length)return void tU.default.warning("Please upload at least one document");if(!i)return void tU.default.warning("Please select a provider");for(let e of Fl(i).filter(e=>e.required))if(!f[e.name])return void tU.default.warning(`Please provide ${e.label}`);if("s3_vectors"===i){if(f.vector_bucket_name&&f.vector_bucket_name.length<3)return void tU.default.warning("Vector bucket name must be at least 3 characters");if(f.index_name&&f.index_name.length>0&&f.index_name.length<3)return void tU.default.warning("Index name must be at least 3 characters if provided")}if(!e)return void tU.default.error("No access token available");l(!0);let n=[];try{for(let t of a)if(t.originFileObj){s(e=>e.map(e=>e.uid===t.uid?{...e,status:"uploading"}:e));try{let a=await (0,Q.ragIngestCall)(e,t.originFileObj,i,r,d||void 0,u||void 0,f);!r&&a.vector_store_id&&(r=a.vector_store_id),n.push(a),s(e=>e.map(e=>e.uid===t.uid?{...e,status:"done"}:e))}catch(e){throw console.error(`Error ingesting ${t.name}:`,e),s(e=>e.map(e=>e.uid===t.uid?{...e,status:"error"}:e)),e}}h(n),J.default.success(`Successfully created vector store with ${n.length} document(s). Vector Store ID: ${r}`),t&&r&&t(r),setTimeout(()=>{s([]),h([])},3e3)}catch(e){console.error("Error creating vector store:",e),J.default.fromBackend(`Failed to create vector store: ${e}`)}finally{l(!1)}};return(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(X.Title,{children:"Create Vector Store"}),(0,_.jsx)(Z.Text,{className:"text-gray-500",children:"Upload documents and select a provider to create a new vector store with embedded content."})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"mb-4",children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Step 1: Upload Documents"}),(0,_.jsx)(Z.Text,{className:"text-sm text-gray-500 block mt-1",children:"Upload one or more documents (PDF, TXT, DOCX, MD). Maximum file size: 50MB per file."})]}),(0,_.jsxs)(Fb,{...g,children:[(0,_.jsx)("p",{className:"ant-upload-drag-icon",children:(0,_.jsx)(Fx,{style:{fontSize:"48px",color:"#1890ff"}})}),(0,_.jsx)("p",{className:"ant-upload-text",children:"Click or drag files to this area to upload"}),(0,_.jsx)("p",{className:"ant-upload-hint",children:"Support for single or bulk upload. Supported formats: PDF, TXT, DOCX, MD"})]})]}),a.length>0&&(0,_.jsxs)(P.Card,{children:[(0,_.jsx)("div",{className:"mb-4",children:(0,_.jsxs)(Z.Text,{className:"font-medium",children:["Uploaded Documents (",a.length,")"]})}),(0,_.jsx)(Fy,{documents:a,onRemove:e=>{s(t=>t.filter(t=>t.uid!==e))}})]}),(0,_.jsx)(P.Card,{children:(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Step 2: Configure Vector Store"}),(0,_.jsx)(Z.Text,{className:"text-sm text-gray-500 block mt-1",children:"Choose the provider and optionally provide a name and description for your vector store."})]}),(0,_.jsxs)(H.Form,{form:r,layout:"vertical",children:[(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Vector Store Name"," ",(0,_.jsx)(tB.Tooltip,{title:"Optional: Give your vector store a meaningful name",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),children:(0,_.jsx)($.Input,{value:d,onChange:e=>c(e.target.value),placeholder:"e.g., Product Documentation, Customer Support KB",size:"large",className:"rounded-md"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Description"," ",(0,_.jsx)(tB.Tooltip,{title:"Optional: Describe what this vector store contains",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),children:(0,_.jsx)($.Input.TextArea,{value:u,onChange:e=>m(e.target.value),placeholder:"e.g., Contains all product documentation and user guides",rows:2,size:"large",className:"rounded-md"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Provider"," ",(0,_.jsx)(tB.Tooltip,{title:"Select the provider for embedding and vector store operations",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),required:!0,children:(0,_.jsx)(eE.Select,{value:i,onChange:o,placeholder:"Select a provider",size:"large",style:{width:"100%"},children:Object.entries(Ft).map(([e,t])=>(0,_.jsx)(eE.Select.Option,{value:Fr[e],children:(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)("img",{src:Fs[t],alt:`${e} logo`,className:"w-5 h-5",onError:e=>{let r=e.target,a=r.parentElement;if(a){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),a.replaceChild(e,r)}}}),(0,_.jsx)("span",{children:t})]})},e))})}),"s3_vectors"===i&&(0,_.jsx)(F_,{accessToken:e,providerParams:f,onParamsChange:x}),"s3_vectors"!==i&&Fl(i).map(e=>"select"===e.type?(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:[e.label," ",(0,_.jsx)(tB.Tooltip,{title:e.tooltip,children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),required:e.required,children:(0,_.jsx)($.Input,{value:f[e.name]||"",onChange:t=>x(r=>({...r,[e.name]:t.target.value})),placeholder:e.placeholder,size:"large",className:"rounded-md"})},e.name):(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:[e.label," ",(0,_.jsx)(tB.Tooltip,{title:e.tooltip,children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),required:e.required,children:(0,_.jsx)($.Input,{type:"password"===e.type?"password":"text",value:f[e.name]||"",onChange:t=>x(r=>({...r,[e.name]:t.target.value})),placeholder:e.placeholder,size:"large",className:"rounded-md"})},e.name))]}),(0,_.jsx)("div",{className:"flex justify-end",children:(0,_.jsx)(z.Button,{type:"primary",size:"large",onClick:y,loading:n,disabled:0===a.length||!i,children:n?"Creating Vector Store...":"Create Vector Store"})})]})}),p.length>0&&(0,_.jsx)(B.Alert,{message:"Vector Store Created Successfully",description:(0,_.jsxs)("div",{children:[(0,_.jsxs)("p",{children:[(0,_.jsx)("strong",{children:"Vector Store ID:"})," ",p[0]?.vector_store_id]}),(0,_.jsxs)("p",{children:[(0,_.jsx)("strong",{children:"Documents Ingested:"})," ",p.length]})]}),type:"success",showIcon:!0,closable:!0})]})},{Text:Fj,Title:Fw}=V.Typography,Fk=({accessToken:e,vectorStores:t})=>{let[r,a]=(0,T.useState)(t.length>0?t[0].vector_store_id:void 0);return e?0===t.length?(0,_.jsx)(eg.Card,{children:(0,_.jsx)("div",{className:"text-center py-8",children:(0,_.jsx)(Fj,{type:"secondary",children:"No vector stores available. Create one first to test it."})})}):(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsx)(eg.Card,{children:(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Fw,{level:5,children:"Select Vector Store"}),(0,_.jsx)(Fj,{type:"secondary",children:"Choose a vector store to test search queries against"})]}),(0,_.jsx)(eE.Select,{value:r,onChange:a,placeholder:"Select a vector store",size:"large",style:{width:"100%"},showSearch:!0,optionFilterProp:"children",children:t.map(e=>(0,_.jsx)(eE.Select.Option,{value:e.vector_store_id,children:(0,_.jsxs)("div",{className:"flex flex-col",children:[(0,_.jsx)("span",{className:"font-medium",children:e.vector_store_name||e.vector_store_id}),e.vector_store_name&&(0,_.jsx)("span",{className:"text-xs text-gray-500 font-mono",children:e.vector_store_id})]})},e.vector_store_id))})]})}),r&&(0,_.jsx)(Fp,{vectorStoreId:r,accessToken:e})]}):(0,_.jsx)(eg.Card,{children:(0,_.jsx)(Fj,{type:"secondary",children:"Access token is required to test vector stores."})})},FS=({accessToken:e,userID:t,userRole:r})=>{let[a,s]=(0,T.useState)([]),[n,l]=(0,T.useState)(!1),[i,o]=(0,T.useState)(!1),[d,c]=(0,T.useState)(null),[u,m]=(0,T.useState)(""),[p,h]=(0,T.useState)([]),[f,x]=(0,T.useState)(null),[g,y]=(0,T.useState)(!1),[b,v]=(0,T.useState)(!1),j=async()=>{if(e)try{let t=await (0,Q.vectorStoreListCall)(e);console.log("List vector stores response:",t),s(t.data||[])}catch(e){console.error("Error fetching vector stores:",e),J.default.fromBackend("Error fetching vector stores: "+e)}},w=async()=>{if(e)try{let t=await (0,Q.credentialListCall)(e);console.log("List credentials response:",t),h(t.credentials||[])}catch(e){console.error("Error fetching credentials:",e),J.default.fromBackend("Error fetching credentials: "+e)}},k=async e=>{c(e),o(!0)},N=async()=>{if(e&&d){v(!0);try{await (0,Q.vectorStoreDeleteCall)(e,d),J.default.success("Vector store deleted successfully"),j()}catch(e){console.error("Error deleting vector store:",e),J.default.fromBackend("Error deleting vector store: "+e)}finally{v(!1),o(!1),c(null)}}};return(0,T.useEffect)(()=>{j(),w()},[e]),f?(0,_.jsx)("div",{className:"w-full h-full",children:(0,_.jsx)(Fh,{vectorStoreId:f,onClose:()=>{x(null),y(!1),j()},accessToken:e,is_admin:(0,ts.isAdminRole)(r||""),editVectorStore:g})}):(0,_.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,_.jsxs)("div",{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,_.jsxs)("div",{className:"flex justify-between mt-2 w-full items-center mb-4",children:[(0,_.jsx)("h1",{children:"Vector Store Management"}),(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[u&&(0,_.jsxs)(Z.Text,{children:["Last Refreshed: ",u]}),(0,_.jsx)(yi.Icon,{icon:jt.RefreshIcon,variant:"shadow",size:"xs",className:"self-center cursor-pointer",onClick:()=>{j(),w(),m(new Date().toLocaleString())}})]})]}),(0,_.jsx)(Z.Text,{className:"mb-4",children:(0,_.jsx)("p",{children:"You can use vector stores to store and retrieve LLM embeddings."})}),(0,_.jsxs)(rF.TabGroup,{children:[(0,_.jsxs)(rR.TabList,{className:"mb-6",children:[(0,_.jsx)(rY.Tab,{children:"Create Vector Store"}),(0,_.jsx)(rY.Tab,{children:"Manage Vector Stores"}),(0,_.jsx)(rY.Tab,{children:"Test Vector Store"})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Fv,{accessToken:e,onSuccess:e=>{console.log("Vector store created:",e),j()}})}),(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsx)(S.Button,{className:"mb-4",onClick:()=>l(!0),children:"+ Add Vector Store"}),(0,_.jsx)(ee.Grid,{numItems:1,className:"gap-2 pt-2 pb-2 w-full mt-2",children:(0,_.jsx)(yl.Col,{numColSpan:1,children:(0,_.jsx)(Fe,{data:a,onView:e=>{x(e),y(!1)},onEdit:e=>{x(e),y(!0)},onDelete:k})})})]}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Fk,{accessToken:e,vectorStores:a})})]})]}),(0,_.jsx)(Fi,{isVisible:n,onCancel:()=>l(!1),onSuccess:()=>{l(!1),j()},accessToken:e,credentials:p}),(0,_.jsx)(eH.default,{isOpen:i,title:"Delete Vector Store",message:"Are you sure you want to delete this vector store? This action cannot be undone.",resourceInformationTitle:"Vector Store Information",resourceInformation:[{label:"Vector Store ID",value:d,code:!0}],onCancel:()=>o(!1),onOk:N,confirmLoading:b})]})})},FN={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M536.1 273H488c-4.4 0-8 3.6-8 8v275.3c0 2.6 1.2 5 3.3 6.5l165.3 120.7c3.6 2.6 8.6 1.9 11.2-1.7l28.6-39c2.7-3.7 1.9-8.7-1.7-11.2L544.1 528.5V281c0-4.4-3.6-8-8-8zm219.8 75.2l156.8 38.3c5 1.2 9.9-2.6 9.9-7.7l.8-161.5c0-6.7-7.7-10.5-12.9-6.3L752.9 334.1a8 8 0 003 14.1zm167.7 301.1l-56.7-19.5a8 8 0 00-10.1 4.8c-1.9 5.1-3.9 10.1-6 15.1-17.8 42.1-43.3 80-75.9 112.5a353 353 0 01-112.5 75.9 352.18 352.18 0 01-137.7 27.8c-47.8 0-94.1-9.3-137.7-27.8a353 353 0 01-112.5-75.9c-32.5-32.5-58-70.4-75.9-112.5A353.44 353.44 0 01171 512c0-47.8 9.3-94.2 27.8-137.8 17.8-42.1 43.3-80 75.9-112.5a353 353 0 01112.5-75.9C430.6 167.3 477 158 524.8 158s94.1 9.3 137.7 27.8A353 353 0 01775 261.7c10.2 10.3 19.8 21 28.6 32.3l59.8-46.8C784.7 146.6 662.2 81.9 524.6 82 285 82.1 92.6 276.7 95 516.4 97.4 751.9 288.9 942 524.8 942c185.5 0 343.5-117.6 403.7-282.3 1.5-4.2-.7-8.9-4.9-10.4z"}}]},name:"history",theme:"outlined"};var FT=T.forwardRef(function(e,t){return T.createElement(rf.default,(0,rp.default)({},e,{ref:t,icon:FN}))});let FM=[{value:"untrusted",label:"untrusted",color:"#92400e",bg:"#fef3c7",border:"#fcd34d"},{value:"trusted",label:"trusted",color:"#065f46",bg:"#d1fae5",border:"#6ee7b7"},{value:"blocked",label:"blocked",color:"#991b1b",bg:"#fee2e2",border:"#fca5a5"}],FC=[{value:"untrusted",label:"untrusted",color:"#92400e",bg:"#fef3c7",border:"#fcd34d"},{value:"trusted",label:"trusted",color:"#065f46",bg:"#d1fae5",border:"#6ee7b7"}],FL=({value:e,toolName:t,saving:r,onChange:a,policyType:s="input",size:n="small",minWidth:l=110,stopPropagation:i=!0})=>{let o="output"===s?FC:FM,d=FM.find(t=>t.value===e)??FM[0];return(0,_.jsx)(eE.Select,{size:n,value:e,disabled:r,loading:r,onChange:e=>a(t,e),onClick:e=>i&&e.stopPropagation(),style:{minWidth:l,fontWeight:500,backgroundColor:d.bg,borderColor:d.border,color:d.color,borderRadius:999,fontSize:"small"===n?11:12},popupMatchSelectWidth:!1,options:o.map(e=>({value:e.value,label:(0,_.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:12,fontWeight:500,color:e.color},children:[(0,_.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:e.color,display:"inline-block",flexShrink:0}}),e.label]})}))})},FO="tool-detail";function FD({toolName:e,onBack:t,accessToken:r}){let a=(0,eh.useQueryClient)(),[s,n]=(0,T.useState)(!1),[l,i]=(0,T.useState)(!1),[o,d]=(0,T.useState)(!1),[c,u]=(0,T.useState)("team"),[m,p]=(0,T.useState)(null),[h,f]=(0,T.useState)(null),x=(0,T.useMemo)(()=>{let e,t,r;return e=new Date,(t=new Date).setDate(t.getDate()-90),{start:(r=e=>e.toISOString().slice(0,19).replace("T"," "))(t),end:r(e)}},[]),{data:g,isLoading:y,error:b}=(0,ev.useQuery)({queryKey:[FO,e],queryFn:()=>(0,Q.fetchToolDetail)(r,e),enabled:!!r&&!!e}),{data:v}=(0,ev.useQuery)({queryKey:["tool-policy-options"],queryFn:()=>(0,Q.fetchToolPolicyOptions)(r),enabled:!!r,staleTime:6e4}),{data:j}=(0,ev.useQuery)({queryKey:["teams-list-tool-detail"],queryFn:()=>(0,Q.teamListCall)(r,null,null),enabled:!!r}),{data:w}=(0,ev.useQuery)({queryKey:["keys-list-tool-detail"],queryFn:()=>(0,Q.keyListCall)(r,null,null,null,null,null,1,100),enabled:!!r}),{data:k,isLoading:S}=(0,ev.useQuery)({queryKey:["tool-usage-logs",e,x.start,x.end],queryFn:()=>(0,Q.getToolUsageLogs)(r,e,{page:1,pageSize:50,startDate:x.start,endDate:x.end}),enabled:!!r&&!!e}),N=(0,T.useMemo)(()=>(k?.logs??[]).map(e=>({id:e.id,timestamp:e.timestamp,action:"passed",model:e.model??void 0,input_snippet:e.input_snippet??void 0})),[k?.logs]);(0,T.useMemo)(()=>(Array.isArray(j)?j:j?.data??[]).map(e=>({team_id:e.team_id??e.id??"",team_alias:e.team_alias??e.team_id??"",models:[],max_budget:null,budget_duration:null,tpm_limit:null,rpm_limit:null,organization_id:"",created_at:"",keys:[],members_with_roles:[],spend:0})),[j]);let M=(0,T.useMemo)(()=>(w?.keys??w?.data??[]).map(e=>({token:e.token??e.api_key??e.key_hash??"",key_alias:e.key_alias??(e.token??e.api_key??e.key_hash)?.toString?.()?.substring?.(0,8)})),[w]),C=(0,T.useCallback)(()=>{a.invalidateQueries({queryKey:[FO,e]})},[a,e]),L=(0,T.useCallback)(async(t,a)=>{if(r){i(!0);try{await (0,Q.updateToolPolicy)(r,e,{input_policy:a}),C()}catch(e){alert(`Failed to update input policy: ${e instanceof Error?e.message:String(e)}`)}finally{i(!1)}}},[r,e,C]),O=(0,T.useCallback)(async(t,a)=>{if(r){d(!0);try{await (0,Q.updateToolPolicy)(r,e,{output_policy:a}),C()}catch(e){alert(`Failed to update output policy: ${e instanceof Error?e.message:String(e)}`)}finally{d(!1)}}},[r,e,C]),D=(0,T.useCallback)(async()=>{if(!r||!e)return;let t="team"===c;if((!t||m)&&(t||h?.token)){n(!0);try{await (0,Q.updateToolPolicy)(r,e,{input_policy:"blocked"},{team_id:t?m:void 0,key_hash:t?void 0:h.token,key_alias:t?void 0:h.key_alias}),C(),p(null),f(null)}catch(e){alert(`Failed to add override: ${e instanceof Error?e.message:String(e)}`)}finally{n(!1)}}},[r,e,c,m,h,C]),P=(0,T.useCallback)(async t=>{if(r&&e){n(!0);try{await (0,Q.deleteToolPolicyOverride)(r,e,{team_id:t.team_id??void 0,key_hash:t.key_hash??void 0}),C()}catch(e){alert(`Failed to remove override: ${e instanceof Error?e.message:String(e)}`)}finally{n(!1)}}},[r,e,C]);if(y&&!g)return(0,_.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,_.jsx)(rm.Spin,{size:"large"})});if(b&&!g)return(0,_.jsxs)("div",{children:[(0,_.jsx)(z.Button,{type:"link",icon:(0,_.jsx)(kd.ArrowLeftOutlined,{}),onClick:t,className:"pl-0 mb-4",children:"Back to Tool Policies"}),(0,_.jsx)("p",{className:"text-red-600",children:"Failed to load tool details."})]});if(!g)return null;let{tool:A,overrides:E}=g,I=v?.input_policies?.find(e=>e.value===A.input_policy)?.description,Y=v?.output_policies?.find(e=>e.value===A.output_policy)?.description;return(0,_.jsxs)("div",{children:[(0,_.jsxs)("div",{className:"mb-6",children:[(0,_.jsx)(z.Button,{type:"link",icon:(0,_.jsx)(kd.ArrowLeftOutlined,{}),onClick:t,className:"pl-0 mb-4",children:"Back to Tool Policies"}),(0,_.jsx)("div",{className:"flex items-start justify-between",children:(0,_.jsxs)("div",{children:[(0,_.jsxs)("div",{className:"flex items-center gap-3 mb-1 flex-wrap",children:[(0,_.jsx)(Nd.ToolOutlined,{className:"text-xl text-gray-400"}),(0,_.jsx)("h1",{className:"text-xl font-semibold text-gray-900 font-mono",children:A.tool_name}),(0,_.jsx)("span",{className:"inline-flex items-center px-2.5 py-1 text-xs font-medium rounded-md bg-gray-100 text-gray-700 border border-gray-200",children:A.origin??"—"}),(0,_.jsxs)("span",{className:"inline-flex items-center px-2.5 py-1 text-xs font-medium rounded-md bg-indigo-50 text-indigo-700 border border-indigo-200",children:[(A.call_count??0).toLocaleString()," calls"]})]}),(0,_.jsxs)("dl",{className:"mt-3 flex flex-wrap gap-x-6 gap-y-1 text-sm text-gray-600",children:[A.user_agent&&(0,_.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,_.jsx)("dt",{className:"font-medium text-gray-500 whitespace-nowrap",children:"User Agent:"}),(0,_.jsx)("dd",{className:"font-mono truncate max-w-[40ch]",title:A.user_agent,children:A.user_agent})]}),A.created_at&&(0,_.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,_.jsx)("dt",{className:"font-medium text-gray-500 whitespace-nowrap",children:"First Discovered:"}),(0,_.jsx)("dd",{children:new Date(A.created_at).toLocaleString()})]}),A.last_used_at&&(0,_.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,_.jsx)("dt",{className:"font-medium text-gray-500 whitespace-nowrap",children:"Last Used:"}),(0,_.jsx)("dd",{children:new Date(A.last_used_at).toLocaleString()})]})]})]})})]}),(0,_.jsxs)("div",{className:"space-y-6",children:[(0,_.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,_.jsxs)("section",{className:"bg-white rounded-lg border border-gray-200 p-5 shadow-sm",children:[(0,_.jsx)("h2",{className:"text-sm font-semibold text-gray-700 mb-1",children:"Input Policy"}),(0,_.jsx)("p",{className:"text-xs text-gray-500 mb-3",children:I??"Controls what data this tool is allowed to accept."}),(0,_.jsx)(FL,{value:A.input_policy,toolName:A.tool_name,saving:l,onChange:L,policyType:"input",size:"middle",minWidth:140,stopPropagation:!1})]}),(0,_.jsxs)("section",{className:"bg-white rounded-lg border border-gray-200 p-5 shadow-sm",children:[(0,_.jsx)("h2",{className:"text-sm font-semibold text-gray-700 mb-1",children:"Output Policy"}),(0,_.jsx)("p",{className:"text-xs text-gray-500 mb-3",children:Y??"Controls how this tool's output is trusted by downstream tools."}),(0,_.jsx)(FL,{value:A.output_policy,toolName:A.tool_name,saving:o,onChange:O,policyType:"output",size:"middle",minWidth:140,stopPropagation:!1})]})]}),E.length>0&&(0,_.jsxs)("section",{className:"bg-white rounded-lg border border-gray-200 p-5 shadow-sm",children:[(0,_.jsx)("h2",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Blocked for team or key"}),(0,_.jsx)("ul",{className:"border rounded-md divide-y divide-gray-100 bg-red-50/30",children:E.map(e=>(0,_.jsxs)("li",{className:"flex items-center justify-between px-3 py-2.5 text-sm",children:[(0,_.jsxs)("span",{className:"text-gray-700",children:[e.team_id?`Team: ${e.team_id}`:"",e.team_id&&e.key_hash?" · ":"",e.key_hash?`Key: ${e.key_alias||e.key_hash.substring(0,8)}`:"",e.team_id||e.key_hash?"":"—"]}),(0,_.jsx)(z.Button,{type:"link",danger:!0,size:"small",disabled:s,onClick:()=>P(e),children:"Remove"})]},e.override_id))})]}),(0,_.jsxs)("section",{className:"bg-white rounded-lg border border-gray-200 p-5 shadow-sm",children:[(0,_.jsx)("h2",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Block for team or key"}),(0,_.jsxs)("div",{className:"flex flex-col gap-4 max-w-md",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{className:"text-sm font-medium text-gray-700 block mb-2",children:"Scope"}),(0,_.jsxs)("div",{className:"flex items-center gap-6",children:[(0,_.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,_.jsx)("input",{type:"radio",checked:"team"===c,onChange:()=>u("team"),className:"align-middle"}),"Team"]}),(0,_.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,_.jsx)("input",{type:"radio",checked:"key"===c,onChange:()=>u("key"),className:"align-middle"}),"Key"]})]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{className:"text-sm font-medium text-gray-700 block mb-2",children:"team"===c?"Team":"Key"}),"team"===c?(0,_.jsx)(tX.default,{value:m??void 0,onChange:e=>p(e||null)}):(0,_.jsx)(eE.Select,{placeholder:"Select key",allowClear:!0,showSearch:!0,optionFilterProp:"label",value:h?h.token:void 0,onChange:e=>{f(M.find(t=>t.token===e)??null)},options:M.map(e=>({value:e.token,label:e.key_alias||e.token?.substring?.(0,12)||e.token})),className:"w-full",style:{minWidth:200}})]}),(0,_.jsxs)(z.Button,{type:"primary",danger:!0,disabled:s||("team"===c?!m:!h?.token),loading:s,onClick:D,children:["Block for ",c]})]})]}),(0,_.jsxs)("section",{className:"bg-white rounded-lg border border-gray-200 p-5 shadow-sm",children:[(0,_.jsxs)("h2",{className:"text-sm font-semibold text-gray-700 mb-3 flex items-center gap-2",children:[(0,_.jsx)(FT,{}),"Recent logs"]}),(0,_.jsx)(N4,{guardrailName:A.tool_name,filterAction:"passed",logs:N,logsLoading:S,totalLogs:k?.total??0,accessToken:r,startDate:x.start,endDate:x.end})]})]})]})}let FP=({utcTime:e})=>(0,_.jsx)("span",{style:{fontFamily:"monospace",width:"180px",display:"inline-block"},children:(e=>{try{return new Date(e).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0}).replace(",","")}catch(e){return"Error converting time"}})(e)});var FA=e.i(969550);function FE(e){return`${e.getUTCFullYear()}-${String(e.getUTCMonth()+1).padStart(2,"0")}-${String(e.getUTCDate()).padStart(2,"0")}`}function FI(e,t){if(!e)return!1;try{let r=new Date(e);return FE(r)===t}catch{return!1}}function FY(e,t){return e.filter(e=>FI(e.created_at,t)).length}let FF=({accessToken:e,onSelectTool:t})=>{let[r,a]=(0,T.useState)([]),[s,n]=(0,T.useState)(!0),[l,i]=(0,T.useState)(!1),[o,d]=(0,T.useState)(null),[c,u]=(0,T.useState)(null),[m,p]=(0,T.useState)(null),[h,f]=(0,T.useState)(""),[x,g]=(0,T.useState)("created_at"),[y,b]=(0,T.useState)("desc"),[v,j]=(0,T.useState)(1),[w,k]=(0,T.useState)(!0),[S,N]=(0,T.useState)({}),M=(0,T.useDeferredValue)(l),C=l||M,L=(0,T.useCallback)(async()=>{if(e){i(!0),d(null);try{let t=await (0,Q.fetchToolsList)(e);a(t)}catch(e){d(e.message??"Failed to load tools")}finally{i(!1),n(!1)}}},[e]);(0,T.useEffect)(()=>{L()},[L]),(0,T.useEffect)(()=>{if(!w)return;let e=setInterval(L,15e3);return()=>clearInterval(e)},[w,L]);let O=async(t,r)=>{if(e){u(t);try{await (0,Q.updateToolPolicy)(e,t,{input_policy:r}),a(e=>e.map(e=>e.tool_name===t?{...e,input_policy:r}:e))}catch(e){alert(`Failed to update input policy: ${e.message}`)}finally{u(null)}}},D=async(t,r)=>{if(e){p(t);try{await (0,Q.updateToolPolicy)(e,t,{output_policy:r}),a(e=>e.map(e=>e.tool_name===t?{...e,output_policy:r}:e))}catch(e){alert(`Failed to update output policy: ${e.message}`)}finally{p(null)}}},P=Array.from(new Set(r.map(e=>e.team_id).filter(Boolean))).map(e=>({label:e,value:e})),B=Array.from(new Set(r.map(e=>e.key_alias).filter(Boolean))).map(e=>({label:e,value:e})),z=[{name:"Input Policy",label:"Input Policy",options:FM.map(e=>({label:e.label,value:e.value}))},{name:"Output Policy",label:"Output Policy",options:FC.map(e=>({label:e.label,value:e.value}))},{name:"Team Name",label:"Team Name",options:P},{name:"Key Name",label:"Key Name",options:B}],{newToday:H,newYesterday:$,trendSubtitle:q,totalTools:U,blockedCount:W,activeTeamsCount:V,needsReviewTools:G}=(0,T.useMemo)(()=>{let e=new Date,t=FE(e),a=new Date(e);a.setUTCDate(a.getUTCDate()-1);let s=FE(a),n=FY(r,t),l=FY(r,s),i=function(e,t){let r=e-t;if(0!==r)return r>0?`+${r} since yesterday`:`${r} since yesterday`}(n,l),o=r.length,d=r.filter(e=>"blocked"===e.input_policy).length;return{newToday:n,newYesterday:l,trendSubtitle:i,totalTools:o,blockedCount:d,activeTeamsCount:new Set(r.map(e=>e.team_id).filter(Boolean)).size,needsReviewTools:r.filter(e=>FI(e.created_at,t)&&"untrusted"===e.input_policy)}},[r]),K=({label:e,field:t})=>(0,_.jsxs)("div",{className:"flex items-center gap-1",children:[(0,_.jsx)("span",{children:e}),(0,_.jsx)(YT.TableHeaderSortDropdown,{sortState:x===t&&y,onSortChange:e=>{!1===e?(g("created_at"),b("desc")):(g(t),b(e)),j(1)}})]}),J=r.filter(e=>{if(h){let t=h.toLowerCase();if(!(e.tool_name.toLowerCase().includes(t)||(e.team_id??"").toLowerCase().includes(t)||(e.key_alias??"").toLowerCase().includes(t)||(e.key_hash??"").toLowerCase().includes(t)||e.input_policy.toLowerCase().includes(t)||e.output_policy.toLowerCase().includes(t)))return!1}return(!S["Input Policy"]||e.input_policy===S["Input Policy"])&&(!S["Output Policy"]||e.output_policy===S["Output Policy"])&&(!S["Team Name"]||e.team_id===S["Team Name"])&&(!S["Key Name"]||e.key_alias===S["Key Name"])}),X=[...J].sort((e,t)=>{let r=e[x]??"",a=t[x]??"";return ra?"desc"===y?-1:1:0}),Z=Math.max(1,Math.ceil(X.length/50)),ee=X.slice((v-1)*50,50*v);return(0,_.jsxs)("div",{className:"w-full",children:[(0,_.jsx)("h1",{className:"text-2xl font-semibold text-gray-900 mb-6",children:"Tool Policies"}),(0,_.jsxs)("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4 mb-6",children:[(0,_.jsx)(N5,{label:"New Today",value:H,valueColor:"text-green-600",subtitle:q,icon:(0,_.jsx)("svg",{className:"w-4 h-4 text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"})})}),(0,_.jsx)(N5,{label:"Total Tools Discovered",value:U}),(0,_.jsx)(N5,{label:"Blocked Tools",value:W,valueColor:W>0?"text-red-600":void 0}),(0,_.jsx)(N5,{label:"Active Teams",value:V>0?V:"—"})]}),G.length>0&&(0,_.jsxs)("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4 mb-6",children:[(0,_.jsx)("h2",{className:"text-sm font-semibold text-amber-900 mb-1",children:"Needs Review"}),(0,_.jsxs)("p",{className:"text-sm text-amber-800 mb-3",children:[G.length," new tool",1!==G.length?"s":""," discovered that require policy decisions."]}),(0,_.jsx)("div",{className:"flex flex-wrap gap-2",children:G.map(e=>(0,_.jsxs)("span",{className:"inline-flex items-center gap-2 px-3 py-1.5 bg-white border border-amber-200 rounded-md text-sm",children:[(0,_.jsx)("span",{className:"font-mono text-amber-900 truncate max-w-[200px]",title:e.tool_name,children:e.tool_name}),(0,_.jsx)("button",{type:"button",onClick:()=>(e=>{let t=X.findIndex(t=>t.tool_id===e);if(t>=0){let r=Math.floor(t/50)+1;r!==v&&j(r),requestAnimationFrame(()=>{setTimeout(()=>{document.getElementById(`tool-row-${e}`)?.scrollIntoView({behavior:"smooth",block:"center"})},100)})}})(e.tool_id),className:"text-amber-700 hover:text-amber-900 font-medium text-xs whitespace-nowrap",children:"Review"})]},e.tool_id))})]}),(0,_.jsxs)("div",{className:"bg-white rounded-lg shadow w-full max-w-full box-border",children:[(0,_.jsxs)("div",{className:"border-b px-6 py-4 w-full max-w-full box-border",children:[(0,_.jsxs)("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between space-y-4 md:space-y-0 w-full max-w-full box-border",children:[(0,_.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,_.jsxs)("div",{className:"relative w-64",children:[(0,_.jsx)("input",{type:"text",placeholder:"Search by Tool Name",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:h,onChange:e=>{f(e.target.value),j(1)}}),(0,_.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("span",{className:"text-sm font-medium text-gray-900",children:"Live Tail"}),(0,_.jsx)(e_.Switch,{checked:w,onChange:k})]}),(0,_.jsxs)("button",{onClick:L,disabled:C,className:"flex items-center gap-1.5 px-3 py-2 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-60",children:[(0,_.jsx)("svg",{className:`w-4 h-4 ${C?"animate-spin":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),C?"Fetching":"Fetch"]})]}),(0,_.jsxs)("div",{className:"flex items-center gap-4 text-sm text-gray-600 whitespace-nowrap",children:[(0,_.jsxs)("span",{children:["Showing ",0===J.length?0:(v-1)*50+1," -"," ",Math.min(50*v,J.length)," of ",J.length," results"]}),(0,_.jsxs)("span",{children:["Page ",v," of ",Z]}),(0,_.jsxs)("div",{className:"flex gap-1",children:[(0,_.jsx)("button",{onClick:()=>j(e=>Math.max(1,e-1)),disabled:1===v,className:"px-3 py-1.5 border rounded-md text-sm hover:bg-gray-50 disabled:opacity-40",children:"Previous"}),(0,_.jsx)("button",{onClick:()=>j(e=>Math.min(Z,e+1)),disabled:v===Z,className:"px-3 py-1.5 border rounded-md text-sm hover:bg-gray-50 disabled:opacity-40",children:"Next"})]})]})]}),(0,_.jsx)("div",{className:"mt-3",children:(0,_.jsx)(FA.default,{options:z,onApplyFilters:e=>{N(e),j(1)},onResetFilters:()=>{N({}),j(1)},buttonLabel:"Filters"})})]}),w&&(0,_.jsxs)("div",{className:"bg-green-50 border-b border-green-100 px-6 py-2 flex items-center justify-between",children:[(0,_.jsx)("span",{className:"text-sm text-green-700",children:"Auto-refreshing every 15 seconds"}),(0,_.jsx)("button",{onClick:()=>k(!1),className:"text-xs text-green-600 underline",children:"Stop"})]}),o&&(0,_.jsx)("div",{className:"mx-6 mt-4 p-3 bg-red-50 border border-red-200 rounded text-sm text-red-700",children:o}),(0,_.jsxs)(A.Table,{className:"[&_td]:py-0.5 [&_th]:py-1 w-full",children:[(0,_.jsx)(Y.TableHead,{children:(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:(0,_.jsx)(K,{label:"Discovered",field:"created_at"})}),(0,_.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:(0,_.jsx)(K,{label:"Tool Name",field:"tool_name"})}),(0,_.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:(0,_.jsx)(K,{label:"Input Policy",field:"input_policy"})}),(0,_.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:(0,_.jsx)(K,{label:"Output Policy",field:"output_policy"})}),(0,_.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:(0,_.jsx)(K,{label:"# Calls",field:"call_count"})}),(0,_.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:(0,_.jsx)(K,{label:"Team Name",field:"team_id"})}),(0,_.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:"Key Hash"}),(0,_.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:(0,_.jsx)(K,{label:"Key Name",field:"key_alias"})}),(0,_.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:"User Agent"})]})}),(0,_.jsx)(E.TableBody,{children:s?(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:9,className:"h-8 text-center text-gray-500",children:"Loading tools…"})}):0===ee.length?(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:9,className:"h-8 text-center text-gray-500",children:"No tools discovered yet. Make a chat completion that returns tool_calls to start auto-discovery."})}):ee.map(e=>(0,_.jsxs)(R.TableRow,{id:`tool-row-${e.tool_id}`,className:"h-8 hover:bg-gray-50",children:[(0,_.jsx)(I.TableCell,{className:"py-0.5 max-h-8 overflow-hidden whitespace-nowrap",children:(0,_.jsx)(FP,{utcTime:e.created_at??""})}),(0,_.jsx)(I.TableCell,{className:"py-0.5 max-h-8 overflow-hidden",children:(0,_.jsx)("button",{type:"button",onClick:()=>t?.(e.tool_name),className:"text-left w-full font-mono text-xs max-w-[20ch] truncate block font-medium text-blue-600 hover:text-blue-800 hover:underline focus:outline-none focus:ring-0",children:(0,_.jsx)(tB.Tooltip,{title:t?"Click to view details and block for team/key":e.tool_name,children:(0,_.jsx)("span",{children:e.tool_name})})})}),(0,_.jsx)(I.TableCell,{className:"py-0.5 max-h-8",children:(0,_.jsx)(FL,{value:e.input_policy,toolName:e.tool_name,saving:c===e.tool_name,onChange:O,policyType:"input"})}),(0,_.jsx)(I.TableCell,{className:"py-0.5 max-h-8",children:(0,_.jsx)(FL,{value:e.output_policy,toolName:e.tool_name,saving:m===e.tool_name,onChange:D,policyType:"output"})}),(0,_.jsx)(I.TableCell,{className:"py-0.5 max-h-8",children:(0,_.jsx)("div",{className:"flex items-center justify-end h-8 tabular-nums text-sm font-mono text-gray-700",children:(e.call_count??0).toLocaleString()})}),(0,_.jsx)(I.TableCell,{className:"py-0.5 max-h-8 overflow-hidden whitespace-nowrap",children:(0,_.jsx)(tB.Tooltip,{title:e.team_id??"-",children:(0,_.jsx)("span",{className:"max-w-[15ch] truncate block",children:e.team_id??"-"})})}),(0,_.jsx)(I.TableCell,{className:"py-0.5 max-h-8 overflow-hidden whitespace-nowrap",children:(0,_.jsx)(tB.Tooltip,{title:e.key_hash??"-",children:(0,_.jsx)("span",{className:"font-mono max-w-[15ch] truncate block text-blue-600",children:e.key_hash??"-"})})}),(0,_.jsx)(I.TableCell,{className:"py-0.5 max-h-8 overflow-hidden whitespace-nowrap",children:(0,_.jsx)(tB.Tooltip,{title:e.key_alias??"-",children:(0,_.jsx)("span",{className:"max-w-[15ch] truncate block",children:e.key_alias??"-"})})}),(0,_.jsx)(I.TableCell,{className:"py-0.5 max-h-8 overflow-hidden whitespace-nowrap",children:(0,_.jsx)(tB.Tooltip,{title:e.user_agent??"-",children:(0,_.jsx)("span",{className:"font-mono max-w-[20ch] truncate block text-xs text-gray-500",children:e.user_agent??"-"})})})]},e.tool_id))})]}),Z>1&&(0,_.jsxs)("div",{className:"border-t px-6 py-3 flex items-center justify-between text-sm text-gray-600",children:[(0,_.jsxs)("span",{children:["Showing ",(v-1)*50+1," - ",Math.min(50*v,X.length)," of"," ",X.length]}),(0,_.jsxs)("div",{className:"flex gap-1",children:[(0,_.jsx)("button",{onClick:()=>j(e=>Math.max(1,e-1)),disabled:1===v,className:"px-3 py-1.5 border rounded-md hover:bg-gray-50 disabled:opacity-40",children:"Previous"}),(0,_.jsx)("button",{onClick:()=>j(e=>Math.min(Z,e+1)),disabled:v===Z,className:"px-3 py-1.5 border rounded-md hover:bg-gray-50 disabled:opacity-40",children:"Next"})]})]})]})]})};function FR({accessToken:e,userRole:t}){let[r,a]=(0,T.useState)({type:"overview"});return(0,_.jsx)("div",{className:"p-6 w-full min-w-0 flex-1",children:"detail"===r.type?(0,_.jsx)(FD,{toolName:r.toolName,onBack:()=>{a({type:"overview"})},accessToken:e}):(0,_.jsx)(FF,{accessToken:e,userRole:t,onSelectTool:e=>{a({type:"detail",toolName:e})}})})}var Fg=Fg;let{Text:FB}=V.Typography,Fz=({open:e,mode:t,initialRow:r,onClose:a,onSave:s})=>{let[n]=H.Form.useForm(),[l,i]=(0,T.useState)(!1);(0,T.useEffect)(()=>{e&&("edit"===t&&r?n.setFieldsValue({key:r.key,value:r.value,metadata:null!=r.metadata?JSON.stringify(r.metadata,null,2):""}):n.resetFields())},[e,t,r,n]);let o=async()=>{let e=await n.validateFields();i(!0);let r=await s(e.key.trim(),e.value??"",e.metadata??"","create"===t);i(!1),r&&(n.resetFields(),a())};return(0,_.jsx)(q.Modal,{open:e,title:"create"===t?"Create memory":`Edit ${r?.key??""}`,onCancel:()=>{n.resetFields(),a()},onOk:o,okText:"create"===t?"Create":"Save",confirmLoading:l,width:640,destroyOnClose:!0,children:(0,_.jsxs)(H.Form,{form:n,layout:"vertical",children:[(0,_.jsx)(H.Form.Item,{label:"Key",name:"key",rules:[{required:!0,message:"Key is required"}],tooltip:"Globally unique — two memories cannot share a key. Namespace your own keys if you need per-user isolation (e.g. user:123:notes).",children:(0,_.jsx)($.Input,{placeholder:"e.g. user_role",disabled:"edit"===t})}),(0,_.jsx)(H.Form.Item,{label:"Value",name:"value",rules:[{required:!0,message:"Value is required"}],tooltip:"Markdown/text injected into LLM context. Plain strings are fine.",children:(0,_.jsx)($.Input.TextArea,{rows:8,placeholder:"What the agent should remember…"})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Metadata ",(0,_.jsx)(FB,{type:"secondary",children:"(optional JSON)"})]}),name:"metadata",tooltip:"Optional structured metadata — must be valid JSON if provided.",children:(0,_.jsx)($.Input.TextArea,{rows:4,placeholder:'{"tags": ["example"]}',style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace"}})})]})})},{Text:FH,Paragraph:F$,Title:Fq}=V.Typography;function FU(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}let FW=({accessToken:e})=>{let[t,r]=(0,T.useState)(""),[a,s]=(0,T.useState)(""),[n,l]=(0,T.useState)(null),[i,o]=(0,T.useState)(null),[d,c]=(0,T.useState)(null),[u,m]=(0,T.useState)(!1),[p,h]=(0,T.useState)(1);T.default.useEffect(()=>{h(1)},[a]);let f=(0,eh.useQueryClient)(),x="memoryList",{data:g,isLoading:y,isFetching:b}=(0,ev.useQuery)({queryKey:[x,a,p],queryFn:()=>{if(!e)throw Error("Access token required");return(0,Q.fetchMemoryList)(e,{keyPrefix:a||void 0,page:p,pageSize:50})},enabled:!!e}),v=(0,T.useMemo)(()=>g?.memories??[],[g]),j=g?.total??0,w=()=>f.invalidateQueries({queryKey:[x]}),k=(0,ep.useMutation)({mutationFn:t=>{if(!e)throw Error("Access token required");return(0,Q.createMemory)(e,t)},onSuccess:e=>{LB.message.success(`Created ${e.key}`),w()},onError:e=>{LB.message.error(`Save failed: ${e.message}`)}}),S=(0,ep.useMutation)({mutationFn:t=>{if(!e)throw Error("Access token required");let{key:r,...a}=t;return(0,Q.updateMemory)(e,r,a)},onSuccess:e=>{LB.message.success(`Updated ${e.key}`),w()},onError:e=>{LB.message.error(`Save failed: ${e.message}`)}}),N=(0,ep.useMutation)({mutationFn:t=>{if(!e)throw Error("Access token required");return(0,Q.deleteMemory)(e,t).then(()=>t)},onSuccess:e=>{LB.message.success(`Deleted ${e}`),w()},onError:e=>{LB.message.error(`Delete failed: ${e.message}`)}}),M=async()=>{if(d)try{await N.mutateAsync(d.key),c(null)}catch{}},C=async(t,r,a,s)=>{let n;if(!e)return!1;if(a.trim())try{n=JSON.parse(a)}catch{return LB.message.error("Metadata must be valid JSON (or leave empty)."),!1}else n=s?void 0:null;try{return s?await k.mutateAsync({key:t,value:r,metadata:n}):await S.mutateAsync({key:t,value:r,metadata:n}),!0}catch{return!1}},L=(e,t)=>{if(!e)return(0,_.jsx)(FH,{type:"secondary",children:"-"});let r=e.length>10?`${e.slice(0,7)}...`:e,a="font-mono text-blue-600 bg-blue-50 text-xs font-medium px-2 py-0.5 rounded-md border border-blue-200 inline-block max-w-[15ch] truncate whitespace-nowrap";return(0,_.jsx)(tB.Tooltip,{title:e,children:t?(0,_.jsx)("button",{onClick:t,className:`${a} hover:bg-blue-100 cursor-pointer transition-colors text-left`,children:r}):(0,_.jsx)("span",{className:a,children:r})})},O=[{title:"ID",dataIndex:"memory_id",key:"memory_id",width:140,render:(e,t)=>L(t.memory_id,()=>l(t))},{title:"Name",dataIndex:"key",key:"key",width:200,render:e=>(0,_.jsx)(FH,{code:!0,children:e})},{title:"Preview",dataIndex:"value",key:"value",render:e=>(0,_.jsx)(FH,{type:"secondary",style:{whiteSpace:"pre-wrap"},children:function(e,t=120){if(!e)return"";let r=e.trim();return r.length<=t?r:`${r.slice(0,t)}…`}(e)})},{title:"User ID",dataIndex:"user_id",key:"user_id",width:160,render:e=>L(e)},{title:"Team ID",dataIndex:"team_id",key:"team_id",width:160,render:e=>L(e)},{title:"Updated",dataIndex:"updated_at",key:"updated_at",width:180,render:e=>(0,_.jsx)(FH,{type:"secondary",children:FU(e)})},{title:"",key:"actions",width:140,render:(e,t)=>(0,_.jsxs)(U.Space,{size:4,children:[(0,_.jsx)(z.Button,{size:"small",type:"text",icon:(0,_.jsx)(Fg.default,{}),onClick:()=>l(t),"aria-label":"View"}),(0,_.jsx)(z.Button,{size:"small",type:"text",icon:(0,_.jsx)(wX.EditOutlined,{}),onClick:()=>o(t),"aria-label":"Edit"}),(0,_.jsx)(z.Button,{size:"small",type:"text",danger:!0,icon:(0,_.jsx)(jQ.DeleteOutlined,{}),onClick:()=>{c(t)},"aria-label":"Delete"})]})}];return(0,_.jsxs)("div",{className:"w-full",style:{padding:24},children:[(0,_.jsxs)(U.Space,{direction:"vertical",size:"large",style:{width:"100%"},children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Fq,{level:3,style:{marginBottom:4},children:"Memory"}),(0,_.jsxs)(F$,{type:"secondary",style:{marginBottom:0},children:["Inspect what your agents have stored under ",(0,_.jsx)(FH,{code:!0,children:"/v1/memory"}),". Scoped to memories visible to your user / team (admins see all)."]})]}),(0,_.jsxs)(eg.Card,{children:[(0,_.jsxs)(U.Space,{style:{width:"100%",justifyContent:"space-between",marginBottom:16},wrap:!0,children:[(0,_.jsxs)(U.Space,{children:[(0,_.jsx)($.Input,{allowClear:!0,placeholder:'Filter by key prefix, e.g. "user:"',prefix:(0,_.jsx)(ry.SearchOutlined,{}),value:t,onChange:e=>r(e.target.value),onPressEnter:()=>s(t.trim()),onClear:()=>{r(""),s("")},style:{width:280}}),(0,_.jsx)(z.Button,{type:"primary",ghost:!0,onClick:()=>s(t.trim()),children:"Search"}),(0,_.jsx)(z.Button,{icon:(0,_.jsx)(rg.ReloadOutlined,{}),onClick:()=>w(),loading:b&&!y,children:"Refresh"})]}),(0,_.jsx)(z.Button,{type:"primary",icon:(0,_.jsx)(tZ.PlusOutlined,{}),onClick:()=>m(!0),children:"New memory"})]}),(0,_.jsx)(eK.Table,{rowKey:"memory_id",loading:y,dataSource:v,columns:O,pagination:{current:p,pageSize:50,total:j,showSizeChanger:!1,showTotal:(e,t)=>`${t[0]}–${t[1]} of ${e}`,onChange:e=>h(e)},locale:{emptyText:(0,_.jsx)(e0.Empty,{description:a?`No memories with keys starting with "${a}"`:"No memories stored yet"})}})]})]}),(0,_.jsx)(kJ,{open:!!n,onClose:()=>l(null),title:n?(0,_.jsx)(U.Space,{children:(0,_.jsx)(FH,{code:!0,children:n.key})}):"Memory",width:720,destroyOnClose:!0,children:n&&(0,_.jsxs)(U.Space,{direction:"vertical",size:"middle",style:{width:"100%"},children:[(0,_.jsxs)(U.Space,{size:"large",wrap:!0,children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(FH,{strong:!0,style:{display:"block"},children:"Memory ID"}),(0,_.jsx)(FH,{code:!0,style:{fontSize:12},children:n.memory_id})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(FH,{strong:!0,style:{display:"block"},children:"User ID"}),(0,_.jsx)(FH,{type:n.user_id?void 0:"secondary",children:n.user_id??"-"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(FH,{strong:!0,style:{display:"block"},children:"Team ID"}),(0,_.jsx)(FH,{type:n.team_id?void 0:"secondary",children:n.team_id??"-"})]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(FH,{strong:!0,children:"Value"}),(0,_.jsx)(F$,{style:{background:"#fafafa",padding:12,borderRadius:6,whiteSpace:"pre-wrap",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:13},children:n.value})]}),void 0!==n.metadata&&null!==n.metadata&&(0,_.jsxs)("div",{children:[(0,_.jsx)(FH,{strong:!0,children:"Metadata"}),(0,_.jsx)(F$,{style:{background:"#fafafa",padding:12,borderRadius:6,whiteSpace:"pre-wrap",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:12},children:JSON.stringify(n.metadata,null,2)})]}),(0,_.jsxs)(U.Space,{split:(0,_.jsx)(FH,{type:"secondary",children:"·"}),wrap:!0,size:"small",style:{color:"rgba(0,0,0,0.45)"},children:[(0,_.jsxs)(FH,{type:"secondary",children:["Created ",FU(n.created_at),n.created_by?` by ${n.created_by}`:""]}),(0,_.jsxs)(FH,{type:"secondary",children:["Updated ",FU(n.updated_at),n.updated_by?` by ${n.updated_by}`:""]})]})]})}),(0,_.jsx)(Fz,{open:u||!!i,mode:i?"edit":"create",initialRow:i??void 0,onClose:()=>{m(!1),o(null)},onSave:C}),(0,_.jsx)(eH.default,{isOpen:!!d,title:"Delete memory",message:"This action cannot be undone.",resourceInformationTitle:"Memory",resourceInformation:d?[{label:"Key",value:d.key,code:!0},{label:"Memory ID",value:d.memory_id,code:!0},{label:"User ID",value:d.user_id??"-",code:!0},{label:"Team ID",value:d.team_id??"-",code:!0}]:[],onCancel:()=>{N.isPending||c(null)},onOk:M,confirmLoading:N.isPending,requiredConfirmation:d?.key})]})},{Text:FV}=V.Typography,FG={pending:"#a1a1aa",running:"#3b82f6",paused:"#f59e0b",completed:"#22c55e",failed:"#ef4444"},FK={"step.started":{bar:"#f0fdf4",border:"#86efac",text:"#16a34a"},"step.failed":{bar:"#fef2f2",border:"#fca5a5",text:"#dc2626"},"hook.waiting":{bar:"#fffbeb",border:"#fcd34d",text:"#d97706"},"hook.received":{bar:"#eff6ff",border:"#93c5fd",text:"#2563eb"}};function FJ(e){let t=Date.now()-new Date(e).getTime();if(isNaN(t))return e;let r=Math.floor(t/1e3);if(r<60)return`${r}s ago`;let a=Math.floor(r/60);if(a<60)return`${a}m ago`;let s=Math.floor(a/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function FQ(e){return e<0?"":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function FX(e){let t=e.metadata?.title;return t?String(t):e.workflow_type??e.run_id.slice(0,8)}function FZ(e){return e.slice(0,8)}let F0=({status:e,size:t=8})=>(0,_.jsx)("span",{style:{display:"inline-block",width:t,height:t,borderRadius:"50%",background:FG[e]??"#a1a1aa",flexShrink:0}}),F1=({value:e})=>{let[t,r]=(0,T.useState)(!1);return e.length<=120?(0,_.jsx)("span",{style:{color:"#27272a",wordBreak:"break-all"},children:e}):(0,_.jsxs)("span",{style:{color:"#27272a",wordBreak:"break-all"},children:[t?e:e.slice(0,120)+"…",(0,_.jsx)("button",{onClick:()=>r(e=>!e),style:{background:"none",border:"none",padding:"0 4px",cursor:"pointer",color:"#2563eb",fontSize:11,flexShrink:0},children:t?"less":"more"})]})},F2=({run:e})=>{let t=e.metadata??{},r=[{key:"state",label:"state"},{key:"worktree_path",label:"worktree"},{key:"grill_session_id",label:"grill session"},{key:"session_id",label:"session"}],a=new Set(["title",...r.map(e=>e.key)]),s=Object.entries(t).filter(([e,t])=>!a.has(e)&&null!=t&&""!==t);return(0,_.jsxs)("div",{style:{borderRadius:8,border:"1px solid #e4e4e7",marginBottom:16,overflow:"hidden"},children:[(0,_.jsxs)("div",{style:{padding:"14px 20px",borderBottom:"1px solid #f4f4f5",display:"flex",alignItems:"center",gap:10},children:[(0,_.jsx)(F0,{status:e.status,size:10}),(0,_.jsx)("span",{style:{fontSize:14,fontWeight:600,color:"#18181b",flex:1},children:FX(e)}),(0,_.jsx)("span",{style:{fontFamily:"monospace",fontSize:11,color:"#a1a1aa",background:"#f4f4f5",padding:"2px 8px",borderRadius:4},children:FZ(e.run_id)}),(0,_.jsx)("span",{style:{fontSize:11,color:"#a1a1aa",background:"#f4f4f5",padding:"2px 8px",borderRadius:4},children:e.workflow_type})]}),(0,_.jsxs)("div",{style:{padding:"12px 20px",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:"8px 24px",fontFamily:"monospace",fontSize:12},children:[(0,_.jsx)(F4,{label:"status",children:(0,_.jsx)("span",{style:{textTransform:"capitalize",color:"#27272a"},children:e.status})}),(0,_.jsx)(F4,{label:"created",children:(0,_.jsx)("span",{style:{color:"#27272a"},children:FJ(e.created_at)})}),t.pr_url&&(0,_.jsx)(F4,{label:"pr",children:(0,_.jsx)("a",{href:String(t.pr_url),target:"_blank",rel:"noopener noreferrer",style:{color:"#2563eb",textDecoration:"none",wordBreak:"break-all"},children:String(t.pr_url)})}),r.map(({key:e,label:r})=>{let a=t[e];if(null==a||""===a)return null;let s="object"==typeof a?JSON.stringify(a):String(a);return(0,_.jsx)(F4,{label:r,children:(0,_.jsx)(F1,{value:s})},e)}),s.map(([e,t])=>{let r="object"==typeof t?JSON.stringify(t):String(t);return(0,_.jsx)(F4,{label:e,children:(0,_.jsx)(F1,{value:r})},e)})]})]})},F4=({label:e,children:t})=>(0,_.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:1},children:[(0,_.jsx)("span",{style:{fontSize:10,color:"#a1a1aa",textTransform:"uppercase",letterSpacing:"0.06em"},children:e}),(0,_.jsx)("span",{style:{fontSize:12},children:t})]}),F5=({run:e,events:t})=>{if(0===t.length)return(0,_.jsx)("div",{style:{padding:"16px 0",color:"#a1a1aa",fontSize:12,fontFamily:"monospace"},children:"No events recorded"});let r=new Date(e.created_at).getTime(),a=Math.max(...t.map(e=>new Date(e.created_at).getTime())),s=Math.max(a-r,1),n=FQ(a-r);return(0,_.jsxs)("div",{style:{fontFamily:"monospace",fontSize:12},children:[(0,_.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"160px 1fr",gap:"0 12px",marginBottom:2},children:[(0,_.jsx)("div",{}),(0,_.jsx)("div",{style:{position:"relative",height:16},children:[0,100].map(e=>(0,_.jsx)("span",{style:{position:"absolute",left:`${e}%`,transform:100===e?"translateX(-100%)":void 0,fontSize:10,color:"#a1a1aa"},children:0===e?"0":n},e))})]}),(0,_.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"160px 1fr",gap:"0 12px",marginBottom:4},children:[(0,_.jsx)("div",{style:{color:"#3f3f46",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingTop:2},children:FX(e)}),(0,_.jsx)("div",{style:{height:24,background:"#f4f4f5",border:"1px solid #d4d4d8",borderRadius:4,display:"flex",alignItems:"center",paddingLeft:8},children:(0,_.jsx)("span",{style:{color:"#71717a",fontSize:11},children:n})})]}),(0,_.jsx)("div",{style:{display:"grid",gridTemplateColumns:"160px 1fr",gap:"0 12px",rowGap:3},children:t.map(e=>{let n=new Date(e.created_at).getTime(),l=(n-r)/s*100,i=t.findIndex(t=>t.sequence_number>e.sequence_number),o=i>=0?new Date(t[i].created_at).getTime():a+Math.max(.12*s,500),d=Math.max(8,(o-n)/s*100),c=FK[e.event_type]??{bar:"#f4f4f5",border:"#d4d4d8",text:"#52525b"},u=FQ(o-n);return(0,_.jsxs)(T.default.Fragment,{children:[(0,_.jsx)("div",{style:{color:c.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingTop:2,paddingLeft:12},children:e.step_name||e.event_type}),(0,_.jsx)("div",{style:{position:"relative",height:24},children:(0,_.jsx)(tB.Tooltip,{title:(0,_.jsxs)("div",{style:{fontFamily:"monospace",fontSize:11,lineHeight:1.6},children:[(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{style:{color:"#a1a1aa"},children:"type: "}),(0,_.jsx)("span",{style:{color:c.text},children:e.event_type})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{style:{color:"#a1a1aa"},children:"step: "}),e.step_name]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{style:{color:"#a1a1aa"},children:"seq: "}),e.sequence_number]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{style:{color:"#a1a1aa"},children:"time: "}),FJ(e.created_at)]}),e.data&&Object.keys(e.data).length>0&&(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{style:{color:"#a1a1aa"},children:"data: "}),JSON.stringify(e.data)]})]}),children:(0,_.jsxs)("div",{style:{position:"absolute",left:`${Math.min(l,92)}%`,width:`${Math.min(d,100-Math.min(l,92))}%`,height:"100%",background:c.bar,border:`1px solid ${c.border}`,borderRadius:4,display:"flex",alignItems:"center",paddingLeft:8,cursor:"default",overflow:"hidden",gap:6},children:[(0,_.jsx)("span",{style:{color:c.text,whiteSpace:"nowrap",fontSize:11},children:e.event_type}),u&&(0,_.jsx)("span",{style:{color:"#a1a1aa",whiteSpace:"nowrap",fontSize:11},children:u})]})})})]},e.event_id)})})]})},F6=({msg:e})=>{let t={user:"#2563eb",assistant:"#16a34a",system:"#7c3aed",tool_result:"#d97706"}[e.role]??"#52525b";return(0,_.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"80px 1fr",gap:"0 16px",padding:"10px 0",borderBottom:"1px solid #f4f4f5",fontFamily:"monospace",fontSize:12,alignItems:"start"},children:[(0,_.jsxs)("span",{style:{color:t,paddingTop:1},children:["[",e.role,"]"]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{style:{color:"#27272a",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word",display:"block"},children:e.content}),(0,_.jsx)("span",{style:{color:"#a1a1aa",fontSize:11,marginTop:2,display:"block"},children:FJ(e.created_at)})]})]})},F3=({accessToken:e})=>{let[t,r]=(0,T.useState)([]),[a,s]=(0,T.useState)(!1),[n,l]=(0,T.useState)(null),[i,o]=(0,T.useState)([]),[d,c]=(0,T.useState)([]),[u,m]=(0,T.useState)(!1),[p,h]=(0,T.useState)(!1),f=(0,T.useCallback)(async()=>{if(e){s(!0);try{let t=await fetch(`${Q.proxyBaseUrl??""}/v1/workflows/runs?limit=100`,{headers:{Authorization:`Bearer ${e}`}});if(!t.ok)throw Error(`HTTP ${t.status}`);let a=await t.json();r(a.runs??[])}catch(e){console.error("workflow runs fetch failed:",e)}finally{s(!1)}}},[e]),x=(0,T.useCallback)(async t=>{if(e){l(t),h(!0),m(!0),o([]),c([]);try{let r=Q.proxyBaseUrl??"",[a,s]=await Promise.all([fetch(`${r}/v1/workflows/runs/${t.run_id}/events`,{headers:{Authorization:`Bearer ${e}`}}),fetch(`${r}/v1/workflows/runs/${t.run_id}/messages`,{headers:{Authorization:`Bearer ${e}`}})]),n=a.ok?await a.json():{events:[]},l=s.ok?await s.json():{messages:[]};o([...n.events??[]].sort((e,t)=>e.sequence_number-t.sequence_number)),c([...l.messages??[]].sort((e,t)=>e.sequence_number-t.sequence_number))}catch(e){console.error("workflow run detail fetch failed:",e)}finally{m(!1)}}},[e]);(0,T.useEffect)(()=>{f()},[f]);let g=[{title:"Run",dataIndex:"run_id",key:"run",render:(e,t)=>(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,_.jsx)(F0,{status:t.status,size:7}),(0,_.jsxs)("div",{children:[(0,_.jsx)("div",{style:{fontSize:13,color:"#18181b",fontWeight:500,lineHeight:1.4},children:FX(t)}),(0,_.jsx)("div",{style:{fontFamily:"monospace",fontSize:11,color:"#a1a1aa"},children:FZ(t.run_id)})]})]})},{title:"Type",dataIndex:"workflow_type",key:"workflow_type",render:e=>(0,_.jsx)("span",{style:{fontFamily:"monospace",fontSize:12,color:"#71717a"},children:e})},{title:"Status",dataIndex:"status",key:"status",render:(e,t)=>{let r=t.metadata?.state;return(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,_.jsx)(F0,{status:e,size:7}),(0,_.jsx)("span",{style:{fontSize:12,color:"#52525b",textTransform:"capitalize"},children:r??e})]})}},{title:"Created",dataIndex:"created_at",key:"created_at",render:e=>(0,_.jsx)("span",{style:{fontSize:12,color:"#a1a1aa"},children:FJ(e)})}];return(0,_.jsxs)("div",{style:{padding:"24px 32px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',minHeight:"calc(100vh - 64px)",background:"#fff"},children:[(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:20},children:[(0,_.jsxs)("div",{children:[(0,_.jsx)("div",{style:{fontSize:18,fontWeight:600,color:"#18181b"},children:"Workflow Runs"}),(0,_.jsx)("div",{style:{fontSize:13,color:"#71717a",marginTop:2},children:"Durable state tracking for agents and automated workflows"})]}),(0,_.jsx)(z.Button,{icon:(0,_.jsx)(rg.ReloadOutlined,{}),onClick:f,loading:a,style:{color:"#71717a",borderColor:"#e4e4e7"},children:"Refresh"})]}),(0,_.jsx)("div",{className:"rounded-lg custom-border overflow-x-auto w-full",children:(0,_.jsx)(eK.Table,{dataSource:t,columns:g,rowKey:"run_id",loading:a,size:"small",pagination:{pageSize:50,hideOnSinglePage:!0,size:"small"},onRow:e=>({onClick:()=>x(e),style:{cursor:"pointer"}}),locale:{emptyText:(0,_.jsx)(e0.Empty,{description:(0,_.jsx)("span",{style:{color:"#a1a1aa",fontSize:13},children:"No workflow runs yet"}),image:e0.Empty.PRESENTED_IMAGE_SIMPLE})},className:"[&_.ant-table-cell]:py-0.5 [&_.ant-table-thead_.ant-table-cell]:py-1",style:{border:"none"}})}),(0,_.jsx)(kJ,{open:p,onClose:()=>h(!1),width:680,title:null,closable:!1,bodyStyle:{padding:0},styles:{body:{padding:0}},children:n?u?(0,_.jsx)("div",{style:{display:"flex",justifyContent:"center",padding:80},children:(0,_.jsx)(rm.Spin,{})}):(0,_.jsxs)("div",{style:{padding:"24px 28px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:[(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[(0,_.jsx)("button",{onClick:()=>h(!1),style:{background:"none",border:"none",cursor:"pointer",padding:"4px 0",fontSize:12,color:"#a1a1aa",display:"flex",alignItems:"center",gap:4},children:"← close"}),(0,_.jsx)(z.Button,{size:"small",icon:(0,_.jsx)(rg.ReloadOutlined,{}),onClick:()=>x(n),loading:u,style:{color:"#71717a",borderColor:"#e4e4e7"},children:"Refresh"})]}),(0,_.jsx)(F2,{run:n}),(0,_.jsx)(tl.Collapse,{defaultActiveKey:["timeline"],ghost:!1,style:{border:"1px solid #e4e4e7",borderRadius:8,overflow:"hidden"},items:[{key:"timeline",label:(0,_.jsxs)("span",{style:{fontSize:12,fontWeight:500,color:"#3f3f46"},children:["Timeline",(0,_.jsxs)("span",{style:{marginLeft:6,fontSize:11,color:"#a1a1aa",fontWeight:400},children:[i.length," ",1===i.length?"event":"events"]})]}),children:(0,_.jsx)("div",{style:{padding:"4px 4px 12px"},children:(0,_.jsx)(F5,{run:n,events:i})})},{key:"messages",label:(0,_.jsxs)("span",{style:{fontSize:12,fontWeight:500,color:"#3f3f46"},children:["Messages",(0,_.jsx)("span",{style:{marginLeft:6,fontSize:11,color:"#a1a1aa",fontWeight:400},children:d.length})]}),children:0===d.length?(0,_.jsx)("div",{style:{padding:"12px 4px",color:"#a1a1aa",fontSize:12,fontFamily:"monospace"},children:"No messages"}):(0,_.jsx)("div",{style:{paddingBottom:4},children:d.map(e=>(0,_.jsx)(F6,{msg:e},e.message_id))})}]})]}):null})]})};var F8=e.i(207082);function F7({keys:e,totalCount:t,isLoading:r,isFetching:a,pageIndex:s,pageSize:n,onPageChange:l}){let[i,o]=(0,T.useState)([{id:"deleted_at",desc:!0}]),[d,c]=(0,T.useState)({pageIndex:s,pageSize:n});T.default.useEffect(()=>{c({pageIndex:s,pageSize:n})},[s,n]);let u=[{id:"token",accessorKey:"token",header:"Key ID",size:150,maxSize:250,cell:e=>{let t=e.getValue();return(0,_.jsx)(tB.Tooltip,{title:t,children:(0,_.jsx)("span",{className:"font-mono text-blue-500 text-xs truncate block max-w-[250px]",children:t||"-"})})}},{id:"key_alias",accessorKey:"key_alias",header:"Key Alias",size:150,maxSize:200,cell:e=>{let t=e.getValue();return(0,_.jsx)(tB.Tooltip,{title:t,children:(0,_.jsx)("span",{className:"font-mono text-xs truncate block max-w-[200px]",children:t??"-"})})}},{id:"team_alias",accessorKey:"team_alias",header:"Team Alias",size:120,maxSize:180,cell:e=>{let t=e.getValue();return(0,_.jsx)("span",{className:"truncate block max-w-[180px]",children:t||"-"})}},{id:"spend",accessorKey:"spend",header:"Spend (USD)",size:100,maxSize:140,cell:e=>(0,_.jsx)("span",{className:"block max-w-[140px]",children:(0,rV.formatNumberWithCommas)(e.getValue(),4)})},{id:"max_budget",accessorKey:"max_budget",header:"Budget (USD)",size:110,maxSize:150,cell:e=>{let t=e.getValue();return(0,_.jsx)("span",{className:"block max-w-[150px]",children:null===t?"Unlimited":`$${(0,rV.formatNumberWithCommas)(t)}`})}},{id:"user_email",accessorKey:"user_email",header:"User Email",size:160,maxSize:250,cell:e=>{let t=e.getValue();return(0,_.jsx)(tB.Tooltip,{title:t,children:(0,_.jsx)("span",{className:"font-mono text-xs truncate block max-w-[250px]",children:t??"-"})})}},{id:"user_id",accessorKey:"user_id",header:"User ID",size:120,maxSize:200,cell:e=>{let t=e.getValue();return(0,_.jsx)(tB.Tooltip,{title:t||void 0,children:(0,_.jsx)("span",{className:"truncate block max-w-[200px]",children:t||"-"})})}},{id:"created_at",accessorKey:"created_at",header:"Created At",size:120,maxSize:140,cell:e=>{let t=e.getValue();return(0,_.jsx)("span",{className:"block max-w-[140px]",children:t?new Date(t).toLocaleDateString():"-"})}},{id:"created_by",accessorKey:"created_by",header:"Created By",size:120,maxSize:180,cell:e=>{let t=e.row.original.created_by;return(0,_.jsx)(tB.Tooltip,{title:t||void 0,children:(0,_.jsx)("span",{className:"truncate block max-w-[180px]",children:t||"-"})})}},{id:"deleted_at",accessorKey:"deleted_at",header:"Deleted At",size:120,maxSize:140,cell:e=>{let t=e.row.original.deleted_at;return(0,_.jsx)("span",{className:"block max-w-[140px]",children:t?new Date(t).toLocaleDateString():"-"})}},{id:"deleted_by",accessorKey:"deleted_by",header:"Deleted By",size:120,maxSize:180,cell:e=>{let t=e.row.original.deleted_by;return(0,_.jsx)(tB.Tooltip,{title:t||void 0,children:(0,_.jsx)("span",{className:"truncate block max-w-[180px]",children:t||"-"})})}}],m=(0,jD.useReactTable)({data:e,columns:u,columnResizeMode:"onChange",columnResizeDirection:"ltr",state:{sorting:i,pagination:d},onSortingChange:o,onPaginationChange:e=>{let t="function"==typeof e?e(d):e;c(t),l(t.pageIndex)},getCoreRowModel:(0,jP.getCoreRowModel)(),getSortedRowModel:(0,jP.getSortedRowModel)(),getPaginationRowModel:(0,jP.getPaginationRowModel)(),enableSorting:!0,manualSorting:!1,manualPagination:!0,pageCount:Math.ceil(t/n)}),{pageIndex:p}=m.getState().pagination,h=p*n+1,f=Math.min((p+1)*n,t),x=`${h} - ${f}`;return(0,_.jsx)("div",{className:"w-full h-full overflow-hidden",children:(0,_.jsxs)("div",{className:"border-b py-4 flex-1 overflow-hidden",children:[(0,_.jsxs)("div",{className:"flex items-center justify-between w-full mb-4",children:[r||a?(0,_.jsx)("span",{className:"inline-flex text-sm text-gray-700",children:"Loading..."}):(0,_.jsxs)("span",{className:"inline-flex text-sm text-gray-700",children:["Showing ",x," of ",t," results"]}),(0,_.jsxs)("div",{className:"inline-flex items-center gap-2",children:[r||a?(0,_.jsx)("span",{className:"text-sm text-gray-700",children:"Loading..."}):(0,_.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",p+1," of ",m.getPageCount()]}),(0,_.jsx)("button",{onClick:()=>m.previousPage(),disabled:r||a||!m.getCanPreviousPage(),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,_.jsx)("button",{onClick:()=>m.nextPage(),disabled:r||a||!m.getCanNextPage(),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]}),(0,_.jsx)("div",{className:"h-[75vh] overflow-auto",children:(0,_.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,_.jsx)("div",{className:"overflow-x-auto",children:(0,_.jsxs)(A.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",style:{width:m.getCenterTotalSize()},children:[(0,_.jsx)(Y.TableHead,{children:m.getHeaderGroups().map(e=>(0,_.jsx)(R.TableRow,{children:e.headers.map(e=>(0,_.jsx)(F.TableHeaderCell,{"data-header-id":e.id,className:"py-1 h-8 relative hover:bg-gray-50",style:{width:e.getSize(),maxWidth:e.column.columnDef.maxSize,position:"relative"},onMouseEnter:()=>{let t=document.querySelector(`[data-header-id="${e.id}"] .resizer`);t&&(t.style.opacity="0.5")},onMouseLeave:()=>{let t=document.querySelector(`[data-header-id="${e.id}"] .resizer`);t&&!e.column.getIsResizing()&&(t.style.opacity="0")},onClick:e.column.getToggleSortingHandler(),children:(0,_.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,_.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,jD.flexRender)(e.column.columnDef.header,e.getContext())}),(0,_.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,_.jsx)(jC.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,_.jsx)(jM.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,_.jsx)(jL.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})}),(0,_.jsx)("div",{onDoubleClick:()=>e.column.resetSize(),onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:`resizer ${m.options.columnResizeDirection} ${e.column.getIsResizing()?"isResizing":""}`,style:{position:"absolute",right:0,top:0,height:"100%",width:"5px",background:e.column.getIsResizing()?"#3b82f6":"transparent",cursor:"col-resize",userSelect:"none",touchAction:"none",opacity:+!!e.column.getIsResizing()}})]})},e.id))},e.id))}),(0,_.jsx)(E.TableBody,{children:r||a?(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:u.length,className:"h-8 text-center",children:(0,_.jsx)("div",{className:"text-center text-gray-500",children:(0,_.jsx)("p",{children:"🚅 Loading keys..."})})})}):e.length>0?m.getRowModel().rows.map(e=>(0,_.jsx)(R.TableRow,{className:"h-8",children:e.getVisibleCells().map(e=>(0,_.jsx)(I.TableCell,{style:{width:e.column.getSize(),maxWidth:e.column.columnDef.maxSize,whiteSpace:"pre-wrap",overflow:"hidden"},className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,jD.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:u.length,className:"h-8 text-center",children:(0,_.jsx)("div",{className:"text-center text-gray-500",children:(0,_.jsx)("p",{children:"No deleted keys found"})})})})})]})})})})]})})}function F9(){let{premiumUser:e}=(0,k.default)(),[t,r]=(0,T.useState)(0),[a]=(0,T.useState)(50),{data:s,isPending:n,isFetching:l}=(0,F8.useDeletedKeys)(t+1,a);return(0,_.jsxs)("div",{className:"flex flex-col gap-4",children:[!e&&(0,_.jsx)(B.Alert,{type:"info",banner:!0,showIcon:!0,message:"Coming soon to Enterprise",description:"Deleted key auditing is graduating from beta into our Enterprise audit & compliance suite."}),(0,_.jsx)(F7,{keys:s?.keys||[],totalCount:s?.total_count||0,isLoading:n,isFetching:l,pageIndex:t,pageSize:a,onPageChange:r})]})}function Re({teams:e,isLoading:t,isFetching:r}){let[a,s]=(0,T.useState)([{id:"deleted_at",desc:!0}]),n=[{id:"team_alias",accessorKey:"team_alias",header:"Team Name",size:150,maxSize:200,cell:e=>{let t=e.getValue();return(0,_.jsx)(tB.Tooltip,{title:t||void 0,children:(0,_.jsx)("span",{className:"truncate block max-w-[200px]",children:t||"-"})})}},{id:"team_id",accessorKey:"team_id",header:"Team ID",size:150,maxSize:250,cell:e=>{let t=e.getValue();return(0,_.jsx)(tB.Tooltip,{title:t,children:(0,_.jsx)("span",{className:"font-mono text-blue-500 text-xs truncate block max-w-[250px]",children:t||"-"})})}},{id:"created_at",accessorKey:"created_at",header:"Created",size:120,maxSize:140,cell:e=>{let t=e.getValue();return(0,_.jsx)("span",{className:"block max-w-[140px]",children:t?new Date(t).toLocaleDateString():"-"})}},{id:"spend",accessorKey:"spend",header:"Spend (USD)",size:100,maxSize:140,cell:e=>{let t=e.row.original.spend;return(0,_.jsx)("span",{className:"block max-w-[140px]",children:void 0!==t?(0,rV.formatNumberWithCommas)(t,4):"-"})}},{id:"max_budget",accessorKey:"max_budget",header:"Budget (USD)",size:110,maxSize:150,cell:e=>{let t=e.getValue();return(0,_.jsx)("span",{className:"block max-w-[150px]",children:null==t?"No limit":`$${(0,rV.formatNumberWithCommas)(t)}`})}},{id:"models",accessorKey:"models",header:"Models",size:200,maxSize:300,cell:e=>{let t=e.getValue();return Array.isArray(t)&&0!==t.length?(0,_.jsxs)("div",{className:"flex flex-wrap gap-1 max-w-[300px]",children:[t.slice(0,3).map((e,t)=>"all-proxy-models"===e?(0,_.jsx)(tR.Badge,{size:"xs",color:"red",children:(0,_.jsx)(Z.Text,{children:"All Proxy Models"})},t):(0,_.jsx)(tR.Badge,{size:"xs",color:"blue",children:(0,_.jsx)(Z.Text,{children:e.length>30?`${(0,tQ.getModelDisplayName)(e).slice(0,30)}...`:(0,tQ.getModelDisplayName)(e)})},t)),t.length>3&&(0,_.jsx)(tR.Badge,{size:"xs",color:"gray",children:(0,_.jsxs)(Z.Text,{children:["+",t.length-3," ",t.length-3==1?"more model":"more models"]})})]}):(0,_.jsx)(tR.Badge,{size:"xs",color:"red",children:(0,_.jsx)(Z.Text,{children:"All Proxy Models"})})}},{id:"organization_id",accessorKey:"organization_id",header:"Organization",size:150,maxSize:200,cell:e=>{let t=e.getValue();return(0,_.jsx)(tB.Tooltip,{title:t||void 0,children:(0,_.jsx)("span",{className:"truncate block max-w-[200px]",children:t||"-"})})}},{id:"deleted_at",accessorKey:"deleted_at",header:"Deleted At",size:120,maxSize:140,cell:e=>{let t=e.row.original.deleted_at;return(0,_.jsx)("span",{className:"block max-w-[140px]",children:t?new Date(t).toLocaleDateString():"-"})}},{id:"deleted_by",accessorKey:"deleted_by",header:"Deleted By",size:120,maxSize:180,cell:e=>{let t=e.row.original.deleted_by;return(0,_.jsx)(tB.Tooltip,{title:t||void 0,children:(0,_.jsx)("span",{className:"truncate block max-w-[180px]",children:t||"-"})})}}],l=(0,jD.useReactTable)({data:e,columns:n,columnResizeMode:"onChange",columnResizeDirection:"ltr",state:{sorting:a},onSortingChange:s,getCoreRowModel:(0,jP.getCoreRowModel)(),getSortedRowModel:(0,jP.getSortedRowModel)(),enableSorting:!0,manualSorting:!1});return(0,_.jsx)("div",{className:"w-full h-full overflow-hidden",children:(0,_.jsxs)("div",{className:"border-b py-4 flex-1 overflow-hidden",children:[(0,_.jsx)("div",{className:"flex items-center justify-between w-full mb-4",children:t||r?(0,_.jsx)("span",{className:"inline-flex text-sm text-gray-700",children:"Loading..."}):(0,_.jsxs)("span",{className:"inline-flex text-sm text-gray-700",children:["Showing ",e.length," ",1===e.length?"team":"teams"]})}),(0,_.jsx)("div",{className:"h-[75vh] overflow-auto",children:(0,_.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,_.jsx)("div",{className:"overflow-x-auto",children:(0,_.jsxs)(A.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",style:{width:l.getCenterTotalSize()},children:[(0,_.jsx)(Y.TableHead,{children:l.getHeaderGroups().map(e=>(0,_.jsx)(R.TableRow,{children:e.headers.map(e=>(0,_.jsx)(F.TableHeaderCell,{"data-header-id":e.id,className:"py-1 h-8 relative hover:bg-gray-50",style:{width:e.getSize(),maxWidth:e.column.columnDef.maxSize,position:"relative"},onMouseEnter:()=>{let t=document.querySelector(`[data-header-id="${e.id}"] .resizer`);t&&(t.style.opacity="0.5")},onMouseLeave:()=>{let t=document.querySelector(`[data-header-id="${e.id}"] .resizer`);t&&!e.column.getIsResizing()&&(t.style.opacity="0")},onClick:e.column.getToggleSortingHandler(),children:(0,_.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,_.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,jD.flexRender)(e.column.columnDef.header,e.getContext())}),(0,_.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,_.jsx)(jC.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,_.jsx)(jM.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,_.jsx)(jL.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})}),(0,_.jsx)("div",{onDoubleClick:()=>e.column.resetSize(),onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:`resizer ${l.options.columnResizeDirection} ${e.column.getIsResizing()?"isResizing":""}`,style:{position:"absolute",right:0,top:0,height:"100%",width:"5px",background:e.column.getIsResizing()?"#3b82f6":"transparent",cursor:"col-resize",userSelect:"none",touchAction:"none",opacity:+!!e.column.getIsResizing()}})]})},e.id))},e.id))}),(0,_.jsx)(E.TableBody,{children:t||r?(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:n.length,className:"h-8 text-center",children:(0,_.jsx)("div",{className:"text-center text-gray-500",children:(0,_.jsx)("p",{children:"🚅 Loading teams..."})})})}):e.length>0?l.getRowModel().rows.map(e=>(0,_.jsx)(R.TableRow,{className:"h-8",children:e.getVisibleCells().map(e=>(0,_.jsx)(I.TableCell,{style:{width:e.column.getSize(),maxWidth:e.column.columnDef.maxSize,whiteSpace:"pre-wrap",overflow:"hidden"},className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,jD.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:n.length,className:"h-8 text-center",children:(0,_.jsx)("div",{className:"text-center text-gray-500",children:(0,_.jsx)("p",{children:"No deleted teams found"})})})})})]})})})})]})})}function Rt(){let{premiumUser:e}=(0,k.default)(),{data:t,isPending:r,isFetching:a}=(0,jY.useDeletedTeams)(1,100);return(0,_.jsxs)("div",{className:"flex flex-col gap-4",children:[!e&&(0,_.jsx)(B.Alert,{type:"info",banner:!0,showIcon:!0,message:"Coming soon to Enterprise",description:"Deleted team auditing is graduating from beta into our Enterprise audit & compliance suite."}),(0,_.jsx)(Re,{teams:t||[],isLoading:r,isFetching:a})]})}var Rr=e.i(619273),Ex=MV;let{Text:Ra}=V.Typography,Rs={LiteLLM_VerificationToken:"Keys",LiteLLM_TeamTable:"Teams",LiteLLM_UserTable:"Users",LiteLLM_OrganizationTable:"Organizations",LiteLLM_ProxyModelTable:"Models"},Rn={created:"green",updated:"blue",deleted:"red",rotated:"orange"};function Rl({label:e,value:t}){let[r,a]=(0,T.useState)(!1),s=(0,T.useCallback)(async()=>{try{let e=JSON.stringify(t,null,2);if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(e);else{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select(),document.execCommand("copy"),document.body.removeChild(t)}a(!0),setTimeout(()=>a(!1),2e3)}catch(e){console.error("Copy failed:",e)}},[t]);return(0,_.jsxs)("div",{className:"bg-white rounded border overflow-hidden",children:[(0,_.jsxs)("div",{className:"flex justify-between items-center px-3 py-2 border-b bg-gray-50",children:[(0,_.jsx)("span",{className:"text-xs font-semibold text-gray-600",children:e}),(0,_.jsx)("button",{onClick:s,className:"p-1 hover:bg-gray-200 rounded text-gray-500 hover:text-gray-700 transition-colors",title:"Copy JSON",children:r?(0,_.jsx)(kQ.CheckOutlined,{className:"text-green-600"}):(0,_.jsx)(ei.CopyOutlined,{})})]}),(0,_.jsx)("pre",{className:"p-3 bg-white text-xs font-mono overflow-auto max-h-96 whitespace-pre-wrap break-all m-0",children:JSON.stringify(t,null,2)})]})}function Ri({label:e,value:t}){return(0,_.jsxs)("div",{className:"flex items-start gap-2 py-1.5",children:[(0,_.jsx)("span",{className:"text-xs text-gray-500 w-36 shrink-0",children:e}),(0,_.jsx)("span",{className:"text-xs text-gray-900 break-all",children:t})]})}function Ro({log:e}){let{action:t,table_name:r,before_value:a,updated_values:s}=e,n="LiteLLM_VerificationToken"===r,l="updated"===t||"rotated"===t,i=a,o=s;if(l&&a&&s){let e={},t={};new Set([...Object.keys(a),...Object.keys(s)]).forEach(r=>{JSON.stringify(a[r])!==JSON.stringify(s[r])&&(r in a&&(e[r]=a[r]),r in s&&(t[r]=s[r]))}),Object.keys(a).forEach(r=>{r in s||r in e||(e[r]=a[r],t[r]=void 0)}),Object.keys(s).forEach(r=>{r in a||r in t||(t[r]=s[r],e[r]=void 0)}),i=Object.keys(e).length>0?e:{note:"No differing fields detected"},o=Object.keys(t).length>0?t:{note:"No differing fields detected"}}let d=(e,t)=>{if(!t||0===Object.keys(t).length)return(0,_.jsxs)("div",{className:"bg-white rounded border overflow-hidden",children:[(0,_.jsx)("div",{className:"flex items-center px-3 py-2 border-b bg-gray-50",children:(0,_.jsx)("span",{className:"text-xs font-semibold text-gray-600",children:e})}),(0,_.jsx)("p",{className:"px-3 py-3 text-xs text-gray-400 italic m-0",children:"N/A"})]});if(n&&l){let r=["token","spend","max_budget"];if(Object.keys(t).every(e=>r.includes(e))&&!("note"in t))return(0,_.jsxs)("div",{className:"bg-white rounded border overflow-hidden",children:[(0,_.jsx)("div",{className:"flex items-center px-3 py-2 border-b bg-gray-50",children:(0,_.jsx)("span",{className:"text-xs font-semibold text-gray-600",children:e})}),(0,_.jsxs)("div",{className:"px-3 py-3 space-y-1 text-xs",children:[void 0!==t.token&&(0,_.jsxs)("p",{children:[(0,_.jsx)("span",{className:"text-gray-500",children:"Token:"})," ",t.token??"N/A"]}),void 0!==t.spend&&(0,_.jsxs)("p",{children:[(0,_.jsx)("span",{className:"text-gray-500",children:"Spend:"})," $",Number(t.spend).toFixed(6)]}),void 0!==t.max_budget&&(0,_.jsxs)("p",{children:[(0,_.jsx)("span",{className:"text-gray-500",children:"Max Budget:"})," $",Number(t.max_budget).toFixed(6)]})]})]})}return(0,_.jsx)(Rl,{label:e,value:t})};return(0,_.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[d("Before",i),d("After",o)]})}function Rd({open:e,onClose:t,log:r}){if(!r)return null;let a=Rs[r.table_name]??r.table_name,s=Rn[r.action]??"default";return(0,_.jsxs)(kJ,{placement:"right",width:"60%",open:e,onClose:t,closable:!1,mask:!0,maskClosable:!0,styles:{body:{padding:0,display:"flex",flexDirection:"column"},header:{display:"none"}},children:[(0,_.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b bg-white shrink-0",children:[(0,_.jsxs)("div",{className:"flex items-center gap-3",children:[(0,_.jsx)(eN.Tag,{color:s,className:"capitalize m-0",children:r.action}),(0,_.jsx)("span",{className:"text-sm text-gray-500",children:kl.default.utc(r.updated_at).local().format("MMM D, YYYY HH:mm:ss")})]}),(0,_.jsx)("button",{onClick:t,className:"w-8 h-8 flex items-center justify-center rounded hover:bg-gray-100 text-gray-500","aria-label":"Close",children:(0,_.jsx)(kp.CloseOutlined,{})})]}),(0,_.jsxs)("div",{className:"px-6 py-5",children:[(0,_.jsxs)("div",{className:"bg-gray-50 border rounded-lg p-4 mb-5",children:[(0,_.jsx)("p",{className:"text-xs font-semibold text-gray-700 mb-2 uppercase tracking-wide",children:"Details"}),(0,_.jsx)(Ri,{label:"Table",value:a}),(0,_.jsx)(Ri,{label:"Object ID",value:(0,_.jsx)(Ra,{copyable:!0,className:"font-mono text-xs",children:r.object_id})}),(0,_.jsx)(Ri,{label:"Changed By",value:(0,_.jsx)(YC.default,{userId:r.changed_by})}),(0,_.jsx)(Ri,{label:"API Key (Hash)",value:r.changed_by_api_key?(0,_.jsx)(Ra,{copyable:!0,className:"font-mono text-xs break-all",children:r.changed_by_api_key}):"—"})]}),(0,_.jsx)(Ro,{log:r})]})]})}let{Search:Rc}=$.Input,Ru={LiteLLM_VerificationToken:"Keys",LiteLLM_TeamTable:"Teams",LiteLLM_UserTable:"Users",LiteLLM_OrganizationTable:"Organizations",LiteLLM_ProxyModelTable:"Models"},Rm={created:"green",updated:"blue",deleted:"red",rotated:"orange"};function Rp({userID:e,userRole:t,token:r,accessToken:a,isActive:s,premiumUser:n}){let[l,i]=(0,T.useState)(1),[o,d]=(0,T.useState)(""),[c,u]=(0,T.useState)(""),[m,p]=(0,T.useState)(""),[h,f]=(0,T.useState)(""),[x,g]=(0,T.useState)(void 0),[y,b]=(0,T.useState)(void 0),[v,j]=(0,T.useState)(null),[w,k]=(0,T.useState)(!1),S=(0,ev.useQuery)({queryKey:["audit_logs",l,50,o,c,m,h,x,y],queryFn:async()=>a&&r&&t&&e?(0,Q.uiAuditLogsCall)({accessToken:a,page:l,page_size:50,params:{object_id:o||void 0,changed_by:c||void 0,object_key_hash:m||void 0,object_team_id:h||void 0,action:x||void 0,table_name:y||void 0,sort_by:"updated_at",sort_order:"desc"}}):{audit_logs:[],total:0,page:1,page_size:50,total_pages:0},enabled:!!a&&!!r&&!!t&&!!e&&s,placeholderData:Rr.keepPreviousData}),N=[{title:"Timestamp",dataIndex:"updated_at",key:"updated_at",width:200,render:e=>(0,_.jsx)("span",{className:"font-mono text-xs whitespace-nowrap",children:kl.default.utc(e).local().format("MMM D, YYYY HH:mm:ss")})},{title:"Action",dataIndex:"action",key:"action",width:100,render:e=>(0,_.jsx)(eN.Tag,{color:Rm[e]??"default",className:"capitalize",children:e})},{title:"Table",dataIndex:"table_name",key:"table_name",width:130,render:e=>Ru[e]??e},{title:"Object ID",dataIndex:"object_id",key:"object_id",render:e=>(0,_.jsx)("span",{className:"font-mono text-xs",children:e})},{title:"Changed By",dataIndex:"changed_by",key:"changed_by",width:200,render:e=>(0,_.jsx)(YC.default,{userId:e})},{title:"API Key (Hash)",dataIndex:"changed_by_api_key",key:"changed_by_api_key",width:140,render:e=>e?(0,_.jsxs)("span",{className:"font-mono text-xs",children:[e.slice(0,12),"…"]}):"—"}];if(!n)return(0,_.jsxs)("div",{style:{textAlign:"center",marginTop:"20px"},children:[(0,_.jsx)("h1",{style:{display:"block",marginBottom:"10px"},children:"✨ Enterprise Feature."}),(0,_.jsx)("p",{style:{display:"block",marginBottom:"10px"},children:"This is a LiteLLM Enterprise feature, and requires a valid key to use."}),(0,_.jsx)("p",{style:{display:"block",marginBottom:"20px",fontStyle:"italic"},children:"Here's a preview of what Audit Logs offer:"}),(0,_.jsx)("img",{src:"../ui/assets/audit-logs-preview.png",alt:"Audit Logs Preview",style:{maxWidth:"100%",maxHeight:"700px",borderRadius:"8px",boxShadow:"0 4px 8px rgba(0,0,0,0.1)",margin:"0 auto"},onError:e=>{e.target.style.display="none"}})]});let M=S.data?.audit_logs??[],C=S.data?.total??0;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,_.jsxs)("div",{className:"border-b px-6 py-4",children:[(0,_.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,_.jsx)("h1",{className:"text-xl font-semibold",children:"Audit Logs"})}),(0,_.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,_.jsx)(Rc,{placeholder:"Object ID",allowClear:!0,style:{width:200},onSearch:e=>{d(e),i(1)},onChange:e=>{e.target.value||(d(""),i(1))}}),(0,_.jsx)(Rc,{placeholder:"Changed By",allowClear:!0,style:{width:180},onSearch:e=>{u(e),i(1)},onChange:e=>{e.target.value||(u(""),i(1))}}),(0,_.jsx)(Rc,{placeholder:"Team ID",allowClear:!0,style:{width:180},onSearch:e=>{f(e),i(1)},onChange:e=>{e.target.value||(f(""),i(1))}}),(0,_.jsx)(Rc,{placeholder:"Key Hash",allowClear:!0,style:{width:180},onSearch:e=>{p(e),i(1)},onChange:e=>{e.target.value||(p(""),i(1))}}),(0,_.jsx)(eE.Select,{placeholder:"All Actions",allowClear:!0,style:{width:140},options:[{label:"Created",value:"created"},{label:"Updated",value:"updated"},{label:"Deleted",value:"deleted"},{label:"Rotated",value:"rotated"}],onChange:e=>{g(e),i(1)}}),(0,_.jsx)(eE.Select,{placeholder:"All Tables",allowClear:!0,style:{width:150},options:[{label:"Keys",value:"LiteLLM_VerificationToken"},{label:"Teams",value:"LiteLLM_TeamTable"},{label:"Users",value:"LiteLLM_UserTable"},{label:"Organizations",value:"LiteLLM_OrganizationTable"},{label:"Models",value:"LiteLLM_ProxyModelTable"}],onChange:e=>{b(e),i(1)}}),(0,_.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,_.jsx)(z.Button,{icon:(0,_.jsx)(rg.ReloadOutlined,{spin:S.isFetching}),onClick:()=>S.refetch(),disabled:S.isFetching}),(0,_.jsx)(Ex.default,{current:l,pageSize:50,total:C,showTotal:e=>`${e} total`,showSizeChanger:!1,size:"small",onChange:e=>i(e)})]})]})]}),(0,_.jsx)(eK.Table,{columns:N,dataSource:M,rowKey:"id",loading:{spinning:S.isLoading,indicator:(0,_.jsx)(rm.Spin,{indicator:(0,_.jsx)(wo.LoadingOutlined,{spin:!0}),size:"small"})},size:"small",pagination:!1,onRow:e=>({onClick:()=>{j(e),k(!0)},style:{cursor:"pointer"}})})]}),(0,_.jsx)(Rd,{open:w,onClose:()=>k(!1),log:v})]})}let Rh=({size:e=12})=>(0,_.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0 text-gray-400",children:(0,_.jsx)("path",{d:"M12 3l1.912 5.813a2 2 0 0 0 1.275 1.275L21 12l-5.813 1.912a2 2 0 0 0-1.275 1.275L12 21l-1.912-5.813a2 2 0 0 0-1.275-1.275L3 12l5.813-1.912a2 2 0 0 0 1.275-1.275L12 3z"})}),Rf=({size:e=10})=>(0,_.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0",children:(0,_.jsx)("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})}),Rx=({size:e=12})=>(0,_.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0",children:[(0,_.jsx)("path",{d:"M12 8V4H8"}),(0,_.jsx)("rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"}),(0,_.jsx)("path",{d:"M2 14h2"}),(0,_.jsx)("path",{d:"M20 14h2"}),(0,_.jsx)("path",{d:"M15 13v2"}),(0,_.jsx)("path",{d:"M9 13v2"})]}),Rg=({count:e})=>(0,_.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-blue-50 text-blue-700 border border-blue-200 rounded-full text-[11px] font-medium whitespace-nowrap",children:[(0,_.jsx)(Rh,{}),null!=e?e:"LLM"]}),Ry=({count:e})=>(0,_.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-amber-50 text-amber-700 border border-amber-200 rounded-full text-[11px] font-medium whitespace-nowrap",children:[(0,_.jsx)(Rf,{}),null!=e?e:"MCP"]}),R_=({count:e})=>(0,_.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-violet-50 text-violet-700 border border-violet-200 rounded-full text-[11px] font-medium whitespace-nowrap",children:[(0,_.jsx)(Rx,{}),null!=e?e:"Agent"]}),Rb=({label:e,field:t,sortBy:r,sortOrder:a,onSortChange:s})=>(0,_.jsxs)("div",{className:"flex items-center gap-1",children:[(0,_.jsx)("span",{children:e}),(0,_.jsx)(YT.TableHeaderSortDropdown,{sortState:r===t&&a,onSortChange:e=>{!1===e?s("startTime","desc"):s(t,e)}})]}),Rv=e=>[{header:e?()=>(0,_.jsx)(Rb,{label:"Time",field:"startTime",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"Time",accessorKey:"startTime",cell:e=>(0,_.jsx)(FP,{utcTime:e.getValue()})},{header:"Type",id:"type",cell:e=>{let t=e.row.original,r=t.session_total_count||1,a=k4.includes(t.call_type),s=k5.includes(t.call_type),n=t.session_llm_count??(a||s?0:r),l=t.session_agent_count??(s?r:0),i=t.session_mcp_count??(a?r:0);if(a)return(0,_.jsx)(Ry,{});if(s&&r<=1)return(0,_.jsx)(R_,{});if(r<=1)return(0,_.jsx)(Rg,{});let o=(0,_.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-blue-50 text-blue-700 border border-blue-200 rounded-full text-[11px] font-medium whitespace-nowrap",children:[(0,_.jsx)(Rh,{}),(0,_.jsx)("span",{children:r}),l>0&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("span",{className:"text-blue-300",children:"·"}),(0,_.jsx)(Rx,{size:10})]}),i>0&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("span",{className:"text-blue-300",children:"·"}),(0,_.jsx)(Rf,{})]})]}),d=[n>0&&`${n} LLM`,l>0&&`${l} Agent`,i>0&&`${i} MCP`].filter(Boolean);return(0,_.jsx)(tB.Tooltip,{title:d.join(" • "),children:o})}},{header:"Status",accessorKey:"metadata.status",cell:e=>{let t="failure"!==(e.getValue()||"Success").toLowerCase();return(0,_.jsx)("span",{className:`px-2 py-1 rounded-md text-xs font-medium inline-block text-center w-16 ${t?"bg-green-100 text-green-800":"bg-red-100 text-red-800"}`,children:t?"Success":"Failure"})}},{header:"Session ID",accessorKey:"session_id",cell:e=>{let t=String(e.getValue()||""),r=e.row.original.onSessionClick;return(0,_.jsx)(tB.Tooltip,{title:String(e.getValue()||""),children:(0,_.jsx)(S.Button,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal text-xs max-w-[15ch] truncate block",onClick:()=>r?.(t),children:String(e.getValue()||"")})})}},{header:"Request ID",accessorKey:"request_id",cell:e=>(0,_.jsx)(tB.Tooltip,{title:String(e.getValue()||""),children:(0,_.jsx)("span",{className:"font-mono text-xs max-w-[15ch] truncate block",children:String(e.getValue()||"")})})},{header:e?()=>(0,_.jsx)(Rb,{label:"Cost",field:"spend",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"Cost",accessorKey:"spend",cell:e=>{let t=e.row.original,r=t.mcp_tool_call_count||0,a=t.mcp_tool_call_spend||0;return(0,_.jsxs)("div",{className:"flex flex-col",children:[(0,_.jsx)(tB.Tooltip,{title:`$${String(e.getValue()||0)}`,children:(0,_.jsx)("span",{children:(0,rV.getSpendString)(e.getValue()||0)})}),r>0&&a>0&&(0,_.jsxs)("span",{className:"text-[10px] text-amber-600",children:["incl. ",(0,rV.getSpendString)(a)," from ",r," MCP"]})]})}},{header:e?()=>(0,_.jsx)(Rb,{label:"Duration (s)",field:"request_duration_ms",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"Duration (s)",accessorKey:"request_duration_ms",cell:e=>{let t=e.getValue();if(null==t)return(0,_.jsx)("span",{children:"-"});let r=(t/1e3).toFixed(2);return(0,_.jsx)(tB.Tooltip,{title:`${t}ms`,children:(0,_.jsx)("span",{className:"max-w-[15ch] truncate block",children:r})})}},{header:e?()=>(0,_.jsx)(Rb,{label:"TTFT (s)",field:"ttft_ms",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"TTFT (s)",accessorKey:"completionStartTime",cell:e=>{let t=e.row.original,r=e.getValue();if(!r||r===t.endTime)return(0,_.jsx)("span",{children:"-"});let a=new Date(r).getTime()-new Date(t.startTime).getTime();if(a<=0)return(0,_.jsx)("span",{children:"-"});let s=(a/1e3).toFixed(2);return(0,_.jsx)(tB.Tooltip,{title:`${a}ms`,children:(0,_.jsx)("span",{className:"max-w-[15ch] truncate block",children:s})})}},{header:"Team Name",accessorKey:"metadata.user_api_key_team_alias",cell:e=>(0,_.jsx)(tB.Tooltip,{title:String(e.getValue()||"-"),children:(0,_.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Key Hash",accessorKey:"metadata.user_api_key",cell:e=>{let t=String(e.getValue()||"-"),r=e.row.original.onKeyHashClick;return(0,_.jsx)(tB.Tooltip,{title:t,children:(0,_.jsx)("span",{className:"font-mono max-w-[15ch] truncate block cursor-pointer hover:text-blue-600",onClick:()=>r?.(t),children:t})})}},{header:"Key Name",accessorKey:"metadata.user_api_key_alias",cell:e=>(0,_.jsx)(tB.Tooltip,{title:String(e.getValue()||"-"),children:(0,_.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:e?()=>(0,_.jsx)(Rb,{label:"Model",field:"model",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"Model",accessorKey:"model",cell:e=>{let t=e.row.original,r=t.custom_llm_provider,a=String(e.getValue()||"");return(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[r&&(0,_.jsx)("img",{src:t.metadata?.mcp_tool_call_metadata?.mcp_server_logo_url?t.metadata.mcp_tool_call_metadata.mcp_server_logo_url:r?(0,j$.getProviderLogoAndName)(r).logo:"",alt:"",className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,_.jsx)(tB.Tooltip,{title:a,children:(0,_.jsx)("span",{className:"max-w-[15ch] truncate block",children:a})})]})}},{header:e?()=>(0,_.jsx)(Rb,{label:"Tokens",field:"total_tokens",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"Tokens",accessorKey:"total_tokens",cell:e=>{let t=e.row.original;return(0,_.jsxs)("span",{className:"text-sm",children:[String(t.total_tokens||"0"),(0,_.jsxs)("span",{className:"text-gray-400 text-xs ml-1",children:["(",String(t.prompt_tokens||"0"),"+",String(t.completion_tokens||"0"),")"]})]})}},{header:"Internal User",accessorKey:"user",cell:e=>(0,_.jsx)(tB.Tooltip,{title:String(e.getValue()||"-"),children:(0,_.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"End User",accessorKey:"end_user",cell:e=>(0,_.jsx)(tB.Tooltip,{title:String(e.getValue()||"-"),children:(0,_.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Tags",accessorKey:"request_tags",cell:e=>{let t=e.getValue();if(!t||0===Object.keys(t).length)return"-";let r=Object.entries(t),a=r[0],s=r.slice(1);return(0,_.jsx)("div",{className:"flex flex-wrap gap-1",children:(0,_.jsx)(tB.Tooltip,{title:(0,_.jsx)("div",{className:"flex flex-col gap-1",children:r.map(([e,t])=>(0,_.jsxs)("span",{children:[e,": ",String(t)]},e))}),children:(0,_.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[a[0],": ",String(a[1]),s.length>0&&` +${s.length}`]})})})}}];Rv();let Rj=({value:e,onChange:t})=>(0,_.jsx)(tX.default,{value:e,onChange:t});var Rw=e.i(50882);let{Text:Rk}=V.Typography,RS=({value:e,onChange:t,placeholder:r="Select a model",style:a,pageSize:s=50,allowClear:n=!0,disabled:l=!1})=>{let[i,o]=(0,T.useState)(""),[d,c]=(0,Dj.useDebouncedState)("",{wait:300}),{data:u,fetchNextPage:m,hasNextPage:p,isFetchingNextPage:h,isLoading:f}=(0,wK.useInfiniteModelInfo)(s,d||void 0),x=(0,T.useMemo)(()=>{if(!u?.pages)return[];let e=new Set,t=[];for(let r of u.pages)for(let a of r.data){let r=a.model_info?.id??"",s=a.model_name??"";!r||e.has(r)||(e.add(r),t.push({label:s?`${s} (${r})`:r,value:r,modelName:s,modelId:r}))}return t},[u]);return(0,_.jsx)(eE.Select,{value:e||void 0,onChange:e=>{let r="string"==typeof e?e:Array.isArray(e)?e[0]??"":"";t?.(r)},placeholder:r,style:{width:"100%",...a},allowClear:n,disabled:l,showSearch:!0,filterOption:!1,onSearch:e=>{o(e),c(e)},searchValue:i,onPopupScroll:e=>{let t=e.currentTarget;(t.scrollTop+t.clientHeight)/t.scrollHeight>=.8&&p&&!h&&m()},loading:f,notFoundContent:f?(0,_.jsx)(wo.LoadingOutlined,{spin:!0}):"No models found",options:x,optionRender:e=>{let{modelName:t,modelId:r}=e.data;return(0,_.jsx)(_.Fragment,{children:t?(0,_.jsxs)(U.Space,{direction:"vertical",children:[(0,_.jsxs)(U.Space,{direction:"horizontal",children:[(0,_.jsx)(Rk,{strong:!0,children:"Model name:"}),(0,_.jsx)(Rk,{ellipsis:!0,children:t})]}),(0,_.jsxs)(Rk,{ellipsis:!0,type:"secondary",children:["Model ID: ",r]})]}):(0,_.jsxs)(Rk,{ellipsis:!0,type:"secondary",children:["Model ID: ",r]})})},popupRender:e=>(0,_.jsxs)(_.Fragment,{children:[e,h&&(0,_.jsx)("div",{style:{textAlign:"center",padding:8},children:(0,_.jsx)(wo.LoadingOutlined,{spin:!0})})]})})};var RN=e.i(633627);let RT="Team ID",RM="Key Hash",RC="Request ID",RL="Model",RO="Public model / search tool",RD="User ID",RP="End User",RA="Status",RE="Key Alias",RI="Error Code",RY="Error Message",RF=[RM,RY,RC,RD,RO],RR={[RT]:"",[RM]:"",[RC]:"",[RL]:"",[RO]:"",[RD]:"",[RP]:"",[RA]:"",[RE]:"",[RI]:"",[RY]:""};var RB=e.i(772345);function Rz({searchTerm:e,onSearchChange:t,startTime:r,onStartTimeChange:a,endTime:s,onEndTimeChange:n,isCustomDate:l,onIsCustomDateChange:i,selectedTimeInterval:o,onSelectedTimeIntervalChange:d,isLiveTail:c,onIsLiveTailChange:u,currentPage:m,onCurrentPageChange:p,pageSize:h,isLoading:f,isButtonLoading:x,onRefetch:g,filteredLogs:y}){let[b,v]=(0,T.useState)(!1),j=(0,T.useRef)(null);(0,T.useEffect)(()=>{function e(e){j.current&&!j.current.contains(e.target)&&v(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let w=k6.find(e=>e.value===o.value&&e.unit===o.unit),k=l?((e,t,r)=>{if(e)return`${(0,kl.default)(t).format("MMM D, h:mm A")} - ${(0,kl.default)(r).format("MMM D, h:mm A")}`;let a=(0,kl.default)(),s=(0,kl.default)(t),n=a.diff(s,"minutes");if(n>=0&&n<2)return"Last 1 Minute";if(n>=2&&n<16)return"Last 15 Minutes";if(n>=16&&n<61)return"Last Hour";let l=a.diff(s,"hours");return l>=1&&l<5?"Last 4 Hours":l>=5&&l<25?"Last 24 Hours":l>=25&&l<169?"Last 7 Days":`${s.format("MMM D")} - ${a.format("MMM D")}`})(l,r,s):w?.label;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"border-b px-6 py-4 w-full max-w-full box-border",children:(0,_.jsxs)("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between space-y-4 md:space-y-0 w-full max-w-full box-border",children:[(0,_.jsxs)("div",{className:"flex flex-wrap items-center gap-3 w-full max-w-full box-border",children:[(0,_.jsxs)("div",{className:"relative w-64 min-w-0 flex-shrink-0",children:[(0,_.jsx)("input",{type:"text",placeholder:"Search by Request ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:e,onChange:e=>t(e.target.value)}),(0,_.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,_.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-shrink",children:[(0,_.jsxs)("div",{className:"relative z-50",ref:j,children:[(0,_.jsxs)("button",{onClick:()=>v(!b),className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",children:[(0,_.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,_.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),k]}),b&&(0,_.jsx)("div",{className:"absolute left-0 mt-2 w-64 bg-white rounded-lg shadow-lg border p-2 z-50",children:(0,_.jsxs)("div",{className:"space-y-1",children:[k6.map(e=>(0,_.jsx)("button",{className:`w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ${k===e.label?"bg-blue-50 text-blue-600":""}`,onClick:()=>{p(1),n((0,kl.default)().format("YYYY-MM-DDTHH:mm")),a((0,kl.default)().subtract(e.value,e.unit).format("YYYY-MM-DDTHH:mm")),d({value:e.value,unit:e.unit}),i(!1),v(!1)},children:e.label},e.label)),(0,_.jsx)("div",{className:"border-t my-2"}),(0,_.jsx)("button",{className:`w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ${l?"bg-blue-50 text-blue-600":""}`,onClick:()=>i(!l),children:"Custom Range"})]})})]}),(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("span",{className:"text-sm font-medium text-gray-900",children:"Live Tail"}),(0,_.jsx)(e_.Switch,{checked:c,defaultChecked:!0,onChange:u})]}),(0,_.jsx)(z.Button,{type:"default",icon:(0,_.jsx)(RB.SyncOutlined,{spin:x}),onClick:g,disabled:x,title:"Fetch data",children:x?"Fetching":"Fetch"})]}),l&&(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("div",{children:(0,_.jsx)("input",{type:"datetime-local",value:r,onChange:e=>{a(e.target.value),p(1)},className:"px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})}),(0,_.jsx)("span",{className:"text-gray-500",children:"to"}),(0,_.jsx)("div",{children:(0,_.jsx)("input",{type:"datetime-local",value:s,onChange:e=>{n(e.target.value),p(1)},className:"px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})})]})]}),(0,_.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,_.jsxs)("span",{className:"text-sm text-gray-700 whitespace-nowrap",children:["Showing ",f?"...":y?(m-1)*h+1:0," -"," ",f?"...":y?Math.min(m*h,y.total):0," of"," ",f?"...":y?y.total:0," results"]}),(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsxs)("span",{className:"text-sm text-gray-700 min-w-[90px]",children:["Page ",f?"...":m," of"," ",f?"...":y?y.total_pages:1]}),(0,_.jsx)("button",{onClick:()=>p(e=>Math.max(1,e-1)),disabled:f||1===m,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,_.jsx)("button",{onClick:()=>p(e=>Math.min(y.total_pages||1,e+1)),disabled:f||m===(y.total_pages||1),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]})]})}),c&&1===m&&(0,_.jsxs)("div",{className:"mb-4 px-4 py-2 bg-green-50 border border-green-200 rounded-md flex items-center justify-between",children:[(0,_.jsx)("div",{className:"flex items-center gap-2",children:(0,_.jsx)("span",{className:"text-sm text-green-700",children:"Auto-refreshing every 15 seconds"})}),(0,_.jsx)("button",{onClick:()=>u(!1),className:"text-sm text-green-600 hover:text-green-800",children:"Stop"})]})]})}function RH({accessToken:e,token:t,userRole:r,userID:a,premiumUser:s}){let[n,l]=(0,T.useState)(""),[i,o]=(0,T.useState)(1),[d]=(0,T.useState)(50),[c,u]=(0,T.useState)((0,kl.default)().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),[m,p]=(0,T.useState)((0,kl.default)().format("YYYY-MM-DDTHH:mm")),[h,f]=(0,T.useState)(!1),[x,g]=(0,T.useState)(RR),[y,b]=(0,T.useState)(null),[v,j]=(0,T.useState)(null),[w,k]=(0,T.useState)(r&&ts.internalUserRoles.includes(r)),[S,N]=(0,T.useState)("request logs"),[M,C]=(0,T.useState)(null),[L,O]=(0,T.useState)(!1),[D,P]=(0,T.useState)(null),[A,E]=(0,T.useState)("startTime"),[I,Y]=(0,T.useState)("desc"),[F,R]=(0,T.useState)({value:24,unit:"hours"}),[B,z]=(0,T.useState)(()=>{let e=sessionStorage.getItem("isLiveTail");return null===e||JSON.parse(e)});(0,T.useEffect)(()=>{sessionStorage.setItem("isLiveTail",JSON.stringify(B))},[B]),(0,T.useEffect)(()=>{(async()=>{v&&e&&b({...(await (0,Q.keyInfoV1Call)(e,v)).info,token:v,api_key:v})})()},[v,e]),(0,T.useEffect)(()=>{r&&ts.internalUserRoles.includes(r)&&k(!0)},[r]);let{logsQuery:H,filteredLogs:$,allTeams:q,handleFilterChange:U,handleFilterReset:W}=function({accessToken:e,token:t,userRole:r,userID:a,filters:s,setFilters:n,filterByCurrentUser:l,activeTab:i,isLiveTail:o,startTime:d,endTime:c,pageSize:u=K.defaultPageSize,isCustomDate:m,setCurrentPage:p,sortBy:h="startTime",sortOrder:f="desc",currentPage:x=1}){let[g,y]=function(e,t){let[r,a]=(0,T.useState)(e);return(0,T.useEffect)(()=>{let t=setTimeout(()=>a(e),300);return()=>clearTimeout(t)},[e,300]),[r,a]}(s,0),_=(0,T.useMemo)(()=>{let e={...s};for(let t of RF)e[t]=g[t];return e},[s,g]),b=(0,ev.useQuery)({queryKey:["logs","table",x,u,d,c,m,_,l?a:null,h,f],queryFn:async()=>{if(!e||!t||!r||!a)return{data:[],total:0,page:1,page_size:u,total_pages:0};let s=(0,kl.default)(d).utc().format("YYYY-MM-DD HH:mm:ss"),n=m?(0,kl.default)(c).utc().format("YYYY-MM-DD HH:mm:ss"):(0,kl.default)().utc().format("YYYY-MM-DD HH:mm:ss");return await (0,Q.uiSpendLogsCall)({accessToken:e,start_date:s,end_date:n,page:x,page_size:u,params:{api_key:_[RM]||void 0,team_id:_[RT]||void 0,request_id:_[RC]||void 0,user_id:_[RD]||(l?a??void 0:void 0),end_user:_[RP]||void 0,status_filter:_[RA]||void 0,model_id:_[RL]||void 0,model:_[RO]||void 0,key_alias:_[RE]||void 0,error_code:_[RI]||void 0,error_message:_[RY]||void 0,sort_by:h,sort_order:f}})},enabled:!!e&&!!t&&!!r&&!!a&&"request logs"===i,refetchInterval:!!o&&1===x&&15e3,placeholderData:Rr.keepPreviousData,refetchIntervalInBackground:!1}),v=b.data??{data:[],total:0,page:1,page_size:u,total_pages:0},{data:j}=(0,ev.useQuery)({queryKey:["allTeamsForLogFilters",e],queryFn:async()=>e&&await (0,RN.fetchAllTeams)(e)||[],enabled:!!e});return{logsQuery:b,filteredLogs:v,allTeams:j,handleFilterChange:e=>{n(t=>{let r={...t,...e};for(let e of Object.keys(RR))e in r||(r[e]=RR[e]);return JSON.stringify(r)!==JSON.stringify(t)&&p(1),r})},handleFilterReset:()=>{n(RR),y(RR),p(1)}}}({accessToken:e,token:t,userRole:r,userID:a,filters:x,setFilters:g,filterByCurrentUser:!!w,activeTab:S,isLiveTail:B,startTime:c,endTime:m,pageSize:d,isCustomDate:h,setCurrentPage:o,sortBy:A,sortOrder:I,currentPage:i}),V=(0,T.useCallback)(()=>{W(),u((0,kl.default)().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),p((0,kl.default)().format("YYYY-MM-DDTHH:mm")),f(!1),R({value:24,unit:"hours"}),o(1)},[W]),G=(0,T.useCallback)((e,t)=>{E(e),Y(t),o(1)},[]),J=(0,T.useMemo)(()=>Rv({sortBy:A,sortOrder:I,onSortChange:G}),[A,I,G]),X=(0,T.useMemo)(()=>{let e=$.data.filter(e=>!n||e.request_id.includes(n)||e.model.includes(n)||e.user&&e.user.includes(n)),t=e.reduce((e,t)=>(t.session_id&&(e[t.session_id]||(e[t.session_id]={llm:0,agent:0,mcp:0}),k4.includes(t.call_type)?e[t.session_id].mcp+=1:k5.includes(t.call_type)?e[t.session_id].agent+=1:e[t.session_id].llm+=1),e),{}),r=new Map;for(let t of e){if(!t.session_id||1>=(t.session_total_count||1))continue;let e=k4.includes(t.call_type),a=r.get(t.session_id);a&&(!a.isMcp||e)||r.set(t.session_id,{requestId:t.request_id,isMcp:e})}return e.map(e=>{let r=e.session_id?t[e.session_id]:void 0;return{...e,request_duration_ms:e.request_duration_ms,session_llm_count:r?.llm??void 0,session_mcp_count:r?.mcp??void 0,session_agent_count:r?.agent??void 0,onKeyHashClick:e=>j(e),onSessionClick:t=>{t&&(P(t),C(e),O(!0))}}}).filter(e=>!e.session_id||1>=(e.session_total_count||1)||r.get(e.session_id)?.requestId===e.request_id)},[$.data,n]),Z=(0,T.useDeferredValue)(X),ee=Z!==X,et=H.isFetching||ee,er=H.isPlaceholderData,ea=H.isLoading||er;return e&&t&&r&&a?(0,_.jsxs)("div",{className:"w-full max-w-screen p-6 overflow-x-hidden box-border",children:[(0,_.jsxs)(rF.TabGroup,{defaultIndex:0,onIndexChange:e=>N(0===e?"request logs":"audit logs"),children:[(0,_.jsxs)(rR.TabList,{children:[(0,_.jsx)(rY.Tab,{children:"Request Logs"}),(0,_.jsx)(rY.Tab,{children:"Audit Logs"}),(0,_.jsx)(rY.Tab,{children:"Deleted Keys"}),(0,_.jsx)(rY.Tab,{children:"Deleted Teams"})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsxs)(rB.TabPanel,{children:[(0,_.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,_.jsx)("h1",{className:"text-xl font-semibold",children:"Request Logs"})}),y&&v&&y.api_key===v?(0,_.jsx)(AH.default,{keyId:v,keyData:y,teams:q??[],onClose:()=>j(null),backButtonText:"Back to Logs"}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(FA.default,{options:[{name:"Team ID",label:"Team ID",customComponent:Rj},{name:"Status",label:"Status",isSearchable:!1,options:[{label:"Success",value:"success"},{label:"Failure",value:"failure"}]},{name:"Key Alias",label:"Key Alias",customComponent:Rw.PaginatedKeyAliasSelect},{name:"End User",label:"End User",isSearchable:!0,searchFn:async t=>{let r=await (0,Q.allEndUsersCall)(e);return(r?.map(e=>e.user_id)||[]).filter(e=>e.toLowerCase().includes(t.toLowerCase())).map(e=>({label:e,value:e}))}},{name:"Error Code",label:"Error Code",isSearchable:!0,searchFn:async e=>{if(!e)return k2;let t=e.toLowerCase(),r=k2.filter(e=>e.label.toLowerCase().includes(t));return!k2.some(t=>t.value===e.trim())&&e.trim()&&r.push({label:`Use custom code: ${e.trim()}`,value:e.trim()}),r}},{name:"Error Message",label:"Error Message",isSearchable:!1},{name:"Key Hash",label:"Key Hash",isSearchable:!1},{name:"Model",label:"Model",customComponent:RS},{name:RO,label:"Public model / search tool",isSearchable:!1}],onApplyFilters:U,onResetFilters:V}),(0,_.jsxs)("div",{className:"bg-white rounded-lg shadow w-full max-w-full box-border",children:[(0,_.jsx)(Rz,{searchTerm:n,onSearchChange:l,startTime:c,onStartTimeChange:u,endTime:m,onEndTimeChange:p,isCustomDate:h,onIsCustomDateChange:f,selectedTimeInterval:F,onSelectedTimeIntervalChange:R,isLiveTail:B,onIsLiveTailChange:z,currentPage:i,onCurrentPageChange:o,pageSize:d,isLoading:ea,isButtonLoading:et,onRefetch:()=>H.refetch(),filteredLogs:$}),(0,_.jsx)(LH.DataTable,{columns:J,data:Z,onRowClick:e=>{if(e.session_id&&(e.session_total_count||1)>1){P(e.session_id),C(e),O(!0);return}P(null),C(e),O(!0)},isLoading:ea})]})]})]}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Rp,{userID:a,userRole:r,token:t,accessToken:e,isActive:"audit logs"===S,premiumUser:s})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(F9,{})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(Rt,{})})]})]}),(0,_.jsx)(N1,{open:L,onClose:()=>{O(!1),P(null)},logEntry:M,sessionId:D,accessToken:e,allLogs:X,onSelectLog:C,startTime:(0,kl.default)(c).utc().format("YYYY-MM-DD HH:mm:ss")})]}):(0,_.jsx)("div",{className:"flex items-center justify-center h-64",children:(0,_.jsx)(Eb,{size:"large"})})}function R$({userData:e,onCancel:t,onSubmit:r,teams:a,accessToken:s,userID:n,userRole:l,userModels:i,possibleUIRoles:o,isBulkEdit:d=!1}){let[c]=H.Form.useForm(),[u,m]=(0,T.useState)(!1);return T.default.useEffect(()=>{let t=e.user_info?.max_budget,r=null==t;m(r),c.setFieldsValue({user_id:e.user_id,user_email:e.user_info?.user_email,user_alias:e.user_info?.user_alias,user_role:e.user_info?.user_role,models:e.user_info?.models||[],max_budget:r?"":t,budget_duration:e.user_info?.budget_duration,metadata:e.user_info?.metadata?JSON.stringify(e.user_info.metadata,null,2):void 0})},[e,c]),(0,_.jsxs)(H.Form,{form:c,onFinish:e=>{if(e.metadata&&"string"==typeof e.metadata)try{e.metadata=JSON.parse(e.metadata)}catch(e){console.error("Error parsing metadata JSON:",e);return}(u||""===e.max_budget||void 0===e.max_budget)&&(e.max_budget=null),r(e)},layout:"vertical",children:[!d&&(0,_.jsx)(H.Form.Item,{label:"User ID",name:"user_id",children:(0,_.jsx)(et.TextInput,{disabled:!0})}),!d&&(0,_.jsx)(H.Form.Item,{label:"Email",name:"user_email",children:(0,_.jsx)(et.TextInput,{})}),(0,_.jsx)(H.Form.Item,{label:"User Alias",name:"user_alias",children:(0,_.jsx)(et.TextInput,{})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Global Proxy Role"," ",(0,_.jsx)(tB.Tooltip,{title:"This is the role that the user will globally on the proxy. This role is independent of any team/org specific roles.",children:(0,_.jsx)(tK.InfoCircleOutlined,{})})]}),name:"user_role",children:(0,_.jsx)(eE.Select,{children:o&&Object.entries(o).map(([e,{ui_label:t,description:r}])=>(0,_.jsx)(ju.SelectItem,{value:e,title:t,children:(0,_.jsxs)("div",{className:"flex",children:[t," ",(0,_.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:r})]})},e))})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("span",{children:["Personal Models"," ",(0,_.jsx)(tB.Tooltip,{title:"Select which models this user can access outside of team-scope. Choose 'All Proxy Models' to grant access to all models available on the proxy.",children:(0,_.jsx)(tK.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,_.jsxs)(eE.Select,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},disabled:!ts.all_admin_roles.includes(l||""),children:[(0,_.jsx)(eE.Select.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),(0,_.jsx)(eE.Select.Option,{value:"no-default-models",children:"No Default Models"},"no-default-models"),i.map(e=>(0,_.jsx)(eE.Select.Option,{value:e,children:(0,tQ.getModelDisplayName)(e)},e))]})}),(0,_.jsx)(H.Form.Item,{label:(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[(0,_.jsx)("span",{children:"Max Budget (USD)"}),(0,_.jsx)(eA.Checkbox,{checked:u,onChange:e=>{let t=e.target.checked;m(t),t&&c.setFieldsValue({max_budget:""})},children:"Unlimited Budget"})]}),name:"max_budget",rules:[{validator:(e,t)=>u||""!==t&&null!=t?Promise.resolve():Promise.reject(Error("Please enter a budget or select Unlimited Budget"))}],children:(0,_.jsx)(jf.default,{step:.01,precision:2,style:{width:"100%"},disabled:u})}),(0,_.jsx)(H.Form.Item,{label:"Reset Budget",name:"budget_duration",children:(0,_.jsx)(En.default,{})}),(0,_.jsx)(H.Form.Item,{label:"Metadata",name:"metadata",children:(0,_.jsx)(C8,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,_.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,_.jsx)(S.Button,{variant:"secondary",type:"button",onClick:t,children:"Cancel"}),(0,_.jsx)(S.Button,{type:"submit",children:"Save Changes"})]})]})}let{Text:Rq,Title:RU}=V.Typography,RW=({open:e,onCancel:t,selectedUsers:r,possibleUIRoles:a,accessToken:s,onSuccess:n,teams:l,userRole:i,userModels:o,allowAllUsers:d=!1})=>{let[c,u]=(0,T.useState)(!1),[m,p]=(0,T.useState)([]),[h,f]=(0,T.useState)(null),[x,g]=(0,T.useState)(!1),[y,b]=(0,T.useState)(!1),v=()=>{p([]),f(null),g(!1),b(!1),t()},j=T.default.useMemo(()=>({user_id:"bulk_edit",user_info:{user_email:"",user_role:"",teams:[],models:[],max_budget:null,spend:0,metadata:{},created_at:null,updated_at:null},keys:[],teams:l||[]}),[l,e]),w=async e=>{if(console.log("formValues",e),!s)return void J.default.fromBackend("Access token not found");u(!0);try{let a=r.map(e=>e.user_id),l={};e.user_role&&""!==e.user_role&&(l.user_role=e.user_role),null!==e.max_budget&&void 0!==e.max_budget&&(l.max_budget=e.max_budget),e.models&&e.models.length>0&&(l.models=e.models),e.budget_duration&&""!==e.budget_duration&&(l.budget_duration=e.budget_duration),e.metadata&&Object.keys(e.metadata).length>0&&(l.metadata=e.metadata);let i=Object.keys(l).length>0,o=x&&m.length>0;if(!i&&!o)return void J.default.fromBackend("Please modify at least one field or select teams to add users to");let d=[];if(i)if(y){let e=await (0,Q.userBulkUpdateUserCall)(s,l,void 0,!0);d.push(`Updated all users (${e.total_requested} total)`)}else await (0,Q.userBulkUpdateUserCall)(s,l,a),d.push(`Updated ${a.length} user(s)`);if(o){let e=[];for(let t of m)try{let a=null;a=y?null:r.map(e=>({user_id:e.user_id,role:"user",user_email:e.user_email||null}));let n=await (0,Q.teamBulkMemberAddCall)(s,t,a||null,h||void 0,y);console.log("result",n),e.push({teamId:t,success:!0,successfulAdditions:n.successful_additions,failedAdditions:n.failed_additions})}catch(r){console.error(`Failed to add users to team ${t}:`,r),e.push({teamId:t,success:!1,error:r})}let t=e.filter(e=>e.success),a=e.filter(e=>!e.success);if(t.length>0){let e=t.reduce((e,t)=>e+t.successfulAdditions,0);d.push(`Added users to ${t.length} team(s) (${e} total additions)`)}a.length>0&&tU.default.warning(`Failed to add users to ${a.length} team(s)`)}d.length>0&&J.default.success(d.join(". ")),p([]),f(null),g(!1),b(!1),n(),t()}catch(e){console.error("Bulk operation failed:",e),J.default.fromBackend("Failed to perform bulk operations")}finally{u(!1)}};return(0,_.jsxs)(q.Modal,{open:e,onCancel:v,footer:null,title:y?"Bulk Edit All Users":`Bulk Edit ${r.length} User(s)`,width:800,children:[d&&(0,_.jsxs)("div",{className:"mb-4",children:[(0,_.jsx)(eA.Checkbox,{checked:y,onChange:e=>b(e.target.checked),children:(0,_.jsx)(Rq,{strong:!0,children:"Update ALL users in the system"})}),y&&(0,_.jsx)("div",{style:{marginTop:8},children:(0,_.jsx)(Rq,{type:"warning",style:{fontSize:"12px"},children:"⚠️ This will apply changes to ALL users in the system, not just the selected ones."})})]}),!y&&(0,_.jsxs)("div",{className:"mb-4",children:[(0,_.jsxs)(RU,{level:5,children:["Selected Users (",r.length,"):"]}),(0,_.jsx)(eK.Table,{size:"small",bordered:!0,dataSource:r,pagination:!1,scroll:{y:200},rowKey:"user_id",columns:[{title:"User ID",dataIndex:"user_id",key:"user_id",width:"30%",render:e=>(0,_.jsx)(Rq,{strong:!0,style:{fontSize:"12px"},children:e.length>20?`${e.slice(0,20)}...`:e})},{title:"Email",dataIndex:"user_email",key:"user_email",width:"25%",render:e=>(0,_.jsx)(Rq,{type:"secondary",style:{fontSize:"12px"},children:e||"No email"})},{title:"Current Role",dataIndex:"user_role",key:"user_role",width:"25%",render:e=>(0,_.jsx)(Rq,{style:{fontSize:"12px"},children:a?.[e]?.ui_label||e})},{title:"Budget",dataIndex:"max_budget",key:"max_budget",width:"20%",render:e=>(0,_.jsx)(Rq,{style:{fontSize:"12px"},children:null!==e?`$${e}`:"Unlimited"})}]})]}),(0,_.jsx)(eG.Divider,{}),(0,_.jsx)("div",{className:"mb-4",children:(0,_.jsxs)(Rq,{children:[(0,_.jsx)("strong",{children:"Instructions:"})," Fill in the fields below with the values you want to apply to all selected users. You can bulk edit: role, budget, models, and metadata. You can also add users to teams."]})}),(0,_.jsx)(eg.Card,{title:"Team Management",size:"small",className:"mb-4",style:{backgroundColor:"#fafafa"},children:(0,_.jsxs)(U.Space,{direction:"vertical",style:{width:"100%"},children:[(0,_.jsx)(eA.Checkbox,{checked:x,onChange:e=>g(e.target.checked),children:"Add selected users to teams"}),x&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Rq,{strong:!0,children:"Select Teams:"}),(0,_.jsx)(eE.Select,{mode:"multiple",placeholder:"Select teams to add users to",value:m,onChange:p,style:{width:"100%",marginTop:8},options:l?.map(e=>({label:e.team_alias||e.team_id,value:e.team_id}))||[]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Rq,{strong:!0,children:"Team Budget (Optional):"}),(0,_.jsx)(tq.InputNumber,{placeholder:"Max budget per user in team",value:h,onChange:e=>f(e),style:{width:"100%",marginTop:8},min:0,step:.01,precision:2}),(0,_.jsx)(Rq,{type:"secondary",style:{fontSize:"12px"},children:"Leave empty for unlimited budget within team limits"})]}),(0,_.jsx)(Rq,{type:"secondary",style:{fontSize:"12px"},children:'Users will be added with "user" role by default. All users will be added to each selected team.'})]})]})}),(0,_.jsx)(R$,{userData:j,onCancel:v,onSubmit:w,teams:l,accessToken:s,userID:"bulk_edit",userRole:i,userModels:o,possibleUIRoles:a,isBulkEdit:!0}),c&&(0,_.jsx)("div",{style:{textAlign:"center",marginTop:"10px"},children:(0,_.jsxs)(Rq,{children:["Updating ",y?"all users":r.length," user(s)..."]})})]})};var RV=e.i(371455);let RG=({visible:e,possibleUIRoles:t,onCancel:r,user:a,onSubmit:s})=>{let[n,l]=(0,T.useState)(a),[i]=H.Form.useForm();(0,T.useEffect)(()=>{i.resetFields()},[a]);let o=async()=>{i.resetFields(),r()},d=async e=>{s(e),i.resetFields(),r()};return a?(0,_.jsx)(q.Modal,{open:e,onCancel:o,footer:null,title:"Edit User "+a.user_id,width:1e3,children:(0,_.jsx)(H.Form,{form:i,onFinish:d,initialValues:a,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(H.Form.Item,{className:"mt-8",label:"User Email",tooltip:"Email of the User",name:"user_email",children:(0,_.jsx)(et.TextInput,{})}),(0,_.jsx)(H.Form.Item,{label:"user_id",name:"user_id",hidden:!0,children:(0,_.jsx)(et.TextInput,{})}),(0,_.jsx)(H.Form.Item,{label:"User Role",name:"user_role",children:(0,_.jsx)(eE.Select,{children:t&&Object.entries(t).map(([e,{ui_label:t,description:r}])=>(0,_.jsx)(ju.SelectItem,{value:e,title:t,children:(0,_.jsxs)("div",{className:"flex",children:[t," ",(0,_.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:r})]})},e))})}),(0,_.jsx)(H.Form.Item,{label:"Spend (USD)",name:"spend",tooltip:"(float) - Spend of all LLM calls completed by this user",help:"Across all keys (including keys with team_id).",children:(0,_.jsx)(tq.InputNumber,{min:0,step:.01})}),(0,_.jsx)(H.Form.Item,{label:"User Budget (USD)",name:"max_budget",tooltip:"(float) - Maximum budget of this user",help:"Maximum budget of this user.",children:(0,_.jsx)(jf.default,{min:0,step:.01})}),(0,_.jsx)(H.Form.Item,{label:"Reset Budget",name:"budget_duration",children:(0,_.jsx)(En.default,{})}),(0,_.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,_.jsx)(z.Button,{htmlType:"submit",children:"Save"})}),(0,_.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,_.jsx)(z.Button,{htmlType:"submit",children:"Save"})})]})})}):null};var RK=e.i(172372);let RJ=({accessToken:e,possibleUIRoles:t,userID:r,userRole:a})=>{let[s,n]=(0,T.useState)(!0),[l,i]=(0,T.useState)(null),[o,d]=(0,T.useState)(!1),[c,u]=(0,T.useState)({}),[m,p]=(0,T.useState)(!1),[h,f]=(0,T.useState)([]),{Paragraph:x}=V.Typography,{Option:g}=eE.Select;(0,T.useEffect)(()=>{(async()=>{if(!e)return n(!1);try{let t=await (0,Q.getInternalUserSettings)(e);if(i(t),u(t.values||{}),e)try{let t=await (0,Q.modelAvailableCall)(e,r,a);if(t&&t.data){let e=t.data.map(e=>e.id);f(e)}}catch(e){console.error("Error fetching available models:",e)}}catch(e){console.error("Error fetching SSO settings:",e),J.default.fromBackend("Failed to fetch SSO settings")}finally{n(!1)}})()},[e]);let y=async()=>{if(e){p(!0);try{let t=Object.entries(c).reduce((e,[t,r])=>(e[t]=""===r?null:r,e),{}),r=await (0,Q.updateInternalUserSettings)(e,t);i({...l,values:r.settings}),d(!1)}catch(e){console.error("Error updating SSO settings:",e),J.default.fromBackend("Failed to update settings: "+e)}finally{p(!1)}}},b=(e,t)=>{u(r=>({...r,[e]:t}))},v=e=>e&&Array.isArray(e)?e.map(e=>"string"==typeof e?{team_id:e,user_role:"user"}:"object"==typeof e&&e.team_id?{team_id:e.team_id,max_budget_in_team:e.max_budget_in_team,user_role:e.user_role||"user"}:{team_id:"",user_role:"user"}):[];return s?(0,_.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,_.jsx)(rm.Spin,{size:"large"})}):l?(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,_.jsx)(X.Title,{children:"Default User Settings"}),!s&&l&&(o?(0,_.jsxs)("div",{className:"flex gap-2",children:[(0,_.jsx)(z.Button,{onClick:()=>{d(!1),u(l.values||{})},disabled:m,children:"Cancel"}),(0,_.jsx)(z.Button,{type:"primary",onClick:y,loading:m,children:"Save Changes"})]}):(0,_.jsx)(z.Button,{type:"primary",onClick:()=>d(!0),children:"Edit Settings"}))]}),l?.field_schema?.description&&(0,_.jsx)(x,{className:"mb-4",children:l.field_schema.description}),(0,_.jsx)(ea,{}),(0,_.jsx)("div",{className:"mt-4 space-y-4",children:(()=>{let{values:e,field_schema:r}=l;return r&&r.properties?Object.entries(r.properties).map(([r,a])=>{let s=e[r],n=r.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,_.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200 last:border-0",children:[(0,_.jsx)(Z.Text,{className:"font-medium text-lg",children:n}),(0,_.jsx)(x,{className:"text-sm text-gray-500 mt-1",children:a.description||"No description available"}),o?(0,_.jsx)("div",{className:"mt-2",children:((e,r,a)=>{let s=r.type;if("teams"===e){let t,r;return(0,_.jsx)("div",{className:"mt-2",children:(t=v(c[e]||[]),r=(e,r,a)=>{let s=[...t];s[e]={...s[e],[r]:a},b("teams",s)},(0,_.jsxs)("div",{className:"space-y-3",children:[t.map((e,a)=>(0,_.jsxs)("div",{className:"border rounded-lg p-4 bg-gray-50",children:[(0,_.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,_.jsxs)(Z.Text,{className:"font-medium",children:["Team ",a+1]}),(0,_.jsx)(z.Button,{size:"small",danger:!0,icon:(0,_.jsx)(jQ.DeleteOutlined,{}),onClick:()=>{b("teams",t.filter((e,t)=>t!==a))},children:"Remove"})]}),(0,_.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium mb-1",children:"Team ID"}),(0,_.jsx)(et.TextInput,{value:e.team_id,onChange:e=>r(a,"team_id",e.target.value),placeholder:"Enter team ID"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium mb-1",children:"Max Budget in Team"}),(0,_.jsx)(tq.InputNumber,{style:{width:"100%"},value:e.max_budget_in_team,onChange:e=>r(a,"max_budget_in_team",e),placeholder:"Optional",min:0,step:.01,precision:2})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"text-sm font-medium mb-1",children:"User Role"}),(0,_.jsxs)(eE.Select,{style:{width:"100%"},value:e.user_role,onChange:e=>r(a,"user_role",e),children:[(0,_.jsx)(g,{value:"user",children:"User"}),(0,_.jsx)(g,{value:"admin",children:"Admin"})]})]})]})]},a)),(0,_.jsx)(z.Button,{icon:(0,_.jsx)(tZ.PlusOutlined,{}),onClick:()=>{b("teams",[...t,{team_id:"",user_role:"user"}])},className:"w-full",children:"Add Team"})]}))})}if("user_role"===e&&t)return(0,_.jsx)(eE.Select,{style:{width:"100%"},value:c[e]||"",onChange:t=>b(e,t),className:"mt-2",children:Object.entries(t).filter(([e])=>e.includes("internal_user")).map(([e,{ui_label:t,description:r}])=>(0,_.jsx)(g,{value:e,children:(0,_.jsxs)("div",{className:"flex items-center",children:[(0,_.jsx)("span",{children:t}),(0,_.jsx)("span",{className:"ml-2 text-xs text-gray-500",children:r})]})},e))});if("budget_duration"===e)return(0,_.jsx)(En.default,{value:c[e]||null,onChange:t=>b(e,t),className:"mt-2"});if("boolean"===s)return(0,_.jsx)("div",{className:"mt-2",children:(0,_.jsx)(e_.Switch,{checked:!!c[e],onChange:t=>b(e,t)})});if("array"===s&&r.items?.enum)return(0,_.jsx)(eE.Select,{mode:"multiple",style:{width:"100%"},value:c[e]||[],onChange:t=>b(e,t),className:"mt-2",children:r.items.enum.map(e=>(0,_.jsx)(g,{value:e,children:e},e))});else if("models"===e)return(0,_.jsxs)(eE.Select,{mode:"multiple",style:{width:"100%"},value:c[e]||[],onChange:t=>b(e,t),className:"mt-2",children:[(0,_.jsx)(g,{value:"no-default-models",children:"No Default Models"},"no-default-models"),(0,_.jsx)(g,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),h.map(e=>(0,_.jsx)(g,{value:e,children:(0,tQ.getModelDisplayName)(e)},e))]});else if("string"===s&&r.enum)return(0,_.jsx)(eE.Select,{style:{width:"100%"},value:c[e]||"",onChange:t=>b(e,t),className:"mt-2",children:r.enum.map(e=>(0,_.jsx)(g,{value:e,children:e},e))});else return(0,_.jsx)(et.TextInput,{value:void 0!==c[e]?String(c[e]):"",onChange:t=>b(e,t.target.value),placeholder:r.description||"",className:"mt-2"})})(r,a,0)}):(0,_.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:((e,r)=>{if(null==r)return(0,_.jsx)("span",{className:"text-gray-400",children:"Not set"});if("teams"===e&&Array.isArray(r)){if(0===r.length)return(0,_.jsx)("span",{className:"text-gray-400",children:"No teams assigned"});let e=v(r);return(0,_.jsx)("div",{className:"space-y-2 mt-1",children:e.map((e,t)=>(0,_.jsx)("div",{className:"border rounded-lg p-3 bg-white",children:(0,_.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2 text-sm",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{className:"font-medium text-gray-600",children:"Team ID:"}),(0,_.jsx)("p",{className:"text-gray-900",children:e.team_id||"Not specified"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{className:"font-medium text-gray-600",children:"Max Budget:"}),(0,_.jsx)("p",{className:"text-gray-900",children:void 0!==e.max_budget_in_team?`$${(0,rV.formatNumberWithCommas)(e.max_budget_in_team,4)}`:"No limit"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{className:"font-medium text-gray-600",children:"Role:"}),(0,_.jsx)("p",{className:"text-gray-900 capitalize",children:e.user_role})]})]})},t))})}if("user_role"===e&&t&&t[r]){let{ui_label:e,description:a}=t[r];return(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{className:"font-medium",children:e}),a&&(0,_.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:a})]})}if("budget_duration"===e)return(0,_.jsx)("span",{children:(0,En.getBudgetDurationLabel)(r)});if("boolean"==typeof r)return(0,_.jsx)("span",{children:r?"Enabled":"Disabled"});if("models"===e&&Array.isArray(r))return 0===r.length?(0,_.jsx)("span",{className:"text-gray-400",children:"None"}):(0,_.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:r.map((e,t)=>(0,_.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:(0,tQ.getModelDisplayName)(e)},t))});if("object"==typeof r)return Array.isArray(r)?0===r.length?(0,_.jsx)("span",{className:"text-gray-400",children:"None"}):(0,_.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:r.map((e,t)=>(0,_.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:"object"==typeof e?JSON.stringify(e):String(e)},t))}):(0,_.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(r,null,2)});return(0,_.jsx)("span",{children:String(r)})})(r,s)})]},r)}):(0,_.jsx)(Z.Text,{children:"No schema information available"})})()})]}):(0,_.jsx)(P.Card,{children:(0,_.jsx)(Z.Text,{children:"No settings available or you do not have permission to view them."})})};var RQ=e.i(502275);let RX=(e,t,r,a,s,n)=>{let l=[{header:"User ID",accessorKey:"user_id",enableSorting:!0,cell:({row:e})=>(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)(tB.Tooltip,{title:e.original.user_id,children:(0,_.jsx)("span",{className:"text-xs",children:e.original.user_id?`${e.original.user_id.slice(0,7)}...`:"-"})}),e.original.user_id&&(0,_.jsx)(tB.Tooltip,{title:"Copy User ID",children:(0,_.jsx)(ei.CopyOutlined,{onClick:t=>{t.stopPropagation(),(0,rV.copyToClipboard)(e.original.user_id,"User ID copied to clipboard")},className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]})},{header:"Email",accessorKey:"user_email",enableSorting:!0,cell:({row:e})=>(0,_.jsx)("span",{className:"text-xs",children:e.original.user_email||"-"})},{id:"status",header:"Status",enableSorting:!1,cell:({row:e})=>e.original.metadata?.scim_active===!1?(0,_.jsx)(tB.Tooltip,{title:"Deactivated via SCIM (external identity provider). The user's virtual keys are blocked.",children:(0,_.jsx)(eN.Tag,{color:"red","data-testid":`user-status-${e.original.user_id}`,children:"Inactive"})}):(0,_.jsx)(eN.Tag,{color:"green","data-testid":`user-status-${e.original.user_id}`,children:"Active"})},{header:"Global Proxy Role",accessorKey:"user_role",enableSorting:!0,cell:({row:t})=>(0,_.jsx)("span",{className:"text-xs",children:e?.[t.original.user_role]?.ui_label||"-"})},{header:"User Alias",accessorKey:"user_alias",enableSorting:!1,cell:({row:e})=>(0,_.jsx)("span",{className:"text-xs",children:e.original.user_alias||"-"})},{header:"Spend (USD)",accessorKey:"spend",enableSorting:!0,cell:({row:e})=>(0,_.jsx)("span",{className:"text-xs",children:e.original.spend?(0,rV.formatNumberWithCommas)(e.original.spend,4):"-"})},{header:"Budget (USD)",accessorKey:"max_budget",enableSorting:!1,cell:({row:e})=>(0,_.jsx)("span",{className:"text-xs",children:null!==e.original.max_budget?e.original.max_budget:"Unlimited"})},{header:()=>(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)("span",{children:"SSO ID"}),(0,_.jsx)(tB.Tooltip,{title:"SSO ID is the ID of the user in the SSO provider. If the user is not using SSO, this will be null.",children:(0,_.jsx)(RQ.InformationCircleIcon,{className:"w-4 h-4"})})]}),accessorKey:"sso_user_id",enableSorting:!1,cell:({row:e})=>(0,_.jsx)("span",{className:"text-xs",children:null!==e.original.sso_user_id?e.original.sso_user_id:"-"})},{header:"Virtual Keys",accessorKey:"key_count",enableSorting:!1,cell:({row:e})=>(0,_.jsx)(ee.Grid,{numItems:2,children:e.original.key_count>0?(0,_.jsxs)(tR.Badge,{size:"xs",color:"indigo",children:[e.original.key_count," ",1===e.original.key_count?"Key":"Keys"]}):(0,_.jsx)(tR.Badge,{size:"xs",color:"gray",children:"No Keys"})})},{header:"Created At",accessorKey:"created_at",enableSorting:!0,cell:({row:e})=>(0,_.jsx)("span",{className:"text-xs",children:e.original.created_at?new Date(e.original.created_at).toLocaleDateString():"-"})},{header:"Updated At",accessorKey:"updated_at",enableSorting:!1,cell:({row:e})=>(0,_.jsx)("span",{className:"text-xs",children:e.original.updated_at?new Date(e.original.updated_at).toLocaleDateString():"-"})},{id:"actions",header:"Actions",enableSorting:!1,cell:({row:e})=>(0,_.jsxs)("div",{className:"flex gap-2",children:[(0,_.jsx)(tB.Tooltip,{title:"Edit user details",children:(0,_.jsx)(yi.Icon,{icon:jR.PencilAltIcon,size:"sm",onClick:()=>s(e.original.user_id,!0),className:"cursor-pointer hover:text-blue-600"})}),(0,_.jsx)(tB.Tooltip,{title:"Delete user",children:(0,_.jsx)(yi.Icon,{icon:jO.TrashIcon,size:"sm",onClick:()=>r(e.original),className:"cursor-pointer hover:text-red-600"})}),(0,_.jsx)(tB.Tooltip,{title:"Reset Password",children:(0,_.jsx)(yi.Icon,{icon:jt.RefreshIcon,size:"sm",onClick:()=>a(e.original.user_id),className:"cursor-pointer hover:text-green-600"})})]})}];if(n){let{onSelectUser:e,onSelectAll:t,isUserSelected:r,isAllSelected:a,isIndeterminate:s}=n;return[{id:"select",enableSorting:!1,header:()=>(0,_.jsx)(eA.Checkbox,{indeterminate:s,checked:a,onChange:e=>t(e.target.checked),onClick:e=>e.stopPropagation()}),cell:({row:t})=>(0,_.jsx)(eA.Checkbox,{checked:r(t.original),onChange:r=>e(t.original,r.target.checked),onClick:e=>e.stopPropagation()})},...l]}return l};function RZ({userId:e,onClose:t,accessToken:r,userRole:a,onDelete:s,possibleUIRoles:n,initialTab:l=0,startInEditMode:i=!1}){let[o,d]=(0,T.useState)(null),[c,u]=(0,T.useState)([]),[m,p]=(0,T.useState)(!1),[h,f]=(0,T.useState)(!1),[x,g]=(0,T.useState)(!0),[y,b]=(0,T.useState)(i),[v,j]=(0,T.useState)([]),[w,k]=(0,T.useState)(!1),[N,M]=(0,T.useState)(null),[C,L]=(0,T.useState)(null),[O,D]=(0,T.useState)(l),[B,$]=(0,T.useState)({}),[U,W]=(0,T.useState)(!1),[V,G]=(0,T.useState)(!1),[K,et]=(0,T.useState)(!1),[er,ea]=(0,T.useState)(null),[es,en]=(0,T.useState)(!1),[el,ei]=(0,T.useState)(!1),[eo,ed]=(0,T.useState)([]),[ec,eu]=(0,T.useState)(""),[em,ep]=(0,T.useState)("user"),[eh,ef]=(0,T.useState)(!1);T.default.useEffect(()=>{L((0,Q.getProxyBaseUrl)())},[]),T.default.useEffect(()=>{console.log(`userId: ${e}, userRole: ${a}, accessToken: ${r}`),(async()=>{try{if(!r)return;let t=await (0,Q.userGetInfoV2)(r,e);if(d(t),t.teams&&t.teams.length>0)try{let e=t.teams.map(async e=>{try{let t=await (0,Q.teamInfoCall)(r,e);return{team_id:e,team_alias:t?.team_info?.team_alias||null}}catch{return{team_id:e,team_alias:null}}}),a=await Promise.all(e);u(a)}catch{u(t.teams.map(e=>({team_id:e,team_alias:null})))}let s=(await (0,Q.modelAvailableCall)(r,e,a||"")).data.map(e=>e.id);j(s)}catch(e){console.error("Error fetching user data:",e),J.default.fromBackend("Failed to fetch user data")}finally{g(!1)}})()},[r,e,a]);let ex="proxy_admin"===a||"Admin"===a,eg=async()=>{if(r){ef(!0);try{let e=await (0,Q.teamListCall)(r,null);ed((e||[]).map(e=>({team_id:e.team_id,team_alias:e.team_alias||e.team_id})))}catch(e){console.error("Error fetching teams:",e)}finally{ef(!1)}}},ey=async()=>{if(r&&ec){en(!0);try{await (0,Q.teamMemberAddCall)(r,ec,{role:em,user_id:e}),J.default.success("User added to team successfully"),G(!1);let t=await (0,Q.userGetInfoV2)(r,e);if(d(t),t.teams&&t.teams.length>0){let e=t.teams.map(async e=>{try{let t=await (0,Q.teamInfoCall)(r,e);return{team_id:e,team_alias:t?.team_info?.team_alias||null}}catch{return{team_id:e,team_alias:null}}});u(await Promise.all(e))}else u([])}catch(e){console.error("Error adding user to team:",e),J.default.fromBackend(e?.message||"Failed to add user to team")}finally{en(!1)}}},e_=async()=>{if(r&&er){ei(!0);try{await (0,Q.teamMemberDeleteCall)(r,er.team_id,{role:"user",user_id:e}),J.default.success("User removed from team successfully"),et(!1),ea(null);let t=await (0,Q.userGetInfoV2)(r,e);if(d(t),t.teams&&t.teams.length>0){let e=t.teams.map(async e=>{try{let t=await (0,Q.teamInfoCall)(r,e);return{team_id:e,team_alias:t?.team_info?.team_alias||null}}catch{return{team_id:e,team_alias:null}}});u(await Promise.all(e))}else u([])}catch(e){console.error("Error removing user from team:",e),J.default.fromBackend(e?.message||"Failed to remove user from team")}finally{ei(!1)}}},eb=eo.filter(e=>!c.some(t=>t.team_id===e.team_id)),ev=async()=>{if(!r)return void J.default.fromBackend("Access token not found");try{J.default.success("Generating password reset link...");let t=await (0,Q.invitationCreateCall)(r,e);M(t),k(!0)}catch(e){J.default.fromBackend("Failed to generate password reset link")}},ej=async()=>{try{if(!r)return;f(!0),await (0,Q.userDeleteCall)(r,[e]),J.default.success("User deleted successfully"),s&&s(),t()}catch(e){console.error("Error deleting user:",e),J.default.fromBackend("Failed to delete user")}finally{p(!1),f(!1)}},ew=async e=>{try{if(!r||!o)return;await (0,Q.userUpdateUserCall)(r,e,null),d({...o,user_email:e.user_email??o.user_email,user_alias:e.user_alias??o.user_alias,models:e.models??o.models,max_budget:e.max_budget??o.max_budget,budget_duration:e.budget_duration??o.budget_duration,metadata:e.metadata??o.metadata}),J.default.success("User updated successfully"),b(!1)}catch(e){console.error("Error updating user:",e),J.default.fromBackend("Failed to update user")}};if(x)return(0,_.jsxs)("div",{className:"p-4",children:[(0,_.jsx)(S.Button,{icon:rH.ArrowLeftIcon,variant:"light",onClick:t,className:"mb-4",children:"Back to Users"}),(0,_.jsx)(Z.Text,{children:"Loading user data..."})]});if(!o)return(0,_.jsxs)("div",{className:"p-4",children:[(0,_.jsx)(S.Button,{icon:rH.ArrowLeftIcon,variant:"light",onClick:t,className:"mb-4",children:"Back to Users"}),(0,_.jsx)(Z.Text,{children:"User not found"})]});let ek=async(e,t)=>{await (0,rV.copyToClipboard)(e)&&($(e=>({...e,[t]:!0})),setTimeout(()=>{$(e=>({...e,[t]:!1}))},2e3))},eS={user_id:o.user_id,user_info:{user_email:o.user_email,user_alias:o.user_alias,user_role:o.user_role,models:o.models,max_budget:o.max_budget,budget_duration:o.budget_duration,metadata:o.metadata}};return(0,_.jsxs)("div",{className:"p-4",children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(S.Button,{icon:rH.ArrowLeftIcon,variant:"light",onClick:t,className:"mb-4",children:"Back to Users"}),(0,_.jsx)(X.Title,{children:o.user_email||"User"}),(0,_.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,_.jsx)(Z.Text,{className:"text-gray-500 font-mono",children:o.user_id}),(0,_.jsx)(z.Button,{type:"text",size:"small",icon:B["user-id"]?(0,_.jsx)(M_.CheckIcon,{size:12}):(0,_.jsx)(Mb.CopyIcon,{size:12}),onClick:()=>ek(o.user_id,"user-id"),className:`left-2 z-10 transition-all duration-200 ${B["user-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`})]})]}),a&&ts.rolesWithWriteAccess.includes(a)&&(0,_.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,_.jsx)(S.Button,{icon:jt.RefreshIcon,variant:"secondary",onClick:ev,className:"flex items-center",children:"Reset Password"}),(0,_.jsx)(S.Button,{icon:jO.TrashIcon,variant:"secondary",onClick:()=>p(!0),className:"flex items-center text-red-500 border-red-500 hover:text-red-600 hover:border-red-600",children:"Delete User"})]})]}),(0,_.jsx)(eH.default,{isOpen:m,title:"Delete User?",message:"Are you sure you want to delete this user? This action cannot be undone.",resourceInformationTitle:"User Information",resourceInformation:[{label:"Email",value:o.user_email},{label:"User ID",value:o.user_id,code:!0},{label:"Global Proxy Role",value:o.user_role&&n?.[o.user_role]?.ui_label||o.user_role||"-"},{label:"Total Spend (USD)",value:null!==o.spend&&void 0!==o.spend?o.spend.toFixed(2):void 0}],onCancel:()=>{p(!1)},onOk:ej,confirmLoading:h}),(0,_.jsxs)(rF.TabGroup,{defaultIndex:O,onIndexChange:D,children:[(0,_.jsxs)(rR.TabList,{className:"mb-4",children:[(0,_.jsx)(rY.Tab,{children:"Overview"}),(0,_.jsx)(rY.Tab,{children:"Details"})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(ee.Grid,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Spend"}),(0,_.jsxs)("div",{className:"mt-2",children:[(0,_.jsxs)(X.Title,{children:["$",(0,rV.formatNumberWithCommas)(o.spend||0,4)]}),(0,_.jsxs)(Z.Text,{children:["of"," ",null!==o.max_budget?`$${(0,rV.formatNumberWithCommas)(o.max_budget,4)}`:"Unlimited"]})]})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,_.jsx)(Z.Text,{children:"Teams"}),ex&&(0,_.jsx)(S.Button,{icon:CO.PlusIcon,variant:"light",size:"xs",onClick:()=>{eu(""),ep("user"),G(!0),eg()},children:"Add Team"})]}),(0,_.jsxs)("div",{className:"mt-2",children:[c.length>0?(0,_.jsx)("div",{className:"max-h-60 overflow-y-auto",children:(0,_.jsxs)(A.Table,{children:[(0,_.jsx)(Y.TableHead,{children:(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(F.TableHeaderCell,{children:"Team Name"}),ex&&(0,_.jsx)(F.TableHeaderCell,{className:"text-right",children:"Actions"})]})}),(0,_.jsx)(E.TableBody,{children:c.slice(0,U?c.length:20).map(e=>(0,_.jsxs)(R.TableRow,{children:[(0,_.jsx)(I.TableCell,{children:e.team_alias||e.team_id}),ex&&(0,_.jsx)(I.TableCell,{className:"text-right",children:(0,_.jsx)(S.Button,{icon:jO.TrashIcon,variant:"light",size:"xs",color:"red",onClick:()=>{ea(e),et(!0)}})})]},e.team_id))})]})}):(0,_.jsx)(Z.Text,{children:"No teams"}),!U&&c.length>20&&(0,_.jsxs)(S.Button,{variant:"light",size:"xs",className:"mt-2",onClick:()=>W(!0),children:["+",c.length-20," more"]}),U&&c.length>20&&(0,_.jsx)(S.Button,{variant:"light",size:"xs",className:"mt-2",onClick:()=>W(!1),children:"Show Less"})]})]}),(0,_.jsxs)(P.Card,{children:[(0,_.jsx)(Z.Text,{children:"Personal Models"}),(0,_.jsx)("div",{className:"mt-2",children:o.models?.length&&o.models?.length>0?o.models?.map((e,t)=>(0,_.jsx)(Z.Text,{children:e},t)):(0,_.jsx)(Z.Text,{children:"All proxy models"})})]})]})}),(0,_.jsx)(rB.TabPanel,{children:(0,_.jsxs)(P.Card,{children:[(0,_.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,_.jsx)(X.Title,{children:"User Settings"}),!y&&a&&ts.rolesWithWriteAccess.includes(a)&&(0,_.jsx)(S.Button,{onClick:()=>b(!0),children:"Edit Settings"})]}),y&&o?(0,_.jsx)(R$,{userData:eS,onCancel:()=>b(!1),onSubmit:ew,teams:c,accessToken:r,userID:e,userRole:a,userModels:v,possibleUIRoles:n}):(0,_.jsxs)("div",{className:"space-y-4",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"User ID"}),(0,_.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,_.jsx)(Z.Text,{className:"font-mono",children:o.user_id}),(0,_.jsx)(z.Button,{type:"text",size:"small",icon:B["user-id"]?(0,_.jsx)(M_.CheckIcon,{size:12}):(0,_.jsx)(Mb.CopyIcon,{size:12}),onClick:()=>ek(o.user_id,"user-id"),className:`left-2 z-10 transition-all duration-200 ${B["user-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`})]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Email"}),(0,_.jsx)(Z.Text,{children:o.user_email||"Not Set"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"User Alias"}),(0,_.jsx)(Z.Text,{children:o.user_alias||"Not Set"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Global Proxy Role"}),(0,_.jsx)(Z.Text,{children:o.user_role||"Not Set"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Created"}),(0,_.jsx)(Z.Text,{children:o.created_at?new Date(o.created_at).toLocaleString():"Unknown"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Last Updated"}),(0,_.jsx)(Z.Text,{children:o.updated_at?new Date(o.updated_at).toLocaleString():"Unknown"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Personal Models"}),(0,_.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:o.models?.length&&o.models?.length>0?o.models?.map((e,t)=>(0,_.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e},t)):(0,_.jsx)(Z.Text,{children:"All proxy models"})})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Max Budget"}),(0,_.jsx)(Z.Text,{children:null!==o.max_budget&&void 0!==o.max_budget?`$${(0,rV.formatNumberWithCommas)(o.max_budget,4)}`:"Unlimited"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Budget Reset"}),(0,_.jsx)(Z.Text,{children:(0,En.getBudgetDurationLabel)(o.budget_duration??null)})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(Z.Text,{className:"font-medium",children:"Metadata"}),(0,_.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(o.metadata||{},null,2)})]})]})]})})]})]}),(0,_.jsx)(RK.default,{isInvitationLinkModalVisible:w,setIsInvitationLinkModalVisible:k,baseUrl:C||"",invitationLinkData:N,modalType:"resetPassword"}),(0,_.jsx)(eH.default,{isOpen:K,title:"Remove from Team",alertMessage:"Removing this user from the team will also delete any keys the user created for this team.",message:"Are you sure you want to remove this user from the team? This action cannot be undone.",resourceInformationTitle:"Team Membership",resourceInformation:[{label:"Team",value:er?.team_alias||er?.team_id},{label:"User ID",value:o?.user_id,code:!0},{label:"Email",value:o?.user_email}],onCancel:()=>{et(!1),ea(null)},onOk:e_,confirmLoading:el}),(0,_.jsx)(q.Modal,{title:"Add User to Team",open:V,onCancel:()=>G(!1),footer:null,width:500,maskClosable:!es,children:(0,_.jsxs)(H.Form,{layout:"vertical",onFinish:ey,children:[(0,_.jsx)(H.Form.Item,{label:"Team",required:!0,children:(0,_.jsx)(eE.Select,{showSearch:!0,value:ec||void 0,onChange:eu,placeholder:"Select a team",filterOption:(e,t)=>{let r=eb.find(e=>e.team_id===t?.value);return!!r&&r.team_alias.toLowerCase().includes(e.toLowerCase())},loading:eh,children:eb.map(e=>(0,_.jsx)(eE.Select.Option,{value:e.team_id,children:e.team_alias},e.team_id))})}),(0,_.jsx)(H.Form.Item,{label:"Member Role",children:(0,_.jsxs)(eE.Select,{value:em,onChange:ep,children:[(0,_.jsx)(eE.Select.Option,{value:"user",children:(0,_.jsxs)(tB.Tooltip,{title:"Can view team info, but not manage it",children:[(0,_.jsx)("span",{className:"font-medium",children:"user"}),(0,_.jsx)("span",{className:"ml-2 text-gray-500 text-sm",children:"- Can view team info, but not manage it"})]})}),(0,_.jsx)(eE.Select.Option,{value:"admin",children:(0,_.jsxs)(tB.Tooltip,{title:"Can create team keys, add members, and manage settings",children:[(0,_.jsx)("span",{className:"font-medium",children:"admin"}),(0,_.jsx)("span",{className:"ml-2 text-gray-500 text-sm",children:"- Can create team keys, add members, and manage settings"})]})})]})}),(0,_.jsx)("div",{className:"text-right mt-4",children:(0,_.jsx)(z.Button,{type:"primary",htmlType:"submit",loading:es,disabled:!ec,children:es?"Adding...":"Add to Team"})})]})})]})}var R0=e.i(655913),R1=e.i(38419),R2=e.i(78334),R4=e.i(555436),R5=e.i(284614);let R6=(0,eT.default)("circle-user-round",[["path",{d:"M18 20a6 6 0 0 0-12 0",key:"1qehca"}],["circle",{cx:"12",cy:"10",r:"4",key:"1h16sb"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);function R3({data:e=[],columns:t,isLoading:r=!1,onSortChange:a,currentSort:s,accessToken:n,userRole:l,possibleUIRoles:i,handleEdit:o,handleDelete:d,handleResetPassword:c,selectedUsers:u=[],onSelectionChange:m,enableSelection:p=!1,filters:h,updateFilters:f,initialFilters:x,teams:g,userListResponse:y,currentPage:b,handlePageChange:v}){let[j,w]=T.default.useState([{id:s?.sortBy||"created_at",desc:s?.sortOrder==="desc"}]),[k,S]=T.default.useState(null),[N,M]=T.default.useState(!1),[C,L]=T.default.useState(!1),O=(e,t=!1)=>{S(e),M(t)},D=(e,t)=>{m&&(t?m([...u,e]):m(u.filter(t=>t.user_id!==e.user_id)))},P=t=>{m&&(t?m(e):m([]))},B=e=>u.some(t=>t.user_id===e.user_id),z=e.length>0&&u.length===e.length,H=u.length>0&&u.lengthi?RX(i,o,d,c,O,p?{selectedUsers:u,onSelectUser:D,onSelectAll:P,isUserSelected:B,isAllSelected:z,isIndeterminate:H}:void 0):t,[i,o,d,c,O,t,p,u,z,H]),q=(0,jD.useReactTable)({data:e,columns:$,state:{sorting:j},onSortingChange:e=>{let t="function"==typeof e?e(j):e;if(w(t),t&&Array.isArray(t)&&t.length>0&&t[0]){let e=t[0];if(e.id){let t=e.id,r=e.desc?"desc":"asc";a?.(t,r)}}else a?.("created_at","desc")},getCoreRowModel:(0,jP.getCoreRowModel)(),manualSorting:!0,enableSorting:!0});return(T.default.useEffect(()=>{s&&w([{id:s.sortBy,desc:"desc"===s.sortOrder}])},[s]),k)?(0,_.jsx)(RZ,{userId:k,onClose:()=>{S(null),M(!1)},accessToken:n,userRole:l,possibleUIRoles:i,initialTab:+!!N,startInEditMode:N}):(0,_.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,_.jsx)("div",{className:"border-b px-6 py-4",children:(0,_.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,_.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,_.jsx)(R0.FilterInput,{placeholder:"Search by email...",value:h.email,onChange:e=>f({email:e}),icon:R4.Search}),(0,_.jsx)(R1.FiltersButton,{onClick:()=>L(!C),active:C,hasActiveFilters:!!(h.user_id||h.user_role||h.team)}),(0,_.jsx)(R2.ResetFiltersButton,{onClick:()=>{f(x)}})]}),C&&(0,_.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,_.jsx)(R0.FilterInput,{placeholder:"Filter by User ID",value:h.user_id,onChange:e=>f({user_id:e}),icon:R5.User}),(0,_.jsx)(R0.FilterInput,{placeholder:"Filter by SSO ID",value:h.sso_user_id,onChange:e=>f({sso_user_id:e}),icon:R6}),(0,_.jsx)("div",{className:"w-64",children:(0,_.jsx)(jc.Select,{value:h.user_role,onValueChange:e=>f({user_role:e}),placeholder:"Select Role",children:i&&Object.entries(i).map(([e,t])=>(0,_.jsx)(ju.SelectItem,{value:e,children:t.ui_label},e))})}),(0,_.jsx)("div",{className:"w-64",children:(0,_.jsx)(jc.Select,{value:h.team,onValueChange:e=>f({team:e}),placeholder:"Select Team",children:g?.map(e=>(0,_.jsx)(ju.SelectItem,{value:e.team_id,children:e.team_alias||e.team_id},e.team_id))})})]}),(0,_.jsxs)("div",{className:"flex justify-between items-center",children:[r?(0,_.jsx)(ey.Skeleton.Input,{active:!0,style:{width:192,height:20}}):(0,_.jsxs)("span",{className:"text-sm text-gray-700",children:["Showing"," ",y&&y.users&&y.users.length>0?(y.page-1)*y.page_size+1:0," ","-"," ",y&&y.users?Math.min(y.page*y.page_size,y.total):0," ","of ",y?y.total:0," results"]}),(0,_.jsx)("div",{className:"flex space-x-2",children:r?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(ey.Skeleton.Button,{active:!0,size:"small",style:{width:80,height:30}}),(0,_.jsx)(ey.Skeleton.Button,{active:!0,size:"small",style:{width:60,height:30}})]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("button",{onClick:()=>v(b-1),disabled:1===b,className:`px-3 py-1 text-sm border rounded-md ${1===b?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"}`,children:"Previous"}),(0,_.jsx)("button",{onClick:()=>v(b+1),disabled:!y||b>=y.total_pages,className:`px-3 py-1 text-sm border rounded-md ${!y||b>=y.total_pages?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"}`,children:"Next"})]})})]})]})}),(0,_.jsx)("div",{className:"overflow-auto",children:(0,_.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,_.jsx)("div",{className:"overflow-x-auto",children:(0,_.jsxs)(A.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,_.jsx)(Y.TableHead,{children:q.getHeaderGroups().map(e=>(0,_.jsx)(R.TableRow,{children:e.headers.map(e=>(0,_.jsx)(F.TableHeaderCell,{className:`py-1 h-8 ${"actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""} ${e.column.getCanSort()?"cursor-pointer hover:bg-gray-50":""}`,onClick:e.column.getToggleSortingHandler(),children:(0,_.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,_.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,jD.flexRender)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&e.column.getCanSort()&&(0,_.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,_.jsx)(jC.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,_.jsx)(jM.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,_.jsx)(jL.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,_.jsx)(E.TableBody,{children:r?(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:$.length,className:"h-8 text-center",children:(0,_.jsx)("div",{className:"text-center text-gray-500",children:(0,_.jsx)("p",{children:"🚅 Loading users..."})})})}):e.length>0?q.getRowModel().rows.map(e=>(0,_.jsx)(R.TableRow,{className:"h-8",children:e.getVisibleCells().map(e=>(0,_.jsx)(I.TableCell,{className:`py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ${"actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""}`,onClick:()=>{"user_id"===e.column.id&&O(e.getValue(),!1)},style:{cursor:"user_id"===e.column.id?"pointer":"default",color:"user_id"===e.column.id?"#3b82f6":"inherit"},children:(0,jD.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,_.jsx)(R.TableRow,{children:(0,_.jsx)(I.TableCell,{colSpan:$.length,className:"h-8 text-center",children:(0,_.jsx)("div",{className:"text-center text-gray-500",children:(0,_.jsx)("p",{children:"No users found"})})})})})]})})})})]})}let{Text:R8,Title:R7}=V.Typography,R9={email:"",user_id:"",user_role:"",sso_user_id:"",team:"",model:"",min_spend:null,max_spend:null,sort_by:"created_at",sort_order:"desc"},Be=({accessToken:e,token:t,userRole:r,userID:a,teams:s,orgAdminOrgIds:n})=>{let l=!!r&&(0,ts.isProxyAdminRole)(r),i=(0,eh.useQueryClient)(),[o,d]=(0,T.useState)(1),[c,u]=(0,T.useState)(!1),[m,p]=(0,T.useState)(null),[h,f]=(0,T.useState)(!1),[x,g]=(0,T.useState)(!1),[y,b]=(0,T.useState)(null),[v,j]=(0,T.useState)("users"),[w,k]=(0,T.useState)(R9),[S,N,M]=(0,Dj.useDebouncedState)(w,{wait:300}),[C,L]=(0,T.useState)(!1),[O,D]=(0,T.useState)(null),[P,A]=(0,T.useState)(null),[E,I]=(0,T.useState)([]),[Y,F]=(0,T.useState)(!1),[R,B]=(0,T.useState)(!1),[H,$]=(0,T.useState)([]),q=e=>{b(e),f(!0)};(0,T.useEffect)(()=>()=>{M.cancel()},[M]),(0,T.useEffect)(()=>{A((0,Q.getProxyBaseUrl)())},[]),(0,T.useEffect)(()=>{(async()=>{try{if(!a||!r||!e)return;let t=(await (0,Q.modelAvailableCall)(e,a,r)).data.map(e=>e.id);console.log("available_model_names:",t),$(t)}catch(e){console.error("Error fetching user models:",e)}})()},[e,a,r]);let U=e=>{k(t=>{let r={...t,...e};return N(r),r})},W=(e,t)=>{U({sort_by:e,sort_order:t})},V=async t=>{if(!e)return void J.default.fromBackend("Access token not found");try{J.default.success("Generating password reset link...");let r=await (0,Q.invitationCreateCall)(e,t);D(r),L(!0)}catch(e){J.default.fromBackend("Failed to generate password reset link")}},G=async()=>{if(y&&e)try{g(!0),await (0,Q.userDeleteCall)(e,[y.user_id]),i.setQueriesData({queryKey:["userList"]},e=>{if(void 0===e)return e;let t=e.users.filter(e=>e.user_id!==y.user_id);return{...e,users:t}}),J.default.success("User deleted successfully")}catch(e){console.error("Error deleting user:",e),J.default.fromBackend("Failed to delete user")}finally{f(!1),b(null),g(!1)}},K=async()=>{p(null),u(!1)},X=async s=>{if(console.log("inside handleEditSubmit:",s),e&&t&&r&&a){try{let t=await (0,Q.userUpdateUserCall)(e,s,null);i.setQueriesData({queryKey:["userList"]},e=>{if(void 0===e)return e;let r=e.users.map(e=>e.user_id===t.data.user_id?(0,rV.updateExistingKeys)(e,t.data):e);return{...e,users:r}}),J.default.success(`User ${s.user_id} updated successfully`)}catch(e){console.error("There was an error updating the user",e)}p(null),u(!1)}},Z=async e=>{d(e)},ee=e=>{I(e)},et=(0,ev.useQuery)({queryKey:["userList",{debouncedFilter:S,currentPage:o,orgAdminOrgIds:n}],queryFn:async()=>{if(!e)throw Error("Access token required");return await (0,Q.userListCall)(e,S.user_id?[S.user_id]:null,o,25,S.email||null,S.user_role||null,S.team||null,S.sso_user_id||null,S.sort_by,S.sort_order,n?n.map(e=>e.organization_id):null)},enabled:!!(e&&t&&r&&a),placeholderData:e=>e}),er=et.data,ea=(0,ev.useQuery)({queryKey:["userRoles"],initialData:()=>({}),queryFn:async()=>{if(!e)throw Error("Access token required");return await (0,Q.getPossibleUserRoles)(e)},enabled:!!(e&&t&&r&&a)}).data,es=RX(ea,e=>{p(e),u(!0)},q,V,()=>{});return(0,_.jsxs)("div",{className:"w-full p-8 overflow-hidden",children:[(0,_.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,_.jsx)("div",{className:"flex space-x-3",children:et.isLoading?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(ey.Skeleton.Button,{active:!0,size:"default",shape:"default",style:{width:110,height:36}}),(0,_.jsx)(ey.Skeleton.Button,{active:!0,size:"default",shape:"default",style:{width:145,height:36}}),(0,_.jsx)(ey.Skeleton.Button,{active:!0,size:"default",shape:"default",style:{width:110,height:36}})]}):a&&e?(0,_.jsxs)(_.Fragment,{children:[l&&(0,_.jsx)(RV.CreateUserButton,{userID:a,accessToken:e,teams:s,possibleUIRoles:ea}),l&&(0,_.jsx)(z.Button,{onClick:()=>{B(!R),I([])},type:R?"primary":"default",className:"flex items-center",children:R?"Cancel Selection":"Select Users"}),l&&R&&(0,_.jsxs)(z.Button,{type:"primary",onClick:()=>{0===E.length?J.default.fromBackend("Please select users to edit"):F(!0)},disabled:0===E.length,className:"flex items-center",children:["Bulk Edit (",E.length," selected)"]})]}):null})}),l?(0,_.jsxs)(rF.TabGroup,{defaultIndex:0,onIndexChange:e=>j(0===e?"users":"settings"),children:[(0,_.jsxs)(rR.TabList,{className:"mb-4",children:[(0,_.jsx)(rY.Tab,{children:"Users"}),(0,_.jsx)(rY.Tab,{children:"Default User Settings"})]}),(0,_.jsxs)(rz.TabPanels,{children:[(0,_.jsx)(rB.TabPanel,{children:(0,_.jsx)(R3,{data:et.data?.users||[],columns:es,isLoading:et.isLoading,accessToken:e,userRole:r,onSortChange:W,currentSort:{sortBy:w.sort_by,sortOrder:w.sort_order},possibleUIRoles:ea,handleEdit:e=>{p(e),u(!0)},handleDelete:q,handleResetPassword:V,enableSelection:R,selectedUsers:E,onSelectionChange:ee,filters:w,updateFilters:U,initialFilters:R9,teams:s,userListResponse:er,currentPage:o,handlePageChange:Z})}),(0,_.jsx)(rB.TabPanel,{children:a&&r&&e?(0,_.jsx)(RJ,{accessToken:e,possibleUIRoles:ea,userID:a,userRole:r}):(0,_.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,_.jsx)(ey.Skeleton,{active:!0,paragraph:{rows:4}})})})]})]}):(0,_.jsx)(R3,{data:et.data?.users||[],columns:es,isLoading:et.isLoading,accessToken:e,userRole:r,onSortChange:W,currentSort:{sortBy:w.sort_by,sortOrder:w.sort_order},possibleUIRoles:ea,handleEdit:e=>{p(e),u(!0)},handleDelete:q,handleResetPassword:V,enableSelection:!1,selectedUsers:[],onSelectionChange:ee,filters:w,updateFilters:U,initialFilters:R9,teams:s,userListResponse:er,currentPage:o,handlePageChange:Z}),(0,_.jsx)(RG,{visible:c,possibleUIRoles:ea,onCancel:K,user:m,onSubmit:X}),(0,_.jsx)(eH.default,{isOpen:h,title:"Delete User?",message:"Are you sure you want to delete this user? This action cannot be undone.",resourceInformationTitle:"User Information",resourceInformation:[{label:"Email",value:y?.user_email},{label:"User ID",value:y?.user_id,code:!0},{label:"Global Proxy Role",value:y&&ea?.[y.user_role]?.ui_label||y?.user_role||"-"},{label:"Total Spend (USD)",value:y?.spend?.toFixed(2)}],onCancel:()=>{f(!1),b(null)},onOk:G,confirmLoading:x}),(0,_.jsx)(RK.default,{isInvitationLinkModalVisible:C,setIsInvitationLinkModalVisible:L,baseUrl:P||"",invitationLinkData:O,modalType:"resetPassword"}),(0,_.jsx)(RW,{open:Y,onCancel:()=>F(!1),selectedUsers:E,possibleUIRoles:ea,accessToken:e,onSuccess:()=>{i.invalidateQueries({queryKey:["userList"]}),I([]),B(!1)},teams:s,userRole:r,userModels:H,allowAllUsers:!!r&&(0,ts.isAdminRole)(r)})]})};var Bt=e.i(557951),Br=e.i(321836),Ba=e.i(618566),Bs=e.i(592143);let Bn={};function Bl(){let{authLoading:e,token:t,userID:r,userRole:a,userEmail:s,accessToken:n,premiumUser:l,setUserRole:i,setUserEmail:o}=(0,Bt.useAuth)(),[d,c]=(0,T.useState)(null),[u,m]=(0,T.useState)([]),[p,h]=(0,T.useState)([]),[f,x]=(0,T.useState)([]),[g,y]=(0,T.useState)({PROXY_BASE_URL:"",PROXY_LOGOUT_URL:""}),k=(0,Ba.useRouter)(),S=(0,Ba.useSearchParams)(),[N,M]=(0,T.useState)({data:[]}),[C,L]=(0,T.useState)(!1),[O,D]=(0,T.useState)(!0),[P,A]=(0,T.useState)(!1),[E,I]=(0,T.useState)(!1),[Y,F]=(0,T.useState)(!1),[R,B]=(0,T.useState)(!1),[z,H]=(0,T.useState)(!1),$=S.get("invitation_id"),q="true"===S.get("create"),U=(0,T.useMemo)(()=>{if(!q)return;let e=S.get("owned_by"),t=S.get("team_id"),r=S.get("key_alias"),a=S.get("models"),s=S.get("key_type");if(!e&&!t&&!r&&!a&&!s)return;let n=e&&["you","service_account","another_user"].includes(e)?e:void 0,l=s&&["default","llm_api","management"].includes(s)?s:void 0,i=r?r.trim().slice(0,256):void 0,o=a?a.split(",").slice(0,100).map(e=>e.trim().slice(0,256)).filter(e=>e.length>0):void 0;return{owned_by:n,team_id:t?.trim()||void 0,key_alias:i,models:o&&o.length>0?o:void 0,key_type:l}},[S,q]),[W,V]=(0,T.useState)(()=>S.get("page")||"api-keys"),[G,K]=(0,T.useState)(!1),J=(0,T.useRef)(!1),X=e=>{m(t=>t?[...t,e]:[e]),L(()=>!C)},Z=!1===e&&null===t&&null===$;(0,T.useEffect)(()=>{if(Z){(0,Br.storeReturnUrl)();let e=(Q.proxyBaseUrl||"")+"/ui/login",t=(0,Br.buildLoginUrlWithReturn)(e);window.location.replace(t)}},[Z]);let ee=W in Bn;return((0,T.useEffect)(()=>{if(!e&&ee){let e=(Q.proxyBaseUrl||"")+"/ui";k.replace(`${e}/${Bn[W]}`)}},[e,ee,W,k]),(0,T.useEffect)(()=>{if(e||!t||J.current)return;J.current=!0;let r=(0,Br.consumeReturnUrl)();if(r&&(0,Br.isValidReturnUrl)(r)){let e=new URL(r,window.location.origin);if(e.origin!==window.location.origin)return;let t=window.location.href;(0,Br.normalizeUrlForCompare)(r)!==(0,Br.normalizeUrlForCompare)(t)&&window.location.replace(e.href)}},[e,t]),(0,T.useEffect)(()=>{t||(J.current=!1)},[t]),(0,T.useEffect)(()=>{n&&r&&a&&(0,EP.fetchUserModels)(r,a,n,x),n&&r&&a&&(0,jY.teamListCall)(n,1,100,{userID:"Admin"!==a&&"Admin Viewer"!==a?r:null}).then(e=>c(e.teams??[])).catch(console.error),n&&(0,EA.fetchOrganizations)(n,h)},[n,r,a]),(0,T.useEffect)(()=>{n&&t&&(async()=>{try{let e=await (0,Q.getInProductNudgesCall)(n),t=e?.is_claude_code_enabled||!1;I(t),t&&(F(!0),D(!1))}catch(e){console.error("Failed to fetch in-product nudges:",e)}})()},[n,t]),(0,T.useEffect)(()=>{if(O&&!P){let e=setTimeout(()=>{D(!1)},15e3);return()=>clearTimeout(e)}},[O,P]),(0,T.useEffect)(()=>{if(Y&&!R){let e=setTimeout(()=>{F(!1)},15e3);return()=>clearTimeout(e)}},[Y,R]),e||Z||ee)?(0,_.jsx)(jF.default,{}):(0,_.jsx)(T.Suspense,{fallback:(0,_.jsx)(jF.default,{}),children:(0,_.jsx)(Bs.ConfigProvider,{theme:{algorithm:z?Eg.theme.darkAlgorithm:Eg.theme.defaultAlgorithm},children:(0,_.jsx)(Yx.ThemeProvider,{accessToken:n,children:$?(0,_.jsx)(Yw.default,{userID:r,userRole:a,premiumUser:l,teams:d,keys:u,setUserRole:i,userEmail:s,setUserEmail:o,setTeams:c,setKeys:m,organizations:p,addKey:X,createClicked:C}):(0,_.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,_.jsx)(Dv.default,{setProxySettings:y,proxySettings:g,accessToken:n,isPublicPage:!1,sidebarCollapsed:G,onToggleSidebar:()=>{K(!G)}}),(0,_.jsxs)("div",{className:"flex flex-1",children:[(0,_.jsx)("div",{className:"mt-2",children:(0,_.jsx)(v.default,{setPage:e=>{let t=new URLSearchParams(S);t.set("page",e),window.history.pushState(null,"",`?${t.toString()}`),V(e)},defaultSelectedKey:W,sidebarCollapsed:G})}),"api-keys"==W?(0,_.jsx)(Yw.default,{userID:r,userRole:a,premiumUser:l,teams:d,keys:u,setUserRole:i,userEmail:s,setUserEmail:o,setTeams:c,setKeys:m,organizations:p,addKey:X,createClicked:C,autoOpenCreate:q,prefillData:U}):"models"==W?(0,_.jsx)(j.default,{token:t,keys:u,modelData:N,setModelData:M,premiumUser:l,teams:d}):"llm-playground"==W?(0,_.jsx)(w.default,{}):"users"==W?(0,_.jsx)(Be,{userID:r,userRole:a,token:t,keys:u,teams:d,accessToken:n,setKeys:m}):"teams"==W?(0,_.jsx)(ED,{teams:d,setTeams:c,accessToken:n,userID:r,userRole:a,organizations:p,premiumUser:l,searchParams:S}):"organizations"==W?(0,_.jsx)(EA.default,{organizations:p,setOrganizations:h,userModels:f,accessToken:n,userRole:a,premiumUser:l}):"admin-panel"==W?(0,_.jsx)(tF,{proxySettings:g}):"api_ref"==W||"api-reference"==W?(0,_.jsx)(b.default,{proxySettings:g}):"logging-and-alerts"==W?(0,_.jsx)(I7,{userID:r,userRole:a,accessToken:n,premiumUser:l}):"budgets"==W?(0,_.jsx)(r3,{accessToken:n}):"guardrails"==W?(0,_.jsx)(CM,{accessToken:n,userRole:a}):"policies"==W?(0,_.jsx)(LT,{accessToken:n,userRole:a}):"agents"==W?(0,_.jsx)(rK,{accessToken:n,userRole:a,teams:d}):"prompts"==W?(0,_.jsx)(Ix,{accessToken:n,userRole:a}):"transform-request"==W?(0,_.jsx)(Yf,{accessToken:n}):"router-settings"==W?(0,_.jsx)(ks,{userID:r,userRole:a,accessToken:n,modelData:N}):"ui-theme"==W?(0,_.jsx)(Yg,{userID:r,userRole:a,accessToken:n}):"cost-tracking"==W?(0,_.jsx)(wC,{userID:r,userRole:a,accessToken:n}):"model-hub-table"==W?(0,ts.isAdminRole)(a)?(0,_.jsx)(Db.default,{accessToken:n,publicPage:!1,premiumUser:l,userRole:a}):(0,_.jsx)(Ig.default,{accessToken:n,isEmbedded:!0}):"caching"==W?(0,_.jsx)(jj,{userID:r,userRole:a,token:t,accessToken:n,premiumUser:l}):"pass-through-settings"==W?(0,_.jsx)(EE.default,{userID:r,userRole:a,accessToken:n,modelData:N,premiumUser:l}):"logs"==W?(0,_.jsx)(RH,{userID:r,userRole:a,token:t,accessToken:n,premiumUser:l}):"mcp-servers"==W?(0,_.jsx)(D_,{accessToken:n,userRole:a,userID:r}):"search-tools"==W?(0,_.jsx)(IM,{accessToken:n,userRole:a,userID:r}):"tag-management"==W?(0,_.jsx)(Yh,{accessToken:n,userRole:a,userID:r}):"skills"==W||"claude-code-plugins"==W?(0,_.jsx)(jI,{accessToken:n,userRole:a}):"access-groups"==W?(0,_.jsx)(Yq,{}):"projects"==W?(0,_.jsx)(Y9,{}):"vector-stores"==W?(0,_.jsx)(FS,{accessToken:n,userRole:a,userID:r}):"tool-policies"==W?(0,_.jsx)(FR,{accessToken:n,userRole:a}):"workflows"==W?(0,_.jsx)(F3,{accessToken:n}):"memory"==W?(0,_.jsx)(FW,{accessToken:n,userID:r,userRole:a}):"guardrails-monitor"==W?(0,_.jsx)(Ts,{accessToken:n}):"new_usage"==W?(0,_.jsx)(Et,{teams:d??[],organizations:p??[]}):(0,_.jsx)(Yj,{userID:r,userRole:a,token:t,accessToken:n,keys:u,premiumUser:l})]}),(0,_.jsx)(Yn,{isVisible:O,onOpen:()=>{D(!1),A(!0)},onDismiss:()=>{D(!1)}}),(0,_.jsx)(Yi,{isOpen:P,onClose:()=>{A(!1),D(!0)},onComplete:()=>{A(!1)}}),(0,_.jsx)(Yo,{isVisible:Y,onOpen:()=>{F(!1),B(!0)},onDismiss:()=>{F(!1)}}),(0,_.jsx)(Yd,{isOpen:R,onClose:()=>{B(!1),F(!0)},onComplete:()=>{B(!1)}})]})})})})}function Bi(){return(0,_.jsx)(T.Suspense,{fallback:(0,_.jsx)(jF.default,{}),children:(0,_.jsx)(Bl,{})})}e.s(["default",()=>Bi],952683)}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/694efc3611ad294e.js b/litellm/proxy/_experimental/out/_next/static/chunks/b4e17884b60263b6.js similarity index 67% rename from litellm/proxy/_experimental/out/_next/static/chunks/694efc3611ad294e.js rename to litellm/proxy/_experimental/out/_next/static/chunks/b4e17884b60263b6.js index 3a052433c94d..7d63c99d4d23 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/694efc3611ad294e.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/b4e17884b60263b6.js @@ -1 +1 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,482725,244451,e=>{"use strict";let t;e.i(247167);var n=e.i(271645),r=e.i(343794),i=e.i(242064),o=e.i(763731),s=e.i(174428);let a=80*Math.PI,l=e=>{let{dotClassName:t,style:i,hasCircleCls:o}=e;return n.createElement("circle",{className:(0,r.default)(`${t}-circle`,{[`${t}-circle-bg`]:o}),r:40,cx:50,cy:50,strokeWidth:20,style:i})},u=({percent:e,prefixCls:t})=>{let i=`${t}-dot`,o=`${i}-holder`,u=`${o}-hidden`,[c,d]=n.useState(!1);(0,s.default)(()=>{0!==e&&d(!0)},[0!==e]);let f=Math.max(Math.min(e,100),0);if(!c)return null;let h={strokeDashoffset:`${a/4}`,strokeDasharray:`${a*f/100} ${a*(100-f)/100}`};return n.createElement("span",{className:(0,r.default)(o,`${i}-progress`,f<=0&&u)},n.createElement("svg",{viewBox:"0 0 100 100",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":f},n.createElement(l,{dotClassName:i,hasCircleCls:!0}),n.createElement(l,{dotClassName:i,style:h})))};function c(e){let{prefixCls:t,percent:i=0}=e,o=`${t}-dot`,s=`${o}-holder`,a=`${s}-hidden`;return n.createElement(n.Fragment,null,n.createElement("span",{className:(0,r.default)(s,i>0&&a)},n.createElement("span",{className:(0,r.default)(o,`${t}-dot-spin`)},[1,2,3,4].map(e=>n.createElement("i",{className:`${t}-dot-item`,key:e})))),n.createElement(u,{prefixCls:t,percent:i}))}function d(e){var t;let{prefixCls:i,indicator:s,percent:a}=e,l=`${i}-dot`;return s&&n.isValidElement(s)?(0,o.cloneElement)(s,{className:(0,r.default)(null==(t=s.props)?void 0:t.className,l),percent:a}):n.createElement(c,{prefixCls:i,percent:a})}e.i(296059);var f=e.i(694758),h=e.i(183293),m=e.i(246422),p=e.i(838378);let g=new f.Keyframes("antSpinMove",{to:{opacity:1}}),v=new f.Keyframes("antRotate",{to:{transform:"rotate(405deg)"}}),y=(0,m.genStyleHooks)("Spin",e=>(e=>{let{componentCls:t,calc:n}=e;return{[t]:Object.assign(Object.assign({},(0,h.resetComponent)(e)),{position:"absolute",display:"none",color:e.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`,"&-spinning":{position:"relative",display:"inline-block",opacity:1},[`${t}-text`]:{fontSize:e.fontSize,paddingTop:n(n(e.dotSize).sub(e.fontSize)).div(2).add(2).equal()},"&-fullscreen":{position:"fixed",width:"100vw",height:"100vh",backgroundColor:e.colorBgMask,zIndex:e.zIndexPopupBase,inset:0,display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:0,visibility:"hidden",transition:`all ${e.motionDurationMid}`,"&-show":{opacity:1,visibility:"visible"},[t]:{[`${t}-dot-holder`]:{color:e.colorWhite},[`${t}-text`]:{color:e.colorTextLightSolid}}},"&-nested-loading":{position:"relative",[`> div > ${t}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:e.contentHeight,[`${t}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:n(e.dotSize).mul(-1).div(2).equal()},[`${t}-text`]:{position:"absolute",top:"50%",width:"100%",textShadow:`0 1px 2px ${e.colorBgContainer}`},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSize).div(2).mul(-1).sub(10).equal()},"&-sm":{[`${t}-dot`]:{margin:n(e.dotSizeSM).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:n(n(e.dotSizeSM).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSizeSM).div(2).mul(-1).sub(10).equal()}},"&-lg":{[`${t}-dot`]:{margin:n(e.dotSizeLG).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:n(n(e.dotSizeLG).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSizeLG).div(2).mul(-1).sub(10).equal()}}},[`${t}-container`]:{position:"relative",transition:`opacity ${e.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:e.colorBgContainer,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${t}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-tip":{color:e.spinDotDefault},[`${t}-dot-holder`]:{width:"1em",height:"1em",fontSize:e.dotSize,display:"inline-block",transition:`transform ${e.motionDurationSlow} ease, opacity ${e.motionDurationSlow} ease`,transformOrigin:"50% 50%",lineHeight:1,color:e.colorPrimary,"&-hidden":{transform:"scale(0.3)",opacity:0}},[`${t}-dot-progress`]:{position:"absolute",inset:0},[`${t}-dot`]:{position:"relative",display:"inline-block",fontSize:e.dotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),height:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),background:"currentColor",borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:g,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:v,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"},"&-circle":{strokeLinecap:"round",transition:["stroke-dashoffset","stroke-dasharray","stroke","stroke-width","opacity"].map(t=>`${t} ${e.motionDurationSlow} ease`).join(","),fillOpacity:0,stroke:"currentcolor"},"&-circle-bg":{stroke:e.colorFillSecondary}},[`&-sm ${t}-dot`]:{"&, &-holder":{fontSize:e.dotSizeSM}},[`&-sm ${t}-dot-holder`]:{i:{width:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal(),height:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal()}},[`&-lg ${t}-dot`]:{"&, &-holder":{fontSize:e.dotSizeLG}},[`&-lg ${t}-dot-holder`]:{i:{width:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal(),height:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal()}},[`&${t}-show-text ${t}-text`]:{display:"block"}})}})((0,p.mergeToken)(e,{spinDotDefault:e.colorTextDescription})),e=>{let{controlHeightLG:t,controlHeight:n}=e;return{contentHeight:400,dotSize:t/2,dotSizeSM:.35*t,dotSizeLG:n}}),S=[[30,.05],[70,.03],[96,.01]];var b=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let $=e=>{var o;let{prefixCls:s,spinning:a=!0,delay:l=0,className:u,rootClassName:c,size:f="default",tip:h,wrapperClassName:m,style:p,children:g,fullscreen:v=!1,indicator:$,percent:_}=e,w=b(e,["prefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","fullscreen","indicator","percent"]),{getPrefixCls:O,direction:C,className:x,style:z,indicator:E}=(0,i.useComponentConfig)("spin"),M=O("spin",s),[T,j,D]=y(M),[k,N]=n.useState(()=>a&&(!a||!l||!!Number.isNaN(Number(l)))),R=function(e,t){let[r,i]=n.useState(0),o=n.useRef(null),s="auto"===t;return n.useEffect(()=>(s&&e&&(i(0),o.current=setInterval(()=>{i(e=>{let t=100-e;for(let n=0;n{o.current&&(clearInterval(o.current),o.current=null)}),[s,e]),s?r:t}(k,_);n.useEffect(()=>{if(a){let e=function(e,t,n){var r,i=n||{},o=i.noTrailing,s=void 0!==o&&o,a=i.noLeading,l=void 0!==a&&a,u=i.debounceMode,c=void 0===u?void 0:u,d=!1,f=0;function h(){r&&clearTimeout(r)}function m(){for(var n=arguments.length,i=Array(n),o=0;oe?l?(f=Date.now(),s||(r=setTimeout(c?p:m,e))):m():!0!==s&&(r=setTimeout(c?p:m,void 0===c?e-u:e)))}return m.cancel=function(e){var t=(e||{}).upcomingOnly;h(),d=!(void 0!==t&&t)},m}(l,()=>{N(!0)},{debounceMode:false});return e(),()=>{var t;null==(t=null==e?void 0:e.cancel)||t.call(e)}}N(!1)},[l,a]);let I=n.useMemo(()=>void 0!==g&&!v,[g,v]),A=(0,r.default)(M,x,{[`${M}-sm`]:"small"===f,[`${M}-lg`]:"large"===f,[`${M}-spinning`]:k,[`${M}-show-text`]:!!h,[`${M}-rtl`]:"rtl"===C},u,!v&&c,j,D),F=(0,r.default)(`${M}-container`,{[`${M}-blur`]:k}),P=null!=(o=null!=$?$:E)?o:t,H=Object.assign(Object.assign({},z),p),L=n.createElement("div",Object.assign({},w,{style:H,className:A,"aria-live":"polite","aria-busy":k}),n.createElement(d,{prefixCls:M,indicator:P,percent:R}),h&&(I||v)?n.createElement("div",{className:`${M}-text`},h):null);return T(I?n.createElement("div",Object.assign({},w,{className:(0,r.default)(`${M}-nested-loading`,m,j,D)}),k&&n.createElement("div",{key:"loading"},L),n.createElement("div",{className:F,key:"container"},g)):v?n.createElement("div",{className:(0,r.default)(`${M}-fullscreen`,{[`${M}-fullscreen-show`]:k},c,j,D)},L):L)};$.setDefaultIndicator=e=>{t=e},e.s(["default",0,$],244451),e.s(["Spin",0,$],482725)},597440,e=>{"use strict";e.i(247167);var t=e.i(931067),n=e.i(271645);let r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"};var i=e.i(9583),o=n.forwardRef(function(e,o){return n.createElement(i.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["default",0,o],597440)},955135,e=>{"use strict";var t=e.i(597440);e.s(["DeleteOutlined",()=>t.default])},689020,e=>{"use strict";var t=e.i(602869);let n=async e=>{try{let n=await (0,t.modelHubCall)(e);if(console.log("model_info:",n),n?.data.length>0){let e=n.data.map(e=>({model_group:e.model_group,mode:e?.mode}));return e.sort((e,t)=>e.model_group.localeCompare(t.model_group)),e}return[]}catch(e){throw console.error("Error fetching model info:",e),e}};e.s(["fetchAvailableModels",0,n])},981339,e=>{"use strict";var t=e.i(185793);e.s(["Skeleton",()=>t.default])},751904,883552,e=>{"use strict";var t=e.i(401361);e.s(["EditOutlined",()=>t.default],751904),e.i(247167);var n=e.i(271645),r=e.i(562901),i=e.i(343794),o=e.i(914949),s=e.i(529681),a=e.i(242064),l=e.i(829672),u=e.i(285781),c=e.i(836938),d=e.i(920228),f=e.i(62405),h=e.i(408850),m=e.i(87414),p=e.i(310730);let g=(0,e.i(246422).genStyleHooks)("Popconfirm",e=>(e=>{let{componentCls:t,iconCls:n,antCls:r,zIndexPopup:i,colorText:o,colorWarning:s,marginXXS:a,marginXS:l,fontSize:u,fontWeightStrong:c,colorTextHeading:d}=e;return{[t]:{zIndex:i,[`&${r}-popover`]:{fontSize:u},[`${t}-message`]:{marginBottom:l,display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${t}-message-icon ${n}`]:{color:s,fontSize:u,lineHeight:1,marginInlineEnd:l},[`${t}-title`]:{fontWeight:c,color:d,"&:only-child":{fontWeight:"normal"}},[`${t}-description`]:{marginTop:a,color:o}},[`${t}-buttons`]:{textAlign:"end",whiteSpace:"nowrap",button:{marginInlineStart:l}}}}})(e),e=>{let{zIndexPopupBase:t}=e;return{zIndexPopup:t+60}},{resetStyle:!1});var v=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let y=e=>{let{prefixCls:t,okButtonProps:i,cancelButtonProps:o,title:s,description:l,cancelText:p,okText:g,okType:v="primary",icon:y=n.createElement(r.default,null),showCancel:S=!0,close:b,onConfirm:$,onCancel:_,onPopupClick:w}=e,{getPrefixCls:O}=n.useContext(a.ConfigContext),[C]=(0,h.useLocale)("Popconfirm",m.default.Popconfirm),x=(0,c.getRenderPropValue)(s),z=(0,c.getRenderPropValue)(l);return n.createElement("div",{className:`${t}-inner-content`,onClick:w},n.createElement("div",{className:`${t}-message`},y&&n.createElement("span",{className:`${t}-message-icon`},y),n.createElement("div",{className:`${t}-message-text`},x&&n.createElement("div",{className:`${t}-title`},x),z&&n.createElement("div",{className:`${t}-description`},z))),n.createElement("div",{className:`${t}-buttons`},S&&n.createElement(d.default,Object.assign({onClick:_,size:"small"},o),p||(null==C?void 0:C.cancelText)),n.createElement(u.default,{buttonProps:Object.assign(Object.assign({size:"small"},(0,f.convertLegacyProps)(v)),i),actionFn:$,close:b,prefixCls:O("btn"),quitOnNullishReturnValue:!0,emitEvent:!0},g||(null==C?void 0:C.okText))))};var S=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let b=n.forwardRef((e,t)=>{var u,c;let{prefixCls:d,placement:f="top",trigger:h="click",okType:m="primary",icon:p=n.createElement(r.default,null),children:v,overlayClassName:b,onOpenChange:$,onVisibleChange:_,overlayStyle:w,styles:O,classNames:C}=e,x=S(e,["prefixCls","placement","trigger","okType","icon","children","overlayClassName","onOpenChange","onVisibleChange","overlayStyle","styles","classNames"]),{getPrefixCls:z,className:E,style:M,classNames:T,styles:j}=(0,a.useComponentConfig)("popconfirm"),[D,k]=(0,o.default)(!1,{value:null!=(u=e.open)?u:e.visible,defaultValue:null!=(c=e.defaultOpen)?c:e.defaultVisible}),N=(e,t)=>{k(e,!0),null==_||_(e),null==$||$(e,t)},R=z("popconfirm",d),I=(0,i.default)(R,E,b,T.root,null==C?void 0:C.root),A=(0,i.default)(T.body,null==C?void 0:C.body),[F]=g(R);return F(n.createElement(l.default,Object.assign({},(0,s.default)(x,["title"]),{trigger:h,placement:f,onOpenChange:(t,n)=>{let{disabled:r=!1}=e;r||N(t,n)},open:D,ref:t,classNames:{root:I,body:A},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},j.root),M),w),null==O?void 0:O.root),body:Object.assign(Object.assign({},j.body),null==O?void 0:O.body)},content:n.createElement(y,Object.assign({okType:m,icon:p},e,{prefixCls:R,close:e=>{N(!1,e)},onConfirm:t=>{var n;return null==(n=e.onConfirm)?void 0:n.call(void 0,t)},onCancel:t=>{var n;N(!1,t),null==(n=e.onCancel)||n.call(void 0,t)}})),"data-popover-inject":!0}),v))});b._InternalPanelDoNotUseOrYouWillBeFired=e=>{let{prefixCls:t,placement:r,className:o,style:s}=e,l=v(e,["prefixCls","placement","className","style"]),{getPrefixCls:u}=n.useContext(a.ConfigContext),c=u("popconfirm",t),[d]=g(c);return d(n.createElement(p.default,{placement:r,className:(0,i.default)(c,o),style:s,content:n.createElement(y,Object.assign({prefixCls:c},l))}))},e.s(["Popconfirm",0,b],883552)},822315,(e,t,n)=>{e.e,t.exports=function(){"use strict";var e="millisecond",t="second",n="minute",r="hour",i="week",o="month",s="quarter",a="year",l="date",u="Invalid Date",c=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},h="en",m={};m[h]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}};var p="$isDayjsObject",g=function(e){return e instanceof b||!(!e||!e[p])},v=function e(t,n,r){var i;if(!t)return h;if("string"==typeof t){var o=t.toLowerCase();m[o]&&(i=o),n&&(m[o]=n,i=o);var s=t.split("-");if(!i&&s.length>1)return e(s[0])}else{var a=t.name;m[a]=t,i=a}return!r&&i&&(h=i),i||!r&&h},y=function(e,t){if(g(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new b(n)},S={s:f,z:function(e){var t=-e.utcOffset(),n=Math.abs(t);return(t<=0?"+":"-")+f(Math.floor(n/60),2,"0")+":"+f(n%60,2,"0")},m:function e(t,n){if(t.date(){"use strict";var t=e.i(959013);e.s(["PlusOutlined",()=>t.default])},313603,e=>{"use strict";e.i(247167);var t=e.i(931067),n=e.i(271645);let r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"};var i=e.i(9583),o=n.forwardRef(function(e,o){return n.createElement(i.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["SettingOutlined",0,o],313603)},362024,e=>{"use strict";var t=e.i(988122);e.s(["Collapse",()=>t.default])},240647,e=>{"use strict";var t=e.i(286612);e.s(["RightOutlined",()=>t.default])},516015,(e,t,n)=>{},898547,(e,t,n)=>{var r=e.i(247167);e.r(516015);var i=e.r(271645),o=i&&"object"==typeof i&&"default"in i?i:{default:i},s=void 0!==r.default&&r.default.env&&!0,a=function(e){return"[object String]"===Object.prototype.toString.call(e)},l=function(){function e(e){var t=void 0===e?{}:e,n=t.name,r=void 0===n?"stylesheet":n,i=t.optimizeForSpeed,o=void 0===i?s:i;u(a(r),"`name` must be a string"),this._name=r,this._deletedRulePlaceholder="#"+r+"-deleted-rule____{}",u("boolean"==typeof o,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=o,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var l="u">typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=l?l.getAttribute("content"):null}var t,n=e.prototype;return n.setOptimizeForSpeed=function(e){u("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),u(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},n.isOptimizeForSpeed=function(){return this._optimizeForSpeed},n.inject=function(){var e=this;if(u(!this._injected,"sheet already injected"),this._injected=!0,"u">typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(s||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,n){return"number"==typeof n?e._serverSheet.cssRules[n]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),n},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},n.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;ttypeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!n.cssRules[e])return e;n.deleteRule(e);try{n.insertRule(t,e)}catch(r){s||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),n.insertRule(this._deletedRulePlaceholder,e)}}else{var r=this._tags[e];u(r,"old rule at index `"+e+"` not found"),r.textContent=t}return e},n.deleteRule=function(e){if("u"typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},n.cssRules=function(){var e=this;return"u">>0},d={};function f(e,t){if(!t)return"jsx-"+e;var n=String(t),r=e+n;return d[r]||(d[r]="jsx-"+c(e+"-"+n)),d[r]}function h(e,t){"u"typeof window&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var n=this.getIdAndRules(e),r=n.styleId,i=n.rules;if(r in this._instancesCounts){this._instancesCounts[r]+=1;return}var o=i.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[r]=o,this._instancesCounts[r]=1},t.remove=function(e){var t=this,n=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(n in this._instancesCounts,"styleId: `"+n+"` not found"),this._instancesCounts[n]-=1,this._instancesCounts[n]<1){var r=this._fromServer&&this._fromServer[n];r?(r.parentNode.removeChild(r),delete this._fromServer[n]):(this._indices[n].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[n]),delete this._instancesCounts[n]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],n=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return n[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,n;return t=this.cssRules(),void 0===(n=e)&&(n={}),t.map(function(e){var t=e[0],r=e[1];return o.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:n.nonce?n.nonce:void 0,dangerouslySetInnerHTML:{__html:r}})})},t.getIdAndRules=function(e){var t=e.children,n=e.dynamic,r=e.id;if(n){var i=f(r,n);return{styleId:i,rules:Array.isArray(t)?t.map(function(e){return h(i,e)}):[h(i,t)]}}return{styleId:f(r),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),p=i.createContext(null);function g(){return new m}function v(){return i.useContext(p)}p.displayName="StyleSheetContext";var y=o.default.useInsertionEffect||o.default.useLayoutEffect,S="u">typeof window?g():void 0;function b(e){var t=S||v();return t&&("u"{t.exports=e.r(898547).style},434166,e=>{"use strict";function t(e,t){window.sessionStorage.setItem(e,btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))))}function n(e){try{let t=window.sessionStorage.getItem(e);if(null===t)return null;return decodeURIComponent(atob(t).split("").map(e=>"%"+e.charCodeAt(0).toString(16).padStart(2,"0")).join(""))}catch{return null}}e.s(["getSecureItem",()=>n,"setSecureItem",()=>t])},438957,366308,e=>{"use strict";e.i(247167);var t=e.i(931067),n=e.i(271645);let r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M608 112c-167.9 0-304 136.1-304 304 0 70.3 23.9 135 63.9 186.5l-41.1 41.1-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-44.9 44.9-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-65.3 65.3a8.03 8.03 0 000 11.3l42.3 42.3c3.1 3.1 8.2 3.1 11.3 0l253.6-253.6A304.06 304.06 0 00608 720c167.9 0 304-136.1 304-304S775.9 112 608 112zm161.2 465.2C726.2 620.3 668.9 644 608 644c-60.9 0-118.2-23.7-161.2-66.8-43.1-43-66.8-100.3-66.8-161.2 0-60.9 23.7-118.2 66.8-161.2 43-43.1 100.3-66.8 161.2-66.8 60.9 0 118.2 23.7 161.2 66.8 43.1 43 66.8 100.3 66.8 161.2 0 60.9-23.7 118.2-66.8 161.2z"}}]},name:"key",theme:"outlined"};var i=e.i(9583),o=n.forwardRef(function(e,o){return n.createElement(i.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["KeyOutlined",0,o],438957);let s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M876.6 239.5c-.5-.9-1.2-1.8-2-2.5-5-5-13.1-5-18.1 0L684.2 409.3l-67.9-67.9L788.7 169c.8-.8 1.4-1.6 2-2.5 3.6-6.1 1.6-13.9-4.5-17.5-98.2-58-226.8-44.7-311.3 39.7-67 67-89.2 162-66.5 247.4l-293 293c-3 3-2.8 7.9.3 11l169.7 169.7c3.1 3.1 8.1 3.3 11 .3l292.9-292.9c85.5 22.8 180.5.7 247.6-66.4 84.4-84.5 97.7-213.1 39.7-311.3zM786 499.8c-58.1 58.1-145.3 69.3-214.6 33.6l-8.8 8.8-.1-.1-274 274.1-79.2-79.2 230.1-230.1s0 .1.1.1l52.8-52.8c-35.7-69.3-24.5-156.5 33.6-214.6a184.2 184.2 0 01144-53.5L537 318.9a32.05 32.05 0 000 45.3l124.5 124.5a32.05 32.05 0 0045.3 0l132.8-132.8c3.7 51.8-14.4 104.8-53.6 143.9z"}}]},name:"tool",theme:"outlined"};var a=n.forwardRef(function(e,r){return n.createElement(i.default,(0,t.default)({},e,{ref:r,icon:s}))});e.s(["ToolOutlined",0,a],366308)},477189,e=>{"use strict";e.i(247167);var t=e.i(931067),n=e.i(271645);let r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"}}]},name:"appstore",theme:"outlined"};var i=e.i(9583),o=n.forwardRef(function(e,o){return n.createElement(i.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["AppstoreOutlined",0,o],477189)},264843,292335,122520,165615,779129,e=>{"use strict";e.i(247167);var t=e.i(931067),n=e.i(271645);let r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z"}}]},name:"message",theme:"outlined"};var i=e.i(9583),o=n.forwardRef(function(e,o){return n.createElement(i.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["MessageOutlined",0,o],264843);let s={NONE:"none",API_KEY:"api_key",BEARER_TOKEN:"bearer_token",TOKEN:"token",BASIC:"basic",OAUTH2:"oauth2",AWS_SIGV4:"aws_sigv4"},a="client_credentials";function l(e){return e.auth_type!==s.OAUTH2?null:e.oauth2_flow===a?"m2m":e.delegate_auth_to_upstream?"passthrough":"obo"}let u={SSE:"sse",HTTP:"http",STDIO:"stdio",OPENAPI:"openapi"};function c(e){if(e instanceof Error)return e.message;if(e&&"object"==typeof e){let t=e.detail;return"string"==typeof t?t:Array.isArray(t)?t.map(e=>e&&"object"==typeof e?"string"==typeof e.msg?e.msg:JSON.stringify(e):String(e)).join("; "):t&&"object"==typeof t&&"string"==typeof t.error?t.error:"string"==typeof e.message?e.message:JSON.stringify(e)}return String(e)}e.s(["AUTH_TYPE",0,s,"MCP_OAUTH2_FLOW_M2M",0,a,"OAUTH_FLOW",0,{INTERACTIVE:"interactive",M2M:"m2m"},"TRANSPORT",0,u,"getMcpOAuthMode",()=>l,"handleAuth",0,e=>null==e?s.NONE:e,"handleTransport",0,(e,t)=>null==e?u.SSE:t&&e!==u.STDIO?u.OPENAPI:e],292335),e.s(["extractErrorMessage",()=>c],122520);let d=e=>{let t=new Uint8Array(e),n="";return t.forEach(e=>n+=String.fromCharCode(e)),btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},f=async e=>{let t=new TextEncoder().encode(e);return d(await window.crypto.subtle.digest("SHA-256",t))};e.s(["generateCodeChallenge",0,f,"generateCodeVerifier",0,()=>{let e=new Uint8Array(32);return window.crypto.getRandomValues(e),d(e.buffer)}],165615),e.i(602869),e.s(["buildCallbackUrl",0,()=>{{let e=window.location.pathname||"",t=e.indexOf("/ui"),n=t>=0?e.slice(0,t+3).replace(/\/+$/,""):"";return`${window.location.origin}${n}/mcp/oauth/callback`}},"clearStorage",0,(...e)=>{e.forEach(e=>{try{window.sessionStorage.removeItem(e)}catch(e){}})}],779129)}]); \ No newline at end of file +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,482725,244451,e=>{"use strict";let t;e.i(247167);var n=e.i(271645),r=e.i(343794),i=e.i(242064),o=e.i(763731),s=e.i(174428);let a=80*Math.PI,l=e=>{let{dotClassName:t,style:i,hasCircleCls:o}=e;return n.createElement("circle",{className:(0,r.default)(`${t}-circle`,{[`${t}-circle-bg`]:o}),r:40,cx:50,cy:50,strokeWidth:20,style:i})},c=({percent:e,prefixCls:t})=>{let i=`${t}-dot`,o=`${i}-holder`,c=`${o}-hidden`,[u,d]=n.useState(!1);(0,s.default)(()=>{0!==e&&d(!0)},[0!==e]);let f=Math.max(Math.min(e,100),0);if(!u)return null;let h={strokeDashoffset:`${a/4}`,strokeDasharray:`${a*f/100} ${a*(100-f)/100}`};return n.createElement("span",{className:(0,r.default)(o,`${i}-progress`,f<=0&&c)},n.createElement("svg",{viewBox:"0 0 100 100",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":f},n.createElement(l,{dotClassName:i,hasCircleCls:!0}),n.createElement(l,{dotClassName:i,style:h})))};function u(e){let{prefixCls:t,percent:i=0}=e,o=`${t}-dot`,s=`${o}-holder`,a=`${s}-hidden`;return n.createElement(n.Fragment,null,n.createElement("span",{className:(0,r.default)(s,i>0&&a)},n.createElement("span",{className:(0,r.default)(o,`${t}-dot-spin`)},[1,2,3,4].map(e=>n.createElement("i",{className:`${t}-dot-item`,key:e})))),n.createElement(c,{prefixCls:t,percent:i}))}function d(e){var t;let{prefixCls:i,indicator:s,percent:a}=e,l=`${i}-dot`;return s&&n.isValidElement(s)?(0,o.cloneElement)(s,{className:(0,r.default)(null==(t=s.props)?void 0:t.className,l),percent:a}):n.createElement(u,{prefixCls:i,percent:a})}e.i(296059);var f=e.i(694758),h=e.i(183293),m=e.i(246422),p=e.i(838378);let g=new f.Keyframes("antSpinMove",{to:{opacity:1}}),v=new f.Keyframes("antRotate",{to:{transform:"rotate(405deg)"}}),y=(0,m.genStyleHooks)("Spin",e=>(e=>{let{componentCls:t,calc:n}=e;return{[t]:Object.assign(Object.assign({},(0,h.resetComponent)(e)),{position:"absolute",display:"none",color:e.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`,"&-spinning":{position:"relative",display:"inline-block",opacity:1},[`${t}-text`]:{fontSize:e.fontSize,paddingTop:n(n(e.dotSize).sub(e.fontSize)).div(2).add(2).equal()},"&-fullscreen":{position:"fixed",width:"100vw",height:"100vh",backgroundColor:e.colorBgMask,zIndex:e.zIndexPopupBase,inset:0,display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:0,visibility:"hidden",transition:`all ${e.motionDurationMid}`,"&-show":{opacity:1,visibility:"visible"},[t]:{[`${t}-dot-holder`]:{color:e.colorWhite},[`${t}-text`]:{color:e.colorTextLightSolid}}},"&-nested-loading":{position:"relative",[`> div > ${t}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:e.contentHeight,[`${t}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:n(e.dotSize).mul(-1).div(2).equal()},[`${t}-text`]:{position:"absolute",top:"50%",width:"100%",textShadow:`0 1px 2px ${e.colorBgContainer}`},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSize).div(2).mul(-1).sub(10).equal()},"&-sm":{[`${t}-dot`]:{margin:n(e.dotSizeSM).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:n(n(e.dotSizeSM).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSizeSM).div(2).mul(-1).sub(10).equal()}},"&-lg":{[`${t}-dot`]:{margin:n(e.dotSizeLG).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:n(n(e.dotSizeLG).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSizeLG).div(2).mul(-1).sub(10).equal()}}},[`${t}-container`]:{position:"relative",transition:`opacity ${e.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:e.colorBgContainer,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${t}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-tip":{color:e.spinDotDefault},[`${t}-dot-holder`]:{width:"1em",height:"1em",fontSize:e.dotSize,display:"inline-block",transition:`transform ${e.motionDurationSlow} ease, opacity ${e.motionDurationSlow} ease`,transformOrigin:"50% 50%",lineHeight:1,color:e.colorPrimary,"&-hidden":{transform:"scale(0.3)",opacity:0}},[`${t}-dot-progress`]:{position:"absolute",inset:0},[`${t}-dot`]:{position:"relative",display:"inline-block",fontSize:e.dotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),height:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),background:"currentColor",borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:g,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:v,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"},"&-circle":{strokeLinecap:"round",transition:["stroke-dashoffset","stroke-dasharray","stroke","stroke-width","opacity"].map(t=>`${t} ${e.motionDurationSlow} ease`).join(","),fillOpacity:0,stroke:"currentcolor"},"&-circle-bg":{stroke:e.colorFillSecondary}},[`&-sm ${t}-dot`]:{"&, &-holder":{fontSize:e.dotSizeSM}},[`&-sm ${t}-dot-holder`]:{i:{width:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal(),height:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal()}},[`&-lg ${t}-dot`]:{"&, &-holder":{fontSize:e.dotSizeLG}},[`&-lg ${t}-dot-holder`]:{i:{width:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal(),height:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal()}},[`&${t}-show-text ${t}-text`]:{display:"block"}})}})((0,p.mergeToken)(e,{spinDotDefault:e.colorTextDescription})),e=>{let{controlHeightLG:t,controlHeight:n}=e;return{contentHeight:400,dotSize:t/2,dotSizeSM:.35*t,dotSizeLG:n}}),S=[[30,.05],[70,.03],[96,.01]];var _=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let b=e=>{var o;let{prefixCls:s,spinning:a=!0,delay:l=0,className:c,rootClassName:u,size:f="default",tip:h,wrapperClassName:m,style:p,children:g,fullscreen:v=!1,indicator:b,percent:$}=e,w=_(e,["prefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","fullscreen","indicator","percent"]),{getPrefixCls:O,direction:C,className:x,style:z,indicator:E}=(0,i.useComponentConfig)("spin"),M=O("spin",s),[k,I,T]=y(M),[A,j]=n.useState(()=>a&&(!a||!l||!!Number.isNaN(Number(l)))),D=function(e,t){let[r,i]=n.useState(0),o=n.useRef(null),s="auto"===t;return n.useEffect(()=>(s&&e&&(i(0),o.current=setInterval(()=>{i(e=>{let t=100-e;for(let n=0;n{o.current&&(clearInterval(o.current),o.current=null)}),[s,e]),s?r:t}(A,$);n.useEffect(()=>{if(a){let e=function(e,t,n){var r,i=n||{},o=i.noTrailing,s=void 0!==o&&o,a=i.noLeading,l=void 0!==a&&a,c=i.debounceMode,u=void 0===c?void 0:c,d=!1,f=0;function h(){r&&clearTimeout(r)}function m(){for(var n=arguments.length,i=Array(n),o=0;oe?l?(f=Date.now(),s||(r=setTimeout(u?p:m,e))):m():!0!==s&&(r=setTimeout(u?p:m,void 0===u?e-c:e)))}return m.cancel=function(e){var t=(e||{}).upcomingOnly;h(),d=!(void 0!==t&&t)},m}(l,()=>{j(!0)},{debounceMode:false});return e(),()=>{var t;null==(t=null==e?void 0:e.cancel)||t.call(e)}}j(!1)},[l,a]);let N=n.useMemo(()=>void 0!==g&&!v,[g,v]),R=(0,r.default)(M,x,{[`${M}-sm`]:"small"===f,[`${M}-lg`]:"large"===f,[`${M}-spinning`]:A,[`${M}-show-text`]:!!h,[`${M}-rtl`]:"rtl"===C},c,!v&&u,I,T),F=(0,r.default)(`${M}-container`,{[`${M}-blur`]:A}),P=null!=(o=null!=b?b:E)?o:t,H=Object.assign(Object.assign({},z),p),L=n.createElement("div",Object.assign({},w,{style:H,className:R,"aria-live":"polite","aria-busy":A}),n.createElement(d,{prefixCls:M,indicator:P,percent:D}),h&&(N||v)?n.createElement("div",{className:`${M}-text`},h):null);return k(N?n.createElement("div",Object.assign({},w,{className:(0,r.default)(`${M}-nested-loading`,m,I,T)}),A&&n.createElement("div",{key:"loading"},L),n.createElement("div",{className:F,key:"container"},g)):v?n.createElement("div",{className:(0,r.default)(`${M}-fullscreen`,{[`${M}-fullscreen-show`]:A},u,I,T)},L):L)};b.setDefaultIndicator=e=>{t=e},e.s(["default",0,b],244451),e.s(["Spin",0,b],482725)},597440,e=>{"use strict";e.i(247167);var t=e.i(931067),n=e.i(271645);let r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"};var i=e.i(9583),o=n.forwardRef(function(e,o){return n.createElement(i.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["default",0,o],597440)},955135,e=>{"use strict";var t=e.i(597440);e.s(["DeleteOutlined",()=>t.default])},689020,e=>{"use strict";var t=e.i(602869);let n=async e=>{try{let n=await (0,t.modelHubCall)(e);if(console.log("model_info:",n),n?.data.length>0){let e=n.data.map(e=>({model_group:e.model_group,mode:e?.mode}));return e.sort((e,t)=>e.model_group.localeCompare(t.model_group)),e}return[]}catch(e){throw console.error("Error fetching model info:",e),e}};e.s(["fetchAvailableModels",0,n])},981339,e=>{"use strict";var t=e.i(185793);e.s(["Skeleton",()=>t.default])},751904,883552,e=>{"use strict";var t=e.i(401361);e.s(["EditOutlined",()=>t.default],751904),e.i(247167);var n=e.i(271645),r=e.i(562901),i=e.i(343794),o=e.i(914949),s=e.i(529681),a=e.i(242064),l=e.i(829672),c=e.i(285781),u=e.i(836938),d=e.i(920228),f=e.i(62405),h=e.i(408850),m=e.i(87414),p=e.i(310730);let g=(0,e.i(246422).genStyleHooks)("Popconfirm",e=>(e=>{let{componentCls:t,iconCls:n,antCls:r,zIndexPopup:i,colorText:o,colorWarning:s,marginXXS:a,marginXS:l,fontSize:c,fontWeightStrong:u,colorTextHeading:d}=e;return{[t]:{zIndex:i,[`&${r}-popover`]:{fontSize:c},[`${t}-message`]:{marginBottom:l,display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${t}-message-icon ${n}`]:{color:s,fontSize:c,lineHeight:1,marginInlineEnd:l},[`${t}-title`]:{fontWeight:u,color:d,"&:only-child":{fontWeight:"normal"}},[`${t}-description`]:{marginTop:a,color:o}},[`${t}-buttons`]:{textAlign:"end",whiteSpace:"nowrap",button:{marginInlineStart:l}}}}})(e),e=>{let{zIndexPopupBase:t}=e;return{zIndexPopup:t+60}},{resetStyle:!1});var v=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let y=e=>{let{prefixCls:t,okButtonProps:i,cancelButtonProps:o,title:s,description:l,cancelText:p,okText:g,okType:v="primary",icon:y=n.createElement(r.default,null),showCancel:S=!0,close:_,onConfirm:b,onCancel:$,onPopupClick:w}=e,{getPrefixCls:O}=n.useContext(a.ConfigContext),[C]=(0,h.useLocale)("Popconfirm",m.default.Popconfirm),x=(0,u.getRenderPropValue)(s),z=(0,u.getRenderPropValue)(l);return n.createElement("div",{className:`${t}-inner-content`,onClick:w},n.createElement("div",{className:`${t}-message`},y&&n.createElement("span",{className:`${t}-message-icon`},y),n.createElement("div",{className:`${t}-message-text`},x&&n.createElement("div",{className:`${t}-title`},x),z&&n.createElement("div",{className:`${t}-description`},z))),n.createElement("div",{className:`${t}-buttons`},S&&n.createElement(d.default,Object.assign({onClick:$,size:"small"},o),p||(null==C?void 0:C.cancelText)),n.createElement(c.default,{buttonProps:Object.assign(Object.assign({size:"small"},(0,f.convertLegacyProps)(v)),i),actionFn:b,close:_,prefixCls:O("btn"),quitOnNullishReturnValue:!0,emitEvent:!0},g||(null==C?void 0:C.okText))))};var S=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let _=n.forwardRef((e,t)=>{var c,u;let{prefixCls:d,placement:f="top",trigger:h="click",okType:m="primary",icon:p=n.createElement(r.default,null),children:v,overlayClassName:_,onOpenChange:b,onVisibleChange:$,overlayStyle:w,styles:O,classNames:C}=e,x=S(e,["prefixCls","placement","trigger","okType","icon","children","overlayClassName","onOpenChange","onVisibleChange","overlayStyle","styles","classNames"]),{getPrefixCls:z,className:E,style:M,classNames:k,styles:I}=(0,a.useComponentConfig)("popconfirm"),[T,A]=(0,o.default)(!1,{value:null!=(c=e.open)?c:e.visible,defaultValue:null!=(u=e.defaultOpen)?u:e.defaultVisible}),j=(e,t)=>{A(e,!0),null==$||$(e),null==b||b(e,t)},D=z("popconfirm",d),N=(0,i.default)(D,E,_,k.root,null==C?void 0:C.root),R=(0,i.default)(k.body,null==C?void 0:C.body),[F]=g(D);return F(n.createElement(l.default,Object.assign({},(0,s.default)(x,["title"]),{trigger:h,placement:f,onOpenChange:(t,n)=>{let{disabled:r=!1}=e;r||j(t,n)},open:T,ref:t,classNames:{root:N,body:R},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},I.root),M),w),null==O?void 0:O.root),body:Object.assign(Object.assign({},I.body),null==O?void 0:O.body)},content:n.createElement(y,Object.assign({okType:m,icon:p},e,{prefixCls:D,close:e=>{j(!1,e)},onConfirm:t=>{var n;return null==(n=e.onConfirm)?void 0:n.call(void 0,t)},onCancel:t=>{var n;j(!1,t),null==(n=e.onCancel)||n.call(void 0,t)}})),"data-popover-inject":!0}),v))});_._InternalPanelDoNotUseOrYouWillBeFired=e=>{let{prefixCls:t,placement:r,className:o,style:s}=e,l=v(e,["prefixCls","placement","className","style"]),{getPrefixCls:c}=n.useContext(a.ConfigContext),u=c("popconfirm",t),[d]=g(u);return d(n.createElement(p.default,{placement:r,className:(0,i.default)(u,o),style:s,content:n.createElement(y,Object.assign({prefixCls:u},l))}))},e.s(["Popconfirm",0,_],883552)},822315,(e,t,n)=>{e.e,t.exports=function(){"use strict";var e="millisecond",t="second",n="minute",r="hour",i="week",o="month",s="quarter",a="year",l="date",c="Invalid Date",u=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},h="en",m={};m[h]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}};var p="$isDayjsObject",g=function(e){return e instanceof _||!(!e||!e[p])},v=function e(t,n,r){var i;if(!t)return h;if("string"==typeof t){var o=t.toLowerCase();m[o]&&(i=o),n&&(m[o]=n,i=o);var s=t.split("-");if(!i&&s.length>1)return e(s[0])}else{var a=t.name;m[a]=t,i=a}return!r&&i&&(h=i),i||!r&&h},y=function(e,t){if(g(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new _(n)},S={s:f,z:function(e){var t=-e.utcOffset(),n=Math.abs(t);return(t<=0?"+":"-")+f(Math.floor(n/60),2,"0")+":"+f(n%60,2,"0")},m:function e(t,n){if(t.date(){"use strict";var t=e.i(959013);e.s(["PlusOutlined",()=>t.default])},313603,e=>{"use strict";e.i(247167);var t=e.i(931067),n=e.i(271645);let r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"};var i=e.i(9583),o=n.forwardRef(function(e,o){return n.createElement(i.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["SettingOutlined",0,o],313603)},362024,e=>{"use strict";var t=e.i(988122);e.s(["Collapse",()=>t.default])},240647,e=>{"use strict";var t=e.i(286612);e.s(["RightOutlined",()=>t.default])},516015,(e,t,n)=>{},898547,(e,t,n)=>{var r=e.i(247167);e.r(516015);var i=e.r(271645),o=i&&"object"==typeof i&&"default"in i?i:{default:i},s=void 0!==r.default&&r.default.env&&!0,a=function(e){return"[object String]"===Object.prototype.toString.call(e)},l=function(){function e(e){var t=void 0===e?{}:e,n=t.name,r=void 0===n?"stylesheet":n,i=t.optimizeForSpeed,o=void 0===i?s:i;c(a(r),"`name` must be a string"),this._name=r,this._deletedRulePlaceholder="#"+r+"-deleted-rule____{}",c("boolean"==typeof o,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=o,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var l="u">typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=l?l.getAttribute("content"):null}var t,n=e.prototype;return n.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},n.isOptimizeForSpeed=function(){return this._optimizeForSpeed},n.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"u">typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(s||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,n){return"number"==typeof n?e._serverSheet.cssRules[n]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),n},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},n.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;ttypeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!n.cssRules[e])return e;n.deleteRule(e);try{n.insertRule(t,e)}catch(r){s||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),n.insertRule(this._deletedRulePlaceholder,e)}}else{var r=this._tags[e];c(r,"old rule at index `"+e+"` not found"),r.textContent=t}return e},n.deleteRule=function(e){if("u"typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},n.cssRules=function(){var e=this;return"u">>0},d={};function f(e,t){if(!t)return"jsx-"+e;var n=String(t),r=e+n;return d[r]||(d[r]="jsx-"+u(e+"-"+n)),d[r]}function h(e,t){"u"typeof window&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var n=this.getIdAndRules(e),r=n.styleId,i=n.rules;if(r in this._instancesCounts){this._instancesCounts[r]+=1;return}var o=i.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[r]=o,this._instancesCounts[r]=1},t.remove=function(e){var t=this,n=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(n in this._instancesCounts,"styleId: `"+n+"` not found"),this._instancesCounts[n]-=1,this._instancesCounts[n]<1){var r=this._fromServer&&this._fromServer[n];r?(r.parentNode.removeChild(r),delete this._fromServer[n]):(this._indices[n].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[n]),delete this._instancesCounts[n]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],n=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return n[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,n;return t=this.cssRules(),void 0===(n=e)&&(n={}),t.map(function(e){var t=e[0],r=e[1];return o.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:n.nonce?n.nonce:void 0,dangerouslySetInnerHTML:{__html:r}})})},t.getIdAndRules=function(e){var t=e.children,n=e.dynamic,r=e.id;if(n){var i=f(r,n);return{styleId:i,rules:Array.isArray(t)?t.map(function(e){return h(i,e)}):[h(i,t)]}}return{styleId:f(r),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),p=i.createContext(null);function g(){return new m}function v(){return i.useContext(p)}p.displayName="StyleSheetContext";var y=o.default.useInsertionEffect||o.default.useLayoutEffect,S="u">typeof window?g():void 0;function _(e){var t=S||v();return t&&("u"{t.exports=e.r(898547).style},434166,e=>{"use strict";function t(e,t){window.sessionStorage.setItem(e,btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))))}function n(e){try{let t=window.sessionStorage.getItem(e);if(null===t)return null;return decodeURIComponent(atob(t).split("").map(e=>"%"+e.charCodeAt(0).toString(16).padStart(2,"0")).join(""))}catch{return null}}e.s(["getSecureItem",()=>n,"setSecureItem",()=>t])},438957,366308,e=>{"use strict";e.i(247167);var t=e.i(931067),n=e.i(271645);let r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M608 112c-167.9 0-304 136.1-304 304 0 70.3 23.9 135 63.9 186.5l-41.1 41.1-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-44.9 44.9-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-65.3 65.3a8.03 8.03 0 000 11.3l42.3 42.3c3.1 3.1 8.2 3.1 11.3 0l253.6-253.6A304.06 304.06 0 00608 720c167.9 0 304-136.1 304-304S775.9 112 608 112zm161.2 465.2C726.2 620.3 668.9 644 608 644c-60.9 0-118.2-23.7-161.2-66.8-43.1-43-66.8-100.3-66.8-161.2 0-60.9 23.7-118.2 66.8-161.2 43-43.1 100.3-66.8 161.2-66.8 60.9 0 118.2 23.7 161.2 66.8 43.1 43 66.8 100.3 66.8 161.2 0 60.9-23.7 118.2-66.8 161.2z"}}]},name:"key",theme:"outlined"};var i=e.i(9583),o=n.forwardRef(function(e,o){return n.createElement(i.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["KeyOutlined",0,o],438957);let s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M876.6 239.5c-.5-.9-1.2-1.8-2-2.5-5-5-13.1-5-18.1 0L684.2 409.3l-67.9-67.9L788.7 169c.8-.8 1.4-1.6 2-2.5 3.6-6.1 1.6-13.9-4.5-17.5-98.2-58-226.8-44.7-311.3 39.7-67 67-89.2 162-66.5 247.4l-293 293c-3 3-2.8 7.9.3 11l169.7 169.7c3.1 3.1 8.1 3.3 11 .3l292.9-292.9c85.5 22.8 180.5.7 247.6-66.4 84.4-84.5 97.7-213.1 39.7-311.3zM786 499.8c-58.1 58.1-145.3 69.3-214.6 33.6l-8.8 8.8-.1-.1-274 274.1-79.2-79.2 230.1-230.1s0 .1.1.1l52.8-52.8c-35.7-69.3-24.5-156.5 33.6-214.6a184.2 184.2 0 01144-53.5L537 318.9a32.05 32.05 0 000 45.3l124.5 124.5a32.05 32.05 0 0045.3 0l132.8-132.8c3.7 51.8-14.4 104.8-53.6 143.9z"}}]},name:"tool",theme:"outlined"};var a=n.forwardRef(function(e,r){return n.createElement(i.default,(0,t.default)({},e,{ref:r,icon:s}))});e.s(["ToolOutlined",0,a],366308)},477189,e=>{"use strict";e.i(247167);var t=e.i(931067),n=e.i(271645);let r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"}}]},name:"appstore",theme:"outlined"};var i=e.i(9583),o=n.forwardRef(function(e,o){return n.createElement(i.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["AppstoreOutlined",0,o],477189)},264843,292335,122520,165615,779129,280024,e=>{"use strict";e.i(247167);var t=e.i(931067),n=e.i(271645);let r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z"}}]},name:"message",theme:"outlined"};var i=e.i(9583),o=n.forwardRef(function(e,o){return n.createElement(i.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["MessageOutlined",0,o],264843);let s={NONE:"none",API_KEY:"api_key",BEARER_TOKEN:"bearer_token",TOKEN:"token",BASIC:"basic",OAUTH2:"oauth2",AWS_SIGV4:"aws_sigv4"},a="client_credentials";function l(e){return e.auth_type!==s.OAUTH2?null:e.oauth2_flow===a?"m2m":e.delegate_auth_to_upstream?"passthrough":"obo"}let c={SSE:"sse",HTTP:"http",STDIO:"stdio",OPENAPI:"openapi"};e.s(["AUTH_TYPE",0,s,"MCP_OAUTH2_FLOW_M2M",0,a,"OAUTH_FLOW",0,{INTERACTIVE:"interactive",M2M:"m2m"},"TRANSPORT",0,c,"getMcpOAuthMode",()=>l,"handleAuth",0,e=>null==e?s.NONE:e,"handleTransport",0,(e,t)=>null==e?c.SSE:t&&e!==c.STDIO?c.OPENAPI:e],292335);var u=e.i(602869),d=e.i(727749);function f(e){if(e instanceof Error)return e.message;if(e&&"object"==typeof e){let t=e.detail;return"string"==typeof t?t:Array.isArray(t)?t.map(e=>e&&"object"==typeof e?"string"==typeof e.msg?e.msg:JSON.stringify(e):String(e)).join("; "):t&&"object"==typeof t&&"string"==typeof t.error?t.error:"string"==typeof e.message?e.message:JSON.stringify(e)}return String(e)}e.s(["extractErrorMessage",()=>f],122520);let h=e=>{let t=new Uint8Array(e),n="";return t.forEach(e=>n+=String.fromCharCode(e)),btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},m=()=>{let e=new Uint8Array(32);return window.crypto.getRandomValues(e),h(e.buffer)},p=async e=>{let t=new TextEncoder().encode(e);return h(await window.crypto.subtle.digest("SHA-256",t))};e.s(["generateCodeChallenge",0,p,"generateCodeVerifier",0,m],165615);var g=e.i(434166);let v=()=>{{let e=window.location.pathname||"",t=e.indexOf("/ui"),n=t>=0?e.slice(0,t+3).replace(/\/+$/,""):"";return`${window.location.origin}${n}/mcp/oauth/callback`}},y=(...e)=>{e.forEach(e=>{try{window.sessionStorage.removeItem(e)}catch(e){}})};e.s(["TOOLS_OAUTH_UI_STATE_KEY",0,"litellm-mcp-oauth-tools-state","buildCallbackUrl",0,v,"clearStorage",0,y],779129);let S="litellm-user-mcp-oauth-flow-state",_="litellm-user-mcp-oauth-result",b=(e,t)=>{(0,g.setSecureItem)(e,t)},$=e=>(0,g.getSecureItem)(e);e.s(["useUserMcpOAuthFlow",0,({accessToken:e,serverId:t,serverAlias:r,scopes:i,clientId:o,onSuccess:s})=>{let[a,l]=(0,n.useState)("idle"),[c,h]=(0,n.useState)(null),g=(0,n.useRef)(!1),w=(0,n.useCallback)(async()=>{try{let n;l("authorizing"),h(null);let s=o??void 0;if(!s)try{let i=await (0,u.registerMcpOAuthClient)(e,t,{client_name:r||t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"});s=i?.client_id,n=i?.client_secret}catch(e){}let a=m(),c=await p(a),d=crypto.randomUUID(),f=v(),g=i?.filter(e=>e.trim()).join(" "),y=(0,u.buildMcpOAuthAuthorizeUrl)({serverId:t,clientId:s,redirectUri:f,state:d,codeChallenge:c,scope:g}),_={state:d,codeVerifier:a,serverId:t,redirectUri:f,clientId:s,clientSecret:n,scopes:i};b(S,JSON.stringify(_));let $=new URL(window.location.href);$.searchParams.set("mcpOauthReturn","apps"),b("litellm-mcp-oauth-return-url",$.toString()),window.location.href=y}catch(t){let e=f(t);h(e),l("error"),d.default.error(e)}},[e,t,r,i,o]),O=(0,n.useCallback)(async()=>{if(g.current)return;let n=$(_);if(!n)return;let r=$(S);if(!r)return;try{let e=JSON.parse(r);if(e.serverId&&e.serverId!==t)return}catch(e){}g.current=!0,y(_);let i=null,o=null;try{i=JSON.parse(n);let e=$(S);o=e?JSON.parse(e):null}catch(e){h("Failed to resume OAuth flow. Please retry."),l("error"),g.current=!1,y(S);return}try{if(!o?.state||!o.codeVerifier||!o.serverId)throw Error("OAuth session state was lost. Please retry.");if(!i?.state||i.state!==o.state)throw Error("OAuth state mismatch. Please retry.");if(i.error)throw Error(i.error_description||i.error);if(!i.code)throw Error("Authorization code missing in callback.");l("exchanging");let t=await (0,u.exchangeMcpOAuthToken)({serverId:o.serverId,code:i.code,clientId:o.clientId,clientSecret:o.clientSecret,codeVerifier:o.codeVerifier,redirectUri:o.redirectUri,accessToken:e});await (0,u.storeMCPOAuthUserCredential)(e,o.serverId,{access_token:t.access_token,refresh_token:t.refresh_token,expires_in:t.expires_in,scopes:o.scopes}),l("success"),h(null),d.default.success("Connected successfully"),s()}catch(t){let e=f(t);h(e),l("error"),d.default.error(e)}finally{y(S),setTimeout(()=>{g.current=!1},1e3)}},[e,t,s]);return(0,n.useEffect)(()=>{O()},[O]),{startOAuthFlow:w,status:a,error:c}}],280024)}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/LpqGBJeKQM0vUG-9uVaiY/_buildManifest.js b/litellm/proxy/_experimental/out/_next/static/qDSCS5Afc8ezv8M4GuOM3/_buildManifest.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/LpqGBJeKQM0vUG-9uVaiY/_buildManifest.js rename to litellm/proxy/_experimental/out/_next/static/qDSCS5Afc8ezv8M4GuOM3/_buildManifest.js diff --git a/litellm/proxy/_experimental/out/_next/static/LpqGBJeKQM0vUG-9uVaiY/_clientMiddlewareManifest.json b/litellm/proxy/_experimental/out/_next/static/qDSCS5Afc8ezv8M4GuOM3/_clientMiddlewareManifest.json similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/LpqGBJeKQM0vUG-9uVaiY/_clientMiddlewareManifest.json rename to litellm/proxy/_experimental/out/_next/static/qDSCS5Afc8ezv8M4GuOM3/_clientMiddlewareManifest.json diff --git a/litellm/proxy/_experimental/out/_next/static/LpqGBJeKQM0vUG-9uVaiY/_ssgManifest.js b/litellm/proxy/_experimental/out/_next/static/qDSCS5Afc8ezv8M4GuOM3/_ssgManifest.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/LpqGBJeKQM0vUG-9uVaiY/_ssgManifest.js rename to litellm/proxy/_experimental/out/_next/static/qDSCS5Afc8ezv8M4GuOM3/_ssgManifest.js diff --git a/litellm/proxy/_experimental/out/_not-found/__next._full.txt b/litellm/proxy/_experimental/out/_not-found/__next._full.txt index 70b2a6402113..38c37aff5592 100644 --- a/litellm/proxy/_experimental/out/_not-found/__next._full.txt +++ b/litellm/proxy/_experimental/out/_not-found/__next._full.txt @@ -1,7 +1,7 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] @@ -11,7 +11,7 @@ c:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/li e:I[168027,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","_not-found",""],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L7",null,{"children":["$","$8",null,{"name":"Next.MetadataOutlet","children":"$@9"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$La",null,{"children":"$Lb"}],["$","div",null,{"hidden":true,"children":["$","$Lc",null,{"children":["$","$8",null,{"name":"Next.Metadata","children":"$Ld"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$e","$undefined"],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","_not-found",""],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L7",null,{"children":["$","$8",null,{"name":"Next.MetadataOutlet","children":"$@9"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$La",null,{"children":"$Lb"}],["$","div",null,{"hidden":true,"children":["$","$Lc",null,{"children":["$","$8",null,{"name":"Next.Metadata","children":"$Ld"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$e","$undefined"],"S":true} b:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] f:I[27201,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"IconMark"] 9:null diff --git a/litellm/proxy/_experimental/out/_not-found/__next._head.txt b/litellm/proxy/_experimental/out/_not-found/__next._head.txt index 5c58c26f386d..59dc0061ef2b 100644 --- a/litellm/proxy/_experimental/out/_not-found/__next._head.txt +++ b/litellm/proxy/_experimental/out/_not-found/__next._head.txt @@ -3,4 +3,4 @@ 3:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"IconMark"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/_not-found/__next._index.txt b/litellm/proxy/_experimental/out/_not-found/__next._index.txt index 67c452e8c219..d3b4e1ec8d8c 100644 --- a/litellm/proxy/_experimental/out/_not-found/__next._index.txt +++ b/litellm/proxy/_experimental/out/_not-found/__next._index.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/_not-found/__next._not-found.__PAGE__.txt b/litellm/proxy/_experimental/out/_not-found/__next._not-found.__PAGE__.txt index 6d1f669ea1c9..ac985bff1cad 100644 --- a/litellm/proxy/_experimental/out/_not-found/__next._not-found.__PAGE__.txt +++ b/litellm/proxy/_experimental/out/_not-found/__next._not-found.__PAGE__.txt @@ -1,5 +1,5 @@ 1:"$Sreact.fragment" 2:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 3:"$Sreact.suspense" -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"loading":null,"isPartial":false} 4:null diff --git a/litellm/proxy/_experimental/out/_not-found/__next._not-found.txt b/litellm/proxy/_experimental/out/_not-found/__next._not-found.txt index 8675b565665e..36d9cb90d1c8 100644 --- a/litellm/proxy/_experimental/out/_not-found/__next._not-found.txt +++ b/litellm/proxy/_experimental/out/_not-found/__next._not-found.txt @@ -1,4 +1,4 @@ 1:"$Sreact.fragment" 2:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 3:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/_not-found/__next._tree.txt b/litellm/proxy/_experimental/out/_not-found/__next._tree.txt index 2a2482fc200f..93e134dde1a9 100644 --- a/litellm/proxy/_experimental/out/_not-found/__next._tree.txt +++ b/litellm/proxy/_experimental/out/_not-found/__next._tree.txt @@ -1,3 +1,3 @@ :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"/_not-found","paramType":null,"paramKey":"/_not-found","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"/_not-found","paramType":null,"paramKey":"/_not-found","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} diff --git a/litellm/proxy/_experimental/out/_not-found/index.html b/litellm/proxy/_experimental/out/_not-found/index.html index 45de348c4d5c..57818f08886e 100644 --- a/litellm/proxy/_experimental/out/_not-found/index.html +++ b/litellm/proxy/_experimental/out/_not-found/index.html @@ -1 +1 @@ -404: This page could not be found.LiteLLM Dashboard

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.LiteLLM Dashboard

404

This page could not be found.

\ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_not-found/index.txt b/litellm/proxy/_experimental/out/_not-found/index.txt index 70b2a6402113..38c37aff5592 100644 --- a/litellm/proxy/_experimental/out/_not-found/index.txt +++ b/litellm/proxy/_experimental/out/_not-found/index.txt @@ -1,7 +1,7 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] @@ -11,7 +11,7 @@ c:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/li e:I[168027,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","_not-found",""],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L7",null,{"children":["$","$8",null,{"name":"Next.MetadataOutlet","children":"$@9"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$La",null,{"children":"$Lb"}],["$","div",null,{"hidden":true,"children":["$","$Lc",null,{"children":["$","$8",null,{"name":"Next.Metadata","children":"$Ld"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$e","$undefined"],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","_not-found",""],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L7",null,{"children":["$","$8",null,{"name":"Next.MetadataOutlet","children":"$@9"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$La",null,{"children":"$Lb"}],["$","div",null,{"hidden":true,"children":["$","$Lc",null,{"children":["$","$8",null,{"name":"Next.Metadata","children":"$Ld"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$e","$undefined"],"S":true} b:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] f:I[27201,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"IconMark"] 9:null diff --git a/litellm/proxy/_experimental/out/api-reference/__next.!KGRhc2hib2FyZCk.api-reference.__PAGE__.txt b/litellm/proxy/_experimental/out/api-reference/__next.!KGRhc2hib2FyZCk.api-reference.__PAGE__.txt index 0cedce6ffd4e..e9ab68c40d8d 100644 --- a/litellm/proxy/_experimental/out/api-reference/__next.!KGRhc2hib2FyZCk.api-reference.__PAGE__.txt +++ b/litellm/proxy/_experimental/out/api-reference/__next.!KGRhc2hib2FyZCk.api-reference.__PAGE__.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" 2:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -3:I[191905,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/a7ff92f3d4489e51.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js"],"default"] +3:I[191905,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/a7ff92f3d4489e51.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js"],"default"] 6:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 7:"$Sreact.suspense" -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/a7ff92f3d4489e51.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/a7ff92f3d4489e51.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} 4:{} 5:{} 8:null diff --git a/litellm/proxy/_experimental/out/api-reference/__next.!KGRhc2hib2FyZCk.api-reference.txt b/litellm/proxy/_experimental/out/api-reference/__next.!KGRhc2hib2FyZCk.api-reference.txt index 8675b565665e..36d9cb90d1c8 100644 --- a/litellm/proxy/_experimental/out/api-reference/__next.!KGRhc2hib2FyZCk.api-reference.txt +++ b/litellm/proxy/_experimental/out/api-reference/__next.!KGRhc2hib2FyZCk.api-reference.txt @@ -1,4 +1,4 @@ 1:"$Sreact.fragment" 2:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 3:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/api-reference/__next.!KGRhc2hib2FyZCk.txt b/litellm/proxy/_experimental/out/api-reference/__next.!KGRhc2hib2FyZCk.txt index 364759b4338b..8b6933f2bce4 100644 --- a/litellm/proxy/_experimental/out/api-reference/__next.!KGRhc2hib2FyZCk.txt +++ b/litellm/proxy/_experimental/out/api-reference/__next.!KGRhc2hib2FyZCk.txt @@ -1,7 +1,7 @@ 1:"$Sreact.fragment" 2:I[92825,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientSegmentRoot"] -3:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] +3:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] 4:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 5:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true}]],["$","$L2",null,{"Component":"$3","slots":{"children":["$","$L4",null,{"parallelRouterKey":"children","template":["$","$L5",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]},"serverProvidedParams":{"params":{},"promises":["$@6"]}}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true}]],["$","$L2",null,{"Component":"$3","slots":{"children":["$","$L4",null,{"parallelRouterKey":"children","template":["$","$L5",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]},"serverProvidedParams":{"params":{},"promises":["$@6"]}}]]}],"loading":null,"isPartial":false} 6:"$0:rsc:props:children:1:props:serverProvidedParams:params" diff --git a/litellm/proxy/_experimental/out/api-reference/__next._full.txt b/litellm/proxy/_experimental/out/api-reference/__next._full.txt index 510f372b2d42..15ae86230e2d 100644 --- a/litellm/proxy/_experimental/out/api-reference/__next._full.txt +++ b/litellm/proxy/_experimental/out/api-reference/__next._full.txt @@ -1,18 +1,18 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[92825,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientSegmentRoot"] -8:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] +8:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] 10:I[168027,[],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","api-reference",""],"q":"","i":false,"f":[[["",{"children":["(dashboard)",{"children":["api-reference",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true,"nonce":"$undefined"}]],["$","$L7",null,{"Component":"$8","slots":{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]},"serverProvidedParams":{"params":{},"promises":["$@9"]}}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":["$La",["$Lb","$Lc","$Ld"],"$Le"]}],{},null,false,false]},null,false,false]},null,false,false]},null,false,false],"$Lf",false]],"m":"$undefined","G":["$10",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","api-reference",""],"q":"","i":false,"f":[[["",{"children":["(dashboard)",{"children":["api-reference",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true,"nonce":"$undefined"}]],["$","$L7",null,{"Component":"$8","slots":{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]},"serverProvidedParams":{"params":{},"promises":["$@9"]}}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":["$La",["$Lb","$Lc","$Ld"],"$Le"]}],{},null,false,false]},null,false,false]},null,false,false]},null,false,false],"$Lf",false]],"m":"$undefined","G":["$10",[]],"S":true} 11:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -12:I[191905,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/a7ff92f3d4489e51.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js"],"default"] +12:I[191905,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/a7ff92f3d4489e51.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js"],"default"] 15:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 16:"$Sreact.suspense" 18:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"] diff --git a/litellm/proxy/_experimental/out/api-reference/__next._head.txt b/litellm/proxy/_experimental/out/api-reference/__next._head.txt index 870c89c7e114..5e208181bb38 100644 --- a/litellm/proxy/_experimental/out/api-reference/__next._head.txt +++ b/litellm/proxy/_experimental/out/api-reference/__next._head.txt @@ -3,4 +3,4 @@ 3:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"IconMark"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/api-reference/__next._index.txt b/litellm/proxy/_experimental/out/api-reference/__next._index.txt index 67c452e8c219..d3b4e1ec8d8c 100644 --- a/litellm/proxy/_experimental/out/api-reference/__next._index.txt +++ b/litellm/proxy/_experimental/out/api-reference/__next._index.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/api-reference/__next._tree.txt b/litellm/proxy/_experimental/out/api-reference/__next._tree.txt index ebbd4c2218b1..01263214572e 100644 --- a/litellm/proxy/_experimental/out/api-reference/__next._tree.txt +++ b/litellm/proxy/_experimental/out/api-reference/__next._tree.txt @@ -1,4 +1,4 @@ :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"(dashboard)","paramType":null,"paramKey":"(dashboard)","hasRuntimePrefetch":false,"slots":{"children":{"name":"api-reference","paramType":null,"paramKey":"api-reference","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"(dashboard)","paramType":null,"paramKey":"(dashboard)","hasRuntimePrefetch":false,"slots":{"children":{"name":"api-reference","paramType":null,"paramKey":"api-reference","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} diff --git a/litellm/proxy/_experimental/out/api-reference/index.html b/litellm/proxy/_experimental/out/api-reference/index.html index 3500a78cb3d2..9498d576dbd5 100644 --- a/litellm/proxy/_experimental/out/api-reference/index.html +++ b/litellm/proxy/_experimental/out/api-reference/index.html @@ -1 +1 @@ -LiteLLM Dashboard
Loading...
\ No newline at end of file +LiteLLM Dashboard
Loading...
\ No newline at end of file diff --git a/litellm/proxy/_experimental/out/api-reference/index.txt b/litellm/proxy/_experimental/out/api-reference/index.txt index 510f372b2d42..15ae86230e2d 100644 --- a/litellm/proxy/_experimental/out/api-reference/index.txt +++ b/litellm/proxy/_experimental/out/api-reference/index.txt @@ -1,18 +1,18 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[92825,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientSegmentRoot"] -8:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] +8:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] 10:I[168027,[],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","api-reference",""],"q":"","i":false,"f":[[["",{"children":["(dashboard)",{"children":["api-reference",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true,"nonce":"$undefined"}]],["$","$L7",null,{"Component":"$8","slots":{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]},"serverProvidedParams":{"params":{},"promises":["$@9"]}}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":["$La",["$Lb","$Lc","$Ld"],"$Le"]}],{},null,false,false]},null,false,false]},null,false,false]},null,false,false],"$Lf",false]],"m":"$undefined","G":["$10",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","api-reference",""],"q":"","i":false,"f":[[["",{"children":["(dashboard)",{"children":["api-reference",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true,"nonce":"$undefined"}]],["$","$L7",null,{"Component":"$8","slots":{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]},"serverProvidedParams":{"params":{},"promises":["$@9"]}}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":["$La",["$Lb","$Lc","$Ld"],"$Le"]}],{},null,false,false]},null,false,false]},null,false,false]},null,false,false],"$Lf",false]],"m":"$undefined","G":["$10",[]],"S":true} 11:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -12:I[191905,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/a7ff92f3d4489e51.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js"],"default"] +12:I[191905,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/a7ff92f3d4489e51.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js"],"default"] 15:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 16:"$Sreact.suspense" 18:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"] diff --git a/litellm/proxy/_experimental/out/chat/__next._full.txt b/litellm/proxy/_experimental/out/chat/__next._full.txt index fcf9a495103a..3ce2446de098 100644 --- a/litellm/proxy/_experimental/out/chat/__next._full.txt +++ b/litellm/proxy/_experimental/out/chat/__next._full.txt @@ -1,11 +1,11 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -8:I[321443,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/29b221aa119c1fd9.js","/litellm-asset-prefix/_next/static/chunks/e538653d70cbebb3.js","/litellm-asset-prefix/_next/static/chunks/d1486de50c4b1eb6.js","/litellm-asset-prefix/_next/static/chunks/694efc3611ad294e.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/5da00c0630555f00.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/487ad085992f334d.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js"],"default"] +8:I[321443,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/29b221aa119c1fd9.js","/litellm-asset-prefix/_next/static/chunks/e538653d70cbebb3.js","/litellm-asset-prefix/_next/static/chunks/d1486de50c4b1eb6.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/487ad085992f334d.js","/litellm-asset-prefix/_next/static/chunks/2476fe06d2780024.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/b4e17884b60263b6.js"],"default"] b:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] c:"$Sreact.suspense" e:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"] @@ -14,7 +14,7 @@ e:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/li :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","chat",""],"q":"","i":false,"f":[[["",{"children":["chat",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/29b221aa119c1fd9.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/e538653d70cbebb3.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/d1486de50c4b1eb6.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/694efc3611ad294e.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/5da00c0630555f00.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/487ad085992f334d.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true,"nonce":"$undefined"}]],["$","$Lb",null,{"children":["$","$c",null,{"name":"Next.MetadataOutlet","children":"$@d"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Le",null,{"children":"$Lf"}],["$","div",null,{"hidden":true,"children":["$","$L10",null,{"children":["$","$c",null,{"name":"Next.Metadata","children":"$L11"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$12",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","chat",""],"q":"","i":false,"f":[[["",{"children":["chat",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/29b221aa119c1fd9.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/e538653d70cbebb3.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/d1486de50c4b1eb6.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/487ad085992f334d.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/2476fe06d2780024.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/b4e17884b60263b6.js","async":true,"nonce":"$undefined"}]],["$","$Lb",null,{"children":["$","$c",null,{"name":"Next.MetadataOutlet","children":"$@d"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Le",null,{"children":"$Lf"}],["$","div",null,{"hidden":true,"children":["$","$L10",null,{"children":["$","$c",null,{"name":"Next.Metadata","children":"$L11"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$12",[]],"S":true} 9:{} a:"$0:f:0:1:1:children:1:children:0:props:children:0:props:serverProvidedParams:params" f:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] diff --git a/litellm/proxy/_experimental/out/chat/__next._head.txt b/litellm/proxy/_experimental/out/chat/__next._head.txt index 870c89c7e114..5e208181bb38 100644 --- a/litellm/proxy/_experimental/out/chat/__next._head.txt +++ b/litellm/proxy/_experimental/out/chat/__next._head.txt @@ -3,4 +3,4 @@ 3:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"IconMark"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/chat/__next._index.txt b/litellm/proxy/_experimental/out/chat/__next._index.txt index 67c452e8c219..d3b4e1ec8d8c 100644 --- a/litellm/proxy/_experimental/out/chat/__next._index.txt +++ b/litellm/proxy/_experimental/out/chat/__next._index.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/chat/__next._tree.txt b/litellm/proxy/_experimental/out/chat/__next._tree.txt index a00f138e1972..cc8e88660455 100644 --- a/litellm/proxy/_experimental/out/chat/__next._tree.txt +++ b/litellm/proxy/_experimental/out/chat/__next._tree.txt @@ -1,4 +1,4 @@ :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"chat","paramType":null,"paramKey":"chat","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"chat","paramType":null,"paramKey":"chat","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} diff --git a/litellm/proxy/_experimental/out/chat/__next.chat.__PAGE__.txt b/litellm/proxy/_experimental/out/chat/__next.chat.__PAGE__.txt index b522f825876b..4d9d6ec364b2 100644 --- a/litellm/proxy/_experimental/out/chat/__next.chat.__PAGE__.txt +++ b/litellm/proxy/_experimental/out/chat/__next.chat.__PAGE__.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" 2:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -3:I[321443,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/29b221aa119c1fd9.js","/litellm-asset-prefix/_next/static/chunks/e538653d70cbebb3.js","/litellm-asset-prefix/_next/static/chunks/d1486de50c4b1eb6.js","/litellm-asset-prefix/_next/static/chunks/694efc3611ad294e.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/5da00c0630555f00.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/487ad085992f334d.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js"],"default"] +3:I[321443,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/29b221aa119c1fd9.js","/litellm-asset-prefix/_next/static/chunks/e538653d70cbebb3.js","/litellm-asset-prefix/_next/static/chunks/d1486de50c4b1eb6.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/487ad085992f334d.js","/litellm-asset-prefix/_next/static/chunks/2476fe06d2780024.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/b4e17884b60263b6.js"],"default"] 6:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 7:"$Sreact.suspense" -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/29b221aa119c1fd9.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/e538653d70cbebb3.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/d1486de50c4b1eb6.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/694efc3611ad294e.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/5da00c0630555f00.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/487ad085992f334d.js","async":true}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/29b221aa119c1fd9.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/e538653d70cbebb3.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/d1486de50c4b1eb6.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/487ad085992f334d.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/2476fe06d2780024.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/b4e17884b60263b6.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} 4:{} 5:"$0:rsc:props:children:0:props:serverProvidedParams:params" 8:null diff --git a/litellm/proxy/_experimental/out/chat/__next.chat.txt b/litellm/proxy/_experimental/out/chat/__next.chat.txt index 8675b565665e..36d9cb90d1c8 100644 --- a/litellm/proxy/_experimental/out/chat/__next.chat.txt +++ b/litellm/proxy/_experimental/out/chat/__next.chat.txt @@ -1,4 +1,4 @@ 1:"$Sreact.fragment" 2:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 3:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/chat/index.html b/litellm/proxy/_experimental/out/chat/index.html index d0ad08840193..59a9427b7b73 100644 --- a/litellm/proxy/_experimental/out/chat/index.html +++ b/litellm/proxy/_experimental/out/chat/index.html @@ -1 +1 @@ -LiteLLM Dashboard \ No newline at end of file +LiteLLM Dashboard \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/chat/index.txt b/litellm/proxy/_experimental/out/chat/index.txt index fcf9a495103a..3ce2446de098 100644 --- a/litellm/proxy/_experimental/out/chat/index.txt +++ b/litellm/proxy/_experimental/out/chat/index.txt @@ -1,11 +1,11 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -8:I[321443,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/29b221aa119c1fd9.js","/litellm-asset-prefix/_next/static/chunks/e538653d70cbebb3.js","/litellm-asset-prefix/_next/static/chunks/d1486de50c4b1eb6.js","/litellm-asset-prefix/_next/static/chunks/694efc3611ad294e.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/5da00c0630555f00.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/487ad085992f334d.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js"],"default"] +8:I[321443,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/29b221aa119c1fd9.js","/litellm-asset-prefix/_next/static/chunks/e538653d70cbebb3.js","/litellm-asset-prefix/_next/static/chunks/d1486de50c4b1eb6.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/487ad085992f334d.js","/litellm-asset-prefix/_next/static/chunks/2476fe06d2780024.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/b4e17884b60263b6.js"],"default"] b:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] c:"$Sreact.suspense" e:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"] @@ -14,7 +14,7 @@ e:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/li :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","chat",""],"q":"","i":false,"f":[[["",{"children":["chat",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/29b221aa119c1fd9.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/e538653d70cbebb3.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/d1486de50c4b1eb6.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/694efc3611ad294e.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/5da00c0630555f00.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/487ad085992f334d.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true,"nonce":"$undefined"}]],["$","$Lb",null,{"children":["$","$c",null,{"name":"Next.MetadataOutlet","children":"$@d"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Le",null,{"children":"$Lf"}],["$","div",null,{"hidden":true,"children":["$","$L10",null,{"children":["$","$c",null,{"name":"Next.Metadata","children":"$L11"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$12",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","chat",""],"q":"","i":false,"f":[[["",{"children":["chat",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/29b221aa119c1fd9.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/e538653d70cbebb3.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/d1486de50c4b1eb6.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/487ad085992f334d.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/2476fe06d2780024.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/b4e17884b60263b6.js","async":true,"nonce":"$undefined"}]],["$","$Lb",null,{"children":["$","$c",null,{"name":"Next.MetadataOutlet","children":"$@d"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Le",null,{"children":"$Lf"}],["$","div",null,{"hidden":true,"children":["$","$L10",null,{"children":["$","$c",null,{"name":"Next.Metadata","children":"$L11"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$12",[]],"S":true} 9:{} a:"$0:f:0:1:1:children:1:children:0:props:children:0:props:serverProvidedParams:params" f:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] diff --git a/litellm/proxy/_experimental/out/index.html b/litellm/proxy/_experimental/out/index.html index ab749275c1bf..f0f816e64117 100644 --- a/litellm/proxy/_experimental/out/index.html +++ b/litellm/proxy/_experimental/out/index.html @@ -1 +1 @@ -LiteLLM Dashboard
🚅 LiteLLM
Loading...
\ No newline at end of file +LiteLLM Dashboard
🚅 LiteLLM
Loading...
\ No newline at end of file diff --git a/litellm/proxy/_experimental/out/index.txt b/litellm/proxy/_experimental/out/index.txt index 2b2b38502070..c5f18ea1744c 100644 --- a/litellm/proxy/_experimental/out/index.txt +++ b/litellm/proxy/_experimental/out/index.txt @@ -1,34 +1,34 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -8:I[952683,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/bee4095c26818f05.js","/litellm-asset-prefix/_next/static/chunks/81937424fe90f746.js","/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/04711b0f8ffa7bbd.js","/litellm-asset-prefix/_next/static/chunks/eb1ba04e211a533f.js","/litellm-asset-prefix/_next/static/chunks/88c74f8b4b20d25a.js","/litellm-asset-prefix/_next/static/chunks/4cb93eefa53f21a3.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/84a27349dda457cd.js","/litellm-asset-prefix/_next/static/chunks/8ddf82e7e0b331fc.js","/litellm-asset-prefix/_next/static/chunks/1d7b3500478e93ae.js","/litellm-asset-prefix/_next/static/chunks/f0e079183e7bb90c.js","/litellm-asset-prefix/_next/static/chunks/10757c2146f43db4.js","/litellm-asset-prefix/_next/static/chunks/786e88f4abdd5c58.js","/litellm-asset-prefix/_next/static/chunks/ffa46de7b8384155.js","/litellm-asset-prefix/_next/static/chunks/31275eb5c6f6332f.js","/litellm-asset-prefix/_next/static/chunks/80f4410629229bf9.js","/litellm-asset-prefix/_next/static/chunks/75ee9aba04c74e23.js","/litellm-asset-prefix/_next/static/chunks/193886179a5779b5.js","/litellm-asset-prefix/_next/static/chunks/2063ca6435a47940.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/d7c18aec4a87a237.js","/litellm-asset-prefix/_next/static/chunks/dac86522fa98e760.js"],"default"] +8:I[952683,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/bee4095c26818f05.js","/litellm-asset-prefix/_next/static/chunks/81937424fe90f746.js","/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/04711b0f8ffa7bbd.js","/litellm-asset-prefix/_next/static/chunks/eb1ba04e211a533f.js","/litellm-asset-prefix/_next/static/chunks/1d7b3500478e93ae.js","/litellm-asset-prefix/_next/static/chunks/4cb93eefa53f21a3.js","/litellm-asset-prefix/_next/static/chunks/f0e079183e7bb90c.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/8ddf82e7e0b331fc.js","/litellm-asset-prefix/_next/static/chunks/193886179a5779b5.js","/litellm-asset-prefix/_next/static/chunks/80f4410629229bf9.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","/litellm-asset-prefix/_next/static/chunks/31275eb5c6f6332f.js","/litellm-asset-prefix/_next/static/chunks/a4315c6eaf401064.js","/litellm-asset-prefix/_next/static/chunks/10757c2146f43db4.js","/litellm-asset-prefix/_next/static/chunks/88c74f8b4b20d25a.js","/litellm-asset-prefix/_next/static/chunks/75ee9aba04c74e23.js","/litellm-asset-prefix/_next/static/chunks/786e88f4abdd5c58.js","/litellm-asset-prefix/_next/static/chunks/2063ca6435a47940.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/84a27349dda457cd.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/d7c18aec4a87a237.js","/litellm-asset-prefix/_next/static/chunks/51d99dfbdc051e05.js"],"default"] 1a:I[168027,[],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] :HL["/litellm-asset-prefix/_next/static/chunks/3f3fa56b5786d58c.css","style"] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/3f3fa56b5786d58c.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/bee4095c26818f05.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/81937424fe90f746.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/04711b0f8ffa7bbd.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/eb1ba04e211a533f.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/88c74f8b4b20d25a.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/4cb93eefa53f21a3.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/84a27349dda457cd.js","async":true,"nonce":"$undefined"}],["$","script","script-12",{"src":"/litellm-asset-prefix/_next/static/chunks/8ddf82e7e0b331fc.js","async":true,"nonce":"$undefined"}],["$","script","script-13",{"src":"/litellm-asset-prefix/_next/static/chunks/1d7b3500478e93ae.js","async":true,"nonce":"$undefined"}],["$","script","script-14",{"src":"/litellm-asset-prefix/_next/static/chunks/f0e079183e7bb90c.js","async":true,"nonce":"$undefined"}],["$","script","script-15",{"src":"/litellm-asset-prefix/_next/static/chunks/10757c2146f43db4.js","async":true,"nonce":"$undefined"}],"$Lb","$Lc","$Ld","$Le","$Lf","$L10","$L11","$L12","$L13","$L14","$L15","$L16","$L17"],"$L18"]}],{},null,false,false]},null,false,false],"$L19",false]],"m":"$undefined","G":["$1a",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/3f3fa56b5786d58c.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/bee4095c26818f05.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/81937424fe90f746.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/04711b0f8ffa7bbd.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/eb1ba04e211a533f.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/1d7b3500478e93ae.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/4cb93eefa53f21a3.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/f0e079183e7bb90c.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","async":true,"nonce":"$undefined"}],["$","script","script-12",{"src":"/litellm-asset-prefix/_next/static/chunks/8ddf82e7e0b331fc.js","async":true,"nonce":"$undefined"}],["$","script","script-13",{"src":"/litellm-asset-prefix/_next/static/chunks/193886179a5779b5.js","async":true,"nonce":"$undefined"}],["$","script","script-14",{"src":"/litellm-asset-prefix/_next/static/chunks/80f4410629229bf9.js","async":true,"nonce":"$undefined"}],["$","script","script-15",{"src":"/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","async":true,"nonce":"$undefined"}],"$Lb","$Lc","$Ld","$Le","$Lf","$L10","$L11","$L12","$L13","$L14","$L15","$L16","$L17"],"$L18"]}],{},null,false,false]},null,false,false],"$L19",false]],"m":"$undefined","G":["$1a",[]],"S":true} 1b:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 1c:"$Sreact.suspense" 1e:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"] 20:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"MetadataBoundary"] -b:["$","script","script-16",{"src":"/litellm-asset-prefix/_next/static/chunks/786e88f4abdd5c58.js","async":true,"nonce":"$undefined"}] -c:["$","script","script-17",{"src":"/litellm-asset-prefix/_next/static/chunks/ffa46de7b8384155.js","async":true,"nonce":"$undefined"}] -d:["$","script","script-18",{"src":"/litellm-asset-prefix/_next/static/chunks/31275eb5c6f6332f.js","async":true,"nonce":"$undefined"}] -e:["$","script","script-19",{"src":"/litellm-asset-prefix/_next/static/chunks/80f4410629229bf9.js","async":true,"nonce":"$undefined"}] +b:["$","script","script-16",{"src":"/litellm-asset-prefix/_next/static/chunks/31275eb5c6f6332f.js","async":true,"nonce":"$undefined"}] +c:["$","script","script-17",{"src":"/litellm-asset-prefix/_next/static/chunks/a4315c6eaf401064.js","async":true,"nonce":"$undefined"}] +d:["$","script","script-18",{"src":"/litellm-asset-prefix/_next/static/chunks/10757c2146f43db4.js","async":true,"nonce":"$undefined"}] +e:["$","script","script-19",{"src":"/litellm-asset-prefix/_next/static/chunks/88c74f8b4b20d25a.js","async":true,"nonce":"$undefined"}] f:["$","script","script-20",{"src":"/litellm-asset-prefix/_next/static/chunks/75ee9aba04c74e23.js","async":true,"nonce":"$undefined"}] -10:["$","script","script-21",{"src":"/litellm-asset-prefix/_next/static/chunks/193886179a5779b5.js","async":true,"nonce":"$undefined"}] +10:["$","script","script-21",{"src":"/litellm-asset-prefix/_next/static/chunks/786e88f4abdd5c58.js","async":true,"nonce":"$undefined"}] 11:["$","script","script-22",{"src":"/litellm-asset-prefix/_next/static/chunks/2063ca6435a47940.js","async":true,"nonce":"$undefined"}] 12:["$","script","script-23",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true,"nonce":"$undefined"}] -13:["$","script","script-24",{"src":"/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","async":true,"nonce":"$undefined"}] +13:["$","script","script-24",{"src":"/litellm-asset-prefix/_next/static/chunks/84a27349dda457cd.js","async":true,"nonce":"$undefined"}] 14:["$","script","script-25",{"src":"/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","async":true,"nonce":"$undefined"}] -15:["$","script","script-26",{"src":"/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","async":true,"nonce":"$undefined"}] +15:["$","script","script-26",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}] 16:["$","script","script-27",{"src":"/litellm-asset-prefix/_next/static/chunks/d7c18aec4a87a237.js","async":true,"nonce":"$undefined"}] -17:["$","script","script-28",{"src":"/litellm-asset-prefix/_next/static/chunks/dac86522fa98e760.js","async":true,"nonce":"$undefined"}] +17:["$","script","script-28",{"src":"/litellm-asset-prefix/_next/static/chunks/51d99dfbdc051e05.js","async":true,"nonce":"$undefined"}] 18:["$","$L1b",null,{"children":["$","$1c",null,{"name":"Next.MetadataOutlet","children":"$@1d"}]}] 19:["$","$1","h",{"children":[null,["$","$L1e",null,{"children":"$L1f"}],["$","div",null,{"hidden":true,"children":["$","$L20",null,{"children":["$","$1c",null,{"name":"Next.Metadata","children":"$L21"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}] 9:{} diff --git a/litellm/proxy/_experimental/out/login/__next._full.txt b/litellm/proxy/_experimental/out/login/__next._full.txt index 4c6762e95fc9..7760283b5da4 100644 --- a/litellm/proxy/_experimental/out/login/__next._full.txt +++ b/litellm/proxy/_experimental/out/login/__next._full.txt @@ -1,11 +1,11 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -8:I[594542,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/6f180247948a105b.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/10376d0955336027.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js"],"default"] +8:I[594542,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/6f180247948a105b.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/10376d0955336027.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js"],"default"] b:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] c:"$Sreact.suspense" e:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"] @@ -14,7 +14,7 @@ e:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/li :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","login",""],"q":"","i":false,"f":[[["",{"children":["login",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/6f180247948a105b.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/10376d0955336027.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","async":true,"nonce":"$undefined"}]],["$","$Lb",null,{"children":["$","$c",null,{"name":"Next.MetadataOutlet","children":"$@d"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Le",null,{"children":"$Lf"}],["$","div",null,{"hidden":true,"children":["$","$L10",null,{"children":["$","$c",null,{"name":"Next.Metadata","children":"$L11"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$12",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","login",""],"q":"","i":false,"f":[[["",{"children":["login",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/6f180247948a105b.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/10376d0955336027.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","async":true,"nonce":"$undefined"}]],["$","$Lb",null,{"children":["$","$c",null,{"name":"Next.MetadataOutlet","children":"$@d"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Le",null,{"children":"$Lf"}],["$","div",null,{"hidden":true,"children":["$","$L10",null,{"children":["$","$c",null,{"name":"Next.Metadata","children":"$L11"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$12",[]],"S":true} 9:{} a:"$0:f:0:1:1:children:1:children:0:props:children:0:props:serverProvidedParams:params" f:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] diff --git a/litellm/proxy/_experimental/out/login/__next._head.txt b/litellm/proxy/_experimental/out/login/__next._head.txt index 870c89c7e114..5e208181bb38 100644 --- a/litellm/proxy/_experimental/out/login/__next._head.txt +++ b/litellm/proxy/_experimental/out/login/__next._head.txt @@ -3,4 +3,4 @@ 3:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"IconMark"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/login/__next._index.txt b/litellm/proxy/_experimental/out/login/__next._index.txt index 67c452e8c219..d3b4e1ec8d8c 100644 --- a/litellm/proxy/_experimental/out/login/__next._index.txt +++ b/litellm/proxy/_experimental/out/login/__next._index.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/login/__next._tree.txt b/litellm/proxy/_experimental/out/login/__next._tree.txt index 50476abc1fa9..a17b2f8662ff 100644 --- a/litellm/proxy/_experimental/out/login/__next._tree.txt +++ b/litellm/proxy/_experimental/out/login/__next._tree.txt @@ -1,4 +1,4 @@ :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"login","paramType":null,"paramKey":"login","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"login","paramType":null,"paramKey":"login","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} diff --git a/litellm/proxy/_experimental/out/login/__next.login.__PAGE__.txt b/litellm/proxy/_experimental/out/login/__next.login.__PAGE__.txt index ece56cda4d47..073030efc3e5 100644 --- a/litellm/proxy/_experimental/out/login/__next.login.__PAGE__.txt +++ b/litellm/proxy/_experimental/out/login/__next.login.__PAGE__.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" 2:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -3:I[594542,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/6f180247948a105b.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/10376d0955336027.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js"],"default"] +3:I[594542,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/6f180247948a105b.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/10376d0955336027.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js"],"default"] 6:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 7:"$Sreact.suspense" -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/6f180247948a105b.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/10376d0955336027.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/6f180247948a105b.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/10376d0955336027.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} 4:{} 5:"$0:rsc:props:children:0:props:serverProvidedParams:params" 8:null diff --git a/litellm/proxy/_experimental/out/login/__next.login.txt b/litellm/proxy/_experimental/out/login/__next.login.txt index 8675b565665e..36d9cb90d1c8 100644 --- a/litellm/proxy/_experimental/out/login/__next.login.txt +++ b/litellm/proxy/_experimental/out/login/__next.login.txt @@ -1,4 +1,4 @@ 1:"$Sreact.fragment" 2:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 3:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/login/index.html b/litellm/proxy/_experimental/out/login/index.html index 092032796087..6422fa85e69b 100644 --- a/litellm/proxy/_experimental/out/login/index.html +++ b/litellm/proxy/_experimental/out/login/index.html @@ -1 +1 @@ -LiteLLM Dashboard
🚅 LiteLLM
Loading...
\ No newline at end of file +LiteLLM Dashboard
🚅 LiteLLM
Loading...
\ No newline at end of file diff --git a/litellm/proxy/_experimental/out/login/index.txt b/litellm/proxy/_experimental/out/login/index.txt index 4c6762e95fc9..7760283b5da4 100644 --- a/litellm/proxy/_experimental/out/login/index.txt +++ b/litellm/proxy/_experimental/out/login/index.txt @@ -1,11 +1,11 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -8:I[594542,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/6f180247948a105b.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/10376d0955336027.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js"],"default"] +8:I[594542,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/6f180247948a105b.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/10376d0955336027.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js"],"default"] b:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] c:"$Sreact.suspense" e:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"] @@ -14,7 +14,7 @@ e:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/li :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","login",""],"q":"","i":false,"f":[[["",{"children":["login",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/6f180247948a105b.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/10376d0955336027.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","async":true,"nonce":"$undefined"}]],["$","$Lb",null,{"children":["$","$c",null,{"name":"Next.MetadataOutlet","children":"$@d"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Le",null,{"children":"$Lf"}],["$","div",null,{"hidden":true,"children":["$","$L10",null,{"children":["$","$c",null,{"name":"Next.Metadata","children":"$L11"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$12",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","login",""],"q":"","i":false,"f":[[["",{"children":["login",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/6f180247948a105b.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/10376d0955336027.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","async":true,"nonce":"$undefined"}]],["$","$Lb",null,{"children":["$","$c",null,{"name":"Next.MetadataOutlet","children":"$@d"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Le",null,{"children":"$Lf"}],["$","div",null,{"hidden":true,"children":["$","$L10",null,{"children":["$","$c",null,{"name":"Next.Metadata","children":"$L11"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$12",[]],"S":true} 9:{} a:"$0:f:0:1:1:children:1:children:0:props:children:0:props:serverProvidedParams:params" f:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] diff --git a/litellm/proxy/_experimental/out/mcp/oauth/callback/__next._full.txt b/litellm/proxy/_experimental/out/mcp/oauth/callback/__next._full.txt index b1876d771c07..45c16bf21331 100644 --- a/litellm/proxy/_experimental/out/mcp/oauth/callback/__next._full.txt +++ b/litellm/proxy/_experimental/out/mcp/oauth/callback/__next._full.txt @@ -1,11 +1,11 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -8:I[346328,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/fc5911e3a3caa8aa.js"],"default"] +8:I[346328,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/fc5911e3a3caa8aa.js"],"default"] b:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] c:"$Sreact.suspense" e:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"] @@ -14,7 +14,7 @@ e:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/li :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","mcp","oauth","callback",""],"q":"","i":false,"f":[[["",{"children":["mcp",{"children":["oauth",{"children":["callback",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/fc5911e3a3caa8aa.js","async":true,"nonce":"$undefined"}]],["$","$Lb",null,{"children":["$","$c",null,{"name":"Next.MetadataOutlet","children":"$@d"}]}]]}],{},null,false,false]},null,false,false]},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Le",null,{"children":"$Lf"}],["$","div",null,{"hidden":true,"children":["$","$L10",null,{"children":["$","$c",null,{"name":"Next.Metadata","children":"$L11"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$12",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","mcp","oauth","callback",""],"q":"","i":false,"f":[[["",{"children":["mcp",{"children":["oauth",{"children":["callback",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/fc5911e3a3caa8aa.js","async":true,"nonce":"$undefined"}]],["$","$Lb",null,{"children":["$","$c",null,{"name":"Next.MetadataOutlet","children":"$@d"}]}]]}],{},null,false,false]},null,false,false]},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Le",null,{"children":"$Lf"}],["$","div",null,{"hidden":true,"children":["$","$L10",null,{"children":["$","$c",null,{"name":"Next.Metadata","children":"$L11"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$12",[]],"S":true} 9:{} a:"$0:f:0:1:1:children:1:children:1:children:1:children:0:props:children:0:props:serverProvidedParams:params" f:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] diff --git a/litellm/proxy/_experimental/out/mcp/oauth/callback/__next._head.txt b/litellm/proxy/_experimental/out/mcp/oauth/callback/__next._head.txt index 870c89c7e114..5e208181bb38 100644 --- a/litellm/proxy/_experimental/out/mcp/oauth/callback/__next._head.txt +++ b/litellm/proxy/_experimental/out/mcp/oauth/callback/__next._head.txt @@ -3,4 +3,4 @@ 3:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"IconMark"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/mcp/oauth/callback/__next._index.txt b/litellm/proxy/_experimental/out/mcp/oauth/callback/__next._index.txt index 67c452e8c219..d3b4e1ec8d8c 100644 --- a/litellm/proxy/_experimental/out/mcp/oauth/callback/__next._index.txt +++ b/litellm/proxy/_experimental/out/mcp/oauth/callback/__next._index.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/mcp/oauth/callback/__next._tree.txt b/litellm/proxy/_experimental/out/mcp/oauth/callback/__next._tree.txt index 5c483c0a2568..4034622bab4b 100644 --- a/litellm/proxy/_experimental/out/mcp/oauth/callback/__next._tree.txt +++ b/litellm/proxy/_experimental/out/mcp/oauth/callback/__next._tree.txt @@ -1,4 +1,4 @@ :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"mcp","paramType":null,"paramKey":"mcp","hasRuntimePrefetch":false,"slots":{"children":{"name":"oauth","paramType":null,"paramKey":"oauth","hasRuntimePrefetch":false,"slots":{"children":{"name":"callback","paramType":null,"paramKey":"callback","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"mcp","paramType":null,"paramKey":"mcp","hasRuntimePrefetch":false,"slots":{"children":{"name":"oauth","paramType":null,"paramKey":"oauth","hasRuntimePrefetch":false,"slots":{"children":{"name":"callback","paramType":null,"paramKey":"callback","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} diff --git a/litellm/proxy/_experimental/out/mcp/oauth/callback/__next.mcp.oauth.callback.__PAGE__.txt b/litellm/proxy/_experimental/out/mcp/oauth/callback/__next.mcp.oauth.callback.__PAGE__.txt index 4004e9823e04..3ba3bbb91329 100644 --- a/litellm/proxy/_experimental/out/mcp/oauth/callback/__next.mcp.oauth.callback.__PAGE__.txt +++ b/litellm/proxy/_experimental/out/mcp/oauth/callback/__next.mcp.oauth.callback.__PAGE__.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" 2:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -3:I[346328,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/fc5911e3a3caa8aa.js"],"default"] +3:I[346328,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/fc5911e3a3caa8aa.js"],"default"] 6:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 7:"$Sreact.suspense" -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/fc5911e3a3caa8aa.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/fc5911e3a3caa8aa.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} 4:{} 5:"$0:rsc:props:children:0:props:serverProvidedParams:params" 8:null diff --git a/litellm/proxy/_experimental/out/mcp/oauth/callback/__next.mcp.oauth.callback.txt b/litellm/proxy/_experimental/out/mcp/oauth/callback/__next.mcp.oauth.callback.txt index 8675b565665e..36d9cb90d1c8 100644 --- a/litellm/proxy/_experimental/out/mcp/oauth/callback/__next.mcp.oauth.callback.txt +++ b/litellm/proxy/_experimental/out/mcp/oauth/callback/__next.mcp.oauth.callback.txt @@ -1,4 +1,4 @@ 1:"$Sreact.fragment" 2:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 3:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/mcp/oauth/callback/__next.mcp.oauth.txt b/litellm/proxy/_experimental/out/mcp/oauth/callback/__next.mcp.oauth.txt index 8675b565665e..36d9cb90d1c8 100644 --- a/litellm/proxy/_experimental/out/mcp/oauth/callback/__next.mcp.oauth.txt +++ b/litellm/proxy/_experimental/out/mcp/oauth/callback/__next.mcp.oauth.txt @@ -1,4 +1,4 @@ 1:"$Sreact.fragment" 2:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 3:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/mcp/oauth/callback/__next.mcp.txt b/litellm/proxy/_experimental/out/mcp/oauth/callback/__next.mcp.txt index 8675b565665e..36d9cb90d1c8 100644 --- a/litellm/proxy/_experimental/out/mcp/oauth/callback/__next.mcp.txt +++ b/litellm/proxy/_experimental/out/mcp/oauth/callback/__next.mcp.txt @@ -1,4 +1,4 @@ 1:"$Sreact.fragment" 2:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 3:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/mcp/oauth/callback/index.html b/litellm/proxy/_experimental/out/mcp/oauth/callback/index.html index 4842b9751f41..1e66cfec3215 100644 --- a/litellm/proxy/_experimental/out/mcp/oauth/callback/index.html +++ b/litellm/proxy/_experimental/out/mcp/oauth/callback/index.html @@ -1 +1 @@ -LiteLLM Dashboard
Loading...
\ No newline at end of file +LiteLLM Dashboard
Loading...
\ No newline at end of file diff --git a/litellm/proxy/_experimental/out/mcp/oauth/callback/index.txt b/litellm/proxy/_experimental/out/mcp/oauth/callback/index.txt index b1876d771c07..45c16bf21331 100644 --- a/litellm/proxy/_experimental/out/mcp/oauth/callback/index.txt +++ b/litellm/proxy/_experimental/out/mcp/oauth/callback/index.txt @@ -1,11 +1,11 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -8:I[346328,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/fc5911e3a3caa8aa.js"],"default"] +8:I[346328,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/fc5911e3a3caa8aa.js"],"default"] b:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] c:"$Sreact.suspense" e:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"] @@ -14,7 +14,7 @@ e:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/li :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","mcp","oauth","callback",""],"q":"","i":false,"f":[[["",{"children":["mcp",{"children":["oauth",{"children":["callback",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/fc5911e3a3caa8aa.js","async":true,"nonce":"$undefined"}]],["$","$Lb",null,{"children":["$","$c",null,{"name":"Next.MetadataOutlet","children":"$@d"}]}]]}],{},null,false,false]},null,false,false]},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Le",null,{"children":"$Lf"}],["$","div",null,{"hidden":true,"children":["$","$L10",null,{"children":["$","$c",null,{"name":"Next.Metadata","children":"$L11"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$12",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","mcp","oauth","callback",""],"q":"","i":false,"f":[[["",{"children":["mcp",{"children":["oauth",{"children":["callback",{"children":["__PAGE__",{}]}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/fc5911e3a3caa8aa.js","async":true,"nonce":"$undefined"}]],["$","$Lb",null,{"children":["$","$c",null,{"name":"Next.MetadataOutlet","children":"$@d"}]}]]}],{},null,false,false]},null,false,false]},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Le",null,{"children":"$Lf"}],["$","div",null,{"hidden":true,"children":["$","$L10",null,{"children":["$","$c",null,{"name":"Next.Metadata","children":"$L11"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$12",[]],"S":true} 9:{} a:"$0:f:0:1:1:children:1:children:1:children:1:children:0:props:children:0:props:serverProvidedParams:params" f:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] diff --git a/litellm/proxy/_experimental/out/model_hub/__next._full.txt b/litellm/proxy/_experimental/out/model_hub/__next._full.txt index d3aa9d59b1fd..0ba4ea9a4f6a 100644 --- a/litellm/proxy/_experimental/out/model_hub/__next._full.txt +++ b/litellm/proxy/_experimental/out/model_hub/__next._full.txt @@ -1,11 +1,11 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -8:I[560280,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/5282ed7355826608.js","/litellm-asset-prefix/_next/static/chunks/91bec32f0959e7e7.js","/litellm-asset-prefix/_next/static/chunks/4251768481e3628c.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/684e626991fc0b22.js","/litellm-asset-prefix/_next/static/chunks/2442f588ee71a3fd.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/afa8789677796146.js","/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/334af1ce9508e323.js"],"default"] +8:I[560280,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/5282ed7355826608.js","/litellm-asset-prefix/_next/static/chunks/91bec32f0959e7e7.js","/litellm-asset-prefix/_next/static/chunks/4251768481e3628c.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/684e626991fc0b22.js","/litellm-asset-prefix/_next/static/chunks/2442f588ee71a3fd.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/afa8789677796146.js","/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/334af1ce9508e323.js"],"default"] b:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] c:"$Sreact.suspense" e:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"] @@ -14,7 +14,7 @@ e:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/li :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","model_hub",""],"q":"","i":false,"f":[[["",{"children":["model_hub",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/5282ed7355826608.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/91bec32f0959e7e7.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/4251768481e3628c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/684e626991fc0b22.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/2442f588ee71a3fd.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/afa8789677796146.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","async":true,"nonce":"$undefined"}],["$","script","script-12",{"src":"/litellm-asset-prefix/_next/static/chunks/334af1ce9508e323.js","async":true,"nonce":"$undefined"}]],["$","$Lb",null,{"children":["$","$c",null,{"name":"Next.MetadataOutlet","children":"$@d"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Le",null,{"children":"$Lf"}],["$","div",null,{"hidden":true,"children":["$","$L10",null,{"children":["$","$c",null,{"name":"Next.Metadata","children":"$L11"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$12",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","model_hub",""],"q":"","i":false,"f":[[["",{"children":["model_hub",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/5282ed7355826608.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/91bec32f0959e7e7.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/4251768481e3628c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/684e626991fc0b22.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/2442f588ee71a3fd.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/afa8789677796146.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","async":true,"nonce":"$undefined"}],["$","script","script-12",{"src":"/litellm-asset-prefix/_next/static/chunks/334af1ce9508e323.js","async":true,"nonce":"$undefined"}]],["$","$Lb",null,{"children":["$","$c",null,{"name":"Next.MetadataOutlet","children":"$@d"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Le",null,{"children":"$Lf"}],["$","div",null,{"hidden":true,"children":["$","$L10",null,{"children":["$","$c",null,{"name":"Next.Metadata","children":"$L11"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$12",[]],"S":true} 9:{} a:"$0:f:0:1:1:children:1:children:0:props:children:0:props:serverProvidedParams:params" f:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] diff --git a/litellm/proxy/_experimental/out/model_hub/__next._head.txt b/litellm/proxy/_experimental/out/model_hub/__next._head.txt index 870c89c7e114..5e208181bb38 100644 --- a/litellm/proxy/_experimental/out/model_hub/__next._head.txt +++ b/litellm/proxy/_experimental/out/model_hub/__next._head.txt @@ -3,4 +3,4 @@ 3:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"IconMark"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/model_hub/__next._index.txt b/litellm/proxy/_experimental/out/model_hub/__next._index.txt index 67c452e8c219..d3b4e1ec8d8c 100644 --- a/litellm/proxy/_experimental/out/model_hub/__next._index.txt +++ b/litellm/proxy/_experimental/out/model_hub/__next._index.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/model_hub/__next._tree.txt b/litellm/proxy/_experimental/out/model_hub/__next._tree.txt index 0b289702801a..e650c4934f11 100644 --- a/litellm/proxy/_experimental/out/model_hub/__next._tree.txt +++ b/litellm/proxy/_experimental/out/model_hub/__next._tree.txt @@ -1,4 +1,4 @@ :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"model_hub","paramType":null,"paramKey":"model_hub","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"model_hub","paramType":null,"paramKey":"model_hub","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} diff --git a/litellm/proxy/_experimental/out/model_hub/__next.model_hub.__PAGE__.txt b/litellm/proxy/_experimental/out/model_hub/__next.model_hub.__PAGE__.txt index 7b1a1f90abb2..d08b4e082013 100644 --- a/litellm/proxy/_experimental/out/model_hub/__next.model_hub.__PAGE__.txt +++ b/litellm/proxy/_experimental/out/model_hub/__next.model_hub.__PAGE__.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" 2:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -3:I[560280,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/5282ed7355826608.js","/litellm-asset-prefix/_next/static/chunks/91bec32f0959e7e7.js","/litellm-asset-prefix/_next/static/chunks/4251768481e3628c.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/684e626991fc0b22.js","/litellm-asset-prefix/_next/static/chunks/2442f588ee71a3fd.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/afa8789677796146.js","/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/334af1ce9508e323.js"],"default"] +3:I[560280,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/5282ed7355826608.js","/litellm-asset-prefix/_next/static/chunks/91bec32f0959e7e7.js","/litellm-asset-prefix/_next/static/chunks/4251768481e3628c.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/684e626991fc0b22.js","/litellm-asset-prefix/_next/static/chunks/2442f588ee71a3fd.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/afa8789677796146.js","/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/334af1ce9508e323.js"],"default"] 6:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 7:"$Sreact.suspense" -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/5282ed7355826608.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/91bec32f0959e7e7.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/4251768481e3628c.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/684e626991fc0b22.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/2442f588ee71a3fd.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/afa8789677796146.js","async":true}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","async":true}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","async":true}],["$","script","script-12",{"src":"/litellm-asset-prefix/_next/static/chunks/334af1ce9508e323.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/5282ed7355826608.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/91bec32f0959e7e7.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/4251768481e3628c.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/684e626991fc0b22.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/2442f588ee71a3fd.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/afa8789677796146.js","async":true}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","async":true}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","async":true}],["$","script","script-12",{"src":"/litellm-asset-prefix/_next/static/chunks/334af1ce9508e323.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} 4:{} 5:"$0:rsc:props:children:0:props:serverProvidedParams:params" 8:null diff --git a/litellm/proxy/_experimental/out/model_hub/__next.model_hub.txt b/litellm/proxy/_experimental/out/model_hub/__next.model_hub.txt index 8675b565665e..36d9cb90d1c8 100644 --- a/litellm/proxy/_experimental/out/model_hub/__next.model_hub.txt +++ b/litellm/proxy/_experimental/out/model_hub/__next.model_hub.txt @@ -1,4 +1,4 @@ 1:"$Sreact.fragment" 2:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 3:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/model_hub/index.html b/litellm/proxy/_experimental/out/model_hub/index.html index faab644a6bdf..fe2d3cc7e7c7 100644 --- a/litellm/proxy/_experimental/out/model_hub/index.html +++ b/litellm/proxy/_experimental/out/model_hub/index.html @@ -1 +1 @@ -LiteLLM Dashboard
Loading...
\ No newline at end of file +LiteLLM Dashboard
Loading...
\ No newline at end of file diff --git a/litellm/proxy/_experimental/out/model_hub/index.txt b/litellm/proxy/_experimental/out/model_hub/index.txt index d3aa9d59b1fd..0ba4ea9a4f6a 100644 --- a/litellm/proxy/_experimental/out/model_hub/index.txt +++ b/litellm/proxy/_experimental/out/model_hub/index.txt @@ -1,11 +1,11 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -8:I[560280,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/5282ed7355826608.js","/litellm-asset-prefix/_next/static/chunks/91bec32f0959e7e7.js","/litellm-asset-prefix/_next/static/chunks/4251768481e3628c.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/684e626991fc0b22.js","/litellm-asset-prefix/_next/static/chunks/2442f588ee71a3fd.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/afa8789677796146.js","/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/334af1ce9508e323.js"],"default"] +8:I[560280,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/5282ed7355826608.js","/litellm-asset-prefix/_next/static/chunks/91bec32f0959e7e7.js","/litellm-asset-prefix/_next/static/chunks/4251768481e3628c.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/684e626991fc0b22.js","/litellm-asset-prefix/_next/static/chunks/2442f588ee71a3fd.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/afa8789677796146.js","/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/334af1ce9508e323.js"],"default"] b:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] c:"$Sreact.suspense" e:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"] @@ -14,7 +14,7 @@ e:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/li :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","model_hub",""],"q":"","i":false,"f":[[["",{"children":["model_hub",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/5282ed7355826608.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/91bec32f0959e7e7.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/4251768481e3628c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/684e626991fc0b22.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/2442f588ee71a3fd.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/afa8789677796146.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","async":true,"nonce":"$undefined"}],["$","script","script-12",{"src":"/litellm-asset-prefix/_next/static/chunks/334af1ce9508e323.js","async":true,"nonce":"$undefined"}]],["$","$Lb",null,{"children":["$","$c",null,{"name":"Next.MetadataOutlet","children":"$@d"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Le",null,{"children":"$Lf"}],["$","div",null,{"hidden":true,"children":["$","$L10",null,{"children":["$","$c",null,{"name":"Next.Metadata","children":"$L11"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$12",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","model_hub",""],"q":"","i":false,"f":[[["",{"children":["model_hub",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/5282ed7355826608.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/91bec32f0959e7e7.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/4251768481e3628c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/684e626991fc0b22.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/2442f588ee71a3fd.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/afa8789677796146.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","async":true,"nonce":"$undefined"}],["$","script","script-12",{"src":"/litellm-asset-prefix/_next/static/chunks/334af1ce9508e323.js","async":true,"nonce":"$undefined"}]],["$","$Lb",null,{"children":["$","$c",null,{"name":"Next.MetadataOutlet","children":"$@d"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Le",null,{"children":"$Lf"}],["$","div",null,{"hidden":true,"children":["$","$L10",null,{"children":["$","$c",null,{"name":"Next.Metadata","children":"$L11"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$12",[]],"S":true} 9:{} a:"$0:f:0:1:1:children:1:children:0:props:children:0:props:serverProvidedParams:params" f:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] diff --git a/litellm/proxy/_experimental/out/model_hub_table/__next._full.txt b/litellm/proxy/_experimental/out/model_hub_table/__next._full.txt index 65b5806dfe81..761d3ec52d93 100644 --- a/litellm/proxy/_experimental/out/model_hub_table/__next._full.txt +++ b/litellm/proxy/_experimental/out/model_hub_table/__next._full.txt @@ -1,16 +1,16 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -8:I[86408,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/3f7acc7b23e100ab.js","/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","/litellm-asset-prefix/_next/static/chunks/57c31f51bf493dcc.js","/litellm-asset-prefix/_next/static/chunks/ca9decc19fd0331a.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/d1aa35e8d9888fa4.js","/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/f85083fd17530154.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/2c27be032d53887b.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","/litellm-asset-prefix/_next/static/chunks/422057b6f974d749.js","/litellm-asset-prefix/_next/static/chunks/b47b846925c67711.js"],"default"] +8:I[86408,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/3f7acc7b23e100ab.js","/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","/litellm-asset-prefix/_next/static/chunks/57c31f51bf493dcc.js","/litellm-asset-prefix/_next/static/chunks/ca9decc19fd0331a.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/d1aa35e8d9888fa4.js","/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/f85083fd17530154.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/2c27be032d53887b.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","/litellm-asset-prefix/_next/static/chunks/422057b6f974d749.js","/litellm-asset-prefix/_next/static/chunks/b47b846925c67711.js"],"default"] 10:I[168027,[],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","model_hub_table",""],"q":"","i":false,"f":[[["",{"children":["model_hub_table",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/3f7acc7b23e100ab.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/57c31f51bf493dcc.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/ca9decc19fd0331a.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/d1aa35e8d9888fa4.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/f85083fd17530154.js","async":true,"nonce":"$undefined"}],["$","script","script-12",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true,"nonce":"$undefined"}],["$","script","script-13",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-14",{"src":"/litellm-asset-prefix/_next/static/chunks/2c27be032d53887b.js","async":true,"nonce":"$undefined"}],"$Lb","$Lc","$Ld"],"$Le"]}],{},null,false,false]},null,false,false]},null,false,false],"$Lf",false]],"m":"$undefined","G":["$10",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","model_hub_table",""],"q":"","i":false,"f":[[["",{"children":["model_hub_table",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/3f7acc7b23e100ab.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/57c31f51bf493dcc.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/ca9decc19fd0331a.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/d1aa35e8d9888fa4.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/f85083fd17530154.js","async":true,"nonce":"$undefined"}],["$","script","script-12",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true,"nonce":"$undefined"}],["$","script","script-13",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-14",{"src":"/litellm-asset-prefix/_next/static/chunks/2c27be032d53887b.js","async":true,"nonce":"$undefined"}],"$Lb","$Lc","$Ld"],"$Le"]}],{},null,false,false]},null,false,false]},null,false,false],"$Lf",false]],"m":"$undefined","G":["$10",[]],"S":true} 11:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 12:"$Sreact.suspense" 14:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"] diff --git a/litellm/proxy/_experimental/out/model_hub_table/__next._head.txt b/litellm/proxy/_experimental/out/model_hub_table/__next._head.txt index 870c89c7e114..5e208181bb38 100644 --- a/litellm/proxy/_experimental/out/model_hub_table/__next._head.txt +++ b/litellm/proxy/_experimental/out/model_hub_table/__next._head.txt @@ -3,4 +3,4 @@ 3:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"IconMark"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/model_hub_table/__next._index.txt b/litellm/proxy/_experimental/out/model_hub_table/__next._index.txt index 67c452e8c219..d3b4e1ec8d8c 100644 --- a/litellm/proxy/_experimental/out/model_hub_table/__next._index.txt +++ b/litellm/proxy/_experimental/out/model_hub_table/__next._index.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/model_hub_table/__next._tree.txt b/litellm/proxy/_experimental/out/model_hub_table/__next._tree.txt index 4510b131095e..bd4d0193bfd2 100644 --- a/litellm/proxy/_experimental/out/model_hub_table/__next._tree.txt +++ b/litellm/proxy/_experimental/out/model_hub_table/__next._tree.txt @@ -1,4 +1,4 @@ :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"model_hub_table","paramType":null,"paramKey":"model_hub_table","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"model_hub_table","paramType":null,"paramKey":"model_hub_table","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} diff --git a/litellm/proxy/_experimental/out/model_hub_table/__next.model_hub_table.__PAGE__.txt b/litellm/proxy/_experimental/out/model_hub_table/__next.model_hub_table.__PAGE__.txt index 2e2de45ff4d7..7c8f501903a0 100644 --- a/litellm/proxy/_experimental/out/model_hub_table/__next.model_hub_table.__PAGE__.txt +++ b/litellm/proxy/_experimental/out/model_hub_table/__next.model_hub_table.__PAGE__.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" 2:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -3:I[86408,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/3f7acc7b23e100ab.js","/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","/litellm-asset-prefix/_next/static/chunks/57c31f51bf493dcc.js","/litellm-asset-prefix/_next/static/chunks/ca9decc19fd0331a.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/d1aa35e8d9888fa4.js","/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/f85083fd17530154.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/2c27be032d53887b.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","/litellm-asset-prefix/_next/static/chunks/422057b6f974d749.js","/litellm-asset-prefix/_next/static/chunks/b47b846925c67711.js"],"default"] +3:I[86408,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/3f7acc7b23e100ab.js","/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","/litellm-asset-prefix/_next/static/chunks/57c31f51bf493dcc.js","/litellm-asset-prefix/_next/static/chunks/ca9decc19fd0331a.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/d1aa35e8d9888fa4.js","/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/f85083fd17530154.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/2c27be032d53887b.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","/litellm-asset-prefix/_next/static/chunks/422057b6f974d749.js","/litellm-asset-prefix/_next/static/chunks/b47b846925c67711.js"],"default"] 6:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 7:"$Sreact.suspense" -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/3f7acc7b23e100ab.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/57c31f51bf493dcc.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/ca9decc19fd0331a.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","async":true}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/d1aa35e8d9888fa4.js","async":true}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","async":true}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","async":true}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/f85083fd17530154.js","async":true}],["$","script","script-12",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true}],["$","script","script-13",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true}],["$","script","script-14",{"src":"/litellm-asset-prefix/_next/static/chunks/2c27be032d53887b.js","async":true}],["$","script","script-15",{"src":"/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","async":true}],["$","script","script-16",{"src":"/litellm-asset-prefix/_next/static/chunks/422057b6f974d749.js","async":true}],["$","script","script-17",{"src":"/litellm-asset-prefix/_next/static/chunks/b47b846925c67711.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/3f7acc7b23e100ab.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/57c31f51bf493dcc.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/ca9decc19fd0331a.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","async":true}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/d1aa35e8d9888fa4.js","async":true}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","async":true}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","async":true}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/f85083fd17530154.js","async":true}],["$","script","script-12",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true}],["$","script","script-13",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true}],["$","script","script-14",{"src":"/litellm-asset-prefix/_next/static/chunks/2c27be032d53887b.js","async":true}],["$","script","script-15",{"src":"/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","async":true}],["$","script","script-16",{"src":"/litellm-asset-prefix/_next/static/chunks/422057b6f974d749.js","async":true}],["$","script","script-17",{"src":"/litellm-asset-prefix/_next/static/chunks/b47b846925c67711.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} 4:{} 5:"$0:rsc:props:children:0:props:serverProvidedParams:params" 8:null diff --git a/litellm/proxy/_experimental/out/model_hub_table/__next.model_hub_table.txt b/litellm/proxy/_experimental/out/model_hub_table/__next.model_hub_table.txt index 8675b565665e..36d9cb90d1c8 100644 --- a/litellm/proxy/_experimental/out/model_hub_table/__next.model_hub_table.txt +++ b/litellm/proxy/_experimental/out/model_hub_table/__next.model_hub_table.txt @@ -1,4 +1,4 @@ 1:"$Sreact.fragment" 2:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 3:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/model_hub_table/index.html b/litellm/proxy/_experimental/out/model_hub_table/index.html index 6d033a8a08f4..a2d27105de1d 100644 --- a/litellm/proxy/_experimental/out/model_hub_table/index.html +++ b/litellm/proxy/_experimental/out/model_hub_table/index.html @@ -1 +1 @@ -LiteLLM Dashboard
Loading...
\ No newline at end of file +LiteLLM Dashboard
Loading...
\ No newline at end of file diff --git a/litellm/proxy/_experimental/out/model_hub_table/index.txt b/litellm/proxy/_experimental/out/model_hub_table/index.txt index 65b5806dfe81..761d3ec52d93 100644 --- a/litellm/proxy/_experimental/out/model_hub_table/index.txt +++ b/litellm/proxy/_experimental/out/model_hub_table/index.txt @@ -1,16 +1,16 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -8:I[86408,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/3f7acc7b23e100ab.js","/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","/litellm-asset-prefix/_next/static/chunks/57c31f51bf493dcc.js","/litellm-asset-prefix/_next/static/chunks/ca9decc19fd0331a.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/d1aa35e8d9888fa4.js","/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/f85083fd17530154.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/2c27be032d53887b.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","/litellm-asset-prefix/_next/static/chunks/422057b6f974d749.js","/litellm-asset-prefix/_next/static/chunks/b47b846925c67711.js"],"default"] +8:I[86408,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/3f7acc7b23e100ab.js","/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","/litellm-asset-prefix/_next/static/chunks/57c31f51bf493dcc.js","/litellm-asset-prefix/_next/static/chunks/ca9decc19fd0331a.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/d1aa35e8d9888fa4.js","/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/f85083fd17530154.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/2c27be032d53887b.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","/litellm-asset-prefix/_next/static/chunks/422057b6f974d749.js","/litellm-asset-prefix/_next/static/chunks/b47b846925c67711.js"],"default"] 10:I[168027,[],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","model_hub_table",""],"q":"","i":false,"f":[[["",{"children":["model_hub_table",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/3f7acc7b23e100ab.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/57c31f51bf493dcc.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/ca9decc19fd0331a.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/d1aa35e8d9888fa4.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/f85083fd17530154.js","async":true,"nonce":"$undefined"}],["$","script","script-12",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true,"nonce":"$undefined"}],["$","script","script-13",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-14",{"src":"/litellm-asset-prefix/_next/static/chunks/2c27be032d53887b.js","async":true,"nonce":"$undefined"}],"$Lb","$Lc","$Ld"],"$Le"]}],{},null,false,false]},null,false,false]},null,false,false],"$Lf",false]],"m":"$undefined","G":["$10",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","model_hub_table",""],"q":"","i":false,"f":[[["",{"children":["model_hub_table",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/3f7acc7b23e100ab.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/e2257d8308d35cf4.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/57c31f51bf493dcc.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/ca9decc19fd0331a.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/d1aa35e8d9888fa4.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/eb687266a02bebc1.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/f85083fd17530154.js","async":true,"nonce":"$undefined"}],["$","script","script-12",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true,"nonce":"$undefined"}],["$","script","script-13",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-14",{"src":"/litellm-asset-prefix/_next/static/chunks/2c27be032d53887b.js","async":true,"nonce":"$undefined"}],"$Lb","$Lc","$Ld"],"$Le"]}],{},null,false,false]},null,false,false]},null,false,false],"$Lf",false]],"m":"$undefined","G":["$10",[]],"S":true} 11:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 12:"$Sreact.suspense" 14:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"] diff --git a/litellm/proxy/_experimental/out/models-and-endpoints/__next.!KGRhc2hib2FyZCk.models-and-endpoints.__PAGE__.txt b/litellm/proxy/_experimental/out/models-and-endpoints/__next.!KGRhc2hib2FyZCk.models-and-endpoints.__PAGE__.txt index eede3a4a8e70..8baea2b4107c 100644 --- a/litellm/proxy/_experimental/out/models-and-endpoints/__next.!KGRhc2hib2FyZCk.models-and-endpoints.__PAGE__.txt +++ b/litellm/proxy/_experimental/out/models-and-endpoints/__next.!KGRhc2hib2FyZCk.models-and-endpoints.__PAGE__.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" 2:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -3:I[664307,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/04711b0f8ffa7bbd.js","/litellm-asset-prefix/_next/static/chunks/6a9f0c852bce9817.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/193886179a5779b5.js","/litellm-asset-prefix/_next/static/chunks/76b36d8bf27be7b6.js","/litellm-asset-prefix/_next/static/chunks/75ee9aba04c74e23.js","/litellm-asset-prefix/_next/static/chunks/10757c2146f43db4.js","/litellm-asset-prefix/_next/static/chunks/05e9ff30be0ddaae.js","/litellm-asset-prefix/_next/static/chunks/274ab32e0ed6ef59.js"],"default"] +3:I[664307,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/04711b0f8ffa7bbd.js","/litellm-asset-prefix/_next/static/chunks/6a9f0c852bce9817.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/193886179a5779b5.js","/litellm-asset-prefix/_next/static/chunks/76b36d8bf27be7b6.js","/litellm-asset-prefix/_next/static/chunks/75ee9aba04c74e23.js","/litellm-asset-prefix/_next/static/chunks/10757c2146f43db4.js","/litellm-asset-prefix/_next/static/chunks/05e9ff30be0ddaae.js","/litellm-asset-prefix/_next/static/chunks/274ab32e0ed6ef59.js"],"default"] 6:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 7:"$Sreact.suspense" -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/04711b0f8ffa7bbd.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/6a9f0c852bce9817.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/193886179a5779b5.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/76b36d8bf27be7b6.js","async":true}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/75ee9aba04c74e23.js","async":true}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/10757c2146f43db4.js","async":true}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/05e9ff30be0ddaae.js","async":true}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/274ab32e0ed6ef59.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/04711b0f8ffa7bbd.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/6a9f0c852bce9817.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/193886179a5779b5.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/76b36d8bf27be7b6.js","async":true}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/75ee9aba04c74e23.js","async":true}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/10757c2146f43db4.js","async":true}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/05e9ff30be0ddaae.js","async":true}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/274ab32e0ed6ef59.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} 4:{} 5:{} 8:null diff --git a/litellm/proxy/_experimental/out/models-and-endpoints/__next.!KGRhc2hib2FyZCk.models-and-endpoints.txt b/litellm/proxy/_experimental/out/models-and-endpoints/__next.!KGRhc2hib2FyZCk.models-and-endpoints.txt index 8675b565665e..36d9cb90d1c8 100644 --- a/litellm/proxy/_experimental/out/models-and-endpoints/__next.!KGRhc2hib2FyZCk.models-and-endpoints.txt +++ b/litellm/proxy/_experimental/out/models-and-endpoints/__next.!KGRhc2hib2FyZCk.models-and-endpoints.txt @@ -1,4 +1,4 @@ 1:"$Sreact.fragment" 2:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 3:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/models-and-endpoints/__next.!KGRhc2hib2FyZCk.txt b/litellm/proxy/_experimental/out/models-and-endpoints/__next.!KGRhc2hib2FyZCk.txt index 364759b4338b..8b6933f2bce4 100644 --- a/litellm/proxy/_experimental/out/models-and-endpoints/__next.!KGRhc2hib2FyZCk.txt +++ b/litellm/proxy/_experimental/out/models-and-endpoints/__next.!KGRhc2hib2FyZCk.txt @@ -1,7 +1,7 @@ 1:"$Sreact.fragment" 2:I[92825,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientSegmentRoot"] -3:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] +3:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] 4:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 5:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true}]],["$","$L2",null,{"Component":"$3","slots":{"children":["$","$L4",null,{"parallelRouterKey":"children","template":["$","$L5",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]},"serverProvidedParams":{"params":{},"promises":["$@6"]}}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true}]],["$","$L2",null,{"Component":"$3","slots":{"children":["$","$L4",null,{"parallelRouterKey":"children","template":["$","$L5",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]},"serverProvidedParams":{"params":{},"promises":["$@6"]}}]]}],"loading":null,"isPartial":false} 6:"$0:rsc:props:children:1:props:serverProvidedParams:params" diff --git a/litellm/proxy/_experimental/out/models-and-endpoints/__next._full.txt b/litellm/proxy/_experimental/out/models-and-endpoints/__next._full.txt index 1f05c3ceaaa7..57a293df6911 100644 --- a/litellm/proxy/_experimental/out/models-and-endpoints/__next._full.txt +++ b/litellm/proxy/_experimental/out/models-and-endpoints/__next._full.txt @@ -1,18 +1,18 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[92825,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientSegmentRoot"] -8:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] +8:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] c:I[168027,[],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","models-and-endpoints",""],"q":"","i":false,"f":[[["",{"children":["(dashboard)",{"children":["models-and-endpoints",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true,"nonce":"$undefined"}]],["$","$L7",null,{"Component":"$8","slots":{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]},"serverProvidedParams":{"params":{},"promises":["$@9"]}}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":["$La",{},null,false,false]},null,false,false]},null,false,false]},null,false,false],"$Lb",false]],"m":"$undefined","G":["$c",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","models-and-endpoints",""],"q":"","i":false,"f":[[["",{"children":["(dashboard)",{"children":["models-and-endpoints",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true,"nonce":"$undefined"}]],["$","$L7",null,{"Component":"$8","slots":{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]},"serverProvidedParams":{"params":{},"promises":["$@9"]}}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":["$La",{},null,false,false]},null,false,false]},null,false,false]},null,false,false],"$Lb",false]],"m":"$undefined","G":["$c",[]],"S":true} d:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -e:I[664307,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/04711b0f8ffa7bbd.js","/litellm-asset-prefix/_next/static/chunks/6a9f0c852bce9817.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/193886179a5779b5.js","/litellm-asset-prefix/_next/static/chunks/76b36d8bf27be7b6.js","/litellm-asset-prefix/_next/static/chunks/75ee9aba04c74e23.js","/litellm-asset-prefix/_next/static/chunks/10757c2146f43db4.js","/litellm-asset-prefix/_next/static/chunks/05e9ff30be0ddaae.js","/litellm-asset-prefix/_next/static/chunks/274ab32e0ed6ef59.js"],"default"] +e:I[664307,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/04711b0f8ffa7bbd.js","/litellm-asset-prefix/_next/static/chunks/6a9f0c852bce9817.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/193886179a5779b5.js","/litellm-asset-prefix/_next/static/chunks/76b36d8bf27be7b6.js","/litellm-asset-prefix/_next/static/chunks/75ee9aba04c74e23.js","/litellm-asset-prefix/_next/static/chunks/10757c2146f43db4.js","/litellm-asset-prefix/_next/static/chunks/05e9ff30be0ddaae.js","/litellm-asset-prefix/_next/static/chunks/274ab32e0ed6ef59.js"],"default"] 11:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 12:"$Sreact.suspense" 14:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"] diff --git a/litellm/proxy/_experimental/out/models-and-endpoints/__next._head.txt b/litellm/proxy/_experimental/out/models-and-endpoints/__next._head.txt index 870c89c7e114..5e208181bb38 100644 --- a/litellm/proxy/_experimental/out/models-and-endpoints/__next._head.txt +++ b/litellm/proxy/_experimental/out/models-and-endpoints/__next._head.txt @@ -3,4 +3,4 @@ 3:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"IconMark"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/models-and-endpoints/__next._index.txt b/litellm/proxy/_experimental/out/models-and-endpoints/__next._index.txt index 67c452e8c219..d3b4e1ec8d8c 100644 --- a/litellm/proxy/_experimental/out/models-and-endpoints/__next._index.txt +++ b/litellm/proxy/_experimental/out/models-and-endpoints/__next._index.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/models-and-endpoints/__next._tree.txt b/litellm/proxy/_experimental/out/models-and-endpoints/__next._tree.txt index 061c8c465312..b2637491df7e 100644 --- a/litellm/proxy/_experimental/out/models-and-endpoints/__next._tree.txt +++ b/litellm/proxy/_experimental/out/models-and-endpoints/__next._tree.txt @@ -1,4 +1,4 @@ :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"(dashboard)","paramType":null,"paramKey":"(dashboard)","hasRuntimePrefetch":false,"slots":{"children":{"name":"models-and-endpoints","paramType":null,"paramKey":"models-and-endpoints","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"(dashboard)","paramType":null,"paramKey":"(dashboard)","hasRuntimePrefetch":false,"slots":{"children":{"name":"models-and-endpoints","paramType":null,"paramKey":"models-and-endpoints","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} diff --git a/litellm/proxy/_experimental/out/models-and-endpoints/index.html b/litellm/proxy/_experimental/out/models-and-endpoints/index.html index 936f30c1bb0a..068980160ea0 100644 --- a/litellm/proxy/_experimental/out/models-and-endpoints/index.html +++ b/litellm/proxy/_experimental/out/models-and-endpoints/index.html @@ -1 +1 @@ -LiteLLM Dashboard
Loading...
\ No newline at end of file +LiteLLM Dashboard
Loading...
\ No newline at end of file diff --git a/litellm/proxy/_experimental/out/models-and-endpoints/index.txt b/litellm/proxy/_experimental/out/models-and-endpoints/index.txt index 1f05c3ceaaa7..57a293df6911 100644 --- a/litellm/proxy/_experimental/out/models-and-endpoints/index.txt +++ b/litellm/proxy/_experimental/out/models-and-endpoints/index.txt @@ -1,18 +1,18 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[92825,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientSegmentRoot"] -8:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] +8:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] c:I[168027,[],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","models-and-endpoints",""],"q":"","i":false,"f":[[["",{"children":["(dashboard)",{"children":["models-and-endpoints",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true,"nonce":"$undefined"}]],["$","$L7",null,{"Component":"$8","slots":{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]},"serverProvidedParams":{"params":{},"promises":["$@9"]}}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":["$La",{},null,false,false]},null,false,false]},null,false,false]},null,false,false],"$Lb",false]],"m":"$undefined","G":["$c",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","models-and-endpoints",""],"q":"","i":false,"f":[[["",{"children":["(dashboard)",{"children":["models-and-endpoints",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true,"nonce":"$undefined"}]],["$","$L7",null,{"Component":"$8","slots":{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]},"serverProvidedParams":{"params":{},"promises":["$@9"]}}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":["$La",{},null,false,false]},null,false,false]},null,false,false]},null,false,false],"$Lb",false]],"m":"$undefined","G":["$c",[]],"S":true} d:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -e:I[664307,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/04711b0f8ffa7bbd.js","/litellm-asset-prefix/_next/static/chunks/6a9f0c852bce9817.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/193886179a5779b5.js","/litellm-asset-prefix/_next/static/chunks/76b36d8bf27be7b6.js","/litellm-asset-prefix/_next/static/chunks/75ee9aba04c74e23.js","/litellm-asset-prefix/_next/static/chunks/10757c2146f43db4.js","/litellm-asset-prefix/_next/static/chunks/05e9ff30be0ddaae.js","/litellm-asset-prefix/_next/static/chunks/274ab32e0ed6ef59.js"],"default"] +e:I[664307,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/04711b0f8ffa7bbd.js","/litellm-asset-prefix/_next/static/chunks/6a9f0c852bce9817.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/4ac3235460262f36.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/193886179a5779b5.js","/litellm-asset-prefix/_next/static/chunks/76b36d8bf27be7b6.js","/litellm-asset-prefix/_next/static/chunks/75ee9aba04c74e23.js","/litellm-asset-prefix/_next/static/chunks/10757c2146f43db4.js","/litellm-asset-prefix/_next/static/chunks/05e9ff30be0ddaae.js","/litellm-asset-prefix/_next/static/chunks/274ab32e0ed6ef59.js"],"default"] 11:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 12:"$Sreact.suspense" 14:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"] diff --git a/litellm/proxy/_experimental/out/onboarding/__next._full.txt b/litellm/proxy/_experimental/out/onboarding/__next._full.txt index 247fa4e65afc..e267dcab6cb6 100644 --- a/litellm/proxy/_experimental/out/onboarding/__next._full.txt +++ b/litellm/proxy/_experimental/out/onboarding/__next._full.txt @@ -1,11 +1,11 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -8:I[566606,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/9e8f9cc5fd406040.js","/litellm-asset-prefix/_next/static/chunks/881da92c0aeda03f.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js"],"default"] +8:I[566606,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/9e8f9cc5fd406040.js","/litellm-asset-prefix/_next/static/chunks/881da92c0aeda03f.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js"],"default"] b:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] c:"$Sreact.suspense" e:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"] @@ -14,7 +14,7 @@ e:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/li :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","onboarding",""],"q":"","i":false,"f":[[["",{"children":["onboarding",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/9e8f9cc5fd406040.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/881da92c0aeda03f.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}]],["$","$Lb",null,{"children":["$","$c",null,{"name":"Next.MetadataOutlet","children":"$@d"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Le",null,{"children":"$Lf"}],["$","div",null,{"hidden":true,"children":["$","$L10",null,{"children":["$","$c",null,{"name":"Next.Metadata","children":"$L11"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$12",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","onboarding",""],"q":"","i":false,"f":[[["",{"children":["onboarding",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/9e8f9cc5fd406040.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/881da92c0aeda03f.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}]],["$","$Lb",null,{"children":["$","$c",null,{"name":"Next.MetadataOutlet","children":"$@d"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Le",null,{"children":"$Lf"}],["$","div",null,{"hidden":true,"children":["$","$L10",null,{"children":["$","$c",null,{"name":"Next.Metadata","children":"$L11"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$12",[]],"S":true} 9:{} a:"$0:f:0:1:1:children:1:children:0:props:children:0:props:serverProvidedParams:params" f:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] diff --git a/litellm/proxy/_experimental/out/onboarding/__next._head.txt b/litellm/proxy/_experimental/out/onboarding/__next._head.txt index 870c89c7e114..5e208181bb38 100644 --- a/litellm/proxy/_experimental/out/onboarding/__next._head.txt +++ b/litellm/proxy/_experimental/out/onboarding/__next._head.txt @@ -3,4 +3,4 @@ 3:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"IconMark"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/onboarding/__next._index.txt b/litellm/proxy/_experimental/out/onboarding/__next._index.txt index 67c452e8c219..d3b4e1ec8d8c 100644 --- a/litellm/proxy/_experimental/out/onboarding/__next._index.txt +++ b/litellm/proxy/_experimental/out/onboarding/__next._index.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/onboarding/__next._tree.txt b/litellm/proxy/_experimental/out/onboarding/__next._tree.txt index c755da337b91..240e24389820 100644 --- a/litellm/proxy/_experimental/out/onboarding/__next._tree.txt +++ b/litellm/proxy/_experimental/out/onboarding/__next._tree.txt @@ -1,4 +1,4 @@ :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"onboarding","paramType":null,"paramKey":"onboarding","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"onboarding","paramType":null,"paramKey":"onboarding","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} diff --git a/litellm/proxy/_experimental/out/onboarding/__next.onboarding.__PAGE__.txt b/litellm/proxy/_experimental/out/onboarding/__next.onboarding.__PAGE__.txt index fecb01ceed4a..67232f5ce3dc 100644 --- a/litellm/proxy/_experimental/out/onboarding/__next.onboarding.__PAGE__.txt +++ b/litellm/proxy/_experimental/out/onboarding/__next.onboarding.__PAGE__.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" 2:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -3:I[566606,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/9e8f9cc5fd406040.js","/litellm-asset-prefix/_next/static/chunks/881da92c0aeda03f.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js"],"default"] +3:I[566606,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/9e8f9cc5fd406040.js","/litellm-asset-prefix/_next/static/chunks/881da92c0aeda03f.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js"],"default"] 6:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 7:"$Sreact.suspense" -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/9e8f9cc5fd406040.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/881da92c0aeda03f.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/9e8f9cc5fd406040.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/881da92c0aeda03f.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} 4:{} 5:"$0:rsc:props:children:0:props:serverProvidedParams:params" 8:null diff --git a/litellm/proxy/_experimental/out/onboarding/__next.onboarding.txt b/litellm/proxy/_experimental/out/onboarding/__next.onboarding.txt index 8675b565665e..36d9cb90d1c8 100644 --- a/litellm/proxy/_experimental/out/onboarding/__next.onboarding.txt +++ b/litellm/proxy/_experimental/out/onboarding/__next.onboarding.txt @@ -1,4 +1,4 @@ 1:"$Sreact.fragment" 2:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 3:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/onboarding/index.html b/litellm/proxy/_experimental/out/onboarding/index.html index 1f6bbeb16d17..c9410fdd5b3b 100644 --- a/litellm/proxy/_experimental/out/onboarding/index.html +++ b/litellm/proxy/_experimental/out/onboarding/index.html @@ -1 +1 @@ -LiteLLM Dashboard
Loading...
\ No newline at end of file +LiteLLM Dashboard
Loading...
\ No newline at end of file diff --git a/litellm/proxy/_experimental/out/onboarding/index.txt b/litellm/proxy/_experimental/out/onboarding/index.txt index 247fa4e65afc..e267dcab6cb6 100644 --- a/litellm/proxy/_experimental/out/onboarding/index.txt +++ b/litellm/proxy/_experimental/out/onboarding/index.txt @@ -1,11 +1,11 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -8:I[566606,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/9e8f9cc5fd406040.js","/litellm-asset-prefix/_next/static/chunks/881da92c0aeda03f.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js"],"default"] +8:I[566606,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/9e8f9cc5fd406040.js","/litellm-asset-prefix/_next/static/chunks/881da92c0aeda03f.js","/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js"],"default"] b:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] c:"$Sreact.suspense" e:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"] @@ -14,7 +14,7 @@ e:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/li :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","onboarding",""],"q":"","i":false,"f":[[["",{"children":["onboarding",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/9e8f9cc5fd406040.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/881da92c0aeda03f.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}]],["$","$Lb",null,{"children":["$","$c",null,{"name":"Next.MetadataOutlet","children":"$@d"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Le",null,{"children":"$Lf"}],["$","div",null,{"hidden":true,"children":["$","$L10",null,{"children":["$","$c",null,{"name":"Next.Metadata","children":"$L11"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$12",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","onboarding",""],"q":"","i":false,"f":[[["",{"children":["onboarding",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@9","$@a"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/9e8f9cc5fd406040.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/881da92c0aeda03f.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/570b2e10aa856e54.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}]],["$","$Lb",null,{"children":["$","$c",null,{"name":"Next.MetadataOutlet","children":"$@d"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Le",null,{"children":"$Lf"}],["$","div",null,{"hidden":true,"children":["$","$L10",null,{"children":["$","$c",null,{"name":"Next.Metadata","children":"$L11"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$12",[]],"S":true} 9:{} a:"$0:f:0:1:1:children:1:children:0:props:children:0:props:serverProvidedParams:params" f:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] diff --git a/litellm/proxy/_experimental/out/organizations/__next.!KGRhc2hib2FyZCk.organizations.__PAGE__.txt b/litellm/proxy/_experimental/out/organizations/__next.!KGRhc2hib2FyZCk.organizations.__PAGE__.txt index 53559a081559..7ccda20d8fd6 100644 --- a/litellm/proxy/_experimental/out/organizations/__next.!KGRhc2hib2FyZCk.organizations.__PAGE__.txt +++ b/litellm/proxy/_experimental/out/organizations/__next.!KGRhc2hib2FyZCk.organizations.__PAGE__.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" 2:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -3:I[526612,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/42662d8d6531cdbe.js","/litellm-asset-prefix/_next/static/chunks/978a3219a22261f4.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/e3bc6be94771265a.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/ce25ece877f8d603.js","/litellm-asset-prefix/_next/static/chunks/cd07baa6a7669b93.js","/litellm-asset-prefix/_next/static/chunks/259f1b38a33edf27.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js"],"default"] +3:I[526612,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/42662d8d6531cdbe.js","/litellm-asset-prefix/_next/static/chunks/978a3219a22261f4.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/e3bc6be94771265a.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/ce25ece877f8d603.js","/litellm-asset-prefix/_next/static/chunks/cd07baa6a7669b93.js","/litellm-asset-prefix/_next/static/chunks/259f1b38a33edf27.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js"],"default"] 6:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 7:"$Sreact.suspense" -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/42662d8d6531cdbe.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/978a3219a22261f4.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/e3bc6be94771265a.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/ce25ece877f8d603.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/cd07baa6a7669b93.js","async":true}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/259f1b38a33edf27.js","async":true}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/42662d8d6531cdbe.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/978a3219a22261f4.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/e3bc6be94771265a.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/ce25ece877f8d603.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/cd07baa6a7669b93.js","async":true}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/259f1b38a33edf27.js","async":true}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} 4:{} 5:{} 8:null diff --git a/litellm/proxy/_experimental/out/organizations/__next.!KGRhc2hib2FyZCk.organizations.txt b/litellm/proxy/_experimental/out/organizations/__next.!KGRhc2hib2FyZCk.organizations.txt index 8675b565665e..36d9cb90d1c8 100644 --- a/litellm/proxy/_experimental/out/organizations/__next.!KGRhc2hib2FyZCk.organizations.txt +++ b/litellm/proxy/_experimental/out/organizations/__next.!KGRhc2hib2FyZCk.organizations.txt @@ -1,4 +1,4 @@ 1:"$Sreact.fragment" 2:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 3:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/organizations/__next.!KGRhc2hib2FyZCk.txt b/litellm/proxy/_experimental/out/organizations/__next.!KGRhc2hib2FyZCk.txt index 364759b4338b..8b6933f2bce4 100644 --- a/litellm/proxy/_experimental/out/organizations/__next.!KGRhc2hib2FyZCk.txt +++ b/litellm/proxy/_experimental/out/organizations/__next.!KGRhc2hib2FyZCk.txt @@ -1,7 +1,7 @@ 1:"$Sreact.fragment" 2:I[92825,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientSegmentRoot"] -3:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] +3:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] 4:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 5:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true}]],["$","$L2",null,{"Component":"$3","slots":{"children":["$","$L4",null,{"parallelRouterKey":"children","template":["$","$L5",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]},"serverProvidedParams":{"params":{},"promises":["$@6"]}}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true}]],["$","$L2",null,{"Component":"$3","slots":{"children":["$","$L4",null,{"parallelRouterKey":"children","template":["$","$L5",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]},"serverProvidedParams":{"params":{},"promises":["$@6"]}}]]}],"loading":null,"isPartial":false} 6:"$0:rsc:props:children:1:props:serverProvidedParams:params" diff --git a/litellm/proxy/_experimental/out/organizations/__next._full.txt b/litellm/proxy/_experimental/out/organizations/__next._full.txt index 7ff7e7d84853..1c9efac98f88 100644 --- a/litellm/proxy/_experimental/out/organizations/__next._full.txt +++ b/litellm/proxy/_experimental/out/organizations/__next._full.txt @@ -1,18 +1,18 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[92825,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientSegmentRoot"] -8:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] +8:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] 17:I[168027,[],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","organizations",""],"q":"","i":false,"f":[[["",{"children":["(dashboard)",{"children":["organizations",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true,"nonce":"$undefined"}]],["$","$L7",null,{"Component":"$8","slots":{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]},"serverProvidedParams":{"params":{},"promises":["$@9"]}}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":["$La",["$Lb","$Lc","$Ld","$Le","$Lf","$L10","$L11","$L12","$L13","$L14"],"$L15"]}],{},null,false,false]},null,false,false]},null,false,false]},null,false,false],"$L16",false]],"m":"$undefined","G":["$17",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","organizations",""],"q":"","i":false,"f":[[["",{"children":["(dashboard)",{"children":["organizations",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true,"nonce":"$undefined"}]],["$","$L7",null,{"Component":"$8","slots":{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]},"serverProvidedParams":{"params":{},"promises":["$@9"]}}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":["$La",["$Lb","$Lc","$Ld","$Le","$Lf","$L10","$L11","$L12","$L13","$L14"],"$L15"]}],{},null,false,false]},null,false,false]},null,false,false]},null,false,false],"$L16",false]],"m":"$undefined","G":["$17",[]],"S":true} 18:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -19:I[526612,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/42662d8d6531cdbe.js","/litellm-asset-prefix/_next/static/chunks/978a3219a22261f4.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/e3bc6be94771265a.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/ce25ece877f8d603.js","/litellm-asset-prefix/_next/static/chunks/cd07baa6a7669b93.js","/litellm-asset-prefix/_next/static/chunks/259f1b38a33edf27.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js"],"default"] +19:I[526612,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/42662d8d6531cdbe.js","/litellm-asset-prefix/_next/static/chunks/978a3219a22261f4.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/e3bc6be94771265a.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/ce25ece877f8d603.js","/litellm-asset-prefix/_next/static/chunks/cd07baa6a7669b93.js","/litellm-asset-prefix/_next/static/chunks/259f1b38a33edf27.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js"],"default"] 1c:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 1d:"$Sreact.suspense" 1f:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"] diff --git a/litellm/proxy/_experimental/out/organizations/__next._head.txt b/litellm/proxy/_experimental/out/organizations/__next._head.txt index 870c89c7e114..5e208181bb38 100644 --- a/litellm/proxy/_experimental/out/organizations/__next._head.txt +++ b/litellm/proxy/_experimental/out/organizations/__next._head.txt @@ -3,4 +3,4 @@ 3:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"IconMark"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/organizations/__next._index.txt b/litellm/proxy/_experimental/out/organizations/__next._index.txt index 67c452e8c219..d3b4e1ec8d8c 100644 --- a/litellm/proxy/_experimental/out/organizations/__next._index.txt +++ b/litellm/proxy/_experimental/out/organizations/__next._index.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/organizations/__next._tree.txt b/litellm/proxy/_experimental/out/organizations/__next._tree.txt index 7bbed61ff1f4..1119ede453fc 100644 --- a/litellm/proxy/_experimental/out/organizations/__next._tree.txt +++ b/litellm/proxy/_experimental/out/organizations/__next._tree.txt @@ -1,4 +1,4 @@ :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"(dashboard)","paramType":null,"paramKey":"(dashboard)","hasRuntimePrefetch":false,"slots":{"children":{"name":"organizations","paramType":null,"paramKey":"organizations","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"(dashboard)","paramType":null,"paramKey":"(dashboard)","hasRuntimePrefetch":false,"slots":{"children":{"name":"organizations","paramType":null,"paramKey":"organizations","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} diff --git a/litellm/proxy/_experimental/out/organizations/index.html b/litellm/proxy/_experimental/out/organizations/index.html index 5ab163c1a2da..ae18a13bc647 100644 --- a/litellm/proxy/_experimental/out/organizations/index.html +++ b/litellm/proxy/_experimental/out/organizations/index.html @@ -1 +1 @@ -LiteLLM Dashboard
Loading...
\ No newline at end of file +LiteLLM Dashboard
Loading...
\ No newline at end of file diff --git a/litellm/proxy/_experimental/out/organizations/index.txt b/litellm/proxy/_experimental/out/organizations/index.txt index 7ff7e7d84853..1c9efac98f88 100644 --- a/litellm/proxy/_experimental/out/organizations/index.txt +++ b/litellm/proxy/_experimental/out/organizations/index.txt @@ -1,18 +1,18 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[92825,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientSegmentRoot"] -8:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] +8:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] 17:I[168027,[],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","organizations",""],"q":"","i":false,"f":[[["",{"children":["(dashboard)",{"children":["organizations",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true,"nonce":"$undefined"}]],["$","$L7",null,{"Component":"$8","slots":{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]},"serverProvidedParams":{"params":{},"promises":["$@9"]}}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":["$La",["$Lb","$Lc","$Ld","$Le","$Lf","$L10","$L11","$L12","$L13","$L14"],"$L15"]}],{},null,false,false]},null,false,false]},null,false,false]},null,false,false],"$L16",false]],"m":"$undefined","G":["$17",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","organizations",""],"q":"","i":false,"f":[[["",{"children":["(dashboard)",{"children":["organizations",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true,"nonce":"$undefined"}]],["$","$L7",null,{"Component":"$8","slots":{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]},"serverProvidedParams":{"params":{},"promises":["$@9"]}}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":["$La",["$Lb","$Lc","$Ld","$Le","$Lf","$L10","$L11","$L12","$L13","$L14"],"$L15"]}],{},null,false,false]},null,false,false]},null,false,false]},null,false,false],"$L16",false]],"m":"$undefined","G":["$17",[]],"S":true} 18:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -19:I[526612,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/42662d8d6531cdbe.js","/litellm-asset-prefix/_next/static/chunks/978a3219a22261f4.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/e3bc6be94771265a.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/ce25ece877f8d603.js","/litellm-asset-prefix/_next/static/chunks/cd07baa6a7669b93.js","/litellm-asset-prefix/_next/static/chunks/259f1b38a33edf27.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js"],"default"] +19:I[526612,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/42662d8d6531cdbe.js","/litellm-asset-prefix/_next/static/chunks/978a3219a22261f4.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/51494a4a4b6fc437.js","/litellm-asset-prefix/_next/static/chunks/e3bc6be94771265a.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/ce25ece877f8d603.js","/litellm-asset-prefix/_next/static/chunks/cd07baa6a7669b93.js","/litellm-asset-prefix/_next/static/chunks/259f1b38a33edf27.js","/litellm-asset-prefix/_next/static/chunks/b323e0ef008e6348.js"],"default"] 1c:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 1d:"$Sreact.suspense" 1f:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"] diff --git a/litellm/proxy/_experimental/out/playground/__next.!KGRhc2hib2FyZCk.playground.__PAGE__.txt b/litellm/proxy/_experimental/out/playground/__next.!KGRhc2hib2FyZCk.playground.__PAGE__.txt index 3ee4f0cbe416..e2b8cc3b35db 100644 --- a/litellm/proxy/_experimental/out/playground/__next.!KGRhc2hib2FyZCk.playground.__PAGE__.txt +++ b/litellm/proxy/_experimental/out/playground/__next.!KGRhc2hib2FyZCk.playground.__PAGE__.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" 2:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -3:I[213970,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/57c31f51bf493dcc.js","/litellm-asset-prefix/_next/static/chunks/be0fdd72cd27ab4e.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/8af8e2401247aed2.js","/litellm-asset-prefix/_next/static/chunks/2063ca6435a47940.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/80f4410629229bf9.js","/litellm-asset-prefix/_next/static/chunks/05d4ceb8d45fdc83.js","/litellm-asset-prefix/_next/static/chunks/ef83159ac8b6cc18.js"],"default"] +3:I[213970,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/57c31f51bf493dcc.js","/litellm-asset-prefix/_next/static/chunks/be0fdd72cd27ab4e.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/8af8e2401247aed2.js","/litellm-asset-prefix/_next/static/chunks/2063ca6435a47940.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/80f4410629229bf9.js","/litellm-asset-prefix/_next/static/chunks/05d4ceb8d45fdc83.js","/litellm-asset-prefix/_next/static/chunks/ef83159ac8b6cc18.js"],"default"] 6:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 7:"$Sreact.suspense" -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/57c31f51bf493dcc.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/be0fdd72cd27ab4e.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/8af8e2401247aed2.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/2063ca6435a47940.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/80f4410629229bf9.js","async":true}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/05d4ceb8d45fdc83.js","async":true}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/ef83159ac8b6cc18.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/57c31f51bf493dcc.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/be0fdd72cd27ab4e.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/8af8e2401247aed2.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/2063ca6435a47940.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/80f4410629229bf9.js","async":true}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/05d4ceb8d45fdc83.js","async":true}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/ef83159ac8b6cc18.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} 4:{} 5:{} 8:null diff --git a/litellm/proxy/_experimental/out/playground/__next.!KGRhc2hib2FyZCk.playground.txt b/litellm/proxy/_experimental/out/playground/__next.!KGRhc2hib2FyZCk.playground.txt index 8675b565665e..36d9cb90d1c8 100644 --- a/litellm/proxy/_experimental/out/playground/__next.!KGRhc2hib2FyZCk.playground.txt +++ b/litellm/proxy/_experimental/out/playground/__next.!KGRhc2hib2FyZCk.playground.txt @@ -1,4 +1,4 @@ 1:"$Sreact.fragment" 2:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 3:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/playground/__next.!KGRhc2hib2FyZCk.txt b/litellm/proxy/_experimental/out/playground/__next.!KGRhc2hib2FyZCk.txt index 364759b4338b..8b6933f2bce4 100644 --- a/litellm/proxy/_experimental/out/playground/__next.!KGRhc2hib2FyZCk.txt +++ b/litellm/proxy/_experimental/out/playground/__next.!KGRhc2hib2FyZCk.txt @@ -1,7 +1,7 @@ 1:"$Sreact.fragment" 2:I[92825,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientSegmentRoot"] -3:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] +3:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] 4:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 5:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true}]],["$","$L2",null,{"Component":"$3","slots":{"children":["$","$L4",null,{"parallelRouterKey":"children","template":["$","$L5",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]},"serverProvidedParams":{"params":{},"promises":["$@6"]}}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true}]],["$","$L2",null,{"Component":"$3","slots":{"children":["$","$L4",null,{"parallelRouterKey":"children","template":["$","$L5",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]},"serverProvidedParams":{"params":{},"promises":["$@6"]}}]]}],"loading":null,"isPartial":false} 6:"$0:rsc:props:children:1:props:serverProvidedParams:params" diff --git a/litellm/proxy/_experimental/out/playground/__next._full.txt b/litellm/proxy/_experimental/out/playground/__next._full.txt index a3c3455731bf..9efc1b0d2443 100644 --- a/litellm/proxy/_experimental/out/playground/__next._full.txt +++ b/litellm/proxy/_experimental/out/playground/__next._full.txt @@ -1,18 +1,18 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[92825,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientSegmentRoot"] -8:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] +8:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] 17:I[168027,[],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","playground",""],"q":"","i":false,"f":[[["",{"children":["(dashboard)",{"children":["playground",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true,"nonce":"$undefined"}]],["$","$L7",null,{"Component":"$8","slots":{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]},"serverProvidedParams":{"params":{},"promises":["$@9"]}}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":["$La",["$Lb","$Lc","$Ld","$Le","$Lf","$L10","$L11","$L12","$L13","$L14"],"$L15"]}],{},null,false,false]},null,false,false]},null,false,false]},null,false,false],"$L16",false]],"m":"$undefined","G":["$17",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","playground",""],"q":"","i":false,"f":[[["",{"children":["(dashboard)",{"children":["playground",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true,"nonce":"$undefined"}]],["$","$L7",null,{"Component":"$8","slots":{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]},"serverProvidedParams":{"params":{},"promises":["$@9"]}}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":["$La",["$Lb","$Lc","$Ld","$Le","$Lf","$L10","$L11","$L12","$L13","$L14"],"$L15"]}],{},null,false,false]},null,false,false]},null,false,false]},null,false,false],"$L16",false]],"m":"$undefined","G":["$17",[]],"S":true} 18:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -19:I[213970,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/57c31f51bf493dcc.js","/litellm-asset-prefix/_next/static/chunks/be0fdd72cd27ab4e.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/8af8e2401247aed2.js","/litellm-asset-prefix/_next/static/chunks/2063ca6435a47940.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/80f4410629229bf9.js","/litellm-asset-prefix/_next/static/chunks/05d4ceb8d45fdc83.js","/litellm-asset-prefix/_next/static/chunks/ef83159ac8b6cc18.js"],"default"] +19:I[213970,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/57c31f51bf493dcc.js","/litellm-asset-prefix/_next/static/chunks/be0fdd72cd27ab4e.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/8af8e2401247aed2.js","/litellm-asset-prefix/_next/static/chunks/2063ca6435a47940.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/80f4410629229bf9.js","/litellm-asset-prefix/_next/static/chunks/05d4ceb8d45fdc83.js","/litellm-asset-prefix/_next/static/chunks/ef83159ac8b6cc18.js"],"default"] 1c:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 1d:"$Sreact.suspense" 1f:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"] diff --git a/litellm/proxy/_experimental/out/playground/__next._head.txt b/litellm/proxy/_experimental/out/playground/__next._head.txt index 870c89c7e114..5e208181bb38 100644 --- a/litellm/proxy/_experimental/out/playground/__next._head.txt +++ b/litellm/proxy/_experimental/out/playground/__next._head.txt @@ -3,4 +3,4 @@ 3:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"IconMark"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/playground/__next._index.txt b/litellm/proxy/_experimental/out/playground/__next._index.txt index 67c452e8c219..d3b4e1ec8d8c 100644 --- a/litellm/proxy/_experimental/out/playground/__next._index.txt +++ b/litellm/proxy/_experimental/out/playground/__next._index.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/playground/__next._tree.txt b/litellm/proxy/_experimental/out/playground/__next._tree.txt index cc853e49201a..77010446b1d1 100644 --- a/litellm/proxy/_experimental/out/playground/__next._tree.txt +++ b/litellm/proxy/_experimental/out/playground/__next._tree.txt @@ -1,4 +1,4 @@ :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"(dashboard)","paramType":null,"paramKey":"(dashboard)","hasRuntimePrefetch":false,"slots":{"children":{"name":"playground","paramType":null,"paramKey":"playground","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"(dashboard)","paramType":null,"paramKey":"(dashboard)","hasRuntimePrefetch":false,"slots":{"children":{"name":"playground","paramType":null,"paramKey":"playground","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} diff --git a/litellm/proxy/_experimental/out/playground/index.html b/litellm/proxy/_experimental/out/playground/index.html index 75eace1a962f..eba1294a76f4 100644 --- a/litellm/proxy/_experimental/out/playground/index.html +++ b/litellm/proxy/_experimental/out/playground/index.html @@ -1 +1 @@ -LiteLLM Dashboard
Loading...
\ No newline at end of file +LiteLLM Dashboard
Loading...
\ No newline at end of file diff --git a/litellm/proxy/_experimental/out/playground/index.txt b/litellm/proxy/_experimental/out/playground/index.txt index a3c3455731bf..9efc1b0d2443 100644 --- a/litellm/proxy/_experimental/out/playground/index.txt +++ b/litellm/proxy/_experimental/out/playground/index.txt @@ -1,18 +1,18 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[92825,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientSegmentRoot"] -8:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] +8:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] 17:I[168027,[],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","playground",""],"q":"","i":false,"f":[[["",{"children":["(dashboard)",{"children":["playground",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true,"nonce":"$undefined"}]],["$","$L7",null,{"Component":"$8","slots":{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]},"serverProvidedParams":{"params":{},"promises":["$@9"]}}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":["$La",["$Lb","$Lc","$Ld","$Le","$Lf","$L10","$L11","$L12","$L13","$L14"],"$L15"]}],{},null,false,false]},null,false,false]},null,false,false]},null,false,false],"$L16",false]],"m":"$undefined","G":["$17",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","playground",""],"q":"","i":false,"f":[[["",{"children":["(dashboard)",{"children":["playground",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true,"nonce":"$undefined"}]],["$","$L7",null,{"Component":"$8","slots":{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]},"serverProvidedParams":{"params":{},"promises":["$@9"]}}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":["$La",["$Lb","$Lc","$Ld","$Le","$Lf","$L10","$L11","$L12","$L13","$L14"],"$L15"]}],{},null,false,false]},null,false,false]},null,false,false]},null,false,false],"$L16",false]],"m":"$undefined","G":["$17",[]],"S":true} 18:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -19:I[213970,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/57c31f51bf493dcc.js","/litellm-asset-prefix/_next/static/chunks/be0fdd72cd27ab4e.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/8af8e2401247aed2.js","/litellm-asset-prefix/_next/static/chunks/2063ca6435a47940.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/80f4410629229bf9.js","/litellm-asset-prefix/_next/static/chunks/05d4ceb8d45fdc83.js","/litellm-asset-prefix/_next/static/chunks/ef83159ac8b6cc18.js"],"default"] +19:I[213970,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/57c31f51bf493dcc.js","/litellm-asset-prefix/_next/static/chunks/be0fdd72cd27ab4e.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/8af8e2401247aed2.js","/litellm-asset-prefix/_next/static/chunks/2063ca6435a47940.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/80f4410629229bf9.js","/litellm-asset-prefix/_next/static/chunks/05d4ceb8d45fdc83.js","/litellm-asset-prefix/_next/static/chunks/ef83159ac8b6cc18.js"],"default"] 1c:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 1d:"$Sreact.suspense" 1f:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"] diff --git a/litellm/proxy/_experimental/out/virtual-keys/__next.!KGRhc2hib2FyZCk.txt b/litellm/proxy/_experimental/out/virtual-keys/__next.!KGRhc2hib2FyZCk.txt index 364759b4338b..8b6933f2bce4 100644 --- a/litellm/proxy/_experimental/out/virtual-keys/__next.!KGRhc2hib2FyZCk.txt +++ b/litellm/proxy/_experimental/out/virtual-keys/__next.!KGRhc2hib2FyZCk.txt @@ -1,7 +1,7 @@ 1:"$Sreact.fragment" 2:I[92825,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientSegmentRoot"] -3:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] +3:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] 4:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 5:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true}]],["$","$L2",null,{"Component":"$3","slots":{"children":["$","$L4",null,{"parallelRouterKey":"children","template":["$","$L5",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]},"serverProvidedParams":{"params":{},"promises":["$@6"]}}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true}]],["$","$L2",null,{"Component":"$3","slots":{"children":["$","$L4",null,{"parallelRouterKey":"children","template":["$","$L5",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]},"serverProvidedParams":{"params":{},"promises":["$@6"]}}]]}],"loading":null,"isPartial":false} 6:"$0:rsc:props:children:1:props:serverProvidedParams:params" diff --git a/litellm/proxy/_experimental/out/virtual-keys/__next.!KGRhc2hib2FyZCk.virtual-keys.__PAGE__.txt b/litellm/proxy/_experimental/out/virtual-keys/__next.!KGRhc2hib2FyZCk.virtual-keys.__PAGE__.txt index 098cd4cf7a92..04f4097a7800 100644 --- a/litellm/proxy/_experimental/out/virtual-keys/__next.!KGRhc2hib2FyZCk.virtual-keys.__PAGE__.txt +++ b/litellm/proxy/_experimental/out/virtual-keys/__next.!KGRhc2hib2FyZCk.virtual-keys.__PAGE__.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" 2:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -3:I[995118,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/7a8b5e4509475f1b.js","/litellm-asset-prefix/_next/static/chunks/5924be7dfd4e3180.js","/litellm-asset-prefix/_next/static/chunks/0f4e333632824936.js","/litellm-asset-prefix/_next/static/chunks/8e07d45aac7bbba7.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/b80871109e9f0047.js","/litellm-asset-prefix/_next/static/chunks/c14973c0b8a84588.js","/litellm-asset-prefix/_next/static/chunks/90cb6cf32d80a498.js","/litellm-asset-prefix/_next/static/chunks/1adc8f9684e2031d.js","/litellm-asset-prefix/_next/static/chunks/e26b06a3f997aa29.js"],"default"] +3:I[995118,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/7a8b5e4509475f1b.js","/litellm-asset-prefix/_next/static/chunks/5924be7dfd4e3180.js","/litellm-asset-prefix/_next/static/chunks/0f4e333632824936.js","/litellm-asset-prefix/_next/static/chunks/8e07d45aac7bbba7.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/b80871109e9f0047.js","/litellm-asset-prefix/_next/static/chunks/c14973c0b8a84588.js","/litellm-asset-prefix/_next/static/chunks/90cb6cf32d80a498.js","/litellm-asset-prefix/_next/static/chunks/1adc8f9684e2031d.js","/litellm-asset-prefix/_next/static/chunks/e26b06a3f997aa29.js"],"default"] 6:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 7:"$Sreact.suspense" -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/7a8b5e4509475f1b.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/5924be7dfd4e3180.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/0f4e333632824936.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/8e07d45aac7bbba7.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/b80871109e9f0047.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/c14973c0b8a84588.js","async":true}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/90cb6cf32d80a498.js","async":true}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/1adc8f9684e2031d.js","async":true}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/e26b06a3f997aa29.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/7a8b5e4509475f1b.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/5924be7dfd4e3180.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/0f4e333632824936.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/8e07d45aac7bbba7.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/b80871109e9f0047.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/c14973c0b8a84588.js","async":true}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/90cb6cf32d80a498.js","async":true}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/1adc8f9684e2031d.js","async":true}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/e26b06a3f997aa29.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} 4:{} 5:{} 8:null diff --git a/litellm/proxy/_experimental/out/virtual-keys/__next.!KGRhc2hib2FyZCk.virtual-keys.txt b/litellm/proxy/_experimental/out/virtual-keys/__next.!KGRhc2hib2FyZCk.virtual-keys.txt index 8675b565665e..36d9cb90d1c8 100644 --- a/litellm/proxy/_experimental/out/virtual-keys/__next.!KGRhc2hib2FyZCk.virtual-keys.txt +++ b/litellm/proxy/_experimental/out/virtual-keys/__next.!KGRhc2hib2FyZCk.virtual-keys.txt @@ -1,4 +1,4 @@ 1:"$Sreact.fragment" 2:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 3:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/virtual-keys/__next._full.txt b/litellm/proxy/_experimental/out/virtual-keys/__next._full.txt index 1d82eca73ddb..1d0914455c01 100644 --- a/litellm/proxy/_experimental/out/virtual-keys/__next._full.txt +++ b/litellm/proxy/_experimental/out/virtual-keys/__next._full.txt @@ -1,18 +1,18 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[92825,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientSegmentRoot"] -8:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] +8:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] 18:I[168027,[],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","virtual-keys",""],"q":"","i":false,"f":[[["",{"children":["(dashboard)",{"children":["virtual-keys",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true,"nonce":"$undefined"}]],["$","$L7",null,{"Component":"$8","slots":{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]},"serverProvidedParams":{"params":{},"promises":["$@9"]}}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":["$La",["$Lb","$Lc","$Ld","$Le","$Lf","$L10","$L11","$L12","$L13","$L14","$L15"],"$L16"]}],{},null,false,false]},null,false,false]},null,false,false]},null,false,false],"$L17",false]],"m":"$undefined","G":["$18",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","virtual-keys",""],"q":"","i":false,"f":[[["",{"children":["(dashboard)",{"children":["virtual-keys",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true,"nonce":"$undefined"}]],["$","$L7",null,{"Component":"$8","slots":{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]},"serverProvidedParams":{"params":{},"promises":["$@9"]}}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":["$La",["$Lb","$Lc","$Ld","$Le","$Lf","$L10","$L11","$L12","$L13","$L14","$L15"],"$L16"]}],{},null,false,false]},null,false,false]},null,false,false]},null,false,false],"$L17",false]],"m":"$undefined","G":["$18",[]],"S":true} 19:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -1a:I[995118,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/7a8b5e4509475f1b.js","/litellm-asset-prefix/_next/static/chunks/5924be7dfd4e3180.js","/litellm-asset-prefix/_next/static/chunks/0f4e333632824936.js","/litellm-asset-prefix/_next/static/chunks/8e07d45aac7bbba7.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/b80871109e9f0047.js","/litellm-asset-prefix/_next/static/chunks/c14973c0b8a84588.js","/litellm-asset-prefix/_next/static/chunks/90cb6cf32d80a498.js","/litellm-asset-prefix/_next/static/chunks/1adc8f9684e2031d.js","/litellm-asset-prefix/_next/static/chunks/e26b06a3f997aa29.js"],"default"] +1a:I[995118,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/7a8b5e4509475f1b.js","/litellm-asset-prefix/_next/static/chunks/5924be7dfd4e3180.js","/litellm-asset-prefix/_next/static/chunks/0f4e333632824936.js","/litellm-asset-prefix/_next/static/chunks/8e07d45aac7bbba7.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/b80871109e9f0047.js","/litellm-asset-prefix/_next/static/chunks/c14973c0b8a84588.js","/litellm-asset-prefix/_next/static/chunks/90cb6cf32d80a498.js","/litellm-asset-prefix/_next/static/chunks/1adc8f9684e2031d.js","/litellm-asset-prefix/_next/static/chunks/e26b06a3f997aa29.js"],"default"] 1d:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 1e:"$Sreact.suspense" 20:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"] diff --git a/litellm/proxy/_experimental/out/virtual-keys/__next._head.txt b/litellm/proxy/_experimental/out/virtual-keys/__next._head.txt index 870c89c7e114..5e208181bb38 100644 --- a/litellm/proxy/_experimental/out/virtual-keys/__next._head.txt +++ b/litellm/proxy/_experimental/out/virtual-keys/__next._head.txt @@ -3,4 +3,4 @@ 3:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"IconMark"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/get_favicon"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/virtual-keys/__next._index.txt b/litellm/proxy/_experimental/out/virtual-keys/__next._index.txt index 67c452e8c219..d3b4e1ec8d8c 100644 --- a/litellm/proxy/_experimental/out/virtual-keys/__next._index.txt +++ b/litellm/proxy/_experimental/out/virtual-keys/__next._index.txt @@ -1,9 +1,9 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","template":["$","$L6",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]}]]}],"loading":null,"isPartial":false} diff --git a/litellm/proxy/_experimental/out/virtual-keys/__next._tree.txt b/litellm/proxy/_experimental/out/virtual-keys/__next._tree.txt index 9c212b604427..99cb81ef14fc 100644 --- a/litellm/proxy/_experimental/out/virtual-keys/__next._tree.txt +++ b/litellm/proxy/_experimental/out/virtual-keys/__next._tree.txt @@ -1,4 +1,4 @@ :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"buildId":"LpqGBJeKQM0vUG-9uVaiY","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"(dashboard)","paramType":null,"paramKey":"(dashboard)","hasRuntimePrefetch":false,"slots":{"children":{"name":"virtual-keys","paramType":null,"paramKey":"virtual-keys","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +0:{"buildId":"qDSCS5Afc8ezv8M4GuOM3","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"(dashboard)","paramType":null,"paramKey":"(dashboard)","hasRuntimePrefetch":false,"slots":{"children":{"name":"virtual-keys","paramType":null,"paramKey":"virtual-keys","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} diff --git a/litellm/proxy/_experimental/out/virtual-keys/index.html b/litellm/proxy/_experimental/out/virtual-keys/index.html index ad81620f271b..52a9fedeaf7e 100644 --- a/litellm/proxy/_experimental/out/virtual-keys/index.html +++ b/litellm/proxy/_experimental/out/virtual-keys/index.html @@ -1 +1 @@ -LiteLLM Dashboard
Loading...
\ No newline at end of file +LiteLLM Dashboard
Loading...
\ No newline at end of file diff --git a/litellm/proxy/_experimental/out/virtual-keys/index.txt b/litellm/proxy/_experimental/out/virtual-keys/index.txt index 1d82eca73ddb..1d0914455c01 100644 --- a/litellm/proxy/_experimental/out/virtual-keys/index.txt +++ b/litellm/proxy/_experimental/out/virtual-keys/index.txt @@ -1,18 +1,18 @@ 1:"$Sreact.fragment" -2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"default"] -4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js"],"AuthProvider"] +2:I[867271,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +3:I[71195,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"default"] +4:I[557951,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js"],"AuthProvider"] 5:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 6:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"] 7:I[92825,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientSegmentRoot"] -8:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] +8:I[216370,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js"],"default"] 18:I[168027,[],"default"] :HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"] :HL["/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","style"] :HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}] -0:{"P":null,"b":"LpqGBJeKQM0vUG-9uVaiY","c":["","virtual-keys",""],"q":"","i":false,"f":[[["",{"children":["(dashboard)",{"children":["virtual-keys",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true,"nonce":"$undefined"}]],["$","$L7",null,{"Component":"$8","slots":{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]},"serverProvidedParams":{"params":{},"promises":["$@9"]}}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":["$La",["$Lb","$Lc","$Ld","$Le","$Lf","$L10","$L11","$L12","$L13","$L14","$L15"],"$L16"]}],{},null,false,false]},null,false,false]},null,false,false]},null,false,false],"$L17",false]],"m":"$undefined","G":["$18",[]],"S":true} +0:{"P":null,"b":"qDSCS5Afc8ezv8M4GuOM3","c":["","virtual-keys",""],"q":"","i":false,"f":[[["",{"children":["(dashboard)",{"children":["virtual-keys",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/47150bfa067220d3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[[["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","async":true,"nonce":"$undefined"}]],["$","$L7",null,{"Component":"$8","slots":{"children":["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]},"serverProvidedParams":{"params":{},"promises":["$@9"]}}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L5",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":["$La",["$Lb","$Lc","$Ld","$Le","$Lf","$L10","$L11","$L12","$L13","$L14","$L15"],"$L16"]}],{},null,false,false]},null,false,false]},null,false,false]},null,false,false],"$L17",false]],"m":"$undefined","G":["$18",[]],"S":true} 19:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"] -1a:I[995118,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/25c705f79a0254af.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/7a8b5e4509475f1b.js","/litellm-asset-prefix/_next/static/chunks/5924be7dfd4e3180.js","/litellm-asset-prefix/_next/static/chunks/0f4e333632824936.js","/litellm-asset-prefix/_next/static/chunks/8e07d45aac7bbba7.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/b80871109e9f0047.js","/litellm-asset-prefix/_next/static/chunks/c14973c0b8a84588.js","/litellm-asset-prefix/_next/static/chunks/90cb6cf32d80a498.js","/litellm-asset-prefix/_next/static/chunks/1adc8f9684e2031d.js","/litellm-asset-prefix/_next/static/chunks/e26b06a3f997aa29.js"],"default"] +1a:I[995118,["/litellm-asset-prefix/_next/static/chunks/59002382e3e0d318.js","/litellm-asset-prefix/_next/static/chunks/39f15eb671ac68ef.js","/litellm-asset-prefix/_next/static/chunks/2954392b7a60a6a1.js","/litellm-asset-prefix/_next/static/chunks/40a2744137b1aec2.js","/litellm-asset-prefix/_next/static/chunks/6b6f59918488256c.js","/litellm-asset-prefix/_next/static/chunks/738c339383c3b4b6.js","/litellm-asset-prefix/_next/static/chunks/dd195df4747f737d.js","/litellm-asset-prefix/_next/static/chunks/14a8d3d080828636.js","/litellm-asset-prefix/_next/static/chunks/bc90eb5e42a662a8.js","/litellm-asset-prefix/_next/static/chunks/7b668a9caf81638c.js","/litellm-asset-prefix/_next/static/chunks/7a8b5e4509475f1b.js","/litellm-asset-prefix/_next/static/chunks/5924be7dfd4e3180.js","/litellm-asset-prefix/_next/static/chunks/0f4e333632824936.js","/litellm-asset-prefix/_next/static/chunks/8e07d45aac7bbba7.js","/litellm-asset-prefix/_next/static/chunks/542a1a209eb732c6.js","/litellm-asset-prefix/_next/static/chunks/a1ef280b7ad5ae6a.js","/litellm-asset-prefix/_next/static/chunks/b80871109e9f0047.js","/litellm-asset-prefix/_next/static/chunks/c14973c0b8a84588.js","/litellm-asset-prefix/_next/static/chunks/90cb6cf32d80a498.js","/litellm-asset-prefix/_next/static/chunks/1adc8f9684e2031d.js","/litellm-asset-prefix/_next/static/chunks/e26b06a3f997aa29.js"],"default"] 1d:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"] 1e:"$Sreact.suspense" 20:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"]