trybeacon 0.1.66 → 0.1.67
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/.claude-plugin/plugin.json +1 -1
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +8 -8
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +11 -11
- package/.next/server/app/_not-found.segments/_full.segment.rsc +11 -11
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +11 -11
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/lesson/close/route.js +1 -1
- package/.next/server/app/api/lesson/questions/route.js +1 -1
- package/.next/server/app/api/lesson/route.js +1 -1
- package/.next/server/app/api/lesson/save/route.js +1 -1
- package/.next/server/app/api/lesson/verdict/route.js +1 -1
- package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/docs.html +1 -1
- package/.next/server/app/docs.rsc +11 -11
- package/.next/server/app/docs.segments/_full.segment.rsc +11 -11
- package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/docs.segments/_index.segment.rsc +11 -11
- package/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
- package/.next/server/app/feedback/page_client-reference-manifest.js +1 -1
- package/.next/server/app/feedback.html +1 -1
- package/.next/server/app/feedback.rsc +11 -11
- package/.next/server/app/feedback.segments/_full.segment.rsc +11 -11
- package/.next/server/app/feedback.segments/_head.segment.rsc +1 -1
- package/.next/server/app/feedback.segments/_index.segment.rsc +11 -11
- package/.next/server/app/feedback.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/feedback.segments/feedback/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/feedback.segments/feedback.segment.rsc +1 -1
- package/.next/server/app/help/page_client-reference-manifest.js +1 -1
- package/.next/server/app/help.html +1 -1
- package/.next/server/app/help.rsc +11 -11
- package/.next/server/app/help.segments/_full.segment.rsc +11 -11
- package/.next/server/app/help.segments/_head.segment.rsc +1 -1
- package/.next/server/app/help.segments/_index.segment.rsc +11 -11
- package/.next/server/app/help.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/help.segments/help.segment.rsc +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +12 -12
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +12 -12
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +11 -11
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/learn/page.js +5 -3
- package/.next/server/app/learn/page.js.nft.json +1 -1
- package/.next/server/app/learn/page_client-reference-manifest.js +1 -1
- package/.next/server/app/map/page.js +2 -2
- package/.next/server/app/map/page.js.nft.json +1 -1
- package/.next/server/app/map/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +2 -2
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/plan/page.js +2 -2
- package/.next/server/app/plan/page.js.nft.json +1 -1
- package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
- package/.next/server/app/s/[token]/page.js +2 -2
- package/.next/server/app/s/[token]/page.js.nft.json +1 -1
- package/.next/server/app/s/[token]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page.js +1 -1
- package/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +8 -8
- package/.next/server/chunks/2025.js +1 -0
- package/.next/server/chunks/2994.js +2 -0
- package/.next/server/chunks/4046.js +3 -3
- package/.next/server/chunks/5683.js +1 -0
- package/.next/server/chunks/5719.js +1 -0
- package/.next/server/chunks/7720.js +154 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/1276-b84f61ec9c0df862.js +1 -0
- package/.next/static/chunks/1a258343-954e0e6619585d3c.js +2 -0
- package/.next/static/chunks/2059-fba06ba63ba64522.js +62 -0
- package/.next/static/chunks/4607-a668ea431c41e60e.js +1 -0
- package/.next/static/chunks/4853-6dc402b4ce452fa5.js +1 -0
- package/.next/static/chunks/{7043-254590cf9891391f.js → 4888-911c0da3c2d785d2.js} +1 -1
- package/.next/static/chunks/5957-83f611fcd5a08b45.js +1 -0
- package/.next/static/chunks/766-242213d211df0afd.js +1 -0
- package/.next/static/chunks/8997-78a359d0d238622e.js +1 -0
- package/.next/static/chunks/app/{layout-0c993f55d3a798f4.js → layout-9f0f4d8e4534a62e.js} +1 -1
- package/.next/static/chunks/app/learn/page-03acad0a37068966.js +7 -0
- package/.next/static/chunks/app/map/page-5cfad64d5feea695.js +1 -0
- package/.next/static/chunks/app/page-d08947a671077569.js +1 -0
- package/.next/static/chunks/app/plan/page-5eacb6b83bd4873d.js +1 -0
- package/.next/static/chunks/app/s/[token]/page-1a350cf50a45500c.js +1 -0
- package/.next/static/chunks/app/settings/page-7e176d120b1effa9.js +1 -0
- package/.next/static/css/63986592e2be7d62.css +1 -0
- package/.next/trace +43 -43
- package/.next/trace-build +1 -1
- package/dist/bin/beacon.js +14 -12
- package/dist/bin/doctor.js +22 -15
- package/dist/bin/hook.js +18 -11
- package/dist/bin/mcp.js +41 -34
- package/dist/bin/plan.js +21 -14
- package/dist/bin/uninstall.js +26 -19
- package/dist/lib/assets.js +7 -0
- package/dist/lib/codex-install.js +28 -21
- package/dist/lib/global-install.js +27 -20
- package/package.json +1 -1
- package/plugin/skills/beacon-explain/SKILL.md +7 -0
- package/.next/server/chunks/3584.js +0 -154
- package/.next/server/chunks/6024.js +0 -2
- package/.next/server/chunks/7187.js +0 -1
- package/.next/server/chunks/8035.js +0 -1
- package/.next/static/chunks/1936-7fea5225b5bfcfda.js +0 -1
- package/.next/static/chunks/1a258343-6baccd9e573fdfaf.js +0 -2
- package/.next/static/chunks/2019-3be80edc82176878.js +0 -1
- package/.next/static/chunks/3845-6fe7e66d4bf82eb5.js +0 -1
- package/.next/static/chunks/4549-591415d55ca009a3.js +0 -62
- package/.next/static/chunks/6638-4e53879181b1df75.js +0 -1
- package/.next/static/chunks/7643-6c7ff4b9400f68fc.js +0 -1
- package/.next/static/chunks/app/learn/page-797d74e02b98fa88.js +0 -5
- package/.next/static/chunks/app/map/page-634b6d5d98e921b3.js +0 -1
- package/.next/static/chunks/app/page-84dc684d45002cfb.js +0 -1
- package/.next/static/chunks/app/plan/page-df829b2054c40611.js +0 -1
- package/.next/static/chunks/app/s/[token]/page-f97dec75856a7952.js +0 -1
- package/.next/static/chunks/app/settings/page-59d90685cd17fc1f.js +0 -1
- package/.next/static/css/b3d3212da726bbfb.css +0 -1
- /package/.next/static/{P3uXQySdS-m6_bxuiezYe → hkOIw5DQW9WSwBwZrD8_9}/_buildManifest.js +0 -0
- /package/.next/static/{P3uXQySdS-m6_bxuiezYe → hkOIw5DQW9WSwBwZrD8_9}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2059],{874:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("file-braces",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]])},1275:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},5937:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]])},5989:(e,t,n)=>{var r,i;function o(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:a,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=a.prototype,o=Object.keys(i);for(let e=0;e<o.length;e++){let t=o[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class o extends i{}function a(e){var t;let i=n?.Parent?new o:this;for(let n of(r(i,e),(t=i._zod).deferred??(t.deferred=[]),i._zod.deferred))n();return i}return Object.defineProperty(o,"name",{value:e}),Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:t=>!!n?.Parent&&t instanceof n.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}n.d(t,{EB:()=>nh,bz:()=>nL,YO:()=>nB,zM:()=>nC,gM:()=>nX,k5:()=>nQ,eu:()=>n1,ai:()=>nT,Ik:()=>nH,Yj:()=>nf}),Symbol("zod_brand");class a extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class s extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(r=globalThis).__zod_globalConfig??(r.__zod_globalConfig={});let l=globalThis.__zod_globalConfig;function u(e){return e&&Object.assign(l,e),l}let c=/^[cC][0-9a-z]{6,}$/,d=/^[0-9a-z]+$/,f=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,h=/^[0-9a-vA-V]{20}$/,p=/^[A-Za-z0-9]{27}$/,m=/^[a-zA-Z0-9_-]{21}$/,y=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,g=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,v=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,b=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,w=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,k=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,z=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,x=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,O=/^[A-Za-z0-9_-]*$/,$=/^https?$/,A=/^\+[1-9]\d{6,14}$/,S="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",E=RegExp(`^${S}$`);function N(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}let M=/^-?\d+$/,Z=/^-?\d+(?:\.\d+)?$/,j=/^(?:true|false)$/i,T=/^[^A-Z]*$/,P=/^[^a-z]*$/;function I(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function R(e,t){return"bigint"==typeof t?t.toString():t}function C(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function U(e){let t=+!!e.startsWith("^"),n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}let L=Symbol("evaluating");function F(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==L)return void 0===r&&(r=L,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function D(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function J(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function V(e){return JSON.stringify(e)}let B="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function q(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let H=C(()=>{if(l.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function W(e){if(!1===q(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let n=t.prototype;return!1!==q(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function G(e){return W(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let X=new Set(["string","number","symbol"]);function K(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Y(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Q(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}let ee={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function et(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function en(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function er(e){return"string"==typeof e?e:e?.message}function ei(e,t,n){let r=e.message?e.message:er(e.inst?._zod.def?.error?.(e))??er(t?.error?.(e))??er(n.customError?.(e))??er(n.localeError?.(e))??"Invalid input",{inst:i,continue:o,input:a,...s}=e;return s.path??(s.path=[]),s.message=r,t?.reportInput&&(s.input=a),s}function eo(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function ea(...e){let[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}let es=o("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),el={number:"number",bigint:"bigint",object:"date"},eu=o("$ZodCheckLessThan",(e,t)=>{es.init(e,t);let n=el[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ec=o("$ZodCheckGreaterThan",(e,t)=>{es.init(e,t);let n=el[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ed=o("$ZodCheckMultipleOf",(e,t)=>{es.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{let r,i,o;if(typeof n.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0==(i=Math.round(r=n.value/t.value),o=Number.EPSILON*Math.max(Math.abs(r),1),Math.abs(r-i)<o?0:r-i))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),ef=o("$ZodCheckNumberFormat",(e,t)=>{es.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[i,o]=ee[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=o,n&&(r.pattern=M)}),e._zod.check=a=>{let s=a.value;if(n){if(!Number.isInteger(s))return void a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}s<i&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),eh=o("$ZodCheckMaxLength",(e,t)=>{var n;es.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=eo(r);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ep=o("$ZodCheckMinLength",(e,t)=>{var n;es.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=eo(r);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),em=o("$ZodCheckLengthEquals",(e,t)=>{var n;es.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let o=eo(r),a=i>t.length;n.issues.push({origin:o,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ey=o("$ZodCheckStringFormat",(e,t)=>{var n,r;es.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),eg=o("$ZodCheckRegex",(e,t)=>{ey.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ev=o("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=T),ey.init(e,t)}),e_=o("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=P),ey.init(e,t)}),eb=o("$ZodCheckIncludes",(e,t)=>{es.init(e,t);let n=K(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),ew=o("$ZodCheckStartsWith",(e,t)=>{es.init(e,t);let n=RegExp(`^${K(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),ek=o("$ZodCheckEndsWith",(e,t)=>{es.init(e,t);let n=RegExp(`.*${K(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),ez=o("$ZodCheckOverwrite",(e,t)=>{es.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class ex{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}let eO=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,R,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},e$=o("$ZodError",eO),eA=o("$ZodError",eO,{Parent:Error}),eS=e=>(t,n,r,i)=>{let o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new a;if(s.issues.length){let t=new(i?.Err??e)(s.issues.map(e=>ei(e,o,u())));throw B(t,i?.callee),t}return s.value},eE=e=>async(t,n,r,i)=>{let o=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let t=new(i?.Err??e)(a.issues.map(e=>ei(e,o,u())));throw B(t,i?.callee),t}return a.value},eN=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new a;return o.issues.length?{success:!1,error:new(e??e$)(o.issues.map(e=>ei(e,i,u())))}:{success:!0,data:o.value}},eM=eN(eA),eZ=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>ei(e,i,u())))}:{success:!0,data:o.value}},ej=eZ(eA),eT={major:4,minor:4,patch:3},eP=o("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=eT;let r=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&r.unshift(e),r))for(let n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r,i=et(e);for(let o of t){if(o._zod.def.when){if(function(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}(e)||!o._zod.def.when(e))continue}else if(i)continue;let t=e.issues.length,s=o._zod.check(e);if(s instanceof Promise&&n?.async===!1)throw new a;if(r||s instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(i||(i=et(e,t)))});else{if(e.issues.length===t)continue;i||(i=et(e,t))}}return r?r.then(()=>e):e},n=(n,i,o)=>{if(et(n))return n.aborted=!0,n;let s=t(i,r,o);if(s instanceof Promise){if(!1===o.async)throw new a;return s.then(t=>e._zod.parse(t,o))}return e._zod.parse(s,o)};e._zod.run=(i,o)=>{if(o.skipChecks)return e._zod.parse(i,o);if("backward"===o.direction){let t=e._zod.parse({value:i.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,o)):n(t,i,o)}let s=e._zod.parse(i,o);if(s instanceof Promise){if(!1===o.async)throw new a;return s.then(e=>t(e,r,o))}return t(s,r,o)}}F(e,"~standard",()=>({validate:t=>{try{let n=eM(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return ej(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),eI=o("$ZodString",(e,t)=>{var n;let r;eP.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(r=(n=e._zod.bag)?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*",RegExp(`^${r}$`)),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(e){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),eR=o("$ZodStringFormat",(e,t)=>{ey.init(e,t),eI.init(e,t)}),eC=o("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=g),eR.init(e,t)}),eU=o("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=v(e))}else t.pattern??(t.pattern=v());eR.init(e,t)}),eL=o("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=_),eR.init(e,t)}),eF=o("$ZodURL",(e,t)=>{eR.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===$.source&&!/^https?:\/\//i.test(r))return void n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),eD=o("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),eR.init(e,t)}),eJ=o("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=m),eR.init(e,t)}),eV=o("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=c),eR.init(e,t)}),eB=o("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=d),eR.init(e,t)}),eq=o("$ZodULID",(e,t)=>{t.pattern??(t.pattern=f),eR.init(e,t)}),eH=o("$ZodXID",(e,t)=>{t.pattern??(t.pattern=h),eR.init(e,t)}),eW=o("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=p),eR.init(e,t)}),eG=o("$ZodISODateTime",(e,t)=>{let n,r,i;t.pattern??(n=N({precision:t.precision}),r=["Z"],t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)"),i=`${n}(?:${r.join("|")})`,t.pattern=RegExp(`^${S}T(?:${i})$`)),eR.init(e,t)}),eX=o("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=E),eR.init(e,t)}),eK=o("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RegExp(`^${N(t)}$`)),eR.init(e,t)}),eY=o("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=y),eR.init(e,t)}),eQ=o("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=b),eR.init(e,t),e._zod.bag.format="ipv4"}),e0=o("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=w),eR.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),e1=o("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=k),eR.init(e,t)}),e2=o("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=z),eR.init(e,t),e._zod.check=n=>{let r=n.value.split("/");try{if(2!==r.length)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function e4(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let e7=o("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=x),eR.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{e4(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),e3=o("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=O),eR.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{!function(e){if(!O.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return e4(t.padEnd(4*Math.ceil(t.length/4),"="))}(n.value)&&n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),e9=o("$ZodE164",(e,t)=>{t.pattern??(t.pattern=A),eR.init(e,t)}),e6=o("$ZodJWT",(e,t)=>{eR.init(e,t),e._zod.check=n=>{!function(e,t=null){try{let n=e.split(".");if(3!==n.length)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));if("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}(n.value,t.alg)&&n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),e8=o("$ZodNumber",(e,t)=>{eP.init(e,t),e._zod.pattern=e._zod.bag.pattern??Z,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}let i=n.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return n;let o="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),n}}),e5=o("$ZodNumberFormat",(e,t)=>{ef.init(e,t),e8.init(e,t)}),te=o("$ZodBoolean",(e,t)=>{eP.init(e,t),e._zod.pattern=j,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch(e){}let i=n.value;return"boolean"==typeof i||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),tt=o("$ZodAny",(e,t)=>{eP.init(e,t),e._zod.parse=e=>e}),tn=o("$ZodUnknown",(e,t)=>{eP.init(e,t),e._zod.parse=e=>e}),tr=o("$ZodNever",(e,t)=>{eP.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function ti(e,t,n){e.issues.length&&t.issues.push(...en(n,e.issues)),t.value[n]=e.value}let to=o("$ZodArray",(e,t)=>{eP.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);let o=[];for(let e=0;e<i.length;e++){let a=i[e],s=t.element._zod.run({value:a,issues:[]},r);s instanceof Promise?o.push(s.then(t=>ti(t,n,e))):ti(s,n,e)}return o.length?Promise.all(o).then(()=>n):n}});function ta(e,t,n,r,i,o){let a=n in r;if(e.issues.length){if(i&&o&&!a)return;t.issues.push(...en(n,e.issues))}if(!a&&!i){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}void 0===e.value?a&&(t.value[n]=void 0):t.value[n]=e.value}function ts(e){var t;let n=Object.keys(e.shape);for(let t of n)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${t}": expected a Zod schema`);let r=Object.keys(t=e.shape).filter(e=>"optional"===t[e]._zod.optin&&"optional"===t[e]._zod.optout);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(r)}}function tl(e,t,n,r,i,o){let a=[],s=i.keySet,l=i.catchall._zod,u=l.def.type,c="optional"===l.optin,d="optional"===l.optout;for(let i in t){if("__proto__"===i||s.has(i))continue;if("never"===u){a.push(i);continue}let o=l.run({value:t[i],issues:[]},r);o instanceof Promise?e.push(o.then(e=>ta(e,n,i,t,c,d))):ta(o,n,i,t,c,d)}return(a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o}),e.length)?Promise.all(e).then(()=>n):n}let tu=o("$ZodObject",(e,t)=>{let n;eP.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape");if(!r?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let i=C(()=>ts(t));F(e._zod,"propValues",()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values)for(let e of(n[t]??(n[t]=new Set),r.values))n[t].add(e)}return n});let o=t.catchall;e._zod.parse=(t,r)=>{n??(n=i.value);let a=t.value;if(!q(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};let s=[],l=n.shape;for(let e of n.keys){let n=l[e],i="optional"===n._zod.optin,o="optional"===n._zod.optout,u=n._zod.run({value:a[e],issues:[]},r);u instanceof Promise?s.push(u.then(n=>ta(n,t,e,a,i,o))):ta(u,t,e,a,i,o)}return o?tl(s,a,t,r,i.value,e):s.length?Promise.all(s).then(()=>t):t}}),tc=o("$ZodObjectJIT",(e,t)=>{let n,r;tu.init(e,t);let i=e._zod.parse,o=C(()=>ts(t)),a=!l.jitless,s=a&&H.value,u=t.catchall;e._zod.parse=(l,c)=>{r??(r=o.value);let d=l.value;return q(d)?a&&s&&c?.async===!1&&!0!==c.jitless?(n||(n=(e=>{let t=new ex(["shape","payload","ctx"]),n=o.value,r=e=>{let t=V(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let i=Object.create(null),a=0;for(let e of n.keys)i[e]=`key_${a++}`;for(let o of(t.write("const newResult = {};"),n.keys)){let n=i[o],a=V(o),s=e[o],l=s?._zod?.optin==="optional",u=s?._zod?.optout==="optional";t.write(`const ${n} = ${r(o)};`),l&&u?t.write(`
|
|
2
|
+
if (${n}.issues.length) {
|
|
3
|
+
if (${a} in input) {
|
|
4
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
5
|
+
...iss,
|
|
6
|
+
path: iss.path ? [${a}, ...iss.path] : [${a}]
|
|
7
|
+
})));
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (${n}.value === undefined) {
|
|
12
|
+
if (${a} in input) {
|
|
13
|
+
newResult[${a}] = undefined;
|
|
14
|
+
}
|
|
15
|
+
} else {
|
|
16
|
+
newResult[${a}] = ${n}.value;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
`):l?t.write(`
|
|
20
|
+
if (${n}.issues.length) {
|
|
21
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
22
|
+
...iss,
|
|
23
|
+
path: iss.path ? [${a}, ...iss.path] : [${a}]
|
|
24
|
+
})));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (${n}.value === undefined) {
|
|
28
|
+
if (${a} in input) {
|
|
29
|
+
newResult[${a}] = undefined;
|
|
30
|
+
}
|
|
31
|
+
} else {
|
|
32
|
+
newResult[${a}] = ${n}.value;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
`):t.write(`
|
|
36
|
+
const ${n}_present = ${a} in input;
|
|
37
|
+
if (${n}.issues.length) {
|
|
38
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
39
|
+
...iss,
|
|
40
|
+
path: iss.path ? [${a}, ...iss.path] : [${a}]
|
|
41
|
+
})));
|
|
42
|
+
}
|
|
43
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
44
|
+
payload.issues.push({
|
|
45
|
+
code: "invalid_type",
|
|
46
|
+
expected: "nonoptional",
|
|
47
|
+
input: undefined,
|
|
48
|
+
path: [${a}]
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (${n}_present) {
|
|
53
|
+
if (${n}.value === undefined) {
|
|
54
|
+
newResult[${a}] = undefined;
|
|
55
|
+
} else {
|
|
56
|
+
newResult[${a}] = ${n}.value;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
`)}t.write("payload.value = newResult;"),t.write("return payload;");let s=t.compile();return(t,n)=>s(e,t,n)})(t.shape)),l=n(l,c),u)?tl([],d,l,c,r,e):l:i(l,c):(l.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),l)}});function td(e,t,n,r){for(let n of e)if(0===n.issues.length)return t.value=n.value,t;let i=e.filter(e=>!et(e));return 1===i.length?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ei(e,r,u())))}),t)}let tf=o("$ZodUnion",(e,t)=>{eP.init(e,t),F(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),F(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),F(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),F(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>U(e.source)).join("|")})$`)}});let n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let o=!1,a=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)a.push(t),o=!0;else{if(0===t.issues.length)return t;a.push(t)}}return o?Promise.all(a).then(t=>td(t,r,e,i)):td(a,r,e,i)}}),th=o("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,tf.init(e,t);let n=e._zod.parse;F(e._zod,"propValues",()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||0===Object.keys(r).length)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r))for(let r of(e[t]||(e[t]=new Set),n))e[t].add(r)}return e});let r=C(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,o)=>{let a=i.value;if(!q(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),i;let s=r.value.get(a?.[t.discriminator]);return s?s._zod.run(i,o):t.unionFallback||"backward"===o.direction?n(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()),input:a,path:[t.discriminator],inst:e}),i)}}),tp=o("$ZodIntersection",(e,t)=>{eP.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),o=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([t,n])=>tm(e,t,n)):tm(e,i,o)}});function tm(e,t,n){let r,i=new Map;for(let n of t.issues)if("unrecognized_keys"===n.code)for(let e of(r??(r=n),n.keys))i.has(e)||i.set(e,{}),i.get(e).l=!0;else e.issues.push(n);for(let t of n.issues)if("unrecognized_keys"===t.code)for(let e of t.keys)i.has(e)||i.set(e,{}),i.get(e).r=!0;else e.issues.push(t);let o=[...i].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(o.length&&r&&e.issues.push({...r,keys:o}),et(e))return e;let a=function e(t,n){if(t===n||t instanceof Date&&n instanceof Date&&+t==+n)return{valid:!0,data:t};if(W(t)&&W(n)){let r=Object.keys(n),i=Object.keys(t).filter(e=>-1!==r.indexOf(e)),o={...t,...n};for(let r of i){let i=e(t[r],n[r]);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};o[r]=i.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<t.length;i++){let o=e(t[i],n[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};r.push(o.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}(t.value,n.value);if(!a.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}let ty=o("$ZodEnum",(e,t)=>{eP.init(e,t);let n=I(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>X.has(typeof e)).map(e=>"string"==typeof e?K(e):e.toString()).join("|")})$`),e._zod.parse=(t,i)=>{let o=t.value;return r.has(o)||t.issues.push({code:"invalid_value",values:n,input:o,inst:e}),t}}),tg=o("$ZodLiteral",(e,t)=>{if(eP.init(e,t),0===t.values.length)throw Error("Cannot create literal schema with no valid values");let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>"string"==typeof e?K(e):e?K(e.toString()):String(e)).join("|")})$`),e._zod.parse=(r,i)=>{let o=r.value;return n.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),tv=o("$ZodTransform",(e,t)=>{eP.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new s(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new a;return n.value=i,n.fallback=!0,n}});function t_(e,t){return void 0===t&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}let tb=o("$ZodOptional",(e,t)=>{eP.init(e,t),e._zod.optin="optional",e._zod.optout="optional",F(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),F(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${U(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>t_(e,r)):t_(i,r)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),tw=o("$ZodExactOptional",(e,t)=>{tb.init(e,t),F(e._zod,"values",()=>t.innerType._zod.values),F(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),tk=o("$ZodNullable",(e,t)=>{eP.init(e,t),F(e._zod,"optin",()=>t.innerType._zod.optin),F(e._zod,"optout",()=>t.innerType._zod.optout),F(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${U(e.source)}|null)$`):void 0}),F(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),tz=o("$ZodDefault",(e,t)=>{eP.init(e,t),e._zod.optin="optional",F(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>tx(e,t)):tx(r,t)}});function tx(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let tO=o("$ZodPrefault",(e,t)=>{eP.init(e,t),e._zod.optin="optional",F(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),t$=o("$ZodNonOptional",(e,t)=>{eP.init(e,t),F(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>tA(t,e)):tA(i,e)}});function tA(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}let tS=o("$ZodCatch",(e,t)=>{eP.init(e,t),e._zod.optin="optional",F(e._zod,"optout",()=>t.innerType._zod.optout),F(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ei(e,n,u()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ei(e,n,u()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),tE=o("$ZodPipe",(e,t)=>{eP.init(e,t),F(e._zod,"values",()=>t.in._zod.values),F(e._zod,"optin",()=>t.in._zod.optin),F(e._zod,"optout",()=>t.out._zod.optout),F(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>tN(e,t.in,n)):tN(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>tN(e,t.out,n)):tN(r,t.out,n)}});function tN(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}let tM=o("$ZodReadonly",(e,t)=>{eP.init(e,t),F(e._zod,"propValues",()=>t.innerType._zod.propValues),F(e._zod,"values",()=>t.innerType._zod.values),F(e._zod,"optin",()=>t.innerType?._zod?.optin),F(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(tZ):tZ(r)}});function tZ(e){return e.value=Object.freeze(e.value),e}let tj=o("$ZodCustom",(e,t)=>{es.init(e,t),eP.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>tT(t,n,r,e));tT(i,n,r,e)}});function tT(e,t,n,r){if(!e){let e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(ea(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class tP{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}(i=globalThis).__zod_globalRegistry??(i.__zod_globalRegistry=new tP);let tI=globalThis.__zod_globalRegistry;function tR(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Q(t)})}function tC(e,t){return new eu({check:"less_than",...Q(t),value:e,inclusive:!1})}function tU(e,t){return new eu({check:"less_than",...Q(t),value:e,inclusive:!0})}function tL(e,t){return new ec({check:"greater_than",...Q(t),value:e,inclusive:!1})}function tF(e,t){return new ec({check:"greater_than",...Q(t),value:e,inclusive:!0})}function tD(e,t){return new ed({check:"multiple_of",...Q(t),value:e})}function tJ(e,t){return new eh({check:"max_length",...Q(t),maximum:e})}function tV(e,t){return new ep({check:"min_length",...Q(t),minimum:e})}function tB(e,t){return new em({check:"length_equals",...Q(t),length:e})}function tq(e){return new ez({check:"overwrite",tx:e})}function tH(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??tI,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function tW(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;let a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a);let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,r);else{let n=a.schema,o=t.processors[i.type];if(!o)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);o(e,t,n,r)}let o=e._zod.parent;o&&(a.ref||(a.ref=o),tW(o,t,r),t.seen.get(o).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),"input"===t.io&&function e(t,n){let r=n??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let i=t._zod.def;if("transform"===i.type)return!0;if("array"===i.type)return e(i.element,r);if("set"===i.type)return e(i.valueType,r);if("lazy"===i.type)return e(i.getter(),r);if("promise"===i.type||"optional"===i.type||"nonoptional"===i.type||"nullable"===i.type||"readonly"===i.type||"default"===i.type||"prefault"===i.type)return e(i.innerType,r);if("intersection"===i.type)return e(i.left,r)||e(i.right,r);if("record"===i.type||"map"===i.type)return e(i.keyType,r)||e(i.valueType,r);if("pipe"===i.type)return!!t._zod.traits.has("$ZodCodec")||e(i.in,r)||e(i.out,r);if("object"===i.type){for(let t in i.shape)if(e(i.shape[t],r))return!0;return!1}if("union"===i.type){for(let t of i.options)if(e(t,r))return!0;return!1}if("tuple"===i.type){for(let t of i.items)if(e(t,r))return!0;if(i.rest&&e(i.rest,r))return!0}return!1}(e)&&(delete a.schema.examples,delete a.schema.default),"input"===t.io&&"_prefault"in a.schema&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function tG(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{if(t[1].schema.$ref)return;let r=t[1],{ref:i,defId:o}=(t=>{let r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let o=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=o,{defId:o,ref:`${i("__shared")}#/${r}/${o}`}}if(t[1]===n)return{ref:"#"};let i=`#/${r}/`,o=t[1].schema.id??`__schema${e.counter++}`;return{defId:o,ref:i+o}})(t);r.def={...r.schema},o&&(r.defId=o);let a=r.schema;for(let e in a)delete a[e];a.$ref=i};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
|
|
61
|
+
|
|
62
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){i(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){i(n);continue}}if(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&"ref"===e.reused){i(n);continue}}}function tX(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=t=>{let n=e.seen.get(t);if(null===n.ref)return;let i=n.def??n.schema,o={...i},a=n.ref;if(n.ref=null,a){r(a);let n=e.seen.get(a),s=n.schema;if(s.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,o),t._zod.parent===a)for(let e in i)"$ref"!==e&&"allOf"!==e&&(e in o||delete i[e]);if(s.$ref&&n.def)for(let e in i)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==a){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if("draft-2020-12"===e.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;void 0!==o&&i.id===o&&delete i.id;let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&("draft-2020-12"===e.target?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:tK(t,"input",e.processors),output:tK(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw Error("Error converting schema to JSON.")}}let tK=(e,t,n={})=>r=>{let{libraryOptions:i,target:o}=r??{},a=tH({...i??{},target:o,io:t,processors:n});return tW(e,a),tG(a,e),tX(a,e)},tY={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},tQ=(e,t,n,r)=>{let i=e._zod.def;tW(i.innerType,t,r),t.seen.get(e).ref=i.innerType},t0=o("ZodISODateTime",(e,t)=>{eG.init(e,t),nh.init(e,t)}),t1=o("ZodISODate",(e,t)=>{eX.init(e,t),nh.init(e,t)}),t2=o("ZodISOTime",(e,t)=>{eK.init(e,t),nh.init(e,t)}),t4=o("ZodISODuration",(e,t)=>{eY.init(e,t),nh.init(e,t)}),t7=o("ZodError",(e,t)=>{e$.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>(function(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>r({issues:e},[...i,...o.path]));else if("invalid_key"===o.code)r({issues:o.issues},[...i,...o.path]);else if("invalid_element"===o.code)r({issues:o.issues},[...i,...o.path]);else{let e=[...i,...o.path];if(0===e.length)n._errors.push(t(o));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(o))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n})(e,t)},flatten:{value:t=>(function(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}})(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,R,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,R,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),t3=eS(t7),t9=eE(t7),t6=eN(t7),t8=eZ(t7),t5=(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return eS(t7)(e,t,r)},ne=(e,t,n)=>eS(t7)(e,t,n),nt=async(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return eE(t7)(e,t,r)},nn=async(e,t,n)=>eE(t7)(e,t,n),nr=(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return eN(t7)(e,t,r)},ni=(e,t,n)=>eN(t7)(e,t,n),no=async(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return eZ(t7)(e,t,r)},na=async(e,t,n)=>eZ(t7)(e,t,n),ns=new WeakMap;function nl(e,t,n){let r=Object.getPrototypeOf(e),i=ns.get(r);if(i||(i=new Set,ns.set(r,i)),!i.has(t))for(let e in i.add(t),n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}let nu=o("ZodType",(e,t)=>(eP.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:tK(e,"input"),output:tK(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{let r=tH({...n,processors:t});return tW(e,r),tG(r,e),tX(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>t3(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>t6(e,t,n),e.parseAsync=async(t,n)=>t9(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>t8(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>t5(e,t,n),e.decode=(t,n)=>ne(e,t,n),e.encodeAsync=async(t,n)=>nt(e,t,n),e.decodeAsync=async(t,n)=>nn(e,t,n),e.safeEncode=(t,n)=>nr(e,t,n),e.safeDecode=(t,n)=>ni(e,t,n),e.safeEncodeAsync=async(t,n)=>no(e,t,n),e.safeDecodeAsync=async(t,n)=>na(e,t,n),nl(e,"ZodType",{check(...e){let t=this.def;return this.clone(J(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Y(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new ro({type:"custom",check:"custom",fn:e,...Q(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var n;let r,i;return n=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(ea(e,t.value,r._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=t.value),e.inst??(e.inst=r),e.continue??(e.continue=!r._zod.def.abort),t.issues.push(ea(e)))},e(t.value,t)),(i=new es({check:"custom",...Q(t)}))._zod.check=n,r=i}(e,t))},overwrite(e){return this.check(tq(e))},optional(){return n7(this)},exactOptional(){var e;return e=this,new n3({type:"optional",innerType:e})},nullable(){return n6(this)},nullish(){return n7(n6(this))},nonoptional(e){var t;return t=this,new re({type:"nonoptional",innerType:t,...Q(e)})},array(){return nB(this)},or(e){return new nW({type:"union",options:[this,e],...Q(void 0)})},and(e){var t;return t=this,new nK({type:"intersection",left:t,right:e})},transform(e){return rr(this,new n2({type:"transform",transform:e}))},default(e){var t,n;return t=this,n=e,new n8({type:"default",innerType:t,get defaultValue(){return"function"==typeof n?n():G(n)}})},prefault(e){var t,n;return t=this,n=e,new n5({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof n?n():G(n)}})},catch(e){var t,n;return t=this,new rt({type:"catch",innerType:t,catchValue:"function"==typeof(n=e)?n:()=>n})},pipe(e){return rr(this,e)},readonly(){var e;return e=this,new ri({type:"readonly",innerType:e})},describe(e){let t=this.clone();return tI.add(t,{description:e}),t},meta(...e){if(0===e.length)return tI.get(this);let t=this.clone();return tI.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get:()=>tI.get(e)?.description,configurable:!0}),e)),nc=o("_ZodString",(e,t)=>{eI.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{n.type="string";let{minimum:i,maximum:o,format:a,patterns:s,contentEncoding:l}=e._zod.bag;if("number"==typeof i&&(n.minLength=i),"number"==typeof o&&(n.maxLength=o),a&&(n.format=tY[a]??a,""===n.format&&delete n.format,"time"===a&&delete n.format),l&&(n.contentEncoding=l),s&&s.size>0){let e=[...s];1===e.length?n.pattern=e[0].source:e.length>1&&(n.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n,0);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,nl(e,"_ZodString",{regex(...e){return this.check(function(e,t){return new eg({check:"string_format",format:"regex",...Q(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new eb({check:"string_format",format:"includes",...Q(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new ew({check:"string_format",format:"starts_with",...Q(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new ek({check:"string_format",format:"ends_with",...Q(t),suffix:e})}(...e))},min(...e){return this.check(tV(...e))},max(...e){return this.check(tJ(...e))},length(...e){return this.check(tB(...e))},nonempty(...e){return this.check(tV(1,...e))},lowercase(e){return this.check(new ev({check:"string_format",format:"lowercase",...Q(e)}))},uppercase(e){return this.check(new e_({check:"string_format",format:"uppercase",...Q(e)}))},trim(){return this.check(tq(e=>e.trim()))},normalize(...e){return this.check(function(e){return tq(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(tq(e=>e.toLowerCase()))},toUpperCase(){return this.check(tq(e=>e.toUpperCase()))},slugify(){return this.check(tq(e=>e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")))}})}),nd=o("ZodString",(e,t)=>{eI.init(e,t),nc.init(e,t),e.email=t=>e.check(new np({type:"string",format:"email",check:"string_format",abort:!1,...Q(t)})),e.url=t=>e.check(new ng({type:"string",format:"url",check:"string_format",abort:!1,...Q(t)})),e.jwt=t=>e.check(new nZ({type:"string",format:"jwt",check:"string_format",abort:!1,...Q(t)})),e.emoji=t=>e.check(new nv({type:"string",format:"emoji",check:"string_format",abort:!1,...Q(t)})),e.guid=t=>e.check(tR(nm,t)),e.uuid=t=>e.check(new ny({type:"string",format:"uuid",check:"string_format",abort:!1,...Q(t)})),e.uuidv4=t=>e.check(new ny({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Q(t)})),e.uuidv6=t=>e.check(new ny({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Q(t)})),e.uuidv7=t=>e.check(new ny({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Q(t)})),e.nanoid=t=>e.check(new n_({type:"string",format:"nanoid",check:"string_format",abort:!1,...Q(t)})),e.guid=t=>e.check(tR(nm,t)),e.cuid=t=>e.check(new nb({type:"string",format:"cuid",check:"string_format",abort:!1,...Q(t)})),e.cuid2=t=>e.check(new nw({type:"string",format:"cuid2",check:"string_format",abort:!1,...Q(t)})),e.ulid=t=>e.check(new nk({type:"string",format:"ulid",check:"string_format",abort:!1,...Q(t)})),e.base64=t=>e.check(new nE({type:"string",format:"base64",check:"string_format",abort:!1,...Q(t)})),e.base64url=t=>e.check(new nN({type:"string",format:"base64url",check:"string_format",abort:!1,...Q(t)})),e.xid=t=>e.check(new nz({type:"string",format:"xid",check:"string_format",abort:!1,...Q(t)})),e.ksuid=t=>e.check(new nx({type:"string",format:"ksuid",check:"string_format",abort:!1,...Q(t)})),e.ipv4=t=>e.check(new nO({type:"string",format:"ipv4",check:"string_format",abort:!1,...Q(t)})),e.ipv6=t=>e.check(new n$({type:"string",format:"ipv6",check:"string_format",abort:!1,...Q(t)})),e.cidrv4=t=>e.check(new nA({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Q(t)})),e.cidrv6=t=>e.check(new nS({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Q(t)})),e.e164=t=>e.check(new nM({type:"string",format:"e164",check:"string_format",abort:!1,...Q(t)})),e.datetime=t=>e.check(new t0({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Q(t)})),e.date=t=>e.check(new t1({type:"string",format:"date",check:"string_format",...Q(t)})),e.time=t=>e.check(new t2({type:"string",format:"time",check:"string_format",precision:null,...Q(t)})),e.duration=t=>e.check(new t4({type:"string",format:"duration",check:"string_format",...Q(t)}))});function nf(e){return new nd({type:"string",...Q(e)})}let nh=o("ZodStringFormat",(e,t)=>{eR.init(e,t),nc.init(e,t)}),np=o("ZodEmail",(e,t)=>{eL.init(e,t),nh.init(e,t)}),nm=o("ZodGUID",(e,t)=>{eC.init(e,t),nh.init(e,t)}),ny=o("ZodUUID",(e,t)=>{eU.init(e,t),nh.init(e,t)}),ng=o("ZodURL",(e,t)=>{eF.init(e,t),nh.init(e,t)}),nv=o("ZodEmoji",(e,t)=>{eD.init(e,t),nh.init(e,t)}),n_=o("ZodNanoID",(e,t)=>{eJ.init(e,t),nh.init(e,t)}),nb=o("ZodCUID",(e,t)=>{eV.init(e,t),nh.init(e,t)}),nw=o("ZodCUID2",(e,t)=>{eB.init(e,t),nh.init(e,t)}),nk=o("ZodULID",(e,t)=>{eq.init(e,t),nh.init(e,t)}),nz=o("ZodXID",(e,t)=>{eH.init(e,t),nh.init(e,t)}),nx=o("ZodKSUID",(e,t)=>{eW.init(e,t),nh.init(e,t)}),nO=o("ZodIPv4",(e,t)=>{eQ.init(e,t),nh.init(e,t)}),n$=o("ZodIPv6",(e,t)=>{e0.init(e,t),nh.init(e,t)}),nA=o("ZodCIDRv4",(e,t)=>{e1.init(e,t),nh.init(e,t)}),nS=o("ZodCIDRv6",(e,t)=>{e2.init(e,t),nh.init(e,t)}),nE=o("ZodBase64",(e,t)=>{e7.init(e,t),nh.init(e,t)}),nN=o("ZodBase64URL",(e,t)=>{e3.init(e,t),nh.init(e,t)}),nM=o("ZodE164",(e,t)=>{e9.init(e,t),nh.init(e,t)}),nZ=o("ZodJWT",(e,t)=>{e6.init(e,t),nh.init(e,t)}),nj=o("ZodNumber",(e,t)=>{e8.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let{minimum:i,maximum:o,format:a,multipleOf:s,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;"string"==typeof a&&a.includes("int")?n.type="integer":n.type="number";let c="number"==typeof u&&u>=(i??-1/0),d="number"==typeof l&&l<=(o??1/0),f="draft-04"===t.target||"openapi-3.0"===t.target;c?f?(n.minimum=u,n.exclusiveMinimum=!0):n.exclusiveMinimum=u:"number"==typeof i&&(n.minimum=i),d?f?(n.maximum=l,n.exclusiveMaximum=!0):n.exclusiveMaximum=l:"number"==typeof o&&(n.maximum=o),"number"==typeof s&&(n.multipleOf=s)})(e,t,n,0),nl(e,"ZodNumber",{gt(e,t){return this.check(tL(e,t))},gte(e,t){return this.check(tF(e,t))},min(e,t){return this.check(tF(e,t))},lt(e,t){return this.check(tC(e,t))},lte(e,t){return this.check(tU(e,t))},max(e,t){return this.check(tU(e,t))},int(e){return this.check(nI(e))},safe(e){return this.check(nI(e))},positive(e){return this.check(tL(0,e))},nonnegative(e){return this.check(tF(0,e))},negative(e){return this.check(tC(0,e))},nonpositive(e){return this.check(tU(0,e))},multipleOf(e,t){return this.check(tD(e,t))},step(e,t){return this.check(tD(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function nT(e){return new nj({type:"number",checks:[],...Q(e)})}let nP=o("ZodNumberFormat",(e,t)=>{e5.init(e,t),nj.init(e,t)});function nI(e){return new nP({type:"number",check:"number_format",abort:!1,format:"safeint",...Q(e)})}let nR=o("ZodBoolean",(e,t)=>{te.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.type="boolean"}});function nC(e){return new nR({type:"boolean",...Q(e)})}let nU=o("ZodAny",(e,t)=>{tt.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function nL(){return new nU({type:"any"})}let nF=o("ZodUnknown",(e,t)=>{tn.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function nD(){return new nF({type:"unknown"})}let nJ=o("ZodNever",(e,t)=>{tr.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.not={}}}),nV=o("ZodArray",(e,t)=>{to.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def,{minimum:o,maximum:a}=e._zod.bag;"number"==typeof o&&(n.minItems=o),"number"==typeof a&&(n.maxItems=a),n.type="array",n.items=tW(i.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,nl(e,"ZodArray",{min(e,t){return this.check(tV(e,t))},nonempty(e){return this.check(tV(1,e))},max(e,t){return this.check(tJ(e,t))},length(e,t){return this.check(tB(e,t))},unwrap(){return this.element}})});function nB(e,t){return new nV({type:"array",element:e,...Q(t)})}let nq=o("ZodObject",(e,t)=>{tc.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;n.type="object",n.properties={};let o=i.shape;for(let e in o)n.properties[e]=tW(o[e],t,{...r,path:[...r.path,"properties",e]});let a=new Set([...new Set(Object.keys(o))].filter(e=>{let n=i.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));a.size>0&&(n.required=Array.from(a)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=tW(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(n.additionalProperties=!1)})(e,t,n,r),F(e,"shape",()=>t.shape),nl(e,"ZodObject",{keyof(){return nQ(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:nD()})},loose(){return this.clone({...this._zod.def,catchall:nD()})},strict(){return this.clone({...this._zod.def,catchall:new nJ({type:"never",...Q(void 0)})})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return function(e,t){if(!W(t))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=J(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return D(this,"shape",n),n}});return Y(e,r)}(this,e)},safeExtend(e){var t=this;if(!W(e))throw Error("Invalid input to safeExtend: expected a plain object");let n=J(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return D(this,"shape",n),n}});return Y(t,n)},merge(e){var t=this;if(t._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=J(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return D(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Y(t,n)},pick(e){return function(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i=J(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return D(this,"shape",e),e},checks:[]});return Y(e,i)}(this,e)},omit(e){return function(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=J(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return D(this,"shape",r),r},checks:[]});return Y(e,i)}(this,e)},partial(...e){return function(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let i=J(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return D(this,"shape",i),i},checks:[]});return Y(t,i)}(n4,this,e[0])},required(...e){var t,n;let r;return t=this,n=e[0],r=J(t._zod.def,{get shape(){let e=t._zod.def.shape,r={...e};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(r[t]=new re({type:"nonoptional",innerType:e[t]}))}else for(let t in e)r[t]=new re({type:"nonoptional",innerType:e[t]});return D(this,"shape",r),r}}),Y(t,r)}})});function nH(e,t){return new nq({type:"object",shape:e??{},...Q(t)})}let nW=o("ZodUnion",(e,t)=>{tf.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a;return o=!1===(i=e._zod.def).inclusive,a=i.options.map((e,n)=>tW(e,t,{...r,path:[...r.path,o?"oneOf":"anyOf",n]})),void(o?n.oneOf=a:n.anyOf=a)},e.options=t.options}),nG=o("ZodDiscriminatedUnion",(e,t)=>{nW.init(e,t),th.init(e,t)});function nX(e,t,n){return new nG({type:"union",options:t,discriminator:e,...Q(n)})}let nK=o("ZodIntersection",(e,t)=>{tp.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a,s;return o=tW((i=e._zod.def).left,t,{...r,path:[...r.path,"allOf",0]}),a=tW(i.right,t,{...r,path:[...r.path,"allOf",1]}),void(n.allOf=[...(s=e=>"allOf"in e&&1===Object.keys(e).length)(o)?o.allOf:[o],...s(a)?a.allOf:[a]])}}),nY=o("ZodEnum",(e,t)=>{ty.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;(i=I(e._zod.def.entries)).every(e=>"number"==typeof e)&&(n.type="number"),i.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=i},e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new nY({...t,checks:[],...Q(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new nY({...t,checks:[],...Q(r),entries:i})}});function nQ(e,t){return new nY({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...Q(t)})}let n0=o("ZodLiteral",(e,t)=>{tg.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def,o=[];for(let e of i.values)if(void 0===e){if("throw"===t.unrepresentable)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e)if("throw"===t.unrepresentable)throw Error("BigInt literals cannot be represented in JSON Schema");else o.push(Number(e));else o.push(e);if(0===o.length);else if(1===o.length){let e=o[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else o.every(e=>"number"==typeof e)&&(n.type="number"),o.every(e=>"string"==typeof e)&&(n.type="string"),o.every(e=>"boolean"==typeof e)&&(n.type="boolean"),o.every(e=>null===e)&&(n.type="null"),n.enum=o})(e,t,n,0),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function n1(e,t){return new n0({type:"literal",values:Array.isArray(e)?e:[e],...Q(t)})}let n2=o("ZodTransform",(e,t)=>{tv.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema")})(0,e,0,0),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new s(e.constructor.name);n.addIssue=r=>{"string"==typeof r?n.issues.push(ea(r,n.value,t)):(r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),n.issues.push(ea(r)))};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}}),n4=o("ZodOptional",(e,t)=>{tb.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tQ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function n7(e){return new n4({type:"optional",innerType:e})}let n3=o("ZodExactOptional",(e,t)=>{tw.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tQ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),n9=o("ZodNullable",(e,t)=>{tk.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a;return o=tW((i=e._zod.def).innerType,t,r),a=t.seen.get(e),void("openapi-3.0"===t.target?(a.ref=i.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function n6(e){return new n9({type:"nullable",innerType:e})}let n8=o("ZodDefault",(e,t)=>{tz.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;tW((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),n5=o("ZodPrefault",(e,t)=>{tO.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;tW((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},e.unwrap=()=>e._zod.def.innerType}),re=o("ZodNonOptional",(e,t)=>{t$.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;tW((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType},e.unwrap=()=>e._zod.def.innerType}),rt=o("ZodCatch",(e,t)=>{tS.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i,o=e._zod.def;tW(o.innerType,t,r),t.seen.get(e).ref=o.innerType;try{i=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}n.default=i})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),rn=o("ZodPipe",(e,t)=>{tE.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a;return o=(i=e._zod.def).in._zod.traits.has("$ZodTransform"),void(tW(a="input"===t.io?o?i.out:i.in:i.out,t,r),t.seen.get(e).ref=a)},e.in=t.in,e.out=t.out});function rr(e,t){return new rn({type:"pipe",in:e,out:t})}let ri=o("ZodReadonly",(e,t)=>{tM.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;tW((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType,n.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),ro=o("ZodCustom",(e,t)=>{tj.init(e,t),nu.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")})(0,e,0,0)})},8962:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]])},9107:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]])},9339:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r={callServer:function(){return o.callServer},createServerReference:function(){return s.createServerReference},findSourceMapURL:function(){return a.findSourceMapURL}};for(var i in r)Object.defineProperty(t,i,{enumerable:!0,get:r[i]});let o=n(77304),a=n(4060),s=n(77197)},12651:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]])},14225:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])},15480:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("git-branch",[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]])},17082:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]])},17112:(e,t,n)=>{n.d(t,{D:()=>a});var r=n(12115),i=n(63699),o=n(94257);function a(e){let t=r.useContext(i.Ts)?"drawer":"dialog";return(0,o.G)(e,t)}},17356:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},17494:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]])},19707:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]])},24413:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("compass",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]])},25583:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("file-code-corner",[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]])},25640:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("map-pinned",[["path",{d:"M18 8c0 3.613-3.869 7.429-5.393 8.795a1 1 0 0 1-1.214 0C9.87 15.429 6 11.613 6 8a6 6 0 0 1 12 0",key:"11u0oz"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["path",{d:"M8.714 14h-3.71a1 1 0 0 0-.948.683l-2.004 6A1 1 0 0 0 3 22h18a1 1 0 0 0 .948-1.316l-2-6a1 1 0 0 0-.949-.684h-3.712",key:"q8zwxj"}]])},27700:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("component",[["path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1uwlt4"}],["path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z",key:"10291m"}],["path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z",key:"1tqoq1"}],["path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1x6lto"}]])},40638:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("message-circle-question-mark",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},44825:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("rocket",[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]])},45486:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("panel-right",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]])},48869:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("gamepad-2",[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]])},54154:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("package-check",[["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m16 17 2 2 4-4",key:"uh5qu3"}],["path",{d:"M21 11.127V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.32-.753",key:"kpkbpo"}],["path",{d:"M3.29 7 12 12l8.71-5",key:"19ckod"}],["path",{d:"m7.5 4.27 8.997 5.148",key:"9yrvtv"}]])},55776:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("notebook-pen",[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]])},61285:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("mouse-pointer-2",[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]])},61388:(e,t,n)=>{n.d(t,{b:()=>p});var r=n(12115),i=n.t(r,2);function o(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}n(47650);var a=n(95155),s=Symbol.for("react.lazy"),l=i[" use ".trim().toString()];function u(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===s&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var c=Symbol("radix.slottable");function d(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===c}var f=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{var n,i;let s,c,f,h=(i=n=`Primitive.${t}`,(s=r.forwardRef((e,t)=>{let{children:n,...i}=e;if(u(n)&&"function"==typeof l&&(n=l(n._payload)),r.isValidElement(n)){var a;let e,s,l=(a=n,(s=(e=Object.getOwnPropertyDescriptor(a.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.ref:(s=(e=Object.getOwnPropertyDescriptor(a,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.props.ref:a.props.ref||a.ref),u=function(e,t){let n={...t};for(let r in t){let i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...e)=>{let t=o(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}(i,n.props);return n.type!==r.Fragment&&(u.ref=t?function(...e){return t=>{let n=!1,r=e.map(e=>{let r=o(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];"function"==typeof n?n():o(e[t],null)}}}}(t,l):l),r.cloneElement(n,u)}return r.Children.count(n)>1?r.Children.only(null):null})).displayName=`${i}.SlotClone`,c=s,(f=r.forwardRef((e,t)=>{let{children:n,...i}=e;u(n)&&"function"==typeof l&&(n=l(n._payload));let o=r.Children.toArray(n),s=o.find(d);if(s){let e=s.props.children,n=o.map(t=>t!==s?t:r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null);return(0,a.jsx)(c,{...i,ref:t,children:r.isValidElement(e)?r.cloneElement(e,void 0,n):null})}return(0,a.jsx)(c,{...i,ref:t,children:n})})).displayName=`${n}.Slot`,f),p=r.forwardRef((e,n)=>{let{asChild:r,...i}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,a.jsx)(r?h:t,{...i,ref:n})});return p.displayName=`Primitive.${t}`,{...e,[t]:p}},{}),h=r.forwardRef((e,t)=>(0,a.jsx)(f.label,{...e,ref:t,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));h.displayName="Label";var p=h},65377:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},68426:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]])},71019:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("credit-card",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]])},72974:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("webhook",[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]])},76181:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("hexagon",[["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}]])},76721:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},78780:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},80846:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]])},85222:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]])},85618:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]])},91906:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("hand",[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]])},92571:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},94192:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("folder-tree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]])},95660:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]])},98112:(e,t,n)=>{let r;n.d(t,{sX:()=>X});let i=BigInt(0x100000000-1),o=BigInt(32);function a(e,t=""){if("number"!=typeof e){let n=t&&`"${t}" `;throw TypeError(`${n}expected number, got ${typeof e}`)}if(!Number.isSafeInteger(e)||e<0){let n=t&&`"${t}" `;throw RangeError(`${n}expected integer >= 0, got ${e}`)}}function s(e,t,n=""){let r=e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name&&"BYTES_PER_ELEMENT"in e&&1===e.BYTES_PER_ELEMENT,i=e?.length,o=void 0!==t;if(!r||o&&i!==t){let a=(n&&`"${n}" `)+"expected Uint8Array"+(o?` of length ${t}`:"")+", got "+(r?`length=${i}`:`type=${typeof e}`);if(!r)throw TypeError(a);throw RangeError(a)}return e}function l(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function u(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}let c=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0]?e=>e:function(e){for(let n=0;n<e.length;n++){var t;e[n]=(t=e[n])<<24&0xff000000|t<<8&0xff0000|t>>>8&65280|t>>>24&255}return e},d=BigInt(0),f=BigInt(1),h=BigInt(2),p=BigInt(7),m=BigInt(256),y=BigInt(113),g=[],v=[],_=[];for(let e=0,t=f,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],g.push(2*(5*r+n)),v.push((e+1)*(e+2)/2%64);let i=d;for(let e=0;e<7;e++)(t=(t<<f^(t>>p)*y)%m)&h&&(i^=f<<(f<<BigInt(e))-f);_.push(i)}let b=function(e,t=!1){let n=e.length,r=new Uint32Array(n),a=new Uint32Array(n);for(let s=0;s<n;s++){let{h:n,l}=function(e,t=!1){return t?{h:Number(e&i),l:Number(e>>o&i)}:{h:0|Number(e>>o&i),l:0|Number(e&i)}}(e[s],t);[r[s],a[s]]=[n,l]}return[r,a]}(_,!0),w=b[0],k=b[1],z=(e,t,n)=>n>32?t<<n-32|e>>>64-n:e<<n|t>>>32-n,x=(e,t,n)=>n>32?e<<n-32|t>>>64-n:t<<n|e>>>32-n;class O{state;pos=0;posOut=0;finished=!1;state32;destroyed=!1;blockLen;suffix;outputLen;canXOF;enableXOF=!1;rounds;constructor(e,t,n,r=!1,i=24){if(this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.canXOF=r,this.rounds=i,a(n,"outputLen"),!(0<e&&e<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=function(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}(this.state)}clone(){return this._cloneInto()}keccak(){c(this.state32),function(e,t=24){if(a(t,"rounds"),t<1||t>24)throw Error('"rounds" expected integer 1..24');let n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let r=(t+8)%10,i=(t+2)%10,o=n[i],a=n[i+1],s=z(o,a,1)^n[r],l=x(o,a,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=s,e[t+n+1]^=l}let t=e[2],i=e[3];for(let n=0;n<24;n++){let r=v[n],o=z(t,i,r),a=x(t,i,r),s=g[n];t=e[s],i=e[s+1],e[s]=o,e[s+1]=a}for(let t=0;t<50;t+=10){let n=e[t],r=e[t+1],i=e[t+2],o=e[t+3];e[t]^=~e[t+2]&e[t+4],e[t+1]^=~e[t+3]&e[t+5],e[t+2]^=~e[t+4]&e[t+6],e[t+3]^=~e[t+5]&e[t+7],e[t+4]^=~e[t+6]&e[t+8],e[t+5]^=~e[t+7]&e[t+9],e[t+6]^=~e[t+8]&n,e[t+7]^=~e[t+9]&r,e[t+8]^=~n&i,e[t+9]^=~r&o}e[0]^=w[r],e[1]^=k[r]}u(n)}(this.state32,this.rounds),c(this.state32),this.posOut=0,this.pos=0}update(e){l(this),s(e);let{blockLen:t,state:n}=this,r=e.length;for(let i=0;i<r;){let o=Math.min(t-this.pos,r-i);for(let t=0;t<o;t++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,(128&t)!=0&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){l(this,!1),s(e),this.finish();let t=this.state,{blockLen:n}=this;for(let r=0,i=e.length;r<i;){this.posOut>=n&&this.keccak();let o=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return a(e),this.xofInto(new Uint8Array(e))}digestInto(e){s(e,void 0,"digestInto() output");let t=this.outputLen;if(e.length<t)throw RangeError('"digestInto() output" expected to be of length >='+t);if(this.finished)throw Error("digest() was already called");this.writeInto(e.subarray(0,this.outputLen)),this.destroy()}digest(){let e=new Uint8Array(this.outputLen);return this.digestInto(e),e}destroy(){this.destroyed=!0,u(this.state)}_cloneInto(e){let{blockLen:t,suffix:n,outputLen:r,rounds:i,enableXOF:o}=this;return(e||=new O(t,n,r,o,i)).blockLen=t,e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=r,e.enableXOF=o,e.canXOF=this.canXOF,e.destroyed=this.destroyed,e}}let $=((e,t,n,r={})=>(function(e,t={}){let n=(t,n)=>e(n).update(t).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=t=>e(t),Object.assign(n,t),Object.freeze(n)})(()=>new O(t,e,n),r))(6,72,64,{oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,10])});var A,S=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,E=Math.ceil,N=Math.floor,M="[BigNumber Error] ",Z=M+"Number primitive has more than 15 significant digits: ",j=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13];function T(e){var t=0|e;return e>0||e===t?t:t-1}function P(e){for(var t,n,r=1,i=e.length,o=e[0]+"";r<i;){for(n=14-(t=e[r++]+"").length;n--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function I(e,t){var n,r,i=e.c,o=t.c,a=e.s,s=t.s,l=e.e,u=t.e;if(!a||!s)return null;if(n=i&&!i[0],r=o&&!o[0],n||r)return n?r?0:-s:a;if(a!=s)return a;if(n=a<0,r=l==u,!i||!o)return r?0:!i^n?1:-1;if(!r)return l>u^n?1:-1;for(a=0,s=(l=i.length)<(u=o.length)?l:u;a<s;a++)if(i[a]!=o[a])return i[a]>o[a]^n?1:-1;return l==u?0:l>u^n?1:-1}function R(e,t,n,r){if(e<t||e>n||e!==N(e))throw Error(M+(r||"Argument")+("number"==typeof e?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function C(e){var t=e.c.length-1;return T(e.e/14)==t&&e.c[t]%2!=0}function U(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function L(e,t,n){var r,i;if(t<0){for(i=n+".";++t;i+=n);e=i+e}else if(r=e.length,++t>r){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}var F=function e(t){var n,r,i,o,a,s,l,u,c,d=O.prototype={constructor:O,toString:null,valueOf:null},f=new O(1),h=20,p=4,m=-7,y=21,g=-1e7,v=1e7,_=!1,b=1,w=0,k={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xa0",suffix:""},z="0123456789abcdefghijklmnopqrstuvwxyz",x=!0;function O(e,t){var n,r,i,o,a,s,l,d,f=this;if(!(f instanceof O))return new O(e,t);if(null==t){if(e&&!0===e._isBigNumber){f.s=e.s,!e.c||e.e>v?f.c=f.e=null:e.e<g?f.c=[f.e=0]:(f.e=e.e,f.c=e.c.slice());return}if((s="number"==typeof e)&&0*e==0){if(f.s=1/e<0?(e=-e,-1):1,e===~~e){for(o=0,a=e;a>=10;a/=10,o++);o>v?f.c=f.e=null:(f.e=o,f.c=[e]);return}d=String(e)}else{if(!S.test(d=String(e)))return c(f,d,s);f.s=45==d.charCodeAt(0)?(d=d.slice(1),-1):1}(o=d.indexOf("."))>-1&&(d=d.replace(".","")),(a=d.search(/e/i))>0?(o<0&&(o=a),o+=+d.slice(a+1),d=d.substring(0,a)):o<0&&(o=d.length)}else{if(R(t,2,z.length,"Base"),10==t&&x)return D(f=new O(e),h+f.e+1,p);if(d=String(e),s="number"==typeof e){if(0*e!=0)return c(f,d,s,t);if(f.s=1/e<0?(d=d.slice(1),-1):1,O.DEBUG&&d.replace(/^0\.0*|\./,"").length>15)throw Error(Z+e)}else f.s=45===d.charCodeAt(0)?(d=d.slice(1),-1):1;for(n=z.slice(0,t),o=a=0,l=d.length;a<l;a++)if(0>n.indexOf(r=d.charAt(a))){if("."==r){if(a>o){o=l;continue}}else if(!i&&(d==d.toUpperCase()&&(d=d.toLowerCase())||d==d.toLowerCase()&&(d=d.toUpperCase()))){i=!0,a=-1,o=0;continue}return c(f,String(e),s,t)}s=!1,(o=(d=u(d,t,10,f.s)).indexOf("."))>-1?d=d.replace(".",""):o=d.length}for(a=0;48===d.charCodeAt(a);a++);for(l=d.length;48===d.charCodeAt(--l););if(d=d.slice(a,++l)){if(l-=a,s&&O.DEBUG&&l>15&&(e>0x1fffffffffffff||e!==N(e)))throw Error(Z+f.s*e);if((o=o-a-1)>v)f.c=f.e=null;else if(o<g)f.c=[f.e=0];else{if(f.e=o,f.c=[],a=(o+1)%14,o<0&&(a+=14),a<l){for(a&&f.c.push(+d.slice(0,a)),l-=14;a<l;)f.c.push(+d.slice(a,a+=14));a=14-(d=d.slice(a)).length}else a-=l;for(;a--;d+="0");f.c.push(+d)}}else f.c=[f.e=0]}function $(e,t,n,r){var i,o,a,s,l;if(null==n?n=p:R(n,0,8),!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)l=P(e.c),l=1==r||2==r&&(a<=m||a>=y)?U(l,a):L(l,a,"0");else if(o=(e=D(new O(e),t,n)).e,s=(l=P(e.c)).length,1==r||2==r&&(t<=o||o<=m)){for(;s<t;l+="0",s++);l=U(l,o)}else if(t-=a+(2===r&&o>a),l=L(l,o,"0"),o+1>s){if(--t>0)for(l+=".";t--;l+="0");}else if((t+=o-s)>0)for(o+1==s&&(l+=".");t--;l+="0");return e.s<0&&i?"-"+l:l}function A(e,t){for(var n,r,i=1,o=new O(e[0]);i<e.length;i++)(r=new O(e[i])).s&&(n=I(o,r))!==t&&(0!==n||o.s!==t)||(o=r);return o}function F(e,t,n){for(var r=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,r++);return(n=r+14*n-1)>v?e.c=e.e=null:n<g?e.c=[e.e=0]:(e.e=n,e.c=t),e}function D(e,t,n,r){var i,o,a,s,l,u,c,d=e.c;if(d){e:{for(i=1,s=d[0];s>=10;s/=10,i++);if((o=t-i)<0)o+=14,a=t,c=N((l=d[u=0])/j[i-a-1]%10);else if((u=E((o+1)/14))>=d.length)if(r){for(;d.length<=u;d.push(0));l=c=0,i=1,o%=14,a=o-14+1}else break e;else{for(i=1,l=s=d[u];s>=10;s/=10,i++);o%=14,c=(a=o-14+i)<0?0:N(l/j[i-a-1]%10)}if(r=r||t<0||null!=d[u+1]||(a<0?l:l%j[i-a-1]),r=n<4?(c||r)&&(0==n||n==(e.s<0?3:2)):c>5||5==c&&(4==n||r||6==n&&(o>0?a>0?l/j[i-a]:0:d[u-1])%10&1||n==(e.s<0?8:7)),t<1||!d[0])return d.length=0,r?(t-=e.e+1,d[0]=j[(14-t%14)%14],e.e=-t||0):d[0]=e.e=0,e;if(0==o?(d.length=u,s=1,u--):(d.length=u+1,s=j[14-o],d[u]=a>0?N(l/j[i-a]%j[a])*s:0),r)for(;;)if(0==u){for(o=1,a=d[0];a>=10;a/=10,o++);for(a=d[0]+=s,s=1;a>=10;a/=10,s++);o!=s&&(e.e++,1e14==d[0]&&(d[0]=1));break}else{if(d[u]+=s,1e14!=d[u])break;d[u--]=0,s=1}for(o=d.length;0===d[--o];d.pop());}e.e>v?e.c=e.e=null:e.e<g&&(e.c=[e.e=0])}return e}function J(e){var t,n=e.e;return null===n?e.toString():(t=P(e.c),t=n<=m||n>=y?U(t,n):L(t,n,"0"),e.s<0?"-"+t:t)}return O.clone=e,O.ROUND_UP=0,O.ROUND_DOWN=1,O.ROUND_CEIL=2,O.ROUND_FLOOR=3,O.ROUND_HALF_UP=4,O.ROUND_HALF_DOWN=5,O.ROUND_HALF_EVEN=6,O.ROUND_HALF_CEIL=7,O.ROUND_HALF_FLOOR=8,O.EUCLID=9,O.config=O.set=function(e){var t,n;if(null!=e)if("object"==typeof e){if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(R(n=e[t],0,1e9,t),h=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(R(n=e[t],0,8,t),p=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(R(n[0],-1e9,0,t),R(n[1],0,1e9,t),m=n[0],y=n[1]):(R(n,-1e9,1e9,t),m=-(y=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)R(n[0],-1e9,-1,t),R(n[1],1,1e9,t),g=n[0],v=n[1];else if(R(n,-1e9,1e9,t),n)g=-(v=n<0?-n:n);else throw Error(M+t+" cannot be zero: "+n);if(e.hasOwnProperty(t="CRYPTO"))if(!!(n=e[t])===n)if(n)if("u">typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))_=n;else throw _=!n,Error(M+"crypto unavailable");else _=n;else throw Error(M+t+" not true or false: "+n);if(e.hasOwnProperty(t="MODULO_MODE")&&(R(n=e[t],0,9,t),b=n),e.hasOwnProperty(t="POW_PRECISION")&&(R(n=e[t],0,1e9,t),w=n),e.hasOwnProperty(t="FORMAT"))if("object"==typeof(n=e[t]))k=n;else throw Error(M+t+" not an object: "+n);if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(M+t+" invalid: "+n);x="0123456789"==n.slice(0,10),z=n}}else throw Error(M+"Object expected: "+e);return{DECIMAL_PLACES:h,ROUNDING_MODE:p,EXPONENTIAL_AT:[m,y],RANGE:[g,v],CRYPTO:_,MODULO_MODE:b,POW_PRECISION:w,FORMAT:k,ALPHABET:z}},O.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!O.DEBUG)return!0;var t,n,r=e.c,i=e.e,o=e.s;e:if("[object Array]"==({}).toString.call(r)){if((1===o||-1===o)&&i>=-1e9&&i<=1e9&&i===N(i)){if(0===r[0]){if(0===i&&1===r.length)return!0;break e}if((t=(i+1)%14)<1&&(t+=14),String(r[0]).length==t){for(t=0;t<r.length;t++)if((n=r[t])<0||n>=1e14||n!==N(n))break e;if(0!==n)return!0}}}else if(null===r&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(M+"Invalid BigNumber: "+e)},O.maximum=O.max=function(){return A(arguments,-1)},O.minimum=O.min=function(){return A(arguments,1)},n=0x20000000000000*Math.random()&2097151?function(){return N(0x20000000000000*Math.random())}:function(){return(0x40000000*Math.random()|0)*8388608+(8388608*Math.random()|0)},O.random=function(e){var t,r,i,o,a,s=0,l=[],u=new O(f);if(null==e?e=h:R(e,0,1e9),o=E(e/14),_)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));s<o;)(a=131072*t[s]+(t[s+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(l.push(a%1e14),s+=2);s=o/2}else if(crypto.randomBytes){for(t=crypto.randomBytes(o*=7);s<o;)(a=(31&t[s])*0x1000000000000+0x10000000000*t[s+1]+0x100000000*t[s+2]+0x1000000*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(l.push(a%1e14),s+=7);s=o/7}else throw _=!1,Error(M+"crypto unavailable");if(!_)for(;s<o;)(a=n())<9e15&&(l[s++]=a%1e14);for(o=l[--s],e%=14,o&&e&&(a=j[14-e],l[s]=N(o/a)*a);0===l[s];l.pop(),s--);if(s<0)l=[i=0];else{for(i=-1;0===l[0];l.splice(0,1),i-=14);for(s=1,a=l[0];a>=10;a/=10,s++);s<14&&(i-=14-s)}return u.e=i,u.c=l,u},O.sum=function(){for(var e=1,t=arguments,n=new O(t[0]);e<t.length;)n=n.plus(t[e++]);return n},u=function(){var e="0123456789";function t(e,t,n,r){for(var i,o,a=[0],s=0,l=e.length;s<l;){for(o=a.length;o--;a[o]*=t);for(a[0]+=r.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>n-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/n|0,a[i]%=n)}return a.reverse()}return function(n,r,i,o,a){var s,u,c,d,f,m,y,g,v=n.indexOf("."),_=h,b=p;for(v>=0&&(d=w,w=0,n=n.replace(".",""),m=(g=new O(r)).pow(n.length-v),w=d,g.c=t(L(P(m.c),m.e,"0"),10,i,e),g.e=g.c.length),c=d=(y=t(n,r,i,a?(s=z,e):(s=e,z))).length;0==y[--d];y.pop());if(!y[0])return s.charAt(0);if(v<0?--c:(m.c=y,m.e=c,m.s=o,y=(m=l(m,g,_,b,i)).c,f=m.r,c=m.e),v=y[u=c+_+1],d=i/2,f=f||u<0||null!=y[u+1],f=b<4?(null!=v||f)&&(0==b||b==(m.s<0?3:2)):v>d||v==d&&(4==b||f||6==b&&1&y[u-1]||b==(m.s<0?8:7)),u<1||!y[0])n=f?L(s.charAt(1),-_,s.charAt(0)):s.charAt(0);else{if(y.length=u,f)for(--i;++y[--u]>i;)y[u]=0,u||(++c,y=[1].concat(y));for(d=y.length;!y[--d];);for(v=0,n="";v<=d;n+=s.charAt(y[v++]));n=L(n,c,s.charAt(0))}return n}}(),l=function(){function e(e,t,n){var r,i,o,a,s=0,l=e.length,u=t%1e7,c=t/1e7|0;for(e=e.slice();l--;)r=c*(o=e[l]%1e7)+(a=e[l]/1e7|0)*u,s=((i=u*o+r%1e7*1e7+s)/n|0)+(r/1e7|0)+c*a,e[l]=i%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=+(e[n]<t[n]),e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,i,o,a,s){var l,u,c,d,f,h,p,m,y,g,v,_,b,w,k,z,x,$=r.s==i.s?1:-1,A=r.c,S=i.c;if(!A||!A[0]||!S||!S[0])return new O(!r.s||!i.s||(A?S&&A[0]==S[0]:!S)?NaN:A&&0==A[0]||!S?0*$:$/0);for(y=(m=new O($)).c=[],$=o+(u=r.e-i.e)+1,s||(s=1e14,u=T(r.e/14)-T(i.e/14),$=$/14|0),c=0;S[c]==(A[c]||0);c++);if(S[c]>(A[c]||0)&&u--,$<0)y.push(1),d=!0;else{for(w=A.length,z=S.length,c=0,$+=2,(f=N(s/(S[0]+1)))>1&&(S=e(S,f,s),A=e(A,f,s),z=S.length,w=A.length),b=z,v=(g=A.slice(0,z)).length;v<z;g[v++]=0);x=[0].concat(x=S.slice()),k=S[0],S[1]>=s/2&&k++;do{if(f=0,(l=t(S,g,z,v))<0){if(_=g[0],z!=v&&(_=_*s+(g[1]||0)),(f=N(_/k))>1)for(f>=s&&(f=s-1),p=(h=e(S,f,s)).length,v=g.length;1==t(h,g,p,v);)f--,n(h,z<p?x:S,p,s),p=h.length,l=1;else 0==f&&(l=f=1),p=(h=S.slice()).length;if(p<v&&(h=[0].concat(h)),n(g,h,v,s),v=g.length,-1==l)for(;1>t(S,g,z,v);)f++,n(g,z<v?x:S,v,s),v=g.length}else 0===l&&(f++,g=[0]);y[c++]=f,g[0]?g[v++]=A[b]||0:(g=[A[b]],v=1)}while((b++<w||null!=g[0])&&$--);d=null!=g[0],y[0]||y.splice(0,1)}if(1e14==s){for(c=1,$=y[0];$>=10;$/=10,c++);D(m,o+(m.e=c+14*u-1)+1,a,d)}else m.e=u,m.r=+d;return m}}(),r=/^(-?)0([xbo])(?=\w[\w.]*$)/i,i=/^([^.]+)\.$/,o=/^\.([^.]+)$/,a=/^-?(Infinity|NaN)$/,s=/^\s*\+(?=[\w.])|^\s+|\s+$/g,c=function(e,t,n,l){var u,c=n?t:t.replace(s,"");if(a.test(c))e.s=isNaN(c)?null:c<0?-1:1;else{if(!n&&(c=c.replace(r,function(e,t,n){return u="x"==(n=n.toLowerCase())?16:"b"==n?2:8,l&&l!=u?e:t}),l&&(u=l,c=c.replace(i,"$1").replace(o,"0.$1")),t!=c))return new O(c,u);if(O.DEBUG)throw Error(M+"Not a"+(l?" base "+l:"")+" number: "+t);e.s=null}e.c=e.e=null},d.absoluteValue=d.abs=function(){var e=new O(this);return e.s<0&&(e.s=1),e},d.comparedTo=function(e,t){return I(this,new O(e,t))},d.decimalPlaces=d.dp=function(e,t){var n,r,i;if(null!=e)return R(e,0,1e9),null==t?t=p:R(t,0,8),D(new O(this),e+this.e+1,t);if(!(n=this.c))return null;if(r=((i=n.length-1)-T(this.e/14))*14,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},d.dividedBy=d.div=function(e,t){return l(this,new O(e,t),h,p)},d.dividedToIntegerBy=d.idiv=function(e,t){return l(this,new O(e,t),0,1)},d.exponentiatedBy=d.pow=function(e,t){var n,r,i,o,a,s,l,u,c,d=this;if((e=new O(e)).c&&!e.isInteger())throw Error(M+"Exponent not an integer: "+J(e));if(null!=t&&(t=new O(t)),s=e.e>14,!d.c||!d.c[0]||1==d.c[0]&&!d.e&&1==d.c.length||!e.c||!e.c[0])return c=new O(Math.pow(+J(d),s?e.s*(2-C(e)):+J(e))),t?c.mod(t):c;if(l=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new O(NaN);(r=!l&&d.isInteger()&&t.isInteger())&&(d=d.mod(t))}else{if(e.e>9&&(d.e>0||d.e<-1||(0==d.e?d.c[0]>1||s&&d.c[1]>=24e7:d.c[0]<8e13||s&&d.c[0]<=9999975e7)))return o=d.s<0&&C(e)?-0:0,d.e>-1&&(o=1/o),new O(l?1/o:o);w&&(o=E(w/14+2))}for(s?(n=new O(.5),l&&(e.s=1),u=C(e)):u=(i=Math.abs(+J(e)))%2,c=new O(f);;){if(u){if(!(c=c.times(d)).c)break;o?c.c.length>o&&(c.c.length=o):r&&(c=c.mod(t))}if(i){if(0===(i=N(i/2)))break;u=i%2}else if(D(e=e.times(n),e.e+1,1),e.e>14)u=C(e);else{if(0==(i=+J(e)))break;u=i%2}d=d.times(d),o?d.c&&d.c.length>o&&(d.c.length=o):r&&(d=d.mod(t))}return r?c:(l&&(c=f.div(c)),t?c.mod(t):o?D(c,w,p,a):c)},d.integerValue=function(e){var t=new O(this);return null==e?e=p:R(e,0,8),D(t,t.e+1,e)},d.isEqualTo=d.eq=function(e,t){return 0===I(this,new O(e,t))},d.isFinite=function(){return!!this.c},d.isGreaterThan=d.gt=function(e,t){return I(this,new O(e,t))>0},d.isGreaterThanOrEqualTo=d.gte=function(e,t){return 1===(t=I(this,new O(e,t)))||0===t},d.isInteger=function(){return!!this.c&&T(this.e/14)>this.c.length-2},d.isLessThan=d.lt=function(e,t){return 0>I(this,new O(e,t))},d.isLessThanOrEqualTo=d.lte=function(e,t){return -1===(t=I(this,new O(e,t)))||0===t},d.isNaN=function(){return!this.s},d.isNegative=function(){return this.s<0},d.isPositive=function(){return this.s>0},d.isZero=function(){return!!this.c&&0==this.c[0]},d.minus=function(e,t){var n,r,i,o,a=this.s;if(t=(e=new O(e,t)).s,!a||!t)return new O(NaN);if(a!=t)return e.s=-t,this.plus(e);var s=this.e/14,l=e.e/14,u=this.c,c=e.c;if(!s||!l){if(!u||!c)return u?(e.s=-t,e):new O(c?this:NaN);if(!u[0]||!c[0])return c[0]?(e.s=-t,e):new O(u[0]?this:3==p?-0:0)}if(s=T(s),l=T(l),u=u.slice(),a=s-l){for((o=a<0)?(a=-a,i=u):(l=s,i=c),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(r=(o=(a=u.length)<(t=c.length))?a:t,a=t=0;t<r;t++)if(u[t]!=c[t]){o=u[t]<c[t];break}if(o&&(i=u,u=c,c=i,e.s=-e.s),(t=(r=c.length)-(n=u.length))>0)for(;t--;u[n++]=0);for(t=1e14-1;r>a;){if(u[--r]<c[r]){for(n=r;n&&!u[--n];u[n]=t);--u[n],u[r]+=1e14}u[r]-=c[r]}for(;0==u[0];u.splice(0,1),--l);return u[0]?F(e,u,l):(e.s=3==p?-1:1,e.c=[e.e=0],e)},d.modulo=d.mod=function(e,t){var n,r;return(e=new O(e,t),this.c&&e.s&&(!e.c||e.c[0]))?e.c&&(!this.c||this.c[0])?(9==b?(r=e.s,e.s=1,n=l(this,e,0,3),e.s=r,n.s*=r):n=l(this,e,0,b),(e=this.minus(n.times(e))).c[0]||1!=b||(e.s=this.s),e):new O(this):new O(NaN)},d.multipliedBy=d.times=function(e,t){var n,r,i,o,a,s,l,u,c,d,f,h,p,m=this.c,y=(e=new O(e,t)).c;if(!m||!y||!m[0]||!y[0])return this.s&&e.s&&(!m||m[0]||y)&&(!y||y[0]||m)?(e.s*=this.s,m&&y?(e.c=[0],e.e=0):e.c=e.e=null):e.c=e.e=e.s=null,e;for(r=T(this.e/14)+T(e.e/14),e.s*=this.s,(l=m.length)<(d=y.length)&&(p=m,m=y,y=p,i=l,l=d,d=i),i=l+d,p=[];i--;p.push(0));for(i=d;--i>=0;){for(n=0,f=y[i]%1e7,h=y[i]/1e7|0,o=i+(a=l);o>i;)s=h*(u=m[--a]%1e7)+(c=m[a]/1e7|0)*f,n=((u=f*u+s%1e7*1e7+p[o]+n)/1e14|0)+(s/1e7|0)+h*c,p[o--]=u%1e14;p[o]=n}return n?++r:p.splice(0,1),F(e,p,r)},d.negated=function(){var e=new O(this);return e.s=-e.s||null,e},d.plus=function(e,t){var n,r=this.s;if(t=(e=new O(e,t)).s,!r||!t)return new O(NaN);if(r!=t)return e.s=-t,this.minus(e);var i=this.e/14,o=e.e/14,a=this.c,s=e.c;if(!i||!o){if(!a||!s)return new O(r/0);if(!a[0]||!s[0])return s[0]?e:new O(a[0]?this:0*r)}if(i=T(i),o=T(o),a=a.slice(),r=i-o){for(r>0?(o=i,n=s):(r=-r,n=a),n.reverse();r--;n.push(0));n.reverse()}for((r=a.length)-(t=s.length)<0&&(n=s,s=a,a=n,t=r),r=0;t;)r=(a[--t]=a[t]+s[t]+r)/1e14|0,a[t]=1e14===a[t]?0:a[t]%1e14;return r&&(a=[r].concat(a),++o),F(e,a,o)},d.precision=d.sd=function(e,t){var n,r,i;if(null!=e&&!!e!==e)return R(e,1,1e9),null==t?t=p:R(t,0,8),D(new O(this),e,t);if(!(n=this.c))return null;if(r=14*(i=n.length-1)+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return e&&this.e+1>r&&(r=this.e+1),r},d.shiftedBy=function(e){return R(e,-0x1fffffffffffff,0x1fffffffffffff),this.times("1e"+e)},d.squareRoot=d.sqrt=function(){var e,t,n,r,i,o=this.c,a=this.s,s=this.e,u=h+4,c=new O("0.5");if(1!==a||!o||!o[0])return new O(!a||a<0&&(!o||o[0])?NaN:o?this:1/0);if(0==(a=Math.sqrt(+J(this)))||a==1/0?(((t=P(o)).length+s)%2==0&&(t+="0"),a=Math.sqrt(+t),s=T((s+1)/2)-(s<0||s%2),n=new O(t=a==1/0?"5e"+s:(t=a.toExponential()).slice(0,t.indexOf("e")+1)+s)):n=new O(a+""),n.c[0]){for((a=(s=n.e)+u)<3&&(a=0);;)if(i=n,n=c.times(i.plus(l(this,i,u,1))),P(i.c).slice(0,a)===(t=P(n.c)).slice(0,a)){if(n.e<s&&--a,"9999"!=(t=t.slice(a-3,a+1))&&(r||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(D(n,n.e+h+2,1),e=!n.times(n).eq(this));break}if(!r&&(D(i,i.e+h+2,0),i.times(i).eq(this))){n=i;break}u+=4,a+=4,r=1}}return D(n,n.e+h+1,p,e)},d.toExponential=function(e,t){return null!=e&&(R(e,0,1e9),e++),$(this,e,t,1)},d.toFixed=function(e,t){return null!=e&&(R(e,0,1e9),e=e+this.e+1),$(this,e,t)},d.toFormat=function(e,t,n){var r;if(null==n)null!=e&&t&&"object"==typeof t?(n=t,t=null):e&&"object"==typeof e?(n=e,e=t=null):n=k;else if("object"!=typeof n)throw Error(M+"Argument not an object: "+n);if(r=this.toFixed(e,t),this.c){var i,o=r.split("."),a=+n.groupSize,s=+n.secondaryGroupSize,l=n.groupSeparator||"",u=o[0],c=o[1],d=this.s<0,f=d?u.slice(1):u,h=f.length;if(s&&(i=a,a=s,s=i,h-=i),a>0&&h>0){for(i=h%a||a,u=f.substr(0,i);i<h;i+=a)u+=l+f.substr(i,a);s>0&&(u+=l+f.slice(i)),d&&(u="-"+u)}r=c?u+(n.decimalSeparator||"")+((s=+n.fractionGroupSize)?c.replace(RegExp("\\d{"+s+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):c):u}return(n.prefix||"")+r+(n.suffix||"")},d.toFraction=function(e){var t,n,r,i,o,a,s,u,c,d,h,m,y=this.c;if(null!=e&&(!(s=new O(e)).isInteger()&&(s.c||1!==s.s)||s.lt(f)))throw Error(M+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+J(s));if(!y)return new O(this);for(t=new O(f),c=n=new O(f),r=u=new O(f),m=P(y),o=t.e=m.length-this.e-1,t.c[0]=j[(a=o%14)<0?14+a:a],e=!e||s.comparedTo(t)>0?o>0?t:c:s,a=v,v=1/0,s=new O(m),u.c[0]=0;d=l(s,t,0,1),1!=(i=n.plus(d.times(r))).comparedTo(e);)n=r,r=i,c=u.plus(d.times(i=c)),u=i,t=s.minus(d.times(i=t)),s=i;return i=l(e.minus(n),r,0,1),u=u.plus(i.times(c)),n=n.plus(i.times(r)),u.s=c.s=this.s,o*=2,h=1>l(c,r,o,p).minus(this).abs().comparedTo(l(u,n,o,p).minus(this).abs())?[c,r]:[u,n],v=a,h},d.toNumber=function(){return+J(this)},d.toPrecision=function(e,t){return null!=e&&R(e,1,1e9),$(this,e,t,2)},d.toString=function(e){var t,n=this,r=n.s,i=n.e;return null===i?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(null==e?t=i<=m||i>=y?U(P(n.c),i):L(P(n.c),i,"0"):10===e&&x?t=L(P((n=D(new O(n),h+i+1,p)).c),n.e,"0"):(R(e,2,z.length,"Base"),t=u(L(P(n.c),i,"0"),10,e,r,!0)),r<0&&n.c[0]&&(t="-"+t)),t},d.valueOf=d.toJSON=function(){return J(this)},d._isBigNumber=!0,d[Symbol.toStringTag]="BigNumber",d[Symbol.for("nodejs.util.inspect.custom")]=d.valueOf,null!=t&&O.set(t),O}();let D=24,J="u">typeof globalThis&&globalThis.crypto&&"function"==typeof globalThis.crypto.getRandomValues?()=>{let e=new Uint32Array(1);return globalThis.crypto.getRandomValues(e),e[0]/0x100000000}:Math.random,V=(e=4,t=J)=>{let n="";for(;n.length<e;)n+=Math.floor(36*t()).toString(36);return n},B=(e="")=>(function(e){let t=new F(0);for(let n of e.values())t=t.multipliedBy(256).plus(n);return t})($(new TextEncoder().encode(e))).toString(36).slice(1),q=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),H=({globalObj:e="u">typeof global?global:"u">typeof window?window:{},random:t=J}={})=>{let n=Object.keys(e).toString();return B(n.length?n+V(32,t):V(32,t)).substring(0,32)},W=e=>()=>e++,G=0x1c6b1f1f,X=(A=({random:e=J,counter:t=W(Math.floor(e()*G)),length:n=D,fingerprint:r=H({random:e})}={})=>{if(n>32)throw Error(`Length must be between 2 and 32. Received: ${n}`);return function(){let i=q[Math.floor(e()*q.length)],o=Date.now().toString(36),a=t().toString(36),s=V(n,e),l=`${o+s+a+r}`;return`${i+B(l).substring(1,n)}`}},()=>(r||(r=A()),r()))}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4607],{2982:(t,n,r)=>{r.d(n,{A:()=>i});var e=r(17434);function i(t){var n,r,i,o=(0,e.A)(.1);function u(t){for(var e,o=0,u=n.length;o<u;++o)e=n[o],e.vx+=(i[o]-e.x)*r[o]*t}function a(){if(n){var e,u=n.length;for(e=0,r=Array(u),i=Array(u);e<u;++e)r[e]=isNaN(i[e]=+t(n[e],e,n))?0:+o(n[e],e,n)}}return"function"!=typeof t&&(t=(0,e.A)(null==t?0:+t)),u.initialize=function(t){n=t,a()},u.strength=function(t){return arguments.length?(o="function"==typeof t?t:(0,e.A)(+t),a(),u):o},u.x=function(n){return arguments.length?(t="function"==typeof n?n:(0,e.A)(+n),a(),u):t},u}},7679:(t,n,r)=>{r.d(n,{A:()=>h,x:()=>o,y:()=>u});var e=r(32521),i=r(87977);function o(t){return t.x}function u(t){return t.y}var a=Math.PI*(3-Math.sqrt(5));function h(t){let n;var r,o=1,u=.001,h=1-Math.pow(.001,1/300),f=0,s=.6,l=new Map,c=(0,i.O1)(y),x=(0,e.A)("tick","end"),v=(n=1,()=>(n=(1664525*n+0x3c6ef35f)%0x100000000)/0x100000000);function y(){d(),x.call("tick",r),o<u&&(c.stop(),x.call("end",r))}function d(n){var e,i,u=t.length;void 0===n&&(n=1);for(var a=0;a<n;++a)for(o+=(f-o)*h,l.forEach(function(t){t(o)}),e=0;e<u;++e)null==(i=t[e]).fx?i.x+=i.vx*=s:(i.x=i.fx,i.vx=0),null==i.fy?i.y+=i.vy*=s:(i.y=i.fy,i.vy=0);return r}function g(){for(var n,r=0,e=t.length;r<e;++r){if((n=t[r]).index=r,null!=n.fx&&(n.x=n.fx),null!=n.fy&&(n.y=n.fy),isNaN(n.x)||isNaN(n.y)){var i=10*Math.sqrt(.5+r),o=r*a;n.x=i*Math.cos(o),n.y=i*Math.sin(o)}(isNaN(n.vx)||isNaN(n.vy))&&(n.vx=n.vy=0)}}function _(n){return n.initialize&&n.initialize(t,v),n}return null==t&&(t=[]),g(),r={tick:d,restart:function(){return c.restart(y),r},stop:function(){return c.stop(),r},nodes:function(n){return arguments.length?(t=n,g(),l.forEach(_),r):t},alpha:function(t){return arguments.length?(o=+t,r):o},alphaMin:function(t){return arguments.length?(u=+t,r):u},alphaDecay:function(t){return arguments.length?(h=+t,r):+h},alphaTarget:function(t){return arguments.length?(f=+t,r):f},velocityDecay:function(t){return arguments.length?(s=1-t,r):1-s},randomSource:function(t){return arguments.length?(v=t,l.forEach(_),r):v},force:function(t,n){return arguments.length>1?(null==n?l.delete(t):l.set(t,_(n)),r):l.get(t)},find:function(n,r,e){var i,o,u,a,h,f=0,s=t.length;for(null==e?e=1/0:e*=e,f=0;f<s;++f)(u=(i=n-(a=t[f]).x)*i+(o=r-a.y)*o)<e&&(h=a,e=u);return h},on:function(t,n){return arguments.length>1?(x.on(t,n),r):x.on(t)}}}},15330:(t,n,r)=>{r.d(n,{A:()=>e});let e=(0,r(30772).A)("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]])},15629:(t,n,r)=>{r.d(n,{A:()=>a});var e=r(53891),i=r(17434),o=r(93958),u=r(7679);function a(){var t,n,r,a,h,f=(0,i.A)(-30),s=1,l=1/0,c=.81;function x(r){var i,o=t.length,h=(0,e.A)(t,u.x,u.y).visitAfter(y);for(a=r,i=0;i<o;++i)n=t[i],h.visit(d)}function v(){if(t){var n,r,e=t.length;for(n=0,h=Array(e);n<e;++n)h[(r=t[n]).index]=+f(r,n,t)}}function y(t){var n,r,e,i,o,u=0,a=0;if(t.length){for(e=i=o=0;o<4;++o)(n=t[o])&&(r=Math.abs(n.value))&&(u+=n.value,a+=r,e+=r*n.x,i+=r*n.y);t.x=e/a,t.y=i/a}else{(n=t).x=n.data.x,n.y=n.data.y;do u+=h[n.data.index];while(n=n.next)}t.value=u}function d(t,e,i,u){if(!t.value)return!0;var f=t.x-n.x,x=t.y-n.y,v=u-e,y=f*f+x*x;if(v*v/c<y)return y<l&&(0===f&&(y+=(f=(0,o.A)(r))*f),0===x&&(y+=(x=(0,o.A)(r))*x),y<s&&(y=Math.sqrt(s*y)),n.vx+=f*t.value*a/y,n.vy+=x*t.value*a/y),!0;if(!t.length&&!(y>=l)){(t.data!==n||t.next)&&(0===f&&(y+=(f=(0,o.A)(r))*f),0===x&&(y+=(x=(0,o.A)(r))*x),y<s&&(y=Math.sqrt(s*y)));do t.data!==n&&(v=h[t.data.index]*a/y,n.vx+=f*v,n.vy+=x*v);while(t=t.next)}}return x.initialize=function(n,e){t=n,r=e,v()},x.strength=function(t){return arguments.length?(f="function"==typeof t?t:(0,i.A)(+t),v(),x):f},x.distanceMin=function(t){return arguments.length?(s=t*t,x):Math.sqrt(s)},x.distanceMax=function(t){return arguments.length?(l=t*t,x):Math.sqrt(l)},x.theta=function(t){return arguments.length?(c=t*t,x):Math.sqrt(c)},x}},17434:(t,n,r)=>{r.d(n,{A:()=>e});function e(t){return function(){return t}}},18986:(t,n,r)=>{r.d(n,{A:()=>e});let e=(0,r(30772).A)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},53891:(t,n,r)=>{function e(t,n,r,e){if(isNaN(n)||isNaN(r))return t;var i,o,u,a,h,f,s,l,c,x=t._root,v={data:e},y=t._x0,d=t._y0,g=t._x1,_=t._y1;if(!x)return t._root=v,t;for(;x.length;)if((f=n>=(o=(y+g)/2))?y=o:g=o,(s=r>=(u=(d+_)/2))?d=u:_=u,i=x,!(x=x[l=s<<1|f]))return i[l]=v,t;if(a=+t._x.call(null,x.data),h=+t._y.call(null,x.data),n===a&&r===h)return v.next=x,i?i[l]=v:t._root=v,t;do i=i?i[l]=[,,,,]:t._root=[,,,,],(f=n>=(o=(y+g)/2))?y=o:g=o,(s=r>=(u=(d+_)/2))?d=u:_=u;while((l=s<<1|f)==(c=(h>=u)<<1|a>=o));return i[c]=x,i[l]=v,t}function i(t,n,r,e,i){this.node=t,this.x0=n,this.y0=r,this.x1=e,this.y1=i}function o(t){return t[0]}function u(t){return t[1]}function a(t,n,r){var e=new h(null==n?o:n,null==r?u:r,NaN,NaN,NaN,NaN);return null==t?e:e.addAll(t)}function h(t,n,r,e,i,o){this._x=t,this._y=n,this._x0=r,this._y0=e,this._x1=i,this._y1=o,this._root=void 0}function f(t){for(var n={data:t.data},r=n;t=t.next;)r=r.next={data:t.data};return n}r.d(n,{A:()=>a});var s=a.prototype=h.prototype;s.copy=function(){var t,n,r=new h(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root;if(!e)return r;if(!e.length)return r._root=f(e),r;for(t=[{source:e,target:r._root=[,,,,]}];e=t.pop();)for(var i=0;i<4;++i)(n=e.source[i])&&(n.length?t.push({source:n,target:e.target[i]=[,,,,]}):e.target[i]=f(n));return r},s.add=function(t){let n=+this._x.call(null,t),r=+this._y.call(null,t);return e(this.cover(n,r),n,r,t)},s.addAll=function(t){var n,r,i,o,u=t.length,a=Array(u),h=Array(u),f=1/0,s=1/0,l=-1/0,c=-1/0;for(r=0;r<u;++r)!(isNaN(i=+this._x.call(null,n=t[r]))||isNaN(o=+this._y.call(null,n)))&&(a[r]=i,h[r]=o,i<f&&(f=i),i>l&&(l=i),o<s&&(s=o),o>c&&(c=o));if(f>l||s>c)return this;for(this.cover(f,s).cover(l,c),r=0;r<u;++r)e(this,a[r],h[r],t[r]);return this},s.cover=function(t,n){if(isNaN(t*=1)||isNaN(n*=1))return this;var r=this._x0,e=this._y0,i=this._x1,o=this._y1;if(isNaN(r))i=(r=Math.floor(t))+1,o=(e=Math.floor(n))+1;else{for(var u,a,h=i-r||1,f=this._root;r>t||t>=i||e>n||n>=o;)switch(a=(n<e)<<1|t<r,(u=[,,,,])[a]=f,f=u,h*=2,a){case 0:i=r+h,o=e+h;break;case 1:r=i-h,o=e+h;break;case 2:i=r+h,e=o-h;break;case 3:r=i-h,e=o-h}this._root&&this._root.length&&(this._root=f)}return this._x0=r,this._y0=e,this._x1=i,this._y1=o,this},s.data=function(){var t=[];return this.visit(function(n){if(!n.length)do t.push(n.data);while(n=n.next)}),t},s.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},s.find=function(t,n,r){var e,o,u,a,h,f,s,l=this._x0,c=this._y0,x=this._x1,v=this._y1,y=[],d=this._root;for(d&&y.push(new i(d,l,c,x,v)),null==r?r=1/0:(l=t-r,c=n-r,x=t+r,v=n+r,r*=r);f=y.pop();)if((d=f.node)&&!((o=f.x0)>x)&&!((u=f.y0)>v)&&!((a=f.x1)<l)&&!((h=f.y1)<c))if(d.length){var g=(o+a)/2,_=(u+h)/2;y.push(new i(d[3],g,_,a,h),new i(d[2],o,_,g,h),new i(d[1],g,u,a,_),new i(d[0],o,u,g,_)),(s=(n>=_)<<1|t>=g)&&(f=y[y.length-1],y[y.length-1]=y[y.length-1-s],y[y.length-1-s]=f)}else{var p=t-this._x.call(null,d.data),A=n-this._y.call(null,d.data),N=p*p+A*A;if(N<r){var w=Math.sqrt(r=N);l=t-w,c=n-w,x=t+w,v=n+w,e=d.data}}return e},s.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(u=+this._y.call(null,t)))return this;var n,r,e,i,o,u,a,h,f,s,l,c,x=this._root,v=this._x0,y=this._y0,d=this._x1,g=this._y1;if(!x)return this;if(x.length)for(;;){if((f=o>=(a=(v+d)/2))?v=a:d=a,(s=u>=(h=(y+g)/2))?y=h:g=h,n=x,!(x=x[l=s<<1|f]))return this;if(!x.length)break;(n[l+1&3]||n[l+2&3]||n[l+3&3])&&(r=n,c=l)}for(;x.data!==t;)if(e=x,!(x=x.next))return this;return((i=x.next)&&delete x.next,e)?i?e.next=i:delete e.next:n?(i?n[l]=i:delete n[l],(x=n[0]||n[1]||n[2]||n[3])&&x===(n[3]||n[2]||n[1]||n[0])&&!x.length&&(r?r[c]=x:this._root=x)):this._root=i,this},s.removeAll=function(t){for(var n=0,r=t.length;n<r;++n)this.remove(t[n]);return this},s.root=function(){return this._root},s.size=function(){var t=0;return this.visit(function(n){if(!n.length)do++t;while(n=n.next)}),t},s.visit=function(t){var n,r,e,o,u,a,h=[],f=this._root;for(f&&h.push(new i(f,this._x0,this._y0,this._x1,this._y1));n=h.pop();)if(!t(f=n.node,e=n.x0,o=n.y0,u=n.x1,a=n.y1)&&f.length){var s=(e+u)/2,l=(o+a)/2;(r=f[3])&&h.push(new i(r,s,l,u,a)),(r=f[2])&&h.push(new i(r,e,l,s,a)),(r=f[1])&&h.push(new i(r,s,o,u,l)),(r=f[0])&&h.push(new i(r,e,o,s,l))}return this},s.visitAfter=function(t){var n,r=[],e=[];for(this._root&&r.push(new i(this._root,this._x0,this._y0,this._x1,this._y1));n=r.pop();){var o=n.node;if(o.length){var u,a=n.x0,h=n.y0,f=n.x1,s=n.y1,l=(a+f)/2,c=(h+s)/2;(u=o[0])&&r.push(new i(u,a,h,l,c)),(u=o[1])&&r.push(new i(u,l,h,f,c)),(u=o[2])&&r.push(new i(u,a,c,l,s)),(u=o[3])&&r.push(new i(u,l,c,f,s))}e.push(n)}for(;n=e.pop();)t(n.node,n.x0,n.y0,n.x1,n.y1);return this},s.x=function(t){return arguments.length?(this._x=t,this):this._x},s.y=function(t){return arguments.length?(this._y=t,this):this._y}},60976:(t,n,r)=>{r.d(n,{A:()=>e});let e=(0,r(30772).A)("redo-2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]])},64385:(t,n,r)=>{r.d(n,{A:()=>i});var e=r(17434);function i(t){var n,r,i,o=(0,e.A)(.1);function u(t){for(var e,o=0,u=n.length;o<u;++o)e=n[o],e.vy+=(i[o]-e.y)*r[o]*t}function a(){if(n){var e,u=n.length;for(e=0,r=Array(u),i=Array(u);e<u;++e)r[e]=isNaN(i[e]=+t(n[e],e,n))?0:+o(n[e],e,n)}}return"function"!=typeof t&&(t=(0,e.A)(null==t?0:+t)),u.initialize=function(t){n=t,a()},u.strength=function(t){return arguments.length?(o="function"==typeof t?t:(0,e.A)(+t),a(),u):o},u.y=function(n){return arguments.length?(t="function"==typeof n?n:(0,e.A)(+n),a(),u):t},u}},79176:(t,n,r)=>{r.d(n,{A:()=>h});var e=r(53891),i=r(17434),o=r(93958);function u(t){return t.x+t.vx}function a(t){return t.y+t.vy}function h(t){var n,r,h,f=1,s=1;function l(){for(var t,i,l,x,v,y,d,g=n.length,_=0;_<s;++_)for(t=0,i=(0,e.A)(n,u,a).visitAfter(c);t<g;++t)d=(y=r[(l=n[t]).index])*y,x=l.x+l.vx,v=l.y+l.vy,i.visit(p);function p(t,n,r,e,i){var u=t.data,a=t.r,s=y+a;if(u){if(u.index>l.index){var c=x-u.x-u.vx,g=v-u.y-u.vy,_=c*c+g*g;_<s*s&&(0===c&&(_+=(c=(0,o.A)(h))*c),0===g&&(_+=(g=(0,o.A)(h))*g),_=(s-(_=Math.sqrt(_)))/_*f,l.vx+=(c*=_)*(s=(a*=a)/(d+a)),l.vy+=(g*=_)*s,u.vx-=c*(s=1-s),u.vy-=g*s)}return}return n>x+s||e<x-s||r>v+s||i<v-s}}function c(t){if(t.data)return t.r=r[t.data.index];for(var n=t.r=0;n<4;++n)t[n]&&t[n].r>t.r&&(t.r=t[n].r)}function x(){if(n){var e,i,o=n.length;for(e=0,r=Array(o);e<o;++e)r[(i=n[e]).index]=+t(i,e,n)}}return"function"!=typeof t&&(t=(0,i.A)(null==t?1:+t)),l.initialize=function(t,r){n=t,h=r,x()},l.iterations=function(t){return arguments.length?(s=+t,l):s},l.strength=function(t){return arguments.length?(f=+t,l):f},l.radius=function(n){return arguments.length?(t="function"==typeof n?n:(0,i.A)(+n),x(),l):t},l}},93958:(t,n,r)=>{r.d(n,{A:()=>e});function e(t){return(t()-.5)*1e-6}},98766:(t,n,r)=>{r.d(n,{A:()=>a});var e=r(17434),i=r(93958);function o(t){return t.index}function u(t,n){var r=t.get(n);if(!r)throw Error("node not found: "+n);return r}function a(t){var n,r,a,h,f,s,l=o,c=function(t){return 1/Math.min(h[t.source.index],h[t.target.index])},x=(0,e.A)(30),v=1;function y(e){for(var o=0,u=t.length;o<v;++o)for(var a,h,l,c,x,y,d,g=0;g<u;++g)h=(a=t[g]).source,y=((y=Math.sqrt((c=(l=a.target).x+l.vx-h.x-h.vx||(0,i.A)(s))*c+(x=l.y+l.vy-h.y-h.vy||(0,i.A)(s))*x))-r[g])/y*e*n[g],c*=y,x*=y,l.vx-=c*(d=f[g]),l.vy-=x*d,h.vx+=c*(d=1-d),h.vy+=x*d}function d(){if(a){var e,i,o=a.length,s=t.length,c=new Map(a.map((t,n)=>[l(t,n,a),t]));for(e=0,h=Array(o);e<s;++e)(i=t[e]).index=e,"object"!=typeof i.source&&(i.source=u(c,i.source)),"object"!=typeof i.target&&(i.target=u(c,i.target)),h[i.source.index]=(h[i.source.index]||0)+1,h[i.target.index]=(h[i.target.index]||0)+1;for(e=0,f=Array(s);e<s;++e)i=t[e],f[e]=h[i.source.index]/(h[i.source.index]+h[i.target.index]);n=Array(s),g(),r=Array(s),_()}}function g(){if(a)for(var r=0,e=t.length;r<e;++r)n[r]=+c(t[r],r,t)}function _(){if(a)for(var n=0,e=t.length;n<e;++n)r[n]=+x(t[n],n,t)}return null==t&&(t=[]),y.initialize=function(t,n){a=t,s=n,d()},y.links=function(n){return arguments.length?(t=n,d(),y):t},y.id=function(t){return arguments.length?(l=t,y):l},y.iterations=function(t){return arguments.length?(v=+t,y):v},y.strength=function(t){return arguments.length?(c="function"==typeof t?t:(0,e.A)(+t),g(),y):c},y.distance=function(t){return arguments.length?(x="function"==typeof t?t:(0,e.A)(+t),_(),y):x},y}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4853],{44853:(e,t,n)=>{n.d(t,{DbMapClient:()=>ek});var a=n(95155),s=n(12115),o=n(80277),l=n(73321),i=n(81750),r=n(6266);n(53255);var d=n(32133),c=n(81499),m=n(51128),u=n(65738),p=n(9005),h=n(2125),f=n(91337),x=n(18874);let b=(0,s.createContext)(null);function g(){let e=(0,s.useContext)(b);if(!e)throw Error("useDbEdit must be used inside DbEditContext");return e}var y=n(29523),j=n(70221),k=n(95635),w=n(17918);let N={danger:"bg-red-500/15 text-red-300",warn:"bg-amber-500/15 text-amber-300"};function v({badges:e,className:t}){return e.length?(0,a.jsx)("span",{className:(0,f.cn)("flex shrink-0 items-center gap-0.5",t),children:e.map(e=>(0,a.jsx)("span",{title:e.title,className:(0,f.cn)("rounded px-1 text-[8px] font-semibold uppercase tracking-wide",N[e.tone]),children:e.label},e.label))}):null}let C=/pass(word)?|token|secret|api[_-]?key|credential|priv(ate)?[_-]?key|hash|salt/i,T=/auth|login|logout|session|token|password|oauth|sso|credential/i,M="nodrag nopan",S=k.x;function E({onClick:e,title:t}){return(0,a.jsx)("button",{type:"button",title:t,onClick:t=>{t.stopPropagation(),e()},className:(0,f.cn)(M,"absolute -right-3 top-1/2 z-10 flex size-6 -translate-y-1/2 items-center justify-center rounded-full border border-white/15 bg-[#242428] text-muted-foreground opacity-0 shadow-md transition-all group-hover/row:opacity-100 hover:border-[#ff7a45]/50 hover:text-[#ff7a45]"),children:(0,a.jsx)(d.A,{className:"size-3"})})}function I({c:e,fkTargets:t}){let n=t?.[e.name];return(0,a.jsx)("span",{title:n?`→ ${n}`:e.type,className:"ml-auto min-w-0 truncate font-mono text-[11px] text-muted-foreground/80",children:n?(0,a.jsxs)(a.Fragment,{children:["→\xa0",n]}):e.type})}let $=(0,s.memo)(function({id:e,data:t,selected:n}){var o;let l,i,r="DRAFT"===t.source,d="added"===t.diffStatus?"#7bd389":"modified"===t.diffStatus?"#ffb86b":"#4ea1ff",b="added"===t.diffStatus||"modified"===t.diffStatus,N="added"===t.diffStatus?"new":"modified"===t.diffStatus?"modify":"in plan",T=t.diffChanges?.length?t.diffChanges.join("\n"):"in this plan — no column change",$=r?d:(0,x.qA)(t.domain),A=(o={domain:t.domain,columns:t.columns},l=[],(i=o.columns.filter(e=>C.test(e.name)).map(e=>e.name)).length&&l.push({label:"secrets",tone:"danger",title:`stores credentials: ${i.join(", ")}`}),o.domain&&/auth/i.test(o.domain)&&l.push({label:"auth",tone:"warn",title:"auth-domain table"}),l),P=g(),[z,D]=(0,s.useState)(t.name),[F,R]=(0,s.useState)(t.columns),[O,L]=(0,s.useState)(!1);(0,s.useEffect)(()=>{D(t.name),R(t.columns)},[t.rev]);let K=e=>e.stopPropagation(),B=t=>{R(t),P.patchTable(e,{columns:t})},H=(t.pins??[]).filter(e=>null===e.column),_=e=>(t.pins??[]).filter(t=>t.column===e),Z=function(e,t,n,a=!1,s){return Math.min(312,Math.max(240,Math.round(8*e.length)+90,...t.map(e=>{if(a){let t=s?.[e.name];return Math.round(7.3*Math.max(6,e.name.length+1)+(t?.kind==="modified"?8*t.detail.length:64))+94}let t=n?.[e.name]?n[e.name].length+2:e.type.length;return Math.round(7.3*e.name.length+6.7*t)+64})))}(t.name,r?F:t.columns,t.fkTargets,r,t.diffColumns),U=(0,f.cn)("relative rounded-xl border bg-[#161618]/95 text-card-foreground shadow-[0_18px_50px_-22px_rgba(0,0,0,0.9)] backdrop-blur",n&&"ring-2 ring-[var(--accent,#f5b942)]"),q=(0,y.k)(j.fE);return"full"!==q?(0,a.jsxs)("div",{className:(0,f.cn)(U,"border-white/10 px-3 py-2.5","far"===q&&!P.readOnly&&"!opacity-0"),style:{width:Z},children:[(0,a.jsx)(k.x,{}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"inline-block size-2 shrink-0 rounded-full",style:{background:$}}),(0,a.jsx)("span",{className:"truncate font-mono text-[15px] font-semibold",children:t.name})]})]}):r?(0,a.jsxs)("div",{className:(0,f.cn)(U,"group/card"),style:{width:Z,borderColor:`${d}59`},children:[(0,a.jsx)(S,{}),(0,a.jsxs)("div",{className:"group/row relative flex items-center gap-1.5 rounded-t-[11px] px-3 py-2",style:{background:`${d}14`},children:[(0,a.jsx)("input",{value:z,onChange:e=>D(e.target.value),onBlur:()=>{let n=z.trim();n&&n!==t.name&&P.patchTable(e,{name:n})},onKeyDown:e=>{K(e),"Enter"===e.key&&e.currentTarget.blur()},placeholder:"table",className:(0,f.cn)(M,"min-w-0 flex-1 bg-transparent font-mono text-[13px] font-semibold tracking-tight outline-none")}),(0,a.jsx)(v,{badges:A}),(0,a.jsx)("span",{title:T,className:(0,f.cn)("shrink-0 rounded-md border px-1.5 py-px font-mono text-[9px] font-semibold uppercase tracking-[0.14em]",!b&&"border-white/15 bg-white/5 text-muted-foreground"),style:b?{background:`${d}1f`,borderColor:`${d}55`,color:d}:void 0,children:N}),(0,a.jsx)("button",{type:"button",onClick:t=>{K(t),O?P.deleteTable(e):L(!0)},onBlur:()=>L(!1),title:"Delete table",className:(0,f.cn)(M,"shrink-0 transition-all",O?"text-red-300":"text-muted-foreground opacity-0 hover:text-red-300 group-hover/card:opacity-100"),children:(0,a.jsx)(u.A,{className:"size-3"})}),H.length>0?(0,a.jsx)(w.e0,{pins:H,onPinClick:t.onPinClick}):t.onComment&&(0,a.jsx)(E,{title:`Comment on ${t.name}`,onClick:()=>t.onComment?.(t.name)})]}),(0,a.jsxs)("div",{className:"divide-y divide-white/[0.05]",children:[F.map((e,n)=>{let s=_(e.name),o=t.diffColumns?.[e.name],l=o?.kind==="added"?{background:"#7bd38914",boxShadow:"inset 2px 0 0 #7bd389"}:o?.kind==="modified"?{background:"#ffb86b14",boxShadow:"inset 2px 0 0 #ffb86b"}:void 0;return(0,a.jsxs)("div",{style:l,className:"group/row relative flex items-center gap-1.5 px-3 py-[5px] text-[12px]",children:[(0,a.jsx)("button",{type:"button",onClick:e=>{K(e),B(F.map((e,t)=>t===n?{...e,isPk:!e.isPk}:e))},title:"Primary key",className:(0,f.cn)(M,"shrink-0",e.isPk?"text-amber-300/90":"text-muted-foreground/40 hover:text-amber-300"),children:(0,a.jsx)(c.A,{className:"size-3"})}),(0,a.jsx)("button",{type:"button",onClick:e=>{K(e),B(F.map((e,t)=>t===n?{...e,isFk:!e.isFk}:e))},title:"Foreign key",className:(0,f.cn)(M,"shrink-0",e.isFk?"text-sky-400/80":"text-muted-foreground/40 hover:text-sky-400"),children:(0,a.jsx)(m.A,{className:"size-3"})}),(0,a.jsx)("input",{value:e.name,onChange:e=>R(t=>t.map((t,a)=>a===n?{...t,name:e.target.value}:t)),onBlur:()=>B(F),onKeyDown:K,placeholder:"column",style:{width:`${Math.max(6,e.name.length+1)}ch`},className:(0,f.cn)(M,"shrink-0 bg-transparent font-mono outline-none")}),(0,a.jsx)("span",{"aria-hidden":!0,className:"flex-1"}),t.fkTargets?.[e.name]?(0,a.jsxs)("span",{title:`→ ${t.fkTargets[e.name]}`,className:"min-w-0 shrink truncate text-right font-mono text-[11px] text-muted-foreground/80",children:["→\xa0",t.fkTargets[e.name]]}):o?.kind==="modified"?(0,a.jsx)("span",{title:`was changed — ${o.detail}`,className:(0,f.cn)(M,"min-w-0 shrink truncate text-right font-mono text-[11px] font-medium text-[#ffb86b]"),children:o.detail}):(0,a.jsx)("input",{value:e.type,onChange:e=>R(t=>t.map((t,a)=>a===n?{...t,type:e.target.value}:t)),onBlur:()=>B(F),onKeyDown:K,placeholder:"type",title:e.type,className:(0,f.cn)(M,"w-16 min-w-0 shrink bg-transparent text-right font-mono text-[11px] outline-none",o?.kind==="added"?"text-[#7bd389]":"text-muted-foreground/80")}),(0,a.jsx)("button",{type:"button",onClick:e=>{K(e),B(F.filter((e,t)=>t!==n))},title:"Remove column",className:(0,f.cn)(M,"shrink-0 text-muted-foreground/40 opacity-0 transition-opacity hover:text-red-300 group-hover/card:opacity-100"),children:(0,a.jsx)(p.A,{className:"size-3"})}),s.length>0?(0,a.jsx)(w.e0,{pins:s,onPinClick:t.onPinClick}):t.onComment&&(0,a.jsx)(E,{title:`Comment on ${t.name}.${e.name}`,onClick:()=>t.onComment?.(`${t.name}.${e.name}`)})]},n)}),(0,a.jsxs)("button",{type:"button",onClick:e=>{K(e),B([...F,{name:"",type:"text",isPk:!1,isFk:!1,nullable:!0,note:null}])},className:(0,f.cn)(M,"flex w-full items-center gap-1 px-3 py-1.5 text-[10px] text-muted-foreground hover:text-foreground"),children:[(0,a.jsx)(h.A,{className:"size-3"})," column"]})]})]}):(0,a.jsxs)("div",{className:U,style:{width:Z,borderColor:`${$}3d`},children:[(0,a.jsx)(S,{}),(0,a.jsxs)("div",{className:"group/row relative flex items-center justify-between rounded-t-[11px] px-3 py-2",style:{background:`${$}14`},children:[(0,a.jsxs)("span",{className:"flex min-w-0 flex-1 items-center gap-1.5 font-mono text-[13px] font-semibold tracking-tight",children:["INTROSPECTION"===t.source&&(0,a.jsx)("span",{title:"live — derived from your code",className:"inline-block size-1.5 shrink-0 rounded-full bg-emerald-400"}),(0,a.jsx)("span",{className:"truncate",title:t.name,children:t.name})]}),(0,a.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5",children:["INTROSPECTION"!==t.source&&(0,a.jsx)("span",{title:"planned — not yet detected in code",className:"shrink-0 rounded-md border border-[#f5b942]/35 bg-[#f5b942]/10 px-1.5 py-px font-mono text-[9px] font-semibold uppercase tracking-[0.14em] text-[#f5b942]",children:"planned"}),(0,a.jsx)(v,{badges:A}),t.domain&&(0,a.jsx)("span",{className:"text-[9px] uppercase tracking-[0.14em]",style:{color:$},children:t.domain})]}),H.length>0?(0,a.jsx)(w.e0,{pins:H,onPinClick:t.onPinClick}):t.onComment&&(0,a.jsx)(E,{title:`Comment on ${t.name}`,onClick:()=>t.onComment?.(t.name)})]}),(0,a.jsx)("div",{className:"divide-y divide-white/[0.05]",children:t.columns.map(e=>{let n=_(e.name);return(0,a.jsxs)("div",{className:"group/row relative flex items-center gap-2 px-3 py-[7px] text-[12px]",children:[e.isPk?(0,a.jsx)(c.A,{className:"size-3 shrink-0 text-amber-300/90"}):e.isFk?(0,a.jsx)(m.A,{className:"size-3 shrink-0 text-sky-400/80"}):(0,a.jsx)("span",{className:"size-3 shrink-0"}),(0,a.jsx)("span",{className:"shrink-0 whitespace-nowrap font-mono",children:e.name}),(0,a.jsx)(I,{c:e,fkTargets:t.fkTargets}),n.length>0?(0,a.jsx)(w.e0,{pins:n,onPinClick:t.onPinClick}):t.onComment&&(0,a.jsx)(E,{title:`Comment on ${t.name}.${e.name}`,onClick:()=>t.onComment?.(`${t.name}.${e.name}`)})]},e.name)})})]})}),A="nodrag nopan",P=["GET","POST","PUT","PATCH","DELETE"],z=(0,s.memo)(function({id:e,data:t,selected:n}){var o;let l,i=x.e6[t.method]??"#8a8a8a",r="DRAFT"===t.source,c="added"===t.diffStatus?"#7bd389":"modified"===t.diffStatus?"#ffb86b":"#4ea1ff",m="added"===t.diffStatus?"new":"modified"===t.diffStatus?"changed":"draft",p=t.diffChanges?.length?t.diffChanges.join("\n"):"draft",h=(o={method:t.method,domain:t.domain,path:t.path},l=[],/^delete$/i.test(o.method.trim())&&l.push({label:"DELETE",tone:"danger",title:"destructive: deletes data"}),(o.domain&&/auth/i.test(o.domain)||T.test(o.path))&&l.push({label:"auth",tone:"warn",title:"auth-related endpoint"}),l),b=g(),[N,C]=(0,s.useState)(t.path),[M,S]=(0,s.useState)(!1);(0,s.useEffect)(()=>{C(t.path)},[t.rev]);let E=e=>e.stopPropagation(),I=(0,y.k)(j.fE);return"full"!==I?(0,a.jsxs)("div",{className:(0,f.cn)("relative flex w-[300px] items-center gap-2 rounded-lg border border-white/10 bg-[#161618]/95 px-2.5 py-2 text-card-foreground backdrop-blur",n&&"ring-2 ring-[var(--accent,#f5b942)]","far"===I&&!b.readOnly&&"!opacity-0"),children:[(0,a.jsx)(k.x,{}),(0,a.jsx)("span",{className:"shrink-0 font-mono text-[12px] font-bold",style:{color:i},children:t.method}),(0,a.jsx)("span",{title:t.path,className:"truncate font-mono text-[13px]",children:t.path})]}):(0,a.jsxs)("div",{className:(0,f.cn)("group relative flex w-[300px] items-center gap-2 rounded-lg border bg-[#161618]/95 px-2.5 py-1.5 text-card-foreground shadow-[0_12px_36px_-18px_rgba(0,0,0,0.9)] backdrop-blur",r?"border-dashed":"border-white/10",n&&"ring-2 ring-[var(--accent,#f5b942)]"),style:r?{borderColor:`${c}66`,background:`${c}0f`}:void 0,children:[(0,a.jsx)(k.x,{}),"INTROSPECTION"===t.source&&(0,a.jsx)("span",{title:"live — derived from your code",className:"inline-block size-1.5 shrink-0 rounded-full bg-emerald-400"}),r?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("select",{value:t.method,onChange:t=>b.patchEndpoint(e,{method:t.target.value}),onPointerDown:E,className:(0,f.cn)(A,"shrink-0 rounded bg-transparent text-[10px] font-bold outline-none"),style:{color:i},title:"Method",children:P.map(e=>(0,a.jsx)("option",{value:e,className:"bg-card text-foreground",children:e},e))}),(0,a.jsx)("input",{value:N,title:N,onChange:e=>C(e.target.value),onBlur:()=>{let n=N.trim();n&&n!==t.path&&b.patchEndpoint(e,{path:n})},onKeyDown:e=>{E(e),"Enter"===e.key&&e.currentTarget.blur()},className:(0,f.cn)(A,"min-w-0 flex-1 bg-transparent font-mono text-[11px] outline-none")}),(0,a.jsx)(v,{badges:h}),(0,a.jsx)("span",{title:p,className:"shrink-0 rounded px-1 py-0.5 text-[8px] font-semibold uppercase",style:{background:`${c}26`,color:c},children:m}),(0,a.jsx)("button",{type:"button",onClick:t=>{E(t),M?b.deleteEndpoint(e):S(!0)},onBlur:()=>S(!1),title:"Delete",className:(0,f.cn)(A,"shrink-0 transition-colors",M?"text-red-300":"text-muted-foreground hover:text-red-300"),children:(0,a.jsx)(u.A,{className:"size-3"})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-bold",style:{background:`${i}22`,color:i},children:t.method}),(0,a.jsx)("span",{title:t.path,className:"min-w-0 flex-1 break-all font-mono text-[11px] leading-tight [-webkit-box-orient:vertical] [-webkit-line-clamp:2] [display:-webkit-box] overflow-hidden",children:t.path}),"INTROSPECTION"!==t.source&&(0,a.jsx)("span",{title:"planned — not yet detected in code",className:"shrink-0 rounded-md border border-[#f5b942]/35 bg-[#f5b942]/10 px-1.5 py-px font-mono text-[8px] font-semibold uppercase tracking-[0.14em] text-[#f5b942]",children:"planned"}),(0,a.jsx)(v,{badges:h}),(0,a.jsx)("button",{type:"button",onClick:t=>{E(t),M?b.deleteRealEndpoint(e):S(!0)},onBlur:()=>S(!1),title:M?"Click again to delete":"Delete endpoint",className:(0,f.cn)(A,"shrink-0 opacity-0 transition-opacity group-hover:opacity-100",M?"text-red-300 opacity-100":"text-muted-foreground hover:text-red-300"),children:(0,a.jsx)(u.A,{className:"size-3"})})]}),(t.pins?.length??0)>0?(0,a.jsx)(w.e0,{pins:t.pins,onPinClick:t.onPinClick}):t.onComment&&(0,a.jsx)("button",{type:"button",title:`Comment on ${t.method} ${t.path}`,onClick:e=>{E(e),t.onComment?.(`${t.method} ${t.path}`)},className:(0,f.cn)(A,"absolute -right-3 top-1/2 z-10 flex size-6 -translate-y-1/2 items-center justify-center rounded-full border border-white/15 bg-[#242428] text-muted-foreground opacity-0 shadow-md transition-all group-hover:opacity-100 hover:border-[#ff7a45]/50 hover:text-[#ff7a45]"),children:(0,a.jsx)(d.A,{className:"size-3"})})]})});var D=n(54698),F=n(82099),R=n(4474);let O=[{id:"claude",label:"Prompt p/ Claude Code",fn:function(e){let t=["Implement this database schema in this project, following its existing stack and conventions:",""];for(let n of e.tables){let e=`Table \`${n.name}\``+(n.domain?` (domain: ${n.domain})`:"")+(n.description?` — ${n.description}`:"");for(let a of(t.push(e),n.columns)){let e=[a.isPk&&"PK",a.isFk&&"FK",!1===a.nullable&&"NOT NULL"].filter(Boolean).join(", ");t.push(` - ${a.name}: ${a.type}`+(e?` [${e}]`:"")+(a.note?` — ${a.note}`:""))}t.push("")}if(e.relations.length){for(let n of(t.push("Foreign keys:"),e.relations))t.push(` - ${n.fromTable}.${n.fromColumn} -> ${n.toTable}.${n.toColumn}`);t.push("")}return t.push("Create the models/migrations using the project's existing ORM and patterns, wire the relationships, and keep table and column names exactly as given."),t.join("\n")}},{id:"dbml",label:"DBML",fn:function(e){let t=[];for(let n of e.tables){for(let e of(t.push(`Table ${n.name} {`),n.columns)){let n=[e.isPk&&"pk",!1===e.nullable&&!e.isPk&&"not null",e.note&&`note: '${e.note.replace(/'/g,"")}'`].filter(Boolean).join(", ");t.push(` ${e.name} ${e.type}`+(n?` [${n}]`:""))}t.push("}","")}for(let n of e.relations)t.push(`Ref: ${n.fromTable}.${n.fromColumn} > ${n.toTable}.${n.toColumn}`);return t.join("\n").trim()}},{id:"sql",label:"SQL DDL",fn:function(e){let t=[];for(let n of e.tables){t.push(`CREATE TABLE ${n.name} (`);let a=n.columns.map(e=>{let t=[` ${e.name} ${e.type}`];return e.isPk?t.push("PRIMARY KEY"):!1===e.nullable&&t.push("NOT NULL"),t.join(" ")}),s=e.relations.filter(e=>e.fromTable===n.name).map(e=>` FOREIGN KEY (${e.fromColumn}) REFERENCES ${e.toTable}(${e.toColumn})`);t.push([...a,...s].join(",\n")),t.push(");","")}return t.join("\n").trim()}}];function L({draftGraph:e}){let[t,n]=(0,s.useState)(null);if(0===e.tables.length)return null;async function o(t){await navigator.clipboard.writeText(t.fn(e)).catch(()=>{}),n(t.id),setTimeout(()=>n(null),1500)}return(0,a.jsxs)("div",{className:"space-y-2 rounded-xl border border-sky-400/20 bg-sky-500/[0.04] p-3",children:[(0,a.jsxs)("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-sky-300",children:["Rascunho \xb7 ",e.tables.length," tabelas"]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"copiar:"}),O.map(e=>(0,a.jsx)(R.$,{size:"sm",variant:"outline",className:"h-6 px-2 text-[11px]",onClick:()=>o(e),children:t===e.id?"✓":e.label},e.id))]})]})}function K({selected:e,tables:t,relations:n,endpoints:s,draftGraph:o,onClose:l,commentsContent:i,commentsCount:r=0,activeTab:c,onTabChange:m,onAddComment:u,topOffset:h}){let f,x,b=new Map(t.map(e=>[e.id,e.name])),g=!!i,y=c??"details",j=e?.kind==="table"?t.find(t=>t.id===e.id)?.name??null:e?.kind==="endpoint"&&(x=s.find(t=>t.id===e.id))?`${x.method} ${x.path}`:null;if(e?.kind==="table"){let o=t.find(t=>t.id===e.id);f=o?(0,a.jsx)(H,{table:o,relations:n,endpoints:s,nameById:b}):null}else if(e?.kind==="endpoint"){let t=s.find(t=>t.id===e.id);f=t?(0,a.jsx)(_,{ep:t,nameById:b}):null}else f=(0,a.jsx)(Z,{tables:t,relations:n,endpoints:s});return(0,a.jsxs)(F.b,{className:"absolute right-3 z-10 flex w-80 flex-col rounded-2xl",style:{top:h??12,maxHeight:`calc(100% - ${(h??12)+12}px)`},children:[g?(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-white/10 px-1 py-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,a.jsx)(B,{active:"details"===y,onClick:()=>m?.("details"),children:"Details"}),(0,a.jsxs)(B,{active:"comments"===y,onClick:()=>m?.("comments"),children:["Comments",r>0&&(0,a.jsx)("span",{className:"ml-1 rounded-full bg-white/10 px-1 text-[9px] font-semibold leading-4",children:r})]})]}),(0,a.jsx)("button",{onClick:l,title:"Close panel",className:"mr-1 rounded-md p-1 text-muted-foreground transition-colors hover:bg-white/10 hover:text-foreground",children:(0,a.jsx)(p.A,{className:"size-4"})})]}):(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-white/10 px-3.5 py-2.5",children:[(0,a.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Panel"}),(0,a.jsx)("button",{onClick:l,title:"Close panel",className:"rounded-md p-1 text-muted-foreground transition-colors hover:bg-white/10 hover:text-foreground",children:(0,a.jsx)(p.A,{className:"size-4"})})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:"comments"===y&&g?(0,a.jsx)("div",{className:"p-3",children:i}):(0,a.jsxs)(a.Fragment,{children:[o.tables.length>0&&(0,a.jsx)("div",{className:"border-b border-white/10 p-3.5",children:(0,a.jsx)(L,{draftGraph:o})}),(0,a.jsxs)("div",{className:"p-4",children:[u&&j&&(0,a.jsxs)("button",{type:"button",onClick:()=>u(j),className:"mb-3 flex w-full items-center justify-center gap-1.5 rounded-lg border border-white/10 bg-white/[0.03] px-3 py-1.5 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-white/[0.06] hover:text-foreground",children:[(0,a.jsx)(d.A,{className:"size-3.5"}),"Comment on this ",e?.kind==="endpoint"?"endpoint":"table"]}),f]})]})})]})}function B({active:e,onClick:t,children:n}){return(0,a.jsx)("button",{type:"button",onClick:t,className:(0,f.cn)("flex items-center gap-1 rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors",e?"bg-white/10 text-foreground":"text-muted-foreground hover:text-foreground"),children:n})}function H({table:e,relations:t,endpoints:n,nameById:s}){let o=t.filter(t=>t.fromTableId===e.id),l=t.filter(t=>t.toTableId===e.id),i=n.map(t=>({e:t,u:t.tables.find(t=>t.tableId===e.id)})).filter(e=>e.u);return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-xs uppercase tracking-wide",style:{color:(0,x.qA)(e.domain)},children:e.domain??"table"}),(0,a.jsx)("h2",{className:"font-mono text-lg font-semibold",children:e.name}),e.description&&(0,a.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:e.description})]}),(0,a.jsx)(U,{title:`Columns (${e.columns.length})`,children:(0,a.jsx)("ul",{className:"space-y-0.5",children:e.columns.map(e=>(0,a.jsxs)("li",{className:"flex items-center gap-1.5 text-xs",children:[e.isPk?(0,a.jsx)(c.A,{className:"size-3 text-amber-400"}):e.isFk?(0,a.jsx)(m.A,{className:"size-3 text-sky-400"}):(0,a.jsx)("span",{className:"size-3"}),(0,a.jsx)("span",{className:"font-mono",children:e.name}),(0,a.jsxs)("span",{className:"ml-auto font-mono text-[10px] text-muted-foreground",children:[e.type,!e.nullable&&" \xb7NN"]})]},e.name))})}),o.length>0&&(0,a.jsx)(U,{title:"References (FK out)",children:(0,a.jsx)("ul",{className:"space-y-1 text-xs",children:o.map(e=>(0,a.jsxs)("li",{className:"font-mono text-muted-foreground",children:[e.fromColumn," → ",s.get(e.toTableId),".",e.toColumn]},e.id))})}),l.length>0&&(0,a.jsx)(U,{title:"Referenced by (FK in)",children:(0,a.jsx)("ul",{className:"space-y-1 text-xs",children:l.map(e=>(0,a.jsxs)("li",{className:"font-mono text-muted-foreground",children:[s.get(e.fromTableId),".",e.fromColumn]},e.id))})}),i.length>0&&(0,a.jsx)(U,{title:`Used by endpoints (${i.length})`,children:(0,a.jsx)("ul",{className:"space-y-1 text-xs",children:i.map(({e,u:t})=>(0,a.jsxs)("li",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{style:{color:x.e6[e.method]},className:"font-bold",children:e.method}),(0,a.jsx)("span",{className:"truncate font-mono",children:e.path}),(0,a.jsx)("span",{className:"ml-auto",style:{color:x.ru[t.access]},children:t.access})]},e.id))})})]})}function _({ep:e,nameById:t}){return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"rounded px-1.5 py-0.5 text-[11px] font-bold",style:{background:`${x.e6[e.method]}22`,color:x.e6[e.method]},children:e.method}),(0,a.jsx)("h2",{className:"mt-2 font-mono text-base font-semibold",children:e.path}),e.description&&(0,a.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:e.description})]}),(0,a.jsx)(U,{title:`Tables used (${e.tables.length})`,children:(0,a.jsx)("ul",{className:"space-y-1 text-xs",children:e.tables.map(e=>(0,a.jsxs)("li",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"font-mono",children:t.get(e.tableId)}),(0,a.jsx)("span",{className:"ml-auto",style:{color:x.ru[e.access]},children:e.access})]},e.tableId))})})]})}function Z({tables:e,relations:t,endpoints:n}){return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-sm font-semibold",children:"Database"}),(0,a.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"Live schema derived from your code. Click a table or endpoint to see details. Drag to rearrange — positions are saved."})]}),(0,a.jsxs)("dl",{className:"grid grid-cols-3 gap-2 text-center",children:[(0,a.jsx)(q,{label:"tables",value:e.length}),(0,a.jsx)(q,{label:"FKs",value:t.length}),(0,a.jsx)(q,{label:"endpoints",value:n.length})]}),(0,a.jsx)(U,{title:"Legend",children:(0,a.jsxs)("ul",{className:"space-y-1 text-xs text-muted-foreground",children:[(0,a.jsxs)("li",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(c.A,{className:"size-3 text-amber-400"})," primary key"]}),(0,a.jsxs)("li",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(m.A,{className:"size-3 text-sky-400"})," foreign key"]}),(0,a.jsx)("li",{children:"— gray line: FK relation between tables"}),(0,a.jsx)("li",{children:"– – dashed line: endpoint uses table (read/write)"})]})})]})}function U({title:e,children:t}){return(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:e}),t]})}function q({label:e,value:t}){return(0,a.jsxs)("div",{className:"rounded-lg border border-white/10 bg-white/[0.03] py-2",children:[(0,a.jsx)("div",{className:"text-lg font-semibold",children:t}),(0,a.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:e})]})}var W=n(56614),G=n(9991),J=n(40654),Q=n(14983),V=n(62311);let X=new Set(["GET","HEAD","OPTIONS"]);var Y=n(44267),ee=n(94014);function et(e){return 36+30*Math.max(0,e)+16}let en="Unattached",ea=e=>(e??"").trim()||"—";function es(e,t){let n=new Map(e.map(e=>[e.id,e.name])),a=new Map;for(let e of t)for(let t of e.uses)n.has(t.tableId)&&a.set(t.tableId,(a.get(t.tableId)??0)+1);return new Map(t.map(e=>[e.id,function(e,t,n){let a=new Map;for(let n of e.uses)t.has(n.tableId)&&a.set(n.tableId,(a.get(n.tableId)??0)+1);let s=null;for(let[e,o]of a){if(null===s){s=e;continue}let l=a.get(s);if(o>l){s=e;continue}if(o<l)continue;let i=n?.get(e)??0,r=n?.get(s)??0;i<r?s=e:i===r&&0>t.get(e).localeCompare(t.get(s))&&(s=e)}return s}(e,n,a)]))}let eo=(e,t)=>e.path.localeCompare(t.path)||e.method.localeCompare(t.method)||e.id.localeCompare(t.id);var el=n(70947);let ei=e=>e.trim().toLowerCase();var er=n(85618),ed=n(80846),ec=n(17356),em=n(45486),eu=n(15330),ep=n(60976),eh=n(64577),ef=n(24692),ex=n(45437);let eb={dbTable:$,endpoint:z,annotation:w.Sh},eg={deletable:ef.I,annotation:ex.L},ey="beacon:db-draft",ej={proposedAt:0,status:"pending",tables:[],relations:[],endpoints:[]};function ek({tables:e,relations:t,endpoints:n,draft:d,workspaceId:c,embedded:m=!1,diffBase:p,draftRef:h,onEdit:g,controlRef:k,commentsContent:N,commentsCount:v=0,onAddComment:C,annotations:T,onPinClick:M,onUpdateComment:S,onRemoveComment:E,boardAnnotations:I,readOnly:$=!1}){let A=(0,l.useRouter)(),P=e.length+(d?.tables.length??0),z=n.length+(d?.endpoints.length??0),[F,R]=(0,s.useState)(z>0&&(m||0===P)),[O,L]=(0,s.useState)(null),[B,H]=(0,s.useState)(null),[_,Z]=(0,s.useState)(null),[U,q]=(0,s.useState)(!1),[ef,ex]=(0,s.useState)(!1),[ew,eN]=(0,s.useState)("details"),[ev,eC]=(0,s.useState)(!1),[eT,eM]=(0,s.useState)(""),eS=(0,s.useRef)(null),{tool:eE,setTool:eI,flowProps:e$}=(0,o.e)();(0,s.useEffect)(()=>{if(!$)return;let e=0,t=requestAnimationFrame(()=>{e=requestAnimationFrame(()=>eS.current?.fitView({padding:.2,duration:0}))});return()=>{cancelAnimationFrame(t),cancelAnimationFrame(e)}},[$,d,F]),(0,s.useEffect)(()=>{if(k)return k.current={open:()=>{q(!0),eN("details")},close:()=>{q(!1),eN("details")},openComments:()=>{q(!0),eN("comments")}},()=>{k&&(k.current=null)}},[k]);let[eA,eP]=(0,s.useState)(new Set),[ez,eD]=(0,s.useState)("full"),[eF,eR]=(0,s.useState)(new Set),[eO,eL]=(0,s.useState)(new Set),[eK,eB]=(0,s.useState)(()=>({past:[],present:d??ej,future:[],rev:0,edited:!1})),eH=eK.present,e_=(0,s.useCallback)(e=>{eB(t=>{let n=e(t.present);return n===t.present?t:{past:[...t.past,t.present].slice(-100),present:n,future:[],rev:t.rev+1,edited:!0}})},[]),eZ=(0,s.useCallback)(e=>{eB(t=>{let n=e(t.present);return n===t.present?t:{...t,present:n}})},[]),eU=(0,s.useCallback)(()=>eB(e=>e.past.length?{past:e.past.slice(0,-1),present:e.past[e.past.length-1],future:[e.present,...e.future],rev:e.rev+1,edited:!0}:e),[]),eq=(0,s.useCallback)(()=>eB(e=>e.future.length?{past:[...e.past,e.present],present:e.future[0],future:e.future.slice(1),rev:e.rev+1,edited:!0}:e),[]),eW=(0,s.useCallback)(e=>eB(t=>({past:[],present:e,future:[],rev:t.rev+1,edited:!1})),[]),eG=(0,s.useRef)(!1),eJ=d?.proposedAt??0;(0,s.useEffect)(()=>{let e=null;if(eG.current)d&&d.proposedAt!==eH.proposedAt?e=d:!d&&(eH.tables.length>0||eH.endpoints.length>0)&&(e=ej);else{eG.current=!0;let t=null;try{let e=localStorage.getItem(ey);if(e){let n=JSON.parse(e);n.workspaceId===c&&n.doc&&d&&n.doc.proposedAt===d.proposedAt&&(t=n.doc)}}catch{}e=t??d??null}e&&eW(e)},[eJ]),(0,s.useEffect)(()=>{try{eH.tables.length>0||eH.endpoints.length>0?localStorage.setItem(ey,JSON.stringify({workspaceId:c,doc:eH})):localStorage.removeItem(ey)}catch{}},[eH,c]),(0,s.useEffect)(()=>{h&&(h.current=eH)},[h,eH]);let eQ=(0,s.useRef)(!1);(0,s.useEffect)(()=>{eK.edited&&!eQ.current&&(eQ.current=!0,g?.())},[eK.edited,g]);let eV=(0,s.useMemo)(()=>eH.tables.map(e=>({id:e.id,name:e.name,domain:e.domain,description:e.description,source:"DRAFT",x:e.x,y:e.y,columns:e.columns})),[eH]),eX=(0,s.useMemo)(()=>eH.endpoints.map(e=>({id:e.id,method:e.method,path:e.path,domain:e.domain,description:e.description,source:"DRAFT",x:e.x,y:e.y,tables:e.links.map(e=>({tableId:e.tableId,access:e.access}))})),[eH]),eY=(0,s.useMemo)(()=>[...e,...eV],[e,eV]),e0=(0,s.useMemo)(()=>[...n,...eX],[n,eX]),e1=(0,s.useMemo)(()=>(function(e,t,n={}){let a=es(e,t),s=new Map,o=[];for(let e of[...t].sort(eo)){let t=a.get(e.id)??null;if(t){let n=s.get(t);n?n.push(e):s.set(t,[e])}else o.push(e)}let l=e=>{let t=s.get(e.id)?.length??0;return et(e.columnCount)+(t?10+60*t:0)+30},i=Array.from(new Set(e.map(e=>ea(e.domain)))),r=i.filter(e=>"—"!==e).sort(),d=i.includes("—")?[...r,"—"]:r,c=[];for(let t of d){let n=e.filter(e=>ea(e.domain)===t).sort((e,t)=>e.name.localeCompare(t.name)),a=n.reduce((e,t)=>e+l(t),0),s=Math.max(1,Math.min(12,n.length,Math.round(Math.sqrt(a/320)))),o=Array(s).fill(0),i=new Map;for(let e of n){let t=0;for(let e=1;e<s;e++)o[e]<o[t]&&(t=e);i.set(e.id,{x:320*t,y:o[t]}),o[t]+=l(e)}c.push({d:t,w:320*s,h:Math.max(...o,0),tableLocal:i})}let m=(0,ee.Xi)(c.map(e=>({id:e.d,w:e.w,h:e.h})),{gapX:84,gapY:72,viewportAspect:n.viewportAspect,minBandW:960,aspectSlack:1.7}),u=new Map,p=new Map,h=0;for(let t of c){let n=m.get(t.d);for(let a of e.filter(e=>t.tableLocal.has(e.id))){let e=t.tableLocal.get(a.id),o=n.x+e.x,l=n.y+e.y;u.set(a.id,{x:o,y:l}),(s.get(a.id)??[]).forEach((e,t)=>{p.set(e.id,{x:o,y:l+et(a.columnCount)+10+60*t})})}h=Math.max(h,n.y+t.h)}if(o.length){let e=h+72,t=Math.max(1,Math.min(4,Math.ceil(Math.sqrt(o.length/2))));o.forEach((n,a)=>{p.set(n.id,{x:a%t*300,y:e+60*Math.floor(a/t)})})}return{tables:u,endpoints:p}})(eY.map(e=>({id:e.id,name:e.name,domain:e.domain,columnCount:e.columns.length})),[]).tables,[eY]),e5=(0,s.useMemo)(()=>new Map,[]),e2=(0,s.useMemo)(()=>m?function(e,t){let n=new Map(e.map(e=>[ei(e.name),e])),a=new Map;for(let e of t){let t=n.get(ei(e.name));if(!t){a.set(e.id,{status:"added",changes:["new table"],columns:{}});continue}let{changes:s,columns:o}=function(e,t){let n=new Map(e.map(e=>[ei(e.name),e])),a=new Set(t.map(e=>ei(e.name))),s=[],o={};for(let e of t){let t=n.get(ei(e.name));if(!t){s.push(`+ column ${e.name} (${e.type})`),o[e.name]={kind:"added",detail:"new column"};continue}let a=[],l=[];if(ei(t.type)!==ei(e.type)&&(a.push(`type ${t.type}→${e.type}`),l.push(`${t.type}→${e.type}`)),t.isPk!==e.isPk){let t=e.isPk?"now PK":"no longer PK";a.push(t),l.push(t)}if(t.isFk!==e.isFk){let t=e.isFk?"now FK":"no longer FK";a.push(t),l.push(t)}if(t.nullable!==e.nullable){let t=e.nullable?"now nullable":"now required";a.push(t),l.push(t)}a.length&&(s.push(`~ column ${e.name}: ${a.join(", ")}`),o[e.name]={kind:"modified",detail:l.join(" \xb7 ")})}for(let t of e)a.has(ei(t.name))||s.push(`- column ${t.name}`);return{changes:s,columns:o}}(t.columns,e.columns);a.set(e.id,{status:s.length?"modified":"unchanged",changes:s,columns:o})}return a}(p?.tables??e,eV):e5,[m,p,e,eV,e5]),e3=(0,s.useMemo)(()=>m?function(e,t){let n=e=>`${ei(e.method)} ${ei(e.path)}`,a=new Set(e.map(n)),s=new Map;for(let e of t)s.set(e.id,a.has(n(e))?{status:"unchanged",changes:[],columns:{}}:{status:"added",changes:["new endpoint"],columns:{}});return s}(p?.endpoints??n,eX):e5,[m,p,n,eX,e5]),e4=(0,s.useMemo)(()=>[...t,...eH.relations.map(e=>({id:e.id,fromTableId:e.fromTableId,toTableId:e.toTableId,fromColumn:e.fromColumn,toColumn:e.toColumn,label:e.label}))],[t,eH.relations]),e6=(0,s.useMemo)(()=>{let e=new Map;for(let t of e0)for(let n of t.tables)e.set(n.tableId,(e.get(n.tableId)??0)+1);return e},[e0]),e8=(0,s.useMemo)(()=>{let e=new Map;return eY.forEach(t=>e.set(t.id,t.x)),e0.forEach(t=>e.set(t.id,t.x)),e},[eY,e0]),e9=(0,s.useMemo)(()=>{let e=new Map;return eY.forEach(t=>e.set(t.id,t.y)),e0.forEach(t=>e.set(t.id,t.y)),e},[eY,e0]),e7=(0,s.useMemo)(()=>{let e=new Map(eY.map(e=>[e.id,e.name])),t=new Map;for(let n of e4){let a=e.get(n.toTableId);if(!a)continue;let s=t.get(n.fromTableId)??{};s[n.fromColumn]=a,t.set(n.fromTableId,s)}return t},[e4,eY]),te=void 0!==I,[tt,tn]=(0,s.useState)(I??[]);(0,s.useEffect)(()=>{I&&tn(I)},[I]);let ta=(0,s.useMemo)(()=>({tables:eY.map(e=>({id:e.id,name:e.name,columns:e.columns.map(e=>e.name)})),endpoints:e0.map(e=>({id:e.id,method:e.method,path:e.path}))}),[eY,e0]),ts=(0,s.useMemo)(()=>{if(te){let e=new Set([...eY.map(e=>e.id),...e0.map(e=>e.id)]);return tt.filter(t=>e.has(t.targetId)).map((e,t)=>({id:e.id,n:t+1,targetId:e.targetId,column:e.columnName,text:e.body,x:e.x,y:e.y}))}let e=new Map((T??[]).map(e=>[e.id,e.comment]));return(0,D.m)(T??[],ta).map(t=>({id:t.annotationId,n:t.n,targetId:t.targetId,column:t.column,text:e.get(t.annotationId)??"",x:null,y:null}))},[te,tt,T,ta,eY,e0]),to=(0,s.useMemo)(()=>{let e=new Map;for(let t of ts){let n=e.get(t.targetId)??[];n.push({id:t.id,n:t.n,column:t.column}),e.set(t.targetId,n)}return e},[ts]),tl=(0,s.useMemo)(()=>new Map(ts.map(e=>[`anno-${e.id}`,e.targetId])),[ts]),ti=(0,s.useCallback)(async e=>{let t=(0,D.m)([{id:"_",excerpt:e}],ta)[0];if(!t)return;let n=await fetch("/api/board-annotations",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({targetKind:t.kind,targetId:t.targetId,columnName:t.column??void 0})});if(n.ok){let e=await n.json();tn(t=>[...t,e])}},[ta]),tr=(0,s.useCallback)((e,t)=>{tn(n=>n.map(n=>n.id===e?{...n,...t}:n)),fetch(`/api/board-annotations/${e}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)})},[]),td=(0,s.useCallback)(e=>{tn(t=>t.filter(t=>t.id!==e)),fetch(`/api/board-annotations/${e}`,{method:"DELETE"})},[]),tc=te?ti:C,tm=(0,s.useCallback)((e,t)=>{let n=(e8.get(t)??0)-(e8.get(e)??0),a=(e9.get(t)??0)-(e9.get(e)??0);return Math.abs(n)>=Math.abs(a)?n>=0?{sourceHandle:"sr",targetHandle:"tl"}:{sourceHandle:"sl",targetHandle:"tr"}:a>=0?{sourceHandle:"sb",targetHandle:"tt"}:{sourceHandle:"st",targetHandle:"tb"}},[e8,e9]),tu=(0,s.useMemo)(()=>new Set([...eH.tables.map(e=>e.id),...eH.endpoints.map(e=>e.id)]),[eH]),tp=(0,s.useMemo)(()=>new Set(e.map(e=>e.id)),[e]),th=(0,s.useCallback)(()=>{let e=eY.map(e=>({id:e.id,type:"dbTable",position:F?{x:e.x,y:e.y}:e1.get(e.id)??{x:e.x,y:e.y},data:{name:e.name,domain:e.domain,columns:e.columns,usageCount:e6.get(e.id)??0,source:e.source,rev:eK.rev,diffStatus:e2.get(e.id)?.status,diffChanges:e2.get(e.id)?.changes,diffColumns:e2.get(e.id)?.columns,fkTargets:e7.get(e.id),pins:to.get(e.id),onPinClick:M,onComment:tc}})),t=e0.map(e=>({id:e.id,type:"endpoint",position:{x:e.x,y:e.y},data:{method:e.method,path:e.path,domain:e.domain,source:e.source,rev:eK.rev,diffStatus:e3.get(e.id)?.status,diffChanges:e3.get(e.id)?.changes,pins:to.get(e.id),onPinClick:M,onComment:tc}})),n=new Map,a=new Map(eY.map(e=>[e.id,e])),s=new Map(e0.map(e=>[e.id,e]));return[...e,...t,...ts.map(e=>{let t=a.get(e.targetId),o=s.get(e.targetId),l=t?.x??o?.x??0,i=t?.y??o?.y??0,r=t?38+28*t.columns.length:42,d=n.get(e.targetId)??0;return n.set(e.targetId,d+1),{id:`anno-${e.id}`,type:"annotation",position:{x:e.x??l+26,y:e.y??i+r+64+112*d},data:{n:e.n,text:e.text,annotationId:e.id,onClick:te||S?void 0:M,editable:te||!!S,onChangeText:te?(e,t)=>tr(e,{body:t}):S,onDelete:te?td:E}}})]},[eY,e0,F,e1,e6,eK.rev,e2,e3,e7,to,ts,te,M,S,E,tc,tr,td]),[tf,tx,tb]=(0,i.ck)(th()),tg=(0,s.useRef)(F);(0,s.useEffect)(()=>{let e=tg.current!==F;tg.current=F,tx(t=>{let n=new Map(t.map(e=>[e.id,e.position]));return th().map(t=>e&&"dbTable"===t.type?t:{...t,position:n.get(t.id)??t.position})}),e&&requestAnimationFrame(()=>eS.current?.fitView({duration:500,padding:.15,minZoom:.2,maxZoom:.9}))},[th,tx,F]);let ty=(0,s.useCallback)((e,t,n,a)=>{fetch("/api/db/position",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({kind:e,id:t,x:n,y:a})})},[]),tj=(0,s.useCallback)((e,t)=>{var n;let{x:a,y:s}=t.position,o=(n={readOnly:$,nodeId:t.id,isDraft:tu.has(t.id),boardMode:te}).readOnly?"none":n.nodeId.startsWith("anno-")?n.boardMode?"annotation":"none":n.isDraft?"draft":"real";"annotation"===o?tr(t.id.slice(5),{x:a,y:s}):"draft"===o?eZ(e=>e.tables.some(e=>e.id===t.id)?{...e,tables:e.tables.map(e=>e.id===t.id?{...e,x:a,y:s}:e)}:e.endpoints.some(e=>e.id===t.id)?{...e,endpoints:e.endpoints.map(e=>e.id===t.id?{...e,x:a,y:s}:e)}:e):"real"===o&&ty("endpoint"===t.type?"endpoint":"table",t.id,a,s)},[$,tu,eZ,ty,te,tr]),tk=(0,s.useMemo)(()=>e4.map(e=>({id:`fk-${e.id}`,source:e.fromTableId,target:e.toTableId,...tm(e.fromTableId,e.toTableId),type:"deletable",label:e.label??void 0,markerEnd:{type:r.TG.ArrowClosed,color:"#6b6b6b"},style:{stroke:"#6b6b6b"}})),[e4,tm]),tw=(0,s.useMemo)(()=>e0.flatMap(e=>e.tables.map(t=>{let n=x.ru[t.access]??"#5a5a5a";return{id:`u-${e.id}-${t.tableId}`,source:e.id,target:t.tableId,...tm(e.id,t.tableId),type:"default",markerEnd:{type:r.TG.ArrowClosed,color:n},style:{stroke:n,strokeDasharray:"4 4",opacity:.7}}})),[e0,tm]),tN=(0,s.useMemo)(()=>F?[...tk,...tw]:tk,[tk,tw,F]),tv=(0,s.useMemo)(()=>ts.map(e=>({id:`annoe-${e.id}`,source:e.targetId,sourceHandle:`pin-${e.id}`,target:`anno-${e.id}`,targetHandle:"in",type:"annotation",selectable:!1,zIndex:30,style:{stroke:w.V5,strokeWidth:1.5,opacity:.9}})),[ts]),tC=O?.id??_,tT=(0,s.useMemo)(()=>{if(B){let e=tN.find(e=>e.id===B);return e?new Set([e.source,e.target]):null}return tC?(0,x.F1)(tC,tN):null},[tC,B,tN]),tM=(0,s.useMemo)(()=>new Map(eY.map(e=>[e.id,{domain:e.domain,source:e.source}])),[eY]),tS=(0,s.useMemo)(()=>new Map(e0.map(e=>[e.id,{method:e.method,source:e.source}])),[e0]),tE=(0,s.useMemo)(()=>{let e=new Set;if(!F)for(let t of tS.keys())e.add(t);for(let[t,n]of tM)!eA.size||n.domain&&eA.has(n.domain)||e.add(t),eF.size&&!eF.has(n.source)&&e.add(t);for(let[t,n]of tS)eO.size&&!eO.has(n.method)&&e.add(t),eF.size&&!eF.has(n.source)&&e.add(t);return e},[F,tM,tS,eA,eF,eO]),tI=eT.trim().length>0,t$=(0,s.useMemo)(()=>{if(!tI)return null;let e=new Set;for(let t of eY)!tE.has(t.id)&&(0,Q.Qk)((0,Q.jF)(t),eT)&&e.add(t.id);for(let t of e0)!tE.has(t.id)&&(0,Q.Qk)((0,Q.sQ)(t),eT)&&e.add(t.id);return e},[eY,e0,tE,eT,tI]),tA=(0,s.useMemo)(()=>tI?[...(0,Q.r2)(eY.filter(e=>!tE.has(e.id)),eT,e=>(0,Q.jF)(e),e=>({id:e.id,label:e.name,sublabel:e.domain??"table",kind:"table"})),...(0,Q.r2)(e0.filter(e=>!tE.has(e.id)),eT,e=>(0,Q.sQ)(e),e=>({id:e.id,label:e.path,sublabel:e.method,kind:"endpoint"}))].slice(0,12):[],[eY,e0,tE,eT,tI]),tP=(0,s.useCallback)(e=>{eM(""),L(tS.has(e)?{id:e,kind:"endpoint"}:{id:e,kind:"table"}),H(null),q(!0),eN("details");let t=eS.current?.getNode(e);if(!t||!eS.current)return;let n=t.measured?.width??220,a=t.measured?.height??80;eS.current.setCenter(t.position.x+n/2,t.position.y+a/2,{zoom:.9,duration:600})},[tS]),tz=t$??tT,tD=(0,s.useMemo)(()=>tf.map(e=>{if(e.id.startsWith("anno-")){let t=tl.get(e.id),n=!!t&&tE.has(t);return!!e.hidden!==n?{...e,hidden:n}:e}let t=tE.has(e.id);if(!tz)return t?{...e,hidden:t}:e;let n=tz.has(e.id),a=t$?Q.Uy:.45;return{...e,hidden:t,style:{...e.style,opacity:n?1:a,boxShadow:n&&t$?Q.RU:e.style?.boxShadow,borderRadius:n&&t$?12:e.style?.borderRadius,transition:"opacity 120ms, box-shadow 120ms"}}}),[tf,tE,tz,t$,tl]),tF=(0,s.useMemo)(()=>{let e=new Map(eY.map(e=>[e.id,(e.domain??"").trim()||"—"])),t=es(eY,e0.map(e=>({id:e.id,method:e.method,path:e.path,uses:e.tables.map(e=>({tableId:e.tableId}))})));return new Map(e0.map(n=>{let a=t.get(n.id);return[n.id,a?e.get(a):en]}))},[eY,e0]),tR=(0,s.useMemo)(()=>{let e=[];for(let t of tf)if(!tE.has(t.id))if("dbTable"===t.type){let n=t.data;e.push({id:t.id,group:(n.domain??"").trim()||"—",x:t.position.x,y:t.position.y,w:t.measured?.width??280,h:t.measured?.height??38+28*n.columns.length})}else"endpoint"===t.type&&e.push({id:t.id,group:tF.get(t.id)??en,x:t.position.x,y:t.position.y,w:t.measured?.width??240,h:t.measured?.height??50});return(0,Y.S)(e)},[tf,tE,tF]),tO=(0,s.useMemo)(()=>t$?tN.map(e=>{let t=tE.has(e.source)||tE.has(e.target);return t$.has(e.source)&&t$.has(e.target)?{...e,hidden:t,style:{...e.style,opacity:1}}:{...e,hidden:t,label:void 0,style:{...e.style,opacity:.08}}}):tN.map(e=>{let t=tE.has(e.source)||tE.has(e.target);return tC||B?(B?e.id===B:tC&&(e.source===tC||e.target===tC))?{...e,hidden:t,zIndex:20,style:{...e.style,opacity:1,strokeWidth:2.5}}:{...e,hidden:t,selectable:!1,label:void 0,markerEnd:void 0,style:{...e.style,opacity:.08}}:{...e,hidden:t,label:void 0}}),[tN,tC,B,tE,t$]),tL=(0,s.useMemo)(()=>Array.from(new Set(eY.map(e=>e.domain).filter(e=>!!e))).sort(),[eY]),tK=(0,s.useMemo)(()=>Array.from(new Set([...eY.map(e=>e.source),...e0.map(e=>e.source)])).sort(),[eY,e0]),tB=(0,s.useMemo)(()=>Array.from(new Set(e0.map(e=>e.method))).sort(),[e0]);function tH(e,t){t(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}let t_=+!F+eA.size+eF.size+eO.size,tZ=(0,s.useCallback)(()=>{R(!0),eP(new Set),eR(new Set),eL(new Set)},[]),tU=(0,s.useCallback)(e=>{let{source:t,target:n}=e;t&&n&&t!==n&&e_(e=>{if(!(e.tables.some(e=>e.id===n)||tp.has(n)))return e;let a=e.endpoints.find(e=>e.id===t);return a?a.links.some(e=>e.tableId===n)?e:{...e,endpoints:e.endpoints.map(e=>{var a;return e.id===t?{...e,links:[...e.links,{tableId:n,access:(a=e.method,X.has(a.trim().toUpperCase())?"read":"write")}]}:e})}:e.tables.find(e=>e.id===t)?e.relations.some(e=>e.fromTableId===t&&e.toTableId===n)?e:{...e,relations:[...e.relations,{id:crypto.randomUUID(),fromTableId:t,toTableId:n,fromColumn:"fk",toColumn:"id",label:null}]}:e})},[e_,tp]),tq=(0,s.useMemo)(()=>({readOnly:$,patchEndpoint:(e,t)=>e_(n=>({...n,endpoints:n.endpoints.map(n=>n.id===e?{...n,...t}:n)})),deleteEndpoint:e=>e_(t=>({...t,endpoints:t.endpoints.filter(t=>t.id!==e)})),patchTable:(e,t)=>e_(n=>({...n,tables:n.tables.map(n=>n.id===e?{...n,...t}:n)})),deleteTable:e=>e_(t=>({...t,tables:t.tables.filter(t=>t.id!==e),relations:t.relations.filter(t=>t.fromTableId!==e&&t.toTableId!==e),endpoints:t.endpoints.map(t=>({...t,links:t.links.filter(t=>t.tableId!==e)}))})),deleteRealEndpoint:e=>{fetch(`/api/endpoints/${e}`,{method:"DELETE"}).then(e=>{e.ok&&A.refresh()})}}),[$,e_,A]);(0,s.useEffect)(()=>{let e=e=>{if(!(e.metaKey||e.ctrlKey))return;let t=e.target;if(t&&/^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName))return;let n=e.key.toLowerCase();"z"===n?(e.preventDefault(),e.shiftKey?eq():eU()):"y"===n&&(e.preventDefault(),eq())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[eU,eq]);let tW=(0,s.useCallback)(async()=>{eC(!0);try{if((await fetch("/api/draft/approve",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(eH)})).ok){try{localStorage.removeItem(ey)}catch{}eW(ej),A.refresh()}}finally{eC(!1)}},[eH,eW,A]),tG=(0,s.useCallback)(async()=>{eC(!0);try{await fetch("/api/draft",{method:"DELETE"})}catch{}try{localStorage.removeItem(ey)}catch{}eW(ej),A.refresh(),eC(!1)},[eW,A]),tJ=(0,s.useMemo)(()=>{let e;return e=new Map(eH.tables.map(e=>[e.id,e.name])),{tables:eH.tables.map(e=>({name:e.name,domain:e.domain,description:e.description,columns:e.columns.map(e=>({name:e.name,type:e.type,isPk:e.isPk,isFk:e.isFk,nullable:e.nullable,note:e.note}))})),relations:eH.relations.flatMap(t=>{let n=e.get(t.fromTableId),a=e.get(t.toTableId);return n&&a?[{fromTable:n,fromColumn:t.fromColumn,toTable:a,toColumn:t.toColumn,label:t.label}]:[]}),endpoints:eH.endpoints.map(t=>({method:t.method,path:t.path,domain:t.domain,description:t.description,uses:t.links.flatMap(t=>{let n=e.get(t.tableId);return n?[{table:n,access:t.access}]:[]})}))}},[eH]),tQ=eH.tables.length>0||eH.endpoints.length>0,tV=eK.past.length>0,tX=eK.future.length>0;return(0,a.jsx)(b.Provider,{value:tq,children:(0,a.jsxs)("div",{className:(0,f.cn)("canvas-dots relative w-full",m?"h-full":"h-screen",ef&&"rf-panning"),children:[(0,a.jsxs)(i.Gc,{...e$,nodes:tD,edges:"far"===ez?[...tO,...tv].map(e=>({...e,hidden:!0})):[...tO,...tv.map(e=>({...e,hidden:tE.has(e.source)}))],nodeTypes:eb,edgeTypes:eg,nodesConnectable:!$,connectionMode:r.WZ.Loose,connectionLineStyle:{stroke:"var(--accent-2,#ff7a45)",strokeWidth:1.5,strokeDasharray:"4 4"},onInit:e=>{eS.current=e},onNodesChange:tb,onMoveStart:()=>ex(!0),onMoveEnd:()=>ex(!1),onConnect:tU,onNodeMouseEnter:(e,t)=>{"annotation"!==t.type&&Z(t.id)},onNodeMouseLeave:()=>Z(null),onNodeClick:(e,t)=>{if("annotation"===t.type){let e=t.data;e.editable||M?.(e.annotationId);return}let n="endpoint"===t.type?"endpoint":"table";L({id:t.id,kind:n}),H(null),q(!0),eN("details")},onEdgeClick:(e,t)=>{H(t.id),L(null)},onPaneClick:()=>{L(null),H(null),q(!1)},onNodeDragStop:tj,onEdgesDelete:e=>{for(let t of e)if(t.id.startsWith("fk-")){let e=t.id.slice(3);fetch(`/api/db/relations/${e}`,{method:"DELETE"})}},onNodesDelete:e=>{for(let t of e)t.id.startsWith("anno-")||tu.has(t.id)||("endpoint"===t.type?fetch(`/api/endpoints/${t.id}`,{method:"DELETE"}):"dbTable"===t.type&&fetch(`/api/db/tables/${t.id}`,{method:"DELETE"}))},deleteKeyCode:$?null:["Backspace","Delete"],colorMode:"dark",fitView:!0,fitViewOptions:{padding:.15,minZoom:.38,maxZoom:.9},minZoom:.15,panOnScroll:!0,zoomActivationKeyCode:["Meta","Control"],proOptions:{hideAttribution:!0},children:[(0,a.jsx)(el.Z,{regions:tR,tone:"category",lod:ez}),(0,a.jsx)(y.J,{onLod:eD,thresholds:j.fE}),(0,a.jsx)(i.H2,{position:"bottom-right",className:"!overflow-hidden !rounded-xl !border !border-white/10 [&_button]:!border-white/10 [&_button]:!bg-card/70 [&_button]:!text-foreground [&_button]:!backdrop-blur"}),!m&&(0,a.jsx)(i.of,{pannable:!0,zoomable:!0,position:"bottom-left",style:{width:140,height:90},className:"!overflow-hidden !rounded-xl !border !border-white/10 !bg-card/50 !backdrop-blur",nodeColor:"#555"}),(0,a.jsx)(i.Zk,{position:"bottom-left",style:{marginBottom:118},children:(0,a.jsx)(o.H,{tool:eE,onChange:eI})}),!m&&(0,a.jsx)(i.Zk,{position:"bottom-center",className:"!mb-4",children:(0,a.jsx)("div",{className:"glass flex items-center rounded-full p-0.5",children:(0,a.jsxs)("button",{type:"button",disabled:ev,title:"Re-arrange the board — domain clusters with endpoints docked under their tables",onClick:async()=>{eC(!0);try{let e=window.innerWidth/window.innerHeight;await fetch("/api/db/arrange",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({viewportAspect:e})}),A.refresh()}finally{eC(!1)}},className:"flex h-6 items-center gap-1.5 rounded-full px-3 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-white/[0.06] hover:text-foreground disabled:opacity-40",children:[(0,a.jsx)(er.A,{className:"size-3"}),ev?"Arranging…":"Arrange"]})})}),!m&&(0,a.jsx)(i.Zk,{position:"top-center",className:"glass rounded-full px-1 py-0.5",children:(0,a.jsx)(V.Z,{active:"DATABASE",tabs:[{value:"ROADMAP",label:"Roadmap",href:"/map?view=ROADMAP"},{value:"ARCHITECTURE",label:"Architecture",href:"/map?view=ARCHITECTURE"},{value:"DATABASE",label:"Database",href:"/map?view=DATABASE"},{value:"FILES",label:"Files",href:"/map?view=FILES"}]})}),(0,a.jsxs)(i.Zk,{position:"top-right",className:(0,f.cn)("flex items-center gap-1 transition-[margin] duration-200",U&&"!mr-[332px]",m&&"hidden"),children:[(0,a.jsx)(G.X,{query:eT,onQuery:eM,hits:tA,placeholder:"Find a table, column, endpoint…",onPick:tP,onZoomToMatches:()=>{t$?.size&&eS.current?.fitView({nodes:[...t$].map(e=>({id:e})),duration:600,padding:.2})}}),(0,a.jsx)(J.e,{defaultSelection:"DATABASE"}),(0,a.jsxs)(W.er,{title:"Filters",trigger:(e,t)=>(0,a.jsxs)("button",{type:"button",onClick:t,title:"Filters",className:(0,f.cn)("glass relative flex size-8 items-center justify-center rounded-lg transition-colors",e||t_>0?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,a.jsx)(ed.A,{className:"size-4"}),t_>0&&(0,a.jsx)("span",{className:"absolute -right-1 -top-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-[var(--accent-2,#ff7a45)] px-1 text-[9px] font-semibold text-white",children:t_})]}),children:[(0,a.jsx)(W.r1,{title:"Show",children:(0,a.jsx)(W.vu,{tone:"accent",on:F,onClick:()=>R(e=>!e),children:"endpoints"})}),tL.length>0&&(0,a.jsx)(W.r1,{title:"Domain",children:tL.map(e=>(0,a.jsx)(W.vu,{on:eA.has(e),onClick:()=>tH(e,eP),children:e},e))}),tB.length>0&&(0,a.jsx)(W.r1,{title:"Method",children:tB.map(e=>(0,a.jsx)(W.vu,{on:eO.has(e),onClick:()=>tH(e,eL),children:e},e))}),tK.length>0&&(0,a.jsx)(W.r1,{title:"Source",children:tK.map(e=>(0,a.jsx)(W.vu,{on:eF.has(e),onClick:()=>tH(e,eR),children:e.toLowerCase()},e))}),t_>0&&(0,a.jsx)("button",{type:"button",onClick:tZ,className:"mt-1 w-full rounded-md border border-white/10 px-2 py-1 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-white/5 hover:text-foreground",children:"clear filters"})]}),(0,a.jsx)(W.er,{title:"Legend",trigger:(e,t)=>(0,a.jsx)("button",{type:"button",onClick:t,title:"Legend",className:(0,f.cn)("glass flex size-8 items-center justify-center rounded-lg transition-colors",e?"text-foreground":"text-muted-foreground hover:text-foreground"),children:(0,a.jsx)(ec.A,{className:"size-4"})}),children:(0,a.jsxs)("ul",{className:"space-y-1.5 text-[10.5px] text-muted-foreground",children:[(0,a.jsxs)("li",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"inline-block rounded border border-white/15 bg-white/[0.06] px-1 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-foreground/80",children:"table"}),(0,a.jsx)("span",{children:"a database table \xb7 its columns"})]}),(0,a.jsxs)("li",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"inline-block rounded border border-white/15 bg-white/[0.06] px-1 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-foreground/80",children:"endpoint"}),(0,a.jsx)("span",{children:"an API route \xb7 reads / writes tables"})]}),(0,a.jsxs)("li",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{"aria-hidden":!0,className:"inline-block h-px w-6 bg-[#6b6b6b]"}),(0,a.jsx)("span",{children:"foreign key \xb7 drag from a table handle"})]}),(0,a.jsxs)("li",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{"aria-hidden":!0,className:"inline-block h-0 w-6 border-t border-dashed",style:{borderColor:"#4ea1ff"}}),(0,a.jsx)("span",{children:"endpoint read \xb7 GET / POST / etc"})]}),(0,a.jsxs)("li",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{"aria-hidden":!0,className:"inline-block h-0 w-6 border-t border-dashed",style:{borderColor:"#ffb86b"}}),(0,a.jsx)("span",{children:"endpoint write"})]}),(0,a.jsxs)("li",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"inline-block rounded border border-dashed border-sky-400/50 px-1 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-sky-300",children:"draft"}),(0,a.jsx)("span",{children:"agent-proposed \xb7 approve to persist"})]})]})}),!U&&(0,a.jsx)("button",{onClick:()=>q(!0),title:"Show panel",className:"glass flex size-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:text-foreground",children:(0,a.jsx)(em.A,{className:"size-4"})})]}),tQ&&(0,a.jsxs)(i.Zk,{position:"bottom-center",className:"glass flex items-center gap-1 rounded-xl p-1.5",children:[(0,a.jsxs)("button",{onClick:eU,disabled:!tV,title:"Undo (⌘Z)",className:"flex items-center gap-1 rounded-md px-2 py-1 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-white/10 hover:text-foreground disabled:opacity-30 disabled:hover:bg-transparent",children:[(0,a.jsx)(eu.A,{className:"size-3.5"})," undo"]}),(0,a.jsxs)("button",{onClick:eq,disabled:!tX,title:"Redo (⇧⌘Z)",className:"flex items-center gap-1 rounded-md px-2 py-1 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-white/10 hover:text-foreground disabled:opacity-30 disabled:hover:bg-transparent",children:[(0,a.jsx)(ep.A,{className:"size-3.5"})," redo"]}),!m&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"mx-1 h-4 w-px bg-white/10"}),(0,a.jsxs)("button",{onClick:tG,disabled:ev,title:"Discard draft",className:"flex items-center gap-1 rounded-md px-2 py-1 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-red-500/15 hover:text-red-300 disabled:opacity-40",children:[(0,a.jsx)(u.A,{className:"size-3.5"})," discard"]}),(0,a.jsxs)("button",{onClick:tW,disabled:ev,title:"Approve and persist to the schema",className:"flex items-center gap-1 rounded-md border border-emerald-500/40 bg-emerald-500/15 px-2.5 py-1 text-[11px] font-semibold text-emerald-300 transition-colors hover:bg-emerald-500/25 disabled:opacity-40",children:[(0,a.jsx)(eh.A,{className:"size-3.5"})," approve draft"]})]})]})]}),U&&(0,a.jsx)(K,{selected:O,tables:eY,relations:e4,endpoints:e0,draftGraph:tJ,onClose:()=>{q(!1),eN("details")},commentsContent:N,commentsCount:v,activeTab:ew,onTabChange:eN,onAddComment:tc,topOffset:m?64:void 0})]})})}}}]);
|