twenty 2.62.0 → 2.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-template/yarn.lock +24 -244
- package/dist/app-worker.cjs +1 -1
- package/dist/chunks/{build-source-manifest-DQ5YF5PV.cjs → build-source-manifest-CivM9QlD.cjs} +1 -1
- package/dist/chunks/{build-source-snapshot-DIjGWX_5.cjs → build-source-snapshot-BEYMotI-.cjs} +7 -7
- package/dist/chunks/{cli-version.constant-DNNCqpbE.cjs → cli-version.constant-DbksYiUq.cjs} +1 -1
- package/dist/chunks/compile-application-translations-Bv-kC52f.cjs +58 -0
- package/dist/chunks/create-metadata-client-BlgP9Pvz.cjs +6 -0
- package/dist/chunks/{extract-manifest-from-file-B3pazFD1.cjs → extract-manifest-from-file-KLaAvTnC.cjs} +9 -1
- package/dist/chunks/extract-source-translations-DIA4VCMw.cjs +1 -0
- package/dist/chunks/{fetch-metadata-inspection-D45BvG-t.cjs → fetch-metadata-inspection-Bg9N-xN9.cjs} +1 -1
- package/dist/chunks/{fetch-signed-in-identity-CI1CRnos.cjs → fetch-signed-in-identity-4eDYfKrQ.cjs} +1 -1
- package/dist/chunks/{fetch-workspace-or-throw-8afzHT9W.cjs → fetch-workspace-or-throw-DgSxIQDi.cjs} +1 -1
- package/dist/chunks/{get-client-generation-skip-reason-C3VEtb-R.cjs → get-client-generation-skip-reason-Ci_I89j8.cjs} +1 -1
- package/dist/chunks/{global-flags.constant-Bwz4LCEy.cjs → global-flags.constant-Cy2IsDun.cjs} +1 -1
- package/dist/chunks/{is-valid-package-name-DCxejisa.cjs → is-valid-package-name-CjafE459.cjs} +1 -1
- package/dist/chunks/kebab-case-tmo--p0I.cjs +1 -0
- package/dist/chunks/pull-minimum-sdk-version.constant-lr3UTcEG.cjs +6 -0
- package/dist/chunks/{pull-source-B5Hot5CI.cjs → pull-source-Bw4NRNJu.cjs} +1 -1
- package/dist/chunks/{read-application-identifier-Ch3TuO_n.cjs → read-application-identifier-B9d-Ow2J.cjs} +1 -1
- package/dist/chunks/{read-application-identity-CYKNL1g5.cjs → read-application-identity-CxmrWgYf.cjs} +1 -1
- package/dist/chunks/{read-infer-deletion-option-Cq68tV7k.cjs → read-infer-deletion-option-DWh9S1Gq.cjs} +1 -1
- package/dist/chunks/{read-source-identity-bo4jC2Dh.cjs → read-source-identity-D_wD1tkE.cjs} +1 -1
- package/dist/chunks/{record-pull-base-DtY9aRif.cjs → record-pull-base-Cr_kwKnW.cjs} +1 -1
- package/dist/chunks/{resolve-command-target-BZJtWdPy.cjs → resolve-command-target-DN85H7eA.cjs} +1 -1
- package/dist/chunks/{run-app-add-command-De3cIhU0.cjs → run-app-add-command-BuoyG82_.cjs} +1 -1
- package/dist/chunks/{run-app-apply-command-Dh4lc8hj.cjs → run-app-apply-command-mmqc1_Oo.cjs} +1 -1
- package/dist/chunks/{run-app-build-command-DDgaL02E.cjs → run-app-build-command-CI4w2jD7.cjs} +1 -1
- package/dist/chunks/{run-app-dev-command-B4KTmf_z.cjs → run-app-dev-command-DrX-0548.cjs} +1 -1
- package/dist/chunks/{run-app-exec-command-kY1eL1r5.cjs → run-app-exec-command-BDjvtcCN.cjs} +1 -1
- package/dist/chunks/{run-app-generate-client-command-QkxVxVx_.cjs → run-app-generate-client-command-DW_6iosJ.cjs} +1 -1
- package/dist/chunks/{run-app-init-command-DSkO13d-.cjs → run-app-init-command-DezgcYp1.cjs} +1 -1
- package/dist/chunks/{run-app-install-command-Bi0zzk4A.cjs → run-app-install-command-DB1JjFhO.cjs} +1 -1
- package/dist/chunks/{run-app-operation-CDJvAttZ.cjs → run-app-operation-BwPt2bdD.cjs} +1 -1
- package/dist/chunks/{run-app-plan-command-C6eyLLLO.cjs → run-app-plan-command-B2fzK_uT.cjs} +1 -1
- package/dist/chunks/{run-app-publish-command-DQ6vzJgn.cjs → run-app-publish-command-CQsZgljP.cjs} +1 -1
- package/dist/chunks/{run-app-pull-command-BXUC3k0e.cjs → run-app-pull-command-CEEo-CfN.cjs} +1 -1
- package/dist/chunks/{run-app-typecheck-command-4K_pP5i8.cjs → run-app-typecheck-command-BWE5ii7e.cjs} +1 -1
- package/dist/chunks/{run-app-uninstall-command-OmmIgnAn.cjs → run-app-uninstall-command-BgaBDrdk.cjs} +1 -1
- package/dist/chunks/{run-auth-login-command-DZAiuNqZ.cjs → run-auth-login-command-KO2ifeY7.cjs} +1 -1
- package/dist/chunks/{run-auth-status-command-CqN2SXlq.cjs → run-auth-status-command-CvGcoPtC.cjs} +1 -1
- package/dist/chunks/{run-cli-YPcCDqcg.cjs → run-cli-CvHrVor5.cjs} +1 -1
- package/dist/chunks/{run-commands-command-DgnWg2rh.cjs → run-commands-command-DRrZNLVB.cjs} +1 -1
- package/dist/chunks/{run-data-export-command-B1rmhaKc.cjs → run-data-export-command-Cx3kI2k_.cjs} +1 -1
- package/dist/chunks/{run-data-get-command-B4nBUwrU.cjs → run-data-get-command-CABKqxAv.cjs} +1 -1
- package/dist/chunks/{run-data-list-command-D2HsR6ru.cjs → run-data-list-command-D4hPLTvj.cjs} +1 -1
- package/dist/chunks/{run-doctor-command-BkyTVduO.cjs → run-doctor-command-COB76enz.cjs} +1 -1
- package/dist/chunks/{run-metadata-field-describe-command-BjvbEGss.cjs → run-metadata-field-describe-command-8moX6Uye.cjs} +1 -1
- package/dist/chunks/{run-metadata-field-list-command-CjiAlmp4.cjs → run-metadata-field-list-command-BICpDnOb.cjs} +1 -1
- package/dist/chunks/{run-metadata-object-describe-command-BRKyHBUi.cjs → run-metadata-object-describe-command-DCb5Ek8k.cjs} +1 -1
- package/dist/chunks/{run-metadata-object-list-command-CBzwm3R1.cjs → run-metadata-object-list-command-9-X0oimh.cjs} +1 -1
- package/dist/chunks/{run-open-command-BNJTwnxV.cjs → run-open-command-CWBFD_2g.cjs} +1 -1
- package/dist/chunks/{run-version-command-C2_qC5Qa.cjs → run-version-command-wTaZJPhd.cjs} +1 -1
- package/dist/chunks/{sign-in-to-remote-again-CpUKz_mi.cjs → sign-in-to-remote-again-CzhCXTTn.cjs} +1 -1
- package/dist/chunks/standard-object-fields.constant-BxrNzIwQ.cjs +1 -0
- package/dist/cli.cjs +1 -1
- package/package.json +2 -2
- package/dist/chunks/compile-application-translations-CDykMbFf.cjs +0 -58
- package/dist/chunks/create-metadata-client-BTLenEIm.cjs +0 -6
- package/dist/chunks/extract-source-translations-b9c2CH4w.cjs +0 -1
- package/dist/chunks/kebab-case-B3kq7ANN.cjs +0 -1
- package/dist/chunks/pull-minimum-sdk-version.constant-DOAFtDDD.cjs +0 -6
- package/dist/chunks/standard-object-fields.constant-CA16BdJ2.cjs +0 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./build--4zYt4wd.cjs"),n=require("./isDefined-CJctgvfE.cjs"),r=require("./isNonEmptyArray-v52xg4Xj.cjs"),i=require("./isPlainObject-fJEJm71P.cjs"),a=require("./get-field-universal-identifier.util-d1401qKf.cjs"),o=require("./standard-object-fields.constant-BxrNzIwQ.cjs"),s=require("./is-supported-locale-DUMI9QQ2.cjs"),c=require("./isValidUniversalIdentifier-DymFerYs.cjs"),l=require("./locale-catalog-format-BD4XDEnl.cjs"),u=require("./fs-utils-BcNux7fF.cjs"),d=require("./AssetDirectory-c_JEwMr2.cjs"),f=require("./TwentyStandardApplicationUniversalIdentifier-Cm4vo0D3.cjs"),p=require("./extract-manifest-from-file-KLaAvTnC.cjs"),m=require("./get-engine-version-range-DZGIWoR6.cjs"),h=require("./constants-Cf5-CwMu.cjs");let ee=require("node:fs/promises"),g=require("node:path");g=e.r(g,1);let te=require("tinyglobby"),_=require("typescript");_=e.r(_);let v=require("path");v=e.r(v);var y=t.t(),ne=(e,t)=>{throw Error(t??`Didn't expect to get here.`)};function re(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function ie(e,t=`|`){return e.map(e=>Oe(e)).join(t)}function ae(e,t){return typeof t==`bigint`?t.toString():t}var oe=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function se(e){return new oe(e)}function ce(e){return e==null}function le(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function ue(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function de(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function fe(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function pe(e){return fe(e._zod.def)??e._zod.def.shape}function me(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return de(this,t,e),e},enumerable:!0,configurable:!0})}function he(e,t,n){t in e?de(e,t,n):e[t]=n}function ge(e,t,n,r){let i=pe(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?me(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):he(e,a,r?r(n.value,a):n.value))}}function _e(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?me(e,n,()=>t[n]):he(e,n,r.value))}}function b(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ve(e){return JSON.stringify(e)}function ye(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var be=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function xe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Se=se(()=>{if(gt.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Ce(e){if(xe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(xe(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function we(e){return Ce(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Te=new Set([`string`,`number`,`symbol`]);function Ee(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function De(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function x(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Oe(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ke(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var Ae={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},je={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function Me(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={};return ge(i,e,Ne(e,t)),De(e,b(n,{shape:i,checks:[]}))}function Ne(e,t){let n=pe(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Pe(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=new Set(Ne(e,t)),a={};return ge(a,e,Reflect.ownKeys(pe(e)).filter(e=>!i.has(e))),De(e,b(n,{shape:a,checks:[]}))}function Fe(e,t){if(!Ce(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=pe(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return De(e,b(e._zod.def,{shape:Ie(e,t)}))}function Ie(e,t){let n={};return ge(n,e,Reflect.ownKeys(pe(e))),_e(n,t),n}function Le(e,t){if(!Ce(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return De(e,b(e._zod.def,{shape:Ie(e,t)}))}function Re(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return ge(n,e,Reflect.ownKeys(pe(e))),ge(n,t,Reflect.ownKeys(pe(t))),De(e,b(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function ze(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(Ne(t,n)):void 0,o={};return ge(o,t,Reflect.ownKeys(pe(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),De(t,b(t._zod.def,{shape:o,checks:[]}))}function Be(e,t,n){let r=n?new Set(Ne(t,n)):void 0,i={};return ge(i,t,Reflect.ownKeys(pe(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),De(t,b(t._zod.def,{shape:i}))}function Ve(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function He(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Ue(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function We(e){return typeof e==`string`?e:e?.message}function Ge(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Ke(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function qe(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:We(e.inst?._zod.def?.error?.(e))??We(a?.(e))??We(t?.error?.(e))??We(n.customError?.(e))??We(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t===`inst`||t===`schema`||t===`continue`||t===`input`||t===`__proto__`||(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var Je=/[\uD800-\uDBFF]/;function Ye(e){let t=e.length;if(!Je.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Xe(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Ze(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Qe(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function $e(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):nt(e,n,r.value)}}function et(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function tt(e,t,n){return et(e,t,n,!1)}function S(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return et(this,n,r(this))},set(e){et(this,n,e)}})}return t}function nt(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:et(this,t,n.bind(this))},set(e){et(this,t,e)}})}function rt(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var it,at=!1,ot={configurable:!0,get(){at=!0}};function C(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&it!==e._zod){it=void 0;return}it=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,ot);let e=at;at=!1;try{let r=n(this);return at?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),at||=e,r}catch(n){throw delete this[t],at||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function st(e,t,n,r){let i=rt(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var ct=`~constantCatch`;function lt(e){let t=()=>e;return t[ct]=!0,t}var ut,dt={value:void 0,enumerable:!1},ft=`captureStackTrace`in Error?Error:null;function pt(e){let t=ft;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return ft=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function w(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){dt.value=new a(r);try{Object.defineProperty(n,"_zod",dt)}finally{dt.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),$e(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?pt(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var mt=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},ht=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(ut=globalThis).__zod_globalConfig??(ut.__zod_globalConfig={});var gt=globalThis.__zod_globalConfig;function _t(e){return e&&Object.assign(gt,e),gt}function vt(){let e=this._zod;return e.message??=JSON.stringify(e.def,ae,2),e.message}function yt(e){this._zod.message=e}var bt={get:vt,set:yt,enumerable:!0,configurable:!0},xt={value:void 0,enumerable:!1},St=new WeakSet([Object.prototype,Error.prototype]),Ct=(e,t)=>{e.name=`$ZodError`,xt.value=t,Object.defineProperty(e,"issues",xt),xt.value=void 0,Object.defineProperty(e,"message",bt);let n=Object.getPrototypeOf(e);St.has(n)||(St.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},wt=w(`$ZodError`,Ct);w(`$ZodError`,Ct,void 0,{Parent:Error});function Tt(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Et(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Tt(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Dt(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function Ot(e,t){return{callee:t?.callee??e,Err:t?.Err}}var kt=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new mt;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>qe(e,o,_t())));throw be(n,a?.callee??t),n}return s.value};return t},At=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>qe(e,o,_t())));throw be(n,a?.callee??t),n}return s.value};return t},jt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new mt;return a.issues.length?Mt(e,a.issues,i):{success:!0,data:a.value}};function Mt(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>qe(e,n,_t()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var Nt=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?Mt(e,a.issues,i):{success:!0,data:a.value}},Pt=Symbol.for(`zod.compile.invalid`),Ft=Symbol.for(`zod.compile.fallback`),It=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Pt)return!0;if(r.definite===!0&&n===void 0)return!1}return Lt(e,t,n)});function Lt(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Ft]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new mt;return a.issues.length===0}var Rt=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},zt=e=>{let t=kt(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Ot(n,a))};return n},Bt=e=>{let t=kt(e),n=(e,r,i,a)=>t(e,r,i,Ot(n,a));return n},Vt=e=>{let t=At(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Ot(n,a))};return n},Ht=e=>{let t=At(e),n=async(e,r,i,a)=>await t(e,r,i,Ot(n,a));return n},Ut=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return jt(e)(t,n,i)},Wt=e=>(t,n,r)=>jt(e)(t,n,r),Gt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Nt(e)(t,n,i)},Kt=e=>async(t,n,r)=>Nt(e)(t,n,r),qt=/^[cC][0-9a-z]{6,}$/,Jt=/^[0-9a-z]+$/,Yt=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Xt=/^[0-9a-vA-V]{20}$/,Zt=/^[A-Za-z0-9]{27}$/,Qt=/^[a-zA-Z0-9_-]{21}$/;function $t(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var en=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tn=/^([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})$/,nn=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)$/,rn=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,an=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function on(){return new RegExp(an,`u`)}var sn=/^(?:(?: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])$/,cn=/^(([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}|:))$/,ln=/^((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])$/,un=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,dn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,fn=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,pn=/^https?$/,mn=/^\+[1-9]\d{6,14}$/,hn=`(?:(?:\\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])))`;function gn(e){return RegExp(`^${e}$`)}var _n=gn(hn);function vn(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function yn(e){return RegExp(`^${vn(e)}$`)}function bn(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${vn({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${vn({precision:e.precision})}`:n;return RegExp(`^${hn}T(?:${r})$`)}var xn=/^[\s\S]{0,}$/,Sn=/^-?\d+(?:\.\d+)?$/,Cn=/^[^A-Z]*$/,wn=/^[^a-z]*$/,Tn=w(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),En=e=>{let t=e.value;return!ce(t)&&t.length!==void 0},Dn={number:`number`,bigint:`bigint`,object:`date`},On=w(`$ZodCheckLessThan`,(e,t)=>{Tn.init(e,t);let n=Dn[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Dn[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),kn=w(`$ZodCheckGreaterThan`,(e,t)=>{Tn.init(e,t);let n=Dn[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Dn[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),An=w(`$ZodCheckMultipleOf`,(e,t)=>{Tn.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):ue(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),jn=w(`$ZodCheckNumberFormat`,(e,t)=>{Tn.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Ae[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Mn=w(`$ZodCheckMaxLength`,(e,t)=>{var n;Tn.init(e,t),(n=e._zod.def).when??(n.when=En),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Ye(r):i)<=t.maximum)return;let a=Xe(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Nn=w(`$ZodCheckMinLength`,(e,t)=>{var n;Tn.init(e,t),(n=e._zod.def).when??(n.when=En),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Ye(r):i)>=t.minimum)return;let a=Xe(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Pn=w(`$ZodCheckLengthEquals`,(e,t)=>{var n;Tn.init(e,t),(n=e._zod.def).when??(n.when=En),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Ye(r):i;if(a===t.length)return;let o=Xe(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Fn=w(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Tn.init(e,t),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=()=>{})}),In=w(`$ZodCheckRegex`,(e,t)=>{Fn.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})}}),Ln=w(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Cn,Fn.init(e,t)}),Rn=w(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=wn,Fn.init(e,t)}),zn=w(`$ZodCheckIncludes`,(e,t)=>{Tn.init(e,t);let n=Ee(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),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})}}),Bn=w(`$ZodCheckStartsWith`,(e,t)=>{Tn.init(e,t);let n=RegExp(`^${Ee(t.prefix)}.*`);t.pattern??=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})}}),Vn=w(`$ZodCheckEndsWith`,(e,t)=>{Tn.init(e,t);let n=RegExp(`.*${Ee(t.suffix)}$`);t.pattern??=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})}}),Hn=w(`$ZodCheckOverwrite`,(e,t)=>{Tn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Un=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
2
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
3
|
+
`)}\n};`)(...Object.values(this.closed))}},Wn={major:4,minor:6,patch:7},T=w(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Wn;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=Ve(t),a;for(let o of n){if(o._zod.def.when){if(He(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new mt;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Ke(t.issues,n,e),i||=Ve(t,n))});else{if(t.issues.length===n)continue;Ke(t.issues,n,e),i||=Ve(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Ve(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new mt;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new mt;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return tt(this,`~standard`,qn(this))},set"~standard"(e){et(this,`~standard`,e)}}),Gn=(e,t)=>e.issues.length?{issues:e.issues.map(e=>qe(e,t,_t()))}:{value:e.value};async function Kn(e,t){let n={async:!0};return Gn(await e._zod.run({value:t,issues:[]},n),n)}function qn(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Gn(r,n)}catch{}return Kn(e,t)},vendor:`zod`,version:1}}var Jn=w(`$ZodString`,(e,t)=>{T.init(e,t),e._zod.pattern=t.pattern??xn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),E=w(`$ZodStringFormat`,(e,t)=>{Fn.init(e,t),Jn.init(e,t)}),Yn=w(`$ZodGUID`,(e,t)=>{t.pattern??=tn,E.init(e,t)}),Xn=w(`$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(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=nn(e)}else t.pattern??=nn();E.init(e,t)}),Zn=w(`$ZodEmail`,(e,t)=>{t.pattern??=rn,E.init(e,t)});function Qn(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function $n(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?Qn(e)||2:er(e,t)}function er(e,t){if(!t.normalize&&t.protocol?.source===pn.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var tr=/[\t\n\r]/g;function nr(e){return e.replace(tr,``)}function rr(e,t){return t.lastIndex=0,t.test(e.hostname)}function ir(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var ar=w(`$ZodURL`,(e,t)=>{E.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=$n(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=nr(r);return}t.hostname&&!rr(i,t.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&&!ir(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:nr(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),or=w(`$ZodEmoji`,(e,t)=>{t.pattern??=on(),E.init(e,t)}),sr=w(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Qt:$t(t.length),E.init(e,t)}),cr=w(`$ZodCUID`,(e,t)=>{t.pattern??=qt,E.init(e,t)}),lr=w(`$ZodCUID2`,(e,t)=>{t.pattern??=Jt,E.init(e,t)}),ur=w(`$ZodULID`,(e,t)=>{t.pattern??=Yt,E.init(e,t)}),dr=w(`$ZodXID`,(e,t)=>{t.pattern??=Xt,E.init(e,t)}),fr=w(`$ZodKSUID`,(e,t)=>{t.pattern??=Zt,E.init(e,t)}),pr=w(`$ZodISODateTime`,(e,t)=>{t.pattern??=bn(t),E.init(e,t)}),mr=w(`$ZodISODate`,(e,t)=>{t.pattern??=_n,E.init(e,t)}),hr=w(`$ZodISOTime`,(e,t)=>{t.pattern??=yn(t),E.init(e,t)}),gr=w(`$ZodISODuration`,(e,t)=>{t.pattern??=en,E.init(e,t)}),_r=w(`$ZodIPv4`,(e,t)=>{t.pattern??=sn,E.init(e,t)}),vr=/^[0-9a-fA-F:.]+$/;function yr(e){return vr.test(e)?Qn(`http://[${e}]`):!1}var br=w(`$ZodIPv6`,(e,t)=>{t.pattern??=cn,E.init(e,t),e._zod.check=n=>{yr(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),xr=w(`$ZodCIDRv4`,(e,t)=>{t.pattern??=ln,E.init(e,t)});function Sr(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:yr(n)}var Cr=w(`$ZodCIDRv6`,(e,t)=>{t.pattern??=un,E.init(e,t),e._zod.check=n=>{Sr(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function wr(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Tr=/^[0-9a-zA-Z+/]*={0,2}$/,Er=w(`$ZodBase64`,(e,t)=>{t.pattern??=Tr,E.init(e,t),e._zod.check=n=>{wr(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Dr=/^[A-Za-z0-9_-]*$/;function Or(e){if(!Dr.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return wr(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var kr=w(`$ZodBase64URL`,(e,t)=>{t.pattern??=Dr,E.init(e,t),e._zod.check=n=>{Or(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Ar=w(`$ZodE164`,(e,t)=>{t.pattern??=mn,E.init(e,t)});function jr(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Mr=w(`$ZodJWT`,(e,t)=>{E.init(e,t),e._zod.check=n=>{jr(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Nr=w(`$ZodNumber`,(e,t)=>{T.init(e,t),e._zod.pattern=Sn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Pr=w(`$ZodNumberFormat`,(e,t)=>{jn.init(e,t),Nr.init(e,t)}),Fr=w(`$ZodUnknown`,(e,t)=>{T.init(e,t),e._zod.parse=e=>e}),Ir=w(`$ZodNever`,(e,t)=>{T.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Lr(e,t){let n=Ge(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of Ge(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,Ke(n.issues,t,e),n}}return i(n,a)}}var Rr=e=>Array.isArray(e)?e.length:-1;function zr(e,t,n){e.issues.length&&t.issues.push(...Ue(n,e.issues)),t.value[n]=e.value}var Br=w(`$ZodArray`,(e,t)=>{T.init(e,t);let n=gt.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>zr(t,r,e)));else if(zr(c,r,e),s&&c.issues.length!==0&&Ve(c))break}return o.length?Promise.all(o).then(()=>r):r},Lr(e,Rr)});function Vr(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(!(!o&&s&&i===`optional`)){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Ue(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var Hr=[];function Ur(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Hr,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=ke(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function Wr(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(Ve(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Vr(e,n,i,t,d,f))):Vr(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var Gr=w(`$ZodObject`,(e,t)=>{T.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=se(()=>Ur(t));C(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||de(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=xe,o=t.catchall,s,c=gt.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(Ve(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>Vr(n,t,e,r,a,o))):Vr(s,t,e,r,a,o)}return o?Wr(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),Kr=w(`$ZodObjectJIT`,(e,t)=>{Gr.init(e,t);let n=e._zod.parse,r=se(()=>Ur(t)),i=gt.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Un([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
4
|
+
let ${e}_ab = false;
|
|
5
|
+
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
6
|
+
const iss = ${e}.issues[i];
|
|
7
|
+
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
8
|
+
payload.issues.push(iss);
|
|
9
|
+
if (iss.continue !== true) ${e}_ab = true;
|
|
10
|
+
}
|
|
11
|
+
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
12
|
+
payload.value = newResult;
|
|
13
|
+
return payload;
|
|
14
|
+
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:ve(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
15
|
+
const ${n}_present = ${i};
|
|
16
|
+
if (!${n}.issues.length || ${n}_present) {
|
|
17
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (${e}) {
|
|
21
|
+
newResult[${r}] = ${n}.value;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
`)}else f?(o.write(`
|
|
26
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
27
|
+
}
|
|
28
|
+
`),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
|
|
29
|
+
if (${n}.value !== undefined || ${i}) {
|
|
30
|
+
newResult[${r}] = ${n}.value;
|
|
31
|
+
}
|
|
32
|
+
`)):o.write(`
|
|
33
|
+
const ${n}_present = ${i};
|
|
34
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
35
|
+
}
|
|
36
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
37
|
+
payload.issues.push({
|
|
38
|
+
code: "invalid_type",
|
|
39
|
+
expected: "nonoptional",
|
|
40
|
+
input: undefined,
|
|
41
|
+
path: [${r}]
|
|
42
|
+
});
|
|
43
|
+
if (ctx && ctx.abortEarly) {
|
|
44
|
+
payload.value = newResult;
|
|
45
|
+
return payload;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (${n}_present) {
|
|
50
|
+
newResult[${r}] = ${n}.value;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=xe,c=!gt.jitless,l=c&&Se.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?Wr([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function qr(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Ve(e));return i.length===1?(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=>qe(e,r,_t())))}),t)}var Jr=w(`$ZodUnion`,(e,t)=>{T.init(e,t),C(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),C(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),C(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),C(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>le(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>qr(t,r,e,i)):qr(o,r,e,i)}}),Yr=w(`$ZodIntersection`,(e,t)=>{T.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Zr(e,t,n)):Zr(e,i,a)}});function Xr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ce(e)&&Ce(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Xr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Xr(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Zr(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Xr(t.value,n.value);if(!c.valid){if(Ve(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Qr=w(`$ZodEnum`,(e,t)=>{T.init(e,t);let n=re(t.entries),r=new Set(n);e._zod.values=r,C(e,`pattern`,e=>{let t=re(e.def.entries).filter(e=>Te.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Ee(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),$r=w(`$ZodLiteral`,(e,t)=>{T.init(e,t);let n=new Set(t.values);e._zod.values=n,C(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?Ee(e):e?Ee(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),ei=w(`$ZodTransform`,(e,t)=>{T.init(e,t),e._zod.optin=`optional`,gt.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ht(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));if(i instanceof Promise)throw new mt;return n.value=i,n}});function ti(e,t){return e.value=t.issues.length?void 0:t.value,e}var ni=w(`$ZodOptional`,(e,t)=>{T.init(e,t),C(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,C(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),C(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${le(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>ti(e,t)):ti(e,r)}return t.innerType._zod.run(e,n)}}),ri=w(`$ZodExactOptional`,(e,t)=>{ni.init(e,t),C(e,`values`,e=>e.def.innerType._zod.values),C(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ii=w(`$ZodNullable`,(e,t)=>{T.init(e,t),C(e,`optin`,e=>e.def.innerType._zod.optin),C(e,`optout`,e=>e.def.innerType._zod.optout),C(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${le(t.source)}|null)$`):void 0}),C(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),ai=w(`$ZodDefault`,(e,t)=>{T.init(e,t),e._zod.optin=`defaulted`,C(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>oi(e,t)):oi(r,t)}});function oi(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var si=w(`$ZodPrefault`,(e,t)=>{T.init(e,t),e._zod.optin=`defaulted`,C(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),ci=w(`$ZodNonOptional`,(e,t)=>{T.init(e,t),C(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>li(t,e)):li(i,e)}});function li(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function ui(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>qe(e,r,_t()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var di=w(`$ZodCatch`,(e,t)=>{T.init(e,t),C(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),C(e,`optout`,e=>e.def.innerType._zod.optout),C(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>ui(e,r,t,n)):ui(e,r,t,n)}}),fi=w(`$ZodPipe`,(e,t)=>{T.init(e,t),C(e,`values`,e=>e.def.in._zod.values),C(e,`optin`,e=>e.def.in._zod.optin),C(e,`optout`,e=>e.def.out._zod.optout),C(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>pi(e,t.in,n)):pi(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>pi(e,t.out,n)):pi(r,t.out,n)}});function pi(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var mi=w(`$ZodReadonly`,(e,t)=>{T.init(e,t),C(e,`propValues`,e=>e.def.innerType._zod.propValues),C(e,`values`,e=>e.def.innerType._zod.values),C(e,`optin`,e=>e.def.innerType?._zod?.optin),C(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(hi):hi(r)}});function hi(e){return e.memo||(e.value=Object.freeze(e.value)),e}var gi=w(`$ZodCustom`,(e,t)=>{Tn.init(e,t),T.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=>_i(t,n,r,e));_i(i,n,r,e)}});function _i(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(Qe(e))}}var vi=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},yi=`~memo`,bi=[];function xi(e){return typeof e==`object`&&!!e}function Si(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Ci=new WeakMap,wi=0,Ti=1,Ei=2;function Di(e,t,n){let r=Ci.get(e);if(r!==void 0)return r?Ei:wi;if(t.has(e))return Ei;t.add(e);let i=wi,a=e=>{if(i!==Ei&&e?._zod){let r=Di(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=wi;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?Ti:o.value?._zod?Di(o.value,t,n):wi;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=fe(c);s(e?o(e,!0):Ti),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Di(r,t,!1):Ti);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(!(!n||typeof n!=`object`)){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Oi(e,i)}function Oi(e,t){return t!==Ti&&Ci.set(e,t===Ei),t}function ki(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Ai,ji=[],Mi={alloc(e,t,n){let r=Ai;if(!r)return n;Ai=void 0;let i={value:n,issues:null};return r.set(t.value,i),ji.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Pi(n,e.value))throw new vi;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Di(e,new Set,!1);if(i===wi)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Ei||r?n=!0:r=!0}let l=s.value;if(!xi(l))return t(s,c);let u=c[yi];u||(u={buckets:new WeakMap,backEdges:void 0},c[yi]=u);let d;i===c?d=a:(d=ki(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Si(f.issues)):(s.memo=!0,u.backEdges??=new WeakSet,u.backEdges.add(f.value)),s;Ai=d;let p=ji.length,m=t(s,c);Ai=void 0;let h=ji.length>p?ji.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Si(e.issues):bi),e)):(h&&(h.issues=m.issues.length?Si(m.issues):bi),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Ni(){return Mi}function Pi(e,t){let n=e[yi]?.backEdges;return n!==void 0&&xi(t)&&n.has(t)}var Fi=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Ze(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Oe(e.values[0])}`:`Invalid option: expected one of ${ie(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${ie(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Ii(){return{localeError:Fi()}}var Li,Ri=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`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&&typeof t==`object`&&`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)}};function zi(){return new Ri}(Li=globalThis).__zod_globalRegistry??(Li.__zod_globalRegistry=zi());var Bi=globalThis.__zod_globalRegistry;function Vi(e){return e.checks&&=[...e.checks],e}function Hi(e,t){return new e(Vi({type:`string`,...x(t)}))}function Ui(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...x(t)})}function Wi(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...x(t)})}function Gi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...x(t)})}function Ki(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...x(t)})}function qi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...x(t)})}function Ji(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...x(t)})}function Yi(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...x(t)})}function Xi(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...x(t)})}function Zi(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...x(t)})}function Qi(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...x(t)})}function $i(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...x(t)})}function ea(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...x(t)})}function ta(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...x(t)})}function na(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...x(t)})}function ra(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...x(t)})}function ia(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...x(t)})}function aa(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...x(t)})}function oa(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...x(t)})}function sa(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...x(t)})}function ca(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...x(t)})}function la(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...x(t)})}function ua(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...x(t)})}function da(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...x(t)})}function fa(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...x(t)})}function pa(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...x(t)})}function ma(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...x(t)})}function ha(e,t){return new e(Vi({type:`number`,coerce:!0,checks:[],...x(t)}))}function ga(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...x(t)})}function _a(e){return new e({type:`unknown`})}function va(e,t){return new e({type:`never`,...x(t)})}function ya(e,t){return new On({check:`less_than`,...x(t),value:e,inclusive:!1})}function ba(e,t){return new On({check:`less_than`,...x(t),value:e,inclusive:!0})}function xa(e,t){return new kn({check:`greater_than`,...x(t),value:e,inclusive:!1})}function Sa(e,t){return new kn({check:`greater_than`,...x(t),value:e,inclusive:!0})}function Ca(e,t){return new An({check:`multiple_of`,...x(t),value:e})}function wa(e,t){return new Mn({check:`max_length`,...x(t),maximum:e})}function Ta(e,t){return new Nn({check:`min_length`,...x(t),minimum:e})}function Ea(e,t){return new Pn({check:`length_equals`,...x(t),length:e})}function Da(e,t){return new In({check:`string_format`,format:`regex`,...x(t),pattern:e})}function Oa(e){return new Ln({check:`string_format`,format:`lowercase`,...x(e)})}function ka(e){return new Rn({check:`string_format`,format:`uppercase`,...x(e)})}function Aa(e,t){return new zn({check:`string_format`,format:`includes`,...x(t),includes:e})}function ja(e,t){return new Bn({check:`string_format`,format:`starts_with`,...x(t),prefix:e})}function Ma(e,t){return new Vn({check:`string_format`,format:`ends_with`,...x(t),suffix:e})}function Na(e){return new Hn({check:`overwrite`,tx:e})}function Pa(e){return Na(t=>t.normalize(e))}function Fa(){return Na(e=>e.trim())}function Ia(){return Na(e=>e.toLowerCase())}function La(){return Na(e=>e.toUpperCase())}function Ra(){return Na(e=>ye(e))}function za(e,t,n){return new e({type:`array`,element:t,...x(n)})}function Ba(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...x(n)})}function Va(e,t){let n=Ha(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Qe(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Qe(r))}},e(t.value,t)),t);return n}function Ha(e,t){let n=new Tn({check:`custom`,...x(t)});return n._zod.check=e,n}function Ua(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&de(e,t,n[t]);return e}function Wa(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Bi,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function Ga(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function D(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,D(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Ua(o.schema,c),t.io===`input`&&O(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Ka(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function qa(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;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=>{let r=e.target===`draft-2020-12`?`$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 a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${Ka(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Ka(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
54
|
+
|
|
55
|
+
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]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ja(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Ja(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Ya=new Set([`type`,`properties`,`required`,`additionalProperties`]),Xa=[`oneOf`,`anyOf`];function Za(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Qa(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Ya.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Za(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}de(n,r,e.length===1?e[0]:Qa(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Za(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function $a(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Ya)if(t in e)return;let n=t.filter(e=>Xa.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Qa(t);else{let e=n[0],i=Xa.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Qa([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Ua(e,r))}function eo(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(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Ua(i,s),Ua(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||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??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Ja(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])$a(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?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)}Ua(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,de(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:no(t,`input`,e.processors),output:no(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function O(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return O(r.element,n);if(r.type===`set`)return O(r.valueType,n);if(r.type===`lazy`)return O(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return O(r.innerType,n);if(r.type===`intersection`)return O(r.left,n)||O(r.right,n);if(r.type===`record`||r.type===`map`)return O(r.keyType,n)||O(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:O(r.in,n)||O(r.out,n);if(r.type===`object`){for(let e in r.shape)if(O(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(O(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(O(e,n))return!0;return!!(r.rest&&O(r.rest,n))}return!1}var to=(e,t={})=>n=>{let r=Wa({...n,processors:t});return D(e,r),qa(r,e),eo(r,e)},no=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Wa({...i??{},target:a,io:t,processors:n});return D(e,o),qa(o,e),eo(o,e)},ro=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},io=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},ao=(e,t)=>{ro(e,`minimum`,t),io(e,`maximum`,t)},oo=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},so=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},co=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},lo=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},uo=(e,t)=>ro(e,`minimum`,t.minimum),fo=(e,t)=>io(e,`maximum`,t.maximum),po=e=>(t,n)=>{lo(t,n.format);let[r,i]=e[n.format];ro(t,`minimum`,r),io(t,`maximum`,i)},mo={greater_than:(e,t)=>ro(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>io(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>oo(e,t.value),number_format:po(Ae),bigint_format:po(je),min_length:uo,max_length:fo,length_equals:(e,t)=>ao(e,t.length),min_size:uo,max_size:fo,size_equals:(e,t)=>ao(e,t.size),string_format:(e,t)=>{lo(e,t.format),t.pattern&&so(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>co(e,t.mime)};function ho(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)mo[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&ro(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&ro(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&io(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&io(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&oo(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&co(t,i.mime);for(let e of i.patterns??[])so(t,e);return t}var go={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},_o=new Map([[Tr,dn],[Dr,fn]]),vo=e=>_o.get(e)??e,yo=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=ho(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=go[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(vo);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},bo=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=ho(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):Ga(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},xo=(e,t,n,r)=>{n.not={}},So=(e,t,n,r)=>{let i=e._zod.def,a=re(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Co=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(Ga(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Ga(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},wo=(e,t,n,r)=>{Ga(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},To=(e,t,n,r)=>{Ga(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Eo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=ho(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=D(a.element,t,{...r,path:[...r.path,`items`]})};function Do(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Do(t.out):t.type===`catch`?Do(t.innerType):e._zod.optin}var Oo=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Ga(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)de(i.properties,e,D(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Do(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=D(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},ko=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>D(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Ao=(e,t,n,r)=>{let i=e._zod.def,a=D(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=D(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},jo=(e,t,n,r)=>{let i=e._zod.def,a=D(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Mo=(e,t,n,r)=>{let i=e._zod.def;D(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},No=Symbol();function Po(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Ga(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),No):JSON.parse(o)}var Fo=(e,t,n,r)=>{let i=e._zod.def;D(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Po(i.defaultValue,e,t,n,r);o!==No&&(n.default=o)},Io=(e,t,n,r)=>{let i=e._zod.def;D(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Po(i.defaultValue,e,t,n,r);o!==No&&(n._prefault=o)},Lo=(e,t,n,r)=>{let i=e._zod.def;D(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Ga(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Ro=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;D(o,t,r);let s=t.seen.get(e);s.ref=o},zo=(e,t,n,r)=>{let i=e._zod.def;D(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Bo=(e,t,n,r)=>{let i=e._zod.def;D(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Vo=new WeakSet([Object.prototype,Error.prototype]);function Ho(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var Uo=w(`ZodError`,(e,t)=>{wt.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Vo.has(n)||(Vo.add(n),Ho(n,`format`,e=>t=>Dt(e,t)),Ho(n,`flatten`,e=>t=>Et(e,t)),Ho(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ae,2)}),Ho(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ae,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Wo=kt(Uo),Go=At(Uo),Ko=jt(Uo),qo=Nt(Uo),Jo=zt(Uo),Yo=Bt(Uo),Xo=Vt(Uo),Zo=Ht(Uo),Qo=Ut(Uo),$o=Wt(Uo),es=Gt(Uo),ts=Kt(Uo);function ns(){gt.localeError||_t(Ii())}function rs(){gt.memoizer||_t({memoizer:Ni()})}var k=w(`ZodType`,(e,t)=>(ns(),T.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(b(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return De(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(gc(e,t))},superRefine(e,t){return this.check(_c(e,t))},overwrite(e){return this.check(Na(e))},optional(){return Qs(this)},exactOptional(){return ec(this)},nullable(){return nc(this)},nullish(){return Qs(nc(this))},nonoptional(e){return cc(this,e)},array(){return Rs(this)},or(e){return Hs([this,e])},and(e){return Ws(this,e)},transform(e){return fc(this,Xs(e))},default(e){return ic(this,e)},prefault(e){return oc(this,e)},catch(e){return uc(this,e)},pipe(e){return fc(this,e)},readonly(){return mc(this)},describe(e){let t=this.clone();return Bi.add(t,{description:e}),t},meta(...e){if(e.length===0)return Bi.get(this);let t=this.clone();return Bi.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return tt(this,`~standard`,{...qn(this),jsonSchema:{input:no(this,`input`),output:no(this,`output`)}})},set"~standard"(e){et(this,`~standard`,e)},parse:function e(t,n){return Wo(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Go(this,t,n,{callee:e})},safeParse(e,t){return Ko(this,e,t)},async safeParseAsync(e,t){return qo(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){et(this,`spa`,e)},validate(e,t){return It(this,e,t)},validateAsync(e,t){return Rt(this,e,t)},encode:function e(t,n){return Jo(this,t,n,{callee:e})},decode:function e(t,n){return Yo(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Xo(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Zo(this,t,n,{callee:e})},safeEncode(e,t){return Qo(this,e,t)},safeDecode(e,t){return $o(this,e,t)},async safeEncodeAsync(e,t){return es(this,e,t)},async safeDecodeAsync(e,t){return ts(this,e,t)},toJSONSchema(e){return to(this,{})(e)},get description(){return Bi.get(this)?.description},get _def(){return this._zod.def}}),is=w(`_ZodString`,(e,t)=>{Jn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yo(e,t,n,r)},S({format:e=>ho(e).format??null,minLength:e=>ho(e).minimum??null,maxLength:e=>ho(e).maximum??null},{regex(...e){return this.check(Da(...e))},includes(...e){return this.check(Aa(...e))},startsWith(...e){return this.check(ja(...e))},endsWith(...e){return this.check(Ma(...e))},min(...e){return this.check(Ta(...e))},max(...e){return this.check(wa(...e))},length(...e){return this.check(Ea(...e))},nonempty(...e){return this.check(Ta(1,...e))},lowercase(e){return this.check(Oa(e))},uppercase(e){return this.check(ka(e))},trim(){return this.check(Fa())},normalize(...e){return this.check(Pa(...e))},toLowerCase(){return this.check(Ia())},toUpperCase(){return this.check(La())},slugify(){return this.check(Ra())}})),as=w(`ZodString`,(e,t)=>{Jn.init(e,t),is.init(e,t)},{email(e){return this.check(Ui(ds,e))},url(e){return this.check(Yi(ms,e))},jwt(e){return this.check(ua(ks,e))},emoji(e){return this.check(Xi(hs,e))},guid(e){return this.check(Wi(fs,e))},uuid(e){return this.check(Gi(ps,e))},uuidv4(e){return this.check(Ki(ps,e))},uuidv6(e){return this.check(qi(ps,e))},uuidv7(e){return this.check(Ji(ps,e))},nanoid(e){return this.check(Zi(gs,e))},cuid(e){return this.check(Qi(_s,e))},cuid2(e){return this.check($i(vs,e))},ulid(e){return this.check(ea(ys,e))},base64(e){return this.check(sa(Es,e))},base64url(e){return this.check(ca(Ds,e))},xid(e){return this.check(ta(bs,e))},ksuid(e){return this.check(na(xs,e))},ipv4(e){return this.check(ra(Ss,e))},ipv6(e){return this.check(ia(Cs,e))},cidrv4(e){return this.check(aa(ws,e))},cidrv6(e){return this.check(oa(Ts,e))},e164(e){return this.check(la(Os,e))},datetime(e){return this.check(da(ss,e))},date(e){return this.check(fa(cs,e))},time(e){return this.check(pa(ls,e))},duration(e){return this.check(ma(us,e))}});function os(e){return Hi(as,e)}var A=w(`ZodStringFormat`,(e,t)=>{E.init(e,t),is.init(e,t)}),ss=w(`ZodISODateTime`,(e,t)=>{pr.init(e,t),A.init(e,t)}),cs=w(`ZodISODate`,(e,t)=>{mr.init(e,t),A.init(e,t)}),ls=w(`ZodISOTime`,(e,t)=>{hr.init(e,t),A.init(e,t)}),us=w(`ZodISODuration`,(e,t)=>{gr.init(e,t),A.init(e,t)}),ds=w(`ZodEmail`,(e,t)=>{Zn.init(e,t),A.init(e,t)}),fs=w(`ZodGUID`,(e,t)=>{Yn.init(e,t),A.init(e,t)}),ps=w(`ZodUUID`,(e,t)=>{Xn.init(e,t),A.init(e,t)}),ms=w(`ZodURL`,(e,t)=>{ar.init(e,t),A.init(e,t)}),hs=w(`ZodEmoji`,(e,t)=>{or.init(e,t),A.init(e,t)}),gs=w(`ZodNanoID`,(e,t)=>{sr.init(e,t),A.init(e,t)}),_s=w(`ZodCUID`,(e,t)=>{cr.init(e,t),A.init(e,t)}),vs=w(`ZodCUID2`,(e,t)=>{lr.init(e,t),A.init(e,t)}),ys=w(`ZodULID`,(e,t)=>{ur.init(e,t),A.init(e,t)}),bs=w(`ZodXID`,(e,t)=>{dr.init(e,t),A.init(e,t)}),xs=w(`ZodKSUID`,(e,t)=>{fr.init(e,t),A.init(e,t)}),Ss=w(`ZodIPv4`,(e,t)=>{_r.init(e,t),A.init(e,t)}),Cs=w(`ZodIPv6`,(e,t)=>{br.init(e,t),A.init(e,t)}),ws=w(`ZodCIDRv4`,(e,t)=>{xr.init(e,t),A.init(e,t)}),Ts=w(`ZodCIDRv6`,(e,t)=>{Cr.init(e,t),A.init(e,t)}),Es=w(`ZodBase64`,(e,t)=>{Er.init(e,t),A.init(e,t)}),Ds=w(`ZodBase64URL`,(e,t)=>{kr.init(e,t),A.init(e,t)}),Os=w(`ZodE164`,(e,t)=>{Ar.init(e,t),A.init(e,t)}),ks=w(`ZodJWT`,(e,t)=>{Mr.init(e,t),A.init(e,t)}),As=w(`ZodNumber`,(e,t)=>{Nr.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bo(e,t,n,r),e.isFinite=!0},S({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=ho(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=ho(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=ho(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>ho(e).format??null},{gt(e,t){return this.check(xa(e,t))},gte(e,t){return this.check(Sa(e,t))},min(e,t){return this.check(Sa(e,t))},lt(e,t){return this.check(ya(e,t))},lte(e,t){return this.check(ba(e,t))},max(e,t){return this.check(ba(e,t))},int(e){return this.check(Ms(e))},safe(e){return this.check(Ms(e))},positive(e){return this.check(xa(0,e))},nonnegative(e){return this.check(Sa(0,e))},negative(e){return this.check(ya(0,e))},nonpositive(e){return this.check(ba(0,e))},multipleOf(e,t){return this.check(Ca(e,t))},step(e,t){return this.check(Ca(e,t))},finite(){return this}})),js=w(`ZodNumberFormat`,(e,t)=>{Pr.init(e,t),As.init(e,t)});function Ms(e){return ga(js,e)}var Ns=w(`ZodUnknown`,(e,t)=>{Fr.init(e,t),k.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ps(){return _a(Ns)}var Fs=w(`ZodNever`,(e,t)=>{Ir.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xo(e,t,n,r)});function Is(e){return va(Fs,e)}var Ls=w(`ZodArray`,(e,t)=>{rs(),Br.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Eo(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Ta(e,t))},nonempty(e){return this.check(Ta(1,e))},max(e,t){return this.check(wa(e,t))},length(e,t){return this.check(Ea(e,t))},unwrap(){return this.element}});function Rs(e,t){return za(Ls,e,t)}var zs=w(`ZodObject`,(e,t)=>{rs(),Kr.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oo(e,t,n,r),st(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Ks(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(b(this._zod.def,{catchall:e}))},passthrough(){return this.clone(b(this._zod.def,{catchall:Ps()}))},loose(){return this.clone(b(this._zod.def,{catchall:Ps()}))},strict(){return this.clone(b(this._zod.def,{catchall:Is()}))},strip(){return this.clone(b(this._zod.def,{catchall:void 0}))},extend(e){return Fe(this,e)},safeExtend(e){return Le(this,e)},merge(e){return Re(this,e)},pick(e){return Me(this,e)},omit(e){return Pe(this,e)},partial(...e){return ze(Zs,this,e[0])},exactPartial(...e){return ze($s,this,e[0],`exactPartial`)},required(...e){return Be(sc,this,e[0])}});function Bs(e,t){return new zs({type:`object`,shape:e??{},...x(t)})}var Vs=w(`ZodUnion`,(e,t)=>{Jr.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ko(e,t,n,r),e.options=t.options});function Hs(e,t){return new Vs({type:`union`,options:e,...x(t)})}var Us=w(`ZodIntersection`,(e,t)=>{Yr.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ao(e,t,n,r)});function Ws(e,t){return new Us({type:`intersection`,left:e,right:t})}var Gs=w(`ZodEnum`,(e,t)=>{Qr.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>So(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];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 Gs({...t,checks:[],...x(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 Gs({...t,checks:[],...x(r),entries:i})}});function Ks(e,t){return new Gs({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...x(t)})}var qs=w(`ZodLiteral`,(e,t)=>{$r.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Co(e,t,n,r),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 Js(e,t){return new qs({type:`literal`,values:Array.isArray(e)?e:[e],...x(t)})}var Ys=w(`ZodTransform`,(e,t)=>{rs(),ei.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>To(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ht(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Qe(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Qe(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Xs(e){return new Ys({type:`transform`,transform:e})}var Zs=w(`ZodOptional`,(e,t)=>{ni.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Qs(e){return new Zs({type:`optional`,innerType:e})}var $s=w(`ZodExactOptional`,(e,t)=>{ri.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ec(e){return new $s({type:`optional`,innerType:e})}var tc=w(`ZodNullable`,(e,t)=>{ii.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function nc(e){return new tc({type:`nullable`,innerType:e})}var rc=w(`ZodDefault`,(e,t)=>{ai.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ic(e,t){return new rc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():we(t)}})}var ac=w(`ZodPrefault`,(e,t)=>{si.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Io(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function oc(e,t){return new ac({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():we(t)}})}var sc=w(`ZodNonOptional`,(e,t)=>{ci.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function cc(e,t){return new sc({type:`nonoptional`,innerType:e,...x(t)})}var lc=w(`ZodCatch`,(e,t)=>{di.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function uc(e,t){return new lc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:lt(t)})}var dc=w(`ZodPipe`,(e,t)=>{fi.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ro(e,t,n,r),e.in=t.in,e.out=t.out});function fc(e,t){return new dc({type:`pipe`,in:e,out:t})}var pc=w(`ZodReadonly`,(e,t)=>{mi.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function mc(e){return new pc({type:`readonly`,innerType:e})}var hc=w(`ZodCustom`,(e,t)=>{gi.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wo(e,t,n,r)});function gc(e,t={}){return Ba(hc,e,t)}function _c(e,t){return Va(e,t)}function vc(e){return ha(As,e)}var yc=Ks([`SECOND`,`MINUTE`,`HOUR`,`DAY`,`WEEK`,`MONTH`,`QUARTER`,`YEAR`]),bc=class extends Error{constructor(e,t){super(e),this.code=t}},xc=e=>e,Sc=({value:e,kind:t,allowedValues:n})=>{let r=n.map(e=>`'${e}'`);return xc(`${JSON.stringify(e)??String(e)} is not a date ${t}: use ${r.slice(0,-1).join(`, `)} or ${r[r.length-1]}`)},Cc=yc.options.filter(e=>e!==`SECOND`),wc=e=>Cc.some(t=>t===e),Tc=e=>{if(!wc(e))throw new bc(Sc({value:e,kind:`unit`,allowedValues:Cc}),`INVALID_DATE_UNIT`)},Ec=e=>e.isDateOnly?e.date.toString():e.dateTime.toInstant().toString({fractionalSecondDigits:3}),Dc=e=>e.isDateOnly?e.date.toZonedDateTime(`UTC`):e.dateTime,Oc=e=>{let{year:t}=Dc(e);return t>=1&&t<=9999},kc=e=>/^\d{4}-\d{2}-\d{2}$/.test(e);function Ac(e,t,n,r,i){return jc(t,((e,t)=>{let n=e[t];if(n===void 0)throw TypeError(oh(t));return n})(e,t),n,r,i)}function jc(e,t,n,r,i,a){let o=Yc(t,n,r);if(i&&t!==o)throw RangeError(ih(e,t,n,r,a));return o}function j(e){return e!==null&&/object|function/.test(typeof e)}function Mc(e,t=Map){let n=new t;return(t,...r)=>{if(n.has(t))return n.get(t);let i=e(t,...r);return n.set(t,i),i}}function Nc(e){return Pc({name:e},1)}function Pc(e,t){return Rc((e=>({value:e,configurable:1,writable:!t})),e)}function Fc(e){return Rc((e=>({get:e,configurable:1})),e)}function Ic(e){return{[Symbol.toStringTag]:{value:e,configurable:1}}}function Lc(e,t){let n={},r=e.length;for(let i of t)n[e[--r]]=i;return n}function Rc(e,t,n){let r={};for(let i in t)r[i]=e(t[i],i,n);return r}function zc(e,t,n){let r={};for(let i=0;i<t.length;i++){let a=t[i];r[a]=e(a,i,n)}return r}function Bc(e,t,n){let r={};for(let i=0;i<e.length;i++)r[t[i]]=n[e[i]];return r}function Vc(e,t){let n=Object.create(null);for(let r of e)n[r]=t[r];return n}function Hc(e,t){for(let n of t)if(n in e)return 1;return 0}function Uc(e,t,n){for(let r of e)if(t[r]!==n[r])return 0;return 1}function Wc(e,t,n){let r={...n};for(let n=0;n<t;n++)r[e[n]]=0;return r}function M(e,...t){return(...n)=>e(...t,...n)}function Gc(e){return e[0].toUpperCase()+e.substring(1)}function Kc(e){return e.slice().sort()}function qc(e,t){return String(t).padStart(e,`0`)}function Jc(e,t){return Math.sign(e-t)}function Yc(e,t,n){return Math.min(Math.max(e,t),n)}function Xc(e,t){return[Math.floor(e/t),Zc(e,t)]}function Zc(e,t){return(e%t+t)%t}function Qc(e,t){return[$c(e,t),el(e,t)]}function $c(e,t){return Math.trunc(e/t)||0}function el(e,t){return e%t||0}function tl(e){return Math.abs(e%1)===.5}function nl(e,t,n){let r=0,i=0;for(let a=0;a<=t;a++){let t=e[n[a]],o=rg[a],[s,c]=Qc(t,L/o);r+=c*o,i+=s}let[a,o]=Qc(r,L);return[i+a,o]}function rl(e,t,n){let r={};for(let i=t;i>=0;i--){let t=rg[i];r[n[i]]=$c(e,t),e=el(e,t)}return r}function il(e){if(e!==void 0)return R(e)}function al(e){if(e!==void 0)return sl(e)}function ol(e){if(e!==void 0)return cl(e)}function sl(e){return pl(cl(e))}function cl(e){return fl(kg(e))}function ll(e,t){if(t==null)throw RangeError(oh(e));return t}function ul(e){if(!j(e))throw TypeError(rh);return e}function dl(e,t,n=e){if(typeof t!==e)throw TypeError(ah(n,t));return t}function fl(e,t=`number`){if(!Number.isInteger(e))throw RangeError(Zm(t,e));return e||0}function pl(e,t=`number`){if(e<=0)throw RangeError(Qm(t,e));return e}function ml(e){if(typeof e==`symbol`)throw TypeError(nh);return String(e)}function hl(e,t){return j(e)?String(e):R(e,t)}function gl(e){if(typeof e==`string`)return BigInt(e);if(typeof e!=`bigint`)throw TypeError(th(e));return e}function _l(e,t=`number`){if(typeof e==`bigint`)throw TypeError(eh(t));if(e=Number(e),!Number.isFinite(e))throw RangeError($m(t,e));return e}function vl(e,t){return Math.trunc(_l(e,t))||0}function yl(e,t){return fl(_l(e,t),t)}function bl(e,t){return pl(vl(e,t),t)}function xl(e,t){let[n,r]=Qc(t,L),i=e+n,a=Math.sign(i);return a&&a===-Math.sign(r)&&(i-=a,r+=a*L),[i,r]}function Sl(e,t,n=1){return xl(e[0]+t[0]*n,e[1]+t[1]*n)}function Cl(e,t){return xl(e[0],e[1]+t)}function wl(e,t){return Sl(t,e,-1)}function Tl(e,t){return Jc(e[0],t[0])||Jc(e[1],t[1])}function El(e,t,n){return Tl(e,t)===-1||Tl(e,n)===1}function Dl(e,t=1){let n=BigInt(L/t);return[Number(e/n),Number(e%n)*t]}function Ol(e,t=1){let[n,r]=Qc(e,L/t);return[n,r*t]}function kl(e,t=1,n){let[r,i]=e,[a,o]=Qc(i,t);return L/t*r+(a+(n?o/t:0))}function Al(e,t,n=Xc){let[r,i]=e,[a,o]=n(i,t);return[L/t*r+a,o]}function jl(e){return Ac(e,`isoYear`,Xg,Yg,1),e.isoYear===Xg?Ac(e,`isoMonth`,4,12,1):e.isoYear===Yg&&Ac(e,`isoMonth`,1,9,1),e}function Ml(e){return Nl({...e,...Ug,isoHour:12}),e}function Nl(e){let t=Ac(e,`isoYear`,Xg,Yg,1),n=t===Xg?1:t===Yg?-1:0;return n&&Pl(N({...e,isoDay:e.isoDay+n,isoNanosecond:e.isoNanosecond-n})),e}function Pl(e){if(!e||El(e,Jg,qg))throw RangeError(Nh);return e}function Fl(e){return nl(e,5,Lg)[1]}function Il(e){let[t,n]=Xc(e,L);return[rl(n,5,Lg),t]}function Ll(e){return Al(e,eg)}function Rl(e){return Vl(e.isoYear,e.isoMonth,e.isoDay,e.isoHour,e.isoMinute,e.isoSecond,e.isoMillisecond)}function N(e){let t=Rl(e);if(t!==void 0){let[n,r]=Qc(t,Xh);return[n,r*$h+(e.isoMicrosecond||0)*Qh+(e.isoNanosecond||0)]}}function zl(e,t){let[n,r]=Il(Fl(e)-t);return Pl(N({...e,isoDay:e.isoDay+r,...n}))}function Bl(...e){return Vl(...e)/Zh}function Vl(...e){let[t,n]=Hl(...e),r=t.valueOf();if(!isNaN(r))return r-n*Xh}function Hl(e,t=1,n=1,r=0,i=0,a=0,o=0){let s=e===Xg?1:e===Yg?-1:0,c=new Date;return c.setUTCHours(r,i,a,o),c.setUTCFullYear(e,t-1,n+s),[c,s]}function Ul(e,t){let[n,r]=Cl(e,t);r<0&&(r+=L,--n);let[i,a]=Xc(r,$h),[o,s]=Xc(a,Qh);return Wl(n*Xh+i,o,s)}function Wl(e,t=0,n=0){let r=Math.ceil(Math.max(0,Math.abs(e)-Kg)/Xh)*Math.sign(e),i=new Date(e-r*Xh);return Lc(zg,[i.getUTCFullYear(),i.getUTCMonth()+1,i.getUTCDate()+r,i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds(),t,n])}function Gl(e,t){if(t<-Kg)throw RangeError(Nh);let n=e.formatToParts(t),r={};for(let e of n)r[e.type]=e.value;return r}function Kl(e){return[e.isoYear,e.isoMonth,e.isoDay]}function ql(e,t){return[t,0]}function Jl(){return t_}function Yl(e,t){switch(t){case 2:return Zl(e)?29:28;case 4:case 6:case 9:case 11:return 30}return 31}function Xl(e){return Zl(e)?366:365}function Zl(e){return e%4==0&&(e%100!=0||e%400==0)}function Ql(e){let[t,n]=Hl(e.isoYear,e.isoMonth,e.isoDay);return Zc(t.getUTCDay()-n,7)||7}function $l(e){return this.id===Cg?(({isoYear:e})=>e<1?[`gregory-inverse`,1-e]:[`gregory`,e])(e):this.id===wg?r_(e):[]}function eu(e){let t=Rl(e);if(t<n_){let{isoYear:t}=e;return t<1?[`japanese-inverse`,1-t]:[`japanese`,t]}let{era:n,eraYear:r}=Np(Gl(fv(wg),t),wg);return[n,r]}function tu(e){return nu(e),au(e,1),e}function nu(e){return iu(e,1),e}function ru(e){return Uc(Rg,e,iu(e))}function iu(e,t){let{isoYear:n}=e,r=Ac(e,`isoMonth`,1,Jl(),t);return{isoYear:n,isoMonth:r,isoDay:Ac(e,`isoDay`,1,Yl(n,r),t)}}function au(e,t){return Lc(Lg,[Ac(e,`isoHour`,0,23,t),Ac(e,`isoMinute`,0,59,t),Ac(e,`isoSecond`,0,59,t),Ac(e,`isoMillisecond`,0,999,t),Ac(e,`isoMicrosecond`,0,999,t),Ac(e,`isoNanosecond`,0,999,t)])}function P(e){return e===void 0?0:S_(ul(e))}function ou(e,t=0){e=_u(e);let n=C_(e),r=w_(e,t);return[S_(e),r,n]}function su(e,t,n,r=9,i=0,a=4){t=_u(t);let o=b_(t,r,i),s=mu(t),c=O_(t,a),l=y_(t,r,i,1);return o==null?o=Math.max(n,l):Su(o,l),s=hu(s,l,1),e&&(c=(e=>e<4?(e+2)%4:e)(c)),[o,l,s,c]}function cu(e,t=6,n){let r=mu(e=vu(e,i_)),i=O_(e,7),a=y_(e,t);return a=ll(i_,a),r=hu(r,a,void 0,n),[a,r,i]}function lu(e){return T_(_u(e))}function uu(e,t){return fu(_u(e),t)}function du(e){let t=xu(l_,v_,vu(e,l_),0);if(!t)throw RangeError(ah(l_,t));return t}function fu(e,t=4){let n=gu(e);return[O_(e,4),...pu(y_(e,t),n)]}function pu(e,t){return e==null?[t===void 0?1:10**(9-t),t]:[rg[e],e<4?9-3*e:-1]}function mu(e){let t=e[o_];return t===void 0?1:vl(t,o_)}function hu(e,t,n,r){let i=r?L:rg[t+1];if(i){let n=rg[t];if(i%((e=jc(o_,e,1,i/n-+!r,1))*n))throw RangeError(ah(o_,e))}else e=jc(o_,e,1,n?10**9:1,1);return e}function gu(e){let t=e[s_];if(t!==void 0){if(typeof t!=`number`){if(ml(t)===`auto`)return;throw RangeError(ah(s_,t))}t=jc(s_,Math.floor(t),0,9,1)}return t}function _u(e){return e===void 0?{}:ul(e)}function vu(e,t){return typeof e==`string`?{[t]:e}:ul(e)}function yu(e){return{overflow:d_[e]}}function bu(e,t,n=9,r=0,i){let a=t[e];if(a===void 0)return i?r:void 0;if(a=ml(a),a===`auto`)return i?r:null;let o=Jh[a];if(o===void 0&&(o=Pg[a]),o===void 0)throw RangeError(dh(e,a,Jh));return jc(e,o,r,n,1,Yh),o}function xu(e,t,n,r=0){let i=n[e];if(i===void 0)return r;let a=ml(i),o=t[a];if(o===void 0)throw RangeError(dh(e,a,t));return o}function Su(e,t){if(t>e)throw RangeError(zh)}function Cu(e){return{branding:F_,epochNanoseconds:e}}function wu(e,t,n){return{branding:P_,calendar:n,timeZone:t,epochNanoseconds:e}}function Tu(e,t=e.calendar){return{branding:M_,calendar:t,...Vc(Hg,e)}}function Eu(e,t=e.calendar){return{branding:j_,calendar:t,...Vc(Bg,e)}}function Du(e,t=e.calendar){return{branding:k_,calendar:t,...Vc(Bg,e)}}function Ou(e,t=e.calendar){return{branding:A_,calendar:t,...Vc(Bg,e)}}function ku(e){return{branding:N_,...Vc(Vg,e)}}function F(e){return{branding:I_,sign:ef(e),...Vc(Ag,e)}}function Au(e){return Al(e.epochNanoseconds,$h)[0]}function ju(e){return((e,t=1)=>{let[n,r]=e,i=Math.floor(r/t),a=L/t;return BigInt(n)*BigInt(a)+BigInt(i)})(e.epochNanoseconds)}function Mu(e){return e.epochNanoseconds}function Nu(e,t,n,r,i){let a=sf(r),[o,s]=((e,t)=>{let n=t((e=vu(e,a_))[c_]),r=x_(e);return r=ll(a_,r),[r,n]})(i,e);if(!s&&qd(Math.max(o,a),s))return Pu(r,o);if(!s)throw RangeError(Ih);if(!r.sign)return 0;let[c,l,u]=Hd(t,n,s),d=Ud(u),f=Wd(u),p=Gd(u),m=f(l,c,r);Kd(s)||(Nl(c),Nl(m));let h=p(l,c,m,o);return qd(o,s)?Pu(h,o):((e,t,n,r,i,a,o)=>{let s=ef(e),[c,l]=Fu(r,Ig(n,e),n,s,i,a,o),u=Iu(t,c,l);return e[z[n]]+u*s})(h,d(m),o,l,c,d,f)}function Pu(e,t){return kl(I(e),rg[t],1)}function Fu(e,t,n,r,i,a,o){let s=z[n],c={...t,[s]:t[s]+r},l=o(e,i,t),u=o(e,i,c);return[a(l),a(u)]}function Iu(e,t,n){let r=kl(wl(t,n));if(!r)throw RangeError(Ch);return kl(wl(t,e))/r}function Lu(e,t){let[n,r,i]=cu(t,5,1);return Cu(Qu(e.epochNanoseconds,n,r,i,1))}function Ru(e,t,n){let{epochNanoseconds:r,timeZone:i,calendar:a}=t,[o,s,c]=cu(n);if(o===0&&s===1)return t;let l=e(i);if(o===6)r=((e,t,n,r)=>{let[i,a]=e(U_(n,t)),o=n.epochNanoseconds,s=kd(t,i),c=kd(t,a);if(El(o,s,c))throw RangeError(Ch);return td(Iu(o,s,c),r)?c:s})(Ju,l,t,c);else{let e=l.R(r);r=Dd(l,Uu(Ul(r,e),o,s,c),e,2,0,1)}return wu(r,i,a)}function zu(e,t){return Tu(Uu(e,...cu(t)),e.calendar)}function Bu(e,t){let[n,r,i]=cu(t,5);var a;return ku((a=i,Gu(e,qu(n,r),a)[0]))}function Vu(e,t){let n=e(t.timeZone),[r,i]=Ju(U_(t,n)),a=kl(wl(kd(n,r),kd(n,i)),ng,1);if(a<=0)throw RangeError(Ch);return a}function Hu(e,t){let{timeZone:n,calendar:r}=t;return wu(((e,t,n)=>kd(t,e(U_(n,t))))(Yu,e(n),t),n,r)}function Uu(e,t,n,r){return Wu(e,qu(t,n),r)}function Wu(e,t,n){let[r,i]=Gu(e,t,n);return Nl({...Vd(e,i),...r})}function Gu(e,t,n){return Il(ed(Fl(e),t,n))}function Ku(e){return ed(e,tg,7)}function qu(e,t){return rg[e]*t}function Ju(e){let t=Yu(e);return[t,Vd(t,1)]}function Yu(e){return Wg(6,e)}function Xu(e,t,n){let r=Math.min(sf(e),6);return rf($u(I(e,r),t,n),r)}function Zu(e,t,n,r,i,a,o,s,c,l){if(r===0&&i===1)return e;let[u,d,f]=(qd(r,s)?Kd(s)&&r<6&&n>=6?rd:nd:id)(e,t,n,r,i,a,o,s,c,l);return f&&r!==7&&(u=((e,t,n,r,i,a,o,s)=>{let c=ef(e);for(let l=r+1;l<=n;l++){if(l===7&&n!==7)continue;let r=Ig(l,e);r[z[l]]+=c;let u=kl(wl(o(s(i,a,r)),t));if(u&&Math.sign(u)!==c)break;e=r}return e})(u,d,n,Math.max(6,r),o,s,c,l)),u}function Qu(e,t,n,r,i){return t===6?[ed((e=>e[0]+e[1]/L)(e),n,r),0]:$u(e,qu(t,n),r,i)}function $u(e,t,n,r){let[i,a]=e;r&&a<0&&(a+=L,--i);let[o,s]=Xc(ed(a,t,n),L);return xl(i+o,s)}function ed(e,t,n){return td(e/t,n)*t}function td(e,t){return L_[t](e)}function nd(e,t,n,r,i,a){let o=ef(e),s=I(e),c=Qu(s,r,i,a),l=wl(s,c),u=Math.sign(c[0]-s[0])===o,d=rf(c,Math.min(n,6));return[{...e,...d},Sl(t,l),u]}function rd(e,t,n,r,i,a,o,s,c,l){let u=ef(e)||1,d=kl(I(e,5)),f=qu(r,i),p=ed(d,f,a),[m,h]=Fu(o,{...e,...Fg},6,u,s,c,l),ee=p-kl(wl(m,h)),g=0;ee&&Math.sign(ee)!==u?t=Cl(m,p):(g+=u,p=ed(ee,f,a),t=Cl(h,p));let te=af(p);return[{...e,...te,days:e.days+g},t,!!g]}function id(e,t,n,r,i,a,o,s,c,l){let u=ef(e),d=z[r],f=Ig(r,e);r===7&&(e={...e,weeks:e.weeks+Math.trunc(e.days/7)});let p=$c(e[d],i)*i;f[d]=p;let[m,h]=Fu(o,f,r,i*u,s,c,l),ee=p+Iu(t,m,h)*u*i,g=ed(ee,i,a),te=Math.sign(g-ee)===u;return f[d]=g,[f,te?h:m,te]}function ad(e,t,n,r){let[i,a,o,s]=(e=>{let t=fu(e=_u(e));return[e.timeZone,...t]})(r),c=i!==void 0;return((e,t,n,r,i,a)=>{n=$u(n,i,r,1);let o=t.R(n);return hd(Ul(n,o),a)+(e?bd(Ku(o)):`Z`)})(c,t(c?e(i):R_),n.epochNanoseconds,a,o,s)}function od(e,t,n){let[r,i,a,o,s,c]=(e=>{e=_u(e);let t=T_(e),n=gu(e),r=D_(e),i=O_(e,4),a=y_(e,4);return[t,E_(e),r,i,...pu(a,n)]})(n);return((e,t,n,r,i,a,o,s,c,l)=>{r=$u(r,c,s,1);let u=e(n).R(r);return hd(Ul(r,u),l)+bd(Ku(u),o)+((e,t)=>t===1?``:`[`+(t===2?`!`:``)+e+`]`)(n,a)+xd(t,i)})(e,t.calendar,t.timeZone,t.epochNanoseconds,r,i,a,o,s,c)}function sd(e,t){let[n,r,i,a]=(e=>(e=_u(e),[T_(e),...fu(e)]))(t);return o=e.calendar,s=n,c=a,hd(Wu(e,i,r),c)+xd(o,s);var o,s,c}function cd(e,t){return n=e.calendar,r=e,i=lu(t),gd(r)+xd(n,i);var n,r,i}function ld(e,t){return pd(e.calendar,_d,e,lu(t))}function ud(e,t){return pd(e.calendar,vd,e,lu(t))}function dd(e,t){let[n,r,i]=uu(t);return a=i,yd(Gu(e,r,n)[0],a);var a}function fd(e,t){let[n,r,i]=uu(t,3);return r>1&&tf(e={...e,...Xu(e,r,n)}),((e,t)=>{let{sign:n}=e,r=n===-1?Qd(e):e,{hours:i,minutes:a}=r,[o,s]=Al(I(r,3),eg,Qc);nf(o);let c=Cd(s,t),l=t>=0||!n||c;return(n<0?`-`:``)+`P`+md({Y:Td(r.years),M:Td(r.months),W:Td(r.weeks),D:Td(r.days)})+(i||a||o||l?`T`+md({H:Td(i),M:Td(a),S:Td(o,l)+c}):``)})(e,i)}function pd(e,t,n,r){return r===1?e===`iso8601`?t(n):gd(n):r>1||r===0&&e!==`iso8601`?gd(n)+Sd(e,r===2):t(n)}function md(e){let t=[];for(let n in e){let r=e[n];r&&t.push(r,n)}return t.join(``)}function hd(e,t){return gd(e)+`T`+yd(e,t)}function gd(e){return _d(e)+`-`+qh(e.isoDay)}function _d(e){let{isoYear:t}=e;return(t<0||t>9999?wd(t)+qc(6,Math.abs(t)):qc(4,t))+`-`+qh(e.isoMonth)}function vd(e){return qh(e.isoMonth)+`-`+qh(e.isoDay)}function yd(e,t){let n=[qh(e.isoHour),qh(e.isoMinute)];return t!==-1&&n.push(qh(e.isoSecond)+((e,t,n,r)=>Cd(e*1e6+t*Qh+n,r))(e.isoMillisecond,e.isoMicrosecond,e.isoNanosecond,t)),n.join(`:`)}function bd(e,t=0){if(t===1)return``;let[n,r]=Xc(Math.abs(e),ng),[i,a]=Xc(r,tg),[o,s]=Xc(a,eg);return wd(e)+qh(n)+`:`+qh(i)+(o||s?`:`+qh(o)+Cd(s):``)}function xd(e,t){return t!==1&&(t>1||t===0&&e!==`iso8601`)?Sd(e,t===2):``}function Sd(e,t){return`[`+(t?`!`:``)+`u-ca=`+e+`]`}function Cd(e,t){let n=qc(9,e);return n=t===void 0?n.replace(H_,``):n.slice(0,t),n?`.`+n:``}function wd(e){return e<0?`-`:`+`}function Td(e,t){return e||t?e.toLocaleString(`fullwide`,{useGrouping:0}):``}function Ed(e,t){let{epochNanoseconds:n}=e,r=(t.R?t:t(e.timeZone)).R(n),i=Ul(n,r);return{calendar:e.calendar,...i,offsetNanoseconds:r}}function Dd(e,t,n,r=0,i=0,a,o){if(n!==void 0&&r===1&&(r===1||o))return zl(t,n);let s=e.I(t);if(n!==void 0&&r!==3){let e=((e,t,n,r)=>{let i=N(t);r&&(n=Ku(n));for(let t of e){let e=kl(wl(t,i));if(r&&(e=Ku(e)),e===n)return t}})(s,t,n,a);if(e!==void 0)return e;if(r===0)throw RangeError(jh)}return o?N(t):Od(e,t,i,s)}function Od(e,t,n=0,r=e.I(t)){if(r.length===1)return r[0];if(n===1)throw RangeError(Mh);if(r.length)return r[+(n===3)];let i=N(t),a=((e,t)=>{let n=e.R(Cl(t,-L));return(e=>{if(e>L)throw RangeError(Ah);return e})(e.R(Cl(t,L))-n)})(e,i)*(n===2?-1:1);return(r=e.I(Ul(i,a)))[n===2?0:r.length-1]}function kd(e,t){let n=e.I(t);if(n.length)return n[0];let r=Cl(N(t),-L);return e.O(r,1)}function Ad(e,t,n){return Cu(Pl(Sl(t.epochNanoseconds,(e=>{if(of(e))throw RangeError(Lh);return I(e,5)})(e?Qd(n):n))))}function jd(e,t,n,r,i,a=Object.create(null)){let o=t(r.timeZone),s=e(r.calendar);return{...r,...Id(o,s,r,n?Qd(i):i,a)}}function Md(e,t,n,r,i=Object.create(null)){let{calendar:a}=n;return Tu(Ld(e(a),n,t?Qd(r):r,i),a)}function Nd(e,t,n,r,i){let{calendar:a}=n;return Eu(Rd(e(a),n,t?Qd(r):r,i),a)}function Pd(e,t,n,r,i){let a=n.calendar,o=e(a),s=Ml(zd(o,n));return t&&(r=Zd(r)),r.sign<0&&(s=o.P(s,{...B,months:1}),s=Vd(s,-1)),Du(zd(o,o.P(s,r,i)),a)}function Fd(e,t,n){return ku(Bd(t,e?Qd(n):n)[0])}function Id(e,t,n,r,i){let a=I(r,5),o=n.epochNanoseconds;if(of(r)){let s=U_(n,e);o=Sl(Od(e,{...Rd(t,s,{...r,...Fg},i),...Vc(Lg,s)}),a)}else o=Sl(o,a),P(i);return{epochNanoseconds:Pl(o)}}function Ld(e,t,n,r){let[i,a]=Bd(t,n);return Nl({...Rd(e,t,{...n,...Fg,days:n.days+a},r),...i})}function Rd(e,t,n,r){if(n.years||n.months||n.weeks)return e.P(t,n,r);P(r);let i=n.days+I(n,5)[0];return i?Ml(Vd(t,i)):t}function zd(e,t,n=1){return Vd(t,n-e.day(t))}function Bd(e,t){let[n,r]=I(t,5),[i,a]=Il(Fl(e)+r);return[i,n+a]}function Vd(e,t){return t?{...e,...Wl(Rl(e)+t*Xh)}:e}function Hd(e,t,n){let r=e(n.calendar);return Kd(n)?[n,r,t(n.timeZone)]:[{...n,...Ug},r]}function Ud(e){return e?Mu:N}function Wd(e){return e?M(Id,e):Ld}function Gd(e){return e?M(lp,e):up}function Kd(e){return e&&e.epochNanoseconds}function qd(e,t){return e<=6-!!Kd(t)}function Jd(e,t,n,r,i,a,o){let s=e(_u(o).relativeTo),c=Math.max(sf(i),sf(a));if(qd(c,s))return F(tf(((e,t,n,r)=>{let i=Sl(I(e),I(t),r?-1:1);if(!Number.isFinite(i[0]))throw RangeError(Nh);return{...B,...rf(i,n)}})(i,a,c,r)));if(!s)throw RangeError(Ih);r&&(a=Qd(a));let[l,u,d]=Hd(t,n,s),f=Wd(d);return F(Gd(d)(u,l,f(u,f(u,l,i),a),c))}function Yd(e,t,n,r,i){let a=sf(r),[o,s,c,l,u]=((e,t,n)=>{e=vu(e,i_);let r=b_(e),i=n(e[c_]),a=mu(e),o=O_(e,7),s=y_(e);if(r===void 0&&s===void 0)throw RangeError(Rh);if(s??=0,r??=Math.max(s,t),Su(r,s),a=hu(a,s,1),a>1&&s>5&&r!==s)throw RangeError(`For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit`);return[r,s,a,o,i]})(i,a,e);if(!u&&Math.max(a,o)<=6)return F(tf(((e,t,n,r,i)=>{let a=Qu(I(e),n,r,i);return{...B,...rf(a,t)}})(r,o,s,c,l)));if(!Kd(u)&&!r.sign)return r;if(!u)throw RangeError(Ih);let[d,f,p]=Hd(t,n,u),m=Ud(p),h=Wd(p),ee=Gd(p),g=h(f,d,r);Kd(u)||(Nl(d),Nl(g));let te=ee(f,d,g,o),_=r.sign,v=ef(te);if(_&&v&&_!==v)throw RangeError(Ch);return te=Zu(te,m(g),o,s,c,l,f,d,m,h),F(te)}function Xd(e){return e.sign===-1?Zd(e):e}function Zd(e){return F(Qd(e))}function Qd(e){let t={};for(let n of z)t[n]=-1*e[n]||0;return t}function $d(e){return!e.sign}function ef(e,t=z){let n=0;for(let r of t){let t=Math.sign(e[r]);if(t){if(n&&n!==t)throw RangeError(Fh);n=t}}return n}function tf(e){for(let t of Ng)jc(t,e[t],-W_,W_,1);return nf(kl(I(e),eg)),e}function nf(e){if(!Number.isSafeInteger(e))throw RangeError(Ph)}function I(e,t=6){return nl(e,t,z)}function rf(e,t=6){let[n,r]=e,i=rl(r,t,z);if(i[z[t]]+=n*(L/rg[t]),!Number.isFinite(i[z[t]]))throw RangeError(Nh);return i}function af(e,t=5){return rl(e,t,z)}function of(e){return!!ef(e,Mg)}function sf(e){let t=9;for(;t>0&&!e[z[t]];t--);return t}function cf(e,t){return[e,t]}function lf(e){let t=Math.floor(e/z_)*z_;return[t,t+z_]}function uf(e){let t=Df(e=hl(e));if(!t)throw RangeError(Bh(e));let n;if(t.j)n=0;else{if(!t.offset)throw RangeError(Bh(e));n=pf(t.offset)}return t.timeZone&&Af(t.timeZone,1),Cu(zl(tu(t),n))}function df(e){let t=Df(R(e));if(!t)throw RangeError(Bh(e));if(t.timeZone)return Cf(t,t.offset?pf(t.offset):void 0);if(t.j)throw RangeError(Bh(e));return Tf(t)}function ff(e,t){let n=Df(R(e));if(!n||!n.timeZone)throw RangeError(Bh(e));let{offset:r}=n,i=r?pf(r):void 0,[,a,o]=ou(t);return Cf(n,i,a,o)}function pf(e){let t=Af(e);if(t===void 0)throw RangeError(Bh(e));return t}function mf(e){let t=Df(R(e));if(!t||t.j)throw RangeError(Bh(e));return Tu(wf(t))}function hf(e,t,n){let r=Df(R(e));if(!r||r.j)throw RangeError(Bh(e));return t?r.calendar===`iso8601`&&(r=r.isoYear===-271821&&r.isoMonth===4?{...r,isoDay:20,...Ug}:{...r,isoDay:1,...Ug}):n&&r.calendar===`iso8601`&&(r={...r,isoYear:e_}),Eu(r.C?wf(r):Tf(r))}function gf(e,t){let n=Of(R(t));if(n)return _f(n),Du(jl(nu(n)));let r=hf(t,1);return Du(zd(e(r.calendar),r))}function _f(e){if(e.calendar!==`iso8601`)throw RangeError(Vh(e.calendar))}function vf(e,t){let n=kf(R(t));if(n)return _f(n),Ou(nu(n));let r=hf(t,0,1),{calendar:i}=r,a=e(i),[o,s,c]=a.v(r),[l,u]=a.q(o,s),[d,f]=a.G(l,u,c);return Ou(Ml(a.V(d,f,c)),i)}function yf(e){let t,n=(e=>{let t=rv.exec(e);return t?(Nf(t[10]),Mf(t)):void 0})(R(e));if(!n){if(n=Df(e),!n||!n.C)throw RangeError(Bh(e));if(n.j)throw RangeError(Vh(`Z`));_f(n)}if((t=Of(e))&&ru(t)||(t=kf(e))&&ru(t))throw RangeError(Bh(e));return ku(au(n,1))}function bf(e){let t=(e=>{let t=ov.exec(e);return t?(e=>{function t(e,t,a){let o=0,s=0;if(a&&([o,i]=Xc(i,rg[a])),e!==void 0){if(r)throw RangeError(Vh(e));s=(e=>{let t=parseInt(e);if(!Number.isFinite(t))throw RangeError(Vh(e));return t})(e),n=1,t&&(i=Pf(t)*(rg[a]/eg),r=1)}return o+s}let n=0,r=0,i=0,a={...Lc(z,[t(e[2]),t(e[3]),t(e[4]),t(e[5]),t(e[6],e[7],5),t(e[8],e[9],4),t(e[10],e[11],3)]),...rl(i,2,z)};if(!n)throw RangeError(lh(z));return If(e[1])<0&&(a=Qd(a)),a})(t):void 0})(R(e));if(!t)throw RangeError(Bh(e));return F(tf(t))}function xf(e){let t=Df(e)||Of(e)||kf(e);return t?t.calendar:e}function Sf(e){let t=Df(e);return t&&(t.timeZone||t.j&&R_||t.offset)||e}function Cf(e,t,n=0,r=0){let i=zf(e.timeZone),a=V(i),o;return tu(e),o=e.C?Dd(a,e,t,n,r,!a.$,e.j):kd(a,e),wu(o,i,Gp(e.calendar))}function wf(e){return Ef(Nl(tu(e)))}function Tf(e){return Ef(Ml(nu(e)))}function Ef(e){return{...e,calendar:Gp(e.calendar)}}function Df(e){let t=nv.exec(e);return t?(e=>{let t=e[10],n=(t||``).toUpperCase()===`Z`;return{isoYear:jf(e),isoMonth:parseInt(e[4]),isoDay:parseInt(e[5]),...Mf(e.slice(5)),...Nf(e[16]),C:!!e[6],j:n,offset:n?void 0:t}})(t):void 0}function Of(e){let t=ev.exec(e);return t?(e=>({isoYear:jf(e),isoMonth:parseInt(e[4]),isoDay:1,...Nf(e[5])}))(t):void 0}function kf(e){let t=tv.exec(e);return t?(e=>({isoYear:e_,isoMonth:parseInt(e[1]),isoDay:parseInt(e[2]),...Nf(e[3])}))(t):void 0}function Af(e,t){let n=iv.exec(e);return n?((e,t)=>{let n=e[4]||e[5];if(t&&n)throw RangeError(Vh(n));return(e=>{if(Math.abs(e)>=L)throw RangeError(kh);return e})((Lf(e[2])*ng+Lf(e[3])*tg+Lf(e[4])*eg+Pf(e[5]||``))*If(e[1]))})(n,t):void 0}function jf(e){let t=If(e[1]),n=parseInt(e[2]||e[3]);if(t<0&&!n)throw RangeError(Vh(-0));return t*n}function Mf(e){let t=Lf(e[3]);return{...Il(Pf(e[4]||``))[0],isoHour:Lf(e[1]),isoMinute:Lf(e[2]),isoSecond:t===60?59:t}}function Nf(e){let t,n,r=[];if(e.replace(av,((e,i,a)=>{let o=!!i,[s,c]=a.split(`=`).reverse();if(c){if(c===`u-ca`)r.push(s),t||=o;else if(o||/[A-Z]/.test(c))throw RangeError(Vh(e))}else{if(n)throw RangeError(Vh(e));n=s}return``})),r.length>1&&t)throw RangeError(Vh(e));return{timeZone:n,calendar:r[0]||`iso8601`}}function Pf(e){return parseInt(e.padEnd(9,`0`))}function Ff(e){return RegExp(`^${e}$`,`i`)}function If(e){return e&&e!==`+`?-1:1}function Lf(e){return e===void 0?0:parseInt(e)}function Rf(e){return zf(R(e))}function zf(e){let t=Vf(e);return typeof t==`number`?bd(t):t?(e=>{if(lv.test(e))throw RangeError(Eh(e));if(cv.test(e))throw RangeError(Oh);return e.toLowerCase().split(`/`).map(((e,t)=>(e.length<=3||/\d/.test(e))&&!/etc|yap/.test(e)?e.toUpperCase():e.replace(/baja|dumont|[a-z]+/g,((e,n)=>e.length<=2&&!t||e===`in`||e===`chat`?e.toUpperCase():e.length>2||!n?Gc(e).replace(/island|noronha|murdo|rivadavia|urville/,Gc):e)))).join(`/`)})(e):R_}function Bf(e){let t=Vf(e);return typeof t==`number`?t:t?t.resolvedOptions().timeZone:R_}function Vf(e){let t=Af(e=e.toUpperCase(),1);return t===void 0?e===R_?void 0:sv(e):t}function Hf(e,t){return Tl(e.epochNanoseconds,t.epochNanoseconds)}function Uf(e,t){return Tl(e.epochNanoseconds,t.epochNanoseconds)}function Wf(e,t,n,r,i,a){let o=e(_u(a).relativeTo),s=Math.max(sf(r),sf(i));if(Uc(z,r,i))return 0;if(qd(s,o))return Tl(I(r),I(i));if(!o)throw RangeError(Ih);let[c,l,u]=Hd(t,n,o),d=Ud(u),f=Wd(u);return Tl(d(f(l,c,r)),d(f(l,c,i)))}function Gf(e,t){return Kf(e,t)||qf(e,t)}function Kf(e,t){return Jc(Rl(e),Rl(t))}function qf(e,t){return Jc(Fl(e),Fl(t))}function Jf(e,t){return!Hf(e,t)}function Yf(e,t){return!Uf(e,t)&&!!tp(e.timeZone,t.timeZone)&&e.calendar===t.calendar}function Xf(e,t){return!Gf(e,t)&&e.calendar===t.calendar}function Zf(e,t){return!Kf(e,t)&&e.calendar===t.calendar}function Qf(e,t){return!Kf(e,t)&&e.calendar===t.calendar}function $f(e,t){return!Kf(e,t)&&e.calendar===t.calendar}function ep(e,t){return!qf(e,t)}function tp(e,t){if(e===t)return 1;try{return Bf(e)===Bf(t)}catch{}}function np(e,t,n,r){let i=su(e,r,3,5),a=pp(t.epochNanoseconds,n.epochNanoseconds,...i);return F(e?Qd(a):a)}function rp(e,t,n,r,i,a){let o=vp(r.calendar,i.calendar),[s,c,l,u]=su(n,a,5),d=r.epochNanoseconds,f=i.epochNanoseconds,p=Tl(f,d),m;if(p)if(s<6)m=pp(d,f,s,c,l,u);else{let n=t(((e,t)=>{if(!tp(e,t))throw RangeError(Dh);return e})(r.timeZone,i.timeZone)),d=e(o);m=dp(d,n,r,i,p,s,a),m=Zu(m,f,s,c,l,u,d,r,Mu,M(Id,n))}else m=B;return F(n?Qd(m):m)}function ip(e,t,n,r,i){let a=vp(n.calendar,r.calendar),[o,s,c,l]=su(t,i,6),u=N(n),d=N(r),f=Tl(d,u),p;if(f)if(o<=6)p=pp(u,d,o,s,c,l);else{let t=e(a);p=fp(t,n,r,f,o,i),p=Zu(p,d,o,s,c,l,t,n,N,Ld)}else p=B;return F(t?Qd(p):p)}function ap(e,t,n,r,i){let a=vp(n.calendar,r.calendar);return sp(t,(()=>e(a)),n,r,...su(t,i,6,9,6))}function op(e,t,n,r,i){let a=vp(n.calendar,r.calendar),o=su(t,i,9,9,8),s=e(a),c=zd(s,n),l=zd(s,r);return c.isoYear===l.isoYear&&c.isoMonth===l.isoMonth&&c.isoDay===l.isoDay?F(B):sp(t,(()=>s),Ml(c),Ml(l),...o,8)}function sp(e,t,n,r,i,a,o,s,c=6){let l=N(n),u=N(r);if(l===void 0||u===void 0)throw RangeError(Nh);let d;if(Tl(u,l))if(i===6)d=pp(l,u,i,a,o,s);else{let e=t();d=e.N(n,r,i),a===c&&o===1||(d=Zu(d,u,i,a,o,s,e,n,N,Rd))}else d=B;return F(e?Qd(d):d)}function cp(e,t,n,r){let[i,a,o,s]=su(e,r,5,5),c=ed(_p(t,n),qu(a,o),s),l={...B,...af(c,i)};return F(e?Qd(l):l)}function lp(e,t,n,r,i,a){let o=Tl(r.epochNanoseconds,n.epochNanoseconds);return o?i<6?mp(n.epochNanoseconds,r.epochNanoseconds,i):dp(t,e,n,r,o,i,a):B}function up(e,t,n,r,i){let a=N(t),o=N(n),s=Tl(o,a);return s?r<=6?mp(a,o,r):fp(e,t,n,s,r,i):B}function dp(e,t,n,r,i,a,o){let[s,c,l]=((e,t,n,r)=>{function i(){return d={...Vd(s,l++*-r),...o},f=Od(e,d),Tl(c,f)===-r}let a=U_(t,e),o=Vc(Lg,a),s=U_(n,e),c=n.epochNanoseconds,l=0,u=_p(a,s),d,f;if(Math.sign(u)===-r&&l++,i()&&(r===-1||i()))throw RangeError(Ch);let p=kl(wl(f,c));return[a,d,p]})(t,n,r,i);var u,d;return{...a===6?(u=s,d=c,{...B,days:hp(u,d)}):e.N(s,c,a,o),...af(l)}}function fp(e,t,n,r,i,a){let[o,s,c]=((e,t,n)=>{let r=t,i=_p(e,t);return Math.sign(i)===-n&&(r=Vd(t,-n),i+=L*n),[e,r,i]})(t,n,r);return{...e.N(o,s,i,a),...af(c)}}function pp(e,t,n,r,i,a){return{...B,...rf(Qu(wl(e,t),r,i,a),n)}}function mp(e,t,n){return{...B,...rf(wl(e,t),n)}}function hp(e,t){return gp(Rl(e),Rl(t))}function gp(e,t){return Math.trunc((t-e)/Xh)}function _p(e,t){return Fl(t)-Fl(e)}function vp(e,t){if(e!==t)throw RangeError(Th);return e}function yp(e){return this.m(e)[0]}function bp(e){return this.m(e)[1]}function xp(e){let[t]=this.v(e);return gp(this.p(t),Rl(e))+1}function Sp(e){let t=uv.exec(e);if(!t)throw RangeError(yh(e));return[parseInt(t[1]),!!t[2]]}function Cp(e,t){return`M`+qh(e)+(t?`L`:``)}function wp(e,t,n){return e+(t||n&&e>=n?1:0)}function Tp(e,t){return e-(t&&e>=t?1:0)}function Ep(e,t){return(t+e)*(Math.sign(t)||1)||0}function Dp(e){return Tg[kp(e)]}function Op(e){return Dg[kp(e)]}function kp(e){return Kp(e.id||`iso8601`)}function Ap(e){function t(e){return((e,t)=>({...Np(e,t),o:e.month,day:parseInt(e.day)}))(Gl(n,e),r)}let n=fv(e),r=Kp(e);return{id:e,h:jp(t),l:Mp(t)}}function jp(e){return Mc((t=>e(Rl(t))),WeakMap)}function Mp(e){let t=e(0).year-$g;return Mc((n=>{let r,i=Vl(n-t),a=0,o=[],s=[];do i+=400*Xh;while((r=e(i)).year<=n);do if(i+=(1-r.day)*Xh,r.year===n&&(o.push(i),s.push(r.o)),i-=Xh,++a>100||i<-Kg)throw RangeError(Ch);while((r=e(i)).year>=n);return{i:o.reverse(),u:Gh(s.reverse())}}))}function Np(e,t){let n,r,i=Pp(e);if(e.era){let a=Tg[t],o=Eg[t]||{};a!==void 0&&(n=t===`islamic`?`ah`:e.era.normalize(`NFD`).toLowerCase().replace(/[^a-z0-9]/g,``),n===`bc`||n===`b`?n=`bce`:n===`ad`||n===`a`?n=`ce`:n===`beforeroc`&&(n=`broc`),n=o[n]||n,r=i,i=Ep(r,a[n]||0))}return{era:n,eraYear:r,year:i}}function Pp(e){return parseInt(e.relatedYear||e.year)}function Fp(e){let{year:t,o:n,day:r}=this.h(e),{u:i}=this.l(t);return[t,i[n]+1,r]}function Ip(e,t=1,n=1){return this.l(e).i[t-1]+(n-1)*Xh}function Lp(e,t){let n=Rp.call(this,e);return[Tp(t,n),n===t]}function Rp(e){let t=Up(this,e),n=Up(this,e-1),r=t.length;if(r>n.length){let e=Op(this);if(e<0)return-e;for(let e=0;e<r;e++)if(t[e]!==n[e])return e+1}}function zp(e){return gp(Ip.call(this,e),Ip.call(this,e+1))}function Bp(e,t){let{i:n}=this.l(e),r=t+1,i=n;return r>n.length&&(r=1,i=this.l(e+1).i),gp(n[t-1],i[r-1])}function Vp(e){return this.l(e).i.length}function Hp(e){let t=this.h(e);return[t.era,t.eraYear]}function Up(e,t){return Object.keys(e.l(t).u)}function Wp(e){return Gp(R(e))}function Gp(e){if((e=e.toLowerCase())!==`iso8601`&&e!==Cg){let t=fv(e).resolvedOptions().calendar;if(Kp(e)!==Kp(t))throw RangeError(wh(e));return t}return e}function Kp(e){return e===`islamicc`&&(e=`islamic`),e.split(`-`)[0]}function qp(e,t){return n=>n===`iso8601`?e:n===Cg||n===wg?Object.assign(Object.create(e),{id:n}):Object.assign(Object.create(t),dv(n))}function Jp(e,t,n,r){let i=nm(n,r,vg,[],lg);if(i.timeZone!==void 0){let r=n.F(i),a=im(i),o=e(i.timeZone);return{epochNanoseconds:Dd(t(o),{...r,...a},i.offset===void 0?void 0:pf(i.offset)),timeZone:o}}return{...n.F(i),...Ug}}function Yp(e,t,n,r,i,a){let o=nm(n,i,vg,sg,lg),s=e(o.timeZone),[c,l,u]=ou(a),d=n.F(o,yu(c)),f=im(o,c);return wu(Dd(t(s),{...d,...f},o.offset===void 0?void 0:pf(o.offset),l,u),s,r)}function Xp(e,t,n){let r=nm(e,t,vg,[],ig),i=P(n);return Tu(Nl({...e.F(r,yu(i)),...im(r,i)}))}function Zp(e,t,n,r=[]){let i=nm(e,t,vg,r);return e.F(i,n)}function Qp(e,t,n,r){let i=nm(e,t,gg,r);return e.K(i,n)}function $p(e,t,n,r){let i=nm(e,n,vg,hg);return t&&i.month!==void 0&&i.monthCode===void 0&&i.year===void 0&&(i.year=e_),e._(i,r)}function em(e,t){return ku(im(rm(e,ag,[],1),P(t)))}function tm(e){let t=rm(e,Ag);return F(tf({...B,...t}))}function nm(e,t,n,r=[],i=[]){return rm(t,[...e.fields(n),...i].sort(),r)}function rm(e,t,n,r=!n){let i={},a,o=0;for(let r of t){if(r===a)throw RangeError(ch(r));if(r===`constructor`||r===`__proto__`)throw RangeError(sh(r));let t=e[r];if(t!==void 0)o=1,yv[r]&&(t=yv[r](t,r)),i[r]=t;else if(n){if(n.includes(r))throw TypeError(oh(r));i[r]=xg[r]}a=r}if(r&&!o)throw TypeError(lh(t));return i}function im(e,t){return au(bv({...xg,...e}),t)}function am(e,t,n,r,i){let{calendar:a,timeZone:o}=n,s=e(a),c=t(o),l=[...s.fields(vg),...cg].sort(),u=(e=>{let t=U_(e,V),n=bd(t.offsetNanoseconds),r=vv(e.calendar),[i,a,o]=r.v(t),[s,c]=r.q(i,a),l=Cp(s,c);return{...xv(t),year:i,monthCode:l,day:o,offset:n}})(n),d=rm(r,l),f=s.k(u,d),p={...u,...d},[m,h,ee]=ou(i,2);return wu(Dd(c,{...s.F(f,yu(m)),...au(bv(p),m)},pf(p.offset),h,ee),o,a)}function om(e,t,n,r){let i=e(t.calendar),a=[...i.fields(vg),...ig].sort(),o={..._m(s=t),hour:s.isoHour,minute:s.isoMinute,second:s.isoSecond,millisecond:s.isoMillisecond,microsecond:s.isoMicrosecond,nanosecond:s.isoNanosecond};var s;let c=rm(n,a),l=P(r),u=i.k(o,c),d={...o,...c};return Tu(Nl({...i.F(u,yu(l)),...au(bv(d),l)}))}function sm(e,t,n,r){let i=e(t.calendar),a=i.fields(vg).sort(),o=_m(t),s=rm(n,a),c=i.k(o,s);return i.F(c,r)}function cm(e,t,n,r){let i=e(t.calendar),a=i.fields(gg).sort(),o=(e=>{let t=vv(e.calendar),[n,r]=t.v(e),[i,a]=t.q(n,r);return{year:n,monthCode:Cp(i,a)}})(t),s=rm(n,a),c=i.k(o,s);return i.K(c,r)}function lm(e,t,n,r){let i=e(t.calendar),a=i.fields(vg).sort(),o=(e=>{let t=vv(e.calendar),[n,r,i]=t.v(e),[a,o]=t.q(n,r);return{monthCode:Cp(a,o),day:i}})(t),s=rm(n,a),c=i.k(o,s);return i._(c,r)}function um(e,t,n){return ku(((e,t,n)=>im({...Vc(ag,e),...rm(t,ag)},P(n)))(e,t,n))}function dm(e,t){return F((n=e,r=t,tf({...n,...rm(r,Ag)})));var n,r}function fm(e,t,n,r,i){t=Vc(n=e.fields(n),t),r=rm(r,i=e.fields(i),[]);let a=e.k(t,r);return a=rm(a,[...n,...i].sort(),[]),e.F(a)}function pm(e,t){let n=Dp(e),r=Eg[e.id||``]||{},{era:i,eraYear:a,year:o}=t;if(i!==void 0||a!==void 0){if(i===void 0||a===void 0)throw TypeError(hh);if(!n)throw RangeError(mh);let e=n[r[i]||i];if(e===void 0)throw RangeError(_h(i));let t=Ep(a,e);if(o!==void 0&&o!==t)throw RangeError(gh);o=t}else if(o===void 0)throw TypeError(vh(n));return o}function mm(e,t,n,r){let{month:i,monthCode:a}=t;if(a!==void 0){let t=((e,t,n,r)=>{let i=e.L(n),[a,o]=Sp(t),s=wp(a,o,i);if(o){let t=Op(e);if(t===void 0)throw RangeError(Sh);if(t>0){if(s>t)throw RangeError(Sh);if(i===void 0){if(r===1)throw RangeError(Sh);s--}}else if(s!==-t||i===void 0&&r===1)throw RangeError(Sh)}return s})(e,a,n,r);if(i!==void 0&&i!==t)throw RangeError(bh);i=t,r=1}else if(i===void 0)throw TypeError(xh);return jc(`month`,i,1,e.B(n),r)}function hm(e,t,n,r,i){return Ac(t,`day`,1,e.U(r,n),i)}function gm(e,t,n,r){let i=0,a=[];for(let e of n)t[e]===void 0?a.push(e):i=1;if(Object.assign(e,t),i)for(let t of r||a)delete e[t]}function _m(e){let t=vv(e.calendar),[n,r,i]=t.v(e),[a,o]=t.q(n,r);return{year:n,monthCode:Cp(a,o),day:i}}function vm(e){return Cu(Pl(Dl(gl(e))))}function ym(e,t,n,r,i=Sg){return wu(Pl(Dl(gl(n))),t(r),e(i))}function bm(e,t,n,r,i=0,a=0,o=0,s=0,c=0,l=0,u=Sg){return Tu(Nl(tu(Rc(vl,Lc(zg,[t,n,r,i,a,o,s,c,l])))),e(u))}function xm(e,t,n,r,i=Sg){return Eu(Ml(nu(Rc(vl,{isoYear:t,isoMonth:n,isoDay:r}))),e(i))}function Sm(e,t,n,r=Sg,i=1){let a=vl(t),o=vl(n),s=e(r);return Du(jl(nu({isoYear:a,isoMonth:o,isoDay:vl(i)})),s)}function Cm(e,t,n,r=Sg,i=e_){let a=vl(t),o=vl(n),s=e(r);return Ou(Ml(nu({isoYear:vl(i),isoMonth:a,isoDay:o})),s)}function wm(e=0,t=0,n=0,r=0,i=0,a=0){return ku(au(Rc(vl,Lc(Lg,[e,t,n,r,i,a])),1))}function Tm(e=0,t=0,n=0,r=0,i=0,a=0,o=0,s=0,c=0,l=0){return F(tf(Rc(yl,Lc(z,[e,t,n,r,i,a,o,s,c,l]))))}function Em(e,t,n=Sg){return wu(e.epochNanoseconds,t,n)}function Dm(e){return Cu(e.epochNanoseconds)}function Om(e,t){return Tu(U_(t,e))}function km(e,t){return Eu(U_(t,e))}function Am(e,t){return ku(U_(t,e))}function jm(e,t,n,r){return wu(Pl(((e,t,n,r)=>{let i=(e=>C_(_u(e)))(r);return Od(e(t),n,i)})(e,n,t,r)),n,t.calendar)}function Mm(e,t,n,r,i){let a=e(i.timeZone),o=i.plainTime,s=o===void 0?void 0:t(o),c=n(a),l;return l=s?Od(c,{...r,...s}):kd(c,{...r,...Ug}),wu(l,a,r.calendar)}function Nm(e,t=Ug){return Tu(Nl({...e,...t}))}function Pm(e,t,n){return((e,t)=>{let n=nm(e,t,_g);return e.K(n,void 0)})(e(t.calendar),n)}function Fm(e,t,n){return((e,t)=>{let n=nm(e,t,bg);return e._(n)})(e(t.calendar),n)}function Im(e,t,n,r){return((e,t,n)=>fm(e,t,_g,ul(n),hg))(e(t.calendar),n,r)}function Lm(e,t,n,r){return((e,t,n)=>fm(e,t,bg,ul(n),fg))(e(t.calendar),n,r)}function Rm(e){return Cu(Pl(Ol(yl(e),$h)))}function zm(e){return Cu(Pl(Dl(gl(e))))}function Bm(e,t,n){let r=new Set(n);return(i,a)=>{let o=n&&Hc(i,n);if(!Hc(i=((e,t)=>{let n={};for(let r in t)e.has(r)||(n[r]=t[r]);return n})(r,i),e)){if(a&&o)throw TypeError(`Invalid formatting options`);i={...t,...i}}return n&&(i.timeZone=R_,[`full`,`long`].includes(i.J)&&(i.J=`medium`)),i}}function Vm(e,t=Hm,n=0){let[r,,,i]=e;return(a,o=Zv,...s)=>{let c=t(i&&i(...s),a,o,r,n);return[c,...Um(e,c.resolvedOptions(),s)]}}function Hm(e,t,n,r,i){if(n=r(n,i),e){if(n.timeZone!==void 0)throw TypeError(Wh);n.timeZone=e}return new Zg(t,n)}function Um(e,t,n){let[,r,i]=e;return n.map((e=>(e.calendar&&((e,t,n)=>{if((n||e!==`iso8601`)&&e!==t)throw RangeError(Th)})(e.calendar,t.calendar,i),r(e,t))))}function Wm(e,t,n){let r=t.timeZone,i=e(r),a={...U_(t,i),...n||Ug},o;return o=n?Dd(i,a,a.offsetNanoseconds,2):kd(i,a),wu(o,r,t.calendar)}function Gm(e,t=Ug){return Tu(Nl({...e,...t}))}function Km(e,t){return{...e,calendar:t}}function qm(e,t){return{...e,timeZone:t}}function Jm(e){let t=Ym();return Ul(t,e.R(t))}function Ym(){return Ol(Date.now(),$h)}function Xm(){return oy||=new Zg().resolvedOptions().timeZone}var Zm=(e,t)=>`Non-integer ${e}: ${t}`,Qm=(e,t)=>`Non-positive ${e}: ${t}`,$m=(e,t)=>`Non-finite ${e}: ${t}`,eh=e=>`Cannot convert bigint to ${e}`,th=e=>`Invalid bigint: ${e}`,nh=`Cannot convert Symbol to string`,rh=`Invalid object`,ih=(e,t,n,r,i)=>i?ih(e,i[t],i[n],i[r]):ah(e,t)+`; must be between ${n}-${r}`,ah=(e,t)=>`Invalid ${e}: ${t}`,oh=e=>`Missing ${e}`,sh=e=>`Invalid field ${e}`,ch=e=>`Duplicate field ${e}`,lh=e=>`No valid fields: `+e.join(),uh=`Invalid bag`,dh=(e,t,n)=>ah(e,t)+`; must be `+Object.keys(n).join(),fh=`Cannot use valueOf`,ph=`Invalid calling context`,mh=`Forbidden era/eraYear`,hh=`Mismatching era/eraYear`,gh=`Mismatching year/eraYear`,_h=e=>`Invalid era: ${e}`,vh=e=>`Missing year`+(e?`/era/eraYear`:``),yh=e=>`Invalid monthCode: ${e}`,bh=`Mismatching month/monthCode`,xh=`Missing month/monthCode`,Sh=`Invalid leap month`,Ch=`Invalid protocol results`,wh=e=>ah(`Calendar`,e),Th=`Mismatching Calendars`,Eh=e=>ah(`TimeZone`,e),Dh=`Mismatching TimeZones`,Oh=`Forbidden ICU TimeZone`,kh=`Out-of-bounds offset`,Ah=`Out-of-bounds TimeZone gap`,jh=`Invalid TimeZone offset`,Mh=`Ambiguous offset`,Nh=`Out-of-bounds date`,Ph=`Out-of-bounds duration`,Fh=`Cannot mix duration signs`,Ih=`Missing relativeTo`,Lh=`Cannot use large units`,Rh=`Required smallestUnit or largestUnit`,zh=`smallestUnit > largestUnit`,Bh=e=>`Cannot parse: ${e}`,Vh=e=>`Invalid substring: ${e}`,Hh=e=>`Cannot format ${e}`,Uh=`Mismatching types for formatting`,Wh=`Cannot specify TimeZone`,Gh=M(zc,((e,t)=>t)),Kh=M(zc,((e,t,n)=>n)),qh=M(qc,2),Jh={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},Yh=Object.keys(Jh),Xh=864e5,Zh=1e3,Qh=1e3,$h=1e6,eg=1e9,tg=6e10,ng=36e11,L=864e11,rg=[1,Qh,$h,eg,tg,ng,L],ig=Yh.slice(0,6),ag=Kc(ig),og=[`offset`],sg=[`timeZone`],cg=ig.concat(og),lg=cg.concat(sg),ug=[`era`,`eraYear`],dg=ug.concat([`year`]),fg=[`year`],pg=[`monthCode`],mg=[`month`].concat(pg),hg=[`day`],gg=mg.concat(fg),_g=pg.concat(fg),vg=hg.concat(gg),yg=hg.concat(mg),bg=hg.concat(pg),xg=Kh(ig,0),Sg=`iso8601`,Cg=`gregory`,wg=`japanese`,Tg={[Cg]:{"gregory-inverse":-1,gregory:0},[wg]:{"japanese-inverse":-1,japanese:0,meiji:1867,taisho:1911,showa:1925,heisei:1988,reiwa:2018},ethiopic:{ethioaa:0,ethiopic:5500},coptic:{"coptic-inverse":-1,coptic:0},roc:{"roc-inverse":-1,roc:0},buddhist:{be:0},islamic:{ah:0},indian:{saka:0},persian:{ap:0}},Eg={[Cg]:{bce:`gregory-inverse`,ce:`gregory`},[wg]:{bce:`japanese-inverse`,ce:`japanese`},ethiopic:{era0:`ethioaa`,era1:`ethiopic`},coptic:{era0:`coptic-inverse`,era1:`coptic`},roc:{broc:`roc-inverse`,minguo:`roc`}},Dg={chinese:13,dangi:13,hebrew:-6},R=M(dl,`string`),Og=M(dl,`boolean`),kg=M(dl,`number`),z=Yh.map((e=>e+`s`)),Ag=Kc(z),jg=z.slice(0,6),Mg=z.slice(6),Ng=Mg.slice(1),Pg=Gh(z),B=Kh(z,0),Fg=Kh(jg,0),Ig=M(Wc,z),Lg=[`isoNanosecond`,`isoMicrosecond`,`isoMillisecond`,`isoSecond`,`isoMinute`,`isoHour`],Rg=[`isoDay`,`isoMonth`,`isoYear`],zg=Lg.concat(Rg),Bg=Kc(Rg),Vg=Kc(Lg),Hg=Kc(zg),Ug=Kh(Vg,0),Wg=M(Wc,zg),Gg=1e8,Kg=Gg*Xh,qg=[Gg,0],Jg=[-1e8,0],Yg=275760,Xg=-271821,Zg=Intl.DateTimeFormat,Qg=`en-GB`,$g=1970,e_=1972,t_=12,n_=Vl(1868,9,8),r_=Mc(eu,WeakMap),i_=`smallestUnit`,a_=`unit`,o_=`roundingIncrement`,s_=`fractionalSecondDigits`,c_=`relativeTo`,l_=`direction`,u_={constrain:0,reject:1},d_=Object.keys(u_),f_={compatible:0,reject:1,earlier:2,later:3},p_={reject:0,use:1,prefer:2,ignore:3},m_={auto:0,never:1,critical:2,always:3},h_={auto:0,never:1,critical:2},g_={auto:0,never:1},__={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},v_={previous:-1,next:1},y_=M(bu,i_),b_=M(bu,`largestUnit`),x_=M(bu,a_),S_=M(xu,`overflow`,u_),C_=M(xu,`disambiguation`,f_),w_=M(xu,`offset`,p_),T_=M(xu,`calendarName`,m_),E_=M(xu,`timeZoneName`,h_),D_=M(xu,`offset`,g_),O_=M(xu,`roundingMode`,__),k_=`PlainYearMonth`,A_=`PlainMonthDay`,j_=`PlainDate`,M_=`PlainDateTime`,N_=`PlainTime`,P_=`ZonedDateTime`,F_=`Instant`,I_=`Duration`,L_=[Math.floor,e=>tl(e)?Math.floor(e):Math.round(e),Math.ceil,e=>tl(e)?Math.ceil(e):Math.round(e),Math.trunc,e=>tl(e)?Math.trunc(e)||0:Math.round(e),e=>e<0?Math.floor(e):Math.ceil(e),e=>Math.sign(e)*Math.round(Math.abs(e))||0,e=>tl(e)?(e=Math.trunc(e)||0)+e%2:Math.round(e)],R_=`UTC`,z_=5184e3,B_=Bl(1847),V_=Bl(new Date().getUTCFullYear()+10),H_=/0+$/,U_=Mc(Ed,WeakMap),W_=2**32-1,V=Mc((e=>{let t=Vf(e);return typeof t==`object`?new K_(t):new G_(t||0)})),G_=class{constructor(e){this.$=e}R(){return this.$}I(e){return(e=>{let t=N({...e,...Ug});if(!t||Math.abs(t[0])>1e8)throw RangeError(Nh)})(e),[zl(e,this.$)]}O(){}},K_=class{constructor(e){this.nn=(e=>{function t(e){let[t,s]=lf(Yc(e,a,o)),c=r(t),l=r(s);return c===l?c:n(i(t,s),c,l,e)}function n(t,n,r,i){let a,o;for(;(i===void 0||(a=i<t[0]?n:i>=t[1]?r:void 0)===void 0)&&(o=t[1]-t[0]);){let n=t[0]+Math.floor(o/2);e(n)===r?t[1]=n:t[0]=n+1}return a}let r=Mc(e),i=Mc(cf),a=B_,o=V_;return{tn(e){let n=t(e-86400),r=t(e+86400),i=e-n,a=e-r;if(n===r)return[i];let o=t(i);return o===t(a)?[e-o]:n>r?[i,a]:[]},rn:t,O(e,t){let s=Yc(e,a,o),[c,l]=lf(s),u=z_*t,d=t<0?()=>l>a||(a=s,0):()=>c<o||(o=s,0);for(;d();){let a=r(c),o=r(l);if(a!==o){let r=i(c,l);n(r,a,o);let s=r[0];if((Jc(s,e)||1)===t)return s}c+=u,l+=u}}}})((e=>t=>{let n=Gl(e,t*Zh);return Bl(Pp(n),parseInt(n.month),parseInt(n.day),parseInt(n.hour),parseInt(n.minute),parseInt(n.second))-t})(e))}R(e){return this.nn.rn((e=>Ll(e)[0])(e))*eg}I(e){let[t,n]=[Bl((r=e).isoYear,r.isoMonth,r.isoDay,r.isoHour,r.isoMinute,r.isoSecond),r.isoMillisecond*$h+r.isoMicrosecond*Qh+r.isoNanosecond];var r;return this.nn.tn(t).map((e=>Pl(Cl(Ol(e,eg),n))))}O(e,t){let[n,r]=Ll(e),i=this.nn.O(n+(t>0||r?1:0),t);if(i!==void 0)return Ol(i,eg)}},q_=`([+-])`,J_=`(?:[.,](\\d{1,9}))?`,Y_=`(?:(?:${q_}(\\d{6}))|(\\d{4}))-?(\\d{2})`,X_=`([+-])(\\d{2})(?::?(\\d{2})(?::?(\\d{2})(?:[.,](\\d{1,9}))?)?)?`,Z_=Y_+`-?(\\d{2})(?:[T ](\\d{2})(?::?(\\d{2})(?::?(\\d{2})(?:[.,](\\d{1,9}))?)?)?(Z|([+-])(\\d{2})(?::?(\\d{2})(?::?(\\d{2})(?:[.,](\\d{1,9}))?)?)?)?)?`,Q_=`\\[(!?)([^\\]]*)\\]`,$_=`((?:${Q_}){0,9})`,ev=Ff(Y_+$_),tv=Ff(`(?:--)?(\\d{2})-?(\\d{2})`+$_),nv=Ff(Z_+$_),rv=Ff(`T?(\\d{2})(?::?(\\d{2})(?::?(\\d{2})(?:[.,](\\d{1,9}))?)?)?(?:([+-])(\\d{2})(?::?(\\d{2})(?::?(\\d{2})(?:[.,](\\d{1,9}))?)?)?)?`+$_),iv=Ff(X_),av=new RegExp(Q_,`g`),ov=Ff(`${q_}?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?:(\\d+)${J_}H)?(?:(\\d+)${J_}M)?(?:(\\d+)${J_}S)?)?`),sv=Mc((e=>new Zg(Qg,{timeZone:e,era:`short`,year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`}))),cv=/^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/,lv=/[^\w\/:+-]+/,uv=/^M(\d{2})(L?)$/,dv=Mc(Ap),fv=Mc((e=>new Zg(Qg,{calendar:e,timeZone:R_,era:`short`,year:`numeric`,month:`short`,day:`numeric`}))),pv={P(e,t,n){let r=P(n),i,{years:a,months:o,weeks:s,days:c}=t;if(c+=I(t,5)[0],a||o)i=((e,t,n,r,i)=>{let[a,o,s]=e.v(t);if(n){let[t,r]=e.q(a,o);a+=n,o=wp(t,r,e.L(a)),o=jc(`month`,o,1,e.B(a),i)}return r&&([a,o]=e.un(a,o,r)),s=jc(`day`,s,1,e.U(a,o),i),e.p(a,o,s)})(this,e,a,o,r);else{if(!s&&!c)return e;i=Rl(e)}if(i===void 0)throw RangeError(Nh);return i+=(7*s+c)*Xh,Ml(Wl(i))},N(e,t,n){if(n<=7){let r=0,i=hp({...e,...Ug},{...t,...Ug});return n===7&&([r,i]=Qc(i,7)),{...B,weeks:r,days:i}}let r=this.v(e),i=this.v(t),[a,o,s]=((e,t,n,r,i,a,o)=>{let s=i-t,c=a-n,l=o-r;if(s||c){let u=Math.sign(s||c),d=e.U(i,a),f=0;if(Math.sign(l)===-u){let r=d;[i,a]=e.un(i,a,-u),s=i-t,c=a-n,d=e.U(i,a),f=u<0?-r:d}if(l=o-Math.min(r,d)+f,s){let[r,o]=e.q(t,n),[l,d]=e.q(i,a);if(c=l-r||Number(d)-Number(o),Math.sign(c)===-u){let n=u<0&&-e.B(i);s=(i-=u)-t,c=a-wp(r,o,e.L(i))+(n||e.B(i))}}}return[s,c,l]})(this,...r,...i);return n===8&&(o+=this.cn(a,r[0]),a=0),{...B,years:a,months:o,days:s}},F(e,t){let n=P(t),r=pm(this,e),i=mm(this,e,r,n),a=hm(this,e,i,r,n);return Eu(Ml(this.V(r,i,a)),this.id||`iso8601`)},K(e,t){let n=P(t),r=pm(this,e),i=mm(this,e,r,n);return Du(jl(this.V(r,i,1)),this.id||`iso8601`)},_(e,t){let n=P(t),r,i,a,o=e.eraYear!==void 0||e.year!==void 0?pm(this,e):void 0,s=!this.id;if(o===void 0&&s&&(o=e_),o!==void 0){let t=mm(this,e,o,n);r=hm(this,e,t,o,n);let s=this.L(o);i=Tp(t,s),a=t===s}else{if(e.monthCode===void 0)throw TypeError(xh);if([i,a]=Sp(e.monthCode),this.id&&this.id!==Cg&&this.id!==wg)if(this.id&&Kp(this.id)===`coptic`&&n===0){let t=a||i!==13?30:6;r=e.day,r=Yc(r,1,t)}else if(this.id&&Kp(this.id)===`chinese`&&n===0){let t=!a||i!==1&&i!==9&&i!==10&&i!==11&&i!==12?30:29;r=e.day,r=Yc(r,1,t)}else r=e.day;else r=hm(this,e,mm(this,e,e_,n),e_,n)}let c=this.G(i,a,r);if(!c)throw RangeError(`Cannot guess year`);let[l,u]=c;return Ou(Ml(this.V(l,u,r)),this.id||`iso8601`)},fields(e){return Dp(this)&&e.includes(`year`)?[...e,...ug]:e},k(e,t){let n=Object.assign(Object.create(null),e);return gm(n,t,mg),Dp(this)&&(gm(n,t,dg),this.id===wg&&gm(n,t,yg,ug)),n},inLeapYear(e){let[t]=this.v(e);return this.sn(t)},monthsInYear(e){let[t]=this.v(e);return this.B(t)},daysInMonth(e){let[t,n]=this.v(e);return this.U(t,n)},daysInYear(e){let[t]=this.v(e);return this.fn(t)},dayOfYear:xp,era(e){return this.hn(e)[0]},eraYear(e){return this.hn(e)[1]},monthCode(e){let[t,n]=this.v(e),[r,i]=this.q(t,n);return Cp(r,i)},dayOfWeek:Ql,daysInWeek(){return 7}},mv={v:Kl,hn:$l,q:ql},hv=Object.assign({},pv,Object.assign({},{dayOfYear:xp,v:Kl,p:Vl},{weekOfYear:yp,yearOfWeek:bp,m(e){function t(e){return(7-e<r?7:0)-e}function n(e){let n=Xl(f+e),r=e||1;return u=(n+(t(Zc(c+n*r,7))-l)*r)/7}let r=this.id?1:4,i=Ql(e),a=this.dayOfYear(e),o=Zc(i-1,7),s=a-1,c=Zc(o-s,7),l=t(c),u,d=Math.floor((s-l)/7)+1,f=e.isoYear;return d?d>n(0)&&(d=1,f++):(d=n(-1),f--),[d,f,u]}}),{v:Kl,hn:$l,q:ql,G(e,t){if(!t)return[e_,e]},sn:Zl,L(){},B:Jl,cn:e=>e*t_,U:Yl,fn:Xl,V:(e,t,n)=>({isoYear:e,isoMonth:t,isoDay:n}),p:Vl,un:(e,t,n)=>(e+=$c(n,t_),(t+=el(n,t_))<1?(e--,t+=t_):t>t_&&(e++,t-=t_),[e,t]),year(e){return e.isoYear},month(e){return e.isoMonth},day:e=>e.isoDay}),gv={v:Fp,hn:Hp,q:Lp},_v=Object.assign({},pv,{dayOfYear:xp,v:Fp,p:Ip,weekOfYear:yp,yearOfWeek:bp,m(){return[]}},{v:Fp,hn:Hp,q:Lp,G(e,t,n){let r=this.id&&Kp(this.id)===`chinese`?((e,t,n)=>{if(t)switch(e){case 1:return 1651;case 2:return n<30?1947:1765;case 3:return n<30?1966:1955;case 4:return n<30?1963:1944;case 5:return n<30?1971:1952;case 6:return n<30?1960:1941;case 7:return n<30?1968:1938;case 8:return n<30?1957:1718;case 9:return 1832;case 10:return 1870;case 11:return 1814;case 12:return 1890}return 1972})(e,t,n):e_,[i,a,o]=Fp.call(this,{isoYear:r,isoMonth:t_,isoDay:31}),s=Rp.call(this,i),c=a===s;(Jc(e,Tp(a,s))||Jc(Number(t),Number(c))||Jc(n,o))===1&&i--;for(let r=0;r<100;r++){let a=i-r,o=Rp.call(this,a),s=wp(e,t,o);if(t===(s===o)&&n<=Bp.call(this,a,s))return[a,s]}},sn(e){let t=zp.call(this,e);return t>zp.call(this,e-1)&&t>zp.call(this,e+1)},L:Rp,B:Vp,cn(e,t){let n=t+e,r=Math.sign(e),i=r<0?-1:0,a=0;for(let e=t;e!==n;e+=r)a+=Vp.call(this,e+i);return a},U:Bp,fn:zp,V(e,t,n){return Wl(Ip.call(this,e,t,n))},p:Ip,un(e,t,n){if(n){if(t+=n,!Number.isSafeInteger(t))throw RangeError(Nh);if(n<0)for(;t<1;)t+=Vp.call(this,--e);else{let n;for(;t>(n=Vp.call(this,e));)t-=n,e++}}return[e,t]},year(e){return this.h(e).year},month(e){let{year:t,o:n}=this.h(e),{u:r}=this.l(t);return r[n]+1},day(e){return this.h(e).day}}),vv=qp(mv,gv),H=qp(hv,_v),yv={era:hl,eraYear:vl,year:vl,month:bl,monthCode(e){let t=hl(e);return Sp(t),t},day:bl,...Kh(ig,vl),...Kh(z,yl),offset(e){let t=hl(e);return pf(t),t}},bv=M(Bc,ig,Lg),xv=M(Bc,Lg,ig),Sv=`numeric`,Cv=[`timeZoneName`],wv={month:Sv,day:Sv},Tv={year:Sv,month:Sv},Ev=Object.assign({},Tv,{day:Sv}),Dv={hour:Sv,minute:Sv,second:Sv},Ov=Object.assign({},Ev,Dv),kv=Object.assign({},Ov,{timeZoneName:`short`}),Av=Object.keys(Tv),jv=Object.keys(wv),Mv=Object.keys(Ev),Nv=Object.keys(Dv),Pv=[`dateStyle`],Fv=Av.concat(Pv),Iv=jv.concat(Pv),Lv=Mv.concat(Pv,[`weekday`]),Rv=Nv.concat([`dayPeriod`,`timeStyle`,`fractionalSecondDigits`]),zv=Lv.concat(Rv),Bv=Cv.concat(Rv),Vv=Cv.concat(Lv),Hv=Cv.concat([`day`,`weekday`],Rv),Uv=Cv.concat([`year`,`weekday`],Rv),Wv=Bm(zv,Ov),Gv=Bm(zv,kv),Kv=Bm(zv,Ov,Cv),qv=Bm(Lv,Ev,Bv),Jv=Bm(Rv,Dv,Vv),Yv=Bm(Fv,Tv,Hv),Xv=Bm(Iv,wv,Uv),Zv={},Qv=new Zg(void 0,{calendar:Sg}).resolvedOptions().calendar===Sg,$v=[Wv,Au],ey=[Gv,Au,0,(e,t)=>{let n=e.timeZone;if(t&&t.timeZone!==n)throw RangeError(Dh);return n}],ty=[Kv,Rl],ny=[qv,Rl],ry=[Jv,e=>Fl(e)/$h],iy=[Yv,Rl,Qv],ay=[Xv,Rl,Qv],oy;function sy(e,t,n,r,i){function a(...e){if(!(this instanceof a))throw TypeError(ph);jy(this,t(...e))}function o(e,t){return Object.defineProperties((function(...t){return e.call(this,s(this),...t)}),Nc(t))}function s(t){let n=W(t);if(!n||n.branding!==e)throw TypeError(ph);return n}return Object.defineProperties(a.prototype,{...Fc(Rc(o,n)),...Pc(Rc(o,r)),...Ic(`Temporal.`+e)}),Object.defineProperties(a,{...Pc(i),...Nc(e)}),[a,e=>{let t=Object.create(a.prototype);return jy(t,e),t},s]}function cy(e){if(W(e)||e.calendar!==void 0||e.timeZone!==void 0)throw TypeError(uh);return e}function ly(e){return uy(e)||`iso8601`}function uy(e){let{calendar:t}=e;if(t!==void 0)return dy(t)}function dy(e){if(j(e)){let{calendar:t}=W(e)||{};if(!t)throw TypeError(wh(e));return t}return(e=>Gp(xf(R(e))))(e)}function fy(e){let t={};for(let n in e)t[n]=e=>{let{calendar:t}=e;return H(t)[n](e)};return t}function py(){throw TypeError(fh)}function my(e){if(j(e)){let{timeZone:t}=W(e)||{};if(!t)throw TypeError(Eh(e));return t}return(e=>zf(Sf(R(e))))(e)}function U(e){if(j(e)){let t=W(e);return t&&t.branding===`Duration`?t:tm(e)}return bf(e)}function hy(e){if(e!==void 0){if(j(e)){let t=W(e)||{};switch(t.branding){case P_:case j_:return t;case M_:return Eu(t)}let n=ly(e);return{...Jp(my,V,H(n),e),calendar:n}}return df(e)}}function gy(e,t){if(j(e)){let n=W(e)||{};switch(n.branding){case N_:return P(t),n;case M_:return P(t),ku(n);case P_:return P(t),Am(V,n)}return em(e,t)}let n=yf(e);return P(t),n}function _y(e){return e===void 0?void 0:gy(e)}function vy(e,t){if(j(e)){let n=W(e)||{};switch(n.branding){case M_:return P(t),n;case j_:return P(t),Tu({...n,...Ug});case P_:return P(t),Om(V,n)}return Xp(H(ly(e)),e,t)}let n=mf(e);return P(t),n}function yy(e,t){if(j(e)){let n=W(e);if(n&&n.branding===`PlainMonthDay`)return P(t),n;let r=uy(e);return $p(H(r||`iso8601`),!r,e,t)}let n=vf(H,e);return P(t),n}function by(e,t){if(j(e)){let n=W(e);return n&&n.branding===`PlainYearMonth`?(P(t),n):Qp(H(ly(e)),e,t)}let n=gf(H,e);return P(t),n}function xy(e,t){if(j(e)){let n=W(e)||{};switch(n.branding){case j_:return P(t),n;case M_:return P(t),Eu(n);case P_:return P(t),km(V,n)}return Zp(H(ly(e)),e,t)}let n=hf(e);return P(t),n}function Sy(e,t){if(j(e)){let n=W(e);if(n&&n.branding===`ZonedDateTime`)return ou(t),n;let r=ly(e);return Yp(my,V,H(r),r,e,t)}return ff(e,t)}function Cy(e){return Rc((e=>t=>e(wy(t))),e)}function wy(e){return U_(e,V)}function Ty(e){if(j(e)){let t=W(e);if(t)switch(t.branding){case F_:return t;case P_:return Cu(t.epochNanoseconds)}}return uf(e)}function Ey(){function e(e,n){return new t(e,n)}function t(e,t=Object.create(null)){yb.set(this,((e,t)=>{let n=new Zg(e,t),r=n.resolvedOptions(),i=r.locale,a=Vc(Object.keys(t),r),o=Mc(ky),s=(e,...t)=>{if(e){if(t.length!==2)throw TypeError(Uh);for(let e of t)if(e===void 0)throw TypeError(Uh)}e||t[0]!==void 0||(t=[]);let r=t.map((e=>W(e)||Number(e))),s,c=0;for(let e of r){let t=typeof e==`object`?e.branding:void 0;if(c++&&t!==s)throw TypeError(Uh);s=t}return s?o(s)(i,a,...r):[n,...r]};return s.X=n,s})(e,t))}let n=Zg.prototype,r=Object.getOwnPropertyDescriptors(n),i=Object.getOwnPropertyDescriptors(Zg);for(let t in r){let n=r[t],i=t.startsWith(`format`)&&Dy(t);typeof n.value==`function`?n.value=t===`constructor`?e:i||Oy(t):i&&(n.get=function(){if(!yb.has(this))throw TypeError(`Invalid calling context`);return(...e)=>i.apply(this,e)},Object.defineProperties(n.get,Nc(`get ${t}`)))}return i.prototype.value=t.prototype=Object.create({},r),Object.defineProperties(e,i),e}function Dy(e){return Object.defineProperties((function(...t){let[n,...r]=yb.get(this)(e.includes(`Range`),...t);return n[e](...r)}),Nc(e))}function Oy(e){return Object.defineProperties((function(...t){return yb.get(this).X[e](...t)}),Nc(e))}function ky(e){let t=Wy[e];if(!t)throw TypeError(Hh(e));return Vm(t,Mc(Hm),1)}var Ay=new WeakMap,W=Ay.get.bind(Ay),jy=Ay.set.bind(Ay),My={era:il,eraYear:ol,year:cl,month:sl,daysInMonth:sl,daysInYear:sl,inLeapYear:Og,monthsInYear:sl},Ny={monthCode:R},Py={day:sl},Fy=fy(Object.assign({},My,Ny,Py,{dayOfWeek:sl,dayOfYear:sl,weekOfYear:al,yearOfWeek:ol,daysInWeek:sl})),Iy=fy({...My,...Ny}),Ly=fy({...Ny,...Py}),Ry={calendarId:e=>e.calendar},zy=zc((e=>t=>t[e]),z.concat(`sign`)),By=zc(((e,t)=>e=>e[Lg[t]]),ig),Vy={epochMilliseconds:Au,epochNanoseconds:ju},[Hy,G,Uy]=sy(I_,Tm,{...zy,blank:$d},{with:(e,t)=>G(dm(e,t)),negated:e=>G(Zd(e)),abs:e=>G(Xd(e)),add:(e,t,n)=>G(Jd(hy,H,V,0,e,U(t),n)),subtract:(e,t,n)=>G(Jd(hy,H,V,1,e,U(t),n)),round:(e,t)=>G(Yd(hy,H,V,e,t)),total:(e,t)=>Nu(hy,H,V,e,t),toLocaleString(e,t,n){return Intl.DurationFormat?new Intl.DurationFormat(t,n).format(this):fd(e)},toString:fd,toJSON:e=>fd(e),valueOf:py},{from:e=>G(U(e)),compare:(e,t,n)=>Wf(hy,H,V,U(e),U(t),n)}),Wy={Instant:$v,PlainDateTime:ty,PlainDate:ny,PlainTime:ry,PlainYearMonth:iy,PlainMonthDay:ay},Gy=Vm($v),Ky=Vm(ey),qy=Vm(ty),Jy=Vm(ny),Yy=Vm(ry),Xy=Vm(iy),Zy=Vm(ay),[Qy,$y]=sy(N_,wm,By,{with(e,t,n){return $y(um(this,cy(t),n))},add:(e,t)=>$y(Fd(0,e,U(t))),subtract:(e,t)=>$y(Fd(1,e,U(t))),until:(e,t,n)=>G(cp(0,e,gy(t),n)),since:(e,t,n)=>G(cp(1,e,gy(t),n)),round:(e,t)=>$y(Bu(e,t)),equals:(e,t)=>ep(e,gy(t)),toLocaleString(e,t,n){let[r,i]=Yy(t,n,e);return r.format(i)},toString:dd,toJSON:e=>dd(e),valueOf:py},{from:(e,t)=>$y(gy(e,t)),compare:(e,t)=>qf(gy(e),gy(t))}),[eb,tb]=sy(M_,M(bm,Wp),{...Ry,...Fy,...By},{with:(e,t,n)=>tb(om(H,e,cy(t),n)),withCalendar:(e,t)=>tb(Km(e,dy(t))),withPlainTime:(e,t)=>tb(Gm(e,_y(t))),add:(e,t,n)=>tb(Md(H,0,e,U(t),n)),subtract:(e,t,n)=>tb(Md(H,1,e,U(t),n)),until:(e,t,n)=>G(ip(H,0,e,vy(t),n)),since:(e,t,n)=>G(ip(H,1,e,vy(t),n)),round:(e,t)=>tb(zu(e,t)),equals:(e,t)=>Xf(e,vy(t)),toZonedDateTime:(e,t,n)=>fb(jm(V,e,my(t),n)),toPlainDate:e=>lb(Eu(e)),toPlainTime:e=>$y(ku(e)),toLocaleString(e,t,n){let[r,i]=qy(t,n,e);return r.format(i)},toString:sd,toJSON:e=>sd(e),valueOf:py},{from:(e,t)=>tb(vy(e,t)),compare:(e,t)=>Gf(vy(e),vy(t))}),[nb,rb,ib]=sy(A_,M(Cm,Wp),{...Ry,...Ly},{with:(e,t,n)=>rb(lm(H,e,cy(t),n)),equals:(e,t)=>$f(e,yy(t)),toPlainDate(e,t){return lb(Lm(H,e,this,t))},toLocaleString(e,t,n){let[r,i]=Zy(t,n,e);return r.format(i)},toString:ud,toJSON:e=>ud(e),valueOf:py},{from:(e,t)=>rb(yy(e,t))}),[ab,ob,sb]=sy(k_,M(Sm,Wp),{...Ry,...Iy},{with:(e,t,n)=>ob(cm(H,e,cy(t),n)),add:(e,t,n)=>ob(Pd(H,0,e,U(t),n)),subtract:(e,t,n)=>ob(Pd(H,1,e,U(t),n)),until:(e,t,n)=>G(op(H,0,e,by(t),n)),since:(e,t,n)=>G(op(H,1,e,by(t),n)),equals:(e,t)=>Qf(e,by(t)),toPlainDate(e,t){return lb(Im(H,e,this,t))},toLocaleString(e,t,n){let[r,i]=Xy(t,n,e);return r.format(i)},toString:ld,toJSON:e=>ld(e),valueOf:py},{from:(e,t)=>ob(by(e,t)),compare:(e,t)=>Kf(by(e),by(t))}),[cb,lb,ub]=sy(j_,M(xm,Wp),{...Ry,...Fy},{with:(e,t,n)=>lb(sm(H,e,cy(t),n)),withCalendar:(e,t)=>lb(Km(e,dy(t))),add:(e,t,n)=>lb(Nd(H,0,e,U(t),n)),subtract:(e,t,n)=>lb(Nd(H,1,e,U(t),n)),until:(e,t,n)=>G(ap(H,0,e,xy(t),n)),since:(e,t,n)=>G(ap(H,1,e,xy(t),n)),equals:(e,t)=>Zf(e,xy(t)),toZonedDateTime(e,t){return fb(Mm(my,gy,V,e,j(t)?t:{timeZone:t}))},toPlainDateTime:(e,t)=>tb(Nm(e,_y(t))),toPlainYearMonth(e){return ob(Pm(H,e,this))},toPlainMonthDay(e){return rb(Fm(H,e,this))},toLocaleString(e,t,n){let[r,i]=Jy(t,n,e);return r.format(i)},toString:cd,toJSON:e=>cd(e),valueOf:py},{from:(e,t)=>lb(xy(e,t)),compare:(e,t)=>Kf(xy(e),xy(t))}),[db,fb]=sy(P_,M(ym,Wp,Rf),{...Vy,...Ry,...Cy(Fy),...Cy(By),offset:e=>bd(wy(e).offsetNanoseconds),offsetNanoseconds:e=>wy(e).offsetNanoseconds,timeZoneId:e=>e.timeZone,hoursInDay:e=>Vu(V,e)},{with:(e,t,n)=>fb(am(H,V,e,cy(t),n)),withCalendar:(e,t)=>fb(Km(e,dy(t))),withTimeZone:(e,t)=>fb(qm(e,my(t))),withPlainTime:(e,t)=>fb(Wm(V,e,_y(t))),add:(e,t,n)=>fb(jd(H,V,0,e,U(t),n)),subtract:(e,t,n)=>fb(jd(H,V,1,e,U(t),n)),until:(e,t,n)=>G(F(rp(H,V,0,e,Sy(t),n))),since:(e,t,n)=>G(F(rp(H,V,1,e,Sy(t),n))),round:(e,t)=>fb(Ru(V,e,t)),startOfDay:e=>fb(Hu(V,e)),equals:(e,t)=>Yf(e,Sy(t)),toInstant:e=>mb(Dm(e)),toPlainDateTime:e=>tb(Om(V,e)),toPlainDate:e=>lb(km(V,e)),toPlainTime:e=>$y(Am(V,e)),toLocaleString(e,t,n={}){let[r,i]=Ky(t,n,e);return r.format(i)},toString:(e,t)=>od(V,e,t),toJSON:e=>od(V,e),valueOf:py,getTimeZoneTransition(e,t){let{timeZone:n,epochNanoseconds:r}=e,i=du(t),a=V(n).O(r,i);return a?fb({...e,epochNanoseconds:a}):null}},{from:(e,t)=>fb(Sy(e,t)),compare:(e,t)=>Uf(Sy(e),Sy(t))}),[pb,mb,hb]=sy(F_,vm,Vy,{add:(e,t)=>mb(Ad(0,e,U(t))),subtract:(e,t)=>mb(Ad(1,e,U(t))),until:(e,t,n)=>G(np(0,e,Ty(t),n)),since:(e,t,n)=>G(np(1,e,Ty(t),n)),round:(e,t)=>mb(Lu(e,t)),equals:(e,t)=>Jf(e,Ty(t)),toZonedDateTimeISO:(e,t)=>fb(Em(e,my(t))),toLocaleString(e,t,n){let[r,i]=Gy(t,n,e);return r.format(i)},toString:(e,t)=>ad(my,V,e,t),toJSON:e=>ad(my,V,e),valueOf:py},{from:e=>mb(Ty(e)),fromEpochMilliseconds:e=>mb(Rm(e)),fromEpochNanoseconds:e=>mb(zm(e)),compare:(e,t)=>Hf(Ty(e),Ty(t))}),gb=Object.defineProperties({},{...Ic(`Temporal.Now`),...Pc({timeZoneId:()=>Xm(),instant:()=>mb(Cu(Ym())),zonedDateTimeISO:(e=Xm())=>fb(wu(Ym(),my(e),Sg)),plainDateTimeISO:(e=Xm())=>tb(Tu(Jm(V(my(e))),Sg)),plainDateISO:(e=Xm())=>lb(Eu(Jm(V(my(e))),Sg)),plainTimeISO:(e=Xm())=>$y(ku(Jm(V(my(e)))))})}),_b=Object.defineProperties({},{...Ic(`Temporal`),...Pc({PlainYearMonth:ab,PlainMonthDay:nb,PlainDate:cb,PlainTime:Qy,PlainDateTime:eb,ZonedDateTime:db,Instant:pb,Duration:Hy,Now:gb})}),vb=Ey(),yb=new WeakMap;Object.create(Intl),Pc({DateTimeFormat:vb});var bb=e=>{if(!(0,y.isString)(e))return null;try{return kc(e)?{isDateOnly:!0,date:_b.PlainDate.from(e)}:{isDateOnly:!1,dateTime:_b.Instant.from(e).toZonedDateTimeISO(`UTC`)}}catch{return null}},xb=e=>Math.trunc(e)+0,Sb=(e,t,n)=>{switch(t){case`DAY`:return e.add({days:n});case`WEEK`:return e.add({weeks:n});case`QUARTER`:return e.add({months:n*3});case`MONTH`:return e.add({months:n});case`YEAR`:return e.add({years:n});case`SECOND`:return e.add({seconds:n});case`MINUTE`:return e.add({minutes:n});case`HOUR`:return e.add({hours:n});default:return ne(t)}},Cb=({expressionDate:e,amount:t,unit:n})=>{try{let r=Sb(Dc(e),n,t);return e.isDateOnly&&n!==`MINUTE`&&n!==`HOUR`?{isDateOnly:!0,date:r.toPlainDate()}:{isDateOnly:!1,dateTime:r}}catch(e){if(e instanceof RangeError)return null;throw e}},wb=(e,t,r)=>{Tc(r);let i=bb(e);if(!n.t(i)||!Oc(i)||!(0,y.isNumber)(t)||!Number.isFinite(t))return null;let a=Cb({expressionDate:i,amount:xb(t),unit:r});return n.t(a)&&Oc(a)?Ec(a):null},Tb=({from:e,to:t})=>{let n=(t.year-e.year)*12+(t.month-e.month);return n>0&&t.day<e.day?n-1:n<0&&t.day>e.day?n+1:n},Eb={MINUTE:6e4,HOUR:36e5},Db=(e,t,r)=>{Tc(r);let i=bb(e),a=bb(t);if(!n.t(i)||!n.t(a))return null;let o=Dc(i),s=Dc(a);switch(r){case`MINUTE`:case`HOUR`:return xb((s.epochMilliseconds-o.epochMilliseconds)/Eb[r]);case`DAY`:case`WEEK`:{let e=o.toPlainDate().until(s.toPlainDate(),{largestUnit:`days`}).days;return r===`DAY`?e:xb(e/7)}case`MONTH`:case`QUARTER`:case`YEAR`:return xb(Tb({from:o.toPlainDate(),to:s.toPlainDate()})/{MONTH:1,QUARTER:3,YEAR:12}[r])}},Ob=({values:e,reduce:t})=>{let n=e.filter(y.isNumber);return r.t(n)?t(...n):null},kb=({value:e,decimals:t})=>{let n=Number(`${Math.abs(e)}e${t}`);return Number.isFinite(n)?Math.sign(e)*Number(`${Math.round(n)}e-${t}`):Number(e.toFixed(t))},Ab=[`YEAR`,`QUARTER`,`MONTH`,`WEEK`,`DAY`,`DAY_OF_WEEK`,`HOUR`,`MINUTE`],jb=e=>Ab.some(t=>t===e),Mb=e=>{if(!jb(e))throw new bc(Sc({value:e,kind:`part`,allowedValues:Ab}),`INVALID_DATE_PART`)},Nb=(e,t)=>{Mb(t);let r=bb(e);if(!n.t(r))return null;let i=Dc(r);switch(t){case`YEAR`:return i.year;case`QUARTER`:return Math.floor((i.month-1)/3)+1;case`MONTH`:return i.month;case`WEEK`:return i.weekOfYear??null;case`DAY`:return i.day;case`DAY_OF_WEEK`:return i.dayOfWeek;case`HOUR`:return i.hour;case`MINUTE`:return i.minute}},Pb=function(e){return e.MONDAY=`MONDAY`,e.SUNDAY=`SUNDAY`,e.SATURDAY=`SATURDAY`,e}({}),Fb=e=>{switch(e){case Pb.MONDAY:return 1;case Pb.SATURDAY:return 6;case Pb.SUNDAY:return 7;default:return ne(e)}},Ib=(e,t,r)=>{switch(t){case`DAY`:return e.startOfDay();case`WEEK`:{let t=n.t(r)?Fb(r):1,i=(e.dayOfWeek-t+7)%7;return e.startOfDay().subtract({days:i})}case`QUARTER`:{let t=Math.floor((e.month-1)/3);return e.startOfDay().with({day:1,month:t*3+1})}case`MONTH`:return e.startOfDay().with({day:1});case`YEAR`:return e.startOfDay().with({day:1,month:1});case`SECOND`:return e.with({nanosecond:0,microsecond:0,millisecond:0});case`MINUTE`:return e.with({second:0,nanosecond:0,microsecond:0,millisecond:0});case`HOUR`:return e.with({minute:0,second:0,nanosecond:0,microsecond:0,millisecond:0});default:return ne(t)}},Lb=(e,t,n)=>{switch(t){case`DAY`:return Ib(e,`DAY`).add({days:1});case`WEEK`:return Ib(e,`WEEK`,n).add({weeks:1});case`MONTH`:return Ib(e,`MONTH`,n).add({months:1});case`QUARTER`:return Ib(e,`QUARTER`,n).add({months:3});case`YEAR`:return Ib(e,`YEAR`,n).add({years:1});case`SECOND`:return Ib(e,`SECOND`).add({seconds:1});case`MINUTE`:return Ib(e,`MINUTE`).add({minutes:1});case`HOUR`:return Ib(e,`HOUR`).add({hours:1});default:return ne(t)}},Rb=(e,t)=>{Tc(t);let r=bb(e);if(!n.t(r))return null;let i=Ib(Dc(r),t);return Ec(r.isDateOnly?{isDateOnly:!0,date:i.toPlainDate()}:{isDateOnly:!1,dateTime:i})},zb=Ks([Pb.MONDAY,Pb.SATURDAY,Pb.SUNDAY]),Bb=Hs([vc().int().positive(),Js(`undefined`)]).transform(e=>e===`undefined`?void 0:e),Vb=Bs({direction:Ks([`NEXT`,`THIS`,`PAST`]),amount:Bb.nullish(),unit:yc,timezone:os().nullish(),firstDayOfTheWeek:zb.nullish()}).refine(e=>!(e.amount===void 0&&e.direction!==`THIS`),{error:`Amount cannot be 'undefined' unless direction is 'THIS'`}),Hb=(e,t,n)=>{switch(t){case`DAY`:return e.subtract({days:n});case`WEEK`:return e.subtract({weeks:n});case`QUARTER`:return e.subtract({months:n*3});case`MONTH`:return e.subtract({months:n});case`YEAR`:return e.subtract({years:n});case`SECOND`:return e.subtract({seconds:n});case`MINUTE`:return e.subtract({minutes:n});case`HOUR`:return e.subtract({hours:n});default:return ne(t)}},Ub=(e,t)=>{let{direction:r,amount:i,unit:a,firstDayOfTheWeek:o}=e;switch(r){case`NEXT`:{if(!n.t(i))throw Error(`Amount is required`);let r=Lb(t,a,o);return{...e,start:r,end:Sb(r,a,i)}}case`PAST`:{if(!n.t(i))throw Error(`Amount is required`);let r=Ib(t,a,o);return{...e,start:Hb(r,a,i),end:r}}case`THIS`:return{...e,start:Ib(t,a,o),end:Lb(t,a,o)}}},Wb={},Gb=()=>n.t(Wb.current)?_b.Instant.from(Wb.current).toZonedDateTimeISO(`UTC`):_b.Now.zonedDateTimeISO(`UTC`),Kb=e=>{try{return _b.Instant.from(e)}catch{}try{return _b.PlainDate.from(e).toZonedDateTime({timeZone:`UTC`}).toInstant()}catch{return null}},qb=(e,t,r,i)=>{if(!(0,y.isString)(e)||t!==`THIS`&&!n.t(r))return!1;let a=Kb(e),o=Vb.safeParse({direction:t,amount:t===`THIS`?void 0:r,unit:i});if(!n.t(a)||!o.success)return!1;let{start:s,end:c}=Ub(o.data,Gb());return _b.Instant.compare(a,s.toInstant())>=0&&_b.Instant.compare(a,c.toInstant())<0},Jb=new WeakSet,Yb=new WeakMap,Xb=e=>n.t(e)&&!(typeof e==`object`&&Jb.has(e)),Zb={[a.a.CURRENCY]:[`amountMicros`],[a.a.FULL_NAME]:[`firstName`,`lastName`],[a.a.LINKS]:[`primaryLinkUrl`],[a.a.EMAILS]:[`primaryEmail`],[a.a.PHONES]:[`primaryPhoneNumber`]},Qb=e=>{if(!n.t(e)||e===``)return!0;if(Array.isArray(e))return e.length===0;if(!i.t(e)||e instanceof Date)return!1;if(Jb.has(e))return!0;let t=Yb.get(e);if(t===a.a.RICH_TEXT)return!(0,y.isNonEmptyString)(e.markdown)||e.markdown.trim().length===0;let r=n.t(t)?Zb[t]:void 0;return(n.t(r)?r.map(t=>e[t]):Object.values(e)).every(Qb)},$b=function(e){return e.FIT_CONTENT=`FIT_CONTENT`,e.TAB_VIEWPORT=`TAB_VIEWPORT`,e}({}),ex=({widgetType:e,heightBehavior:t})=>{if(n.t(t))return t;switch(e){case o.d.CALENDAR:case o.d.CALL_RECORDING_SUMMARY:case o.d.CALL_RECORDING_TRANSCRIPT:case o.d.CHAT:case o.d.CHAT_THREADS:case o.d.EMAILS:case o.d.EMAIL_THREAD:case o.d.FILES:case o.d.MESSAGE_CAMPAIGN_BODY:case o.d.NOTES:case o.d.TASKS:case o.d.TIMELINE:case o.d.WORKFLOW:case o.d.WORKFLOW_RUN:case o.d.WORKFLOW_VERSION:return $b.TAB_VIEWPORT;case o.d.IFRAME:case o.d.RECORD_TABLE:case o.d.MESSAGE_CAMPAIGN_DETAILS:case o.d.FIELD:case o.d.FIELDS:case o.d.FORM_FIELD:case o.d.FIELD_RICH_TEXT:case o.d.FRONT_COMPONENT:case o.d.GRAPH:case o.d.STANDALONE_RICH_TEXT:case o.d.VIEW:return $b.FIT_CONTENT}},tx=({map:e,maxEntries:t,minEvict:r=0,recencyOf:i,matches:a})=>{if(!n.t(a)){if(e.size<=t)return 0;if(!n.t(i)){let n=Math.min(e.size,Math.max(r,e.size-t)),i=e.keys();for(let t=0;t<n;t+=1){let t=i.next();if(t.done)break;e.delete(t.value)}return n}}let o=[];for(let t of e)(!n.t(a)||a(t[0]))&&o.push(t);if(o.length<=t)return 0;n.t(i)&&o.sort((e,t)=>i(e[1])-i(t[1]));let s=Math.min(o.length,Math.max(r,o.length-t));for(let[t]of o.slice(0,s))e.delete(t);return s},nx=({map:e,key:t})=>{let n=e.get(t);if(!(0,y.isUndefined)(n))return e.delete(t),e.set(t,n),n},rx=({map:e,key:t,value:n,maxEntries:r})=>{e.delete(t),e.set(t,n),tx({map:e,maxEntries:r})},ix=({compute:e,maxEntries:t})=>{let r=new Map;return i=>{let a=nx({map:r,key:i});if(n.t(a))return a;let o=e(i);return rx({map:r,key:i,value:o,maxEntries:t}),o}},ax=e=>{try{return _b.Instant.from(e).toZonedDateTimeISO(`UTC`).toPlainDate()}catch{}try{return _b.PlainDate.from(e)}catch{}throw Error(`Cannot parse date string as PlainDate : "${e}"`)},ox=[`count`,`sum`,`avg`,`min`,`max`],sx=e=>ox.some(t=>t===e),cx=({functionName:e,argumentPaths:t,getToManyRelationName:r})=>{if(!sx(e))return;let[i]=t,a=n.t(i)?r(i):void 0;if(!n.t(a)&&(e===`min`||e===`max`))return;let o=n.t(a)&&(e===`count`?i===a:i!==a);return!n.t(a)||!o||t.length>2?{isValid:!1,functionName:e}:{isValid:!0,functionName:e,relationName:a}},lx=class extends Error{constructor(e){super(e.errorMessage),this.aggregationError=e}},ux=e=>{throw new lx(e)},dx=({instructions:e,toManyRelationNameByPath:t,shouldAllowAggregates:r})=>{let i=[],a=e=>{if(!n.t(e)||e.kind===`value`)return{toManyRelationNames:e?.toManyRelationNames??new Set,hasAggregate:e?.hasAggregate??!1};let r=t.get(e.path);return{toManyRelationNames:new Set(n.t(r)?[r]:[]),hasAggregate:!1}},o=e=>{let t=e.map(a);return{kind:`value`,toManyRelationNames:new Set(t.flatMap(({toManyRelationNames:e})=>[...e])),hasAggregate:t.some(({hasAggregate:e})=>e)}},s=e=>i.splice(Math.max(i.length-e,0),e),c=({functionName:e,argumentEntries:i})=>{let o=cx({functionName:e,argumentPaths:i.map(e=>e.kind===`path`?e.path:void 0),getToManyRelationName:e=>t.get(e)});if(!n.t(o))return;if(!r)return ux({errorMessage:`${e}() reads related records, which only a formula can do`,errorCode:`AGGREGATE_NOT_ALLOWED`,errorParams:{functionName:e}});if(!o.isValid)return ux({errorMessage:`${e}() needs a relation, for example count(tasks) or sum(deals.amount)`,errorCode:`INVALID_AGGREGATE_ARGUMENT`,errorParams:{functionName:e}});let{relationName:s}=o,[,...c]=i;for(let t of c.map(a)){if(t.hasAggregate)return ux({errorMessage:`${e}() cannot contain another aggregate`,errorCode:`NESTED_AGGREGATE`,errorParams:{functionName:e}});let r=[...t.toManyRelationNames].find(e=>e!==s);if(n.t(r))return ux({errorMessage:`The condition of ${e}() cannot read "${r}"`,errorCode:`INVALID_AGGREGATE_ARGUMENT`,errorParams:{functionName:e,relationFieldName:r}})}return{kind:`value`,toManyRelationNames:new Set,hasAggregate:!0}};for(let{type:n,value:a}of e)switch(n){case`IVAR`:i.push({kind:`path`,path:String(a)});break;case`IMEMBER`:{let e=i.pop();i.push(e?.kind===`path`?{kind:`path`,path:`${e.path}.${String(a)}`}:o([e]));break}case`IEXPR`:i.push(o([Array.isArray(a)?dx({instructions:a,toManyRelationNameByPath:t,shouldAllowAggregates:r}):void 0]));break;case`IOP1`:i.push(o(s(1)));break;case`IOP2`:i.push(o(s(2)));break;case`IARRAY`:i.push(o(s(Number(a))));break;case`IFUNCALL`:{let e=s(Number(a)),t=i.pop(),n=t?.kind===`path`?c({functionName:t.path,argumentEntries:e}):void 0;i.push(n??o(e));break}default:i.push(o([]))}return i.pop()},fx=({instructions:e,toManyRelationNameByPath:t,shouldAllowAggregates:r})=>{try{let i=dx({instructions:e,toManyRelationNameByPath:t,shouldAllowAggregates:r}),[a]=i?.kind===`path`?[t.get(i.path)].filter(n.t):[...i?.toManyRelationNames??[]];return n.t(a)?{errorMessage:`"${a}" has many records: read it inside count(), sum(), avg(), min() or max()`,errorCode:`TO_MANY_RELATION_OUTSIDE_AGGREGATE`,errorParams:{fieldName:a}}:null}catch(e){if(e instanceof lx)return e.aggregationError;throw e}},px={isDefined:{minimumArgumentCount:1,maximumArgumentCount:1,signature:`isDefined(value)`,evaluate:Xb},isEmpty:{minimumArgumentCount:1,maximumArgumentCount:1,signature:`isEmpty(value)`,evaluate:Qb},isNonEmptyString:{minimumArgumentCount:1,maximumArgumentCount:1,signature:`isNonEmptyString(value)`,evaluate:e=>(0,y.isNonEmptyString)(e)},includes:{minimumArgumentCount:2,maximumArgumentCount:2,signature:`includes(listOrText, value)`,evaluate:(e,t)=>(Array.isArray(e)||(0,y.isString)(e)&&(0,y.isString)(t))&&e.includes(t)},arrayLength:{minimumArgumentCount:1,maximumArgumentCount:1,signature:`arrayLength(list)`,evaluate:e=>Array.isArray(e)?e.length:0},dateDiff:{minimumArgumentCount:3,maximumArgumentCount:3,signature:`dateDiff(from, to, unit)`,evaluate:Db},dateAdd:{minimumArgumentCount:3,maximumArgumentCount:3,signature:`dateAdd(date, amount, unit)`,evaluate:wb},dateTrunc:{minimumArgumentCount:2,maximumArgumentCount:2,signature:`dateTrunc(date, unit)`,evaluate:Rb},datePart:{minimumArgumentCount:2,maximumArgumentCount:2,signature:`datePart(date, part)`,evaluate:Nb},if:{minimumArgumentCount:3,maximumArgumentCount:3,signature:`if(condition, valueIfTrue, valueIfFalse)`,evaluate:(e,t,n)=>e===!0?t:n},coalesce:{minimumArgumentCount:1,maximumArgumentCount:1/0,signature:`coalesce(value, ...fallbacks)`,evaluate:(...e)=>e.find(Xb)??null},concat:{minimumArgumentCount:1,maximumArgumentCount:1/0,signature:`concat(value, ...values)`,evaluate:(...e)=>e.filter(Xb).join(``)},lower:{minimumArgumentCount:1,maximumArgumentCount:1,signature:`lower(text)`,evaluate:e=>(0,y.isString)(e)?e.toLowerCase():null},upper:{minimumArgumentCount:1,maximumArgumentCount:1,signature:`upper(text)`,evaluate:e=>(0,y.isString)(e)?e.toUpperCase():null},min:{minimumArgumentCount:1,maximumArgumentCount:1/0,signature:`min(number, ...numbers)`,evaluate:(...e)=>Ob({values:e,reduce:Math.min})},max:{minimumArgumentCount:1,maximumArgumentCount:1/0,signature:`max(number, ...numbers)`,evaluate:(...e)=>Ob({values:e,reduce:Math.max})},roundTo:{minimumArgumentCount:2,maximumArgumentCount:2,signature:`roundTo(number, decimals)`,evaluate:(e,t)=>(0,y.isNumber)(e)&&(0,y.isNumber)(t)?kb({value:e,decimals:Math.min(Math.max(Math.trunc(t),0),20)}):null},isInRelativeDateRange:{minimumArgumentCount:4,maximumArgumentCount:4,signature:`isInRelativeDateRange(date, direction, amount, unit)`,evaluate:qb}},mx=e=>e in px,hx={IMEMBER:1,IOP1:1,IOP2:2,IOP3:3},gx=({functionName:e,argumentCount:t})=>{if(!n.t(e)||!mx(e))return;let{minimumArgumentCount:r,maximumArgumentCount:i}=px[e];if(!(t>=r&&t<=i))return{errorMessage:`${e} takes ${r===i?`${r}`:`at least ${r}`} argument(s), but got ${t}`,errorParams:{functionName:e,minimumArgumentCount:r,maximumArgumentCount:i,argumentCount:t}}},_x=e=>{let t=[],r=e=>t.splice(t.length-e,e);for(let{type:i,value:a}of e){if(i===`IEXPR`&&Array.isArray(a)){let e=_x(a);if(n.t(e))return e}if(i===`IVAR`){t.push(String(a));continue}if(i===`IFUNCALL`){let e=Number(a);r(e);let i=gx({functionName:t.pop(),argumentCount:e});if(n.t(i))return i}else r(i===`IARRAY`?Number(a):hx[i]??0);t.push(void 0)}},vx=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*/,yx=/^\d+(?:\.\d+)?/,bx=/^\s+/,xx=[`"`,`'`],Sx=(e,t)=>{let n=e[t];for(let r=t+1;r<e.length;r++){if(e[r]===`\\`){r++;continue}if(e[r]===n)return{type:`string`,end:r+1}}return{type:`unclosedString`,end:e.length}},Cx=(e,t)=>{let r=e[t]??``;if(xx.includes(r))return Sx(e,t);let i=e.slice(t),a=[[`whitespace`,bx],[`number`,yx],[`path`,vx]];for(let[e,r]of a){let a=i.match(r);if(n.t(a))return{type:e,end:t+a[0].length}}return{type:`symbol`,end:t+1}},wx=e=>{let t=[],n=0;for(;n<e.length;){let{type:r,end:i}=Cx(e,n);t.push({type:r,text:e.slice(n,i),start:n,end:i}),n=i}return t},Tx=/Unknown character "(.+)"/,Ex=/^unexpected T[A-Z]+: (.+)$/,Dx=`Expected )`,Ox=`TEOF`,kx=({expression:e,error:t})=>{let r=t instanceof Error?t.message:String(t);if(wx(e).some(e=>e.type===`unclosedString`))return{errorMessage:`A text value is missing its closing quote`,errorCode:`UNCLOSED_TEXT`};if(r.includes(Ox)||r.endsWith(Dx))return{errorMessage:`Expression is incomplete`,errorCode:`INCOMPLETE_EXPRESSION`};let i=r.match(Tx)?.[1]??r.match(Ex)?.[1];return n.t(i)?{errorMessage:`Unexpected "${i}"`,errorCode:`INVALID_SYNTAX`,errorParams:{token:i}}:{errorMessage:`Expression is not valid`,errorCode:`INVALID_SYNTAX`}},Ax=e=>e.some(e=>e.type===`IOP2`?e.value===`[`:e.type===`IEXPR`&&Array.isArray(e.value)&&Ax(e.value)),jx=`INUMBER`,Mx=`IOP1`,Nx=`IOP2`,Px=`IOP3`,Fx=`IVAR`,Ix=`IVARNAME`,Lx=`IFUNCALL`,Rx=`IFUNDEF`,zx=`IEXPR`,Bx=`IEXPREVAL`,Vx=`IMEMBER`,Hx=`IENDSTATEMENT`,Ux=`IARRAY`;function K(e,t){this.type=e,this.value=t??0}K.prototype.toString=function(){switch(this.type){case jx:case Mx:case Nx:case Px:case Fx:case Ix:case Hx:return this.value;case Lx:return`CALL `+this.value;case Rx:return`DEF `+this.value;case Ux:return`ARRAY `+this.value;case Vx:return`.`+this.value;default:return`Invalid Instruction`}};function Wx(e){return new K(Mx,e)}function Gx(e){return new K(Nx,e)}function Kx(e){return new K(Px,e)}function qx(e,t,n,r,i){for(var a=[],o=[],s,c,l,u,d=0;d<e.length;d++){var f=e[d],p=f.type;if(p===jx||p===Ix)Array.isArray(f.value)?a.push.apply(a,qx(f.value.map(function(e){return new K(jx,e)}).concat(new K(Ux,f.value.length)),t,n,r,i)):a.push(f);else if(p===Fx&&Object.hasOwn(i,f.value))f=new K(jx,i[f.value]),a.push(f);else if(p===Nx&&a.length>1)c=a.pop(),s=a.pop(),u=n[f.value],f=new K(jx,u(s.value,c.value)),a.push(f);else if(p===Px&&a.length>2)l=a.pop(),c=a.pop(),s=a.pop(),f.value===`?`?a.push(s.value?c.value:l.value):(u=r[f.value],f=new K(jx,u(s.value,c.value,l.value)),a.push(f));else if(p===Mx&&a.length>0)s=a.pop(),u=t[f.value],f=new K(jx,u(s.value)),a.push(f);else if(p===zx){for(;a.length>0;)o.push(a.shift());o.push(new K(zx,qx(f.value,t,n,r,i)))}else if(p===Vx&&a.length>0)s=a.pop(),a.push(new K(jx,s.value[f.value]));else{for(;a.length>0;)o.push(a.shift());o.push(f)}}for(;a.length>0;)o.push(a.shift());return o}function Jx(e,t,n){for(var r=[],i=0;i<e.length;i++){var a=e[i],o=a.type;if(o===Fx&&a.value===t)for(var s=0;s<n.tokens.length;s++){var c=n.tokens[s],l=c.type===Mx?Wx(c.value):c.type===Nx?Gx(c.value):c.type===Px?Kx(c.value):new K(c.type,c.value);r.push(l)}else o===zx?r.push(new K(zx,Jx(a.value,t,n))):r.push(a)}return r}function Yx(e,t,n){if(Object.values(t.functions).includes(e))return!0;for(let i of Object.values(n))if(typeof i==`object`&&i){for(let n of Object.values(i))if(n===e){let e=Object.freeze({abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,clz32:Math.clz32,cos:Math.cos,exp:Math.exp,floor:Math.floor,imul:Math.imul,fround:Math.fround,f16round:Math.f16round,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,log10:Math.log10,log2:Math.log2,log1p:Math.log1p,expm1:Math.expm1,cosh:Math.cosh,sinh:Math.sinh,tanh:Math.tanh,acosh:Math.acosh,asinh:Math.asinh,atanh:Math.atanh,hypot:Math.hypot,trunc:Math.trunc,sign:Math.sign,cbrt:Math.cbrt});for(var r of Object.getOwnPropertyNames(e))if(e[r]===n)return!0;return Object.values(t.functions).includes(n)}}return!1}function Xx(e,t,n){var r=[],i,a,o,s,c,l;if(Qx(e))return $x(e,n);for(var u=e.length,d=0;d<u;d++){var f=e[d],p=f.type;if(p===jx||p===Ix)r.push(f.value);else if(p===Nx)a=r.pop(),i=r.pop(),f.value===`and`?r.push(i?!!Xx(a,t,n):!1):f.value===`or`?r.push(i?!0:!!Xx(a,t,n)):f.value===`=`?(s=t.binaryOps[f.value],r.push(s(i,Xx(a,t,n),n))):(s=t.binaryOps[f.value],r.push(s($x(i,n),$x(a,n))));else if(p===Px)o=r.pop(),a=r.pop(),i=r.pop(),f.value===`?`?r.push(Xx(i?a:o,t,n)):(s=t.ternaryOps[f.value],r.push(s($x(i,n),$x(a,n),$x(o,n))));else if(p===Fx){if(/^__proto__|prototype|constructor$/.test(f.value))throw Error(`prototype access detected`);if(f.value in t.functions)r.push(t.functions[f.value]);else if(f.value in t.unaryOps&&t.parser.isOperatorEnabled(f.value))r.push(t.unaryOps[f.value]);else{var m=n[f.value];if(m!==void 0){if(typeof m==`function`&&!Yx(m,t,n))throw Error(`Variable references an unallowed function: `+f.value);r.push(m)}else throw Error(`undefined variable: `+f.value)}}else if(p===Mx)i=r.pop(),s=t.unaryOps[f.value],r.push(s($x(i,n)));else if(p===Lx){for(l=f.value,c=[];l-->0;)c.unshift($x(r.pop(),n));if(s=r.pop(),!Yx(s,t,n))throw Error(`Is not an allowed function.`);if(s.apply&&s.call)r.push(s.apply(void 0,c));else throw Error(s+` is not a function`)}else if(p===Rx)r.push((function(){for(var e=r.pop(),i=[],a=f.value;a-->0;)i.unshift(r.pop());var o=r.pop(),s=function(){for(var r=Object.assign({},n),a=0,o=i.length;a<o;a++)r[i[a]]=arguments[a];return Xx(e,t,r)};return t.functions[`lambda_`+t.functions.__counter++]=s,n[o]=s,s})());else if(p===zx)r.push(Zx(f,t));else if(p===Bx)r.push(f);else if(p===Vx){if(i=r.pop(),/^__proto__|prototype|constructor$/.test(f.value))throw Error(`prototype access detected in MEMBER`);if(typeof i==`object`&&typeof i[f.value]==`function`&&!Yx(i[f.value],t,n))throw Error(`Is not an allowed function in MEMBER.`);r.push(i[f.value])}else if(p===Hx)r.pop();else if(p===Ux){for(l=f.value,c=[];l-->0;)c.unshift(r.pop());r.push(c)}else throw Error(`invalid Expression`)}if(r.length>1)throw Error(`invalid Expression (parity)`);return r[0]===0?0:$x(r[0],n)}function Zx(e,t,n){return Qx(e)?e:{type:Bx,value:function(n){return Xx(e.value,t,n)}}}function Qx(e){return e&&e.type===Bx}function $x(e,t){return Qx(e)?e.value(t):e}function eS(e,t){for(var n=[],r,i,a,o,s,c,l=0;l<e.length;l++){var u=e[l],d=u.type;if(d===jx)typeof u.value==`number`&&u.value<0?n.push(`(`+u.value+`)`):Array.isArray(u.value)?n.push(`[`+u.value.map(tS).join(`, `)+`]`):n.push(tS(u.value));else if(d===Nx)i=n.pop(),r=n.pop(),o=u.value,t?o===`^`?n.push(`Math.pow(`+r+`, `+i+`)`):o===`and`?n.push(`(!!`+r+` && !!`+i+`)`):o===`or`?n.push(`(!!`+r+` || !!`+i+`)`):o===`||`?n.push(`(function(a,b){ return Array.isArray(a) && Array.isArray(b) ? a.concat(b) : String(a) + String(b); }((`+r+`),(`+i+`)))`):o===`==`?n.push(`(`+r+` === `+i+`)`):o===`!=`?n.push(`(`+r+` !== `+i+`)`):o===`[`?n.push(r+`[(`+i+`) | 0]`):n.push(`(`+r+` `+o+` `+i+`)`):o===`[`?n.push(r+`[`+i+`]`):n.push(`(`+r+` `+o+` `+i+`)`);else if(d===Px)if(a=n.pop(),i=n.pop(),r=n.pop(),o=u.value,o===`?`)n.push(`(`+r+` ? `+i+` : `+a+`)`);else throw Error(`invalid Expression`);else if(d===Fx||d===Ix)n.push(u.value);else if(d===Mx)r=n.pop(),o=u.value,o===`-`||o===`+`?n.push(`(`+o+r+`)`):t?o===`not`?n.push(`(!`+r+`)`):o===`!`?n.push(`fac(`+r+`)`):n.push(o+`(`+r+`)`):o===`!`?n.push(`(`+r+`!)`):n.push(`(`+o+` `+r+`)`);else if(d===Lx){for(c=u.value,s=[];c-->0;)s.unshift(n.pop());o=n.pop(),n.push(o+`(`+s.join(`, `)+`)`)}else if(d===Rx){for(i=n.pop(),c=u.value,s=[];c-->0;)s.unshift(n.pop());r=n.pop(),t?n.push(`(`+r+` = function(`+s.join(`, `)+`) { return `+i+` })`):n.push(`(`+r+`(`+s.join(`, `)+`) = `+i+`)`)}else if(d===Vx)r=n.pop(),n.push(r+`.`+u.value);else if(d===Ux){for(c=u.value,s=[];c-->0;)s.unshift(n.pop());n.push(`[`+s.join(`, `)+`]`)}else if(d===zx)n.push(`(`+eS(u.value,t)+`)`);else if(d!==Hx)throw Error(`invalid Expression`)}return n.length>1&&(n=t?[n.join(`,`)]:[n.join(`;`)]),String(n[0])}function tS(e){return typeof e==`string`?JSON.stringify(e).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`):e}function nS(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return!0;return!1}function rS(e,t,n){n||={};for(var r=!!n.withMembers,i=null,a=0;a<e.length;a++){var o=e[a];o.type===Fx||o.type===Ix?!r&&!nS(t,o.value)?t.push(o.value):(i===null||nS(t,i)||t.push(i),i=o.value):o.type===Vx&&r&&i!==null?i+=`.`+o.value:o.type===zx?rS(o.value,t,n):i!==null&&(nS(t,i)||t.push(i),i=null)}i!==null&&!nS(t,i)&&t.push(i)}function iS(e,t){this.tokens=e,this.parser=t,this.unaryOps=t.unaryOps,this.binaryOps=t.binaryOps,this.ternaryOps=t.ternaryOps,this.functions=t.functions}iS.prototype.simplify=function(e){return e||={},new iS(qx(this.tokens,this.unaryOps,this.binaryOps,this.ternaryOps,e),this.parser)},iS.prototype.substitute=function(e,t){return t instanceof iS||(t=this.parser.parse(String(t))),new iS(Jx(this.tokens,e,t),this.parser)},iS.prototype.evaluate=function(e){return e||={},Xx(this.tokens,this,e)},iS.prototype.toString=function(){return eS(this.tokens,!1)},iS.prototype.symbols=function(e){e||={};var t=[];return rS(this.tokens,t,e),t},iS.prototype.variables=function(e){e||={};var t=[];rS(this.tokens,t,e);var n=this.functions;return t.filter(function(e){return!(e in n)})},iS.prototype.toJSFunction=function(e,t){var n=this,r=Function(e,`with(this.functions) with (this.ternaryOps) with (this.binaryOps) with (this.unaryOps) { return `+eS(this.simplify(t).tokens,!0)+`; }`);return function(){return r.apply(n,arguments)}};var aS=`TEOF`,q=`TOP`,oS=`TNUMBER`,sS=`TSTRING`,cS=`TPAREN`,lS=`TBRACKET`,uS=`TCOMMA`,dS=`TNAME`,fS=`TSEMICOLON`;function pS(e,t,n){this.type=e,this.value=t,this.index=n}pS.prototype.toString=function(){return this.type+`: `+this.value};function J(e,t){this.pos=0,this.current=null,this.unaryOps=e.unaryOps,this.binaryOps=e.binaryOps,this.ternaryOps=e.ternaryOps,this.consts=e.consts,this.expression=t,this.savedPosition=0,this.savedCurrent=null,this.options=e.options,this.parser=e}J.prototype.newToken=function(e,t,n){return new pS(e,t,n??this.pos)},J.prototype.save=function(){this.savedPosition=this.pos,this.savedCurrent=this.current},J.prototype.restore=function(){this.pos=this.savedPosition,this.current=this.savedCurrent},J.prototype.next=function(){if(this.pos>=this.expression.length)return this.newToken(aS,`EOF`);if(this.isWhitespace()||this.isComment())return this.next();if(this.isRadixInteger()||this.isNumber()||this.isOperator()||this.isString()||this.isParen()||this.isBracket()||this.isComma()||this.isSemicolon()||this.isNamedOp()||this.isConst()||this.isName())return this.current;this.parseError(`Unknown character "`+this.expression.charAt(this.pos)+`"`)},J.prototype.isString=function(){var e=!1,t=this.pos,n=this.expression.charAt(t);if(n===`'`||n===`"`)for(var r=this.expression.indexOf(n,t+1);r>=0&&this.pos<this.expression.length;){if(this.pos=r+1,this.expression.charAt(r-1)!==`\\`){var i=this.expression.substring(t+1,r);this.current=this.newToken(sS,this.unescape(i),t),e=!0;break}r=this.expression.indexOf(n,r+1)}return e},J.prototype.isParen=function(){var e=this.expression.charAt(this.pos);return e===`(`||e===`)`?(this.current=this.newToken(cS,e),this.pos++,!0):!1},J.prototype.isBracket=function(){var e=this.expression.charAt(this.pos);return(e===`[`||e===`]`)&&this.isOperatorEnabled(`[`)?(this.current=this.newToken(lS,e),this.pos++,!0):!1},J.prototype.isComma=function(){return this.expression.charAt(this.pos)===`,`?(this.current=this.newToken(uS,`,`),this.pos++,!0):!1},J.prototype.isSemicolon=function(){return this.expression.charAt(this.pos)===`;`?(this.current=this.newToken(fS,`;`),this.pos++,!0):!1},J.prototype.isConst=function(){for(var e=this.pos,t=e;t<this.expression.length;t++){var n=this.expression.charAt(t);if(n.toUpperCase()===n.toLowerCase()&&(t===this.pos||n!==`_`&&n!==`.`&&(n<`0`||n>`9`)))break}if(t>e){var r=this.expression.substring(e,t);if(r in this.consts)return this.current=this.newToken(oS,this.consts[r]),this.pos+=r.length,!0}return!1},J.prototype.isNamedOp=function(){for(var e=this.pos,t=e;t<this.expression.length;t++){var n=this.expression.charAt(t);if(n.toUpperCase()===n.toLowerCase()&&(t===this.pos||n!==`_`&&(n<`0`||n>`9`)))break}if(t>e){var r=this.expression.substring(e,t);if(this.isOperatorEnabled(r)&&(r in this.binaryOps||r in this.unaryOps||r in this.ternaryOps))return this.current=this.newToken(q,r),this.pos+=r.length,!0}return!1},J.prototype.isName=function(){for(var e=this.pos,t=e,n=!1;t<this.expression.length;t++){var r=this.expression.charAt(t);if(r.toUpperCase()===r.toLowerCase()){if(t===this.pos&&(r===`$`||r===`_`)){r===`_`&&(n=!0);continue}else if(t===this.pos||!n||r!==`_`&&(r<`0`||r>`9`))break}else n=!0}if(n){var i=this.expression.substring(e,t);return this.current=this.newToken(dS,i),this.pos+=i.length,!0}return!1},J.prototype.isWhitespace=function(){for(var e=!1,t=this.expression.charAt(this.pos);(t===` `||t===` `||t===`
|
|
56
|
+
`||t===`\r`)&&(e=!0,this.pos++,!(this.pos>=this.expression.length));)t=this.expression.charAt(this.pos);return e};var mS=/^[0-9a-f]{4}$/i;J.prototype.unescape=function(e){var t=e.indexOf(`\\`);if(t<0)return e;for(var n=e.substring(0,t);t>=0;){var r=e.charAt(++t);switch(r){case`'`:n+=`'`;break;case`"`:n+=`"`;break;case`\\`:n+=`\\`;break;case`/`:n+=`/`;break;case`b`:n+=`\b`;break;case`f`:n+=`\f`;break;case`n`:n+=`
|
|
57
|
+
`;break;case`r`:n+=`\r`;break;case`t`:n+=` `;break;case`u`:var i=e.substring(t+1,t+5);mS.test(i)||this.parseError(`Illegal escape sequence: \\u`+i),n+=String.fromCharCode(parseInt(i,16)),t+=4;break;default:throw this.parseError(`Illegal escape sequence: "\\`+r+`"`)}++t;var a=e.indexOf(`\\`,t);n+=e.substring(t,a<0?e.length:a),t=a}return n},J.prototype.isComment=function(){return this.expression.charAt(this.pos)===`/`&&this.expression.charAt(this.pos+1)===`*`?(this.pos=this.expression.indexOf(`*/`,this.pos)+2,this.pos===1&&(this.pos=this.expression.length),!0):!1},J.prototype.isRadixInteger=function(){var e=this.pos;if(e>=this.expression.length-2||this.expression.charAt(e)!==`0`)return!1;++e;var t,n;if(this.expression.charAt(e)===`x`)t=16,n=/^[0-9a-f]$/i,++e;else if(this.expression.charAt(e)===`b`)t=2,n=/^[01]$/i,++e;else return!1;for(var r=!1,i=e;e<this.expression.length;){var a=this.expression.charAt(e);if(n.test(a))e++,r=!0;else break}return r&&(this.current=this.newToken(oS,parseInt(this.expression.substring(i,e),t)),this.pos=e),r},J.prototype.isNumber=function(){for(var e=!1,t=this.pos,n=t,r=t,i=!1,a=!1,o;t<this.expression.length&&(o=this.expression.charAt(t),o>=`0`&&o<=`9`||!i&&o===`.`);)o===`.`?i=!0:a=!0,t++,e=a;if(e&&(r=t),o===`e`||o===`E`){t++;for(var s=!0,c=!1;t<this.expression.length;){if(o=this.expression.charAt(t),s&&(o===`+`||o===`-`))s=!1;else if(o>=`0`&&o<=`9`)c=!0,s=!1;else break;t++}c||(t=r)}return e?(this.current=this.newToken(oS,parseFloat(this.expression.substring(n,t))),this.pos=t):this.pos=r,e},J.prototype.isOperator=function(){var e=this.pos,t=this.expression.charAt(this.pos);if(t===`+`||t===`-`||t===`*`||t===`/`||t===`%`||t===`^`||t===`?`||t===`:`||t===`.`)this.current=this.newToken(q,t);else if(t===`∙`||t===`•`)this.current=this.newToken(q,`*`);else if(t===`>`)this.expression.charAt(this.pos+1)===`=`?(this.current=this.newToken(q,`>=`),this.pos++):this.current=this.newToken(q,`>`);else if(t===`<`)this.expression.charAt(this.pos+1)===`=`?(this.current=this.newToken(q,`<=`),this.pos++):this.current=this.newToken(q,`<`);else if(t===`|`)if(this.expression.charAt(this.pos+1)===`|`)this.current=this.newToken(q,`||`),this.pos++;else return!1;else if(t===`=`)this.expression.charAt(this.pos+1)===`=`?(this.current=this.newToken(q,`==`),this.pos++):this.current=this.newToken(q,t);else if(t===`!`)this.expression.charAt(this.pos+1)===`=`?(this.current=this.newToken(q,`!=`),this.pos++):this.current=this.newToken(q,t);else return!1;return this.pos++,this.isOperatorEnabled(this.current.value)?!0:(this.pos=e,!1)},J.prototype.isOperatorEnabled=function(e){return this.parser.isOperatorEnabled(e)},J.prototype.getCoordinates=function(){var e=0,t,n=-1;do e++,t=this.pos-n,n=this.expression.indexOf(`
|
|
58
|
+
`,n+1);while(n>=0&&n<this.pos);return{line:e,column:t}},J.prototype.parseError=function(e){var t=this.getCoordinates();throw Error(`parse error [`+t.line+`:`+t.column+`]: `+e)};function Y(e,t,n){this.parser=e,this.tokens=t,this.current=null,this.nextToken=null,this.next(),this.savedCurrent=null,this.savedNextToken=null,this.allowMemberAccess=n.allowMemberAccess!==!1}Y.prototype.next=function(){return this.current=this.nextToken,this.nextToken=this.tokens.next()},Y.prototype.tokenMatches=function(e,t){return t===void 0?!0:Array.isArray(t)?nS(t,e.value):typeof t==`function`?t(e):e.value===t},Y.prototype.save=function(){this.savedCurrent=this.current,this.savedNextToken=this.nextToken,this.tokens.save()},Y.prototype.restore=function(){this.tokens.restore(),this.current=this.savedCurrent,this.nextToken=this.savedNextToken},Y.prototype.accept=function(e,t){return this.nextToken.type===e&&this.tokenMatches(this.nextToken,t)?(this.next(),!0):!1},Y.prototype.expect=function(e,t){if(!this.accept(e,t)){var n=this.tokens.getCoordinates();throw Error(`parse error [`+n.line+`:`+n.column+`]: Expected `+(t||e))}},Y.prototype.parseAtom=function(e){var t=this.tokens.unaryOps;function n(e){return e.value in t}if(this.accept(dS)||this.accept(q,n))e.push(new K(Fx,this.current.value));else if(this.accept(oS))e.push(new K(jx,this.current.value));else if(this.accept(sS))e.push(new K(jx,this.current.value));else if(this.accept(cS,`(`))this.parseExpression(e),this.expect(cS,`)`);else if(this.accept(lS,`[`))if(this.accept(lS,`]`))e.push(new K(Ux,0));else{var r=this.parseArrayList(e);e.push(new K(Ux,r))}else throw Error(`unexpected `+this.nextToken)},Y.prototype.parseExpression=function(e){var t=[];this.parseUntilEndStatement(e,t)||(this.parseVariableAssignmentExpression(t),!this.parseUntilEndStatement(e,t)&&this.pushExpression(e,t))},Y.prototype.pushExpression=function(e,t){for(var n=0,r=t.length;n<r;n++)e.push(t[n])},Y.prototype.parseUntilEndStatement=function(e,t){return this.accept(fS)?(this.nextToken&&this.nextToken.type!==aS&&!(this.nextToken.type===cS&&this.nextToken.value===`)`)&&t.push(new K(Hx)),this.nextToken.type!==aS&&this.parseExpression(t),e.push(new K(zx,t)),!0):!1},Y.prototype.parseArrayList=function(e){for(var t=0;!this.accept(lS,`]`);)for(this.parseExpression(e),++t;this.accept(uS);)this.parseExpression(e),++t;return t},Y.prototype.parseVariableAssignmentExpression=function(e){for(this.parseConditionalExpression(e);this.accept(q,`=`);){var t=e.pop(),n=[],r=e.length-1;if(t.type===Lx){if(!this.tokens.isOperatorEnabled(`()=`))throw Error(`function definition is not permitted`);for(var i=0,a=t.value+1;i<a;i++){var o=r-i;e[o].type===Fx&&(e[o]=new K(Ix,e[o].value))}this.parseVariableAssignmentExpression(n),e.push(new K(zx,n)),e.push(new K(Rx,t.value));continue}if(t.type!==Fx&&t.type!==Vx)throw Error(`expected variable for assignment`);this.parseVariableAssignmentExpression(n),e.push(new K(Ix,t.value)),e.push(new K(zx,n)),e.push(Gx(`=`))}},Y.prototype.parseConditionalExpression=function(e){for(this.parseOrExpression(e);this.accept(q,`?`);){var t=[],n=[];this.parseConditionalExpression(t),this.expect(q,`:`),this.parseConditionalExpression(n),e.push(new K(zx,t)),e.push(new K(zx,n)),e.push(Kx(`?`))}},Y.prototype.parseOrExpression=function(e){for(this.parseAndExpression(e);this.accept(q,`or`);){var t=[];this.parseAndExpression(t),e.push(new K(zx,t)),e.push(Gx(`or`))}},Y.prototype.parseAndExpression=function(e){for(this.parseComparison(e);this.accept(q,`and`);){var t=[];this.parseComparison(t),e.push(new K(zx,t)),e.push(Gx(`and`))}};var hS=[`==`,`!=`,`<`,`<=`,`>=`,`>`,`in`];Y.prototype.parseComparison=function(e){for(this.parseAddSub(e);this.accept(q,hS);){var t=this.current;this.parseAddSub(e),e.push(Gx(t.value))}};var gS=[`+`,`-`,`||`];Y.prototype.parseAddSub=function(e){for(this.parseTerm(e);this.accept(q,gS);){var t=this.current;this.parseTerm(e),e.push(Gx(t.value))}};var _S=[`*`,`/`,`%`];Y.prototype.parseTerm=function(e){for(this.parseFactor(e);this.accept(q,_S);){var t=this.current;this.parseFactor(e),e.push(Gx(t.value))}},Y.prototype.parseFactor=function(e){var t=this.tokens.unaryOps;function n(e){return e.value in t}if(this.save(),this.accept(q,n)){if(this.current.value!==`-`&&this.current.value!==`+`){if(this.nextToken.type===cS&&this.nextToken.value===`(`){this.restore(),this.parseExponential(e);return}else if(this.nextToken.type===fS||this.nextToken.type===uS||this.nextToken.type===aS||this.nextToken.type===cS&&this.nextToken.value===`)`){this.restore(),this.parseAtom(e);return}}var r=this.current;this.parseFactor(e),e.push(Wx(r.value))}else this.parseExponential(e)},Y.prototype.parseExponential=function(e){for(this.parsePostfixExpression(e);this.accept(q,`^`);)this.parseFactor(e),e.push(Gx(`^`))},Y.prototype.parsePostfixExpression=function(e){for(this.parseFunctionCall(e);this.accept(q,`!`);)e.push(Wx(`!`))},Y.prototype.parseFunctionCall=function(e){var t=this.tokens.unaryOps;function n(e){return e.value in t}if(this.accept(q,n)){var r=this.current;this.parseAtom(e),e.push(Wx(r.value))}else for(this.parseMemberExpression(e);this.accept(cS,`(`);)if(this.accept(cS,`)`))e.push(new K(Lx,0));else{var i=this.parseArgumentList(e);e.push(new K(Lx,i))}},Y.prototype.parseArgumentList=function(e){for(var t=0;!this.accept(cS,`)`);)for(this.parseExpression(e),++t;this.accept(uS);)this.parseExpression(e),++t;return t},Y.prototype.parseMemberExpression=function(e){for(this.parseAtom(e);this.accept(q,`.`)||this.accept(lS,`[`);){var t=this.current;if(t.value===`.`){if(!this.allowMemberAccess)throw Error(`unexpected ".", member access is not permitted`);this.expect(dS),e.push(new K(Vx,this.current.value))}else if(t.value===`[`){if(!this.tokens.isOperatorEnabled(`[`))throw Error(`unexpected "[]", arrays are disabled`);this.parseExpression(e),this.expect(lS,`]`),e.push(Gx(`[`))}else throw Error(`unexpected symbol: `+t.value)}};function vS(e,t){return Number(e)+Number(t)}function yS(e,t){return e-t}function bS(e,t){return e*t}function xS(e,t){return e/t}function SS(e,t){return e%t}function CS(e,t){return Array.isArray(e)&&Array.isArray(t)?e.concat(t):``+e+t}function wS(e,t){return e===t}function TS(e,t){return e!==t}function ES(e,t){return e>t}function DS(e,t){return e<t}function OS(e,t){return e>=t}function kS(e,t){return e<=t}function AS(e,t){return!!(e&&t)}function jS(e,t){return!!(e||t)}function MS(e,t){return nS(t,e)}function NS(e){return(Math.exp(e)-Math.exp(-e))/2}function PS(e){return(Math.exp(e)+Math.exp(-e))/2}function FS(e){return e===1/0?1:e===-1/0?-1:(Math.exp(e)-Math.exp(-e))/(Math.exp(e)+Math.exp(-e))}function IS(e){return e===-1/0?e:Math.log(e+Math.sqrt(e*e+1))}function LS(e){return Math.log(e+Math.sqrt(e*e-1))}function RS(e){return Math.log((1+e)/(1-e))/2}function zS(e){return Math.log(e)*Math.LOG10E}function BS(e){return-e}function VS(e){return!e}function HS(e){return e<0?Math.ceil(e):Math.floor(e)}function US(e){return Math.random()*(e||1)}function WS(e){return JS(e+1)}function GS(e){return isFinite(e)&&e===Math.round(e)}var KS=4.7421875,qS=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];function JS(e){var t,n;if(GS(e)){if(e<=0)return isFinite(e)?1/0:NaN;if(e>171)return 1/0;for(var r=e-2,i=e-1;r>1;)i*=r,r--;return i===0&&(i=1),i}if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*JS(1-e));if(e>=171.35)return 1/0;if(e>85){var a=e*e,o=a*e,s=o*e,c=s*e;return Math.sqrt(2*Math.PI/e)*(e/Math.E)**+e*(1+1/(12*e)+1/(288*a)-139/(51840*o)-571/(2488320*s)+163879/(209018880*c)+5246819/(75246796800*c*e))}--e,n=qS[0];for(var l=1;l<qS.length;++l)n+=qS[l]/(e+l);return t=e+KS+.5,Math.sqrt(2*Math.PI)*t**+(e+.5)*Math.exp(-t)*n}function YS(e){return Array.isArray(e)?e.length:String(e).length}function XS(){for(var e=0,t=0,n=0;n<arguments.length;n++){var r=Math.abs(arguments[n]),i;t<r?(i=t/r,e=e*i*i+1,t=r):r>0?(i=r/t,e+=i*i):e+=r}return t===1/0?1/0:t*Math.sqrt(e)}function ZS(e,t,n){return e?t:n}function QS(e,t){return t===void 0||+t==0?Math.round(e):(e=+e,t=-+t,isNaN(e)||!(typeof t==`number`&&t%1==0)?NaN:(e=e.toString().split(`e`),e=Math.round(+(e[0]+`e`+(e[1]?+e[1]-t:-t))),e=e.toString().split(`e`),+(e[0]+`e`+(e[1]?+e[1]+t:t))))}function $S(e,t,n){return n&&(n[e]=t),t}function eC(e,t){return e[t|0]}function tC(e){return arguments.length===1&&Array.isArray(e)?Math.max.apply(Math,e):Math.max.apply(Math,arguments)}function nC(e){return arguments.length===1&&Array.isArray(e)?Math.min.apply(Math,e):Math.min.apply(Math,arguments)}function rC(e,t){if(typeof e!=`function`)throw Error(`First argument to map is not a function`);if(!Array.isArray(t))throw Error(`Second argument to map is not an array`);return t.map(function(t,n){return e(t,n)})}function iC(e,t,n){if(typeof e!=`function`)throw Error(`First argument to fold is not a function`);if(!Array.isArray(n))throw Error(`Second argument to fold is not an array`);return n.reduce(function(t,n,r){return e(t,n,r)},t)}function aC(e,t){if(typeof e!=`function`)throw Error(`First argument to filter is not a function`);if(!Array.isArray(t))throw Error(`Second argument to filter is not an array`);return t.filter(function(t,n){return e(t,n)})}function oC(e,t){if(!(Array.isArray(t)||typeof t==`string`))throw Error(`Second argument to indexOf is not a string or array`);return t.indexOf(e)}function sC(e,t){if(!Array.isArray(t))throw Error(`Second argument to join is not an array`);return t.join(e)}function cC(e){return(e>0)-(e<0)||+e}var lC=1/3;function uC(e){return e<0?-((-e)**+lC):e**+lC}function dC(e){return Math.exp(e)-1}function fC(e){return Math.log(1+e)}function pC(e){return Math.log(e)/Math.LN2}function mC(e){if(!Array.isArray(e))throw Error(`Sum argument is not an array`);return e.reduce(function(e,t){return e+Number(t)},0)}function hC(e){this.options=e||{},this.unaryOps={sin:Math.sin,cos:Math.cos,tan:Math.tan,asin:Math.asin,acos:Math.acos,atan:Math.atan,sinh:Math.sinh||NS,cosh:Math.cosh||PS,tanh:Math.tanh||FS,asinh:Math.asinh||IS,acosh:Math.acosh||LS,atanh:Math.atanh||RS,sqrt:Math.sqrt,cbrt:Math.cbrt||uC,log:Math.log,log2:Math.log2||pC,ln:Math.log,lg:Math.log10||zS,log10:Math.log10||zS,expm1:Math.expm1||dC,log1p:Math.log1p||fC,abs:Math.abs,ceil:Math.ceil,floor:Math.floor,round:Math.round,trunc:Math.trunc||HS,"-":BS,"+":Number,exp:Math.exp,not:VS,length:YS,"!":WS,sign:Math.sign||cC},this.binaryOps={"+":vS,"-":yS,"*":bS,"/":xS,"%":SS,"^":Math.pow,"||":CS,"==":wS,"!=":TS,">":ES,"<":DS,">=":OS,"<=":kS,and:AS,or:jS,in:MS,"=":$S,"[":eC},this.ternaryOps={"?":ZS},this.functions={random:US,fac:WS,min:nC,max:tC,hypot:Math.hypot||XS,pyt:Math.hypot||XS,pow:Math.pow,atan2:Math.atan2,if:ZS,gamma:JS,roundTo:QS,map:rC,fold:iC,filter:aC,indexOf:oC,join:sC,sum:mC},this.consts={E:Math.E,PI:Math.PI,true:!0,false:!1}}hC.prototype.parse=function(e){var t=[],n=new Y(this,new J(this,e),{allowMemberAccess:this.options.allowMemberAccess});return n.parseExpression(t),n.expect(aS,`EOF`),new iS(t,this)},hC.prototype.evaluate=function(e,t){return this.parse(e).evaluate(t)};var gC=new hC;hC.parse=function(e){return gC.parse(e)},hC.evaluate=function(e,t){return gC.parse(e).evaluate(t)};var _C={"+":`add`,"-":`subtract`,"*":`multiply`,"/":`divide`,"%":`remainder`,"^":`power`,"!":`factorial`,"<":`comparison`,">":`comparison`,"<=":`comparison`,">=":`comparison`,"==":`comparison`,"!=":`comparison`,"||":`concatenate`,and:`logical`,or:`logical`,not:`logical`,"?":`conditional`,":":`conditional`,"=":`assignment`,"[":`array`,"()=":`fndef`};function vC(e){return Object.hasOwn(_C,e)?_C[e]:e}hC.prototype.isOperatorEnabled=function(e){var t=vC(e),n=this.options.operators||{};return!(t in n)||!!n[t]};var yC=new hC({allowMemberAccess:!0,operators:{add:!0,subtract:!0,multiply:!0,divide:!0,remainder:!0,comparison:!0,concatenate:!0,conditional:!1,logical:!0,in:!0,length:!0,abs:!0,ceil:!0,floor:!0,round:!0,trunc:!0,power:!1,factorial:!1,assignment:!1,fndef:!1,random:!1,min:!1,max:!1,sin:!1,cos:!1,tan:!1,asin:!1,acos:!1,atan:!1,sinh:!1,cosh:!1,tanh:!1,asinh:!1,acosh:!1,atanh:!1,sqrt:!1,cbrt:!1,log:!1,log2:!1,ln:!1,lg:!1,log10:!1,expm1:!1,log1p:!1,exp:!1,sign:!1}});yC.consts={true:!0,false:!1};var bC=e=>{try{return ax(e).toString()}catch{return e}},xC=({value:e,otherValue:t})=>{if((0,y.isString)(e)&&(0,y.isString)(t)&&kc(t))return bC(e);if((0,y.isString)(e)&&(0,y.isString)(t)){let r=bb(e),i=bb(t);if(n.t(r)&&n.t(i)&&!r.isDateOnly&&!i.isDateOnly)return r.dateTime.epochNanoseconds}return e},SC=e=>(t,n)=>Xb(t)&&Xb(n)&&e(xC({value:t,otherValue:n}),xC({value:n,otherValue:t})),CC=({left:e,right:t})=>(0,y.isString)(e)&&(0,y.isString)(t)?xC({value:e,otherValue:t})===xC({value:t,otherValue:e}):e===t;yC.binaryOps[`==`]=(e,t)=>CC({left:e,right:t}),yC.binaryOps[`!=`]=(e,t)=>!CC({left:e,right:t}),yC.binaryOps[`<`]=SC((e,t)=>e<t),yC.binaryOps[`<=`]=SC((e,t)=>e<=t),yC.binaryOps[`>`]=SC((e,t)=>e>t),yC.binaryOps[`>=`]=SC((e,t)=>e>=t),yC.binaryOps.in=(e,t)=>Array.isArray(t)&&t.includes(e);var wC=e=>Xb(e)?e:``;yC.binaryOps[`||`]=(e,t)=>Array.isArray(e)&&Array.isArray(t)?[...e,...t]:`${wC(e)}${wC(t)}`,yC.unaryOps.length=e=>Array.isArray(e)?e.length:Xb(e)?[...String(e)].length:0;var TC=()=>null;yC.functions={...Object.fromEntries(ox.map(e=>[e,TC])),...Object.fromEntries(Object.entries(px).map(([e,{evaluate:t}])=>[e,t]))};var EC=ix({compute:e=>yC.parse(e),maxEntries:500}),DC,OC=new Uint8Array(16);function kC(){if(!DC){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);DC=crypto.getRandomValues.bind(crypto)}return DC(OC)}var AC={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function jC(e,t,n){if(AC.randomUUID&&!t&&!e)return AC.randomUUID();e||={};let r=e.random??e.rng?.()??kC();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return a.r(r)}var MC=function(e){return e.EMAIL=`EMAIL`,e.CALENDAR=`CALENDAR`,e.WORKFLOW=`WORKFLOW`,e.AGENT=`AGENT`,e.API=`API`,e.IMPORT=`IMPORT`,e.MANUAL=`MANUAL`,e.SYSTEM=`SYSTEM`,e.WEBHOOK=`WEBHOOK`,e.APPLICATION=`APPLICATION`,e}({}),NC={type:a.a.ACTOR,properties:[{name:`source`,type:a.a.SELECT,hidden:!1,isRequired:!0,options:Object.keys(MC).map((e,t)=>({id:jC(),label:`${MC[e].toLowerCase()}`,value:e,position:t}))},{name:`workspaceMemberId`,type:a.a.UUID,hidden:`input`,isRequired:!1},{name:`name`,type:a.a.TEXT,hidden:`input`,isRequired:!0},{name:`context`,type:a.a.RAW_JSON,hidden:!1,isRequired:!1}]},PC={type:a.a.ADDRESS,properties:[{name:`addressStreet1`,type:a.a.TEXT,hidden:!1,isRequired:!1},{name:`addressStreet2`,type:a.a.TEXT,hidden:!1,isRequired:!1},{name:`addressCity`,type:a.a.TEXT,hidden:!1,isRequired:!1},{name:`addressPostcode`,type:a.a.TEXT,hidden:!1,isRequired:!1},{name:`addressState`,type:a.a.TEXT,hidden:!1,isRequired:!1},{name:`addressCountry`,type:a.a.TEXT,hidden:!1,isRequired:!1},{name:`addressLat`,type:a.a.NUMERIC,hidden:!1,isRequired:!1},{name:`addressLng`,type:a.a.NUMERIC,hidden:!1,isRequired:!1}]},FC={type:a.a.CURRENCY,properties:[{name:`amountMicros`,type:a.a.NUMERIC,hidden:!1,isRequired:!1},{name:`currencyCode`,type:a.a.TEXT,hidden:!1,isRequired:!1}]},IC={type:a.a.EMAILS,properties:[{name:`primaryEmail`,type:a.a.TEXT,hidden:!1,isRequired:!1,isIncludedInUniqueConstraint:!0},{name:`additionalEmails`,type:a.a.RAW_JSON,hidden:!1,isRequired:!1}]},LC={type:a.a.FULL_NAME,properties:[{name:`firstName`,type:a.a.TEXT,hidden:!1,isRequired:!1,isIncludedInUniqueConstraint:!1},{name:`lastName`,type:a.a.TEXT,hidden:!1,isRequired:!1,isIncludedInUniqueConstraint:!1}]},RC={type:a.a.LINKS,properties:[{name:`primaryLinkLabel`,type:a.a.TEXT,hidden:!1,isRequired:!1},{name:`primaryLinkUrl`,type:a.a.TEXT,hidden:!1,isRequired:!1,isIncludedInUniqueConstraint:!0},{name:`secondaryLinks`,type:a.a.RAW_JSON,hidden:!1,isRequired:!1}]},zC={type:a.a.PHONES,properties:[{name:`primaryPhoneNumber`,type:a.a.TEXT,hidden:!1,isRequired:!1,isIncludedInUniqueConstraint:!0},{name:`primaryPhoneCountryCode`,type:a.a.TEXT,hidden:!1,isRequired:!1,isIncludedInUniqueConstraint:!0},{name:`primaryPhoneCallingCode`,type:a.a.TEXT,hidden:!1,isRequired:!1,isIncludedInUniqueConstraint:!0},{name:`additionalPhones`,type:a.a.RAW_JSON,hidden:!1,isRequired:!1}]},BC={type:a.a.RICH_TEXT,properties:[{name:`blocknote`,deprecationReason:`Use markdown or tiptap instead. This value is cleared whenever the field is written in another format.`,type:a.a.TEXT,hidden:!1,isRequired:!1},{name:`markdown`,type:a.a.TEXT,hidden:!1,isRequired:!1},{name:`tiptap`,type:a.a.TEXT,hidden:!1,isRequired:!1}]};Bs({tiptap:os().nullable().optional(),markdown:os().nullable().optional(),blocknote:os().nullable().optional()});var VC=new Map([[a.a.LINKS,RC],[a.a.CURRENCY,FC],[a.a.FULL_NAME,LC],[a.a.ADDRESS,PC],[a.a.ACTOR,NC],[a.a.EMAILS,IC],[a.a.PHONES,zC],[a.a.RICH_TEXT,BC]]),HC=`previous`,UC=({field:e,subfieldSegments:t,path:r})=>{if(t.length===0)return null;let i=VC.get(e.type);if(!n.t(i)||t.length>1)return{errorMessage:`"${r}" goes deeper than the field "${e.name}" allows`,errorCode:`SUBFIELD_TOO_DEEP`,errorParams:{path:r,fieldName:e.name}};let a=t[0];return i.properties.some(e=>e.name===a)?null:{errorMessage:`"${a}" is not a subfield of "${e.name}"`,errorCode:`UNKNOWN_SUBFIELD`,errorParams:{subfieldName:a,fieldName:e.name}}},WC=e=>({errorMessage:`"${e}" is not a value`,errorCode:`NOT_A_VALUE`,errorParams:{path:e}}),GC=({path:e,memberSegments:t,fields:r})=>{let[i,...o]=t;if(!n.t(i))return{isResolved:!1,...WC(e)};let s=r.find(e=>e.name===i);if(!n.t(s))return{isResolved:!1,errorMessage:`Unknown field "${i}"`,errorCode:`UNKNOWN_FIELD`,errorParams:{fieldName:i}};if(s.type===a.a.RELATION||s.type===a.a.MORPH_RELATION)return{isResolved:!1,errorMessage:`"${e}" reads a relation, but previous values only cover this record's own fields`,errorCode:`PREVIOUS_VALUE_OF_RELATION`,errorParams:{path:e}};let c=UC({field:s,subfieldSegments:o,path:e});return n.t(c)?{isResolved:!1,...c}:{isResolved:!0,bindings:{[`${HC}.${i}`]:s.universalIdentifier}}},KC=({path:e,fields:t})=>{let[r,...i]=e.split(`.`);if(!n.t(r))return{isResolved:!1,...WC(e)};if(r===`now`)return i.length===0?{isResolved:!0,bindings:{}}:{isResolved:!1,...WC(e)};if(r===`previous`)return GC({path:e,memberSegments:i,fields:t});let o=t.find(e=>e.name===r);if(!n.t(o))return{isResolved:!1,errorMessage:`Unknown field "${r}"`,errorCode:`UNKNOWN_FIELD`,errorParams:{fieldName:r}};if(!(o.type===a.a.RELATION||o.type===a.a.MORPH_RELATION)){let t=UC({field:o,subfieldSegments:i,path:e});return n.t(t)?{isResolved:!1,...t}:{isResolved:!0,bindings:{[r]:o.universalIdentifier}}}let s=o.type===a.a.RELATION&&o.relationType===a.i.ONE_TO_MANY;if(!(o.type===a.a.RELATION&&(o.relationType===a.i.MANY_TO_ONE||s))||!n.t(o.relationTargetFields))return{isResolved:!1,errorMessage:`"${r}" is not a to-one relation`,errorCode:`NOT_A_TO_ONE_RELATION`,errorParams:{fieldName:r}};let c=s?r:void 0,[l,...u]=i;if(!n.t(l))return{isResolved:!0,bindings:{[r]:o.universalIdentifier},toManyRelationName:c};let d=o.relationTargetFields.find(e=>e.name===l);if(!n.t(d))return{isResolved:!1,errorMessage:`Unknown field "${l}" on "${r}"`,errorCode:`UNKNOWN_RELATION_TARGET_FIELD`,errorParams:{fieldName:l,relationFieldName:r}};if(d.type===a.a.RELATION||d.type===a.a.MORPH_RELATION)return{isResolved:!1,errorMessage:`"${e}" goes more than one relation deep`,errorCode:`RELATION_TOO_DEEP`,errorParams:{path:e}};let f=UC({field:d,subfieldSegments:u,path:e});return n.t(f)?{isResolved:!1,...f}:{isResolved:!0,bindings:{[r]:o.universalIdentifier,[`${r}.${l}`]:d.universalIdentifier},toManyRelationName:c}},qC=2e3,JC=({expression:e,fields:t,shouldAllowAggregates:r=!1})=>{if(e.trim().length===0)return{isValid:!1,errorMessage:`Expression is empty`,errorCode:`EMPTY_EXPRESSION`};if(e.length>2e3)return{isValid:!1,errorMessage:`Expression is longer than ${qC} characters`,errorCode:`EXPRESSION_TOO_LONG`,errorParams:{maxLength:qC}};let i;try{i=EC(e)}catch(t){return{isValid:!1,...kx({expression:e,error:t})}}if(Ax(i.tokens))return{isValid:!1,errorMessage:`Bracket access is not supported, use dot access instead`,errorCode:`BRACKET_ACCESS`};let a=wx(e).filter(e=>e.type!==`whitespace`),o=a.findIndex((e,t)=>e.type===`symbol`&&e.text===`.`&&a[t-1]?.type===`path`&&a[t+1]?.type===`path`);if(o!==-1){let e=`${a[o-1]?.text}.${a[o+1]?.text}`;return{isValid:!1,errorMessage:`Write ${e} without spaces around the dot`,errorCode:`SPACED_MEMBER_DOT`,errorParams:{path:e}}}let s=_x(i.tokens);if(n.t(s))return{isValid:!1,errorCode:`WRONG_ARGUMENT_COUNT`,...s};let c=i.variables({withMembers:!0}),l={},u=new Map;for(let e of c){let r=KC({path:e,fields:t});if(!r.isResolved)return{isValid:!1,errorMessage:r.errorMessage,errorCode:r.errorCode,errorParams:r.errorParams};l={...l,...r.bindings},n.t(r.toManyRelationName)&&u.set(e,r.toManyRelationName)}let d=fx({instructions:i.tokens,toManyRelationNameByPath:u,shouldAllowAggregates:r});return n.t(d)?{isValid:!1,...d}:{isValid:!0,bindings:l}},YC=e=>e.startsWith(`${HC}.`),XC=e=>YC(e)?e.slice(HC.length+1):null,ZC=(e,t)=>n.t(e)?e instanceof Date?e.toISOString():e:t?.type!==a.a.BOOLEAN&&null,QC=e=>i.t(e)&&!(e instanceof Date),$C=(e,t)=>{n.t(t)&&QC(e)&&VC.has(t.type)&&Yb.set(e,t.type)},ew=(e,t,r)=>{let i=e[t];if(!n.t(i)){let n={};return Jb.add(n),r.add(n),e[t]=n,n}if(!QC(i))return null;if(r.has(i))return i;let a={...i},o=Yb.get(i);return n.t(o)&&Yb.set(a,o),r.add(a),e[t]=a,a},tw=({record:e,previousRecord:t,fieldByName:r,identifierPaths:i,now:a,isPreviousRecordContext:o=!1})=>{let s={},c=new WeakSet,l=o?[]:i.map(XC).filter(n.t);l.length>0&&(s.previous=tw({record:t??{},fieldByName:n.t(t)?r:new Map,identifierPaths:l,now:a,isPreviousRecordContext:!0}));for(let t of i){let i=t.split(`.`),[l]=i;if(!n.t(l))continue;if(!o){if(l===`previous`)continue;if(l===`now`){s.now=a;continue}}let u=r.get(l);if(!(l in s)){let t=ZC(e[l],u);$C(t,u),s[l]=t}let d=s;for(let[e,t]of i.entries()){if(!n.t(d))break;if(e===i.length-1){d[t]=ZC(d[t],e===0?u:u?.relationTargetFields?.find(e=>e.name===t));break}d=ew(d,t,c);let r=i[e+1];if(e===0&&n.t(d)&&n.t(r)){let e=u?.relationTargetFields?.find(e=>e.name===r);$C(d[r],e)}}}return s},nw=({now:e,run:t})=>{let n=Wb.current;Wb.current=e;try{return t()}finally{Wb.current=n}},rw=e=>e instanceof Error?e.message:String(e),iw=e=>{try{return{isValid:!0,parsedExpression:EC(e)}}catch(e){return{isValid:!1,errorMessage:rw(e)}}},aw=({expression:e,fields:t})=>{let n=iw(e);if(!n.isValid){let{errorMessage:e}=n;return()=>({status:`errored`,errorMessage:e})}let{parsedExpression:r}=n,i=r.variables({withMembers:!0}),a=new Map(t.map(e=>[e.name,e]));return({record:e,previousRecord:t,now:n})=>{try{return{status:`evaluated`,value:nw({now:n,run:()=>r.evaluate(tw({record:e,previousRecord:t,fieldByName:a,identifierPaths:i,now:n}))})}}catch(e){return e instanceof bc&&(e.code===`INVALID_DATE_UNIT`||e.code===`INVALID_DATE_PART`)?{status:`errored`,errorMessage:e.message,errorCode:e.code}:{status:`errored`,errorMessage:rw(e)}}}},ow=[o.u.IS_EMPTY,o.u.IS_NOT_EMPTY],sw={CURRENCY:{currencyCode:[o.u.IS,o.u.IS_NOT,...ow],amountMicros:[o.u.GREATER_THAN_OR_EQUAL,o.u.LESS_THAN_OR_EQUAL,o.u.IS,o.u.IS_NOT,...ow]}},X=[o.u.IS_EMPTY,o.u.IS_NOT_EMPTY],cw=[o.u.IS,o.u.IS_NOT],lw={TEXT:[o.u.CONTAINS,o.u.DOES_NOT_CONTAIN,o.u.IS,o.u.IS_NOT,...X],EMAILS:[o.u.CONTAINS,o.u.DOES_NOT_CONTAIN,...X],FULL_NAME:[o.u.CONTAINS,o.u.DOES_NOT_CONTAIN,...X],ADDRESS:[o.u.CONTAINS,o.u.DOES_NOT_CONTAIN,...X],LINKS:[o.u.CONTAINS,o.u.DOES_NOT_CONTAIN,...X],PHONES:[o.u.CONTAINS,o.u.DOES_NOT_CONTAIN,...X],CURRENCY:[o.u.GREATER_THAN_OR_EQUAL,o.u.LESS_THAN_OR_EQUAL,...X],NUMBER:[o.u.IS,o.u.IS_NOT,o.u.GREATER_THAN_OR_EQUAL,o.u.LESS_THAN_OR_EQUAL,...X],RAW_JSON:[o.u.CONTAINS,o.u.DOES_NOT_CONTAIN,...X],FILES:[o.u.CONTAINS,o.u.DOES_NOT_CONTAIN,...X],DATE_TIME:[o.u.IS,o.u.IS_RELATIVE,o.u.IS_IN_PAST,o.u.IS_IN_FUTURE,o.u.IS_TODAY,o.u.IS_BEFORE,o.u.IS_AFTER,...X],DATE:[o.u.IS,o.u.IS_RELATIVE,o.u.IS_IN_PAST,o.u.IS_IN_FUTURE,o.u.IS_TODAY,o.u.IS_BEFORE,o.u.IS_AFTER,...X],RATING:[o.u.IS,o.u.IS_NOT,o.u.GREATER_THAN_OR_EQUAL,o.u.LESS_THAN_OR_EQUAL,...X],RELATION:[...cw,...X],MULTI_SELECT:[o.u.CONTAINS,o.u.DOES_NOT_CONTAIN,...X],SELECT:[o.u.IS,o.u.IS_NOT,...X],ACTOR:[o.u.CONTAINS,o.u.DOES_NOT_CONTAIN,...X],ARRAY:[o.u.CONTAINS,o.u.DOES_NOT_CONTAIN,...X],BOOLEAN:[o.u.IS],TS_VECTOR:[o.u.VECTOR_SEARCH],UUID:[o.u.IS,o.u.IS_NOT,...X]},uw=[o.u.IS,o.u.IS_NOT,o.u.IS_EMPTY,o.u.IS_NOT_EMPTY],dw=({filterType:e,subFieldName:t})=>e===`CURRENCY`?t===`currencyCode`?sw.CURRENCY.currencyCode:sw.CURRENCY.amountMicros:e===`ACTOR`&&(t===`source`||t===`workspaceMemberId`)?uw:lw[e],fw=({expression:e,fields:t})=>{let n=aw({expression:e,fields:t});return e=>{let t=n(e);return t.status===`errored`?t:typeof t.value==`boolean`?t.value?{status:`passed`}:{status:`failed`}:{status:`errored`,errorMessage:`Expression did not return true or false`,errorCode:`NON_BOOLEAN_RESULT`}}},pw=({expression:e,record:t,previousRecord:n,fields:r,now:i})=>fw({expression:e,fields:r})({record:t,previousRecord:n,now:i}),mw=({expression:e,fields:t})=>{let n=JC({expression:e,fields:t});if(!n.isValid)return n;let r=pw({expression:e,record:{},fields:t,now:new Date().toISOString()});return r.status===`errored`?{isValid:!1,errorMessage:r.errorMessage,errorCode:r.errorCode}:n},hw=[`AGGREGATE_CHART`,`PIE_CHART`,`BAR_CHART`,`LINE_CHART`],gw=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function _w(e){return typeof e==`string`&&gw.test(e)}function vw(e){if(!_w(e))throw TypeError(`Invalid UUID`);let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,t&255,(t=parseInt(e.slice(9,13),16))>>>8,t&255,(t=parseInt(e.slice(14,18),16))>>>8,t&255,(t=parseInt(e.slice(19,23),16))>>>8,t&255,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255)}var Z=[];for(let e=0;e<256;++e)Z.push((e+256).toString(16).slice(1));function yw(e,t=0){return(Z[e[t+0]]+Z[e[t+1]]+Z[e[t+2]]+Z[e[t+3]]+`-`+Z[e[t+4]]+Z[e[t+5]]+`-`+Z[e[t+6]]+Z[e[t+7]]+`-`+Z[e[t+8]]+Z[e[t+9]]+`-`+Z[e[t+10]]+Z[e[t+11]]+Z[e[t+12]]+Z[e[t+13]]+Z[e[t+14]]+Z[e[t+15]]).toLowerCase()}function bw(e){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t}var xw=`6ba7b810-9dad-11d1-80b4-00c04fd430c8`,Sw=`6ba7b811-9dad-11d1-80b4-00c04fd430c8`;function Cw(e,t,n,r,i,a){let o=typeof n==`string`?bw(n):n,s=typeof r==`string`?vw(r):r;if(typeof r==`string`&&(r=vw(r)),r?.length!==16)throw TypeError(`Namespace must be array-like (16 iterable integer values, 0-255)`);let c=new Uint8Array(16+o.length);if(c.set(s),c.set(o,s.length),c=t(c),c[6]=c[6]&15|e,c[8]=c[8]&63|128,i){if(a||=0,a<0||a+16>i.length)throw RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);for(let e=0;e<16;++e)i[a+e]=c[e];return i}return yw(c)}function ww(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^n^r}}function Tw(e,t){return e<<t|e>>>32-t}function Ew(e){let t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520],r=new Uint8Array(e.length+1);r.set(e),r[e.length]=128,e=r;let i=e.length/4+2,a=Math.ceil(i/16),o=Array(a);for(let t=0;t<a;++t){let n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=e[t*64+r*4]<<24|e[t*64+r*4+1]<<16|e[t*64+r*4+2]<<8|e[t*64+r*4+3];o[t]=n}o[a-1][14]=(e.length-1)*8/2**32,o[a-1][14]=Math.floor(o[a-1][14]),o[a-1][15]=(e.length-1)*8&4294967295;for(let e=0;e<a;++e){let r=new Uint32Array(80);for(let t=0;t<16;++t)r[t]=o[e][t];for(let e=16;e<80;++e)r[e]=Tw(r[e-3]^r[e-8]^r[e-14]^r[e-16],1);let i=n[0],a=n[1],s=n[2],c=n[3],l=n[4];for(let e=0;e<80;++e){let n=Math.floor(e/20),o=Tw(i,5)+ww(n,a,s,c)+l+t[n]+r[e]>>>0;l=c,c=s,s=Tw(a,30)>>>0,a=i,i=o}n[0]=n[0]+i>>>0,n[1]=n[1]+a>>>0,n[2]=n[2]+s>>>0,n[3]=n[3]+c>>>0,n[4]=n[4]+l>>>0}return Uint8Array.of(n[0]>>24,n[0]>>16,n[0]>>8,n[0],n[1]>>24,n[1]>>16,n[1]>>8,n[1],n[2]>>24,n[2]>>16,n[2]>>8,n[2],n[3]>>24,n[3]>>16,n[3]>>8,n[3],n[4]>>24,n[4]>>16,n[4]>>8,n[4])}function Dw(e,t,n,r){return Cw(80,Ew,e,t,n,r)}Dw.DNS=xw,Dw.URL=Sw;function Ow(e){if(!_w(e))throw TypeError(`Invalid UUID`);return parseInt(e.slice(14,15),16)}var kw=`a80ff791-b940-4c47-a522-2bb478515415`,Aw=e=>e.type!==a.a.SELECT&&e.type!==a.a.MULTI_SELECT||e.options===void 0||e.options===null?e:{...e,options:e.options.map(t=>({...t,id:t.id??Dw(`${t.label}-${e.universalIdentifier}`,kw)}))},jw=({fields:e,labelIdentifierFieldMetadataUniversalIdentifier:t})=>n.t(t)&&!e.some(e=>e.universalIdentifier===t),Mw=`front-component-shared-dependencies.mjs`,Nw=({objectMetadataApplicationUniversalIdentifier:e,viewUniversalIdentifier:t,name:n})=>a.n({entityNamespace:`viewFieldGroup`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),Pw=({fieldMetadataApplicationUniversalIdentifier:e,viewUniversalIdentifier:t,fieldMetadataUniversalIdentifier:n})=>a.n({entityNamespace:`viewField`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),Fw={default:{w:4,h:4},minimum:{w:2,h:2}},Iw=({pageLayoutTabManifest:e,pageLayoutType:t})=>{let r=e.layoutMode??(t===o.c.STANDALONE_PAGE?o.l.VERTICAL_LIST:o.l.GRID),a=e.widgets??[],s=[];if(!Object.values(o.l).some(e=>e===r))return{status:`fail`,errors:[`Page layout tab "${e.title}" defines unsupported layoutMode "${r}". Expected GRID, VERTICAL_LIST or CANVAS.`]};for(let t of a){let a=[t.heightBehavior,i.t(t.position)&&`heightBehavior`in t.position?t.position.heightBehavior:void 0].filter(n.t);a.length>0&&r!==o.l.VERTICAL_LIST&&s.push(`Page layout widget "${t.title}" defines heightBehavior, but its parent tab "${e.title}" uses ${r}. heightBehavior is only supported for VERTICAL_LIST tabs.`);for(let e of a)Object.values($b).some(t=>t===e)||s.push(`Page layout widget "${t.title}" defines unsupported heightBehavior "${e}". Expected FIT_CONTENT or TAB_VIEWPORT.`)}if(s.length>0)return{status:`fail`,errors:s};let c={...e,layoutMode:r,widgets:a.map(({heightBehavior:e,position:t,gridPosition:i,...a},s)=>{if(n.t(t))return{...a,position:t.layoutMode===o.l.VERTICAL_LIST&&n.t(e)?{...t,heightBehavior:e}:t};if(n.t(i))return{...a,position:{layoutMode:o.l.GRID,...i}};switch(r){case o.l.GRID:return{...a,position:{layoutMode:r,row:0,column:0,rowSpan:Fw.default.h,columnSpan:Fw.default.w}};case o.l.VERTICAL_LIST:return{...a,position:{layoutMode:r,index:s,...n.t(e)?{heightBehavior:e}:{}}};case o.l.CANVAS:return{...a,position:{layoutMode:r}};default:return ne(r)}})};for(let e of c.widgets)e.position.layoutMode!==r&&s.push(`Page layout widget "${e.title}" uses a ${e.position.layoutMode} position, but its parent tab "${c.title}" uses ${r}.`);if(r===o.l.VERTICAL_LIST){let e=c.widgets.filter(({type:e,position:t})=>t.layoutMode===o.l.VERTICAL_LIST&&ex({widgetType:e,heightBehavior:t.heightBehavior})===$b.TAB_VIEWPORT);e.length>1&&s.push(`Page layout tab "${c.title}" can contain only one TAB_VIEWPORT widget.`);let t=e.length===1?e[0]:void 0;n.t(t)&&c.widgets.some(e=>e!==t&&e.position.layoutMode===o.l.VERTICAL_LIST&&t.position.layoutMode===o.l.VERTICAL_LIST&&e.position.index>=t.position.index)&&s.push(`Page layout tab "${c.title}" must place its TAB_VIEWPORT widget last.`)}return s.length>0?{status:`fail`,errors:s}:{status:`success`,pageLayoutTab:c}},Lw=[`canReadObjectRecords`,`canUpdateObjectRecords`,`canSoftDeleteObjectRecords`,`canDestroyObjectRecords`];[...Lw];var Rw={canReadObjectRecords:`canReadAllObjectRecords`,canUpdateObjectRecords:`canUpdateAllObjectRecords`,canSoftDeleteObjectRecords:`canSoftDeleteAllObjectRecords`,canDestroyObjectRecords:`canDestroyAllObjectRecords`},zw=({role:e,objectUniversalIdentifier:t})=>{let n=e.objectPermissions?.find(e=>e.objectUniversalIdentifier===t);return{canReadObjectRecords:n?.canReadObjectRecords??e[Rw.canReadObjectRecords]??!1,canUpdateObjectRecords:n?.canUpdateObjectRecords??e[Rw.canUpdateObjectRecords]??!1,canSoftDeleteObjectRecords:n?.canSoftDeleteObjectRecords??e[Rw.canSoftDeleteObjectRecords]??!1,canDestroyObjectRecords:n?.canDestroyObjectRecords??e[Rw.canDestroyObjectRecords]??!1}},Bw=e=>JSON.stringify(e,(e,t)=>i.t(t)?Object.fromEntries(Object.entries(t).sort(([e],[t])=>e.localeCompare(t))):t),Vw=({groupsByUniversalIdentifier:e,predicateGroupUniversalIdentifier:t})=>{let r=[],i=new Set,a=t;for(;n.t(a)&&!i.has(a);){i.add(a);let t=e.get(a);if(!n.t(t))break;r.push(t.logicalOperator),a=t.parentPredicateGroupUniversalIdentifier}return r},Hw=({role:e,objectUniversalIdentifier:t})=>{let n=new Map((e.rowLevelPermissionPredicateGroups??[]).map(e=>[e.universalIdentifier,e]));return(e.rowLevelPermissionPredicates??[]).filter(e=>e.objectUniversalIdentifier===t).map(e=>Bw({fieldUniversalIdentifier:e.fieldUniversalIdentifier,subFieldName:e.subFieldName??null,operand:e.operand,value:e.value??null,workspaceMemberFieldUniversalIdentifier:e.workspaceMemberFieldUniversalIdentifier??null,workspaceMemberSubFieldName:e.workspaceMemberSubFieldName??null,groupOperatorPath:Vw({groupsByUniversalIdentifier:n,predicateGroupUniversalIdentifier:e.predicateGroupUniversalIdentifier})})).sort()},Uw=function(e){return e.API_KEYS_AND_WEBHOOKS=`API_KEYS_AND_WEBHOOKS`,e.WORKSPACE=`WORKSPACE`,e.WORKSPACE_MEMBERS=`WORKSPACE_MEMBERS`,e.ROLES=`ROLES`,e.DATA_MODEL=`DATA_MODEL`,e.SECURITY=`SECURITY`,e.WORKFLOWS=`WORKFLOWS`,e.IMPERSONATE=`IMPERSONATE`,e.SSO_BYPASS=`SSO_BYPASS`,e.APPLICATIONS=`APPLICATIONS`,e.MARKETPLACE_APPS=`MARKETPLACE_APPS`,e.LAYOUTS=`LAYOUTS`,e.BILLING=`BILLING`,e.AI_SETTINGS=`AI_SETTINGS`,e.AI=`AI`,e.VIEWS=`VIEWS`,e.UPLOAD_FILE=`UPLOAD_FILE`,e.DOWNLOAD_FILE=`DOWNLOAD_FILE`,e.SEND_EMAIL_TOOL=`SEND_EMAIL_TOOL`,e.CREATE_CALENDAR_EVENT_TOOL=`CREATE_CALENDAR_EVENT_TOOL`,e.HTTP_REQUEST_TOOL=`HTTP_REQUEST_TOOL`,e.CODE_INTERPRETER_TOOL=`CODE_INTERPRETER_TOOL`,e.IMPORT_CSV=`IMPORT_CSV`,e.EXPORT_CSV=`EXPORT_CSV`,e.CONNECTED_ACCOUNTS=`CONNECTED_ACCOUNTS`,e.PROFILE_INFORMATION=`PROFILE_INFORMATION`,e.READ_PRIVATE_CHANNELS=`READ_PRIVATE_CHANNELS`,e}({}),Ww=[Uw.AI,Uw.VIEWS,Uw.UPLOAD_FILE,Uw.DOWNLOAD_FILE,Uw.SEND_EMAIL_TOOL,Uw.CREATE_CALENDAR_EVENT_TOOL,Uw.HTTP_REQUEST_TOOL,Uw.IMPORT_CSV,Uw.EXPORT_CSV,Uw.CONNECTED_ACCOUNTS,Uw.PROFILE_INFORMATION,Uw.CODE_INTERPRETER_TOOL].map(e=>o.r[e]),Gw=({roleSignature:e,supersetSignature:t})=>e.length===t.length&&e.every((e,n)=>e===t[n]),Kw=({role:e,superset:t})=>[...Lw.filter(n=>{let r=Rw[n];return e[r]&&!t[r]}).map(e=>({type:`ALL_OBJECT_RECORDS`,action:e})),...e.canUpdateAllSettings&&!t.canUpdateAllSettings?[{type:`ALL_SETTINGS`}]:[],...e.canAccessAllTools&&!t.canAccessAllTools?[{type:`ALL_TOOLS`}]:[]],qw=({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n})=>{let r=new Set([...Ww,...n]),i=new Set(t.permissionFlagUniversalIdentifiers??[]);return[...new Set(e.permissionFlagUniversalIdentifiers??[])].filter(e=>!(r.has(e)?t.canAccessAllTools:t.canUpdateAllSettings)&&!i.has(e)).map(e=>({type:`PERMISSION_FLAG`,permissionFlagUniversalIdentifier:e}))},Jw=({role:e,superset:t})=>[...new Set([...[...e.objectPermissions??[],...t.objectPermissions??[]].map(e=>e.objectUniversalIdentifier),...(t.rowLevelPermissionPredicates??[]).map(e=>e.objectUniversalIdentifier)])].flatMap(n=>{let r=zw({role:e,objectUniversalIdentifier:n}),i=zw({role:t,objectUniversalIdentifier:n}),a=Lw.filter(e=>r[e]&&!i[e]).map(e=>({type:`OBJECT_RECORDS`,objectUniversalIdentifier:n,action:e})),o=Lw.some(e=>r[e]),s=Hw({role:t,objectUniversalIdentifier:n}),c=Hw({role:e,objectUniversalIdentifier:n});return o&&s.length>0&&!Gw({roleSignature:c,supersetSignature:s})?[...a,{type:`ROW_LEVEL_RESTRICTION`,objectUniversalIdentifier:n}]:a}),Yw=({role:e,superset:t})=>(t.fieldPermissions??[]).flatMap(t=>{let{objectUniversalIdentifier:n,fieldUniversalIdentifier:r}=t,i=zw({role:e,objectUniversalIdentifier:n}),a=e.fieldPermissions?.find(e=>e.objectUniversalIdentifier===n&&e.fieldUniversalIdentifier===r),o=t.canReadFieldValue===!1&&i.canReadObjectRecords&&a?.canReadFieldValue!==!1,s=t.canUpdateFieldValue===!1&&i.canUpdateObjectRecords&&a?.canUpdateFieldValue!==!1;return[...o?[{type:`FIELD_VALUE`,objectUniversalIdentifier:n,fieldUniversalIdentifier:r,action:`canReadFieldValue`}]:[],...s?[{type:`FIELD_VALUE`,objectUniversalIdentifier:n,fieldUniversalIdentifier:r,action:`canUpdateFieldValue`}]:[]]}),Xw=({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n})=>[...Kw({role:e,superset:t}),...qw({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n}),...Jw({role:e,superset:t}),...Yw({role:e,superset:t})],Zw=({universalIdentifier:e,deprecatedReference:t})=>e??t?.universalIdentifier,Qw=({authorizeLogicFunction:e,callbackLogicFunction:t,...n})=>({...n,authorizeLogicFunctionUniversalIdentifier:Zw({universalIdentifier:n.authorizeLogicFunctionUniversalIdentifier,deprecatedReference:e}),callbackLogicFunctionUniversalIdentifier:Zw({universalIdentifier:n.callbackLogicFunctionUniversalIdentifier,deprecatedReference:t})}),$w=e=>{let{identifyAccountLogicFunction:t,onConnectLogicFunction:r,onDisconnectLogicFunction:i,...a}=e,o={...a,identifyAccountLogicFunctionUniversalIdentifier:Zw({universalIdentifier:e.identifyAccountLogicFunctionUniversalIdentifier,deprecatedReference:t}),onConnectLogicFunctionUniversalIdentifier:Zw({universalIdentifier:e.onConnectLogicFunctionUniversalIdentifier,deprecatedReference:r}),onDisconnectLogicFunctionUniversalIdentifier:Zw({universalIdentifier:e.onDisconnectLogicFunctionUniversalIdentifier,deprecatedReference:i})};return o.type!==`custom`||!n.t(o.custom)?o:{...o,custom:Qw(o.custom)}},eT=({connectionProvider:e,...t})=>({...t,connectionProviderUniversalIdentifier:Zw({universalIdentifier:t.connectionProviderUniversalIdentifier,deprecatedReference:e})}),tT=({connectionProvider:e,sendMessageLogicFunction:t,markThreadAsReadLogicFunction:n,...r})=>({...r,connectionProviderUniversalIdentifier:Zw({universalIdentifier:r.connectionProviderUniversalIdentifier,deprecatedReference:e}),sendMessageLogicFunctionUniversalIdentifier:Zw({universalIdentifier:r.sendMessageLogicFunctionUniversalIdentifier,deprecatedReference:t}),markThreadAsReadLogicFunctionUniversalIdentifier:Zw({universalIdentifier:r.markThreadAsReadLogicFunctionUniversalIdentifier,deprecatedReference:n})}),nT=e=>n.t(e)?{universalIdentifier:e}:void 0,rT=e=>{let t=$w(e),r={...t,identifyAccountLogicFunction:nT(t.identifyAccountLogicFunctionUniversalIdentifier),onConnectLogicFunction:nT(t.onConnectLogicFunctionUniversalIdentifier),onDisconnectLogicFunction:nT(t.onDisconnectLogicFunctionUniversalIdentifier)};if(r.type!==`custom`||!n.t(r.custom))return r;let{custom:i}=r;return{...r,custom:{...i,authorizeLogicFunction:nT(i.authorizeLogicFunctionUniversalIdentifier),callbackLogicFunction:nT(i.callbackLogicFunctionUniversalIdentifier)}}},iT=e=>n.t(e)?{universalIdentifier:e}:void 0,aT=e=>{let t=eT(e);return{...t,connectionProvider:iT(t.connectionProviderUniversalIdentifier)}},oT=e=>n.t(e)?{universalIdentifier:e}:void 0,sT=e=>{let t=tT(e);return{...t,connectionProvider:oT(t.connectionProviderUniversalIdentifier),sendMessageLogicFunction:oT(t.sendMessageLogicFunctionUniversalIdentifier),markThreadAsReadLogicFunction:oT(t.markThreadAsReadLogicFunctionUniversalIdentifier)}},cT=({objectConfig:e,applicationUniversalIdentifier:t})=>({name:`name`,label:`Name`,description:`Name`,icon:`IconAbc`,isNullable:!0,defaultValue:null,type:a.a.TEXT,universalIdentifier:a.t({applicationUniversalIdentifier:t,objectUniversalIdentifier:e.universalIdentifier,name:`name`})}),lT=({objectConfig:e,applicationUniversalIdentifier:t})=>{let n=(e.fields??[]).map(e=>e.name),r=[...e.fields??[]],i=cT({objectConfig:e,applicationUniversalIdentifier:t}),a=jw({fields:e.fields??[],labelIdentifierFieldMetadataUniversalIdentifier:e.labelIdentifierFieldMetadataUniversalIdentifier});return!n.includes(i.name)&&!a&&r.push(i),{objectFields:r}},uT=({objectConfig:e,applicationUniversalIdentifier:t})=>{let{objectFields:n}=lT({objectConfig:e,applicationUniversalIdentifier:t}),r=e.labelIdentifierFieldMetadataUniversalIdentifier??n.find(e=>e.name===`name`)?.universalIdentifier;return r?{objectManifest:{...e,fields:n.map(Aw),labelIdentifierFieldMetadataUniversalIdentifier:r},errors:[]}:{objectManifest:null,errors:[`No label identifier field found for object ${e.nameSingular}. Please add a field with name "name" to your object.`]}},dT={type:`object`,properties:{}},fT=e=>{let t={type:`unknown`};switch(e.type){case`string`:t.type=`string`;break;case`number`:case`integer`:t.type=`number`;break;case`boolean`:t.type=`boolean`;break;case`array`:t.type=`array`,e.items&&(t.items=fT(e.items));break;case`object`:t.type=`object`,e.properties&&(t.properties=Object.fromEntries(Object.entries(e.properties).map(([e,t])=>[e,fT(t)])));break;case`record`:t.type=`record`;break;case`records`:t.type=`records`;break;default:t.type=`unknown`}return Array.isArray(e.enum)&&(t.enum=e.enum.filter(e=>typeof e==`string`)),e.multiline===!0&&(t.multiline=!0),(0,y.isNonEmptyString)(e.label)&&(t.label=e.label),(0,y.isNonEmptyString)(e.objectUniversalIdentifier)&&(t.objectUniversalIdentifier=e.objectUniversalIdentifier),t},pT=e=>[fT(e)],mT=async e=>{let{getFunctionInputSchema:t}=await Promise.resolve().then(()=>require("./get-function-input-schema-ClPQURr8.cjs")),r=t(e)[0];return r?.type===`object`&&n.t(r.properties)?{type:`object`,properties:r.properties}:dT},hT=async({logicFunctionConfig:e,sourceCode:t,sourcePath:r})=>{let{handler:i,onJobFailure:a,...o}=e,s=o.toolTriggerSettings&&!o.toolTriggerSettings.inputSchema||o.workflowActionTriggerSettings&&!o.workflowActionTriggerSettings.inputSchema?await mT(t):null,c=o.toolTriggerSettings?{...o.toolTriggerSettings,inputSchema:o.toolTriggerSettings.inputSchema??s??void 0}:void 0,l=o.workflowActionTriggerSettings?{...o.workflowActionTriggerSettings,inputSchema:o.workflowActionTriggerSettings.inputSchema??(s?pT(s):void 0)}:void 0;return{...o,...c?{toolTriggerSettings:c}:{},...l?{workflowActionTriggerSettings:l}:{},handlerName:`default.config.handler`,...n.t(a)?{jobFailureHandlerName:`default.config.onJobFailure`}:{},sourceHandlerPath:r,builtHandlerPath:r.replace(/\.tsx?$/,`.mjs`),builtHandlerChecksum:`[default-checksum]`}},gT=({frontComponentConfig:e,sourcePath:t})=>{let{component:n,...r}=e;return{...r,componentName:n.name,sourceComponentPath:t,builtComponentPath:t.replace(/\.tsx?$/,`.mjs`),builtComponentChecksum:``,isHeadless:r.isHeadless??!1}},_T=({roleConfig:e,applicationUniversalIdentifier:t})=>{let{recordsPermissions:r}=e;return n.t(r)?{...e,recordsPermissions:{...r,...n.t(r.objects)?{objects:r.objects.map(n=>({...n,universalIdentifier:n.universalIdentifier??o.o({applicationUniversalIdentifier:t,roleUniversalIdentifier:e.universalIdentifier,objectUniversalIdentifier:n.objectUniversalIdentifier})}))}:{}},permissionFlagUniversalIdentifiers:e.permissionFlagUniversalIdentifiers??[]}:{...e,objectPermissions:(e.objectPermissions??[]).map(n=>({...n,universalIdentifier:n.universalIdentifier??o.o({applicationUniversalIdentifier:t,roleUniversalIdentifier:e.universalIdentifier,objectUniversalIdentifier:n.objectUniversalIdentifier})})),fieldPermissions:(e.fieldPermissions??[]).map(n=>({...n,universalIdentifier:n.universalIdentifier??o.s({applicationUniversalIdentifier:t,roleUniversalIdentifier:e.universalIdentifier,fieldUniversalIdentifier:n.fieldUniversalIdentifier})})),rowLevelPermissionPredicateGroups:e.rowLevelPermissionPredicateGroups??[],rowLevelPermissionPredicates:e.rowLevelPermissionPredicates??[],permissionFlagUniversalIdentifiers:e.permissionFlagUniversalIdentifiers??[]}},vT=[`react`,`react-dom`,`react-dom/client`,`react/jsx-runtime`],yT=[`twenty-ui/primitives/input`,`twenty-ui/primitives/data-display`,`twenty-ui/primitives/feedback`,`twenty-ui/primitives/layout`,`twenty-ui/primitives/navigation`,`twenty-ui/primitives/surfaces`,`twenty-ui/primitives/typography`,`twenty-ui/components/input`,`twenty-ui/icon`,`twenty-ui/theme`,`twenty-ui/style.css`,`twenty-ui/theme-light.css`],bT=[...vT,...yT],xT=({dependencies:e,packageNames:t=[]})=>{let n=new Set([...e,...bT.filter(e=>t.some(t=>e===t||e.startsWith(`${t}/`)))]);return n.has(`react`)&&n.add(`react/jsx-runtime`),[...n].sort()},ST=[`twenty-client-sdk`,`twenty-sdk`],CT=e=>{if(e===void 0)return{errors:[]};if(!Array.isArray(e))return{errors:[`"frontComponentSharedDependencies" in package.json must be an array of package specifiers`]};if(!(0,y.isNonEmptyArray)(e))return{errors:[]};let t=[],n=new Set;for(let r of e){if(!(0,y.isNonEmptyString)(r)){t.push(`"frontComponentSharedDependencies" entries in package.json must be non-empty strings`);continue}if(r.startsWith(`.`)||g.default.posix.isAbsolute(r)||g.default.win32.isAbsolute(r)){t.push(`Shared dependency "${r}" must be a package specifier, not a relative or absolute path`);continue}if(r===`twenty:front-component-shared-dependencies`){t.push(`Shared dependency "${r}" is reserved and cannot be shared`);continue}if(ST.some(e=>r===e||r.startsWith(`${e}/`))){t.push(`Shared dependency "${r}" is already served separately and cannot be shared`);continue}if(n.has(r)){t.push(`Shared dependency "${r}" is declared twice`);continue}n.add(r)}return(0,y.isNonEmptyArray)(t)?{errors:t}:{dependencies:xT({dependencies:[...n]}),errors:[]}},wT=async e=>{let t=v.default.join(e,`package.json`);if(!await u.i(t))return{errors:[]};let{dependencies:r,errors:i}=CT((await u.a(t)).frontComponentSharedDependencies);return n.t(r)?{sharedDependencies:{dependencies:r,builtPath:Mw,builtChecksum:null},errors:[]}:{errors:i}},TT=`pageType.isInSidePanel.isDashboardPageLayoutInEditMode.isLayoutCustomizationModeEnabled.favoriteRecordIds.isSelectAll.hasAnySoftDeleteFilterOnView.numberOfSelectedRecords.objectPermissions.selectedRecords.featureFlags.targetObjectReadPermissions.targetObjectWritePermissions.canImpersonate.canAccessFullAdminPanel.objectMetadataItem.objectMetadataLabel.currentView.isDefined.isNonEmptyString.includes.every.everyDefined.everyEquals.some.someDefined.someEquals.none.noneDefined.noneEquals.someNonEmptyString.includesEvery`.split(`.`),ET=`conditionalAvailabilityExpression`,DT=[`twenty-sdk/define`,`twenty-sdk`],OT=new Set(TT),kT=(e,t)=>{let r=[];for(let i of e.statements){if(!_.default.isImportDeclaration(i)||!_.default.isStringLiteral(i.moduleSpecifier)||!DT.includes(i.moduleSpecifier.text))continue;let a=i.importClause;if(!n.t(a)||a.phaseModifier===_.default.SyntaxKind.TypeKeyword)continue;let o=a.namedBindings;if(n.t(o)){if(_.default.isNamespaceImport(o)){let n=t.getSymbolAtLocation(o.name),i=e=>{_.default.isImportDeclaration(e)||_.default.isTypeNode(e)||(_.default.isPropertyAccessExpression(e)&&_.default.isIdentifier(e.expression)&&t.getSymbolAtLocation(e.expression)===n&&OT.has(e.name.text)&&r.push({importedName:e.name.text,node:e}),_.default.forEachChild(e,i))};i(e);continue}if(_.default.isNamedImports(o))for(let i of o.elements){if(i.isTypeOnly)continue;let a=(i.propertyName??i.name).text;if(OT.has(a)){let o=t.getSymbolAtLocation(i.name),s,c=e=>{if(!(n.t(s)||_.default.isImportDeclaration(e)||_.default.isTypeNode(e))){if(_.default.isIdentifier(e)){let r=_.default.isShorthandPropertyAssignment(e.parent)?t.getShorthandAssignmentValueSymbol(e.parent):t.getSymbolAtLocation(e);n.t(o)&&r===o&&(s=e)}_.default.forEachChild(e,c)}};c(e),n.t(s)&&r.push({importedName:a,node:s})}}}}return r},AT=e=>{let t=!1,n=e=>{if(!t){if((_.default.isPropertyAssignment(e)||_.default.isShorthandPropertyAssignment(e))&&(_.default.isIdentifier(e.name)||_.default.isStringLiteral(e.name))&&e.name.text===ET){t=!0;return}_.default.forEachChild(e,n)}};return n(e),t},jT=(e,t)=>{if(!TT.some(t=>e.includes(t)))return[];let n=_.default.createSourceFile(t,e,_.default.ScriptTarget.Latest,!0,t.endsWith(`.tsx`)?_.default.ScriptKind.TSX:_.default.ScriptKind.TS);if(AT(n))return[];let r={noLib:!0,noResolve:!0},i=_.default.createCompilerHost(r);return i.getSourceFile=e=>e===n.fileName?n:void 0,kT(n,_.default.createProgram([n.fileName],r,i).getTypeChecker()).map(({importedName:e,node:r})=>{let{line:i,character:a}=n.getLineAndCharacterOfPosition(r.getStart(n));return`${t}:${i+1}:${a+1} - "${e}" is a conditional-availability expression variable from twenty-sdk but this file has no ${ET}. These variables can only be used inside a command's ${ET}, not at runtime.`})},MT={id:a.a.UUID,createdAt:a.a.DATE_TIME,updatedAt:a.a.DATE_TIME,deletedAt:a.a.DATE_TIME,createdBy:a.a.ACTOR,updatedBy:a.a.ACTOR,position:a.a.POSITION},Q=({objectUniversalIdentifier:e,fields:t,viewFieldNames:n})=>{let r=o.i({objectMetadataApplicationUniversalIdentifier:f.t,objectUniversalIdentifier:e,viewKey:o.a.INDEX});return{universalIdentifier:r,viewFields:Object.fromEntries(n.map(n=>{let i=t[n];if(i===void 0)throw Error(`Missing field "${n}" for the INDEX view of object ${e}`);return[n,{universalIdentifier:Pw({fieldMetadataApplicationUniversalIdentifier:f.t,viewUniversalIdentifier:r,fieldMetadataUniversalIdentifier:i.universalIdentifier})}]}))}},$=({objectUniversalIdentifier:e,fields:t,viewFieldNames:n,viewFieldGroupNames:r})=>{let i=o.i({objectMetadataApplicationUniversalIdentifier:f.t,objectUniversalIdentifier:e,viewKey:o.a.FIELDS_WIDGET});return{universalIdentifier:i,viewFields:Object.fromEntries(n.map(n=>{let r=t[n];if(r===void 0)throw Error(`Missing field "${n}" for the record-page view of object ${e}`);return[n,{universalIdentifier:Pw({fieldMetadataApplicationUniversalIdentifier:f.t,viewUniversalIdentifier:i,fieldMetadataUniversalIdentifier:r.universalIdentifier})}]})),viewFieldGroups:Object.fromEntries(Object.entries(r).map(([e,t])=>[e,{universalIdentifier:Nw({objectMetadataApplicationUniversalIdentifier:f.t,viewUniversalIdentifier:i,name:t})}]))}},NT={attachment:{universalIdentifier:o.n.attachment,fields:o.t.attachment,morphIds:{targetMorphId:{morphId:o.t.attachment.target.universalIdentifier}},indexes:{taskIdIndex:{universalIdentifier:`b8d4f9a3-0c25-4e7b-9f6a-2d3e4c5b6f70`},noteIdIndex:{universalIdentifier:`9d31ea73-13b6-4e06-84ee-c66c72bf7787`},personIdIndex:{universalIdentifier:`55637a5a-1edc-4351-8d76-d40020bf8944`},companyIdIndex:{universalIdentifier:`4137ba06-184d-438f-b484-080f02a97659`},opportunityIdIndex:{universalIdentifier:`8cc162d1-c127-4981-878d-f78622f8f12d`},dashboardIdIndex:{universalIdentifier:`c10eba2d-ff1a-4eab-9285-50481c12a003`},agentChatThreadIdIndex:{universalIdentifier:`69857371-6ff9-48fa-a9de-db4f71593431`},messageIdIndex:{universalIdentifier:`83c77988-2dc4-4575-bac5-f0f50c05568e`}},views:{allAttachments:Q({objectUniversalIdentifier:o.n.attachment,fields:o.t.attachment,viewFieldNames:[`name`,`file`,`createdBy`,`createdAt`,`targetPerson`,`targetCompany`,`targetOpportunity`,`targetTask`,`targetNote`,`targetDashboard`]}),attachmentRecordPageFields:$({objectUniversalIdentifier:o.n.attachment,fields:o.t.attachment,viewFieldNames:[`createdBy`,`createdAt`],viewFieldGroupNames:{}})}},blocklist:{universalIdentifier:o.n.blocklist,fields:o.t.blocklist,indexes:{workspaceMemberIdIndex:{universalIdentifier:`4daf320e-74d0-4f24-a45a-af3a09d741cb`}},views:{allBlocklists:Q({objectUniversalIdentifier:o.n.blocklist,fields:o.t.blocklist,viewFieldNames:[`handle`,`workspaceMember`,`createdAt`]}),blocklistRecordPageFields:$({objectUniversalIdentifier:o.n.blocklist,fields:o.t.blocklist,viewFieldNames:[`workspaceMember`,`createdAt`,`createdBy`],viewFieldGroupNames:{general:`General`,system:`System`}})}},calendarChannelEventAssociation:{universalIdentifier:o.n.calendarChannelEventAssociation,fields:o.t.calendarChannelEventAssociation,indexes:{calendarChannelIdIndex:{universalIdentifier:`ff6b86c1-3112-4dfa-b734-c4789111a716`},calendarEventIdIndex:{universalIdentifier:`47a3c8d2-9f14-4b6e-8c5d-1a2b3f4e5c69`},eventExternalIdIndex:{universalIdentifier:`b14d63d0-c1ab-470f-927d-9c0c05277caa`},accountOwnerIdIndex:{universalIdentifier:`740776d1-fe14-41b9-80b9-11c610765f0c`}},views:{allCalendarChannelEventAssociations:Q({objectUniversalIdentifier:o.n.calendarChannelEventAssociation,fields:o.t.calendarChannelEventAssociation,viewFieldNames:[`calendarChannelId`,`calendarEvent`,`eventExternalId`,`createdAt`]}),calendarChannelEventAssociationRecordPageFields:$({objectUniversalIdentifier:o.n.calendarChannelEventAssociation,fields:o.t.calendarChannelEventAssociation,viewFieldNames:[`calendarChannelId`,`calendarEvent`,`eventExternalId`,`createdAt`,`createdBy`],viewFieldGroupNames:{general:`General`,system:`System`}})}},calendarEventParticipant:{universalIdentifier:o.n.calendarEventParticipant,fields:o.t.calendarEventParticipant,indexes:{calendarEventIdIndex:{universalIdentifier:`c458ad97-8b95-43de-9003-88eb68576049`},personIdIndex:{universalIdentifier:`30e9b75a-881f-4a85-aaf1-f2d2464be1cf`},workspaceMemberIdIndex:{universalIdentifier:`898aa202-428f-4a7a-a3b3-8f0a17a6658e`}},views:{allCalendarEventParticipants:Q({objectUniversalIdentifier:o.n.calendarEventParticipant,fields:o.t.calendarEventParticipant,viewFieldNames:[`calendarEvent`,`handle`,`displayName`,`isOrganizer`,`responseStatus`,`person`,`workspaceMember`,`createdAt`]}),calendarEventParticipantRecordPageFields:$({objectUniversalIdentifier:o.n.calendarEventParticipant,fields:o.t.calendarEventParticipant,viewFieldNames:[`calendarEvent`,`handle`,`displayName`,`isOrganizer`,`responseStatus`,`person`,`workspaceMember`,`createdAt`,`createdBy`],viewFieldGroupNames:{general:`General`,system:`System`}})}},calendarEvent:{universalIdentifier:o.n.calendarEvent,fields:o.t.calendarEvent,indexes:{iCalUidIndex:{universalIdentifier:`e38d1418-f994-4f0d-b0cd-41d4da240ea0`}},views:{allCalendarEvents:Q({objectUniversalIdentifier:o.n.calendarEvent,fields:o.t.calendarEvent,viewFieldNames:[`title`,`startsAt`,`endsAt`,`isFullDay`,`location`,`conferenceLink`,`isCanceled`,`createdAt`]}),calendarEventRecordPageFields:$({objectUniversalIdentifier:o.n.calendarEvent,fields:o.t.calendarEvent,viewFieldNames:[`title`,`startsAt`,`endsAt`,`isFullDay`,`isCanceled`,`conferenceLink`,`location`,`description`,`calendarEventTargets`,`externalCreatedAt`,`externalUpdatedAt`,`iCalUid`,`conferenceSolution`],viewFieldGroupNames:{general:`General`,system:`System`}})}},calendarEventTarget:{universalIdentifier:o.n.calendarEventTarget,fields:o.t.calendarEventTarget,morphIds:{targetMorphId:{morphId:o.t.calendarEventTarget.target.universalIdentifier}},indexes:{calendarEventIdIndex:{universalIdentifier:`ce1c180c-0236-4673-ad1d-359dddf59f93`},personIdIndex:{universalIdentifier:`f151bc84-ba45-40cb-b064-02ef359ac17b`},companyIdIndex:{universalIdentifier:`30413277-505d-4f08-be38-a56257460f9f`},opportunityIdIndex:{universalIdentifier:`7920092d-281f-473a-8ea4-53c209b36a37`},calendarEventPersonUniqueIndex:{universalIdentifier:`15b9e394-d451-4186-aaf0-612f6be1ea91`},calendarEventCompanyUniqueIndex:{universalIdentifier:`3fa22398-6e7d-47a5-95eb-4971f9d62135`},calendarEventOpportunityUniqueIndex:{universalIdentifier:`c8183b17-5dfe-4e02-8d9d-aef8e54ef07d`}},views:{}},callRecording:{universalIdentifier:o.n.callRecording,fields:o.t.callRecording,indexes:{calendarEventIdIndex:{universalIdentifier:`8be3cc47-9352-4a1b-ad19-bb186bc0865d`}},views:{allCallRecordings:Q({objectUniversalIdentifier:o.n.callRecording,fields:o.t.callRecording,viewFieldNames:[`status`,`recordingRequestStatus`,`title`,`startedAt`]}),callRecordingRecordPageFields:$({objectUniversalIdentifier:o.n.callRecording,fields:o.t.callRecording,viewFieldNames:[`title`,`status`,`recordingRequestStatus`,`startedAt`,`endedAt`,`video`,`audio`,`transcript`,`summary`],viewFieldGroupNames:{general:`General`}})}},company:{universalIdentifier:o.n.company,fields:o.t.company,indexes:{accountOwnerIdIndex:{universalIdentifier:`ec2ebfc9-0c9b-4597-a87d-aa295e2d8bfe`},domainNameUniqueIndex:{universalIdentifier:`dd300c61-f422-467a-91f4-de4f83c4175b`},searchVectorGinIndex:{universalIdentifier:`c3eb62df-2cc1-4cc3-b7aa-e96a4d65c633`}},views:{allCompanies:Q({objectUniversalIdentifier:o.n.company,fields:o.t.company,viewFieldNames:[`name`,`domainName`,`createdBy`,`accountOwner`,`createdAt`,`linkedinLink`,`address`]}),companyRecordPageFields:$({objectUniversalIdentifier:o.n.company,fields:o.t.company,viewFieldNames:[`domainName`,`accountOwner`,`annualRevenue`,`linkedinLink`,`address`,`createdAt`,`createdBy`,`updatedAt`,`updatedBy`,`people`,`taskTargets`,`noteTargets`,`opportunities`,`attachments`,`timelineActivities`],viewFieldGroupNames:{general:`General`,business:`Business`,contact:`Contact`,system:`System`}})}},dashboard:{universalIdentifier:o.n.dashboard,fields:o.t.dashboard,indexes:{searchVectorGinIndex:{universalIdentifier:`e69f71aa-de0f-4b70-845f-7a8369c47928`}},views:{allDashboards:Q({objectUniversalIdentifier:o.n.dashboard,fields:o.t.dashboard,viewFieldNames:[`title`,`createdBy`,`createdAt`,`updatedAt`]})}},messageCampaign:{universalIdentifier:o.n.messageCampaign,fields:o.t.messageCampaign,indexes:{unsubscribeTopicIdIndex:{universalIdentifier:`efe8c20e-d12b-4475-969e-e86e0bbfe444`},listIdIndex:{universalIdentifier:`17bffd6a-714a-458d-a547-f9e2183d9520`},searchVectorGinIndex:{universalIdentifier:`975823ad-9b97-4f39-b2c7-fbd7d77f4bd1`}},views:{allMessageCampaigns:Q({objectUniversalIdentifier:o.n.messageCampaign,fields:o.t.messageCampaign,viewFieldNames:[`name`,`subject`,`status`,`list`,`fromAddress`,`scheduledAt`,`sentAt`,`recipients`,`createdAt`]}),messageCampaignList:{universalIdentifier:`99ca5417-e5e0-4fd4-8e64-67acd7b21e25`,viewFields:{name:{universalIdentifier:`fcda0c3b-7ee3-40dd-b280-da3ff4da5452`},subject:{universalIdentifier:`700087d2-bd10-4ab9-b8a9-b0710146927c`},status:{universalIdentifier:`ff29b192-5a52-42a1-8a1e-1a03d26f5464`},list:{universalIdentifier:`8e28bc70-eaa0-4768-bb13-606571e65ac8`},fromAddress:{universalIdentifier:`b9798ecc-de06-4717-8b42-057181437dbc`},scheduledAt:{universalIdentifier:`caba5417-964d-416c-a5a9-b64ef71e5964`},sentAt:{universalIdentifier:`9d546249-b029-4b01-8389-65a88ae583c8`},recipients:{universalIdentifier:`e065a2d1-1352-4869-b527-58e3c37557c0`},createdAt:{universalIdentifier:`27548f0a-5ed4-4412-b23a-718b99eb697e`}}},messageCampaignRecordPageFields:$({objectUniversalIdentifier:o.n.messageCampaign,fields:o.t.messageCampaign,viewFieldNames:[`status`,`scheduledAt`,`sentAt`,`sentCount`,`deliveredCount`,`failedCount`,`skippedCount`,`bouncedCount`,`complainedCount`,`uniqueClickCount`,`clickRate`,`uniqueOpenCount`,`openRate`],viewFieldGroupNames:{stats:`Stats`}})}},messageList:{universalIdentifier:o.n.messageList,fields:o.t.messageList,indexes:{searchVectorGinIndex:{universalIdentifier:`8e205171-ed74-4620-b7d2-674aab85033a`}},views:{allMessageLists:Q({objectUniversalIdentifier:o.n.messageList,fields:o.t.messageList,viewFieldNames:[`name`,`description`,`members`,`campaigns`,`createdAt`]})}},messageListMember:{universalIdentifier:o.n.messageListMember,fields:o.t.messageListMember,indexes:{listIdIndex:{universalIdentifier:`61188470-6dcb-4b2a-b1a9-baeb688bccae`},personListUniqueIndex:{universalIdentifier:`e5497dc2-1d72-418c-a389-a0645ca0195a`}},views:{allMessageListMembers:Q({objectUniversalIdentifier:o.n.messageListMember,fields:o.t.messageListMember,viewFieldNames:[`id`,`person`,`list`,`createdAt`]})}},messageChannelMessageAssociation:{universalIdentifier:o.n.messageChannelMessageAssociation,fields:o.t.messageChannelMessageAssociation,indexes:{messageChannelIdIndex:{universalIdentifier:`9894f9a3-0225-4e7b-9f6a-23d4e2576784`},messageIdIndex:{universalIdentifier:`9bb24d40-60dd-4beb-8c64-a74e8c67f9ee`},messageChannelIdMessageIdUniqueIndex:{universalIdentifier:`1b86ece8-7ce3-4df3-8771-fd4b5d45b2f2`},accountOwnerIdIndex:{universalIdentifier:`0797b417-8f87-4df1-b838-d85fbb663110`}},views:{allMessageChannelMessageAssociations:Q({objectUniversalIdentifier:o.n.messageChannelMessageAssociation,fields:o.t.messageChannelMessageAssociation,viewFieldNames:[`messageChannelId`,`message`,`messageExternalId`,`direction`,`createdAt`]}),messageChannelMessageAssociationRecordPageFields:$({objectUniversalIdentifier:o.n.messageChannelMessageAssociation,fields:o.t.messageChannelMessageAssociation,viewFieldNames:[`messageChannelId`,`message`,`messageExternalId`,`direction`,`createdAt`,`createdBy`],viewFieldGroupNames:{general:`General`,system:`System`}})}},messageChannelMessageAssociationMessageFolder:{universalIdentifier:o.n.messageChannelMessageAssociationMessageFolder,fields:o.t.messageChannelMessageAssociationMessageFolder,indexes:{messageChannelMessageAssociationIdIndex:{universalIdentifier:`8e6038aa-1f79-4a84-87b5-f33caa172e98`},messageFolderIdIndex:{universalIdentifier:`905299c3-ca81-435d-901c-f68b87562516`},messageChannelMessageAssociationIdMessageFolderIdUniqueIndex:{universalIdentifier:`a3de1788-5dff-4849-ac5a-0dabe5fab216`}},views:{allMessageChannelMessageAssociationMessageFolders:Q({objectUniversalIdentifier:o.n.messageChannelMessageAssociationMessageFolder,fields:o.t.messageChannelMessageAssociationMessageFolder,viewFieldNames:[`messageChannelMessageAssociation`,`messageFolderId`,`createdAt`]}),messageChannelMessageAssociationMessageFolderRecordPageFields:$({objectUniversalIdentifier:o.n.messageChannelMessageAssociationMessageFolder,fields:o.t.messageChannelMessageAssociationMessageFolder,viewFieldNames:[`messageChannelMessageAssociation`,`messageFolderId`,`createdAt`,`createdBy`],viewFieldGroupNames:{general:`General`,system:`System`}})}},messageParticipant:{universalIdentifier:o.n.messageParticipant,fields:o.t.messageParticipant,indexes:{messageIdIndex:{universalIdentifier:`ab0863ba-f95e-493c-b86c-56e1bc7e5bc2`},personIdIndex:{universalIdentifier:`df805c2e-3bfe-4d51-8309-75e5eb4052fe`},workspaceMemberIdIndex:{universalIdentifier:`ce1e3a9e-afe9-439d-abb7-6cc98a6fa405`},messageCampaignIdIndex:{universalIdentifier:`e9bcdd77-cc8b-4532-833c-124dfdc8e5ff`}},views:{allMessageParticipants:Q({objectUniversalIdentifier:o.n.messageParticipant,fields:o.t.messageParticipant,viewFieldNames:[`message`,`role`,`handle`,`displayName`,`person`,`workspaceMember`,`createdAt`]}),messageParticipantRecordPageFields:$({objectUniversalIdentifier:o.n.messageParticipant,fields:o.t.messageParticipant,viewFieldNames:[`message`,`role`,`displayName`,`person`,`workspaceMember`,`createdAt`,`createdBy`],viewFieldGroupNames:{general:`General`,system:`System`}})}},messageThread:{universalIdentifier:o.n.messageThread,fields:o.t.messageThread,indexes:{},views:{allMessageThreads:Q({objectUniversalIdentifier:o.n.messageThread,fields:o.t.messageThread,viewFieldNames:[`subject`,`messages`,`updatedAt`,`createdAt`]})}},messageThreadTarget:{universalIdentifier:o.n.messageThreadTarget,fields:o.t.messageThreadTarget,morphIds:{targetMorphId:{morphId:o.t.messageThreadTarget.target.universalIdentifier}},indexes:{messageThreadIdIndex:{universalIdentifier:`222fdd8b-0863-4f2a-816a-29745537b6b6`},personIdIndex:{universalIdentifier:`280ee419-ac3c-4599-bd62-3e5cb268342c`},companyIdIndex:{universalIdentifier:`b98005e4-3811-41b6-82d0-3ccd27757eba`},opportunityIdIndex:{universalIdentifier:`7679ee05-cf6c-40a7-9ee6-c3e8053caca5`},messageThreadPersonUniqueIndex:{universalIdentifier:`087f97cb-8c3c-4ea1-9556-933acde6c83b`},messageThreadCompanyUniqueIndex:{universalIdentifier:`30d4f1af-8b6f-4685-802f-8a7cf29f318b`},messageThreadOpportunityUniqueIndex:{universalIdentifier:`1dc0e37e-afb1-4e90-90b4-052374126a6a`}},views:{}},message:{universalIdentifier:o.n.message,fields:o.t.message,indexes:{messageThreadIdIndex:{universalIdentifier:`7a05b45e-7aa6-4a7e-9bbc-299cbed53c96`},messageCampaignIdIndex:{universalIdentifier:`79e777ca-7008-46c5-b3a6-3108b7c7dfb6`},headerMessageIdIndex:{universalIdentifier:`0904b3e4-6052-4a8d-bf41-f12a27c7e34a`}},views:{allMessages:Q({objectUniversalIdentifier:o.n.message,fields:o.t.message,viewFieldNames:[`subject`,`messageThread`,`messageParticipants`,`receivedAt`,`headerMessageId`,`text`,`createdAt`]}),messageRecordPageFields:$({objectUniversalIdentifier:o.n.message,fields:o.t.message,viewFieldNames:[`messageThread`,`messageParticipants`,`receivedAt`,`text`,`headerMessageId`,`createdAt`,`createdBy`],viewFieldGroupNames:{general:`General`,system:`System`}})}},note:{universalIdentifier:o.n.note,fields:o.t.note,indexes:{searchVectorGinIndex:{universalIdentifier:`8183c8d2-9114-4b6e-8c5d-12a3b14a5a13`}},views:{allNotes:Q({objectUniversalIdentifier:o.n.note,fields:o.t.note,viewFieldNames:[`title`,`noteTargets`,`bodyV2`,`createdBy`,`createdAt`]}),noteRecordPageFields:$({objectUniversalIdentifier:o.n.note,fields:o.t.note,viewFieldNames:[`noteTargets`,`attachments`,`timelineActivities`],viewFieldGroupNames:{general:`General`}})}},noteTarget:{universalIdentifier:o.n.noteTarget,fields:o.t.noteTarget,morphIds:{targetMorphId:{morphId:o.t.noteTarget.target.universalIdentifier}},indexes:{noteIdIndex:{universalIdentifier:`9294d9e3-0225-4c7f-9d6e-23b4c25b6b24`},personIdIndex:{universalIdentifier:`7c069dc0-e83b-4cd5-aaa2-cac7f3e00d80`},companyIdIndex:{universalIdentifier:`2d83909a-a383-4e82-b00a-8b7739f3f906`},opportunityIdIndex:{universalIdentifier:`0d1a59b4-cc87-4b7d-804a-656e8504f371`},notePersonUniqueIndex:{universalIdentifier:`29be76d1-ff4f-4f0f-b05c-f679a234e90a`},noteCompanyUniqueIndex:{universalIdentifier:`e3b92659-04cf-4496-8fd4-4f32c747c26a`},noteOpportunityUniqueIndex:{universalIdentifier:`58002741-8aa7-4812-b7af-f4cf98dd2433`}},views:{allNoteTargets:Q({objectUniversalIdentifier:o.n.noteTarget,fields:o.t.noteTarget,viewFieldNames:[`id`,`note`,`targetPerson`,`targetCompany`,`targetOpportunity`]})}},opportunity:{universalIdentifier:o.n.opportunity,fields:o.t.opportunity,indexes:{pointOfContactIdIndex:{universalIdentifier:`b8c2a673-a981-4357-a43d-313a358e4daa`},companyIdIndex:{universalIdentifier:`e161072d-37b1-477a-b944-ef0d65289574`},stageIndex:{universalIdentifier:`ae60d580-b562-44f2-a24d-7b8040063f83`},searchVectorGinIndex:{universalIdentifier:`f53fdd28-a26b-47ba-81b5-6813ad622720`}},views:{allOpportunities:Q({objectUniversalIdentifier:o.n.opportunity,fields:o.t.opportunity,viewFieldNames:[`name`,`amount`,`createdBy`,`closeDate`,`company`,`pointOfContact`]}),byStage:{universalIdentifier:`20202020-a004-4a04-8a04-0aa0b1ca1ba0`,viewFields:{name:{universalIdentifier:`20202020-af04-4a04-8a04-0aa0b2ca2baf`},amount:{universalIdentifier:`20202020-af04-4a04-8a04-0aa0b2ca2bb0`},createdBy:{universalIdentifier:`20202020-af04-4a04-8a04-0aa0b2ca2bb1`},closeDate:{universalIdentifier:`20202020-af04-4a04-8a04-0aa0b2ca2bb2`},company:{universalIdentifier:`20202020-af04-4a04-8a04-0aa0b2ca2bb3`},pointOfContact:{universalIdentifier:`20202020-af04-4a04-8a04-0aa0b2ca2bb4`}},viewGroups:{new:{universalIdentifier:`20202020-af14-4a04-8a04-0aa0b2ca2bf1`},screening:{universalIdentifier:`20202020-af14-4a04-8a04-0aa0b2ca2bf2`},meeting:{universalIdentifier:`20202020-af14-4a04-8a04-0aa0b2ca2bf3`},proposal:{universalIdentifier:`20202020-af14-4a04-8a04-0aa0b2ca2bf4`},customer:{universalIdentifier:`20202020-af14-4a04-8a04-0aa0b2ca2bf5`}}},opportunityRecordPageFields:$({objectUniversalIdentifier:o.n.opportunity,fields:o.t.opportunity,viewFieldNames:[`amount`,`closeDate`,`stage`,`company`,`pointOfContact`,`owner`,`createdAt`,`createdBy`,`updatedAt`,`updatedBy`,`taskTargets`,`noteTargets`,`attachments`,`timelineActivities`],viewFieldGroupNames:{deal:`Deal`,relations:`Relations`,system:`System`}})}},person:{universalIdentifier:o.n.person,fields:o.t.person,indexes:{companyIdIndex:{universalIdentifier:`8a265a5c-d3ae-47dc-bdf9-b42cfa2ba639`},emailsUniqueIndex:{universalIdentifier:`8183a8b2-9114-4f6c-8a5b-12e3f14e5e13`},searchVectorGinIndex:{universalIdentifier:`9294b9c3-0225-4a7d-9b6c-23f4a25f6f24`}},views:{allPeople:Q({objectUniversalIdentifier:o.n.person,fields:o.t.person,viewFieldNames:[`name`,`emails`,`createdBy`,`company`,`phones`,`createdAt`,`jobTitle`,`linkedinLink`]}),personRecordPageFields:$({objectUniversalIdentifier:o.n.person,fields:o.t.person,viewFieldNames:[`emails`,`phones`,`company`,`jobTitle`,`linkedinLink`,`avatarUrl`,`createdAt`,`createdBy`,`updatedAt`,`updatedBy`,`avatarFile`,`pointOfContactForOpportunities`,`taskTargets`,`noteTargets`,`attachments`,`messageParticipants`,`calendarEventParticipants`,`timelineActivities`],viewFieldGroupNames:{general:`General`,work:`Work`,social:`Social`,system:`System`}}),messageListRecordPageMembers:{universalIdentifier:`bef79e8e-9ef3-4458-81ed-78a299e2566f`,viewFields:{name:{universalIdentifier:`a4f0d7b4-3956-44a6-8bb2-df45a699609b`},emails:{universalIdentifier:`180e9cbb-34c2-4e27-8648-2915be88a50e`},company:{universalIdentifier:`3db54119-df4d-449b-91c9-22fca1e5d599`}},viewFilters:{listMembershipsListIsCurrentRecord:{universalIdentifier:`256dceea-a9b5-42b7-8461-a6ce62e7fa6c`}}}}},accessGroup:{universalIdentifier:o.n.accessGroup,fields:o.t.accessGroup,indexes:{roleIdIndex:{universalIdentifier:`933f2eee-0856-46fd-b144-ffd4bad7e9c8`},groupHashUniqueIndex:{universalIdentifier:`dcb0d254-43ae-442e-9223-8ac052eddb28`},objectMetadataIdIndex:{universalIdentifier:`60e48c2a-a3db-4f11-b25b-49c7e8a385bc`}},views:{}},recordShare:{universalIdentifier:o.n.recordShare,fields:o.t.recordShare,indexes:{recordPrincipalCauseSourceUniqueIndex:{universalIdentifier:`4580f104-47a7-4110-87a8-26cb6f63ce7b`},principalIdIndex:{universalIdentifier:`66fbc3d2-6126-4e29-a306-dbe9995bf062`},sourceIdIndex:{universalIdentifier:`21b84593-c647-40ce-bdf4-a8b4ac658f57`}},views:{}},shortLink:{universalIdentifier:o.n.shortLink,fields:o.t.shortLink,indexes:{templateAndResolvedUrlHashUniqueIndex:{universalIdentifier:`b1330e3c-bd74-4bd1-a9dc-1ecefe41f199`}},views:{}},task:{universalIdentifier:o.n.task,fields:o.t.task,indexes:{assigneeIdIndex:{universalIdentifier:`f48fa3b1-0cec-44da-a9e5-f8a5e766637e`},searchVectorGinIndex:{universalIdentifier:`a86b32b3-01d3-4302-a152-8b7f247db7b4`}},views:{allTasks:Q({objectUniversalIdentifier:o.n.task,fields:o.t.task,viewFieldNames:[`title`,`status`,`taskTargets`,`createdBy`,`dueAt`,`assignee`,`bodyV2`,`createdAt`]}),assignedToMe:{universalIdentifier:`20202020-a007-4a07-8a07-ba5ca551aaed`,viewFields:{title:{universalIdentifier:`20202020-af07-4a07-8a07-ba5ca551aaed`},taskTargets:{universalIdentifier:`20202020-af07-4a07-8a07-ba5ca551aaee`},createdBy:{universalIdentifier:`20202020-af07-4a07-8a07-ba5ca551aaef`},dueAt:{universalIdentifier:`20202020-af07-4a07-8a07-ba5ca551aaf0`},assignee:{universalIdentifier:`20202020-af07-4a07-8a07-ba5ca551aaf1`},bodyV2:{universalIdentifier:`20202020-af07-4a07-8a07-ba5ca551aaf2`},createdAt:{universalIdentifier:`20202020-af07-4a07-8a07-ba5ca551aaf3`}},viewFilters:{assigneeIsMe:{universalIdentifier:`20202020-af17-4a07-8a07-ba5ca551abf1`}},viewGroups:{todo:{universalIdentifier:`20202020-af17-4a07-8a07-ba5ca551abf2`},inProgress:{universalIdentifier:`20202020-af17-4a07-8a07-ba5ca551abf3`},done:{universalIdentifier:`20202020-af17-4a07-8a07-ba5ca551abf4`},empty:{universalIdentifier:`20202020-af17-4a07-8a07-ba5ca551abf5`}}},byStatus:{universalIdentifier:`20202020-a008-4a08-8a08-ba5cba51aba5`,viewFields:{title:{universalIdentifier:`20202020-af08-4a08-8a08-ba5cba5babf0`},status:{universalIdentifier:`20202020-af08-4a08-8a08-ba5cba5babf1`},dueAt:{universalIdentifier:`20202020-af08-4a08-8a08-ba5cba5babf2`},assignee:{universalIdentifier:`20202020-af08-4a08-8a08-ba5cba5babf3`},createdAt:{universalIdentifier:`20202020-af08-4a08-8a08-ba5cba5babf4`}},viewGroups:{todo:{universalIdentifier:`20202020-af18-4a08-8a08-ba5cba5bbf01`},inProgress:{universalIdentifier:`20202020-af18-4a08-8a08-ba5cba5bbf02`},done:{universalIdentifier:`20202020-af18-4a08-8a08-ba5cba5bbf03`}}},taskRecordPageFields:$({objectUniversalIdentifier:o.n.task,fields:o.t.task,viewFieldNames:[`dueAt`,`status`,`assignee`,`taskTargets`,`attachments`,`timelineActivities`],viewFieldGroupNames:{general:`General`}})}},taskTarget:{universalIdentifier:o.n.taskTarget,fields:o.t.taskTarget,morphIds:{targetMorphId:{morphId:o.t.taskTarget.target.universalIdentifier}},indexes:{taskIdIndex:{universalIdentifier:`c882f7a4-b025-4d32-aa26-5ef2595bdbf9`},personIdIndex:{universalIdentifier:`b7d305d1-6fae-4ed6-9bdc-354fe9032c0e`},companyIdIndex:{universalIdentifier:`c0af54c7-751b-4bb2-b102-677cc4e47402`},opportunityIdIndex:{universalIdentifier:`6942e0ba-90f6-4c33-bf40-7f00b1ec35ab`},taskPersonUniqueIndex:{universalIdentifier:`4adf4d5a-ad69-4c5c-bc62-2807816b3aa8`},taskCompanyUniqueIndex:{universalIdentifier:`637dce5e-f609-49f4-89e3-c0ef9e330d3a`},taskOpportunityUniqueIndex:{universalIdentifier:`eb5422ff-7a41-48d2-a2df-3de1cbf7bced`}},views:{allTaskTargets:Q({objectUniversalIdentifier:o.n.taskTarget,fields:o.t.taskTarget,viewFieldNames:[`id`,`task`,`targetPerson`,`targetCompany`,`targetOpportunity`]})}},timelineActivity:{universalIdentifier:o.n.timelineActivity,fields:o.t.timelineActivity,morphIds:{targetMorphId:{morphId:o.t.timelineActivity.target.universalIdentifier}},indexes:{workspaceMemberIdIndex:{universalIdentifier:`5e0b2391-85ca-4a66-aef4-52d74245bec2`},personIdIndex:{universalIdentifier:`3e89a914-7bec-47bd-9cf9-743c6b83d001`},companyIdIndex:{universalIdentifier:`8183e8f2-9114-4d6a-8e5f-12c3d14c5c13`},opportunityIdIndex:{universalIdentifier:`9294f9a3-0225-4e7b-9f6a-23d4e25d6d24`},noteIdIndex:{universalIdentifier:`995db1d8-0d3e-40f7-b0eb-5e6897bc9966`},taskIdIndex:{universalIdentifier:`609cf622-86ef-48d1-812b-e1cab610a46c`},workflowRunIdIndex:{universalIdentifier:`1a2bd046-7c23-4e0a-9f8a-c3ca3a16d3b9`},dashboardIdIndex:{universalIdentifier:`e8821da9-728d-470a-bf5b-5a981fff7880`},messageListIdIndex:{universalIdentifier:`a251f71a-c698-4526-8817-0e7c803c158e`},messageCampaignIdIndex:{universalIdentifier:`e808e721-91cc-4b9b-b24b-806d64b4d5e2`},linkedRecordIdIndex:{universalIdentifier:`00e9bf50-0e98-4105-8cb7-31c94995ff55`}},views:{allTimelineActivities:Q({objectUniversalIdentifier:o.n.timelineActivity,fields:o.t.timelineActivity,viewFieldNames:[`linkedRecordCachedName`,`happensAt`,`workspaceMember`,`targetPerson`,`targetCompany`,`targetOpportunity`,`targetTask`,`targetNote`,`targetWorkflowRun`,`targetDashboard`]})}},workflowRun:{universalIdentifier:o.n.workflowRun,fields:o.t.workflowRun,indexes:{coreWorkflowIdCreatedAtIndex:{universalIdentifier:`5f16fa40-7dd4-4a30-8331-9ad4a106f6be`},searchVectorGinIndex:{universalIdentifier:`e0ac5ad2-d0c8-4f72-b710-8e53b9dc18d9`}},views:{allWorkflowRuns:Q({objectUniversalIdentifier:o.n.workflowRun,fields:o.t.workflowRun,viewFieldNames:[`name`,`coreWorkflowId`,`status`]}),workflowRunRecordPageFields:$({objectUniversalIdentifier:o.n.workflowRun,fields:o.t.workflowRun,viewFieldNames:[`status`,`coreWorkflowId`,`startedAt`,`endedAt`,`createdAt`,`createdBy`,`enqueuedAt`,`state`,`updatedAt`,`updatedBy`,`timelineActivities`],viewFieldGroupNames:{general:`General`,system:`System`}})}},workspaceMember:{universalIdentifier:o.n.workspaceMember,fields:o.t.workspaceMember,indexes:{userEmailUniqueIndex:{universalIdentifier:`76da5f27-523c-44b6-ad06-12954f6b949f`},searchVectorGinIndex:{universalIdentifier:`8678dde9-a804-4a9e-80e3-9af35e471ec5`}},views:{workspaceMemberRecordPageFields:$({objectUniversalIdentifier:o.n.workspaceMember,fields:o.t.workspaceMember,viewFieldNames:[`userEmail`,`jobTitle`,`createdAt`,`updatedAt`,`assignedTasks`,`accountOwnerForCompanies`,`ownedOpportunities`],viewFieldGroupNames:{general:`General`,system:`System`,relations:`Relations`}}),allWorkspaceMembers:Q({objectUniversalIdentifier:o.n.workspaceMember,fields:o.t.workspaceMember,viewFieldNames:[`name`,`createdAt`,`ownedOpportunities`,`assignedTasks`]})}},agentChatThread:{universalIdentifier:o.n.agentChatThread,fields:o.t.agentChatThread,indexes:{directMessagePairUniqueIndex:{universalIdentifier:`365c5b24-cd52-4ebc-98d2-23c5684216d5`},workspaceMemberIndex:{universalIdentifier:`079f2dd7-6c11-4eae-be8a-cce2d1bee0fb`},assigneeIndex:{universalIdentifier:`a65524f8-c999-448b-b9f4-c9ecce15fd13`},channelLastActivityIndex:{universalIdentifier:`bd129bd1-db66-4c74-a64e-819d2edd3062`}},views:{open:{universalIdentifier:`e9a3781b-db78-41bb-a0e4-f6324770432a`,viewFields:{}},needsInput:{universalIdentifier:`0b97f7e4-423a-4e2f-93b9-7a5bcde62c03`,viewFields:{},viewFilters:{pendingQuestionMessageIdIsNotEmpty:{universalIdentifier:`05baa741-58a6-4641-abe2-267a1268e53b`}}},mentions:{universalIdentifier:`0a5d7727-2263-46b1-a795-9227559faf6f`,viewFields:{}},assignedToMe:{universalIdentifier:`1cddfa2c-38c0-4fda-80f3-cd01e37bf8e3`,viewFields:{},viewFilters:{assigneeIsMe:{universalIdentifier:`defbcad5-d91f-4e9a-90c6-9bac578ef374`}}},snoozed:{universalIdentifier:`31e8f41f-53ed-4dfd-aaa7-6d0d5dd2d56d`,viewFields:{}},done:{universalIdentifier:`81ee1b41-8035-46d1-85ae-18a75616954a`,viewFields:{}}}},agentChatThreadParticipant:{universalIdentifier:o.n.agentChatThreadParticipant,fields:o.t.agentChatThreadParticipant,indexes:{threadWorkspaceMemberUniqueIndex:{universalIdentifier:`e5bbe244-cf74-49a3-938a-e6fff7a8710b`},workspaceMemberIndex:{universalIdentifier:`73d8bb5d-18eb-47bb-89e6-12d8f89aecf6`}}},agentChatThreadTarget:{universalIdentifier:o.n.agentChatThreadTarget,fields:o.t.agentChatThreadTarget,morphIds:{targetMorphId:{morphId:o.t.agentChatThreadTarget.target.universalIdentifier}},indexes:{threadIdIndex:{universalIdentifier:`19291d2c-15ab-43a0-91f7-1694b34813dd`},personIdIndex:{universalIdentifier:`fe9c48d0-5b2a-4a51-bd47-f9205ea0c09d`},companyIdIndex:{universalIdentifier:`ab45593a-3614-41c8-aab1-20aa91f1095c`},opportunityIdIndex:{universalIdentifier:`b68e2031-73c6-4bc4-b062-5f795539e452`},threadPersonUniqueIndex:{universalIdentifier:`5a12050f-4de2-4076-aecc-959b863e14b2`},threadCompanyUniqueIndex:{universalIdentifier:`d9067628-fd16-4843-955b-5fd47fea52a9`},threadOpportunityUniqueIndex:{universalIdentifier:`1b9bec10-2788-40be-9435-44937b9f7018`}},views:{}},agentTurn:{universalIdentifier:o.n.agentTurn,fields:o.t.agentTurn,indexes:{agentIndex:{universalIdentifier:`606e8ba3-f322-426b-bef8-2208f67a541a`},agentIdCreatedAtIndex:{universalIdentifier:`39fbc85e-22ec-4279-8c67-f3f0850b68c9`},threadIndex:{universalIdentifier:`7d351559-4546-4307-ba28-de9fc4c40ef4`}}},agentMessage:{universalIdentifier:o.n.agentMessage,fields:o.t.agentMessage,indexes:{agentIndex:{universalIdentifier:`465b20e1-d4cd-4d80-a85b-78bd1f0e70ad`},threadIndex:{universalIdentifier:`2054f1a5-554f-42ac-a41a-b8ccd6ba72ec`},turnIndex:{universalIdentifier:`dc46f804-a55f-4283-884e-9cb938741da3`},senderWorkspaceMemberIndex:{universalIdentifier:`8ecdac01-7bbe-411e-8461-6ff265c90759`}}},agentMessageReaction:{universalIdentifier:o.n.agentMessageReaction,fields:o.t.agentMessageReaction,indexes:{messageWorkspaceMemberEmojiUniqueIndex:{universalIdentifier:`4089a239-e2d0-4e3e-83e8-e9b555a8a31d`},workspaceMemberIndex:{universalIdentifier:`565d89ab-2c11-4ebe-aaaf-8dbc4d79a9e5`}}},agentMessagePart:{universalIdentifier:o.n.agentMessagePart,fields:o.t.agentMessagePart,indexes:{messageOrderIndex:{universalIdentifier:`f5a08f6f-cf91-4996-9c21-2af64a17ca83`}}},campaignDelivery:{universalIdentifier:o.n.campaignDelivery,fields:o.t.campaignDelivery,indexes:{campaignPersonUniqueIndex:{universalIdentifier:`8d719548-d34f-4891-bbc9-e0e09f0e363b`},expiredClaimIndex:{universalIdentifier:`a4d7e8ed-0008-4f6a-a20c-a2b821487481`},countsIndex:{universalIdentifier:`1ea1ae7a-158f-436a-95a0-e9c998ad94f7`},claimTokenIndex:{universalIdentifier:`91640dcd-3f6b-4378-b284-bb02cc8b81ec`},providerMessageIdUniqueIndex:{universalIdentifier:`4de6f73d-ef3a-4c80-b71a-88739213f1c0`}}},messageSuppression:{universalIdentifier:o.n.messageSuppression,fields:o.t.messageSuppression,indexes:{emailAddressTopicUniqueIndex:{universalIdentifier:`a6c1f4dc-d925-49f9-8205-3e7f95545966`}}}},PT={canReadObjectRecords:`read`,canUpdateObjectRecords:`update`,canSoftDeleteObjectRecords:`soft-delete`,canDestroyObjectRecords:`destroy`},FT=e=>{let t=new Map;for(let[n,r]of Object.entries(e))t.has(r)||t.set(r,n);return t},IT=Object.fromEntries(Object.entries(NT).map(([e,{universalIdentifier:t}])=>[t,e])),LT=({grant:e,objects:t,permissionFlags:n,systemPermissionFlagNameByUniversalIdentifier:r})=>{let i=e=>t.find(t=>t.universalIdentifier===e)?.nameSingular??IT[e]??e;switch(e.type){case`ALL_OBJECT_RECORDS`:return`${PT[e.action]} all object records`;case`ALL_SETTINGS`:return`update all settings`;case`ALL_TOOLS`:return`access all tools`;case`PERMISSION_FLAG`:return`permission flag ${n.find(t=>t.universalIdentifier===e.permissionFlagUniversalIdentifier)?.key??r.get(e.permissionFlagUniversalIdentifier)??e.permissionFlagUniversalIdentifier}`;case`OBJECT_RECORDS`:return`${PT[e.action]} ${i(e.objectUniversalIdentifier)} records`;case`FIELD_VALUE`:return`${e.action===`canReadFieldValue`?`read`:`update`} field ${e.fieldUniversalIdentifier} of ${i(e.objectUniversalIdentifier)}`;case`ROW_LEVEL_RESTRICTION`:return`${i(e.objectUniversalIdentifier)} records without the row-level restriction`}},RT=e=>e.map(e=>`"${e}"`).join(`, `),zT=({agents:e,defaultRoleUniversalIdentifier:t})=>{let r=new Map;for(let i of e)!n.t(i.roleUniversalIdentifier)||i.roleUniversalIdentifier===t||r.set(i.roleUniversalIdentifier,[...r.get(i.roleUniversalIdentifier)??[],i.name]);return r},BT=({agentNamesByRoleUniversalIdentifier:e,roles:t})=>[...e].filter(([e])=>!t.some(t=>t.universalIdentifier===e)).map(([e,t])=>`Agent ${RT(t)} references role "${e}", which is not defined by this application.`),VT=({agentNamesByRoleUniversalIdentifier:e,applicationRole:t,roles:r,objects:i,permissionFlags:a,systemPermissionFlagNameByUniversalIdentifier:o})=>{let s=a.filter(e=>(e.permissionType??`tool`)===`tool`).map(e=>e.universalIdentifier);return[...e].flatMap(([e,c])=>{let l=r.find(t=>t.universalIdentifier===e);if(!n.t(l))return[];let u=Xw({role:l,superset:t,toolPermissionFlagUniversalIdentifiers:s});if(u.length===0)return[];let d=u.map(e=>LT({grant:e,objects:i,permissionFlags:a,systemPermissionFlagNameByUniversalIdentifier:o})).join(`, `);return[`Role "${l.label}" used by agent ${RT(c)} grants more than the application role "${t.label}": ${d}. The application role must cover every permission an agent role grants.`]})},HT=({agents:e,roles:t,objects:r,permissionFlags:i,defaultRoleUniversalIdentifier:a,systemPermissionFlag:s=o.r})=>{let c=t.find(e=>e.universalIdentifier===a),l=zT({agents:e,defaultRoleUniversalIdentifier:a});return[...BT({agentNamesByRoleUniversalIdentifier:l,roles:t}),...n.t(c)?VT({agentNamesByRoleUniversalIdentifier:l,applicationRole:c,roles:t,objects:r,permissionFlags:i,systemPermissionFlagNameByUniversalIdentifier:FT(s)}):[]]},UT=({views:e,objects:t,fields:r})=>{let i=[],o=new Map;for(let e of r)o.set(e.universalIdentifier,e);for(let e of t)for(let t of e.fields)o.set(t.universalIdentifier,t);for(let t of e)for(let e of t.filters??[]){let t=o.get(e.fieldMetadataUniversalIdentifier);if(!n.t(t))continue;let r=(t.type===a.a.RELATION||t.type===a.a.MORPH_RELATION)&&n.t(e.relationTargetFieldMetadataUniversalIdentifier)?o.get(e.relationTargetFieldMetadataUniversalIdentifier)?.type??t.type:t.type;if(!(r in lw))continue;let s=dw({filterType:r,subFieldName:e.subFieldName});s.includes(e.operand)||i.push(`Operand "${e.operand}" is not supported on field "${t.name}" (type "${r}"). Supported operands: ${s.join(`, `)}.`)}return i},WT=e=>p.i(e),GT=async e=>(await(0,te.glob)([`${d.t}/**/*`],{cwd:e,absolute:!0,onlyFiles:!0})).sort(),KT=async e=>{try{let t=await(0,ee.readFile)((0,v.join)(e,`README.md`),`utf-8`);return t.trim().length>0?t:void 0}catch{return}},qT=async e=>{let t=await WT(e),r=await KT(e),i=[],a=[],o,s=[],c=[],u=[],d=[],f=[],h=[],g=[],te=[],_=[],y=[],re=[],ie=[],ae=[],oe=[],se=[],ce=[],le=[],ue=[],de=[],fe=[],pe=[],me=[],he=[],ge=[],_e=[],b=[],ve=[],ye=[],be=[],xe=[],Se=[],Ce=[],we=[],Te=[],Ee=[],De=[],x=[],Oe=[],ke=[],Ae=[],je=[],Me=[],Ne=[],Pe=[],Fe=[],Ie=[],Le=[],Re=[],ze=[],Be=[],Ve=[],He=[],Ue=[],We=[],Ge=[],Ke=[],qe=[],Je=[],Ye=[];for(let r of t){let t=await(0,ee.readFile)(r,`utf-8`),l=(0,v.relative)(e,r);i.push(...jT(t,l));let u=p.r({fileContent:t,filePath:r});if(!u)continue;let m=p.n[u];switch(m){case`application`:{let t=await p.t({appPath:e,filePath:r});o=t.config,i.push(...t.errors),a.push(...t.warnings??[]),Te.push(l);break}case`objects`:{let t=await p.t({appPath:e,filePath:r});s.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),Ee.push(l);break}case`fields`:{let t=await p.t({appPath:e,filePath:r}),n=Aw(t.config);d.push(n),i.push(...t.errors),a.push(...t.warnings??[]),De.push(l);break}case`permissionFlags`:{let t=await p.t({appPath:e,filePath:r});g.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),ke.push(l);break}case`roles`:{let t=await p.t({appPath:e,filePath:r});c.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),Ae.push(l),u===`defineApplicationRole`&&we.push(t.config.universalIdentifier);break}case`skills`:{let t=await p.t({appPath:e,filePath:r});_.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),je.push(l);break}case`agents`:{let t=await p.t({appPath:e,filePath:r});y.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),Me.push(l);break}case`workflows`:{let t=await p.t({appPath:e,filePath:r});re.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),Ne.push(l);break}case`connectionProviders`:{let t=await p.t({appPath:e,filePath:r});ie.push(rT(t.config)),i.push(...t.errors),a.push(...t.warnings??[]),Pe.push(l);break}case`messagingProviders`:{let t=await p.t({appPath:e,filePath:r});ae.push(sT(t.config)),i.push(...t.errors),a.push(...t.warnings??[]),Fe.push(l);break}case`mcpServers`:{let t=await p.t({appPath:e,filePath:r});oe.push(aT(t.config)),i.push(...t.errors),a.push(...t.warnings??[]),Ie.push(l);break}case`relatedRecordPaths`:{let t=await p.t({appPath:e,filePath:r});se.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),Le.push(l);break}case`logicFunctions`:{let o=await p.t({appPath:e,filePath:r});i.push(...o.errors),a.push(...o.warnings??[]),u===`definePreInstallLogicFunction`&&n.t(o.config.serverRouteTriggerSettings)&&i.push(`${l}: pre-install logic functions cannot define serverRouteTriggerSettings.`);let{runOnUserPreferences:s,...c}=o.config,d=await hT({logicFunctionConfig:c,sourceCode:t,sourcePath:l});if(ce.push(d),Re.push(l),u===`definePostInstallLogicFunction`){let e=o.config;ye.push({universalIdentifier:o.config.universalIdentifier,shouldRunOnVersionUpgrade:e.shouldRunOnVersionUpgrade??!1,shouldRunSynchronously:e.shouldRunSynchronously??!1})}if(u===`definePreInstallLogicFunction`){let e=o.config;be.push({universalIdentifier:o.config.universalIdentifier,shouldRunOnVersionUpgrade:e.shouldRunOnVersionUpgrade??!1})}u===`defineUninstallLogicFunction`&&xe.push({universalIdentifier:o.config.universalIdentifier}),u===`defineHealthCheck`&&Se.push({universalIdentifier:o.config.universalIdentifier,...n.t(s)?{runOnUserPreferences:s}:{}});break}case`frontComponents`:{let t=await p.t({appPath:e,filePath:r});i.push(...t.errors),a.push(...t.warnings??[]);let n=gT({frontComponentConfig:t.config,sourcePath:l});le.push(n),ze.push(l),u===`defineSettingsFrontComponent`&&Ce.push(t.config.universalIdentifier);break}case`views`:{let t=await p.t({appPath:e,filePath:r}),n={...t.config};de.push(n),i.push(...t.errors),a.push(...t.warnings??[]),Ve.push(l);break}case`viewFields`:{let t=await p.t({appPath:e,filePath:r});fe.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),He.push(l);break}case`navigationMenuItems`:{let t=await p.t({appPath:e,filePath:r});pe.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),Ue.push(l);break}case`pageLayouts`:{let t=await p.t({appPath:e,filePath:r}),n={...t.config};me.push(n),i.push(...t.errors),a.push(...t.warnings??[]),We.push(l);break}case`indexes`:{let t=await p.t({appPath:e,filePath:r}),n={...t.config};f.push(n),i.push(...t.errors),a.push(...t.warnings??[]),x.push(l);break}case`validationRules`:{let t=await p.t({appPath:e,filePath:r});h.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),Oe.push(l);break}case`pageLayoutTabs`:{let t=await p.t({appPath:e,filePath:r}),n={...t.config};he.push(n),i.push(...t.errors),a.push(...t.warnings??[]),Ge.push(l);break}case`pageLayoutWidgets`:{let t=await p.t({appPath:e,filePath:r});ge.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),Ke.push(l);break}case`commandMenuItems`:{let t=await p.t({appPath:e,filePath:r});_e.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),qe.push(l);break}case`timelineActivityTypes`:{let t=await p.t({appPath:e,filePath:r});b.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),Je.push(l);break}case`settingsMenuItems`:{let t=await p.t({appPath:e,filePath:r});ve.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),Ye.push(l);break}default:ne(m)}}let Xe=await GT(e);for(let t of Xe){let n=(0,v.relative)(e,t);ue.push({filePath:n,fileName:(0,v.basename)(t),fileType:(0,v.extname)(t).replace(/^\./,``),checksum:null}),Be.push(n)}if(o||i.push(`Cannot build application, please export default defineApplication() to define an application`),o){for(let e of s){let{objectManifest:t,errors:n}=uT({objectConfig:e,applicationUniversalIdentifier:o.universalIdentifier});i.push(...n),t&&u.push(t)}for(let e of c)te.push(_T({roleConfig:e,applicationUniversalIdentifier:o.universalIdentifier}))}ye.length>1&&i.push(`Only one post install logic function is allowed per application`),be.length>1&&i.push(`Only one pre install logic function is allowed per application`),xe.length>1&&i.push(`Only one uninstall logic function is allowed per application`),Se.length>1&&i.push(`Only one health check is allowed per application`);let[Ze]=Se;Ce.length>1&&i.push(`Only one settings front component is allowed per application`),we.length>1&&i.push(`Only one defineApplicationRole is allowed per application`);let{sharedDependencies:Qe,errors:$e}=await wT(e);i.push(...$e);let et=o?.defaultRoleUniversalIdentifier??(we.length===1?we[0]:void 0);o&&!et&&i.push("Application must declare a default role: either pass `defaultRoleUniversalIdentifier` to defineApplication() or mark a role file with defineApplicationRole()"),i.push(...UT({views:de,objects:u,fields:d})),n.t(o)&&n.t(et)&&i.push(...HT({agents:y,roles:te,objects:u,permissionFlags:g,defaultRoleUniversalIdentifier:et,systemPermissionFlag:l.i(e)}));let tt=o&&et?(()=>{let{logoUrl:t,screenshots:i,...a}=o;return{...a,logo:o.logo,galleryImages:o.galleryImages??[],defaultRoleUniversalIdentifier:et,aboutDescription:r,yarnLockChecksum:null,packageJsonChecksum:``,requiredServerVersionRange:m.t(e),...ye.length>=1?{postInstallLogicFunction:ye[0]}:{},...be.length>=1?{preInstallLogicFunction:be[0]}:{},...xe.length>=1?{uninstallLogicFunction:xe[0]}:{},...n.t(Ze)?{healthCheckLogicFunction:Ze}:{},...Ce.length>=1?{settingsFrontComponent:{universalIdentifier:Ce[0]}}:{},...n.t(Qe)?{frontComponentSharedDependencies:Qe}:{}}})():void 0,S=(e,t)=>e.universalIdentifier.localeCompare(t.universalIdentifier);return{manifest:tt?{application:tt,objects:u.sort(S),fields:d.sort(S),indexes:f.sort(S),permissionFlags:g.sort(S),roles:te.sort(S),skills:_.sort(S),agents:y.sort(S),workflows:re.sort(S),connectionProviders:ie.sort(S),messagingProviders:ae.sort(S),mcpServers:oe.sort(S),logicFunctions:ce.sort(S),frontComponents:le.sort(S),publicAssets:ue.sort((e,t)=>e.filePath.localeCompare(t.filePath)),views:de.sort(S),viewFields:fe.sort(S),navigationMenuItems:pe.sort(S),pageLayouts:me.sort(S),pageLayoutTabs:he.sort(S),pageLayoutWidgets:ge.sort(S),commandMenuItems:_e.sort(S),timelineActivityTypes:b.sort(S),settingsMenuItems:ve.sort(S),validationRules:h.sort(S),relatedRecordPaths:se.sort(S)}:null,filePaths:{application:Te,objects:Ee,fields:De,indexes:x,validationRules:Oe,permissionFlags:ke,roles:Ae,skills:je,agents:Me,workflows:Ne,connectionProviders:Pe,messagingProviders:Fe,mcpServers:Ie,relatedRecordPaths:Le,logicFunctions:Re,frontComponents:ze,publicAssets:Be,views:Ve,viewFields:He,navigationMenuItems:Ue,pageLayouts:We,pageLayoutTabs:Ge,pageLayoutWidgets:Ke,commandMenuItems:qe,timelineActivityTypes:Je,settingsMenuItems:Ye},errors:i,warnings:a}},JT=[a.a.RELATION,a.a.MORPH_RELATION],YT=e=>JT.includes(e.type),XT=e=>{let t=new Set,n=new Set;for(let r of e)t.has(r)?n.add(r):t.add(r);return Array.from(n)},ZT=({manifest:e,pageLayoutWidgets:t})=>{let r=new Set([e.application.settingsFrontComponent?.universalIdentifier,...e.settingsMenuItems.map(e=>e.frontComponentUniversalIdentifier),...e.commandMenuItems.map(e=>e.frontComponentUniversalIdentifier),...e.timelineActivityTypes.map(e=>e.frontComponentUniversalIdentifier),...t.map(({configuration:e})=>n.t(e)&&`frontComponentUniversalIdentifier`in e?e.frontComponentUniversalIdentifier:void 0)].filter(n.t));return e.frontComponents.filter(e=>!e.isHeadless&&!n.t(e.widgetAvailability)&&!r.has(e.universalIdentifier)).map(e=>`Front component "${e.name??e.componentName}" declares no widgetAvailability, so it is not offered in any widget picker. Set widgetAvailability to let users add it to record pages or dashboards.`)},QT=e=>{let t=[],r=[...e.pageLayouts.flatMap(({tabs:e})=>e??[]),...e.pageLayoutTabs];for(let e of r){e.layoutMode===o.l.CANVAS&&t.push(`Page layout tab "${e.title}" uses deprecated CANVAS. For a full-height widget, use VERTICAL_LIST and set the widget's heightBehavior to 'TAB_VIEWPORT'. Existing Canvas layouts remain supported and are not converted.`);for(let r of e.widgets??[])r.position?.layoutMode===o.l.VERTICAL_LIST&&t.push(`Page layout widget "${r.title}" uses a deprecated vertical-list position. Order the widgets array by position.index, remove position, and move any position.heightBehavior to heightBehavior. Existing positions remain supported and keep their indices.`),`gridPosition`in r&&n.t(r.gridPosition)&&t.push(`Page layout widget "${r.title}" uses deprecated gridPosition. If position is already set, it takes precedence; remove the ignored gridPosition. Use position with layoutMode: 'GRID' and the same row, column, rowSpan and columnSpan only when position is absent. Existing gridPosition remains supported as a fallback.`)}return t},$T=[`id`,`createdAt`,`createdBy`,`updatedAt`,`updatedBy`,`deletedAt`,`position`,`searchVector`],eE=e=>e.objects.flatMap(t=>{let r=t.labelIdentifierFieldMetadataUniversalIdentifier?.toLowerCase();return n.t(r)?[...(t.fields??[]).map(e=>e.universalIdentifier.toLowerCase()),...e.fields.filter(e=>e.objectUniversalIdentifier.toLowerCase()===t.universalIdentifier.toLowerCase()).map(e=>e.universalIdentifier.toLowerCase()),...$T.map(n=>a.t({applicationUniversalIdentifier:e.application.universalIdentifier,objectUniversalIdentifier:t.universalIdentifier,name:n}))].includes(r)?[]:[`Object "${t.nameSingular}" references label field ${r}, which is not declared in this app or a recognized generated field. Check the identifier; the server must resolve this reference before applying.`]:[]}),tE=e=>XT(e.settingsMenuItems.map(e=>e.slug).filter(n.t)).map(e=>`Settings menu item slug "${e}" is used more than once. Slugs must be unique within an application.`),nE=e=>{let t=[],i=XT(e.timelineActivityTypes.map(e=>e.name)),o=new Set(e.frontComponents.map(e=>e.universalIdentifier));for(let e of i)t.push(`Timeline activity type name "${e}" is used more than once. Names must be unique within an application.`);for(let i of e.timelineActivityTypes){n.t(i.frontComponentUniversalIdentifier)&&!o.has(i.frontComponentUniversalIdentifier)&&t.push(`Timeline activity type "${i.name}" references front component "${i.frontComponentUniversalIdentifier}", which is not defined by this application.`);let s=i.emit,l=i.replacesTimelineActivityTypeUniversalIdentifier;if(!n.t(s)){n.t(l)&&t.push(`Timeline activity type "${i.name}" declares replacesTimelineActivityTypeUniversalIdentifier without an automatic emit contract.`);continue}let u=s.through,d=u?.triggerFieldUniversalIdentifiers,f=c.t(s.objectUniversalIdentifier);f||t.push(`Timeline activity type "${i.name}" references an invalid object universal identifier "${s.objectUniversalIdentifier}".`),(s.on===`linked`||s.on===`unlinked`)&&!n.t(u)&&t.push(`Timeline activity type "${i.name}" must declare emit.through for a ${s.on} event.`),n.t(d)&&(s.on!==`updated`||!r.t(d)||new Set(d).size!==d.length)&&t.push(`Timeline activity type "${i.name}" trigger fields must be a non-empty list of unique fields on an updated through event.`);let p=f?e.objects.find(e=>e.universalIdentifier===s.objectUniversalIdentifier):void 0;if(!n.t(p)){f&&!n.t(l)&&t.push(`Timeline activity type "${i.name}" targets object "${s.objectUniversalIdentifier}", which is not defined by this application. Types targeting another application's object must declare replacesTimelineActivityTypeUniversalIdentifier.`),n.t(l)&&!c.t(l)&&t.push(`Timeline activity type "${i.name}" references an invalid replacement universal identifier "${l}".`),n.t(u)&&!c.t(u.relationFieldUniversalIdentifier)&&t.push(`Timeline activity type "${i.name}" references an invalid through relation field universal identifier "${u.relationFieldUniversalIdentifier}".`);let e=d?.filter(e=>!c.t(e))??[];e.length>0&&t.push(`Timeline activity type "${i.name}" references invalid trigger field universal identifiers: ${e.join(`, `)}.`);continue}n.t(l)&&t.push(`Timeline activity type "${i.name}" targets an object defined by this application and must not replace another application's type.`);let m=[...p.fields,...e.fields.filter(e=>e.objectUniversalIdentifier===p.universalIdentifier)];if(!n.t(u))continue;let h=m.find(e=>e.universalIdentifier===u.relationFieldUniversalIdentifier);if(n.t(h)?YT(h)&&n.t(h.universalSettings)&&(h.universalSettings.relationType===a.i.MANY_TO_ONE||h.universalSettings.relationType===a.i.ONE_TO_MANY&&(0,y.isNonEmptyString)(h.universalSettings.junctionTargetFieldUniversalIdentifier))||t.push(`Timeline activity type "${i.name}" must route through a MANY_TO_ONE relation or a junction-backed ONE_TO_MANY relation.`):t.push(`Timeline activity type "${i.name}" references relation field "${u.relationFieldUniversalIdentifier}", which is not defined on object "${p.nameSingular}".`),n.t(d)){let e=new Set(m.map(e=>e.universalIdentifier)),n=d.filter(t=>!e.has(t));n.length>0&&t.push(`Timeline activity type "${i.name}" references trigger fields that are not defined on object "${p.nameSingular}": ${n.join(`, `)}.`)}}return t},rE=({name:e,errorMessage:t})=>`Validation rule "${e}" has an invalid expression: ${t}`,iE=e=>({name:e.name,type:e.type,universalIdentifier:e.universalIdentifier}),aE=e=>new Map(e.objects.map(t=>[t.universalIdentifier,[...t.fields,...e.fields.filter(e=>e.objectUniversalIdentifier===t.universalIdentifier)]])),oE=({manifest:{application:e},objectUniversalIdentifier:t})=>Object.entries(MT).map(([n,r])=>({name:n,type:r,universalIdentifier:a.t({applicationUniversalIdentifier:e.universalIdentifier,objectUniversalIdentifier:t,name:n})})),sE=({manifest:e,declaredFieldsByObject:t,objectUniversalIdentifier:n})=>[...t.get(n)??[],...oE({manifest:e,objectUniversalIdentifier:n})].map(iE),cE=({manifest:e,declaredFieldsByObject:t,objectUniversalIdentifier:n})=>[...(t.get(n)??[]).map(n=>{if(!YT(n))return iE(n);let r=n.universalSettings?.relationType;return r===a.i.MANY_TO_ONE?{...iE(n),relationType:r,relationTargetFields:sE({manifest:e,declaredFieldsByObject:t,objectUniversalIdentifier:n.relationTargetObjectMetadataUniversalIdentifier})}:{...iE(n),relationType:r}}),...oE({manifest:e,objectUniversalIdentifier:n}).map(iE)],lE=({name:e,expression:t})=>{let n=mw({expression:t,fields:[]});return!n.isValid&&n.errorCode!==`UNKNOWN_FIELD`?[rE({name:e,errorMessage:n.errorMessage})]:[]},uE=({validationRule:{name:e,errorFieldUniversalIdentifier:t},objectFields:r})=>n.t(t)&&!r.some(e=>e.universalIdentifier===t)?[`Validation rule "${e}" shows its error on field "${t}", which does not belong to the rule's object.`]:[],dE=({compilationResult:e,declaredFields:t,declaredFieldsByObject:r})=>{if(e.isValid||e.errorCode!==`UNKNOWN_RELATION_TARGET_FIELD`)return!1;let i=t.find(t=>t.name===e.errorParams?.relationFieldName);return n.t(i)&&YT(i)&&!r.has(i.relationTargetObjectMetadataUniversalIdentifier)},fE=({validationRule:e,manifest:t,declaredFields:n,declaredFieldsByObject:r})=>{let{name:i,expression:a,objectUniversalIdentifier:o}=e,s=uE({validationRule:e,objectFields:sE({manifest:t,declaredFieldsByObject:r,objectUniversalIdentifier:o})}),c=mw({expression:a,fields:cE({manifest:t,declaredFieldsByObject:r,objectUniversalIdentifier:o})});return c.isValid||dE({compilationResult:c,declaredFields:n,declaredFieldsByObject:r})?s:[...s,rE({name:i,errorMessage:c.errorMessage})]},pE=e=>{let t=aE(e);return(e.validationRules??[]).flatMap(r=>{let i=t.get(r.objectUniversalIdentifier);return n.t(i)?fE({validationRule:r,manifest:e,declaredFields:i,declaredFieldsByObject:t}):lE(r)})},mE=[a.i.MANY_TO_ONE,a.i.ONE_TO_MANY],hE=`aggregateFieldMetadataId`,gE=e=>n.t(e)&&hw.some(t=>t===e.configurationType),_E=e=>{let t=[];if(!e)return[];for(let[n,r]of Object.entries(e))n===`universalIdentifier`&&typeof r==`string`&&t.push(r),!(n===`postInstallLogicFunction`||n===`preInstallLogicFunction`||n===`uninstallLogicFunction`||n===`healthCheckLogicFunction`||n===`identifyAccountLogicFunction`||n===`authorizeLogicFunction`||n===`callbackLogicFunction`||n===`onConnectLogicFunction`||n===`onDisconnectLogicFunction`||n===`sendMessageLogicFunction`||n===`markThreadAsReadLogicFunction`||n===`connectionProvider`||n===`settingsFrontComponent`||n===`input`||n===`expectedBody`||n===`outputSchema`||n===`expectedOutputSchema`)&&typeof r==`object`&&t.push(..._E(r));return t},vE=e=>{let t=[];for(let n of e){if(!YT(n))continue;let e=n.universalSettings;if(!e?.relationType){t.push(`Relation field "${n.name}" is missing relationType. ${n.type} fields must declare a relationType (${mE.join(` or `)}) in universalSettings.`);continue}if(!mE.includes(e.relationType)){t.push(`Relation field "${n.name}" has invalid relationType "${e.relationType}". Expected ${mE.join(` or `)}.`);continue}e.relationType===a.i.MANY_TO_ONE&&!e.joinColumnName&&t.push(`MANY_TO_ONE relation field "${n.name}" is missing joinColumnName. MANY_TO_ONE relations must declare a joinColumnName in universalSettings.`)}return t},yE=e=>{let t=e.pageLayouts.flatMap(e=>e.tabs?.flatMap(e=>e.widgets??[])??[]),n=e.pageLayoutTabs.flatMap(e=>e.widgets??[]);return[...t,...n,...e.pageLayoutWidgets??[]]},bE=e=>{let t=[];for(let n of e){let e=n.configuration;if(gE(e)&&!(0,y.isNonEmptyString)(e.aggregateFieldMetadataUniversalIdentifier)){let r=hE in e?` Reference the aggregate field with "aggregateFieldMetadataUniversalIdentifier" (not "${hE}").`:``;t.push(`Graph widget "${n.title}" is missing aggregateFieldMetadataUniversalIdentifier.${r}`)}}return t},xE=({pageLayoutTab:e,pageLayoutType:t})=>{let n=Iw({pageLayoutTabManifest:e,pageLayoutType:t});return n.status===`fail`?n.errors:[]},SE=e=>{let t=new Map(e.pageLayouts.map(e=>[e.universalIdentifier,e.type])),r=e.pageLayouts.flatMap(e=>(e.tabs??[]).flatMap(t=>xE({pageLayoutTab:t,pageLayoutType:e.type}))),i=e.pageLayoutTabs.flatMap(e=>xE({pageLayoutTab:e,pageLayoutType:n.t(e.pageLayoutUniversalIdentifier)?t.get(e.pageLayoutUniversalIdentifier):void 0}));return[...r,...i]},CE=e=>{let t=[],n=new Set;for(let r of e){if(n.has(r))continue;if(n.add(r),!_w(r)){t.push(`Universal identifier "${r}" is not a valid UUID.`);continue}let e=Ow(r);c.t(r)||t.push(`Universal identifier "${r}" is UUID version ${e}. Only UUID version 4 or higher is allowed.`)}return t},wE=e=>{let t=[],i=yE(e),o=[...QT(e),...eE(e),...ZT({manifest:e,pageLayoutWidgets:i})],s=_E(e),c=XT(s.map(e=>e.toLowerCase()));c.length>0&&t.push(`Duplicate universal identifiers: ${c.join(`, `)}`);let l=CE(s);l.length>0&&t.push(`Invalid universal identifiers: ${l.join(`, `)}`),(e.application.billing?.prices??[]).some(({per:e})=>e===`CONNECTED_ACCOUNT`)&&!r.t(e.connectionProviders)&&t.push(`A billing price per CONNECTED_ACCOUNT needs a connection provider: without one no account is ever connected and the price is never billed.`);let u=[...e.fields,...e.objects.flatMap(e=>e.fields)];for(let e of u)if((e.type===a.a.SELECT||e.type===a.a.MULTI_SELECT||e.type===a.a.RATING)&&n.t(e.options)){e.options.some(({id:e})=>n.t(e)&&!(0,y.isNonEmptyString)(e))&&t.push(`Field "${e.name}" has empty option IDs. Set distinct non-empty IDs on these options.`);let r=XT(e.options.map(e=>e.id).filter(n.t).map(e=>e.toLowerCase()));r.length>0&&t.push(`Field "${e.name}" has duplicate option IDs: ${r.join(`, `)}. Set distinct explicit IDs on these options.`)}return t.push(...vE(u)),t.push(...SE(e)),t.push(...bE(i)),t.push(...nE(e)),t.push(...pE(e)),t.push(...tE(e)),{errors:t,warnings:o,isValid:t.length===0}},TE={"twenty-sdk":`"twenty-sdk" is listed under "dependencies" in package.json. It is a build-time only tool and should be moved to "devDependencies".`,"twenty-client-sdk":`"twenty-client-sdk" is listed under "dependencies" in package.json. It is provided at runtime by Twenty's injected SDK and should be moved to "devDependencies".`},EE=async e=>{let t=v.default.join(e,`package.json`);if(!await u.i(t))return[];let r=await u.a(t);return[`dependencies`,`optionalDependencies`].flatMap(e=>Object.entries(TE).filter(([t])=>n.t(r[e]?.[t])).map(([,t])=>t.replace(`"dependencies"`,`"${e}"`)))},DE=async e=>await u.i(e)?(await(0,ee.stat)(e)).size===0?[`yarn.lock is empty. Run "yarn install" to regenerate it before building.`]:[]:[`yarn.lock not found. Run "yarn install" to generate it before building.`],OE=e=>DE(v.default.join(e,`yarn.lock`)),kE=async e=>{let t=await qT(e);if(t.errors.length>0||!t.manifest)return{success:!1,errors:t.errors.length>0?t.errors:[`Failed to build manifest.`]};let n=wE(t.manifest);if(!n.isValid)return{success:!1,errors:n.errors};let r=await OE(e);if(r.length>0)return{success:!1,errors:r};let i=await EE(e);return{success:!0,manifest:t.manifest,filePaths:t.filePaths,warnings:[...t.warnings,...n.warnings,...i]}},AE=({catalog:e,onCollision:t})=>{let r={},i=new Map;for(let{message:a,context:o,translation:s}of l.n(e)){if(s.length===0)continue;let e=n.t(o)?`${o} ${a}`:a,c=l.r(a,o),u=i.get(c);n.t(u)&&u!==e&&t?.({messageId:c,keptKey:e,droppedKey:u}),i.set(c,e),r[c]=s}return r},jE=async({filePath:e,onWarning:t})=>{let r;try{r=await u.a(e)}catch{return t(`Skipping translation file "${v.default.basename(e)}": it is not valid JSON.`),null}return!n.t(r)||typeof r!=`object`||Array.isArray(r)?(t(`Skipping translation file "${v.default.basename(e)}": expected a JSON object.`),null):r},ME=async({appPath:e,onWarning:t})=>{let n=v.default.join(e,h.t);if(!await u.i(n))return{};let r={};for(let e of(await(0,ee.readdir)(n)).filter(e=>e.endsWith(`.json`))){let i=v.default.basename(e,`.json`);if(i===`en`)continue;if(!s.t(i)){t(`Skipping compiled translation file "${e}": "${i}" is not a supported locale.`);continue}let a=await jE({filePath:v.default.join(n,e),onWarning:t});if(a===null)continue;let o=Object.fromEntries(Object.entries(a).filter(e=>typeof e[1]==`string`&&e[1].length>0));Object.keys(o).length>0&&(r[i]=o)}return r},NE=async({appPath:e,onWarning:t=e=>console.warn(e)})=>{let n=v.default.join(e,h.n);if(!await u.i(n))return;let r=(await(0,ee.readdir)(n)).filter(e=>e.endsWith(`.json`)),i={};for(let e of r){let r=v.default.basename(e,`.json`);if(r===`en`)continue;if(!s.t(r)){t(`Skipping translation file "${e}": "${r}" is not a supported locale.`);continue}let a=await jE({filePath:v.default.join(n,e),onWarning:t});if(a===null)continue;let o=AE({catalog:a,onCollision:({messageId:n,keptKey:r,droppedKey:i})=>t(`Message id collision in "${e}": "${r}" and "${i}" share id "${n}". Keeping "${r}".`)});Object.keys(o).length>0&&(i[r]=o)}for(let[n,r]of Object.entries(await ME({appPath:e,onWarning:t})))i[n]={...r,...i[n]??{}};return i};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return bc}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return xT}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return AE}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return kE}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return NE}});
|