@decocms/mesh 2.12.0 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-Cso_Xxvk.js → AlertCircle-CtP28Oyz.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BrsZ2N_5.js → ArrowLeft-Bps-R0_t.js} +1 -1
- package/dist/client/assets/{Check-JFkjTCfG.js → Check-Bkw0Gz-n.js} +1 -1
- package/dist/client/assets/{ChevronDown-HtFMO0lw.js → ChevronDown-mvTJP4-S.js} +1 -1
- package/dist/client/assets/{Clock-CW5u1cfj.js → Clock-DiHiAbv6.js} +1 -1
- package/dist/client/assets/{Code01-CgNchnl3.js → Code01-CTUZx8UP.js} +1 -1
- package/dist/client/assets/{Copy01-Dadp_RDG.js → Copy01-BctGx-5E.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-B0A7sUYv.js → DotsHorizontal-MMZ1EZhB.js} +1 -1
- package/dist/client/assets/{DotsVertical-BHUUUCDx.js → DotsVertical-CzCtj25W.js} +1 -1
- package/dist/client/assets/{Edit01-CxRkZTQ1.js → Edit01-BD5iJRQz.js} +1 -1
- package/dist/client/assets/{File06-D0TXCuMx.js → File06-nV81V8TD.js} +1 -1
- package/dist/client/assets/{FilterLines-_uykt7r4.js → FilterLines-CBfbdjv3.js} +1 -1
- package/dist/client/assets/{FlipBackward-GGMv99yc.js → FlipBackward-CpWoOBPz.js} +1 -1
- package/dist/client/assets/{GitBranch01-BUTuezlq.js → GitBranch01-DWYSSAGj.js} +1 -1
- package/dist/client/assets/{Grid01-BbdtRdR8.js → Grid01-BEpepbVy.js} +1 -1
- package/dist/client/assets/{Inbox01-CgwXLK3n.js → Inbox01-DkMyh-FB.js} +1 -1
- package/dist/client/assets/{InfoCircle-D6qJG9Nl.js → InfoCircle-BXctEVkS.js} +1 -1
- package/dist/client/assets/{Key01-8ewaPBuD.js → Key01-ChIWeKNh.js} +1 -1
- package/dist/client/assets/{LinkExternal01-D0Wjfr3t.js → LinkExternal01-By7zx70s.js} +1 -1
- package/dist/client/assets/{Loading01-NW_f44Lz.js → Loading01-CdaWSExX.js} +1 -1
- package/dist/client/assets/{Lock01-BTPtPjN4.js → Lock01-txD_UwBx.js} +1 -1
- package/dist/client/assets/{Play-CIMfsFF1.js → Play-CjVz5-Yt.js} +1 -1
- package/dist/client/assets/{Plus-DaP4KLuJ.js → Plus-CovnOzP9.js} +1 -1
- package/dist/client/assets/{SearchMd-tOSOFUes.js → SearchMd-YxKkBPG0.js} +1 -1
- package/dist/client/assets/{Terminal-ANRX3jJ8.js → Terminal-DYwA22tz.js} +1 -1
- package/dist/client/assets/{Trash01-CjDzx3jP.js → Trash01-DopdNXEu.js} +1 -1
- package/dist/client/assets/{X-D3ljCSd1.js → X-DcqsnRSe.js} +1 -1
- package/dist/client/assets/{XClose-Ba3zyI0J.js → XClose-D0utLGU3.js} +1 -1
- package/dist/client/assets/{alert-dialog-_Gzpv9vf.js → alert-dialog-B2ogXLEp.js} +1 -1
- package/dist/client/assets/{auth-C9dSkS_x.js → auth-CNkA6dk2.js} +1 -1
- package/dist/client/assets/{auth-catchall-DRL5ZGJM.js → auth-catchall-BG5YjEP_.js} +1 -1
- package/dist/client/assets/{avatar-D1o5pnzU.js → avatar-KT16fAYd.js} +1 -1
- package/dist/client/assets/{badge-0b6sJe4S.js → badge-8BCP2QJ_.js} +1 -1
- package/dist/client/assets/{card-B3fsloDi.js → card-XgDm8_H9.js} +1 -1
- package/dist/client/assets/{checkbox-2xIaHvS4.js → checkbox-B9Ss6ffk.js} +1 -1
- package/dist/client/assets/{collection-detail-Bu5gtjud.js → collection-detail-BJvqsPlx.js} +1 -1
- package/dist/client/assets/{collection-display-button-BGIcja12.js → collection-display-button-DroTLKfu.js} +1 -1
- package/dist/client/assets/{collection-header-DhWbmVkk.js → collection-header-CUphFaJM.js} +1 -1
- package/dist/client/assets/{collection-page-B4ZjGX9V.js → collection-page-C8c74lBQ.js} +1 -1
- package/dist/client/assets/{collection-search-CYZk6T6Z.js → collection-search-DIEJ7x7R.js} +1 -1
- package/dist/client/assets/{collection-tab-IeT0mJ-2.js → collection-tab-BQr3sv8I.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-D2niE2Ci.js → collection-table-wrapper-x8zydyA0.js} +1 -1
- package/dist/client/assets/{connection-card-D0c_wvmz.js → connection-card-CTMXB5Zh.js} +1 -1
- package/dist/client/assets/{connection-detail-BmNPUV8x.js → connection-detail-BU82m59Z.js} +1 -1
- package/dist/client/assets/{connections-U2y3agtD.js → connections-B-zsqKwM.js} +1 -1
- package/dist/client/assets/constants-8DEiLmV-.js +1 -0
- package/dist/client/assets/{create-organization-dialog-D0WQQsLG.js → create-organization-dialog-CHS4cOdy.js} +1 -1
- package/dist/client/assets/{dialog-BXeLl5mO.js → dialog-D9LHhl79.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CnL8UM0z.js → dropdown-menu-DjFWyTtD.js} +1 -1
- package/dist/client/assets/{empty-state-BmkZOMzL.js → empty-state-DSGxvcRL.js} +1 -1
- package/dist/client/assets/{empty-state-DzS1Zp7m.js → empty-state-DgOO5bI1.js} +1 -1
- package/dist/client/assets/env-vars-editor-mM2KyO-W.js +1 -0
- package/dist/client/assets/{error-boundary-BQnJ9S9E.js → error-boundary-uBvOVTCE.js} +1 -1
- package/dist/client/assets/extract-connection-data-DMhfaAiL.js +1 -0
- package/dist/client/assets/{form-DrOt6d2d.js → form-orY-xngM.js} +1 -1
- package/dist/client/assets/{gateway-detail-CniDbJPb.js → gateway-detail-Bnl2H9_J.js} +1 -1
- package/dist/client/assets/{gateways-DmEpJOpx.js → gateways-RS5E135D.js} +1 -1
- package/dist/client/assets/{home-HrkEcREJ.js → home-HRdtfNlr.js} +1 -1
- package/dist/client/assets/index-9MwexYU6.css +1 -0
- package/dist/client/assets/{index-CBIrwxtj.js → index-BuPukvJG.js} +3 -3
- package/dist/client/assets/{index-DMNk-OUX.js → index-Bz1LU39D.js} +2 -2
- package/dist/client/assets/{index-XOpbMEap.js → index-Cw3bkeXO.js} +1 -1
- package/dist/client/assets/{index-GoXtajA4.js → index-K2EwRRk6.js} +2 -2
- package/dist/client/assets/{index-Bb8rHnPb.js → index-o28bnKR9.js} +1 -1
- package/dist/client/assets/{input-68J17rBp.js → input-CtiQUsvV.js} +1 -1
- package/dist/client/assets/{layout-Olb4shdE.js → layout-C8G6tSLB.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-Ccgc_fxj.js → lazy-highlighter-C5pGkBnk.js} +1 -1
- package/dist/client/assets/localstorage-keys-5oG1CfEQ.js +1 -0
- package/dist/client/assets/{login-UTKAAaeX.js → login-BvQHpiOu.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Db8WtQ8u.js → mcp-oauth-BzcB2WNx.js} +1 -1
- package/dist/client/assets/mcp-server-card-BawKO-ZK.js +1 -0
- package/dist/client/assets/mcp-server-detail-CxrhH1J8.js +1 -0
- package/dist/client/assets/{members-V-vtwMYY.js → members-C0iWKqGR.js} +1 -1
- package/dist/client/assets/{monaco-editor-B_MycISs.js → monaco-editor-BmVBfnK5.js} +1 -1
- package/dist/client/assets/{monitoring-CBmCnQ7i.js → monitoring-7ik3wQUY.js} +1 -1
- package/dist/client/assets/{oauth-callback-BYBqbF1w.js → oauth-callback-Coasa0XK.js} +1 -1
- package/dist/client/assets/page-DsAOPS13.js +1 -0
- package/dist/client/assets/{page-DrIZd1pO.js → page-yu9K5Vtj.js} +1 -1
- package/dist/client/assets/{pin-to-sidebar-button-B1xHHS9n.js → pin-to-sidebar-button-C-akIZzz.js} +1 -1
- package/dist/client/assets/{popover-DC9U4d6e.js → popover-QWczrvYc.js} +1 -1
- package/dist/client/assets/{project-context-provider-BJIP5a-U.js → project-context-provider-_aLYBfO9.js} +1 -1
- package/dist/client/assets/registry-utils-BIzwINzW.js +1 -0
- package/dist/client/assets/{resizable-CW5_SPIS.js → resizable-djk090hC.js} +1 -1
- package/dist/client/assets/{resource-tabs-BKSlcL1W.js → resource-tabs-GXDudjH9.js} +1 -1
- package/dist/client/assets/{select-B9KJyTZZ.js → select-Bxj6_TSM.js} +1 -1
- package/dist/client/assets/{settings-CYg4YPRI.js → settings-0nIjjKRi.js} +1 -1
- package/dist/client/assets/{shell-layout-KIN6fL5j.js → shell-layout-BFIjeoYr.js} +1 -1
- package/dist/client/assets/{spinner-B0sczm1j.js → spinner-C7HX4n17.js} +1 -1
- package/dist/client/assets/{switch-BuVvmF04.js → switch-zovYrKoi.js} +1 -1
- package/dist/client/assets/{textarea-BAUX8Qgd.js → textarea-D76YOeHc.js} +1 -1
- package/dist/client/assets/{thread-history-popover-Dv63nk6L.js → thread-history-popover-BKo2wskT.js} +1 -1
- package/dist/client/assets/{tool-set-selector-DMsE0yRo.js → tool-set-selector-Dfdgsx2h.js} +1 -1
- package/dist/client/assets/{tools-list-Dgf0oqyC.js → tools-list-C2S7XIkI.js} +1 -1
- package/dist/client/assets/{use-binding-Dj4lal1A.js → use-binding-UNVemCFv.js} +1 -1
- package/dist/client/assets/{use-connection-DoWszS3j.js → use-connection-BXdeHsm0.js} +1 -1
- package/dist/client/assets/{use-connection-resources-BywYCfzc.js → use-connection-resources-C8cAy7Nl.js} +1 -1
- package/dist/client/assets/{use-create-gateway-Ca5SEa8I.js → use-create-gateway-D8vNiD2K.js} +1 -1
- package/dist/client/assets/{use-gateway-CRpsitbG.js → use-gateway-BhC1hXIm.js} +1 -1
- package/dist/client/assets/{use-gateway-system-prompt-B4ia2QxW.js → use-gateway-system-prompt-uetw6YB3.js} +1 -1
- package/dist/client/assets/{use-list-state-CPUcOhR_.js → use-list-state-CAv4RNZg.js} +1 -1
- package/dist/client/assets/{use-mcp-L2lisTXg.js → use-mcp-kCjFuvFP.js} +1 -1
- package/dist/client/assets/{use-members-7eRdYOTr.js → use-members-9nvpFN_1.js} +1 -1
- package/dist/client/assets/{use-mobile--ytA5LT5.js → use-mobile-sd5ko6M_.js} +1 -1
- package/dist/client/assets/{use-organization-settings-D6rXW2c_.js → use-organization-settings-DBRSoBd0.js} +1 -1
- package/dist/client/assets/{use-tool-call-BBonHr6l.js → use-tool-call-BLplGau6.js} +1 -1
- package/dist/client/assets/{value-Bd2XBV_y.js → value-DxHsXzsm.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BpjQ6V4P.js → view-mode-toggle-CVcyaB_S.js} +1 -1
- package/dist/client/assets/{workflow-CjynHD6b.js → workflow-BUV3CQv_.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +201 -201
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/LICENSE +47 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/README.md +82 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.d.ts +11 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.mjs +43 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cjs +45 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cloudflare.cjs +46 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cloudflare.d.ts +11 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.d.ts +11 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.mjs +46 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.wasm +0 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.d.mts +83 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.d.ts +83 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.js +2 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.js.map +1 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs +2 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs.map +1 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.d.mts +20 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.d.ts +20 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.js +2 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.js.map +1 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs +2 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs.map +1 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/package.json +61 -0
- package/dist/server/server.js +197 -197
- package/package.json +1 -1
- package/dist/client/assets/constants-Cy709IUA.js +0 -1
- package/dist/client/assets/env-vars-editor-B_mIaT86.js +0 -1
- package/dist/client/assets/extract-connection-data-DPoJQhk8.js +0 -1
- package/dist/client/assets/index-ChrSnaFS.css +0 -1
- package/dist/client/assets/localstorage-keys-C62ZbWuB.js +0 -1
- package/dist/client/assets/mcp-server-detail-BvVQovUz.js +0 -1
- package/dist/client/assets/page-DYF0Qz3l.js +0 -1
- package/dist/client/assets/registry-utils-B7t_ZBUi.js +0 -1
- package/dist/client/assets/server-name-C3ttWdyD.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a2 as _c,c as ve,K as ui,p as Cc,j as c,f as Vo,aH as Nc,aI as ls,u as Tc,a as Fc,t as Ut,a0 as di,r as P,aJ as Pc,a4 as Ec,i as zo,h as fi,l as Ic,aK as Dc,aL as $c,aM as kc,ai as Mc,ac as Rc,aF as Bc,af as Rt,ad as Nn,aa as Yt,ab as Uc,aN as Lc,aO as Wc,v as qo,U as Vc,V as cs,w as Ae,$ as zc,X as qc,s as Kc,k as Gc,y as Hc,x as Yc}from"./index-DMNk-OUX.js";import{i as Xc,a as Jc}from"./mcp-oauth-Db8WtQ8u.js";import{I as Zc,n as Qc,c as mi,E as eu}from"./empty-state-DzS1Zp7m.js";import{s as xr,E as tu,i as nu,r as ru,e as Ko}from"./env-vars-editor-B_mIaT86.js";import{E as iu}from"./error-boundary-BQnJ9S9E.js";import{u as hi,a as Go}from"./use-connection-DoWszS3j.js";import{a as Ho,r as su,c as ou,d as Yo,A as au,u as Xo}from"./use-binding-Dj4lal1A.js";import{u as lu}from"./use-tool-call-BBonHr6l.js";import{P as cu}from"./pin-to-sidebar-button-B1xHHS9n.js";import{B as Vt,I as lt}from"./input-68J17rBp.js";import{i as uu}from"./File06-D0TXCuMx.js";import{i as du}from"./Key01-8ewaPBuD.js";import{i as yn}from"./Loading01-NW_f44Lz.js";import{V as fu}from"./layout-Olb4shdE.js";import{u as pi}from"./project-context-provider-BJIP5a-U.js";import{F as ke,a as mu,b as Me,d as Re,f as Be,c as it,e as hu}from"./form-DrOt6d2d.js";import{S as Jo,a as Zo,b as Qo,c as ea,d as kt,e as ta}from"./select-B9KJyTZZ.js";import{i as pu}from"./Terminal-ANRX3jJ8.js";import{u as gu,a as yu,i as na}from"./use-gateway-CRpsitbG.js";import{i as xu}from"./Grid01-BbdtRdR8.js";import{s as ra}from"./Plus-DaP4KLuJ.js";import{u as bu,R as vu,I as Su,a as wu}from"./index-Bb8rHnPb.js";import{M as ju}from"./constants-Cy709IUA.js";import{f as ia,e as Ou}from"./registry-utils-B7t_ZBUi.js";import{e as Au}from"./extract-connection-data-DPoJQhk8.js";import{R as us,_ as _t}from"./index-XOpbMEap.js";import{G as _u,M as Cu}from"./index-CBIrwxtj.js";function Nu(t,e){return bu({...t,queries:t.queries.map(n=>({...n,suspense:!0,throwOnError:_c,enabled:!0,placeholderData:void 0}))},e)}function Dw(t){const e=ve.c(9),{connectionId:n}=t;let r,i,s;e[0]!==n?(r=new URL(`/mcp/${n}`,window.location.origin),s=Cc,i=ui.isMCPAuthenticated(r.href,null),e[0]=n,e[1]=r,e[2]=i,e[3]=s):(r=e[1],i=e[2],s=e[3]);let a;e[4]!==r?(a=()=>Xc({url:r.href,token:null}),e[4]=r,e[5]=a):a=e[5];let o;e[6]!==i||e[7]!==a?(o={queryKey:i,queryFn:a},e[6]=i,e[7]=a,e[8]=o):o=e[8];const{data:l}=s(o);return l}const Bn=43200,ds=1440,fs=Symbol.for("constructDateFrom");function gi(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&fs in t?t[fs](e):t instanceof Date?new t.constructor(e):new Date(e)}function ht(t,e){return gi(t,t)}let Tu={};function Fu(){return Tu}function ms(t){const e=ht(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function yi(t,...e){const n=gi.bind(null,t||e.find(r=>typeof r=="object"));return e.map(n)}function zn(t,e){const n=+ht(t)-+ht(e);return n<0?-1:n>0?1:n}function Pu(t){return gi(t,Date.now())}function Eu(t,e,n){const[r,i]=yi(n?.in,t,e),s=r.getFullYear()-i.getFullYear(),a=r.getMonth()-i.getMonth();return s*12+a}function Iu(t){return e=>{const r=(t?Math[t]:Math.trunc)(e);return r===0?0:r}}function Du(t,e){return+ht(t)-+ht(e)}function $u(t,e){const n=ht(t);return n.setHours(23,59,59,999),n}function ku(t,e){const n=ht(t),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Mu(t,e){const n=ht(t);return+$u(n)==+ku(n)}function Ru(t,e,n){const[r,i,s]=yi(n?.in,t,t,e),a=zn(i,s),o=Math.abs(Eu(i,s));if(o<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*o);let l=zn(i,s)===-a;Mu(r)&&o===1&&zn(r,s)===1&&(l=!1);const d=a*(o-+l);return d===0?0:d}function Bu(t,e,n){const r=Du(t,e)/1e3;return Iu(n?.roundingMethod)(r)}const Uu={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Lu=(t,e,n)=>{let r;const i=Uu[t];return typeof i=="string"?r=i:e===1?r=i.one:r=i.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function br(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const Wu={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Vu={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},zu={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},qu={date:br({formats:Wu,defaultWidth:"full"}),time:br({formats:Vu,defaultWidth:"full"}),dateTime:br({formats:zu,defaultWidth:"full"})},Ku={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Gu=(t,e,n,r)=>Ku[t];function rn(t){return(e,n)=>{const r=n?.context?String(n.context):"standalone";let i;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,o=n?.width?String(n.width):a;i=t.formattingValues[o]||t.formattingValues[a]}else{const a=t.defaultWidth,o=n?.width?String(n.width):t.defaultWidth;i=t.values[o]||t.values[a]}const s=t.argumentCallback?t.argumentCallback(e):e;return i[s]}}const Hu={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Yu={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Xu={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ju={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Zu={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Qu={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ed=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},td={ordinalNumber:ed,era:rn({values:Hu,defaultWidth:"wide"}),quarter:rn({values:Yu,defaultWidth:"wide",argumentCallback:t=>t-1}),month:rn({values:Xu,defaultWidth:"wide"}),day:rn({values:Ju,defaultWidth:"wide"}),dayPeriod:rn({values:Zu,defaultWidth:"wide",formattingValues:Qu,defaultFormattingWidth:"wide"})};function sn(t){return(e,n={})=>{const r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=e.match(i);if(!s)return null;const a=s[0],o=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(o)?rd(o,u=>u.test(a)):nd(o,u=>u.test(a));let d;d=t.valueCallback?t.valueCallback(l):l,d=n.valueCallback?n.valueCallback(d):d;const f=e.slice(a.length);return{value:d,rest:f}}}function nd(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function rd(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function id(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const i=r[0],s=e.match(t.parsePattern);if(!s)return null;let a=t.valueCallback?t.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=e.slice(i.length);return{value:a,rest:o}}}const sd=/^(\d+)(th|st|nd|rd)?/i,od=/\d+/i,ad={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ld={any:[/^b/i,/^(a|c)/i]},cd={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ud={any:[/1/i,/2/i,/3/i,/4/i]},dd={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},fd={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},md={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},hd={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},pd={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},gd={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},yd={ordinalNumber:id({matchPattern:sd,parsePattern:od,valueCallback:t=>parseInt(t,10)}),era:sn({matchPatterns:ad,defaultMatchWidth:"wide",parsePatterns:ld,defaultParseWidth:"any"}),quarter:sn({matchPatterns:cd,defaultMatchWidth:"wide",parsePatterns:ud,defaultParseWidth:"any",valueCallback:t=>t+1}),month:sn({matchPatterns:dd,defaultMatchWidth:"wide",parsePatterns:fd,defaultParseWidth:"any"}),day:sn({matchPatterns:md,defaultMatchWidth:"wide",parsePatterns:hd,defaultParseWidth:"any"}),dayPeriod:sn({matchPatterns:pd,defaultMatchWidth:"any",parsePatterns:gd,defaultParseWidth:"any"})},xd={code:"en-US",formatDistance:Lu,formatLong:qu,formatRelative:Gu,localize:td,match:yd,options:{weekStartsOn:0,firstWeekContainsDate:1}};function bd(t,e,n){const r=Fu(),i=n?.locale??r.locale??xd,s=2520,a=zn(t,e);if(isNaN(a))throw new RangeError("Invalid time value");const o=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[l,d]=yi(n?.in,...a>0?[e,t]:[t,e]),f=Bu(d,l),u=(ms(d)-ms(l))/1e3,h=Math.round((f-u)/60);let g;if(h<2)return n?.includeSeconds?f<5?i.formatDistance("lessThanXSeconds",5,o):f<10?i.formatDistance("lessThanXSeconds",10,o):f<20?i.formatDistance("lessThanXSeconds",20,o):f<40?i.formatDistance("halfAMinute",0,o):f<60?i.formatDistance("lessThanXMinutes",1,o):i.formatDistance("xMinutes",1,o):h===0?i.formatDistance("lessThanXMinutes",1,o):i.formatDistance("xMinutes",h,o);if(h<45)return i.formatDistance("xMinutes",h,o);if(h<90)return i.formatDistance("aboutXHours",1,o);if(h<ds){const m=Math.round(h/60);return i.formatDistance("aboutXHours",m,o)}else{if(h<s)return i.formatDistance("xDays",1,o);if(h<Bn){const m=Math.round(h/ds);return i.formatDistance("xDays",m,o)}else if(h<Bn*2)return g=Math.round(h/Bn),i.formatDistance("aboutXMonths",g,o)}if(g=Ru(d,l),g<12){const m=Math.round(h/Bn);return i.formatDistance("xMonths",m,o)}else{const m=g%12,p=Math.trunc(g/12);return m<3?i.formatDistance("aboutXYears",p,o):m<9?i.formatDistance("overXYears",p,o):i.formatDistance("almostXYears",p+1,o)}}function vd(t,e){return bd(t,Pu(t),e)}function Sd(t){const e=ve.c(13),{gateway:n,org:r}=t;let i;e[0]!==n.id||e[1]!==r?(i={org:r,gatewayId:n.id},e[0]=n.id,e[1]=r,e[2]=i):i=e[2];let s;e[3]!==n.icon||e[4]!==n.title?(s=n.icon?c.jsx("img",{src:n.icon,alt:n.title,className:"w-8 h-8 rounded-md object-cover shrink-0"}):c.jsx("div",{className:"w-8 h-8 rounded-md bg-primary/10 flex items-center justify-center shrink-0",children:c.jsx(na,{size:16,className:"text-primary"})}),e[3]=n.icon,e[4]=n.title,e[5]=s):s=e[5];let a;e[6]!==n.title?(a=c.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[6]=n.title,e[7]=a):a=e[7];let o;e[8]===Symbol.for("react.memo_cache_sentinel")?(o=c.jsx(xu,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[8]=o):o=e[8];let l;return e[9]!==i||e[10]!==s||e[11]!==a?(l=c.jsxs(Nc,{to:"/$org/gateways/$gatewayId",params:i,className:"flex items-center gap-3 p-3 rounded-lg border border-border hover:bg-muted/50 transition-colors group",children:[s,a,o]}),e[9]=i,e[10]=s,e[11]=a,e[12]=l):l=e[12],l}function hs(t){const e=ve.c(20),{connectionId:n,connectionTitle:r,connectionDescription:i,connectionIcon:s,org:a,hasExistingGateways:o}=t,l=Vo(),d=yu();let f;e[0]!==d.create||e[1]!==i||e[2]!==s||e[3]!==n||e[4]!==r||e[5]!==l||e[6]!==a?(f=async()=>{const m=await d.create.mutateAsync({title:`${r} Agent`,description:i??null,icon:s??null,status:"active",tool_selection_mode:"inclusion",connections:[{connection_id:n,selected_tools:null,selected_resources:null,selected_prompts:null}]});l({to:"/$org/gateways/$gatewayId",params:{org:a,gatewayId:m.id}})},e[0]=d.create,e[1]=i,e[2]=s,e[3]=n,e[4]=r,e[5]=l,e[6]=a,e[7]=f):f=e[7];const u=f;if(o){let m;e[8]!==d.create.isPending?(m=d.create.isPending?c.jsx(yn,{size:16,className:"animate-spin"}):c.jsx(ra,{size:16}),e[8]=d.create.isPending,e[9]=m):m=e[9];let p;return e[10]!==d.create.isPending||e[11]!==u||e[12]!==m?(p=c.jsxs(Vt,{variant:"outline",size:"sm",className:"gap-1.5",onClick:u,disabled:d.create.isPending,children:[m,"Create another Agent"]}),e[10]=d.create.isPending,e[11]=u,e[12]=m,e[13]=p):p=e[13],p}let h;e[14]!==d.create.isPending?(h=d.create.isPending?c.jsx(yn,{size:20,className:"animate-spin"}):c.jsx(na,{size:20}),e[14]=d.create.isPending,e[15]=h):h=e[15];let g;return e[16]!==d.create.isPending||e[17]!==u||e[18]!==h?(g=c.jsxs(Vt,{size:"lg",className:"gap-2 w-full",onClick:u,disabled:d.create.isPending,children:[h,"Create an agent"]}),e[16]=d.create.isPending,e[17]=u,e[18]=h,e[19]=g):g=e[19],g}function wd(t){const e=ve.c(26),{connectionId:n,connectionTitle:r,connectionDescription:i,connectionIcon:s,org:a}=t;let o;e[0]!==n?(o={filters:[{column:"connection_id",value:n}]},e[0]=n,e[1]=o):o=e[1];const l=gu(o);if(!(l.length>0)){let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("h4",{className:"text-sm font-medium text-foreground",children:"Use in your IDE"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Expose this connection via an Agent to use it in Cursor, VS Code, Claude Desktop, and other MCP-compatible tools."})]}),e[2]=p):p=e[2];let y;return e[3]!==i||e[4]!==s||e[5]!==n||e[6]!==r||e[7]!==a?(y=c.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[p,c.jsx(hs,{connectionId:n,connectionTitle:r,connectionDescription:i,connectionIcon:s,org:a,hasExistingGateways:!1})]}),e[3]=i,e[4]=s,e[5]=n,e[6]=r,e[7]=a,e[8]=y):y=e[8],y}let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("h4",{className:"text-sm font-medium text-foreground",children:"Agents"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection is used on the following agents."})]}),e[9]=f):f=e[9];let u;if(e[10]!==l||e[11]!==a){let p;e[13]!==a?(p=y=>c.jsx(Sd,{gateway:y,org:a},y.id),e[13]=a,e[14]=p):p=e[14],u=l.map(p),e[10]=l,e[11]=a,e[12]=u}else u=e[12];let h;e[15]!==u?(h=c.jsx("div",{className:"flex flex-col gap-2",children:u}),e[15]=u,e[16]=h):h=e[16];let g;e[17]!==i||e[18]!==s||e[19]!==n||e[20]!==r||e[21]!==a?(g=c.jsx(hs,{connectionId:n,connectionTitle:r,connectionDescription:i,connectionIcon:s,org:a,hasExistingGateways:!0}),e[17]=i,e[18]=s,e[19]=n,e[20]=r,e[21]=a,e[22]=g):g=e[22];let m;return e[23]!==h||e[24]!==g?(m=c.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[f,h,g]}),e[23]=h,e[24]=g,e[25]=m):m=e[25],m}function jd({form:t,connection:e}){const n=ls({control:t.control,name:"ui_type"}),r=ls({control:t.control,name:"connection_url"}),{stdioEnabled:i}=Tc(),s=(()=>{if(typeof r!="string"||!r)return!1;try{const o=new URL(r);return o.hostname==="api.githubcopilot.com"&&o.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),a=i||e.connection_type==="STDIO";return c.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[c.jsx(ke,{control:t.control,name:"ui_type",render:({field:o})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"Type"}),c.jsxs(Jo,{value:o.value,onValueChange:o.onChange,children:[c.jsx(Re,{children:c.jsx(Zo,{children:c.jsx(Qo,{})})}),c.jsxs(ea,{children:[c.jsx(kt,{value:"HTTP",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(xr,{className:"w-4 h-4"}),"HTTP"]})}),c.jsx(kt,{value:"SSE",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(xr,{className:"w-4 h-4"}),"SSE"]})}),c.jsx(kt,{value:"Websocket",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(xr,{className:"w-4 h-4"}),"Websocket"]})}),a&&c.jsxs(c.Fragment,{children:[c.jsx(kt,{value:"NPX",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(Qc,{className:"w-4 h-4"}),"NPX Package"]})}),c.jsx(kt,{value:"STDIO",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(pu,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),c.jsx(Be,{})]})}),n==="NPX"&&c.jsx(ke,{control:t.control,name:"npx_package",render:({field:o})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"NPM Package"}),c.jsx(Re,{children:c.jsx(lt,{placeholder:"@perplexity-ai/mcp-server",...o,value:o.value||"",className:"h-10 rounded-lg"})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),c.jsx(Be,{})]})}),n==="STDIO"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(ke,{control:t.control,name:"stdio_command",render:({field:o})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"Command"}),c.jsx(Re,{children:c.jsx(lt,{placeholder:"node, bun, python...",...o,value:o.value||"",className:"h-10 rounded-lg"})}),c.jsx(Be,{})]})}),c.jsx(ke,{control:t.control,name:"stdio_args",render:({field:o})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"Arguments"}),c.jsx(Re,{children:c.jsx(lt,{placeholder:"arg1 arg2 --flag value",...o,value:o.value||"",className:"h-10 rounded-lg"})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments (no quotes needed)"}),c.jsx(Be,{})]})})]}),c.jsx(ke,{control:t.control,name:"stdio_cwd",render:({field:o})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"Working Directory"}),c.jsx(Re,{children:c.jsx(lt,{placeholder:"/path/to/project (optional)",...o,value:o.value||"",className:"h-10 rounded-lg"})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),c.jsx(Be,{})]})})]}),(n==="NPX"||n==="STDIO")&&c.jsx(ke,{control:t.control,name:"env_vars",render:({field:o})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"Environment Variables"}),c.jsx(Re,{children:c.jsx(tu,{value:o.value??[],onChange:o.onChange})}),c.jsx(Be,{})]})}),n!=="NPX"&&n!=="STDIO"&&c.jsxs(c.Fragment,{children:[c.jsx(ke,{control:t.control,name:"connection_url",render:({field:o})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"URL"}),c.jsx(Re,{children:c.jsx(lt,{placeholder:"https://example.com/mcp",...o,value:o.value??"",className:"h-10 rounded-lg"})}),c.jsx(Be,{})]})}),c.jsx(ke,{control:t.control,name:"connection_token",render:({field:o})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:s?"GitHub Personal Access Token":"Token"}),c.jsx(Re,{children:c.jsx(lt,{type:"password",placeholder:e.connection_token?"••••••••":s?"Paste your GitHub PAT (no 'Bearer' prefix)":"Enter access token...",...o,value:o.value||"",className:"h-10 rounded-lg"})}),s&&c.jsxs(hu,{children:["(!) GitHub’s hosted MCP at"," ",c.jsx("code",{children:"api.githubcopilot.com/mcp"})," currently requires a Personal Access Token (PAT). Create one at"," ",c.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"}),". Mesh will send it as"," ",c.jsx("code",{children:"Authorization: Bearer <PAT>"}),"."]}),c.jsx(Be,{})]})})]})]})}function Od(t){const e=ve.c(30),{form:n,connection:r}=t,{org:i}=pi();let s;e[0]!==r.icon||e[1]!==r.title?(s=c.jsx(Zc,{icon:r.icon,name:r.title,size:"lg",className:"shadow-sm"}),e[0]=r.icon,e[1]=r.title,e[2]=s):s=e[2];let a;e[3]!==n.control?(a=c.jsxs("div",{className:"flex flex-col",children:[c.jsx(ke,{control:n.control,name:"title",render:_d}),c.jsx(ke,{control:n.control,name:"description",render:Ad})]}),e[3]=n.control,e[4]=a):a=e[4];let o;e[5]!==s||e[6]!==a?(o=c.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[s,a]}),e[5]=s,e[6]=a,e[7]=o):o=e[7];let l;e[8]!==r||e[9]!==n?(l=c.jsx(jd,{form:n,connection:r}),e[8]=r,e[9]=n,e[10]=l):l=e[10];let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[11]=d):d=e[11];let f;e[12]!==r.updated_at?(f=r.updated_at?vd(new Date(r.updated_at),{addSuffix:!1}):"Unknown",e[12]=r.updated_at,e[13]=f):f=e[13];let u;e[14]!==f?(u=c.jsxs("div",{className:"flex items-center gap-4 p-5 border-b border-border",children:[d,c.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:f})]}),e[14]=f,e[15]=u):u=e[15];let h;e[16]!==r.description||e[17]!==r.icon||e[18]!==r.id||e[19]!==r.title||e[20]!==i.slug?(h=c.jsx(wd,{connectionId:r.id,connectionTitle:r.title,connectionDescription:r.description,connectionIcon:r.icon,org:i.slug}),e[16]=r.description,e[17]=r.icon,e[18]=r.id,e[19]=r.title,e[20]=i.slug,e[21]=h):h=e[21];let g;e[22]!==o||e[23]!==l||e[24]!==u||e[25]!==h?(g=c.jsxs("div",{className:"flex flex-col",children:[o,l,u,h]}),e[22]=o,e[23]=l,e[24]=u,e[25]=h,e[26]=g):g=e[26];let m;return e[27]!==n||e[28]!==g?(m=c.jsx(mu,{...n,children:g}),e[27]=n,e[28]=g,e[29]=m):m=e[29],m}function Ad(t){const{field:e}=t;return c.jsxs(Me,{className:"w-full space-y-0",children:[c.jsx(Re,{children:c.jsx(lt,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),c.jsx(Be,{})]})}function _d(t){const{field:e}=t;return c.jsxs(Me,{className:"w-full space-y-0",children:[c.jsx("div",{className:"flex items-center gap-2.5",children:c.jsx(Re,{children:c.jsx(lt,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Connection Name"})})}),c.jsx(Be,{})]})}function Cd(t){return t.startsWith("@")?t:`@${t}`}function Nd(t){const e=t._meta?.[ju]?.tools;if(!(!e||e.length===0))return e.map(n=>({name:n.name,inputSchema:n.inputSchema??void 0,outputSchema:n.outputSchema??void 0}))}function Td(t){const e=hi(),n=Ho(e),r=t?Cd(t):"",i=r?{where:{appName:r},includeTools:!0}:{},a=Nu({queries:n.map(l=>{const d=l.id,f=ia(l.tools)||"",u=mi(d),h=JSON.stringify(i);return{queryKey:ui.toolCall(d,f,h),queryFn:async()=>{if(!f||!r)return null;try{return(await u(f,i))?.items?.[0]??null}catch{return null}},staleTime:300*1e3}})}).map(l=>l.data).find(l=>l!==null);return{bindingSchema:a?Nd(a):void 0}}function Fd(t){return t.startsWith("@")?t:`@${t}`}function Pd(){const{org:t}=pi(),{data:e}=Fc.useSession(),n=Go(),r=hi(),i=Ho(r);return{installByBinding:async a=>{if(!t||!e?.user?.id){Ut.error("Not authenticated");return}const o=Fd(a),d=(await Promise.all(i.map(async u=>{const h=ia(u.tools);if(!h)return null;const g=mi(u.id);try{const m=await g(h,{where:{appName:o}});return Ou(m??[])[0]??null}catch{return null}}))).find(u=>u!==null);if(!d){Ut.error(`MCP Server not found in registry: ${a}`);return}const f=Au(d,t.id,e.user.id);if(!f.connection_url){Ut.error("This MCP Server cannot be connected: no connection URL available");return}return await n.create.mutateAsync(f),{id:f.id,connection:f}},isInstalling:n.create.isPending}}function Y(t){return typeof t!="object"||t===null||typeof t.lastModified=="number"&&typeof File<"u"&&t instanceof File||typeof t.getMonth=="function"&&typeof Date<"u"&&t instanceof Date?!1:!Array.isArray(t)}function Ed(t){return t.additionalItems===!0&&console.warn("additionalItems=true is currently not supported"),Y(t.additionalItems)}function ps(t){if(t==="")return;if(t===null)return null;if(/\.$/.test(t)||/\.0$/.test(t)||/\.\d*0$/.test(t))return t;const e=Number(t);return typeof e=="number"&&!Number.isNaN(e)?e:t}const Qe="__additional_property",Zn="additionalProperties",pt="allOf",J="anyOf",Ce="const",ir="default",xi="dependencies",Id="enum",xe="__errors",oe="$id",bi="if",zt="items",Dd="_$junk_option_schema_id$_",qn="$name",q="oneOf",qr="patternProperties",te="properties",vr="readonly",sa="required",Qn="submitButtonOptions",ce="$ref",cn="$schema",oa="root",aa="_",$d=["discriminator","propertyName"],gs="formContext",kd="layoutGridLookupMap",vi="__rjsf_additionalProperties",la="__rjsf_rootSchema",Md="ui:field",Si="ui:widget",ut="ui:options",Kr="ui:globalOptions",Rd="https://json-schema.org/draft/2019-09/schema",Kn="https://json-schema.org/draft/2020-12/schema";function U(t={},e={}){return t?Object.keys(t).filter(n=>n.indexOf("ui:")===0).reduce((n,r)=>{const i=t[r];return r===Si&&Y(i)?(console.error("Setting options via ui:widget object is no longer supported, use ui:options instead"),n):r===ut&&Y(i)?{...n,...i}:{...n,[r.substring(3)]:i}},{...e}):{...e}}function ca(t,e={},n){if(!(t.additionalProperties||t.patternProperties))return!1;const{expandable:r=!0}=U(e);return r===!1?r:t.maxProperties!==void 0&&n?Object.keys(n).length<t.maxProperties:!0}var ua=typeof global=="object"&&global&&global.Object===Object&&global,Bd=typeof self=="object"&&self&&self.Object===Object&&self,Ye=ua||Bd||Function("return this")(),Ne=Ye.Symbol,da=Object.prototype,Ud=da.hasOwnProperty,Ld=da.toString,on=Ne?Ne.toStringTag:void 0;function Wd(t){var e=Ud.call(t,on),n=t[on];try{t[on]=void 0;var r=!0}catch{}var i=Ld.call(t);return r&&(e?t[on]=n:delete t[on]),i}var Vd=Object.prototype,zd=Vd.toString;function qd(t){return zd.call(t)}var Kd="[object Null]",Gd="[object Undefined]",ys=Ne?Ne.toStringTag:void 0;function tt(t){return t==null?t===void 0?Gd:Kd:ys&&ys in Object(t)?Wd(t):qd(t)}function fa(t,e){return function(n){return t(e(n))}}var sr=fa(Object.getPrototypeOf,Object);function Te(t){return t!=null&&typeof t=="object"}var Hd="[object Object]",Yd=Function.prototype,Xd=Object.prototype,ma=Yd.toString,Jd=Xd.hasOwnProperty,Zd=ma.call(Object);function gt(t){if(!Te(t)||tt(t)!=Hd)return!1;var e=sr(t);if(e===null)return!0;var n=Jd.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&ma.call(n)==Zd}function Gr(t){const e={[xe]:[],addError(n){this[xe].push(n)}};if(Array.isArray(t))return t.reduce((n,r,i)=>({...n,[i]:Gr(r)}),e);if(gt(t)){const n=t;return Object.keys(n).reduce((r,i)=>({...r,[i]:Gr(n[i])}),e)}return e}function Qd(){this.__data__=[],this.size=0}function Tn(t,e){return t===e||t!==t&&e!==e}function or(t,e){for(var n=t.length;n--;)if(Tn(t[n][0],e))return n;return-1}var ef=Array.prototype,tf=ef.splice;function nf(t){var e=this.__data__,n=or(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():tf.call(e,n,1),--this.size,!0}function rf(t){var e=this.__data__,n=or(e,t);return n<0?void 0:e[n][1]}function sf(t){return or(this.__data__,t)>-1}function of(t,e){var n=this.__data__,r=or(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function nt(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}nt.prototype.clear=Qd;nt.prototype.delete=nf;nt.prototype.get=rf;nt.prototype.has=sf;nt.prototype.set=of;function af(){this.__data__=new nt,this.size=0}function lf(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function cf(t){return this.__data__.get(t)}function uf(t){return this.__data__.has(t)}function Z(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var df="[object AsyncFunction]",ff="[object Function]",mf="[object GeneratorFunction]",hf="[object Proxy]";function Fn(t){if(!Z(t))return!1;var e=tt(t);return e==ff||e==mf||e==df||e==hf}var Sr=Ye["__core-js_shared__"],xs=(function(){var t=/[^.]+$/.exec(Sr&&Sr.keys&&Sr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function pf(t){return!!xs&&xs in t}var gf=Function.prototype,yf=gf.toString;function Ct(t){if(t!=null){try{return yf.call(t)}catch{}try{return t+""}catch{}}return""}var xf=/[\\^$.*+?()[\]{}|]/g,bf=/^\[object .+?Constructor\]$/,vf=Function.prototype,Sf=Object.prototype,wf=vf.toString,jf=Sf.hasOwnProperty,Of=RegExp("^"+wf.call(jf).replace(xf,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Af(t){if(!Z(t)||pf(t))return!1;var e=Fn(t)?Of:bf;return e.test(Ct(t))}function _f(t,e){return t?.[e]}function Nt(t,e){var n=_f(t,e);return Af(n)?n:void 0}var xn=Nt(Ye,"Map"),bn=Nt(Object,"create");function Cf(){this.__data__=bn?bn(null):{},this.size=0}function Nf(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Tf="__lodash_hash_undefined__",Ff=Object.prototype,Pf=Ff.hasOwnProperty;function Ef(t){var e=this.__data__;if(bn){var n=e[t];return n===Tf?void 0:n}return Pf.call(e,t)?e[t]:void 0}var If=Object.prototype,Df=If.hasOwnProperty;function $f(t){var e=this.__data__;return bn?e[t]!==void 0:Df.call(e,t)}var kf="__lodash_hash_undefined__";function Mf(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=bn&&e===void 0?kf:e,this}function jt(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}jt.prototype.clear=Cf;jt.prototype.delete=Nf;jt.prototype.get=Ef;jt.prototype.has=$f;jt.prototype.set=Mf;function Rf(){this.size=0,this.__data__={hash:new jt,map:new(xn||nt),string:new jt}}function Bf(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ar(t,e){var n=t.__data__;return Bf(e)?n[typeof e=="string"?"string":"hash"]:n.map}function Uf(t){var e=ar(this,t).delete(t);return this.size-=e?1:0,e}function Lf(t){return ar(this,t).get(t)}function Wf(t){return ar(this,t).has(t)}function Vf(t,e){var n=ar(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function rt(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}rt.prototype.clear=Rf;rt.prototype.delete=Uf;rt.prototype.get=Lf;rt.prototype.has=Wf;rt.prototype.set=Vf;var zf=200;function qf(t,e){var n=this.__data__;if(n instanceof nt){var r=n.__data__;if(!xn||r.length<zf-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new rt(r)}return n.set(t,e),this.size=n.size,this}function Ee(t){var e=this.__data__=new nt(t);this.size=e.size}Ee.prototype.clear=af;Ee.prototype.delete=lf;Ee.prototype.get=cf;Ee.prototype.has=uf;Ee.prototype.set=qf;var Kf="__lodash_hash_undefined__";function Gf(t){return this.__data__.set(t,Kf),this}function Hf(t){return this.__data__.has(t)}function Ot(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new rt;++e<n;)this.add(t[e])}Ot.prototype.add=Ot.prototype.push=Gf;Ot.prototype.has=Hf;function Yf(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function vn(t,e){return t.has(e)}var Xf=1,Jf=2;function ha(t,e,n,r,i,s){var a=n&Xf,o=t.length,l=e.length;if(o!=l&&!(a&&l>o))return!1;var d=s.get(t),f=s.get(e);if(d&&f)return d==e&&f==t;var u=-1,h=!0,g=n&Jf?new Ot:void 0;for(s.set(t,e),s.set(e,t);++u<o;){var m=t[u],p=e[u];if(r)var y=a?r(p,m,u,e,t,s):r(m,p,u,t,e,s);if(y!==void 0){if(y)continue;h=!1;break}if(g){if(!Yf(e,function(x,S){if(!vn(g,S)&&(m===x||i(m,x,n,r,s)))return g.push(S)})){h=!1;break}}else if(!(m===p||i(m,p,n,r,s))){h=!1;break}}return s.delete(t),s.delete(e),h}var er=Ye.Uint8Array;function Zf(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function wi(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var Qf=1,em=2,tm="[object Boolean]",nm="[object Date]",rm="[object Error]",im="[object Map]",sm="[object Number]",om="[object RegExp]",am="[object Set]",lm="[object String]",cm="[object Symbol]",um="[object ArrayBuffer]",dm="[object DataView]",bs=Ne?Ne.prototype:void 0,wr=bs?bs.valueOf:void 0;function fm(t,e,n,r,i,s,a){switch(n){case dm:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case um:return!(t.byteLength!=e.byteLength||!s(new er(t),new er(e)));case tm:case nm:case sm:return Tn(+t,+e);case rm:return t.name==e.name&&t.message==e.message;case om:case lm:return t==e+"";case im:var o=Zf;case am:var l=r&Qf;if(o||(o=wi),t.size!=e.size&&!l)return!1;var d=a.get(t);if(d)return d==e;r|=em,a.set(t,e);var f=ha(o(t),o(e),r,i,s,a);return a.delete(t),f;case cm:if(wr)return wr.call(t)==wr.call(e)}return!1}function ji(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var ye=Array.isArray;function pa(t,e,n){var r=e(t);return ye(t)?r:ji(r,n(t))}function mm(t,e){for(var n=-1,r=t==null?0:t.length,i=0,s=[];++n<r;){var a=t[n];e(a,n,t)&&(s[i++]=a)}return s}function ga(){return[]}var hm=Object.prototype,pm=hm.propertyIsEnumerable,vs=Object.getOwnPropertySymbols,Oi=vs?function(t){return t==null?[]:(t=Object(t),mm(vs(t),function(e){return pm.call(t,e)}))}:ga;function ya(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var gm="[object Arguments]";function Ss(t){return Te(t)&&tt(t)==gm}var xa=Object.prototype,ym=xa.hasOwnProperty,xm=xa.propertyIsEnumerable,qt=Ss((function(){return arguments})())?Ss:function(t){return Te(t)&&ym.call(t,"callee")&&!xm.call(t,"callee")};function bm(){return!1}var ba=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ws=ba&&typeof module=="object"&&module&&!module.nodeType&&module,vm=ws&&ws.exports===ba,js=vm?Ye.Buffer:void 0,Sm=js?js.isBuffer:void 0,At=Sm||bm,wm=9007199254740991,jm=/^(?:0|[1-9]\d*)$/;function lr(t,e){var n=typeof t;return e=e??wm,!!e&&(n=="number"||n!="symbol"&&jm.test(t))&&t>-1&&t%1==0&&t<e}var Om=9007199254740991;function Ai(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Om}var Am="[object Arguments]",_m="[object Array]",Cm="[object Boolean]",Nm="[object Date]",Tm="[object Error]",Fm="[object Function]",Pm="[object Map]",Em="[object Number]",Im="[object Object]",Dm="[object RegExp]",$m="[object Set]",km="[object String]",Mm="[object WeakMap]",Rm="[object ArrayBuffer]",Bm="[object DataView]",Um="[object Float32Array]",Lm="[object Float64Array]",Wm="[object Int8Array]",Vm="[object Int16Array]",zm="[object Int32Array]",qm="[object Uint8Array]",Km="[object Uint8ClampedArray]",Gm="[object Uint16Array]",Hm="[object Uint32Array]",ue={};ue[Um]=ue[Lm]=ue[Wm]=ue[Vm]=ue[zm]=ue[qm]=ue[Km]=ue[Gm]=ue[Hm]=!0;ue[Am]=ue[_m]=ue[Rm]=ue[Cm]=ue[Bm]=ue[Nm]=ue[Tm]=ue[Fm]=ue[Pm]=ue[Em]=ue[Im]=ue[Dm]=ue[$m]=ue[km]=ue[Mm]=!1;function Ym(t){return Te(t)&&Ai(t.length)&&!!ue[tt(t)]}function _i(t){return function(e){return t(e)}}var va=typeof exports=="object"&&exports&&!exports.nodeType&&exports,fn=va&&typeof module=="object"&&module&&!module.nodeType&&module,Xm=fn&&fn.exports===va,jr=Xm&&ua.process,Kt=(function(){try{var t=fn&&fn.require&&fn.require("util").types;return t||jr&&jr.binding&&jr.binding("util")}catch{}})(),Os=Kt&&Kt.isTypedArray,Pn=Os?_i(Os):Ym,Jm=Object.prototype,Zm=Jm.hasOwnProperty;function Sa(t,e){var n=ye(t),r=!n&&qt(t),i=!n&&!r&&At(t),s=!n&&!r&&!i&&Pn(t),a=n||r||i||s,o=a?ya(t.length,String):[],l=o.length;for(var d in t)(e||Zm.call(t,d))&&!(a&&(d=="length"||i&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||lr(d,l)))&&o.push(d);return o}var Qm=Object.prototype;function cr(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Qm;return t===n}var eh=fa(Object.keys,Object),th=Object.prototype,nh=th.hasOwnProperty;function wa(t){if(!cr(t))return eh(t);var e=[];for(var n in Object(t))nh.call(t,n)&&n!="constructor"&&e.push(n);return e}function Tt(t){return t!=null&&Ai(t.length)&&!Fn(t)}function Pe(t){return Tt(t)?Sa(t):wa(t)}function Hr(t){return pa(t,Pe,Oi)}var rh=1,ih=Object.prototype,sh=ih.hasOwnProperty;function oh(t,e,n,r,i,s){var a=n&rh,o=Hr(t),l=o.length,d=Hr(e),f=d.length;if(l!=f&&!a)return!1;for(var u=l;u--;){var h=o[u];if(!(a?h in e:sh.call(e,h)))return!1}var g=s.get(t),m=s.get(e);if(g&&m)return g==e&&m==t;var p=!0;s.set(t,e),s.set(e,t);for(var y=a;++u<l;){h=o[u];var x=t[h],S=e[h];if(r)var j=a?r(S,x,h,e,t,s):r(x,S,h,t,e,s);if(!(j===void 0?x===S||i(x,S,n,r,s):j)){p=!1;break}y||(y=h=="constructor")}if(p&&!y){var b=t.constructor,v=e.constructor;b!=v&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof v=="function"&&v instanceof v)&&(p=!1)}return s.delete(t),s.delete(e),p}var Yr=Nt(Ye,"DataView"),Xr=Nt(Ye,"Promise"),Lt=Nt(Ye,"Set"),Jr=Nt(Ye,"WeakMap"),As="[object Map]",ah="[object Object]",_s="[object Promise]",Cs="[object Set]",Ns="[object WeakMap]",Ts="[object DataView]",lh=Ct(Yr),ch=Ct(xn),uh=Ct(Xr),dh=Ct(Lt),fh=Ct(Jr),_e=tt;(Yr&&_e(new Yr(new ArrayBuffer(1)))!=Ts||xn&&_e(new xn)!=As||Xr&&_e(Xr.resolve())!=_s||Lt&&_e(new Lt)!=Cs||Jr&&_e(new Jr)!=Ns)&&(_e=function(t){var e=tt(t),n=e==ah?t.constructor:void 0,r=n?Ct(n):"";if(r)switch(r){case lh:return Ts;case ch:return As;case uh:return _s;case dh:return Cs;case fh:return Ns}return e});var mh=1,Fs="[object Arguments]",Ps="[object Array]",Un="[object Object]",hh=Object.prototype,Es=hh.hasOwnProperty;function ph(t,e,n,r,i,s){var a=ye(t),o=ye(e),l=a?Ps:_e(t),d=o?Ps:_e(e);l=l==Fs?Un:l,d=d==Fs?Un:d;var f=l==Un,u=d==Un,h=l==d;if(h&&At(t)){if(!At(e))return!1;a=!0,f=!1}if(h&&!f)return s||(s=new Ee),a||Pn(t)?ha(t,e,n,r,i,s):fm(t,e,l,n,r,i,s);if(!(n&mh)){var g=f&&Es.call(t,"__wrapped__"),m=u&&Es.call(e,"__wrapped__");if(g||m){var p=g?t.value():t,y=m?e.value():e;return s||(s=new Ee),i(p,y,n,r,s)}}return h?(s||(s=new Ee),oh(t,e,n,r,i,s)):!1}function En(t,e,n,r,i){return t===e?!0:t==null||e==null||!Te(t)&&!Te(e)?t!==t&&e!==e:ph(t,e,n,r,En,i)}function gh(t,e,n){n=typeof n=="function"?n:void 0;var r=n?n(t,e):void 0;return r===void 0?En(t,e,void 0,n):!!r}function le(t,e){return gh(t,e,(n,r)=>{if(typeof n=="function"&&typeof r=="function")return!0})}var yh="[object Symbol]";function In(t){return typeof t=="symbol"||Te(t)&&tt(t)==yh}var xh=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bh=/^\w*$/;function Ci(t,e){if(ye(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||In(t)?!0:bh.test(t)||!xh.test(t)||e!=null&&t in Object(e)}var vh="Expected a function";function Ni(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(vh);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=t.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(Ni.Cache||rt),n}Ni.Cache=rt;var Sh=500;function wh(t){var e=Ni(t,function(r){return n.size===Sh&&n.clear(),r}),n=e.cache;return e}var jh=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Oh=/\\(\\)?/g,ja=wh(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(jh,function(n,r,i,s){e.push(i?s.replace(Oh,"$1"):r||n)}),e});function Xt(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var Is=Ne?Ne.prototype:void 0,Ds=Is?Is.toString:void 0;function Oa(t){if(typeof t=="string")return t;if(ye(t))return Xt(t,Oa)+"";if(In(t))return Ds?Ds.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Ti(t){return t==null?"":Oa(t)}function Jt(t,e){return ye(t)?t:Ci(t,e)?[t]:ja(Ti(t))}function Ft(t){if(typeof t=="string"||In(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function ur(t,e){e=Jt(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Ft(e[n++])];return n&&n==r?t:void 0}function I(t,e,n){var r=t==null?void 0:ur(t,e);return r===void 0?n:r}var Ah=Object.prototype,_h=Ah.hasOwnProperty;function Ch(t,e){return t!=null&&_h.call(t,e)}function Aa(t,e,n){e=Jt(e,t);for(var r=-1,i=e.length,s=!1;++r<i;){var a=Ft(e[r]);if(!(s=t!=null&&n(t,a)))break;t=t[a]}return s||++r!=i?s:(i=t==null?0:t.length,!!i&&Ai(i)&&lr(a,i)&&(ye(t)||qt(t)))}function X(t,e){return t!=null&&Aa(t,e,Ch)}function dt(t,e){return En(t,e)}var tr=(function(){try{var t=Nt(Object,"defineProperty");return t({},"",{}),t}catch{}})();function Fi(t,e,n){e=="__proto__"&&tr?tr(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var Nh=Object.prototype,Th=Nh.hasOwnProperty;function Pi(t,e,n){var r=t[e];(!(Th.call(t,e)&&Tn(r,n))||n===void 0&&!(e in t))&&Fi(t,e,n)}function Ei(t,e,n,r){if(!Z(t))return t;e=Jt(e,t);for(var i=-1,s=e.length,a=s-1,o=t;o!=null&&++i<s;){var l=Ft(e[i]),d=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=a){var f=o[l];d=r?r(f,l,o):void 0,d===void 0&&(d=Z(f)?f:lr(e[i+1])?[]:{})}Pi(o,l,d),o=o[l]}return t}function se(t,e,n){return t==null?t:Ei(t,e,n)}function dr(t){return t}function _a(t){return typeof t=="function"?t:dr}var Fh=/\s/;function Ph(t){for(var e=t.length;e--&&Fh.test(t.charAt(e)););return e}var Eh=/^\s+/;function Ih(t){return t&&t.slice(0,Ph(t)+1).replace(Eh,"")}var $s=NaN,Dh=/^[-+]0x[0-9a-f]+$/i,$h=/^0b[01]+$/i,kh=/^0o[0-7]+$/i,Mh=parseInt;function Rh(t){if(typeof t=="number")return t;if(In(t))return $s;if(Z(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Z(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Ih(t);var n=$h.test(t);return n||kh.test(t)?Mh(t.slice(2),n?2:8):Dh.test(t)?$s:+t}var ks=1/0,Bh=17976931348623157e292;function Uh(t){if(!t)return t===0?t:0;if(t=Rh(t),t===ks||t===-ks){var e=t<0?-1:1;return e*Bh}return t===t?t:0}function Ca(t){var e=Uh(t),n=e%1;return e===e?n?e-n:e:0}var Lh=9007199254740991,Or=4294967295,Wh=Math.min;function Na(t,e){if(t=Ca(t),t<1||t>Lh)return[];var n=Or,r=Wh(t,Or);e=_a(e),t-=Or;for(var i=ya(r,e);++n<t;)e(n);return i}function Ii(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}var Ms=Object.create,Ta=(function(){function t(){}return function(e){if(!Z(e))return{};if(Ms)return Ms(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();function Vh(t){return function(e,n,r){for(var i=-1,s=Object(e),a=r(e),o=a.length;o--;){var l=a[++i];if(n(s[l],l,s)===!1)break}return e}}var Fa=Vh();function Pa(t,e){return t&&Fa(t,e,Pe)}var zh=1,qh=2;function Kh(t,e,n,r){var i=n.length,s=i;if(t==null)return!s;for(t=Object(t);i--;){var a=n[i];if(a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<s;){a=n[i];var o=a[0],l=t[o],d=a[1];if(a[2]){if(l===void 0&&!(o in t))return!1}else{var f=new Ee,u;if(!(u===void 0?En(d,l,zh|qh,r,f):u))return!1}}return!0}function Ea(t){return t===t&&!Z(t)}function Gh(t){for(var e=Pe(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,Ea(i)]}return e}function Ia(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function Hh(t){var e=Gh(t);return e.length==1&&e[0][2]?Ia(e[0][0],e[0][1]):function(n){return n===t||Kh(n,t,e)}}function Yh(t,e){return t!=null&&e in Object(t)}function Da(t,e){return t!=null&&Aa(t,e,Yh)}var Xh=1,Jh=2;function Zh(t,e){return Ci(t)&&Ea(e)?Ia(Ft(t),e):function(n){var r=I(n,t);return r===void 0&&r===e?Da(n,t):En(e,r,Xh|Jh)}}function Qh(t){return function(e){return e?.[t]}}function ep(t){return function(e){return ur(e,t)}}function tp(t){return Ci(t)?Qh(Ft(t)):ep(t)}function Di(t){return typeof t=="function"?t:t==null?dr:typeof t=="object"?ye(t)?Zh(t[0],t[1]):Hh(t):tp(t)}function np(t,e,n){var r=ye(t),i=r||At(t)||Pn(t);if(e=Di(e),n==null){var s=t&&t.constructor;i?n=r?new s:[]:Z(t)?n=Fn(s)?Ta(sr(t)):{}:n={}}return(i?Ii:Pa)(t,function(a,o,l){return e(n,a,o,l)}),n}function Zr(t,e,n){(n!==void 0&&!Tn(t[e],n)||n===void 0&&!(e in t))&&Fi(t,e,n)}var $a=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Rs=$a&&typeof module=="object"&&module&&!module.nodeType&&module,rp=Rs&&Rs.exports===$a,Bs=rp?Ye.Buffer:void 0,Us=Bs?Bs.allocUnsafe:void 0;function ka(t,e){if(e)return t.slice();var n=t.length,r=Us?Us(n):new t.constructor(n);return t.copy(r),r}function $i(t){var e=new t.constructor(t.byteLength);return new er(e).set(new er(t)),e}function Ma(t,e){var n=e?$i(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function ki(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function Ra(t){return typeof t.constructor=="function"&&!cr(t)?Ta(sr(t)):{}}function Sn(t){return Te(t)&&Tt(t)}function Qr(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Zt(t,e,n,r){var i=!n;n||(n={});for(var s=-1,a=e.length;++s<a;){var o=e[s],l=void 0;l===void 0&&(l=t[o]),i?Fi(n,o,l):Pi(n,o,l)}return n}function ip(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var sp=Object.prototype,op=sp.hasOwnProperty;function ap(t){if(!Z(t))return ip(t);var e=cr(t),n=[];for(var r in t)r=="constructor"&&(e||!op.call(t,r))||n.push(r);return n}function Dn(t){return Tt(t)?Sa(t,!0):ap(t)}function lp(t){return Zt(t,Dn(t))}function cp(t,e,n,r,i,s,a){var o=Qr(t,n),l=Qr(e,n),d=a.get(l);if(d){Zr(t,n,d);return}var f=s?s(o,l,n+"",t,e,a):void 0,u=f===void 0;if(u){var h=ye(l),g=!h&&At(l),m=!h&&!g&&Pn(l);f=l,h||g||m?ye(o)?f=o:Sn(o)?f=ki(o):g?(u=!1,f=ka(l,!0)):m?(u=!1,f=Ma(l,!0)):f=[]:gt(l)||qt(l)?(f=o,qt(o)?f=lp(o):(!Z(o)||Fn(o))&&(f=Ra(l))):u=!1}u&&(a.set(l,f),i(f,l,r,s,a),a.delete(l)),Zr(t,n,f)}function Ba(t,e,n,r,i){t!==e&&Fa(e,function(s,a){if(i||(i=new Ee),Z(s))cp(t,e,a,n,Ba,r,i);else{var o=r?r(Qr(t,a),s,a+"",t,e,i):void 0;o===void 0&&(o=s),Zr(t,a,o)}},Dn)}function up(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var Ls=Math.max;function Ua(t,e,n){return e=Ls(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=Ls(r.length-e,0),a=Array(s);++i<s;)a[i]=r[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=r[i];return o[e]=n(a),up(t,this,o)}}function dp(t){return function(){return t}}var fp=tr?function(t,e){return tr(t,"toString",{configurable:!0,enumerable:!1,value:dp(e),writable:!0})}:dr,mp=800,hp=16,pp=Date.now;function gp(t){var e=0,n=0;return function(){var r=pp(),i=hp-(r-n);if(n=r,i>0){if(++e>=mp)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var La=gp(fp);function fr(t,e){return La(Ua(t,e,dr),t+"")}function yp(t,e,n){if(!Z(n))return!1;var r=typeof e;return(r=="number"?Tt(n)&&lr(e,n.length):r=="string"&&e in n)?Tn(n[e],t):!1}function xp(t){return fr(function(e,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=t.length>3&&typeof s=="function"?(i--,s):void 0,a&&yp(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),e=Object(e);++r<i;){var o=n[r];o&&t(e,o,r,s)}return e})}var bp=xp(function(t,e,n){Ba(t,e,n)}),Ws=Ne?Ne.isConcatSpreadable:void 0;function vp(t){return ye(t)||qt(t)||!!(Ws&&t&&t[Ws])}function $n(t,e,n,r,i){var s=-1,a=t.length;for(n||(n=vp),i||(i=[]);++s<a;){var o=t[s];e>0&&n(o)?e>1?$n(o,e-1,n,r,i):ji(i,o):r||(i[i.length]=o)}return i}var Sp=1/0;function wp(t){var e=t==null?0:t.length;return e?$n(t,Sp):[]}function jp(t,e,n,r){for(var i=t.length,s=n+-1;++s<i;)if(e(t[s],s,t))return s;return-1}function Op(t){return t!==t}function Ap(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function Wa(t,e,n){return e===e?Ap(t,e,n):jp(t,Op,n)}function Mi(t,e){var n=t==null?0:t.length;return!!n&&Wa(t,e,0)>-1}function Gn(){}var _p=1/0,Cp=Lt&&1/wi(new Lt([,-0]))[1]==_p?function(t){return new Lt(t)}:Gn,Np=200;function Va(t,e,n){var r=-1,i=Mi,s=t.length,a=!0,o=[],l=o;if(s>=Np){var d=Cp(t);if(d)return wi(d);a=!1,i=vn,l=new Ot}else l=o;e:for(;++r<s;){var f=t[r],u=f;if(f=f!==0?f:0,a&&u===u){for(var h=l.length;h--;)if(l[h]===u)continue e;o.push(f)}else i(l,u,n)||(l!==o&&l.push(u),o.push(f))}return o}function za(t){return t&&t.length?Va(t):[]}var Tp="[object Map]",Fp="[object Set]",Pp=Object.prototype,Ep=Pp.hasOwnProperty;function me(t){if(t==null)return!0;if(Tt(t)&&(ye(t)||typeof t=="string"||typeof t.splice=="function"||At(t)||Pn(t)||qt(t)))return!t.length;var e=_e(t);if(e==Tp||e==Fp)return!t.size;if(cr(t))return!wa(t).length;for(var n in t)if(Ep.call(t,n))return!1;return!0}const Ip=Object.prototype;function un(t){for(const e in t)if(Ip.hasOwnProperty.call(t,e))return!1;return!0}const Dp=["array","boolean","integer","null","number","object","string"];new Set(Dp);const $p=["$defs","definitions","properties","patternProperties","dependencies"];new Set($p);const kp=["items","allOf","oneOf","anyOf"];new Set(kp);const Mp=["items","additionalItems","additionalProperties","propertyNames","contains","if","then","else","not"];new Set(Mp);function Hn(t){return typeof t=="object"}function Le(t){return Hn(t)?un(t):t===!0}function Bt(t,e){return t<e?-1:t>e?1:0}function Ar(t,e){const n=t.length;if(n===0)return e;let r=e.length;if(r===0)return t;if(n<r){const s=t;t=e,e=s,r=n}const i=new Set(t);for(let s=0;s<r;s++)i.add(e[s]);return Array.from(i)}function Rp(t,e){const n=[];if(t.length===0||e.length===0)return n;if(t.length>e.length){const i=t;t=e,e=i}const r=new Set(e);for(let i=0;i<t.length&&r.size>0;i++){const s=t[i];r.delete(s)&&n.push(s)}return n}function Vs(t){return t.length===0}function _r(t){return(e,n)=>{const r=e.length-n.length;if(r!==0)return r;for(let i=0;i<e.length;i++)if(e[i]!==n[i]){const s=t(e[i],n[i]);if(s!==0)return s}return 0}}function qa(t,{threshold:e=12}={}){return n=>{const r=n.length;if(r===0)return n;if(r<=e){const a=[];let o=0;e:for(let l=0;l<r;l++){const d=n[l];for(let f=0;f<o;f++)if(t(d,a[f])===0)continue e;o=a.push(d)}return a}const i=n.slice().sort(t);let s=0;for(let a=1;a<r;a++)t(i[s],i[a])!==0&&++s!==a&&(i[s]=i[a]);return i.length=s+1,i}}function Bp(t){return(e,n)=>{const r=[];let i=e.length,s=n.length;if(i===0||s===0)return r;if(i>s){const f=e;e=n,n=f;const u=i;i=s,s=u}const a=[...e].sort(t),o=[...n].sort(t);let l=0,d=0;for(;l<i&&d<s;){const f=t(a[l],o[d]);f===0?((r.length===0||t(r[r.length-1],a[l])!==0)&&r.push(a[l]),l++,d++):f<0?l++:d++}return r}}function Up(t,e){return n=>{if(t.has(n))return t.get(n);const r=e(n);return t.set(n,r),r}}const zs=Up,Ka=()=>0,Lp=t=>t===void 0,Wp=t=>typeof t!="object",qs={boolean:0,number:1,string:2};function Vp(t,e){const n=typeof t,r=typeof e;return n===r?Bt(t,e):qs[n]-qs[r]}function zp(t,e){const n=t.length;if(n===0)return e;const r=e.length;if(r===0)return t;if(r>n){const a=t;t=e,e=a}const i=new Set(t),s=e.length;for(let a=0;a<s;a++){const o=e[a];i.has(o)||t.push(o)}return t}function mr(t,e,n=Ka){return(r,i)=>t(r)?t(i)?n(r,i):-1:t(i)?1:e(r,i)}function Mt(t){return mr(Lp,t)}function ot(t,e){return mr(n=>n===void 0||t(n),e)}function Cr(t,e){return mr(Array.isArray,t,e)}const he=Mt(Bt),Nr=ot(t=>t===0,(t,e)=>t-e);function qp({deduplicationCache:t=new WeakMap,sortedKeysCache:e=new WeakMap}={}){const n=zs(e,p=>Object.keys(p).sort());function r(p){return(y,x)=>{const S=n(y),j=n(x),b=Math.min(S.length,j.length);for(let v=0;v<b;v++){const w=Bt(S[v],j[v]);if(w!==0)return w}if(S.length!==j.length)return S.length-j.length;for(let v=0;v<b;v++){const w=S[v],O=p(y[w],x[w]);if(O!==0)return O}return 0}}function i(p){const y=_r(p),x=zs(t,qa(p,{threshold:0}));return(S,j)=>y(x(S),x(j))}const s=i(Bt);function a(p,y){if(Hn(p)){if(Hn(y)){const x=Object.keys(p),S=Object.keys(y),j=zp(x,S),b=j.length;for(let v=0;v<b;v++){const w=j[v];if(p[w]===y[w])continue;const A=(m[w]??o)(p[w],y[w]);if(A!==0)return A}return 0}return y===!0&&un(p)?0:1}return Hn(y)?p===!0&&un(y)?0:-1:Bt(p,y)}const o=Mt(d),l=mr(Wp,Cr(r(o),_r(d)),Vp);function d(p,y){return p===null?-1:y===null?1:l(p,y)}const f=Mt(a),u=ot(un,r(f)),h=Mt(i(a)),g=ot(Le,a),m={$id:he,$comment:he,$defs:u,$ref:he,$schema:he,const:o,contains:f,contentEncoding:he,contentMediaType:he,default:o,definitions:u,description:he,else:f,examples:o,exclusiveMaximum:he,exclusiveMinimum:he,format:he,if:f,maximum:he,maxItems:he,maxLength:he,maxProperties:he,minimum:he,multipleOf:he,not:f,pattern:he,propertyNames:f,readOnly:he,then:f,title:he,writeOnly:he,uniqueItems:ot(p=>p===!1,Ka),minLength:Nr,minItems:Nr,minProperties:Nr,required:ot(Vs,s),enum:ot(Vs,i(d)),type:Mt((p,y)=>{const x=Array.isArray(p),S=Array.isArray(y);return!x&&!S?Bt(p,y):s(x?p:[p],S?y:[y])}),items:ot(p=>!Array.isArray(p)&&Le(p),Cr(a,_r(a))),anyOf:h,allOf:h,oneOf:h,properties:u,patternProperties:u,additionalProperties:g,additionalItems:g,dependencies:ot(un,r(Mt(Cr(a,s))))};return{compareSchemaValues:d,compareSchemaDefinitions:a}}function Ks(t){return t}const Ga=(t,e)=>t?Ga(e%t,t):e,Kp=(t,e)=>Math.abs(t*e)/Ga(t,e);function Gp(t,e){return t===e?t:`^(?=.*(?:${t}))(?=.*(?:${e})).*$`}function*Tr(t,e,n){const r=t.length,i=e.length;if(r>0&&i>0)for(let s=0;s<r;s++){const a=t[s];for(let o=0;o<i;o++)yield n(a,e[o])}}function Fr(t,e){return t||e}function Gs(t){return(e,n)=>{const r={...e},i=Object.keys(n),s=i.length;for(let a=0;a<s;a++){const o=i[a];r[o]=e[o]===void 0?n[o]:t(e[o],n[o])}return r}}function Hp(t){const e=new Map;for(const n of t)for(const r of n[0])e.set(r,n[1]);return e}function bt(t,e,n){n===void 0||Le(n)?delete t[e]:t[e]=n}const Yp=["properties","patternProperties","additionalProperties"];function Hs(t){const e=Object.keys(t),n=e.length,r=[];for(let i=0;i<n;i++){const s=e[i];r.push({regExp:new RegExp(s),schema:t[s]})}return[r,e]}const Ys=[[],[]];function Xs(t,e,n){const r=n.length;for(let i=0;i<r;i++){const s=n[i];if(!s.regExp.test(e))continue;const a=s.schema;if(a===!1)return!0;t.push(a)}return!1}const Xp=["items","additionalItems"],Jp=["if","then","else"];function Js(t,e){return e.if!==void 0&&(t.if=e.if),e.then!==void 0&&(t.then=e.then),e.else!==void 0&&(t.else=e.else),t}function Pr(t,e){if(t===e)return t;switch(t){case"number":if(e==="integer")return"integer";case"integer":if(e==="number")return"integer";default:return}}function vt(t,e,n){return[t,e,n]}function Zp(t){const e=new Map;for(const[n,r,i]of t){const s=a=>{if(!i(a))throw new Error(`Schema keys '${n}' and '${r}' are conflicting (${n}: ${JSON.stringify(a[n])}, ${r}: ${JSON.stringify(a[r])})`)};for(const a of[[n,r],[r,n]]){let o=e.get(a[0]);o===void 0&&(o=[],e.set(a[0],o)),o.push({oppositeKey:a[1],check:s})}}return e}const Qp=[vt("minimum","maximum",t=>t.maximum>=t.minimum),vt("exclusiveMinimum","maximum",t=>t.maximum>t.exclusiveMinimum),vt("minimum","exclusiveMaximum",t=>t.exclusiveMaximum>t.minimum),vt("exclusiveMinimum","exclusiveMaximum",t=>t.exclusiveMaximum>t.exclusiveMinimum),vt("minLength","maxLength",t=>t.maxLength>=t.minLength),vt("minItems","maxItems",t=>t.maxItems>=t.minItems),vt("minProperties","maxProperties",t=>t.maxProperties>=t.minProperties)];function eg({mergePatterns:t=Gp,isSubRegExp:e=Object.is,intersectJson:n=Rp,deduplicateJsonSchemaDef:r=Ks,defaultMerger:i=Ks,assigners:s=[],checks:a=Qp,mergers:o}={}){function l(b){const v=b.length;let w=b[0];for(let O=1;O<v;O++){const A=x(w,b[O]);if(A===!1)return!1;Le(A)||(w=A)}return w}function d(b,v,w,O,A,_,T){if(b.length=0,w===!1)return!1;if(b.push(w),A!==void 0){if(A===!1)return!1;b.push(A)}if(Xs(b,v,_))return!1;const C=b.length<2;if(T===!1){if(C)return;if(Xs(b,v,O))return!1}else C&&T!==void 0&&b.push(T);return b.length===1?b[0]:l(b)}function f(b,v,w,O,A,_){const T=w.length;if(T>0&&A!==!1)if(_)Object.assign(b,v);else for(let N=0;N<T;N++){const C=w[N];O.has(C)||(b[C]=x(v[C],A))}return b}const u=(b,{properties:v={},patternProperties:w,additionalProperties:O=!0},{properties:A={},patternProperties:_,additionalProperties:T=!0})=>{const N=Le(O),C=Le(T);if(N&&C)return bt(b,"properties",S(v,A)),bt(b,"patternProperties",w&&_?S(w,_):w??_),delete b.additionalProperties,b;const F=x(O,T);bt(b,"additionalProperties",F);const $={},E=Object.keys(v),D=E.length,[M,k]=w?Hs(w):Ys,[B,V]=_?Hs(_):Ys,R=[],W=new Set,Q=C?void 0:T;for(let H=0;H<D;H++){const re=E[H];W.add(re);const fe=d(R,re,v[re],M,A[re],B,Q);fe!==void 0&&($[re]=fe)}const ne=Object.keys(A),ie=ne.length,de=N?void 0:O;for(let H=0;H<ie;H++){const re=ne[H];if(W.has(re))continue;const fe=d(R,re,A[re],B,void 0,M,de);fe!==void 0&&($[re]=fe)}bt(b,"properties",$);let ee={};const z=new Set;if(k.length>0&&V.length>0){const H=Tr(k,V,(re,fe)=>{e(re,fe)&&z.add(re),e(fe,re)&&z.add(fe),ee[t(re,fe)]=x(w[re],_[fe])});for(;!H.next().done;);}return ee=f(ee,w,k,z,T,C),ee=f(ee,_,V,z,O,N),bt(b,"patternProperties",ee),b},h=(b,{items:v=[],additionalItems:w},{items:O=[],additionalItems:A})=>{const _=Array.isArray(v),T=Array.isArray(O),N=[];if(b.items=N,_&&T){const[C,F,$]=v.length<O.length?[v.length,w,O]:[O.length,A,v];let E=0;for(;E<C;E++)N.push(x(v[E],O[E]));if(F===!1)b.additionalItems=!1;else{const D=F===void 0||Le(F);for(;E<$.length;E++)N.push(D?$[E]:x($[E],F));bt(b,"additionalItems",w!==void 0&&A!==void 0?x(w,A):w??A)}}else if(_||T){const[C,F,$]=_?[v,O,w]:[O,v,A];bt(b,"additionalItems",$&&x($,F));for(let E=0;E<C.length;E++)N.push(x(C[E],F))}else delete b.additionalItems,b.items=x(v,O);return b},g=(b,v,w)=>{Js(b,v);const O=Js({},w);return b.allOf===void 0?b.allOf=[O]:b.allOf=b.allOf.concat(O),b};function m(b,v){return r(Array.from(Tr(b,v,x)))}const p=Hp([[Yp,u],[Xp,h],[Jp,g],...s]),y=Zp(a);function x(b,v){if(b===!1||v===!1)return!1;if(Le(b))return Le(v)?!0:v;if(Le(v))return b;let w={...b};const O=new Set,A=new Set,_=Object.keys(v),T=_.length;for(let N=0;N<T;N++){const C=_[N],F=v[C];if(F===void 0)continue;const $=y.get(C);if($!==void 0){const k=$.length;for(let B=0;B<k;B++){const V=$[B];b[V.oppositeKey]!==void 0&&A.add(V.check)}}const E=b[C];if(E===void 0){w[C]=F;continue}const D=p.get(C);if(D){O.add(D);continue}const M=j[C]??i;w[C]=M(E,F)}for(const N of O)w=N(w,b,v);for(const N of A)N(w);return w}const S=Gs(x),j={$id:i,$ref:i,$schema:i,$comment:i,$defs:S,definitions:S,type:(b,v)=>{if(b===v)return b;const w=Array.isArray(b),O=Array.isArray(v);if(!w&&!O){const A=Pr(b,v);if(A!==void 0)return A}else if(w||O){const A=new Set;if(w&&O)for(const T of Tr(b,v,Pr))T!==void 0&&A.add(T);else{const T=w?b:v,N=w?v:b,C=T.length;for(let F=0;F<C;F++){const $=Pr(N,T[F]);$!==void 0&&A.add($)}}const _=A.size;if(_===1)return A.values().next().value;if(_>1)return Array.from(A)}throw new Error(`It is not possible to create an intersection of the following incompatible types: ${b.toString()}, ${v.toString()}`)},default:i,description:i,title:i,const:i,format:i,contentEncoding:i,contentMediaType:i,not:(b,v)=>{const w=r([b,v]);return w.length===1?w[0]:{anyOf:w}},pattern:t,readOnly:Fr,writeOnly:Fr,enum:(b,v)=>{const w=n(b,v);if(w.length===0)throw new Error(`Intersection of the following enums is empty: "${JSON.stringify(b)}", "${JSON.stringify(v)}"`);return w},anyOf:m,oneOf:m,allOf:(b,v)=>r(b.concat(v)),propertyNames:x,contains:x,dependencies:Gs((b,v)=>Array.isArray(b)?Array.isArray(v)?Ar(b,v):x(v,{required:b}):Array.isArray(v)?x(b,{required:v}):x(b,v)),examples:(b,v)=>{if(!Array.isArray(b)||!Array.isArray(v))throw new Error(`Value of the 'examples' field should be an array, but got "${JSON.stringify(b)}" and "${JSON.stringify(v)}"`);return Ar(b,v)},multipleOf:(b,v)=>{let w=1;for(;!Number.isInteger(b)||!Number.isInteger(v);)w*=10,b*=10,v*=10;return Kp(b,v)/w},exclusiveMaximum:Math.min,maximum:Math.min,maxItems:Math.min,maxLength:Math.min,maxProperties:Math.min,exclusiveMinimum:Math.max,minimum:Math.max,minItems:Math.max,minLength:Math.max,minProperties:Math.max,uniqueItems:Fr,required:Ar,...o};return{mergeSchemaDefinitions:x,mergeArrayOfSchemaDefinitions:l}}function tg(t){const e=[],n=[t];for(;n.length>0;){const r=n.pop();if(typeof r=="boolean"||r.allOf===void 0){e.push(r);continue}const{allOf:i,...s}=r;e.push(s);for(let a=i.length-1;a>=0;a--)n.push(i[a])}return e}function ng(t){return e=>t(tg(e))}var an={},Zs;function rg(){if(Zs)return an;Zs=1;var t=/~/,e=/~[01]/g;function n(d){switch(d){case"~1":return"/";case"~0":return"~"}throw new Error("Invalid tilde escape: "+d)}function r(d){return t.test(d)?d.replace(e,n):d}function i(d,f,u){for(var h,g,m=1,p=f.length;m<p;){if(f[m]==="constructor"||f[m]==="prototype"||f[m]==="__proto__")return d;if(h=r(f[m++]),g=p>m,typeof d[h]>"u"&&(Array.isArray(d)&&h==="-"&&(h=d.length),g&&(f[m]!==""&&f[m]<1/0||f[m]==="-"?d[h]=[]:d[h]={})),!g)break;d=d[h]}var y=d[h];return u===void 0?delete d[h]:d[h]=u,y}function s(d){if(typeof d=="string"){if(d=d.split("/"),d[0]==="")return d;throw new Error("Invalid JSON pointer.")}else if(Array.isArray(d)){for(const f of d)if(typeof f!="string"&&typeof f!="number")throw new Error("Invalid JSON pointer. Must be of type string or number.");return d}throw new Error("Invalid JSON pointer.")}function a(d,f){if(typeof d!="object")throw new Error("Invalid input object.");f=s(f);var u=f.length;if(u===1)return d;for(var h=1;h<u;){if(d=d[r(f[h++])],u===h)return d;if(typeof d!="object"||d===null)return}}function o(d,f,u){if(typeof d!="object")throw new Error("Invalid input object.");if(f=s(f),f.length===0)throw new Error("Invalid JSON pointer for set.");return i(d,f,u)}function l(d){var f=s(d);return{get:function(u){return a(u,f)},set:function(u,h){return o(u,f,h)}}}return an.get=a,an.set=o,an.compile=l,an}var ig=rg();const Er=di(ig);function sg(t,e){return t&&Zt(e,Pe(e),t)}function og(t,e){return t&&Zt(e,Dn(e),t)}function ag(t,e){return Zt(t,Oi(t),e)}var lg=Object.getOwnPropertySymbols,Ha=lg?function(t){for(var e=[];t;)ji(e,Oi(t)),t=sr(t);return e}:ga;function cg(t,e){return Zt(t,Ha(t),e)}function Ri(t){return pa(t,Dn,Ha)}var ug=Object.prototype,dg=ug.hasOwnProperty;function fg(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&dg.call(t,"index")&&(n.index=t.index,n.input=t.input),n}function mg(t,e){var n=e?$i(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var hg=/\w*$/;function pg(t){var e=new t.constructor(t.source,hg.exec(t));return e.lastIndex=t.lastIndex,e}var Qs=Ne?Ne.prototype:void 0,eo=Qs?Qs.valueOf:void 0;function gg(t){return eo?Object(eo.call(t)):{}}var yg="[object Boolean]",xg="[object Date]",bg="[object Map]",vg="[object Number]",Sg="[object RegExp]",wg="[object Set]",jg="[object String]",Og="[object Symbol]",Ag="[object ArrayBuffer]",_g="[object DataView]",Cg="[object Float32Array]",Ng="[object Float64Array]",Tg="[object Int8Array]",Fg="[object Int16Array]",Pg="[object Int32Array]",Eg="[object Uint8Array]",Ig="[object Uint8ClampedArray]",Dg="[object Uint16Array]",$g="[object Uint32Array]";function kg(t,e,n){var r=t.constructor;switch(e){case Ag:return $i(t);case yg:case xg:return new r(+t);case _g:return mg(t,n);case Cg:case Ng:case Tg:case Fg:case Pg:case Eg:case Ig:case Dg:case $g:return Ma(t,n);case bg:return new r;case vg:case jg:return new r(t);case Sg:return pg(t);case wg:return new r;case Og:return gg(t)}}var Mg="[object Map]";function Rg(t){return Te(t)&&_e(t)==Mg}var to=Kt&&Kt.isMap,Bg=to?_i(to):Rg,Ug="[object Set]";function Lg(t){return Te(t)&&_e(t)==Ug}var no=Kt&&Kt.isSet,Wg=no?_i(no):Lg,Vg=1,zg=2,qg=4,Ya="[object Arguments]",Kg="[object Array]",Gg="[object Boolean]",Hg="[object Date]",Yg="[object Error]",Xa="[object Function]",Xg="[object GeneratorFunction]",Jg="[object Map]",Zg="[object Number]",Ja="[object Object]",Qg="[object RegExp]",ey="[object Set]",ty="[object String]",ny="[object Symbol]",ry="[object WeakMap]",iy="[object ArrayBuffer]",sy="[object DataView]",oy="[object Float32Array]",ay="[object Float64Array]",ly="[object Int8Array]",cy="[object Int16Array]",uy="[object Int32Array]",dy="[object Uint8Array]",fy="[object Uint8ClampedArray]",my="[object Uint16Array]",hy="[object Uint32Array]",ae={};ae[Ya]=ae[Kg]=ae[iy]=ae[sy]=ae[Gg]=ae[Hg]=ae[oy]=ae[ay]=ae[ly]=ae[cy]=ae[uy]=ae[Jg]=ae[Zg]=ae[Ja]=ae[Qg]=ae[ey]=ae[ty]=ae[ny]=ae[dy]=ae[fy]=ae[my]=ae[hy]=!0;ae[Yg]=ae[Xa]=ae[ry]=!1;function mn(t,e,n,r,i,s){var a,o=e&Vg,l=e&zg,d=e&qg;if(n&&(a=i?n(t,r,i,s):n(t)),a!==void 0)return a;if(!Z(t))return t;var f=ye(t);if(f){if(a=fg(t),!o)return ki(t,a)}else{var u=_e(t),h=u==Xa||u==Xg;if(At(t))return ka(t,o);if(u==Ja||u==Ya||h&&!i){if(a=l||h?{}:Ra(t),!o)return l?cg(t,og(a,t)):ag(t,sg(a,t))}else{if(!ae[u])return i?t:{};a=kg(t,u,o)}}s||(s=new Ee);var g=s.get(t);if(g)return g;s.set(t,a),Wg(t)?t.forEach(function(y){a.add(mn(y,e,n,y,t,s))}):Bg(t)&&t.forEach(function(y,x){a.set(x,mn(y,e,n,x,t,s))});var m=d?l?Ri:Hr:l?Dn:Pe,p=f?void 0:m(t);return Ii(p||t,function(y,x){p&&(x=y,y=t[x]),Pi(a,x,mn(y,e,n,x,t,s))}),a}function Za(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function py(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}function gy(t,e){return e.length<2?t:ur(t,py(e,0,-1))}var yy=Object.prototype,xy=yy.hasOwnProperty;function Qa(t,e){e=Jt(e,t);var n=-1,r=e.length;if(!r)return!0;for(var i=t==null||typeof t!="object"&&typeof t!="function";++n<r;){var s=e[n];if(typeof s=="string"){if(s==="__proto__"&&!xy.call(t,"__proto__"))return!1;if(s==="constructor"&&n+1<r&&typeof e[n+1]=="string"&&e[n+1]==="prototype"){if(i&&n===0)continue;return!1}}}var a=gy(t,e);return a==null||delete a[Ft(Za(e))]}function by(t){return gt(t)?void 0:t}function ei(t){var e=t==null?0:t.length;return e?$n(t,1):[]}function el(t){return La(Ua(t,void 0,ei),t+"")}var vy=1,Sy=2,wy=4,wn=el(function(t,e){var n={};if(t==null)return n;var r=!1;e=Xt(e,function(s){return s=Jt(s,t),r||(r=s.length>1),s}),Zt(t,Ri(t),n),r&&(n=mn(n,vy|Sy|wy,by));for(var i=e.length;i--;)Qa(n,e[i]);return n}),jy=su();const Bi=di(jy);function nr(t,e){if(oe in t&&Bi.equal(t[oe],e))return t;for(const n of Object.values(t))if(Array.isArray(n)){for(const r of n)if(Z(r)){const i=nr(r,e);if(i!==void 0)return i}}else if(Z(n)){const r=nr(n,e);if(r!==void 0)return r}}function ti(t,e){const n=I(t,oe,e);ce in t&&(t={...t,[ce]:Bi.resolve(n,t[ce])});for(const[r,i]of Object.entries(t))Array.isArray(i)?t={...t,[r]:i.map(s=>Z(s)?ti(s,n):s)}:Z(i)&&(t={...t,[r]:ti(i,n)});return t}function Ui(t,e){const n=e[t];return[wn(e,[t]),n]}function tl(t,e={},n=[],r=I(e,[oe])){const i=t||"";let s;if(i.startsWith("#")){const o=decodeURIComponent(i.substring(1));r===void 0||oe in e&&e[oe]===r?s=Er.get(e,o):e[cn]===Kn&&(s=nr(e,r.replace(/\/$/,"")),s!==void 0&&(s=Er.get(s,o)))}else if(e[cn]===Kn){const o=r?Bi.resolve(r,i):i,[l,...d]=o.replace(/#\/?$/,"").split("#");s=nr(e,l.replace(/\/$/,"")),s!==void 0&&(r=s[oe],me(d)||(s=Er.get(s,decodeURIComponent(d.join("#")))))}if(s===void 0)throw new Error(`Could not find a definition for ${t}.`);const a=s[ce];if(a){if(n.includes(a)){if(n.length===1)throw new Error(`Definition for ${t} is a circular reference`);const[f,...u]=n,h=[...u,i,f].join(" -> ");throw new Error(`Definition for ${f} contains a circular reference through ${h}`)}const[o,l]=Ui(ce,s),d=tl(l,e,[...n,i],r);return Object.keys(o).length>0?e[cn]===Rd||e[cn]===Kn?{[pt]:[o,d]}:{...o,...d}:d}return s}function nl(t,e={},n=I(e,[oe])){return tl(t,e,[],n)}var Oy="[object String]";function yt(t){return typeof t=="string"||!ye(t)&&Te(t)&&tt(t)==Oy}function Ge(t){let e;const n=I(t,$d);return yt(n)?e=n:n!==void 0&&console.warn(`Expecting discriminator to be a string, got "${typeof n}" instead`),e}function jn(t){return Array.isArray(t)?"array":typeof t=="string"?"string":t==null?"null":typeof t=="boolean"?"boolean":isNaN(t)?typeof t=="object"?"object":"string":"number"}var Ay=fr(function(t){return Va($n(t,1,Sn,!0))});function Ie(t){let{type:e}=t;return!e&&t.const?jn(t.const):!e&&t.enum?"string":!e&&(t.properties||t.additionalProperties||t.patternProperties)?"object":(Array.isArray(e)&&(e.length===2&&e.includes("null")?e=e.find(n=>n!=="null"):e=e[0]),e)}function et(t,e){const n=Object.assign({},t);return Object.keys(e).reduce((r,i)=>{const s=t?t[i]:{},a=e[i];return t&&i in t&&Y(a)?r[i]=et(s,a):t&&e&&(Ie(t)==="object"||Ie(e)==="object")&&i===sa&&Array.isArray(s)&&Array.isArray(a)?r[i]=Ay(s,a):r[i]=a,r},n)}var _y="[object Number]";function rl(t){return typeof t=="number"||Te(t)&&tt(t)==_y}function il(t,e,n){var r;if(t&&n){const i=I(t,n);if(i===void 0)return;for(let s=0;s<e.length;s++){const a=e[s],o=I(a,[te,n],{});if(!(o.type==="object"||o.type==="array")&&(o.const===i||!((r=o.enum)===null||r===void 0)&&r.includes(i)))return s}}}function Li(t,e,n,r,i){if(e===void 0)return 0;const s=il(e,n,i);if(rl(s))return s;for(let a=0;a<n.length;a++){const o=n[a];if(i&&X(o,[te,i])){const l=I(e,i),d=I(o,[te,i],{});if(t.isValid(d,l,r))return a}else if(o[te]){const l={anyOf:Object.keys(o[te]).map(f=>({required:[f]}))};let d;if(o.anyOf){const{...f}=o;f.allOf?f.allOf=f.allOf.slice():f.allOf=[],f.allOf.push(l),d=f}else d=Object.assign({},o,l);if(delete d.required,t.isValid(d,e,r))return a}else if(t.isValid(o,e,r))return a}return 0}function be(t,e,n={},r,i,s=!1){return Ve(t,e,n,r,void 0,void 0,i,s)[0]}function Cy(t,e,n,r,i,s,a){const{if:o,then:l,else:d,...f}=e,u=t.isValid(o,s||{},n);let h=[f],g=[];if(r)l&&typeof l!="boolean"&&(g=g.concat(Ve(t,l,n,s,r,i,a))),d&&typeof d!="boolean"&&(g=g.concat(Ve(t,d,n,s,r,i,a)));else{const m=u?l:d;m&&typeof m!="boolean"&&(g=g.concat(Ve(t,m,n,s,r,i,a)))}return g.length&&(h=g.map(m=>et(f,m))),h.flatMap(m=>Ve(t,m,n,s,r,i,a))}function sl(t){return t.reduce((n,r)=>r.length>1?r.flatMap(i=>Na(n.length,s=>[...n[s]].concat(i))):(n.forEach(i=>i.push(r[0])),n),[[]])}function ol(t,e){return Object.keys(t.patternProperties).filter(n=>RegExp(n).test(e)).reduce((n,r)=>(se(n,[r],t.patternProperties[r]),n),{})}function Ny(t,e,n,r,i,s,a,o){const l=al(t,e,n,r,i,s,a,o);if(l.length>1||l[0]!==e)return l;if(xi in e)return ll(t,e,n,r,i,s,a).flatMap(f=>Ve(t,f,n,s,r,i,a));if(pt in e&&Array.isArray(e[pt])){const d=e.allOf.map(u=>Ve(t,u,n,s,r,i,a));return sl(d).map(u=>({...e,allOf:u}))}return[e]}function al(t,e,n,r,i,s,a,o){const l=Wt(e,n,i,void 0,o);return l!==e?Ve(t,l,n,s,r,i,a,o):[e]}function Wt(t,e,n,r,i){if(!Y(t))return t;let s=t;if(ce in s){const{$ref:a,...o}=s;if(n.includes(a))return s;n.push(a),s={...nl(a,e,r),...o},oe in s&&(r=s[oe])}if(te in s){const a=[],o=np(s[te],(l,d,f)=>{const u=[...n];l[f]=Wt(d,e,u,r,i),a.push(u)},{});bp(n,za(wp(a))),s={...s,[te]:o}}if(zt in s&&!Array.isArray(s.items)&&typeof s.items!="boolean"&&(s={...s,items:Wt(s.items,e,n,r,i)}),i){let a,o;J in t&&Array.isArray(t[J])?(a=J,o=s[J]):q in t&&Array.isArray(t[q])&&(a=q,o=s[q]),a&&o&&(s={...s,[a]:o.map(l=>Wt(l,e,n,r,i))})}return le(t,s)?t:s}function Ty(t,e,n,r,i){const s={...e,properties:{...e.properties}},a=r&&Y(r)?r:{};return Object.keys(a).forEach(o=>{if(!(o in s.properties)){if(qr in s){const l=ol(s,o);if(!me(l)){s.properties[o]=be(t,{[pt]:Object.values(l)},n,I(a,[o]),i),se(s.properties,[o,Qe],!0);return}}if(Zn in s&&s.additionalProperties!==!1){let l;typeof s.additionalProperties!="boolean"?ce in s.additionalProperties?l=be(t,{[ce]:I(s.additionalProperties,[ce])},n,a,i):"type"in s.additionalProperties?l={...s.additionalProperties}:J in s.additionalProperties||q in s.additionalProperties?l={type:"object",...s.additionalProperties}:l={type:jn(I(a,[o]))}:l={type:jn(I(a,[o]))},s.properties[o]=l,se(s.properties,[o,Qe],!0)}else s.properties[o]={type:"null"},se(s.properties,[o,Qe],!0)}}),s}const{compareSchemaDefinitions:Fy,compareSchemaValues:Py}=qp(),{mergeArrayOfSchemaDefinitions:Ey}=eg({intersectJson:Bp(Py),deduplicateJsonSchemaDef:qa(Fy)}),Iy=ng(Ey);function Dy(t){return Iy(t)}function Ve(t,e,n,r,i=!1,s=[],a,o){return Y(e)?Ny(t,e,n,i,s,r,a,o).flatMap(d=>{var f;let u=d;if(bi in u)return Cy(t,u,n,i,s,r,a);if(pt in u){if(i){const{allOf:g,...m}=u;return[...g,m]}try{const g=[],m=[];(f=u.allOf)===null||f===void 0||f.forEach(p=>{typeof p=="object"&&p.contains?g.push(p):m.push(p)}),g.length&&(u={...u,allOf:m}),u=a?a(u):Dy(u),g.length&&(u.allOf=g)}catch(g){console.warn(`could not merge subschemas in allOf:
|
|
1
|
+
import{a2 as _c,c as ve,K as ui,p as Cc,j as c,f as Vo,aH as Nc,aI as ls,u as Tc,a as Fc,t as Ut,a0 as di,r as P,aJ as Pc,a4 as Ec,i as zo,h as fi,l as Ic,aK as Dc,aL as $c,aM as kc,ai as Mc,ac as Rc,aF as Bc,af as Rt,ad as Nn,aa as Yt,ab as Uc,aN as Lc,aO as Wc,v as qo,U as Vc,V as cs,w as Ae,$ as zc,X as qc,s as Kc,k as Gc,y as Hc,x as Yc}from"./index-Bz1LU39D.js";import{i as Xc,a as Jc}from"./mcp-oauth-BzcB2WNx.js";import{I as Zc,n as Qc,c as mi,E as eu}from"./empty-state-DgOO5bI1.js";import{E as tu,i as nu,r as ru,e as Ko}from"./env-vars-editor-mM2KyO-W.js";import{E as iu}from"./error-boundary-uBvOVTCE.js";import{u as hi,a as Go}from"./use-connection-BXdeHsm0.js";import{a as Ho,r as su,c as ou,d as Yo,A as au,u as Xo}from"./use-binding-UNVemCFv.js";import{u as lu}from"./use-tool-call-BLplGau6.js";import{P as cu}from"./pin-to-sidebar-button-C-akIZzz.js";import{B as Vt,I as lt}from"./input-CtiQUsvV.js";import{i as uu}from"./File06-nV81V8TD.js";import{i as du}from"./Key01-ChIWeKNh.js";import{i as yn}from"./Loading01-CdaWSExX.js";import{V as fu}from"./layout-C8G6tSLB.js";import{u as pi}from"./project-context-provider-_aLYBfO9.js";import{F as ke,a as mu,b as Me,d as Re,f as Be,c as it,e as hu}from"./form-orY-xngM.js";import{S as Jo,a as Zo,b as Qo,c as ea,d as kt,e as ta}from"./select-Bxj6_TSM.js";import{s as xr,f as na,e as pu}from"./registry-utils-BIzwINzW.js";import{i as gu}from"./Terminal-DYwA22tz.js";import{u as yu,a as xu,i as ra}from"./use-gateway-BhC1hXIm.js";import{i as bu}from"./Grid01-BEpepbVy.js";import{s as ia}from"./Plus-CovnOzP9.js";import{u as vu,R as Su,I as wu,a as ju}from"./index-o28bnKR9.js";import{M as Ou}from"./constants-8DEiLmV-.js";import{e as Au}from"./extract-connection-data-DMhfaAiL.js";import{R as us,_ as _t}from"./index-Cw3bkeXO.js";import{G as _u,M as Cu}from"./index-BuPukvJG.js";function Nu(t,e){return vu({...t,queries:t.queries.map(n=>({...n,suspense:!0,throwOnError:_c,enabled:!0,placeholderData:void 0}))},e)}function Dw(t){const e=ve.c(9),{connectionId:n}=t;let r,i,s;e[0]!==n?(r=new URL(`/mcp/${n}`,window.location.origin),s=Cc,i=ui.isMCPAuthenticated(r.href,null),e[0]=n,e[1]=r,e[2]=i,e[3]=s):(r=e[1],i=e[2],s=e[3]);let a;e[4]!==r?(a=()=>Xc({url:r.href,token:null}),e[4]=r,e[5]=a):a=e[5];let o;e[6]!==i||e[7]!==a?(o={queryKey:i,queryFn:a},e[6]=i,e[7]=a,e[8]=o):o=e[8];const{data:l}=s(o);return l}const Bn=43200,ds=1440,fs=Symbol.for("constructDateFrom");function gi(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&fs in t?t[fs](e):t instanceof Date?new t.constructor(e):new Date(e)}function ht(t,e){return gi(t,t)}let Tu={};function Fu(){return Tu}function ms(t){const e=ht(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function yi(t,...e){const n=gi.bind(null,t||e.find(r=>typeof r=="object"));return e.map(n)}function zn(t,e){const n=+ht(t)-+ht(e);return n<0?-1:n>0?1:n}function Pu(t){return gi(t,Date.now())}function Eu(t,e,n){const[r,i]=yi(n?.in,t,e),s=r.getFullYear()-i.getFullYear(),a=r.getMonth()-i.getMonth();return s*12+a}function Iu(t){return e=>{const r=(t?Math[t]:Math.trunc)(e);return r===0?0:r}}function Du(t,e){return+ht(t)-+ht(e)}function $u(t,e){const n=ht(t);return n.setHours(23,59,59,999),n}function ku(t,e){const n=ht(t),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Mu(t,e){const n=ht(t);return+$u(n)==+ku(n)}function Ru(t,e,n){const[r,i,s]=yi(n?.in,t,t,e),a=zn(i,s),o=Math.abs(Eu(i,s));if(o<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*o);let l=zn(i,s)===-a;Mu(r)&&o===1&&zn(r,s)===1&&(l=!1);const d=a*(o-+l);return d===0?0:d}function Bu(t,e,n){const r=Du(t,e)/1e3;return Iu(n?.roundingMethod)(r)}const Uu={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Lu=(t,e,n)=>{let r;const i=Uu[t];return typeof i=="string"?r=i:e===1?r=i.one:r=i.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function br(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const Wu={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Vu={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},zu={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},qu={date:br({formats:Wu,defaultWidth:"full"}),time:br({formats:Vu,defaultWidth:"full"}),dateTime:br({formats:zu,defaultWidth:"full"})},Ku={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Gu=(t,e,n,r)=>Ku[t];function rn(t){return(e,n)=>{const r=n?.context?String(n.context):"standalone";let i;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,o=n?.width?String(n.width):a;i=t.formattingValues[o]||t.formattingValues[a]}else{const a=t.defaultWidth,o=n?.width?String(n.width):t.defaultWidth;i=t.values[o]||t.values[a]}const s=t.argumentCallback?t.argumentCallback(e):e;return i[s]}}const Hu={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Yu={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Xu={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ju={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Zu={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Qu={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ed=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},td={ordinalNumber:ed,era:rn({values:Hu,defaultWidth:"wide"}),quarter:rn({values:Yu,defaultWidth:"wide",argumentCallback:t=>t-1}),month:rn({values:Xu,defaultWidth:"wide"}),day:rn({values:Ju,defaultWidth:"wide"}),dayPeriod:rn({values:Zu,defaultWidth:"wide",formattingValues:Qu,defaultFormattingWidth:"wide"})};function sn(t){return(e,n={})=>{const r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=e.match(i);if(!s)return null;const a=s[0],o=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(o)?rd(o,u=>u.test(a)):nd(o,u=>u.test(a));let d;d=t.valueCallback?t.valueCallback(l):l,d=n.valueCallback?n.valueCallback(d):d;const f=e.slice(a.length);return{value:d,rest:f}}}function nd(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function rd(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function id(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const i=r[0],s=e.match(t.parsePattern);if(!s)return null;let a=t.valueCallback?t.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=e.slice(i.length);return{value:a,rest:o}}}const sd=/^(\d+)(th|st|nd|rd)?/i,od=/\d+/i,ad={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ld={any:[/^b/i,/^(a|c)/i]},cd={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ud={any:[/1/i,/2/i,/3/i,/4/i]},dd={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},fd={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},md={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},hd={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},pd={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},gd={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},yd={ordinalNumber:id({matchPattern:sd,parsePattern:od,valueCallback:t=>parseInt(t,10)}),era:sn({matchPatterns:ad,defaultMatchWidth:"wide",parsePatterns:ld,defaultParseWidth:"any"}),quarter:sn({matchPatterns:cd,defaultMatchWidth:"wide",parsePatterns:ud,defaultParseWidth:"any",valueCallback:t=>t+1}),month:sn({matchPatterns:dd,defaultMatchWidth:"wide",parsePatterns:fd,defaultParseWidth:"any"}),day:sn({matchPatterns:md,defaultMatchWidth:"wide",parsePatterns:hd,defaultParseWidth:"any"}),dayPeriod:sn({matchPatterns:pd,defaultMatchWidth:"any",parsePatterns:gd,defaultParseWidth:"any"})},xd={code:"en-US",formatDistance:Lu,formatLong:qu,formatRelative:Gu,localize:td,match:yd,options:{weekStartsOn:0,firstWeekContainsDate:1}};function bd(t,e,n){const r=Fu(),i=n?.locale??r.locale??xd,s=2520,a=zn(t,e);if(isNaN(a))throw new RangeError("Invalid time value");const o=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[l,d]=yi(n?.in,...a>0?[e,t]:[t,e]),f=Bu(d,l),u=(ms(d)-ms(l))/1e3,h=Math.round((f-u)/60);let g;if(h<2)return n?.includeSeconds?f<5?i.formatDistance("lessThanXSeconds",5,o):f<10?i.formatDistance("lessThanXSeconds",10,o):f<20?i.formatDistance("lessThanXSeconds",20,o):f<40?i.formatDistance("halfAMinute",0,o):f<60?i.formatDistance("lessThanXMinutes",1,o):i.formatDistance("xMinutes",1,o):h===0?i.formatDistance("lessThanXMinutes",1,o):i.formatDistance("xMinutes",h,o);if(h<45)return i.formatDistance("xMinutes",h,o);if(h<90)return i.formatDistance("aboutXHours",1,o);if(h<ds){const m=Math.round(h/60);return i.formatDistance("aboutXHours",m,o)}else{if(h<s)return i.formatDistance("xDays",1,o);if(h<Bn){const m=Math.round(h/ds);return i.formatDistance("xDays",m,o)}else if(h<Bn*2)return g=Math.round(h/Bn),i.formatDistance("aboutXMonths",g,o)}if(g=Ru(d,l),g<12){const m=Math.round(h/Bn);return i.formatDistance("xMonths",m,o)}else{const m=g%12,p=Math.trunc(g/12);return m<3?i.formatDistance("aboutXYears",p,o):m<9?i.formatDistance("overXYears",p,o):i.formatDistance("almostXYears",p+1,o)}}function vd(t,e){return bd(t,Pu(t),e)}function Sd(t){const e=ve.c(13),{gateway:n,org:r}=t;let i;e[0]!==n.id||e[1]!==r?(i={org:r,gatewayId:n.id},e[0]=n.id,e[1]=r,e[2]=i):i=e[2];let s;e[3]!==n.icon||e[4]!==n.title?(s=n.icon?c.jsx("img",{src:n.icon,alt:n.title,className:"w-8 h-8 rounded-md object-cover shrink-0"}):c.jsx("div",{className:"w-8 h-8 rounded-md bg-primary/10 flex items-center justify-center shrink-0",children:c.jsx(ra,{size:16,className:"text-primary"})}),e[3]=n.icon,e[4]=n.title,e[5]=s):s=e[5];let a;e[6]!==n.title?(a=c.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[6]=n.title,e[7]=a):a=e[7];let o;e[8]===Symbol.for("react.memo_cache_sentinel")?(o=c.jsx(bu,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[8]=o):o=e[8];let l;return e[9]!==i||e[10]!==s||e[11]!==a?(l=c.jsxs(Nc,{to:"/$org/gateways/$gatewayId",params:i,className:"flex items-center gap-3 p-3 rounded-lg border border-border hover:bg-muted/50 transition-colors group",children:[s,a,o]}),e[9]=i,e[10]=s,e[11]=a,e[12]=l):l=e[12],l}function hs(t){const e=ve.c(20),{connectionId:n,connectionTitle:r,connectionDescription:i,connectionIcon:s,org:a,hasExistingGateways:o}=t,l=Vo(),d=xu();let f;e[0]!==d.create||e[1]!==i||e[2]!==s||e[3]!==n||e[4]!==r||e[5]!==l||e[6]!==a?(f=async()=>{const m=await d.create.mutateAsync({title:`${r} Agent`,description:i??null,icon:s??null,status:"active",tool_selection_mode:"inclusion",connections:[{connection_id:n,selected_tools:null,selected_resources:null,selected_prompts:null}]});l({to:"/$org/gateways/$gatewayId",params:{org:a,gatewayId:m.id}})},e[0]=d.create,e[1]=i,e[2]=s,e[3]=n,e[4]=r,e[5]=l,e[6]=a,e[7]=f):f=e[7];const u=f;if(o){let m;e[8]!==d.create.isPending?(m=d.create.isPending?c.jsx(yn,{size:16,className:"animate-spin"}):c.jsx(ia,{size:16}),e[8]=d.create.isPending,e[9]=m):m=e[9];let p;return e[10]!==d.create.isPending||e[11]!==u||e[12]!==m?(p=c.jsxs(Vt,{variant:"outline",size:"sm",className:"gap-1.5",onClick:u,disabled:d.create.isPending,children:[m,"Create another Agent"]}),e[10]=d.create.isPending,e[11]=u,e[12]=m,e[13]=p):p=e[13],p}let h;e[14]!==d.create.isPending?(h=d.create.isPending?c.jsx(yn,{size:20,className:"animate-spin"}):c.jsx(ra,{size:20}),e[14]=d.create.isPending,e[15]=h):h=e[15];let g;return e[16]!==d.create.isPending||e[17]!==u||e[18]!==h?(g=c.jsxs(Vt,{size:"lg",className:"gap-2 w-full",onClick:u,disabled:d.create.isPending,children:[h,"Create an agent"]}),e[16]=d.create.isPending,e[17]=u,e[18]=h,e[19]=g):g=e[19],g}function wd(t){const e=ve.c(26),{connectionId:n,connectionTitle:r,connectionDescription:i,connectionIcon:s,org:a}=t;let o;e[0]!==n?(o={filters:[{column:"connection_id",value:n}]},e[0]=n,e[1]=o):o=e[1];const l=yu(o);if(!(l.length>0)){let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("h4",{className:"text-sm font-medium text-foreground",children:"Use in your IDE"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Expose this connection via an Agent to use it in Cursor, VS Code, Claude Desktop, and other MCP-compatible tools."})]}),e[2]=p):p=e[2];let y;return e[3]!==i||e[4]!==s||e[5]!==n||e[6]!==r||e[7]!==a?(y=c.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[p,c.jsx(hs,{connectionId:n,connectionTitle:r,connectionDescription:i,connectionIcon:s,org:a,hasExistingGateways:!1})]}),e[3]=i,e[4]=s,e[5]=n,e[6]=r,e[7]=a,e[8]=y):y=e[8],y}let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("h4",{className:"text-sm font-medium text-foreground",children:"Agents"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection is used on the following agents."})]}),e[9]=f):f=e[9];let u;if(e[10]!==l||e[11]!==a){let p;e[13]!==a?(p=y=>c.jsx(Sd,{gateway:y,org:a},y.id),e[13]=a,e[14]=p):p=e[14],u=l.map(p),e[10]=l,e[11]=a,e[12]=u}else u=e[12];let h;e[15]!==u?(h=c.jsx("div",{className:"flex flex-col gap-2",children:u}),e[15]=u,e[16]=h):h=e[16];let g;e[17]!==i||e[18]!==s||e[19]!==n||e[20]!==r||e[21]!==a?(g=c.jsx(hs,{connectionId:n,connectionTitle:r,connectionDescription:i,connectionIcon:s,org:a,hasExistingGateways:!0}),e[17]=i,e[18]=s,e[19]=n,e[20]=r,e[21]=a,e[22]=g):g=e[22];let m;return e[23]!==h||e[24]!==g?(m=c.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[f,h,g]}),e[23]=h,e[24]=g,e[25]=m):m=e[25],m}function jd({form:t,connection:e}){const n=ls({control:t.control,name:"ui_type"}),r=ls({control:t.control,name:"connection_url"}),{stdioEnabled:i}=Tc(),s=(()=>{if(typeof r!="string"||!r)return!1;try{const o=new URL(r);return o.hostname==="api.githubcopilot.com"&&o.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),a=i||e.connection_type==="STDIO";return c.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[c.jsx(ke,{control:t.control,name:"ui_type",render:({field:o})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"Type"}),c.jsxs(Jo,{value:o.value,onValueChange:o.onChange,children:[c.jsx(Re,{children:c.jsx(Zo,{children:c.jsx(Qo,{})})}),c.jsxs(ea,{children:[c.jsx(kt,{value:"HTTP",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(xr,{className:"w-4 h-4"}),"HTTP"]})}),c.jsx(kt,{value:"SSE",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(xr,{className:"w-4 h-4"}),"SSE"]})}),c.jsx(kt,{value:"Websocket",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(xr,{className:"w-4 h-4"}),"Websocket"]})}),a&&c.jsxs(c.Fragment,{children:[c.jsx(kt,{value:"NPX",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(Qc,{className:"w-4 h-4"}),"NPX Package"]})}),c.jsx(kt,{value:"STDIO",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(gu,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),c.jsx(Be,{})]})}),n==="NPX"&&c.jsx(ke,{control:t.control,name:"npx_package",render:({field:o})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"NPM Package"}),c.jsx(Re,{children:c.jsx(lt,{placeholder:"@perplexity-ai/mcp-server",...o,value:o.value||"",className:"h-10 rounded-lg"})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),c.jsx(Be,{})]})}),n==="STDIO"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(ke,{control:t.control,name:"stdio_command",render:({field:o})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"Command"}),c.jsx(Re,{children:c.jsx(lt,{placeholder:"node, bun, python...",...o,value:o.value||"",className:"h-10 rounded-lg"})}),c.jsx(Be,{})]})}),c.jsx(ke,{control:t.control,name:"stdio_args",render:({field:o})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"Arguments"}),c.jsx(Re,{children:c.jsx(lt,{placeholder:"arg1 arg2 --flag value",...o,value:o.value||"",className:"h-10 rounded-lg"})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments (no quotes needed)"}),c.jsx(Be,{})]})})]}),c.jsx(ke,{control:t.control,name:"stdio_cwd",render:({field:o})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"Working Directory"}),c.jsx(Re,{children:c.jsx(lt,{placeholder:"/path/to/project (optional)",...o,value:o.value||"",className:"h-10 rounded-lg"})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),c.jsx(Be,{})]})})]}),(n==="NPX"||n==="STDIO")&&c.jsx(ke,{control:t.control,name:"env_vars",render:({field:o})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"Environment Variables"}),c.jsx(Re,{children:c.jsx(tu,{value:o.value??[],onChange:o.onChange})}),c.jsx(Be,{})]})}),n!=="NPX"&&n!=="STDIO"&&c.jsxs(c.Fragment,{children:[c.jsx(ke,{control:t.control,name:"connection_url",render:({field:o})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"URL"}),c.jsx(Re,{children:c.jsx(lt,{placeholder:"https://example.com/mcp",...o,value:o.value??"",className:"h-10 rounded-lg"})}),c.jsx(Be,{})]})}),c.jsx(ke,{control:t.control,name:"connection_token",render:({field:o})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:s?"GitHub Personal Access Token":"Token"}),c.jsx(Re,{children:c.jsx(lt,{type:"password",placeholder:e.connection_token?"••••••••":s?"Paste your GitHub PAT (no 'Bearer' prefix)":"Enter access token...",...o,value:o.value||"",className:"h-10 rounded-lg"})}),s&&c.jsxs(hu,{children:["(!) GitHub’s hosted MCP at"," ",c.jsx("code",{children:"api.githubcopilot.com/mcp"})," currently requires a Personal Access Token (PAT). Create one at"," ",c.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"}),". Mesh will send it as"," ",c.jsx("code",{children:"Authorization: Bearer <PAT>"}),"."]}),c.jsx(Be,{})]})})]})]})}function Od(t){const e=ve.c(30),{form:n,connection:r}=t,{org:i}=pi();let s;e[0]!==r.icon||e[1]!==r.title?(s=c.jsx(Zc,{icon:r.icon,name:r.title,size:"lg",className:"shadow-sm"}),e[0]=r.icon,e[1]=r.title,e[2]=s):s=e[2];let a;e[3]!==n.control?(a=c.jsxs("div",{className:"flex flex-col",children:[c.jsx(ke,{control:n.control,name:"title",render:_d}),c.jsx(ke,{control:n.control,name:"description",render:Ad})]}),e[3]=n.control,e[4]=a):a=e[4];let o;e[5]!==s||e[6]!==a?(o=c.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[s,a]}),e[5]=s,e[6]=a,e[7]=o):o=e[7];let l;e[8]!==r||e[9]!==n?(l=c.jsx(jd,{form:n,connection:r}),e[8]=r,e[9]=n,e[10]=l):l=e[10];let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[11]=d):d=e[11];let f;e[12]!==r.updated_at?(f=r.updated_at?vd(new Date(r.updated_at),{addSuffix:!1}):"Unknown",e[12]=r.updated_at,e[13]=f):f=e[13];let u;e[14]!==f?(u=c.jsxs("div",{className:"flex items-center gap-4 p-5 border-b border-border",children:[d,c.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:f})]}),e[14]=f,e[15]=u):u=e[15];let h;e[16]!==r.description||e[17]!==r.icon||e[18]!==r.id||e[19]!==r.title||e[20]!==i.slug?(h=c.jsx(wd,{connectionId:r.id,connectionTitle:r.title,connectionDescription:r.description,connectionIcon:r.icon,org:i.slug}),e[16]=r.description,e[17]=r.icon,e[18]=r.id,e[19]=r.title,e[20]=i.slug,e[21]=h):h=e[21];let g;e[22]!==o||e[23]!==l||e[24]!==u||e[25]!==h?(g=c.jsxs("div",{className:"flex flex-col",children:[o,l,u,h]}),e[22]=o,e[23]=l,e[24]=u,e[25]=h,e[26]=g):g=e[26];let m;return e[27]!==n||e[28]!==g?(m=c.jsx(mu,{...n,children:g}),e[27]=n,e[28]=g,e[29]=m):m=e[29],m}function Ad(t){const{field:e}=t;return c.jsxs(Me,{className:"w-full space-y-0",children:[c.jsx(Re,{children:c.jsx(lt,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),c.jsx(Be,{})]})}function _d(t){const{field:e}=t;return c.jsxs(Me,{className:"w-full space-y-0",children:[c.jsx("div",{className:"flex items-center gap-2.5",children:c.jsx(Re,{children:c.jsx(lt,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Connection Name"})})}),c.jsx(Be,{})]})}function Cd(t){return t.startsWith("@")?t:`@${t}`}function Nd(t){const e=t._meta?.[Ou]?.tools;if(!(!e||e.length===0))return e.map(n=>({name:n.name,inputSchema:n.inputSchema??void 0,outputSchema:n.outputSchema??void 0}))}function Td(t){const e=hi(),n=Ho(e),r=t?Cd(t):"",i=r?{where:{appName:r},includeTools:!0}:{},a=Nu({queries:n.map(l=>{const d=l.id,f=na(l.tools)||"",u=mi(d),h=JSON.stringify(i);return{queryKey:ui.toolCall(d,f,h),queryFn:async()=>{if(!f||!r)return null;try{return(await u(f,i))?.items?.[0]??null}catch{return null}},staleTime:300*1e3}})}).map(l=>l.data).find(l=>l!==null);return{bindingSchema:a?Nd(a):void 0}}function Fd(t){return t.startsWith("@")?t:`@${t}`}function Pd(){const{org:t}=pi(),{data:e}=Fc.useSession(),n=Go(),r=hi(),i=Ho(r);return{installByBinding:async a=>{if(!t||!e?.user?.id){Ut.error("Not authenticated");return}const o=Fd(a),d=(await Promise.all(i.map(async m=>{const p=na(m.tools);if(!p)return null;const y=mi(m.id);try{const x=await y(p,{where:{appName:o}});return pu(x??[])[0]??null}catch{return null}}))).find(m=>m!==null);if(!d){Ut.error(`MCP Server not found in registry: ${a}`);return}const f=Au(d,t.id,e.user.id),u=f.connection_type==="STDIO",h=!!f.connection_url,g=u&&f.connection_headers&&typeof f.connection_headers=="object"&&"command"in f.connection_headers;if(!h&&!g){Ut.error("This MCP Server cannot be connected: no connection method available");return}return await n.create.mutateAsync(f),{id:f.id,connection:f}},isInstalling:n.create.isPending}}function Y(t){return typeof t!="object"||t===null||typeof t.lastModified=="number"&&typeof File<"u"&&t instanceof File||typeof t.getMonth=="function"&&typeof Date<"u"&&t instanceof Date?!1:!Array.isArray(t)}function Ed(t){return t.additionalItems===!0&&console.warn("additionalItems=true is currently not supported"),Y(t.additionalItems)}function ps(t){if(t==="")return;if(t===null)return null;if(/\.$/.test(t)||/\.0$/.test(t)||/\.\d*0$/.test(t))return t;const e=Number(t);return typeof e=="number"&&!Number.isNaN(e)?e:t}const Qe="__additional_property",Zn="additionalProperties",pt="allOf",J="anyOf",Ce="const",ir="default",xi="dependencies",Id="enum",xe="__errors",oe="$id",bi="if",zt="items",Dd="_$junk_option_schema_id$_",qn="$name",q="oneOf",qr="patternProperties",te="properties",vr="readonly",sa="required",Qn="submitButtonOptions",ce="$ref",cn="$schema",oa="root",aa="_",$d=["discriminator","propertyName"],gs="formContext",kd="layoutGridLookupMap",vi="__rjsf_additionalProperties",la="__rjsf_rootSchema",Md="ui:field",Si="ui:widget",ut="ui:options",Kr="ui:globalOptions",Rd="https://json-schema.org/draft/2019-09/schema",Kn="https://json-schema.org/draft/2020-12/schema";function U(t={},e={}){return t?Object.keys(t).filter(n=>n.indexOf("ui:")===0).reduce((n,r)=>{const i=t[r];return r===Si&&Y(i)?(console.error("Setting options via ui:widget object is no longer supported, use ui:options instead"),n):r===ut&&Y(i)?{...n,...i}:{...n,[r.substring(3)]:i}},{...e}):{...e}}function ca(t,e={},n){if(!(t.additionalProperties||t.patternProperties))return!1;const{expandable:r=!0}=U(e);return r===!1?r:t.maxProperties!==void 0&&n?Object.keys(n).length<t.maxProperties:!0}var ua=typeof global=="object"&&global&&global.Object===Object&&global,Bd=typeof self=="object"&&self&&self.Object===Object&&self,Ye=ua||Bd||Function("return this")(),Ne=Ye.Symbol,da=Object.prototype,Ud=da.hasOwnProperty,Ld=da.toString,on=Ne?Ne.toStringTag:void 0;function Wd(t){var e=Ud.call(t,on),n=t[on];try{t[on]=void 0;var r=!0}catch{}var i=Ld.call(t);return r&&(e?t[on]=n:delete t[on]),i}var Vd=Object.prototype,zd=Vd.toString;function qd(t){return zd.call(t)}var Kd="[object Null]",Gd="[object Undefined]",ys=Ne?Ne.toStringTag:void 0;function tt(t){return t==null?t===void 0?Gd:Kd:ys&&ys in Object(t)?Wd(t):qd(t)}function fa(t,e){return function(n){return t(e(n))}}var sr=fa(Object.getPrototypeOf,Object);function Te(t){return t!=null&&typeof t=="object"}var Hd="[object Object]",Yd=Function.prototype,Xd=Object.prototype,ma=Yd.toString,Jd=Xd.hasOwnProperty,Zd=ma.call(Object);function gt(t){if(!Te(t)||tt(t)!=Hd)return!1;var e=sr(t);if(e===null)return!0;var n=Jd.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&ma.call(n)==Zd}function Gr(t){const e={[xe]:[],addError(n){this[xe].push(n)}};if(Array.isArray(t))return t.reduce((n,r,i)=>({...n,[i]:Gr(r)}),e);if(gt(t)){const n=t;return Object.keys(n).reduce((r,i)=>({...r,[i]:Gr(n[i])}),e)}return e}function Qd(){this.__data__=[],this.size=0}function Tn(t,e){return t===e||t!==t&&e!==e}function or(t,e){for(var n=t.length;n--;)if(Tn(t[n][0],e))return n;return-1}var ef=Array.prototype,tf=ef.splice;function nf(t){var e=this.__data__,n=or(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():tf.call(e,n,1),--this.size,!0}function rf(t){var e=this.__data__,n=or(e,t);return n<0?void 0:e[n][1]}function sf(t){return or(this.__data__,t)>-1}function of(t,e){var n=this.__data__,r=or(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function nt(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}nt.prototype.clear=Qd;nt.prototype.delete=nf;nt.prototype.get=rf;nt.prototype.has=sf;nt.prototype.set=of;function af(){this.__data__=new nt,this.size=0}function lf(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function cf(t){return this.__data__.get(t)}function uf(t){return this.__data__.has(t)}function Z(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var df="[object AsyncFunction]",ff="[object Function]",mf="[object GeneratorFunction]",hf="[object Proxy]";function Fn(t){if(!Z(t))return!1;var e=tt(t);return e==ff||e==mf||e==df||e==hf}var Sr=Ye["__core-js_shared__"],xs=(function(){var t=/[^.]+$/.exec(Sr&&Sr.keys&&Sr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function pf(t){return!!xs&&xs in t}var gf=Function.prototype,yf=gf.toString;function Ct(t){if(t!=null){try{return yf.call(t)}catch{}try{return t+""}catch{}}return""}var xf=/[\\^$.*+?()[\]{}|]/g,bf=/^\[object .+?Constructor\]$/,vf=Function.prototype,Sf=Object.prototype,wf=vf.toString,jf=Sf.hasOwnProperty,Of=RegExp("^"+wf.call(jf).replace(xf,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Af(t){if(!Z(t)||pf(t))return!1;var e=Fn(t)?Of:bf;return e.test(Ct(t))}function _f(t,e){return t?.[e]}function Nt(t,e){var n=_f(t,e);return Af(n)?n:void 0}var xn=Nt(Ye,"Map"),bn=Nt(Object,"create");function Cf(){this.__data__=bn?bn(null):{},this.size=0}function Nf(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Tf="__lodash_hash_undefined__",Ff=Object.prototype,Pf=Ff.hasOwnProperty;function Ef(t){var e=this.__data__;if(bn){var n=e[t];return n===Tf?void 0:n}return Pf.call(e,t)?e[t]:void 0}var If=Object.prototype,Df=If.hasOwnProperty;function $f(t){var e=this.__data__;return bn?e[t]!==void 0:Df.call(e,t)}var kf="__lodash_hash_undefined__";function Mf(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=bn&&e===void 0?kf:e,this}function jt(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}jt.prototype.clear=Cf;jt.prototype.delete=Nf;jt.prototype.get=Ef;jt.prototype.has=$f;jt.prototype.set=Mf;function Rf(){this.size=0,this.__data__={hash:new jt,map:new(xn||nt),string:new jt}}function Bf(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ar(t,e){var n=t.__data__;return Bf(e)?n[typeof e=="string"?"string":"hash"]:n.map}function Uf(t){var e=ar(this,t).delete(t);return this.size-=e?1:0,e}function Lf(t){return ar(this,t).get(t)}function Wf(t){return ar(this,t).has(t)}function Vf(t,e){var n=ar(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function rt(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}rt.prototype.clear=Rf;rt.prototype.delete=Uf;rt.prototype.get=Lf;rt.prototype.has=Wf;rt.prototype.set=Vf;var zf=200;function qf(t,e){var n=this.__data__;if(n instanceof nt){var r=n.__data__;if(!xn||r.length<zf-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new rt(r)}return n.set(t,e),this.size=n.size,this}function Ee(t){var e=this.__data__=new nt(t);this.size=e.size}Ee.prototype.clear=af;Ee.prototype.delete=lf;Ee.prototype.get=cf;Ee.prototype.has=uf;Ee.prototype.set=qf;var Kf="__lodash_hash_undefined__";function Gf(t){return this.__data__.set(t,Kf),this}function Hf(t){return this.__data__.has(t)}function Ot(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new rt;++e<n;)this.add(t[e])}Ot.prototype.add=Ot.prototype.push=Gf;Ot.prototype.has=Hf;function Yf(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function vn(t,e){return t.has(e)}var Xf=1,Jf=2;function ha(t,e,n,r,i,s){var a=n&Xf,o=t.length,l=e.length;if(o!=l&&!(a&&l>o))return!1;var d=s.get(t),f=s.get(e);if(d&&f)return d==e&&f==t;var u=-1,h=!0,g=n&Jf?new Ot:void 0;for(s.set(t,e),s.set(e,t);++u<o;){var m=t[u],p=e[u];if(r)var y=a?r(p,m,u,e,t,s):r(m,p,u,t,e,s);if(y!==void 0){if(y)continue;h=!1;break}if(g){if(!Yf(e,function(x,S){if(!vn(g,S)&&(m===x||i(m,x,n,r,s)))return g.push(S)})){h=!1;break}}else if(!(m===p||i(m,p,n,r,s))){h=!1;break}}return s.delete(t),s.delete(e),h}var er=Ye.Uint8Array;function Zf(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function wi(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var Qf=1,em=2,tm="[object Boolean]",nm="[object Date]",rm="[object Error]",im="[object Map]",sm="[object Number]",om="[object RegExp]",am="[object Set]",lm="[object String]",cm="[object Symbol]",um="[object ArrayBuffer]",dm="[object DataView]",bs=Ne?Ne.prototype:void 0,wr=bs?bs.valueOf:void 0;function fm(t,e,n,r,i,s,a){switch(n){case dm:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case um:return!(t.byteLength!=e.byteLength||!s(new er(t),new er(e)));case tm:case nm:case sm:return Tn(+t,+e);case rm:return t.name==e.name&&t.message==e.message;case om:case lm:return t==e+"";case im:var o=Zf;case am:var l=r&Qf;if(o||(o=wi),t.size!=e.size&&!l)return!1;var d=a.get(t);if(d)return d==e;r|=em,a.set(t,e);var f=ha(o(t),o(e),r,i,s,a);return a.delete(t),f;case cm:if(wr)return wr.call(t)==wr.call(e)}return!1}function ji(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var ye=Array.isArray;function pa(t,e,n){var r=e(t);return ye(t)?r:ji(r,n(t))}function mm(t,e){for(var n=-1,r=t==null?0:t.length,i=0,s=[];++n<r;){var a=t[n];e(a,n,t)&&(s[i++]=a)}return s}function ga(){return[]}var hm=Object.prototype,pm=hm.propertyIsEnumerable,vs=Object.getOwnPropertySymbols,Oi=vs?function(t){return t==null?[]:(t=Object(t),mm(vs(t),function(e){return pm.call(t,e)}))}:ga;function ya(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var gm="[object Arguments]";function Ss(t){return Te(t)&&tt(t)==gm}var xa=Object.prototype,ym=xa.hasOwnProperty,xm=xa.propertyIsEnumerable,qt=Ss((function(){return arguments})())?Ss:function(t){return Te(t)&&ym.call(t,"callee")&&!xm.call(t,"callee")};function bm(){return!1}var ba=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ws=ba&&typeof module=="object"&&module&&!module.nodeType&&module,vm=ws&&ws.exports===ba,js=vm?Ye.Buffer:void 0,Sm=js?js.isBuffer:void 0,At=Sm||bm,wm=9007199254740991,jm=/^(?:0|[1-9]\d*)$/;function lr(t,e){var n=typeof t;return e=e??wm,!!e&&(n=="number"||n!="symbol"&&jm.test(t))&&t>-1&&t%1==0&&t<e}var Om=9007199254740991;function Ai(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Om}var Am="[object Arguments]",_m="[object Array]",Cm="[object Boolean]",Nm="[object Date]",Tm="[object Error]",Fm="[object Function]",Pm="[object Map]",Em="[object Number]",Im="[object Object]",Dm="[object RegExp]",$m="[object Set]",km="[object String]",Mm="[object WeakMap]",Rm="[object ArrayBuffer]",Bm="[object DataView]",Um="[object Float32Array]",Lm="[object Float64Array]",Wm="[object Int8Array]",Vm="[object Int16Array]",zm="[object Int32Array]",qm="[object Uint8Array]",Km="[object Uint8ClampedArray]",Gm="[object Uint16Array]",Hm="[object Uint32Array]",ue={};ue[Um]=ue[Lm]=ue[Wm]=ue[Vm]=ue[zm]=ue[qm]=ue[Km]=ue[Gm]=ue[Hm]=!0;ue[Am]=ue[_m]=ue[Rm]=ue[Cm]=ue[Bm]=ue[Nm]=ue[Tm]=ue[Fm]=ue[Pm]=ue[Em]=ue[Im]=ue[Dm]=ue[$m]=ue[km]=ue[Mm]=!1;function Ym(t){return Te(t)&&Ai(t.length)&&!!ue[tt(t)]}function _i(t){return function(e){return t(e)}}var va=typeof exports=="object"&&exports&&!exports.nodeType&&exports,fn=va&&typeof module=="object"&&module&&!module.nodeType&&module,Xm=fn&&fn.exports===va,jr=Xm&&ua.process,Kt=(function(){try{var t=fn&&fn.require&&fn.require("util").types;return t||jr&&jr.binding&&jr.binding("util")}catch{}})(),Os=Kt&&Kt.isTypedArray,Pn=Os?_i(Os):Ym,Jm=Object.prototype,Zm=Jm.hasOwnProperty;function Sa(t,e){var n=ye(t),r=!n&&qt(t),i=!n&&!r&&At(t),s=!n&&!r&&!i&&Pn(t),a=n||r||i||s,o=a?ya(t.length,String):[],l=o.length;for(var d in t)(e||Zm.call(t,d))&&!(a&&(d=="length"||i&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||lr(d,l)))&&o.push(d);return o}var Qm=Object.prototype;function cr(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Qm;return t===n}var eh=fa(Object.keys,Object),th=Object.prototype,nh=th.hasOwnProperty;function wa(t){if(!cr(t))return eh(t);var e=[];for(var n in Object(t))nh.call(t,n)&&n!="constructor"&&e.push(n);return e}function Tt(t){return t!=null&&Ai(t.length)&&!Fn(t)}function Pe(t){return Tt(t)?Sa(t):wa(t)}function Hr(t){return pa(t,Pe,Oi)}var rh=1,ih=Object.prototype,sh=ih.hasOwnProperty;function oh(t,e,n,r,i,s){var a=n&rh,o=Hr(t),l=o.length,d=Hr(e),f=d.length;if(l!=f&&!a)return!1;for(var u=l;u--;){var h=o[u];if(!(a?h in e:sh.call(e,h)))return!1}var g=s.get(t),m=s.get(e);if(g&&m)return g==e&&m==t;var p=!0;s.set(t,e),s.set(e,t);for(var y=a;++u<l;){h=o[u];var x=t[h],S=e[h];if(r)var j=a?r(S,x,h,e,t,s):r(x,S,h,t,e,s);if(!(j===void 0?x===S||i(x,S,n,r,s):j)){p=!1;break}y||(y=h=="constructor")}if(p&&!y){var b=t.constructor,v=e.constructor;b!=v&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof v=="function"&&v instanceof v)&&(p=!1)}return s.delete(t),s.delete(e),p}var Yr=Nt(Ye,"DataView"),Xr=Nt(Ye,"Promise"),Lt=Nt(Ye,"Set"),Jr=Nt(Ye,"WeakMap"),As="[object Map]",ah="[object Object]",_s="[object Promise]",Cs="[object Set]",Ns="[object WeakMap]",Ts="[object DataView]",lh=Ct(Yr),ch=Ct(xn),uh=Ct(Xr),dh=Ct(Lt),fh=Ct(Jr),_e=tt;(Yr&&_e(new Yr(new ArrayBuffer(1)))!=Ts||xn&&_e(new xn)!=As||Xr&&_e(Xr.resolve())!=_s||Lt&&_e(new Lt)!=Cs||Jr&&_e(new Jr)!=Ns)&&(_e=function(t){var e=tt(t),n=e==ah?t.constructor:void 0,r=n?Ct(n):"";if(r)switch(r){case lh:return Ts;case ch:return As;case uh:return _s;case dh:return Cs;case fh:return Ns}return e});var mh=1,Fs="[object Arguments]",Ps="[object Array]",Un="[object Object]",hh=Object.prototype,Es=hh.hasOwnProperty;function ph(t,e,n,r,i,s){var a=ye(t),o=ye(e),l=a?Ps:_e(t),d=o?Ps:_e(e);l=l==Fs?Un:l,d=d==Fs?Un:d;var f=l==Un,u=d==Un,h=l==d;if(h&&At(t)){if(!At(e))return!1;a=!0,f=!1}if(h&&!f)return s||(s=new Ee),a||Pn(t)?ha(t,e,n,r,i,s):fm(t,e,l,n,r,i,s);if(!(n&mh)){var g=f&&Es.call(t,"__wrapped__"),m=u&&Es.call(e,"__wrapped__");if(g||m){var p=g?t.value():t,y=m?e.value():e;return s||(s=new Ee),i(p,y,n,r,s)}}return h?(s||(s=new Ee),oh(t,e,n,r,i,s)):!1}function En(t,e,n,r,i){return t===e?!0:t==null||e==null||!Te(t)&&!Te(e)?t!==t&&e!==e:ph(t,e,n,r,En,i)}function gh(t,e,n){n=typeof n=="function"?n:void 0;var r=n?n(t,e):void 0;return r===void 0?En(t,e,void 0,n):!!r}function le(t,e){return gh(t,e,(n,r)=>{if(typeof n=="function"&&typeof r=="function")return!0})}var yh="[object Symbol]";function In(t){return typeof t=="symbol"||Te(t)&&tt(t)==yh}var xh=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bh=/^\w*$/;function Ci(t,e){if(ye(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||In(t)?!0:bh.test(t)||!xh.test(t)||e!=null&&t in Object(e)}var vh="Expected a function";function Ni(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(vh);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=t.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(Ni.Cache||rt),n}Ni.Cache=rt;var Sh=500;function wh(t){var e=Ni(t,function(r){return n.size===Sh&&n.clear(),r}),n=e.cache;return e}var jh=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Oh=/\\(\\)?/g,ja=wh(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(jh,function(n,r,i,s){e.push(i?s.replace(Oh,"$1"):r||n)}),e});function Xt(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var Is=Ne?Ne.prototype:void 0,Ds=Is?Is.toString:void 0;function Oa(t){if(typeof t=="string")return t;if(ye(t))return Xt(t,Oa)+"";if(In(t))return Ds?Ds.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Ti(t){return t==null?"":Oa(t)}function Jt(t,e){return ye(t)?t:Ci(t,e)?[t]:ja(Ti(t))}function Ft(t){if(typeof t=="string"||In(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function ur(t,e){e=Jt(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Ft(e[n++])];return n&&n==r?t:void 0}function I(t,e,n){var r=t==null?void 0:ur(t,e);return r===void 0?n:r}var Ah=Object.prototype,_h=Ah.hasOwnProperty;function Ch(t,e){return t!=null&&_h.call(t,e)}function Aa(t,e,n){e=Jt(e,t);for(var r=-1,i=e.length,s=!1;++r<i;){var a=Ft(e[r]);if(!(s=t!=null&&n(t,a)))break;t=t[a]}return s||++r!=i?s:(i=t==null?0:t.length,!!i&&Ai(i)&&lr(a,i)&&(ye(t)||qt(t)))}function X(t,e){return t!=null&&Aa(t,e,Ch)}function dt(t,e){return En(t,e)}var tr=(function(){try{var t=Nt(Object,"defineProperty");return t({},"",{}),t}catch{}})();function Fi(t,e,n){e=="__proto__"&&tr?tr(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var Nh=Object.prototype,Th=Nh.hasOwnProperty;function Pi(t,e,n){var r=t[e];(!(Th.call(t,e)&&Tn(r,n))||n===void 0&&!(e in t))&&Fi(t,e,n)}function Ei(t,e,n,r){if(!Z(t))return t;e=Jt(e,t);for(var i=-1,s=e.length,a=s-1,o=t;o!=null&&++i<s;){var l=Ft(e[i]),d=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=a){var f=o[l];d=r?r(f,l,o):void 0,d===void 0&&(d=Z(f)?f:lr(e[i+1])?[]:{})}Pi(o,l,d),o=o[l]}return t}function se(t,e,n){return t==null?t:Ei(t,e,n)}function dr(t){return t}function _a(t){return typeof t=="function"?t:dr}var Fh=/\s/;function Ph(t){for(var e=t.length;e--&&Fh.test(t.charAt(e)););return e}var Eh=/^\s+/;function Ih(t){return t&&t.slice(0,Ph(t)+1).replace(Eh,"")}var $s=NaN,Dh=/^[-+]0x[0-9a-f]+$/i,$h=/^0b[01]+$/i,kh=/^0o[0-7]+$/i,Mh=parseInt;function Rh(t){if(typeof t=="number")return t;if(In(t))return $s;if(Z(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Z(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Ih(t);var n=$h.test(t);return n||kh.test(t)?Mh(t.slice(2),n?2:8):Dh.test(t)?$s:+t}var ks=1/0,Bh=17976931348623157e292;function Uh(t){if(!t)return t===0?t:0;if(t=Rh(t),t===ks||t===-ks){var e=t<0?-1:1;return e*Bh}return t===t?t:0}function Ca(t){var e=Uh(t),n=e%1;return e===e?n?e-n:e:0}var Lh=9007199254740991,Or=4294967295,Wh=Math.min;function Na(t,e){if(t=Ca(t),t<1||t>Lh)return[];var n=Or,r=Wh(t,Or);e=_a(e),t-=Or;for(var i=ya(r,e);++n<t;)e(n);return i}function Ii(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}var Ms=Object.create,Ta=(function(){function t(){}return function(e){if(!Z(e))return{};if(Ms)return Ms(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();function Vh(t){return function(e,n,r){for(var i=-1,s=Object(e),a=r(e),o=a.length;o--;){var l=a[++i];if(n(s[l],l,s)===!1)break}return e}}var Fa=Vh();function Pa(t,e){return t&&Fa(t,e,Pe)}var zh=1,qh=2;function Kh(t,e,n,r){var i=n.length,s=i;if(t==null)return!s;for(t=Object(t);i--;){var a=n[i];if(a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<s;){a=n[i];var o=a[0],l=t[o],d=a[1];if(a[2]){if(l===void 0&&!(o in t))return!1}else{var f=new Ee,u;if(!(u===void 0?En(d,l,zh|qh,r,f):u))return!1}}return!0}function Ea(t){return t===t&&!Z(t)}function Gh(t){for(var e=Pe(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,Ea(i)]}return e}function Ia(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function Hh(t){var e=Gh(t);return e.length==1&&e[0][2]?Ia(e[0][0],e[0][1]):function(n){return n===t||Kh(n,t,e)}}function Yh(t,e){return t!=null&&e in Object(t)}function Da(t,e){return t!=null&&Aa(t,e,Yh)}var Xh=1,Jh=2;function Zh(t,e){return Ci(t)&&Ea(e)?Ia(Ft(t),e):function(n){var r=I(n,t);return r===void 0&&r===e?Da(n,t):En(e,r,Xh|Jh)}}function Qh(t){return function(e){return e?.[t]}}function ep(t){return function(e){return ur(e,t)}}function tp(t){return Ci(t)?Qh(Ft(t)):ep(t)}function Di(t){return typeof t=="function"?t:t==null?dr:typeof t=="object"?ye(t)?Zh(t[0],t[1]):Hh(t):tp(t)}function np(t,e,n){var r=ye(t),i=r||At(t)||Pn(t);if(e=Di(e),n==null){var s=t&&t.constructor;i?n=r?new s:[]:Z(t)?n=Fn(s)?Ta(sr(t)):{}:n={}}return(i?Ii:Pa)(t,function(a,o,l){return e(n,a,o,l)}),n}function Zr(t,e,n){(n!==void 0&&!Tn(t[e],n)||n===void 0&&!(e in t))&&Fi(t,e,n)}var $a=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Rs=$a&&typeof module=="object"&&module&&!module.nodeType&&module,rp=Rs&&Rs.exports===$a,Bs=rp?Ye.Buffer:void 0,Us=Bs?Bs.allocUnsafe:void 0;function ka(t,e){if(e)return t.slice();var n=t.length,r=Us?Us(n):new t.constructor(n);return t.copy(r),r}function $i(t){var e=new t.constructor(t.byteLength);return new er(e).set(new er(t)),e}function Ma(t,e){var n=e?$i(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function ki(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function Ra(t){return typeof t.constructor=="function"&&!cr(t)?Ta(sr(t)):{}}function Sn(t){return Te(t)&&Tt(t)}function Qr(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Zt(t,e,n,r){var i=!n;n||(n={});for(var s=-1,a=e.length;++s<a;){var o=e[s],l=void 0;l===void 0&&(l=t[o]),i?Fi(n,o,l):Pi(n,o,l)}return n}function ip(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var sp=Object.prototype,op=sp.hasOwnProperty;function ap(t){if(!Z(t))return ip(t);var e=cr(t),n=[];for(var r in t)r=="constructor"&&(e||!op.call(t,r))||n.push(r);return n}function Dn(t){return Tt(t)?Sa(t,!0):ap(t)}function lp(t){return Zt(t,Dn(t))}function cp(t,e,n,r,i,s,a){var o=Qr(t,n),l=Qr(e,n),d=a.get(l);if(d){Zr(t,n,d);return}var f=s?s(o,l,n+"",t,e,a):void 0,u=f===void 0;if(u){var h=ye(l),g=!h&&At(l),m=!h&&!g&&Pn(l);f=l,h||g||m?ye(o)?f=o:Sn(o)?f=ki(o):g?(u=!1,f=ka(l,!0)):m?(u=!1,f=Ma(l,!0)):f=[]:gt(l)||qt(l)?(f=o,qt(o)?f=lp(o):(!Z(o)||Fn(o))&&(f=Ra(l))):u=!1}u&&(a.set(l,f),i(f,l,r,s,a),a.delete(l)),Zr(t,n,f)}function Ba(t,e,n,r,i){t!==e&&Fa(e,function(s,a){if(i||(i=new Ee),Z(s))cp(t,e,a,n,Ba,r,i);else{var o=r?r(Qr(t,a),s,a+"",t,e,i):void 0;o===void 0&&(o=s),Zr(t,a,o)}},Dn)}function up(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var Ls=Math.max;function Ua(t,e,n){return e=Ls(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=Ls(r.length-e,0),a=Array(s);++i<s;)a[i]=r[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=r[i];return o[e]=n(a),up(t,this,o)}}function dp(t){return function(){return t}}var fp=tr?function(t,e){return tr(t,"toString",{configurable:!0,enumerable:!1,value:dp(e),writable:!0})}:dr,mp=800,hp=16,pp=Date.now;function gp(t){var e=0,n=0;return function(){var r=pp(),i=hp-(r-n);if(n=r,i>0){if(++e>=mp)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var La=gp(fp);function fr(t,e){return La(Ua(t,e,dr),t+"")}function yp(t,e,n){if(!Z(n))return!1;var r=typeof e;return(r=="number"?Tt(n)&&lr(e,n.length):r=="string"&&e in n)?Tn(n[e],t):!1}function xp(t){return fr(function(e,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=t.length>3&&typeof s=="function"?(i--,s):void 0,a&&yp(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),e=Object(e);++r<i;){var o=n[r];o&&t(e,o,r,s)}return e})}var bp=xp(function(t,e,n){Ba(t,e,n)}),Ws=Ne?Ne.isConcatSpreadable:void 0;function vp(t){return ye(t)||qt(t)||!!(Ws&&t&&t[Ws])}function $n(t,e,n,r,i){var s=-1,a=t.length;for(n||(n=vp),i||(i=[]);++s<a;){var o=t[s];e>0&&n(o)?e>1?$n(o,e-1,n,r,i):ji(i,o):r||(i[i.length]=o)}return i}var Sp=1/0;function wp(t){var e=t==null?0:t.length;return e?$n(t,Sp):[]}function jp(t,e,n,r){for(var i=t.length,s=n+-1;++s<i;)if(e(t[s],s,t))return s;return-1}function Op(t){return t!==t}function Ap(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function Wa(t,e,n){return e===e?Ap(t,e,n):jp(t,Op,n)}function Mi(t,e){var n=t==null?0:t.length;return!!n&&Wa(t,e,0)>-1}function Gn(){}var _p=1/0,Cp=Lt&&1/wi(new Lt([,-0]))[1]==_p?function(t){return new Lt(t)}:Gn,Np=200;function Va(t,e,n){var r=-1,i=Mi,s=t.length,a=!0,o=[],l=o;if(s>=Np){var d=Cp(t);if(d)return wi(d);a=!1,i=vn,l=new Ot}else l=o;e:for(;++r<s;){var f=t[r],u=f;if(f=f!==0?f:0,a&&u===u){for(var h=l.length;h--;)if(l[h]===u)continue e;o.push(f)}else i(l,u,n)||(l!==o&&l.push(u),o.push(f))}return o}function za(t){return t&&t.length?Va(t):[]}var Tp="[object Map]",Fp="[object Set]",Pp=Object.prototype,Ep=Pp.hasOwnProperty;function me(t){if(t==null)return!0;if(Tt(t)&&(ye(t)||typeof t=="string"||typeof t.splice=="function"||At(t)||Pn(t)||qt(t)))return!t.length;var e=_e(t);if(e==Tp||e==Fp)return!t.size;if(cr(t))return!wa(t).length;for(var n in t)if(Ep.call(t,n))return!1;return!0}const Ip=Object.prototype;function un(t){for(const e in t)if(Ip.hasOwnProperty.call(t,e))return!1;return!0}const Dp=["array","boolean","integer","null","number","object","string"];new Set(Dp);const $p=["$defs","definitions","properties","patternProperties","dependencies"];new Set($p);const kp=["items","allOf","oneOf","anyOf"];new Set(kp);const Mp=["items","additionalItems","additionalProperties","propertyNames","contains","if","then","else","not"];new Set(Mp);function Hn(t){return typeof t=="object"}function Le(t){return Hn(t)?un(t):t===!0}function Bt(t,e){return t<e?-1:t>e?1:0}function Ar(t,e){const n=t.length;if(n===0)return e;let r=e.length;if(r===0)return t;if(n<r){const s=t;t=e,e=s,r=n}const i=new Set(t);for(let s=0;s<r;s++)i.add(e[s]);return Array.from(i)}function Rp(t,e){const n=[];if(t.length===0||e.length===0)return n;if(t.length>e.length){const i=t;t=e,e=i}const r=new Set(e);for(let i=0;i<t.length&&r.size>0;i++){const s=t[i];r.delete(s)&&n.push(s)}return n}function Vs(t){return t.length===0}function _r(t){return(e,n)=>{const r=e.length-n.length;if(r!==0)return r;for(let i=0;i<e.length;i++)if(e[i]!==n[i]){const s=t(e[i],n[i]);if(s!==0)return s}return 0}}function qa(t,{threshold:e=12}={}){return n=>{const r=n.length;if(r===0)return n;if(r<=e){const a=[];let o=0;e:for(let l=0;l<r;l++){const d=n[l];for(let f=0;f<o;f++)if(t(d,a[f])===0)continue e;o=a.push(d)}return a}const i=n.slice().sort(t);let s=0;for(let a=1;a<r;a++)t(i[s],i[a])!==0&&++s!==a&&(i[s]=i[a]);return i.length=s+1,i}}function Bp(t){return(e,n)=>{const r=[];let i=e.length,s=n.length;if(i===0||s===0)return r;if(i>s){const f=e;e=n,n=f;const u=i;i=s,s=u}const a=[...e].sort(t),o=[...n].sort(t);let l=0,d=0;for(;l<i&&d<s;){const f=t(a[l],o[d]);f===0?((r.length===0||t(r[r.length-1],a[l])!==0)&&r.push(a[l]),l++,d++):f<0?l++:d++}return r}}function Up(t,e){return n=>{if(t.has(n))return t.get(n);const r=e(n);return t.set(n,r),r}}const zs=Up,Ka=()=>0,Lp=t=>t===void 0,Wp=t=>typeof t!="object",qs={boolean:0,number:1,string:2};function Vp(t,e){const n=typeof t,r=typeof e;return n===r?Bt(t,e):qs[n]-qs[r]}function zp(t,e){const n=t.length;if(n===0)return e;const r=e.length;if(r===0)return t;if(r>n){const a=t;t=e,e=a}const i=new Set(t),s=e.length;for(let a=0;a<s;a++){const o=e[a];i.has(o)||t.push(o)}return t}function mr(t,e,n=Ka){return(r,i)=>t(r)?t(i)?n(r,i):-1:t(i)?1:e(r,i)}function Mt(t){return mr(Lp,t)}function ot(t,e){return mr(n=>n===void 0||t(n),e)}function Cr(t,e){return mr(Array.isArray,t,e)}const he=Mt(Bt),Nr=ot(t=>t===0,(t,e)=>t-e);function qp({deduplicationCache:t=new WeakMap,sortedKeysCache:e=new WeakMap}={}){const n=zs(e,p=>Object.keys(p).sort());function r(p){return(y,x)=>{const S=n(y),j=n(x),b=Math.min(S.length,j.length);for(let v=0;v<b;v++){const w=Bt(S[v],j[v]);if(w!==0)return w}if(S.length!==j.length)return S.length-j.length;for(let v=0;v<b;v++){const w=S[v],O=p(y[w],x[w]);if(O!==0)return O}return 0}}function i(p){const y=_r(p),x=zs(t,qa(p,{threshold:0}));return(S,j)=>y(x(S),x(j))}const s=i(Bt);function a(p,y){if(Hn(p)){if(Hn(y)){const x=Object.keys(p),S=Object.keys(y),j=zp(x,S),b=j.length;for(let v=0;v<b;v++){const w=j[v];if(p[w]===y[w])continue;const A=(m[w]??o)(p[w],y[w]);if(A!==0)return A}return 0}return y===!0&&un(p)?0:1}return Hn(y)?p===!0&&un(y)?0:-1:Bt(p,y)}const o=Mt(d),l=mr(Wp,Cr(r(o),_r(d)),Vp);function d(p,y){return p===null?-1:y===null?1:l(p,y)}const f=Mt(a),u=ot(un,r(f)),h=Mt(i(a)),g=ot(Le,a),m={$id:he,$comment:he,$defs:u,$ref:he,$schema:he,const:o,contains:f,contentEncoding:he,contentMediaType:he,default:o,definitions:u,description:he,else:f,examples:o,exclusiveMaximum:he,exclusiveMinimum:he,format:he,if:f,maximum:he,maxItems:he,maxLength:he,maxProperties:he,minimum:he,multipleOf:he,not:f,pattern:he,propertyNames:f,readOnly:he,then:f,title:he,writeOnly:he,uniqueItems:ot(p=>p===!1,Ka),minLength:Nr,minItems:Nr,minProperties:Nr,required:ot(Vs,s),enum:ot(Vs,i(d)),type:Mt((p,y)=>{const x=Array.isArray(p),S=Array.isArray(y);return!x&&!S?Bt(p,y):s(x?p:[p],S?y:[y])}),items:ot(p=>!Array.isArray(p)&&Le(p),Cr(a,_r(a))),anyOf:h,allOf:h,oneOf:h,properties:u,patternProperties:u,additionalProperties:g,additionalItems:g,dependencies:ot(un,r(Mt(Cr(a,s))))};return{compareSchemaValues:d,compareSchemaDefinitions:a}}function Ks(t){return t}const Ga=(t,e)=>t?Ga(e%t,t):e,Kp=(t,e)=>Math.abs(t*e)/Ga(t,e);function Gp(t,e){return t===e?t:`^(?=.*(?:${t}))(?=.*(?:${e})).*$`}function*Tr(t,e,n){const r=t.length,i=e.length;if(r>0&&i>0)for(let s=0;s<r;s++){const a=t[s];for(let o=0;o<i;o++)yield n(a,e[o])}}function Fr(t,e){return t||e}function Gs(t){return(e,n)=>{const r={...e},i=Object.keys(n),s=i.length;for(let a=0;a<s;a++){const o=i[a];r[o]=e[o]===void 0?n[o]:t(e[o],n[o])}return r}}function Hp(t){const e=new Map;for(const n of t)for(const r of n[0])e.set(r,n[1]);return e}function bt(t,e,n){n===void 0||Le(n)?delete t[e]:t[e]=n}const Yp=["properties","patternProperties","additionalProperties"];function Hs(t){const e=Object.keys(t),n=e.length,r=[];for(let i=0;i<n;i++){const s=e[i];r.push({regExp:new RegExp(s),schema:t[s]})}return[r,e]}const Ys=[[],[]];function Xs(t,e,n){const r=n.length;for(let i=0;i<r;i++){const s=n[i];if(!s.regExp.test(e))continue;const a=s.schema;if(a===!1)return!0;t.push(a)}return!1}const Xp=["items","additionalItems"],Jp=["if","then","else"];function Js(t,e){return e.if!==void 0&&(t.if=e.if),e.then!==void 0&&(t.then=e.then),e.else!==void 0&&(t.else=e.else),t}function Pr(t,e){if(t===e)return t;switch(t){case"number":if(e==="integer")return"integer";case"integer":if(e==="number")return"integer";default:return}}function vt(t,e,n){return[t,e,n]}function Zp(t){const e=new Map;for(const[n,r,i]of t){const s=a=>{if(!i(a))throw new Error(`Schema keys '${n}' and '${r}' are conflicting (${n}: ${JSON.stringify(a[n])}, ${r}: ${JSON.stringify(a[r])})`)};for(const a of[[n,r],[r,n]]){let o=e.get(a[0]);o===void 0&&(o=[],e.set(a[0],o)),o.push({oppositeKey:a[1],check:s})}}return e}const Qp=[vt("minimum","maximum",t=>t.maximum>=t.minimum),vt("exclusiveMinimum","maximum",t=>t.maximum>t.exclusiveMinimum),vt("minimum","exclusiveMaximum",t=>t.exclusiveMaximum>t.minimum),vt("exclusiveMinimum","exclusiveMaximum",t=>t.exclusiveMaximum>t.exclusiveMinimum),vt("minLength","maxLength",t=>t.maxLength>=t.minLength),vt("minItems","maxItems",t=>t.maxItems>=t.minItems),vt("minProperties","maxProperties",t=>t.maxProperties>=t.minProperties)];function eg({mergePatterns:t=Gp,isSubRegExp:e=Object.is,intersectJson:n=Rp,deduplicateJsonSchemaDef:r=Ks,defaultMerger:i=Ks,assigners:s=[],checks:a=Qp,mergers:o}={}){function l(b){const v=b.length;let w=b[0];for(let O=1;O<v;O++){const A=x(w,b[O]);if(A===!1)return!1;Le(A)||(w=A)}return w}function d(b,v,w,O,A,_,T){if(b.length=0,w===!1)return!1;if(b.push(w),A!==void 0){if(A===!1)return!1;b.push(A)}if(Xs(b,v,_))return!1;const C=b.length<2;if(T===!1){if(C)return;if(Xs(b,v,O))return!1}else C&&T!==void 0&&b.push(T);return b.length===1?b[0]:l(b)}function f(b,v,w,O,A,_){const T=w.length;if(T>0&&A!==!1)if(_)Object.assign(b,v);else for(let N=0;N<T;N++){const C=w[N];O.has(C)||(b[C]=x(v[C],A))}return b}const u=(b,{properties:v={},patternProperties:w,additionalProperties:O=!0},{properties:A={},patternProperties:_,additionalProperties:T=!0})=>{const N=Le(O),C=Le(T);if(N&&C)return bt(b,"properties",S(v,A)),bt(b,"patternProperties",w&&_?S(w,_):w??_),delete b.additionalProperties,b;const F=x(O,T);bt(b,"additionalProperties",F);const $={},E=Object.keys(v),D=E.length,[M,k]=w?Hs(w):Ys,[B,V]=_?Hs(_):Ys,R=[],W=new Set,Q=C?void 0:T;for(let H=0;H<D;H++){const re=E[H];W.add(re);const fe=d(R,re,v[re],M,A[re],B,Q);fe!==void 0&&($[re]=fe)}const ne=Object.keys(A),ie=ne.length,de=N?void 0:O;for(let H=0;H<ie;H++){const re=ne[H];if(W.has(re))continue;const fe=d(R,re,A[re],B,void 0,M,de);fe!==void 0&&($[re]=fe)}bt(b,"properties",$);let ee={};const z=new Set;if(k.length>0&&V.length>0){const H=Tr(k,V,(re,fe)=>{e(re,fe)&&z.add(re),e(fe,re)&&z.add(fe),ee[t(re,fe)]=x(w[re],_[fe])});for(;!H.next().done;);}return ee=f(ee,w,k,z,T,C),ee=f(ee,_,V,z,O,N),bt(b,"patternProperties",ee),b},h=(b,{items:v=[],additionalItems:w},{items:O=[],additionalItems:A})=>{const _=Array.isArray(v),T=Array.isArray(O),N=[];if(b.items=N,_&&T){const[C,F,$]=v.length<O.length?[v.length,w,O]:[O.length,A,v];let E=0;for(;E<C;E++)N.push(x(v[E],O[E]));if(F===!1)b.additionalItems=!1;else{const D=F===void 0||Le(F);for(;E<$.length;E++)N.push(D?$[E]:x($[E],F));bt(b,"additionalItems",w!==void 0&&A!==void 0?x(w,A):w??A)}}else if(_||T){const[C,F,$]=_?[v,O,w]:[O,v,A];bt(b,"additionalItems",$&&x($,F));for(let E=0;E<C.length;E++)N.push(x(C[E],F))}else delete b.additionalItems,b.items=x(v,O);return b},g=(b,v,w)=>{Js(b,v);const O=Js({},w);return b.allOf===void 0?b.allOf=[O]:b.allOf=b.allOf.concat(O),b};function m(b,v){return r(Array.from(Tr(b,v,x)))}const p=Hp([[Yp,u],[Xp,h],[Jp,g],...s]),y=Zp(a);function x(b,v){if(b===!1||v===!1)return!1;if(Le(b))return Le(v)?!0:v;if(Le(v))return b;let w={...b};const O=new Set,A=new Set,_=Object.keys(v),T=_.length;for(let N=0;N<T;N++){const C=_[N],F=v[C];if(F===void 0)continue;const $=y.get(C);if($!==void 0){const k=$.length;for(let B=0;B<k;B++){const V=$[B];b[V.oppositeKey]!==void 0&&A.add(V.check)}}const E=b[C];if(E===void 0){w[C]=F;continue}const D=p.get(C);if(D){O.add(D);continue}const M=j[C]??i;w[C]=M(E,F)}for(const N of O)w=N(w,b,v);for(const N of A)N(w);return w}const S=Gs(x),j={$id:i,$ref:i,$schema:i,$comment:i,$defs:S,definitions:S,type:(b,v)=>{if(b===v)return b;const w=Array.isArray(b),O=Array.isArray(v);if(!w&&!O){const A=Pr(b,v);if(A!==void 0)return A}else if(w||O){const A=new Set;if(w&&O)for(const T of Tr(b,v,Pr))T!==void 0&&A.add(T);else{const T=w?b:v,N=w?v:b,C=T.length;for(let F=0;F<C;F++){const $=Pr(N,T[F]);$!==void 0&&A.add($)}}const _=A.size;if(_===1)return A.values().next().value;if(_>1)return Array.from(A)}throw new Error(`It is not possible to create an intersection of the following incompatible types: ${b.toString()}, ${v.toString()}`)},default:i,description:i,title:i,const:i,format:i,contentEncoding:i,contentMediaType:i,not:(b,v)=>{const w=r([b,v]);return w.length===1?w[0]:{anyOf:w}},pattern:t,readOnly:Fr,writeOnly:Fr,enum:(b,v)=>{const w=n(b,v);if(w.length===0)throw new Error(`Intersection of the following enums is empty: "${JSON.stringify(b)}", "${JSON.stringify(v)}"`);return w},anyOf:m,oneOf:m,allOf:(b,v)=>r(b.concat(v)),propertyNames:x,contains:x,dependencies:Gs((b,v)=>Array.isArray(b)?Array.isArray(v)?Ar(b,v):x(v,{required:b}):Array.isArray(v)?x(b,{required:v}):x(b,v)),examples:(b,v)=>{if(!Array.isArray(b)||!Array.isArray(v))throw new Error(`Value of the 'examples' field should be an array, but got "${JSON.stringify(b)}" and "${JSON.stringify(v)}"`);return Ar(b,v)},multipleOf:(b,v)=>{let w=1;for(;!Number.isInteger(b)||!Number.isInteger(v);)w*=10,b*=10,v*=10;return Kp(b,v)/w},exclusiveMaximum:Math.min,maximum:Math.min,maxItems:Math.min,maxLength:Math.min,maxProperties:Math.min,exclusiveMinimum:Math.max,minimum:Math.max,minItems:Math.max,minLength:Math.max,minProperties:Math.max,uniqueItems:Fr,required:Ar,...o};return{mergeSchemaDefinitions:x,mergeArrayOfSchemaDefinitions:l}}function tg(t){const e=[],n=[t];for(;n.length>0;){const r=n.pop();if(typeof r=="boolean"||r.allOf===void 0){e.push(r);continue}const{allOf:i,...s}=r;e.push(s);for(let a=i.length-1;a>=0;a--)n.push(i[a])}return e}function ng(t){return e=>t(tg(e))}var an={},Zs;function rg(){if(Zs)return an;Zs=1;var t=/~/,e=/~[01]/g;function n(d){switch(d){case"~1":return"/";case"~0":return"~"}throw new Error("Invalid tilde escape: "+d)}function r(d){return t.test(d)?d.replace(e,n):d}function i(d,f,u){for(var h,g,m=1,p=f.length;m<p;){if(f[m]==="constructor"||f[m]==="prototype"||f[m]==="__proto__")return d;if(h=r(f[m++]),g=p>m,typeof d[h]>"u"&&(Array.isArray(d)&&h==="-"&&(h=d.length),g&&(f[m]!==""&&f[m]<1/0||f[m]==="-"?d[h]=[]:d[h]={})),!g)break;d=d[h]}var y=d[h];return u===void 0?delete d[h]:d[h]=u,y}function s(d){if(typeof d=="string"){if(d=d.split("/"),d[0]==="")return d;throw new Error("Invalid JSON pointer.")}else if(Array.isArray(d)){for(const f of d)if(typeof f!="string"&&typeof f!="number")throw new Error("Invalid JSON pointer. Must be of type string or number.");return d}throw new Error("Invalid JSON pointer.")}function a(d,f){if(typeof d!="object")throw new Error("Invalid input object.");f=s(f);var u=f.length;if(u===1)return d;for(var h=1;h<u;){if(d=d[r(f[h++])],u===h)return d;if(typeof d!="object"||d===null)return}}function o(d,f,u){if(typeof d!="object")throw new Error("Invalid input object.");if(f=s(f),f.length===0)throw new Error("Invalid JSON pointer for set.");return i(d,f,u)}function l(d){var f=s(d);return{get:function(u){return a(u,f)},set:function(u,h){return o(u,f,h)}}}return an.get=a,an.set=o,an.compile=l,an}var ig=rg();const Er=di(ig);function sg(t,e){return t&&Zt(e,Pe(e),t)}function og(t,e){return t&&Zt(e,Dn(e),t)}function ag(t,e){return Zt(t,Oi(t),e)}var lg=Object.getOwnPropertySymbols,Ha=lg?function(t){for(var e=[];t;)ji(e,Oi(t)),t=sr(t);return e}:ga;function cg(t,e){return Zt(t,Ha(t),e)}function Ri(t){return pa(t,Dn,Ha)}var ug=Object.prototype,dg=ug.hasOwnProperty;function fg(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&dg.call(t,"index")&&(n.index=t.index,n.input=t.input),n}function mg(t,e){var n=e?$i(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var hg=/\w*$/;function pg(t){var e=new t.constructor(t.source,hg.exec(t));return e.lastIndex=t.lastIndex,e}var Qs=Ne?Ne.prototype:void 0,eo=Qs?Qs.valueOf:void 0;function gg(t){return eo?Object(eo.call(t)):{}}var yg="[object Boolean]",xg="[object Date]",bg="[object Map]",vg="[object Number]",Sg="[object RegExp]",wg="[object Set]",jg="[object String]",Og="[object Symbol]",Ag="[object ArrayBuffer]",_g="[object DataView]",Cg="[object Float32Array]",Ng="[object Float64Array]",Tg="[object Int8Array]",Fg="[object Int16Array]",Pg="[object Int32Array]",Eg="[object Uint8Array]",Ig="[object Uint8ClampedArray]",Dg="[object Uint16Array]",$g="[object Uint32Array]";function kg(t,e,n){var r=t.constructor;switch(e){case Ag:return $i(t);case yg:case xg:return new r(+t);case _g:return mg(t,n);case Cg:case Ng:case Tg:case Fg:case Pg:case Eg:case Ig:case Dg:case $g:return Ma(t,n);case bg:return new r;case vg:case jg:return new r(t);case Sg:return pg(t);case wg:return new r;case Og:return gg(t)}}var Mg="[object Map]";function Rg(t){return Te(t)&&_e(t)==Mg}var to=Kt&&Kt.isMap,Bg=to?_i(to):Rg,Ug="[object Set]";function Lg(t){return Te(t)&&_e(t)==Ug}var no=Kt&&Kt.isSet,Wg=no?_i(no):Lg,Vg=1,zg=2,qg=4,Ya="[object Arguments]",Kg="[object Array]",Gg="[object Boolean]",Hg="[object Date]",Yg="[object Error]",Xa="[object Function]",Xg="[object GeneratorFunction]",Jg="[object Map]",Zg="[object Number]",Ja="[object Object]",Qg="[object RegExp]",ey="[object Set]",ty="[object String]",ny="[object Symbol]",ry="[object WeakMap]",iy="[object ArrayBuffer]",sy="[object DataView]",oy="[object Float32Array]",ay="[object Float64Array]",ly="[object Int8Array]",cy="[object Int16Array]",uy="[object Int32Array]",dy="[object Uint8Array]",fy="[object Uint8ClampedArray]",my="[object Uint16Array]",hy="[object Uint32Array]",ae={};ae[Ya]=ae[Kg]=ae[iy]=ae[sy]=ae[Gg]=ae[Hg]=ae[oy]=ae[ay]=ae[ly]=ae[cy]=ae[uy]=ae[Jg]=ae[Zg]=ae[Ja]=ae[Qg]=ae[ey]=ae[ty]=ae[ny]=ae[dy]=ae[fy]=ae[my]=ae[hy]=!0;ae[Yg]=ae[Xa]=ae[ry]=!1;function mn(t,e,n,r,i,s){var a,o=e&Vg,l=e&zg,d=e&qg;if(n&&(a=i?n(t,r,i,s):n(t)),a!==void 0)return a;if(!Z(t))return t;var f=ye(t);if(f){if(a=fg(t),!o)return ki(t,a)}else{var u=_e(t),h=u==Xa||u==Xg;if(At(t))return ka(t,o);if(u==Ja||u==Ya||h&&!i){if(a=l||h?{}:Ra(t),!o)return l?cg(t,og(a,t)):ag(t,sg(a,t))}else{if(!ae[u])return i?t:{};a=kg(t,u,o)}}s||(s=new Ee);var g=s.get(t);if(g)return g;s.set(t,a),Wg(t)?t.forEach(function(y){a.add(mn(y,e,n,y,t,s))}):Bg(t)&&t.forEach(function(y,x){a.set(x,mn(y,e,n,x,t,s))});var m=d?l?Ri:Hr:l?Dn:Pe,p=f?void 0:m(t);return Ii(p||t,function(y,x){p&&(x=y,y=t[x]),Pi(a,x,mn(y,e,n,x,t,s))}),a}function Za(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function py(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}function gy(t,e){return e.length<2?t:ur(t,py(e,0,-1))}var yy=Object.prototype,xy=yy.hasOwnProperty;function Qa(t,e){e=Jt(e,t);var n=-1,r=e.length;if(!r)return!0;for(var i=t==null||typeof t!="object"&&typeof t!="function";++n<r;){var s=e[n];if(typeof s=="string"){if(s==="__proto__"&&!xy.call(t,"__proto__"))return!1;if(s==="constructor"&&n+1<r&&typeof e[n+1]=="string"&&e[n+1]==="prototype"){if(i&&n===0)continue;return!1}}}var a=gy(t,e);return a==null||delete a[Ft(Za(e))]}function by(t){return gt(t)?void 0:t}function ei(t){var e=t==null?0:t.length;return e?$n(t,1):[]}function el(t){return La(Ua(t,void 0,ei),t+"")}var vy=1,Sy=2,wy=4,wn=el(function(t,e){var n={};if(t==null)return n;var r=!1;e=Xt(e,function(s){return s=Jt(s,t),r||(r=s.length>1),s}),Zt(t,Ri(t),n),r&&(n=mn(n,vy|Sy|wy,by));for(var i=e.length;i--;)Qa(n,e[i]);return n}),jy=su();const Bi=di(jy);function nr(t,e){if(oe in t&&Bi.equal(t[oe],e))return t;for(const n of Object.values(t))if(Array.isArray(n)){for(const r of n)if(Z(r)){const i=nr(r,e);if(i!==void 0)return i}}else if(Z(n)){const r=nr(n,e);if(r!==void 0)return r}}function ti(t,e){const n=I(t,oe,e);ce in t&&(t={...t,[ce]:Bi.resolve(n,t[ce])});for(const[r,i]of Object.entries(t))Array.isArray(i)?t={...t,[r]:i.map(s=>Z(s)?ti(s,n):s)}:Z(i)&&(t={...t,[r]:ti(i,n)});return t}function Ui(t,e){const n=e[t];return[wn(e,[t]),n]}function tl(t,e={},n=[],r=I(e,[oe])){const i=t||"";let s;if(i.startsWith("#")){const o=decodeURIComponent(i.substring(1));r===void 0||oe in e&&e[oe]===r?s=Er.get(e,o):e[cn]===Kn&&(s=nr(e,r.replace(/\/$/,"")),s!==void 0&&(s=Er.get(s,o)))}else if(e[cn]===Kn){const o=r?Bi.resolve(r,i):i,[l,...d]=o.replace(/#\/?$/,"").split("#");s=nr(e,l.replace(/\/$/,"")),s!==void 0&&(r=s[oe],me(d)||(s=Er.get(s,decodeURIComponent(d.join("#")))))}if(s===void 0)throw new Error(`Could not find a definition for ${t}.`);const a=s[ce];if(a){if(n.includes(a)){if(n.length===1)throw new Error(`Definition for ${t} is a circular reference`);const[f,...u]=n,h=[...u,i,f].join(" -> ");throw new Error(`Definition for ${f} contains a circular reference through ${h}`)}const[o,l]=Ui(ce,s),d=tl(l,e,[...n,i],r);return Object.keys(o).length>0?e[cn]===Rd||e[cn]===Kn?{[pt]:[o,d]}:{...o,...d}:d}return s}function nl(t,e={},n=I(e,[oe])){return tl(t,e,[],n)}var Oy="[object String]";function yt(t){return typeof t=="string"||!ye(t)&&Te(t)&&tt(t)==Oy}function Ge(t){let e;const n=I(t,$d);return yt(n)?e=n:n!==void 0&&console.warn(`Expecting discriminator to be a string, got "${typeof n}" instead`),e}function jn(t){return Array.isArray(t)?"array":typeof t=="string"?"string":t==null?"null":typeof t=="boolean"?"boolean":isNaN(t)?typeof t=="object"?"object":"string":"number"}var Ay=fr(function(t){return Va($n(t,1,Sn,!0))});function Ie(t){let{type:e}=t;return!e&&t.const?jn(t.const):!e&&t.enum?"string":!e&&(t.properties||t.additionalProperties||t.patternProperties)?"object":(Array.isArray(e)&&(e.length===2&&e.includes("null")?e=e.find(n=>n!=="null"):e=e[0]),e)}function et(t,e){const n=Object.assign({},t);return Object.keys(e).reduce((r,i)=>{const s=t?t[i]:{},a=e[i];return t&&i in t&&Y(a)?r[i]=et(s,a):t&&e&&(Ie(t)==="object"||Ie(e)==="object")&&i===sa&&Array.isArray(s)&&Array.isArray(a)?r[i]=Ay(s,a):r[i]=a,r},n)}var _y="[object Number]";function rl(t){return typeof t=="number"||Te(t)&&tt(t)==_y}function il(t,e,n){var r;if(t&&n){const i=I(t,n);if(i===void 0)return;for(let s=0;s<e.length;s++){const a=e[s],o=I(a,[te,n],{});if(!(o.type==="object"||o.type==="array")&&(o.const===i||!((r=o.enum)===null||r===void 0)&&r.includes(i)))return s}}}function Li(t,e,n,r,i){if(e===void 0)return 0;const s=il(e,n,i);if(rl(s))return s;for(let a=0;a<n.length;a++){const o=n[a];if(i&&X(o,[te,i])){const l=I(e,i),d=I(o,[te,i],{});if(t.isValid(d,l,r))return a}else if(o[te]){const l={anyOf:Object.keys(o[te]).map(f=>({required:[f]}))};let d;if(o.anyOf){const{...f}=o;f.allOf?f.allOf=f.allOf.slice():f.allOf=[],f.allOf.push(l),d=f}else d=Object.assign({},o,l);if(delete d.required,t.isValid(d,e,r))return a}else if(t.isValid(o,e,r))return a}return 0}function be(t,e,n={},r,i,s=!1){return Ve(t,e,n,r,void 0,void 0,i,s)[0]}function Cy(t,e,n,r,i,s,a){const{if:o,then:l,else:d,...f}=e,u=t.isValid(o,s||{},n);let h=[f],g=[];if(r)l&&typeof l!="boolean"&&(g=g.concat(Ve(t,l,n,s,r,i,a))),d&&typeof d!="boolean"&&(g=g.concat(Ve(t,d,n,s,r,i,a)));else{const m=u?l:d;m&&typeof m!="boolean"&&(g=g.concat(Ve(t,m,n,s,r,i,a)))}return g.length&&(h=g.map(m=>et(f,m))),h.flatMap(m=>Ve(t,m,n,s,r,i,a))}function sl(t){return t.reduce((n,r)=>r.length>1?r.flatMap(i=>Na(n.length,s=>[...n[s]].concat(i))):(n.forEach(i=>i.push(r[0])),n),[[]])}function ol(t,e){return Object.keys(t.patternProperties).filter(n=>RegExp(n).test(e)).reduce((n,r)=>(se(n,[r],t.patternProperties[r]),n),{})}function Ny(t,e,n,r,i,s,a,o){const l=al(t,e,n,r,i,s,a,o);if(l.length>1||l[0]!==e)return l;if(xi in e)return ll(t,e,n,r,i,s,a).flatMap(f=>Ve(t,f,n,s,r,i,a));if(pt in e&&Array.isArray(e[pt])){const d=e.allOf.map(u=>Ve(t,u,n,s,r,i,a));return sl(d).map(u=>({...e,allOf:u}))}return[e]}function al(t,e,n,r,i,s,a,o){const l=Wt(e,n,i,void 0,o);return l!==e?Ve(t,l,n,s,r,i,a,o):[e]}function Wt(t,e,n,r,i){if(!Y(t))return t;let s=t;if(ce in s){const{$ref:a,...o}=s;if(n.includes(a))return s;n.push(a),s={...nl(a,e,r),...o},oe in s&&(r=s[oe])}if(te in s){const a=[],o=np(s[te],(l,d,f)=>{const u=[...n];l[f]=Wt(d,e,u,r,i),a.push(u)},{});bp(n,za(wp(a))),s={...s,[te]:o}}if(zt in s&&!Array.isArray(s.items)&&typeof s.items!="boolean"&&(s={...s,items:Wt(s.items,e,n,r,i)}),i){let a,o;J in t&&Array.isArray(t[J])?(a=J,o=s[J]):q in t&&Array.isArray(t[q])&&(a=q,o=s[q]),a&&o&&(s={...s,[a]:o.map(l=>Wt(l,e,n,r,i))})}return le(t,s)?t:s}function Ty(t,e,n,r,i){const s={...e,properties:{...e.properties}},a=r&&Y(r)?r:{};return Object.keys(a).forEach(o=>{if(!(o in s.properties)){if(qr in s){const l=ol(s,o);if(!me(l)){s.properties[o]=be(t,{[pt]:Object.values(l)},n,I(a,[o]),i),se(s.properties,[o,Qe],!0);return}}if(Zn in s&&s.additionalProperties!==!1){let l;typeof s.additionalProperties!="boolean"?ce in s.additionalProperties?l=be(t,{[ce]:I(s.additionalProperties,[ce])},n,a,i):"type"in s.additionalProperties?l={...s.additionalProperties}:J in s.additionalProperties||q in s.additionalProperties?l={type:"object",...s.additionalProperties}:l={type:jn(I(a,[o]))}:l={type:jn(I(a,[o]))},s.properties[o]=l,se(s.properties,[o,Qe],!0)}else s.properties[o]={type:"null"},se(s.properties,[o,Qe],!0)}}),s}const{compareSchemaDefinitions:Fy,compareSchemaValues:Py}=qp(),{mergeArrayOfSchemaDefinitions:Ey}=eg({intersectJson:Bp(Py),deduplicateJsonSchemaDef:qa(Fy)}),Iy=ng(Ey);function Dy(t){return Iy(t)}function Ve(t,e,n,r,i=!1,s=[],a,o){return Y(e)?Ny(t,e,n,i,s,r,a,o).flatMap(d=>{var f;let u=d;if(bi in u)return Cy(t,u,n,i,s,r,a);if(pt in u){if(i){const{allOf:g,...m}=u;return[...g,m]}try{const g=[],m=[];(f=u.allOf)===null||f===void 0||f.forEach(p=>{typeof p=="object"&&p.contains?g.push(p):m.push(p)}),g.length&&(u={...u,allOf:m}),u=a?a(u):Dy(u),g.length&&(u.allOf=g)}catch(g){console.warn(`could not merge subschemas in allOf:
|
|
2
2
|
`,g);const{allOf:m,...p}=u;return p}}return te in u&&qr in u&&(u=Object.keys(u.properties).reduce((g,m)=>{const p=ol(g,m);return me(p)||(g.properties[m]=be(t,{allOf:[g.properties[m],...Object.values(p)]},n,I(r,[m]),a)),g},{...u,properties:{...u.properties}})),qr in u||Zn in u&&u.additionalProperties!==!1?Ty(t,u,n,r,a):u}):[{}]}function $y(t,e,n,r,i){let s;const{oneOf:a,anyOf:o,...l}=e;if(Array.isArray(a)?s=a:Array.isArray(o)&&(s=o),s){const d=i===void 0&&r?{}:i,f=Ge(e);s=s.map(h=>Wt(h,n,[]));const u=Li(t,d,s,n,f);if(r)return s.map(h=>et(l,h));e=et(l,s[u])}return[e]}function ll(t,e,n,r,i,s,a){const{dependencies:o,...l}=e;return $y(t,l,n,r,s).flatMap(f=>cl(t,o,f,n,r,i,s,a))}function cl(t,e,n,r,i,s,a,o){let l=[n];for(const d in e){if(!i&&I(a,[d])===void 0||n.properties&&!(d in n.properties))continue;const[f,u]=Ui(d,e);return Array.isArray(u)?l[0]=ky(n,u):Y(u)&&(l=My(t,n,r,d,u,i,s,a,o)),l.flatMap(h=>cl(t,f,h,r,i,s,a,o))}return l}function ky(t,e){if(!e)return t;const n=Array.isArray(t.required)?Array.from(new Set([...t.required,...e])):e;return{...t,required:n}}function My(t,e,n,r,i,s,a,o,l){return Ve(t,i,n,o,s,a,l).flatMap(f=>{const{oneOf:u,...h}=f;if(e=et(e,h),u===void 0)return e;const g=u.map(p=>typeof p=="boolean"||!(ce in p)?[p]:al(t,p,n,s,a,o));return sl(g).flatMap(p=>Ry(t,e,n,r,p,s,a,o,l))})}function Ry(t,e,n,r,i,s,a,o,l){const d=i.filter(f=>{if(typeof f=="boolean"||!f||!f.properties)return!1;const{[r]:u}=f.properties;if(u){const h={type:"object",properties:{[r]:u}};return t.isValid(h,o,n)||s}return!1});return!s&&d.length!==1?(console.warn("ignoring oneOf in dependencies because there isn't exactly one subschema that is valid"),[e]):d.flatMap(f=>{const u=f,[h]=Ui(r,u.properties),g={...u,properties:h};return Ve(t,g,n,o,s,a,l).map(p=>et(e,p))})}function dn(t,e,n,r,i,s={},a){if(Array.isArray(n[i])){const l=Ge(n)||r,d=n[i].map(u=>be(t,u,e,s,a)),f=I(s,l);if(f!==void 0)return d.find(u=>dt(I(u,[te,l,ir],I(u,[te,l,Ce])),f))}}function ul(t,e,n,r,i){let s=n;if(X(n,ce)&&(s=be(t,n,e,void 0,i)),me(r))return s;const a=Array.isArray(r)?r:r.split("."),[o,...l]=a;if(o&&X(s,o))return s=I(s,o),ul(t,e,s,l,i)}function Yn(t,e,n,r,i,s){const a=ul(t,e,n,r,s);return a===void 0?i:a}const ro={title:"!@#$_UNKNOWN_$#@!"};function By(t,e,n,r,i={},s){const a=Array.isArray(r)?[...r]:r.split(".");let o=n;const l=a.pop();a.length&&a.forEach(h=>{o=Yn(t,e,o,[te,h],{},s),X(o,q)?o=dn(t,e,o,l,q,I(i,h),s):X(o,J)&&(o=dn(t,e,o,l,J,I(i,h),s))}),X(o,q)?o=dn(t,e,o,l,q,i,s):X(o,J)&&(o=dn(t,e,o,l,J,i,s));let d=Yn(t,e,o,[te,l],ro,s);d===ro&&(d=void 0);const f=Yn(t,e,o,sa,[],s);let u;return d&&Array.isArray(f)&&(u=f.includes(l)),{field:d,isRequired:u}}function Uy(t,e,n,r){var i=-1,s=t==null?0:t.length;for(r&&s&&(n=t[++i]);++i<s;)n=e(n,t[i],i,t);return n}function Ly(t,e){return function(n,r){if(n==null)return n;if(!Tt(n))return t(n,r);for(var i=n.length,s=-1,a=Object(n);++s<i&&r(a[s],s,a)!==!1;);return n}}var dl=Ly(Pa);function Wy(t,e,n,r,i){return i(t,function(s,a,o){n=r?(r=!1,s):e(n,s,a,o)}),n}function Vy(t,e,n){var r=ye(t)?Uy:Wy,i=arguments.length<3;return r(t,Di(e),n,i,dl)}const zy={type:"object",$id:Dd,properties:{__not_really_there__:{type:"number"}}};function ni(t,e,n,r,i){let s=0;return n&&(Z(n.properties)?s+=Vy(n.properties,(a,o,l)=>{const d=I(r,l);if(typeof o=="boolean")return a;if(X(o,ce)){const f=be(t,o,e,d,i);return a+ni(t,e,f,d||{},i)}if((X(o,q)||X(o,J))&&d){const f=X(o,q)?q:J,u=Ge(o);return a+On(t,e,d,I(o,f),-1,u,i)}if(o.type==="object")return Z(d)&&(a+=1),a+ni(t,e,o,d,i);if(o.type===jn(d)){let f=a+1;return o.default?f+=d===o.default?1:-1:o.const&&(f+=d===o.const?1:-1),f}return a},0):yt(n.type)&&n.type===jn(r)&&(s+=1)),s}function On(t,e,n,r,i=-1,s,a){const o=r.map(h=>Wt(h,e,[])),l=il(n,r,s);if(rl(l))return l;const d=o.reduce((h,g,m)=>(Li(t,n,[zy,g],e,s)===1&&h.push(m),h),[]);if(d.length===1)return d[0];d.length||Na(o.length,h=>d.push(h));const f=new Set,{bestIndex:u}=d.reduce((h,g)=>{const{bestScore:m}=h,p=o[g],y=ni(t,e,p,n,a);return f.add(y),y>m?{bestIndex:g,bestScore:y}:h},{bestIndex:i,bestScore:0});return f.size===1&&i>=0?i:u}function Wi(t){return Array.isArray(t.items)&&t.items.length>0&&t.items.every(e=>Y(e))}function rr(t){return t==null}function An(t,e,n=!1,r=!1,i=!1){if(Array.isArray(e)){const s=Array.isArray(t)?t:[],a=i?s:e,o=i?e:s,l=a.map((d,f)=>o[f]!==void 0?An(s[f],e[f],n,r,i):d);return(n||i)&&l.length<o.length&&l.push(...o.slice(l.length)),l}if(Y(e)){const s=Object.assign({},t);return Object.keys(e).reduce((a,o)=>{var l;const d=I(e,o),f=Y(t)&&o in t,u=o in e,h=(l=I(t,o))!==null&&l!==void 0?l:{},g=f&&Object.entries(h).some(([,y])=>Y(y)),m=f&&Y(I(t,o)),p=u&&Y(d);return m&&p&&!g?(a[o]={...I(t,o),...d},a):(a[o]=An(I(t,o),d,n,r,i&&(f||!u)),a)},s)}return r&&(t!==void 0&&rr(e)||typeof e=="number"&&isNaN(e))||i&&!rr(e)?t:e}function _n(t,e,n=!1){return Object.keys(e).reduce((r,i)=>{const s=t?t[i]:{},a=e[i];if(t&&i in t&&Y(a))r[i]=_n(s,a,n);else if(n&&Array.isArray(s)&&Array.isArray(a)){let o=a;n==="preventDuplicates"&&(o=a.reduce((l,d)=>(s.includes(d)||l.push(d),l),[])),r[i]=s.concat(o)}else r[i]=a;return r},Object.assign({},t))}function fl(t){return Array.isArray(t.enum)&&t.enum.length===1||Ce in t}function Vi(t,e,n={},r){const i=be(t,e,n,void 0,r),s=i.oneOf||i.anyOf;return Array.isArray(i.enum)?!0:Array.isArray(s)?s.every(a=>typeof a!="boolean"&&fl(a)):!1}function zi(t,e,n,r){return!e.uniqueItems||!e.items||typeof e.items=="boolean"?!1:Vi(t,e.items,n,r)}function ml(t){const e=t[Ce],n=Ie(t);return Y(e)&&yt(e?.$data)&&n!=="object"&&n!=="array"}function qy(t){if(Id in t&&Array.isArray(t.enum)&&t.enum.length===1)return t.enum[0];if(Ce in t)return t.const;throw new Error("schema cannot be inferred as a constant")}function Gt(t,e){if(t.enum){let s;if(e){const{enumNames:a}=U(e);s=a}return t.enum.map((a,o)=>({label:s?.[o]||String(a),value:a}))}let n,r;t.anyOf?(n=t.anyOf,r=e?.anyOf):t.oneOf&&(n=t.oneOf,r=e?.oneOf);let i=Ge(t);if(e){const{optionsSchemaSelector:s=i}=U(e);i=s}return n&&n.map((s,a)=>{const{title:o}=U(r?.[a]),l=s;let d,f=o;if(i){const u=I(l,[te,i],{});d=I(u,ir,I(u,Ce)),f=f||u?.title||l.title||String(d)}else d=qy(l),f=f||l.title||String(d);return{schema:l,label:f,value:d}})}const Ky=["string","number","integer","boolean","null"];var Ht;(function(t){t[t.Ignore=0]="Ignore",t[t.Invert=1]="Invert",t[t.Fallback=2]="Fallback"})(Ht||(Ht={}));function Ir(t,e=Ht.Ignore,n=-1){if(n>=0){if(Array.isArray(t.items)&&n<t.items.length){const r=t.items[n];if(typeof r!="boolean")return r}}else if(t.items&&!Array.isArray(t.items)&&typeof t.items!="boolean")return t.items;return e!==Ht.Ignore&&Y(t.additionalItems)?t.additionalItems:{}}function hl(t,e){const{default:n,type:r}=t;return Array.isArray(r)&&r.includes("null")&&me(e)&&n===null?null:e}function io(t,e,n,r,i,s=[],a={},o=!1,l=!1){const{emptyObjectFields:d="populateAllDefaults"}=a;if(r===!0||o)t[e]=n;else if(r==="excludeObjectChildren")(l&&n!==void 0||!Y(n)||!me(n))&&(t[e]=n);else if(d!=="skipDefaults"){const f=i===void 0?s.includes(e):i;Y(n)?d==="skipEmptyDefaults"?me(n)||(t[e]=n):(!me(n)||s.includes(e))&&(f||d!=="populateRequiredDefaults")&&(t[e]=n):n!==void 0&&(d==="populateAllDefaults"||d==="skipEmptyDefaults"||f&&s.includes(e))&&(t[e]=n)}}function ft(t,e,n={}){const{parentDefaults:r,rawFormData:i,rootSchema:s={},includeUndefinedValues:a=!1,_recurseList:o=[],experimental_defaultFormStateBehavior:l=void 0,experimental_customMergeAllOf:d=void 0,required:f,shouldMergeDefaultsIntoFormData:u=!1,initialDefaultsGenerated:h}=n;let g=Y(i)?i:{};const m=Y(e)?e:{};let p=r,y=null,x=l,S=o;if(m[Ce]!==void 0&&l?.constAsDefaults!=="never"&&!ml(m))p=m[Ce];else if(Y(p)&&Y(m.default)&&!m[J]&&!m[q]&&!m[ce])p=_n(p,m.default);else if(ir in m&&!m[J]&&!m[q]&&!m[ce])p=m.default;else if(ce in m){const v=m[ce];o.includes(v)||(S=o.concat(v),y=nl(v,s));const w=i===void 0||Y(i)&&me(i);y&&!p&&w&&(p=m.default),u&&y&&!Y(i)&&(g=i)}else if(xi in m){const v={...so(t,m,n,p),...g};y=ll(t,m,s,!1,[],v,d)[0]}else if(Wi(m))p=m.items.map((v,w)=>ft(t,v,{rootSchema:s,includeUndefinedValues:a,_recurseList:o,experimental_defaultFormStateBehavior:l,experimental_customMergeAllOf:d,parentDefaults:Array.isArray(r)?r[w]:void 0,rawFormData:g,required:f,shouldMergeDefaultsIntoFormData:u}));else if(q in m){const{oneOf:v,...w}=m;if(v.length===0)return;const O=Ge(m),{type:A="null"}=w;!Array.isArray(A)&&Ky.includes(A)&&x?.constAsDefaults==="skipOneOf"&&(x={...x,constAsDefaults:"never"}),y=v[On(t,s,i??m.default,v,0,O,d)],y=et(w,y)}else if(J in m){const{anyOf:v,...w}=m;if(v.length===0)return;const O=Ge(m);y=v[On(t,s,i??m.default,v,0,O,d)],y=et(w,y)}if(y)return ft(t,y,{rootSchema:s,includeUndefinedValues:a,_recurseList:S,experimental_defaultFormStateBehavior:x,experimental_customMergeAllOf:d,parentDefaults:p,rawFormData:i??g,required:f,shouldMergeDefaultsIntoFormData:u,initialDefaultsGenerated:h});p===void 0&&(p=m.default);const j=so(t,m,n,p);let b=j??p;if(u){const{arrayMinItems:v={}}=l||{},{mergeExtraDefaults:w}=v,O=Gy(t,m,s,i,l,d);(!Y(i)||pt in m)&&(b=An(b,O,w,!0))}return b}function Gy(t,e,n,r,i,s){const a=!fl(e)&&Vi(t,e,n,s);let o=r;if(a){const d=Gt(e);o=d?.some(u=>le(u.value,r))?r:void 0}return e[Ce]&&i?.constAsDefaults==="always"&&(o=e.const),o}function Hy(t,e,{rawFormData:n,rootSchema:r={},includeUndefinedValues:i=!1,_recurseList:s=[],experimental_defaultFormStateBehavior:a=void 0,experimental_customMergeAllOf:o=void 0,required:l,shouldMergeDefaultsIntoFormData:d,initialDefaultsGenerated:f}={},u){{const h=Y(n)?n:{},g=e,p=a?.allOf==="populateDefaults"&&pt in g||a?.emptyObjectFields!=="skipEmptyDefaults"&&bi in g?be(t,g,r,h,o):g,y=p[Ce],x=Object.keys(p.properties||{}).reduce((S,j)=>{var b;const v=I(p,[te,j],{}),w=Y(y)&&y[j]!==void 0,O=(Y(v)&&Ce in v||w)&&a?.constAsDefaults!=="never"&&!ml(v),A=ft(t,v,{rootSchema:r,_recurseList:s,experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:o,includeUndefinedValues:i===!0,parentDefaults:I(u,[j]),rawFormData:I(h,[j]),required:(b=p.required)===null||b===void 0?void 0:b.includes(j),shouldMergeDefaultsIntoFormData:d,initialDefaultsGenerated:f});return io(S,j,A,i,l,p.required,a,O,v?.type==="null"),S},{});if(p.additionalProperties&&!f){const S=Y(p.additionalProperties)?p.additionalProperties:{},j=new Set;Y(u)&&Object.keys(u).filter(v=>!p.properties||!p.properties[v]).forEach(v=>j.add(v));const b=[];Object.keys(h).filter(v=>!p.properties||!p.properties[v]).forEach(v=>{j.add(v),b.push(v)}),j.forEach(v=>{var w;const O=ft(t,S,{rootSchema:r,_recurseList:s,experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:o,includeUndefinedValues:i===!0,parentDefaults:I(u,[v]),rawFormData:I(h,[v]),required:(w=p.required)===null||w===void 0?void 0:w.includes(v),shouldMergeDefaultsIntoFormData:d,initialDefaultsGenerated:f});io(x,v,O,i,l,b)})}return hl(e,x)}}function Yy(t,e,{rawFormData:n,rootSchema:r={},_recurseList:i=[],experimental_defaultFormStateBehavior:s=void 0,experimental_customMergeAllOf:a=void 0,required:o,requiredAsRoot:l=!1,shouldMergeDefaultsIntoFormData:d,initialDefaultsGenerated:f}={},u){var h,g;const m=e,p=(h=s?.arrayMinItems)!==null&&h!==void 0?h:{},{populate:y,mergeExtraDefaults:x}=p,S=y==="never",j=y==="requiredOnly",b=y==="all"||!S&&!j,v=(g=p?.computeSkipPopulate)!==null&&g!==void 0?g:(()=>!1),O=s?.emptyObjectFields==="skipEmptyDefaults"?void 0:[];if(Array.isArray(u)&&(u=u.map((N,C)=>{const F=Ir(m,Ht.Fallback,C),$=Array.isArray(n)?n[C]:void 0;return ft(t,F,{rootSchema:r,_recurseList:i,experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:a,parentDefaults:N,rawFormData:$,required:o,shouldMergeDefaultsIntoFormData:d,initialDefaultsGenerated:f})})),Array.isArray(n)){const N=Ir(m);if(S)u=n;else{const C=n.map(($,E)=>ft(t,N,{rootSchema:r,_recurseList:i,experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:a,rawFormData:$,parentDefaults:I(u,[E]),required:o,shouldMergeDefaultsIntoFormData:d,initialDefaultsGenerated:f}));u=An(u,C,(j&&o||b)&&x)}}if((Y(m)&&Ce in m&&s?.constAsDefaults!=="never")===!1){if(S)return u??O;if(j&&!o)return u||void 0}let _;const T=Array.isArray(u)?u.length:0;if(!m.minItems||zi(t,m,r,a)||v(t,m,r)||m.minItems<=T)_=u||!o&&!l?u:O;else{const N=u||[],C=Ir(m,Ht.Invert),F=C.default,$=Array.from({length:m.minItems-T},()=>ft(t,C,{parentDefaults:F,rootSchema:r,_recurseList:i,experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:a,required:o,shouldMergeDefaultsIntoFormData:d}));_=N.concat($)}return hl(e,_)}function so(t,e,n={},r){switch(Ie(e)){case"object":return Hy(t,e,n,r);case"array":return Yy(t,e,n,r)}}function pl(t,e,n,r,i=!1,s,a,o){if(!Y(e))throw new Error("Invalid schema: "+e);const l=be(t,e,r,n,a),d=ft(t,l,{rootSchema:r,includeUndefinedValues:i,experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:a,rawFormData:n,shouldMergeDefaultsIntoFormData:!0,initialDefaultsGenerated:o,requiredAsRoot:!0});if(l.type!=="object"&&Y(l.default))return{...d,...n};if(Y(n)||Array.isArray(n)){const{mergeDefaultsIntoFormData:f}=s||{};return An(d,n,!0,f==="useDefaultIfFormDataUndefined",!0)}return d}function gl(t={}){return"widget"in U(t)&&U(t).widget!=="hidden"}function yl(t,e,n={},r,i){if(n[Si]==="files")return!0;if(e.items){const s=be(t,e.items,r,void 0,i);return s.type==="string"&&s.format==="data-url"}return!1}function Xy(t,e,n={},r,i,s){const a=U(n,i),{label:o=!0}=a;let l=!!o;if(l){const d=Ie(e),f=I(e,Qe,!1);d==="array"&&(l=f||zi(t,e,r,s)||yl(t,e,n,r,s)||gl(n)),d==="object"&&(l=f),d==="boolean"&&n&&!n[Si]&&(l=!1),n&&n[Md]&&(l=!1)}return l}function xl(t,e,n){for(var r=-1,i=e.length,s={};++r<i;){var a=e[r],o=ur(t,a);n(o,a)&&Ei(s,Jt(a,t),o)}return s}function Jy(t,e){return xl(t,e,function(n,r){return Da(t,r)})}var qi=el(function(t,e){return t==null?{}:Jy(t,e)});function St(t,e,n,r,i,s=[],a){if(ce in e||xi in e||pt in e||bi in e){const l=be(t,e,r,i,a);if(s.findIndex(f=>le(f,l))===-1)return St(t,l,n,r,i,s.concat(l),a)}let o={[qn]:n.replace(/^\./,"")};if(q in e||J in e){const l=q in e?e.oneOf:e.anyOf,d=Ge(e),f=On(t,r,i,l,0,d,a),u=l[f];o={...o,...St(t,u,n,r,i,s,a)}}if(Zn in e&&e[Zn]!==!1&&se(o,vi,!0),zt in e&&Array.isArray(i)){const{items:l,additionalItems:d}=e;Array.isArray(l)?i.forEach((f,u)=>{l[u]?o[u]=St(t,l[u],`${n}.${u}`,r,f,s,a):d?o[u]=St(t,d,`${n}.${u}`,r,f,s,a):console.warn(`Unable to generate path schema for "${n}.${u}". No schema defined for it`)}):i.forEach((f,u)=>{o[u]=St(t,l,`${n}.${u}`,r,f,s,a)})}else if(te in e)for(const l in e.properties){const d=I(e,[te,l],{});o[l]=St(t,d,`${n}.${l}`,r,I(i,[l]),s,a)}return o}function bl(t,e,n="",r,i,s){return St(t,e,n,r,i,void 0,s)}function vl(t,e){if(e.length===0&&typeof t!="object")return t;const n=qi(t,e);return Array.isArray(t)?Object.keys(n).map(r=>n[r]):n}function Sl(t,e){const n=(i,s)=>typeof i!="object"||me(i)||s&&!me(i),r=(i,s=[],a=[[]])=>{const o=Object.keys(i);return o.forEach(l=>{const d=i[l];if(typeof d=="object"){const f=a.map(u=>[...u,l]);d[vi]&&d[qn]!==""?s.push(d[qn]):r(d,s,f)}else l===qn&&d!==""&&a.forEach(f=>{const u=I(e,f),h=o.length===1;(n(u,h)||Array.isArray(u)&&u.every(g=>n(g,h)))&&s.push(f)})}),s};return r(t)}function Zy(t,e,n={},r){const i=be(t,e,n,r),s=bl(t,i,"",n,r),o=Sl(s,r).map(l=>Array.isArray(l)?l.join("."):l);return vl(r,o)}const Dt=Symbol("no Value");function ri(t,e,n,r,i={},s){let a;if(X(n,te)){const o={};if(X(r,te)){const f=I(r,te,{});Object.keys(f).forEach(u=>{X(i,u)&&(o[u]=void 0)})}const l=Object.keys(I(n,te,{})),d={};l.forEach(f=>{const u=I(i,f);let h=I(r,[te,f],{}),g=I(n,[te,f],{});X(h,ce)&&(h=be(t,h,e,u,s)),X(g,ce)&&(g=be(t,g,e,u,s));const m=I(h,"type"),p=I(g,"type");if(!m||m===p)if(X(o,f)&&delete o[f],p==="object"||p==="array"&&Array.isArray(u)){const y=ri(t,e,g,h,u,s);(y!==void 0||p==="array")&&(d[f]=y)}else{const y=I(g,"default",Dt),x=I(h,"default",Dt);y!==Dt&&y!==u&&(x===u?o[f]=y:I(g,"readOnly")===!0&&(o[f]=void 0));const S=I(g,"const",Dt),j=I(h,"const",Dt);S!==Dt&&S!==u&&(o[f]=j===u?S:void 0)}}),a={...typeof i=="string"||Array.isArray(i)?void 0:i,...o,...d}}else if(I(r,"type")==="array"&&I(n,"type")==="array"&&Array.isArray(i)){let o=I(r,"items"),l=I(n,"items");if(typeof o=="object"&&typeof l=="object"&&!Array.isArray(o)&&!Array.isArray(l)){X(o,ce)&&(o=be(t,o,e,i,s)),X(l,ce)&&(l=be(t,l,e,i,s));const d=I(o,"type"),f=I(l,"type");if(!d||d===f){const u=I(n,"maxItems",-1);f==="object"?a=i.reduce((h,g)=>{const m=ri(t,e,l,o,g,s);return m!==void 0&&(u<0||h.length<u)&&h.push(m),h},[]):a=u>0&&i.length>u?i.slice(0,u):i}}else typeof o=="boolean"&&typeof l=="boolean"&&o===l&&(a=i)}return a}class Qy{constructor(e,n,r,i){n&&n[cn]===Kn?this.rootSchema=ti(n,I(n,oe,"#")):this.rootSchema=n,this.validator=e,this.experimental_defaultFormStateBehavior=r,this.experimental_customMergeAllOf=i}getRootSchema(){return this.rootSchema}getValidator(){return this.validator}doesSchemaUtilsDiffer(e,n,r={},i){return!e||!n?!1:this.validator!==e||!le(this.rootSchema,n)||!le(this.experimental_defaultFormStateBehavior,r)||this.experimental_customMergeAllOf!==i}findFieldInSchema(e,n,r){return By(this.validator,this.rootSchema,e,n,r,this.experimental_customMergeAllOf)}findSelectedOptionInXxxOf(e,n,r,i){return dn(this.validator,this.rootSchema,e,n,r,i,this.experimental_customMergeAllOf)}getDefaultFormState(e,n,r=!1,i){return pl(this.validator,e,n,this.rootSchema,r,this.experimental_defaultFormStateBehavior,this.experimental_customMergeAllOf,i)}getDisplayLabel(e,n,r){return Xy(this.validator,e,n,this.rootSchema,r,this.experimental_customMergeAllOf)}getClosestMatchingOption(e,n,r,i){return On(this.validator,this.rootSchema,e,n,r,i,this.experimental_customMergeAllOf)}getFirstMatchingOption(e,n,r){return Li(this.validator,e,n,this.rootSchema,r)}getFromSchema(e,n,r){return Yn(this.validator,this.rootSchema,e,n,r,this.experimental_customMergeAllOf)}isFilesArray(e,n){return yl(this.validator,e,n,this.rootSchema,this.experimental_customMergeAllOf)}isMultiSelect(e){return zi(this.validator,e,this.rootSchema,this.experimental_customMergeAllOf)}isSelect(e){return Vi(this.validator,e,this.rootSchema,this.experimental_customMergeAllOf)}omitExtraData(e,n){return Zy(this.validator,e,this.rootSchema,n)}retrieveSchema(e,n,r){return be(this.validator,e,this.rootSchema,n,this.experimental_customMergeAllOf,r)}sanitizeDataForNewSchema(e,n,r){return ri(this.validator,this.rootSchema,e,n,r,this.experimental_customMergeAllOf)}toPathSchema(e,n,r){return bl(this.validator,e,n,this.rootSchema,r,this.experimental_customMergeAllOf)}}function ex(t,e,n={},r){return new Qy(t,e,n,r)}function tx(t){var e;if(t.indexOf("data:")===-1)throw new Error("File is invalid: URI must be a dataURI");const r=t.slice(5).split(";base64,");if(r.length!==2)throw new Error("File is invalid: dataURI must be base64");const[i,s]=r,[a,...o]=i.split(";"),l=a||"",d=decodeURI(((e=o.map(f=>f.split("=")).find(([f])=>f==="name"))===null||e===void 0?void 0:e[1])||"unknown");try{const f=atob(s),u=new Array(f.length);for(let g=0;g<f.length;g++)u[g]=f.charCodeAt(g);return{blob:new window.Blob([new Uint8Array(u)],{type:l}),name:d}}catch(f){throw new Error("File is invalid: "+f.message)}}function at(t,e){let n=String(t);for(;n.length<e;)n="0"+n;return n}function wl(t,e){if(t<=0&&e<=0)t=new Date().getFullYear()+t,e=new Date().getFullYear()+e;else if(t<0||e<0)throw new Error(`Both start (${t}) and stop (${e}) must both be <= 0 or > 0, got one of each`);if(t>e)return wl(e,t).reverse();const n=[];for(let r=t;r<=e;r++)n.push({value:r,label:at(r,2)});return n}function oo(t,e){if(Object.is(t,e))return!0;if(t==null||e==null||typeof t!="object"||typeof e!="object")return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++){const s=n[i];if(!Object.prototype.hasOwnProperty.call(e,s)||!Object.is(t[s],e[s]))return!1}return!0}function nx(t,e){let n=t;if(Array.isArray(e)){const r=n.split(/(%\d)/);e.forEach((i,s)=>{const a=r.findIndex(o=>o===`%${s+1}`);a>=0&&(r[a]=i)}),n=r.join("")}return n}function rx(t,e){return nx(t,e)}function ge(t,e=[],n){if(Array.isArray(t))return t.map(s=>ge(s,e)).filter(s=>s!==n);const r=t===""||t===null?-1:Number(t),i=e[r];return i?i.value:n}function jl(t,e,n=[]){const r=ge(t,n);return Array.isArray(e)?e.filter(i=>!le(i,r)):le(r,e)?void 0:e}function kn(t,e){return Array.isArray(e)?e.some(n=>le(n,t)):le(e,t)}function Ol(t,e=[],n=!1){const r=e.map((i,s)=>kn(i.value,t)?String(s):void 0).filter(i=>typeof i<"u");return n?r:r[0]}function Al(t,e,n=[]){const r=ge(t,n);if(!rr(r)){const i=n.findIndex(o=>r===o.value),s=n.map(({value:o})=>o);return e.slice(0,i).concat(r,e.slice(i)).sort((o,l)=>+(s.indexOf(o)>s.indexOf(l)))}return e}var ix=1,sx=4;function Ki(t){return mn(t,ix|sx)}function ox(t,e,n,r){return r=typeof r=="function"?r:void 0,t==null?t:Ei(t,e,n,r)}class _l{constructor(e){this.errorSchema={},this.resetAllErrors(e)}get ErrorSchema(){return this.errorSchema}getOrCreateErrorBlock(e){let r=Array.isArray(e)&&e.length>0||typeof e=="string"?I(this.errorSchema,e):this.errorSchema;return!r&&e&&(r={},ox(this.errorSchema,e,r,Object)),r}resetAllErrors(e){return this.errorSchema=e?Ki(e):{},this}addErrors(e,n){const r=this.getOrCreateErrorBlock(n);let i=I(r,xe);return Array.isArray(i)||(i=[],r[xe]=i),Array.isArray(e)?se(r,xe,[...new Set([...i,...e])]):se(r,xe,[...new Set([...i,e])]),this}setErrors(e,n){const r=this.getOrCreateErrorBlock(n),i=Array.isArray(e)?[...new Set([...e])]:[e];return se(r,xe,i),this}clearErrors(e){const n=this.getOrCreateErrorBlock(e);return se(n,xe,[]),this}}function ax(t,e){if(t==null)return{};var n=Xt(Ri(t),function(r){return[r]});return e=Di(e),xl(t,n,function(r,i){return e(r,i[0])})}var lx=200;function cx(t,e,n,r){var i=-1,s=Mi,a=!0,o=t.length,l=[],d=e.length;if(!o)return l;e.length>=lx&&(s=vn,a=!1,e=new Ot(e));e:for(;++i<o;){var f=t[i],u=f;if(f=f!==0?f:0,a&&u===u){for(var h=d;h--;)if(e[h]===u)continue e;l.push(f)}else s(e,u,r)||l.push(f)}return l}var ux=fr(function(t,e){return Sn(t)?cx(t,$n(e,1,Sn,!0)):[]});function ao(t,e){const n=gt(t),r=gt(e);if(t===e||!n&&!r)return[];if(n&&!r)return Pe(t);if(!n&&r)return Pe(e);{const i=Pe(ax(t,(a,o)=>!le(a,I(e,o)))),s=ux(Pe(e),Pe(t));return[...i,...s]}}function dx(t,e,n=[1900,new Date().getFullYear()+2],r="YMD"){const{day:i,month:s,year:a,hour:o,minute:l,second:d}=t,f={type:"day",range:[1,31],value:i},u={type:"month",range:[1,12],value:s},h={type:"year",range:n,value:a},g=[];switch(r){case"MDY":g.push(u,f,h);break;case"DMY":g.push(f,u,h);break;default:g.push(h,u,f)}return e&&g.push({type:"hour",range:[0,23],value:o},{type:"minute",range:[0,59],value:l},{type:"second",range:[0,59],value:d}),g}function Cl(t){const e={};return t.multipleOf&&(e.step=t.multipleOf),(t.minimum||t.minimum===0)&&(e.min=t.minimum),(t.maximum||t.maximum===0)&&(e.max=t.maximum),e}function Nl(t,e,n={},r=!0){const i={type:e||"text",...Cl(t)};return n.inputType?i.type=n.inputType:e||(t.type==="number"?(i.type="number",r&&i.step===void 0&&(i.step="any")):t.type==="integer"&&(i.type="number",i.step===void 0&&(i.step=1))),n.autocomplete&&(i.autoComplete=n.autocomplete),n.accept&&(i.accept=n.accept),i}const lo={props:{disabled:!1},submitText:"Submit",norender:!1};function Tl(t={}){const e=U(t);if(e&&e[Qn]){const n=e[Qn];return{...lo,...n}}return lo}function L(t,e,n={}){const{templates:r}=e;if(t==="ButtonTemplates")return r[t];if(Object.hasOwn(n,t)&&typeof n[t]=="string"&&Object.hasOwn(r,n[t])){const i=n[t];return r[i]}return n[t]||r[t]}var fx=0;function Fl(t){var e=++fx;return Ti(t)+e}function Gi(){if(typeof process>"u"||I(process,"env.NODE_ENV")!=="test")return{};const t=new Map;return new Proxy({},{get(e,n){return t.has(n)||t.set(n,Fl("test-id-")),t.get(n)}})}const Dr={boolean:{checkbox:"CheckboxWidget",radio:"RadioWidget",select:"SelectWidget",hidden:"HiddenWidget"},string:{text:"TextWidget",password:"PasswordWidget",email:"EmailWidget",hostname:"TextWidget",ipv4:"TextWidget",ipv6:"TextWidget",uri:"URLWidget","data-url":"FileWidget",radio:"RadioWidget",select:"SelectWidget",textarea:"TextareaWidget",hidden:"HiddenWidget",date:"DateWidget",datetime:"DateTimeWidget","date-time":"DateTimeWidget","alt-date":"AltDateWidget","alt-datetime":"AltDateTimeWidget",time:"TimeWidget",color:"ColorWidget",file:"FileWidget"},number:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},integer:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},array:{select:"SelectWidget",checkboxes:"CheckboxesWidget",files:"FileWidget",hidden:"HiddenWidget"}};function mx(t){let e=I(t,"MergedWidget");if(!e){const n=t.defaultProps&&t.defaultProps.options||{};e=({options:r,...i})=>c.jsx(t,{options:{...n,...r},...i}),se(t,"MergedWidget",e)}return e}function He(t,e,n={}){const r=Ie(t);if(typeof e=="function"||e&&us.isForwardRef(P.createElement(e))||us.isMemo(e))return mx(e);if(typeof e!="string")throw new Error(`Unsupported widget definition: ${typeof e} in schema: ${JSON.stringify(t)}`);if(e in n){const i=n[e];return He(t,i,n)}if(typeof r=="string"){if(!(r in Dr))throw new Error(`No widget for type '${r}' in schema: ${JSON.stringify(t)}`);if(e in Dr[r]){const i=n[Dr[r][e]];return He(t,i,n)}}throw new Error(`No widget '${e}' for type '${r}' in schema: ${JSON.stringify(t)}`)}function hx(t){let e=0;for(let n=0;n<t.length;n+=1){const r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return e.toString(16)}function px(t){const e=new Set;return JSON.stringify(t,(n,r)=>(e.add(n),r)),JSON.stringify(t,Array.from(e).sort())}function ze(t){return hx(px(t))}function gx(t){return ze(t)}function yx(t,e,n={}){try{return He(t,e,n),!0}catch(r){const i=r;if(i.message&&(i.message.startsWith("No widget")||i.message.startsWith("Unsupported widget")))return!1;throw r}}function Pt(t,e){return`${yt(t)?t:t[oe]}__${e}`}function Et(t){return Pt(t,"description")}function Hi(t){return Pt(t,"error")}function Cn(t){return Pt(t,"examples")}function Yi(t){return Pt(t,"help")}function hr(t){return Pt(t,"title")}function we(t,e=!1){const n=e?` ${Cn(t)}`:"";return`${Hi(t)} ${Et(t)} ${Yi(t)}${n}`}function wt(t,e){return`${t}-${e}`}function qe(t,e){return Pt(t,e)}function $r(t,e){return Pt(t,`optional${e}`)}function Qt(t){return!rr(t)&&(!Z(t)||Array.isArray(t)||!me(t))}function xx(t,e){const{rootSchema:n,schemaUtils:r}=t;if(dt(e,n))return!0;if(ce in n){const i=r.retrieveSchema(n);return dt(e,i)}return!1}function Pl(t,e,n){return e?n:t}function bx(t){return t?new Date(t).toJSON():void 0}function Xi(t,e,n){const r=[kd];return X(t,gs)&&r.unshift(gs),I(t,[...r,e],n)}function vx(t,e){if(!Array.isArray(e))return t;const n=f=>f.reduce((u,h)=>(u[h]=!0,u),{}),r=f=>f.length>1?`properties '${f.join("', '")}'`:`property '${f[0]}'`,i=n(t),s=e.filter(f=>f==="*"||i[f]),a=n(s),o=t.filter(f=>!a[f]),l=s.indexOf("*");if(l===-1){if(o.length)throw new Error(`uiSchema order list does not contain ${r(o)}`);return s}if(l!==s.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");const d=[...s];return d.splice(l,1,...o),d}function kr(t,e=!0){if(!t)return{year:-1,month:-1,day:-1,hour:e?-1:0,minute:e?-1:0,second:e?-1:0};const n=new Date(t);if(Number.isNaN(n.getTime()))throw new Error("Unable to parse date "+t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:e?n.getUTCHours():0,minute:e?n.getUTCMinutes():0,second:e?n.getUTCSeconds():0}}function hn(t){if(t.const||t.enum&&t.enum.length===1&&t.enum[0]===!0)return!0;if(t.anyOf&&t.anyOf.length===1)return hn(t.anyOf[0]);if(t.oneOf&&t.oneOf.length===1)return hn(t.oneOf[0]);if(t.allOf){const e=n=>hn(n);return t.allOf.some(e)}return!1}function El(t,e,n,r="customDeep"){if(r==="always")return!0;if(r==="shallow"){const{props:a,state:o}=t;return!oo(a,e)||!oo(o,n)}const{props:i,state:s}=t;return!le(i,e)||!le(s,n)}function co(t){const e=za(t.map(n=>Z(n)?Ie(n):void 0).flat().filter(n=>n!==void 0));return e.length===1?e[0]:e}function Mn(t,e,n,r){const{enableOptionalDataFieldForType:i=[]}=U(r,t.globalUiOptions);let s;return J in e&&Array.isArray(e[J])?s=co(e[J]):q in e&&Array.isArray(e[q])?s=co(e[q]):s=Ie(e),!xx(t,e)&&!n&&!!s&&!Array.isArray(s)&&!!i.find(a=>a===s)}function uo(t,e=!0){const{year:n,month:r,day:i,hour:s=0,minute:a=0,second:o=0}=t,l=Date.UTC(n,r-1,i,s,a,o),d=new Date(l).toJSON();return e?d:d.slice(0,10)}function Ji(t,e=[]){if(!t)return[];let n=[];return xe in t&&(n=n.concat(t[xe].map(r=>{const i=`.${e.join(".")}`;return{property:i,message:r,stack:`${i} ${r}`}}))),Object.keys(t).reduce((r,i)=>{if(i!==xe){const s=t[i];gt(s)&&(r=r.concat(Ji(s,[...e,i])))}return r},n)}function Il(t){return ye(t)?Xt(t,Ft):In(t)?[t]:ki(ja(Ti(t)))}function Sx(t){const e=new _l;return t.length&&t.forEach(n=>{const{property:r,message:i}=n,s=r==="."?[]:Il(r);s.length>0&&s[0]===""&&s.splice(0,1),i&&e.addErrors(i,s)}),e.ErrorSchema}function Fe(t,e,n,r){const i=Array.isArray(n)?n:n?.path,s=t===""?[]:[t],a=i?i.concat(...s):s,o=[e.idPrefix,...a].join(e.idSeparator);let l;return e.nameGenerator&&a.length>0&&(l=e.nameGenerator(a,e.idPrefix,r)),{path:a,[oe]:o,...l!==void 0&&{name:l}}}function Dl(t){return Object.keys(t).reduce((e,n)=>{if(n==="addError")return e;{const r=t[n];return gt(r)?{...e,[n]:Dl(r)}:{...e,[n]:r}}},{})}function wx(t){return Object.values(t).every(e=>e!==-1)}function jx(t){const{className:e="form-control",type:n,range:r,value:i,select:s,rootId:a,name:o,disabled:l,readonly:d,autofocus:f,registry:u,onBlur:h,onFocus:g}=t,m=`${a}_${n}`,{SelectWidget:p}=u.widgets,y=P.useCallback(x=>s(n,x),[s,n]);return c.jsx(p,{schema:{type:"integer"},id:m,name:o,className:e,options:{enumOptions:wl(r[0],r[1])},placeholder:n,value:i,disabled:l,readonly:d,autofocus:f,onChange:y,onBlur:h,onFocus:g,registry:u,label:"","aria-describedby":we(a)})}function Ox(t){const{time:e=!1,disabled:n=!1,readonly:r=!1,options:i,onChange:s,value:a}=t,[o,l]=P.useState(kr(a,e));P.useEffect(()=>{l(kr(a,e))},[e,a]);const d=P.useCallback((g,m)=>{const p={...o,[g]:typeof m>"u"?-1:m};wx(p)?s(uo(p,e)):l(p)},[o,s,e]),f=P.useCallback(g=>{g.preventDefault(),!(n||r)&&s(void 0)},[n,r,s]),u=P.useCallback(g=>{if(g.preventDefault(),n||r)return;const m=kr(new Date().toJSON(),e);s(uo(m,e))},[n,r,e,s]);return{elements:P.useMemo(()=>dx(o,e,i.yearsRange,i.format),[o,e,i.yearsRange,i.format]),handleChange:d,handleClear:f,handleSetNow:u}}function It(t){const e=P.useRef(t);return dt(t,e.current)||(e.current=t),e.current}function Ax(t,e){return t.replace(";base64",`;name=${encodeURIComponent(e)};base64`)}function _x(t){const{name:e,size:n,type:r}=t;return new Promise((i,s)=>{const a=new window.FileReader;a.onerror=s,a.onload=o=>{var l;typeof((l=o.target)===null||l===void 0?void 0:l.result)=="string"?i({dataURL:Ax(o.target.result,e),name:e,size:n,type:r}):i({dataURL:null,name:e,size:n,type:r})},a.readAsDataURL(t)})}function Cx(t){return Promise.all(Array.from(t).map(_x))}function fo(t){return t.reduce((e,n)=>{if(!n)return e;try{const{blob:r,name:i}=tx(n);return[...e,{dataURL:n,name:i,size:r.size,type:r.type}]}catch{return e}},[])}function Nx(t,e,n=!1){const r=P.useMemo(()=>n&&t?Array.isArray(t)?t:[t]:[],[t,n]),i=P.useMemo(()=>Array.isArray(t)?fo(t):fo([t||""]),[t]),s=P.useCallback(o=>{Cx(o).then(l=>{const d=l.map(f=>f.dataURL||null);e(n?r.concat(...d):d[0])})},[r,n,e]),a=P.useCallback(o=>{if(n){const l=r.filter((d,f)=>f!==o);e(l)}else e(void 0)},[r,n,e]);return{filesInfo:i,handleChange:s,handleRemove:a}}function Tx(t){if(!t)return"";const e=new Date(t),n=at(e.getFullYear(),4),r=at(e.getMonth()+1,2),i=at(e.getDate(),2),s=at(e.getHours(),2),a=at(e.getMinutes(),2),o=at(e.getSeconds(),2),l=at(e.getMilliseconds(),3);return`${n}-${r}-${i}T${s}:${a}:${o}.${l}`}function Xn(t,e,n=!1){if(!e)return t;const{errors:r,errorSchema:i}=t;let s=Ji(e),a=e;return me(i)||(a=_n(i,e,n?"preventDuplicates":!0),s=[...r].concat(s)),{errorSchema:a,errors:s}}function Fx(t){for(const e in t){const n=t,r=n[e];e===ce&&typeof r=="string"&&r.startsWith("#")?n[e]=la+r:n[e]=Zi(r)}return t}function Px(t){for(let e=0;e<t.length;e++)t[e]=Zi(t[e]);return t}function Zi(t){return Array.isArray(t)?Px([...t]):Z(t)?Fx({...t}):t}var K;(function(t){t.ArrayItemTitle="Item",t.MissingItems="Missing items definition",t.EmptyArray="No items yet. Use the button below to add some.",t.YesLabel="Yes",t.NoLabel="No",t.CloseLabel="Close",t.ErrorsLabel="Errors",t.NewStringDefault="New Value",t.AddButton="Add",t.AddItemButton="Add Item",t.CopyButton="Copy",t.MoveDownButton="Move down",t.MoveUpButton="Move up",t.RemoveButton="Remove",t.NowLabel="Now",t.ClearLabel="Clear",t.AriaDateLabel="Select a date",t.PreviewLabel="Preview",t.DecrementAriaLabel="Decrease value by 1",t.IncrementAriaLabel="Increase value by 1",t.OptionalObjectAdd="Add data for optional field",t.OptionalObjectRemove="Remove data for optional field",t.OptionalObjectEmptyMsg="No data for optional field",t.Type="Type",t.Value="Value",t.ClearButton="clear input",t.UnknownFieldType="Unknown field type %1",t.OptionPrefix="Option %1",t.TitleOptionPrefix="%1 option %2",t.KeyLabel="%1 Key",t.InvalidObjectField='Invalid "%1" object field configuration: _%2_.',t.UnsupportedField="Unsupported field schema.",t.UnsupportedFieldWithId="Unsupported field schema for field `%1`.",t.UnsupportedFieldWithReason="Unsupported field schema: _%1_.",t.UnsupportedFieldWithIdAndReason="Unsupported field schema for field `%1`: _%2_.",t.FilesInfo="**%1** (%2, %3 bytes)"})(K||(K={}));function Ex(t,e){var n=ye(t)?Ii:dl;return n(t,_a(e))}function Ix(t,e){return t==null?!0:Qa(t,e)}function ii(){return Fl("rjsf-array-item-")}function mo(t){return Array.isArray(t)?t.map(e=>({key:ii(),item:e})):[]}function $l(t){return Array.isArray(t)?t.map(e=>e.item):[]}function Dx(t){return Array.isArray(t.type)?!t.type.includes("null"):t.type!=="null"}function kl(t,e,n,r){let{addable:i}=U(r,t.globalUiOptions);return i!==!1&&(e.maxItems!==void 0?i=n.length<e.maxItems:i=!0),i}function Ml(t,e,n,r){if(typeof t.items=="function")try{return t.items(e,n,r)}catch(i){console.error(`Error executing dynamic uiSchema.items function for item at index ${n}:`,i);return}else return t.items}function $x(t,e){const{schemaUtils:n,globalFormOptions:r}=t;let i=e.items;return r.useFallbackUiForUnsupportedType&&!i?i={}:Wi(e)&&Ed(e)&&(i=e.additionalItems),n.getDefaultFormState(i)}function kx(t){const{schema:e,fieldPathId:n,uiSchema:r,formData:i=[],disabled:s=!1,readonly:a=!1,autofocus:o=!1,required:l=!1,placeholder:d,onBlur:f,onFocus:u,registry:h,rawErrors:g,name:m,onSelectChange:p}=t,{widgets:y,schemaUtils:x,globalFormOptions:S,globalUiOptions:j}=h,b=x.retrieveSchema(e.items,i),v=Gt(b,r),{widget:w="select",title:O,...A}=U(r,j),_=He(e,w,y),T=O??e.title??m,N=x.getDisplayLabel(e,r,j),C=It(Fe("",S,n,!0));return c.jsx(_,{id:C[oe],name:m,multiple:!0,onChange:p,onBlur:f,onFocus:u,options:{...A,enumOptions:v},schema:e,uiSchema:r,registry:h,value:i,disabled:s,readonly:a,required:l,label:T,hideLabel:!N,placeholder:d,autofocus:o,rawErrors:g,htmlName:C.name})}function Mx(t){const{schema:e,fieldPathId:n,uiSchema:r,disabled:i=!1,readonly:s=!1,autofocus:a=!1,required:o=!1,hideError:l,placeholder:d,onBlur:f,onFocus:u,formData:h=[],registry:g,rawErrors:m,name:p,onSelectChange:y}=t,{widgets:x,schemaUtils:S,globalFormOptions:j,globalUiOptions:b}=g,{widget:v,title:w,...O}=U(r,b),A=He(e,v,x),_=w??e.title??p,T=S.getDisplayLabel(e,r,b),N=It(Fe("",j,n,!0));return c.jsx(A,{id:N[oe],name:p,multiple:!0,onChange:y,onBlur:f,onFocus:u,options:O,schema:e,uiSchema:r,registry:g,value:h,disabled:i,readonly:s,hideError:l,required:o,label:_,hideLabel:!T,placeholder:d,autofocus:a,rawErrors:m,htmlName:N.name})}function Rx(t){const{schema:e,uiSchema:n,fieldPathId:r,name:i,disabled:s=!1,readonly:a=!1,autofocus:o=!1,required:l=!1,onBlur:d,onFocus:f,registry:u,formData:h=[],rawErrors:g,onSelectChange:m}=t,{widgets:p,schemaUtils:y,globalFormOptions:x,globalUiOptions:S}=u,{widget:j="files",title:b,...v}=U(n,S),w=He(e,j,p),O=b??e.title??i,A=y.getDisplayLabel(e,n,S),_=It(Fe("",x,r,!0));return c.jsx(w,{options:v,id:_[oe],name:i,multiple:!0,onChange:m,onBlur:d,onFocus:f,schema:e,uiSchema:n,value:h,disabled:s,readonly:a,required:l,registry:u,autofocus:o,rawErrors:g,label:O,hideLabel:!A,htmlName:_.name})}function Rl(t){const{itemKey:e,index:n,name:r,disabled:i,hideError:s,readonly:a,registry:o,uiOptions:l,parentUiSchema:d,canAdd:f,canRemove:u=!0,canMoveUp:h,canMoveDown:g,itemSchema:m,itemData:p,itemUiSchema:y,itemFieldPathId:x,itemErrorSchema:S,autofocus:j,onBlur:b,onFocus:v,onChange:w,rawErrors:O,totalItems:A,title:_,handleAddItem:T,handleCopyItem:N,handleRemoveItem:C,handleReorderItems:F}=t,{schemaUtils:$,fields:{ArraySchemaField:E,SchemaField:D},globalUiOptions:M}=o,k=It(x),B=E||D,V=L("ArrayFieldItemTemplate",o,l),R=$.getDisplayLabel(m,y,M),{description:W}=U(y),Q=!!W||!!m.description,{orderable:ne=!0,removable:ie=!0,copyable:de=!1}=l,ee={moveUp:ne&&h,moveDown:ne&&g,copy:de&&f,remove:ie&&u,toolbar:!1};ee.toolbar=Object.keys(ee).some(pe=>ee[pe]);const z=P.useCallback(pe=>{T(pe,n+1)},[T,n]),H=P.useCallback(pe=>{N(pe,n)},[N,n]),re=P.useCallback(pe=>{C(pe,n)},[C,n]),fe=P.useCallback(pe=>{F(pe,n,n-1)},[F,n]),je=P.useCallback(pe=>{F(pe,n,n+1)},[F,n]),Se={children:c.jsx(B,{name:r,title:_,index:n,schema:m,uiSchema:y,formData:p,errorSchema:S,fieldPathId:k,required:Dx(m),onChange:w,onBlur:b,onFocus:v,registry:o,disabled:i,readonly:a,hideError:s,autofocus:j,rawErrors:O}),buttonsProps:{fieldPathId:k,disabled:i,readonly:a,canAdd:f,hasCopy:ee.copy,hasMoveUp:ee.moveUp,hasMoveDown:ee.moveDown,hasRemove:ee.remove,index:n,totalItems:A,onAddItem:z,onCopyItem:H,onRemoveItem:re,onMoveUpItem:fe,onMoveDownItem:je,registry:o,schema:m,uiSchema:y},itemKey:e,className:"rjsf-array-item",disabled:i,hasToolbar:ee.toolbar,index:n,totalItems:A,readonly:a,registry:o,schema:m,uiSchema:y,parentUiSchema:d,displayLabel:R,hasDescription:Q};return c.jsx(V,{...Se})}function Bx(t){const{schema:e,uiSchema:n={},errorSchema:r,fieldPathId:i,formData:s,name:a,title:o,disabled:l=!1,readonly:d=!1,autofocus:f=!1,required:u=!1,hideError:h=!1,registry:g,onBlur:m,onFocus:p,rawErrors:y,onChange:x,keyedFormData:S,handleAddItem:j,handleCopyItem:b,handleRemoveItem:v,handleReorderItems:w}=t,O=e.title||o||a,{schemaUtils:A,fields:_,formContext:T,globalFormOptions:N,globalUiOptions:C}=g,{OptionalDataControlsField:F}=_,$=U(n,C),E=Z(e.items)?e.items:{},D=A.retrieveSchema(E),M=$l(S),k=Mn(g,e,u,n),B=Qt(s),V=kl(g,e,M,n)&&(!k||B),R=B?S:[],W=k?" rjsf-optional-array-field":"",Q=t.childFieldPathId??i,ne=k?c.jsx(F,{...t,fieldPathId:Q}):void 0,ie={canAdd:V,items:R.map((ee,z)=>{const{key:H,item:re}=ee,fe=re,je=A.retrieveSchema(E,fe),Se=r?r[z]:void 0,pe=Fe(z,N,Q),Oe=Ml(n,re,z,T),De={itemKey:H,index:z,name:a&&`${a}-${z}`,registry:g,uiOptions:$,hideError:h,readonly:d,disabled:l,required:u,title:O?`${O}-${z+1}`:void 0,canAdd:V,canMoveUp:z>0,canMoveDown:z<M.length-1,itemSchema:je,itemFieldPathId:pe,itemErrorSchema:Se,itemData:fe,itemUiSchema:Oe,autofocus:f&&z===0,onBlur:m,onFocus:p,rawErrors:y,totalItems:S.length,handleAddItem:j,handleCopyItem:b,handleRemoveItem:v,handleReorderItems:w,onChange:x};return c.jsx(Rl,{...De},H)}),className:`rjsf-field rjsf-field-array rjsf-field-array-of-${D.type}${W}`,disabled:l,fieldPathId:i,uiSchema:n,onAddClick:j,readonly:d,required:u,schema:e,title:O,formData:M,rawErrors:y,registry:g,optionalDataControl:ne},de=L("ArrayFieldTemplate",g,$);return c.jsx(de,{...ie})}function Ux(t){const{schema:e,uiSchema:n={},formData:r,errorSchema:i,fieldPathId:s,name:a,title:o,disabled:l=!1,readonly:d=!1,autofocus:f=!1,required:u=!1,hideError:h=!1,registry:g,onBlur:m,onFocus:p,rawErrors:y,keyedFormData:x,onChange:S,handleAddItem:j,handleCopyItem:b,handleRemoveItem:v,handleReorderItems:w}=t;let{formData:O=[]}=t;const A=e.title||o||a,{schemaUtils:_,fields:T,formContext:N,globalFormOptions:C,globalUiOptions:F}=g,$=U(n,F),{OptionalDataControlsField:E}=T,D=Mn(g,e,u,n),M=Qt(r),B=(Z(e.items)?e.items:[]).map((z,H)=>_.retrieveSchema(z,O[H])),V=Z(e.additionalItems)?_.retrieveSchema(e.additionalItems,r):null,R=t.childFieldPathId??s;O.length<B.length&&(O=O.concat(new Array(B.length-O.length)));const W=M?x:[],Q=D?" rjsf-optional-array-field":"",ne=D?c.jsx(E,{...t,fieldPathId:R}):void 0,ie=kl(g,e,O,n)&&!!V&&(!D||M),de={canAdd:ie,className:`rjsf-field rjsf-field-array rjsf-field-array-fixed-items${Q}`,disabled:l,fieldPathId:s,formData:r,items:W.map((z,H)=>{const{key:re,item:fe}=z,je=fe,Se=H>=B.length,pe=(Se&&Z(e.additionalItems)?_.retrieveSchema(e.additionalItems,je):B[H])||{},Oe=Fe(H,C,R);let De;Se?De=n.additionalItems:Array.isArray(n.items)?De=n.items[H]:De=Ml(n,fe,H,N);const nn=i?i[H]:void 0,Je={index:H,itemKey:re,name:a&&`${a}-${H}`,registry:g,uiOptions:$,hideError:h,readonly:d,disabled:l,required:u,title:A?`${A}-${H+1}`:void 0,canAdd:ie,canRemove:Se,canMoveUp:H>=B.length+1,canMoveDown:Se&&H<O.length-1,itemSchema:pe,itemData:je,itemUiSchema:De,itemFieldPathId:Oe,itemErrorSchema:nn,autofocus:f&&H===0,onBlur:m,onFocus:p,rawErrors:y,totalItems:x.length,onChange:S,handleAddItem:j,handleCopyItem:b,handleRemoveItem:v,handleReorderItems:w};return c.jsx(Rl,{...Je},re)}),onAddClick:j,readonly:d,required:u,registry:g,schema:e,uiSchema:n,title:A,errorSchema:i,rawErrors:y,optionalDataControl:ne},ee=L("ArrayFieldTemplate",g,$);return c.jsx(ee,{...de})}function Lx(t=[]){const e=P.useMemo(()=>ze(t),[t]),[n,r]=P.useState(()=>({formDataHash:e,keyedFormData:mo(t)}));let{keyedFormData:i,formDataHash:s}=n;if(e!==s){const o=Array.isArray(t)?t:[],l=i||[];i=o.length===l.length?l.map((d,f)=>({key:d.key,item:o[f]})):mo(o),s=e,r({formDataHash:s,keyedFormData:i})}const a=P.useCallback(o=>{const l=$l(o),d=ze(l);return r({formDataHash:d,keyedFormData:o}),l},[]);return{keyedFormData:i,updateKeyedFormData:a}}function Wx(t){const{schema:e,uiSchema:n,errorSchema:r,fieldPathId:i,registry:s,formData:a,onChange:o}=t,{globalFormOptions:l,schemaUtils:d,translateString:f}=s,{keyedFormData:u,updateKeyedFormData:h}=Lx(a),g=t.childFieldPathId??i,m=P.useCallback((w,O)=>{w&&w.preventDefault();let A;if(r){A={};for(const N in r){const C=parseInt(N);O===void 0||C<O?se(A,[C],r[N]):C>=O&&se(A,[C+1],r[N])}}const _={key:ii(),item:$x(s,e)},T=[...u];O!==void 0?T.splice(O,0,_):T.push(_),o(h(T),g.path,A)},[u,s,e,o,h,r,g]),p=P.useCallback((w,O)=>{w&&w.preventDefault();let A;if(r){A={};for(const N in r){const C=parseInt(N);C<=O?se(A,[C],r[N]):C>O&&se(A,[C+1],r[N])}}const _={key:ii(),item:Ki(u[O].item)},T=[...u];O!==void 0?T.splice(O+1,0,_):T.push(_),o(h(T),g.path,A)},[u,o,h,r,g]),y=P.useCallback((w,O)=>{w&&w.preventDefault();let A;if(r){A={};for(const T in r){const N=parseInt(T);N<O?se(A,[N],r[T]):N>O&&se(A,[N-1],r[T])}}const _=u.filter((T,N)=>N!==O);o(h(_),g.path,A)},[u,o,h,r,g]),x=P.useCallback((w,O,A)=>{w&&(w.preventDefault(),w.currentTarget.blur());let _;if(r){_={};for(const C in r){const F=parseInt(C);F==O?se(_,[A],r[O]):F==A?se(_,[O],r[A]):se(_,[C],r[F])}}function T(){const C=u.slice();return C.splice(O,1),C.splice(A,0,u[O]),C}const N=T();o(h(N),g.path,_)},[u,o,h,r,g]),S=P.useCallback((w,O,A,_)=>{o(w===void 0?null:w,O,A,_)},[o]),j=P.useCallback(w=>{o(w,g.path,void 0,g?.[oe])},[o,g]),b={...t,formData:a,fieldPathId:g,onSelectChange:j},v={...t,handleAddItem:m,handleCopyItem:p,handleRemoveItem:y,handleReorderItems:x,keyedFormData:u,onChange:S};if(!(zt in e)){if(!l.useFallbackUiForUnsupportedType){const O=U(n),A=L("UnsupportedFieldTemplate",s,O);return c.jsx(A,{schema:e,fieldPathId:i,reason:f(K.MissingItems),registry:s})}const w={...e,[zt]:{type:void 0}};b.schema=w,v.schema=w}return d.isMultiSelect(b.schema)?c.jsx(kx,{...b}):gl(n)?c.jsx(Mx,{...b}):Wi(b.schema)?c.jsx(Ux,{...v}):d.isFilesArray(b.schema,n)?c.jsx(Rx,{...b}):c.jsx(Bx,{...v})}function Vx(t){const{schema:e,name:n,uiSchema:r,fieldPathId:i,formData:s,registry:a,required:o,disabled:l,readonly:d,hideError:f,autofocus:u,title:h,onChange:g,onFocus:m,onBlur:p,rawErrors:y}=t,{title:x}=e,{widgets:S,translateString:j,globalUiOptions:b}=a,{widget:v="checkbox",title:w,label:O=!0,enumNames:A,..._}=U(r,b),T=He(e,v,S),N=j(K.YesLabel),C=j(K.NoLabel);let F;const $=w??x??h??n;if(Array.isArray(e.oneOf))F=Gt({oneOf:e.oneOf.map(D=>{if(Z(D))return{...D,title:D.title||(D.const===!0?N:C)}}).filter(D=>D)},r);else{const D=e.enum??[!0,!1];!A&&D.length===2&&D.every(M=>typeof M=="boolean")?F=[{value:D[0],label:D[0]?N:C},{value:D[1],label:D[1]?N:C}]:F=Gt({enum:D},r)}const E=P.useCallback((D,M,k)=>g(D,i.path,M,k),[g,i]);return c.jsx(T,{options:{..._,enumOptions:F},schema:e,uiSchema:r,id:i.$id,name:n,onChange:E,onFocus:m,onBlur:p,label:$,hideLabel:!O,value:s,required:o,disabled:l,readonly:d,hideError:f,registry:a,autofocus:u,rawErrors:y,htmlName:i.name})}function zx(t){return{type:"string",enum:["string","number","boolean","object","array"],default:"string",title:t}}function qx(t){const e=typeof t;return e==="string"||e==="number"||e==="boolean"?e:e==="object"?Array.isArray(t)?"array":"object":"string"}function Kx(t,e){switch(e){case"string":return String(t);case"number":{const n=Number(t);return isNaN(n)?0:n}case"boolean":return!!t;default:return t}}function Gx(t){const{id:e,formData:n,displayLabel:r=!0,schema:i,name:s,uiSchema:a,required:o,disabled:l=!1,readonly:d=!1,onBlur:f,onFocus:u,registry:h,fieldPathId:g,onChange:m,errorSchema:p}=t,{translateString:y,fields:x,globalFormOptions:S}=h,[j,b]=P.useState(qx(n)),v=U(a),w=It(Fe("__internal_type_selector",S,g)),O=y(K.Type),A=P.useMemo(()=>zx(O),[O]),_=C=>{C!=null&&(b(C),m(Kx(n,C),g.path,p,e))};if(!S.useFallbackUiForUnsupportedType){const{reason:C=y(K.UnknownFieldType,[String(i.type)])}=t,F=L("UnsupportedFieldTemplate",h,v);return c.jsx(F,{schema:i,fieldPathId:g,reason:C,registry:h})}const T=L("FallbackFieldTemplate",h,v),{SchemaField:N}=x;return c.jsx(T,{schema:i,registry:h,typeSelector:c.jsx(N,{fieldPathId:w,name:`${s}__fallback_type`,schema:A,formData:j,onChange:_,onBlur:f,onFocus:u,registry:h,hideLabel:!r,disabled:l,readonly:d,required:o},n?ze(n):"__empty__"),schemaField:c.jsx(N,{...t,schema:{type:j,title:y(K.Value),...j==="object"&&{additionalProperties:!0}}})})}function Hx(t,e){return Xt(e,function(n){return t[n]})}function Yx(t){return t==null?[]:Hx(t,Pe(t))}var Xx=Math.max;function Jx(t,e,n,r){t=Tt(t)?t:Yx(t),n=n?Ca(n):0;var i=t.length;return n<0&&(n=Xx(i+n,0)),yt(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Wa(t,e,n)>-1}var Zx=Math.min;function Qx(t,e,n){for(var r=Mi,i=t[0].length,s=t.length,a=s,o=Array(s),l=1/0,d=[];a--;){var f=t[a];l=Zx(f.length,l),o[a]=i>=120&&f.length>=120?new Ot(a&&f):void 0}f=t[0];var u=-1,h=o[0];e:for(;++u<i&&d.length<l;){var g=f[u],m=g;if(g=g!==0?g:0,!(h?vn(h,m):r(d,m))){for(a=s;--a;){var p=o[a];if(!(p?vn(p,m):r(t[a],m)))continue e}h&&h.push(m),d.push(g)}}return d}function e0(t){return Sn(t)?t:[]}var ho=fr(function(t){var e=Xt(t,e0);return e.length&&e[0]===t[0]?Qx(e):[]});function Bl(t){return t===void 0}var Ke;(function(t){t.ROW="ui:row",t.COLUMN="ui:col",t.COLUMNS="ui:columns",t.CONDITION="ui:condition"})(Ke||(Ke={}));var pn;(function(t){t.ALL="all",t.SOME="some",t.NONE="none"})(pn||(pn={}));const t0=/^\$lookup=(.+)/,Mr="layoutGrid";function po(t,e){return t??e}function n0(t){return/^\d+?$/.test(t)}const mt=Gi();function r0(t,e,n,r,i){const s=I(n,[Kr],{}),a=I(n,t),o={...I(a,[ut],{}),...e,...s},l={...a};me(o)||se(l,[ut],o),me(s)||se(l,[Kr],s);let{readonly:d}=U(l);return(i===!0||Bl(d)&&r===!0)&&(d=!0,X(o,vr)?se(l,[ut,vr],!0):se(l,`ui:${vr}`,!0)),{fieldUiSchema:l,uiReadonly:d}}function i0(t,e,n="$0m3tH1nG Un3xP3cT3d"){const r=ei([e]).sort(),i=ei([n]).sort();switch(t){case pn.ALL:return dt(r,i);case pn.SOME:return ho(r,i).length>0;case pn.NONE:return ho(r,i).length===0;default:return!1}}function pr(t,e,n){let r={},i=t[e];if(gt(i)){const{children:s,className:a,...o}=i;if(i=s,a){const d=a.split(" ").map(f=>Xi(n,f,f)).join(" ");r={...o,className:d}}else r=o}if(!Array.isArray(i))throw new TypeError(`Expected array for "${e}" in ${JSON.stringify(t)}`);return{children:i,gridProps:r}}function go(t,e,n){let r;if(n0(n)&&t&&t?.type==="array"&&X(t,zt)){const i=Number(n),s=t[zt];Array.isArray(s)?i>s.length?r=Za(s):r=s[i]:r=s,e={[oe]:e[oe],path:[...e.path.slice(0,e.path.length-1),i]}}return{rawSchema:r,fieldPathId:e}}function s0(t,e,n,r,i){const{schemaUtils:s,globalFormOptions:a}=t;let o=n,l=i;const d=e.split("."),f=d.pop();let u=s.retrieveSchema(o,r),h=r,g=u.readOnly;d.forEach(y=>{if(l=Fe(y,a,l),X(u,te))o=I(u,[te,y],{});else if(u&&(X(u,q)||X(u,J))){const x=X(u,q)?q:J,S=s.findSelectedOptionInXxxOf(u,y,x,h);o=I(S,[te,y],{})}else{const x=go(u,l,y);o=x.rawSchema??{},l=x.fieldPathId}h=I(h,y,{}),u=s.retrieveSchema(o,h),g=po(u.readOnly,g)});let m,p=!1;if(me(u)&&(u=void 0),u&&f){if(u&&(X(u,q)||X(u,J))){const x=X(u,q)?q:J;u=s.findSelectedOptionInXxxOf(u,f,x,h)}l=Fe(f,a,l),p=u!==void 0&&Array.isArray(u.required)&&Jx(u.required,f);const y=go(u,l,f);if(y.rawSchema?(u=y.rawSchema,l=y.fieldPathId):(u=I(u,[te,f]),u=u&&s.retrieveSchema(u)),g=po(u?.readOnly,g),u&&(X(u,q)||X(u,J))){const x=X(u,q)?q:J,S=Ge(u);m={options:u[x],hasDiscriminator:!!S}}}return{schema:u,isRequired:p,isReadonly:g,optionsInfo:m,fieldPathId:l}}function o0(t,e){let n=t;return yt(n)&&(n=Xi(e,n)),Fn(n)?n:null}function a0(t,e){let n,r=null,i={},s;if(yt(e)||Bl(e))n=e??"";else{const{name:a="",render:o,...l}=e;n=a,i=l,me(i)||Ex(i,(d,f)=>{if(yt(d)){const u=t0.exec(d);if(Array.isArray(u)&&u.length>1){const h=u[1];i[f]=Xi(t,h,h)}}}),r=o0(o,t),!a&&r&&(s=c.jsx(r,{...l,"data-testid":mt.uiComponent}))}return{name:n,UIComponent:r,uiProps:i,rendered:s}}function gr(t){const{childrenLayoutGridSchemaId:e,...n}=t,{registry:r,schema:i,formData:s}=n,{schemaUtils:a}=r,o=a.retrieveSchema(i,s);return e.map(l=>P.createElement(Qi,{...n,key:`layoutGrid-${ze(l)}`,schema:o,layoutGridSchema:l}))}function l0(t){const{layoutGridSchema:e,...n}=t,{formData:r,registry:i}=n,{children:s,gridProps:a}=pr(e,Ke.CONDITION,i),{operator:o,field:l="",value:d}=a,f=I(r,l,null);return i0(o,f,d)?c.jsx(gr,{...n,childrenLayoutGridSchemaId:s}):null}function c0(t){const{layoutGridSchema:e,...n}=t,{registry:r,uiSchema:i}=n,{children:s,gridProps:a}=pr(e,Ke.COLUMN,r),o=U(i),l=L("GridTemplate",r,o);return c.jsx(l,{column:!0,"data-testid":mt.col,...a,children:c.jsx(gr,{...n,childrenLayoutGridSchemaId:s})})}function u0(t){const{layoutGridSchema:e,...n}=t,{registry:r,uiSchema:i}=n,{children:s,gridProps:a}=pr(e,Ke.COLUMNS,r),o=U(i),l=L("GridTemplate",r,o);return s.map(d=>c.jsx(l,{column:!0,"data-testid":mt.col,...a,children:c.jsx(gr,{...n,childrenLayoutGridSchemaId:[d]})},`column-${ze(d)}`))}function d0(t){const{layoutGridSchema:e,...n}=t,{registry:r,uiSchema:i}=n,{children:s,gridProps:a}=pr(e,Ke.ROW,r),o=U(i),l=L("GridTemplate",r,o);return c.jsx(l,{...a,"data-testid":mt.row,children:c.jsx(gr,{...n,childrenLayoutGridSchemaId:s})})}function f0(t){const{gridSchema:e,schema:n,uiSchema:r,errorSchema:i,fieldPathId:s,onBlur:a,onFocus:o,formData:l,readonly:d,registry:f,layoutGridSchema:u,...h}=t,{onChange:g}=h,{fields:m}=f,{SchemaField:p,LayoutMultiSchemaField:y}=m,x=a0(f,e),{name:S,UIComponent:j,uiProps:b}=x,{schema:v,isRequired:w,isReadonly:O,optionsInfo:A,fieldPathId:_}=s0(f,S,n,l,s),T=It(_);if(x.rendered)return x.rendered;if(v){const N=A?.hasDiscriminator?y:p,{fieldUiSchema:C,uiReadonly:F}=r0(S,b,r,O,d);return c.jsx(N,{"data-testid":A?.hasDiscriminator?mt.layoutMultiSchemaField:mt.field,...h,name:S,required:w,readonly:F,schema:v,uiSchema:C,errorSchema:I(i,S),fieldPathId:T,formData:I(l,S),onChange:g,onBlur:a,onFocus:o,options:A?.options,registry:f})}return j?c.jsx(j,{"data-testid":mt.uiComponent,...h,name:S,required:w,formData:l,readOnly:!!O||d,errorSchema:i,uiSchema:r,schema:n,fieldPathId:s,onBlur:a,onFocus:o,registry:f,...b}):null}function Qi(t){const{uiSchema:e}=t;let{layoutGridSchema:n}=t;const r=U(e);if(!n&&Mr in r&&Z(r[Mr])&&(n=r[Mr]),Z(n)){if(Ke.ROW in n)return c.jsx(d0,{...t,layoutGridSchema:n});if(Ke.COLUMN in n)return c.jsx(c0,{...t,layoutGridSchema:n});if(Ke.COLUMNS in n)return c.jsx(u0,{...t,layoutGridSchema:n});if(Ke.CONDITION in n)return c.jsx(l0,{...t,layoutGridSchema:n})}return c.jsx(f0,{...t,gridSchema:n})}Qi.TEST_IDS=mt;function m0(t){const{fieldPathId:e,title:n,schema:r,uiSchema:i,required:s,registry:a,name:o}=t,l=U(i,a.globalUiOptions),{title:d}=l,{title:f}=r,u=d||n||f||o;if(!u)return null;const h=L("TitleFieldTemplate",a,l);return c.jsx(h,{id:hr(e),title:u,required:s,schema:r,uiSchema:i,registry:a})}function Rr(t,e,n){const r="!@#!@$@#$!@$#";return t.map(({schema:s})=>s).find(s=>{const a=I(s,[te,e]);return I(a,ir,I(a,Ce,r))===n})}function yo(t,e,n,r,i){const s=e.map(l=>n.retrieveSchema(l,i));let a=t;X(t,q)?a={...t,[q]:s}:X(t,J)&&(a={...t,[J]:s});const o=Gt(a,r);if(!o)throw new Error(`No enumOptions were computed from the schema ${JSON.stringify(a)}`);return o}function h0(t){const{name:e,baseType:n,disabled:r=!1,formData:i,fieldPathId:s,onBlur:a,onChange:o,options:l,onFocus:d,registry:f,uiSchema:u,schema:h,autofocus:g,readonly:m,required:p,errorSchema:y,hideError:x=!1}=t,{widgets:S,schemaUtils:j,globalUiOptions:b}=f,[v,w]=P.useState(yo(h,l,j,u,i)),O=I(s,oe),A=Ge(h),_=L("FieldErrorTemplate",f,l),T=L("FieldTemplate",f,l),N=ze(h),C=ze(l),F=u?ze(u):"",$=i?ze(i):"";P.useEffect(()=>{w(yo(h,l,j,u,i))},[N,C,j,F,$]);const{widget:E=A?"radio":"select",title:D="",placeholder:M="",optionsSchemaSelector:k=A,hideError:B,...V}=U(u);if(!k)throw new Error("No selector field provided for the LayoutMultiSchemaField");const R=I(i,k);let W=I(v[0]?.schema,[te,k],{});const Q=Rr(v,k,R);W=W?.type?W:{...W,type:Q?.type||n};const ne=He(W,E,S),ie=B===void 0?x:!!B,de=I(y,[xe],[]),ee=wn(y,[xe]),z=j.getDisplayLabel(h,u,b),H=je=>{const Se=Rr(v,k,je),pe=Rr(v,k,R);let Oe=j.sanitizeDataForNewSchema(Se,pe,i);Oe&&Se&&(Oe=j.getDefaultFormState(Se,Oe,"excludeObjectChildren")),Oe&&se(Oe,k,je),o(Oe,s.path,void 0,O)},re={enumOptions:v,...V},fe=!ie&&de.length>0?c.jsx(_,{fieldPathId:s,schema:h,errors:de,registry:f}):void 0;return c.jsx(T,{fieldPathId:s,id:O,schema:h,label:(D||h.title)??"",disabled:r||Array.isArray(v)&&me(v),uiSchema:u,required:p,readonly:!!m,registry:f,displayLabel:z,errors:fe,onChange:o,onKeyRename:Gn,onKeyRenameBlur:Gn,onRemoveProperty:Gn,children:c.jsx(ne,{id:O,name:e,schema:h,label:(D||h.title)??"",disabled:r||Array.isArray(v)&&me(v),uiSchema:u,autofocus:g,readonly:m,required:p,registry:f,multiple:!1,rawErrors:de,hideError:ie,hideLabel:!z,errorSchema:ee,placeholder:M,onChange:H,onBlur:a,onFocus:d,value:R,options:re,htmlName:s.name})})}class xo extends P.Component{constructor(e){super(e);const{formData:n,options:r,registry:{schemaUtils:i}}=this.props,s=r.map(a=>i.retrieveSchema(a,n));this.state={retrievedOptions:s,selectedOption:this.getMatchingOption(0,n,s)}}componentDidUpdate(e,n){const{formData:r,options:i,fieldPathId:s}=this.props,{selectedOption:a}=this.state;let o=this.state;if(!le(e.options,i)){const{registry:{schemaUtils:l}}=this.props,d=i.map(f=>l.retrieveSchema(f,r));o={selectedOption:a,retrievedOptions:d}}if(!le(r,e.formData)&&s.$id===e.fieldPathId.$id){const{retrievedOptions:l}=o,d=this.getMatchingOption(a,r,l);n&&d!==a&&(o={selectedOption:d,retrievedOptions:l})}o!==this.state&&this.setState(o)}getMatchingOption(e,n,r){const{schema:i,registry:{schemaUtils:s}}=this.props,a=Ge(i);return s.getClosestMatchingOption(n,r,e,a)}onOptionChange=e=>{const{selectedOption:n,retrievedOptions:r}=this.state,{formData:i,onChange:s,registry:a,fieldPathId:o}=this.props,{schemaUtils:l}=a,d=e!==void 0?parseInt(e,10):-1;if(d===n)return;const f=d>=0?r[d]:void 0,u=n>=0?r[n]:void 0;let h=l.sanitizeDataForNewSchema(f,u,i);f&&(h=l.getDefaultFormState(f,h,"excludeObjectChildren")),this.setState({selectedOption:d},()=>{s(h,o.path,void 0,this.getFieldId())})};getFieldId(){const{fieldPathId:e,schema:n}=this.props;return`${e.$id}${n.oneOf?"__oneof_select":"__anyof_select"}`}render(){const{name:e,disabled:n=!1,errorSchema:r={},formData:i,onBlur:s,onFocus:a,readonly:o,required:l=!1,registry:d,schema:f,uiSchema:u}=this.props,{widgets:h,fields:g,translateString:m,globalUiOptions:p,schemaUtils:y}=d,{SchemaField:x}=g,S=L("MultiSchemaFieldTemplate",d,p),j=Mn(d,f,l,u),b=Qt(i),{selectedOption:v,retrievedOptions:w}=this.state,{widget:O="select",placeholder:A,autofocus:_,autocomplete:T,title:N=f.title,...C}=U(u,p),F=He({type:"number"},O,h),$=I(r,xe,[]),E=wn(r,[xe]),D=y.getDisplayLabel(f,u,p),M=v>=0&&w[v]||null;let k;if(M){const{required:de}=f;k=de?et({required:de},M):M}let B=[];q in f&&u&&q in u?Array.isArray(u[q])?B=u[q]:console.warn(`uiSchema.oneOf is not an array for "${N||e}"`):J in f&&u&&J in u&&(Array.isArray(u[J])?B=u[J]:console.warn(`uiSchema.anyOf is not an array for "${N||e}"`));let V=u;v>=0&&B.length>v&&(V=B[v]);const R=N?K.TitleOptionPrefix:K.OptionPrefix,W=N?[N]:[],Q=w.map((de,ee)=>{const{title:z=de.title}=U(B[ee]);return{label:z||m(R,W.concat(String(ee+1))),value:ee}}),ne=!j||b?c.jsx(F,{id:this.getFieldId(),name:`${e}${f.oneOf?"__oneof_select":"__anyof_select"}`,schema:{type:"number",default:0},onChange:this.onOptionChange,onBlur:s,onFocus:a,disabled:n||me(Q),multiple:!1,rawErrors:$,errorSchema:E,value:v>=0?v:void 0,options:{enumOptions:Q,...C},registry:d,placeholder:A,autocomplete:T,autofocus:_,label:N??e,hideLabel:!D,readonly:o}):void 0,ie=k&&k.type!=="null"&&c.jsx(x,{...this.props,schema:k,uiSchema:V})||null;return c.jsx(S,{schema:f,registry:d,uiSchema:u,selector:ne,optionSchemaField:ie})}}const p0=/\.([0-9]*0)*$/,g0=/[0.]0*$/;function y0(t){const{registry:e,onChange:n,formData:r,value:i}=t,[s,a]=P.useState(i),{StringField:o}=e.fields;let l=r;const d=P.useCallback((f,u,h,g)=>{a(f),`${f}`.charAt(0)==="."&&(f=`0${f}`);const m=typeof f=="string"&&f.match(p0)?ps(f.replace(g0,"")):ps(f);n(m,u,h,g)},[n]);if(typeof s=="string"&&typeof l=="number"){const f=new RegExp(`^(${String(l).replace(".","\\.")})?\\.?0*$`);s.match(f)&&(l=s)}return c.jsx(o,{...t,formData:l,onChange:d})}function We(){return We=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},We.apply(null,arguments)}const Ln=["strong","em","del","mark"],bo=[["**",Ln[0]],["__",Ln[0]],["~~",Ln[2]],["==",Ln[3]],["*","em"],["_","em"]];function x0(t,e){for(var n=1,r=e+1;r<t.length&&n>0;)t[r]!=="\\"?(t[r]==="["&&n++,t[r]==="]"&&n--,r++):r+=2;if(n===0&&r<t.length&&(t[r]==="("||t[r]==="[")){var i=t[r]==="("?")":"]",s=1;for(r++;r<t.length&&s>0;)t[r]!=="\\"?(t[r]==="("&&i===")"&&s++,t[r]===i&&s--,r++):r+=2;if(s===0)return r}return-1}function b0(t,e){if(!e||!e.inline&&!e.simple)return null;var n=t[0];if(n!=="*"&&n!=="_"&&n!=="~"&&n!=="=")return null;for(var r="",i=0,s="",a=0;a<6;a++){var o=bo[a][0];if(t.startsWith(o)&&t.length>=2*o.length){r=o,i=o.length,s=bo[a][1];break}}if(!r)return null;for(var l=i,d=!1,f=!1,u="",h=0,g="",m=!1,p="";l<t.length;){var y=t[l];if(m)g+=y,m=!1,p=y,l++;else if(y!=="\\")if(y!=="`"||h!==0){if(y==="["&&!d&&h===0){var x=x0(t,l);if(x!==-1){g+=t.slice(l,x),l=x,p=t[x-1];continue}}if(f)g+=y,u?y===u&&(u=""):y==='"'||y==="'"?u=y:y===">"&&(f=!1),p=y,l++;else if(y!=="<"||d){if(y===`
|
|
3
3
|
`&&p===`
|
|
4
4
|
`&&!d&&h===0)return null;if(!d&&h===0){for(var S=0;l+S<t.length&&t[l+S]===r[0];)S++;if(S>=i&&(i!==1||r!=="*"&&r!=="_"||t[l-1]!==r&&t[l+1]!==r)){var j=[t.slice(0,l+S),s,g+t.slice(l+i,l+S)];return j.index=0,j.input=t,j}}g+=y,p=y,l++}else{var b=t[l+1],v=t.indexOf(">",l);if(v!==-1){var w=t.slice(l,v+1).endsWith("/>");b==="/"?h=Math.max(0,h-1):w||h++}f=!0,g+=y,p=y,l++}}else d=!d,g+=y,p=y,l++;else g+=y,m=!0,p=y,l++}return null}const v0=["children","options"],vo=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce((t,e)=>(t[e.toLowerCase()]=e,t),{class:"className",for:"htmlFor"}),So={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},S0=["style","script","pre"],w0=["src","href","data","formAction","srcDoc","action"],j0=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,O0=/\n{2,}$/,wo=/^(\s*>[\s\S]*?)(?=\n\n|$)/,A0=/^ *> ?/gm,_0=/^(?:\[!([^\]]*)\]\n)?([\s\S]*)/,C0=/^ {2,}\n/,N0=/^(?:([-*_])( *\1){2,}) *(?:\n *)+\n/,jo=/^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/,Oo=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,T0=/^(`+)((?:\\`|(?!\1)`|[^`])+)\1/,F0=/^(?:\n *)*\n/,P0=/\r\n?/g,E0=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,I0=/^\[\^([^\]]+)]/,D0=/\f/g,$0=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,k0=/^\[(x|\s)\]/,Ao=/^(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,_o=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,Co=/^([^\n]+)\n *(=|-)\2{2,} *\n/,es=/^<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>/i;function M0(t){const e=es.exec(t);if(!e)return null;const n=e[1],r=n.toLowerCase(),i=r.length+1;let s=e[0].length;t[s]===`
|
|
@@ -22,4 +22,4 @@ import{a2 as _c,c as ve,K as ui,p as Cc,j as c,f as Vo,aH as Nc,aI as ls,u as Tc
|
|
|
22
22
|
`))return null;let y="",x=0;for(;;){const j=m.indexOf(`
|
|
23
23
|
`,x),b=m.slice(x,j===-1?void 0:j+1),v=m[x];if((v===">"||v==="#"||v==="|"||v==="`"||v==="~"||v==="*"||v==="-"||v==="_"||v===" ")&&$o(s,b)||(y+=b,j===-1||!b.trim()))break;x=j+1}const S=gn(y);return S===""?null:[y,,S]}),u:3,i:vb},22:{t:["["],o:st(q0),u:0,i:m=>(f[m[1]]={target:m[2],title:m[4]},{})},23:{t:["!["],o:Wn(K0),u:0,i:m=>({alt:m[1]?Ue(m[1]):void 0,ref:m[2]})},24:{t:m=>m[0]==="["&&!$e(m,"]("),o:st(G0),u:0,i:(m,p,y)=>({children:p(m[1],y),fallbackChildren:m[0],ref:m[2]})},25:{t:["|"],o:Ze(To),u:1,i:pb},27:{o:ct(function(m,p){let y;return oi(m,":")&&(y=eb.exec(m)),y||rb.exec(m)}),u:4,i(m){const p=m[0];return{text:$e(p,"&")?p.replace(R0,(y,x)=>e.namedCodesToUnicode[x]||y):p}}},34:{t:["*","_","~","="],o:ct(b0),u:2,i:(m,p,y)=>({children:p(m[2],y),tag:m[1]})},28:{t:["\\"],o:Wn(tb),u:1,i:m=>({text:m[1],type:"27"})}};e.disableParsingRawHTML===!0&&(delete u[11],delete u[13]);const h=(function(m){var p=Object.keys(m);function y(x,S){var j=[];if(S.prevCapture=S.prevCapture||"",x.trim())for(;x;)for(var b=0;b<p.length;){var v=p[b],w=m[v];if(!w.t||mb(x,S,w.t)){var O=w.o(x,S);if(O&&O[0]){x=x.substring(O[0].length);var A=w.i(O,y,S);S.prevCapture+=O[0],A.type||(A.type=v),j.push(A);break}b++}else b++}return S.prevCapture="",j}return p.sort(function(x,S){return m[x].u-m[S].u||(x<S?-1:1)}),function(x,S){return y((function(j){return j.replace(P0,`
|
|
24
24
|
`).replace(D0,"").replace(Y0," ")})(x),S)}})(u),g=(function(m,p,y,x,S){function j(b){return Array.isArray(b)?b.map(v=>"text"in v?v.text:""):"text"in b?b.text:""}return function b(v,w={}){const O=(w.renderDepth||0)+1;if(O>2500)return j(v);w.renderDepth=O;try{if(Array.isArray(v)){const _=w.key,T=[];let N=!1;for(let C=0;C<v.length;C++){w.key=C;const F=b(v[C],w),$=Po(F);$&&N?T[T.length-1]+=F:F!==null&&T.push(F),N=$}return w.key=_,w.renderDepth=O-1,T}const A=(function(_,T,N){const C=()=>(function(F,$,E,D,M,k,B){switch(F.type){case"0":{const V={key:E.key};return F.alert&&(V.className="markdown-alert-"+k(F.alert.toLowerCase(),ln),F.children.unshift({attrs:{},children:[{type:"27",text:F.alert}],noInnerParse:!0,type:"11",tag:"header"})),D("blockquote",V,$(F.children,E))}case"1":return D("br",{key:E.key});case"2":return D("hr",{key:E.key});case"3":return D("pre",{key:E.key},D("code",We({},F.attrs,{className:F.lang?"lang-"+F.lang:""}),F.text));case"5":return D("code",{key:E.key},F.text);case"7":return D("a",{key:E.key,href:M(F.target,"a","href")},D("sup",{key:E.key},F.text));case"8":return D("input",{checked:F.completed,key:E.key,readOnly:!0,type:"checkbox"});case"9":return D("h"+F.level,{id:F.id,key:E.key},$(F.children,E));case"11":return D(F.tag,We({key:E.key},F.attrs),F.text||(F.children?$(F.children,E):""));case"13":return D(F.tag,We({},F.attrs,{key:E.key}));case"14":return D("img",{key:E.key,alt:F.alt||void 0,title:F.title||void 0,src:M(F.target,"img","src")});case"15":return D("a",{key:E.key,href:M(F.target,"a","href"),title:F.title},$(F.children,E));case"23":return B[F.ref]?D("img",{key:E.key,alt:F.alt,src:M(B[F.ref].target,"img","src"),title:B[F.ref].title}):null;case"24":return B[F.ref]?D("a",{key:E.key,href:M(B[F.ref].target,"a","href"),title:B[F.ref].title},$(F.children,E)):D("span",{key:E.key},F.fallbackChildren);case"25":{const V=F;return D("table",{key:E.key},D("thead",null,D("tr",null,V.header.map(function(R,W){return D("th",{key:W,style:Io(V,W)},$(R,E))}))),D("tbody",null,V.cells.map(function(R,W){return D("tr",{key:W},R.map(function(Q,ne){return D("td",{key:ne,style:Io(V,ne)},$(Q,E))}))})))}case"27":return F.text;case"34":return D(F.tag,{key:E.key},$(F.children,E));case"20":case"30":return D(F.ordered?"ol":"ul",{key:E.key,start:F.type==="20"?F.start:void 0},F.items.map(function(V,R){return D("li",{key:R},$(V,E))}));case"19":return`
|
|
25
|
-
`;case"21":return D("p",{key:E.key},$(F.children,E));default:return null}})(_,T,N,p,y,x,S);return m?m(C,_,T,N):C()})(v,b,w);return w.renderDepth=O-1,A}catch(A){if(A instanceof RangeError&&A.message.includes("Maximum call stack"))return j(v);throw A}}})(e.renderRule,o,r,n,f);return l(t)}const Rn=t=>{let{children:e,options:n}=t,r=(function(i,s){if(i==null)return{};var a={};for(var o in i)if({}.hasOwnProperty.call(i,o)){if(s.indexOf(o)!==-1)continue;a[o]=i[o]}return a})(t,v0);return wb(e??"",We({},n,{wrapperProps:We({},n?.wrapperProps,r)}))},Hl=Symbol("remove-this-key"),ko=Symbol("reset");function jb(t,e){return Array.isArray(t.required)&&t.required.indexOf(e)!==-1}function Ob(t,e){switch(e){case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{};default:return t(K.NewStringDefault)}}function Ab(t){const{fieldPathId:e,schema:n,registry:r,uiSchema:i,errorSchema:s,formData:a,onChange:o,onBlur:l,onFocus:d,disabled:f,readonly:u,required:h,hideError:g,propertyName:m,handleKeyRename:p,handleRemoveProperty:y,addedByAdditionalProperties:x}=t,[S,j]=P.useState(!1),{globalFormOptions:b,fields:v}=r,{SchemaField:w}=v,O=It(Fe(m,b,e.path)),A=P.useCallback((C,F,$,E)=>{C===void 0&&x&&(C=""),o(C,F,$,E)},[o,x]),_=P.useCallback(C=>{m!==C&&j(!0),p(m,C)},[m,p]),T=P.useCallback(C=>{const{target:{value:F}}=C;_(F)},[_]),N=P.useCallback(()=>{y(m)},[m,y]);return c.jsx(w,{name:m,required:h,schema:n,uiSchema:i,errorSchema:s,fieldPathId:O,formData:a,wasPropertyKeyModified:S,onKeyRename:_,onKeyRenameBlur:T,onRemoveProperty:N,onChange:A,onBlur:l,onFocus:d,registry:r,disabled:f,readonly:u,hideError:g})}function _b(t){const{schema:e,uiSchema:n={},formData:r,errorSchema:i,fieldPathId:s,name:a,required:o=!1,disabled:l,readonly:d,hideError:f,onBlur:u,onFocus:h,onChange:g,registry:m,title:p}=t,{fields:y,schemaUtils:x,translateString:S,globalUiOptions:j}=m,{OptionalDataControlsField:b}=y,v=x.retrieveSchema(e,r,!0),w=U(n,j),{properties:O={}}=v,A=t.childFieldPathId??s,_=w.title??v.title??p??a,T=w.description??v.description,N=Mn(m,v,o,n),C=Qt(r);let F=[];const $=P.useCallback((R,W)=>{const{duplicateKeySuffixSeparator:Q="-"}=U(n,j);let ne=0,ie=R;for(;X(W,ie);)ie=`${R}${Q}${++ne}`;return ie},[n,j]),E=P.useCallback(()=>{if(!(v.additionalProperties||v.patternProperties))return;const{translateString:R}=m,W={...r},Q=$("newKey",W);if(v.patternProperties)se(W,Q,null);else{let ne,ie,de;if(Z(v.additionalProperties)){ne=v.additionalProperties.type,ie=v.additionalProperties.const,de=v.additionalProperties.default;let z=v.additionalProperties;if(ce in z){const{schemaUtils:H}=m;z=H.retrieveSchema({[ce]:z[ce]},r),ne=z.type,ie=z.const,de=z.default}!ne&&(J in z||q in z)&&(ne="object")}const ee=ie??de??Ob(R,ne);se(W,Q,ee)}g(W,A.path)},[r,g,m,A,$,v]),D=P.useCallback((R,W)=>{if(R!==W){const Q=$(W,r),ne={...r},ie={[R]:Q},de=Object.keys(ne).map(z=>({[ie[z]||z]:ne[z]})),ee=Object.assign({},...de);g(ee,A.path)}},[r,g,A,$]),M=P.useCallback(R=>{g(Hl,[...A.path,R])},[g,A]);if(!N||C)try{const R=Object.keys(O);F=vx(R,w.order)}catch(R){return c.jsxs("div",{children:[c.jsx("p",{className:"rjsf-config-error",style:{color:"red"},children:c.jsx(Rn,{options:{disableParsingRawHTML:!0},children:S(K.InvalidObjectField,[a||"root",R.message])})}),c.jsx("pre",{children:JSON.stringify(v)})]})}const k=L("ObjectFieldTemplate",m,w),B=N?c.jsx(b,{...t,fieldPathId:A,schema:v}):void 0,V={title:w.label===!1?"":_,description:w.label===!1?void 0:T,properties:F.map(R=>{const W=X(v,[te,R,Qe]),Q=W?n.additionalProperties:n[R],ne=U(Q).widget==="hidden";return{content:c.jsx(Ab,{propertyName:R,required:jb(v,R),schema:I(v,[te,R],{}),uiSchema:Q,errorSchema:I(i,[R]),fieldPathId:A,formData:I(r,[R]),handleKeyRename:D,handleRemoveProperty:M,addedByAdditionalProperties:W,onChange:g,onBlur:u,onFocus:h,registry:m,disabled:l,readonly:d,hideError:f},R),name:R,readonly:d,disabled:l,required:o,hidden:ne}}),readonly:d,disabled:l,required:o,fieldPathId:s,uiSchema:n,errorSchema:i,schema:v,formData:r,registry:m,optionalDataControl:B,className:N?"rjsf-optional-object-field":void 0};return c.jsx(k,{...V,onAddProperty:E})}function Cb(t){const{schema:e,uiSchema:n={},formData:r,disabled:i=!1,readonly:s=!1,onChange:a,errorSchema:o,fieldPathId:l,registry:d}=t,{globalUiOptions:f={},schemaUtils:u,translateString:h}=d,g=U(n,f),m=L("OptionalDataControlsTemplate",d,g),p=Qt(r);let y,x,S,j;if(i||s)y=$r(l,"Msg"),x=p?void 0:h(K.OptionalObjectEmptyMsg);else{const b=p?K.OptionalObjectRemove:K.OptionalObjectAdd;x=h(b),p?(y=$r(l,"Remove"),j=()=>a(void 0,l.path,o)):(y=$r(l,"Add"),S=()=>{let v=u.getDefaultFormState(e,r,"excludeObjectChildren");v===void 0&&(v=Ie(e)==="array"?[]:{}),a(v,l.path,o)})}return x&&c.jsx(m,{id:y,registry:d,schema:e,uiSchema:n,label:x,onAddClick:S,onRemoveClick:j})}const Nb={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function Tb(t,e,n){const r=e.field,{fields:i}=n;if(typeof r=="function")return r;if(typeof r=="string"&&r in i)return i[r];const s=Ie(t),a=Array.isArray(s)?s[0]:s||"",o=t.$id;let l=Nb[a];return o&&o in i&&(l=o),!l&&(t.anyOf||t.oneOf)?()=>null:l in i?i[l]:i.FallbackField}function Fb(t){const{schema:e,fieldPathId:n,uiSchema:r,formData:i,errorSchema:s,name:a,onChange:o,onKeyRename:l,onKeyRenameBlur:d,onRemoveProperty:f,required:u=!1,registry:h,wasPropertyKeyModified:g=!1}=t,{schemaUtils:m,globalFormOptions:p,globalUiOptions:y,fields:x}=h,{AnyOfField:S,OneOfField:j}=x,b=U(r,y),v=L("FieldTemplate",h,b),w=L("DescriptionFieldTemplate",h,b),O=L("FieldHelpTemplate",h,b),A=L("FieldErrorTemplate",h,b),_=m.retrieveSchema(e,i),T=n[oe],N=P.useCallback((De,nn,Je,Ac)=>o(De,nn,Je,Ac||T),[T,o]),C=Tb(_,b,h),F=!!(b.disabled??t.disabled),$=!!(b.readonly??(t.readonly||t.schema.readOnly||_.readOnly)),E=b.hideError,D=E===void 0?t.hideError:!!E,M=!!(b.autofocus??t.autofocus);if(Object.keys(_).length===0)return null;let k=m.getDisplayLabel(_,r,y);const B=b.field&&b.fieldReplacesAnyOrOneOf===!0;let V,R,W={fieldPathId:n};if((J in _||q in _)&&!B&&!m.isSelect(_)){_[J]?(V=S,R=_[J].map(Je=>m.retrieveSchema(Z(Je)?Je:{},i))):_[q]&&(V=j,R=_[q].map(Je=>m.retrieveSchema(Z(Je)?Je:{},i)));const De=Mn(h,_,u,r),nn=Qt(i);k=k&&(!De||nn),W={childFieldPathId:n,fieldPathId:Fe("XxxOf",p,n)}}const{__errors:Q,...ne}=s||{},ie=wn(r,["ui:classNames","classNames","ui:style"]);ut in ie&&(ie[ut]=wn(ie[ut],["classNames","style"]));const de=c.jsx(C,{...t,onChange:N,...W,schema:_,uiSchema:ie,disabled:F,readonly:$,hideError:D,autofocus:M,errorSchema:ne,rawErrors:Q}),ee=n[oe];let z;g?z=a:z=Qe in _?a:b.title||t.schema.title||_.title||t.title||a;const H=b.description||t.schema.description||_.description||"",re=b.help,fe=b.widget==="hidden",je=["rjsf-field",`rjsf-field-${Ie(_)}`];!D&&Q&&Q.length>0&&je.push("rjsf-field-error"),b.classNames&&je.push(b.classNames);const Se=c.jsx(O,{help:re,fieldPathId:n,schema:_,uiSchema:r,hasErrors:!D&&Q&&Q.length>0,registry:h}),pe=D||V&&!m.isSelect(_)?void 0:c.jsx(A,{errors:Q,errorSchema:s,fieldPathId:n,schema:_,uiSchema:r,registry:h}),Oe={description:c.jsx(w,{id:Et(ee),description:H,schema:_,uiSchema:r,registry:h}),rawDescription:H,help:Se,rawHelp:typeof re=="string"?re:void 0,errors:pe,rawErrors:D?void 0:Q,fieldPathId:n,id:ee,label:z,hidden:fe,onChange:o,onKeyRename:l,onKeyRenameBlur:d,onRemoveProperty:f,required:u,disabled:F,readonly:$,hideError:D,displayLabel:k,classNames:je.join(" ").trim(),style:b.style,formData:i,schema:_,uiSchema:r,registry:h};return c.jsx(v,{...Oe,children:c.jsxs(c.Fragment,{children:[de,V&&c.jsx(V,{name:a,disabled:F,readonly:$,hideError:D,errorSchema:s,formData:i,fieldPathId:n,onBlur:t.onBlur,onChange:t.onChange,onFocus:t.onFocus,options:R,registry:h,required:u,schema:_,uiSchema:r})]})})}class Pb extends P.Component{shouldComponentUpdate(e){const{registry:{globalFormOptions:n}}=this.props,{experimental_componentUpdateStrategy:r="customDeep"}=n;return El(this,e,this.state,r)}render(){return c.jsx(Fb,{...this.props})}}function Eb(t){const{schema:e,name:n,uiSchema:r,fieldPathId:i,formData:s,required:a,disabled:o=!1,readonly:l=!1,autofocus:d=!1,onChange:f,onBlur:u,onFocus:h,registry:g,rawErrors:m,hideError:p,title:y}=t,{title:x,format:S}=e,{widgets:j,schemaUtils:b,globalUiOptions:v}=g,w=b.isSelect(e)?Gt(e,r):void 0;let O=w?"select":"text";S&&yx(e,S,j)&&(O=S);const{widget:A=O,placeholder:_="",title:T,...N}=U(r),C=b.getDisplayLabel(e,r,v),F=T??y??x??n,$=He(e,A,j),E=P.useCallback((D,M,k)=>f(D,i.path,M,k),[f,i]);return c.jsx($,{options:{...N,enumOptions:w},schema:e,uiSchema:r,id:i.$id,name:n,label:F,hideLabel:!C,hideError:p,value:s,onChange:E,onBlur:u,onFocus:h,required:a,disabled:o,readonly:l,autofocus:d,registry:g,placeholder:_,rawErrors:m,htmlName:i.name})}function Ib(t){const{formData:e,onChange:n,fieldPathId:r}=t;return P.useEffect(()=>{e===void 0&&n(null,r.path)},[r,e,n]),null}function Db(){return{AnyOfField:xo,ArrayField:Wx,BooleanField:Vx,FallbackField:Gx,LayoutGridField:Qi,LayoutHeaderField:m0,LayoutMultiSchemaField:h0,NumberField:y0,ObjectField:_b,OneOfField:xo,OptionalDataControlsField:Cb,SchemaField:Pb,StringField:Eb,NullField:Ib}}function $b(t){const{fieldPathId:e,description:n,registry:r,schema:i,uiSchema:s}=t,a=U(s,r.globalUiOptions),{label:o=!0}=a;if(!n||!o)return null;const l=L("DescriptionFieldTemplate",r,a);return c.jsx(l,{id:Et(e),description:n,schema:i,uiSchema:s,registry:r})}function kb(t){const{children:e,className:n,buttonsProps:r,displayLabel:i,hasDescription:s,hasToolbar:a,registry:o,uiSchema:l}=t,d=U(l),f=L("ArrayFieldItemButtonsTemplate",o,d),u={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"},h=s?31:9,g={display:"flex",alignItems:i?"center":"baseline"},m={display:"flex",justifyContent:"flex-end",marginTop:i?`${h}px`:0};return c.jsxs("div",{className:n,style:g,children:[c.jsx("div",{className:a?"col-xs-9 col-md-10 col-xl-11":"col-xs-12",children:e}),a&&c.jsx("div",{className:"col-xs-3 col-md-2 col-xl-1 array-item-toolbox",children:c.jsx("div",{className:"btn-group",style:m,children:c.jsx(f,{...r,style:u})})})]})}function Mb(t){const{disabled:e,hasCopy:n,hasMoveDown:r,hasMoveUp:i,hasRemove:s,fieldPathId:a,onCopyItem:o,onRemoveItem:l,onMoveDownItem:d,onMoveUpItem:f,readonly:u,registry:h,uiSchema:g}=t,{CopyButton:m,MoveDownButton:p,MoveUpButton:y,RemoveButton:x}=h.templates.ButtonTemplates;return c.jsxs(c.Fragment,{children:[(i||r)&&c.jsx(y,{id:qe(a,"moveUp"),className:"rjsf-array-item-move-up",disabled:e||u||!i,onClick:f,uiSchema:g,registry:h}),(i||r)&&c.jsx(p,{id:qe(a,"moveDown"),className:"rjsf-array-item-move-down",disabled:e||u||!r,onClick:d,uiSchema:g,registry:h}),n&&c.jsx(m,{id:qe(a,"copy"),className:"rjsf-array-item-copy",disabled:e||u,onClick:o,uiSchema:g,registry:h}),s&&c.jsx(x,{id:qe(a,"remove"),className:"rjsf-array-item-remove",disabled:e||u,onClick:l,uiSchema:g,registry:h})]})}function Rb(t){const{canAdd:e,className:n,disabled:r,fieldPathId:i,uiSchema:s,items:a,optionalDataControl:o,onAddClick:l,readonly:d,registry:f,required:u,schema:h,title:g}=t,m=U(s),p=L("ArrayFieldDescriptionTemplate",f,m),y=L("ArrayFieldTitleTemplate",f,m),x=!d&&!r,{ButtonTemplates:{AddButton:S}}=f.templates;return c.jsxs("fieldset",{className:n,id:i.$id,children:[c.jsx(y,{fieldPathId:i,title:m.title||g,required:u,schema:h,uiSchema:s,registry:f,optionalDataControl:x?o:void 0}),c.jsx(p,{fieldPathId:i,description:m.description||h.description,schema:h,uiSchema:s,registry:f}),x?void 0:o,c.jsx("div",{className:"row array-item-list",children:a}),e&&c.jsx(S,{id:qe(i,"add"),className:"rjsf-array-item-add",onClick:l,disabled:r||d,uiSchema:s,registry:f})]})}function Bb(t){const{fieldPathId:e,title:n,schema:r,uiSchema:i,required:s,registry:a,optionalDataControl:o}=t,l=U(i,a.globalUiOptions),{label:d=!0}=l;if(!n||!d)return null;const f=L("TitleFieldTemplate",a,l);return c.jsx(f,{id:hr(e),title:n,required:s,schema:r,uiSchema:i,registry:a,optionalDataControl:o})}function Ub(t){const{id:e,name:n,htmlName:r,value:i,readonly:s,disabled:a,autofocus:o,onBlur:l,onFocus:d,onChange:f,onChangeOverride:u,options:h,schema:g,uiSchema:m,registry:p,rawErrors:y,type:x,hideLabel:S,hideError:j,...b}=t,{ClearButton:v}=p.templates.ButtonTemplates;if(!e)throw console.log("No id for",t),new Error(`no id for props ${JSON.stringify(t)}`);const w={...b,...Nl(g,x,h)};let O;w.type==="number"||w.type==="integer"?O=i||i===0?i:"":O=i??"";const A=P.useCallback(({target:{value:C}})=>f(C===""?h.emptyValue:C),[f,h]),_=P.useCallback(({target:C})=>l(e,C&&C.value),[l,e]),T=P.useCallback(({target:C})=>d(e,C&&C.value),[d,e]),N=P.useCallback(C=>{C.preventDefault(),C.stopPropagation(),f(h.emptyValue??"")},[f,h.emptyValue]);return c.jsxs(c.Fragment,{children:[c.jsx("input",{id:e,name:r||e,className:"form-control",readOnly:s,disabled:a,autoFocus:o,value:O,...w,list:g.examples?Cn(e):void 0,onChange:u||A,onBlur:_,onFocus:T,"aria-describedby":we(e,!!g.examples)}),h.allowClearTextInputs&&!s&&!a&&O&&c.jsx(v,{registry:p,onClick:N}),Array.isArray(g.examples)&&c.jsx("datalist",{id:Cn(e),children:g.examples.concat(g.default&&!g.examples.includes(g.default)?[g.default]:[]).map(C=>c.jsx("option",{value:C},C))},`datalist_${e}`)]})}function Lb({uiSchema:t}){const{submitText:e,norender:n,props:r={}}=Tl(t);return n?null:c.jsx("div",{children:c.jsx("button",{type:"submit",...r,className:`btn btn-info ${r.className||""}`,children:e})})}function xt(t){const{iconType:e="default",icon:n,className:r,uiSchema:i,registry:s,...a}=t;return c.jsx("button",{type:"button",className:`btn btn-${e} ${r}`,...a,children:c.jsx("i",{className:`glyphicon glyphicon-${n}`})})}function Wb(t){const{registry:{translateString:e}}=t;return c.jsx(xt,{title:e(K.CopyButton),...t,icon:"copy"})}function Vb(t){const{registry:{translateString:e}}=t;return c.jsx(xt,{title:e(K.MoveDownButton),...t,icon:"arrow-down"})}function zb(t){const{registry:{translateString:e}}=t;return c.jsx(xt,{title:e(K.MoveUpButton),...t,icon:"arrow-up"})}function qb(t){const{registry:{translateString:e}}=t;return c.jsx(xt,{title:e(K.RemoveButton),...t,iconType:"danger",icon:"remove"})}function Kb({id:t,className:e,onClick:n,disabled:r,registry:i,...s}){const{translateString:a}=i;return c.jsx(xt,{id:t,iconType:"default",icon:"remove",className:"btn-clear col-xs-12",title:a(K.ClearButton),onClick:n,disabled:r,registry:i,...s})}function Gb({id:t,className:e,onClick:n,disabled:r,registry:i}){const{translateString:s}=i;return c.jsx("div",{className:"row",children:c.jsx("p",{className:`col-xs-4 col-sm-2 col-lg-1 col-xs-offset-8 col-sm-offset-10 col-lg-offset-11 text-right ${e}`,children:c.jsx(xt,{id:t,iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:s(K.AddButton),onClick:n,disabled:r,registry:i})})})}function Hb(){return{SubmitButton:Lb,AddButton:Gb,CopyButton:Wb,MoveDownButton:Vb,MoveUpButton:zb,RemoveButton:qb,ClearButton:Kb}}const Yl=Gi();function rs({description:t,registry:e,uiSchema:n={}}){const{globalUiOptions:r}=e;return U(n,r).enableMarkdownInDescription&&typeof t=="string"?c.jsx(Rn,{options:{disableParsingRawHTML:!0},"data-testid":Yl.markdown,children:t}):t}rs.TEST_IDS=Yl;function Yb(t){const{id:e,description:n,registry:r,uiSchema:i}=t;return n?c.jsx("div",{id:e,className:"field-description",children:c.jsx(rs,{description:n,registry:r,uiSchema:i})}):null}function Xb({errors:t,registry:e}){const{translateString:n}=e;return c.jsxs("div",{className:"panel panel-danger errors",children:[c.jsx("div",{className:"panel-heading",children:c.jsx("h3",{className:"panel-title",children:n(K.ErrorsLabel)})}),c.jsx("ul",{className:"list-group",children:t.map((r,i)=>c.jsx("li",{className:"list-group-item text-danger",children:r.stack},i))})]})}function Jb(t){const{schema:e,registry:n,typeSelector:r,schemaField:i}=t,s=L("MultiSchemaFieldTemplate",n);return c.jsx(s,{selector:r,optionSchemaField:i,schema:e,registry:n})}const Zb="*";function Xl(t){const{label:e,required:n,id:r}=t;return e?c.jsxs("label",{className:"control-label",htmlFor:r,children:[e,n&&c.jsx("span",{className:"required",children:Zb})]}):null}function Qb(t){const{id:e,label:n,children:r,errors:i,help:s,description:a,hidden:o,required:l,displayLabel:d,registry:f,uiSchema:u}=t,h=U(u),g=L("WrapIfAdditionalTemplate",f,h);if(o)return c.jsx("div",{className:"hidden",children:r});const m=h.widget==="checkbox";return c.jsxs(g,{...t,children:[d&&!m&&c.jsx(Xl,{label:n,required:l,id:e}),d&&a?a:null,r,i,s]})}function ev(t){const{errors:e=[],fieldPathId:n}=t;if(e.length===0)return null;const r=Hi(n);return c.jsx("div",{children:c.jsx("ul",{id:r,className:"error-detail bs-callout bs-callout-info",children:e.filter(i=>!!i).map((i,s)=>c.jsx("li",{className:"text-danger",children:i},s))})})}const Jl=Gi();function is({help:t,registry:e,uiSchema:n={}}){const{globalUiOptions:r}=e;return U(n,r).enableMarkdownInHelp&&typeof t=="string"?c.jsx(Rn,{options:{disableParsingRawHTML:!0},"data-testid":Jl.markdown,children:t}):t}is.TEST_IDS=Jl;function tv(t){const{fieldPathId:e,help:n,uiSchema:r,registry:i}=t;return n?c.jsx("div",{id:Yi(e),className:"help-block",children:c.jsx(is,{help:n,registry:i,uiSchema:r})}):null}function nv(t){const{children:e,column:n,className:r,...i}=t;return c.jsx("div",{className:r,...i,children:e})}function rv(t){const{selector:e,optionSchemaField:n}=t;return c.jsxs("div",{className:"panel panel-default panel-body",children:[c.jsx("div",{className:"form-group",children:e}),n]})}function iv(t){const{className:e,description:n,disabled:r,formData:i,fieldPathId:s,onAddProperty:a,optionalDataControl:o,properties:l,readonly:d,registry:f,required:u,schema:h,title:g,uiSchema:m}=t,p=U(m),y=L("TitleFieldTemplate",f,p),x=L("DescriptionFieldTemplate",f,p);if((h.oneOf||h.anyOf)&&!h.properties&&l.length===0)return null;const j=!d&&!r,{ButtonTemplates:{AddButton:b}}=f.templates;return c.jsxs("fieldset",{className:e,id:s.$id,children:[g&&c.jsx(y,{id:hr(s),title:g,required:u,schema:h,uiSchema:m,registry:f,optionalDataControl:j?o:void 0}),n&&c.jsx(x,{id:Et(s),description:n,schema:h,uiSchema:m,registry:f}),j?void 0:o,l.map(v=>v.content),ca(h,m,i)&&c.jsx(b,{id:qe(s,"add"),className:"rjsf-object-property-expand",onClick:a,disabled:r||d,uiSchema:m,registry:f})]})}function sv(t){const{id:e,registry:n,label:r,onAddClick:i,onRemoveClick:s}=t;return i?c.jsx(xt,{id:e,registry:n,icon:"plus",className:"rjsf-add-optional-data btn-sm",onClick:i,title:r}):s?c.jsx(xt,{id:e,registry:n,icon:"remove",className:"rjsf-remove-optional-data btn-sm",onClick:s,title:r}):c.jsx("em",{id:e,children:r})}const ov="*";function av(t){const{id:e,title:n,required:r,optionalDataControl:i}=t;return c.jsxs("legend",{id:e,children:[n,r&&c.jsx("span",{className:"required",children:ov}),i&&c.jsx("span",{className:"pull-right",style:{marginBottom:"2px"},children:i})]})}function lv(t){const{schema:e,fieldPathId:n,reason:r,registry:i}=t,{translateString:s}=i;let a=K.UnsupportedField;const o=[];return n&&n.$id&&(a=K.UnsupportedFieldWithId,o.push(n.$id)),r&&(a=a===K.UnsupportedField?K.UnsupportedFieldWithReason:K.UnsupportedFieldWithIdAndReason,o.push(r)),c.jsxs("div",{className:"unsupported-field",children:[c.jsx("p",{children:c.jsx(Rn,{options:{disableParsingRawHTML:!0},children:s(a,o)})}),e&&c.jsx("pre",{children:JSON.stringify(e,null,2)})]})}function cv(t){const{id:e,classNames:n,style:r,disabled:i,displayLabel:s,label:a,onKeyRenameBlur:o,onRemoveProperty:l,rawDescription:d,readonly:f,required:u,schema:h,hideError:g,rawErrors:m,children:p,uiSchema:y,registry:x}=t,{templates:S,translateString:j}=x,{RemoveButton:b}=S.ButtonTemplates,v=j(K.KeyLabel,[a]),w=Qe in h,O=!!d,A=["form-group",n];!g&&m&&m.length>0&&A.push("has-error has-danger");const _=A.join(" ").trim();if(!w)return c.jsx("div",{className:_,style:r,children:p});const T=O?46:26;return c.jsx("div",{className:_,style:r,children:c.jsxs("div",{className:"row",children:[c.jsx("div",{className:"col-xs-5 form-additional",children:c.jsxs("div",{className:"form-group",children:[s&&c.jsx(Xl,{label:v,required:u,id:`${e}-key`}),s&&d&&c.jsx("div",{children:" "}),c.jsx("input",{className:"form-control",type:"text",id:`${e}-key`,onBlur:o,defaultValue:a})]})}),c.jsx("div",{className:"form-additional form-group col-xs-5",children:p}),c.jsx("div",{className:"col-xs-2",style:{marginTop:s?`${T}px`:void 0},children:c.jsx(b,{id:qe(e,"remove"),className:"rjsf-object-property-remove btn-block",style:{border:"0"},disabled:i||f,onClick:l,uiSchema:y,registry:x})})]})})}function uv(){return{ArrayFieldDescriptionTemplate:$b,ArrayFieldItemTemplate:kb,ArrayFieldItemButtonsTemplate:Mb,ArrayFieldTemplate:Rb,ArrayFieldTitleTemplate:Bb,ButtonTemplates:Hb(),BaseInputTemplate:Ub,DescriptionFieldTemplate:Yb,ErrorListTemplate:Xb,FallbackFieldTemplate:Jb,FieldTemplate:Qb,FieldErrorTemplate:ev,FieldHelpTemplate:tv,GridTemplate:nv,MultiSchemaFieldTemplate:rv,ObjectFieldTemplate:iv,OptionalDataControlsTemplate:sv,TitleFieldTemplate:av,UnsupportedFieldTemplate:lv,WrapIfAdditionalTemplate:cv}}function dv(t){const{disabled:e=!1,readonly:n=!1,autofocus:r=!1,options:i,id:s,name:a,registry:o,onBlur:l,onFocus:d}=t,{translateString:f}=o,{elements:u,handleChange:h,handleClear:g,handleSetNow:m}=Ox(t);return c.jsxs("ul",{className:"list-inline",children:[u.map((p,y)=>c.jsx("li",{className:"list-inline-item",children:c.jsx(jx,{rootId:s,name:a,select:h,...p,disabled:e,readonly:n,registry:o,onBlur:l,onFocus:d,autofocus:r&&y===0})},y)),(i.hideNowButton!=="undefined"?!i.hideNowButton:!0)&&c.jsx("li",{className:"list-inline-item",children:c.jsx("a",{href:"#",className:"btn btn-info btn-now",onClick:m,children:f(K.NowLabel)})}),(i.hideClearButton!=="undefined"?!i.hideClearButton:!0)&&c.jsx("li",{className:"list-inline-item",children:c.jsx("a",{href:"#",className:"btn btn-warning btn-clear",onClick:g,children:f(K.ClearLabel)})})]})}function fv({time:t=!0,...e}){const{AltDateWidget:n}=e.registry.widgets;return c.jsx(n,{time:t,...e})}function mv({schema:t,uiSchema:e,options:n,id:r,value:i,disabled:s,readonly:a,label:o,hideLabel:l,autofocus:d=!1,onBlur:f,onFocus:u,onChange:h,registry:g,htmlName:m}){const p=L("DescriptionFieldTemplate",g,n),y=hn(t),x=P.useCallback(O=>h(O.target.checked),[h]),S=P.useCallback(O=>f(r,O.target.checked),[f,r]),j=P.useCallback(O=>u(r,O.target.checked),[u,r]),w=U(e).widget==="checkbox"?void 0:n.description??t.description;return c.jsxs("div",{className:`checkbox ${s||a?"disabled":""}`,children:[!l&&w&&c.jsx(p,{id:Et(r),description:w,schema:t,uiSchema:e,registry:g}),c.jsxs("label",{children:[c.jsx("input",{type:"checkbox",id:r,name:m||r,checked:typeof i>"u"?!1:i,required:y,disabled:s||a,autoFocus:d,onChange:x,onBlur:S,onFocus:j,"aria-describedby":we(r)}),Pl(c.jsx("span",{children:o}),l)]})]})}function hv({id:t,disabled:e,options:{inline:n=!1,enumOptions:r,enumDisabled:i,emptyValue:s},value:a,autofocus:o=!1,readonly:l,onChange:d,onBlur:f,onFocus:u,htmlName:h}){const g=Array.isArray(a)?a:[a],m=P.useCallback(({target:y})=>f(t,ge(y&&y.value,r,s)),[f,t,r,s]),p=P.useCallback(({target:y})=>u(t,ge(y&&y.value,r,s)),[u,t,r,s]);return c.jsx("div",{className:"checkboxes",id:t,children:Array.isArray(r)&&r.map((y,x)=>{const S=kn(y.value,g),j=Array.isArray(i)&&i.indexOf(y.value)!==-1,b=e||j||l?"disabled":"",v=O=>{O.target.checked?d(Al(x,g,r)):d(jl(x,g,r))},w=c.jsxs("span",{children:[c.jsx("input",{type:"checkbox",id:wt(t,x),name:h||t,checked:S,value:String(x),disabled:e||j||l,autoFocus:o&&x===0,onChange:v,onBlur:m,onFocus:p,"aria-describedby":we(t)}),c.jsx("span",{children:y.label})]});return n?c.jsx("label",{className:`checkbox-inline ${b}`,children:w},x):c.jsx("div",{className:`checkbox ${b}`,children:c.jsx("label",{children:w})},x)})})}function pv(t){const{disabled:e,readonly:n,options:r,registry:i}=t,s=L("BaseInputTemplate",i,r);return c.jsx(s,{type:"color",...t,disabled:e||n})}function gv(t){const{onChange:e,options:n,registry:r}=t,i=L("BaseInputTemplate",r,n),s=P.useCallback(a=>e(a||void 0),[e]);return c.jsx(i,{type:"date",...t,onChange:s})}function yv(t){const{onChange:e,value:n,options:r,registry:i}=t,s=L("BaseInputTemplate",i,r);return c.jsx(s,{type:"datetime-local",...t,value:Tx(n),onChange:a=>e(bx(a))})}function xv(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{type:"email",...t})}function bv({fileInfo:t,registry:e}){const{translateString:n}=e,{dataURL:r,type:i,name:s}=t;return r?["image/jpeg","image/png"].includes(i)?c.jsx("img",{src:r,style:{maxWidth:"100%"},className:"file-preview"}):c.jsxs(c.Fragment,{children:[" ",c.jsx("a",{download:`preview-${s}`,href:r,className:"file-download",children:n(K.PreviewLabel)})]}):null}function vv({filesInfo:t,registry:e,preview:n,onRemove:r,options:i}){if(t.length===0)return null;const{translateString:s}=e,{RemoveButton:a}=L("ButtonTemplates",e,i);return c.jsx("ul",{className:"file-info",children:t.map((o,l)=>{const{name:d,size:f,type:u}=o,h=()=>r(l);return c.jsxs("li",{children:[c.jsx(Rn,{children:s(K.FilesInfo,[d,u,String(f)])}),n&&c.jsx(bv,{fileInfo:o,registry:e}),c.jsx(a,{onClick:h,registry:e})]},l)})})}function Sv(t){const{disabled:e,readonly:n,required:r,multiple:i,onChange:s,value:a,options:o,registry:l}=t,{filesInfo:d,handleChange:f,handleRemove:u}=Nx(a,s,i),h=L("BaseInputTemplate",l,o),g=m=>{m.target.files&&f(m.target.files)};return c.jsxs("div",{children:[c.jsx(h,{...t,disabled:e||n,type:"file",required:a?!1:r,onChangeOverride:g,value:"",accept:o.accept?String(o.accept):void 0}),c.jsx(vv,{filesInfo:d,onRemove:u,registry:l,preview:o.filePreview,options:o})]})}function wv({id:t,value:e,htmlName:n}){return c.jsx("input",{type:"hidden",id:t,name:n||t,value:typeof e>"u"?"":e})}function jv(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{type:"password",...t})}function Ov({options:t,value:e,required:n,disabled:r,readonly:i,autofocus:s=!1,onBlur:a,onFocus:o,onChange:l,id:d,htmlName:f}){const{enumOptions:u,enumDisabled:h,inline:g,emptyValue:m}=t,p=P.useCallback(({target:x})=>a(d,ge(x&&x.value,u,m)),[a,u,m,d]),y=P.useCallback(({target:x})=>o(d,ge(x&&x.value,u,m)),[o,u,m,d]);return c.jsx("div",{className:"field-radio-group",id:d,role:"radiogroup",children:Array.isArray(u)&&u.map((x,S)=>{const j=kn(x.value,e),b=Array.isArray(h)&&h.indexOf(x.value)!==-1,v=r||b||i?"disabled":"",w=()=>l(x.value),O=c.jsxs("span",{children:[c.jsx("input",{type:"radio",id:wt(d,S),checked:j,name:f||d,required:n,value:String(S),disabled:r||b||i,autoFocus:s&&S===0,onChange:w,onBlur:p,onFocus:y,"aria-describedby":we(d)}),c.jsx("span",{children:x.label})]});return g?c.jsx("label",{className:`radio-inline ${v}`,children:O},S):c.jsx("div",{className:`radio ${v}`,children:c.jsx("label",{children:O})},S)})})}function Av(t){const{value:e,registry:{templates:{BaseInputTemplate:n}}}=t;return c.jsxs("div",{className:"field-range-wrapper",children:[c.jsx(n,{type:"range",...t}),c.jsx("span",{className:"range-view",children:e})]})}function _v({id:t,value:e,required:n,disabled:r,readonly:i,autofocus:s,onChange:a,onFocus:o,onBlur:l,schema:d,options:f,htmlName:u}){const{stars:h=5,shape:g="star"}=f,m=d.maximum?Math.min(d.maximum,5):Math.min(Math.max(h,1),5),p=d.minimum||0,y=P.useCallback(b=>{!r&&!i&&a(b)},[a,r,i]),x=P.useCallback(b=>{if(o){const v=Number(b.target.dataset.value);o(t,v)}},[o,t]),S=P.useCallback(b=>{if(l){const v=Number(b.target.dataset.value);l(t,v)}},[l,t]),j=b=>g==="heart"?b?"♥":"♡":b?"★":"☆";return c.jsx(c.Fragment,{children:c.jsxs("div",{className:"rating-widget",style:{display:"inline-flex",fontSize:"1.5rem",cursor:r||i?"default":"pointer"},children:[[...Array(m)].map((b,v)=>{const w=p+v,O=w<=e;return c.jsx("span",{onClick:()=>y(w),onFocus:x,onBlur:S,"data-value":w,tabIndex:r||i?-1:0,role:"radio","aria-checked":w===e,"aria-label":`${w} ${g==="heart"?"heart":"star"}${w===1?"":"s"}`,style:{color:O?"#FFD700":"#ccc",padding:"0 0.2rem",transition:"color 0.2s",userSelect:"none"},children:j(O)},v)}),c.jsx("input",{type:"hidden",id:t,name:u||t,value:e||"",required:n,disabled:r||i,"aria-hidden":"true"})]})})}function Wr(t,e){return e?Array.from(t.target.options).slice().filter(n=>n.selected).map(n=>n.value):t.target.value}function Cv({schema:t,id:e,options:n,value:r,required:i,disabled:s,readonly:a,multiple:o=!1,autofocus:l=!1,onChange:d,onBlur:f,onFocus:u,placeholder:h,htmlName:g}){const{enumOptions:m,enumDisabled:p,emptyValue:y}=n,x=o?[]:"",S=P.useCallback(O=>{const A=Wr(O,o);return u(e,ge(A,m,y))},[u,e,o,m,y]),j=P.useCallback(O=>{const A=Wr(O,o);return f(e,ge(A,m,y))},[f,e,o,m,y]),b=P.useCallback(O=>{const A=Wr(O,o);return d(ge(A,m,y))},[d,o,m,y]),v=Ol(r,m,o),w=!o&&t.default===void 0;return c.jsxs("select",{id:e,name:g||e,multiple:o,role:"combobox",className:"form-control",value:typeof v>"u"?x:v,required:i,disabled:s||a,autoFocus:l,onBlur:j,onFocus:S,onChange:b,"aria-describedby":we(e),children:[w&&c.jsx("option",{value:"",children:h}),Array.isArray(m)&&m.map(({value:O,label:A},_)=>{const T=p&&p.indexOf(O)!==-1;return c.jsx("option",{value:String(_),disabled:T,children:A},_)})]})}function Nv({id:t,options:e={},placeholder:n,value:r,required:i,disabled:s,readonly:a,autofocus:o=!1,onChange:l,onBlur:d,onFocus:f,htmlName:u}){const h=P.useCallback(({target:{value:p}})=>l(p===""?e.emptyValue:p),[l,e.emptyValue]),g=P.useCallback(({target:p})=>d(t,p&&p.value),[d,t]),m=P.useCallback(({target:p})=>f(t,p&&p.value),[t,f]);return c.jsx("textarea",{id:t,name:u||t,className:"form-control",value:r||"",placeholder:n,required:i,disabled:s,readOnly:a,autoFocus:o,rows:e.rows,onBlur:g,onFocus:m,onChange:h,"aria-describedby":we(t)})}function Tv(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{...t})}function Fv(t){const{onChange:e,options:n,registry:r}=t,i=L("BaseInputTemplate",r,n),s=P.useCallback(a=>e(a?`${a}:00`:void 0),[e]);return c.jsx(i,{type:"time",...t,onChange:s})}function Pv(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{type:"url",...t})}function Ev(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{type:"number",...t})}function Iv(){return{AltDateWidget:dv,AltDateTimeWidget:fv,CheckboxWidget:mv,CheckboxesWidget:hv,ColorWidget:pv,DateWidget:gv,DateTimeWidget:yv,EmailWidget:xv,FileWidget:Sv,HiddenWidget:wv,PasswordWidget:jv,RadioWidget:Ov,RangeWidget:Av,RatingWidget:_v,SelectWidget:Cv,TextWidget:Tv,TextareaWidget:Nv,TimeWidget:Fv,UpDownWidget:Ev,URLWidget:Pv}}function Dv(){return{fields:Db(),templates:uv(),widgets:Iv(),rootSchema:{},formContext:{},translateString:rx,globalFormOptions:{idPrefix:oa,idSeparator:aa,useFallbackUiForUnsupportedType:!1}}}function $t(t,e){return{...qi(t,["schema","uiSchema","fieldPathId","schemaUtils","formData","edit","errors","errorSchema"]),...e!==void 0&&{status:e}}}let $v=class extends P.Component{formElement;pendingChanges=[];_isProcessingUserChange=!1;constructor(e){if(super(e),!e.validator)throw new Error("A validator is required for Form functionality to work");const{formData:n,initialFormData:r,onChange:i}=e,s=n??r;this.state=this.getStateFromProps(e,s,void 0,void 0,void 0,!0),i&&!le(this.state.formData,s)&&i($t(this.state)),this.formElement=P.createRef()}getSnapshotBeforeUpdate(e,n){if(!le(this.props,e)){const r=ao(this.props.formData,e.formData),i=ao(this.props.formData,this.state.formData),s=!le(e.schema,this.props.schema),a=r.length>0||!le(e.formData,this.props.formData),o=i.length>0||!le(this.state.formData,this.props.formData),l=this.getStateFromProps(this.props,this.props.formData,s||a?void 0:this.state.retrievedSchema,s,r,!o),d=!le(l,n);return{nextState:l,shouldUpdate:d}}return{shouldUpdate:!1}}componentDidUpdate(e,n,r){if(r.shouldUpdate){const{nextState:i}=r,s=!le(i.formData,this.props.formData),a=this._isProcessingUserChange;if(this._isProcessingUserChange=!1,a&&s)return;s&&!le(i.formData,n.formData)&&this.props.onChange&&this.props.onChange($t(i)),this.setState(i)}}getStateFromProps(e,n,r,i=!1,s=[],a=!1){const o=this.state||{},l="schema"in e?e.schema:this.props.schema,d="validator"in e?e.validator:this.props.validator,f=("uiSchema"in e?e.uiSchema:this.props.uiSchema)||{},u=e.formData===void 0&&this.props.formData===void 0,h=typeof n<"u",g="liveValidate"in e?e.liveValidate:this.props.liveValidate,m=h&&!e.noValidate&&g,p="experimental_defaultFormStateBehavior"in e?e.experimental_defaultFormStateBehavior:this.props.experimental_defaultFormStateBehavior,y="experimental_customMergeAllOf"in e?e.experimental_customMergeAllOf:this.props.experimental_customMergeAllOf;let x=o.schemaUtils;(!x||x.doesSchemaUtilsDiffer(d,l,p,y))&&(x=ex(d,l,p,y));const S=x.getRootSchema();let j=n;n===ko?j=void 0:n===void 0&&u&&(j=o.formData);const b=x.getDefaultFormState(S,j,!1,o.initialDefaultsGenerated),v=this.updateRetrievedSchema(r??x.retrieveSchema(S,b)),w=()=>e.noValidate||i?{errors:[],errorSchema:{}}:e.liveValidate?{errors:o.errors||[],errorSchema:o.errorSchema||{}}:{errors:o.schemaValidationErrors||[],errorSchema:o.schemaValidationErrorSchema||{}};let O,A,_=o.schemaValidationErrors,T=o.schemaValidationErrorSchema;if(m&&!a){const E=this.liveValidate(S,x,o.errorSchema,b,void 0,o.customErrors,r,r!==void 0);O=E.errors,A=E.errorSchema,_=E.schemaValidationErrors,T=E.schemaValidationErrorSchema}else{const E=w();if(O=E.errors,A=E.errorSchema,s.length>0&&!m){const M=s.reduce((k,B)=>(k[B]=void 0,k),{});A=T=_n(E.errorSchema,M,"preventDuplicates")}const D=this.mergeErrors({errorSchema:A,errors:O},e.extraErrors,o.customErrors);O=D.errors,A=D.errorSchema}const N=this.getRegistry(e,S,x),C=le(o.registry,N)?o.registry:N,F=o.fieldPathId&&o.fieldPathId?.[oe]===C.globalFormOptions.idPrefix?o.fieldPathId:Fe("",C.globalFormOptions);return{schemaUtils:x,schema:S,uiSchema:f,fieldPathId:F,formData:b,edit:h,errors:O,errorSchema:A,schemaValidationErrors:_,schemaValidationErrorSchema:T,retrievedSchema:v,initialDefaultsGenerated:!0,registry:C}}shouldComponentUpdate(e,n){const{experimental_componentUpdateStrategy:r="customDeep"}=this.props;return El(this,e,n,r)}validate(e,n=this.state.schema,r,i){const s=r||this.state.schemaUtils,{customValidate:a,transformErrors:o,uiSchema:l}=this.props,d=i??s.retrieveSchema(n,e);return s.getValidator().validateFormData(e,d,a,o,l)}renderErrors(e){const{errors:n,errorSchema:r,schema:i,uiSchema:s}=this.state,a=U(s),o=L("ErrorListTemplate",e,a);return n&&n.length?c.jsx(o,{errors:n,errorSchema:r||{},schema:i,uiSchema:s,registry:e}):null}mergeErrors(e,n,r){let i=e.errorSchema,s=e.errors;if(n){const a=Xn(e,n);i=a.errorSchema,s=a.errors}if(r){const a=Xn(e,r.ErrorSchema,!0);i=a.errorSchema,s=a.errors}return{errors:s,errorSchema:i}}liveValidate(e,n,r,i,s,a,o,l=!1){const d=this.validate(i,e,n,o),f=d.errors;let u=d.errorSchema;l&&(u=_n(r,d.errorSchema,"preventDuplicates"));const h=f,g=u;return{...this.mergeErrors({errorSchema:u,errors:f},s,a),schemaValidationErrors:h,schemaValidationErrorSchema:g}}getUsedFormData=(e,n)=>vl(e,n);getFieldNames=(e,n)=>Sl(e,n);omitExtraData=e=>{const{schema:n,schemaUtils:r}=this.state;return r.omitExtraData(n,e)};setFieldValue=(e,n)=>{const{registry:r}=this.state,i=Array.isArray(e)?e:e.split("."),s=Fe("",r.globalFormOptions,i);this.onChange(n,i,void 0,s[oe])};onChange=(e,n,r,i)=>{this.pendingChanges.push({newValue:e,path:n,newErrorSchema:r,id:i}),this.pendingChanges.length===1&&this.processPendingChange()};processPendingChange(){if(this.pendingChanges.length===0)return;this._isProcessingUserChange=!0;const{newValue:e,path:n,id:r}=this.pendingChanges[0],{newErrorSchema:i}=this.pendingChanges[0],{extraErrors:s,omitExtraData:a,liveOmit:o,noValidate:l,liveValidate:d,onChange:f}=this.props,{formData:u,schemaUtils:h,schema:g,fieldPathId:m,schemaValidationErrorSchema:p,errors:y}=this.state;let{customErrors:x,errorSchema:S}=this.state;const j=m.path[0]||"",b=!n||n.length===0||n.length===1&&n[0]===j;let v=this.state.retrievedSchema,w=b?e:Ki(u);const O=Y(w)&&Object.keys(w).length>0&&Object.values(w).every(F=>F===void 0),A=u==null,_=O&&A?void 0:w;if(Y(w)||Array.isArray(w)){e===Hl?Ix(w,n):b||se(w,n,e);const F=this.getStateFromProps(this.props,_,void 0,void 0,void 0,!0);w=F.formData,v=F.retrievedSchema}const T=!l&&(d===!0||d==="onChange");let N={formData:w,schema:g},C=w;if(a===!0&&(o===!0||o==="onChange")&&(C=this.omitExtraData(w),N={formData:C}),i){const F=b?p:I(p,n);if(!me(F))b?S=i:se(S,n,i);else if(x||(x=new _l),b){const $=I(i,xe);$&&x.setErrors($)}else se(x.ErrorSchema,n,i)}else x&&I(x.ErrorSchema,[...n,xe])&&x.clearErrors(n);if(T&&this.pendingChanges.length===1){const F=this.liveValidate(g,h,S,C,s,x,v);N={formData:C,...F,customErrors:x}}else if(!l&&i){const F=this.mergeErrors({errorSchema:S,errors:y},s,x);N={formData:C,...F,customErrors:x}}this.setState(N,()=>{f&&f($t({...this.state,...N}),r),this.pendingChanges.shift(),this.processPendingChange()})}updateRetrievedSchema(e){return le(e,this.state?.retrievedSchema)?this.state.retrievedSchema:e}reset=()=>{const{formData:e,initialFormData:n=ko,onChange:r}=this.props,a={formData:this.getStateFromProps(this.props,e??n,void 0,void 0,void 0,!0).formData,errorSchema:{},errors:[],schemaValidationErrors:[],schemaValidationErrorSchema:{},initialDefaultsGenerated:!1,customErrors:void 0};this.setState(a,()=>r&&r($t({...this.state,...a})))};onBlur=(e,n)=>{const{onBlur:r,omitExtraData:i,liveOmit:s,liveValidate:a}=this.props;if(r&&r(e,n),i===!0&&s==="onBlur"||a==="onBlur"){const{onChange:o,extraErrors:l}=this.props,{formData:d}=this.state;let f=d,u={formData:f};if(i===!0&&s==="onBlur"&&(f=this.omitExtraData(d),u={formData:f}),a==="onBlur"){const{schema:g,schemaUtils:m,errorSchema:p,customErrors:y,retrievedSchema:x}=this.state,S=this.liveValidate(g,m,p,f,l,y,x);u={formData:f,...S,customErrors:y}}const h=Object.keys(u).filter(g=>!g.startsWith("schemaValidation")).some(g=>{const m=I(this.state,g),p=I(u,g);return!le(m,p)});this.setState(u,()=>{o&&h&&o($t({...this.state,...u}),e)})}};onFocus=(e,n)=>{const{onFocus:r}=this.props;r&&r(e,n)};onSubmit=e=>{if(e.preventDefault(),e.target!==e.currentTarget)return;e.persist();const{omitExtraData:n,extraErrors:r,noValidate:i,onSubmit:s}=this.props;let{formData:a}=this.state;if(n===!0&&(a=this.omitExtraData(a)),i||this.validateFormWithFormData(a)){const o=r||{},l=r?Ji(r):[];this.setState({formData:a,errors:l,errorSchema:o,schemaValidationErrors:[],schemaValidationErrorSchema:{}},()=>{s&&s($t({...this.state,formData:a},"submitted"),e)})}};getGlobalFormOptions(e){const{uiSchema:n={},experimental_componentUpdateStrategy:r,idSeparator:i=aa,idPrefix:s=oa,nameGenerator:a,useFallbackUiForUnsupportedType:o=!1}=e;return{idPrefix:n["ui:rootFieldId"]||s,idSeparator:i,useFallbackUiForUnsupportedType:o,...r!==void 0&&{experimental_componentUpdateStrategy:r},...a!==void 0&&{nameGenerator:a}}}getRegistry(e,n,r){const{translateString:i,uiSchema:s={}}=e,{fields:a,templates:o,widgets:l,formContext:d,translateString:f}=Dv();return{fields:{...a,...e.fields},templates:{...o,...e.templates,ButtonTemplates:{...o.ButtonTemplates,...e.templates?.ButtonTemplates}},widgets:{...l,...e.widgets},rootSchema:n,formContext:e.formContext||d,schemaUtils:r,translateString:i||f,globalUiOptions:s[Kr],globalFormOptions:this.getGlobalFormOptions(e)}}submit=()=>{if(this.formElement.current){const e=new CustomEvent("submit",{cancelable:!0});e.preventDefault(),this.formElement.current.dispatchEvent(e),this.formElement.current.requestSubmit()}};focusOnError(e){const{idPrefix:n="root",idSeparator:r="_"}=this.props,{property:i}=e,s=Il(i);s[0]===""?s[0]=n:s.unshift(n);const a=s.join(r);let o=this.formElement.current.elements[a];o||(o=this.formElement.current.querySelector(`input[id^="${a}"`)),o&&o.length&&(o=o[0]),o&&o.focus()}validateFormWithFormData=e=>{const{extraErrors:n,extraErrorsBlockSubmit:r,focusOnFirstError:i,onError:s}=this.props,{errors:a}=this.state,o=this.validate(e);let l=o.errors,d=o.errorSchema;const f=l,u=d,h=l.length>0||n&&r;if(h){if(n){const g=Xn(o,n);d=g.errorSchema,l=g.errors}i&&(typeof i=="function"?i(l[0]):this.focusOnError(l[0])),this.setState({errors:l,errorSchema:d,schemaValidationErrors:f,schemaValidationErrorSchema:u},()=>{s?s(l):console.error("Form validation failed",l)})}else a.length>0&&this.setState({errors:[],errorSchema:{},schemaValidationErrors:[],schemaValidationErrorSchema:{}});return!h};validateForm(){const{omitExtraData:e}=this.props;let{formData:n}=this.state;return e===!0&&(n=this.omitExtraData(n)),this.validateFormWithFormData(n)}render(){const{children:e,id:n,className:r="",tagName:i,name:s,method:a,target:o,action:l,autoComplete:d,enctype:f,acceptCharset:u,noHtml5Validate:h=!1,disabled:g,readonly:m,showErrorList:p="top",_internalFormWrapper:y}=this.props,{schema:x,uiSchema:S,formData:j,errorSchema:b,fieldPathId:v,registry:w}=this.state,{SchemaField:O}=w.fields,{SubmitButton:A}=w.templates.ButtonTemplates,_=y?i:void 0,T=y||i||"form";let{[Qn]:N={}}=U(S);g&&(N={...N,props:{...N.props,disabled:!0}});const C={[ut]:{[Qn]:N}};return c.jsxs(T,{className:r||"rjsf",id:n,name:s,method:a,target:o,action:l,autoComplete:d,encType:f,acceptCharset:u,noValidate:h,onSubmit:this.onSubmit,as:_,ref:this.formElement,children:[p==="top"&&this.renderErrors(w),c.jsx(O,{name:"",schema:x,uiSchema:S,errorSchema:b,fieldPathId:v,formData:j,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,registry:w,disabled:g,readonly:m}),e||c.jsx(A,{uiSchema:C,registry:w}),p==="bottom"&&this.renderErrors(w)]})}};function kv(t){return P.forwardRef(({fields:e,widgets:n,templates:r,...i},s)=>(e={...t?.fields,...e},n={...t?.widgets,...n},r={...t?.templates,...r,ButtonTemplates:{...t?.templates?.ButtonTemplates,...r?.ButtonTemplates}},c.jsx($v,{...t,...i,fields:e,widgets:n,templates:r,ref:s})))}var Vn={exports:{}},Vr={},Mo;function Mv(){return Mo||(Mo=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0;function e(_,T){return{validate:_,compare:T}}t.fullFormats={date:e(s,a),time:e(l,d),"date-time":e(u,h),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:p,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:A,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:x,int32:{type:"number",validate:b},int64:{type:"number",validate:v},float:{type:"number",validate:w},double:{type:"number",validate:w},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:e(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,a),time:e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,d),"date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,h),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);function n(_){return _%4===0&&(_%100!==0||_%400===0)}const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(_){const T=r.exec(_);if(!T)return!1;const N=+T[1],C=+T[2],F=+T[3];return C>=1&&C<=12&&F>=1&&F<=(C===2&&n(N)?29:i[C])}function a(_,T){if(_&&T)return _>T?1:_<T?-1:0}const o=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function l(_,T){const N=o.exec(_);if(!N)return!1;const C=+N[1],F=+N[2],$=+N[3],E=N[5];return(C<=23&&F<=59&&$<=59||C===23&&F===59&&$===60)&&(!T||E!=="")}function d(_,T){if(!(_&&T))return;const N=o.exec(_),C=o.exec(T);if(N&&C)return _=N[1]+N[2]+N[3]+(N[4]||""),T=C[1]+C[2]+C[3]+(C[4]||""),_>T?1:_<T?-1:0}const f=/t|\s/i;function u(_){const T=_.split(f);return T.length===2&&s(T[0])&&l(T[1],!0)}function h(_,T){if(!(_&&T))return;const[N,C]=_.split(f),[F,$]=T.split(f),E=a(N,F);if(E!==void 0)return E||d(C,$)}const g=/\/|:/,m=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function p(_){return g.test(_)&&m.test(_)}const y=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function x(_){return y.lastIndex=0,y.test(_)}const S=-2147483648,j=2**31-1;function b(_){return Number.isInteger(_)&&_<=j&&_>=S}function v(_){return Number.isInteger(_)}function w(){return!0}const O=/[^\\]\\Z/;function A(_){if(O.test(_))return!1;try{return new RegExp(_),!0}catch{return!1}}})(Vr)),Vr}var zr={},Ro;function Rv(){return Ro||(Ro=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;const e=ou(),n=Yo(),r=n.operators,i={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},s={message:({keyword:o,schemaCode:l})=>n.str`should be ${i[o].okStr} ${l}`,params:({keyword:o,schemaCode:l})=>n._`{comparison: ${i[o].okStr}, limit: ${l}}`};t.formatLimitDefinition={keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:s,code(o){const{gen:l,data:d,schemaCode:f,keyword:u,it:h}=o,{opts:g,self:m}=h;if(!g.validateFormats)return;const p=new e.KeywordCxt(h,m.RULES.all.format.definition,"format");p.$data?y():x();function y(){const j=l.scopeValue("formats",{ref:m.formats,code:g.code.formats}),b=l.const("fmt",n._`${j}[${p.schemaCode}]`);o.fail$data(n.or(n._`typeof ${b} != "object"`,n._`${b} instanceof RegExp`,n._`typeof ${b}.compare != "function"`,S(b)))}function x(){const j=p.schema,b=m.formats[j];if(!b||b===!0)return;if(typeof b!="object"||b instanceof RegExp||typeof b.compare!="function")throw new Error(`"${u}": format "${j}" does not define "compare" function`);const v=l.scopeValue("formats",{key:j,ref:b,code:g.code.formats?n._`${g.code.formats}${n.getProperty(j)}`:void 0});o.fail$data(S(v))}function S(j){return n._`${j}.compare(${d}, ${f}) ${i[u].fail} 0`}},dependencies:["format"]};const a=o=>(o.addKeyword(t.formatLimitDefinition),o);t.default=a})(zr)),zr}var Bo;function Bv(){return Bo||(Bo=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const n=Mv(),r=Rv(),i=Yo(),s=new i.Name("fullFormats"),a=new i.Name("fastFormats"),o=(d,f={keywords:!0})=>{if(Array.isArray(f))return l(d,f,n.fullFormats,s),d;const[u,h]=f.mode==="fast"?[n.fastFormats,a]:[n.fullFormats,s],g=f.formats||n.formatNames;return l(d,g,u,h),f.keywords&&r.default(d),d};o.get=(d,f="full")=>{const h=(f==="fast"?n.fastFormats:n.fullFormats)[d];if(!h)throw new Error(`Unknown format "${d}"`);return h};function l(d,f,u,h){var g,m;(g=(m=d.opts.code).formats)!==null&&g!==void 0||(m.formats=i._`require("ajv-formats/dist/formats").${h}`);for(const p of f)d.addFormat(p,u[p])}t.exports=e=o,Object.defineProperty(e,"__esModule",{value:!0}),e.default=o})(Vn,Vn.exports)),Vn.exports}var Uv=Bv();const Uo=di(Uv),Lv={allErrors:!0,multipleOfPrecision:8,strict:!1,verbose:!0,discriminator:!1},Wv=/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,Vv=/^data:([a-z]+\/[a-z0-9-+.]+)?;(?:name=(.*);)?base64,(.*)$/;function zv(t,e,n={},r,i=au,s){let a=new i({...Lv,...n});return r?Uo(a,r):r!==!1&&Uo(a),a.addFormat("data-url",Vv),a.addFormat("color",Wv),a.addKeyword(Qe),a.addKeyword(vi),Array.isArray(t)&&a.addMetaSchema(t),Z(e)&&Object.keys(e).forEach(o=>{a.addFormat(o,e[o])}),s&&(a=s(a)),a}function qv(t=[],e){return t.map(r=>{var i;const{instancePath:s,keyword:a,params:o,schemaPath:l,parentSchema:d,...f}=r;let{message:u=""}=f,h=s.replace(/\//g,"."),g=`${h} ${u}`.trim(),m="";const p=[...((i=o.deps)===null||i===void 0?void 0:i.split(", "))||[],o.missingProperty,o.property].filter(y=>y);if(p.length>0)p.forEach(y=>{const x=h?`${h}.${y}`:y;let S=U(I(e,`${x.replace(/^\./,"")}`)).title;if(S===void 0){const j=l.replace(/\/properties\//g,"/").split("/").slice(1,-1).concat([y]);S=U(I(e,j)).title}if(S)u=u.replace(`'${y}'`,`'${S}'`),m=S;else{const j=I(d,[te,y,"title"]);j&&(u=u.replace(`'${y}'`,`'${j}'`),m=j)}}),g=u;else{const y=U(I(e,`${h.replace(/^\./,"")}`)).title;if(y)g=`'${y}' ${u}`.trim(),m=y;else{const x=d?.title;x&&(g=`'${x}' ${u}`.trim(),m=x)}}return"missingProperty"in o&&(h=h?`${h}.${o.missingProperty}`:o.missingProperty),{name:a,property:h,message:u,params:o,stack:g,schemaPath:l,title:m}}).reduce((r,i)=>{const{message:s,schemaPath:a}=i,o=a?.indexOf(`/${J}/`),l=a?.indexOf(`/${q}/`);let d;return o&&o>=0?d=a?.substring(0,o):l&&l>=0&&(d=a?.substring(0,l)),d&&r.find(u=>{var h;return u.message===s&&((h=u.schemaPath)===null||h===void 0?void 0:h.startsWith(d))})||r.push(i),r},[])}function Kv(t,e,n,r,i,s,a){const{validationError:o}=e;let l=qv(e.errors,a);o&&(l=[...l,{stack:o.message}]),typeof s=="function"&&(l=s(l,a));let d=Sx(l);if(o&&(d={...d,$schema:{__errors:[o.message]}}),typeof i!="function")return{errors:l,errorSchema:d};const f=pl(t,r,n,r,!0),u=i(f,Gr(f),a,d),h=Dl(u);return Xn({errors:l,errorSchema:d},h)}class Gv{constructor(e,n){const{additionalMetaSchemas:r,customFormats:i,ajvOptionsOverrides:s,ajvFormatOptions:a,AjvClass:o,extenderFn:l}=e;this.ajv=zv(r,i,s,a,o,l),this.localizer=n}reset(){this.ajv.removeSchema()}rawValidation(e,n){var r,i;let s,a;try{e[oe]&&(a=this.ajv.getSchema(e[oe])),a===void 0&&(a=this.ajv.compile(e)),a(n)}catch(l){s=l}let o;return a&&(typeof this.localizer=="function"&&(((r=a.errors)!==null&&r!==void 0?r:[]).forEach(l=>{var d;["missingProperty","property"].forEach(f=>{var u;!((u=l.params)===null||u===void 0)&&u[f]&&(l.params[f]=`'${l.params[f]}'`)}),!((d=l.params)===null||d===void 0)&&d.deps&&(l.params.deps=l.params.deps.split(", ").map(f=>`'${f}'`).join(", "))}),this.localizer(a.errors),((i=a.errors)!==null&&i!==void 0?i:[]).forEach(l=>{var d;["missingProperty","property"].forEach(f=>{var u;!((u=l.params)===null||u===void 0)&&u[f]&&(l.params[f]=l.params[f].slice(1,-1))}),!((d=l.params)===null||d===void 0)&&d.deps&&(l.params.deps=l.params.deps.split(", ").map(f=>f.slice(1,-1)).join(", "))})),o=a.errors||void 0,a.errors=null),{errors:o,validationError:s}}validateFormData(e,n,r,i,s){const a=this.rawValidation(n,e);return Kv(this,a,e,n,r,i,s)}handleSchemaUpdate(e){var n,r;const i=(n=e[oe])!==null&&n!==void 0?n:la;this.ajv.getSchema(i)===void 0?this.ajv.addSchema(e,i):le(e,(r=this.ajv.getSchema(i))===null||r===void 0?void 0:r.schema)||(this.ajv.removeSchema(i),this.ajv.addSchema(e,i))}isValid(e,n,r){var i;try{this.handleSchemaUpdate(r);const s=Zi(e),a=(i=s[oe])!==null&&i!==void 0?i:gx(s);let o;return o=this.ajv.getSchema(a),o===void 0&&(o=this.ajv.addSchema(s,a).getSchema(a)||this.ajv.compile(s)),o(n)}catch(s){return console.warn("Error encountered compiling schema:",s),!1}}}function Hv(t={},e){return new Gv(t,e)}const Yv=Hv();const Xv=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Jv=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase()),Lo=t=>{const e=Jv(t);return e.charAt(0).toUpperCase()+e.slice(1)},Zl=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim(),Zv=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var Qv={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const e1=P.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...o},l)=>P.createElement("svg",{ref:l,...Qv,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:Zl("lucide",i),...!s&&!Zv(o)&&{"aria-hidden":"true"},...o},[...a.map(([d,f])=>P.createElement(d,f)),...Array.isArray(s)?s:[s]]));const Xe=(t,e)=>{const n=P.forwardRef(({className:r,...i},s)=>P.createElement(e1,{ref:s,iconNode:e,className:Zl(`lucide-${Xv(Lo(t))}`,`lucide-${t}`,r),...i}));return n.displayName=Lo(t),n};const t1=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],n1=Xe("check",t1);const r1=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ql=Xe("chevron-down",r1);const i1=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],s1=Xe("chevron-up",i1);const o1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],a1=Xe("circle-alert",o1);const l1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],ec=Xe("circle-plus",l1);const c1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],u1=Xe("circle",c1);const d1=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],f1=Xe("copy",d1);const m1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],h1=Xe("search",m1);const p1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],g1=Xe("trash-2",p1);const y1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],tc=Xe("x",y1);function G(...t){return Pc(Ec(t))}const x1=fi("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",xs:"h-6 rounded-md gap-1 px-2 has-[>svg]:px-2",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function ss({className:t,variant:e,size:n,asChild:r=!1,...i}){const s=r?zo:"button";return c.jsx(s,{"data-slot":"button",className:G(x1({variant:e,size:n,className:t})),...i})}function b1({uiSchema:t,registry:e,className:n,...r}){const{translateString:i}=e;return c.jsx("div",{className:"p-0 m-0",children:c.jsxs(ss,{...r,className:G("w-fit gap-2",n),variant:"outline",type:"button",children:[c.jsx(ec,{size:16})," ",i(K.AddItemButton)]})})}function v1(t){const{children:e,buttonsProps:n,displayLabel:r,hasDescription:i,hasToolbar:s,uiSchema:a,registry:o}=t,l=U(a),d=L("ArrayFieldItemButtonsTemplate",o,l),f=i?-6:22;return c.jsx("div",{children:c.jsxs("div",{className:"mb-2 flex flex-row flex-wrap items-center",children:[c.jsx("div",{className:"grow shrink",children:e}),c.jsx("div",{className:"flex items-end justify-end p-0.5",children:s&&c.jsx("div",{className:"flex gap-2",style:{marginLeft:"5px",marginTop:r?`${f}px`:void 0},children:c.jsx(d,{...n})})})]})})}function S1(t){const{canAdd:e,disabled:n,fieldPathId:r,uiSchema:i,items:s,optionalDataControl:a,onAddClick:o,readonly:l,registry:d,required:f,schema:u,title:h}=t,g=U(i),m=L("ArrayFieldDescriptionTemplate",d,g),p=L("ArrayFieldTitleTemplate",d,g),y=!l&&!n,{ButtonTemplates:{AddButton:x}}=d.templates;return c.jsx("div",{children:c.jsx("div",{className:"m-0 flex p-0",children:c.jsxs("div",{className:"m-0 w-full p-0",children:[c.jsx(p,{fieldPathId:r,title:g.title||h,schema:u,uiSchema:i,required:f,registry:d,optionalDataControl:y?a:void 0}),c.jsx(m,{fieldPathId:r,description:g.description||u.description,schema:u,uiSchema:i,registry:d}),c.jsxs("div",{className:"p-0 m-0 w-full mb-2",children:[y?void 0:a,s,e&&c.jsx("div",{className:"mt-2 flex justify-end",children:c.jsx(x,{id:qe(r,"add"),className:"rjsf-array-item-add",onClick:o,disabled:n||l,uiSchema:i,registry:d})})]},`array-item-list-${r.$id}`)]})})})}function nc({className:t,type:e,...n}){return c.jsx("input",{type:e,"data-slot":"input",className:G("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...n})}function w1({id:t,htmlName:e,placeholder:n,required:r,readonly:i,disabled:s,type:a,value:o,onChange:l,onChangeOverride:d,onBlur:f,onFocus:u,autofocus:h,options:g,schema:m,rawErrors:p=[],children:y,extraProps:x,className:S,registry:j}){const{ClearButton:b}=j.templates.ButtonTemplates,v={...x,...Nl(m,a,g)},w=({target:{value:T}})=>l(T===""?g.emptyValue:T),O=({target:T})=>f(t,T&&T.value),A=({target:T})=>u(t,T&&T.value),_=P.useCallback(T=>{var N;T.preventDefault(),T.stopPropagation(),l((N=g.emptyValue)!==null&&N!==void 0?N:"")},[l,g.emptyValue]);return c.jsxs("div",{className:"p-0.5",children:[c.jsx(nc,{id:t,name:e||t,type:a,placeholder:n,autoFocus:h,required:r,disabled:s,readOnly:i,className:G({"border-destructive focus-visible:ring-0":p.length>0},S),list:m.examples?Cn(t):void 0,...v,value:o||o===0?o:"",onChange:d||w,onBlur:O,onFocus:A,"aria-describedby":we(t,!!m.examples)}),g.allowClearTextInputs&&!i&&!s&&o&&c.jsx(b,{onClick:_,registry:j}),y,Array.isArray(m.examples)?c.jsx("datalist",{id:Cn(t),children:m.examples.concat(m.default&&!m.examples.includes(m.default)?[m.default]:[]).map(T=>c.jsx("option",{value:T},T))}):null]})}function j1({id:t,description:e,registry:n,uiSchema:r}){return e?c.jsx("div",{children:c.jsx("div",{id:t,className:"text-sm text-muted-foreground",children:c.jsx(rs,{description:e,registry:n,uiSchema:r})})}):null}const O1=fi("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function A1({className:t,variant:e,...n}){return c.jsx("div",{"data-slot":"alert",role:"alert",className:G(O1({variant:e}),t),...n})}function _1({className:t,...e}){return c.jsx("div",{"data-slot":"alert-title",className:G("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...e})}function C1({className:t,...e}){return c.jsx("div",{"data-slot":"alert-description",className:G("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...e})}function N1({errors:t,registry:e}){const{translateString:n}=e;return c.jsxs(A1,{variant:"destructive",className:"mb-2",children:[c.jsx(a1,{className:"h-4 w-4"}),c.jsx(_1,{children:n(K.ErrorsLabel)}),c.jsx(C1,{className:"flex flex-col gap-1",children:t.map((r,i)=>c.jsxs("span",{children:["• ",r.stack]},i))})]})}function T1(t){const{errors:e=[],fieldPathId:n}=t;if(e.length===0)return null;const r=Hi(n);return c.jsx("div",{className:"flex flex-col gap-1",id:r,children:e.map((i,s)=>c.jsx("span",{className:"text-xs font-medium text-destructive mb-1",children:i},s))})}function F1(t){const{fieldPathId:e,help:n,uiSchema:r,registry:i,hasErrors:s}=t;return n?c.jsx("span",{className:G("text-xs font-medium text-muted-foreground",{"text-destructive":s}),id:Yi(e),children:c.jsx(is,{help:n,registry:i,uiSchema:r})}):null}function P1({id:t,children:e,displayLabel:n,rawErrors:r=[],errors:i,help:s,description:a,rawDescription:o,classNames:l,style:d,disabled:f,label:u,hidden:h,onKeyRename:g,onKeyRenameBlur:m,onRemoveProperty:p,readonly:y,required:x,schema:S,uiSchema:j,registry:b}){const v=U(j),w=L("WrapIfAdditionalTemplate",b,v);if(h)return c.jsx("div",{className:"hidden",children:e});const O=v.widget==="checkbox";return c.jsx(w,{classNames:l,style:d,disabled:f,id:t,label:u,displayLabel:n,onKeyRename:g,onKeyRenameBlur:m,onRemoveProperty:p,rawDescription:o,readonly:y,required:x,schema:S,uiSchema:j,registry:b,children:c.jsxs("div",{className:"flex flex-col gap-2",children:[n&&!O&&c.jsxs("label",{className:G("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{" text-destructive":r.length>0}),htmlFor:t,children:[u,x?"*":null]}),e,n&&o&&!O&&c.jsx("span",{className:G("text-xs font-medium text-muted-foreground",{" text-destructive":r.length>0}),children:a}),i,s]})})}function E1(t){const{children:e,column:n,className:r,...i}=t;return c.jsx("div",{className:G("grid gap-2",r),...i,children:e})}function en(t){const{icon:e,iconType:n,className:r,uiSchema:i,registry:s,...a}=t;return c.jsx(ss,{size:"icon",variant:"outline",className:r,...a,type:"button",children:e})}function I1(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.CopyButton),...t,icon:c.jsx(f1,{className:"h-4 w-4"})})}function D1(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.MoveDownButton),...t,icon:c.jsx(Ql,{className:"h-4 w-4"})})}function $1(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.MoveUpButton),...t,icon:c.jsx(s1,{className:"h-4 w-4"})})}function rc(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.RemoveButton),...t,className:"border-destructive",icon:c.jsx(g1,{className:"h-4 w-4 stroke-destructive"})})}function k1(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.ClearButton),...t,icon:c.jsx(tc,{})})}function M1({selector:t,optionSchemaField:e}){return c.jsxs("div",{className:G("p-4 border rounded-md bg-background shadow-sm"),children:[c.jsx("div",{className:G("mb-4"),children:t}),e]})}function R1({description:t,title:e,properties:n,required:r,uiSchema:i,fieldPathId:s,schema:a,formData:o,optionalDataControl:l,onAddProperty:d,disabled:f,readonly:u,registry:h}){const g=U(i),m=L("TitleFieldTemplate",h,g),p=L("DescriptionFieldTemplate",h,g),y=!u&&!f,{ButtonTemplates:{AddButton:x}}=h.templates;return c.jsxs(c.Fragment,{children:[e&&c.jsx(m,{id:hr(s),title:e,required:r,schema:a,uiSchema:i,registry:h,optionalDataControl:y?l:void 0}),t&&c.jsx(p,{id:Et(s),description:t,schema:a,uiSchema:i,registry:h}),c.jsxs("div",{className:"flex flex-col gap-2",children:[y?void 0:l,n.map((S,j)=>c.jsx("div",{className:`${S.hidden?"hidden":""} flex`,children:c.jsx("div",{className:"w-full",children:S.content})},j)),ca(a,i,o)?c.jsx("div",{className:"mt-2 flex justify-end",children:c.jsx(x,{id:qe(s,"add"),onClick:d,disabled:f||u,className:"rjsf-object-property-expand",uiSchema:i,registry:h})}):null]})]})}function B1(t){const{id:e,registry:n,label:r,onAddClick:i,onRemoveClick:s}=t;return i?c.jsx(en,{id:e,registry:n,className:"rjsf-add-optional-data",onClick:i,title:r,icon:c.jsx(ec,{}),size:"xs"}):s?c.jsx(rc,{id:e,registry:n,className:"rjsf-remove-optional-data",onClick:s,title:r,size:"xs"}):c.jsx("em",{id:e,children:r})}function U1(t){const{submitText:e,norender:n,props:r}=Tl(t.uiSchema);return n?null:c.jsx("div",{children:c.jsx(ss,{type:"submit",...r,className:G("my-2",r?.className),children:e})})}function ic({className:t,orientation:e="horizontal",decorative:n=!0,...r}){return c.jsx(Ic,{"data-slot":"separator",decorative:n,orientation:e,className:G("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...r})}function L1({id:t,title:e,uiSchema:n,optionalDataControl:r}){const i=U(n);let s=c.jsx("h5",{children:i.title||e});return r&&(s=c.jsxs("div",{className:"flex flex-row",children:[c.jsx("div",{className:"flex-grow",children:s}),c.jsx("div",{className:"flex",children:r})]})),c.jsxs("div",{id:t,className:"my-1 flex flex-col gap-0.5",children:[s,c.jsx(ic,{dir:"horizontal",style:{height:"1px"},className:"my-1"})]})}function W1({classNames:t,style:e,children:n,disabled:r,id:i,label:s,displayLabel:a,onRemoveProperty:o,onKeyRenameBlur:l,rawDescription:d,readonly:f,required:u,schema:h,uiSchema:g,registry:m}){const{templates:p,translateString:y}=m,{RemoveButton:x}=p.ButtonTemplates,S=y(K.KeyLabel,[s]);if(!(Qe in h))return c.jsx("div",{className:t,style:e,children:n});const v=a?22+(d?-28:0):0,w=`${i}-key`;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`grid grid-cols-12 col-span-12 items-center gap-2 ${t}`,style:e,children:[c.jsx("div",{className:"grid gap-2 col-span-5",children:c.jsxs("div",{className:"flex flex-col gap-2",children:[a&&c.jsx("label",{htmlFor:w,className:"text-sm font-medium text-muted-foreground leading-none",children:S}),c.jsx("div",{className:"pl-0.5",children:c.jsx(nc,{required:u,defaultValue:s,disabled:r||f,id:w,name:w,onBlur:f?void 0:l,type:"text",className:"w-full border shadow-sm"})}),!!d&&c.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c.jsx("div",{className:"text-sm text-muted-foreground",children:" "})})]})}),c.jsx("div",{className:"grid gap-2 col-span-6 pr-0.5",children:n}),c.jsx("div",{className:"grid gap-2 col-span-1",style:{marginTop:`${v}px`},children:c.jsx(x,{id:qe(i,"remove"),iconType:"block",className:"rjsf-object-property-remove w-full",disabled:r||f,onClick:o,uiSchema:g,registry:m})})]}),c.jsx(ic,{dir:"horizontal",className:"mt-2"})]})}function V1(){return{ArrayFieldItemTemplate:v1,ArrayFieldTemplate:S1,BaseInputTemplate:w1,ButtonTemplates:{AddButton:b1,CopyButton:I1,MoveDownButton:D1,MoveUpButton:$1,RemoveButton:rc,SubmitButton:U1,ClearButton:k1},DescriptionFieldTemplate:j1,ErrorListTemplate:N1,FieldErrorTemplate:T1,FieldHelpTemplate:F1,FieldTemplate:P1,GridTemplate:E1,MultiSchemaFieldTemplate:M1,ObjectFieldTemplate:R1,OptionalDataControlsTemplate:B1,TitleFieldTemplate:L1,WrapIfAdditionalTemplate:W1}}function z1(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var q1=["color"],K1=P.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,i=z1(t,q1);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:e}),P.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});function sc({className:t,...e}){return c.jsx(Dc,{"data-slot":"checkbox",className:G("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:c.jsx($c,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:c.jsx(K1,{className:"size-3.5"})})})}function os({className:t,...e}){return c.jsx(kc,{"data-slot":"label",className:G("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...e})}function G1(t){const{id:e,htmlName:n,value:r,disabled:i,readonly:s,label:a,hideLabel:o,schema:l,autofocus:d,options:f,onChange:u,onBlur:h,onFocus:g,registry:m,uiSchema:p,className:y}=t,x=hn(l),S=L("DescriptionFieldTemplate",m,f),j=O=>u(O),b=()=>h(e,r),v=()=>g(e,r),w=f.description||l.description;return c.jsxs("div",{className:`relative ${i||s?"cursor-not-allowed opacity-50":""}`,"aria-describedby":we(e),children:[!o&&w&&c.jsx(S,{id:Et(e),description:w,schema:l,uiSchema:p,registry:m}),c.jsxs("div",{className:"flex items-center gap-2 my-2",children:[c.jsx(sc,{id:e,name:n||e,checked:typeof r>"u"?!1:!!r,required:x,disabled:i||s,autoFocus:d,onCheckedChange:j,onBlur:b,onFocus:v,className:y}),c.jsx(os,{className:"leading-tight",htmlFor:e,children:Pl(a,o||!a)})]})]})}function H1({id:t,htmlName:e,disabled:n,options:r,value:i,autofocus:s,readonly:a,required:o,onChange:l,onBlur:d,onFocus:f,className:u}){const{enumOptions:h,enumDisabled:g,inline:m,emptyValue:p}=r,y=Array.isArray(i)?i:[i],x=({target:j})=>d(t,ge(j&&j.value,h,p)),S=({target:j})=>f(t,ge(j&&j.value,h,p));return c.jsx("div",{className:G({"flex flex-col gap-2":!m,"flex flex-row gap-4 flex-wrap":m}),children:Array.isArray(h)&&h.map((j,b)=>{const v=kn(j.value,y),w=Array.isArray(g)&&g.indexOf(j.value)!==-1,O=wt(t,b);return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(sc,{id:O,name:e||t,required:o,disabled:n||w||a,onCheckedChange:A=>{l(A?Al(b,y,h):jl(b,y,h))},className:u,checked:v,autoFocus:s&&b===0,onBlur:x,onFocus:S,"aria-describedby":we(t)}),c.jsx(os,{className:"leading-tight",htmlFor:wt(t,b),children:j.label})]},O)})})}function Y1({className:t,...e}){return c.jsx(vu,{"data-slot":"radio-group",className:G("grid gap-3",t),...e})}function X1({className:t,...e}){return c.jsx(Su,{"data-slot":"radio-group-item",className:G("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:c.jsx(wu,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:c.jsx(u1,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function J1({id:t,options:e,value:n,required:r,disabled:i,readonly:s,onChange:a,onBlur:o,onFocus:l,className:d}){const{enumOptions:f,enumDisabled:u,emptyValue:h}=e,g=x=>a(ge(x,f,h)),m=({target:x})=>o(t,ge(x&&x.value,f,h)),p=({target:x})=>l(t,ge(x&&x.value,f,h)),y=!!(e&&e.inline);return c.jsx("div",{className:"mb-0",children:c.jsx(Y1,{defaultValue:n?.toString(),required:r,disabled:i||s,onValueChange:x=>{g(x)},onBlur:m,onFocus:p,"aria-describedby":we(t),orientation:y?"horizontal":"vertical",className:G("flex flex-wrap",{"flex-col":!y},d),children:Array.isArray(f)&&f.map((x,S)=>{const j=Array.isArray(u)&&u.indexOf(x.value)!==-1,b=kn(x.value,n);return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(X1,{checked:b,value:S.toString(),id:wt(t,S),disabled:j}),c.jsx(os,{className:"leading-tight",htmlFor:wt(t,S),children:x.label})]},wt(t,S))})})})}var oc=["PageUp","PageDown"],ac=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],lc={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},tn="Slider",[ai,Z1,Q1]=Bc(tn),[cc]=Rc(tn,[Q1]),[eS,yr]=cc(tn),uc=P.forwardRef((t,e)=>{const{name:n,min:r=0,max:i=100,step:s=1,orientation:a="horizontal",disabled:o=!1,minStepsBetweenThumbs:l=0,defaultValue:d=[r],value:f,onValueChange:u=()=>{},onValueCommit:h=()=>{},inverted:g=!1,form:m,...p}=t,y=P.useRef(new Set),x=P.useRef(0),j=a==="horizontal"?tS:nS,[b=[],v]=Mc({prop:f,defaultProp:d,onChange:N=>{[...y.current][x.current]?.focus(),u(N)}}),w=P.useRef(b);function O(N){const C=aS(b,N);T(N,C)}function A(N){T(N,x.current)}function _(){const N=w.current[x.current];b[x.current]!==N&&h(b)}function T(N,C,{commit:F}={commit:!1}){const $=dS(s),E=fS(Math.round((N-r)/s)*s+r,$),D=ta(E,[r,i]);v((M=[])=>{const k=sS(M,D,C);if(uS(k,l*s)){x.current=k.indexOf(D);const B=String(k)!==String(M);return B&&F&&h(k),B?k:M}else return M})}return c.jsx(eS,{scope:t.__scopeSlider,name:n,disabled:o,min:r,max:i,valueIndexToChangeRef:x,thumbs:y.current,values:b,orientation:a,form:m,children:c.jsx(ai.Provider,{scope:t.__scopeSlider,children:c.jsx(ai.Slot,{scope:t.__scopeSlider,children:c.jsx(j,{"aria-disabled":o,"data-disabled":o?"":void 0,...p,ref:e,onPointerDown:Rt(p.onPointerDown,()=>{o||(w.current=b)}),min:r,max:i,inverted:g,onSlideStart:o?void 0:O,onSlideMove:o?void 0:A,onSlideEnd:o?void 0:_,onHomeKeyDown:()=>!o&&T(r,0,{commit:!0}),onEndKeyDown:()=>!o&&T(i,b.length-1,{commit:!0}),onStepKeyDown:({event:N,direction:C})=>{if(!o){const E=oc.includes(N.key)||N.shiftKey&&ac.includes(N.key)?10:1,D=x.current,M=b[D],k=s*E*C;T(M+k,D,{commit:!0})}}})})})})});uc.displayName=tn;var[dc,fc]=cc(tn,{startEdge:"left",endEdge:"right",size:"width",direction:1}),tS=P.forwardRef((t,e)=>{const{min:n,max:r,dir:i,inverted:s,onSlideStart:a,onSlideMove:o,onSlideEnd:l,onStepKeyDown:d,...f}=t,[u,h]=P.useState(null),g=Yt(e,j=>h(j)),m=P.useRef(void 0),p=Uc(i),y=p==="ltr",x=y&&!s||!y&&s;function S(j){const b=m.current||u.getBoundingClientRect(),v=[0,b.width],O=as(v,x?[n,r]:[r,n]);return m.current=b,O(j-b.left)}return c.jsx(dc,{scope:t.__scopeSlider,startEdge:x?"left":"right",endEdge:x?"right":"left",direction:x?1:-1,size:"width",children:c.jsx(mc,{dir:p,"data-orientation":"horizontal",...f,ref:g,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:j=>{const b=S(j.clientX);a?.(b)},onSlideMove:j=>{const b=S(j.clientX);o?.(b)},onSlideEnd:()=>{m.current=void 0,l?.()},onStepKeyDown:j=>{const v=lc[x?"from-left":"from-right"].includes(j.key);d?.({event:j,direction:v?-1:1})}})})}),nS=P.forwardRef((t,e)=>{const{min:n,max:r,inverted:i,onSlideStart:s,onSlideMove:a,onSlideEnd:o,onStepKeyDown:l,...d}=t,f=P.useRef(null),u=Yt(e,f),h=P.useRef(void 0),g=!i;function m(p){const y=h.current||f.current.getBoundingClientRect(),x=[0,y.height],j=as(x,g?[r,n]:[n,r]);return h.current=y,j(p-y.top)}return c.jsx(dc,{scope:t.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:c.jsx(mc,{"data-orientation":"vertical",...d,ref:u,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:p=>{const y=m(p.clientY);s?.(y)},onSlideMove:p=>{const y=m(p.clientY);a?.(y)},onSlideEnd:()=>{h.current=void 0,o?.()},onStepKeyDown:p=>{const x=lc[g?"from-bottom":"from-top"].includes(p.key);l?.({event:p,direction:x?-1:1})}})})}),mc=P.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:s,onHomeKeyDown:a,onEndKeyDown:o,onStepKeyDown:l,...d}=t,f=yr(tn,n);return c.jsx(Nn.span,{...d,ref:e,onKeyDown:Rt(t.onKeyDown,u=>{u.key==="Home"?(a(u),u.preventDefault()):u.key==="End"?(o(u),u.preventDefault()):oc.concat(ac).includes(u.key)&&(l(u),u.preventDefault())}),onPointerDown:Rt(t.onPointerDown,u=>{const h=u.target;h.setPointerCapture(u.pointerId),u.preventDefault(),f.thumbs.has(h)?h.focus():r(u)}),onPointerMove:Rt(t.onPointerMove,u=>{u.target.hasPointerCapture(u.pointerId)&&i(u)}),onPointerUp:Rt(t.onPointerUp,u=>{const h=u.target;h.hasPointerCapture(u.pointerId)&&(h.releasePointerCapture(u.pointerId),s(u))})})}),hc="SliderTrack",pc=P.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=yr(hc,n);return c.jsx(Nn.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:e})});pc.displayName=hc;var li="SliderRange",gc=P.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=yr(li,n),s=fc(li,n),a=P.useRef(null),o=Yt(e,a),l=i.values.length,d=i.values.map(h=>bc(h,i.min,i.max)),f=l>1?Math.min(...d):0,u=100-Math.max(...d);return c.jsx(Nn.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:o,style:{...t.style,[s.startEdge]:f+"%",[s.endEdge]:u+"%"}})});gc.displayName=li;var ci="SliderThumb",yc=P.forwardRef((t,e)=>{const n=Z1(t.__scopeSlider),[r,i]=P.useState(null),s=Yt(e,o=>i(o)),a=P.useMemo(()=>r?n().findIndex(o=>o.ref.current===r):-1,[n,r]);return c.jsx(rS,{...t,ref:s,index:a})}),rS=P.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:i,...s}=t,a=yr(ci,n),o=fc(ci,n),[l,d]=P.useState(null),f=Yt(e,S=>d(S)),u=l?a.form||!!l.closest("form"):!0,h=Lc(l),g=a.values[r],m=g===void 0?0:bc(g,a.min,a.max),p=oS(r,a.values.length),y=h?.[o.size],x=y?lS(y,m,o.direction):0;return P.useEffect(()=>{if(l)return a.thumbs.add(l),()=>{a.thumbs.delete(l)}},[l,a.thumbs]),c.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[o.startEdge]:`calc(${m}% + ${x}px)`},children:[c.jsx(ai.ItemSlot,{scope:t.__scopeSlider,children:c.jsx(Nn.span,{role:"slider","aria-label":t["aria-label"]||p,"aria-valuemin":a.min,"aria-valuenow":g,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...s,ref:f,style:g===void 0?{display:"none"}:t.style,onFocus:Rt(t.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),u&&c.jsx(xc,{name:i??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:g},r)]})});yc.displayName=ci;var iS="RadioBubbleInput",xc=P.forwardRef(({__scopeSlider:t,value:e,...n},r)=>{const i=P.useRef(null),s=Yt(i,r),a=Wc(e);return P.useEffect(()=>{const o=i.current;if(!o)return;const l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==e&&f){const u=new Event("input",{bubbles:!0});f.call(o,e),o.dispatchEvent(u)}},[a,e]),c.jsx(Nn.input,{style:{display:"none"},...n,ref:s,defaultValue:e})});xc.displayName=iS;function sS(t=[],e,n){const r=[...t];return r[n]=e,r.sort((i,s)=>i-s)}function bc(t,e,n){const s=100/(n-e)*(t-e);return ta(s,[0,100])}function oS(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function aS(t,e){if(t.length===1)return 0;const n=t.map(i=>Math.abs(i-e)),r=Math.min(...n);return n.indexOf(r)}function lS(t,e,n){const r=t/2,s=as([0,50],[0,r]);return(r-s(e)*n)*n}function cS(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function uS(t,e){if(e>0){const n=cS(t);return Math.min(...n)>=e}return!0}function as(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function dS(t){return(String(t).split(".")[1]||"").length}function fS(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var mS=uc,hS=pc,pS=gc,gS=yc;function yS({className:t,defaultValue:e,value:n,min:r=0,max:i=100,...s}){const a=P.useMemo(()=>Array.isArray(n)?n:Array.isArray(e)?e:[r,i],[n,e,r,i]);return c.jsxs(mS,{"data-slot":"slider",defaultValue:e,value:n,min:r,max:i,className:G("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",t),...s,children:[c.jsx(hS,{"data-slot":"slider-track",className:G("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:c.jsx(pS,{"data-slot":"slider-range",className:G("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:a.length},(o,l)=>c.jsx(gS,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},l))]})}const xS=["name","min","max","step","orientation","disabled","defaultValue","value","onValueChange","className","dir","inverted","minStepsBetweenThumbs"];function bS({value:t,readonly:e,disabled:n,options:r,schema:i,onChange:s,label:a,id:o}){const l=u=>s(u[0]),d={...Cl(i)},f={id:o,...qi(r.props||{},xS)};return c.jsxs(c.Fragment,{children:[c.jsx(yS,{disabled:n||e,min:d.min,max:d.max,step:d.step,value:[t],onValueChange:l,...f,"aria-describedby":we(o)}),t]})}const vS=fi("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function SS({className:t,variant:e,asChild:n=!1,...r}){const i=n?zo:"span";return c.jsx(i,{"data-slot":"badge",className:G(vS({variant:e}),t),...r})}const vc=P.forwardRef(({className:t,...e},n)=>c.jsx(_t,{ref:n,"data-slot":"command",className:G("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),...e})),wS=P.forwardRef(({className:t,...e},n)=>c.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[c.jsx(h1,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),c.jsx(_t.Input,{ref:n,className:G("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...e})]}));wS.displayName=_t.Input.displayName;function Sc({className:t,...e}){return c.jsx(_t.List,{"data-slot":"command-list",className:G("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),...e})}function wc({className:t,...e}){return c.jsx(_t.Group,{"data-slot":"command-group",className:G("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),...e})}function jc({className:t,...e}){return c.jsx(_t.Item,{"data-slot":"command-item",className:G("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...e})}function jS({multiple:t,items:e=[],selected:n,onValueChange:r,autoFocus:i=!1,disabled:s=!1,ariaDescribedby:a,ariaPlaceholder:o,onFocus:l,onBlur:d,className:f,id:u}){const h=P.useRef(null),[g,m]=P.useState(!1),[p,y]=P.useState(""),x=P.useMemo(()=>e.filter(O=>n.some(A=>dt(O.value,A))),[e,n]),S=P.useMemo(()=>e.filter(O=>!x.some(A=>dt(A.value,O.value))),[e,x]),j=P.useCallback(O=>{if(s)return;const A=x.filter(_=>!dt(_.value,O.value));r?.(A.map(_=>_.index))},[x,r,s]),b=P.useCallback(O=>{if(!(s||!h.current||h.current.value!==""))if(O.key==="Delete"||O.key==="Backspace"){const A=x.slice(0,-1);r?.(A.map(_=>_.index))}else O.key==="Escape"&&h.current.blur()},[x,r,s]),v=P.useCallback(O=>{if(s)return;y("");const A=t?[...x,O]:[O];r?.(A.map(_=>_.index))},[t,x,r,s]),w=P.useCallback(O=>{s||m(!0),l?.(O)},[s,l]);return c.jsxs(vc,{onKeyDown:b,className:G("overflow-visible bg-transparent",f),autoFocus:i,"aria-disabled":s,onBlur:d,onFocus:w,"aria-describedby":a,"aria-placeholder":o,children:[c.jsx("div",{className:G("group border border-input px-3 py-2 text-sm ring-offset-background rounded-md focus-within:ring-1 focus-within:ring-ring focus-within:ring-offset-1",s&&"opacity-50 cursor-not-allowed"),children:c.jsxs("div",{className:"flex gap-1 flex-wrap",children:[x.map(O=>c.jsxs(SS,{variant:"secondary",children:[O.label,c.jsx("button",{type:"button",className:"rtl:mr-1 ltr:ml-1 ring-offset-background rounded-full outline-none focus:ring-1 focus:ring-ring focus:ring-offset-1",onKeyDown:A=>A.key==="Enter"&&!s&&j(O),onMouseDown:A=>{A.preventDefault(),A.stopPropagation()},onClick:()=>j(O),disabled:s,children:c.jsx(tc,{className:G("h-3 w-3 text-muted-foreground hover:text-foreground",s&&"pointer-events-none")})})]},O.value)),c.jsx(_t.Input,{ref:h,value:p,onValueChange:y,onBlur:()=>m(!1),onFocus:()=>!s&&m(!0),placeholder:"Select ...",className:"rtl:mr-2 ltr:ml-2 bg-transparent outline-none placeholder:text-muted-foreground flex-1",disabled:s,"aria-controls":`command-item-input-${u}`,"aria-labelledby":`command-item-input-${u}`,id:`command-item-input-${u}`})]})}),g&&!s&&S.length>0&&c.jsx("div",{className:"relative mt-2",children:c.jsx("div",{className:"absolute w-full z-10 top-0 rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in",children:c.jsx(wc,{className:"h-full overflow-auto",children:c.jsx(Sc,{children:S.map(O=>c.jsx(jc,{disabled:O.disabled,onMouseDown:A=>{A.preventDefault(),A.stopPropagation()},"aria-controls":`${O.value}-command-item`,"aria-labelledby":`${O.value}-command-item`,id:`${O.value}-command-item`,onSelect:()=>v(O),className:"cursor-pointer",children:O.label},`${O.value}-command-item`))})})})})]})}function OS({items:t,selected:e,onValueChange:n,autoFocus:r=!1,disabled:i=!1,required:s=!1,placeholder:a="Select...",ariaDescribedby:o,ariaPlaceholder:l,onFocus:d,onBlur:f,className:u}){const[h,g]=P.useState(!1),m=t?.find(S=>S.value===e),p=P.useRef(null),y=P.useRef(null);P.useEffect(()=>{h&&p.current&&requestAnimationFrame(()=>{var S;(S=p.current)===null||S===void 0||S.scrollIntoView({block:"nearest"})})},[h]);const x=S=>{y.current&&!y.current.contains(S.relatedTarget)&&g(!1),f?.(S)};return c.jsxs(vc,{ref:y,className:G("overflow-visible bg-transparent",u),autoFocus:r,"aria-disabled":i,onBlur:x,onFocus:d,"aria-describedby":o,"aria-placeholder":l,children:[c.jsxs("div",{onClick:()=>!i&&g(!h),className:G("flex h-9 w-full items-center justify-between gap-2 whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",!m&&s&&"border-red-500",i&&"opacity-50 cursor-not-allowed",u),children:[c.jsx("span",{className:G("flex-1 line-clamp-1",!m&&"text-muted-foreground"),children:m?.label||a}),c.jsx(Ql,{className:"h-4 w-4 opacity-50"})]}),c.jsx("div",{className:"relative",children:h&&t&&t.length>0?c.jsx("div",{style:{top:"0.5rem"},className:"absolute w-full z-10 rounded-md border bg-popover text-popover-foreground shadow-md outline-none",children:c.jsx(wc,{className:"h-full overflow-auto",children:c.jsx(Sc,{children:t.map(S=>c.jsxs(jc,{ref:S.value===e?p:void 0,onMouseDown:j=>{j.preventDefault(),j.stopPropagation()},onSelect:()=>{S.disabled||(n?.(S.value),g(!1))},className:G("cursor-pointer relative flex items-center justify-between rounded-sm py-1.5 gap-2 rtl:flex-row-reverse",S.value===e&&"font-semibold",S.disabled&&"opacity-50 cursor-not-allowed"),children:[c.jsx("span",{children:S.label}),c.jsx("span",{className:"flex h-3.5 w-3.5 items-center justify-center",children:S.value===e&&c.jsx(n1,{className:"h-4 w-4"})})]},S.value))})})}):null})]})}function AS({id:t,options:e,required:n,disabled:r,readonly:i,value:s,multiple:a,autofocus:o,onChange:l,onBlur:d,onFocus:f,defaultValue:u,placeholder:h,rawErrors:g=[],className:m}){const{enumOptions:p,enumDisabled:y,emptyValue:x}=e,S=()=>{f(t,ge(s,p,x))},j=()=>{d(t,ge(s,p,x))},b=p?.map(({value:w,label:O},A)=>({value:a?w:A.toString(),label:O,index:A,disabled:Array.isArray(y)&&y.includes(w)})),v=G({"border-destructive":g.length>0},m);return c.jsx("div",{className:"p-0.5",children:a?c.jsx(jS,{id:t,autoFocus:o,disabled:r||i,multiple:!0,className:v,items:b,selected:s,onValueChange:w=>{l(ge(w,p,x))},onFocus:S,onBlur:j}):c.jsx(OS,{items:b,selected:Ol(s??u,p,!1),onValueChange:w=>{l(ge(w,p,x))},autoFocus:o,disabled:r||i,required:n,placeholder:h,className:v,onFocus:S,onBlur:j,ariaDescribedby:we(t)})})}function _S({className:t,...e}){return c.jsx("textarea",{"data-slot":"textarea",className:G("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...e})}function CS({id:t,htmlName:e,placeholder:n,value:r,required:i,disabled:s,autofocus:a,readonly:o,onBlur:l,onFocus:d,onChange:f,options:u,className:h}){const g=({target:{value:y}})=>f(y===""?u.emptyValue:y),m=({target:y})=>l(t,y&&y.value),p=({target:y})=>d(t,y&&y.value);return c.jsx("div",{className:"flex p-0.5",children:c.jsx(_S,{id:t,name:e||t,placeholder:n,disabled:s,readOnly:o,value:r??"",required:i,autoFocus:a,rows:u.rows||5,onChange:g,onBlur:m,onFocus:p,"aria-describedby":we(t),className:h})})}function NS(){return{CheckboxWidget:G1,CheckboxesWidget:H1,RadioWidget:J1,RangeWidget:bS,SelectWidget:AS,TextareaWidget:CS}}function TS(){return{templates:V1(),widgets:NS()}}function FS(){return kv(TS())}const PS=FS();function ES(t){const e=t.properties;if(!e)return!1;const n=e.__type,r=e.__binding;return!!(n?.const||r?.const)}function IS(t){const e=t.properties;if(!e)return{};const n=e.__type,r=e.__binding;return{bindingType:n?.const,bindingSchema:r?.const}}function DS(t){return t.replace(/^root_/,"").split("_")[0]||""}function Wo(t){return typeof t!="string"?!1:(t.startsWith("@")?t.slice(1):t).includes("/")}function $S(t){const e=ve.c(8),{bindingSchema:n,bindingType:r,currentValue:i,onValueChange:s,placeholder:a,onAddNew:o,className:l}=t,d=Wo(n),f=Wo(r),u=d||f,h=d?n:f?r:void 0,{bindingSchema:g}=Td(h);let m;e:{if(u){m=g;break e}if(Array.isArray(n)){m=n;break e}if(typeof n=="string"){m=n;break e}m=void 0}const p=m;let y;return e[0]!==r||e[1]!==l||e[2]!==i||e[3]!==o||e[4]!==s||e[5]!==a||e[6]!==p?(y=c.jsx(kS,{value:i,onValueChange:s,placeholder:a,binding:p,bindingType:r,onAddNew:o,className:l}),e[0]=r,e[1]=l,e[2]=i,e[3]=o,e[4]=s,e[5]=a,e[6]=p,e[7]=y):y=e[7],y}function kS({value:t,onValueChange:e,placeholder:n="Select a connection...",binding:r,bindingType:i,onAddNew:s,className:a}){const[o,l]=P.useState(!1),{installByBinding:d,isInstalling:f}=Pd(),u=o||f,h=hi(),g=Xo({connections:h,binding:r}),m=(()=>{if(!i?.startsWith("@"))return null;const[S,j]=i.replace("@","").split("/");return S&&j?{scope:S,appName:j}:null})(),p=(()=>{let S=g;const j=Array.isArray(r)&&r.length>0;if(m&&!j&&(S=S.filter(b=>{const v=b.app_name,w=b.metadata?.scopeName;return v===m.appName&&w===m.scope})),t&&!S.some(b=>b.id===t)){const b=h?.find(v=>v.id===t);if(b)return[b,...S]}return S})(),y=i?.startsWith("@"),x=async()=>{if(y&&i){l(!0);try{const S=await d(i);S&&e(S.id)}catch(S){const j=S instanceof Error?S.message:String(S);Ut.error(`Failed to connect MCP: ${j}`)}finally{l(!1)}return}s?.()};return c.jsxs(Jo,{value:t,onValueChange:e,children:[c.jsx(Zo,{size:"sm",className:a??"w-[200px]",children:c.jsx(Qo,{placeholder:n})}),c.jsxs(ea,{children:[p.length===0?c.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No connections found"}):p.map(S=>c.jsx(kt,{value:S.id,children:c.jsxs("div",{className:"flex items-center gap-2",children:[S.icon?c.jsx("img",{src:S.icon,alt:S.title,className:"w-4 h-4 rounded"}):c.jsx("div",{className:"w-4 h-4 rounded bg-linear-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:S.title.slice(0,1).toUpperCase()}),c.jsx("span",{children:S.title})]})},S.id)),(s||y)&&c.jsx("div",{className:"border-t border-border",children:c.jsx(Vt,{onClick:S=>{S.preventDefault(),S.stopPropagation(),x()},disabled:u,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:u?c.jsxs(c.Fragment,{children:[c.jsx(yn,{size:16,className:"animate-spin"}),c.jsx("span",{children:"Connecting..."})]}):c.jsxs(c.Fragment,{children:[c.jsx(ra,{size:16}),c.jsx("span",{children:"Custom Connection"})]})})})]})]})}function MS(t){const e=ve.c(68),{schema:n,formData:r,title:i,description:s,registry:a}=t,o=a.formContext,l=t.properties[0]?.content?.key;let d;e[0]!==l||e[1]!==i?(d=i||(l?DS(l):""),e[0]=l,e[1]=i,e[2]=d):d=e[2];const f=d;if(ES(n)){const g=n;let m;e[3]!==g?(m=IS(g),e[3]=g,e[4]=m):m=e[4];const{bindingType:p,bindingSchema:y}=m,x=r?.value||"";let S;e[5]!==p||e[6]!==f||e[7]!==o||e[8]!==r?(S=M=>{const k={...r,value:M,...p&&{__type:p}};o?.onFieldChange(f,k)},e[5]=p,e[6]=f,e[7]=o,e[8]=r,e[9]=S):S=e[9];const j=S;let b;e[10]!==p||e[11]!==f||e[12]!==o?(b=M=>{o?.onFieldChange(f,{__type:p,value:{id:M.id,connectionId:M.connectionId}})},e[10]=p,e[11]=f,e[12]=o,e[13]=b):b=e[13];const v=b,w=BS;let O;e[14]!==f||e[15]!==i?(O=w(i||f),e[14]=f,e[15]=i,e[16]=O):O=e[16];const A=O;if(p==="@deco/agent"){let M;e[17]!==A?(M=c.jsx("label",{className:"text-sm font-medium truncate block",children:A}),e[17]=A,e[18]=M):M=e[18];let k;e[19]!==s?(k=s&&c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s}),e[19]=s,e[20]=k):k=e[20];let B;e[21]!==M||e[22]!==k?(B=c.jsxs("div",{className:"flex-1 min-w-0",children:[M,k]}),e[21]=M,e[22]=k,e[23]=B):B=e[23];const V=x||void 0;let R;e[24]!==j||e[25]!==V?(R=c.jsx(_u,{selectedGatewayId:V,onGatewayChange:j,variant:"bordered",placeholder:"Select Agent",className:"w-[200px] shrink-0"}),e[24]=j,e[25]=V,e[26]=R):R=e[26];let W;return e[27]!==R||e[28]!==B?(W=c.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[B,R]}),e[27]=R,e[28]=B,e[29]=W):W=e[29],W}if(p==="@deco/language-model"){let M;e[30]!==A?(M=c.jsx("label",{className:"text-sm font-medium truncate block",children:A}),e[30]=A,e[31]=M):M=e[31];let k;e[32]!==s?(k=s&&c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s}),e[32]=s,e[33]=k):k=e[33];let B;e[34]!==M||e[35]!==k?(B=c.jsxs("div",{className:"flex-1 min-w-0",children:[M,k]}),e[34]=M,e[35]=k,e[36]=B):B=e[36];const V=x;let R;e[37]!==v||e[38]!==V?(R=c.jsx(Cu,{selectedModel:V,onModelChange:v,variant:"bordered",placeholder:"Select Language Model",className:"w-[200px] shrink-0"}),e[37]=v,e[38]=V,e[39]=R):R=e[39];let W;return e[40]!==R||e[41]!==B?(W=c.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[B,R]}),e[40]=R,e[41]=B,e[42]=W):W=e[42],W}let _;e[43]!==A?(_=c.jsx("label",{className:"text-sm font-medium truncate block",children:A}),e[43]=A,e[44]=_):_=e[44];let T;e[45]!==s?(T=s&&c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s}),e[45]=s,e[46]=T):T=e[46];let N;e[47]!==_||e[48]!==T?(N=c.jsxs("div",{className:"flex-1 min-w-0",children:[_,T]}),e[47]=_,e[48]=T,e[49]=N):N=e[49];let C;e[50]!==A?(C=A.toLowerCase(),e[50]=A,e[51]=C):C=e[51];const F=`Select ${C}...`;let $;e[52]!==o?($=()=>o?.onAddNew(),e[52]=o,e[53]=$):$=e[53];let E;e[54]!==y||e[55]!==p||e[56]!==x||e[57]!==j||e[58]!==F||e[59]!==$?(E=c.jsx($S,{bindingSchema:y,bindingType:p,currentValue:x,onValueChange:j,placeholder:F,onAddNew:$,className:"w-[200px] shrink-0"}),e[54]=y,e[55]=p,e[56]=x,e[57]=j,e[58]=F,e[59]=$,e[60]=E):E=e[60];let D;return e[61]!==E||e[62]!==N?(D=c.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[N,E]}),e[61]=E,e[62]=N,e[63]=D):D=e[63],D}let u;e[64]!==t.properties?(u=t.properties.map(RS),e[64]=t.properties,e[65]=u):u=e[65];let h;return e[66]!==u?(h=c.jsx("div",{className:"flex flex-col gap-4",children:u}),e[66]=u,e[67]=h):h=e[67],h}function RS(t){return t.content}function BS(t){return t.toLowerCase().replace(/_/g," ").replace(/\b\w/g,US)}function US(t){return t.toUpperCase()}function LS(t){const e=ve.c(13),{label:n,children:r,description:i,id:s,schema:a}=t;if(s.includes("__type")||s.includes("__binding"))return null;if(a.type==="object")return r;let o;e[0]!==s||e[1]!==n?(o=n&&c.jsx("label",{className:"text-sm font-medium truncate block",htmlFor:s,children:n}),e[0]=s,e[1]=n,e[2]=o):o=e[2];let l;e[3]!==i?(l=i&&c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i}),e[3]=i,e[4]=l):l=e[4];let d;e[5]!==o||e[6]!==l?(d=c.jsxs("div",{className:"flex-1 min-w-0",children:[o,l]}),e[5]=o,e[6]=l,e[7]=d):d=e[7];let f;e[8]!==r?(f=c.jsx("div",{className:"w-[200px] shrink-0",children:r}),e[8]=r,e[9]=f):f=e[9];let u;return e[10]!==d||e[11]!==f?(u=c.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[d,f]}),e[10]=d,e[11]=f,e[12]=u):u=e[12],u}const WS={ObjectFieldTemplate:MS,FieldTemplate:LS};function VS(t){const e=ve.c(18),{formState:n,onFormStateChange:r,stateSchema:i}=t,{org:s}=pi(),a=Vo();let o;e[0]!==r?(o=x=>{x.formData&&r(x.formData)},e[0]=r,e[1]=o):o=e[1];const l=o;let d;e[2]!==n||e[3]!==r?(d=(x,S)=>{const j={...n,[x]:S};r(j)},e[2]=n,e[3]=r,e[4]=d):d=e[4];const f=d;let u;e[5]!==a||e[6]!==s?(u=()=>{a({to:"/$org/mcps",params:{org:s.slug},search:{action:"create"}})},e[5]=a,e[6]=s,e[7]=u):u=e[7];const h=u;let g;e[8]!==n||e[9]!==h||e[10]!==f?(g={onFieldChange:f,formData:n,onAddNew:h},e[8]=n,e[9]=h,e[10]=f,e[11]=g):g=e[11];const m=g;let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(c.Fragment,{}),e[12]=p):p=e[12];let y;return e[13]!==m||e[14]!==n||e[15]!==l||e[16]!==i?(y=c.jsx("div",{className:"flex flex-col h-full overflow-auto p-5",children:c.jsx(PS,{schema:i,validator:Yv,formData:n,onChange:l,formContext:m,liveValidate:!1,showErrorList:!1,templates:WS,children:p})}),e[13]=m,e[14]=n,e[15]=l,e[16]=i,e[17]=y):y=e[17],y}const zS=qo({key:Ae().min(1,"Key is required"),value:Ae()}),qS=qo({title:Ae().min(1,"Name is required"),description:Ae().nullable().optional(),ui_type:zc(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:Ae().optional(),connection_token:Ae().nullable().optional(),npx_package:Ae().optional(),stdio_command:Ae().optional(),stdio_args:Ae().optional(),stdio_cwd:Ae().optional(),env_vars:cs(zS).optional(),configuration_scopes:cs(Ae()).nullable().optional(),configuration_state:Vc(Ae(),qc()).nullable().optional()}).refine(t=>t.ui_type==="NPX"?!!t.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(t=>t.ui_type==="STDIO"?!!t.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(t=>t.ui_type==="HTTP"||t.ui_type==="SSE"||t.ui_type==="Websocket"?!!t.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function KS(t){return t.command==="npx"}function GS(t){return t.args?.find(e=>!e.startsWith("-"))??""}function HS(t){return{command:t.command,args:t.args?.join(" ")??"",cwd:t.cwd??""}}function YS(t,e){const n={command:"npx",args:["-y",t]},r=Ko(e);return Object.keys(r).length>0&&(n.envVars=r),n}function XS(t,e,n,r){const i={command:t};e.trim()&&(i.args=e.trim().split(/\s+/)),n?.trim()&&(i.cwd=n.trim());const s=Ko(r);return Object.keys(s).length>0&&(i.envVars=s),i}function JS(t,e){const n={title:t.title,description:t.description??"",configuration_state:t.configuration_state??{},configuration_scopes:e||t.configuration_scopes||[]};if(t.connection_type==="STDIO"&&nu(t.connection_headers)){const r=t.connection_headers,i=ru(r.envVars);if(KS(r)){const a=GS(r);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i}}const s=HS(r);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:s.command,stdio_args:s.args,stdio_cwd:s.cwd,env_vars:i}}return{...n,ui_type:t.connection_type,connection_url:t.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function ZS(t){let e,n=null,r=null,i=null;return t.ui_type==="NPX"?(e="STDIO",n="",i=YS(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(e="STDIO",n="",i=XS(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(e=t.ui_type,n=t.connection_url||"",r=t.connection_token||null),{title:t.title,description:t.description||null,connection_type:e,connection_url:n,...r&&{connection_token:r},...i&&{connection_headers:i},configuration_state:t.configuration_state??null,configuration_scopes:t.configuration_scopes??null}}function QS(t){const e=ve.c(13);let n;e[0]!==t?(n=mi(t),e[0]=t,e[1]=n):n=e[1];const r=n;let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i={},e[2]=i):i=e[2];let s;e[3]!==t||e[4]!==r?(s={toolCaller:r,toolName:"MCP_CONFIGURATION",toolInputParams:i,scope:t},e[3]=t,e[4]=r,e[5]=s):s=e[5];const{data:a}=lu(s);let o;e[6]!==a.stateSchema?(o=a.stateSchema??{type:"object",properties:{}},e[6]=a.stateSchema,e[7]=o):o=e[7];const l=o;let d;e[8]!==a.scopes?(d=a.scopes??[],e[8]=a.scopes,e[9]=d):d=e[9];const f=d;let u;return e[10]!==f||e[11]!==l?(u={stateSchema:l,scopes:f},e[10]=f,e[11]=l,e[12]=u):u=e[12],u}function ew(t){const e=ve.c(4),{onAuthenticate:n,buttonText:r}=t,i=r===void 0?"Authenticate":r;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"Authentication Required"}),c.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-center",children:"This connection requires OAuth authentication to access resources."})]}),e[0]=s):s=e[0];let a;return e[1]!==i||e[2]!==n?(a=c.jsx("div",{className:"w-3/5 min-w-0 flex items-center justify-center",children:c.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[s,c.jsx(Vt,{onClick:n,size:"lg",children:i})]})}),e[1]=i,e[2]=n,e[3]=a):a=e[3],a}function tw(t){const e=ve.c(7),{hasReadme:n,onViewReadme:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(du,{size:48,className:"text-muted-foreground"}),e[0]=i):i=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"Manual Authentication Required"}),c.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-center",children:"This server requires an API key or token that must be configured manually. Check the server's documentation for instructions on obtaining credentials."})]}),e[1]=s):s=e[1];let a;e[2]!==n||e[3]!==r?(a=n&&r&&c.jsxs(Vt,{onClick:r,variant:"outline",size:"lg",children:[c.jsx(uu,{size:18,className:"mr-2"}),"View README"]}),e[2]=n,e[3]=r,e[4]=a):a=e[4];let o;return e[5]!==a?(o=c.jsx("div",{className:"w-3/5 min-w-0 flex items-center justify-center",children:c.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[i,s,a]})}),e[5]=a,e[6]=o):o=e[6],o}function nw(){const t=ve.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx("img",{src:"/empty-state-error.svg",alt:"",width:160,height:160,"aria-hidden":"true"}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=c.jsx("div",{className:"w-3/5 min-w-0 flex items-center justify-center",children:c.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[e,c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"Server Error"}),c.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-center",children:"The MCP server is currently experiencing issues. Please try again later or check the server's status."})]})]})}),t[1]=n):n=t[1],n}function rw(t){const e=ve.c(3),n=QS(t.connection.id);let r;return e[0]!==n||e[1]!==t?(r=c.jsx(Oc,{...t,...n}),e[0]=n,e[1]=t,e[2]=r):r=e[2],r}function iw(t){const e=ve.c(2);let n;return e[0]!==t?(n=c.jsx(Oc,{...t}),e[0]=t,e[1]=n):n=e[1],n}function sw(t){const e=ve.c(13),{hasMcpBinding:n,stateSchema:r,formState:i,onFormStateChange:s,onAuthenticate:a,onViewReadme:o,isMCPAuthenticated:l,supportsOAuth:d,isServerError:f,hasReadme:u}=t,h=r&&r.properties&&typeof r.properties=="object"&&Object.keys(r.properties).length>0;if(!l){if(f){let y;return e[0]===Symbol.for("react.memo_cache_sentinel")?(y=c.jsx(nw,{}),e[0]=y):y=e[0],y}if(d){let y;return e[1]!==a?(y=c.jsx(ew,{onAuthenticate:a}),e[1]=a,e[2]=y):y=e[2],y}let p;return e[3]!==u||e[4]!==o?(p=c.jsx(tw,{hasReadme:u,onViewReadme:o}),e[3]=u,e[4]=o,e[5]=p):p=e[5],p}if(!n)return null;if(!h||!r){let p;return e[6]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx("div",{className:"w-3/5 min-w-0 overflow-auto flex items-center justify-center",children:c.jsx(eu,{image:c.jsx("img",{src:"/empty-state-success-muted.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),title:"This server is all set!",description:"No additional configuration is needed. Everything is ready to go."})}),e[6]=p):p=e[6],p}let g;e[7]!==i?(g=i??{},e[7]=i,e[8]=g):g=e[8];let m;return e[9]!==s||e[10]!==r||e[11]!==g?(m=c.jsx("div",{className:"w-3/5 min-w-0 overflow-auto",children:c.jsx(VS,{stateSchema:r,formState:g,onFormStateChange:s})}),e[9]=s,e[10]=r,e[11]=g,e[12]=m):m=e[12],m}function Oc(t){const{connection:e,onUpdate:n,isUpdating:r,scopes:i,hasMcpBinding:s,stateSchema:a,onViewReadme:o}=t,l=Go(),d=Kc(),u=Gc().location.href,g=!!e?.metadata?.repository?.url,m=Hc({resolver:Yc(qS),values:JS(e,i)}),p=m.watch("configuration_state"),y=m.formState.isDirty,x=b=>{m.setValue("configuration_state",b,{shouldDirty:!0})},S=async()=>{if(!await m.trigger())return;const v=m.getValues(),w=ZS(v);await n(w),m.reset(v)},j=async()=>{const{token:b,tokenInfo:v,error:w}=await Jc({connectionId:e.id});if(w||!b){Ut.error(`Authentication failed: ${w}`);return}if(v)try{const A=await fetch(`/api/connections/${e.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:v.accessToken,refreshToken:v.refreshToken,expiresIn:v.expiresIn,scope:v.scope,clientId:v.clientId,clientSecret:v.clientSecret,tokenEndpoint:v.tokenEndpoint})});if(!A.ok)console.error("Failed to save OAuth token:",await A.text()),await l.update.mutateAsync({id:e.id,data:{connection_token:b}});else try{await l.update.mutateAsync({id:e.id,data:{}})}catch(_){console.warn("Failed to refresh connection tools after OAuth:",_)}}catch(A){console.error("Error saving OAuth token:",A),await l.update.mutateAsync({id:e.id,data:{connection_token:b}})}else await l.update.mutateAsync({id:e.id,data:{connection_token:b}});const O=new URL(`/mcp/${e.id}`,window.location.origin);await d.invalidateQueries({queryKey:ui.isMCPAuthenticated(O.href,null)}),Ut.success("Authentication successful")};return c.jsxs(c.Fragment,{children:[c.jsxs(fu,{children:[c.jsx(cu,{title:`${e.title}: Settings`,url:u,icon:e.icon??"settings"}),y&&c.jsxs(Vt,{onClick:S,disabled:r,size:"sm",className:"h-7",children:[r&&c.jsx(yn,{size:16,className:"mr-2 animate-spin"}),"Save Changes"]})]}),c.jsxs("div",{className:"flex h-full",children:[c.jsx("div",{className:"w-2/5 shrink-0 border-r border-border overflow-auto",children:c.jsx(Od,{form:m,connection:e})}),c.jsx(iu,{children:c.jsx(P.Suspense,{fallback:c.jsx("div",{className:"w-3/5 min-w-0 flex items-center justify-center",children:c.jsx(yn,{size:32,className:"animate-spin text-muted-foreground"})}),children:c.jsx(sw,{hasMcpBinding:s,stateSchema:a,formState:p??void 0,onFormStateChange:x,onAuthenticate:j,onViewReadme:o,isMCPAuthenticated:t.isMCPAuthenticated,supportsOAuth:t.supportsOAuth,isServerError:t.isServerError,hasReadme:g})})})]})]})}function kw(t){const e=ve.c(5);let n;e[0]!==t.connection?(n={connections:[t.connection],binding:"MCP"},e[0]=t.connection,e[1]=n):n=e[1];const i=Xo(n).length>0;let s;return e[2]!==i||e[3]!==t?(s=c.jsx("div",{className:"flex-1",children:i?c.jsx(rw,{...t,hasMcpBinding:!0}):c.jsx(iw,{...t,hasMcpBinding:!1})}),e[2]=i,e[3]=t,e[4]=s):s=e[4],s}export{$v as F,tw as M,ew as O,kw as S,Dw as u,Yv as v};
|
|
25
|
+
`;case"21":return D("p",{key:E.key},$(F.children,E));default:return null}})(_,T,N,p,y,x,S);return m?m(C,_,T,N):C()})(v,b,w);return w.renderDepth=O-1,A}catch(A){if(A instanceof RangeError&&A.message.includes("Maximum call stack"))return j(v);throw A}}})(e.renderRule,o,r,n,f);return l(t)}const Rn=t=>{let{children:e,options:n}=t,r=(function(i,s){if(i==null)return{};var a={};for(var o in i)if({}.hasOwnProperty.call(i,o)){if(s.indexOf(o)!==-1)continue;a[o]=i[o]}return a})(t,v0);return wb(e??"",We({},n,{wrapperProps:We({},n?.wrapperProps,r)}))},Hl=Symbol("remove-this-key"),ko=Symbol("reset");function jb(t,e){return Array.isArray(t.required)&&t.required.indexOf(e)!==-1}function Ob(t,e){switch(e){case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{};default:return t(K.NewStringDefault)}}function Ab(t){const{fieldPathId:e,schema:n,registry:r,uiSchema:i,errorSchema:s,formData:a,onChange:o,onBlur:l,onFocus:d,disabled:f,readonly:u,required:h,hideError:g,propertyName:m,handleKeyRename:p,handleRemoveProperty:y,addedByAdditionalProperties:x}=t,[S,j]=P.useState(!1),{globalFormOptions:b,fields:v}=r,{SchemaField:w}=v,O=It(Fe(m,b,e.path)),A=P.useCallback((C,F,$,E)=>{C===void 0&&x&&(C=""),o(C,F,$,E)},[o,x]),_=P.useCallback(C=>{m!==C&&j(!0),p(m,C)},[m,p]),T=P.useCallback(C=>{const{target:{value:F}}=C;_(F)},[_]),N=P.useCallback(()=>{y(m)},[m,y]);return c.jsx(w,{name:m,required:h,schema:n,uiSchema:i,errorSchema:s,fieldPathId:O,formData:a,wasPropertyKeyModified:S,onKeyRename:_,onKeyRenameBlur:T,onRemoveProperty:N,onChange:A,onBlur:l,onFocus:d,registry:r,disabled:f,readonly:u,hideError:g})}function _b(t){const{schema:e,uiSchema:n={},formData:r,errorSchema:i,fieldPathId:s,name:a,required:o=!1,disabled:l,readonly:d,hideError:f,onBlur:u,onFocus:h,onChange:g,registry:m,title:p}=t,{fields:y,schemaUtils:x,translateString:S,globalUiOptions:j}=m,{OptionalDataControlsField:b}=y,v=x.retrieveSchema(e,r,!0),w=U(n,j),{properties:O={}}=v,A=t.childFieldPathId??s,_=w.title??v.title??p??a,T=w.description??v.description,N=Mn(m,v,o,n),C=Qt(r);let F=[];const $=P.useCallback((R,W)=>{const{duplicateKeySuffixSeparator:Q="-"}=U(n,j);let ne=0,ie=R;for(;X(W,ie);)ie=`${R}${Q}${++ne}`;return ie},[n,j]),E=P.useCallback(()=>{if(!(v.additionalProperties||v.patternProperties))return;const{translateString:R}=m,W={...r},Q=$("newKey",W);if(v.patternProperties)se(W,Q,null);else{let ne,ie,de;if(Z(v.additionalProperties)){ne=v.additionalProperties.type,ie=v.additionalProperties.const,de=v.additionalProperties.default;let z=v.additionalProperties;if(ce in z){const{schemaUtils:H}=m;z=H.retrieveSchema({[ce]:z[ce]},r),ne=z.type,ie=z.const,de=z.default}!ne&&(J in z||q in z)&&(ne="object")}const ee=ie??de??Ob(R,ne);se(W,Q,ee)}g(W,A.path)},[r,g,m,A,$,v]),D=P.useCallback((R,W)=>{if(R!==W){const Q=$(W,r),ne={...r},ie={[R]:Q},de=Object.keys(ne).map(z=>({[ie[z]||z]:ne[z]})),ee=Object.assign({},...de);g(ee,A.path)}},[r,g,A,$]),M=P.useCallback(R=>{g(Hl,[...A.path,R])},[g,A]);if(!N||C)try{const R=Object.keys(O);F=vx(R,w.order)}catch(R){return c.jsxs("div",{children:[c.jsx("p",{className:"rjsf-config-error",style:{color:"red"},children:c.jsx(Rn,{options:{disableParsingRawHTML:!0},children:S(K.InvalidObjectField,[a||"root",R.message])})}),c.jsx("pre",{children:JSON.stringify(v)})]})}const k=L("ObjectFieldTemplate",m,w),B=N?c.jsx(b,{...t,fieldPathId:A,schema:v}):void 0,V={title:w.label===!1?"":_,description:w.label===!1?void 0:T,properties:F.map(R=>{const W=X(v,[te,R,Qe]),Q=W?n.additionalProperties:n[R],ne=U(Q).widget==="hidden";return{content:c.jsx(Ab,{propertyName:R,required:jb(v,R),schema:I(v,[te,R],{}),uiSchema:Q,errorSchema:I(i,[R]),fieldPathId:A,formData:I(r,[R]),handleKeyRename:D,handleRemoveProperty:M,addedByAdditionalProperties:W,onChange:g,onBlur:u,onFocus:h,registry:m,disabled:l,readonly:d,hideError:f},R),name:R,readonly:d,disabled:l,required:o,hidden:ne}}),readonly:d,disabled:l,required:o,fieldPathId:s,uiSchema:n,errorSchema:i,schema:v,formData:r,registry:m,optionalDataControl:B,className:N?"rjsf-optional-object-field":void 0};return c.jsx(k,{...V,onAddProperty:E})}function Cb(t){const{schema:e,uiSchema:n={},formData:r,disabled:i=!1,readonly:s=!1,onChange:a,errorSchema:o,fieldPathId:l,registry:d}=t,{globalUiOptions:f={},schemaUtils:u,translateString:h}=d,g=U(n,f),m=L("OptionalDataControlsTemplate",d,g),p=Qt(r);let y,x,S,j;if(i||s)y=$r(l,"Msg"),x=p?void 0:h(K.OptionalObjectEmptyMsg);else{const b=p?K.OptionalObjectRemove:K.OptionalObjectAdd;x=h(b),p?(y=$r(l,"Remove"),j=()=>a(void 0,l.path,o)):(y=$r(l,"Add"),S=()=>{let v=u.getDefaultFormState(e,r,"excludeObjectChildren");v===void 0&&(v=Ie(e)==="array"?[]:{}),a(v,l.path,o)})}return x&&c.jsx(m,{id:y,registry:d,schema:e,uiSchema:n,label:x,onAddClick:S,onRemoveClick:j})}const Nb={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function Tb(t,e,n){const r=e.field,{fields:i}=n;if(typeof r=="function")return r;if(typeof r=="string"&&r in i)return i[r];const s=Ie(t),a=Array.isArray(s)?s[0]:s||"",o=t.$id;let l=Nb[a];return o&&o in i&&(l=o),!l&&(t.anyOf||t.oneOf)?()=>null:l in i?i[l]:i.FallbackField}function Fb(t){const{schema:e,fieldPathId:n,uiSchema:r,formData:i,errorSchema:s,name:a,onChange:o,onKeyRename:l,onKeyRenameBlur:d,onRemoveProperty:f,required:u=!1,registry:h,wasPropertyKeyModified:g=!1}=t,{schemaUtils:m,globalFormOptions:p,globalUiOptions:y,fields:x}=h,{AnyOfField:S,OneOfField:j}=x,b=U(r,y),v=L("FieldTemplate",h,b),w=L("DescriptionFieldTemplate",h,b),O=L("FieldHelpTemplate",h,b),A=L("FieldErrorTemplate",h,b),_=m.retrieveSchema(e,i),T=n[oe],N=P.useCallback((De,nn,Je,Ac)=>o(De,nn,Je,Ac||T),[T,o]),C=Tb(_,b,h),F=!!(b.disabled??t.disabled),$=!!(b.readonly??(t.readonly||t.schema.readOnly||_.readOnly)),E=b.hideError,D=E===void 0?t.hideError:!!E,M=!!(b.autofocus??t.autofocus);if(Object.keys(_).length===0)return null;let k=m.getDisplayLabel(_,r,y);const B=b.field&&b.fieldReplacesAnyOrOneOf===!0;let V,R,W={fieldPathId:n};if((J in _||q in _)&&!B&&!m.isSelect(_)){_[J]?(V=S,R=_[J].map(Je=>m.retrieveSchema(Z(Je)?Je:{},i))):_[q]&&(V=j,R=_[q].map(Je=>m.retrieveSchema(Z(Je)?Je:{},i)));const De=Mn(h,_,u,r),nn=Qt(i);k=k&&(!De||nn),W={childFieldPathId:n,fieldPathId:Fe("XxxOf",p,n)}}const{__errors:Q,...ne}=s||{},ie=wn(r,["ui:classNames","classNames","ui:style"]);ut in ie&&(ie[ut]=wn(ie[ut],["classNames","style"]));const de=c.jsx(C,{...t,onChange:N,...W,schema:_,uiSchema:ie,disabled:F,readonly:$,hideError:D,autofocus:M,errorSchema:ne,rawErrors:Q}),ee=n[oe];let z;g?z=a:z=Qe in _?a:b.title||t.schema.title||_.title||t.title||a;const H=b.description||t.schema.description||_.description||"",re=b.help,fe=b.widget==="hidden",je=["rjsf-field",`rjsf-field-${Ie(_)}`];!D&&Q&&Q.length>0&&je.push("rjsf-field-error"),b.classNames&&je.push(b.classNames);const Se=c.jsx(O,{help:re,fieldPathId:n,schema:_,uiSchema:r,hasErrors:!D&&Q&&Q.length>0,registry:h}),pe=D||V&&!m.isSelect(_)?void 0:c.jsx(A,{errors:Q,errorSchema:s,fieldPathId:n,schema:_,uiSchema:r,registry:h}),Oe={description:c.jsx(w,{id:Et(ee),description:H,schema:_,uiSchema:r,registry:h}),rawDescription:H,help:Se,rawHelp:typeof re=="string"?re:void 0,errors:pe,rawErrors:D?void 0:Q,fieldPathId:n,id:ee,label:z,hidden:fe,onChange:o,onKeyRename:l,onKeyRenameBlur:d,onRemoveProperty:f,required:u,disabled:F,readonly:$,hideError:D,displayLabel:k,classNames:je.join(" ").trim(),style:b.style,formData:i,schema:_,uiSchema:r,registry:h};return c.jsx(v,{...Oe,children:c.jsxs(c.Fragment,{children:[de,V&&c.jsx(V,{name:a,disabled:F,readonly:$,hideError:D,errorSchema:s,formData:i,fieldPathId:n,onBlur:t.onBlur,onChange:t.onChange,onFocus:t.onFocus,options:R,registry:h,required:u,schema:_,uiSchema:r})]})})}class Pb extends P.Component{shouldComponentUpdate(e){const{registry:{globalFormOptions:n}}=this.props,{experimental_componentUpdateStrategy:r="customDeep"}=n;return El(this,e,this.state,r)}render(){return c.jsx(Fb,{...this.props})}}function Eb(t){const{schema:e,name:n,uiSchema:r,fieldPathId:i,formData:s,required:a,disabled:o=!1,readonly:l=!1,autofocus:d=!1,onChange:f,onBlur:u,onFocus:h,registry:g,rawErrors:m,hideError:p,title:y}=t,{title:x,format:S}=e,{widgets:j,schemaUtils:b,globalUiOptions:v}=g,w=b.isSelect(e)?Gt(e,r):void 0;let O=w?"select":"text";S&&yx(e,S,j)&&(O=S);const{widget:A=O,placeholder:_="",title:T,...N}=U(r),C=b.getDisplayLabel(e,r,v),F=T??y??x??n,$=He(e,A,j),E=P.useCallback((D,M,k)=>f(D,i.path,M,k),[f,i]);return c.jsx($,{options:{...N,enumOptions:w},schema:e,uiSchema:r,id:i.$id,name:n,label:F,hideLabel:!C,hideError:p,value:s,onChange:E,onBlur:u,onFocus:h,required:a,disabled:o,readonly:l,autofocus:d,registry:g,placeholder:_,rawErrors:m,htmlName:i.name})}function Ib(t){const{formData:e,onChange:n,fieldPathId:r}=t;return P.useEffect(()=>{e===void 0&&n(null,r.path)},[r,e,n]),null}function Db(){return{AnyOfField:xo,ArrayField:Wx,BooleanField:Vx,FallbackField:Gx,LayoutGridField:Qi,LayoutHeaderField:m0,LayoutMultiSchemaField:h0,NumberField:y0,ObjectField:_b,OneOfField:xo,OptionalDataControlsField:Cb,SchemaField:Pb,StringField:Eb,NullField:Ib}}function $b(t){const{fieldPathId:e,description:n,registry:r,schema:i,uiSchema:s}=t,a=U(s,r.globalUiOptions),{label:o=!0}=a;if(!n||!o)return null;const l=L("DescriptionFieldTemplate",r,a);return c.jsx(l,{id:Et(e),description:n,schema:i,uiSchema:s,registry:r})}function kb(t){const{children:e,className:n,buttonsProps:r,displayLabel:i,hasDescription:s,hasToolbar:a,registry:o,uiSchema:l}=t,d=U(l),f=L("ArrayFieldItemButtonsTemplate",o,d),u={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"},h=s?31:9,g={display:"flex",alignItems:i?"center":"baseline"},m={display:"flex",justifyContent:"flex-end",marginTop:i?`${h}px`:0};return c.jsxs("div",{className:n,style:g,children:[c.jsx("div",{className:a?"col-xs-9 col-md-10 col-xl-11":"col-xs-12",children:e}),a&&c.jsx("div",{className:"col-xs-3 col-md-2 col-xl-1 array-item-toolbox",children:c.jsx("div",{className:"btn-group",style:m,children:c.jsx(f,{...r,style:u})})})]})}function Mb(t){const{disabled:e,hasCopy:n,hasMoveDown:r,hasMoveUp:i,hasRemove:s,fieldPathId:a,onCopyItem:o,onRemoveItem:l,onMoveDownItem:d,onMoveUpItem:f,readonly:u,registry:h,uiSchema:g}=t,{CopyButton:m,MoveDownButton:p,MoveUpButton:y,RemoveButton:x}=h.templates.ButtonTemplates;return c.jsxs(c.Fragment,{children:[(i||r)&&c.jsx(y,{id:qe(a,"moveUp"),className:"rjsf-array-item-move-up",disabled:e||u||!i,onClick:f,uiSchema:g,registry:h}),(i||r)&&c.jsx(p,{id:qe(a,"moveDown"),className:"rjsf-array-item-move-down",disabled:e||u||!r,onClick:d,uiSchema:g,registry:h}),n&&c.jsx(m,{id:qe(a,"copy"),className:"rjsf-array-item-copy",disabled:e||u,onClick:o,uiSchema:g,registry:h}),s&&c.jsx(x,{id:qe(a,"remove"),className:"rjsf-array-item-remove",disabled:e||u,onClick:l,uiSchema:g,registry:h})]})}function Rb(t){const{canAdd:e,className:n,disabled:r,fieldPathId:i,uiSchema:s,items:a,optionalDataControl:o,onAddClick:l,readonly:d,registry:f,required:u,schema:h,title:g}=t,m=U(s),p=L("ArrayFieldDescriptionTemplate",f,m),y=L("ArrayFieldTitleTemplate",f,m),x=!d&&!r,{ButtonTemplates:{AddButton:S}}=f.templates;return c.jsxs("fieldset",{className:n,id:i.$id,children:[c.jsx(y,{fieldPathId:i,title:m.title||g,required:u,schema:h,uiSchema:s,registry:f,optionalDataControl:x?o:void 0}),c.jsx(p,{fieldPathId:i,description:m.description||h.description,schema:h,uiSchema:s,registry:f}),x?void 0:o,c.jsx("div",{className:"row array-item-list",children:a}),e&&c.jsx(S,{id:qe(i,"add"),className:"rjsf-array-item-add",onClick:l,disabled:r||d,uiSchema:s,registry:f})]})}function Bb(t){const{fieldPathId:e,title:n,schema:r,uiSchema:i,required:s,registry:a,optionalDataControl:o}=t,l=U(i,a.globalUiOptions),{label:d=!0}=l;if(!n||!d)return null;const f=L("TitleFieldTemplate",a,l);return c.jsx(f,{id:hr(e),title:n,required:s,schema:r,uiSchema:i,registry:a,optionalDataControl:o})}function Ub(t){const{id:e,name:n,htmlName:r,value:i,readonly:s,disabled:a,autofocus:o,onBlur:l,onFocus:d,onChange:f,onChangeOverride:u,options:h,schema:g,uiSchema:m,registry:p,rawErrors:y,type:x,hideLabel:S,hideError:j,...b}=t,{ClearButton:v}=p.templates.ButtonTemplates;if(!e)throw console.log("No id for",t),new Error(`no id for props ${JSON.stringify(t)}`);const w={...b,...Nl(g,x,h)};let O;w.type==="number"||w.type==="integer"?O=i||i===0?i:"":O=i??"";const A=P.useCallback(({target:{value:C}})=>f(C===""?h.emptyValue:C),[f,h]),_=P.useCallback(({target:C})=>l(e,C&&C.value),[l,e]),T=P.useCallback(({target:C})=>d(e,C&&C.value),[d,e]),N=P.useCallback(C=>{C.preventDefault(),C.stopPropagation(),f(h.emptyValue??"")},[f,h.emptyValue]);return c.jsxs(c.Fragment,{children:[c.jsx("input",{id:e,name:r||e,className:"form-control",readOnly:s,disabled:a,autoFocus:o,value:O,...w,list:g.examples?Cn(e):void 0,onChange:u||A,onBlur:_,onFocus:T,"aria-describedby":we(e,!!g.examples)}),h.allowClearTextInputs&&!s&&!a&&O&&c.jsx(v,{registry:p,onClick:N}),Array.isArray(g.examples)&&c.jsx("datalist",{id:Cn(e),children:g.examples.concat(g.default&&!g.examples.includes(g.default)?[g.default]:[]).map(C=>c.jsx("option",{value:C},C))},`datalist_${e}`)]})}function Lb({uiSchema:t}){const{submitText:e,norender:n,props:r={}}=Tl(t);return n?null:c.jsx("div",{children:c.jsx("button",{type:"submit",...r,className:`btn btn-info ${r.className||""}`,children:e})})}function xt(t){const{iconType:e="default",icon:n,className:r,uiSchema:i,registry:s,...a}=t;return c.jsx("button",{type:"button",className:`btn btn-${e} ${r}`,...a,children:c.jsx("i",{className:`glyphicon glyphicon-${n}`})})}function Wb(t){const{registry:{translateString:e}}=t;return c.jsx(xt,{title:e(K.CopyButton),...t,icon:"copy"})}function Vb(t){const{registry:{translateString:e}}=t;return c.jsx(xt,{title:e(K.MoveDownButton),...t,icon:"arrow-down"})}function zb(t){const{registry:{translateString:e}}=t;return c.jsx(xt,{title:e(K.MoveUpButton),...t,icon:"arrow-up"})}function qb(t){const{registry:{translateString:e}}=t;return c.jsx(xt,{title:e(K.RemoveButton),...t,iconType:"danger",icon:"remove"})}function Kb({id:t,className:e,onClick:n,disabled:r,registry:i,...s}){const{translateString:a}=i;return c.jsx(xt,{id:t,iconType:"default",icon:"remove",className:"btn-clear col-xs-12",title:a(K.ClearButton),onClick:n,disabled:r,registry:i,...s})}function Gb({id:t,className:e,onClick:n,disabled:r,registry:i}){const{translateString:s}=i;return c.jsx("div",{className:"row",children:c.jsx("p",{className:`col-xs-4 col-sm-2 col-lg-1 col-xs-offset-8 col-sm-offset-10 col-lg-offset-11 text-right ${e}`,children:c.jsx(xt,{id:t,iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:s(K.AddButton),onClick:n,disabled:r,registry:i})})})}function Hb(){return{SubmitButton:Lb,AddButton:Gb,CopyButton:Wb,MoveDownButton:Vb,MoveUpButton:zb,RemoveButton:qb,ClearButton:Kb}}const Yl=Gi();function rs({description:t,registry:e,uiSchema:n={}}){const{globalUiOptions:r}=e;return U(n,r).enableMarkdownInDescription&&typeof t=="string"?c.jsx(Rn,{options:{disableParsingRawHTML:!0},"data-testid":Yl.markdown,children:t}):t}rs.TEST_IDS=Yl;function Yb(t){const{id:e,description:n,registry:r,uiSchema:i}=t;return n?c.jsx("div",{id:e,className:"field-description",children:c.jsx(rs,{description:n,registry:r,uiSchema:i})}):null}function Xb({errors:t,registry:e}){const{translateString:n}=e;return c.jsxs("div",{className:"panel panel-danger errors",children:[c.jsx("div",{className:"panel-heading",children:c.jsx("h3",{className:"panel-title",children:n(K.ErrorsLabel)})}),c.jsx("ul",{className:"list-group",children:t.map((r,i)=>c.jsx("li",{className:"list-group-item text-danger",children:r.stack},i))})]})}function Jb(t){const{schema:e,registry:n,typeSelector:r,schemaField:i}=t,s=L("MultiSchemaFieldTemplate",n);return c.jsx(s,{selector:r,optionSchemaField:i,schema:e,registry:n})}const Zb="*";function Xl(t){const{label:e,required:n,id:r}=t;return e?c.jsxs("label",{className:"control-label",htmlFor:r,children:[e,n&&c.jsx("span",{className:"required",children:Zb})]}):null}function Qb(t){const{id:e,label:n,children:r,errors:i,help:s,description:a,hidden:o,required:l,displayLabel:d,registry:f,uiSchema:u}=t,h=U(u),g=L("WrapIfAdditionalTemplate",f,h);if(o)return c.jsx("div",{className:"hidden",children:r});const m=h.widget==="checkbox";return c.jsxs(g,{...t,children:[d&&!m&&c.jsx(Xl,{label:n,required:l,id:e}),d&&a?a:null,r,i,s]})}function ev(t){const{errors:e=[],fieldPathId:n}=t;if(e.length===0)return null;const r=Hi(n);return c.jsx("div",{children:c.jsx("ul",{id:r,className:"error-detail bs-callout bs-callout-info",children:e.filter(i=>!!i).map((i,s)=>c.jsx("li",{className:"text-danger",children:i},s))})})}const Jl=Gi();function is({help:t,registry:e,uiSchema:n={}}){const{globalUiOptions:r}=e;return U(n,r).enableMarkdownInHelp&&typeof t=="string"?c.jsx(Rn,{options:{disableParsingRawHTML:!0},"data-testid":Jl.markdown,children:t}):t}is.TEST_IDS=Jl;function tv(t){const{fieldPathId:e,help:n,uiSchema:r,registry:i}=t;return n?c.jsx("div",{id:Yi(e),className:"help-block",children:c.jsx(is,{help:n,registry:i,uiSchema:r})}):null}function nv(t){const{children:e,column:n,className:r,...i}=t;return c.jsx("div",{className:r,...i,children:e})}function rv(t){const{selector:e,optionSchemaField:n}=t;return c.jsxs("div",{className:"panel panel-default panel-body",children:[c.jsx("div",{className:"form-group",children:e}),n]})}function iv(t){const{className:e,description:n,disabled:r,formData:i,fieldPathId:s,onAddProperty:a,optionalDataControl:o,properties:l,readonly:d,registry:f,required:u,schema:h,title:g,uiSchema:m}=t,p=U(m),y=L("TitleFieldTemplate",f,p),x=L("DescriptionFieldTemplate",f,p);if((h.oneOf||h.anyOf)&&!h.properties&&l.length===0)return null;const j=!d&&!r,{ButtonTemplates:{AddButton:b}}=f.templates;return c.jsxs("fieldset",{className:e,id:s.$id,children:[g&&c.jsx(y,{id:hr(s),title:g,required:u,schema:h,uiSchema:m,registry:f,optionalDataControl:j?o:void 0}),n&&c.jsx(x,{id:Et(s),description:n,schema:h,uiSchema:m,registry:f}),j?void 0:o,l.map(v=>v.content),ca(h,m,i)&&c.jsx(b,{id:qe(s,"add"),className:"rjsf-object-property-expand",onClick:a,disabled:r||d,uiSchema:m,registry:f})]})}function sv(t){const{id:e,registry:n,label:r,onAddClick:i,onRemoveClick:s}=t;return i?c.jsx(xt,{id:e,registry:n,icon:"plus",className:"rjsf-add-optional-data btn-sm",onClick:i,title:r}):s?c.jsx(xt,{id:e,registry:n,icon:"remove",className:"rjsf-remove-optional-data btn-sm",onClick:s,title:r}):c.jsx("em",{id:e,children:r})}const ov="*";function av(t){const{id:e,title:n,required:r,optionalDataControl:i}=t;return c.jsxs("legend",{id:e,children:[n,r&&c.jsx("span",{className:"required",children:ov}),i&&c.jsx("span",{className:"pull-right",style:{marginBottom:"2px"},children:i})]})}function lv(t){const{schema:e,fieldPathId:n,reason:r,registry:i}=t,{translateString:s}=i;let a=K.UnsupportedField;const o=[];return n&&n.$id&&(a=K.UnsupportedFieldWithId,o.push(n.$id)),r&&(a=a===K.UnsupportedField?K.UnsupportedFieldWithReason:K.UnsupportedFieldWithIdAndReason,o.push(r)),c.jsxs("div",{className:"unsupported-field",children:[c.jsx("p",{children:c.jsx(Rn,{options:{disableParsingRawHTML:!0},children:s(a,o)})}),e&&c.jsx("pre",{children:JSON.stringify(e,null,2)})]})}function cv(t){const{id:e,classNames:n,style:r,disabled:i,displayLabel:s,label:a,onKeyRenameBlur:o,onRemoveProperty:l,rawDescription:d,readonly:f,required:u,schema:h,hideError:g,rawErrors:m,children:p,uiSchema:y,registry:x}=t,{templates:S,translateString:j}=x,{RemoveButton:b}=S.ButtonTemplates,v=j(K.KeyLabel,[a]),w=Qe in h,O=!!d,A=["form-group",n];!g&&m&&m.length>0&&A.push("has-error has-danger");const _=A.join(" ").trim();if(!w)return c.jsx("div",{className:_,style:r,children:p});const T=O?46:26;return c.jsx("div",{className:_,style:r,children:c.jsxs("div",{className:"row",children:[c.jsx("div",{className:"col-xs-5 form-additional",children:c.jsxs("div",{className:"form-group",children:[s&&c.jsx(Xl,{label:v,required:u,id:`${e}-key`}),s&&d&&c.jsx("div",{children:" "}),c.jsx("input",{className:"form-control",type:"text",id:`${e}-key`,onBlur:o,defaultValue:a})]})}),c.jsx("div",{className:"form-additional form-group col-xs-5",children:p}),c.jsx("div",{className:"col-xs-2",style:{marginTop:s?`${T}px`:void 0},children:c.jsx(b,{id:qe(e,"remove"),className:"rjsf-object-property-remove btn-block",style:{border:"0"},disabled:i||f,onClick:l,uiSchema:y,registry:x})})]})})}function uv(){return{ArrayFieldDescriptionTemplate:$b,ArrayFieldItemTemplate:kb,ArrayFieldItemButtonsTemplate:Mb,ArrayFieldTemplate:Rb,ArrayFieldTitleTemplate:Bb,ButtonTemplates:Hb(),BaseInputTemplate:Ub,DescriptionFieldTemplate:Yb,ErrorListTemplate:Xb,FallbackFieldTemplate:Jb,FieldTemplate:Qb,FieldErrorTemplate:ev,FieldHelpTemplate:tv,GridTemplate:nv,MultiSchemaFieldTemplate:rv,ObjectFieldTemplate:iv,OptionalDataControlsTemplate:sv,TitleFieldTemplate:av,UnsupportedFieldTemplate:lv,WrapIfAdditionalTemplate:cv}}function dv(t){const{disabled:e=!1,readonly:n=!1,autofocus:r=!1,options:i,id:s,name:a,registry:o,onBlur:l,onFocus:d}=t,{translateString:f}=o,{elements:u,handleChange:h,handleClear:g,handleSetNow:m}=Ox(t);return c.jsxs("ul",{className:"list-inline",children:[u.map((p,y)=>c.jsx("li",{className:"list-inline-item",children:c.jsx(jx,{rootId:s,name:a,select:h,...p,disabled:e,readonly:n,registry:o,onBlur:l,onFocus:d,autofocus:r&&y===0})},y)),(i.hideNowButton!=="undefined"?!i.hideNowButton:!0)&&c.jsx("li",{className:"list-inline-item",children:c.jsx("a",{href:"#",className:"btn btn-info btn-now",onClick:m,children:f(K.NowLabel)})}),(i.hideClearButton!=="undefined"?!i.hideClearButton:!0)&&c.jsx("li",{className:"list-inline-item",children:c.jsx("a",{href:"#",className:"btn btn-warning btn-clear",onClick:g,children:f(K.ClearLabel)})})]})}function fv({time:t=!0,...e}){const{AltDateWidget:n}=e.registry.widgets;return c.jsx(n,{time:t,...e})}function mv({schema:t,uiSchema:e,options:n,id:r,value:i,disabled:s,readonly:a,label:o,hideLabel:l,autofocus:d=!1,onBlur:f,onFocus:u,onChange:h,registry:g,htmlName:m}){const p=L("DescriptionFieldTemplate",g,n),y=hn(t),x=P.useCallback(O=>h(O.target.checked),[h]),S=P.useCallback(O=>f(r,O.target.checked),[f,r]),j=P.useCallback(O=>u(r,O.target.checked),[u,r]),w=U(e).widget==="checkbox"?void 0:n.description??t.description;return c.jsxs("div",{className:`checkbox ${s||a?"disabled":""}`,children:[!l&&w&&c.jsx(p,{id:Et(r),description:w,schema:t,uiSchema:e,registry:g}),c.jsxs("label",{children:[c.jsx("input",{type:"checkbox",id:r,name:m||r,checked:typeof i>"u"?!1:i,required:y,disabled:s||a,autoFocus:d,onChange:x,onBlur:S,onFocus:j,"aria-describedby":we(r)}),Pl(c.jsx("span",{children:o}),l)]})]})}function hv({id:t,disabled:e,options:{inline:n=!1,enumOptions:r,enumDisabled:i,emptyValue:s},value:a,autofocus:o=!1,readonly:l,onChange:d,onBlur:f,onFocus:u,htmlName:h}){const g=Array.isArray(a)?a:[a],m=P.useCallback(({target:y})=>f(t,ge(y&&y.value,r,s)),[f,t,r,s]),p=P.useCallback(({target:y})=>u(t,ge(y&&y.value,r,s)),[u,t,r,s]);return c.jsx("div",{className:"checkboxes",id:t,children:Array.isArray(r)&&r.map((y,x)=>{const S=kn(y.value,g),j=Array.isArray(i)&&i.indexOf(y.value)!==-1,b=e||j||l?"disabled":"",v=O=>{O.target.checked?d(Al(x,g,r)):d(jl(x,g,r))},w=c.jsxs("span",{children:[c.jsx("input",{type:"checkbox",id:wt(t,x),name:h||t,checked:S,value:String(x),disabled:e||j||l,autoFocus:o&&x===0,onChange:v,onBlur:m,onFocus:p,"aria-describedby":we(t)}),c.jsx("span",{children:y.label})]});return n?c.jsx("label",{className:`checkbox-inline ${b}`,children:w},x):c.jsx("div",{className:`checkbox ${b}`,children:c.jsx("label",{children:w})},x)})})}function pv(t){const{disabled:e,readonly:n,options:r,registry:i}=t,s=L("BaseInputTemplate",i,r);return c.jsx(s,{type:"color",...t,disabled:e||n})}function gv(t){const{onChange:e,options:n,registry:r}=t,i=L("BaseInputTemplate",r,n),s=P.useCallback(a=>e(a||void 0),[e]);return c.jsx(i,{type:"date",...t,onChange:s})}function yv(t){const{onChange:e,value:n,options:r,registry:i}=t,s=L("BaseInputTemplate",i,r);return c.jsx(s,{type:"datetime-local",...t,value:Tx(n),onChange:a=>e(bx(a))})}function xv(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{type:"email",...t})}function bv({fileInfo:t,registry:e}){const{translateString:n}=e,{dataURL:r,type:i,name:s}=t;return r?["image/jpeg","image/png"].includes(i)?c.jsx("img",{src:r,style:{maxWidth:"100%"},className:"file-preview"}):c.jsxs(c.Fragment,{children:[" ",c.jsx("a",{download:`preview-${s}`,href:r,className:"file-download",children:n(K.PreviewLabel)})]}):null}function vv({filesInfo:t,registry:e,preview:n,onRemove:r,options:i}){if(t.length===0)return null;const{translateString:s}=e,{RemoveButton:a}=L("ButtonTemplates",e,i);return c.jsx("ul",{className:"file-info",children:t.map((o,l)=>{const{name:d,size:f,type:u}=o,h=()=>r(l);return c.jsxs("li",{children:[c.jsx(Rn,{children:s(K.FilesInfo,[d,u,String(f)])}),n&&c.jsx(bv,{fileInfo:o,registry:e}),c.jsx(a,{onClick:h,registry:e})]},l)})})}function Sv(t){const{disabled:e,readonly:n,required:r,multiple:i,onChange:s,value:a,options:o,registry:l}=t,{filesInfo:d,handleChange:f,handleRemove:u}=Nx(a,s,i),h=L("BaseInputTemplate",l,o),g=m=>{m.target.files&&f(m.target.files)};return c.jsxs("div",{children:[c.jsx(h,{...t,disabled:e||n,type:"file",required:a?!1:r,onChangeOverride:g,value:"",accept:o.accept?String(o.accept):void 0}),c.jsx(vv,{filesInfo:d,onRemove:u,registry:l,preview:o.filePreview,options:o})]})}function wv({id:t,value:e,htmlName:n}){return c.jsx("input",{type:"hidden",id:t,name:n||t,value:typeof e>"u"?"":e})}function jv(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{type:"password",...t})}function Ov({options:t,value:e,required:n,disabled:r,readonly:i,autofocus:s=!1,onBlur:a,onFocus:o,onChange:l,id:d,htmlName:f}){const{enumOptions:u,enumDisabled:h,inline:g,emptyValue:m}=t,p=P.useCallback(({target:x})=>a(d,ge(x&&x.value,u,m)),[a,u,m,d]),y=P.useCallback(({target:x})=>o(d,ge(x&&x.value,u,m)),[o,u,m,d]);return c.jsx("div",{className:"field-radio-group",id:d,role:"radiogroup",children:Array.isArray(u)&&u.map((x,S)=>{const j=kn(x.value,e),b=Array.isArray(h)&&h.indexOf(x.value)!==-1,v=r||b||i?"disabled":"",w=()=>l(x.value),O=c.jsxs("span",{children:[c.jsx("input",{type:"radio",id:wt(d,S),checked:j,name:f||d,required:n,value:String(S),disabled:r||b||i,autoFocus:s&&S===0,onChange:w,onBlur:p,onFocus:y,"aria-describedby":we(d)}),c.jsx("span",{children:x.label})]});return g?c.jsx("label",{className:`radio-inline ${v}`,children:O},S):c.jsx("div",{className:`radio ${v}`,children:c.jsx("label",{children:O})},S)})})}function Av(t){const{value:e,registry:{templates:{BaseInputTemplate:n}}}=t;return c.jsxs("div",{className:"field-range-wrapper",children:[c.jsx(n,{type:"range",...t}),c.jsx("span",{className:"range-view",children:e})]})}function _v({id:t,value:e,required:n,disabled:r,readonly:i,autofocus:s,onChange:a,onFocus:o,onBlur:l,schema:d,options:f,htmlName:u}){const{stars:h=5,shape:g="star"}=f,m=d.maximum?Math.min(d.maximum,5):Math.min(Math.max(h,1),5),p=d.minimum||0,y=P.useCallback(b=>{!r&&!i&&a(b)},[a,r,i]),x=P.useCallback(b=>{if(o){const v=Number(b.target.dataset.value);o(t,v)}},[o,t]),S=P.useCallback(b=>{if(l){const v=Number(b.target.dataset.value);l(t,v)}},[l,t]),j=b=>g==="heart"?b?"♥":"♡":b?"★":"☆";return c.jsx(c.Fragment,{children:c.jsxs("div",{className:"rating-widget",style:{display:"inline-flex",fontSize:"1.5rem",cursor:r||i?"default":"pointer"},children:[[...Array(m)].map((b,v)=>{const w=p+v,O=w<=e;return c.jsx("span",{onClick:()=>y(w),onFocus:x,onBlur:S,"data-value":w,tabIndex:r||i?-1:0,role:"radio","aria-checked":w===e,"aria-label":`${w} ${g==="heart"?"heart":"star"}${w===1?"":"s"}`,style:{color:O?"#FFD700":"#ccc",padding:"0 0.2rem",transition:"color 0.2s",userSelect:"none"},children:j(O)},v)}),c.jsx("input",{type:"hidden",id:t,name:u||t,value:e||"",required:n,disabled:r||i,"aria-hidden":"true"})]})})}function Wr(t,e){return e?Array.from(t.target.options).slice().filter(n=>n.selected).map(n=>n.value):t.target.value}function Cv({schema:t,id:e,options:n,value:r,required:i,disabled:s,readonly:a,multiple:o=!1,autofocus:l=!1,onChange:d,onBlur:f,onFocus:u,placeholder:h,htmlName:g}){const{enumOptions:m,enumDisabled:p,emptyValue:y}=n,x=o?[]:"",S=P.useCallback(O=>{const A=Wr(O,o);return u(e,ge(A,m,y))},[u,e,o,m,y]),j=P.useCallback(O=>{const A=Wr(O,o);return f(e,ge(A,m,y))},[f,e,o,m,y]),b=P.useCallback(O=>{const A=Wr(O,o);return d(ge(A,m,y))},[d,o,m,y]),v=Ol(r,m,o),w=!o&&t.default===void 0;return c.jsxs("select",{id:e,name:g||e,multiple:o,role:"combobox",className:"form-control",value:typeof v>"u"?x:v,required:i,disabled:s||a,autoFocus:l,onBlur:j,onFocus:S,onChange:b,"aria-describedby":we(e),children:[w&&c.jsx("option",{value:"",children:h}),Array.isArray(m)&&m.map(({value:O,label:A},_)=>{const T=p&&p.indexOf(O)!==-1;return c.jsx("option",{value:String(_),disabled:T,children:A},_)})]})}function Nv({id:t,options:e={},placeholder:n,value:r,required:i,disabled:s,readonly:a,autofocus:o=!1,onChange:l,onBlur:d,onFocus:f,htmlName:u}){const h=P.useCallback(({target:{value:p}})=>l(p===""?e.emptyValue:p),[l,e.emptyValue]),g=P.useCallback(({target:p})=>d(t,p&&p.value),[d,t]),m=P.useCallback(({target:p})=>f(t,p&&p.value),[t,f]);return c.jsx("textarea",{id:t,name:u||t,className:"form-control",value:r||"",placeholder:n,required:i,disabled:s,readOnly:a,autoFocus:o,rows:e.rows,onBlur:g,onFocus:m,onChange:h,"aria-describedby":we(t)})}function Tv(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{...t})}function Fv(t){const{onChange:e,options:n,registry:r}=t,i=L("BaseInputTemplate",r,n),s=P.useCallback(a=>e(a?`${a}:00`:void 0),[e]);return c.jsx(i,{type:"time",...t,onChange:s})}function Pv(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{type:"url",...t})}function Ev(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{type:"number",...t})}function Iv(){return{AltDateWidget:dv,AltDateTimeWidget:fv,CheckboxWidget:mv,CheckboxesWidget:hv,ColorWidget:pv,DateWidget:gv,DateTimeWidget:yv,EmailWidget:xv,FileWidget:Sv,HiddenWidget:wv,PasswordWidget:jv,RadioWidget:Ov,RangeWidget:Av,RatingWidget:_v,SelectWidget:Cv,TextWidget:Tv,TextareaWidget:Nv,TimeWidget:Fv,UpDownWidget:Ev,URLWidget:Pv}}function Dv(){return{fields:Db(),templates:uv(),widgets:Iv(),rootSchema:{},formContext:{},translateString:rx,globalFormOptions:{idPrefix:oa,idSeparator:aa,useFallbackUiForUnsupportedType:!1}}}function $t(t,e){return{...qi(t,["schema","uiSchema","fieldPathId","schemaUtils","formData","edit","errors","errorSchema"]),...e!==void 0&&{status:e}}}let $v=class extends P.Component{formElement;pendingChanges=[];_isProcessingUserChange=!1;constructor(e){if(super(e),!e.validator)throw new Error("A validator is required for Form functionality to work");const{formData:n,initialFormData:r,onChange:i}=e,s=n??r;this.state=this.getStateFromProps(e,s,void 0,void 0,void 0,!0),i&&!le(this.state.formData,s)&&i($t(this.state)),this.formElement=P.createRef()}getSnapshotBeforeUpdate(e,n){if(!le(this.props,e)){const r=ao(this.props.formData,e.formData),i=ao(this.props.formData,this.state.formData),s=!le(e.schema,this.props.schema),a=r.length>0||!le(e.formData,this.props.formData),o=i.length>0||!le(this.state.formData,this.props.formData),l=this.getStateFromProps(this.props,this.props.formData,s||a?void 0:this.state.retrievedSchema,s,r,!o),d=!le(l,n);return{nextState:l,shouldUpdate:d}}return{shouldUpdate:!1}}componentDidUpdate(e,n,r){if(r.shouldUpdate){const{nextState:i}=r,s=!le(i.formData,this.props.formData),a=this._isProcessingUserChange;if(this._isProcessingUserChange=!1,a&&s)return;s&&!le(i.formData,n.formData)&&this.props.onChange&&this.props.onChange($t(i)),this.setState(i)}}getStateFromProps(e,n,r,i=!1,s=[],a=!1){const o=this.state||{},l="schema"in e?e.schema:this.props.schema,d="validator"in e?e.validator:this.props.validator,f=("uiSchema"in e?e.uiSchema:this.props.uiSchema)||{},u=e.formData===void 0&&this.props.formData===void 0,h=typeof n<"u",g="liveValidate"in e?e.liveValidate:this.props.liveValidate,m=h&&!e.noValidate&&g,p="experimental_defaultFormStateBehavior"in e?e.experimental_defaultFormStateBehavior:this.props.experimental_defaultFormStateBehavior,y="experimental_customMergeAllOf"in e?e.experimental_customMergeAllOf:this.props.experimental_customMergeAllOf;let x=o.schemaUtils;(!x||x.doesSchemaUtilsDiffer(d,l,p,y))&&(x=ex(d,l,p,y));const S=x.getRootSchema();let j=n;n===ko?j=void 0:n===void 0&&u&&(j=o.formData);const b=x.getDefaultFormState(S,j,!1,o.initialDefaultsGenerated),v=this.updateRetrievedSchema(r??x.retrieveSchema(S,b)),w=()=>e.noValidate||i?{errors:[],errorSchema:{}}:e.liveValidate?{errors:o.errors||[],errorSchema:o.errorSchema||{}}:{errors:o.schemaValidationErrors||[],errorSchema:o.schemaValidationErrorSchema||{}};let O,A,_=o.schemaValidationErrors,T=o.schemaValidationErrorSchema;if(m&&!a){const E=this.liveValidate(S,x,o.errorSchema,b,void 0,o.customErrors,r,r!==void 0);O=E.errors,A=E.errorSchema,_=E.schemaValidationErrors,T=E.schemaValidationErrorSchema}else{const E=w();if(O=E.errors,A=E.errorSchema,s.length>0&&!m){const M=s.reduce((k,B)=>(k[B]=void 0,k),{});A=T=_n(E.errorSchema,M,"preventDuplicates")}const D=this.mergeErrors({errorSchema:A,errors:O},e.extraErrors,o.customErrors);O=D.errors,A=D.errorSchema}const N=this.getRegistry(e,S,x),C=le(o.registry,N)?o.registry:N,F=o.fieldPathId&&o.fieldPathId?.[oe]===C.globalFormOptions.idPrefix?o.fieldPathId:Fe("",C.globalFormOptions);return{schemaUtils:x,schema:S,uiSchema:f,fieldPathId:F,formData:b,edit:h,errors:O,errorSchema:A,schemaValidationErrors:_,schemaValidationErrorSchema:T,retrievedSchema:v,initialDefaultsGenerated:!0,registry:C}}shouldComponentUpdate(e,n){const{experimental_componentUpdateStrategy:r="customDeep"}=this.props;return El(this,e,n,r)}validate(e,n=this.state.schema,r,i){const s=r||this.state.schemaUtils,{customValidate:a,transformErrors:o,uiSchema:l}=this.props,d=i??s.retrieveSchema(n,e);return s.getValidator().validateFormData(e,d,a,o,l)}renderErrors(e){const{errors:n,errorSchema:r,schema:i,uiSchema:s}=this.state,a=U(s),o=L("ErrorListTemplate",e,a);return n&&n.length?c.jsx(o,{errors:n,errorSchema:r||{},schema:i,uiSchema:s,registry:e}):null}mergeErrors(e,n,r){let i=e.errorSchema,s=e.errors;if(n){const a=Xn(e,n);i=a.errorSchema,s=a.errors}if(r){const a=Xn(e,r.ErrorSchema,!0);i=a.errorSchema,s=a.errors}return{errors:s,errorSchema:i}}liveValidate(e,n,r,i,s,a,o,l=!1){const d=this.validate(i,e,n,o),f=d.errors;let u=d.errorSchema;l&&(u=_n(r,d.errorSchema,"preventDuplicates"));const h=f,g=u;return{...this.mergeErrors({errorSchema:u,errors:f},s,a),schemaValidationErrors:h,schemaValidationErrorSchema:g}}getUsedFormData=(e,n)=>vl(e,n);getFieldNames=(e,n)=>Sl(e,n);omitExtraData=e=>{const{schema:n,schemaUtils:r}=this.state;return r.omitExtraData(n,e)};setFieldValue=(e,n)=>{const{registry:r}=this.state,i=Array.isArray(e)?e:e.split("."),s=Fe("",r.globalFormOptions,i);this.onChange(n,i,void 0,s[oe])};onChange=(e,n,r,i)=>{this.pendingChanges.push({newValue:e,path:n,newErrorSchema:r,id:i}),this.pendingChanges.length===1&&this.processPendingChange()};processPendingChange(){if(this.pendingChanges.length===0)return;this._isProcessingUserChange=!0;const{newValue:e,path:n,id:r}=this.pendingChanges[0],{newErrorSchema:i}=this.pendingChanges[0],{extraErrors:s,omitExtraData:a,liveOmit:o,noValidate:l,liveValidate:d,onChange:f}=this.props,{formData:u,schemaUtils:h,schema:g,fieldPathId:m,schemaValidationErrorSchema:p,errors:y}=this.state;let{customErrors:x,errorSchema:S}=this.state;const j=m.path[0]||"",b=!n||n.length===0||n.length===1&&n[0]===j;let v=this.state.retrievedSchema,w=b?e:Ki(u);const O=Y(w)&&Object.keys(w).length>0&&Object.values(w).every(F=>F===void 0),A=u==null,_=O&&A?void 0:w;if(Y(w)||Array.isArray(w)){e===Hl?Ix(w,n):b||se(w,n,e);const F=this.getStateFromProps(this.props,_,void 0,void 0,void 0,!0);w=F.formData,v=F.retrievedSchema}const T=!l&&(d===!0||d==="onChange");let N={formData:w,schema:g},C=w;if(a===!0&&(o===!0||o==="onChange")&&(C=this.omitExtraData(w),N={formData:C}),i){const F=b?p:I(p,n);if(!me(F))b?S=i:se(S,n,i);else if(x||(x=new _l),b){const $=I(i,xe);$&&x.setErrors($)}else se(x.ErrorSchema,n,i)}else x&&I(x.ErrorSchema,[...n,xe])&&x.clearErrors(n);if(T&&this.pendingChanges.length===1){const F=this.liveValidate(g,h,S,C,s,x,v);N={formData:C,...F,customErrors:x}}else if(!l&&i){const F=this.mergeErrors({errorSchema:S,errors:y},s,x);N={formData:C,...F,customErrors:x}}this.setState(N,()=>{f&&f($t({...this.state,...N}),r),this.pendingChanges.shift(),this.processPendingChange()})}updateRetrievedSchema(e){return le(e,this.state?.retrievedSchema)?this.state.retrievedSchema:e}reset=()=>{const{formData:e,initialFormData:n=ko,onChange:r}=this.props,a={formData:this.getStateFromProps(this.props,e??n,void 0,void 0,void 0,!0).formData,errorSchema:{},errors:[],schemaValidationErrors:[],schemaValidationErrorSchema:{},initialDefaultsGenerated:!1,customErrors:void 0};this.setState(a,()=>r&&r($t({...this.state,...a})))};onBlur=(e,n)=>{const{onBlur:r,omitExtraData:i,liveOmit:s,liveValidate:a}=this.props;if(r&&r(e,n),i===!0&&s==="onBlur"||a==="onBlur"){const{onChange:o,extraErrors:l}=this.props,{formData:d}=this.state;let f=d,u={formData:f};if(i===!0&&s==="onBlur"&&(f=this.omitExtraData(d),u={formData:f}),a==="onBlur"){const{schema:g,schemaUtils:m,errorSchema:p,customErrors:y,retrievedSchema:x}=this.state,S=this.liveValidate(g,m,p,f,l,y,x);u={formData:f,...S,customErrors:y}}const h=Object.keys(u).filter(g=>!g.startsWith("schemaValidation")).some(g=>{const m=I(this.state,g),p=I(u,g);return!le(m,p)});this.setState(u,()=>{o&&h&&o($t({...this.state,...u}),e)})}};onFocus=(e,n)=>{const{onFocus:r}=this.props;r&&r(e,n)};onSubmit=e=>{if(e.preventDefault(),e.target!==e.currentTarget)return;e.persist();const{omitExtraData:n,extraErrors:r,noValidate:i,onSubmit:s}=this.props;let{formData:a}=this.state;if(n===!0&&(a=this.omitExtraData(a)),i||this.validateFormWithFormData(a)){const o=r||{},l=r?Ji(r):[];this.setState({formData:a,errors:l,errorSchema:o,schemaValidationErrors:[],schemaValidationErrorSchema:{}},()=>{s&&s($t({...this.state,formData:a},"submitted"),e)})}};getGlobalFormOptions(e){const{uiSchema:n={},experimental_componentUpdateStrategy:r,idSeparator:i=aa,idPrefix:s=oa,nameGenerator:a,useFallbackUiForUnsupportedType:o=!1}=e;return{idPrefix:n["ui:rootFieldId"]||s,idSeparator:i,useFallbackUiForUnsupportedType:o,...r!==void 0&&{experimental_componentUpdateStrategy:r},...a!==void 0&&{nameGenerator:a}}}getRegistry(e,n,r){const{translateString:i,uiSchema:s={}}=e,{fields:a,templates:o,widgets:l,formContext:d,translateString:f}=Dv();return{fields:{...a,...e.fields},templates:{...o,...e.templates,ButtonTemplates:{...o.ButtonTemplates,...e.templates?.ButtonTemplates}},widgets:{...l,...e.widgets},rootSchema:n,formContext:e.formContext||d,schemaUtils:r,translateString:i||f,globalUiOptions:s[Kr],globalFormOptions:this.getGlobalFormOptions(e)}}submit=()=>{if(this.formElement.current){const e=new CustomEvent("submit",{cancelable:!0});e.preventDefault(),this.formElement.current.dispatchEvent(e),this.formElement.current.requestSubmit()}};focusOnError(e){const{idPrefix:n="root",idSeparator:r="_"}=this.props,{property:i}=e,s=Il(i);s[0]===""?s[0]=n:s.unshift(n);const a=s.join(r);let o=this.formElement.current.elements[a];o||(o=this.formElement.current.querySelector(`input[id^="${a}"`)),o&&o.length&&(o=o[0]),o&&o.focus()}validateFormWithFormData=e=>{const{extraErrors:n,extraErrorsBlockSubmit:r,focusOnFirstError:i,onError:s}=this.props,{errors:a}=this.state,o=this.validate(e);let l=o.errors,d=o.errorSchema;const f=l,u=d,h=l.length>0||n&&r;if(h){if(n){const g=Xn(o,n);d=g.errorSchema,l=g.errors}i&&(typeof i=="function"?i(l[0]):this.focusOnError(l[0])),this.setState({errors:l,errorSchema:d,schemaValidationErrors:f,schemaValidationErrorSchema:u},()=>{s?s(l):console.error("Form validation failed",l)})}else a.length>0&&this.setState({errors:[],errorSchema:{},schemaValidationErrors:[],schemaValidationErrorSchema:{}});return!h};validateForm(){const{omitExtraData:e}=this.props;let{formData:n}=this.state;return e===!0&&(n=this.omitExtraData(n)),this.validateFormWithFormData(n)}render(){const{children:e,id:n,className:r="",tagName:i,name:s,method:a,target:o,action:l,autoComplete:d,enctype:f,acceptCharset:u,noHtml5Validate:h=!1,disabled:g,readonly:m,showErrorList:p="top",_internalFormWrapper:y}=this.props,{schema:x,uiSchema:S,formData:j,errorSchema:b,fieldPathId:v,registry:w}=this.state,{SchemaField:O}=w.fields,{SubmitButton:A}=w.templates.ButtonTemplates,_=y?i:void 0,T=y||i||"form";let{[Qn]:N={}}=U(S);g&&(N={...N,props:{...N.props,disabled:!0}});const C={[ut]:{[Qn]:N}};return c.jsxs(T,{className:r||"rjsf",id:n,name:s,method:a,target:o,action:l,autoComplete:d,encType:f,acceptCharset:u,noValidate:h,onSubmit:this.onSubmit,as:_,ref:this.formElement,children:[p==="top"&&this.renderErrors(w),c.jsx(O,{name:"",schema:x,uiSchema:S,errorSchema:b,fieldPathId:v,formData:j,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,registry:w,disabled:g,readonly:m}),e||c.jsx(A,{uiSchema:C,registry:w}),p==="bottom"&&this.renderErrors(w)]})}};function kv(t){return P.forwardRef(({fields:e,widgets:n,templates:r,...i},s)=>(e={...t?.fields,...e},n={...t?.widgets,...n},r={...t?.templates,...r,ButtonTemplates:{...t?.templates?.ButtonTemplates,...r?.ButtonTemplates}},c.jsx($v,{...t,...i,fields:e,widgets:n,templates:r,ref:s})))}var Vn={exports:{}},Vr={},Mo;function Mv(){return Mo||(Mo=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0;function e(_,T){return{validate:_,compare:T}}t.fullFormats={date:e(s,a),time:e(l,d),"date-time":e(u,h),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:p,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:A,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:x,int32:{type:"number",validate:b},int64:{type:"number",validate:v},float:{type:"number",validate:w},double:{type:"number",validate:w},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:e(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,a),time:e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,d),"date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,h),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);function n(_){return _%4===0&&(_%100!==0||_%400===0)}const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(_){const T=r.exec(_);if(!T)return!1;const N=+T[1],C=+T[2],F=+T[3];return C>=1&&C<=12&&F>=1&&F<=(C===2&&n(N)?29:i[C])}function a(_,T){if(_&&T)return _>T?1:_<T?-1:0}const o=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function l(_,T){const N=o.exec(_);if(!N)return!1;const C=+N[1],F=+N[2],$=+N[3],E=N[5];return(C<=23&&F<=59&&$<=59||C===23&&F===59&&$===60)&&(!T||E!=="")}function d(_,T){if(!(_&&T))return;const N=o.exec(_),C=o.exec(T);if(N&&C)return _=N[1]+N[2]+N[3]+(N[4]||""),T=C[1]+C[2]+C[3]+(C[4]||""),_>T?1:_<T?-1:0}const f=/t|\s/i;function u(_){const T=_.split(f);return T.length===2&&s(T[0])&&l(T[1],!0)}function h(_,T){if(!(_&&T))return;const[N,C]=_.split(f),[F,$]=T.split(f),E=a(N,F);if(E!==void 0)return E||d(C,$)}const g=/\/|:/,m=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function p(_){return g.test(_)&&m.test(_)}const y=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function x(_){return y.lastIndex=0,y.test(_)}const S=-2147483648,j=2**31-1;function b(_){return Number.isInteger(_)&&_<=j&&_>=S}function v(_){return Number.isInteger(_)}function w(){return!0}const O=/[^\\]\\Z/;function A(_){if(O.test(_))return!1;try{return new RegExp(_),!0}catch{return!1}}})(Vr)),Vr}var zr={},Ro;function Rv(){return Ro||(Ro=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;const e=ou(),n=Yo(),r=n.operators,i={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},s={message:({keyword:o,schemaCode:l})=>n.str`should be ${i[o].okStr} ${l}`,params:({keyword:o,schemaCode:l})=>n._`{comparison: ${i[o].okStr}, limit: ${l}}`};t.formatLimitDefinition={keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:s,code(o){const{gen:l,data:d,schemaCode:f,keyword:u,it:h}=o,{opts:g,self:m}=h;if(!g.validateFormats)return;const p=new e.KeywordCxt(h,m.RULES.all.format.definition,"format");p.$data?y():x();function y(){const j=l.scopeValue("formats",{ref:m.formats,code:g.code.formats}),b=l.const("fmt",n._`${j}[${p.schemaCode}]`);o.fail$data(n.or(n._`typeof ${b} != "object"`,n._`${b} instanceof RegExp`,n._`typeof ${b}.compare != "function"`,S(b)))}function x(){const j=p.schema,b=m.formats[j];if(!b||b===!0)return;if(typeof b!="object"||b instanceof RegExp||typeof b.compare!="function")throw new Error(`"${u}": format "${j}" does not define "compare" function`);const v=l.scopeValue("formats",{key:j,ref:b,code:g.code.formats?n._`${g.code.formats}${n.getProperty(j)}`:void 0});o.fail$data(S(v))}function S(j){return n._`${j}.compare(${d}, ${f}) ${i[u].fail} 0`}},dependencies:["format"]};const a=o=>(o.addKeyword(t.formatLimitDefinition),o);t.default=a})(zr)),zr}var Bo;function Bv(){return Bo||(Bo=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const n=Mv(),r=Rv(),i=Yo(),s=new i.Name("fullFormats"),a=new i.Name("fastFormats"),o=(d,f={keywords:!0})=>{if(Array.isArray(f))return l(d,f,n.fullFormats,s),d;const[u,h]=f.mode==="fast"?[n.fastFormats,a]:[n.fullFormats,s],g=f.formats||n.formatNames;return l(d,g,u,h),f.keywords&&r.default(d),d};o.get=(d,f="full")=>{const h=(f==="fast"?n.fastFormats:n.fullFormats)[d];if(!h)throw new Error(`Unknown format "${d}"`);return h};function l(d,f,u,h){var g,m;(g=(m=d.opts.code).formats)!==null&&g!==void 0||(m.formats=i._`require("ajv-formats/dist/formats").${h}`);for(const p of f)d.addFormat(p,u[p])}t.exports=e=o,Object.defineProperty(e,"__esModule",{value:!0}),e.default=o})(Vn,Vn.exports)),Vn.exports}var Uv=Bv();const Uo=di(Uv),Lv={allErrors:!0,multipleOfPrecision:8,strict:!1,verbose:!0,discriminator:!1},Wv=/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,Vv=/^data:([a-z]+\/[a-z0-9-+.]+)?;(?:name=(.*);)?base64,(.*)$/;function zv(t,e,n={},r,i=au,s){let a=new i({...Lv,...n});return r?Uo(a,r):r!==!1&&Uo(a),a.addFormat("data-url",Vv),a.addFormat("color",Wv),a.addKeyword(Qe),a.addKeyword(vi),Array.isArray(t)&&a.addMetaSchema(t),Z(e)&&Object.keys(e).forEach(o=>{a.addFormat(o,e[o])}),s&&(a=s(a)),a}function qv(t=[],e){return t.map(r=>{var i;const{instancePath:s,keyword:a,params:o,schemaPath:l,parentSchema:d,...f}=r;let{message:u=""}=f,h=s.replace(/\//g,"."),g=`${h} ${u}`.trim(),m="";const p=[...((i=o.deps)===null||i===void 0?void 0:i.split(", "))||[],o.missingProperty,o.property].filter(y=>y);if(p.length>0)p.forEach(y=>{const x=h?`${h}.${y}`:y;let S=U(I(e,`${x.replace(/^\./,"")}`)).title;if(S===void 0){const j=l.replace(/\/properties\//g,"/").split("/").slice(1,-1).concat([y]);S=U(I(e,j)).title}if(S)u=u.replace(`'${y}'`,`'${S}'`),m=S;else{const j=I(d,[te,y,"title"]);j&&(u=u.replace(`'${y}'`,`'${j}'`),m=j)}}),g=u;else{const y=U(I(e,`${h.replace(/^\./,"")}`)).title;if(y)g=`'${y}' ${u}`.trim(),m=y;else{const x=d?.title;x&&(g=`'${x}' ${u}`.trim(),m=x)}}return"missingProperty"in o&&(h=h?`${h}.${o.missingProperty}`:o.missingProperty),{name:a,property:h,message:u,params:o,stack:g,schemaPath:l,title:m}}).reduce((r,i)=>{const{message:s,schemaPath:a}=i,o=a?.indexOf(`/${J}/`),l=a?.indexOf(`/${q}/`);let d;return o&&o>=0?d=a?.substring(0,o):l&&l>=0&&(d=a?.substring(0,l)),d&&r.find(u=>{var h;return u.message===s&&((h=u.schemaPath)===null||h===void 0?void 0:h.startsWith(d))})||r.push(i),r},[])}function Kv(t,e,n,r,i,s,a){const{validationError:o}=e;let l=qv(e.errors,a);o&&(l=[...l,{stack:o.message}]),typeof s=="function"&&(l=s(l,a));let d=Sx(l);if(o&&(d={...d,$schema:{__errors:[o.message]}}),typeof i!="function")return{errors:l,errorSchema:d};const f=pl(t,r,n,r,!0),u=i(f,Gr(f),a,d),h=Dl(u);return Xn({errors:l,errorSchema:d},h)}class Gv{constructor(e,n){const{additionalMetaSchemas:r,customFormats:i,ajvOptionsOverrides:s,ajvFormatOptions:a,AjvClass:o,extenderFn:l}=e;this.ajv=zv(r,i,s,a,o,l),this.localizer=n}reset(){this.ajv.removeSchema()}rawValidation(e,n){var r,i;let s,a;try{e[oe]&&(a=this.ajv.getSchema(e[oe])),a===void 0&&(a=this.ajv.compile(e)),a(n)}catch(l){s=l}let o;return a&&(typeof this.localizer=="function"&&(((r=a.errors)!==null&&r!==void 0?r:[]).forEach(l=>{var d;["missingProperty","property"].forEach(f=>{var u;!((u=l.params)===null||u===void 0)&&u[f]&&(l.params[f]=`'${l.params[f]}'`)}),!((d=l.params)===null||d===void 0)&&d.deps&&(l.params.deps=l.params.deps.split(", ").map(f=>`'${f}'`).join(", "))}),this.localizer(a.errors),((i=a.errors)!==null&&i!==void 0?i:[]).forEach(l=>{var d;["missingProperty","property"].forEach(f=>{var u;!((u=l.params)===null||u===void 0)&&u[f]&&(l.params[f]=l.params[f].slice(1,-1))}),!((d=l.params)===null||d===void 0)&&d.deps&&(l.params.deps=l.params.deps.split(", ").map(f=>f.slice(1,-1)).join(", "))})),o=a.errors||void 0,a.errors=null),{errors:o,validationError:s}}validateFormData(e,n,r,i,s){const a=this.rawValidation(n,e);return Kv(this,a,e,n,r,i,s)}handleSchemaUpdate(e){var n,r;const i=(n=e[oe])!==null&&n!==void 0?n:la;this.ajv.getSchema(i)===void 0?this.ajv.addSchema(e,i):le(e,(r=this.ajv.getSchema(i))===null||r===void 0?void 0:r.schema)||(this.ajv.removeSchema(i),this.ajv.addSchema(e,i))}isValid(e,n,r){var i;try{this.handleSchemaUpdate(r);const s=Zi(e),a=(i=s[oe])!==null&&i!==void 0?i:gx(s);let o;return o=this.ajv.getSchema(a),o===void 0&&(o=this.ajv.addSchema(s,a).getSchema(a)||this.ajv.compile(s)),o(n)}catch(s){return console.warn("Error encountered compiling schema:",s),!1}}}function Hv(t={},e){return new Gv(t,e)}const Yv=Hv();const Xv=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Jv=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase()),Lo=t=>{const e=Jv(t);return e.charAt(0).toUpperCase()+e.slice(1)},Zl=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim(),Zv=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var Qv={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const e1=P.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...o},l)=>P.createElement("svg",{ref:l,...Qv,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:Zl("lucide",i),...!s&&!Zv(o)&&{"aria-hidden":"true"},...o},[...a.map(([d,f])=>P.createElement(d,f)),...Array.isArray(s)?s:[s]]));const Xe=(t,e)=>{const n=P.forwardRef(({className:r,...i},s)=>P.createElement(e1,{ref:s,iconNode:e,className:Zl(`lucide-${Xv(Lo(t))}`,`lucide-${t}`,r),...i}));return n.displayName=Lo(t),n};const t1=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],n1=Xe("check",t1);const r1=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ql=Xe("chevron-down",r1);const i1=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],s1=Xe("chevron-up",i1);const o1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],a1=Xe("circle-alert",o1);const l1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],ec=Xe("circle-plus",l1);const c1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],u1=Xe("circle",c1);const d1=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],f1=Xe("copy",d1);const m1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],h1=Xe("search",m1);const p1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],g1=Xe("trash-2",p1);const y1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],tc=Xe("x",y1);function G(...t){return Pc(Ec(t))}const x1=fi("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",xs:"h-6 rounded-md gap-1 px-2 has-[>svg]:px-2",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function ss({className:t,variant:e,size:n,asChild:r=!1,...i}){const s=r?zo:"button";return c.jsx(s,{"data-slot":"button",className:G(x1({variant:e,size:n,className:t})),...i})}function b1({uiSchema:t,registry:e,className:n,...r}){const{translateString:i}=e;return c.jsx("div",{className:"p-0 m-0",children:c.jsxs(ss,{...r,className:G("w-fit gap-2",n),variant:"outline",type:"button",children:[c.jsx(ec,{size:16})," ",i(K.AddItemButton)]})})}function v1(t){const{children:e,buttonsProps:n,displayLabel:r,hasDescription:i,hasToolbar:s,uiSchema:a,registry:o}=t,l=U(a),d=L("ArrayFieldItemButtonsTemplate",o,l),f=i?-6:22;return c.jsx("div",{children:c.jsxs("div",{className:"mb-2 flex flex-row flex-wrap items-center",children:[c.jsx("div",{className:"grow shrink",children:e}),c.jsx("div",{className:"flex items-end justify-end p-0.5",children:s&&c.jsx("div",{className:"flex gap-2",style:{marginLeft:"5px",marginTop:r?`${f}px`:void 0},children:c.jsx(d,{...n})})})]})})}function S1(t){const{canAdd:e,disabled:n,fieldPathId:r,uiSchema:i,items:s,optionalDataControl:a,onAddClick:o,readonly:l,registry:d,required:f,schema:u,title:h}=t,g=U(i),m=L("ArrayFieldDescriptionTemplate",d,g),p=L("ArrayFieldTitleTemplate",d,g),y=!l&&!n,{ButtonTemplates:{AddButton:x}}=d.templates;return c.jsx("div",{children:c.jsx("div",{className:"m-0 flex p-0",children:c.jsxs("div",{className:"m-0 w-full p-0",children:[c.jsx(p,{fieldPathId:r,title:g.title||h,schema:u,uiSchema:i,required:f,registry:d,optionalDataControl:y?a:void 0}),c.jsx(m,{fieldPathId:r,description:g.description||u.description,schema:u,uiSchema:i,registry:d}),c.jsxs("div",{className:"p-0 m-0 w-full mb-2",children:[y?void 0:a,s,e&&c.jsx("div",{className:"mt-2 flex justify-end",children:c.jsx(x,{id:qe(r,"add"),className:"rjsf-array-item-add",onClick:o,disabled:n||l,uiSchema:i,registry:d})})]},`array-item-list-${r.$id}`)]})})})}function nc({className:t,type:e,...n}){return c.jsx("input",{type:e,"data-slot":"input",className:G("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...n})}function w1({id:t,htmlName:e,placeholder:n,required:r,readonly:i,disabled:s,type:a,value:o,onChange:l,onChangeOverride:d,onBlur:f,onFocus:u,autofocus:h,options:g,schema:m,rawErrors:p=[],children:y,extraProps:x,className:S,registry:j}){const{ClearButton:b}=j.templates.ButtonTemplates,v={...x,...Nl(m,a,g)},w=({target:{value:T}})=>l(T===""?g.emptyValue:T),O=({target:T})=>f(t,T&&T.value),A=({target:T})=>u(t,T&&T.value),_=P.useCallback(T=>{var N;T.preventDefault(),T.stopPropagation(),l((N=g.emptyValue)!==null&&N!==void 0?N:"")},[l,g.emptyValue]);return c.jsxs("div",{className:"p-0.5",children:[c.jsx(nc,{id:t,name:e||t,type:a,placeholder:n,autoFocus:h,required:r,disabled:s,readOnly:i,className:G({"border-destructive focus-visible:ring-0":p.length>0},S),list:m.examples?Cn(t):void 0,...v,value:o||o===0?o:"",onChange:d||w,onBlur:O,onFocus:A,"aria-describedby":we(t,!!m.examples)}),g.allowClearTextInputs&&!i&&!s&&o&&c.jsx(b,{onClick:_,registry:j}),y,Array.isArray(m.examples)?c.jsx("datalist",{id:Cn(t),children:m.examples.concat(m.default&&!m.examples.includes(m.default)?[m.default]:[]).map(T=>c.jsx("option",{value:T},T))}):null]})}function j1({id:t,description:e,registry:n,uiSchema:r}){return e?c.jsx("div",{children:c.jsx("div",{id:t,className:"text-sm text-muted-foreground",children:c.jsx(rs,{description:e,registry:n,uiSchema:r})})}):null}const O1=fi("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function A1({className:t,variant:e,...n}){return c.jsx("div",{"data-slot":"alert",role:"alert",className:G(O1({variant:e}),t),...n})}function _1({className:t,...e}){return c.jsx("div",{"data-slot":"alert-title",className:G("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...e})}function C1({className:t,...e}){return c.jsx("div",{"data-slot":"alert-description",className:G("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...e})}function N1({errors:t,registry:e}){const{translateString:n}=e;return c.jsxs(A1,{variant:"destructive",className:"mb-2",children:[c.jsx(a1,{className:"h-4 w-4"}),c.jsx(_1,{children:n(K.ErrorsLabel)}),c.jsx(C1,{className:"flex flex-col gap-1",children:t.map((r,i)=>c.jsxs("span",{children:["• ",r.stack]},i))})]})}function T1(t){const{errors:e=[],fieldPathId:n}=t;if(e.length===0)return null;const r=Hi(n);return c.jsx("div",{className:"flex flex-col gap-1",id:r,children:e.map((i,s)=>c.jsx("span",{className:"text-xs font-medium text-destructive mb-1",children:i},s))})}function F1(t){const{fieldPathId:e,help:n,uiSchema:r,registry:i,hasErrors:s}=t;return n?c.jsx("span",{className:G("text-xs font-medium text-muted-foreground",{"text-destructive":s}),id:Yi(e),children:c.jsx(is,{help:n,registry:i,uiSchema:r})}):null}function P1({id:t,children:e,displayLabel:n,rawErrors:r=[],errors:i,help:s,description:a,rawDescription:o,classNames:l,style:d,disabled:f,label:u,hidden:h,onKeyRename:g,onKeyRenameBlur:m,onRemoveProperty:p,readonly:y,required:x,schema:S,uiSchema:j,registry:b}){const v=U(j),w=L("WrapIfAdditionalTemplate",b,v);if(h)return c.jsx("div",{className:"hidden",children:e});const O=v.widget==="checkbox";return c.jsx(w,{classNames:l,style:d,disabled:f,id:t,label:u,displayLabel:n,onKeyRename:g,onKeyRenameBlur:m,onRemoveProperty:p,rawDescription:o,readonly:y,required:x,schema:S,uiSchema:j,registry:b,children:c.jsxs("div",{className:"flex flex-col gap-2",children:[n&&!O&&c.jsxs("label",{className:G("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{" text-destructive":r.length>0}),htmlFor:t,children:[u,x?"*":null]}),e,n&&o&&!O&&c.jsx("span",{className:G("text-xs font-medium text-muted-foreground",{" text-destructive":r.length>0}),children:a}),i,s]})})}function E1(t){const{children:e,column:n,className:r,...i}=t;return c.jsx("div",{className:G("grid gap-2",r),...i,children:e})}function en(t){const{icon:e,iconType:n,className:r,uiSchema:i,registry:s,...a}=t;return c.jsx(ss,{size:"icon",variant:"outline",className:r,...a,type:"button",children:e})}function I1(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.CopyButton),...t,icon:c.jsx(f1,{className:"h-4 w-4"})})}function D1(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.MoveDownButton),...t,icon:c.jsx(Ql,{className:"h-4 w-4"})})}function $1(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.MoveUpButton),...t,icon:c.jsx(s1,{className:"h-4 w-4"})})}function rc(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.RemoveButton),...t,className:"border-destructive",icon:c.jsx(g1,{className:"h-4 w-4 stroke-destructive"})})}function k1(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.ClearButton),...t,icon:c.jsx(tc,{})})}function M1({selector:t,optionSchemaField:e}){return c.jsxs("div",{className:G("p-4 border rounded-md bg-background shadow-sm"),children:[c.jsx("div",{className:G("mb-4"),children:t}),e]})}function R1({description:t,title:e,properties:n,required:r,uiSchema:i,fieldPathId:s,schema:a,formData:o,optionalDataControl:l,onAddProperty:d,disabled:f,readonly:u,registry:h}){const g=U(i),m=L("TitleFieldTemplate",h,g),p=L("DescriptionFieldTemplate",h,g),y=!u&&!f,{ButtonTemplates:{AddButton:x}}=h.templates;return c.jsxs(c.Fragment,{children:[e&&c.jsx(m,{id:hr(s),title:e,required:r,schema:a,uiSchema:i,registry:h,optionalDataControl:y?l:void 0}),t&&c.jsx(p,{id:Et(s),description:t,schema:a,uiSchema:i,registry:h}),c.jsxs("div",{className:"flex flex-col gap-2",children:[y?void 0:l,n.map((S,j)=>c.jsx("div",{className:`${S.hidden?"hidden":""} flex`,children:c.jsx("div",{className:"w-full",children:S.content})},j)),ca(a,i,o)?c.jsx("div",{className:"mt-2 flex justify-end",children:c.jsx(x,{id:qe(s,"add"),onClick:d,disabled:f||u,className:"rjsf-object-property-expand",uiSchema:i,registry:h})}):null]})]})}function B1(t){const{id:e,registry:n,label:r,onAddClick:i,onRemoveClick:s}=t;return i?c.jsx(en,{id:e,registry:n,className:"rjsf-add-optional-data",onClick:i,title:r,icon:c.jsx(ec,{}),size:"xs"}):s?c.jsx(rc,{id:e,registry:n,className:"rjsf-remove-optional-data",onClick:s,title:r,size:"xs"}):c.jsx("em",{id:e,children:r})}function U1(t){const{submitText:e,norender:n,props:r}=Tl(t.uiSchema);return n?null:c.jsx("div",{children:c.jsx(ss,{type:"submit",...r,className:G("my-2",r?.className),children:e})})}function ic({className:t,orientation:e="horizontal",decorative:n=!0,...r}){return c.jsx(Ic,{"data-slot":"separator",decorative:n,orientation:e,className:G("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...r})}function L1({id:t,title:e,uiSchema:n,optionalDataControl:r}){const i=U(n);let s=c.jsx("h5",{children:i.title||e});return r&&(s=c.jsxs("div",{className:"flex flex-row",children:[c.jsx("div",{className:"flex-grow",children:s}),c.jsx("div",{className:"flex",children:r})]})),c.jsxs("div",{id:t,className:"my-1 flex flex-col gap-0.5",children:[s,c.jsx(ic,{dir:"horizontal",style:{height:"1px"},className:"my-1"})]})}function W1({classNames:t,style:e,children:n,disabled:r,id:i,label:s,displayLabel:a,onRemoveProperty:o,onKeyRenameBlur:l,rawDescription:d,readonly:f,required:u,schema:h,uiSchema:g,registry:m}){const{templates:p,translateString:y}=m,{RemoveButton:x}=p.ButtonTemplates,S=y(K.KeyLabel,[s]);if(!(Qe in h))return c.jsx("div",{className:t,style:e,children:n});const v=a?22+(d?-28:0):0,w=`${i}-key`;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`grid grid-cols-12 col-span-12 items-center gap-2 ${t}`,style:e,children:[c.jsx("div",{className:"grid gap-2 col-span-5",children:c.jsxs("div",{className:"flex flex-col gap-2",children:[a&&c.jsx("label",{htmlFor:w,className:"text-sm font-medium text-muted-foreground leading-none",children:S}),c.jsx("div",{className:"pl-0.5",children:c.jsx(nc,{required:u,defaultValue:s,disabled:r||f,id:w,name:w,onBlur:f?void 0:l,type:"text",className:"w-full border shadow-sm"})}),!!d&&c.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c.jsx("div",{className:"text-sm text-muted-foreground",children:" "})})]})}),c.jsx("div",{className:"grid gap-2 col-span-6 pr-0.5",children:n}),c.jsx("div",{className:"grid gap-2 col-span-1",style:{marginTop:`${v}px`},children:c.jsx(x,{id:qe(i,"remove"),iconType:"block",className:"rjsf-object-property-remove w-full",disabled:r||f,onClick:o,uiSchema:g,registry:m})})]}),c.jsx(ic,{dir:"horizontal",className:"mt-2"})]})}function V1(){return{ArrayFieldItemTemplate:v1,ArrayFieldTemplate:S1,BaseInputTemplate:w1,ButtonTemplates:{AddButton:b1,CopyButton:I1,MoveDownButton:D1,MoveUpButton:$1,RemoveButton:rc,SubmitButton:U1,ClearButton:k1},DescriptionFieldTemplate:j1,ErrorListTemplate:N1,FieldErrorTemplate:T1,FieldHelpTemplate:F1,FieldTemplate:P1,GridTemplate:E1,MultiSchemaFieldTemplate:M1,ObjectFieldTemplate:R1,OptionalDataControlsTemplate:B1,TitleFieldTemplate:L1,WrapIfAdditionalTemplate:W1}}function z1(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var q1=["color"],K1=P.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,i=z1(t,q1);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:e}),P.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});function sc({className:t,...e}){return c.jsx(Dc,{"data-slot":"checkbox",className:G("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:c.jsx($c,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:c.jsx(K1,{className:"size-3.5"})})})}function os({className:t,...e}){return c.jsx(kc,{"data-slot":"label",className:G("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...e})}function G1(t){const{id:e,htmlName:n,value:r,disabled:i,readonly:s,label:a,hideLabel:o,schema:l,autofocus:d,options:f,onChange:u,onBlur:h,onFocus:g,registry:m,uiSchema:p,className:y}=t,x=hn(l),S=L("DescriptionFieldTemplate",m,f),j=O=>u(O),b=()=>h(e,r),v=()=>g(e,r),w=f.description||l.description;return c.jsxs("div",{className:`relative ${i||s?"cursor-not-allowed opacity-50":""}`,"aria-describedby":we(e),children:[!o&&w&&c.jsx(S,{id:Et(e),description:w,schema:l,uiSchema:p,registry:m}),c.jsxs("div",{className:"flex items-center gap-2 my-2",children:[c.jsx(sc,{id:e,name:n||e,checked:typeof r>"u"?!1:!!r,required:x,disabled:i||s,autoFocus:d,onCheckedChange:j,onBlur:b,onFocus:v,className:y}),c.jsx(os,{className:"leading-tight",htmlFor:e,children:Pl(a,o||!a)})]})]})}function H1({id:t,htmlName:e,disabled:n,options:r,value:i,autofocus:s,readonly:a,required:o,onChange:l,onBlur:d,onFocus:f,className:u}){const{enumOptions:h,enumDisabled:g,inline:m,emptyValue:p}=r,y=Array.isArray(i)?i:[i],x=({target:j})=>d(t,ge(j&&j.value,h,p)),S=({target:j})=>f(t,ge(j&&j.value,h,p));return c.jsx("div",{className:G({"flex flex-col gap-2":!m,"flex flex-row gap-4 flex-wrap":m}),children:Array.isArray(h)&&h.map((j,b)=>{const v=kn(j.value,y),w=Array.isArray(g)&&g.indexOf(j.value)!==-1,O=wt(t,b);return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(sc,{id:O,name:e||t,required:o,disabled:n||w||a,onCheckedChange:A=>{l(A?Al(b,y,h):jl(b,y,h))},className:u,checked:v,autoFocus:s&&b===0,onBlur:x,onFocus:S,"aria-describedby":we(t)}),c.jsx(os,{className:"leading-tight",htmlFor:wt(t,b),children:j.label})]},O)})})}function Y1({className:t,...e}){return c.jsx(Su,{"data-slot":"radio-group",className:G("grid gap-3",t),...e})}function X1({className:t,...e}){return c.jsx(wu,{"data-slot":"radio-group-item",className:G("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:c.jsx(ju,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:c.jsx(u1,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function J1({id:t,options:e,value:n,required:r,disabled:i,readonly:s,onChange:a,onBlur:o,onFocus:l,className:d}){const{enumOptions:f,enumDisabled:u,emptyValue:h}=e,g=x=>a(ge(x,f,h)),m=({target:x})=>o(t,ge(x&&x.value,f,h)),p=({target:x})=>l(t,ge(x&&x.value,f,h)),y=!!(e&&e.inline);return c.jsx("div",{className:"mb-0",children:c.jsx(Y1,{defaultValue:n?.toString(),required:r,disabled:i||s,onValueChange:x=>{g(x)},onBlur:m,onFocus:p,"aria-describedby":we(t),orientation:y?"horizontal":"vertical",className:G("flex flex-wrap",{"flex-col":!y},d),children:Array.isArray(f)&&f.map((x,S)=>{const j=Array.isArray(u)&&u.indexOf(x.value)!==-1,b=kn(x.value,n);return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(X1,{checked:b,value:S.toString(),id:wt(t,S),disabled:j}),c.jsx(os,{className:"leading-tight",htmlFor:wt(t,S),children:x.label})]},wt(t,S))})})})}var oc=["PageUp","PageDown"],ac=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],lc={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},tn="Slider",[ai,Z1,Q1]=Bc(tn),[cc]=Rc(tn,[Q1]),[eS,yr]=cc(tn),uc=P.forwardRef((t,e)=>{const{name:n,min:r=0,max:i=100,step:s=1,orientation:a="horizontal",disabled:o=!1,minStepsBetweenThumbs:l=0,defaultValue:d=[r],value:f,onValueChange:u=()=>{},onValueCommit:h=()=>{},inverted:g=!1,form:m,...p}=t,y=P.useRef(new Set),x=P.useRef(0),j=a==="horizontal"?tS:nS,[b=[],v]=Mc({prop:f,defaultProp:d,onChange:N=>{[...y.current][x.current]?.focus(),u(N)}}),w=P.useRef(b);function O(N){const C=aS(b,N);T(N,C)}function A(N){T(N,x.current)}function _(){const N=w.current[x.current];b[x.current]!==N&&h(b)}function T(N,C,{commit:F}={commit:!1}){const $=dS(s),E=fS(Math.round((N-r)/s)*s+r,$),D=ta(E,[r,i]);v((M=[])=>{const k=sS(M,D,C);if(uS(k,l*s)){x.current=k.indexOf(D);const B=String(k)!==String(M);return B&&F&&h(k),B?k:M}else return M})}return c.jsx(eS,{scope:t.__scopeSlider,name:n,disabled:o,min:r,max:i,valueIndexToChangeRef:x,thumbs:y.current,values:b,orientation:a,form:m,children:c.jsx(ai.Provider,{scope:t.__scopeSlider,children:c.jsx(ai.Slot,{scope:t.__scopeSlider,children:c.jsx(j,{"aria-disabled":o,"data-disabled":o?"":void 0,...p,ref:e,onPointerDown:Rt(p.onPointerDown,()=>{o||(w.current=b)}),min:r,max:i,inverted:g,onSlideStart:o?void 0:O,onSlideMove:o?void 0:A,onSlideEnd:o?void 0:_,onHomeKeyDown:()=>!o&&T(r,0,{commit:!0}),onEndKeyDown:()=>!o&&T(i,b.length-1,{commit:!0}),onStepKeyDown:({event:N,direction:C})=>{if(!o){const E=oc.includes(N.key)||N.shiftKey&&ac.includes(N.key)?10:1,D=x.current,M=b[D],k=s*E*C;T(M+k,D,{commit:!0})}}})})})})});uc.displayName=tn;var[dc,fc]=cc(tn,{startEdge:"left",endEdge:"right",size:"width",direction:1}),tS=P.forwardRef((t,e)=>{const{min:n,max:r,dir:i,inverted:s,onSlideStart:a,onSlideMove:o,onSlideEnd:l,onStepKeyDown:d,...f}=t,[u,h]=P.useState(null),g=Yt(e,j=>h(j)),m=P.useRef(void 0),p=Uc(i),y=p==="ltr",x=y&&!s||!y&&s;function S(j){const b=m.current||u.getBoundingClientRect(),v=[0,b.width],O=as(v,x?[n,r]:[r,n]);return m.current=b,O(j-b.left)}return c.jsx(dc,{scope:t.__scopeSlider,startEdge:x?"left":"right",endEdge:x?"right":"left",direction:x?1:-1,size:"width",children:c.jsx(mc,{dir:p,"data-orientation":"horizontal",...f,ref:g,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:j=>{const b=S(j.clientX);a?.(b)},onSlideMove:j=>{const b=S(j.clientX);o?.(b)},onSlideEnd:()=>{m.current=void 0,l?.()},onStepKeyDown:j=>{const v=lc[x?"from-left":"from-right"].includes(j.key);d?.({event:j,direction:v?-1:1})}})})}),nS=P.forwardRef((t,e)=>{const{min:n,max:r,inverted:i,onSlideStart:s,onSlideMove:a,onSlideEnd:o,onStepKeyDown:l,...d}=t,f=P.useRef(null),u=Yt(e,f),h=P.useRef(void 0),g=!i;function m(p){const y=h.current||f.current.getBoundingClientRect(),x=[0,y.height],j=as(x,g?[r,n]:[n,r]);return h.current=y,j(p-y.top)}return c.jsx(dc,{scope:t.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:c.jsx(mc,{"data-orientation":"vertical",...d,ref:u,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:p=>{const y=m(p.clientY);s?.(y)},onSlideMove:p=>{const y=m(p.clientY);a?.(y)},onSlideEnd:()=>{h.current=void 0,o?.()},onStepKeyDown:p=>{const x=lc[g?"from-bottom":"from-top"].includes(p.key);l?.({event:p,direction:x?-1:1})}})})}),mc=P.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:s,onHomeKeyDown:a,onEndKeyDown:o,onStepKeyDown:l,...d}=t,f=yr(tn,n);return c.jsx(Nn.span,{...d,ref:e,onKeyDown:Rt(t.onKeyDown,u=>{u.key==="Home"?(a(u),u.preventDefault()):u.key==="End"?(o(u),u.preventDefault()):oc.concat(ac).includes(u.key)&&(l(u),u.preventDefault())}),onPointerDown:Rt(t.onPointerDown,u=>{const h=u.target;h.setPointerCapture(u.pointerId),u.preventDefault(),f.thumbs.has(h)?h.focus():r(u)}),onPointerMove:Rt(t.onPointerMove,u=>{u.target.hasPointerCapture(u.pointerId)&&i(u)}),onPointerUp:Rt(t.onPointerUp,u=>{const h=u.target;h.hasPointerCapture(u.pointerId)&&(h.releasePointerCapture(u.pointerId),s(u))})})}),hc="SliderTrack",pc=P.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=yr(hc,n);return c.jsx(Nn.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:e})});pc.displayName=hc;var li="SliderRange",gc=P.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=yr(li,n),s=fc(li,n),a=P.useRef(null),o=Yt(e,a),l=i.values.length,d=i.values.map(h=>bc(h,i.min,i.max)),f=l>1?Math.min(...d):0,u=100-Math.max(...d);return c.jsx(Nn.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:o,style:{...t.style,[s.startEdge]:f+"%",[s.endEdge]:u+"%"}})});gc.displayName=li;var ci="SliderThumb",yc=P.forwardRef((t,e)=>{const n=Z1(t.__scopeSlider),[r,i]=P.useState(null),s=Yt(e,o=>i(o)),a=P.useMemo(()=>r?n().findIndex(o=>o.ref.current===r):-1,[n,r]);return c.jsx(rS,{...t,ref:s,index:a})}),rS=P.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:i,...s}=t,a=yr(ci,n),o=fc(ci,n),[l,d]=P.useState(null),f=Yt(e,S=>d(S)),u=l?a.form||!!l.closest("form"):!0,h=Lc(l),g=a.values[r],m=g===void 0?0:bc(g,a.min,a.max),p=oS(r,a.values.length),y=h?.[o.size],x=y?lS(y,m,o.direction):0;return P.useEffect(()=>{if(l)return a.thumbs.add(l),()=>{a.thumbs.delete(l)}},[l,a.thumbs]),c.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[o.startEdge]:`calc(${m}% + ${x}px)`},children:[c.jsx(ai.ItemSlot,{scope:t.__scopeSlider,children:c.jsx(Nn.span,{role:"slider","aria-label":t["aria-label"]||p,"aria-valuemin":a.min,"aria-valuenow":g,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...s,ref:f,style:g===void 0?{display:"none"}:t.style,onFocus:Rt(t.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),u&&c.jsx(xc,{name:i??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:g},r)]})});yc.displayName=ci;var iS="RadioBubbleInput",xc=P.forwardRef(({__scopeSlider:t,value:e,...n},r)=>{const i=P.useRef(null),s=Yt(i,r),a=Wc(e);return P.useEffect(()=>{const o=i.current;if(!o)return;const l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==e&&f){const u=new Event("input",{bubbles:!0});f.call(o,e),o.dispatchEvent(u)}},[a,e]),c.jsx(Nn.input,{style:{display:"none"},...n,ref:s,defaultValue:e})});xc.displayName=iS;function sS(t=[],e,n){const r=[...t];return r[n]=e,r.sort((i,s)=>i-s)}function bc(t,e,n){const s=100/(n-e)*(t-e);return ta(s,[0,100])}function oS(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function aS(t,e){if(t.length===1)return 0;const n=t.map(i=>Math.abs(i-e)),r=Math.min(...n);return n.indexOf(r)}function lS(t,e,n){const r=t/2,s=as([0,50],[0,r]);return(r-s(e)*n)*n}function cS(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function uS(t,e){if(e>0){const n=cS(t);return Math.min(...n)>=e}return!0}function as(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function dS(t){return(String(t).split(".")[1]||"").length}function fS(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var mS=uc,hS=pc,pS=gc,gS=yc;function yS({className:t,defaultValue:e,value:n,min:r=0,max:i=100,...s}){const a=P.useMemo(()=>Array.isArray(n)?n:Array.isArray(e)?e:[r,i],[n,e,r,i]);return c.jsxs(mS,{"data-slot":"slider",defaultValue:e,value:n,min:r,max:i,className:G("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",t),...s,children:[c.jsx(hS,{"data-slot":"slider-track",className:G("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:c.jsx(pS,{"data-slot":"slider-range",className:G("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:a.length},(o,l)=>c.jsx(gS,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},l))]})}const xS=["name","min","max","step","orientation","disabled","defaultValue","value","onValueChange","className","dir","inverted","minStepsBetweenThumbs"];function bS({value:t,readonly:e,disabled:n,options:r,schema:i,onChange:s,label:a,id:o}){const l=u=>s(u[0]),d={...Cl(i)},f={id:o,...qi(r.props||{},xS)};return c.jsxs(c.Fragment,{children:[c.jsx(yS,{disabled:n||e,min:d.min,max:d.max,step:d.step,value:[t],onValueChange:l,...f,"aria-describedby":we(o)}),t]})}const vS=fi("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function SS({className:t,variant:e,asChild:n=!1,...r}){const i=n?zo:"span";return c.jsx(i,{"data-slot":"badge",className:G(vS({variant:e}),t),...r})}const vc=P.forwardRef(({className:t,...e},n)=>c.jsx(_t,{ref:n,"data-slot":"command",className:G("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),...e})),wS=P.forwardRef(({className:t,...e},n)=>c.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[c.jsx(h1,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),c.jsx(_t.Input,{ref:n,className:G("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...e})]}));wS.displayName=_t.Input.displayName;function Sc({className:t,...e}){return c.jsx(_t.List,{"data-slot":"command-list",className:G("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),...e})}function wc({className:t,...e}){return c.jsx(_t.Group,{"data-slot":"command-group",className:G("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),...e})}function jc({className:t,...e}){return c.jsx(_t.Item,{"data-slot":"command-item",className:G("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...e})}function jS({multiple:t,items:e=[],selected:n,onValueChange:r,autoFocus:i=!1,disabled:s=!1,ariaDescribedby:a,ariaPlaceholder:o,onFocus:l,onBlur:d,className:f,id:u}){const h=P.useRef(null),[g,m]=P.useState(!1),[p,y]=P.useState(""),x=P.useMemo(()=>e.filter(O=>n.some(A=>dt(O.value,A))),[e,n]),S=P.useMemo(()=>e.filter(O=>!x.some(A=>dt(A.value,O.value))),[e,x]),j=P.useCallback(O=>{if(s)return;const A=x.filter(_=>!dt(_.value,O.value));r?.(A.map(_=>_.index))},[x,r,s]),b=P.useCallback(O=>{if(!(s||!h.current||h.current.value!==""))if(O.key==="Delete"||O.key==="Backspace"){const A=x.slice(0,-1);r?.(A.map(_=>_.index))}else O.key==="Escape"&&h.current.blur()},[x,r,s]),v=P.useCallback(O=>{if(s)return;y("");const A=t?[...x,O]:[O];r?.(A.map(_=>_.index))},[t,x,r,s]),w=P.useCallback(O=>{s||m(!0),l?.(O)},[s,l]);return c.jsxs(vc,{onKeyDown:b,className:G("overflow-visible bg-transparent",f),autoFocus:i,"aria-disabled":s,onBlur:d,onFocus:w,"aria-describedby":a,"aria-placeholder":o,children:[c.jsx("div",{className:G("group border border-input px-3 py-2 text-sm ring-offset-background rounded-md focus-within:ring-1 focus-within:ring-ring focus-within:ring-offset-1",s&&"opacity-50 cursor-not-allowed"),children:c.jsxs("div",{className:"flex gap-1 flex-wrap",children:[x.map(O=>c.jsxs(SS,{variant:"secondary",children:[O.label,c.jsx("button",{type:"button",className:"rtl:mr-1 ltr:ml-1 ring-offset-background rounded-full outline-none focus:ring-1 focus:ring-ring focus:ring-offset-1",onKeyDown:A=>A.key==="Enter"&&!s&&j(O),onMouseDown:A=>{A.preventDefault(),A.stopPropagation()},onClick:()=>j(O),disabled:s,children:c.jsx(tc,{className:G("h-3 w-3 text-muted-foreground hover:text-foreground",s&&"pointer-events-none")})})]},O.value)),c.jsx(_t.Input,{ref:h,value:p,onValueChange:y,onBlur:()=>m(!1),onFocus:()=>!s&&m(!0),placeholder:"Select ...",className:"rtl:mr-2 ltr:ml-2 bg-transparent outline-none placeholder:text-muted-foreground flex-1",disabled:s,"aria-controls":`command-item-input-${u}`,"aria-labelledby":`command-item-input-${u}`,id:`command-item-input-${u}`})]})}),g&&!s&&S.length>0&&c.jsx("div",{className:"relative mt-2",children:c.jsx("div",{className:"absolute w-full z-10 top-0 rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in",children:c.jsx(wc,{className:"h-full overflow-auto",children:c.jsx(Sc,{children:S.map(O=>c.jsx(jc,{disabled:O.disabled,onMouseDown:A=>{A.preventDefault(),A.stopPropagation()},"aria-controls":`${O.value}-command-item`,"aria-labelledby":`${O.value}-command-item`,id:`${O.value}-command-item`,onSelect:()=>v(O),className:"cursor-pointer",children:O.label},`${O.value}-command-item`))})})})})]})}function OS({items:t,selected:e,onValueChange:n,autoFocus:r=!1,disabled:i=!1,required:s=!1,placeholder:a="Select...",ariaDescribedby:o,ariaPlaceholder:l,onFocus:d,onBlur:f,className:u}){const[h,g]=P.useState(!1),m=t?.find(S=>S.value===e),p=P.useRef(null),y=P.useRef(null);P.useEffect(()=>{h&&p.current&&requestAnimationFrame(()=>{var S;(S=p.current)===null||S===void 0||S.scrollIntoView({block:"nearest"})})},[h]);const x=S=>{y.current&&!y.current.contains(S.relatedTarget)&&g(!1),f?.(S)};return c.jsxs(vc,{ref:y,className:G("overflow-visible bg-transparent",u),autoFocus:r,"aria-disabled":i,onBlur:x,onFocus:d,"aria-describedby":o,"aria-placeholder":l,children:[c.jsxs("div",{onClick:()=>!i&&g(!h),className:G("flex h-9 w-full items-center justify-between gap-2 whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",!m&&s&&"border-red-500",i&&"opacity-50 cursor-not-allowed",u),children:[c.jsx("span",{className:G("flex-1 line-clamp-1",!m&&"text-muted-foreground"),children:m?.label||a}),c.jsx(Ql,{className:"h-4 w-4 opacity-50"})]}),c.jsx("div",{className:"relative",children:h&&t&&t.length>0?c.jsx("div",{style:{top:"0.5rem"},className:"absolute w-full z-10 rounded-md border bg-popover text-popover-foreground shadow-md outline-none",children:c.jsx(wc,{className:"h-full overflow-auto",children:c.jsx(Sc,{children:t.map(S=>c.jsxs(jc,{ref:S.value===e?p:void 0,onMouseDown:j=>{j.preventDefault(),j.stopPropagation()},onSelect:()=>{S.disabled||(n?.(S.value),g(!1))},className:G("cursor-pointer relative flex items-center justify-between rounded-sm py-1.5 gap-2 rtl:flex-row-reverse",S.value===e&&"font-semibold",S.disabled&&"opacity-50 cursor-not-allowed"),children:[c.jsx("span",{children:S.label}),c.jsx("span",{className:"flex h-3.5 w-3.5 items-center justify-center",children:S.value===e&&c.jsx(n1,{className:"h-4 w-4"})})]},S.value))})})}):null})]})}function AS({id:t,options:e,required:n,disabled:r,readonly:i,value:s,multiple:a,autofocus:o,onChange:l,onBlur:d,onFocus:f,defaultValue:u,placeholder:h,rawErrors:g=[],className:m}){const{enumOptions:p,enumDisabled:y,emptyValue:x}=e,S=()=>{f(t,ge(s,p,x))},j=()=>{d(t,ge(s,p,x))},b=p?.map(({value:w,label:O},A)=>({value:a?w:A.toString(),label:O,index:A,disabled:Array.isArray(y)&&y.includes(w)})),v=G({"border-destructive":g.length>0},m);return c.jsx("div",{className:"p-0.5",children:a?c.jsx(jS,{id:t,autoFocus:o,disabled:r||i,multiple:!0,className:v,items:b,selected:s,onValueChange:w=>{l(ge(w,p,x))},onFocus:S,onBlur:j}):c.jsx(OS,{items:b,selected:Ol(s??u,p,!1),onValueChange:w=>{l(ge(w,p,x))},autoFocus:o,disabled:r||i,required:n,placeholder:h,className:v,onFocus:S,onBlur:j,ariaDescribedby:we(t)})})}function _S({className:t,...e}){return c.jsx("textarea",{"data-slot":"textarea",className:G("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...e})}function CS({id:t,htmlName:e,placeholder:n,value:r,required:i,disabled:s,autofocus:a,readonly:o,onBlur:l,onFocus:d,onChange:f,options:u,className:h}){const g=({target:{value:y}})=>f(y===""?u.emptyValue:y),m=({target:y})=>l(t,y&&y.value),p=({target:y})=>d(t,y&&y.value);return c.jsx("div",{className:"flex p-0.5",children:c.jsx(_S,{id:t,name:e||t,placeholder:n,disabled:s,readOnly:o,value:r??"",required:i,autoFocus:a,rows:u.rows||5,onChange:g,onBlur:m,onFocus:p,"aria-describedby":we(t),className:h})})}function NS(){return{CheckboxWidget:G1,CheckboxesWidget:H1,RadioWidget:J1,RangeWidget:bS,SelectWidget:AS,TextareaWidget:CS}}function TS(){return{templates:V1(),widgets:NS()}}function FS(){return kv(TS())}const PS=FS();function ES(t){const e=t.properties;if(!e)return!1;const n=e.__type,r=e.__binding;return!!(n?.const||r?.const)}function IS(t){const e=t.properties;if(!e)return{};const n=e.__type,r=e.__binding;return{bindingType:n?.const,bindingSchema:r?.const}}function DS(t){return t.replace(/^root_/,"").split("_")[0]||""}function Wo(t){return typeof t!="string"?!1:(t.startsWith("@")?t.slice(1):t).includes("/")}function $S(t){const e=ve.c(8),{bindingSchema:n,bindingType:r,currentValue:i,onValueChange:s,placeholder:a,onAddNew:o,className:l}=t,d=Wo(n),f=Wo(r),u=d||f,h=d?n:f?r:void 0,{bindingSchema:g}=Td(h);let m;e:{if(u){m=g;break e}if(Array.isArray(n)){m=n;break e}if(typeof n=="string"){m=n;break e}m=void 0}const p=m;let y;return e[0]!==r||e[1]!==l||e[2]!==i||e[3]!==o||e[4]!==s||e[5]!==a||e[6]!==p?(y=c.jsx(kS,{value:i,onValueChange:s,placeholder:a,binding:p,bindingType:r,onAddNew:o,className:l}),e[0]=r,e[1]=l,e[2]=i,e[3]=o,e[4]=s,e[5]=a,e[6]=p,e[7]=y):y=e[7],y}function kS({value:t,onValueChange:e,placeholder:n="Select a connection...",binding:r,bindingType:i,onAddNew:s,className:a}){const[o,l]=P.useState(!1),{installByBinding:d,isInstalling:f}=Pd(),u=o||f,h=hi(),g=Xo({connections:h,binding:r}),m=(()=>{if(!i?.startsWith("@"))return null;const[S,j]=i.replace("@","").split("/");return S&&j?{scope:S,appName:j}:null})(),p=(()=>{let S=g;const j=Array.isArray(r)&&r.length>0;if(m&&!j&&(S=S.filter(b=>{const v=b.app_name,w=b.metadata?.scopeName;return v===m.appName&&w===m.scope})),t&&!S.some(b=>b.id===t)){const b=h?.find(v=>v.id===t);if(b)return[b,...S]}return S})(),y=i?.startsWith("@"),x=async()=>{if(y&&i){l(!0);try{const S=await d(i);S&&e(S.id)}catch(S){const j=S instanceof Error?S.message:String(S);Ut.error(`Failed to connect MCP: ${j}`)}finally{l(!1)}return}s?.()};return c.jsxs(Jo,{value:t,onValueChange:e,children:[c.jsx(Zo,{size:"sm",className:a??"w-[200px]",children:c.jsx(Qo,{placeholder:n})}),c.jsxs(ea,{children:[p.length===0?c.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No connections found"}):p.map(S=>c.jsx(kt,{value:S.id,children:c.jsxs("div",{className:"flex items-center gap-2",children:[S.icon?c.jsx("img",{src:S.icon,alt:S.title,className:"w-4 h-4 rounded"}):c.jsx("div",{className:"w-4 h-4 rounded bg-linear-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:S.title.slice(0,1).toUpperCase()}),c.jsx("span",{children:S.title})]})},S.id)),(s||y)&&c.jsx("div",{className:"border-t border-border",children:c.jsx(Vt,{onClick:S=>{S.preventDefault(),S.stopPropagation(),x()},disabled:u,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:u?c.jsxs(c.Fragment,{children:[c.jsx(yn,{size:16,className:"animate-spin"}),c.jsx("span",{children:"Connecting..."})]}):c.jsxs(c.Fragment,{children:[c.jsx(ia,{size:16}),c.jsx("span",{children:"Custom Connection"})]})})})]})]})}function MS(t){const e=ve.c(68),{schema:n,formData:r,title:i,description:s,registry:a}=t,o=a.formContext,l=t.properties[0]?.content?.key;let d;e[0]!==l||e[1]!==i?(d=i||(l?DS(l):""),e[0]=l,e[1]=i,e[2]=d):d=e[2];const f=d;if(ES(n)){const g=n;let m;e[3]!==g?(m=IS(g),e[3]=g,e[4]=m):m=e[4];const{bindingType:p,bindingSchema:y}=m,x=r?.value||"";let S;e[5]!==p||e[6]!==f||e[7]!==o||e[8]!==r?(S=M=>{const k={...r,value:M,...p&&{__type:p}};o?.onFieldChange(f,k)},e[5]=p,e[6]=f,e[7]=o,e[8]=r,e[9]=S):S=e[9];const j=S;let b;e[10]!==p||e[11]!==f||e[12]!==o?(b=M=>{o?.onFieldChange(f,{__type:p,value:{id:M.id,connectionId:M.connectionId}})},e[10]=p,e[11]=f,e[12]=o,e[13]=b):b=e[13];const v=b,w=BS;let O;e[14]!==f||e[15]!==i?(O=w(i||f),e[14]=f,e[15]=i,e[16]=O):O=e[16];const A=O;if(p==="@deco/agent"){let M;e[17]!==A?(M=c.jsx("label",{className:"text-sm font-medium truncate block",children:A}),e[17]=A,e[18]=M):M=e[18];let k;e[19]!==s?(k=s&&c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s}),e[19]=s,e[20]=k):k=e[20];let B;e[21]!==M||e[22]!==k?(B=c.jsxs("div",{className:"flex-1 min-w-0",children:[M,k]}),e[21]=M,e[22]=k,e[23]=B):B=e[23];const V=x||void 0;let R;e[24]!==j||e[25]!==V?(R=c.jsx(_u,{selectedGatewayId:V,onGatewayChange:j,variant:"bordered",placeholder:"Select Agent",className:"w-[200px] shrink-0"}),e[24]=j,e[25]=V,e[26]=R):R=e[26];let W;return e[27]!==R||e[28]!==B?(W=c.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[B,R]}),e[27]=R,e[28]=B,e[29]=W):W=e[29],W}if(p==="@deco/language-model"){let M;e[30]!==A?(M=c.jsx("label",{className:"text-sm font-medium truncate block",children:A}),e[30]=A,e[31]=M):M=e[31];let k;e[32]!==s?(k=s&&c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s}),e[32]=s,e[33]=k):k=e[33];let B;e[34]!==M||e[35]!==k?(B=c.jsxs("div",{className:"flex-1 min-w-0",children:[M,k]}),e[34]=M,e[35]=k,e[36]=B):B=e[36];const V=x;let R;e[37]!==v||e[38]!==V?(R=c.jsx(Cu,{selectedModel:V,onModelChange:v,variant:"bordered",placeholder:"Select Language Model",className:"w-[200px] shrink-0"}),e[37]=v,e[38]=V,e[39]=R):R=e[39];let W;return e[40]!==R||e[41]!==B?(W=c.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[B,R]}),e[40]=R,e[41]=B,e[42]=W):W=e[42],W}let _;e[43]!==A?(_=c.jsx("label",{className:"text-sm font-medium truncate block",children:A}),e[43]=A,e[44]=_):_=e[44];let T;e[45]!==s?(T=s&&c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s}),e[45]=s,e[46]=T):T=e[46];let N;e[47]!==_||e[48]!==T?(N=c.jsxs("div",{className:"flex-1 min-w-0",children:[_,T]}),e[47]=_,e[48]=T,e[49]=N):N=e[49];let C;e[50]!==A?(C=A.toLowerCase(),e[50]=A,e[51]=C):C=e[51];const F=`Select ${C}...`;let $;e[52]!==o?($=()=>o?.onAddNew(),e[52]=o,e[53]=$):$=e[53];let E;e[54]!==y||e[55]!==p||e[56]!==x||e[57]!==j||e[58]!==F||e[59]!==$?(E=c.jsx($S,{bindingSchema:y,bindingType:p,currentValue:x,onValueChange:j,placeholder:F,onAddNew:$,className:"w-[200px] shrink-0"}),e[54]=y,e[55]=p,e[56]=x,e[57]=j,e[58]=F,e[59]=$,e[60]=E):E=e[60];let D;return e[61]!==E||e[62]!==N?(D=c.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[N,E]}),e[61]=E,e[62]=N,e[63]=D):D=e[63],D}let u;e[64]!==t.properties?(u=t.properties.map(RS),e[64]=t.properties,e[65]=u):u=e[65];let h;return e[66]!==u?(h=c.jsx("div",{className:"flex flex-col gap-4",children:u}),e[66]=u,e[67]=h):h=e[67],h}function RS(t){return t.content}function BS(t){return t.toLowerCase().replace(/_/g," ").replace(/\b\w/g,US)}function US(t){return t.toUpperCase()}function LS(t){const e=ve.c(13),{label:n,children:r,description:i,id:s,schema:a}=t;if(s.includes("__type")||s.includes("__binding"))return null;if(a.type==="object")return r;let o;e[0]!==s||e[1]!==n?(o=n&&c.jsx("label",{className:"text-sm font-medium truncate block",htmlFor:s,children:n}),e[0]=s,e[1]=n,e[2]=o):o=e[2];let l;e[3]!==i?(l=i&&c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i}),e[3]=i,e[4]=l):l=e[4];let d;e[5]!==o||e[6]!==l?(d=c.jsxs("div",{className:"flex-1 min-w-0",children:[o,l]}),e[5]=o,e[6]=l,e[7]=d):d=e[7];let f;e[8]!==r?(f=c.jsx("div",{className:"w-[200px] shrink-0",children:r}),e[8]=r,e[9]=f):f=e[9];let u;return e[10]!==d||e[11]!==f?(u=c.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[d,f]}),e[10]=d,e[11]=f,e[12]=u):u=e[12],u}const WS={ObjectFieldTemplate:MS,FieldTemplate:LS};function VS(t){const e=ve.c(18),{formState:n,onFormStateChange:r,stateSchema:i}=t,{org:s}=pi(),a=Vo();let o;e[0]!==r?(o=x=>{x.formData&&r(x.formData)},e[0]=r,e[1]=o):o=e[1];const l=o;let d;e[2]!==n||e[3]!==r?(d=(x,S)=>{const j={...n,[x]:S};r(j)},e[2]=n,e[3]=r,e[4]=d):d=e[4];const f=d;let u;e[5]!==a||e[6]!==s?(u=()=>{a({to:"/$org/mcps",params:{org:s.slug},search:{action:"create"}})},e[5]=a,e[6]=s,e[7]=u):u=e[7];const h=u;let g;e[8]!==n||e[9]!==h||e[10]!==f?(g={onFieldChange:f,formData:n,onAddNew:h},e[8]=n,e[9]=h,e[10]=f,e[11]=g):g=e[11];const m=g;let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(c.Fragment,{}),e[12]=p):p=e[12];let y;return e[13]!==m||e[14]!==n||e[15]!==l||e[16]!==i?(y=c.jsx("div",{className:"flex flex-col h-full overflow-auto p-5",children:c.jsx(PS,{schema:i,validator:Yv,formData:n,onChange:l,formContext:m,liveValidate:!1,showErrorList:!1,templates:WS,children:p})}),e[13]=m,e[14]=n,e[15]=l,e[16]=i,e[17]=y):y=e[17],y}const zS=qo({key:Ae().min(1,"Key is required"),value:Ae()}),qS=qo({title:Ae().min(1,"Name is required"),description:Ae().nullable().optional(),ui_type:zc(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:Ae().optional(),connection_token:Ae().nullable().optional(),npx_package:Ae().optional(),stdio_command:Ae().optional(),stdio_args:Ae().optional(),stdio_cwd:Ae().optional(),env_vars:cs(zS).optional(),configuration_scopes:cs(Ae()).nullable().optional(),configuration_state:Vc(Ae(),qc()).nullable().optional()}).refine(t=>t.ui_type==="NPX"?!!t.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(t=>t.ui_type==="STDIO"?!!t.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(t=>t.ui_type==="HTTP"||t.ui_type==="SSE"||t.ui_type==="Websocket"?!!t.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function KS(t){return t.command==="npx"}function GS(t){return t.args?.find(e=>!e.startsWith("-"))??""}function HS(t){return{command:t.command,args:t.args?.join(" ")??"",cwd:t.cwd??""}}function YS(t,e){const n={command:"npx",args:["-y",t]},r=Ko(e);return Object.keys(r).length>0&&(n.envVars=r),n}function XS(t,e,n,r){const i={command:t};e.trim()&&(i.args=e.trim().split(/\s+/)),n?.trim()&&(i.cwd=n.trim());const s=Ko(r);return Object.keys(s).length>0&&(i.envVars=s),i}function JS(t,e){const n={title:t.title,description:t.description??"",configuration_state:t.configuration_state??{},configuration_scopes:e||t.configuration_scopes||[]};if(t.connection_type==="STDIO"&&nu(t.connection_headers)){const r=t.connection_headers,i=ru(r.envVars);if(KS(r)){const a=GS(r);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i}}const s=HS(r);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:s.command,stdio_args:s.args,stdio_cwd:s.cwd,env_vars:i}}return{...n,ui_type:t.connection_type,connection_url:t.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function ZS(t){let e,n=null,r=null,i=null;return t.ui_type==="NPX"?(e="STDIO",n="",i=YS(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(e="STDIO",n="",i=XS(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(e=t.ui_type,n=t.connection_url||"",r=t.connection_token||null),{title:t.title,description:t.description||null,connection_type:e,connection_url:n,...r&&{connection_token:r},...i&&{connection_headers:i},configuration_state:t.configuration_state??null,configuration_scopes:t.configuration_scopes??null}}function QS(t){const e=ve.c(13);let n;e[0]!==t?(n=mi(t),e[0]=t,e[1]=n):n=e[1];const r=n;let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i={},e[2]=i):i=e[2];let s;e[3]!==t||e[4]!==r?(s={toolCaller:r,toolName:"MCP_CONFIGURATION",toolInputParams:i,scope:t},e[3]=t,e[4]=r,e[5]=s):s=e[5];const{data:a}=lu(s);let o;e[6]!==a.stateSchema?(o=a.stateSchema??{type:"object",properties:{}},e[6]=a.stateSchema,e[7]=o):o=e[7];const l=o;let d;e[8]!==a.scopes?(d=a.scopes??[],e[8]=a.scopes,e[9]=d):d=e[9];const f=d;let u;return e[10]!==f||e[11]!==l?(u={stateSchema:l,scopes:f},e[10]=f,e[11]=l,e[12]=u):u=e[12],u}function ew(t){const e=ve.c(4),{onAuthenticate:n,buttonText:r}=t,i=r===void 0?"Authenticate":r;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"Authentication Required"}),c.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-center",children:"This connection requires OAuth authentication to access resources."})]}),e[0]=s):s=e[0];let a;return e[1]!==i||e[2]!==n?(a=c.jsx("div",{className:"w-3/5 min-w-0 flex items-center justify-center",children:c.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[s,c.jsx(Vt,{onClick:n,size:"lg",children:i})]})}),e[1]=i,e[2]=n,e[3]=a):a=e[3],a}function tw(t){const e=ve.c(7),{hasReadme:n,onViewReadme:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(du,{size:48,className:"text-muted-foreground"}),e[0]=i):i=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"Manual Authentication Required"}),c.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-center",children:"This server requires an API key or token that must be configured manually. Check the server's documentation for instructions on obtaining credentials."})]}),e[1]=s):s=e[1];let a;e[2]!==n||e[3]!==r?(a=n&&r&&c.jsxs(Vt,{onClick:r,variant:"outline",size:"lg",children:[c.jsx(uu,{size:18,className:"mr-2"}),"View README"]}),e[2]=n,e[3]=r,e[4]=a):a=e[4];let o;return e[5]!==a?(o=c.jsx("div",{className:"w-3/5 min-w-0 flex items-center justify-center",children:c.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[i,s,a]})}),e[5]=a,e[6]=o):o=e[6],o}function nw(){const t=ve.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx("img",{src:"/empty-state-error.svg",alt:"",width:160,height:160,"aria-hidden":"true"}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=c.jsx("div",{className:"w-3/5 min-w-0 flex items-center justify-center",children:c.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[e,c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"Server Error"}),c.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-center",children:"The MCP server is currently experiencing issues. Please try again later or check the server's status."})]})]})}),t[1]=n):n=t[1],n}function rw(t){const e=ve.c(3),n=QS(t.connection.id);let r;return e[0]!==n||e[1]!==t?(r=c.jsx(Oc,{...t,...n}),e[0]=n,e[1]=t,e[2]=r):r=e[2],r}function iw(t){const e=ve.c(2);let n;return e[0]!==t?(n=c.jsx(Oc,{...t}),e[0]=t,e[1]=n):n=e[1],n}function sw(t){const e=ve.c(13),{hasMcpBinding:n,stateSchema:r,formState:i,onFormStateChange:s,onAuthenticate:a,onViewReadme:o,isMCPAuthenticated:l,supportsOAuth:d,isServerError:f,hasReadme:u}=t,h=r&&r.properties&&typeof r.properties=="object"&&Object.keys(r.properties).length>0;if(!l){if(f){let y;return e[0]===Symbol.for("react.memo_cache_sentinel")?(y=c.jsx(nw,{}),e[0]=y):y=e[0],y}if(d){let y;return e[1]!==a?(y=c.jsx(ew,{onAuthenticate:a}),e[1]=a,e[2]=y):y=e[2],y}let p;return e[3]!==u||e[4]!==o?(p=c.jsx(tw,{hasReadme:u,onViewReadme:o}),e[3]=u,e[4]=o,e[5]=p):p=e[5],p}if(!n)return null;if(!h||!r){let p;return e[6]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx("div",{className:"w-3/5 min-w-0 overflow-auto flex items-center justify-center",children:c.jsx(eu,{image:c.jsx("img",{src:"/empty-state-success-muted.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),title:"This server is all set!",description:"No additional configuration is needed. Everything is ready to go."})}),e[6]=p):p=e[6],p}let g;e[7]!==i?(g=i??{},e[7]=i,e[8]=g):g=e[8];let m;return e[9]!==s||e[10]!==r||e[11]!==g?(m=c.jsx("div",{className:"w-3/5 min-w-0 overflow-auto",children:c.jsx(VS,{stateSchema:r,formState:g,onFormStateChange:s})}),e[9]=s,e[10]=r,e[11]=g,e[12]=m):m=e[12],m}function Oc(t){const{connection:e,onUpdate:n,isUpdating:r,scopes:i,hasMcpBinding:s,stateSchema:a,onViewReadme:o}=t,l=Go(),d=Kc(),u=Gc().location.href,g=!!e?.metadata?.repository?.url,m=Hc({resolver:Yc(qS),values:JS(e,i)}),p=m.watch("configuration_state"),y=m.formState.isDirty,x=b=>{m.setValue("configuration_state",b,{shouldDirty:!0})},S=async()=>{if(!await m.trigger())return;const v=m.getValues(),w=ZS(v);await n(w),m.reset(v)},j=async()=>{const{token:b,tokenInfo:v,error:w}=await Jc({connectionId:e.id});if(w||!b){Ut.error(`Authentication failed: ${w}`);return}if(v)try{const A=await fetch(`/api/connections/${e.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:v.accessToken,refreshToken:v.refreshToken,expiresIn:v.expiresIn,scope:v.scope,clientId:v.clientId,clientSecret:v.clientSecret,tokenEndpoint:v.tokenEndpoint})});if(!A.ok)console.error("Failed to save OAuth token:",await A.text()),await l.update.mutateAsync({id:e.id,data:{connection_token:b}});else try{await l.update.mutateAsync({id:e.id,data:{}})}catch(_){console.warn("Failed to refresh connection tools after OAuth:",_)}}catch(A){console.error("Error saving OAuth token:",A),await l.update.mutateAsync({id:e.id,data:{connection_token:b}})}else await l.update.mutateAsync({id:e.id,data:{connection_token:b}});const O=new URL(`/mcp/${e.id}`,window.location.origin);await d.invalidateQueries({queryKey:ui.isMCPAuthenticated(O.href,null)}),Ut.success("Authentication successful")};return c.jsxs(c.Fragment,{children:[c.jsxs(fu,{children:[c.jsx(cu,{title:`${e.title}: Settings`,url:u,icon:e.icon??"settings"}),y&&c.jsxs(Vt,{onClick:S,disabled:r,size:"sm",className:"h-7",children:[r&&c.jsx(yn,{size:16,className:"mr-2 animate-spin"}),"Save Changes"]})]}),c.jsxs("div",{className:"flex h-full",children:[c.jsx("div",{className:"w-2/5 shrink-0 border-r border-border overflow-auto",children:c.jsx(Od,{form:m,connection:e})}),c.jsx(iu,{children:c.jsx(P.Suspense,{fallback:c.jsx("div",{className:"w-3/5 min-w-0 flex items-center justify-center",children:c.jsx(yn,{size:32,className:"animate-spin text-muted-foreground"})}),children:c.jsx(sw,{hasMcpBinding:s,stateSchema:a,formState:p??void 0,onFormStateChange:x,onAuthenticate:j,onViewReadme:o,isMCPAuthenticated:t.isMCPAuthenticated,supportsOAuth:t.supportsOAuth,isServerError:t.isServerError,hasReadme:g})})})]})]})}function kw(t){const e=ve.c(5);let n;e[0]!==t.connection?(n={connections:[t.connection],binding:"MCP"},e[0]=t.connection,e[1]=n):n=e[1];const i=Xo(n).length>0;let s;return e[2]!==i||e[3]!==t?(s=c.jsx("div",{className:"flex-1",children:i?c.jsx(rw,{...t,hasMcpBinding:!0}):c.jsx(iw,{...t,hasMcpBinding:!1})}),e[2]=i,e[3]=t,e[4]=s):s=e[4],s}export{$v as F,tw as M,ew as O,kw as S,Dw as u,Yv as v};
|