@kajitiluna/erd-cli 0.260912.111155 → 0.260922.143727
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/erd-cli.cjs +1 -1
- package/package.json +1 -1
package/erd-cli.cjs
CHANGED
|
@@ -24,7 +24,7 @@ var iu=Object.create;var Ur=Object.defineProperty;var au=Object.getOwnPropertyDe
|
|
|
24
24
|
if (${v}.issues.length) payload.issues = payload.issues.concat(${v}.issues.map(iss => ({
|
|
25
25
|
...iss,
|
|
26
26
|
path: iss.path ? [${wt(R)}, ...iss.path] : [${wt(R)}]
|
|
27
|
-
})));`),h.write(`newResult[${wt(R)}] = ${v}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");let M=h.compile();return(R,v)=>M(d,R,v)},o,i=Kt,a=!Hn.jitless,l=a&&Kr.value,c=e.catchall,m;t._zod.parse=(d,h)=>{m??(m=n.value);let g=d.value;if(!i(g))return d.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),d;let b=[];if(a&&l&&h?.async===!1&&h.jitless!==!0)o||(o=r(e.shape)),d=o(d,h);else{d.value={};let v=m.shape;for(let z of m.keys){let me=v[z],pe=me._zod.run({value:g[z],issues:[]},h),H=me._zod.optin==="optional"&&me._zod.optout==="optional";pe instanceof Promise?b.push(pe.then(Ge=>H?ba(Ge,d,z,g):or(Ge,d,z))):H?ba(pe,d,z,g):or(pe,d,z)}}if(!c)return b.length?Promise.all(b).then(()=>d):d;let y=[],N=m.keySet,M=c._zod,R=M.def.type;for(let v of Object.keys(g)){if(N.has(v))continue;if(R==="never"){y.push(v);continue}let z=M.run({value:g[v],issues:[]},h);z instanceof Promise?b.push(z.then(me=>or(me,d,v))):or(z,d,v)}return y.length&&d.issues.push({code:"unrecognized_keys",keys:y,input:g,inst:t}),b.length?Promise.all(b).then(()=>d):d}});function Sa(t,e,n,r){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(o=>o.issues.map(i=>Pe(i,r,Me())))}),e}var so=f("$ZodUnion",(t,e)=>{Z.init(t,e),q(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),q(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),q(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),q(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(r=>r._zod.pattern);return new RegExp(`^(${n.map(r=>Sn(r.source)).join("|")})$`)}}),t._zod.parse=(n,r)=>{let o=!1,i=[];for(let a of e.options){let s=a._zod.run({value:n.value,issues:[]},r);if(s instanceof Promise)i.push(s),o=!0;else{if(s.issues.length===0)return s;i.push(s)}}return o?Promise.all(i).then(a=>Sa(a,n,t,r)):Sa(i,n,t,r)}}),rs=f("$ZodDiscriminatedUnion",(t,e)=>{so.init(t,e);let n=t._zod.parse;q(t._zod,"propValues",()=>{let o={};for(let i of e.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(let[s,l]of Object.entries(a)){o[s]||(o[s]=new Set);for(let c of l)o[s].add(c)}}return o});let r=yn(()=>{let o=e.options,i=new Map;for(let a of o){let s=a._zod.propValues[e.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(let l of s){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,a)}}return i});t._zod.parse=(o,i)=>{let a=o.value;if(!Kt(a))return o.issues.push({code:"invalid_type",expected:"object",input:a,inst:t}),o;let s=r.value.get(a?.[e.discriminator]);return s?s._zod.run(o,i):e.unionFallback?n(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:a,path:[e.discriminator],inst:t}),o)}}),os=f("$ZodIntersection",(t,e)=>{Z.init(t,e),t._zod.parse=(n,r)=>{let o=n.value,i=e.left._zod.run({value:o,issues:[]},r),a=e.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([l,c])=>wa(n,l,c)):wa(n,i,a)}});function io(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Gt(t)&&Gt(e)){let n=Object.keys(e),r=Object.keys(t).filter(i=>n.indexOf(i)!==-1),o={...t,...e};for(let i of r){let a=io(t[i],e[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};o[i]=a.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<t.length;r++){let o=t[r],i=e[r],a=io(o,i);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function wa(t,e,n){if(e.issues.length&&t.issues.push(...e.issues),n.issues.length&&t.issues.push(...n.issues),Mt(t))return t;let r=io(e.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return t.value=r.data,t}var is=f("$ZodRecord",(t,e)=>{Z.init(t,e),t._zod.parse=(n,r)=>{let o=n.value;if(!Gt(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),n;let i=[];if(e.keyType._zod.values){let a=e.keyType._zod.values;n.value={};for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){let c=e.valueType._zod.run({value:o[l],issues:[]},r);c instanceof Promise?i.push(c.then(m=>{m.issues.length&&n.issues.push(...De(l,m.issues)),n.value[l]=m.value})):(c.issues.length&&n.issues.push(...De(l,c.issues)),n.value[l]=c.value)}let s;for(let l in o)a.has(l)||(s=s??[],s.push(l));s&&s.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:s})}else{n.value={};for(let a of Reflect.ownKeys(o)){if(a==="__proto__")continue;let s=e.keyType._zod.run({value:a,issues:[]},r);if(s instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(s.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:s.issues.map(c=>Pe(c,r,Me())),input:a,path:[a],inst:t}),n.value[s.value]=s.value;continue}let l=e.valueType._zod.run({value:o[a],issues:[]},r);l instanceof Promise?i.push(l.then(c=>{c.issues.length&&n.issues.push(...De(a,c.issues)),n.value[s.value]=c.value})):(l.issues.length&&n.issues.push(...De(a,l.issues)),n.value[s.value]=l.value)}}return i.length?Promise.all(i).then(()=>n):n}});var as=f("$ZodEnum",(t,e)=>{Z.init(t,e);let n=Zr(e.entries);t._zod.values=new Set(n),t._zod.pattern=new RegExp(`^(${n.filter(r=>Gr.has(typeof r)).map(r=>typeof r=="string"?rt(r):r.toString()).join("|")})$`),t._zod.parse=(r,o)=>{let i=r.value;return t._zod.values.has(i)||r.issues.push({code:"invalid_value",values:n,input:i,inst:t}),r}}),ss=f("$ZodLiteral",(t,e)=>{Z.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?rt(n):n?n.toString():String(n)).join("|")})$`),t._zod.parse=(n,r)=>{let o=n.value;return t._zod.values.has(o)||n.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),n}});var ls=f("$ZodTransform",(t,e)=>{Z.init(t,e),t._zod.parse=(n,r)=>{let o=e.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(n.value=a,n));if(o instanceof Promise)throw new Ye;return n.value=o,n}}),cs=f("$ZodOptional",(t,e)=>{Z.init(t,e),t._zod.optin="optional",t._zod.optout="optional",q(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),q(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${Sn(n.source)})?$`):void 0}),t._zod.parse=(n,r)=>e.innerType._zod.optin==="optional"?e.innerType._zod.run(n,r):n.value===void 0?n:e.innerType._zod.run(n,r)}),us=f("$ZodNullable",(t,e)=>{Z.init(t,e),q(t._zod,"optin",()=>e.innerType._zod.optin),q(t._zod,"optout",()=>e.innerType._zod.optout),q(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${Sn(n.source)}|null)$`):void 0}),q(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(n,r)=>n.value===null?n:e.innerType._zod.run(n,r)}),ds=f("$ZodDefault",(t,e)=>{Z.init(t,e),t._zod.optin="optional",q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>{if(n.value===void 0)return n.value=e.defaultValue,n;let o=e.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>Ma(i,e)):Ma(o,e)}});function Ma(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var ms=f("$ZodPrefault",(t,e)=>{Z.init(t,e),t._zod.optin="optional",q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>(n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,r))}),ps=f("$ZodNonOptional",(t,e)=>{Z.init(t,e),q(t._zod,"values",()=>{let n=e.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),t._zod.parse=(n,r)=>{let o=e.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>xa(i,t)):xa(o,t)}});function xa(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var hs=f("$ZodCatch",(t,e)=>{Z.init(t,e),t._zod.optin="optional",q(t._zod,"optout",()=>e.innerType._zod.optout),q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>{let o=e.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.value,i.issues.length&&(n.value=e.catchValue({...n,error:{issues:i.issues.map(a=>Pe(a,r,Me()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=e.catchValue({...n,error:{issues:o.issues.map(i=>Pe(i,r,Me()))},input:n.value}),n.issues=[]),n)}});var fs=f("$ZodPipe",(t,e)=>{Z.init(t,e),q(t._zod,"values",()=>e.in._zod.values),q(t._zod,"optin",()=>e.in._zod.optin),q(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(n,r)=>{let o=e.in._zod.run(n,r);return o instanceof Promise?o.then(i=>Ta(i,e,r)):Ta(o,e,r)}});function Ta(t,e,n){return Mt(t)?t:e.out._zod.run({value:t.value,issues:t.issues},n)}var gs=f("$ZodReadonly",(t,e)=>{Z.init(t,e),q(t._zod,"propValues",()=>e.innerType._zod.propValues),q(t._zod,"values",()=>e.innerType._zod.values),q(t._zod,"optin",()=>e.innerType._zod.optin),q(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(n,r)=>{let o=e.innerType._zod.run(n,r);return o instanceof Promise?o.then(Ia):Ia(o)}});function Ia(t){return t.value=Object.freeze(t.value),t}var ys=f("$ZodCustom",(t,e)=>{ue.init(t,e),Z.init(t,e),t._zod.parse=(n,r)=>n,t._zod.check=n=>{let r=n.value,o=e.fn(r);if(o instanceof Promise)return o.then(i=>Ca(i,n,r,t));Ca(o,n,r,t)}});function Ca(t,e,n,r){if(!t){let o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),e.issues.push(Wr(o))}}var $u=t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},Uu=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(r){return t[r]??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",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Invalid input: expected ${r.expected}, received ${$u(r.input)}`;case"invalid_value":return r.values.length===1?`Invalid input: expected ${tr(r.values[0])}`:`Invalid option: expected one of ${Xn(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",i=e(r.origin);return i?`Too big: expected ${r.origin??"value"} to have ${o}${r.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${r.origin??"value"} to be ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",i=e(r.origin);return i?`Too small: expected ${r.origin} to have ${o}${r.minimum.toString()} ${i.unit}`:`Too small: expected ${r.origin} to be ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${n[o.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${Xn(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}};function bs(){return{localeError:Uu()}}var lo=class{constructor(){this._map=new Map,this._idmap=new Map}add(e,...n){let r=n[0];if(this._map.set(e,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){let n=e._zod.parent;if(n){let r={...this.get(n)??{}};return delete r.id,{...r,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function Lu(){return new lo}var xn=Lu();function Ss(t,e){return new t({type:"string",...E(e)})}function ws(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...E(e)})}function co(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...E(e)})}function Ms(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...E(e)})}function xs(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...E(e)})}function Ts(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...E(e)})}function Is(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...E(e)})}function Cs(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...E(e)})}function _s(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...E(e)})}function Ns(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...E(e)})}function vs(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...E(e)})}function Es(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...E(e)})}function As(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...E(e)})}function Rs(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...E(e)})}function Ps(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...E(e)})}function zs(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...E(e)})}function Os(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...E(e)})}function ks(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...E(e)})}function Ds(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...E(e)})}function $s(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...E(e)})}function Us(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...E(e)})}function Ls(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...E(e)})}function Vs(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...E(e)})}function qs(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...E(e)})}function Zs(t,e){return new t({type:"string",format:"date",check:"string_format",...E(e)})}function Fs(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...E(e)})}function Qs(t,e){return new t({type:"string",format:"duration",check:"string_format",...E(e)})}function Bs(t,e){return new t({type:"number",checks:[],...E(e)})}function Ks(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...E(e)})}function Gs(t,e){return new t({type:"boolean",...E(e)})}function Ys(t,e){return new t({type:"null",...E(e)})}function js(t){return new t({type:"unknown"})}function Ws(t,e){return new t({type:"never",...E(e)})}function ar(t,e){return new ro({check:"less_than",...E(e),value:t,inclusive:!1})}function Tn(t,e){return new ro({check:"less_than",...E(e),value:t,inclusive:!0})}function sr(t,e){return new oo({check:"greater_than",...E(e),value:t,inclusive:!1})}function In(t,e){return new oo({check:"greater_than",...E(e),value:t,inclusive:!0})}function lr(t,e){return new ra({check:"multiple_of",...E(e),value:t})}function cr(t,e){return new ia({check:"max_length",...E(e),maximum:t})}function Yt(t,e){return new aa({check:"min_length",...E(e),minimum:t})}function ur(t,e){return new sa({check:"length_equals",...E(e),length:t})}function uo(t,e){return new la({check:"string_format",format:"regex",...E(e),pattern:t})}function mo(t){return new ca({check:"string_format",format:"lowercase",...E(t)})}function po(t){return new ua({check:"string_format",format:"uppercase",...E(t)})}function ho(t,e){return new da({check:"string_format",format:"includes",...E(e),includes:t})}function fo(t,e){return new ma({check:"string_format",format:"starts_with",...E(e),prefix:t})}function go(t,e){return new pa({check:"string_format",format:"ends_with",...E(e),suffix:t})}function xt(t){return new ha({check:"overwrite",tx:t})}function yo(t){return xt(e=>e.normalize(t))}function bo(){return xt(t=>t.trim())}function So(){return xt(t=>t.toLowerCase())}function wo(){return xt(t=>t.toUpperCase())}function Js(t,e,n){return new t({type:"array",element:e,...E(n)})}function Hs(t,e,n){let r=E(n);return r.abort??(r.abort=!0),new t({type:"custom",check:"custom",fn:e,...r})}function Xs(t,e,n){return new t({type:"custom",check:"custom",fn:e,...E(n)})}var _n={};Lr(_n,{ZodISODate:()=>tl,ZodISODateTime:()=>el,ZodISODuration:()=>rl,ZodISOTime:()=>nl,date:()=>xo,datetime:()=>Mo,duration:()=>Io,time:()=>To});var el=f("ZodISODateTime",(t,e)=>{$a.init(t,e),K.init(t,e)});function Mo(t){return qs(el,t)}var tl=f("ZodISODate",(t,e)=>{Ua.init(t,e),K.init(t,e)});function xo(t){return Zs(tl,t)}var nl=f("ZodISOTime",(t,e)=>{La.init(t,e),K.init(t,e)});function To(t){return Fs(nl,t)}var rl=f("ZodISODuration",(t,e)=>{Va.init(t,e),K.init(t,e)});function Io(t){return Qs(rl,t)}var ol=(t,e)=>{nr.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>xi(t,n)},flatten:{value:n=>Mi(t,n)},addIssue:{value:n=>t.issues.push(n)},addIssues:{value:n=>t.issues.push(...n)},isEmpty:{get(){return t.issues.length===0}}})},Pb=f("ZodError",ol),Nn=f("ZodError",ol,{Parent:Error});var il=Ti(Nn),al=Ii(Nn),sl=Hr(Nn),ll=Xr(Nn);var J=f("ZodType",(t,e)=>(Z.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...n)=>t.clone({...e,checks:[...e.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),t.clone=(n,r)=>ke(t,n,r),t.brand=()=>t,t.register=((n,r)=>(n.add(t,r),t)),t.parse=(n,r)=>il(t,n,r,{callee:t.parse}),t.safeParse=(n,r)=>sl(t,n,r),t.parseAsync=async(n,r)=>al(t,n,r,{callee:t.parseAsync}),t.safeParseAsync=async(n,r)=>ll(t,n,r),t.spa=t.safeParseAsync,t.refine=(n,r)=>t.check(Dd(n,r)),t.superRefine=n=>t.check($d(n)),t.overwrite=n=>t.check(xt(n)),t.optional=()=>Y(t),t.nullable=()=>dl(t),t.nullish=()=>Y(dl(t)),t.nonoptional=n=>Ed(t,n),t.array=()=>$(t),t.or=n=>B([t,n]),t.and=n=>mr(t,n),t.transform=n=>_o(t,yl(n)),t.default=n=>_d(t,n),t.prefault=n=>vd(t,n),t.catch=n=>Rd(t,n),t.pipe=n=>_o(t,n),t.readonly=()=>Od(t),t.describe=n=>{let r=t.clone();return xn.add(r,{description:n}),r},Object.defineProperty(t,"description",{get(){return xn.get(t)?.description},configurable:!0}),t.meta=(...n)=>{if(n.length===0)return xn.get(t);let r=t.clone();return xn.add(r,n[0]),r},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),ml=f("_ZodString",(t,e)=>{ir.init(t,e),J.init(t,e);let n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,t.regex=(...r)=>t.check(uo(...r)),t.includes=(...r)=>t.check(ho(...r)),t.startsWith=(...r)=>t.check(fo(...r)),t.endsWith=(...r)=>t.check(go(...r)),t.min=(...r)=>t.check(Yt(...r)),t.max=(...r)=>t.check(cr(...r)),t.length=(...r)=>t.check(ur(...r)),t.nonempty=(...r)=>t.check(Yt(1,...r)),t.lowercase=r=>t.check(mo(r)),t.uppercase=r=>t.check(po(r)),t.trim=()=>t.check(bo()),t.normalize=(...r)=>t.check(yo(...r)),t.toLowerCase=()=>t.check(So()),t.toUpperCase=()=>t.check(wo())}),Yu=f("ZodString",(t,e)=>{ir.init(t,e),ml.init(t,e),t.email=n=>t.check(ws(ju,n)),t.url=n=>t.check(Cs(Wu,n)),t.jwt=n=>t.check(Vs(dd,n)),t.emoji=n=>t.check(_s(Ju,n)),t.guid=n=>t.check(co(cl,n)),t.uuid=n=>t.check(Ms(dr,n)),t.uuidv4=n=>t.check(xs(dr,n)),t.uuidv6=n=>t.check(Ts(dr,n)),t.uuidv7=n=>t.check(Is(dr,n)),t.nanoid=n=>t.check(Ns(Hu,n)),t.guid=n=>t.check(co(cl,n)),t.cuid=n=>t.check(vs(Xu,n)),t.cuid2=n=>t.check(Es(ed,n)),t.ulid=n=>t.check(As(td,n)),t.base64=n=>t.check($s(ld,n)),t.base64url=n=>t.check(Us(cd,n)),t.xid=n=>t.check(Rs(nd,n)),t.ksuid=n=>t.check(Ps(rd,n)),t.ipv4=n=>t.check(zs(od,n)),t.ipv6=n=>t.check(Os(id,n)),t.cidrv4=n=>t.check(ks(ad,n)),t.cidrv6=n=>t.check(Ds(sd,n)),t.e164=n=>t.check(Ls(ud,n)),t.datetime=n=>t.check(Mo(n)),t.date=n=>t.check(xo(n)),t.time=n=>t.check(To(n)),t.duration=n=>t.check(Io(n))});function p(t){return Ss(Yu,t)}var K=f("ZodStringFormat",(t,e)=>{Q.init(t,e),ml.init(t,e)}),ju=f("ZodEmail",(t,e)=>{va.init(t,e),K.init(t,e)});var cl=f("ZodGUID",(t,e)=>{_a.init(t,e),K.init(t,e)});var dr=f("ZodUUID",(t,e)=>{Na.init(t,e),K.init(t,e)});var Wu=f("ZodURL",(t,e)=>{Ea.init(t,e),K.init(t,e)});var Ju=f("ZodEmoji",(t,e)=>{Aa.init(t,e),K.init(t,e)});var Hu=f("ZodNanoID",(t,e)=>{Ra.init(t,e),K.init(t,e)});var Xu=f("ZodCUID",(t,e)=>{Pa.init(t,e),K.init(t,e)});var ed=f("ZodCUID2",(t,e)=>{za.init(t,e),K.init(t,e)});var td=f("ZodULID",(t,e)=>{Oa.init(t,e),K.init(t,e)});var nd=f("ZodXID",(t,e)=>{ka.init(t,e),K.init(t,e)});var rd=f("ZodKSUID",(t,e)=>{Da.init(t,e),K.init(t,e)});var od=f("ZodIPv4",(t,e)=>{qa.init(t,e),K.init(t,e)});var id=f("ZodIPv6",(t,e)=>{Za.init(t,e),K.init(t,e)});var ad=f("ZodCIDRv4",(t,e)=>{Fa.init(t,e),K.init(t,e)});var sd=f("ZodCIDRv6",(t,e)=>{Qa.init(t,e),K.init(t,e)});var ld=f("ZodBase64",(t,e)=>{Ka.init(t,e),K.init(t,e)});var cd=f("ZodBase64URL",(t,e)=>{Ga.init(t,e),K.init(t,e)});var ud=f("ZodE164",(t,e)=>{Ya.init(t,e),K.init(t,e)});var dd=f("ZodJWT",(t,e)=>{ja.init(t,e),K.init(t,e)});var pl=f("ZodNumber",(t,e)=>{ao.init(t,e),J.init(t,e),t.gt=(r,o)=>t.check(sr(r,o)),t.gte=(r,o)=>t.check(In(r,o)),t.min=(r,o)=>t.check(In(r,o)),t.lt=(r,o)=>t.check(ar(r,o)),t.lte=(r,o)=>t.check(Tn(r,o)),t.max=(r,o)=>t.check(Tn(r,o)),t.int=r=>t.check(ul(r)),t.safe=r=>t.check(ul(r)),t.positive=r=>t.check(sr(0,r)),t.nonnegative=r=>t.check(In(0,r)),t.negative=r=>t.check(ar(0,r)),t.nonpositive=r=>t.check(Tn(0,r)),t.multipleOf=(r,o)=>t.check(lr(r,o)),t.step=(r,o)=>t.check(lr(r,o)),t.finite=()=>t;let n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});function L(t){return Bs(pl,t)}var md=f("ZodNumberFormat",(t,e)=>{Wa.init(t,e),pl.init(t,e)});function ul(t){return Ks(md,t)}var pd=f("ZodBoolean",(t,e)=>{Ja.init(t,e),J.init(t,e)});function ne(t){return Gs(pd,t)}var hd=f("ZodNull",(t,e)=>{Ha.init(t,e),J.init(t,e)});function hl(t){return Ys(hd,t)}var fd=f("ZodUnknown",(t,e)=>{Xa.init(t,e),J.init(t,e)});function G(){return js(fd)}var gd=f("ZodNever",(t,e)=>{es.init(t,e),J.init(t,e)});function yd(t){return Ws(gd,t)}var bd=f("ZodArray",(t,e)=>{ts.init(t,e),J.init(t,e),t.element=e.element,t.min=(n,r)=>t.check(Yt(n,r)),t.nonempty=n=>t.check(Yt(1,n)),t.max=(n,r)=>t.check(cr(n,r)),t.length=(n,r)=>t.check(ur(n,r)),t.unwrap=()=>t.element});function $(t,e){return Js(bd,t,e)}var fl=f("ZodObject",(t,e)=>{ns.init(t,e),J.init(t,e),U.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>fe(Object.keys(t._zod.def.shape)),t.catchall=n=>t.clone({...t._zod.def,catchall:n}),t.passthrough=()=>t.clone({...t._zod.def,catchall:G()}),t.loose=()=>t.clone({...t._zod.def,catchall:G()}),t.strict=()=>t.clone({...t._zod.def,catchall:yd()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=n=>U.extend(t,n),t.merge=n=>U.merge(t,n),t.pick=n=>U.pick(t,n),t.omit=n=>U.omit(t,n),t.partial=(...n)=>U.partial(bl,t,n[0]),t.required=(...n)=>U.required(Sl,t,n[0])});function I(t,e){let n={type:"object",get shape(){return U.assignProp(this,"shape",{...t}),this.shape},...U.normalizeParams(e)};return new fl(n)}function he(t,e){return new fl({type:"object",get shape(){return U.assignProp(this,"shape",{...t}),this.shape},catchall:G(),...U.normalizeParams(e)})}var gl=f("ZodUnion",(t,e)=>{so.init(t,e),J.init(t,e),t.options=e.options});function B(t,e){return new gl({type:"union",options:t,...U.normalizeParams(e)})}var Sd=f("ZodDiscriminatedUnion",(t,e)=>{gl.init(t,e),rs.init(t,e)});function No(t,e,n){return new Sd({type:"union",options:e,discriminator:t,...U.normalizeParams(n)})}var wd=f("ZodIntersection",(t,e)=>{os.init(t,e),J.init(t,e)});function mr(t,e){return new wd({type:"intersection",left:t,right:e})}var Md=f("ZodRecord",(t,e)=>{is.init(t,e),J.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function F(t,e,n){return new Md({type:"record",keyType:t,valueType:e,...U.normalizeParams(n)})}var Co=f("ZodEnum",(t,e)=>{as.init(t,e),J.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);let n=new Set(Object.keys(e.entries));t.extract=(r,o)=>{let i={};for(let a of r)if(n.has(a))i[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Co({...e,checks:[],...U.normalizeParams(o),entries:i})},t.exclude=(r,o)=>{let i={...e.entries};for(let a of r)if(n.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new Co({...e,checks:[],...U.normalizeParams(o),entries:i})}});function fe(t,e){let n=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new Co({type:"enum",entries:n,...U.normalizeParams(e)})}var xd=f("ZodLiteral",(t,e)=>{ss.init(t,e),J.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function _(t,e){return new xd({type:"literal",values:Array.isArray(t)?t:[t],...U.normalizeParams(e)})}var Td=f("ZodTransform",(t,e)=>{ls.init(t,e),J.init(t,e),t._zod.parse=(n,r)=>{n.addIssue=i=>{if(typeof i=="string")n.issues.push(U.issue(i,n.value,e));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=t),a.continue??(a.continue=!0),n.issues.push(U.issue(a))}};let o=e.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function yl(t){return new Td({type:"transform",transform:t})}var bl=f("ZodOptional",(t,e)=>{cs.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Y(t){return new bl({type:"optional",innerType:t})}var Id=f("ZodNullable",(t,e)=>{us.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType});function dl(t){return new Id({type:"nullable",innerType:t})}var Cd=f("ZodDefault",(t,e)=>{ds.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function _d(t,e){return new Cd({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}var Nd=f("ZodPrefault",(t,e)=>{ms.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType});function vd(t,e){return new Nd({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}var Sl=f("ZodNonOptional",(t,e)=>{ps.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Ed(t,e){return new Sl({type:"nonoptional",innerType:t,...U.normalizeParams(e)})}var Ad=f("ZodCatch",(t,e)=>{hs.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function Rd(t,e){return new Ad({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var Pd=f("ZodPipe",(t,e)=>{fs.init(t,e),J.init(t,e),t.in=e.in,t.out=e.out});function _o(t,e){return new Pd({type:"pipe",in:t,out:e})}var zd=f("ZodReadonly",(t,e)=>{gs.init(t,e),J.init(t,e)});function Od(t){return new zd({type:"readonly",innerType:t})}var wl=f("ZodCustom",(t,e)=>{ys.init(t,e),J.init(t,e)});function kd(t){let e=new ue({check:"custom"});return e._zod.check=t,e}function Ml(t,e){return Hs(wl,t??(()=>!0),e)}function Dd(t,e={}){return Xs(wl,t,e)}function $d(t){let e=kd(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(U.issue(r,n.value,e._zod.def));else{let o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),o.continue??(o.continue=!e._zod.def.abort),n.issues.push(U.issue(o))}},t(n.value,n)));return e}function vo(t,e){return _o(yl(t),e)}Me(bs());var Ud="io.modelcontextprotocol/related-task",hr="2.0",te=Ml(t=>t!==null&&(typeof t=="object"||typeof t=="function")),xl=B([p(),L().int()]),Tl=p(),CS=he({ttl:L().optional(),pollInterval:L().optional()}),Ld=I({ttl:L().optional()}),Vd=I({taskId:p()}),Ao=he({progressToken:xl.optional(),[Ud]:Vd.optional()}),Se=I({_meta:Ao.optional()}),fr=Se.extend({task:Ld.optional()});var ie=I({method:p(),params:Se.loose().optional()}),xe=I({_meta:Ao.optional()}),Te=I({method:p(),params:xe.loose().optional()}),ae=he({_meta:Ao.optional()}),gr=B([p(),L().int()]),qd=I({jsonrpc:_(hr),id:gr,...ie.shape}).strict();var Zd=I({jsonrpc:_(hr),...Te.shape}).strict();var Il=I({jsonrpc:_(hr),id:gr,result:ae}).strict();var Tt;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Tt||(Tt={}));var Cl=I({jsonrpc:_(hr),id:gr.optional(),error:I({code:L().int(),message:p(),data:G().optional()})}).strict();var _S=B([qd,Zd,Il,Cl]),NS=B([Il,Cl]),_l=ae.strict(),Fd=xe.extend({requestId:gr.optional(),reason:p().optional()}),Nl=Te.extend({method:_("notifications/cancelled"),params:Fd}),Qd=I({src:p(),mimeType:p().optional(),sizes:$(p()).optional(),theme:fe(["light","dark"]).optional()}),En=I({icons:$(Qd).optional()}),jt=I({name:p(),title:p().optional()}),vl=jt.extend({...jt.shape,...En.shape,version:p(),websiteUrl:p().optional(),description:p().optional()}),Bd=mr(I({applyDefaults:ne().optional()}),F(p(),G())),Kd=vo(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,mr(I({form:Bd.optional(),url:te.optional()}),F(p(),G()).optional())),Gd=he({list:te.optional(),cancel:te.optional(),requests:he({sampling:he({createMessage:te.optional()}).optional(),elicitation:he({create:te.optional()}).optional()}).optional()}),Yd=he({list:te.optional(),cancel:te.optional(),requests:he({tools:he({call:te.optional()}).optional()}).optional()}),jd=I({experimental:F(p(),te).optional(),sampling:I({context:te.optional(),tools:te.optional()}).optional(),elicitation:Kd.optional(),roots:I({listChanged:ne().optional()}).optional(),tasks:Gd.optional(),extensions:F(p(),te).optional()}),Wd=Se.extend({protocolVersion:p(),capabilities:jd,clientInfo:vl}),Jd=ie.extend({method:_("initialize"),params:Wd});var Hd=I({experimental:F(p(),te).optional(),logging:te.optional(),completions:te.optional(),prompts:I({listChanged:ne().optional()}).optional(),resources:I({subscribe:ne().optional(),listChanged:ne().optional()}).optional(),tools:I({listChanged:ne().optional()}).optional(),tasks:Yd.optional(),extensions:F(p(),te).optional()}),Xd=ae.extend({protocolVersion:p(),capabilities:Hd,serverInfo:vl,instructions:p().optional()}),em=Te.extend({method:_("notifications/initialized"),params:xe.optional()});var El=ie.extend({method:_("ping"),params:Se.optional()}),tm=I({progress:L(),total:Y(L()),message:Y(p())}),nm=I({...xe.shape,...tm.shape,progressToken:xl}),Al=Te.extend({method:_("notifications/progress"),params:nm}),rm=Se.extend({cursor:Tl.optional()}),An=ie.extend({params:rm.optional()}),Rn=ae.extend({nextCursor:Tl.optional()}),om=fe(["working","input_required","completed","failed","cancelled"]),Pn=I({taskId:p(),status:om,ttl:B([L(),hl()]),createdAt:p(),lastUpdatedAt:p(),pollInterval:Y(L()),statusMessage:Y(p())}),Rl=ae.extend({task:Pn}),im=xe.merge(Pn),Pl=Te.extend({method:_("notifications/tasks/status"),params:im}),zl=ie.extend({method:_("tasks/get"),params:Se.extend({taskId:p()})}),Ol=ae.merge(Pn),kl=ie.extend({method:_("tasks/result"),params:Se.extend({taskId:p()})}),vS=ae.loose(),Dl=An.extend({method:_("tasks/list")}),$l=Rn.extend({tasks:$(Pn)}),Ul=ie.extend({method:_("tasks/cancel"),params:Se.extend({taskId:p()})}),ES=ae.merge(Pn),Ll=I({uri:p(),mimeType:Y(p()),_meta:F(p(),G()).optional()}),Vl=Ll.extend({text:p()}),Ro=p().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),ql=Ll.extend({blob:Ro}),zn=fe(["user","assistant"]),Wt=I({audience:$(zn).optional(),priority:L().min(0).max(1).optional(),lastModified:_n.datetime({offset:!0}).optional()}),Zl=I({...jt.shape,...En.shape,uri:p(),description:Y(p()),mimeType:Y(p()),size:Y(L()),annotations:Wt.optional(),_meta:Y(he({}))}),am=I({...jt.shape,...En.shape,uriTemplate:p(),description:Y(p()),mimeType:Y(p()),annotations:Wt.optional(),_meta:Y(he({}))}),sm=An.extend({method:_("resources/list")}),lm=Rn.extend({resources:$(Zl)}),cm=An.extend({method:_("resources/templates/list")}),um=Rn.extend({resourceTemplates:$(am)}),Po=Se.extend({uri:p()}),dm=Po,mm=ie.extend({method:_("resources/read"),params:dm}),pm=ae.extend({contents:$(B([Vl,ql]))}),hm=Te.extend({method:_("notifications/resources/list_changed"),params:xe.optional()}),fm=Po,gm=ie.extend({method:_("resources/subscribe"),params:fm}),ym=Po,bm=ie.extend({method:_("resources/unsubscribe"),params:ym}),Sm=xe.extend({uri:p()}),wm=Te.extend({method:_("notifications/resources/updated"),params:Sm}),Mm=I({name:p(),description:Y(p()),required:Y(ne())}),xm=I({...jt.shape,...En.shape,description:Y(p()),arguments:Y($(Mm)),_meta:Y(he({}))}),Tm=An.extend({method:_("prompts/list")}),Im=Rn.extend({prompts:$(xm)}),Cm=Se.extend({name:p(),arguments:F(p(),p()).optional()}),_m=ie.extend({method:_("prompts/get"),params:Cm}),zo=I({type:_("text"),text:p(),annotations:Wt.optional(),_meta:F(p(),G()).optional()}),Oo=I({type:_("image"),data:Ro,mimeType:p(),annotations:Wt.optional(),_meta:F(p(),G()).optional()}),ko=I({type:_("audio"),data:Ro,mimeType:p(),annotations:Wt.optional(),_meta:F(p(),G()).optional()}),Nm=I({type:_("tool_use"),name:p(),id:p(),input:F(p(),G()),_meta:F(p(),G()).optional()}),vm=I({type:_("resource"),resource:B([Vl,ql]),annotations:Wt.optional(),_meta:F(p(),G()).optional()}),Em=Zl.extend({type:_("resource_link")}),Do=B([zo,Oo,ko,Em,vm]),Am=I({role:zn,content:Do}),Rm=ae.extend({description:p().optional(),messages:$(Am)}),Pm=Te.extend({method:_("notifications/prompts/list_changed"),params:xe.optional()}),zm=I({title:p().optional(),readOnlyHint:ne().optional(),destructiveHint:ne().optional(),idempotentHint:ne().optional(),openWorldHint:ne().optional()}),Om=I({taskSupport:fe(["required","optional","forbidden"]).optional()}),Fl=I({...jt.shape,...En.shape,description:p().optional(),inputSchema:I({type:_("object"),properties:F(p(),te).optional(),required:$(p()).optional()}).catchall(G()),outputSchema:I({type:_("object"),properties:F(p(),te).optional(),required:$(p()).optional()}).catchall(G()).optional(),annotations:zm.optional(),execution:Om.optional(),_meta:F(p(),G()).optional()}),km=An.extend({method:_("tools/list")}),Dm=Rn.extend({tools:$(Fl)}),Ql=ae.extend({content:$(Do).default([]),structuredContent:F(p(),G()).optional(),isError:ne().optional()}),AS=Ql.or(ae.extend({toolResult:G()})),$m=fr.extend({name:p(),arguments:F(p(),G()).optional()}),Um=ie.extend({method:_("tools/call"),params:$m}),Lm=Te.extend({method:_("notifications/tools/list_changed"),params:xe.optional()}),RS=I({autoRefresh:ne().default(!0),debounceMs:L().int().nonnegative().default(300)}),Bl=fe(["debug","info","notice","warning","error","critical","alert","emergency"]),Vm=Se.extend({level:Bl}),qm=ie.extend({method:_("logging/setLevel"),params:Vm}),Zm=xe.extend({level:Bl,logger:p().optional(),data:G()}),Fm=Te.extend({method:_("notifications/message"),params:Zm}),Qm=I({name:p().optional()}),Bm=I({hints:$(Qm).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),Km=I({mode:fe(["auto","required","none"]).optional()}),Gm=I({type:_("tool_result"),toolUseId:p().describe("The unique identifier for the corresponding tool call."),content:$(Do).default([]),structuredContent:I({}).loose().optional(),isError:ne().optional(),_meta:F(p(),G()).optional()}),Ym=No("type",[zo,Oo,ko]),pr=No("type",[zo,Oo,ko,Nm,Gm]),jm=I({role:zn,content:B([pr,$(pr)]),_meta:F(p(),G()).optional()}),Wm=fr.extend({messages:$(jm),modelPreferences:Bm.optional(),systemPrompt:p().optional(),includeContext:fe(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:$(p()).optional(),metadata:te.optional(),tools:$(Fl).optional(),toolChoice:Km.optional()}),Jm=ie.extend({method:_("sampling/createMessage"),params:Wm}),Hm=ae.extend({model:p(),stopReason:Y(fe(["endTurn","stopSequence","maxTokens"]).or(p())),role:zn,content:Ym}),Xm=ae.extend({model:p(),stopReason:Y(fe(["endTurn","stopSequence","maxTokens","toolUse"]).or(p())),role:zn,content:B([pr,$(pr)])}),ep=I({type:_("boolean"),title:p().optional(),description:p().optional(),default:ne().optional()}),tp=I({type:_("string"),title:p().optional(),description:p().optional(),minLength:L().optional(),maxLength:L().optional(),format:fe(["email","uri","date","date-time"]).optional(),default:p().optional()}),np=I({type:fe(["number","integer"]),title:p().optional(),description:p().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),rp=I({type:_("string"),title:p().optional(),description:p().optional(),enum:$(p()),default:p().optional()}),op=I({type:_("string"),title:p().optional(),description:p().optional(),oneOf:$(I({const:p(),title:p()})),default:p().optional()}),ip=I({type:_("string"),title:p().optional(),description:p().optional(),enum:$(p()),enumNames:$(p()).optional(),default:p().optional()}),ap=B([rp,op]),sp=I({type:_("array"),title:p().optional(),description:p().optional(),minItems:L().optional(),maxItems:L().optional(),items:I({type:_("string"),enum:$(p())}),default:$(p()).optional()}),lp=I({type:_("array"),title:p().optional(),description:p().optional(),minItems:L().optional(),maxItems:L().optional(),items:I({anyOf:$(I({const:p(),title:p()}))}),default:$(p()).optional()}),cp=B([sp,lp]),up=B([ip,ap,cp]),dp=B([up,ep,tp,np]),mp=fr.extend({mode:_("form").optional(),message:p(),requestedSchema:I({type:_("object"),properties:F(p(),dp),required:$(p()).optional()})}),pp=fr.extend({mode:_("url"),message:p(),elicitationId:p(),url:p().url()}),hp=B([mp,pp]),fp=ie.extend({method:_("elicitation/create"),params:hp}),gp=xe.extend({elicitationId:p()}),yp=Te.extend({method:_("notifications/elicitation/complete"),params:gp}),bp=ae.extend({action:fe(["accept","decline","cancel"]),content:vo(t=>t===null?void 0:t,F(p(),B([p(),L(),ne(),$(p())])).optional())}),Sp=I({type:_("ref/resource"),uri:p()});var wp=I({type:_("ref/prompt"),name:p()}),Mp=Se.extend({ref:B([wp,Sp]),argument:I({name:p(),value:p()}),context:I({arguments:F(p(),p()).optional()}).optional()}),xp=ie.extend({method:_("completion/complete"),params:Mp});var Tp=ae.extend({completion:he({values:$(p()).max(100),total:Y(L().int()),hasMore:Y(ne())})}),Ip=I({uri:p().startsWith("file://"),name:p().optional(),_meta:F(p(),G()).optional()}),Cp=ie.extend({method:_("roots/list"),params:Se.optional()}),_p=ae.extend({roots:$(Ip)}),Np=Te.extend({method:_("notifications/roots/list_changed"),params:xe.optional()}),PS=B([El,Jd,xp,qm,_m,Tm,sm,cm,mm,gm,bm,Um,km,zl,kl,Dl,Ul]),zS=B([Nl,Al,em,Np,Pl]),OS=B([_l,Hm,Xm,bp,_p,Ol,$l,Rl]),kS=B([El,Jm,fp,Cp,zl,kl,Dl,Ul]),DS=B([Nl,Al,Fm,wm,hm,Lm,Pm,Pl,yp]),$S=B([_l,Xd,Tp,Rm,Im,lm,um,pm,Ql,Dm,Ol,$l,Rl]),vn=class t extends Error{constructor(e,n,r){super(`MCP error ${e}: ${n}`),this.code=e,this.data=r,this.name="McpError"}static fromError(e,n,r){if(e===Tt.UrlElicitationRequired&&r){let o=r;if(o.elicitations)return new Eo(o.elicitations,n)}return new t(e,n,r)}},Eo=class extends vn{constructor(e,n=`URL elicitation${e.length>1?"s":""} required`){super(Tt.UrlElicitationRequired,n,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};var oc=require("url");var Vo={};Lr(Vo,{BRAND:()=>Xp,DIRTY:()=>It,EMPTY_PATH:()=>Rp,INVALID:()=>A,NEVER:()=>$h,OK:()=>de,ParseStatus:()=>se,Schema:()=>k,ZodAny:()=>at,ZodArray:()=>He,ZodBigInt:()=>_t,ZodBoolean:()=>Nt,ZodBranded:()=>kn,ZodCatch:()=>Ut,ZodDate:()=>vt,ZodDefault:()=>$t,ZodDiscriminatedUnion:()=>Sr,ZodEffects:()=>_e,ZodEnum:()=>kt,ZodError:()=>ge,ZodFirstPartyTypeKind:()=>P,ZodFunction:()=>Mr,ZodIntersection:()=>Pt,ZodIssueCode:()=>w,ZodLazy:()=>zt,ZodLiteral:()=>Ot,ZodMap:()=>nn,ZodNaN:()=>on,ZodNativeEnum:()=>Dt,ZodNever:()=>ze,ZodNull:()=>At,ZodNullable:()=>Le,ZodNumber:()=>Ct,ZodObject:()=>ye,ZodOptional:()=>Ie,ZodParsedType:()=>T,ZodPipeline:()=>Dn,ZodPromise:()=>st,ZodReadonly:()=>Lt,ZodRecord:()=>wr,ZodSchema:()=>k,ZodSet:()=>rn,ZodString:()=>it,ZodSymbol:()=>en,ZodTransformer:()=>_e,ZodTuple:()=>Ue,ZodType:()=>k,ZodUndefined:()=>Et,ZodUnion:()=>Rt,ZodUnknown:()=>Je,ZodVoid:()=>tn,addIssueToContext:()=>x,any:()=>lh,array:()=>mh,bigint:()=>rh,boolean:()=>nc,coerce:()=>Dh,custom:()=>Xl,date:()=>oh,datetimeRegex:()=>Jl,defaultErrorMap:()=>je,discriminatedUnion:()=>gh,effect:()=>vh,enum:()=>Ch,function:()=>xh,getErrorMap:()=>Jt,getParsedType:()=>$e,instanceof:()=>th,intersection:()=>yh,isAborted:()=>yr,isAsync:()=>Ht,isDirty:()=>br,isValid:()=>ot,late:()=>eh,lazy:()=>Th,literal:()=>Ih,makeIssue:()=>On,map:()=>wh,nan:()=>nh,nativeEnum:()=>_h,never:()=>uh,null:()=>sh,nullable:()=>Ah,number:()=>tc,object:()=>ph,objectUtil:()=>$o,oboolean:()=>kh,onumber:()=>Oh,optional:()=>Eh,ostring:()=>zh,pipeline:()=>Ph,preprocess:()=>Rh,promise:()=>Nh,quotelessJson:()=>vp,record:()=>Sh,set:()=>Mh,setErrorMap:()=>Ap,strictObject:()=>hh,string:()=>ec,symbol:()=>ih,transformer:()=>vh,tuple:()=>bh,undefined:()=>ah,union:()=>fh,unknown:()=>ch,util:()=>D,void:()=>dh});var D;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{let i={};for(let a of o)i[a]=a;return i},t.getValidEnumValues=o=>{let i=t.objectKeys(o).filter(s=>typeof o[o[s]]!="number"),a={};for(let s of i)a[s]=o[s];return t.objectValues(a)},t.objectValues=o=>t.objectKeys(o).map(function(i){return o[i]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let a in o)Object.prototype.hasOwnProperty.call(o,a)&&i.push(a);return i},t.find=(o,i)=>{for(let a of o)if(i(a))return a},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,i=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(D||(D={}));var $o;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})($o||($o={}));var T=D.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$e=t=>{switch(typeof t){case"undefined":return T.undefined;case"string":return T.string;case"number":return Number.isNaN(t)?T.nan:T.number;case"boolean":return T.boolean;case"function":return T.function;case"bigint":return T.bigint;case"symbol":return T.symbol;case"object":return Array.isArray(t)?T.array:t===null?T.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?T.promise:typeof Map<"u"&&t instanceof Map?T.map:typeof Set<"u"&&t instanceof Set?T.set:typeof Date<"u"&&t instanceof Date?T.date:T.object;default:return T.unknown}};var w=D.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),vp=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),ge=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(i){return i.message},r={_errors:[]},o=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let s=r,l=0;for(;l<a.path.length;){let c=a.path[l];l===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(n(a))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return o(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,D.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];n[i]=n[i]||[],n[i].push(e(o))}else r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};ge.create=t=>new ge(t);var Ep=(t,e)=>{let n;switch(t.code){case w.invalid_type:t.received===T.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case w.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,D.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:n=`Unrecognized key(s) in object: ${D.joinValues(t.keys,", ")}`;break;case w.invalid_union:n="Invalid input";break;case w.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${D.joinValues(t.options)}`;break;case w.invalid_enum_value:n=`Invalid enum value. Expected ${D.joinValues(t.options)}, received '${t.received}'`;break;case w.invalid_arguments:n="Invalid function arguments";break;case w.invalid_return_type:n="Invalid function return type";break;case w.invalid_date:n="Invalid date";break;case w.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:D.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case w.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case w.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case w.custom:n="Invalid input";break;case w.invalid_intersection_types:n="Intersection results could not be merged";break;case w.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case w.not_finite:n="Number must be finite";break;default:n=e.defaultError,D.assertNever(t)}return{message:n}},je=Ep;var Kl=je;function Ap(t){Kl=t}function Jt(){return Kl}var On=t=>{let{data:e,path:n,errorMaps:r,issueData:o}=t,i=[...n,...o.path||[]],a={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let s="",l=r.filter(c=>!!c).slice().reverse();for(let c of l)s=c(a,{data:e,defaultError:s}).message;return{...o,path:i,message:s}},Rp=[];function x(t,e){let n=Jt(),r=On({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===je?void 0:je].filter(o=>!!o)});t.common.issues.push(r)}var se=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let o of n){if(o.status==="aborted")return A;o.status==="dirty"&&e.dirty(),r.push(o.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let o of n){let i=await o.key,a=await o.value;r.push({key:i,value:a})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let o of n){let{key:i,value:a}=o;if(i.status==="aborted"||a.status==="aborted")return A;i.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet)&&(r[i.value]=a.value)}return{status:e.value,value:r}}},A=Object.freeze({status:"aborted"}),It=t=>({status:"dirty",value:t}),de=t=>({status:"valid",value:t}),yr=t=>t.status==="aborted",br=t=>t.status==="dirty",ot=t=>t.status==="valid",Ht=t=>typeof Promise<"u"&&t instanceof Promise;var C;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(C||(C={}));var Ce=class{constructor(e,n,r,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Gl=(t,e)=>{if(ot(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new ge(t.common.issues);return this._error=n,this._error}}};function O(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:o}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(a,s)=>{let{message:l}=t;return a.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??r??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:l??n??s.defaultError}},description:o}}var k=class{get description(){return this._def.description}_getType(e){return $e(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:$e(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new se,ctx:{common:e.parent.common,data:e.data,parsedType:$e(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(Ht(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$e(e)},o=this._parseSync({data:e,path:r.path,parent:r});return Gl(r,o)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$e(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return ot(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>ot(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$e(e)},o=this._parse({data:e,path:r.path,parent:r}),i=await(Ht(o)?o:Promise.resolve(o));return Gl(r,i)}refine(e,n){let r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,i)=>{let a=e(o),s=()=>i.addIssue({code:w.custom,...r(o)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(e,n){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(e){return new _e({schema:this,typeName:P.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Ie.create(this,this._def)}nullable(){return Le.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return He.create(this)}promise(){return st.create(this,this._def)}or(e){return Rt.create([this,e],this._def)}and(e){return Pt.create(this,e,this._def)}transform(e){return new _e({...O(this._def),schema:this,typeName:P.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new $t({...O(this._def),innerType:this,defaultValue:n,typeName:P.ZodDefault})}brand(){return new kn({typeName:P.ZodBranded,type:this,...O(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Ut({...O(this._def),innerType:this,catchValue:n,typeName:P.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Dn.create(this,e)}readonly(){return Lt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Pp=/^c[^\s-]{8,}$/i,zp=/^[0-9a-z]+$/,Op=/^[0-9A-HJKMNP-TV-Z]{26}$/i,kp=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Dp=/^[a-z0-9_-]{21}$/i,$p=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Up=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Lp=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Vp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Uo,qp=/^(?:(?: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])$/,Zp=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,Fp=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Qp=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Bp=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Kp=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,jl="((\\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])))",Gp=new RegExp(`^${jl}$`);function Wl(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Yp(t){return new RegExp(`^${Wl(t)}$`)}function Jl(t){let e=`${jl}T${Wl(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function jp(t,e){return!!((e==="v4"||!e)&&qp.test(t)||(e==="v6"||!e)&&Fp.test(t))}function Wp(t,e){if(!$p.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function Jp(t,e){return!!((e==="v4"||!e)&&Zp.test(t)||(e==="v6"||!e)&&Qp.test(t))}var it=class t extends k{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==T.string){let i=this._getOrReturnCtx(e);return x(i,{code:w.invalid_type,expected:T.string,received:i.parsedType}),A}let r=new se,o;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:w.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:w.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){let a=e.data.length>i.value,s=e.data.length<i.value;(a||s)&&(o=this._getOrReturnCtx(e,o),a?x(o,{code:w.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&x(o,{code:w.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")Lp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"email",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Uo||(Uo=new RegExp(Vp,"u")),Uo.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"emoji",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")kp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"uuid",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")Dp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"nanoid",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")Pp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"cuid",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")zp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"cuid2",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")Op.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"ulid",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),x(o,{validation:"url",code:w.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"regex",code:w.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?Jl(i).test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?Gp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?Yp(i).test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?Up.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"duration",code:w.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?jp(e.data,i.version)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"ip",code:w.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?Wp(e.data,i.alg)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"jwt",code:w.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?Jp(e.data,i.version)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"cidr",code:w.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?Bp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"base64",code:w.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?Kp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"base64url",code:w.invalid_string,message:i.message}),r.dirty()):D.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(o=>e.test(o),{validation:n,code:w.invalid_string,...C.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...C.errToObj(e)})}url(e){return this._addCheck({kind:"url",...C.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...C.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...C.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...C.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...C.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...C.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...C.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...C.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...C.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...C.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...C.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...C.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...C.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...C.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...C.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...C.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...C.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...C.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...C.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...C.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...C.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...C.errToObj(n)})}nonempty(e){return this.min(1,C.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};it.create=t=>new it({checks:[],typeName:P.ZodString,coerce:t?.coerce??!1,...O(t)});function Hp(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,i=Number.parseInt(t.toFixed(o).replace(".","")),a=Number.parseInt(e.toFixed(o).replace(".",""));return i%a/10**o}var Ct=class t extends k{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==T.number){let i=this._getOrReturnCtx(e);return x(i,{code:w.invalid_type,expected:T.number,received:i.parsedType}),A}let r,o=new se;for(let i of this._def.checks)i.kind==="int"?D.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),x(r,{code:w.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?Hp(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),x(r,{code:w.not_finite,message:i.message}),o.dirty()):D.assertNever(i);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,C.toString(n))}gt(e,n){return this.setLimit("min",e,!1,C.toString(n))}lte(e,n){return this.setLimit("max",e,!0,C.toString(n))}lt(e,n){return this.setLimit("max",e,!1,C.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:C.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:C.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:C.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:C.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:C.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:C.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:C.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:C.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:C.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:C.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&D.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};Ct.create=t=>new Ct({checks:[],typeName:P.ZodNumber,coerce:t?.coerce||!1,...O(t)});var _t=class t extends k{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==T.bigint)return this._getInvalidInput(e);let r,o=new se;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):D.assertNever(i);return{status:o.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return x(n,{code:w.invalid_type,expected:T.bigint,received:n.parsedType}),A}gte(e,n){return this.setLimit("min",e,!0,C.toString(n))}gt(e,n){return this.setLimit("min",e,!1,C.toString(n))}lte(e,n){return this.setLimit("max",e,!0,C.toString(n))}lt(e,n){return this.setLimit("max",e,!1,C.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:C.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:C.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:C.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:C.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:C.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:C.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};_t.create=t=>new _t({checks:[],typeName:P.ZodBigInt,coerce:t?.coerce??!1,...O(t)});var Nt=class extends k{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==T.boolean){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.boolean,received:r.parsedType}),A}return de(e.data)}};Nt.create=t=>new Nt({typeName:P.ZodBoolean,coerce:t?.coerce||!1,...O(t)});var vt=class t extends k{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==T.date){let i=this._getOrReturnCtx(e);return x(i,{code:w.invalid_type,expected:T.date,received:i.parsedType}),A}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return x(i,{code:w.invalid_date}),A}let r=new se,o;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:w.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:w.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):D.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:C.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:C.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};vt.create=t=>new vt({checks:[],coerce:t?.coerce||!1,typeName:P.ZodDate,...O(t)});var en=class extends k{_parse(e){if(this._getType(e)!==T.symbol){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.symbol,received:r.parsedType}),A}return de(e.data)}};en.create=t=>new en({typeName:P.ZodSymbol,...O(t)});var Et=class extends k{_parse(e){if(this._getType(e)!==T.undefined){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.undefined,received:r.parsedType}),A}return de(e.data)}};Et.create=t=>new Et({typeName:P.ZodUndefined,...O(t)});var At=class extends k{_parse(e){if(this._getType(e)!==T.null){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.null,received:r.parsedType}),A}return de(e.data)}};At.create=t=>new At({typeName:P.ZodNull,...O(t)});var at=class extends k{constructor(){super(...arguments),this._any=!0}_parse(e){return de(e.data)}};at.create=t=>new at({typeName:P.ZodAny,...O(t)});var Je=class extends k{constructor(){super(...arguments),this._unknown=!0}_parse(e){return de(e.data)}};Je.create=t=>new Je({typeName:P.ZodUnknown,...O(t)});var ze=class extends k{_parse(e){let n=this._getOrReturnCtx(e);return x(n,{code:w.invalid_type,expected:T.never,received:n.parsedType}),A}};ze.create=t=>new ze({typeName:P.ZodNever,...O(t)});var tn=class extends k{_parse(e){if(this._getType(e)!==T.undefined){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.void,received:r.parsedType}),A}return de(e.data)}};tn.create=t=>new tn({typeName:P.ZodVoid,...O(t)});var He=class t extends k{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==T.array)return x(n,{code:w.invalid_type,expected:T.array,received:n.parsedType}),A;if(o.exactLength!==null){let a=n.data.length>o.exactLength.value,s=n.data.length<o.exactLength.value;(a||s)&&(x(n,{code:a?w.too_big:w.too_small,minimum:s?o.exactLength.value:void 0,maximum:a?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(x(n,{code:w.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(x(n,{code:w.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>o.type._parseAsync(new Ce(n,a,n.path,s)))).then(a=>se.mergeArray(r,a));let i=[...n.data].map((a,s)=>o.type._parseSync(new Ce(n,a,n.path,s)));return se.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:C.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:C.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:C.toString(n)}})}nonempty(e){return this.min(1,e)}};He.create=(t,e)=>new He({type:t,minLength:null,maxLength:null,exactLength:null,typeName:P.ZodArray,...O(e)});function Xt(t){if(t instanceof ye){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=Ie.create(Xt(r))}return new ye({...t._def,shape:()=>e})}else return t instanceof He?new He({...t._def,type:Xt(t.element)}):t instanceof Ie?Ie.create(Xt(t.unwrap())):t instanceof Le?Le.create(Xt(t.unwrap())):t instanceof Ue?Ue.create(t.items.map(e=>Xt(e))):t}var ye=class t extends k{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=D.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==T.object){let c=this._getOrReturnCtx(e);return x(c,{code:w.invalid_type,expected:T.object,received:c.parsedType}),A}let{status:r,ctx:o}=this._processInputParams(e),{shape:i,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof ze&&this._def.unknownKeys==="strip"))for(let c in o.data)a.includes(c)||s.push(c);let l=[];for(let c of a){let m=i[c],d=o.data[c];l.push({key:{status:"valid",value:c},value:m._parse(new Ce(o,d,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof ze){let c=this._def.unknownKeys;if(c==="passthrough")for(let m of s)l.push({key:{status:"valid",value:m},value:{status:"valid",value:o.data[m]}});else if(c==="strict")s.length>0&&(x(o,{code:w.unrecognized_keys,keys:s}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let m of s){let d=o.data[m];l.push({key:{status:"valid",value:m},value:c._parse(new Ce(o,d,o.path,m)),alwaysSet:m in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let c=[];for(let m of l){let d=await m.key,h=await m.value;c.push({key:d,value:h,alwaysSet:m.alwaysSet})}return c}).then(c=>se.mergeObjectSync(r,c)):se.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return C.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let o=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:C.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:P.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of D.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of D.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return Xt(this)}partial(e){let n={};for(let r of D.objectKeys(this.shape)){let o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of D.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Ie;)i=i._def.innerType;n[r]=i}return new t({...this._def,shape:()=>n})}keyof(){return Hl(D.objectKeys(this.shape))}};ye.create=(t,e)=>new ye({shape:()=>t,unknownKeys:"strip",catchall:ze.create(),typeName:P.ZodObject,...O(e)});ye.strictCreate=(t,e)=>new ye({shape:()=>t,unknownKeys:"strict",catchall:ze.create(),typeName:P.ZodObject,...O(e)});ye.lazycreate=(t,e)=>new ye({shape:t,unknownKeys:"strip",catchall:ze.create(),typeName:P.ZodObject,...O(e)});var Rt=class extends k{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function o(i){for(let s of i)if(s.result.status==="valid")return s.result;for(let s of i)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(s=>new ge(s.ctx.common.issues));return x(n,{code:w.invalid_union,unionErrors:a}),A}if(n.common.async)return Promise.all(r.map(async i=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(o);{let i,a=[];for(let l of r){let c={...n,common:{...n.common,issues:[]},parent:null},m=l._parseSync({data:n.data,path:n.path,parent:c});if(m.status==="valid")return m;m.status==="dirty"&&!i&&(i={result:m,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let s=a.map(l=>new ge(l));return x(n,{code:w.invalid_union,unionErrors:s}),A}}get options(){return this._def.options}};Rt.create=(t,e)=>new Rt({options:t,typeName:P.ZodUnion,...O(e)});var We=t=>t instanceof zt?We(t.schema):t instanceof _e?We(t.innerType()):t instanceof Ot?[t.value]:t instanceof kt?t.options:t instanceof Dt?D.objectValues(t.enum):t instanceof $t?We(t._def.innerType):t instanceof Et?[void 0]:t instanceof At?[null]:t instanceof Ie?[void 0,...We(t.unwrap())]:t instanceof Le?[null,...We(t.unwrap())]:t instanceof kn||t instanceof Lt?We(t.unwrap()):t instanceof Ut?We(t._def.innerType):[],Sr=class t extends k{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==T.object)return x(n,{code:w.invalid_type,expected:T.object,received:n.parsedType}),A;let r=this.discriminator,o=n.data[r],i=this.optionsMap.get(o);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(x(n,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),A)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let o=new Map;for(let i of n){let a=We(i.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of a){if(o.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);o.set(s,i)}}return new t({typeName:P.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:o,...O(r)})}};function Lo(t,e){let n=$e(t),r=$e(e);if(t===e)return{valid:!0,data:t};if(n===T.object&&r===T.object){let o=D.objectKeys(e),i=D.objectKeys(t).filter(s=>o.indexOf(s)!==-1),a={...t,...e};for(let s of i){let l=Lo(t[s],e[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(n===T.array&&r===T.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let i=0;i<t.length;i++){let a=t[i],s=e[i],l=Lo(a,s);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return n===T.date&&r===T.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Pt=class extends k{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=(i,a)=>{if(yr(i)||yr(a))return A;let s=Lo(i.value,a.value);return s.valid?((br(i)||br(a))&&n.dirty(),{status:n.value,value:s.data}):(x(r,{code:w.invalid_intersection_types}),A)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,a])=>o(i,a)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Pt.create=(t,e,n)=>new Pt({left:t,right:e,typeName:P.ZodIntersection,...O(n)});var Ue=class t extends k{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==T.array)return x(r,{code:w.invalid_type,expected:T.array,received:r.parsedType}),A;if(r.data.length<this._def.items.length)return x(r,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),A;!this._def.rest&&r.data.length>this._def.items.length&&(x(r,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...r.data].map((a,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new Ce(r,a,r.path,s)):null}).filter(a=>!!a);return r.common.async?Promise.all(i).then(a=>se.mergeArray(n,a)):se.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Ue.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ue({items:t,typeName:P.ZodTuple,rest:null,...O(e)})};var wr=class t extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==T.object)return x(r,{code:w.invalid_type,expected:T.object,received:r.parsedType}),A;let o=[],i=this._def.keyType,a=this._def.valueType;for(let s in r.data)o.push({key:i._parse(new Ce(r,s,r.path,s)),value:a._parse(new Ce(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?se.mergeObjectAsync(n,o):se.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof k?new t({keyType:e,valueType:n,typeName:P.ZodRecord,...O(r)}):new t({keyType:it.create(),valueType:e,typeName:P.ZodRecord,...O(n)})}},nn=class extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==T.map)return x(r,{code:w.invalid_type,expected:T.map,received:r.parsedType}),A;let o=this._def.keyType,i=this._def.valueType,a=[...r.data.entries()].map(([s,l],c)=>({key:o._parse(new Ce(r,s,r.path,[c,"key"])),value:i._parse(new Ce(r,l,r.path,[c,"value"]))}));if(r.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let l of a){let c=await l.key,m=await l.value;if(c.status==="aborted"||m.status==="aborted")return A;(c.status==="dirty"||m.status==="dirty")&&n.dirty(),s.set(c.value,m.value)}return{status:n.value,value:s}})}else{let s=new Map;for(let l of a){let c=l.key,m=l.value;if(c.status==="aborted"||m.status==="aborted")return A;(c.status==="dirty"||m.status==="dirty")&&n.dirty(),s.set(c.value,m.value)}return{status:n.value,value:s}}}};nn.create=(t,e,n)=>new nn({valueType:e,keyType:t,typeName:P.ZodMap,...O(n)});var rn=class t extends k{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==T.set)return x(r,{code:w.invalid_type,expected:T.set,received:r.parsedType}),A;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(x(r,{code:w.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(x(r,{code:w.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());let i=this._def.valueType;function a(l){let c=new Set;for(let m of l){if(m.status==="aborted")return A;m.status==="dirty"&&n.dirty(),c.add(m.value)}return{status:n.value,value:c}}let s=[...r.data.values()].map((l,c)=>i._parse(new Ce(r,l,r.path,c)));return r.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(e,n){return new t({...this._def,minSize:{value:e,message:C.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:C.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};rn.create=(t,e)=>new rn({valueType:t,minSize:null,maxSize:null,typeName:P.ZodSet,...O(e)});var Mr=class t extends k{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==T.function)return x(n,{code:w.invalid_type,expected:T.function,received:n.parsedType}),A;function r(s,l){return On({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Jt(),je].filter(c=>!!c),issueData:{code:w.invalid_arguments,argumentsError:l}})}function o(s,l){return On({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Jt(),je].filter(c=>!!c),issueData:{code:w.invalid_return_type,returnTypeError:l}})}let i={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof st){let s=this;return de(async function(...l){let c=new ge([]),m=await s._def.args.parseAsync(l,i).catch(g=>{throw c.addIssue(r(l,g)),c}),d=await Reflect.apply(a,this,m);return await s._def.returns._def.type.parseAsync(d,i).catch(g=>{throw c.addIssue(o(d,g)),c})})}else{let s=this;return de(function(...l){let c=s._def.args.safeParse(l,i);if(!c.success)throw new ge([r(l,c.error)]);let m=Reflect.apply(a,this,c.data),d=s._def.returns.safeParse(m,i);if(!d.success)throw new ge([o(m,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Ue.create(e).rest(Je.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||Ue.create([]).rest(Je.create()),returns:n||Je.create(),typeName:P.ZodFunction,...O(r)})}},zt=class extends k{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};zt.create=(t,e)=>new zt({getter:t,typeName:P.ZodLazy,...O(e)});var Ot=class extends k{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return x(n,{received:n.data,code:w.invalid_literal,expected:this._def.value}),A}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ot.create=(t,e)=>new Ot({value:t,typeName:P.ZodLiteral,...O(e)});function Hl(t,e){return new kt({values:t,typeName:P.ZodEnum,...O(e)})}var kt=class t extends k{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return x(n,{expected:D.joinValues(r),received:n.parsedType,code:w.invalid_type}),A}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return x(n,{received:n.data,code:w.invalid_enum_value,options:r}),A}return de(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};kt.create=Hl;var Dt=class extends k{_parse(e){let n=D.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==T.string&&r.parsedType!==T.number){let o=D.objectValues(n);return x(r,{expected:D.joinValues(o),received:r.parsedType,code:w.invalid_type}),A}if(this._cache||(this._cache=new Set(D.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=D.objectValues(n);return x(r,{received:r.data,code:w.invalid_enum_value,options:o}),A}return de(e.data)}get enum(){return this._def.values}};Dt.create=(t,e)=>new Dt({values:t,typeName:P.ZodNativeEnum,...O(e)});var st=class extends k{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==T.promise&&n.common.async===!1)return x(n,{code:w.invalid_type,expected:T.promise,received:n.parsedType}),A;let r=n.parsedType===T.promise?n.data:Promise.resolve(n.data);return de(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}};st.create=(t,e)=>new st({type:t,typeName:P.ZodPromise,...O(e)});var _e=class extends k{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===P.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,i={addIssue:a=>{x(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let a=o.transform(r.data,i);if(r.common.async)return Promise.resolve(a).then(async s=>{if(n.value==="aborted")return A;let l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?A:l.status==="dirty"?It(l.value):n.value==="dirty"?It(l.value):l});{if(n.value==="aborted")return A;let s=this._def.schema._parseSync({data:a,path:r.path,parent:r});return s.status==="aborted"?A:s.status==="dirty"?It(s.value):n.value==="dirty"?It(s.value):s}}if(o.type==="refinement"){let a=s=>{let l=o.refinement(s,i);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?A:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?A:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(o.type==="transform")if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ot(a))return A;let s=o.transform(a.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>ot(a)?Promise.resolve(o.transform(a.value,i)).then(s=>({status:n.value,value:s})):A);D.assertNever(o)}};_e.create=(t,e,n)=>new _e({schema:t,typeName:P.ZodEffects,effect:e,...O(n)});_e.createWithPreprocess=(t,e,n)=>new _e({schema:e,effect:{type:"preprocess",transform:t},typeName:P.ZodEffects,...O(n)});var Ie=class extends k{_parse(e){return this._getType(e)===T.undefined?de(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ie.create=(t,e)=>new Ie({innerType:t,typeName:P.ZodOptional,...O(e)});var Le=class extends k{_parse(e){return this._getType(e)===T.null?de(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Le.create=(t,e)=>new Le({innerType:t,typeName:P.ZodNullable,...O(e)});var $t=class extends k{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===T.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};$t.create=(t,e)=>new $t({innerType:t,typeName:P.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...O(e)});var Ut=class extends k{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Ht(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ge(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ge(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Ut.create=(t,e)=>new Ut({innerType:t,typeName:P.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...O(e)});var on=class extends k{_parse(e){if(this._getType(e)!==T.nan){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.nan,received:r.parsedType}),A}return{status:"valid",value:e.data}}};on.create=t=>new on({typeName:P.ZodNaN,...O(t)});var Xp=Symbol("zod_brand"),kn=class extends k{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Dn=class t extends k{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?A:i.status==="dirty"?(n.dirty(),It(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?A:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:P.ZodPipeline})}},Lt=class extends k{_parse(e){let n=this._def.innerType._parse(e),r=o=>(ot(o)&&(o.value=Object.freeze(o.value)),o);return Ht(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}};Lt.create=(t,e)=>new Lt({innerType:t,typeName:P.ZodReadonly,...O(e)});function Yl(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function Xl(t,e={},n){return t?at.create().superRefine((r,o)=>{let i=t(r);if(i instanceof Promise)return i.then(a=>{if(!a){let s=Yl(e,r),l=s.fatal??n??!0;o.addIssue({code:"custom",...s,fatal:l})}});if(!i){let a=Yl(e,r),s=a.fatal??n??!0;o.addIssue({code:"custom",...a,fatal:s})}}):at.create()}var eh={object:ye.lazycreate},P;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(P||(P={}));var th=(t,e={message:`Input not instance of ${t.name}`})=>Xl(n=>n instanceof t,e),ec=it.create,tc=Ct.create,nh=on.create,rh=_t.create,nc=Nt.create,oh=vt.create,ih=en.create,ah=Et.create,sh=At.create,lh=at.create,ch=Je.create,uh=ze.create,dh=tn.create,mh=He.create,ph=ye.create,hh=ye.strictCreate,fh=Rt.create,gh=Sr.create,yh=Pt.create,bh=Ue.create,Sh=wr.create,wh=nn.create,Mh=rn.create,xh=Mr.create,Th=zt.create,Ih=Ot.create,Ch=kt.create,_h=Dt.create,Nh=st.create,vh=_e.create,Eh=Ie.create,Ah=Le.create,Rh=_e.createWithPreprocess,Ph=Dn.create,zh=()=>ec().optional(),Oh=()=>tc().optional(),kh=()=>nc().optional(),Dh={string:(t=>it.create({...t,coerce:!0})),number:(t=>Ct.create({...t,coerce:!0})),boolean:(t=>Nt.create({...t,coerce:!0})),bigint:(t=>_t.create({...t,coerce:!0})),date:(t=>vt.create({...t,coerce:!0}))};var $h=A;var rc=Vo;var Uh={ResourceNotFound:-32002,InvalidParams:Tt.InvalidParams,InternalError:Tt.InternalError};var gw=rc.string().regex(/^#[0-9A-Fa-f]{6}$/,"Color must be in hex format (e.g., #FFFFFF).");var ic=t=>t.startsWith("file://")?(0,oc.fileURLToPath)(t):t;var qo=t=>new vn(Uh.InvalidParams,t);var le=[];for(let t=0;t<256;++t)le.push((t+256).toString(16).slice(1));function ac(t,e=0){return(le[t[e+0]]+le[t[e+1]]+le[t[e+2]]+le[t[e+3]]+"-"+le[t[e+4]]+le[t[e+5]]+"-"+le[t[e+6]]+le[t[e+7]]+"-"+le[t[e+8]]+le[t[e+9]]+"-"+le[t[e+10]]+le[t[e+11]]+le[t[e+12]]+le[t[e+13]]+le[t[e+14]]+le[t[e+15]]).toLowerCase()}var Lh=new Uint8Array(16);function Zo(){return crypto.getRandomValues(Lh)}function Vh(t,e,n){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():qh(t,e,n)}function qh(t,e,n){t=t||{};let r=t.random??t.rng?.()??Zo();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){if(n=n||0,n<0||n+16>e.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let o=0;o<16;++o)e[n+o]=r[o];return e}return ac(r)}var X=Vh;var Zh={equalsEntries(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],o=e[n];if(r.modelType!==o.modelType||r.modelType==="single"&&o.modelType==="single"&&r.columnModelId!==o.columnModelId||r.modelType==="group"&&o.modelType==="group"&&r.columnGroupId!==o.columnGroupId)return!1}return!0},serializeEntries(t){return t.map(e=>e.modelType==="group"?`group:${e.columnGroupId}`:e.columnModelId)},deserializeEntries(t){return t.map(e=>e.startsWith("group:")?{modelType:"group",columnGroupId:e.substring(6)}:{modelType:"single",columnModelId:e})}},lt=Zh;var $n=class extends Error{constructor(e){super(e)}},xr=class extends $n{constructor(e,n){super(`Not exists property '${e}' in object : ${n}`),this.propertyName=e}},Tr=class extends $n{constructor(e,n){super(`The property '${e}' is not array : ${n}`),this.propertyName=e}},Ir=class extends $n{constructor(e,n){super(`The property '${e}' is not Object : ${n}`),this.propertyName=e}};function S(t,e){if(!(e in t))throw new xr(e,t)}function j(t,e,n){if(Fh(t)===!1)throw new Tr(e,t);if(t.length===0)return[];if(Qh(t)===!1)throw new Ir(e,t);return t.map(r=>n(r))}function Fh(t){return Array.isArray(t)}function Qh(t){return t.every(e=>typeof e=="object"&&e!==null)}function Ve(t,e=null){return t==null?e??new Date:t instanceof Date?t:typeof t=="string"?new Date(t):new Date}var ct=class t{constructor({structShareModelId:e="",physicalName:n="",logicalName:r="",columnEntries:o=[],isArray:i=!1,description:a=""}){this.structShareModelId=e||X(),this.physicalName=n.trim(),this.logicalName=r.trim(),this.columnEntries=o,this.isArray=i,this.description=a.trim()}simpleColumnType(){return this.isArray===!0?"ARRAY<STRUCT>":"STRUCT"}toJSON(){let e=lt.serializeEntries(this.columnEntries);return{structShareModelId:this.structShareModelId,physicalName:this.physicalName,...this.logicalName!==""&&{logicalName:this.logicalName},columnModelIds:e,...this.isArray===!0&&{isArray:this.isArray},...this.description!==""&&{description:this.description}}}static toObject(e){S(e,"structShareModelId"),S(e,"physicalName"),S(e,"columnModelIds");let n="logicalName"in e?e.logicalName:"",r=lt.deserializeEntries(e.columnModelIds),o="isArray"in e?e.isArray:!1,i="description"in e?e.description:"";return new t({structShareModelId:e.structShareModelId,physicalName:e.physicalName,logicalName:n,columnEntries:r,isArray:o,description:i})}equals(e){return this.structShareModelId!==e.structShareModelId||this.physicalName!==e.physicalName||this.logicalName!==e.logicalName||this.description!==e.description||this.isArray!==e.isArray?!1:lt.equalsEntries(this.columnEntries,e.columnEntries)}};function Xe(t,e){return t.size!==e.size?!1:Array.from(t.entries()).every(([n,r])=>{let o=e.get(n);return o!=null&&r.equals(o)})}function Vt(t,e){let n=t.size===e.size,r=Array.from(e.entries()).map(([o,i])=>{let a=t.get(o);return a!=null&&a.equals(i)?[o,a]:(n=!1,[o,i])});return n?t:new Map(r)}function Fo(t,e){return an(t,e)?t:e}function an(t,e){return t.length!==e.length?!1:t.every((n,r)=>n===e[r])}var Un=class t{constructor(e,n){this.columnShareModelMap=e,this.structShareModelMap=n}static create(e=null,n=null){let r=new Map(e==null?[]:e.map(i=>[i.columnShareModelId,i])),o=new Map(n==null?[]:n.map(i=>[i.structShareModelId,i]));return new t(r,o)}getColumnShareModels(){return Array.from(this.columnShareModelMap.values()).sort((e,n)=>{let r=e.physicalName.localeCompare(n.physicalName,"en");if(r!==0)return r;let o=e.logicalName.localeCompare(n.logicalName,"en");if(o!==0)return o;let i=e.columnType.name.localeCompare(n.columnType.name,"en");return i!==0?i:e.columnShareModelId.localeCompare(n.columnShareModelId,"en")})}findColumnShare(e){if(e==="")return null;let n=this.columnShareModelMap.get(e);return n??null}addColumnShare(...e){if(e.length===0)return this;let n=new Map(this.columnShareModelMap);return e.forEach(r=>n.set(r.columnShareModelId,r)),new t(n,this.structShareModelMap)}getStructShareModels(){return this.structShareModelMap.size===0?[]:Array.from(this.structShareModelMap.values()).sort((e,n)=>{let r=e.physicalName.localeCompare(n.physicalName,"en");return r!==0?r:e.structShareModelId.localeCompare(n.structShareModelId,"en")})}findStructShare(e){if(e==="")return null;let n=this.structShareModelMap.get(e);return n??null}addStructShare(...e){if(e.length===0)return this;let n=new Map(this.structShareModelMap);return e.forEach(r=>n.set(r.structShareModelId,r)),new t(this.columnShareModelMap,n)}deleteStructShare(e){if(e.length===0)return this;let n=new Map(this.structShareModelMap);return e.forEach(r=>n.delete(r)),new t(this.columnShareModelMap,n)}retain(e,n,r,o){let i=Array.from(this.columnShareModelMap.keys()).filter(s=>e.has(s)===!1),a=Array.from(this.structShareModelMap.keys()).filter(s=>n.has(s)===!1);return this.deleteColumnShare(i).deleteStructShare(a).deleteDanglingColumnEntries(r,o)}deleteColumnShare(e){if(e.length===0)return this;let n=new Map(this.columnShareModelMap);return e.forEach(r=>n.delete(r)),new t(n,this.structShareModelMap)}deleteDanglingColumnEntries(e,n){let r=!1,o=new Map(this.structShareModelMap);for(let[i,a]of this.structShareModelMap.entries()){let s=a.columnEntries.filter(c=>c.modelType==="single"?e.has(c.columnModelId):n.has(c.columnGroupId));if(s.length===a.columnEntries.length)continue;r=!0;let l=new ct({...a,columnEntries:s});o.set(i,l)}return r?new t(this.columnShareModelMap,o):this}copy(){return new t(new Map(this.columnShareModelMap),new Map(this.structShareModelMap))}equals(e){return Xe(this.columnShareModelMap,e.columnShareModelMap)&&Xe(this.structShareModelMap,e.structShareModelMap)}reuseInstancesFrom(e){let n=Vt(e.columnShareModelMap,this.columnShareModelMap),r=Vt(e.structShareModelMap,this.structShareModelMap);return(n===e.columnShareModelMap&&r===e.structShareModelMap)===!0?e:new t(new Map(n),new Map(r))}};var sn=class t{constructor({columnGroupId:e="",groupName:n="",columnModelIds:r=[],description:o=""}){this.columnGroupId=e||X(),this.groupName=n.trim(),this.columnModelIds=[...r],this.description=o}toJSON(){return{columnGroupId:this.columnGroupId,groupName:this.groupName,columnModelIds:this.columnModelIds,...this.description!==""&&{description:this.description}}}static toObject(e){return S(e,"columnGroupId"),S(e,"groupName"),S(e,"columnModelIds"),new t({columnGroupId:e.columnGroupId,groupName:e.groupName,columnModelIds:e.columnModelIds,description:"description"in e?e.description:""})}equals(e){return this.columnGroupId===e.columnGroupId&&this.groupName===e.groupName&&this.description===e.description&&this.columnModelIds.length===e.columnModelIds.length&&this.columnModelIds.every((n,r)=>n===e.columnModelIds[r])}};var ut=class t{constructor(e){this.entityType="simple";this.columnModelId=e.columnModelId?e.columnModelId:X(),this.physicalName=(e.physicalName??"").trim(),this.logicalName=(e.logicalName??"").trim(),this.notNull=e.notNull??!1,this.columnShareModelId=e.columnShareModelId,this.primaryKey=e.primaryKey??!1,this.unique=e.unique??!1,this.autoIncrement=e.autoIncrement??!1,this.defaultValue=(e.defaultValue??"").trim()}toJSON(){return{columnModelId:this.columnModelId,columnShareModelId:this.columnShareModelId,...this.physicalName!==""&&{physicalName:this.physicalName},...this.logicalName!==""&&{logicalName:this.logicalName},...this.primaryKey&&{primaryKey:this.primaryKey},...this.notNull&&{notNull:this.notNull},...this.unique&&{unique:this.unique},...this.autoIncrement&&{autoIncrement:this.autoIncrement},...this.defaultValue!==""&&{defaultValue:this.defaultValue}}}static toObject(e){S(e,"columnModelId"),S(e,"columnShareModelId");let n="physicalName"in e?e.physicalName:"",r="logicalName"in e?e.logicalName:"",o="notNull"in e?e.notNull:!1,i="primaryKey"in e?e.primaryKey:!1,a="unique"in e?e.unique:!1,s="autoIncrement"in e?e.autoIncrement:!1,l="defaultValue"in e?e.defaultValue:"";return new t({columnModelId:e.columnModelId,columnShareModelId:e.columnShareModelId,physicalName:n,logicalName:r,primaryKey:i,notNull:o,unique:a,autoIncrement:s,defaultValue:l})}equals(e){return this.columnModelId===e.columnModelId&&this.physicalName===e.physicalName&&this.logicalName===e.logicalName&&this.notNull===e.notNull&&this.columnShareModelId===e.columnShareModelId&&this.primaryKey===e.primaryKey&&this.unique===e.unique&&this.autoIncrement===e.autoIncrement&&this.defaultValue===e.defaultValue}};var Ln=class t{constructor(e){this.entityType="struct";this.columnModelId=e.columnModelId?e.columnModelId:X(),this.physicalName=(e.physicalName??"").trim(),this.logicalName=(e.logicalName??"").trim(),this.notNull=e.notNull??!1,this.structShareModelId=e.structShareModelId}toJSON(){return{columnModelId:this.columnModelId,entityType:"struct",structShareModelId:this.structShareModelId,...this.physicalName!==""&&{physicalName:this.physicalName},...this.logicalName!==""&&{logicalName:this.logicalName},...this.notNull&&{notNull:this.notNull}}}static toObject(e){S(e,"columnModelId"),S(e,"structShareModelId");let n="physicalName"in e?e.physicalName:"",r="logicalName"in e?e.logicalName:"",o="notNull"in e?e.notNull:!1;return new t({columnModelId:e.columnModelId,physicalName:n,logicalName:r,notNull:o,structShareModelId:e.structShareModelId})}equals(e){return this.columnModelId===e.columnModelId&&this.physicalName===e.physicalName&&this.logicalName===e.logicalName&&this.notNull===e.notNull&&this.structShareModelId===e.structShareModelId}};var Vn={isSimpleColumn(t){return t.entityType==="simple"},isStructColumn(t){return t.entityType==="struct"},equals(t,e){return Vn.isSimpleColumn(t)&&Vn.isSimpleColumn(e)||Vn.isStructColumn(t)&&Vn.isStructColumn(e)?t.equals(e):!1},toObject(t){return("entityType"in t?t.entityType:"simple")==="struct"?Ln.toObject(t):ut.toObject(t)}},ce=Vn;var qn=class t{constructor({columnShareModelId:e,physicalName:n,logicalName:r,columnType:o,precision:i="",scale:a="",unsigned:s=!1,isArray:l=!1,description:c="",checkExpression:m="",characterSet:d="",collate:h="",optionExpression:g="",createdAt:b=null}){this.columnShareModelId=e,this.physicalName=n,this.logicalName=r,this.columnType=o,this.precision=o.withPrecision?i:"",this.scale=o.withScale?a:"",this.unsigned=o.withUnsigned?s:!1,this.isArray=l,this.description=c.trim(),this.checkExpression=m.trim(),this.characterSetValue=d.trim(),this.collateValue=h.trim(),this.optionExpression=g.trim(),this.createdAt=b||new Date}get collate(){return this.columnType.category==="text"?this.collateValue:""}characterSet(e){return this.columnType.category==="text"&&e.editableCharacterSet?this.characterSetValue:""}specifiedColumnType(e=!1){return this.columnType.specifiedType({precision:this.precision,scale:this.scale,isArray:this.isArray,inChildRelation:e})}matchForReferenceType(e){let n=this.specifiedColumnType(!0),r=e.specifiedColumnType(!0);return!(n!==r||this.columnType.withUnsigned&&this.unsigned!==e.unsigned)}toJSON(){return{columnShareModelId:this.columnShareModelId,physicalName:this.physicalName,logicalName:this.logicalName,columnTypeId:this.columnType.id,...this.precision!==""&&{precision:this.precision},...this.scale!==""&&{scale:this.scale},...this.unsigned&&{unsigned:this.unsigned},...this.isArray&&{isArray:this.isArray},...this.description!==""&&{description:this.description},...this.checkExpression!==""&&{checkExpression:this.checkExpression},...this.characterSetValue!==""&&this.columnType.category==="text"&&{characterSet:this.characterSetValue},...this.collateValue!==""&&this.columnType.category==="text"&&{collate:this.collateValue},...this.optionExpression!==""&&{optionExpression:this.optionExpression},createdAt:this.createdAt}}static toObject(e,n){return S(e,"columnShareModelId"),S(e,"physicalName"),S(e,"logicalName"),S(e,"columnTypeId"),new t({columnShareModelId:e.columnShareModelId,physicalName:e.physicalName,logicalName:e.logicalName,columnType:n(e.columnTypeId),precision:"precision"in e?e.precision:"",scale:"scale"in e?e.scale:"",unsigned:"unsigned"in e?e.unsigned:!1,isArray:"isArray"in e?e.isArray:!1,description:"description"in e?e.description:"",checkExpression:"checkExpression"in e?e.checkExpression:"",characterSet:"characterSet"in e?e.characterSet:"",collate:"collate"in e?e.collate:"",optionExpression:"optionExpression"in e?e.optionExpression:"",createdAt:"createdAt"in e?Ve(e.createdAt):new Date})}equals(e){return this.columnShareModelId===e.columnShareModelId&&this.physicalName===e.physicalName&&this.logicalName===e.logicalName&&this.columnType.id===e.columnType.id&&this.precision===e.precision&&this.scale===e.scale&&this.unsigned===e.unsigned&&this.isArray===e.isArray&&this.description===e.description&&this.checkExpression===e.checkExpression&&this.characterSetValue===e.characterSetValue&&this.collateValue===e.collateValue&&this.optionExpression===e.optionExpression}};var dt=class t{constructor({parentColumnModelId:e,childColumnModelId:n}){this.parentColumnModelId=e,this.childColumnModelId=n}toJSON(){return{parentColumnModelId:this.parentColumnModelId,childColumnModelId:this.childColumnModelId}}static toObject(e){return S(e,"parentColumnModelId"),S(e,"childColumnModelId"),new t({parentColumnModelId:e.parentColumnModelId,childColumnModelId:e.childColumnModelId})}equals(e){return this.parentColumnModelId===e.parentColumnModelId&&this.childColumnModelId===e.childColumnModelId}};var qe=class t{constructor({relationModelId:e="",relationName:n="",parentTableModelId:r,parentCardinality:o="1",childTableModelId:i,childCardinality:a="1",relationPairs:s=[],onUpdateAction:l="RESTRICT",onDeleteAction:c="RESTRICT"}){this.relationModelId=e||X(),this.relationName=n,this.parentTableModelId=r,this.parentCardinality=o,this.childTableModelId=i,this.childCardinality=a,this.relationPairs=[...s],this.onUpdateAction=l,this.onDeleteAction=c}toJSON(){return{relationModelId:this.relationModelId,...this.relationName!==""&&{relationName:this.relationName},parentTableModelId:this.parentTableModelId,parentCardinality:this.parentCardinality,childTableModelId:this.childTableModelId,childCardinality:this.childCardinality,relationPairs:this.relationPairs.map(e=>e.toJSON()),onUpdateAction:this.onUpdateAction,onDeleteAction:this.onDeleteAction}}static toObject(e){return S(e,"relationModelId"),S(e,"parentTableModelId"),S(e,"childTableModelId"),S(e,"relationPairs"),new t({relationModelId:e.relationModelId,relationName:"relationName"in e?e.relationName:"",parentTableModelId:e.parentTableModelId,parentCardinality:"parentCardinality"in e?e.parentCardinality:"1",childTableModelId:e.childTableModelId,childCardinality:"childCardinality"in e?e.childCardinality:"1",relationPairs:j(e.relationPairs,"relationPairs",n=>dt.toObject(n)),onUpdateAction:"onUpdateAction"in e?e.onUpdateAction:"RESTRICT",onDeleteAction:"onDeleteAction"in e?e.onDeleteAction:"RESTRICT"})}equals(e){if(this.relationModelId!==e.relationModelId||this.relationName!==e.relationName||this.parentTableModelId!==e.parentTableModelId||this.parentCardinality!==e.parentCardinality||this.childTableModelId!==e.childTableModelId||this.childCardinality!==e.childCardinality||this.relationPairs.length!==e.relationPairs.length)return!1;for(let n=0;n<this.relationPairs.length;n++)if(this.relationPairs[n].equals(e.relationPairs[n])===!1)return!1;return!(this.onUpdateAction!==e.onUpdateAction||this.onDeleteAction!==e.onDeleteAction)}};var mt=(t,e)=>{let n=t.physicalName!=""?t.physicalName:e.physicalName,r=t.logicalName!=""?t.logicalName:e.logicalName;return{physicalName:n,logicalName:r}};var pt=class t{constructor({tableIndexModelId:e,physicalName:n,indexColumnModels:r,indexOption:o="",indexType:i="",clustered:a=!1,description:s=""}){this.tableIndexModelId=e,this.physicalName=n.trim(),this.indexColumnModels=[...r],this.indexOption=o,this.indexType=i,this.clustered=a,this.description=s}static filterColumns(e,n){let r=!1;return{tableIndexModels:e.flatMap(i=>{let a=i.indexColumnModels.filter(n);return a.length===i.indexColumnModels.length?[i]:(r=!0,a.length===0?[]:[new t({...i,indexColumnModels:a})])}),hasChanged:r}}toJSON(){return{tableIndexModelId:this.tableIndexModelId,physicalName:this.physicalName,indexColumnModels:this.indexColumnModels.map(e=>e.toJSON()),...this.indexOption!==""&&{indexOption:this.indexOption},...this.indexType!==""&&{indexType:this.indexType},...this.clustered&&{clustered:this.clustered},...this.description!==""&&{description:this.description}}}static toObject(e){S(e,"tableIndexModelId"),S(e,"physicalName"),S(e,"indexColumnModels");let n=j(e.indexColumnModels,"indexColumnModels",r=>Qo.toObject(r));return new t({tableIndexModelId:e.tableIndexModelId,physicalName:e.physicalName,indexColumnModels:n,indexOption:Bh(e),indexType:"indexType"in e?e.indexType:"",clustered:"clustered"in e?e.clustered:!1,description:"description"in e?e.description:""})}equals(e){if(this.tableIndexModelId!==e.tableIndexModelId||this.physicalName!==e.physicalName||this.indexColumnModels.length!==e.indexColumnModels.length)return!1;for(let n=0;n<this.indexColumnModels.length;n++){let r=this.indexColumnModels[n],o=e.indexColumnModels[n];if(r.equals(o)===!1)return!1}return!(this.indexOption!==e.indexOption||this.indexType!==e.indexType||this.clustered!==e.clustered||this.description!==e.description)}},Bh=t=>"indexOption"in t?t.indexOption:"indexOptioin"in t?t.indexOptioin:"",Qo=class t{constructor({columnModelId:e,sortOrderType:n="",nullsOrderType:r=""}){this.columnModelId=e,this.sortOrderType=n,this.nullsOrderType=r}querySort(){return this.sortOrderType===""?"":this.nullsOrderType===""?this.sortOrderType:`${this.sortOrderType} NULLS ${this.nullsOrderType}`}toJSON(){return{columnModelId:this.columnModelId,...this.sortOrderType!==""&&{sortOrderType:this.sortOrderType},...this.nullsOrderType!==""&&{nullsOrderType:this.nullsOrderType}}}static toObject(e){return S(e,"columnModelId"),new t({columnModelId:e.columnModelId,sortOrderType:"sortOrderType"in e?e.sortOrderType:"",nullsOrderType:"nullsOrderType"in e?e.nullsOrderType:""})}equals(e){return!(this.columnModelId!==e.columnModelId||this.sortOrderType!==e.sortOrderType||this.nullsOrderType!==e.nullsOrderType)}};var ht=class t{constructor({tableUniqueKeysModelId:e,physicalName:n="",uniqueKeysColumnModels:r,description:o=""}){this.tableUniqueKeysModelId=e,this.physicalName=n.trim(),this.uniqueKeysColumnModels=[...r],this.description=o}static filterColumns(e,n){let r=!1;return{tableUniqueKeysModels:e.flatMap(i=>{let a=i.uniqueKeysColumnModels.filter(n);return a.length===i.uniqueKeysColumnModels.length?[i]:(r=!0,a.length===0?[]:[new t({...i,uniqueKeysColumnModels:a})])}),hasChanged:r}}toJSON(){return{tableUniqueKeysModelId:this.tableUniqueKeysModelId,...this.physicalName!==""&&{physicalName:this.physicalName},uniqueKeysColumnModels:this.uniqueKeysColumnModels.map(e=>e.toJSON()),...this.description!==""&&{description:this.description}}}static toObject(e){S(e,"tableUniqueKeysModelId"),S(e,"uniqueKeysColumnModels");let n="physicalName"in e?e.physicalName:"",r=j(e.uniqueKeysColumnModels,"uniqueKeysColumnModels",o=>Bo.toObject(o));return new t({tableUniqueKeysModelId:e.tableUniqueKeysModelId,physicalName:n,uniqueKeysColumnModels:r,description:"description"in e?e.description:""})}equals(e){if(this.tableUniqueKeysModelId!==e.tableUniqueKeysModelId||this.physicalName!==e.physicalName||this.uniqueKeysColumnModels.length!==e.uniqueKeysColumnModels.length)return!1;for(let n=0;n<this.uniqueKeysColumnModels.length;n++){let r=this.uniqueKeysColumnModels[n],o=e.uniqueKeysColumnModels[n];if(r.equals(o)===!1)return!1}return this.description===e.description}},Bo=class t{constructor({columnModelId:e,sortOrderType:n}){this.columnModelId=e,this.sortOrderType=n}toJSON(){return{columnModelId:this.columnModelId,...this.sortOrderType!==""&&{sortOrderType:this.sortOrderType}}}static toObject(e){return S(e,"columnModelId"),new t({columnModelId:e.columnModelId,sortOrderType:"sortOrderType"in e?e.sortOrderType:""})}equals(e){return!(this.columnModelId!==e.columnModelId||this.sortOrderType!==e.sortOrderType)}};var Ze=class t{constructor({tableModelId:e="",physicalName:n="",logicalName:r="",schemaId:o="",columnEntries:i=[],uniqueKeysModels:a=[],tableIndexModels:s=[],description:l="",checkExpression:c="",characterSet:m="",collate:d="",definitionExpression:h="",optionExpression:g=""}){this.tableModelId=e||X(),this.physicalName=n.trim(),this.logicalName=r.trim(),this.schemaId=o,this.columnEntries=i,this.uniqueKeysModels=a,this.tableIndexModels=s,this.description=l.trim(),this.checkExpression=c.trim(),this.characterSet=m.trim(),this.collate=d.trim(),this.definitionExpression=h.trim(),this.optionExpression=g.trim()}addColumnModelIds(e){let n=new Set(this.columnEntries.filter(o=>o.modelType==="single").map(o=>o.columnModelId)),r=e.filter(o=>n.has(o)===!1).map(o=>({modelType:"single",columnModelId:o}));return r.length===0?this:new t({...this,columnEntries:this.columnEntries.concat(r)})}updateCheckExpression(e){if(this.checkExpression===""||e.length===0)return this;let n=this.checkExpression;for(let r of e){let o=`\${${r.previousName.physicalName}}`,i=`\${${r.nextName.physicalName}}`;n=n.replaceAll(o,i)}return n===this.checkExpression?this:new t({...this,checkExpression:n})}equals(e){if(this.tableModelId!==e.tableModelId||this.physicalName!==e.physicalName||this.logicalName!==e.logicalName||this.schemaId!==e.schemaId||lt.equalsEntries(this.columnEntries,e.columnEntries)===!1||this.uniqueKeysModels.length!==e.uniqueKeysModels.length)return!1;for(let n=0;n<this.uniqueKeysModels.length;n++){let r=this.uniqueKeysModels[n],o=e.uniqueKeysModels[n];if(r.equals(o)===!1)return!1}if(this.tableIndexModels.length!==e.tableIndexModels.length)return!1;for(let n=0;n<this.tableIndexModels.length;n++){let r=this.tableIndexModels[n],o=e.tableIndexModels[n];if(r.equals(o)===!1)return!1}return!(this.description!==e.description||this.checkExpression!==e.checkExpression||this.characterSet!==e.characterSet||this.collate!==e.collate||this.definitionExpression!==e.definitionExpression||this.optionExpression!==e.optionExpression)}toJSON(){let e=lt.serializeEntries(this.columnEntries);return{tableModelId:this.tableModelId,physicalName:this.physicalName,logicalName:this.logicalName,...this.schemaId!=""&&{schemaId:this.schemaId},columnModelIds:e,...this.uniqueKeysModels.length>0&&{uniqueKeysModels:this.uniqueKeysModels.map(n=>n.toJSON())},...this.tableIndexModels.length>0&&{tableIndexModels:this.tableIndexModels.map(n=>n.toJSON())},...this.description!==""&&{description:this.description},...this.checkExpression!==""&&{checkExpression:this.checkExpression},...this.characterSet!==""&&{characterSet:this.characterSet},...this.collate!==""&&{collate:this.collate},...this.definitionExpression!==""&&{definitionExpression:this.definitionExpression},...this.optionExpression!==""&&{optionExpression:this.optionExpression}}}static toObject(e){S(e,"tableModelId"),S(e,"physicalName"),S(e,"logicalName"),S(e,"columnModelIds");let n="schemaId"in e?e.schemaId:"",r=lt.deserializeEntries(e.columnModelIds),o="uniqueKeysModels"in e?j(e.uniqueKeysModels,"uniqueKeysModels",h=>ht.toObject(h)):[],i="tableIndexModels"in e?j(e.tableIndexModels,"tableIndexModels",h=>pt.toObject(h)):[],a="description"in e?e.description:"",s="checkExpression"in e?e.checkExpression:"",l="characterSet"in e?e.characterSet:"",c="collate"in e?e.collate:"",m="definitionExpression"in e?e.definitionExpression:"",d="optionExpression"in e?e.optionExpression:"";return new t({tableModelId:e.tableModelId,physicalName:e.physicalName,logicalName:e.logicalName,schemaId:n,columnEntries:r,uniqueKeysModels:o,tableIndexModels:i,description:a,checkExpression:s,characterSet:l,collate:c,definitionExpression:m,optionExpression:d})}};var Ko="[[TYPE]][]",u=class t{static{this.EMPTY=new t({id:0,name:"",description:"",baseQuery:""})}constructor({id:e,name:n,description:r,baseQuery:o,category:i="other",withPrecision:a=!1,withScale:s=!1,withUnsigned:l=!1,withAutoIncrement:c=!1,foreignColumn:m=null,defaultValueCandidates:d=[],arrayQueryTemplate:h=Ko}){this.id=e,this.name=n,this.description=r,this.baseQuery=o,this.category=i,this.withPrecision=a,this.withScale=s,this.withUnsigned=l,this.withAutoIncrement=c,this.foreignColumn=m??null,this.defaultValueCandidates=d,this.arrayQueryTemplate=h}specifiedType({precision:e="",scale:n="",isArray:r=!1,inChildRelation:o=!1}){if(this.foreignColumn&&o)return this.foreignColumn.specifiedType({precision:e,scale:n,isArray:r});if(this.baseQuery.indexOf("[[PARAM]]")<0)return this.applyArrayTemplate(this.baseQuery,r);let i=this.initTypeParam(e,n),a=this.baseQuery.replace("[[PARAM]]",i);return this.applyArrayTemplate(a,r)}applyArrayTemplate(e,n){return n===!1?e:this.arrayQueryTemplate.replace("[[TYPE]]",e)}candidateDefaultValues(e,n){return this.defaultValueCandidates.map(r=>{if(r.indexOf("[[PARAM]]")<0)return r;let o=this.initTypeParam(e,n);return r.replaceAll("[[PARAM]]",o)})}initTypeParam(e,n){return n&&this.withScale?`(${e}, ${n})`:e&&this.withPrecision?`(${e})`:""}toJSON(){return{id:this.id,name:this.name,description:this.description,baseQuery:this.baseQuery,category:this.category,...this.withPrecision&&{withPrecision:this.withPrecision},...this.withScale&&{withScale:this.withScale},...this.withUnsigned&&{withUnsigned:this.withUnsigned},...this.withAutoIncrement&&{withAutoIncrement:this.withAutoIncrement},...this.foreignColumn!=null&&{foreignColumn:this.foreignColumn.toJSON()},...this.defaultValueCandidates.length>0&&{defaultValueCandidates:this.defaultValueCandidates},...this.arrayQueryTemplate!==Ko&&{arrayQueryTemplate:this.arrayQueryTemplate}}}static toObject(e){S(e,"id"),S(e,"name"),S(e,"description"),S(e,"baseQuery");let n="category"in e?e.category:"other",r="withPrecision"in e?e.withPrecision:!1,o="withScale"in e?e.withScale:!1,i="withUnsigned"in e?e.withUnsigned:!1,a="withAutoIncrement"in e?e.withAutoIncrement:"withAuthIncrement"in e?e.withAuthIncrement:!1,s="foreignColumn"in e&&e.foreignColumn!=null?t.toObject(e.foreignColumn):null,l="defaultValueCandidates"in e?e.defaultValueCandidates:[],c="arrayQueryTemplate"in e?e.arrayQueryTemplate:Ko;return new t({id:e.id,name:e.name,description:e.description,baseQuery:e.baseQuery,category:n,withPrecision:r,withScale:o,withUnsigned:i,withAutoIncrement:a,foreignColumn:s,defaultValueCandidates:l,arrayQueryTemplate:c})}equals(e){return this.id===e.id&&this.name===e.name&&this.description===e.description&&this.baseQuery===e.baseQuery&&this.withPrecision===e.withPrecision&&this.withScale===e.withScale&&this.withUnsigned===e.withUnsigned&&this.withAutoIncrement===e.withAutoIncrement&&(this.foreignColumn===null&&e.foreignColumn===null||this.foreignColumn!==null&&e.foreignColumn!==null&&this.foreignColumn.equals(e.foreignColumn))&&this.defaultValueCandidates.length===e.defaultValueCandidates.length&&this.defaultValueCandidates.every((n,r)=>n===e.defaultValueCandidates[r])&&this.arrayQueryTemplate===e.arrayQueryTemplate}static migrateDefaultValueCandidates(e,n,r){if(e.name!==n.name||n.defaultValueCandidates.length===0)return e;if(r<20250612)return new t({...e,defaultValueCandidates:[...n.defaultValueCandidates]});if(r<20260321){let o=new Set(e.defaultValueCandidates);if(n.defaultValueCandidates.some(i=>o.has(i)===!1))return new t({...e,defaultValueCandidates:[...n.defaultValueCandidates]})}return e}};var sc=new u({id:11,name:"smallint",description:"2\u30D0\u30A4\u30C8\u7B26\u53F7\u4ED8\u304D\u6574\u6570",baseQuery:"SMALLINT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),lc=new u({id:15,name:"integer",description:"4\u30D0\u30A4\u30C8\u7B26\u53F7\u4ED8\u304D\u6574\u6570",baseQuery:"INTEGER",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),cc=new u({id:17,name:"bigint",description:"8\u30D0\u30A4\u30C8\u7B26\u53F7\u4ED8\u304D\u6574\u6570",baseQuery:"BIGINT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),Kh={postgres:[new u({id:1,name:"bit",description:"\u56FA\u5B9A\u9577\u30D3\u30C3\u30C8\u5217",baseQuery:"BIT",category:"bit",withPrecision:!1,withScale:!1}),new u({id:2,name:"bit (n)",description:"\u56FA\u5B9A\u9577\u30D3\u30C3\u30C8\u5217",baseQuery:"BIT[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1}),new u({id:4,name:"bit varying",description:"\u53EF\u5909\u9577\u30D3\u30C3\u30C8\u5217",baseQuery:"BIT VARYING",category:"bit",withPrecision:!1,withScale:!1}),new u({id:5,name:"bit varying (n)",description:"\u53EF\u5909\u9577\u30D3\u30C3\u30C8\u5217",baseQuery:"BIT VARYING[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1}),new u({id:6,name:"boolean",description:"\u8AD6\u7406\u5024 (\u771F/\u507D)",baseQuery:"BOOLEAN",category:"bit",withPrecision:!1,withScale:!1}),new u({id:367,name:"bytea",description:"\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF (\u300C\u30D0\u30A4\u30C8\u306E\u914D\u5217 (byte array)\u300D)",baseQuery:"BYTEA",category:"bit",withPrecision:!1,withScale:!1}),sc,new u({id:51,name:"smallserial",description:"\u81EA\u52D5\u5897\u52062\u30D0\u30A4\u30C8\u6574\u6570",baseQuery:"SMALLSERIAL",category:"integer",withPrecision:!1,withScale:!1,foreignColumn:sc}),lc,new u({id:55,name:"serial",description:"\u81EA\u52D5\u5897\u52064\u30D0\u30A4\u30C8\u6574\u6570",baseQuery:"SERIAL",category:"integer",withPrecision:!1,withScale:!1,foreignColumn:lc}),cc,new u({id:57,name:"bigserial",description:"\u81EA\u52D5\u5897\u52068\u30D0\u30A4\u30C8\u6574\u6570",baseQuery:"BIGSERIAL",category:"integer",withPrecision:!1,withScale:!1,foreignColumn:cc}),new u({id:31,name:"real",description:"\u5358\u7CBE\u5EA6\u6D6E\u52D5\u5C0F\u6570\u70B9 (4\u30D0\u30A4\u30C8)",baseQuery:"REAL",category:"decimal",withPrecision:!1,withScale:!1}),new u({id:33,name:"double precision",description:"\u500D\u7CBE\u5EA6\u6D6E\u52D5\u5C0F\u6570\u70B9 (8\u30D0\u30A4\u30C8)",baseQuery:"DOUBLE PRECISION",category:"decimal",withPrecision:!1,withScale:!1}),new u({id:35,name:"decimal",description:"\u7CBE\u5EA6\u306E\u9078\u629E\u53EF\u80FD\u306A\u9AD8\u7CBE\u5EA6\u6570\u5024",baseQuery:"DECIMAL",category:"decimal",withPrecision:!1,withScale:!1}),new u({id:36,name:"numeric",description:"\u7CBE\u5EA6\u306E\u9078\u629E\u53EF\u80FD\u306A\u9AD8\u7CBE\u5EA6\u6570\u5024",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1}),new u({id:45,name:"decimal (p, s)",description:"\u7CBE\u5EA6\u306E\u9078\u629E\u53EF\u80FD\u306A\u9AD8\u7CBE\u5EA6\u6570\u5024",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0}),new u({id:46,name:"numeric (p, s)",description:"\u7CBE\u5EA6\u306E\u9078\u629E\u53EF\u80FD\u306A\u9AD8\u7CBE\u5EA6\u6570\u5024",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0}),new u({id:101,name:"date",description:"\u66A6\u306E\u65E5\u4ED8 (\u5E74\u6708\u65E5)",baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1}),new u({id:131,name:"time without time zone",description:"\u6642\u523B (\u6642\u9593\u5E2F\u306A\u3057)",baseQuery:"TIME WITHOUT TIME ZONE",category:"timestamp",withPrecision:!1,withScale:!1}),new u({id:132,name:"time with time zone",description:"\u6642\u9593\u5E2F\u4ED8\u304D\u6642\u523B",baseQuery:"TIME WITH TIME ZONE",category:"timestamp",withPrecision:!1,withScale:!1}),new u({id:141,name:"time (p) without time zone",description:"\u6642\u523B (\u6642\u9593\u5E2F\u306A\u3057)",baseQuery:"TIME[[PARAM]] WITHOUT TIME ZONE",category:"timestamp",withPrecision:!0,withScale:!1}),new u({id:142,name:"time (p) with time zone",description:"\u6642\u9593\u5E2F\u4ED8\u304D\u6642\u523B",baseQuery:"TIME[[PARAM]] WITH TIME ZONE",category:"timestamp",withPrecision:!0,withScale:!1}),new u({id:111,name:"timestamp without time zone",description:"\u65E5\u4ED8\u3068\u6642\u523B (\u6642\u9593\u5E2F\u306A\u3057)",baseQuery:"TIMESTAMP WITHOUT TIME ZONE",category:"timestamp",withPrecision:!1,withScale:!1}),new u({id:112,name:"timestamp with time zone",description:"\u6642\u9593\u5E2F\u4ED8\u304D\u65E5\u4ED8\u3068\u6642\u523B",baseQuery:"TIMESTAMP WITH TIME ZONE",category:"timestamp",withPrecision:!1,withScale:!1}),new u({id:121,name:"timestamp (p) without time zone",description:"\u65E5\u4ED8\u3068\u6642\u523B (\u6642\u9593\u5E2F\u306A\u3057)",baseQuery:"TIMESTAMP[[PARAM]] WITHOUT TIME ZONE",category:"timestamp",withPrecision:!0,withScale:!1}),new u({id:122,name:"timestamp (p) with time zone",description:"\u6642\u9593\u5E2F\u4ED8\u304D\u65E5\u4ED8\u3068\u6642\u523B",baseQuery:"TIMESTAMP[[PARAM]] WITH TIME ZONE",category:"timestamp",withPrecision:!0,withScale:!1}),new u({id:301,name:"char",description:"\u56FA\u5B9A\u9577\u6587\u5B57\u5217",baseQuery:"CHAR",category:"text",withPrecision:!1,withScale:!1}),new u({id:302,name:"varchar",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217",baseQuery:"VARCHAR",category:"text",withPrecision:!1,withScale:!1}),new u({id:311,name:"char (n)",description:"\u56FA\u5B9A\u9577\u6587\u5B57\u5217",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1}),new u({id:312,name:"varchar (n)",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1}),new u({id:325,name:"text",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217",baseQuery:"TEXT",category:"text",withPrecision:!1,withScale:!1}),new u({id:411,name:"uuid",description:"\u6C4E\u7528\u4E00\u610F\u8B58\u5225\u5B50",baseQuery:"UUID",category:"other",withPrecision:!1,withScale:!1}),new u({id:421,name:"json",description:"\u30C6\u30AD\u30B9\u30C8\u306EJSON\u30C7\u30FC\u30BF",baseQuery:"JSON",category:"other",withPrecision:!1,withScale:!1}),new u({id:422,name:"jsonb",description:"\u30D0\u30A4\u30CA\u30EA JSON \u30C7\u30FC\u30BF, \u5C55\u958B\u578B",baseQuery:"JSONB",category:"other",withPrecision:!1,withScale:!1}),new u({id:431,name:"xml",description:"XML\u30C7\u30FC\u30BF",baseQuery:"XML",category:"other",withPrecision:!1,withScale:!1}),new u({id:441,name:"money",description:"\u8CA8\u5E63\u91D1\u984D",baseQuery:"MONEY",category:"other",withPrecision:!1,withScale:!1}),new u({id:451,name:"tsquery",description:"\u30C6\u30AD\u30B9\u30C8\u691C\u7D22\u554F\u3044\u5408\u308F\u305B",baseQuery:"TSQUERY",category:"other",withPrecision:!1,withScale:!1}),new u({id:453,name:"tsvector",description:"\u30C6\u30AD\u30B9\u30C8\u691C\u7D22\u6587\u66F8",baseQuery:"TSVECTOR",category:"other",withPrecision:!1,withScale:!1}),new u({id:1011,name:"point",description:"\u5E73\u9762\u4E0A\u306E\u5E7E\u4F55\u5B66\u7684\u70B9",baseQuery:"POINT",category:"other",withPrecision:!1,withScale:!1}),new u({id:1021,name:"line",description:"\u5E73\u9762\u4E0A\u306E\u7121\u9650\u76F4\u7DDA",baseQuery:"LINE",category:"other",withPrecision:!1,withScale:!1}),new u({id:1022,name:"lseg",description:"\u5E73\u9762\u4E0A\u306E\u7DDA\u5206",baseQuery:"LSEG",category:"other",withPrecision:!1,withScale:!1}),new u({id:1031,name:"box",description:"\u5E73\u9762\u4E0A\u306E\u77E9\u5F62",baseQuery:"BOX",category:"other",withPrecision:!1,withScale:!1}),new u({id:1032,name:"circle",description:"\u5E73\u9762\u4E0A\u306E\u5186",baseQuery:"CIRCLE",category:"other",withPrecision:!1,withScale:!1}),new u({id:1041,name:"path",description:"\u5E73\u9762\u4E0A\u306E\u5E7E\u4F55\u5B66\u7684\u7D4C\u8DEF",baseQuery:"PATH",category:"other",withPrecision:!1,withScale:!1}),new u({id:1042,name:"polygon",description:"\u5E73\u9762\u4E0A\u306E\u9589\u3058\u305F\u5E7E\u4F55\u5B66\u7684\u7D4C\u8DEF",baseQuery:"POLYGON",category:"other",withPrecision:!1,withScale:!1}),new u({id:1111,name:"cidr",description:"IPv4\u3082\u3057\u304F\u306FIPv6\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u30A2\u30C9\u30EC\u30B9",baseQuery:"CIDR",category:"other",withPrecision:!1,withScale:!1}),new u({id:1112,name:"inet",description:"IPv4\u3082\u3057\u304F\u306FIPv6\u30DB\u30B9\u30C8\u30A2\u30C9\u30EC\u30B9",baseQuery:"INET",category:"other",withPrecision:!1,withScale:!1}),new u({id:1121,name:"macaddr",description:"MAC (Media Access Control)\u30A2\u30C9\u30EC\u30B9",baseQuery:"MACADDR",category:"other",withPrecision:!1,withScale:!1}),new u({id:1122,name:"macaddr8",description:"MAC (Media Access Control) \u30A2\u30C9\u30EC\u30B9 (EUI-64 \u5F62\u5F0F)",baseQuery:"MACADDR8",category:"other",withPrecision:!1,withScale:!1}),new u({id:9101,name:"pg_lsn",description:"PostgreSQL\u30ED\u30B0\u30B7\u30FC\u30B1\u30F3\u30B9\u756A\u53F7",baseQuery:"PG_LSN",category:"other",withPrecision:!1,withScale:!1}),new u({id:9102,name:"pg_snapshot",description:"\u30E6\u30FC\u30B6\u30EC\u30D9\u30EB\u306E\u30C8\u30E9\u30F3\u30B6\u30AF\u30B7\u30E7\u30F3ID\u30B9\u30CA\u30C3\u30D7\u30B7\u30E7\u30C3\u30C8",baseQuery:"PG_SNAPSHOT",category:"other",withPrecision:!1,withScale:!1}),new u({id:9103,name:"oid",description:"\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u8B58\u5225\u5B50\u30C7\u30FC\u30BF",baseQuery:"OID",category:"other",withPrecision:!1,withScale:!1}),u.EMPTY],mysql:[new u({id:1,name:"bit",description:"\u30D3\u30C3\u30C8\u5024\u578B",baseQuery:"BIT",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2,name:"bit (m)",description:"\u30D3\u30C3\u30C8\u5024\u578B",baseQuery:"BIT[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:6,name:"boolean",description:"TINYINT(1) \u306E\u30B7\u30CE\u30CB\u30E0",baseQuery:"BOOLEAN",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:10,name:"tinyint",description:"\u975E\u5E38\u306B\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -128 \u304B\u3089 127 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 255 \u3067\u3059\u3002",baseQuery:"TINYINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:11,name:"smallint",description:"\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -32768 \u304B\u3089 32767 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 65535 \u3067\u3059\u3002",baseQuery:"SMALLINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:13,name:"mediumint",description:"\u4E2D\u9593\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -8388608 \u304B\u3089 8388607 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 16777215 \u3067\u3059\u3002",baseQuery:"MEDIUMINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:15,name:"int",description:"\u666E\u901A\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -2147483648 \u304B\u3089 2147483647 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 4294967295 \u3067\u3059\u3002",baseQuery:"INT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:17,name:"bigint",description:"\u5927\u304D\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -9223372036854775808 \u304B\u3089 9223372036854775807 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 18446744073709551615 \u3067\u3059\u3002",baseQuery:"BIGINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:20,name:"tinyint (m)",description:"\u975E\u5E38\u306B\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -128 \u304B\u3089 127 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 255 \u3067\u3059\u3002",baseQuery:"TINYINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!1}),new u({id:21,name:"smallint (m)",description:"\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -32768 \u304B\u3089 32767 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 65535 \u3067\u3059\u3002",baseQuery:"SMALLINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:23,name:"mediumint (m)",description:"\u4E2D\u9593\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -8388608 \u304B\u3089 8388607 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 16777215 \u3067\u3059\u3002",baseQuery:"MEDIUMINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:25,name:"int (m)",description:"\u666E\u901A\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -2147483648 \u304B\u3089 2147483647 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 4294967295 \u3067\u3059\u3002",baseQuery:"INT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:27,name:"bigint (m)",description:"\u5927\u304D\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -9223372036854775808 \u304B\u3089 9223372036854775807 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 18446744073709551615 \u3067\u3059\u3002",baseQuery:"BIGINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:31,name:"float",description:"\u5C0F\u3055\u3044 (\u5358\u7CBE\u5EA6) \u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u308B\u5024\u306F\u3001-3.402823466E+38 \u304B\u3089 -1.175494351E-38\u30010\u3001\u304A\u3088\u3073 1.175494351E-38 \u304B\u3089 3.402823466E+38 \u3067\u3059\u3002",baseQuery:"FLOAT",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:33,name:"double",description:"\u666E\u901A\u30B5\u30A4\u30BA (\u500D\u7CBE\u5EA6) \u306E\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u3066\u3044\u308B\u5024\u306F\u3001-1.7976931348623157E+308 \u304B\u3089 -2.2250738585072014E-308\u30010\u3001\u304A\u3088\u3073 2.2250738585072014E-308 \u304B\u3089 1.7976931348623157E+308 \u3067\u3059\u3002",baseQuery:"DOUBLE",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:35,name:"decimal",description:"\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 \u6841\u657010 (\u7CBE\u5EA6) \u3067\u3001\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u65700\u3067\u3059\u3002",baseQuery:"DECIMAL",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:36,name:"numeric",description:"DECIMAL \u306E\u30B7\u30CE\u30CB\u30E0\u3067\u3059\u3002\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 \u6841\u657010 (\u7CBE\u5EA6) \u3067\u3001\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u65700\u3067\u3059\u3002",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:41,name:"float (m, d)",description:"\u5C0F\u3055\u3044 (\u5358\u7CBE\u5EA6) \u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u308B\u5024\u306F\u3001-3.402823466E+38 \u304B\u3089 -1.175494351E-38\u30010\u3001\u304A\u3088\u3073 1.175494351E-38 \u304B\u3089 3.402823466E+38 \u3067\u3059\u3002",baseQuery:"FLOAT[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:42,name:"float (p)",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3067\u3059\u3002p \u306F\u7CBE\u5EA6\u3092\u30D3\u30C3\u30C8\u3067\u8868\u73FE\u3057\u307E\u3059\u3002",baseQuery:"FLOAT[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:43,name:"double (m, d)",description:"\u666E\u901A\u30B5\u30A4\u30BA (\u500D\u7CBE\u5EA6) \u306E\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u3066\u3044\u308B\u5024\u306F\u3001-1.7976931348623157E+308 \u304B\u3089 -2.2250738585072014E-308\u30010\u3001\u304A\u3088\u3073 2.2250738585072014E-308 \u304B\u3089 1.7976931348623157E+308 \u3067\u3059\u3002",baseQuery:"DOUBLE[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:45,name:"decimal (m, d)",description:"\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 M \u306F\u6841\u6570\u306E\u5408\u8A08 (\u7CBE\u5EA6) \u3067\u3001D \u306F\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u6570 (\u30B9\u30B1\u30FC\u30EB) \u3067\u3059\u3002",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:46,name:"numeric (m, d)",description:"DECIMAL \u306E\u30B7\u30CE\u30CB\u30E0\u3067\u3059\u3002\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 M \u306F\u6841\u6570\u306E\u5408\u8A08 (\u7CBE\u5EA6) \u3067\u3001D \u306F\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u6570 (\u30B9\u30B1\u30FC\u30EB) \u3067\u3059\u3002",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:101,name:"date",description:'\u65E5\u4ED8\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01" \u304B\u3089 "9999-12-31" \u3067\u3059\u3002',baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_DATE)"]}),new u({id:131,name:"time",description:'\u6642\u9593\u3067\u3059\u3002 \u7BC4\u56F2\u306F\u3001"-838:59:59.000000" \u304B\u3089 "838:59:59.000000" \u3067\u3059\u3002',baseQuery:"TIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_TIME)"]}),new u({id:141,name:"time (p)",description:'\u6642\u9593\u3067\u3059\u3002 \u7BC4\u56F2\u306F\u3001"-838:59:59.000000" \u304B\u3089 "838:59:59.000000" \u3067\u3059\u3002',baseQuery:"TIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_TIME)"]}),new u({id:112,name:"datetime",description:'\u65E5\u4ED8\u3068\u6642\u9593\u306E\u7D44\u307F\u5408\u308F\u305B\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01 00:00:00.000000" \u304B\u3089 "9999-12-31 23:59:59.999999" \u3067\u3059\u3002',baseQuery:"DATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP","CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"]}),new u({id:115,name:"timestamp",description:'\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u3067\u3059\u3002 \u7BC4\u56F2\u306F "1970-01-01 00:00:01.000000" UTC \u304B\u3089 "2038-01-19 03:14:07.999999" UTC \u3067\u3059\u3002',baseQuery:"TIMESTAMP",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP","CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"]}),new u({id:122,name:"datetime (p)",description:'\u65E5\u4ED8\u3068\u6642\u9593\u306E\u7D44\u307F\u5408\u308F\u305B\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01 00:00:00.000000" \u304B\u3089 "9999-12-31 23:59:59.999999" \u3067\u3059\u3002',baseQuery:"DATETIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP[[PARAM]]","CURRENT_TIMESTAMP[[PARAM]] ON UPDATE CURRENT_TIMESTAMP[[PARAM]]"]}),new u({id:125,name:"timestamp (p)",description:'\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u3067\u3059\u3002 \u7BC4\u56F2\u306F "1970-01-01 00:00:01.000000" UTC \u304B\u3089 "2038-01-19 03:14:07.999999" UTC \u3067\u3059\u3002',baseQuery:"TIMESTAMP[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP[[PARAM]]","CURRENT_TIMESTAMP[[PARAM]] ON UPDATE CURRENT_TIMESTAMP[[PARAM]]"]}),new u({id:151,name:"year",description:"4 \u6841\u5F62\u5F0F\u306E\u5E74\u3002",baseQuery:"YEAR",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:301,name:"char",description:"\u683C\u7D0D\u6642\u306B\u5FC5\u305A\u3001\u6307\u5B9A\u3055\u308C\u305F\u9577\u3055\u306B\u306A\u308B\u3088\u3046\u306B\u53F3\u5074\u304C\u30B9\u30DA\u30FC\u30B9\u3067\u57CB\u3081\u3089\u308C\u308B\u56FA\u5B9A\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"CHAR",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:311,name:"char (m)",description:"\u683C\u7D0D\u6642\u306B\u5FC5\u305A\u3001\u6307\u5B9A\u3055\u308C\u305F\u9577\u3055\u306B\u306A\u308B\u3088\u3046\u306B\u53F3\u5074\u304C\u30B9\u30DA\u30FC\u30B9\u3067\u57CB\u3081\u3089\u308C\u308B\u56FA\u5B9A\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:312,name:"varchar (m)",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:321,name:"tinytext",description:"\u6700\u5927\u9577\u304C 255 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TINYTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:322,name:"text",description:"\u6700\u5927\u9577\u304C 65,535 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:323,name:"text (m)",description:"\u6700\u5927\u9577\u304C 65,535 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TEXT[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:324,name:"mediumtext",description:"\u6700\u5927\u9577\u304C 16,777,215 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"MEDIUMTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:325,name:"longtext",description:"\u6700\u5927\u9577\u304C 4G \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"LONGTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:3,name:"binary (m)",description:"\u30D0\u30A4\u30CA\u30EA\u30D0\u30A4\u30C8\u6587\u5B57\u5217\u3092\u683C\u7D0D\u3057\u307E\u3059\u3002",baseQuery:"BINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:5,name:"varbinary (m)",description:"\u30D0\u30A4\u30CA\u30EA\u30D0\u30A4\u30C8\u6587\u5B57\u5217\u3092\u683C\u7D0D\u3057\u307E\u3059\u3002",baseQuery:"VARBINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:361,name:"tinyblob",description:"\u6700\u5927\u9577\u304C 255 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"TINYBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:363,name:"blob",description:"\u6700\u5927\u9577\u304C 65,535 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"BLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:364,name:"blob (m)",description:"\u6700\u5927\u9577\u304C 65,535 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"BLOB[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:365,name:"mediumblob",description:"\u6700\u5927\u9577\u304C 16,777,215 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"MEDIUMBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:367,name:"longblob",description:"\u6700\u5927\u9577\u304C 4G \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"LONGBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:422,name:"json",description:"\u6587\u66F8\u306E\u578B\u5F0F\u3067\u3042\u308BJSON\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"JSON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2001,name:"geometry",description:"\u7A7A\u9593\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002\u70B9\u3001\u7DDA\u3001\u591A\u89D2\u5F62\u3001\u304A\u3088\u3073\u305D\u306E\u4ED6\u306E\u5F62\u72B6\u3092\u542B\u3081\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002",baseQuery:"GEOMETRY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2011,name:"point",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u7A7A\u9593\u4E0A\u306E\u5358\u4E00\u306E\u70B9\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"POINT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2012,name:"linestring",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u7A7A\u9593\u4E0A\u306E\u8907\u6570\u306E\u70B9\u3092\u7D50\u3076\u76F4\u7DDA\u30BB\u30B0\u30E1\u30F3\u30C8\u306E\u9023\u7D9A\u3057\u305F\u30BB\u30C3\u30C8\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"LINESTRING",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2013,name:"polygon",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u5E73\u9762\u4E0A\u306E\u5358\u4E00\u306E\u9818\u57DF\u3092\u8868\u3059\u9589\u3058\u305F\u30EB\u30FC\u30D7\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"POLYGON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2021,name:"multipoint",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u70B9\u3092\u8868\u3059\u8907\u6570\u306EPOINT\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTIPOINT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2022,name:"multilinestring",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u7DDA\u5206\u3092\u8868\u3059\u8907\u6570\u306ELINESTRING\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTILINESTRING",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2023,name:"multipolygon",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u30DD\u30EA\u30B4\u30F3\u3092\u8868\u3059\u8907\u6570\u306EPOLYGON\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTIPOLYGON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2031,name:"geometrycollection",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306EGEOMETRY\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"GEOMETRYCOLLECTION",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2101,name:"enum",description:"\u6587\u5B57\u5217\u306E\u30EA\u30B9\u30C8\u306E\u4E2D\u304B\u30891\u3064\u3092\u9078\u629E\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"ENUM",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2102,name:"set",description:"ENUM\u306E\u62E1\u5F35\u7248\u3067\u3042\u308A\u3001\u6587\u5B57\u5217\u306E\u30EA\u30B9\u30C8\u304B\u3089\u8907\u6570\u306E\u9078\u629E\u80A2\u3092\u9078\u629E\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"SET",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),u.EMPTY],ms_sqlserver:[new u({id:1,name:"bit",description:"1\u30010\u3001\u307E\u305F\u306FNULL\u306E\u5024\u3092\u53D7\u3051\u53D6\u308B\u3053\u3068\u304C\u3067\u304D\u308B\u6574\u6570\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"BIT",category:"bit",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:3,name:"binary (n)",description:"n \u30D0\u30A4\u30C8\u306E\u56FA\u5B9A\u9577\u306E binary \u30C7\u30FC\u30BF\u3067\u3059\u3002\u3053\u3053\u3067\u3001n \u306F 1 \u304B\u3089 8,000 \u306E\u5024\u306B\u306A\u308A\u307E\u3059\u3002",baseQuery:"BINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:4,name:"binary",description:"\u56FA\u5B9A\u9577\u306E binary \u30C7\u30FC\u30BF\u3067\u3059\u3002",baseQuery:"BINARY",category:"bit",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:5,name:"varbinary (n)",description:"\u53EF\u5909\u9577 binary \u30C7\u30FC\u30BF\u3002 n \u306B\u306F 1 \uFF5E 8,000 \u306E\u5024\u3092\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002",baseQuery:"VARBINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:9,name:"varbinary (max)",description:"\u53EF\u5909\u9577 binary \u30C7\u30FC\u30BF\u3002",baseQuery:"VARBINARY(MAX)",category:"bit",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:10,name:"tinyint",description:"\u6574\u6570\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B\u5B9F\u6570\u30C7\u30FC\u30BF\u578B\u3067\u3059\u30020 to 255 (2^0-1 to 2^8-1)",baseQuery:"TINYINT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:11,name:"smallint",description:"\u6574\u6570\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B\u5B9F\u6570\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002-32,768 to 32,767 (-2^15 to 2^15-1)",baseQuery:"SMALLINT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:15,name:"int",description:"\u6574\u6570\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B\u5B9F\u6570\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002-2,147,483,648 to 2,147,483,647 (-2^31 to 2^31-1)",baseQuery:"INT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:17,name:"bigint",description:"\u6574\u6570\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B\u5B9F\u6570\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 (-2^63 to 2^63-1)",baseQuery:"BIGINT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:31,name:"real",description:"real \u306E ISO \u30B7\u30CE\u30CB\u30E0\u306F\u3001 float (24) \u3067\u3059\u3002",baseQuery:"REAL",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:33,name:"float",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u5024\u30C7\u30FC\u30BF\u3067\u4F7F\u7528\u3059\u308B\u6982\u6570\u578B\u3067\u3059\u3002",baseQuery:"FLOAT",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:35,name:"decimal",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"DECIMAL",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:36,name:"numeric",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002decimal \u3068 numeric \u306F\u30B7\u30CE\u30CB\u30E0\u3067\u3042\u308A\u3001\u540C\u3058\u610F\u5473\u3067\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:42,name:"float (n)",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u5024\u30C7\u30FC\u30BF\u3067\u4F7F\u7528\u3059\u308B\u6982\u6570\u578B\u3067\u3059\u3002",baseQuery:"FLOAT[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:45,name:"decimal (m, s)",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withAutoIncrement:!1}),new u({id:46,name:"numeric (m, s)",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002decimal \u3068 numeric \u306F\u30B7\u30CE\u30CB\u30E0\u3067\u3042\u308A\u3001\u540C\u3058\u610F\u5473\u3067\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withAutoIncrement:!1}),new u({id:47,name:"decimal (m)",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!1,withAutoIncrement:!0}),new u({id:48,name:"numeric (m)",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002decimal \u3068 numeric \u306F\u30B7\u30CE\u30CB\u30E0\u3067\u3042\u308A\u3001\u540C\u3058\u610F\u5473\u3067\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!1,withAutoIncrement:!0}),new u({id:65,name:"smallmoney",description:"\u91D1\u984D\u5024\u307E\u305F\u306F\u901A\u8CA8\u5024\u3092\u8868\u3059\u30C7\u30FC\u30BF\u578B\u3002-214,748.3648 to 214,748.3647",baseQuery:"SMALLMONEY",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:67,name:"money",description:"\u91D1\u984D\u5024\u307E\u305F\u306F\u901A\u8CA8\u5024\u3092\u8868\u3059\u30C7\u30FC\u30BF\u578B\u3002-922,337,203,685,477.5808 to 922,337,203,685,477.5807",baseQuery:"MONEY",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:101,name:"date",description:"\u65E5\u4ED8\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002",baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:111,name:"datetime2",description:"24 \u6642\u9593\u5F62\u5F0F\u306E\u6642\u523B\u3068\u7D44\u307F\u5408\u308F\u305B\u305F\u65E5\u4ED8\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002",baseQuery:"DATETIME2",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["SYSDATETIME()","SYSUTCDATETIME()"]}),new u({id:112,name:"datetimeoffset",description:"datetime2 \u306A\u3069\u306E 24 \u6642\u9593\u5236\u306B\u57FA\u3065\u3044\u3066 1 \u65E5\u306E\u6642\u523B\u3068\u7D44\u307F\u5408\u308F\u3055\u308C\u308B\u65E5\u4ED8\u3092\u5B9A\u7FA9\u3057\u3001\u5354\u5B9A\u4E16\u754C\u6642 (UTC) \u306B\u57FA\u3065\u3044\u3066\u30BF\u30A4\u30E0 \u30BE\u30FC\u30F3\u8A8D\u8B58\u3092\u8FFD\u52A0\u3057\u307E\u3059\u3002",baseQuery:"DATETIMEOFFSET",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["SYSDATETIMEOFFSET()"]}),new u({id:121,name:"datetime2 (p)",description:"24 \u6642\u9593\u5F62\u5F0F\u306E\u6642\u523B\u3068\u7D44\u307F\u5408\u308F\u305B\u305F\u65E5\u4ED8\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002",baseQuery:"DATETIME2[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["SYSDATETIME()","SYSUTCDATETIME()"]}),new u({id:122,name:"datetimeoffset (p)",description:"datetime2 \u306A\u3069\u306E 24 \u6642\u9593\u5236\u306B\u57FA\u3065\u3044\u3066 1 \u65E5\u306E\u6642\u523B\u3068\u7D44\u307F\u5408\u308F\u3055\u308C\u308B\u65E5\u4ED8\u3092\u5B9A\u7FA9\u3057\u3001\u5354\u5B9A\u4E16\u754C\u6642 (UTC) \u306B\u57FA\u3065\u3044\u3066\u30BF\u30A4\u30E0 \u30BE\u30FC\u30F3\u8A8D\u8B58\u3092\u8FFD\u52A0\u3057\u307E\u3059\u3002",baseQuery:"DATETIMEOFFSET[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["SYSDATETIMEOFFSET()"]}),new u({id:131,name:"time",description:"1 \u65E5\u306E\u6642\u523B\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002 \u6642\u523B\u306F 24 \u6642\u9593\u5F62\u5F0F\u3067\u3001\u30BF\u30A4\u30E0 \u30BE\u30FC\u30F3\u306F\u8A8D\u8B58\u3055\u308C\u307E\u305B\u3093\u3002",baseQuery:"TIME",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:141,name:"time (s)",description:"",baseQuery:"TIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:191,name:"smalldatetime (deprecated)",description:"(deprecated)",baseQuery:"SMALLDATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["GETDATE()","GETUTCDATE()"]}),new u({id:192,name:"datetime (deprecated)",description:"(deprecated)",baseQuery:"DATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["GETDATE()","GETUTCDATE()"]}),new u({id:301,name:"char",description:"\u56FA\u5B9A\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"CHAR",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:302,name:"varchar",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"VARCHAR",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:306,name:"nchar",description:"\u56FA\u5B9A\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u5217\u30C7\u30FC\u30BF\u3067\u3059\u3002",baseQuery:"NCHAR",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:307,name:"nvarchar",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u5217\u30C7\u30FC\u30BF\u3067\u3059\u3002 ",baseQuery:"NVARCHAR",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:311,name:"char (n)",description:"\u56FA\u5B9A\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:312,name:"varchar (n)",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:316,name:"nchar (n)",description:"\u56FA\u5B9A\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u5217\u30C7\u30FC\u30BF\u3067\u3059\u3002",baseQuery:"NCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:317,name:"nvarchar (n)",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u5217\u30C7\u30FC\u30BF\u3067\u3059\u3002 ",baseQuery:"NVARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:325,name:"varchar (max)",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"VARCHAR(MAX)",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:326,name:"nvarchar (max)",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u5217\u30C7\u30FC\u30BF\u3067\u3059\u3002 ",baseQuery:"NVARCHAR(MAX)",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:395,name:"text (deprecated)",description:"(deprecated)",baseQuery:"TEXT",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:396,name:"ntext (deprecated)",description:"(deprecated)",baseQuery:"NTEXT",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:397,name:"image (deprecated)",description:"(deprecated)",baseQuery:"IMAGE",category:"bit",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:422,name:"json",description:"The native json data type that stores JSON documents in a native binary format.",baseQuery:"JSON",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:431,name:"xml",description:"XML \u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"XML",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:453,name:"vector",description:"vector \u30C7\u30FC\u30BF\u578B\u306F\u3001\u985E\u4F3C\u6027\u691C\u7D22\u3084\u6A5F\u68B0\u5B66\u7FD2\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306A\u3069\u306E\u64CD\u4F5C\u7528\u306B\u6700\u9069\u5316\u3055\u308C\u305F\u30D9\u30AF\u30C8\u30EB \u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u3088\u3046\u306B\u8A2D\u8A08\u3055\u308C\u3066\u3044\u307E\u3059\u3002",baseQuery:"VECTOR",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:2001,name:"geometry",description:"\u5E73\u9762\u7A7A\u9593\u30C7\u30FC\u30BF\u578B\u306E geometry \u306F\u3001SQL Server \u3067\u306F\u5171\u901A\u8A00\u8A9E\u30E9\u30F3\u30BF\u30A4\u30E0 (CLR) \u306E\u30C7\u30FC\u30BF\u578B\u3068\u3057\u3066\u5B9F\u88C5\u3055\u308C\u3066\u3044\u307E\u3059\u3002 \u3053\u306E\u578B\u306F\u3001\u30E6\u30FC\u30AF\u30EA\u30C3\u30C9 (\u5E73\u9762) \u5EA7\u6A19\u7CFB\u306E\u30C7\u30FC\u30BF\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"GEOMETRY",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:2002,name:"geography",description:"\u5730\u7406\u7A7A\u9593\u30C7\u30FC\u30BF\u578B\u306E geography \u306F\u3001SQL Server \u3067\u306F .NET \u5171\u901A\u8A00\u8A9E\u30E9\u30F3\u30BF\u30A4\u30E0 (CLR) \u306E\u30C7\u30FC\u30BF\u578B\u3068\u3057\u3066\u5B9F\u88C5\u3055\u308C\u3066\u3044\u307E\u3059\u3002 \u3053\u306E\u578B\u306F\u3001\u7403\u4F53\u5730\u7403\u5EA7\u6A19\u7CFB\u306E\u30C7\u30FC\u30BF\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"GEOGRAPHY",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:2061,name:"hierarchyid",description:"hierarchyid \u30C7\u30FC\u30BF\u578B\u306F\u53EF\u5909\u9577\u306E\u30B7\u30B9\u30C6\u30E0 \u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002 hierarchyid \u306F\u3001\u968E\u5C64\u5185\u306E\u4F4D\u7F6E\u3092\u8868\u3059\u305F\u3081\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002",baseQuery:"HIERARCHYID",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:9301,name:"uniqueidentifier",description:"16 \u30D0\u30A4\u30C8\u306E GUID \u3067\u3059\u3002",baseQuery:"UNIQUEIDENTIFIER",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:9302,name:"sql_variant",description:"SQL Server \u3067\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u5404\u7A2E\u30C7\u30FC\u30BF\u578B\u306E\u5024\u304C\u683C\u7D0D\u3055\u308C\u307E\u3059\u3002",baseQuery:"SQL_VARIANT",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),u.EMPTY],mariadb:[new u({id:1,name:"bit",description:"\u30D3\u30C3\u30C8\u5024\u578B",baseQuery:"BIT",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2,name:"bit (m)",description:"\u30D3\u30C3\u30C8\u5024\u578B",baseQuery:"BIT[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:6,name:"boolean",description:"TINYINT(1) \u306E\u30B7\u30CE\u30CB\u30E0",baseQuery:"BOOLEAN",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:10,name:"tinyint",description:"\u975E\u5E38\u306B\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -128 \u304B\u3089 127 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 255 \u3067\u3059\u3002",baseQuery:"TINYINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:11,name:"smallint",description:"\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -32768 \u304B\u3089 32767 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 65535 \u3067\u3059\u3002",baseQuery:"SMALLINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:13,name:"mediumint",description:"\u4E2D\u9593\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -8388608 \u304B\u3089 8388607 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 16777215 \u3067\u3059\u3002",baseQuery:"MEDIUMINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:15,name:"int",description:"\u666E\u901A\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -2147483648 \u304B\u3089 2147483647 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 4294967295 \u3067\u3059\u3002",baseQuery:"INT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:17,name:"bigint",description:"\u5927\u304D\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -9223372036854775808 \u304B\u3089 9223372036854775807 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 18446744073709551615 \u3067\u3059\u3002",baseQuery:"BIGINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:20,name:"tinyint (m)",description:"\u975E\u5E38\u306B\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -128 \u304B\u3089 127 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 255 \u3067\u3059\u3002",baseQuery:"TINYINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!1}),new u({id:21,name:"smallint (m)",description:"\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -32768 \u304B\u3089 32767 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 65535 \u3067\u3059\u3002",baseQuery:"SMALLINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:23,name:"mediumint (m)",description:"\u4E2D\u9593\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -8388608 \u304B\u3089 8388607 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 16777215 \u3067\u3059\u3002",baseQuery:"MEDIUMINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:25,name:"int (m)",description:"\u666E\u901A\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -2147483648 \u304B\u3089 2147483647 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 4294967295 \u3067\u3059\u3002",baseQuery:"INT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:27,name:"bigint (m)",description:"\u5927\u304D\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -9223372036854775808 \u304B\u3089 9223372036854775807 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 18446744073709551615 \u3067\u3059\u3002",baseQuery:"BIGINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:31,name:"float",description:"\u5C0F\u3055\u3044 (\u5358\u7CBE\u5EA6) \u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u308B\u5024\u306F\u3001-3.402823466E+38 \u304B\u3089 -1.175494351E-38\u30010\u3001\u304A\u3088\u3073 1.175494351E-38 \u304B\u3089 3.402823466E+38 \u3067\u3059\u3002",baseQuery:"FLOAT",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:33,name:"double",description:"\u666E\u901A\u30B5\u30A4\u30BA (\u500D\u7CBE\u5EA6) \u306E\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u3066\u3044\u308B\u5024\u306F\u3001-1.7976931348623157E+308 \u304B\u3089 -2.2250738585072014E-308\u30010\u3001\u304A\u3088\u3073 2.2250738585072014E-308 \u304B\u3089 1.7976931348623157E+308 \u3067\u3059\u3002",baseQuery:"DOUBLE",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:35,name:"decimal",description:"\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 \u6841\u657010 (\u7CBE\u5EA6) \u3067\u3001\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u65700\u3067\u3059\u3002",baseQuery:"DECIMAL",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:36,name:"numeric",description:"DECIMAL \u306E\u30B7\u30CE\u30CB\u30E0\u3067\u3059\u3002\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 \u6841\u657010 (\u7CBE\u5EA6) \u3067\u3001\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u65700\u3067\u3059\u3002",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:41,name:"float (m, d)",description:"\u5C0F\u3055\u3044 (\u5358\u7CBE\u5EA6) \u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u308B\u5024\u306F\u3001-3.402823466E+38 \u304B\u3089 -1.175494351E-38\u30010\u3001\u304A\u3088\u3073 1.175494351E-38 \u304B\u3089 3.402823466E+38 \u3067\u3059\u3002",baseQuery:"FLOAT[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:42,name:"float (p)",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3067\u3059\u3002p \u306F\u7CBE\u5EA6\u3092\u30D3\u30C3\u30C8\u3067\u8868\u73FE\u3057\u307E\u3059\u3002",baseQuery:"FLOAT[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:43,name:"double (m, d)",description:"\u666E\u901A\u30B5\u30A4\u30BA (\u500D\u7CBE\u5EA6) \u306E\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u3066\u3044\u308B\u5024\u306F\u3001-1.7976931348623157E+308 \u304B\u3089 -2.2250738585072014E-308\u30010\u3001\u304A\u3088\u3073 2.2250738585072014E-308 \u304B\u3089 1.7976931348623157E+308 \u3067\u3059\u3002",baseQuery:"DOUBLE[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:45,name:"decimal (m, d)",description:"\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 M \u306F\u6841\u6570\u306E\u5408\u8A08 (\u7CBE\u5EA6) \u3067\u3001D \u306F\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u6570 (\u30B9\u30B1\u30FC\u30EB) \u3067\u3059\u3002",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:46,name:"numeric (m, d)",description:"DECIMAL \u306E\u30B7\u30CE\u30CB\u30E0\u3067\u3059\u3002\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 M \u306F\u6841\u6570\u306E\u5408\u8A08 (\u7CBE\u5EA6) \u3067\u3001D \u306F\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u6570 (\u30B9\u30B1\u30FC\u30EB) \u3067\u3059\u3002",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:101,name:"date",description:'\u65E5\u4ED8\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01" \u304B\u3089 "9999-12-31" \u3067\u3059\u3002',baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_DATE)"]}),new u({id:131,name:"time",description:'\u6642\u9593\u3067\u3059\u3002 \u7BC4\u56F2\u306F\u3001"-838:59:59.000000" \u304B\u3089 "838:59:59.000000" \u3067\u3059\u3002',baseQuery:"TIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_TIME)"]}),new u({id:141,name:"time (p)",description:'\u6642\u9593\u3067\u3059\u3002 \u7BC4\u56F2\u306F\u3001"-838:59:59.000000" \u304B\u3089 "838:59:59.000000" \u3067\u3059\u3002',baseQuery:"TIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_TIME)"]}),new u({id:112,name:"datetime",description:'\u65E5\u4ED8\u3068\u6642\u9593\u306E\u7D44\u307F\u5408\u308F\u305B\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01 00:00:00.000000" \u304B\u3089 "9999-12-31 23:59:59.999999" \u3067\u3059\u3002',baseQuery:"DATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP","CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"]}),new u({id:115,name:"timestamp",description:'\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u3067\u3059\u3002 \u7BC4\u56F2\u306F "1970-01-01 00:00:01.000000" UTC \u304B\u3089 "2038-01-19 03:14:07.999999" UTC \u3067\u3059\u3002',baseQuery:"TIMESTAMP",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP","CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"]}),new u({id:122,name:"datetime (p)",description:'\u65E5\u4ED8\u3068\u6642\u9593\u306E\u7D44\u307F\u5408\u308F\u305B\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01 00:00:00.000000" \u304B\u3089 "9999-12-31 23:59:59.999999" \u3067\u3059\u3002',baseQuery:"DATETIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP[[PARAM]]","CURRENT_TIMESTAMP[[PARAM]] ON UPDATE CURRENT_TIMESTAMP[[PARAM]]"]}),new u({id:125,name:"timestamp (p)",description:'\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u3067\u3059\u3002 \u7BC4\u56F2\u306F "1970-01-01 00:00:01.000000" UTC \u304B\u3089 "2038-01-19 03:14:07.999999" UTC \u3067\u3059\u3002',baseQuery:"TIMESTAMP[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP[[PARAM]]","CURRENT_TIMESTAMP[[PARAM]] ON UPDATE CURRENT_TIMESTAMP[[PARAM]]"]}),new u({id:151,name:"year",description:"4 \u6841\u5F62\u5F0F\u306E\u5E74\u3002",baseQuery:"YEAR",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:301,name:"char",description:"\u683C\u7D0D\u6642\u306B\u5FC5\u305A\u3001\u6307\u5B9A\u3055\u308C\u305F\u9577\u3055\u306B\u306A\u308B\u3088\u3046\u306B\u53F3\u5074\u304C\u30B9\u30DA\u30FC\u30B9\u3067\u57CB\u3081\u3089\u308C\u308B\u56FA\u5B9A\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"CHAR",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:311,name:"char (m)",description:"\u683C\u7D0D\u6642\u306B\u5FC5\u305A\u3001\u6307\u5B9A\u3055\u308C\u305F\u9577\u3055\u306B\u306A\u308B\u3088\u3046\u306B\u53F3\u5074\u304C\u30B9\u30DA\u30FC\u30B9\u3067\u57CB\u3081\u3089\u308C\u308B\u56FA\u5B9A\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:312,name:"varchar (m)",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:321,name:"tinytext",description:"\u6700\u5927\u9577\u304C 255 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TINYTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:322,name:"text",description:"\u6700\u5927\u9577\u304C 65,535 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:323,name:"text (m)",description:"\u6700\u5927\u9577\u304C 65,535 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TEXT[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:324,name:"mediumtext",description:"\u6700\u5927\u9577\u304C 16,777,215 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"MEDIUMTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:325,name:"longtext",description:"\u6700\u5927\u9577\u304C 4G \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"LONGTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:3,name:"binary (m)",description:"\u30D0\u30A4\u30CA\u30EA\u30D0\u30A4\u30C8\u6587\u5B57\u5217\u3092\u683C\u7D0D\u3057\u307E\u3059\u3002",baseQuery:"BINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:5,name:"varbinary (m)",description:"\u30D0\u30A4\u30CA\u30EA\u30D0\u30A4\u30C8\u6587\u5B57\u5217\u3092\u683C\u7D0D\u3057\u307E\u3059\u3002",baseQuery:"VARBINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:361,name:"tinyblob",description:"\u6700\u5927\u9577\u304C 255 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"TINYBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:363,name:"blob",description:"\u6700\u5927\u9577\u304C 65,535 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"BLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:364,name:"blob (m)",description:"\u6700\u5927\u9577\u304C 65,535 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"BLOB[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:365,name:"mediumblob",description:"\u6700\u5927\u9577\u304C 16,777,215 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"MEDIUMBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:367,name:"longblob",description:"\u6700\u5927\u9577\u304C 4G \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"LONGBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:422,name:"json",description:"\u6587\u66F8\u306E\u578B\u5F0F\u3067\u3042\u308BJSON\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"JSON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2001,name:"geometry",description:"\u7A7A\u9593\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002\u70B9\u3001\u7DDA\u3001\u591A\u89D2\u5F62\u3001\u304A\u3088\u3073\u305D\u306E\u4ED6\u306E\u5F62\u72B6\u3092\u542B\u3081\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002",baseQuery:"GEOMETRY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2011,name:"point",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u7A7A\u9593\u4E0A\u306E\u5358\u4E00\u306E\u70B9\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"POINT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2012,name:"linestring",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u7A7A\u9593\u4E0A\u306E\u8907\u6570\u306E\u70B9\u3092\u7D50\u3076\u76F4\u7DDA\u30BB\u30B0\u30E1\u30F3\u30C8\u306E\u9023\u7D9A\u3057\u305F\u30BB\u30C3\u30C8\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"LINESTRING",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2013,name:"polygon",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u5E73\u9762\u4E0A\u306E\u5358\u4E00\u306E\u9818\u57DF\u3092\u8868\u3059\u9589\u3058\u305F\u30EB\u30FC\u30D7\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"POLYGON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2021,name:"multipoint",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u70B9\u3092\u8868\u3059\u8907\u6570\u306EPOINT\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTIPOINT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2022,name:"multilinestring",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u7DDA\u5206\u3092\u8868\u3059\u8907\u6570\u306ELINESTRING\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTILINESTRING",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2023,name:"multipolygon",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u30DD\u30EA\u30B4\u30F3\u3092\u8868\u3059\u8907\u6570\u306EPOLYGON\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTIPOLYGON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2031,name:"geometrycollection",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306EGEOMETRY\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"GEOMETRYCOLLECTION",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2101,name:"enum",description:"\u6587\u5B57\u5217\u306E\u30EA\u30B9\u30C8\u306E\u4E2D\u304B\u30891\u3064\u3092\u9078\u629E\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"ENUM",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2102,name:"set",description:"ENUM\u306E\u62E1\u5F35\u7248\u3067\u3042\u308A\u3001\u6587\u5B57\u5217\u306E\u30EA\u30B9\u30C8\u304B\u3089\u8907\u6570\u306E\u9078\u629E\u80A2\u3092\u9078\u629E\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"SET",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:411,name:"uuid",description:"128\u30D3\u30C3\u30C8\u306EUUID\u5024\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B (MariaDB 10.7+)\u3002",baseQuery:"UUID",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:1113,name:"inet4",description:"IPv4\u30A2\u30C9\u30EC\u30B9\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B (MariaDB 10.10+)\u3002",baseQuery:"INET4",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:1114,name:"inet6",description:"IPv6\u30A2\u30C9\u30EC\u30B9\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B (MariaDB 10.5+)\u3002",baseQuery:"INET6",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),u.EMPTY],sqlite:[new u({id:15,name:"integer",description:"\u6574\u6570\u5024\u3002INTEGER\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u3002\u5358\u4E00\u5217\u306EPRIMARY KEY\u306B\u8A2D\u5B9A\u3059\u308B\u3068rowid\u30A8\u30A4\u30EA\u30A2\u30B9\u3068\u306A\u308A\u81EA\u52D5\u63A1\u756A\u76F8\u5F53\u306B\u306A\u308B\u3002",baseQuery:"INTEGER",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:33,name:"real",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u5024\u3002REAL\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u3002",baseQuery:"REAL",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:325,name:"text",description:"\u6587\u5B57\u5217\u3002TEXT\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u3002",baseQuery:"TEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:363,name:"blob",description:"\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002BLOB\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3(\u578B\u6307\u5B9A\u306A\u3057\u3068\u540C\u7FA9)\u3002",baseQuery:"BLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:36,name:"numeric",description:"\u6570\u5024\u3002NUMERIC\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u3002",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:6,name:"boolean",description:"\u8AD6\u7406\u5024\u3002NUMERIC\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"BOOLEAN",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:311,name:"char (n)",description:"\u56FA\u5B9A\u9577\u6587\u5B57\u5217\u306E\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002n\u306F\u69CB\u6587\u4E0A\u66F8\u3051\u308B\u304C\u7121\u8996\u3055\u308CTEXT\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u3002",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:312,name:"varchar (n)",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217\u306E\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002n\u306F\u69CB\u6587\u4E0A\u66F8\u3051\u308B\u304C\u7121\u8996\u3055\u308CTEXT\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u3002",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:101,name:"date",description:"\u65E5\u4ED8\u306E\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002NUMERIC\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u6163\u7528\u578B\u3002",baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:112,name:"datetime",description:"\u65E5\u6642\u306E\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002NUMERIC\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u6163\u7528\u578B\u3002",baseQuery:"DATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:45,name:"decimal (p, s)",description:"\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u306E\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002p,s\u306F\u69CB\u6587\u4E0A\u66F8\u3051\u308B\u304C\u7121\u8996\u3055\u308CNUMERIC\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u3002",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),u.EMPTY],bigquery:[new u({id:17,name:"int64",description:"8\u30D0\u30A4\u30C8\u7B26\u53F7\u4ED8\u304D\u6574\u6570\u3002INT/SMALLINT/INTEGER/BIGINT/TINYINT/BYTEINT \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"INT64",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:33,name:"float64",description:"\u500D\u7CBE\u5EA6\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u5024\u3002FLOAT \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"FLOAT64",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:36,name:"numeric",description:"\u7CBE\u5EA638\u6841\u30FB\u30B9\u30B1\u30FC\u30EB9\u6841\u306E\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u5024\u3002DECIMAL \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:46,name:"numeric (p, s)",description:"\u7CBE\u5EA6\u30FB\u30B9\u30B1\u30FC\u30EB\u3092\u6307\u5B9A\u3059\u308B\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u5024\u3002DECIMAL \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002\u7CBE\u5EA6\u6307\u5B9A\u4ED8\u304D DDL \u306E\u8AAD\u8FBC\u306F node-sql-parser \u975E\u5BFE\u5FDC\u3002",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:37,name:"bignumeric",description:"\u7CBE\u5EA676.76\u6841\u30FB\u30B9\u30B1\u30FC\u30EB38\u6841\u306E\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u5024\u3002BIGDECIMAL \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"BIGNUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:49,name:"bignumeric (p, s)",description:"\u7CBE\u5EA6\u30FB\u30B9\u30B1\u30FC\u30EB\u3092\u6307\u5B9A\u3059\u308B\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u5024\u3002BIGDECIMAL \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002\u7CBE\u5EA6\u6307\u5B9A\u4ED8\u304D DDL \u306E\u8AAD\u8FBC\u306F node-sql-parser \u975E\u5BFE\u5FDC\u3002",baseQuery:"BIGNUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:6,name:"bool",description:"\u8AD6\u7406\u5024 (\u771F/\u507D)\u3002BOOLEAN \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"BOOL",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:325,name:"string",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217 (Unicode)\u3002",baseQuery:"STRING",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:312,name:"string (n)",description:"\u6700\u5927\u9577\u3092\u6307\u5B9A\u3059\u308B\u53EF\u5909\u9577\u6587\u5B57\u5217 (Unicode)\u3002\u7CBE\u5EA6\u6307\u5B9A\u4ED8\u304D DDL \u306E\u8AAD\u8FBC\u306F node-sql-parser \u975E\u5BFE\u5FDC\u3002",baseQuery:"STRING[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:367,name:"bytes",description:"\u53EF\u5909\u9577\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002",baseQuery:"BYTES",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:5,name:"bytes (n)",description:"\u6700\u5927\u9577\u3092\u6307\u5B9A\u3059\u308B\u53EF\u5909\u9577\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002",baseQuery:"BYTES[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:101,name:"date",description:"\u66A6\u306E\u65E5\u4ED8 (\u5E74\u6708\u65E5)\u3002",baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:111,name:"datetime",description:"\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\u306A\u3057\u306E\u65E5\u4ED8\u3068\u6642\u523B\u3002",baseQuery:"DATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:131,name:"time",description:"\u6642\u523B\u3002",baseQuery:"TIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:112,name:"timestamp",description:"UTC \u57FA\u6E96\u306E\u7D76\u5BFE\u6642\u70B9\u3092\u8868\u3059\u65E5\u4ED8\u3068\u6642\u523B\u3002",baseQuery:"TIMESTAMP",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:422,name:"json",description:"JSON \u5F62\u5F0F\u306E\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"JSON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:2002,name:"geography",description:"\u7403\u4F53\u5730\u7403\u5EA7\u6A19\u7CFB\u306E\u5730\u7406\u7A7A\u9593\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"GEOGRAPHY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),u.EMPTY],snowflake:[new u({id:36,name:"number",description:"\u6570\u5024\u578B\u3002\u65E2\u5B9A\u306E\u7CBE\u5EA6\u30FB\u30B9\u30B1\u30FC\u30EB\u306F (38, 0)\u3002INT/INTEGER/BIGINT \u7B49\u306E\u6574\u6570\u578B\u306F\u3059\u3079\u3066 NUMBER(38,0) \u306E\u30B7\u30CE\u30CB\u30E0\u3068\u3057\u3066\u6271\u308F\u308C\u308B\u3002",baseQuery:"NUMBER",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:46,name:"number (p, s)",description:"\u7CBE\u5EA6\u30FB\u30B9\u30B1\u30FC\u30EB\u3092\u6307\u5B9A\u3059\u308B\u6570\u5024\u578B\u3002INT/INTEGER/BIGINT \u7B49\u306F NUMBER(38,0) \u306E\u30B7\u30CE\u30CB\u30E0\u3067\u3042\u308A\u3001\u3053\u306E\u578B\u3067\u7CBE\u5EA6\u30FB\u30B9\u30B1\u30FC\u30EB\u3092\u660E\u793A\u7684\u306B\u6307\u5B9A\u3057\u305F\u3082\u306E\u306B\u76F8\u5F53\u3059\u308B\u3002",baseQuery:"NUMBER[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!0}),new u({id:33,name:"float",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u5024\u3002\u500D\u7CBE\u5EA6\u6D6E\u52D5\u5C0F\u6570\u70B9\u3068\u3057\u3066\u683C\u7D0D\u3055\u308C\u308B\u3002",baseQuery:"FLOAT",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:301,name:"char",description:"\u56FA\u5B9A\u9577\u6587\u5B57\u5217 (\u5B9F\u969B\u306B\u306F\u53EF\u5909\u9577\u3068\u3057\u3066\u683C\u7D0D\u3055\u308C\u308B)\u3002",baseQuery:"CHAR",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:311,name:"char (n)",description:"\u56FA\u5B9A\u9577\u6587\u5B57\u5217 (\u5B9F\u969B\u306B\u306F\u53EF\u5909\u9577\u3068\u3057\u3066\u683C\u7D0D\u3055\u308C\u308B)\u3002",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:302,name:"varchar",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217\u3002STRING/TEXT \u306F\u30B7\u30CE\u30CB\u30E0\u3002",baseQuery:"VARCHAR",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:312,name:"varchar (n)",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217\u3002STRING/TEXT \u306F\u30B7\u30CE\u30CB\u30E0\u3002",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:4,name:"binary",description:"\u56FA\u5B9A\u9577\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002",baseQuery:"BINARY",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:3,name:"binary (n)",description:"\u56FA\u5B9A\u9577\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002",baseQuery:"BINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:5,name:"varbinary (n)",description:"\u53EF\u5909\u9577\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002BINARY \u306E\u30B7\u30CE\u30CB\u30E0\u3002",baseQuery:"VARBINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:6,name:"boolean",description:"\u8AD6\u7406\u5024 (\u771F/\u507D)\u3002",baseQuery:"BOOLEAN",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:101,name:"date",description:"\u66A6\u306E\u65E5\u4ED8 (\u5E74\u6708\u65E5)\u3002",baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:131,name:"time",description:"\u6642\u523B\u3002\u65E2\u5B9A\u306E\u7CBE\u5EA6\u306F\u79D2\u306E\u5C0F\u6570\u70B9\u4EE5\u4E0B9\u6841\u3002",baseQuery:"TIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:141,name:"time (p)",description:"\u7CBE\u5EA6 (\u79D2\u306E\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570) \u3092\u6307\u5B9A\u3059\u308B\u6642\u523B\u578B\u3002",baseQuery:"TIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:111,name:"timestamp_ntz",description:"\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\u306A\u3057\u306E\u65E5\u4ED8\u3068\u6642\u523B\u3002",baseQuery:"TIMESTAMP_NTZ",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:112,name:"timestamp_tz",description:"\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\u4ED8\u304D\u306E\u65E5\u4ED8\u3068\u6642\u523B\u3002",baseQuery:"TIMESTAMP_TZ",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:113,name:"timestamp_ltz",description:"\u30BB\u30C3\u30B7\u30E7\u30F3\u306E\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\u3067\u89E3\u91C8\u3055\u308C\u308B\u65E5\u4ED8\u3068\u6642\u523B\u3002",baseQuery:"TIMESTAMP_LTZ",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:9601,name:"variant",description:"\u4EFB\u610F\u306E\u4ED6\u306E\u30C7\u30FC\u30BF\u578B\u306E\u5024\u3092\u683C\u7D0D\u3067\u304D\u308B\u534A\u69CB\u9020\u5316\u30C7\u30FC\u30BF\u578B\u3002DDL \u8AAD\u8FBC (\u30A4\u30F3\u30DD\u30FC\u30C8) \u306F node-sql-parser \u306E snowflake \u30C0\u30A4\u30A2\u30EC\u30AF\u30C8\u306E\u5236\u7D04\u306B\u3088\u308A\u975E\u5BFE\u5FDC\u3002",baseQuery:"VARIANT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:9602,name:"object",description:"\u30AD\u30FC\u3068\u5024\u306E\u30DA\u30A2\u306E\u96C6\u5408\u3092\u683C\u7D0D\u3059\u308B\u534A\u69CB\u9020\u5316\u30C7\u30FC\u30BF\u578B\u3002DDL \u8AAD\u8FBC (\u30A4\u30F3\u30DD\u30FC\u30C8) \u306F node-sql-parser \u306E snowflake \u30C0\u30A4\u30A2\u30EC\u30AF\u30C8\u306E\u5236\u7D04\u306B\u3088\u308A\u975E\u5BFE\u5FDC\u3002",baseQuery:"OBJECT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:9603,name:"array",description:"\u5024\u306E\u914D\u5217\u3092\u683C\u7D0D\u3059\u308B\u534A\u69CB\u9020\u5316\u30C7\u30FC\u30BF\u578B\u3002DDL \u8AAD\u8FBC (\u30A4\u30F3\u30DD\u30FC\u30C8) \u306F node-sql-parser \u306E snowflake \u30C0\u30A4\u30A2\u30EC\u30AF\u30C8\u306E\u5236\u7D04\u306B\u3088\u308A\u975E\u5BFE\u5FDC\u3002",baseQuery:"ARRAY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2001,name:"geometry",description:"\u5E73\u9762 (\u30E6\u30FC\u30AF\u30EA\u30C3\u30C9) \u5EA7\u6A19\u7CFB\u306E\u7A7A\u9593\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"GEOMETRY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2002,name:"geography",description:"\u7403\u4F53\u5730\u7403\u5EA7\u6A19\u7CFB\u306E\u5730\u7406\u7A7A\u9593\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"GEOGRAPHY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),u.EMPTY]},Zn=t=>Kh[t],uc=(t,e,n)=>{let r=new Map(Zn(t).map(i=>[i.id,i])),o=e;if(n<20260321&&(o=o.map(i=>{let a=r.get(i.id);return a==null?i:u.migrateDefaultValueCandidates(i,a,n)})),n<20250718&&t==="postgres"){let i=r.get(9103);i!=null&&o.every(a=>a.id!==9103)&&o.push(i)}return n<20251130&&t==="postgres"&&(o=o.map(i=>{let a=r.get(i.id);return a==null||a.withAutoIncrement===!1?i:new u({...i,withAutoIncrement:!0})})),n<20260504&&(o=o.map(i=>{let a=r.get(i.id);return a==null?i:new u({...i,category:a.category})})),o};var dc=20260504,Fn=class t{constructor({databaseType:e,columnTypes:n,version:r}){this.databaseType=e,this.columnTypes=n,this.version=r}static create(e){let n=Zn(e);return new t({databaseType:e,columnTypes:n,version:dc})}getDatabase(){return ee.get(this.databaseType)}initToColumnTypeMapping(){let e=new Map(this.columnTypes.map(n=>[n.id,n]));return n=>e.get(n)??u.EMPTY}findColumnType(e){return this.columnTypes.find(n=>n.id===e)??null}toJSON(){return{databaseType:this.databaseType,columnTypes:this.columnTypes.map(e=>e.toJSON()),version:this.version}}static toObject(e){S(e,"databaseType"),S(e,"columnTypes");let n=e.databaseType,r=j(e.columnTypes,"columnTypes",a=>u.toObject(a)),o="version"in e?e.version:0,i=uc(n,r,o);return new t({databaseType:n,columnTypes:i,version:dc})}equals(e){if(this.databaseType!==e.databaseType||this.columnTypes.length!==e.columnTypes.length)return!1;for(let n=0;n<this.columnTypes.length;n++)if(this.columnTypes[n].equals(e.columnTypes[n])===!1)return!1;return!0}};var Go=class t{constructor({schemaId:e,schemaName:n,description:r}){this.schemaId=e,this.schemaName=n,this.description=r}static create(e,n){return new t({schemaId:X(),schemaName:e,description:n})}update(e){return new t({schemaId:this.schemaId,schemaName:e.schemaName??this.schemaName,description:e.description??this.description})}toJSON(){return{schemaId:this.schemaId,schemaName:this.schemaName,description:this.description}}static toObject(e){return S(e,"schemaId"),S(e,"schemaName"),new t({schemaId:e.schemaId,schemaName:e.schemaName,description:"description"in e?e.description:""})}equals(e){return this.schemaId===e.schemaId&&this.schemaName===e.schemaName&&this.description===e.description}},mc=Go;var Yo=class t{constructor(e,n,r){this.defaultSchemaId=r.has(e)?e:"",this.schemaIds=n,this.schemaMap=r}static create(e={}){let n=e.defaultSchemaId||"",r=e.schemas||[],o=r.map(a=>a.schemaId),i=new Map(r.map(a=>[a.schemaId,a]));return new t(n,o,i)}findSchema(e){if(e==="")return this.findDefaultSchema();let n=this.schemaMap.get(e);return n??this.findDefaultSchema()}findDefaultSchema(){return this.defaultSchemaId===""?null:this.schemaMap.get(this.defaultSchemaId)||null}hasSchemas(){return this.schemaIds.length>0}getSchemas(){return this.schemaIds.map(e=>this.schemaMap.get(e))}equals(e){if(this===e)return!0;if(this.defaultSchemaId!==e.defaultSchemaId||this.schemaIds.length!==e.schemaIds.length)return!1;for(let[n,r]of this.schemaIds.entries()){let o=e.schemaIds[n];if(r!==o)return!1;let i=this.schemaMap.get(r),a=e.schemaMap.get(r);if(i==null||a==null||i.equals(a)===!1)return!1}return!0}toJSON(){return{defaultSchemaId:this.defaultSchemaId,schemas:this.getSchemas().map(e=>e.toJSON())}}static toObject(e){S(e,"defaultSchemaId"),S(e,"schemas");let n=e.defaultSchemaId,r=j(e.schemas,"schemas",a=>mc.toObject(a)),o=r.map(a=>a.schemaId),i=new Map(r.map(a=>[a.schemaId,a]));return new t(n,o,i)}},Cr=Yo;var qt=class t{constructor(e,n){this.name=e;this.displayFunction=n}static{this.PHYSICAL=new t("Physical",(e,n)=>e)}static{this.LOGICAL=new t("Logical",(e,n)=>n)}static{this.BOTH=new t("Both",(e,n)=>`${n} / ${e}`)}static values(){return[t.PHYSICAL,t.LOGICAL,t.BOTH]}displayName(e,n){return this.displayFunction(e,n)}toJSON(){return{styleName:this.name}}static toObject(e){if(!("styleName"in e))return t.BOTH;let n=e.styleName;for(let r of Object.values(t))if(r.name===n)return r;return t.BOTH}equals(e){return this.name===e.name}};var ft=class t{static{this.ALL=new t("all","All Columns",()=>!0)}static{this.ONLY_PK=new t("pk","Only PK Columns",e=>e.primaryKey)}static{this.PK_OR_FK=new t("pk_fk","PK or FK Columns",(e,n)=>e.primaryKey||n)}static{this.NONE=new t("none","No Columns",()=>!1)}constructor(e,n,r){this.key=e,this.name=n,this.viewableFunction=r}static values(){return[t.ALL,t.ONLY_PK,t.PK_OR_FK,t.NONE]}viewable(e,n){return this.viewableFunction(e,n)}toJSON(){return{style:this.key}}static toObject(e){if(!("style"in e))return t.ALL;let n=e.style;for(let r of t.values())if(r.key===n)return r;return t.ALL}equals(e){return this.key===e.key}};var ln=class t{constructor({fileName:e,withTable:n=!0,withIndex:r=!0,withForeignKey:o=!0,withSchema:i=!0,withComment:a=!0,commentStyle:s="logical_name",commentSeparator:l=" : "}){this.fileName=e,this.withTable=n,this.withIndex=r,this.withForeignKey=o,this.withSchema=i,this.withComment=a,this.commentStyle=s,this.commentSeparator=l}equals(e){return!(this.fileName!==e.fileName||this.withTable!==e.withTable||this.withIndex!==e.withIndex||this.withForeignKey!==e.withForeignKey||this.withSchema!==e.withSchema||this.withComment!==e.withComment||this.commentStyle!==e.commentStyle||this.commentSeparator!==e.commentSeparator)}toJSON(){return{fileName:this.fileName,withTable:this.withTable,withIndex:this.withIndex,withForeignKey:this.withForeignKey,withSchema:this.withSchema,withComment:this.withComment,commentStyle:this.commentStyle,commentSeparator:this.commentSeparator}}static toObject(e){S(e,"fileName");let n="withTable"in e?e.withTable:!0,r="withIndex"in e?e.withIndex:!0,o="withForeignKey"in e?e.withForeignKey:!0,i="withSchema"in e?e.withSchema:!0,a="withComment"in e?e.withComment:!0,s="commentStyle"in e?e.commentStyle:"logical_name",l="commentSeparator"in e?e.commentSeparator:" : ";return new t({fileName:e.fileName,withTable:n,withIndex:r,withForeignKey:o,withSchema:i,withComment:a,commentStyle:s,commentSeparator:l})}};var jo=class t{constructor({perspectiveId:e,perspectiveName:n,description:r,containIds:o}){this.perspectiveId=e,this.perspectiveName=n,this.description=r,this.containIds=new Set(o)}static create(e,n=""){return new t({perspectiveId:X(),perspectiveName:e,description:n,containIds:[]})}containsModel(e){return this.containIds.has(e)}getContainIds(){return Array.from(this.containIds)}update(e,n){return new t({perspectiveId:this.perspectiveId,perspectiveName:e,description:n,containIds:this.containIds})}updateContainId(e,n){let r=new Set(this.containIds);return n==="add"?r.add(e):r.delete(e),new t({perspectiveId:this.perspectiveId,perspectiveName:this.perspectiveName,description:this.description,containIds:r})}updateAllContainIds(e){return this.containIds.size===0&&e.length===0?this:this.containIds.size===e.length&&[...e].every(r=>this.containIds.has(r))?this:new t({perspectiveId:this.perspectiveId,perspectiveName:this.perspectiveName,description:this.description,containIds:e})}equals(e){return this.perspectiveId!==e.perspectiveId||this.perspectiveName!==e.perspectiveName||this.description!==e.description||this.containIds.size!==e.containIds.size?!1:[...this.containIds].every(n=>e.containIds.has(n))}toJSON(){let e=Array.from(this.containIds).sort();return{perspectiveId:this.perspectiveId,perspectiveName:this.perspectiveName,...this.description!==""&&{description:this.description},containIds:e}}static toObject(e){return S(e,"perspectiveId"),S(e,"perspectiveName"),new t({perspectiveId:e.perspectiveId,perspectiveName:e.perspectiveName,description:"description"in e?e.description:"",containIds:"containIds"in e?e.containIds:[]})}},pc=jo;var Wo=class t{constructor(e){this.perspectiveIds=e.map(n=>n.perspectiveId),this.perspectiveMap=new Map(e.map(n=>[n.perspectiveId,n]))}findModel(e){return this.perspectiveMap.get(e)||null}getModels(){return this.perspectiveIds.map(e=>this.perspectiveMap.get(e))}updateModel(e){let n=this.perspectiveMap.get(e.perspectiveId);if(n==null){let o=[...this.getModels(),e];return new t(o)}if(n.equals(e)===!0)return this;let r=this.getModels().map(o=>o.perspectiveId!==e.perspectiveId?o:e);return new t(r)}equals(e){return an(this.perspectiveIds,e.perspectiveIds)===!1?!1:Xe(this.perspectiveMap,e.perspectiveMap)}},_r=Wo;var cn=class t{constructor({displayNameStyle:e=qt.BOTH,displayColumnStyle:n=ft.ALL,exportDdlSetting:r,perspectiveModelStorage:o,showRelationNames:i=!1,syncRemoteChanges:a=!1}){this.displayNameStyle=e,this.displayColumnStyle=n,this.exportDdlSetting=r,this.perspectiveModelStorage=o,this.showRelationNames=i,this.syncRemoteChanges=a}static create(e){let n=new ln({fileName:e}),r=new _r([]);return new t({exportDdlSetting:n,perspectiveModelStorage:r})}findPerspectiveModel(e){return this.perspectiveModelStorage.findModel(e)}getPerspectiveModels(){return this.perspectiveModelStorage.getModels()}update({displayNameStyle:e=null,displayColumnStyle:n=null,exportDdlSetting:r=null,perspectiveModels:o=null,showRelationNames:i=null,syncRemoteChanges:a=null}){return e==null&&n==null&&r==null&&o==null&&i==null&&a==null?this:new t({displayNameStyle:e??this.displayNameStyle,displayColumnStyle:n??this.displayColumnStyle,exportDdlSetting:r??this.exportDdlSetting,perspectiveModelStorage:o!=null?new _r(o):this.perspectiveModelStorage,showRelationNames:i??this.showRelationNames,syncRemoteChanges:a??this.syncRemoteChanges})}updatePerspective(e){let n=this.perspectiveModelStorage.updateModel(e);return n===this.perspectiveModelStorage?this:new t({displayNameStyle:this.displayNameStyle,displayColumnStyle:this.displayColumnStyle,exportDdlSetting:this.exportDdlSetting,perspectiveModelStorage:n,showRelationNames:this.showRelationNames,syncRemoteChanges:this.syncRemoteChanges})}toJSON(){let e=this.perspectiveModelStorage.getModels().map(n=>n.toJSON());return{displayStyle:this.displayNameStyle.toJSON(),...this.displayColumnStyle.key!==ft.ALL.key&&{displayColumn:this.displayColumnStyle.toJSON()},exportDdlSetting:this.exportDdlSetting.toJSON(),...e.length>0&&{perspectiveModels:e},...this.showRelationNames&&{showRelationNames:!0},...this.syncRemoteChanges&&{syncRemoteChanges:!0}}}static toObject(e){S(e,"exportDdlSetting");let n="displayStyle"in e?qt.toObject(e.displayStyle):qt.BOTH,r="displayColumn"in e?ft.toObject(e.displayColumn):ft.ALL,o=ln.toObject(e.exportDdlSetting),i="perspectiveModels"in e?j(e.perspectiveModels,"perspectiveModels",l=>pc.toObject(l)):[],a="showRelationNames"in e?e.showRelationNames:!1,s="syncRemoteChanges"in e?e.syncRemoteChanges:!1;return new t({displayNameStyle:n,displayColumnStyle:r,exportDdlSetting:o,perspectiveModelStorage:new _r(i),showRelationNames:a,syncRemoteChanges:s})}equals(e){return!(this.displayNameStyle.equals(e.displayNameStyle)===!1||this.displayColumnStyle.equals(e.displayColumnStyle)===!1||this.exportDdlSetting.equals(e.exportDdlSetting)===!1||this.perspectiveModelStorage.equals(e.perspectiveModelStorage)===!1||this.showRelationNames!==e.showRelationNames||this.syncRemoteChanges!==e.syncRemoteChanges)}};var Gh=/^#[0-9A-Fa-f]{6}$/,re=class t{static{this.WHITE=new t({red:255,green:255,blue:255})}static{this.BLACK=new t({red:0,green:0,blue:0})}constructor({red:e,green:n,blue:r}){this.red=e,this.green=n,this.blue=r}static fromHex(e){if(Gh.test(e)===!1)throw new Error(`Invalid color hex string: ${e}`);let n=parseInt(e.substring(1,3),16),r=parseInt(e.substring(3,5),16),o=parseInt(e.substring(5,7),16);return new t({red:n,green:r,blue:o})}toHex(){let e=this.red.toString(16).padStart(2,"0"),n=this.green.toString(16).padStart(2,"0"),r=this.blue.toString(16).padStart(2,"0");return`#${e}${n}${r}`.toUpperCase()}toRgba(e=1){return`rgba(${this.red}, ${this.green}, ${this.blue}, ${e})`}reverseGrayscale(){let e=255-(this.red+this.green+this.blue)/3;return new t({red:e,green:e,blue:e})}equals(e){return this.red===e.red&&this.green===e.green&&this.blue===e.blue}static toObject(e){return S(e,"red"),S(e,"green"),S(e,"blue"),new t({red:e.red,green:e.green,blue:e.blue})}toJSON(){return{red:this.red,green:this.green,blue:this.blue}}};var Qn=class t{constructor({positionX:e,positionY:n,width:r,height:o}){this.positionX=e,this.positionY=n,this.width=r,this.height=o}static createFromPoints(e,n){let r=Math.min(e.x,n.x),o=Math.min(e.y,n.y),i=Math.max(Math.abs(e.x-n.x),2),a=Math.max(Math.abs(e.y-n.y),2);return new t({positionX:r,positionY:o,width:i,height:a})}static createFromEdges(e){let n=e.left,r=e.top,o=e.right-e.left,i=e.bottom-e.top;return new t({positionX:n,positionY:r,width:o,height:i})}move(e){return new t({positionX:this.positionX+e.x,positionY:this.positionY+e.y,width:this.width,height:this.height})}get left(){return this.positionX}get right(){return this.positionX+this.width}get xCenter(){return this.positionX+this.width/2}get top(){return this.positionY}get bottom(){return this.positionY+this.height}get yCenter(){return this.positionY+this.height/2}get center(){return{x:this.xCenter,y:this.yCenter}}contains(e){return e instanceof t?this.containsArea(e):this.containsPoint(e)}containsArea(e){return!(this.left>e.left||this.right<e.right||this.top>e.top||this.bottom<e.bottom)}containsPoint(e){return!(e.x<this.left||e.x>this.right||e.y<this.top||e.y>this.bottom)}static toObject(e){return S(e,"positionX"),S(e,"positionY"),S(e,"width"),S(e,"height"),new t({positionX:e.positionX,positionY:e.positionY,width:e.width,height:e.height})}toJSON(){return{positionX:this.positionX,positionY:this.positionY,width:this.width,height:this.height}}equals(e){return!(this.positionX!==e.positionX||this.positionY!==e.positionY||this.width!==e.width||this.height!==e.height)}};var hc="center",fc="center",Jo=9,un=class t{constructor({memoId:e,memo:n,rectangleViewModel:r,backgroundColor:o,foregroundColor:i,verticalAlign:a=hc,horizontalAlign:s=fc,fontSize:l=Jo,createdAt:c=null}){this.memoId=e,this.memo=n,this.rectangleViewModel=r,this.backgroundColor=o,this.foregroundColor=i,this.verticalAlign=a,this.horizontalAlign=s,this.fontSize=l>=1?l:1,this.createdAt=c||new Date}static create(e,n,r=Jo){return new t({memoId:X(),memo:"",rectangleViewModel:e,backgroundColor:n.background,foregroundColor:n.foreground,fontSize:r})}updateMemo(e){return this.memo===e?this:new t({...this,memo:e})}updateRectangle(e){return e.equals(this.rectangleViewModel)?this:new t({...this,rectangleViewModel:e})}updateColor(e=null,n=null){let r=e||this.backgroundColor,o=n||this.foregroundColor;return this.backgroundColor.equals(r)&&this.foregroundColor.equals(o)?this:new t({...this,backgroundColor:r,foregroundColor:o})}updateVerticalAlign(e){return this.verticalAlign===e?this:new t({...this,verticalAlign:e})}updateHorizontalAlign(e){return this.horizontalAlign===e?this:new t({...this,horizontalAlign:e})}updateFontSize(e){return this.fontSize===e||e<1?this:new t({...this,fontSize:e})}move(e){let n=this.rectangleViewModel.move(e);return new t({...this,rectangleViewModel:n})}toJSON(){return{memoId:this.memoId,memo:this.memo,rectangleViewModel:this.rectangleViewModel.toJSON(),backgroundColor:this.backgroundColor.toJSON(),foregroundColor:this.foregroundColor.toJSON(),verticalAlign:this.verticalAlign,horizontalAlign:this.horizontalAlign,fontSize:this.fontSize,createdAt:this.createdAt}}static toObject(e){S(e,"memoId"),S(e,"memo"),S(e,"rectangleViewModel");let n="backgroundColor"in e?re.toObject(e.backgroundColor):re.WHITE,r="foregroundColor"in e?re.toObject(e.foregroundColor):re.BLACK,o="verticalAlign"in e?e.verticalAlign:hc,i="horizontalAlign"in e?e.horizontalAlign:fc,a="fontSize"in e?e.fontSize:Jo,s="createdAt"in e?Ve(e.createdAt):new Date;return new t({memoId:e.memoId,memo:e.memo,rectangleViewModel:Qn.toObject(e.rectangleViewModel),backgroundColor:n,foregroundColor:r,verticalAlign:o,horizontalAlign:i,fontSize:a,createdAt:s})}equals(e){return!(this.memoId!==e.memoId||this.memo!==e.memo||this.rectangleViewModel.equals(e.rectangleViewModel)===!1||this.backgroundColor.equals(e.backgroundColor)===!1||this.foregroundColor.equals(e.foregroundColor)===!1||this.verticalAlign!==e.verticalAlign||this.horizontalAlign!==e.horizontalAlign||this.fontSize!==e.fontSize||this.createdAt.getTime()!==e.createdAt.getTime())}};var Bn=class t{constructor(e,n,r){this.memoIdMap=new Map(e),this.foregroundIds=n,this.backgroundIds=r}static create(e,n){return new t(new Map(e.concat(n).map(r=>[r.memoId,r])),e.map(r=>r.memoId),n.map(r=>r.memoId))}find(e){return this.memoIdMap.get(e)||null}getMemos(){let e=this.foregroundIds.map(r=>this.memoIdMap.get(r)).filter(r=>r!=null),n=this.backgroundIds.map(r=>this.memoIdMap.get(r)).filter(r=>r!=null);return{frontMemos:e,backMemos:n}}addMemo(e,n="front"){let r=new Map(this.memoIdMap);r.set(e.memoId,e);let o=n==="front"?[...this.foregroundIds,e.memoId]:this.foregroundIds,i=n==="back"?[e.memoId,...this.backgroundIds]:this.backgroundIds;return new t(r,o,i)}updateMemo(e){let n=new Map(this.memoIdMap);return n.set(e.memoId,e),new t(n,this.foregroundIds,this.backgroundIds)}deleteMemo(e){let n=new Map(this.memoIdMap);if(n.delete(e)===!1)return this;let o=this.foregroundIds.indexOf(e),i=o<0?this.backgroundIds.indexOf(e):-1,a=o>=0?Nr(this.foregroundIds,o):this.foregroundIds,s=i>=0?Nr(this.backgroundIds,i):this.backgroundIds;return new t(n,a,s)}moveMemo(e,n){let r=new Map(this.memoIdMap);return e.forEach(o=>{let i=r.get(o);i!=null&&r.set(o,i.move(n))}),new t(r,this.foregroundIds,this.backgroundIds)}arrangeMemo(e,n){if(this.memoIdMap.get(e)==null)return this;let o=this.foregroundIds.indexOf(e);if(n==="front"&&this.foregroundIds.length>0&&o===this.foregroundIds.length-1)return this;let i=o<0?this.backgroundIds.indexOf(e):-1;if(n==="back"&&this.backgroundIds.length>0&&i===0)return this;let a=o>=0?Nr(this.foregroundIds,o):this.foregroundIds,s=i>=0?Nr(this.backgroundIds,i):this.backgroundIds;return new t(this.memoIdMap,n==="front"?[...a,e]:a,n==="back"?[e,...s]:s)}equals(e){return Xe(this.memoIdMap,e.memoIdMap)===!1||an(this.foregroundIds,e.foregroundIds)===!1?!1:an(this.backgroundIds,e.backgroundIds)}reuseInstancesFrom(e){let n=Vt(e.memoIdMap,this.memoIdMap),r=Fo(e.foregroundIds,this.foregroundIds),o=Fo(e.backgroundIds,this.backgroundIds);return(n===e.memoIdMap&&r===e.foregroundIds&&o===e.backgroundIds)===!0?e:new t(new Map(n),r,o)}},Nr=(t,e)=>t.length===0||e<0||e>=t.length?t:t.slice(0,e).concat(t.slice(e+1));var Yh={segment:-1,fraction:0,offsetX:0,offsetY:0},jh={bold:!1,italic:!1,strikethrough:!1,fontSize:10},et=class t{constructor({label:e,position:n=Yh,color:r=re.BLACK,style:o=jh}){this.label=e,this.position=n,this.color=r,this.style=o}updateLabelPosition(e){return gc(this.position,e)?this:new t({...this,position:e})}updateLabelStyle(e){return yc(this.style,e)?this:new t({...this,style:e})}updateColor(e){return this.color.equals(e)?this:new t({...this,color:e})}equals(e){return!(this.label!==e.label||gc(this.position,e.position)===!1||this.color.equals(e.color)===!1||yc(this.style,e.style)===!1)}toJSON(){return{label:this.label,position:this.position,color:this.color.toJSON(),style:this.style}}static toObject(e){return S(e,"label"),S(e,"position"),S(e,"color"),S(e,"style"),new t({label:e.label,position:e.position,color:re.toObject(e.color),style:e.style})}},gc=(t,e)=>t.segment===e.segment&&t.fraction===e.fraction&&t.offsetX===e.offsetX&&t.offsetY===e.offsetY,yc=(t,e)=>t.bold===e.bold&&t.italic===e.italic&&t.strikethrough===e.strikethrough&&t.fontSize===e.fontSize;var gt=class t{constructor({strokeWidth:e=1,edges:n=[],orthogonalLines:r=[],color:o=re.BLACK}){this.strokeWidth=e>0?e:1,this.edges=[...n],this.orthogonalLines=[...r],this.color=o}get lineType(){return this.orthogonalLines.length>0?"orthogonal":"straight"}updateEdge(e){if(e.edgeType==="virtual"){let r=[...this.edges];return r.splice(e.edgeId,0,e.point),new t({...this,edges:r,orthogonalLines:[]})}if(e.edgeId<0||e.edgeId>=this.edges.length)return this;let n=[...this.edges];return n[e.edgeId]=e.point,new t({...this,edges:n,orthogonalLines:[]})}updateOrthogonalLines(e){return new t({...this,orthogonalLines:[...e],edges:[]})}updateStrokeWidth(e){return this.strokeWidth===e||e<=0?this:new t({...this,strokeWidth:e})}updateColor(e){return this.color.equals(e)?this:new t({...this,color:e})}deleteEdge(e){if(e<0||e>=this.edges.length)return this;let n=[...this.edges];return n.splice(e,1),new t({...this,edges:n})}equals(e){return this===e?!0:this.strokeWidth!==e.strokeWidth||this.edges.length!==e.edges.length||this.color.equals(e.color)===!1||this.edges.every((r,o)=>{let i=e.edges[o];return r.x===i.x&&r.y===i.y})===!1||this.orthogonalLines.length!==e.orthogonalLines.length?!1:this.orthogonalLines.every((r,o)=>{let i=e.orthogonalLines[o];return r.direction===i.direction&&r.position===i.position})}toJSON(){return{strokeWidth:this.strokeWidth,edges:this.edges,orthogonalLines:this.orthogonalLines,color:this.color.toJSON()}}static toObject(e){S(e,"strokeWidth");let n="edges"in e?e.edges:[],r="orthogonalLines"in e?e.orthogonalLines:[],o="color"in e?re.toObject(e.color):re.BLACK;return new t({strokeWidth:e.strokeWidth,edges:n,orthogonalLines:r,color:o})}};var Ne=class t{constructor({relationModel:e,lineViewModel:n,labelViewModel:r=null,createdAt:o=null}){this.relationModel=e,this.lineViewModel=n,this.labelViewModel=r??new et({label:e.relationName}),this.createdAt=o||new Date}get relationId(){return this.relationModel.relationModelId}get parentTableModelId(){return this.relationModel.parentTableModelId}get childTableModelId(){return this.relationModel.childTableModelId}updateRelationModel(e){let n=e.relationName===this.labelViewModel.label?this.labelViewModel:new et({...this.labelViewModel,label:e.relationName});return new t({relationModel:e,lineViewModel:this.lineViewModel,labelViewModel:n,createdAt:this.createdAt})}toJSON(){return{relationModel:this.relationModel.toJSON(),lineViewModel:this.lineViewModel.toJSON(),...this.labelViewModel.label!=""&&{labelViewModel:this.labelViewModel.toJSON()},createdAt:this.createdAt}}static toObject(e){S(e,"relationModel"),S(e,"lineViewModel");let n="labelViewModel"in e?et.toObject(e.labelViewModel):null,r="createdAt"in e?Ve(e.createdAt):new Date;return new t({relationModel:qe.toObject(e.relationModel),lineViewModel:gt.toObject(e.lineViewModel),labelViewModel:n,createdAt:r})}equals(e){return this.relationModel.equals(e.relationModel)&&this.lineViewModel.equals(e.lineViewModel)&&this.labelViewModel.equals(e.labelViewModel)}};var dn=class t{constructor(e){this.relationIdMap=new Map(e.map(n=>[n.relationId,n])),this.parentTableModelIdMap=t.toTableIdMapping(e,n=>n.parentTableModelId),this.childTableModelIdMap=t.toTableIdMapping(e,n=>n.childTableModelId),this.childColumnModelIdMap=new Map(e.filter(n=>n.relationModel.relationPairs.length>0).flatMap(n=>n.relationModel.relationPairs.map(r=>[`${n.relationModel.childTableModelId}:${r.childColumnModelId}`,{tableModelId:n.relationModel.parentTableModelId,columnModelId:r.parentColumnModelId}])))}static toTableIdMapping(e,n){let r=new Map;return e.forEach(o=>{let i=n(o.relationModel),a=r.get(i);a!=null?a.push(o):r.set(i,[o])}),r}getModels(){return Array.from(this.relationIdMap.values()).sort((e,n)=>e.relationId.localeCompare(n.relationId,"en"))}findByRelationId(e){let n=this.relationIdMap.get(e);return n??null}fetchRelationsByParent(e){let n=this.parentTableModelIdMap.get(e);return n||[]}fetchRelationsByChild(e){let n=this.childTableModelIdMap.get(e);return n||[]}fetchRelationsByTableIds(e){let n=e.flatMap(i=>this.parentTableModelIdMap.get(i)||[]).map(i=>i.relationId),r=e.flatMap(i=>this.childTableModelIdMap.get(i)||[]).map(i=>i.relationId),o=new Set([...n,...r]);return o.size===0?[]:[...o].flatMap(i=>this.relationIdMap.get(i)||[])}inChildRelation(e,n){return this.childColumnModelIdMap.has(`${e}:${n}`)}findParentRelation(e,n){return this.childColumnModelIdMap.get(`${e}:${n}`)??null}updateRelationView(e){return this.update([e])}updateRelationModel(e){if(e.length===0)return this;let n=e.map(r=>{let o=this.relationIdMap.get(r.relationModelId);return o!=null?o.updateRelationModel(r):new Ne({relationModel:r,lineViewModel:new gt({})})});return this.update(n)}deleteRelation(e){if(e.length===0)return this;let n=new Map(this.relationIdMap);return e.forEach(r=>n.delete(r)),n.size===this.relationIdMap.size?this:new t(Array.from(n.values()))}deleteFromTableId(e){if(e.length===0)return this;let n=new Map(this.relationIdMap);for(let r of e)(this.childTableModelIdMap.get(r)||[]).forEach(i=>{n.delete(i.relationId)});return n.size===this.relationIdMap.size?this:new t(Array.from(n.values()))}updateLineView(e,n){let r=this.relationIdMap.get(e);if(r==null)return this;if(r.lineViewModel.equals(n))return this;let o=new Ne({...r,lineViewModel:n});return this.update([o])}updateLabelView(e,n){let r=this.relationIdMap.get(e);if(r==null)return this;if(r.labelViewModel.equals(n))return this;let o=new Ne({...r,labelViewModel:n});return this.update([o])}updateRelationOrthogonal(e){if(e.length===0)return this;let n=e.map(({relationId:r,orthogonalLines:o,changedIndex:i})=>{let a=this.findByRelationId(r);if(a==null)return null;let s=a.lineViewModel,l=s.updateOrthogonalLines(o);if(s.equals(l))return null;let c=a.labelViewModel,m=c.position.segment;if(i<0||m<i)return new Ne({...a,lineViewModel:l});let d=l.orthogonalLines.length-s.orthogonalLines.length,h=i===0&&m===0?0:Math.min(Math.max(0,m+d),l.orthogonalLines.length-1),g=new et({...c,position:{...c.position,segment:h}});return new Ne({...a,lineViewModel:l,labelViewModel:g})}).filter(r=>r!=null);return this.update(n)}update(e){if(e.length===0)return this;let n=new Map(this.relationIdMap);return e.forEach(r=>n.set(r.relationId,r)),new t(Array.from(n.values()))}moveRelation(e,n){if(this.relationIdMap.size===0)return this;if(e.size<=1)return this;if(n.x===0&&n.y===0)return this;let r=!1,o=[...this.relationIdMap.values()].map(i=>{let a=i.relationModel;if(e.has(a.parentTableModelId)==!1||e.has(a.childTableModelId)==!1||i.lineViewModel.edges.length===0)return i;r=!0;let s=i.lineViewModel.edges.map(c=>({x:c.x+n.x,y:c.y+n.y})),l=new gt({...i.lineViewModel,edges:s});return new Ne({...i,lineViewModel:l})});return r===!1?this:new t(o)}equals(e){return Xe(this.relationIdMap,e.relationIdMap)}reuseInstancesFrom(e){let n=Vt(e.relationIdMap,this.relationIdMap);return n===e.relationIdMap?e:new t(Array.from(n.values()))}};var be=class t{constructor({tableModel:e,corner:n,headerColor:r,createdAt:o=null}){this.tableModel=e,this.corner={...n},this.headerColor={...r},this.createdAt=o||new Date}get tableId(){return this.tableModel.tableModelId}toJSON(){return{tableModel:this.tableModel.toJSON(),top:this.corner.top,left:this.corner.left,headerBackgroundColor:this.headerColor.background.toJSON(),headerForegroundColor:this.headerColor.foreground.toJSON(),createdAt:this.createdAt}}static toObject(e){return S(e,"tableModel"),S(e,"top"),S(e,"left"),S(e,"headerBackgroundColor"),S(e,"headerForegroundColor"),new t({tableModel:Ze.toObject(e.tableModel),corner:{top:e.top,left:e.left},headerColor:{background:re.toObject(e.headerBackgroundColor),foreground:re.toObject(e.headerForegroundColor)},createdAt:"createdAt"in e?Ve(e.createdAt):new Date})}equals(e){return!(this.tableModel.equals(e.tableModel)===!1||this.corner.top!==e.corner.top||this.corner.left!==e.corner.left||this.headerColor.background.equals(e.headerColor.background)===!1||this.headerColor.foreground.equals(e.headerColor.foreground)===!1||this.createdAt.getTime()!==e.createdAt.getTime())}};var mn=class t{constructor(e,n,r,o,i,a,s,l,c,m,d,h=null){this.documentName=e,this.erdSettingModel=n,this.databaseSettingModel=r,this.schemaConfig=o,this.tableViewModelIds=i,this.tableViewModelMap=a,this.columnGroupModelMap=s,this.columnModelMap=l,this.columnShareStorage=c,this.relationViewModelStorage=m,this.memoViewModelStorage=d,this.lastUpdatedAt=h||new Date}static create({documentName:e,databaseSettingModel:n,erdSettingModel:r=cn.create(e),schemaConfig:o=Cr.create(),tableViewModels:i=[],columnGroupModels:a=[],structShareModels:s=[],columnModels:l=[],columnShareModels:c=[],relationViewModels:m=[],foregroundMemoViewModels:d=[],backgroundMemoViewModels:h=[],lastUpdatedAt:g=null}){return new t(e,r,n,o,i.map(b=>b.tableId),new Map(i.map(b=>[b.tableId,b])),new Map(a.map(b=>[b.columnGroupId,b])),new Map(l.map(b=>[b.columnModelId,b])),Un.create(c,s),new dn(m),Bn.create(d,h),g)}doUpdate(e){let n=e.columnModelMap!=null||e.columnGroupModelMap!=null||e.columnShareModelStorage!=null,r=e.tableViewModelMap??this.tableViewModelMap,o=e.columnGroupModelMap??this.columnGroupModelMap,i=e.columnModelMap??this.columnModelMap,a=e.columnShareModelStorage??this.columnShareStorage,s=n?this.doCollectReachableModelIds(r,o,i,a):null,l=s==null?i:this.doRetainColumnModels(i,s.columnModelIds),c=s==null?a:a.retain(s.columnShareModelIds,s.structShareModelIds,new Set(l.keys()),new Set(o.keys()));return new t(e.documentName??this.documentName,e.erdSettingModel??this.erdSettingModel,e.databaseSettingModel??this.databaseSettingModel,e.schemaConfig??this.schemaConfig,e.tableViewModelIds??this.tableViewModelIds,e.tableViewModelMap??this.tableViewModelMap,o,l,c,e.relationViewModelStorage??this.relationViewModelStorage,e.memoViewModelStorage??this.memoViewModelStorage,e.lastUpdatedAt??null)}doCollectReachableModelIds(e,n,r,o){let i=Array.from(e.values()).flatMap(d=>bc(d.tableModel.columnEntries)),a=Array.from(n.values()).flatMap(d=>d.columnModelIds),s=new Set,l=new Set,c=new Set,m=[...i,...a];for(;m.length>0;){let d=m.pop();if(d==null||s.has(d))continue;s.add(d);let h=r.get(d);if(h==null)continue;if(ce.isSimpleColumn(h)){l.add(h.columnShareModelId);continue}let g=h.structShareModelId;if(c.has(g))continue;c.add(g);let b=o.findStructShare(g);b!=null&&m.push(...bc(b.columnEntries))}return{columnModelIds:s,columnShareModelIds:l,structShareModelIds:c}}doRetainColumnModels(e,n){let r=Array.from(e.keys()).filter(i=>n.has(i)===!1);if(r.length===0)return e;let o=new Map(e);return r.forEach(i=>o.delete(i)),o}getDatabase(){return this.databaseSettingModel.getDatabase()}getDisplayNameStyle(){return this.erdSettingModel.displayNameStyle}getDisplayColumnStyle(){return this.erdSettingModel.displayColumnStyle}findSchema(e){return this.getDatabase().supportsSchema===!1?null:this.schemaConfig.findSchema(e)}findDefaultSchema(){return this.getDatabase().supportsSchema===!1?null:this.schemaConfig.findDefaultSchema()}findTableViewModel(e){let n=this.tableViewModelMap.get(e);return n||null}getTableViewModels(){return this.tableViewModelIds.map(e=>this.tableViewModelMap.get(e))}findColumnGroupModel(e){let n=this.columnGroupModelMap.get(e);return n||null}getColumnGroupModels(){return Array.from(this.columnGroupModelMap.values()).sort((n,r)=>{let o=n.groupName.localeCompare(r.groupName,"en");return o!==0?o:n.columnGroupId.localeCompare(r.columnGroupId,"en")})}findStructColumnShareModel(e){return this.columnShareStorage.findStructShare(e)}getStructColumnShareModels(){return this.columnShareStorage.getStructShareModels()}findColumnModel(e){let n=this.columnModelMap.get(e);return n||null}toAllColumnsWithStruct(e){return e.columnEntries.flatMap(n=>{if(n.modelType==="single")return[n.columnModelId];let r=this.findColumnGroupModel(n.columnGroupId);return r==null?[]:r.columnModelIds}).map(n=>this.findColumnModel(n)).filter(n=>n!=null)}toAllColumnsExceptStruct(e){return this.toAllColumnsWithStruct(e).filter(ce.isSimpleColumn)}findColumnShareModel(e){return this.columnShareStorage.findColumnShare(e)}fetchReferencedColumnModelsForShareModel(e){return Array.from(this.columnModelMap.values()).filter(ce.isSimpleColumn).filter(n=>n.columnShareModelId===e).sort((n,r)=>{let o=n.physicalName.localeCompare(r.physicalName,"en");return o!==0?o:n.columnModelId.localeCompare(r.columnModelId,"en")})}getColumnShareModelStorage(){return this.columnShareStorage.copy()}findRelationViewModel(e){return this.relationViewModelStorage.findByRelationId(e)}fetchRelationsByTableIds(e){return e.length===0?[]:this.relationViewModelStorage.fetchRelationsByTableIds(e)}getRelationViewModels(){return this.relationViewModelStorage.getModels()}inChildRelation(e,n){return this.relationViewModelStorage.inChildRelation(e,n)}findParentRelation(e,n){return this.relationViewModelStorage.findParentRelation(e,n)}findRelatedRelations(e){let n=this.relationViewModelStorage.fetchRelationsByParent(e),r=this.relationViewModelStorage.fetchRelationsByChild(e);return{parentRelations:n,childRelations:r}}findMemoViewModel(e){return this.memoViewModelStorage.find(e)}getMemoViewModels(){return this.memoViewModelStorage.getMemos()}updateSchema(e){return this.schemaConfig.equals(e)?this:this.doUpdate({schemaConfig:e})}updateTableMeta(...e){let n=new Map(this.tableViewModelMap);return e.forEach(r=>{n.set(r.tableId,r)}),this.doUpdate({tableViewModelMap:n})}updateTableViewWithColumns(e,n,r=null){let o=r||this.columnShareStorage,i=this.tableViewModelMap.get(e.tableId);if(i==null)return this.doAddTableViewModel(e,n,o);let{nextTableViewModels:a,nextColumnModelMap:s,nextRelationViewModelStorage:l}=this.doUpdateTableViewModelWithRelation(i,e,n,o),c=new Map(this.tableViewModelMap);a.forEach(d=>{c.set(d.tableId,d)});let m=new Map(this.columnModelMap);return s.forEach(d=>m.set(d.columnModelId,d)),this.doUpdate({tableViewModelMap:c,columnModelMap:m,columnShareModelStorage:o.copy(),relationViewModelStorage:l})}doAddTableViewModel(e,n,r){let o=[...this.tableViewModelIds,e.tableId],i=new Map(this.tableViewModelMap);i.set(e.tableId,e);let a=new Map(this.columnModelMap);return n.forEach(l=>a.set(l.columnModelId,l)),this.doUpdateTableCheckExpression(e,a,r).forEach(l=>i.set(l.tableId,l)),this.doUpdate({tableViewModelIds:o,tableViewModelMap:i,columnModelMap:a,columnShareModelStorage:r.copy()})}doUpdateTableCheckExpression(e,n,r){if(r.equals(this.columnShareStorage)===!0)return[];let o=e.tableModel.columnEntries.map(s=>{if(s.modelType!=="single")return null;let l=n.get(s.columnModelId);if(l==null||ce.isSimpleColumn(l)===!1)return null;let c=this.columnShareStorage.findColumnShare(l.columnShareModelId),m=r.findColumnShare(l.columnShareModelId);return c==null||m==null||c.physicalName===m.physicalName?null:{previousColumnShare:c,nextColumnShare:m}}).filter(s=>s!==null);if(o.length===0)return[];let i=new Map(o.map(s=>[s.nextColumnShare.columnShareModelId,s]));return Array.from(this.tableViewModelMap.entries()).map(([s,l])=>{let c=l.tableModel;if(c.checkExpression==""||s===e.tableId)return null;let m=this.toAllColumnsExceptStruct(c).map(h=>{let g=i.get(h.columnShareModelId);if(g==null)return null;let b=mt(h,g.previousColumnShare),y=mt(h,g.nextColumnShare);return b.physicalName===y.physicalName?null:{previousName:b,nextName:y}}).filter(h=>h!==null),d=c.updateCheckExpression(m);return d===c?null:(console.debug(`Update checkExpression. tableId: ${s}, tableName: ${c.physicalName}, before: ${c.checkExpression}, after: ${d.checkExpression}`),new be({...l,tableModel:d}))}).filter(s=>s!==null)}doUpdateTableViewModelWithRelation(e,n,r,o){let i=new Map(r.map(M=>[M.columnModelId,M])),a=this.relationViewModelStorage.fetchRelationsByParent(n.tableId),s=new Map(this.columnModelMap);r.forEach(M=>s.set(M.columnModelId,M));let l=this.doUpdateTableCheckExpression(n,s,o),c=[n,...l];if(a.length===0)return{nextTableViewModels:c,nextColumnModelMap:i,nextRelationViewModelStorage:this.relationViewModelStorage};let m=n.tableModel.columnEntries.flatMap(M=>{if(M.modelType==="single"){let v=i.get(M.columnModelId);return v!=null?[v]:[]}let R=this.columnGroupModelMap.get(M.columnGroupId);return R==null?[]:R.columnModelIds.map(v=>this.findColumnModel(v)).filter(v=>v!=null)}).filter(ce.isSimpleColumn).filter(M=>M.primaryKey===!0),d=this.toAllColumnsExceptStruct(e.tableModel),h=d.filter(M=>M.primaryKey===!0&&m.some(R=>R.columnModelId===M.columnModelId)===!1).map(M=>M.columnModelId),g=d.filter(M=>M.primaryKey===!0).map(M=>M.columnModelId),b=m.filter(M=>g.includes(M.columnModelId)===!1);if(h.length===0&&b.length===0)return{nextTableViewModels:c,nextColumnModelMap:i,nextRelationViewModelStorage:this.relationViewModelStorage};let y=new Map(c.map(M=>[M.tableId,M])),N=this.doUpdateRelationWithPrimaryKeyChanged(a,y,i,b,h);return{...N,nextTableViewModels:Array.from(N.nextTableViewMap.values())}}doUpdateRelationWithPrimaryKeyChanged(e,n,r,o,i,a=null){let s=new Map(n),l=new Map(r),c=new Map,m=new Set;if(i.length>0)for(let d of e){let h=d.relationModel,g=h.relationPairs.filter(y=>i.includes(y.parentColumnModelId)===!1);if(h.relationPairs.length===g.length)continue;g.length===0&&m.add(d.relationId);let b=new qe({...d.relationModel,relationPairs:g});c.set(b.relationModelId,b)}if(o.length>0)for(let d of e){let h=c.get(d.relationId)||d.relationModel,g=s.get(h.childTableModelId)||this.tableViewModelMap.get(h.childTableModelId);if(g==null)continue;if(a===null?!1:g.tableModel.columnEntries.some(H=>H.modelType==="group"&&H.columnGroupId===a.columnGroupId)){let H=[...h.relationPairs,...o.map(ci=>new dt({parentColumnModelId:ci.columnModelId,childColumnModelId:ci.columnModelId}))],Ge=new qe({...h,relationPairs:H});c.set(Ge.relationModelId,Ge),m.delete(Ge.relationModelId);continue}let y=Sc(h.childCardinality),N=o.map(H=>{let Ge=new ut({columnModelId:X(),columnShareModelId:H.columnShareModelId,physicalName:H.physicalName,logicalName:H.logicalName,notNull:y});return{columnModel:Ge,relationPair:new dt({parentColumnModelId:H.columnModelId,childColumnModelId:Ge.columnModelId})}}),M=N.map(H=>H.columnModel),R=N.map(H=>H.relationPair);M.forEach(H=>{l.set(H.columnModelId,H)});let v=g.tableModel,z=new be({...g,tableModel:new Ze({...v,columnEntries:[...v.columnEntries,...M.map(H=>({modelType:"single",columnModelId:H.columnModelId}))]})});s.set(z.tableId,z);let me=[...h.relationPairs,...R],pe=new qe({...h,relationPairs:me});c.set(pe.relationModelId,pe),m.delete(pe.relationModelId)}return m.forEach(d=>c.delete(d)),{nextTableViewMap:s,nextColumnModelMap:l,nextRelationViewModelStorage:this.relationViewModelStorage.updateRelationModel(Array.from(c.values())).deleteRelation(Array.from(m))}}deleteTable(e){if(this.tableViewModelMap.get(e)==null)return this;let r=this.tableViewModelIds.filter(i=>i!==e),o=new Map(this.tableViewModelMap);return o.delete(e),this.doUpdate({tableViewModelIds:r,tableViewModelMap:o,columnModelMap:this.columnModelMap,relationViewModelStorage:this.relationViewModelStorage.deleteFromTableId([e])})}updateColumnGroup(e,n,r){let o=this.columnGroupModelMap.get(e.columnGroupId)||null,i=new Map(this.columnGroupModelMap);i.set(e.columnGroupId,e);let a=new Map(this.columnModelMap);n.forEach(m=>{a.set(m.columnModelId,m)});let{nextTableViewMap:s,nextColumnModelMap:l,nextRelationViewModelStorage:c}=this.doUpdateTableViewModelsWithUpdatingColumnGroup(o,e,n,a,r);return this.doUpdate({tableViewModelMap:s.size>0?new Map([...this.tableViewModelMap,...s]):this.tableViewModelMap,columnGroupModelMap:i,columnModelMap:l,columnShareModelStorage:r.copy(),relationViewModelStorage:c})}doUpdateTableViewModelsWithUpdatingColumnGroup(e,n,r,o,i){let a=Array.from(this.tableViewModelMap.values()).filter(M=>M.tableModel.columnEntries.some(R=>R.modelType==="group"&&R.columnGroupId===n.columnGroupId)),s=new Map;if(a.length===0)return{nextTableViewMap:s,nextColumnModelMap:o,nextRelationViewModelStorage:this.relationViewModelStorage};let l=r.filter(ce.isSimpleColumn).map(M=>{let R=this.columnModelMap.get(M.columnModelId);if(R==null||ce.isSimpleColumn(R)===!1)return null;let v=this.columnShareStorage.findColumnShare(R.columnShareModelId);if(v==null)return null;let z=i.findColumnShare(M.columnShareModelId);if(z==null)return null;let me=mt(R,v),pe=mt(M,z);return me.physicalName===pe.physicalName?null:{previousName:me,nextName:pe}}).filter(M=>M!==null),c=new Set,m=a.map(M=>{let R=M.tableModel,v=R.updateCheckExpression(l);if(v===R)return M;c.add(M.tableId),console.debug(`Update checkExpression. tableId: ${M.tableId}, tableName: ${R.physicalName}, before: ${R.checkExpression}, after: ${v.checkExpression}`);let z=new be({...M,tableModel:v});return s.set(z.tableId,z),z}),d=new Set(e==null?[]:e.columnModelIds.filter(M=>n.columnModelIds.includes(M)===!1));if(d.size>0)for(let M of m){let R=M.tableModel,v=ht.filterColumns(R.uniqueKeysModels,pe=>d.has(pe.columnModelId)===!1),z=pt.filterColumns(R.tableIndexModels,pe=>d.has(pe.columnModelId)===!1);if(c.has(M.tableId)===!1&&v.hasChanged===!1&&z.hasChanged===!1)continue;let me=new be({...M,tableModel:new Ze({...R,uniqueKeysModels:v.tableUniqueKeysModels,tableIndexModels:z.tableIndexModels})});s.set(me.tableId,me)}let h=e==null?[]:e.columnModelIds.map(M=>this.columnModelMap.get(M)).filter(M=>M!=null&&ce.isSimpleColumn(M)&&M.primaryKey===!0).map(M=>M.columnModelId),g=n.columnModelIds.map(M=>o.get(M)).filter(M=>M!=null&&ce.isSimpleColumn(M)&&M.primaryKey===!0),b=h.filter(M=>g.every(R=>R.columnModelId!==M)),y=g.filter(M=>h.includes(M.columnModelId)===!1),N=a.flatMap(M=>this.relationViewModelStorage.fetchRelationsByParent(M.tableId));return this.doUpdateRelationWithPrimaryKeyChanged(N,s,o,y,b,n)}deleteColumnGroup(e){let n=this.columnGroupModelMap.get(e);if(n==null)return this;let r=new Map(this.columnGroupModelMap);r.delete(e);let{nextTableViewModelMap:o,nextRelationViewModelStorage:i}=this.doUpdateTableViewModelsWithDeletingColumnGroup(n);return this.doUpdate({tableViewModelMap:o,columnGroupModelMap:r,columnModelMap:this.columnModelMap,relationViewModelStorage:i})}doUpdateTableViewModelsWithDeletingColumnGroup(e){let r=e.columnModelIds.map(g=>this.columnModelMap.get(g)).filter(g=>g!=null&&ce.isSimpleColumn(g)).filter(g=>g.primaryKey===!0).map(g=>g.columnModelId),o=new Map(this.tableViewModelMap),i=[],a=[],s=new Set,l=!1;for(let[g,b]of this.tableViewModelMap.entries()){let y=b.tableModel.columnEntries.filter(z=>z.modelType!=="group"||z.columnGroupId!==e.columnGroupId);if(b.tableModel.columnEntries.length===y.length)continue;if(l=!0,y.length===0){o.delete(g),a.push(g);continue}i.push(b.tableModel);let N=z=>e.columnModelIds.includes(z)===!1,M=ht.filterColumns(b.tableModel.uniqueKeysModels,z=>N(z.columnModelId)),R=pt.filterColumns(b.tableModel.tableIndexModels,z=>N(z.columnModelId)),v=new be({...b,tableModel:new Ze({...b.tableModel,columnEntries:y,uniqueKeysModels:M.tableUniqueKeysModels,tableIndexModels:R.tableIndexModels})});o.set(g,v)}let c=r.length===0?new Map:new Map(i.flatMap(g=>this.relationViewModelStorage.fetchRelationsByParent(g.tableModelId).map(b=>{let y=b.relationModel.relationPairs.filter(N=>r.includes(N.parentColumnModelId)===!1);return y.length===0?(s.add(b.relationId),null):new qe({...b.relationModel,relationPairs:y})}).filter(b=>b!=null)).map(g=>[g.relationModelId,g])),m=new Set(e.columnModelIds);i.flatMap(g=>this.relationViewModelStorage.fetchRelationsByChild(g.tableModelId)).filter(g=>s.has(g.relationId)===!1).map(g=>c.get(g.relationId)??g.relationModel).filter(g=>g.relationPairs.some(b=>m.has(b.childColumnModelId))).map(g=>g.relationModelId).forEach(g=>s.add(g));let h=this.relationViewModelStorage.updateRelationModel(Array.from(c.values())).deleteFromTableId(a).deleteRelation(Array.from(s));return{nextTableViewModelMap:l?o:this.tableViewModelMap,nextRelationViewModelStorage:h}}updateStructColumnShare(e,n=[]){let r=this.columnShareStorage.addStructShare(...e);if(n.length===0)return this.doUpdate({columnShareModelStorage:r});let o=new Map(this.columnModelMap);return n.forEach(i=>o.set(i.columnModelId,i)),this.doUpdate({columnModelMap:o,columnShareModelStorage:r})}deleteStructColumnShare(e){if(this.columnShareStorage.findStructShare(e)==null)return this;let r=new Set(Array.from(this.columnModelMap.values()).filter(d=>d.entityType==="struct"&&d.structShareModelId===e).map(d=>d.columnModelId)),o=[...this.tableViewModelIds],i=new Map(this.tableViewModelMap),a=[];for(let[d,h]of this.tableViewModelMap.entries()){let g=h.tableModel.columnEntries.filter(y=>y.modelType!=="single"||r.has(y.columnModelId)===!1);if(g.length===h.tableModel.columnEntries.length)continue;if(g.length===0){i.delete(d),a.push(d);continue}let b=new be({...h,tableModel:new Ze({...h.tableModel,columnEntries:g})});i.set(d,b)}let s=a.length>0?this.relationViewModelStorage.deleteFromTableId(a):this.relationViewModelStorage,l=a.length>0?o.filter(d=>a.includes(d)===!1):o,c=new Map(this.columnGroupModelMap);for(let[d,h]of this.columnGroupModelMap.entries()){let g=h.columnModelIds.filter(b=>r.has(b)===!1);g.length!==h.columnModelIds.length&&c.set(d,new sn({...h,columnModelIds:g}))}let m=this.columnShareStorage.getStructShareModels().filter(d=>d.structShareModelId!==e).reduce((d,h)=>{let g=h.columnEntries.filter(b=>b.modelType!=="single"||r.has(b.columnModelId)===!1);return g.length===h.columnEntries.length?d:d.addStructShare(new ct({...h,columnEntries:g}))},this.columnShareStorage).deleteStructShare([e]);return this.doUpdate({tableViewModelIds:l,tableViewModelMap:i,columnGroupModelMap:c,columnModelMap:this.columnModelMap,columnShareModelStorage:m,relationViewModelStorage:s})}updateColumnModels(e,n){if(e.length===0&&n.length===0)return this;let r=this.columnShareStorage.addColumnShare(...n);if(e.length===0)return this.doUpdate({columnShareModelStorage:r});let o=new Map(this.columnModelMap);return e.forEach(i=>{o.set(i.columnModelId,i)}),this.doUpdate({columnModelMap:o,columnShareModelStorage:r})}updateRelation(e){let n=e.relationModel,r=this.tableViewModelMap.get(n.childTableModelId);if(r==null)return this;let o=r.tableModel,a=n.relationPairs.map(c=>({parentColumnModelId:c.parentColumnModelId,childColumnModelId:c.childColumnModelId,childColumnModel:this.findColumnModel(c.childColumnModelId)})).filter(c=>c.childColumnModel==null).map(c=>{let m=this.findColumnModel(c.parentColumnModelId);return new ut({columnModelId:c.childColumnModelId,columnShareModelId:m.columnShareModelId,physicalName:m.physicalName,logicalName:m.logicalName,notNull:Sc(n.childCardinality)})}),s;a.length>0?(s=new Map(this.tableViewModelMap),s.set(o.tableModelId,new be({...r,tableModel:o.addColumnModelIds(a.map(c=>c.columnModelId))}))):s=this.tableViewModelMap;let l;return a.length>0?(l=new Map(this.columnModelMap),a.forEach(c=>l.set(c.columnModelId,c))):l=this.columnModelMap,this.doUpdate({tableViewModelMap:s,columnModelMap:l,relationViewModelStorage:this.relationViewModelStorage.updateRelationView(e)})}deleteRelation(e){return this.doUpdateRelationStorage(()=>this.relationViewModelStorage.deleteRelation([e]))}updateRelationLine(e,n){return this.doUpdateRelationStorage(()=>this.relationViewModelStorage.updateLineView(e,n))}updateRelationLabel(e,n){return this.doUpdateRelationStorage(()=>this.relationViewModelStorage.updateLabelView(e,n))}updateRelationLineBy(e,n){let r=this.findRelationViewModel(e);if(r==null)return this;let o=r.lineViewModel,i=n(o);return o.equals(i)?this:this.updateRelationLine(e,i)}updateRelationLabelBy(e,n){let r=this.findRelationViewModel(e);if(r==null)return this;let o=r.labelViewModel,i=n(o);return i.equals(o)?this:this.updateRelationLabel(e,i)}deleteSelectedElements(e){let n=e.relationId!=null&&e.relationId!==""?this.deleteRelation(e.relationId):this,r=Array.from(e.tableIds).reduce((o,i)=>o.deleteTable(i),n);return Array.from(e.memoIds).reduce((o,i)=>o.deleteMemo(i),r)}updateRelationOrthogonal(e){return this.doUpdateRelationStorage(()=>this.relationViewModelStorage.updateRelationOrthogonal(e))}doUpdateRelationStorage(e){let n=e();return this.relationViewModelStorage===n?this:this.doUpdate({relationViewModelStorage:n})}updateTableViewColor(e,n,r){if(e.length===0)return this;let o=i=>new be({...i,headerColor:{background:n,foreground:r}});return this.doUpdateTableRectangle(e,o)}moveTableView(e,n,r){if(e.size===0)return this;let o=a=>new be({...a,corner:{left:a.corner.left+n.x,top:a.corner.top+n.y}}),i=this.relationViewModelStorage.moveRelation(e,n).updateRelationOrthogonal(r);return this.doUpdateTableRectangle([...e],o,i)}doUpdateTableRectangle(e,n,r=null){if(e.length===0)return this;let o=new Map(this.tableViewModelMap);return e.forEach(i=>{let a=this.tableViewModelMap.get(i);a!=null&&o.set(i,n(a))}),this.doUpdate({tableViewModelMap:o,relationViewModelStorage:r??this.relationViewModelStorage})}addMemo(e){return this.doUpdateMemoViewModel(()=>this.memoViewModelStorage.addMemo(e))}updateMemo(e){return this.doUpdateMemoViewModel(()=>this.memoViewModelStorage.updateMemo(e))}deleteMemo(e){return this.doUpdateMemoViewModel(()=>this.memoViewModelStorage.deleteMemo(e))}arrangeMemo(e,n){return this.doUpdateMemoViewModel(()=>this.memoViewModelStorage.arrangeMemo(e,n))}doUpdateMemoViewModel(e){let n=e();return n===this.memoViewModelStorage?this:this.doUpdate({memoViewModelStorage:n})}moveMemoView(e,n){if(e.size===0)return this;let r=this.memoViewModelStorage.moveMemo(e,n);return r===this.memoViewModelStorage?this:this.doUpdate({memoViewModelStorage:r})}updateDocumentName(e){return this.documentName===e?this:this.doUpdate({documentName:e})}updateErdSetting(e){return this.erdSettingModel===e?this:this.doUpdate({erdSettingModel:e})}importDdl({tableViewModels:e,columnModels:n,columnShareModels:r,relationViewModels:o}){let i=[...this.tableViewModelIds,...e.map(m=>m.tableId)],a=new Map(this.tableViewModelMap);e.forEach(m=>a.set(m.tableId,m));let s=new Map(this.columnModelMap);n.forEach(m=>s.set(m.columnModelId,m));let l=this.columnShareStorage.addColumnShare(...r),c=new dn([...this.relationViewModelStorage.getModels(),...o]);return this.doUpdate({tableViewModelIds:i,tableViewModelMap:a,columnModelMap:s,columnShareModelStorage:l,relationViewModelStorage:c})}toJSON(){let e=this.getDatabase(),n=this.tableViewModelIds.map(l=>this.tableViewModelMap.get(l)).filter(l=>l!=null).map(l=>l.toJSON()),r=Array.from(this.columnGroupModelMap.values()).sort((l,c)=>l.groupName.localeCompare(c.groupName,"en")).map(l=>l.toJSON()),o=this.getStructColumnShareModels().map(l=>l.toJSON()),i=Array.from(this.columnModelMap.values()).sort((l,c)=>l.columnModelId.localeCompare(c.columnModelId,"en")).map(l=>l.toJSON()),{frontMemos:a,backMemos:s}=this.memoViewModelStorage.getMemos();return{documentName:this.documentName,lastUpdatedAt:this.lastUpdatedAt,...e.supportsSchema&&{schemaConfig:this.schemaConfig.toJSON()},tableViewModels:n,columnGroupModels:r,...o.length>0&&{structColumnShareModels:o},columnModels:i,columnShareModels:this.columnShareStorage.getColumnShareModels().map(l=>l.toJSON()),relationViewModels:this.relationViewModelStorage.getModels().map(l=>l.toJSON()),foregroundMemos:a.map(l=>l.toJSON()),backgroundMemos:s.map(l=>l.toJSON()),erdSettingModel:this.erdSettingModel.toJSON(),databaseSetting:this.databaseSettingModel.toJSON()}}static toObject(e){S(e,"documentName"),S(e,"tableViewModels"),S(e,"columnModels"),S(e,"columnShareModels"),S(e,"relationViewModels"),S(e,"erdSettingModel"),S(e,"databaseSetting");let n=cn.toObject(e.erdSettingModel),r=Fn.toObject(e.databaseSetting),o=r.initToColumnTypeMapping(),i="schemaConfig"in e?Cr.toObject(e.schemaConfig):Cr.create(),a=j(e.tableViewModels,"tableViewModels",y=>be.toObject(y)),s="columnGroupModels"in e?j(e.columnGroupModels,"columnGroupModels",y=>sn.toObject(y)):[],l="structColumnShareModels"in e?j(e.structColumnShareModels,"structColumnShareModels",y=>ct.toObject(y)):[],c=j(e.columnModels,"columnModels",y=>ce.toObject(y)),m=j(e.columnShareModels,"columnShareModels",y=>qn.toObject(y,o)),d=j(e.relationViewModels,"relationViewModels",y=>Ne.toObject(y)),h="foregroundMemos"in e?j(e.foregroundMemos,"foregroundMemos",y=>un.toObject(y)):[],g="backgroundMemos"in e?j(e.backgroundMemos,"backgroundMemos",y=>un.toObject(y)):[],b="lastUpdatedAt"in e?Ve(e.lastUpdatedAt):new Date;return t.create({documentName:e.documentName,erdSettingModel:n,schemaConfig:i,tableViewModels:a,columnGroupModels:s,structShareModels:l,columnModels:c,columnShareModels:m,relationViewModels:d,foregroundMemoViewModels:h,backgroundMemoViewModels:g,databaseSettingModel:r,lastUpdatedAt:b})}equals(e){if(this===e)return!0;if(this.documentName!==e.documentName||this.tableViewModelIds.length!==e.tableViewModelIds.length)return!1;for(let n=0;n<this.tableViewModelIds.length;n++)if(this.tableViewModelIds[n]!==e.tableViewModelIds[n])return!1;if(this.tableViewModelMap.size!==e.tableViewModelMap.size)return!1;for(let[n,r]of this.tableViewModelMap.entries()){let o=e.tableViewModelMap.get(n);if(o==null||r.equals(o)===!1)return!1}if(this.columnGroupModelMap.size!==e.columnGroupModelMap.size)return!1;for(let[n,r]of this.columnGroupModelMap.entries()){let o=e.columnGroupModelMap.get(n);if(o==null||r.equals(o)===!1)return!1}if(this.columnModelMap.size!==e.columnModelMap.size)return!1;for(let[n,r]of this.columnModelMap.entries()){let o=e.columnModelMap.get(n);if(o==null||ce.equals(r,o)===!1)return!1}return!(this.columnShareStorage.equals(e.columnShareStorage)===!1||this.relationViewModelStorage.equals(e.relationViewModelStorage)===!1||this.memoViewModelStorage.equals(e.memoViewModelStorage)===!1||this.erdSettingModel.equals(e.erdSettingModel)===!1||this.databaseSettingModel.equals(e.databaseSettingModel)===!1||this.schemaConfig.equals(e.schemaConfig)===!1)}reuseInstancesFrom(e){let n=Wh(e.tableViewModelIds,this.tableViewModelIds),r=Ho(e.tableViewModelMap,this.tableViewModelMap,(g,b)=>g.equals(b)),o=Ho(e.columnGroupModelMap,this.columnGroupModelMap,(g,b)=>g.equals(b)),i=Ho(e.columnModelMap,this.columnModelMap,(g,b)=>ce.equals(g,b)),a=this.columnShareStorage.reuseInstancesFrom(e.columnShareStorage),s=this.relationViewModelStorage.reuseInstancesFrom(e.relationViewModelStorage),l=this.memoViewModelStorage.reuseInstancesFrom(e.memoViewModelStorage),c=this.erdSettingModel.equals(e.erdSettingModel)===!0?e.erdSettingModel:this.erdSettingModel,m=this.databaseSettingModel.equals(e.databaseSettingModel)===!0?e.databaseSettingModel:this.databaseSettingModel,d=this.schemaConfig.equals(e.schemaConfig)===!0?e.schemaConfig:this.schemaConfig;return(this.documentName===e.documentName&&n===e.tableViewModelIds&&r===e.tableViewModelMap&&o===e.columnGroupModelMap&&i===e.columnModelMap&&a===e.columnShareStorage&&s===e.relationViewModelStorage&&l===e.memoViewModelStorage&&c===e.erdSettingModel&&m===e.databaseSettingModel&&d===e.schemaConfig)===!0?e:new t(this.documentName,c,m,d,n,r,o,i,a,s,l,this.lastUpdatedAt)}},bc=t=>t.flatMap(e=>e.modelType==="single"?[e.columnModelId]:[]),Wh=(t,e)=>t.length!==e.length?e:e.every((r,o)=>t[o]===r)?t:e,Ho=(t,e,n)=>{let r=t.size===e.size,o=Array.from(e.entries()).map(([i,a])=>{let s=t.get(i);return s!=null&&n(s,a)?[i,s]:(r=!1,[i,a])});return r?t:new Map(o)},Sc=t=>t==="1"||t==="1..N";var vr=class{constructor(){this.uriToIdMap=new Map,this.idToBudgetMap=new Map}async create(e,n){let r=Zt.resolve(e);if(Fe.existsSync(r))throw qo(`File already exists: ${r}`);let o=Zt.dirname(r);if(Fe.existsSync(o)===!1)throw qo(`Directory does not exist: ${o}`);let i=wc(n);return Fe.writeFileSync(r,i),this.doRegister(r,n)}tryRegister(e){let n=Zt.resolve(e);return Fe.existsSync(n)===!1?null:this.register(n)}register(e){let n=Zt.resolve(e),r=Fe.readFileSync(n,"utf-8"),o=mn.toObject(JSON.parse(r));return this.doRegister(n,o).documentId}load(e){let n=Zt.resolve(e),r=Fe.readFileSync(n,"utf-8"),o=mn.toObject(JSON.parse(r));return this.doRegister(n,o),o}doRegister(e,n){let r=(0,xc.pathToFileURL)(e).href,o=gi(r);return this.uriToIdMap.set(r,o),this.idToBudgetMap.set(o,{documentId:o,fileUri:r,filePath:e,erdDocument:n}),{documentId:o,fileUri:r}}notify(e,n){let r=this.idToBudgetMap.get(e);if(r==null||r.erdDocument===n)return;let o=wc(n);Fe.writeFileSync(r.filePath,o),this.idToBudgetMap.set(e,{...r,erdDocument:n})}fetchDocuments(){return Array.from(this.idToBudgetMap.values()).map(e=>Mc(e))}findById(e){let n=this.idToBudgetMap.get(e);return n==null?null:Mc(n)}findByUri(e){let n=this.uriToIdMap.get(e);return n==null?null:this.findById(n)}},wc=t=>JSON.stringify(t.toJSON(),null,4),Mc=t=>new fn({documentId:t.documentId,uri:t.fileUri,erdDocument:t.erdDocument,rectangles:new Map});var Qe=class{constructor(){}static load(e){let n=ic(e);try{return{resultType:"loaded",erdDocument:new vr().load(n)}}catch(r){let o=r instanceof Error?r.message:String(r);return{resultType:"failed",message:`Failed to load document: ${n}
|
|
27
|
+
})));`),h.write(`newResult[${wt(R)}] = ${v}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");let M=h.compile();return(R,v)=>M(d,R,v)},o,i=Kt,a=!Hn.jitless,l=a&&Kr.value,c=e.catchall,m;t._zod.parse=(d,h)=>{m??(m=n.value);let g=d.value;if(!i(g))return d.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),d;let b=[];if(a&&l&&h?.async===!1&&h.jitless!==!0)o||(o=r(e.shape)),d=o(d,h);else{d.value={};let v=m.shape;for(let z of m.keys){let me=v[z],pe=me._zod.run({value:g[z],issues:[]},h),H=me._zod.optin==="optional"&&me._zod.optout==="optional";pe instanceof Promise?b.push(pe.then(Ge=>H?ba(Ge,d,z,g):or(Ge,d,z))):H?ba(pe,d,z,g):or(pe,d,z)}}if(!c)return b.length?Promise.all(b).then(()=>d):d;let y=[],N=m.keySet,M=c._zod,R=M.def.type;for(let v of Object.keys(g)){if(N.has(v))continue;if(R==="never"){y.push(v);continue}let z=M.run({value:g[v],issues:[]},h);z instanceof Promise?b.push(z.then(me=>or(me,d,v))):or(z,d,v)}return y.length&&d.issues.push({code:"unrecognized_keys",keys:y,input:g,inst:t}),b.length?Promise.all(b).then(()=>d):d}});function Sa(t,e,n,r){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(o=>o.issues.map(i=>Pe(i,r,Me())))}),e}var so=f("$ZodUnion",(t,e)=>{Z.init(t,e),q(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),q(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),q(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),q(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(r=>r._zod.pattern);return new RegExp(`^(${n.map(r=>Sn(r.source)).join("|")})$`)}}),t._zod.parse=(n,r)=>{let o=!1,i=[];for(let a of e.options){let s=a._zod.run({value:n.value,issues:[]},r);if(s instanceof Promise)i.push(s),o=!0;else{if(s.issues.length===0)return s;i.push(s)}}return o?Promise.all(i).then(a=>Sa(a,n,t,r)):Sa(i,n,t,r)}}),rs=f("$ZodDiscriminatedUnion",(t,e)=>{so.init(t,e);let n=t._zod.parse;q(t._zod,"propValues",()=>{let o={};for(let i of e.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(let[s,l]of Object.entries(a)){o[s]||(o[s]=new Set);for(let c of l)o[s].add(c)}}return o});let r=yn(()=>{let o=e.options,i=new Map;for(let a of o){let s=a._zod.propValues[e.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(let l of s){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,a)}}return i});t._zod.parse=(o,i)=>{let a=o.value;if(!Kt(a))return o.issues.push({code:"invalid_type",expected:"object",input:a,inst:t}),o;let s=r.value.get(a?.[e.discriminator]);return s?s._zod.run(o,i):e.unionFallback?n(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:a,path:[e.discriminator],inst:t}),o)}}),os=f("$ZodIntersection",(t,e)=>{Z.init(t,e),t._zod.parse=(n,r)=>{let o=n.value,i=e.left._zod.run({value:o,issues:[]},r),a=e.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([l,c])=>wa(n,l,c)):wa(n,i,a)}});function io(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Gt(t)&&Gt(e)){let n=Object.keys(e),r=Object.keys(t).filter(i=>n.indexOf(i)!==-1),o={...t,...e};for(let i of r){let a=io(t[i],e[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};o[i]=a.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<t.length;r++){let o=t[r],i=e[r],a=io(o,i);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function wa(t,e,n){if(e.issues.length&&t.issues.push(...e.issues),n.issues.length&&t.issues.push(...n.issues),Mt(t))return t;let r=io(e.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return t.value=r.data,t}var is=f("$ZodRecord",(t,e)=>{Z.init(t,e),t._zod.parse=(n,r)=>{let o=n.value;if(!Gt(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),n;let i=[];if(e.keyType._zod.values){let a=e.keyType._zod.values;n.value={};for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){let c=e.valueType._zod.run({value:o[l],issues:[]},r);c instanceof Promise?i.push(c.then(m=>{m.issues.length&&n.issues.push(...De(l,m.issues)),n.value[l]=m.value})):(c.issues.length&&n.issues.push(...De(l,c.issues)),n.value[l]=c.value)}let s;for(let l in o)a.has(l)||(s=s??[],s.push(l));s&&s.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:s})}else{n.value={};for(let a of Reflect.ownKeys(o)){if(a==="__proto__")continue;let s=e.keyType._zod.run({value:a,issues:[]},r);if(s instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(s.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:s.issues.map(c=>Pe(c,r,Me())),input:a,path:[a],inst:t}),n.value[s.value]=s.value;continue}let l=e.valueType._zod.run({value:o[a],issues:[]},r);l instanceof Promise?i.push(l.then(c=>{c.issues.length&&n.issues.push(...De(a,c.issues)),n.value[s.value]=c.value})):(l.issues.length&&n.issues.push(...De(a,l.issues)),n.value[s.value]=l.value)}}return i.length?Promise.all(i).then(()=>n):n}});var as=f("$ZodEnum",(t,e)=>{Z.init(t,e);let n=Zr(e.entries);t._zod.values=new Set(n),t._zod.pattern=new RegExp(`^(${n.filter(r=>Gr.has(typeof r)).map(r=>typeof r=="string"?rt(r):r.toString()).join("|")})$`),t._zod.parse=(r,o)=>{let i=r.value;return t._zod.values.has(i)||r.issues.push({code:"invalid_value",values:n,input:i,inst:t}),r}}),ss=f("$ZodLiteral",(t,e)=>{Z.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?rt(n):n?n.toString():String(n)).join("|")})$`),t._zod.parse=(n,r)=>{let o=n.value;return t._zod.values.has(o)||n.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),n}});var ls=f("$ZodTransform",(t,e)=>{Z.init(t,e),t._zod.parse=(n,r)=>{let o=e.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(n.value=a,n));if(o instanceof Promise)throw new Ye;return n.value=o,n}}),cs=f("$ZodOptional",(t,e)=>{Z.init(t,e),t._zod.optin="optional",t._zod.optout="optional",q(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),q(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${Sn(n.source)})?$`):void 0}),t._zod.parse=(n,r)=>e.innerType._zod.optin==="optional"?e.innerType._zod.run(n,r):n.value===void 0?n:e.innerType._zod.run(n,r)}),us=f("$ZodNullable",(t,e)=>{Z.init(t,e),q(t._zod,"optin",()=>e.innerType._zod.optin),q(t._zod,"optout",()=>e.innerType._zod.optout),q(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${Sn(n.source)}|null)$`):void 0}),q(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(n,r)=>n.value===null?n:e.innerType._zod.run(n,r)}),ds=f("$ZodDefault",(t,e)=>{Z.init(t,e),t._zod.optin="optional",q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>{if(n.value===void 0)return n.value=e.defaultValue,n;let o=e.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>Ma(i,e)):Ma(o,e)}});function Ma(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var ms=f("$ZodPrefault",(t,e)=>{Z.init(t,e),t._zod.optin="optional",q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>(n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,r))}),ps=f("$ZodNonOptional",(t,e)=>{Z.init(t,e),q(t._zod,"values",()=>{let n=e.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),t._zod.parse=(n,r)=>{let o=e.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>xa(i,t)):xa(o,t)}});function xa(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var hs=f("$ZodCatch",(t,e)=>{Z.init(t,e),t._zod.optin="optional",q(t._zod,"optout",()=>e.innerType._zod.optout),q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>{let o=e.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.value,i.issues.length&&(n.value=e.catchValue({...n,error:{issues:i.issues.map(a=>Pe(a,r,Me()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=e.catchValue({...n,error:{issues:o.issues.map(i=>Pe(i,r,Me()))},input:n.value}),n.issues=[]),n)}});var fs=f("$ZodPipe",(t,e)=>{Z.init(t,e),q(t._zod,"values",()=>e.in._zod.values),q(t._zod,"optin",()=>e.in._zod.optin),q(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(n,r)=>{let o=e.in._zod.run(n,r);return o instanceof Promise?o.then(i=>Ta(i,e,r)):Ta(o,e,r)}});function Ta(t,e,n){return Mt(t)?t:e.out._zod.run({value:t.value,issues:t.issues},n)}var gs=f("$ZodReadonly",(t,e)=>{Z.init(t,e),q(t._zod,"propValues",()=>e.innerType._zod.propValues),q(t._zod,"values",()=>e.innerType._zod.values),q(t._zod,"optin",()=>e.innerType._zod.optin),q(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(n,r)=>{let o=e.innerType._zod.run(n,r);return o instanceof Promise?o.then(Ia):Ia(o)}});function Ia(t){return t.value=Object.freeze(t.value),t}var ys=f("$ZodCustom",(t,e)=>{ue.init(t,e),Z.init(t,e),t._zod.parse=(n,r)=>n,t._zod.check=n=>{let r=n.value,o=e.fn(r);if(o instanceof Promise)return o.then(i=>Ca(i,n,r,t));Ca(o,n,r,t)}});function Ca(t,e,n,r){if(!t){let o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),e.issues.push(Wr(o))}}var $u=t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},Uu=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(r){return t[r]??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",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Invalid input: expected ${r.expected}, received ${$u(r.input)}`;case"invalid_value":return r.values.length===1?`Invalid input: expected ${tr(r.values[0])}`:`Invalid option: expected one of ${Xn(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",i=e(r.origin);return i?`Too big: expected ${r.origin??"value"} to have ${o}${r.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${r.origin??"value"} to be ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",i=e(r.origin);return i?`Too small: expected ${r.origin} to have ${o}${r.minimum.toString()} ${i.unit}`:`Too small: expected ${r.origin} to be ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${n[o.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${Xn(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}};function bs(){return{localeError:Uu()}}var lo=class{constructor(){this._map=new Map,this._idmap=new Map}add(e,...n){let r=n[0];if(this._map.set(e,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){let n=e._zod.parent;if(n){let r={...this.get(n)??{}};return delete r.id,{...r,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function Lu(){return new lo}var xn=Lu();function Ss(t,e){return new t({type:"string",...E(e)})}function ws(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...E(e)})}function co(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...E(e)})}function Ms(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...E(e)})}function xs(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...E(e)})}function Ts(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...E(e)})}function Is(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...E(e)})}function Cs(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...E(e)})}function _s(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...E(e)})}function Ns(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...E(e)})}function vs(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...E(e)})}function Es(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...E(e)})}function As(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...E(e)})}function Rs(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...E(e)})}function Ps(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...E(e)})}function zs(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...E(e)})}function Os(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...E(e)})}function ks(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...E(e)})}function Ds(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...E(e)})}function $s(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...E(e)})}function Us(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...E(e)})}function Ls(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...E(e)})}function Vs(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...E(e)})}function qs(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...E(e)})}function Zs(t,e){return new t({type:"string",format:"date",check:"string_format",...E(e)})}function Fs(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...E(e)})}function Qs(t,e){return new t({type:"string",format:"duration",check:"string_format",...E(e)})}function Bs(t,e){return new t({type:"number",checks:[],...E(e)})}function Ks(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...E(e)})}function Gs(t,e){return new t({type:"boolean",...E(e)})}function Ys(t,e){return new t({type:"null",...E(e)})}function js(t){return new t({type:"unknown"})}function Ws(t,e){return new t({type:"never",...E(e)})}function ar(t,e){return new ro({check:"less_than",...E(e),value:t,inclusive:!1})}function Tn(t,e){return new ro({check:"less_than",...E(e),value:t,inclusive:!0})}function sr(t,e){return new oo({check:"greater_than",...E(e),value:t,inclusive:!1})}function In(t,e){return new oo({check:"greater_than",...E(e),value:t,inclusive:!0})}function lr(t,e){return new ra({check:"multiple_of",...E(e),value:t})}function cr(t,e){return new ia({check:"max_length",...E(e),maximum:t})}function Yt(t,e){return new aa({check:"min_length",...E(e),minimum:t})}function ur(t,e){return new sa({check:"length_equals",...E(e),length:t})}function uo(t,e){return new la({check:"string_format",format:"regex",...E(e),pattern:t})}function mo(t){return new ca({check:"string_format",format:"lowercase",...E(t)})}function po(t){return new ua({check:"string_format",format:"uppercase",...E(t)})}function ho(t,e){return new da({check:"string_format",format:"includes",...E(e),includes:t})}function fo(t,e){return new ma({check:"string_format",format:"starts_with",...E(e),prefix:t})}function go(t,e){return new pa({check:"string_format",format:"ends_with",...E(e),suffix:t})}function xt(t){return new ha({check:"overwrite",tx:t})}function yo(t){return xt(e=>e.normalize(t))}function bo(){return xt(t=>t.trim())}function So(){return xt(t=>t.toLowerCase())}function wo(){return xt(t=>t.toUpperCase())}function Js(t,e,n){return new t({type:"array",element:e,...E(n)})}function Hs(t,e,n){let r=E(n);return r.abort??(r.abort=!0),new t({type:"custom",check:"custom",fn:e,...r})}function Xs(t,e,n){return new t({type:"custom",check:"custom",fn:e,...E(n)})}var _n={};Lr(_n,{ZodISODate:()=>tl,ZodISODateTime:()=>el,ZodISODuration:()=>rl,ZodISOTime:()=>nl,date:()=>xo,datetime:()=>Mo,duration:()=>Io,time:()=>To});var el=f("ZodISODateTime",(t,e)=>{$a.init(t,e),K.init(t,e)});function Mo(t){return qs(el,t)}var tl=f("ZodISODate",(t,e)=>{Ua.init(t,e),K.init(t,e)});function xo(t){return Zs(tl,t)}var nl=f("ZodISOTime",(t,e)=>{La.init(t,e),K.init(t,e)});function To(t){return Fs(nl,t)}var rl=f("ZodISODuration",(t,e)=>{Va.init(t,e),K.init(t,e)});function Io(t){return Qs(rl,t)}var ol=(t,e)=>{nr.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>xi(t,n)},flatten:{value:n=>Mi(t,n)},addIssue:{value:n=>t.issues.push(n)},addIssues:{value:n=>t.issues.push(...n)},isEmpty:{get(){return t.issues.length===0}}})},Pb=f("ZodError",ol),Nn=f("ZodError",ol,{Parent:Error});var il=Ti(Nn),al=Ii(Nn),sl=Hr(Nn),ll=Xr(Nn);var J=f("ZodType",(t,e)=>(Z.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...n)=>t.clone({...e,checks:[...e.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),t.clone=(n,r)=>ke(t,n,r),t.brand=()=>t,t.register=((n,r)=>(n.add(t,r),t)),t.parse=(n,r)=>il(t,n,r,{callee:t.parse}),t.safeParse=(n,r)=>sl(t,n,r),t.parseAsync=async(n,r)=>al(t,n,r,{callee:t.parseAsync}),t.safeParseAsync=async(n,r)=>ll(t,n,r),t.spa=t.safeParseAsync,t.refine=(n,r)=>t.check(Dd(n,r)),t.superRefine=n=>t.check($d(n)),t.overwrite=n=>t.check(xt(n)),t.optional=()=>Y(t),t.nullable=()=>dl(t),t.nullish=()=>Y(dl(t)),t.nonoptional=n=>Ed(t,n),t.array=()=>$(t),t.or=n=>B([t,n]),t.and=n=>mr(t,n),t.transform=n=>_o(t,yl(n)),t.default=n=>_d(t,n),t.prefault=n=>vd(t,n),t.catch=n=>Rd(t,n),t.pipe=n=>_o(t,n),t.readonly=()=>Od(t),t.describe=n=>{let r=t.clone();return xn.add(r,{description:n}),r},Object.defineProperty(t,"description",{get(){return xn.get(t)?.description},configurable:!0}),t.meta=(...n)=>{if(n.length===0)return xn.get(t);let r=t.clone();return xn.add(r,n[0]),r},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),ml=f("_ZodString",(t,e)=>{ir.init(t,e),J.init(t,e);let n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,t.regex=(...r)=>t.check(uo(...r)),t.includes=(...r)=>t.check(ho(...r)),t.startsWith=(...r)=>t.check(fo(...r)),t.endsWith=(...r)=>t.check(go(...r)),t.min=(...r)=>t.check(Yt(...r)),t.max=(...r)=>t.check(cr(...r)),t.length=(...r)=>t.check(ur(...r)),t.nonempty=(...r)=>t.check(Yt(1,...r)),t.lowercase=r=>t.check(mo(r)),t.uppercase=r=>t.check(po(r)),t.trim=()=>t.check(bo()),t.normalize=(...r)=>t.check(yo(...r)),t.toLowerCase=()=>t.check(So()),t.toUpperCase=()=>t.check(wo())}),Yu=f("ZodString",(t,e)=>{ir.init(t,e),ml.init(t,e),t.email=n=>t.check(ws(ju,n)),t.url=n=>t.check(Cs(Wu,n)),t.jwt=n=>t.check(Vs(dd,n)),t.emoji=n=>t.check(_s(Ju,n)),t.guid=n=>t.check(co(cl,n)),t.uuid=n=>t.check(Ms(dr,n)),t.uuidv4=n=>t.check(xs(dr,n)),t.uuidv6=n=>t.check(Ts(dr,n)),t.uuidv7=n=>t.check(Is(dr,n)),t.nanoid=n=>t.check(Ns(Hu,n)),t.guid=n=>t.check(co(cl,n)),t.cuid=n=>t.check(vs(Xu,n)),t.cuid2=n=>t.check(Es(ed,n)),t.ulid=n=>t.check(As(td,n)),t.base64=n=>t.check($s(ld,n)),t.base64url=n=>t.check(Us(cd,n)),t.xid=n=>t.check(Rs(nd,n)),t.ksuid=n=>t.check(Ps(rd,n)),t.ipv4=n=>t.check(zs(od,n)),t.ipv6=n=>t.check(Os(id,n)),t.cidrv4=n=>t.check(ks(ad,n)),t.cidrv6=n=>t.check(Ds(sd,n)),t.e164=n=>t.check(Ls(ud,n)),t.datetime=n=>t.check(Mo(n)),t.date=n=>t.check(xo(n)),t.time=n=>t.check(To(n)),t.duration=n=>t.check(Io(n))});function p(t){return Ss(Yu,t)}var K=f("ZodStringFormat",(t,e)=>{Q.init(t,e),ml.init(t,e)}),ju=f("ZodEmail",(t,e)=>{va.init(t,e),K.init(t,e)});var cl=f("ZodGUID",(t,e)=>{_a.init(t,e),K.init(t,e)});var dr=f("ZodUUID",(t,e)=>{Na.init(t,e),K.init(t,e)});var Wu=f("ZodURL",(t,e)=>{Ea.init(t,e),K.init(t,e)});var Ju=f("ZodEmoji",(t,e)=>{Aa.init(t,e),K.init(t,e)});var Hu=f("ZodNanoID",(t,e)=>{Ra.init(t,e),K.init(t,e)});var Xu=f("ZodCUID",(t,e)=>{Pa.init(t,e),K.init(t,e)});var ed=f("ZodCUID2",(t,e)=>{za.init(t,e),K.init(t,e)});var td=f("ZodULID",(t,e)=>{Oa.init(t,e),K.init(t,e)});var nd=f("ZodXID",(t,e)=>{ka.init(t,e),K.init(t,e)});var rd=f("ZodKSUID",(t,e)=>{Da.init(t,e),K.init(t,e)});var od=f("ZodIPv4",(t,e)=>{qa.init(t,e),K.init(t,e)});var id=f("ZodIPv6",(t,e)=>{Za.init(t,e),K.init(t,e)});var ad=f("ZodCIDRv4",(t,e)=>{Fa.init(t,e),K.init(t,e)});var sd=f("ZodCIDRv6",(t,e)=>{Qa.init(t,e),K.init(t,e)});var ld=f("ZodBase64",(t,e)=>{Ka.init(t,e),K.init(t,e)});var cd=f("ZodBase64URL",(t,e)=>{Ga.init(t,e),K.init(t,e)});var ud=f("ZodE164",(t,e)=>{Ya.init(t,e),K.init(t,e)});var dd=f("ZodJWT",(t,e)=>{ja.init(t,e),K.init(t,e)});var pl=f("ZodNumber",(t,e)=>{ao.init(t,e),J.init(t,e),t.gt=(r,o)=>t.check(sr(r,o)),t.gte=(r,o)=>t.check(In(r,o)),t.min=(r,o)=>t.check(In(r,o)),t.lt=(r,o)=>t.check(ar(r,o)),t.lte=(r,o)=>t.check(Tn(r,o)),t.max=(r,o)=>t.check(Tn(r,o)),t.int=r=>t.check(ul(r)),t.safe=r=>t.check(ul(r)),t.positive=r=>t.check(sr(0,r)),t.nonnegative=r=>t.check(In(0,r)),t.negative=r=>t.check(ar(0,r)),t.nonpositive=r=>t.check(Tn(0,r)),t.multipleOf=(r,o)=>t.check(lr(r,o)),t.step=(r,o)=>t.check(lr(r,o)),t.finite=()=>t;let n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});function L(t){return Bs(pl,t)}var md=f("ZodNumberFormat",(t,e)=>{Wa.init(t,e),pl.init(t,e)});function ul(t){return Ks(md,t)}var pd=f("ZodBoolean",(t,e)=>{Ja.init(t,e),J.init(t,e)});function ne(t){return Gs(pd,t)}var hd=f("ZodNull",(t,e)=>{Ha.init(t,e),J.init(t,e)});function hl(t){return Ys(hd,t)}var fd=f("ZodUnknown",(t,e)=>{Xa.init(t,e),J.init(t,e)});function G(){return js(fd)}var gd=f("ZodNever",(t,e)=>{es.init(t,e),J.init(t,e)});function yd(t){return Ws(gd,t)}var bd=f("ZodArray",(t,e)=>{ts.init(t,e),J.init(t,e),t.element=e.element,t.min=(n,r)=>t.check(Yt(n,r)),t.nonempty=n=>t.check(Yt(1,n)),t.max=(n,r)=>t.check(cr(n,r)),t.length=(n,r)=>t.check(ur(n,r)),t.unwrap=()=>t.element});function $(t,e){return Js(bd,t,e)}var fl=f("ZodObject",(t,e)=>{ns.init(t,e),J.init(t,e),U.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>fe(Object.keys(t._zod.def.shape)),t.catchall=n=>t.clone({...t._zod.def,catchall:n}),t.passthrough=()=>t.clone({...t._zod.def,catchall:G()}),t.loose=()=>t.clone({...t._zod.def,catchall:G()}),t.strict=()=>t.clone({...t._zod.def,catchall:yd()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=n=>U.extend(t,n),t.merge=n=>U.merge(t,n),t.pick=n=>U.pick(t,n),t.omit=n=>U.omit(t,n),t.partial=(...n)=>U.partial(bl,t,n[0]),t.required=(...n)=>U.required(Sl,t,n[0])});function I(t,e){let n={type:"object",get shape(){return U.assignProp(this,"shape",{...t}),this.shape},...U.normalizeParams(e)};return new fl(n)}function he(t,e){return new fl({type:"object",get shape(){return U.assignProp(this,"shape",{...t}),this.shape},catchall:G(),...U.normalizeParams(e)})}var gl=f("ZodUnion",(t,e)=>{so.init(t,e),J.init(t,e),t.options=e.options});function B(t,e){return new gl({type:"union",options:t,...U.normalizeParams(e)})}var Sd=f("ZodDiscriminatedUnion",(t,e)=>{gl.init(t,e),rs.init(t,e)});function No(t,e,n){return new Sd({type:"union",options:e,discriminator:t,...U.normalizeParams(n)})}var wd=f("ZodIntersection",(t,e)=>{os.init(t,e),J.init(t,e)});function mr(t,e){return new wd({type:"intersection",left:t,right:e})}var Md=f("ZodRecord",(t,e)=>{is.init(t,e),J.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function F(t,e,n){return new Md({type:"record",keyType:t,valueType:e,...U.normalizeParams(n)})}var Co=f("ZodEnum",(t,e)=>{as.init(t,e),J.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);let n=new Set(Object.keys(e.entries));t.extract=(r,o)=>{let i={};for(let a of r)if(n.has(a))i[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Co({...e,checks:[],...U.normalizeParams(o),entries:i})},t.exclude=(r,o)=>{let i={...e.entries};for(let a of r)if(n.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new Co({...e,checks:[],...U.normalizeParams(o),entries:i})}});function fe(t,e){let n=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new Co({type:"enum",entries:n,...U.normalizeParams(e)})}var xd=f("ZodLiteral",(t,e)=>{ss.init(t,e),J.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function _(t,e){return new xd({type:"literal",values:Array.isArray(t)?t:[t],...U.normalizeParams(e)})}var Td=f("ZodTransform",(t,e)=>{ls.init(t,e),J.init(t,e),t._zod.parse=(n,r)=>{n.addIssue=i=>{if(typeof i=="string")n.issues.push(U.issue(i,n.value,e));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=t),a.continue??(a.continue=!0),n.issues.push(U.issue(a))}};let o=e.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function yl(t){return new Td({type:"transform",transform:t})}var bl=f("ZodOptional",(t,e)=>{cs.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Y(t){return new bl({type:"optional",innerType:t})}var Id=f("ZodNullable",(t,e)=>{us.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType});function dl(t){return new Id({type:"nullable",innerType:t})}var Cd=f("ZodDefault",(t,e)=>{ds.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function _d(t,e){return new Cd({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}var Nd=f("ZodPrefault",(t,e)=>{ms.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType});function vd(t,e){return new Nd({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}var Sl=f("ZodNonOptional",(t,e)=>{ps.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Ed(t,e){return new Sl({type:"nonoptional",innerType:t,...U.normalizeParams(e)})}var Ad=f("ZodCatch",(t,e)=>{hs.init(t,e),J.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function Rd(t,e){return new Ad({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var Pd=f("ZodPipe",(t,e)=>{fs.init(t,e),J.init(t,e),t.in=e.in,t.out=e.out});function _o(t,e){return new Pd({type:"pipe",in:t,out:e})}var zd=f("ZodReadonly",(t,e)=>{gs.init(t,e),J.init(t,e)});function Od(t){return new zd({type:"readonly",innerType:t})}var wl=f("ZodCustom",(t,e)=>{ys.init(t,e),J.init(t,e)});function kd(t){let e=new ue({check:"custom"});return e._zod.check=t,e}function Ml(t,e){return Hs(wl,t??(()=>!0),e)}function Dd(t,e={}){return Xs(wl,t,e)}function $d(t){let e=kd(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(U.issue(r,n.value,e._zod.def));else{let o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),o.continue??(o.continue=!e._zod.def.abort),n.issues.push(U.issue(o))}},t(n.value,n)));return e}function vo(t,e){return _o(yl(t),e)}Me(bs());var Ud="io.modelcontextprotocol/related-task",hr="2.0",te=Ml(t=>t!==null&&(typeof t=="object"||typeof t=="function")),xl=B([p(),L().int()]),Tl=p(),CS=he({ttl:L().optional(),pollInterval:L().optional()}),Ld=I({ttl:L().optional()}),Vd=I({taskId:p()}),Ao=he({progressToken:xl.optional(),[Ud]:Vd.optional()}),Se=I({_meta:Ao.optional()}),fr=Se.extend({task:Ld.optional()});var ie=I({method:p(),params:Se.loose().optional()}),xe=I({_meta:Ao.optional()}),Te=I({method:p(),params:xe.loose().optional()}),ae=he({_meta:Ao.optional()}),gr=B([p(),L().int()]),qd=I({jsonrpc:_(hr),id:gr,...ie.shape}).strict();var Zd=I({jsonrpc:_(hr),...Te.shape}).strict();var Il=I({jsonrpc:_(hr),id:gr,result:ae}).strict();var Tt;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Tt||(Tt={}));var Cl=I({jsonrpc:_(hr),id:gr.optional(),error:I({code:L().int(),message:p(),data:G().optional()})}).strict();var _S=B([qd,Zd,Il,Cl]),NS=B([Il,Cl]),_l=ae.strict(),Fd=xe.extend({requestId:gr.optional(),reason:p().optional()}),Nl=Te.extend({method:_("notifications/cancelled"),params:Fd}),Qd=I({src:p(),mimeType:p().optional(),sizes:$(p()).optional(),theme:fe(["light","dark"]).optional()}),En=I({icons:$(Qd).optional()}),jt=I({name:p(),title:p().optional()}),vl=jt.extend({...jt.shape,...En.shape,version:p(),websiteUrl:p().optional(),description:p().optional()}),Bd=mr(I({applyDefaults:ne().optional()}),F(p(),G())),Kd=vo(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,mr(I({form:Bd.optional(),url:te.optional()}),F(p(),G()).optional())),Gd=he({list:te.optional(),cancel:te.optional(),requests:he({sampling:he({createMessage:te.optional()}).optional(),elicitation:he({create:te.optional()}).optional()}).optional()}),Yd=he({list:te.optional(),cancel:te.optional(),requests:he({tools:he({call:te.optional()}).optional()}).optional()}),jd=I({experimental:F(p(),te).optional(),sampling:I({context:te.optional(),tools:te.optional()}).optional(),elicitation:Kd.optional(),roots:I({listChanged:ne().optional()}).optional(),tasks:Gd.optional(),extensions:F(p(),te).optional()}),Wd=Se.extend({protocolVersion:p(),capabilities:jd,clientInfo:vl}),Jd=ie.extend({method:_("initialize"),params:Wd});var Hd=I({experimental:F(p(),te).optional(),logging:te.optional(),completions:te.optional(),prompts:I({listChanged:ne().optional()}).optional(),resources:I({subscribe:ne().optional(),listChanged:ne().optional()}).optional(),tools:I({listChanged:ne().optional()}).optional(),tasks:Yd.optional(),extensions:F(p(),te).optional()}),Xd=ae.extend({protocolVersion:p(),capabilities:Hd,serverInfo:vl,instructions:p().optional()}),em=Te.extend({method:_("notifications/initialized"),params:xe.optional()});var El=ie.extend({method:_("ping"),params:Se.optional()}),tm=I({progress:L(),total:Y(L()),message:Y(p())}),nm=I({...xe.shape,...tm.shape,progressToken:xl}),Al=Te.extend({method:_("notifications/progress"),params:nm}),rm=Se.extend({cursor:Tl.optional()}),An=ie.extend({params:rm.optional()}),Rn=ae.extend({nextCursor:Tl.optional()}),om=fe(["working","input_required","completed","failed","cancelled"]),Pn=I({taskId:p(),status:om,ttl:B([L(),hl()]),createdAt:p(),lastUpdatedAt:p(),pollInterval:Y(L()),statusMessage:Y(p())}),Rl=ae.extend({task:Pn}),im=xe.merge(Pn),Pl=Te.extend({method:_("notifications/tasks/status"),params:im}),zl=ie.extend({method:_("tasks/get"),params:Se.extend({taskId:p()})}),Ol=ae.merge(Pn),kl=ie.extend({method:_("tasks/result"),params:Se.extend({taskId:p()})}),vS=ae.loose(),Dl=An.extend({method:_("tasks/list")}),$l=Rn.extend({tasks:$(Pn)}),Ul=ie.extend({method:_("tasks/cancel"),params:Se.extend({taskId:p()})}),ES=ae.merge(Pn),Ll=I({uri:p(),mimeType:Y(p()),_meta:F(p(),G()).optional()}),Vl=Ll.extend({text:p()}),Ro=p().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),ql=Ll.extend({blob:Ro}),zn=fe(["user","assistant"]),Wt=I({audience:$(zn).optional(),priority:L().min(0).max(1).optional(),lastModified:_n.datetime({offset:!0}).optional()}),Zl=I({...jt.shape,...En.shape,uri:p(),description:Y(p()),mimeType:Y(p()),size:Y(L()),annotations:Wt.optional(),_meta:Y(he({}))}),am=I({...jt.shape,...En.shape,uriTemplate:p(),description:Y(p()),mimeType:Y(p()),annotations:Wt.optional(),_meta:Y(he({}))}),sm=An.extend({method:_("resources/list")}),lm=Rn.extend({resources:$(Zl)}),cm=An.extend({method:_("resources/templates/list")}),um=Rn.extend({resourceTemplates:$(am)}),Po=Se.extend({uri:p()}),dm=Po,mm=ie.extend({method:_("resources/read"),params:dm}),pm=ae.extend({contents:$(B([Vl,ql]))}),hm=Te.extend({method:_("notifications/resources/list_changed"),params:xe.optional()}),fm=Po,gm=ie.extend({method:_("resources/subscribe"),params:fm}),ym=Po,bm=ie.extend({method:_("resources/unsubscribe"),params:ym}),Sm=xe.extend({uri:p()}),wm=Te.extend({method:_("notifications/resources/updated"),params:Sm}),Mm=I({name:p(),description:Y(p()),required:Y(ne())}),xm=I({...jt.shape,...En.shape,description:Y(p()),arguments:Y($(Mm)),_meta:Y(he({}))}),Tm=An.extend({method:_("prompts/list")}),Im=Rn.extend({prompts:$(xm)}),Cm=Se.extend({name:p(),arguments:F(p(),p()).optional()}),_m=ie.extend({method:_("prompts/get"),params:Cm}),zo=I({type:_("text"),text:p(),annotations:Wt.optional(),_meta:F(p(),G()).optional()}),Oo=I({type:_("image"),data:Ro,mimeType:p(),annotations:Wt.optional(),_meta:F(p(),G()).optional()}),ko=I({type:_("audio"),data:Ro,mimeType:p(),annotations:Wt.optional(),_meta:F(p(),G()).optional()}),Nm=I({type:_("tool_use"),name:p(),id:p(),input:F(p(),G()),_meta:F(p(),G()).optional()}),vm=I({type:_("resource"),resource:B([Vl,ql]),annotations:Wt.optional(),_meta:F(p(),G()).optional()}),Em=Zl.extend({type:_("resource_link")}),Do=B([zo,Oo,ko,Em,vm]),Am=I({role:zn,content:Do}),Rm=ae.extend({description:p().optional(),messages:$(Am)}),Pm=Te.extend({method:_("notifications/prompts/list_changed"),params:xe.optional()}),zm=I({title:p().optional(),readOnlyHint:ne().optional(),destructiveHint:ne().optional(),idempotentHint:ne().optional(),openWorldHint:ne().optional()}),Om=I({taskSupport:fe(["required","optional","forbidden"]).optional()}),Fl=I({...jt.shape,...En.shape,description:p().optional(),inputSchema:I({type:_("object"),properties:F(p(),te).optional(),required:$(p()).optional()}).catchall(G()),outputSchema:I({type:_("object"),properties:F(p(),te).optional(),required:$(p()).optional()}).catchall(G()).optional(),annotations:zm.optional(),execution:Om.optional(),_meta:F(p(),G()).optional()}),km=An.extend({method:_("tools/list")}),Dm=Rn.extend({tools:$(Fl)}),Ql=ae.extend({content:$(Do).default([]),structuredContent:F(p(),G()).optional(),isError:ne().optional()}),AS=Ql.or(ae.extend({toolResult:G()})),$m=fr.extend({name:p(),arguments:F(p(),G()).optional()}),Um=ie.extend({method:_("tools/call"),params:$m}),Lm=Te.extend({method:_("notifications/tools/list_changed"),params:xe.optional()}),RS=I({autoRefresh:ne().default(!0),debounceMs:L().int().nonnegative().default(300)}),Bl=fe(["debug","info","notice","warning","error","critical","alert","emergency"]),Vm=Se.extend({level:Bl}),qm=ie.extend({method:_("logging/setLevel"),params:Vm}),Zm=xe.extend({level:Bl,logger:p().optional(),data:G()}),Fm=Te.extend({method:_("notifications/message"),params:Zm}),Qm=I({name:p().optional()}),Bm=I({hints:$(Qm).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),Km=I({mode:fe(["auto","required","none"]).optional()}),Gm=I({type:_("tool_result"),toolUseId:p().describe("The unique identifier for the corresponding tool call."),content:$(Do).default([]),structuredContent:I({}).loose().optional(),isError:ne().optional(),_meta:F(p(),G()).optional()}),Ym=No("type",[zo,Oo,ko]),pr=No("type",[zo,Oo,ko,Nm,Gm]),jm=I({role:zn,content:B([pr,$(pr)]),_meta:F(p(),G()).optional()}),Wm=fr.extend({messages:$(jm),modelPreferences:Bm.optional(),systemPrompt:p().optional(),includeContext:fe(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:$(p()).optional(),metadata:te.optional(),tools:$(Fl).optional(),toolChoice:Km.optional()}),Jm=ie.extend({method:_("sampling/createMessage"),params:Wm}),Hm=ae.extend({model:p(),stopReason:Y(fe(["endTurn","stopSequence","maxTokens"]).or(p())),role:zn,content:Ym}),Xm=ae.extend({model:p(),stopReason:Y(fe(["endTurn","stopSequence","maxTokens","toolUse"]).or(p())),role:zn,content:B([pr,$(pr)])}),ep=I({type:_("boolean"),title:p().optional(),description:p().optional(),default:ne().optional()}),tp=I({type:_("string"),title:p().optional(),description:p().optional(),minLength:L().optional(),maxLength:L().optional(),format:fe(["email","uri","date","date-time"]).optional(),default:p().optional()}),np=I({type:fe(["number","integer"]),title:p().optional(),description:p().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),rp=I({type:_("string"),title:p().optional(),description:p().optional(),enum:$(p()),default:p().optional()}),op=I({type:_("string"),title:p().optional(),description:p().optional(),oneOf:$(I({const:p(),title:p()})),default:p().optional()}),ip=I({type:_("string"),title:p().optional(),description:p().optional(),enum:$(p()),enumNames:$(p()).optional(),default:p().optional()}),ap=B([rp,op]),sp=I({type:_("array"),title:p().optional(),description:p().optional(),minItems:L().optional(),maxItems:L().optional(),items:I({type:_("string"),enum:$(p())}),default:$(p()).optional()}),lp=I({type:_("array"),title:p().optional(),description:p().optional(),minItems:L().optional(),maxItems:L().optional(),items:I({anyOf:$(I({const:p(),title:p()}))}),default:$(p()).optional()}),cp=B([sp,lp]),up=B([ip,ap,cp]),dp=B([up,ep,tp,np]),mp=fr.extend({mode:_("form").optional(),message:p(),requestedSchema:I({type:_("object"),properties:F(p(),dp),required:$(p()).optional()})}),pp=fr.extend({mode:_("url"),message:p(),elicitationId:p(),url:p().url()}),hp=B([mp,pp]),fp=ie.extend({method:_("elicitation/create"),params:hp}),gp=xe.extend({elicitationId:p()}),yp=Te.extend({method:_("notifications/elicitation/complete"),params:gp}),bp=ae.extend({action:fe(["accept","decline","cancel"]),content:vo(t=>t===null?void 0:t,F(p(),B([p(),L(),ne(),$(p())])).optional())}),Sp=I({type:_("ref/resource"),uri:p()});var wp=I({type:_("ref/prompt"),name:p()}),Mp=Se.extend({ref:B([wp,Sp]),argument:I({name:p(),value:p()}),context:I({arguments:F(p(),p()).optional()}).optional()}),xp=ie.extend({method:_("completion/complete"),params:Mp});var Tp=ae.extend({completion:he({values:$(p()).max(100),total:Y(L().int()),hasMore:Y(ne())})}),Ip=I({uri:p().startsWith("file://"),name:p().optional(),_meta:F(p(),G()).optional()}),Cp=ie.extend({method:_("roots/list"),params:Se.optional()}),_p=ae.extend({roots:$(Ip)}),Np=Te.extend({method:_("notifications/roots/list_changed"),params:xe.optional()}),PS=B([El,Jd,xp,qm,_m,Tm,sm,cm,mm,gm,bm,Um,km,zl,kl,Dl,Ul]),zS=B([Nl,Al,em,Np,Pl]),OS=B([_l,Hm,Xm,bp,_p,Ol,$l,Rl]),kS=B([El,Jm,fp,Cp,zl,kl,Dl,Ul]),DS=B([Nl,Al,Fm,wm,hm,Lm,Pm,Pl,yp]),$S=B([_l,Xd,Tp,Rm,Im,lm,um,pm,Ql,Dm,Ol,$l,Rl]),vn=class t extends Error{constructor(e,n,r){super(`MCP error ${e}: ${n}`),this.code=e,this.data=r,this.name="McpError"}static fromError(e,n,r){if(e===Tt.UrlElicitationRequired&&r){let o=r;if(o.elicitations)return new Eo(o.elicitations,n)}return new t(e,n,r)}},Eo=class extends vn{constructor(e,n=`URL elicitation${e.length>1?"s":""} required`){super(Tt.UrlElicitationRequired,n,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};var oc=require("url");var Vo={};Lr(Vo,{BRAND:()=>Xp,DIRTY:()=>It,EMPTY_PATH:()=>Rp,INVALID:()=>A,NEVER:()=>$h,OK:()=>de,ParseStatus:()=>se,Schema:()=>k,ZodAny:()=>at,ZodArray:()=>He,ZodBigInt:()=>_t,ZodBoolean:()=>Nt,ZodBranded:()=>kn,ZodCatch:()=>Ut,ZodDate:()=>vt,ZodDefault:()=>$t,ZodDiscriminatedUnion:()=>Sr,ZodEffects:()=>_e,ZodEnum:()=>kt,ZodError:()=>ge,ZodFirstPartyTypeKind:()=>P,ZodFunction:()=>Mr,ZodIntersection:()=>Pt,ZodIssueCode:()=>w,ZodLazy:()=>zt,ZodLiteral:()=>Ot,ZodMap:()=>nn,ZodNaN:()=>on,ZodNativeEnum:()=>Dt,ZodNever:()=>ze,ZodNull:()=>At,ZodNullable:()=>Le,ZodNumber:()=>Ct,ZodObject:()=>ye,ZodOptional:()=>Ie,ZodParsedType:()=>T,ZodPipeline:()=>Dn,ZodPromise:()=>st,ZodReadonly:()=>Lt,ZodRecord:()=>wr,ZodSchema:()=>k,ZodSet:()=>rn,ZodString:()=>it,ZodSymbol:()=>en,ZodTransformer:()=>_e,ZodTuple:()=>Ue,ZodType:()=>k,ZodUndefined:()=>Et,ZodUnion:()=>Rt,ZodUnknown:()=>Je,ZodVoid:()=>tn,addIssueToContext:()=>x,any:()=>lh,array:()=>mh,bigint:()=>rh,boolean:()=>nc,coerce:()=>Dh,custom:()=>Xl,date:()=>oh,datetimeRegex:()=>Jl,defaultErrorMap:()=>je,discriminatedUnion:()=>gh,effect:()=>vh,enum:()=>Ch,function:()=>xh,getErrorMap:()=>Jt,getParsedType:()=>$e,instanceof:()=>th,intersection:()=>yh,isAborted:()=>yr,isAsync:()=>Ht,isDirty:()=>br,isValid:()=>ot,late:()=>eh,lazy:()=>Th,literal:()=>Ih,makeIssue:()=>On,map:()=>wh,nan:()=>nh,nativeEnum:()=>_h,never:()=>uh,null:()=>sh,nullable:()=>Ah,number:()=>tc,object:()=>ph,objectUtil:()=>$o,oboolean:()=>kh,onumber:()=>Oh,optional:()=>Eh,ostring:()=>zh,pipeline:()=>Ph,preprocess:()=>Rh,promise:()=>Nh,quotelessJson:()=>vp,record:()=>Sh,set:()=>Mh,setErrorMap:()=>Ap,strictObject:()=>hh,string:()=>ec,symbol:()=>ih,transformer:()=>vh,tuple:()=>bh,undefined:()=>ah,union:()=>fh,unknown:()=>ch,util:()=>D,void:()=>dh});var D;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{let i={};for(let a of o)i[a]=a;return i},t.getValidEnumValues=o=>{let i=t.objectKeys(o).filter(s=>typeof o[o[s]]!="number"),a={};for(let s of i)a[s]=o[s];return t.objectValues(a)},t.objectValues=o=>t.objectKeys(o).map(function(i){return o[i]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let a in o)Object.prototype.hasOwnProperty.call(o,a)&&i.push(a);return i},t.find=(o,i)=>{for(let a of o)if(i(a))return a},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,i=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(D||(D={}));var $o;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})($o||($o={}));var T=D.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$e=t=>{switch(typeof t){case"undefined":return T.undefined;case"string":return T.string;case"number":return Number.isNaN(t)?T.nan:T.number;case"boolean":return T.boolean;case"function":return T.function;case"bigint":return T.bigint;case"symbol":return T.symbol;case"object":return Array.isArray(t)?T.array:t===null?T.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?T.promise:typeof Map<"u"&&t instanceof Map?T.map:typeof Set<"u"&&t instanceof Set?T.set:typeof Date<"u"&&t instanceof Date?T.date:T.object;default:return T.unknown}};var w=D.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),vp=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),ge=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(i){return i.message},r={_errors:[]},o=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let s=r,l=0;for(;l<a.path.length;){let c=a.path[l];l===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(n(a))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return o(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,D.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];n[i]=n[i]||[],n[i].push(e(o))}else r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};ge.create=t=>new ge(t);var Ep=(t,e)=>{let n;switch(t.code){case w.invalid_type:t.received===T.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case w.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,D.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:n=`Unrecognized key(s) in object: ${D.joinValues(t.keys,", ")}`;break;case w.invalid_union:n="Invalid input";break;case w.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${D.joinValues(t.options)}`;break;case w.invalid_enum_value:n=`Invalid enum value. Expected ${D.joinValues(t.options)}, received '${t.received}'`;break;case w.invalid_arguments:n="Invalid function arguments";break;case w.invalid_return_type:n="Invalid function return type";break;case w.invalid_date:n="Invalid date";break;case w.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:D.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case w.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case w.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case w.custom:n="Invalid input";break;case w.invalid_intersection_types:n="Intersection results could not be merged";break;case w.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case w.not_finite:n="Number must be finite";break;default:n=e.defaultError,D.assertNever(t)}return{message:n}},je=Ep;var Kl=je;function Ap(t){Kl=t}function Jt(){return Kl}var On=t=>{let{data:e,path:n,errorMaps:r,issueData:o}=t,i=[...n,...o.path||[]],a={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let s="",l=r.filter(c=>!!c).slice().reverse();for(let c of l)s=c(a,{data:e,defaultError:s}).message;return{...o,path:i,message:s}},Rp=[];function x(t,e){let n=Jt(),r=On({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===je?void 0:je].filter(o=>!!o)});t.common.issues.push(r)}var se=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let o of n){if(o.status==="aborted")return A;o.status==="dirty"&&e.dirty(),r.push(o.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let o of n){let i=await o.key,a=await o.value;r.push({key:i,value:a})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let o of n){let{key:i,value:a}=o;if(i.status==="aborted"||a.status==="aborted")return A;i.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet)&&(r[i.value]=a.value)}return{status:e.value,value:r}}},A=Object.freeze({status:"aborted"}),It=t=>({status:"dirty",value:t}),de=t=>({status:"valid",value:t}),yr=t=>t.status==="aborted",br=t=>t.status==="dirty",ot=t=>t.status==="valid",Ht=t=>typeof Promise<"u"&&t instanceof Promise;var C;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(C||(C={}));var Ce=class{constructor(e,n,r,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Gl=(t,e)=>{if(ot(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new ge(t.common.issues);return this._error=n,this._error}}};function O(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:o}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(a,s)=>{let{message:l}=t;return a.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??r??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:l??n??s.defaultError}},description:o}}var k=class{get description(){return this._def.description}_getType(e){return $e(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:$e(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new se,ctx:{common:e.parent.common,data:e.data,parsedType:$e(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(Ht(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$e(e)},o=this._parseSync({data:e,path:r.path,parent:r});return Gl(r,o)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$e(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return ot(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>ot(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$e(e)},o=this._parse({data:e,path:r.path,parent:r}),i=await(Ht(o)?o:Promise.resolve(o));return Gl(r,i)}refine(e,n){let r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,i)=>{let a=e(o),s=()=>i.addIssue({code:w.custom,...r(o)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(e,n){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(e){return new _e({schema:this,typeName:P.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Ie.create(this,this._def)}nullable(){return Le.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return He.create(this)}promise(){return st.create(this,this._def)}or(e){return Rt.create([this,e],this._def)}and(e){return Pt.create(this,e,this._def)}transform(e){return new _e({...O(this._def),schema:this,typeName:P.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new $t({...O(this._def),innerType:this,defaultValue:n,typeName:P.ZodDefault})}brand(){return new kn({typeName:P.ZodBranded,type:this,...O(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Ut({...O(this._def),innerType:this,catchValue:n,typeName:P.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Dn.create(this,e)}readonly(){return Lt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Pp=/^c[^\s-]{8,}$/i,zp=/^[0-9a-z]+$/,Op=/^[0-9A-HJKMNP-TV-Z]{26}$/i,kp=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Dp=/^[a-z0-9_-]{21}$/i,$p=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Up=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Lp=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Vp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Uo,qp=/^(?:(?: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])$/,Zp=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,Fp=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Qp=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Bp=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Kp=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,jl="((\\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])))",Gp=new RegExp(`^${jl}$`);function Wl(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Yp(t){return new RegExp(`^${Wl(t)}$`)}function Jl(t){let e=`${jl}T${Wl(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function jp(t,e){return!!((e==="v4"||!e)&&qp.test(t)||(e==="v6"||!e)&&Fp.test(t))}function Wp(t,e){if(!$p.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function Jp(t,e){return!!((e==="v4"||!e)&&Zp.test(t)||(e==="v6"||!e)&&Qp.test(t))}var it=class t extends k{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==T.string){let i=this._getOrReturnCtx(e);return x(i,{code:w.invalid_type,expected:T.string,received:i.parsedType}),A}let r=new se,o;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:w.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:w.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){let a=e.data.length>i.value,s=e.data.length<i.value;(a||s)&&(o=this._getOrReturnCtx(e,o),a?x(o,{code:w.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&x(o,{code:w.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")Lp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"email",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Uo||(Uo=new RegExp(Vp,"u")),Uo.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"emoji",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")kp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"uuid",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")Dp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"nanoid",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")Pp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"cuid",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")zp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"cuid2",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")Op.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"ulid",code:w.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),x(o,{validation:"url",code:w.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"regex",code:w.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?Jl(i).test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?Gp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?Yp(i).test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{code:w.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?Up.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"duration",code:w.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?jp(e.data,i.version)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"ip",code:w.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?Wp(e.data,i.alg)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"jwt",code:w.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?Jp(e.data,i.version)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"cidr",code:w.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?Bp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"base64",code:w.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?Kp.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"base64url",code:w.invalid_string,message:i.message}),r.dirty()):D.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(o=>e.test(o),{validation:n,code:w.invalid_string,...C.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...C.errToObj(e)})}url(e){return this._addCheck({kind:"url",...C.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...C.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...C.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...C.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...C.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...C.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...C.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...C.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...C.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...C.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...C.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...C.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...C.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...C.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...C.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...C.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...C.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...C.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...C.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...C.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...C.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...C.errToObj(n)})}nonempty(e){return this.min(1,C.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};it.create=t=>new it({checks:[],typeName:P.ZodString,coerce:t?.coerce??!1,...O(t)});function Hp(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,i=Number.parseInt(t.toFixed(o).replace(".","")),a=Number.parseInt(e.toFixed(o).replace(".",""));return i%a/10**o}var Ct=class t extends k{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==T.number){let i=this._getOrReturnCtx(e);return x(i,{code:w.invalid_type,expected:T.number,received:i.parsedType}),A}let r,o=new se;for(let i of this._def.checks)i.kind==="int"?D.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),x(r,{code:w.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?Hp(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),x(r,{code:w.not_finite,message:i.message}),o.dirty()):D.assertNever(i);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,C.toString(n))}gt(e,n){return this.setLimit("min",e,!1,C.toString(n))}lte(e,n){return this.setLimit("max",e,!0,C.toString(n))}lt(e,n){return this.setLimit("max",e,!1,C.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:C.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:C.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:C.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:C.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:C.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:C.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:C.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:C.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:C.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:C.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&D.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};Ct.create=t=>new Ct({checks:[],typeName:P.ZodNumber,coerce:t?.coerce||!1,...O(t)});var _t=class t extends k{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==T.bigint)return this._getInvalidInput(e);let r,o=new se;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),x(r,{code:w.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):D.assertNever(i);return{status:o.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return x(n,{code:w.invalid_type,expected:T.bigint,received:n.parsedType}),A}gte(e,n){return this.setLimit("min",e,!0,C.toString(n))}gt(e,n){return this.setLimit("min",e,!1,C.toString(n))}lte(e,n){return this.setLimit("max",e,!0,C.toString(n))}lt(e,n){return this.setLimit("max",e,!1,C.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:C.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:C.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:C.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:C.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:C.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:C.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};_t.create=t=>new _t({checks:[],typeName:P.ZodBigInt,coerce:t?.coerce??!1,...O(t)});var Nt=class extends k{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==T.boolean){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.boolean,received:r.parsedType}),A}return de(e.data)}};Nt.create=t=>new Nt({typeName:P.ZodBoolean,coerce:t?.coerce||!1,...O(t)});var vt=class t extends k{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==T.date){let i=this._getOrReturnCtx(e);return x(i,{code:w.invalid_type,expected:T.date,received:i.parsedType}),A}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return x(i,{code:w.invalid_date}),A}let r=new se,o;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:w.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:w.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):D.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:C.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:C.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};vt.create=t=>new vt({checks:[],coerce:t?.coerce||!1,typeName:P.ZodDate,...O(t)});var en=class extends k{_parse(e){if(this._getType(e)!==T.symbol){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.symbol,received:r.parsedType}),A}return de(e.data)}};en.create=t=>new en({typeName:P.ZodSymbol,...O(t)});var Et=class extends k{_parse(e){if(this._getType(e)!==T.undefined){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.undefined,received:r.parsedType}),A}return de(e.data)}};Et.create=t=>new Et({typeName:P.ZodUndefined,...O(t)});var At=class extends k{_parse(e){if(this._getType(e)!==T.null){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.null,received:r.parsedType}),A}return de(e.data)}};At.create=t=>new At({typeName:P.ZodNull,...O(t)});var at=class extends k{constructor(){super(...arguments),this._any=!0}_parse(e){return de(e.data)}};at.create=t=>new at({typeName:P.ZodAny,...O(t)});var Je=class extends k{constructor(){super(...arguments),this._unknown=!0}_parse(e){return de(e.data)}};Je.create=t=>new Je({typeName:P.ZodUnknown,...O(t)});var ze=class extends k{_parse(e){let n=this._getOrReturnCtx(e);return x(n,{code:w.invalid_type,expected:T.never,received:n.parsedType}),A}};ze.create=t=>new ze({typeName:P.ZodNever,...O(t)});var tn=class extends k{_parse(e){if(this._getType(e)!==T.undefined){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.void,received:r.parsedType}),A}return de(e.data)}};tn.create=t=>new tn({typeName:P.ZodVoid,...O(t)});var He=class t extends k{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==T.array)return x(n,{code:w.invalid_type,expected:T.array,received:n.parsedType}),A;if(o.exactLength!==null){let a=n.data.length>o.exactLength.value,s=n.data.length<o.exactLength.value;(a||s)&&(x(n,{code:a?w.too_big:w.too_small,minimum:s?o.exactLength.value:void 0,maximum:a?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(x(n,{code:w.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(x(n,{code:w.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>o.type._parseAsync(new Ce(n,a,n.path,s)))).then(a=>se.mergeArray(r,a));let i=[...n.data].map((a,s)=>o.type._parseSync(new Ce(n,a,n.path,s)));return se.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:C.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:C.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:C.toString(n)}})}nonempty(e){return this.min(1,e)}};He.create=(t,e)=>new He({type:t,minLength:null,maxLength:null,exactLength:null,typeName:P.ZodArray,...O(e)});function Xt(t){if(t instanceof ye){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=Ie.create(Xt(r))}return new ye({...t._def,shape:()=>e})}else return t instanceof He?new He({...t._def,type:Xt(t.element)}):t instanceof Ie?Ie.create(Xt(t.unwrap())):t instanceof Le?Le.create(Xt(t.unwrap())):t instanceof Ue?Ue.create(t.items.map(e=>Xt(e))):t}var ye=class t extends k{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=D.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==T.object){let c=this._getOrReturnCtx(e);return x(c,{code:w.invalid_type,expected:T.object,received:c.parsedType}),A}let{status:r,ctx:o}=this._processInputParams(e),{shape:i,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof ze&&this._def.unknownKeys==="strip"))for(let c in o.data)a.includes(c)||s.push(c);let l=[];for(let c of a){let m=i[c],d=o.data[c];l.push({key:{status:"valid",value:c},value:m._parse(new Ce(o,d,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof ze){let c=this._def.unknownKeys;if(c==="passthrough")for(let m of s)l.push({key:{status:"valid",value:m},value:{status:"valid",value:o.data[m]}});else if(c==="strict")s.length>0&&(x(o,{code:w.unrecognized_keys,keys:s}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let m of s){let d=o.data[m];l.push({key:{status:"valid",value:m},value:c._parse(new Ce(o,d,o.path,m)),alwaysSet:m in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let c=[];for(let m of l){let d=await m.key,h=await m.value;c.push({key:d,value:h,alwaysSet:m.alwaysSet})}return c}).then(c=>se.mergeObjectSync(r,c)):se.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return C.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let o=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:C.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:P.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of D.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of D.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return Xt(this)}partial(e){let n={};for(let r of D.objectKeys(this.shape)){let o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of D.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Ie;)i=i._def.innerType;n[r]=i}return new t({...this._def,shape:()=>n})}keyof(){return Hl(D.objectKeys(this.shape))}};ye.create=(t,e)=>new ye({shape:()=>t,unknownKeys:"strip",catchall:ze.create(),typeName:P.ZodObject,...O(e)});ye.strictCreate=(t,e)=>new ye({shape:()=>t,unknownKeys:"strict",catchall:ze.create(),typeName:P.ZodObject,...O(e)});ye.lazycreate=(t,e)=>new ye({shape:t,unknownKeys:"strip",catchall:ze.create(),typeName:P.ZodObject,...O(e)});var Rt=class extends k{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function o(i){for(let s of i)if(s.result.status==="valid")return s.result;for(let s of i)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(s=>new ge(s.ctx.common.issues));return x(n,{code:w.invalid_union,unionErrors:a}),A}if(n.common.async)return Promise.all(r.map(async i=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(o);{let i,a=[];for(let l of r){let c={...n,common:{...n.common,issues:[]},parent:null},m=l._parseSync({data:n.data,path:n.path,parent:c});if(m.status==="valid")return m;m.status==="dirty"&&!i&&(i={result:m,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let s=a.map(l=>new ge(l));return x(n,{code:w.invalid_union,unionErrors:s}),A}}get options(){return this._def.options}};Rt.create=(t,e)=>new Rt({options:t,typeName:P.ZodUnion,...O(e)});var We=t=>t instanceof zt?We(t.schema):t instanceof _e?We(t.innerType()):t instanceof Ot?[t.value]:t instanceof kt?t.options:t instanceof Dt?D.objectValues(t.enum):t instanceof $t?We(t._def.innerType):t instanceof Et?[void 0]:t instanceof At?[null]:t instanceof Ie?[void 0,...We(t.unwrap())]:t instanceof Le?[null,...We(t.unwrap())]:t instanceof kn||t instanceof Lt?We(t.unwrap()):t instanceof Ut?We(t._def.innerType):[],Sr=class t extends k{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==T.object)return x(n,{code:w.invalid_type,expected:T.object,received:n.parsedType}),A;let r=this.discriminator,o=n.data[r],i=this.optionsMap.get(o);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(x(n,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),A)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let o=new Map;for(let i of n){let a=We(i.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of a){if(o.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);o.set(s,i)}}return new t({typeName:P.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:o,...O(r)})}};function Lo(t,e){let n=$e(t),r=$e(e);if(t===e)return{valid:!0,data:t};if(n===T.object&&r===T.object){let o=D.objectKeys(e),i=D.objectKeys(t).filter(s=>o.indexOf(s)!==-1),a={...t,...e};for(let s of i){let l=Lo(t[s],e[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(n===T.array&&r===T.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let i=0;i<t.length;i++){let a=t[i],s=e[i],l=Lo(a,s);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return n===T.date&&r===T.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Pt=class extends k{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=(i,a)=>{if(yr(i)||yr(a))return A;let s=Lo(i.value,a.value);return s.valid?((br(i)||br(a))&&n.dirty(),{status:n.value,value:s.data}):(x(r,{code:w.invalid_intersection_types}),A)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,a])=>o(i,a)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Pt.create=(t,e,n)=>new Pt({left:t,right:e,typeName:P.ZodIntersection,...O(n)});var Ue=class t extends k{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==T.array)return x(r,{code:w.invalid_type,expected:T.array,received:r.parsedType}),A;if(r.data.length<this._def.items.length)return x(r,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),A;!this._def.rest&&r.data.length>this._def.items.length&&(x(r,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...r.data].map((a,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new Ce(r,a,r.path,s)):null}).filter(a=>!!a);return r.common.async?Promise.all(i).then(a=>se.mergeArray(n,a)):se.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Ue.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ue({items:t,typeName:P.ZodTuple,rest:null,...O(e)})};var wr=class t extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==T.object)return x(r,{code:w.invalid_type,expected:T.object,received:r.parsedType}),A;let o=[],i=this._def.keyType,a=this._def.valueType;for(let s in r.data)o.push({key:i._parse(new Ce(r,s,r.path,s)),value:a._parse(new Ce(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?se.mergeObjectAsync(n,o):se.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof k?new t({keyType:e,valueType:n,typeName:P.ZodRecord,...O(r)}):new t({keyType:it.create(),valueType:e,typeName:P.ZodRecord,...O(n)})}},nn=class extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==T.map)return x(r,{code:w.invalid_type,expected:T.map,received:r.parsedType}),A;let o=this._def.keyType,i=this._def.valueType,a=[...r.data.entries()].map(([s,l],c)=>({key:o._parse(new Ce(r,s,r.path,[c,"key"])),value:i._parse(new Ce(r,l,r.path,[c,"value"]))}));if(r.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let l of a){let c=await l.key,m=await l.value;if(c.status==="aborted"||m.status==="aborted")return A;(c.status==="dirty"||m.status==="dirty")&&n.dirty(),s.set(c.value,m.value)}return{status:n.value,value:s}})}else{let s=new Map;for(let l of a){let c=l.key,m=l.value;if(c.status==="aborted"||m.status==="aborted")return A;(c.status==="dirty"||m.status==="dirty")&&n.dirty(),s.set(c.value,m.value)}return{status:n.value,value:s}}}};nn.create=(t,e,n)=>new nn({valueType:e,keyType:t,typeName:P.ZodMap,...O(n)});var rn=class t extends k{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==T.set)return x(r,{code:w.invalid_type,expected:T.set,received:r.parsedType}),A;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(x(r,{code:w.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(x(r,{code:w.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());let i=this._def.valueType;function a(l){let c=new Set;for(let m of l){if(m.status==="aborted")return A;m.status==="dirty"&&n.dirty(),c.add(m.value)}return{status:n.value,value:c}}let s=[...r.data.values()].map((l,c)=>i._parse(new Ce(r,l,r.path,c)));return r.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(e,n){return new t({...this._def,minSize:{value:e,message:C.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:C.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};rn.create=(t,e)=>new rn({valueType:t,minSize:null,maxSize:null,typeName:P.ZodSet,...O(e)});var Mr=class t extends k{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==T.function)return x(n,{code:w.invalid_type,expected:T.function,received:n.parsedType}),A;function r(s,l){return On({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Jt(),je].filter(c=>!!c),issueData:{code:w.invalid_arguments,argumentsError:l}})}function o(s,l){return On({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Jt(),je].filter(c=>!!c),issueData:{code:w.invalid_return_type,returnTypeError:l}})}let i={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof st){let s=this;return de(async function(...l){let c=new ge([]),m=await s._def.args.parseAsync(l,i).catch(g=>{throw c.addIssue(r(l,g)),c}),d=await Reflect.apply(a,this,m);return await s._def.returns._def.type.parseAsync(d,i).catch(g=>{throw c.addIssue(o(d,g)),c})})}else{let s=this;return de(function(...l){let c=s._def.args.safeParse(l,i);if(!c.success)throw new ge([r(l,c.error)]);let m=Reflect.apply(a,this,c.data),d=s._def.returns.safeParse(m,i);if(!d.success)throw new ge([o(m,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Ue.create(e).rest(Je.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||Ue.create([]).rest(Je.create()),returns:n||Je.create(),typeName:P.ZodFunction,...O(r)})}},zt=class extends k{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};zt.create=(t,e)=>new zt({getter:t,typeName:P.ZodLazy,...O(e)});var Ot=class extends k{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return x(n,{received:n.data,code:w.invalid_literal,expected:this._def.value}),A}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ot.create=(t,e)=>new Ot({value:t,typeName:P.ZodLiteral,...O(e)});function Hl(t,e){return new kt({values:t,typeName:P.ZodEnum,...O(e)})}var kt=class t extends k{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return x(n,{expected:D.joinValues(r),received:n.parsedType,code:w.invalid_type}),A}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return x(n,{received:n.data,code:w.invalid_enum_value,options:r}),A}return de(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};kt.create=Hl;var Dt=class extends k{_parse(e){let n=D.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==T.string&&r.parsedType!==T.number){let o=D.objectValues(n);return x(r,{expected:D.joinValues(o),received:r.parsedType,code:w.invalid_type}),A}if(this._cache||(this._cache=new Set(D.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=D.objectValues(n);return x(r,{received:r.data,code:w.invalid_enum_value,options:o}),A}return de(e.data)}get enum(){return this._def.values}};Dt.create=(t,e)=>new Dt({values:t,typeName:P.ZodNativeEnum,...O(e)});var st=class extends k{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==T.promise&&n.common.async===!1)return x(n,{code:w.invalid_type,expected:T.promise,received:n.parsedType}),A;let r=n.parsedType===T.promise?n.data:Promise.resolve(n.data);return de(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}};st.create=(t,e)=>new st({type:t,typeName:P.ZodPromise,...O(e)});var _e=class extends k{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===P.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,i={addIssue:a=>{x(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let a=o.transform(r.data,i);if(r.common.async)return Promise.resolve(a).then(async s=>{if(n.value==="aborted")return A;let l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?A:l.status==="dirty"?It(l.value):n.value==="dirty"?It(l.value):l});{if(n.value==="aborted")return A;let s=this._def.schema._parseSync({data:a,path:r.path,parent:r});return s.status==="aborted"?A:s.status==="dirty"?It(s.value):n.value==="dirty"?It(s.value):s}}if(o.type==="refinement"){let a=s=>{let l=o.refinement(s,i);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?A:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?A:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(o.type==="transform")if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ot(a))return A;let s=o.transform(a.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>ot(a)?Promise.resolve(o.transform(a.value,i)).then(s=>({status:n.value,value:s})):A);D.assertNever(o)}};_e.create=(t,e,n)=>new _e({schema:t,typeName:P.ZodEffects,effect:e,...O(n)});_e.createWithPreprocess=(t,e,n)=>new _e({schema:e,effect:{type:"preprocess",transform:t},typeName:P.ZodEffects,...O(n)});var Ie=class extends k{_parse(e){return this._getType(e)===T.undefined?de(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ie.create=(t,e)=>new Ie({innerType:t,typeName:P.ZodOptional,...O(e)});var Le=class extends k{_parse(e){return this._getType(e)===T.null?de(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Le.create=(t,e)=>new Le({innerType:t,typeName:P.ZodNullable,...O(e)});var $t=class extends k{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===T.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};$t.create=(t,e)=>new $t({innerType:t,typeName:P.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...O(e)});var Ut=class extends k{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Ht(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ge(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ge(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Ut.create=(t,e)=>new Ut({innerType:t,typeName:P.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...O(e)});var on=class extends k{_parse(e){if(this._getType(e)!==T.nan){let r=this._getOrReturnCtx(e);return x(r,{code:w.invalid_type,expected:T.nan,received:r.parsedType}),A}return{status:"valid",value:e.data}}};on.create=t=>new on({typeName:P.ZodNaN,...O(t)});var Xp=Symbol("zod_brand"),kn=class extends k{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Dn=class t extends k{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?A:i.status==="dirty"?(n.dirty(),It(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?A:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:P.ZodPipeline})}},Lt=class extends k{_parse(e){let n=this._def.innerType._parse(e),r=o=>(ot(o)&&(o.value=Object.freeze(o.value)),o);return Ht(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}};Lt.create=(t,e)=>new Lt({innerType:t,typeName:P.ZodReadonly,...O(e)});function Yl(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function Xl(t,e={},n){return t?at.create().superRefine((r,o)=>{let i=t(r);if(i instanceof Promise)return i.then(a=>{if(!a){let s=Yl(e,r),l=s.fatal??n??!0;o.addIssue({code:"custom",...s,fatal:l})}});if(!i){let a=Yl(e,r),s=a.fatal??n??!0;o.addIssue({code:"custom",...a,fatal:s})}}):at.create()}var eh={object:ye.lazycreate},P;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(P||(P={}));var th=(t,e={message:`Input not instance of ${t.name}`})=>Xl(n=>n instanceof t,e),ec=it.create,tc=Ct.create,nh=on.create,rh=_t.create,nc=Nt.create,oh=vt.create,ih=en.create,ah=Et.create,sh=At.create,lh=at.create,ch=Je.create,uh=ze.create,dh=tn.create,mh=He.create,ph=ye.create,hh=ye.strictCreate,fh=Rt.create,gh=Sr.create,yh=Pt.create,bh=Ue.create,Sh=wr.create,wh=nn.create,Mh=rn.create,xh=Mr.create,Th=zt.create,Ih=Ot.create,Ch=kt.create,_h=Dt.create,Nh=st.create,vh=_e.create,Eh=Ie.create,Ah=Le.create,Rh=_e.createWithPreprocess,Ph=Dn.create,zh=()=>ec().optional(),Oh=()=>tc().optional(),kh=()=>nc().optional(),Dh={string:(t=>it.create({...t,coerce:!0})),number:(t=>Ct.create({...t,coerce:!0})),boolean:(t=>Nt.create({...t,coerce:!0})),bigint:(t=>_t.create({...t,coerce:!0})),date:(t=>vt.create({...t,coerce:!0}))};var $h=A;var rc=Vo;var Uh={ResourceNotFound:-32002,InvalidParams:Tt.InvalidParams,InternalError:Tt.InternalError};var gw=rc.string().regex(/^#[0-9A-Fa-f]{6}$/,"Color must be in hex format (e.g., #FFFFFF).");var ic=t=>t.startsWith("file://")?(0,oc.fileURLToPath)(t):t;var qo=t=>new vn(Uh.InvalidParams,t);var le=[];for(let t=0;t<256;++t)le.push((t+256).toString(16).slice(1));function ac(t,e=0){return(le[t[e+0]]+le[t[e+1]]+le[t[e+2]]+le[t[e+3]]+"-"+le[t[e+4]]+le[t[e+5]]+"-"+le[t[e+6]]+le[t[e+7]]+"-"+le[t[e+8]]+le[t[e+9]]+"-"+le[t[e+10]]+le[t[e+11]]+le[t[e+12]]+le[t[e+13]]+le[t[e+14]]+le[t[e+15]]).toLowerCase()}var Lh=new Uint8Array(16);function Zo(){return crypto.getRandomValues(Lh)}function Vh(t,e,n){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():qh(t,e,n)}function qh(t,e,n){t=t||{};let r=t.random??t.rng?.()??Zo();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){if(n=n||0,n<0||n+16>e.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let o=0;o<16;++o)e[n+o]=r[o];return e}return ac(r)}var X=Vh;var Zh={equalsEntries(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],o=e[n];if(r.modelType!==o.modelType||r.modelType==="single"&&o.modelType==="single"&&r.columnModelId!==o.columnModelId||r.modelType==="group"&&o.modelType==="group"&&r.columnGroupId!==o.columnGroupId)return!1}return!0},serializeEntries(t){return t.map(e=>e.modelType==="group"?`group:${e.columnGroupId}`:e.columnModelId)},deserializeEntries(t){return t.map(e=>e.startsWith("group:")?{modelType:"group",columnGroupId:e.substring(6)}:{modelType:"single",columnModelId:e})}},lt=Zh;var $n=class extends Error{constructor(e){super(e)}},xr=class extends $n{constructor(e,n){super(`Not exists property '${e}' in object : ${n}`),this.propertyName=e}},Tr=class extends $n{constructor(e,n){super(`The property '${e}' is not array : ${n}`),this.propertyName=e}},Ir=class extends $n{constructor(e,n){super(`The property '${e}' is not Object : ${n}`),this.propertyName=e}};function S(t,e){if(!(e in t))throw new xr(e,t)}function j(t,e,n){if(Fh(t)===!1)throw new Tr(e,t);if(t.length===0)return[];if(Qh(t)===!1)throw new Ir(e,t);return t.map(r=>n(r))}function Fh(t){return Array.isArray(t)}function Qh(t){return t.every(e=>typeof e=="object"&&e!==null)}function Ve(t,e=null){return t==null?e??new Date:t instanceof Date?t:typeof t=="string"?new Date(t):new Date}var ct=class t{constructor({structShareModelId:e="",physicalName:n="",logicalName:r="",columnEntries:o=[],isArray:i=!1,description:a=""}){this.structShareModelId=e||X(),this.physicalName=n.trim(),this.logicalName=r.trim(),this.columnEntries=o,this.isArray=i,this.description=a.trim()}simpleColumnType(){return this.isArray===!0?"ARRAY<STRUCT>":"STRUCT"}toJSON(){let e=lt.serializeEntries(this.columnEntries);return{structShareModelId:this.structShareModelId,physicalName:this.physicalName,...this.logicalName!==""&&{logicalName:this.logicalName},columnModelIds:e,...this.isArray===!0&&{isArray:this.isArray},...this.description!==""&&{description:this.description}}}static toObject(e){S(e,"structShareModelId"),S(e,"physicalName"),S(e,"columnModelIds");let n="logicalName"in e?e.logicalName:"",r=lt.deserializeEntries(e.columnModelIds),o="isArray"in e?e.isArray:!1,i="description"in e?e.description:"";return new t({structShareModelId:e.structShareModelId,physicalName:e.physicalName,logicalName:n,columnEntries:r,isArray:o,description:i})}equals(e){return this.structShareModelId!==e.structShareModelId||this.physicalName!==e.physicalName||this.logicalName!==e.logicalName||this.description!==e.description||this.isArray!==e.isArray?!1:lt.equalsEntries(this.columnEntries,e.columnEntries)}};function Xe(t,e){return t.size!==e.size?!1:Array.from(t.entries()).every(([n,r])=>{let o=e.get(n);return o!=null&&r.equals(o)})}function Vt(t,e){let n=t.size===e.size,r=Array.from(e.entries()).map(([o,i])=>{let a=t.get(o);return a!=null&&a.equals(i)?[o,a]:(n=!1,[o,i])});return n?t:new Map(r)}function Fo(t,e){return an(t,e)?t:e}function an(t,e){return t.length!==e.length?!1:t.every((n,r)=>n===e[r])}var Un=class t{constructor(e,n){this.columnShareModelMap=e,this.structShareModelMap=n}static create(e=null,n=null){let r=new Map(e==null?[]:e.map(i=>[i.columnShareModelId,i])),o=new Map(n==null?[]:n.map(i=>[i.structShareModelId,i]));return new t(r,o)}getColumnShareModels(){return Array.from(this.columnShareModelMap.values()).sort((e,n)=>{let r=e.physicalName.localeCompare(n.physicalName,"en");if(r!==0)return r;let o=e.logicalName.localeCompare(n.logicalName,"en");if(o!==0)return o;let i=e.columnType.name.localeCompare(n.columnType.name,"en");return i!==0?i:e.columnShareModelId.localeCompare(n.columnShareModelId,"en")})}findColumnShare(e){if(e==="")return null;let n=this.columnShareModelMap.get(e);return n??null}addColumnShare(...e){if(e.length===0)return this;let n=new Map(this.columnShareModelMap);return e.forEach(r=>n.set(r.columnShareModelId,r)),new t(n,this.structShareModelMap)}getStructShareModels(){return this.structShareModelMap.size===0?[]:Array.from(this.structShareModelMap.values()).sort((e,n)=>{let r=e.physicalName.localeCompare(n.physicalName,"en");return r!==0?r:e.structShareModelId.localeCompare(n.structShareModelId,"en")})}findStructShare(e){if(e==="")return null;let n=this.structShareModelMap.get(e);return n??null}addStructShare(...e){if(e.length===0)return this;let n=new Map(this.structShareModelMap);return e.forEach(r=>n.set(r.structShareModelId,r)),new t(this.columnShareModelMap,n)}deleteStructShare(e){if(e.length===0)return this;let n=new Map(this.structShareModelMap);return e.forEach(r=>n.delete(r)),new t(this.columnShareModelMap,n)}retain(e,n,r,o){let i=Array.from(this.columnShareModelMap.keys()).filter(s=>e.has(s)===!1),a=Array.from(this.structShareModelMap.keys()).filter(s=>n.has(s)===!1);return this.deleteColumnShare(i).deleteStructShare(a).deleteDanglingColumnEntries(r,o)}deleteColumnShare(e){if(e.length===0)return this;let n=new Map(this.columnShareModelMap);return e.forEach(r=>n.delete(r)),new t(n,this.structShareModelMap)}deleteDanglingColumnEntries(e,n){let r=!1,o=new Map(this.structShareModelMap);for(let[i,a]of this.structShareModelMap.entries()){let s=a.columnEntries.filter(c=>c.modelType==="single"?e.has(c.columnModelId):n.has(c.columnGroupId));if(s.length===a.columnEntries.length)continue;r=!0;let l=new ct({...a,columnEntries:s});o.set(i,l)}return r?new t(this.columnShareModelMap,o):this}copy(){return new t(new Map(this.columnShareModelMap),new Map(this.structShareModelMap))}equals(e){return Xe(this.columnShareModelMap,e.columnShareModelMap)&&Xe(this.structShareModelMap,e.structShareModelMap)}reuseInstancesFrom(e){let n=Vt(e.columnShareModelMap,this.columnShareModelMap),r=Vt(e.structShareModelMap,this.structShareModelMap);return(n===e.columnShareModelMap&&r===e.structShareModelMap)===!0?e:new t(new Map(n),new Map(r))}};var sn=class t{constructor({columnGroupId:e="",groupName:n="",columnModelIds:r=[],description:o=""}){this.columnGroupId=e||X(),this.groupName=n.trim(),this.columnModelIds=[...r],this.description=o}toJSON(){return{columnGroupId:this.columnGroupId,groupName:this.groupName,columnModelIds:this.columnModelIds,...this.description!==""&&{description:this.description}}}static toObject(e){return S(e,"columnGroupId"),S(e,"groupName"),S(e,"columnModelIds"),new t({columnGroupId:e.columnGroupId,groupName:e.groupName,columnModelIds:e.columnModelIds,description:"description"in e?e.description:""})}equals(e){return this.columnGroupId===e.columnGroupId&&this.groupName===e.groupName&&this.description===e.description&&this.columnModelIds.length===e.columnModelIds.length&&this.columnModelIds.every((n,r)=>n===e.columnModelIds[r])}};var ut=class t{constructor(e){this.entityType="simple";this.columnModelId=e.columnModelId?e.columnModelId:X(),this.physicalName=(e.physicalName??"").trim(),this.logicalName=(e.logicalName??"").trim(),this.notNull=e.notNull??!1,this.columnShareModelId=e.columnShareModelId,this.primaryKey=e.primaryKey??!1,this.unique=e.unique??!1,this.autoIncrement=e.autoIncrement??!1,this.defaultValue=(e.defaultValue??"").trim()}toJSON(){return{columnModelId:this.columnModelId,columnShareModelId:this.columnShareModelId,...this.physicalName!==""&&{physicalName:this.physicalName},...this.logicalName!==""&&{logicalName:this.logicalName},...this.primaryKey&&{primaryKey:this.primaryKey},...this.notNull&&{notNull:this.notNull},...this.unique&&{unique:this.unique},...this.autoIncrement&&{autoIncrement:this.autoIncrement},...this.defaultValue!==""&&{defaultValue:this.defaultValue}}}static toObject(e){S(e,"columnModelId"),S(e,"columnShareModelId");let n="physicalName"in e?e.physicalName:"",r="logicalName"in e?e.logicalName:"",o="notNull"in e?e.notNull:!1,i="primaryKey"in e?e.primaryKey:!1,a="unique"in e?e.unique:!1,s="autoIncrement"in e?e.autoIncrement:!1,l="defaultValue"in e?e.defaultValue:"";return new t({columnModelId:e.columnModelId,columnShareModelId:e.columnShareModelId,physicalName:n,logicalName:r,primaryKey:i,notNull:o,unique:a,autoIncrement:s,defaultValue:l})}equals(e){return this.columnModelId===e.columnModelId&&this.physicalName===e.physicalName&&this.logicalName===e.logicalName&&this.notNull===e.notNull&&this.columnShareModelId===e.columnShareModelId&&this.primaryKey===e.primaryKey&&this.unique===e.unique&&this.autoIncrement===e.autoIncrement&&this.defaultValue===e.defaultValue}};var Ln=class t{constructor(e){this.entityType="struct";this.columnModelId=e.columnModelId?e.columnModelId:X(),this.physicalName=(e.physicalName??"").trim(),this.logicalName=(e.logicalName??"").trim(),this.notNull=e.notNull??!1,this.structShareModelId=e.structShareModelId}toJSON(){return{columnModelId:this.columnModelId,entityType:"struct",structShareModelId:this.structShareModelId,...this.physicalName!==""&&{physicalName:this.physicalName},...this.logicalName!==""&&{logicalName:this.logicalName},...this.notNull&&{notNull:this.notNull}}}static toObject(e){S(e,"columnModelId"),S(e,"structShareModelId");let n="physicalName"in e?e.physicalName:"",r="logicalName"in e?e.logicalName:"",o="notNull"in e?e.notNull:!1;return new t({columnModelId:e.columnModelId,physicalName:n,logicalName:r,notNull:o,structShareModelId:e.structShareModelId})}equals(e){return this.columnModelId===e.columnModelId&&this.physicalName===e.physicalName&&this.logicalName===e.logicalName&&this.notNull===e.notNull&&this.structShareModelId===e.structShareModelId}};var Vn={isSimpleColumn(t){return t.entityType==="simple"},isStructColumn(t){return t.entityType==="struct"},equals(t,e){return Vn.isSimpleColumn(t)&&Vn.isSimpleColumn(e)||Vn.isStructColumn(t)&&Vn.isStructColumn(e)?t.equals(e):!1},toObject(t){return("entityType"in t?t.entityType:"simple")==="struct"?Ln.toObject(t):ut.toObject(t)}},ce=Vn;var qn=class t{constructor({columnShareModelId:e,physicalName:n,logicalName:r,columnType:o,precision:i="",scale:a="",unsigned:s=!1,isArray:l=!1,description:c="",checkExpression:m="",characterSet:d="",collate:h="",optionExpression:g="",createdAt:b=null}){this.columnShareModelId=e,this.physicalName=n,this.logicalName=r,this.columnType=o,this.precision=o.withPrecision?i:"",this.scale=o.withScale?a:"",this.unsigned=o.withUnsigned?s:!1,this.isArray=l,this.description=c.trim(),this.checkExpression=m.trim(),this.characterSetValue=d.trim(),this.collateValue=h.trim(),this.optionExpression=g.trim(),this.createdAt=b||new Date}get collate(){return this.columnType.category==="text"?this.collateValue:""}characterSet(e){return this.columnType.category==="text"&&e.editableCharacterSet?this.characterSetValue:""}specifiedColumnType(e=!1){return this.columnType.specifiedType({precision:this.precision,scale:this.scale,isArray:this.isArray,inChildRelation:e})}matchForReferenceType(e){let n=this.specifiedColumnType(!0),r=e.specifiedColumnType(!0);return!(n!==r||this.columnType.withUnsigned&&this.unsigned!==e.unsigned)}toJSON(){return{columnShareModelId:this.columnShareModelId,physicalName:this.physicalName,logicalName:this.logicalName,columnTypeId:this.columnType.id,...this.precision!==""&&{precision:this.precision},...this.scale!==""&&{scale:this.scale},...this.unsigned&&{unsigned:this.unsigned},...this.isArray&&{isArray:this.isArray},...this.description!==""&&{description:this.description},...this.checkExpression!==""&&{checkExpression:this.checkExpression},...this.characterSetValue!==""&&this.columnType.category==="text"&&{characterSet:this.characterSetValue},...this.collateValue!==""&&this.columnType.category==="text"&&{collate:this.collateValue},...this.optionExpression!==""&&{optionExpression:this.optionExpression},createdAt:this.createdAt}}static toObject(e,n){return S(e,"columnShareModelId"),S(e,"physicalName"),S(e,"logicalName"),S(e,"columnTypeId"),new t({columnShareModelId:e.columnShareModelId,physicalName:e.physicalName,logicalName:e.logicalName,columnType:n(e.columnTypeId),precision:"precision"in e?e.precision:"",scale:"scale"in e?e.scale:"",unsigned:"unsigned"in e?e.unsigned:!1,isArray:"isArray"in e?e.isArray:!1,description:"description"in e?e.description:"",checkExpression:"checkExpression"in e?e.checkExpression:"",characterSet:"characterSet"in e?e.characterSet:"",collate:"collate"in e?e.collate:"",optionExpression:"optionExpression"in e?e.optionExpression:"",createdAt:"createdAt"in e?Ve(e.createdAt):new Date})}equals(e){return this.columnShareModelId===e.columnShareModelId&&this.physicalName===e.physicalName&&this.logicalName===e.logicalName&&this.columnType.id===e.columnType.id&&this.precision===e.precision&&this.scale===e.scale&&this.unsigned===e.unsigned&&this.isArray===e.isArray&&this.description===e.description&&this.checkExpression===e.checkExpression&&this.characterSetValue===e.characterSetValue&&this.collateValue===e.collateValue&&this.optionExpression===e.optionExpression}};var dt=class t{constructor({parentColumnModelId:e,childColumnModelId:n}){this.parentColumnModelId=e,this.childColumnModelId=n}toJSON(){return{parentColumnModelId:this.parentColumnModelId,childColumnModelId:this.childColumnModelId}}static toObject(e){return S(e,"parentColumnModelId"),S(e,"childColumnModelId"),new t({parentColumnModelId:e.parentColumnModelId,childColumnModelId:e.childColumnModelId})}equals(e){return this.parentColumnModelId===e.parentColumnModelId&&this.childColumnModelId===e.childColumnModelId}};var qe=class t{constructor({relationModelId:e="",relationName:n="",parentTableModelId:r,parentCardinality:o="1",childTableModelId:i,childCardinality:a="1",relationPairs:s=[],onUpdateAction:l="RESTRICT",onDeleteAction:c="RESTRICT"}){this.relationModelId=e||X(),this.relationName=n,this.parentTableModelId=r,this.parentCardinality=o,this.childTableModelId=i,this.childCardinality=a,this.relationPairs=[...s],this.onUpdateAction=l,this.onDeleteAction=c}toJSON(){return{relationModelId:this.relationModelId,...this.relationName!==""&&{relationName:this.relationName},parentTableModelId:this.parentTableModelId,parentCardinality:this.parentCardinality,childTableModelId:this.childTableModelId,childCardinality:this.childCardinality,relationPairs:this.relationPairs.map(e=>e.toJSON()),onUpdateAction:this.onUpdateAction,onDeleteAction:this.onDeleteAction}}static toObject(e){return S(e,"relationModelId"),S(e,"parentTableModelId"),S(e,"childTableModelId"),S(e,"relationPairs"),new t({relationModelId:e.relationModelId,relationName:"relationName"in e?e.relationName:"",parentTableModelId:e.parentTableModelId,parentCardinality:"parentCardinality"in e?e.parentCardinality:"1",childTableModelId:e.childTableModelId,childCardinality:"childCardinality"in e?e.childCardinality:"1",relationPairs:j(e.relationPairs,"relationPairs",n=>dt.toObject(n)),onUpdateAction:"onUpdateAction"in e?e.onUpdateAction:"RESTRICT",onDeleteAction:"onDeleteAction"in e?e.onDeleteAction:"RESTRICT"})}equals(e){if(this.relationModelId!==e.relationModelId||this.relationName!==e.relationName||this.parentTableModelId!==e.parentTableModelId||this.parentCardinality!==e.parentCardinality||this.childTableModelId!==e.childTableModelId||this.childCardinality!==e.childCardinality||this.relationPairs.length!==e.relationPairs.length)return!1;for(let n=0;n<this.relationPairs.length;n++)if(this.relationPairs[n].equals(e.relationPairs[n])===!1)return!1;return!(this.onUpdateAction!==e.onUpdateAction||this.onDeleteAction!==e.onDeleteAction)}};var mt=(t,e)=>{let n=t.physicalName!=""?t.physicalName:e.physicalName,r=t.logicalName!=""?t.logicalName:e.logicalName;return{physicalName:n,logicalName:r}};var pt=class t{constructor({tableIndexModelId:e,physicalName:n,indexColumnModels:r,indexOption:o="",indexType:i="",clustered:a=!1,description:s=""}){this.tableIndexModelId=e,this.physicalName=n.trim(),this.indexColumnModels=[...r],this.indexOption=o,this.indexType=i,this.clustered=a,this.description=s}static filterColumns(e,n){let r=!1;return{tableIndexModels:e.flatMap(i=>{let a=i.indexColumnModels.filter(n);return a.length===i.indexColumnModels.length?[i]:(r=!0,a.length===0?[]:[new t({...i,indexColumnModels:a})])}),hasChanged:r}}toJSON(){return{tableIndexModelId:this.tableIndexModelId,physicalName:this.physicalName,indexColumnModels:this.indexColumnModels.map(e=>e.toJSON()),...this.indexOption!==""&&{indexOption:this.indexOption},...this.indexType!==""&&{indexType:this.indexType},...this.clustered&&{clustered:this.clustered},...this.description!==""&&{description:this.description}}}static toObject(e){S(e,"tableIndexModelId"),S(e,"physicalName"),S(e,"indexColumnModels");let n=j(e.indexColumnModels,"indexColumnModels",r=>Qo.toObject(r));return new t({tableIndexModelId:e.tableIndexModelId,physicalName:e.physicalName,indexColumnModels:n,indexOption:Bh(e),indexType:"indexType"in e?e.indexType:"",clustered:"clustered"in e?e.clustered:!1,description:"description"in e?e.description:""})}equals(e){if(this.tableIndexModelId!==e.tableIndexModelId||this.physicalName!==e.physicalName||this.indexColumnModels.length!==e.indexColumnModels.length)return!1;for(let n=0;n<this.indexColumnModels.length;n++){let r=this.indexColumnModels[n],o=e.indexColumnModels[n];if(r.equals(o)===!1)return!1}return!(this.indexOption!==e.indexOption||this.indexType!==e.indexType||this.clustered!==e.clustered||this.description!==e.description)}},Bh=t=>"indexOption"in t?t.indexOption:"indexOptioin"in t?t.indexOptioin:"",Qo=class t{constructor({columnModelId:e,sortOrderType:n="",nullsOrderType:r=""}){this.columnModelId=e,this.sortOrderType=n,this.nullsOrderType=r}querySort(){return this.sortOrderType===""?"":this.nullsOrderType===""?this.sortOrderType:`${this.sortOrderType} NULLS ${this.nullsOrderType}`}toJSON(){return{columnModelId:this.columnModelId,...this.sortOrderType!==""&&{sortOrderType:this.sortOrderType},...this.nullsOrderType!==""&&{nullsOrderType:this.nullsOrderType}}}static toObject(e){return S(e,"columnModelId"),new t({columnModelId:e.columnModelId,sortOrderType:"sortOrderType"in e?e.sortOrderType:"",nullsOrderType:"nullsOrderType"in e?e.nullsOrderType:""})}equals(e){return!(this.columnModelId!==e.columnModelId||this.sortOrderType!==e.sortOrderType||this.nullsOrderType!==e.nullsOrderType)}};var ht=class t{constructor({tableUniqueKeysModelId:e,physicalName:n="",uniqueKeysColumnModels:r,description:o=""}){this.tableUniqueKeysModelId=e,this.physicalName=n.trim(),this.uniqueKeysColumnModels=[...r],this.description=o}static filterColumns(e,n){let r=!1;return{tableUniqueKeysModels:e.flatMap(i=>{let a=i.uniqueKeysColumnModels.filter(n);return a.length===i.uniqueKeysColumnModels.length?[i]:(r=!0,a.length===0?[]:[new t({...i,uniqueKeysColumnModels:a})])}),hasChanged:r}}toJSON(){return{tableUniqueKeysModelId:this.tableUniqueKeysModelId,...this.physicalName!==""&&{physicalName:this.physicalName},uniqueKeysColumnModels:this.uniqueKeysColumnModels.map(e=>e.toJSON()),...this.description!==""&&{description:this.description}}}static toObject(e){S(e,"tableUniqueKeysModelId"),S(e,"uniqueKeysColumnModels");let n="physicalName"in e?e.physicalName:"",r=j(e.uniqueKeysColumnModels,"uniqueKeysColumnModels",o=>Bo.toObject(o));return new t({tableUniqueKeysModelId:e.tableUniqueKeysModelId,physicalName:n,uniqueKeysColumnModels:r,description:"description"in e?e.description:""})}equals(e){if(this.tableUniqueKeysModelId!==e.tableUniqueKeysModelId||this.physicalName!==e.physicalName||this.uniqueKeysColumnModels.length!==e.uniqueKeysColumnModels.length)return!1;for(let n=0;n<this.uniqueKeysColumnModels.length;n++){let r=this.uniqueKeysColumnModels[n],o=e.uniqueKeysColumnModels[n];if(r.equals(o)===!1)return!1}return this.description===e.description}},Bo=class t{constructor({columnModelId:e,sortOrderType:n}){this.columnModelId=e,this.sortOrderType=n}toJSON(){return{columnModelId:this.columnModelId,...this.sortOrderType!==""&&{sortOrderType:this.sortOrderType}}}static toObject(e){return S(e,"columnModelId"),new t({columnModelId:e.columnModelId,sortOrderType:"sortOrderType"in e?e.sortOrderType:""})}equals(e){return!(this.columnModelId!==e.columnModelId||this.sortOrderType!==e.sortOrderType)}};var Ze=class t{constructor({tableModelId:e="",physicalName:n="",logicalName:r="",schemaId:o="",columnEntries:i=[],uniqueKeysModels:a=[],tableIndexModels:s=[],description:l="",checkExpression:c="",characterSet:m="",collate:d="",definitionExpression:h="",optionExpression:g=""}){this.tableModelId=e||X(),this.physicalName=n.trim(),this.logicalName=r.trim(),this.schemaId=o,this.columnEntries=i,this.uniqueKeysModels=a,this.tableIndexModels=s,this.description=l.trim(),this.checkExpression=c.trim(),this.characterSet=m.trim(),this.collate=d.trim(),this.definitionExpression=h.trim(),this.optionExpression=g.trim()}addColumnModelIds(e){let n=new Set(this.columnEntries.filter(o=>o.modelType==="single").map(o=>o.columnModelId)),r=e.filter(o=>n.has(o)===!1).map(o=>({modelType:"single",columnModelId:o}));return r.length===0?this:new t({...this,columnEntries:this.columnEntries.concat(r)})}updateCheckExpression(e){if(this.checkExpression===""||e.length===0)return this;let n=this.checkExpression;for(let r of e){let o=`\${${r.previousName.physicalName}}`,i=`\${${r.nextName.physicalName}}`;n=n.replaceAll(o,i)}return n===this.checkExpression?this:new t({...this,checkExpression:n})}equals(e){if(this.tableModelId!==e.tableModelId||this.physicalName!==e.physicalName||this.logicalName!==e.logicalName||this.schemaId!==e.schemaId||lt.equalsEntries(this.columnEntries,e.columnEntries)===!1||this.uniqueKeysModels.length!==e.uniqueKeysModels.length)return!1;for(let n=0;n<this.uniqueKeysModels.length;n++){let r=this.uniqueKeysModels[n],o=e.uniqueKeysModels[n];if(r.equals(o)===!1)return!1}if(this.tableIndexModels.length!==e.tableIndexModels.length)return!1;for(let n=0;n<this.tableIndexModels.length;n++){let r=this.tableIndexModels[n],o=e.tableIndexModels[n];if(r.equals(o)===!1)return!1}return!(this.description!==e.description||this.checkExpression!==e.checkExpression||this.characterSet!==e.characterSet||this.collate!==e.collate||this.definitionExpression!==e.definitionExpression||this.optionExpression!==e.optionExpression)}toJSON(){let e=lt.serializeEntries(this.columnEntries);return{tableModelId:this.tableModelId,physicalName:this.physicalName,logicalName:this.logicalName,...this.schemaId!=""&&{schemaId:this.schemaId},columnModelIds:e,...this.uniqueKeysModels.length>0&&{uniqueKeysModels:this.uniqueKeysModels.map(n=>n.toJSON())},...this.tableIndexModels.length>0&&{tableIndexModels:this.tableIndexModels.map(n=>n.toJSON())},...this.description!==""&&{description:this.description},...this.checkExpression!==""&&{checkExpression:this.checkExpression},...this.characterSet!==""&&{characterSet:this.characterSet},...this.collate!==""&&{collate:this.collate},...this.definitionExpression!==""&&{definitionExpression:this.definitionExpression},...this.optionExpression!==""&&{optionExpression:this.optionExpression}}}static toObject(e){S(e,"tableModelId"),S(e,"physicalName"),S(e,"logicalName"),S(e,"columnModelIds");let n="schemaId"in e?e.schemaId:"",r=lt.deserializeEntries(e.columnModelIds),o="uniqueKeysModels"in e?j(e.uniqueKeysModels,"uniqueKeysModels",h=>ht.toObject(h)):[],i="tableIndexModels"in e?j(e.tableIndexModels,"tableIndexModels",h=>pt.toObject(h)):[],a="description"in e?e.description:"",s="checkExpression"in e?e.checkExpression:"",l="characterSet"in e?e.characterSet:"",c="collate"in e?e.collate:"",m="definitionExpression"in e?e.definitionExpression:"",d="optionExpression"in e?e.optionExpression:"";return new t({tableModelId:e.tableModelId,physicalName:e.physicalName,logicalName:e.logicalName,schemaId:n,columnEntries:r,uniqueKeysModels:o,tableIndexModels:i,description:a,checkExpression:s,characterSet:l,collate:c,definitionExpression:m,optionExpression:d})}};var Ko="[[TYPE]][]",u=class t{static{this.EMPTY=new t({id:0,name:"",description:"",baseQuery:""})}constructor({id:e,name:n,description:r,baseQuery:o,category:i="other",withPrecision:a=!1,withScale:s=!1,withUnsigned:l=!1,withAutoIncrement:c=!1,foreignColumn:m=null,defaultValueCandidates:d=[],arrayQueryTemplate:h=Ko}){this.id=e,this.name=n,this.description=r,this.baseQuery=o,this.category=i,this.withPrecision=a,this.withScale=s,this.withUnsigned=l,this.withAutoIncrement=c,this.foreignColumn=m??null,this.defaultValueCandidates=d,this.arrayQueryTemplate=h}specifiedType({precision:e="",scale:n="",isArray:r=!1,inChildRelation:o=!1}){if(this.foreignColumn&&o)return this.foreignColumn.specifiedType({precision:e,scale:n,isArray:r});if(this.baseQuery.indexOf("[[PARAM]]")<0)return this.applyArrayTemplate(this.baseQuery,r);let i=this.initTypeParam(e,n),a=this.baseQuery.replace("[[PARAM]]",i);return this.applyArrayTemplate(a,r)}applyArrayTemplate(e,n){return n===!1?e:this.arrayQueryTemplate.replace("[[TYPE]]",e)}candidateDefaultValues(e,n){return this.defaultValueCandidates.map(r=>{if(r.indexOf("[[PARAM]]")<0)return r;let o=this.initTypeParam(e,n);return r.replaceAll("[[PARAM]]",o)})}initTypeParam(e,n){return n&&this.withScale?`(${e}, ${n})`:e&&this.withPrecision?`(${e})`:""}toJSON(){return{id:this.id,name:this.name,description:this.description,baseQuery:this.baseQuery,category:this.category,...this.withPrecision&&{withPrecision:this.withPrecision},...this.withScale&&{withScale:this.withScale},...this.withUnsigned&&{withUnsigned:this.withUnsigned},...this.withAutoIncrement&&{withAutoIncrement:this.withAutoIncrement},...this.foreignColumn!=null&&{foreignColumn:this.foreignColumn.toJSON()},...this.defaultValueCandidates.length>0&&{defaultValueCandidates:this.defaultValueCandidates},...this.arrayQueryTemplate!==Ko&&{arrayQueryTemplate:this.arrayQueryTemplate}}}static toObject(e){S(e,"id"),S(e,"name"),S(e,"description"),S(e,"baseQuery");let n="category"in e?e.category:"other",r="withPrecision"in e?e.withPrecision:!1,o="withScale"in e?e.withScale:!1,i="withUnsigned"in e?e.withUnsigned:!1,a="withAutoIncrement"in e?e.withAutoIncrement:"withAuthIncrement"in e?e.withAuthIncrement:!1,s="foreignColumn"in e&&e.foreignColumn!=null?t.toObject(e.foreignColumn):null,l="defaultValueCandidates"in e?e.defaultValueCandidates:[],c="arrayQueryTemplate"in e?e.arrayQueryTemplate:Ko;return new t({id:e.id,name:e.name,description:e.description,baseQuery:e.baseQuery,category:n,withPrecision:r,withScale:o,withUnsigned:i,withAutoIncrement:a,foreignColumn:s,defaultValueCandidates:l,arrayQueryTemplate:c})}equals(e){return this.id===e.id&&this.name===e.name&&this.description===e.description&&this.baseQuery===e.baseQuery&&this.withPrecision===e.withPrecision&&this.withScale===e.withScale&&this.withUnsigned===e.withUnsigned&&this.withAutoIncrement===e.withAutoIncrement&&(this.foreignColumn===null&&e.foreignColumn===null||this.foreignColumn!==null&&e.foreignColumn!==null&&this.foreignColumn.equals(e.foreignColumn))&&this.defaultValueCandidates.length===e.defaultValueCandidates.length&&this.defaultValueCandidates.every((n,r)=>n===e.defaultValueCandidates[r])&&this.arrayQueryTemplate===e.arrayQueryTemplate}static migrateDefaultValueCandidates(e,n,r){if(e.name!==n.name||n.defaultValueCandidates.length===0)return e;if(r<20250612)return new t({...e,defaultValueCandidates:[...n.defaultValueCandidates]});if(r<20260321){let o=new Set(e.defaultValueCandidates);if(n.defaultValueCandidates.some(i=>o.has(i)===!1))return new t({...e,defaultValueCandidates:[...n.defaultValueCandidates]})}return e}};var sc=new u({id:11,name:"smallint",description:"2\u30D0\u30A4\u30C8\u7B26\u53F7\u4ED8\u304D\u6574\u6570",baseQuery:"SMALLINT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),lc=new u({id:15,name:"integer",description:"4\u30D0\u30A4\u30C8\u7B26\u53F7\u4ED8\u304D\u6574\u6570",baseQuery:"INTEGER",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),cc=new u({id:17,name:"bigint",description:"8\u30D0\u30A4\u30C8\u7B26\u53F7\u4ED8\u304D\u6574\u6570",baseQuery:"BIGINT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),Kh={postgres:[new u({id:1,name:"bit",description:"\u56FA\u5B9A\u9577\u30D3\u30C3\u30C8\u5217",baseQuery:"BIT",category:"bit",withPrecision:!1,withScale:!1}),new u({id:2,name:"bit (n)",description:"\u56FA\u5B9A\u9577\u30D3\u30C3\u30C8\u5217",baseQuery:"BIT[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1}),new u({id:4,name:"bit varying",description:"\u53EF\u5909\u9577\u30D3\u30C3\u30C8\u5217",baseQuery:"BIT VARYING",category:"bit",withPrecision:!1,withScale:!1}),new u({id:5,name:"bit varying (n)",description:"\u53EF\u5909\u9577\u30D3\u30C3\u30C8\u5217",baseQuery:"BIT VARYING[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1}),new u({id:6,name:"boolean",description:"\u8AD6\u7406\u5024 (\u771F/\u507D)",baseQuery:"BOOLEAN",category:"bit",withPrecision:!1,withScale:!1}),new u({id:367,name:"bytea",description:"\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF (\u300C\u30D0\u30A4\u30C8\u306E\u914D\u5217 (byte array)\u300D)",baseQuery:"BYTEA",category:"bit",withPrecision:!1,withScale:!1}),sc,new u({id:51,name:"smallserial",description:"\u81EA\u52D5\u5897\u52062\u30D0\u30A4\u30C8\u6574\u6570",baseQuery:"SMALLSERIAL",category:"integer",withPrecision:!1,withScale:!1,foreignColumn:sc}),lc,new u({id:55,name:"serial",description:"\u81EA\u52D5\u5897\u52064\u30D0\u30A4\u30C8\u6574\u6570",baseQuery:"SERIAL",category:"integer",withPrecision:!1,withScale:!1,foreignColumn:lc}),cc,new u({id:57,name:"bigserial",description:"\u81EA\u52D5\u5897\u52068\u30D0\u30A4\u30C8\u6574\u6570",baseQuery:"BIGSERIAL",category:"integer",withPrecision:!1,withScale:!1,foreignColumn:cc}),new u({id:31,name:"real",description:"\u5358\u7CBE\u5EA6\u6D6E\u52D5\u5C0F\u6570\u70B9 (4\u30D0\u30A4\u30C8)",baseQuery:"REAL",category:"decimal",withPrecision:!1,withScale:!1}),new u({id:33,name:"double precision",description:"\u500D\u7CBE\u5EA6\u6D6E\u52D5\u5C0F\u6570\u70B9 (8\u30D0\u30A4\u30C8)",baseQuery:"DOUBLE PRECISION",category:"decimal",withPrecision:!1,withScale:!1}),new u({id:35,name:"decimal",description:"\u7CBE\u5EA6\u306E\u9078\u629E\u53EF\u80FD\u306A\u9AD8\u7CBE\u5EA6\u6570\u5024",baseQuery:"DECIMAL",category:"decimal",withPrecision:!1,withScale:!1}),new u({id:36,name:"numeric",description:"\u7CBE\u5EA6\u306E\u9078\u629E\u53EF\u80FD\u306A\u9AD8\u7CBE\u5EA6\u6570\u5024",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1}),new u({id:45,name:"decimal (p, s)",description:"\u7CBE\u5EA6\u306E\u9078\u629E\u53EF\u80FD\u306A\u9AD8\u7CBE\u5EA6\u6570\u5024",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0}),new u({id:46,name:"numeric (p, s)",description:"\u7CBE\u5EA6\u306E\u9078\u629E\u53EF\u80FD\u306A\u9AD8\u7CBE\u5EA6\u6570\u5024",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0}),new u({id:101,name:"date",description:"\u66A6\u306E\u65E5\u4ED8 (\u5E74\u6708\u65E5)",baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1}),new u({id:131,name:"time without time zone",description:"\u6642\u523B (\u6642\u9593\u5E2F\u306A\u3057)",baseQuery:"TIME WITHOUT TIME ZONE",category:"timestamp",withPrecision:!1,withScale:!1}),new u({id:132,name:"time with time zone",description:"\u6642\u9593\u5E2F\u4ED8\u304D\u6642\u523B",baseQuery:"TIME WITH TIME ZONE",category:"timestamp",withPrecision:!1,withScale:!1}),new u({id:141,name:"time (p) without time zone",description:"\u6642\u523B (\u6642\u9593\u5E2F\u306A\u3057)",baseQuery:"TIME[[PARAM]] WITHOUT TIME ZONE",category:"timestamp",withPrecision:!0,withScale:!1}),new u({id:142,name:"time (p) with time zone",description:"\u6642\u9593\u5E2F\u4ED8\u304D\u6642\u523B",baseQuery:"TIME[[PARAM]] WITH TIME ZONE",category:"timestamp",withPrecision:!0,withScale:!1}),new u({id:111,name:"timestamp without time zone",description:"\u65E5\u4ED8\u3068\u6642\u523B (\u6642\u9593\u5E2F\u306A\u3057)",baseQuery:"TIMESTAMP WITHOUT TIME ZONE",category:"timestamp",withPrecision:!1,withScale:!1}),new u({id:112,name:"timestamp with time zone",description:"\u6642\u9593\u5E2F\u4ED8\u304D\u65E5\u4ED8\u3068\u6642\u523B",baseQuery:"TIMESTAMP WITH TIME ZONE",category:"timestamp",withPrecision:!1,withScale:!1}),new u({id:121,name:"timestamp (p) without time zone",description:"\u65E5\u4ED8\u3068\u6642\u523B (\u6642\u9593\u5E2F\u306A\u3057)",baseQuery:"TIMESTAMP[[PARAM]] WITHOUT TIME ZONE",category:"timestamp",withPrecision:!0,withScale:!1}),new u({id:122,name:"timestamp (p) with time zone",description:"\u6642\u9593\u5E2F\u4ED8\u304D\u65E5\u4ED8\u3068\u6642\u523B",baseQuery:"TIMESTAMP[[PARAM]] WITH TIME ZONE",category:"timestamp",withPrecision:!0,withScale:!1}),new u({id:301,name:"char",description:"\u56FA\u5B9A\u9577\u6587\u5B57\u5217",baseQuery:"CHAR",category:"text",withPrecision:!1,withScale:!1}),new u({id:302,name:"varchar",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217",baseQuery:"VARCHAR",category:"text",withPrecision:!1,withScale:!1}),new u({id:311,name:"char (n)",description:"\u56FA\u5B9A\u9577\u6587\u5B57\u5217",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1}),new u({id:312,name:"varchar (n)",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1}),new u({id:325,name:"text",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217",baseQuery:"TEXT",category:"text",withPrecision:!1,withScale:!1}),new u({id:411,name:"uuid",description:"\u6C4E\u7528\u4E00\u610F\u8B58\u5225\u5B50",baseQuery:"UUID",category:"other",withPrecision:!1,withScale:!1}),new u({id:421,name:"json",description:"\u30C6\u30AD\u30B9\u30C8\u306EJSON\u30C7\u30FC\u30BF",baseQuery:"JSON",category:"other",withPrecision:!1,withScale:!1}),new u({id:422,name:"jsonb",description:"\u30D0\u30A4\u30CA\u30EA JSON \u30C7\u30FC\u30BF, \u5C55\u958B\u578B",baseQuery:"JSONB",category:"other",withPrecision:!1,withScale:!1}),new u({id:431,name:"xml",description:"XML\u30C7\u30FC\u30BF",baseQuery:"XML",category:"other",withPrecision:!1,withScale:!1}),new u({id:441,name:"money",description:"\u8CA8\u5E63\u91D1\u984D",baseQuery:"MONEY",category:"other",withPrecision:!1,withScale:!1}),new u({id:451,name:"tsquery",description:"\u30C6\u30AD\u30B9\u30C8\u691C\u7D22\u554F\u3044\u5408\u308F\u305B",baseQuery:"TSQUERY",category:"other",withPrecision:!1,withScale:!1}),new u({id:453,name:"tsvector",description:"\u30C6\u30AD\u30B9\u30C8\u691C\u7D22\u6587\u66F8",baseQuery:"TSVECTOR",category:"other",withPrecision:!1,withScale:!1}),new u({id:1011,name:"point",description:"\u5E73\u9762\u4E0A\u306E\u5E7E\u4F55\u5B66\u7684\u70B9",baseQuery:"POINT",category:"other",withPrecision:!1,withScale:!1}),new u({id:1021,name:"line",description:"\u5E73\u9762\u4E0A\u306E\u7121\u9650\u76F4\u7DDA",baseQuery:"LINE",category:"other",withPrecision:!1,withScale:!1}),new u({id:1022,name:"lseg",description:"\u5E73\u9762\u4E0A\u306E\u7DDA\u5206",baseQuery:"LSEG",category:"other",withPrecision:!1,withScale:!1}),new u({id:1031,name:"box",description:"\u5E73\u9762\u4E0A\u306E\u77E9\u5F62",baseQuery:"BOX",category:"other",withPrecision:!1,withScale:!1}),new u({id:1032,name:"circle",description:"\u5E73\u9762\u4E0A\u306E\u5186",baseQuery:"CIRCLE",category:"other",withPrecision:!1,withScale:!1}),new u({id:1041,name:"path",description:"\u5E73\u9762\u4E0A\u306E\u5E7E\u4F55\u5B66\u7684\u7D4C\u8DEF",baseQuery:"PATH",category:"other",withPrecision:!1,withScale:!1}),new u({id:1042,name:"polygon",description:"\u5E73\u9762\u4E0A\u306E\u9589\u3058\u305F\u5E7E\u4F55\u5B66\u7684\u7D4C\u8DEF",baseQuery:"POLYGON",category:"other",withPrecision:!1,withScale:!1}),new u({id:1111,name:"cidr",description:"IPv4\u3082\u3057\u304F\u306FIPv6\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u30A2\u30C9\u30EC\u30B9",baseQuery:"CIDR",category:"other",withPrecision:!1,withScale:!1}),new u({id:1112,name:"inet",description:"IPv4\u3082\u3057\u304F\u306FIPv6\u30DB\u30B9\u30C8\u30A2\u30C9\u30EC\u30B9",baseQuery:"INET",category:"other",withPrecision:!1,withScale:!1}),new u({id:1121,name:"macaddr",description:"MAC (Media Access Control)\u30A2\u30C9\u30EC\u30B9",baseQuery:"MACADDR",category:"other",withPrecision:!1,withScale:!1}),new u({id:1122,name:"macaddr8",description:"MAC (Media Access Control) \u30A2\u30C9\u30EC\u30B9 (EUI-64 \u5F62\u5F0F)",baseQuery:"MACADDR8",category:"other",withPrecision:!1,withScale:!1}),new u({id:9101,name:"pg_lsn",description:"PostgreSQL\u30ED\u30B0\u30B7\u30FC\u30B1\u30F3\u30B9\u756A\u53F7",baseQuery:"PG_LSN",category:"other",withPrecision:!1,withScale:!1}),new u({id:9102,name:"pg_snapshot",description:"\u30E6\u30FC\u30B6\u30EC\u30D9\u30EB\u306E\u30C8\u30E9\u30F3\u30B6\u30AF\u30B7\u30E7\u30F3ID\u30B9\u30CA\u30C3\u30D7\u30B7\u30E7\u30C3\u30C8",baseQuery:"PG_SNAPSHOT",category:"other",withPrecision:!1,withScale:!1}),new u({id:9103,name:"oid",description:"\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u8B58\u5225\u5B50\u30C7\u30FC\u30BF",baseQuery:"OID",category:"other",withPrecision:!1,withScale:!1}),u.EMPTY],mysql:[new u({id:1,name:"bit",description:"\u30D3\u30C3\u30C8\u5024\u578B",baseQuery:"BIT",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2,name:"bit (m)",description:"\u30D3\u30C3\u30C8\u5024\u578B",baseQuery:"BIT[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:6,name:"boolean",description:"TINYINT(1) \u306E\u30B7\u30CE\u30CB\u30E0",baseQuery:"BOOLEAN",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:10,name:"tinyint",description:"\u975E\u5E38\u306B\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -128 \u304B\u3089 127 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 255 \u3067\u3059\u3002",baseQuery:"TINYINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:11,name:"smallint",description:"\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -32768 \u304B\u3089 32767 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 65535 \u3067\u3059\u3002",baseQuery:"SMALLINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:13,name:"mediumint",description:"\u4E2D\u9593\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -8388608 \u304B\u3089 8388607 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 16777215 \u3067\u3059\u3002",baseQuery:"MEDIUMINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:15,name:"int",description:"\u666E\u901A\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -2147483648 \u304B\u3089 2147483647 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 4294967295 \u3067\u3059\u3002",baseQuery:"INT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:17,name:"bigint",description:"\u5927\u304D\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -9223372036854775808 \u304B\u3089 9223372036854775807 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 18446744073709551615 \u3067\u3059\u3002",baseQuery:"BIGINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:20,name:"tinyint (m)",description:"\u975E\u5E38\u306B\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -128 \u304B\u3089 127 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 255 \u3067\u3059\u3002",baseQuery:"TINYINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!1}),new u({id:21,name:"smallint (m)",description:"\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -32768 \u304B\u3089 32767 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 65535 \u3067\u3059\u3002",baseQuery:"SMALLINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:23,name:"mediumint (m)",description:"\u4E2D\u9593\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -8388608 \u304B\u3089 8388607 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 16777215 \u3067\u3059\u3002",baseQuery:"MEDIUMINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:25,name:"int (m)",description:"\u666E\u901A\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -2147483648 \u304B\u3089 2147483647 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 4294967295 \u3067\u3059\u3002",baseQuery:"INT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:27,name:"bigint (m)",description:"\u5927\u304D\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -9223372036854775808 \u304B\u3089 9223372036854775807 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 18446744073709551615 \u3067\u3059\u3002",baseQuery:"BIGINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:31,name:"float",description:"\u5C0F\u3055\u3044 (\u5358\u7CBE\u5EA6) \u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u308B\u5024\u306F\u3001-3.402823466E+38 \u304B\u3089 -1.175494351E-38\u30010\u3001\u304A\u3088\u3073 1.175494351E-38 \u304B\u3089 3.402823466E+38 \u3067\u3059\u3002",baseQuery:"FLOAT",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:33,name:"double",description:"\u666E\u901A\u30B5\u30A4\u30BA (\u500D\u7CBE\u5EA6) \u306E\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u3066\u3044\u308B\u5024\u306F\u3001-1.7976931348623157E+308 \u304B\u3089 -2.2250738585072014E-308\u30010\u3001\u304A\u3088\u3073 2.2250738585072014E-308 \u304B\u3089 1.7976931348623157E+308 \u3067\u3059\u3002",baseQuery:"DOUBLE",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:35,name:"decimal",description:"\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 \u6841\u657010 (\u7CBE\u5EA6) \u3067\u3001\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u65700\u3067\u3059\u3002",baseQuery:"DECIMAL",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:36,name:"numeric",description:"DECIMAL \u306E\u30B7\u30CE\u30CB\u30E0\u3067\u3059\u3002\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 \u6841\u657010 (\u7CBE\u5EA6) \u3067\u3001\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u65700\u3067\u3059\u3002",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:41,name:"float (m, d)",description:"\u5C0F\u3055\u3044 (\u5358\u7CBE\u5EA6) \u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u308B\u5024\u306F\u3001-3.402823466E+38 \u304B\u3089 -1.175494351E-38\u30010\u3001\u304A\u3088\u3073 1.175494351E-38 \u304B\u3089 3.402823466E+38 \u3067\u3059\u3002",baseQuery:"FLOAT[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:42,name:"float (p)",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3067\u3059\u3002p \u306F\u7CBE\u5EA6\u3092\u30D3\u30C3\u30C8\u3067\u8868\u73FE\u3057\u307E\u3059\u3002",baseQuery:"FLOAT[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:43,name:"double (m, d)",description:"\u666E\u901A\u30B5\u30A4\u30BA (\u500D\u7CBE\u5EA6) \u306E\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u3066\u3044\u308B\u5024\u306F\u3001-1.7976931348623157E+308 \u304B\u3089 -2.2250738585072014E-308\u30010\u3001\u304A\u3088\u3073 2.2250738585072014E-308 \u304B\u3089 1.7976931348623157E+308 \u3067\u3059\u3002",baseQuery:"DOUBLE[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:45,name:"decimal (m, d)",description:"\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 M \u306F\u6841\u6570\u306E\u5408\u8A08 (\u7CBE\u5EA6) \u3067\u3001D \u306F\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u6570 (\u30B9\u30B1\u30FC\u30EB) \u3067\u3059\u3002",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:46,name:"numeric (m, d)",description:"DECIMAL \u306E\u30B7\u30CE\u30CB\u30E0\u3067\u3059\u3002\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 M \u306F\u6841\u6570\u306E\u5408\u8A08 (\u7CBE\u5EA6) \u3067\u3001D \u306F\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u6570 (\u30B9\u30B1\u30FC\u30EB) \u3067\u3059\u3002",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:101,name:"date",description:'\u65E5\u4ED8\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01" \u304B\u3089 "9999-12-31" \u3067\u3059\u3002',baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_DATE)"]}),new u({id:131,name:"time",description:'\u6642\u9593\u3067\u3059\u3002 \u7BC4\u56F2\u306F\u3001"-838:59:59.000000" \u304B\u3089 "838:59:59.000000" \u3067\u3059\u3002',baseQuery:"TIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_TIME)"]}),new u({id:141,name:"time (p)",description:'\u6642\u9593\u3067\u3059\u3002 \u7BC4\u56F2\u306F\u3001"-838:59:59.000000" \u304B\u3089 "838:59:59.000000" \u3067\u3059\u3002',baseQuery:"TIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_TIME)"]}),new u({id:112,name:"datetime",description:'\u65E5\u4ED8\u3068\u6642\u9593\u306E\u7D44\u307F\u5408\u308F\u305B\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01 00:00:00.000000" \u304B\u3089 "9999-12-31 23:59:59.999999" \u3067\u3059\u3002',baseQuery:"DATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP","CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"]}),new u({id:115,name:"timestamp",description:'\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u3067\u3059\u3002 \u7BC4\u56F2\u306F "1970-01-01 00:00:01.000000" UTC \u304B\u3089 "2038-01-19 03:14:07.999999" UTC \u3067\u3059\u3002',baseQuery:"TIMESTAMP",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP","CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"]}),new u({id:122,name:"datetime (p)",description:'\u65E5\u4ED8\u3068\u6642\u9593\u306E\u7D44\u307F\u5408\u308F\u305B\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01 00:00:00.000000" \u304B\u3089 "9999-12-31 23:59:59.999999" \u3067\u3059\u3002',baseQuery:"DATETIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP[[PARAM]]","CURRENT_TIMESTAMP[[PARAM]] ON UPDATE CURRENT_TIMESTAMP[[PARAM]]"]}),new u({id:125,name:"timestamp (p)",description:'\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u3067\u3059\u3002 \u7BC4\u56F2\u306F "1970-01-01 00:00:01.000000" UTC \u304B\u3089 "2038-01-19 03:14:07.999999" UTC \u3067\u3059\u3002',baseQuery:"TIMESTAMP[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP[[PARAM]]","CURRENT_TIMESTAMP[[PARAM]] ON UPDATE CURRENT_TIMESTAMP[[PARAM]]"]}),new u({id:151,name:"year",description:"4 \u6841\u5F62\u5F0F\u306E\u5E74\u3002",baseQuery:"YEAR",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:301,name:"char",description:"\u683C\u7D0D\u6642\u306B\u5FC5\u305A\u3001\u6307\u5B9A\u3055\u308C\u305F\u9577\u3055\u306B\u306A\u308B\u3088\u3046\u306B\u53F3\u5074\u304C\u30B9\u30DA\u30FC\u30B9\u3067\u57CB\u3081\u3089\u308C\u308B\u56FA\u5B9A\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"CHAR",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:311,name:"char (m)",description:"\u683C\u7D0D\u6642\u306B\u5FC5\u305A\u3001\u6307\u5B9A\u3055\u308C\u305F\u9577\u3055\u306B\u306A\u308B\u3088\u3046\u306B\u53F3\u5074\u304C\u30B9\u30DA\u30FC\u30B9\u3067\u57CB\u3081\u3089\u308C\u308B\u56FA\u5B9A\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:312,name:"varchar (m)",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:321,name:"tinytext",description:"\u6700\u5927\u9577\u304C 255 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TINYTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:322,name:"text",description:"\u6700\u5927\u9577\u304C 65,535 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:323,name:"text (m)",description:"\u6700\u5927\u9577\u304C 65,535 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TEXT[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:324,name:"mediumtext",description:"\u6700\u5927\u9577\u304C 16,777,215 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"MEDIUMTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:325,name:"longtext",description:"\u6700\u5927\u9577\u304C 4G \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"LONGTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:3,name:"binary (m)",description:"\u30D0\u30A4\u30CA\u30EA\u30D0\u30A4\u30C8\u6587\u5B57\u5217\u3092\u683C\u7D0D\u3057\u307E\u3059\u3002",baseQuery:"BINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:5,name:"varbinary (m)",description:"\u30D0\u30A4\u30CA\u30EA\u30D0\u30A4\u30C8\u6587\u5B57\u5217\u3092\u683C\u7D0D\u3057\u307E\u3059\u3002",baseQuery:"VARBINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:361,name:"tinyblob",description:"\u6700\u5927\u9577\u304C 255 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"TINYBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:363,name:"blob",description:"\u6700\u5927\u9577\u304C 65,535 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"BLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:364,name:"blob (m)",description:"\u6700\u5927\u9577\u304C 65,535 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"BLOB[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:365,name:"mediumblob",description:"\u6700\u5927\u9577\u304C 16,777,215 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"MEDIUMBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:367,name:"longblob",description:"\u6700\u5927\u9577\u304C 4G \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"LONGBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:422,name:"json",description:"\u6587\u66F8\u306E\u578B\u5F0F\u3067\u3042\u308BJSON\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"JSON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2001,name:"geometry",description:"\u7A7A\u9593\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002\u70B9\u3001\u7DDA\u3001\u591A\u89D2\u5F62\u3001\u304A\u3088\u3073\u305D\u306E\u4ED6\u306E\u5F62\u72B6\u3092\u542B\u3081\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002",baseQuery:"GEOMETRY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2011,name:"point",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u7A7A\u9593\u4E0A\u306E\u5358\u4E00\u306E\u70B9\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"POINT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2012,name:"linestring",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u7A7A\u9593\u4E0A\u306E\u8907\u6570\u306E\u70B9\u3092\u7D50\u3076\u76F4\u7DDA\u30BB\u30B0\u30E1\u30F3\u30C8\u306E\u9023\u7D9A\u3057\u305F\u30BB\u30C3\u30C8\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"LINESTRING",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2013,name:"polygon",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u5E73\u9762\u4E0A\u306E\u5358\u4E00\u306E\u9818\u57DF\u3092\u8868\u3059\u9589\u3058\u305F\u30EB\u30FC\u30D7\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"POLYGON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2021,name:"multipoint",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u70B9\u3092\u8868\u3059\u8907\u6570\u306EPOINT\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTIPOINT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2022,name:"multilinestring",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u7DDA\u5206\u3092\u8868\u3059\u8907\u6570\u306ELINESTRING\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTILINESTRING",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2023,name:"multipolygon",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u30DD\u30EA\u30B4\u30F3\u3092\u8868\u3059\u8907\u6570\u306EPOLYGON\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTIPOLYGON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2031,name:"geometrycollection",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306EGEOMETRY\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"GEOMETRYCOLLECTION",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2101,name:"enum",description:"\u6587\u5B57\u5217\u306E\u30EA\u30B9\u30C8\u306E\u4E2D\u304B\u30891\u3064\u3092\u9078\u629E\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"ENUM",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2102,name:"set",description:"ENUM\u306E\u62E1\u5F35\u7248\u3067\u3042\u308A\u3001\u6587\u5B57\u5217\u306E\u30EA\u30B9\u30C8\u304B\u3089\u8907\u6570\u306E\u9078\u629E\u80A2\u3092\u9078\u629E\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"SET",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),u.EMPTY],ms_sqlserver:[new u({id:1,name:"bit",description:"1\u30010\u3001\u307E\u305F\u306FNULL\u306E\u5024\u3092\u53D7\u3051\u53D6\u308B\u3053\u3068\u304C\u3067\u304D\u308B\u6574\u6570\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"BIT",category:"bit",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:3,name:"binary (n)",description:"n \u30D0\u30A4\u30C8\u306E\u56FA\u5B9A\u9577\u306E binary \u30C7\u30FC\u30BF\u3067\u3059\u3002\u3053\u3053\u3067\u3001n \u306F 1 \u304B\u3089 8,000 \u306E\u5024\u306B\u306A\u308A\u307E\u3059\u3002",baseQuery:"BINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:4,name:"binary",description:"\u56FA\u5B9A\u9577\u306E binary \u30C7\u30FC\u30BF\u3067\u3059\u3002",baseQuery:"BINARY",category:"bit",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:5,name:"varbinary (n)",description:"\u53EF\u5909\u9577 binary \u30C7\u30FC\u30BF\u3002 n \u306B\u306F 1 \uFF5E 8,000 \u306E\u5024\u3092\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002",baseQuery:"VARBINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:9,name:"varbinary (max)",description:"\u53EF\u5909\u9577 binary \u30C7\u30FC\u30BF\u3002",baseQuery:"VARBINARY(MAX)",category:"bit",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:10,name:"tinyint",description:"\u6574\u6570\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B\u5B9F\u6570\u30C7\u30FC\u30BF\u578B\u3067\u3059\u30020 to 255 (2^0-1 to 2^8-1)",baseQuery:"TINYINT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:11,name:"smallint",description:"\u6574\u6570\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B\u5B9F\u6570\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002-32,768 to 32,767 (-2^15 to 2^15-1)",baseQuery:"SMALLINT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:15,name:"int",description:"\u6574\u6570\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B\u5B9F\u6570\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002-2,147,483,648 to 2,147,483,647 (-2^31 to 2^31-1)",baseQuery:"INT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:17,name:"bigint",description:"\u6574\u6570\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B\u5B9F\u6570\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 (-2^63 to 2^63-1)",baseQuery:"BIGINT",category:"integer",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:31,name:"real",description:"real \u306E ISO \u30B7\u30CE\u30CB\u30E0\u306F\u3001 float (24) \u3067\u3059\u3002",baseQuery:"REAL",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:33,name:"float",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u5024\u30C7\u30FC\u30BF\u3067\u4F7F\u7528\u3059\u308B\u6982\u6570\u578B\u3067\u3059\u3002",baseQuery:"FLOAT",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:35,name:"decimal",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"DECIMAL",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:36,name:"numeric",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002decimal \u3068 numeric \u306F\u30B7\u30CE\u30CB\u30E0\u3067\u3042\u308A\u3001\u540C\u3058\u610F\u5473\u3067\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!0}),new u({id:42,name:"float (n)",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u5024\u30C7\u30FC\u30BF\u3067\u4F7F\u7528\u3059\u308B\u6982\u6570\u578B\u3067\u3059\u3002",baseQuery:"FLOAT[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:45,name:"decimal (m, s)",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withAutoIncrement:!1}),new u({id:46,name:"numeric (m, s)",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002decimal \u3068 numeric \u306F\u30B7\u30CE\u30CB\u30E0\u3067\u3042\u308A\u3001\u540C\u3058\u610F\u5473\u3067\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withAutoIncrement:!1}),new u({id:47,name:"decimal (m)",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!1,withAutoIncrement:!0}),new u({id:48,name:"numeric (m)",description:"\u6709\u52B9\u6841\u6570\u3068\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570\u304C\u56FA\u5B9A\u3055\u308C\u305F\u6570\u5024\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002decimal \u3068 numeric \u306F\u30B7\u30CE\u30CB\u30E0\u3067\u3042\u308A\u3001\u540C\u3058\u610F\u5473\u3067\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!1,withAutoIncrement:!0}),new u({id:65,name:"smallmoney",description:"\u91D1\u984D\u5024\u307E\u305F\u306F\u901A\u8CA8\u5024\u3092\u8868\u3059\u30C7\u30FC\u30BF\u578B\u3002-214,748.3648 to 214,748.3647",baseQuery:"SMALLMONEY",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:67,name:"money",description:"\u91D1\u984D\u5024\u307E\u305F\u306F\u901A\u8CA8\u5024\u3092\u8868\u3059\u30C7\u30FC\u30BF\u578B\u3002-922,337,203,685,477.5808 to 922,337,203,685,477.5807",baseQuery:"MONEY",category:"decimal",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:101,name:"date",description:"\u65E5\u4ED8\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002",baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:111,name:"datetime2",description:"24 \u6642\u9593\u5F62\u5F0F\u306E\u6642\u523B\u3068\u7D44\u307F\u5408\u308F\u305B\u305F\u65E5\u4ED8\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002",baseQuery:"DATETIME2",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["SYSDATETIME()","SYSUTCDATETIME()"]}),new u({id:112,name:"datetimeoffset",description:"datetime2 \u306A\u3069\u306E 24 \u6642\u9593\u5236\u306B\u57FA\u3065\u3044\u3066 1 \u65E5\u306E\u6642\u523B\u3068\u7D44\u307F\u5408\u308F\u3055\u308C\u308B\u65E5\u4ED8\u3092\u5B9A\u7FA9\u3057\u3001\u5354\u5B9A\u4E16\u754C\u6642 (UTC) \u306B\u57FA\u3065\u3044\u3066\u30BF\u30A4\u30E0 \u30BE\u30FC\u30F3\u8A8D\u8B58\u3092\u8FFD\u52A0\u3057\u307E\u3059\u3002",baseQuery:"DATETIMEOFFSET",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["SYSDATETIMEOFFSET()"]}),new u({id:121,name:"datetime2 (p)",description:"24 \u6642\u9593\u5F62\u5F0F\u306E\u6642\u523B\u3068\u7D44\u307F\u5408\u308F\u305B\u305F\u65E5\u4ED8\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002",baseQuery:"DATETIME2[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["SYSDATETIME()","SYSUTCDATETIME()"]}),new u({id:122,name:"datetimeoffset (p)",description:"datetime2 \u306A\u3069\u306E 24 \u6642\u9593\u5236\u306B\u57FA\u3065\u3044\u3066 1 \u65E5\u306E\u6642\u523B\u3068\u7D44\u307F\u5408\u308F\u3055\u308C\u308B\u65E5\u4ED8\u3092\u5B9A\u7FA9\u3057\u3001\u5354\u5B9A\u4E16\u754C\u6642 (UTC) \u306B\u57FA\u3065\u3044\u3066\u30BF\u30A4\u30E0 \u30BE\u30FC\u30F3\u8A8D\u8B58\u3092\u8FFD\u52A0\u3057\u307E\u3059\u3002",baseQuery:"DATETIMEOFFSET[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["SYSDATETIMEOFFSET()"]}),new u({id:131,name:"time",description:"1 \u65E5\u306E\u6642\u523B\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002 \u6642\u523B\u306F 24 \u6642\u9593\u5F62\u5F0F\u3067\u3001\u30BF\u30A4\u30E0 \u30BE\u30FC\u30F3\u306F\u8A8D\u8B58\u3055\u308C\u307E\u305B\u3093\u3002",baseQuery:"TIME",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:141,name:"time (s)",description:"",baseQuery:"TIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:191,name:"smalldatetime (deprecated)",description:"(deprecated)",baseQuery:"SMALLDATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["GETDATE()","GETUTCDATE()"]}),new u({id:192,name:"datetime (deprecated)",description:"(deprecated)",baseQuery:"DATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withAutoIncrement:!1,defaultValueCandidates:["GETDATE()","GETUTCDATE()"]}),new u({id:301,name:"char",description:"\u56FA\u5B9A\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"CHAR",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:302,name:"varchar",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"VARCHAR",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:306,name:"nchar",description:"\u56FA\u5B9A\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u5217\u30C7\u30FC\u30BF\u3067\u3059\u3002",baseQuery:"NCHAR",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:307,name:"nvarchar",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u5217\u30C7\u30FC\u30BF\u3067\u3059\u3002 ",baseQuery:"NVARCHAR",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:311,name:"char (n)",description:"\u56FA\u5B9A\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:312,name:"varchar (n)",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:316,name:"nchar (n)",description:"\u56FA\u5B9A\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u5217\u30C7\u30FC\u30BF\u3067\u3059\u3002",baseQuery:"NCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:317,name:"nvarchar (n)",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u5217\u30C7\u30FC\u30BF\u3067\u3059\u3002 ",baseQuery:"NVARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withAutoIncrement:!1}),new u({id:325,name:"varchar (max)",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"VARCHAR(MAX)",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:326,name:"nvarchar (max)",description:"\u53EF\u5909\u30B5\u30A4\u30BA\u306E\u6587\u5B57\u5217\u30C7\u30FC\u30BF\u3067\u3059\u3002 ",baseQuery:"NVARCHAR(MAX)",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:395,name:"text (deprecated)",description:"(deprecated)",baseQuery:"TEXT",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:396,name:"ntext (deprecated)",description:"(deprecated)",baseQuery:"NTEXT",category:"text",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:397,name:"image (deprecated)",description:"(deprecated)",baseQuery:"IMAGE",category:"bit",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:422,name:"json",description:"The native json data type that stores JSON documents in a native binary format.",baseQuery:"JSON",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:431,name:"xml",description:"XML \u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002",baseQuery:"XML",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:453,name:"vector",description:"vector \u30C7\u30FC\u30BF\u578B\u306F\u3001\u985E\u4F3C\u6027\u691C\u7D22\u3084\u6A5F\u68B0\u5B66\u7FD2\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306A\u3069\u306E\u64CD\u4F5C\u7528\u306B\u6700\u9069\u5316\u3055\u308C\u305F\u30D9\u30AF\u30C8\u30EB \u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u3088\u3046\u306B\u8A2D\u8A08\u3055\u308C\u3066\u3044\u307E\u3059\u3002",baseQuery:"VECTOR",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:2001,name:"geometry",description:"\u5E73\u9762\u7A7A\u9593\u30C7\u30FC\u30BF\u578B\u306E geometry \u306F\u3001SQL Server \u3067\u306F\u5171\u901A\u8A00\u8A9E\u30E9\u30F3\u30BF\u30A4\u30E0 (CLR) \u306E\u30C7\u30FC\u30BF\u578B\u3068\u3057\u3066\u5B9F\u88C5\u3055\u308C\u3066\u3044\u307E\u3059\u3002 \u3053\u306E\u578B\u306F\u3001\u30E6\u30FC\u30AF\u30EA\u30C3\u30C9 (\u5E73\u9762) \u5EA7\u6A19\u7CFB\u306E\u30C7\u30FC\u30BF\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"GEOMETRY",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:2002,name:"geography",description:"\u5730\u7406\u7A7A\u9593\u30C7\u30FC\u30BF\u578B\u306E geography \u306F\u3001SQL Server \u3067\u306F .NET \u5171\u901A\u8A00\u8A9E\u30E9\u30F3\u30BF\u30A4\u30E0 (CLR) \u306E\u30C7\u30FC\u30BF\u578B\u3068\u3057\u3066\u5B9F\u88C5\u3055\u308C\u3066\u3044\u307E\u3059\u3002 \u3053\u306E\u578B\u306F\u3001\u7403\u4F53\u5730\u7403\u5EA7\u6A19\u7CFB\u306E\u30C7\u30FC\u30BF\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"GEOGRAPHY",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:2061,name:"hierarchyid",description:"hierarchyid \u30C7\u30FC\u30BF\u578B\u306F\u53EF\u5909\u9577\u306E\u30B7\u30B9\u30C6\u30E0 \u30C7\u30FC\u30BF\u578B\u3067\u3059\u3002 hierarchyid \u306F\u3001\u968E\u5C64\u5185\u306E\u4F4D\u7F6E\u3092\u8868\u3059\u305F\u3081\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002",baseQuery:"HIERARCHYID",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:9301,name:"uniqueidentifier",description:"16 \u30D0\u30A4\u30C8\u306E GUID \u3067\u3059\u3002",baseQuery:"UNIQUEIDENTIFIER",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),new u({id:9302,name:"sql_variant",description:"SQL Server \u3067\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u5404\u7A2E\u30C7\u30FC\u30BF\u578B\u306E\u5024\u304C\u683C\u7D0D\u3055\u308C\u307E\u3059\u3002",baseQuery:"SQL_VARIANT",category:"other",withPrecision:!1,withScale:!1,withAutoIncrement:!1}),u.EMPTY],mariadb:[new u({id:1,name:"bit",description:"\u30D3\u30C3\u30C8\u5024\u578B",baseQuery:"BIT",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2,name:"bit (m)",description:"\u30D3\u30C3\u30C8\u5024\u578B",baseQuery:"BIT[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:6,name:"boolean",description:"TINYINT(1) \u306E\u30B7\u30CE\u30CB\u30E0",baseQuery:"BOOLEAN",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:10,name:"tinyint",description:"\u975E\u5E38\u306B\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -128 \u304B\u3089 127 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 255 \u3067\u3059\u3002",baseQuery:"TINYINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:11,name:"smallint",description:"\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -32768 \u304B\u3089 32767 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 65535 \u3067\u3059\u3002",baseQuery:"SMALLINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:13,name:"mediumint",description:"\u4E2D\u9593\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -8388608 \u304B\u3089 8388607 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 16777215 \u3067\u3059\u3002",baseQuery:"MEDIUMINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:15,name:"int",description:"\u666E\u901A\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -2147483648 \u304B\u3089 2147483647 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 4294967295 \u3067\u3059\u3002",baseQuery:"INT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:17,name:"bigint",description:"\u5927\u304D\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -9223372036854775808 \u304B\u3089 9223372036854775807 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 18446744073709551615 \u3067\u3059\u3002",baseQuery:"BIGINT",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:20,name:"tinyint (m)",description:"\u975E\u5E38\u306B\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -128 \u304B\u3089 127 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 255 \u3067\u3059\u3002",baseQuery:"TINYINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!1}),new u({id:21,name:"smallint (m)",description:"\u5C0F\u3055\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -32768 \u304B\u3089 32767 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 65535 \u3067\u3059\u3002",baseQuery:"SMALLINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:23,name:"mediumint (m)",description:"\u4E2D\u9593\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -8388608 \u304B\u3089 8388607 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 16777215 \u3067\u3059\u3002",baseQuery:"MEDIUMINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:25,name:"int (m)",description:"\u666E\u901A\u30B5\u30A4\u30BA\u306E\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -2147483648 \u304B\u3089 2147483647 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 4294967295 \u3067\u3059\u3002",baseQuery:"INT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:27,name:"bigint (m)",description:"\u5927\u304D\u3044\u6574\u6570\u3002 \u7B26\u53F7\u4ED8\u304D\u306E\u7BC4\u56F2\u306F -9223372036854775808 \u304B\u3089 9223372036854775807 \u3067\u3059\u3002 \u7B26\u53F7\u306A\u3057\u306E\u7BC4\u56F2\u306F 0 \u304B\u3089 18446744073709551615 \u3067\u3059\u3002",baseQuery:"BIGINT[[PARAM]]",category:"integer",withPrecision:!0,withScale:!1,withUnsigned:!0,withAutoIncrement:!0}),new u({id:31,name:"float",description:"\u5C0F\u3055\u3044 (\u5358\u7CBE\u5EA6) \u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u308B\u5024\u306F\u3001-3.402823466E+38 \u304B\u3089 -1.175494351E-38\u30010\u3001\u304A\u3088\u3073 1.175494351E-38 \u304B\u3089 3.402823466E+38 \u3067\u3059\u3002",baseQuery:"FLOAT",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:33,name:"double",description:"\u666E\u901A\u30B5\u30A4\u30BA (\u500D\u7CBE\u5EA6) \u306E\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u3066\u3044\u308B\u5024\u306F\u3001-1.7976931348623157E+308 \u304B\u3089 -2.2250738585072014E-308\u30010\u3001\u304A\u3088\u3073 2.2250738585072014E-308 \u304B\u3089 1.7976931348623157E+308 \u3067\u3059\u3002",baseQuery:"DOUBLE",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:35,name:"decimal",description:"\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 \u6841\u657010 (\u7CBE\u5EA6) \u3067\u3001\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u65700\u3067\u3059\u3002",baseQuery:"DECIMAL",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:36,name:"numeric",description:"DECIMAL \u306E\u30B7\u30CE\u30CB\u30E0\u3067\u3059\u3002\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 \u6841\u657010 (\u7CBE\u5EA6) \u3067\u3001\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u65700\u3067\u3059\u3002",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:41,name:"float (m, d)",description:"\u5C0F\u3055\u3044 (\u5358\u7CBE\u5EA6) \u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u308B\u5024\u306F\u3001-3.402823466E+38 \u304B\u3089 -1.175494351E-38\u30010\u3001\u304A\u3088\u3073 1.175494351E-38 \u304B\u3089 3.402823466E+38 \u3067\u3059\u3002",baseQuery:"FLOAT[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:42,name:"float (p)",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3067\u3059\u3002p \u306F\u7CBE\u5EA6\u3092\u30D3\u30C3\u30C8\u3067\u8868\u73FE\u3057\u307E\u3059\u3002",baseQuery:"FLOAT[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:43,name:"double (m, d)",description:"\u666E\u901A\u30B5\u30A4\u30BA (\u500D\u7CBE\u5EA6) \u306E\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u3002 \u8A31\u53EF\u3055\u308C\u3066\u3044\u308B\u5024\u306F\u3001-1.7976931348623157E+308 \u304B\u3089 -2.2250738585072014E-308\u30010\u3001\u304A\u3088\u3073 2.2250738585072014E-308 \u304B\u3089 1.7976931348623157E+308 \u3067\u3059\u3002",baseQuery:"DOUBLE[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:45,name:"decimal (m, d)",description:"\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 M \u306F\u6841\u6570\u306E\u5408\u8A08 (\u7CBE\u5EA6) \u3067\u3001D \u306F\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u6570 (\u30B9\u30B1\u30FC\u30EB) \u3067\u3059\u3002",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:46,name:"numeric (m, d)",description:"DECIMAL \u306E\u30B7\u30CE\u30CB\u30E0\u3067\u3059\u3002\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u3002 M \u306F\u6841\u6570\u306E\u5408\u8A08 (\u7CBE\u5EA6) \u3067\u3001D \u306F\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u6570 (\u30B9\u30B1\u30FC\u30EB) \u3067\u3059\u3002",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),new u({id:101,name:"date",description:'\u65E5\u4ED8\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01" \u304B\u3089 "9999-12-31" \u3067\u3059\u3002',baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_DATE)"]}),new u({id:131,name:"time",description:'\u6642\u9593\u3067\u3059\u3002 \u7BC4\u56F2\u306F\u3001"-838:59:59.000000" \u304B\u3089 "838:59:59.000000" \u3067\u3059\u3002',baseQuery:"TIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_TIME)"]}),new u({id:141,name:"time (p)",description:'\u6642\u9593\u3067\u3059\u3002 \u7BC4\u56F2\u306F\u3001"-838:59:59.000000" \u304B\u3089 "838:59:59.000000" \u3067\u3059\u3002',baseQuery:"TIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["(CURRENT_TIME)"]}),new u({id:112,name:"datetime",description:'\u65E5\u4ED8\u3068\u6642\u9593\u306E\u7D44\u307F\u5408\u308F\u305B\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01 00:00:00.000000" \u304B\u3089 "9999-12-31 23:59:59.999999" \u3067\u3059\u3002',baseQuery:"DATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP","CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"]}),new u({id:115,name:"timestamp",description:'\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u3067\u3059\u3002 \u7BC4\u56F2\u306F "1970-01-01 00:00:01.000000" UTC \u304B\u3089 "2038-01-19 03:14:07.999999" UTC \u3067\u3059\u3002',baseQuery:"TIMESTAMP",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP","CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"]}),new u({id:122,name:"datetime (p)",description:'\u65E5\u4ED8\u3068\u6642\u9593\u306E\u7D44\u307F\u5408\u308F\u305B\u3067\u3059\u3002 \u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u7BC4\u56F2\u306F "1000-01-01 00:00:00.000000" \u304B\u3089 "9999-12-31 23:59:59.999999" \u3067\u3059\u3002',baseQuery:"DATETIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP[[PARAM]]","CURRENT_TIMESTAMP[[PARAM]] ON UPDATE CURRENT_TIMESTAMP[[PARAM]]"]}),new u({id:125,name:"timestamp (p)",description:'\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u3067\u3059\u3002 \u7BC4\u56F2\u306F "1970-01-01 00:00:01.000000" UTC \u304B\u3089 "2038-01-19 03:14:07.999999" UTC \u3067\u3059\u3002',baseQuery:"TIMESTAMP[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,defaultValueCandidates:["CURRENT_TIMESTAMP[[PARAM]]","CURRENT_TIMESTAMP[[PARAM]] ON UPDATE CURRENT_TIMESTAMP[[PARAM]]"]}),new u({id:151,name:"year",description:"4 \u6841\u5F62\u5F0F\u306E\u5E74\u3002",baseQuery:"YEAR",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:301,name:"char",description:"\u683C\u7D0D\u6642\u306B\u5FC5\u305A\u3001\u6307\u5B9A\u3055\u308C\u305F\u9577\u3055\u306B\u306A\u308B\u3088\u3046\u306B\u53F3\u5074\u304C\u30B9\u30DA\u30FC\u30B9\u3067\u57CB\u3081\u3089\u308C\u308B\u56FA\u5B9A\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"CHAR",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:311,name:"char (m)",description:"\u683C\u7D0D\u6642\u306B\u5FC5\u305A\u3001\u6307\u5B9A\u3055\u308C\u305F\u9577\u3055\u306B\u306A\u308B\u3088\u3046\u306B\u53F3\u5074\u304C\u30B9\u30DA\u30FC\u30B9\u3067\u57CB\u3081\u3089\u308C\u308B\u56FA\u5B9A\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:312,name:"varchar (m)",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217\u3067\u3059\u3002",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:321,name:"tinytext",description:"\u6700\u5927\u9577\u304C 255 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TINYTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:322,name:"text",description:"\u6700\u5927\u9577\u304C 65,535 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:323,name:"text (m)",description:"\u6700\u5927\u9577\u304C 65,535 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"TEXT[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:324,name:"mediumtext",description:"\u6700\u5927\u9577\u304C 16,777,215 \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"MEDIUMTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:325,name:"longtext",description:"\u6700\u5927\u9577\u304C 4G \u6587\u5B57\u306E TEXT \u30AB\u30E9\u30E0\u3002",baseQuery:"LONGTEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:3,name:"binary (m)",description:"\u30D0\u30A4\u30CA\u30EA\u30D0\u30A4\u30C8\u6587\u5B57\u5217\u3092\u683C\u7D0D\u3057\u307E\u3059\u3002",baseQuery:"BINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:5,name:"varbinary (m)",description:"\u30D0\u30A4\u30CA\u30EA\u30D0\u30A4\u30C8\u6587\u5B57\u5217\u3092\u683C\u7D0D\u3057\u307E\u3059\u3002",baseQuery:"VARBINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:361,name:"tinyblob",description:"\u6700\u5927\u9577\u304C 255 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"TINYBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:363,name:"blob",description:"\u6700\u5927\u9577\u304C 65,535 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"BLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:364,name:"blob (m)",description:"\u6700\u5927\u9577\u304C 65,535 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"BLOB[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:365,name:"mediumblob",description:"\u6700\u5927\u9577\u304C 16,777,215 \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"MEDIUMBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:367,name:"longblob",description:"\u6700\u5927\u9577\u304C 4G \u30D0\u30A4\u30C8\u306E BLOB \u30AB\u30E9\u30E0\u3002",baseQuery:"LONGBLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:422,name:"json",description:"\u6587\u66F8\u306E\u578B\u5F0F\u3067\u3042\u308BJSON\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"JSON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2001,name:"geometry",description:"\u7A7A\u9593\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002\u70B9\u3001\u7DDA\u3001\u591A\u89D2\u5F62\u3001\u304A\u3088\u3073\u305D\u306E\u4ED6\u306E\u5F62\u72B6\u3092\u542B\u3081\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002",baseQuery:"GEOMETRY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2011,name:"point",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u7A7A\u9593\u4E0A\u306E\u5358\u4E00\u306E\u70B9\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"POINT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2012,name:"linestring",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u7A7A\u9593\u4E0A\u306E\u8907\u6570\u306E\u70B9\u3092\u7D50\u3076\u76F4\u7DDA\u30BB\u30B0\u30E1\u30F3\u30C8\u306E\u9023\u7D9A\u3057\u305F\u30BB\u30C3\u30C8\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"LINESTRING",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2013,name:"polygon",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u30012\u6B21\u5143\u5E73\u9762\u4E0A\u306E\u5358\u4E00\u306E\u9818\u57DF\u3092\u8868\u3059\u9589\u3058\u305F\u30EB\u30FC\u30D7\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"POLYGON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2021,name:"multipoint",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u70B9\u3092\u8868\u3059\u8907\u6570\u306EPOINT\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTIPOINT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2022,name:"multilinestring",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u7DDA\u5206\u3092\u8868\u3059\u8907\u6570\u306ELINESTRING\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTILINESTRING",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2023,name:"multipolygon",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306E\u30DD\u30EA\u30B4\u30F3\u3092\u8868\u3059\u8907\u6570\u306EPOLYGON\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3067\u3059\u3002",baseQuery:"MULTIPOLYGON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2031,name:"geometrycollection",description:"GEOMETRY\u30C7\u30FC\u30BF\u578B\u306E1\u3064\u3067\u3042\u308A\u3001\u8907\u6570\u306EGEOMETRY\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u96C6\u5408\u3092\u8868\u3057\u307E\u3059\u3002",baseQuery:"GEOMETRYCOLLECTION",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2101,name:"enum",description:"\u6587\u5B57\u5217\u306E\u30EA\u30B9\u30C8\u306E\u4E2D\u304B\u30891\u3064\u3092\u9078\u629E\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"ENUM",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2102,name:"set",description:"ENUM\u306E\u62E1\u5F35\u7248\u3067\u3042\u308A\u3001\u6587\u5B57\u5217\u306E\u30EA\u30B9\u30C8\u304B\u3089\u8907\u6570\u306E\u9078\u629E\u80A2\u3092\u9078\u629E\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"SET",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:411,name:"uuid",description:"128\u30D3\u30C3\u30C8\u306EUUID\u5024\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B (MariaDB 10.7+)\u3002",baseQuery:"UUID",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:1113,name:"inet4",description:"IPv4\u30A2\u30C9\u30EC\u30B9\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B (MariaDB 10.10+)\u3002",baseQuery:"INET4",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:1114,name:"inet6",description:"IPv6\u30A2\u30C9\u30EC\u30B9\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B (MariaDB 10.5+)\u3002",baseQuery:"INET6",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),u.EMPTY],sqlite:[new u({id:15,name:"integer",description:"\u6574\u6570\u5024\u3002INTEGER\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u3002\u5358\u4E00\u5217\u306EPRIMARY KEY\u306B\u8A2D\u5B9A\u3059\u308B\u3068rowid\u30A8\u30A4\u30EA\u30A2\u30B9\u3068\u306A\u308A\u81EA\u52D5\u63A1\u756A\u76F8\u5F53\u306B\u306A\u308B\u3002",baseQuery:"INTEGER",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:33,name:"real",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u5024\u3002REAL\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u3002",baseQuery:"REAL",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:325,name:"text",description:"\u6587\u5B57\u5217\u3002TEXT\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u3002",baseQuery:"TEXT",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:363,name:"blob",description:"\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002BLOB\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3(\u578B\u6307\u5B9A\u306A\u3057\u3068\u540C\u7FA9)\u3002",baseQuery:"BLOB",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:36,name:"numeric",description:"\u6570\u5024\u3002NUMERIC\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u3002",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:6,name:"boolean",description:"\u8AD6\u7406\u5024\u3002NUMERIC\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"BOOLEAN",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:311,name:"char (n)",description:"\u56FA\u5B9A\u9577\u6587\u5B57\u5217\u306E\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002n\u306F\u69CB\u6587\u4E0A\u66F8\u3051\u308B\u304C\u7121\u8996\u3055\u308CTEXT\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u3002",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:312,name:"varchar (n)",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217\u306E\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002n\u306F\u69CB\u6587\u4E0A\u66F8\u3051\u308B\u304C\u7121\u8996\u3055\u308CTEXT\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u3002",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:101,name:"date",description:"\u65E5\u4ED8\u306E\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002NUMERIC\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u6163\u7528\u578B\u3002",baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:112,name:"datetime",description:"\u65E5\u6642\u306E\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002NUMERIC\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u6163\u7528\u578B\u3002",baseQuery:"DATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:45,name:"decimal (p, s)",description:"\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u306E\u5B9F\u7528\u30A8\u30A4\u30EA\u30A2\u30B9\u3002p,s\u306F\u69CB\u6587\u4E0A\u66F8\u3051\u308B\u304C\u7121\u8996\u3055\u308CNUMERIC\u30A2\u30D5\u30A3\u30CB\u30C6\u30A3\u306B\u89E3\u6C7A\u3055\u308C\u308B\u3002",baseQuery:"DECIMAL[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1}),u.EMPTY],bigquery:[new u({id:17,name:"int64",description:"8\u30D0\u30A4\u30C8\u7B26\u53F7\u4ED8\u304D\u6574\u6570\u3002INT/SMALLINT/INTEGER/BIGINT/TINYINT/BYTEINT \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"INT64",category:"integer",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:33,name:"float64",description:"\u500D\u7CBE\u5EA6\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u5024\u3002FLOAT \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"FLOAT64",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:36,name:"numeric",description:"\u7CBE\u5EA638\u6841\u30FB\u30B9\u30B1\u30FC\u30EB9\u6841\u306E\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u5024\u3002DECIMAL \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"NUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:46,name:"numeric (p, s)",description:"\u7CBE\u5EA6\u30FB\u30B9\u30B1\u30FC\u30EB\u3092\u6307\u5B9A\u3059\u308B\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u5024\u3002DECIMAL \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002\u7CBE\u5EA6\u6307\u5B9A\u4ED8\u304D DDL \u306E\u8AAD\u8FBC\u306F node-sql-parser \u975E\u5BFE\u5FDC\u3002",baseQuery:"NUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:37,name:"bignumeric",description:"\u7CBE\u5EA676.76\u6841\u30FB\u30B9\u30B1\u30FC\u30EB38\u6841\u306E\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u5024\u3002BIGDECIMAL \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"BIGNUMERIC",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:49,name:"bignumeric (p, s)",description:"\u7CBE\u5EA6\u30FB\u30B9\u30B1\u30FC\u30EB\u3092\u6307\u5B9A\u3059\u308B\u56FA\u5B9A\u5C0F\u6570\u70B9\u6570\u5024\u3002BIGDECIMAL \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002\u7CBE\u5EA6\u6307\u5B9A\u4ED8\u304D DDL \u306E\u8AAD\u8FBC\u306F node-sql-parser \u975E\u5BFE\u5FDC\u3002",baseQuery:"BIGNUMERIC[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:6,name:"bool",description:"\u8AD6\u7406\u5024 (\u771F/\u507D)\u3002BOOLEAN \u306F\u30A8\u30A4\u30EA\u30A2\u30B9\u3002",baseQuery:"BOOL",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:325,name:"string",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217 (Unicode)\u3002",baseQuery:"STRING",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:312,name:"string (n)",description:"\u6700\u5927\u9577\u3092\u6307\u5B9A\u3059\u308B\u53EF\u5909\u9577\u6587\u5B57\u5217 (Unicode)\u3002\u7CBE\u5EA6\u6307\u5B9A\u4ED8\u304D DDL \u306E\u8AAD\u8FBC\u306F node-sql-parser \u975E\u5BFE\u5FDC\u3002",baseQuery:"STRING[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:367,name:"bytes",description:"\u53EF\u5909\u9577\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002",baseQuery:"BYTES",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:5,name:"bytes (n)",description:"\u6700\u5927\u9577\u3092\u6307\u5B9A\u3059\u308B\u53EF\u5909\u9577\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002",baseQuery:"BYTES[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:101,name:"date",description:"\u66A6\u306E\u65E5\u4ED8 (\u5E74\u6708\u65E5)\u3002",baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:111,name:"datetime",description:"\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\u306A\u3057\u306E\u65E5\u4ED8\u3068\u6642\u523B\u3002",baseQuery:"DATETIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:131,name:"time",description:"\u6642\u523B\u3002",baseQuery:"TIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:112,name:"timestamp",description:"UTC \u57FA\u6E96\u306E\u7D76\u5BFE\u6642\u70B9\u3092\u8868\u3059\u65E5\u4ED8\u3068\u6642\u523B\u3002",baseQuery:"TIMESTAMP",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:422,name:"json",description:"JSON \u5F62\u5F0F\u306E\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"JSON",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),new u({id:2002,name:"geography",description:"\u7403\u4F53\u5730\u7403\u5EA7\u6A19\u7CFB\u306E\u5730\u7406\u7A7A\u9593\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"GEOGRAPHY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1,arrayQueryTemplate:"ARRAY<[[TYPE]]>"}),u.EMPTY],snowflake:[new u({id:36,name:"number",description:"\u6570\u5024\u578B\u3002\u65E2\u5B9A\u306E\u7CBE\u5EA6\u30FB\u30B9\u30B1\u30FC\u30EB\u306F (38, 0)\u3002INT/INTEGER/BIGINT \u7B49\u306E\u6574\u6570\u578B\u306F\u3059\u3079\u3066 NUMBER(38,0) \u306E\u30B7\u30CE\u30CB\u30E0\u3068\u3057\u3066\u6271\u308F\u308C\u308B\u3002",baseQuery:"NUMBER",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!0}),new u({id:46,name:"number (p, s)",description:"\u7CBE\u5EA6\u30FB\u30B9\u30B1\u30FC\u30EB\u3092\u6307\u5B9A\u3059\u308B\u6570\u5024\u578B\u3002INT/INTEGER/BIGINT \u7B49\u306F NUMBER(38,0) \u306E\u30B7\u30CE\u30CB\u30E0\u3067\u3042\u308A\u3001\u3053\u306E\u578B\u3067\u7CBE\u5EA6\u30FB\u30B9\u30B1\u30FC\u30EB\u3092\u660E\u793A\u7684\u306B\u6307\u5B9A\u3057\u305F\u3082\u306E\u306B\u76F8\u5F53\u3059\u308B\u3002",baseQuery:"NUMBER[[PARAM]]",category:"decimal",withPrecision:!0,withScale:!0,withUnsigned:!1,withAutoIncrement:!0}),new u({id:33,name:"float",description:"\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u5024\u3002\u500D\u7CBE\u5EA6\u6D6E\u52D5\u5C0F\u6570\u70B9\u3068\u3057\u3066\u683C\u7D0D\u3055\u308C\u308B\u3002",baseQuery:"FLOAT",category:"decimal",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:301,name:"char",description:"\u56FA\u5B9A\u9577\u6587\u5B57\u5217 (\u5B9F\u969B\u306B\u306F\u53EF\u5909\u9577\u3068\u3057\u3066\u683C\u7D0D\u3055\u308C\u308B)\u3002",baseQuery:"CHAR",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:311,name:"char (n)",description:"\u56FA\u5B9A\u9577\u6587\u5B57\u5217 (\u5B9F\u969B\u306B\u306F\u53EF\u5909\u9577\u3068\u3057\u3066\u683C\u7D0D\u3055\u308C\u308B)\u3002",baseQuery:"CHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:302,name:"varchar",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217\u3002STRING/TEXT \u306F\u30B7\u30CE\u30CB\u30E0\u3002",baseQuery:"VARCHAR",category:"text",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:312,name:"varchar (n)",description:"\u53EF\u5909\u9577\u6587\u5B57\u5217\u3002STRING/TEXT \u306F\u30B7\u30CE\u30CB\u30E0\u3002",baseQuery:"VARCHAR[[PARAM]]",category:"text",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:4,name:"binary",description:"\u56FA\u5B9A\u9577\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002",baseQuery:"BINARY",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:3,name:"binary (n)",description:"\u56FA\u5B9A\u9577\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002",baseQuery:"BINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:5,name:"varbinary (n)",description:"\u53EF\u5909\u9577\u30D0\u30A4\u30CA\u30EA\u30C7\u30FC\u30BF\u3002BINARY \u306E\u30B7\u30CE\u30CB\u30E0\u3002",baseQuery:"VARBINARY[[PARAM]]",category:"bit",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:6,name:"boolean",description:"\u8AD6\u7406\u5024 (\u771F/\u507D)\u3002",baseQuery:"BOOLEAN",category:"bit",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:101,name:"date",description:"\u66A6\u306E\u65E5\u4ED8 (\u5E74\u6708\u65E5)\u3002",baseQuery:"DATE",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:131,name:"time",description:"\u6642\u523B\u3002\u65E2\u5B9A\u306E\u7CBE\u5EA6\u306F\u79D2\u306E\u5C0F\u6570\u70B9\u4EE5\u4E0B9\u6841\u3002",baseQuery:"TIME",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:141,name:"time (p)",description:"\u7CBE\u5EA6 (\u79D2\u306E\u5C0F\u6570\u70B9\u4EE5\u4E0B\u6841\u6570) \u3092\u6307\u5B9A\u3059\u308B\u6642\u523B\u578B\u3002",baseQuery:"TIME[[PARAM]]",category:"timestamp",withPrecision:!0,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:111,name:"timestamp_ntz",description:"\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\u306A\u3057\u306E\u65E5\u4ED8\u3068\u6642\u523B\u3002",baseQuery:"TIMESTAMP_NTZ",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:112,name:"timestamp_tz",description:"\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\u4ED8\u304D\u306E\u65E5\u4ED8\u3068\u6642\u523B\u3002",baseQuery:"TIMESTAMP_TZ",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:113,name:"timestamp_ltz",description:"\u30BB\u30C3\u30B7\u30E7\u30F3\u306E\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\u3067\u89E3\u91C8\u3055\u308C\u308B\u65E5\u4ED8\u3068\u6642\u523B\u3002",baseQuery:"TIMESTAMP_LTZ",category:"timestamp",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:9601,name:"variant",description:"\u4EFB\u610F\u306E\u4ED6\u306E\u30C7\u30FC\u30BF\u578B\u306E\u5024\u3092\u683C\u7D0D\u3067\u304D\u308B\u534A\u69CB\u9020\u5316\u30C7\u30FC\u30BF\u578B\u3002DDL \u8AAD\u8FBC (\u30A4\u30F3\u30DD\u30FC\u30C8) \u306F node-sql-parser \u306E snowflake \u30C0\u30A4\u30A2\u30EC\u30AF\u30C8\u306E\u5236\u7D04\u306B\u3088\u308A\u975E\u5BFE\u5FDC\u3002",baseQuery:"VARIANT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:9602,name:"object",description:"\u30AD\u30FC\u3068\u5024\u306E\u30DA\u30A2\u306E\u96C6\u5408\u3092\u683C\u7D0D\u3059\u308B\u534A\u69CB\u9020\u5316\u30C7\u30FC\u30BF\u578B\u3002DDL \u8AAD\u8FBC (\u30A4\u30F3\u30DD\u30FC\u30C8) \u306F node-sql-parser \u306E snowflake \u30C0\u30A4\u30A2\u30EC\u30AF\u30C8\u306E\u5236\u7D04\u306B\u3088\u308A\u975E\u5BFE\u5FDC\u3002",baseQuery:"OBJECT",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:9603,name:"array",description:"\u5024\u306E\u914D\u5217\u3092\u683C\u7D0D\u3059\u308B\u534A\u69CB\u9020\u5316\u30C7\u30FC\u30BF\u578B\u3002DDL \u8AAD\u8FBC (\u30A4\u30F3\u30DD\u30FC\u30C8) \u306F node-sql-parser \u306E snowflake \u30C0\u30A4\u30A2\u30EC\u30AF\u30C8\u306E\u5236\u7D04\u306B\u3088\u308A\u975E\u5BFE\u5FDC\u3002",baseQuery:"ARRAY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2001,name:"geometry",description:"\u5E73\u9762 (\u30E6\u30FC\u30AF\u30EA\u30C3\u30C9) \u5EA7\u6A19\u7CFB\u306E\u7A7A\u9593\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"GEOMETRY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),new u({id:2002,name:"geography",description:"\u7403\u4F53\u5730\u7403\u5EA7\u6A19\u7CFB\u306E\u5730\u7406\u7A7A\u9593\u30C7\u30FC\u30BF\u3092\u683C\u7D0D\u3059\u308B\u30C7\u30FC\u30BF\u578B\u3002",baseQuery:"GEOGRAPHY",category:"other",withPrecision:!1,withScale:!1,withUnsigned:!1,withAutoIncrement:!1}),u.EMPTY]},Zn=t=>Kh[t],uc=(t,e,n)=>{let r=new Map(Zn(t).map(i=>[i.id,i])),o=e;if(n<20260321&&(o=o.map(i=>{let a=r.get(i.id);return a==null?i:u.migrateDefaultValueCandidates(i,a,n)})),n<20250718&&t==="postgres"){let i=r.get(9103);i!=null&&o.every(a=>a.id!==9103)&&o.push(i)}return n<20251130&&t==="postgres"&&(o=o.map(i=>{let a=r.get(i.id);return a==null||a.withAutoIncrement===!1?i:new u({...i,withAutoIncrement:!0})})),n<20260504&&(o=o.map(i=>{let a=r.get(i.id);return a==null?i:new u({...i,category:a.category})})),o};var dc=20260504,Fn=class t{constructor({databaseType:e,columnTypes:n,version:r}){this.databaseType=e,this.columnTypes=n,this.version=r}static create(e){let n=Zn(e);return new t({databaseType:e,columnTypes:n,version:dc})}getDatabase(){return ee.get(this.databaseType)}initToColumnTypeMapping(){let e=new Map(this.columnTypes.map(n=>[n.id,n]));return n=>e.get(n)??u.EMPTY}findColumnType(e){return this.columnTypes.find(n=>n.id===e)??null}toJSON(){return{databaseType:this.databaseType,columnTypes:this.columnTypes.map(e=>e.toJSON()),version:this.version}}static toObject(e){S(e,"databaseType"),S(e,"columnTypes");let n=e.databaseType,r=j(e.columnTypes,"columnTypes",a=>u.toObject(a)),o="version"in e?e.version:0,i=uc(n,r,o);return new t({databaseType:n,columnTypes:i,version:dc})}equals(e){if(this.databaseType!==e.databaseType||this.columnTypes.length!==e.columnTypes.length)return!1;for(let n=0;n<this.columnTypes.length;n++)if(this.columnTypes[n].equals(e.columnTypes[n])===!1)return!1;return!0}};var Go=class t{constructor({schemaId:e,schemaName:n,description:r}){this.schemaId=e,this.schemaName=n,this.description=r}static create(e,n){return new t({schemaId:X(),schemaName:e,description:n})}update(e){return new t({schemaId:this.schemaId,schemaName:e.schemaName??this.schemaName,description:e.description??this.description})}toJSON(){return{schemaId:this.schemaId,schemaName:this.schemaName,description:this.description}}static toObject(e){return S(e,"schemaId"),S(e,"schemaName"),new t({schemaId:e.schemaId,schemaName:e.schemaName,description:"description"in e?e.description:""})}equals(e){return this.schemaId===e.schemaId&&this.schemaName===e.schemaName&&this.description===e.description}},mc=Go;var Yo=class t{constructor(e,n,r){this.defaultSchemaId=r.has(e)?e:"",this.schemaIds=n,this.schemaMap=r}static create(e={}){let n=e.defaultSchemaId||"",r=e.schemas||[],o=r.map(a=>a.schemaId),i=new Map(r.map(a=>[a.schemaId,a]));return new t(n,o,i)}findSchema(e){if(e==="")return this.findDefaultSchema();let n=this.schemaMap.get(e);return n??this.findDefaultSchema()}findDefaultSchema(){return this.defaultSchemaId===""?null:this.schemaMap.get(this.defaultSchemaId)||null}hasSchemas(){return this.schemaIds.length>0}getSchemas(){return this.schemaIds.map(e=>this.schemaMap.get(e))}equals(e){if(this===e)return!0;if(this.defaultSchemaId!==e.defaultSchemaId||this.schemaIds.length!==e.schemaIds.length)return!1;for(let[n,r]of this.schemaIds.entries()){let o=e.schemaIds[n];if(r!==o)return!1;let i=this.schemaMap.get(r),a=e.schemaMap.get(r);if(i==null||a==null||i.equals(a)===!1)return!1}return!0}toJSON(){return{defaultSchemaId:this.defaultSchemaId,schemas:this.getSchemas().map(e=>e.toJSON())}}static toObject(e){S(e,"defaultSchemaId"),S(e,"schemas");let n=e.defaultSchemaId,r=j(e.schemas,"schemas",a=>mc.toObject(a)),o=r.map(a=>a.schemaId),i=new Map(r.map(a=>[a.schemaId,a]));return new t(n,o,i)}},Cr=Yo;var qt=class t{constructor(e,n,r){this.name=e;this.displayFunction=n;this.logicalNameIncluded=r}static{this.PHYSICAL=new t("Physical",(e,n)=>e,!1)}static{this.LOGICAL=new t("Logical",(e,n)=>n,!0)}static{this.BOTH=new t("Both",(e,n)=>`${n} / ${e}`,!0)}static values(){return[t.PHYSICAL,t.LOGICAL,t.BOTH]}displayName(e,n){return this.displayFunction(e,n)}withLogicalName(){return this.logicalNameIncluded}toJSON(){return{styleName:this.name}}static toObject(e){if(!("styleName"in e))return t.BOTH;let n=e.styleName;for(let r of t.values())if(r.name===n)return r;return t.BOTH}equals(e){return this.name===e.name}};var ft=class t{static{this.ALL=new t("all","All Columns",()=>!0)}static{this.ONLY_PK=new t("pk","Only PK Columns",e=>e.primaryKey)}static{this.PK_OR_FK=new t("pk_fk","PK or FK Columns",(e,n)=>e.primaryKey||n)}static{this.NONE=new t("none","No Columns",()=>!1)}constructor(e,n,r){this.key=e,this.name=n,this.viewableFunction=r}static values(){return[t.ALL,t.ONLY_PK,t.PK_OR_FK,t.NONE]}viewable(e,n){return this.viewableFunction(e,n)}toJSON(){return{style:this.key}}static toObject(e){if(!("style"in e))return t.ALL;let n=e.style;for(let r of t.values())if(r.key===n)return r;return t.ALL}equals(e){return this.key===e.key}};var ln=class t{constructor({fileName:e,withTable:n=!0,withIndex:r=!0,withForeignKey:o=!0,withSchema:i=!0,withComment:a=!0,commentStyle:s="logical_name",commentSeparator:l=" : "}){this.fileName=e,this.withTable=n,this.withIndex=r,this.withForeignKey=o,this.withSchema=i,this.withComment=a,this.commentStyle=s,this.commentSeparator=l}equals(e){return!(this.fileName!==e.fileName||this.withTable!==e.withTable||this.withIndex!==e.withIndex||this.withForeignKey!==e.withForeignKey||this.withSchema!==e.withSchema||this.withComment!==e.withComment||this.commentStyle!==e.commentStyle||this.commentSeparator!==e.commentSeparator)}toJSON(){return{fileName:this.fileName,withTable:this.withTable,withIndex:this.withIndex,withForeignKey:this.withForeignKey,withSchema:this.withSchema,withComment:this.withComment,commentStyle:this.commentStyle,commentSeparator:this.commentSeparator}}static toObject(e){S(e,"fileName");let n="withTable"in e?e.withTable:!0,r="withIndex"in e?e.withIndex:!0,o="withForeignKey"in e?e.withForeignKey:!0,i="withSchema"in e?e.withSchema:!0,a="withComment"in e?e.withComment:!0,s="commentStyle"in e?e.commentStyle:"logical_name",l="commentSeparator"in e?e.commentSeparator:" : ";return new t({fileName:e.fileName,withTable:n,withIndex:r,withForeignKey:o,withSchema:i,withComment:a,commentStyle:s,commentSeparator:l})}};var jo=class t{constructor({perspectiveId:e,perspectiveName:n,description:r,containIds:o}){this.perspectiveId=e,this.perspectiveName=n,this.description=r,this.containIds=new Set(o)}static create(e,n=""){return new t({perspectiveId:X(),perspectiveName:e,description:n,containIds:[]})}containsModel(e){return this.containIds.has(e)}getContainIds(){return Array.from(this.containIds)}update(e,n){return new t({perspectiveId:this.perspectiveId,perspectiveName:e,description:n,containIds:this.containIds})}updateContainId(e,n){let r=new Set(this.containIds);return n==="add"?r.add(e):r.delete(e),new t({perspectiveId:this.perspectiveId,perspectiveName:this.perspectiveName,description:this.description,containIds:r})}updateAllContainIds(e){return this.containIds.size===0&&e.length===0?this:this.containIds.size===e.length&&[...e].every(r=>this.containIds.has(r))?this:new t({perspectiveId:this.perspectiveId,perspectiveName:this.perspectiveName,description:this.description,containIds:e})}equals(e){return this.perspectiveId!==e.perspectiveId||this.perspectiveName!==e.perspectiveName||this.description!==e.description||this.containIds.size!==e.containIds.size?!1:[...this.containIds].every(n=>e.containIds.has(n))}toJSON(){let e=Array.from(this.containIds).sort();return{perspectiveId:this.perspectiveId,perspectiveName:this.perspectiveName,...this.description!==""&&{description:this.description},containIds:e}}static toObject(e){return S(e,"perspectiveId"),S(e,"perspectiveName"),new t({perspectiveId:e.perspectiveId,perspectiveName:e.perspectiveName,description:"description"in e?e.description:"",containIds:"containIds"in e?e.containIds:[]})}},pc=jo;var Wo=class t{constructor(e){this.perspectiveIds=e.map(n=>n.perspectiveId),this.perspectiveMap=new Map(e.map(n=>[n.perspectiveId,n]))}findModel(e){return this.perspectiveMap.get(e)||null}getModels(){return this.perspectiveIds.map(e=>this.perspectiveMap.get(e))}updateModel(e){let n=this.perspectiveMap.get(e.perspectiveId);if(n==null){let o=[...this.getModels(),e];return new t(o)}if(n.equals(e)===!0)return this;let r=this.getModels().map(o=>o.perspectiveId!==e.perspectiveId?o:e);return new t(r)}equals(e){return an(this.perspectiveIds,e.perspectiveIds)===!1?!1:Xe(this.perspectiveMap,e.perspectiveMap)}},_r=Wo;var cn=class t{constructor({displayNameStyle:e=qt.BOTH,displayColumnStyle:n=ft.ALL,exportDdlSetting:r,perspectiveModelStorage:o,showRelationNames:i=!1,syncRemoteChanges:a=!1}){this.displayNameStyle=e,this.displayColumnStyle=n,this.exportDdlSetting=r,this.perspectiveModelStorage=o,this.showRelationNames=i,this.syncRemoteChanges=a}static create(e){let n=new ln({fileName:e}),r=new _r([]);return new t({exportDdlSetting:n,perspectiveModelStorage:r})}findPerspectiveModel(e){return this.perspectiveModelStorage.findModel(e)}getPerspectiveModels(){return this.perspectiveModelStorage.getModels()}update({displayNameStyle:e=null,displayColumnStyle:n=null,exportDdlSetting:r=null,perspectiveModels:o=null,showRelationNames:i=null,syncRemoteChanges:a=null}){return e==null&&n==null&&r==null&&o==null&&i==null&&a==null?this:new t({displayNameStyle:e??this.displayNameStyle,displayColumnStyle:n??this.displayColumnStyle,exportDdlSetting:r??this.exportDdlSetting,perspectiveModelStorage:o!=null?new _r(o):this.perspectiveModelStorage,showRelationNames:i??this.showRelationNames,syncRemoteChanges:a??this.syncRemoteChanges})}updatePerspective(e){let n=this.perspectiveModelStorage.updateModel(e);return n===this.perspectiveModelStorage?this:new t({displayNameStyle:this.displayNameStyle,displayColumnStyle:this.displayColumnStyle,exportDdlSetting:this.exportDdlSetting,perspectiveModelStorage:n,showRelationNames:this.showRelationNames,syncRemoteChanges:this.syncRemoteChanges})}toJSON(){let e=this.perspectiveModelStorage.getModels().map(n=>n.toJSON());return{displayStyle:this.displayNameStyle.toJSON(),...this.displayColumnStyle.key!==ft.ALL.key&&{displayColumn:this.displayColumnStyle.toJSON()},exportDdlSetting:this.exportDdlSetting.toJSON(),...e.length>0&&{perspectiveModels:e},...this.showRelationNames&&{showRelationNames:!0},...this.syncRemoteChanges&&{syncRemoteChanges:!0}}}static toObject(e){S(e,"exportDdlSetting");let n="displayStyle"in e?qt.toObject(e.displayStyle):qt.BOTH,r="displayColumn"in e?ft.toObject(e.displayColumn):ft.ALL,o=ln.toObject(e.exportDdlSetting),i="perspectiveModels"in e?j(e.perspectiveModels,"perspectiveModels",l=>pc.toObject(l)):[],a="showRelationNames"in e?e.showRelationNames:!1,s="syncRemoteChanges"in e?e.syncRemoteChanges:!1;return new t({displayNameStyle:n,displayColumnStyle:r,exportDdlSetting:o,perspectiveModelStorage:new _r(i),showRelationNames:a,syncRemoteChanges:s})}equals(e){return!(this.displayNameStyle.equals(e.displayNameStyle)===!1||this.displayColumnStyle.equals(e.displayColumnStyle)===!1||this.exportDdlSetting.equals(e.exportDdlSetting)===!1||this.perspectiveModelStorage.equals(e.perspectiveModelStorage)===!1||this.showRelationNames!==e.showRelationNames||this.syncRemoteChanges!==e.syncRemoteChanges)}};var Gh=/^#[0-9A-Fa-f]{6}$/,re=class t{static{this.WHITE=new t({red:255,green:255,blue:255})}static{this.BLACK=new t({red:0,green:0,blue:0})}constructor({red:e,green:n,blue:r}){this.red=e,this.green=n,this.blue=r}static fromHex(e){if(Gh.test(e)===!1)throw new Error(`Invalid color hex string: ${e}`);let n=parseInt(e.substring(1,3),16),r=parseInt(e.substring(3,5),16),o=parseInt(e.substring(5,7),16);return new t({red:n,green:r,blue:o})}toHex(){let e=this.red.toString(16).padStart(2,"0"),n=this.green.toString(16).padStart(2,"0"),r=this.blue.toString(16).padStart(2,"0");return`#${e}${n}${r}`.toUpperCase()}toRgba(e=1){return`rgba(${this.red}, ${this.green}, ${this.blue}, ${e})`}reverseGrayscale(){let e=255-(this.red+this.green+this.blue)/3;return new t({red:e,green:e,blue:e})}equals(e){return this.red===e.red&&this.green===e.green&&this.blue===e.blue}static toObject(e){return S(e,"red"),S(e,"green"),S(e,"blue"),new t({red:e.red,green:e.green,blue:e.blue})}toJSON(){return{red:this.red,green:this.green,blue:this.blue}}};var Qn=class t{constructor({positionX:e,positionY:n,width:r,height:o}){this.positionX=e,this.positionY=n,this.width=r,this.height=o}static createFromPoints(e,n){let r=Math.min(e.x,n.x),o=Math.min(e.y,n.y),i=Math.max(Math.abs(e.x-n.x),2),a=Math.max(Math.abs(e.y-n.y),2);return new t({positionX:r,positionY:o,width:i,height:a})}static createFromEdges(e){let n=e.left,r=e.top,o=e.right-e.left,i=e.bottom-e.top;return new t({positionX:n,positionY:r,width:o,height:i})}move(e){return new t({positionX:this.positionX+e.x,positionY:this.positionY+e.y,width:this.width,height:this.height})}get left(){return this.positionX}get right(){return this.positionX+this.width}get xCenter(){return this.positionX+this.width/2}get top(){return this.positionY}get bottom(){return this.positionY+this.height}get yCenter(){return this.positionY+this.height/2}get center(){return{x:this.xCenter,y:this.yCenter}}contains(e){return e instanceof t?this.containsArea(e):this.containsPoint(e)}containsArea(e){return!(this.left>e.left||this.right<e.right||this.top>e.top||this.bottom<e.bottom)}containsPoint(e){return!(e.x<this.left||e.x>this.right||e.y<this.top||e.y>this.bottom)}static toObject(e){return S(e,"positionX"),S(e,"positionY"),S(e,"width"),S(e,"height"),new t({positionX:e.positionX,positionY:e.positionY,width:e.width,height:e.height})}toJSON(){return{positionX:this.positionX,positionY:this.positionY,width:this.width,height:this.height}}equals(e){return!(this.positionX!==e.positionX||this.positionY!==e.positionY||this.width!==e.width||this.height!==e.height)}};var hc="center",fc="center",Jo=9,un=class t{constructor({memoId:e,memo:n,rectangleViewModel:r,backgroundColor:o,foregroundColor:i,verticalAlign:a=hc,horizontalAlign:s=fc,fontSize:l=Jo,createdAt:c=null}){this.memoId=e,this.memo=n,this.rectangleViewModel=r,this.backgroundColor=o,this.foregroundColor=i,this.verticalAlign=a,this.horizontalAlign=s,this.fontSize=l>=1?l:1,this.createdAt=c||new Date}static create(e,n,r=Jo){return new t({memoId:X(),memo:"",rectangleViewModel:e,backgroundColor:n.background,foregroundColor:n.foreground,fontSize:r})}updateMemo(e){return this.memo===e?this:new t({...this,memo:e})}updateRectangle(e){return e.equals(this.rectangleViewModel)?this:new t({...this,rectangleViewModel:e})}updateColor(e=null,n=null){let r=e||this.backgroundColor,o=n||this.foregroundColor;return this.backgroundColor.equals(r)&&this.foregroundColor.equals(o)?this:new t({...this,backgroundColor:r,foregroundColor:o})}updateVerticalAlign(e){return this.verticalAlign===e?this:new t({...this,verticalAlign:e})}updateHorizontalAlign(e){return this.horizontalAlign===e?this:new t({...this,horizontalAlign:e})}updateFontSize(e){return this.fontSize===e||e<1?this:new t({...this,fontSize:e})}move(e){let n=this.rectangleViewModel.move(e);return new t({...this,rectangleViewModel:n})}toJSON(){return{memoId:this.memoId,memo:this.memo,rectangleViewModel:this.rectangleViewModel.toJSON(),backgroundColor:this.backgroundColor.toJSON(),foregroundColor:this.foregroundColor.toJSON(),verticalAlign:this.verticalAlign,horizontalAlign:this.horizontalAlign,fontSize:this.fontSize,createdAt:this.createdAt}}static toObject(e){S(e,"memoId"),S(e,"memo"),S(e,"rectangleViewModel");let n="backgroundColor"in e?re.toObject(e.backgroundColor):re.WHITE,r="foregroundColor"in e?re.toObject(e.foregroundColor):re.BLACK,o="verticalAlign"in e?e.verticalAlign:hc,i="horizontalAlign"in e?e.horizontalAlign:fc,a="fontSize"in e?e.fontSize:Jo,s="createdAt"in e?Ve(e.createdAt):new Date;return new t({memoId:e.memoId,memo:e.memo,rectangleViewModel:Qn.toObject(e.rectangleViewModel),backgroundColor:n,foregroundColor:r,verticalAlign:o,horizontalAlign:i,fontSize:a,createdAt:s})}equals(e){return!(this.memoId!==e.memoId||this.memo!==e.memo||this.rectangleViewModel.equals(e.rectangleViewModel)===!1||this.backgroundColor.equals(e.backgroundColor)===!1||this.foregroundColor.equals(e.foregroundColor)===!1||this.verticalAlign!==e.verticalAlign||this.horizontalAlign!==e.horizontalAlign||this.fontSize!==e.fontSize||this.createdAt.getTime()!==e.createdAt.getTime())}};var Bn=class t{constructor(e,n,r){this.memoIdMap=new Map(e),this.foregroundIds=n,this.backgroundIds=r}static create(e,n){return new t(new Map(e.concat(n).map(r=>[r.memoId,r])),e.map(r=>r.memoId),n.map(r=>r.memoId))}find(e){return this.memoIdMap.get(e)||null}getMemos(){let e=this.foregroundIds.map(r=>this.memoIdMap.get(r)).filter(r=>r!=null),n=this.backgroundIds.map(r=>this.memoIdMap.get(r)).filter(r=>r!=null);return{frontMemos:e,backMemos:n}}addMemo(e,n="front"){let r=new Map(this.memoIdMap);r.set(e.memoId,e);let o=n==="front"?[...this.foregroundIds,e.memoId]:this.foregroundIds,i=n==="back"?[e.memoId,...this.backgroundIds]:this.backgroundIds;return new t(r,o,i)}updateMemo(e){let n=new Map(this.memoIdMap);return n.set(e.memoId,e),new t(n,this.foregroundIds,this.backgroundIds)}deleteMemo(e){let n=new Map(this.memoIdMap);if(n.delete(e)===!1)return this;let o=this.foregroundIds.indexOf(e),i=o<0?this.backgroundIds.indexOf(e):-1,a=o>=0?Nr(this.foregroundIds,o):this.foregroundIds,s=i>=0?Nr(this.backgroundIds,i):this.backgroundIds;return new t(n,a,s)}moveMemo(e,n){let r=new Map(this.memoIdMap);return e.forEach(o=>{let i=r.get(o);i!=null&&r.set(o,i.move(n))}),new t(r,this.foregroundIds,this.backgroundIds)}arrangeMemo(e,n){if(this.memoIdMap.get(e)==null)return this;let o=this.foregroundIds.indexOf(e);if(n==="front"&&this.foregroundIds.length>0&&o===this.foregroundIds.length-1)return this;let i=o<0?this.backgroundIds.indexOf(e):-1;if(n==="back"&&this.backgroundIds.length>0&&i===0)return this;let a=o>=0?Nr(this.foregroundIds,o):this.foregroundIds,s=i>=0?Nr(this.backgroundIds,i):this.backgroundIds;return new t(this.memoIdMap,n==="front"?[...a,e]:a,n==="back"?[e,...s]:s)}equals(e){return Xe(this.memoIdMap,e.memoIdMap)===!1||an(this.foregroundIds,e.foregroundIds)===!1?!1:an(this.backgroundIds,e.backgroundIds)}reuseInstancesFrom(e){let n=Vt(e.memoIdMap,this.memoIdMap),r=Fo(e.foregroundIds,this.foregroundIds),o=Fo(e.backgroundIds,this.backgroundIds);return(n===e.memoIdMap&&r===e.foregroundIds&&o===e.backgroundIds)===!0?e:new t(new Map(n),r,o)}},Nr=(t,e)=>t.length===0||e<0||e>=t.length?t:t.slice(0,e).concat(t.slice(e+1));var Yh={segment:-1,fraction:0,offsetX:0,offsetY:0},jh={bold:!1,italic:!1,strikethrough:!1,fontSize:10},et=class t{constructor({label:e,position:n=Yh,color:r=re.BLACK,style:o=jh}){this.label=e,this.position=n,this.color=r,this.style=o}updateLabelPosition(e){return gc(this.position,e)?this:new t({...this,position:e})}updateLabelStyle(e){return yc(this.style,e)?this:new t({...this,style:e})}updateColor(e){return this.color.equals(e)?this:new t({...this,color:e})}equals(e){return!(this.label!==e.label||gc(this.position,e.position)===!1||this.color.equals(e.color)===!1||yc(this.style,e.style)===!1)}toJSON(){return{label:this.label,position:this.position,color:this.color.toJSON(),style:this.style}}static toObject(e){return S(e,"label"),S(e,"position"),S(e,"color"),S(e,"style"),new t({label:e.label,position:e.position,color:re.toObject(e.color),style:e.style})}},gc=(t,e)=>t.segment===e.segment&&t.fraction===e.fraction&&t.offsetX===e.offsetX&&t.offsetY===e.offsetY,yc=(t,e)=>t.bold===e.bold&&t.italic===e.italic&&t.strikethrough===e.strikethrough&&t.fontSize===e.fontSize;var gt=class t{constructor({strokeWidth:e=1,edges:n=[],orthogonalLines:r=[],color:o=re.BLACK}){this.strokeWidth=e>0?e:1,this.edges=[...n],this.orthogonalLines=[...r],this.color=o}get lineType(){return this.orthogonalLines.length>0?"orthogonal":"straight"}updateEdge(e){if(e.edgeType==="virtual"){let r=[...this.edges];return r.splice(e.edgeId,0,e.point),new t({...this,edges:r,orthogonalLines:[]})}if(e.edgeId<0||e.edgeId>=this.edges.length)return this;let n=[...this.edges];return n[e.edgeId]=e.point,new t({...this,edges:n,orthogonalLines:[]})}updateOrthogonalLines(e){return new t({...this,orthogonalLines:[...e],edges:[]})}updateStrokeWidth(e){return this.strokeWidth===e||e<=0?this:new t({...this,strokeWidth:e})}updateColor(e){return this.color.equals(e)?this:new t({...this,color:e})}deleteEdge(e){if(e<0||e>=this.edges.length)return this;let n=[...this.edges];return n.splice(e,1),new t({...this,edges:n})}equals(e){return this===e?!0:this.strokeWidth!==e.strokeWidth||this.edges.length!==e.edges.length||this.color.equals(e.color)===!1||this.edges.every((r,o)=>{let i=e.edges[o];return r.x===i.x&&r.y===i.y})===!1||this.orthogonalLines.length!==e.orthogonalLines.length?!1:this.orthogonalLines.every((r,o)=>{let i=e.orthogonalLines[o];return r.direction===i.direction&&r.position===i.position})}toJSON(){return{strokeWidth:this.strokeWidth,edges:this.edges,orthogonalLines:this.orthogonalLines,color:this.color.toJSON()}}static toObject(e){S(e,"strokeWidth");let n="edges"in e?e.edges:[],r="orthogonalLines"in e?e.orthogonalLines:[],o="color"in e?re.toObject(e.color):re.BLACK;return new t({strokeWidth:e.strokeWidth,edges:n,orthogonalLines:r,color:o})}};var Ne=class t{constructor({relationModel:e,lineViewModel:n,labelViewModel:r=null,createdAt:o=null}){this.relationModel=e,this.lineViewModel=n,this.labelViewModel=r??new et({label:e.relationName}),this.createdAt=o||new Date}get relationId(){return this.relationModel.relationModelId}get parentTableModelId(){return this.relationModel.parentTableModelId}get childTableModelId(){return this.relationModel.childTableModelId}updateRelationModel(e){let n=e.relationName===this.labelViewModel.label?this.labelViewModel:new et({...this.labelViewModel,label:e.relationName});return new t({relationModel:e,lineViewModel:this.lineViewModel,labelViewModel:n,createdAt:this.createdAt})}toJSON(){return{relationModel:this.relationModel.toJSON(),lineViewModel:this.lineViewModel.toJSON(),...this.labelViewModel.label!=""&&{labelViewModel:this.labelViewModel.toJSON()},createdAt:this.createdAt}}static toObject(e){S(e,"relationModel"),S(e,"lineViewModel");let n="labelViewModel"in e?et.toObject(e.labelViewModel):null,r="createdAt"in e?Ve(e.createdAt):new Date;return new t({relationModel:qe.toObject(e.relationModel),lineViewModel:gt.toObject(e.lineViewModel),labelViewModel:n,createdAt:r})}equals(e){return this.relationModel.equals(e.relationModel)&&this.lineViewModel.equals(e.lineViewModel)&&this.labelViewModel.equals(e.labelViewModel)}};var dn=class t{constructor(e){this.relationIdMap=new Map(e.map(n=>[n.relationId,n])),this.parentTableModelIdMap=t.toTableIdMapping(e,n=>n.parentTableModelId),this.childTableModelIdMap=t.toTableIdMapping(e,n=>n.childTableModelId),this.childColumnModelIdMap=new Map(e.filter(n=>n.relationModel.relationPairs.length>0).flatMap(n=>n.relationModel.relationPairs.map(r=>[`${n.relationModel.childTableModelId}:${r.childColumnModelId}`,{tableModelId:n.relationModel.parentTableModelId,columnModelId:r.parentColumnModelId}])))}static toTableIdMapping(e,n){let r=new Map;return e.forEach(o=>{let i=n(o.relationModel),a=r.get(i);a!=null?a.push(o):r.set(i,[o])}),r}getModels(){return Array.from(this.relationIdMap.values()).sort((e,n)=>e.relationId.localeCompare(n.relationId,"en"))}findByRelationId(e){let n=this.relationIdMap.get(e);return n??null}fetchRelationsByParent(e){let n=this.parentTableModelIdMap.get(e);return n||[]}fetchRelationsByChild(e){let n=this.childTableModelIdMap.get(e);return n||[]}fetchRelationsByTableIds(e){let n=e.flatMap(i=>this.parentTableModelIdMap.get(i)||[]).map(i=>i.relationId),r=e.flatMap(i=>this.childTableModelIdMap.get(i)||[]).map(i=>i.relationId),o=new Set([...n,...r]);return o.size===0?[]:[...o].flatMap(i=>this.relationIdMap.get(i)||[])}inChildRelation(e,n){return this.childColumnModelIdMap.has(`${e}:${n}`)}findParentRelation(e,n){return this.childColumnModelIdMap.get(`${e}:${n}`)??null}updateRelationView(e){return this.update([e])}updateRelationModel(e){if(e.length===0)return this;let n=e.map(r=>{let o=this.relationIdMap.get(r.relationModelId);return o!=null?o.updateRelationModel(r):new Ne({relationModel:r,lineViewModel:new gt({})})});return this.update(n)}deleteRelation(e){if(e.length===0)return this;let n=new Map(this.relationIdMap);return e.forEach(r=>n.delete(r)),n.size===this.relationIdMap.size?this:new t(Array.from(n.values()))}deleteFromTableId(e){if(e.length===0)return this;let n=new Map(this.relationIdMap);for(let r of e)(this.childTableModelIdMap.get(r)||[]).forEach(i=>{n.delete(i.relationId)});return n.size===this.relationIdMap.size?this:new t(Array.from(n.values()))}updateLineView(e,n){let r=this.relationIdMap.get(e);if(r==null)return this;if(r.lineViewModel.equals(n))return this;let o=new Ne({...r,lineViewModel:n});return this.update([o])}updateLabelView(e,n){let r=this.relationIdMap.get(e);if(r==null)return this;if(r.labelViewModel.equals(n))return this;let o=new Ne({...r,labelViewModel:n});return this.update([o])}updateRelationOrthogonal(e){if(e.length===0)return this;let n=e.map(({relationId:r,orthogonalLines:o,changedIndex:i})=>{let a=this.findByRelationId(r);if(a==null)return null;let s=a.lineViewModel,l=s.updateOrthogonalLines(o);if(s.equals(l))return null;let c=a.labelViewModel,m=c.position.segment;if(i<0||m<i)return new Ne({...a,lineViewModel:l});let d=l.orthogonalLines.length-s.orthogonalLines.length,h=i===0&&m===0?0:Math.min(Math.max(0,m+d),l.orthogonalLines.length-1),g=new et({...c,position:{...c.position,segment:h}});return new Ne({...a,lineViewModel:l,labelViewModel:g})}).filter(r=>r!=null);return this.update(n)}update(e){if(e.length===0)return this;let n=new Map(this.relationIdMap);return e.forEach(r=>n.set(r.relationId,r)),new t(Array.from(n.values()))}moveRelation(e,n){if(this.relationIdMap.size===0)return this;if(e.size<=1)return this;if(n.x===0&&n.y===0)return this;let r=!1,o=[...this.relationIdMap.values()].map(i=>{let a=i.relationModel;if(e.has(a.parentTableModelId)==!1||e.has(a.childTableModelId)==!1||i.lineViewModel.edges.length===0)return i;r=!0;let s=i.lineViewModel.edges.map(c=>({x:c.x+n.x,y:c.y+n.y})),l=new gt({...i.lineViewModel,edges:s});return new Ne({...i,lineViewModel:l})});return r===!1?this:new t(o)}equals(e){return Xe(this.relationIdMap,e.relationIdMap)}reuseInstancesFrom(e){let n=Vt(e.relationIdMap,this.relationIdMap);return n===e.relationIdMap?e:new t(Array.from(n.values()))}};var be=class t{constructor({tableModel:e,corner:n,headerColor:r,createdAt:o=null}){this.tableModel=e,this.corner={...n},this.headerColor={...r},this.createdAt=o||new Date}get tableId(){return this.tableModel.tableModelId}toJSON(){return{tableModel:this.tableModel.toJSON(),top:this.corner.top,left:this.corner.left,headerBackgroundColor:this.headerColor.background.toJSON(),headerForegroundColor:this.headerColor.foreground.toJSON(),createdAt:this.createdAt}}static toObject(e){return S(e,"tableModel"),S(e,"top"),S(e,"left"),S(e,"headerBackgroundColor"),S(e,"headerForegroundColor"),new t({tableModel:Ze.toObject(e.tableModel),corner:{top:e.top,left:e.left},headerColor:{background:re.toObject(e.headerBackgroundColor),foreground:re.toObject(e.headerForegroundColor)},createdAt:"createdAt"in e?Ve(e.createdAt):new Date})}equals(e){return!(this.tableModel.equals(e.tableModel)===!1||this.corner.top!==e.corner.top||this.corner.left!==e.corner.left||this.headerColor.background.equals(e.headerColor.background)===!1||this.headerColor.foreground.equals(e.headerColor.foreground)===!1||this.createdAt.getTime()!==e.createdAt.getTime())}};var mn=class t{constructor(e,n,r,o,i,a,s,l,c,m,d,h=null){this.documentName=e,this.erdSettingModel=n,this.databaseSettingModel=r,this.schemaConfig=o,this.tableViewModelIds=i,this.tableViewModelMap=a,this.columnGroupModelMap=s,this.columnModelMap=l,this.columnShareStorage=c,this.relationViewModelStorage=m,this.memoViewModelStorage=d,this.lastUpdatedAt=h||new Date}static create({documentName:e,databaseSettingModel:n,erdSettingModel:r=cn.create(e),schemaConfig:o=Cr.create(),tableViewModels:i=[],columnGroupModels:a=[],structShareModels:s=[],columnModels:l=[],columnShareModels:c=[],relationViewModels:m=[],foregroundMemoViewModels:d=[],backgroundMemoViewModels:h=[],lastUpdatedAt:g=null}){return new t(e,r,n,o,i.map(b=>b.tableId),new Map(i.map(b=>[b.tableId,b])),new Map(a.map(b=>[b.columnGroupId,b])),new Map(l.map(b=>[b.columnModelId,b])),Un.create(c,s),new dn(m),Bn.create(d,h),g)}doUpdate(e){let n=e.columnModelMap!=null||e.columnGroupModelMap!=null||e.columnShareModelStorage!=null,r=e.tableViewModelMap??this.tableViewModelMap,o=e.columnGroupModelMap??this.columnGroupModelMap,i=e.columnModelMap??this.columnModelMap,a=e.columnShareModelStorage??this.columnShareStorage,s=n?this.doCollectReachableModelIds(r,o,i,a):null,l=s==null?i:this.doRetainColumnModels(i,s.columnModelIds),c=s==null?a:a.retain(s.columnShareModelIds,s.structShareModelIds,new Set(l.keys()),new Set(o.keys()));return new t(e.documentName??this.documentName,e.erdSettingModel??this.erdSettingModel,e.databaseSettingModel??this.databaseSettingModel,e.schemaConfig??this.schemaConfig,e.tableViewModelIds??this.tableViewModelIds,e.tableViewModelMap??this.tableViewModelMap,o,l,c,e.relationViewModelStorage??this.relationViewModelStorage,e.memoViewModelStorage??this.memoViewModelStorage,e.lastUpdatedAt??null)}doCollectReachableModelIds(e,n,r,o){let i=Array.from(e.values()).flatMap(d=>bc(d.tableModel.columnEntries)),a=Array.from(n.values()).flatMap(d=>d.columnModelIds),s=new Set,l=new Set,c=new Set,m=[...i,...a];for(;m.length>0;){let d=m.pop();if(d==null||s.has(d))continue;s.add(d);let h=r.get(d);if(h==null)continue;if(ce.isSimpleColumn(h)){l.add(h.columnShareModelId);continue}let g=h.structShareModelId;if(c.has(g))continue;c.add(g);let b=o.findStructShare(g);b!=null&&m.push(...bc(b.columnEntries))}return{columnModelIds:s,columnShareModelIds:l,structShareModelIds:c}}doRetainColumnModels(e,n){let r=Array.from(e.keys()).filter(i=>n.has(i)===!1);if(r.length===0)return e;let o=new Map(e);return r.forEach(i=>o.delete(i)),o}getDatabase(){return this.databaseSettingModel.getDatabase()}getDisplayNameStyle(){return this.erdSettingModel.displayNameStyle}getDisplayColumnStyle(){return this.erdSettingModel.displayColumnStyle}findSchema(e){return this.getDatabase().supportsSchema===!1?null:this.schemaConfig.findSchema(e)}findDefaultSchema(){return this.getDatabase().supportsSchema===!1?null:this.schemaConfig.findDefaultSchema()}findTableViewModel(e){let n=this.tableViewModelMap.get(e);return n||null}getTableViewModels(){return this.tableViewModelIds.map(e=>this.tableViewModelMap.get(e))}findColumnGroupModel(e){let n=this.columnGroupModelMap.get(e);return n||null}getColumnGroupModels(){return Array.from(this.columnGroupModelMap.values()).sort((n,r)=>{let o=n.groupName.localeCompare(r.groupName,"en");return o!==0?o:n.columnGroupId.localeCompare(r.columnGroupId,"en")})}findStructColumnShareModel(e){return this.columnShareStorage.findStructShare(e)}getStructColumnShareModels(){return this.columnShareStorage.getStructShareModels()}findColumnModel(e){let n=this.columnModelMap.get(e);return n||null}toAllColumnsWithStruct(e){return e.columnEntries.flatMap(n=>{if(n.modelType==="single")return[n.columnModelId];let r=this.findColumnGroupModel(n.columnGroupId);return r==null?[]:r.columnModelIds}).map(n=>this.findColumnModel(n)).filter(n=>n!=null)}toAllColumnsExceptStruct(e){return this.toAllColumnsWithStruct(e).filter(ce.isSimpleColumn)}findColumnShareModel(e){return this.columnShareStorage.findColumnShare(e)}fetchReferencedColumnModelsForShareModel(e){return Array.from(this.columnModelMap.values()).filter(ce.isSimpleColumn).filter(n=>n.columnShareModelId===e).sort((n,r)=>{let o=n.physicalName.localeCompare(r.physicalName,"en");return o!==0?o:n.columnModelId.localeCompare(r.columnModelId,"en")})}getColumnShareModelStorage(){return this.columnShareStorage.copy()}findRelationViewModel(e){return this.relationViewModelStorage.findByRelationId(e)}fetchRelationsByTableIds(e){return e.length===0?[]:this.relationViewModelStorage.fetchRelationsByTableIds(e)}getRelationViewModels(){return this.relationViewModelStorage.getModels()}inChildRelation(e,n){return this.relationViewModelStorage.inChildRelation(e,n)}findParentRelation(e,n){return this.relationViewModelStorage.findParentRelation(e,n)}findRelatedRelations(e){let n=this.relationViewModelStorage.fetchRelationsByParent(e),r=this.relationViewModelStorage.fetchRelationsByChild(e);return{parentRelations:n,childRelations:r}}findMemoViewModel(e){return this.memoViewModelStorage.find(e)}getMemoViewModels(){return this.memoViewModelStorage.getMemos()}updateSchema(e){return this.schemaConfig.equals(e)?this:this.doUpdate({schemaConfig:e})}updateTableMeta(...e){let n=new Map(this.tableViewModelMap);return e.forEach(r=>{n.set(r.tableId,r)}),this.doUpdate({tableViewModelMap:n})}updateTableViewWithColumns(e,n,r=null){let o=r||this.columnShareStorage,i=this.tableViewModelMap.get(e.tableId);if(i==null)return this.doAddTableViewModel(e,n,o);let{nextTableViewModels:a,nextColumnModelMap:s,nextRelationViewModelStorage:l}=this.doUpdateTableViewModelWithRelation(i,e,n,o),c=new Map(this.tableViewModelMap);a.forEach(d=>{c.set(d.tableId,d)});let m=new Map(this.columnModelMap);return s.forEach(d=>m.set(d.columnModelId,d)),this.doUpdate({tableViewModelMap:c,columnModelMap:m,columnShareModelStorage:o.copy(),relationViewModelStorage:l})}doAddTableViewModel(e,n,r){let o=[...this.tableViewModelIds,e.tableId],i=new Map(this.tableViewModelMap);i.set(e.tableId,e);let a=new Map(this.columnModelMap);return n.forEach(l=>a.set(l.columnModelId,l)),this.doUpdateTableCheckExpression(e,a,r).forEach(l=>i.set(l.tableId,l)),this.doUpdate({tableViewModelIds:o,tableViewModelMap:i,columnModelMap:a,columnShareModelStorage:r.copy()})}doUpdateTableCheckExpression(e,n,r){if(r.equals(this.columnShareStorage)===!0)return[];let o=e.tableModel.columnEntries.map(s=>{if(s.modelType!=="single")return null;let l=n.get(s.columnModelId);if(l==null||ce.isSimpleColumn(l)===!1)return null;let c=this.columnShareStorage.findColumnShare(l.columnShareModelId),m=r.findColumnShare(l.columnShareModelId);return c==null||m==null||c.physicalName===m.physicalName?null:{previousColumnShare:c,nextColumnShare:m}}).filter(s=>s!==null);if(o.length===0)return[];let i=new Map(o.map(s=>[s.nextColumnShare.columnShareModelId,s]));return Array.from(this.tableViewModelMap.entries()).map(([s,l])=>{let c=l.tableModel;if(c.checkExpression==""||s===e.tableId)return null;let m=this.toAllColumnsExceptStruct(c).map(h=>{let g=i.get(h.columnShareModelId);if(g==null)return null;let b=mt(h,g.previousColumnShare),y=mt(h,g.nextColumnShare);return b.physicalName===y.physicalName?null:{previousName:b,nextName:y}}).filter(h=>h!==null),d=c.updateCheckExpression(m);return d===c?null:(console.debug(`Update checkExpression. tableId: ${s}, tableName: ${c.physicalName}, before: ${c.checkExpression}, after: ${d.checkExpression}`),new be({...l,tableModel:d}))}).filter(s=>s!==null)}doUpdateTableViewModelWithRelation(e,n,r,o){let i=new Map(r.map(M=>[M.columnModelId,M])),a=this.relationViewModelStorage.fetchRelationsByParent(n.tableId),s=new Map(this.columnModelMap);r.forEach(M=>s.set(M.columnModelId,M));let l=this.doUpdateTableCheckExpression(n,s,o),c=[n,...l];if(a.length===0)return{nextTableViewModels:c,nextColumnModelMap:i,nextRelationViewModelStorage:this.relationViewModelStorage};let m=n.tableModel.columnEntries.flatMap(M=>{if(M.modelType==="single"){let v=i.get(M.columnModelId);return v!=null?[v]:[]}let R=this.columnGroupModelMap.get(M.columnGroupId);return R==null?[]:R.columnModelIds.map(v=>this.findColumnModel(v)).filter(v=>v!=null)}).filter(ce.isSimpleColumn).filter(M=>M.primaryKey===!0),d=this.toAllColumnsExceptStruct(e.tableModel),h=d.filter(M=>M.primaryKey===!0&&m.some(R=>R.columnModelId===M.columnModelId)===!1).map(M=>M.columnModelId),g=d.filter(M=>M.primaryKey===!0).map(M=>M.columnModelId),b=m.filter(M=>g.includes(M.columnModelId)===!1);if(h.length===0&&b.length===0)return{nextTableViewModels:c,nextColumnModelMap:i,nextRelationViewModelStorage:this.relationViewModelStorage};let y=new Map(c.map(M=>[M.tableId,M])),N=this.doUpdateRelationWithPrimaryKeyChanged(a,y,i,b,h);return{...N,nextTableViewModels:Array.from(N.nextTableViewMap.values())}}doUpdateRelationWithPrimaryKeyChanged(e,n,r,o,i,a=null){let s=new Map(n),l=new Map(r),c=new Map,m=new Set;if(i.length>0)for(let d of e){let h=d.relationModel,g=h.relationPairs.filter(y=>i.includes(y.parentColumnModelId)===!1);if(h.relationPairs.length===g.length)continue;g.length===0&&m.add(d.relationId);let b=new qe({...d.relationModel,relationPairs:g});c.set(b.relationModelId,b)}if(o.length>0)for(let d of e){let h=c.get(d.relationId)||d.relationModel,g=s.get(h.childTableModelId)||this.tableViewModelMap.get(h.childTableModelId);if(g==null)continue;if(a===null?!1:g.tableModel.columnEntries.some(H=>H.modelType==="group"&&H.columnGroupId===a.columnGroupId)){let H=[...h.relationPairs,...o.map(ci=>new dt({parentColumnModelId:ci.columnModelId,childColumnModelId:ci.columnModelId}))],Ge=new qe({...h,relationPairs:H});c.set(Ge.relationModelId,Ge),m.delete(Ge.relationModelId);continue}let y=Sc(h.childCardinality),N=o.map(H=>{let Ge=new ut({columnModelId:X(),columnShareModelId:H.columnShareModelId,physicalName:H.physicalName,logicalName:H.logicalName,notNull:y});return{columnModel:Ge,relationPair:new dt({parentColumnModelId:H.columnModelId,childColumnModelId:Ge.columnModelId})}}),M=N.map(H=>H.columnModel),R=N.map(H=>H.relationPair);M.forEach(H=>{l.set(H.columnModelId,H)});let v=g.tableModel,z=new be({...g,tableModel:new Ze({...v,columnEntries:[...v.columnEntries,...M.map(H=>({modelType:"single",columnModelId:H.columnModelId}))]})});s.set(z.tableId,z);let me=[...h.relationPairs,...R],pe=new qe({...h,relationPairs:me});c.set(pe.relationModelId,pe),m.delete(pe.relationModelId)}return m.forEach(d=>c.delete(d)),{nextTableViewMap:s,nextColumnModelMap:l,nextRelationViewModelStorage:this.relationViewModelStorage.updateRelationModel(Array.from(c.values())).deleteRelation(Array.from(m))}}deleteTable(e){if(this.tableViewModelMap.get(e)==null)return this;let r=this.tableViewModelIds.filter(i=>i!==e),o=new Map(this.tableViewModelMap);return o.delete(e),this.doUpdate({tableViewModelIds:r,tableViewModelMap:o,columnModelMap:this.columnModelMap,relationViewModelStorage:this.relationViewModelStorage.deleteFromTableId([e])})}updateColumnGroup(e,n,r){let o=this.columnGroupModelMap.get(e.columnGroupId)||null,i=new Map(this.columnGroupModelMap);i.set(e.columnGroupId,e);let a=new Map(this.columnModelMap);n.forEach(m=>{a.set(m.columnModelId,m)});let{nextTableViewMap:s,nextColumnModelMap:l,nextRelationViewModelStorage:c}=this.doUpdateTableViewModelsWithUpdatingColumnGroup(o,e,n,a,r);return this.doUpdate({tableViewModelMap:s.size>0?new Map([...this.tableViewModelMap,...s]):this.tableViewModelMap,columnGroupModelMap:i,columnModelMap:l,columnShareModelStorage:r.copy(),relationViewModelStorage:c})}doUpdateTableViewModelsWithUpdatingColumnGroup(e,n,r,o,i){let a=Array.from(this.tableViewModelMap.values()).filter(M=>M.tableModel.columnEntries.some(R=>R.modelType==="group"&&R.columnGroupId===n.columnGroupId)),s=new Map;if(a.length===0)return{nextTableViewMap:s,nextColumnModelMap:o,nextRelationViewModelStorage:this.relationViewModelStorage};let l=r.filter(ce.isSimpleColumn).map(M=>{let R=this.columnModelMap.get(M.columnModelId);if(R==null||ce.isSimpleColumn(R)===!1)return null;let v=this.columnShareStorage.findColumnShare(R.columnShareModelId);if(v==null)return null;let z=i.findColumnShare(M.columnShareModelId);if(z==null)return null;let me=mt(R,v),pe=mt(M,z);return me.physicalName===pe.physicalName?null:{previousName:me,nextName:pe}}).filter(M=>M!==null),c=new Set,m=a.map(M=>{let R=M.tableModel,v=R.updateCheckExpression(l);if(v===R)return M;c.add(M.tableId),console.debug(`Update checkExpression. tableId: ${M.tableId}, tableName: ${R.physicalName}, before: ${R.checkExpression}, after: ${v.checkExpression}`);let z=new be({...M,tableModel:v});return s.set(z.tableId,z),z}),d=new Set(e==null?[]:e.columnModelIds.filter(M=>n.columnModelIds.includes(M)===!1));if(d.size>0)for(let M of m){let R=M.tableModel,v=ht.filterColumns(R.uniqueKeysModels,pe=>d.has(pe.columnModelId)===!1),z=pt.filterColumns(R.tableIndexModels,pe=>d.has(pe.columnModelId)===!1);if(c.has(M.tableId)===!1&&v.hasChanged===!1&&z.hasChanged===!1)continue;let me=new be({...M,tableModel:new Ze({...R,uniqueKeysModels:v.tableUniqueKeysModels,tableIndexModels:z.tableIndexModels})});s.set(me.tableId,me)}let h=e==null?[]:e.columnModelIds.map(M=>this.columnModelMap.get(M)).filter(M=>M!=null&&ce.isSimpleColumn(M)&&M.primaryKey===!0).map(M=>M.columnModelId),g=n.columnModelIds.map(M=>o.get(M)).filter(M=>M!=null&&ce.isSimpleColumn(M)&&M.primaryKey===!0),b=h.filter(M=>g.every(R=>R.columnModelId!==M)),y=g.filter(M=>h.includes(M.columnModelId)===!1),N=a.flatMap(M=>this.relationViewModelStorage.fetchRelationsByParent(M.tableId));return this.doUpdateRelationWithPrimaryKeyChanged(N,s,o,y,b,n)}deleteColumnGroup(e){let n=this.columnGroupModelMap.get(e);if(n==null)return this;let r=new Map(this.columnGroupModelMap);r.delete(e);let{nextTableViewModelMap:o,nextRelationViewModelStorage:i}=this.doUpdateTableViewModelsWithDeletingColumnGroup(n);return this.doUpdate({tableViewModelMap:o,columnGroupModelMap:r,columnModelMap:this.columnModelMap,relationViewModelStorage:i})}doUpdateTableViewModelsWithDeletingColumnGroup(e){let r=e.columnModelIds.map(g=>this.columnModelMap.get(g)).filter(g=>g!=null&&ce.isSimpleColumn(g)).filter(g=>g.primaryKey===!0).map(g=>g.columnModelId),o=new Map(this.tableViewModelMap),i=[],a=[],s=new Set,l=!1;for(let[g,b]of this.tableViewModelMap.entries()){let y=b.tableModel.columnEntries.filter(z=>z.modelType!=="group"||z.columnGroupId!==e.columnGroupId);if(b.tableModel.columnEntries.length===y.length)continue;if(l=!0,y.length===0){o.delete(g),a.push(g);continue}i.push(b.tableModel);let N=z=>e.columnModelIds.includes(z)===!1,M=ht.filterColumns(b.tableModel.uniqueKeysModels,z=>N(z.columnModelId)),R=pt.filterColumns(b.tableModel.tableIndexModels,z=>N(z.columnModelId)),v=new be({...b,tableModel:new Ze({...b.tableModel,columnEntries:y,uniqueKeysModels:M.tableUniqueKeysModels,tableIndexModels:R.tableIndexModels})});o.set(g,v)}let c=r.length===0?new Map:new Map(i.flatMap(g=>this.relationViewModelStorage.fetchRelationsByParent(g.tableModelId).map(b=>{let y=b.relationModel.relationPairs.filter(N=>r.includes(N.parentColumnModelId)===!1);return y.length===0?(s.add(b.relationId),null):new qe({...b.relationModel,relationPairs:y})}).filter(b=>b!=null)).map(g=>[g.relationModelId,g])),m=new Set(e.columnModelIds);i.flatMap(g=>this.relationViewModelStorage.fetchRelationsByChild(g.tableModelId)).filter(g=>s.has(g.relationId)===!1).map(g=>c.get(g.relationId)??g.relationModel).filter(g=>g.relationPairs.some(b=>m.has(b.childColumnModelId))).map(g=>g.relationModelId).forEach(g=>s.add(g));let h=this.relationViewModelStorage.updateRelationModel(Array.from(c.values())).deleteFromTableId(a).deleteRelation(Array.from(s));return{nextTableViewModelMap:l?o:this.tableViewModelMap,nextRelationViewModelStorage:h}}updateStructColumnShare(e,n=[]){let r=this.columnShareStorage.addStructShare(...e);if(n.length===0)return this.doUpdate({columnShareModelStorage:r});let o=new Map(this.columnModelMap);return n.forEach(i=>o.set(i.columnModelId,i)),this.doUpdate({columnModelMap:o,columnShareModelStorage:r})}deleteStructColumnShare(e){if(this.columnShareStorage.findStructShare(e)==null)return this;let r=new Set(Array.from(this.columnModelMap.values()).filter(d=>d.entityType==="struct"&&d.structShareModelId===e).map(d=>d.columnModelId)),o=[...this.tableViewModelIds],i=new Map(this.tableViewModelMap),a=[];for(let[d,h]of this.tableViewModelMap.entries()){let g=h.tableModel.columnEntries.filter(y=>y.modelType!=="single"||r.has(y.columnModelId)===!1);if(g.length===h.tableModel.columnEntries.length)continue;if(g.length===0){i.delete(d),a.push(d);continue}let b=new be({...h,tableModel:new Ze({...h.tableModel,columnEntries:g})});i.set(d,b)}let s=a.length>0?this.relationViewModelStorage.deleteFromTableId(a):this.relationViewModelStorage,l=a.length>0?o.filter(d=>a.includes(d)===!1):o,c=new Map(this.columnGroupModelMap);for(let[d,h]of this.columnGroupModelMap.entries()){let g=h.columnModelIds.filter(b=>r.has(b)===!1);g.length!==h.columnModelIds.length&&c.set(d,new sn({...h,columnModelIds:g}))}let m=this.columnShareStorage.getStructShareModels().filter(d=>d.structShareModelId!==e).reduce((d,h)=>{let g=h.columnEntries.filter(b=>b.modelType!=="single"||r.has(b.columnModelId)===!1);return g.length===h.columnEntries.length?d:d.addStructShare(new ct({...h,columnEntries:g}))},this.columnShareStorage).deleteStructShare([e]);return this.doUpdate({tableViewModelIds:l,tableViewModelMap:i,columnGroupModelMap:c,columnModelMap:this.columnModelMap,columnShareModelStorage:m,relationViewModelStorage:s})}updateColumnModels(e,n){if(e.length===0&&n.length===0)return this;let r=this.columnShareStorage.addColumnShare(...n);if(e.length===0)return this.doUpdate({columnShareModelStorage:r});let o=new Map(this.columnModelMap);return e.forEach(i=>{o.set(i.columnModelId,i)}),this.doUpdate({columnModelMap:o,columnShareModelStorage:r})}updateRelation(e){let n=e.relationModel,r=this.tableViewModelMap.get(n.childTableModelId);if(r==null)return this;let o=r.tableModel,a=n.relationPairs.map(c=>({parentColumnModelId:c.parentColumnModelId,childColumnModelId:c.childColumnModelId,childColumnModel:this.findColumnModel(c.childColumnModelId)})).filter(c=>c.childColumnModel==null).map(c=>{let m=this.findColumnModel(c.parentColumnModelId);return new ut({columnModelId:c.childColumnModelId,columnShareModelId:m.columnShareModelId,physicalName:m.physicalName,logicalName:m.logicalName,notNull:Sc(n.childCardinality)})}),s;a.length>0?(s=new Map(this.tableViewModelMap),s.set(o.tableModelId,new be({...r,tableModel:o.addColumnModelIds(a.map(c=>c.columnModelId))}))):s=this.tableViewModelMap;let l;return a.length>0?(l=new Map(this.columnModelMap),a.forEach(c=>l.set(c.columnModelId,c))):l=this.columnModelMap,this.doUpdate({tableViewModelMap:s,columnModelMap:l,relationViewModelStorage:this.relationViewModelStorage.updateRelationView(e)})}deleteRelation(e){return this.doUpdateRelationStorage(()=>this.relationViewModelStorage.deleteRelation([e]))}updateRelationLine(e,n){return this.doUpdateRelationStorage(()=>this.relationViewModelStorage.updateLineView(e,n))}updateRelationLabel(e,n){return this.doUpdateRelationStorage(()=>this.relationViewModelStorage.updateLabelView(e,n))}updateRelationLineBy(e,n){let r=this.findRelationViewModel(e);if(r==null)return this;let o=r.lineViewModel,i=n(o);return o.equals(i)?this:this.updateRelationLine(e,i)}updateRelationLabelBy(e,n){let r=this.findRelationViewModel(e);if(r==null)return this;let o=r.labelViewModel,i=n(o);return i.equals(o)?this:this.updateRelationLabel(e,i)}deleteSelectedElements(e){let n=e.relationId!=null&&e.relationId!==""?this.deleteRelation(e.relationId):this,r=Array.from(e.tableIds).reduce((o,i)=>o.deleteTable(i),n);return Array.from(e.memoIds).reduce((o,i)=>o.deleteMemo(i),r)}updateRelationOrthogonal(e){return this.doUpdateRelationStorage(()=>this.relationViewModelStorage.updateRelationOrthogonal(e))}doUpdateRelationStorage(e){let n=e();return this.relationViewModelStorage===n?this:this.doUpdate({relationViewModelStorage:n})}updateTableViewColor(e,n,r){if(e.length===0)return this;let o=i=>new be({...i,headerColor:{background:n,foreground:r}});return this.doUpdateTableRectangle(e,o)}moveTableView(e,n,r){if(e.size===0)return this;let o=a=>new be({...a,corner:{left:a.corner.left+n.x,top:a.corner.top+n.y}}),i=this.relationViewModelStorage.moveRelation(e,n).updateRelationOrthogonal(r);return this.doUpdateTableRectangle([...e],o,i)}doUpdateTableRectangle(e,n,r=null){if(e.length===0)return this;let o=new Map(this.tableViewModelMap);return e.forEach(i=>{let a=this.tableViewModelMap.get(i);a!=null&&o.set(i,n(a))}),this.doUpdate({tableViewModelMap:o,relationViewModelStorage:r??this.relationViewModelStorage})}addMemo(e){return this.doUpdateMemoViewModel(()=>this.memoViewModelStorage.addMemo(e))}updateMemo(e){return this.doUpdateMemoViewModel(()=>this.memoViewModelStorage.updateMemo(e))}deleteMemo(e){return this.doUpdateMemoViewModel(()=>this.memoViewModelStorage.deleteMemo(e))}arrangeMemo(e,n){return this.doUpdateMemoViewModel(()=>this.memoViewModelStorage.arrangeMemo(e,n))}doUpdateMemoViewModel(e){let n=e();return n===this.memoViewModelStorage?this:this.doUpdate({memoViewModelStorage:n})}moveMemoView(e,n){if(e.size===0)return this;let r=this.memoViewModelStorage.moveMemo(e,n);return r===this.memoViewModelStorage?this:this.doUpdate({memoViewModelStorage:r})}updateDocumentName(e){return this.documentName===e?this:this.doUpdate({documentName:e})}updateErdSetting(e){return this.erdSettingModel===e?this:this.doUpdate({erdSettingModel:e})}importDdl({tableViewModels:e,columnModels:n,columnShareModels:r,relationViewModels:o}){let i=[...this.tableViewModelIds,...e.map(m=>m.tableId)],a=new Map(this.tableViewModelMap);e.forEach(m=>a.set(m.tableId,m));let s=new Map(this.columnModelMap);n.forEach(m=>s.set(m.columnModelId,m));let l=this.columnShareStorage.addColumnShare(...r),c=new dn([...this.relationViewModelStorage.getModels(),...o]);return this.doUpdate({tableViewModelIds:i,tableViewModelMap:a,columnModelMap:s,columnShareModelStorage:l,relationViewModelStorage:c})}toJSON(){let e=this.getDatabase(),n=this.tableViewModelIds.map(l=>this.tableViewModelMap.get(l)).filter(l=>l!=null).map(l=>l.toJSON()),r=Array.from(this.columnGroupModelMap.values()).sort((l,c)=>l.groupName.localeCompare(c.groupName,"en")).map(l=>l.toJSON()),o=this.getStructColumnShareModels().map(l=>l.toJSON()),i=Array.from(this.columnModelMap.values()).sort((l,c)=>l.columnModelId.localeCompare(c.columnModelId,"en")).map(l=>l.toJSON()),{frontMemos:a,backMemos:s}=this.memoViewModelStorage.getMemos();return{documentName:this.documentName,lastUpdatedAt:this.lastUpdatedAt,...e.supportsSchema&&{schemaConfig:this.schemaConfig.toJSON()},tableViewModels:n,columnGroupModels:r,...o.length>0&&{structColumnShareModels:o},columnModels:i,columnShareModels:this.columnShareStorage.getColumnShareModels().map(l=>l.toJSON()),relationViewModels:this.relationViewModelStorage.getModels().map(l=>l.toJSON()),foregroundMemos:a.map(l=>l.toJSON()),backgroundMemos:s.map(l=>l.toJSON()),erdSettingModel:this.erdSettingModel.toJSON(),databaseSetting:this.databaseSettingModel.toJSON()}}static toObject(e){S(e,"documentName"),S(e,"tableViewModels"),S(e,"columnModels"),S(e,"columnShareModels"),S(e,"relationViewModels"),S(e,"erdSettingModel"),S(e,"databaseSetting");let n=cn.toObject(e.erdSettingModel),r=Fn.toObject(e.databaseSetting),o=r.initToColumnTypeMapping(),i="schemaConfig"in e?Cr.toObject(e.schemaConfig):Cr.create(),a=j(e.tableViewModels,"tableViewModels",y=>be.toObject(y)),s="columnGroupModels"in e?j(e.columnGroupModels,"columnGroupModels",y=>sn.toObject(y)):[],l="structColumnShareModels"in e?j(e.structColumnShareModels,"structColumnShareModels",y=>ct.toObject(y)):[],c=j(e.columnModels,"columnModels",y=>ce.toObject(y)),m=j(e.columnShareModels,"columnShareModels",y=>qn.toObject(y,o)),d=j(e.relationViewModels,"relationViewModels",y=>Ne.toObject(y)),h="foregroundMemos"in e?j(e.foregroundMemos,"foregroundMemos",y=>un.toObject(y)):[],g="backgroundMemos"in e?j(e.backgroundMemos,"backgroundMemos",y=>un.toObject(y)):[],b="lastUpdatedAt"in e?Ve(e.lastUpdatedAt):new Date;return t.create({documentName:e.documentName,erdSettingModel:n,schemaConfig:i,tableViewModels:a,columnGroupModels:s,structShareModels:l,columnModels:c,columnShareModels:m,relationViewModels:d,foregroundMemoViewModels:h,backgroundMemoViewModels:g,databaseSettingModel:r,lastUpdatedAt:b})}equals(e){if(this===e)return!0;if(this.documentName!==e.documentName||this.tableViewModelIds.length!==e.tableViewModelIds.length)return!1;for(let n=0;n<this.tableViewModelIds.length;n++)if(this.tableViewModelIds[n]!==e.tableViewModelIds[n])return!1;if(this.tableViewModelMap.size!==e.tableViewModelMap.size)return!1;for(let[n,r]of this.tableViewModelMap.entries()){let o=e.tableViewModelMap.get(n);if(o==null||r.equals(o)===!1)return!1}if(this.columnGroupModelMap.size!==e.columnGroupModelMap.size)return!1;for(let[n,r]of this.columnGroupModelMap.entries()){let o=e.columnGroupModelMap.get(n);if(o==null||r.equals(o)===!1)return!1}if(this.columnModelMap.size!==e.columnModelMap.size)return!1;for(let[n,r]of this.columnModelMap.entries()){let o=e.columnModelMap.get(n);if(o==null||ce.equals(r,o)===!1)return!1}return!(this.columnShareStorage.equals(e.columnShareStorage)===!1||this.relationViewModelStorage.equals(e.relationViewModelStorage)===!1||this.memoViewModelStorage.equals(e.memoViewModelStorage)===!1||this.erdSettingModel.equals(e.erdSettingModel)===!1||this.databaseSettingModel.equals(e.databaseSettingModel)===!1||this.schemaConfig.equals(e.schemaConfig)===!1)}reuseInstancesFrom(e){let n=Wh(e.tableViewModelIds,this.tableViewModelIds),r=Ho(e.tableViewModelMap,this.tableViewModelMap,(g,b)=>g.equals(b)),o=Ho(e.columnGroupModelMap,this.columnGroupModelMap,(g,b)=>g.equals(b)),i=Ho(e.columnModelMap,this.columnModelMap,(g,b)=>ce.equals(g,b)),a=this.columnShareStorage.reuseInstancesFrom(e.columnShareStorage),s=this.relationViewModelStorage.reuseInstancesFrom(e.relationViewModelStorage),l=this.memoViewModelStorage.reuseInstancesFrom(e.memoViewModelStorage),c=this.erdSettingModel.equals(e.erdSettingModel)===!0?e.erdSettingModel:this.erdSettingModel,m=this.databaseSettingModel.equals(e.databaseSettingModel)===!0?e.databaseSettingModel:this.databaseSettingModel,d=this.schemaConfig.equals(e.schemaConfig)===!0?e.schemaConfig:this.schemaConfig;return(this.documentName===e.documentName&&n===e.tableViewModelIds&&r===e.tableViewModelMap&&o===e.columnGroupModelMap&&i===e.columnModelMap&&a===e.columnShareStorage&&s===e.relationViewModelStorage&&l===e.memoViewModelStorage&&c===e.erdSettingModel&&m===e.databaseSettingModel&&d===e.schemaConfig)===!0?e:new t(this.documentName,c,m,d,n,r,o,i,a,s,l,this.lastUpdatedAt)}},bc=t=>t.flatMap(e=>e.modelType==="single"?[e.columnModelId]:[]),Wh=(t,e)=>t.length!==e.length?e:e.every((r,o)=>t[o]===r)?t:e,Ho=(t,e,n)=>{let r=t.size===e.size,o=Array.from(e.entries()).map(([i,a])=>{let s=t.get(i);return s!=null&&n(s,a)?[i,s]:(r=!1,[i,a])});return r?t:new Map(o)},Sc=t=>t==="1"||t==="1..N";var vr=class{constructor(){this.uriToIdMap=new Map,this.idToBudgetMap=new Map}async create(e,n){let r=Zt.resolve(e);if(Fe.existsSync(r))throw qo(`File already exists: ${r}`);let o=Zt.dirname(r);if(Fe.existsSync(o)===!1)throw qo(`Directory does not exist: ${o}`);let i=wc(n);return Fe.writeFileSync(r,i),this.doRegister(r,n)}tryRegister(e){let n=Zt.resolve(e);return Fe.existsSync(n)===!1?null:this.register(n)}register(e){let n=Zt.resolve(e),r=Fe.readFileSync(n,"utf-8"),o=mn.toObject(JSON.parse(r));return this.doRegister(n,o).documentId}load(e){let n=Zt.resolve(e),r=Fe.readFileSync(n,"utf-8"),o=mn.toObject(JSON.parse(r));return this.doRegister(n,o),o}doRegister(e,n){let r=(0,xc.pathToFileURL)(e).href,o=gi(r);return this.uriToIdMap.set(r,o),this.idToBudgetMap.set(o,{documentId:o,fileUri:r,filePath:e,erdDocument:n}),{documentId:o,fileUri:r}}notify(e,n){let r=this.idToBudgetMap.get(e);if(r==null||r.erdDocument===n)return;let o=wc(n);Fe.writeFileSync(r.filePath,o),this.idToBudgetMap.set(e,{...r,erdDocument:n})}fetchDocuments(){return Array.from(this.idToBudgetMap.values()).map(e=>Mc(e))}findById(e){let n=this.idToBudgetMap.get(e);return n==null?null:Mc(n)}findByUri(e){let n=this.uriToIdMap.get(e);return n==null?null:this.findById(n)}},wc=t=>JSON.stringify(t.toJSON(),null,4),Mc=t=>new fn({documentId:t.documentId,uri:t.fileUri,erdDocument:t.erdDocument,rectangles:new Map});var Qe=class{constructor(){}static load(e){let n=ic(e);try{return{resultType:"loaded",erdDocument:new vr().load(n)}}catch(r){let o=r instanceof Error?r.message:String(r);return{resultType:"failed",message:`Failed to load document: ${n}
|
|
28
28
|
cause: ${o}`}}}};var Er=class{static find(e,n){return Zn(e).find(i=>Jh(i,n))||null}},Jh=(t,e)=>{let n=t.baseQuery.replace("[[PARAM]]","").toUpperCase(),r=e.timezone!==""?` ${e.timezone}`:"",o=e.precision==="max"?"(MAX)":"",i=`${e.columnType}${r}${o}`.toUpperCase();return n!==i?!1:e.precision==="max"?!0:!(e.precision!=null&&t.withPrecision===!1||e.scale!=null&&t.withScale===!1)};var Ar=(t,e,n,r)=>{if(r.withComment===!1)return"";if(r.commentStyle==="logical_name")return e!==t?e:"";let o=n!==""?`${e}${r.commentSeparator}${n}`:e;return o!==t?o:""};var yt=class{static ofDesignedColumn(e,n){let r=e.columnShare.columnType,o=Hh(r,e.columnModel.autoIncrement),i=Ic(o.resolvedType,e.columnShare.precision,e.columnShare.scale,e.columnShare.isArray),a=Ar(e.physicalName,e.logicalName,e.columnShare.description,e.commentOption);return{columnName:e.physicalName,logicalName:n.withLogicalName?e.logicalName:"",typeExpression:i,unsigned:e.columnShare.unsigned,notNull:e.columnModel.notNull,defaultValue:Tc(e.columnModel.defaultValue),autoIncrement:o.autoIncrement,comment:a}}static ofDatabaseColumn(e){let n=Xh(e.databaseType,e.typeQuery,e.declaredExpression),r=e.autoIncrement===!0?"":Tc(e.defaultValue??"");return{columnName:e.columnName,logicalName:"",typeExpression:n,unsigned:e.unsigned,notNull:e.notNull,defaultValue:r,autoIncrement:e.autoIncrement,comment:e.comment}}},Hh=(t,e)=>{let n=t.foreignColumn!=null,r=n?t.foreignColumn:t,o=e&&t.withAutoIncrement||n;return{resolvedType:r,autoIncrement:o}},Xh=(t,e,n)=>{let r=Er.find(t,e);return r==null?n.toUpperCase():Ic(r,String(e.precision??""),String(e.scale??""),e.isArray)},Ic=(t,e,n,r)=>t.specifiedType({precision:e,scale:n,isArray:r,inChildRelation:!1}).toUpperCase(),Tc=t=>{let e=t.trim();if(e===""||e.toUpperCase()==="NULL")return"";let n=e.replace(ef,"");return tf(n).trim().toUpperCase()},ef=/::([A-Za-z_][A-Za-z0-9_]*\.)?[A-Za-z_][A-Za-z0-9_ ]*(\[\])?$/,tf=t=>{let e=t.trim();return e.length>=2&&e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1).replaceAll("''","'"):e};var we=class{constructor(){}static toSchemaSnapshot(e,n){let r=e.getDatabase().databaseType,o=nf(e,n),i=rf(e,n),a=e.getTableViewModels().map(c=>af(e,c,n,i)),s=a.map(c=>c.table),l=a.flatMap(c=>c.warnings);return{databaseType:r,schemaNames:o,tables:s,warnings:l}}static toDeclaredTableSchemaNames(e){let n=e.tables.map(r=>r.schemaName).filter(r=>r!=="");return Array.from(new Set(n))}},nf=(t,e)=>{let n=t.getDatabase();if(n.supportsSchema===!1||e.withSchema===!1)return[];let r=t.schemaConfig.getSchemas().map(o=>o.schemaName);return r.length===0&&n.defaultSchemaName!==""?[n.defaultSchemaName]:r},rf=(t,e)=>{let n=new Map;return e.withForeignKey===!1||t.getRelationViewModels().forEach(r=>{let o=r.relationModel,i=of(t,o),a=n.get(o.childTableModelId)??[];a.push(i),n.set(o.childTableModelId,a)}),n},of=(t,e)=>{let r=t.findTableViewModel(e.parentTableModelId).tableModel,o=e.relationPairs.map(a=>Cc(t,a.childColumnModelId)),i=e.relationPairs.map(a=>Cc(t,a.parentColumnModelId));return{constraintName:"",columnNames:o,parentSchemaName:_c(t,r),parentTableName:r.physicalName,parentColumnNames:i,onUpdate:e.onUpdateAction,onDelete:e.onDeleteAction}},Cc=(t,e)=>{let n=t.findColumnModel(e),r=t.findColumnShareModel(n.columnShareModelId);return mt(n,r).physicalName},af=(t,e,n,r)=>{let o=t.getDatabase(),i=e.tableModel,a=_c(t,i),s=sf(t),l=lf(t,i,s,n),c=Ar(i.physicalName,i.logicalName,i.description,s),m=n.withLogicalName?i.logicalName:"",d=l.contexts.filter(b=>b.columnModel.primaryKey).map(b=>b.physicalName),h={schemaName:a,tableName:i.physicalName,logicalName:m,comment:c,columns:l.columns,primaryKeyColumnNames:d,uniqueKeys:df(i,l.contexts),indexes:mf(i,l.contexts,n,o.databaseType),foreignKeys:r.get(i.tableModelId)??[]},g=l.warnings.map(b=>({...b,schemaName:a,tableName:i.physicalName}));return{table:h,warnings:g}},_c=(t,e)=>{let n=t.getDatabase();if(n.supportsSchema===!1)return"";let r=t.findSchema(e.schemaId);return r!=null?r.schemaName:n.defaultSchemaName},sf=t=>{let e=t.erdSettingModel.exportDdlSetting;return{withComment:!0,commentStyle:e.commentStyle,commentSeparator:e.commentSeparator}},lf=(t,e,n,r)=>{let o=t.toAllColumnsWithStruct(e),i=o.filter(ce.isStructColumn).length,a=i>0?[{category:"struct.skipped",schemaName:"",tableName:"",message:`${i} struct column(s) are not supported by schema verification and were excluded from comparison.`}]:[],s=o.filter(ce.isSimpleColumn).map(c=>cf(t,c));return{columns:s.map(c=>uf(c,n,r)),contexts:s,warnings:a}},cf=(t,e)=>{let n=t.findColumnShareModel(e.columnShareModelId),r=mt(e,n);return{columnModelId:e.columnModelId,columnModel:e,columnShareModel:n,physicalName:r.physicalName,logicalName:r.logicalName}},uf=(t,e,n)=>{let r={columnModel:t.columnModel,columnShare:t.columnShareModel,physicalName:t.physicalName,logicalName:t.logicalName,commentOption:e};return yt.ofDesignedColumn(r,n)},df=(t,e)=>{let n=new Map(e.map(a=>[a.columnModelId,a.physicalName])),r=t.uniqueKeysModels.map(a=>{let s=a.uniqueKeysColumnModels.map(l=>n.get(l.columnModelId)).filter(l=>l!=null);return{constraintName:a.physicalName,columnNames:s}}),o=e.filter(a=>a.columnModel.unique).map(a=>({constraintName:"",columnNames:[a.physicalName]})),i=t.tableIndexModels.filter(a=>a.indexOption==="UNIQUE").map(a=>{let s=a.indexColumnModels.map(l=>n.get(l.columnModelId)).filter(l=>l!=null);return{constraintName:a.physicalName,columnNames:s}});return[...r,...o,...i]},mf=(t,e,n,r)=>{if(n.withIndex===!1)return[];let o=new Map(e.map(i=>[i.columnModelId,i.physicalName]));return t.tableIndexModels.filter(i=>i.indexOption!=="UNIQUE").map(i=>{let a=i.indexColumnModels.map(l=>o.get(l.columnModelId)).filter(l=>l!=null),s=pf(i.indexType,i.indexOption,r);return{indexName:i.physicalName,columnNames:a,indexOption:i.indexOption,indexType:s}})},pf=(t,e,n)=>t!==""||e==="FULLTEXT"||e==="SPATIAL"?t:hf[n],hf={postgres:"BTREE",mysql:"BTREE",mariadb:"BTREE",ms_sqlserver:"",sqlite:"",bigquery:"",snowflake:""};var Ft=(t,e)=>t.length===e.length&&t.every((n,r)=>n===e[r]);var Qt=class{constructor(){}static match(e,n,r){return ff(e,n,r)}},ff=(t,e,n)=>{let r=d=>n?`${d.schemaName} ${d.tableName}`:d.tableName,o=new Map(e.map(d=>[r(d),d])),i=new Map(e.map(d=>[r(d).toUpperCase(),d])),a=new Set,s=[],l=[],c=[];t.forEach(d=>{let h=r(d),g=o.get(h);if(g!=null){s.push({expected:d,actual:g}),a.add(r(g));return}let b=i.get(h.toUpperCase());if(b==null||a.has(r(b))){l.push(d);return}let y={expected:d,actual:b};s.push(y),c.push(y),a.add(r(b))});let m=e.filter(d=>a.has(r(d))===!1);return{pairs:s,missingExpected:l,unexpectedActual:m,caseFoldedPairs:c}};var pn=class{constructor(){}static compare(e,n,r){let o=Qt.match(e.tables,n.tables,r.withSchema),a=ee.get(n.databaseType).caseSensitiveColumnName,s=yf(e.schemaNames,n.schemaNames),l=o.missingExpected.map(b=>W("table.missing",b.schemaName,b.tableName,b.tableName,Pr,ve)),c=o.unexpectedActual.map(b=>W("table.unexpected",b.schemaName,b.tableName,b.tableName,ve,Pr)),m=o.pairs.map(b=>bf(b.expected,b.actual,r,a)),d=o.caseFoldedPairs.map(b=>gf(b)),h=[...s,...l,...c,...m.flatMap(b=>b.differences)],g=[...e.warnings,...n.warnings,...d,...m.flatMap(b=>b.warnings)];return{differences:h,warnings:g}}},gf=t=>({category:"name.caseFolded",schemaName:t.expected.schemaName,tableName:t.expected.tableName,message:`Table name differs only in case: design="${t.expected.tableName}" database="${t.actual.tableName}".`}),yf=(t,e)=>{let n=new Set(e),r=new Set(t),o=t.filter(a=>n.has(a)===!1).map(a=>W("schema.missing",a,"",a,Pr,ve)),i=e.filter(a=>r.has(a)===!1).map(a=>W("schema.unexpected",a,"",a,ve,Pr));return[...o,...i]},bf=(t,e,n,r)=>{let o=t.schemaName,i=t.tableName,a=n.withComment&&t.comment!==e.comment?[W("table.comment",o,i,i,Oe(t.comment),Oe(e.comment))]:[],s=Sf(t.columns,e.columns,n,o,i,r),l=xf(t.primaryKeyColumnNames,e.primaryKeyColumnNames,o,i),c=Tf(t.uniqueKeys,e.uniqueKeys,o,i),m=If(t.indexes,e.indexes,o,i),d=Cf(t.foreignKeys,e.foreignKeys,o,i);return{differences:[...a,...s.differences,...l,...c,...m,...d],warnings:s.warnings}},Sf=(t,e,n,r,o,i)=>{let a=new Map(e.map(y=>[y.columnName,y])),s=new Map(e.map(y=>[y.columnName.toUpperCase(),y])),l=new Set,c=[],m=[],d=[];t.forEach(y=>{let N=a.get(y.columnName),M=s.get(y.columnName.toUpperCase()),R=i===!1&&N==null&&M!=null&&l.has(M.columnName)===!1?M:null,v=N??R;if(v==null){let z=Nc(y),me=W("column.missing",r,o,y.columnName,Be(z),ve);c.push(me);return}l.add(v.columnName),d.push({expectedName:y.columnName,actualName:v.columnName}),R!=null&&m.push({category:"name.caseFolded",schemaName:r,tableName:o,message:`Column name differs only in case: design="${y.columnName}" database="${v.columnName}".`}),c.push(...Mf(y,v,n,r,o))}),e.filter(y=>l.has(y.columnName)===!1).forEach(y=>{let N=W("column.unexpected",r,o,y.columnName,ve,Be(Nc(y)));c.push(N)});let g=new Map(e.map((y,N)=>[y.columnName,N])),b=d.map(y=>g.get(y.actualName));if(wf(b)===!1){let y=e.filter(N=>l.has(N.columnName)).map(N=>N.columnName);m.push({category:"column.order",schemaName:r,tableName:o,message:`Column order differs (design: ${d.map(N=>N.expectedName).join(", ")} / database: ${y.join(", ")}).`})}return{differences:c,warnings:m}},wf=t=>t.every((e,n)=>n===0||t[n-1]<=e),Kn=t=>t.unsigned?`${t.typeExpression} UNSIGNED`:t.typeExpression,Nc=t=>{let e=Kn(t);return t.notNull?`${e} NOT NULL`:e},Mf=(t,e,n,r,o)=>{let i=t.columnName,a=[];if(Kn(t)!==Kn(e)){let c=W("column.type",r,o,i,Be(Kn(t)),Be(Kn(e)));a.push(c)}if(t.notNull!==e.notNull){let c=W("column.nullability",r,o,i,Be(vc(t.notNull)),Be(vc(e.notNull)));a.push(c)}if(t.defaultValue!==e.defaultValue){let c=W("column.default",r,o,i,Oe(t.defaultValue),Oe(e.defaultValue));a.push(c)}if(t.autoIncrement!==e.autoIncrement){let c=W("column.autoIncrement",r,o,i,Pc(t.autoIncrement),Pc(e.autoIncrement));a.push(c)}let s=n.withLogicalName&&t.logicalName!==e.logicalName;if(s){let c=W("column.logicalName",r,o,i,Oe(t.logicalName),Oe(e.logicalName));a.push(c)}let l=n.commentStyle==="logical_name"&&s;if(n.withComment&&l===!1&&t.comment!==e.comment){let c=W("column.comment",r,o,i,Oe(t.comment),Oe(e.comment));a.push(c)}return a},vc=t=>t?"NOT NULL":"NULL",xf=(t,e,n,r)=>Ft(t,e)?[]:[W("primaryKey",n,r,r,Ke(t),Ke(e))],zc=t=>t.length>0?`(${t.join(", ")})`:"",Tf=(t,e,n,r)=>{let o=[...e],i=[];return t.forEach(a=>{let s=o.findIndex(m=>Ft(m.columnNames,a.columnNames));if(s>=0){o.splice(s,1);return}let l=a.constraintName!==""?o.findIndex(m=>m.constraintName===a.constraintName):-1;if(l>=0){let m=o[l];o.splice(l,1);let d=W("uniqueKey.columns",n,r,a.constraintName,Ke(a.columnNames),Ke(m.columnNames));i.push(d);return}let c=W("uniqueKey.missing",n,r,Ec(a),Ke(a.columnNames),ve);i.push(c)}),o.forEach(a=>{let s=W("uniqueKey.unexpected",n,r,Ec(a),ve,Ke(a.columnNames));i.push(s)}),i},Ec=t=>t.constraintName!==""?t.constraintName:zc(t.columnNames),If=(t,e,n,r)=>{let o=[...e],i=[];return t.forEach(a=>{let s=o.findIndex(d=>d.indexName.toUpperCase()===a.indexName.toUpperCase()),l=s<0?o.findIndex(d=>Ft(d.columnNames,a.columnNames)):-1,c=s>=0?s:l;if(c<0){let d=W("index.missing",n,r,a.indexName,Ke(a.columnNames),ve);i.push(d);return}let m=o[c];if(o.splice(c,1),Ft(a.columnNames,m.columnNames)===!1){let d=W("index.columns",n,r,a.indexName,Ke(a.columnNames),Ke(m.columnNames));i.push(d)}if(Rr(a)!==Rr(m)){let d=W("index.type",n,r,a.indexName,Oe(Rr(a)),Oe(Rr(m)));i.push(d)}}),o.forEach(a=>{let s=W("index.unexpected",n,r,a.indexName,ve,Ke(a.columnNames));i.push(s)}),i},Rr=t=>{let e=[t.indexOption,t.indexType].filter(n=>n!=="");return e.length>0?e.join(" "):""},Cf=(t,e,n,r)=>{let o=[...e],i=[];return t.forEach(a=>{let s=o.findIndex(c=>_f(a,c));if(s<0){let c=Xo(a),m=W("foreignKey.missing",n,r,c,Be(Ac(a)),ve);i.push(m);return}let l=o[s];if(o.splice(s,1),a.onUpdate!==l.onUpdate||a.onDelete!==l.onDelete){let c=Xo(a),m=W("foreignKey.reference",n,r,c,Be(Rc(a)),Be(Rc(l)));i.push(m)}}),o.forEach(a=>{let s=Xo(a),l=W("foreignKey.unexpected",n,r,s,ve,Be(Ac(a)));i.push(l)}),i},_f=(t,e)=>Ft(t.columnNames,e.columnNames)&&t.parentSchemaName===e.parentSchemaName&&t.parentTableName===e.parentTableName&&Ft(t.parentColumnNames,e.parentColumnNames),Xo=t=>t.columnNames.join(", "),Ac=t=>`${t.parentSchemaName!==""?`${t.parentSchemaName}.${t.parentTableName}`:t.parentTableName} (${t.parentColumnNames.join(", ")})`,Rc=t=>`ON UPDATE ${t.onUpdate} ON DELETE ${t.onDelete}`,W=(t,e,n,r,o,i)=>({category:t,schemaName:e,tableName:n,targetName:r,expected:o,actual:i}),Be=t=>({state:"value",text:t}),Oe=t=>t!==""?{state:"value",text:t}:{state:"blank"},Ke=t=>{let e=zc(t);return Oe(e)},Pc=t=>t?{state:"value",text:"AUTO_INCREMENT"}:{state:"blank"},ve={state:"absent"},Pr={state:"present"};var hn=class{constructor(){}static format(e,n,r){let o=Nf(e.warnings);return r==="json"?{stdout:vf(e,n),stderr:o}:r==="markdown"?{stdout:Df(e,n),stderr:o}:{stdout:Ef(e,n),stderr:o}}},Nf=t=>t.length===0?"":`${t.map(n=>`warn: ${n.message}`).join(`
|
|
29
29
|
`)}
|
|
30
30
|
`,vf=(t,e)=>JSON.stringify({direction:e.direction,databaseType:e.databaseType,expected:e.expectedLabel,actual:e.actualLabel,ignoredTableNames:e.ignoredTableNames,differences:t.differences,warnings:t.warnings}),$c=(t,e)=>e==="designToDatabase"?{left:t.expected,right:t.actual}:{left:t.actual,right:t.expected},Ef=(t,e)=>{let n=Af(e);if(t.differences.length===0)return`${n}
|